var I,p,v_,E,e_,y_,O,P={},K=[],$_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Q=Array.isArray;function $(e,_){for(var t in _)e[t]=_[t];return e}function m_(e){var _=e.parentNode;_&&_.removeChild(e)}function E_(e,_,t){var o,n,i,l={};for(i in _)i=="key"?o=_[i]:i=="ref"?n=_[i]:l[i]=_[i];if(arguments.length>2&&(l.children=arguments.length>3?I.call(arguments,2):t),typeof e=="function"&&e.defaultProps!=null)for(i in e.defaultProps)l[i]===void 0&&(l[i]=e.defaultProps[i]);return F(e,l,o,n,null)}function F(e,_,t,o,n){var i={type:e,props:_,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:n??++v_,__i:-1,__u:0};return n==null&&p.vnode!=null&&p.vnode(i),i}function A(e){return e.children}function M(e,_){this.props=e,this.context=_}function x(e,_){if(_==null)return e.__?x(e.__,e.__i+1):null;for(var t;_t?(z(o,_,n),n.length=o.length=0,_=void 0,E.sort(O)):_&&p.__c&&p.__c(_,K));_&&z(o,_,n),B.__r=0}function b_(e,_,t,o,n,i,l,c,f,s,a){var r,g,u,v,S,y=o&&o.__k||K,d=_.length;for(t.__d=f,x_(t,_,y),f=t.__d,r=0;r0?F(n.type,n.props,n.key,n.ref?n.ref:null,n.__v):n)!=null?(n.__=e,n.__b=e.__b+1,c=C_(n,t,l=o+r,a),n.__i=c,i=null,c!==-1&&(a--,(i=t[c])&&(i.__u|=131072)),i==null||i.__v===null?(c==-1&&r--,typeof n.type!="function"&&(n.__u|=65536)):c!==l&&(c===l+1?r++:c>l?a>f-l?r+=c-l:r--:r=c(f!=null&&!(131072&f.__u)?1:0))for(;l>=0||c<_.length;){if(l>=0){if((f=_[l])&&!(131072&f.__u)&&n==f.key&&i===f.type)return l;l--}if(c<_.length){if((f=_[c])&&!(131072&f.__u)&&n==f.key&&i===f.type)return c;c++}}return-1}function n_(e,_,t){_[0]==="-"?e.setProperty(_,t??""):e[_]=t==null?"":typeof t!="number"||$_.test(_)?t:t+"px"}function N(e,_,t,o,n){var i;_:if(_==="style")if(typeof t=="string")e.style.cssText=t;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(_ in o)t&&_ in t||n_(e.style,_,"");if(t)for(_ in t)o&&t[_]===o[_]||n_(e.style,_,t[_])}else if(_[0]==="o"&&_[1]==="n")i=_!==(_=_.replace(/(PointerCapture)$|Capture$/i,"$1")),_=_.toLowerCase()in e?_.toLowerCase().slice(2):_.slice(2),e.l||(e.l={}),e.l[_+i]=t,t?o?t.u=o.u:(t.u=Date.now(),e.addEventListener(_,i?r_:o_,i)):e.removeEventListener(_,i?r_:o_,i);else{if(n)_=_.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(_!=="width"&&_!=="height"&&_!=="href"&&_!=="list"&&_!=="form"&&_!=="tabIndex"&&_!=="download"&&_!=="rowSpan"&&_!=="colSpan"&&_!=="role"&&_ in e)try{e[_]=t??"";break _}catch{}typeof t=="function"||(t==null||t===!1&&_[4]!=="-"?e.removeAttribute(_):e.setAttribute(_,t))}}function o_(e){if(this.l){var _=this.l[e.type+!1];if(e.t){if(e.t<=_.u)return}else e.t=Date.now();return _(p.event?p.event(e):e)}}function r_(e){if(this.l)return this.l[e.type+!0](p.event?p.event(e):e)}function X(e,_,t,o,n,i,l,c,f,s){var a,r,g,u,v,S,y,d,m,w,T,C,__,D,j,k=_.type;if(_.constructor!==void 0)return null;128&t.__u&&(f=!!(32&t.__u),i=[c=_.__e=t.__e]),(a=p.__b)&&a(_);_:if(typeof k=="function")try{if(d=_.props,m=(a=k.contextType)&&o[a.__c],w=a?m?m.props.value:a.__:o,t.__c?y=(r=_.__c=t.__c).__=r.__E:("prototype"in k&&k.prototype.render?_.__c=r=new k(d,w):(_.__c=r=new M(d,w),r.constructor=k,r.render=A_),m&&m.sub(r),r.props=d,r.state||(r.state={}),r.context=w,r.__n=o,g=r.__d=!0,r.__h=[],r._sb=[]),r.__s==null&&(r.__s=r.state),k.getDerivedStateFromProps!=null&&(r.__s==r.state&&(r.__s=$({},r.__s)),$(r.__s,k.getDerivedStateFromProps(d,r.__s))),u=r.props,v=r.state,r.__v=_,g)k.getDerivedStateFromProps==null&&r.componentWillMount!=null&&r.componentWillMount(),r.componentDidMount!=null&&r.__h.push(r.componentDidMount);else{if(k.getDerivedStateFromProps==null&&d!==u&&r.componentWillReceiveProps!=null&&r.componentWillReceiveProps(d,w),!r.__e&&(r.shouldComponentUpdate!=null&&r.shouldComponentUpdate(d,r.__s,w)===!1||_.__v===t.__v)){for(_.__v!==t.__v&&(r.props=d,r.state=r.__s,r.__d=!1),_.__e=t.__e,_.__k=t.__k,_.__k.forEach(function(L){L&&(L.__=_)}),T=0;T=t.__.length&&t.__.push({__V:V}),t.__[e]}function N_(e,_){var t=L_(G++,3);!h.__s&&M_(t.__H,_)&&(t.__=e,t.i=_,b.__H.__h.push(t))}function U_(){for(var e;e=w_.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(W),e.__H.__h.forEach(J),e.__H.__h=[]}catch(_){e.__H.__h=[],h.__e(_,e.__v)}}h.__b=function(e){b=null,l_&&l_(e)},h.__=function(e,_){_.__k&&_.__k.__m&&(e.__m=_.__k.__m),p_&&p_(e,_)},h.__r=function(e){c_&&c_(e),G=0;var _=(b=e.__c).__H;_&&(q===b?(_.__h=[],b.__h=[],_.__.forEach(function(t){t.__N&&(t.__=t.__N),t.__V=V,t.__N=t.i=void 0})):(_.__h.forEach(W),_.__h.forEach(J),_.__h=[],G=0)),q=b},h.diffed=function(e){u_&&u_(e);var _=e.__c;_&&_.__H&&(_.__H.__h.length&&(w_.push(_)!==1&&i_===h.requestAnimationFrame||((i_=h.requestAnimationFrame)||F_)(U_)),_.__H.__.forEach(function(t){t.i&&(t.__H=t.i),t.__V!==V&&(t.__=t.__V),t.i=void 0,t.__V=V})),q=b=null},h.__c=function(e,_){_.some(function(t){try{t.__h.forEach(W),t.__h=t.__h.filter(function(o){return!o.__||J(o)})}catch(o){_.some(function(n){n.__h&&(n.__h=[])}),_=[],h.__e(o,t.__v)}}),f_&&f_(e,_)},h.unmount=function(e){a_&&a_(e);var _,t=e.__c;t&&t.__H&&(t.__H.__.forEach(function(o){try{W(o)}catch(n){_=n}}),t.__H=void 0,_&&h.__e(_,t.__v))};var d_=typeof requestAnimationFrame=="function";function F_(e){var _,t=function(){clearTimeout(o),d_&&cancelAnimationFrame(_),setTimeout(e)},o=setTimeout(t,100);d_&&(_=requestAnimationFrame(t))}function W(e){var _=b,t=e.__c;typeof t=="function"&&(e.__c=void 0,t()),b=_}function J(e){var _=b;e.__c=e.__(),b=_}function M_(e,_){return!e||e.length!==_.length||_.some(function(t,o){return t!==e[o]})}const h_="https://script.withlantern.com/api",H=document.currentScript,V_=(H==null?void 0:H.getAttribute("tenant"))??(H==null?void 0:H.getAttribute("data-tenant")),W_=async(e,_=!1)=>{const t=JSON.stringify(e);return _?navigator.sendBeacon(`${h_}/endSession`,t):await fetch(`${h_}/newSession`,{body:t,headers:{"Content-Type":"application/json"},method:"POST"})},U=async({close:e=!1,receiveNew:_=!1,sendSession:t=!0}={})=>{const o=sessionStorage.getItem("lantern-session"),n=await W_({domain:window.location.hostname,path:window.location.pathname,receive_new:_,session_id:t?o:void 0,tenant:V_,referrer:document.referrer},e);if(n instanceof Response&&n.status===200){const i=await n.text();sessionStorage.setItem("lantern-session",i)}};function B_(){N_(()=>{U({sendSession:!1});const e=()=>{U({receiveNew:!0})},_=()=>{document.visibilityState==="visible"&&U({sendSession:!1}),document.visibilityState==="hidden"&&sessionStorage.getItem("lantern-session")&&U({close:!0})},t=history.pushState,o=history.replaceState;return history.pushState=function(...n){t.apply(history,n),e()},history.replaceState=function(...n){o.apply(history,n),e()},window.addEventListener("popstate",e),document.addEventListener("visibilitychange",_),()=>{history.pushState=t,history.replaceState=o,window.removeEventListener("popstate",e),document.removeEventListener("visibilitychange",_)}})}function I_(){return B_(),S_(A,{})}const Z=document.createElement("div");Z.id="lantern-script";document.body.appendChild(Z);T_(S_(I_,{}),Z);