posthog-js 1.429.2 → 1.429.3

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.
Files changed (61) hide show
  1. package/dist/all-external-dependencies.js +1 -1
  2. package/dist/all-external-dependencies.js.map +1 -1
  3. package/dist/array.full.es5.js +1 -1
  4. package/dist/array.full.es5.js.map +1 -1
  5. package/dist/array.full.js +1 -1
  6. package/dist/array.full.js.map +1 -1
  7. package/dist/array.full.no-external.js +1 -1
  8. package/dist/array.full.no-external.js.map +1 -1
  9. package/dist/array.js +1 -1
  10. package/dist/array.js.map +1 -1
  11. package/dist/array.no-external.js +1 -1
  12. package/dist/array.no-external.js.map +1 -1
  13. package/dist/conversations.js +1 -1
  14. package/dist/customizations.d.ts +2 -0
  15. package/dist/customizations.full.js +1 -1
  16. package/dist/customizations.js +1 -1
  17. package/dist/dead-clicks-autocapture.js +1 -1
  18. package/dist/default-extensions.js +1 -1
  19. package/dist/default-extensions.js.map +1 -1
  20. package/dist/exception-autocapture.js +1 -1
  21. package/dist/extension-bundles.js +1 -1
  22. package/dist/extension-bundles.js.map +1 -1
  23. package/dist/lazy-recorder.js +1 -1
  24. package/dist/main.d.ts +2 -0
  25. package/dist/main.js +1 -1
  26. package/dist/main.js.map +1 -1
  27. package/dist/module.d.ts +2 -0
  28. package/dist/module.full.d.ts +2 -0
  29. package/dist/module.full.js +1 -1
  30. package/dist/module.full.js.map +1 -1
  31. package/dist/module.full.no-external.d.ts +2 -0
  32. package/dist/module.full.no-external.js +1 -1
  33. package/dist/module.full.no-external.js.map +1 -1
  34. package/dist/module.js +1 -1
  35. package/dist/module.js.map +1 -1
  36. package/dist/module.mjs +1 -1
  37. package/dist/module.mjs.map +1 -1
  38. package/dist/module.no-external.d.ts +2 -0
  39. package/dist/module.no-external.js +1 -1
  40. package/dist/module.no-external.js.map +1 -1
  41. package/dist/module.slim.js +1 -1
  42. package/dist/module.slim.js.map +1 -1
  43. package/dist/module.slim.no-external.d.ts +2 -0
  44. package/dist/module.slim.no-external.js +1 -1
  45. package/dist/module.slim.no-external.js.map +1 -1
  46. package/dist/posthog-recorder.js +1 -1
  47. package/dist/product-tours.js +1 -1
  48. package/dist/src/extensions/surveys.d.ts +2 -0
  49. package/dist/surveys-preview.js.map +1 -1
  50. package/dist/surveys.d.ts +2 -0
  51. package/dist/surveys.js +1 -1
  52. package/dist/surveys.js.map +1 -1
  53. package/lib/package.json +1 -1
  54. package/lib/src/extensions/surveys.d.ts +2 -0
  55. package/lib/src/extensions/surveys.js +18 -1
  56. package/lib/src/extensions/surveys.js.map +1 -1
  57. package/lib/src/feature-flags-config.js +5 -5
  58. package/lib/src/feature-flags-config.js.map +1 -1
  59. package/lib/src/posthog-core.js +3 -7
  60. package/lib/src/posthog-core.js.map +1 -1
  61. package/package.json +4 -4
