diff --git a/src/webview/highlight.js b/src/webview/highlight.js index 61a9914..63b3f28 100644 --- a/src/webview/highlight.js +++ b/src/webview/highlight.js @@ -1,88 +1,50 @@ -"use strict";var Gr=Object.defineProperty;var In=t=>{throw TypeError(t)};var Zr=(t,e,n)=>e in t?Gr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ct=(t,e,n)=>Zr(t,typeof e!="symbol"?e+"":e,n),qn=(t,e,n)=>e.has(t)||In("Cannot "+n);var K=(t,e,n)=>(qn(t,e,"read from private field"),n?n.call(t):e.get(t)),ze=(t,e,n)=>e.has(t)?In("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Xe=(t,e,n,r)=>(qn(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);(function(){var t=window.Document.prototype.createElement,e=window.Document.prototype.createElementNS,n=window.Document.prototype.importNode,r=window.Document.prototype.prepend,o=window.Document.prototype.append,s=window.DocumentFragment.prototype.prepend,l=window.DocumentFragment.prototype.append,d=window.Node.prototype.cloneNode,h=window.Node.prototype.appendChild,f=window.Node.prototype.insertBefore,_=window.Node.prototype.removeChild,g=window.Node.prototype.replaceChild,C=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),m=window.Element.prototype.attachShadow,b=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),T=window.Element.prototype.getAttribute,L=window.Element.prototype.setAttribute,S=window.Element.prototype.removeAttribute,k=window.Element.prototype.toggleAttribute,$=window.Element.prototype.getAttributeNS,A=window.Element.prototype.setAttributeNS,xt=window.Element.prototype.removeAttributeNS,Z=window.Element.prototype.insertAdjacentElement,N=window.Element.prototype.insertAdjacentHTML,P=window.Element.prototype.prepend,I=window.Element.prototype.append,F=window.Element.prototype.before,O=window.Element.prototype.after,X=window.Element.prototype.replaceWith,U=window.Element.prototype.remove,wt=window.HTMLElement,ut=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),te=window.HTMLElement.prototype.insertAdjacentElement,ee=window.HTMLElement.prototype.insertAdjacentHTML,Sn=new Set;"annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ").forEach(function(i){return Sn.add(i)});function An(i){var a=Sn.has(i);return i=/^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(i),!a&&i}var Vr=document.contains?document.contains.bind(document):document.documentElement.contains.bind(document.documentElement);function V(i){var a=i.isConnected;if(a!==void 0)return a;if(Vr(i))return!0;for(;i&&!(i.__CE_isImportDocument||i instanceof Document);)i=i.parentNode||(window.ShadowRoot&&i instanceof ShadowRoot?i.host:void 0);return!(!i||!(i.__CE_isImportDocument||i instanceof Document))}function Be(i){var a=i.children;if(a)return Array.prototype.slice.call(a);for(a=[],i=i.firstChild;i;i=i.nextSibling)i.nodeType===Node.ELEMENT_NODE&&a.push(i);return a}function Ve(i,a){for(;a&&a!==i&&!a.nextSibling;)a=a.parentNode;return a&&a!==i?a.nextSibling:null}function We(i,a,c){for(var p=i;p;){if(p.nodeType===Node.ELEMENT_NODE){var u=p;a(u);var v=u.localName;if(v==="link"&&u.getAttribute("rel")==="import"){if(p=u.import,c===void 0&&(c=new Set),p instanceof Node&&!c.has(p))for(c.add(p),p=p.firstChild;p;p=p.nextSibling)We(p,a,c);p=Ve(i,u);continue}else if(v==="template"){p=Ve(i,u);continue}if(u=u.__CE_shadowRoot)for(u=u.firstChild;u;u=u.nextSibling)We(u,a,c)}p=p.firstChild?p.firstChild:Ve(i,p)}}function me(){var i=!(dt==null||!dt.noDocumentConstructionObserver),a=!(dt==null||!dt.shadyDomFastWalk);this.m=[],this.g=[],this.j=!1,this.shadyDomFastWalk=a,this.I=!i}function ne(i,a,c,p){var u=window.ShadyDOM;if(i.shadyDomFastWalk&&u&&u.inUse){if(a.nodeType===Node.ELEMENT_NODE&&c(a),a.querySelectorAll)for(i=u.nativeMethods.querySelectorAll.call(a,"*"),a=0;a{Zt(e)}}function bn(t){return Gt(or,t,!1)}function he(t){return Gt(Jt,t,!0)}function vt(t){return he(t)}function cr(t,e=0){return Gt(Jt|ir|e,t,!0)}function ae(t,e=!0){return Gt(Jt|Lt,t,!0,e)}function fr(t){var e=t.teardown;if(e!==null){const n=kn,r=H;Vn(!0),Se(null);try{e.call(null)}finally{Vn(n),Se(r)}}}function Zt(t,e=!0){var n=!1;if((e||t.f&ao)&&t.nodes_start!==null){for(var r=t.nodes_start,o=t.nodes_end;r!==null;){var s=r===o?null:$t(r);r.remove(),r=s}n=!0}Cr(t,e&&!n),ce(t,0),gt(t,de);var l=t.transitions;if(l!==null)for(const h of l)h.stop();fr(t);var d=t.parent;d!==null&&d.first!==null&&dr(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.parent=t.fn=t.nodes_start=t.nodes_end=null}function dr(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function en(t,e){var n=[];En(t,n,!0),hr(n,()=>{Zt(t),e&&e()})}function hr(t,e){var n=t.length;if(n>0){var r=()=>--n||e();for(var o of t)o.out(r)}else e()}function En(t,e,n){if(!(t.f&Ht)){if(t.f^=Ht,t.transitions!==null)for(const l of t.transitions)(l.is_global||n)&&e.push(l);for(var r=t.first;r!==null;){var o=r.next,s=(r.f&mn)!==0||(r.f&Lt)!==0;En(r,e,s?n:!1),r=o}}}function xe(t){vr(t,!0)}function vr(t,e){if(t.f&Ht){t.f^=Ht,ve(t)&&Re(t);for(var n=t.first;n!==null;){var r=n.next,o=(n.f&mn)!==0||(n.f&Lt)!==0;vr(n,o?e:!1),n=r}if(t.transitions!==null)for(const s of t.transitions)(s.is_global||e)&&s.in()}}const xo=typeof requestIdleCallback>"u"?t=>setTimeout(t,1):requestIdleCallback;let Te=!1,Ne=!1,nn=[],rn=[];function pr(){Te=!1;const t=nn.slice();nn=[],rr(t)}function _r(){Ne=!1;const t=rn.slice();rn=[],rr(t)}function Pt(t){Te||(Te=!0,queueMicrotask(pr)),nn.push(t)}function To(t){Ne||(Ne=!0,xo(_r)),rn.push(t)}function No(){Te&&pr(),Ne&&_r()}function Cn(t){let e=kt|St;M===null?e|=It:M.f|=sr;const n={children:null,deps:null,equals:lr,f:e,fn:t,reactions:null,v:null,version:0,parent:M};if(H!==null&&H.f&kt){var r=H;(r.children??(r.children=[])).push(n)}return n}function gr(t){var e=t.children;if(e!==null){t.children=null;for(var n=0;nt.version)return!0}}r||gt(t,G)}return!1}function Mo(t,e,n){throw t}function Er(t){var _;var e=z,n=et,r=Nt,o=H,s=Yt,l=pt;z=null,et=0,Nt=null,H=t.f&(Lt|Oe)?null:t,Yt=!zt&&(t.f&It)!==0,pt=null;try{var d=(0,t.fn)(),h=t.deps;if(z!==null){var f;if(ce(t,et),h!==null&&et>0)for(h.length=et+z.length,f=0;f1e3&&(Xt=0,_o()),Xt++}function $r(t){var e=t.length;if(e!==0){kr();var n=zt;zt=!0;try{for(var r=0;r1001)return;const t=Ot;Ot=[],$r(t),ue||(Xt=0)}function Fe(t){be===wr&&(ue||(ue=!0,queueMicrotask(Ro)));for(var e=t;e.parent!==null;){e=e.parent;var n=e.f;if(n&(Oe|Lt)){if(!(n&G))return;e.f^=G}}Ot.push(e)}function xr(t,e){var n=t.first,r=[];t:for(;n!==null;){var o=n.f,s=(o&Lt)!==0,l=s&&(o&G)!==0;if(!l&&!(o&Ht))if(o&Jt){s?n.f^=G:ve(n)&&Re(n);var d=n.first;if(d!==null){n=d;continue}}else o&or&&r.push(n);var h=n.next;if(h===null){let g=n.parent;for(;g!==null;){if(t===g)break t;var f=g.next;if(f!==null){n=f;continue t}g=g.parent}}n=h}for(var _=0;_0||o.length>0)&&Qt(),Xt=0,r}finally{be=e,Ot=n}}function x(t){var e=t.f;if(e&de)return t.v;if(H!==null){pt!==null&&pt.includes(t)&&bo();var n=H.deps;z===null&&n!==null&&n[et]===t?et++:z===null?z=[t]:z.push(t),Nt!==null&&M!==null&&M.f&G&&!(M.f&Lt)&&Nt.includes(t)&&(gt(M,St),Fe(M))}if(e&kt){var r=t;ve(r)&&mr(r)}return t.v}function Fo(t){const e=H;try{return H=null,t()}finally{H=e}}const Ho=~(St|fe|G);function gt(t,e){t.f=t.f&Ho|e}function pe(t,e=!1,n){Y={p:Y,c:null,e:null,m:!1,s:t,x:null,l:null},e||(Y.l={s:null,u:null,r1:[],r2:nt(!1)})}function _e(t){const e=Y;if(e!==null){t!==void 0&&(e.x=t);const l=e.e;if(l!==null){var n=M,r=H;e.e=null;try{for(var o=0;o=S.v&&B(S,k+1)}Wn(l)}return!0},ownKeys(h){x(l);var f=Reflect.ownKeys(h).filter(C=>{var m=o.get(C);return m===void 0||m.v!==tt});for(var[_,g]of o)g.v!==tt&&!(_ in h)&&f.push(_);return f},setPrototypeOf(){yo()}})}function Wn(t,e=1){B(t,t.v+e)}function Le(t){return t!==null&&typeof t=="object"&&Ut in t?t[Ut]:t}function Po(t,e){return Object.is(Le(t),Le(e))}var Me,Mt,Tr,Nr;function on(){if(Me===void 0){Me=window,Mt=document;var t=Element.prototype,e=Node.prototype;Tr=Rt(e,"firstChild").get,Nr=Rt(e,"nextSibling").get,t.__click=void 0,t.__className="",t.__attributes=null,t.__e=void 0,Text.prototype.__t=void 0}}function ge(t=""){return document.createTextNode(t)}function At(t){return Tr.call(t)}function $t(t){return Nr.call(t)}function lt(t){if(!j)return At(t);var e=At(R);return e===null&&(e=R.appendChild(ge())),_t(e),e}function $n(t,e){if(!j){var n=At(t);return n instanceof Comment&&n.data===""?$t(n):n}return R}function rt(t,e=1,n=!1){let r=j?R:t;for(;e--;)r=$t(r);if(!j)return r;var o=r.nodeType;if(n&&o!==3){var s=ge();return r==null||r.before(s),_t(s),s}return _t(r),r}function xn(t){t.textContent=""}let j=!1;function Ct(t){j=t}let R;function _t(t){if(t===null)throw pn(),se;return R=t}function He(){return _t($t(R))}function J(t){if(j){if($t(R)!==null)throw pn(),se;R=t}}function Io(t=1){if(j){for(var e=t,n=R;e--;)n=$t(n);R=n}}function sn(){for(var t=0,e=R;;){if(e.nodeType===8){var n=e.data;if(n===vn){if(t===0)return e;t-=1}else(n===er||n===hn)&&(t+=1)}var r=$t(e);e.remove(),e=r}}const Sr=new Set,ln=new Set;function qo(t,e,n,r){function o(s){if(r.capture||oe.call(e,s),!s.cancelBubble)return n.call(this,s)}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Pt(()=>{e.addEventListener(t,o,r)}):e.addEventListener(t,o,r),o}function ht(t,e,n,r,o){var s={capture:r,passive:o},l=qo(t,e,n,s);(e===document.body||e===window||e===document)&&ur(()=>{e.removeEventListener(t,l,s)})}function Ar(t){for(var e=0;e{throw S});throw _}}finally{t.__root=e,delete t.currentTarget}}}function Bo(t){var e=document.createElement("template");return e.innerHTML=t,e.content}function Kt(t,e){var n=M;n.nodes_start===null&&(n.nodes_start=t,n.nodes_end=e)}function mt(t,e){var n=(e&no)!==0,r=(e&ro)!==0,o,s=!t.startsWith("");return()=>{if(j)return Kt(R,null),R;o===void 0&&(o=Bo(s?t:""+t),n||(o=At(o)));var l=r?document.importNode(o,!0):o.cloneNode(!0);if(n){var d=At(l),h=l.lastChild;Kt(d,h)}else Kt(l,l);return l}}function Vo(){if(j)return Kt(R,null),R;var t=document.createDocumentFragment(),e=document.createComment(""),n=ge();return t.append(e,n),Kt(e,n),t}function at(t,e){if(j){M.nodes_end=R,He();return}t!==null&&t.before(e)}const Wo=["touchstart","touchmove"];function Yo(t){return Wo.includes(t)}function Ke(t,e){e!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=e,t.nodeValue=e==null?"":e+"")}function Dr(t,e){const n=e.anchor??e.target.appendChild(ge());return Lr(t,{...e,anchor:n})}function Uo(t,e){on(),e.intro=e.intro??!1;const n=e.target,r=j,o=R;try{for(var s=At(n);s&&(s.nodeType!==8||s.data!==er);)s=$t(s);if(!s)throw se;Ct(!0),_t(s),He();const l=Lr(t,{...e,anchor:s});if(R===null||R.nodeType!==8||R.data!==vn)throw pn(),se;return Ct(!1),l}catch(l){if(l===se)return e.recover===!1&&go(),on(),xn(n),Ct(!1),Dr(t,e);throw l}finally{Ct(r),_t(o)}}const Wt=new Map;function Lr(t,{target:e,anchor:n,props:r={},events:o,context:s,intro:l=!0}){on();var d=new Set,h=g=>{for(var C=0;C(ae(()=>{if(s){pe({});var g=Y;g.c=s}o&&(r.$$events=o),j&&Kt(n,null),f=t(n,r)||{},j&&(M.nodes_end=R),s&&_e()}),()=>{for(var g of d){e.removeEventListener(g,oe);var C=Wt.get(g);--C===0?(document.removeEventListener(g,oe),Wt.delete(g)):Wt.set(g,C)}ln.delete(h),an.delete(f)}));return an.set(f,_),f}let an=new WeakMap;function zo(t){const e=an.get(t);e&&e()}function je(t,e,n,r=null,o=!1){j&&He();var s=t,l=null,d=null,h=null,f=o?mn:0;cr(()=>{if(h===(h=!!e()))return;let _=!1;if(j){const g=s.data===hn;h===g&&(s=sn(),_t(s),Ct(!1),_=!0)}h?(l?xe(l):l=ae(()=>n(s)),d&&en(d,()=>{d=null})):(d?xe(d):r&&(d=ae(()=>r(s))),l&&en(l,()=>{l=null})),_&&Ct(!0)},f),j&&(s=R)}let Je=null;function Xo(t,e){return e}function Ko(t,e,n,r){for(var o=[],s=e.length,l=0;l0&&o.length===0&&n!==null;if(d){var h=n.parentNode;xn(h),h.append(n),r.clear(),Tt(t,e[0].prev,e[s-1].next)}hr(o,()=>{for(var f=0;f{var g=n(),C=_n(g)?g:g==null?[]:gn(g),m=C.length;let b=!1;if(j){var T=l.data===hn;T!==(m===0)&&(l=sn(),_t(l),Ct(!1),b=!0)}if(j){for(var L=null,S,k=0;k0&&_t(sn())}j||Jo(C,d,l,o,e,r),s!==null&&(m===0?_?xe(_):_=ae(()=>s(l)):_!==null&&en(_,()=>{_=null})),b&&Ct(!0)}),j&&(l=R)}function Jo(t,e,n,r,o,s){var U,wt,ut,te;var l=(o&Qr)!==0,d=(o&(fn|dn))!==0,h=t.length,f=e.items,_=e.first,g=_,C,m=null,b,T=[],L=[],S,k,$,A;if(l)for(A=0;A0){var X=o&tr&&h===0?n:null;if(l){for(A=0;A{var ee;if(b!==void 0)for($ of b)(ee=$.a)==null||ee.apply()}),M.first=e.first&&e.first.e,M.last=m&&m.e}function Go(t,e,n,r){r&fn&&B(t.v,e),r&dn?B(t.i,n):t.i=n}function Mr(t,e,n,r,o,s,l,d,h){var f=Je;try{var _=(h&fn)!==0,g=(h&to)===0,C=_?g?wn(o):nt(o):o,m=h&dn?nt(l):l,b={i:m,v:C,k:s,a:null,e:null,prev:n,next:r};return Je=b,b.e=ae(()=>d(t,C,m),j),b.e.prev=n&&n.e,b.e.next=r&&r.e,n===null?e.first=b:(n.next=b,n.e.next=b.e),r!==null&&(r.prev=b,r.e.prev=b.e),b}finally{Je=f}}function Yn(t,e,n){for(var r=t.next?t.next.e.nodes_start:n,o=e?e.e.nodes_start:n,s=t.e.nodes_start;s!==r;){var l=$t(s);o.before(s),s=l}}function Tt(t,e,n){e===null?t.first=n:(e.next=n,e.e.next=n&&n.e),n!==null&&(n.prev=e,n.e.prev=e&&e.e)}function Nn(t,e){Pt(()=>{var n=t.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+e.hash)){const o=document.createElement("style");o.id=e.hash,o.textContent=e.code,r.appendChild(o)}})}function Zo(t,e){{const n=document.body;t.autofocus=!0,Pt(()=>{document.activeElement===n&&t.focus()})}}function Qo(t){j&&At(t)!==null&&xn(t)}let Un=!1;function jr(){Un||(Un=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n.__on_r)==null||e.call(n)})},{capture:!0}))}function ti(t){if(j){var e=!1,n=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var r=t.value;it(t,"value",null),t.value=r}if(t.hasAttribute("checked")){var o=t.checked;it(t,"checked",null),t.checked=o}}};t.__on_r=n,To(n),jr()}}function ei(t,e){var n=t.__attributes??(t.__attributes={});n.value!==(n.value=e)&&(t.value=e)}function it(t,e,n,r){var o=t.__attributes??(t.__attributes={});j&&(o[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||o[e]!==(o[e]=n)&&(e==="loading"&&(t[uo]=n),n==null?t.removeAttribute(e):typeof n!="string"&&ni(t).includes(e)?t[e]=n:t.setAttribute(e,n))}var zn=new Map;function ni(t){var e=zn.get(t.nodeName);if(e)return e;zn.set(t.nodeName,e=[]);for(var n,r=Qe(t);r.constructor.name!=="Element";){n=oo(r);for(var o in n)n[o].set&&e.push(o);r=Qe(r)}return e}function le(t,e,n){if(n){if(t.classList.contains(e))return;t.classList.add(e)}else{if(!t.classList.contains(e))return;t.classList.remove(e)}}function Or(t,e,n,r=n){t.addEventListener(e,n);const o=t.__on_r;o?t.__on_r=()=>{o(),r()}:t.__on_r=r,jr()}function ri(t,e,n=e){var r=De();Or(t,"input",()=>{var o=Kn(t)?Jn(t.value):t.value;n(o),r&&o!==(o=e())&&(t.value=o??"")}),he(()=>{var o=e();if(j&&t.defaultValue!==t.value){n(t.value);return}Kn(t)&&o===Jn(t.value)||t.type==="date"&&!o&&!t.value||(t.value=o??"")})}const Ge=new Set;function oi(t,e,n,r,o=r){var s=n.getAttribute("type")==="checkbox",l=t;let d=!1;if(e!==null)for(var h of e)l=l[h]??(l[h]=[]);l.push(n),Or(n,"change",()=>{var f=n.__value;s&&(f=Xn(l,f,n.checked)),o(f)},()=>o(s?[]:null)),he(()=>{var f=r();if(j&&n.defaultChecked!==n.checked){d=!0;return}s?(f=f||[],n.checked=Le(f).includes(Le(n.__value))):n.checked=Po(n.__value,f)}),ur(()=>{var f=l.indexOf(n);f!==-1&&l.splice(f,1)}),Ge.has(l)||(Ge.add(l),Pt(()=>{l.sort((f,_)=>f.compareDocumentPosition(_)===4?-1:1),Ge.delete(l)})),Pt(()=>{if(d){var f;if(s)f=Xn(l,f,n.checked);else{var _=l.find(g=>g.checked);f=_==null?void 0:_.__value}o(f)}})}function Xn(t,e,n){for(var r=new Set,o=0;o{var o,s;return he(()=>{o=s,s=[],Fo(()=>{t!==n(...s)&&(e(t,...s),o&&Gn(n(...o),t)&&e(null,...o))})}),()=>{Pt(()=>{s&&Gn(n(...s),t)&&e(null,...s)})}}),t}function Pe(t,e,n,r){var L;var o=(n&eo)!==0,s=t[e],l=(L=Rt(t,e))==null?void 0:L.set,d=r,h=!0,f=!1,_=()=>(f=!0,h&&(h=!1,d=r),d);s===void 0&&r!==void 0&&(l&&o&&mo(),s=_(),l&&l(s));var g;if(g=()=>{var S=t[e];return S===void 0?_():(h=!0,f=!1,S)},l){var C=t.$$legacy;return function(S,k){return arguments.length>0?((!k||C)&&l(k?g():S),S):g()}}var m=!1,b=wn(s),T=Cn(()=>{var S=g(),k=x(b);return m?(m=!1,k):b.v=S});return function(S,k){var $=x(T);if(arguments.length>0){const A=k?x(T):S;return T.equals(A)||(m=!0,B(b,A),f&&d!==void 0&&(d=A),x(T)),S}return $}}function ii(t){return new si(t)}var bt,ot;class si{constructor(e){ze(this,bt);ze(this,ot);var s;var n=new Map,r=(l,d)=>{var h=wn(d);return n.set(l,h),h};const o=new Proxy({...e.props||{},$$events:{}},{get(l,d){return x(n.get(d)??r(d,Reflect.get(l,d)))},has(l,d){return x(n.get(d)??r(d,Reflect.get(l,d))),Reflect.has(l,d)},set(l,d,h){return B(n.get(d)??r(d,h),h),Reflect.set(l,d,h)}});Xe(this,ot,(e.hydrate?Uo:Dr)(e.component,{target:e.target,props:o,context:e.context,intro:e.intro??!1,recover:e.recover})),(!((s=e==null?void 0:e.props)!=null&&s.$$host)||e.sync===!1)&&Qt(),Xe(this,bt,o.$$events);for(const l of Object.keys(K(this,ot)))l==="$set"||l==="$destroy"||l==="$on"||ke(this,l,{get(){return K(this,ot)[l]},set(d){K(this,ot)[l]=d},enumerable:!0});K(this,ot).$set=l=>{Object.assign(o,l)},K(this,ot).$destroy=()=>{zo(K(this,ot))}}$set(e){K(this,ot).$set(e)}$on(e,n){K(this,bt)[e]=K(this,bt)[e]||[];const r=(...o)=>n.call(this,...o);return K(this,bt)[e].push(r),()=>{K(this,bt)[e]=K(this,bt)[e].filter(o=>o!==r)}}$destroy(){K(this,ot).$destroy()}}bt=new WeakMap,ot=new WeakMap;let Rr;typeof HTMLElement=="function"&&(Rr=class extends HTMLElement{constructor(e,n,r){super();ct(this,"$$ctor");ct(this,"$$s");ct(this,"$$c");ct(this,"$$cn",!1);ct(this,"$$d",{});ct(this,"$$r",!1);ct(this,"$$p_d",{});ct(this,"$$l",{});ct(this,"$$l_u",new Map);ct(this,"$$me");this.$$ctor=e,this.$$s=n,r&&this.attachShadow({mode:"open"})}addEventListener(e,n,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(n),this.$$c){const o=this.$$c.$on(e,n);this.$$l_u.set(n,o)}super.addEventListener(e,n,r)}removeEventListener(e,n,r){if(super.removeEventListener(e,n,r),this.$$c){const o=this.$$l_u.get(n);o&&(o(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(o){return s=>{const l=document.createElement("slot");o!=="default"&&(l.name=o),at(s,l)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=li(this);for(const o of this.$$s)o in r&&(o==="default"&&!this.$$d.children?(this.$$d.children=e(o),n.default=!0):n[o]=e(o));for(const o of this.attributes){const s=this.$$g_p(o.name);s in this.$$d||(this.$$d[s]=Ee(s,o.value,this.$$p_d,"toProp"))}for(const o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=ii({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=yn(()=>{he(()=>{var o;this.$$r=!0;for(const s of Ce(this.$$c)){if(!((o=this.$$p_d[s])!=null&&o.reflect))continue;this.$$d[s]=this.$$c[s];const l=Ee(s,this.$$d[s],this.$$p_d,"toAttribute");l==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,l)}this.$$r=!1})});for(const o in this.$$l)for(const s of this.$$l[o]){const l=this.$$c.$on(o,s);this.$$l_u.set(s,l)}this.$$l={}}}attributeChangedCallback(e,n,r){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=Ee(e,r,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return Ce(this.$$p_d).find(n=>this.$$p_d[n].attribute===e||!this.$$p_d[n].attribute&&n.toLowerCase()===e)||e}});function Ee(t,e,n,r){var s;const o=(s=n[t])==null?void 0:s.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!r||!n[t])return e;if(r==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function li(t){const e={};return t.childNodes.forEach(n=>{e[n.slot||"default"]=!0}),e}function Ie(t,e,n,r,o,s){let l=class extends Rr{constructor(){super(t,n,o),this.$$p_d=e}static get observedAttributes(){return Ce(e).map(d=>(e[d].attribute||d).toLowerCase())}};return Ce(e).forEach(d=>{ke(l.prototype,d,{get(){return this.$$c&&d in this.$$c?this.$$c[d]:this.$$d[d]},set(h){var g;h=Ee(d,h,e),this.$$d[d]=h;var f=this.$$c;if(f){var _=(g=Rt(f,d))==null?void 0:g.get;_?f[d]=h:f.$set({[d]:h})}}})}),r.forEach(d=>{ke(l.prototype,d,{get(){var h;return(h=this.$$c)==null?void 0:h[d]}})}),t.element=l,l}const Dt=new Map([["yellow","#F8B920"],["red","#FF4646"],["blue","#0064FF"],["green","#00C564"]]),ai=["SCRIPT","STYLE","NOSCRIPT","TEXTAREA","OPTION"];function Fr(t){const e=document.documentElement.lang||void 0,n=t.map(d=>d.trim().toLocaleLowerCase(e)),r=n.map(()=>({start:null,end:null,shift:0})),o=n.map(()=>[]),s=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,d=>{var h,f;return ai.includes((h=d.parentNode)==null?void 0:h.tagName)||((f=d.parentNode)==null?void 0:f.contentEditable)=="true"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let l;for(;l=s.nextNode();)if(l!=null&&l.nodeValue)for(let d=0;d{var C,m;for(;f[r[_].shift]&&!f[r[_].shift].trim();)r[_].shift++;let g=f[r[_].shift]===h;if(!g&&r[_].shift&&(r[_].shift=0,g=f[r[_].shift]===h),g&&(r[_].shift||(r[_].start=[l,d]),r[_].end=[l,d],r[_].shift++),r[_].shift>=f.length){const b=document.createRange();b.setStart(r[_].start[0],r[_].start[1]),b.setEnd(r[_].end[0],r[_].end[1]+1),!b.collapsed&&(!((C=b.commonAncestorContainer.parentElement)!=null&&C.checkVisibility)||(m=b.commonAncestorContainer.parentElement)!=null&&m.checkVisibility())?o[_].push(b):b.detach(),g=!1}g||(r[_].shift=0,r[_].start=null,r[_].end=null)})}return o}const Ft=`rh-${new Date().getTime()}-`,qe="highlights"in CSS;function ui(t){if(!t.length&&!CSS.highlights.size)return;const e=[];if(CSS.highlights.clear(),t.length){const r=Fr(t.map(({text:o})=>o||""));for(const o in t){if(!r[o].length)continue;const{_id:s,color:l,note:d}=t[o],h=`${Ft}${s}`;CSS.highlights.set(h,new Highlight(...r[o]));const f=r[o][0].getBoundingClientRect();e.push(` - ::highlight(${h}) { +"use strict";var so=Object.defineProperty;var Yn=t=>{throw TypeError(t)};var lo=(t,e,n)=>e in t?so(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var vt=(t,e,n)=>lo(t,typeof e!="symbol"?e+"":e,n),Un=(t,e,n)=>e.has(t)||Yn("Cannot "+n);var Z=(t,e,n)=>(Un(t,e,"read from private field"),n?n.call(t):e.get(t)),tn=(t,e,n)=>e.has(t)?Yn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),en=(t,e,n,r)=>(Un(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n);(function(){var t=window.Document.prototype.createElement,e=window.Document.prototype.createElementNS,n=window.Document.prototype.importNode,r=window.Document.prototype.prepend,o=window.Document.prototype.append,i=window.DocumentFragment.prototype.prepend,l=window.DocumentFragment.prototype.append,f=window.Node.prototype.cloneNode,v=window.Node.prototype.appendChild,d=window.Node.prototype.insertBefore,p=window.Node.prototype.removeChild,w=window.Node.prototype.replaceChild,g=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),y=window.Element.prototype.attachShadow,m=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),k=window.Element.prototype.getAttribute,S=window.Element.prototype.setAttribute,O=window.Element.prototype.removeAttribute,q=window.Element.prototype.toggleAttribute,$=window.Element.prototype.getAttributeNS,x=window.Element.prototype.setAttributeNS,A=window.Element.prototype.removeAttributeNS,$t=window.Element.prototype.insertAdjacentElement,dt=window.Element.prototype.insertAdjacentHTML,D=window.Element.prototype.prepend,M=window.Element.prototype.append,Y=window.Element.prototype.before,z=window.Element.prototype.after,L=window.Element.prototype.replaceWith,V=window.Element.prototype.remove,U=window.HTMLElement,tt=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),X=window.HTMLElement.prototype.insertAdjacentElement,qt=window.HTMLElement.prototype.insertAdjacentHTML,jt=new Set;"annotation-xml color-profile font-face font-face-src font-face-uri font-face-format font-face-name missing-glyph".split(" ").forEach(function(s){return jt.add(s)});function qn(s){var a=jt.has(s);return s=/^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(s),!a&&s}var Zr=document.contains?document.contains.bind(document):document.documentElement.contains.bind(document.documentElement);function j(s){var a=s.isConnected;if(a!==void 0)return a;if(Zr(s))return!0;for(;s&&!(s.__CE_isImportDocument||s instanceof Document);)s=s.parentNode||(window.ShadowRoot&&s instanceof ShadowRoot?s.host:void 0);return!(!s||!(s.__CE_isImportDocument||s instanceof Document))}function Ge(s){var a=s.children;if(a)return Array.prototype.slice.call(a);for(a=[],s=s.firstChild;s;s=s.nextSibling)s.nodeType===Node.ELEMENT_NODE&&a.push(s);return a}function Je(s,a){for(;a&&a!==s&&!a.nextSibling;)a=a.parentNode;return a&&a!==s?a.nextSibling:null}function Ke(s,a,c){for(var _=s;_;){if(_.nodeType===Node.ELEMENT_NODE){var u=_;a(u);var h=u.localName;if(h==="link"&&u.getAttribute("rel")==="import"){if(_=u.import,c===void 0&&(c=new Set),_ instanceof Node&&!c.has(_))for(c.add(_),_=_.firstChild;_;_=_.nextSibling)Ke(_,a,c);_=Je(s,u);continue}else if(h==="template"){_=Je(s,u);continue}if(u=u.__CE_shadowRoot)for(u=u.firstChild;u;u=u.nextSibling)Ke(u,a,c)}_=_.firstChild?_.firstChild:Je(s,_)}}function be(){var s=!(wt==null||!wt.noDocumentConstructionObserver),a=!(wt==null||!wt.shadyDomFastWalk);this.m=[],this.g=[],this.j=!1,this.shadyDomFastWalk=a,this.I=!s}function ce(s,a,c,_){var u=window.ShadyDOM;if(s.shadyDomFastWalk&&u&&u.inUse){if(a.nodeType===Node.ELEMENT_NODE&&c(a),a.querySelectorAll)for(s=u.nativeMethods.querySelectorAll.call(a,"*"),a=0;a{};function vr(t){for(var e=0;e"u"?t=>setTimeout(t,1):requestIdleCallback;let pe=[],_e=[];function hr(){var t=pe;pe=[],vr(t)}function pr(){var t=_e;_e=[],vr(t)}function Ut(t){pe.length===0&&queueMicrotask(hr),pe.push(t)}function Eo(t){_e.length===0&&yo(pr),_e.push(t)}function Gn(){pe.length>0&&hr(),_e.length>0&&pr()}function _r(t){return t===this.v}function Co(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function gr(t){return!Co(t,this.v)}function $o(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function ko(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function To(t){throw new Error("https://svelte.dev/e/effect_orphan")}function xo(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function No(){throw new Error("https://svelte.dev/e/hydration_failed")}function So(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function Ao(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function Do(){throw new Error("https://svelte.dev/e/state_unsafe_local_read")}function Mo(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}let Lo=!1;function ut(t,e){var n={f:0,v:t,reactions:null,equals:_r,rv:0,wv:0};return n}function Nt(t){return Oo(ut(t))}function $n(t,e=!1){const n=ut(t);return e||(n.equals=gr),n}function Oo(t){return F!==null&&!ht&&F.f&_t&&(yt===null?Io([t]):yt.push(t)),t}function B(t,e){return F!==null&&!ht&&qr()&&F.f&(_t|yn)&&(yt===null||!yt.includes(t))&&Mo(),an(t,e)}function an(t,e){return t.equals(e)||(t.v,t.v=e,t.wv=kr(),mr(t,Ot),H!==null&&H.f&K&&!(H.f&(Lt|ie))&&(Tt===null?Bo([t]):Tt.push(t))),e}function mr(t,e){var n=t.reactions;if(n!==null)for(var r=n.length,o=0;o=O.v&&B(O,q+1)}Jn(l)}return!0},ownKeys(v){T(l);var d=Reflect.ownKeys(v).filter(g=>{var y=o.get(g);return y===void 0||y.v!==Q});for(var[p,w]of o)w.v!==Q&&!(p in v)&&d.push(p);return d},setPrototypeOf(){Ao()}})}function Jn(t,e=1){B(t,t.v+e)}function Kn(t){return t!==null&&typeof t=="object"&&te in t?t[te]:t}function Ho(t,e){return Object.is(Kn(t),Kn(e))}var Se,Vt,yr,Er,Cr;function cn(){if(Se===void 0){Se=window,Vt=document,yr=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype;Er=ee(e,"firstChild").get,Cr=ee(e,"nextSibling").get,t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__styles=null,t.__e=void 0,Text.prototype.__t=void 0}}function re(t=""){return document.createTextNode(t)}function Ht(t){return Er.call(t)}function Rt(t){return Cr.call(t)}function ot(t,e){if(!R)return Ht(t);var n=Ht(P);if(n===null)n=P.appendChild(re());else if(e&&n.nodeType!==3){var r=re();return n==null||n.before(r),pt(r),r}return pt(n),n}function xn(t,e){if(!R){var n=Ht(t);return n instanceof Comment&&n.data===""?Rt(n):n}return P}function it(t,e=1,n=!1){let r=R?P:t;for(var o;e--;)o=r,r=Rt(r);if(!R)return r;var i=r==null?void 0:r.nodeType;if(n&&i!==3){var l=re();return r===null?o==null||o.after(l):r.before(l),pt(l),l}return pt(r),r}function Nn(t){t.textContent=""}let Ce=!1,Ae=!1,De=null,zt=!1,Sn=!1;function Zn(t){Sn=t}let he=[];let F=null,ht=!1;function It(t){F=t}let H=null;function Bt(t){H=t}let yt=null;function Io(t){yt=t}let G=null,nt=0,Tt=null;function Bo(t){Tt=t}let $r=1,Me=0,Ft=!1;function kr(){return++$r}function ge(t){var w;var e=t.f;if(e&Ot)return!0;if(e&se){var n=t.deps,r=(e&ft)!==0;if(n!==null){var o,i,l=(e&Te)!==0,f=r&&H!==null&&!Ft,v=n.length;if(l||f){var d=t,p=d.parent;for(o=0;ot.wv)return!0}(!r||H!==null&&!Ft)&&Et(t,K)}return!1}function jo(t,e){for(var n=e;n!==null;){if(n.f&ke)try{n.fn(t);return}catch{n.f^=ke}n=n.parent}throw Ce=!1,t}function Vo(t){return(t.f&Ie)===0&&(t.parent===null||(t.parent.f&ke)===0)}function Ve(t,e,n,r){if(Ce){if(n===null&&(Ce=!1),Vo(e))throw t;return}n!==null&&(Ce=!0);{jo(t,e);return}}function Tr(t,e,n=!0){var r=t.reactions;if(r!==null)for(var o=0;o0)for(w.length=nt+G.length,g=0;g0;){e++>1e3&&Wo();var n=he,r=n.length;he=[];for(var o=0;o0;)Ae=!0,Nr(),Gn();return e}function T(t){var e=t.f,n=(e&_t)!==0;if(F!==null&&!ht){yt!==null&&yt.includes(t)&&Do();var r=F.deps;t.rv{Ct(e)}}function Ko(t){const e=Xt(ie,t,!0);return(n={})=>new Promise(r=>{n.outro?Re(e,()=>{Ct(e),r(void 0)}):(Ct(e),r(void 0))})}function Mn(t){return Xt(ur,t,!1)}function We(t){return Xt(He,t,!0)}function Wt(t,e=[],n=kn){const r=e.map(n);return Ye(()=>t(...r.map(T)))}function Ye(t,e=0){return Xt(He|yn|e,t,!0)}function oe(t,e=!0){return Xt(He|Lt,t,!0,e)}function Dr(t){var e=t.teardown;if(e!==null){const n=Sn,r=F;Zn(!0),It(null);try{e.call(null)}finally{Zn(n),It(r)}}}function Mr(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){var r=n.next;Ct(n,e),n=r}}function Zo(t){for(var e=t.first;e!==null;){var n=e.next;e.f&Lt||Ct(e),e=n}}function Ct(t,e=!0){var n=!1;if((e||t.f&ho)&&t.nodes_start!==null){for(var r=t.nodes_start,o=t.nodes_end;r!==null;){var i=r===o?null:Rt(r);r.remove(),r=i}n=!0}Mr(t,e&&!n),Le(t,0),Et(t,Ie);var l=t.transitions;if(l!==null)for(const v of l)v.stop();Dr(t);var f=t.parent;f!==null&&f.first!==null&&Lr(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=null}function Lr(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function Re(t,e){var n=[];Ln(t,n,!0),Or(n,()=>{Ct(t),e&&e()})}function Or(t,e){var n=t.length;if(n>0){var r=()=>--n||e();for(var o of t)o.out(r)}else e()}function Ln(t,e,n){if(!(t.f&Dt)){if(t.f^=Dt,t.transitions!==null)for(const l of t.transitions)(l.is_global||n)&&e.push(l);for(var r=t.first;r!==null;){var o=r.next,i=(r.f&Be)!==0||(r.f&Lt)!==0;Ln(r,e,i?n:!1),r=o}}}function qe(t){Rr(t,!0)}function Rr(t,e){if(t.f&Dt){t.f^=Dt,t.f&K||(t.f^=K),ge(t)&&(Et(t,Ot),ze(t));for(var n=t.first;n!==null;){var r=n.next,o=(n.f&Be)!==0||(n.f&Lt)!==0;Rr(n,o?e:!1),n=r}if(t.transitions!==null)for(const i of t.transitions)(i.is_global||e)&&i.in()}}let lt=null;function Qn(t){lt=t}function ae(t,e=!1,n){lt={p:lt,c:null,e:null,m:!1,s:t,x:null,l:null}}function ue(t){const e=lt;if(e!==null){t!==void 0&&(e.x=t);const l=e.e;if(l!==null){var n=H,r=F;e.e=null;try{for(var o=0;o{document.activeElement===n&&t.focus()})}}function ni(t){R&&Ht(t)!==null&&Nn(t)}let tr=!1;function Pr(){tr||(tr=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n.__on_r)==null||e.call(n)})},{capture:!0}))}function Fr(t){var e=F,n=H;It(null),Bt(null);try{return t()}finally{It(e),Bt(n)}}function Hr(t,e,n,r=n){t.addEventListener(e,()=>Fr(n));const o=t.__on_r;o?t.__on_r=()=>{o(),r(!0)}:t.__on_r=()=>r(!0),Pr()}const Ir=new Set,fn=new Set;function ri(t,e,n,r={}){function o(i){if(r.capture||de.call(e,i),!i.cancelBubble)return Fr(()=>n==null?void 0:n.call(this,i))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Ut(()=>{e.addEventListener(t,o,r)}):e.addEventListener(t,o,r),o}function bt(t,e,n,r,o){var i={capture:r,passive:o},l=ri(t,e,n,i);(e===document.body||e===window||e===document)&&Sr(()=>{e.removeEventListener(t,l,i)})}function Br(t){for(var e=0;e{throw $});throw g}}finally{t.__root=e,delete t.currentTarget,It(p),Bt(w)}}}function oi(t){var e=document.createElement("template");return e.innerHTML=t,e.content}function ne(t,e){var n=H;n.nodes_start===null&&(n.nodes_start=t,n.nodes_end=e)}function gt(t,e){var n=(e&co)!==0,r=(e&fo)!==0,o,i=!t.startsWith("");return()=>{if(R)return ne(P,null),P;o===void 0&&(o=oi(i?t:""+t),n||(o=Ht(o)));var l=r||yr?document.importNode(o,!0):o.cloneNode(!0);if(n){var f=Ht(l),v=l.lastChild;ne(f,v)}else ne(l,l);return l}}function ii(){if(R)return ne(P,null),P;var t=document.createDocumentFragment(),e=document.createComment(""),n=re();return t.append(e,n),ne(e,n),t}function st(t,e){if(R){H.nodes_end=P,je();return}t!==null&&t.before(e)}function nn(t,e){var n=e==null?"":typeof e=="object"?e+"":e;n!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=n,t.nodeValue=n+"")}function jr(t,e){return Vr(t,e)}function si(t,e){cn(),e.intro=e.intro??!1;const n=e.target,r=R,o=P;try{for(var i=Ht(n);i&&(i.nodeType!==8||i.data!==mn);)i=Rt(i);if(!i)throw ve;At(!0),pt(i),je();const l=Vr(t,{...e,anchor:i});if(P===null||P.nodeType!==8||P.data!==bn)throw Tn(),ve;return At(!1),l}catch(l){if(l===ve)return e.recover===!1&&No(),cn(),Nn(n),At(!1),jr(t,e);throw l}finally{At(r),pt(o)}}const Zt=new Map;function Vr(t,{target:e,anchor:n,props:r={},events:o,context:i,intro:l=!0}){cn();var f=new Set,v=w=>{for(var g=0;g{var w=n??e.appendChild(re());return oe(()=>{if(i){ae({});var g=lt;g.c=i}o&&(r.$$events=o),R&&ne(w,null),d=t(w,r)||{},R&&(H.nodes_end=P),i&&ue()}),()=>{var m;for(var g of f){e.removeEventListener(g,de);var y=Zt.get(g);--y===0?(document.removeEventListener(g,de),Zt.delete(g)):Zt.set(g,y)}fn.delete(v),w!==n&&((m=w.parentNode)==null||m.removeChild(w))}});return dn.set(d,p),d}let dn=new WeakMap;function li(t,e){const n=dn.get(t);return n?(dn.delete(t),n(e)):Promise.resolve()}function Pe(t,e,[n,r]=[0,0]){R&&n===0&&je();var o=t,i=null,l=null,f=Q,v=n>0?Be:0,d=!1;const p=(g,y=!0)=>{d=!0,w(y,g)},w=(g,y)=>{if(f===(f=g))return;let m=!1;if(R&&r!==-1){if(n===0){const S=o.data;S===mn?r=0:S===wn?r=1/0:(r=parseInt(S.substring(1)),r!==r&&(r=f?1/0:-1))}const k=r>n;!!f===k&&(o=un(),pt(o),At(!1),m=!0,r=-1)}f?(i?qe(i):y&&(i=oe(()=>y(o))),l&&Re(l,()=>{l=null})):(l?qe(l):y&&(l=oe(()=>y(o,[n+1,r]))),i&&Re(i,()=>{i=null})),m&&At(!0)};Ye(()=>{d=!1,e(p),d||w(null,null)},v),R&&(o=P)}function ai(t,e){return e}function ui(t,e,n,r){for(var o=[],i=e.length,l=0;l0&&o.length===0&&n!==null;if(f){var v=n.parentNode;Nn(v),v.append(n),r.clear(),Pt(t,e[0].prev,e[i-1].next)}Or(o,()=>{for(var d=0;d{var y=n();return En(y)?y:y==null?[]:Cn(y)});Ye(()=>{var y=T(g),m=y.length;if(w&&m===0)return;w=m===0;let k=!1;if(R){var S=l.data===wn;S!==(m===0)&&(l=un(),pt(l),At(!1),k=!0)}if(R){for(var O=null,q,$=0;$0&&pt(un())}R||ci(y,f,l,o,e,r,n),i!==null&&(m===0?p?qe(p):p=oe(()=>i(l)):p!==null&&Re(p,()=>{p=null})),k&&At(!0),T(g)}),R&&(l=P)}function ci(t,e,n,r,o,i,l){var U,tt,X,qt;var f=(o&ao)!==0,v=(o&(_n|gn))!==0,d=t.length,p=e.items,w=e.first,g=w,y,m=null,k,S=[],O=[],q,$,x,A;if(f)for(A=0;A0){var V=o&ar&&d===0?n:null;if(f){for(A=0;A{var jt;if(k!==void 0)for(x of k)(jt=x.a)==null||jt.apply()}),H.first=e.first&&e.first.e,H.last=m&&m.e}function fi(t,e,n,r){r&_n&&an(t.v,e),r&gn?an(t.i,n):t.i=n}function zr(t,e,n,r,o,i,l,f,v,d){var p=(v&_n)!==0,w=(v&uo)===0,g=p?w?$n(o):ut(o):o,y=v&gn?ut(l):l,m={i:y,v:g,k:i,a:null,e:null,prev:n,next:r};try{return m.e=oe(()=>f(t,g,y,d),R),m.e.prev=n&&n.e,m.e.next=r&&r.e,n===null?e.first=m:(n.next=m,n.e.next=m.e),r!==null&&(r.prev=m,r.e.prev=m.e),m}finally{}}function er(t,e,n){for(var r=t.next?t.next.e.nodes_start:n,o=e?e.e.nodes_start:n,i=t.e.nodes_start;i!==r;){var l=Rt(i);o.before(i),i=l}}function Pt(t,e,n){e===null?t.first=n:(e.next=n,e.e.next=n&&n.e),n!==null&&(n.prev=e,n.e.prev=e&&e.e)}function di(t,e,...n){var r=t,o=dr,i;Ye(()=>{o!==(o=e())&&(i&&(Ct(i),i=null),i=oe(()=>o(r,...n)))},Be),R&&(r=P)}function Ue(t,e){Ut(()=>{var n=t.getRootNode(),r=n.host?n:n.head??n.ownerDocument.head;if(!r.querySelector("#"+e.hash)){const o=document.createElement("style");o.id=e.hash,o.textContent=e.code,r.appendChild(o)}})}const nr=[...` +\r\f \v\uFEFF`];function vi(t,e,n){var r=t==null?"":""+t;if(n){for(var o in n)if(n[o])r=r?r+" "+o:o;else if(r.length)for(var i=o.length,l=0;(l=r.indexOf(o,l))>=0;){var f=l+i;(l===0||nr.includes(r[l-1]))&&(f===r.length||nr.includes(r[f]))?r=(l===0?"":r.substring(0,l))+r.substring(f+1):l=f}}return r===""?null:r}function Fe(t,e,n,r,o,i){var l=t.__className;if(R||l!==n){var f=vi(n,r,i);(!R||f!==t.getAttribute("class"))&&(f==null?t.removeAttribute("class"):t.className=f),t.__className=n}else if(i)for(var v in i){var d=!!i[v];(o==null||d!==!!o[v])&&t.classList.toggle(v,d)}return i}function hi(t){if(R){var e=!1,n=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var r=t.value;ct(t,"value",null),t.value=r}if(t.hasAttribute("checked")){var o=t.checked;ct(t,"checked",null),t.checked=o}}};t.__on_r=n,Eo(n),Pr()}}function pi(t,e){var n=t.__attributes??(t.__attributes={});n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function ct(t,e,n,r){var o=t.__attributes??(t.__attributes={});R&&(o[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||o[e]!==(o[e]=n)&&(e==="style"&&"__styles"in t&&(t.__styles={}),e==="loading"&&(t[_o]=n),n==null?t.removeAttribute(e):typeof n!="string"&&_i(t).includes(e)?t[e]=n:t.setAttribute(e,n))}var rr=new Map;function _i(t){var e=rr.get(t.nodeName);if(e)return e;rr.set(t.nodeName,e=[]);for(var n,r=t,o=Element.prototype;o!==r;){n=mo(r);for(var i in n)n[i].set&&e.push(i);r=fr(r)}return e}function gi(t,e,n,r){var o=t.__styles??(t.__styles={});o[e]!==n&&(o[e]=n,n==null?t.style.removeProperty(e):t.style.setProperty(e,n,""))}function mi(t,e,n=e){Hr(t,"input",r=>{var o=r?t.defaultValue:t.value;if(o=on(t)?sn(o):o,n(o),o!==(o=e())){var i=t.selectionStart,l=t.selectionEnd;t.value=o??"",l!==null&&(t.selectionStart=i,t.selectionEnd=Math.min(l,t.value.length))}}),(R&&t.defaultValue!==t.value||Dn(e)==null&&t.value)&&n(on(t)?sn(t.value):t.value),We(()=>{var r=e();on(t)&&r===sn(t.value)||t.type==="date"&&!r&&!t.value||r!==t.value&&(t.value=r??"")})}const rn=new Set;function wi(t,e,n,r,o=r){var i=n.getAttribute("type")==="checkbox",l=t;let f=!1;if(e!==null)for(var v of e)l=l[v]??(l[v]=[]);l.push(n),Hr(n,"change",()=>{var d=n.__value;i&&(d=or(l,d,n.checked)),o(d)},()=>o(i?[]:null)),We(()=>{var d=r();if(R&&n.defaultChecked!==n.checked){f=!0;return}i?(d=d||[],n.checked=d.includes(n.__value)):n.checked=Ho(n.__value,d)}),Sr(()=>{var d=l.indexOf(n);d!==-1&&l.splice(d,1)}),rn.has(l)||(rn.add(l),Ut(()=>{l.sort((d,p)=>d.compareDocumentPosition(p)===4?-1:1),rn.delete(l)})),Ut(()=>{if(f){var d;if(i)d=or(l,d,n.checked);else{var p=l.find(w=>w.checked);d=p==null?void 0:p.__value}o(d)}})}function or(t,e,n){for(var r=new Set,o=0;o{var o,i;return We(()=>{o=i,i=[],Dn(()=>{t!==n(...i)&&(e(t,...i),o&&ir(n(...o),t)&&e(null,...o))})}),()=>{Ut(()=>{i&&ir(n(...i),t)&&e(null,...i)})}}),t}function me(t,e,n,r){var o;o=t[e];var i=r,l=!0,f=!1,v=()=>(f=!0,l&&(l=!1,i=r),i),d;d=()=>{var y=t[e];return y===void 0?v():(l=!0,f=!1,y)};var p=!1,w=$n(o),g=kn(()=>{var y=d(),m=T(w);return p?(p=!1,m):w.v=y});return function(y,m){if(arguments.length>0){const k=m?T(g):y;return g.equals(k)||(p=!0,B(w,k),f&&i!==void 0&&(i=k),Dn(()=>T(g))),y}return T(g)}}function bi(t){return new yi(t)}var xt,at;class yi{constructor(e){tn(this,xt);tn(this,at);var i;var n=new Map,r=(l,f)=>{var v=$n(f);return n.set(l,v),v};const o=new Proxy({...e.props||{},$$events:{}},{get(l,f){return T(n.get(f)??r(f,Reflect.get(l,f)))},has(l,f){return f===po?!0:(T(n.get(f)??r(f,Reflect.get(l,f))),Reflect.has(l,f))},set(l,f,v){return B(n.get(f)??r(f,v),v),Reflect.set(l,f,v)}});en(this,at,(e.hydrate?si:jr)(e.component,{target:e.target,anchor:e.anchor,props:o,context:e.context,intro:e.intro??!1,recover:e.recover})),(!((i=e==null?void 0:e.props)!=null&&i.$$host)||e.sync===!1)&&le(),en(this,xt,o.$$events);for(const l of Object.keys(Z(this,at)))l==="$set"||l==="$destroy"||l==="$on"||Ne(this,l,{get(){return Z(this,at)[l]},set(f){Z(this,at)[l]=f},enumerable:!0});Z(this,at).$set=l=>{Object.assign(o,l)},Z(this,at).$destroy=()=>{li(Z(this,at))}}$set(e){Z(this,at).$set(e)}$on(e,n){Z(this,xt)[e]=Z(this,xt)[e]||[];const r=(...o)=>n.call(this,...o);return Z(this,xt)[e].push(r),()=>{Z(this,xt)[e]=Z(this,xt)[e].filter(o=>o!==r)}}$destroy(){Z(this,at).$destroy()}}xt=new WeakMap,at=new WeakMap;let Wr;typeof HTMLElement=="function"&&(Wr=class extends HTMLElement{constructor(e,n,r){super();vt(this,"$$ctor");vt(this,"$$s");vt(this,"$$c");vt(this,"$$cn",!1);vt(this,"$$d",{});vt(this,"$$r",!1);vt(this,"$$p_d",{});vt(this,"$$l",{});vt(this,"$$l_u",new Map);vt(this,"$$me");this.$$ctor=e,this.$$s=n,r&&this.attachShadow({mode:"open"})}addEventListener(e,n,r){if(this.$$l[e]=this.$$l[e]||[],this.$$l[e].push(n),this.$$c){const o=this.$$c.$on(e,n);this.$$l_u.set(n,o)}super.addEventListener(e,n,r)}removeEventListener(e,n,r){if(super.removeEventListener(e,n,r),this.$$c){const o=this.$$l_u.get(n);o&&(o(),this.$$l_u.delete(n))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let e=function(o){return i=>{const l=document.createElement("slot");o!=="default"&&(l.name=o),st(i,l)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=Ei(this);for(const o of this.$$s)o in r&&(o==="default"&&!this.$$d.children?(this.$$d.children=e(o),n.default=!0):n[o]=e(o));for(const o of this.attributes){const i=this.$$g_p(o.name);i in this.$$d||(this.$$d[i]=$e(i,o.value,this.$$p_d,"toProp"))}for(const o in this.$$p_d)!(o in this.$$d)&&this[o]!==void 0&&(this.$$d[o]=this[o],delete this[o]);this.$$c=bi({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=Ar(()=>{We(()=>{var o;this.$$r=!0;for(const i of xe(this.$$c)){if(!((o=this.$$p_d[i])!=null&&o.reflect))continue;this.$$d[i]=this.$$c[i];const l=$e(i,this.$$d[i],this.$$p_d,"toAttribute");l==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,l)}this.$$r=!1})});for(const o in this.$$l)for(const i of this.$$l[o]){const l=this.$$c.$on(o,i);this.$$l_u.set(i,l)}this.$$l={}}}attributeChangedCallback(e,n,r){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=$e(e,r,this.$$p_d,"toProp"),(o=this.$$c)==null||o.$set({[e]:this.$$d[e]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(e){return xe(this.$$p_d).find(n=>this.$$p_d[n].attribute===e||!this.$$p_d[n].attribute&&n.toLowerCase()===e)||e}});function $e(t,e,n,r){var i;const o=(i=n[t])==null?void 0:i.type;if(e=o==="Boolean"&&typeof e!="boolean"?e!=null:e,!r||!n[t])return e;if(r==="toAttribute")switch(o){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(o){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function Ei(t){const e={};return t.childNodes.forEach(n=>{e[n.slot||"default"]=!0}),e}function we(t,e,n,r,o,i){let l=class extends Wr{constructor(){super(t,n,o),this.$$p_d=e}static get observedAttributes(){return xe(e).map(f=>(e[f].attribute||f).toLowerCase())}};return xe(e).forEach(f=>{Ne(l.prototype,f,{get(){return this.$$c&&f in this.$$c?this.$$c[f]:this.$$d[f]},set(v){var w;v=$e(f,v,e),this.$$d[f]=v;var d=this.$$c;if(d){var p=(w=ee(d,f))==null?void 0:w.get;p?d[f]=v:d.$set({[f]:v})}}})}),r.forEach(f=>{Ne(l.prototype,f,{get(){var v;return(v=this.$$c)==null?void 0:v[f]}})}),t.element=l,l}const Mt=new Map([["yellow","#F8B920"],["red","#FF4646"],["blue","#0064FF"],["green","#00C564"]]),Ci=["SCRIPT","STYLE","NOSCRIPT","TEXTAREA","OPTION"];function Rn(t){const e=document.documentElement.lang||void 0,n=t.map(f=>f.trim().toLocaleLowerCase(e)),r=n.map(()=>({start:null,end:null,shift:0})),o=n.map(()=>[]),i=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,f=>{var v,d;return Ci.includes((v=f.parentNode)==null?void 0:v.tagName)||((d=f.parentNode)==null?void 0:d.contentEditable)=="true"?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let l;for(;l=i.nextNode();)if(l!=null&&l.nodeValue)for(let f=0;f{var g,y;for(;d[r[p].shift]&&!d[r[p].shift].trim();)r[p].shift++;let w=d[r[p].shift]===v;if(!w&&r[p].shift&&(r[p].shift=0,w=d[r[p].shift]===v),w&&(r[p].shift||(r[p].start=[l,f]),r[p].end=[l,f],r[p].shift++),r[p].shift>=d.length){const m=document.createRange();m.setStart(r[p].start[0],r[p].start[1]),m.setEnd(r[p].end[0],r[p].end[1]+1),!m.collapsed&&(!((g=m.commonAncestorContainer.parentElement)!=null&&g.checkVisibility)||(y=m.commonAncestorContainer.parentElement)!=null&&y.checkVisibility())?o[p].push(m):m.detach(),w=!1}w||(r[p].shift=0,r[p].start=null,r[p].end=null)})}return o}const Yt=`rh-${new Date().getTime()}-`,Xe="highlights"in CSS;function $i(t){if(!t.length&&!CSS.highlights.size)return;const e=[];if(CSS.highlights.clear(),t.length){const r=Rn(t.map(({text:o})=>o||""));for(const o in t){const i=r[o];if(!i.length)continue;const{_id:l,color:f,note:v,position:d=0}=t[o],p=`${Yt}${l}`,w=(i==null?void 0:i[d])||i[0];CSS.highlights.set(p,new Highlight(w));const g=w.getBoundingClientRect();e.push(` + ::highlight(${p}) { all: unset; - background-color: color-mix(in srgb, ${Dt.get(l)||l||"yellow"}, white 60%) !important; - color: color-mix(in srgb, ${Dt.get(l)||l||"yellow"}, black 80%) !important; - ${d?"text-decoration: underline wavy; -webkit-text-decoration: underline wavy;":""} + background-color: color-mix(in srgb, ${Mt.get(f)||f||"yellow"}, white 60%) !important; + color: color-mix(in srgb, ${Mt.get(f)||f||"yellow"}, black 80%) !important; + ${v?"text-decoration: underline wavy; -webkit-text-decoration: underline wavy;":""} text-decoration-thickness: from-font; } /* fuck you dark reader */ - html[data-darkreader-scheme="dark"] ::highlight(${h}) { + html[data-darkreader-scheme="dark"] ::highlight(${p}) { color: CanvasText !important; } + /* pdf render */ + .pdf ::highlight(${p}) { + background-color: color-mix(in srgb, ${Mt.get(f)||f||"yellow"}, transparent 60%) !important; + color: transparent !important; + } + :root { - --highlight-${s}-top: ${(100/document.documentElement.scrollHeight*(window.scrollY+f.top-10)).toFixed(2)}%; + --highlight-${l}-top: ${(100/document.documentElement.scrollHeight*(window.scrollY+g.top-10)).toFixed(2)}%; } - `);for(const _ of r[o])_.detach()}}const n=(()=>{let r=document.getElementById(Ft);return r||(r=document.createElement("style"),r.id=Ft,document.head.appendChild(r)),r})();n.innerHTML=e.join(` -`)}function ci(){var t;(t=document.getElementById(Ft))==null||t.remove()}function fi(t){var e;for(const[n,r]of CSS.highlights){const o=n.replace(Ft,"");if(t==o)for(const s of r){(e=s.startContainer.parentElement)==null||e.scrollIntoView({behavior:"smooth",block:"start"});break}}}function di(t){let e;for(const[n,r]of CSS.highlights)for(const o of r){const s=t.compareBoundaryPoints(Range.START_TO_START,o),l=t.compareBoundaryPoints(Range.END_TO_END,o);(s==0&&l==0||t!=null&&t.collapsed&&s>=0&&l<=0)&&(e=[n.replace(Ft,""),o])}if(e)return e[0].replace(Ft,"")}const Et=`rh-${new Date().getTime()}`;function hi(t){const e=document.body.querySelectorAll(`.${Et}`);if(!t.length&&!e.length)return;e.forEach(s=>s.outerHTML=s.innerText);const n=[],r=Fr(t.map(({text:s})=>s||""));for(const s in t){const{_id:l,color:d}=t[s];for(const h of r[s]){const f=document.createElement("mark");f.className=Et,f.setAttribute("data-id",String(l)),f.append(h.extractContents()),h.insertNode(f),h.detach()}n.push(` - .${Et}[data-id="${l}"] { + `);for(const y of i)y.detach()}}const n=(()=>{let r=document.getElementById(Yt);return r||(r=document.createElement("style"),r.id=Yt,document.head.appendChild(r)),r})();n.innerHTML=e.join(` +`)}function ki(){var t;(t=document.getElementById(Yt))==null||t.remove()}function Ti(t){var e;for(const[n,r]of CSS.highlights){const o=n.replace(Yt,"");if(t==o)for(const i of r){(e=i.startContainer.parentElement)==null||e.scrollIntoView({behavior:"smooth",block:"start"});break}}}function xi(t){let e;for(const[n,r]of CSS.highlights)for(const o of r){const i=t.compareBoundaryPoints(Range.START_TO_START,o),l=t.compareBoundaryPoints(Range.END_TO_END,o);(i==0&&l==0||t!=null&&t.collapsed&&i>=0&&l<=0)&&(e=[n.replace(Yt,""),o])}if(e)return e[0].replace(Yt,"")}const St=`rh-${new Date().getTime()}`;function Ni(t){const e=document.body.querySelectorAll(`.${St}`);if(!t.length&&!e.length)return;e.forEach(i=>i.outerHTML=i.innerText);const n=[],r=Rn(t.map(({text:i})=>i||""));for(const i in t){const{_id:l,color:f}=t[i];for(const v of r[i]){const d=document.createElement("mark");d.className=St,d.setAttribute("data-id",String(l)),d.append(v.extractContents()),v.insertNode(d),v.detach()}n.push(` + .${St}[data-id="${l}"] { all: unset; display: inline-block !important; background-color: white !important; - background-image: linear-gradient(to bottom, ${Zn(Dt.get(d)||d,.4)} 0, ${Zn(Dt.get(d)||d,.4)} 100%) !important; + background-image: linear-gradient(to bottom, ${sr(Mt.get(f)||f,.4)} 0, ${sr(Mt.get(f)||f,.4)} 100%) !important; color: black !important; } - `)}const o=(()=>{let s=document.getElementById(Et);return s||(s=document.createElement("style"),s.id=Et,document.head.appendChild(s)),s})();o.innerHTML=n.join(` -`)}function vi(){var t;document.body.querySelectorAll(`.${Et}`).forEach(e=>e.outerHTML=e.innerText),(t=document.getElementById(Et))==null||t.remove()}function pi(t){const e=document.body.querySelector(`.${Et}[data-id="${t}"]`);e&&e.scrollIntoView({behavior:"smooth",block:"start"})}function _i(t){const e=t.commonAncestorContainer.nodeType==Node.ELEMENT_NODE?t.commonAncestorContainer:t.commonAncestorContainer.parentElement;if((e==null?void 0:e.className)==Et){if(!t.collapsed){const n=new Range;n.selectNodeContents(t.commonAncestorContainer);const r=t.compareBoundaryPoints(Range.START_TO_START,n),o=t.compareBoundaryPoints(Range.END_TO_END,n);if(n.detach(),r!=0||o!=0)return}return e.getAttribute("data-id")||void 0}}function Zn(t,e){if(!t)return t;const n=parseInt(t.slice(1,3),16),r=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16);return`rgba(${n}, ${r}, ${o}, ${e})`}function gi(t){return qe?ui(t):hi(t)}function Ze(t){return gi(t)}function mi(){return qe?ci():vi()}function Hr(t){return qe?fi(t):pi(t)}function Pr(){var n,r,o;const t=document.getSelection();if(!(t!=null&&t.rangeCount))return;const e=t.getRangeAt(0);if(!((o=((n=e==null?void 0:e.commonAncestorContainer)==null?void 0:n.nodeType)==1?e==null?void 0:e.commonAncestorContainer:(r=e==null?void 0:e.commonAncestorContainer)==null?void 0:r.parentElement)!=null&&o.closest('[contenteditable=""], [contenteditable=true]')))return e}function ie(){const t=document.getSelection();t!=null&&t.rangeCount&&t.removeAllRanges()}function wi(t){return qe?di(t):_i(t)}function Qn(t){if(!t)return"";var e=document.createElement("div");e.appendChild(t.cloneContents().cloneNode(!0)),document.body.appendChild(e);const n=e.innerText;return document.body.removeChild(e),e=void 0,n}function yi(t,e,n){let r=jt(st([])),o=jt(!1),s=jt(!1),l=jt(void 0);function d(m){const b=wi(m);if(b)return x(r).find(L=>L._id==b);if(Qn(m).trim())return{text:Qn(m).trim()}}function h(m){const b={...typeof m._id=="string"?{_id:m._id}:{},...typeof m.text=="string"?{text:m.text}:{},...typeof m.note=="string"?{note:m.note}:{},color:m.color||"yellow"};if(!b.text)return;const T=x(r).findIndex(L=>{var S,k;return L._id==b._id||((S=L.text)==null?void 0:S.toLocaleLowerCase().trim())===((k=b.text)==null?void 0:k.toLocaleLowerCase().trim())});T!=-1?(x(r)[T]=b,e(b)):(x(r).push(b),t(b))}function f({_id:m}){B(r,st(x(r).filter(b=>b._id!=m))),n({_id:m})}function _(m){B(l,st(JSON.parse(JSON.stringify(m))))}function g(){x(l)&&(h(x(l)),B(l,void 0))}function C(){B(l,void 0)}return{get highlights(){return x(r)},set highlights(m){B(r,st(m))},get pro(){return x(o)},set pro(m){B(o,st(m))},get nav(){return x(s)},set nav(m){B(s,st(m))},get draft(){return x(l)},find:d,upsert:h,remove:f,setDraft:_,draftSubmit:g,draftCancel:C}}const bi="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(bi);function Ei(t,e){let n=null,r=!0;return function(...s){n||(r?(t(...s),r=!1):(clearTimeout(n),n=setTimeout(()=>{t(...s),clearTimeout(n),n=null},e)))}}function cn(){var t;return(t=navigator==null?void 0:navigator.userAgentData)!=null&&t.mobile?!0:/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)}var Ci=mt(''),ki=mt(''),$i=mt('
');const xi={hash:"svelte-ado8wf",code:` - .svelte-ado8wf { - user-select: none; - -webkit-user-select: none; - box-sizing: border-box; - -webkit-tap-highlight-color: transparent; - } - - dialog.svelte-ado8wf { - --control-size: 16px; - --padding-s: 6px; - --padding-m: 8px; - - --bg-light: rgb(255, 255, 255); - --bg-dark: rgb(60, 60, 60); - --control-fg-light: rgb(65, 65, 65); - --control-fg-dark: rgb(230, 230, 230); - --hover-bg-light: rgba(0,0,0,.07); - --hover-bg-dark: rgba(255,255,255,.1); - --active-bg-light: rgba(0,0,0,.13); - --active-bg-dark: rgba(255,255,255,.2); - } - - @supports (background-color: -apple-system-control-background) { - dialog.svelte-ado8wf { - --bg-light: rgba(255, 255, 255, .8); - --bg-dark: rgba(60, 60, 60, .8); - backdrop-filter: blur(5px); - -webkit-backdrop-filter: blur(5px); - } - } + `)}const o=(()=>{let i=document.getElementById(St);return i||(i=document.createElement("style"),i.id=St,document.head.appendChild(i)),i})();o.innerHTML=n.join(` +`)}function Si(){var t;document.body.querySelectorAll(`.${St}`).forEach(e=>e.outerHTML=e.innerText),(t=document.getElementById(St))==null||t.remove()}function Ai(t){const e=document.body.querySelector(`.${St}[data-id="${t}"]`);e&&e.scrollIntoView({behavior:"smooth",block:"start"})}function Di(t){const e=t.commonAncestorContainer.nodeType==Node.ELEMENT_NODE?t.commonAncestorContainer:t.commonAncestorContainer.parentElement;if((e==null?void 0:e.className)==St){if(!t.collapsed){const n=new Range;n.selectNodeContents(t.commonAncestorContainer);const r=t.compareBoundaryPoints(Range.START_TO_START,n),o=t.compareBoundaryPoints(Range.END_TO_END,n);if(n.detach(),r!=0||o!=0)return}return e.getAttribute("data-id")||void 0}}function sr(t,e){if(!t)return t;const n=parseInt(t.slice(1,3),16),r=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16);return`rgba(${n}, ${r}, ${o}, ${e})`}function Mi(t){return Xe?$i(t):Ni(t)}function ln(t){return Mi(t)}function Li(){return Xe?ki():Si()}function Yr(t){return Xe?Ti(t):Ai(t)}function hn(){var n,r,o;const t=document.getSelection();if(!(t!=null&&t.rangeCount))return;const e=t.getRangeAt(0);if(!((o=((n=e==null?void 0:e.commonAncestorContainer)==null?void 0:n.nodeType)==1?e==null?void 0:e.commonAncestorContainer:(r=e==null?void 0:e.commonAncestorContainer)==null?void 0:r.parentElement)!=null&&o.closest('[contenteditable=""], [contenteditable=true]')))return e}function Qt(){const t=document.getSelection();t!=null&&t.rangeCount&&t.removeAllRanges()}function Oi(t){return Xe?xi(t):Di(t)}function Ur(t){if(!t)return"";var e=document.createElement("div");e.appendChild(t.cloneContents().cloneNode(!0)),e.querySelectorAll("tspan").forEach(r=>r.outerHTML=`${r.innerHTML}`),e.querySelectorAll("text").forEach(r=>r.outerHTML=`
${r.innerHTML}
`),document.body.appendChild(e);const n=e.innerText;return document.body.removeChild(e),e=void 0,n}function Ri(t){if(!t)return;const e=Ur(t);if(!e)return;const[n]=Rn([e]),r=n.findIndex(o=>{const i=o.compareBoundaryPoints(Range.START_TO_START,t),l=o.compareBoundaryPoints(Range.END_TO_END,t);return i==0&&l==0||(t==null?void 0:t.collapsed)&&i>=0&&l<=0});return r==-1?void 0:r}function qi(t,e,n){let r=Nt(rt([])),o=Nt(!1),i=Nt(!1),l=Nt(!1),f=Nt(void 0);function v(m){const k=Oi(m);if(k)return T(r).find(O=>O._id==k);const S=Ur(m).trim();if(S)return{text:S,position:Ri(m)}}function d(m){const k={...typeof m._id=="string"?{_id:m._id}:{},...typeof m.text=="string"?{text:m.text}:{},...typeof m.note=="string"?{note:m.note}:{},...typeof m.position=="number"?{position:m.position}:{},color:m.color||"yellow"};if(!k.text)return;const S=T(r).findIndex(O=>{var q,$;return O._id==k._id||((q=O.text)==null?void 0:q.toLocaleLowerCase().trim())===(($=k.text)==null?void 0:$.toLocaleLowerCase().trim())});S!=-1?(k._id=T(r)[S]._id,T(r)[S]=k,e(k)):(T(r).push(k),t(k))}function p({_id:m}){B(r,rt(T(r).filter(k=>k._id!=m))),n({_id:m})}function w(m){B(f,rt(JSON.parse(JSON.stringify(m))))}function g(){T(f)&&(d(T(f)),B(f,void 0))}function y(){B(f,void 0)}return{get highlights(){return T(r)},set highlights(m){B(r,rt(m))},get pro(){return T(i)},set pro(m){B(i,rt(m))},get nav(){return T(l)},set nav(m){B(l,rt(m))},get hide_new_toolbar(){return T(o)},set hide_new_toolbar(m){B(o,rt(m))},get draft(){return T(f)},find:v,upsert:d,remove:p,setDraft:w,draftSubmit:g,draftCancel:y}}const Pi="5";var lr;typeof window<"u"&&((lr=window.__svelte??(window.__svelte={})).v??(lr.v=new Set)).add(Pi);function Fi(t,e){let n=null,r=!0;return function(...i){n||(r?(t(...i),r=!1):(clearTimeout(n),n=setTimeout(()=>{t(...i),clearTimeout(n),n=null},e)))}}function pn(){var t;return(t=navigator==null?void 0:navigator.userAgentData)!=null&&t.mobile?!0:/Android|webOS|iPhone|iPad|iPod|Opera Mini/i.test(navigator.userAgent)}var Hi=gt(''),Ii=gt(''),Bi=gt('
');const ji={hash:"svelte-1rsw1q7",code:`.svelte-1rsw1q7 {user-select:none;-webkit-user-select:none;box-sizing:border-box;-webkit-tap-highlight-color:transparent;}dialog.svelte-1rsw1q7 {transform-origin:0 0;transform:scale(var(--mobile-zoom-level, 1));--control-size: 16px;--padding-s: 6px;--padding-m: 8px;--bg-light: rgb(255, 255, 255);--bg-dark: rgb(60, 60, 60);--control-fg-light: rgb(65, 65, 65);--control-fg-dark: rgb(230, 230, 230);--hover-bg-light: rgba(0,0,0,.07);--hover-bg-dark: rgba(255,255,255,.1);--active-bg-light: rgba(0,0,0,.13);--active-bg-dark: rgba(255,255,255,.2);} - dialog.mobile.svelte-ado8wf { - --control-size: 26px; + /* Safari iOS fix position bug */ + @supports (background-color: -apple-system-control-background) {dialog.svelte-1rsw1q7 {transform-origin:top right;} } - dialog.svelte-ado8wf { - position: absolute; - left: unset; - top: unset; - right: unset; - bottom: unset; - border: none; - padding: 2px; - border-radius: var(--control-size); - overflow: clip; - z-index: 999999999999999; + @supports (background-color: -apple-system-control-background) {dialog.svelte-1rsw1q7 {--bg-light: rgba(255, 255, 255, .8);--bg-dark: rgba(60, 60, 60, .8);backdrop-filter:blur(5px);-webkit-backdrop-filter:blur(5px);} + }dialog.mobile.svelte-1rsw1q7 {--control-size: 26px;}dialog.svelte-1rsw1q7 {position:absolute;left:unset;top:unset;right:unset;bottom:unset;border:none;padding:2px;border-radius:var(--control-size);overflow:clip;z-index:999999999999999;background:var(--bg-light);color:var(--control-fg-light); - background: var(--bg-light); - color: var(--control-fg-light); + @supports(color: light-dark(white,black)) {background:light-dark(var(--bg-light), var(--bg-dark));color:light-dark(var(--control-fg-light), var(--control-fg-dark)); + }} - @supports(color: light-dark(white,black)) { - background: light-dark(var(--bg-light), var(--bg-dark)); - color: light-dark(var(--control-fg-light), var(--control-fg-dark)); - } - } - - dialog.mobile.new.svelte-ado8wf { + /* dialog.mobile.new { position: fixed; top: auto !important; left: auto !important; @@ -90,377 +52,58 @@ bottom: 16px !important; margin-right: env(safe-area-inset-right); margin-bottom: env(safe-area-inset-bottom); - } - - [open].svelte-ado8wf { - box-shadow: 0 0 0 .5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.05), 0 15px 40px rgba(0,0,0,.1); - } - - form.svelte-ado8wf { - display: flex; - gap: 2px; - margin: 0; - padding: 0; - } - - button.svelte-ado8wf { - border-radius: var(--control-size); - border: 0; - background: transparent; - cursor: pointer; - appearance: none; - touch-action: manipulation; - width: calc(var(--control-size) + var(--padding-s)*2); - height: calc(var(--control-size) + var(--padding-s)*2); - padding: var(--padding-s); - color: inherit; - display: flex; - align-items: center; - justify-content: center; - transition: background .15s ease-in-out; - } - - @media (pointer: fine) { - button.svelte-ado8wf:hover { - transition: none; - background: var(--hover-bg-light); - - @supports(color: light-dark(white,black)) { - background: light-dark(var(--hover-bg-light), var(--hover-bg-dark)); - } - } - } + } */[open].svelte-1rsw1q7 {box-shadow:0 0 0 .5px rgba(0,0,0,.2), 0 5px 10px rgba(0,0,0,.05), 0 15px 40px rgba(0,0,0,.1);}form.svelte-1rsw1q7 {display:flex;gap:2px;margin:0;padding:0;}button.svelte-1rsw1q7 {border-radius:var(--control-size);border:0;background:transparent;cursor:pointer;appearance:none;touch-action:manipulation;width:calc(var(--control-size) + var(--padding-s)*2);height:calc(var(--control-size) + var(--padding-s)*2);padding:var(--padding-s);color:inherit;display:flex;align-items:center;justify-content:center;transition:background .15s ease-in-out;} - button.svelte-ado8wf:active { - transition: none; - background: var(--active-bg-light); + @media (pointer: fine) {button.svelte-1rsw1q7:hover {transition:none;background:var(--hover-bg-light); - @supports(color: light-dark(white,black)) { - background: light-dark(var(--active-bg-light), var(--active-bg-dark)); - } - } + @supports(color: light-dark(white,black)) {background:light-dark(var(--hover-bg-light), var(--hover-bg-dark)); + }} + }button.svelte-1rsw1q7:active {transition:none;background:var(--active-bg-light); - svg.svelte-ado8wf { - stroke: currentColor; - stroke-width: 1.5px; - } + @supports(color: light-dark(white,black)) {background:light-dark(var(--active-bg-light), var(--active-bg-dark)); + }}svg.svelte-1rsw1q7 {stroke:currentColor;stroke-width:1.5px;}.color.svelte-1rsw1q7 {pointer-events:none;content:'';display:block;width:15px;height:15px;background:var(--color);transition:background .15s ease-in-out, box-shadow .15s ease-in-out;border-radius:50%;}.color.active.svelte-1rsw1q7 {background:transparent;box-shadow:inset 0 0 0 5px var(--color);} - .color.svelte-ado8wf { - pointer-events: none; - content: ''; - display: block; - width: 15px; - height: 15px; - background: var(--color); - transition: background .15s ease-in-out, box-shadow .15s ease-in-out; - border-radius: 50%; - } - - .color.active.svelte-ado8wf { - background: transparent; - box-shadow: inset 0 0 0 5px var(--color); - } - - /* animation */ - dialog.svelte-ado8wf { - transition: - display .25s allow-discrete ease-in-out, + /* animation */dialog.svelte-1rsw1q7 {transition:display .25s allow-discrete ease-in-out, overlay .25s allow-discrete ease-in-out, box-shadow .25s allow-discrete ease-in-out, - opacity .25s ease-in-out, - left .15s ease-in-out, - top .15s ease-in-out, - right .15s ease-in-out, - bottom .15s ease-in-out; - opacity: 0; - } - - [open].svelte-ado8wf { - opacity: 1; - } - - dialog.svelte-ado8wf:not([open]) { - transition-duration: .2s; - pointer-events: none; - } + opacity .25s ease-in-out;opacity:0;}[open].svelte-1rsw1q7 {opacity:1;}dialog.svelte-1rsw1q7:not([open]) {transition-duration:.2s;pointer-events:none;} - @starting-style { - [open].svelte-ado8wf { - opacity: 0; - } - } -`};function Ir(t,e){pe(e,!0),Nn(t,xi);let n=Pe(e,"store",7),r,o=jt(void 0),s=jt(!1);function l(N){if(!x(o))return;const P=N.currentTarget.returnValue;switch(N.currentTarget.returnValue="",P){case"add":n().upsert(x(o)),ie();break;case"note":n().setDraft(x(o)),ie();break;case"remove":n().remove(x(o)),ie();break;default:if(Dt.has(P)){n().upsert({...x(o),color:P}),ie();return}break}}function d(){B(s,!0)}function h(){B(s,!1),setTimeout(f)}function f(){if(x(s)){r==null||r.close();return}requestAnimationFrame(()=>{const N=Pr(),P=N&&n().find(N);if(!N||!(P!=null&&P._id)&&!N.toString().trim()){r==null||r.close();return}B(o,st(P)),r.inert=!0,r==null||r.show(),r.inert=!1;const I=256,F=10,O=N.getBoundingClientRect(),X=Math.min(Math.max(O.x,F)+window.scrollX,window.innerWidth+window.scrollX-I-F),U=Math.min(window.innerWidth-Math.max(O.x,F)-window.scrollX-O.width,window.innerWidth-window.scrollX-I-F),wt=Math.max(O.y,40)+window.scrollY+O.height+4;window.innerHeight-Math.max(O.y,40)-window.scrollY+4;const ut=Xr=N,()=>r);const C=Cn(cn);vt(()=>le(g,"mobile",x(C)));var m=lt(g),b=lt(m);Tn(b,17,()=>Dt,([N,P])=>N,(N,P)=>{let I=()=>x(P)[0],F=()=>x(P)[1];var O=Ci(),X=lt(O);J(O),vt(()=>{var U;it(O,"aria-label",I()),ei(O,I()),it(X,"style",`--color: ${F()??""}`),le(X,"active",I()==((U=x(o))==null?void 0:U.color))}),at(N,O)});var T=rt(b,2),L=lt(T),S=lt(L),k=lt(S),$=rt(k),A=rt($),xt=rt(A);J(S),J(L),J(T);var Z=rt(T,2);return je(Z,()=>{var N;return(N=x(o))==null?void 0:N._id},N=>{var P=ki();at(N,P)}),J(m),J(g),vt(()=>{var N,P,I,F,O,X;le(g,"new",!((N=x(o))!=null&&N._id)),it(k,"fill",(P=x(o))!=null&&P.note?"currentColor":"none"),it(k,"stroke-width",(I=x(o))!=null&&I.note?"0":void 0),it($,"fill",(F=x(o))!=null&&F.note?"none":"currentColor"),it(A,"fill",(O=x(o))!=null&&O.note?"none":"currentColor"),it(xt,"fill",(X=x(o))!=null&&X.note?"none":"currentColor")}),ht("close",g,l),at(t,g),_e({get store(){return n()},set store(N){n(N),Qt()}})}Ie(Ir,{store:{}},[],[],!0);function Ti(t){const e=t.currentTarget.getBoundingClientRect();e.top<=t.clientY&&t.clientY<=e.top+e.height&&e.left<=t.clientX&&t.clientX<=e.left+e.width||(t.preventDefault(),t.currentTarget.close())}var Ni=(t,e)=>B(e,!1),Si=mt(''),Ai=mt('
Upgrade to Pro to unlock annotation
'),Di=mt('
',1),Li=mt('
');const Mi={hash:"svelte-n7j6yt",code:` - .svelte-n7j6yt { - box-sizing: border-box; - -webkit-tap-highlight-color: transparent; - } + @starting-style {[open].svelte-1rsw1q7 {opacity:0;} + }`};function Xr(t,e){ae(e,!0),Ue(t,ji);let n=me(e,"store"),r,o=Nt(void 0),i=Nt(!1);function l(D){if(!T(o))return;const M=D.currentTarget.returnValue;switch(D.currentTarget.returnValue="",M){case"add":n().upsert(T(o)),Qt();break;case"note":n().setDraft(T(o)),Qt();break;case"remove":n().remove(T(o)),Qt();break;default:if(Mt.has(M)){n().upsert({...T(o),color:M}),Qt();return}break}}function f(){B(i,!0)}function v(){B(i,!1),setTimeout(d)}function d(){if(T(i)){r==null||r.close();return}requestAnimationFrame(()=>{const D=hn(),M=D&&n().find(D);if(!D||!(M!=null&&M._id)&&!D.toString().trim()||!(M!=null&&M._id)&&n().hide_new_toolbar){r==null||r.close();return}B(o,rt(M)),r.inert=!0,r==null||r.show(),r.inert=!1;const Y=256,z=10,L=D.getBoundingClientRect(),V=Math.min(Math.max(L.x,z)+window.scrollX,window.innerWidth+window.scrollX-Y-z),U=Math.min(window.innerWidth-Math.max(L.x,z)-window.scrollX-L.width,window.innerWidth-window.scrollX-Y-z),tt=Math.max(L.y,40)+window.scrollY+L.height+4;window.innerHeight-Math.max(L.y,40)-window.scrollY+4;const X=VMt,([D,M])=>D,(D,M)=>{let Y=()=>T(M)[0],z=()=>T(M)[1];var L=Hi(),V=ot(L);let U;J(L),Wt(()=>{var tt;ct(L,"aria-label",Y()),pi(L,Y()),U=Fe(V,1,"color svelte-1rsw1q7",null,U,{active:Y()==((tt=T(o))==null?void 0:tt.color)}),ct(V,"style",`--color: ${z()??""}`)}),st(D,L)});var k=it(m,2),S=ot(k),O=ot(S),q=ot(O),$=it(q),x=it($),A=it(x);J(O),J(S),J(k);var $t=it(k,2);{var dt=D=>{var M=Ii();st(D,M)};Pe($t,D=>{var M;(M=T(o))!=null&&M._id&&D(dt)})}return J(y),J(w),vn(w,D=>r=D,()=>r),Wt(D=>{var M,Y,z,L,V,U;g=Fe(w,1,"svelte-1rsw1q7",null,g,{new:!((M=T(o))!=null&&M._id),mobile:D}),ct(q,"fill",(Y=T(o))!=null&&Y.note?"currentColor":"none"),ct(q,"stroke-width",(z=T(o))!=null&&z.note?"0":void 0),ct($,"fill",(L=T(o))!=null&&L.note?"none":"currentColor"),ct(x,"fill",(V=T(o))!=null&&V.note?"none":"currentColor"),ct(A,"fill",(U=T(o))!=null&&U.note?"none":"currentColor")},[pn]),bt("close",w,l),st(t,w),ue({get store(){return n()},set store(D){n(D),le()}})}we(Xr,{store:{}},[],[],!0);function Vi(t){const e=t.currentTarget.getBoundingClientRect();e.top<=t.clientY&&t.clientY<=e.top+e.height&&e.left<=t.clientX&&t.clientX<=e.left+e.width||(t.preventDefault(),t.currentTarget.close())}var zi=(t,e)=>B(e,!1),Wi=gt(''),Yi=gt('
Upgrade to Pro to unlock annotation
'),Ui=gt('
',1),Xi=gt('
');const Gi={hash:"svelte-ub8p4v",code:`.svelte-ub8p4v {box-sizing:border-box;-webkit-tap-highlight-color:transparent;}dialog.svelte-ub8p4v {transform:scale(var(--mobile-zoom-level, 1));--bg-light: rgb(245, 245, 245);--bg-dark: rgb(35, 35, 35);--fg-light: black;--fg-dark: white;--control-bg-light: rgb(230, 230, 230);--control-bg-dark: rgb(55, 55, 55);font-family:-apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji;font-size:18px;line-height:1.4;border:none;border-radius:.5em;padding:0;overscroll-behavior:none;color:var(--fg-light); - dialog.svelte-n7j6yt { - --bg-light: rgb(245, 245, 245); - --bg-dark: rgb(35, 35, 35); - --fg-light: black; - --fg-dark: white; - --control-bg-light: rgb(230, 230, 230); - --control-bg-dark: rgb(55, 55, 55); + @supports(color: light-dark(white,black)) {color:light-dark(var(--fg-light), var(--fg-dark)); + }}dialog.mobile.svelte-ub8p4v {left:0;right:0;bottom:0;top:0;width:100%;margin:0;max-width:100%;max-height:100%;border-radius:0;bottom:auto;}dialog.svelte-ub8p4v, header.svelte-ub8p4v {background:var(--bg-light); - font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji; - font-size: 18px; - line-height: 1.4; - border: none; - border-radius: .5em; - padding: 0; - overscroll-behavior: none; - - color: var(--fg-light); - - @supports(color: light-dark(white,black)) { - color: light-dark(var(--fg-light), var(--fg-dark)); - } - } - - dialog.mobile.svelte-n7j6yt { - left: 0;right: 0;bottom: 0;top: 0; - width: 100%; - margin: 0; - max-width: 100%; - max-height: 100%; - border-radius: 0; - bottom: auto; - } - - dialog.svelte-n7j6yt, header.svelte-n7j6yt { - background: var(--bg-light); - - @supports(color: light-dark(white,black)) { - background: light-dark(var(--bg-light), var(--bg-dark)); - } - } - - [open].svelte-n7j6yt { - box-shadow: 0 0 0 .5px rgba(60, 60, 60, .9), 0 3px 10px rgba(0,0,0,.05), 0 7px 15px -3px rgba(0,0,0,.15); - } - - .svelte-n7j6yt::backdrop { - background-color: rgba(0,0,0,.3); - } - - header.svelte-n7j6yt { - margin: 0; - padding: 1em; - font-weight: bold; - position: sticky; - top: 0; - } + @supports(color: light-dark(white,black)) {background:light-dark(var(--bg-light), var(--bg-dark)); + }}[open].svelte-ub8p4v {box-shadow:0 0 0 .5px rgba(60, 60, 60, .9), 0 3px 10px rgba(0,0,0,.05), 0 7px 15px -3px rgba(0,0,0,.15);}.svelte-ub8p4v::backdrop {background-color:rgba(0,0,0,.3);}header.svelte-ub8p4v {margin:0;padding:1em;font-weight:bold;position:sticky;top:0;} - @supports(animation-timeline: scroll()) { - header.svelte-n7j6yt { - animation: svelte-n7j6yt-header-scroll linear both; - animation-timeline: scroll(); - animation-range: 0 1px; - } + @supports(animation-timeline: scroll()) {header.svelte-ub8p4v { + animation: svelte-ub8p4v-header-scroll linear both;animation-timeline:scroll();animation-range:0 1px;} } - @keyframes svelte-n7j6yt-header-scroll { + @keyframes svelte-ub8p4v-header-scroll { to { box-shadow: 0 .5px 0 rgba(0,0,0,.2); } - } - - form.svelte-n7j6yt { - display: flex; - flex-direction: column; - gap: 1em; - padding: 1em; - padding-top: 0; - } - - .color.svelte-n7j6yt { - all: unset; - display: flex; - gap: .75em; - } - - .color.svelte-n7j6yt input[type="radio"]:where(.svelte-n7j6yt) { - cursor: pointer; - appearance: none; - user-select: none; - -webkit-user-select: none; - margin: 0; - background: var(--color); - transition: box-shadow .2s ease-in-out, background .2s ease-in-out; - width: 2em; - height: 2em; - border-radius: 50%; - } - - .color.svelte-n7j6yt input[type="radio"]:where(.svelte-n7j6yt):checked { - background: transparent; - box-shadow: inset 0 0 0 .5em var(--color); - } - - .color.svelte-n7j6yt input[type="radio"]:where(.svelte-n7j6yt):active { - transform: translateY(1px); - } - - blockquote.svelte-n7j6yt, .note.svelte-n7j6yt, button.svelte-n7j6yt { - background: var(--control-bg-light); - - @supports(color: light-dark(white,black)) { - background: light-dark(var(--control-bg-light), var(--control-bg-dark)); - } - } - - blockquote.svelte-n7j6yt { - white-space: pre-wrap; - margin: 0; - min-width: 100%; - width: 0; - font-size: 16px; - } - - blockquote.compact.svelte-n7j6yt { - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - overflow: clip; - } - - blockquote.svelte-n7j6yt, .note.svelte-n7j6yt { - border-radius: .5em; - padding: .5em .6em; - } - - .note.svelte-n7j6yt { - min-width: min(21em, 70vw); - min-height: 4lh; - appearance: none; - border: 0; - font: inherit; - color: inherit; - display: block; - scroll-margin-top: 100vh; - transition: background .15s ease-in-out, box-shadow .15s ease-in-out; - } + }form.svelte-ub8p4v {display:flex;flex-direction:column;gap:1em;padding:1em;padding-top:0;}.color.svelte-ub8p4v {all:unset;display:flex;gap:.75em;}.color.svelte-ub8p4v input[type="radio"]:where(.svelte-ub8p4v) {cursor:pointer;appearance:none;user-select:none;-webkit-user-select:none;margin:0;background:var(--color);transition:box-shadow .2s ease-in-out, background .2s ease-in-out;width:2em;height:2em;border-radius:50%;}.color.svelte-ub8p4v input[type="radio"]:where(.svelte-ub8p4v):checked {background:transparent;box-shadow:inset 0 0 0 .5em var(--color);}.color.svelte-ub8p4v input[type="radio"]:where(.svelte-ub8p4v):active {transform:translateY(1px);}blockquote.svelte-ub8p4v, .note.svelte-ub8p4v, button.svelte-ub8p4v {background:var(--control-bg-light); - .note.svelte-n7j6yt:focus { - background: transparent; - } - - footer.svelte-n7j6yt { - all: unset; - display: flex; - justify-content: flex-end; - gap: .75em; - } - - button.svelte-n7j6yt { - appearance: none; - user-select: none; - -webkit-user-select: none; - touch-action: manipulation; - border: 0; - font: inherit; - color: inherit; - cursor: pointer; - padding: .25em .75em; - border-radius: .5em; - } + @supports(color: light-dark(white,black)) {background:light-dark(var(--control-bg-light), var(--control-bg-dark)); + }}blockquote.svelte-ub8p4v {white-space:pre-wrap;margin:0;min-width:100%;width:0;font-size:16px;}blockquote.compact.svelte-ub8p4v {white-space:nowrap;text-overflow:ellipsis;overflow:hidden;overflow:clip;}blockquote.svelte-ub8p4v, .note.svelte-ub8p4v {border-radius:.5em;padding:.5em .6em;}.note.svelte-ub8p4v {min-width:min(21em, 70vw);min-height:4lh;appearance:none;border:0;font:inherit;color:inherit;display:block;scroll-margin-top:100vh;transition:background .15s ease-in-out, box-shadow .15s ease-in-out;}.note.svelte-ub8p4v:focus {background:transparent;}footer.svelte-ub8p4v {all:unset;display:flex;justify-content:flex-end;gap:.75em;}button.svelte-ub8p4v {appearance:none;user-select:none;-webkit-user-select:none;touch-action:manipulation;border:0;font:inherit;color:inherit;cursor:pointer;padding:.25em .75em;border-radius:.5em;}button.svelte-ub8p4v:active {transform:translateY(1px);}button.svelte-ub8p4v sup:where(.svelte-ub8p4v) {margin-left:.25em;vertical-align:text-top;opacity:.5;}dialog.mobile.svelte-ub8p4v button:where(.svelte-ub8p4v) sup:where(.svelte-ub8p4v) {display:none;}button[value].svelte-ub8p4v {background:blue;background:AccentColor;color:white;}.unlock.svelte-ub8p4v {font-size:.75em;color:GrayText;} - button.svelte-n7j6yt:active { - transform: translateY(1px); - } - - button.svelte-n7j6yt sup:where(.svelte-n7j6yt) { - margin-left: .25em; - vertical-align: text-top; - opacity: .5; - } - - dialog.mobile.svelte-n7j6yt button:where(.svelte-n7j6yt) sup:where(.svelte-n7j6yt) { - display: none; - } - - button[value].svelte-n7j6yt { - background: blue; - background: AccentColor; - color: white; - } - - .unlock.svelte-n7j6yt { - font-size: .75em; - color: GrayText; - } - - /* animation */ - dialog.svelte-n7j6yt, .svelte-n7j6yt::backdrop { - transition: - display .2s allow-discrete ease-in-out, + /* animation */dialog.svelte-ub8p4v, .svelte-ub8p4v::backdrop {transition:display .2s allow-discrete ease-in-out, overlay .2s allow-discrete ease-in-out, opacity .2s ease-in-out, - transform .2s ease-in-out, - box-shadow .2s ease-in-out; - opacity: 0; - } + box-shadow .2s ease-in-out;opacity:0;}[open].svelte-ub8p4v, + [open].svelte-ub8p4v::backdrop {opacity:1;} - dialog.svelte-n7j6yt { - transform: translateY(1em); + @starting-style {[open].svelte-ub8p4v, + [open].svelte-ub8p4v::backdrop {opacity:0;} } - [open].svelte-n7j6yt, - [open].svelte-n7j6yt::backdrop { - opacity: 1; - transform: translateY(0); - } - - @starting-style { - [open].svelte-n7j6yt, - [open].svelte-n7j6yt::backdrop { - opacity: 0; - } - - [open].svelte-n7j6yt { - transform: translateY(-1em); - } - } - - @supports not selector(::highlight(a)) { - dialog.svelte-n7j6yt, dialog.svelte-n7j6yt::backdrop { - animation: svelte-n7j6yt-simple-appear .2s forwards; - } - @keyframes svelte-n7j6yt-simple-appear { + @supports not selector(::highlight(a)) {dialog.svelte-ub8p4v, dialog.svelte-ub8p4v::backdrop { + animation: svelte-ub8p4v-simple-appear .2s forwards;} + @keyframes svelte-ub8p4v-simple-appear { from { opacity: 0; } to { opacity: 1; } } - } -`};function qr(t,e){pe(e,!0),Nn(t,Mi);const n=[];let r=Pe(e,"store",7),o,s,l=jt(!0);tn(()=>{r().draft?(B(l,!0),o==null||o.showModal()):o==null||o.close()});function d(k){const $=k.currentTarget.returnValue;k.currentTarget.returnValue="",setTimeout($?r().draftSubmit:r().draftCancel,200)}function h(k){var $;cn()||(k.stopImmediatePropagation(),k.stopPropagation(),k.key=="Enter"&&!k.shiftKey&&(k.preventDefault(),s&&(($=k.currentTarget.closest("form"))==null||$.requestSubmit(s))))}var f=Li();un(f,k=>o=k,()=>o),f.__mousedown=[Ti];const _=Cn(cn);vt(()=>le(f,"mobile",x(_)));var g=lt(f),C=lt(g);J(g);var m=rt(g,2),b=lt(m);je(b,()=>r().draft,k=>{var $=Di(),A=$n($);A.__click=[Ni,l];var xt=lt(A);vt(()=>{var I,F;return Ke(xt,((F=(I=r().draft)==null?void 0:I.text)==null?void 0:F.trim())||"")}),J(A);var Z=rt(A,2);Tn(Z,21,()=>Dt,Xo,(I,F)=>{let O=()=>x(F)[0],X=()=>x(F)[1];var U=Si();ti(U);var wt;vt(()=>{wt!==(wt=O())&&(U.value=(U.__value=O())==null?"":O()),it(U,"style",`--color: ${X()??""}`)}),oi(n,[],U,()=>(O(),r().draft.color),ut=>r().draft.color=ut),at(I,U)}),J(Z);var N=rt(Z,2);Qo(N),Zo(N),N.__keydown=h;var P=rt(N,2);je(P,()=>!r().pro,I=>{var F=Ai();at(I,F)}),vt(()=>{le(A,"compact",x(l)),N.disabled=!r().pro}),ri(N,()=>r().draft.note,I=>r().draft.note=I),at(k,$)});var T=rt(b,2),L=rt(lt(T),2);un(L,k=>s=k,()=>s);var S=lt(L);return Io(),J(L),J(T),J(m),J(f),vt(()=>{var k,$;Ke(C,`${((k=r().draft)!=null&&k._id?"Edit":"New")??""} highlight`),Ke(S,`${(($=r().draft)!=null&&$._id?"Update":"Create")??""} `)}),ht("close",f,d),at(t,f),_e({get store(){return r()},set store(k){r(k),Qt()}})}Ar(["mousedown","click","keydown"]);Ie(qr,{store:{}},[],[],!0);const ji=t=>{const e=t.target.getAttribute("data-highlight");e&&(t.preventDefault(),Hr(e))};var Oi=mt('
'),Ri=mt('');const Fi={hash:"svelte-rwfy02",code:` - nav.svelte-rwfy02 { - all: unset; - } - - div.svelte-rwfy02 { - position: fixed; - right: 0; - width: 24px; - height: 20px; - display: flex; - justify-content: flex-end; - align-items: center; - cursor: pointer; - background: transparent; - z-index: 99999999999999; - } - - div.svelte-rwfy02::before { - content: ''; - display: block; - height: 3px; - border-radius: 3px; - width: 16px; - background: var(--color); - transition: width .15s ease-in-out; - } - - div.svelte-rwfy02:hover::before { - width: 100%; - } -`};function Br(t,e){pe(e,!0),Nn(t,Fi);let n=Pe(e,"store",7);var r=Vo(),o=$n(r);return je(o,()=>n().nav,s=>{var l=Ri();l.__click=[ji],Tn(l,21,()=>n().highlights,d=>d._id,(d,h)=>{var f=Oi();vt(()=>it(f,"style",`top: var(--highlight-${x(h)._id??""}-top); --color: ${(Dt.get(x(h).color)||x(h).color)??""}`)),vt(()=>it(f,"data-highlight",x(h)._id)),at(d,f)}),J(l),at(s,l)}),at(t,r),_e({get store(){return n()},set store(s){n(s),Qt()}})}Ar(["click"]);Ie(Br,{store:{}},[],[],!0);var Hi=mt(" ",1);function Pi(t,e){pe(e,!0);let n=Pe(e,"store",7);tn(()=>{Ze(n().highlights)});let r;function o(){Ze(n().highlights),clearTimeout(r),r=setTimeout(()=>Ze(n().highlights),3e3)}yn(()=>{document.readyState&&o()}),tn(()=>mi);var s=Hi();ht("load",Me,o),ht("popstate",Me,o);var l=$n(s);Ir(l,{get store(){return n()}});var d=rt(l,2);qr(d,{get store(){return n()}});var h=rt(d,2);return Br(h,{get store(){return n()}}),at(t,s),_e({get store(){return n()},set store(f){n(f),Qt()}})}customElements.define("rdh-ui",Ie(Pi,{store:{}},[],[],!0));function Ii(t){if(typeof chrome=="object"&&chrome.runtime&&chrome.runtime.onMessage||typeof browser=="object"&&browser.runtime&&browser.runtime.onMessage){const{runtime:e}=typeof browser=="object"?browser:chrome,n=(r,o)=>{o.id==e.id&&typeof r.type=="string"&&t(r)};return e.onMessage.removeListener(n),e.onMessage.addListener(n),r=>e.sendMessage(null,r)}if(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.rdh)return window.rdhSend=t,e=>window.webkit.messageHandlers.rdh.postMessage(e);if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&process.versions.electron){const{ipcRenderer:e}=require("electron"),n=(r,o)=>t(o);return e.removeListener("RDH",n),e.on("RDH",n),r=>e.sendToHost("RDH",r)}if("ReactNativeWebView"in window)return window.ReactNativeWebViewSendMessage=t,e=>window.ReactNativeWebView.postMessage(JSON.stringify(e));if(window.self!==window.top){const e=({data:n,source:r})=>{r!==window.parent||typeof n!="object"||typeof n.type!="string"||t(n)};return window.removeEventListener("message",e),window.addEventListener("message",e),n=>window.parent.postMessage(n,"*")}throw new Error("unsupported platform")}async function qi(t){let e=!1;const n=new Set,r=Ii(o=>{if(!e){n.add(o);return}t(o)});await new Promise(o=>{function s(){window.removeEventListener("DOMContentLoaded",s),o()}document.readyState=="loading"?(window.removeEventListener("DOMContentLoaded",s),window.addEventListener("DOMContentLoaded",s,{once:!0})):o()}),e=!0;for(const o of n)t(o),n.delete(o);return r}const re=document.createElement("rdh-ui");(async()=>{const t=await qi(n=>{switch(n.type){case"RDH_APPLY":Array.isArray(n.payload)&&(e.highlights=n.payload);break;case"RDH_CONFIG":typeof n.payload.pro=="boolean"&&(e.pro=n.payload.pro),typeof n.payload.nav=="boolean"&&(e.nav=n.payload.nav),typeof n.payload.enabled=="boolean"&&(n.payload.enabled===!0?document.body.contains(re)||document.body.appendChild(re):document.body.contains(re)&&document.body.removeChild(re));break;case"RDH_SCROLL":typeof n.payload._id=="string"&&Hr(n.payload._id);break;case"RDH_ADD_SELECTION":const r=Pr();if(!r)return;const o=e.find(r);if(!o)return;e.upsert(o),ie();break;case"RDH_NOTE_SELECTION":console.log("not implemented yet");break}}),e=yi(n=>t({type:"RDH_ADD",payload:n}),n=>t({type:"RDH_UPDATE",payload:n}),({_id:n})=>t({type:"RDH_REMOVE",payload:{_id:n}}));re.store=e,t({type:"RDH_READY",payload:{url:location.href}})})(); + }`};function Gr(t,e){ae(e,!0),Ue(t,Gi);const n=[];let r=me(e,"store"),o,i,l=Nt(!0);Oe(()=>{r().draft?(B(l,!0),o==null||o.showModal()):o==null||o.close()});function f($){const x=$.currentTarget.returnValue;$.currentTarget.returnValue="",setTimeout(x?r().draftSubmit:r().draftCancel,200)}function v($){var x;pn()||($.stopImmediatePropagation(),$.stopPropagation(),$.key=="Enter"&&!$.shiftKey&&($.preventDefault(),i&&((x=$.currentTarget.closest("form"))==null||x.requestSubmit(i))))}var d=Xi();d.__mousedown=[Vi];let p;var w=ot(d),g=ot(w);J(w);var y=it(w,2),m=ot(y);{var k=$=>{var x=Ui(),A=xn(x);A.__click=[zi,l];let $t;var dt=ot(A,!0);J(A);var D=it(A,2);On(D,21,()=>Mt,ai,(L,V)=>{let U=()=>T(V)[0],tt=()=>T(V)[1];var X=Wi();hi(X);var qt;Wt(()=>{qt!==(qt=U())&&(X.value=(X.__value=U())==null?"":U()),ct(X,"style",`--color: ${tt()??""}`)}),wi(n,[],X,()=>(U(),r().draft.color),jt=>r().draft.color=jt),st(L,X)}),J(D);var M=it(D,2);ni(M),ei(M),M.__keydown=v;var Y=it(M,2);{var z=L=>{var V=Yi();st(L,V)};Pe(Y,L=>{r().pro||L(z)})}Wt(L=>{$t=Fe(A,1,"svelte-ub8p4v",null,$t,{compact:T(l)}),nn(dt,L),M.disabled=!r().pro},[()=>{var L,V;return((V=(L=r().draft)==null?void 0:L.text)==null?void 0:V.trim())||""}]),mi(M,()=>r().draft.note,L=>r().draft.note=L),st($,x)};Pe(m,$=>{r().draft&&$(k)})}var S=it(m,2),O=it(ot(S),2),q=ot(O);return Fo(),J(O),vn(O,$=>i=$,()=>i),J(S),J(y),J(d),vn(d,$=>o=$,()=>o),Wt($=>{var x,A;p=Fe(d,1,"svelte-ub8p4v",null,p,{mobile:$}),nn(g,`${((x=r().draft)!=null&&x._id?"Edit":"New")??""} highlight`),nn(q,`${((A=r().draft)!=null&&A._id?"Update":"Create")??""} `)},[pn]),bt("close",d,f),st(t,d),ue({get store(){return r()},set store($){r($),le()}})}Br(["mousedown","click","keydown"]);we(Gr,{store:{}},[],[],!0);const Ji=t=>{const e=t.target.getAttribute("data-highlight");e&&(t.preventDefault(),Yr(e))};var Ki=gt('
'),Zi=gt('');const Qi={hash:"svelte-rwfy02",code:"nav.svelte-rwfy02 {all:unset;}div.svelte-rwfy02 {position:fixed;right:0;width:24px;height:20px;display:flex;justify-content:flex-end;align-items:center;cursor:pointer;background:transparent;z-index:99999999999999;}div.svelte-rwfy02::before {content:'';display:block;height:3px;border-radius:3px;width:16px;background:var(--color);transition:width .15s ease-in-out;}div.svelte-rwfy02:hover::before {width:100%;}"};function Jr(t,e){ae(e,!0),Ue(t,Qi);let n=me(e,"store");var r=ii(),o=xn(r);{var i=l=>{var f=Zi();f.__click=[Ji],On(f,21,()=>n().highlights,v=>v._id,(v,d)=>{var p=Ki();Wt(w=>{ct(p,"data-highlight",T(d)._id),ct(p,"style",`top: var(--highlight-${T(d)._id??""}-top); --color: ${w??""}`)},[()=>Mt.get(T(d).color)||T(d).color]),st(v,p)}),J(f),st(l,f)};Pe(o,l=>{n().nav&&l(i)})}return st(t,r),ue({get store(){return n()},set store(l){n(l),le()}})}Br(["click"]);we(Jr,{store:{}},[],[],!0);var ts=gt('
');const es={hash:"svelte-1qyoyb3",code:"div.svelte-1qyoyb3 {display:contents;}"};function Kr(t,e){ae(e,!0),Ue(t,es);let n=me(e,"children"),r=Nt(1);Oe(()=>{var f;function l(){var v;B(r,1/(((v=window.visualViewport)==null?void 0:v.scale)||1))}return(f=window.visualViewport)==null||f.addEventListener("resize",l),()=>{var v;return(v=window.visualViewport)==null?void 0:v.removeEventListener("resize",l)}});var o=ts(),i=ot(o);return di(i,()=>n()??dr),J(o),Wt(()=>gi(o,"--mobile-zoom-level",T(r))),st(t,o),ue({get children(){return n()},set children(l){n(l),le()}})}we(Kr,{children:{}},[],[],!0);var ns=gt(" ",1);function rs(t,e){ae(e,!0);let n=me(e,"store");Oe(()=>{ln(n().highlights)});let r;function o(){ln(n().highlights),clearTimeout(r),r=setTimeout(()=>ln(n().highlights),3e3)}return Ar(()=>{document.readyState&&o()}),Oe(()=>Li),bt("load",Se,o),bt("popstate",Se,o),Kr(t,{children:(i,l)=>{var f=ns(),v=xn(f);Xr(v,{get store(){return n()}});var d=it(v,2);Gr(d,{get store(){return n()}});var p=it(d,2);Jr(p,{get store(){return n()}}),st(i,f)},$$slots:{default:!0}}),ue({get store(){return n()},set store(i){n(i),le()}})}customElements.define("rdh-ui",we(rs,{store:{}},[],[],!0));function os(t){if(typeof chrome=="object"&&chrome.runtime&&chrome.runtime.onMessage||typeof browser=="object"&&browser.runtime&&browser.runtime.onMessage){const{runtime:e}=typeof browser=="object"?browser:chrome,n=(r,o)=>{o.id==e.id&&typeof r.type=="string"&&t(r)};return e.onMessage.removeListener(n),e.onMessage.addListener(n),r=>e.sendMessage(null,r)}if(window.webkit&&window.webkit.messageHandlers&&window.webkit.messageHandlers.rdh)return window.rdhSend=t,e=>window.webkit.messageHandlers.rdh.postMessage(e);if(typeof window<"u"&&typeof window.process=="object"&&window.process.type==="renderer"||typeof process<"u"&&typeof process.versions=="object"&&process.versions.electron){const{ipcRenderer:e}=require("electron"),n=(r,o)=>t(o);return e.removeListener("RDH",n),e.on("RDH",n),r=>e.sendToHost("RDH",r)}if("ReactNativeWebView"in window)return window.ReactNativeWebViewSendMessage=t,e=>window.ReactNativeWebView.postMessage(JSON.stringify(e));if(window.self!==window.top){const e=({data:n,source:r})=>{r!==window.parent||typeof n!="object"||typeof n.type!="string"||t(n)};return window.removeEventListener("message",e),window.addEventListener("message",e),n=>window.parent.postMessage(n,"*")}throw new Error("unsupported platform")}async function is(t){let e=!1;const n=new Set,r=os(o=>{if(!e){n.add(o);return}t(o)});await new Promise(o=>{function i(){window.removeEventListener("DOMContentLoaded",i),o()}document.body?o():(window.removeEventListener("DOMContentLoaded",i),window.addEventListener("DOMContentLoaded",i,{once:!0}))}),e=!0;for(const o of n)t(o),n.delete(o);return r}const fe=document.createElement("rdh-ui");(async()=>{const t=await is(n=>{switch(n.type){case"RDH_APPLY":Array.isArray(n.payload)&&(e.highlights=n.payload);break;case"RDH_CONFIG":typeof n.payload.pro=="boolean"&&(e.pro=n.payload.pro),typeof n.payload.nav=="boolean"&&(e.nav=n.payload.nav),typeof n.payload.hide_new_toolbar=="boolean"&&(e.hide_new_toolbar=n.payload.hide_new_toolbar),typeof n.payload.enabled=="boolean"&&(n.payload.enabled===!0?document.body.contains(fe)||document.body.appendChild(fe):document.body.contains(fe)&&document.body.removeChild(fe));break;case"RDH_SCROLL":typeof n.payload._id=="string"&&Yr(n.payload._id);break;case"RDH_ADD_SELECTION":{const r=hn();if(!r)return;const o=e.find(r);if(!o)return;e.upsert({...o,...n.payload||{}}),Qt()}break;case"RDH_NOTE_SELECTION":{const r=hn();if(!r)return;const o=e.find(r);if(!o)return;e.setDraft(o),Qt()}break}}),e=qi(n=>t({type:"RDH_ADD",payload:n}),n=>t({type:"RDH_UPDATE",payload:n}),({_id:n})=>t({type:"RDH_REMOVE",payload:{_id:n}}));fe.store=e,t({type:"RDH_READY",payload:{url:location.href}})})(); diff --git a/webapp b/webapp index 94ce852..506e37a 160000 --- a/webapp +++ b/webapp @@ -1 +1 @@ -Subproject commit 94ce852eb40615a3d139e179361038d41a1d216b +Subproject commit 506e37ad843ad1dbcf3f2f089a8ea90e7e43e7c0