(()=>{"use strict";const{AbortController:n,FileReader:e,TextDecoder:t,atob:o,btoa:r,clearInterval:s,clearTimeout:a,crypto:i,decodeURIComponent:c,encodeURIComponent:l,escape:d,location:u,setInterval:h,setTimeout:p,unescape:m}=self;let{fetch:f}=self;const g=self,{addEventListener:b,removeEventListener:y}=(u.origin,u.host,self),v=b,{DOMParser:w,Notification:k,Image:j,Worker:x,alert:T,confirm:_,document:E,screen:U,webkitNotifications:S}=self;let A;try{A=self.localStorage}catch(n){}const R=A ;let{XMLHttpRequest:O}=self;const{clients:L}=self;let C=0;const z=[],I=()=>{const n=["debug"],e=["log"],t=["warn","info"],o=["error"],r=[...n,...e,...t,...o],s=o;C>=80&&s.push(...n),C>=60&&s.push(...e),C>=30&&s.push(...t),r.forEach((n=>D[n]=s.includes(n)?console[n].bind(console):()=>{}))},D={set:n=>{C=n,z.forEach((n=>{n(D,C)})),I()},get:()=>C,get verbose(){return(D.debug||(()=>{})).bind(console)},debug:()=>{},log:()=>{},warn:()=>{},info:()=>{},error:()=>{},addChangeListener:n=>{z.push(n)}};I() ;const M=globalThis;let N,B,q,P,{chrome:$,browser:H}=M;q=()=>{if(void 0!==N)return N;try{const n=navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);n&&(N=parseInt(n[2]))}catch(n){}return N},P=()=>{if(void 0!==B)return B;try{B=-1!=navigator.userAgent.search(/Android|Mobile/)}catch(n){}return B},q();const F=["chrome-extension:"];[].concat(["chrome"]);const V=(()=>{const n={getInternalPathRegexp:function(n,e){ const t=new RegExp("(\\"+["/",".","+","?","|","(",")","[","]","{","}","\\"].join("|\\")+")","g"),o=F[0]+"//"+V.id+"/";return new RegExp(o.replace(t,"\\$1")+"([a-zA-Z"+(n?"\\/":"")+"]*)"+(e||"").replace(t,"\\$1"))},getInternalPageRegexp:function(){return V.getInternalPathRegexp(!1,".html")},getPlatformInfo:n=>$.runtime.getPlatformInfo(n),getBrowserInfo:n=>{n({name:"Chrome",version:`${q()}`,vendor:"unknown"})}};return Object.defineProperty(n,"lastError",{get:()=>$.runtime.lastError,enumerable:!0 }),Object.defineProperty(n,"id",{get:()=>$.runtime.id,enumerable:!0}),Object.defineProperty(n,"short_id",{get:()=>n.id.replace(/[^0-9a-zA-Z]/g,"").substr(0,4),enumerable:!0}),n})(),G=Object.defineProperties({},{inIncognitoContext:{get:()=>{throw new Error("Not supported in offscreen context")},enumerable:!0},...Object.getOwnPropertyDescriptors({getURL:function(n){return $.runtime.getURL(n)},sendMessage:(n,e)=>$.runtime.sendMessage(n,e),onMessage:{addListener:n=>$.runtime.onMessage.addListener(n) },connect:n=>$.runtime.connect({name:n}),urls:{prepareForReport:function(n){return n}}})});let X=[];const J={},W={},Y={},Z=n=>{const e=(()=>{let n,e;const t=[],o=[],r=n=>{o.push(n),s()},s=()=>{if(void 0!==n){let t;for(;o.length;)t=o.shift(),void 0!==t.state&&t.state!==n||"function"==typeof t.f&&t.f.call(a,e)}},a={promise:()=>a,done:n=>(r({state:!0,f:n}),a),fail:n=>(r({state:!1,f:n}),a),always:n=>(r({f:n}),a),progress:n=>(n&&t.push(n),a),then:(n,t,o)=>Z((r=>{const s=(n,t)=>(...o)=>{ const s=n?n(e):void 0,a=s&&"function"==typeof s.promise?s.promise():null,i=s&&"function"==typeof s.then?s:null;if(a)a.done((n=>r.resolve(n))).fail(((...n)=>r.reject(n[0]))).progress(((...n)=>r.notify(...n)));else if(i)i.then(((...n)=>r.resolve(...n)),(n=>r.reject(n)));else{const e=n?[s]:o;r[t](e[0])}};a.done(s(n,"resolve")),a.fail(s(t,"reject")),a.progress(s(o,"notify"))})).promise(),each:n=>{const e=Z();return a.then((t=>{const o=Array.isArray(t)?t:[t];Z.when(o.map((e=>n(e)))).then(e.resolve) })),e.promise()},iterate:n=>{const e=Z();return a.then((t=>{const o=(Array.isArray(t)?t:[t]).map((e=>()=>n(e)));Z.onebyone(o,!0).done((n=>{e.resolve(n)})).fail(e.reject)})),e.promise()}};return{get:()=>a,try_resolve:t=>(void 0===n&&(n=!0,e=t),s(),a),try_reject:t=>(void 0===n&&(n=!1,e=t),s(),a),do_notify:n=>((n=>{t.forEach((e=>e(n)))})(n),a)}})(),t={promise:()=>e.get(),resolve:n=>e.try_resolve(n),reject:n=>e.try_reject(n),notify:n=>e.do_notify(n), consume:n=>(n&&n.promise?n.promise().done((n=>t.resolve(n))).fail(((...n)=>t.reject(n[0]))).progress((n=>t.notify(n))):n&&n.then?n.then((n=>t.resolve(n)),((...n)=>t.reject(n[0]))):D.warn("promise: incompatible object given to consume()",n),t.promise())};return n&&n(t),t};Z.Pledge=(...n)=>{const e=Z();return e.resolve(...n),e.promise()},Z.Breach=(...n)=>{const e=Z();return e.reject(n[0]),e.promise()},Z.onebyone=(n,e=!0)=>{const t=[],o=Z();let r=0;const s=()=>{if(r{t.push(n),s()})).fail((()=>{if(t.push(null),e)return o.reject();s()})):a&&a.then?a.then((n=>{t.push(n),s()}),(()=>{if(t.push(null),e)return o.reject();s()})):(t.push(a),s())}else o.resolve(t)};return s(),o.promise()},Z.or=n=>{let e;const t=Z(),o=()=>{n.length?(e=n.shift(),e&&Z.Pledge().then(e).done(t.resolve).fail(o)):t.reject()};return o(),t.promise()},Z.sidebyside=n=>{n=Array.isArray(n)?n:[n];const e=Z();let t=n.length;return t?n.forEach((n=>{ n&&n.promise&&n.promise().always((()=>{0==--t&&e.resolve()}))})):e.resolve(),e.promise()},Z.when=n=>{n=Array.isArray(n)?n:[n];const e=Z();let t=n.length;const o=[];return t?n.forEach((n=>{let r;if(n&&n.promise)r=n.promise();else{if(!n.then)return void D.warn("promise: incompatible object given to when()",n);r=n}r.fail((()=>{e.reject(),t=-1})).done((n=>{o.push(n),0==--t&&e.resolve(o)}))})):e.resolve(o),e.promise()},Z.all=n=>Z.when(n).then((()=>{})),Z.from=n=>{const e=Z() ;return n.then(e.resolve,e.reject),e.promise()},Z.heal=n=>n instanceof Array?Z.all(n.map((n=>Z.from(n).then((()=>{}),(()=>Z.Pledge()))))):Z.from(n).then((()=>{}),(()=>{})),Object.defineProperties(Promise.prototype,{done:{value:function(n){return this.then(((...e)=>n.apply(this,e)))},configurable:!0,enumerable:!0,writable:!1},fail:{value:function(n){return this.then((()=>{}),((...e)=>n.apply(this,e)))},configurable:!0,enumerable:!0,writable:!1},always:{value:function(n){ return this.then(((...e)=>n.apply(this,e)),((...e)=>n.apply(this,e)))},configurable:!0,enumerable:!0,writable:!1}});const K=Promise;let Q=0;const nn=async function(n,...e){await(()=>{const n=Date.now();if(Q+1e3p((()=>{Q=Date.now(),n()}),0)))})(),n.apply(this,e)},en=function(n,e){return e?p.apply(this,[n,e]):(nn.apply(this,[n]),0)},tn=n=>{const e=[],t=[],o=()=>{let r;if(t.length{let n;(n=t.indexOf(e))>-1&&t.splice(n,1),o()})),r.p.consume(e)}};return{add:function(n){const t=Z();return e.push({fn:n,p:t}),o(),t.promise()}}};var on;!function(n){n.TESTING="TESTING",n.AUDIO_PLAYBACK="AUDIO_PLAYBACK",n.IFRAME_SCRIPTING="IFRAME_SCRIPTING",n.DOM_SCRAPING="DOM_SCRAPING",n.BLOBS="BLOBS",n.DOM_PARSER="DOM_PARSER",n.USER_MEDIA="USER_MEDIA",n.DISPLAY_MEDIA="DISPLAY_MEDIA",n.WEB_RTC="WEB_RTC", n.CLIPBOARD="CLIPBOARD",n.LOCAL_STORAGE="LOCAL_STORAGE",n.WORKERS="WORKERS",n.BATTERY_STATUS="BATTERY_STATUS",n.MATCH_MEDIA="MATCH_MEDIA",n.GEOLOCATION="GEOLOCATION"}(on||(on={}));const rn=n=>{if(!w)throw new Error("DOMParser not available");return(new w).parseFromString(n,"text/xml")},sn=n=>{var e;let t;return n&&(t=(null===(e=n.firstChild)||void 0===e?void 0:e.nextSibling)?n.firstChild.nextSibling:n.firstChild),t},an=(n,e)=>{let t,o ;if((t=n.getElementsByTagNameNS("*",e)[0])&&(o=t.firstChild))return o.nodeValue||void 0},cn=n=>m(l(n)),ln=n=>c(d(n)),dn=n=>{let e="";for(let t=0;t{try{let t;t="object"==typeof e?e.encoding:e,t&&"utf-8"==t.toLowerCase()&&(n=cn(n));const o=new Uint8Array(n.length);for(let e=0;e{let e ;e=n.split(",")[0].includes("base64")?o(n.split(",")[1]):m(n.split(",")[1]);const t=n.split(",")[0].split(":")[1].split(";")[0];return new Blob([un(e)],{type:t})},pn=n=>new Promise((t=>{const o=new e;o.onload=n=>{var e;t((null===(e=n.target)||void 0===e?void 0:e.result)||void 0)},o.readAsDataURL(n)})),mn=async(n,t)=>new Promise((o=>{const r=new e;r.onload=()=>{o(r.result||"")},r.onerror=n=>{D.warn(`unable to decode data ${n}`),o(void 0)},t?r.readAsText(n,t):r.readAsBinaryString(n)}));var fn ;!function(n){n[n.OBJ_URL=1]="OBJ_URL",n[n.BLOB=2]="BLOB",n[n.BINARY=4]="BINARY",n[n.DATA_URI=8]="DATA_URI"}(fn||(fn={}));const gn=fn.OBJ_URL+0+fn.BINARY+fn.DATA_URI,bn=n=>void 0!==n.objUrl,yn=n=>void 0!==n.blob,vn=n=>void 0!==n.dataUri,wn=n=>void 0!==n.binary;class kn{constructor(n,e){if(bn(n)){this.objUrl=n.objUrl.url,this.type=n.objUrl.type;const e=n.objUrl.revoke;e&&(kn.objUrlDisposers[this.objUrl]=e)}else if(yn(n))this.blob=n.blob;else if(vn(n))this.dataUri=n.dataUri;else{ if(!wn(n))throw new Error("incompatible TransferableData");this.binary=n.binary,this.type=n.type}this.kinds=e||gn}async dispose(){if(this.objUrl){const n=kn.objUrlDisposers,e=n[this.objUrl];e?(delete n[this.objUrl],await e()):URL.revokeObjectURL(this.objUrl)}}async toTransferableData(){if(this.kinds&fn.OBJ_URL){if(!this.objUrl&&(!this.blob&&this.dataUri&&(this.blob=hn(this.dataUri)),this.blob&&(this.objUrl=URL.createObjectURL(this.blob)),!this.objUrl))throw new Error("incomplete Transferable") ;return{objUrl:{url:this.objUrl,type:this.type}}}if(this.kinds&fn.BLOB){if(!this.blob&&(this.objUrl?this.blob=await f(this.objUrl).then((n=>n.blob())):this.dataUri&&(this.blob=hn(this.dataUri)),!this.blob))throw new Error("incomplete Transferable");return{blob:this.blob}}if(this.kinds&fn.BINARY){if(void 0===this.binary){let n=this.blob;if(!n&&this.objUrl&&(n=await f(this.objUrl).then((n=>n.blob()))),n&&(this.binary=await mn(n),this.type=this.type||n.type), void 0===this.binary)throw new Error("incomplete Transferable")}return{binary:this.binary,type:this.type||"application/octet-stream"}}if(this.kinds&fn.DATA_URI){if(!this.dataUri){let n=this.blob;if(!n&&this.objUrl&&(n=await f(this.objUrl).then((n=>n.blob()))),n&&(this.dataUri=await pn(n)),!this.dataUri)throw new Error("incomplete Transferable")}return{dataUri:this.dataUri}}throw new Error("incompatible Transferable")}get tryObjectUrl(){return this.objUrl}get tryBlob(){return this.blob} get tryDataUri(){return this.dataUri}get tryBinary(){return this.binary}async toBlob(){if(this.blob)return this.blob;if(!this.objUrl){if(this.dataUri)return hn(this.dataUri);if(this.binary)return new Blob([un(this.binary)],{type:this.type||"application/octet-stream"});throw new Error("incompatible Transferable")}try{return await(await f(this.objUrl)).blob()}catch(n){return}}async toDataUri(){if(this.dataUri)return this.dataUri;{const n=await this.toBlob() ;if(!n)throw new Error("incompatible Transferable");return await pn(n)}}async toObjectUrl(){if(this.objUrl)return this.objUrl;{const n=await this.toBlob();if(!n)return;return this.objUrl=URL.createObjectURL(n)}}static fromTransferableData(n){return n&&(yn(n)||bn(n)||vn(n)||wn(n))?new kn(n):void 0}}kn.objUrlDisposers={};const jn=(n,e)=>{let t=!0;if("object"!=typeof n||"object"!=typeof e||null===n||null===e)return n===e ;for(const[o,r]of Object.entries(e))if(void 0!==r&&(t=void 0!==n[o]&&(null===r?null===n[o]:r instanceof RegExp?!!`${n[o]}`.match(r):"object"==typeof r?jn(n[o],r):n[o]===r),!t))break;return t},xn=(n,e)=>{const t=[];for(let o=0,r=n.length;o{const n={},{retimeout_on_get:e,timeout:t,check_interval:o,auto_remove_mutex:r}=Object.assign({retimeout_on_get:!1,timeout:300,check_interval:120},{timeout:180,check_interval:120,retimeout_on_get:!0}||{});let s;const i=()=>{c(),s=p(d,1e3*o)},c=()=>{s&&a(s),s=null},l=e=>{const t=n[e];return delete n[e],t?t.value:void 0},d=()=>{s=null;const e=Date.now()-1e3*t,o=Object.entries(n).filter((([n,t])=>t.ts{o.forEach((([n,e])=>{const t=e&&e.d ;t&&t.resolve([n,e.value]),l(n)})),r&&r.release(),i()})):i()};return t&&i(),{set:(e,t)=>{const o=Z();return n[e]={value:t,ts:Date.now(),d:o},o.promise()},get:(t,o)=>{const r=n[t];return r?(e&&(r.ts=Date.now()),r.value):o},remove:l,removeAll:()=>{Object.keys(n).map((n=>l(n)))}}})()),Un=["protocol","hostname","origin"],Sn=["port"],An=["pathname"],Rn=["search","hash"];let On;const Ln={protocol:"",scheme:"",origin:"",pathname:"",hostname:"",port:void 0,search:"",hash:""},Cn=(n,e)=>{ let t=Object.assign({},Ln);if(null==n);else if(["data:","view-source:"].some((e=>n.startsWith(e)))){t.origin="null";const e=n.indexOf(":");t.protocol=n.substr(0,e+1),t.pathname=n.substr(e+1)}else{let o,r;try{o=new URL(n)}catch(e){try{const e="http:";r="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(n=>{const e=16*Math.random()|0;return("x"==n?e:3&e|8).toString(16)})),o=new URL(n||"/",`${e}//${r}/${r}`)}catch(n){r=void 0}}if(o){ let{protocol:s,origin:a,pathname:i,hostname:c,port:l,search:d,hash:u,username:h,password:p}=o;if(r&&(s=a="",c===r&&(c=""),i=i.replace(`/${r}`,"")),t={protocol:s,origin:a,pathname:i,hostname:c,port:parseInt(l)||void 0,search:d,hash:u,username:h,password:p},!e&&s){if(0!==n.toLowerCase().indexOf(s))if(n.startsWith("//"))t.origin="",t.protocol="";else{if(!["/","?","#"].includes(n[0]))return Cn("/"+n);On=On||Cn("",!0),[...Rn,...An].forEach((n=>{On[n]===t[n]&&(t[n]="")})),Un.forEach((n=>{t[n]=""})), Sn.forEach((n=>{t[n]=void 0}))}["tampermonkey:"].includes(t.protocol)&&(t.pathname=((t.hostname?"/"+t.hostname:"")+(t.pathname||"")).replace(/^\/+/,"/"),t.hostname="")}}}return 0===t.port&&(t.port=void 0),Object.defineProperties(t,{domain:{get:function(){const n=t.hostname.split("."),e=n.pop();let o=`${n.pop()}.${e}`;return In(o)&&(o=`${n.pop()}.${o}`),o}},scheme:{get:function(){return t.protocol.replace(/:$/,"")}}}),t};let zn;const In=n=>(zn=zn||new RegExp("^("+_n.replace(/\./g,"\\.")+")$"), !!n.match(zn)),Dn=new class{constructor(n=1){if(this.waiting=[],n<0)throw new Error("Count must not be negative");this._count=n}acquire(){if(this._count>0)return this._count--,Z.Pledge();{const n=Z();return this.waiting.push(n.resolve),n.promise()}}release(){if(this.waiting.length>0){const n=this.waiting.shift();n&&n(void 0)}else this._count++}get count(){return this._count}}(1),Mn=new class{constructor(){this.events={}}on(n,e,t){const o=void 0===t||Array.isArray(t)?t:[t],{events:r}=this ;let s=r[n];return s||(s=[],r[n]=s),s.push({listener:e,filter:o}),()=>this.off(n,e)}once(n,e,t){const o=void 0===t||Array.isArray(t)?t:[t],r=this.on(n,((...n)=>(r(),e.bind(this)(...n))),o);return r}off(n,e){const t=this.events[n];t&&(this.events[n]=t.filter((n=>n.listener!==e)))}has(n,e){const t=this.events[n];return!!t&&t.some((n=>n.listener===e))}emit(n,...e){const t=this.events[n];if(t)for(const n of t){const{listener:t,filter:o}=n;if((!o||jn(e,o))&&!0===t(...e))return!0}return!1} listening(n,e){const t=this.events[n];if(t){if(e){const n=Array.isArray(e)?e:[e];return t.filter((e=>!e.filter||jn(e.filter,n))).length}return t.length}return 0}},Nn={};Mn.on("xhr",(function(n){let e,t;void 0!==(e=n.id)&&void 0!==(t=Nn[e])&&t.handle(n)&&delete Nn[e]}));class Bn{constructor(n){this.readyState=Bn.UNSENT,this.status=0,this.statusText="",this.responseType="",this.async=!0,this.timeout=-1,this.canceled=!1,this.loaded=0,this.headers={},this.onreadystatechange=null, this.onredirect=null,this.onopen=null,this.onload=null,this.onloadstart=null,this.onprogress=null,this.onabort=null,this.onerror=null,this.ontimeout=null,this.upload={onprogress:null,loaded:0,total:void 0},this.open=function(n,e,t=!0,o,r){if(this.method=n,this.url=e,this.async=t,this.user=o,this.password=r,this.responseURL=e,!this.async)throw new Error("Synchronous requests are not supported");this.onopen&&this.onopen(this)},this.send=async function(n){ this.mime_type&&(this.request_headers||(this.request_headers={}),this.request_headers["content-type"]||(this.request_headers["content-type"]=this.mime_type)),(this.user||this.password)&&(this.request_headers||(this.request_headers={}),this.request_headers.Authorization="Basic "+r((this.user||"")+":"+(this.password||"")));const e=this.method||"GET",t=this.url;if(!t)throw new Error("No URL specified");const o={method:e,url:t,headers:this.request_headers,timeout:this.timeout>0?this.timeout:void 0, anonymous:"withCredentials"in this?!this.withCredentials:this.options&&!!this.options.anonymous},s=n=>{this.method&&"POST"==this.method.toUpperCase()&&(this.request_headers||(this.request_headers={}),this.request_headers["content-type"]||(this.request_headers["content-type"]=n))};if(n){let e,t="";if(n instanceof Blob){e=n.size;const r=await mn(n);r?(o.data=dn(r),s(t)):(this.readyState=0,this.statusText="data read error",this.onerror&&this.onerror(this))}else e=n.length,t="text/plain", o.data=dn(cn(n));s(t),this.upload&&(this.upload.loaded=0,this.upload.total=e)}(async n=>{await Dn.acquire();try{let e;const t=await Promise.race([new Promise(((t,o)=>{e=p((()=>{e=void 0,o(`timeout: ${n.method}`)}),15e3)})),H.runtime.sendNativeMessage("application",n)]);return void 0!==e&&a(e),t}catch(n){throw console.error("sendNativeMessage",n),n}finally{Dn.release()}})({method:"xhr",id:this.id,details:o}),n&&this.upload&&this.upload.onprogress&&this.upload.onprogress.apply(this,[this.upload]) },this.abort=function(){this.canceled=!0,delete Nn[this.id],this.onabort&&this.onabort(this)},this.overrideMimeType=function(n){this.mime_type=n},this.getAllResponseHeaders=function(){const n=this.headers;return Object.keys(n).map((function(e){const t=n[e];return t&&t.includes(",")?t.split(",").map((function(n){return e+":"+n.trimStart()})).join("\r\n"):e+":"+t})).join("\r\n")},this.getResponseHeader=function(n){return this.headers[n]},this.setRequestHeader=function(n,e){ null!==e&&(this.request_headers||(this.request_headers={}),this.request_headers[n.trim().toLowerCase()]=e.trim())},this.toString=function(){return"[object XMLHttpRequest]"},this.handle=function(n){const e=n.data,t=()=>{this.onprogress&&this.onprogress(this)};if(e.timeout)this.ontimeout&&this.ontimeout.apply(this,[this]);else if(1==e.readyState&&"loaded"in e)this.upload&&this.upload.onprogress&&(this.upload.loaded=e.loaded||0,this.upload.total=e.total, this.upload.onprogress.apply(this,[this.upload]));else if(2==e.readyState&&301==e.status)Object.assign(this,e),this.onredirect&&this.onredirect(this);else if(e.readyState!=this.readyState){if(Object.assign(this,e),this.onreadystatechange&&this.onreadystatechange(this),4==e.readyState){const n=e.status;return n>=400?this.onload&&this.onload.apply(this,[this]):n>=300||(n>=200?this.onload&&this.onload.apply(this,[this]):n>=100||0===n&&this.onerror&&this.onerror.apply(this,[this])),!0} e.readyState>1?t():1==e.readyState&&this.onloadstart&&this.onloadstart.apply(this,[this])}else 3==e.readyState&&(Object.assign(this,e),t())},this.id=Date.now()+(Math.random()+1).toString(36).substring(7),this.options=n,Nn[this.id]=this}get lengthComputable(){return null!=this.total}get target(){return this}get response(){const n=Pn(this.responseData);if(null==n)return null ;const e=this.responseType?this.responseType.toLowerCase():"",t=(this.headers?this.headers["content-type"]:null)||"binary/octet-stream";return qn(n,e,t)}get responseText(){const n=Pn(this.responseData);return null==n?null:qn(n,this.mime_type?"binary":"text")}get responseXML(){const n=Pn(this.responseData);if(null==n)return null;const e=(this.headers?this.headers["content-type"]:null)||"";return qn(n,"document",e.split(";")[0])}}Bn.UNSENT=0,Bn.OPENED=1,Bn.HEADERS_RECEIVED=2,Bn.LOADING=3, Bn.DONE=4,Bn.toString=function(){return"[XMLHttpRequest]"};const qn=function(n,e,t){let o;if("arraybuffer"==e)o=un(n);else if("blob"==e)o=new Blob([un(n)],{type:t});else if("json"==e)o=JSON.parse(ln(n));else{if("document"==e)return"text/xml"==t&&w?(new w).parseFromString(n,t):null;if("text"==e||t&&(t.match(/charset=(utf[-_]?8)/i)||"text/html"==t))try{o=ln(n)}catch(e){o=n}else o=n}return o},Pn=n=>{try{if(void 0===n)return;return o(n)}catch(n){return void console.warn("XmlHttpRequest:",n)}} ;let $n={},Hn=()=>K.resolve({done:()=>{}});const Fn=["internal","user-agent","accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"],Vn={"cache-control":"no-cache",pragma:"no-cache"},Gn={"cache-control":"max-age=0, must-revalidate"},Xn=n=>{const e={},t={};return Object.keys(n).forEach((o=>{ let r=o,s=n[o];var a;a=o.toLowerCase(),Fn.includes(a)||0===a.indexOf("proxy-")||0===a.indexOf("sec-")?t[r]=s:e[r]=s})),{...Object.keys(t).length?{forbidden:t}:{},...Object.keys(e).length?{regular:e}:{}}},Jn=n=>({responseText:"",response:null,readyState:4,responseHeaders:"",status:0,statusText:"",error:n=n||"Forbidden"}),Wn=n=>n&&"object"==typeof n&&"type"in n&&"value"in n,Yn=n=>{if("Blob"===n.type)return new Blob([un(n.value)]);if("File"===n.type){if(!n.name)return ;return new File([un(n.value)],n.name,{type:n.meta,lastModified:n.lastModified||Date.now()})}if("FormData"==n.type){const e=new FormData;return n.value.forEach((({name:n,value:t})=>{const o=Yn(t);void 0!==o?e.append(n,o):D.warn("Unable to un-typify value for FormData field",t)})),e}if("URLSearchParams"===n.type)return new URLSearchParams(n.value);if("Array"===n.type||"Object"===n.type){let e,t,o;"Object"===n.type?(o=Object.keys(n.value),t=n=>ne{const l=w,d=!e.redirect||"follow"===e.redirect;let u,h,m,g;const b=(n,t,o)=>{const r=[];let s;const a=o||n.headers;if(a){const t=[],o=[];a.forEach(((n,e)=>{const a=e.toLowerCase();a.startsWith(Kn)?t.push(n):"set-cookie"===a?o.push(n):a===Zn?s=n:r.push(a+":"+n)})), s=d?s||n.url:e.url,(t.length?t:o).forEach((n=>r.push("set-cookie:"+n)))}const i=void 0===t?4:t,c=n.status||0,l=n.statusText||"";return{readyState:i,responseHeaders:r.join("\r\n"),finalUrl:s,status:c,statusText:l}},y=(n,e,t)=>Object.assign(t||{},{lengthComputable:void 0!==n,loaded:n,done:n,position:n,total:e,totalSize:e}),v=n=>{let e;g&&g(),h||(m?(e=b({status:408,statusText:"Request Timeout"}),i("ontimeout")):"AbortError"==(null==n?void 0:n.name)?(e=Jn("aborted"),i("onabort",e)):(e=b({status:408, statusText:(null==n?void 0:n.message)||"Request Timeout"}),i("onerror",e)),h=!0,i("ondone",e))},k=e.responseType?e.responseType.toLowerCase():"";if("document"==k&&!l)return void v({name:"Error",message:"response type not supported"});const j=async(n,e,t)=>{let r;if(t)r=n;else{const e=n;if(!o.no_blob&&!o.foreign_context){let n;return n=new kn({blob:e},fn.OBJ_URL),c("onpartial",{tfd:await n.toTransferableData()}),void p((()=>n.dispose()),3e5)}{const n=await mn(e) ;if(!n)return void D.warn("xhr: failed to convert blob to binary text");r=n}}const s=xn(r,e);s.forEach(((n,e)=>{c("onpartial",{partial:n,index:e,length:s.length})}))};let x=!1;const T=n=>{n&&(m=!0),_?_.abort():m?v():v({name:"AbortError",message:"Aborted by user"})};let _;return(async()=>{try{const E={};E.method=e.method||"GET";const U=(n=>{if(null==n)return;let e=En.get(n);return e||(e=Cn(n),En.set(n,e),e)})(e.url);let S,A;if(U){let n=!1;U.username&&(e.user=e.user||U.username,n=!0), U.password&&(e.password=e.password||U.password,n=!0),S=n?(m=U,((w=w||{}).noprotocol?"":["about:"].includes(m.protocol)?m.protocol:m.protocol+"//")+(w.auth&&(m.username||m.password)?((n,e)=>{const t=n=>n.replace(/[^A-Za-z0-9-._~!$&'()*+,;=]/g,(n=>"%"+n.charCodeAt(0).toString(16).toUpperCase()));return t(n)+(e?":"+t(e):"")+"@" })(m.username||"",m.password)+"@":"")+m.hostname+(!w.noport&&m.port&&m.port>0?":"+m.port:"")+(w.nopath?"":w.nofile?m.pathname.replace(/\/[^/]*$/,"/"):m.pathname+(w.nosearch?"":m.search))):e.url}else S=e.url;if(e.headers){let{forbidden:n,regular:t}=Xn(e.headers);A=t,n&&D.warn("xhr: setting forbidden headers in non-bg environment is not supported!",n)}if(d||(E.redirect=e.redirect,D.warn("xhr: setting redirect in non-bg environment is not supported!",e.redirect)),!g){ const{done:n}=await Hn(E.method);g=()=>{n(),g=void 0}}e.nocache?E.cache="reload":e.revalidate&&(E.cache="default",A=A||{},A={...A,...Gn}),e.anonymous?E.credentials="omit":E.credentials="include",e.user&&e.password&&(A=A||{},A.Authorization="Basic "+r(e.user+":"+e.password)),A&&(E.headers=new Headers(A)),void 0!==e.data&&null!==e.data&&(Wn(e.data)&&"typified"===e.data_type?E.body=Yn(e.data):"string"==typeof e.data?E.body=e.data:E.body=JSON.stringify(e.data)),_=n?new n:void 0, _&&(E.signal=_.signal),i("onloadstart",b({status:0,statusText:""},1)),f(S,E).then((async n=>{var r,d,p;let m;if(u&&(a(u),u=null),g&&g(),h)return;let f=b(n,void 0,m);if(f.status>0&&(f.status<200||f.status>=399)&&s>0)return void Qn(e,t,o,s-1,i,c);const{partialSize:v,overrideMimeType:w,responseType:T}=e;if(n.ok)if(c("onreadystatechange",b(n,2,m)),"stream"==k){const t=null===(r=n.body)||void 0===r?void 0:r.getReader();if(t)for(;;){const{done:n,value:o}=await t.read();if(o){const n=new Blob([o]) ;await j(n,parseInt(e.partialSize),!1)}if(n)break}}else{const t=await(async(n,e)=>{var t;const o=null===(t=n.body)||void 0===t?void 0:t.getReader();if(o){const t=[];let r=0;const s=parseInt(n.headers.get("Content-Length")||"-1");for(;;){const{done:a,value:i}=await o.read();if(i&&(t.push(i),r+=i.length,await c("onprogress",(async()=>{const t=b(n,3,e);return y(r,s,t)}))),a)break}const a=new Uint8Array(r);let i=0;for(const n of t)a.set(n,i),i+=n.length;return a}{const t=await n.arrayBuffer() ;return await c("onprogress",(async()=>{const o=b(n,3,e);return y(t.byteLength,t.byteLength,o)})),new Uint8Array(t)}})(n,m),o=null===(d=n.headers)||void 0===d?void 0:d.get("Content-Type"),r=((null===(p=w||o)||void 0===p?void 0:p.toLowerCase().match(/charset=([^;]+)/))||[])[1],s=()=>new Blob([t],{type:w||o||"binary/octet-stream"});if(v){let n;["arraybuffer","blob"].includes(k)||void 0!==w?(f.response=s(),n=!1):(f.response=await mn(s(),r||"utf-8"),n=!0),f=await(async(n,t)=>{if(e.partialSize){ const o=n.response;["response","responseText","responseXML"].forEach((e=>{delete n[e]})),!x&&o&&(x=!0,await j(o,parseInt(e.partialSize),t))}return n})(f,n)}else if(void 0!==T){let n;if("arraybuffer"==k)f.response=t.buffer;else if("blob"==k)f.response=s();else if("document"==k){n=(o||"text/xml").toString().split(";")[0];const e=new l,t=await mn(s(),r||"utf-8");f.response=e.parseFromString(t||"",n)}else if("json"==k){const n=await mn(s(),r||"utf-8");f.response=JSON.parse(n||"") }else D.warn("xhr: responseType",k," is not implemented!"),f.responseText=f.response=await mn(s(),r||"utf-8")}else{const n=await mn(s(),r||"utf-8");f.responseText=f.response=n}}else if(f.responseXML=void 0,"follow"!==e.redirect&&"opaqueredirect"==n.type){const e=b(n,2,m);e.responseText=e.response=f.responseText=f.response=void 0,e.status=f.status=301,c("onreadystatechange",e)}else{c("onreadystatechange",b(n,2,m));try{if("stream"==k){const t=await n.text(),o=new Blob([t]) ;await j(o,parseInt(e.partialSize),!1)}else f.responseText=f.response=await n.text()}catch(n){}}i("onreadystatechange",f),i("onload",f),i("ondone",f)})).catch((async n=>{v(n)})),void 0!==e.timeout&&null!==e.data&&(u=p((()=>{u=null,T(!0)}),e.timeout))}catch(n){g&&g();const e=n;D.error(e.message,e.stack);const t=Jn(e.message);i("onerror",t),i("ondone",t)}var m,w})(),{abort:()=>T()}},ne=(n,e,t,o,r,s)=>{const a=n.responseType?n.responseType.toLowerCase():"";let i,c;n.anonymous&&(i=$n.mozAnon?{ mozAnon:!0}:{anonymous:!0});const l=O;if(!l)throw new Error("internal error: XMLHttpRequest not available!");const d=new l(i),u=e=>{let t="",o=n.url;if(d.readyState>=2){let n;t=d.getAllResponseHeaders(),t&&(t=t.replace(/tm-finalurl[0-9a-zA-Z]*: .*[\r\n]{1,2}/i,""),t=t.replace(/tm-setcookie[0-9a-zA-Z]+-[0-9]+:/gi,"set-cookie:")),(n=d.getResponseHeader(Zn)||d.responseURL)&&(o=n)}const r={readyState:d.readyState,responseHeaders:t,finalUrl:o,status:d.readyState>=2?d.status:0, statusText:d.readyState>=2?d.statusText:""};return e&&4==d.readyState?d.responseType?(r.responseXML=void 0,r.responseText=void 0,r.responseType=d.responseType,r.response=d.response):(r.responseXML=d.responseXML||void 0,r.responseText=d.responseText,r.response=d.response):(r.responseXML=void 0,r.responseText="",r.response=void 0),r};let h=!1;const m=async e=>{if(n.partialSize){const o=e.response,r=!["arraybuffer","blob"].includes(a);["response","responseText","responseXML"].forEach((n=>{ delete e[n]})),!h&&o&&(h=!0,await(async(n,e,o)=>{let r;if(o)r=n;else{const e=n;if(!t.no_blob&&!t.foreign_context){let n;return n=new kn({blob:e},fn.OBJ_URL),s("onpartial",{tfd:await n.toTransferableData()}),void p((()=>n.dispose()),3e5)}{const n=await mn(e);if(!n)return void D.warn("xhr: failed to convert blob to binary text");r=n}}const a=xn(r,e);a.forEach(((n,e)=>{s("onpartial",{partial:n,index:e,length:a.length})}))})(o,parseInt(n.partialSize),r))}return e},f=tn({threads:1 }),g=n=>e=>f.add((()=>n(e)));return(async()=>{n.method=n.method||"GET";const{done:i}=await Hn(n.url,n.method),l=async n=>{await r("ondone",n),i()},h={onload:g((async()=>{let a=u(!0);a.status>0&&(a.status<200||a.status>=300)&&o>0?ne(n,e,t,o-1,r,s):(n.partialSize&&(a=await m(a)),await r("onload",a),4==a.readyState&&await l(a))})),onerror:g((async()=>{const a=u();4==a.readyState&&200!=a.status&&0!=a.status&&o>0?ne(n,e,t,o-1,r,s):(await r("onerror",a),await l(a))})),onloadstart:g((async()=>{ await s("onloadstart",(()=>u()))})),onreadystatechange:g((async()=>{await s("onreadystatechange",(async()=>{let n=u();return n=await m(n),n}))})),onredirect:g((async()=>{await s("onredirect",(()=>u()))})),onprogress:g((async n=>{await s("onprogress",(async()=>{let e=u();return e=await m(e),b(n,e)}))})),ontimeout:g((async()=>{const n=u();await r("ontimeout"),await l(n)})),onabort:g((async()=>{const n=Jn("aborted");await r("onabort"),await l(n)}))},p={onuploadprogress:g((async n=>{ await s("onuploadprogress",(async()=>b(n)))}))},f=0==Object.keys(h).concat(["ondone"]).filter((n=>!!e[n])).length;if(f)throw new Error("Synchronous XHR is not supported anymore");const b=(n,e)=>{let t,o,r,s,a,i;try{if(n.lengthComputable||n.total>0)t=n.loaded,o=n.total;else if(e){const r=!d.responseType||["","text"].includes(d.responseType)?d.responseText:null;let s=Number((n=>{const e={};return n&&n.split("\n").forEach((n=>{const t=n.match(/^([^:]+): ?(.*)/);if(t){const n=t[1].toLowerCase() ;e[n]=(void 0!==e[n]?e[n]+",":"")+(t[2]||"").replace(/,/g,"%2C")}})),e})(e.responseHeaders)["content-length"]||"");const a=e.readyState>2&&r?r.length:0;0==s&&(s=-1),t=n.loaded||a,o=n.total||s}s=n.lengthComputable,r=t,a=t,i=o}catch(n){}return Object.assign(e||{},{lengthComputable:s,loaded:r,done:t,position:a,total:o,totalSize:i})},y=["ontimeout","onload","onerror","onabort"];Object.keys(h).forEach((n=>{(e[n]||y.includes(n))&&(d[n]=h[n])}));const v={onuploadprogress:"onprogress"} ;d.upload&&Object.keys(p).forEach((n=>{const t=v[n];t&&e[n]&&(d.upload[t]=p[n])}));try{let e;if(d.open(n.method,n.url,!f,n.user,n.password),n.headers){const{forbidden:t,regular:o}=Xn(n.headers);e={...o,...t}}(n.nocache||n.revalidate)&&(e=e||{},n.nocache?e={...e,...Vn}:n.revalidate&&(e={...e,...Gn})),e&&Object.keys(e).forEach((n=>{try{d.setRequestHeader(n,e[n])}catch(t){D.warn("xhr: rejected header",n,e[n])}})),void 0!==n.overrideMimeType&&d.overrideMimeType(n.overrideMimeType), n.partialSize?["arraybuffer","blob"].includes(a)?d.responseType=n.responseType="blob":delete n.responseType:void 0!==n.responseType&&(c=n.responseType.toLowerCase(),"xml"!=c&&"headers"!=c&&"stream"!=c&&(d.responseType=c)),void 0!==n.timeout&&(d.timeout=n.timeout),void 0!==n.data?Wn(n.data)&&"typified"===n.data_type?d.send(Yn(n.data)):"string"==typeof n.data?d.send(n.data):d.send(JSON.stringify(n.data)):d.send()}catch(n){const e=n;D.error(e.stack);const t=Jn(e.message);r("onerror",t),await l(t)} })(),{abort:function(){d.abort()}}},ee="mtm_visitor",te="default",oe="pageview",re="script_update",se="script",ae="cloud",ie="event",ce="pageview",le="ping",de="https://a.tampermonkey.net/matomo.php",ue=R;let he,pe,me,fe=null;const ge=()=>({url:de,siteId:4,tracker:{[te]:{enabled:Se(4,1)},[se]:{enabled:!0},[re]:{enabled:Se(4,10)},[ae]:{enabled:Se(4,5e-4)}}}),be=()=>({url:de,siteId:5,tracker:{[te]:{enabled:Se(5,10)},[se]:{enabled:!0},[re]:{enabled:Se(5,10)},[ae]:{enabled:Se(5,.001)}}}),ye=()=>({ url:de,siteId:6,tracker:{[te]:{enabled:Se(6,50)},[se]:{enabled:!0},[re]:{enabled:Se(6,10)},[ae]:{enabled:Se(6,.01)}}}),ve=()=>({url:de,siteId:7,tracker:{[te]:{enabled:!0},[se]:{enabled:!0},[re]:{enabled:Se(7,10)},[ae]:{enabled:Se(7,.01)}}}),we={default:be,gcal:be,iikm:ge,fcmf:ge,saap:ve,swgx:ve,fire:ye,firb:ye,dhdg:()=>({url:de,siteId:3,tracker:{[te]:{enabled:Se(3,1)},[se]:{enabled:!0},[re]:{enabled:Se(3,10)},[ae]:{enabled:Se(3,5e-4)}}}),mfdh:be,heif:()=>({ url:"http://a.userscript.grobilan:8081/matomo.php",siteId:2,tracker:{[te]:{enabled:!0}}})};let ke;const je=[{msg:"a disconnected port"},{msg:"Function.prototype.apply: Arguments list has wrong type",url:"event_bindings"},{msg:"Script error."}],xe=n=>[...Array(n)].map((()=>Math.floor(16*Math.random()).toString(16))).join(""),Te=n=>{if(!ue)return;const e=[n.uuid,n.createTs,n.visitCount,n.currentVisitTs,n.lastVisitTs].join(".");ue.setItem(ee,e)},_e=n=>{const e=n||te,t=ke.tracker[e]||ke.tracker[te] ;return t.enabled?{url:ke.url,siteId:ke.siteId,options:t}:null},Ee=xe(6),Ue=async(n,e,t)=>{if(!n)return;const o=(()=>{if(!ue)return;const n=ue.getItem(ee);if(!n)return;const e=n.split(".");if(e.length>=5){e.unshift("0");const[n,t,o,r,s,a]=e;return{createdNow:!1,newVisitor:n,uuid:t,createTs:o,visitCount:r,currentVisitTs:s,lastVisitTs:a}}})()||(()=>{const n=Math.floor(Date.now()/1e3).toString(),e={createdNow:!0,newVisitor:"1",uuid:xe(16),createTs:n,visitCount:"0",currentVisitTs:n,lastVisitTs:""} ;return Te(e),e})();let r;const s=new Date,a={idsite:n.siteId,rec:1,action_name:E?E.title:u.href||V.short_id,url:u.href,_id:o.uuid,rand:xe(4),apiv:1,h:s.getHours(),m:s.getMinutes(),s:s.getSeconds(),cookie:1,pv_id:Ee},i={...a,_idts:Number(o.createTs),_idvc:Number(o.visitCount),_viewts:Number(o.lastVisitTs),res:U?`${U.width}x${U.height}`:"0x0"};if(e==ce){const n=pe?{gt_ms:pe}:{},e={...a,...i,...n,new_visit:1};Te((n=>{const e=Math.floor(Date.now()/1e3).toString();return n.newVisitor="0", n.visitCount=(Number(n.visitCount)+1).toString(),n.lastVisitTs=n.currentVisitTs,n.currentVisitTs=e,n})(o)),r=e}else if(e==ie){if(!t)return;r={...a,ca:1,e_c:t.category,e_a:t.action,e_n:t.name,e_v:t.value}}else{if(e!=le)return;r={...a,...i,ping:1}}r=Object.assign(a,r);const c=`${n.url}?${d=r,Object.entries(d).map((([n,e])=>void 0===e?null:l(n)+"="+l(e))).filter((n=>n)).join("&")}`;var d;if(E){const n=E.createElement("img");n.src=c,n.onload=()=>{var e ;null===(e=n.parentNode)||void 0===e||e.removeChild(n)},n.onerror=()=>{var e;null===(e=n.parentNode)||void 0===e||e.removeChild(n)},(E.body||E.head||E.documentElement).appendChild(n)}else try{await f(c)}catch(n){D.warn("stats:",n)}},Se=(n,e)=>{let t=100*Math.random(){if(!await(null===fe&&Re?Re.promise():Z.Pledge(!!fe)))return;void 0===t&&(e+=" "+u.href,t="");let o=!1;for(const t of je){if(!t.msg&&!t.url)return;t.msg&&-1==n.indexOf(t.msg)||t.url&&-1==e.indexOf(t.url)||(o=!0)}o||Ue(_e("error"),ie,{category:"Error",action:n,name:e+":"+t})},Le=tn({threads:3});((n,e)=>{Ae=`${(null==e?void 0:e.version)||""} `;const t=V.short_id;ke=(we[t]||we[te])(),v("error",(n=>{const{message:e,filename:t,lineno:o,colno:r,error:s}=n ;((n,e,t,o,r)=>{let s="";if(r)try{s=r.stack||""}catch(n){}Oe(n.toString(),Ae+"off@"+G.urls.prepareForReport(e||""),[t+":"+o,s].join(";"))})(e,t,o,r,s)}));const o=n=>{let e="";try{e=n.stack}catch(n){}Oe("CSP violation of "+n.effectiveDirective,Ae+"off@"+G.urls.prepareForReport(n.documentURI),[n.sourceFile," -> ",n.lineNumber+":"+n.columnNumber,e].join(";"))};E?E.addEventListener("securitypolicyviolation",(n=>o(n))):v("securitypolicyviolation",(n=>o(n))), (null==e?void 0:e.started)&&(pe=Date.now()-e.started.getTime())})(0,{version:"?"});let Ce=()=>{const n=Z();return(e=>{const t="string"==typeof e?[e]:e,o=()=>{t.every((n=>!!Y[n]))?(Ce=Z.Pledge,n.resolve()):X.push(o)};t.forEach((n=>{if(void 0===Y[n]&&void 0===J[n]){const e=p((()=>{W[n]||(delete J[n],(n=>{W[n]=!0})(n),((n,e)=>{let t=1;const o=()=>{0==--t&&e&&e()};("string"==typeof n?[n]:n).forEach((n=>{t++;try{!function(n,e){{const t=document.createElement("script");t.setAttribute("src",n), e&&(t.onload=()=>e(!0),t.onerror=()=>e(!1)),(document.head||document.body||document.documentElement||document).appendChild(t)}}(n,(e=>{e||D.warn("registry: self.load "+n+" failed! "),o()}))}catch(e){D.warn("registry: self.load "+n+" failed! ",e),o()}})),o()})(G.getURL(n+".js"),(()=>{(n=>{if(!Y[n]){let e;Y[n]=!0,delete W[n],(e=J[n])&&e(),(()=>{const n=X;X=[];for(const e of n)e()})()}})(n)})))}),0);J[n]=()=>{a(e),delete J[n]}}})),o()})(["vendor/saveas/filesaver"]),n.promise()};const ze=(()=>{ const n=[],e=[];let t;const o=()=>{if(!t||Me&&!e.length)return;const n=e.shift();t({result:n,poll:Me||e.length?1:0}),t=void 0};return{send:n=>{e.push(n),o()},message:(r,s)=>{const{details:a}=r;if("message"in a){const{message:e}=a;n.forEach((n=>{n(e)}))}if(t){const n=e.length;t({result:void 0,poll:n?1:0})}t=s,o()},onMessage:{addListener:e=>{n.push(e)}}}})(),Ie=(n=>{const e={};let t;const o=t=>{let o=[],s=[];const a=()=>{o=[],s=[],i=null,delete e[t]};let i={postMessage:e=>{(e=>{ if(!i)throw"port is disconnected";n.send({response_id:t,value:e})})(e)},onMessage:{addListener:n=>{o.push(n)}},onDisconnect:{addListener:n=>{s.push(n)}},disconnect:()=>{a(),r(t)}};return e[t]={message:n=>{o&&o.forEach((e=>e(n)))},disconnect:()=>{s.length&&s.forEach((n=>n())),a()}},i},r=e=>{n.send({response_id:e,disconnect:!0})};return n.onMessage.addListener((n=>{let r;if(n.connect){if(!n.destination||!n.response_id)throw"invalid message";t&&t(n.destination,o(n.response_id))}else{ if(!n.response_id)throw"invalid message";if(!(r=e[n.response_id]))return void console.warn("ports: unknown id",n.response_id,n);if(n.disconnect)r.disconnect();else{const e=n.value;e&&r.message(e)}}})),{connect:function(e){const t=Math.random().toString(36).slice(2);return((e,t)=>{n.send({response_id:t,connect:!0,destination:e})})(e,t),o(t)},onConnect:{addListener:n=>{t=n}}}})(ze),De=async(n,e)=>{const{action:t}=n;if("port"===t)ze.message(n,e);else if("download"===t){ const{details:t,id:o}=n,{name:r,tfd:s}=t,a=kn.fromTransferableData(s),i=a&&await a.toBlob();if(!i)return console.warn("downs: invalid transferable"),void e({result:{id:o,error:"not_supported"}});Ce().then((async()=>{const n=g.saveAs;return n?Le.add((async()=>{var t;n(i,r),await(t=500,new K((n=>en(n,t)))),e({result:{id:o,mode:"native"}})})):(e({result:{id:o,error:"failed"}}),void console.warn("Unable to load saveAs!"))}))}else if("config"===t){const{config:t,version:o}=n;Ae=o, t.statistics_enabled&&(fe=!0,Re&&(Re.resolve(fe),Re=void 0),fe?(he&&(Ue(_e(oe),ce),he=!1),me=h((()=>Ue(_e(oe),le)),864e5)):me&&(s(me),me=void 0)),e({result:!0})}else if("objectURL"===t){const{blob:t,url:o}=n;if(t){const n=URL.createObjectURL(t);e({result:{url:n}})}else o?(URL.revokeObjectURL(o),e({result:{}})):e({error:"invalid_request"})}else{const{doc:o}=n;if("xmlToWebdavResults"===t){const n=await(async n=>{if(w){const e=rn(n);let t;if(!e||!(t=sn(e))||!t.childNodes)return;return(async n=>{ const e=[],t=n.getElementsByTagNameNS("*","response");for(let n=0;n=0?c:void 0,removed:-1==c};e.push(n)}}return e})(t)}throw new Error("DOMParser not available")})(o);e({result:n})}else if("xmlToCursor"===t){const n=await(async n=>{if(w){const e=rn(n);let t;if(!e||!(t=sn(e))||!t.childNodes)return;return(n=>an(n,"td:cursor"))(t)}throw new Error("DOMParser not available")})(o);e({result:n})}else if("xmlToResponseCodes"===t){const n=await(async n=>{if(w){const e=rn(n);if(!e)return;return(n=>{var e;let t,o,r,s ;if((t=n.childNodes[0])&&(o=t.getElementsByTagNameNS("*","status")[0])&&(r=null===(e=o.firstChild)||void 0===e?void 0:e.nodeValue)&&(s=r.match(/HTTP\/[0-9.]+ ([1-5][0-9][0-9])/)))return[parseInt(s[1])]})(e)}throw new Error("DOMParser not available")})(o);e({result:n})}else console.warn("offscreen: unknown action",t),e({error:"unknown_action"})}};let Me=0;const Ne={};Ie.onConnect.addListener(((n,e)=>{if(Me++,"xhr"===n){const n=Math.random().toString(36).slice(2),t=()=>{const e=Ne[n];e?(e.abort(), delete Ne[n]):console.log("offscreen: xhr already deleted",n)};e.onMessage.addListener((o=>{if("abort"in o)t();else{const{details:t,options:r,callbacks:s}=o,a={};for(const n of Object.keys(s)){const t=t=>{e.postMessage({data:t,type:n})};a[n]=t}const i=a.ondone;a.ondone=t=>{i&&i(t),delete Ne[n],e.disconnect()},Ne[n]=((n,e,t)=>{const o={...e||{}},r=async(n,e)=>{const t=o[n];t&&t("function"==typeof e?await e():e)},s=async(n,e)=>{o[n]&&(await r(n,e),o[n]=void 0)};if(!(t=t||{}).internal&&(a=n.url, !["https:","http:","data:","blob"].some((n=>a.startsWith(n))))){D.warn("xhr: invalid scheme of url:",n.url);const e=Jn("Invalid scheme");return s("onerror",e),void s("ondone",e)}var a;const i=void 0!==n.responseType?n.responseType.toLowerCase():void 0,c=n.redirect&&"follow"!==n.redirect,l=!$n.mozAnon&&n.anonymous||"stream"==i||c||!n.partialSize&&i||"typified"===n.data_type,d=n.fetch||!1;return l||d?Qn(n,o,t,n.retries||0,s,r):ne(n,o,t,n.retries||0,s,r)})(t,a,r)}})), e.onDisconnect.addListener((()=>{t(),r||(r=!0,Me--)}));const o=e.disconnect;let r=!1;e.disconnect=()=>{r||(r=!0,o(),Me--)}}})),G.onMessage.addListener(((n,e,t)=>{const{target:o,method:r,request:s}=n;if("offscreen"===o&&"offscreen"===r){let n=!1;if(De(s,(e=>{n=!0,void 0!==e&&t(e)})),!n)return!0}})),navigator.serviceWorker.onmessage=n=>{De(n.data,(e=>{n.ports[0].postMessage(e)}))}})();