@scoperat/tracker 0.1.0 → 0.2.0
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/dist/index.d.ts +163 -4
- package/dist/index.js +630 -2
- package/dist/index.js.map +1 -1
- package/dist/widget/index.d.ts +41 -0
- package/dist/widget/index.js +2633 -0
- package/dist/widget/index.js.map +1 -0
- package/dist/widget.global.js +970 -0
- package/dist/widget.global.js.map +1 -0
- package/package.json +15 -3
- package/dist/client.d.ts +0 -27
- package/dist/client.d.ts.map +0 -1
- package/dist/client.js +0 -178
- package/dist/client.js.map +0 -1
- package/dist/context.d.ts +0 -5
- package/dist/context.d.ts.map +0 -1
- package/dist/context.js +0 -24
- package/dist/context.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/types.d.ts +0 -30
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
|
@@ -0,0 +1,970 @@
|
|
|
1
|
+
"use strict";var ScopeRatWidget=(()=>{var dt=Object.defineProperty;var is=Object.getOwnPropertyDescriptor;var ss=Object.getOwnPropertyNames;var os=Object.prototype.hasOwnProperty;var as=(t,e,n)=>e in t?dt(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ls=(t,e)=>{for(var n in e)dt(t,n,{get:e[n],enumerable:!0})},cs=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of ss(e))!os.call(t,i)&&i!==n&&dt(t,i,{get:()=>e[i],enumerable:!(r=is(e,i))||r.enumerable});return t};var ps=t=>cs(dt({},"__esModule",{value:!0}),t);var b=(t,e,n)=>as(t,typeof e!="symbol"?e+"":e,n);var Yo={};ls(Yo,{destroyWidget:()=>Vo,initWidget:()=>Ko});var wt,R,br,us,xe,gr,kr,wr,tn,gt,Ge,vr,on,nn,rn,hs,xt={},bt=[],ds=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,vt=Array.isArray;function de(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?wt.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 mt(t,o,r,i,null)}function mt(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??++br,__i:-1,__u:0};return i==null&&R.vnode!=null&&R.vnode(s),s}function be(t){return t.children}function _t(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 fs(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,r=[],i=[],s=de({},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,Er(r,s,i),e.__e=e.__=null,s.__e!=n&&yr(s)}}function yr(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}),yr(t)}function mr(t){(!t.__d&&(t.__d=!0)&&xe.push(t)&&!kt.__r++||gr!=R.debounceRendering)&&((gr=R.debounceRendering)||kr)(kt)}function kt(){try{for(var t,e=1;xe.length;)xe.length>e&&xe.sort(wr),t=xe.shift(),e=xe.length,fs(t)}finally{xe.length=kt.__r=0}}function Tr(t,e,n,r,i,s,o,p,l,u,d){var h,m,g,_,E,w,v,T=r&&r.__k||bt,D=e.length;for(l=gs(n,e,T,l,D),h=0;h<D;h++)(g=n.__k[h])!=null&&(m=g.__i!=-1&&T[g.__i]||xt,g.__i=h,w=cn(t,g,m,i,s,o,p,l,u,d),_=g.__e,g.ref&&m.ref!=g.ref&&(m.ref&&pn(m.ref,null,g),d.push(g.ref,g.__c||_,g)),E==null&&_!=null&&(E=_),(v=!!(4&g.__u))||m.__k===g.__k?(l=Sr(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 gs(t,e,n,r,i){var s,o,p,l,u,d=n.length,h=d,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]=mt(null,o,null,null,null):vt(o)?o=t.__k[s]=mt(be,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[s]=mt(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,p=null,(u=o.__i=ms(o,n,l,h))!=-1&&(h--,(p=n[u])&&(p.__u|=2)),p==null||p.__v==null?(u==-1&&(i>d?m--:i<d&&m++),typeof o.type!="function"&&(o.__u|=4)):u!=l&&(u==l-1?m--:u==l+1?m++:(u>l?m--:m++,o.__u|=4))):t.__k[s]=null;if(h)for(s=0;s<d;s++)(p=n[s])!=null&&(2&p.__u)==0&&(p.__e==r&&(r=Me(p)),Ir(p,p));return r}function Sr(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=Sr(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 ms(t,e,n,r){var i,s,o,p=t.key,l=t.type,u=e[n],d=u!=null&&(2&u.__u)==0;if(u===null&&p==null||d&&p==u.key&&l==u.type)return n;if(r>(d?1:0)){for(i=n-1,s=n+1;i>=0||s<e.length;)if((u=e[o=i>=0?i--:s++])!=null&&(2&u.__u)==0&&p==u.key&&l==u.type)return o}return-1}function _r(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||ds.test(e)?n:n+"px"}function ft(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||_r(t.style,e,"");if(n)for(e in n)r&&n[e]==r[e]||_r(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(vr,"$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 xr(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[gt]==null)e[gt]=on++;else if(e[gt]<n[Ge])return;return n(R.event?R.event(e):e)}}}function cn(t,e,n,r,i,s,o,p,l,u){var d,h,m,g,_,E,w,v,T,D,A,B,q,pe,ge,I=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(l=!!(32&n.__u),s=[p=e.__e=n.__e]),(d=R.__b)&&d(e);e:if(typeof I=="function")try{if(v=e.props,T=I.prototype&&I.prototype.render,D=(d=I.contextType)&&r[d.__c],A=d?D?D.props.value:d.__:r,n.__c?w=(h=e.__c=n.__c).__=h.__E:(T?e.__c=h=new I(v,A):(e.__c=h=new _t(v,A),h.constructor=I,h.render=xs),D&&D.sub(h),h.state||(h.state={}),h.__n=r,m=h.__d=!0,h.__h=[],h._sb=[]),T&&h.__s==null&&(h.__s=h.state),T&&I.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=de({},h.__s)),de(h.__s,I.getDerivedStateFromProps(v,h.__s))),g=h.props,_=h.state,h.__v=e,m)T&&I.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),T&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(T&&I.getDerivedStateFromProps==null&&v!==g&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(v,A),e.__v==n.__v||!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(v,h.__s,A)===!1){e.__v!=n.__v&&(h.props=v,h.state=h.__s,h.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(F){F&&(F.__=e)}),bt.push.apply(h.__h,h._sb),h._sb=[],h.__h.length&&o.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(v,h.__s,A),T&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(g,_,E)})}if(h.context=A,h.props=v,h.__P=t,h.__e=!1,B=R.__r,q=0,T)h.state=h.__s,h.__d=!1,B&&B(e),d=h.render(h.props,h.state,h.context),bt.push.apply(h.__h,h._sb),h._sb=[];else do h.__d=!1,B&&B(e),d=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++q<25);h.state=h.__s,h.getChildContext!=null&&(r=de(de({},r),h.getChildContext())),T&&!m&&h.getSnapshotBeforeUpdate!=null&&(E=h.getSnapshotBeforeUpdate(g,_)),pe=d!=null&&d.type===be&&d.key==null?Ar(d.props.children):d,p=Tr(t,vt(pe)?pe:[pe],e,n,r,i,s,o,p,l,u),h.base=e.__e,e.__u&=-161,h.__h.length&&o.push(h),w&&(h.__E=h.__=null)}catch(F){if(e.__v=null,l||s!=null)if(F.then){for(e.__u|=l?160:128;p&&p.nodeType==8&&p.nextSibling;)p=p.nextSibling;s[s.indexOf(p)]=null,e.__e=p}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):p=e.__e=_s(n.__e,e,n,r,i,s,o,l,u);return(d=R.diffed)&&d(e),128&e.__u?void 0:p}function sn(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(sn))}function Er(t,e,n){for(var r=0;r<n.length;r++)pn(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 Ar(t){return typeof t!="object"||t==null||t.__b>0?t:vt(t)?t.map(Ar):de({},t)}function _s(t,e,n,r,i,s,o,p,l){var u,d,h,m,g,_,E,w=n.props||xt,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(u=0;u<s.length;u++)if((g=s[u])&&"setAttribute"in g==!!T&&(T?g.localName==T:g.nodeType==3)){t=g,s[u]=null;break}}if(t==null){if(T==null)return document.createTextNode(v);t=document.createElementNS(i,T,v.is&&v),p&&(R.__m&&R.__m(e,s),p=!1),s=null}if(T==null)w===v||p&&t.data==v||(t.data=v);else{if(s=s&&wt.call(t.childNodes),!p&&s!=null)for(w={},u=0;u<t.attributes.length;u++)w[(g=t.attributes[u]).name]=g.value;for(u in w)g=w[u],u=="dangerouslySetInnerHTML"?h=g:u=="children"||u in v||u=="value"&&"defaultValue"in v||u=="checked"&&"defaultChecked"in v||ft(t,u,null,g,i);for(u in v)g=v[u],u=="children"?m=g:u=="dangerouslySetInnerHTML"?d=g:u=="value"?_=g:u=="checked"?E=g:p&&typeof g!="function"||w[u]===g||ft(t,u,g,w[u],i);if(d)p||h&&(d.__html==h.__html||d.__html==t.innerHTML)||(t.innerHTML=d.__html),e.__k=[];else if(h&&(t.innerHTML=""),Tr(e.type=="template"?t.content:t,vt(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),p,l),s!=null)for(u=s.length;u--;)an(s[u]);p||(u="value",T=="progress"&&_==null?t.removeAttribute("value"):_!=null&&(_!==t[u]||T=="progress"&&!_||T=="option"&&_!=w[u])&&ft(t,u,_,w[u],i),u="checked",E!=null&&E!=t[u]&&ft(t,u,E,w[u],i))}return t}function pn(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 Ir(t,e,n){var r,i;if(R.unmount&&R.unmount(t),(r=t.ref)&&(r.current&&r.current!=t.__e||pn(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]&&Ir(r[i],e,n||typeof t.type!="function");n||an(t.__e),t.__c=t.__=t.__e=void 0}function xs(t,e,n){return this.constructor(t,n)}function un(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||xt,xt,e.namespaceURI,!r&&n?[n]:i?null:e.firstChild?wt.call(e.childNodes):null,s,!r&&n?n:i?i.__e:e.firstChild,r,o),Er(s,t,o)}wt=bt.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(p){t=p}throw t}},br=0,us=function(t){return t!=null&&t.constructor===void 0},_t.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=de({},this.state),typeof t=="function"&&(t=t(de({},n),this.props)),t&&de(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),mr(this))},_t.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),mr(this))},_t.prototype.render=be,xe=[],kr=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,wr=function(t,e){return t.__v.__b-e.__v.__b},kt.__r=0,tn=Math.random().toString(8),gt="__d"+tn,Ge="__a"+tn,vr=/(PointerCapture)$|Capture$/i,on=0,nn=xr(!1),rn=xr(!0),hs=0;function Rr(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",p=e?"rgba(255,255,255,0.05)":"#f0f0f0",l=e?"rgba(255,255,255,0.15)":"#d1d5db",u=e?"rgba(255,255,255,0.05)":"#e5e7eb",d=e?"#3a3a3a":"#f9fafb",h=e?"#3a3a3a":"#f3f4f6",m=e?"#525252":"#e5e7eb",g=e?"#a3a3a3":"#6b7280",_=e?"#a3a3a3":"#4b5563",E=e?"#d4d4d4":"#374151",w=e?"#272727":"white";return`
|
|
2
|
+
:host {
|
|
3
|
+
all: initial;
|
|
4
|
+
font-family: ${s};
|
|
5
|
+
color: ${r};
|
|
6
|
+
font-size: 14px;
|
|
7
|
+
line-height: 1.5;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
* {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
margin: 0;
|
|
13
|
+
padding: 0;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
.sr-launcher {
|
|
17
|
+
position: fixed;
|
|
18
|
+
bottom: 20px;
|
|
19
|
+
z-index: 2147483647;
|
|
20
|
+
width: 44px;
|
|
21
|
+
height: 44px;
|
|
22
|
+
border-radius: 50%;
|
|
23
|
+
background: ${n};
|
|
24
|
+
color: white;
|
|
25
|
+
border: none;
|
|
26
|
+
cursor: pointer;
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
justify-content: center;
|
|
30
|
+
box-shadow: 0 8px 30px rgba(0,0,0,0.35), 0 4px 12px rgba(0,0,0,0.25), 0 0 0 1px rgba(0,0,0,0.05);
|
|
31
|
+
transition: transform 0.2s, box-shadow 0.2s;
|
|
32
|
+
}
|
|
33
|
+
.sr-launcher:hover {
|
|
34
|
+
transform: scale(1.05);
|
|
35
|
+
box-shadow: 0 12px 40px rgba(0,0,0,0.45), 0 6px 16px rgba(0,0,0,0.3), 0 0 0 1px rgba(0,0,0,0.05);
|
|
36
|
+
}
|
|
37
|
+
.sr-launcher.right { right: 20px; }
|
|
38
|
+
.sr-launcher.left { left: 20px; }
|
|
39
|
+
|
|
40
|
+
.sr-launcher svg {
|
|
41
|
+
width: 20px;
|
|
42
|
+
height: 20px;
|
|
43
|
+
fill: currentColor;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.sr-panel {
|
|
47
|
+
position: fixed;
|
|
48
|
+
bottom: 88px;
|
|
49
|
+
z-index: 2147483647;
|
|
50
|
+
width: 380px;
|
|
51
|
+
height: 520px;
|
|
52
|
+
max-height: calc(100vh - 120px);
|
|
53
|
+
background: ${i};
|
|
54
|
+
border-radius: 16px;
|
|
55
|
+
box-shadow: ${e?"0 8px 30px rgba(0,0,0,0.5)":"0 8px 30px rgba(0,0,0,0.12)"};
|
|
56
|
+
border: ${e?"1px solid rgba(255,255,255,0.05)":"1px solid rgba(0,0,0,0.08)"};
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: column;
|
|
59
|
+
overflow: hidden;
|
|
60
|
+
animation: sr-slide-up 0.2s ease-out;
|
|
61
|
+
}
|
|
62
|
+
.sr-panel.right { right: 20px; }
|
|
63
|
+
.sr-panel.left { left: 20px; }
|
|
64
|
+
|
|
65
|
+
@keyframes sr-slide-up {
|
|
66
|
+
from { opacity: 0; transform: translateY(12px); }
|
|
67
|
+
to { opacity: 1; transform: translateY(0); }
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.sr-header {
|
|
71
|
+
padding: 16px 20px;
|
|
72
|
+
background: ${n};
|
|
73
|
+
color: white;
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: space-between;
|
|
77
|
+
flex-shrink: 0;
|
|
78
|
+
border-radius: 16px 16px 0 0;
|
|
79
|
+
margin: -1px -1px 0 -1px;
|
|
80
|
+
}
|
|
81
|
+
.sr-header h3 {
|
|
82
|
+
font-size: 16px;
|
|
83
|
+
font-weight: 600;
|
|
84
|
+
margin: 0;
|
|
85
|
+
flex: 1;
|
|
86
|
+
min-width: 0;
|
|
87
|
+
}
|
|
88
|
+
.sr-header-title-truncate {
|
|
89
|
+
overflow: hidden;
|
|
90
|
+
text-overflow: ellipsis;
|
|
91
|
+
white-space: nowrap;
|
|
92
|
+
}
|
|
93
|
+
.sr-header-actions {
|
|
94
|
+
display: flex;
|
|
95
|
+
gap: 8px;
|
|
96
|
+
align-items: center;
|
|
97
|
+
}
|
|
98
|
+
.sr-header button {
|
|
99
|
+
background: none;
|
|
100
|
+
border: none;
|
|
101
|
+
color: white;
|
|
102
|
+
cursor: pointer;
|
|
103
|
+
padding: 4px;
|
|
104
|
+
border-radius: 4px;
|
|
105
|
+
display: flex;
|
|
106
|
+
align-items: center;
|
|
107
|
+
opacity: 0.8;
|
|
108
|
+
}
|
|
109
|
+
.sr-header button:hover { opacity: 1; }
|
|
110
|
+
.sr-header button svg { width: 18px; height: 18px; fill: currentColor; }
|
|
111
|
+
|
|
112
|
+
.sr-body {
|
|
113
|
+
flex: 1;
|
|
114
|
+
overflow-y: auto;
|
|
115
|
+
padding: 0;
|
|
116
|
+
min-height: 0;
|
|
117
|
+
display: flex;
|
|
118
|
+
flex-direction: column;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.sr-ticket-list {
|
|
122
|
+
list-style: none;
|
|
123
|
+
padding: 0;
|
|
124
|
+
}
|
|
125
|
+
.sr-ticket-item {
|
|
126
|
+
padding: 14px 20px;
|
|
127
|
+
border-bottom: 1px solid ${p};
|
|
128
|
+
cursor: pointer;
|
|
129
|
+
transition: background 0.15s;
|
|
130
|
+
}
|
|
131
|
+
.sr-ticket-item:hover { background: ${d}; }
|
|
132
|
+
.sr-ticket-item h4 {
|
|
133
|
+
font-size: 14px;
|
|
134
|
+
font-weight: 500;
|
|
135
|
+
margin-bottom: 4px;
|
|
136
|
+
color: ${r};
|
|
137
|
+
}
|
|
138
|
+
.sr-ticket-item .sr-meta {
|
|
139
|
+
font-size: 12px;
|
|
140
|
+
color: ${g};
|
|
141
|
+
display: flex;
|
|
142
|
+
gap: 8px;
|
|
143
|
+
align-items: center;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
.sr-badge {
|
|
147
|
+
font-size: 11px;
|
|
148
|
+
padding: 2px 8px;
|
|
149
|
+
border-radius: 9999px;
|
|
150
|
+
font-weight: 500;
|
|
151
|
+
}
|
|
152
|
+
.sr-badge-bug { background: ${e?"#3b1111":"#fef2f2"}; color: ${e?"#fca5a5":"#dc2626"}; }
|
|
153
|
+
.sr-badge-feature_request { background: ${e?"#052e16":"#f0fdf4"}; color: ${e?"#4ade80":"#16a34a"}; }
|
|
154
|
+
.sr-badge-question { background: ${e?"#1e2a4a":"#eff6ff"}; color: ${e?"#93c5fd":"#2563eb"}; }
|
|
155
|
+
.sr-badge-access_issue { background: ${e?"#3b2506":"#fefce8"}; color: ${e?"#fcd34d":"#ca8a04"}; }
|
|
156
|
+
.sr-badge-performance { background: ${e?"#2e0a4a":"#fdf4ff"}; color: ${e?"#c084fc":"#9333ea"}; }
|
|
157
|
+
.sr-badge-billing { background: ${e?"#042f2e":"#f0fdfa"}; color: ${e?"#5eead4":"#0d9488"}; }
|
|
158
|
+
.sr-badge-documentation { background: ${h}; color: ${g}; }
|
|
159
|
+
.sr-badge-other { background: ${h}; color: ${g}; }
|
|
160
|
+
|
|
161
|
+
.sr-empty {
|
|
162
|
+
padding: 40px 20px;
|
|
163
|
+
text-align: center;
|
|
164
|
+
color: ${g};
|
|
165
|
+
}
|
|
166
|
+
.sr-empty p { margin-bottom: 16px; font-size: 14px; }
|
|
167
|
+
|
|
168
|
+
.sr-btn {
|
|
169
|
+
display: inline-flex;
|
|
170
|
+
align-items: center;
|
|
171
|
+
justify-content: center;
|
|
172
|
+
padding: 8px 16px;
|
|
173
|
+
font-size: 14px;
|
|
174
|
+
font-weight: 500;
|
|
175
|
+
border: none;
|
|
176
|
+
border-radius: 8px;
|
|
177
|
+
cursor: pointer;
|
|
178
|
+
transition: background 0.15s;
|
|
179
|
+
}
|
|
180
|
+
.sr-btn-primary {
|
|
181
|
+
background: ${n};
|
|
182
|
+
color: white;
|
|
183
|
+
}
|
|
184
|
+
.sr-btn-primary:hover { filter: brightness(1.1); }
|
|
185
|
+
.sr-btn-primary:disabled {
|
|
186
|
+
opacity: 0.5;
|
|
187
|
+
cursor: not-allowed;
|
|
188
|
+
}
|
|
189
|
+
.sr-btn-secondary {
|
|
190
|
+
background: ${h};
|
|
191
|
+
color: ${r};
|
|
192
|
+
}
|
|
193
|
+
.sr-btn-secondary:hover { background: ${m}; }
|
|
194
|
+
|
|
195
|
+
.sr-form {
|
|
196
|
+
padding: 16px 20px;
|
|
197
|
+
display: flex;
|
|
198
|
+
flex-direction: column;
|
|
199
|
+
gap: 12px;
|
|
200
|
+
flex: 1;
|
|
201
|
+
min-height: 0;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.sr-field-grow {
|
|
205
|
+
flex: 1;
|
|
206
|
+
display: flex;
|
|
207
|
+
flex-direction: column;
|
|
208
|
+
min-height: 0;
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
.sr-field label {
|
|
212
|
+
display: block;
|
|
213
|
+
font-size: 13px;
|
|
214
|
+
font-weight: 500;
|
|
215
|
+
margin-bottom: 4px;
|
|
216
|
+
color: ${E};
|
|
217
|
+
}
|
|
218
|
+
.sr-field input,
|
|
219
|
+
.sr-field textarea,
|
|
220
|
+
.sr-field select {
|
|
221
|
+
width: 100%;
|
|
222
|
+
padding: 8px 12px;
|
|
223
|
+
border: none;
|
|
224
|
+
border-radius: 8px;
|
|
225
|
+
font-size: 14px;
|
|
226
|
+
font-family: inherit;
|
|
227
|
+
color: ${r};
|
|
228
|
+
background: ${w};
|
|
229
|
+
outline: none;
|
|
230
|
+
}
|
|
231
|
+
.sr-field input:focus,
|
|
232
|
+
.sr-field textarea:focus,
|
|
233
|
+
.sr-field select:focus {
|
|
234
|
+
box-shadow: none;
|
|
235
|
+
}
|
|
236
|
+
.sr-field textarea {
|
|
237
|
+
resize: none;
|
|
238
|
+
min-height: 160px;
|
|
239
|
+
padding-bottom: 44px;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.sr-textarea-wrap {
|
|
243
|
+
position: relative;
|
|
244
|
+
flex: 1;
|
|
245
|
+
display: flex;
|
|
246
|
+
flex-direction: column;
|
|
247
|
+
}
|
|
248
|
+
.sr-textarea-wrap textarea {
|
|
249
|
+
flex: 1;
|
|
250
|
+
}
|
|
251
|
+
.sr-send-btn {
|
|
252
|
+
width: 32px;
|
|
253
|
+
height: 32px;
|
|
254
|
+
border-radius: 50%;
|
|
255
|
+
background: ${e?"white":n};
|
|
256
|
+
color: ${e?"#121212":"white"};
|
|
257
|
+
border: none;
|
|
258
|
+
cursor: pointer;
|
|
259
|
+
display: flex;
|
|
260
|
+
align-items: center;
|
|
261
|
+
justify-content: center;
|
|
262
|
+
padding: 0;
|
|
263
|
+
transition: opacity 0.15s;
|
|
264
|
+
}
|
|
265
|
+
.sr-send-btn:disabled {
|
|
266
|
+
opacity: 0.3;
|
|
267
|
+
cursor: not-allowed;
|
|
268
|
+
}
|
|
269
|
+
.sr-send-btn svg {
|
|
270
|
+
width: 16px;
|
|
271
|
+
height: 16px;
|
|
272
|
+
fill: currentColor;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
.sr-categories {
|
|
276
|
+
display: flex;
|
|
277
|
+
flex-wrap: wrap;
|
|
278
|
+
gap: 6px;
|
|
279
|
+
}
|
|
280
|
+
.sr-category-btn {
|
|
281
|
+
padding: 6px 12px;
|
|
282
|
+
border: 1px solid ${l};
|
|
283
|
+
border-radius: 9999px;
|
|
284
|
+
font-size: 12px;
|
|
285
|
+
font-weight: 500;
|
|
286
|
+
background: ${w};
|
|
287
|
+
cursor: pointer;
|
|
288
|
+
transition: all 0.15s;
|
|
289
|
+
color: ${_};
|
|
290
|
+
}
|
|
291
|
+
.sr-category-btn.active {
|
|
292
|
+
border-color: ${n};
|
|
293
|
+
background: ${n}11;
|
|
294
|
+
color: ${n};
|
|
295
|
+
}
|
|
296
|
+
.sr-category-btn:hover { border-color: ${n}; }
|
|
297
|
+
|
|
298
|
+
.sr-thread {
|
|
299
|
+
display: flex;
|
|
300
|
+
flex-direction: column;
|
|
301
|
+
min-height: 0;
|
|
302
|
+
height: 100%;
|
|
303
|
+
}
|
|
304
|
+
.sr-thread-messages {
|
|
305
|
+
flex: 1 1 0;
|
|
306
|
+
min-height: 0;
|
|
307
|
+
overflow-y: auto;
|
|
308
|
+
padding: 16px 20px;
|
|
309
|
+
display: flex;
|
|
310
|
+
flex-direction: column;
|
|
311
|
+
gap: 0;
|
|
312
|
+
}
|
|
313
|
+
.sr-message-row {
|
|
314
|
+
display: flex;
|
|
315
|
+
flex-direction: column;
|
|
316
|
+
gap: 6px;
|
|
317
|
+
max-width: 75%;
|
|
318
|
+
}
|
|
319
|
+
.sr-message-row + .sr-message-row {
|
|
320
|
+
margin-top: 20px;
|
|
321
|
+
}
|
|
322
|
+
.sr-message-row-user {
|
|
323
|
+
align-self: flex-end;
|
|
324
|
+
align-items: flex-end;
|
|
325
|
+
}
|
|
326
|
+
.sr-message-row-agent {
|
|
327
|
+
align-self: flex-start;
|
|
328
|
+
align-items: flex-start;
|
|
329
|
+
}
|
|
330
|
+
.sr-message {
|
|
331
|
+
padding: 12px 16px;
|
|
332
|
+
background: none;
|
|
333
|
+
border: 1px solid ${u};
|
|
334
|
+
border-radius: 8px;
|
|
335
|
+
font-size: 14px;
|
|
336
|
+
line-height: 1.5;
|
|
337
|
+
word-break: break-word;
|
|
338
|
+
color: ${r};
|
|
339
|
+
}
|
|
340
|
+
.sr-message-meta {
|
|
341
|
+
display: flex;
|
|
342
|
+
align-items: center;
|
|
343
|
+
gap: 6px;
|
|
344
|
+
font-size: 11px;
|
|
345
|
+
color: ${g};
|
|
346
|
+
}
|
|
347
|
+
.sr-message-sender {
|
|
348
|
+
font-weight: 600;
|
|
349
|
+
color: ${g};
|
|
350
|
+
}
|
|
351
|
+
.sr-avatar {
|
|
352
|
+
width: 18px;
|
|
353
|
+
height: 18px;
|
|
354
|
+
border-radius: 4px;
|
|
355
|
+
background: ${n};
|
|
356
|
+
color: white;
|
|
357
|
+
font-size: 10px;
|
|
358
|
+
font-weight: 600;
|
|
359
|
+
display: flex;
|
|
360
|
+
align-items: center;
|
|
361
|
+
justify-content: center;
|
|
362
|
+
flex-shrink: 0;
|
|
363
|
+
overflow: hidden;
|
|
364
|
+
}
|
|
365
|
+
.sr-avatar img {
|
|
366
|
+
width: 100%;
|
|
367
|
+
height: 100%;
|
|
368
|
+
object-fit: cover;
|
|
369
|
+
}
|
|
370
|
+
|
|
371
|
+
.sr-original-desc {
|
|
372
|
+
padding: 12px 16px;
|
|
373
|
+
background: none;
|
|
374
|
+
border-radius: 8px;
|
|
375
|
+
border: 1px solid ${u};
|
|
376
|
+
font-size: 14px;
|
|
377
|
+
color: ${r};
|
|
378
|
+
white-space: pre-wrap;
|
|
379
|
+
word-break: break-word;
|
|
380
|
+
max-width: 75%;
|
|
381
|
+
margin-bottom: 0;
|
|
382
|
+
}
|
|
383
|
+
.sr-original-desc .sr-desc-label {
|
|
384
|
+
font-size: 11px;
|
|
385
|
+
font-weight: 600;
|
|
386
|
+
color: ${g};
|
|
387
|
+
text-transform: uppercase;
|
|
388
|
+
margin-bottom: 6px;
|
|
389
|
+
}
|
|
390
|
+
|
|
391
|
+
.sr-composer {
|
|
392
|
+
padding: 12px 20px;
|
|
393
|
+
border-top: 1px solid ${p};
|
|
394
|
+
flex-shrink: 0;
|
|
395
|
+
}
|
|
396
|
+
.sr-composer-wrap {
|
|
397
|
+
position: relative;
|
|
398
|
+
}
|
|
399
|
+
.sr-composer textarea {
|
|
400
|
+
width: 100%;
|
|
401
|
+
padding: 10px 8px;
|
|
402
|
+
padding-right: 8px;
|
|
403
|
+
padding-bottom: 40px;
|
|
404
|
+
border: 1px solid ${u};
|
|
405
|
+
border-radius: 10px;
|
|
406
|
+
font-size: 14px;
|
|
407
|
+
font-family: inherit;
|
|
408
|
+
resize: none;
|
|
409
|
+
min-height: 80px;
|
|
410
|
+
max-height: 120px;
|
|
411
|
+
outline: none;
|
|
412
|
+
color: ${r};
|
|
413
|
+
background: ${e?"#1a1a1a":w};
|
|
414
|
+
}
|
|
415
|
+
.sr-composer textarea:focus {
|
|
416
|
+
border-color: ${u};
|
|
417
|
+
box-shadow: none;
|
|
418
|
+
}
|
|
419
|
+
.sr-composer .sr-send-btn {
|
|
420
|
+
width: 26px;
|
|
421
|
+
height: 26px;
|
|
422
|
+
}
|
|
423
|
+
.sr-composer .sr-send-btn svg {
|
|
424
|
+
width: 13px;
|
|
425
|
+
height: 13px;
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
.sr-loading {
|
|
429
|
+
padding: 40px 20px;
|
|
430
|
+
text-align: center;
|
|
431
|
+
color: ${g};
|
|
432
|
+
}
|
|
433
|
+
|
|
434
|
+
.sr-error {
|
|
435
|
+
padding: 12px 20px;
|
|
436
|
+
background: ${e?"#3b1111":"#fef2f2"};
|
|
437
|
+
color: ${e?"#fca5a5":"#dc2626"};
|
|
438
|
+
font-size: 13px;
|
|
439
|
+
text-align: center;
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
.sr-success {
|
|
443
|
+
padding: 40px 20px;
|
|
444
|
+
text-align: center;
|
|
445
|
+
}
|
|
446
|
+
.sr-success-icon {
|
|
447
|
+
width: 48px;
|
|
448
|
+
height: 48px;
|
|
449
|
+
margin: 0 auto 12px;
|
|
450
|
+
background: ${e?"#052e16":"#f0fdf4"};
|
|
451
|
+
border-radius: 50%;
|
|
452
|
+
display: flex;
|
|
453
|
+
align-items: center;
|
|
454
|
+
justify-content: center;
|
|
455
|
+
}
|
|
456
|
+
.sr-success-icon svg { width: 24px; height: 24px; fill: ${e?"#4ade80":"#16a34a"}; }
|
|
457
|
+
.sr-success h4 {
|
|
458
|
+
font-size: 16px;
|
|
459
|
+
font-weight: 600;
|
|
460
|
+
margin-bottom: 4px;
|
|
461
|
+
color: ${r};
|
|
462
|
+
}
|
|
463
|
+
.sr-success p {
|
|
464
|
+
font-size: 14px;
|
|
465
|
+
color: ${g};
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.sr-form-actions {
|
|
469
|
+
display: flex;
|
|
470
|
+
gap: 8px;
|
|
471
|
+
padding-top: 4px;
|
|
472
|
+
}
|
|
473
|
+
.sr-form-actions .sr-btn { flex: 1; }
|
|
474
|
+
|
|
475
|
+
.sr-new-btn-wrap {
|
|
476
|
+
padding: 12px 20px;
|
|
477
|
+
border-bottom: 1px solid ${p};
|
|
478
|
+
}
|
|
479
|
+
.sr-new-btn-wrap .sr-btn { width: 100%; }
|
|
480
|
+
|
|
481
|
+
.sr-suggested-articles {
|
|
482
|
+
margin-top: 12px;
|
|
483
|
+
display: flex;
|
|
484
|
+
flex-direction: column;
|
|
485
|
+
gap: 6px;
|
|
486
|
+
}
|
|
487
|
+
.sr-suggested-label {
|
|
488
|
+
display: flex;
|
|
489
|
+
align-items: center;
|
|
490
|
+
gap: 6px;
|
|
491
|
+
font-size: 11px;
|
|
492
|
+
font-weight: 600;
|
|
493
|
+
color: ${g};
|
|
494
|
+
text-transform: uppercase;
|
|
495
|
+
letter-spacing: 0.03em;
|
|
496
|
+
margin-bottom: 2px;
|
|
497
|
+
}
|
|
498
|
+
.sr-suggested-label svg {
|
|
499
|
+
width: 14px;
|
|
500
|
+
height: 14px;
|
|
501
|
+
stroke: ${n};
|
|
502
|
+
fill: none;
|
|
503
|
+
}
|
|
504
|
+
.sr-article-card {
|
|
505
|
+
border: 1px solid ${u};
|
|
506
|
+
border-radius: 8px;
|
|
507
|
+
overflow: hidden;
|
|
508
|
+
background: ${o};
|
|
509
|
+
}
|
|
510
|
+
.sr-article-btn {
|
|
511
|
+
display: flex;
|
|
512
|
+
align-items: center;
|
|
513
|
+
gap: 8px;
|
|
514
|
+
width: 100%;
|
|
515
|
+
padding: 10px 12px;
|
|
516
|
+
background: none;
|
|
517
|
+
border: none;
|
|
518
|
+
cursor: pointer;
|
|
519
|
+
text-align: left;
|
|
520
|
+
font-size: 13px;
|
|
521
|
+
font-family: inherit;
|
|
522
|
+
color: ${r};
|
|
523
|
+
transition: background 0.15s;
|
|
524
|
+
}
|
|
525
|
+
.sr-article-btn:hover { background: ${d}; }
|
|
526
|
+
.sr-article-icon {
|
|
527
|
+
width: 16px;
|
|
528
|
+
height: 16px;
|
|
529
|
+
stroke: ${n};
|
|
530
|
+
fill: none;
|
|
531
|
+
flex-shrink: 0;
|
|
532
|
+
}
|
|
533
|
+
.sr-article-title {
|
|
534
|
+
flex: 1;
|
|
535
|
+
min-width: 0;
|
|
536
|
+
font-weight: 500;
|
|
537
|
+
overflow: hidden;
|
|
538
|
+
text-overflow: ellipsis;
|
|
539
|
+
white-space: nowrap;
|
|
540
|
+
}
|
|
541
|
+
.sr-article-chevron {
|
|
542
|
+
width: 14px;
|
|
543
|
+
height: 14px;
|
|
544
|
+
flex-shrink: 0;
|
|
545
|
+
stroke: ${g};
|
|
546
|
+
fill: none;
|
|
547
|
+
transition: transform 0.2s;
|
|
548
|
+
}
|
|
549
|
+
.sr-article-chevron.sr-expanded { transform: rotate(180deg); }
|
|
550
|
+
.sr-article-loading {
|
|
551
|
+
padding: 8px 12px;
|
|
552
|
+
font-size: 12px;
|
|
553
|
+
color: ${g};
|
|
554
|
+
}
|
|
555
|
+
.sr-article-content {
|
|
556
|
+
padding: 12px;
|
|
557
|
+
font-size: 13px;
|
|
558
|
+
line-height: 1.6;
|
|
559
|
+
color: ${E};
|
|
560
|
+
word-break: break-word;
|
|
561
|
+
border-top: 1px solid ${p};
|
|
562
|
+
max-height: 300px;
|
|
563
|
+
overflow-y: auto;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
.sr-link-preview {
|
|
567
|
+
display: flex;
|
|
568
|
+
margin-top: 8px;
|
|
569
|
+
max-width: 420px;
|
|
570
|
+
border: 1px solid ${u};
|
|
571
|
+
border-radius: 8px;
|
|
572
|
+
overflow: hidden;
|
|
573
|
+
background: ${o};
|
|
574
|
+
text-decoration: none;
|
|
575
|
+
color: inherit;
|
|
576
|
+
transition: border-color 0.15s;
|
|
577
|
+
}
|
|
578
|
+
.sr-link-preview:hover { border-color: ${g}; }
|
|
579
|
+
.sr-link-preview-img {
|
|
580
|
+
flex-shrink: 0;
|
|
581
|
+
width: 96px;
|
|
582
|
+
border-right: 1px solid ${p};
|
|
583
|
+
}
|
|
584
|
+
.sr-link-preview-img img {
|
|
585
|
+
width: 100%;
|
|
586
|
+
height: 100%;
|
|
587
|
+
object-fit: cover;
|
|
588
|
+
display: block;
|
|
589
|
+
}
|
|
590
|
+
.sr-link-preview-body {
|
|
591
|
+
flex: 1;
|
|
592
|
+
min-width: 0;
|
|
593
|
+
display: flex;
|
|
594
|
+
flex-direction: column;
|
|
595
|
+
gap: 3px;
|
|
596
|
+
padding: 8px 10px;
|
|
597
|
+
}
|
|
598
|
+
.sr-link-preview-site {
|
|
599
|
+
display: flex;
|
|
600
|
+
align-items: center;
|
|
601
|
+
gap: 5px;
|
|
602
|
+
font-size: 10.5px;
|
|
603
|
+
color: ${g};
|
|
604
|
+
}
|
|
605
|
+
.sr-link-preview-site span {
|
|
606
|
+
overflow: hidden;
|
|
607
|
+
text-overflow: ellipsis;
|
|
608
|
+
white-space: nowrap;
|
|
609
|
+
}
|
|
610
|
+
.sr-link-preview-favicon {
|
|
611
|
+
width: 12px;
|
|
612
|
+
height: 12px;
|
|
613
|
+
border-radius: 2px;
|
|
614
|
+
flex-shrink: 0;
|
|
615
|
+
}
|
|
616
|
+
.sr-link-preview-title {
|
|
617
|
+
margin: 0;
|
|
618
|
+
font-size: 12.5px;
|
|
619
|
+
font-weight: 600;
|
|
620
|
+
color: ${r};
|
|
621
|
+
overflow: hidden;
|
|
622
|
+
text-overflow: ellipsis;
|
|
623
|
+
white-space: nowrap;
|
|
624
|
+
line-height: 1.3;
|
|
625
|
+
}
|
|
626
|
+
.sr-link-preview-desc {
|
|
627
|
+
margin: 0;
|
|
628
|
+
font-size: 11.5px;
|
|
629
|
+
color: ${g};
|
|
630
|
+
line-height: 1.4;
|
|
631
|
+
display: -webkit-box;
|
|
632
|
+
-webkit-line-clamp: 2;
|
|
633
|
+
-webkit-box-orient: vertical;
|
|
634
|
+
overflow: hidden;
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.sr-prose h1, .sr-prose h2, .sr-prose h3,
|
|
638
|
+
.sr-prose h4, .sr-prose h5, .sr-prose h6 {
|
|
639
|
+
margin-top: 1em;
|
|
640
|
+
margin-bottom: 0.5em;
|
|
641
|
+
font-weight: 600;
|
|
642
|
+
line-height: 1.3;
|
|
643
|
+
color: ${r};
|
|
644
|
+
}
|
|
645
|
+
.sr-prose h1 { font-size: 1.35em; }
|
|
646
|
+
.sr-prose h2 { font-size: 1.2em; }
|
|
647
|
+
.sr-prose h3 { font-size: 1.1em; }
|
|
648
|
+
.sr-prose h4, .sr-prose h5, .sr-prose h6 { font-size: 1em; }
|
|
649
|
+
.sr-prose h1:first-child, .sr-prose h2:first-child,
|
|
650
|
+
.sr-prose h3:first-child { margin-top: 0; }
|
|
651
|
+
|
|
652
|
+
.sr-prose p { margin: 0.5em 0; }
|
|
653
|
+
.sr-prose p:first-child { margin-top: 0; }
|
|
654
|
+
.sr-prose p:last-child { margin-bottom: 0; }
|
|
655
|
+
|
|
656
|
+
.sr-prose ul, .sr-prose ol {
|
|
657
|
+
margin: 0.5em 0;
|
|
658
|
+
padding-left: 1.5em;
|
|
659
|
+
}
|
|
660
|
+
.sr-prose li { margin: 0.2em 0; }
|
|
661
|
+
.sr-prose li > p { margin: 0; }
|
|
662
|
+
|
|
663
|
+
.sr-prose a {
|
|
664
|
+
color: ${n};
|
|
665
|
+
text-decoration: underline;
|
|
666
|
+
text-underline-offset: 2px;
|
|
667
|
+
}
|
|
668
|
+
.sr-prose a:hover { text-decoration-thickness: 2px; }
|
|
669
|
+
|
|
670
|
+
.sr-prose strong { font-weight: 600; }
|
|
671
|
+
.sr-prose em { font-style: italic; }
|
|
672
|
+
|
|
673
|
+
.sr-prose code {
|
|
674
|
+
background: ${e?"#3a3a3a":"#f3f4f6"};
|
|
675
|
+
padding: 0.15em 0.35em;
|
|
676
|
+
border-radius: 4px;
|
|
677
|
+
font-size: 0.9em;
|
|
678
|
+
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
|
|
679
|
+
}
|
|
680
|
+
.sr-prose pre {
|
|
681
|
+
background: ${e?"#1a1a1a":"#1f2937"};
|
|
682
|
+
color: ${e?"#d4d4d4":"#e5e7eb"};
|
|
683
|
+
padding: 12px;
|
|
684
|
+
border-radius: 6px;
|
|
685
|
+
overflow-x: auto;
|
|
686
|
+
margin: 0.75em 0;
|
|
687
|
+
font-size: 0.85em;
|
|
688
|
+
line-height: 1.5;
|
|
689
|
+
}
|
|
690
|
+
.sr-prose pre code {
|
|
691
|
+
background: none;
|
|
692
|
+
padding: 0;
|
|
693
|
+
border-radius: 0;
|
|
694
|
+
font-size: inherit;
|
|
695
|
+
color: inherit;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
.sr-prose blockquote {
|
|
699
|
+
border-left: 3px solid ${l};
|
|
700
|
+
padding-left: 12px;
|
|
701
|
+
margin: 0.75em 0;
|
|
702
|
+
color: ${e?"#a3a3a3":"#6b7280"};
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
.sr-prose hr {
|
|
706
|
+
border: none;
|
|
707
|
+
border-top: 1px solid ${u};
|
|
708
|
+
margin: 1em 0;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
.sr-prose img {
|
|
712
|
+
max-width: 100%;
|
|
713
|
+
height: auto;
|
|
714
|
+
border-radius: 6px;
|
|
715
|
+
margin: 0.5em 0;
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
.sr-prose table {
|
|
719
|
+
width: 100%;
|
|
720
|
+
border-collapse: collapse;
|
|
721
|
+
margin: 0.75em 0;
|
|
722
|
+
font-size: 0.9em;
|
|
723
|
+
}
|
|
724
|
+
.sr-prose th, .sr-prose td {
|
|
725
|
+
border: 1px solid ${u};
|
|
726
|
+
padding: 6px 10px;
|
|
727
|
+
text-align: left;
|
|
728
|
+
}
|
|
729
|
+
.sr-prose th {
|
|
730
|
+
background: ${e?"#272727":"#f9fafb"};
|
|
731
|
+
font-weight: 600;
|
|
732
|
+
}
|
|
733
|
+
|
|
734
|
+
.sr-attach-btn {
|
|
735
|
+
width: 28px;
|
|
736
|
+
height: 28px;
|
|
737
|
+
border-radius: 50%;
|
|
738
|
+
background: none;
|
|
739
|
+
color: ${g};
|
|
740
|
+
border: none;
|
|
741
|
+
cursor: pointer;
|
|
742
|
+
display: flex;
|
|
743
|
+
align-items: center;
|
|
744
|
+
justify-content: center;
|
|
745
|
+
padding: 0;
|
|
746
|
+
transition: color 0.15s;
|
|
747
|
+
}
|
|
748
|
+
.sr-attach-btn:hover { color: ${r}; }
|
|
749
|
+
.sr-attach-btn:disabled { opacity: 0.3; cursor: not-allowed; }
|
|
750
|
+
.sr-attach-btn svg { width: 15px; height: 15px; }
|
|
751
|
+
.sr-attach-btn-left {
|
|
752
|
+
position: absolute;
|
|
753
|
+
bottom: 8px;
|
|
754
|
+
left: 8px;
|
|
755
|
+
}
|
|
756
|
+
.sr-send-btn-abs {
|
|
757
|
+
position: absolute;
|
|
758
|
+
bottom: 8px;
|
|
759
|
+
right: 8px;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
.sr-attachment-pills {
|
|
763
|
+
display: flex;
|
|
764
|
+
flex-wrap: wrap;
|
|
765
|
+
gap: 6px;
|
|
766
|
+
padding: 4px 0 8px;
|
|
767
|
+
}
|
|
768
|
+
.sr-attachment-pill {
|
|
769
|
+
display: inline-flex;
|
|
770
|
+
align-items: center;
|
|
771
|
+
gap: 4px;
|
|
772
|
+
padding: 3px 8px;
|
|
773
|
+
border-radius: 9999px;
|
|
774
|
+
background: ${h};
|
|
775
|
+
font-size: 11px;
|
|
776
|
+
color: ${g};
|
|
777
|
+
max-width: 200px;
|
|
778
|
+
}
|
|
779
|
+
.sr-attachment-pill-icon {
|
|
780
|
+
width: 11px;
|
|
781
|
+
height: 11px;
|
|
782
|
+
flex-shrink: 0;
|
|
783
|
+
}
|
|
784
|
+
.sr-attachment-pill-name {
|
|
785
|
+
overflow: hidden;
|
|
786
|
+
text-overflow: ellipsis;
|
|
787
|
+
white-space: nowrap;
|
|
788
|
+
}
|
|
789
|
+
.sr-attachment-pill-remove {
|
|
790
|
+
width: 14px;
|
|
791
|
+
height: 14px;
|
|
792
|
+
border-radius: 50%;
|
|
793
|
+
background: none;
|
|
794
|
+
border: none;
|
|
795
|
+
cursor: pointer;
|
|
796
|
+
display: flex;
|
|
797
|
+
align-items: center;
|
|
798
|
+
justify-content: center;
|
|
799
|
+
padding: 0;
|
|
800
|
+
color: ${g};
|
|
801
|
+
flex-shrink: 0;
|
|
802
|
+
}
|
|
803
|
+
.sr-attachment-pill-remove:hover { color: ${r}; }
|
|
804
|
+
.sr-attachment-pill-remove svg { width: 10px; height: 10px; }
|
|
805
|
+
|
|
806
|
+
.sr-message-attachments {
|
|
807
|
+
display: flex;
|
|
808
|
+
flex-direction: column;
|
|
809
|
+
gap: 6px;
|
|
810
|
+
margin-top: 6px;
|
|
811
|
+
}
|
|
812
|
+
|
|
813
|
+
.sr-file-preview {
|
|
814
|
+
border: 1px solid ${u};
|
|
815
|
+
border-radius: 8px;
|
|
816
|
+
overflow: hidden;
|
|
817
|
+
max-width: 280px;
|
|
818
|
+
}
|
|
819
|
+
.sr-file-preview-image {
|
|
820
|
+
display: block;
|
|
821
|
+
border-bottom: 1px solid ${u};
|
|
822
|
+
}
|
|
823
|
+
.sr-file-preview-image img {
|
|
824
|
+
display: block;
|
|
825
|
+
max-height: 180px;
|
|
826
|
+
width: 100%;
|
|
827
|
+
object-fit: contain;
|
|
828
|
+
background: ${e?"#1a1a1a":"#f9fafb"};
|
|
829
|
+
}
|
|
830
|
+
.sr-file-preview-image:hover img { opacity: 0.9; }
|
|
831
|
+
|
|
832
|
+
.sr-file-preview-row {
|
|
833
|
+
display: flex;
|
|
834
|
+
align-items: center;
|
|
835
|
+
gap: 8px;
|
|
836
|
+
padding: 8px 10px;
|
|
837
|
+
}
|
|
838
|
+
.sr-file-preview-icon {
|
|
839
|
+
width: 16px;
|
|
840
|
+
height: 16px;
|
|
841
|
+
flex-shrink: 0;
|
|
842
|
+
color: ${g};
|
|
843
|
+
}
|
|
844
|
+
.sr-file-preview-info {
|
|
845
|
+
min-width: 0;
|
|
846
|
+
flex: 1;
|
|
847
|
+
}
|
|
848
|
+
.sr-file-preview-name {
|
|
849
|
+
display: block;
|
|
850
|
+
font-size: 12px;
|
|
851
|
+
font-weight: 500;
|
|
852
|
+
color: ${n};
|
|
853
|
+
overflow: hidden;
|
|
854
|
+
text-overflow: ellipsis;
|
|
855
|
+
white-space: nowrap;
|
|
856
|
+
text-decoration: none;
|
|
857
|
+
}
|
|
858
|
+
.sr-file-preview-name:hover { text-decoration: underline; }
|
|
859
|
+
span.sr-file-preview-name { color: ${r}; }
|
|
860
|
+
span.sr-file-preview-name:hover { text-decoration: none; }
|
|
861
|
+
.sr-file-preview-size {
|
|
862
|
+
font-size: 11px;
|
|
863
|
+
color: ${g};
|
|
864
|
+
}
|
|
865
|
+
.sr-file-preview-download {
|
|
866
|
+
flex-shrink: 0;
|
|
867
|
+
padding: 4px;
|
|
868
|
+
border-radius: 4px;
|
|
869
|
+
color: ${g};
|
|
870
|
+
transition: color 0.15s, background 0.15s;
|
|
871
|
+
}
|
|
872
|
+
.sr-file-preview-download:hover {
|
|
873
|
+
color: ${r};
|
|
874
|
+
background: ${d};
|
|
875
|
+
}
|
|
876
|
+
.sr-file-preview-download svg {
|
|
877
|
+
width: 14px;
|
|
878
|
+
height: 14px;
|
|
879
|
+
}
|
|
880
|
+
|
|
881
|
+
::-webkit-scrollbar {
|
|
882
|
+
width: 13px;
|
|
883
|
+
height: 13px;
|
|
884
|
+
}
|
|
885
|
+
::-webkit-scrollbar-track {
|
|
886
|
+
background: transparent;
|
|
887
|
+
}
|
|
888
|
+
::-webkit-scrollbar-thumb {
|
|
889
|
+
background: ${e?"#525252":"oklch(0.8 0 0)"};
|
|
890
|
+
border: 3px solid transparent;
|
|
891
|
+
border-radius: 7px;
|
|
892
|
+
background-clip: padding-box;
|
|
893
|
+
}
|
|
894
|
+
::-webkit-scrollbar-thumb:hover {
|
|
895
|
+
background: ${e?"#666666":"oklch(0.65 0 0)"};
|
|
896
|
+
border: 3px solid transparent;
|
|
897
|
+
background-clip: padding-box;
|
|
898
|
+
}
|
|
899
|
+
`}var qe,O,hn,Cr,Ke=0,zr=[],M=R,Lr=M.__b,$r=M.__r,Dr=M.diffed,Pr=M.__c,Or=M.unmount,Nr=M.__;function fn(t,e){M.__h&&M.__h(O,t,Ke||e),Ke=0;var n=O.__H||(O.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function z(t){return Ke=1,bs(Hr,t)}function bs(t,e,n){var r=fn(qe++,2);if(r.t=t,!r.__c&&(r.__=[n?n(e):Hr(void 0,e),function(p){var l=r.__N?r.__N[0]:r.__[0],u=r.t(l,p);l!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=O,!O.__f)){var i=function(p,l,u){if(!r.__c.__H)return!0;var d=r.__c.__H.__.filter(function(m){return m.__c});if(d.every(function(m){return!m.__N}))return!s||s.call(this,p,l,u);var h=r.__c.props!==p;return d.some(function(m){if(m.__N){var g=m.__[0];m.__=m.__N,m.__N=void 0,g!==m.__[0]&&(h=!0)}}),s&&s.call(this,p,l,u)||h};O.__f=!0;var s=O.shouldComponentUpdate,o=O.componentWillUpdate;O.componentWillUpdate=function(p,l,u){if(this.__e){var d=s;s=void 0,i(p,l,u),s=d}o&&o.call(this,p,l,u)},O.shouldComponentUpdate=i}return r.__N||r.__}function Se(t,e){var n=fn(qe++,3);!M.__s&&Fr(n.__H,e)&&(n.__=t,n.u=e,O.__H.__h.push(n))}function Ve(t){return Ke=5,Ee(function(){return{current:t}},[])}function Ee(t,e){var n=fn(qe++,7);return Fr(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function fe(t,e){return Ke=8,Ee(function(){return t},e)}function ks(){for(var t;t=zr.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(yt),e.__h.some(dn),e.__h=[]}catch(n){e.__h=[],M.__e(n,t.__v)}}}M.__b=function(t){O=null,Lr&&Lr(t)},M.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Nr&&Nr(t,e)},M.__r=function(t){$r&&$r(t),qe=0;var e=(O=t.__c).__H;e&&(hn===O?(e.__h=[],O.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(yt),e.__h.some(dn),e.__h=[],qe=0)),hn=O},M.diffed=function(t){Dr&&Dr(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(zr.push(e)!==1&&Cr===M.requestAnimationFrame||((Cr=M.requestAnimationFrame)||ws)(ks)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),hn=O=null},M.__c=function(t,e){e.some(function(n){try{n.__h.some(yt),n.__h=n.__h.filter(function(r){return!r.__||dn(r)})}catch(r){e.some(function(i){i.__h&&(i.__h=[])}),e=[],M.__e(r,n.__v)}}),Pr&&Pr(t,e)},M.unmount=function(t){Or&&Or(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(r){try{yt(r)}catch(i){e=i}}),n.__H=void 0,e&&M.__e(e,n.__v))};var Mr=typeof requestAnimationFrame=="function";function ws(t){var e,n=function(){clearTimeout(r),Mr&&cancelAnimationFrame(e),setTimeout(t)},r=setTimeout(n,35);Mr&&(e=requestAnimationFrame(n))}function yt(t){var e=O,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),O=e}function dn(t){var e=O;t.__c=t.__(),O=e}function Fr(t,e){return!t||t.length!==e.length||e.some(function(n,r){return n!==t[r]})}function Hr(t,e){return typeof e=="function"?e(t):e}var Ye=[],Br=!1;function Xe(t){Ye.push(t),Ye.length>20&&(Ye=Ye.slice(-20))}function gn(t,e=120){return t.length>e?t.slice(0,e)+"\u2026":t}function mn(){return[...Ye]}function Ur(t){Xe(t)}function jr(){if(Br||typeof window>"u")return;Br=!0,document.addEventListener("click",n=>{let r=n.target;if(!r)return;let i=r.textContent?.trim()||r.getAttribute("aria-label")||"";Xe({type:"user",category:"click",message:gn(`${r.tagName.toLowerCase()}${i?` "${i}"`:""}`),timestamp:Date.now(),data:{tagName:r.tagName.toLowerCase(),className:r.className?gn(r.className,80):void 0}})},{capture:!0});let t=history.pushState;history.pushState=function(...n){let r=location.pathname;t.apply(this,n),Xe({type:"navigation",category:"navigation",message:`${r} \u2192 ${location.pathname}`,timestamp:Date.now()})},window.addEventListener("popstate",()=>{Xe({type:"navigation",category:"navigation",message:`popstate \u2192 ${location.pathname}`,timestamp:Date.now()})});let e=n=>{let r=console[n];console[n]=(...i)=>{Xe({type:"console",category:`console.${n}`,message:gn(i.map(s=>typeof s=="string"?s:String(s)).join(" ")),timestamp:Date.now()}),r.apply(console,i)}};e("error"),e("warn")}function Tt(){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 Wr=new Map;function vs(t,e){let n=e?.split(`
|
|
900
|
+
`)[1]?.trim()??"";return`${t}:${n}`}function ys(t){let e=Wr.get(t);return e&&Date.now()-e<6e4?!0:(Wr.set(t,Date.now()),!1)}function Gr(t,e,n){let r=vs(e.type,e.stack);ys(r)||t.track("$exception",{...e,context:{breadcrumbs:n()}})}function qr(t,e){typeof window>"u"||(window.onerror=(n,r,i,s,o)=>{let p=o??new Error(String(n));Gr(t,{type:p.name||"Error",message:p.message||String(n),stack:p.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));Gr(t,{type:i.name||"UnhandledRejection",message:i.message,stack:i.stack,handled:!1,mechanism:"onunhandledrejection",source:"browser"},e)})}var St=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 p=await o.json();this.cache.clear();for(let[l,u]of Object.entries(p.flags))this.cache.set(l,u);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 Kr=10,Vr=3e3,Yr=1e4,Xr=1800*1e3,Zr=100,Qr="__scoperat_anon_id",_n="__scoperat_session_id",Et="__scoperat_last_activity",At="__scoperat_ticket_session";function It(){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 Jr(){if(!(typeof window>"u"||typeof localStorage>"u"))try{let t=localStorage.getItem(Qr);return t||(t=It(),localStorage.setItem(Qr,t)),t}catch{return It()}}var xn=class{constructor(){b(this,"writeKey",null);b(this,"endpoint","");b(this,"flushAt",Kr);b(this,"flushInterval",Vr);b(this,"timeout",Yr);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,"sessionTimeout",Xr);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??Kr,this.flushInterval=n.flushInterval??Vr,this.timeout=n.timeout??Yr,this.onError=n.onError,this.sessionTimeout=n.sessionTimeout??Xr,this.anonymousId=Jr(),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&&(qr(this,mn),jr()),this._flagClient?.destroy(),this._flagClient=new St({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){this.userId=e,n&&(this.traits={...n},n.orgId&&(this.orgId=n.orgId)),this.userHash=r?.userHash;for(let i of this.buffer)i.user_id||(i.user_id=e),!i.org_id&&this.orgId&&(i.org_id=this.orgId);this._flagClient?.refresh()}reset(){this.userId=void 0,this.orgId=void 0,this.traits={},this.userHash=void 0,this.anonymousId=Jr(),this.clearSession(),this.clearTicketSession()}clearTicketSession(){if(this.ticketSessionFetch=null,!(typeof localStorage>"u"))try{localStorage.removeItem(At)}catch{}}readStoredTicketSession(){if(typeof localStorage>"u")return null;try{let e=localStorage.getItem(At);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(At)}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(At,JSON.stringify(r))}catch{}return this.anonymousId=r.anonymousId,r}return null}catch{return null}finally{this.ticketSessionFetch=null}})(),this.ticketSessionFetch):Promise.resolve(null)}getOrCreateSessionId(){if(!(typeof window>"u"))try{let e=Date.now(),n=localStorage.getItem(Et),r=sessionStorage.getItem(_n),i=!n||e-Number(n)>this.sessionTimeout;if(r&&!i)return localStorage.setItem(Et,String(e)),r;let s=It();return sessionStorage.setItem(_n,s),localStorage.setItem(Et,String(e)),s}catch{return It()}}clearSession(){if(!(typeof window>"u"))try{sessionStorage.removeItem(_n),localStorage.removeItem(Et)}catch{}}getSessionId(){return this.getOrCreateSessionId()}_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){Ur({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.getOrCreateSessionId(),context:{...Tt(),...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,Zr);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 navigator>"u"||!navigator.sendBeacon||this.buffer.length===0)return;let e=this.buffer.splice(0,Zr),n=JSON.stringify({events:e}),r=`${this.endpoint}/api/ingest/track?key=${encodeURIComponent(this.writeKey)}`;try{let i=new Blob([n],{type:"application/json"});navigator.sendBeacon(r,i)}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()}},Ts=new xn,ee=Ts;async function ei(){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 ti(){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 ni(){let t=ee._getWriteKey();return{"Content-Type":"application/json",...t?{Authorization:`Bearer ${t}`}:{},...await ei()}}async function bn(){let t=ee._getWriteKey();return{...t?{Authorization:`Bearer ${t}`}:{},...await ei()}}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 bn(),body:e});if(!n.ok){let r=await n.text().catch(()=>"");throw new Error(`Upload failed: ${n.status} ${r}`)}return n.json()}async function ri(t){let e=ee._getIdentity(),n=Tt(),r=await fetch(`${ze()}/api/ingest/ticket`,{method:"POST",headers:await ni(),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 ii(t,e,n){let r=await fetch(`${ze()}/api/ingest/ticket/message`,{method:"POST",headers:await ni(),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 si(){let t=await ti(),e=ee._getWriteKey();e&&t.set("key",e);let n=await fetch(`${ze()}/api/ingest/tickets?${t.toString()}`,{headers:await bn()});return n.ok?(await n.json()).tickets:[]}async function kn(t){let e=await ti(),n=await fetch(`${ze()}/api/ingest/ticket/${t}?${e.toString()}`,{headers:await bn()});if(!n.ok)throw new Error(`Failed to fetch conversation: ${n.status}`);return n.json()}async function oi(t,e){try{let n=await fetch(`${ze()}/api/kb/${t}/${e}`);return n.ok?n.json():null}catch{return null}}var wn=new Set,Ct={isOpen:!1,view:"conversations",tickets:[],activeTicketId:null,activeConversation:null,loading:!1,error:null};function Ss(){for(let t of wn)t()}function Ae(){return Ct}function ai(t){return wn.add(t),()=>wn.delete(t)}function J(t){Ct={...Ct,...t},Ss()}function li(){J({isOpen:!Ct.isOpen})}function Lt(t){J({view:t})}function $t(t){J({view:"thread",activeTicketId:t})}function ci(){J({view:"conversations",activeTicketId:null,activeConversation:null})}var Es=0;function c(t,e,n,r,i,s){e||(e={});var o,p,l=e;if("ref"in l)for(p in l={},e)p=="ref"?o=e[p]:l[p]=e[p];var u={type:t,props:l,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Es,__i:-1,__u:0,__source:i,__self:s};if(typeof t=="function"&&(o=t.defaultProps))for(p in o)l[p]===void 0&&(l[p]=o[p]);return R.vnode&&R.vnode(u),u}function As(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 Is({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:As(t.lastMessageAt??t.createdAt)})})]})}function pi(){let t=Ae();return Se(()=>{J({loading:!0}),si().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(Is,{ticket:e},e.id))})})}var{entries:bi,setPrototypeOf:ui,isFrozen:Rs,getPrototypeOf:Cs,getOwnPropertyDescriptor:Ls}=Object,{freeze:V,seal:te,create:nt}=Object,{apply:In,construct:Rn}=typeof Reflect<"u"&&Reflect;V||(V=function(e){return e});te||(te=function(e){return e});In||(In=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)});Rn||(Rn=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 Ze=Y(Array.prototype.forEach),$s=Y(Array.prototype.lastIndexOf),hi=Y(Array.prototype.pop),Qe=Y(Array.prototype.push),Ds=Y(Array.prototype.splice),Pt=Y(String.prototype.toLowerCase),vn=Y(String.prototype.toString),yn=Y(String.prototype.match),Fe=Y(String.prototype.replace),Ps=Y(String.prototype.indexOf),Os=Y(String.prototype.trim),re=Y(Object.prototype.hasOwnProperty),K=Y(RegExp.prototype.test),Je=Ns(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 In(t,e,r)}}function Ns(t){return function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Rn(t,n)}}function y(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pt;ui&&ui(t,null);let r=e.length;for(;r--;){let i=e[r];if(typeof i=="string"){let s=n(i);s!==i&&(Rs(e)||(e[r]=s),i=s)}t[i]=!0}return t}function Ms(t){for(let e=0;e<t.length;e++)re(t,e)||(t[e]=null);return t}function le(t){let e=nt(null);for(let[n,r]of bi(t))re(t,n)&&(Array.isArray(r)?e[n]=Ms(r):r&&typeof r=="object"&&r.constructor===Object?e[n]=le(r):e[n]=r);return e}function et(t,e){for(;t!==null;){let r=Ls(t,e);if(r){if(r.get)return Y(r.get);if(typeof r.value=="function")return Y(r.value)}t=Cs(t)}function n(){return null}return n}var di=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"]),Tn=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"]),Sn=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"]),zs=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"]),En=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"]),Fs=V(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),fi=V(["#text"]),gi=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"]),An=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"]),mi=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"]),Hs=te(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Bs=te(/<%[\w\W]*|[\w\W]*%>/gm),Us=te(/\$\{[\w\W]*/gm),js=te(/^data-[\-\w.\u00B7-\uFFFF]+$/),Ws=te(/^aria-[\-\w]+$/),ki=te(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Gs=te(/^(?:\w+script|data):/i),qs=te(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),wi=te(/^html$/i),Ks=te(/^[a-z][.\w]*(-[.\w]+)+$/i),_i=Object.freeze({__proto__:null,ARIA_ATTR:Ws,ATTR_WHITESPACE:qs,CUSTOM_ELEMENT:Ks,DATA_ATTR:js,DOCTYPE_NAME:wi,ERB_EXPR:Bs,IS_ALLOWED_URI:ki,IS_SCRIPT_OR_DATA:Gs,MUSTACHE_EXPR:Hs,TMPLIT_EXPR:Us}),tt={element:1,text:3,progressingInstruction:7,comment:8,document:9},Vs=function(){return typeof window>"u"?null:window},Ys=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}},xi=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function vi(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Vs(),e=k=>vi(k);if(e.version="3.4.0",e.removed=[],!t||!t.document||t.document.nodeType!==tt.document||!t.Element)return e.isSupported=!1,e;let{document:n}=t,r=n,i=r.currentScript,{DocumentFragment:s,HTMLTemplateElement:o,Node:p,Element:l,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:m,trustedTypes:g}=t,_=l.prototype,E=et(_,"cloneNode"),w=et(_,"remove"),v=et(_,"nextSibling"),T=et(_,"childNodes"),D=et(_,"parentNode");if(typeof o=="function"){let k=n.createElement("template");k.content&&k.content.ownerDocument&&(n=k.content.ownerDocument)}let A,B="",{implementation:q,createNodeIterator:pe,createDocumentFragment:ge,getElementsByTagName:I}=n,{importNode:F}=r,$=xi();e.isSupported=typeof bi=="function"&&typeof D=="function"&&q&&q.createHTMLDocument!==void 0;let{MUSTACHE_EXPR:ue,ERB_EXPR:Le,TMPLIT_EXPR:$e,DATA_ATTR:Ki,ARIA_ATTR:Vi,IS_SCRIPT_OR_DATA:Yi,ATTR_WHITESPACE:Gn,CUSTOM_ELEMENT:Xi}=_i,{IS_ALLOWED_URI:qn}=_i,U=null,Kn=y({},[...di,...Tn,...Sn,...En,...fi]),j=null,Vn=y({},[...gi,...An,...mi,...Dt]),P=Object.seal(nt(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}})),Be=null,ot=null,me=Object.seal(nt(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}})),Yn=!0,jt=!0,Xn=!1,Zn=!0,ve=!1,Ue=!0,ye=!1,Wt=!1,Gt=!1,De=!1,at=!1,lt=!1,Qn=!0,Jn=!1,Zi="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"]),er=null,tr=y({},["audio","video","img","source","image","track"]),Vt=null,nr=y({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),ct="http://www.w3.org/1998/Math/MathML",pt="http://www.w3.org/2000/svg",ae="http://www.w3.org/1999/xhtml",Oe=ae,Yt=!1,Xt=null,Qi=y({},[ct,pt,ae],vn),ut=y({},["mi","mo","mn","ms","mtext"]),ht=y({},["annotation-xml"]),Ji=y({},["title","style","font","a","script"]),We=null,es=["application/xhtml+xml","text/html"],ts="text/html",H=null,Ne=null,ns=n.createElement("form"),rr=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=es.indexOf(a.PARSER_MEDIA_TYPE)===-1?ts:a.PARSER_MEDIA_TYPE,H=We==="application/xhtml+xml"?vn:Pt,U=re(a,"ALLOWED_TAGS")?y({},a.ALLOWED_TAGS,H):Kn,j=re(a,"ALLOWED_ATTR")?y({},a.ALLOWED_ATTR,H):Vn,Xt=re(a,"ALLOWED_NAMESPACES")?y({},a.ALLOWED_NAMESPACES,vn):Qi,Vt=re(a,"ADD_URI_SAFE_ATTR")?y(le(nr),a.ADD_URI_SAFE_ATTR,H):nr,er=re(a,"ADD_DATA_URI_TAGS")?y(le(tr),a.ADD_DATA_URI_TAGS,H):tr,oe=re(a,"FORBID_CONTENTS")?y({},a.FORBID_CONTENTS,H):Kt,Be=re(a,"FORBID_TAGS")?y({},a.FORBID_TAGS,H):le({}),ot=re(a,"FORBID_ATTR")?y({},a.FORBID_ATTR,H):le({}),Pe=re(a,"USE_PROFILES")?a.USE_PROFILES:!1,Yn=a.ALLOW_ARIA_ATTR!==!1,jt=a.ALLOW_DATA_ATTR!==!1,Xn=a.ALLOW_UNKNOWN_PROTOCOLS||!1,Zn=a.ALLOW_SELF_CLOSE_IN_ATTR!==!1,ve=a.SAFE_FOR_TEMPLATES||!1,Ue=a.SAFE_FOR_XML!==!1,ye=a.WHOLE_DOCUMENT||!1,De=a.RETURN_DOM||!1,at=a.RETURN_DOM_FRAGMENT||!1,lt=a.RETURN_TRUSTED_TYPE||!1,Gt=a.FORCE_BODY||!1,Qn=a.SANITIZE_DOM!==!1,Jn=a.SANITIZE_NAMED_PROPS||!1,qt=a.KEEP_CONTENT!==!1,je=a.IN_PLACE||!1,qn=a.ALLOWED_URI_REGEXP||ki,Oe=a.NAMESPACE||ae,ut=a.MATHML_TEXT_INTEGRATION_POINTS||ut,ht=a.HTML_INTEGRATION_POINTS||ht,P=a.CUSTOM_ELEMENT_HANDLING||nt(null),a.CUSTOM_ELEMENT_HANDLING&&rr(a.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(P.tagNameCheck=a.CUSTOM_ELEMENT_HANDLING.tagNameCheck),a.CUSTOM_ELEMENT_HANDLING&&rr(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),at&&(De=!0),Pe&&(U=y({},fi),j=nt(null),Pe.html===!0&&(y(U,di),y(j,gi)),Pe.svg===!0&&(y(U,Tn),y(j,An),y(j,Dt)),Pe.svgFilters===!0&&(y(U,Sn),y(j,An),y(j,Dt)),Pe.mathMl===!0&&(y(U,En),y(j,mi),y(j,Dt))),me.tagCheck=null,me.attributeCheck=null,a.ADD_TAGS&&(typeof a.ADD_TAGS=="function"?me.tagCheck=a.ADD_TAGS:(U===Kn&&(U=le(U)),y(U,a.ADD_TAGS,H))),a.ADD_ATTR&&(typeof a.ADD_ATTR=="function"?me.attributeCheck=a.ADD_ATTR:(j===Vn&&(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&&(U["#text"]=!0),ye&&y(U,["html","head","body"]),U.table&&(y(U,["tbody"]),delete Be.tbody),a.TRUSTED_TYPES_POLICY){if(typeof a.TRUSTED_TYPES_POLICY.createHTML!="function")throw Je('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof a.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw Je('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');A=a.TRUSTED_TYPES_POLICY,B=A.createHTML("")}else A===void 0&&(A=Ys(g,i)),A!==null&&typeof B=="string"&&(B=A.createHTML(""));V&&V(a),Ne=a}},ir=y({},[...Tn,...Sn,...zs]),sr=y({},[...En,...Fs]),rs=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===pt?f.namespaceURI===ae?x==="svg":f.namespaceURI===ct?x==="svg"&&(L==="annotation-xml"||ut[L]):!!ir[x]:a.namespaceURI===ct?f.namespaceURI===ae?x==="math":f.namespaceURI===pt?x==="math"&&ht[L]:!!sr[x]:a.namespaceURI===ae?f.namespaceURI===pt&&!ht[L]||f.namespaceURI===ct&&!ut[L]?!1:!sr[x]&&(Ji[x]||!ir[x]):!!(We==="application/xhtml+xml"&&Xt[a.namespaceURI]):!1},ne=function(a){Qe(e.removed,{element:a});try{D(a).removeChild(a)}catch{w(a)}},Te=function(a,f){try{Qe(e.removed,{attribute:f.getAttributeNode(a),from:f})}catch{Qe(e.removed,{attribute:null,from:f})}if(f.removeAttribute(a),a==="is")if(De||at)try{ne(f)}catch{}else try{f.setAttribute(a,"")}catch{}},or=function(a){let f=null,x=null;if(Gt)a="<remove></remove>"+a;else{let N=yn(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?B: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},ar=function(a){return pe.call(a.ownerDocument||a,a,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Qt=function(a){return a instanceof h&&(typeof a.nodeName!="string"||typeof a.textContent!="string"||typeof a.removeChild!="function"||!(a.attributes instanceof d)||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 p=="function"&&a instanceof p};function he(k,a,f){Ze(k,x=>{x.call(e,a,f,Ne)})}let lr=function(a){let f=null;if(he($.beforeSanitizeElements,a,null),Qt(a))return ne(a),!0;let x=H(a.nodeName);if(he($.uponSanitizeElement,a,{tagName:x,allowedTags:U}),Ue&&a.hasChildNodes()&&!Jt(a.firstElementChild)&&K(/<[/\w!]/g,a.innerHTML)&&K(/<[/\w!]/g,a.textContent)||Ue&&a.namespaceURI===ae&&x==="style"&&Jt(a.firstElementChild)||a.nodeType===tt.progressingInstruction||Ue&&a.nodeType===tt.comment&&K(/<[/\w]/g,a.data))return ne(a),!0;if(Be[x]||!(me.tagCheck instanceof Function&&me.tagCheck(x))&&!U[x]){if(!Be[x]&&pr(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&&!rs(a)||(x==="noscript"||x==="noembed"||x==="noframes")&&K(/<\/no(script|embed|frames)/i,a.innerHTML)?(ne(a),!0):(ve&&a.nodeType===tt.text&&(f=a.textContent,Ze([ue,Le,$e],L=>{f=Fe(f,L," ")}),a.textContent!==f&&(Qe(e.removed,{element:a.cloneNode()}),a.textContent=f)),he($.afterSanitizeElements,a,null),!1)},cr=function(a,f,x){if(ot[f]||Qn&&(f==="id"||f==="name")&&(x in n||x in ns))return!1;if(!(jt&&!ot[f]&&K(Ki,f))){if(!(Yn&&K(Vi,f))){if(!(me.attributeCheck instanceof Function&&me.attributeCheck(f,a))){if(!j[f]||ot[f]){if(!(pr(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(qn,Fe(x,Gn,""))){if(!((f==="src"||f==="xlink:href"||f==="href")&&a!=="script"&&Ps(x,"data:")===0&&er[a])){if(!(Xn&&!K(Yi,Fe(x,Gn,"")))){if(x)return!1}}}}}}}return!0},pr=function(a){return a!=="annotation-xml"&&yn(a,Xi)},ur=function(a){he($.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:Os(en);if(x.attrName=_e,x.attrValue=W,x.keepAttr=!0,x.forceKeepAttr=void 0,he($.uponSanitizeAttribute,a,x),W=x.attrValue,Jn&&(_e==="id"||_e==="name")&&(Te(N,a),W=Zi+W),Ue&&K(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,W)){Te(N,a);continue}if(_e==="attributename"&&yn(W,"href")){Te(N,a);continue}if(x.forceKeepAttr)continue;if(!x.keepAttr){Te(N,a);continue}if(!Zn&&K(/\/>/i,W)){Te(N,a);continue}ve&&Ze([ue,Le,$e],fr=>{W=Fe(W,fr," ")});let dr=H(a.nodeName);if(!cr(dr,_e,W)){Te(N,a);continue}if(A&&typeof g=="object"&&typeof g.getAttributeType=="function"&&!Z)switch(g.getAttributeType(dr,_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):hi(e.removed)}catch{Te(N,a)}}he($.afterSanitizeAttributes,a,null)},hr=function(a){let f=null,x=ar(a);for(he($.beforeSanitizeShadowDOM,a,null);f=x.nextNode();)he($.uponSanitizeShadowNode,f,null),lr(f),ur(f),f.content instanceof s&&hr(f.content);he($.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 Je("dirty is not a string, aborting")}else throw Je("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(!U[Q]||Be[Q])throw Je("root node is forbidden and cannot be sanitized in-place")}}else if(k instanceof p)f=or("<!---->"),x=f.ownerDocument.importNode(k,!0),x.nodeType===tt.element&&x.nodeName==="BODY"||x.nodeName==="HTML"?f=x:f.appendChild(x);else{if(!De&&!ve&&!ye&&k.indexOf("<")===-1)return A&<?A.createHTML(k):k;if(f=or(k),!f)return De?null:lt?B:""}f&&Gt&&ne(f.firstChild);let N=ar(je?k:f);for(;L=N.nextNode();)lr(L),ur(L),L.content instanceof s&&hr(L.content);if(je)return k;if(De){if(ve){f.normalize();let Q=f.innerHTML;Ze([ue,Le,$e],_e=>{Q=Fe(Q,_e," ")}),f.innerHTML=Q}if(at)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&&U["!doctype"]&&f.ownerDocument&&f.ownerDocument.doctype&&f.ownerDocument.doctype.name&&K(wi,f.ownerDocument.doctype.name)&&(Z="<!DOCTYPE "+f.ownerDocument.doctype.name+`>
|
|
901
|
+
`+Z),ve&&Ze([ue,Le,$e],Q=>{Z=Fe(Z,Q," ")}),A&<?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 cr(x,L,f)},e.addHook=function(k,a){typeof a=="function"&&Qe($[k],a)},e.removeHook=function(k,a){if(a!==void 0){let f=$s($[k],a);return f===-1?void 0:Ds($[k],f,1)[0]}return hi($[k])},e.removeHooks=function(k){$[k]=[]},e.removeAllHooks=function(){$=xi()},e}var Cn=vi();function Pn(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Ce=Pn();function Ci(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 Xs=((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)}}>`)},Zs=/^(?:[ \t]*(?:\n|$))+/,Qs=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Js=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,st=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,eo=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,On=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Li=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,$i=S(Li).replace(/bull/g,On).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(),to=S(Li).replace(/bull/g,On).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(),Nn=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,no=/^[^\n]+/,Mn=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,ro=S(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Mn).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),io=S(/^(bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,On).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",zn=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,so=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",zn).replace("tag",Ht).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Di=S(Nn).replace("hr",st).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(),oo=S(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",Di).getRegex(),Fn={blockquote:oo,code:Qs,def:ro,fences:Js,heading:eo,hr:st,html:so,lheading:$i,list:io,newline:Zs,paragraph:Di,table:Ie,text:no},yi=S("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",st).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(),ao={...Fn,lheading:to,table:yi,paragraph:S(Nn).replace("hr",st).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]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Ht).getRegex()},lo={...Fn,html:S(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",zn).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(Nn).replace("hr",st).replace("heading",` *#{1,6} *[^
|
|
902
|
+
]`).replace("lheading",$i).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},co=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,po=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Pi=/^( {2,}|\\)\n(?!\s*$)/,uo=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,He=/[\p{P}\p{S}]/u,Bt=/[\s\p{P}\p{S}]/u,Hn=/[^\s\p{P}\p{S}]/u,ho=S(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Bt).getRegex(),Oi=/(?!~)[\p{P}\p{S}]/u,fo=/(?!~)[\s\p{P}\p{S}]/u,go=/(?:[^\s\p{P}\p{S}]|~)/u,mo=S(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",Xs?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Ni=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,_o=S(Ni,"u").replace(/punct/g,He).getRegex(),xo=S(Ni,"u").replace(/punct/g,Oi).getRegex(),Mi="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",bo=S(Mi,"gu").replace(/notPunctSpace/g,Hn).replace(/punctSpace/g,Bt).replace(/punct/g,He).getRegex(),ko=S(Mi,"gu").replace(/notPunctSpace/g,go).replace(/punctSpace/g,fo).replace(/punct/g,Oi).getRegex(),wo=S("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Hn).replace(/punctSpace/g,Bt).replace(/punct/g,He).getRegex(),vo=S(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,He).getRegex(),yo="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",To=S(yo,"gu").replace(/notPunctSpace/g,Hn).replace(/punctSpace/g,Bt).replace(/punct/g,He).getRegex(),So=S(/\\(punct)/,"gu").replace(/punct/g,He).getRegex(),Eo=S(/^<(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(),Ao=S(zn).replace("(?:-->|$)","-->").getRegex(),Io=S("^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",Ao).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Mt=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Ro=S(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Mt).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),zi=S(/^!?\[(label)\]\[(ref)\]/).replace("label",Mt).replace("ref",Mn).getRegex(),Fi=S(/^!?\[(ref)\](?:\[\])?/).replace("ref",Mn).getRegex(),Co=S("reflink|nolink(?!\\()","g").replace("reflink",zi).replace("nolink",Fi).getRegex(),Ti=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Bn={_backpedal:Ie,anyPunctuation:So,autolink:Eo,blockSkip:mo,br:Pi,code:po,del:Ie,delLDelim:Ie,delRDelim:Ie,emStrongLDelim:_o,emStrongRDelimAst:bo,emStrongRDelimUnd:wo,escape:co,link:Ro,nolink:Fi,punctuation:ho,reflink:zi,reflinkSearch:Co,tag:Io,text:uo,url:Ie},Lo={...Bn,link:S(/^!?\[(label)\]\((.*?)\)/).replace("label",Mt).getRegex(),reflink:S(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Mt).getRegex()},Ln={...Bn,emStrongRDelimAst:ko,emStrongLDelim:xo,delLDelim:vo,delRDelim:To,url:S(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Ti).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:S(/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Ti).getRegex()},$o={...Ln,br:S(Pi).replace("{2,}","*").getRegex(),text:S(Ln.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Ot={normal:Fn,gfm:ao,pedantic:lo},rt={normal:Bn,gfm:Ln,breaks:$o,pedantic:Lo},Do={"&":"&","<":"<",">":">",'"':""","'":"'"},Si=t=>Do[t];function ce(t,e){if(e){if(X.escapeTest.test(t))return t.replace(X.escapeReplace,Si)}else if(X.escapeTestNoEncode.test(t))return t.replace(X.escapeReplaceNoEncode,Si);return t}function Ei(t){try{t=encodeURI(t).replace(X.percentDecode,"%")}catch{return null}return t}function Ai(t,e){let n=t.replace(X.findPipe,(s,o,p)=>{let l=!1,u=o;for(;--u>=0&&p[u]==="\\";)l=!l;return l?"|":" |"}),r=n.split(X.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(X.slashPipe,"|");return r}function ke(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 Ii(t){let e=t.split(`
|
|
903
|
+
`),n=e.length-1;for(;n>=0&&!e[n].trim();)n--;return e.length-n<=2?t:e.slice(0,n+1).join(`
|
|
904
|
+
`)}function Po(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 Oo(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 Ri(t,e,n,r,i){let s=e.href,o=e.title||null,p=t[1].replace(i.other.outputLinkReplace,"$1");r.state.inLink=!0;let l={type:t[0].charAt(0)==="!"?"image":"link",raw:n,href:s,title:o,text:p,tokens:r.inlineTokens(p)};return r.state.inLink=!1,l}function No(t,e,n){let r=t.match(n.other.indentCodeCompensation);if(r===null)return e;let i=r[1];return e.split(`
|
|
905
|
+
`).map(s=>{let o=s.match(n.other.beginningSpace);if(o===null)return s;let[p]=o;return p.length>=i.length?s.slice(i.length):s}).join(`
|
|
906
|
+
`)}var zt=class{constructor(t){b(this,"options");b(this,"rules");b(this,"lexer");this.options=t||Ce}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]:Ii(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=No(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=ke(n,"#");(this.options.pedantic||!r||this.rules.other.endingSpaceChar.test(r))&&(n=r.trim())}return{type:"heading",raw:ke(e[0],`
|
|
907
|
+
`),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:ke(e[0],`
|
|
908
|
+
`)}}blockquote(t){let e=this.rules.block.blockquote.exec(t);if(e){let n=ke(e[0],`
|
|
909
|
+
`).split(`
|
|
910
|
+
`),r="",i="",s=[];for(;n.length>0;){let o=!1,p=[],l;for(l=0;l<n.length;l++)if(this.rules.other.blockquoteStart.test(n[l]))p.push(n[l]),o=!0;else if(!o)p.push(n[l]);else break;n=n.slice(l);let u=p.join(`
|
|
911
|
+
`),d=u.replace(this.rules.other.blockquoteSetextReplace,`
|
|
912
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");r=r?`${r}
|
|
913
|
+
${u}`:u,i=i?`${i}
|
|
914
|
+
${d}`:d;let h=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(d,s,!0),this.lexer.state.top=h,n.length===0)break;let m=s.at(-1);if(m?.type==="code")break;if(m?.type==="blockquote"){let g=m,_=g.raw+`
|
|
915
|
+
`+n.join(`
|
|
916
|
+
`),E=this.blockquote(_);s[s.length-1]=E,r=r.substring(0,r.length-g.raw.length)+E.raw,i=i.substring(0,i.length-g.text.length)+E.text;break}else if(m?.type==="list"){let g=m,_=g.raw+`
|
|
917
|
+
`+n.join(`
|
|
918
|
+
`),E=this.list(_);s[s.length-1]=E,r=r.substring(0,r.length-m.raw.length)+E.raw,i=i.substring(0,i.length-g.raw.length)+E.raw,n=_.substring(s.at(-1).raw.length).split(`
|
|
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),o=!1;for(;t;){let l=!1,u="",d="";if(!(e=s.exec(t))||this.rules.block.hr.test(t))break;u=e[0],t=t.substring(u.length);let h=Oo(e[2].split(`
|
|
920
|
+
`,1)[0],e[1].length),m=t.split(`
|
|
921
|
+
`,1)[0],g=!h.trim(),_=0;if(this.options.pedantic?(_=2,d=h.trimStart()):g?_=e[1].length+1:(_=h.search(this.rules.other.nonSpaceChar),_=_>4?1:_,d=h.slice(_),_+=e[1].length),g&&this.rules.other.blankLine.test(m)&&(u+=m+`
|
|
922
|
+
`,t=t.substring(m.length+1),l=!0),!l){let E=this.rules.other.nextBulletRegex(_),w=this.rules.other.hrRegex(_),v=this.rules.other.fencesBeginRegex(_),T=this.rules.other.headingBeginRegex(_),D=this.rules.other.htmlBeginRegex(_),A=this.rules.other.blockquoteBeginRegex(_);for(;t;){let B=t.split(`
|
|
923
|
+
`,1)[0],q;if(m=B,this.options.pedantic?(m=m.replace(this.rules.other.listReplaceNesting," "),q=m):q=m.replace(this.rules.other.tabCharGlobal," "),v.test(m)||T.test(m)||D.test(m)||A.test(m)||E.test(m)||w.test(m))break;if(q.search(this.rules.other.nonSpaceChar)>=_||!m.trim())d+=`
|
|
924
|
+
`+q.slice(_);else{if(g||h.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||v.test(h)||T.test(h)||w.test(h))break;d+=`
|
|
925
|
+
`+m}g=!m.trim(),u+=B+`
|
|
926
|
+
`,t=t.substring(B.length+1),h=q.slice(_)}}i.loose||(o?i.loose=!0:this.rules.other.doubleBlankLine.test(u)&&(o=!0)),i.items.push({type:"list_item",raw:u,task:!!this.options.gfm&&this.rules.other.listIsTask.test(d),loose:!1,text:d,tokens:[]}),i.raw+=u}let p=i.items.at(-1);if(p)p.raw=p.raw.trimEnd(),p.text=p.text.trimEnd();else return;i.raw=i.raw.trimEnd();for(let l of i.items){if(this.lexer.state.top=!1,l.tokens=this.lexer.blockTokens(l.text,[]),l.task){if(l.text=l.text.replace(this.rules.other.listReplaceTask,""),l.tokens[0]?.type==="text"||l.tokens[0]?.type==="paragraph"){l.tokens[0].raw=l.tokens[0].raw.replace(this.rules.other.listReplaceTask,""),l.tokens[0].text=l.tokens[0].text.replace(this.rules.other.listReplaceTask,"");for(let d=this.lexer.inlineQueue.length-1;d>=0;d--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[d].src)){this.lexer.inlineQueue[d].src=this.lexer.inlineQueue[d].src.replace(this.rules.other.listReplaceTask,"");break}}let u=this.rules.other.listTaskCheckbox.exec(l.raw);if(u){let d={type:"checkbox",raw:u[0]+" ",checked:u[0]!=="[ ]"};l.checked=d.checked,i.loose?l.tokens[0]&&["paragraph","text"].includes(l.tokens[0].type)&&"tokens"in l.tokens[0]&&l.tokens[0].tokens?(l.tokens[0].raw=d.raw+l.tokens[0].raw,l.tokens[0].text=d.raw+l.tokens[0].text,l.tokens[0].tokens.unshift(d)):l.tokens.unshift({type:"paragraph",raw:d.raw,text:d.raw,tokens:[d]}):l.tokens.unshift(d)}}if(!i.loose){let u=l.tokens.filter(h=>h.type==="space"),d=u.length>0&&u.some(h=>this.rules.other.anyLine.test(h.raw));i.loose=d}}if(i.loose)for(let l of i.items){l.loose=!0;for(let u of l.tokens)u.type==="text"&&(u.type="paragraph")}return i}}html(t){let e=this.rules.block.html.exec(t);if(e){let n=Ii(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:ke(e[0],`
|
|
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=Ai(e[1]),r=e[2].replace(this.rules.other.tableAlignChars,"").split("|"),i=e[3]?.trim()?e[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
928
|
+
`):[],s={type:"table",raw:ke(e[0],`
|
|
929
|
+
`),header:[],align:[],rows:[]};if(n.length===r.length){for(let o of r)this.rules.other.tableAlignRight.test(o)?s.align.push("right"):this.rules.other.tableAlignCenter.test(o)?s.align.push("center"):this.rules.other.tableAlignLeft.test(o)?s.align.push("left"):s.align.push(null);for(let o=0;o<n.length;o++)s.header.push({text:n[o],tokens:this.lexer.inline(n[o]),header:!0,align:s.align[o]});for(let o of i)s.rows.push(Ai(o,s.header.length).map((p,l)=>({text:p,tokens:this.lexer.inline(p),header:!1,align:s.align[l]})));return s}}lheading(t){let e=this.rules.block.lheading.exec(t);if(e){let n=e[1].trim();return{type:"heading",raw:ke(e[0],`
|
|
930
|
+
`),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=ke(n.slice(0,-1),"\\");if((n.length-s.length)%2===0)return}else{let s=Po(e[2],"()");if(s===-2)return;if(s>-1){let o=(e[0].indexOf("!")===0?5:4)+e[1].length+s;e[2]=e[2].substring(0,s),e[0]=e[0].substring(0,o).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)),Ri(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 Ri(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,o,p=i,l=0,u=r[0][0]==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(u.lastIndex=0,e=e.slice(-1*t.length+i);(r=u.exec(e))!==null;){if(s=r[1]||r[2]||r[3]||r[4]||r[5]||r[6],!s)continue;if(o=[...s].length,r[3]||r[4]){p+=o;continue}else if((r[5]||r[6])&&i%3&&!((i+o)%3)){l+=o;continue}if(p-=o,p>0)continue;o=Math.min(o,o+p+l);let d=[...r[0]][0].length,h=t.slice(0,i+r.index+d+o);if(Math.min(i,o)%2){let g=h.slice(1,-1);return{type:"em",raw:h,text:g,tokens:this.lexer.inlineTokens(g)}}let m=h.slice(2,-2);return{type:"strong",raw:h,text:m,tokens:this.lexer.inlineTokens(m)}}}}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,o,p=i,l=this.rules.inline.delRDelim;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||(o=[...s].length,o!==i))continue;if(r[3]||r[4]){p+=o;continue}if(p-=o,p>0)continue;o=Math.min(o,o+p);let u=[...r[0]][0].length,d=t.slice(0,i+r.index+u+o),h=d.slice(i,-i);return{type:"del",raw:d,text:h,tokens:this.lexer.inlineTokens(h)}}}}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}}}},ie=class $n{constructor(e){b(this,"tokens");b(this,"options");b(this,"state");b(this,"inlineQueue");b(this,"tokenizer");this.tokens=[],this.tokens.links=Object.create(null),this.options=e||Ce,this.options.tokenizer=this.options.tokenizer||new zt,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:X,block:Ot.normal,inline:rt.normal};this.options.pedantic?(n.block=Ot.pedantic,n.inline=rt.pedantic):this.options.gfm&&(n.block=Ot.gfm,this.options.breaks?n.inline=rt.breaks:n.inline=rt.gfm),this.tokenizer.rules=n}static get rules(){return{block:Ot,inline:rt}}static lex(e,n){return new $n(n).lex(e)}static lexInline(e,n){return new $n(n).inlineTokens(e)}lex(e){e=e.replace(X.carriageReturn,`
|
|
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){for(this.tokenizer.lexer=this,this.options.pedantic&&(e=e.replace(X.tabCharGlobal," ").replace(X.spaceLine,""));e;){let i;if(this.options.extensions?.block?.some(o=>(i=o.call({lexer:this},e,n))?(e=e.substring(i.raw.length),n.push(i),!0):!1))continue;if(i=this.tokenizer.space(e)){e=e.substring(i.raw.length);let o=n.at(-1);i.raw.length===1&&o!==void 0?o.raw+=`
|
|
933
|
+
`:n.push(i);continue}if(i=this.tokenizer.code(e)){e=e.substring(i.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
934
|
+
`)?"":`
|
|
935
|
+
`)+i.raw,o.text+=`
|
|
936
|
+
`+i.text,this.inlineQueue.at(-1).src=o.text):n.push(i);continue}if(i=this.tokenizer.fences(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.heading(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.hr(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.blockquote(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.list(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.html(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.def(e)){e=e.substring(i.raw.length);let o=n.at(-1);o?.type==="paragraph"||o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
937
|
+
`)?"":`
|
|
938
|
+
`)+i.raw,o.text+=`
|
|
939
|
+
`+i.raw,this.inlineQueue.at(-1).src=o.text):this.tokens.links[i.tag]||(this.tokens.links[i.tag]={href:i.href,title:i.title},n.push(i));continue}if(i=this.tokenizer.table(e)){e=e.substring(i.raw.length),n.push(i);continue}if(i=this.tokenizer.lheading(e)){e=e.substring(i.raw.length),n.push(i);continue}let s=e;if(this.options.extensions?.startBlock){let o=1/0,p=e.slice(1),l;this.options.extensions.startBlock.forEach(u=>{l=u.call({lexer:this},p),typeof l=="number"&&l>=0&&(o=Math.min(o,l))}),o<1/0&&o>=0&&(s=e.substring(0,o+1))}if(this.state.top&&(i=this.tokenizer.paragraph(s))){let o=n.at(-1);r&&o?.type==="paragraph"?(o.raw+=(o.raw.endsWith(`
|
|
940
|
+
`)?"":`
|
|
941
|
+
`)+i.raw,o.text+=`
|
|
942
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(i),r=s.length!==e.length,e=e.substring(i.raw.length);continue}if(i=this.tokenizer.text(e)){e=e.substring(i.raw.length);let o=n.at(-1);o?.type==="text"?(o.raw+=(o.raw.endsWith(`
|
|
943
|
+
`)?"":`
|
|
944
|
+
`)+i.raw,o.text+=`
|
|
945
|
+
`+i.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=o.text):n.push(i);continue}if(e){let o="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(o);break}else throw new Error(o)}}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 o=!1,p="";for(;e;){o||(p=""),o=!1;let l;if(this.options.extensions?.inline?.some(d=>(l=d.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 d=n.at(-1);l.type==="text"&&d?.type==="text"?(d.raw+=l.raw,d.text+=l.text):n.push(l);continue}if(l=this.tokenizer.emStrong(e,r,p)){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,p)){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 u=e;if(this.options.extensions?.startInline){let d=1/0,h=e.slice(1),m;this.options.extensions.startInline.forEach(g=>{m=g.call({lexer:this},h),typeof m=="number"&&m>=0&&(d=Math.min(d,m))}),d<1/0&&d>=0&&(u=e.substring(0,d+1))}if(l=this.tokenizer.inlineText(u)){e=e.substring(l.raw.length),l.raw.slice(-1)!=="_"&&(p=l.raw.slice(-1)),o=!0;let d=n.at(-1);d?.type==="text"?(d.raw+=l.raw,d.text+=l.text):n.push(l);continue}if(e){let d="Infinite loop on byte: "+e.charCodeAt(0);if(this.options.silent){console.error(d);break}else throw new Error(d)}}return n}},Ft=class{constructor(t){b(this,"options");b(this,"parser");this.options=t||Ce}space(t){return""}code({text:t,lang:e,escaped:n}){let r=(e||"").match(X.notSpaceStart)?.[0],i=t.replace(X.endingNewline,"")+`
|
|
946
|
+
`;return r?'<pre><code class="language-'+ce(r)+'">'+(n?i:ce(i,!0))+`</code></pre>
|
|
947
|
+
`:"<pre><code>"+(n?i:ce(i,!0))+`</code></pre>
|
|
948
|
+
`}blockquote({tokens:t}){return`<blockquote>
|
|
949
|
+
${this.parser.parse(t)}</blockquote>
|
|
950
|
+
`}html({text:t}){return t}def(t){return""}heading({tokens:t,depth:e}){return`<h${e}>${this.parser.parseInline(t)}</h${e}>
|
|
951
|
+
`}hr(t){return`<hr>
|
|
952
|
+
`}list(t){let e=t.ordered,n=t.start,r="";for(let o=0;o<t.items.length;o++){let p=t.items[o];r+=this.listitem(p)}let i=e?"ol":"ul",s=e&&n!==1?' start="'+n+'"':"";return"<"+i+s+`>
|
|
953
|
+
`+r+"</"+i+`>
|
|
954
|
+
`}listitem(t){return`<li>${this.parser.parse(t.tokens)}</li>
|
|
955
|
+
`}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 o=0;o<s.length;o++)n+=this.tablecell(s[o]);r+=this.tablerow({text:n})}return r&&(r=`<tbody>${r}</tbody>`),`<table>
|
|
957
|
+
<thead>
|
|
958
|
+
`+e+`</thead>
|
|
959
|
+
`+r+`</table>
|
|
960
|
+
`}tablerow({text:t}){return`<tr>
|
|
961
|
+
${t}</tr>
|
|
962
|
+
`}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>${ce(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=Ei(t);if(i===null)return r;t=i;let s='<a href="'+t+'"';return e&&(s+=' title="'+ce(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=Ei(t);if(i===null)return ce(n);t=i;let s=`<img src="${t}" alt="${ce(n)}"`;return e&&(s+=` title="${ce(e)}"`),s+=">",s}text(t){return"tokens"in t&&t.tokens?this.parser.parseInline(t.tokens):"escaped"in t&&t.escaped?t.text:ce(t.text)}},Un=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}},se=class Dn{constructor(e){b(this,"options");b(this,"renderer");b(this,"textRenderer");this.options=e||Ce,this.options.renderer=this.options.renderer||new Ft,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Un}static parse(e,n){return new Dn(n).parse(e)}static parseInline(e,n){return new Dn(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 o=i,p=this.options.extensions.renderers[o.type].call({parser:this},o);if(p!==!1||!["space","hr","heading","code","table","blockquote","list","html","def","paragraph","text"].includes(o.type)){n+=p||"";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 o='Token with "'+s.type+'" type was not found.';if(this.options.silent)return console.error(o),"";throw new Error(o)}}}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 p=this.options.extensions.renderers[s.type].call({parser:this},s);if(p!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(s.type)){r+=p||"";continue}}let o=s;switch(o.type){case"escape":{r+=n.text(o);break}case"html":{r+=n.html(o);break}case"link":{r+=n.link(o);break}case"image":{r+=n.image(o);break}case"checkbox":{r+=n.checkbox(o);break}case"strong":{r+=n.strong(o);break}case"em":{r+=n.em(o);break}case"codespan":{r+=n.codespan(o);break}case"br":{r+=n.br(o);break}case"del":{r+=n.del(o);break}case"text":{r+=n.text(o);break}default:{let p='Token with "'+o.type+'" type was not found.';if(this.options.silent)return console.error(p),"";throw new Error(p)}}}return r}},Nt,it=(Nt=class{constructor(t){b(this,"options");b(this,"block");this.options=t||Ce}preprocess(t){return t}postprocess(t){return t}processAllTokens(t){return t}emStrongMask(t){return t}provideLexer(t=this.block){return t?ie.lex:ie.lexInline}provideParser(t=this.block){return t?se.parse:se.parseInline}},b(Nt,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens","emStrongMask"])),b(Nt,"passThroughHooksRespectAsync",new Set(["preprocess","postprocess","processAllTokens"])),Nt),jn=class{constructor(...t){b(this,"defaults",Pn());b(this,"options",this.setOptions);b(this,"parse",this.parseMarkdown(!0));b(this,"parseInline",this.parseMarkdown(!1));b(this,"Parser",se);b(this,"Renderer",Ft);b(this,"TextRenderer",Un);b(this,"Lexer",ie);b(this,"Tokenizer",zt);b(this,"Hooks",it);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 o of s)n=n.concat(this.walkTokens(o.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 o=i[s].flat(1/0);n=n.concat(this.walkTokens(o,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(...o){let p=i.renderer.apply(this,o);return p===!1&&(p=s.apply(this,o)),p}: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 Ft(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 o=s,p=n.renderer[o],l=i[o];i[o]=(...u)=>{let d=p.apply(i,u);return d===!1&&(d=l.apply(i,u)),d||""}}r.renderer=i}if(n.tokenizer){let i=this.defaults.tokenizer||new zt(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 o=s,p=n.tokenizer[o],l=i[o];i[o]=(...u)=>{let d=p.apply(i,u);return d===!1&&(d=l.apply(i,u)),d}}r.tokenizer=i}if(n.hooks){let i=this.defaults.hooks||new it;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 o=s,p=n.hooks[o],l=i[o];it.passThroughHooks.has(s)?i[o]=u=>{if(this.defaults.async&&it.passThroughHooksRespectAsync.has(s))return(async()=>{let h=await p.call(i,u);return l.call(i,h)})();let d=p.call(i,u);return l.call(i,d)}:i[o]=(...u)=>{if(this.defaults.async)return(async()=>{let h=await p.apply(i,u);return h===!1&&(h=await l.apply(i,u)),h})();let d=p.apply(i,u);return d===!1&&(d=l.apply(i,u)),d}}r.hooks=i}if(n.walkTokens){let i=this.defaults.walkTokens,s=n.walkTokens;r.walkTokens=function(o){let p=[];return p.push(s.call(this,o)),i&&(p=p.concat(i.call(this,o))),p}}this.defaults={...this.defaults,...r}}),this}setOptions(t){return this.defaults={...this.defaults,...t},this}lexer(t,e){return ie.lex(t,e??this.defaults)}parser(t,e){return se.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 o=i.hooks?await i.hooks.preprocess(e):e,p=await(i.hooks?await i.hooks.provideLexer(t):t?ie.lex:ie.lexInline)(o,i),l=i.hooks?await i.hooks.processAllTokens(p):p;i.walkTokens&&await Promise.all(this.walkTokens(l,i.walkTokens));let u=await(i.hooks?await i.hooks.provideParser(t):t?se.parse:se.parseInline)(l,i);return i.hooks?await i.hooks.postprocess(u):u})().catch(s);try{i.hooks&&(e=i.hooks.preprocess(e));let o=(i.hooks?i.hooks.provideLexer(t):t?ie.lex:ie.lexInline)(e,i);i.hooks&&(o=i.hooks.processAllTokens(o)),i.walkTokens&&this.walkTokens(o,i.walkTokens);let p=(i.hooks?i.hooks.provideParser(t):t?se.parse:se.parseInline)(o,i);return i.hooks&&(p=i.hooks.postprocess(p)),p}catch(o){return s(o)}}}onError(t,e){return n=>{if(n.message+=`
|
|
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 jn;function C(t,e){return Re.parse(t,e)}C.options=C.setOptions=function(t){return Re.setOptions(t),C.defaults=Re.defaults,Ci(C.defaults),C};C.getDefaults=Pn;C.defaults=Ce;C.use=function(...t){return Re.use(...t),C.defaults=Re.defaults,Ci(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=Un;C.Lexer=ie;C.lexer=ie.lex;C.Tokenizer=zt;C.Hooks=it;C.parse=C;var Sa=C.options,Ea=C.setOptions,Aa=C.use,Ia=C.walkTokens,Ra=C.parseInline;var Ca=se.parse,La=ie.lex;var Mo=new jn({async:!1,gfm:!0,breaks:!0});typeof window<"u"&&Cn.addHook("afterSanitizeAttributes",t=>{t.tagName==="A"&&(t.setAttribute("target","_blank"),t.setAttribute("rel","noopener noreferrer"))});function Wn(t){let e=Mo.parse(t);return Cn.sanitize(e,{USE_PROFILES:{html:!0}})}function Hi(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 zo({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 Fo(t){return t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`}function Ho({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:Fo(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 Bi({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(Ho,{attachment:i},i.id))})}function Bo({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 Uo({msg:t}){let e=t.senderType==="user",n=t.senderType==="agent"?t.agentName??t.senderName??"Support":null,r=e?"You":n??"Support",i=Ee(()=>Wn(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]),p=Ee(()=>{let l=t.metadata?.linkPreview;if(!l||typeof l!="object")return null;let u=l;return typeof u.url!="string"?null:u},[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(Bi,{messageId:t.id}),o&&c(Ui,{articles:o}),p&&c(Bo,{preview:p}),c("div",{class:"sr-message-meta",children:[!e&&c(zo,{name:r,imageUrl:t.agentAvatarUrl}),c("span",{class:"sr-message-sender",children:r}),c("span",{children:"\xB7"}),c("span",{children:Hi(t.createdAt)})]})]})}function jo({ticketId:t}){let[e,n]=z(""),[r,i]=z(!1),[s,o]=z([]),[p,l]=z(!1),u=Ve(null),d=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]),h=fe(async()=>{if(!(!e.trim()&&s.length===0||r)){i(!0);try{await ii(t,e.trim()||"(attachment)",s.length?s:void 0),n(""),o([]);let _=await kn(t);J({activeConversation:_})}catch{}finally{i(!1)}}},[e,r,t,s]),m=fe(_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),h())},[h]),g=(!!e.trim()||s.length>0)&&!r;return c("div",{class:"sr-composer",children:[(s.length>0||p)&&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)),p&&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:()=>u.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:h,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:u,type:"file",multiple:!0,style:{display:"none"},onChange:d})]})}function Wo({article:t}){let[e,n]=z(null),[r,i]=z(!1),[s,o]=z(!1),p=Ee(()=>e?Wn(e):"",[e]),l=fe(async()=>{if(r){i(!1);return}if(e){i(!0);return}o(!0);let u=await oi(t.workspaceSlug,t.slug);if(u?.page.contentUrl)try{let d=await fetch(u.page.contentUrl);if(d.ok){let h=await d.text();n(h)}}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&&p&&c("div",{class:"sr-article-content sr-prose",dangerouslySetInnerHTML:{__html:p}})]})}function Ui({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(Wo,{article:e},e.pageId))]})}function ji(){let t=Ae(),e=t.activeTicketId,n=t.activeConversation,r=Ve(null);return Se(()=>{e&&(J({loading:!0}),kn(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:Wn(n.ticket.description)}}),c(Bi,{messageId:null}),c("div",{class:"sr-message-meta",children:[c("span",{class:"sr-message-sender",children:"You"}),c("span",{children:"\xB7"}),c("span",{children:Hi(n.ticket.createdAt)})]})]}),n.ticket.suggestedArticles&&n.ticket.suggestedArticles.length>0&&c(Ui,{articles:n.ticket.suggestedArticles}),n.messages.map(i=>c(Uo,{msg:i},i.id)),c("div",{ref:r})]}),c(jo,{ticketId:e})]}):null}function Wi({position:t,isOpen:e}){return c("button",{class:`sr-launcher ${t==="bottom-left"?"left":"right"}`,onClick:li,"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 Gi(){let t=ee._getIdentity(),e=!!t.email,[n,r]=z(""),[i,s]=z(""),[o,p]=z(t.email??""),[l,u]=z(!1),[d,h]=z(null),[m,g]=z(!1),[_,E]=z(null),[w,v]=z([]),[T,D]=z(!1),A=Ve(null),B=fe(async I=>{let F=I.target,$=F.files;if($){for(let ue=0;ue<$.length&&w.length+ue<5;ue++){D(!0);try{let Le=await Rt($[ue]);v($e=>[...$e,Le])}catch{h("File upload failed")}finally{D(!1)}}F.value=""}},[w.length]),q=fe(I=>{v(F=>F.filter($=>$.storageKey!==I))},[]),pe=fe(async I=>{if(I.preventDefault(),!(!n.trim()||!i.trim())){u(!0),h(null);try{let F=await ri({subject:n.trim(),description:i.trim(),email:o.trim()||void 0,attachments:w.length?w:void 0});g(!0),E(F.id)}catch(F){h(F instanceof Error?F.message:"Something went wrong")}finally{u(!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:pe,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:B})]}),(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=>p(I.target.value),placeholder:"your@email.com"})]}),d&&c("div",{class:"sr-error",children:d})]})}function Go(){return c("button",{onClick:ci,"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 qo(){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 qi({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(()=>ai(()=>e(l=>l+1)),[]);let s=Ae(),o=s.activeConversation?.ticket.subject??s.tickets.find(l=>l.id===s.activeTicketId)?.subject??"Conversation",p={conversations:r,"new-ticket":t.labels?.newTicket??"New conversation",thread:o};return c(be,{children:[c(Wi,{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(Go,{})}),c("h3",{class:s.view==="thread"?"sr-header-title-truncate":"",children:p[s.view]}),c("div",{class:"sr-header-actions",children:s.view==="conversations"&&c(qo,{})})]}),c("div",{class:"sr-body",children:[s.view==="conversations"&&c(pi,{}),s.view==="new-ticket"&&c(Gi,{}),s.view==="thread"&&c(ji,{})]})]})]})}var Ut=!1,we=null;function Ko(t={}){if(Ut||typeof document>"u")return;Ut=!0,we=document.createElement("div"),we.id="scoperat-widget";let e=we.attachShadow({mode:"open"}),n=document.createElement("style");n.textContent=Rr(t.theme,t.darkMode),e.appendChild(n);let r=document.createElement("div");e.appendChild(r),document.body.appendChild(we),un(ln(qi,{options:t}),r)}function Vo(){!Ut||!we||(un(null,we.shadowRoot.lastElementChild),we.remove(),we=null,Ut=!1)}return ps(Yo);})();
|
|
965
|
+
/*! Bundled license information:
|
|
966
|
+
|
|
967
|
+
dompurify/dist/purify.es.mjs:
|
|
968
|
+
(*! @license DOMPurify 3.4.0 | (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.0/LICENSE *)
|
|
969
|
+
*/
|
|
970
|
+
//# sourceMappingURL=widget.global.js.map
|