diff --git a/build/xcode/Save to Raindrop.io/App/Info.plist b/build/xcode/Save to Raindrop.io/App/Info.plist index d3833242..ce81dc8a 100644 --- a/build/xcode/Save to Raindrop.io/App/Info.plist +++ b/build/xcode/Save to Raindrop.io/App/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 5.6.35 + 5.6.37 CFBundleURLTypes @@ -32,7 +32,7 @@ CFBundleVersion - 346 + 347 LSApplicationCategoryType public.app-category.productivity LSMinimumSystemVersion diff --git a/build/xcode/Save to Raindrop.io/Extension/Info.plist b/build/xcode/Save to Raindrop.io/Extension/Info.plist index ffaa7e59..4eb7c0b7 100644 --- a/build/xcode/Save to Raindrop.io/Extension/Info.plist +++ b/build/xcode/Save to Raindrop.io/Extension/Info.plist @@ -17,9 +17,9 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 5.6.35 + 5.6.37 CFBundleVersion - 346 + 347 LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) NSExtension diff --git a/build/xcode/Save to Raindrop.io/Save to Raindrop.io.xcodeproj/project.pbxproj b/build/xcode/Save to Raindrop.io/Save to Raindrop.io.xcodeproj/project.pbxproj index cea1ec5e..2064cefe 100644 --- a/build/xcode/Save to Raindrop.io/Save to Raindrop.io.xcodeproj/project.pbxproj +++ b/build/xcode/Save to Raindrop.io/Save to Raindrop.io.xcodeproj/project.pbxproj @@ -441,7 +441,7 @@ CODE_SIGN_ENTITLEMENTS = Extension/Extension.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 346; + CURRENT_PROJECT_VERSION = 347; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = 7459JWM5TY; ENABLE_HARDENED_RUNTIME = YES; @@ -452,7 +452,7 @@ "@executable_path/../../../../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)"; - MARKETING_VERSION = 5.6.35; + MARKETING_VERSION = 5.6.37; PRODUCT_BUNDLE_IDENTIFIER = io.raindrop.safari.extension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -467,7 +467,7 @@ CODE_SIGN_ENTITLEMENTS = Extension/Extension.entitlements; CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; - CURRENT_PROJECT_VERSION = 346; + CURRENT_PROJECT_VERSION = 347; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = 7459JWM5TY; ENABLE_HARDENED_RUNTIME = YES; @@ -478,7 +478,7 @@ "@executable_path/../../../../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)"; - MARKETING_VERSION = 5.6.35; + MARKETING_VERSION = 5.6.37; PRODUCT_BUNDLE_IDENTIFIER = io.raindrop.safari.extension; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; @@ -497,7 +497,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 346; + CURRENT_PROJECT_VERSION = 347; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = 7459JWM5TY; ENABLE_HARDENED_RUNTIME = YES; @@ -508,7 +508,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)"; - MARKETING_VERSION = 5.6.35; + MARKETING_VERSION = 5.6.37; PRODUCT_BUNDLE_IDENTIFIER = io.raindrop.safari; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; @@ -525,7 +525,7 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; - CURRENT_PROJECT_VERSION = 346; + CURRENT_PROJECT_VERSION = 347; DEAD_CODE_STRIPPING = YES; DEVELOPMENT_TEAM = 7459JWM5TY; ENABLE_HARDENED_RUNTIME = YES; @@ -536,7 +536,7 @@ "@executable_path/../Frameworks", ); MACOSX_DEPLOYMENT_TARGET = "$(RECOMMENDED_MACOSX_DEPLOYMENT_TARGET)"; - MARKETING_VERSION = 5.6.35; + MARKETING_VERSION = 5.6.37; PRODUCT_BUNDLE_IDENTIFIER = io.raindrop.safari; PRODUCT_NAME = "$(TARGET_NAME)"; SWIFT_VERSION = 5.0; diff --git a/build/xcode/Save to Raindrop.io/Save to Raindrop.io.xcodeproj/project.xcworkspace/xcuserdata/exentrich.xcuserdatad/UserInterfaceState.xcuserstate b/build/xcode/Save to Raindrop.io/Save to Raindrop.io.xcodeproj/project.xcworkspace/xcuserdata/exentrich.xcuserdatad/UserInterfaceState.xcuserstate index d9c2a0d3..cdeb872a 100644 Binary files a/build/xcode/Save to Raindrop.io/Save to Raindrop.io.xcodeproj/project.xcworkspace/xcuserdata/exentrich.xcuserdatad/UserInterfaceState.xcuserstate and b/build/xcode/Save to Raindrop.io/Save to Raindrop.io.xcodeproj/project.xcworkspace/xcuserdata/exentrich.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/src/target/extension/background/contextMenus.js b/src/target/extension/background/contextMenus.js index 284abce9..659382f7 100644 --- a/src/target/extension/background/contextMenus.js +++ b/src/target/extension/background/contextMenus.js @@ -92,17 +92,19 @@ async function init() { contexts: ['action'] }), - browser.contextMenus.create({ - id: 'save_tabs', - title: browser.i18n.getMessage('saveTabs'), - contexts: ['action'] - }), + ...(!environment.includes('safari') ? [ + browser.contextMenus.create({ + id: 'save_tabs', + title: browser.i18n.getMessage('saveTabs'), + contexts: ['action'] + }), - browser.contextMenus.create({ - id: 'settings', - title: browser.i18n.getMessage('settings'), - contexts: ['action'] - }) + browser.contextMenus.create({ + id: 'settings', + title: browser.i18n.getMessage('settings'), + contexts: ['action'] + }) + ] : []) ]) } diff --git a/src/target/extension/background/highlights/highlight.js b/src/target/extension/background/highlights/highlight.js index 837fb86c..ccffe186 100644 --- a/src/target/extension/background/highlights/highlight.js +++ b/src/target/extension/background/highlights/highlight.js @@ -1,22 +1,22 @@ -"use strict";var Jr=Object.defineProperty;var On=t=>{throw TypeError(t)};var Zr=(t,e,n)=>e in t?Jr(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),Ln=(t,e,n)=>e.has(t)||On("Cannot "+n);var tt=(t,e,n)=>(Ln(t,e,"read from private field"),n?n.call(t):e.get(t)),We=(t,e,n)=>e.has(t)?On("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ue=(t,e,n,r)=>(Ln(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,c=window.DocumentFragment.prototype.append,v=window.Node.prototype.cloneNode,f=window.Node.prototype.appendChild,h=window.Node.prototype.insertBefore,m=window.Node.prototype.removeChild,_=window.Node.prototype.replaceChild,E=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),y=window.Element.prototype.attachShadow,C=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),S=window.Element.prototype.getAttribute,z=window.Element.prototype.setAttribute,O=window.Element.prototype.removeAttribute,T=window.Element.prototype.toggleAttribute,x=window.Element.prototype.getAttributeNS,A=window.Element.prototype.setAttributeNS,K=window.Element.prototype.removeAttributeNS,k=window.Element.prototype.insertAdjacentElement,$=window.Element.prototype.insertAdjacentHTML,L=window.Element.prototype.prepend,j=window.Element.prototype.append,F=window.Element.prototype.before,V=window.Element.prototype.after,J=window.Element.prototype.replaceWith,ut=window.Element.prototype.remove,B=window.HTMLElement,ot=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),St=window.HTMLElement.prototype.insertAdjacentElement,Zt=window.HTMLElement.prototype.insertAdjacentHTML,Qt=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 Qt.add(i)});function Cn(i){var l=Qt.has(i);return i=/^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(i),!l&&i}var Br=document.contains?document.contains.bind(document):document.documentElement.contains.bind(document.documentElement);function H(i){var l=i.isConnected;if(l!==void 0)return l;if(Br(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 l=i.children;if(l)return Array.prototype.slice.call(l);for(l=[],i=i.firstChild;i;i=i.nextSibling)i.nodeType===Node.ELEMENT_NODE&&l.push(i);return l}function Pe(i,l){for(;l&&l!==i&&!l.nextSibling;)l=l.parentNode;return l&&l!==i?l.nextSibling:null}function qe(i,l,u){for(var p=i;p;){if(p.nodeType===Node.ELEMENT_NODE){var a=p;l(a);var d=a.localName;if(d==="link"&&a.getAttribute("rel")==="import"){if(p=a.import,u===void 0&&(u=new Set),p instanceof Node&&!u.has(p))for(u.add(p),p=p.firstChild;p;p=p.nextSibling)qe(p,l,u);p=Pe(i,a);continue}else if(d==="template"){p=Pe(i,a);continue}if(a=a.__CE_shadowRoot)for(a=a.firstChild;a;a=a.nextSibling)qe(a,l,u)}p=p.firstChild?p.firstChild:Pe(i,p)}}function ge(){var i=!(vt==null||!vt.noDocumentConstructionObserver),l=!(vt==null||!vt.shadyDomFastWalk);this.m=[],this.g=[],this.j=!1,this.shadyDomFastWalk=l,this.I=!i}function te(i,l,u,p){var a=window.ShadyDOM;if(i.shadyDomFastWalk&&a&&a.inUse){if(l.nodeType===Node.ELEMENT_NODE&&u(l),l.querySelectorAll)for(i=a.nativeMethods.querySelectorAll.call(l,"*"),l=0;lr[e]),s=o.s.get(e)),s!==void 0&&P(s,st(n,o.i,o));const c=o.a,v=!(e in t);if(c&&e==="length")for(let f=n;f"u"?t=>setTimeout(t,1):requestIdleCallback;let Te=!1,$e=!1,tn=[],en=[];function sr(){Te=!1;const t=tn.slice();tn=[],ir(t)}function lr(){$e=!1;const t=en.slice();en=[],ir(t)}function ce(t){Te||(Te=!0,queueMicrotask(sr)),tn.push(t)}function $o(t){$e||($e=!0,To(lr)),en.push(t)}function So(){Te&&sr(),$e&&lr()}function zo(t){let e=Ot|bt;M===null&&(e|=$t);const n={deps:null,deriveds:null,equals:or,f:e,first:null,fn:t,last:null,reactions:null,v:null,version:0};if(Z!==null&&Z.f&Ot){var r=Z;r.deriveds===null?r.deriveds=[n]:r.deriveds.push(n)}return n}function ar(t){vn(t);var e=t.deriveds;if(e!==null){t.deriveds=null;for(var n=0;nt.version)return t.version=_,!v;!qt&&!((E=m==null?void 0:m.reactions)!=null&&E.includes(t))&&(f=m.reactions,f===null?m.reactions=[t]:f.push(t))}else{if(t.f&bt)return!0;o&&(_>t.version&&(t.version=_,n=!0),f=m.reactions,f===null?m.reactions=[t]:f.includes(t)||f.push(t))}}r||at(t,dt),o&&(t.f^=Ce)}return n}function Oo(t,e,n){throw t}function fr(t){const e=W,n=Y,r=Tt,o=Z,s=qt,c=_t;W=null,Y=0,Tt=null,Z=t,qt=!Bt&&(t.f&$t)!==0,_t=!1;try{let v=(0,t.fn)(),f=t.deps;if(W!==null){let h;if(f!==null){const m=f.length,_=Y===0?W:f.slice(0,Y).concat(W),y=_.length>16&&m-Y>1?new Set(_):null;for(h=Y;h0)for(f.length=Y+W.length,h=0;h1e3&&(Yt=0,bo()),Yt++}function pr(t){var e=t.length;if(e!==0){hr();var n=Bt;Bt=!0;try{for(var r=0;r1001)return;const t=Nt;Nt=[],pr(t),le||(Yt=0)}function je(t){ye===cr&&(le||(le=!0,queueMicrotask(Lo)));for(var e=t;e.parent!==null;){e=e.parent;var n=e.f;if(n&yt){if(!(n&dt))return;at(e,Lt)}}Nt.push(e)}function vr(t,e){var n=t.first,r=[];t:for(;n!==null;){var o=n.f,s=(o&(Gt|jt))===0,c=o&yt,v=(o&dt)!==0,f=n.first;if(s&&(!c||!v)){if(c&&at(n,dt),o&Xt){if(!c&&fe(n)&&(Le(n),f=n.first),f!==null){n=f;continue}}else if(o&nr)if(c||v){if(f!==null){n=f;continue}}else r.push(n)}var h=n.next;if(h===null){let E=n.parent;for(;E!==null;){if(t===E)break t;var m=E.next;if(m!==null){n=m;continue t}E=E.parent}}n=h}for(var _=0;_0||s.length>0)&&Rt(),Yt=0,o}finally{ye=n,Nt=r}}function D(t){const e=t.f;if(e&Gt)return t.v;if(Z!==null&&!(Z.f&(yt|dn))&&!_t){const n=(Z.f&$t)!==0,r=Z.deps;W===null&&r!==null&&r[Y]===t&&!(n&&M!==null)?Y++:(r===null||Y===0||r[Y-1]!==t)&&(W===null?W=[t]:W[W.length-1]!==t&&W.push(t)),Tt!==null&&M!==null&&M.f&dt&&!(M.f&yt)&&Tt.includes(t)&&(at(M,bt),je(M))}return e&Ot&&fe(t)&&ur(t,!1),t.v}function gn(t,e,n){var r=t.reactions;if(r!==null)for(var o=nn(),s=r.length,c=0;c{ve(e)}}function _n(t){return Kt(nr,t,!1)}function pe(t){return Kt(Xt,t,!0)}function mt(t){return pe(t)}function _r(t,e=0){return Kt(Xt|rr|e,t,!0)}function ae(t){return Kt(Xt|yt,t,!0)}function yr(t){var e=t.teardown;if(e!==null){const n=pn,r=_t;In(!0),Fn(!0);try{e.call(null)}finally{In(n),Fn(r)}}}function ve(t,e=!0){var n=t.dom;if(n!==null&&e&&mn(n),vn(t,e),Oe(t,0),at(t,Gt),t.transitions)for(const o of t.transitions)o.stop();yr(t);var r=t.parent;r!==null&&t.f&yt&&r.first!==null&&br(t),t.next=t.prev=t.teardown=t.ctx=t.dom=t.deps=t.parent=t.fn=null}function br(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 on(t,e){var n=[];yn(t,n,!0),wr(n,()=>{ve(t),e&&e()})}function wr(t,e){var n=t.length;if(n>0){var r=()=>--n||e();for(var o of t)o.out(r)}else e()}function yn(t,e,n){if(!(t.f&jt)){if(t.f^=jt,t.transitions!==null)for(const c of t.transitions)(c.is_global||n)&&e.push(c);for(var r=t.first;r!==null;){var o=r.next,s=(r.f&hn)!==0||(r.f&yt)!==0;yn(r,e,s?n:!1),r=o}}}function Se(t){Er(t,!0)}function Er(t,e){if(t.f&jt){t.f^=jt,fe(t)&&Le(t);for(var n=t.first;n!==null;){var r=n.next,o=(n.f&hn)!==0||(n.f&yt)!==0;Er(n,o?e:!1),n=r}if(t.transitions!==null)for(const s of t.transitions)(s.is_global||e)&&s.in()}}var ze,zt;function Cr(){if(ze===void 0){ze=window,zt=document;var t=Element.prototype;t.__click=void 0,t.__className="",t.__attributes=null,t.__e=void 0,Text.prototype.__t=void 0}}function Jt(){return document.createTextNode("")}function lt(t){const e=t.firstChild;return G?e===null?t.appendChild(Jt()):Wt(e):e}function Me(t,e){return G?Wt(Dt):t.firstChild}function I(t,e=!1){var n=t.nextSibling;if(!G)return n;var r=n.nodeType;if(r===8&&n.data===oo)return I(n,e);if(e&&r!==3){var o=Jt(),s=M.dom;return s.unshift(o),n==null||n.before(o),o}return Wt(n)}function bn(t){t.textContent=""}function Ho(t){return document.createElement(t)}function Po(t,e,n,r){function o(s){if(r.capture||sn(e,s),!s.cancelBubble)return n.call(this,s)}return t.startsWith("pointer")||t==="wheel"?ce(()=>{e.addEventListener(t,o,r)}):e.addEventListener(t,o,r),o}function gt(t,e,n,r,o){var s={capture:r,passive:o},c=Po(t,e,n,s);(e===document.body||e===window||e===document)&&mr(()=>{e.removeEventListener(t,c,s)})}function kr(t){for(var e=0;e{throw O});throw m}}finally{e.__root=t,s=t}}}const xr=new Set,ln=new Set;function Ve(t,e){(t.__t??(t.__t=t.nodeValue))!==e&&(t.nodeValue=t.__t=e)}function Tr(t,e){const n=e.anchor??e.target.appendChild(Jt());return Rt(()=>$r(t,{...e,anchor:n}),!1)}function qo(t,e){const n=e.target,r=Mt;try{return Rt(()=>{kt(!0);for(var o=n.firstChild;o&&(o.nodeType!==8||o.data!==we);)o=o.nextSibling;if(!o)throw Ze;const s=Wt(o),c=$r(t,{...e,anchor:s});return kt(!1),c},!1)}catch(o){if(o===Ze)return e.recover===!1&&wo(),Cr(),bn(n),kt(!1),Tr(t,e);throw o}finally{kt(!!r),so(r)}}function $r(t,{target:e,anchor:n,props:r={},events:o,context:s,intro:c=!1}){Cr();const v=new Set,f=sn.bind(null,e),h=sn.bind(null,document),m=y=>{for(let C=0;C(ae(()=>{if(s){de({});var y=U;y.c=s}o&&(r.$$events=o),_=t(n,r)||{},s&&he()}),()=>{for(const y of v)e.removeEventListener(y,f);ln.delete(m),an.delete(_)}));return an.set(_,E),_}let an=new WeakMap;function Bo(t){const e=an.get(t);e==null||e()}async function wn(t,e,n){await Promise.resolve();const r=Yo(t);if(!r.getElementById(e)){const o=Ho("style");o.id=e,o.textContent=n,(r.head||r).appendChild(o)}}function Yo(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function ue(t,e,n,r=null,o=!1){var s=null,c=null,v=null,f=o?hn:0;_r(()=>{if(v===(v=!!e()))return;let h=!1;if(G){const m=t.data===tr;v===m&&(mn(Mt),kt(!1),h=!0)}v?(s?Se(s):s=ae(()=>n(t)),c&&on(c,()=>{c=null})):(c?Se(c):r&&(c=ae(()=>r(t))),s&&on(s,()=>{s=null})),h&&kt(!0)},f)}let Xe=null;function Wo(t,e){return e}function Uo(t,e,n){for(var r=[],o=t.length,s=0;s0&&r.length===0&&e!==null;if(c){var v=e.parentNode;bn(v),v.append(e),n.clear(),xt(t[0].prev,t[o-1].next)}wr(r,()=>{for(var f=0;f{var m=n(),_=Ut(m)?m:m==null?[]:Array.from(m),E=_.length,y=c.flags;y&Je&&!er(_)&&!(X in _)&&(y^=Je,y&Qr&&!(y&ie)&&(y^=ie));let C=!1;if(G){var S=t.data===tr;S!==(E===0)&&(mn(Mt),kt(!1),C=!0)}if(G){for(var z=Dt,O=c,T,x=0;x0)for(;z!==t;){var $=z.nextSibling;z.remove(),z=$}}G||Vo(_,c,t,o,y,r),s!==null&&(E===0?h?Se(h):h=ae(()=>s(t)):h!==null&&on(h,()=>{h=null})),C&&kt(!0)})}function Vo(t,e,n,r,o,s){var B,ot,St,Zt;var c=(o&to)!==0,v=(o&(ie|fn))!==0,f=t.length,h=e.items,m=e.next,_=m,E=new Set,y=e,C=new Set,S=[],z=[],O,T,x,A;if(c)for(A=0;A0){var ut=o&Zn&&f===0?n:null;if(c){for(A=0;A{var Qt;for(x of C)(Qt=x.a)==null||Qt.apply()})}function Xo(t,e,n,r){r&ie&&P(t.v,e),r&fn?P(t.i,n):t.i=n}function Sr(t,e,n,r,o,s,c,v,f){var h=Xe;try{var m=(f&ie)!==0,_=(f&Je)===0,E=m?_?ke(o):nt(o):o,y=f&fn?nt(c):c,C={i:y,v:E,k:s,a:null,e:null,o:t,prev:n,next:r};return n.next=C,r!==null&&(r.prev=C),Xe=C,C.e=ae(()=>v(e,E,y)),C}finally{Xe=h}}function qn(t,e,n){for(var r=t.next?t.next.o:n,o=e?e.o:n,s=t.o;s!==r;){var c=s.nextSibling;o.before(s),s=c}}function xt(t,e){t.next=e,e!==null&&(e.prev=t)}function Ne(t,e=M){var n=e.dom;return n===null?e.dom=t:(Ut(n)||(n=e.dom=[n]),Ut(t)?n.push(...t):n.push(t)),t}function ht(t,e){var n=(e&no)!==0,r=(e&ro)!==0,o;return()=>{if(G)return Ne(n?Mt:Dt),Dt;o||(o=Ro(t),n||(o=o.firstChild));var s=r?document.importNode(o,!0):o.cloneNode(!0);return Ne(n?[...s.childNodes]:s),s}}function zr(){if(G)return Ne(Mt),Dt;var t=document.createDocumentFragment(),e=Jt();return t.append(e),Ne([e]),t}function et(t,e){G||t.before(e)}function Go(t,e){{const n=document.body;t.autofocus=!0,ce(()=>{document.activeElement===n&&t.focus()})}}function Ko(t){G&&t.firstChild!==null&&bn(t)}let Bn=!1;function Nr(){Bn||(Bn=!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(G){let e=!1;const n=()=>{if(e)return;e=!0;const r=t.getAttribute("value");ft(t,"value",null),ft(t,"checked",null),r&&(t.value=r)};t.__on_r=n,$o(n),Nr()}}function Zo(t,e){var n=t.__attributes??(t.__attributes={});n.value!==(n.value=e)&&(t.value=e)}function ft(t,e,n){n=n==null?null:n+"";var r=t.__attributes??(t.__attributes={});G&&(r[e]=t.getAttribute(e),e==="src"||e==="href"||e==="srcset")||r[e]!==(r[e]=n)&&(e==="loading"&&(t[po]=n),n===null?t.removeAttribute(e):t.setAttribute(e,n))}function oe(t,e,n){n?t.classList.add(e):t.classList.remove(e)}function Ar(t,e,n,r=n){t.addEventListener(e,n);const o=t.__on_r;o?t.__on_r=()=>{o(),r()}:t.__on_r=r,Nr()}function Qo(t,e,n){Ar(t,"input",()=>{n(Wn(t)?Un(t.value):t.value)}),pe(()=>{var r=e();if(G&&t.defaultValue!==t.value){n(t.value);return}Wn(t)&&r===Un(t.value)||t.type==="date"&&!r&&!t.value||(t.value=r??"")})}function ti(t,e,n,r,o){var s=n.getAttribute("type")==="checkbox",c=t;let v=!1;if(e!==null)for(var f of e){var h=c;c=h[f],c===void 0&&(c=h[f]=[])}c.push(n),Ar(n,"change",()=>{var m=n.__value;s&&(m=Yn(c,m,n.checked)),o(m)},()=>o(s?[]:null)),pe(()=>{var m=r();if(G&&n.defaultChecked!==n.checked){v=!0;return}s?(m=m||[],n.checked=xe(m).includes(xe(n.__value))):n.checked=xo(n.__value,m)}),mr(()=>{var m=c.indexOf(n);m!==-1&&c.splice(m,1)}),ce(()=>{if(c.sort((E,y)=>E.compareDocumentPosition(y)===4?-1:1),v){var m;if(s)m=Yn(c,m,n.checked);else{var _=c.find(E=>E.checked);m=_==null?void 0:_.__value}o(m)}})}function Yn(t,e,n){for(var r=new Set,o=0;o{var o,s;return pe(()=>{o=s,s=[],gr(()=>{t!==n(...s)&&(e(t,...s),o&&Vn(n(...o),t)&&e(null,...o))})}),()=>{ce(()=>{s&&Vn(n(...s),t)&&e(null,...s)})}})}function Re(t,e,n,r){var y;var o=(n&eo)!==0,s=t[e],c=(y=Qe(t,e))==null?void 0:y.set,v=r,f=()=>v;s===void 0&&r!==void 0&&(c&&o&&Eo(),s=f(),c&&c(s));var h;if(h=()=>{var C=t[e];return C===void 0?f():C},c)return function(C){return arguments.length===1?(c(C),C):h()};var m=!1,_=ke(s),E=zo(()=>{var C=h(),S=D(_);return m?(m=!1,S):_.v=C});return function(C){var S=D(E);return arguments.length>0?(E.equals(C)||(m=!0,P(_,C),D(E),E.version++),C):S}}function ei(t){return new ni(t)}var Et,it;class ni{constructor(e){We(this,Et);We(this,it);const n=st({...e.props||{},$$events:{}},!1);Ue(this,it,(e.hydrate?qo:Tr)(e.component,{target:e.target,props:n,context:e.context,intro:e.intro,recover:e.recover})),Ue(this,Et,n.$$events);for(const r of Object.keys(tt(this,it)))r==="$set"||r==="$destroy"||r==="$on"||se(this,r,{get(){return tt(this,it)[r]},set(o){tt(this,it)[r]=o},enumerable:!0});tt(this,it).$set=r=>{Object.assign(n,r)},tt(this,it).$destroy=()=>{Bo(tt(this,it))}}$set(e){tt(this,it).$set(e)}$on(e,n){tt(this,Et)[e]=tt(this,Et)[e]||[];const r=(...o)=>n.call(this,...o);return tt(this,Et)[e].push(r),()=>{tt(this,Et)[e]=tt(this,Et)[e].filter(o=>o!==r)}}$destroy(){tt(this,it).$destroy()}}Et=new WeakMap,it=new WeakMap;let Dr;typeof HTMLElement=="function"&&(Dr=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 c=document.createElement("slot");o!=="default"&&(c.name=o),et(s,c)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=ri(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]=be(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=ei({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=pe(()=>{var o;this.$$r=!0;for(const s of Ee(this.$$c)){if(!((o=this.$$p_d[s])!=null&&o.reflect))continue;this.$$d[s]=this.$$c[s];const c=be(s,this.$$d[s],this.$$p_d,"toAttribute");c==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,c)}this.$$r=!1});for(const o in this.$$l)for(const s of this.$$l[o]){const c=this.$$c.$on(o,s);this.$$l_u.set(s,c)}this.$$l={}}}attributeChangedCallback(e,n,r){var o;this.$$r||(e=this.$$g_p(e),this.$$d[e]=be(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(),ve(this.$$me),this.$$c=void 0)})}$$g_p(e){return Ee(this.$$p_d).find(n=>this.$$p_d[n].attribute===e||!this.$$p_d[n].attribute&&n.toLowerCase()===e)||e}});function be(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 ri(t){const e={};return t.childNodes.forEach(n=>{e[n.slot||"default"]=!0}),e}function Ie(t,e,n,r,o,s){let c=class extends Dr{constructor(){super(t,n,o),this.$$p_d=e}static get observedAttributes(){return Ee(e).map(v=>(e[v].attribute||v).toLowerCase())}};return Ee(e).forEach(v=>{se(c.prototype,v,{get(){return this.$$c&&v in this.$$c?this.$$c[v]:this.$$d[v]},set(f){var h;f=be(v,f,e),this.$$d[v]=f,(h=this.$$c)==null||h.$set({[v]:f})}})}),r.forEach(v=>{se(c.prototype,v,{get(){var f;return(f=this.$$c)==null?void 0:f[v]}})}),t.element=c,c}const Vt=new Map([["yellow","#F8B920"],["red","#FF4646"],["blue","#0064FF"],["green","#00C564"]]),oi=["SCRIPT","STYLE","NOSCRIPT","TEXTAREA","OPTION"];function Or(t){const e=t.map(c=>c.trim().toLocaleLowerCase()),n=e.map(()=>({start:null,end:null,shift:0})),r=e.map(()=>[]),o=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,c=>{var v,f;return oi.includes((v=c.parentNode)==null?void 0:v.tagName)||!((f=c.parentNode)!=null&&f.checkVisibility())?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let s;for(;s=o.nextNode();)if(s!=null&&s.nodeValue)for(let c=0;c{var _;for(;f[n[h].shift]&&!f[n[h].shift].trim();)n[h].shift++;let m=f[n[h].shift]===v;if(!m&&n[h].shift&&(n[h].shift=0,m=f[n[h].shift]===v),m&&(n[h].shift||(n[h].start=[s,c]),n[h].end=[s,c],n[h].shift++),n[h].shift>=f.length){const E=document.createRange();E.setStart(n[h].start[0],n[h].start[1]),E.setEnd(n[h].end[0],n[h].end[1]+1),!E.collapsed&&((_=E.commonAncestorContainer.parentElement)!=null&&_.checkVisibility())?r[h].push(E):E.detach(),m=!1}m||(n[h].shift=0,n[h].start=null,n[h].end=null)})}return r}const At=`rh-${new Date().getTime()}-`,Fe="highlights"in CSS;function ii(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:c}=t[o],v=`${At}${s}`;CSS.highlights.set(v,new Highlight(...r[o]));const f=r[o][0].getBoundingClientRect();e.push(` - ::highlight(${v}) { +"use strict";var Zr=Object.defineProperty;var On=t=>{throw TypeError(t)};var Qr=(t,e,n)=>e in t?Zr(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ct=(t,e,n)=>Qr(t,typeof e!="symbol"?e+"":e,n),Ln=(t,e,n)=>e.has(t)||On("Cannot "+n);var Q=(t,e,n)=>(Ln(t,e,"read from private field"),n?n.call(t):e.get(t)),Be=(t,e,n)=>e.has(t)?On("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Ye=(t,e,n,r)=>(Ln(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,c=window.DocumentFragment.prototype.append,h=window.Node.prototype.cloneNode,d=window.Node.prototype.appendChild,p=window.Node.prototype.insertBefore,_=window.Node.prototype.removeChild,b=window.Node.prototype.replaceChild,E=Object.getOwnPropertyDescriptor(window.Node.prototype,"textContent"),m=window.Element.prototype.attachShadow,z=Object.getOwnPropertyDescriptor(window.Element.prototype,"innerHTML"),x=window.Element.prototype.getAttribute,T=window.Element.prototype.setAttribute,O=window.Element.prototype.removeAttribute,k=window.Element.prototype.toggleAttribute,$=window.Element.prototype.getAttributeNS,A=window.Element.prototype.setAttributeNS,K=window.Element.prototype.removeAttributeNS,C=window.Element.prototype.insertAdjacentElement,S=window.Element.prototype.insertAdjacentHTML,q=window.Element.prototype.prepend,L=window.Element.prototype.append,M=window.Element.prototype.before,V=window.Element.prototype.after,Z=window.Element.prototype.replaceWith,et=window.Element.prototype.remove,nt=window.HTMLElement,ot=Object.getOwnPropertyDescriptor(window.HTMLElement.prototype,"innerHTML"),ht=window.HTMLElement.prototype.insertAdjacentElement,Kt=window.HTMLElement.prototype.insertAdjacentHTML,En=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 En.add(i)});function Cn(i){var l=En.has(i);return i=/^[a-z][.0-9_a-z]*-[-.0-9_a-z]*$/.test(i),!l&&i}var Yr=document.contains?document.contains.bind(document):document.documentElement.contains.bind(document.documentElement);function F(i){var l=i.isConnected;if(l!==void 0)return l;if(Yr(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 Ie(i){var l=i.children;if(l)return Array.prototype.slice.call(l);for(l=[],i=i.firstChild;i;i=i.nextSibling)i.nodeType===Node.ELEMENT_NODE&&l.push(i);return l}function Fe(i,l){for(;l&&l!==i&&!l.nextSibling;)l=l.parentNode;return l&&l!==i?l.nextSibling:null}function He(i,l,u){for(var v=i;v;){if(v.nodeType===Node.ELEMENT_NODE){var a=v;l(a);var f=a.localName;if(f==="link"&&a.getAttribute("rel")==="import"){if(v=a.import,u===void 0&&(u=new Set),v instanceof Node&&!u.has(v))for(u.add(v),v=v.firstChild;v;v=v.nextSibling)He(v,l,u);v=Fe(i,a);continue}else if(f==="template"){v=Fe(i,a);continue}if(a=a.__CE_shadowRoot)for(a=a.firstChild;a;a=a.nextSibling)He(a,l,u)}v=v.firstChild?v.firstChild:Fe(i,v)}}function pe(){var i=!(vt==null||!vt.noDocumentConstructionObserver),l=!(vt==null||!vt.shadyDomFastWalk);this.m=[],this.g=[],this.j=!1,this.shadyDomFastWalk=l,this.I=!i}function Jt(i,l,u,v){var a=window.ShadyDOM;if(i.shadyDomFastWalk&&a&&a.inUse){if(l.nodeType===Node.ELEMENT_NODE&&u(l),l.querySelectorAll)for(i=a.nativeMethods.querySelectorAll.call(l,"*"),l=0;lr[e]),s=o.s.get(e)),s!==void 0&&H(s,st(n,o.i,o));const c=o.a,h=!(e in t);if(c&&e==="length")for(let d=n;d"u"?t=>setTimeout(t,1):requestIdleCallback;let $e=!1,ke=!1,Ze=[],Qe=[];function lr(){$e=!1;const t=Ze.slice();Ze=[],sr(t)}function ar(){ke=!1;const t=Qe.slice();Qe=[],sr(t)}function le(t){$e||($e=!0,queueMicrotask(lr)),Ze.push(t)}function So(t){ke||(ke=!0,To(ar)),Qe.push(t)}function zo(){$e&&lr(),ke&&ar()}function No(t){let e=Ot|_t;j===null&&(e|=St);const n={deps:null,deriveds:null,equals:ir,f:e,first:null,fn:t,last:null,reactions:null,v:null,version:0};if(P!==null&&P.f&Ot){var r=P;r.deriveds===null?r.deriveds=[n]:r.deriveds.push(n)}return n}function ur(t){hn(t);var e=t.deriveds;if(e!==null){t.deriveds=null;for(var n=0;nt.version)return!0;!qt&&!((b=p==null?void 0:p.reactions)!=null&&b.includes(t))&&(p.reactions??(p.reactions=[])).push(t)}else{if(t.f&_t)return!0;o&&(_>t.version&&(n=!0),h=p.reactions,h===null?p.reactions=[t]:h.includes(t)||h.push(t))}}r||ut(t,dt),o&&(t.f^=we)}return n}function Mo(t,e,n){throw t}function hr(t){const e=W,n=Y,r=xt,o=P,s=qt;W=null,Y=0,xt=null,P=t.f&(yt|cn)?null:t,qt=!Bt&&(t.f&St)!==0;try{let c=(0,t.fn)(),h=t.deps;if(W!==null){let d;if(h!==null){const p=h.length,_=Y===0?W:h.slice(0,Y).concat(W),E=_.length>16&&p-Y>1?new Set(_):null;for(d=Y;d0)for(h.length=Y+W.length,d=0;d1e3&&(Yt=0,wo()),Yt++}function gr(t){var e=t.length;if(e!==0){vr();var n=Bt;Bt=!0;try{for(var r=0;r1001)return;const t=Nt;Nt=[],gr(t),ie||(Yt=0)}function Le(t){me===fr&&(ie||(ie=!0,queueMicrotask(jo)));for(var e=t;e.parent!==null;){e=e.parent;var n=e.f;if(n&yt){if(!(n&dt))return;ut(e,Lt)}}Nt.push(e)}function mr(t,e){var n=t.first,r=[];t:for(;n!==null;){var o=n.f,s=(o&(Xt|Mt))===0,c=o&yt,h=(o&dt)!==0,d=n.first;if(s&&(!c||!h)){if(c&&ut(n,dt),o&Vt){if(!c&&ae(n)&&(Oe(n),d=n.first),d!==null){n=d;continue}}else if(o&rr)if(c||h){if(d!==null){n=d;continue}}else r.push(n)}var p=n.next;if(p===null){let E=n.parent;for(;E!==null;){if(t===E)break t;var _=E.next;if(_!==null){n=_;continue t}E=E.parent}}n=p}for(var b=0;b0||s.length>0)&&Rt(),Yt=0,o}finally{me=n,Nt=r}}function D(t){const e=t.f;if(e&Xt)return t.v;if(P!==null){const n=(P.f&St)!==0,r=P.deps;W===null&&r!==null&&r[Y]===t&&!(n&&j!==null)?Y++:(r===null||Y===0||r[Y-1]!==t)&&(W===null?W=[t]:W[W.length-1]!==t&&W.push(t)),xt!==null&&j!==null&&j.f&dt&&!(j.f&yt)&&xt.includes(t)&&(ut(j,_t),Le(j))}return e&Ot&&ae(t)&&cr(t),t.v}function pn(t,e,n){var r=t.reactions;if(r!==null)for(var o=tn(),s=r.length,c=0;c{de(e)}}function gn(t){return Gt(rr,t,!1)}function fe(t){return Gt(Vt,t,!0)}function mt(t){return fe(t)}function br(t,e=0){return Gt(Vt|or|e,t,!0)}function se(t){return Gt(Vt|yt,t,!0)}function wr(t){var e=t.teardown;if(e!==null){const n=dn,r=P;In(!0),Fn(null);try{e.call(null)}finally{In(n),Fn(r)}}}function de(t,e=!0){var n=t.dom;if(n!==null&&e&&vn(n),hn(t,e),De(t,0),ut(t,Xt),t.transitions)for(const o of t.transitions)o.stop();wr(t);var r=t.parent;r!==null&&t.f&yt&&r.first!==null&&Er(t),t.next=t.prev=t.teardown=t.ctx=t.dom=t.deps=t.parent=t.fn=null}function Er(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 nn(t,e){var n=[];mn(t,n,!0),Cr(n,()=>{de(t),e&&e()})}function Cr(t,e){var n=t.length;if(n>0){var r=()=>--n||e();for(var o of t)o.out(r)}else e()}function mn(t,e,n){if(!(t.f&Mt)){if(t.f^=Mt,t.transitions!==null)for(const c of t.transitions)(c.is_global||n)&&e.push(c);for(var r=t.first;r!==null;){var o=r.next,s=(r.f&fn)!==0||(r.f&yt)!==0;mn(r,e,s?n:!1),r=o}}}function xe(t){$r(t,!0)}function $r(t,e){if(t.f&Mt){t.f^=Mt,ae(t)&&Oe(t);for(var n=t.first;n!==null;){var r=n.next,o=(n.f&fn)!==0||(n.f&yt)!==0;$r(n,o?e:!1),n=r}if(t.transitions!==null)for(const s of t.transitions)(s.is_global||e)&&s.in()}}var Te,zt;function kr(){if(Te===void 0){Te=window,zt=document;var t=Element.prototype;t.__click=void 0,t.__className="",t.__attributes=null,t.__e=void 0,Text.prototype.__t=void 0}}function he(){return document.createTextNode("")}function lt(t){const e=t.firstChild;return G?e===null?t.appendChild(he()):Wt(e):e}function _n(t,e){return G?Wt(Tt):t.firstChild}function I(t,e=!1){var n=t.nextSibling;if(!G)return n;var r=n.nodeType;if(r===8&&n.data===io)return I(n,e);if(e&&r!==3){var o=he(),s=j.dom;return s.unshift(o),n==null||n.before(o),o}return Wt(n)}function yn(t){t.textContent=""}function qo(t){return document.createElement(t)}function Bo(t,e,n,r){function o(s){if(r.capture||rn(e,s),!s.cancelBubble)return n.call(this,s)}return t.startsWith("pointer")||t==="wheel"?le(()=>{e.addEventListener(t,o,r)}):e.addEventListener(t,o,r),o}function gt(t,e,n,r,o){var s={capture:r,passive:o},c=Bo(t,e,n,s);(e===document.body||e===window||e===document)&&yr(()=>{e.removeEventListener(t,c,s)})}function xr(t){for(var e=0;e{throw O});throw _}}finally{e.__root=t,s=t}}}const Tr=new Set,on=new Set;function We(t,e){(t.__t??(t.__t=t.nodeValue))!==e&&(t.nodeValue=t.__t=e)}function Sr(t,e){const n=e.anchor??e.target.appendChild(he());return Rt(()=>zr(t,{...e,anchor:n}),!1)}function Yo(t,e){const n=e.target,r=jt;try{return Rt(()=>{$t(!0);for(var o=n.firstChild;o&&(o.nodeType!==8||o.data!==ye);)o=o.nextSibling;if(!o)throw Ke;const s=Wt(o),c=zr(t,{...e,anchor:s});return $t(!1),c},!1)}catch(o){if(o===Ke)return e.recover===!1&&Eo(),kr(),yn(n),$t(!1),Sr(t,e);throw o}finally{$t(!!r),lo(r)}}function zr(t,{target:e,anchor:n,props:r={},events:o,context:s,intro:c=!1}){kr();const h=new Set,d=rn.bind(null,e),p=rn.bind(null,document),_=m=>{for(let z=0;z(se(()=>{if(s){ue({});var m=U;m.c=s}o&&(r.$$events=o),b=t(n,r)||{},s&&ce()}),()=>{for(const m of h)e.removeEventListener(m,d),document.removeEventListener(m,d);on.delete(_),sn.delete(b)}));return sn.set(b,E),b}let sn=new WeakMap;function Wo(t){const e=sn.get(t);e==null||e()}async function bn(t,e,n){await Promise.resolve();const r=Uo(t);if(!r.getElementById(e)){const o=qo("style");o.id=e,o.textContent=n,(r.head||r).appendChild(o)}}function Uo(t){if(!t)return document;const e=t.getRootNode?t.getRootNode():t.ownerDocument;return e&&e.host?e:t.ownerDocument}function Se(t,e,n,r=null,o=!1){var s=null,c=null,h=null,d=o?fn:0;br(()=>{if(h===(h=!!e()))return;let p=!1;if(G){const _=t.data===er;h===_&&(vn(jt),$t(!1),p=!0)}h?(s?xe(s):s=se(()=>n(t)),c&&nn(c,()=>{c=null})):(c?xe(c):r&&(c=se(()=>r(t))),s&&nn(s,()=>{s=null})),p&&$t(!0)},d)}let Ue=null;function Vo(t,e){return e}function Xo(t,e,n){for(var r=[],o=t.length,s=0;s0&&r.length===0&&e!==null;if(c){var h=e.parentNode;yn(h),h.append(e),n.clear(),kt(t[0].prev,t[o-1].next)}Cr(r,()=>{for(var d=0;d{var _=n(),b=Dt(_)?_:_==null?[]:Array.from(_),E=b.length,m=c.flags;m&Ge&&!nr(b)&&!(X in b)&&(m^=Ge,m&to&&!(m&re)&&(m^=re));let z=!1;if(G){var x=t.data===er;(x!==(E===0)||Tt===void 0)&&(vn(jt),$t(!1),z=!0)}if(G){for(var T=Tt,O=c,k,$=0;$0)for(;T!==t;){var C=T.nextSibling;T.remove(),T=C}}G||Go(b,c,t,o,m,r),s!==null&&(E===0?p?xe(p):p=se(()=>s(t)):p!==null&&nn(p,()=>{p=null})),z&&$t(!0)})}function Go(t,e,n,r,o,s){var et,nt,ot,ht;var c=(o&eo)!==0,h=(o&(re|un))!==0,d=t.length,p=e.items,_=e.next,b=_,E=new Set,m=e,z=new Set,x=[],T=[],O,k,$,A;if(c)for(A=0;A0){var Z=o&Qn&&d===0?n:null;if(c){for(A=0;A{var Kt;for($ of z)(Kt=$.a)==null||Kt.apply()})}function Ko(t,e,n,r){r&re&&H(t.v,e),r&un?H(t.i,n):t.i=n}function Nr(t,e,n,r,o,s,c,h){var d=Ue;try{var p=(h&re)!==0,_=(h&Ge)===0,b=p?_?Ee(r):tt(r):r,E=h&un?tt(s):s,m={i:E,v:b,k:o,a:null,e:null,prev:e,next:n};return e.next=m,n!==null&&(n.prev=m),Ue=m,m.e=se(()=>c(t,b,E)),m}finally{Ue=d}}function qn(t,e){if(t.nodeType===3&&t.data===""||t.nodeType===8){for(var n=e.first,r;n!==null&&(r=n.first,n.dom===null);){if(r===null)return t.previousSibling;n=r}return ee(n)}return t}function ee(t){var e=t.dom;return Dt(e)?qn(e[0],t):qn(e,t)}function Bn(t,e,n){for(var r=t.next?ee(t.next.e):n,o=e?ee(e.e):n,s=ee(t.e);s!==r;){var c=s.nextSibling;o.before(s),s=c}}function kt(t,e){t.next=e,e!==null&&(e.prev=t)}function ze(t,e=j){var n=e.dom;return n===null?e.dom=t:(Dt(n)||(n=e.dom=[n]),Dt(t)?n.push(...t):n.push(t)),t}function bt(t,e){var n=(e&ro)!==0,r=(e&oo)!==0,o;return()=>{if(G)return ze(n?jt:Tt),Tt;o||(o=Fo(t),n||(o=o.firstChild));var s=r?document.importNode(o,!0):o.cloneNode(!0);return ze(n?[...s.childNodes]:s),s}}function Jo(){if(G)return ze(jt),Tt;var t=document.createDocumentFragment(),e=he();return t.append(e),ze([e]),t}function at(t,e){G||t.before(e)}function Zo(t,e){{const n=document.body;t.autofocus=!0,le(()=>{document.activeElement===n&&t.focus()})}}function Qo(t){G&&t.firstChild!==null&&yn(t)}let Yn=!1;function Ar(){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 ti(t){if(G){var e=!1,n=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var r=t.value;ft(t,"value",null),t.value=r}if(t.hasAttribute("checked")){var o=t.checked;ft(t,"checked",null),t.checked=o}}};t.__on_r=n,So(n),Ar()}}function ei(t,e){var n=t.__attributes??(t.__attributes={});n.value!==(n.value=e)&&(t.value=e)}function ft(t,e,n){n=n==null?null:n+"";var r=t.__attributes??(t.__attributes={});G&&(r[e]=t.getAttribute(e),e==="src"||e==="href"||e==="srcset")||r[e]!==(r[e]=n)&&(e==="loading"&&(t[vo]=n),n===null?t.removeAttribute(e):t.setAttribute(e,n))}function ne(t,e,n){n?t.classList.add(e):t.classList.remove(e)}function Dr(t,e,n,r=n){t.addEventListener(e,n);const o=t.__on_r;o?t.__on_r=()=>{o(),r()}:t.__on_r=r,Ar()}function ni(t,e,n){Dr(t,"input",()=>{n(Un(t)?Vn(t.value):t.value)}),fe(()=>{var r=e();if(G&&t.defaultValue!==t.value){n(t.value);return}Un(t)&&r===Vn(t.value)||t.type==="date"&&!r&&!t.value||(t.value=r??"")})}function ri(t,e,n,r,o){var s=n.getAttribute("type")==="checkbox",c=t;let h=!1;if(e!==null)for(var d of e){var p=c;c=p[d],c===void 0&&(c=p[d]=[])}c.push(n),Dr(n,"change",()=>{var _=n.__value;s&&(_=Wn(c,_,n.checked)),o(_)},()=>o(s?[]:null)),fe(()=>{var _=r();if(G&&n.defaultChecked!==n.checked){h=!0;return}s?(_=_||[],n.checked=Ce(_).includes(Ce(n.__value))):n.checked=xo(n.__value,_)}),yr(()=>{var _=c.indexOf(n);_!==-1&&c.splice(_,1)}),le(()=>{if(c.sort((E,m)=>E.compareDocumentPosition(m)===4?-1:1),h){var _;if(s)_=Wn(c,_,n.checked);else{var b=c.find(E=>E.checked);_=b==null?void 0:b.__value}o(_)}})}function Wn(t,e,n){for(var r=new Set,o=0;o{var o,s;return fe(()=>{o=s,s=[],_r(()=>{t!==n(...s)&&(e(t,...s),o&&Xn(n(...o),t)&&e(null,...o))})}),()=>{le(()=>{s&&Xn(n(...s),t)&&e(null,...s)})}})}function Me(t,e,n,r){var z;var o=(n&no)!==0,s=t[e],c=(z=Je(t,e))==null?void 0:z.set,h=r,d=()=>h;s===void 0&&r!==void 0&&(c&&o&&Co(),s=d(),c&&c(s));var p;if(p=()=>{var x=t[e];return x===void 0?d():x},c){var _=t.$$legacy;return function(x,T){return arguments.length>0?((!T||_)&&c(T?p():x),x):p()}}var b=!1,E=Ee(s),m=No(()=>{var x=p(),T=D(E);return b?(b=!1,T):E.v=x});return function(x,T){var O=D(m);if(arguments.length>0){const k=T?D(m):x;return m.equals(k)||(b=!0,H(E,k),D(m)),x}return O}}function oi(t){return new ii(t)}var Et,it;class ii{constructor(e){Be(this,Et);Be(this,it);const n=st({...e.props||{},$$events:{}},!1);Ye(this,it,(e.hydrate?Yo:Sr)(e.component,{target:e.target,props:n,context:e.context,intro:e.intro,recover:e.recover})),Ye(this,Et,n.$$events);for(const r of Object.keys(Q(this,it)))r==="$set"||r==="$destroy"||r==="$on"||oe(this,r,{get(){return Q(this,it)[r]},set(o){Q(this,it)[r]=o},enumerable:!0});Q(this,it).$set=r=>{Object.assign(n,r)},Q(this,it).$destroy=()=>{Wo(Q(this,it))}}$set(e){Q(this,it).$set(e)}$on(e,n){Q(this,Et)[e]=Q(this,Et)[e]||[];const r=(...o)=>n.call(this,...o);return Q(this,Et)[e].push(r),()=>{Q(this,Et)[e]=Q(this,Et)[e].filter(o=>o!==r)}}$destroy(){Q(this,it).$destroy()}}Et=new WeakMap,it=new WeakMap;let Or;typeof HTMLElement=="function"&&(Or=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 c=document.createElement("slot");o!=="default"&&(c.name=o),at(s,c)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;const n={},r=si(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]=_e(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=oi({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:n,$$host:this}}),this.$$me=fe(()=>{var o;this.$$r=!0;for(const s of be(this.$$c)){if(!((o=this.$$p_d[s])!=null&&o.reflect))continue;this.$$d[s]=this.$$c[s];const c=_e(s,this.$$d[s],this.$$p_d,"toAttribute");c==null?this.removeAttribute(this.$$p_d[s].attribute||s):this.setAttribute(this.$$p_d[s].attribute||s,c)}this.$$r=!1});for(const o in this.$$l)for(const s of this.$$l[o]){const c=this.$$c.$on(o,s);this.$$l_u.set(s,c)}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(),de(this.$$me),this.$$c=void 0)})}$$g_p(e){return be(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 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 si(t){const e={};return t.childNodes.forEach(n=>{e[n.slot||"default"]=!0}),e}function je(t,e,n,r,o,s){let c=class extends Or{constructor(){super(t,n,o),this.$$p_d=e}static get observedAttributes(){return be(e).map(h=>(e[h].attribute||h).toLowerCase())}};return be(e).forEach(h=>{oe(c.prototype,h,{get(){return this.$$c&&h in this.$$c?this.$$c[h]:this.$$d[h]},set(d){var p;d=_e(h,d,e),this.$$d[h]=d,(p=this.$$c)==null||p.$set({[h]:d})}})}),r.forEach(h=>{oe(c.prototype,h,{get(){var d;return(d=this.$$c)==null?void 0:d[h]}})}),t.element=c,c}const Ut=new Map([["yellow","#F8B920"],["red","#FF4646"],["blue","#0064FF"],["green","#00C564"]]),li=["SCRIPT","STYLE","NOSCRIPT","TEXTAREA","OPTION"];function Lr(t){const e=t.map(c=>c.trim().toLocaleLowerCase()),n=e.map(()=>({start:null,end:null,shift:0})),r=e.map(()=>[]),o=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT,c=>{var h,d;return li.includes((h=c.parentNode)==null?void 0:h.tagName)||!((d=c.parentNode)!=null&&d.checkVisibility())?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT});let s;for(;s=o.nextNode();)if(s!=null&&s.nodeValue)for(let c=0;c{var b;for(;d[n[p].shift]&&!d[n[p].shift].trim();)n[p].shift++;let _=d[n[p].shift]===h;if(!_&&n[p].shift&&(n[p].shift=0,_=d[n[p].shift]===h),_&&(n[p].shift||(n[p].start=[s,c]),n[p].end=[s,c],n[p].shift++),n[p].shift>=d.length){const E=document.createRange();E.setStart(n[p].start[0],n[p].start[1]),E.setEnd(n[p].end[0],n[p].end[1]+1),!E.collapsed&&((b=E.commonAncestorContainer.parentElement)!=null&&b.checkVisibility())?r[p].push(E):E.detach(),_=!1}_||(n[p].shift=0,n[p].start=null,n[p].end=null)})}return r}const At=`rh-${new Date().getTime()}-`,Re="highlights"in CSS;function ai(t){if(!t.length&&!CSS.highlights.size)return;const e=[];if(CSS.highlights.clear(),t.length){const r=Lr(t.map(({text:o})=>o||""));for(const o in t){if(!r[o].length)continue;const{_id:s,color:c}=t[o],h=`${At}${s}`;CSS.highlights.set(h,new Highlight(...r[o]));const d=r[o][0].getBoundingClientRect();e.push(` + ::highlight(${h}) { all: unset; - background-color: color-mix(in srgb, ${Vt.get(c)||c}, white 50%) !important; + background-color: color-mix(in srgb, ${Ut.get(c)||c}, white 50%) !important; color: black; } :root { - --highlight-${s}-top: ${(100/document.documentElement.scrollHeight*(window.scrollY+f.top-10)).toFixed(2)}%; + --highlight-${s}-top: ${(100/document.documentElement.scrollHeight*(window.scrollY+d.top-10)).toFixed(2)}%; } - `);for(const h of r[o])h.detach()}}const n=(()=>{let r=document.getElementById(At);return r||(r=document.createElement("style"),r.id=At,document.head.appendChild(r)),r})();n.innerHTML=e.join(` -`)}function si(){var t;(t=document.getElementById(At))==null||t.remove()}function li(t){var e;for(const[n,r]of CSS.highlights){const o=n.replace(At,"");if(t==o)for(const s of r){(e=s.startContainer.parentElement)==null||e.scrollIntoView({behavior:"smooth",block:"start"});break}}}function ai(t){let e;for(const[n,r]of CSS.highlights)for(const o of r){const s=t.compareBoundaryPoints(Range.START_TO_START,o),c=t.compareBoundaryPoints(Range.END_TO_END,o);(s==0&&c==0||t!=null&&t.collapsed&&s>=0&&c<=0)&&(e=[n.replace(At,""),o])}if(e)return e[0].replace(At,"")}const Ct=`rh-${new Date().getTime()}`;function ui(t){const e=document.body.querySelectorAll(`.${Ct}`);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:c,color:v}=t[s];for(const f of r[s]){const h=document.createElement("mark");h.className=Ct,h.setAttribute("data-id",String(c)),h.append(f.extractContents()),f.insertNode(h),f.detach()}n.push(` + `);for(const p of r[o])p.detach()}}const n=(()=>{let r=document.getElementById(At);return r||(r=document.createElement("style"),r.id=At,document.head.appendChild(r)),r})();n.innerHTML=e.join(` +`)}function ui(){var t;(t=document.getElementById(At))==null||t.remove()}function ci(t){var e;for(const[n,r]of CSS.highlights){const o=n.replace(At,"");if(t==o)for(const s of r){(e=s.startContainer.parentElement)==null||e.scrollIntoView({behavior:"smooth",block:"start"});break}}}function fi(t){let e;for(const[n,r]of CSS.highlights)for(const o of r){const s=t.compareBoundaryPoints(Range.START_TO_START,o),c=t.compareBoundaryPoints(Range.END_TO_END,o);(s==0&&c==0||t!=null&&t.collapsed&&s>=0&&c<=0)&&(e=[n.replace(At,""),o])}if(e)return e[0].replace(At,"")}const Ct=`rh-${new Date().getTime()}`;function di(t){const e=document.body.querySelectorAll(`.${Ct}`);if(!t.length&&!e.length)return;e.forEach(s=>s.outerHTML=s.innerText);const n=[],r=Lr(t.map(({text:s})=>s||""));for(const s in t){const{_id:c,color:h}=t[s];for(const d of r[s]){const p=document.createElement("mark");p.className=Ct,p.setAttribute("data-id",String(c)),p.append(d.extractContents()),d.insertNode(p),d.detach()}n.push(` .${Ct}[data-id="${c}"] { all: unset; display: inline-block; - background-color: ${hi(Vt.get(v)||v,.5)} !important; + background-color: ${gi(Ut.get(h)||h,.5)} !important; } `)}const o=(()=>{let s=document.getElementById(Ct);return s||(s=document.createElement("style"),s.id=Ct,document.head.appendChild(s)),s})();o.innerHTML=n.join(` -`)}function ci(){var t;document.body.querySelectorAll(`.${Ct}`).forEach(e=>e.outerHTML=e.innerText),(t=document.getElementById(Ct))==null||t.remove()}function fi(t){const e=document.body.querySelector(`.${Ct}[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)==Ct){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 hi(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 Ae(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var pi=typeof global=="object"&&global&&global.Object===Object&&global,vi=typeof self=="object"&&self&&self.Object===Object&&self,Lr=pi||vi||Function("return this")(),Ge=function(){return Lr.Date.now()},gi=/\s/;function mi(t){for(var e=t.length;e--&&gi.test(t.charAt(e)););return e}var _i=/^\s+/;function yi(t){return t&&t.slice(0,mi(t)+1).replace(_i,"")}var De=Lr.Symbol,jr=Object.prototype,bi=jr.hasOwnProperty,wi=jr.toString,ee=De?De.toStringTag:void 0;function Ei(t){var e=bi.call(t,ee),n=t[ee];try{t[ee]=void 0;var r=!0}catch{}var o=wi.call(t);return r&&(e?t[ee]=n:delete t[ee]),o}var Ci=Object.prototype,ki=Ci.toString;function xi(t){return ki.call(t)}var Ti="[object Null]",$i="[object Undefined]",Xn=De?De.toStringTag:void 0;function Si(t){return t==null?t===void 0?$i:Ti:Xn&&Xn in Object(t)?Ei(t):xi(t)}function zi(t){return t!=null&&typeof t=="object"}var Ni="[object Symbol]";function Ai(t){return typeof t=="symbol"||zi(t)&&Si(t)==Ni}var Gn=NaN,Di=/^[-+]0x[0-9a-f]+$/i,Oi=/^0b[01]+$/i,Li=/^0o[0-7]+$/i,ji=parseInt;function Kn(t){if(typeof t=="number")return t;if(Ai(t))return Gn;if(Ae(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ae(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=yi(t);var n=Oi.test(t);return n||Li.test(t)?ji(t.slice(2),n?2:8):Di.test(t)?Gn:+t}var Mi="Expected a function",Ri=Math.max,Ii=Math.min;function Fi(t,e,n){var r,o,s,c,v,f,h=0,m=!1,_=!1,E=!0;if(typeof t!="function")throw new TypeError(Mi);e=Kn(e)||0,Ae(n)&&(m=!!n.leading,_="maxWait"in n,s=_?Ri(Kn(n.maxWait)||0,e):s,E="trailing"in n?!!n.trailing:E);function y(k){var $=r,L=o;return r=o=void 0,h=k,c=t.apply(L,$),c}function C(k){return h=k,v=setTimeout(O,e),m?y(k):c}function S(k){var $=k-f,L=k-h,j=e-$;return _?Ii(j,s-L):j}function z(k){var $=k-f,L=k-h;return f===void 0||$>=e||$<0||_&&L>=s}function O(){var k=Ge();if(z(k))return T(k);v=setTimeout(O,S(k))}function T(k){return v=void 0,E&&r?y(k):(r=o=void 0,c)}function x(){v!==void 0&&clearTimeout(v),h=0,r=f=o=v=void 0}function A(){return v===void 0?c:T(Ge())}function K(){var k=Ge(),$=z(k);if(r=arguments,o=this,f=k,$){if(v===void 0)return C(f);if(_)return clearTimeout(v),v=setTimeout(O,e),y(f)}return v===void 0&&(v=setTimeout(O,e)),c}return K.cancel=x,K.flush=A,K}var Hi="Expected a function";function Mr(t,e,n){var r=!0,o=!0;if(typeof t!="function")throw new TypeError(Hi);return Ae(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),Fi(t,e,{leading:r,maxWait:e,trailing:o})}function Rr(t){return Fe?ii(t):ui(t)}const Pi=Mr(Rr,500);function Ke(t){return t.length?Pi(t):Rr(t)}function qi(){return Fe?si():ci()}function Ir(t){return Fe?li(t):fi(t)}function Fr(){const t=document.getSelection();if(t!=null&&t.rangeCount)return t.getRangeAt(0)}function re(){const t=document.getSelection();t!=null&&t.rangeCount&&t.removeAllRanges()}function Bi(t){return Fe?ai(t):di(t)}function Jn(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=nt(st([])),o=nt(!1),s=nt(!1),c=nt(void 0);function v(y){const C=Bi(y);if(C)return D(r).find(z=>z._id==C);if(Jn(y).trim())return{text:Jn(y).trim(),color:"yellow"}}function f(y){const C={...y._id?{_id:y._id}:{},...y.text?{text:y.text}:{},...y.note?{note:y.note}:{},...y.color?{color:y.color}:{}};if(!C.text)return;const S=D(r).findIndex(z=>{var O,T;return z._id==C._id||((O=z.text)==null?void 0:O.toLocaleLowerCase().trim())===((T=C.text)==null?void 0:T.toLocaleLowerCase().trim())});S!=-1?(D(r)[S]=C,e(C)):(D(r).push(C),t(C))}function h({_id:y}){P(r,st(D(r).filter(C=>C._id!=y))),n({_id:y})}function m(y){P(c,st(JSON.parse(JSON.stringify(y))))}function _(){D(c)&&(f(D(c)),P(c,void 0))}function E(){P(c,void 0)}return{get highlights(){return D(r)},set highlights(y){P(r,st(y))},get pro(){return D(o)},set pro(y){P(o,st(y))},get nav(){return D(s)},set nav(y){P(s,st(y))},get draft(){return D(c)},find:v,upsert:f,remove:h,setDraft:m,draftSubmit:_,draftCancel:E}}const Wi="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Wi);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 Ui=ht(''),Vi=ht(''),Xi=ht(''),Gi=ht('
');function Hr(t,e){de(e,!0);let n=Re(e,"store",7),r,o=nt(void 0),s=nt(!1);function c(k){if(!D(o))return;const $=k.currentTarget.returnValue;switch(k.currentTarget.returnValue="",$){case"add":e.store.upsert(D(o)),re();break;case"note":e.store.setDraft(D(o)),re();break;case"remove":e.store.remove(D(o)),re();break;default:if(Vt.has($)){e.store.upsert({...D(o),color:$}),re();return}break}}function v(){P(s,!0)}function f(){P(s,!1),h()}function h(){if(D(s)){r==null||r.close();return}requestAnimationFrame(()=>{const k=Fr(),$=k&&e.store.find(k);if(!k||!($!=null&&$._id)&&!k.toString().trim()){r==null||r.close();return}P(o,st($)),r.inert=!0,r==null||r.show(),r.inert=!1;const L=k.getBoundingClientRect(),j=Math.max(L.x,10)+window.scrollX,F=window.innerWidth-Math.max(L.x,10)-window.scrollX-L.width,V=Math.max(L.y,40)+window.scrollY+L.height+4,J=window.innerHeight-Math.max(L.y,40)-window.scrollY+4,ut=jr=k,()=>r),mt(()=>oe(_,"mobile",cn()));var E=lt(_),y=lt(E);ue(y,()=>{var k;return(k=D(o))==null?void 0:k._id},k=>{var $=zr(),L=Me($);En(L,71,()=>Vt,(j,F)=>Q(Q(j))[0],(j,F,V)=>{let J=()=>Q(Q(F))[0],ut=()=>Q(Q(F))[1];var B=Ui(),ot=lt(B);mt(()=>{Zo(B,J()),ft(ot,"style",`--color: ${ut()??""}`),oe(ot,"active",J()==D(o).color)}),et(j,B)}),et(k,$)},k=>{var $=Vi();et(k,$)});var C=I(I(y,!0)),S=lt(C),z=lt(S),O=lt(z),T=I(O),x=I(T),A=I(x),K=I(I(C,!0));return ue(K,()=>{var k;return(k=D(o))==null?void 0:k._id},k=>{var $=Xi();et(k,$)}),mt(()=>{var k,$,L,j,F,V;oe(_,"new",!((k=D(o))!=null&&k._id)),ft(O,"fill",($=D(o))!=null&&$.note?"currentColor":"none"),ft(O,"stroke-width",(L=D(o))!=null&&L.note?"0":void 0),ft(T,"fill",(j=D(o))!=null&&j.note?"none":"currentColor"),ft(x,"fill",(F=D(o))!=null&&F.note?"none":"currentColor"),ft(A,"fill",(V=D(o))!=null&&V.note?"none":"currentColor")}),gt("close",_,c,!1),et(t,_),wn(t,"svelte-1iojgl7",` +`)}function hi(){var t;document.body.querySelectorAll(`.${Ct}`).forEach(e=>e.outerHTML=e.innerText),(t=document.getElementById(Ct))==null||t.remove()}function pi(t){const e=document.body.querySelector(`.${Ct}[data-id="${t}"]`);e&&e.scrollIntoView({behavior:"smooth",block:"start"})}function vi(t){const e=t.commonAncestorContainer.nodeType==Node.ELEMENT_NODE?t.commonAncestorContainer:t.commonAncestorContainer.parentElement;if((e==null?void 0:e.className)==Ct){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 gi(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 Ne(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var mi=typeof global=="object"&&global&&global.Object===Object&&global,_i=typeof self=="object"&&self&&self.Object===Object&&self,Mr=mi||_i||Function("return this")(),Ve=function(){return Mr.Date.now()},yi=/\s/;function bi(t){for(var e=t.length;e--&&yi.test(t.charAt(e)););return e}var wi=/^\s+/;function Ei(t){return t&&t.slice(0,bi(t)+1).replace(wi,"")}var Ae=Mr.Symbol,jr=Object.prototype,Ci=jr.hasOwnProperty,$i=jr.toString,Zt=Ae?Ae.toStringTag:void 0;function ki(t){var e=Ci.call(t,Zt),n=t[Zt];try{t[Zt]=void 0;var r=!0}catch{}var o=$i.call(t);return r&&(e?t[Zt]=n:delete t[Zt]),o}var xi=Object.prototype,Ti=xi.toString;function Si(t){return Ti.call(t)}var zi="[object Null]",Ni="[object Undefined]",Gn=Ae?Ae.toStringTag:void 0;function Ai(t){return t==null?t===void 0?Ni:zi:Gn&&Gn in Object(t)?ki(t):Si(t)}function Di(t){return t!=null&&typeof t=="object"}var Oi="[object Symbol]";function Li(t){return typeof t=="symbol"||Di(t)&&Ai(t)==Oi}var Kn=NaN,Mi=/^[-+]0x[0-9a-f]+$/i,ji=/^0b[01]+$/i,Ri=/^0o[0-7]+$/i,Ii=parseInt;function Jn(t){if(typeof t=="number")return t;if(Li(t))return Kn;if(Ne(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=Ne(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=Ei(t);var n=ji.test(t);return n||Ri.test(t)?Ii(t.slice(2),n?2:8):Mi.test(t)?Kn:+t}var Fi="Expected a function",Hi=Math.max,Pi=Math.min;function qi(t,e,n){var r,o,s,c,h,d,p=0,_=!1,b=!1,E=!0;if(typeof t!="function")throw new TypeError(Fi);e=Jn(e)||0,Ne(n)&&(_=!!n.leading,b="maxWait"in n,s=b?Hi(Jn(n.maxWait)||0,e):s,E="trailing"in n?!!n.trailing:E);function m(C){var S=r,q=o;return r=o=void 0,p=C,c=t.apply(q,S),c}function z(C){return p=C,h=setTimeout(O,e),_?m(C):c}function x(C){var S=C-d,q=C-p,L=e-S;return b?Pi(L,s-q):L}function T(C){var S=C-d,q=C-p;return d===void 0||S>=e||S<0||b&&q>=s}function O(){var C=Ve();if(T(C))return k(C);h=setTimeout(O,x(C))}function k(C){return h=void 0,E&&r?m(C):(r=o=void 0,c)}function $(){h!==void 0&&clearTimeout(h),p=0,r=d=o=h=void 0}function A(){return h===void 0?c:k(Ve())}function K(){var C=Ve(),S=T(C);if(r=arguments,o=this,d=C,S){if(h===void 0)return z(d);if(b)return clearTimeout(h),h=setTimeout(O,e),m(d)}return h===void 0&&(h=setTimeout(O,e)),c}return K.cancel=$,K.flush=A,K}var Bi="Expected a function";function Rr(t,e,n){var r=!0,o=!0;if(typeof t!="function")throw new TypeError(Bi);return Ne(n)&&(r="leading"in n?!!n.leading:r,o="trailing"in n?!!n.trailing:o),qi(t,e,{leading:r,maxWait:e,trailing:o})}function Ir(t){return Re?ai(t):di(t)}const Yi=Rr(Ir,500);function Xe(t){return t.length?Yi(t):Ir(t)}function Wi(){return Re?ui():hi()}function Fr(t){return Re?ci(t):pi(t)}function Hr(){const t=document.getSelection();if(t!=null&&t.rangeCount)return t.getRangeAt(0)}function te(){const t=document.getSelection();t!=null&&t.rangeCount&&t.removeAllRanges()}function Ui(t){return Re?fi(t):vi(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 Vi(t,e,n){let r=tt(st([])),o=tt(!1),s=tt(!1),c=tt(void 0);function h(m){const z=Ui(m);if(z)return D(r).find(T=>T._id==z);if(Zn(m).trim())return{text:Zn(m).trim()}}function d(m){const z={...m._id?{_id:m._id}:{},...m.text?{text:m.text}:{},...m.note?{note:m.note}:{},color:m.color||"yellow"};if(!z.text)return;const x=D(r).findIndex(T=>{var O,k;return T._id==z._id||((O=T.text)==null?void 0:O.toLocaleLowerCase().trim())===((k=z.text)==null?void 0:k.toLocaleLowerCase().trim())});x!=-1?(D(r)[x]=z,e(z)):(D(r).push(z),t(z))}function p({_id:m}){H(r,st(D(r).filter(z=>z._id!=m))),n({_id:m})}function _(m){H(c,st(JSON.parse(JSON.stringify(m))))}function b(){D(c)&&(d(D(c)),H(c,void 0))}function E(){H(c,void 0)}return{get highlights(){return D(r)},set highlights(m){H(r,st(m))},get pro(){return D(o)},set pro(m){H(o,st(m))},get nav(){return D(s)},set nav(m){H(s,st(m))},get draft(){return D(c)},find:h,upsert:d,remove:p,setDraft:_,draftSubmit:b,draftCancel:E}}const Xi="5";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(Xi);function an(){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=bt(''),Ki=bt(''),Ji=bt('
');function Pr(t,e){ue(e,!0);let n=Me(e,"store",7),r,o=tt(void 0),s=tt(!1);function c(C){if(!D(o))return;const S=C.currentTarget.returnValue;switch(C.currentTarget.returnValue="",S){case"add":n().upsert(D(o)),te();break;case"note":n().setDraft(D(o)),te();break;case"remove":n().remove(D(o)),te();break;default:if(Ut.has(S)){n().upsert({...D(o),color:S}),te();return}break}}function h(){H(s,!0)}function d(){H(s,!1),setTimeout(p)}function p(){if(D(s)){r==null||r.close();return}requestAnimationFrame(()=>{const C=Hr(),S=C&&n().find(C);if(!C||!(S!=null&&S._id)&&!C.toString().trim()){r==null||r.close();return}H(o,st(S)),r.inert=!0,r==null||r.show(),r.inert=!1;const q=256,L=10,M=C.getBoundingClientRect(),V=Math.min(Math.max(M.x,L)+window.scrollX,window.innerWidth+window.scrollX-q-L),Z=Math.min(window.innerWidth-Math.max(M.x,L)-window.scrollX-M.width,window.innerWidth-window.scrollX-q-L),et=Math.max(M.y,40)+window.scrollY+M.height+4,nt=window.innerHeight-Math.max(M.y,40)-window.scrollY+4,ot=Vr=C,()=>r),mt(()=>ne(b,"mobile",an()));var E=lt(b),m=lt(E);wn(m,71,()=>Ut,(C,S)=>J(J(C))[0],(C,S,q)=>{let L=()=>J(J(S))[0],M=()=>J(J(S))[1];var V=Gi(),Z=lt(V);mt(()=>{var et;ei(V,L()),ft(Z,"style",`--color: ${M()??""}`),ne(Z,"active",L()==((et=D(o))==null?void 0:et.color))}),at(C,V)});var z=I(I(m,!0)),x=lt(z),T=lt(x),O=lt(T),k=I(O),$=I(k),A=I($),K=I(I(z,!0));return Se(K,()=>{var C;return(C=D(o))==null?void 0:C._id},C=>{var S=Ki();at(C,S)}),mt(()=>{var C,S,q,L,M,V;ne(b,"new",!((C=D(o))!=null&&C._id)),ft(O,"fill",(S=D(o))!=null&&S.note?"currentColor":"none"),ft(O,"stroke-width",(q=D(o))!=null&&q.note?"0":void 0),ft(k,"fill",(L=D(o))!=null&&L.note?"none":"currentColor"),ft($,"fill",(M=D(o))!=null&&M.note?"none":"currentColor"),ft(A,"fill",(V=D(o))!=null&&V.note?"none":"currentColor")}),gt("close",b,c,!1),at(t,b),bn(t,"svelte-1iojgl7",` .svelte-1iojgl7 { user-select: none; -webkit-user-select: none; @@ -189,7 +189,7 @@ transform: translateY(-3px); } } -`),he({get store(){return n()},set store(k){n(k),Rt()}})}Ie(Hr,{store:{}},[],[],!0);function Ki(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 Ji=(t,e)=>P(e,!1),Zi=ht(''),Qi=ht('
Upgrade to Pro to unlock annotation
'),ts=ht('
',1),es=ht('
');function Pr(t,e){de(e,!0);const n=[];let r=Re(e,"store",7),o,s,c=nt(!0);rn(()=>{e.store.draft?(P(c,!0),o==null||o.showModal()):o==null||o.close()});function v(T){const x=T.currentTarget.returnValue;T.currentTarget.returnValue="",setTimeout(x?e.store.draftSubmit:e.store.draftCancel,200)}function f(T){var x;cn()||(T.stopImmediatePropagation(),T.stopPropagation(),T.key=="Enter"&&!T.shiftKey&&(T.preventDefault(),s&&((x=T.currentTarget.closest("form"))==null||x.requestSubmit(s))))}var h=es();un(h,T=>o=T,()=>o),h.__mousedown=[Ki],mt(()=>oe(h,"mobile",cn()));var m=lt(h),_=lt(m),E=I(I(m,!0)),y=lt(E);ue(y,()=>e.store.draft,T=>{var x=ts(),A=Me(x);A.__click=[Ji,c];var K=lt(A);mt(()=>{var j,F;return Ve(K,((F=(j=e.store.draft)==null?void 0:j.text)==null?void 0:F.trim())||"")});var k=I(I(A,!0));En(k,73,()=>Vt,Wo,(j,F,V)=>{let J=()=>Q(Q(F))[0],ut=()=>Q(Q(F))[1];var B=Zi();Jo(B);var ot;mt(()=>{ot!==(ot=J())&&(B.value=(B.__value=J())==null?"":J()),ft(B,"style",`--color: ${ut()??""}`)}),ti(n,[],B,()=>(J(),e.store.draft.color),St=>e.store.draft.color=St),et(j,B)});var $=I(I(k,!0));Ko($),Go($),$.__keydown=f;var L=I(I($,!0));ue(L,()=>!e.store.pro,j=>{var F=Qi();et(j,F)}),mt(()=>{oe(A,"compact",D(c)),$.disabled=!e.store.pro}),Qo($,()=>e.store.draft.note,j=>e.store.draft.note=j),et(T,x)});var C=I(I(y,!0)),S=lt(C),z=I(I(S,!0));un(z,T=>s=T,()=>s);var O=lt(z);return mt(()=>{var T,x;Ve(_,`${((T=e.store.draft)!=null&&T._id?"Edit":"New")??""} highlight`),Ve(O,`${((x=e.store.draft)!=null&&x._id?"Update":"Create")??""} `)}),gt("close",h,v,!1),et(t,h),wn(t,"svelte-2yzs5z",` +`),ce({get store(){return n()},set store(C){n(C),Rt()}})}je(Pr,{store:{}},[],[],!0);function Zi(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 Qi=(t,e)=>H(e,!1),ts=bt(''),es=bt('
Upgrade to Pro to unlock annotation
'),ns=bt('
',1),rs=bt('
');function qr(t,e){ue(e,!0);const n=[];let r=Me(e,"store",7),o,s,c=tt(!0);en(()=>{r().draft?(H(c,!0),o==null||o.showModal()):o==null||o.close()});function h(k){const $=k.currentTarget.returnValue;k.currentTarget.returnValue="",setTimeout($?r().draftSubmit:r().draftCancel,200)}function d(k){var $;an()||(k.stopImmediatePropagation(),k.stopPropagation(),k.key=="Enter"&&!k.shiftKey&&(k.preventDefault(),s&&(($=k.currentTarget.closest("form"))==null||$.requestSubmit(s))))}var p=rs();ln(p,k=>o=k,()=>o),p.__mousedown=[Zi],mt(()=>ne(p,"mobile",an()));var _=lt(p),b=lt(_),E=I(I(_,!0)),m=lt(E);Se(m,()=>r().draft,k=>{var $=ns(),A=_n($);A.__click=[Qi,c];var K=lt(A);mt(()=>{var L,M;return We(K,((M=(L=r().draft)==null?void 0:L.text)==null?void 0:M.trim())||"")});var C=I(I(A,!0));wn(C,73,()=>Ut,Vo,(L,M,V)=>{let Z=()=>J(J(M))[0],et=()=>J(J(M))[1];var nt=ts();ti(nt);var ot;mt(()=>{ot!==(ot=Z())&&(nt.value=(nt.__value=Z())==null?"":Z()),ft(nt,"style",`--color: ${et()??""}`)}),ri(n,[],nt,()=>(Z(),r().draft.color),ht=>r().draft.color=ht),at(L,nt)});var S=I(I(C,!0));Qo(S),Zo(S),S.__keydown=d;var q=I(I(S,!0));Se(q,()=>!r().pro,L=>{var M=es();at(L,M)}),mt(()=>{ne(A,"compact",D(c)),S.disabled=!r().pro}),ni(S,()=>r().draft.note,L=>r().draft.note=L),at(k,$)});var z=I(I(m,!0)),x=lt(z),T=I(I(x,!0));ln(T,k=>s=k,()=>s);var O=lt(T);return mt(()=>{var k,$;We(b,`${((k=r().draft)!=null&&k._id?"Edit":"New")??""} highlight`),We(O,`${(($=r().draft)!=null&&$._id?"Update":"Create")??""} `)}),gt("close",p,h,!1),at(t,p),bn(t,"svelte-2yzs5z",` .svelte-2yzs5z { box-sizing: border-box; -webkit-tap-highlight-color: transparent; @@ -433,7 +433,7 @@ to { opacity: 1; } } } -`),he({get store(){return r()},set store(T){r(T),Rt()}})}kr(["mousedown","click","keydown"]);Ie(Pr,{store:{}},[],[],!0);const ns=(t,e)=>{const n=t.target.getAttribute("data-highlight");n&&(t.preventDefault(),e(n))};var rs=ht('
'),os=ht('');function qr(t,e){de(e,!0);let n=Re(e,"store",7);var r=zr(),o=Me(r);return ue(o,()=>e.store.nav,s=>{var c=os();c.__click=[ns,Ir],En(c,77,()=>e.store.highlights,(v,f)=>Q(v)._id,(v,f,h)=>{var m=rs();mt(()=>ft(m,"style",`top: var(--highlight-${Q(f)._id??""}-top); --color: ${(Vt.get(Q(f).color)||Q(f).color)??""}`)),mt(()=>ft(m,"data-highlight",Q(f)._id)),et(v,m)}),et(s,c)}),et(t,r),wn(t,"svelte-1t9y4ki",` +`),ce({get store(){return r()},set store(k){r(k),Rt()}})}xr(["mousedown","click","keydown"]);je(qr,{store:{}},[],[],!0);const os=(t,e)=>{const n=t.target.getAttribute("data-highlight");n&&(t.preventDefault(),e(n))};var is=bt('
'),ss=bt('');function Br(t,e){ue(e,!0);let n=Me(e,"store",7);var r=Jo(),o=_n(r);return Se(o,()=>n().nav,s=>{var c=ss();c.__click=[os,Fr],wn(c,77,()=>n().highlights,(h,d)=>J(h)._id,(h,d,p)=>{var _=is();mt(()=>ft(_,"style",`top: var(--highlight-${J(d)._id??""}-top); --color: ${(Ut.get(J(d).color)||J(d).color)??""}`)),mt(()=>ft(_,"data-highlight",J(d)._id)),at(h,_)}),at(s,c)}),at(t,r),bn(t,"svelte-1t9y4ki",` nav.svelte-1t9y4ki { all: unset; } @@ -458,4 +458,4 @@ width: 100%; background: var(--color); } -`),he({get store(){return n()},set store(s){n(s),Rt()}})}kr(["click"]);Ie(qr,{store:{}},[],[],!0);var is=ht(" ",1);function ss(t,e){de(e,!0);let n=Re(e,"store",7);rn(()=>{Ke(e.store.highlights)});let r;function o(){Ke(e.store.highlights),clearTimeout(r),r=setTimeout(()=>Ke(e.store.highlights),3e3)}rn(()=>qi);var s=is();gt("load",ze,o,!1),gt("popstate",ze,o,!1);var c=Me(s);Hr(c,{get store(){return e.store}});var v=I(I(c,!0));Pr(v,{get store(){return e.store}});var f=I(I(v,!0));return qr(f,{get store(){return e.store}}),et(t,s),he({get store(){return n()},set store(h){n(h),Rt()}})}customElements.define("rdh-ui",Ie(ss,{store:{}},[],[],!0));function ls(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 as(t){let e=!1;const n=new Set,r=ls(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 ne=document.createElement("rdh-ui");(async()=>{const t=await as(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(ne)||document.body.appendChild(ne):document.body.contains(ne)&&document.body.removeChild(ne));break;case"RDH_SCROLL":typeof n.payload._id=="string"&&Ir(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),re();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}}));ne.store=e,t({type:"RDH_READY",payload:{url:location.href}})})(); +`),ce({get store(){return n()},set store(s){n(s),Rt()}})}xr(["click"]);je(Br,{store:{}},[],[],!0);var ls=bt(" ",1);function as(t,e){ue(e,!0);let n=Me(e,"store",7);en(()=>{Xe(n().highlights)});let r;function o(){Xe(n().highlights),clearTimeout(r),r=setTimeout(()=>Xe(n().highlights),3e3)}en(()=>Wi);var s=ls();gt("load",Te,o,!1),gt("popstate",Te,o,!1);var c=_n(s);Pr(c,{get store(){return n()}});var h=I(I(c,!0));qr(h,{get store(){return n()}});var d=I(I(h,!0));return Br(d,{get store(){return n()}}),at(t,s),ce({get store(){return n()},set store(p){n(p),Rt()}})}customElements.define("rdh-ui",je(as,{store:{}},[],[],!0));function us(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 cs(t){let e=!1;const n=new Set,r=us(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 Qt=document.createElement("rdh-ui");(async()=>{const t=await cs(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(Qt)||document.body.appendChild(Qt):document.body.contains(Qt)&&document.body.removeChild(Qt));break;case"RDH_SCROLL":typeof n.payload._id=="string"&&Fr(n.payload._id);break;case"RDH_ADD_SELECTION":const r=Hr();if(!r)return;const o=e.find(r);if(!o)return;e.upsert(o),te();break;case"RDH_NOTE_SELECTION":console.log("not implemented yet");break}}),e=Vi(n=>t({type:"RDH_ADD",payload:n}),n=>t({type:"RDH_UPDATE",payload:n}),({_id:n})=>t({type:"RDH_REMOVE",payload:{_id:n}}));Qt.store=e,t({type:"RDH_READY",payload:{url:location.href}})})();