@@ -1,2 +1,2 @@
1
- !function(t){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="u">typeof window?window:void 0,n="u">typeof globalThis?globalThis:e,o=null==n?void 0:n.navigator,r=null==n?void 0:n.document;null!=n&&n.XMLHttpRequest&&new n.XMLHttpRequest;const i=null==o?void 0:o.userAgent;var l,s,u,a,c,d,h,f,p,v,m,g,b,y,w,_={},x=[],k=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,T=Array.isArray;function C(t,e){for(var n in e)t[n]=e[n];return t}function S(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function q(t,e,n,o,r){var i={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=s.vnode&&s.vnode(i),i}function A(t){return t.children}function M(t,e){this.props=t,this.context=e}function $(t,e){if(null==e)return t.__?$(t.__,t.__i+1):null;for(var n;t.__k.length>e;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?$(t):null}function j(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,o=[],r=[],i=C({},e);i.__v=e.__v+1,s.vnode&&s.vnode(i),F(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,o,null==n?$(e):n,!!(32&e.__u),r),i.__v=e.__v,i.__.__k[i.__i]=i,H(o,i,r),e.__e=e.__=null,i.__e!=n&&E(i)}}function E(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),E(t)}function I(t){(!t.__d&&(t.__d=!0)&&a.push(t)&&!L.__r++||c!=s.debounceRendering)&&((c=s.debounceRendering)||d)(L)}function L(){try{for(var t,e=1;a.length;)a.length>e&&a.sort(h),t=a.shift(),e=a.length,j(t)}finally{a.length=L.__r=0}}function z(t,e,n,o,r,i,l,s,u,a,c){var d,h,f,p,v,m,g,b=o&&o.__k||x,y=e.length;for(u=O(n,e,b,u,y),d=0;y>d;d++)null!=(f=n.__k[d])&&(h=-1!=f.__i&&b[f.__i]||_,f.__i=d,m=F(t,f,h,r,i,l,s,u,a,c),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&Q(h.ref,null,f),c.push(f.ref,f.__c||p,f)),null==v&&null!=p&&(v=p),(g=!!(4&f.__u))||h.__k===f.__k?(u=D(f,u,t,g),g&&h.__e&&(h.__e=null)):"function"==typeof f.type&&void 0!==m?u=m:p&&(u=p.nextSibling),f.__u&=-7);return n.__e=v,u}function O(t,e,n,o,r){var i,l,s,u,a,c=n.length,d=c,h=0;for(t.__k=new Array(r),i=0;r>i;i++)null!=(l=e[i])&&"boolean"!=typeof l&&"function"!=typeof l?("string"==typeof l||"number"==typeof l||"bigint"==typeof l||l.constructor==String?l=t.__k[i]=q(null,l,null,null,null):T(l)?l=t.__k[i]=q(A,{children:l},null,null,null):void 0===l.constructor&&l.__b>0?l=t.__k[i]=q(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):t.__k[i]=l,u=i+h,l.__=t,l.__b=t.__b+1,s=null,-1!=(a=l.__i=P(l,n,u,d))&&(d--,(s=n[a])&&(s.__u|=2)),null==s||null==s.__v?(-1==a&&(r>c?h--:c>r&&h++),"function"!=typeof l.type&&(l.__u|=4)):a!=u&&(a==u-1?h--:a==u+1?h++:(a>u?h--:h++,l.__u|=4))):t.__k[i]=null;if(d)for(i=0;c>i;i++)null!=(s=n[i])&&!(2&s.__u)&&(s.__e==o&&(o=$(s)),W(s,s));return o}function D(t,e,n,o){var r,i;if("function"==typeof t.type){for(r=t.__k,i=0;r&&r.length>i;i++)r[i]&&(r[i].__=t,e=D(r[i],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=$(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function P(t,e,n,o){var r,i,l,s=t.key,u=t.type,a=e[n],c=null!=a&&!(2&a.__u);if(null===a&&null==s||c&&s==a.key&&u==a.type)return n;if(o>(c?1:0))for(r=n-1,i=n+1;r>=0||e.length>i;)if(null!=(a=e[l=0>r?i++:r--])&&!(2&a.__u)&&s==a.key&&u==a.type)return l;return-1}function R(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||k.test(e)?n:n+"px"}function N(t,e,n,o,r){var i,l;t:if("style"==e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||R(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||R(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])i=e!=(e=e.replace(m,"$1")),l=e.toLowerCase(),e=l in t||"onFocusOut"==e||"onFocusIn"==e?l.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?o?n[v]=o[v]:(n[v]=g,t.addEventListener(e,i?y:b,i)):t.removeEventListener(e,i?y:b,i);else{if("http://www.w3.org/2000/svg"==r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function Z(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e[p])e[p]=g++;else if(n[v]>e[p])return;return n(s.event?s.event(e):e)}}}function F(t,e,n,o,r,i,l,u,a,c){var d,h,f,p,v,m,g,b,y,w,$,_,k,q,j,E,I=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(a=!!(32&n.__u),i=[u=e.__e=n.__e]),(d=s.__b)&&d(e);t:if("function"==typeof I){h=l.length;try{if(y=e.props,w=I.prototype&&I.prototype.render,$=(d=I.contextType)&&o[d.__c],_=d?$?$.props.value:d.__:o,n.__c?b=(f=e.__c=n.__c).__=f.__E:(w?e.__c=f=new I(y,_):(e.__c=f=new M(y,_),f.constructor=I,f.render=Y),$&&$.sub(f),f.state||(f.state={}),f.__n=o,p=f.__d=!0,f.__h=[],f._sb=[]),w&&null==f.__s&&(f.__s=f.state),w&&null!=I.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=C({},f.__s)),C(f.__s,I.getDerivedStateFromProps(y,f.__s))),v=f.props,m=f.state,f.__v=e,p)w&&null==I.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),w&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(w&&null==I.getDerivedStateFromProps&&y!==v&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(y,_),e.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(y,f.__s,_)){e.__v!=n.__v&&(f.props=y,f.state=f.__s,f.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(t){t&&(t.__=e)}),x.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&l.push(f);break t}null!=f.componentWillUpdate&&f.componentWillUpdate(y,f.__s,_),w&&null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(v,m,g)})}if(f.context=_,f.props=y,f.__P=t,f.__e=!1,k=s.__r,q=0,w)f.state=f.__s,f.__d=!1,k&&k(e),d=f.render(f.props,f.state,f.context),x.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,k&&k(e),d=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&25>++q);f.state=f.__s,null!=f.getChildContext&&(o=C(C({},o),f.getChildContext())),w&&!p&&null!=f.getSnapshotBeforeUpdate&&(g=f.getSnapshotBeforeUpdate(v,m)),j=null!=d&&d.type===A&&null==d.key?V(d.props.children):d,u=z(t,T(j)?j:[j],e,n,o,r,i,l,u,a,c),f.base=e.__e,e.__u&=-161,f.__h.length&&l.push(f),b&&(f.__E=f.__=null)}catch(t){if(l.length=h,e.__v=null,a||null!=i)if(t.then){for(e.__u|=a?160:128;u&&8==u.nodeType&&u.nextSibling;)u=u.nextSibling;null!=i&&(i[i.indexOf(u)]=null),e.__e=u}else{if(null!=i)for(E=i.length;E--;)S(i[E]);B(e)}else e.__e=n.__e,!e.__k&&n.__k&&(e.__k=n.__k),t.then||B(e);s.__e(t,e,n)}}else null==i&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):u=e.__e=U(n.__e,e,n,o,r,i,l,a,c);return(d=s.diffed)&&d(e),128&e.__u?void 0:u}function B(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(B))}function H(t,e,n){for(var o=0;n.length>o;o++)Q(n[o],n[++o],n[++o]);s.__c&&s.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){s.__e(t,e.__v)}})}function V(t){return"object"!=typeof t||null==t||t.__b>0?t:T(t)?t.map(V):void 0!==t.constructor?null:C({},t)}function U(t,e,n,o,r,i,u,a,c){var d,h,f,p,v,m,g,b=n.props||_,y=e.props,w=e.type;if("svg"==w?r="http://www.w3.org/2000/svg":"math"==w?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=i)for(d=0;i.length>d;d++)if((v=i[d])&&"setAttribute"in v==!!w&&(w?v.localName==w:3==v.nodeType)){t=v,i[d]=null;break}if(null==t){if(null==w)return document.createTextNode(y);t=document.createElementNS(r,w,y.is&&y),a&&(s.__m&&s.__m(e,i),a=!1),i=null}if(null==w)b===y||a&&t.data==y||(t.data=y);else{if(i="textarea"==w&&null!=y.defaultValue?null:i&&l.call(t.childNodes),!a&&null!=i)for(b={},d=0;t.attributes.length>d;d++)b[(v=t.attributes[d]).name]=v.value;for(d in b)v=b[d],"dangerouslySetInnerHTML"==d?f=v:"children"==d||d in y||"value"==d&&"defaultValue"in y||"checked"==d&&"defaultChecked"in y||N(t,d,null,v,r);for(d in y)v=y[d],"children"==d?p=v:"dangerouslySetInnerHTML"==d?h=v:"value"==d?m=v:"checked"==d?g=v:a&&"function"!=typeof v||b[d]===v||N(t,d,v,b[d],r);if(h)a||f&&(h.__html==f.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(f&&(t.innerHTML=""),z("template"==e.type?t.content:t,T(p)?p:[p],e,n,o,"foreignObject"==w?"http://www.w3.org/1999/xhtml":r,i,u,i?i[0]:n.__k&&$(n,0),a,c),null!=i)for(d=i.length;d--;)S(i[d]);a&&"textarea"!=w||(d="value","progress"==w&&null==m?t.removeAttribute("value"):null!=m&&(m!==t[d]||"progress"==w&&!m||"option"==w&&m!=b[d])&&N(t,d,m,b[d],r),d="checked",null!=g&&g!=t[d]&&N(t,d,g,b[d],r))}return t}function Q(t,e,n){try{if("function"==typeof t){var o="function"==typeof t.__u;o&&t.__u(),o&&null==e||(t.__u=t(e))}else t.current=e}catch(t){s.__e(t,n)}}function W(t,e,n){var o,r;if(s.unmount&&s.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||Q(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){s.__e(t,e)}o.base=o.__P=o.__n=null}if(o=t.__k)for(r=0;o.length>r;r++)o[r]&&W(o[r],e,n||"function"!=typeof t.type);n||S(t.__e),t.__c=t.__=t.__e=void 0}function Y(t,e,n){return this.constructor(t,n)}function G(t,e,n){var o,r,i,u;e==document&&(e=document.documentElement),s.__&&s.__(t,e),r=(o="function"==typeof n)?null:n&&n.__k||e.__k,i=[],u=[],F(e,t=(!o&&n||e).__k=function(t,e,n){var o,r,i,s={};for(i in e)"key"==i?o=e[i]:"ref"==i?r=e[i]:s[i]=e[i];if(arguments.length>2&&(s.children=arguments.length>3?l.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(i in t.defaultProps)void 0===s[i]&&(s[i]=t.defaultProps[i]);return q(t,s,o,r,null)}(A,null,[t]),r||_,_,e.namespaceURI,!o&&n?[n]:r?null:e.firstChild?l.call(e.childNodes):null,i,!o&&n?n:r?r.__e:e.firstChild,o,u),H(i,t,u),t.props.children=null}l=x.slice,s={__e(t,e,n,o){for(var r,i,l;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(t)),l=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,o||{}),l=r.__d),l)return r.__E=r}catch(e){t=e}throw t}},u=0,M.prototype.setState=function(t,e){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=C({},this.state);"function"==typeof t&&(t=t(C({},n),this.props)),t&&C(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),I(this))},M.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),I(this))},M.prototype.render=A,a=[],d="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,h=function(t,e){return t.__v.__b-e.__v.__b},L.__r=0,f=Math.random().toString(8),p="__d"+f,v="__a"+f,m=/(PointerCapture)$|Capture$/i,g=0,b=Z(!1),y=Z(!0),w=0;const K={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},J="product tour shown",X="$product_tour_id",tt="$product_tour_name",et="$product_tour_iteration",nt="$product_tour_render_reason",ot="$product_tour_step_id",rt="$product_tour_step_order",it="$product_tour_step_type",lt="$product_tour_dismiss_reason",st="$product_tour_button_text",ut="$product_tour_button_action",at="$product_tour_button_link",ct="$product_tour_button_tour_id",dt="$product_tour_steps_count",ht="$product_tour_step_selector",ft="$product_tour_step_selector_found",pt="$product_tour_step_element_tag",vt="$product_tour_step_element_id",mt="$product_tour_step_element_classes",gt="$product_tour_step_element_text",bt="$product_tour_error",yt="$product_tour_matches_count",wt="$product_tour_failure_phase",_t="$product_tour_waited_for_element",xt="$product_tour_wait_duration_ms",kt="$product_tour_banner_selector",Tt="$product_tour_linked_survey_id",Ct="$use_manual_selector",$t="$inference_data_present",St="$product_tour_type",qt="events",At="cancelEvents",Mt="$survey_id",jt="$survey_partially_completed",Et="$survey_questions",It="$survey_completed",Lt="$product_tour_id",zt=Object.prototype,Ot=zt.hasOwnProperty,Dt=zt.toString,Pt=Array.isArray||function(t){return"[object Array]"===Dt.call(t)},Rt=t=>"function"==typeof t,Nt=t=>void 0===t,Zt=t=>null===t,Ft=t=>Nt(t)||Zt(t),Bt=t=>"[object Number]"==Dt.call(t)&&t==t,Ht=(t,e,n)=>{function o(o,...r){e(()=>{(0,n[o])(t,...r)})}return{debug(...t){o("debug",...t)},info(...t){o("log",...t)},warn(...t){o("warn",...t)},error(...t){o("error",...t)},critical(...e){n.error(t,...e)},createLogger:o=>Ht(`${t} ${o}`,e,n)}},Vt=t=>t(),Ut="Mobile",Qt="Tablet",Wt="Android Tablet",Yt="iPad",Gt="Apple Watch",Kt="Nintendo",Jt="PlayStation",Xt="Xbox",te="Nokia",ee="Ouya",ne="Generic "+Ut.toLowerCase(),oe="Generic "+Qt.toLowerCase(),re=new RegExp(Xt,"i"),ie=new RegExp("PlayStation \\w+","i"),le=new RegExp("Nintendo \\w+","i"),se=new RegExp("BlackBerry|PlayBook|BB10","i");new RegExp(Kt,"i"),new RegExp(Jt,"i"),new RegExp("Windows","i");function ue(t){return ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ue(t)}function ae(t,e,n){return(e=function(t){var e=function(t){if("object"!=ue(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ue(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ue(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ce(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function de(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ce(Object(n),!0).forEach(function(e){ae(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function he(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);e>n;n++)o[n]=t[n];return o}function fe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,l,s=[],u=!0,a=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(u=(o=i.call(n)).done)&&(s.push(o.value),s.length!==e);u=!0);}catch(t){a=!0,r=t}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(a)throw r}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return he(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?he(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const pe=Object.entries,ve=Object.setPrototypeOf,me=Object.isFrozen,ge=Object.getPrototypeOf,be=Object.getOwnPropertyDescriptor;let ye=Object.freeze,we=Object.seal,_e=Object.create,xe="undefined"!=typeof Reflect&&Reflect,ke=xe.apply,Te=xe.construct;ye||(ye=function(t){return t}),we||(we=function(t){return t}),ke||(ke=function(t,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;n>r;r++)o[r-2]=arguments[r];return t.apply(e,o)}),Te||(Te=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;e>o;o++)n[o-1]=arguments[o];return new t(...n)});const Ce=Ue([].forEach),$e=Ue([].lastIndexOf),Se=Ue([].pop),qe=Ue([].push),Ae=Ue([].splice),Me=Array.isArray,je=Ue("".toLowerCase),Ee=Ue("".toString),Ie=Ue("".match),Le=Ue("".replace),ze=Ue("".indexOf),Oe=Ue("".trim),De=Ue((0).toString),Pe=Ue(Boolean.prototype.toString),Re="undefined"==typeof BigInt?null:Ue(BigInt.prototype.toString),Ne="undefined"==typeof Symbol?null:Ue(Symbol.prototype.toString),Ze=Ue({}.hasOwnProperty),Fe=Ue({}.toString),Be=Ue(/t/.test),He=(Ve=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];return Te(Ve,e)});var Ve;function Ue(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;n>r;r++)o[r-1]=arguments[r];return ke(t,e,o)}}function Qe(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:je;if(ve&&ve(t,null),!Me(e))return t;let o=e.length;for(;o--;){let r=e[o];if("string"==typeof r){const t=n(r);t!==r&&(me(e)||(e[o]=t),r=t)}t[r]=!0}return t}function We(t){for(let e=0;t.length>e;e++)Ze(t,e)||(t[e]=null);return t}function Ye(t){const e=_e(null);for(const o of pe(t)){var n=fe(o,2);const r=n[0],i=n[1];Ze(t,r)&&(e[r]=Me(i)?We(i):i&&"object"==typeof i&&i.constructor===Object?Ye(i):i)}return e}function Ge(t,e){for(;null!==t;){const n=be(t,e);if(n){if(n.get)return Ue(n.get);if("function"==typeof n.value)return Ue(n.value)}t=ge(t)}return function(){return null}}const Ke=ye(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Je=ye(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Xe=ye(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),tn=ye(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),en=ye(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),nn=ye(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),on=ye(["#text"]),rn=ye(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),ln=ye(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),sn=ye(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),un=ye(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),an=we(/{{[\w\W]*|^[\w\W]*}}/g),cn=we(/<%[\w\W]*|^[\w\W]*%>/g),dn=we(/\${[\w\W]*/g),hn=we(/^data-[\-\w.\u00B7-\uFFFF]+$/),fn=we(/^aria-[\-\w]+$/),pn=we(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vn=we(/^(?:\w+script|data):/i),mn=we(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gn=we(/^html$/i),bn=we(/^[a-z][.\w]*(-[.\w]+)+$/i),yn=we(/<[/\w!]/g),wn=we(/<[/\w]/g),_n=we(/<\/no(script|embed|frames)/i),xn=we(/\/>/i),kn=function(){return"undefined"==typeof window?null:window},Tn=function(t,e,n,o){return Ze(t,e)&&Me(t[e])?Qe(o.base?Ye(o.base):{},t[e],o.transform):n};var Cn=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:kn();const n=e=>t(e);if(n.version="3.4.13",n.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return n.isSupported=!1,n;let o=e.document;const r=o,i=r.currentScript,l=e.HTMLTemplateElement,s=e.Node,u=e.NodeFilter,a=e.DOMParser,c=e.trustedTypes,d=e.Element.prototype,h=Ge(d,"cloneNode"),f=Ge(d,"remove"),p=Ge(d,"nextSibling"),v=Ge(d,"childNodes"),m=Ge(d,"parentNode"),g=Ge(d,"shadowRoot"),b=Ge(d,"attributes"),y=s&&s.prototype?Ge(s.prototype,"nodeType"):null,w=s&&s.prototype?Ge(s.prototype,"nodeName"):null,_=s&&s.prototype?Ge(s.prototype,"ownerDocument"):null;if("function"==typeof l){const t=o.createElement("template");t.content&&t.content.ownerDocument&&(o=t.content.ownerDocument)}let x,k,T="",C=!1,S=0;const q=function(){if(S>0)throw He('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},A=function(t){q(),S++;try{return x.createHTML(t)}finally{S--}},M=o.implementation,j=o.createNodeIterator,E=o.createDocumentFragment,I=o.getElementsByTagName,L=r.importNode;let z={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof pe&&"function"==typeof m&&M&&void 0!==M.createHTMLDocument;const O=an,D=cn,P=dn,R=hn,N=fn,Z=vn,F=mn,B=bn;let H=pn,V=null;const U=Qe({},[...Ke,...Je,...Xe,...en,...on]);let Q=null;const W=Qe({},[...rn,...ln,...sn,...un]);let Y=Object.seal(_e(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,K=null;const J=Object.seal(_e(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let X=!0,tt=!0,et=!1,nt=!0,ot=!1,rt=!0,it=!1,lt=!1,st=null,ut=null,at=!1,ct=!1,dt=!1,ht=!1,ft=!0,pt=!1;const vt="user-content-";let mt=!0,gt=!1,bt={},yt=null;const wt=Qe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let _t=null;const xt=Qe({},["audio","video","img","source","image","track"]);let kt=null;const Tt=Qe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ct="http://www.w3.org/1998/Math/MathML",$t="http://www.w3.org/2000/svg",St="http://www.w3.org/1999/xhtml";let qt=St,At=!1,Mt=null;const jt=Qe({},[Ct,$t,St],Ee),Et=ye(["mi","mo","mn","ms","mtext"]);let It=Qe({},Et);const Lt=ye(["annotation-xml"]);let zt=Qe({},Lt);const Ot=Qe({},["title","style","font","a","script"]);let Dt=null;const Pt=["application/xhtml+xml","text/html"];let Rt=null,Nt=null;const Zt=o.createElement("form"),Ft=function(t){return t instanceof RegExp||t instanceof Function},Bt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Nt&&Nt===t)return;t&&"object"==typeof t||(t={}),t=Ye(t),Dt=-1===Pt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Rt="application/xhtml+xml"===Dt?Ee:je,V=Tn(t,"ALLOWED_TAGS",U,{transform:Rt}),Q=Tn(t,"ALLOWED_ATTR",W,{transform:Rt}),Mt=Tn(t,"ALLOWED_NAMESPACES",jt,{transform:Ee}),kt=Tn(t,"ADD_URI_SAFE_ATTR",Tt,{transform:Rt,base:Tt}),_t=Tn(t,"ADD_DATA_URI_TAGS",xt,{transform:Rt,base:xt}),yt=Tn(t,"FORBID_CONTENTS",wt,{transform:Rt}),G=Tn(t,"FORBID_TAGS",Ye({}),{transform:Rt}),K=Tn(t,"FORBID_ATTR",Ye({}),{transform:Rt}),bt=!!Ze(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?Ye(t.USE_PROFILES):t.USE_PROFILES),X=!1!==t.ALLOW_ARIA_ATTR,tt=!1!==t.ALLOW_DATA_ATTR,et=t.ALLOW_UNKNOWN_PROTOCOLS||!1,nt=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ot=t.SAFE_FOR_TEMPLATES||!1,rt=!1!==t.SAFE_FOR_XML,it=t.WHOLE_DOCUMENT||!1,ct=t.RETURN_DOM||!1,dt=t.RETURN_DOM_FRAGMENT||!1,ht=t.RETURN_TRUSTED_TYPE||!1,at=t.FORCE_BODY||!1,ft=!1!==t.SANITIZE_DOM,pt=t.SANITIZE_NAMED_PROPS||!1,mt=!1!==t.KEEP_CONTENT,gt=t.IN_PLACE||!1,H=function(t){try{return Be(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:pn,qt="string"==typeof t.NAMESPACE?t.NAMESPACE:St,It=Ze(t,"MATHML_TEXT_INTEGRATION_POINTS")&&t.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof t.MATHML_TEXT_INTEGRATION_POINTS?Ye(t.MATHML_TEXT_INTEGRATION_POINTS):Qe({},Et),zt=Ze(t,"HTML_INTEGRATION_POINTS")&&t.HTML_INTEGRATION_POINTS&&"object"==typeof t.HTML_INTEGRATION_POINTS?Ye(t.HTML_INTEGRATION_POINTS):Qe({},Lt);const e=Ze(t,"CUSTOM_ELEMENT_HANDLING")&&t.CUSTOM_ELEMENT_HANDLING&&"object"==typeof t.CUSTOM_ELEMENT_HANDLING?Ye(t.CUSTOM_ELEMENT_HANDLING):_e(null);if(Y=_e(null),Ze(e,"tagNameCheck")&&Ft(e.tagNameCheck)&&(Y.tagNameCheck=e.tagNameCheck),Ze(e,"attributeNameCheck")&&Ft(e.attributeNameCheck)&&(Y.attributeNameCheck=e.attributeNameCheck),Ze(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(Y.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),we(Y),ot&&(tt=!1),dt&&(ct=!0),bt&&(V=Qe({},on),Q=_e(null),!0===bt.html&&(Qe(V,Ke),Qe(Q,rn)),!0===bt.svg&&(Qe(V,Je),Qe(Q,ln),Qe(Q,un)),!0===bt.svgFilters&&(Qe(V,Xe),Qe(Q,ln),Qe(Q,un)),!0===bt.mathMl&&(Qe(V,en),Qe(Q,sn),Qe(Q,un))),J.tagCheck=null,J.attributeCheck=null,Ze(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?J.tagCheck=t.ADD_TAGS:Me(t.ADD_TAGS)&&(V===U&&(V=Ye(V)),Qe(V,t.ADD_TAGS,Rt))),Ze(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?J.attributeCheck=t.ADD_ATTR:Me(t.ADD_ATTR)&&(Q===W&&(Q=Ye(Q)),Qe(Q,t.ADD_ATTR,Rt))),Ze(t,"ADD_URI_SAFE_ATTR")&&Me(t.ADD_URI_SAFE_ATTR)&&Qe(kt,t.ADD_URI_SAFE_ATTR,Rt),Ze(t,"FORBID_CONTENTS")&&Me(t.FORBID_CONTENTS)&&(yt===wt&&(yt=Ye(yt)),Qe(yt,t.FORBID_CONTENTS,Rt)),Ze(t,"ADD_FORBID_CONTENTS")&&Me(t.ADD_FORBID_CONTENTS)&&(yt===wt&&(yt=Ye(yt)),Qe(yt,t.ADD_FORBID_CONTENTS,Rt)),mt&&(V["#text"]=!0),it&&Qe(V,["html","head","body"]),V.table&&(Qe(V,["tbody"]),delete G.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw He('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw He('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=x;x=t.TRUSTED_TYPES_POLICY;try{T=A("")}catch(t){throw x=e,t}}else null===t.TRUSTED_TYPES_POLICY?(x=void 0,T=""):(void 0===x&&(C||(k=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";e&&e.hasAttribute(o)&&(n=e.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(c,i),C=!0),x=k),x&&"string"==typeof T&&(T=A("")));ye&&ye(t),Nt=t},Ht=Qe({},[...Je,...Xe,...tn]),Vt=Qe({},[...en,...nn]),Ut=function(t){qe(n.removed,{element:t});try{m(t).removeChild(t)}catch(e){if(f(t),!m(t))throw He("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Qt=function(t){Gt(t);const e=v(t);if(e){const t=[];Ce(e,e=>{qe(t,e)}),Ce(t,t=>{try{f(t)}catch(t){}})}const n=b(t);if(n)for(let e=n.length-1;e>=0;--e){const o=n[e],r=o&&o.name;if("string"==typeof r)try{t.removeAttribute(r)}catch(t){}}},Wt=function(t,e){try{qe(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){qe(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(ct||dt)try{Ut(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},Yt=function(t){const e=b(t);if(e)for(let n=e.length-1;n>=0;--n){const o=e[n],r=o&&o.name;if("string"==typeof r&&!Q[Rt(r)])try{t.removeAttribute(r)}catch(t){}}},Gt=function(t){const e=[t];for(;e.length>0;){const t=e.pop();1===(y?y(t):t.nodeType)&&Yt(t);const n=v(t);if(n)for(let t=n.length-1;t>=0;--t)e.push(n[t])}},Kt=function(t){let e=null,n=null;if(at)t="<remove></remove>"+t;else{const e=Ie(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Dt&&qt===St&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=x?A(t):t;if(qt===St)try{e=(new a).parseFromString(r,Dt)}catch(t){}if(!e||!e.documentElement){e=M.createDocument(qt,"template",null);try{e.documentElement.innerHTML=At?T:r}catch(t){}}const i=e.body||e.documentElement;return t&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),qt===St?I.call(e,it?"html":"body")[0]:it?e.documentElement:i},Jt=function(t){const e=_?_(t):t.ownerDocument;return j.call(e||t,t,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Xt=function(t){return t=Le(t,O," "),t=Le(t,D," "),Le(t,P," ")},te=function(t){var e;t.normalize();const n=_?_(t):t.ownerDocument,o=j.call(n||t,t,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let r=o.nextNode();for(;r;)r.data=Xt(r.data),r=o.nextNode();const i=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");i&&Ce(i,t=>{ne(t.content)&&te(t.content)})},ee=function(t){const e=w?w(t):null;return"string"==typeof e&&"form"===Rt(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==b(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==y(t)||t.childNodes!==v(t))},ne=function(t){if(!y||"object"!=typeof t||null===t)return!1;try{return 11===y(t)}catch(t){return!1}},oe=function(t){if(!y||"object"!=typeof t||null===t)return!1;try{return"number"==typeof y(t)}catch(t){return!1}};function re(t,e,o){0!==t.length&&Ce(t,t=>{t.call(n,e,o,Nt)})}const ie=function(t,e,n,o){return 0===t.length?e:e===n||e===o?Ye(e):e},le=function(t,e){if(re(z.beforeSanitizeElements,t,null),t!==e&&null===m(t))return gt&&Gt(t),!0;if(ee(t))return Ut(t),!0;const o=Rt(w?w(t):t.nodeName);if(V=ie(z.uponSanitizeElement,V,U,st),re(z.uponSanitizeElement,t,{tagName:o,allowedTags:V}),t!==e&&null===m(t))return gt&&Gt(t),!0;if(function(t,e){return!!(rt&&t.hasChildNodes()&&!oe(t.firstElementChild)&&Be(yn,t.textContent)&&Be(yn,t.innerHTML))||!(!rt||t.namespaceURI!==St||"style"!==e||!oe(t.firstElementChild))||7===t.nodeType||!(!rt||8!==t.nodeType||!Be(wn,t.data))}(t,o))return Ut(t),!0;if(G[o]||!(J.tagCheck instanceof Function&&J.tagCheck(o))&&!V[o]){const n=function(t,e,n){if(!G[e]&&ae(e)){if(Y.tagNameCheck instanceof RegExp&&Be(Y.tagNameCheck,e))return!1;if(Y.tagNameCheck instanceof Function&&Y.tagNameCheck(e))return!1}if(mt&&!yt[e]){const e=m(t),o=v(t);if(o&&e)for(let r=o.length-1;r>=0;--r){const i=t===n?h(o[r],!0):o[r];e.insertBefore(i,p(t))}}return Ut(t),!0}(t,o,e);return!1===n&&re(z.afterSanitizeElements,t,null),n}if(1===(y?y(t):t.nodeType)&&!function(t){let e=m(t);e&&e.tagName||(e={namespaceURI:qt,tagName:"template"});const n=je(t.tagName),o=je(e.tagName);return!!Mt[t.namespaceURI]&&(t.namespaceURI===$t?function(t,e,n){return e.namespaceURI===St?"svg"===t:e.namespaceURI===Ct?"svg"===t&&("annotation-xml"===n||It[n]):Boolean(Ht[t])}(n,e,o):t.namespaceURI===Ct?function(t,e,n){return e.namespaceURI===St?"math"===t:e.namespaceURI===$t?"math"===t&&zt[n]:Boolean(Vt[t])}(n,e,o):t.namespaceURI===St?function(t,e,n){return!(e.namespaceURI===$t&&!zt[n])&&!(e.namespaceURI===Ct&&!It[n])&&!Vt[t]&&(Ot[t]||!Ht[t])}(n,e,o):!("application/xhtml+xml"!==Dt||!Mt[t.namespaceURI]))}(t))return Ut(t),!0;if(("noscript"===o||"noembed"===o||"noframes"===o)&&Be(_n,t.innerHTML))return Ut(t),!0;if(ot&&3===t.nodeType){const e=Xt(t.textContent);t.textContent!==e&&(qe(n.removed,{element:t.cloneNode()}),t.textContent=e)}return re(z.afterSanitizeElements,t,null),!1},se=function(t,e,n){if(K[e])return!1;if(rt&&"patchsrc"===e)return!1;if(rt&&"for"===e&&"label"!==t&&"output"!==t)return!1;if(ft&&("id"===e||"name"===e)&&(n in o||n in Zt))return!1;const r=Q[e]||J.attributeCheck instanceof Function&&J.attributeCheck(e,t);if(tt&&Be(R,e));else if(X&&Be(N,e));else if(r){if(kt[e]);else if(Be(H,Le(n,F,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==ze(n,"data:")||!_t[t])if(et&&!Be(Z,Le(n,F,"")));else if(n)return!1}else if(!(ae(t)&&(Y.tagNameCheck instanceof RegExp&&Be(Y.tagNameCheck,t)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(t))&&(Y.attributeNameCheck instanceof RegExp&&Be(Y.attributeNameCheck,e)||Y.attributeNameCheck instanceof Function&&Y.attributeNameCheck(e,t))||"is"===e&&Y.allowCustomizedBuiltInElements&&(Y.tagNameCheck instanceof RegExp&&Be(Y.tagNameCheck,n)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(n))))return!1;return!0},ue=Qe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ae=function(t){return!ue[je(t)]&&Be(B,t)},ce=function(t,e,n,o){if(x&&"object"==typeof c&&"function"==typeof c.getAttributeType&&!n)switch(c.getAttributeType(t,e)){case"TrustedHTML":return A(o);case"TrustedScriptURL":return function(t){q(),S++;try{return x.createScriptURL(t)}finally{S--}}(o)}return o},de=function(t,e,o,r){try{o?t.setAttributeNS(o,e,r):t.setAttribute(e,r),ee(t)?Ut(t):Se(n.removed)}catch(n){Wt(e,t)}},he=function(t){re(z.beforeSanitizeAttributes,t,null);const e=t.attributes;if(!e||ee(t))return;Q=ie(z.uponSanitizeAttribute,Q,W,ut);const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0};let o=e.length;const r=Rt(t.nodeName);for(;o--;){const i=e[o],l=i.name,s=i.namespaceURI,u=i.value,a=Rt(l),c=u;let d="value"===l?c:Oe(c);n.attrName=a,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,re(z.uponSanitizeAttribute,t,n),d=n.attrValue,!pt||"id"!==a&&"name"!==a||0===ze(d,vt)||(Wt(l,t),d=vt+d),rt&&Be(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)||"attributename"===a&&Ie(d,"href")?Wt(l,t):n.forceKeepAttr||(!n.keepAttr||!nt&&Be(xn,d)?Wt(l,t):(ot&&(d=Xt(d)),se(r,a,d)?(d=ce(r,a,s,d),d!==c&&de(t,l,s,d)):Wt(l,t)))}re(z.afterSanitizeAttributes,t,null)},fe=function(t){let e=null;const n=Jt(t);for(re(z.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(re(z.uponSanitizeShadowNode,e,null),le(e,t),he(e),ne(e.content)&&fe(e.content),1===(y?y(e):e.nodeType)){const t=g(e);ne(t)&&(ve(t),fe(t))}re(z.afterSanitizeShadowDOM,t,null)},ve=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){fe(t.shadow);continue}const n=t.node,o=1===(y?y(n):n.nodeType),r=v(n);if(r)for(let t=r.length-1;t>=0;--t)e.push({node:r[t],shadow:null});if(o){const t=w?w(n):null;if("string"==typeof t&&"template"===Rt(t)){const t=n.content;ne(t)&&e.push({node:t,shadow:null})}}if(o){const t=g(n);ne(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,i=null,l=null,s=null;if(At=!t,At&&(t="\x3c!--\x3e"),"string"!=typeof t&&!oe(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return De(t);case"boolean":return Pe(t);case"bigint":return Re?Re(t):"0";case"symbol":return Ne?Ne(t):"Symbol()";case"undefined":default:return Fe(t);case"function":case"object":{if(null===t)return Fe(t);const e=t,n=Ge(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:Fe(t)}return Fe(t)}}}(t)))throw He("dirty is not a string, aborting");if(!n.isSupported)return t;lt?(V=st,Q=ut):Bt(e),(z.uponSanitizeElement.length>0||z.uponSanitizeAttribute.length>0)&&(V=Ye(V)),z.uponSanitizeAttribute.length>0&&(Q=Ye(Q)),n.removed=[];const u=gt&&"string"!=typeof t&&oe(t);if(u){!function(t){if(!rt)return;const e=[t];for(;e.length>0;){const t=e.pop(),n=y?y(t):t.nodeType;if(7===n||8===n&&Be(wn,t.data)){try{f(t)}catch(t){}continue}if(1===n){const e=t,n=Rt(w?w(t):t.nodeName);try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&"label"!==n&&"output"!==n&&e.removeAttribute("for")}catch(t){}}const o=v(t);if(o)for(let t=o.length-1;t>=0;--t)e.push(o[t])}}(t);const e=w?w(t):t.nodeName;if("string"==typeof e){const n=Rt(e);if(!V[n]||G[n])throw Qt(t),He("root node is forbidden and cannot be sanitized in-place")}if(ee(t))throw Qt(t),He("root node is clobbered and cannot be sanitized in-place");try{ve(t)}catch(e){throw Qt(t),e}}else if(oe(t))o=Kt("\x3c!----\x3e"),i=o.ownerDocument.importNode(t,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?o=i:o.appendChild(i),ve(i);else{if(!ct&&!ot&&!it&&-1===t.indexOf("<"))return x&&ht?A(t):t;if(o=Kt(t),!o)return ct?null:ht?T:""}o&&at&&Ut(o.firstChild);const a=u?t:o;try{const t=Jt(a);for(;l=t.nextNode();)le(l,a),he(l),ne(l.content)&&fe(l.content)}catch(e){throw u&&(Qt(t),Ce(n.removed,t=>{t.element&&Gt(t.element)})),e}if(u)return Ce(n.removed,t=>{t.element&&Gt(t.element)}),ot&&te(t),t;if(ct){if(ot&&te(o),dt)for(s=E.call(o.ownerDocument);o.firstChild;)s.appendChild(o.firstChild);else s=o;return(Q.shadowroot||Q.shadowrootmode)&&(s=L.call(r,s,!0)),s}let c=it?o.outerHTML:o.innerHTML;return it&&V["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&Be(gn,o.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+c),ot&&(c=Xt(c)),x&&ht?A(c):c},n.setConfig=function(){Bt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),lt=!0,st=V,ut=Q},n.clearConfig=function(){Nt=null,lt=!1,st=null,ut=null,x=k,T=""},n.isValidAttribute=function(t,e,n){Nt||Bt({});const o=Rt(t),r=Rt(e);return se(o,r,n)},n.addHook=function(t,e){"function"==typeof e&&Ze(z,t)&&qe(z[t],e)},n.removeHook=function(t,e){if(Ze(z,t)){if(void 0!==e){const n=$e(z[t],e);return-1===n?void 0:Ae(z[t],n,1)[0]}return Se(z[t])}},n.removeHooks=function(t){Ze(z,t)&&(z[t]=[])},n.removeAllHooks=function(){z={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();function $n(t,e){return t.match(/\\?.|^$/g).reduce((t,n)=>('"'!==n||t.sQuote?"'"!==n||t.quote?t.quote||t.sQuote||n!==e?t.a[t.a.length-1]+=n:t.a.push(""):(t.sQuote^=1,t.a[t.a.length-1]+=n):(t.quote^=1,t.a[t.a.length-1]+=n),t),{a:[""]}).a}function Sn(t){return t.nodeType===Node.DOCUMENT_FRAGMENT_NODE||t.nodeType===Node.DOCUMENT_NODE}function qn(t,e){const n=t.parentNode;return n&&n.host&&11===n.nodeType?n.host:n===e?null:n}const An=e,Mn=function(t,e=Vt){return Ht("[Element Inference]",e,function(t=console){return{log:t.log.bind(t),warn:t.warn.bind(t),error:t.error.bind(t),debug:t.debug.bind(t)}}())}();function jn(t,e){try{const n=e.get(t);if(!Nt(n))return n;if(t.checkVisibility){const n=t.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});return e.set(t,n),n}const o=An.getComputedStyle(t);if("none"===o.display||"hidden"===o.visibility||0===parseFloat(o.opacity))return e.set(t,!1),!1;let r=t.parentElement;for(;r;){const t=e.get(r);if(!Nt(t)){if(!t)return!1;r=r.parentElement;continue}const n=An.getComputedStyle(r),o="none"!==n.display&&"hidden"!==n.visibility;if(e.set(r,o),!o)return!1;r=r.parentElement}const i=t.getBoundingClientRect(),l=i.width>0||i.height>0||t.getClientRects().length>0;return e.set(t,l),l}catch(t){return!0}}function En(t,e){const n=function(t){var e;const n=null===(e=t.innerText)||void 0===e?void 0:e.trim();return!n||n.length>250?null:n}(t);return(null==n?void 0:n.toLowerCase())===e.toLowerCase()}function*In(t,e,n){let o;try{o=function(t,e=document,n=null){return function(t,e,n,o=null){t=function(t){function e(){o&&(l.length>0&&/^[~+>]$/.test(l[l.length-1])&&l.push(" "),l.push(o))}var n,o,r,i,l=[],s=[0],u=0,a=/(?:[^\\]|(?:^|[^\\])(?:\\\\)+)$/,c=/^\s+$/,d=[/\s+|\/\*|["'>~+[(]/g,/\s+|\/\*|["'[\]()]/g,/\s+|\/\*|["'[\]()]/g,null,/\*\//g];for(t=t.trim();;){if(o="",(r=d[s[s.length-1]]).lastIndex=u,!(n=r.exec(t))){o=t.substr(u),e();break}if(i=u,(u=r.lastIndex)-n[0].length>i&&(o=t.substring(i,u-n[0].length)),3>s[s.length-1]){if(e(),"["===n[0])s.push(1);else if("("===n[0])s.push(2);else if(/^["']$/.test(n[0]))s.push(3),d[3]=new RegExp(n[0],"g");else if("/*"===n[0])s.push(4);else if(/^[\])]$/.test(n[0])&&s.length>0)s.pop();else if(/^(?:\s+|[~+>])$/.test(n[0])&&(l.length>0&&!c.test(l[l.length-1])&&0===s[s.length-1]&&l.push(" "),1===s[s.length-1]&&5===l.length&&"="===l[2].charAt(l[2].length-1)&&(l[4]=" "+l[4]),c.test(n[0])))continue;l.push(n[0])}else l[l.length-1]+=o,a.test(l[l.length-1])&&(4===s[s.length-1]&&(2>l.length||c.test(l[l.length-2])?l.pop():l[l.length-1]=" ",n[0]=""),s.pop()),l[l.length-1]+=n[0]}return l.join("").trim()}(t);let r=n.querySelector(t);return document.head.createShadowRoot||document.head.attachShadow?!e&&r?r:$n(t,",").reduce((t,r)=>{if(!e&&t)return t;const i=$n(r.replace(/^\s+/g,"").replace(/\s*([>+~]+)\s*/g,"$1")," ").filter(t=>!!t).map(t=>$n(t,">")),l=i.length-1,s=function(t=null,e,n=null){let o=[];if(n)o=n;else{const t=function(e){for(let n=0;e.length>n;n++){const r=e[n];o.push(r),r.shadowRoot&&t(r.shadowRoot.querySelectorAll("*"))}};e.shadowRoot&&t(e.shadowRoot.querySelectorAll("*")),t(e.querySelectorAll("*"))}return t?o.filter(e=>e.matches(t)):o}(i[l][i[l].length-1],n,o),u=function(t,e,n){return o=>{let r=e,i=o,l=!1;for(;i&&!Sn(i);){let e=!0;if(1===t[r].length)e=i.matches(t[r]);else{const o=[].concat(t[r]).reverse();let l=i;for(const t of o){if(!l||!l.matches(t)){e=!1;break}l=qn(l,n)}}if(e&&0===r){l=!0;break}e&&r--,i=qn(i,n)}return l}}(i,l,n);return e?t=t.concat(s.filter(u)):(t=s.find(u))||null},e?[]:null):e?n.querySelectorAll(t):r}(t,!0,e,n)}(t)}catch(t){return}for(const t of o){const o=t;e&&!En(o,e)||jn(o,n)&&(yield o)}}function Ln(t,e){let n=0;for(const o of t){if(n===e)return o;n++}return null}function zn(t){try{const n=JSON.parse(t.autoData);if(!Pt(null==n?void 0:n.textGroups)||!Pt(null==n?void 0:n.notextGroups))return Mn.error("Invalid autoData structure:",n),null;const{text:o,excludeText:r,precision:i=1}=t,l=null!=o&&!r,s=(l?n.textGroups:n.notextGroups).sort((t,e)=>t.cardinality-e.cardinality);if(0===s.length)return null;const u=Math.max(1,Math.ceil((1-i)*s.length)),a=new WeakMap;for(let t=0;u>t;t++){const n=s[t],r=new Map;let i=null,u=0;for(const{css:t,offset:s}of n.cssSelectors){var e;const c=Ln(In(t,l?o:null,a),s);if(!c)continue;const d=(null!==(e=r.get(c))&&void 0!==e?e:0)+1;if(r.set(c,d),d>u&&(u=d,i=c,d>=Math.ceil(n.cssSelectors.length/2)))return i}if(i)return i}return null}catch(t){return Mn.error("Error finding element:",t),null}}const On=(t,{debugEnabled:n}={})=>{const o={N(o,...r){e&&(e.POSTHOG_DEBUG||n)&&!Nt(e.console)&&e.console&&("__rrweb_original__"in e.console[o]?e.console[o].__rrweb_original__:e.console[o])(t,...r)},debug(...t){o.N("debug",...t)},info(...t){o.N("log",...t)},warn(...t){o.N("warn",...t)},error(...t){o.N("error",...t)},critical(...e){console.error(t,...e)},uninitializedWarning(t){o.error(`You must initialize PostHog before calling ${t}`)},createLogger:(e,n)=>On(`${t} ${e}`,n)};return o},Dn=On("[PostHog.js]"),Pn=Dn.createLogger,Rn=Pn("[Stylesheet Loader]"),Nn=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},Zn=t=>t.toLowerCase(),Fn={exact:(t,e)=>e.some(e=>t.some(t=>e===t)),is_not:(t,e)=>e.every(e=>t.every(t=>e!==t)),regex:(t,e)=>e.some(e=>t.some(t=>Nn(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Nn(e,t))),icontains:(t,e)=>e.map(Zn).some(e=>t.map(Zn).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Zn).every(e=>t.map(Zn).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n>parseFloat(t))}),lt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n<parseFloat(t))})};function Bn(t,e){return!t||Object.entries(t).every(([t,n])=>{const o=null==e?void 0:e[t];if(null==o)return!1;const r=Fn[n.operator];return!!r&&r(n.values,[String(o)])})}function Hn(t,e,n,o){const{capture:r=!1,passive:i=!0}=null!=o?o:{};null==t||t.addEventListener(e,n,{capture:r,passive:i})}Pn("[Surveys]"),Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Bt(t)&&isFinite(t)&&Math.floor(t)===t}),e&&!Nt(e.crypto)&&crypto;let Vn=null;const Un={Et(){if(!Zt(Vn))return Vn;let t=!0;if(Nt(e))t=!1;else try{const e="__mplssupport__";Un.At(e,"xyz"),'"xyz"'!==Un.Ot(e)&&(t=!1),Un.Lt(e)}catch(e){t=!1}return t||Dn.error("localStorage unsupported; falling back to cookie store"),Vn=t,t},Pt(t){Dn.error("localStorage error: "+t)},Ot(t){try{return null==e?void 0:e.localStorage.getItem(t)}catch(t){Un.Pt(t)}return null},Dt(t){try{return JSON.parse(Un.Ot(t))||{}}catch(t){}return null},At(t,n){try{return null==e||e.localStorage.setItem(t,JSON.stringify(n)),!0}catch(t){Un.Pt(t)}return!1},Lt(t){try{null==e||e.localStorage.removeItem(t)}catch(t){Un.Pt(t)}}};let Qn=null;const Wn={Et(){if(!Zt(Qn))return Qn;if(Qn=!0,Nt(e))Qn=!1;else try{const t="__support__";Wn.At(t,"xyz"),'"xyz"'!==Wn.Ot(t)&&(Qn=!1),Wn.Lt(t)}catch(t){Qn=!1}return Qn},Pt(t){Dn.error("sessionStorage error: ",t)},Ot(t){try{return null==e?void 0:e.sessionStorage.getItem(t)}catch(t){Wn.Pt(t)}return null},Dt(t){try{return JSON.parse(Wn.Ot(t))||null}catch(t){}return null},At(t,n){try{return null==e||e.sessionStorage.setItem(t,JSON.stringify(n)),!0}catch(t){Wn.Pt(t)}return!1},Lt(t){try{null==e||e.sessionStorage.removeItem(t)}catch(t){Wn.Pt(t)}}};var Yn,Gn,Kn,Jn,Xn=0,to=[],eo=s,no=eo.__b,oo=eo.__r,ro=eo.diffed,io=eo.__c,lo=eo.unmount,so=eo.__;function uo(t,e){eo.__h&&eo.__h(Gn,t,Xn||e),Xn=0;var n=Gn.__H||(Gn.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function ao(t){return Xn=1,function(t,e){var n=uo(Yn++,2);if(n.t=t,!n.__c&&(n.__=[_o(void 0,e),function(t){var e=n.__N?n.__N[0]:n.__[0],o=n.t(e,t);e!==o&&(n.__N=[o,n.__[1]],n.__c.setState({}))}],n.__c=Gn,!Gn.__f)){var o=function(t,e,o){if(!n.__c.__H)return!0;var i=!1,l=n.__c.props!==t;if(n.__c.__H.__.some(function(t){if(t.__N){i=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(l=!0)}}),r){var s=r.call(this,t,e,o);return i?s||l:s}return!i||l};Gn.__f=!0;var r=Gn.shouldComponentUpdate,i=Gn.componentWillUpdate;Gn.componentWillUpdate=function(t,e,n){if(this.__e){var l=r;r=void 0,o(t,e,n),r=l}i&&i.call(this,t,e,n)},Gn.shouldComponentUpdate=o}return n.__N||n.__}(_o,t)}function co(t,e){var n=uo(Yn++,3);!eo.__s&&wo(n.__H,e)&&(n.__=t,n.u=e,Gn.__H.__h.push(n))}function ho(t,e){var n=uo(Yn++,4);!eo.__s&&wo(n.__H,e)&&(n.__=t,n.u=e,Gn.__h.push(n))}function fo(t){return Xn=5,po(function(){return{current:t}},[])}function po(t,e){var n=uo(Yn++,7);return wo(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function vo(){for(var t;t=to.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(bo),e.__h.some(yo),e.__h=[]}catch(n){e.__h=[],eo.__e(n,t.__v)}}}eo.__b=function(t){Gn=null,no&&no(t)},eo.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),so&&so(t,e)},eo.__r=function(t){oo&&oo(t),Yn=0;var e=(Gn=t.__c).__H;e&&(Kn===Gn?(e.__h=[],Gn.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&vo(),Yn=0)),Kn=Gn},eo.diffed=function(t){ro&&ro(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==to.push(e)&&Jn===eo.requestAnimationFrame||((Jn=eo.requestAnimationFrame)||go)(vo)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Kn=Gn=null},eo.__c=function(t,e){e.some(function(t){try{t.__h.some(bo),t.__h=t.__h.filter(function(t){return!t.__||yo(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],eo.__e(n,t.__v)}}),io&&io(t,e)},eo.unmount=function(t){lo&&lo(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(t){try{bo(t)}catch(t){e=t}}),n.__H=void 0,e&&eo.__e(e,n.__v))};var mo="function"==typeof requestAnimationFrame;function go(t){var e,n=function(){clearTimeout(o),mo&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);mo&&(e=requestAnimationFrame(n))}function bo(t){var e=Gn,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Gn=e}function yo(t){var e=Gn;t.__c=t.__(),Gn=e}function wo(t,e){return!t||t.length!==e.length||e.some(function(e,n){return e!==t[n]})}function _o(t,e){return"function"==typeof e?e(t):e}const xo="#020617";function ko(t){if(t.startsWith("#")){let e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?`rgb(${parseInt(e.slice(0,2),16)},${parseInt(e.slice(2,4),16)},${parseInt(e.slice(4,6),16)})`:"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function To(t="#eeeded"){let e;"#"===t[0]&&(e=ko(t)),t.startsWith("rgb")&&(e=t);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(n&&(e=ko(n)),!e)return xo;const o=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(o){const t=parseInt(o[1]),e=parseInt(o[2]),n=parseInt(o[3]);return Math.sqrt(t*t*.299+e*e*.587+n*n*.114)>127.5?xo:"white"}return xo}String(2147483645),function(t){function e(t){var n,o;return this.getChildContext||(n=new Set,(o={})[e.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&n.forEach(function(t){t.__e=!0,I(t)})},this.sub=function(t){n.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.delete(t),e&&e.call(t)}}),t.children}e.__c="__cC"+w++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null});const Co="ph_product_tour_shown_",$o="ph_product_tour_completed_",So="ph_product_tour_dismissed_",qo="ph_active_product_tour",Ao="ph_last_seen_tour_date_",Mo=Pn("[Product Tours]"),jo=r,Eo=e;function Io(t){const e=((t,e,n)=>{let o=t.createElement("style");o.innerText=e;const r=(t=>{var e;return Rt(t)?t:null==t||null===(e=t.config)||void 0===e?void 0:e.prepare_external_dependency_stylesheet})(n);return r&&(o=r(o)),o||(Rn.error("prepare_external_dependency_stylesheet returned null"),null)})(jo,':host{--ph-tour-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-tour-background-color:#fff;--ph-tour-text-color:#1d1f27;--ph-tour-text-secondary-color:#6b7280;--ph-tour-button-color:#1d1f27;--ph-tour-button-text-color:#fff;--ph-tour-button-secondary-color:transparent;--ph-tour-button-secondary-text-color:#1d1f27;--ph-tour-border-color:#e5e7eb;--ph-tour-border-radius:8px;--ph-tour-button-border-radius:6px;--ph-tour-box-shadow:0 4px 12px #00000026;--ph-tour-max-width:320px;--ph-tour-padding:16px;--ph-tour-z-index:calc(2147480000 + 3646);--ph-tour-overlay-color:#00000080;--ph-tour-spotlight-padding:8px;--ph-tour-spotlight-border-radius:4px;--ph-tour-arrow-size:8px}.ph-tour-container *{box-sizing:border-box;font-family:var(--ph-tour-font-family);margin:0;padding:0}.ph-tour-click-overlay{z-index:var(--ph-tour-z-index);pointer-events:auto;position:fixed;inset:0}.ph-tour-spotlight{z-index:var(--ph-tour-z-index);border-radius:var(--ph-tour-spotlight-border-radius);box-shadow:0 0 0 9999px var(--ph-tour-overlay-color);pointer-events:none;position:fixed}.ph-tour-modal-overlay{z-index:var(--ph-tour-z-index);background:var(--ph-tour-overlay-color);pointer-events:none;position:fixed;inset:0}.ph-tour-tooltip{z-index:calc(var(--ph-tour-z-index) + 1);background:var(--ph-tour-background-color);border:1px solid var(--ph-tour-border-color);border-radius:var(--ph-tour-border-radius);box-shadow:var(--ph-tour-box-shadow);min-width:min(280px,100vw - 16px);max-width:min(var(--ph-tour-max-width), calc(100vw - 16px));padding:var(--ph-tour-padding);padding-top:calc(var(--ph-tour-padding) + 8px);pointer-events:auto;position:fixed}.ph-tour-tooltip--modal{box-shadow:var(--ph-tour-box-shadow)}.ph-tour-arrow{--ph-tour-arrow-offset:0px;border:var(--ph-tour-arrow-size) solid transparent;width:0;height:0;position:absolute}.ph-tour-arrow--top{bottom:100%;left:calc(50% + var(--ph-tour-arrow-offset));border-bottom-color:var(--ph-tour-background-color);transform:translate(-50%)}.ph-tour-arrow--bottom{top:100%;left:calc(50% + var(--ph-tour-arrow-offset));border-top-color:var(--ph-tour-background-color);transform:translate(-50%)}.ph-tour-arrow--left{right:100%;top:calc(50% + var(--ph-tour-arrow-offset));border-right-color:var(--ph-tour-background-color);transform:translateY(-50%)}.ph-tour-arrow--right{left:100%;top:calc(50% + var(--ph-tour-arrow-offset));border-left-color:var(--ph-tour-background-color);transform:translateY(-50%)}.ph-tour-content{color:var(--ph-tour-text-color);margin-bottom:16px;padding-right:24px;font-size:14px;line-height:1.5}.ph-tour-content h1,.ph-tour-content h2{margin-bottom:8px;font-weight:600}.ph-tour-content h1{font-size:18px}.ph-tour-content h2{font-size:16px}.ph-tour-content p{margin-bottom:8px}.ph-tour-content p:last-child{margin-bottom:0}.ph-tour-content strong{font-weight:600}.ph-tour-content em{font-style:italic}.ph-tour-content ul,.ph-tour-content ol{margin-bottom:8px;margin-left:20px}.ph-tour-content h3{margin-bottom:8px;font-size:14px;font-weight:600}.ph-tour-content a,.ph-tour-content .ph-tour-link{color:inherit;text-decoration:underline}.ph-tour-content a:hover{opacity:.8}.ph-tour-content code{background:#0000000f;border-radius:4px;padding:2px 6px;font-family:SF Mono,Monaco,Consolas,monospace;font-size:.875em}.ph-tour-content pre{background:#0000000a;border-radius:6px;margin-bottom:8px;padding:12px;font-family:SF Mono,Monaco,Consolas,monospace;font-size:13px;line-height:1.5;overflow-x:auto}.ph-tour-content pre code{font-size:inherit;background:0 0;border-radius:0;padding:0}.ph-tour-content pre *,.ph-tour-content code *{font-family:inherit}.ph-tour-content .hljs-comment,.ph-tour-content .hljs-quote{color:#6a737d;font-style:italic}.ph-tour-content .hljs-keyword,.ph-tour-content .hljs-selector-tag{color:#d73a49}.ph-tour-content .hljs-string,.ph-tour-content .hljs-doctag,.ph-tour-content .hljs-regexp{color:#032f62}.ph-tour-content .hljs-number,.ph-tour-content .hljs-literal,.ph-tour-content .hljs-variable,.ph-tour-content .hljs-template-variable{color:#005cc5}.ph-tour-content .hljs-title,.ph-tour-content .hljs-section,.ph-tour-content .hljs-selector-id,.ph-tour-content .hljs-selector-class,.ph-tour-content .hljs-title.function_{color:#6f42c1}.ph-tour-content .hljs-name,.ph-tour-content .hljs-attribute,.ph-tour-content .hljs-attr,.ph-tour-content .hljs-symbol,.ph-tour-content .hljs-bullet,.ph-tour-content .hljs-built_in,.ph-tour-content .hljs-addition{color:#22863a}.ph-tour-content .hljs-subst,.ph-tour-content .hljs-deletion{color:#b31d28}.ph-tour-content .hljs-meta{color:#032f62}.ph-tour-content .hljs-emphasis{font-style:italic}.ph-tour-content .hljs-strong{font-weight:700}.ph-tour-content img,.ph-tour-content .ph-tour-image{border-radius:6px;max-width:100%;height:auto;margin:8px 0;display:block}.ph-tour-content .ph-tour-embed{margin:8px 0}.ph-tour-content .ph-tour-embed-container{background:#000;border-radius:6px;width:100%;padding-bottom:56.25%;position:relative;overflow:hidden}.ph-tour-content .ph-tour-embed-container iframe{border:none;width:100%;height:100%;position:absolute;top:0;left:0}.ph-tour-content blockquote{border-left:3px solid var(--ph-tour-border-color);color:var(--ph-tour-text-secondary-color);margin:8px 0;padding-left:12px;font-style:italic}.ph-tour-footer{justify-content:space-between;align-items:center;gap:12px;display:flex}.ph-tour-progress{color:var(--ph-tour-text-secondary-color);font-size:12px}.ph-tour-buttons{gap:8px;margin-left:auto;display:flex}.ph-tour-button{border-radius:var(--ph-tour-button-border-radius);cursor:pointer;border:none;justify-content:center;align-items:center;padding:8px 16px;font-size:14px;font-weight:500;text-decoration:none;transition:opacity .15s,transform .1s;display:inline-flex}.ph-tour-button:hover{opacity:.9}.ph-tour-button:active{transform:scale(.98)}.ph-tour-button--primary{background:var(--ph-tour-button-color);color:var(--ph-tour-button-text-color)}.ph-tour-button--secondary{background:var(--ph-tour-button-secondary-color);color:var(--ph-tour-button-secondary-text-color);border:1px solid var(--ph-tour-border-color)}.ph-tour-dismiss{cursor:pointer;width:24px;height:24px;color:var(--ph-tour-text-secondary-color);background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;font-size:18px;line-height:1;transition:background .15s,color .15s;display:flex;position:absolute;top:8px;right:8px}.ph-tour-dismiss:hover{color:var(--ph-tour-text-color);background:#00000014}.ph-tour-branding{border-top:1px solid var(--ph-tour-border-color);color:var(--ph-tour-branding-text-color,var(--ph-tour-text-secondary-color));justify-content:center;align-items:center;gap:6px;margin-top:12px;padding-top:12px;font-size:11px;text-decoration:none;display:flex}.ph-tour-branding:hover{color:var(--ph-tour-branding-text-color,var(--ph-tour-text-color))}.ph-tour-branding svg{width:auto;height:14px}.ph-tour-hidden{display:none!important}.ph-tour-survey-step{min-width:min(300px,100vw - 16px)}.ph-tour-survey-question{color:var(--ph-tour-text-color);margin-bottom:16px;padding-right:24px;font-size:15px;font-weight:500;line-height:1.4}.ph-tour-survey-input-container{flex-direction:column;gap:12px;display:flex}.ph-tour-survey-textarea{border:1px solid var(--ph-tour-border-color);width:100%;font-size:14px;font-family:var(--ph-tour-font-family);color:var(--ph-tour-text-color);resize:vertical;box-sizing:border-box;background:#fff;border-radius:6px;min-height:80px;padding:10px 12px}.ph-tour-survey-textarea:focus{border-color:var(--ph-tour-button-color);outline:none;box-shadow:0 0 0 2px #0000000d}.ph-tour-survey-textarea::placeholder{color:var(--ph-tour-text-secondary-color)}.ph-tour-survey-submit{align-self:flex-end}.ph-tour-survey-rating-container{flex-direction:column;gap:8px;margin-bottom:8px;display:flex}.ph-tour-survey-rating-labels{color:var(--ph-tour-text-secondary-color);justify-content:space-between;font-size:11px;display:flex}.ph-tour-survey-rating-emoji{justify-content:center;gap:8px;display:flex}.ph-tour-survey-emoji-button{border:2px solid var(--ph-tour-border-color);background:var(--ph-tour-background-color);cursor:pointer;border-radius:8px;justify-content:center;align-items:center;width:44px;height:44px;padding:0;transition:all .15s;display:flex}.ph-tour-survey-emoji-button:hover{border-color:var(--ph-tour-button-color);background:#00000005}.ph-tour-survey-emoji-button--active{border-color:var(--ph-tour-button-color);background:var(--ph-tour-button-color)}.ph-tour-survey-emoji-button--active svg{fill:var(--ph-tour-button-text-color)}.ph-tour-survey-emoji-button svg{width:28px;height:28px;fill:var(--ph-tour-text-color);transition:fill .15s}.ph-tour-survey-rating-numbers{gap:6px;display:grid}.ph-tour-survey-number-button{border:1px solid var(--ph-tour-border-color);background:var(--ph-tour-background-color);font-size:13px;font-weight:500;font-family:var(--ph-tour-font-family);color:var(--ph-tour-text-color);cursor:pointer;border-radius:4px;justify-content:center;align-items:center;padding:8px 4px;transition:all .15s;display:flex}.ph-tour-survey-number-button:hover{border-color:var(--ph-tour-button-color);background:#00000005}.ph-tour-survey-number-button--active{border-color:var(--ph-tour-button-color);background:var(--ph-tour-button-color);color:var(--ph-tour-button-text-color)}@keyframes ph-tour-banner-slide-in{0%{grid-template-rows:0fr}to{grid-template-rows:1fr}}.ph-tour-banner-wrapper{animation:ph-tour-banner-slide-in var(--ph-tour-banner-animation-duration,.3s) ease-out forwards;display:grid}.ph-tour-banner-slide{min-height:0;overflow:hidden}.ph-tour-banner{background:var(--ph-tour-background-color);border-bottom:1px solid var(--ph-tour-border-color);box-shadow:var(--ph-tour-box-shadow);font-family:var(--ph-tour-font-family);justify-content:center;align-items:center;gap:16px;padding:12px 16px;display:flex}a.ph-tour-banner{color:inherit;text-decoration:none}:host:has(.ph-tour-banner--sticky){z-index:var(--ph-tour-z-index);position:sticky;top:0}.ph-tour-banner-content{min-width:0;color:var(--ph-tour-text-color);text-align:center;flex:1;font-size:14px;line-height:1.5}.ph-tour-banner-content p{margin:0}.ph-tour-banner-content strong{font-weight:600}.ph-tour-banner-content em{font-style:italic}.ph-tour-banner-content a{color:inherit;text-decoration:underline}.ph-tour-banner-dismiss{cursor:pointer;width:24px;height:24px;color:var(--ph-tour-text-secondary-color);background:0 0;border:none;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;transition:background .15s,color .15s;display:flex}.ph-tour-banner-dismiss:hover{color:var(--ph-tour-text-color);background:#00000014}',t);return null==e||e.setAttribute("data-ph-product-tour-style","true"),e}function Lo(t){return t.useManualSelector?!!t.selector:!!t.inferenceData}function zo(t){var e;if(null!==(e=t.useManualSelector)&&void 0!==e&&e)return t.selector?function(t){try{const e=jo.querySelectorAll(t);if(0===e.length)return{element:null,error:"not_found",matchCount:0};const n=e[0];return function(t){const e=Eo.getComputedStyle(t);if("none"===e.display||"hidden"===e.visibility||"0"===e.opacity)return!1;const n=t.getBoundingClientRect();return 0!==n.width&&0!==n.height}(n)?e.length>1?{element:n,error:"multiple_matches",matchCount:e.length}:{element:n,error:null,matchCount:1}:{element:null,error:"not_visible",matchCount:e.length}}catch(t){return{element:null,error:"not_found",matchCount:0}}}(t.selector):{element:null,error:"not_found",matchCount:0};if(!t.inferenceData)return{element:null,error:"not_found",matchCount:0};const n=zn(t.inferenceData);return n?{element:n,error:null,matchCount:1}:{element:null,error:"not_found",matchCount:0}}const Oo=12;function Do(t,e,n){const o=Math.max(8+e/2,Math.min(n-8-e/2,t));return{clamped:o,offset:t-o}}function Po(t,e){const n=de(de({},K),e),o=t.style;o.setProperty("--ph-tour-background-color",n.backgroundColor),o.setProperty("--ph-tour-text-color",n.textColor),o.setProperty("--ph-tour-button-color",n.buttonColor),o.setProperty("--ph-tour-border-radius",`${n.borderRadius}px`),o.setProperty("--ph-tour-button-border-radius",`${n.buttonBorderRadius}px`),o.setProperty("--ph-tour-border-color",n.borderColor),o.setProperty("--ph-tour-font-family",function(t){if("inherit"===t)return"inherit";const e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?`${t}, ${e}`:`-apple-system, ${e}`}(n.fontFamily)),o.setProperty("--ph-tour-text-secondary-color",function(t){const e=ko(t).match(/^rgb\((\d+),(\d+),(\d+)\)$/);return e?`rgba(${e[1]}, ${e[2]}, ${e[3]}, 0.6)`:t}(n.textColor)),o.setProperty("--ph-tour-branding-text-color",To(n.backgroundColor)),o.setProperty("--ph-tour-button-text-color",To(n.buttonColor)),o.setProperty("--ph-tour-box-shadow",n.boxShadow),o.setProperty("--ph-tour-overlay-color",n.showOverlay?"rgba(0, 0, 0, 0.5)":"transparent"),o.setProperty("--ph-tour-z-index",String(n.zIndex)),o.setProperty("--ph-tour-button-secondary-color","transparent"),o.setProperty("--ph-tour-button-secondary-text-color",n.textColor),o.setProperty("--ph-tour-max-width","320px"),o.setProperty("--ph-tour-padding","16px")}function Ro(t){var e;if(!t)return"";if("string"==typeof t)return Zo(t);if("text"===t.type){let e=Zo(t.text||"");if(t.marks)for(const n of t.marks)switch(n.type){case"bold":e=`<strong>${e}</strong>`;break;case"italic":e=`<em>${e}</em>`;break;case"underline":e=`<u>${e}</u>`;break;case"strike":e=`<s>${e}</s>`}return e}const n=(null===(e=t.content)||void 0===e?void 0:e.map(Ro).join(""))||"";switch(t.type){case"doc":default:return n;case"paragraph":return`<p>${n}</p>`;case"heading":{var o;const e=(null===(o=t.attrs)||void 0===o?void 0:o.level)||1;return`<h${e}>${n}</h${e}>`}case"bulletList":return`<ul>${n}</ul>`;case"orderedList":return`<ol>${n}</ol>`;case"listItem":return`<li>${n}</li>`;case"hardBreak":return"<br>"}}function No(t){return t.endsWith("/")?t.slice(0,-1):t}function Zo(t){const e=jo.createElement("div");return e.textContent=t,e.innerHTML}function Fo(t){const e=[];return t.content&&function t(n){var o,r;"image"===n.type&&(null===(o=n.attrs)||void 0===o?void 0:o.src)&&e.push(n.attrs.src),null===(r=n.content)||void 0===r||r.forEach(t)}(t.content),e}function Bo(t){const e=t.contentHtml||Ro(t.content);return Cn.sanitize(e,{ADD_TAGS:["iframe"],ADD_ATTR:["allowfullscreen","frameborder","referrerpolicy"]})}var Ho=0;function Vo(t,e,n,o,r,i){e||(e={});var l,u,a=e;if("ref"in a)for(u in a={},e)"ref"==u?l=e[u]:a[u]=e[u];var c={type:t,props:a,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ho,__i:-1,__u:0,__source:r,__self:i};if("function"==typeof t&&(l=t.defaultProps))for(u in l)void 0===a[u]&&(a[u]=l[u]);return s.vnode&&s.vnode(c),c}const Uo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Qo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Wo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Yo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Go=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Ko=({fill:t="currentColor"}={})=>Vo("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Vo("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Vo("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:t})]}),Jo=Vo("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Vo("g",{"clip-path":"url(#clip0_2415_6911)",children:[Vo("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Vo("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Vo("g",{mask:"url(#mask0_2415_6911)",children:[Vo("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Vo("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Vo("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Vo("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Vo("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Vo("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Vo("defs",{children:Vo("clipPath",{id:"clip0_2415_6911",children:Vo("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Xo({button:t,variant:e,onClick:n,cursorStyle:o}){const r=`ph-tour-button ph-tour-button--${e}`;return"link"===t.action&&t.link?Vo("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",class:r,onClick:()=>n(t),children:t.text}):Vo("button",{class:r,onClick:()=>n(t),style:o,children:t.text})}function tr({step:t,appearance:e,stepIndex:n,totalSteps:o,onNext:r,onPrevious:i,onDismiss:l,onButtonClick:s}){var u,a,c;const d=null!==(u=null==e?void 0:e.whiteLabel)&&void 0!==u&&u,h=n>=o-1,f=0===n,p=!(t.buttons||"button"!==t.progressionTrigger&&Lo(t)),v=!!t.buttons,m=!!(r||i||l||s),g=m?void 0:{cursor:"default"},b=!d&&f,y=t=>{s&&s(t)};return Vo(A,{children:[Vo("button",{class:"ph-tour-dismiss",onClick:l,"aria-label":"Close tour",style:g,children:Ko()}),Vo("div",{class:"ph-tour-content",dangerouslySetInnerHTML:{__html:Bo(t)}}),Vo("div",{class:"ph-tour-footer",children:[o>1&&Vo("span",{class:"ph-tour-progress",children:[n+1," of ",o]}),Vo("div",{class:"ph-tour-buttons",children:[p&&Vo(A,{children:[!f&&Vo("button",{class:"ph-tour-button ph-tour-button--secondary",onClick:i,style:g,children:"Back"}),Vo("button",{class:"ph-tour-button ph-tour-button--primary",onClick:r,style:g,children:h?"Done":"Next"})]}),v&&Vo(A,{children:[(null===(a=t.buttons)||void 0===a?void 0:a.secondary)&&Vo(Xo,{button:t.buttons.secondary,variant:"secondary",onClick:y,cursorStyle:g}),(null===(c=t.buttons)||void 0===c?void 0:c.primary)&&Vo(Xo,{button:t.buttons.primary,variant:"primary",onClick:y,cursorStyle:g})]})]})]}),b&&Vo("a",{href:m?"https://posthog.com/docs/product-tours":void 0,target:m?"_blank":void 0,rel:m?"noopener noreferrer":void 0,class:"ph-tour-branding",style:m?void 0:{cursor:"default",pointerEvents:"none"},children:["Tour by ",Jo]})]})}const er=[Wo,Qo,Uo],nr=[Yo,Wo,Qo,Uo,Go];function or({value:t,onChange:e,onSubmit:n,isInteractive:o}){const r=fo(null);return co(()=>{o&&setTimeout(()=>{var t;return null===(t=r.current)||void 0===t?void 0:t.focus()},100)},[o]),Vo("textarea",{ref:r,class:"ph-tour-survey-textarea",rows:3,placeholder:"Your feedback (optional)...",value:t,onInput:t=>e(t.target.value),onKeyDown(t){"Enter"===t.key&&t.metaKey&&o&&(t.preventDefault(),null==n||n())},disabled:!o,style:o?void 0:{cursor:"default"}})}function rr({survey:t,onSubmit:e,isInteractive:n}){const[o,r]=ao(null),i=t.scale||5,l=t=>{n&&(r(t),null==e||e(t))};if("emoji"===(t.display||"emoji"))return Vo("div",{class:"ph-tour-survey-rating-container",children:[Vo("div",{class:"ph-tour-survey-rating-emoji",children:(3===i?er:nr).map((t,e)=>{const r=e+1;return Vo("button",{type:"button",class:"ph-tour-survey-emoji-button "+(o===r?"ph-tour-survey-emoji-button--active":""),onClick:()=>l(r),style:n?void 0:{cursor:"default"},"aria-label":`Rate ${r}`,children:t},e)})}),(t.lowerBoundLabel||t.upperBoundLabel)&&Vo("div",{class:"ph-tour-survey-rating-labels",children:[Vo("span",{children:t.lowerBoundLabel}),Vo("span",{children:t.upperBoundLabel})]})]});const s=function(t){switch(t){case 5:default:return[1,2,3,4,5];case 10:return[0,1,2,3,4,5,6,7,8,9,10]}}(i);return Vo("div",{class:"ph-tour-survey-rating-container",children:[Vo("div",{class:"ph-tour-survey-rating-numbers",style:{gridTemplateColumns:`repeat(${s.length}, minmax(0, 1fr))`},children:s.map(t=>Vo("button",{type:"button",class:"ph-tour-survey-number-button "+(o===t?"ph-tour-survey-number-button--active":""),onClick:()=>l(t),style:n?void 0:{cursor:"default"},"aria-label":`Rate ${t}`,children:t},t))}),(t.lowerBoundLabel||t.upperBoundLabel)&&Vo("div",{class:"ph-tour-survey-rating-labels",children:[Vo("span",{children:t.lowerBoundLabel}),Vo("span",{children:t.upperBoundLabel})]})]})}function ir({step:t,appearance:e,stepIndex:n,totalSteps:o,onPrevious:r,onSubmit:i,onDismiss:l}){var s;const[u,a]=ao(""),c=t.survey,d=null!==(s=null==e?void 0:e.whiteLabel)&&void 0!==s&&s,h=0===n,f="open"===(null==c?void 0:c.type),p=!!(r||i||l),v=p?void 0:{cursor:"default"},m=()=>{null==i||i(u.trim()||null)};return c?Vo(A,{children:[Vo("button",{class:"ph-tour-dismiss",onClick:l,"aria-label":"Close survey",style:v,children:Ko()}),Vo("div",{class:"ph-tour-survey-question",children:c.questionText}),f?Vo(or,{value:u,onChange:a,onSubmit:m,isInteractive:p}):Vo(rr,{survey:c,onSubmit:i,isInteractive:p}),Vo("div",{class:"ph-tour-footer",children:[Vo("span",{class:"ph-tour-progress",children:[n+1," of ",o]}),Vo("div",{class:"ph-tour-buttons",children:[!h&&Vo("button",{class:"ph-tour-button ph-tour-button--secondary",onClick:r,style:v,children:c.backButtonText||"Back"}),f&&Vo("button",{class:"ph-tour-button ph-tour-button--primary",onClick:m,style:v,children:c.submitButtonText||"Submit"})]})]}),!d&&Vo("a",{href:p?"https://posthog.com/product-tours":void 0,target:p?"_blank":void 0,rel:p?"noopener noreferrer":void 0,class:"ph-tour-branding",style:p?void 0:{cursor:"default",pointerEvents:"none"},children:["Survey by ",Jo]})]}):Vo("div",{})}const lr=e;function sr(t){return{top:"bottom",bottom:"top",left:"right",right:"left"}[t]}function ur({tour:t,step:e,stepIndex:n,totalSteps:o,targetElement:r,onNext:i,onPrevious:l,onDismiss:s,onSurveySubmit:u,onButtonClick:a}){var c;const[d,h]=ao("entering"),[f,p]=ao(null),[v,m]=ao(null),[g,b]=ao(!1),[y,w]=ao(e),[_,x]=ao(n),k=fo(null),T=fo(n),C=fo(!1),S=fo(r),q=!Lo(y)||"survey"===y.type;ho(()=>{S.current=r},[r]);const A=function(t){return Xn=8,po(function(){return t},[])}(()=>{const t=S.current;if(!t||!k.current)return;const e=k.current.getBoundingClientRect(),n={width:e.width,height:e.height},o=t.getBoundingClientRect();p(function(t,e){const n=Eo.innerWidth,o=Eo.innerHeight,{width:r,height:i}=e,l=t.top,s=o-t.bottom,u=t.left,a=t.top+t.height/2,c=t.left+t.width/2;if(n-t.right>=r+Oo){const e=t.right+Oo,{clamped:n,offset:r}=Do(a,i,o);return{position:"right",top:n,left:e,arrowOffset:r}}if(u>=r+Oo){const e=n-t.left+Oo,{clamped:r,offset:l}=Do(a,i,o);return{position:"left",top:r,right:e,arrowOffset:l}}if(l>=i+Oo&&i+Oo>s){const e=o-t.top+Oo,{clamped:i,offset:l}=Do(c,r,n);return{position:"top",bottom:e,left:i,arrowOffset:l}}const d=t.bottom+Oo,{clamped:h,offset:f}=Do(c,r,n);return{position:"bottom",top:d,left:h,arrowOffset:f}}(o,n)),m(function(t,e=8){return{top:t.top-e+"px",left:t.left-e+"px",width:`${t.width+2*e}px`,height:`${t.height+2*e}px`}}(o)),b(!0)});ho(()=>{!q&&!g&&k.current&&r&&A()},[q,g,r,A]),co(()=>{const t=n,o=()=>{T.current===t&&(h("visible"),C.current=!1)},r=()=>{S.current&&Lo(e)&&(S.current.isConnected||(S.current=zo(e).element),S.current)?function(t,e){const n=t.getBoundingClientRect(),o=lr.innerHeight,r=lr.innerWidth,i=o/6,l=r/6;if(!(i>n.top||n.bottom>o-i||l>n.left||n.right>r-l))return void e();t.scrollIntoView({behavior:"smooth",block:"center"});let s=n.top,u=0,a=!1;const c=()=>{if(a)return;const n=t.getBoundingClientRect();if(1>Math.abs(n.top-s)){if(u++,u>=3)return a=!0,void e()}else u=0;s=n.top,setTimeout(c,50)};setTimeout(c,30),setTimeout(()=>{a||(a=!0,e())},500)}(S.current,()=>{T.current===t&&(A(),setTimeout(o,50))}):setTimeout(o,50)};if(T.current===n)return T.current=n,C.current=!0,void r();T.current=n,C.current=!0,h("exiting"),setTimeout(()=>{T.current===t&&(Lo(e)&&(p(null),m(null),b(!1)),w(e),x(n),h("entering"),r())},150)},[r,n,e,A]),co(()=>{if("visible"!==d||q)return;const t=()=>{C.current||A()};return Hn(lr,"scroll",t,{capture:!0}),Hn(lr,"resize",t),()=>{null==lr||lr.removeEventListener("scroll",t,!0),null==lr||lr.removeEventListener("resize",t)}},[A,d,q]),co(()=>{const t=t=>{"Escape"===t.key&&s("escape_key")};return Hn(lr,"keydown",t),()=>{null==lr||lr.removeEventListener("keydown",t)}},[s]);const M="visible"===d,j="survey"===y.type,E=q||g,I=de(de({},y.maxWidth&&{width:`min(${y.maxWidth}px, calc(100vw - 16px))`,maxWidth:`min(${y.maxWidth}px, calc(100vw - 16px))`}),q?de(de({},{top:"auto",right:"auto",bottom:"auto",left:"auto",transform:"none"}),(()=>{var t;const e=function(t,e="right",n){if("external_survey"===t)return{};switch(e){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case"left":return{left:"30px"};case"center":return{left:"50%",transform:"translateX(-50%)"};default:return{right:"widget"===t&&"tab"===n?"60px":"30px"}}}(void 0,null!==(t=y.modalPosition)&&void 0!==t?t:"middle_center");return"top"in e||"bottom"in e?e:de(de({},e),{},{bottom:"30px"})})()):(()=>{if(!f)return{};const t="left"===f.position||"right"===f.position;return{top:Nt(f.top)?"auto":`${f.top}px`,bottom:Nt(f.bottom)?"auto":`${f.bottom}px`,left:Nt(f.left)?"auto":`${f.left}px`,right:Nt(f.right)?"auto":`${f.right}px`,transform:t?"translateY(-50%)":"translateX(-50%)"}})());return Vo("div",{class:"ph-tour-container",children:[!1!==(null===(c=t.appearance)||void 0===c?void 0:c.dismissOnClickOutside)&&Vo("div",{class:"ph-tour-click-overlay",onClick(t){t.stopPropagation(),s("user_clicked_outside")}}),Vo("div",{class:"ph-tour-modal-overlay",style:{opacity:q&&M?1:0,transition:"opacity 150ms ease-out",pointerEvents:"none"}}),Vo("div",{class:"ph-tour-spotlight",style:de(de({},M&&E&&v?v:{top:"50%",left:"50%",width:"0px",height:"0px"}),{},{opacity:!q&&M&&E?1:0,transition:"opacity 150ms ease-out"},"click"===y.progressionTrigger&&!q&&{pointerEvents:"auto",cursor:"pointer"}),onClick:"click"!==y.progressionTrigger||q?void 0:t=>{t.stopPropagation(),S.current&&S.current.click(),i()}}),Vo("div",{ref:k,class:`ph-tour-tooltip ${q?"ph-tour-tooltip--modal":""} ${j?"ph-tour-survey-step":""}`,style:de(de({},I),{},{opacity:M&&E?1:0,transition:"opacity 150ms ease-out"}),onClick(t){t.stopPropagation()},children:[!q&&f&&Vo("div",{class:`ph-tour-arrow ph-tour-arrow--${sr(f.position)}`,style:0!==f.arrowOffset?{"--ph-tour-arrow-offset":`${f.arrowOffset}px`}:void 0}),j?Vo(ir,{step:y,appearance:t.appearance,stepIndex:_,totalSteps:o,onSubmit:u,onPrevious:l,onDismiss:()=>s("user_clicked_skip")}):Vo(tr,{step:y,appearance:t.appearance,stepIndex:_,totalSteps:o,onNext:i,onPrevious:l,onDismiss:()=>s("user_clicked_skip"),onButtonClick:a})]})]})}function ar({class:t,href:e,onClick:n,children:o}){return Vo("a",{class:t,href:e,target:"_blank",rel:"noopener noreferrer",onClick:n,children:o})}function cr({class:t,onClick:e,children:n}){return Vo("div",{class:t,role:"button",tabIndex:0,onClick:e,onKeyDown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())},style:{cursor:"pointer"},children:n})}function dr({class:t,children:e}){return Vo("div",{class:t,children:e})}function hr(t){return Vo("div",{class:"ph-tour-banner-wrapper",children:Vo("div",{class:"ph-tour-banner-slide",children:Vo(fr,de({},t))})})}function fr({step:t,onDismiss:e,onActionClick:n,displayFrequency:o}){var r;const i=null!==(r=t.bannerConfig)&&void 0!==r?r:{behavior:"sticky"},l=i.action,s="always"!==o,u=["ph-tour-banner","sticky"===i.behavior&&"ph-tour-banner--sticky","custom"===i.behavior&&"ph-tour-banner--custom"].filter(Boolean).join(" "),a=Vo(A,{children:[Vo("div",{class:"ph-tour-banner-content",dangerouslySetInnerHTML:{__html:Bo(t)}}),s&&Vo("button",{class:"ph-tour-banner-dismiss",onClick(t){t.stopPropagation(),t.preventDefault(),e()},"aria-label":"Close banner",children:Ko()})]});return"link"===(null==l?void 0:l.type)&&l.link?Vo(ar,{class:u,href:l.link,onClick:n,children:a}):"trigger_tour"===(null==l?void 0:l.type)&&n?Vo(cr,{class:u,onClick:n,children:a}):Vo(dr,{class:u,children:a})}function pr(t){var e,n;return!(!(null===(e=t.conditions)||void 0===e?void 0:e.events)||0>=(null===(n=t.conditions.events.values)||void 0===n?void 0:n.length))}function vr(t){var e,n;return!(!(null===(e=t.conditions)||void 0===e?void 0:e.actions)||0>=(null===(n=t.conditions.actions.values)||void 0===n?void 0:n.length))}var mr=class{on(t,e){return this.ya[t]||(this.ya[t]=[]),this.ya[t].push(e),()=>{this.ya[t]=this.ya[t].filter(t=>t!==e)}}emit(t,e){for(const n of this.ya[t]||[])n(e);for(const n of this.ya["*"]||[])n(t,e)}constructor(){this.ya={}}};function gr(t,e,n){if(Ft(t))return!1;switch(n){case"exact":return t===e;case"contains":{const n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(n,"i").test(t)}case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}var br=class{constructor(t){this._instance=t,this.Ih=new Set,this.Mh=new Set,this.Eh=new mr,this.Ph=(t,e)=>this.Rh(t,e)&&this.Ah(t,e)&&this.Fh(t,e)&&this.Oh(t,e),this.Rh=(t,e)=>!(null==e?void 0:e.event)||(null==t?void 0:t.event)===(null==e?void 0:e.event)}init(){var t,e;Nt(null===(t=this._instance)||void 0===t?void 0:t._addCaptureHook)||(this.Dh=null===(e=this._instance)||void 0===e?void 0:e._addCaptureHook((t,e)=>{this.on(t,e)}))}dispose(){var t;null===(t=this.Dh)||void 0===t||t.call(this),this.Dh=void 0,this.Eh=new mr}register(t){var e,n;if(!Nt(null===(e=this._instance)||void 0===e?void 0:e._addCaptureHook)&&(t.forEach(t=>{var e;this.Ih.add(t),null===(e=t.steps)||void 0===e||e.forEach(t=>{this.Mh.add((null==t?void 0:t.event)||"")})}),null===(n=this._instance)||void 0===n?void 0:n.autocapture)){const t=new Set;this.Ih.forEach(e=>{var n;null===(n=e.steps)||void 0===n||n.forEach(e=>{(null==e?void 0:e.selector)&&t.add(e.selector)})}),this._instance.autocapture.setElementSelectors(t)}}replace(t){this.Ih.clear(),this.Mh.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.Mh.has(t)||this.Mh.has(e.event))&&this.Ih.forEach(t=>{this.Lh(e,t)&&this.Eh.emit("actionCaptured",t.name)})}Nh(t){this.onAction("actionCaptured",e=>t(e))}Lh(t,e){if(null==(null==e?void 0:e.steps))return!1;for(const n of e.steps)if(this.Ph(t,n))return!0;return!1}onAction(t,e){return this.Eh.on(t,e)}Ah(t,e){if(null==e?void 0:e.url){var n;const o=null==t||null===(n=t.properties)||void 0===n?void 0:n.$current_url;if(!o||"string"!=typeof o)return!1;if(!gr(o,e.url,e.url_matching||"contains"))return!1}return!0}Fh(t,e){return!!this.qh(t,e)&&!!this.jh(t,e)&&!!this.Bh(t,e)}qh(t,e){var n;if(!(null==e?void 0:e.href))return!0;const o=this.Hh(t);if(o.length>0)return o.some(t=>gr(t.href,e.href,e.href_matching||"exact"));const r=(null==t||null===(n=t.properties)||void 0===n?void 0:n.$elements_chain)||"";return!!r&&gr(function(t){const e=t.match(/(?::|")href="(.*?)"/);return e?e[1]:""}(r),e.href,e.href_matching||"exact")}jh(t,e){var n;if(!(null==e?void 0:e.text))return!0;const o=this.Hh(t);if(o.length>0)return o.some(t=>gr(t.text,e.text,e.text_matching||"exact")||gr(t.$el_text,e.text,e.text_matching||"exact"));const r=(null==t||null===(n=t.properties)||void 0===n?void 0:n.$elements_chain)||"";return!!r&&(i=function(t){const e=[],n=/(?::|")text="(.*?)"/g;let o;for(;!Ft(o=n.exec(t));)e.includes(o[1])||e.push(o[1]);return e}(r),l=e.text,s=e.text_matching||"exact",i.some(t=>gr(t,l,s)));var i,l,s}Bh(t,e){var n,o;if(!(null==e?void 0:e.selector))return!0;const r=null==t||null===(n=t.properties)||void 0===n?void 0:n.$element_selectors;if(null==r?void 0:r.includes(e.selector))return!0;const i=(null==t||null===(o=t.properties)||void 0===o?void 0:o.$elements_chain)||"";if(e.selector_regex&&i)try{return new RegExp(e.selector_regex).test(i)}catch(t){return!1}return!1}Hh(t){var e;return null==(null==t||null===(e=t.properties)||void 0===e?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Oh(t,e){return!(null==e?void 0:e.properties)||0===e.properties.length||Bn(e.properties.reduce((t,e)=>{const n=Pt(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:n,operator:e.operator||"exact"},t},{}),null==t?void 0:t.properties)}},yr=class{constructor(t){var e,n;this.zh=[],this._instance=t,this.Uh=new Map,this.Wh=new Map,this.Vh=new Map,this.Gh=null===(e=this._instance)||void 0===e||null===(n=e.onSessionId)||void 0===n?void 0:n.call(e,t=>this.Zh(t))}Qh(t){return!1}Jh(){return null}Kh(t){}Yh(){}Xh(t,e){return!!t&&Bn(t.propertyFilters,null==e?void 0:e.properties)}tc(t,e){const n=new Map;return t.forEach(t=>{var o;null===(o=t.conditions)||void 0===o||null===(o=o[e])||void 0===o||null===(o=o.values)||void 0===o||o.forEach(e=>{if(null==e?void 0:e.name){const o=n.get(e.name)||[];o.push(t.id),n.set(e.name,o)}})}),n}ec(t,e,n){const o=(n===qt?this.Uh:this.Wh).get(t);let r=[];return this.nc(t=>{r=t.filter(t=>null==o?void 0:o.includes(t.id))}),r.filter(o=>{var r;const i=null===(r=o.conditions)||void 0===r||null===(r=r[n])||void 0===r||null===(r=r.values)||void 0===r?void 0:r.find(e=>e.name===t);return this.Xh(i,e)})}register(t){this.sc(t,!1)}replace(t){this.sc(t,!0)}sc(t,e){var n;Nt(null===(n=this._instance)||void 0===n?void 0:n._addCaptureHook)||(this.rc(t,e),this.oc(t,e))}oc(t,e){const n=t.filter(t=>{var e;return null===(e=t.conditions)||void 0===e||null===(e=e.actions)||void 0===e||null===(e=e.values)||void 0===e?void 0:e.length});var o;if(e&&this.Vh.clear(),0===n.length)return void(e&&(null===(o=this.lc)||void 0===o||o.replace([])));this.lc||(this.lc=new br(this._instance),this.lc.init(),this.lc.Nh(t=>this.onAction(t)));const r=[];n.forEach(t=>{var e;null===(e=t.conditions)||void 0===e||null===(e=e.actions)||void 0===e||e.values.forEach(e=>{if(r.push(e),e.name){var n;const o=null!==(n=this.Vh.get(e.name))&&void 0!==n?n:[];o.includes(t.id)||o.push(t.id),this.Vh.set(e.name,o)}})}),e?this.lc.replace(r):this.lc.register(r)}ac(t,e){e.forEach((e,n)=>{var o;const r=null!==(o=t.get(n))&&void 0!==o?o:[];e.forEach(t=>{r.includes(t)||r.push(t)}),t.set(n,r)})}rc(t,e){var n,o;const r=t.filter(t=>{var e,n;return(null===(e=t.conditions)||void 0===e?void 0:e.events)&&(null===(n=t.conditions)||void 0===n||null===(n=n.events)||void 0===n||null===(n=n.values)||void 0===n?void 0:n.length)>0}),i=t.filter(t=>{var e,n;return(null===(e=t.conditions)||void 0===e?void 0:e.cancelEvents)&&(null===(n=t.conditions)||void 0===n||null===(n=n.cancelEvents)||void 0===n||null===(n=n.values)||void 0===n?void 0:n.length)>0}),l=this.tc(t,qt),s=this.tc(t,At);e?(this.Uh=l,this.Wh=s):(this.ac(this.Uh,l),this.ac(this.Wh,s)),(0!==r.length||0!==i.length)&&(null!==(n=this.Dh)&&void 0!==n||(this.Dh=null===(o=this._instance)||void 0===o?void 0:o._addCaptureHook((t,e)=>{this.onEvent(t,e)})))}onEvent(t,e){var n,o;const r=this.uc(),i=(null==e||null===(n=e.properties)||void 0===n?void 0:n.$survey_id)||(null==e||null===(o=e.properties)||void 0===o?void 0:o.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){const e=this.hc(t,i);if("consume"===e)return r.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.cc([i]);if("persist"===e)return r.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.dc(i),void this.vc([i])}if(this.Wh.has(t)){const n=this.ec(t,e,At);n.length>0&&(r.info("cancel event matched, cancelling items",{event:t,itemsToCancel:n.map(t=>t.id)}),this.cc(n.map(t=>t.id)),n.forEach(t=>this.fc(t.id)))}if(!this.Uh.has(t))return;r.info("event name matched",{event:t,eventPayload:e,items:this.Uh.get(t)});const l=this.ec(t,e,qt);this.gc(l.map(t=>t.id))}onAction(t){this.Vh.has(t)&&this.gc(this.Vh.get(t)||[])}gc(t){var e,n;if(0===t.length)return;const o=!!(null===(e=this._instance)||void 0===e||null===(n=e.get_session_id)||void 0===n?void 0:n.call(e)),r=[];for(const e of t)o&&this.Qh(e)?this.dc(e)&&this.mc(e):r.push(e);r.length>0&&(this.zh=[...new Set([...this.zh,...r])]),this.uc().info("updating activated items",{activatedItems:this.getActivatedIds()})}dc(t){this.zh=this.zh.filter(e=>e!==t);const e=this.yc();return!e.includes(t)&&(this.bc([...e,t]),this._c(),!0)}cc(t){const e=new Set(t);this.zh=this.zh.filter(t=>!e.has(t));const n=this.wc(),o=n.filter(t=>!e.has(t));o.length!==n.length&&(this.bc(o),0===o.length&&this.kc()),this.vc(t)}Sc(){var t;const e=this.Jh();if(!e)return{};const n=null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t?void 0:t.props[e];return n&&"object"==typeof n?n:{}}mc(t){if(!this.Jh())return;const e=this.Sc();this.Kh(de(de({},e),{},{[t]:Date.now()}))}vc(t){if(!this.Jh())return;const e=this.Sc(),n={};let o=!1;for(const[r,i]of Object.entries(e))t.includes(r)?o=!0:n[r]=i;o&&((t=>{if((t=>t===Object(t)&&!Pt(t))(t)){for(const e in t)if(Ot.call(t,e))return!1;return!0}return!1})(n)?this.Yh():this.Kh(n))}xc(){this.Jh()&&this.Yh()}getActivationTimestamp(t){if(!this.yc().includes(t))return;const e=this.Sc()[t];return Bt(e)?e:void 0}wc(){var t;const e=this.Cc();return(null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t?void 0:t.props[e])||[]}yc(){var t,e,n;const o=this.wc();if(0===o.length)return[];const r=null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t?void 0:t.props[this.$c()],i=null===(e=this._instance)||void 0===e||null===(n=e.get_session_id)||void 0===n?void 0:n.call(e);return i&&r===i?o:[]}_c(){var t,e;const n=null===(t=this._instance)||void 0===t||null===(e=t.get_session_id)||void 0===e?void 0:e.call(t);n&&this.Tc(n)}kc(){this.Ic()}Zh(t){var e;const n=null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e?void 0:e.props[this.$c()];if(n&&n!==t){const t=this.wc(),e=this.Sc();t.length>0&&(this.bc([]),t.filter(t=>Bt(e[t])).forEach(t=>this.fc(t))),this.kc(),this.xc()}}getActivatedIds(){return[...new Set([...this.yc(),...this.zh])].filter(t=>!this.Mc(t))}dispose(){var t,e,n;null===(t=this.Gh)||void 0===t||t.call(this),this.Gh=void 0,null===(e=this.Dh)||void 0===e||e.call(this),this.Dh=void 0,null===(n=this.lc)||void 0===n||n.dispose(),this.lc=void 0}reset(){this.zh=[],this.wc().length>0&&this.bc([]),this.kc(),this.xc()}getEventToItemsMap(){return this.Uh}Ec(){return this.lc}};const wr=Pn("[Product Tour Event Receiver]");var _r=class extends yr{constructor(t){super(t)}Cc(){return"$product_tours_activated"}$c(){return"$product_tours_activated_session"}Pc(){return J}nc(t){var e;null===(e=this._instance)||void 0===e||null===(e=e.productTours)||void 0===e||e.getProductTours(t)}fc(t){var e;null===(e=this._instance)||void 0===e||null===(e=e.productTours)||void 0===e||e.cancelPendingTour(t)}uc(){return wr}bc(t){var e;null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e||e.register({$product_tours_activated:t})}Tc(t){var e;null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e||e.register({$product_tours_activated_session:t})}Ic(){var t;null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t||t.unregister("$product_tours_activated_session")}Mc(t){if(!t)return!0;const e=`${So}${t}`;return!(!Un.Ot(`${$o}${t}`)&&!Un.Ot(e))}hc(t){return t===this.Pc()?"consume":"ignore"}getTours(){return this.getActivatedIds()}};const xr=Pn("[Product Tours]"),kr=r,Tr=e;let Cr;const $r=new Map;function Sr(t,n){const o=t.conditions;if(!(null==o?void 0:o.url))return!0;const r=function(t){var n;const o=null==e||null===(n=e.location)||void 0===n?void 0:n.href;return Nt(o)?void 0:function(t,e){var n;const o=null==t||null===(n=t.config)||void 0===n?void 0:n.get_current_url;if(!Rt(o))return e;try{const t=o(e);return(t=>"[object String]"==Dt.call(t))(t)&&t?t:e}catch(t){return Dn.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,o)}(n);if(!r)return!1;r!==Cr&&($r.clear(),Cr=r);const i=$r.get(t.id);if(!Nt(i))return i;const l=o.urlMatchType||"icontains";let s;return s="exact"===l?No(r)===No(o.url):Fn[l]([o.url],[r]),$r.set(t.id,s),s}function qr(t){const e=new Date;return!(t.start_date&&e<new Date(t.start_date)||t.end_date&&e>new Date(t.end_date))}function Ar(t,n){var r;return qr(t)&&Sr(t,n)&&function(t){var n,r,l;if(!t||0===t.length)return!0;if(!i)return!1;const s=function(t,e){var n;const o=function(t){return le.test(t)?Kt:ie.test(t)?Jt:re.test(t)?Xt:new RegExp(ee,"i").test(t)?ee:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?"Windows Phone":/iPad/.test(t)?Yt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Gt:se.test(t)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(te,"i").test(t)?te:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Ut).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?"Android":Wt:new RegExp("(pda|Mobile)","i").test(t)?ne:new RegExp(Qt,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?oe:""}(t);return o===Yt||o===Wt||"Kobo"===o||"Kindle Fire"===o||o===oe?Qt:o===Kt||o===Xt||o===Jt||o===ee?"Console":o===Gt?"Wearable":o?Ut:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(n=null==e?void 0:e.maxTouchPoints)&&void 0!==n?n:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(i=null==e?void 0:e.screenHeight)&&void 0!==i?i:0)/(null!==(l=null==e?void 0:e.devicePixelRatio)&&void 0!==l?l:1)?Ut:Qt:"Desktop";var r,i,l}(i,{userAgentDataPlatform:null==o||null===(n=o.userAgentData)||void 0===n?void 0:n.platform,maxTouchPoints:null==o?void 0:o.maxTouchPoints,screenWidth:null==e||null===(r=e.screen)||void 0===r?void 0:r.width,screenHeight:null==e||null===(l=e.screen)||void 0===l?void 0:l.height,devicePixelRatio:null==e?void 0:e.devicePixelRatio});return Fn.icontains(t,[s])}(null===(r=t.conditions)||void 0===r?void 0:r.deviceTypes)}const Mr="ph-product-tour-container",jr="data-ph-tour-trigger";var Er=class{constructor(t){this.cv=null,this.kv=0,this.tm=!1,this.nm=!1,this.om=null,this.rm=new Map,this.im=new Map,this.lm=new Set,this.sm=new Set,this.um=()=>{kr.hidden&&this.om?(clearInterval(this.om),this.om=null):kr.hidden||this.om||(this.om=setInterval(()=>{this.am()},1e3),this.am())},this.nextStep=()=>{if(!this.cv)return;const t=this.cv.steps[this.kv];this.ko("product tour step completed",{[X]:this.cv.id,[ot]:t.id,[rt]:this.kv}),this.cv.steps.length-1>this.kv?(this.dm(this.kv+1),this.hm()):this.fm()},this.previousStep=()=>{this.cv&&0!==this.kv&&(this.dm(this.kv-1),this.hm())},this.dismissTour=(t="user_clicked_skip")=>{if(!this.cv)return;const e=this.cv.steps[this.kv];this.ko("product tour dismissed",{[X]:this.cv.id,[ot]:e.id,[rt]:this.kv,[lt]:t}),this.tm||(Un.At(`${So}${this.cv.id}`,!0),this._instance.capture("$set",{$set:{[`$product_tour_dismissed/${this.cv.id}`]:!0}})),Tr.dispatchEvent(new CustomEvent("PHProductTourDismissed",{detail:{tourId:this.cv.id,reason:t}})),this.pm()},this.vm=()=>{var t;if(!this.cv)return;const e=this.gm();if(!e)return;const n=null===(t=e.bannerConfig)||void 0===t?void 0:t.action;this.ko("product tour banner action clicked",{[X]:this.cv.id,[tt]:this.cv.name,[et]:this.cv.current_iteration||1,[ot]:e.id,[rt]:this.kv,[ut]:null==n?void 0:n.type,[at]:null==n?void 0:n.link,[ct]:null==n?void 0:n.tourId}),"trigger_tour"===(null==n?void 0:n.type)&&n.tourId&&(this.pm(),this.showTourById(n.tourId))},this.bm=t=>{if(this.cv){const e=this.cv.steps[this.kv];e&&this.ko("product tour button clicked",de(de({[X]:this.cv.id,[tt]:this.cv.name,[et]:this.cv.current_iteration||1,[ot]:e.id,[rt]:this.kv,[st]:t.text,[ut]:t.action},t.link&&{[at]:t.link}),t.tourId&&{[ct]:t.tourId}))}switch(t.action){case"dismiss":this.dismissTour("user_clicked_skip");break;case"next_step":this.nextStep();break;case"previous_step":this.previousStep();break;case"link":this.fm();break;case"trigger_tour":t.tourId&&(this.fm(),this.showTourById(t.tourId))}},this._instance=t,this.ym=new _r(t)}wm(t){const e=t.filter(t=>!t.disable_image_preload).flatMap(t=>t.steps.flatMap(Fo));for(const t of e)this.sm.has(t)||(this.sm.add(t),(new Image).src=t)}gm(){var t;if(!this.cv)return null;const e=this.cv.steps[this.kv];if(!e)return null;const n=null!==(t=this._instance.config.override_display_language)&&void 0!==t?t:navigator.language||navigator.userLanguage;return function(t,e){var n;if(!e||!t.translations)return t;const o=t.translations,r=null!==(n=o[e])&&void 0!==n?n:o[e.split("-")[0]];if(!r)return Mo.info(`No matching translation for "${e}" in step ${t.id}, using default`),t;const i=de({},t);return Nt(r.content)||(i.content=r.content),Nt(r.contentHtml)||(i.contentHtml=r.contentHtml),r.buttons&&i.buttons&&(i.buttons={primary:i.buttons.primary&&de(de({},i.buttons.primary),r.buttons.primary),secondary:i.buttons.secondary&&de(de({},i.buttons.secondary),r.buttons.secondary)}),r.survey&&i.survey&&(i.survey=de(de({},i.survey),r.survey)),i}(e,null!=n?n:null)}dm(t){this.kv=t,this._m()}_m(){this.cv&&!this.tm&&Wn.At(qo,{tourId:this.cv.id,stepIndex:this.kv})}xm(){Wn.Lt(qo)}km(){const t=Wn.Ot(qo);if(!t)return null;try{return JSON.parse(t)}catch(t){return null}}start(){if(this.om)return;const t=this.km();t?this.Tm(t.tourId,t.stepIndex,()=>{this.Cm()}):this.Cm()}Cm(){this.om=setInterval(()=>{this.am()},1e3),this.am(!0),Hn(kr,"visibilitychange",this.um)}Tm(t,e,n){var o;null===(o=this._instance.productTours)||void 0===o||o.getProductTours(o=>{const r=o.find(e=>e.id===t);r?(this.cv=r,this.kv=e,this.nm=!0,this.hm()):o.length>0&&this.xm(),n()})}stop(){this.om&&(clearInterval(this.om),this.om=null),kr.removeEventListener("visibilitychange",this.um),this.$m(),this.Sm(),this.pm()}am(t){var e;(null==kr?void 0:kr.getElementById("__POSTHOG_TOOLBAR__"))||null===(e=this._instance.productTours)||void 0===e||e.getProductTours(t=>{if(0===t.length)return void this.$m();this.wm(t);const e=new Set,n=t.filter(t=>!this.lm.has(t.id)&&(pr(t)||vr(t)));n.length>0&&(this.ym.register(n),n.forEach(t=>this.lm.add(t.id)));const o=this.cv?[]:this.ym.getTours();for(const n of t){var r;const t=null===(r=n.conditions)||void 0===r?void 0:r.selector;if(t&&(e.add(n.id),this.qm(n,t)),this.cv)continue;const i=vr(n)||pr(n);if(n.auto_launch&&this.Am(n)){if(!i){this.Mm(n,"auto");continue}o.includes(n.id)&&this.Mm(n,"event")}}this.rm.forEach(({tour:t})=>{e.has(t.id)||this.jm(t.id)})},t)}Mm(t,e){var n;const o=(null===(n=t.conditions)||void 0===n?void 0:n.autoShowDelaySeconds)||0;o>0?this.isTourPending(t.id)||this.queueTourWithDelay(t.id,o,e):this.showTour(t,{reason:e})}Am(t){var e,n,o;if(!Ar(t,this._instance))return xr.info(`Tour ${t.id} failed conditions check`),!1;const r=null!==(e=t.display_frequency)&&void 0!==e?e:"until_interacted",i=`${Co}${t.id}`,l=`${$o}${t.id}`,s=`${So}${t.id}`;switch(r){case"show_once":if(Un.Ot(i))return xr.info(`Tour ${t.id} already shown (show_once frequency)`),!1;break;case"until_interacted":if(Un.Ot(l)||Un.Ot(s))return xr.info(`Tour ${t.id} already completed or dismissed`),!1}var u,a;if(!function(t){if(!t)return!0;const{days:e,types:n}=t;if(!e||!n||0===n.length)return!0;let o=null;for(const t of n){const e=Un.Ot(`${Ao}${t}`);if(e)try{const t=JSON.parse(e),n=new Date(t);isNaN(n.getTime())||o&&o>=n||(o=n)}catch(t){}}return!o||function(t,e){if(!t||!e)return!0;const n="string"==typeof e?new Date(e):e,o=Math.abs((new Date).getTime()-n.getTime());return Math.ceil(o/864e5)>t}(e,o)}(null===(n=t.conditions)||void 0===n?void 0:n.seenTourWaitPeriod))return xr.info(`Cannot show tour ${t.id}: user has seen a ${null===(u=t.conditions)||void 0===u||null===(u=u.seenTourWaitPeriod)||void 0===u?void 0:u.types} tour within the last ${null===(a=t.conditions)||void 0===a||null===(a=a.seenTourWaitPeriod)||void 0===a?void 0:a.days} days.`),!1;if(!this.Em({flagKey:t.internal_targeting_flag_key}))return xr.info(`Tour ${t.id} failed feature flag check: ${t.internal_targeting_flag_key}`),!1;const c=null===(o=t.conditions)||void 0===o?void 0:o.linkedFlagVariant;return!!this.Em({flagKey:t.linked_flag_key,flagVariant:c})||(xr.info(`Tour ${t.id} failed feature flag check: ${t.linked_flag_key}, variant: ${c}`),!1)}showTour(t,e){var n;const o=null!==(n=null==e?void 0:e.reason)&&void 0!==n?n:"auto";this.cancelPendingTour(t.id),this.cv=t,this.dm(0);const r=this.hm();return r?(this.ko(J,{[X]:t.id,[tt]:t.name,[et]:t.current_iteration||1,[nt]:o,[St]:t.tour_type}),this.tm||(Un.At(`${Co}${t.id}`,!0),Un.At(`${Ao}${t.tour_type}`,(new Date).toISOString()),this._instance.capture("$set",{$set:{[`$product_tour_shown/${t.id}`]:!0}}))):this.pm(),r}showTourById(t,e){var n;xr.info(`showTourById(${t})`),null===(n=this._instance.productTours)||void 0===n||n.getProductTours(n=>{const o=n.find(e=>e.id===t);o?this.showTour(o,{reason:null!=e?e:"api"}):xr.warn("could not find tour",t)})}previewTour(t){xr.info(`Previewing tour ${t.id}`),this.pm(),this.tm=!0,this.cv=t,this.kv=0,this.hm()}fm(){this.cv&&(this.ko("product tour completed",{[X]:this.cv.id,[dt]:this.cv.steps.length}),this.tm||(Un.At(`${$o}${this.cv.id}`,!0),this._instance.capture("$set",{$set:{[`$product_tour_completed/${this.cv.id}`]:!0}})),Tr.dispatchEvent(new CustomEvent("PHProductTourCompleted",{detail:{tourId:this.cv.id}})),this.pm())}hm(t=0){var e;if(!this.cv)return!1;const n=this.gm();if(!n)return xr.warn(`Step ${this.kv} not found in tour ${this.cv.id}`),this.pm(),!1;if("banner"===n.type)return this.Im(),this.nm=!1,this.Lm(),!0;if("survey"===n.type)return n.survey?(this.zm(),!0):(xr.warn("Unable to render survey step - survey data not found"),!1);if(!Lo(n))return this.Im(),this.nm=!1,this.Om(null),!0;const o=zo(n),r={[Ct]:null!==(e=n.useManualSelector)&&void 0!==e&&e,[$t]:!!n.inferenceData},i=this.kv>0?this.cv.steps[this.kv-1]:null,l="click"===(null==i?void 0:i.progressionTrigger)||this.nm;if("not_found"===o.error||"not_visible"===o.error){if(l&&20>t)return setTimeout(()=>{this.hm(t+1)},100),!1;const e=100*t;return this.Dm(o,de({[_t]:l,[xt]:e},r)),0!==this.kv||this.nm?(xr.warn(`Tour "${this.cv.name}" dismissed: element for step ${this.kv} became unavailable (${o.error})`+(l?` after waiting ${e}ms`:"")),this.dismissTour("element_unavailable"),!1):(xr.warn(`Tour "${this.cv.name}" failed to show: element for first step not found (${o.error})`),!1)}if("multiple_matches"===o.error&&this.Dm(o,r),!o.element)return!1;const s=o.element,u=function(t){var e;return{tag:t.tagName,id:t.id||void 0,classes:t.className||void 0,text:(null===(e=t.innerText)||void 0===e?void 0:e.slice(0,100))||void 0}}(s);return this.Im(de({[ht]:n.selector,[ft]:!0,[pt]:u.tag,[vt]:u.id,[mt]:u.classes,[gt]:u.text},r)),this.nm=!1,this.Om(s),!0}Om(t,e,n){if(!this.cv)return;const o=this.gm();if(!o)return;const{shadow:r}=function(t,e){const n=`${Mr}-${t.id}`,o=kr.querySelector(`.${n}`);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};const r=kr.createElement("div");r.className=n,Po(r,t.appearance);const i=r.attachShadow({mode:"open"}),l=Io(e);return l&&i.appendChild(l),kr.body.appendChild(r),{shadow:i,isNewlyCreated:!0}}(this.cv,this._instance);G(Vo(ur,{tour:this.cv,step:o,stepIndex:this.kv,totalSteps:this.cv.steps.length,targetElement:t,onNext:this.nextStep,onPrevious:this.previousStep,onDismiss:n||this.dismissTour,onSurveySubmit:e,onButtonClick:this.bm}),r)}Lm(){if(!this.cv)return;const t=this.gm();if(!t)return;const e=function(t,e,n){var o;const r=`${Mr}-${t.id}`,i=kr.querySelector(`.${r}`);if(i&&i.shadowRoot)return{shadow:i.shadowRoot,isNewlyCreated:!1};const l=kr.createElement("div");l.className=r,Po(l,t.appearance),Nt(null==n||null===(o=n.animation)||void 0===o?void 0:o.duration)||l.style.setProperty("--ph-tour-banner-animation-duration",`${n.animation.duration}ms`);const s=l.attachShadow({mode:"open"}),u=Io(e);if(u&&s.appendChild(u),"custom"===(null==n?void 0:n.behavior)&&n.selector){const t=kr.querySelector(n.selector);if(!t)return xr.warn(`Custom banner container not found: ${n.selector}. Banner will not be displayed.`),null;t.appendChild(l)}else kr.body.insertBefore(l,kr.body.firstChild);return{shadow:s,isNewlyCreated:!0}}(this.cv,this._instance,t.bannerConfig);var n;if(!e)return this.ko("product tour banner container selector failed",{[X]:this.cv.id,[kt]:null==t||null===(n=t.bannerConfig)||void 0===n?void 0:n.selector}),void this.dismissTour("container_unavailable");const{shadow:o}=e;G(Vo(hr,{step:t,onDismiss:()=>this.dismissTour("user_clicked_skip"),onActionClick:this.vm,displayFrequency:this.cv.display_frequency}),o)}zm(){var t,e,n;if(!this.cv)return;const o=this.cv.id,r=this.gm();if(!r)return;const i=r.linkedSurveyId,l=r.linkedSurveyQuestionId,s=(null===(t=r.survey)||void 0===t?void 0:t.questionText)||"";this.Im({[Tt]:i}),this.ko("survey shown",{[Mt]:i,[Lt]:o,sessionRecordingUrl:null===(e=(n=this._instance).get_session_replay_url)||void 0===e?void 0:e.call(n)}),this.Om(null,t=>{var e,n;const r=l?`$survey_response_${l}`:"$survey_response";this.ko("survey sent",de({[Mt]:i,[Lt]:o,[Et]:[{id:l,question:s,response:t}],[It]:!0,sessionRecordingUrl:null===(e=(n=this._instance).get_session_replay_url)||void 0===e?void 0:e.call(n)},!Zt(t)&&{[r]:t})),xr.info(`Survey ${i} completed`,Zt(t)?"(skipped)":`with response: ${t}`),this.nextStep()},t=>{var e,n;this.ko("survey dismissed",{[Mt]:i,[Lt]:o,[Et]:[{id:l,question:s,response:null}],[jt]:!1,sessionRecordingUrl:null===(e=(n=this._instance).get_session_replay_url)||void 0===e?void 0:e.call(n)}),xr.info(`Survey ${i} dismissed`),this.dismissTour(t)}),xr.info(`Rendered survey step for tour step ${this.kv}`)}Em({flagKey:t,flagVariant:e}){var n;if(!t)return!0;const o=!!(null===(n=this._instance.featureFlags)||void 0===n?void 0:n.isFeatureEnabled(t,{send_event:!t.startsWith("product-tour-targeting-")}));let r=!0;var i;return e&&(r=(null===(i=this._instance.featureFlags)||void 0===i?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),o&&r}pm(){this.cv&&function(t){const e=kr.querySelector(`.${Mr}-${t}`);(null==e?void 0:e.shadowRoot)&&G(null,e.shadowRoot),null==e||e.remove()}(this.cv.id),this.cv=null,this.kv=0,this.tm=!1,this.nm=!1,this.xm()}qm(t,e){const n=kr.querySelector(e),o=this.rm.get(t.id);if(n){if(o){if(n===o.element)return;xr.info(`Trigger element changed for tour ${t.id}. Re-attaching listener.`),this.jm(t.id)}if(!n.hasAttribute(jr)){const o=n=>{var o;if(this.cv)return void xr.info(`Tour ${t.id} trigger clicked but another tour is active`);let r;if(null===(o=this._instance.productTours)||void 0===o||o.getProductTours(e=>{r=e.find(e=>e.id===t.id)}),!r)return xr.warn(`Tour ${t.id} no longer exists. Removing stale listener.`),void this.jm(t.id);qr(r)?(xr.info(`Tour ${t.id} triggered by click on ${e}`),this.showTour(r,{reason:"trigger"})?n.preventDefault():xr.info(`Tour ${t.id} failed to show; not intercepting click.`)):xr.warn(`Tour ${t.id} trigger clicked, but tour is not launched - not showing tour.`)};Hn(n,"click",o),n.setAttribute(jr,t.id),this.rm.set(t.id,{element:n,listener:o,tour:t}),xr.info(`Attached trigger listener for tour ${t.id} on ${e}`)}}else o&&this.jm(t.id)}jm(t){const e=this.rm.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(jr),this.rm.delete(t),xr.info(`Removed trigger listener for tour ${t}`))}$m(){this.rm.forEach((t,e)=>{this.jm(e)})}ko(t,e){this.tm||this._instance.capture(t,e)}Im(t){if(!this.cv)return;const e=this.cv.steps[this.kv];this.ko("product tour step shown",de({[X]:this.cv.id,[ot]:e.id,[rt]:this.kv,[it]:e.type},t))}Dm(t,e){if(!this.cv)return;const n=this.cv.steps[this.kv];this.ko("product tour step selector failed",de({[X]:this.cv.id,[ot]:n.id,[rt]:this.kv,[ht]:n.selector,[bt]:t.error,[yt]:t.matchCount,[wt]:"runtime"},e))}getActiveProductTours(t){var e;null===(e=this._instance.productTours)||void 0===e||e.getProductTours((e,n)=>{t((null==n?void 0:n.isLoaded)?e.filter(t=>this.Am(t)):[],n)})}resetTour(t){Un.Lt(`${Co}${t}`),Un.Lt(`${$o}${t}`),Un.Lt(`${So}${t}`)}resetAllTours(){const t=null==Tr?void 0:Tr.localStorage;if(!t)return;const e=[];for(let n=0;t.length>n;n++){const o=t.key(n);((null==o?void 0:o.startsWith("ph_product_tour_shown_"))||(null==o?void 0:o.startsWith("ph_product_tour_completed_"))||(null==o?void 0:o.startsWith("ph_product_tour_dismissed_"))||(null==o?void 0:o.startsWith("ph_last_seen_tour_date_")))&&e.push(o)}e.forEach(t=>Un.Lt(t))}cancelPendingTour(t){const e=this.im.get(t);e&&(clearTimeout(e),this.im.delete(t),xr.info(`Cancelled pending tour: ${t}`))}Sm(){this.im.forEach(t=>clearTimeout(t)),this.im.clear()}isTourPending(t){return this.im.has(t)}queueTourWithDelay(t,e,n){xr.info(`Queueing tour ${t} with ${e}s delay`);const o=setTimeout(()=>{this.im.delete(t),xr.info(`Delay elapsed for tour ${t}, showing now`),this.showTourById(t,n)},1e3*e);this.im.set(t,o)}};function Ir(t,e){if(!r)return;const n=new Er(t);return e&&n.start(),n}const Lr="undefined"!=typeof globalThis?globalThis:e;Lr&&"undefined"==typeof self&&(Lr.self=Lr),Lr&&"undefined"==typeof File&&(Lr.File=function(){});const zr=null!=e?e:{};zr.__PosthogExtensions__=zr.__PosthogExtensions__||{},zr.__PosthogExtensions__.generateProductTours=Ir,t.default=Ir,t.elementIsVisible=jn,t.findElement=zn,t.getElementPath=function(t,e=4){if(!t)return null;const n=[];let o=t;for(;o&&e>n.length&&"BODY"!==o.tagName;){let t=o.tagName.toLowerCase();o.id?t+=`#${o.id}`:o.classList.length&&(t+=`.${o.classList[0]}`),n.unshift(t),o=o.parentElement}return n.join(" > ")}}({});
1
+ !function(t){Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e="u">typeof window?window:void 0,n="u">typeof globalThis?globalThis:e,o=null==n?void 0:n.navigator,r=null==n?void 0:n.document;null!=n&&n.XMLHttpRequest&&new n.XMLHttpRequest;const i=null==o?void 0:o.userAgent;var l,s,u,a,c,d,h,f,p,v,m,g,b,y,w,_={},x=[],k=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,T=Array.isArray;function C(t,e){for(var n in e)t[n]=e[n];return t}function S(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function q(t,e,n,o,r){var i={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==r?++u:r,__i:-1,__u:0};return null==r&&null!=s.vnode&&s.vnode(i),i}function A(t){return t.children}function M(t,e){this.props=t,this.context=e}function $(t,e){if(null==e)return t.__?$(t.__,t.__i+1):null;for(var n;t.__k.length>e;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?$(t):null}function j(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,o=[],r=[],i=C({},e);i.__v=e.__v+1,s.vnode&&s.vnode(i),F(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,o,null==n?$(e):n,!!(32&e.__u),r),i.__v=e.__v,i.__.__k[i.__i]=i,H(o,i,r),e.__e=e.__=null,i.__e!=n&&E(i)}}function E(t){if(null!=(t=t.__)&&null!=t.__c)return t.__e=t.__c.base=null,t.__k.some(function(e){if(null!=e&&null!=e.__e)return t.__e=t.__c.base=e.__e}),E(t)}function I(t){(!t.__d&&(t.__d=!0)&&a.push(t)&&!L.__r++||c!=s.debounceRendering)&&((c=s.debounceRendering)||d)(L)}function L(){try{for(var t,e=1;a.length;)a.length>e&&a.sort(h),t=a.shift(),e=a.length,j(t)}finally{a.length=L.__r=0}}function z(t,e,n,o,r,i,l,s,u,a,c){var d,h,f,p,v,m,g,b=o&&o.__k||x,y=e.length;for(u=O(n,e,b,u,y),d=0;y>d;d++)null!=(f=n.__k[d])&&(h=-1!=f.__i&&b[f.__i]||_,f.__i=d,m=F(t,f,h,r,i,l,s,u,a,c),p=f.__e,f.ref&&h.ref!=f.ref&&(h.ref&&Q(h.ref,null,f),c.push(f.ref,f.__c||p,f)),null==v&&null!=p&&(v=p),(g=!!(4&f.__u))||h.__k===f.__k?(u=D(f,u,t,g),g&&h.__e&&(h.__e=null)):"function"==typeof f.type&&void 0!==m?u=m:p&&(u=p.nextSibling),f.__u&=-7);return n.__e=v,u}function O(t,e,n,o,r){var i,l,s,u,a,c=n.length,d=c,h=0;for(t.__k=new Array(r),i=0;r>i;i++)null!=(l=e[i])&&"boolean"!=typeof l&&"function"!=typeof l?("string"==typeof l||"number"==typeof l||"bigint"==typeof l||l.constructor==String?l=t.__k[i]=q(null,l,null,null,null):T(l)?l=t.__k[i]=q(A,{children:l},null,null,null):void 0===l.constructor&&l.__b>0?l=t.__k[i]=q(l.type,l.props,l.key,l.ref?l.ref:null,l.__v):t.__k[i]=l,u=i+h,l.__=t,l.__b=t.__b+1,s=null,-1!=(a=l.__i=P(l,n,u,d))&&(d--,(s=n[a])&&(s.__u|=2)),null==s||null==s.__v?(-1==a&&(r>c?h--:c>r&&h++),"function"!=typeof l.type&&(l.__u|=4)):a!=u&&(a==u-1?h--:a==u+1?h++:(a>u?h--:h++,l.__u|=4))):t.__k[i]=null;if(d)for(i=0;c>i;i++)null!=(s=n[i])&&!(2&s.__u)&&(s.__e==o&&(o=$(s)),W(s,s));return o}function D(t,e,n,o){var r,i;if("function"==typeof t.type){for(r=t.__k,i=0;r&&r.length>i;i++)r[i]&&(r[i].__=t,e=D(r[i],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=$(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do{e=e&&e.nextSibling}while(null!=e&&8==e.nodeType);return e}function P(t,e,n,o){var r,i,l,s=t.key,u=t.type,a=e[n],c=null!=a&&!(2&a.__u);if(null===a&&null==s||c&&s==a.key&&u==a.type)return n;if(o>(c?1:0))for(r=n-1,i=n+1;r>=0||e.length>i;)if(null!=(a=e[l=0>r?i++:r--])&&!(2&a.__u)&&s==a.key&&u==a.type)return l;return-1}function R(t,e,n){"-"==e[0]?t.setProperty(e,null==n?"":n):t[e]=null==n?"":"number"!=typeof n||k.test(e)?n:n+"px"}function N(t,e,n,o,r){var i,l;t:if("style"==e)if("string"==typeof n)t.style.cssText=n;else{if("string"==typeof o&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||R(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||R(t.style,e,n[e])}else if("o"==e[0]&&"n"==e[1])i=e!=(e=e.replace(m,"$1")),l=e.toLowerCase(),e=l in t||"onFocusOut"==e||"onFocusIn"==e?l.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=n,n?o?n[v]=o[v]:(n[v]=g,t.addEventListener(e,i?y:b,i)):t.removeEventListener(e,i?y:b,i);else{if("http://www.w3.org/2000/svg"==r)e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=e&&"height"!=e&&"href"!=e&&"list"!=e&&"form"!=e&&"tabIndex"!=e&&"download"!=e&&"rowSpan"!=e&&"colSpan"!=e&&"role"!=e&&"popover"!=e&&e in t)try{t[e]=null==n?"":n;break t}catch(t){}"function"==typeof n||(null==n||!1===n&&"-"!=e[4]?t.removeAttribute(e):t.setAttribute(e,"popover"==e&&1==n?"":n))}}function Z(t){return function(e){if(this.l){var n=this.l[e.type+t];if(null==e[p])e[p]=g++;else if(n[v]>e[p])return;return n(s.event?s.event(e):e)}}}function F(t,e,n,o,r,i,l,u,a,c){var d,h,f,p,v,m,g,b,y,w,$,_,k,q,j,E,I=e.type;if(void 0!==e.constructor)return null;128&n.__u&&(a=!!(32&n.__u),i=[u=e.__e=n.__e]),(d=s.__b)&&d(e);t:if("function"==typeof I){h=l.length;try{if(y=e.props,w=I.prototype&&I.prototype.render,$=(d=I.contextType)&&o[d.__c],_=d?$?$.props.value:d.__:o,n.__c?b=(f=e.__c=n.__c).__=f.__E:(w?e.__c=f=new I(y,_):(e.__c=f=new M(y,_),f.constructor=I,f.render=Y),$&&$.sub(f),f.state||(f.state={}),f.__n=o,p=f.__d=!0,f.__h=[],f._sb=[]),w&&null==f.__s&&(f.__s=f.state),w&&null!=I.getDerivedStateFromProps&&(f.__s==f.state&&(f.__s=C({},f.__s)),C(f.__s,I.getDerivedStateFromProps(y,f.__s))),v=f.props,m=f.state,f.__v=e,p)w&&null==I.getDerivedStateFromProps&&null!=f.componentWillMount&&f.componentWillMount(),w&&null!=f.componentDidMount&&f.__h.push(f.componentDidMount);else{if(w&&null==I.getDerivedStateFromProps&&y!==v&&null!=f.componentWillReceiveProps&&f.componentWillReceiveProps(y,_),e.__v==n.__v||!f.__e&&null!=f.shouldComponentUpdate&&!1===f.shouldComponentUpdate(y,f.__s,_)){e.__v!=n.__v&&(f.props=y,f.state=f.__s,f.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(t){t&&(t.__=e)}),x.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&l.push(f);break t}null!=f.componentWillUpdate&&f.componentWillUpdate(y,f.__s,_),w&&null!=f.componentDidUpdate&&f.__h.push(function(){f.componentDidUpdate(v,m,g)})}if(f.context=_,f.props=y,f.__P=t,f.__e=!1,k=s.__r,q=0,w)f.state=f.__s,f.__d=!1,k&&k(e),d=f.render(f.props,f.state,f.context),x.push.apply(f.__h,f._sb),f._sb=[];else do{f.__d=!1,k&&k(e),d=f.render(f.props,f.state,f.context),f.state=f.__s}while(f.__d&&25>++q);f.state=f.__s,null!=f.getChildContext&&(o=C(C({},o),f.getChildContext())),w&&!p&&null!=f.getSnapshotBeforeUpdate&&(g=f.getSnapshotBeforeUpdate(v,m)),j=null!=d&&d.type===A&&null==d.key?V(d.props.children):d,u=z(t,T(j)?j:[j],e,n,o,r,i,l,u,a,c),f.base=e.__e,e.__u&=-161,f.__h.length&&l.push(f),b&&(f.__E=f.__=null)}catch(t){if(l.length=h,e.__v=null,a||null!=i)if(t.then){for(e.__u|=a?160:128;u&&8==u.nodeType&&u.nextSibling;)u=u.nextSibling;null!=i&&(i[i.indexOf(u)]=null),e.__e=u}else{if(null!=i)for(E=i.length;E--;)S(i[E]);B(e)}else e.__e=n.__e,!e.__k&&n.__k&&(e.__k=n.__k),t.then||B(e);s.__e(t,e,n)}}else null==i&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):u=e.__e=U(n.__e,e,n,o,r,i,l,a,c);return(d=s.diffed)&&d(e),128&e.__u?void 0:u}function B(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(B))}function H(t,e,n){for(var o=0;n.length>o;o++)Q(n[o],n[++o],n[++o]);s.__c&&s.__c(e,t),t.some(function(e){try{t=e.__h,e.__h=[],t.some(function(t){t.call(e)})}catch(t){s.__e(t,e.__v)}})}function V(t){return"object"!=typeof t||null==t||t.__b>0?t:T(t)?t.map(V):void 0!==t.constructor?null:C({},t)}function U(t,e,n,o,r,i,u,a,c){var d,h,f,p,v,m,g,b=n.props||_,y=e.props,w=e.type;if("svg"==w?r="http://www.w3.org/2000/svg":"math"==w?r="http://www.w3.org/1998/Math/MathML":r||(r="http://www.w3.org/1999/xhtml"),null!=i)for(d=0;i.length>d;d++)if((v=i[d])&&"setAttribute"in v==!!w&&(w?v.localName==w:3==v.nodeType)){t=v,i[d]=null;break}if(null==t){if(null==w)return document.createTextNode(y);t=document.createElementNS(r,w,y.is&&y),a&&(s.__m&&s.__m(e,i),a=!1),i=null}if(null==w)b===y||a&&t.data==y||(t.data=y);else{if(i="textarea"==w&&null!=y.defaultValue?null:i&&l.call(t.childNodes),!a&&null!=i)for(b={},d=0;t.attributes.length>d;d++)b[(v=t.attributes[d]).name]=v.value;for(d in b)v=b[d],"dangerouslySetInnerHTML"==d?f=v:"children"==d||d in y||"value"==d&&"defaultValue"in y||"checked"==d&&"defaultChecked"in y||N(t,d,null,v,r);for(d in y)v=y[d],"children"==d?p=v:"dangerouslySetInnerHTML"==d?h=v:"value"==d?m=v:"checked"==d?g=v:a&&"function"!=typeof v||b[d]===v||N(t,d,v,b[d],r);if(h)a||f&&(h.__html==f.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(f&&(t.innerHTML=""),z("template"==e.type?t.content:t,T(p)?p:[p],e,n,o,"foreignObject"==w?"http://www.w3.org/1999/xhtml":r,i,u,i?i[0]:n.__k&&$(n,0),a,c),null!=i)for(d=i.length;d--;)S(i[d]);a&&"textarea"!=w||(d="value","progress"==w&&null==m?t.removeAttribute("value"):null!=m&&(m!==t[d]||"progress"==w&&!m||"option"==w&&m!=b[d])&&N(t,d,m,b[d],r),d="checked",null!=g&&g!=t[d]&&N(t,d,g,b[d],r))}return t}function Q(t,e,n){try{if("function"==typeof t){var o="function"==typeof t.__u;o&&t.__u(),o&&null==e||(t.__u=t(e))}else t.current=e}catch(t){s.__e(t,n)}}function W(t,e,n){var o,r;if(s.unmount&&s.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||Q(o,null,e)),null!=(o=t.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(t){s.__e(t,e)}o.base=o.__P=o.__n=null}if(o=t.__k)for(r=0;o.length>r;r++)o[r]&&W(o[r],e,n||"function"!=typeof t.type);n||S(t.__e),t.__c=t.__=t.__e=void 0}function Y(t,e,n){return this.constructor(t,n)}function G(t,e,n){var o,r,i,u;e==document&&(e=document.documentElement),s.__&&s.__(t,e),r=(o="function"==typeof n)?null:n&&n.__k||e.__k,i=[],u=[],F(e,t=(!o&&n||e).__k=function(t,e,n){var o,r,i,s={};for(i in e)"key"==i?o=e[i]:"ref"==i?r=e[i]:s[i]=e[i];if(arguments.length>2&&(s.children=arguments.length>3?l.call(arguments,2):n),"function"==typeof t&&null!=t.defaultProps)for(i in t.defaultProps)void 0===s[i]&&(s[i]=t.defaultProps[i]);return q(t,s,o,r,null)}(A,null,[t]),r||_,_,e.namespaceURI,!o&&n?[n]:r?null:e.firstChild?l.call(e.childNodes):null,i,!o&&n?n:r?r.__e:e.firstChild,o,u),H(i,t,u),t.props.children=null}l=x.slice,s={__e(t,e,n,o){for(var r,i,l;e=e.__;)if((r=e.__c)&&!r.__)try{if((i=r.constructor)&&null!=i.getDerivedStateFromError&&(r.setState(i.getDerivedStateFromError(t)),l=r.__d),null!=r.componentDidCatch&&(r.componentDidCatch(t,o||{}),l=r.__d),l)return r.__E=r}catch(e){t=e}throw t}},u=0,M.prototype.setState=function(t,e){var n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=C({},this.state);"function"==typeof t&&(t=t(C({},n),this.props)),t&&C(n,t),null!=t&&this.__v&&(e&&this._sb.push(e),I(this))},M.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),I(this))},M.prototype.render=A,a=[],d="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,h=function(t,e){return t.__v.__b-e.__v.__b},L.__r=0,f=Math.random().toString(8),p="__d"+f,v="__a"+f,m=/(PointerCapture)$|Capture$/i,g=0,b=Z(!1),y=Z(!0),w=0;const K={backgroundColor:"#ffffff",textColor:"#1d1f27",buttonColor:"#1d1f27",borderRadius:8,buttonBorderRadius:6,borderColor:"#e5e7eb",fontFamily:"system-ui",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.15)",showOverlay:!0,whiteLabel:!1,dismissOnClickOutside:!0,zIndex:2147483646},J="product tour shown",X="$product_tour_id",tt="$product_tour_name",et="$product_tour_iteration",nt="$product_tour_render_reason",ot="$product_tour_step_id",rt="$product_tour_step_order",it="$product_tour_step_type",lt="$product_tour_dismiss_reason",st="$product_tour_button_text",ut="$product_tour_button_action",at="$product_tour_button_link",ct="$product_tour_button_tour_id",dt="$product_tour_steps_count",ht="$product_tour_step_selector",ft="$product_tour_step_selector_found",pt="$product_tour_step_element_tag",vt="$product_tour_step_element_id",mt="$product_tour_step_element_classes",gt="$product_tour_step_element_text",bt="$product_tour_error",yt="$product_tour_matches_count",wt="$product_tour_failure_phase",_t="$product_tour_waited_for_element",xt="$product_tour_wait_duration_ms",kt="$product_tour_banner_selector",Tt="$product_tour_linked_survey_id",Ct="$use_manual_selector",$t="$inference_data_present",St="$product_tour_type",qt="events",At="cancelEvents",Mt="$survey_id",jt="$survey_partially_completed",Et="$survey_questions",It="$survey_completed",Lt="$product_tour_id",zt=Object.prototype,Ot=zt.hasOwnProperty,Dt=zt.toString,Pt=Array.isArray||function(t){return"[object Array]"===Dt.call(t)},Rt=t=>"function"==typeof t,Nt=t=>void 0===t,Zt=t=>null===t,Ft=t=>Nt(t)||Zt(t),Bt=t=>"[object Number]"==Dt.call(t)&&t==t,Ht=(t,e,n)=>{function o(o,...r){e(()=>{(0,n[o])(t,...r)})}return{debug(...t){o("debug",...t)},info(...t){o("log",...t)},warn(...t){o("warn",...t)},error(...t){o("error",...t)},critical(...e){n.error(t,...e)},createLogger:o=>Ht(`${t} ${o}`,e,n)}},Vt=t=>t(),Ut="Mobile",Qt="Tablet",Wt="Android Tablet",Yt="iPad",Gt="Apple Watch",Kt="Nintendo",Jt="PlayStation",Xt="Xbox",te="Nokia",ee="Ouya",ne="Generic "+Ut.toLowerCase(),oe="Generic "+Qt.toLowerCase(),re=new RegExp(Xt,"i"),ie=new RegExp("PlayStation \\w+","i"),le=new RegExp("Nintendo \\w+","i"),se=new RegExp("BlackBerry|PlayBook|BB10","i");new RegExp(Kt,"i"),new RegExp(Jt,"i"),new RegExp("Windows","i");function ue(t){return ue="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ue(t)}function ae(t,e,n){return(e=function(t){var e=function(t){if("object"!=ue(t)||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=ue(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t);return"symbol"==ue(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ce(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,o)}return n}function de(t){for(var e=1;arguments.length>e;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?ce(Object(n),!0).forEach(function(e){ae(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):ce(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}function he(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,o=Array(e);e>n;n++)o[n]=t[n];return o}function fe(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var o,r,i,l,s=[],u=!0,a=!1;try{if(i=(n=n.call(t)).next,0===e);else for(;!(u=(o=i.call(n)).done)&&(s.push(o.value),s.length!==e);u=!0);}catch(t){a=!0,r=t}finally{try{if(!u&&null!=n.return&&(l=n.return(),Object(l)!==l))return}finally{if(a)throw r}}return s}}(t,e)||function(t,e){if(t){if("string"==typeof t)return he(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?he(t,e):void 0}}(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}const pe=Object.entries,ve=Object.setPrototypeOf,me=Object.isFrozen,ge=Object.getPrototypeOf,be=Object.getOwnPropertyDescriptor;let ye=Object.freeze,we=Object.seal,_e=Object.create,xe="undefined"!=typeof Reflect&&Reflect,ke=xe.apply,Te=xe.construct;ye||(ye=function(t){return t}),we||(we=function(t){return t}),ke||(ke=function(t,e){for(var n=arguments.length,o=new Array(n>2?n-2:0),r=2;n>r;r++)o[r-2]=arguments[r];return t.apply(e,o)}),Te||(Te=function(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),o=1;e>o;o++)n[o-1]=arguments[o];return new t(...n)});const Ce=Ue([].forEach),$e=Ue([].lastIndexOf),Se=Ue([].pop),qe=Ue([].push),Ae=Ue([].splice),Me=Array.isArray,je=Ue("".toLowerCase),Ee=Ue("".toString),Ie=Ue("".match),Le=Ue("".replace),ze=Ue("".indexOf),Oe=Ue("".trim),De=Ue((0).toString),Pe=Ue(Boolean.prototype.toString),Re="undefined"==typeof BigInt?null:Ue(BigInt.prototype.toString),Ne="undefined"==typeof Symbol?null:Ue(Symbol.prototype.toString),Ze=Ue({}.hasOwnProperty),Fe=Ue({}.toString),Be=Ue(/t/.test),He=(Ve=TypeError,function(){for(var t=arguments.length,e=new Array(t),n=0;t>n;n++)e[n]=arguments[n];return Te(Ve,e)});var Ve;function Ue(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),r=1;n>r;r++)o[r-1]=arguments[r];return ke(t,e,o)}}function Qe(t,e){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:je;if(ve&&ve(t,null),!Me(e))return t;let o=e.length;for(;o--;){let r=e[o];if("string"==typeof r){const t=n(r);t!==r&&(me(e)||(e[o]=t),r=t)}t[r]=!0}return t}function We(t){for(let e=0;t.length>e;e++)Ze(t,e)||(t[e]=null);return t}function Ye(t){const e=_e(null);for(const o of pe(t)){var n=fe(o,2);const r=n[0],i=n[1];Ze(t,r)&&(e[r]=Me(i)?We(i):i&&"object"==typeof i&&i.constructor===Object?Ye(i):i)}return e}function Ge(t,e){for(;null!==t;){const n=be(t,e);if(n){if(n.get)return Ue(n.get);if("function"==typeof n.value)return Ue(n.value)}t=ge(t)}return function(){return null}}const Ke=ye(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),Je=ye(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),Xe=ye(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),tn=ye(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),en=ye(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),nn=ye(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),on=ye(["#text"]),rn=ye(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),ln=ye(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),sn=ye(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),un=ye(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),an=we(/{{[\w\W]*|^[\w\W]*}}/g),cn=we(/<%[\w\W]*|^[\w\W]*%>/g),dn=we(/\${[\w\W]*/g),hn=we(/^data-[\-\w.\u00B7-\uFFFF]+$/),fn=we(/^aria-[\-\w]+$/),pn=we(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),vn=we(/^(?:\w+script|data):/i),mn=we(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),gn=we(/^html$/i),bn=we(/^[a-z][.\w]*(-[.\w]+)+$/i),yn=we(/<[/\w!]/g),wn=we(/<[/\w]/g),_n=we(/<\/no(script|embed|frames)/i),xn=we(/\/>/i),kn=function(){return"undefined"==typeof window?null:window},Tn=function(t,e,n,o){return Ze(t,e)&&Me(t[e])?Qe(o.base?Ye(o.base):{},t[e],o.transform):n};var Cn=function t(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:kn();const n=e=>t(e);if(n.version="3.4.13",n.removed=[],!e||!e.document||9!==e.document.nodeType||!e.Element)return n.isSupported=!1,n;let o=e.document;const r=o,i=r.currentScript,l=e.HTMLTemplateElement,s=e.Node,u=e.NodeFilter,a=e.DOMParser,c=e.trustedTypes,d=e.Element.prototype,h=Ge(d,"cloneNode"),f=Ge(d,"remove"),p=Ge(d,"nextSibling"),v=Ge(d,"childNodes"),m=Ge(d,"parentNode"),g=Ge(d,"shadowRoot"),b=Ge(d,"attributes"),y=s&&s.prototype?Ge(s.prototype,"nodeType"):null,w=s&&s.prototype?Ge(s.prototype,"nodeName"):null,_=s&&s.prototype?Ge(s.prototype,"ownerDocument"):null;if("function"==typeof l){const t=o.createElement("template");t.content&&t.content.ownerDocument&&(o=t.content.ownerDocument)}let x,k,T="",C=!1,S=0;const q=function(){if(S>0)throw He('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},A=function(t){q(),S++;try{return x.createHTML(t)}finally{S--}},M=o.implementation,j=o.createNodeIterator,E=o.createDocumentFragment,I=o.getElementsByTagName,L=r.importNode;let z={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]};n.isSupported="function"==typeof pe&&"function"==typeof m&&M&&void 0!==M.createHTMLDocument;const O=an,D=cn,P=dn,R=hn,N=fn,Z=vn,F=mn,B=bn;let H=pn,V=null;const U=Qe({},[...Ke,...Je,...Xe,...en,...on]);let Q=null;const W=Qe({},[...rn,...ln,...sn,...un]);let Y=Object.seal(_e(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),G=null,K=null;const J=Object.seal(_e(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let X=!0,tt=!0,et=!1,nt=!0,ot=!1,rt=!0,it=!1,lt=!1,st=null,ut=null,at=!1,ct=!1,dt=!1,ht=!1,ft=!0,pt=!1;const vt="user-content-";let mt=!0,gt=!1,bt={},yt=null;const wt=Qe({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let _t=null;const xt=Qe({},["audio","video","img","source","image","track"]);let kt=null;const Tt=Qe({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),Ct="http://www.w3.org/1998/Math/MathML",$t="http://www.w3.org/2000/svg",St="http://www.w3.org/1999/xhtml";let qt=St,At=!1,Mt=null;const jt=Qe({},[Ct,$t,St],Ee),Et=ye(["mi","mo","mn","ms","mtext"]);let It=Qe({},Et);const Lt=ye(["annotation-xml"]);let zt=Qe({},Lt);const Ot=Qe({},["title","style","font","a","script"]);let Dt=null;const Pt=["application/xhtml+xml","text/html"];let Rt=null,Nt=null;const Zt=o.createElement("form"),Ft=function(t){return t instanceof RegExp||t instanceof Function},Bt=function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Nt&&Nt===t)return;t&&"object"==typeof t||(t={}),t=Ye(t),Dt=-1===Pt.indexOf(t.PARSER_MEDIA_TYPE)?"text/html":t.PARSER_MEDIA_TYPE,Rt="application/xhtml+xml"===Dt?Ee:je,V=Tn(t,"ALLOWED_TAGS",U,{transform:Rt}),Q=Tn(t,"ALLOWED_ATTR",W,{transform:Rt}),Mt=Tn(t,"ALLOWED_NAMESPACES",jt,{transform:Ee}),kt=Tn(t,"ADD_URI_SAFE_ATTR",Tt,{transform:Rt,base:Tt}),_t=Tn(t,"ADD_DATA_URI_TAGS",xt,{transform:Rt,base:xt}),yt=Tn(t,"FORBID_CONTENTS",wt,{transform:Rt}),G=Tn(t,"FORBID_TAGS",Ye({}),{transform:Rt}),K=Tn(t,"FORBID_ATTR",Ye({}),{transform:Rt}),bt=!!Ze(t,"USE_PROFILES")&&(t.USE_PROFILES&&"object"==typeof t.USE_PROFILES?Ye(t.USE_PROFILES):t.USE_PROFILES),X=!1!==t.ALLOW_ARIA_ATTR,tt=!1!==t.ALLOW_DATA_ATTR,et=t.ALLOW_UNKNOWN_PROTOCOLS||!1,nt=!1!==t.ALLOW_SELF_CLOSE_IN_ATTR,ot=t.SAFE_FOR_TEMPLATES||!1,rt=!1!==t.SAFE_FOR_XML,it=t.WHOLE_DOCUMENT||!1,ct=t.RETURN_DOM||!1,dt=t.RETURN_DOM_FRAGMENT||!1,ht=t.RETURN_TRUSTED_TYPE||!1,at=t.FORCE_BODY||!1,ft=!1!==t.SANITIZE_DOM,pt=t.SANITIZE_NAMED_PROPS||!1,mt=!1!==t.KEEP_CONTENT,gt=t.IN_PLACE||!1,H=function(t){try{return Be(t,""),!0}catch(t){return!1}}(t.ALLOWED_URI_REGEXP)?t.ALLOWED_URI_REGEXP:pn,qt="string"==typeof t.NAMESPACE?t.NAMESPACE:St,It=Ze(t,"MATHML_TEXT_INTEGRATION_POINTS")&&t.MATHML_TEXT_INTEGRATION_POINTS&&"object"==typeof t.MATHML_TEXT_INTEGRATION_POINTS?Ye(t.MATHML_TEXT_INTEGRATION_POINTS):Qe({},Et),zt=Ze(t,"HTML_INTEGRATION_POINTS")&&t.HTML_INTEGRATION_POINTS&&"object"==typeof t.HTML_INTEGRATION_POINTS?Ye(t.HTML_INTEGRATION_POINTS):Qe({},Lt);const e=Ze(t,"CUSTOM_ELEMENT_HANDLING")&&t.CUSTOM_ELEMENT_HANDLING&&"object"==typeof t.CUSTOM_ELEMENT_HANDLING?Ye(t.CUSTOM_ELEMENT_HANDLING):_e(null);if(Y=_e(null),Ze(e,"tagNameCheck")&&Ft(e.tagNameCheck)&&(Y.tagNameCheck=e.tagNameCheck),Ze(e,"attributeNameCheck")&&Ft(e.attributeNameCheck)&&(Y.attributeNameCheck=e.attributeNameCheck),Ze(e,"allowCustomizedBuiltInElements")&&"boolean"==typeof e.allowCustomizedBuiltInElements&&(Y.allowCustomizedBuiltInElements=e.allowCustomizedBuiltInElements),we(Y),ot&&(tt=!1),dt&&(ct=!0),bt&&(V=Qe({},on),Q=_e(null),!0===bt.html&&(Qe(V,Ke),Qe(Q,rn)),!0===bt.svg&&(Qe(V,Je),Qe(Q,ln),Qe(Q,un)),!0===bt.svgFilters&&(Qe(V,Xe),Qe(Q,ln),Qe(Q,un)),!0===bt.mathMl&&(Qe(V,en),Qe(Q,sn),Qe(Q,un))),J.tagCheck=null,J.attributeCheck=null,Ze(t,"ADD_TAGS")&&("function"==typeof t.ADD_TAGS?J.tagCheck=t.ADD_TAGS:Me(t.ADD_TAGS)&&(V===U&&(V=Ye(V)),Qe(V,t.ADD_TAGS,Rt))),Ze(t,"ADD_ATTR")&&("function"==typeof t.ADD_ATTR?J.attributeCheck=t.ADD_ATTR:Me(t.ADD_ATTR)&&(Q===W&&(Q=Ye(Q)),Qe(Q,t.ADD_ATTR,Rt))),Ze(t,"ADD_URI_SAFE_ATTR")&&Me(t.ADD_URI_SAFE_ATTR)&&Qe(kt,t.ADD_URI_SAFE_ATTR,Rt),Ze(t,"FORBID_CONTENTS")&&Me(t.FORBID_CONTENTS)&&(yt===wt&&(yt=Ye(yt)),Qe(yt,t.FORBID_CONTENTS,Rt)),Ze(t,"ADD_FORBID_CONTENTS")&&Me(t.ADD_FORBID_CONTENTS)&&(yt===wt&&(yt=Ye(yt)),Qe(yt,t.ADD_FORBID_CONTENTS,Rt)),mt&&(V["#text"]=!0),it&&Qe(V,["html","head","body"]),V.table&&(Qe(V,["tbody"]),delete G.tbody),t.TRUSTED_TYPES_POLICY){if("function"!=typeof t.TRUSTED_TYPES_POLICY.createHTML)throw He('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof t.TRUSTED_TYPES_POLICY.createScriptURL)throw He('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const e=x;x=t.TRUSTED_TYPES_POLICY;try{T=A("")}catch(t){throw x=e,t}}else null===t.TRUSTED_TYPES_POLICY?(x=void 0,T=""):(void 0===x&&(C||(k=function(t,e){if("object"!=typeof t||"function"!=typeof t.createPolicy)return null;let n=null;const o="data-tt-policy-suffix";e&&e.hasAttribute(o)&&(n=e.getAttribute(o));const r="dompurify"+(n?"#"+n:"");try{return t.createPolicy(r,{createHTML:t=>t,createScriptURL:t=>t})}catch(t){return console.warn("TrustedTypes policy "+r+" could not be created."),null}}(c,i),C=!0),x=k),x&&"string"==typeof T&&(T=A("")));ye&&ye(t),Nt=t},Ht=Qe({},[...Je,...Xe,...tn]),Vt=Qe({},[...en,...nn]),Ut=function(t){qe(n.removed,{element:t});try{m(t).removeChild(t)}catch(e){if(f(t),!m(t))throw He("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Qt=function(t){Gt(t);const e=v(t);if(e){const t=[];Ce(e,e=>{qe(t,e)}),Ce(t,t=>{try{f(t)}catch(t){}})}const n=b(t);if(n)for(let e=n.length-1;e>=0;--e){const o=n[e],r=o&&o.name;if("string"==typeof r)try{t.removeAttribute(r)}catch(t){}}},Wt=function(t,e){try{qe(n.removed,{attribute:e.getAttributeNode(t),from:e})}catch(t){qe(n.removed,{attribute:null,from:e})}if(e.removeAttribute(t),"is"===t)if(ct||dt)try{Ut(e)}catch(t){}else try{e.setAttribute(t,"")}catch(t){}},Yt=function(t){const e=b(t);if(e)for(let n=e.length-1;n>=0;--n){const o=e[n],r=o&&o.name;if("string"==typeof r&&!Q[Rt(r)])try{t.removeAttribute(r)}catch(t){}}},Gt=function(t){const e=[t];for(;e.length>0;){const t=e.pop();1===(y?y(t):t.nodeType)&&Yt(t);const n=v(t);if(n)for(let t=n.length-1;t>=0;--t)e.push(n[t])}},Kt=function(t){let e=null,n=null;if(at)t="<remove></remove>"+t;else{const e=Ie(t,/^[\r\n\t ]+/);n=e&&e[0]}"application/xhtml+xml"===Dt&&qt===St&&(t='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+t+"</body></html>");const r=x?A(t):t;if(qt===St)try{e=(new a).parseFromString(r,Dt)}catch(t){}if(!e||!e.documentElement){e=M.createDocument(qt,"template",null);try{e.documentElement.innerHTML=At?T:r}catch(t){}}const i=e.body||e.documentElement;return t&&n&&i.insertBefore(o.createTextNode(n),i.childNodes[0]||null),qt===St?I.call(e,it?"html":"body")[0]:it?e.documentElement:i},Jt=function(t){const e=_?_(t):t.ownerDocument;return j.call(e||t,t,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Xt=function(t){return t=Le(t,O," "),t=Le(t,D," "),Le(t,P," ")},te=function(t){var e;t.normalize();const n=_?_(t):t.ownerDocument,o=j.call(n||t,t,u.SHOW_TEXT|u.SHOW_COMMENT|u.SHOW_CDATA_SECTION|u.SHOW_PROCESSING_INSTRUCTION,null);let r=o.nextNode();for(;r;)r.data=Xt(r.data),r=o.nextNode();const i=null===(e=t.querySelectorAll)||void 0===e?void 0:e.call(t,"template");i&&Ce(i,t=>{ne(t.content)&&te(t.content)})},ee=function(t){const e=w?w(t):null;return"string"==typeof e&&"form"===Rt(e)&&("string"!=typeof t.nodeName||"string"!=typeof t.textContent||"function"!=typeof t.removeChild||t.attributes!==b(t)||"function"!=typeof t.removeAttribute||"function"!=typeof t.setAttribute||"string"!=typeof t.namespaceURI||"function"!=typeof t.insertBefore||"function"!=typeof t.hasChildNodes||t.nodeType!==y(t)||t.childNodes!==v(t))},ne=function(t){if(!y||"object"!=typeof t||null===t)return!1;try{return 11===y(t)}catch(t){return!1}},oe=function(t){if(!y||"object"!=typeof t||null===t)return!1;try{return"number"==typeof y(t)}catch(t){return!1}};function re(t,e,o){0!==t.length&&Ce(t,t=>{t.call(n,e,o,Nt)})}const ie=function(t,e,n,o){return 0===t.length?e:e===n||e===o?Ye(e):e},le=function(t,e){if(re(z.beforeSanitizeElements,t,null),t!==e&&null===m(t))return gt&&Gt(t),!0;if(ee(t))return Ut(t),!0;const o=Rt(w?w(t):t.nodeName);if(V=ie(z.uponSanitizeElement,V,U,st),re(z.uponSanitizeElement,t,{tagName:o,allowedTags:V}),t!==e&&null===m(t))return gt&&Gt(t),!0;if(function(t,e){return!!(rt&&t.hasChildNodes()&&!oe(t.firstElementChild)&&Be(yn,t.textContent)&&Be(yn,t.innerHTML))||!(!rt||t.namespaceURI!==St||"style"!==e||!oe(t.firstElementChild))||7===t.nodeType||!(!rt||8!==t.nodeType||!Be(wn,t.data))}(t,o))return Ut(t),!0;if(G[o]||!(J.tagCheck instanceof Function&&J.tagCheck(o))&&!V[o]){const n=function(t,e,n){if(!G[e]&&ae(e)){if(Y.tagNameCheck instanceof RegExp&&Be(Y.tagNameCheck,e))return!1;if(Y.tagNameCheck instanceof Function&&Y.tagNameCheck(e))return!1}if(mt&&!yt[e]){const e=m(t),o=v(t);if(o&&e)for(let r=o.length-1;r>=0;--r){const i=t===n?h(o[r],!0):o[r];e.insertBefore(i,p(t))}}return Ut(t),!0}(t,o,e);return!1===n&&re(z.afterSanitizeElements,t,null),n}if(1===(y?y(t):t.nodeType)&&!function(t){let e=m(t);e&&e.tagName||(e={namespaceURI:qt,tagName:"template"});const n=je(t.tagName),o=je(e.tagName);return!!Mt[t.namespaceURI]&&(t.namespaceURI===$t?function(t,e,n){return e.namespaceURI===St?"svg"===t:e.namespaceURI===Ct?"svg"===t&&("annotation-xml"===n||It[n]):Boolean(Ht[t])}(n,e,o):t.namespaceURI===Ct?function(t,e,n){return e.namespaceURI===St?"math"===t:e.namespaceURI===$t?"math"===t&&zt[n]:Boolean(Vt[t])}(n,e,o):t.namespaceURI===St?function(t,e,n){return!(e.namespaceURI===$t&&!zt[n])&&!(e.namespaceURI===Ct&&!It[n])&&!Vt[t]&&(Ot[t]||!Ht[t])}(n,e,o):!("application/xhtml+xml"!==Dt||!Mt[t.namespaceURI]))}(t))return Ut(t),!0;if(("noscript"===o||"noembed"===o||"noframes"===o)&&Be(_n,t.innerHTML))return Ut(t),!0;if(ot&&3===t.nodeType){const e=Xt(t.textContent);t.textContent!==e&&(qe(n.removed,{element:t.cloneNode()}),t.textContent=e)}return re(z.afterSanitizeElements,t,null),!1},se=function(t,e,n){if(K[e])return!1;if(rt&&"patchsrc"===e)return!1;if(rt&&"for"===e&&"label"!==t&&"output"!==t)return!1;if(ft&&("id"===e||"name"===e)&&(n in o||n in Zt))return!1;const r=Q[e]||J.attributeCheck instanceof Function&&J.attributeCheck(e,t);if(tt&&Be(R,e));else if(X&&Be(N,e));else if(r){if(kt[e]);else if(Be(H,Le(n,F,"")));else if("src"!==e&&"xlink:href"!==e&&"href"!==e||"script"===t||0!==ze(n,"data:")||!_t[t])if(et&&!Be(Z,Le(n,F,"")));else if(n)return!1}else if(!(ae(t)&&(Y.tagNameCheck instanceof RegExp&&Be(Y.tagNameCheck,t)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(t))&&(Y.attributeNameCheck instanceof RegExp&&Be(Y.attributeNameCheck,e)||Y.attributeNameCheck instanceof Function&&Y.attributeNameCheck(e,t))||"is"===e&&Y.allowCustomizedBuiltInElements&&(Y.tagNameCheck instanceof RegExp&&Be(Y.tagNameCheck,n)||Y.tagNameCheck instanceof Function&&Y.tagNameCheck(n))))return!1;return!0},ue=Qe({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),ae=function(t){return!ue[je(t)]&&Be(B,t)},ce=function(t,e,n,o){if(x&&"object"==typeof c&&"function"==typeof c.getAttributeType&&!n)switch(c.getAttributeType(t,e)){case"TrustedHTML":return A(o);case"TrustedScriptURL":return function(t){q(),S++;try{return x.createScriptURL(t)}finally{S--}}(o)}return o},de=function(t,e,o,r){try{o?t.setAttributeNS(o,e,r):t.setAttribute(e,r),ee(t)?Ut(t):Se(n.removed)}catch(n){Wt(e,t)}},he=function(t){re(z.beforeSanitizeAttributes,t,null);const e=t.attributes;if(!e||ee(t))return;Q=ie(z.uponSanitizeAttribute,Q,W,ut);const n={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Q,forceKeepAttr:void 0};let o=e.length;const r=Rt(t.nodeName);for(;o--;){const i=e[o],l=i.name,s=i.namespaceURI,u=i.value,a=Rt(l),c=u;let d="value"===l?c:Oe(c);n.attrName=a,n.attrValue=d,n.keepAttr=!0,n.forceKeepAttr=void 0,re(z.uponSanitizeAttribute,t,n),d=n.attrValue,!pt||"id"!==a&&"name"!==a||0===ze(d,vt)||(Wt(l,t),d=vt+d),rt&&Be(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,d)||"attributename"===a&&Ie(d,"href")?Wt(l,t):n.forceKeepAttr||(!n.keepAttr||!nt&&Be(xn,d)?Wt(l,t):(ot&&(d=Xt(d)),se(r,a,d)?(d=ce(r,a,s,d),d!==c&&de(t,l,s,d)):Wt(l,t)))}re(z.afterSanitizeAttributes,t,null)},fe=function(t){let e=null;const n=Jt(t);for(re(z.beforeSanitizeShadowDOM,t,null);e=n.nextNode();)if(re(z.uponSanitizeShadowNode,e,null),le(e,t),he(e),ne(e.content)&&fe(e.content),1===(y?y(e):e.nodeType)){const t=g(e);ne(t)&&(ve(t),fe(t))}re(z.afterSanitizeShadowDOM,t,null)},ve=function(t){const e=[{node:t,shadow:null}];for(;e.length>0;){const t=e.pop();if(t.shadow){fe(t.shadow);continue}const n=t.node,o=1===(y?y(n):n.nodeType),r=v(n);if(r)for(let t=r.length-1;t>=0;--t)e.push({node:r[t],shadow:null});if(o){const t=w?w(n):null;if("string"==typeof t&&"template"===Rt(t)){const t=n.content;ne(t)&&e.push({node:t,shadow:null})}}if(o){const t=g(n);ne(t)&&e.push({node:null,shadow:t},{node:t,shadow:null})}}};return n.sanitize=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=null,i=null,l=null,s=null;if(At=!t,At&&(t="\x3c!--\x3e"),"string"!=typeof t&&!oe(t)&&"string"!=typeof(t=function(t){switch(typeof t){case"string":return t;case"number":return De(t);case"boolean":return Pe(t);case"bigint":return Re?Re(t):"0";case"symbol":return Ne?Ne(t):"Symbol()";case"undefined":default:return Fe(t);case"function":case"object":{if(null===t)return Fe(t);const e=t,n=Ge(e,"toString");if("function"==typeof n){const t=n(e);return"string"==typeof t?t:Fe(t)}return Fe(t)}}}(t)))throw He("dirty is not a string, aborting");if(!n.isSupported)return t;lt?(V=st,Q=ut):Bt(e),(z.uponSanitizeElement.length>0||z.uponSanitizeAttribute.length>0)&&(V=Ye(V)),z.uponSanitizeAttribute.length>0&&(Q=Ye(Q)),n.removed=[];const u=gt&&"string"!=typeof t&&oe(t);if(u){!function(t){if(!rt)return;const e=[t];for(;e.length>0;){const t=e.pop(),n=y?y(t):t.nodeType;if(7===n||8===n&&Be(wn,t.data)){try{f(t)}catch(t){}continue}if(1===n){const e=t,n=Rt(w?w(t):t.nodeName);try{e.hasAttribute&&e.hasAttribute("patchsrc")&&e.removeAttribute("patchsrc"),e.hasAttribute&&e.hasAttribute("for")&&"label"!==n&&"output"!==n&&e.removeAttribute("for")}catch(t){}}const o=v(t);if(o)for(let t=o.length-1;t>=0;--t)e.push(o[t])}}(t);const e=w?w(t):t.nodeName;if("string"==typeof e){const n=Rt(e);if(!V[n]||G[n])throw Qt(t),He("root node is forbidden and cannot be sanitized in-place")}if(ee(t))throw Qt(t),He("root node is clobbered and cannot be sanitized in-place");try{ve(t)}catch(e){throw Qt(t),e}}else if(oe(t))o=Kt("\x3c!----\x3e"),i=o.ownerDocument.importNode(t,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?o=i:o.appendChild(i),ve(i);else{if(!ct&&!ot&&!it&&-1===t.indexOf("<"))return x&&ht?A(t):t;if(o=Kt(t),!o)return ct?null:ht?T:""}o&&at&&Ut(o.firstChild);const a=u?t:o;try{const t=Jt(a);for(;l=t.nextNode();)le(l,a),he(l),ne(l.content)&&fe(l.content)}catch(e){throw u&&(Qt(t),Ce(n.removed,t=>{t.element&&Gt(t.element)})),e}if(u)return Ce(n.removed,t=>{t.element&&Gt(t.element)}),ot&&te(t),t;if(ct){if(ot&&te(o),dt)for(s=E.call(o.ownerDocument);o.firstChild;)s.appendChild(o.firstChild);else s=o;return(Q.shadowroot||Q.shadowrootmode)&&(s=L.call(r,s,!0)),s}let c=it?o.outerHTML:o.innerHTML;return it&&V["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&Be(gn,o.ownerDocument.doctype.name)&&(c="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+c),ot&&(c=Xt(c)),x&&ht?A(c):c},n.setConfig=function(){Bt(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),lt=!0,st=V,ut=Q},n.clearConfig=function(){Nt=null,lt=!1,st=null,ut=null,x=k,T=""},n.isValidAttribute=function(t,e,n){Nt||Bt({});const o=Rt(t),r=Rt(e);return se(o,r,n)},n.addHook=function(t,e){"function"==typeof e&&Ze(z,t)&&qe(z[t],e)},n.removeHook=function(t,e){if(Ze(z,t)){if(void 0!==e){const n=$e(z[t],e);return-1===n?void 0:Ae(z[t],n,1)[0]}return Se(z[t])}},n.removeHooks=function(t){Ze(z,t)&&(z[t]=[])},n.removeAllHooks=function(){z={afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},n}();function $n(t,e){return t.match(/\\?.|^$/g).reduce((t,n)=>('"'!==n||t.sQuote?"'"!==n||t.quote?t.quote||t.sQuote||n!==e?t.a[t.a.length-1]+=n:t.a.push(""):(t.sQuote^=1,t.a[t.a.length-1]+=n):(t.quote^=1,t.a[t.a.length-1]+=n),t),{a:[""]}).a}function Sn(t){return t.nodeType===Node.DOCUMENT_FRAGMENT_NODE||t.nodeType===Node.DOCUMENT_NODE}function qn(t,e){const n=t.parentNode;return n&&n.host&&11===n.nodeType?n.host:n===e?null:n}const An=e,Mn=function(t,e=Vt){return Ht("[Element Inference]",e,function(t=console){return{log:t.log.bind(t),warn:t.warn.bind(t),error:t.error.bind(t),debug:t.debug.bind(t)}}())}();function jn(t,e){try{const n=e.get(t);if(!Nt(n))return n;if(t.checkVisibility){const n=t.checkVisibility({checkOpacity:!0,checkVisibilityCSS:!0});return e.set(t,n),n}const o=An.getComputedStyle(t);if("none"===o.display||"hidden"===o.visibility||0===parseFloat(o.opacity))return e.set(t,!1),!1;let r=t.parentElement;for(;r;){const t=e.get(r);if(!Nt(t)){if(!t)return!1;r=r.parentElement;continue}const n=An.getComputedStyle(r),o="none"!==n.display&&"hidden"!==n.visibility;if(e.set(r,o),!o)return!1;r=r.parentElement}const i=t.getBoundingClientRect(),l=i.width>0||i.height>0||t.getClientRects().length>0;return e.set(t,l),l}catch(t){return!0}}function En(t,e){const n=function(t){var e;const n=null===(e=t.innerText)||void 0===e?void 0:e.trim();return!n||n.length>250?null:n}(t);return(null==n?void 0:n.toLowerCase())===e.toLowerCase()}function*In(t,e,n){let o;try{o=function(t,e=document,n=null){return function(t,e,n,o=null){t=function(t){function e(){o&&(l.length>0&&/^[~+>]$/.test(l[l.length-1])&&l.push(" "),l.push(o))}var n,o,r,i,l=[],s=[0],u=0,a=/(?:[^\\]|(?:^|[^\\])(?:\\\\)+)$/,c=/^\s+$/,d=[/\s+|\/\*|["'>~+[(]/g,/\s+|\/\*|["'[\]()]/g,/\s+|\/\*|["'[\]()]/g,null,/\*\//g];for(t=t.trim();;){if(o="",(r=d[s[s.length-1]]).lastIndex=u,!(n=r.exec(t))){o=t.substr(u),e();break}if(i=u,(u=r.lastIndex)-n[0].length>i&&(o=t.substring(i,u-n[0].length)),3>s[s.length-1]){if(e(),"["===n[0])s.push(1);else if("("===n[0])s.push(2);else if(/^["']$/.test(n[0]))s.push(3),d[3]=new RegExp(n[0],"g");else if("/*"===n[0])s.push(4);else if(/^[\])]$/.test(n[0])&&s.length>0)s.pop();else if(/^(?:\s+|[~+>])$/.test(n[0])&&(l.length>0&&!c.test(l[l.length-1])&&0===s[s.length-1]&&l.push(" "),1===s[s.length-1]&&5===l.length&&"="===l[2].charAt(l[2].length-1)&&(l[4]=" "+l[4]),c.test(n[0])))continue;l.push(n[0])}else l[l.length-1]+=o,a.test(l[l.length-1])&&(4===s[s.length-1]&&(2>l.length||c.test(l[l.length-2])?l.pop():l[l.length-1]=" ",n[0]=""),s.pop()),l[l.length-1]+=n[0]}return l.join("").trim()}(t);let r=n.querySelector(t);return document.head.createShadowRoot||document.head.attachShadow?!e&&r?r:$n(t,",").reduce((t,r)=>{if(!e&&t)return t;const i=$n(r.replace(/^\s+/g,"").replace(/\s*([>+~]+)\s*/g,"$1")," ").filter(t=>!!t).map(t=>$n(t,">")),l=i.length-1,s=function(t=null,e,n=null){let o=[];if(n)o=n;else{const t=function(e){for(let n=0;e.length>n;n++){const r=e[n];o.push(r),r.shadowRoot&&t(r.shadowRoot.querySelectorAll("*"))}};e.shadowRoot&&t(e.shadowRoot.querySelectorAll("*")),t(e.querySelectorAll("*"))}return t?o.filter(e=>e.matches(t)):o}(i[l][i[l].length-1],n,o),u=function(t,e,n){return o=>{let r=e,i=o,l=!1;for(;i&&!Sn(i);){let e=!0;if(1===t[r].length)e=i.matches(t[r]);else{const o=[].concat(t[r]).reverse();let l=i;for(const t of o){if(!l||!l.matches(t)){e=!1;break}l=qn(l,n)}}if(e&&0===r){l=!0;break}e&&r--,i=qn(i,n)}return l}}(i,l,n);return e?t=t.concat(s.filter(u)):(t=s.find(u))||null},e?[]:null):e?n.querySelectorAll(t):r}(t,!0,e,n)}(t)}catch(t){return}for(const t of o){const o=t;e&&!En(o,e)||jn(o,n)&&(yield o)}}function Ln(t,e){let n=0;for(const o of t){if(n===e)return o;n++}return null}function zn(t){try{const n=JSON.parse(t.autoData);if(!Pt(null==n?void 0:n.textGroups)||!Pt(null==n?void 0:n.notextGroups))return Mn.error("Invalid autoData structure:",n),null;const{text:o,excludeText:r,precision:i=1}=t,l=null!=o&&!r,s=(l?n.textGroups:n.notextGroups).sort((t,e)=>t.cardinality-e.cardinality);if(0===s.length)return null;const u=Math.max(1,Math.ceil((1-i)*s.length)),a=new WeakMap;for(let t=0;u>t;t++){const n=s[t],r=new Map;let i=null,u=0;for(const{css:t,offset:s}of n.cssSelectors){var e;const c=Ln(In(t,l?o:null,a),s);if(!c)continue;const d=(null!==(e=r.get(c))&&void 0!==e?e:0)+1;if(r.set(c,d),d>u&&(u=d,i=c,d>=Math.ceil(n.cssSelectors.length/2)))return i}if(i)return i}return null}catch(t){return Mn.error("Error finding element:",t),null}}const On=(t,{debugEnabled:n}={})=>{const o={N(o,...r){e&&(e.POSTHOG_DEBUG||n)&&!Nt(e.console)&&e.console&&("__rrweb_original__"in e.console[o]?e.console[o].__rrweb_original__:e.console[o])(t,...r)},debug(...t){o.N("debug",...t)},info(...t){o.N("log",...t)},warn(...t){o.N("warn",...t)},error(...t){o.N("error",...t)},critical(...e){console.error(t,...e)},uninitializedWarning(t){o.error(`You must initialize PostHog before calling ${t}`)},createLogger:(e,n)=>On(`${t} ${e}`,n)};return o},Dn=On("[PostHog.js]"),Pn=Dn.createLogger,Rn=Pn("[Stylesheet Loader]"),Nn=(t,e)=>{if(!(t=>{try{new RegExp(t)}catch(t){return!1}return!0})(e))return!1;try{return new RegExp(e).test(t)}catch(t){return!1}},Zn=t=>t.toLowerCase(),Fn={exact:(t,e)=>e.some(e=>t.some(t=>e===t)),is_not:(t,e)=>e.every(e=>t.every(t=>e!==t)),regex:(t,e)=>e.some(e=>t.some(t=>Nn(e,t))),not_regex:(t,e)=>e.every(e=>t.every(t=>!Nn(e,t))),icontains:(t,e)=>e.map(Zn).some(e=>t.map(Zn).some(t=>e.includes(t))),not_icontains:(t,e)=>e.map(Zn).every(e=>t.map(Zn).every(t=>!e.includes(t))),gt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n>parseFloat(t))}),lt:(t,e)=>e.some(e=>{const n=parseFloat(e);return!isNaN(n)&&t.some(t=>n<parseFloat(t))})};function Bn(t,e){return!t||Object.entries(t).every(([t,n])=>{const o=null==e?void 0:e[t];if(null==o)return!1;const r=Fn[n.operator];return!!r&&r(n.values,[String(o)])})}function Hn(t,e,n,o){const{capture:r=!1,passive:i=!0}=null!=o?o:{};null==t||t.addEventListener(e,n,{capture:r,passive:i})}Pn("[Surveys]"),Math.trunc||(Math.trunc=function(t){return 0>t?Math.ceil(t):Math.floor(t)}),Number.isInteger||(Number.isInteger=function(t){return Bt(t)&&isFinite(t)&&Math.floor(t)===t}),e&&!Nt(e.crypto)&&crypto;let Vn=null;const Un={Et(){if(!Zt(Vn))return Vn;let t=!0;if(Nt(e))t=!1;else try{const e="__mplssupport__";Un.At(e,"xyz"),'"xyz"'!==Un.Ot(e)&&(t=!1),Un.Lt(e)}catch(e){t=!1}return t||Dn.error("localStorage unsupported; falling back to cookie store"),Vn=t,t},Pt(t){Dn.error("localStorage error: "+t)},Ot(t){try{return null==e?void 0:e.localStorage.getItem(t)}catch(t){Un.Pt(t)}return null},Dt(t){try{return JSON.parse(Un.Ot(t))||{}}catch(t){}return null},At(t,n){try{return null==e||e.localStorage.setItem(t,JSON.stringify(n)),!0}catch(t){Un.Pt(t)}return!1},Lt(t){try{null==e||e.localStorage.removeItem(t)}catch(t){Un.Pt(t)}}};let Qn=null;const Wn={Et(){if(!Zt(Qn))return Qn;if(Qn=!0,Nt(e))Qn=!1;else try{const t="__support__";Wn.At(t,"xyz"),'"xyz"'!==Wn.Ot(t)&&(Qn=!1),Wn.Lt(t)}catch(t){Qn=!1}return Qn},Pt(t){Dn.error("sessionStorage error: ",t)},Ot(t){try{return null==e?void 0:e.sessionStorage.getItem(t)}catch(t){Wn.Pt(t)}return null},Dt(t){try{return JSON.parse(Wn.Ot(t))||null}catch(t){}return null},At(t,n){try{return null==e||e.sessionStorage.setItem(t,JSON.stringify(n)),!0}catch(t){Wn.Pt(t)}return!1},Lt(t){try{null==e||e.sessionStorage.removeItem(t)}catch(t){Wn.Pt(t)}}};var Yn,Gn,Kn,Jn,Xn=0,to=[],eo=s,no=eo.__b,oo=eo.__r,ro=eo.diffed,io=eo.__c,lo=eo.unmount,so=eo.__;function uo(t,e){eo.__h&&eo.__h(Gn,t,Xn||e),Xn=0;var n=Gn.__H||(Gn.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function ao(t){return Xn=1,function(t,e){var n=uo(Yn++,2);if(n.t=t,!n.__c&&(n.__=[_o(void 0,e),function(t){var e=n.__N?n.__N[0]:n.__[0],o=n.t(e,t);e!==o&&(n.__N=[o,n.__[1]],n.__c.setState({}))}],n.__c=Gn,!Gn.__f)){var o=function(t,e,o){if(!n.__c.__H)return!0;var i=!1,l=n.__c.props!==t;if(n.__c.__H.__.some(function(t){if(t.__N){i=!0;var e=t.__[0];t.__=t.__N,t.__N=void 0,e!==t.__[0]&&(l=!0)}}),r){var s=r.call(this,t,e,o);return i?s||l:s}return!i||l};Gn.__f=!0;var r=Gn.shouldComponentUpdate,i=Gn.componentWillUpdate;Gn.componentWillUpdate=function(t,e,n){if(this.__e){var l=r;r=void 0,o(t,e,n),r=l}i&&i.call(this,t,e,n)},Gn.shouldComponentUpdate=o}return n.__N||n.__}(_o,t)}function co(t,e){var n=uo(Yn++,3);!eo.__s&&wo(n.__H,e)&&(n.__=t,n.u=e,Gn.__H.__h.push(n))}function ho(t,e){var n=uo(Yn++,4);!eo.__s&&wo(n.__H,e)&&(n.__=t,n.u=e,Gn.__h.push(n))}function fo(t){return Xn=5,po(function(){return{current:t}},[])}function po(t,e){var n=uo(Yn++,7);return wo(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function vo(){for(var t;t=to.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(bo),e.__h.some(yo),e.__h=[]}catch(n){e.__h=[],eo.__e(n,t.__v)}}}eo.__b=function(t){Gn=null,no&&no(t)},eo.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),so&&so(t,e)},eo.__r=function(t){oo&&oo(t),Yn=0;var e=(Gn=t.__c).__H;e&&(Kn===Gn?(e.__h=[],Gn.__h=[],e.__.some(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.length&&vo(),Yn=0)),Kn=Gn},eo.diffed=function(t){ro&&ro(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(1!==to.push(e)&&Jn===eo.requestAnimationFrame||((Jn=eo.requestAnimationFrame)||go)(vo)),e.__H.__.some(function(t){t.u&&(t.__H=t.u,t.u=void 0)})),Kn=Gn=null},eo.__c=function(t,e){e.some(function(t){try{t.__h.some(bo),t.__h=t.__h.filter(function(t){return!t.__||yo(t)})}catch(n){e.some(function(t){t.__h&&(t.__h=[])}),e=[],eo.__e(n,t.__v)}}),io&&io(t,e)},eo.unmount=function(t){lo&&lo(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(t){try{bo(t)}catch(t){e=t}}),n.__H=void 0,e&&eo.__e(e,n.__v))};var mo="function"==typeof requestAnimationFrame;function go(t){var e,n=function(){clearTimeout(o),mo&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);mo&&(e=requestAnimationFrame(n))}function bo(t){var e=Gn,n=t.__c;"function"==typeof n&&(t.__c=void 0,n()),Gn=e}function yo(t){var e=Gn;t.__c=t.__(),Gn=e}function wo(t,e){return!t||t.length!==e.length||e.some(function(e,n){return e!==t[n]})}function _o(t,e){return"function"==typeof e?e(t):e}const xo="#020617";function ko(t){if(t.startsWith("#")){let e=t.replace(/^#/,"");return/^[0-9A-Fa-f]{3}$/.test(e)&&(e=e[0]+e[0]+e[1]+e[1]+e[2]+e[2]),/^[0-9A-Fa-f]{6}$/.test(e)?`rgb(${parseInt(e.slice(0,2),16)},${parseInt(e.slice(2,4),16)},${parseInt(e.slice(4,6),16)})`:"rgb(255, 255, 255)"}return"rgb(255, 255, 255)"}function To(t="#eeeded"){let e;"#"===t[0]&&(e=ko(t)),t.startsWith("rgb")&&(e=t);const n={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"}[t.toLowerCase()];if(n&&(e=ko(n)),!e)return xo;const o=e.match(/^rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*(\d+(?:\.\d+)?))?\)$/);if(o){const t=parseInt(o[1]),e=parseInt(o[2]),n=parseInt(o[3]);return Math.sqrt(t*t*.299+e*e*.587+n*n*.114)>127.5?xo:"white"}return xo}String(2147483645),function(t){function e(t){var n,o;return this.getChildContext||(n=new Set,(o={})[e.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(t){this.props.value!=t.value&&n.forEach(function(t){t.__e=!0,I(t)})},this.sub=function(t){n.add(t);var e=t.componentWillUnmount;t.componentWillUnmount=function(){n&&n.delete(t),e&&e.call(t)}}),t.children}e.__c="__cC"+w++,e.__=t,e.Provider=e.__l=(e.Consumer=function(t,e){return t.children(e)}).contextType=e}({isPreviewMode:!1,previewPageIndex:0,onPopupSurveyDismissed(){},isPopup:!0,onPreviewSubmit(){},onPreviewBack(){},surveySubmissionId:"",properties:void 0,surveyLanguage:null});const Co="ph_product_tour_shown_",$o="ph_product_tour_completed_",So="ph_product_tour_dismissed_",qo="ph_active_product_tour",Ao="ph_last_seen_tour_date_",Mo=Pn("[Product Tours]"),jo=r,Eo=e;function Io(t){const e=((t,e,n)=>{let o=t.createElement("style");o.innerText=e;const r=(t=>{var e;return Rt(t)?t:null==t||null===(e=t.config)||void 0===e?void 0:e.prepare_external_dependency_stylesheet})(n);return r&&(o=r(o)),o||(Rn.error("prepare_external_dependency_stylesheet returned null"),null)})(jo,':host{--ph-tour-font-family:-apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";--ph-tour-background-color:#fff;--ph-tour-text-color:#1d1f27;--ph-tour-text-secondary-color:#6b7280;--ph-tour-button-color:#1d1f27;--ph-tour-button-text-color:#fff;--ph-tour-button-secondary-color:transparent;--ph-tour-button-secondary-text-color:#1d1f27;--ph-tour-border-color:#e5e7eb;--ph-tour-border-radius:8px;--ph-tour-button-border-radius:6px;--ph-tour-box-shadow:0 4px 12px #00000026;--ph-tour-max-width:320px;--ph-tour-padding:16px;--ph-tour-z-index:calc(2147480000 + 3646);--ph-tour-overlay-color:#00000080;--ph-tour-spotlight-padding:8px;--ph-tour-spotlight-border-radius:4px;--ph-tour-arrow-size:8px}.ph-tour-container *{box-sizing:border-box;font-family:var(--ph-tour-font-family);margin:0;padding:0}.ph-tour-click-overlay{z-index:var(--ph-tour-z-index);pointer-events:auto;position:fixed;inset:0}.ph-tour-spotlight{z-index:var(--ph-tour-z-index);border-radius:var(--ph-tour-spotlight-border-radius);box-shadow:0 0 0 9999px var(--ph-tour-overlay-color);pointer-events:none;position:fixed}.ph-tour-modal-overlay{z-index:var(--ph-tour-z-index);background:var(--ph-tour-overlay-color);pointer-events:none;position:fixed;inset:0}.ph-tour-tooltip{z-index:calc(var(--ph-tour-z-index) + 1);background:var(--ph-tour-background-color);border:1px solid var(--ph-tour-border-color);border-radius:var(--ph-tour-border-radius);box-shadow:var(--ph-tour-box-shadow);min-width:min(280px,100vw - 16px);max-width:min(var(--ph-tour-max-width), calc(100vw - 16px));padding:var(--ph-tour-padding);padding-top:calc(var(--ph-tour-padding) + 8px);pointer-events:auto;position:fixed}.ph-tour-tooltip--modal{box-shadow:var(--ph-tour-box-shadow)}.ph-tour-arrow{--ph-tour-arrow-offset:0px;border:var(--ph-tour-arrow-size) solid transparent;width:0;height:0;position:absolute}.ph-tour-arrow--top{bottom:100%;left:calc(50% + var(--ph-tour-arrow-offset));border-bottom-color:var(--ph-tour-background-color);transform:translate(-50%)}.ph-tour-arrow--bottom{top:100%;left:calc(50% + var(--ph-tour-arrow-offset));border-top-color:var(--ph-tour-background-color);transform:translate(-50%)}.ph-tour-arrow--left{right:100%;top:calc(50% + var(--ph-tour-arrow-offset));border-right-color:var(--ph-tour-background-color);transform:translateY(-50%)}.ph-tour-arrow--right{left:100%;top:calc(50% + var(--ph-tour-arrow-offset));border-left-color:var(--ph-tour-background-color);transform:translateY(-50%)}.ph-tour-content{color:var(--ph-tour-text-color);margin-bottom:16px;padding-right:24px;font-size:14px;line-height:1.5}.ph-tour-content h1,.ph-tour-content h2{margin-bottom:8px;font-weight:600}.ph-tour-content h1{font-size:18px}.ph-tour-content h2{font-size:16px}.ph-tour-content p{margin-bottom:8px}.ph-tour-content p:last-child{margin-bottom:0}.ph-tour-content strong{font-weight:600}.ph-tour-content em{font-style:italic}.ph-tour-content ul,.ph-tour-content ol{margin-bottom:8px;margin-left:20px}.ph-tour-content h3{margin-bottom:8px;font-size:14px;font-weight:600}.ph-tour-content a,.ph-tour-content .ph-tour-link{color:inherit;text-decoration:underline}.ph-tour-content a:hover{opacity:.8}.ph-tour-content code{background:#0000000f;border-radius:4px;padding:2px 6px;font-family:SF Mono,Monaco,Consolas,monospace;font-size:.875em}.ph-tour-content pre{background:#0000000a;border-radius:6px;margin-bottom:8px;padding:12px;font-family:SF Mono,Monaco,Consolas,monospace;font-size:13px;line-height:1.5;overflow-x:auto}.ph-tour-content pre code{font-size:inherit;background:0 0;border-radius:0;padding:0}.ph-tour-content pre *,.ph-tour-content code *{font-family:inherit}.ph-tour-content .hljs-comment,.ph-tour-content .hljs-quote{color:#6a737d;font-style:italic}.ph-tour-content .hljs-keyword,.ph-tour-content .hljs-selector-tag{color:#d73a49}.ph-tour-content .hljs-string,.ph-tour-content .hljs-doctag,.ph-tour-content .hljs-regexp{color:#032f62}.ph-tour-content .hljs-number,.ph-tour-content .hljs-literal,.ph-tour-content .hljs-variable,.ph-tour-content .hljs-template-variable{color:#005cc5}.ph-tour-content .hljs-title,.ph-tour-content .hljs-section,.ph-tour-content .hljs-selector-id,.ph-tour-content .hljs-selector-class,.ph-tour-content .hljs-title.function_{color:#6f42c1}.ph-tour-content .hljs-name,.ph-tour-content .hljs-attribute,.ph-tour-content .hljs-attr,.ph-tour-content .hljs-symbol,.ph-tour-content .hljs-bullet,.ph-tour-content .hljs-built_in,.ph-tour-content .hljs-addition{color:#22863a}.ph-tour-content .hljs-subst,.ph-tour-content .hljs-deletion{color:#b31d28}.ph-tour-content .hljs-meta{color:#032f62}.ph-tour-content .hljs-emphasis{font-style:italic}.ph-tour-content .hljs-strong{font-weight:700}.ph-tour-content img,.ph-tour-content .ph-tour-image{border-radius:6px;max-width:100%;height:auto;margin:8px 0;display:block}.ph-tour-content .ph-tour-embed{margin:8px 0}.ph-tour-content .ph-tour-embed-container{background:#000;border-radius:6px;width:100%;padding-bottom:56.25%;position:relative;overflow:hidden}.ph-tour-content .ph-tour-embed-container iframe{border:none;width:100%;height:100%;position:absolute;top:0;left:0}.ph-tour-content blockquote{border-left:3px solid var(--ph-tour-border-color);color:var(--ph-tour-text-secondary-color);margin:8px 0;padding-left:12px;font-style:italic}.ph-tour-footer{justify-content:space-between;align-items:center;gap:12px;display:flex}.ph-tour-progress{color:var(--ph-tour-text-secondary-color);font-size:12px}.ph-tour-buttons{gap:8px;margin-left:auto;display:flex}.ph-tour-button{border-radius:var(--ph-tour-button-border-radius);cursor:pointer;border:none;justify-content:center;align-items:center;padding:8px 16px;font-size:14px;font-weight:500;text-decoration:none;transition:opacity .15s,transform .1s;display:inline-flex}.ph-tour-button:hover{opacity:.9}.ph-tour-button:active{transform:scale(.98)}.ph-tour-button--primary{background:var(--ph-tour-button-color);color:var(--ph-tour-button-text-color)}.ph-tour-button--secondary{background:var(--ph-tour-button-secondary-color);color:var(--ph-tour-button-secondary-text-color);border:1px solid var(--ph-tour-border-color)}.ph-tour-dismiss{cursor:pointer;width:24px;height:24px;color:var(--ph-tour-text-secondary-color);background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;font-size:18px;line-height:1;transition:background .15s,color .15s;display:flex;position:absolute;top:8px;right:8px}.ph-tour-dismiss:hover{color:var(--ph-tour-text-color);background:#00000014}.ph-tour-branding{border-top:1px solid var(--ph-tour-border-color);color:var(--ph-tour-branding-text-color,var(--ph-tour-text-secondary-color));justify-content:center;align-items:center;gap:6px;margin-top:12px;padding-top:12px;font-size:11px;text-decoration:none;display:flex}.ph-tour-branding:hover{color:var(--ph-tour-branding-text-color,var(--ph-tour-text-color))}.ph-tour-branding svg{width:auto;height:14px}.ph-tour-hidden{display:none!important}.ph-tour-survey-step{min-width:min(300px,100vw - 16px)}.ph-tour-survey-question{color:var(--ph-tour-text-color);margin-bottom:16px;padding-right:24px;font-size:15px;font-weight:500;line-height:1.4}.ph-tour-survey-input-container{flex-direction:column;gap:12px;display:flex}.ph-tour-survey-textarea{border:1px solid var(--ph-tour-border-color);width:100%;font-size:14px;font-family:var(--ph-tour-font-family);color:var(--ph-tour-text-color);resize:vertical;box-sizing:border-box;background:#fff;border-radius:6px;min-height:80px;padding:10px 12px}.ph-tour-survey-textarea:focus{border-color:var(--ph-tour-button-color);outline:none;box-shadow:0 0 0 2px #0000000d}.ph-tour-survey-textarea::placeholder{color:var(--ph-tour-text-secondary-color)}.ph-tour-survey-submit{align-self:flex-end}.ph-tour-survey-rating-container{flex-direction:column;gap:8px;margin-bottom:8px;display:flex}.ph-tour-survey-rating-labels{color:var(--ph-tour-text-secondary-color);justify-content:space-between;font-size:11px;display:flex}.ph-tour-survey-rating-emoji{justify-content:center;gap:8px;display:flex}.ph-tour-survey-emoji-button{border:2px solid var(--ph-tour-border-color);background:var(--ph-tour-background-color);cursor:pointer;border-radius:8px;justify-content:center;align-items:center;width:44px;height:44px;padding:0;transition:all .15s;display:flex}.ph-tour-survey-emoji-button:hover{border-color:var(--ph-tour-button-color);background:#00000005}.ph-tour-survey-emoji-button--active{border-color:var(--ph-tour-button-color);background:var(--ph-tour-button-color)}.ph-tour-survey-emoji-button--active svg{fill:var(--ph-tour-button-text-color)}.ph-tour-survey-emoji-button svg{width:28px;height:28px;fill:var(--ph-tour-text-color);transition:fill .15s}.ph-tour-survey-rating-numbers{gap:6px;display:grid}.ph-tour-survey-number-button{border:1px solid var(--ph-tour-border-color);background:var(--ph-tour-background-color);font-size:13px;font-weight:500;font-family:var(--ph-tour-font-family);color:var(--ph-tour-text-color);cursor:pointer;border-radius:4px;justify-content:center;align-items:center;padding:8px 4px;transition:all .15s;display:flex}.ph-tour-survey-number-button:hover{border-color:var(--ph-tour-button-color);background:#00000005}.ph-tour-survey-number-button--active{border-color:var(--ph-tour-button-color);background:var(--ph-tour-button-color);color:var(--ph-tour-button-text-color)}@keyframes ph-tour-banner-slide-in{0%{grid-template-rows:0fr}to{grid-template-rows:1fr}}.ph-tour-banner-wrapper{animation:ph-tour-banner-slide-in var(--ph-tour-banner-animation-duration,.3s) ease-out forwards;display:grid}.ph-tour-banner-slide{min-height:0;overflow:hidden}.ph-tour-banner{background:var(--ph-tour-background-color);border-bottom:1px solid var(--ph-tour-border-color);box-shadow:var(--ph-tour-box-shadow);font-family:var(--ph-tour-font-family);justify-content:center;align-items:center;gap:16px;padding:12px 16px;display:flex}a.ph-tour-banner{color:inherit;text-decoration:none}:host:has(.ph-tour-banner--sticky){z-index:var(--ph-tour-z-index);position:sticky;top:0}.ph-tour-banner-content{min-width:0;color:var(--ph-tour-text-color);text-align:center;flex:1;font-size:14px;line-height:1.5}.ph-tour-banner-content p{margin:0}.ph-tour-banner-content strong{font-weight:600}.ph-tour-banner-content em{font-style:italic}.ph-tour-banner-content a{color:inherit;text-decoration:underline}.ph-tour-banner-dismiss{cursor:pointer;width:24px;height:24px;color:var(--ph-tour-text-secondary-color);background:0 0;border:none;border-radius:4px;flex-shrink:0;justify-content:center;align-items:center;transition:background .15s,color .15s;display:flex}.ph-tour-banner-dismiss:hover{color:var(--ph-tour-text-color);background:#00000014}',t);return null==e||e.setAttribute("data-ph-product-tour-style","true"),e}function Lo(t){return t.useManualSelector?!!t.selector:!!t.inferenceData}function zo(t){var e;if(null!==(e=t.useManualSelector)&&void 0!==e&&e)return t.selector?function(t){try{const e=jo.querySelectorAll(t);if(0===e.length)return{element:null,error:"not_found",matchCount:0};const n=e[0];return function(t){const e=Eo.getComputedStyle(t);if("none"===e.display||"hidden"===e.visibility||"0"===e.opacity)return!1;const n=t.getBoundingClientRect();return 0!==n.width&&0!==n.height}(n)?e.length>1?{element:n,error:"multiple_matches",matchCount:e.length}:{element:n,error:null,matchCount:1}:{element:null,error:"not_visible",matchCount:e.length}}catch(t){return{element:null,error:"not_found",matchCount:0}}}(t.selector):{element:null,error:"not_found",matchCount:0};if(!t.inferenceData)return{element:null,error:"not_found",matchCount:0};const n=zn(t.inferenceData);return n?{element:n,error:null,matchCount:1}:{element:null,error:"not_found",matchCount:0}}const Oo=12;function Do(t,e,n){const o=Math.max(8+e/2,Math.min(n-8-e/2,t));return{clamped:o,offset:t-o}}function Po(t,e){const n=de(de({},K),e),o=t.style;o.setProperty("--ph-tour-background-color",n.backgroundColor),o.setProperty("--ph-tour-text-color",n.textColor),o.setProperty("--ph-tour-button-color",n.buttonColor),o.setProperty("--ph-tour-border-radius",`${n.borderRadius}px`),o.setProperty("--ph-tour-button-border-radius",`${n.buttonBorderRadius}px`),o.setProperty("--ph-tour-border-color",n.borderColor),o.setProperty("--ph-tour-font-family",function(t){if("inherit"===t)return"inherit";const e='BlinkMacSystemFont, "Inter", "Segoe UI", "Roboto", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"';return t?`${t}, ${e}`:`-apple-system, ${e}`}(n.fontFamily)),o.setProperty("--ph-tour-text-secondary-color",function(t){const e=ko(t).match(/^rgb\((\d+),(\d+),(\d+)\)$/);return e?`rgba(${e[1]}, ${e[2]}, ${e[3]}, 0.6)`:t}(n.textColor)),o.setProperty("--ph-tour-branding-text-color",To(n.backgroundColor)),o.setProperty("--ph-tour-button-text-color",To(n.buttonColor)),o.setProperty("--ph-tour-box-shadow",n.boxShadow),o.setProperty("--ph-tour-overlay-color",n.showOverlay?"rgba(0, 0, 0, 0.5)":"transparent"),o.setProperty("--ph-tour-z-index",String(n.zIndex)),o.setProperty("--ph-tour-button-secondary-color","transparent"),o.setProperty("--ph-tour-button-secondary-text-color",n.textColor),o.setProperty("--ph-tour-max-width","320px"),o.setProperty("--ph-tour-padding","16px")}function Ro(t){var e;if(!t)return"";if("string"==typeof t)return Zo(t);if("text"===t.type){let e=Zo(t.text||"");if(t.marks)for(const n of t.marks)switch(n.type){case"bold":e=`<strong>${e}</strong>`;break;case"italic":e=`<em>${e}</em>`;break;case"underline":e=`<u>${e}</u>`;break;case"strike":e=`<s>${e}</s>`}return e}const n=(null===(e=t.content)||void 0===e?void 0:e.map(Ro).join(""))||"";switch(t.type){case"doc":default:return n;case"paragraph":return`<p>${n}</p>`;case"heading":{var o;const e=(null===(o=t.attrs)||void 0===o?void 0:o.level)||1;return`<h${e}>${n}</h${e}>`}case"bulletList":return`<ul>${n}</ul>`;case"orderedList":return`<ol>${n}</ol>`;case"listItem":return`<li>${n}</li>`;case"hardBreak":return"<br>"}}function No(t){return t.endsWith("/")?t.slice(0,-1):t}function Zo(t){const e=jo.createElement("div");return e.textContent=t,e.innerHTML}function Fo(t){const e=[];return t.content&&function t(n){var o,r;"image"===n.type&&(null===(o=n.attrs)||void 0===o?void 0:o.src)&&e.push(n.attrs.src),null===(r=n.content)||void 0===r||r.forEach(t)}(t.content),e}function Bo(t){const e=t.contentHtml||Ro(t.content);return Cn.sanitize(e,{ADD_TAGS:["iframe"],ADD_ATTR:["allowfullscreen","frameborder","referrerpolicy"]})}var Ho=0;function Vo(t,e,n,o,r,i){e||(e={});var l,u,a=e;if("ref"in a)for(u in a={},e)"ref"==u?l=e[u]:a[u]=e[u];var c={type:t,props:a,key:n,ref:l,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Ho,__i:-1,__u:0,__source:r,__self:i};if("function"==typeof t&&(l=t.defaultProps))for(u in l)void 0===a[u]&&(a[u]=l[u]);return s.vnode&&s.vnode(c),c}const Uo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146 272q66 0 121.5-35.5T682-393h-52q-23 40-63 61.5T480.5-310q-46.5 0-87-21T331-393h-53q26 61 81 96.5T480-261Zm0 181q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Qo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm20 194h253v-49H354v49ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Wo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("path",{d:"M626-533q22.5 0 38.25-15.75T680-587q0-22.5-15.75-38.25T626-641q-22.5 0-38.25 15.75T572-587q0 22.5 15.75 38.25T626-533Zm-292 0q22.5 0 38.25-15.75T388-587q0-22.5-15.75-38.25T334-641q-22.5 0-38.25 15.75T280-587q0 22.5 15.75 38.25T334-533Zm146.174 116Q413-417 358.5-379.5T278-280h53q22-42 62.173-65t87.5-23Q528-368 567.5-344.5T630-280h52q-25-63-79.826-100-54.826-37-122-37ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Yo=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("path",{d:"M480-417q-67 0-121.5 37.5T278-280h404q-25-63-80-100t-122-37Zm-183-72 50-45 45 45 31-36-45-45 45-45-31-36-45 45-50-45-31 36 45 45-45 45 31 36Zm272 0 44-45 51 45 31-36-45-45 45-45-31-36-51 45-44-45-31 36 44 45-44 45 31 36ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142 0 241-99t99-241q0-142-99-241t-241-99q-142 0-241 99t-99 241q0 142 99 241t241 99Z"})}),Go=Vo("svg",{className:"emoji-svg",xmlns:"http://www.w3.org/2000/svg",height:"48",viewBox:"0 -960 960 960",width:"48",children:Vo("path",{d:"M479.504-261Q537-261 585.5-287q48.5-26 78.5-72.4 6-11.6-.75-22.6-6.75-11-20.25-11H316.918Q303-393 296.5-382t-.5 22.6q30 46.4 78.5 72.4 48.5 26 105.004 26ZM347-578l27 27q7.636 8 17.818 8Q402-543 410-551q8-8 8-18t-8-18l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.636-8 17.818Q276-559 284-551q8 8 18 8t18-8l27-27Zm267 0 27 27q7.714 8 18 8t18-8q8-7.636 8-17.818Q685-579 677-587l-42-42q-8.8-9-20.9-9-12.1 0-21.1 9l-42 42q-8 7.714-8 18t8 18q7.636 8 17.818 8Q579-543 587-551l27-27ZM480-80q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Zm0-400Zm0 340q142.375 0 241.188-98.812Q820-337.625 820-480t-98.812-241.188Q622.375-820 480-820t-241.188 98.812Q140-622.375 140-480t98.812 241.188Q337.625-140 480-140Z"})}),Ko=({fill:t="currentColor"}={})=>Vo("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:t,xmlns:"http://www.w3.org/2000/svg","aria-labelledby":"close-survey-title-adam",children:[Vo("title",{id:"close-survey-title",className:"adam-testing",children:"Close survey"}),Vo("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M0.164752 0.164752C0.384422 -0.0549175 0.740578 -0.0549175 0.960248 0.164752L6 5.20451L11.0398 0.164752C11.2594 -0.0549175 11.6156 -0.0549175 11.8352 0.164752C12.0549 0.384422 12.0549 0.740578 11.8352 0.960248L6.79549 6L11.8352 11.0398C12.0549 11.2594 12.0549 11.6156 11.8352 11.8352C11.6156 12.0549 11.2594 12.0549 11.0398 11.8352L6 6.79549L0.960248 11.8352C0.740578 12.0549 0.384422 12.0549 0.164752 11.8352C-0.0549175 11.6156 -0.0549175 11.2594 0.164752 11.0398L5.20451 6L0.164752 0.960248C-0.0549175 0.740578 -0.0549175 0.384422 0.164752 0.164752Z",fill:t})]}),Jo=Vo("svg",{width:"77",height:"14",viewBox:"0 0 77 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[Vo("g",{"clip-path":"url(#clip0_2415_6911)",children:[Vo("mask",{id:"mask0_2415_6911",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"77",height:"14",children:Vo("path",{d:"M0.5 0H76.5V14H0.5V0Z",fill:"white"})}),Vo("g",{mask:"url(#mask0_2415_6911)",children:[Vo("path",{d:"M5.77226 8.02931C5.59388 8.37329 5.08474 8.37329 4.90634 8.02931L4.4797 7.20672C4.41155 7.07535 4.41155 6.9207 4.4797 6.78933L4.90634 5.96669C5.08474 5.62276 5.59388 5.62276 5.77226 5.96669L6.19893 6.78933C6.26709 6.9207 6.26709 7.07535 6.19893 7.20672L5.77226 8.02931ZM5.77226 12.6946C5.59388 13.0386 5.08474 13.0386 4.90634 12.6946L4.4797 11.872C4.41155 11.7406 4.41155 11.586 4.4797 11.4546L4.90634 10.632C5.08474 10.288 5.59388 10.288 5.77226 10.632L6.19893 11.4546C6.26709 11.586 6.26709 11.7406 6.19893 11.872L5.77226 12.6946Z",fill:"#1D4AFF"}),Vo("path",{d:"M0.5 10.9238C0.5 10.508 1.02142 10.2998 1.32637 10.5938L3.54508 12.7327C3.85003 13.0267 3.63405 13.5294 3.20279 13.5294H0.984076C0.716728 13.5294 0.5 13.3205 0.5 13.0627V10.9238ZM0.5 8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.19753 13.3927C5.28831 13.4802 5.41144 13.5294 5.53982 13.5294H8.0421C8.47337 13.5294 8.68936 13.0267 8.3844 12.7327L1.32637 5.92856C1.02142 5.63456 0.5 5.84278 0.5 6.25854V8.67083ZM0.5 4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L10.0368 13.3927C10.1276 13.4802 10.2508 13.5294 10.3791 13.5294H12.8814C13.3127 13.5294 13.5287 13.0267 13.2237 12.7327L1.32637 1.26329C1.02142 0.969312 0.5 1.17752 0.5 1.59327V4.00556ZM5.33931 4.00556C5.33931 4.12932 5.39033 4.24802 5.4811 4.33554L14.1916 12.7327C14.4965 13.0267 15.0179 12.8185 15.0179 12.4028V9.99047C15.0179 9.86671 14.9669 9.74799 14.8762 9.66049L6.16568 1.26329C5.86071 0.969307 5.33931 1.17752 5.33931 1.59327V4.00556ZM11.005 1.26329C10.7 0.969307 10.1786 1.17752 10.1786 1.59327V4.00556C10.1786 4.12932 10.2296 4.24802 10.3204 4.33554L14.1916 8.06748C14.4965 8.36148 15.0179 8.15325 15.0179 7.7375V5.3252C15.0179 5.20144 14.9669 5.08272 14.8762 4.99522L11.005 1.26329Z",fill:"#F9BD2B"}),Vo("path",{d:"M21.0852 10.981L16.5288 6.58843C16.2238 6.29443 15.7024 6.50266 15.7024 6.91841V13.0627C15.7024 13.3205 15.9191 13.5294 16.1865 13.5294H23.2446C23.5119 13.5294 23.7287 13.3205 23.7287 13.0627V12.5032C23.7287 12.2455 23.511 12.0396 23.2459 12.0063C22.4323 11.9042 21.6713 11.546 21.0852 10.981ZM18.0252 12.0365C17.5978 12.0365 17.251 11.7021 17.251 11.2901C17.251 10.878 17.5978 10.5436 18.0252 10.5436C18.4527 10.5436 18.7996 10.878 18.7996 11.2901C18.7996 11.7021 18.4527 12.0365 18.0252 12.0365Z",fill:"currentColor"}),Vo("path",{d:"M0.5 13.0627C0.5 13.3205 0.716728 13.5294 0.984076 13.5294H3.20279C3.63405 13.5294 3.85003 13.0267 3.54508 12.7327L1.32637 10.5938C1.02142 10.2998 0.5 10.508 0.5 10.9238V13.0627ZM5.33931 5.13191L1.32637 1.26329C1.02142 0.969306 0.5 1.17752 0.5 1.59327V4.00556C0.5 4.12932 0.551001 4.24802 0.641783 4.33554L5.33931 8.86412V5.13191ZM1.32637 5.92855C1.02142 5.63455 0.5 5.84278 0.5 6.25853V8.67083C0.5 8.79459 0.551001 8.91331 0.641783 9.00081L5.33931 13.5294V9.79717L1.32637 5.92855Z",fill:"#1D4AFF"}),Vo("path",{d:"M10.1787 5.3252C10.1787 5.20144 10.1277 5.08272 10.0369 4.99522L6.16572 1.26329C5.8608 0.969306 5.33936 1.17752 5.33936 1.59327V4.00556C5.33936 4.12932 5.39037 4.24802 5.48114 4.33554L10.1787 8.86412V5.3252ZM5.33936 13.5294H8.04214C8.47341 13.5294 8.6894 13.0267 8.38443 12.7327L5.33936 9.79717V13.5294ZM5.33936 5.13191V8.67083C5.33936 8.79459 5.39037 8.91331 5.48114 9.00081L10.1787 13.5294V9.99047C10.1787 9.86671 10.1277 9.74803 10.0369 9.66049L5.33936 5.13191Z",fill:"#F54E00"}),Vo("path",{d:"M29.375 11.6667H31.3636V8.48772H33.0249C34.8499 8.48772 36.0204 7.4443 36.0204 5.83052C36.0204 4.21681 34.8499 3.17334 33.0249 3.17334H29.375V11.6667ZM31.3636 6.84972V4.81136H32.8236C33.5787 4.81136 34.0318 5.19958 34.0318 5.83052C34.0318 6.4615 33.5787 6.84972 32.8236 6.84972H31.3636ZM39.618 11.7637C41.5563 11.7637 42.9659 10.429 42.9659 8.60905C42.9659 6.78905 41.5563 5.45438 39.618 5.45438C37.6546 5.45438 36.2701 6.78905 36.2701 8.60905C36.2701 10.429 37.6546 11.7637 39.618 11.7637ZM38.1077 8.60905C38.1077 7.63838 38.7118 6.97105 39.618 6.97105C40.5116 6.97105 41.1157 7.63838 41.1157 8.60905C41.1157 9.57972 40.5116 10.2471 39.618 10.2471C38.7118 10.2471 38.1077 9.57972 38.1077 8.60905ZM46.1482 11.7637C47.6333 11.7637 48.6402 10.8658 48.6402 9.81025C48.6402 7.33505 45.2294 8.13585 45.2294 7.16518C45.2294 6.8983 45.5189 6.72843 45.9342 6.72843C46.3622 6.72843 46.8782 6.98318 47.0418 7.54132L48.527 6.94678C48.2375 6.06105 47.1677 5.45438 45.8713 5.45438C44.4743 5.45438 43.6058 6.25518 43.6058 7.21372C43.6058 9.53118 46.9663 8.88812 46.9663 9.84665C46.9663 10.1864 46.6391 10.417 46.1482 10.417C45.4434 10.417 44.9525 9.94376 44.8015 9.3735L43.3164 9.93158C43.6436 10.8537 44.6001 11.7637 46.1482 11.7637ZM53.4241 11.606L53.2982 10.0651C53.0843 10.1743 52.8074 10.2106 52.5808 10.2106C52.1278 10.2106 51.8257 9.89523 51.8257 9.34918V7.03172H53.3612V5.55145H51.8257V3.78001H49.9755V5.55145H48.9687V7.03172H49.9755V9.57972C49.9755 11.06 51.0202 11.7637 52.3921 11.7637C52.7696 11.7637 53.122 11.7031 53.4241 11.606ZM59.8749 3.17334V6.47358H56.376V3.17334H54.3874V11.6667H56.376V8.11158H59.8749V11.6667H61.8761V3.17334H59.8749ZM66.2899 11.7637C68.2281 11.7637 69.6378 10.429 69.6378 8.60905C69.6378 6.78905 68.2281 5.45438 66.2899 5.45438C64.3265 5.45438 62.942 6.78905 62.942 8.60905C62.942 10.429 64.3265 11.7637 66.2899 11.7637ZM64.7796 8.60905C64.7796 7.63838 65.3837 6.97105 66.2899 6.97105C67.1835 6.97105 67.7876 7.63838 67.7876 8.60905C67.7876 9.57972 67.1835 10.2471 66.2899 10.2471C65.3837 10.2471 64.7796 9.57972 64.7796 8.60905ZM73.2088 11.4725C73.901 11.4725 74.5177 11.242 74.845 10.8416V11.424C74.845 12.1034 74.2786 12.5767 73.4102 12.5767C72.7935 12.5767 72.2523 12.2854 72.1642 11.788L70.4776 12.0428C70.7042 13.1955 71.925 13.972 73.4102 13.972C75.361 13.972 76.6574 12.8679 76.6574 11.2298V5.55145H74.8324V6.07318C74.4926 5.69705 73.9136 5.45438 73.171 5.45438C71.409 5.45438 70.3014 6.61918 70.3014 8.46345C70.3014 10.3077 71.409 11.4725 73.2088 11.4725ZM72.1012 8.46345C72.1012 7.55345 72.655 6.97105 73.5109 6.97105C74.3793 6.97105 74.9331 7.55345 74.9331 8.46345C74.9331 9.37345 74.3793 9.95585 73.5109 9.95585C72.655 9.95585 72.1012 9.37345 72.1012 8.46345Z",fill:"currentColor"})]})]}),Vo("defs",{children:Vo("clipPath",{id:"clip0_2415_6911",children:Vo("rect",{width:"76",height:"14",fill:"white",transform:"translate(0.5)"})})})]});function Xo({button:t,variant:e,onClick:n,cursorStyle:o}){const r=`ph-tour-button ph-tour-button--${e}`;return"link"===t.action&&t.link?Vo("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",class:r,onClick:()=>n(t),children:t.text}):Vo("button",{class:r,onClick:()=>n(t),style:o,children:t.text})}function tr({step:t,appearance:e,stepIndex:n,totalSteps:o,onNext:r,onPrevious:i,onDismiss:l,onButtonClick:s}){var u,a,c;const d=null!==(u=null==e?void 0:e.whiteLabel)&&void 0!==u&&u,h=n>=o-1,f=0===n,p=!(t.buttons||"button"!==t.progressionTrigger&&Lo(t)),v=!!t.buttons,m=!!(r||i||l||s),g=m?void 0:{cursor:"default"},b=!d&&f,y=t=>{s&&s(t)};return Vo(A,{children:[Vo("button",{class:"ph-tour-dismiss",onClick:l,"aria-label":"Close tour",style:g,children:Ko()}),Vo("div",{class:"ph-tour-content",dangerouslySetInnerHTML:{__html:Bo(t)}}),Vo("div",{class:"ph-tour-footer",children:[o>1&&Vo("span",{class:"ph-tour-progress",children:[n+1," of ",o]}),Vo("div",{class:"ph-tour-buttons",children:[p&&Vo(A,{children:[!f&&Vo("button",{class:"ph-tour-button ph-tour-button--secondary",onClick:i,style:g,children:"Back"}),Vo("button",{class:"ph-tour-button ph-tour-button--primary",onClick:r,style:g,children:h?"Done":"Next"})]}),v&&Vo(A,{children:[(null===(a=t.buttons)||void 0===a?void 0:a.secondary)&&Vo(Xo,{button:t.buttons.secondary,variant:"secondary",onClick:y,cursorStyle:g}),(null===(c=t.buttons)||void 0===c?void 0:c.primary)&&Vo(Xo,{button:t.buttons.primary,variant:"primary",onClick:y,cursorStyle:g})]})]})]}),b&&Vo("a",{href:m?"https://posthog.com/docs/product-tours":void 0,target:m?"_blank":void 0,rel:m?"noopener noreferrer":void 0,class:"ph-tour-branding",style:m?void 0:{cursor:"default",pointerEvents:"none"},children:["Tour by ",Jo]})]})}const er=[Wo,Qo,Uo],nr=[Yo,Wo,Qo,Uo,Go];function or({value:t,onChange:e,onSubmit:n,isInteractive:o}){const r=fo(null);return co(()=>{o&&setTimeout(()=>{var t;return null===(t=r.current)||void 0===t?void 0:t.focus()},100)},[o]),Vo("textarea",{ref:r,class:"ph-tour-survey-textarea",rows:3,placeholder:"Your feedback (optional)...",value:t,onInput:t=>e(t.target.value),onKeyDown(t){"Enter"===t.key&&t.metaKey&&o&&(t.preventDefault(),null==n||n())},disabled:!o,style:o?void 0:{cursor:"default"}})}function rr({survey:t,onSubmit:e,isInteractive:n}){const[o,r]=ao(null),i=t.scale||5,l=t=>{n&&(r(t),null==e||e(t))};if("emoji"===(t.display||"emoji"))return Vo("div",{class:"ph-tour-survey-rating-container",children:[Vo("div",{class:"ph-tour-survey-rating-emoji",children:(3===i?er:nr).map((t,e)=>{const r=e+1;return Vo("button",{type:"button",class:"ph-tour-survey-emoji-button "+(o===r?"ph-tour-survey-emoji-button--active":""),onClick:()=>l(r),style:n?void 0:{cursor:"default"},"aria-label":`Rate ${r}`,children:t},e)})}),(t.lowerBoundLabel||t.upperBoundLabel)&&Vo("div",{class:"ph-tour-survey-rating-labels",children:[Vo("span",{children:t.lowerBoundLabel}),Vo("span",{children:t.upperBoundLabel})]})]});const s=function(t){switch(t){case 5:default:return[1,2,3,4,5];case 10:return[0,1,2,3,4,5,6,7,8,9,10]}}(i);return Vo("div",{class:"ph-tour-survey-rating-container",children:[Vo("div",{class:"ph-tour-survey-rating-numbers",style:{gridTemplateColumns:`repeat(${s.length}, minmax(0, 1fr))`},children:s.map(t=>Vo("button",{type:"button",class:"ph-tour-survey-number-button "+(o===t?"ph-tour-survey-number-button--active":""),onClick:()=>l(t),style:n?void 0:{cursor:"default"},"aria-label":`Rate ${t}`,children:t},t))}),(t.lowerBoundLabel||t.upperBoundLabel)&&Vo("div",{class:"ph-tour-survey-rating-labels",children:[Vo("span",{children:t.lowerBoundLabel}),Vo("span",{children:t.upperBoundLabel})]})]})}function ir({step:t,appearance:e,stepIndex:n,totalSteps:o,onPrevious:r,onSubmit:i,onDismiss:l}){var s;const[u,a]=ao(""),c=t.survey,d=null!==(s=null==e?void 0:e.whiteLabel)&&void 0!==s&&s,h=0===n,f="open"===(null==c?void 0:c.type),p=!!(r||i||l),v=p?void 0:{cursor:"default"},m=()=>{null==i||i(u.trim()||null)};return c?Vo(A,{children:[Vo("button",{class:"ph-tour-dismiss",onClick:l,"aria-label":"Close survey",style:v,children:Ko()}),Vo("div",{class:"ph-tour-survey-question",children:c.questionText}),f?Vo(or,{value:u,onChange:a,onSubmit:m,isInteractive:p}):Vo(rr,{survey:c,onSubmit:i,isInteractive:p}),Vo("div",{class:"ph-tour-footer",children:[Vo("span",{class:"ph-tour-progress",children:[n+1," of ",o]}),Vo("div",{class:"ph-tour-buttons",children:[!h&&Vo("button",{class:"ph-tour-button ph-tour-button--secondary",onClick:r,style:v,children:c.backButtonText||"Back"}),f&&Vo("button",{class:"ph-tour-button ph-tour-button--primary",onClick:m,style:v,children:c.submitButtonText||"Submit"})]})]}),!d&&Vo("a",{href:p?"https://posthog.com/product-tours":void 0,target:p?"_blank":void 0,rel:p?"noopener noreferrer":void 0,class:"ph-tour-branding",style:p?void 0:{cursor:"default",pointerEvents:"none"},children:["Survey by ",Jo]})]}):Vo("div",{})}const lr=e;function sr(t){return{top:"bottom",bottom:"top",left:"right",right:"left"}[t]}function ur({tour:t,step:e,stepIndex:n,totalSteps:o,targetElement:r,onNext:i,onPrevious:l,onDismiss:s,onSurveySubmit:u,onButtonClick:a}){var c;const[d,h]=ao("entering"),[f,p]=ao(null),[v,m]=ao(null),[g,b]=ao(!1),[y,w]=ao(e),[_,x]=ao(n),k=fo(null),T=fo(n),C=fo(!1),S=fo(r),q=!Lo(y)||"survey"===y.type;ho(()=>{S.current=r},[r]);const A=function(t){return Xn=8,po(function(){return t},[])}(()=>{const t=S.current;if(!t||!k.current)return;const e=k.current.getBoundingClientRect(),n={width:e.width,height:e.height},o=t.getBoundingClientRect();p(function(t,e){const n=Eo.innerWidth,o=Eo.innerHeight,{width:r,height:i}=e,l=t.top,s=o-t.bottom,u=t.left,a=t.top+t.height/2,c=t.left+t.width/2;if(n-t.right>=r+Oo){const e=t.right+Oo,{clamped:n,offset:r}=Do(a,i,o);return{position:"right",top:n,left:e,arrowOffset:r}}if(u>=r+Oo){const e=n-t.left+Oo,{clamped:r,offset:l}=Do(a,i,o);return{position:"left",top:r,right:e,arrowOffset:l}}if(l>=i+Oo&&i+Oo>s){const e=o-t.top+Oo,{clamped:i,offset:l}=Do(c,r,n);return{position:"top",bottom:e,left:i,arrowOffset:l}}const d=t.bottom+Oo,{clamped:h,offset:f}=Do(c,r,n);return{position:"bottom",top:d,left:h,arrowOffset:f}}(o,n)),m(function(t,e=8){return{top:t.top-e+"px",left:t.left-e+"px",width:`${t.width+2*e}px`,height:`${t.height+2*e}px`}}(o)),b(!0)});ho(()=>{!q&&!g&&k.current&&r&&A()},[q,g,r,A]),co(()=>{const t=n,o=()=>{T.current===t&&(h("visible"),C.current=!1)},r=()=>{S.current&&Lo(e)&&(S.current.isConnected||(S.current=zo(e).element),S.current)?function(t,e){const n=t.getBoundingClientRect(),o=lr.innerHeight,r=lr.innerWidth,i=o/6,l=r/6;if(!(i>n.top||n.bottom>o-i||l>n.left||n.right>r-l))return void e();t.scrollIntoView({behavior:"smooth",block:"center"});let s=n.top,u=0,a=!1;const c=()=>{if(a)return;const n=t.getBoundingClientRect();if(1>Math.abs(n.top-s)){if(u++,u>=3)return a=!0,void e()}else u=0;s=n.top,setTimeout(c,50)};setTimeout(c,30),setTimeout(()=>{a||(a=!0,e())},500)}(S.current,()=>{T.current===t&&(A(),setTimeout(o,50))}):setTimeout(o,50)};if(T.current===n)return T.current=n,C.current=!0,void r();T.current=n,C.current=!0,h("exiting"),setTimeout(()=>{T.current===t&&(Lo(e)&&(p(null),m(null),b(!1)),w(e),x(n),h("entering"),r())},150)},[r,n,e,A]),co(()=>{if("visible"!==d||q)return;const t=()=>{C.current||A()};return Hn(lr,"scroll",t,{capture:!0}),Hn(lr,"resize",t),()=>{null==lr||lr.removeEventListener("scroll",t,!0),null==lr||lr.removeEventListener("resize",t)}},[A,d,q]),co(()=>{const t=t=>{"Escape"===t.key&&s("escape_key")};return Hn(lr,"keydown",t),()=>{null==lr||lr.removeEventListener("keydown",t)}},[s]);const M="visible"===d,j="survey"===y.type,E=q||g,I=de(de({},y.maxWidth&&{width:`min(${y.maxWidth}px, calc(100vw - 16px))`,maxWidth:`min(${y.maxWidth}px, calc(100vw - 16px))`}),q?de(de({},{top:"auto",right:"auto",bottom:"auto",left:"auto",transform:"none"}),(()=>{var t;const e=function(t,e="right",n){if("external_survey"===t)return{};switch(e){case"top_left":return{top:"0",left:"0",transform:"translate(30px, 30px)"};case"top_right":return{top:"0",right:"0",transform:"translate(-30px, 30px)"};case"top_center":return{top:"0",left:"50%",transform:"translate(-50%, 30px)"};case"middle_left":return{top:"50%",left:"0",transform:"translate(30px, -50%)"};case"middle_right":return{top:"50%",right:"0",transform:"translate(-30px, -50%)"};case"middle_center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case"left":return{left:"30px"};case"center":return{left:"50%",transform:"translateX(-50%)"};default:return{right:"widget"===t&&"tab"===n?"60px":"30px"}}}(void 0,null!==(t=y.modalPosition)&&void 0!==t?t:"middle_center");return"top"in e||"bottom"in e?e:de(de({},e),{},{bottom:"30px"})})()):(()=>{if(!f)return{};const t="left"===f.position||"right"===f.position;return{top:Nt(f.top)?"auto":`${f.top}px`,bottom:Nt(f.bottom)?"auto":`${f.bottom}px`,left:Nt(f.left)?"auto":`${f.left}px`,right:Nt(f.right)?"auto":`${f.right}px`,transform:t?"translateY(-50%)":"translateX(-50%)"}})());return Vo("div",{class:"ph-tour-container",children:[!1!==(null===(c=t.appearance)||void 0===c?void 0:c.dismissOnClickOutside)&&Vo("div",{class:"ph-tour-click-overlay",onClick(t){t.stopPropagation(),s("user_clicked_outside")}}),Vo("div",{class:"ph-tour-modal-overlay",style:{opacity:q&&M?1:0,transition:"opacity 150ms ease-out",pointerEvents:"none"}}),Vo("div",{class:"ph-tour-spotlight",style:de(de({},M&&E&&v?v:{top:"50%",left:"50%",width:"0px",height:"0px"}),{},{opacity:!q&&M&&E?1:0,transition:"opacity 150ms ease-out"},"click"===y.progressionTrigger&&!q&&{pointerEvents:"auto",cursor:"pointer"}),onClick:"click"!==y.progressionTrigger||q?void 0:t=>{t.stopPropagation(),S.current&&S.current.click(),i()}}),Vo("div",{ref:k,class:`ph-tour-tooltip ${q?"ph-tour-tooltip--modal":""} ${j?"ph-tour-survey-step":""}`,style:de(de({},I),{},{opacity:M&&E?1:0,transition:"opacity 150ms ease-out"}),onClick(t){t.stopPropagation()},children:[!q&&f&&Vo("div",{class:`ph-tour-arrow ph-tour-arrow--${sr(f.position)}`,style:0!==f.arrowOffset?{"--ph-tour-arrow-offset":`${f.arrowOffset}px`}:void 0}),j?Vo(ir,{step:y,appearance:t.appearance,stepIndex:_,totalSteps:o,onSubmit:u,onPrevious:l,onDismiss:()=>s("user_clicked_skip")}):Vo(tr,{step:y,appearance:t.appearance,stepIndex:_,totalSteps:o,onNext:i,onPrevious:l,onDismiss:()=>s("user_clicked_skip"),onButtonClick:a})]})]})}function ar({class:t,href:e,onClick:n,children:o}){return Vo("a",{class:t,href:e,target:"_blank",rel:"noopener noreferrer",onClick:n,children:o})}function cr({class:t,onClick:e,children:n}){return Vo("div",{class:t,role:"button",tabIndex:0,onClick:e,onKeyDown(t){"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),e())},style:{cursor:"pointer"},children:n})}function dr({class:t,children:e}){return Vo("div",{class:t,children:e})}function hr(t){return Vo("div",{class:"ph-tour-banner-wrapper",children:Vo("div",{class:"ph-tour-banner-slide",children:Vo(fr,de({},t))})})}function fr({step:t,onDismiss:e,onActionClick:n,displayFrequency:o}){var r;const i=null!==(r=t.bannerConfig)&&void 0!==r?r:{behavior:"sticky"},l=i.action,s="always"!==o,u=["ph-tour-banner","sticky"===i.behavior&&"ph-tour-banner--sticky","custom"===i.behavior&&"ph-tour-banner--custom"].filter(Boolean).join(" "),a=Vo(A,{children:[Vo("div",{class:"ph-tour-banner-content",dangerouslySetInnerHTML:{__html:Bo(t)}}),s&&Vo("button",{class:"ph-tour-banner-dismiss",onClick(t){t.stopPropagation(),t.preventDefault(),e()},"aria-label":"Close banner",children:Ko()})]});return"link"===(null==l?void 0:l.type)&&l.link?Vo(ar,{class:u,href:l.link,onClick:n,children:a}):"trigger_tour"===(null==l?void 0:l.type)&&n?Vo(cr,{class:u,onClick:n,children:a}):Vo(dr,{class:u,children:a})}function pr(t){var e,n;return!(!(null===(e=t.conditions)||void 0===e?void 0:e.events)||0>=(null===(n=t.conditions.events.values)||void 0===n?void 0:n.length))}function vr(t){var e,n;return!(!(null===(e=t.conditions)||void 0===e?void 0:e.actions)||0>=(null===(n=t.conditions.actions.values)||void 0===n?void 0:n.length))}var mr=class{on(t,e){return this._a[t]||(this._a[t]=[]),this._a[t].push(e),()=>{this._a[t]=this._a[t].filter(t=>t!==e)}}emit(t,e){for(const n of this._a[t]||[])n(e);for(const n of this._a["*"]||[])n(t,e)}constructor(){this._a={}}};function gr(t,e,n){if(Ft(t))return!1;switch(n){case"exact":return t===e;case"contains":{const n=e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/_/g,".").replace(/%/g,".*");return new RegExp(n,"i").test(t)}case"regex":try{return new RegExp(e).test(t)}catch(t){return!1}default:return!1}}var br=class{constructor(t){this._instance=t,this.Eh=new Set,this.Ph=new Set,this.Rh=new mr,this.Ah=(t,e)=>this.Fh(t,e)&&this.Oh(t,e)&&this.Dh(t,e)&&this.Lh(t,e),this.Fh=(t,e)=>!(null==e?void 0:e.event)||(null==t?void 0:t.event)===(null==e?void 0:e.event)}init(){var t,e;Nt(null===(t=this._instance)||void 0===t?void 0:t._addCaptureHook)||(this.Nh=null===(e=this._instance)||void 0===e?void 0:e._addCaptureHook((t,e)=>{this.on(t,e)}))}dispose(){var t;null===(t=this.Nh)||void 0===t||t.call(this),this.Nh=void 0,this.Rh=new mr}register(t){var e,n;if(!Nt(null===(e=this._instance)||void 0===e?void 0:e._addCaptureHook)&&(t.forEach(t=>{var e;this.Eh.add(t),null===(e=t.steps)||void 0===e||e.forEach(t=>{this.Ph.add((null==t?void 0:t.event)||"")})}),null===(n=this._instance)||void 0===n?void 0:n.autocapture)){const t=new Set;this.Eh.forEach(e=>{var n;null===(n=e.steps)||void 0===n||n.forEach(e=>{(null==e?void 0:e.selector)&&t.add(e.selector)})}),this._instance.autocapture.setElementSelectors(t)}}replace(t){this.Eh.clear(),this.Ph.clear(),this.register(t)}on(t,e){null!=e&&0!=t.length&&(this.Ph.has(t)||this.Ph.has(e.event))&&this.Eh.forEach(t=>{this.qh(e,t)&&this.Rh.emit("actionCaptured",t.name)})}jh(t){this.onAction("actionCaptured",e=>t(e))}qh(t,e){if(null==(null==e?void 0:e.steps))return!1;for(const n of e.steps)if(this.Ah(t,n))return!0;return!1}onAction(t,e){return this.Rh.on(t,e)}Oh(t,e){if(null==e?void 0:e.url){var n;const o=null==t||null===(n=t.properties)||void 0===n?void 0:n.$current_url;if(!o||"string"!=typeof o)return!1;if(!gr(o,e.url,e.url_matching||"contains"))return!1}return!0}Dh(t,e){return!!this.Bh(t,e)&&!!this.Hh(t,e)&&!!this.zh(t,e)}Bh(t,e){var n;if(!(null==e?void 0:e.href))return!0;const o=this.Uh(t);if(o.length>0)return o.some(t=>gr(t.href,e.href,e.href_matching||"exact"));const r=(null==t||null===(n=t.properties)||void 0===n?void 0:n.$elements_chain)||"";return!!r&&gr(function(t){const e=t.match(/(?::|")href="(.*?)"/);return e?e[1]:""}(r),e.href,e.href_matching||"exact")}Hh(t,e){var n;if(!(null==e?void 0:e.text))return!0;const o=this.Uh(t);if(o.length>0)return o.some(t=>gr(t.text,e.text,e.text_matching||"exact")||gr(t.$el_text,e.text,e.text_matching||"exact"));const r=(null==t||null===(n=t.properties)||void 0===n?void 0:n.$elements_chain)||"";return!!r&&(i=function(t){const e=[],n=/(?::|")text="(.*?)"/g;let o;for(;!Ft(o=n.exec(t));)e.includes(o[1])||e.push(o[1]);return e}(r),l=e.text,s=e.text_matching||"exact",i.some(t=>gr(t,l,s)));var i,l,s}zh(t,e){var n,o;if(!(null==e?void 0:e.selector))return!0;const r=null==t||null===(n=t.properties)||void 0===n?void 0:n.$element_selectors;if(null==r?void 0:r.includes(e.selector))return!0;const i=(null==t||null===(o=t.properties)||void 0===o?void 0:o.$elements_chain)||"";if(e.selector_regex&&i)try{return new RegExp(e.selector_regex).test(i)}catch(t){return!1}return!1}Uh(t){var e;return null==(null==t||null===(e=t.properties)||void 0===e?void 0:e.$elements)?[]:null==t?void 0:t.properties.$elements}Lh(t,e){return!(null==e?void 0:e.properties)||0===e.properties.length||Bn(e.properties.reduce((t,e)=>{const n=Pt(e.value)?e.value.map(String):null!=e.value?[String(e.value)]:[];return t[e.key]={values:n,operator:e.operator||"exact"},t},{}),null==t?void 0:t.properties)}},yr=class{constructor(t){var e,n;this.Wh=[],this._instance=t,this.Vh=new Map,this.Gh=new Map,this.Zh=new Map,this.Qh=null===(e=this._instance)||void 0===e||null===(n=e.onSessionId)||void 0===n?void 0:n.call(e,t=>this.Jh(t))}Kh(t){return!1}Yh(){return null}Xh(t){}tc(){}ec(t,e){return!!t&&Bn(t.propertyFilters,null==e?void 0:e.properties)}nc(t,e){const n=new Map;return t.forEach(t=>{var o;null===(o=t.conditions)||void 0===o||null===(o=o[e])||void 0===o||null===(o=o.values)||void 0===o||o.forEach(e=>{if(null==e?void 0:e.name){const o=n.get(e.name)||[];o.push(t.id),n.set(e.name,o)}})}),n}sc(t,e,n){const o=(n===qt?this.Vh:this.Gh).get(t);let r=[];return this.rc(t=>{r=t.filter(t=>null==o?void 0:o.includes(t.id))}),r.filter(o=>{var r;const i=null===(r=o.conditions)||void 0===r||null===(r=r[n])||void 0===r||null===(r=r.values)||void 0===r?void 0:r.find(e=>e.name===t);return this.ec(i,e)})}register(t){this.oc(t,!1)}replace(t){this.oc(t,!0)}oc(t,e){var n;Nt(null===(n=this._instance)||void 0===n?void 0:n._addCaptureHook)||(this.lc(t,e),this.ac(t,e))}ac(t,e){const n=t.filter(t=>{var e;return null===(e=t.conditions)||void 0===e||null===(e=e.actions)||void 0===e||null===(e=e.values)||void 0===e?void 0:e.length});var o;if(e&&this.Zh.clear(),0===n.length)return void(e&&(null===(o=this.uc)||void 0===o||o.replace([])));this.uc||(this.uc=new br(this._instance),this.uc.init(),this.uc.jh(t=>this.onAction(t)));const r=[];n.forEach(t=>{var e;null===(e=t.conditions)||void 0===e||null===(e=e.actions)||void 0===e||e.values.forEach(e=>{if(r.push(e),e.name){var n;const o=null!==(n=this.Zh.get(e.name))&&void 0!==n?n:[];o.includes(t.id)||o.push(t.id),this.Zh.set(e.name,o)}})}),e?this.uc.replace(r):this.uc.register(r)}hc(t,e){e.forEach((e,n)=>{var o;const r=null!==(o=t.get(n))&&void 0!==o?o:[];e.forEach(t=>{r.includes(t)||r.push(t)}),t.set(n,r)})}lc(t,e){var n,o;const r=t.filter(t=>{var e,n;return(null===(e=t.conditions)||void 0===e?void 0:e.events)&&(null===(n=t.conditions)||void 0===n||null===(n=n.events)||void 0===n||null===(n=n.values)||void 0===n?void 0:n.length)>0}),i=t.filter(t=>{var e,n;return(null===(e=t.conditions)||void 0===e?void 0:e.cancelEvents)&&(null===(n=t.conditions)||void 0===n||null===(n=n.cancelEvents)||void 0===n||null===(n=n.values)||void 0===n?void 0:n.length)>0}),l=this.nc(t,qt),s=this.nc(t,At);e?(this.Vh=l,this.Gh=s):(this.hc(this.Vh,l),this.hc(this.Gh,s)),(0!==r.length||0!==i.length)&&(null!==(n=this.Nh)&&void 0!==n||(this.Nh=null===(o=this._instance)||void 0===o?void 0:o._addCaptureHook((t,e)=>{this.onEvent(t,e)})))}onEvent(t,e){var n,o;const r=this.cc(),i=(null==e||null===(n=e.properties)||void 0===n?void 0:n.$survey_id)||(null==e||null===(o=e.properties)||void 0===o?void 0:o.$product_tour_id);if(i&&this.getActivatedIds().includes(i)){const e=this.dc(t,i);if("consume"===e)return r.info("event consumed activated item, removing it",{event:t,itemId:i}),void this.vc([i]);if("persist"===e)return r.info("shown item promoted to persisted activation",{event:t,itemId:i}),this.fc(i),void this.gc([i])}if(this.Gh.has(t)){const n=this.sc(t,e,At);n.length>0&&(r.info("cancel event matched, cancelling items",{event:t,itemsToCancel:n.map(t=>t.id)}),this.vc(n.map(t=>t.id)),n.forEach(t=>this.mc(t.id)))}if(!this.Vh.has(t))return;r.info("event name matched",{event:t,eventPayload:e,items:this.Vh.get(t)});const l=this.sc(t,e,qt);this.yc(l.map(t=>t.id))}onAction(t){this.Zh.has(t)&&this.yc(this.Zh.get(t)||[])}yc(t){var e,n;if(0===t.length)return;const o=!!(null===(e=this._instance)||void 0===e||null===(n=e.get_session_id)||void 0===n?void 0:n.call(e)),r=[];for(const e of t)o&&this.Kh(e)?this.fc(e)&&this.bc(e):r.push(e);r.length>0&&(this.Wh=[...new Set([...this.Wh,...r])]),this.cc().info("updating activated items",{activatedItems:this.getActivatedIds()})}fc(t){this.Wh=this.Wh.filter(e=>e!==t);const e=this._c();return!e.includes(t)&&(this.wc([...e,t]),this.kc(),!0)}vc(t){const e=new Set(t);this.Wh=this.Wh.filter(t=>!e.has(t));const n=this.Sc(),o=n.filter(t=>!e.has(t));o.length!==n.length&&(this.wc(o),0===o.length&&this.xc()),this.gc(t)}Cc(){var t;const e=this.Yh();if(!e)return{};const n=null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t?void 0:t.props[e];return n&&"object"==typeof n?n:{}}bc(t){if(!this.Yh())return;const e=this.Cc();this.Xh(de(de({},e),{},{[t]:Date.now()}))}gc(t){if(!this.Yh())return;const e=this.Cc(),n={};let o=!1;for(const[r,i]of Object.entries(e))t.includes(r)?o=!0:n[r]=i;o&&((t=>{if((t=>t===Object(t)&&!Pt(t))(t)){for(const e in t)if(Ot.call(t,e))return!1;return!0}return!1})(n)?this.tc():this.Xh(n))}$c(){this.Yh()&&this.tc()}getActivationTimestamp(t){if(!this._c().includes(t))return;const e=this.Cc()[t];return Bt(e)?e:void 0}Sc(){var t;const e=this.Tc();return(null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t?void 0:t.props[e])||[]}_c(){var t,e,n;const o=this.Sc();if(0===o.length)return[];const r=null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t?void 0:t.props[this.Ic()],i=null===(e=this._instance)||void 0===e||null===(n=e.get_session_id)||void 0===n?void 0:n.call(e);return i&&r===i?o:[]}kc(){var t,e;const n=null===(t=this._instance)||void 0===t||null===(e=t.get_session_id)||void 0===e?void 0:e.call(t);n&&this.Mc(n)}xc(){this.Ec()}Jh(t){var e;const n=null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e?void 0:e.props[this.Ic()];if(n&&n!==t){const t=this.Sc(),e=this.Cc();t.length>0&&(this.wc([]),t.filter(t=>Bt(e[t])).forEach(t=>this.mc(t))),this.xc(),this.$c()}}getActivatedIds(){return[...new Set([...this._c(),...this.Wh])].filter(t=>!this.Pc(t))}dispose(){var t,e,n;null===(t=this.Qh)||void 0===t||t.call(this),this.Qh=void 0,null===(e=this.Nh)||void 0===e||e.call(this),this.Nh=void 0,null===(n=this.uc)||void 0===n||n.dispose(),this.uc=void 0}reset(){this.Wh=[],this.Sc().length>0&&this.wc([]),this.xc(),this.$c()}getEventToItemsMap(){return this.Vh}Rc(){return this.uc}};const wr=Pn("[Product Tour Event Receiver]");var _r=class extends yr{constructor(t){super(t)}Tc(){return"$product_tours_activated"}Ic(){return"$product_tours_activated_session"}Ac(){return J}rc(t){var e;null===(e=this._instance)||void 0===e||null===(e=e.productTours)||void 0===e||e.getProductTours(t)}mc(t){var e;null===(e=this._instance)||void 0===e||null===(e=e.productTours)||void 0===e||e.cancelPendingTour(t)}cc(){return wr}wc(t){var e;null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e||e.register({$product_tours_activated:t})}Mc(t){var e;null===(e=this._instance)||void 0===e||null===(e=e.persistence)||void 0===e||e.register({$product_tours_activated_session:t})}Ec(){var t;null===(t=this._instance)||void 0===t||null===(t=t.persistence)||void 0===t||t.unregister("$product_tours_activated_session")}Pc(t){if(!t)return!0;const e=`${So}${t}`;return!(!Un.Ot(`${$o}${t}`)&&!Un.Ot(e))}dc(t){return t===this.Ac()?"consume":"ignore"}getTours(){return this.getActivatedIds()}};const xr=Pn("[Product Tours]"),kr=r,Tr=e;let Cr;const $r=new Map;function Sr(t,n){const o=t.conditions;if(!(null==o?void 0:o.url))return!0;const r=function(t){var n;const o=null==e||null===(n=e.location)||void 0===n?void 0:n.href;return Nt(o)?void 0:function(t,e){var n;const o=null==t||null===(n=t.config)||void 0===n?void 0:n.get_current_url;if(!Rt(o))return e;try{const t=o(e);return(t=>"[object String]"==Dt.call(t))(t)&&t?t:e}catch(t){return Dn.error("Error in get_current_url, falling back to window.location.href",t),e}}(t,o)}(n);if(!r)return!1;r!==Cr&&($r.clear(),Cr=r);const i=$r.get(t.id);if(!Nt(i))return i;const l=o.urlMatchType||"icontains";let s;return s="exact"===l?No(r)===No(o.url):Fn[l]([o.url],[r]),$r.set(t.id,s),s}function qr(t){const e=new Date;return!(t.start_date&&e<new Date(t.start_date)||t.end_date&&e>new Date(t.end_date))}function Ar(t,n){var r;return qr(t)&&Sr(t,n)&&function(t){var n,r,l;if(!t||0===t.length)return!0;if(!i)return!1;const s=function(t,e){var n;const o=function(t){return le.test(t)?Kt:ie.test(t)?Jt:re.test(t)?Xt:new RegExp(ee,"i").test(t)?ee:new RegExp("(Windows Phone|WPDesktop)","i").test(t)?"Windows Phone":/iPad/.test(t)?Yt:/iPod/.test(t)?"iPod Touch":/iPhone/.test(t)?"iPhone":/(watch)(?: ?os[,/]|\d,\d\/)[\d.]+/i.test(t)?Gt:se.test(t)?"BlackBerry":/(kobo)\s(ereader|touch)/i.test(t)?"Kobo":new RegExp(te,"i").test(t)?te:/(kf[a-z]{2}wi|aeo[c-r]{2})( bui|\))/i.test(t)||/(kf[a-z]+)( bui|\)).+silk\//i.test(t)?"Kindle Fire":/(Android|ZTE)/i.test(t)?new RegExp(Ut).test(t)&&!/(9138B|TB782B|Nexus [97]|pixel c|HUAWEISHT|BTV|noble nook|smart ultra 6)/i.test(t)||/pixel[\daxl ]{1,6}/i.test(t)&&!/pixel c/i.test(t)||/(huaweimed-al00|tah-|APA|SM-G92|i980|zte|U304AA)/i.test(t)||/lmy47v/i.test(t)&&!/QTAQZ3/i.test(t)?"Android":Wt:new RegExp("(pda|Mobile)","i").test(t)?ne:new RegExp(Qt,"i").test(t)&&!new RegExp("Tablet pc","i").test(t)?oe:""}(t);return o===Yt||o===Wt||"Kobo"===o||"Kindle Fire"===o||o===oe?Qt:o===Kt||o===Xt||o===Jt||o===ee?"Console":o===Gt?"Wearable":o?Ut:"Android"===(null==e?void 0:e.userAgentDataPlatform)&&(null!==(n=null==e?void 0:e.maxTouchPoints)&&void 0!==n?n:0)>0?600>Math.min(null!==(r=null==e?void 0:e.screenWidth)&&void 0!==r?r:0,null!==(i=null==e?void 0:e.screenHeight)&&void 0!==i?i:0)/(null!==(l=null==e?void 0:e.devicePixelRatio)&&void 0!==l?l:1)?Ut:Qt:"Desktop";var r,i,l}(i,{userAgentDataPlatform:null==o||null===(n=o.userAgentData)||void 0===n?void 0:n.platform,maxTouchPoints:null==o?void 0:o.maxTouchPoints,screenWidth:null==e||null===(r=e.screen)||void 0===r?void 0:r.width,screenHeight:null==e||null===(l=e.screen)||void 0===l?void 0:l.height,devicePixelRatio:null==e?void 0:e.devicePixelRatio});return Fn.icontains(t,[s])}(null===(r=t.conditions)||void 0===r?void 0:r.deviceTypes)}const Mr="ph-product-tour-container",jr="data-ph-tour-trigger";var Er=class{constructor(t){this.cv=null,this.kv=0,this.tm=!1,this.nm=!1,this.om=null,this.rm=new Map,this.im=new Map,this.lm=new Set,this.sm=new Set,this.um=()=>{kr.hidden&&this.om?(clearInterval(this.om),this.om=null):kr.hidden||this.om||(this.om=setInterval(()=>{this.am()},1e3),this.am())},this.nextStep=()=>{if(!this.cv)return;const t=this.cv.steps[this.kv];this.xo("product tour step completed",{[X]:this.cv.id,[ot]:t.id,[rt]:this.kv}),this.cv.steps.length-1>this.kv?(this.dm(this.kv+1),this.hm()):this.fm()},this.previousStep=()=>{this.cv&&0!==this.kv&&(this.dm(this.kv-1),this.hm())},this.dismissTour=(t="user_clicked_skip")=>{if(!this.cv)return;const e=this.cv.steps[this.kv];this.xo("product tour dismissed",{[X]:this.cv.id,[ot]:e.id,[rt]:this.kv,[lt]:t}),this.tm||(Un.At(`${So}${this.cv.id}`,!0),this._instance.capture("$set",{$set:{[`$product_tour_dismissed/${this.cv.id}`]:!0}})),Tr.dispatchEvent(new CustomEvent("PHProductTourDismissed",{detail:{tourId:this.cv.id,reason:t}})),this.pm()},this.vm=()=>{var t;if(!this.cv)return;const e=this.gm();if(!e)return;const n=null===(t=e.bannerConfig)||void 0===t?void 0:t.action;this.xo("product tour banner action clicked",{[X]:this.cv.id,[tt]:this.cv.name,[et]:this.cv.current_iteration||1,[ot]:e.id,[rt]:this.kv,[ut]:null==n?void 0:n.type,[at]:null==n?void 0:n.link,[ct]:null==n?void 0:n.tourId}),"trigger_tour"===(null==n?void 0:n.type)&&n.tourId&&(this.pm(),this.showTourById(n.tourId))},this.bm=t=>{if(this.cv){const e=this.cv.steps[this.kv];e&&this.xo("product tour button clicked",de(de({[X]:this.cv.id,[tt]:this.cv.name,[et]:this.cv.current_iteration||1,[ot]:e.id,[rt]:this.kv,[st]:t.text,[ut]:t.action},t.link&&{[at]:t.link}),t.tourId&&{[ct]:t.tourId}))}switch(t.action){case"dismiss":this.dismissTour("user_clicked_skip");break;case"next_step":this.nextStep();break;case"previous_step":this.previousStep();break;case"link":this.fm();break;case"trigger_tour":t.tourId&&(this.fm(),this.showTourById(t.tourId))}},this._instance=t,this.ym=new _r(t)}wm(t){const e=t.filter(t=>!t.disable_image_preload).flatMap(t=>t.steps.flatMap(Fo));for(const t of e)this.sm.has(t)||(this.sm.add(t),(new Image).src=t)}gm(){var t;if(!this.cv)return null;const e=this.cv.steps[this.kv];if(!e)return null;const n=null!==(t=this._instance.config.override_display_language)&&void 0!==t?t:navigator.language||navigator.userLanguage;return function(t,e){var n;if(!e||!t.translations)return t;const o=t.translations,r=null!==(n=o[e])&&void 0!==n?n:o[e.split("-")[0]];if(!r)return Mo.info(`No matching translation for "${e}" in step ${t.id}, using default`),t;const i=de({},t);return Nt(r.content)||(i.content=r.content),Nt(r.contentHtml)||(i.contentHtml=r.contentHtml),r.buttons&&i.buttons&&(i.buttons={primary:i.buttons.primary&&de(de({},i.buttons.primary),r.buttons.primary),secondary:i.buttons.secondary&&de(de({},i.buttons.secondary),r.buttons.secondary)}),r.survey&&i.survey&&(i.survey=de(de({},i.survey),r.survey)),i}(e,null!=n?n:null)}dm(t){this.kv=t,this._m()}_m(){this.cv&&!this.tm&&Wn.At(qo,{tourId:this.cv.id,stepIndex:this.kv})}xm(){Wn.Lt(qo)}km(){const t=Wn.Ot(qo);if(!t)return null;try{return JSON.parse(t)}catch(t){return null}}start(){if(this.om)return;const t=this.km();t?this.Tm(t.tourId,t.stepIndex,()=>{this.Cm()}):this.Cm()}Cm(){this.om=setInterval(()=>{this.am()},1e3),this.am(!0),Hn(kr,"visibilitychange",this.um)}Tm(t,e,n){var o;null===(o=this._instance.productTours)||void 0===o||o.getProductTours(o=>{const r=o.find(e=>e.id===t);r?(this.cv=r,this.kv=e,this.nm=!0,this.hm()):o.length>0&&this.xm(),n()})}stop(){this.om&&(clearInterval(this.om),this.om=null),kr.removeEventListener("visibilitychange",this.um),this.$m(),this.Sm(),this.pm()}am(t){var e;(null==kr?void 0:kr.getElementById("__POSTHOG_TOOLBAR__"))||null===(e=this._instance.productTours)||void 0===e||e.getProductTours(t=>{if(0===t.length)return void this.$m();this.wm(t);const e=new Set,n=t.filter(t=>!this.lm.has(t.id)&&(pr(t)||vr(t)));n.length>0&&(this.ym.register(n),n.forEach(t=>this.lm.add(t.id)));const o=this.cv?[]:this.ym.getTours();for(const n of t){var r;const t=null===(r=n.conditions)||void 0===r?void 0:r.selector;if(t&&(e.add(n.id),this.qm(n,t)),this.cv)continue;const i=vr(n)||pr(n);if(n.auto_launch&&this.Am(n)){if(!i){this.Mm(n,"auto");continue}o.includes(n.id)&&this.Mm(n,"event")}}this.rm.forEach(({tour:t})=>{e.has(t.id)||this.jm(t.id)})},t)}Mm(t,e){var n;const o=(null===(n=t.conditions)||void 0===n?void 0:n.autoShowDelaySeconds)||0;o>0?this.isTourPending(t.id)||this.queueTourWithDelay(t.id,o,e):this.showTour(t,{reason:e})}Am(t){var e,n,o;if(!Ar(t,this._instance))return xr.info(`Tour ${t.id} failed conditions check`),!1;const r=null!==(e=t.display_frequency)&&void 0!==e?e:"until_interacted",i=`${Co}${t.id}`,l=`${$o}${t.id}`,s=`${So}${t.id}`;switch(r){case"show_once":if(Un.Ot(i))return xr.info(`Tour ${t.id} already shown (show_once frequency)`),!1;break;case"until_interacted":if(Un.Ot(l)||Un.Ot(s))return xr.info(`Tour ${t.id} already completed or dismissed`),!1}var u,a;if(!function(t){if(!t)return!0;const{days:e,types:n}=t;if(!e||!n||0===n.length)return!0;let o=null;for(const t of n){const e=Un.Ot(`${Ao}${t}`);if(e)try{const t=JSON.parse(e),n=new Date(t);isNaN(n.getTime())||o&&o>=n||(o=n)}catch(t){}}return!o||function(t,e){if(!t||!e)return!0;const n="string"==typeof e?new Date(e):e,o=Math.abs((new Date).getTime()-n.getTime());return Math.ceil(o/864e5)>t}(e,o)}(null===(n=t.conditions)||void 0===n?void 0:n.seenTourWaitPeriod))return xr.info(`Cannot show tour ${t.id}: user has seen a ${null===(u=t.conditions)||void 0===u||null===(u=u.seenTourWaitPeriod)||void 0===u?void 0:u.types} tour within the last ${null===(a=t.conditions)||void 0===a||null===(a=a.seenTourWaitPeriod)||void 0===a?void 0:a.days} days.`),!1;if(!this.Em({flagKey:t.internal_targeting_flag_key}))return xr.info(`Tour ${t.id} failed feature flag check: ${t.internal_targeting_flag_key}`),!1;const c=null===(o=t.conditions)||void 0===o?void 0:o.linkedFlagVariant;return!!this.Em({flagKey:t.linked_flag_key,flagVariant:c})||(xr.info(`Tour ${t.id} failed feature flag check: ${t.linked_flag_key}, variant: ${c}`),!1)}showTour(t,e){var n;const o=null!==(n=null==e?void 0:e.reason)&&void 0!==n?n:"auto";this.cancelPendingTour(t.id),this.cv=t,this.dm(0);const r=this.hm();return r?(this.xo(J,{[X]:t.id,[tt]:t.name,[et]:t.current_iteration||1,[nt]:o,[St]:t.tour_type}),this.tm||(Un.At(`${Co}${t.id}`,!0),Un.At(`${Ao}${t.tour_type}`,(new Date).toISOString()),this._instance.capture("$set",{$set:{[`$product_tour_shown/${t.id}`]:!0}}))):this.pm(),r}showTourById(t,e){var n;xr.info(`showTourById(${t})`),null===(n=this._instance.productTours)||void 0===n||n.getProductTours(n=>{const o=n.find(e=>e.id===t);o?this.showTour(o,{reason:null!=e?e:"api"}):xr.warn("could not find tour",t)})}previewTour(t){xr.info(`Previewing tour ${t.id}`),this.pm(),this.tm=!0,this.cv=t,this.kv=0,this.hm()}fm(){this.cv&&(this.xo("product tour completed",{[X]:this.cv.id,[dt]:this.cv.steps.length}),this.tm||(Un.At(`${$o}${this.cv.id}`,!0),this._instance.capture("$set",{$set:{[`$product_tour_completed/${this.cv.id}`]:!0}})),Tr.dispatchEvent(new CustomEvent("PHProductTourCompleted",{detail:{tourId:this.cv.id}})),this.pm())}hm(t=0){var e;if(!this.cv)return!1;const n=this.gm();if(!n)return xr.warn(`Step ${this.kv} not found in tour ${this.cv.id}`),this.pm(),!1;if("banner"===n.type)return this.Im(),this.nm=!1,this.Lm(),!0;if("survey"===n.type)return n.survey?(this.zm(),!0):(xr.warn("Unable to render survey step - survey data not found"),!1);if(!Lo(n))return this.Im(),this.nm=!1,this.Om(null),!0;const o=zo(n),r={[Ct]:null!==(e=n.useManualSelector)&&void 0!==e&&e,[$t]:!!n.inferenceData},i=this.kv>0?this.cv.steps[this.kv-1]:null,l="click"===(null==i?void 0:i.progressionTrigger)||this.nm;if("not_found"===o.error||"not_visible"===o.error){if(l&&20>t)return setTimeout(()=>{this.hm(t+1)},100),!1;const e=100*t;return this.Dm(o,de({[_t]:l,[xt]:e},r)),0!==this.kv||this.nm?(xr.warn(`Tour "${this.cv.name}" dismissed: element for step ${this.kv} became unavailable (${o.error})`+(l?` after waiting ${e}ms`:"")),this.dismissTour("element_unavailable"),!1):(xr.warn(`Tour "${this.cv.name}" failed to show: element for first step not found (${o.error})`),!1)}if("multiple_matches"===o.error&&this.Dm(o,r),!o.element)return!1;const s=o.element,u=function(t){var e;return{tag:t.tagName,id:t.id||void 0,classes:t.className||void 0,text:(null===(e=t.innerText)||void 0===e?void 0:e.slice(0,100))||void 0}}(s);return this.Im(de({[ht]:n.selector,[ft]:!0,[pt]:u.tag,[vt]:u.id,[mt]:u.classes,[gt]:u.text},r)),this.nm=!1,this.Om(s),!0}Om(t,e,n){if(!this.cv)return;const o=this.gm();if(!o)return;const{shadow:r}=function(t,e){const n=`${Mr}-${t.id}`,o=kr.querySelector(`.${n}`);if(o&&o.shadowRoot)return{shadow:o.shadowRoot,isNewlyCreated:!1};const r=kr.createElement("div");r.className=n,Po(r,t.appearance);const i=r.attachShadow({mode:"open"}),l=Io(e);return l&&i.appendChild(l),kr.body.appendChild(r),{shadow:i,isNewlyCreated:!0}}(this.cv,this._instance);G(Vo(ur,{tour:this.cv,step:o,stepIndex:this.kv,totalSteps:this.cv.steps.length,targetElement:t,onNext:this.nextStep,onPrevious:this.previousStep,onDismiss:n||this.dismissTour,onSurveySubmit:e,onButtonClick:this.bm}),r)}Lm(){if(!this.cv)return;const t=this.gm();if(!t)return;const e=function(t,e,n){var o;const r=`${Mr}-${t.id}`,i=kr.querySelector(`.${r}`);if(i&&i.shadowRoot)return{shadow:i.shadowRoot,isNewlyCreated:!1};const l=kr.createElement("div");l.className=r,Po(l,t.appearance),Nt(null==n||null===(o=n.animation)||void 0===o?void 0:o.duration)||l.style.setProperty("--ph-tour-banner-animation-duration",`${n.animation.duration}ms`);const s=l.attachShadow({mode:"open"}),u=Io(e);if(u&&s.appendChild(u),"custom"===(null==n?void 0:n.behavior)&&n.selector){const t=kr.querySelector(n.selector);if(!t)return xr.warn(`Custom banner container not found: ${n.selector}. Banner will not be displayed.`),null;t.appendChild(l)}else kr.body.insertBefore(l,kr.body.firstChild);return{shadow:s,isNewlyCreated:!0}}(this.cv,this._instance,t.bannerConfig);var n;if(!e)return this.xo("product tour banner container selector failed",{[X]:this.cv.id,[kt]:null==t||null===(n=t.bannerConfig)||void 0===n?void 0:n.selector}),void this.dismissTour("container_unavailable");const{shadow:o}=e;G(Vo(hr,{step:t,onDismiss:()=>this.dismissTour("user_clicked_skip"),onActionClick:this.vm,displayFrequency:this.cv.display_frequency}),o)}zm(){var t,e,n;if(!this.cv)return;const o=this.cv.id,r=this.gm();if(!r)return;const i=r.linkedSurveyId,l=r.linkedSurveyQuestionId,s=(null===(t=r.survey)||void 0===t?void 0:t.questionText)||"";this.Im({[Tt]:i}),this.xo("survey shown",{[Mt]:i,[Lt]:o,sessionRecordingUrl:null===(e=(n=this._instance).get_session_replay_url)||void 0===e?void 0:e.call(n)}),this.Om(null,t=>{var e,n;const r=l?`$survey_response_${l}`:"$survey_response";this.xo("survey sent",de({[Mt]:i,[Lt]:o,[Et]:[{id:l,question:s,response:t}],[It]:!0,sessionRecordingUrl:null===(e=(n=this._instance).get_session_replay_url)||void 0===e?void 0:e.call(n)},!Zt(t)&&{[r]:t})),xr.info(`Survey ${i} completed`,Zt(t)?"(skipped)":`with response: ${t}`),this.nextStep()},t=>{var e,n;this.xo("survey dismissed",{[Mt]:i,[Lt]:o,[Et]:[{id:l,question:s,response:null}],[jt]:!1,sessionRecordingUrl:null===(e=(n=this._instance).get_session_replay_url)||void 0===e?void 0:e.call(n)}),xr.info(`Survey ${i} dismissed`),this.dismissTour(t)}),xr.info(`Rendered survey step for tour step ${this.kv}`)}Em({flagKey:t,flagVariant:e}){var n;if(!t)return!0;const o=!!(null===(n=this._instance.featureFlags)||void 0===n?void 0:n.isFeatureEnabled(t,{send_event:!t.startsWith("product-tour-targeting-")}));let r=!0;var i;return e&&(r=(null===(i=this._instance.featureFlags)||void 0===i?void 0:i.getFeatureFlag(t,{send_event:!1}))===e||"any"===e),o&&r}pm(){this.cv&&function(t){const e=kr.querySelector(`.${Mr}-${t}`);(null==e?void 0:e.shadowRoot)&&G(null,e.shadowRoot),null==e||e.remove()}(this.cv.id),this.cv=null,this.kv=0,this.tm=!1,this.nm=!1,this.xm()}qm(t,e){const n=kr.querySelector(e),o=this.rm.get(t.id);if(n){if(o){if(n===o.element)return;xr.info(`Trigger element changed for tour ${t.id}. Re-attaching listener.`),this.jm(t.id)}if(!n.hasAttribute(jr)){const o=n=>{var o;if(this.cv)return void xr.info(`Tour ${t.id} trigger clicked but another tour is active`);let r;if(null===(o=this._instance.productTours)||void 0===o||o.getProductTours(e=>{r=e.find(e=>e.id===t.id)}),!r)return xr.warn(`Tour ${t.id} no longer exists. Removing stale listener.`),void this.jm(t.id);qr(r)?(xr.info(`Tour ${t.id} triggered by click on ${e}`),this.showTour(r,{reason:"trigger"})?n.preventDefault():xr.info(`Tour ${t.id} failed to show; not intercepting click.`)):xr.warn(`Tour ${t.id} trigger clicked, but tour is not launched - not showing tour.`)};Hn(n,"click",o),n.setAttribute(jr,t.id),this.rm.set(t.id,{element:n,listener:o,tour:t}),xr.info(`Attached trigger listener for tour ${t.id} on ${e}`)}}else o&&this.jm(t.id)}jm(t){const e=this.rm.get(t);e&&(e.element.removeEventListener("click",e.listener),e.element.removeAttribute(jr),this.rm.delete(t),xr.info(`Removed trigger listener for tour ${t}`))}$m(){this.rm.forEach((t,e)=>{this.jm(e)})}xo(t,e){this.tm||this._instance.capture(t,e)}Im(t){if(!this.cv)return;const e=this.cv.steps[this.kv];this.xo("product tour step shown",de({[X]:this.cv.id,[ot]:e.id,[rt]:this.kv,[it]:e.type},t))}Dm(t,e){if(!this.cv)return;const n=this.cv.steps[this.kv];this.xo("product tour step selector failed",de({[X]:this.cv.id,[ot]:n.id,[rt]:this.kv,[ht]:n.selector,[bt]:t.error,[yt]:t.matchCount,[wt]:"runtime"},e))}getActiveProductTours(t){var e;null===(e=this._instance.productTours)||void 0===e||e.getProductTours((e,n)=>{t((null==n?void 0:n.isLoaded)?e.filter(t=>this.Am(t)):[],n)})}resetTour(t){Un.Lt(`${Co}${t}`),Un.Lt(`${$o}${t}`),Un.Lt(`${So}${t}`)}resetAllTours(){const t=null==Tr?void 0:Tr.localStorage;if(!t)return;const e=[];for(let n=0;t.length>n;n++){const o=t.key(n);((null==o?void 0:o.startsWith("ph_product_tour_shown_"))||(null==o?void 0:o.startsWith("ph_product_tour_completed_"))||(null==o?void 0:o.startsWith("ph_product_tour_dismissed_"))||(null==o?void 0:o.startsWith("ph_last_seen_tour_date_")))&&e.push(o)}e.forEach(t=>Un.Lt(t))}cancelPendingTour(t){const e=this.im.get(t);e&&(clearTimeout(e),this.im.delete(t),xr.info(`Cancelled pending tour: ${t}`))}Sm(){this.im.forEach(t=>clearTimeout(t)),this.im.clear()}isTourPending(t){return this.im.has(t)}queueTourWithDelay(t,e,n){xr.info(`Queueing tour ${t} with ${e}s delay`);const o=setTimeout(()=>{this.im.delete(t),xr.info(`Delay elapsed for tour ${t}, showing now`),this.showTourById(t,n)},1e3*e);this.im.set(t,o)}};function Ir(t,e){if(!r)return;const n=new Er(t);return e&&n.start(),n}const Lr="undefined"!=typeof globalThis?globalThis:e;Lr&&"undefined"==typeof self&&(Lr.self=Lr),Lr&&"undefined"==typeof File&&(Lr.File=function(){});const zr=null!=e?e:{};zr.__PosthogExtensions__=zr.__PosthogExtensions__||{},zr.__PosthogExtensions__.generateProductTours=Ir,t.default=Ir,t.elementIsVisible=jn,t.findElement=zn,t.getElementPath=function(t,e=4){if(!t)return null;const n=[];let o=t;for(;o&&e>n.length&&"BODY"!==o.tagName;){let t=o.tagName.toLowerCase();o.id?t+=`#${o.id}`:o.classList.length&&(t+=`.${o.classList[0]}`),n.unshift(t),o=o.parentElement}return n.join(" > ")}}({});
2
2
  //# sourceMappingURL=product-tours.js.map