@scoperat/tracker 0.3.1 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -8
- package/dist/index.d.ts +30 -0
- package/dist/index.js +197 -52
- package/dist/index.js.map +1 -1
- package/dist/widget/index.js +197 -52
- package/dist/widget/index.js.map +1 -1
- package/dist/widget.global.js +97 -96
- package/dist/widget.global.js.map +1 -1
- package/package.json +29 -17
package/dist/widget.global.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var ScopeRatWidget=(()=>{var gt=Object.defineProperty;var as=Object.getOwnPropertyDescriptor;var ls=Object.getOwnPropertyNames;var cs=Object.prototype.hasOwnProperty;var us=(t,e,n)=>e in t?gt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ps=(t,e)=>{for(var n in e)gt(t,n,{get:e[n],enumerable:!0})},ds=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ls(e))!cs.call(t,i)&&i!==n&>(t,i,{get:()=>e[i],enumerable:!(r=as(e,i))||r.enumerable});return t};var hs=t=>ds(gt({},"__esModule",{value:!0}),t);var b=(t,e,n)=>us(t,typeof e!="symbol"?e+"":e,n);var Qo={};ps(Qo,{destroyWidget:()=>Zo,initWidget:()=>Xo});var yt,R,wr,fs,xe,_r,vr,yr,tn,_t,Ge,Tr,on,nn,rn,gs,kt={},wt=[],ms=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Tt=Array.isArray;function he(t,e){for(var n in e)t[n]=e[n];return t}function an(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function ln(t,e,n){var r,i,s,o={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?yt.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)o[s]===void 0&&(o[s]=t.defaultProps[s]);return xt(t,o,r,i,null)}function xt(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++wr,__i:-1,__u:0};return i==null&&R.vnode!=null&&R.vnode(s),s}function be(t){return t.children}function bt(t,e){this.props=t,this.context=e}function Me(t,e){if(e==null)return t.__?Me(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?Me(t):null}function _s(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,r=[],i=[],s=he({},e);s.__v=e.__v+1,R.vnode&&R.vnode(s),cn(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,r,n??Me(e),!!(32&e.__u),i),s.__v=e.__v,s.__.__k[s.__i]=s,Ir(r,s,i),e.__e=e.__=null,s.__e!=n&&Sr(s)}}function Sr(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Sr(t)}function xr(t){(!t.__d&&(t.__d=!0)&&xe.push(t)&&!vt.__r++||_r!=R.debounceRendering)&&((_r=R.debounceRendering)||vr)(vt)}function vt(){try{for(var t,e=1;xe.length;)xe.length>e&&xe.sort(yr),t=xe.shift(),e=xe.length,_s(t)}finally{xe.length=vt.__r=0}}function Er(t,e,n,r,i,s,o,u,l,p,h){var d,m,g,_,E,w,v,T=r&&r.__k||wt,D=e.length;for(l=xs(n,e,T,l,D),d=0;d<D;d++)(g=n.__k[d])!=null&&(m=g.__i!=-1&&T[g.__i]||kt,g.__i=d,w=cn(t,g,m,i,s,o,u,l,p,h),_=g.__e,g.ref&&m.ref!=g.ref&&(m.ref&&un(m.ref,null,g),h.push(g.ref,g.__c||_,g)),E==null&&_!=null&&(E=_),(v=!!(4&g.__u))||m.__k===g.__k?(l=Ar(g,l,t,v),v&&m.__e&&(m.__e=null)):typeof g.type=="function"&&w!==void 0?l=w:_&&(l=_.nextSibling),g.__u&=-7);return n.__e=E,l}function xs(t,e,n,r,i){var s,o,u,l,p,h=n.length,d=h,m=0;for(t.__k=new Array(i),s=0;s<i;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[s]=xt(null,o,null,null,null):Tt(o)?o=t.__k[s]=xt(be,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[s]=xt(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[s]=o,l=s+m,o.__=t,o.__b=t.__b+1,u=null,(p=o.__i=bs(o,n,l,d))!=-1&&(d--,(u=n[p])&&(u.__u|=2)),u==null||u.__v==null?(p==-1&&(i>h?m--:i<h&&m++),typeof o.type!="function"&&(o.__u|=4)):p!=l&&(p==l-1?m--:p==l+1?m++:(p>l?m--:m++,o.__u|=4))):t.__k[s]=null;if(d)for(s=0;s<h;s++)(u=n[s])!=null&&(2&u.__u)==0&&(u.__e==r&&(r=Me(u)),Cr(u,u));return r}function Ar(t,e,n,r){var i,s;if(typeof t.type=="function"){for(i=t.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=t,e=Ar(i[s],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=Me(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function bs(t,e,n,r){var i,s,o,u=t.key,l=t.type,p=e[n],h=p!=null&&(2&p.__u)==0;if(p===null&&u==null||h&&u==p.key&&l==p.type)return n;if(r>(h?1:0)){for(i=n-1,s=n+1;i>=0||s<e.length;)if((p=e[o=i>=0?i--:s++])!=null&&(2&p.__u)==0&&u==p.key&&l==p.type)return o}return-1}function br(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||ms.test(e)?n:n+"px"}function mt(t,e,n,r,i){var s,o;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||br(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||br(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(Tr,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r?n[Ge]=r[Ge]:(n[Ge]=on,t.addEventListener(e,s?rn:nn,s)):t.removeEventListener(e,s?rn:nn,s);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function kr(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[_t]==null)e[_t]=on++;else if(e[_t]<n[Ge])return;return n(R.event?R.event(e):e)}}}function cn(t,e,n,r,i,s,o,u,l,p){var h,d,m,g,_,E,w,v,T,D,A,U,q,ue,ge,I=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),s=[u=e.__e=n.__e]),(h=R.__b)&&h(e);e:if(typeof I=="function")try{if(v=e.props,T=I.prototype&&I.prototype.render,D=(h=I.contextType)&&r[h.__c],A=h?D?D.props.value:h.__:r,n.__c?w=(d=e.__c=n.__c).__=d.__E:(T?e.__c=d=new I(v,A):(e.__c=d=new bt(v,A),d.constructor=I,d.render=ws),D&&D.sub(d),d.state||(d.state={}),d.__n=r,m=d.__d=!0,d.__h=[],d._sb=[]),T&&d.__s==null&&(d.__s=d.state),T&&I.getDerivedStateFromProps!=null&&(d.__s==d.state&&(d.__s=he({},d.__s)),he(d.__s,I.getDerivedStateFromProps(v,d.__s))),g=d.props,_=d.state,d.__v=e,m)T&&I.getDerivedStateFromProps==null&&d.componentWillMount!=null&&d.componentWillMount(),T&&d.componentDidMount!=null&&d.__h.push(d.componentDidMount);else{if(T&&I.getDerivedStateFromProps==null&&v!==g&&d.componentWillReceiveProps!=null&&d.componentWillReceiveProps(v,A),e.__v==n.__v||!d.__e&&d.shouldComponentUpdate!=null&&d.shouldComponentUpdate(v,d.__s,A)===!1){e.__v!=n.__v&&(d.props=v,d.state=d.__s,d.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(F){F&&(F.__=e)}),wt.push.apply(d.__h,d._sb),d._sb=[],d.__h.length&&o.push(d);break e}d.componentWillUpdate!=null&&d.componentWillUpdate(v,d.__s,A),T&&d.componentDidUpdate!=null&&d.__h.push(function(){d.componentDidUpdate(g,_,E)})}if(d.context=A,d.props=v,d.__P=t,d.__e=!1,U=R.__r,q=0,T)d.state=d.__s,d.__d=!1,U&&U(e),h=d.render(d.props,d.state,d.context),wt.push.apply(d.__h,d._sb),d._sb=[];else do d.__d=!1,U&&U(e),h=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++q<25);d.state=d.__s,d.getChildContext!=null&&(r=he(he({},r),d.getChildContext())),T&&!m&&d.getSnapshotBeforeUpdate!=null&&(E=d.getSnapshotBeforeUpdate(g,_)),ue=h!=null&&h.type===be&&h.key==null?Rr(h.props.children):h,u=Er(t,Tt(ue)?ue:[ue],e,n,r,i,s,o,u,l,p),d.base=e.__e,e.__u&=-161,d.__h.length&&o.push(d),w&&(d.__E=d.__=null)}catch(F){if(e.__v=null,l||s!=null)if(F.then){for(e.__u|=l?160:128;u&&u.nodeType==8&&u.nextSibling;)u=u.nextSibling;s[s.indexOf(u)]=null,e.__e=u}else{for(ge=s.length;ge--;)an(s[ge]);sn(e)}else e.__e=n.__e,e.__k=n.__k,F.then||sn(e);R.__e(F,e,n)}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):u=e.__e=ks(n.__e,e,n,r,i,s,o,l,p);return(h=R.diffed)&&h(e),128&e.__u?void 0:u}function sn(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(sn))}function Ir(t,e,n){for(var r=0;r<n.length;r++)un(n[r],n[++r],n[++r]);R.__c&&R.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){R.__e(s,i.__v)}})}function Rr(t){return typeof t!="object"||t==null||t.__b>0?t:Tt(t)?t.map(Rr):he({},t)}function ks(t,e,n,r,i,s,o,u,l){var p,h,d,m,g,_,E,w=n.props||kt,v=e.props,T=e.type;if(T=="svg"?i="http://www.w3.org/2000/svg":T=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(p=0;p<s.length;p++)if((g=s[p])&&"setAttribute"in g==!!T&&(T?g.localName==T:g.nodeType==3)){t=g,s[p]=null;break}}if(t==null){if(T==null)return document.createTextNode(v);t=document.createElementNS(i,T,v.is&&v),u&&(R.__m&&R.__m(e,s),u=!1),s=null}if(T==null)w===v||u&&t.data==v||(t.data=v);else{if(s=s&&yt.call(t.childNodes),!u&&s!=null)for(w={},p=0;p<t.attributes.length;p++)w[(g=t.attributes[p]).name]=g.value;for(p in w)g=w[p],p=="dangerouslySetInnerHTML"?d=g:p=="children"||p in v||p=="value"&&"defaultValue"in v||p=="checked"&&"defaultChecked"in v||mt(t,p,null,g,i);for(p in v)g=v[p],p=="children"?m=g:p=="dangerouslySetInnerHTML"?h=g:p=="value"?_=g:p=="checked"?E=g:u&&typeof g!="function"||w[p]===g||mt(t,p,g,w[p],i);if(h)u||d&&(h.__html==d.__html||h.__html==t.innerHTML)||(t.innerHTML=h.__html),e.__k=[];else if(d&&(t.innerHTML=""),Er(e.type=="template"?t.content:t,Tt(m)?m:[m],e,n,r,T=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,o,s?s[0]:n.__k&&Me(n,0),u,l),s!=null)for(p=s.length;p--;)an(s[p]);u||(p="value",T=="progress"&&_==null?t.removeAttribute("value"):_!=null&&(_!==t[p]||T=="progress"&&!_||T=="option"&&_!=w[p])&&mt(t,p,_,w[p],i),p="checked",E!=null&&E!=t[p]&&mt(t,p,E,w[p],i))}return t}function un(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){R.__e(i,n)}}function Cr(t,e,n){var r,i;if(R.unmount&&R.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||un(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){R.__e(s,e)}r.base=r.__P=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&Cr(r[i],e,n||typeof t.type!="function");n||an(t.__e),t.__c=t.__=t.__e=void 0}function ws(t,e,n){return this.constructor(t,n)}function pn(t,e,n){var r,i,s,o;e==document&&(e=document.documentElement),R.__&&R.__(t,e),i=(r=typeof n=="function")?null:n&&n.__k||e.__k,s=[],o=[],cn(e,t=(!r&&n||e).__k=ln(be,null,[t]),i||kt,kt,e.namespaceURI,!r&&n?[n]:i?null:e.firstChild?yt.call(e.childNodes):null,s,!r&&n?n:i?i.__e:e.firstChild,r,o),Ir(s,t,o)}yt=wt.slice,R={__e:function(t,e,n,r){for(var i,s,o;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),o=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),o=i.__d),o)return i.__E=i}catch(u){t=u}throw t}},wr=0,fs=function(t){return t!=null&&t.constructor===void 0},bt.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=he({},this.state),typeof t=="function"&&(t=t(he({},n),this.props)),t&&he(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),xr(this))},bt.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),xr(this))},bt.prototype.render=be,xe=[],vr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,yr=function(t,e){return t.__v.__b-e.__v.__b},vt.__r=0,tn=Math.random().toString(8),_t="__d"+tn,Ge="__a"+tn,Tr=/(PointerCapture)$|Capture$/i,on=0,nn=kr(!1),rn=kr(!0),gs=0;function Lr(t={},e=!1){let n=t.primaryColor??"#6366f1",r=t.textColor??(e?"#d4d4d4":"#1f2937"),i=t.backgroundColor??(e?"#121212":"#ffffff"),s=t.fontFamily??'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',o=e?"#272727":"#ffffff",u=e?"rgba(255,255,255,0.05)":"#f0f0f0",l=e?"rgba(255,255,255,0.15)":"#d1d5db",p=e?"rgba(255,255,255,0.05)":"#e5e7eb",h=e?"#3a3a3a":"#f9fafb",d=e?"#3a3a3a":"#f3f4f6",m=e?"#525252":"#e5e7eb",g=e?"#a3a3a3":"#6b7280",_=e?"#a3a3a3":"#4b5563",E=e?"#d4d4d4":"#374151",w=e?"#272727":"white";return`
|
|
1
|
+
"use strict";var ScopeRatWidget=(()=>{var Tt=Object.defineProperty;var qs=Object.getOwnPropertyDescriptor;var Ks=Object.getOwnPropertyNames;var Vs=Object.prototype.hasOwnProperty;var Xs=(t,e,n)=>e in t?Tt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ys=(t,e)=>{for(var n in e)Tt(t,n,{get:e[n],enumerable:!0})},Zs=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ks(e))!Vs.call(t,i)&&i!==n&&Tt(t,i,{get:()=>e[i],enumerable:!(r=qs(e,i))||r.enumerable});return t};var Qs=t=>Zs(Tt({},"__esModule",{value:!0}),t);var k=(t,e,n)=>Xs(t,typeof e!="symbol"?e+"":e,n);var Qa={};Ys(Qa,{destroyWidget:()=>Za,initWidget:()=>Ya});var $t,L,Hr,Js,ve,Pr,Ur,Br,kn,Et,et,jr,vn,wn,yn,eo,Rt={},Ct=[],to=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ot=Array.isArray;function be(t,e){for(var n in e)t[n]=e[n];return t}function Tn(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Sn(t,e,n){var r,i,s,a={};for(s in e)s=="key"?r=e[s]:s=="ref"?i=e[s]:a[s]=e[s];if(arguments.length>2&&(a.children=arguments.length>3?$t.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(s in t.defaultProps)a[s]===void 0&&(a[s]=t.defaultProps[s]);return At(t,a,r,i,null)}function At(t,e,n,r,i){var s={type:t,props:e,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++Hr,__i:-1,__u:0};return i==null&&L.vnode!=null&&L.vnode(s),s}function Te(t){return t.children}function It(t,e){this.props=t,this.context=e}function We(t,e){if(e==null)return t.__?We(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?We(t):null}function no(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,r=[],i=[],s=be({},e);s.__v=e.__v+1,L.vnode&&L.vnode(s),En(t.__P,s,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,r,n??We(e),!!(32&e.__u),i),s.__v=e.__v,s.__.__k[s.__i]=s,Vr(r,s,i),e.__e=e.__=null,s.__e!=n&&Wr(s)}}function Wr(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Wr(t)}function Mr(t){(!t.__d&&(t.__d=!0)&&ve.push(t)&&!Lt.__r++||Pr!=L.debounceRendering)&&((Pr=L.debounceRendering)||Ur)(Lt)}function Lt(){try{for(var t,e=1;ve.length;)ve.length>e&&ve.sort(Br),t=ve.shift(),e=ve.length,no(t)}finally{ve.length=Lt.__r=0}}function Gr(t,e,n,r,i,s,a,c,h,l,g){var f,p,m,x,E,y,S,v=r&&r.__k||Ct,N=e.length;for(h=ro(n,e,v,h,N),f=0;f<N;f++)(m=n.__k[f])!=null&&(p=m.__i!=-1&&v[m.__i]||Rt,m.__i=f,y=En(t,m,p,i,s,a,c,h,l,g),x=m.__e,m.ref&&p.ref!=m.ref&&(p.ref&&An(p.ref,null,m),g.push(m.ref,m.__c||x,m)),E==null&&x!=null&&(E=x),(S=!!(4&m.__u))||p.__k===m.__k?(h=qr(m,h,t,S),S&&p.__e&&(p.__e=null)):typeof m.type=="function"&&y!==void 0?h=y:x&&(h=x.nextSibling),m.__u&=-7);return n.__e=E,h}function ro(t,e,n,r,i){var s,a,c,h,l,g=n.length,f=g,p=0;for(t.__k=new Array(i),s=0;s<i;s++)(a=e[s])!=null&&typeof a!="boolean"&&typeof a!="function"?(typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?a=t.__k[s]=At(null,a,null,null,null):Ot(a)?a=t.__k[s]=At(Te,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?a=t.__k[s]=At(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):t.__k[s]=a,h=s+p,a.__=t,a.__b=t.__b+1,c=null,(l=a.__i=io(a,n,h,f))!=-1&&(f--,(c=n[l])&&(c.__u|=2)),c==null||c.__v==null?(l==-1&&(i>g?p--:i<g&&p++),typeof a.type!="function"&&(a.__u|=4)):l!=h&&(l==h-1?p--:l==h+1?p++:(l>h?p--:p++,a.__u|=4))):t.__k[s]=null;if(f)for(s=0;s<g;s++)(c=n[s])!=null&&(2&c.__u)==0&&(c.__e==r&&(r=We(c)),Yr(c,c));return r}function qr(t,e,n,r){var i,s;if(typeof t.type=="function"){for(i=t.__k,s=0;i&&s<i.length;s++)i[s]&&(i[s].__=t,e=qr(i[s],e,n,r));return e}t.__e!=e&&(r&&(e&&t.type&&!e.parentNode&&(e=We(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function io(t,e,n,r){var i,s,a,c=t.key,h=t.type,l=e[n],g=l!=null&&(2&l.__u)==0;if(l===null&&c==null||g&&c==l.key&&h==l.type)return n;if(r>(g?1:0)){for(i=n-1,s=n+1;i>=0||s<e.length;)if((l=e[a=i>=0?i--:s++])!=null&&(2&l.__u)==0&&c==l.key&&h==l.type)return a}return-1}function zr(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||to.test(e)?n:n+"px"}function St(t,e,n,r,i){var s,a;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof r=="string"&&(t.style.cssText=r=""),r)for(e in r)n&&e in n||zr(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||zr(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(jr,"$1")),a=e.toLowerCase(),e=a in t||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+s]=n,n?r?n[et]=r[et]:(n[et]=vn,t.addEventListener(e,s?yn:wn,s)):t.removeEventListener(e,s?yn:wn,s);else{if(i=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function Fr(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[Et]==null)e[Et]=vn++;else if(e[Et]<n[et])return;return n(L.event?L.event(e):e)}}}function En(t,e,n,r,i,s,a,c,h,l){var g,f,p,m,x,E,y,S,v,N,D,P,C,re,ae,M,O=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(h=!!(32&n.__u),s=[c=e.__e=n.__e]),(g=L.__b)&&g(e);e:if(typeof O=="function"){f=a.length;try{if(v=e.props,N=O.prototype&&O.prototype.render,D=(g=O.contextType)&&r[g.__c],P=g?D?D.props.value:g.__:r,n.__c?S=(p=e.__c=n.__c).__=p.__E:(N?e.__c=p=new O(v,P):(e.__c=p=new It(v,P),p.constructor=O,p.render=oo),D&&D.sub(p),p.state||(p.state={}),p.__n=r,m=p.__d=!0,p.__h=[],p._sb=[]),N&&p.__s==null&&(p.__s=p.state),N&&O.getDerivedStateFromProps!=null&&(p.__s==p.state&&(p.__s=be({},p.__s)),be(p.__s,O.getDerivedStateFromProps(v,p.__s))),x=p.props,E=p.state,p.__v=e,m)N&&O.getDerivedStateFromProps==null&&p.componentWillMount!=null&&p.componentWillMount(),N&&p.componentDidMount!=null&&p.__h.push(p.componentDidMount);else{if(N&&O.getDerivedStateFromProps==null&&v!==x&&p.componentWillReceiveProps!=null&&p.componentWillReceiveProps(v,P),e.__v==n.__v||!p.__e&&p.shouldComponentUpdate!=null&&p.shouldComponentUpdate(v,p.__s,P)===!1){e.__v!=n.__v&&(p.props=v,p.state=p.__s,p.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(J){J&&(J.__=e)}),Ct.push.apply(p.__h,p._sb),p._sb=[],p.__h.length&&a.push(p);break e}p.componentWillUpdate!=null&&p.componentWillUpdate(v,p.__s,P),N&&p.componentDidUpdate!=null&&p.__h.push(function(){p.componentDidUpdate(x,E,y)})}if(p.context=P,p.props=v,p.__P=t,p.__e=!1,C=L.__r,re=0,N)p.state=p.__s,p.__d=!1,C&&C(e),g=p.render(p.props,p.state,p.context),Ct.push.apply(p.__h,p._sb),p._sb=[];else do p.__d=!1,C&&C(e),g=p.render(p.props,p.state,p.context),p.state=p.__s;while(p.__d&&++re<25);p.state=p.__s,p.getChildContext!=null&&(r=be(be({},r),p.getChildContext())),N&&!m&&p.getSnapshotBeforeUpdate!=null&&(y=p.getSnapshotBeforeUpdate(x,E)),ae=g!=null&&g.type===Te&&g.key==null?Xr(g.props.children):g,c=Gr(t,Ot(ae)?ae:[ae],e,n,r,i,s,a,c,h,l),p.base=e.__e,e.__u&=-161,p.__h.length&&a.push(p),S&&(p.__E=p.__=null)}catch(J){if(a.length=f,e.__v=null,h||s!=null){if(J.then){for(e.__u|=h?160:128;c&&c.nodeType==8&&c.nextSibling;)c=c.nextSibling;s!=null&&(s[s.indexOf(c)]=null),e.__e=c}else if(s!=null)for(M=s.length;M--;)Tn(s[M])}else e.__e=n.__e;e.__k==null&&(e.__k=n.__k||[]),J.then||Kr(e),L.__e(J,e,n)}}else s==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):c=e.__e=so(n.__e,e,n,r,i,s,a,h,l);return(g=L.diffed)&&g(e),128&e.__u?void 0:c}function Kr(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Kr))}function Vr(t,e,n){for(var r=0;r<n.length;r++)An(n[r],n[++r],n[++r]);L.__c&&L.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(s){s.call(i)})}catch(s){L.__e(s,i.__v)}})}function Xr(t){return typeof t!="object"||t==null||t.__b>0?t:Ot(t)?t.map(Xr):t.constructor!==void 0?null:be({},t)}function so(t,e,n,r,i,s,a,c,h){var l,g,f,p,m,x,E,y=n.props||Rt,S=e.props,v=e.type;if(v=="svg"?i="http://www.w3.org/2000/svg":v=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),s!=null){for(l=0;l<s.length;l++)if((m=s[l])&&"setAttribute"in m==!!v&&(v?m.localName==v:m.nodeType==3)){t=m,s[l]=null;break}}if(t==null){if(v==null)return document.createTextNode(S);t=document.createElementNS(i,v,S.is&&S),c&&(L.__m&&L.__m(e,s),c=!1),s=null}if(v==null)y===S||c&&t.data==S||(t.data=S);else{if(s=v=="textarea"&&S.defaultValue!=null?null:s&&$t.call(t.childNodes),!c&&s!=null)for(y={},l=0;l<t.attributes.length;l++)y[(m=t.attributes[l]).name]=m.value;for(l in y)m=y[l],l=="dangerouslySetInnerHTML"?f=m:l=="children"||l in S||l=="value"&&"defaultValue"in S||l=="checked"&&"defaultChecked"in S||St(t,l,null,m,i);for(l in S)m=S[l],l=="children"?p=m:l=="dangerouslySetInnerHTML"?g=m:l=="value"?x=m:l=="checked"?E=m:c&&typeof m!="function"||y[l]===m||St(t,l,m,y[l],i);if(g)c||f&&(g.__html==f.__html||g.__html==t.innerHTML)||(t.innerHTML=g.__html),e.__k=[];else if(f&&(t.innerHTML=""),Gr(e.type=="template"?t.content:t,Ot(p)?p:[p],e,n,r,v=="foreignObject"?"http://www.w3.org/1999/xhtml":i,s,a,s?s[0]:n.__k&&We(n,0),c,h),s!=null)for(l=s.length;l--;)Tn(s[l]);c&&v!="textarea"||(l="value",v=="progress"&&x==null?t.removeAttribute("value"):x!=null&&(x!==t[l]||v=="progress"&&!x||v=="option"&&x!=y[l])&&St(t,l,x,y[l],i),l="checked",E!=null&&E!=t[l]&&St(t,l,E,y[l],i))}return t}function An(t,e,n){try{if(typeof t=="function"){var r=typeof t.__u=="function";r&&t.__u(),r&&e==null||(t.__u=t(e))}else t.current=e}catch(i){L.__e(i,n)}}function Yr(t,e,n){var r,i;if(L.unmount&&L.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||An(r,null,e)),(r=t.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){L.__e(s,e)}r.base=r.__P=r.__n=null}if(r=t.__k)for(i=0;i<r.length;i++)r[i]&&Yr(r[i],e,n||typeof t.type!="function");n||Tn(t.__e),t.__c=t.__=t.__e=void 0}function oo(t,e,n){return this.constructor(t,n)}function In(t,e,n){var r,i,s,a;e==document&&(e=document.documentElement),L.__&&L.__(t,e),i=(r=typeof n=="function")?null:n&&n.__k||e.__k,s=[],a=[],En(e,t=(!r&&n||e).__k=Sn(Te,null,[t]),i||Rt,Rt,e.namespaceURI,!r&&n?[n]:i?null:e.firstChild?$t.call(e.childNodes):null,s,!r&&n?n:i?i.__e:e.firstChild,r,a),Vr(s,t,a),t.props.children=null}$t=Ct.slice,L={__e:function(t,e,n,r){for(var i,s,a;e=e.__;)if((i=e.__c)&&!i.__)try{if((s=i.constructor)&&s.getDerivedStateFromError!=null&&(i.setState(s.getDerivedStateFromError(t)),a=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,r||{}),a=i.__d),a)return i.__E=i}catch(c){t=c}throw t}},Hr=0,Js=function(t){return t!=null&&t.constructor===void 0},It.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=be({},this.state),typeof t=="function"&&(t=t(be({},n),this.props)),t&&be(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),Mr(this))},It.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Mr(this))},It.prototype.render=Te,ve=[],Ur=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Br=function(t,e){return t.__v.__b-e.__v.__b},Lt.__r=0,kn=Math.random().toString(8),Et="__d"+kn,et="__a"+kn,jr=/(PointerCapture)$|Capture$/i,vn=0,wn=Fr(!1),yn=Fr(!0),eo=0;function Zr(t={},e=!1){let n=t.primaryColor??"#6366f1",r=t.textColor??(e?"#d4d4d4":"#1f2937"),i=t.backgroundColor??(e?"#121212":"#ffffff"),s=t.fontFamily??'-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',a=e?"#272727":"#ffffff",c=e?"rgba(255,255,255,0.05)":"#f0f0f0",h=e?"rgba(255,255,255,0.15)":"#d1d5db",l=e?"rgba(255,255,255,0.05)":"#e5e7eb",g=e?"#3a3a3a":"#f9fafb",f=e?"#3a3a3a":"#f3f4f6",p=e?"#525252":"#e5e7eb",m=e?"#a3a3a3":"#6b7280",x=e?"#a3a3a3":"#4b5563",E=e?"#d4d4d4":"#374151",y=e?"#272727":"white";return`
|
|
2
2
|
:host {
|
|
3
3
|
all: initial;
|
|
4
4
|
font-family: ${s};
|
|
@@ -124,11 +124,11 @@
|
|
|
124
124
|
}
|
|
125
125
|
.sr-ticket-item {
|
|
126
126
|
padding: 14px 20px;
|
|
127
|
-
border-bottom: 1px solid ${
|
|
127
|
+
border-bottom: 1px solid ${c};
|
|
128
128
|
cursor: pointer;
|
|
129
129
|
transition: background 0.15s;
|
|
130
130
|
}
|
|
131
|
-
.sr-ticket-item:hover { background: ${
|
|
131
|
+
.sr-ticket-item:hover { background: ${g}; }
|
|
132
132
|
.sr-ticket-item h4 {
|
|
133
133
|
font-size: 14px;
|
|
134
134
|
font-weight: 500;
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
}
|
|
138
138
|
.sr-ticket-item .sr-meta {
|
|
139
139
|
font-size: 12px;
|
|
140
|
-
color: ${
|
|
140
|
+
color: ${m};
|
|
141
141
|
display: flex;
|
|
142
142
|
gap: 8px;
|
|
143
143
|
align-items: center;
|
|
@@ -155,13 +155,13 @@
|
|
|
155
155
|
.sr-badge-access_issue { background: ${e?"#3b2506":"#fefce8"}; color: ${e?"#fcd34d":"#ca8a04"}; }
|
|
156
156
|
.sr-badge-performance { background: ${e?"#2e0a4a":"#fdf4ff"}; color: ${e?"#c084fc":"#9333ea"}; }
|
|
157
157
|
.sr-badge-billing { background: ${e?"#042f2e":"#f0fdfa"}; color: ${e?"#5eead4":"#0d9488"}; }
|
|
158
|
-
.sr-badge-documentation { background: ${
|
|
159
|
-
.sr-badge-other { background: ${
|
|
158
|
+
.sr-badge-documentation { background: ${f}; color: ${m}; }
|
|
159
|
+
.sr-badge-other { background: ${f}; color: ${m}; }
|
|
160
160
|
|
|
161
161
|
.sr-empty {
|
|
162
162
|
padding: 40px 20px;
|
|
163
163
|
text-align: center;
|
|
164
|
-
color: ${
|
|
164
|
+
color: ${m};
|
|
165
165
|
}
|
|
166
166
|
.sr-empty p { margin-bottom: 16px; font-size: 14px; }
|
|
167
167
|
|
|
@@ -187,10 +187,10 @@
|
|
|
187
187
|
cursor: not-allowed;
|
|
188
188
|
}
|
|
189
189
|
.sr-btn-secondary {
|
|
190
|
-
background: ${
|
|
190
|
+
background: ${f};
|
|
191
191
|
color: ${r};
|
|
192
192
|
}
|
|
193
|
-
.sr-btn-secondary:hover { background: ${
|
|
193
|
+
.sr-btn-secondary:hover { background: ${p}; }
|
|
194
194
|
|
|
195
195
|
.sr-form {
|
|
196
196
|
padding: 16px 20px;
|
|
@@ -225,7 +225,7 @@
|
|
|
225
225
|
font-size: 14px;
|
|
226
226
|
font-family: inherit;
|
|
227
227
|
color: ${r};
|
|
228
|
-
background: ${
|
|
228
|
+
background: ${y};
|
|
229
229
|
outline: none;
|
|
230
230
|
}
|
|
231
231
|
.sr-field input:focus,
|
|
@@ -279,14 +279,14 @@
|
|
|
279
279
|
}
|
|
280
280
|
.sr-category-btn {
|
|
281
281
|
padding: 6px 12px;
|
|
282
|
-
border: 1px solid ${
|
|
282
|
+
border: 1px solid ${h};
|
|
283
283
|
border-radius: 9999px;
|
|
284
284
|
font-size: 12px;
|
|
285
285
|
font-weight: 500;
|
|
286
|
-
background: ${
|
|
286
|
+
background: ${y};
|
|
287
287
|
cursor: pointer;
|
|
288
288
|
transition: all 0.15s;
|
|
289
|
-
color: ${
|
|
289
|
+
color: ${x};
|
|
290
290
|
}
|
|
291
291
|
.sr-category-btn.active {
|
|
292
292
|
border-color: ${n};
|
|
@@ -330,7 +330,7 @@
|
|
|
330
330
|
.sr-message {
|
|
331
331
|
padding: 12px 16px;
|
|
332
332
|
background: none;
|
|
333
|
-
border: 1px solid ${
|
|
333
|
+
border: 1px solid ${l};
|
|
334
334
|
border-radius: 8px;
|
|
335
335
|
font-size: 14px;
|
|
336
336
|
line-height: 1.5;
|
|
@@ -342,11 +342,11 @@
|
|
|
342
342
|
align-items: center;
|
|
343
343
|
gap: 6px;
|
|
344
344
|
font-size: 11px;
|
|
345
|
-
color: ${
|
|
345
|
+
color: ${m};
|
|
346
346
|
}
|
|
347
347
|
.sr-message-sender {
|
|
348
348
|
font-weight: 600;
|
|
349
|
-
color: ${
|
|
349
|
+
color: ${m};
|
|
350
350
|
}
|
|
351
351
|
.sr-avatar {
|
|
352
352
|
width: 18px;
|
|
@@ -372,7 +372,7 @@
|
|
|
372
372
|
padding: 12px 16px;
|
|
373
373
|
background: none;
|
|
374
374
|
border-radius: 8px;
|
|
375
|
-
border: 1px solid ${
|
|
375
|
+
border: 1px solid ${l};
|
|
376
376
|
font-size: 14px;
|
|
377
377
|
color: ${r};
|
|
378
378
|
white-space: pre-wrap;
|
|
@@ -383,14 +383,14 @@
|
|
|
383
383
|
.sr-original-desc .sr-desc-label {
|
|
384
384
|
font-size: 11px;
|
|
385
385
|
font-weight: 600;
|
|
386
|
-
color: ${
|
|
386
|
+
color: ${m};
|
|
387
387
|
text-transform: uppercase;
|
|
388
388
|
margin-bottom: 6px;
|
|
389
389
|
}
|
|
390
390
|
|
|
391
391
|
.sr-composer {
|
|
392
392
|
padding: 12px 20px;
|
|
393
|
-
border-top: 1px solid ${
|
|
393
|
+
border-top: 1px solid ${c};
|
|
394
394
|
flex-shrink: 0;
|
|
395
395
|
}
|
|
396
396
|
.sr-composer-wrap {
|
|
@@ -401,7 +401,7 @@
|
|
|
401
401
|
padding: 10px 8px;
|
|
402
402
|
padding-right: 8px;
|
|
403
403
|
padding-bottom: 40px;
|
|
404
|
-
border: 1px solid ${
|
|
404
|
+
border: 1px solid ${l};
|
|
405
405
|
border-radius: 10px;
|
|
406
406
|
font-size: 14px;
|
|
407
407
|
font-family: inherit;
|
|
@@ -410,10 +410,10 @@
|
|
|
410
410
|
max-height: 120px;
|
|
411
411
|
outline: none;
|
|
412
412
|
color: ${r};
|
|
413
|
-
background: ${e?"#1a1a1a":
|
|
413
|
+
background: ${e?"#1a1a1a":y};
|
|
414
414
|
}
|
|
415
415
|
.sr-composer textarea:focus {
|
|
416
|
-
border-color: ${
|
|
416
|
+
border-color: ${l};
|
|
417
417
|
box-shadow: none;
|
|
418
418
|
}
|
|
419
419
|
.sr-composer .sr-send-btn {
|
|
@@ -428,7 +428,7 @@
|
|
|
428
428
|
.sr-loading {
|
|
429
429
|
padding: 40px 20px;
|
|
430
430
|
text-align: center;
|
|
431
|
-
color: ${
|
|
431
|
+
color: ${m};
|
|
432
432
|
}
|
|
433
433
|
|
|
434
434
|
.sr-error {
|
|
@@ -462,7 +462,7 @@
|
|
|
462
462
|
}
|
|
463
463
|
.sr-success p {
|
|
464
464
|
font-size: 14px;
|
|
465
|
-
color: ${
|
|
465
|
+
color: ${m};
|
|
466
466
|
}
|
|
467
467
|
|
|
468
468
|
.sr-form-actions {
|
|
@@ -474,7 +474,7 @@
|
|
|
474
474
|
|
|
475
475
|
.sr-new-btn-wrap {
|
|
476
476
|
padding: 12px 20px;
|
|
477
|
-
border-bottom: 1px solid ${
|
|
477
|
+
border-bottom: 1px solid ${c};
|
|
478
478
|
}
|
|
479
479
|
.sr-new-btn-wrap .sr-btn { width: 100%; }
|
|
480
480
|
|
|
@@ -490,7 +490,7 @@
|
|
|
490
490
|
gap: 6px;
|
|
491
491
|
font-size: 11px;
|
|
492
492
|
font-weight: 600;
|
|
493
|
-
color: ${
|
|
493
|
+
color: ${m};
|
|
494
494
|
text-transform: uppercase;
|
|
495
495
|
letter-spacing: 0.03em;
|
|
496
496
|
margin-bottom: 2px;
|
|
@@ -502,10 +502,10 @@
|
|
|
502
502
|
fill: none;
|
|
503
503
|
}
|
|
504
504
|
.sr-article-card {
|
|
505
|
-
border: 1px solid ${
|
|
505
|
+
border: 1px solid ${l};
|
|
506
506
|
border-radius: 8px;
|
|
507
507
|
overflow: hidden;
|
|
508
|
-
background: ${
|
|
508
|
+
background: ${a};
|
|
509
509
|
}
|
|
510
510
|
.sr-article-btn {
|
|
511
511
|
display: flex;
|
|
@@ -522,7 +522,7 @@
|
|
|
522
522
|
color: ${r};
|
|
523
523
|
transition: background 0.15s;
|
|
524
524
|
}
|
|
525
|
-
.sr-article-btn:hover { background: ${
|
|
525
|
+
.sr-article-btn:hover { background: ${g}; }
|
|
526
526
|
.sr-article-icon {
|
|
527
527
|
width: 16px;
|
|
528
528
|
height: 16px;
|
|
@@ -542,7 +542,7 @@
|
|
|
542
542
|
width: 14px;
|
|
543
543
|
height: 14px;
|
|
544
544
|
flex-shrink: 0;
|
|
545
|
-
stroke: ${
|
|
545
|
+
stroke: ${m};
|
|
546
546
|
fill: none;
|
|
547
547
|
transition: transform 0.2s;
|
|
548
548
|
}
|
|
@@ -550,7 +550,7 @@
|
|
|
550
550
|
.sr-article-loading {
|
|
551
551
|
padding: 8px 12px;
|
|
552
552
|
font-size: 12px;
|
|
553
|
-
color: ${
|
|
553
|
+
color: ${m};
|
|
554
554
|
}
|
|
555
555
|
.sr-article-content {
|
|
556
556
|
padding: 12px;
|
|
@@ -558,7 +558,7 @@
|
|
|
558
558
|
line-height: 1.6;
|
|
559
559
|
color: ${E};
|
|
560
560
|
word-break: break-word;
|
|
561
|
-
border-top: 1px solid ${
|
|
561
|
+
border-top: 1px solid ${c};
|
|
562
562
|
max-height: 300px;
|
|
563
563
|
overflow-y: auto;
|
|
564
564
|
}
|
|
@@ -567,19 +567,19 @@
|
|
|
567
567
|
display: flex;
|
|
568
568
|
margin-top: 8px;
|
|
569
569
|
max-width: 420px;
|
|
570
|
-
border: 1px solid ${
|
|
570
|
+
border: 1px solid ${l};
|
|
571
571
|
border-radius: 8px;
|
|
572
572
|
overflow: hidden;
|
|
573
|
-
background: ${
|
|
573
|
+
background: ${a};
|
|
574
574
|
text-decoration: none;
|
|
575
575
|
color: inherit;
|
|
576
576
|
transition: border-color 0.15s;
|
|
577
577
|
}
|
|
578
|
-
.sr-link-preview:hover { border-color: ${
|
|
578
|
+
.sr-link-preview:hover { border-color: ${m}; }
|
|
579
579
|
.sr-link-preview-img {
|
|
580
580
|
flex-shrink: 0;
|
|
581
581
|
width: 96px;
|
|
582
|
-
border-right: 1px solid ${
|
|
582
|
+
border-right: 1px solid ${c};
|
|
583
583
|
}
|
|
584
584
|
.sr-link-preview-img img {
|
|
585
585
|
width: 100%;
|
|
@@ -600,7 +600,7 @@
|
|
|
600
600
|
align-items: center;
|
|
601
601
|
gap: 5px;
|
|
602
602
|
font-size: 10.5px;
|
|
603
|
-
color: ${
|
|
603
|
+
color: ${m};
|
|
604
604
|
}
|
|
605
605
|
.sr-link-preview-site span {
|
|
606
606
|
overflow: hidden;
|
|
@@ -626,7 +626,7 @@
|
|
|
626
626
|
.sr-link-preview-desc {
|
|
627
627
|
margin: 0;
|
|
628
628
|
font-size: 11.5px;
|
|
629
|
-
color: ${
|
|
629
|
+
color: ${m};
|
|
630
630
|
line-height: 1.4;
|
|
631
631
|
display: -webkit-box;
|
|
632
632
|
-webkit-line-clamp: 2;
|
|
@@ -696,7 +696,7 @@
|
|
|
696
696
|
}
|
|
697
697
|
|
|
698
698
|
.sr-prose blockquote {
|
|
699
|
-
border-left: 3px solid ${
|
|
699
|
+
border-left: 3px solid ${h};
|
|
700
700
|
padding-left: 12px;
|
|
701
701
|
margin: 0.75em 0;
|
|
702
702
|
color: ${e?"#a3a3a3":"#6b7280"};
|
|
@@ -704,7 +704,7 @@
|
|
|
704
704
|
|
|
705
705
|
.sr-prose hr {
|
|
706
706
|
border: none;
|
|
707
|
-
border-top: 1px solid ${
|
|
707
|
+
border-top: 1px solid ${l};
|
|
708
708
|
margin: 1em 0;
|
|
709
709
|
}
|
|
710
710
|
|
|
@@ -722,7 +722,7 @@
|
|
|
722
722
|
font-size: 0.9em;
|
|
723
723
|
}
|
|
724
724
|
.sr-prose th, .sr-prose td {
|
|
725
|
-
border: 1px solid ${
|
|
725
|
+
border: 1px solid ${l};
|
|
726
726
|
padding: 6px 10px;
|
|
727
727
|
text-align: left;
|
|
728
728
|
}
|
|
@@ -736,7 +736,7 @@
|
|
|
736
736
|
height: 28px;
|
|
737
737
|
border-radius: 50%;
|
|
738
738
|
background: none;
|
|
739
|
-
color: ${
|
|
739
|
+
color: ${m};
|
|
740
740
|
border: none;
|
|
741
741
|
cursor: pointer;
|
|
742
742
|
display: flex;
|
|
@@ -771,9 +771,9 @@
|
|
|
771
771
|
gap: 4px;
|
|
772
772
|
padding: 3px 8px;
|
|
773
773
|
border-radius: 9999px;
|
|
774
|
-
background: ${
|
|
774
|
+
background: ${f};
|
|
775
775
|
font-size: 11px;
|
|
776
|
-
color: ${
|
|
776
|
+
color: ${m};
|
|
777
777
|
max-width: 200px;
|
|
778
778
|
}
|
|
779
779
|
.sr-attachment-pill-icon {
|
|
@@ -797,7 +797,7 @@
|
|
|
797
797
|
align-items: center;
|
|
798
798
|
justify-content: center;
|
|
799
799
|
padding: 0;
|
|
800
|
-
color: ${
|
|
800
|
+
color: ${m};
|
|
801
801
|
flex-shrink: 0;
|
|
802
802
|
}
|
|
803
803
|
.sr-attachment-pill-remove:hover { color: ${r}; }
|
|
@@ -811,14 +811,14 @@
|
|
|
811
811
|
}
|
|
812
812
|
|
|
813
813
|
.sr-file-preview {
|
|
814
|
-
border: 1px solid ${
|
|
814
|
+
border: 1px solid ${l};
|
|
815
815
|
border-radius: 8px;
|
|
816
816
|
overflow: hidden;
|
|
817
817
|
max-width: 280px;
|
|
818
818
|
}
|
|
819
819
|
.sr-file-preview-image {
|
|
820
820
|
display: block;
|
|
821
|
-
border-bottom: 1px solid ${
|
|
821
|
+
border-bottom: 1px solid ${l};
|
|
822
822
|
}
|
|
823
823
|
.sr-file-preview-image img {
|
|
824
824
|
display: block;
|
|
@@ -839,7 +839,7 @@
|
|
|
839
839
|
width: 16px;
|
|
840
840
|
height: 16px;
|
|
841
841
|
flex-shrink: 0;
|
|
842
|
-
color: ${
|
|
842
|
+
color: ${m};
|
|
843
843
|
}
|
|
844
844
|
.sr-file-preview-info {
|
|
845
845
|
min-width: 0;
|
|
@@ -860,18 +860,18 @@
|
|
|
860
860
|
span.sr-file-preview-name:hover { text-decoration: none; }
|
|
861
861
|
.sr-file-preview-size {
|
|
862
862
|
font-size: 11px;
|
|
863
|
-
color: ${
|
|
863
|
+
color: ${m};
|
|
864
864
|
}
|
|
865
865
|
.sr-file-preview-download {
|
|
866
866
|
flex-shrink: 0;
|
|
867
867
|
padding: 4px;
|
|
868
868
|
border-radius: 4px;
|
|
869
|
-
color: ${
|
|
869
|
+
color: ${m};
|
|
870
870
|
transition: color 0.15s, background 0.15s;
|
|
871
871
|
}
|
|
872
872
|
.sr-file-preview-download:hover {
|
|
873
873
|
color: ${r};
|
|
874
|
-
background: ${
|
|
874
|
+
background: ${g};
|
|
875
875
|
}
|
|
876
876
|
.sr-file-preview-download svg {
|
|
877
877
|
width: 14px;
|
|
@@ -896,75 +896,76 @@
|
|
|
896
896
|
border: 3px solid transparent;
|
|
897
897
|
background-clip: padding-box;
|
|
898
898
|
}
|
|
899
|
-
`}var
|
|
900
|
-
`)[1]?.trim()??"";return`${t}:${n}`}function Es(t){let e=qr.get(t);return e&&Date.now()-e<6e4?!0:(qr.set(t,Date.now()),!1)}function Kr(t,e,n){let r=Ss(e.type,e.stack);Es(r)||t.track("$exception",{...e,context:{breadcrumbs:n()}})}function Vr(t,e){typeof window>"u"||(window.onerror=(n,r,i,s,o)=>{let u=o??new Error(String(n));Kr(t,{type:u.name||"Error",message:u.message||String(n),stack:u.stack,handled:!1,mechanism:"onerror",source:"browser",filename:r,lineno:i,colno:s},e)},window.onunhandledrejection=n=>{let r=n.reason,i=r instanceof Error?r:new Error(String(r));Kr(t,{type:i.name||"UnhandledRejection",message:i.message,stack:i.stack,handled:!1,mechanism:"onunhandledrejection",source:"browser"},e)})}var Et=class{constructor(e){b(this,"endpoint");b(this,"writeKey");b(this,"timeout");b(this,"environment");b(this,"getIdentity");b(this,"onEvaluation");b(this,"cache",new Map);b(this,"ready",!1);b(this,"readyCallbacks",[]);b(this,"changeListeners",new Set);b(this,"evalTracked",new Set);b(this,"timer",null);this.endpoint=e.endpoint,this.writeKey=e.writeKey,this.timeout=e.timeout??1e4,this.environment=e.environment,this.getIdentity=e.getIdentity,this.onEvaluation=e.onEvaluation;let n=e.pollInterval??6e4;this.fetch(),this.timer=setInterval(()=>this.fetch(),n)}getFlag(e,n){let r=this.cache.get(e);return r?(this.evalTracked.has(e)||(this.evalTracked.add(e),this.onEvaluation?.(e,r)),r.value):n}onFlagsReady(e){this.ready?e():this.readyCallbacks.push(e)}onFlagChange(e){return this.changeListeners.add(e),()=>this.changeListeners.delete(e)}async refresh(){await this.fetch()}destroy(){this.timer&&(clearInterval(this.timer),this.timer=null)}async fetch(){if(!this.writeKey||!this.endpoint)return;let e=new URLSearchParams;this.environment&&e.set("environment",this.environment);let n=this.getIdentity(),r=n.userId??n.anonymousId;r&&e.set("identifier",r),n.orgId&&e.set("orgId",n.orgId);let i=e.toString(),s=`${this.endpoint}/api/flags${i?`?${i}`:""}`;try{let o=await globalThis.fetch(s,{headers:{Authorization:`Bearer ${this.writeKey}`},signal:AbortSignal.timeout(this.timeout)});if(!o.ok)return;let u=await o.json();this.cache.clear();for(let[l,p]of Object.entries(u.flags))this.cache.set(l,p);if(!this.ready){this.ready=!0;for(let l of this.readyCallbacks)try{l()}catch{}this.readyCallbacks=[]}for(let l of this.changeListeners)try{l()}catch{}}catch{}}};var Yr=10,Xr=3e3,Zr=1e4,Qr=1800*1e3,Jr=100,ei="__scoperat_anon_id",_n="__scoperat_session_id",At="__scoperat_last_activity",xn="__scoperat_user_id",ti="$session_start",bn="$session_end",It="__scoperat_ticket_session";function Qe(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function ni(){if(!(typeof window>"u"||typeof localStorage>"u"))try{let t=localStorage.getItem(ei);return t||(t=Qe(),localStorage.setItem(ei,t)),t}catch{return Qe()}}var kn=class{constructor(){b(this,"writeKey",null);b(this,"endpoint","");b(this,"flushAt",Yr);b(this,"flushInterval",Xr);b(this,"timeout",Zr);b(this,"onError");b(this,"buffer",[]);b(this,"timer",null);b(this,"visibilityHandler",null);b(this,"userId");b(this,"orgId");b(this,"traits",{});b(this,"userHash");b(this,"anonymousId");b(this,"sessionId");b(this,"sessionTimeout",Qr);b(this,"ticketSessionFetch",null);b(this,"_flagClient",null)}init(e,n={}){this.writeKey=e,this.endpoint=(n.endpoint??globalThis.location?.origin??"").replace(/\/+$/,""),this.flushAt=n.flushAt??Yr,this.flushInterval=n.flushInterval??Xr,this.timeout=n.timeout??Zr,this.onError=n.onError,this.sessionTimeout=n.sessionTimeout??Qr,this.anonymousId=ni(),this.timer&&clearInterval(this.timer),this.timer=setInterval(()=>{this.buffer.length>0&&this.flush().catch(()=>{})},this.flushInterval),typeof window<"u"&&(this.visibilityHandler&&window.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=()=>{document.visibilityState==="hidden"&&this.buffer.length>0&&this.flushSync()},window.addEventListener("visibilitychange",this.visibilityHandler)),n.captureErrors&&(Vr(this,mn),Gr()),this._flagClient?.destroy(),this._flagClient=new Et({endpoint:this.endpoint,writeKey:e,timeout:this.timeout,environment:n.environment,pollInterval:n.flagPollInterval,getIdentity:()=>({userId:this.userId,anonymousId:this.anonymousId,orgId:this.orgId}),onEvaluation:(r,i)=>this.track("$flag_evaluation",{flag_key:r,flag_value:i.value,flag_type:i.type,flag_source:i.source})})}get flags(){if(!this._flagClient)throw new Error("Tracker not initialized. Call init() first.");return this._flagClient}identify(e,n,r){let i=this.userId??this.readStoredUserId();this.userId=e,n&&(this.traits={...n},n.orgId&&(this.orgId=n.orgId)),this.userHash=r?.userHash;for(let s of this.buffer)s.user_id||(s.user_id=e),!s.org_id&&this.orgId&&(s.org_id=this.orgId);e!==i&&(this.writeStoredUserId(e),this.startSession("login")),this._flagClient?.refresh()}reset(){this.endSession("logout",!0),this.userId=void 0,this.orgId=void 0,this.traits={},this.userHash=void 0,this.anonymousId=ni(),this.clearStoredUserId(),this.clearTicketSession()}startSession(e="login"){if(typeof window>"u")return this.sessionId;let n=Date.now(),r=this.readStoredSession();r&&this.emitSessionEvent(bn,r,e);let i=Qe();return this.persistSession(i,n),this.emitSessionEvent(ti,i,e),i}endSession(e="logout",n=!1){if(typeof window>"u")return;let r=this.readStoredSession();r&&this.emitSessionEvent(bn,r,e),this.sessionId=void 0,this.clearSession(),n&&this.flushSync()}readStoredUserId(){if(!(typeof localStorage>"u"))try{return localStorage.getItem(xn)??void 0}catch{return}}writeStoredUserId(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(xn,e)}catch{}}clearStoredUserId(){if(!(typeof localStorage>"u"))try{localStorage.removeItem(xn)}catch{}}clearTicketSession(){if(this.ticketSessionFetch=null,!(typeof localStorage>"u"))try{localStorage.removeItem(It)}catch{}}readStoredTicketSession(){if(typeof localStorage>"u")return null;try{let e=localStorage.getItem(It);if(!e)return null;let n=JSON.parse(e);if(typeof n.anonymousId=="string"&&typeof n.token=="string"&&typeof n.expiresAt=="number"&&n.expiresAt>Date.now()+6e4)return n;localStorage.removeItem(It)}catch{}return null}_ensureTicketSession(){let e=this.readStoredTicketSession();return e?Promise.resolve(e):this.ticketSessionFetch?this.ticketSessionFetch:this.writeKey?(this.ticketSessionFetch=(async()=>{try{let n=await fetch(`${this.endpoint}/api/ingest/ticket/session`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.writeKey}`},body:"{}",signal:AbortSignal.timeout(this.timeout)});if(!n.ok)return null;let r=await n.json();if(typeof r?.anonymousId=="string"&&typeof r?.token=="string"&&typeof r?.expiresAt=="number"){try{localStorage?.setItem(It,JSON.stringify(r))}catch{}return this.anonymousId=r.anonymousId,r}return null}catch{return null}finally{this.ticketSessionFetch=null}})(),this.ticketSessionFetch):Promise.resolve(null)}ensureSession(e){if(typeof window>"u")return this.sessionId;try{let n=this.readLastActivity(),r=this.readStoredSession(),i=n===void 0||e-n>this.sessionTimeout;if(r&&!i){this.sessionId=r;try{localStorage.setItem(At,String(e))}catch{}return r}r&&this.emitSessionEvent(bn,r,"timeout",n!==void 0?new Date(n).toISOString():void 0);let s=Qe();return this.persistSession(s,e),this.emitSessionEvent(ti,s,r?"timeout":"initial"),s}catch{return this.sessionId??Qe()}}readStoredSession(){if(this.sessionId)return this.sessionId;if(!(typeof sessionStorage>"u"))try{return sessionStorage.getItem(_n)??void 0}catch{return}}readLastActivity(){if(!(typeof localStorage>"u"))try{let e=localStorage.getItem(At);return e?Number(e):void 0}catch{return}}persistSession(e,n){if(this.sessionId=e,!(typeof window>"u"))try{sessionStorage.setItem(_n,e),localStorage.setItem(At,String(n))}catch{}}emitSessionEvent(e,n,r,i){if(!this.writeKey)return;let s=Object.keys(this.traits).length>0?{traits:this.traits}:{};this.buffer.push({event:e,properties:{reason:r},occurred_at:i??new Date().toISOString(),source:"browser",org_id:this.orgId,user_id:this.userId,anonymous_id:this.anonymousId,session_id:n,context:{...Ze(),...s}})}clearSession(){if(!(typeof window>"u"))try{sessionStorage.removeItem(_n),localStorage.removeItem(At)}catch{}}getSessionId(){return this.ensureSession(Date.now())}_getEndpoint(){return this.endpoint}_getWriteKey(){return this.writeKey}_getIdentity(){return{userId:this.userId,anonymousId:this.anonymousId,email:this.traits.email,name:this.traits.name,userHash:this.userHash}}captureException(e,n){if(!this.writeKey)return;let r=mn();this.track("$exception",{type:e.name||"Error",message:e.message,stack:e.stack,handled:!0,mechanism:n?.mechanism??"manual",source:"browser",...n,context:{breadcrumbs:r}})}addBreadcrumb(e,n,r){Wr({type:"custom",category:e,message:n,timestamp:Date.now(),data:r})}track(e,n){if(!this.writeKey)return;let r=typeof e=="string"?{event:e,properties:n}:e,i=Object.keys(this.traits).length>0?{traits:this.traits}:{},s={...r,occurred_at:r.occurred_at??new Date().toISOString(),source:r.source??"browser",org_id:r.org_id??this.orgId,user_id:r.user_id??this.userId,anonymous_id:r.anonymous_id??this.anonymousId,session_id:r.session_id??this.ensureSession(Date.now()),context:{...Ze(),...i,...r.context}};this.buffer.push(s),this.buffer.length>=this.flushAt&&this.flush().catch(()=>{})}async flush(){if(!this.writeKey||this.buffer.length===0)return{success:!0,ingested:0};let e=this.buffer.splice(0,Jr);try{let n=await fetch(`${this.endpoint}/api/ingest/track`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.writeKey}`},body:JSON.stringify({events:e}),signal:AbortSignal.timeout(this.timeout)});if(!n.ok){let i=await n.text().catch(()=>"");throw new Error(`API returned ${n.status}: ${i}`)}return{success:!0,ingested:(await n.json()).ingested}}catch(n){this.buffer.unshift(...e);let r=n instanceof Error?n:new Error(String(n));return this.onError?.(r,e),{success:!1,ingested:0}}}flushSync(){if(!this.writeKey||typeof fetch>"u"||this.buffer.length===0)return;let e=this.buffer.splice(0,Jr);try{fetch(`${this.endpoint}/api/ingest/track`,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.writeKey}`},body:JSON.stringify({events:e})}).catch(()=>{})}catch{}}getFlag(e,n){return this._flagClient?.getFlag(e,n)??n}onFlagsReady(e){this._flagClient?.onFlagsReady(e)}onFlagChange(e){return this._flagClient?.onFlagChange(e)??(()=>{})}async refreshFlags(){await this._flagClient?.refresh()}async shutdown(){for(this.timer&&(clearInterval(this.timer),this.timer=null),this._flagClient?.destroy(),this._flagClient=null,typeof window<"u"&&this.visibilityHandler&&(window.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null);this.buffer.length>0;)await this.flush()}},As=new kn,ee=As;async function ri(){let t=ee._getIdentity();if(t.userId&&t.userHash)return{"X-Scoperat-User-Hash":t.userHash,"X-Scoperat-User-Id":t.userId};let e=await ee._ensureTicketSession();return e?{"X-Scoperat-Session":e.token}:{}}async function ii(){let t=new URLSearchParams,e=ee._getIdentity();if(e.userId&&e.userHash)return t.set("user_id",e.userId),t.set("user_hash",e.userHash),t;let n=await ee._ensureTicketSession();return n&&t.set("session",n.token),t}async function si(){let t=ee._getWriteKey();return{"Content-Type":"application/json",...t?{Authorization:`Bearer ${t}`}:{},...await ri()}}async function wn(){let t=ee._getWriteKey();return{...t?{Authorization:`Bearer ${t}`}:{},...await ri()}}function ze(){return ee._getEndpoint()}async function Rt(t){let e=new FormData;e.append("file",t);let n=await fetch(`${ze()}/api/ingest/ticket/upload`,{method:"POST",headers:await wn(),body:e});if(!n.ok){let r=await n.text().catch(()=>"");throw new Error(`Upload failed: ${n.status} ${r}`)}return n.json()}async function oi(t){let e=ee._getIdentity(),n=Ze(),r=await fetch(`${ze()}/api/ingest/ticket`,{method:"POST",headers:await si(),body:JSON.stringify({...t,attachments:t.attachments?.map(i=>({storageKey:i.storageKey,fileName:i.fileName,mimeType:i.mimeType,fileSize:i.size})),email:t.email??e.email,name:t.name??e.name,metadata:{...n,...t.metadata}})});if(!r.ok){let i=await r.text().catch(()=>"");throw new Error(`Failed to create ticket: ${r.status} ${i}`)}return r.json()}async function ai(t,e,n){let r=await fetch(`${ze()}/api/ingest/ticket/message`,{method:"POST",headers:await si(),body:JSON.stringify({ticketId:t,body:e,attachments:n?.map(i=>({storageKey:i.storageKey,fileName:i.fileName,mimeType:i.mimeType,fileSize:i.size}))})});if(!r.ok){let i=await r.text().catch(()=>"");throw new Error(`Failed to send message: ${r.status} ${i}`)}return r.json()}async function li(){let t=await ii(),e=ee._getWriteKey();e&&t.set("key",e);let n=await fetch(`${ze()}/api/ingest/tickets?${t.toString()}`,{headers:await wn()});return n.ok?(await n.json()).tickets:[]}async function vn(t){let e=await ii(),n=await fetch(`${ze()}/api/ingest/ticket/${t}?${e.toString()}`,{headers:await wn()});if(!n.ok)throw new Error(`Failed to fetch conversation: ${n.status}`);return n.json()}async function ci(t,e){try{let n=await fetch(`${ze()}/api/kb/${t}/${e}`);return n.ok?n.json():null}catch{return null}}var yn=new Set,Ct={isOpen:!1,view:"conversations",tickets:[],activeTicketId:null,activeConversation:null,loading:!1,error:null};function Is(){for(let t of yn)t()}function Ae(){return Ct}function ui(t){return yn.add(t),()=>yn.delete(t)}function J(t){Ct={...Ct,...t},Is()}function pi(){J({isOpen:!Ct.isOpen})}function Lt(t){J({view:t})}function $t(t){J({view:"thread",activeTicketId:t})}function di(){J({view:"conversations",activeTicketId:null,activeConversation:null})}var Rs=0;function c(t,e,n,r,i,s){e||(e={});var o,u,l=e;if("ref"in l)for(u in l={},e)u=="ref"?o=e[u]:l[u]=e[u];var p={type:t,props:l,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Rs,__i:-1,__u:0,__source:i,__self:s};if(typeof t=="function"&&(o=t.defaultProps))for(u in o)l[u]===void 0&&(l[u]=o[u]);return R.vnode&&R.vnode(p),p}function Cs(t){let e=Math.floor((Date.now()-new Date(t).getTime())/1e3);if(e<60)return"just now";let n=Math.floor(e/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function Ls({ticket:t}){return c("li",{class:"sr-ticket-item",onClick:()=>$t(t.id),children:[c("h4",{children:t.subject}),c("div",{class:"sr-meta",children:c("span",{children:Cs(t.lastMessageAt??t.createdAt)})})]})}function hi(){let t=Ae();return Se(()=>{J({loading:!0}),li().then(e=>J({tickets:e,loading:!1})).catch(()=>J({loading:!1}))},[]),t.loading?c("div",{class:"sr-loading",children:"Loading conversations..."}):c("div",{children:t.tickets.length===0?c("div",{class:"sr-empty",children:[c("p",{children:"No conversations yet"}),c("button",{class:"sr-btn sr-btn-secondary",onClick:()=>Lt("new-ticket"),children:"Start one"})]}):c("ul",{class:"sr-ticket-list",children:t.tickets.map(e=>c(Ls,{ticket:e},e.id))})})}var{entries:vi,setPrototypeOf:fi,isFrozen:$s,getPrototypeOf:Ds,getOwnPropertyDescriptor:Ps}=Object,{freeze:V,seal:te,create:it}=Object,{apply:Cn,construct:Ln}=typeof Reflect<"u"&&Reflect;V||(V=function(e){return e});te||(te=function(e){return e});Cn||(Cn=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return e.apply(n,i)});Ln||(Ln=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new e(...r)});var Je=Y(Array.prototype.forEach),Os=Y(Array.prototype.lastIndexOf),gi=Y(Array.prototype.pop),et=Y(Array.prototype.push),Ns=Y(Array.prototype.splice),Pt=Y(String.prototype.toLowerCase),Tn=Y(String.prototype.toString),Sn=Y(String.prototype.match),Fe=Y(String.prototype.replace),Ms=Y(String.prototype.indexOf),zs=Y(String.prototype.trim),re=Y(Object.prototype.hasOwnProperty),K=Y(RegExp.prototype.test),tt=Fs(TypeError);function Y(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return Cn(t,e,r)}}function Fs(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Ln(t,n)}}function y(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pt;fi&&fi(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){let s=n(i);s!==i&&($s(e)||(e[r]=s),i=s)}t[i]=!0}return t}function Hs(t){for(let e=0;e<t.length;e++)re(t,e)||(t[e]=null);return t}function le(t){let e=it(null);for(let[n,r]of vi(t))re(t,n)&&(Array.isArray(r)?e[n]=Hs(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=le(r):e[n]=r);return e}function nt(t,e){for(;t!==null;){let r=Ps(t,e);if(r){if(r.get)return Y(r.get);if(typeof r.value=="function")return Y(r.value)}t=Ds(t)}function n(){return null}return n}var mi=V(["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"]),En=V(["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"]),An=V(["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"]),Us=V(["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"]),In=V(["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"]),Bs=V(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),_i=V(["#text"]),xi=V(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","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","slot"]),Rn=V(["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","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-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"]),bi=V(["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"]),Dt=V(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),js=te(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ws=te(/<%[\w\W]*|[\w\W]*%>/gm),Gs=te(/\$\{[\w\W]*/gm),qs=te(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ks=te(/^aria-[\-\w]+$/),yi=te(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Vs=te(/^(?:\w+script|data):/i),Ys=te(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ti=te(/^html$/i),Xs=te(/^[a-z][.\w]*(-[.\w]+)+$/i),ki=Object.freeze({__proto__:null,ARIA_ATTR:Ks,ATTR_WHITESPACE:Ys,CUSTOM_ELEMENT:Xs,DATA_ATTR:qs,DOCTYPE_NAME:Ti,ERB_EXPR:Ws,IS_ALLOWED_URI:yi,IS_SCRIPT_OR_DATA:Vs,MUSTACHE_EXPR:js,TMPLIT_EXPR:Gs}),rt={element:1,text:3,progressingInstruction:7,comment:8,document:9},Zs=function(){return typeof window>"u"?null:window},Qs=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));let s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(o){return o},createScriptURL(o){return o}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},wi=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function Si(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Zs(),e=k=>Si(k);if(e.version="3.4.0",e.removed=[],!t||!t.document||t.document.nodeType!==rt.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t,r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:u,Element:l,NodeFilter:p,NamedNodeMap:h=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:d,DOMParser:m,trustedTypes:g}=t,_=l.prototype,E=nt(_,"cloneNode"),w=nt(_,"remove"),v=nt(_,"nextSibling"),T=nt(_,"childNodes"),D=nt(_,"parentNode");if(typeof o=="function"){let k=n.createElement("template");k.content&&k.content.ownerDocument&&(n=k.content.ownerDocument)}let A,U="",{implementation:q,createNodeIterator:ue,createDocumentFragment:ge,getElementsByTagName:I}=n,{importNode:F}=r,$=wi();e.isSupported=typeof vi=="function"&&typeof D=="function"&&q&&q.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:pe,ERB_EXPR:Le,TMPLIT_EXPR:$e,DATA_ATTR:Xi,ARIA_ATTR:Zi,IS_SCRIPT_OR_DATA:Qi,ATTR_WHITESPACE:Kn,CUSTOM_ELEMENT:Ji}=ki,{IS_ALLOWED_URI:Vn}=ki,B=null,Yn=y({},[...mi,...En,...An,...In,..._i]),j=null,Xn=y({},[...xi,...Rn,...bi,...Dt]),P=Object.seal(it(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}})),Ue=null,lt=null,me=Object.seal(it(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Zn=!0,jt=!0,Qn=!1,Jn=!0,ve=!1,Be=!0,ye=!1,Wt=!1,Gt=!1,De=!1,ct=!1,ut=!1,er=!0,tr=!1,es="user-content-",qt=!0,je=!1,Pe={},oe=null,Kt=y({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]),nr=null,rr=y({},["audio","video","img","source","image","track"]),Vt=null,ir=y({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),pt="http://www.w3.org/1998/Math/MathML",dt="http://www.w3.org/2000/svg",ae="http://www.w3.org/1999/xhtml",Oe=ae,Yt=!1,Xt=null,ts=y({},[pt,dt,ae],Tn),ht=y({},["mi","mo","mn","ms","mtext"]),ft=y({},["annotation-xml"]),ns=y({},["title","style","font","a","script"]),We=null,rs=["application/xhtml+xml","text/html"],is="text/html",H=null,Ne=null,ss=n.createElement("form"),sr=function(a){return a instanceof RegExp||a instanceof Function},Zt=function(){let a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(Ne&&Ne===a)){if((!a||typeof a!="object")&&(a={}),a=le(a),We=rs.indexOf(a.PARSER_MEDIA_TYPE)===-1?is:a.PARSER_MEDIA_TYPE,H=We==="application/xhtml+xml"?Tn:Pt,B=re(a,"ALLOWED_TAGS")?y({},a.ALLOWED_TAGS,H):Yn,j=re(a,"ALLOWED_ATTR")?y({},a.ALLOWED_ATTR,H):Xn,Xt=re(a,"ALLOWED_NAMESPACES")?y({},a.ALLOWED_NAMESPACES,Tn):ts,Vt=re(a,"ADD_URI_SAFE_ATTR")?y(le(ir),a.ADD_URI_SAFE_ATTR,H):ir,nr=re(a,"ADD_DATA_URI_TAGS")?y(le(rr),a.ADD_DATA_URI_TAGS,H):rr,oe=re(a,"FORBID_CONTENTS")?y({},a.FORBID_CONTENTS,H):Kt,Ue=re(a,"FORBID_TAGS")?y({},a.FORBID_TAGS,H):le({}),lt=re(a,"FORBID_ATTR")?y({},a.FORBID_ATTR,H):le({}),Pe=re(a,"USE_PROFILES")?a.USE_PROFILES:!1,Zn=a.ALLOW_ARIA_ATTR!==!1,jt=a.ALLOW_DATA_ATTR!==!1,Qn=a.ALLOW_UNKNOWN_PROTOCOLS||!1,Jn=a.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ve=a.SAFE_FOR_TEMPLATES||!1,Be=a.SAFE_FOR_XML!==!1,ye=a.WHOLE_DOCUMENT||!1,De=a.RETURN_DOM||!1,ct=a.RETURN_DOM_FRAGMENT||!1,ut=a.RETURN_TRUSTED_TYPE||!1,Gt=a.FORCE_BODY||!1,er=a.SANITIZE_DOM!==!1,tr=a.SANITIZE_NAMED_PROPS||!1,qt=a.KEEP_CONTENT!==!1,je=a.IN_PLACE||!1,Vn=a.ALLOWED_URI_REGEXP||yi,Oe=a.NAMESPACE||ae,ht=a.MATHML_TEXT_INTEGRATION_POINTS||ht,ft=a.HTML_INTEGRATION_POINTS||ft,P=a.CUSTOM_ELEMENT_HANDLING||it(null),a.CUSTOM_ELEMENT_HANDLING&&sr(a.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(P.tagNameCheck=a.CUSTOM_ELEMENT_HANDLING.tagNameCheck),a.CUSTOM_ELEMENT_HANDLING&&sr(a.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(P.attributeNameCheck=a.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),a.CUSTOM_ELEMENT_HANDLING&&typeof a.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(P.allowCustomizedBuiltInElements=a.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ve&&(jt=!1),ct&&(De=!0),Pe&&(B=y({},_i),j=it(null),Pe.html===!0&&(y(B,mi),y(j,xi)),Pe.svg===!0&&(y(B,En),y(j,Rn),y(j,Dt)),Pe.svgFilters===!0&&(y(B,An),y(j,Rn),y(j,Dt)),Pe.mathMl===!0&&(y(B,In),y(j,bi),y(j,Dt))),me.tagCheck=null,me.attributeCheck=null,a.ADD_TAGS&&(typeof a.ADD_TAGS=="function"?me.tagCheck=a.ADD_TAGS:(B===Yn&&(B=le(B)),y(B,a.ADD_TAGS,H))),a.ADD_ATTR&&(typeof a.ADD_ATTR=="function"?me.attributeCheck=a.ADD_ATTR:(j===Xn&&(j=le(j)),y(j,a.ADD_ATTR,H))),a.ADD_URI_SAFE_ATTR&&y(Vt,a.ADD_URI_SAFE_ATTR,H),a.FORBID_CONTENTS&&(oe===Kt&&(oe=le(oe)),y(oe,a.FORBID_CONTENTS,H)),a.ADD_FORBID_CONTENTS&&(oe===Kt&&(oe=le(oe)),y(oe,a.ADD_FORBID_CONTENTS,H)),qt&&(B["#text"]=!0),ye&&y(B,["html","head","body"]),B.table&&(y(B,["tbody"]),delete Ue.tbody),a.TRUSTED_TYPES_POLICY){if(typeof a.TRUSTED_TYPES_POLICY.createHTML!="function")throw tt('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof a.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw tt('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=a.TRUSTED_TYPES_POLICY,U=A.createHTML("")}else A===void 0&&(A=Qs(g,i)),A!==null&&typeof U=="string"&&(U=A.createHTML(""));V&&V(a),Ne=a}},or=y({},[...En,...An,...Us]),ar=y({},[...In,...Bs]),os=function(a){let f=D(a);(!f||!f.tagName)&&(f={namespaceURI:Oe,tagName:"template"});let x=Pt(a.tagName),L=Pt(f.tagName);return Xt[a.namespaceURI]?a.namespaceURI===dt?f.namespaceURI===ae?x==="svg":f.namespaceURI===pt?x==="svg"&&(L==="annotation-xml"||ht[L]):!!or[x]:a.namespaceURI===pt?f.namespaceURI===ae?x==="math":f.namespaceURI===dt?x==="math"&&ft[L]:!!ar[x]:a.namespaceURI===ae?f.namespaceURI===dt&&!ft[L]||f.namespaceURI===pt&&!ht[L]?!1:!ar[x]&&(ns[x]||!or[x]):!!(We==="application/xhtml+xml"&&Xt[a.namespaceURI]):!1},ne=function(a){et(e.removed,{element:a});try{D(a).removeChild(a)}catch{w(a)}},Te=function(a,f){try{et(e.removed,{attribute:f.getAttributeNode(a),from:f})}catch{et(e.removed,{attribute:null,from:f})}if(f.removeAttribute(a),a==="is")if(De||ct)try{ne(f)}catch{}else try{f.setAttribute(a,"")}catch{}},lr=function(a){let f=null,x=null;if(Gt)a="<remove></remove>"+a;else{let N=Sn(a,/^[\r\n\t ]+/);x=N&&N[0]}We==="application/xhtml+xml"&&Oe===ae&&(a='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+a+"</body></html>");let L=A?A.createHTML(a):a;if(Oe===ae)try{f=new m().parseFromString(L,We)}catch{}if(!f||!f.documentElement){f=q.createDocument(Oe,"template",null);try{f.documentElement.innerHTML=Yt?U:L}catch{}}let G=f.body||f.documentElement;return a&&x&&G.insertBefore(n.createTextNode(x),G.childNodes[0]||null),Oe===ae?I.call(f,ye?"html":"body")[0]:ye?f.documentElement:G},cr=function(a){return ue.call(a.ownerDocument||a,a,p.SHOW_ELEMENT|p.SHOW_COMMENT|p.SHOW_TEXT|p.SHOW_PROCESSING_INSTRUCTION|p.SHOW_CDATA_SECTION,null)},Qt=function(a){return a instanceof d&&(typeof a.nodeName!="string"||typeof a.textContent!="string"||typeof a.removeChild!="function"||!(a.attributes instanceof h)||typeof a.removeAttribute!="function"||typeof a.setAttribute!="function"||typeof a.namespaceURI!="string"||typeof a.insertBefore!="function"||typeof a.hasChildNodes!="function")},Jt=function(a){return typeof u=="function"&&a instanceof u};function de(k,a,f){Je(k,x=>{x.call(e,a,f,Ne)})}let ur=function(a){let f=null;if(de($.beforeSanitizeElements,a,null),Qt(a))return ne(a),!0;let x=H(a.nodeName);if(de($.uponSanitizeElement,a,{tagName:x,allowedTags:B}),Be&&a.hasChildNodes()&&!Jt(a.firstElementChild)&&K(/<[/\w!]/g,a.innerHTML)&&K(/<[/\w!]/g,a.textContent)||Be&&a.namespaceURI===ae&&x==="style"&&Jt(a.firstElementChild)||a.nodeType===rt.progressingInstruction||Be&&a.nodeType===rt.comment&&K(/<[/\w]/g,a.data))return ne(a),!0;if(Ue[x]||!(me.tagCheck instanceof Function&&me.tagCheck(x))&&!B[x]){if(!Ue[x]&&dr(x)&&(P.tagNameCheck instanceof RegExp&&K(P.tagNameCheck,x)||P.tagNameCheck instanceof Function&&P.tagNameCheck(x)))return!1;if(qt&&!oe[x]){let L=D(a)||a.parentNode,G=T(a)||a.childNodes;if(G&&L){let N=G.length;for(let Z=N-1;Z>=0;--Z){let Q=E(G[Z],!0);Q.__removalCount=(a.__removalCount||0)+1,L.insertBefore(Q,v(a))}}}return ne(a),!0}return a instanceof l&&!os(a)||(x==="noscript"||x==="noembed"||x==="noframes")&&K(/<\/no(script|embed|frames)/i,a.innerHTML)?(ne(a),!0):(ve&&a.nodeType===rt.text&&(f=a.textContent,Je([pe,Le,$e],L=>{f=Fe(f,L," ")}),a.textContent!==f&&(et(e.removed,{element:a.cloneNode()}),a.textContent=f)),de($.afterSanitizeElements,a,null),!1)},pr=function(a,f,x){if(lt[f]||er&&(f==="id"||f==="name")&&(x in n||x in ss))return!1;if(!(jt&&!lt[f]&&K(Xi,f))){if(!(Zn&&K(Zi,f))){if(!(me.attributeCheck instanceof Function&&me.attributeCheck(f,a))){if(!j[f]||lt[f]){if(!(dr(a)&&(P.tagNameCheck instanceof RegExp&&K(P.tagNameCheck,a)||P.tagNameCheck instanceof Function&&P.tagNameCheck(a))&&(P.attributeNameCheck instanceof RegExp&&K(P.attributeNameCheck,f)||P.attributeNameCheck instanceof Function&&P.attributeNameCheck(f,a))||f==="is"&&P.allowCustomizedBuiltInElements&&(P.tagNameCheck instanceof RegExp&&K(P.tagNameCheck,x)||P.tagNameCheck instanceof Function&&P.tagNameCheck(x))))return!1}else if(!Vt[f]){if(!K(Vn,Fe(x,Kn,""))){if(!((f==="src"||f==="xlink:href"||f==="href")&&a!=="script"&&Ms(x,"data:")===0&&nr[a])){if(!(Qn&&!K(Qi,Fe(x,Kn,"")))){if(x)return!1}}}}}}}return!0},dr=function(a){return a!=="annotation-xml"&&Sn(a,Ji)},hr=function(a){de($.beforeSanitizeAttributes,a,null);let{attributes:f}=a;if(!f||Qt(a))return;let x={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j,forceKeepAttr:void 0},L=f.length;for(;L--;){let G=f[L],{name:N,namespaceURI:Z,value:Q}=G,_e=H(N),en=Q,W=N==="value"?en:zs(en);if(x.attrName=_e,x.attrValue=W,x.keepAttr=!0,x.forceKeepAttr=void 0,de($.uponSanitizeAttribute,a,x),W=x.attrValue,tr&&(_e==="id"||_e==="name")&&(Te(N,a),W=es+W),Be&&K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,W)){Te(N,a);continue}if(_e==="attributename"&&Sn(W,"href")){Te(N,a);continue}if(x.forceKeepAttr)continue;if(!x.keepAttr){Te(N,a);continue}if(!Jn&&K(/\/>/i,W)){Te(N,a);continue}ve&&Je([pe,Le,$e],mr=>{W=Fe(W,mr," ")});let gr=H(a.nodeName);if(!pr(gr,_e,W)){Te(N,a);continue}if(A&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Z)switch(g.getAttributeType(gr,_e)){case"TrustedHTML":{W=A.createHTML(W);break}case"TrustedScriptURL":{W=A.createScriptURL(W);break}}if(W!==en)try{Z?a.setAttributeNS(Z,N,W):a.setAttribute(N,W),Qt(a)?ne(a):gi(e.removed)}catch{Te(N,a)}}de($.afterSanitizeAttributes,a,null)},fr=function(a){let f=null,x=cr(a);for(de($.beforeSanitizeShadowDOM,a,null);f=x.nextNode();)de($.uponSanitizeShadowNode,f,null),ur(f),hr(f),f.content instanceof s&&fr(f.content);de($.afterSanitizeShadowDOM,a,null)};return e.sanitize=function(k){let a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},f=null,x=null,L=null,G=null;if(Yt=!k,Yt&&(k="<!-->"),typeof k!="string"&&!Jt(k))if(typeof k.toString=="function"){if(k=k.toString(),typeof k!="string")throw tt("dirty is not a string, aborting")}else throw tt("toString is not a function");if(!e.isSupported)return k;if(Wt||Zt(a),e.removed=[],typeof k=="string"&&(je=!1),je){if(k.nodeName){let Q=H(k.nodeName);if(!B[Q]||Ue[Q])throw tt("root node is forbidden and cannot be sanitized in-place")}}else if(k instanceof u)f=lr("<!---->"),x=f.ownerDocument.importNode(k,!0),x.nodeType===rt.element&&x.nodeName==="BODY"||x.nodeName==="HTML"?f=x:f.appendChild(x);else{if(!De&&!ve&&!ye&&k.indexOf("<")===-1)return A&&ut?A.createHTML(k):k;if(f=lr(k),!f)return De?null:ut?U:""}f&&Gt&&ne(f.firstChild);let N=cr(je?k:f);for(;L=N.nextNode();)ur(L),hr(L),L.content instanceof s&&fr(L.content);if(je)return k;if(De){if(ve){f.normalize();let Q=f.innerHTML;Je([pe,Le,$e],_e=>{Q=Fe(Q,_e," ")}),f.innerHTML=Q}if(ct)for(G=ge.call(f.ownerDocument);f.firstChild;)G.appendChild(f.firstChild);else G=f;return(j.shadowroot||j.shadowrootmode)&&(G=F.call(r,G,!0)),G}let Z=ye?f.outerHTML:f.innerHTML;return ye&&B["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&K(Ti,f.ownerDocument.doctype.name)&&(Z="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
|
|
901
|
-
`+Z),ve&&Je([pe,Le,$e],Q=>{Z=Fe(Z,Q," ")}),A&&ut?A.createHTML(Z):Z},e.setConfig=function(){let k=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Zt(k),Wt=!0},e.clearConfig=function(){Ne=null,Wt=!1},e.isValidAttribute=function(k,a,f){Ne||Zt({});let x=H(k),L=H(a);return pr(x,L,f)},e.addHook=function(k,a){typeof a=="function"&&et($[k],a)},e.removeHook=function(k,a){if(a!==void 0){let f=Os($[k],a);return f===-1?void 0:Ns($[k],f,1)[0]}return gi($[k])},e.removeHooks=function(k){$[k]=[]},e.removeAllHooks=function(){$=wi()},e}var $n=Si();function Nn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ce=Nn();function Di(t){Ce=t}var Ie={exec:()=>null};function S(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(i,s)=>{let o=typeof s=="string"?s:s.source;return o=o.replace(X.caret,"$1"),n=n.replace(i,o),r},getRegex:()=>new RegExp(n,e)};return r}var Js=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),X={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}#`),htmlBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}<(?:[a-z].*>|!--)`,"i"),blockquoteBeginRegex:t=>new RegExp(`^ {0,${Math.min(3,t-1)}}>`)},eo=/^(?:[ \t]*(?:\n|$))+/,to=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,no=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,at=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ro=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Mn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Pi=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Oi=S(Pi).replace(/bull/g,Mn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),io=S(Pi).replace(/bull/g,Mn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),zn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,so=/^[^\n]+/,Fn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,oo=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Fn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),ao=S(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,Mn).getRegex(),Ht="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Hn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,lo=S("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Hn).replace("tag",Ht).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Ni=S(zn).replace("hr",at).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ht).getRegex(),co=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Ni).getRegex(),Un={blockquote:co,code:to,def:oo,fences:no,heading:ro,hr:at,html:lo,lheading:Oi,list:ao,newline:eo,paragraph:Ni,table:Ie,text:so},Ei=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",at).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ht).getRegex(),uo={...Un,lheading:io,table:Ei,paragraph:S(zn).replace("hr",at).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Ei).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ht).getRegex()},po={...Un,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Hn).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Ie,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:S(zn).replace("hr",at).replace("heading",` *#{1,6} *[^
|
|
902
|
-
|
|
903
|
-
`),n=
|
|
904
|
-
`)
|
|
905
|
-
`).
|
|
906
|
-
`)
|
|
907
|
-
`),
|
|
908
|
-
`)}}
|
|
899
|
+
`}var tt,j,Rn,Qr,nt=0,oi=[],G=L,Jr=G.__b,ei=G.__r,ti=G.diffed,ni=G.__c,ri=G.unmount,ii=G.__;function Ln(t,e){G.__h&&G.__h(j,t,nt||e),nt=0;var n=j.__H||(j.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function q(t){return nt=1,ao(li,t)}function ao(t,e,n){var r=Ln(tt++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):li(void 0,e),function(c){var h=r.__N?r.__N[0]:r.__[0],l=r.t(h,c);h!==l&&(r.__N=[l,r.__[1]],r.__c.setState({}))}],r.__c=j,!j.__f)){var i=function(c,h,l){if(!r.__c.__H)return!0;var g=!1,f=r.__c.props!==c;if(r.__c.__H.__.some(function(m){if(m.__N){g=!0;var x=m.__[0];m.__=m.__N,m.__N=void 0,x!==m.__[0]&&(f=!0)}}),s){var p=s.call(this,c,h,l);return g?p||f:p}return!g||f};j.__f=!0;var s=j.shouldComponentUpdate,a=j.componentWillUpdate;j.componentWillUpdate=function(c,h,l){if(this.__e){var g=s;s=void 0,i(c,h,l),s=g}a&&a.call(this,c,h,l)},j.shouldComponentUpdate=i}return r.__N||r.__}function $e(t,e){var n=Ln(tt++,3);!G.__s&&ai(n.__H,e)&&(n.__=t,n.u=e,j.__H.__h.push(n))}function rt(t){return nt=5,Oe(function(){return{current:t}},[])}function Oe(t,e){var n=Ln(tt++,7);return ai(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function xe(t,e){return nt=8,Oe(function(){return t},e)}function lo(){for(var t;t=oi.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Nt),e.__h.some(Cn),e.__h=[]}catch(n){e.__h=[],G.__e(n,t.__v)}}}G.__b=function(t){j=null,Jr&&Jr(t)},G.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),ii&&ii(t,e)},G.__r=function(t){ei&&ei(t),tt=0;var e=(j=t.__c).__H;e&&(Rn===j?(e.__h=[],j.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(Nt),e.__h.some(Cn),e.__h=[],tt=0)),Rn=j},G.diffed=function(t){ti&&ti(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(oi.push(e)!==1&&Qr===G.requestAnimationFrame||((Qr=G.requestAnimationFrame)||co)(lo)),e.__H.__.some(function(n){n.u&&(n.__H=n.u,n.u=void 0)})),Rn=j=null},G.__c=function(t,e){e.some(function(n){try{n.__h.some(Nt),n.__h=n.__h.filter(function(r){return!r.__||Cn(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],G.__e(r,n.__v)}}),ni&&ni(t,e)},G.unmount=function(t){ri&&ri(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(r){try{Nt(r)}catch(i){e=i}}),n.__H=void 0,e&&G.__e(e,n.__v))};var si=typeof requestAnimationFrame=="function";function co(t){var e,n=function(){clearTimeout(r),si&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);si&&(e=requestAnimationFrame(n))}function Nt(t){var e=j,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),j=e}function Cn(t){var e=j;t.__c=t.__(),j=e}function ai(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function li(t,e){return typeof e=="function"?e(t):e}var it=[],ci=!1;function st(t){it.push(t),it.length>20&&(it=it.slice(-20))}function $n(t,e=120){return t.length>e?t.slice(0,e)+"\u2026":t}function On(){return[...it]}function ui(t){st(t)}function pi(){if(ci||typeof window>"u")return;ci=!0,document.addEventListener("click",n=>{let r=n.target;if(!r)return;let i=r.textContent?.trim()||r.getAttribute("aria-label")||"";st({type:"user",category:"click",message:$n(`${r.tagName.toLowerCase()}${i?` "${i}"`:""}`),timestamp:Date.now(),data:{tagName:r.tagName.toLowerCase(),className:r.className?$n(r.className,80):void 0}})},{capture:!0});let t=history.pushState;history.pushState=function(...n){let r=location.pathname;t.apply(this,n),st({type:"navigation",category:"navigation",message:`${r} \u2192 ${location.pathname}`,timestamp:Date.now()})},window.addEventListener("popstate",()=>{st({type:"navigation",category:"navigation",message:`popstate \u2192 ${location.pathname}`,timestamp:Date.now()})});let e=n=>{let r=console[n];console[n]=(...i)=>{st({type:"console",category:`console.${n}`,message:$n(i.map(s=>typeof s=="string"?s:String(s)).join(" ")),timestamp:Date.now()}),r.apply(console,i)}};e("error"),e("warn")}function ot(){return typeof window>"u"?{}:{page:{url:window.location.href,path:window.location.pathname,title:document.title,referrer:document.referrer||void 0},screen:{width:window.screen.width,height:window.screen.height},locale:navigator.language,userAgent:navigator.userAgent,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone}}var Se=new Map;function Dt(t,e){return t.length>e?t.slice(0,e)+"\u2026":t}function uo(t,e,n){let r=n?.split(`
|
|
900
|
+
`)[1]?.trim()??"";return`${t}:${Dt(e,100)}:${r}`}function po(t){let e=Date.now(),n=Se.get(t);return n&&e-n<6e4?!0:(Se.set(t,e),ho(e),!1)}function ho(t){if(!(Se.size<=200)){for(let[e,n]of Se)t-n>=6e4&&Se.delete(e);for(let e of Se.keys()){if(Se.size<=200)break;Se.delete(e)}}}function Pt(t,e,n){let r=uo(e.type,e.message,e.stack);po(r)||t.track("$exception",{...e,message:Dt(e.message,2048),stack:e.stack?Dt(e.stack,16384):void 0,context:{breadcrumbs:n()}})}function fo(t){if(t instanceof Error)return{type:t.name||"UnhandledRejection",message:t.message,stack:t.stack};if(typeof t=="object"&&t!==null){let e;try{e=JSON.stringify(t)??Object.prototype.toString.call(t)}catch{e=Object.prototype.toString.call(t)}return{type:"UnhandledRejection",message:`Non-Error promise rejection: ${Dt(e,1024)}`,stack:void 0}}return{type:"UnhandledRejection",message:String(t),stack:void 0}}var at=null;function di(t,e){if(typeof window>"u")return()=>{};if(at)return at;let n=i=>{let s=i.error,a=s?.message||(typeof i.message=="string"&&i.message?i.message:"Unknown error"),c=!s&&/^Script error\.?$/.test(a);Pt(t,{type:s?.name||"Error",message:a,stack:s?.stack,handled:!1,mechanism:"onerror",source:"browser",filename:i.filename||void 0,lineno:i.lineno||void 0,colno:i.colno||void 0,...c?{opaque:!0}:{}},e)},r=i=>{let{type:s,message:a,stack:c}=fo(i.reason);Pt(t,{type:s,message:a,stack:c,handled:!1,mechanism:"onunhandledrejection",source:"browser"},e)};return window.addEventListener("error",n),window.addEventListener("unhandledrejection",r),at=()=>{window.removeEventListener("error",n),window.removeEventListener("unhandledrejection",r),at=null},at}var Mt=class{constructor(e){k(this,"endpoint");k(this,"writeKey");k(this,"timeout");k(this,"environment");k(this,"getIdentity");k(this,"onEvaluation");k(this,"cache",new Map);k(this,"ready",!1);k(this,"readyCallbacks",[]);k(this,"changeListeners",new Set);k(this,"evalTracked",new Set);k(this,"timer",null);this.endpoint=e.endpoint,this.writeKey=e.writeKey,this.timeout=e.timeout??1e4,this.environment=e.environment,this.getIdentity=e.getIdentity,this.onEvaluation=e.onEvaluation;let n=e.pollInterval??6e4;this.fetch(),this.timer=setInterval(()=>this.fetch(),n)}getFlag(e,n){let r=this.cache.get(e);return r?(this.evalTracked.has(e)||(this.evalTracked.add(e),this.onEvaluation?.(e,r)),r.value):n}onFlagsReady(e){this.ready?e():this.readyCallbacks.push(e)}onFlagChange(e){return this.changeListeners.add(e),()=>this.changeListeners.delete(e)}async refresh(){await this.fetch()}destroy(){this.timer&&(clearInterval(this.timer),this.timer=null)}async fetch(){if(!this.writeKey||!this.endpoint)return;let e=new URLSearchParams;this.environment&&e.set("environment",this.environment);let n=this.getIdentity(),r=n.userId??n.anonymousId;r&&e.set("identifier",r),n.orgId&&e.set("orgId",n.orgId);let i=e.toString(),s=`${this.endpoint}/api/flags${i?`?${i}`:""}`;try{let a=await globalThis.fetch(s,{headers:{Authorization:`Bearer ${this.writeKey}`},signal:AbortSignal.timeout(this.timeout)});if(!a.ok)return;let c=await a.json();this.cache.clear();for(let[h,l]of Object.entries(c.flags))this.cache.set(h,l);if(!this.ready){this.ready=!0;for(let h of this.readyCallbacks)try{h()}catch{}this.readyCallbacks=[]}for(let h of this.changeListeners)try{h()}catch{}}catch{}}};var hi=10,fi=3e3,gi=1e4,mi=1800*1e3,_i=1e3,bi=100,go=6e4,xi="__scoperat_anon_id",Nn="__scoperat_session_id",zt="__scoperat_last_activity",Dn="__scoperat_user_id",ki="$session_start",Pn="$session_end",Ft="__scoperat_ticket_session";function lt(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,t=>{let e=Math.random()*16|0;return(t==="x"?e:e&3|8).toString(16)})}function wi(){if(!(typeof window>"u"||typeof localStorage>"u"))try{let t=localStorage.getItem(xi);return t||(t=lt(),localStorage.setItem(xi,t)),t}catch{return lt()}}var Mn=class{constructor(){k(this,"writeKey",null);k(this,"endpoint","");k(this,"flushAt",hi);k(this,"flushInterval",fi);k(this,"timeout",gi);k(this,"onError");k(this,"buffer",[]);k(this,"maxQueueSize",_i);k(this,"timer",null);k(this,"visibilityHandler",null);k(this,"pageHideHandler",null);k(this,"uninstallErrorHandlers",null);k(this,"flushFailures",0);k(this,"nextFlushAllowedAt",0);k(this,"exceptionFlushScheduled",!1);k(this,"userId");k(this,"orgId");k(this,"traits",{});k(this,"userHash");k(this,"anonymousId");k(this,"sessionId");k(this,"sessionTimeout",mi);k(this,"ticketSessionFetch",null);k(this,"_flagClient",null)}init(e,n={}){this.writeKey=e,this.endpoint=(n.endpoint??globalThis.location?.origin??"").replace(/\/+$/,""),this.flushAt=n.flushAt??hi,this.flushInterval=n.flushInterval??fi,this.timeout=n.timeout??gi,this.onError=n.onError,this.sessionTimeout=n.sessionTimeout??mi,this.maxQueueSize=n.maxQueueSize??_i,this.anonymousId=wi(),this.timer&&clearInterval(this.timer),this.timer=setInterval(()=>{this.buffer.length>0&&this.maybeFlush()},this.flushInterval),typeof window<"u"&&(this.visibilityHandler&&window.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=()=>{document.visibilityState==="hidden"&&this.buffer.length>0&&this.flushSync()},window.addEventListener("visibilitychange",this.visibilityHandler),this.pageHideHandler&&window.removeEventListener("pagehide",this.pageHideHandler),this.pageHideHandler=()=>{this.buffer.length>0&&this.flushSync()},window.addEventListener("pagehide",this.pageHideHandler)),n.captureErrors&&(this.uninstallErrorHandlers=di(this,On),pi()),this._flagClient?.destroy(),this._flagClient=new Mt({endpoint:this.endpoint,writeKey:e,timeout:this.timeout,environment:n.environment,pollInterval:n.flagPollInterval,getIdentity:()=>({userId:this.userId,anonymousId:this.anonymousId,orgId:this.orgId})})}get flags(){if(!this._flagClient)throw new Error("Tracker not initialized. Call init() first.");return this._flagClient}identify(e,n,r){let i=this.userId??this.readStoredUserId();this.userId=e,n&&(this.traits={...n},n.orgId&&(this.orgId=n.orgId)),this.userHash=r?.userHash;for(let s of this.buffer)s.user_id||(s.user_id=e),!s.org_id&&this.orgId&&(s.org_id=this.orgId);e!==i&&(this.writeStoredUserId(e),this.startSession("login")),this._flagClient?.refresh()}reset(){this.endSession("logout",!0),this.userId=void 0,this.orgId=void 0,this.traits={},this.userHash=void 0,this.anonymousId=wi(),this.clearStoredUserId(),this.clearTicketSession()}startSession(e="login"){if(typeof window>"u")return this.sessionId;let n=Date.now(),r=this.readStoredSession();r&&this.emitSessionEvent(Pn,r,e);let i=lt();return this.persistSession(i,n),this.emitSessionEvent(ki,i,e),i}endSession(e="logout",n=!1){if(typeof window>"u")return;let r=this.readStoredSession();r&&this.emitSessionEvent(Pn,r,e),this.sessionId=void 0,this.clearSession(),n&&this.flushSync()}readStoredUserId(){if(!(typeof localStorage>"u"))try{return localStorage.getItem(Dn)??void 0}catch{return}}writeStoredUserId(e){if(!(typeof localStorage>"u"))try{localStorage.setItem(Dn,e)}catch{}}clearStoredUserId(){if(!(typeof localStorage>"u"))try{localStorage.removeItem(Dn)}catch{}}clearTicketSession(){if(this.ticketSessionFetch=null,!(typeof localStorage>"u"))try{localStorage.removeItem(Ft)}catch{}}readStoredTicketSession(){if(typeof localStorage>"u")return null;try{let e=localStorage.getItem(Ft);if(!e)return null;let n=JSON.parse(e);if(typeof n.anonymousId=="string"&&typeof n.token=="string"&&typeof n.expiresAt=="number"&&n.expiresAt>Date.now()+6e4)return n;localStorage.removeItem(Ft)}catch{}return null}_ensureTicketSession(){let e=this.readStoredTicketSession();return e?Promise.resolve(e):this.ticketSessionFetch?this.ticketSessionFetch:this.writeKey?(this.ticketSessionFetch=(async()=>{try{let n=await fetch(`${this.endpoint}/api/ingest/ticket/session`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.writeKey}`},body:"{}",signal:AbortSignal.timeout(this.timeout)});if(!n.ok)return null;let r=await n.json();if(typeof r?.anonymousId=="string"&&typeof r?.token=="string"&&typeof r?.expiresAt=="number"){try{localStorage?.setItem(Ft,JSON.stringify(r))}catch{}return this.anonymousId=r.anonymousId,r}return null}catch{return null}finally{this.ticketSessionFetch=null}})(),this.ticketSessionFetch):Promise.resolve(null)}ensureSession(e){if(typeof window>"u")return this.sessionId;try{let n=this.readLastActivity(),r=this.readStoredSession(),i=n===void 0||e-n>this.sessionTimeout;if(r&&!i){this.sessionId=r;try{localStorage.setItem(zt,String(e))}catch{}return r}r&&this.emitSessionEvent(Pn,r,"timeout",n!==void 0?new Date(n).toISOString():void 0);let s=lt();return this.persistSession(s,e),this.emitSessionEvent(ki,s,r?"timeout":"initial"),s}catch{return this.sessionId??lt()}}readStoredSession(){if(this.sessionId)return this.sessionId;if(!(typeof sessionStorage>"u"))try{return sessionStorage.getItem(Nn)??void 0}catch{return}}readLastActivity(){if(!(typeof localStorage>"u"))try{let e=localStorage.getItem(zt);return e?Number(e):void 0}catch{return}}persistSession(e,n){if(this.sessionId=e,!(typeof window>"u"))try{sessionStorage.setItem(Nn,e),localStorage.setItem(zt,String(n))}catch{}}emitSessionEvent(e,n,r,i){if(!this.writeKey)return;let s=Object.keys(this.traits).length>0?{traits:this.traits}:{};this.enqueue({event:e,properties:{reason:r},occurred_at:i??new Date().toISOString(),source:"browser",org_id:this.orgId,user_id:this.userId,anonymous_id:this.anonymousId,session_id:n,context:{...ot(),...s}})}clearSession(){if(!(typeof window>"u"))try{sessionStorage.removeItem(Nn),localStorage.removeItem(zt)}catch{}}getSessionId(){return this.ensureSession(Date.now())}_getEndpoint(){return this.endpoint}_getWriteKey(){return this.writeKey}_getIdentity(){return{userId:this.userId,anonymousId:this.anonymousId,email:this.traits.email,name:this.traits.name,userHash:this.userHash}}captureException(e,n){if(!this.writeKey)return;let{mechanism:r,...i}=n??{};Pt(this,{type:e.name||"Error",message:e.message,stack:e.stack,handled:!0,mechanism:typeof r=="string"?r:"manual",source:"browser",extra:Object.keys(i).length>0?i:void 0},On)}addBreadcrumb(e,n,r){ui({type:"custom",category:e,message:n,timestamp:Date.now(),data:r})}track(e,n){if(!this.writeKey)return;let r=typeof e=="string"?{event:e,properties:n}:e,i=Object.keys(this.traits).length>0?{traits:this.traits}:{},s={...r,occurred_at:r.occurred_at??new Date().toISOString(),source:r.source??"browser",org_id:r.org_id??this.orgId,user_id:r.user_id??this.userId,anonymous_id:r.anonymous_id??this.anonymousId,session_id:r.session_id??this.ensureSession(Date.now()),context:{...ot(),...i,...r.context}};this.enqueue(s),s.event==="$exception"?this.scheduleExceptionFlush():this.buffer.length>=this.flushAt&&this.maybeFlush()}enqueue(e){if(this.buffer.length>=this.maxQueueSize){let n=this.buffer.findIndex(i=>i.event!=="$exception"),r=this.buffer.splice(n===-1?0:n,1);r.length>0&&this.onError?.(new Error("Event buffer full \u2014 dropped oldest event"),r)}this.buffer.push(e)}maybeFlush(){Date.now()<this.nextFlushAllowedAt||this.flush().catch(()=>{})}scheduleExceptionFlush(){this.exceptionFlushScheduled||(this.exceptionFlushScheduled=!0,setTimeout(()=>{this.exceptionFlushScheduled=!1,this.maybeFlush()},0))}async flush(){if(!this.writeKey||this.buffer.length===0)return{success:!0,ingested:0};let e=this.buffer.splice(0,bi);try{let n=await fetch(`${this.endpoint}/api/ingest/track`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.writeKey}`},body:JSON.stringify({events:e}),signal:AbortSignal.timeout(this.timeout)});if(!n.ok){let i=await n.text().catch(()=>""),s=new Error(`API returned ${n.status}: ${i}`);return(n.status===408||n.status===429||n.status>=500)&&this.buffer.unshift(...e),this.recordFlushFailure(),this.onError?.(s,e),{success:!1,ingested:0}}return this.flushFailures=0,this.nextFlushAllowedAt=0,{success:!0,ingested:(await n.json()).ingested}}catch(n){this.buffer.unshift(...e),this.recordFlushFailure();let r=n instanceof Error?n:new Error(String(n));return this.onError?.(r,e),{success:!1,ingested:0}}}recordFlushFailure(){this.flushFailures+=1;let e=Math.min(this.flushInterval*2**this.flushFailures,go);this.nextFlushAllowedAt=Date.now()+e}flushSync(){if(!this.writeKey||typeof fetch>"u"||this.buffer.length===0)return;let e=this.buffer.splice(0,bi);try{fetch(`${this.endpoint}/api/ingest/track`,{method:"POST",keepalive:!0,headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.writeKey}`},body:JSON.stringify({events:e})}).catch(()=>{})}catch{}}getFlag(e,n){return this._flagClient?.getFlag(e,n)??n}onFlagsReady(e){this._flagClient?.onFlagsReady(e)}onFlagChange(e){return this._flagClient?.onFlagChange(e)??(()=>{})}async refreshFlags(){await this._flagClient?.refresh()}async shutdown(){for(this.timer&&(clearInterval(this.timer),this.timer=null),this._flagClient?.destroy(),this._flagClient=null,typeof window<"u"&&(this.visibilityHandler&&(window.removeEventListener("visibilitychange",this.visibilityHandler),this.visibilityHandler=null),this.pageHideHandler&&(window.removeEventListener("pagehide",this.pageHideHandler),this.pageHideHandler=null)),this.uninstallErrorHandlers?.(),this.uninstallErrorHandlers=null;this.buffer.length>0&&(await this.flush()).success;);}};var mo=new Mn,oe=mo;async function yi(){let t=oe._getIdentity();if(t.userId&&t.userHash)return{"X-Scoperat-User-Hash":t.userHash,"X-Scoperat-User-Id":t.userId};let e=await oe._ensureTicketSession();return e?{"X-Scoperat-Session":e.token}:{}}async function vi(){let t=new URLSearchParams,e=oe._getIdentity();if(e.userId&&e.userHash)return t.set("user_id",e.userId),t.set("user_hash",e.userHash),t;let n=await oe._ensureTicketSession();return n&&t.set("session",n.token),t}async function Ti(){let t=oe._getWriteKey();return{"Content-Type":"application/json",...t?{Authorization:`Bearer ${t}`}:{},...await yi()}}async function zn(){let t=oe._getWriteKey();return{...t?{Authorization:`Bearer ${t}`}:{},...await yi()}}function Ge(){return oe._getEndpoint()}async function Ht(t){let e=new FormData;e.append("file",t);let n=await fetch(`${Ge()}/api/ingest/ticket/upload`,{method:"POST",headers:await zn(),body:e});if(!n.ok){let r=await n.text().catch(()=>"");throw new Error(`Upload failed: ${n.status} ${r}`)}return n.json()}async function Si(t){let e=oe._getIdentity(),n=ot(),r=await fetch(`${Ge()}/api/ingest/ticket`,{method:"POST",headers:await Ti(),body:JSON.stringify({...t,attachments:t.attachments?.map(i=>({storageKey:i.storageKey,fileName:i.fileName,mimeType:i.mimeType,fileSize:i.size})),email:t.email??e.email,name:t.name??e.name,metadata:{...n,...t.metadata}})});if(!r.ok){let i=await r.text().catch(()=>"");throw new Error(`Failed to create ticket: ${r.status} ${i}`)}return r.json()}async function Ei(t,e,n){let r=await fetch(`${Ge()}/api/ingest/ticket/message`,{method:"POST",headers:await Ti(),body:JSON.stringify({ticketId:t,body:e,attachments:n?.map(i=>({storageKey:i.storageKey,fileName:i.fileName,mimeType:i.mimeType,fileSize:i.size}))})});if(!r.ok){let i=await r.text().catch(()=>"");throw new Error(`Failed to send message: ${r.status} ${i}`)}return r.json()}async function Ai(){let t=await vi(),e=oe._getWriteKey();e&&t.set("key",e);let n=await fetch(`${Ge()}/api/ingest/tickets?${t.toString()}`,{headers:await zn()});return n.ok?(await n.json()).tickets:[]}async function Fn(t){let e=await vi(),n=await fetch(`${Ge()}/api/ingest/ticket/${t}?${e.toString()}`,{headers:await zn()});if(!n.ok)throw new Error(`Failed to fetch conversation: ${n.status}`);return n.json()}async function Ii(t,e){try{let n=await fetch(`${Ge()}/api/kb/${t}/${e}`);return n.ok?n.json():null}catch{return null}}var Hn=new Set,Ut={isOpen:!1,view:"conversations",tickets:[],activeTicketId:null,activeConversation:null,loading:!1,error:null};function _o(){for(let t of Hn)t()}function Ne(){return Ut}function Ri(t){return Hn.add(t),()=>Hn.delete(t)}function ie(t){Ut={...Ut,...t},_o()}function Ci(){ie({isOpen:!Ut.isOpen})}function Bt(t){ie({view:t})}function jt(t){ie({view:"thread",activeTicketId:t})}function Li(){ie({view:"conversations",activeTicketId:null,activeConversation:null})}var bo=0;function u(t,e,n,r,i,s){e||(e={});var a,c,h=e;if("ref"in h)for(c in h={},e)c=="ref"?a=e[c]:h[c]=e[c];var l={type:t,props:h,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--bo,__i:-1,__u:0,__source:i,__self:s};if(typeof t=="function"&&(a=t.defaultProps))for(c in a)h[c]===void 0&&(h[c]=a[c]);return L.vnode&&L.vnode(l),l}function xo(t){let e=Math.floor((Date.now()-new Date(t).getTime())/1e3);if(e<60)return"just now";let n=Math.floor(e/60);if(n<60)return`${n}m ago`;let r=Math.floor(n/60);return r<24?`${r}h ago`:`${Math.floor(r/24)}d ago`}function ko({ticket:t}){return u("li",{class:"sr-ticket-item",onClick:()=>jt(t.id),children:[u("h4",{children:t.subject}),u("div",{class:"sr-meta",children:u("span",{children:xo(t.lastMessageAt??t.createdAt)})})]})}function $i(){let t=Ne();return $e(()=>{ie({loading:!0}),Ai().then(e=>ie({tickets:e,loading:!1})).catch(()=>ie({loading:!1}))},[]),t.loading?u("div",{class:"sr-loading",children:"Loading conversations..."}):u("div",{children:t.tickets.length===0?u("div",{class:"sr-empty",children:[u("p",{children:"No conversations yet"}),u("button",{class:"sr-btn sr-btn-secondary",onClick:()=>Bt("new-ticket"),children:"Start one"})]}):u("ul",{class:"sr-ticket-list",children:t.tickets.map(e=>u(ko,{ticket:e},e.id))})})}function Oi(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function wo(t){if(Array.isArray(t))return t}function yo(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r,i,s,a,c=[],h=!0,l=!1;try{if(s=(n=n.call(t)).next,e!==0)for(;!(h=(r=s.call(n)).done)&&(c.push(r.value),c.length!==e);h=!0);}catch(g){l=!0,i=g}finally{try{if(!h&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw i}}return c}}function vo(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
901
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function To(t,e){return wo(t)||yo(t,e)||So(t,e)||vo()}function So(t,e){if(t){if(typeof t=="string")return Oi(t,e);var n={}.toString.call(t).slice(8,-1);return n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set"?Array.from(t):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Oi(t,e):void 0}}var Ki=Object.entries,Ni=Object.setPrototypeOf,Eo=Object.isFrozen,Ao=Object.getPrototypeOf,Io=Object.getOwnPropertyDescriptor,Z=Object.freeze,Q=Object.seal,Ke=Object.create,Vi=typeof Reflect<"u"&&Reflect,qn=Vi.apply,Kn=Vi.construct;Z||(Z=function(e){return e});Q||(Q=function(e){return e});qn||(qn=function(e,n){for(var r=arguments.length,i=new Array(r>2?r-2:0),s=2;s<r;s++)i[s-2]=arguments[s];return e.apply(n,i)});Kn||(Kn=function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return new e(...r)});var ct=K(Array.prototype.forEach),Ro=K(Array.prototype.lastIndexOf),Di=K(Array.prototype.pop),qe=K(Array.prototype.push),Co=K(Array.prototype.splice),Ae=Array.isArray,dt=K(String.prototype.toLowerCase),Un=K(String.prototype.toString),Pi=K(String.prototype.match),ut=K(String.prototype.replace),Mi=K(String.prototype.indexOf),Lo=K(String.prototype.trim),$o=K(Number.prototype.toString),Oo=K(Boolean.prototype.toString),zi=typeof BigInt>"u"?null:K(BigInt.prototype.toString),Fi=typeof Symbol>"u"?null:K(Symbol.prototype.toString),X=K(Object.prototype.hasOwnProperty),pt=K(Object.prototype.toString),Y=K(RegExp.prototype.test),De=No(TypeError);function K(t){return function(e){e instanceof RegExp&&(e.lastIndex=0);for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return qn(t,e,r)}}function No(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Kn(t,n)}}function A(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:dt;if(Ni&&Ni(t,null),!Ae(e))return t;let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){let s=n(i);s!==i&&(Eo(e)||(e[r]=s),i=s)}t[i]=!0}return t}function Do(t){for(let e=0;e<t.length;e++)X(t,e)||(t[e]=null);return t}function ne(t){let e=Ke(null);for(let r of Ki(t)){var n=To(r,2);let i=n[0],s=n[1];X(t,i)&&(Ae(s)?e[i]=Do(s):s&&typeof s=="object"&&s.constructor===Object?e[i]=ne(s):e[i]=s)}return e}function Po(t){switch(typeof t){case"string":return t;case"number":return $o(t);case"boolean":return Oo(t);case"bigint":return zi?zi(t):"0";case"symbol":return Fi?Fi(t):"Symbol()";case"undefined":return pt(t);case"function":case"object":{if(t===null)return pt(t);let e=t,n=ge(e,"toString");if(typeof n=="function"){let r=n(e);return typeof r=="string"?r:pt(r)}return pt(t)}default:return pt(t)}}function ge(t,e){for(;t!==null;){let r=Io(t,e);if(r){if(r.get)return K(r.get);if(typeof r.value=="function")return K(r.value)}t=Ao(t)}function n(){return null}return n}function Mo(t){try{return Y(t,""),!0}catch{return!1}}var Hi=Z(["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"]),Bn=Z(["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"]),jn=Z(["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"]),zo=Z(["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"]),Wn=Z(["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"]),Fo=Z(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Ui=Z(["#text"]),Bi=Z(["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"]),Gn=Z(["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","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-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"]),ji=Z(["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"]),Wt=Z(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Ho=Q(/{{[\w\W]*|^[\w\W]*}}/g),Uo=Q(/<%[\w\W]*|^[\w\W]*%>/g),Bo=Q(/\${[\w\W]*/g),jo=Q(/^data-[\-\w.\u00B7-\uFFFF]+$/),Wo=Q(/^aria-[\-\w]+$/),Wi=Q(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Go=Q(/^(?:\w+script|data):/i),qo=Q(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Ko=Q(/^html$/i),Vo=Q(/^[a-z][.\w]*(-[.\w]+)+$/i),Gi=Q(/<[/\w!]/g),Xo=Q(/<[/\w]/g),Yo=Q(/<\/no(script|embed|frames)/i),Zo=Q(/\/>/i),fe={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Qo=function(){return typeof window>"u"?null:window},Jo=function(e,n){if(typeof e!="object"||typeof e.createPolicy!="function")return null;let r=null,i="data-tt-policy-suffix";n&&n.hasAttribute(i)&&(r=n.getAttribute(i));let s="dompurify"+(r?"#"+r:"");try{return e.createPolicy(s,{createHTML(a){return a},createScriptURL(a){return a}})}catch{return console.warn("TrustedTypes policy "+s+" could not be created."),null}},qi=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Ee=function(e,n,r,i){return X(e,n)&&Ae(e[n])?A(i.base?ne(i.base):{},e[n],i.transform):r};function Xi(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Qo(),e=b=>Xi(b);if(e.version="3.4.11",e.removed=[],!t||!t.document||t.document.nodeType!==fe.document||!t.Element)return e.isSupported=!1,e;let n=t.document,r=n,i=r.currentScript;t.DocumentFragment;let s=t.HTMLTemplateElement,a=t.Node,c=t.Element,h=t.NodeFilter,l=t.NamedNodeMap;l===void 0&&(t.NamedNodeMap||t.MozNamedAttrMap),t.HTMLFormElement;let g=t.DOMParser,f=t.trustedTypes,p=c.prototype,m=ge(p,"cloneNode"),x=ge(p,"remove"),E=ge(p,"nextSibling"),y=ge(p,"childNodes"),S=ge(p,"parentNode"),v=ge(p,"shadowRoot"),N=ge(p,"attributes"),D=a&&a.prototype?ge(a.prototype,"nodeType"):null,P=a&&a.prototype?ge(a.prototype,"nodeName"):null;if(typeof s=="function"){let b=n.createElement("template");b.content&&b.content.ownerDocument&&(n=b.content.ownerDocument)}let C,re="",ae,M=!1,O=0,J=function(){if(O>0)throw De('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.')},le=function(o){J(),O++;try{return C.createHTML(o)}finally{O--}},Jt=function(o){J(),O++;try{return C.createScriptURL(o)}finally{O--}},en=function(){return M||(ae=Jo(f,i),M=!0),ae},mt=n,tn=mt.implementation,cr=mt.createNodeIterator,ks=mt.createDocumentFragment,ws=mt.getElementsByTagName,ys=r.importNode,B=qi();e.isSupported=typeof Ki=="function"&&typeof S=="function"&&tn&&tn.createHTMLDocument!==void 0;let vs=Ho,Ts=Uo,Ss=Bo,Es=jo,As=Wo,Is=Go,ur=qo,Rs=Vo,pr=Wi,z=null,dr=A({},[...Hi,...Bn,...jn,...Wn,...Ui]),F=null,hr=A({},[...Bi,...Gn,...ji,...Wt]),H=Object.seal(Ke(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}})),Ye=null,fr=null,ke=Object.seal(Ke(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),gr=!0,nn=!0,mr=!1,_r=!0,we=!1,Ze=!0,Ce=!1,rn=!1,sn=null,on=null,an=!1,Fe=!1,_t=!1,bt=!1,br=!0,xr=!1,kr="user-content-",ln=!0,cn=!1,He={},de=null,un=A({},["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"]),wr=null,yr=A({},["audio","video","img","source","image","track"]),pn=null,vr=A({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xt="http://www.w3.org/1998/Math/MathML",kt="http://www.w3.org/2000/svg",he="http://www.w3.org/1999/xhtml",Ue=he,dn=!1,hn=null,Cs=A({},[xt,kt,he],Un),Tr=Z(["mi","mo","mn","ms","mtext"]),fn=A({},Tr),Sr=Z(["annotation-xml"]),gn=A({},Sr),Ls=A({},["title","style","font","a","script"]),Qe=null,$s=["application/xhtml+xml","text/html"],Os="text/html",U=null,Be=null,Ns=n.createElement("form"),Er=function(o){return o instanceof RegExp||o instanceof Function},mn=function(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(Be&&Be===o)return;(!o||typeof o!="object")&&(o={}),o=ne(o),Qe=$s.indexOf(o.PARSER_MEDIA_TYPE)===-1?Os:o.PARSER_MEDIA_TYPE,U=Qe==="application/xhtml+xml"?Un:dt,z=Ee(o,"ALLOWED_TAGS",dr,{transform:U}),F=Ee(o,"ALLOWED_ATTR",hr,{transform:U}),hn=Ee(o,"ALLOWED_NAMESPACES",Cs,{transform:Un}),pn=Ee(o,"ADD_URI_SAFE_ATTR",vr,{transform:U,base:vr}),wr=Ee(o,"ADD_DATA_URI_TAGS",yr,{transform:U,base:yr}),de=Ee(o,"FORBID_CONTENTS",un,{transform:U}),Ye=Ee(o,"FORBID_TAGS",ne({}),{transform:U}),fr=Ee(o,"FORBID_ATTR",ne({}),{transform:U}),He=X(o,"USE_PROFILES")?o.USE_PROFILES&&typeof o.USE_PROFILES=="object"?ne(o.USE_PROFILES):o.USE_PROFILES:!1,gr=o.ALLOW_ARIA_ATTR!==!1,nn=o.ALLOW_DATA_ATTR!==!1,mr=o.ALLOW_UNKNOWN_PROTOCOLS||!1,_r=o.ALLOW_SELF_CLOSE_IN_ATTR!==!1,we=o.SAFE_FOR_TEMPLATES||!1,Ze=o.SAFE_FOR_XML!==!1,Ce=o.WHOLE_DOCUMENT||!1,Fe=o.RETURN_DOM||!1,_t=o.RETURN_DOM_FRAGMENT||!1,bt=o.RETURN_TRUSTED_TYPE||!1,an=o.FORCE_BODY||!1,br=o.SANITIZE_DOM!==!1,xr=o.SANITIZE_NAMED_PROPS||!1,ln=o.KEEP_CONTENT!==!1,cn=o.IN_PLACE||!1,pr=Mo(o.ALLOWED_URI_REGEXP)?o.ALLOWED_URI_REGEXP:Wi,Ue=typeof o.NAMESPACE=="string"?o.NAMESPACE:he,fn=X(o,"MATHML_TEXT_INTEGRATION_POINTS")&&o.MATHML_TEXT_INTEGRATION_POINTS&&typeof o.MATHML_TEXT_INTEGRATION_POINTS=="object"?ne(o.MATHML_TEXT_INTEGRATION_POINTS):A({},Tr),gn=X(o,"HTML_INTEGRATION_POINTS")&&o.HTML_INTEGRATION_POINTS&&typeof o.HTML_INTEGRATION_POINTS=="object"?ne(o.HTML_INTEGRATION_POINTS):A({},Sr);let d=X(o,"CUSTOM_ELEMENT_HANDLING")&&o.CUSTOM_ELEMENT_HANDLING&&typeof o.CUSTOM_ELEMENT_HANDLING=="object"?ne(o.CUSTOM_ELEMENT_HANDLING):Ke(null);if(H=Ke(null),X(d,"tagNameCheck")&&Er(d.tagNameCheck)&&(H.tagNameCheck=d.tagNameCheck),X(d,"attributeNameCheck")&&Er(d.attributeNameCheck)&&(H.attributeNameCheck=d.attributeNameCheck),X(d,"allowCustomizedBuiltInElements")&&typeof d.allowCustomizedBuiltInElements=="boolean"&&(H.allowCustomizedBuiltInElements=d.allowCustomizedBuiltInElements),Q(H),we&&(nn=!1),_t&&(Fe=!0),He&&(z=A({},Ui),F=Ke(null),He.html===!0&&(A(z,Hi),A(F,Bi)),He.svg===!0&&(A(z,Bn),A(F,Gn),A(F,Wt)),He.svgFilters===!0&&(A(z,jn),A(F,Gn),A(F,Wt)),He.mathMl===!0&&(A(z,Wn),A(F,ji),A(F,Wt))),ke.tagCheck=null,ke.attributeCheck=null,X(o,"ADD_TAGS")&&(typeof o.ADD_TAGS=="function"?ke.tagCheck=o.ADD_TAGS:Ae(o.ADD_TAGS)&&(z===dr&&(z=ne(z)),A(z,o.ADD_TAGS,U))),X(o,"ADD_ATTR")&&(typeof o.ADD_ATTR=="function"?ke.attributeCheck=o.ADD_ATTR:Ae(o.ADD_ATTR)&&(F===hr&&(F=ne(F)),A(F,o.ADD_ATTR,U))),X(o,"ADD_URI_SAFE_ATTR")&&Ae(o.ADD_URI_SAFE_ATTR)&&A(pn,o.ADD_URI_SAFE_ATTR,U),X(o,"FORBID_CONTENTS")&&Ae(o.FORBID_CONTENTS)&&(de===un&&(de=ne(de)),A(de,o.FORBID_CONTENTS,U)),X(o,"ADD_FORBID_CONTENTS")&&Ae(o.ADD_FORBID_CONTENTS)&&(de===un&&(de=ne(de)),A(de,o.ADD_FORBID_CONTENTS,U)),ln&&(z["#text"]=!0),Ce&&A(z,["html","head","body"]),z.table&&(A(z,["tbody"]),delete Ye.tbody),o.TRUSTED_TYPES_POLICY){if(typeof o.TRUSTED_TYPES_POLICY.createHTML!="function")throw De('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof o.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw De('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');let _=C;C=o.TRUSTED_TYPES_POLICY;try{re=le("")}catch(w){throw C=_,w}}else o.TRUSTED_TYPES_POLICY===null?(C=void 0,re=""):(C===void 0&&(C=en()),C&&typeof re=="string"&&(re=le("")));Z&&Z(o),Be=o},Ar=A({},[...Bn,...jn,...zo]),Ir=A({},[...Wn,...Fo]),Ds=function(o,d,_){return d.namespaceURI===he?o==="svg":d.namespaceURI===xt?o==="svg"&&(_==="annotation-xml"||fn[_]):!!Ar[o]},Ps=function(o,d,_){return d.namespaceURI===he?o==="math":d.namespaceURI===kt?o==="math"&&gn[_]:!!Ir[o]},Ms=function(o,d,_){return d.namespaceURI===kt&&!gn[_]||d.namespaceURI===xt&&!fn[_]?!1:!Ir[o]&&(Ls[o]||!Ar[o])},zs=function(o){let d=S(o);(!d||!d.tagName)&&(d={namespaceURI:Ue,tagName:"template"});let _=dt(o.tagName),w=dt(d.tagName);return hn[o.namespaceURI]?o.namespaceURI===kt?Ds(_,d,w):o.namespaceURI===xt?Ps(_,d,w):o.namespaceURI===he?Ms(_,d,w):!!(Qe==="application/xhtml+xml"&&hn[o.namespaceURI]):!1},ye=function(o){qe(e.removed,{element:o});try{S(o).removeChild(o)}catch{if(x(o),!S(o))throw De("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},Rr=function(o){let d=y(o);if(d){let w=[];ct(d,T=>{qe(w,T)}),ct(w,T=>{try{x(T)}catch{}})}let _=N(o);if(_)for(let w=_.length-1;w>=0;--w){let T=_[w],R=T&&T.name;if(typeof R=="string")try{o.removeAttribute(R)}catch{}}},Le=function(o,d){try{qe(e.removed,{attribute:d.getAttributeNode(o),from:d})}catch{qe(e.removed,{attribute:null,from:d})}if(d.removeAttribute(o),o==="is")if(Fe||_t)try{ye(d)}catch{}else try{d.setAttribute(o,"")}catch{}},Fs=function(o){let d=N(o);if(d)for(let _=d.length-1;_>=0;--_){let w=d[_],T=w&&w.name;if(!(typeof T!="string"||F[U(T)]))try{o.removeAttribute(T)}catch{}}},Hs=function(o){let d=[o];for(;d.length>0;){let _=d.pop();(D?D(_):_.nodeType)===fe.element&&Fs(_);let T=y(_);if(T)for(let R=T.length-1;R>=0;--R)d.push(T[R])}},Cr=function(o){let d=null,_=null;if(an)o="<remove></remove>"+o;else{let R=Pi(o,/^[\r\n\t ]+/);_=R&&R[0]}Qe==="application/xhtml+xml"&&Ue===he&&(o='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+o+"</body></html>");let w=C?le(o):o;if(Ue===he)try{d=new g().parseFromString(w,Qe)}catch{}if(!d||!d.documentElement){d=tn.createDocument(Ue,"template",null);try{d.documentElement.innerHTML=dn?re:w}catch{}}let T=d.body||d.documentElement;return o&&_&&T.insertBefore(n.createTextNode(_),T.childNodes[0]||null),Ue===he?ws.call(d,Ce?"html":"body")[0]:Ce?d.documentElement:T},Lr=function(o){return cr.call(o.ownerDocument||o,o,h.SHOW_ELEMENT|h.SHOW_COMMENT|h.SHOW_TEXT|h.SHOW_PROCESSING_INSTRUCTION|h.SHOW_CDATA_SECTION,null)},wt=function(o){return o=ut(o,vs," "),o=ut(o,Ts," "),o=ut(o,Ss," "),o},_n=function(o){var d;o.normalize();let _=cr.call(o.ownerDocument||o,o,h.SHOW_TEXT|h.SHOW_COMMENT|h.SHOW_CDATA_SECTION|h.SHOW_PROCESSING_INSTRUCTION,null),w=_.nextNode();for(;w;)w.data=wt(w.data),w=_.nextNode();let T=(d=o.querySelectorAll)===null||d===void 0?void 0:d.call(o,"template");T&&ct(T,R=>{je(R.content)&&_n(R.content)})},yt=function(o){let d=P?P(o):null;return typeof d!="string"||U(d)!=="form"?!1:typeof o.nodeName!="string"||typeof o.textContent!="string"||typeof o.removeChild!="function"||o.attributes!==N(o)||typeof o.removeAttribute!="function"||typeof o.setAttribute!="function"||typeof o.namespaceURI!="string"||typeof o.insertBefore!="function"||typeof o.hasChildNodes!="function"||o.nodeType!==D(o)||o.childNodes!==y(o)},je=function(o){if(!D||typeof o!="object"||o===null)return!1;try{return D(o)===fe.documentFragment}catch{return!1}},Je=function(o){if(!D||typeof o!="object"||o===null)return!1;try{return typeof D(o)=="number"}catch{return!1}};function _e(b,o,d){b.length!==0&&ct(b,_=>{_.call(e,o,d,Be)})}let Us=function(o,d){return!!(Ze&&o.hasChildNodes()&&!Je(o.firstElementChild)&&Y(Gi,o.textContent)&&Y(Gi,o.innerHTML)||Ze&&o.namespaceURI===he&&d==="style"&&Je(o.firstElementChild)||o.nodeType===fe.processingInstruction||Ze&&o.nodeType===fe.comment&&Y(Xo,o.data))},Bs=function(o,d){if(!Ye[d]&&Nr(d)&&(H.tagNameCheck instanceof RegExp&&Y(H.tagNameCheck,d)||H.tagNameCheck instanceof Function&&H.tagNameCheck(d)))return!1;if(ln&&!de[d]){let _=S(o),w=y(o);if(w&&_){let T=w.length;for(let R=T-1;R>=0;--R){let V=cn?w[R]:m(w[R],!0);_.insertBefore(V,E(o))}}}return ye(o),!0},$r=function(o){if(_e(B.beforeSanitizeElements,o,null),yt(o))return ye(o),!0;let d=U(P?P(o):o.nodeName);if(_e(B.uponSanitizeElement,o,{tagName:d,allowedTags:z}),Us(o,d))return ye(o),!0;if(Ye[d]||!(ke.tagCheck instanceof Function&&ke.tagCheck(d))&&!z[d])return Bs(o,d);if((D?D(o):o.nodeType)===fe.element&&!zs(o)||(d==="noscript"||d==="noembed"||d==="noframes")&&Y(Yo,o.innerHTML))return ye(o),!0;if(we&&o.nodeType===fe.text){let w=wt(o.textContent);o.textContent!==w&&(qe(e.removed,{element:o.cloneNode()}),o.textContent=w)}return _e(B.afterSanitizeElements,o,null),!1},Or=function(o,d,_){if(fr[d]||br&&(d==="id"||d==="name")&&(_ in n||_ in Ns))return!1;let w=F[d]||ke.attributeCheck instanceof Function&&ke.attributeCheck(d,o);if(!(nn&&Y(Es,d))){if(!(gr&&Y(As,d))){if(w){if(!pn[d]){if(!Y(pr,ut(_,ur,""))){if(!((d==="src"||d==="xlink:href"||d==="href")&&o!=="script"&&Mi(_,"data:")===0&&wr[o])){if(!(mr&&!Y(Is,ut(_,ur,"")))){if(_)return!1}}}}}else if(!(Nr(o)&&(H.tagNameCheck instanceof RegExp&&Y(H.tagNameCheck,o)||H.tagNameCheck instanceof Function&&H.tagNameCheck(o))&&(H.attributeNameCheck instanceof RegExp&&Y(H.attributeNameCheck,d)||H.attributeNameCheck instanceof Function&&H.attributeNameCheck(d,o))||d==="is"&&H.allowCustomizedBuiltInElements&&(H.tagNameCheck instanceof RegExp&&Y(H.tagNameCheck,_)||H.tagNameCheck instanceof Function&&H.tagNameCheck(_))))return!1}}return!0},js=A({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Nr=function(o){return!js[dt(o)]&&Y(Rs,o)},Ws=function(o,d,_,w){if(C&&typeof f=="object"&&typeof f.getAttributeType=="function"&&!_)switch(f.getAttributeType(o,d)){case"TrustedHTML":return le(w);case"TrustedScriptURL":return Jt(w)}return w},Gs=function(o,d,_,w){try{_?o.setAttributeNS(_,d,w):o.setAttribute(d,w),yt(o)?ye(o):Di(e.removed)}catch{Le(d,o)}},Dr=function(o){_e(B.beforeSanitizeAttributes,o,null);let d=o.attributes;if(!d||yt(o))return;let _={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:F,forceKeepAttr:void 0},w=d.length,T=U(o.nodeName);for(;w--;){let R=d[w],V=R.name,W=R.namespaceURI,se=R.value,ce=U(V),xn=se,te=V==="value"?xn:Lo(xn);if(_.attrName=ce,_.attrValue=te,_.keepAttr=!0,_.forceKeepAttr=void 0,_e(B.uponSanitizeAttribute,o,_),te=_.attrValue,xr&&(ce==="id"||ce==="name")&&Mi(te,kr)!==0&&(Le(V,o),te=kr+te),Ze&&Y(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,te)){Le(V,o);continue}if(ce==="attributename"&&Pi(te,"href")){Le(V,o);continue}if(!_.forceKeepAttr){if(!_.keepAttr){Le(V,o);continue}if(!_r&&Y(Zo,te)){Le(V,o);continue}if(we&&(te=wt(te)),!Or(T,ce,te)){Le(V,o);continue}te=Ws(T,ce,W,te),te!==xn&&Gs(o,V,W,te)}}_e(B.afterSanitizeAttributes,o,null)},vt=function(o){let d=null,_=Lr(o);for(_e(B.beforeSanitizeShadowDOM,o,null);d=_.nextNode();)if(_e(B.uponSanitizeShadowNode,d,null),$r(d),Dr(d),je(d.content)&&vt(d.content),(D?D(d):d.nodeType)===fe.element){let T=v(d);je(T)&&(bn(T),vt(T))}_e(B.afterSanitizeShadowDOM,o,null)},bn=function(o){let d=[{node:o,shadow:null}];for(;d.length>0;){let _=d.pop();if(_.shadow){vt(_.shadow);continue}let w=_.node,R=(D?D(w):w.nodeType)===fe.element,V=y(w);if(V)for(let W=V.length-1;W>=0;--W)d.push({node:V[W],shadow:null});if(R){let W=P?P(w):null;if(typeof W=="string"&&U(W)==="template"){let se=w.content;je(se)&&d.push({node:se,shadow:null})}}if(R){let W=v(w);je(W)&&d.push({node:null,shadow:W},{node:W,shadow:null})}}};return e.sanitize=function(b){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},d=null,_=null,w=null,T=null;if(dn=!b,dn&&(b="<!-->"),typeof b!="string"&&!Je(b)&&(b=Po(b),typeof b!="string"))throw De("dirty is not a string, aborting");if(!e.isSupported)return b;rn?(z=sn,F=on):mn(o),(B.uponSanitizeElement.length>0||B.uponSanitizeAttribute.length>0)&&(z=ne(z)),B.uponSanitizeAttribute.length>0&&(F=ne(F)),e.removed=[];let R=cn&&typeof b!="string"&&Je(b);if(R){let se=P?P(b):b.nodeName;if(typeof se=="string"){let ce=U(se);if(!z[ce]||Ye[ce])throw De("root node is forbidden and cannot be sanitized in-place")}if(yt(b))throw De("root node is clobbered and cannot be sanitized in-place");try{bn(b)}catch(ce){throw Rr(b),ce}}else if(Je(b))d=Cr("<!---->"),_=d.ownerDocument.importNode(b,!0),_.nodeType===fe.element&&_.nodeName==="BODY"||_.nodeName==="HTML"?d=_:d.appendChild(_),bn(_);else{if(!Fe&&!we&&!Ce&&b.indexOf("<")===-1)return C&&bt?le(b):b;if(d=Cr(b),!d)return Fe?null:bt?re:""}d&&an&&ye(d.firstChild);let V=Lr(R?b:d);try{for(;w=V.nextNode();)$r(w),Dr(w),je(w.content)&&vt(w.content)}catch(se){throw R&&Rr(b),se}if(R)return ct(e.removed,se=>{se.element&&Hs(se.element)}),we&&_n(b),b;if(Fe){if(we&&_n(d),_t)for(T=ks.call(d.ownerDocument);d.firstChild;)T.appendChild(d.firstChild);else T=d;return(F.shadowroot||F.shadowrootmode)&&(T=ys.call(r,T,!0)),T}let W=Ce?d.outerHTML:d.innerHTML;return Ce&&z["!doctype"]&&d.ownerDocument&&d.ownerDocument.doctype&&d.ownerDocument.doctype.name&&Y(Ko,d.ownerDocument.doctype.name)&&(W="<!DOCTYPE "+d.ownerDocument.doctype.name+`>
|
|
902
|
+
`+W),we&&(W=wt(W)),C&&bt?le(W):W},e.setConfig=function(){let b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};mn(b),rn=!0,sn=z,on=F},e.clearConfig=function(){Be=null,rn=!1,sn=null,on=null,C=ae,re=""},e.isValidAttribute=function(b,o,d){Be||mn({});let _=U(b),w=U(o);return Or(_,w,d)},e.addHook=function(b,o){typeof o=="function"&&X(B,b)&&qe(B[b],o)},e.removeHook=function(b,o){if(X(B,b)){if(o!==void 0){let d=Ro(B[b],o);return d===-1?void 0:Co(B[b],d,1)[0]}return Di(B[b])}},e.removeHooks=function(b){X(B,b)&&(B[b]=[])},e.removeAllHooks=function(){B=qi()},e}var Vn=Xi();function Qn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var ze=Qn();function rs(t){ze=t}var Pe={exec:()=>null};function Ve(t){let e=[];return n=>{let r=Math.max(0,Math.min(3,n-1)),i=e[r];return i||(i=t(r),e[r]=i),i}}function I(t,e=""){let n=typeof t=="string"?t:t.source,r={replace:(i,s)=>{let a=typeof s=="string"?s:s.source;return a=a.replace(ee.caret,"$1"),n=n.replace(i,a),r},getRegex:()=>new RegExp(n,e)};return r}var ea=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),ee={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Ve(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Ve(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Ve(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Ve(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Ve(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Ve(t=>new RegExp(`^ {0,${t}}>`))},ta=/^(?:[ \t]*(?:\n|$))+/,na=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,ra=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,gt=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ia=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Jn=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,is=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,ss=I(is).replace(/bull/g,Jn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),sa=I(is).replace(/bull/g,Jn).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),er=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,oa=/^[^\n]+/,tr=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,aa=I(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",tr).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),la=I(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Jn).getRegex(),Yt="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",nr=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,ca=I("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",nr).replace("tag",Yt).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),os=I(er).replace("hr",gt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yt).getRegex(),ua=I(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",os).getRegex(),rr={blockquote:ua,code:na,def:aa,fences:ra,heading:ia,hr:gt,html:ca,lheading:ss,list:la,newline:ta,paragraph:os,table:Pe,text:oa},Yi=I("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",gt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yt).getRegex(),pa={...rr,lheading:sa,table:Yi,paragraph:I(er).replace("hr",gt).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Yi).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Yt).getRegex()},da={...rr,html:I(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",nr).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:Pe,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:I(er).replace("hr",gt).replace("heading",` *#{1,6} *[^
|
|
903
|
+
]`).replace("lheading",ss).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},ha=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,fa=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,as=/^( {2,}|\\)\n(?!\s*$)/,ga=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Xe=/[\p{P}\p{S}]/u,Zt=/[\s\p{P}\p{S}]/u,ir=/[^\s\p{P}\p{S}]/u,ma=I(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Zt).getRegex(),ls=/(?!~)[\p{P}\p{S}]/u,_a=/(?!~)[\s\p{P}\p{S}]/u,ba=/(?:[^\s\p{P}\p{S}]|~)/u,xa=I(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",ea?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),cs=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,ka=I(cs,"u").replace(/punct/g,Xe).getRegex(),wa=I(cs,"u").replace(/punct/g,ls).getRegex(),us="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ya=I(us,"gu").replace(/notPunctSpace/g,ir).replace(/punctSpace/g,Zt).replace(/punct/g,Xe).getRegex(),va=I(us,"gu").replace(/notPunctSpace/g,ba).replace(/punctSpace/g,_a).replace(/punct/g,ls).getRegex(),Ta=I("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,ir).replace(/punctSpace/g,Zt).replace(/punct/g,Xe).getRegex(),Sa=I(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Xe).getRegex(),Ea="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",Aa=I(Ea,"gu").replace(/notPunctSpace/g,ir).replace(/punctSpace/g,Zt).replace(/punct/g,Xe).getRegex(),Ia=I(/\\(punct)/,"gu").replace(/punct/g,Xe).getRegex(),Ra=I(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Ca=I(nr).replace("(?:-->|$)","-->").getRegex(),La=I("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Ca).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Kt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,$a=I(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Kt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),ps=I(/^!?\[(label)\]\[(ref)\]/).replace("label",Kt).replace("ref",tr).getRegex(),ds=I(/^!?\[(ref)\](?:\[\])?/).replace("ref",tr).getRegex(),Oa=I("reflink|nolink(?!\\()","g").replace("reflink",ps).replace("nolink",ds).getRegex(),Zi=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,sr={_backpedal:Pe,anyPunctuation:Ia,autolink:Ra,blockSkip:xa,br:as,code:fa,del:Pe,delLDelim:Pe,delRDelim:Pe,emStrongLDelim:ka,emStrongRDelimAst:ya,emStrongRDelimUnd:Ta,escape:ha,link:$a,nolink:ds,punctuation:ma,reflink:ps,reflinkSearch:Oa,tag:La,text:ga,url:Pe},Na={...sr,link:I(/^!?\[(label)\]\((.*?)\)/).replace("label",Kt).getRegex(),reflink:I(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Kt).getRegex()},Xn={...sr,emStrongRDelimAst:va,emStrongLDelim:wa,delLDelim:Sa,delRDelim:Aa,url:I(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Zi).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:I(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Zi).getRegex()},Da={...Xn,br:I(as).replace("{2,}","*").getRegex(),text:I(Xn.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Gt={normal:rr,gfm:pa,pedantic:da},ht={normal:sr,gfm:Xn,breaks:Da,pedantic:Na},Pa={"&":"&","<":"<",">":">",'"':""","'":"'"},Qi=t=>Pa[t];function me(t,e){if(e){if(ee.escapeTest.test(t))return t.replace(ee.escapeReplace,Qi)}else if(ee.escapeTestNoEncode.test(t))return t.replace(ee.escapeReplaceNoEncode,Qi);return t}function Ji(t){try{t=encodeURI(t).replace(ee.percentDecode,"%")}catch{return null}return t}function es(t,e){let n=t.replace(ee.findPipe,(s,a,c)=>{let h=!1,l=a;for(;--l>=0&&c[l]==="\\";)h=!h;return h?"|":" |"}),r=n.split(ee.splitPipe),i=0;if(r[0].trim()||r.shift(),r.length>0&&!r.at(-1)?.trim()&&r.pop(),e)if(r.length>e)r.splice(e);else for(;r.length<e;)r.push("");for(;i<r.length;i++)r[i]=r[i].trim().replace(ee.slashPipe,"|");return r}function Ie(t,e,n){let r=t.length;if(r===0)return"";let i=0;for(;i<r;){let s=t.charAt(r-i-1);if(s===e&&!n)i++;else if(s!==e&&n)i++;else break}return t.slice(0,r-i)}function ts(t){let e=t.split(`
|
|
904
|
+
`),n=e.length-1;for(;n>=0&&ee.blankLine.test(e[n]);)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
|
|
905
|
+
`)}function Ma(t,e){if(t.indexOf(e[1])===-1)return-1;let n=0;for(let r=0;r<t.length;r++)if(t[r]==="\\")r++;else if(t[r]===e[0])n++;else if(t[r]===e[1]&&(n--,n<0))return r;return n>0?-2:-1}function za(t,e=0){let n=e,r="";for(let i of t)if(i===" "){let s=4-n%4;r+=" ".repeat(s),n+=s}else r+=i,n++;return r}function ns(t,e,n,r,i){let s=e.href,a=e.title||null,c=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let h={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:a,text:c,tokens:r.inlineTokens(c)};return r.state.inLink=!1,h}function Fa(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let i=r[1];return e.split(`
|
|
906
|
+
`).map(s=>{let a=s.match(n.other.beginningSpace);if(a===null)return s;let[c]=a;return c.length>=i.length?s.slice(i.length):s}).join(`
|
|
907
|
+
`)}var Vt=class{constructor(t){k(this,"options");k(this,"rules");k(this,"lexer");this.options=t||ze}space(t){let e=this.rules.block.newline.exec(t);if(e&&e[0].length>0)return{type:"space",raw:e[0]}}code(t){let e=this.rules.block.code.exec(t);if(e){let n=this.options.pedantic?e[0]:ts(e[0]),r=n.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:n,codeBlockStyle:"indented",text:r}}}fences(t){let e=this.rules.block.fences.exec(t);if(e){let n=e[0],r=Fa(n,e[3]||"",this.rules);return{type:"code",raw:n,lang:e[2]?e[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):e[2],text:r}}}heading(t){let e=this.rules.block.heading.exec(t);if(e){let n=e[2].trim();if(this.rules.other.endingHash.test(n)){let r=Ie(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:Ie(e[0],`
|
|
908
|
+
`),depth:e[1].length,text:n,tokens:this.lexer.inline(n)}}}hr(t){let e=this.rules.block.hr.exec(t);if(e)return{type:"hr",raw:Ie(e[0],`
|
|
909
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=Ie(e[0],`
|
|
909
910
|
`).split(`
|
|
910
|
-
`),r="",i="",s=[];for(;n.length>0;){let
|
|
911
|
-
`),
|
|
911
|
+
`),r="",i="",s=[];for(;n.length>0;){let a=!1,c=[],h;for(h=0;h<n.length;h++)if(this.rules.other.blockquoteStart.test(n[h]))c.push(n[h]),a=!0;else if(!a)c.push(n[h]);else break;n=n.slice(h);let l=c.join(`
|
|
912
|
+
`),g=l.replace(this.rules.other.blockquoteSetextReplace,`
|
|
912
913
|
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
913
|
-
${
|
|
914
|
-
${
|
|
914
|
+
${l}`:l,i=i?`${i}
|
|
915
|
+
${g}`:g;let f=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(g,s,!0),this.lexer.state.top=f,n.length===0)break;let p=s.at(-1);if(p?.type==="code")break;if(p?.type==="blockquote"){let m=p,x=m.raw+`
|
|
915
916
|
`+n.join(`
|
|
916
|
-
`),E=this.blockquote(
|
|
917
|
+
`),E=this.blockquote(x);s[s.length-1]=E,r=r.substring(0,r.length-m.raw.length)+E.raw,i=i.substring(0,i.length-m.text.length)+E.text;break}else if(p?.type==="list"){let m=p,x=m.raw+`
|
|
917
918
|
`+n.join(`
|
|
918
|
-
`),E=this.list(
|
|
919
|
-
`);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),
|
|
920
|
-
`,1)[0],e[1].length),
|
|
921
|
-
`,1)[0],
|
|
922
|
-
`,t=t.substring(
|
|
923
|
-
`,1)[0],
|
|
924
|
-
`+
|
|
925
|
-
`+m
|
|
926
|
-
`,t=t.substring(
|
|
927
|
-
`),href:r,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=
|
|
928
|
-
`):[],s={type:"table",raw:
|
|
929
|
-
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let
|
|
919
|
+
`),E=this.list(x);s[s.length-1]=E,r=r.substring(0,r.length-p.raw.length)+E.raw,i=i.substring(0,i.length-m.raw.length)+E.raw,n=x.substring(s.at(-1).raw.length).split(`
|
|
920
|
+
`);continue}}return{type:"blockquote",raw:r,tokens:s,text:i}}}list(t){let e=this.rules.block.list.exec(t);if(e){let n=e[1].trim(),r=n.length>1,i={type:"list",raw:"",ordered:r,start:r?+n.slice(0,-1):"",loose:!1,items:[]};n=r?`\\d{1,9}\\${n.slice(-1)}`:`\\${n}`,this.options.pedantic&&(n=r?n:"[*+-]");let s=this.rules.other.listItemRegex(n),a=!1;for(;t;){let h=!1,l="",g="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;l=e[0],t=t.substring(l.length);let f=za(e[2].split(`
|
|
921
|
+
`,1)[0],e[1].length),p=t.split(`
|
|
922
|
+
`,1)[0],m=!f.trim(),x=0;if(this.options.pedantic?(x=2,g=f.trimStart()):m?x=e[1].length+1:(x=f.search(this.rules.other.nonSpaceChar),x=x>4?1:x,g=f.slice(x),x+=e[1].length),m&&this.rules.other.blankLine.test(p)&&(l+=p+`
|
|
923
|
+
`,t=t.substring(p.length+1),h=!0),!h){let E=this.rules.other.nextBulletRegex(x),y=this.rules.other.hrRegex(x),S=this.rules.other.fencesBeginRegex(x),v=this.rules.other.headingBeginRegex(x),N=this.rules.other.htmlBeginRegex(x),D=this.rules.other.blockquoteBeginRegex(x);for(;t;){let P=t.split(`
|
|
924
|
+
`,1)[0],C;if(p=P,this.options.pedantic?(p=p.replace(this.rules.other.listReplaceNesting," "),C=p):C=p.replace(this.rules.other.tabCharGlobal," "),S.test(p)||v.test(p)||N.test(p)||D.test(p)||E.test(p)||y.test(p))break;if(C.search(this.rules.other.nonSpaceChar)>=x||!p.trim())g+=`
|
|
925
|
+
`+C.slice(x);else{if(m||f.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||S.test(f)||v.test(f)||y.test(f))break;g+=`
|
|
926
|
+
`+p}m=!p.trim(),l+=P+`
|
|
927
|
+
`,t=t.substring(P.length+1),f=C.slice(x)}}i.loose||(a?i.loose=!0:this.rules.other.doubleBlankLine.test(l)&&(a=!0)),i.items.push({type:"list_item",raw:l,task:!!this.options.gfm&&this.rules.other.listIsTask.test(g),loose:!1,text:g,tokens:[]}),i.raw+=l}let c=i.items.at(-1);if(c)c.raw=c.raw.trimEnd(),c.text=c.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let h of i.items){this.lexer.state.top=!1,h.tokens=this.lexer.blockTokens(h.text,[]);let l=h.tokens[0];if(h.task&&(l?.type==="text"||l?.type==="paragraph")){h.text=h.text.replace(this.rules.other.listReplaceTask,""),l.raw=l.raw.replace(this.rules.other.listReplaceTask,""),l.text=l.text.replace(this.rules.other.listReplaceTask,"");for(let f=this.lexer.inlineQueue.length-1;f>=0;f--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[f].src)){this.lexer.inlineQueue[f].src=this.lexer.inlineQueue[f].src.replace(this.rules.other.listReplaceTask,"");break}let g=this.rules.other.listTaskCheckbox.exec(h.raw);if(g){let f={type:"checkbox",raw:g[0]+" ",checked:g[0]!=="[ ]"};h.checked=f.checked,i.loose?h.tokens[0]&&["paragraph","text"].includes(h.tokens[0].type)&&"tokens"in h.tokens[0]&&h.tokens[0].tokens?(h.tokens[0].raw=f.raw+h.tokens[0].raw,h.tokens[0].text=f.raw+h.tokens[0].text,h.tokens[0].tokens.unshift(f)):h.tokens.unshift({type:"paragraph",raw:f.raw,text:f.raw,tokens:[f]}):h.tokens.unshift(f)}}else h.task&&(h.task=!1);if(!i.loose){let g=h.tokens.filter(p=>p.type==="space"),f=g.length>0&&g.some(p=>this.rules.other.anyLine.test(p.raw));i.loose=f}}if(i.loose)for(let h of i.items){h.loose=!0;for(let l of h.tokens)l.type==="text"&&(l.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=ts(e[0]);return{type:"html",block:!0,raw:n,pre:e[1]==="pre"||e[1]==="script"||e[1]==="style",text:n}}}def(t){let e=this.rules.block.def.exec(t);if(e){let n=e[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),r=e[2]?e[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",i=e[3]?e[3].substring(1,e[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):e[3];return{type:"def",tag:n,raw:Ie(e[0],`
|
|
928
|
+
`),href:r,title:i}}}table(t){let e=this.rules.block.table.exec(t);if(!e||!this.rules.other.tableDelimiter.test(e[2]))return;let n=es(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
929
|
+
`):[],s={type:"table",raw:Ie(e[0],`
|
|
930
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let a of r)this.rules.other.tableAlignRight.test(a)?s.align.push("right"):this.rules.other.tableAlignCenter.test(a)?s.align.push("center"):this.rules.other.tableAlignLeft.test(a)?s.align.push("left"):s.align.push(null);for(let a=0;a<n.length;a++)s.header.push({text:n[a],tokens:this.lexer.inline(n[a]),header:!0,align:s.align[a]});for(let a of i)s.rows.push(es(a,s.header.length).map((c,h)=>({text:c,tokens:this.lexer.inline(c),header:!1,align:s.align[h]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:Ie(e[0],`
|
|
930
931
|
`),depth:e[2].charAt(0)==="="?1:2,text:n,tokens:this.lexer.inline(n)}}}paragraph(t){let e=this.rules.block.paragraph.exec(t);if(e){let n=e[1].charAt(e[1].length-1)===`
|
|
931
|
-
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=
|
|
932
|
-
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){
|
|
933
|
-
`:n.push(
|
|
932
|
+
`?e[1].slice(0,-1):e[1];return{type:"paragraph",raw:e[0],text:n,tokens:this.lexer.inline(n)}}}text(t){let e=this.rules.block.text.exec(t);if(e)return{type:"text",raw:e[0],text:e[0],tokens:this.lexer.inline(e[0])}}escape(t){let e=this.rules.inline.escape.exec(t);if(e)return{type:"escape",raw:e[0],text:e[1]}}tag(t){let e=this.rules.inline.tag.exec(t);if(e)return!this.lexer.state.inLink&&this.rules.other.startATag.test(e[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(e[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(e[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(e[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:e[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:e[0]}}link(t){let e=this.rules.inline.link.exec(t);if(e){let n=e[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(n)){if(!this.rules.other.endAngleBracket.test(n))return;let s=Ie(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Ma(e[2],"()");if(s===-2)return;if(s>-1){let a=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,a).trim(),e[3]=""}}let r=e[2],i="";if(this.options.pedantic){let s=this.rules.other.pedanticHrefTitle.exec(r);s&&(r=s[1],i=s[3])}else i=e[3]?e[3].slice(1,-1):"";return r=r.trim(),this.rules.other.startAngleBracket.test(r)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(n)?r=r.slice(1):r=r.slice(1,-1)),ns(e,{href:r&&r.replace(this.rules.inline.anyPunctuation,"$1"),title:i&&i.replace(this.rules.inline.anyPunctuation,"$1")},e[0],this.lexer,this.rules)}}reflink(t,e){let n;if((n=this.rules.inline.reflink.exec(t))||(n=this.rules.inline.nolink.exec(t))){let r=(n[2]||n[1]).replace(this.rules.other.multipleSpaceGlobal," "),i=e[r.toLowerCase()];if(!i){let s=n[0].charAt(0);return{type:"text",raw:s,text:s}}return ns(n,i,n[0],this.lexer,this.rules)}}emStrong(t,e,n=""){let r=this.rules.inline.emStrongLDelim.exec(t);if(!(!r||!r[1]&&!r[2]&&!r[3]&&!r[4]||r[4]&&n.match(this.rules.other.unicodeAlphaNumeric))&&(!(r[1]||r[3])||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,a,c=i,h=0,l=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(l.lastIndex=0,e=e.slice(-1*t.length+i);(r=l.exec(e))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(a=[...s].length,r[3]||r[4]){c+=a;continue}else if((r[5]||r[6])&&i%3&&!((i+a)%3)){h+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c+h);let g=[...r[0]][0].length,f=t.slice(0,i+r.index+g+a);if(Math.min(i,a)%2){let m=f.slice(1,-1);return{type:"em",raw:f,text:m,tokens:this.lexer.inlineTokens(m)}}let p=f.slice(2,-2);return{type:"strong",raw:f,text:p,tokens:this.lexer.inlineTokens(p)}}}}codespan(t){let e=this.rules.inline.code.exec(t);if(e){let n=e[2].replace(this.rules.other.newLineCharGlobal," "),r=this.rules.other.nonSpaceChar.test(n),i=this.rules.other.startingSpaceChar.test(n)&&this.rules.other.endingSpaceChar.test(n);return r&&i&&(n=n.substring(1,n.length-1)),{type:"codespan",raw:e[0],text:n}}}br(t){let e=this.rules.inline.br.exec(t);if(e)return{type:"br",raw:e[0]}}del(t,e,n=""){let r=this.rules.inline.delLDelim.exec(t);if(r&&(!r[1]||!n||this.rules.inline.punctuation.exec(n))){let i=[...r[0]].length-1,s,a,c=i,h=this.rules.inline.delRDelim;for(h.lastIndex=0,e=e.slice(-1*t.length+i);(r=h.exec(e))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s||(a=[...s].length,a!==i))continue;if(r[3]||r[4]){c+=a;continue}if(c-=a,c>0)continue;a=Math.min(a,a+c);let l=[...r[0]][0].length,g=t.slice(0,i+r.index+l+a),f=g.slice(i,-i);return{type:"del",raw:g,text:f,tokens:this.lexer.inlineTokens(f)}}}}autolink(t){let e=this.rules.inline.autolink.exec(t);if(e){let n,r;return e[2]==="@"?(n=e[1],r="mailto:"+n):(n=e[1],r=n),{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}url(t){let e;if(e=this.rules.inline.url.exec(t)){let n,r;if(e[2]==="@")n=e[0],r="mailto:"+n;else{let i;do i=e[0],e[0]=this.rules.inline._backpedal.exec(e[0])?.[0]??"";while(i!==e[0]);n=e[0],e[1]==="www."?r="http://"+e[0]:r=e[0]}return{type:"link",raw:e[0],text:n,href:r,tokens:[{type:"text",raw:n,text:n}]}}}inlineText(t){let e=this.rules.inline.text.exec(t);if(e){let n=this.lexer.state.inRawBlock;return{type:"text",raw:e[0],text:e[0],escaped:n}}}},ue=class Yn{constructor(e){k(this,"tokens");k(this,"options");k(this,"state");k(this,"inlineQueue");k(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||ze,this.options.tokenizer=this.options.tokenizer||new Vt,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,top:!0};let n={other:ee,block:Gt.normal,inline:ht.normal};this.options.pedantic?(n.block=Gt.pedantic,n.inline=ht.pedantic):this.options.gfm&&(n.block=Gt.gfm,this.options.breaks?n.inline=ht.breaks:n.inline=ht.gfm),this.tokenizer.rules=n}static get rules(){return{block:Gt,inline:ht}}static lex(e,n){return new Yn(n).lex(e)}static lexInline(e,n){return new Yn(n).inlineTokens(e)}lex(e){e=e.replace(ee.carriageReturn,`
|
|
933
|
+
`),this.blockTokens(e,this.tokens);for(let n=0;n<this.inlineQueue.length;n++){let r=this.inlineQueue[n];this.inlineTokens(r.src,r.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(e,n=[],r=!1){this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(ee.tabCharGlobal," ").replace(ee.spaceLine,""));let i=1/0;for(;e;){if(e.length<i)i=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}let s;if(this.options.extensions?.block?.some(c=>(s=c.call({lexer:this},e,n))?(e=e.substring(s.raw.length),n.push(s),!0):!1))continue;if(s=this.tokenizer.space(e)){e=e.substring(s.raw.length);let c=n.at(-1);s.raw.length===1&&c!==void 0?c.raw+=`
|
|
934
|
+
`:n.push(s);continue}if(s=this.tokenizer.code(e)){e=e.substring(s.raw.length);let c=n.at(-1);c?.type==="paragraph"||c?.type==="text"?(c.raw+=(c.raw.endsWith(`
|
|
934
935
|
`)?"":`
|
|
935
|
-
`)+
|
|
936
|
-
`+
|
|
936
|
+
`)+s.raw,c.text+=`
|
|
937
|
+
`+s.text,this.inlineQueue.at(-1).src=c.text):n.push(s);continue}if(s=this.tokenizer.fences(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.heading(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.hr(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.blockquote(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.list(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.html(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.def(e)){e=e.substring(s.raw.length);let c=n.at(-1);c?.type==="paragraph"||c?.type==="text"?(c.raw+=(c.raw.endsWith(`
|
|
937
938
|
`)?"":`
|
|
938
|
-
`)+
|
|
939
|
-
`+
|
|
939
|
+
`)+s.raw,c.text+=`
|
|
940
|
+
`+s.raw,this.inlineQueue.at(-1).src=c.text):this.tokens.links[s.tag]||(this.tokens.links[s.tag]={href:s.href,title:s.title},n.push(s));continue}if(s=this.tokenizer.table(e)){e=e.substring(s.raw.length),n.push(s);continue}if(s=this.tokenizer.lheading(e)){e=e.substring(s.raw.length),n.push(s);continue}let a=e;if(this.options.extensions?.startBlock){let c=1/0,h=e.slice(1),l;this.options.extensions.startBlock.forEach(g=>{l=g.call({lexer:this},h),typeof l=="number"&&l>=0&&(c=Math.min(c,l))}),c<1/0&&c>=0&&(a=e.substring(0,c+1))}if(this.state.top&&(s=this.tokenizer.paragraph(a))){let c=n.at(-1);r&&c?.type==="paragraph"?(c.raw+=(c.raw.endsWith(`
|
|
940
941
|
`)?"":`
|
|
941
|
-
`)+
|
|
942
|
-
`+
|
|
942
|
+
`)+s.raw,c.text+=`
|
|
943
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(s),r=a.length!==e.length,e=e.substring(s.raw.length);continue}if(s=this.tokenizer.text(e)){e=e.substring(s.raw.length);let c=n.at(-1);c?.type==="text"?(c.raw+=(c.raw.endsWith(`
|
|
943
944
|
`)?"":`
|
|
944
|
-
`)+
|
|
945
|
-
`+
|
|
946
|
-
`;return r?'<pre><code class="language-'+
|
|
947
|
-
`:"<pre><code>"+(n?i:
|
|
945
|
+
`)+s.raw,c.text+=`
|
|
946
|
+
`+s.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=c.text):n.push(s);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return this.state.top=!0,n}inline(e,n=[]){return this.inlineQueue.push({src:e,tokens:n}),n}inlineTokens(e,n=[]){this.tokenizer.lexer=this;let r=e,i=null;if(this.tokens.links){let l=Object.keys(this.tokens.links);if(l.length>0)for(;(i=this.tokenizer.rules.inline.reflinkSearch.exec(r))!==null;)l.includes(i[0].slice(i[0].lastIndexOf("[")+1,-1))&&(r=r.slice(0,i.index)+"["+"a".repeat(i[0].length-2)+"]"+r.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(i=this.tokenizer.rules.inline.anyPunctuation.exec(r))!==null;)r=r.slice(0,i.index)+"++"+r.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);let s;for(;(i=this.tokenizer.rules.inline.blockSkip.exec(r))!==null;)s=i[2]?i[2].length:0,r=r.slice(0,i.index+s)+"["+"a".repeat(i[0].length-s-2)+"]"+r.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);r=this.options.hooks?.emStrongMask?.call({lexer:this},r)??r;let a=!1,c="",h=1/0;for(;e;){if(e.length<h)h=e.length;else{this.infiniteLoopError(e.charCodeAt(0));break}a||(c=""),a=!1;let l;if(this.options.extensions?.inline?.some(f=>(l=f.call({lexer:this},e,n))?(e=e.substring(l.raw.length),n.push(l),!0):!1))continue;if(l=this.tokenizer.escape(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.tag(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.link(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.reflink(e,this.tokens.links)){e=e.substring(l.raw.length);let f=n.at(-1);l.type==="text"&&f?.type==="text"?(f.raw+=l.raw,f.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,r,c)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.codespan(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.br(e)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.del(e,r,c)){e=e.substring(l.raw.length),n.push(l);continue}if(l=this.tokenizer.autolink(e)){e=e.substring(l.raw.length),n.push(l);continue}if(!this.state.inLink&&(l=this.tokenizer.url(e))){e=e.substring(l.raw.length),n.push(l);continue}let g=e;if(this.options.extensions?.startInline){let f=1/0,p=e.slice(1),m;this.options.extensions.startInline.forEach(x=>{m=x.call({lexer:this},p),typeof m=="number"&&m>=0&&(f=Math.min(f,m))}),f<1/0&&f>=0&&(g=e.substring(0,f+1))}if(l=this.tokenizer.inlineText(g)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(c=l.raw.slice(-1)),a=!0;let f=n.at(-1);f?.type==="text"?(f.raw+=l.raw,f.text+=l.text):n.push(l);continue}if(e){this.infiniteLoopError(e.charCodeAt(0));break}}return n}infiniteLoopError(e){let n="Infinite loop on byte: "+e;if(this.options.silent)console.error(n);else throw new Error(n)}},Xt=class{constructor(t){k(this,"options");k(this,"parser");this.options=t||ze}space(t){return""}code({text:t,lang:e,escaped:n}){let r=(e||"").match(ee.notSpaceStart)?.[0],i=t.replace(ee.endingNewline,"")+`
|
|
947
|
+
`;return r?'<pre><code class="language-'+me(r)+'">'+(n?i:me(i,!0))+`</code></pre>
|
|
948
|
+
`:"<pre><code>"+(n?i:me(i,!0))+`</code></pre>
|
|
948
949
|
`}blockquote({tokens:t}){return`<blockquote>
|
|
949
950
|
${this.parser.parse(t)}</blockquote>
|
|
950
951
|
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
951
952
|
`}hr(t){return`<hr>
|
|
952
|
-
`}list(t){let e=t.ordered,n=t.start,r="";for(let
|
|
953
|
+
`}list(t){let e=t.ordered,n=t.start,r="";for(let a=0;a<t.items.length;a++){let c=t.items[a];r+=this.listitem(c)}let i=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
|
|
953
954
|
`+r+"</"+i+`>
|
|
954
955
|
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
955
956
|
`}checkbox({checked:t}){return"<input "+(t?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:t}){return`<p>${this.parser.parseInline(t)}</p>
|
|
956
|
-
`}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let r="";for(let i=0;i<t.rows.length;i++){let s=t.rows[i];n="";for(let
|
|
957
|
+
`}table(t){let e="",n="";for(let i=0;i<t.header.length;i++)n+=this.tablecell(t.header[i]);e+=this.tablerow({text:n});let r="";for(let i=0;i<t.rows.length;i++){let s=t.rows[i];n="";for(let a=0;a<s.length;a++)n+=this.tablecell(s[a]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
957
958
|
<thead>
|
|
958
959
|
`+e+`</thead>
|
|
959
960
|
`+r+`</table>
|
|
960
961
|
`}tablerow({text:t}){return`<tr>
|
|
961
962
|
${t}</tr>
|
|
962
963
|
`}tablecell(t){let e=this.parser.parseInline(t.tokens),n=t.header?"th":"td";return(t.align?`<${n} align="${t.align}">`:`<${n}>`)+e+`</${n}>
|
|
963
|
-
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${
|
|
964
|
-
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+ce(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},Re=new Gn;function C(t,e){return Re.parse(t,e)}C.options=C.setOptions=function(t){return Re.setOptions(t),C.defaults=Re.defaults,Di(C.defaults),C};C.getDefaults=Nn;C.defaults=Ce;C.use=function(...t){return Re.use(...t),C.defaults=Re.defaults,Di(C.defaults),C};C.walkTokens=function(t,e){return Re.walkTokens(t,e)};C.parseInline=Re.parseInline;C.Parser=se;C.parser=se.parse;C.Renderer=Ft;C.TextRenderer=Wn;C.Lexer=ie;C.lexer=ie.lex;C.Tokenizer=zt;C.Hooks=ot;C.parse=C;var Ia=C.options,Ra=C.setOptions,Ca=C.use,La=C.walkTokens,$a=C.parseInline;var Da=se.parse,Pa=ie.lex;var Ho=new Gn({async:!1,gfm:!0,breaks:!0});typeof window<"u"&&$n.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&(t.setAttribute("target","_blank"),t.setAttribute("rel","noopener noreferrer"))});function qn(t){let e=Ho.parse(t);return $n.sanitize(e,{USE_PROFILES:{html:!0}})}function ji(t){let e=new Date(t),n=new Date;return e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate()?e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):e.toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Uo({name:t,imageUrl:e}){return e?c("div",{class:"sr-avatar",children:c("img",{src:e,alt:t})}):c("div",{class:"sr-avatar",children:t.charAt(0).toUpperCase()})}function Bo(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function jo({attachment:t}){let e=t.mimeType.startsWith("image/");return c("div",{class:"sr-file-preview",children:[e&&t.url&&c("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",class:"sr-file-preview-image",children:c("img",{src:t.url,alt:t.fileName})}),c("div",{class:"sr-file-preview-row",children:[c("svg",{class:"sr-file-preview-icon",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[c("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),c("polyline",{points:"14 2 14 8 20 8",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]}),c("div",{class:"sr-file-preview-info",children:[t.url?c("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",class:"sr-file-preview-name",children:t.fileName}):c("span",{class:"sr-file-preview-name",children:t.fileName}),c("span",{class:"sr-file-preview-size",children:Bo(t.fileSize)})]}),t.url&&c("a",{href:t.url,download:t.fileName,target:"_blank",rel:"noopener noreferrer",class:"sr-file-preview-download","aria-label":"Download",children:c("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]})}function Wi({messageId:t}){let r=(Ae().activeConversation?.attachments??[]).filter(i=>i.messageId===t);return r.length===0?null:c("div",{class:"sr-message-attachments",children:r.map(i=>c(jo,{attachment:i},i.id))})}function Wo({preview:t}){let e="";try{e=new URL(t.url).hostname.replace(/^www\./,"")}catch{}return c("a",{class:"sr-link-preview",href:t.url,target:"_blank",rel:"noopener noreferrer",children:[t.image&&c("div",{class:"sr-link-preview-img",children:c("img",{src:t.image,alt:"",loading:"lazy",onError:n=>{let r=n.currentTarget.parentElement;r&&(r.style.display="none")}})}),c("div",{class:"sr-link-preview-body",children:[c("div",{class:"sr-link-preview-site",children:[t.favicon?c("img",{class:"sr-link-preview-favicon",src:t.favicon,alt:"",onError:n=>{n.currentTarget.style.display="none"}}):null,c("span",{children:t.siteName??e})]}),t.title&&c("p",{class:"sr-link-preview-title",children:t.title}),t.description&&c("p",{class:"sr-link-preview-desc",children:t.description})]})]})}function Go({msg:t}){let e=t.senderType==="user",n=t.senderType==="agent"?t.agentName??t.senderName??"Support":null,r=e?"You":n??"Support",i=Ee(()=>qn(t.body),[t.body]),s=t.body==="(attachment)",o=Ee(()=>{let l=t.metadata?.articles;return!Array.isArray(l)||l.length===0?null:l},[t.metadata]),u=Ee(()=>{let l=t.metadata?.linkPreview;if(!l||typeof l!="object")return null;let p=l;return typeof p.url!="string"?null:p},[t.metadata]);return c("div",{class:`sr-message-row ${e?"sr-message-row-user":"sr-message-row-agent"}`,children:[!s&&c("div",{class:"sr-message sr-prose",dangerouslySetInnerHTML:{__html:i}}),c(Wi,{messageId:t.id}),o&&c(Gi,{articles:o}),u&&c(Wo,{preview:u}),c("div",{class:"sr-message-meta",children:[!e&&c(Uo,{name:r,imageUrl:t.agentAvatarUrl}),c("span",{class:"sr-message-sender",children:r}),c("span",{children:"\xB7"}),c("span",{children:ji(t.createdAt)})]})]})}function qo({ticketId:t}){let[e,n]=z(""),[r,i]=z(!1),[s,o]=z([]),[u,l]=z(!1),p=Ve(null),h=fe(async _=>{let E=_.target,w=E.files;if(w){for(let v=0;v<w.length&&s.length+v<5;v++){l(!0);try{let T=await Rt(w[v]);o(D=>[...D,T])}catch{}finally{l(!1)}}E.value=""}},[s.length]),d=fe(async()=>{if(!(!e.trim()&&s.length===0||r)){i(!0);try{await ai(t,e.trim()||"(attachment)",s.length?s:void 0),n(""),o([]);let _=await vn(t);J({activeConversation:_})}catch{}finally{i(!1)}}},[e,r,t,s]),m=fe(_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),d())},[d]),g=(!!e.trim()||s.length>0)&&!r;return c("div",{class:"sr-composer",children:[(s.length>0||u)&&c("div",{class:"sr-attachment-pills",children:[s.map(_=>c("div",{class:"sr-attachment-pill",children:[c("svg",{class:"sr-attachment-pill-icon",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})}),c("span",{class:"sr-attachment-pill-name",children:_.fileName}),c("button",{type:"button",class:"sr-attachment-pill-remove",onClick:()=>o(E=>E.filter(w=>w.storageKey!==_.storageKey)),"aria-label":"Remove",children:c("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M18 6L6 18M6 6l12 12",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})})})]},_.storageKey)),u&&c("div",{class:"sr-attachment-pill",children:c("span",{class:"sr-attachment-pill-name",children:"Uploading..."})})]}),c("div",{class:"sr-composer-wrap",children:[c("textarea",{value:e,onInput:_=>n(_.target.value),onKeyDown:m,placeholder:"Ask about this issue...",rows:3}),c("button",{type:"button",class:"sr-attach-btn sr-attach-btn-left",onClick:()=>p.current?.click(),"aria-label":"Attach file",disabled:s.length>=5,children:c("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})})}),c("button",{class:"sr-send-btn sr-send-btn-abs",onClick:d,disabled:!g,"aria-label":"Send",children:c("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"})})})]}),c("input",{ref:p,type:"file",multiple:!0,style:{display:"none"},onChange:h})]})}function Ko({article:t}){let[e,n]=z(null),[r,i]=z(!1),[s,o]=z(!1),u=Ee(()=>e?qn(e):"",[e]),l=fe(async()=>{if(r){i(!1);return}if(e){i(!0);return}o(!0);let p=await ci(t.workspaceSlug,t.slug);if(p?.page.contentUrl)try{let h=await fetch(p.page.contentUrl);if(h.ok){let d=await h.text();n(d)}}catch{}i(!0),o(!1)},[t,e,r]);return c("div",{class:"sr-article-card",children:[c("button",{type:"button",class:"sr-article-btn",onClick:l,children:[c("svg",{class:"sr-article-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:c("path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20"})}),c("span",{class:"sr-article-title",children:t.title}),c("svg",{class:`sr-article-chevron ${r?"sr-expanded":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:c("polyline",{points:"6 9 12 15 18 9"})})]}),s&&c("div",{class:"sr-article-loading",children:"Loading..."}),r&&u&&c("div",{class:"sr-article-content sr-prose",dangerouslySetInnerHTML:{__html:u}})]})}function Gi({articles:t}){return!t||t.length===0?null:c("div",{class:"sr-suggested-articles",children:[c("div",{class:"sr-suggested-label",children:[c("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[c("circle",{cx:"12",cy:"12",r:"10"}),c("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),c("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),"These articles may help"]}),t.map(e=>c(Ko,{article:e},e.pageId))]})}function qi(){let t=Ae(),e=t.activeTicketId,n=t.activeConversation,r=Ve(null);return Se(()=>{e&&(J({loading:!0}),vn(e).then(i=>J({activeConversation:i,loading:!1})).catch(()=>J({loading:!1})))},[e]),Se(()=>{r.current?.scrollIntoView({behavior:"smooth"})},[n?.messages.length]),e?t.loading||!n?c("div",{class:"sr-loading",children:"Loading..."}):c("div",{class:"sr-thread",children:[c("div",{class:"sr-thread-messages",children:[c("div",{class:"sr-message-row sr-message-row-user",children:[c("div",{class:"sr-message sr-prose",dangerouslySetInnerHTML:{__html:qn(n.ticket.description)}}),c(Wi,{messageId:null}),c("div",{class:"sr-message-meta",children:[c("span",{class:"sr-message-sender",children:"You"}),c("span",{children:"\xB7"}),c("span",{children:ji(n.ticket.createdAt)})]})]}),n.ticket.suggestedArticles&&n.ticket.suggestedArticles.length>0&&c(Gi,{articles:n.ticket.suggestedArticles}),n.messages.map(i=>c(Go,{msg:i},i.id)),c("div",{ref:r})]}),c(qo,{ticketId:e})]}):null}function Ki({position:t,isOpen:e}){return c("button",{class:`sr-launcher ${t==="bottom-left"?"left":"right"}`,onClick:pi,"aria-label":e?"Close support":"Open support",children:e?c("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}):c("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[c("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12z"}),c("path",{d:"M7 9h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z"})]})})}function Vi(){let t=ee._getIdentity(),e=!!t.email,[n,r]=z(""),[i,s]=z(""),[o,u]=z(t.email??""),[l,p]=z(!1),[h,d]=z(null),[m,g]=z(!1),[_,E]=z(null),[w,v]=z([]),[T,D]=z(!1),A=Ve(null),U=fe(async I=>{let F=I.target,$=F.files;if($){for(let pe=0;pe<$.length&&w.length+pe<5;pe++){D(!0);try{let Le=await Rt($[pe]);v($e=>[...$e,Le])}catch{d("File upload failed")}finally{D(!1)}}F.value=""}},[w.length]),q=fe(I=>{v(F=>F.filter($=>$.storageKey!==I))},[]),ue=fe(async I=>{if(I.preventDefault(),!(!n.trim()||!i.trim())){p(!0),d(null);try{let F=await oi({subject:n.trim(),description:i.trim(),email:o.trim()||void 0,attachments:w.length?w:void 0});g(!0),E(F.id)}catch(F){d(F instanceof Error?F.message:"Something went wrong")}finally{p(!1)}}},[n,i,o,w]);if(m&&_)return c("div",{class:"sr-success",children:[c("div",{class:"sr-success-icon",children:c("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})})}),c("h4",{children:"Message sent"}),c("p",{children:"We'll get back to you soon."}),c("div",{style:{marginTop:"16px"},children:c("button",{class:"sr-btn sr-btn-primary",onClick:()=>$t(_),children:"View conversation"})})]});let ge=!!n.trim()&&!!i.trim()&&!l;return c("form",{class:"sr-form",onSubmit:ue,children:[c("div",{class:"sr-field",children:[c("label",{children:"Subject"}),c("input",{type:"text",value:n,onInput:I=>r(I.target.value),placeholder:"Brief summary",maxLength:500,required:!0})]}),c("div",{class:"sr-field sr-field-grow",children:[c("label",{children:"Description"}),c("div",{class:"sr-textarea-wrap",children:[c("textarea",{value:i,onInput:I=>s(I.target.value),placeholder:"Describe the issue or request...",maxLength:1e4,required:!0}),c("button",{type:"button",class:"sr-attach-btn sr-attach-btn-left",onClick:()=>A.current?.click(),"aria-label":"Attach file",disabled:w.length>=5,children:c("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})})}),c("button",{type:"submit",class:"sr-send-btn sr-send-btn-abs",disabled:!ge,"aria-label":"Send",children:c("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"})})})]}),c("input",{ref:A,type:"file",multiple:!0,style:{display:"none"},onChange:U})]}),(w.length>0||T)&&c("div",{class:"sr-attachment-pills",children:[w.map(I=>c("div",{class:"sr-attachment-pill",children:[c("svg",{class:"sr-attachment-pill-icon",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})}),c("span",{class:"sr-attachment-pill-name",children:I.fileName}),c("button",{type:"button",class:"sr-attachment-pill-remove",onClick:()=>q(I.storageKey),"aria-label":"Remove",children:c("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M18 6L6 18M6 6l12 12",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})})})]},I.storageKey)),T&&c("div",{class:"sr-attachment-pill",children:c("span",{class:"sr-attachment-pill-name",children:"Uploading..."})})]}),!e&&c("div",{class:"sr-field",children:[c("label",{children:"Email"}),c("input",{type:"email",value:o,onInput:I=>u(I.target.value),placeholder:"your@email.com"})]}),h&&c("div",{class:"sr-error",children:h})]})}function Vo(){return c("button",{onClick:di,"aria-label":"Back",children:c("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})})})}function Yo(){return c("button",{onClick:()=>Lt("new-ticket"),"aria-label":"New conversation",children:c("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:c("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})}function Yi({options:t}){let[,e]=z(0),n=t.position??"bottom-right",r=t.labels?.title??"How can we help?",i=n==="bottom-left"?"left":"right";Se(()=>ui(()=>e(l=>l+1)),[]);let s=Ae(),o=s.activeConversation?.ticket.subject??s.tickets.find(l=>l.id===s.activeTicketId)?.subject??"Conversation",u={conversations:r,"new-ticket":t.labels?.newTicket??"New conversation",thread:o};return c(be,{children:[c(Ki,{position:n,isOpen:s.isOpen}),s.isOpen&&c("div",{class:`sr-panel ${i}`,children:[c("div",{class:"sr-header",children:[c("div",{class:"sr-header-actions",children:(s.view==="new-ticket"||s.view==="thread")&&c(Vo,{})}),c("h3",{class:s.view==="thread"?"sr-header-title-truncate":"",children:u[s.view]}),c("div",{class:"sr-header-actions",children:s.view==="conversations"&&c(Yo,{})})]}),c("div",{class:"sr-body",children:[s.view==="conversations"&&c(hi,{}),s.view==="new-ticket"&&c(Vi,{}),s.view==="thread"&&c(qi,{})]})]})]})}var Bt=!1,we=null;function Xo(t={}){if(Bt||typeof document>"u")return;Bt=!0,we=document.createElement("div"),we.id="scoperat-widget";let e=we.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=Lr(t.theme,t.darkMode),e.appendChild(n);let r=document.createElement("div");e.appendChild(r),document.body.appendChild(we),pn(ln(Yi,{options:t}),r)}function Zo(){!Bt||!we||(pn(null,we.shadowRoot.lastElementChild),we.remove(),we=null,Bt=!1)}return hs(Qo);})();
|
|
964
|
+
`}strong({tokens:t}){return`<strong>${this.parser.parseInline(t)}</strong>`}em({tokens:t}){return`<em>${this.parser.parseInline(t)}</em>`}codespan({text:t}){return`<code>${me(t,!0)}</code>`}br(t){return"<br>"}del({tokens:t}){return`<del>${this.parser.parseInline(t)}</del>`}link({href:t,title:e,tokens:n}){let r=this.parser.parseInline(n),i=Ji(t);if(i===null)return r;t=i;let s='<a href="'+t+'"';return e&&(s+=' title="'+me(e)+'"'),s+=">"+r+"</a>",s}image({href:t,title:e,text:n,tokens:r}){r&&(n=this.parser.parseInline(r,this.parser.textRenderer));let i=Ji(t);if(i===null)return me(n);t=i;let s=`<img src="${t}" alt="${me(n)}"`;return e&&(s+=` title="${me(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:me(t.text)}},or=class{strong({text:t}){return t}em({text:t}){return t}codespan({text:t}){return t}del({text:t}){return t}html({text:t}){return t}text({text:t}){return t}link({text:t}){return""+t}image({text:t}){return""+t}br(){return""}checkbox({raw:t}){return t}},pe=class Zn{constructor(e){k(this,"options");k(this,"renderer");k(this,"textRenderer");this.options=e||ze,this.options.renderer=this.options.renderer||new Xt,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new or}static parse(e,n){return new Zn(n).parse(e)}static parseInline(e,n){return new Zn(n).parseInline(e)}parse(e){this.renderer.parser=this;let n="";for(let r=0;r<e.length;r++){let i=e[r];if(this.options.extensions?.renderers?.[i.type]){let a=i,c=this.options.extensions.renderers[a.type].call({parser:this},a);if(c!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(a.type)){n+=c||"";continue}}let s=i;switch(s.type){case"space":{n+=this.renderer.space(s);break}case"hr":{n+=this.renderer.hr(s);break}case"heading":{n+=this.renderer.heading(s);break}case"code":{n+=this.renderer.code(s);break}case"table":{n+=this.renderer.table(s);break}case"blockquote":{n+=this.renderer.blockquote(s);break}case"list":{n+=this.renderer.list(s);break}case"checkbox":{n+=this.renderer.checkbox(s);break}case"html":{n+=this.renderer.html(s);break}case"def":{n+=this.renderer.def(s);break}case"paragraph":{n+=this.renderer.paragraph(s);break}case"text":{n+=this.renderer.text(s);break}default:{let a='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(a),"";throw new Error(a)}}}return n}parseInline(e,n=this.renderer){this.renderer.parser=this;let r="";for(let i=0;i<e.length;i++){let s=e[i];if(this.options.extensions?.renderers?.[s.type]){let c=this.options.extensions.renderers[s.type].call({parser:this},s);if(c!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=c||"";continue}}let a=s;switch(a.type){case"escape":{r+=n.text(a);break}case"html":{r+=n.html(a);break}case"link":{r+=n.link(a);break}case"image":{r+=n.image(a);break}case"checkbox":{r+=n.checkbox(a);break}case"strong":{r+=n.strong(a);break}case"em":{r+=n.em(a);break}case"codespan":{r+=n.codespan(a);break}case"br":{r+=n.br(a);break}case"del":{r+=n.del(a);break}case"text":{r+=n.text(a);break}default:{let c='Token with "'+a.type+'" type was not found.';if(this.options.silent)return console.error(c),"";throw new Error(c)}}}return r}},qt,ft=(qt=class{constructor(t){k(this,"options");k(this,"block");this.options=t||ze}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?ue.lex:ue.lexInline}provideParser(t=this.block){return t?pe.parse:pe.parseInline}},k(qt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),k(qt,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),qt),ar=class{constructor(...t){k(this,"defaults",Qn());k(this,"options",this.setOptions);k(this,"parse",this.parseMarkdown(!0));k(this,"parseInline",this.parseMarkdown(!1));k(this,"Parser",pe);k(this,"Renderer",Xt);k(this,"TextRenderer",or);k(this,"Lexer",ue);k(this,"Tokenizer",Vt);k(this,"Hooks",ft);this.use(...t)}walkTokens(t,e){let n=[];for(let r of t)switch(n=n.concat(e.call(this,r)),r.type){case"table":{let i=r;for(let s of i.header)n=n.concat(this.walkTokens(s.tokens,e));for(let s of i.rows)for(let a of s)n=n.concat(this.walkTokens(a.tokens,e));break}case"list":{let i=r;n=n.concat(this.walkTokens(i.items,e));break}default:{let i=r;this.defaults.extensions?.childTokens?.[i.type]?this.defaults.extensions.childTokens[i.type].forEach(s=>{let a=i[s].flat(1/0);n=n.concat(this.walkTokens(a,e))}):i.tokens&&(n=n.concat(this.walkTokens(i.tokens,e)))}}return n}use(...t){let e=this.defaults.extensions||{renderers:{},childTokens:{}};return t.forEach(n=>{let r={...n};if(r.async=this.defaults.async||r.async||!1,n.extensions&&(n.extensions.forEach(i=>{if(!i.name)throw new Error("extension name required");if("renderer"in i){let s=e.renderers[i.name];s?e.renderers[i.name]=function(...a){let c=i.renderer.apply(this,a);return c===!1&&(c=s.apply(this,a)),c}:e.renderers[i.name]=i.renderer}if("tokenizer"in i){if(!i.level||i.level!=="block"&&i.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let s=e[i.level];s?s.unshift(i.tokenizer):e[i.level]=[i.tokenizer],i.start&&(i.level==="block"?e.startBlock?e.startBlock.push(i.start):e.startBlock=[i.start]:i.level==="inline"&&(e.startInline?e.startInline.push(i.start):e.startInline=[i.start]))}"childTokens"in i&&i.childTokens&&(e.childTokens[i.name]=i.childTokens)}),r.extensions=e),n.renderer){let i=this.defaults.renderer||new Xt(this.defaults);for(let s in n.renderer){if(!(s in i))throw new Error(`renderer '${s}' does not exist`);if(["options","parser"].includes(s))continue;let a=s,c=n.renderer[a],h=i[a];i[a]=(...l)=>{let g=c.apply(i,l);return g===!1&&(g=h.apply(i,l)),g||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new Vt(this.defaults);for(let s in n.tokenizer){if(!(s in i))throw new Error(`tokenizer '${s}' does not exist`);if(["options","rules","lexer"].includes(s))continue;let a=s,c=n.tokenizer[a],h=i[a];i[a]=(...l)=>{let g=c.apply(i,l);return g===!1&&(g=h.apply(i,l)),g}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new ft;for(let s in n.hooks){if(!(s in i))throw new Error(`hook '${s}' does not exist`);if(["options","block"].includes(s))continue;let a=s,c=n.hooks[a],h=i[a];ft.passThroughHooks.has(s)?i[a]=l=>{if(this.defaults.async&&ft.passThroughHooksRespectAsync.has(s))return(async()=>{let f=await c.call(i,l);return h.call(i,f)})();let g=c.call(i,l);return h.call(i,g)}:i[a]=(...l)=>{if(this.defaults.async)return(async()=>{let f=await c.apply(i,l);return f===!1&&(f=await h.apply(i,l)),f})();let g=c.apply(i,l);return g===!1&&(g=h.apply(i,l)),g}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(a){let c=[];return c.push(s.call(this,a)),i&&(c=c.concat(i.call(this,a))),c}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return ue.lex(t,e??this.defaults)}parser(t,e){return pe.parse(t,e??this.defaults)}parseMarkdown(t){return(e,n)=>{let r={...n},i={...this.defaults,...r},s=this.onError(!!i.silent,!!i.async);if(this.defaults.async===!0&&r.async===!1)return s(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof e>"u"||e===null)return s(new Error("marked(): input parameter is undefined or null"));if(typeof e!="string")return s(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(e)+", string expected"));if(i.hooks&&(i.hooks.options=i,i.hooks.block=t),i.async)return(async()=>{let a=i.hooks?await i.hooks.preprocess(e):e,c=await(i.hooks?await i.hooks.provideLexer(t):t?ue.lex:ue.lexInline)(a,i),h=i.hooks?await i.hooks.processAllTokens(c):c;i.walkTokens&&await Promise.all(this.walkTokens(h,i.walkTokens));let l=await(i.hooks?await i.hooks.provideParser(t):t?pe.parse:pe.parseInline)(h,i);return i.hooks?await i.hooks.postprocess(l):l})().catch(s);try{i.hooks&&(e=i.hooks.preprocess(e));let a=(i.hooks?i.hooks.provideLexer(t):t?ue.lex:ue.lexInline)(e,i);i.hooks&&(a=i.hooks.processAllTokens(a)),i.walkTokens&&this.walkTokens(a,i.walkTokens);let c=(i.hooks?i.hooks.provideParser(t):t?pe.parse:pe.parseInline)(a,i);return i.hooks&&(c=i.hooks.postprocess(c)),c}catch(a){return s(a)}}}onError(t,e){return n=>{if(n.message+=`
|
|
965
|
+
Please report this to https://github.com/markedjs/marked.`,t){let r="<p>An error occurred:</p><pre>"+me(n.message+"",!0)+"</pre>";return e?Promise.resolve(r):r}if(e)return Promise.reject(n);throw n}}},Me=new ar;function $(t,e){return Me.parse(t,e)}$.options=$.setOptions=function(t){return Me.setOptions(t),$.defaults=Me.defaults,rs($.defaults),$};$.getDefaults=Qn;$.defaults=ze;$.use=function(...t){return Me.use(...t),$.defaults=Me.defaults,rs($.defaults),$};$.walkTokens=function(t,e){return Me.walkTokens(t,e)};$.parseInline=Me.parseInline;$.Parser=pe;$.parser=pe.parse;$.Renderer=Xt;$.TextRenderer=or;$.Lexer=ue;$.lexer=ue.lex;$.Tokenizer=Vt;$.Hooks=ft;$.parse=$;var Il=$.options,Rl=$.setOptions,Cl=$.use,Ll=$.walkTokens,$l=$.parseInline;var Ol=pe.parse,Nl=ue.lex;var Ha=new ar({async:!1,gfm:!0,breaks:!0});typeof window<"u"&&Vn.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&(t.setAttribute("target","_blank"),t.setAttribute("rel","noopener noreferrer"))});function lr(t){let e=Ha.parse(t);return Vn.sanitize(e,{USE_PROFILES:{html:!0}})}function hs(t){let e=new Date(t),n=new Date;return e.getFullYear()===n.getFullYear()&&e.getMonth()===n.getMonth()&&e.getDate()===n.getDate()?e.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"}):e.toLocaleDateString(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}function Ua({name:t,imageUrl:e}){return e?u("div",{class:"sr-avatar",children:u("img",{src:e,alt:t})}):u("div",{class:"sr-avatar",children:t.charAt(0).toUpperCase()})}function Ba(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function ja({attachment:t}){let e=t.mimeType.startsWith("image/");return u("div",{class:"sr-file-preview",children:[e&&t.url&&u("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",class:"sr-file-preview-image",children:u("img",{src:t.url,alt:t.fileName})}),u("div",{class:"sr-file-preview-row",children:[u("svg",{class:"sr-file-preview-icon",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[u("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"}),u("polyline",{points:"14 2 14 8 20 8",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})]}),u("div",{class:"sr-file-preview-info",children:[t.url?u("a",{href:t.url,target:"_blank",rel:"noopener noreferrer",class:"sr-file-preview-name",children:t.fileName}):u("span",{class:"sr-file-preview-name",children:t.fileName}),u("span",{class:"sr-file-preview-size",children:Ba(t.fileSize)})]}),t.url&&u("a",{href:t.url,download:t.fileName,target:"_blank",rel:"noopener noreferrer",class:"sr-file-preview-download","aria-label":"Download",children:u("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4M7 10l5 5 5-5M12 15V3",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})})})]})]})}function fs({messageId:t}){let r=(Ne().activeConversation?.attachments??[]).filter(i=>i.messageId===t);return r.length===0?null:u("div",{class:"sr-message-attachments",children:r.map(i=>u(ja,{attachment:i},i.id))})}function Wa({preview:t}){let e="";try{e=new URL(t.url).hostname.replace(/^www\./,"")}catch{}return u("a",{class:"sr-link-preview",href:t.url,target:"_blank",rel:"noopener noreferrer",children:[t.image&&u("div",{class:"sr-link-preview-img",children:u("img",{src:t.image,alt:"",loading:"lazy",onError:n=>{let r=n.currentTarget.parentElement;r&&(r.style.display="none")}})}),u("div",{class:"sr-link-preview-body",children:[u("div",{class:"sr-link-preview-site",children:[t.favicon?u("img",{class:"sr-link-preview-favicon",src:t.favicon,alt:"",onError:n=>{n.currentTarget.style.display="none"}}):null,u("span",{children:t.siteName??e})]}),t.title&&u("p",{class:"sr-link-preview-title",children:t.title}),t.description&&u("p",{class:"sr-link-preview-desc",children:t.description})]})]})}function Ga({msg:t}){let e=t.senderType==="user",n=t.senderType==="agent"?t.agentName??t.senderName??"Support":null,r=e?"You":n??"Support",i=Oe(()=>lr(t.body),[t.body]),s=t.body==="(attachment)",a=Oe(()=>{let h=t.metadata?.articles;return!Array.isArray(h)||h.length===0?null:h},[t.metadata]),c=Oe(()=>{let h=t.metadata?.linkPreview;if(!h||typeof h!="object")return null;let l=h;return typeof l.url!="string"?null:l},[t.metadata]);return u("div",{class:`sr-message-row ${e?"sr-message-row-user":"sr-message-row-agent"}`,children:[!s&&u("div",{class:"sr-message sr-prose",dangerouslySetInnerHTML:{__html:i}}),u(fs,{messageId:t.id}),a&&u(gs,{articles:a}),c&&u(Wa,{preview:c}),u("div",{class:"sr-message-meta",children:[!e&&u(Ua,{name:r,imageUrl:t.agentAvatarUrl}),u("span",{class:"sr-message-sender",children:r}),u("span",{children:"\xB7"}),u("span",{children:hs(t.createdAt)})]})]})}function qa({ticketId:t}){let[e,n]=q(""),[r,i]=q(!1),[s,a]=q([]),[c,h]=q(!1),l=rt(null),g=xe(async x=>{let E=x.target,y=E.files;if(y){for(let S=0;S<y.length&&s.length+S<5;S++){h(!0);try{let v=await Ht(y[S]);a(N=>[...N,v])}catch{}finally{h(!1)}}E.value=""}},[s.length]),f=xe(async()=>{if(!(!e.trim()&&s.length===0||r)){i(!0);try{await Ei(t,e.trim()||"(attachment)",s.length?s:void 0),n(""),a([]);let x=await Fn(t);ie({activeConversation:x})}catch{}finally{i(!1)}}},[e,r,t,s]),p=xe(x=>{x.key==="Enter"&&!x.shiftKey&&(x.preventDefault(),f())},[f]),m=(!!e.trim()||s.length>0)&&!r;return u("div",{class:"sr-composer",children:[(s.length>0||c)&&u("div",{class:"sr-attachment-pills",children:[s.map(x=>u("div",{class:"sr-attachment-pill",children:[u("svg",{class:"sr-attachment-pill-icon",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})}),u("span",{class:"sr-attachment-pill-name",children:x.fileName}),u("button",{type:"button",class:"sr-attachment-pill-remove",onClick:()=>a(E=>E.filter(y=>y.storageKey!==x.storageKey)),"aria-label":"Remove",children:u("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M18 6L6 18M6 6l12 12",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})})})]},x.storageKey)),c&&u("div",{class:"sr-attachment-pill",children:u("span",{class:"sr-attachment-pill-name",children:"Uploading..."})})]}),u("div",{class:"sr-composer-wrap",children:[u("textarea",{value:e,onInput:x=>n(x.target.value),onKeyDown:p,placeholder:"Ask about this issue...",rows:3}),u("button",{type:"button",class:"sr-attach-btn sr-attach-btn-left",onClick:()=>l.current?.click(),"aria-label":"Attach file",disabled:s.length>=5,children:u("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})})}),u("button",{class:"sr-send-btn sr-send-btn-abs",onClick:f,disabled:!m,"aria-label":"Send",children:u("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"})})})]}),u("input",{ref:l,type:"file",multiple:!0,style:{display:"none"},onChange:g})]})}function Ka({article:t}){let[e,n]=q(null),[r,i]=q(!1),[s,a]=q(!1),c=Oe(()=>e?lr(e):"",[e]),h=xe(async()=>{if(r){i(!1);return}if(e){i(!0);return}a(!0);let l=await Ii(t.workspaceSlug,t.slug);if(l?.page.contentUrl)try{let g=await fetch(l.page.contentUrl);if(g.ok){let f=await g.text();n(f)}}catch{}i(!0),a(!1)},[t,e,r]);return u("div",{class:"sr-article-card",children:[u("button",{type:"button",class:"sr-article-btn",onClick:h,children:[u("svg",{class:"sr-article-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:u("path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20"})}),u("span",{class:"sr-article-title",children:t.title}),u("svg",{class:`sr-article-chevron ${r?"sr-expanded":""}`,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:u("polyline",{points:"6 9 12 15 18 9"})})]}),s&&u("div",{class:"sr-article-loading",children:"Loading..."}),r&&c&&u("div",{class:"sr-article-content sr-prose",dangerouslySetInnerHTML:{__html:c}})]})}function gs({articles:t}){return!t||t.length===0?null:u("div",{class:"sr-suggested-articles",children:[u("div",{class:"sr-suggested-label",children:[u("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round",children:[u("circle",{cx:"12",cy:"12",r:"10"}),u("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),u("line",{x1:"12",y1:"17",x2:"12.01",y2:"17"})]}),"These articles may help"]}),t.map(e=>u(Ka,{article:e},e.pageId))]})}function ms(){let t=Ne(),e=t.activeTicketId,n=t.activeConversation,r=rt(null);return $e(()=>{e&&(ie({loading:!0}),Fn(e).then(i=>ie({activeConversation:i,loading:!1})).catch(()=>ie({loading:!1})))},[e]),$e(()=>{r.current?.scrollIntoView({behavior:"smooth"})},[n?.messages.length]),e?t.loading||!n?u("div",{class:"sr-loading",children:"Loading..."}):u("div",{class:"sr-thread",children:[u("div",{class:"sr-thread-messages",children:[u("div",{class:"sr-message-row sr-message-row-user",children:[u("div",{class:"sr-message sr-prose",dangerouslySetInnerHTML:{__html:lr(n.ticket.description)}}),u(fs,{messageId:null}),u("div",{class:"sr-message-meta",children:[u("span",{class:"sr-message-sender",children:"You"}),u("span",{children:"\xB7"}),u("span",{children:hs(n.ticket.createdAt)})]})]}),n.ticket.suggestedArticles&&n.ticket.suggestedArticles.length>0&&u(gs,{articles:n.ticket.suggestedArticles}),n.messages.map(i=>u(Ga,{msg:i},i.id)),u("div",{ref:r})]}),u(qa,{ticketId:e})]}):null}function _s({position:t,isOpen:e}){return u("button",{class:`sr-launcher ${t==="bottom-left"?"left":"right"}`,onClick:Ci,"aria-label":e?"Close support":"Open support",children:e?u("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})}):u("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:[u("path",{d:"M20 2H4c-1.1 0-2 .9-2 2v18l4-4h14c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 14H5.17L4 17.17V4h16v12z"}),u("path",{d:"M7 9h2v2H7zm4 0h2v2h-2zm4 0h2v2h-2z"})]})})}function bs(){let t=oe._getIdentity(),e=!!t.email,[n,r]=q(""),[i,s]=q(""),[a,c]=q(t.email??""),[h,l]=q(!1),[g,f]=q(null),[p,m]=q(!1),[x,E]=q(null),[y,S]=q([]),[v,N]=q(!1),D=rt(null),P=xe(async M=>{let O=M.target,J=O.files;if(J){for(let le=0;le<J.length&&y.length+le<5;le++){N(!0);try{let Jt=await Ht(J[le]);S(en=>[...en,Jt])}catch{f("File upload failed")}finally{N(!1)}}O.value=""}},[y.length]),C=xe(M=>{S(O=>O.filter(J=>J.storageKey!==M))},[]),re=xe(async M=>{if(M.preventDefault(),!(!n.trim()||!i.trim())){l(!0),f(null);try{let O=await Si({subject:n.trim(),description:i.trim(),email:a.trim()||void 0,attachments:y.length?y:void 0});m(!0),E(O.id)}catch(O){f(O instanceof Error?O.message:"Something went wrong")}finally{l(!1)}}},[n,i,a,y]);if(p&&x)return u("div",{class:"sr-success",children:[u("div",{class:"sr-success-icon",children:u("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"})})}),u("h4",{children:"Message sent"}),u("p",{children:"We'll get back to you soon."}),u("div",{style:{marginTop:"16px"},children:u("button",{class:"sr-btn sr-btn-primary",onClick:()=>jt(x),children:"View conversation"})})]});let ae=!!n.trim()&&!!i.trim()&&!h;return u("form",{class:"sr-form",onSubmit:re,children:[u("div",{class:"sr-field",children:[u("label",{children:"Subject"}),u("input",{type:"text",value:n,onInput:M=>r(M.target.value),placeholder:"Brief summary",maxLength:500,required:!0})]}),u("div",{class:"sr-field sr-field-grow",children:[u("label",{children:"Description"}),u("div",{class:"sr-textarea-wrap",children:[u("textarea",{value:i,onInput:M=>s(M.target.value),placeholder:"Describe the issue or request...",maxLength:1e4,required:!0}),u("button",{type:"button",class:"sr-attach-btn sr-attach-btn-left",onClick:()=>D.current?.click(),"aria-label":"Attach file",disabled:y.length>=5,children:u("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})})}),u("button",{type:"submit",class:"sr-send-btn sr-send-btn-abs",disabled:!ae,"aria-label":"Send",children:u("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z"})})})]}),u("input",{ref:D,type:"file",multiple:!0,style:{display:"none"},onChange:P})]}),(y.length>0||v)&&u("div",{class:"sr-attachment-pills",children:[y.map(M=>u("div",{class:"sr-attachment-pill",children:[u("svg",{class:"sr-attachment-pill-icon",viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 01-8.49-8.49l9.19-9.19a4 4 0 015.66 5.66l-9.2 9.19a2 2 0 01-2.83-2.83l8.49-8.48",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"})}),u("span",{class:"sr-attachment-pill-name",children:M.fileName}),u("button",{type:"button",class:"sr-attachment-pill-remove",onClick:()=>C(M.storageKey),"aria-label":"Remove",children:u("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M18 6L6 18M6 6l12 12",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round"})})})]},M.storageKey)),v&&u("div",{class:"sr-attachment-pill",children:u("span",{class:"sr-attachment-pill-name",children:"Uploading..."})})]}),!e&&u("div",{class:"sr-field",children:[u("label",{children:"Email"}),u("input",{type:"email",value:a,onInput:M=>c(M.target.value),placeholder:"your@email.com"})]}),g&&u("div",{class:"sr-error",children:g})]})}function Va(){return u("button",{onClick:Li,"aria-label":"Back",children:u("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"})})})}function Xa(){return u("button",{onClick:()=>Bt("new-ticket"),"aria-label":"New conversation",children:u("svg",{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:u("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z"})})})}function xs({options:t}){let[,e]=q(0),n=t.position??"bottom-right",r=t.labels?.title??"How can we help?",i=n==="bottom-left"?"left":"right";$e(()=>Ri(()=>e(h=>h+1)),[]);let s=Ne(),a=s.activeConversation?.ticket.subject??s.tickets.find(h=>h.id===s.activeTicketId)?.subject??"Conversation",c={conversations:r,"new-ticket":t.labels?.newTicket??"New conversation",thread:a};return u(Te,{children:[u(_s,{position:n,isOpen:s.isOpen}),s.isOpen&&u("div",{class:`sr-panel ${i}`,children:[u("div",{class:"sr-header",children:[u("div",{class:"sr-header-actions",children:(s.view==="new-ticket"||s.view==="thread")&&u(Va,{})}),u("h3",{class:s.view==="thread"?"sr-header-title-truncate":"",children:c[s.view]}),u("div",{class:"sr-header-actions",children:s.view==="conversations"&&u(Xa,{})})]}),u("div",{class:"sr-body",children:[s.view==="conversations"&&u($i,{}),s.view==="new-ticket"&&u(bs,{}),s.view==="thread"&&u(ms,{})]})]})]})}var Qt=!1,Re=null;function Ya(t={}){if(Qt||typeof document>"u")return;Qt=!0,Re=document.createElement("div"),Re.id="scoperat-widget";let e=Re.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=Zr(t.theme,t.darkMode),e.appendChild(n);let r=document.createElement("div");e.appendChild(r),document.body.appendChild(Re),In(Sn(xs,{options:t}),r)}function Za(){!Qt||!Re||(In(null,Re.shadowRoot.lastElementChild),Re.remove(),Re=null,Qt=!1)}return Qs(Qa);})();
|
|
965
966
|
/*! Bundled license information:
|
|
966
967
|
|
|
967
968
|
dompurify/dist/purify.es.mjs:
|
|
968
|
-
(*! @license DOMPurify 3.4.
|
|
969
|
+
(*! @license DOMPurify 3.4.11 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.4.11/LICENSE *)
|
|
969
970
|
*/
|
|
970
971
|
//# sourceMappingURL=widget.global.js.map
|