diff --git a/src/co/common/webview/browser.js b/src/co/common/webview/browser.js
index 4e312f6e..2e972998 100644
--- a/src/co/common/webview/browser.js
+++ b/src/co/common/webview/browser.js
@@ -1,5 +1,5 @@
import s from './browser.module.styl'
-import React, { useEffect } from 'react'
+import React, { useEffect, useMemo } from 'react'
import { PREVIEW_URL } from '~data/constants/app'
export default function WebViewBrowser({ src, forwardedRef, className='', onError, ...etc }) {
@@ -12,6 +12,13 @@ export default function WebViewBrowser({ src, forwardedRef, className='', onErro
return ()=>window.removeEventListener('message', onMessage)
}, [onError])
+ const base64 = useMemo(()=>
+ btoa(
+ String.fromCharCode(...new TextEncoder('utf-8').encode(src))
+ ),
+ [src]
+ )
+
return (
)
}
\ No newline at end of file
diff --git a/src/target/extension/background/highlights/highlight.js b/src/target/extension/background/highlights/highlight.js
index 18bb961a..806c4356 100644
--- a/src/target/extension/background/highlights/highlight.js
+++ b/src/target/extension/background/highlights/highlight.js
@@ -1,31 +1,31 @@
-"use strict";var Xr=Object.defineProperty;var Rn=t=>{throw TypeError(t)};var Kr=(t,e,n)=>e in t?Xr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var at=(t,e,n)=>Kr(t,typeof e!="symbol"?e+"":e,n),Fn=(t,e,n)=>e.has(t)||Rn("Cannot "+n);var X=(t,e,n)=>(Fn(t,e,"read from private field"),n?n.call(t):e.get(t)),Ve=(t,e,n)=>e.has(t)?Rn("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),We=(t,e,n,r)=>(Fn(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,v=window.Node.prototype.cloneNode,d=window.Node.prototype.appendChild,f=window.Node.prototype.insertBefore,_=window.Node.prototype.removeChild,m=window.Node.prototype.replaceChild,b=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),g=window.Element.prototype.attachShadow,k=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),$=window.Element.prototype.getAttribute,A=window.Element.prototype.setAttribute,C=window.Element.prototype.removeAttribute,N=window.Element.prototype.toggleAttribute,x=window.Element.prototype.getAttributeNS,L=window.Element.prototype.setAttributeNS,ft=window.Element.prototype.removeAttributeNS,D=window.Element.prototype.insertAdjacentElement,M=window.Element.prototype.insertAdjacentHTML,B=window.Element.prototype.prepend,P=window.Element.prototype.append,j=window.Element.prototype.before,U=window.Element.prototype.after,z=window.Element.prototype.replaceWith,lt=window.Element.prototype.remove,xt=window.HTMLElement,yt=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),Tt=window.HTMLElement.prototype.insertAdjacentElement,re=window.HTMLElement.prototype.insertAdjacentHTML,$n=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 $n.add(i)});function xn(i){var a=$n.has(i);return i=/^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(i),!a&&i}var Ir=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(Ir(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 He(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 Pe(i,a){for(;a&&a!==i&&!a.nextSibling;)a=a.parentNode;return a&&a!==i?a.nextSibling:null}function Ie(i,a,c){for(var p=i;p;){if(p.nodeType===Node.ELEMENT_NODE){var u=p;a(u);var h=u.localName;if(h==="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)Ie(p,a,c);p=Pe(i,u);continue}else if(h==="template"){p=Pe(i,u);continue}if(u=u.__CE_shadowRoot)for(u=u.firstChild;u;u=u.nextSibling)Ie(u,a,c)}p=p.firstChild?p.firstChild:Pe(i,p)}}function ge(){var i=!(ht==null||!ht.noDocumentConstructionObserver),a=!(ht==null||!ht.shadyDomFastWalk);this.m=[],this.g=[],this.j=!1,this.shadyDomFastWalk=a,this.I=!i}function oe(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{ee(e)}}function mn(t){return te(nr,t,!1)}function he(t){return te(Gt,t,!0)}function pt(t){return he(t)}function ar(t,e=0){return te(Gt|rr|e,t,!0)}function ce(t,e=!0){return te(Gt|gt,t,!0,e)}function ur(t){var e=t.teardown;if(e!==null){const n=wn,r=q;In(!0),qn(null);try{e.call(null)}finally{In(n),qn(r)}}}function ee(t,e=!0){var n=!1;if((e||t.f&io)&&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}yn(t,e&&!n),de(t,0),st(t,Qt);var l=t.transitions;if(l!==null)for(const d of l)d.stop();ur(t);var v=t.parent;v!==null&&t.f>&&v.first!==null&&cr(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.parent=t.fn=t.nodes_start=t.nodes_end=null}function cr(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 Je(t,e){var n=[];gn(t,n,!0),fr(n,()=>{ee(t),e&&e()})}function fr(t,e){var n=t.length;if(n>0){var r=()=>--n||e();for(var o of t)o.out(r)}else e()}function gn(t,e,n){if(!(t.f&Pt)){if(t.f^=Pt,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&pn)!==0||(r.f>)!==0;gn(r,e,s?n:!1),r=o}}}function xe(t){dr(t,!0)}function dr(t,e){if(t.f&Pt){t.f^=Pt,ve(t)&&Le(t);for(var n=t.first;n!==null;){var r=n.next,o=(n.f&pn)!==0||(n.f>)!==0;dr(n,o?e:!1),n=r}if(t.transitions!==null)for(const s of t.transitions)(s.is_global||e)&&s.in()}}const Eo=typeof requestIdleCallback>"u"?t=>setTimeout(t,1):requestIdleCallback;let Te=!1,Ne=!1,Ge=[],Ze=[];function hr(){Te=!1;const t=Ge.slice();Ge=[],er(t)}function vr(){Ne=!1;const t=Ze.slice();Ze=[],er(t)}function It(t){Te||(Te=!0,queueMicrotask(hr)),Ge.push(t)}function ko(t){Ne||(Ne=!0,Eo(vr)),Ze.push(t)}function Co(){Te&&hr(),Ne&&vr()}function $o(t){let e=At|Dt;F===null&&(e|=qt);const n={deps:null,deriveds:null,equals:or,f:e,first:null,fn:t,last:null,reactions:null,v:null,version:0};if(q!==null&&q.f&At){var r=q;r.deriveds===null?r.deriveds=[n]:r.deriveds.push(n)}return n}function pr(t){yn(t);var e=t.deriveds;if(e!==null){t.deriveds=null;for(var n=0;nt.version)return!0;r&&!Ut&&!((v=s==null?void 0:s.reactions)!=null&&v.includes(t))&&(s.reactions??(s.reactions=[])).push(t)}}r||st(t,ct)}return!1}function Ao(t,e,n){throw t}function yr(t){var _;var e=K,n=Q,r=St,o=q,s=Ut,l=_t;K=null,Q=0,St=null,q=t.f&(gt|vn)?null:t,Ut=!Xt&&(t.f&qt)!==0,_t=null;try{var v=(0,t.fn)(),d=t.deps;if(K!==null){var f;if(de(t,Q),d!==null&&Q>0)for(d.length=Q+K.length,f=0;f1e3&&(Kt=0,ho()),Kt++}function Er(t){var e=t.length;if(e!==0){br();var n=Xt;Xt=!0;try{for(var r=0;r1001)return;const t=Rt;Rt=[],Er(t),fe||(Kt=0)}function Me(t){be===mr&&(fe||(fe=!0,queueMicrotask(Lo)));for(var e=t;e.parent!==null;){e=e.parent;var n=e.f;if(n>){if(!(n&ct))return;st(e,Zt)}}Rt.push(e)}function kr(t,e){var n=t.first,r=[];t:for(;n!==null;){var o=n.f,s=(o&(Qt|Pt))===0,l=(o>)!==0,v=(o&ct)!==0,d=n.first;if(s&&(!l||!v)){if(l&&st(n,ct),o&Gt){if(!l&&ve(n)&&(Le(n),d=n.first),d!==null){n=d;continue}}else if(o&nr)if(l||v){if(d!==null){n=d;continue}}else r.push(n)}var f=n.next;if(f===null){let b=n.parent;for(;b!==null;){if(t===b)break t;var _=b.next;if(_!==null){n=_;continue t}b=b.parent}}n=f}for(var m=0;m0||o.length>0)&&ne(),Kt=0,r}finally{be=e,Rt=n}}function T(t){var e=t.f;if(e&Qt)return t.v;if(q!==null){_t!==null&&_t.includes(t)&&go();var n=q.deps;K===null&&n!==null&&n[Q]===t?Q++:K===null?K=[t]:K.push(t),St!==null&&F!==null&&F.f&ct&&!(F.f>)&&St.includes(t)&&(st(F,Dt),Me(F))}if(e&At){var r=t;ve(r)&&_r(r)}return t.v}function Mo(t){const e=q;try{return q=null,t()}finally{q=e}}const jo=~(Dt|Zt|ct);function st(t,e){t.f=t.f&jo|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:tt(!1)})}function _e(t){const e=Y;if(e!==null){t!==void 0&&(e.x=t);const r=e.e;if(r!==null){e.e=null;for(var n=0;n=C.v&&I(C,N+1)}Vn(l)}return!0},ownKeys(d){T(l);var f=Reflect.ownKeys(d).filter(b=>{var g=o.get(b);return g===void 0||g.v!==Z});for(var[_,m]of o)m.v!==Z&&!(_ in d)&&f.push(_);return f},setPrototypeOf(){mo()}})}function Vn(t,e=1){I(t,t.v+e)}function Se(t){return t!==null&&typeof t=="object"&&zt in t?t[zt]:t}function Oo(t,e){return Object.is(Se(t),Se(e))}var Ae,jt,Cr,$r;function tn(){if(Ae===void 0){Ae=window,jt=document;var t=Element.prototype,e=Node.prototype;Cr=Ft(e,"firstChild").get,$r=Ft(e,"nextSibling").get,t.__click=void 0,t.__className="",t.__attributes=null,t.__e=void 0,Text.prototype.__t=void 0}}function me(t=""){return document.createTextNode(t)}function Lt(t){return Cr.call(t)}function $t(t){return $r.call(t)}function ot(t){if(!O)return Lt(t);var e=Lt(R);return e===null&&(e=R.appendChild(me())),mt(e),e}function bn(t,e){if(!O){var n=Lt(t);return n instanceof Comment&&n.data===""?$t(n):n}return R}function et(t,e=1,n=!1){let r=O?R:t;for(;e--;)r=$t(r);if(!O)return r;var o=r.nodeType;if(n&&o!==3){var s=me();return r==null||r.before(s),mt(s),s}return mt(r),r}function En(t){t.textContent=""}let O=!1;function Ct(t){O=t}let R;function mt(t){if(t===null)throw fn(),ae;return R=t}function je(){return mt($t(R))}function J(t){if(O){if($t(R)!==null)throw fn(),ae;R=t}}function Ro(t=1){if(O){for(var e=t,n=R;e--;)n=$t(n);R=n}}function en(){for(var t=0,e=R;;){if(e.nodeType===8){var n=e.data;if(n===cn){if(t===0)return e;t-=1}else(n===tr||n===un)&&(t+=1)}var r=$t(e);e.remove(),e=r}}const xr=new Set,nn=new Set;function Fo(t,e,n,r){function o(s){if(r.capture||se.call(e,s),!s.cancelBubble)return n.call(this,s)}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?It(()=>{e.addEventListener(t,o,r)}):e.addEventListener(t,o,r),o}function vt(t,e,n,r,o){var s={capture:r,passive:o},l=Fo(t,e,n,s);(e===document.body||e===window||e===document)&&sr(()=>{e.removeEventListener(t,l,s)})}function Tr(t){for(var e=0;e{throw C});throw _}}finally{t.__root=e,s=e}}}function Ho(t){var e=document.createElement("template");return e.innerHTML=t,e.content}function Jt(t,e){var n=F;n.nodes_start===null&&(n.nodes_start=t,n.nodes_end=e)}function wt(t,e){var n=(e&Qr)!==0,r=(e&to)!==0,o,s=!t.startsWith("");return()=>{if(O)return Jt(R,null),R;o===void 0&&(o=Ho(s?t:""+t),n||(o=Lt(o)));var l=r?document.importNode(o,!0):o.cloneNode(!0);if(n){var v=Lt(l),d=l.lastChild;Jt(v,d)}else Jt(l,l);return l}}function Po(){if(O)return Jt(R,null),R;var t=document.createDocumentFragment(),e=document.createComment(""),n=me();return t.append(e,n),Jt(e,n),t}function it(t,e){if(O){F.nodes_end=R,je();return}t!==null&&t.before(e)}const Io=["wheel","mousewheel","touchstart","touchmove"];function qo(t){return Io.includes(t)}function Ye(t,e){e!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=e,t.nodeValue=e==null?"":e+"")}function Nr(t,e){const n=e.anchor??e.target.appendChild(me());return Sr(t,{...e,anchor:n})}function Bo(t,e){tn(),e.intro=e.intro??!1;const n=e.target,r=O,o=R;try{for(var s=Lt(n);s&&(s.nodeType!==8||s.data!==tr);)s=$t(s);if(!s)throw ae;Ct(!0),mt(s),je();const l=Sr(t,{...e,anchor:s});if(R===null||R.nodeType!==8||R.data!==cn)throw fn(),ae;return Ct(!1),l}catch(l){if(l===ae)return e.recover===!1&&vo(),tn(),En(n),Ct(!1),Nr(t,e);throw l}finally{Ct(r),mt(o)}}const Yt=new Map;function Sr(t,{target:e,anchor:n,props:r={},events:o,context:s,intro:l=!0}){tn();var v=new Set,d=m=>{for(var b=0;b(ce(()=>{if(s){pe({});var m=Y;m.c=s}o&&(r.$$events=o),O&&Jt(n,null),f=t(n,r)||{},O&&(F.nodes_end=R),s&&_e()}),()=>{for(var m of v){e.removeEventListener(m,se);var b=Yt.get(m);--b===0?(document.removeEventListener(m,se),Yt.delete(m)):Yt.set(m,b)}nn.delete(d),rn.delete(f)}));return rn.set(f,_),f}let rn=new WeakMap;function Vo(t){const e=rn.get(t);e&&e()}function De(t,e,n,r=null,o=!1){O&&je();var s=t,l=null,v=null,d=null,f=o?pn:0;ar(()=>{if(d===(d=!!e()))return;let _=!1;if(O){const m=s.data===un;d===m&&(s=en(),mt(s),Ct(!1),_=!0)}d?(l?xe(l):l=ce(()=>n(s)),v&&Je(v,()=>{v=null})):(v?xe(v):r&&(v=ce(()=>r(s))),l&&Je(l,()=>{l=null})),_&&Ct(!0)},f),O&&(s=R)}let Ue=null;function Wo(t,e){return e}function Yo(t,e,n,r){for(var o=[],s=e.length,l=0;l0&&o.length===0&&n!==null;if(v){var d=n.parentNode;En(d),d.append(n),r.clear(),Nt(t,e[0].prev,e[s-1].next)}fr(o,()=>{for(var f=0;f{var m=n(),b=dn(m)?m:m==null?[]:hn(m),g=b.length;let k=!1;if(O){var $=l.data===un;$!==(g===0)&&(l=en(),mt(l),Ct(!1),k=!0)}if(O){for(var A=null,C,N=0;N0&&mt(en())}O||Uo(b,v,l,o,e,r),s!==null&&(g===0?_?xe(_):_=ce(()=>s(l)):_!==null&&Je(_,()=>{_=null})),k&&Ct(!0)}),O&&(l=R)}function Uo(t,e,n,r,o,s){var lt,xt,yt,Tt;var l=(o&Jr)!==0,v=(o&(ln|an))!==0,d=t.length,f=e.items,_=e.first,m=_,b,g=null,k,$=[],A=[],C,N,x,L;if(l)for(L=0;L0){var z=o&Qn&&d===0?n:null;if(l){for(L=0;L{var re;if(k!==void 0)for(x of k)(re=x.a)==null||re.apply()}),F.first=e.first&&e.first.e,F.last=g&&g.e}function zo(t,e,n,r){r&ln&&I(t.v,e),r&an?I(t.i,n):t.i=n}function Ar(t,e,n,r,o,s,l,v,d){var f=Ue;try{var _=(d&ln)!==0,m=(d&Gr)===0,b=_?m?_n(o):tt(o):o,g=d&an?tt(l):l,k={i:g,v:b,k:s,a:null,e:null,prev:n,next:r};return Ue=k,k.e=ce(()=>v(t,b,g),O),k.e.prev=n&&n.e,k.e.next=r&&r.e,n===null?e.first=k:(n.next=k,n.e.next=k.e),r!==null&&(r.prev=k,r.e.prev=k.e),k}finally{Ue=f}}function Wn(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 Nt(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)}var Yn=new Set;function Cn(t,e,n=!1){if(!n){if(Yn.has(e))return;Yn.add(e)}It(()=>{var r=t.getRootNode(),o=r.host?r:r.head??r.ownerDocument.head;if(!o.querySelector("#"+e.hash)){const s=document.createElement("style");s.id=e.hash,s.textContent=e.code,o.appendChild(s)}})}function Xo(t,e){{const n=document.body;t.autofocus=!0,It(()=>{document.activeElement===n&&t.focus()})}}function Ko(t){O&&Lt(t)!==null&&En(t)}let Un=!1;function Dr(){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 Jo(t){if(O){var e=!1,n=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var r=t.value;ut(t,"value",null),t.value=r}if(t.hasAttribute("checked")){var o=t.checked;ut(t,"checked",null),t.checked=o}}};t.__on_r=n,ko(n),Dr()}}function Go(t,e){var n=t.__attributes??(t.__attributes={});n.value!==(n.value=e)&&(t.value=e)}function ut(t,e,n,r){n=n==null?null:n+"";var o=t.__attributes??(t.__attributes={});O&&(o[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")||o[e]!==(o[e]=n)&&(e==="loading"&&(t[so]=n),n===null?t.removeAttribute(e):t.setAttribute(e,n))}function ue(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 Lr(t,e,n,r=n){t.addEventListener(e,n);const o=t.__on_r;o?t.__on_r=()=>{o(),r()}:t.__on_r=r,Dr()}function Zo(t,e,n){Lr(t,"input",()=>{n(Xn(t)?Kn(t.value):t.value)}),he(()=>{var r=e();if(O&&t.defaultValue!==t.value){n(t.value);return}Xn(t)&&r===Kn(t.value)||t.type==="date"&&!r&&!t.value||(t.value=r??"")})}const ze=new Set;function Qo(t,e,n,r,o){var s=n.getAttribute("type")==="checkbox",l=t;let v=!1;if(e!==null)for(var d of e)l=l[d]??(l[d]=[]);l.push(n),Lr(n,"change",()=>{var f=n.__value;s&&(f=zn(l,f,n.checked)),o(f)},()=>o(s?[]:null)),he(()=>{var f=r();if(O&&n.defaultChecked!==n.checked){v=!0;return}s?(f=f||[],n.checked=Se(f).includes(Se(n.__value))):n.checked=Oo(n.__value,f)}),sr(()=>{var f=l.indexOf(n);f!==-1&&l.splice(f,1)}),ze.has(l)||(ze.add(l),It(()=>{l.sort((f,_)=>f.compareDocumentPosition(_)===4?-1:1),ze.delete(l)})),It(()=>{if(v){var f;if(s)f=zn(l,f,n.checked);else{var _=l.find(m=>m.checked);f=_==null?void 0:_.__value}o(f)}})}function zn(t,e,n){for(var r=new Set,o=0;o{var o,s;return he(()=>{o=s,s=[],Mo(()=>{t!==n(...s)&&(e(t,...s),o&&Jn(n(...o),t)&&e(null,...o))})}),()=>{It(()=>{s&&Jn(n(...s),t)&&e(null,...s)})}}),t}function Oe(t,e,n,r){var k;var o=(n&Zr)!==0,s=t[e],l=(k=Ft(t,e))==null?void 0:k.set,v=r,d=()=>v;s===void 0&&r!==void 0&&(l&&o&&po(),s=d(),l&&l(s));var f;if(f=()=>{var $=t[e];return $===void 0?d():$},l){var _=t.$$legacy;return function($,A){return arguments.length>0?((!A||_)&&l(A?f():$),$):f()}}var m=!1,b=_n(s),g=$o(()=>{var $=f(),A=T(b);return m?(m=!1,A):b.v=$});return function($,A){var C=T(g);if(arguments.length>0){const N=A?T(g):$;return g.equals(N)||(m=!0,I(b,N),T(g)),$}return C}}function ti(t){return new ei(t)}var Et,nt;class ei{constructor(e){Ve(this,Et);Ve(this,nt);var s;var n=new Map,r=(l,v)=>{var d=_n(v);return n.set(l,d),d};const o=new Proxy({...e.props||{},$$events:{}},{get(l,v){return T(n.get(v)??r(v,Reflect.get(l,v)))},has(l,v){return T(n.get(v)??r(v,Reflect.get(l,v))),Reflect.has(l,v)},set(l,v,d){return I(n.get(v)??r(v,d),d),Reflect.set(l,v,d)}});We(this,nt,(e.hydrate?Bo:Nr)(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)&&ne(),We(this,Et,o.$$events);for(const l of Object.keys(X(this,nt)))l==="$set"||l==="$destroy"||l==="$on"||Ce(this,l,{get(){return X(this,nt)[l]},set(v){X(this,nt)[l]=v},enumerable:!0});X(this,nt).$set=l=>{Object.assign(o,l)},X(this,nt).$destroy=()=>{Vo(X(this,nt))}}$set(e){X(this,nt).$set(e)}$on(e,n){X(this,Et)[e]=X(this,Et)[e]||[];const r=(...o)=>n.call(this,...o);return X(this,Et)[e].push(r),()=>{X(this,Et)[e]=X(this,Et)[e].filter(o=>o!==r)}}$destroy(){X(this,nt).$destroy()}}Et=new WeakMap,nt=new WeakMap;let Mr;typeof HTMLElement=="function"&&(Mr=class extends HTMLElement{constructor(e,n,r){super();at(this,"$$ctor");at(this,"$$s");at(this,"$$c");at(this,"$$cn",!1);at(this,"$$d",{});at(this,"$$r",!1);at(this,"$$p_d",{});at(this,"$$l",{});at(this,"$$l_u",new Map);at(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),it(s,l)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=ni(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=ti({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=he(()=>{var o;this.$$r=!0;for(const s of ke(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(),ee(this.$$me),this.$$c=void 0)})}$$g_p(e){return ke(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 ni(t){const e={};return t.childNodes.forEach(n=>{e[n.slot||"default"]=!0}),e}function Re(t,e,n,r,o,s){let l=class extends Mr{constructor(){super(t,n,o),this.$$p_d=e}static get observedAttributes(){return ke(e).map(v=>(e[v].attribute||v).toLowerCase())}};return ke(e).forEach(v=>{Ce(l.prototype,v,{get(){return this.$$c&&v in this.$$c?this.$$c[v]:this.$$d[v]},set(d){var m;d=Ee(v,d,e),this.$$d[v]=d;var f=this.$$c;if(f){var _=(m=Ft(f,v))==null?void 0:m.get;_?f[v]=d:f.$set({[v]:d})}}})}),r.forEach(v=>{Ce(l.prototype,v,{get(){var d;return(d=this.$$c)==null?void 0:d[v]}})}),t.element=l,l}const Mt=new Map([["yellow","#F8B920"],["red","#FF4646"],["blue","#0064FF"],["green","#00C564"]]),ri=["SCRIPT","STYLE","NOSCRIPT","TEXTAREA","OPTION"];function jr(t){const e=document.documentElement.lang||void 0,n=t.map(v=>v.trim().toLocaleLowerCase(e)),r=n.map(()=>({start:null,end:null,shift:0})),o=n.map(()=>[]),s=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,v=>{var d,f;return ri.includes((d=v.parentNode)==null?void 0:d.tagName)||((f=v.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 v=0;v{var b;for(;f[r[_].shift]&&!f[r[_].shift].trim();)r[_].shift++;let m=f[r[_].shift]===d;if(!m&&r[_].shift&&(r[_].shift=0,m=f[r[_].shift]===d),m&&(r[_].shift||(r[_].start=[l,v]),r[_].end=[l,v],r[_].shift++),r[_].shift>=f.length){const g=document.createRange();g.setStart(r[_].start[0],r[_].start[1]),g.setEnd(r[_].end[0],r[_].end[1]+1),!g.collapsed&&((b=g.commonAncestorContainer.parentElement)!=null&&b.checkVisibility())?o[_].push(g):g.detach(),m=!1}m||(r[_].shift=0,r[_].start=null,r[_].end=null)})}return o}const Ht=`rh-${new Date().getTime()}-`,Fe="highlights"in CSS;function oi(t){if(!t.length&&!CSS.highlights.size)return;const e=[];if(CSS.highlights.clear(),t.length){const r=jr(t.map(({text:o})=>o||""));for(const o in t){if(!r[o].length)continue;const{_id:s,color:l,note:v}=t[o],d=`${Ht}${s}`;CSS.highlights.set(d,new Highlight(...r[o]));const f=r[o][0].getBoundingClientRect();e.push(`
- ::highlight(${d}) {
+"use strict";var Kr=Object.defineProperty;var In=t=>{throw TypeError(t)};var Jr=(t,e,n)=>e in t?Kr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ct=(t,e,n)=>Jr(t,typeof e!="symbol"?e+"":e,n),Pn=(t,e,n)=>e.has(t)||In("Cannot "+n);var K=(t,e,n)=>(Pn(t,e,"read from private field"),n?n.call(t):e.get(t)),Ue=(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),ze=(t,e,n,r)=>(Pn(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,m=window.Node.prototype.replaceChild,k=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),g=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,C=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,I=window.Element.prototype.prepend,P=window.Element.prototype.append,F=window.Element.prototype.before,O=window.Element.prototype.after,X=window.Element.prototype.replaceWith,U=window.Element.prototype.remove,yt=window.HTMLElement,ut=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),te=window.HTMLElement.prototype.insertAdjacentElement,ee=window.HTMLElement.prototype.insertAdjacentHTML,Nn=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 Nn.add(i)});function Sn(i){var a=Nn.has(i);return i=/^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(i),!a&&i}var qr=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(qr(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 qe(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 Be(i,a){for(;a&&a!==i&&!a.nextSibling;)a=a.parentNode;return a&&a!==i?a.nextSibling:null}function Ve(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)Ve(p,a,c);p=Be(i,u);continue}else if(v==="template"){p=Be(i,u);continue}if(u=u.__CE_shadowRoot)for(u=u.firstChild;u;u=u.nextSibling)Ve(u,a,c)}p=p.firstChild?p.firstChild:Be(i,p)}}function ge(){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 wn(t){return Gt(nr,t,!1)}function he(t){return Gt(Jt,t,!0)}function vt(t){return he(t)}function ar(t,e=0){return Gt(Jt|rr|e,t,!0)}function ae(t,e=!0){return Gt(Jt|Lt,t,!0,e)}function ur(t){var e=t.teardown;if(e!==null){const n=kn,r=H;Bn(!0),Se(null);try{e.call(null)}finally{Bn(n),Se(r)}}}function Zt(t,e=!0){var n=!1;if((e||t.f&so)&&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}br(t,e&&!n),ce(t,0),mt(t,de);var l=t.transitions;if(l!==null)for(const h of l)h.stop();ur(t);var d=t.parent;d!==null&&d.first!==null&&cr(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.parent=t.fn=t.nodes_start=t.nodes_end=null}function cr(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 Qe(t,e){var n=[];bn(t,n,!0),fr(n,()=>{Zt(t),e&&e()})}function fr(t,e){var n=t.length;if(n>0){var r=()=>--n||e();for(var o of t)o.out(r)}else e()}function bn(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;bn(r,e,s?n:!1),r=o}}}function xe(t){dr(t,!0)}function dr(t,e){if(t.f&Ht){t.f^=Ht,ve(t)&&Oe(t);for(var n=t.first;n!==null;){var r=n.next,o=(n.f&mn)!==0||(n.f&Lt)!==0;dr(n,o?e:!1),n=r}if(t.transitions!==null)for(const s of t.transitions)(s.is_global||e)&&s.in()}}const Co=typeof requestIdleCallback>"u"?t=>setTimeout(t,1):requestIdleCallback;let Te=!1,Ne=!1,tn=[],en=[];function hr(){Te=!1;const t=tn.slice();tn=[],er(t)}function vr(){Ne=!1;const t=en.slice();en=[],er(t)}function It(t){Te||(Te=!0,queueMicrotask(hr)),tn.push(t)}function $o(t){Ne||(Ne=!0,Co(vr)),en.push(t)}function xo(){Te&&hr(),Ne&&vr()}function En(t){let e=Ct|St;M===null?e|=Pt:M.f|=or;const n={children:null,deps:null,equals:ir,f:e,fn:t,reactions:null,v:null,version:0,parent:M};if(H!==null&&H.f&Ct){var r=H;(r.children??(r.children=[])).push(n)}return n}function pr(t){var e=t.children;if(e!==null){t.children=null;for(var n=0;nt.version)return!0}}r||mt(t,G)}return!1}function Do(t,e,n){throw t}function wr(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|je)?null:t,Yt=!zt&&(t.f&Pt)!==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,vo()),Xt++}function kr(t){var e=t.length;if(e!==0){Er();var n=zt;zt=!0;try{for(var r=0;r1001)return;const t=Ot;Ot=[],kr(t),ue||(Xt=0)}function Re(t){be===mr&&(ue||(ue=!0,queueMicrotask(jo)));for(var e=t;e.parent!==null;){e=e.parent;var n=e.f;if(n&(je|Lt)){if(!(n&G))return;e.f^=G}}Ot.push(e)}function Cr(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)&&Oe(n);var d=n.first;if(d!==null){n=d;continue}}else o&nr&&r.push(n);var h=n.next;if(h===null){let m=n.parent;for(;m!==null;){if(t===m)break t;var f=m.next;if(f!==null){n=f;continue t}m=m.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)&&yo();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)&&(mt(M,St),Re(M))}if(e&Ct){var r=t;ve(r)&&_r(r)}return t.v}function Oo(t){const e=H;try{return H=null,t()}finally{H=e}}const Ro=~(St|fe|G);function mt(t,e){t.f=t.f&Ro|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,C+1)}Vn(l)}return!0},ownKeys(h){x(l);var f=Reflect.ownKeys(h).filter(k=>{var g=o.get(k);return g===void 0||g.v!==tt});for(var[_,m]of o)m.v!==tt&&!(_ in h)&&f.push(_);return f},setPrototypeOf(){go()}})}function Vn(t,e=1){B(t,t.v+e)}function De(t){return t!==null&&typeof t=="object"&&Ut in t?t[Ut]:t}function Fo(t,e){return Object.is(De(t),De(e))}var Le,Mt,$r,xr;function rn(){if(Le===void 0){Le=window,Mt=document;var t=Element.prototype,e=Node.prototype;$r=Rt(e,"firstChild").get,xr=Rt(e,"nextSibling").get,t.__click=void 0,t.__className="",t.__attributes=null,t.__e=void 0,Text.prototype.__t=void 0}}function me(t=""){return document.createTextNode(t)}function At(t){return $r.call(t)}function $t(t){return xr.call(t)}function lt(t){if(!j)return At(t);var e=At(R);return e===null&&(e=R.appendChild(me())),_t(e),e}function Cn(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=me();return r==null||r.before(s),_t(s),s}return _t(r),r}function $n(t){t.textContent=""}let j=!1;function kt(t){j=t}let R;function _t(t){if(t===null)throw vn(),se;return R=t}function Fe(){return _t($t(R))}function J(t){if(j){if($t(R)!==null)throw vn(),se;R=t}}function Ho(t=1){if(j){for(var e=t,n=R;e--;)n=$t(n);R=n}}function on(){for(var t=0,e=R;;){if(e.nodeType===8){var n=e.data;if(n===hn){if(t===0)return e;t-=1}else(n===Qn||n===dn)&&(t+=1)}var r=$t(e);e.remove(),e=r}}const Tr=new Set,sn=new Set;function Io(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"?It(()=>{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=Io(t,e,n,s);(e===document.body||e===window||e===document)&&lr(()=>{e.removeEventListener(t,l,s)})}function Nr(t){for(var e=0;e{throw S});throw _}}finally{t.__root=e,delete t.currentTarget}}}function Po(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 gt(t,e){var n=(e&to)!==0,r=(e&eo)!==0,o,s=!t.startsWith("");return()=>{if(j)return Kt(R,null),R;o===void 0&&(o=Po(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 qo(){if(j)return Kt(R,null),R;var t=document.createDocumentFragment(),e=document.createComment(""),n=me();return t.append(e,n),Kt(e,n),t}function at(t,e){if(j){M.nodes_end=R,Fe();return}t!==null&&t.before(e)}const Bo=["touchstart","touchmove"];function Vo(t){return Bo.includes(t)}function Xe(t,e){e!==(t.__t??(t.__t=t.nodeValue))&&(t.__t=e,t.nodeValue=e==null?"":e+"")}function Sr(t,e){const n=e.anchor??e.target.appendChild(me());return Ar(t,{...e,anchor:n})}function Wo(t,e){rn(),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!==Qn);)s=$t(s);if(!s)throw se;kt(!0),_t(s),Fe();const l=Ar(t,{...e,anchor:s});if(R===null||R.nodeType!==8||R.data!==hn)throw vn(),se;return kt(!1),l}catch(l){if(l===se)return e.recover===!1&&po(),rn(),$n(n),kt(!1),Sr(t,e);throw l}finally{kt(r),_t(o)}}const Wt=new Map;function Ar(t,{target:e,anchor:n,props:r={},events:o,context:s,intro:l=!0}){rn();var d=new Set,h=m=>{for(var k=0;k(ae(()=>{if(s){pe({});var m=Y;m.c=s}o&&(r.$$events=o),j&&Kt(n,null),f=t(n,r)||{},j&&(M.nodes_end=R),s&&_e()}),()=>{for(var m of d){e.removeEventListener(m,oe);var k=Wt.get(m);--k===0?(document.removeEventListener(m,oe),Wt.delete(m)):Wt.set(m,k)}sn.delete(h),ln.delete(f)}));return ln.set(f,_),f}let ln=new WeakMap;function Yo(t){const e=ln.get(t);e&&e()}function Me(t,e,n,r=null,o=!1){j&&Fe();var s=t,l=null,d=null,h=null,f=o?mn:0;ar(()=>{if(h===(h=!!e()))return;let _=!1;if(j){const m=s.data===dn;h===m&&(s=on(),_t(s),kt(!1),_=!0)}h?(l?xe(l):l=ae(()=>n(s)),d&&Qe(d,()=>{d=null})):(d?xe(d):r&&(d=ae(()=>r(s))),l&&Qe(l,()=>{l=null})),_&&kt(!0)},f),j&&(s=R)}let Ke=null;function Uo(t,e){return e}function zo(t,e,n,r){for(var o=[],s=e.length,l=0;l0&&o.length===0&&n!==null;if(d){var h=n.parentNode;$n(h),h.append(n),r.clear(),Tt(t,e[0].prev,e[s-1].next)}fr(o,()=>{for(var f=0;f{var m=n(),k=pn(m)?m:m==null?[]:_n(m),g=k.length;let b=!1;if(j){var T=l.data===dn;T!==(g===0)&&(l=on(),_t(l),kt(!1),b=!0)}if(j){for(var L=null,S,C=0;C0&&_t(on())}j||Xo(k,d,l,o,e,r),s!==null&&(g===0?_?xe(_):_=ae(()=>s(l)):_!==null&&Qe(_,()=>{_=null})),b&&kt(!0)}),j&&(l=R)}function Xo(t,e,n,r,o,s){var U,yt,ut,te;var l=(o&Gr)!==0,d=(o&(cn|fn))!==0,h=t.length,f=e.items,_=e.first,m=_,k,g=null,b,T=[],L=[],S,C,$,A;if(l)for(A=0;A0){var X=o&Zn&&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=g&&g.e}function Ko(t,e,n,r){r&cn&&B(t.v,e),r&fn?B(t.i,n):t.i=n}function Dr(t,e,n,r,o,s,l,d,h){var f=Ke;try{var _=(h&cn)!==0,m=(h&Zr)===0,k=_?m?gn(o):nt(o):o,g=h&fn?nt(l):l,b={i:g,v:k,k:s,a:null,e:null,prev:n,next:r};return Ke=b,b.e=ae(()=>d(t,k,g),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{Ke=f}}function Wn(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 Tn(t,e){It(()=>{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 Jo(t,e){{const n=document.body;t.autofocus=!0,It(()=>{document.activeElement===n&&t.focus()})}}function Go(t){j&&At(t)!==null&&$n(t)}let Yn=!1;function Lr(){Yn||(Yn=!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 Zo(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,$o(n),Lr()}}function Qo(t,e){var n=t.__attributes??(t.__attributes={});n.value!==(n.value=e)&&(t.value=e)}function it(t,e,n,r){n=n==null?null:n+"";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[lo]=n),n===null?t.removeAttribute(e):t.setAttribute(e,n))}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 Mr(t,e,n,r=n){t.addEventListener(e,n);const o=t.__on_r;o?t.__on_r=()=>{o(),r()}:t.__on_r=r,Lr()}function ti(t,e,n=e){Mr(t,"input",()=>{n(zn(t)?Xn(t.value):t.value)}),he(()=>{var r=e();if(j&&t.defaultValue!==t.value){n(t.value);return}zn(t)&&r===Xn(t.value)||t.type==="date"&&!r&&!t.value||(t.value=r??"")})}const Je=new Set;function ei(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),Mr(n,"change",()=>{var f=n.__value;s&&(f=Un(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=De(f).includes(De(n.__value))):n.checked=Fo(n.__value,f)}),lr(()=>{var f=l.indexOf(n);f!==-1&&l.splice(f,1)}),Je.has(l)||(Je.add(l),It(()=>{l.sort((f,_)=>f.compareDocumentPosition(_)===4?-1:1),Je.delete(l)})),It(()=>{if(d){var f;if(s)f=Un(l,f,n.checked);else{var _=l.find(m=>m.checked);f=_==null?void 0:_.__value}o(f)}})}function Un(t,e,n){for(var r=new Set,o=0;o{var o,s;return he(()=>{o=s,s=[],Oo(()=>{t!==n(...s)&&(e(t,...s),o&&Kn(n(...o),t)&&e(null,...o))})}),()=>{It(()=>{s&&Kn(n(...s),t)&&e(null,...s)})}}),t}function He(t,e,n,r){var L;var o=(n&Qr)!==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&&_o(),s=_(),l&&l(s));var m;if(m=()=>{var S=t[e];return S===void 0?_():(h=!0,f=!1,S)},l){var k=t.$$legacy;return function(S,C){return arguments.length>0?((!C||k)&&l(C?m():S),S):m()}}var g=!1,b=gn(s),T=En(()=>{var S=m(),C=x(b);return g?(g=!1,C):b.v=S});return function(S,C){var $=x(T);if(arguments.length>0){const A=C?x(T):S;return T.equals(A)||(g=!0,B(b,A),f&&d!==void 0&&(d=A),x(T)),S}return $}}function ni(t){return new ri(t)}var bt,ot;class ri{constructor(e){Ue(this,bt);Ue(this,ot);var s;var n=new Map,r=(l,d)=>{var h=gn(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)}});ze(this,ot,(e.hydrate?Wo:Sr)(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(),ze(this,bt,o.$$events);for(const l of Object.keys(K(this,ot)))l==="$set"||l==="$destroy"||l==="$on"||Ce(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=()=>{Yo(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 jr;typeof HTMLElement=="function"&&(jr=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=oi(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=ni({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 ke(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 ke(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 oi(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 jr{constructor(){super(t,n,o),this.$$p_d=e}static get observedAttributes(){return ke(e).map(d=>(e[d].attribute||d).toLowerCase())}};return ke(e).forEach(d=>{Ce(l.prototype,d,{get(){return this.$$c&&d in this.$$c?this.$$c[d]:this.$$d[d]},set(h){var m;h=Ee(d,h,e),this.$$d[d]=h;var f=this.$$c;if(f){var _=(m=Rt(f,d))==null?void 0:m.get;_?f[d]=h:f.$set({[d]:h})}}})}),r.forEach(d=>{Ce(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"]]),ii=["SCRIPT","STYLE","NOSCRIPT","TEXTAREA","OPTION"];function Or(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 ii.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 k,g;for(;f[r[_].shift]&&!f[r[_].shift].trim();)r[_].shift++;let m=f[r[_].shift]===h;if(!m&&r[_].shift&&(r[_].shift=0,m=f[r[_].shift]===h),m&&(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&&(!((k=b.commonAncestorContainer.parentElement)!=null&&k.checkVisibility)||(g=b.commonAncestorContainer.parentElement)!=null&&g.checkVisibility())?o[_].push(b):b.detach(),m=!1}m||(r[_].shift=0,r[_].start=null,r[_].end=null)})}return o}const Ft=`rh-${new Date().getTime()}-`,Pe="highlights"in CSS;function si(t){if(!t.length&&!CSS.highlights.size)return;const e=[];if(CSS.highlights.clear(),t.length){const r=Or(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}) {
all: unset;
- background-color: color-mix(in srgb, ${Mt.get(l)||l||"yellow"}, white 60%) !important;
- color: color-mix(in srgb, ${Mt.get(l)||l||"yellow"}, black 80%) !important;
- ${v?"text-decoration: underline wavy; -webkit-text-decoration: underline wavy;":""}
+ 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;":""}
text-decoration-thickness: from-font;
}
/* fuck you dark reader */
- html[data-darkreader-scheme="dark"] ::highlight(${d}) {
+ html[data-darkreader-scheme="dark"] ::highlight(${h}) {
color: CanvasText !important;
}
:root {
--highlight-${s}-top: ${(100/document.documentElement.scrollHeight*(window.scrollY+f.top-10)).toFixed(2)}%;
}
- `);for(const _ of r[o])_.detach()}}const n=(()=>{let r=document.getElementById(Ht);return r||(r=document.createElement("style"),r.id=Ht,document.head.appendChild(r)),r})();n.innerHTML=e.join(`
-`)}function ii(){var t;(t=document.getElementById(Ht))==null||t.remove()}function si(t){var e;for(const[n,r]of CSS.highlights){const o=n.replace(Ht,"");if(t==o)for(const s of r){(e=s.startContainer.parentElement)==null||e.scrollIntoView({behavior:"smooth",block:"start"});break}}}function li(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(Ht,""),o])}if(e)return e[0].replace(Ht,"")}const kt=`rh-${new Date().getTime()}`;function ai(t){const e=document.body.querySelectorAll(`.${kt}`);if(!t.length&&!e.length)return;e.forEach(s=>s.outerHTML=s.innerText);const n=[],r=jr(t.map(({text:s})=>s||""));for(const s in t){const{_id:l,color:v}=t[s];for(const d of r[s]){const f=document.createElement("mark");f.className=kt,f.setAttribute("data-id",String(l)),f.append(d.extractContents()),d.insertNode(f),d.detach()}n.push(`
- .${kt}[data-id="${l}"] {
+ `);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 li(){var t;(t=document.getElementById(Ft))==null||t.remove()}function ai(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 ui(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 ci(t){const e=document.body.querySelectorAll(`.${Et}`);if(!t.length&&!e.length)return;e.forEach(s=>s.outerHTML=s.innerText);const n=[],r=Or(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}"] {
all: unset;
display: inline-block !important;
background-color: white !important;
- background-image: linear-gradient(to bottom, ${Gn(Mt.get(v)||v,.4)} 0, ${Gn(Mt.get(v)||v,.4)} 100%) !important;
+ background-image: linear-gradient(to bottom, ${Jn(Dt.get(d)||d,.4)} 0, ${Jn(Dt.get(d)||d,.4)} 100%) !important;
color: black !important;
}
- `)}const o=(()=>{let s=document.getElementById(kt);return s||(s=document.createElement("style"),s.id=kt,document.head.appendChild(s)),s})();o.innerHTML=n.join(`
-`)}function ui(){var t;document.body.querySelectorAll(`.${kt}`).forEach(e=>e.outerHTML=e.innerText),(t=document.getElementById(kt))==null||t.remove()}function ci(t){const e=document.body.querySelector(`.${kt}[data-id="${t}"]`);e&&e.scrollIntoView({behavior:"smooth",block:"start"})}function fi(t){const e=t.commonAncestorContainer.nodeType==Node.ELEMENT_NODE?t.commonAncestorContainer:t.commonAncestorContainer.parentElement;if((e==null?void 0:e.className)==kt){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 Gn(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 di(t){return Fe?oi(t):ai(t)}function Xe(t){return di(t)}function hi(){return Fe?ii():ui()}function Or(t){return Fe?si(t):ci(t)}function Rr(){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 le(){const t=document.getSelection();t!=null&&t.rangeCount&&t.removeAllRanges()}function vi(t){return Fe?li(t):fi(t)}function Zn(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 pi(t,e,n){let r=Ot(rt([])),o=Ot(!1),s=Ot(!1),l=Ot(void 0);function v(g){const k=vi(g);if(k)return T(r).find(A=>A._id==k);if(Zn(g).trim())return{text:Zn(g).trim()}}function d(g){const k={...typeof g._id=="string"?{_id:g._id}:{},...typeof g.text=="string"?{text:g.text}:{},...typeof g.note=="string"?{note:g.note}:{},color:g.color||"yellow"};if(!k.text)return;const $=T(r).findIndex(A=>{var C,N;return A._id==k._id||((C=A.text)==null?void 0:C.toLocaleLowerCase().trim())===((N=k.text)==null?void 0:N.toLocaleLowerCase().trim())});$!=-1?(T(r)[$]=k,e(k)):(T(r).push(k),t(k))}function f({_id:g}){I(r,rt(T(r).filter(k=>k._id!=g))),n({_id:g})}function _(g){I(l,rt(JSON.parse(JSON.stringify(g))))}function m(){T(l)&&(d(T(l)),I(l,void 0))}function b(){I(l,void 0)}return{get highlights(){return T(r)},set highlights(g){I(r,rt(g))},get pro(){return T(o)},set pro(g){I(o,rt(g))},get nav(){return T(s)},set nav(g){I(s,rt(g))},get draft(){return T(l)},find:v,upsert:d,remove:f,setDraft:_,draftSubmit:m,draftCancel:b}}const _i="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(_i);function mi(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 sn(){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 gi=wt(''),wi=wt(''),yi=wt('');const bi={hash:"svelte-f9ok5r",code:`
+ `)}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 fi(){var t;document.body.querySelectorAll(`.${Et}`).forEach(e=>e.outerHTML=e.innerText),(t=document.getElementById(Et))==null||t.remove()}function di(t){const e=document.body.querySelector(`.${Et}[data-id="${t}"]`);e&&e.scrollIntoView({behavior:"smooth",block:"start"})}function hi(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 Jn(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 vi(t){return Pe?si(t):ci(t)}function Ge(t){return vi(t)}function pi(){return Pe?li():fi()}function Rr(t){return Pe?ai(t):di(t)}function Fr(){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 _i(t){return Pe?ui(t):hi(t)}function Gn(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 mi(t,e,n){let r=jt(st([])),o=jt(!1),s=jt(!1),l=jt(void 0);function d(g){const b=_i(g);if(b)return x(r).find(L=>L._id==b);if(Gn(g).trim())return{text:Gn(g).trim()}}function h(g){const b={...typeof g._id=="string"?{_id:g._id}:{},...typeof g.text=="string"?{text:g.text}:{},...typeof g.note=="string"?{note:g.note}:{},color:g.color||"yellow"};if(!b.text)return;const T=x(r).findIndex(L=>{var S,C;return L._id==b._id||((S=L.text)==null?void 0:S.toLocaleLowerCase().trim())===((C=b.text)==null?void 0:C.toLocaleLowerCase().trim())});T!=-1?(x(r)[T]=b,e(b)):(x(r).push(b),t(b))}function f({_id:g}){B(r,st(x(r).filter(b=>b._id!=g))),n({_id:g})}function _(g){B(l,st(JSON.parse(JSON.stringify(g))))}function m(){x(l)&&(h(x(l)),B(l,void 0))}function k(){B(l,void 0)}return{get highlights(){return x(r)},set highlights(g){B(r,st(g))},get pro(){return x(o)},set pro(g){B(o,st(g))},get nav(){return x(s)},set nav(g){B(s,st(g))},get draft(){return x(l)},find:d,upsert:h,remove:f,setDraft:_,draftSubmit:m,draftCancel:k}}const gi="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(gi);function yi(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 un(){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 wi=gt(''),bi=gt(''),Ei=gt('');const ki={hash:"svelte-f9ok5r",code:`
.svelte-f9ok5r {
user-select: none;
-webkit-user-select: none;
@@ -189,7 +189,7 @@
opacity: 0;
}
}
-`};function Fr(t,e){pe(e,!0),Cn(t,bi,!0);let n=Oe(e,"store",7),r,o=Ot(void 0),s=Ot(!1);function l(D){if(!T(o))return;const M=D.currentTarget.returnValue;switch(D.currentTarget.returnValue="",M){case"add":n().upsert(T(o)),le();break;case"note":n().setDraft(T(o)),le();break;case"remove":n().remove(T(o)),le();break;default:if(Mt.has(M)){n().upsert({...T(o),color:M}),le();return}break}}function v(){I(s,!0)}function d(){I(s,!1),setTimeout(f)}function f(){if(T(s)){r==null||r.close();return}requestAnimationFrame(()=>{const D=Rr(),M=D&&n().find(D);if(!D||!(M!=null&&M._id)&&!D.toString().trim()){r==null||r.close();return}I(o,rt(M)),r.inert=!0,r==null||r.show(),r.inert=!1;const B=256,P=10,j=D.getBoundingClientRect(),U=Math.min(Math.max(j.x,P)+window.scrollX,window.innerWidth+window.scrollX-B-P),z=Math.min(window.innerWidth-Math.max(j.x,P)-window.scrollX-j.width,window.innerWidth-window.scrollX-B-P),lt=Math.max(j.y,40)+window.scrollY+j.height+4,xt=window.innerHeight-Math.max(j.y,40)-window.scrollY+4,yt=Ur=D,()=>r),pt(()=>ue(m,"mobile",sn()));var b=ot(m),g=ot(b);kn(g,17,()=>Mt,([D,M])=>D,(D,M)=>{let B=()=>T(M)[0],P=()=>T(M)[1];var j=gi(),U=ot(j);J(j),pt(()=>{var z;Go(j,B()),ut(U,"style",`--color: ${P()??""}`),ue(U,"active",B()==((z=T(o))==null?void 0:z.color))}),it(D,j)});var k=et(g,2),$=ot(k),A=ot($),C=ot(A),N=et(C),x=et(N),L=et(x);J(A),J($),J(k);var ft=et(k,2);return De(ft,()=>{var D;return(D=T(o))==null?void 0:D._id},D=>{var M=wi();it(D,M)}),J(b),J(m),pt(()=>{var D,M,B,P,j,U;ue(m,"new",!((D=T(o))!=null&&D._id)),ut(C,"fill",(M=T(o))!=null&&M.note?"currentColor":"none"),ut(C,"stroke-width",(B=T(o))!=null&&B.note?"0":void 0),ut(N,"fill",(P=T(o))!=null&&P.note?"none":"currentColor"),ut(x,"fill",(j=T(o))!=null&&j.note?"none":"currentColor"),ut(L,"fill",(U=T(o))!=null&&U.note?"none":"currentColor")}),vt("close",m,l),it(t,m),_e({get store(){return n()},set store(D){n(D),ne()}})}Re(Fr,{store:{}},[],[],!0);function Ei(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 ki=(t,e)=>I(e,!1),Ci=wt(''),$i=wt(''),xi=wt('
',1),Ti=wt('');const Ni={hash:"svelte-n7j6yt",code:`
+`};function Hr(t,e){pe(e,!0),Tn(t,ki);let n=He(e,"store",7),r,o=jt(void 0),s=jt(!1);function l(N){if(!x(o))return;const I=N.currentTarget.returnValue;switch(N.currentTarget.returnValue="",I){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(I)){n().upsert({...x(o),color:I}),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=Fr(),I=N&&n().find(N);if(!N||!(I!=null&&I._id)&&!N.toString().trim()){r==null||r.close();return}B(o,st(I)),r.inert=!0,r==null||r.show(),r.inert=!1;const P=256,F=10,O=N.getBoundingClientRect(),X=Math.min(Math.max(O.x,F)+window.scrollX,window.innerWidth+window.scrollX-P-F),U=Math.min(window.innerWidth-Math.max(O.x,F)-window.scrollX-O.width,window.innerWidth-window.scrollX-P-F),yt=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 k=En(un);vt(()=>le(m,"mobile",x(k)));var g=lt(m),b=lt(g);xn(b,17,()=>Dt,([N,I])=>N,(N,I)=>{let P=()=>x(I)[0],F=()=>x(I)[1];var O=wi(),X=lt(O);J(O),vt(()=>{var U;it(O,"aria-label",P()),Qo(O,P()),it(X,"style",`--color: ${F()??""}`),le(X,"active",P()==((U=x(o))==null?void 0:U.color))}),at(N,O)});var T=rt(b,2),L=lt(T),S=lt(L),C=lt(S),$=rt(C),A=rt($),xt=rt(A);J(S),J(L),J(T);var Z=rt(T,2);return Me(Z,()=>{var N;return(N=x(o))==null?void 0:N._id},N=>{var I=bi();at(N,I)}),J(g),J(m),vt(()=>{var N,I,P,F,O,X;le(m,"new",!((N=x(o))!=null&&N._id)),it(C,"fill",(I=x(o))!=null&&I.note?"currentColor":"none"),it(C,"stroke-width",(P=x(o))!=null&&P.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",m,l),at(t,m),_e({get store(){return n()},set store(N){n(N),Qt()}})}Ie(Hr,{store:{}},[],[],!0);function Ci(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 $i=(t,e)=>B(e,!1),xi=gt(''),Ti=gt(''),Ni=gt('
',1),Si=gt('');const Ai={hash:"svelte-n7j6yt",code:`
.svelte-n7j6yt {
box-sizing: border-box;
-webkit-tap-highlight-color: transparent;
@@ -432,7 +432,7 @@
to { opacity: 1; }
}
}
-`};function Hr(t,e){pe(e,!0),Cn(t,Ni,!0);const n=[];let r=Oe(e,"store",7),o,s,l=Ot(!0);Ke(()=>{r().draft?(I(l,!0),o==null||o.showModal()):o==null||o.close()});function v(C){const N=C.currentTarget.returnValue;C.currentTarget.returnValue="",setTimeout(N?r().draftSubmit:r().draftCancel,200)}function d(C){var N;sn()||(C.stopImmediatePropagation(),C.stopPropagation(),C.key=="Enter"&&!C.shiftKey&&(C.preventDefault(),s&&((N=C.currentTarget.closest("form"))==null||N.requestSubmit(s))))}var f=Ti();on(f,C=>o=C,()=>o),f.__mousedown=[Ei],pt(()=>ue(f,"mobile",sn()));var _=ot(f),m=ot(_);J(_);var b=et(_,2),g=ot(b);De(g,()=>r().draft,C=>{var N=xi(),x=bn(N);x.__click=[ki,l];var L=ot(x);pt(()=>{var B,P;return Ye(L,((P=(B=r().draft)==null?void 0:B.text)==null?void 0:P.trim())||"")}),J(x);var ft=et(x,2);kn(ft,21,()=>Mt,Wo,(B,P)=>{let j=()=>T(P)[0],U=()=>T(P)[1];var z=Ci();Jo(z);var lt;pt(()=>{lt!==(lt=j())&&(z.value=(z.__value=j())==null?"":j()),ut(z,"style",`--color: ${U()??""}`)}),Qo(n,[],z,()=>(j(),r().draft.color),xt=>r().draft.color=xt),it(B,z)}),J(ft);var D=et(ft,2);Ko(D),Xo(D),D.__keydown=d;var M=et(D,2);De(M,()=>!r().pro,B=>{var P=$i();it(B,P)}),pt(()=>{ue(x,"compact",T(l)),D.disabled=!r().pro}),Zo(D,()=>r().draft.note,B=>r().draft.note=B),it(C,N)});var k=et(g,2),$=et(ot(k),2);on($,C=>s=C,()=>s);var A=ot($);return Ro(),J($),J(k),J(b),J(f),pt(()=>{var C,N;Ye(m,`${((C=r().draft)!=null&&C._id?"Edit":"New")??""} highlight`),Ye(A,`${((N=r().draft)!=null&&N._id?"Update":"Create")??""} `)}),vt("close",f,v),it(t,f),_e({get store(){return r()},set store(C){r(C),ne()}})}Tr(["mousedown","click","keydown"]);Re(Hr,{store:{}},[],[],!0);const Si=t=>{const e=t.target.getAttribute("data-highlight");e&&(t.preventDefault(),Or(e))};var Ai=wt(''),Di=wt('');const Li={hash:"svelte-rwfy02",code:`
+`};function Ir(t,e){pe(e,!0),Tn(t,Ai);const n=[];let r=He(e,"store",7),o,s,l=jt(!0);Ze(()=>{r().draft?(B(l,!0),o==null||o.showModal()):o==null||o.close()});function d(C){const $=C.currentTarget.returnValue;C.currentTarget.returnValue="",setTimeout($?r().draftSubmit:r().draftCancel,200)}function h(C){var $;un()||(C.stopImmediatePropagation(),C.stopPropagation(),C.key=="Enter"&&!C.shiftKey&&(C.preventDefault(),s&&(($=C.currentTarget.closest("form"))==null||$.requestSubmit(s))))}var f=Si();an(f,C=>o=C,()=>o),f.__mousedown=[Ci];const _=En(un);vt(()=>le(f,"mobile",x(_)));var m=lt(f),k=lt(m);J(m);var g=rt(m,2),b=lt(g);Me(b,()=>r().draft,C=>{var $=Ni(),A=Cn($);A.__click=[$i,l];var xt=lt(A);vt(()=>{var P,F;return Xe(xt,((F=(P=r().draft)==null?void 0:P.text)==null?void 0:F.trim())||"")}),J(A);var Z=rt(A,2);xn(Z,21,()=>Dt,Uo,(P,F)=>{let O=()=>x(F)[0],X=()=>x(F)[1];var U=xi();Zo(U);var yt;vt(()=>{yt!==(yt=O())&&(U.value=(U.__value=O())==null?"":O()),it(U,"style",`--color: ${X()??""}`)}),ei(n,[],U,()=>(O(),r().draft.color),ut=>r().draft.color=ut),at(P,U)}),J(Z);var N=rt(Z,2);Go(N),Jo(N),N.__keydown=h;var I=rt(N,2);Me(I,()=>!r().pro,P=>{var F=Ti();at(P,F)}),vt(()=>{le(A,"compact",x(l)),N.disabled=!r().pro}),ti(N,()=>r().draft.note,P=>r().draft.note=P),at(C,$)});var T=rt(b,2),L=rt(lt(T),2);an(L,C=>s=C,()=>s);var S=lt(L);return Ho(),J(L),J(T),J(g),J(f),vt(()=>{var C,$;Xe(k,`${((C=r().draft)!=null&&C._id?"Edit":"New")??""} highlight`),Xe(S,`${(($=r().draft)!=null&&$._id?"Update":"Create")??""} `)}),ht("close",f,d),at(t,f),_e({get store(){return r()},set store(C){r(C),Qt()}})}Nr(["mousedown","click","keydown"]);Ie(Ir,{store:{}},[],[],!0);const Di=t=>{const e=t.target.getAttribute("data-highlight");e&&(t.preventDefault(),Rr(e))};var Li=gt(''),Mi=gt('');const ji={hash:"svelte-rwfy02",code:`
nav.svelte-rwfy02 {
all: unset;
}
@@ -463,4 +463,4 @@
div.svelte-rwfy02:hover::before {
width: 100%;
}
-`};function Pr(t,e){pe(e,!0),Cn(t,Li,!0);let n=Oe(e,"store",7);var r=Po(),o=bn(r);return De(o,()=>n().nav,s=>{var l=Di();l.__click=[Si],kn(l,21,()=>n().highlights,v=>v._id,(v,d)=>{var f=Ai();pt(()=>ut(f,"style",`top: var(--highlight-${T(d)._id??""}-top); --color: ${(Mt.get(T(d).color)||T(d).color)??""}`)),pt(()=>ut(f,"data-highlight",T(d)._id)),it(v,f)}),J(l),it(s,l)}),it(t,r),_e({get store(){return n()},set store(s){n(s),ne()}})}Tr(["click"]);Re(Pr,{store:{}},[],[],!0);var Mi=wt(" ",1);function ji(t,e){pe(e,!0);let n=Oe(e,"store",7);Ke(()=>{Xe(n().highlights)});let r;function o(){Xe(n().highlights),clearTimeout(r),r=setTimeout(()=>Xe(n().highlights),3e3)}lr(()=>{document.readyState&&o()}),Ke(()=>hi);var s=Mi();vt("load",Ae,o),vt("popstate",Ae,o);var l=bn(s);Fr(l,{get store(){return n()}});var v=et(l,2);Hr(v,{get store(){return n()}});var d=et(v,2);return Pr(d,{get store(){return n()}}),it(t,s),_e({get store(){return n()},set store(f){n(f),ne()}})}customElements.define("rdh-ui",Re(ji,{store:{}},[],[],!0));function Oi(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 Ri(t){let e=!1;const n=new Set,r=Oi(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 ie=document.createElement("rdh-ui");(async()=>{const t=await Ri(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(ie)||document.body.appendChild(ie):document.body.contains(ie)&&document.body.removeChild(ie));break;case"RDH_SCROLL":typeof n.payload._id=="string"&&Or(n.payload._id);break;case"RDH_ADD_SELECTION":const r=Rr();if(!r)return;const o=e.find(r);if(!o)return;e.upsert(o),le();break;case"RDH_NOTE_SELECTION":console.log("not implemented yet");break}}),e=pi(n=>t({type:"RDH_ADD",payload:n}),n=>t({type:"RDH_UPDATE",payload:n}),({_id:n})=>t({type:"RDH_REMOVE",payload:{_id:n}}));ie.store=e,t({type:"RDH_READY",payload:{url:location.href}})})();
+`};function Pr(t,e){pe(e,!0),Tn(t,ji);let n=He(e,"store",7);var r=qo(),o=Cn(r);return Me(o,()=>n().nav,s=>{var l=Mi();l.__click=[Di],xn(l,21,()=>n().highlights,d=>d._id,(d,h)=>{var f=Li();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()}})}Nr(["click"]);Ie(Pr,{store:{}},[],[],!0);var Oi=gt(" ",1);function Ri(t,e){pe(e,!0);let n=He(e,"store",7);Ze(()=>{Ge(n().highlights)});let r;function o(){Ge(n().highlights),clearTimeout(r),r=setTimeout(()=>Ge(n().highlights),3e3)}yn(()=>{document.readyState&&o()}),Ze(()=>pi);var s=Oi();ht("load",Le,o),ht("popstate",Le,o);var l=Cn(s);Hr(l,{get store(){return n()}});var d=rt(l,2);Ir(d,{get store(){return n()}});var h=rt(d,2);return Pr(h,{get store(){return n()}}),at(t,s),_e({get store(){return n()},set store(f){n(f),Qt()}})}customElements.define("rdh-ui",Ie(Ri,{store:{}},[],[],!0));function Fi(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 Hi(t){let e=!1;const n=new Set,r=Fi(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 Hi(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"&&Rr(n.payload._id);break;case"RDH_ADD_SELECTION":const r=Fr();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=mi(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}})})();