Files
s-informer-sur-la-tech-www/.obsidian/plugins/obsidian-importer/main.js

291 lines
653 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
"use strict";var Mg=Object.create;var Zi=Object.defineProperty;var $g=Object.getOwnPropertyDescriptor;var Bg=Object.getOwnPropertyNames;var qg=Object.getPrototypeOf,jg=Object.prototype.hasOwnProperty;var te=(r,t)=>()=>(t||r((t={exports:{}}).exports,t),t.exports),ot=(r,t)=>{for(var e in t)Zi(r,e,{get:t[e],enumerable:!0})},Rc=(r,t,e,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Bg(t))!jg.call(r,i)&&i!==e&&Zi(r,i,{get:()=>t[i],enumerable:!(n=$g(t,i))||n.enumerable});return r};var Yn=(r,t,e)=>(e=r!=null?Mg(qg(r)):{},Rc(t||!r||!r.__esModule?Zi(e,"default",{value:r,enumerable:!0}):e,r)),Ug=r=>Rc(Zi({},"__esModule",{value:!0}),r);var Bs=te((u_,dp)=>{"use strict";dp.exports=Mb;function Mb(r,t){for(var e=new Array(arguments.length-1),n=0,i=2,a=!0;i<arguments.length;)e[n++]=arguments[i++];return new Promise(function(l,s){e[n]=function(u){if(a)if(a=!1,u)s(u);else{for(var p=new Array(arguments.length-1),f=0;f<p.length;)p[f++]=arguments[f];l.apply(null,p)}};try{r.apply(t||null,e)}catch(c){a&&(a=!1,s(c))}})}});var gp=te(hp=>{"use strict";var wa=hp;wa.length=function(t){var e=t.length;if(!e)return 0;for(var n=0;--e%4>1&&t.charAt(e)==="=";)++n;return Math.ceil(t.length*3)/4-n};var An=new Array(64),mp=new Array(123);for(kt=0;kt<64;)mp[An[kt]=kt<26?kt+65:kt<52?kt+71:kt<62?kt-4:kt-59|43]=kt++;var kt;wa.encode=function(t,e,n){for(var i=null,a=[],o=0,l=0,s;e<n;){var c=t[e++];switch(l){case 0:a[o++]=An[c>>2],s=(c&3)<<4,l=1;break;case 1:a[o++]=An[s|c>>4],s=(c&15)<<2,l=2;break;case 2:a[o++]=An[s|c>>6],a[o++]=An[c&63],l=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,a)),o=0)}return l&&(a[o++]=An[s],a[o++]=61,l===1&&(a[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,a.slice(0,o))),i.join("")):String.fromCharCode.apply(String,a.slice(0,o))};var fp="invalid encoding";wa.decode=function(t,e,n){for(var i=n,a=0,o,l=0;l<t.length;){var s=t.charCodeAt(l++);if(s===61&&a>1)break;if((s=mp[s])===void 0)throw Error(fp);switch(a){case 0:o=s,a=1;break;case 1:e[n++]=o<<2|(s&48)>>4,o=s,a=2;break;case 2:e[n++]=(o&15)<<4|(s&60)>>2,o=s,a=3;break;case 3:e[n++]=(o&3)<<6|s,a=0;break}}if(a===1)throw Error(fp);return n-i};wa.test=function(t){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(t)}});var yp=te((d_,bp)=>{"use strict";bp.exports=va;function va(){this._listeners={}}va.prototype.on=function(t,e,n){return(this._listeners[t]||(this._listeners[t]=[])).push({fn:e,ctx:n||this}),this};va.prototype.off=function(t,e){if(t===void 0)this._listeners={};else if(e===void 0)this._listeners[t]=[];else for(var n=this._listeners[t],i=0;i<n.length;)n[i].fn===e?n.splice(i,1):++i;return this};va.prototype.emit=function(t){var e=this._listeners[t];if(e){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<e.length;)e[i].fn.apply(e[i++].ctx,n)}return this}});var Ap=te((f_,_p)=>{"use strict";_p.exports=xp(xp);function xp(r){return typeof Float32Array!="undefined"?function(){var t=new Float32Array([-0]),e=new Uint8Array(t.buffer),n=e[3]===128;function i(s,c,u){t[0]=s,c[u]=e[0],c[u+1]=e[1],c[u+2]=e[2],c[u+3]=e[3]}function a(s,c,u){t[0]=s,c[u]=e[3],c[u+1]=e[2],c[u+2]=e[1],c[u+3]=e[0]}r.writeFloatLE=n?i:a,r.writeFloatBE=n?a:i;function o(s,c){return e[0]=s[c],e[1]=s[c+1],e[2]=s[c+2],e[3]=s[c+3],t[0]}function l(s,c){return e[3]=s[c],e[2]=s[c+1],e[1]=s[c+2],e[0]=s[c+3],t[0]}r.readFloatLE=n?o:l,r.readFloatBE=n?l:o}():function(){function t(n,i,a,o){var l=i<0?1:0;if(l&&(i=-i),i===0)n(1/i>0?0:2147483648,a,o);else if(isNaN(i))n(2143289344,a,o);else if(i>34028234663852886e22)n((l<<31|2139095040)>>>0,a,o);else if(i<11754943508222875e-54)n((l<<31|Math.round(i/1401298464324817e-60))>>>0,a,o);else{var s=Math.floor(Math.log(i)/Math.LN2),c=Math.round(i*Math.pow(2,-s)*8388608)&8388607;n((l<<31|s+127<<23|c)>>>0,a,o)}}r.writeFloatLE=t.bind(null,wp),r.writeFloatBE=t.bind(null,vp);function e(n,i,a){var o=n(i,a),l=(o>>31)*2+1,s=o>>>23&255,c=o&8388607;return s===255?c?NaN:l*(1/0):s===0?l*1401298464324817e-60*c:l*Math.pow(2,s-150)*(c+8388608)}r.readFloatLE=e.bind(null,Ep),r.readFloatBE=e.bind(null,Tp)}(),typeof Float64Array!="undefined"?function(){var t=new Float64Array([-0]),e=new Uint8Array(t.buffer),n=e[7]===128;function i(s,c,u){t[0]=s,c[u]=e[0],c[u+1]=e[1],c[u+2]=e[2],c[u+3]=e[3],c[u+4]=e[4],c[u+5]=e[5],c[u+6]=e[6],c[u+7]=e[7]}function a(s,c,u){t[0]=s,c[u]=e[7],c[u+1]=e[6],c[u+2]=e[5],c[u+3]=e[4],c[u+4]=e[3],c[u+5]=e[2],c[u+6]=e[1],c[u+7]=e[0]}r.writeDoubleLE=n?i:a,r.writeDoubleBE=n?a:i;function o(s,c){return e[0]=s[c],e[1]=s[c+1],e[2]=s[c+2],e[3]=s[c+3],e[4]=s[c+4],e[5]=s[c+5],e[6]=s[c+6],e[7]=s[c+7],t[0]}function l(s,c){return e[7]=s[c],e[6]=s[c+1],e[5]=s[c+2],e[4]=s[c+3],e[3]=s[c+4],e[2]=s[c+5],e[1]=s[c+6],e[0]=s[c+7],t[0]}r.readDoubleLE=n?o:l,r.readDoubleBE=n?l:o}():function(){function t(n,i,a,o,l,s){var c=o<0?1:0;if(c&&(o=-o),o===0)n(0,l,s+i),n(1/o>0?0:2147483648,l,s+a);else if(isNaN(o))n(0,l,s+i),n(2146959360,l,s+a);else if(o>17976931348623157e292)n(0,l,s+i),n((c<<31|2146435072)>>>0,l,s+a);else{var u;if(o<22250738585072014e-324)u=o/5e-324,n(u>>>0,l,s+i),n((c<<31|u/4294967296)>>>0,l,s+a);else{var p=Math.floor(Math.log(o)/Math.LN2);p===1024&&(p=1023),u=o*Math.pow(2,-p),n(u*4503599627370496>>>0,l,s+i),n((c<<31|p+1023<<20|u*1048576&1048575)>>>0,l,s+a)}}}r.writeDoubleLE=t.bind(null,wp,0,4),r.writeDoubleBE=t.bind(null,vp,4,0);function e(n,i,a,o,l){var s=n(o,l+i),c=n(o,l+a),u=(c>>31)*2+1,p=c>>>20&2047,f=4294967296*(c&1048575)+s;return p===2047?f?NaN:u*(1/0):p===0?u*5e-324*f:u*Math.pow(2,p-1075)*(f+4503599627370496)}r.readDoubleLE=e.bind(null,Ep,0,4),r.readDoubleBE=e.bind(null,Tp,4,0)}(),r}function wp(r,t,e){t[e]=r&255,t[e+1]=r>>>8&255,t[e+2]=r>>>16&255,t[e+3]=r>>>24}function vp(r,t,e){t[e]=r>>>24,t[e+1]=r>>>16&255,t[e+2]=r>>>8&255,t[e+3]=r&255}function Ep(r,t){return(r[t]|r[t+1]<<8|r[t+2]<<16|r[t+3]<<24)>>>0}function Tp(r,t){return(r[t]<<24|r[t+1]<<16|r[t+2]<<8|r[t+3])>>>0}});var qs=te((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var kp=te(Cp=>{"use strict";var js=Cp;js.length=function(t){for(var e=0,n=0,i=0;i<t.length;++i)n=t.charCodeAt(i),n<128?e+=1:n<2048?e+=2:(n&64512)===55296&&(t.charCodeAt(i+1)&64512)===56320?(++i,e+=4):e+=3;return e};js.read=function(t,e,n){var i=n-e;if(i<1)return"";for(var a=null,o=[],l=0,s;e<n;)s=t[e++],s<128?o[l++]=s:s>191&&s<224?o[l++]=(s&31)<<6|t[e++]&63:s>239&&s<365?(s=((s&7)<<18|(t[e++]&63)<<12|(t[e++]&63)<<6|t[e++]&63)-65536,o[l++]=55296+(s>>10),o[l++]=56320+(s&1023)):o[l++]=(s&15)<<12|(t[e++]&63)<<6|t[e++]&63,l>8191&&((a||(a=[])).push(String.fromCharCode.apply(String,o)),l=0);return a?(l&&a.push(String.fromCharCode.apply(String,o.slice(0,l))),a.join("")):String.fromCharCode.apply(String,o.slice(0,l))};js.write=function(t,e,n){for(var i=n,a,o,l=0;l<t.length;++l)a=t.charCodeAt(l),a<128?e[n++]=a:a<2048?(e[n++]=a>>6|192,e[n++]=a&63|128):(a&64512)===55296&&((o=t.charCodeAt(l+1))&64512)===56320?(a=65536+((a&1023)<<10)+(o&1023),++l,e[n++]=a>>18|240,e[n++]=a>>12&63|128,e[n++]=a>>6&63|128,e[n++]=a&63|128):(e[n++]=a>>12|224,e[n++]=a>>6&63|128,e[n++]=a&63|128);return n-i}});var Np=te((h_,Pp)=>{"use strict";Pp.exports=$b;function $b(r,t,e){var n=e||8192,i=n>>>1,a=null,o=n;return function(s){if(s<1||s>i)return r(s);o+s>n&&(a=r(n),o=0);var c=t.call(a,o,o+=s);return o&7&&(o=(o|7)+1),c}}});var Dp=te((g_,Sp)=>{"use strict";Sp.exports=qe;var fi=Lt();function qe(r,t){this.lo=r>>>0,this.hi=t>>>0}var Yr=qe.zero=new qe(0,0);Yr.toNumber=function(){return 0};Yr.zzEncode=Yr.zzDecode=function(){return this};Yr.length=function(){return 1};var Bb=qe.zeroHash="\0\0\0\0\0\0\0\0";qe.fromNumber=function(t){if(t===0)return Yr;var e=t<0;e&&(t=-t);var n=t>>>0,i=(t-n)/4294967296>>>0;return e&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new qe(n,i)};qe.from=function(t){if(typeof t=="number")return qe.fromNumber(t);if(fi.isString(t))if(fi.Long)t=fi.Long.fromString(t);else return qe.fromNumber(parseInt(t,10));return t.low||t.high?new qe(t.low>>>0,t.high>>>0):Yr};qe.prototype.toNumber=function(t){if(!t&&this.hi>>>31){var e=~this.lo+1>>>0,n=~this.hi>>>0;return e||(n=n+1>>>0),-(e+n*4294967296)}return this.lo+this.hi*4294967296};qe.prototype.toLong=function(t){return fi.Long?new fi.Long(this.lo|0,this.hi|0,!!t):{low:this.lo|0,high:this.hi|0,unsigned:!!t}};var xr=String.prototype.charCodeAt;qe.fromHash=function(t){return t===Bb?Yr:new qe((xr.call(t,0)|xr.call(t,1)<<8|xr.call(t,2)<<16|xr.call(t,3)<<24)>>>0,(xr.call(t,4)|xr.call(t,5)<<8|xr.call(t,6)<<16|xr.call(t,7)<<24)>>>0)};qe.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};qe.prototype.zzEncode=function(){var t=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^t)>>>0,this.lo=(this.lo<<1^t)>>>0,this};qe.prototype.zzDecode=function(){var t=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^t)>>>0,this.hi=(this.hi>>>1^t)>>>0,this};qe.prototype.length=function(){var t=this.lo,e=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?e===0?t<16384?t<128?1:2:t<2097152?3:4:e<16384?e<128?5:6:e<2097152?7:8:n<128?9:10}});var Lt=te(Us=>{"use strict";var re=Us;re.asPromise=Bs();re.base64=gp();re.EventEmitter=yp();re.float=Ap();re.inquire=qs();re.utf8=kp();re.pool=Np();re.LongBits=Dp();re.isNode=!!(typeof global!="undefined"&&global&&global.process&&global.process.versions&&global.process.versions.node);re.global=re.isNode&&global||typeof window!="undefined"&&window||typeof self!="undefined"&&self||Us;re.emptyArray=Object.freeze?Object.freeze([]):[];re.emptyObject=Object.freeze?Object.freeze({}):{};re.isInteger=Number.isInteger||function(t){return typeof t=="number"&&isFinite(t)&&Math.floor(t)===t};re.isString=function(t){return typeof t=="string"||t instanceof String};re.isObject=function(t){return t&&typeof t=="object"};re.isset=re.isSet=function(t,e){var n=t[e];return n!=null&&t.hasOwnProperty(e)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};re.Buffer=function(){try{var r=re.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch(t){return null}}();re._Buffer_from=null;re._Buffer_allocUnsafe=null;re.newBuffer=function(t){return typeof t=="number"?re.Buffer?re._Buffer_allocUnsafe(t):new re.Array(t):re.Buffer?re._Buffer_from(t):typeof Uint8Array=="undefined"?t:new Uint8Array(t)};re.Array=typeof Uint8Array!="undefined"?Uint8Array:Array;re.Long=re.global.dcodeIO&&re.global.dcodeIO.Long||re.global.Long||re.inquire("long");re.key2Re=/^true|false|0|1$/;re.key32Re=/^-?(?:0|[1-9][0-9]*)$/;re.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;re.longToHash=function(t){return t?re.LongBits.from(t).toHash():re.LongBits.zeroHash};re.longFromHash=function(t,e){var n=re.LongBits.fromHash(t);return re.Long?re.Long.fromBits(n.lo,n.hi,e):n.toNumber(!!e)};function Rp(r,t,e){for(var n=Object.keys(t),i=0;i<n.length;++i)(r[n[i]]===void 0||!e)&&(r[n[i]]=t[n[i]]);return r}re.merge=Rp;re.lcFirst=function(t){return t.charAt(0).toLowerCase()+t.substring(1)};function Op(r){function t(e,n){if(!(this instanceof t))return new t(e,n);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&Rp(this,n)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}re.newError=Op;re.ProtocolError=Op("ProtocolError");re.oneOfGetter=function(t){for(var e={},n=0;n<t.length;++n)e[t[n]]=1;return function(){for(var i=Object.keys(this),a=i.length-1;a>-1;--a)if(e[i[a]]===1&&this[i[a]]!==void 0&&this[i[a]]!==null)return i[a]}};re.oneOfSetter=function(t){return function(e){for(var n=0;n<t.length;++n)t[n]!==e&&delete this[t[n]]}};re.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};re._configure=function(){var r=re.Buffer;if(!r){re._Buffer_from=re._Buffer_allocUnsafe=null;return}re._Buffer_from=r.from!==Uint8Array.from&&r.from||function(e,n){return new r(e,n)},re._Buffer_allocUnsafe=r.allocUnsafe||function(e){return new r(e)}}});var Ta=te((y_,Mp)=>{"use strict";Mp.exports=he;var yt=Lt(),Hs,Ea=yt.LongBits,Ip=yt.base64,Fp=yt.utf8;function mi(r,t,e){this.fn=r,this.len=t,this.next=void 0,this.val=e}function Vs(){}function qb(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function he(){this.len=0,this.head=new mi(Vs,0,0),this.tail=this.head,this.states=null}var Lp=function(){return yt.Buffer?function(){return(he.create=function(){return new Hs})()}:function(){return new he}};he.create=Lp();he.alloc=function(t){return new yt.Array(t)};yt.Array!==Array&&(he.alloc=yt.pool(he.alloc,yt.Array.prototype.subarray));he.prototype._push=function(t,e,n){return this.tail=this.tail.next=new mi(t,e,n),this.len+=e,this};function zs(r,t,e){t[e]=r&255}function jb(r,t,e){for(;r>127;)t[e++]=r&127|128,r>>>=7;t[e]=r}function Gs(r,t){this.len=r,this.next=void 0,this.val=t}Gs.prototype=Object.create(mi.prototype);Gs.prototype.fn=jb;he.prototype.uint32=function(t){return this.len+=(this.tail=this.tail.next=new Gs((t=t>>>0)<128?1:t<16384?2:t<2097152?3:t<268435456?4:5,t)).len,this};he.prototype.int32=function(t){return t<0?this._push(Ys,10,Ea.fromNumber(t)):this.uint32(t)};he.prototype.sint32=function(t){return this.uint32((t<<1^t>>31)>>>0)};function Ys(r,t,e){for(;r.hi;)t[e++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)t[e++]=r.lo&127|128,r.lo=r.lo>>>7;t[e++]=r.lo}he.prototype.uint64=function(t){var e=Ea.from(t);return this._push(Ys,e.length(),e)};he.prototype.int64=he.prototype.uint64;he.prototype.sint64=function(t){var e=Ea.from(t).zzEncode();return this._push(Ys,e.length(),e)};he.prototype.bool=function(t){return this._push(zs,1,t?1:0)};function Ws(r,t,e){t[e]=r&255,t[e+1]=r>>>8&255,t[e+2]=r>>>16&255,t[e+3]=r>>>24}he.prototype.fixed32=function(t){return this._push(Ws,4,t>>>0)};he.prototype.sfixed32=he.prototype.fixed32;he.prototype.fixed64=function(t){var e=Ea.from(t);return this._push(Ws,4,e.lo)._push(Ws,4,e.hi)};he.prototype.sfixed64=he.prototype.fixed64;he.prototype.float=function(t){return this._push(yt.float.writeFloatLE,4,t)};he.prototype.double=function(t){return this._push(yt.float.writeDoubleLE,8,t)};var Ub=yt.Array.prototype.set?function(t,e,n){e.set(t,n)}:function(t,e,n){for(var i=0;i<t.length;++i)e[n+i]=t[i]};he.prototype.bytes=function(t){var e=t.length>>>0;if(!e)return this._push(zs,1,0);if(yt.isString(t)){var n=he.alloc(e=Ip.length(t));Ip.decode(t,n,0),t=n}return this.uint32(e)._push(Ub,e,t)};he.prototype.string=function(t){var e=Fp.length(t);return e?this.uint32(e)._push(Fp.write,e,t):this._push(zs,1,0)};he.prototype.fork=function(){return this.states=new qb(this),this.head=this.tail=new mi(Vs,0,0),this.len=0,this};he.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new mi(Vs,0,0),this.len=0),this};he.prototype.ldelim=function(){var t=this.head,e=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=t.next,this.tail=e,this.len+=n),this};he.prototype.finish=function(){for(var t=this.head.next,e=this.constructor.alloc(this.len),n=0;t;)t.fn(t.val,e,n),n+=t.len,t=t.next;return e};he._configure=function(r){Hs=r,he.create=Lp(),Hs._configure()}});var qp=te((x_,Bp)=>{"use strict";Bp.exports=Mt;var $p=Ta();(Mt.prototype=Object.create($p.prototype)).constructor=Mt;var wr=Lt();function Mt(){$p.call(this)}Mt._configure=function(){Mt.alloc=wr._Buffer_allocUnsafe,Mt.writeBytesBuffer=wr.Buffer&&wr.Buffer.prototype instanceof Uint8Array&&wr.Buffer.prototype.set.name==="set"?function(t,e,n){e.set(t,n)}:function(t,e,n){if(t.copy)t.copy(e,n,0,t.length);else for(var i=0;i<t.length;)e[n++]=t[i++]}};Mt.prototype.bytes=function(t){wr.isString(t)&&(t=wr._Buffer_from(t,"base64"));var e=t.length>>>0;return this.uint32(e),e&&this._push(Mt.writeBytesBuffer,e,t),this};function Hb(r,t,e){r.length<40?wr.utf8.write(r,t,e):t.utf8Write?t.utf8Write(r,e):t.write(r,e)}Mt.prototype.string=function(t){var e=wr.Buffer.byteLength(t);return this.uint32(e),e&&this._push(Hb,e,t),this};Mt._configure()});var Aa=te((w_,Vp)=>{"use strict";Vp.exports=Se;var Pt=Lt(),Ks,Hp=Pt.LongBits,Wb=Pt.utf8;function Nt(r,t){return RangeError("index out of range: "+r.pos+" + "+(t||1)+" > "+r.len)}function Se(r){this.buf=r,this.pos=0,this.len=r.length}var jp=typeof Uint8Array!="undefined"?function(t){if(t instanceof Uint8Array||Array.isArray(t))return new Se(t);throw Error("illegal buffer")}:function(t){if(Array.isArray(t))return new Se(t);throw Error("illegal buffer")},Wp=function(){return Pt.Buffer?function(e){return(Se.create=function(i){return Pt.Buffer.isBuffer(i)?new Ks(i):jp(i)})(e)}:jp};Se.create=Wp();Se.prototype._slice=Pt.Array.prototype.subarray||Pt.Array.prototype.slice;Se.prototype.uint32=function(){var t=4294967295;return function(){if(t=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(t=(t|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(t=(t|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return t;if((this.pos+=5)>this.len)throw this.pos=this.len,Nt(this,10);return t}}();Se.prototype.int32=function(){return this.uint32()|0};Se.prototype.sint32=function(){var t=this.uint32();return t>>>1^-(t&1)|0};function Zs(){var r=new Hp(0,0),t=0;if(this.len-this.pos>4){for(;t<4;++t)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;t=0}else{for(;t<3;++t){if(this.pos>=this.len)throw Nt(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<t*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<t*7)>>>0,r}if(this.len-this.pos>4){for(;t<5;++t)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;t<5;++t){if(this.pos>=this.len)throw Nt(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<t*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}Se.prototype.bool=function(){return this.uint32()!==0};function _a(r,t){return(r[t-4]|r[t-3]<<8|r[t-2]<<16|r[t-1]<<24)>>>0}Se.prototype.fixed32=function(){if(this.pos+4>this.len)throw Nt(this,4);return _a(this.buf,this.pos+=4)};Se.prototype.sfixed32=function(){if(this.pos+4>this.len)throw Nt(this,4);return _a(this.buf,this.pos+=4)|0};function Up(){if(this.pos+8>this.len)throw Nt(this,8);return new Hp(_a(this.buf,this.pos+=4),_a(this.buf,this.pos+=4))}Se.prototype.float=function(){if(this.pos+4>this.len)throw Nt(this,4);var t=Pt.float.readFloatLE(this.buf,this.pos);return this.pos+=4,t};Se.prototype.double=function(){if(this.pos+8>this.len)throw Nt(this,4);var t=Pt.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,t};Se.prototype.bytes=function(){var t=this.uint32(),e=this.pos,n=this.pos+t;if(n>this.len)throw Nt(this,t);if(this.pos+=t,Array.isArray(this.buf))return this.buf.slice(e,n);if(e===n){var i=Pt.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,e,n)};Se.prototype.string=function(){var t=this.bytes();return Wb.read(t,0,t.length)};Se.prototype.skip=function(t){if(typeof t=="number"){if(this.pos+t>this.len)throw Nt(this,t);this.pos+=t}else do if(this.pos>=this.len)throw Nt(this);while(this.buf[this.pos++]&128);return this};Se.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};Se._configure=function(r){Ks=r,Se.create=Wp(),Ks._configure();var t=Pt.Long?"toLong":"toNumber";Pt.merge(Se.prototype,{int64:function(){return Zs.call(this)[t](!1)},uint64:function(){return Zs.call(this)[t](!0)},sint64:function(){return Zs.call(this).zzDecode()[t](!1)},fixed64:function(){return Up.call(this)[t](!0)},sfixed64:function(){return Up.call(this)[t](!1)}})}});var Zp=te((v_,Yp)=>{"use strict";Yp.exports=Zr;var Gp=Aa();(Zr.prototype=Object.create(Gp.prototype)).constructor=Zr;var zp=Lt();function Zr(r){Gp.call(this,r)}Zr._configure=function(){zp.Buffer&&(Zr.prototype._slice=zp.Buffer.prototype.slice)};Zr.prototype.string=function(){var t=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+t,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+t,this.len))};Zr._configure()});var Xp=te((E_,Kp)=>{"use strict";Kp.exports=hi;var Xs=Lt();(hi.prototype=Object.create(Xs.EventEmitter.prototype)).constructor=hi;function hi(r,t,e){if(typeof r!="function")throw TypeError("rpcImpl must be a function");Xs.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!t,this.responseDelimited=!!e}hi.prototype.rpcCall=function r(t,e,n,i,a){if(!i)throw TypeError("request must be specified");var o=this;if(!a)return Xs.asPromise(r,o,t,e,n,i);if(!o.rpcImpl){setTimeout(function(){a(Error("already ended"))},0);return}try{return o.rpcImpl(t,e[o.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(s,c){if(s)return o.emit("error",s,t),a(s);if(c===null){o.end(!0);return}if(!(c instanceof n))try{c=n[o.responseDelimited?"decodeDelimited":"decode"](c)}catch(u){return o.emit("error",u,t),a(u)}return o.emit("data",c,t),a(null,c)})}catch(l){o.emit("error",l,t),setTimeout(function(){a(l)},0);return}};hi.prototype.end=function(t){return this.rpcImpl&&(t||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var Js=te(Jp=>{"use strict";var Vb=Jp;Vb.Service=Xp()});var Qs=te((__,Qp)=>{"use strict";Qp.exports={}});var rd=te(td=>{"use strict";var st=td;st.build="minimal";st.Writer=Ta();st.BufferWriter=qp();st.Reader=Aa();st.BufferReader=Zp();st.util=Lt();st.rpc=Js();st.roots=Qs();st.configure=ed;function ed(){st.util._configure(),st.Writer._configure(st.BufferWriter),st.Reader._configure(st.BufferReader)}ed()});var id=te((C_,nd)=>{"use strict";nd.exports=el;function el(r,t){typeof r=="string"&&(t=r,r=void 0);var e=[];function n(a){if(typeof a!="string"){var o=i();if(el.verbose&&console.log("codegen: "+o),o="return "+o,a){for(var l=Object.keys(a),s=new Array(l.length+1),c=new Array(l.length),u=0;u<l.length;)s[u]=l[u],c[u]=a[l[u++]];return s[u]=o,Function.apply(null,s).apply(null,c)}return Function(o)()}for(var p=new Array(arguments.length-1),f=0;f<p.length;)p[f]=arguments[++f];if(f=0,a=a.replace(/%([%dfijs])/g,function(g,m){var h=p[f++];switch(m){case"d":case"f":return String(Number(h));case"i":return String(Math.floor(h));case"j":return JSON.stringify(h);case"s":return String(h)}return"%"}),f!==p.length)throw Error("parameter count mismatch");return e.push(a),n}function i(a){return"function "+(a||t||"")+"("+(r&&r.join(",")||"")+`){
`+e.join(`
`)+`
}`}return n.toString=i,n}el.verbose=!1});var od=te((k_,ad)=>{"use strict";ad.exports=gi;var zb=Bs(),Gb=qs(),tl=Gb("fs");function gi(r,t,e){return typeof t=="function"?(e=t,t={}):t||(t={}),e?!t.xhr&&tl&&tl.readFile?tl.readFile(r,function(i,a){return i&&typeof XMLHttpRequest!="undefined"?gi.xhr(r,t,e):i?e(i):e(null,t.binary?a:a.toString("utf8"))}):gi.xhr(r,t,e):zb(gi,this,r,t)}gi.xhr=function(t,e,n){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(i.readyState===4){if(i.status!==0&&i.status!==200)return n(Error("status "+i.status));if(e.binary){var o=i.response;if(!o){o=[];for(var l=0;l<i.responseText.length;++l)o.push(i.responseText.charCodeAt(l)&255)}return n(null,typeof Uint8Array!="undefined"?new Uint8Array(o):o)}return n(null,i.responseText)}},e.binary&&("overrideMimeType"in i&&i.overrideMimeType("text/plain; charset=x-user-defined"),i.responseType="arraybuffer"),i.open("GET",t),i.send()}});var cd=te(ld=>{"use strict";var nl=ld,sd=nl.isAbsolute=function(t){return/^(?:\/|\w+:)/.test(t)},rl=nl.normalize=function(t){t=t.replace(/\\/g,"/").replace(/\/{2,}/g,"/");var e=t.split("/"),n=sd(t),i="";n&&(i=e.shift()+"/");for(var a=0;a<e.length;)e[a]===".."?a>0&&e[a-1]!==".."?e.splice(--a,2):n?e.splice(a,1):++a:e[a]==="."?e.splice(a,1):++a;return i+e.join("/")};nl.resolve=function(t,e,n){return n||(e=rl(e)),sd(e)?e:(n||(t=rl(t)),(t=t.replace(/(?:\/|^)[^/]+$/,"")).length?rl(t+"/"+e):e)}});var Kr=te(ud=>{"use strict";var bi=ud,Yb=je(),Zb=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function yi(r,t){var e=0,n={};for(t|=0;e<r.length;)n[Zb[e+t]]=r[e++];return n}bi.basic=yi([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]);bi.defaults=yi([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",Yb.emptyArray,null]);bi.long=yi([0,0,0,1,1],7);bi.mapKey=yi([0,0,0,5,5,0,0,0,1,1,0,2],2);bi.packed=yi([1,5,0,0,0,5,5,0,0,0,1,1,0])});var vr=te((S_,fd)=>{"use strict";fd.exports=xt;var Ca=Xr();((xt.prototype=Object.create(Ca.prototype)).constructor=xt).className="Field";var pd=St(),dd=Kr(),Re=je(),il,Kb=/^required|optional|repeated$/;xt.fromJSON=function(t,e){return new xt(t,e.id,e.type,e.rule,e.extend,e.options,e.comment)};function xt(r,t,e,n,i,a,o){if(Re.isObject(n)?(o=i,a=n,n=i=void 0):Re.isObject(i)&&(o=a,a=i,i=void 0),Ca.call(this,r,a),!Re.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!Re.isString(e))throw TypeError("type must be a string");if(n!==void 0&&!Kb.test(n=n.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(i!==void 0&&!Re.isString(i))throw TypeError("extend must be a string");n==="proto3_optional"&&(n="optional"),this.rule=n&&n!=="optional"?n:void 0,this.type=e,this.id=t,this.extend=i||void 0,this.required=n==="required",this.optional=!this.required,this.repeated=n==="repeated",this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=Re.Long?dd.long[e]!==void 0:!1,this.bytes=e==="bytes",this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=o}Object.defineProperty(xt.prototype,"packed",{get:function(){return this._packed===null&&(this._packed=this.getOption("packed")!==!1),this._packed}});xt.prototype.setOption=function(t,e,n){return t==="packed"&&(this._packed=null),Ca.prototype.setOption.call(this,t,e,n)};xt.prototype.toJSON=function(t){var e=t?!!t.keepComments:!1;return Re.toObject(["rule",this.rule!=="optional"&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",e?this.comment:void 0])};xt.prototype.resolve=function(){if(this.resolved)return this;if((this.typeDefault=dd.defaults[this.type])===void 0?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof il?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&this.options.default!=null&&(this.typeDefault=this.options.default,this.resolvedType instanceof pd&&typeof this.typeDefault=="string"&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&((this.options.packed===!0||this.options.packed!==void 0&&this.resolvedType&&!(this.resolvedType instanceof pd))&&delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=Re.Long.fromNumber(this.typeDefault,this.type.charAt(0)==="u"),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&typeof this.typeDefault=="string"){var t;Re.base64.test(this.typeDefault)?Re.base64.decode(this.typeDefault,t=Re.newBuffer(Re.base64.length(this.typeDefault)),0):Re.utf8.write(this.typeDefault,t=Re.newBuffer(Re.utf8.length(this.typeDefault)),0),this.typeDefault=t}return this.map?this.defaultValue=Re.emptyObject:this.repeated?this.defaultValue=Re.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof il&&(this.parent.ctor.prototype[this.name]=this.defaultValue),Ca.prototype.resolve.call(this)};xt.d=function(t,e,n,i){return typeof e=="function"?e=Re.decorateType(e).name:e&&typeof e=="object"&&(e=Re.decorateEnum(e).name),function(o,l){Re.decorateType(o.constructor).add(new xt(l,t,e,n,{default:i}))}};xt._configure=function(t){il=t}});var Cn=te((D_,gd)=>{"use strict";gd.exports=wt;var Pa=Xr();((wt.prototype=Object.create(Pa.prototype)).constructor=wt).className="OneOf";var md=vr(),ka=je();function wt(r,t,e,n){if(Array.isArray(t)||(e=t,t=void 0),Pa.call(this,r,e),!(t===void 0||Array.isArray(t)))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=n}wt.fromJSON=function(t,e){return new wt(t,e.oneof,e.options,e.comment)};wt.prototype.toJSON=function(t){var e=t?!!t.keepComments:!1;return ka.toObject(["options",this.options,"oneof",this.oneof,"comment",e?this.comment:void 0])};function hd(r){if(r.parent)for(var t=0;t<r.fieldsArray.length;++t)r.fieldsArray[t].parent||r.parent.add(r.fieldsArray[t])}wt.prototype.add=function(t){if(!(t instanceof md))throw TypeError("field must be a Field");return t.parent&&t.parent!==this.parent&&t.parent.remove(t),this.oneof.push(t.name),this.fieldsArray.push(t),t.partOf=this,hd(this),this};wt.prototype.remove=function(t){if(!(t instanceof md))throw TypeError("field must be a Field");var e=this.fieldsArray.indexOf(t);if(e<0)throw Error(t+" is not a member of "+this);return this.fieldsArray.splice(e,1),e=this.oneof.indexOf(t.name),e>-1&&this.oneof.splice(e,1),t.partOf=null,this};wt.prototype.onAdd=function(t){Pa.prototype.onAdd.call(this,t);for(var e=this,n=0;n<this.oneof.length;++n){var i=t.get(this.oneof[n]);i&&!i.partOf&&(i.partOf=e,e.fieldsArray.push(i))}hd(this)};wt.prototype.onRemove=function(t){for(var e=0,n;e<this.fieldsArray.length;++e)(n=this.fieldsArray[e]).parent&&n.parent.remove(n);Pa.prototype.onRemove.call(this,t)};wt.d=function(){for(var t=new Array(arguments.length),e=0;e<arguments.length;)t[e]=arguments[e++];return function(i,a){ka.decorateType(i.constructor).add(new wt(a,t)),Object.defineProperty(i,a,{get:ka.oneOfGetter(t),set:ka.oneOfSetter(t)})}}});var Nn=te((R_,wd)=>{"use strict";wd.exports=be;var al=Xr();((be.prototype=Object.create(al.prototype)).constructor=be).className="Namespace";var bd=vr(),Na=je(),Xb=Cn(),kn,xi,Pn;be.fromJSON=function(t,e){return new be(t,e.options).addJSON(e.nested)};function yd(r,t){if(r&&r.length){for(var e={},n=0;n<r.length;++n)e[r[n].name]=r[n].toJSON(t);return e}}be.arrayToJSON=yd;be.isReservedId=function(t,e){if(t){for(var n=0;n<t.length;++n)if(typeof t[n]!="string"&&t[n][0]<=e&&t[n][1]>e)return!0}return!1};be.isReservedName=function(t,e){if(t){for(var n=0;n<t.length;++n)if(t[n]===e)return!0}return!1};function be(r,t){al.call(this,r,t),this.nested=void 0,this._nestedArray=null}function xd(r){return r._nestedArray=null,r}Object.defineProperty(be.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=Na.toArray(this.nested))}});be.prototype.toJSON=function(t){return Na.toObject(["options",this.options,"nested",yd(this.nestedArray,t)])};be.prototype.addJSON=function(t){var e=this;if(t)for(var n=Object.keys(t),i=0,a;i<n.length;++i)a=t[n[i]],e.add((a.fields!==void 0?kn.fromJSON:a.values!==void 0?Pn.fromJSON:a.methods!==void 0?xi.fromJSON:a.id!==void 0?bd.fromJSON:be.fromJSON)(n[i],a));return this};be.prototype.get=function(t){return this.nested&&this.nested[t]||null};be.prototype.getEnum=function(t){if(this.nested&&this.nested[t]instanceof Pn)return this.nested[t].values;throw Error("no such enum: "+t)};be.prototype.add=function(t){if(!(t instanceof bd&&t.extend!==void 0||t instanceof kn||t instanceof Xb||t instanceof Pn||t instanceof xi||t instanceof be))throw TypeError("object must be a valid nested object");if(!this.nested)this.nested={};else{var e=this.get(t.name);if(e)if(e instanceof be&&t instanceof be&&!(e instanceof kn||e instanceof xi)){for(var n=e.nestedArray,i=0;i<n.length;++i)t.add(n[i]);this.remove(e),this.nested||(this.nested={}),t.setOptions(e.options,!0)}else throw Error("duplicate name '"+t.name+"' in "+this)}return this.nested[t.name]=t,t.onAdd(this),xd(this)};be.prototype.remove=function(t){if(!(t instanceof al))throw TypeError("object must be a ReflectionObject");if(t.parent!==this)throw Error(t+" is not a member of "+this);return delete this.nested[t.name],Object.keys(this.nested).length||(this.nested=void 0),t.onRemove(this),xd(this)};be.prototype.define=function(t,e){if(Na.isString(t))t=t.split(".");else if(!Array.isArray(t))throw TypeError("illegal path");if(t&&t.length&&t[0]==="")throw Error("path must be relative");for(var n=this;t.length>0;){var i=t.shift();if(n.nested&&n.nested[i]){if(n=n.nested[i],!(n instanceof be))throw Error("path conflicts with non-namespace objects")}else n.add(n=new be(i))}return e&&n.addJSON(e),n};be.prototype.resolveAll=function(){for(var t=this.nestedArray,e=0;e<t.length;)t[e]instanceof be?t[e++].resolveAll():t[e++].resolve();return this.resolve()};be.prototype.lookup=function(t,e,n){if(typeof e=="boolean"?(n=e,e=void 0):e&&!Array.isArray(e)&&(e=[e]),Na.isString(t)&&t.length){if(t===".")return this.root;t=t.split(".")}else if(!t.length)return this;if(t[0]==="")return this.root.lookup(t.slice(1),e);var i=this.get(t[0]);if(i){if(t.length===1){if(!e||e.indexOf(i.constructor)>-1)return i}else if(i instanceof be&&(i=i.lookup(t.slice(1),e,!0)))return i}else for(var a=0;a<this.nestedArray.length;++a)if(this._nestedArray[a]instanceof be&&(i=this._nestedArray[a].lookup(t,e,!0)))return i;return this.parent===null||n?null:this.parent.lookup(t,e)};be.prototype.lookupType=function(t){var e=this.lookup(t,[kn]);if(!e)throw Error("no such type: "+t);return e};be.prototype.lookupEnum=function(t){var e=this.lookup(t,[Pn]);if(!e)throw Error("no such Enum '"+t+"' in "+this);return e};be.prototype.lookupTypeOrEnum=function(t){var e=this.lookup(t,[kn,Pn]);if(!e)throw Error("no such Type or Enum '"+t+"' in "+this);return e};be.prototype.lookupService=function(t){var e=this.lookup(t,[xi]);if(!e)throw Error("no such Service '"+t+"' in "+this);return e};be._configure=function(r,t,e){kn=r,xi=t,Pn=e}});var Sa=te((O_,vd)=>{"use strict";vd.exports=Xt;var ol=vr();((Xt.prototype=Object.create(ol.prototype)).constructor=Xt).className="MapField";var Jb=Kr(),wi=je();function Xt(r,t,e,n,i,a){if(ol.call(this,r,t,n,void 0,void 0,i,a),!wi.isString(e))throw TypeError("keyType must be a string");this.keyType=e,this.resolvedKeyType=null,this.map=!0}Xt.fromJSON=function(t,e){return new Xt(t,e.id,e.keyType,e.type,e.options,e.comment)};Xt.prototype.toJSON=function(t){var e=t?!!t.keepComments:!1;return wi.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",e?this.comment:void 0])};Xt.prototype.resolve=function(){if(this.resolved)return this;if(Jb.mapKey[this.keyType]===void 0)throw Error("invalid key type: "+this.keyType);return ol.prototype.resolve.call(this)};Xt.d=function(t,e,n){return typeof n=="function"?n=wi.decorateType(n).name:n&&typeof n=="object"&&(n=wi.decorateEnum(n).name),function(a,o){wi.decorateType(a.constructor).add(new Xt(o,t,e,n))}}});var Da=te((I_,Ed)=>{"use strict";Ed.exports=Jr;var sl=Xr();((Jr.prototype=Object.create(sl.prototype)).constructor=Jr).className="Method";var Sn=je();function Jr(r,t,e,n,i,a,o,l,s){if(Sn.isObject(i)?(o=i,i=a=void 0):Sn.isObject(a)&&(o=a,a=void 0),!(t===void 0||Sn.isString(t)))throw TypeError("type must be a string");if(!Sn.isString(e))throw TypeError("requestType must be a string");if(!Sn.isString(n))throw TypeError("responseType must be a string");sl.call(this,r,o),this.type=t||"rpc",this.requestType=e,this.requestStream=i?!0:void 0,this.responseType=n,this.responseStream=a?!0:void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=l,this.parsedOptions=s}Jr.fromJSON=function(t,e){return new Jr(t,e.type,e.requestType,e.responseType,e.requestStream,e.responseStream,e.options,e.comment,e.parsedOptions)};Jr.prototype.toJSON=function(t){var e=t?!!t.keepComments:!1;return Sn.toObject(["type",this.type!=="rpc"&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",e?this.comment:void 0,"parsedOptions",this.parsedOptions])};Jr.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),sl.prototype.resolve.call(this))}});var Ra=te((F_,_d)=>{"use strict";_d.exports=vt;var Er=Nn();((vt.prototype=Object.create(Er.prototype)).constructor=vt).className="Service";var ll=Da(),vi=je(),Qb=Js();function vt(r,t){Er.call(this,r,t),this.methods={},this._methodsArray=null}vt.fromJSON=function(t,e){var n=new vt(t,e.options);if(e.methods)for(var i=Object.keys(e.methods),a=0;a<i.length;++a)n.add(ll.fromJSON(i[a],e.methods[i[a]]));return e.nested&&n.addJSON(e.nested),n.comment=e.comment,n};vt.prototype.toJSON=function(t){var e=Er.prototype.toJSON.call(this,t),n=t?!!t.keepComments:!1;return vi.toObject(["options",e&&e.options||void 0,"methods",Er.arrayToJSON(this.methodsArray,t)||{},"nested",e&&e.nested||void 0,"comment",n?this.comment:void 0])};Object.defineProperty(vt.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=vi.toArray(this.methods))}});function Td(r){return r._methodsArray=null,r}vt.prototype.get=function(t){return this.methods[t]||Er.prototype.get.call(this,t)};vt.prototype.resolveAll=function(){for(var t=this.methodsArray,e=0;e<t.length;++e)t[e].resolve();return Er.prototype.resolve.call(this)};vt.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);return t instanceof ll?(this.methods[t.name]=t,t.parent=this,Td(this)):Er.prototype.add.call(this,t)};vt.prototype.remove=function(t){if(t instanceof ll){if(this.methods[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.methods[t.name],t.parent=null,Td(this)}return Er.prototype.remove.call(this,t)};vt.prototype.create=function(t,e,n){for(var i=new Qb.Service(t,e,n),a=0,o;a<this.methodsArray.length;++a){var l=vi.lcFirst((o=this._methodsArray[a]).resolve().name).replace(/[^$\w_]/g,"");i[l]=vi.codegen(["r","c"],vi.isReserved(l)?l+"_":l)("return this.rpcCall(m,q,s,r,c)")({m:o,q:o.resolvedRequestType.ctor,s:o.resolvedResponseType.ctor})}return i}});var Oa=te((L_,Ad)=>{"use strict";Ad.exports=$t;var ey=Lt();function $t(r){if(r)for(var t=Object.keys(r),e=0;e<t.length;++e)this[t[e]]=r[t[e]]}$t.create=function(t){return this.$type.create(t)};$t.encode=function(t,e){return this.$type.encode(t,e)};$t.encodeDelimited=function(t,e){return this.$type.encodeDelimited(t,e)};$t.decode=function(t){return this.$type.decode(t)};$t.decodeDelimited=function(t){return this.$type.decodeDelimited(t)};$t.verify=function(t){return this.$type.verify(t)};$t.fromObject=function(t){return this.$type.fromObject(t)};$t.toObject=function(t,e){return this.$type.toObject(t,e)};$t.prototype.toJSON=function(){return this.$type.toObject(this,ey.toJSONOptions)}});var cl=te((M_,kd)=>{"use strict";kd.exports=ny;var ty=St(),Jt=Kr(),Cd=je();function ry(r){return"missing required '"+r.name+"'"}function ny(r){var t=Cd.codegen(["r","l"],r.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(r.fieldsArray.filter(function(l){return l.map}).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");r.group&&t("if((t&7)===4)")("break"),t("switch(t>>>3){");for(var e=0;e<r.fieldsArray.length;++e){var n=r._fieldsArray[e].resolve(),i=n.resolvedType instanceof ty?"int32":n.type,a="m"+Cd.safeProp(n.name);t("case %i: {",n.id),n.map?(t("if(%s===util.emptyObject)",a)("%s={}",a)("var c2 = r.uint32()+r.pos"),Jt.defaults[n.keyType]!==void 0?t("k=%j",Jt.defaults[n.keyType]):t("k=null"),Jt.defaults[i]!==void 0?t("value=%j",Jt.defaults[i]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",n.keyType)("case 2:"),Jt.basic[i]===void 0?t("value=types[%i].decode(r,r.uint32())",e):t("value=r.%s()",i),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),Jt.long[n.keyType]!==void 0?t('%s[typeof k==="object"?util.longToHash(k):k]=value',a):t("%s[k]=value",a)):n.repeated?(t("if(!(%s&&%s.length))",a,a)("%s=[]",a),Jt.packed[i]!==void 0&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",a,i)("}else"),Jt.basic[i]===void 0?t(n.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",a,e):t("%s.push(r.%s())",a,i)):Jt.basic[i]===void 0?t(n.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",a,e):t("%s=r.%s()",a,i),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),e=0;e<r._fieldsArray.length;++e){var o=r._fieldsArray[e];o.required&&t("if(!m.hasOwnProperty(%j))",o.name)("throw util.ProtocolError(%j,{instance:m})",ry(o))}return t("return m")}});var dl=te(($_,Pd)=>{"use strict";Pd.exports=oy;var iy=St(),ul=je();function Et(r,t){return r.name+": "+t+(r.repeated&&t!=="array"?"[]":r.map&&t!=="object"?"{k:"+r.keyType+"}":"")+" expected"}function pl(r,t,e,n){if(t.resolvedType)if(t.resolvedType instanceof iy){r("switch(%s){",n)("default:")("return%j",Et(t,"enum value"));for(var i=Object.keys(t.resolvedType.values),a=0;a<i.length;++a)r("case %i:",t.resolvedType.values[i[a]]);r("break")("}")}else r("{")("var e=types[%i].verify(%s);",e,n)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":r("if(!util.isInteger(%s))",n)("return%j",Et(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":r("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",n,n,n,n)("return%j",Et(t,"integer|Long"));break;case"float":case"double":r('if(typeof %s!=="number")',n)("return%j",Et(t,"number"));break;case"bool":r('if(typeof %s!=="boolean")',n)("return%j",Et(t,"boolean"));break;case"string":r("if(!util.isString(%s))",n)("return%j",Et(t,"string"));break;case"bytes":r('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',n,n,n)("return%j",Et(t,"buffer"));break}return r}function ay(r,t,e){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":r("if(!util.key32Re.test(%s))",e)("return%j",Et(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":r("if(!util.key64Re.test(%s))",e)("return%j",Et(t,"integer|Long key"));break;case"bool":r("if(!util.key2Re.test(%s))",e)("return%j",Et(t,"boolean key"));break}return r}function oy(r){var t=ul.codegen(["m"],r.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),e=r.oneofsArray,n={};e.length&&t("var p={}");for(var i=0;i<r.fieldsArray.length;++i){var a=r._fieldsArray[i].resolve(),o="m"+ul.safeProp(a.name);if(a.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",o,a.name),a.map)t("if(!util.isObject(%s))",o)("return%j",Et(a,"object"))("var k=Object.keys(%s)",o)("for(var i=0;i<k.length;++i){"),ay(t,a,"k[i]"),pl(t,a,i,o+"[k[i]]")("}");else if(a.repeated)t("if(!Array.isArray(%s))",o)("return%j",Et(a,"array"))("for(var i=0;i<%s.length;++i){",o),pl(t,a,i,o+"[i]")("}");else{if(a.partOf){var l=ul.safeProp(a.partOf.name);n[a.partOf.name]===1&&t("if(p%s===1)",l)("return%j",a.partOf.name+": multiple values"),n[a.partOf.name]=1,t("p%s=1",l)}pl(t,a,i,o)}a.optional&&t("}")}return t("return null")}});var hl=te(Sd=>{"use strict";var Nd=Sd,Ei=St(),Bt=je();function fl(r,t,e,n){var i=!1;if(t.resolvedType)if(t.resolvedType instanceof Ei){r("switch(d%s){",n);for(var a=t.resolvedType.values,o=Object.keys(a),l=0;l<o.length;++l)a[o[l]]===t.typeDefault&&!i&&(r("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',n,n,n),t.repeated||r("break"),i=!0),r("case%j:",o[l])("case %i:",a[o[l]])("m%s=%j",n,a[o[l]])("break");r("}")}else r('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,e,n);else{var s=!1;switch(t.type){case"double":case"float":r("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":r("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":r("m%s=d%s|0",n,n);break;case"uint64":s=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":r("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,s)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,s?"true":"");break;case"bytes":r('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":r("m%s=String(d%s)",n,n);break;case"bool":r("m%s=Boolean(d%s)",n,n);break}}return r}Nd.fromObject=function(t){var e=t.fieldsArray,n=Bt.codegen(["d"],t.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!e.length)return n("return new this.ctor");n("var m=new this.ctor");for(var i=0;i<e.length;++i){var a=e[i].resolve(),o=Bt.safeProp(a.name);a.map?(n("if(d%s){",o)('if(typeof d%s!=="object")',o)("throw TypeError(%j)",a.fullName+": object expected")("m%s={}",o)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",o),fl(n,a,i,o+"[ks[i]]")("}")("}")):a.repeated?(n("if(d%s){",o)("if(!Array.isArray(d%s))",o)("throw TypeError(%j)",a.fullName+": array expected")("m%s=[]",o)("for(var i=0;i<d%s.length;++i){",o),fl(n,a,i,o+"[i]")("}")("}")):(a.resolvedType instanceof Ei||n("if(d%s!=null){",o),fl(n,a,i,o),a.resolvedType instanceof Ei||n("}"))}return n("return m")};function ml(r,t,e,n){if(t.resolvedType)t.resolvedType instanceof Ei?r("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",n,e,n,n,e,n,n):r("d%s=types[%i].toObject(m%s,o)",n,e,n);else{var i=!1;switch(t.type){case"double":case"float":r("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":i=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":r('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,i?"true":"",n);break;case"bytes":r("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:r("d%s=m%s",n,n);break}}return r}Nd.toObject=function(t){var e=t.fieldsArray.slice().sort(Bt.compareFieldsById);if(!e.length)return Bt.codegen()("return {}");for(var n=Bt.codegen(["m","o"],t.name+"$toObject")("if(!o)")("o={}")("var d={}"),i=[],a=[],o=[],l=0;l<e.length;++l)e[l].partOf||(e[l].resolve().repeated?i:e[l].map?a:o).push(e[l]);if(i.length){for(n("if(o.arrays||o.defaults){"),l=0;l<i.length;++l)n("d%s=[]",Bt.safeProp(i[l].name));n("}")}if(a.length){for(n("if(o.objects||o.defaults){"),l=0;l<a.length;++l)n("d%s={}",Bt.safeProp(a[l].name));n("}")}if(o.length){for(n("if(o.defaults){"),l=0;l<o.length;++l){var s=o[l],c=Bt.safeProp(s.name);if(s.resolvedType instanceof Ei)n("d%s=o.enums===String?%j:%j",c,s.resolvedType.valuesById[s.typeDefault],s.typeDefault);else if(s.long)n("if(util.Long){")("var n=new util.Long(%i,%i,%j)",s.typeDefault.low,s.typeDefault.high,s.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",c)("}else")("d%s=o.longs===String?%j:%i",c,s.typeDefault.toString(),s.typeDefault.toNumber());else if(s.bytes){var u="["+Array.prototype.slice.call(s.typeDefault).join(",")+"]";n("if(o.bytes===String)d%s=%j",c,String.fromCharCode.apply(String,s.typeDefault))("else{")("d%s=%s",c,u)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",c,c)("}")}else n("d%s=%j",c,s.typeDefault)}n("}")}var p=!1;for(l=0;l<e.length;++l){var s=e[l],f=t._fieldsArray.indexOf(s),c=Bt.safeProp(s.name);s.map?(p||(p=!0,n("var ks2")),n("if(m%s&&(ks2=Object.keys(m%s)).length){",c,c)("d%s={}",c)("for(var j=0;j<ks2.length;++j){"),ml(n,s,f,c+"[ks2[j]]")("}")):s.repeated?(n("if(m%s&&m%s.length){",c,c)("d%s=[]",c)("for(var j=0;j<m%s.length;++j){",c),ml(n,s,f,c+"[j]")("}")):(n("if(m%s!=null&&m.hasOwnProperty(%j)){",c,s.name),ml(n,s,f,c),s.partOf&&n("if(o.oneofs)")("d%s=%j",Bt.safeProp(s.partOf.name),s.name)),n("}")}return n("return d")}});var gl=te(Dd=>{"use strict";var sy=Dd,ly=Oa();sy[".google.protobuf.Any"]={fromObject:function(r){if(r&&r["@type"]){var t=r["@type"].substring(r["@type"].lastIndexOf("/")+1),e=this.lookup(t);if(e){var n=r["@type"].charAt(0)==="."?r["@type"].slice(1):r["@type"];return n.indexOf("/")===-1&&(n="/"+n),this.create({type_url:n,value:e.encode(e.fromObject(r)).finish()})}}return this.fromObject(r)},toObject:function(r,t){var e="type.googleapis.com/",n="",i="";if(t&&t.json&&r.type_url&&r.value){i=r.type_url.substring(r.type_url.lastIndexOf("/")+1),n=r.type_url.substring(0,r.type_url.lastIndexOf("/")+1);var a=this.lookup(i);a&&(r=a.decode(r.value))}if(!(r instanceof this.ctor)&&r instanceof ly){var o=r.$type.toObject(r,t),l=r.$type.fullName[0]==="."?r.$type.fullName.slice(1):r.$type.fullName;return n===""&&(n=e),i=n+l,o["@type"]=i,o}return this.toObject(r,t)}}});var La=te((j_,Od)=>{"use strict";Od.exports=Ae;var Dt=Nn();((Ae.prototype=Object.create(Dt.prototype)).constructor=Ae).className="Type";var cy=St(),xl=Cn(),Ia=vr(),uy=Sa(),py=Ra(),bl=Oa(),yl=Aa(),dy=Ta(),Ge=je(),fy=wl(),my=cl(),hy=dl(),Rd=hl(),gy=gl();function Ae(r,t){Dt.call(this,r,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}Object.defineProperties(Ae.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var r=Object.keys(this.fields),t=0;t<r.length;++t){var e=this.fields[r[t]],n=e.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=e}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=Ge.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=Ge.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=Ae.generateConstructor(this)())},set:function(r){var t=r.prototype;t instanceof bl||((r.prototype=new bl).constructor=r,Ge.merge(r.prototype,t)),r.$type=r.prototype.$type=this,Ge.merge(r,bl,!0),this._ctor=r;for(var e=0;e<this.fieldsArray.length;++e)this._fieldsArray[e].resolve();var n={};for(e=0;e<this.oneofsArray.length;++e)n[this._oneofsArray[e].resolve().name]={get:Ge.oneOfGetter(this._oneofsArray[e].oneof),set:Ge.oneOfSetter(this._oneofsArray[e].oneof)};e&&Object.defineProperties(r.prototype,n)}}});Ae.generateConstructor=function(t){for(var e=Ge.codegen(["p"],t.name),n=0,i;n<t.fieldsArray.length;++n)(i=t._fieldsArray[n]).map?e("this%s={}",Ge.safeProp(i.name)):i.repeated&&e("this%s=[]",Ge.safeProp(i.name));return e("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")};function Fa(r){return r._fieldsById=r._fieldsArray=r._oneofsArray=null,delete r.encode,delete r.decode,delete r.verify,r}Ae.fromJSON=function(t,e){var n=new Ae(t,e.options);n.extensions=e.extensions,n.reserved=e.reserved;for(var i=Object.keys(e.fields),a=0;a<i.length;++a)n.add((typeof e.fields[i[a]].keyType!="undefined"?uy.fromJSON:Ia.fromJSON)(i[a],e.fields[i[a]]));if(e.oneofs)for(i=Object.keys(e.oneofs),a=0;a<i.length;++a)n.add(xl.fromJSON(i[a],e.oneofs[i[a]]));if(e.nested)for(i=Object.keys(e.nested),a=0;a<i.length;++a){var o=e.nested[i[a]];n.add((o.id!==void 0?Ia.fromJSON:o.fields!==void 0?Ae.fromJSON:o.values!==void 0?cy.fromJSON:o.methods!==void 0?py.fromJSON:Dt.fromJSON)(i[a],o))}return e.extensions&&e.extensions.length&&(n.extensions=e.extensions),e.reserved&&e.reserved.length&&(n.reserved=e.reserved),e.group&&(n.group=!0),e.comment&&(n.comment=e.comment),n};Ae.prototype.toJSON=function(t){var e=Dt.prototype.toJSON.call(this,t),n=t?!!t.keepComments:!1;return Ge.toObject(["options",e&&e.options||void 0,"oneofs",Dt.arrayToJSON(this.oneofsArray,t),"fields",Dt.arrayToJSON(this.fieldsArray.filter(function(i){return!i.declaringField}),t)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",e&&e.nested||void 0,"comment",n?this.comment:void 0])};Ae.prototype.resolveAll=function(){for(var t=this.fieldsArray,e=0;e<t.length;)t[e++].resolve();var n=this.oneofsArray;for(e=0;e<n.length;)n[e++].resolve();return Dt.prototype.resolveAll.call(this)};Ae.prototype.get=function(t){return this.fields[t]||this.oneofs&&this.oneofs[t]||this.nested&&this.nested[t]||null};Ae.prototype.add=function(t){if(this.get(t.name))throw Error("duplicate name '"+t.name+"' in "+this);if(t instanceof Ia&&t.extend===void 0){if(this._fieldsById?this._fieldsById[t.id]:this.fieldsById[t.id])throw Error("duplicate id "+t.id+" in "+this);if(this.isReservedId(t.id))throw Error("id "+t.id+" is reserved in "+this);if(this.isReservedName(t.name))throw Error("name '"+t.name+"' is reserved in "+this);return t.parent&&t.parent.remove(t),this.fields[t.name]=t,t.message=this,t.onAdd(this),Fa(this)}return t instanceof xl?(this.oneofs||(this.oneofs={}),this.oneofs[t.name]=t,t.onAdd(this),Fa(this)):Dt.prototype.add.call(this,t)};Ae.prototype.remove=function(t){if(t instanceof Ia&&t.extend===void 0){if(!this.fields||this.fields[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.fields[t.name],t.parent=null,t.onRemove(this),Fa(this)}if(t instanceof xl){if(!this.oneofs||this.oneofs[t.name]!==t)throw Error(t+" is not a member of "+this);return delete this.oneofs[t.name],t.parent=null,t.onRemove(this),Fa(this)}return Dt.prototype.remove.call(this,t)};Ae.prototype.isReservedId=function(t){return Dt.isReservedId(this.reserved,t)};Ae.prototype.isReservedName=function(t){return Dt.isReservedName(this.reserved,t)};Ae.prototype.create=function(t){return new this.ctor(t)};Ae.prototype.setup=function(){for(var t=this.fullName,e=[],n=0;n<this.fieldsArray.length;++n)e.push(this._fieldsArray[n].resolve().resolvedType);this.encode=fy(this)({Writer:dy,types:e,util:Ge}),this.decode=my(this)({Reader:yl,types:e,util:Ge}),this.verify=hy(this)({types:e,util:Ge}),this.fromObject=Rd.fromObject(this)({types:e,util:Ge}),this.toObject=Rd.toObject(this)({types:e,util:Ge});var i=gy[t];if(i){var a=Object.create(this);a.fromObject=this.fromObject,this.fromObject=i.fromObject.bind(a),a.toObject=this.toObject,this.toObject=i.toObject.bind(a)}return this};Ae.prototype.encode=function(t,e){return this.setup().encode(t,e)};Ae.prototype.encodeDelimited=function(t,e){return this.encode(t,e&&e.len?e.fork():e).ldelim()};Ae.prototype.decode=function(t,e){return this.setup().decode(t,e)};Ae.prototype.decodeDelimited=function(t){return t instanceof yl||(t=yl.create(t)),this.decode(t,t.uint32())};Ae.prototype.verify=function(t){return this.setup().verify(t)};Ae.prototype.fromObject=function(t){return this.setup().fromObject(t)};Ae.prototype.toObject=function(t,e){return this.setup().toObject(t,e)};Ae.d=function(t){return function(n){Ge.decorateType(n,t)}}});var Ba=te((U_,$d)=>{"use strict";$d.exports=pt;var $a=Nn();((pt.prototype=Object.create($a.prototype)).constructor=pt).className="Root";var El=vr(),Fd=St(),by=Cn(),Tr=je(),Ld,vl,Ti;function pt(r){$a.call(this,"",r),this.deferred=[],this.files=[]}pt.fromJSON=function(t,e){return e||(e=new pt),t.options&&e.setOptions(t.options),e.addJSON(t.nested)};pt.prototype.resolvePath=Tr.path.resolve;pt.prototype.fetch=Tr.fetch;function Md(){}pt.prototype.load=function r(t,e,n){typeof e=="function"&&(n=e,e=void 0);var i=this;if(!n)return Tr.asPromise(r,i,t,e);var a=n===Md;function o(d,g){if(n){var m=n;if(n=null,a)throw d;m(d,g)}}function l(d){var g=d.lastIndexOf("google/protobuf/");if(g>-1){var m=d.substring(g);if(m in Ti)return m}return null}function s(d,g){try{if(Tr.isString(g)&&g.charAt(0)==="{"&&(g=JSON.parse(g)),!Tr.isString(g))i.setOptions(g.options).addJSON(g.nested);else{vl.filename=d;var m=vl(g,i,e),h,b=0;if(m.imports)for(;b<m.imports.length;++b)(h=l(m.imports[b])||i.resolvePath(d,m.imports[b]))&&c(h);if(m.weakImports)for(b=0;b<m.weakImports.length;++b)(h=l(m.weakImports[b])||i.resolvePath(d,m.weakImports[b]))&&c(h,!0)}}catch(_){o(_)}!a&&!u&&o(null,i)}function c(d,g){if(d=l(d)||d,!(i.files.indexOf(d)>-1)){if(i.files.push(d),d in Ti){a?s(d,Ti[d]):(++u,setTimeout(function(){--u,s(d,Ti[d])}));return}if(a){var m;try{m=Tr.fs.readFileSync(d).toString("utf8")}catch(h){g||o(h);return}s(d,m)}else++u,i.fetch(d,function(h,b){if(--u,!!n){if(h){g?u||o(null,i):o(h);return}s(d,b)}})}}var u=0;Tr.isString(t)&&(t=[t]);for(var p=0,f;p<t.length;++p)(f=i.resolvePath("",t[p]))&&c(f);if(a)return i;u||o(null,i)};pt.prototype.loadSync=function(t,e){if(!Tr.isNode)throw Error("not supported");return this.load(t,e,Md)};pt.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map(function(t){return"'extend "+t.extend+"' in "+t.parent.fullName}).join(", "));return $a.prototype.resolveAll.call(this)};var Ma=/^[A-Z]/;function Id(r,t){var e=t.parent.lookup(t.extend);if(e){var n=new El(t.fullName,t.id,t.type,t.rule,void 0,t.options);return e.get(n.name)||(n.declaringField=t,t.extensionField=n,e.add(n)),!0}return!1}pt.prototype._handleAdd=function(t){if(t instanceof El)t.extend!==void 0&&!t.extensionField&&(Id(this,t)||this.deferred.push(t));else if(t instanceof Fd)Ma.test(t.name)&&(t.parent[t.name]=t.values);else if(!(t instanceof by)){if(t instanceof Ld)for(var e=0;e<this.deferred.length;)Id(this,this.deferred[e])?this.deferred.splice(e,1):++e;for(var n=0;n<t.nestedArray.length;++n)this._handleAdd(t._nestedArray[n]);Ma.test(t.name)&&(t.parent[t.name]=t)}};pt.prototype._handleRemove=function(t){if(t instanceof El){if(t.extend!==void 0)if(t.extensionField)t.extensionField.parent.remove(t.extensionField),t.extensionField=null;else{var e=this.deferred.indexOf(t);e>-1&&this.deferred.splice(e,1)}}else if(t instanceof Fd)Ma.test(t.name)&&delete t.parent[t.name];else if(t instanceof $a){for(var n=0;n<t.nestedArray.length;++n)this._handleRemove(t._nestedArray[n]);Ma.test(t.name)&&delete t.parent[t.name]}};pt._configure=function(r,t,e){Ld=r,vl=t,Ti=e}});var je=te((H_,qd)=>{"use strict";var De=qd.exports=Lt(),Bd=Qs(),Tl,_l;De.codegen=id();De.fetch=od();De.path=cd();De.fs=De.inquire("fs");De.toArray=function(t){if(t){for(var e=Object.keys(t),n=new Array(e.length),i=0;i<e.length;)n[i]=t[e[i++]];return n}return[]};De.toObject=function(t){for(var e={},n=0;n<t.length;){var i=t[n++],a=t[n++];a!==void 0&&(e[i]=a)}return e};var yy=/\\/g,xy=/"/g;De.isReserved=function(t){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(t)};De.safeProp=function(t){return!/^[$\w_]+$/.test(t)||De.isReserved(t)?'["'+t.replace(yy,"\\\\").replace(xy,'\\"')+'"]':"."+t};De.ucFirst=function(t){return t.charAt(0).toUpperCase()+t.substring(1)};var wy=/_([a-z])/g;De.camelCase=function(t){return t.substring(0,1)+t.substring(1).replace(wy,function(e,n){return n.toUpperCase()})};De.compareFieldsById=function(t,e){return t.id-e.id};De.decorateType=function(t,e){if(t.$type)return e&&t.$type.name!==e&&(De.decorateRoot.remove(t.$type),t.$type.name=e,De.decorateRoot.add(t.$type)),t.$type;Tl||(Tl=La());var n=new Tl(e||t.name);return De.decorateRoot.add(n),n.ctor=t,Object.defineProperty(t,"$type",{value:n,enumerable:!1}),Object.defineProperty(t.prototype,"$type",{value:n,enumerable:!1}),n};var vy=0;De.decorateEnum=function(t){if(t.$type)return t.$type;_l||(_l=St());var e=new _l("Enum"+vy++,t);return De.decorateRoot.add(e),Object.defineProperty(t,"$type",{value:e,enumerable:!1}),e};De.setProperty=function(t,e,n){function i(a,o,l){var s=o.shift();if(s==="__proto__"||s==="prototype")return a;if(o.length>0)a[s]=i(a[s]||{},o,l);else{var c=a[s];c&&(l=[].concat(c).concat(l)),a[s]=l}return a}if(typeof t!="object")throw TypeError("dst must be an object");if(!e)throw TypeError("path must be specified");return e=e.split("."),i(t,e,n)};Object.defineProperty(De,"decorateRoot",{get:function(){return Bd.decorated||(Bd.decorated=new(Ba()))}})});var Xr=te((W_,jd)=>{"use strict";jd.exports=dt;dt.className="ReflectionObject";var qa=je(),ja;function dt(r,t){if(!qa.isString(r))throw TypeError("name must be a string");if(t&&!qa.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=r,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(dt.prototype,{root:{get:function(){for(var r=this;r.parent!==null;)r=r.parent;return r}},fullName:{get:function(){for(var r=[this.name],t=this.parent;t;)r.unshift(t.name),t=t.parent;return r.join(".")}}});dt.prototype.toJSON=function(){throw Error()};dt.prototype.onAdd=function(t){this.parent&&this.parent!==t&&this.parent.remove(this),this.parent=t,this.resolved=!1;var e=t.root;e instanceof ja&&e._handleAdd(this)};dt.prototype.onRemove=function(t){var e=t.root;e instanceof ja&&e._handleRemove(this),this.parent=null,this.resolved=!1};dt.prototype.resolve=function(){return this.resolved?this:(this.root instanceof ja&&(this.resolved=!0),this)};dt.prototype.getOption=function(t){if(this.options)return this.options[t]};dt.prototype.setOption=function(t,e,n){return(!n||!this.options||this.options[t]===void 0)&&((this.options||(this.options={}))[t]=e),this};dt.prototype.setParsedOption=function(t,e,n){this.parsedOptions||(this.parsedOptions=[]);var i=this.parsedOptions;if(n){var a=i.find(function(s){return Object.prototype.hasOwnProperty.call(s,t)});if(a){var o=a[t];qa.setProperty(o,n,e)}else a={},a[t]=qa.setProperty({},n,e),i.push(a)}else{var l={};l[t]=e,i.push(l)}return this};dt.prototype.setOptions=function(t,e){if(t)for(var n=Object.keys(t),i=0;i<n.length;++i)this.setOption(n[i],t[n[i]],e);return this};dt.prototype.toString=function(){var t=this.constructor.className,e=this.fullName;return e.length?t+" "+e:t};dt._configure=function(r){ja=r}});var St=te((V_,Wd)=>{"use strict";Wd.exports=qt;var Ud=Xr();((qt.prototype=Object.create(Ud.prototype)).constructor=qt).className="Enum";var Hd=Nn(),Ua=je();function qt(r,t,e,n,i,a){if(Ud.call(this,r,e),t&&typeof t!="object")throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=n,this.comments=i||{},this.valuesOptions=a,this.reserved=void 0,t)for(var o=Object.keys(t),l=0;l<o.length;++l)typeof t[o[l]]=="number"&&(this.valuesById[this.values[o[l]]=t[o[l]]]=o[l])}qt.fromJSON=function(t,e){var n=new qt(t,e.values,e.options,e.comment,e.comments);return n.reserved=e.reserved,n};qt.prototype.toJSON=function(t){var e=t?!!t.keepComments:!1;return Ua.toObject(["options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",e?this.comment:void 0,"comments",e?this.comments:void 0])};qt.prototype.add=function(t,e,n,i){if(!Ua.isString(t))throw TypeError("name must be a string");if(!Ua.isInteger(e))throw TypeError("id must be an integer");if(this.values[t]!==void 0)throw Error("duplicate name '"+t+"' in "+this);if(this.isReservedId(e))throw Error("id "+e+" is reserved in "+this);if(this.isReservedName(t))throw Error("name '"+t+"' is reserved in "+this);if(this.valuesById[e]!==void 0){if(!(this.options&&this.options.allow_alias))throw Error("duplicate id "+e+" in "+this);this.values[t]=e}else this.valuesById[this.values[t]=e]=t;return i&&(this.valuesOptions===void 0&&(this.valuesOptions={}),this.valuesOptions[t]=i||null),this.comments[t]=n||null,this};qt.prototype.remove=function(t){if(!Ua.isString(t))throw TypeError("name must be a string");var e=this.values[t];if(e==null)throw Error("name '"+t+"' does not exist in "+this);return delete this.valuesById[e],delete this.values[t],delete this.comments[t],this.valuesOptions&&delete this.valuesOptions[t],this};qt.prototype.isReservedId=function(t){return Hd.isReservedId(this.reserved,t)};qt.prototype.isReservedName=function(t){return Hd.isReservedName(this.reserved,t)}});var wl=te((z_,zd)=>{"use strict";zd.exports=Ty;var Ey=St(),Al=Kr(),Cl=je();function Vd(r,t,e,n){return t.resolvedType.group?r("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",e,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):r("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",e,n,(t.id<<3|2)>>>0)}function Ty(r){for(var t=Cl.codegen(["m","w"],r.name+"$encode")("if(!w)")("w=Writer.create()"),e,n,i=r.fieldsArray.slice().sort(Cl.compareFieldsById),e=0;e<i.length;++e){var a=i[e].resolve(),o=r._fieldsArray.indexOf(a),l=a.resolvedType instanceof Ey?"int32":a.type,s=Al.basic[l];n="m"+Cl.safeProp(a.name),a.map?(t("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",n,a.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",n)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(a.id<<3|2)>>>0,8|Al.mapKey[a.keyType],a.keyType),s===void 0?t("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",o,n):t(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|s,l,n),t("}")("}")):a.repeated?(t("if(%s!=null&&%s.length){",n,n),a.packed&&Al.packed[l]!==void 0?t("w.uint32(%i).fork()",(a.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",n)("w.%s(%s[i])",l,n)("w.ldelim()"):(t("for(var i=0;i<%s.length;++i)",n),s===void 0?Vd(t,a,o,n+"[i]"):t("w.uint32(%i).%s(%s[i])",(a.id<<3|s)>>>0,l,n)),t("}")):(a.optional&&t("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",n,a.name),s===void 0?Vd(t,a,o,n):t("w.uint32(%i).%s(%s)",(a.id<<3|s)>>>0,l,n))}return t("return w")}});var Yd=te((G_,Gd)=>{"use strict";var me=Gd.exports=rd();me.build="light";function _y(r,t,e){return typeof t=="function"?(e=t,t=new me.Root):t||(t=new me.Root),t.load(r,e)}me.load=_y;function Ay(r,t){return t||(t=new me.Root),t.loadSync(r)}me.loadSync=Ay;me.encoder=wl();me.decoder=cl();me.verifier=dl();me.converter=hl();me.ReflectionObject=Xr();me.Namespace=Nn();me.Root=Ba();me.Enum=St();me.Type=La();me.Field=vr();me.OneOf=Cn();me.MapField=Sa();me.Service=Ra();me.Method=Da();me.Message=Oa();me.wrappers=gl();me.types=Kr();me.util=je();me.ReflectionObject._configure(me.Root);me.Namespace._configure(me.Type,me.Service,me.Enum);me.Root._configure(me.Type);me.Field._configure(me.Type)});var Pl=te((Y_,Xd)=>{"use strict";Xd.exports=Kd;var kl=/[\s{}=;:[\],'"()<>]/g,Cy=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,ky=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,Py=/^ *[*/]+ */,Ny=/^\s*\*?\/*/,Sy=/\n/g,Dy=/\s/,Ry=/\\(.?)/g,Oy={0:"\0",r:"\r",n:`
`,t:" "};function Zd(r){return r.replace(Ry,function(t,e){switch(e){case"\\":case"":return e;default:return Oy[e]||""}})}Kd.unescape=Zd;function Kd(r,t){r=r.toString();var e=0,n=r.length,i=1,a=0,o={},l=[],s=null;function c(k){return Error("illegal "+k+" (line "+i+")")}function u(){var k=s==="'"?ky:Cy;k.lastIndex=e-1;var O=k.exec(r);if(!O)throw c("string");return e=k.lastIndex,h(s),s=null,Zd(O[1])}function p(k){return r.charAt(k)}function f(k,O,w){var C={type:r.charAt(k++),lineEmpty:!1,leading:w},y;t?y=2:y=3;var S=k-y,D;do if(--S<0||(D=r.charAt(S))===`
`){C.lineEmpty=!0;break}while(D===" "||D===" ");for(var R=r.substring(k,O).split(Sy),M=0;M<R.length;++M)R[M]=R[M].replace(t?Ny:Py,"").trim();C.text=R.join(`
`).trim(),o[i]=C,a=i}function d(k){var O=g(k),w=r.substring(k,O),C=/^\s*\/\//.test(w);return C}function g(k){for(var O=k;O<n&&p(O)!==`
`;)O++;return O}function m(){if(l.length>0)return l.shift();if(s)return u();var k,O,w,C,y,S=e===0;do{if(e===n)return null;for(k=!1;Dy.test(w=p(e));)if(w===`
`&&(S=!0,++i),++e===n)return null;if(p(e)==="/"){if(++e===n)throw c("comment");if(p(e)==="/")if(t){if(C=e,y=!1,d(e-1)){y=!0;do if(e=g(e),e===n||(e++,!S))break;while(d(e))}else e=Math.min(n,g(e)+1);y&&(f(C,e,S),S=!0),i++,k=!0}else{for(y=p(C=e+1)==="/";p(++e)!==`
`;)if(e===n)return null;++e,y&&(f(C,e-1,S),S=!0),++i,k=!0}else if((w=p(e))==="*"){C=e+1,y=t||p(C)==="*";do{if(w===`
`&&++i,++e===n)throw c("comment");O=w,w=p(e)}while(O!=="*"||w!=="/");++e,y&&(f(C,e-2,S),S=!0),k=!0}else return"/"}}while(k);var D=e;kl.lastIndex=0;var R=kl.test(p(D++));if(!R)for(;D<n&&!kl.test(p(D));)++D;var M=r.substring(e,e=D);return(M==='"'||M==="'")&&(s=M),M}function h(k){l.push(k)}function b(){if(!l.length){var k=m();if(k===null)return null;h(k)}return l[0]}function _(k,O){var w=b(),C=w===k;if(C)return m(),!0;if(!O)throw c("token '"+w+"', '"+k+"' expected");return!1}function N(k){var O=null,w;return k===void 0?(w=o[i-1],delete o[i-1],w&&(t||w.type==="*"||w.lineEmpty)&&(O=w.leading?w.text:null)):(a<k&&b(),w=o[k],delete o[k],w&&!w.lineEmpty&&(t||w.type==="/")&&(O=w.leading?null:w.text)),O}return Object.defineProperty({next:m,peek:b,push:h,skip:_,cmnt:N},"line",{get:function(){return i}})}});var nf=te((Z_,rf)=>{"use strict";rf.exports=Qt;Qt.filename=null;Qt.defaults={keepCase:!1};var Iy=Pl(),Jd=Ba(),Qd=La(),ef=vr(),Fy=Sa(),tf=Cn(),Ly=St(),My=Ra(),$y=Da(),Nl=Kr(),Sl=je(),By=/^[1-9][0-9]*$/,qy=/^-?[1-9][0-9]*$/,jy=/^0[x][0-9a-fA-F]+$/,Uy=/^-?0[x][0-9a-fA-F]+$/,Hy=/^0[0-7]+$/,Wy=/^-?0[0-7]+$/,Vy=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,jt=/^[a-zA-Z_][a-zA-Z_0-9]*$/,Ut=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,zy=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function Qt(r,t,e){t instanceof Jd||(e=t,t=new Jd),e||(e=Qt.defaults);var n=e.preferTrailingComment||!1,i=Iy(r,e.alternateCommentMode||!1),a=i.next,o=i.push,l=i.peek,s=i.skip,c=i.cmnt,u=!0,p,f,d,g,m=!1,h=t,b=e.keepCase?function(A){return A}:Sl.camelCase;function _(A,L,j){var z=Qt.filename;return j||(Qt.filename=null),Error("illegal "+(L||"token")+" '"+A+"' ("+(z?z+", ":"")+"line "+i.line+")")}function N(){var A=[],L;do{if((L=a())!=='"'&&L!=="'")throw _(L);A.push(a()),s(L),L=l()}while(L==='"'||L==="'");return A.join("")}function k(A){var L=a();switch(L){case"'":case'"':return o(L),N();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return w(L,!0)}catch(j){if(A&&Ut.test(L))return L;throw _(L,"value")}}function O(A,L){var j,z;do L&&((j=l())==='"'||j==="'")?A.push(N()):A.push([z=C(a()),s("to",!0)?C(a()):z]);while(s(",",!0));s(";")}function w(A,L){var j=1;switch(A.charAt(0)==="-"&&(j=-1,A=A.substring(1)),A){case"inf":case"INF":case"Inf":return j*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(By.test(A))return j*parseInt(A,10);if(jy.test(A))return j*parseInt(A,16);if(Hy.test(A))return j*parseInt(A,8);if(Vy.test(A))return j*parseFloat(A);throw _(A,"number",L)}function C(A,L){switch(A){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!L&&A.charAt(0)==="-")throw _(A,"id");if(qy.test(A))return parseInt(A,10);if(Uy.test(A))return parseInt(A,16);if(Wy.test(A))return parseInt(A,8);throw _(A,"id")}function y(){if(p!==void 0)throw _("package");if(p=a(),!Ut.test(p))throw _(p,"name");h=h.define(p),s(";")}function S(){var A=l(),L;switch(A){case"weak":L=d||(d=[]),a();break;case"public":a();default:L=f||(f=[]);break}A=N(),s(";"),L.push(A)}function D(){if(s("="),g=N(),m=g==="proto3",!m&&g!=="proto2")throw _(g,"syntax");s(";")}function R(A,L){switch(L){case"option":return Z(A,L),s(";"),!0;case"message":return I(A,L),!0;case"enum":return X(A,L),!0;case"service":return xe(A,L),!0;case"extend":return x(A,L),!0}return!1}function M(A,L,j){var z=i.line;if(A&&(typeof A.comment!="string"&&(A.comment=c()),A.filename=Qt.filename),s("{",!0)){for(var V;(V=a())!=="}";)L(V);s(";",!0)}else j&&j(),s(";"),A&&(typeof A.comment!="string"||n)&&(A.comment=c(z)||A.comment)}function I(A,L){if(!jt.test(L=a()))throw _(L,"type name");var j=new Qd(L);M(j,function(V){if(!R(j,V))switch(V){case"map":H(j,V);break;case"required":case"repeated":q(j,V);break;case"optional":m?q(j,"proto3_optional"):q(j,"optional");break;case"oneof":W(j,V);break;case"extensions":O(j.extensions||(j.extensions=[]));break;case"reserved":O(j.reserved||(j.reserved=[]),!0);break;default:if(!m||!Ut.test(V))throw _(V);o(V),q(j,"optional");break}}),A.add(j)}function q(A,L,j){var z=a();if(z==="group"){U(A,L);return}for(;z.endsWith(".")||l().startsWith(".");)z+=a();if(!Ut.test(z))throw _(z,"type");var V=a();if(!jt.test(V))throw _(V,"name");V=b(V),s("=");var G=new ef(V,C(a()),z,L,j);if(M(G,function(we){if(we==="option")Z(G,we),s(";");else throw _(we)},function(){ye(G)}),L==="proto3_optional"){var de=new tf("_"+V);G.setOption("proto3_optional",!0),de.add(G),A.add(de)}else A.add(G);!m&&G.repeated&&(Nl.packed[z]!==void 0||Nl.basic[z]===void 0)&&G.setOption("packed",!1,!0)}function U(A,L){var j=a();if(!jt.test(j))throw _(j,"name");var z=Sl.lcFirst(j);j===z&&(j=Sl.ucFirst(j)),s("=");var V=C(a()),G=new Qd(j);G.group=!0;var de=new ef(z,V,j,L);de.filename=Qt.filename,M(G,function(we){switch(we){case"option":Z(G,we),s(";");break;case"required":case"repeated":q(G,we);break;case"optional":m?q(G,"proto3_optional"):q(G,"optional");break;case"message":I(G,we);break;case"enum":X(G,we);break;default:throw _(we)}}),A.add(G).add(de)}function H(A){s("<");var L=a();if(Nl.mapKey[L]===void 0)throw _(L,"type");s(",");var j=a();if(!Ut.test(j))throw _(j,"type");s(">");var z=a();if(!jt.test(z))throw _(z,"name");s("=");var V=new Fy(b(z),C(a()),L,j);M(V,function(de){if(de==="option")Z(V,de),s(";");else throw _(de)},function(){ye(V)}),A.add(V)}function W(A,L){if(!jt.test(L=a()))throw _(L,"name");var j=new tf(b(L));M(j,function(V){V==="option"?(Z(j,V),s(";")):(o(V),q(j,"optional"))}),A.add(j)}function X(A,L){if(!jt.test(L=a()))throw _(L,"name");var j=new Ly(L);M(j,function(V){switch(V){case"option":Z(j,V),s(";");break;case"reserved":O(j.reserved||(j.reserved=[]),!0);break;default:se(j,V)}}),A.add(j)}function se(A,L){if(!jt.test(L))throw _(L,"name");s("=");var j=C(a(),!0),z={options:void 0};z.setOption=function(V,G){this.options===void 0&&(this.options={}),this.options[V]=G},M(z,function(G){if(G==="option")Z(z,G),s(";");else throw _(G)},function(){ye(z)}),A.add(L,j,z.comment,z.options)}function Z(A,L){var j=s("(",!0);if(!Ut.test(L=a()))throw _(L,"name");var z=L,V=z,G;j&&(s(")"),z="("+z+")",V=z,L=l(),zy.test(L)&&(G=L.slice(1),z+=L,a())),s("=");var de=pe(A,z);ce(A,V,de,G)}function pe(A,L){if(s("{",!0)){for(var j={};!s("}",!0);){if(!jt.test(F=a()))throw _(F,"name");if(F===null)throw _(F,"end of input");var z,V=F;if(s(":",!0),l()==="{")z=pe(A,L+"."+F);else if(l()==="["){z=[];var G;if(s("[",!0)){do G=k(!0),z.push(G);while(s(",",!0));s("]"),typeof G!="undefined"&&ie(A,L+"."+F,G)}}else z=k(!0),ie(A,L+"."+F,z);var de=j[V];de&&(z=[].concat(de).concat(z)),j[V]=z,s(",",!0),s(";",!0)}return j}var fe=k(!0);return ie(A,L,fe),fe}function ie(A,L,j){A.setOption&&A.setOption(L,j)}function ce(A,L,j,z){A.setParsedOption&&A.setParsedOption(L,j,z)}function ye(A){if(s("[",!0)){do Z(A,"option");while(s(",",!0));s("]")}return A}function xe(A,L){if(!jt.test(L=a()))throw _(L,"service name");var j=new My(L);M(j,function(V){if(!R(j,V))if(V==="rpc")E(j,V);else throw _(V)}),A.add(j)}function E(A,L){var j=c(),z=L;if(!jt.test(L=a()))throw _(L,"name");var V=L,G,de,fe,we;if(s("("),s("stream",!0)&&(de=!0),!Ut.test(L=a())||(G=L,s(")"),s("returns"),s("("),s("stream",!0)&&(we=!0),!Ut.test(L=a())))throw _(L);fe=L,s(")");var ft=new $y(V,z,G,fe,de,we);ft.comment=j,M(ft,function(ve){if(ve==="option")Z(ft,ve),s(";");else throw _(ve)}),A.add(ft)}function x(A,L){if(!Ut.test(L=a()))throw _(L,"reference");var j=L;M(null,function(V){switch(V){case"required":case"repeated":q(A,V,j);break;case"optional":m?q(A,"proto3_optional",j):q(A,"optional",j);break;default:if(!m||!Ut.test(V))throw _(V);o(V),q(A,"optional",j);break}})}for(var F;(F=a())!==null;)switch(F){case"package":if(!u)throw _(F);y();break;case"import":if(!u)throw _(F);S();break;case"syntax":if(!u)throw _(F);D();break;case"option":Z(h,F),s(";");break;default:if(R(h,F)){u=!1;continue}throw _(F)}return Qt.filename=null,{package:p,imports:f,weakImports:d,syntax:g,root:t}}});var sf=te((K_,of)=>{"use strict";of.exports=Rt;var Gy=/\/|\./;function Rt(r,t){Gy.test(r)||(r="google/protobuf/"+r+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),Rt[r]=t}Rt("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}});var af;Rt("duration",{Duration:af={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}});Rt("timestamp",{Timestamp:af});Rt("empty",{Empty:{fields:{}}});Rt("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}});Rt("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}});Rt("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}});Rt.get=function(t){return Rt[t]||null}});var cf=te((X_,lf)=>{"use strict";var _r=lf.exports=Yd();_r.build="full";_r.tokenize=Pl();_r.parse=nf();_r.common=sf();_r.Root._configure(_r.Type,_r.parse,_r.common)});var pf=te((J_,uf)=>{"use strict";uf.exports=cf()});var Uf=te(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});var Pf=/highlight-(?:text|source)-([a-z0-9]+)/;function Sf(r){r.addRule("highlightedCodeBlock",{filter:function(t){var e=t.firstChild;return t.nodeName==="DIV"&&Pf.test(t.className)&&e&&e.nodeName==="PRE"},replacement:function(t,e,n){var i=e.className||"",a=(i.match(Pf)||[null,""])[1];return`
`+n.fence+a+`
`+e.firstChild.textContent+`
`+n.fence+`
`}})}function Df(r){r.addRule("strikethrough",{filter:["del","s","strike"],replacement:function(t){return"~~"+t+"~~"}})}var _x=Array.prototype.indexOf,Ax=Array.prototype.every,kr={},Cx={left:":---",right:"---:",center:":---:"},$l=null,Rf=null,Nf=new WeakMap;function kx(r){return r?(r.getAttribute("align")||r.style.textAlign||"").toLowerCase():""}function Of(r){return r?Cx[r]:"---"}function If(r,t){for(var e={left:0,right:0,center:0,"":0},n="",i=0;i<r.rows.length;++i){var a=r.rows[i];if(t<a.childNodes.length){var o=kx(a.childNodes[t]);++e[o],e[o]>e[n]&&(n=o)}}return n}kr.tableCell={filter:["th","td"],replacement:function(r,t){return ql($f(t))?r:Ff(r,t)}};kr.tableRow={filter:"tr",replacement:function(r,t){let e=$f(t);if(ql(e))return r;var n="";if(Px(t)){let o=Bf(e);for(var i=0;i<o;i++){let l=i<t.childNodes.length?t.childNodes[i]:null;var a=Of(If(e,i));n+=Ff(a,l,i)}}return`
`+r+(n?`
`+n:"")}};kr.table={filter:function(r,t){return r.nodeName==="TABLE"},replacement:function(r,t){if(Mf(t,Rf)){let l=t.outerHTML,s=Dx(t);return s===null||!s.classList.contains("joplin-table-wrapper")?`
<div class="joplin-table-wrapper">${l}</div>
`:l}else{if(ql(t))return r;r=r.replace(/\n+/g,`
`);var e=r.trim().split(`
`);e.length>=2&&(e=e[1]);var n=/\| :?---/.test(e),i=Bf(t),a="";if(i&&!n){a="|"+" |".repeat(i)+`
|`;for(var o=0;o<i;++o)a+=" "+Of(If(t,o))+" |"}let l=t.caption&&t.caption.textContent||"",s=l?`${l}
`:"",c=`${a}${r}`.trimStart();return`
${s}${c}
`}}};kr.tableCaption={filter:["caption"],replacement:()=>""};kr.tableColgroup={filter:["colgroup","col"],replacement:()=>""};kr.tableSection={filter:["thead","tbody","tfoot"],replacement:function(r){return r}};function Px(r){var t=r.parentNode;return t.nodeName==="THEAD"||t.firstChild===r&&(t.nodeName==="TABLE"||Nx(t))&&Ax.call(r.childNodes,function(e){return e.nodeName==="TH"})}function Nx(r){var t=r.previousSibling;return r.nodeName==="TBODY"&&(!t||t.nodeName==="THEAD"&&/^\s*$/i.test(t.textContent))}function Ff(r,t=null,e=null){e===null&&(e=_x.call(t.parentNode.childNodes,t));var n=" ";e===0&&(n="| ");let i=r.trim().replace(/\n\r/g,"<br>").replace(/\n/g,"<br>");for(i=i.replace(/\|+/g,"\\|");i.length<3;)i+=" ";return t&&(i=Rx(i,t," ")),n+i+" |"}function Lf(r){if(!r.childNodes)return!1;for(let t=0;t<r.childNodes.length;t++){let e=r.childNodes[t];if(e.nodeName==="TABLE"||Lf(e))return!0}return!1}var Bl=(r,t)=>{if(!r.childNodes)return!1;for(let e=0;e<r.childNodes.length;e++){let n=r.childNodes[e];if(t==="code"&&$l&&$l(n)||t.includes(n.nodeName)||Bl(n,t))return!0}return!1},Mf=(r,t)=>{let e=["UL","OL","H1","H2","H3","H4","H5","H6","HR","BLOCKQUOTE"];return t.preserveNestedTables&&e.push("TABLE"),Bl(r,"code")||Bl(r,e)};function ql(r){let t=Nf.get(r);if(t!==void 0)return t;let e=Sx(r);return Nf.set(r,e),e}function Sx(r){return!!(!r||!r.rows||r.rows.length===1&&r.rows[0].childNodes.length<=1||Lf(r))}function Dx(r){let t=r.parentNode;for(;t.nodeName!=="DIV";)if(t=t.parentNode,!t)return null;return t}function $f(r){let t=r.parentNode;for(;t.nodeName!=="TABLE";)if(t=t.parentNode,!t)return null;return t}function Rx(r,t,e){let n=t.getAttribute("colspan")||1;for(let i=1;i<n;i++)r+=" | "+e.repeat(3);return r}function Bf(r){let t=0;for(let e=0;e<r.rows.length;e++){let i=r.rows[e].childNodes.length;i>t&&(t=i)}return t}function qf(r){$l=r.isCodeBlock,Rf=r.options,r.keep(function(e){return!!(e.nodeName==="TABLE"&&Mf(e,r.options))});for(var t in kr)r.addRule(t,kr[t])}function jf(r){r.addRule("taskListItems",{filter:function(t){return t.type==="checkbox"&&t.parentNode.nodeName==="LI"},replacement:function(t,e){return(e.checked?"[x]":"[ ]")+" "}})}function Ox(r){r.use([Sf,Df,qf,jf])}en.gfm=Ox;en.highlightedCodeBlock=Sf;en.strikethrough=Df;en.tables=qf;en.taskListItems=jf});var Th=te(ao=>{(function(r){r.parser=function(E,x){return new e(E,x)},r.SAXParser=e,r.SAXStream=c,r.createStream=s,r.MAX_BUFFER_LENGTH=64*1024;var t=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];r.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function e(E,x){if(!(this instanceof e))return new e(E,x);var F=this;i(F),F.q=F.c="",F.bufferCheckPosition=r.MAX_BUFFER_LENGTH,F.opt=x||{},F.opt.lowercase=F.opt.lowercase||F.opt.lowercasetags,F.looseCase=F.opt.lowercase?"toLowerCase":"toUpperCase",F.tags=[],F.closed=F.closedRoot=F.sawRoot=!1,F.tag=F.error=null,F.strict=!!E,F.noscript=!!(E||F.opt.noscript),F.state=y.BEGIN,F.strictEntities=F.opt.strictEntities,F.ENTITIES=F.strictEntities?Object.create(r.XML_ENTITIES):Object.create(r.ENTITIES),F.attribList=[],F.opt.xmlns&&(F.ns=Object.create(g)),F.opt.unquotedAttributeValues===void 0&&(F.opt.unquotedAttributeValues=!E),F.trackPosition=F.opt.position!==!1,F.trackPosition&&(F.position=F.line=F.column=0),D(F,"onready")}Object.create||(Object.create=function(E){function x(){}x.prototype=E;var F=new x;return F}),Object.keys||(Object.keys=function(E){var x=[];for(var F in E)E.hasOwnProperty(F)&&x.push(F);return x});function n(E){for(var x=Math.max(r.MAX_BUFFER_LENGTH,10),F=0,A=0,L=t.length;A<L;A++){var j=E[t[A]].length;if(j>x)switch(t[A]){case"textNode":M(E);break;case"cdata":R(E,"oncdata",E.cdata),E.cdata="";break;case"script":R(E,"onscript",E.script),E.script="";break;default:q(E,"Max buffer length exceeded: "+t[A])}F=Math.max(F,j)}var z=r.MAX_BUFFER_LENGTH-F;E.bufferCheckPosition=z+E.position}function i(E){for(var x=0,F=t.length;x<F;x++)E[t[x]]=""}function a(E){M(E),E.cdata!==""&&(R(E,"oncdata",E.cdata),E.cdata=""),E.script!==""&&(R(E,"onscript",E.script),E.script="")}e.prototype={end:function(){U(this)},write:xe,resume:function(){return this.error=null,this},close:function(){return this.write(null)},flush:function(){a(this)}};var o;try{o=require("stream").Stream}catch(E){o=function(){}}o||(o=function(){});var l=r.EVENTS.filter(function(E){return E!=="error"&&E!=="end"});function s(E,x){return new c(E,x)}function c(E,x){if(!(this instanceof c))return new c(E,x);o.apply(this),this._parser=new e(E,x),this.writable=!0,this.readable=!0;var F=this;this._parser.onend=function(){F.emit("end")},this._parser.onerror=function(A){F.emit("error",A),F._parser.error=null},this._decoder=null,l.forEach(function(A){Object.defineProperty(F,"on"+A,{get:function(){return F._parser["on"+A]},set:function(L){if(!L)return F.removeAllListeners(A),F._parser["on"+A]=L,L;F.on(A,L)},enumerable:!0,configurable:!1})})}c.prototype=Object.create(o.prototype,{constructor:{value:c}}),c.prototype.write=function(E){if(typeof Buffer=="function"&&typeof Buffer.isBuffer=="function"&&Buffer.isBuffer(E)){if(!this._decoder){var x=require("string_decoder").StringDecoder;this._decoder=new x("utf8")}E=this._decoder.write(E)}return this._parser.write(E.toString()),this.emit("data",E),!0},c.prototype.end=function(E){return E&&E.length&&this.write(E),this._parser.end(),!0},c.prototype.on=function(E,x){var F=this;return!F._parser["on"+E]&&l.indexOf(E)!==-1&&(F._parser["on"+E]=function(){var A=arguments.length===1?[arguments[0]]:Array.apply(null,arguments);A.splice(0,0,E),F.emit.apply(F,A)}),o.prototype.on.call(F,E,x)};var u="[CDATA[",p="DOCTYPE",f="http://www.w3.org/XML/1998/namespace",d="http://www.w3.org/2000/xmlns/",g={xml:f,xmlns:d},m=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,h=/[:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/,b=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,_=/[#:_A-Za-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u00B7\u0300-\u036F\u203F-\u2040.\d-]/;function N(E){return E===" "||E===`
`||E==="\r"||E===" "}function k(E){return E==='"'||E==="'"}function O(E){return E===">"||N(E)}function w(E,x){return E.test(x)}function C(E,x){return!w(E,x)}var y=0;r.STATE={BEGIN:y++,BEGIN_WHITESPACE:y++,TEXT:y++,TEXT_ENTITY:y++,OPEN_WAKA:y++,SGML_DECL:y++,SGML_DECL_QUOTED:y++,DOCTYPE:y++,DOCTYPE_QUOTED:y++,DOCTYPE_DTD:y++,DOCTYPE_DTD_QUOTED:y++,COMMENT_STARTING:y++,COMMENT:y++,COMMENT_ENDING:y++,COMMENT_ENDED:y++,CDATA:y++,CDATA_ENDING:y++,CDATA_ENDING_2:y++,PROC_INST:y++,PROC_INST_BODY:y++,PROC_INST_ENDING:y++,OPEN_TAG:y++,OPEN_TAG_SLASH:y++,ATTRIB:y++,ATTRIB_NAME:y++,ATTRIB_NAME_SAW_WHITE:y++,ATTRIB_VALUE:y++,ATTRIB_VALUE_QUOTED:y++,ATTRIB_VALUE_CLOSED:y++,ATTRIB_VALUE_UNQUOTED:y++,ATTRIB_VALUE_ENTITY_Q:y++,ATTRIB_VALUE_ENTITY_U:y++,CLOSE_TAG:y++,CLOSE_TAG_SAW_WHITE:y++,SCRIPT:y++,SCRIPT_ENDING:y++},r.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},r.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(r.ENTITIES).forEach(function(E){var x=r.ENTITIES[E],F=typeof x=="number"?String.fromCharCode(x):x;r.ENTITIES[E]=F});for(var S in r.STATE)r.STATE[r.STATE[S]]=S;y=r.STATE;function D(E,x,F){E[x]&&E[x](F)}function R(E,x,F){E.textNode&&M(E),D(E,x,F)}function M(E){E.textNode=I(E.opt,E.textNode),E.textNode&&D(E,"ontext",E.textNode),E.textNode=""}function I(E,x){return E.trim&&(x=x.trim()),E.normalize&&(x=x.replace(/\s+/g," ")),x}function q(E,x){return M(E),E.trackPosition&&(x+=`
Line: `+E.line+`
Column: `+E.column+`
Char: `+E.c),x=new Error(x),E.error=x,D(E,"onerror",x),E}function U(E){return E.sawRoot&&!E.closedRoot&&H(E,"Unclosed root tag"),E.state!==y.BEGIN&&E.state!==y.BEGIN_WHITESPACE&&E.state!==y.TEXT&&q(E,"Unexpected end"),M(E),E.c="",E.closed=!0,D(E,"onend"),e.call(E,E.strict,E.opt),E}function H(E,x){if(typeof E!="object"||!(E instanceof e))throw new Error("bad call to strictFail");E.strict&&q(E,x)}function W(E){E.strict||(E.tagName=E.tagName[E.looseCase]());var x=E.tags[E.tags.length-1]||E,F=E.tag={name:E.tagName,attributes:{}};E.opt.xmlns&&(F.ns=x.ns),E.attribList.length=0,R(E,"onopentagstart",F)}function X(E,x){var F=E.indexOf(":"),A=F<0?["",E]:E.split(":"),L=A[0],j=A[1];return x&&E==="xmlns"&&(L="xmlns",j=""),{prefix:L,local:j}}function se(E){if(E.strict||(E.attribName=E.attribName[E.looseCase]()),E.attribList.indexOf(E.attribName)!==-1||E.tag.attributes.hasOwnProperty(E.attribName)){E.attribName=E.attribValue="";return}if(E.opt.xmlns){var x=X(E.attribName,!0),F=x.prefix,A=x.local;if(F==="xmlns")if(A==="xml"&&E.attribValue!==f)H(E,"xml: prefix must be bound to "+f+`
Actual: `+E.attribValue);else if(A==="xmlns"&&E.attribValue!==d)H(E,"xmlns: prefix must be bound to "+d+`
Actual: `+E.attribValue);else{var L=E.tag,j=E.tags[E.tags.length-1]||E;L.ns===j.ns&&(L.ns=Object.create(j.ns)),L.ns[A]=E.attribValue}E.attribList.push([E.attribName,E.attribValue])}else E.tag.attributes[E.attribName]=E.attribValue,R(E,"onattribute",{name:E.attribName,value:E.attribValue});E.attribName=E.attribValue=""}function Z(E,x){if(E.opt.xmlns){var F=E.tag,A=X(E.tagName);F.prefix=A.prefix,F.local=A.local,F.uri=F.ns[A.prefix]||"",F.prefix&&!F.uri&&(H(E,"Unbound namespace prefix: "+JSON.stringify(E.tagName)),F.uri=A.prefix);var L=E.tags[E.tags.length-1]||E;F.ns&&L.ns!==F.ns&&Object.keys(F.ns).forEach(function(Pe){R(E,"onopennamespace",{prefix:Pe,uri:F.ns[Pe]})});for(var j=0,z=E.attribList.length;j<z;j++){var V=E.attribList[j],G=V[0],de=V[1],fe=X(G,!0),we=fe.prefix,ft=fe.local,Vt=we===""?"":F.ns[we]||"",ve={name:G,value:de,prefix:we,local:ft,uri:Vt};we&&we!=="xmlns"&&!Vt&&(H(E,"Unbound namespace prefix: "+JSON.stringify(we)),ve.uri=we),E.tag.attributes[G]=ve,R(E,"onattribute",ve)}E.attribList.length=0}E.tag.isSelfClosing=!!x,E.sawRoot=!0,E.tags.push(E.tag),R(E,"onopentag",E.tag),x||(!E.noscript&&E.tagName.toLowerCase()==="script"?E.state=y.SCRIPT:E.state=y.TEXT,E.tag=null,E.tagName=""),E.attribName=E.attribValue="",E.attribList.length=0}function pe(E){if(!E.tagName){H(E,"Weird empty close tag."),E.textNode+="</>",E.state=y.TEXT;return}if(E.script){if(E.tagName!=="script"){E.script+="</"+E.tagName+">",E.tagName="",E.state=y.SCRIPT;return}R(E,"onscript",E.script),E.script=""}var x=E.tags.length,F=E.tagName;E.strict||(F=F[E.looseCase]());for(var A=F;x--;){var L=E.tags[x];if(L.name!==A)H(E,"Unexpected close tag");else break}if(x<0){H(E,"Unmatched closing tag: "+E.tagName),E.textNode+="</"+E.tagName+">",E.state=y.TEXT;return}E.tagName=F;for(var j=E.tags.length;j-- >x;){var z=E.tag=E.tags.pop();E.tagName=E.tag.name,R(E,"onclosetag",E.tagName);var V={};for(var G in z.ns)V[G]=z.ns[G];var de=E.tags[E.tags.length-1]||E;E.opt.xmlns&&z.ns!==de.ns&&Object.keys(z.ns).forEach(function(fe){var we=z.ns[fe];R(E,"onclosenamespace",{prefix:fe,uri:we})})}x===0&&(E.closedRoot=!0),E.tagName=E.attribValue=E.attribName="",E.attribList.length=0,E.state=y.TEXT}function ie(E){var x=E.entity,F=x.toLowerCase(),A,L="";return E.ENTITIES[x]?E.ENTITIES[x]:E.ENTITIES[F]?E.ENTITIES[F]:(x=F,x.charAt(0)==="#"&&(x.charAt(1)==="x"?(x=x.slice(2),A=parseInt(x,16),L=A.toString(16)):(x=x.slice(1),A=parseInt(x,10),L=A.toString(10))),x=x.replace(/^0+/,""),isNaN(A)||L.toLowerCase()!==x||A<0||A>1114111?(H(E,"Invalid character entity"),"&"+E.entity+";"):String.fromCodePoint(A))}function ce(E,x){x==="<"?(E.state=y.OPEN_WAKA,E.startTagPosition=E.position):N(x)||(H(E,"Non-whitespace before first tag."),E.textNode=x,E.state=y.TEXT)}function ye(E,x){var F="";return x<E.length&&(F=E.charAt(x)),F}function xe(E){var x=this;if(this.error)throw this.error;if(x.closed)return q(x,"Cannot write after close. Assign an onready handler.");if(E===null)return U(x);typeof E=="object"&&(E=E.toString());for(var F=0,A="";A=ye(E,F++),x.c=A,!!A;)switch(x.trackPosition&&(x.position++,A===`
`?(x.line++,x.column=0):x.column++),x.state){case y.BEGIN:if(x.state=y.BEGIN_WHITESPACE,A==="\uFEFF")continue;ce(x,A);continue;case y.BEGIN_WHITESPACE:ce(x,A);continue;case y.TEXT:if(x.sawRoot&&!x.closedRoot){for(var j=F-1;A&&A!=="<"&&A!=="&";)A=ye(E,F++),A&&x.trackPosition&&(x.position++,A===`
`?(x.line++,x.column=0):x.column++);x.textNode+=E.substring(j,F-1)}A==="<"&&!(x.sawRoot&&x.closedRoot&&!x.strict)?(x.state=y.OPEN_WAKA,x.startTagPosition=x.position):(!N(A)&&(!x.sawRoot||x.closedRoot)&&H(x,"Text data outside of root node."),A==="&"?x.state=y.TEXT_ENTITY:x.textNode+=A);continue;case y.SCRIPT:A==="<"?x.state=y.SCRIPT_ENDING:x.script+=A;continue;case y.SCRIPT_ENDING:A==="/"?x.state=y.CLOSE_TAG:(x.script+="<"+A,x.state=y.SCRIPT);continue;case y.OPEN_WAKA:if(A==="!")x.state=y.SGML_DECL,x.sgmlDecl="";else if(!N(A))if(w(m,A))x.state=y.OPEN_TAG,x.tagName=A;else if(A==="/")x.state=y.CLOSE_TAG,x.tagName="";else if(A==="?")x.state=y.PROC_INST,x.procInstName=x.procInstBody="";else{if(H(x,"Unencoded <"),x.startTagPosition+1<x.position){var L=x.position-x.startTagPosition;A=new Array(L).join(" ")+A}x.textNode+="<"+A,x.state=y.TEXT}continue;case y.SGML_DECL:if(x.sgmlDecl+A==="--"){x.state=y.COMMENT,x.comment="",x.sgmlDecl="";continue}x.doctype&&x.doctype!==!0&&x.sgmlDecl?(x.state=y.DOCTYPE_DTD,x.doctype+="<!"+x.sgmlDecl+A,x.sgmlDecl=""):(x.sgmlDecl+A).toUpperCase()===u?(R(x,"onopencdata"),x.state=y.CDATA,x.sgmlDecl="",x.cdata=""):(x.sgmlDecl+A).toUpperCase()===p?(x.state=y.DOCTYPE,(x.doctype||x.sawRoot)&&H(x,"Inappropriately located doctype declaration"),x.doctype="",x.sgmlDecl=""):A===">"?(R(x,"onsgmldeclaration",x.sgmlDecl),x.sgmlDecl="",x.state=y.TEXT):(k(A)&&(x.state=y.SGML_DECL_QUOTED),x.sgmlDecl+=A);continue;case y.SGML_DECL_QUOTED:A===x.q&&(x.state=y.SGML_DECL,x.q=""),x.sgmlDecl+=A;continue;case y.DOCTYPE:A===">"?(x.state=y.TEXT,R(x,"ondoctype",x.doctype),x.doctype=!0):(x.doctype+=A,A==="["?x.state=y.DOCTYPE_DTD:k(A)&&(x.state=y.DOCTYPE_QUOTED,x.q=A));continue;case y.DOCTYPE_QUOTED:x.doctype+=A,A===x.q&&(x.q="",x.state=y.DOCTYPE);continue;case y.DOCTYPE_DTD:A==="]"?(x.doctype+=A,x.state=y.DOCTYPE):A==="<"?(x.state=y.OPEN_WAKA,x.startTagPosition=x.position):k(A)?(x.doctype+=A,x.state=y.DOCTYPE_DTD_QUOTED,x.q=A):x.doctype+=A;continue;case y.DOCTYPE_DTD_QUOTED:x.doctype+=A,A===x.q&&(x.state=y.DOCTYPE_DTD,x.q="");continue;case y.COMMENT:A==="-"?x.state=y.COMMENT_ENDING:x.comment+=A;continue;case y.COMMENT_ENDING:A==="-"?(x.state=y.COMMENT_ENDED,x.comment=I(x.opt,x.comment),x.comment&&R(x,"oncomment",x.comment),x.comment=""):(x.comment+="-"+A,x.state=y.COMMENT);continue;case y.COMMENT_ENDED:A!==">"?(H(x,"Malformed comment"),x.comment+="--"+A,x.state=y.COMMENT):x.doctype&&x.doctype!==!0?x.state=y.DOCTYPE_DTD:x.state=y.TEXT;continue;case y.CDATA:for(var j=F-1;A&&A!=="]";)A=ye(E,F++),A&&x.trackPosition&&(x.position++,A===`
`?(x.line++,x.column=0):x.column++);x.cdata+=E.substring(j,F-1),A==="]"&&(x.state=y.CDATA_ENDING);continue;case y.CDATA_ENDING:A==="]"?x.state=y.CDATA_ENDING_2:(x.cdata+="]"+A,x.state=y.CDATA);continue;case y.CDATA_ENDING_2:A===">"?(x.cdata&&R(x,"oncdata",x.cdata),R(x,"onclosecdata"),x.cdata="",x.state=y.TEXT):A==="]"?x.cdata+="]":(x.cdata+="]]"+A,x.state=y.CDATA);continue;case y.PROC_INST:A==="?"?x.state=y.PROC_INST_ENDING:N(A)?x.state=y.PROC_INST_BODY:x.procInstName+=A;continue;case y.PROC_INST_BODY:if(!x.procInstBody&&N(A))continue;A==="?"?x.state=y.PROC_INST_ENDING:x.procInstBody+=A;continue;case y.PROC_INST_ENDING:A===">"?(R(x,"onprocessinginstruction",{name:x.procInstName,body:x.procInstBody}),x.procInstName=x.procInstBody="",x.state=y.TEXT):(x.procInstBody+="?"+A,x.state=y.PROC_INST_BODY);continue;case y.OPEN_TAG:w(h,A)?x.tagName+=A:(W(x),A===">"?Z(x):A==="/"?x.state=y.OPEN_TAG_SLASH:(N(A)||H(x,"Invalid character in tag name"),x.state=y.ATTRIB));continue;case y.OPEN_TAG_SLASH:A===">"?(Z(x,!0),pe(x)):(H(x,"Forward-slash in opening tag not followed by >"),x.state=y.ATTRIB);continue;case y.ATTRIB:if(N(A))continue;A===">"?Z(x):A==="/"?x.state=y.OPEN_TAG_SLASH:w(m,A)?(x.attribName=A,x.attribValue="",x.state=y.ATTRIB_NAME):H(x,"Invalid attribute name");continue;case y.ATTRIB_NAME:A==="="?x.state=y.ATTRIB_VALUE:A===">"?(H(x,"Attribute without value"),x.attribValue=x.attribName,se(x),Z(x)):N(A)?x.state=y.ATTRIB_NAME_SAW_WHITE:w(h,A)?x.attribName+=A:H(x,"Invalid attribute name");continue;case y.ATTRIB_NAME_SAW_WHITE:if(A==="=")x.state=y.ATTRIB_VALUE;else{if(N(A))continue;H(x,"Attribute without value"),x.tag.attributes[x.attribName]="",x.attribValue="",R(x,"onattribute",{name:x.attribName,value:""}),x.attribName="",A===">"?Z(x):w(m,A)?(x.attribName=A,x.state=y.ATTRIB_NAME):(H(x,"Invalid attribute name"),x.state=y.ATTRIB)}continue;case y.ATTRIB_VALUE:if(N(A))continue;k(A)?(x.q=A,x.state=y.ATTRIB_VALUE_QUOTED):(x.opt.unquotedAttributeValues||q(x,"Unquoted attribute value"),x.state=y.ATTRIB_VALUE_UNQUOTED,x.attribValue=A);continue;case y.ATTRIB_VALUE_QUOTED:if(A!==x.q){A==="&"?x.state=y.ATTRIB_VALUE_ENTITY_Q:x.attribValue+=A;continue}se(x),x.q="",x.state=y.ATTRIB_VALUE_CLOSED;continue;case y.ATTRIB_VALUE_CLOSED:N(A)?x.state=y.ATTRIB:A===">"?Z(x):A==="/"?x.state=y.OPEN_TAG_SLASH:w(m,A)?(H(x,"No whitespace between attributes"),x.attribName=A,x.attribValue="",x.state=y.ATTRIB_NAME):H(x,"Invalid attribute name");continue;case y.ATTRIB_VALUE_UNQUOTED:if(!O(A)){A==="&"?x.state=y.ATTRIB_VALUE_ENTITY_U:x.attribValue+=A;continue}se(x),A===">"?Z(x):x.state=y.ATTRIB;continue;case y.CLOSE_TAG:if(x.tagName)A===">"?pe(x):w(h,A)?x.tagName+=A:x.script?(x.script+="</"+x.tagName,x.tagName="",x.state=y.SCRIPT):(N(A)||H(x,"Invalid tagname in closing tag"),x.state=y.CLOSE_TAG_SAW_WHITE);else{if(N(A))continue;C(m,A)?x.script?(x.script+="</"+A,x.state=y.SCRIPT):H(x,"Invalid tagname in closing tag."):x.tagName=A}continue;case y.CLOSE_TAG_SAW_WHITE:if(N(A))continue;A===">"?pe(x):H(x,"Invalid characters in closing tag");continue;case y.TEXT_ENTITY:case y.ATTRIB_VALUE_ENTITY_Q:case y.ATTRIB_VALUE_ENTITY_U:var z,V;switch(x.state){case y.TEXT_ENTITY:z=y.TEXT,V="textNode";break;case y.ATTRIB_VALUE_ENTITY_Q:z=y.ATTRIB_VALUE_QUOTED,V="attribValue";break;case y.ATTRIB_VALUE_ENTITY_U:z=y.ATTRIB_VALUE_UNQUOTED,V="attribValue";break}if(A===";"){var G=ie(x);x.opt.unparsedEntities&&!Object.values(r.XML_ENTITIES).includes(G)?(x.entity="",x.state=z,x.write(G)):(x[V]+=G,x.entity="",x.state=z)}else w(x.entity.length?_:b,A)?x.entity+=A:(H(x,"Invalid character in entity name"),x[V]+="&"+x.entity+A,x.entity="",x.state=z);continue;default:throw new Error(x,"Unknown state: "+x.state)}return x.position>=x.bufferCheckPosition&&n(x),x}String.fromCodePoint||function(){var E=String.fromCharCode,x=Math.floor,F=function(){var A=16384,L=[],j,z,V=-1,G=arguments.length;if(!G)return"";for(var de="";++V<G;){var fe=Number(arguments[V]);if(!isFinite(fe)||fe<0||fe>1114111||x(fe)!==fe)throw RangeError("Invalid code point: "+fe);fe<=65535?L.push(fe):(fe-=65536,j=(fe>>10)+55296,z=fe%1024+56320,L.push(j,z)),(V+1===G||L.length>A)&&(de+=E.apply(null,L),L.length=0)}return de};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:F,configurable:!0,writable:!0}):String.fromCodePoint=F}()})(typeof ao=="undefined"?ao.sax={}:ao)});var kh=te((GN,Ch)=>{var _h=/[&<>"]/g,pv=RegExp(_h.source),dv={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},fv=r=>{let t=String(r);return t&&pv.test(t)?t.replace(_h,e=>dv[e]):t},mv=(r,t)=>typeof r=="string"&&typeof t=="string"||r&&r[0].$name===t.$name,hv=(r,t)=>typeof r=="string"?r+t:r.concat(t),gv=r=>r.reduce((t,e)=>{let n=t.length-1,i=t[n];return mv(i,e)?t[n]=hv(i,e):t.push(typeof e=="string"?e:[e]),t},[]),bv=(r,t,e)=>{let n=null,i={};return Object.keys(r).forEach(a=>{let o=oo(r[a])?r[a]:null;if(o)switch(a){case"$name":!t&&o&&(i.$name=o);break;case"$attrs":n=o;break;case"$markup":i.$markup=Ah(o);break;default:o&&(i[a]=e(o))}}),{stripped:i,$attrs:n}},yv=r=>Array.isArray(r)&&r.length===1?r[0]:r,xv=(r,t)=>oo(t)?r?Object.keys(t).length===1&&t.$name?Object.assign(t,r):Object.assign(t,{$attrs:r}):t:r,wv=r=>{if(!r)return;let t=Object.keys(r),[e]=t;return t.length===1&&e!=="$name"&&e!=="id"?r[t[0]]:r},ec=(r,t,e)=>{let n=e?s=>s:yv,i=n(r);if(!oo(i))return null;if(typeof i!="object"||Array.isArray(i))return i;let{$attrs:a,stripped:o}=bv(i,t,n),l=xv(a,o);return wv(l)},vv=r=>{let t,e={},n=!0;return r.every(i=>(typeof i=="string"?t="$text":t=i[0].$name,e[t]?(n=!1,!1):(e[t]=!0,!0))),n},tc=(r=[],t=[],e=!1)=>{let n=Array.isArray(r)?r:[r],i=Array.isArray(t)?t:[t],a=n.concat(i);return a.length===1&&!e?a[0]:a},Ah=(r,t)=>{let e=[];return r!==null&&typeof r=="object"&&r.constructor===Array?(r.forEach(n=>{e.push(ec(n,t))}),e):ec(r,t)},Ev=(r,t)=>{let e,n={};return Object.keys(r).forEach(i=>{i!=="$markup"&&(n[i]=r[i])}),r.$markup&&r.$markup.forEach(i=>{typeof i=="string"?n.$text=tc(n.$text,i,t):typeof i=="object"&&(i.constructor===Array?e=i[0].$name:e=i.$name,n[e]=tc(n[e],Ah(i,!0),t))}),n},oo=r=>r!=null&&(r.length==null||r.length!==0)&&(typeof r!="object"||Object.keys(r).length!==0);Ch.exports={condenseArray:gv,escape:fv,isSomething:oo,moosh:tc,objectifyMarkup:Ev,shouldObjectifyMarkup:vv,simplifyNode:ec}});var Sh=te((YN,Nh)=>{var{EventEmitter:Tv}=require("events"),_v=Th(),Sr=kh(),Av=1,$n=0,Dr=-1,Ph={preserveMarkup:$n,simplifyNodes:!0,useArrays:$n,lowercase:!0,trim:!0,normalize:!0,cdataAsText:!1,strict:!1},Ri=function(t,e=Ph){let n=new Tv,i=[],a=Object.assign({},Ph,e),{preserveMarkup:o,simplifyNodes:l,useArrays:s,lowercase:c,trim:u,normalize:p,cdataAsText:f,strict:d}=a,g=null,m=null,h=_v.createStream(d,{lowercase:c,trim:u,normalize:p,cdataAsText:f});return h.on("opentag",b=>{i.length===0&&!n.listeners(`tag:${b.name}`).length||(g={$name:b.name,$attrs:b.attributes},s>Dr&&(g.$markup=[]),i.push(g))}),h.on("text",b=>{g&&(s>Dr?g.$markup.push(b):g.$text?g.$text+=b:g.$text=b)}),h.on("opencdata",()=>{g&&(f||(m={$name:"$cdata",text:""},s>Dr?g.$markup.push(m):g.$cdata=m))}),h.on("cdata",b=>{g&&(m!==null?m.text+=b:s>Dr?g.$markup.push(b):g.$text?g.$text+=b:g.$text=b)}),h.on("closecdata",()=>{m=null}),h.on("script",b=>{g&&(g.$script=b)}),h.on("closetag",b=>{let _,N=null,k=s>$n;i.length!==0&&(s>Dr&&(o<=Dr?(g.$markup=Sr.condenseArray(g.$markup),g=Sr.objectifyMarkup(g,k)):o===$n&&(_=Sr.condenseArray(g.$markup),Sr.shouldObjectifyMarkup(_)&&(g.$markup=_,g=Sr.objectifyMarkup(g,k)))),n.listeners(`tag:${b}`).length&&n.emit(`tag:${b}`,l?Sr.simplifyNode(g,!1,s>$n):g),i.pop(),i.length>0&&(N=i[i.length-1],s>Dr?N.$markup.push(g):N[b]||(N[b]=Sr.simplifyNode(g,!0))),g=N)}),h.on("end",()=>{n.emit("end")}),h.on("error",b=>{n.emit("error",b)}),t.pipe(h),n.pause=function(){t.pause()},n.resume=function(){t.resume()},n};Ri.ALWAYS=Av;Ri.SOMETIMES=$n;Ri.NEVER=Dr;Ri.toXml=function(t,{indent:e="",selfClosing:n=!0,escape:i=Sr.escape,nodeName:a}={}){let o=e?`
`:"";function l(s,c,u){let p="",f,d=c,g=u?o+u:"",m=u+e,h="";return s=s||"",s.constructor===Array?(s.forEach(b=>{p+=l(b,d,u)}),p):(!d&&s.$name&&(d=s.$name),d&&(p=`${g}<${d}`,s.$attrs&&typeof s.$attrs=="object"&&(f=Object.keys(s.$attrs),f.forEach(b=>{p+=` ${b}=${JSON.stringify(String(s.$attrs[b]))}`}))),s==null||s===""||(typeof s=="object"?(f=Object.keys(s),f.forEach(b=>{let _=s[b];switch(b){case"$name":case"$attrs":break;case"$text":case"$markup":h+=l(_,null,m);break;case"$script":h+=l(_,"script",m);break;case"$cdata":h+=`${g}<![CDATA[${_}]]>`;break;default:h+=l(_,b,m)}})):h+=g+i(s)),d?h?p+=`>${h}${o}${u}</${d}>`:n?p+="/>":p+=`></${d}>`:p+=h,p)}return l(t,a,"")};Nh.exports=Ri});var mo=te(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.assertNever=f2;Ii.pick=m2;Ii.isObject=h2;function f2(r){throw new Error(`Unexpected value should never occur: ${r}`)}function m2(r,t){let e=t.map(n=>[n,r==null?void 0:r[n]]);return Object.fromEntries(e)}function h2(r){return typeof r=="object"&&r!==null}});var cc=te(Hn=>{"use strict";Object.defineProperty(Hn,"__esModule",{value:!0});Hn.LogLevel=void 0;Hn.makeConsoleLogger=b2;Hn.logLevelSeverity=y2;var g2=mo(),Un;(function(r){r.DEBUG="debug",r.INFO="info",r.WARN="warn",r.ERROR="error"})(Un||(Hn.LogLevel=Un={}));function b2(r){return(t,e,n)=>{console[t](`${r} ${t}:`,e,n)}}function y2(r){switch(r){case Un.DEBUG:return 20;case Un.INFO:return 40;case Un.WARN:return 60;case Un.ERROR:return 80;default:return(0,g2.assertNever)(r)}}});var pc=te(rt=>{"use strict";Object.defineProperty(rt,"__esModule",{value:!0});rt.APIResponseError=rt.UnknownHTTPResponseError=rt.RequestTimeoutError=rt.ClientErrorCode=rt.APIErrorCode=void 0;rt.isNotionClientError=tg;rt.isHTTPResponseError=w2;rt.buildRequestError=v2;var eg=mo(),Ce;(function(r){r.Unauthorized="unauthorized",r.RestrictedResource="restricted_resource",r.ObjectNotFound="object_not_found",r.RateLimited="rate_limited",r.InvalidJSON="invalid_json",r.InvalidRequestURL="invalid_request_url",r.InvalidRequest="invalid_request",r.ValidationError="validation_error",r.ConflictError="conflict_error",r.InternalServerError="internal_server_error",r.ServiceUnavailable="service_unavailable"})(Ce||(rt.APIErrorCode=Ce={}));var ln;(function(r){r.RequestTimeout="notionhq_client_request_timeout",r.ResponseError="notionhq_client_response_error"})(ln||(rt.ClientErrorCode=ln={}));var Fi=class extends Error{};function tg(r){return(0,eg.isObject)(r)&&r instanceof Fi}function yo(r,t){return tg(r)&&r.code in t}var uc=class r extends Fi{constructor(t="Request to Notion API has timed out"){super(t),this.code=ln.RequestTimeout,this.name="RequestTimeoutError"}static isRequestTimeoutError(t){return yo(t,{[ln.RequestTimeout]:!0})}static rejectAfterTimeout(t,e){return new Promise((n,i)=>{let a=setTimeout(()=>{i(new r)},e);t.then(n).catch(i).then(()=>clearTimeout(a))})}};rt.RequestTimeoutError=uc;var ho=class extends Fi{constructor(t){super(t.message),this.name="HTTPResponseError";let{code:e,status:n,headers:i,rawBodyText:a,additional_data:o,request_id:l}=t;this.code=e,this.status=n,this.headers=i,this.body=a,this.additional_data=o,this.request_id=l}},x2={[ln.ResponseError]:!0,[Ce.Unauthorized]:!0,[Ce.RestrictedResource]:!0,[Ce.ObjectNotFound]:!0,[Ce.RateLimited]:!0,[Ce.InvalidJSON]:!0,[Ce.InvalidRequestURL]:!0,[Ce.InvalidRequest]:!0,[Ce.ValidationError]:!0,[Ce.ConflictError]:!0,[Ce.InternalServerError]:!0,[Ce.ServiceUnavailable]:!0};function w2(r){return!!yo(r,x2)}var go=class extends ho{constructor(t){var e;super({...t,code:ln.ResponseError,message:(e=t.message)!==null&&e!==void 0?e:`Request to Notion API failed with status: ${t.status}`,additional_data:void 0,request_id:void 0}),this.name="UnknownHTTPResponseError"}static isUnknownHTTPResponseError(t){return yo(t,{[ln.ResponseError]:!0})}};rt.UnknownHTTPResponseError=go;var rg={[Ce.Unauthorized]:!0,[Ce.RestrictedResource]:!0,[Ce.ObjectNotFound]:!0,[Ce.RateLimited]:!0,[Ce.InvalidJSON]:!0,[Ce.InvalidRequestURL]:!0,[Ce.InvalidRequest]:!0,[Ce.ValidationError]:!0,[Ce.ConflictError]:!0,[Ce.InternalServerError]:!0,[Ce.ServiceUnavailable]:!0},bo=class extends ho{constructor(){super(...arguments),this.name="APIResponseError"}static isAPIResponseError(t){return yo(t,rg)}};rt.APIResponseError=bo;function v2(r,t){let e=E2(t);return e!==void 0?new bo({code:e.code,message:e.message,headers:r.headers,status:r.status,rawBodyText:t,additional_data:e.additional_data,request_id:e.request_id}):new go({message:void 0,headers:r.headers,status:r.status,rawBodyText:t})}function E2(r){if(typeof r!="string")return;let t;try{t=JSON.parse(r)}catch(i){return}if(!(0,eg.isObject)(t)||typeof t.message!="string"||!T2(t.code))return;let e=t.additional_data,n=t.request_id;return{...t,code:t.code,message:t.message,additional_data:e,request_id:n}}function T2(r){return typeof r=="string"&&r in rg}});var ng=te(J=>{"use strict";Object.defineProperty(J,"__esModule",{value:!0});J.movePage=J.oauthIntrospect=J.oauthRevoke=J.oauthToken=J.getFileUpload=J.completeFileUpload=J.sendFileUpload=J.listFileUploads=J.createFileUpload=J.getComment=J.listComments=J.createComment=J.search=J.createDatabase=J.updateDatabase=J.getDatabase=J.listDataSourceTemplates=J.createDataSource=J.queryDataSource=J.updateDataSource=J.getDataSource=J.appendBlockChildren=J.listBlockChildren=J.deleteBlock=J.updateBlock=J.getBlock=J.getPageProperty=J.updatePage=J.getPage=J.createPage=J.listUsers=J.getUser=J.getSelf=void 0;J.getSelf={method:"get",pathParams:[],queryParams:[],bodyParams:[],path:()=>"users/me"};J.getUser={method:"get",pathParams:["user_id"],queryParams:[],bodyParams:[],path:r=>`users/${r.user_id}`};J.listUsers={method:"get",pathParams:[],queryParams:["start_cursor","page_size"],bodyParams:[],path:()=>"users"};J.createPage={method:"post",pathParams:[],queryParams:[],bodyParams:["parent","properties","icon","cover","content","children","template"],path:()=>"pages"};J.getPage={method:"get",pathParams:["page_id"],queryParams:["filter_properties"],bodyParams:[],path:r=>`pages/${r.page_id}`};J.updatePage={method:"patch",pathParams:["page_id"],queryParams:[],bodyParams:["properties","icon","cover","is_locked","template","erase_content","archived","in_trash"],path:r=>`pages/${r.page_id}`};J.getPageProperty={method:"get",pathParams:["page_id","property_id"],queryParams:["start_cursor","page_size"],bodyParams:[],path:r=>`pages/${r.page_id}/properties/${r.property_id}`};J.getBlock={method:"get",pathParams:["block_id"],queryParams:[],bodyParams:[],path:r=>`blocks/${r.block_id}`};J.updateBlock={method:"patch",pathParams:["block_id"],queryParams:[],bodyParams:["embed","type","archived","in_trash","bookmark","image","video","pdf","file","audio","code","equation","divider","breadcrumb","table_of_contents","link_to_page","table_row","heading_1","heading_2","heading_3","paragraph","bulleted_list_item","numbered_list_item","quote","to_do","toggle","template","callout","synced_block","table","column"],path:r=>`blocks/${r.block_id}`};J.deleteBlock={method:"delete",pathParams:["block_id"],queryParams:[],bodyParams:[],path:r=>`blocks/${r.block_id}`};J.listBlockChildren={method:"get",pathParams:["block_id"],queryParams:["start_cursor","page_size"],bodyParams:[],path:r=>`blocks/${r.block_id}/children`};J.appendBlockChildren={method:"patch",pathParams:["block_id"],queryParams:[],bodyParams:["children","after"],path:r=>`blocks/${r.block_id}/children`};J.getDataSource={method:"get",pathParams:["data_source_id"],queryParams:[],bodyParams:[],path:r=>`data_sources/${r.data_source_id}`};J.updateDataSource={method:"patch",pathParams:["data_source_id"],queryParams:[],bodyParams:["title","icon","properties","in_trash","archived","parent"],path:r=>`data_sources/${r.data_source_id}`};J.queryDataSource={method:"post",pathParams:["data_source_id"],queryParams:["filter_properties"],bodyParams:["sorts","filter","start_cursor","page_size","archived","in_trash","result_type"],path:r=>`data_sources/${r.data_source_id}/query`};J.createDataSource={method:"post",pathParams:[],queryParams:[],bodyParams:["parent","properties","title","icon"],path:()=>"data_sources"};J.listDataSourceTemplates={method:"get",pathParams:["data_source_id"],queryParams:["name","start_cursor","page_size"],bodyParams:[],path:r=>`data_sources/${r.data_source_id}/templates`};J.getDatabase={method:"get",pathParams:["database_id"],queryParams:[],bodyParams:[],path:r=>`databases/${r.database_id}`};J.updateDatabase={method:"patch",pathParams:["database_id"],queryParams:[],bodyParams:["parent","title","description","is_inline","icon","cover","in_trash","is_locked"],path:r=>`databases/${r.database_id}`};J.createDatabase={method:"post",pathParams:[],queryParams:[],bodyParams:["parent","title","description","is_inline","initial_data_source","icon","cover"],path:()=>"databases"};J.search={method:"post",pathParams:[],queryParams:[],bodyParams:["sort","query","start_cursor","page_size","filter"],path:()=>"search"};J.createComment={method:"post",pathParams:[],queryParams:[],bodyParams:["rich_text","attachments","display_name","parent","discussion_id"],path:()=>"comments"};J.listComments={method:"get",pathParams:[],queryParams:["block_id","start_cursor","page_size"],bodyParams:[],path:()=>"comments"};J.getComment={method:"get",pathParams:["comment_id"],queryParams:[],bodyParams:[],path:r=>`comments/${r.comment_id}`};J.createFileUpload={method:"post",pathParams:[],queryParams:[],bodyParams:["mode","filename","content_type","number_of_parts","external_url"],path:()=>"file_uploads"};J.listFileUploads={method:"get",pathParams:[],queryParams:["status","start_cursor","page_size"],bodyParams:[],path:()=>"file_uploads"};J.sendFileUpload={method:"post",pathParams:["file_upload_id"],queryParams:[],bodyParams:[],formDataParams:["file","part_number"],path:r=>`file_uploads/${r.file_upload_id}/send`};J.completeFileUpload={method:"post",pathParams:["file_upload_id"],queryParams:[],bodyParams:[],path:r=>`file_uploads/${r.file_upload_id}/complete`};J.getFileUpload={method:"get",pathParams:["file_upload_id"],queryParams:[],bodyParams:[],path:r=>`file_uploads/${r.file_upload_id}`};J.oauthToken={method:"post",pathParams:[],queryParams:[],bodyParams:["grant_type","code","redirect_uri","external_account","refresh_token"],path:()=>"oauth/token"};J.oauthRevoke={method:"post",pathParams:[],queryParams:[],bodyParams:["token"],path:()=>"oauth/revoke"};J.oauthIntrospect={method:"post",pathParams:[],queryParams:[],bodyParams:["token"],path:()=>"oauth/introspect"};J.movePage={method:"post",pathParams:["page_id"],queryParams:[],bodyParams:["parent"],path:r=>`pages/${r.page_id}/move`}});var ig=te((oD,_2)=>{_2.exports={name:"@notionhq/client",version:"5.4.0",description:"A simple and easy to use client for the Notion API",engines:{node:">=18"},homepage:"https://developers.notion.com/docs/getting-started",bugs:{url:"https://github.com/makenotion/notion-sdk-js/issues"},repository:{type:"git",url:"https://github.com/makenotion/notion-sdk-js/"},keywords:["notion","notionapi","rest","notion-api"],main:"./build/src",types:"./build/src/index.d.ts",scripts:{prepare:"npm run build",prepublishOnly:"npm run checkLoggedIn && npm run lint && npm run test",build:"tsc",prettier:"prettier --write .",lint:"prettier --check . && eslint . --ext .ts && cspell '**/*' ",test:"jest ./test","check-links":"git ls-files | grep md$ | xargs -n 1 markdown-link-check",prebuild:"npm run clean",clean:"rm -rf ./build",checkLoggedIn:"./scripts/verifyLoggedIn.sh","install:examples":'for dir in examples/*/; do echo "Installing dependencies in $dir..."; (cd "$dir" && npm install); done',"examples:install":"npm run install:examples","examples:typecheck":'for dir in examples/*/; do echo "Typechecking $dir..."; (cd "$dir" && npx tsc --noEmit) || exit 1; done'},author:"",license:"MIT",files:["build/package.json","build/src/**"],devDependencies:{"@types/jest":"28.1.4","@typescript-eslint/eslint-plugin":"5.39.0","@typescript-eslint/parser":"5.39.0",cspell:"5.4.1",eslint:"7.24.0",jest:"28.1.2","markdown-link-check":"3.13.7",prettier:"2.8.8","ts-jest":"28.0.5",typescript:"5.9.2"}}});var og=te(cn=>{"use strict";var ar=cn&&cn.__classPrivateFieldSet||function(r,t,e,n,i){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof t=="function"?r!==t||!i:!t.has(r))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?i.call(r,e):i?i.value=e:t.set(r,e),e},or=cn&&cn.__classPrivateFieldGet||function(r,t,e,n){if(e==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof t=="function"?r!==t||!n:!t.has(r))throw new TypeError("Cannot read private member from an object whose class did not declare it");return e==="m"?n:e==="a"?n.call(r):n?n.value:t.get(r)},wo,vo,Eo,To,_o,Ao,Co,ko,Po;Object.defineProperty(cn,"__esModule",{value:!0});var Rr=cc(),xo=pc(),ee=mo(),B=ng(),ag=ig(),No=class r{constructor(t){var e,n,i,a,o,l;wo.set(this,void 0),vo.set(this,void 0),Eo.set(this,void 0),To.set(this,void 0),_o.set(this,void 0),Ao.set(this,void 0),Co.set(this,void 0),ko.set(this,void 0),Po.set(this,void 0),this.blocks={retrieve:s=>this.request({path:B.getBlock.path(s),method:B.getBlock.method,query:(0,ee.pick)(s,B.getBlock.queryParams),body:(0,ee.pick)(s,B.getBlock.bodyParams),auth:s==null?void 0:s.auth}),update:s=>this.request({path:B.updateBlock.path(s),method:B.updateBlock.method,query:(0,ee.pick)(s,B.updateBlock.queryParams),body:(0,ee.pick)(s,B.updateBlock.bodyParams),auth:s==null?void 0:s.auth}),delete:s=>this.request({path:B.deleteBlock.path(s),method:B.deleteBlock.method,query:(0,ee.pick)(s,B.deleteBlock.queryParams),body:(0,ee.pick)(s,B.deleteBlock.bodyParams),auth:s==null?void 0:s.auth}),children:{append:s=>this.request({path:B.appendBlockChildren.path(s),method:B.appendBlockChildren.method,query:(0,ee.pick)(s,B.appendBlockChildren.queryParams),body:(0,ee.pick)(s,B.appendBlockChildren.bodyParams),auth:s==null?void 0:s.auth}),list:s=>this.request({path:B.listBlockChildren.path(s),method:B.listBlockChildren.method,query:(0,ee.pick)(s,B.listBlockChildren.queryParams),body:(0,ee.pick)(s,B.listBlockChildren.bodyParams),auth:s==null?void 0:s.auth})}},this.databases={retrieve:s=>this.request({path:B.getDatabase.path(s),method:B.getDatabase.method,query:(0,ee.pick)(s,B.getDatabase.queryParams),body:(0,ee.pick)(s,B.getDatabase.bodyParams),auth:s==null?void 0:s.auth}),create:s=>this.request({path:B.createDatabase.path(),method:B.createDatabase.method,query:(0,ee.pick)(s,B.createDatabase.queryParams),body:(0,ee.pick)(s,B.createDatabase.bodyParams),auth:s==null?void 0:s.auth}),update:s=>this.request({path:B.updateDatabase.path(s),method:B.updateDatabase.method,query:(0,ee.pick)(s,B.updateDatabase.queryParams),body:(0,ee.pick)(s,B.updateDatabase.bodyParams),auth:s==null?void 0:s.auth})},this.dataSources={retrieve:s=>this.request({path:B.getDataSource.path(s),method:B.getDataSource.method,query:(0,ee.pick)(s,B.getDataSource.queryParams),body:(0,ee.pick)(s,B.getDataSource.bodyParams),auth:s==null?void 0:s.auth}),query:s=>this.request({path:B.queryDataSource.path(s),method:B.queryDataSource.method,query:(0,ee.pick)(s,B.queryDataSource.queryParams),body:(0,ee.pick)(s,B.queryDataSource.bodyParams),auth:s==null?void 0:s.auth}),create:s=>this.request({path:B.createDataSource.path(),method:B.createDataSource.method,query:(0,ee.pick)(s,B.createDataSource.queryParams),body:(0,ee.pick)(s,B.createDataSource.bodyParams),auth:s==null?void 0:s.auth}),update:s=>this.request({path:B.updateDataSource.path(s),method:B.updateDataSource.method,query:(0,ee.pick)(s,B.updateDataSource.queryParams),body:(0,ee.pick)(s,B.updateDataSource.bodyParams),auth:s==null?void 0:s.auth}),listTemplates:s=>this.request({path:B.listDataSourceTemplates.path(s),method:B.listDataSourceTemplates.method,query:(0,ee.pick)(s,B.listDataSourceTemplates.queryParams),body:(0,ee.pick)(s,B.listDataSourceTemplates.bodyParams),auth:s==null?void 0:s.auth})},this.pages={create:s=>this.request({path:B.createPage.path(),method:B.createPage.method,query:(0,ee.pick)(s,B.createPage.queryParams),body:(0,ee.pick)(s,B.createPage.bodyParams),auth:s==null?void 0:s.auth}),retrieve:s=>this.request({path:B.getPage.path(s),method:B.getPage.method,query:(0,ee.pick)(s,B.getPage.queryParams),body:(0,ee.pick)(s,B.getPage.bodyParams),auth:s==null?void 0:s.auth}),update:s=>this.request({path:B.updatePage.path(s),method:B.updatePage.method,query:(0,ee.pick)(s,B.updatePage.queryParams),body:(0,ee.pick)(s,B.updatePage.bodyParams),auth:s==null?void 0:s.auth}),properties:{retrieve:s=>this.request({path:B.getPageProperty.path(s),method:B.getPageProperty.method,query:(0,ee.pick)(s,B.getPageProperty.queryParams),body:(0,ee.pick)(s,B.getPageProperty.bodyParams),auth:s==null?void 0:s.auth})}},this.users={retrieve:s=>this.request({path:B.getUser.path(s),method:B.getUser.method,query:(0,ee.pick)(s,B.getUser.queryParams),body:(0,ee.pick)(s,B.getUser.bodyParams),auth:s==null?void 0:s.auth}),list:s=>this.request({path:B.listUsers.path(),method:B.listUsers.method,query:(0,ee.pick)(s,B.listUsers.queryParams),body:(0,ee.pick)(s,B.listUsers.bodyParams),auth:s==null?void 0:s.auth}),me:s=>this.request({path:B.getSelf.path(),method:B.getSelf.method,query:(0,ee.pick)(s,B.getSelf.queryParams),body:(0,ee.pick)(s,B.getSelf.bodyParams),auth:s==null?void 0:s.auth})},this.comments={create:s=>this.request({path:B.createComment.path(),method:B.createComment.method,query:(0,ee.pick)(s,B.createComment.queryParams),body:(0,ee.pick)(s,B.createComment.bodyParams),auth:s==null?void 0:s.auth}),list:s=>this.request({path:B.listComments.path(),method:B.listComments.method,query:(0,ee.pick)(s,B.listComments.queryParams),body:(0,ee.pick)(s,B.listComments.bodyParams),auth:s==null?void 0:s.auth}),retrieve:s=>this.request({path:B.getComment.path(s),method:B.getComment.method,query:(0,ee.pick)(s,B.getComment.queryParams),body:(0,ee.pick)(s,B.getComment.bodyParams),auth:s==null?void 0:s.auth})},this.fileUploads={create:s=>this.request({path:B.createFileUpload.path(),method:B.createFileUpload.method,query:(0,ee.pick)(s,B.createFileUpload.queryParams),body:(0,ee.pick)(s,B.createFileUpload.bodyParams),auth:s==null?void 0:s.auth}),retrieve:s=>this.request({path:B.getFileUpload.path(s),method:B.getFileUpload.method,query:(0,ee.pick)(s,B.getFileUpload.queryParams),auth:s==null?void 0:s.auth}),list:s=>this.request({path:B.listFileUploads.path(),method:B.listFileUploads.method,query:(0,ee.pick)(s,B.listFileUploads.queryParams),auth:s==null?void 0:s.auth}),send:s=>this.request({path:B.sendFileUpload.path(s),method:B.sendFileUpload.method,query:(0,ee.pick)(s,B.sendFileUpload.queryParams),formDataParams:(0,ee.pick)(s,B.sendFileUpload.formDataParams),auth:s==null?void 0:s.auth}),complete:s=>this.request({path:B.completeFileUpload.path(s),method:B.completeFileUpload.method,query:(0,ee.pick)(s,B.completeFileUpload.queryParams),auth:s==null?void 0:s.auth})},this.search=s=>this.request({path:B.search.path(),method:B.search.method,query:(0,ee.pick)(s,B.search.queryParams),body:(0,ee.pick)(s,B.search.bodyParams),auth:s==null?void 0:s.auth}),this.oauth={token:s=>this.request({path:B.oauthToken.path(),method:B.oauthToken.method,query:(0,ee.pick)(s,B.oauthToken.queryParams),body:(0,ee.pick)(s,B.oauthToken.bodyParams),auth:{client_id:s.client_id,client_secret:s.client_secret}}),introspect:s=>this.request({path:B.oauthIntrospect.path(),method:B.oauthIntrospect.method,query:(0,ee.pick)(s,B.oauthIntrospect.queryParams),body:(0,ee.pick)(s,B.oauthIntrospect.bodyParams),auth:{client_id:s.client_id,client_secret:s.client_secret}}),revoke:s=>this.request({path:B.oauthRevoke.path(),method:B.oauthRevoke.method,query:(0,ee.pick)(s,B.oauthRevoke.queryParams),body:(0,ee.pick)(s,B.oauthRevoke.bodyParams),auth:{client_id:s.client_id,client_secret:s.client_secret}})},ar(this,wo,t==null?void 0:t.auth,"f"),ar(this,vo,(e=t==null?void 0:t.logLevel)!==null&&e!==void 0?e:Rr.LogLevel.WARN,"f"),ar(this,Eo,(n=t==null?void 0:t.logger)!==null&&n!==void 0?n:(0,Rr.makeConsoleLogger)(ag.name),"f"),ar(this,To,`${(i=t==null?void 0:t.baseUrl)!==null&&i!==void 0?i:"https://api.notion.com"}/v1/`,"f"),ar(this,_o,(a=t==null?void 0:t.timeoutMs)!==null&&a!==void 0?a:6e4,"f"),ar(this,Ao,(o=t==null?void 0:t.notionVersion)!==null&&o!==void 0?o:r.defaultNotionVersion,"f"),ar(this,Co,(l=t==null?void 0:t.fetch)!==null&&l!==void 0?l:fetch,"f"),ar(this,ko,t==null?void 0:t.agent,"f"),ar(this,Po,`notionhq-client/${ag.version}`,"f")}async request(t){let{path:e,method:n,query:i,body:a,formDataParams:o,auth:l}=t;this.log(Rr.LogLevel.INFO,"request start",{method:n,path:e});let s=!a||Object.entries(a).length===0?void 0:JSON.stringify(a),c=new URL(`${or(this,To,"f")}${e}`);if(i){for(let[d,g]of Object.entries(i))if(g!==void 0)if(Array.isArray(g))for(let m of g)c.searchParams.append(d,decodeURIComponent(m));else c.searchParams.append(d,String(g))}let u;if(typeof l=="object"){let d=`${l.client_id}:${l.client_secret}`;u={authorization:`Basic ${Buffer.from(d).toString("base64")}`}}else u=this.authAsHeaders(l);let p={...t.headers,...u,"Notion-Version":or(this,Ao,"f"),"user-agent":or(this,Po,"f")};s!==void 0&&(p["content-type"]="application/json");let f;if(o){delete p["content-type"],f=new FormData;for(let[d,g]of Object.entries(o))typeof g=="string"?f.append(d,g):typeof g=="object"&&f.append(d,typeof g.data=="object"?g.data:new Blob([g.data]),g.filename)}try{let d=await xo.RequestTimeoutError.rejectAfterTimeout(or(this,Co,"f").call(this,c.toString(),{method:n.toUpperCase(),headers:p,body:s!=null?s:f,agent:or(this,ko,"f")}),or(this,_o,"f")),g=await d.text();if(!d.ok)throw(0,xo.buildRequestError)(d,g);let m=JSON.parse(g);return this.log(Rr.LogLevel.INFO,"request success",{method:n,path:e,..."request_id"in m&&m.request_id?{requestId:m.request_id}:{}}),m}catch(d){throw(0,xo.isNotionClientError)(d)&&(this.log(Rr.LogLevel.WARN,"request fail",{code:d.code,message:d.message,..."request_id"in d&&d.request_id?{requestId:d.request_id}:{}}),(0,xo.isHTTPResponseError)(d)&&this.log(Rr.LogLevel.DEBUG,"failed response body",{body:d.body})),d}}log(t,e,n){(0,Rr.logLevelSeverity)(t)>=(0,Rr.logLevelSeverity)(or(this,vo,"f"))&&or(this,Eo,"f").call(this,t,e,n)}authAsHeaders(t){let e={},n=t!=null?t:or(this,wo,"f");return n!==void 0&&(e.authorization=`Bearer ${n}`),e}};wo=new WeakMap,vo=new WeakMap,Eo=new WeakMap,To=new WeakMap,_o=new WeakMap,Ao=new WeakMap,Co=new WeakMap,ko=new WeakMap,Po=new WeakMap;No.defaultNotionVersion="2025-09-03";cn.default=No});var pg=te(Ie=>{"use strict";Object.defineProperty(Ie,"__esModule",{value:!0});Ie.iteratePaginatedAPI=sg;Ie.collectPaginatedAPI=A2;Ie.iterateDataSourceTemplates=lg;Ie.collectDataSourceTemplates=C2;Ie.isFullBlock=k2;Ie.isFullPage=cg;Ie.isFullDataSource=ug;Ie.isFullDatabase=P2;Ie.isFullPageOrDataSource=N2;Ie.isFullUser=S2;Ie.isFullComment=D2;Ie.isTextRichTextItemResponse=R2;Ie.isEquationRichTextItemResponse=O2;Ie.isMentionRichTextItemResponse=I2;Ie.extractNotionId=dc;Ie.extractDatabaseId=F2;Ie.extractPageId=L2;Ie.extractBlockId=M2;async function*sg(r,t){let e=t.start_cursor;do{let n=await r({...t,start_cursor:e});yield*n.results,e=n.next_cursor}while(e)}async function A2(r,t){let e=[];for await(let n of sg(r,t))e.push(n);return e}async function*lg(r,t){let e=t.start_cursor;do{let n=await r.dataSources.listTemplates({...t,start_cursor:e});yield*n.templates,e=n.next_cursor}while(e)}async function C2(r,t){let e=[];for await(let n of lg(r,t))e.push(n);return e}function k2(r){return r.object==="block"&&"type"in r}function cg(r){return r.object==="page"&&"url"in r}function ug(r){return r.object==="data_source"}function P2(r){return r.object==="database"}function N2(r){return r.object==="data_source"?ug(r):cg(r)}function S2(r){return"type"in r}function D2(r){return"created_by"in r}function R2(r){return r.type==="text"}function O2(r){return r.type==="equation"}function I2(r){return r.type==="mention"}function dc(r){if(!r||typeof r!="string")return null;let t=r.trim();if(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(t))return t.toLowerCase();if(/^[0-9a-f]{32}$/i.test(t))return Li(t);let i=t.match(/\/[^/?#]*-([0-9a-f]{32})(?:[/?#]|$)/i);if(i&&i[1])return Li(i[1]);let a=t.match(/[?&](?:p|page_id|database_id)=([0-9a-f]{32})/i);if(a&&a[1])return Li(a[1]);let o=t.match(/([0-9a-f]{32})/i);return o&&o[1]?Li(o[1]):null}function Li(r){let t=r.toLowerCase();return`${t.slice(0,8)}-${t.slice(8,12)}-${t.slice(12,16)}-${t.slice(16,20)}-${t.slice(20,32)}`}function F2(r){return dc(r)}function L2(r){return dc(r)}function M2(r){if(!r||typeof r!="string")return null;let t=r.match(/#(?:block-)?([0-9a-f]{32})/i);return t&&t[1]?Li(t[1]):null}});var dg=te(ae=>{"use strict";Object.defineProperty(ae,"__esModule",{value:!0});ae.extractBlockId=ae.extractPageId=ae.extractDatabaseId=ae.extractNotionId=ae.isFullPageOrDataSource=ae.isFullComment=ae.isFullUser=ae.isFullPage=ae.isFullDatabase=ae.isFullDataSource=ae.isFullBlock=ae.iterateDataSourceTemplates=ae.collectDataSourceTemplates=ae.iteratePaginatedAPI=ae.collectPaginatedAPI=ae.isNotionClientError=ae.RequestTimeoutError=ae.UnknownHTTPResponseError=ae.APIResponseError=ae.ClientErrorCode=ae.APIErrorCode=ae.LogLevel=ae.Client=void 0;var $2=og();Object.defineProperty(ae,"Client",{enumerable:!0,get:function(){return $2.default}});var B2=cc();Object.defineProperty(ae,"LogLevel",{enumerable:!0,get:function(){return B2.LogLevel}});var Wn=pc();Object.defineProperty(ae,"APIErrorCode",{enumerable:!0,get:function(){return Wn.APIErrorCode}});Object.defineProperty(ae,"ClientErrorCode",{enumerable:!0,get:function(){return Wn.ClientErrorCode}});Object.defineProperty(ae,"APIResponseError",{enumerable:!0,get:function(){return Wn.APIResponseError}});Object.defineProperty(ae,"UnknownHTTPResponseError",{enumerable:!0,get:function(){return Wn.UnknownHTTPResponseError}});Object.defineProperty(ae,"RequestTimeoutError",{enumerable:!0,get:function(){return Wn.RequestTimeoutError}});Object.defineProperty(ae,"isNotionClientError",{enumerable:!0,get:function(){return Wn.isNotionClientError}});var nt=pg();Object.defineProperty(ae,"collectPaginatedAPI",{enumerable:!0,get:function(){return nt.collectPaginatedAPI}});Object.defineProperty(ae,"iteratePaginatedAPI",{enumerable:!0,get:function(){return nt.iteratePaginatedAPI}});Object.defineProperty(ae,"collectDataSourceTemplates",{enumerable:!0,get:function(){return nt.collectDataSourceTemplates}});Object.defineProperty(ae,"iterateDataSourceTemplates",{enumerable:!0,get:function(){return nt.iterateDataSourceTemplates}});Object.defineProperty(ae,"isFullBlock",{enumerable:!0,get:function(){return nt.isFullBlock}});Object.defineProperty(ae,"isFullDataSource",{enumerable:!0,get:function(){return nt.isFullDataSource}});Object.defineProperty(ae,"isFullDatabase",{enumerable:!0,get:function(){return nt.isFullDatabase}});Object.defineProperty(ae,"isFullPage",{enumerable:!0,get:function(){return nt.isFullPage}});Object.defineProperty(ae,"isFullUser",{enumerable:!0,get:function(){return nt.isFullUser}});Object.defineProperty(ae,"isFullComment",{enumerable:!0,get:function(){return nt.isFullComment}});Object.defineProperty(ae,"isFullPageOrDataSource",{enumerable:!0,get:function(){return nt.isFullPageOrDataSource}});Object.defineProperty(ae,"extractNotionId",{enumerable:!0,get:function(){return nt.extractNotionId}});Object.defineProperty(ae,"extractDatabaseId",{enumerable:!0,get:function(){return nt.extractDatabaseId}});Object.defineProperty(ae,"extractPageId",{enumerable:!0,get:function(){return nt.extractPageId}});Object.defineProperty(ae,"extractBlockId",{enumerable:!0,get:function(){return nt.extractBlockId}})});var Ng=te((Wi,vc)=>{(function(r,t){typeof Wi=="object"&&typeof vc=="object"?vc.exports=t():typeof define=="function"&&define.amd?define([],t):typeof Wi=="object"?Wi.MathMLToLaTeX=t():r.MathMLToLaTeX=t()})(Wi,()=>(()=>{var r={4582:(i,a)=>{"use strict";function o(c,u){return u===void 0&&(u=Object),u&&typeof u.freeze=="function"?u.freeze(c):c}var l=o({HTML:"text/html",isHTML:function(c){return c===l.HTML},XML_APPLICATION:"application/xml",XML_TEXT:"text/xml",XML_XHTML_APPLICATION:"application/xhtml+xml",XML_SVG_IMAGE:"image/svg+xml"}),s=o({HTML:"http://www.w3.org/1999/xhtml",isHTML:function(c){return c===s.HTML},SVG:"http://www.w3.org/2000/svg",XML:"http://www.w3.org/XML/1998/namespace",XMLNS:"http://www.w3.org/2000/xmlns/"});a.assign=function(c,u){if(c===null||typeof c!="object")throw new TypeError("target is not an object");for(var p in u)Object.prototype.hasOwnProperty.call(u,p)&&(c[p]=u[p]);return c},a.find=function(c,u,p){if(p===void 0&&(p=Array.prototype),c&&typeof p.find=="function")return p.find.call(c,u);for(var f=0;f<c.length;f++)if(Object.prototype.hasOwnProperty.call(c,f)){var d=c[f];if(u.call(void 0,d,f,c))return d}},a.freeze=o,a.MIME_TYPE=l,a.NAMESPACE=s},5752:(i,a,o)=>{var l=o(4582),s=o(4722),c=o(6559),u=o(4466),p=s.DOMImplementation,f=l.NAMESPACE,d=u.ParseError,g=u.XMLReader;function m(w){return w.replace(/\r[\n\u0085]/g,`
`).replace(/[\r\u0085\u2028]/g,`
`)}function h(w){this.options=w||{locator:{}}}function b(){this.cdata=!1}function _(w,C){C.lineNumber=w.lineNumber,C.columnNumber=w.columnNumber}function N(w){if(w)return`
@`+(w.systemId||"")+"#[line:"+w.lineNumber+",col:"+w.columnNumber+"]"}function k(w,C,y){return typeof w=="string"?w.substr(C,y):w.length>=C+y||C?new java.lang.String(w,C,y)+"":w}function O(w,C){w.currentElement?w.currentElement.appendChild(C):w.doc.appendChild(C)}h.prototype.parseFromString=function(w,C){var y=this.options,S=new g,D=y.domBuilder||new b,R=y.errorHandler,M=y.locator,I=y.xmlns||{},q=/\/x?html?$/.test(C),U=q?c.HTML_ENTITIES:c.XML_ENTITIES;M&&D.setDocumentLocator(M),S.errorHandler=function(W,X,se){if(!W){if(X instanceof b)return X;W=X}var Z={},pe=W instanceof Function;function ie(ce){var ye=W[ce];!ye&&pe&&(ye=W.length==2?function(xe){W(ce,xe)}:W),Z[ce]=ye&&function(xe){ye("[xmldom "+ce+"] "+xe+N(se))}||function(){}}return se=se||{},ie("warning"),ie("error"),ie("fatalError"),Z}(R,D,M),S.domBuilder=y.domBuilder||D,q&&(I[""]=f.HTML),I.xml=I.xml||f.XML;var H=y.normalizeLineEndings||m;return w&&typeof w=="string"?S.parse(H(w),I,U):S.errorHandler.error("invalid doc source"),D.doc},b.prototype={startDocument:function(){this.doc=new p().createDocument(null,null,null),this.locator&&(this.doc.documentURI=this.locator.systemId)},startElement:function(w,C,y,S){var D=this.doc,R=D.createElementNS(w,y||C),M=S.length;O(this,R),this.currentElement=R,this.locator&&_(this.locator,R);for(var I=0;I<M;I++){w=S.getURI(I);var q=S.getValue(I),U=(y=S.getQName(I),D.createAttributeNS(w,y));this.locator&&_(S.getLocator(I),U),U.value=U.nodeValue=q,R.setAttributeNode(U)}},endElement:function(w,C,y){var S=this.currentElement;S.tagName,this.currentElement=S.parentNode},startPrefixMapping:function(w,C){},endPrefixMapping:function(w){},processingInstruction:function(w,C){var y=this.doc.createProcessingInstruction(w,C);this.locator&&_(this.locator,y),O(this,y)},ignorableWhitespace:function(w,C,y){},characters:function(w,C,y){if(w=k.apply(this,arguments)){if(this.cdata)var S=this.doc.createCDATASection(w);else S=this.doc.createTextNode(w);this.currentElement?this.currentElement.appendChild(S):/^\s*$/.test(w)&&this.doc.appendChild(S),this.locator&&_(this.locator,S)}},skippedEntity:function(w){},endDocument:function(){this.doc.normalize()},setDocumentLocator:function(w){(this.locator=w)&&(w.lineNumber=0)},comment:function(w,C,y){w=k.apply(this,arguments);var S=this.doc.createComment(w);this.locator&&_(this.locator,S),O(this,S)},startCDATA:function(){this.cdata=!0},endCDATA:function(){this.cdata=!1},startDTD:function(w,C,y){var S=this.doc.implementation;if(S&&S.createDocumentType){var D=S.createDocumentType(w,C,y);this.locator&&_(this.locator,D),O(this,D),this.doc.doctype=D}},warning:function(w){console.warn("[xmldom warning] "+w,N(this.locator))},error:function(w){console.error("[xmldom error] "+w,N(this.locator))},fatalError:function(w){throw new d(w,this.locator)}},"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl".replace(/\w+/g,function(w){b.prototype[w]=function(){return null}}),a.DOMParser=h},4722:(i,a,o)=>{var l=o(4582),s=l.find,c=l.NAMESPACE;function u(v){return v!==""}function p(v,T){return v.hasOwnProperty(T)||(v[T]=!0),v}function f(v){if(!v)return[];var T=function(P){return P?P.split(/[\t\n\f\r ]+/).filter(u):[]}(v);return Object.keys(T.reduce(p,{}))}function d(v,T){for(var P in v)Object.prototype.hasOwnProperty.call(v,P)&&(T[P]=v[P])}function g(v,T){var P=v.prototype;if(!(P instanceof T)){let Y=function(){};var $=Y;Y.prototype=T.prototype,d(P,Y=new Y),v.prototype=P=Y}P.constructor!=v&&(typeof v!="function"&&console.error("unknown Class:"+v),P.constructor=v)}var m={},h=m.ELEMENT_NODE=1,b=m.ATTRIBUTE_NODE=2,_=m.TEXT_NODE=3,N=m.CDATA_SECTION_NODE=4,k=m.ENTITY_REFERENCE_NODE=5,O=m.ENTITY_NODE=6,w=m.PROCESSING_INSTRUCTION_NODE=7,C=m.COMMENT_NODE=8,y=m.DOCUMENT_NODE=9,S=m.DOCUMENT_TYPE_NODE=10,D=m.DOCUMENT_FRAGMENT_NODE=11,R=m.NOTATION_NODE=12,M={},I={},q=(M.INDEX_SIZE_ERR=(I[1]="Index size error",1),M.DOMSTRING_SIZE_ERR=(I[2]="DOMString size error",2),M.HIERARCHY_REQUEST_ERR=(I[3]="Hierarchy request error",3)),U=(M.WRONG_DOCUMENT_ERR=(I[4]="Wrong document",4),M.INVALID_CHARACTER_ERR=(I[5]="Invalid character",5),M.NO_DATA_ALLOWED_ERR=(I[6]="No data allowed",6),M.NO_MODIFICATION_ALLOWED_ERR=(I[7]="No modification allowed",7),M.NOT_FOUND_ERR=(I[8]="Not found",8)),H=(M.NOT_SUPPORTED_ERR=(I[9]="Not supported",9),M.INUSE_ATTRIBUTE_ERR=(I[10]="Attribute in use",10));function W(v,T){if(T instanceof Error)var P=T;else P=this,Error.call(this,I[v]),this.message=I[v],Error.captureStackTrace&&Error.captureStackTrace(this,W);return P.code=v,T&&(this.message=this.message+": "+T),P}function X(){}function se(v,T){this._node=v,this._refresh=T,Z(this)}function Z(v){var T=v._node._inc||v._node.ownerDocument._inc;if(v._inc!==T){var P=v._refresh(v._node);if(Nc(v,"length",P.length),!v.$$length||P.length<v.$$length)for(var $=P.length;$ in v;$++)Object.prototype.hasOwnProperty.call(v,$)&&delete v[$];d(P,v),v._inc=T}}function pe(){}function ie(v,T){for(var P=v.length;P--;)if(v[P]===T)return P}function ce(v,T,P,$){if($?T[ie(T,$)]=P:T[T.length++]=P,v){P.ownerElement=v;var Y=v.ownerDocument;Y&&($&&L(Y,v,$),function(oe,Te,ge){oe&&oe._inc++,ge.namespaceURI===c.XMLNS&&(Te._nsMap[ge.prefix?ge.localName:""]=ge.value)}(Y,v,P))}}function ye(v,T,P){var $=ie(T,P);if(!($>=0))throw new W(U,new Error(v.tagName+"@"+P));for(var Y=T.length-1;$<Y;)T[$]=T[++$];if(T.length=Y,v){var oe=v.ownerDocument;oe&&(L(oe,v,P),P.ownerElement=null)}}function xe(){}function E(){}function x(v){return(v=="<"?"&lt;":v==">"&&"&gt;")||v=="&"&&"&amp;"||v=='"'&&"&quot;"||"&#"+v.charCodeAt()+";"}function F(v,T){if(T(v))return!0;if(v=v.firstChild)do if(F(v,T))return!0;while(v=v.nextSibling)}function A(){this.ownerDocument=this}function L(v,T,P,$){v&&v._inc++,P.namespaceURI===c.XMLNS&&delete T._nsMap[P.prefix?P.localName:""]}function j(v,T,P){if(v&&v._inc){v._inc++;var $=T.childNodes;if(P)$[$.length++]=P;else{for(var Y=T.firstChild,oe=0;Y;)$[oe++]=Y,Y=Y.nextSibling;$.length=oe,delete $[$.length]}}}function z(v,T){var P=T.previousSibling,$=T.nextSibling;return P?P.nextSibling=$:v.firstChild=$,$?$.previousSibling=P:v.lastChild=P,T.parentNode=null,T.previousSibling=null,T.nextSibling=null,j(v.ownerDocument,v),T}function V(v){return v&&v.nodeType===E.DOCUMENT_TYPE_NODE}function G(v){return v&&v.nodeType===E.ELEMENT_NODE}function de(v){return v&&v.nodeType===E.TEXT_NODE}function fe(v,T){var P=v.childNodes||[];if(s(P,G)||V(T))return!1;var $=s(P,V);return!(T&&$&&P.indexOf($)>P.indexOf(T))}function we(v,T){var P=v.childNodes||[];if(s(P,function(Y){return G(Y)&&Y!==T}))return!1;var $=s(P,V);return!(T&&$&&P.indexOf($)>P.indexOf(T))}function ft(v,T,P){var $=v.childNodes||[],Y=T.childNodes||[];if(T.nodeType===E.DOCUMENT_FRAGMENT_NODE){var oe=Y.filter(G);if(oe.length>1||s(Y,de))throw new W(q,"More than one element or text in fragment");if(oe.length===1&&!fe(v,P))throw new W(q,"Element in fragment can not be inserted before doctype")}if(G(T)&&!fe(v,P))throw new W(q,"Only one element can be added and only after doctype");if(V(T)){if(s($,V))throw new W(q,"Only one doctype is allowed");var Te=s($,G);if(P&&$.indexOf(Te)<$.indexOf(P))throw new W(q,"Doctype can only be inserted before an element");if(!P&&Te)throw new W(q,"Doctype can not be appended since element is present")}}function Vt(v,T,P){var $=v.childNodes||[],Y=T.childNodes||[];if(T.nodeType===E.DOCUMENT_FRAGMENT_NODE){var oe=Y.filter(G);if(oe.length>1||s(Y,de))throw new W(q,"More than one element or text in fragment");if(oe.length===1&&!we(v,P))throw new W(q,"Element in fragment can not be inserted before doctype")}if(G(T)&&!we(v,P))throw new W(q,"Only one element can be added and only after doctype");if(V(T)){if(s($,function(ge){return V(ge)&&ge!==P}))throw new W(q,"Only one doctype is allowed");var Te=s($,G);if(P&&$.indexOf(Te)<$.indexOf(P))throw new W(q,"Doctype can only be inserted before an element")}}function ve(v,T,P,$){(function(He,at,mt){if(!function(We){return We&&(We.nodeType===E.DOCUMENT_NODE||We.nodeType===E.DOCUMENT_FRAGMENT_NODE||We.nodeType===E.ELEMENT_NODE)}(He))throw new W(q,"Unexpected parent node type "+He.nodeType);if(mt&&mt.parentNode!==He)throw new W(U,"child not in parent");if(!function(We){return We&&(G(We)||de(We)||V(We)||We.nodeType===E.DOCUMENT_FRAGMENT_NODE||We.nodeType===E.COMMENT_NODE||We.nodeType===E.PROCESSING_INSTRUCTION_NODE)}(at)||V(at)&&He.nodeType!==E.DOCUMENT_NODE)throw new W(q,"Unexpected node type "+at.nodeType+" for parent node type "+He.nodeType)})(v,T,P),v.nodeType===E.DOCUMENT_NODE&&($||ft)(v,T,P);var Y=T.parentNode;if(Y&&Y.removeChild(T),T.nodeType===D){var oe=T.firstChild;if(oe==null)return T;var Te=T.lastChild}else oe=Te=T;var ge=P?P.previousSibling:v.lastChild;oe.previousSibling=ge,Te.nextSibling=P,ge?ge.nextSibling=oe:v.firstChild=oe,P==null?v.lastChild=Te:P.previousSibling=Te;do oe.parentNode=v;while(oe!==Te&&(oe=oe.nextSibling));return j(v.ownerDocument||v,v),T.nodeType==D&&(T.firstChild=T.lastChild=null),T}function Pe(){this._nsMap={}}function zt(){}function Lr(){}function Gn(){}function Jo(){}function Qo(){}function zi(){}function Tc(){}function _c(){}function es(){}function Gi(){}function ts(){}function Ac(){}function Cc(v,T){var P=[],$=this.nodeType==9&&this.documentElement||this,Y=$.prefix,oe=$.namespaceURI;if(oe&&Y==null&&(Y=$.lookupPrefix(oe))==null)var Te=[{namespace:oe,prefix:null}];return dn(this,P,v,T,Te),P.join("")}function kc(v,T,P){var $=v.prefix||"",Y=v.namespaceURI;if(!Y||$==="xml"&&Y===c.XML||Y===c.XMLNS)return!1;for(var oe=P.length;oe--;){var Te=P[oe];if(Te.prefix===$)return Te.namespace!==Y}return!0}function rs(v,T,P){v.push(" ",T,'="',P.replace(/[<>&"\t\n\r]/g,x),'"')}function dn(v,T,P,$,Y){if(Y||(Y=[]),$){if(!(v=$(v)))return;if(typeof v=="string")return void T.push(v)}switch(v.nodeType){case h:var oe=v.attributes,Te=oe.length,ge=v.firstChild,He=v.tagName,at=He;if(!(P=c.isHTML(v.namespaceURI)||P)&&!v.prefix&&v.namespaceURI){for(var mt,We=0;We<oe.length;We++)if(oe.item(We).name==="xmlns"){mt=oe.item(We).value;break}if(!mt){for(var Mr=Y.length-1;Mr>=0;Mr--)if((fn=Y[Mr]).prefix===""&&fn.namespace===v.namespaceURI){mt=fn.namespace;break}}if(mt!==v.namespaceURI)for(Mr=Y.length-1;Mr>=0;Mr--){var fn;if((fn=Y[Mr]).namespace===v.namespaceURI){fn.prefix&&(at=fn.prefix+":"+He);break}}}T.push("<",at);for(var $r=0;$r<Te;$r++)(Gt=oe.item($r)).prefix=="xmlns"?Y.push({prefix:Gt.localName,namespace:Gt.value}):Gt.nodeName=="xmlns"&&Y.push({prefix:"",namespace:Gt.value});for($r=0;$r<Te;$r++){var Gt,mn,Yi;kc(Gt=oe.item($r),0,Y)&&(rs(T,(mn=Gt.prefix||"")?"xmlns:"+mn:"xmlns",Yi=Gt.namespaceURI),Y.push({prefix:mn,namespace:Yi})),dn(Gt,T,P,$,Y)}if(He===at&&kc(v,0,Y)&&(rs(T,(mn=v.prefix||"")?"xmlns:"+mn:"xmlns",Yi=v.namespaceURI),Y.push({prefix:mn,namespace:Yi})),ge||P&&!/^(?:meta|link|img|br|hr|input)$/i.test(He)){if(T.push(">"),P&&/^script$/i.test(He))for(;ge;)ge.data?T.push(ge.data):dn(ge,T,P,$,Y.slice()),ge=ge.nextSibling;else for(;ge;)dn(ge,T,P,$,Y.slice()),ge=ge.nextSibling;T.push("</",at,">")}else T.push("/>");return;case y:case D:for(ge=v.firstChild;ge;)dn(ge,T,P,$,Y.slice()),ge=ge.nextSibling;return;case b:return rs(T,v.name,v.value);case _:return T.push(v.data.replace(/[<&>]/g,x));case N:return T.push("<![CDATA[",v.data,"]]>");case C:return T.push("<!--",v.data,"-->");case S:var Sc=v.publicId,hn=v.systemId;if(T.push("<!DOCTYPE ",v.name),Sc)T.push(" PUBLIC ",Sc),hn&&hn!="."&&T.push(" ",hn),T.push(">");else if(hn&&hn!=".")T.push(" SYSTEM ",hn,">");else{var Dc=v.internalSubset;Dc&&T.push(" [",Dc,"]"),T.push(">")}return;case w:return T.push("<?",v.target," ",v.data,"?>");case k:return T.push("&",v.nodeName,";");default:T.push("??",v.nodeName)}}function Pc(v,T,P){var $;switch(T.nodeType){case h:($=T.cloneNode(!1)).ownerDocument=v;case D:break;case b:P=!0}if($||($=T.cloneNode(!1)),$.ownerDocument=v,$.parentNode=null,P)for(var Y=T.firstChild;Y;)$.appendChild(Pc(v,Y,P)),Y=Y.nextSibling;return $}function ns(v,T,P){var $=new T.constructor;for(var Y in T)if(Object.prototype.hasOwnProperty.call(T,Y)){var oe=T[Y];typeof oe!="object"&&oe!=$[Y]&&($[Y]=oe)}switch(T.childNodes&&($.childNodes=new X),$.ownerDocument=v,$.nodeType){case h:var Te=T.attributes,ge=$.attributes=new pe,He=Te.length;ge._ownerElement=$;for(var at=0;at<He;at++)$.setAttributeNode(ns(v,Te.item(at),!0));break;case b:P=!0}if(P)for(var mt=T.firstChild;mt;)$.appendChild(ns(v,mt,P)),mt=mt.nextSibling;return $}function Nc(v,T,P){v[T]=P}M.INVALID_STATE_ERR=(I[11]="Invalid state",11),M.SYNTAX_ERR=(I[12]="Syntax error",12),M.INVALID_MODIFICATION_ERR=(I[13]="Invalid modification",13),M.NAMESPACE_ERR=(I[14]="Invalid namespace",14),M.INVALID_ACCESS_ERR=(I[15]="Invalid access",15),W.prototype=Error.prototype,d(M,W),X.prototype={length:0,item:function(v){return v>=0&&v<this.length?this[v]:null},toString:function(v,T){for(var P=[],$=0;$<this.length;$++)dn(this[$],P,v,T);return P.join("")},filter:function(v){return Array.prototype.filter.call(this,v)},indexOf:function(v){return Array.prototype.indexOf.call(this,v)}},se.prototype.item=function(v){return Z(this),this[v]||null},g(se,X),pe.prototype={length:0,item:X.prototype.item,getNamedItem:function(v){for(var T=this.length;T--;){var P=this[T];if(P.nodeName==v)return P}},setNamedItem:function(v){var T=v.ownerElement;if(T&&T!=this._ownerElement)throw new W(H);var P=this.getNamedItem(v.nodeName);return ce(this._ownerElement,this,v,P),P},setNamedItemNS:function(v){var T,P=v.ownerElement;if(P&&P!=this._ownerElement)throw new W(H);return T=this.getNamedItemNS(v.namespaceURI,v.localName),ce(this._ownerElement,this,v,T),T},removeNamedItem:function(v){var T=this.getNamedItem(v);return ye(this._ownerElement,this,T),T},removeNamedItemNS:function(v,T){var P=this.getNamedItemNS(v,T);return ye(this._ownerElement,this,P),P},getNamedItemNS:function(v,T){for(var P=this.length;P--;){var $=this[P];if($.localName==T&&$.namespaceURI==v)return $}return null}},xe.prototype={hasFeature:function(v,T){return!0},createDocument:function(v,T,P){var $=new A;if($.implementation=this,$.childNodes=new X,$.doctype=P||null,P&&$.appendChild(P),T){var Y=$.createElementNS(v,T);$.appendChild(Y)}return $},createDocumentType:function(v,T,P){var $=new zi;return $.name=v,$.nodeName=v,$.publicId=T||"",$.systemId=P||"",$}},E.prototype={firstChild:null,lastChild:null,previousSibling:null,nextSibling:null,attributes:null,parentNode:null,childNodes:null,ownerDocument:null,nodeValue:null,namespaceURI:null,prefix:null,localName:null,insertBefore:function(v,T){return ve(this,v,T)},replaceChild:function(v,T){ve(this,v,T,Vt),T&&this.removeChild(T)},removeChild:function(v){return z(this,v)},appendChild:function(v){return this.insertBefore(v,null)},hasChildNodes:function(){return this.firstChild!=null},cloneNode:function(v){return ns(this.ownerDocument||this,this,v)},normalize:function(){for(var v=this.firstChild;v;){var T=v.nextSibling;T&&T.nodeType==_&&v.nodeType==_?(this.removeChild(T),v.appendData(T.data)):(v.normalize(),v=T)}},isSupported:function(v,T){return this.ownerDocument.implementation.hasFeature(v,T)},hasAttributes:function(){return this.attributes.length>0},lookupPrefix:function(v){for(var T=this;T;){var P=T._nsMap;if(P){for(var $ in P)if(Object.prototype.hasOwnProperty.call(P,$)&&P[$]===v)return $}T=T.nodeType==b?T.ownerDocument:T.parentNode}return null},lookupNamespaceURI:function(v){for(var T=this;T;){var P=T._nsMap;if(P&&Object.prototype.hasOwnProperty.call(P,v))return P[v];T=T.nodeType==b?T.ownerDocument:T.parentNode}return null},isDefaultNamespace:function(v){return this.lookupPrefix(v)==null}},d(m,E),d(m,E.prototype),A.prototype={nodeName:"#document",nodeType:y,doctype:null,documentElement:null,_inc:1,insertBefore:function(v,T){if(v.nodeType==D){for(var P=v.firstChild;P;){var $=P.nextSibling;this.insertBefore(P,T),P=$}return v}return ve(this,v,T),v.ownerDocument=this,this.documentElement===null&&v.nodeType===h&&(this.documentElement=v),v},removeChild:function(v){return this.documentElement==v&&(this.documentElement=null),z(this,v)},replaceChild:function(v,T){ve(this,v,T,Vt),v.ownerDocument=this,T&&this.removeChild(T),G(v)&&(this.documentElement=v)},importNode:function(v,T){return Pc(this,v,T)},getElementById:function(v){var T=null;return F(this.documentElement,function(P){if(P.nodeType==h&&P.getAttribute("id")==v)return T=P,!0}),T},getElementsByClassName:function(v){var T=f(v);return new se(this,function(P){var $=[];return T.length>0&&F(P.documentElement,function(Y){if(Y!==P&&Y.nodeType===h){var oe=Y.getAttribute("class");if(oe){var Te=v===oe;if(!Te){var ge=f(oe);Te=T.every((He=ge,function(at){return He&&He.indexOf(at)!==-1}))}Te&&$.push(Y)}}var He}),$})},createElement:function(v){var T=new Pe;return T.ownerDocument=this,T.nodeName=v,T.tagName=v,T.localName=v,T.childNodes=new X,(T.attributes=new pe)._ownerElement=T,T},createDocumentFragment:function(){var v=new Gi;return v.ownerDocument=this,v.childNodes=new X,v},createTextNode:function(v){var T=new Gn;return T.ownerDocument=this,T.appendData(v),T},createComment:function(v){var T=new Jo;return T.ownerDocument=this,T.appendData(v),T},createCDATASection:function(v){var T=new Qo;return T.ownerDocument=this,T.appendData(v),T},createProcessingInstruction:function(v,T){var P=new ts;return P.ownerDocument=this,P.tagName=P.nodeName=P.target=v,P.nodeValue=P.data=T,P},createAttribute:function(v){var T=new zt;return T.ownerDocument=this,T.name=v,T.nodeName=v,T.localName=v,T.specified=!0,T},createEntityReference:function(v){var T=new es;return T.ownerDocument=this,T.nodeName=v,T},createElementNS:function(v,T){var P=new Pe,$=T.split(":"),Y=P.attributes=new pe;return P.childNodes=new X,P.ownerDocument=this,P.nodeName=T,P.tagName=T,P.namespaceURI=v,$.length==2?(P.prefix=$[0],P.localName=$[1]):P.localName=T,Y._ownerElement=P,P},createAttributeNS:function(v,T){var P=new zt,$=T.split(":");return P.ownerDocument=this,P.nodeName=T,P.name=T,P.namespaceURI=v,P.specified=!0,$.length==2?(P.prefix=$[0],P.localName=$[1]):P.localName=T,P}},g(A,E),Pe.prototype={nodeType:h,hasAttribute:function(v){return this.getAttributeNode(v)!=null},getAttribute:function(v){var T=this.getAttributeNode(v);return T&&T.value||""},getAttributeNode:function(v){return this.attributes.getNamedItem(v)},setAttribute:function(v,T){var P=this.ownerDocument.createAttribute(v);P.value=P.nodeValue=""+T,this.setAttributeNode(P)},removeAttribute:function(v){var T=this.getAttributeNode(v);T&&this.removeAttributeNode(T)},appendChild:function(v){return v.nodeType===D?this.insertBefore(v,null):function(T,P){return P.parentNode&&P.parentNode.removeChild(P),P.parentNode=T,P.previousSibling=T.lastChild,P.nextSibling=null,P.previousSibling?P.previousSibling.nextSibling=P:T.firstChild=P,T.lastChild=P,j(T.ownerDocument,T,P),P}(this,v)},setAttributeNode:function(v){return this.attributes.setNamedItem(v)},setAttributeNodeNS:function(v){return this.attributes.setNamedItemNS(v)},removeAttributeNode:function(v){return this.attributes.removeNamedItem(v.nodeName)},removeAttributeNS:function(v,T){var P=this.getAttributeNodeNS(v,T);P&&this.removeAttributeNode(P)},hasAttributeNS:function(v,T){return this.getAttributeNodeNS(v,T)!=null},getAttributeNS:function(v,T){var P=this.getAttributeNodeNS(v,T);return P&&P.value||""},setAttributeNS:function(v,T,P){var $=this.ownerDocument.createAttributeNS(v,T);$.value=$.nodeValue=""+P,this.setAttributeNode($)},getAttributeNodeNS:function(v,T){return this.attributes.getNamedItemNS(v,T)},getElementsByTagName:function(v){return new se(this,function(T){var P=[];return F(T,function($){$===T||$.nodeType!=h||v!=="*"&&$.tagName!=v||P.push($)}),P})},getElementsByTagNameNS:function(v,T){return new se(this,function(P){var $=[];return F(P,function(Y){Y===P||Y.nodeType!==h||v!=="*"&&Y.namespaceURI!==v||T!=="*"&&Y.localName!=T||$.push(Y)}),$})}},A.prototype.getElementsByTagName=Pe.prototype.getElementsByTagName,A.prototype.getElementsByTagNameNS=Pe.prototype.getElementsByTagNameNS,g(Pe,E),zt.prototype.nodeType=b,g(zt,E),Lr.prototype={data:"",substringData:function(v,T){return this.data.substring(v,v+T)},appendData:function(v){v=this.data+v,this.nodeValue=this.data=v,this.length=v.length},insertData:function(v,T){this.replaceData(v,0,T)},appendChild:function(v){throw new Error(I[q])},deleteData:function(v,T){this.replaceData(v,T,"")},replaceData:function(v,T,P){P=this.data.substring(0,v)+P+this.data.substring(v+T),this.nodeValue=this.data=P,this.length=P.length}},g(Lr,E),Gn.prototype={nodeName:"#text",nodeType:_,splitText:function(v){var T=this.data,P=T.substring(v);T=T.substring(0,v),this.data=this.nodeValue=T,this.length=T.length;var $=this.ownerDocument.createTextNode(P);return this.parentNode&&this.parentNode.insertBefore($,this.nextSibling),$}},g(Gn,Lr),Jo.prototype={nodeName:"#comment",nodeType:C},g(Jo,Lr),Qo.prototype={nodeName:"#cdata-section",nodeType:N},g(Qo,Lr),zi.prototype.nodeType=S,g(zi,E),Tc.prototype.nodeType=R,g(Tc,E),_c.prototype.nodeType=O,g(_c,E),es.prototype.nodeType=k,g(es,E),Gi.prototype.nodeName="#document-fragment",Gi.prototype.nodeType=D,g(Gi,E),ts.prototype.nodeType=w,g(ts,E),Ac.prototype.serializeToString=function(v,T,P){return Cc.call(v,T,P)},E.prototype.toString=Cc;try{if(Object.defineProperty){let v=function(T){switch(T.nodeType){case h:case D:var P=[];for(T=T.firstChild;T;)T.nodeType!==7&&T.nodeType!==8&&P.push(v(T)),T=T.nextSibling;return P.join("");default:return T.nodeValue}};var n1=v;Object.defineProperty(se.prototype,"length",{get:function(){return Z(this),this.$$length}}),Object.defineProperty(E.prototype,"textContent",{get:function(){return v(this)},set:function(T){switch(this.nodeType){case h:case D:for(;this.firstChild;)this.removeChild(this.firstChild);(T||String(T))&&this.appendChild(this.ownerDocument.createTextNode(T));break;default:this.data=T,this.value=T,this.nodeValue=T}}}),Nc=function(T,P,$){T["$$"+P]=$}}}catch(v){}a.DocumentType=zi,a.DOMException=W,a.DOMImplementation=xe,a.Element=Pe,a.Node=E,a.NodeList=X,a.XMLSerializer=Ac},6559:(i,a,o)=>{"use strict";var l=o(4582).freeze;a.XML_ENTITIES=l({amp:"&",apos:"'",gt:">",lt:"<",quot:'"'}),a.HTML_ENTITIES=l({Aacute:"\xC1",aacute:"\xE1",Abreve:"\u0102",abreve:"\u0103",ac:"\u223E",acd:"\u223F",acE:"\u223E\u0333",Acirc:"\xC2",acirc:"\xE2",acute:"\xB4",Acy:"\u0410",acy:"\u0430",AElig:"\xC6",aelig:"\xE6",af:"\u2061",Afr:"\u{1D504}",afr:"\u{1D51E}",Agrave:"\xC0",agrave:"\xE0",alefsym:"\u2135",aleph:"\u2135",Alpha:"\u0391",alpha:"\u03B1",Amacr:"\u0100",amacr:"\u0101",amalg:"\u2A3F",AMP:"&",amp:"&",And:"\u2A53",and:"\u2227",andand:"\u2A55",andd:"\u2A5C",andslope:"\u2A58",andv:"\u2A5A",ang:"\u2220",ange:"\u29A4",angle:"\u2220",angmsd:"\u2221",angmsdaa:"\u29A8",angmsdab:"\u29A9",angmsdac:"\u29AA",angmsdad:"\u29AB",angmsdae:"\u29AC",angmsdaf:"\u29AD",angmsdag:"\u29AE",angmsdah:"\u29AF",angrt:"\u221F",angrtvb:"\u22BE",angrtvbd:"\u299D",angsph:"\u2222",angst:"\xC5",angzarr:"\u237C",Aogon:"\u0104",aogon:"\u0105",Aopf:"\u{1D538}",aopf:"\u{1D552}",ap:"\u2248",apacir:"\u2A6F",apE:"\u2A70",ape:"\u224A",apid:"\u224B",apos:"'",ApplyFunction:"\u2061",approx:"\u2248",approxeq:"\u224A",Aring:"\xC5",aring:"\xE5",Ascr:"\u{1D49C}",ascr:"\u{1D4B6}",Assign:"\u2254",ast:"*",asymp:"\u2248",asympeq:"\u224D",Atilde:"\xC3",atilde:"\xE3",Auml:"\xC4",auml:"\xE4",awconint:"\u2233",awint:"\u2A11",backcong:"\u224C",backepsilon:"\u03F6",backprime:"\u2035",backsim:"\u223D",backsimeq:"\u22CD",Backslash:"\u2216",Barv:"\u2AE7",barvee:"\u22BD",Barwed:"\u2306",barwed:"\u2305",barwedge:"\u2305",bbrk:"\u23B5",bbrktbrk:"\u23B6",bcong:"\u224C",Bcy:"\u0411",bcy:"\u0431",bdquo:"\u201E",becaus:"\u2235",Because:"\u2235",because:"\u2235",bemptyv:"\u29B0",bepsi:"\u03F6",bernou:"\u212C",Bernoullis:"\u212C",Beta:"\u0392",beta:"\u03B2",beth:"\u2136",between:"\u226C",Bfr:"\u{1D505}",bfr:"\u{1D51F}",bigcap:"\u22C2",bigcirc:"\u25EF",bigcup:"\u22C3",bigodot:"\u2A00",bigoplus:"\u2A01",bigotimes:"\u2A02",bigsqcup:"\u2A06",bigstar:"\u2605",bigtriangledown:"\u25BD",bigtriangleup:"\u25B3",biguplus:"\u2A04",bigvee:"\u22C1",bigwedge:"\u22C0",bkarow:"\u290D",blacklozenge:"\u29EB",blacksquare:"\u25AA",blacktriangle:"\u25B4",blacktriangledown:"\u25BE",blacktriangleleft:"\u25C2",blacktriangleright:"\u25B8",blank:"\u2423",blk12:"\u2592",blk14:"\u2591",blk34:"\u2593",block:"\u2588",bne:"=\u20E5",bnequiv:"\u2261\u20E5",bNot:"\u2AED",bnot:"\u2310",Bopf:"\u{1D539}",bopf:"\u{1D553}",bot:"\u22A5",bottom:"\u22A5",bowtie:"\u22C8",boxbox:"\u29C9",boxDL:"\u2557",boxDl:"\u2556",boxdL:"\u2555",boxdl:"\u2510",boxDR:"\u2554",boxDr:"\u2553",boxdR:"\u2552",boxdr:"\u250C",boxH:"\u2550",boxh:"\u2500",boxHD:"\u2566",boxHd:"\u2564",boxhD:"\u2565",boxhd:"\u252C",boxHU:"\u2569",boxHu:"\u2567",boxhU:"\u2568",boxhu:"\u2534",boxminus:"\u229F",boxplus:"\u229E",boxtimes:"\u22A0",boxUL:"\u255D",boxUl:"\u255C",boxuL:"\u255B",boxul:"\u2518",boxUR:"\u255A",boxUr:"\u2559",boxuR:"\u2558",boxur:"\u2514",boxV:"\u2551",boxv:"\u2502",boxVH:"\u256C",boxVh:"\u256B",boxvH:"\u256A",boxvh:"\u253C",boxVL:"\u2563",boxVl:"\u2562",boxvL:"\u2561",boxvl:"\u2524",boxVR:"\u2560",boxVr:"\u255F",boxvR:"\u255E",boxvr:"\u251C",bprime:"\u2035",Breve:"\u02D8",breve:"\u02D8",brvbar:"\xA6",Bscr:"\u212C",bscr:"\u{1D4B7}",bsemi:"\u204F",bsim:"\u223D",bsime:"\u22CD",bsol:"\\",bsolb:"\u29C5",bsolhsub:"\u27C8",bull:"\u2022",bullet:"\u2022",bump:"\u224E",bumpE:"\u2AAE",bumpe:"\u224F",Bumpeq:"\u224E",bumpeq:"\u224F",Cacute:"\u0106",cacute:"\u0107",Cap:"\u22D2",cap:"\u2229",capand:"\u2A44",capbrcup:"\u2A49",capcap:"\u2A4B",capcup:"\u2A47",capdot:"\u2A40",CapitalDifferentialD:"\u2145",caps:"\u2229\uFE00",caret:"\u2041",caron:"\u02C7",Cayleys:"\u212D",ccaps:"\u2A4D",Ccaron:"\u010C",ccaron:"\u010D",Ccedil:"\xC7",ccedil:"\xE7",Ccirc:"\u0108",ccirc:"\u0109",Cconint:"\u2230",ccups:"\u2A4C",ccupssm:"\u2A50",Cdot:"\u010A",cdot:"\u010B",cedil:"\xB8",Cedilla:"\xB8",cemptyv:"\u29B2",cent:"\xA2",CenterDot:"\xB7",centerdot:"\xB7",Cfr:"\u212D",cfr:"\u{1D520}",CHcy:"\u0427",chcy:"\u0447",check:"\u2713",checkmark:"\u2713",Chi:"\u03A7",chi:"\u03C7",cir:"\u25CB",circ:"\u02C6",circeq:"\u2257",circlearrowleft:"\u21BA",circlearrowright:"\u21BB",circledast:"\u229B",circledcirc:"\u229A",circleddash:"\u229D",CircleDot:"\u2299",circledR:"\xAE",circledS:"\u24C8",CircleMinus:"\u2296",CirclePlus:"\u2295",CircleTimes:"\u2297",cirE:"\u29C3",cire:"\u2257",cirfnint:"\u2A10",cirmid:"\u2AEF",cirscir:"\u29C2",ClockwiseContourIntegral:"\u2232",CloseCurlyDoubleQuote:"\u201D",CloseCurlyQuote:"\u2019",clubs:"\u2663",clubsuit:"\u2663",Colon:"\u2237",colon:":",Colone:"\u2A74",colone:"\u2254",coloneq:"\u2254",comma:",",commat:"@",comp:"\u2201",compfn:"\u2218",complement:"\u2201",complexes:"\u2102",cong:"\u2245",congdot:"\u2A6D",Congruent:"\u2261",Conint:"\u222F",conint:"\u222E",ContourIntegral:"\u222E",Copf:"\u2102",copf:"\u{1D554}",coprod:"\u2210",Coproduct:"\u2210",COPY:"\xA9",copy:"\xA9",copysr:"\u2117",CounterClockwiseContourIntegral:"\u2233",crarr:"\u21B5",Cross:"\u2A2F",cross:"\u2717",Cscr:"\u{1D49E}",cscr:"\u{1D4B8}",csub:"\u2ACF",csube:"\u2AD1",csup:"\u2AD0",csupe:"\u2AD2",ctdot:"\u22EF",cudarrl:"\u2938",cudarrr:"\u2935",cuepr:"\u22DE",cuesc:"\u22DF",cularr:"\u21B6",cularrp:"\u293D",Cup:"\u22D3",cup:"\u222A",cupbrcap:"\u2A48",CupCap:"\u224D",cupcap:"\u2A46",cupcup:"\u2A4A",cupdot:"\u228D",cupor:"\u2A45",cups:"\u222A\uFE00",curarr:"\u21B7",curarrm:"\u293C",curlyeqprec:"\u22DE",curlyeqsucc:"\u22DF",curlyvee:"\u22CE",curlywedge:"\u22CF",curren:"\xA4",curvearrowleft:"\u21B6",curvearrowright:"\u21B7",cuvee:"\u22CE",cuwed:"\u22CF",cwconint:"\u2232",cwint:"\u2231",cylcty:"\u232D",Dagger:"\u2021",dagger:"\u2020",daleth:"\u2138",Darr:"\u21A1",dArr:"\u21D3",darr:"\u2193",dash:"\u2010",Dashv:"\u2AE4",dashv:"\u22A3",dbkarow:"\u290F",dblac:"\u02DD",Dcaron:"\u010E",dcaron:"\u010F",Dcy:"\u0414",dcy:"\u0434",DD:"\u2145",dd:"\u2146",ddagger:"\u2021",ddarr:"\u21CA",DDotrahd:"\u2911",ddotseq:"\u2A77",deg:"\xB0",Del:"\u2207",Delta:"\u0394",delta:"\u03B4",demptyv:"\u29B1",dfisht:"\u297F",Dfr:"\u{1D507}",dfr:"\u{1D521}",dHar:"\u2965",dharl:"\u21C3",dharr:"\u21C2",DiacriticalAcute:"\xB4",DiacriticalDot:"\u02D9",DiacriticalDoubleAcute:"\u02DD",DiacriticalGrave:"`",DiacriticalTilde:"\u02DC",diam:"\u22C4",Diamond:"\u22C4",diamond:"\u22C4",diamondsuit:"\u2666",diams:"\u2666",die:"\xA8",DifferentialD:"\u2146",digamma:"\u03DD",disin:"\u22F2",div:"\xF7",divide:"\xF7",divideontimes:"\u22C7",divonx:"\u22C7",DJcy:"\u0402",djcy:"\u0452",dlcorn:"\u231E",dlcrop:"\u230D",dollar:"$",Dopf:"\u{1D53B}",dopf:"\u{1D555}",Dot:"\xA8",dot:"\u02D9",DotDot:"\u20DC",doteq:"\u2250",doteqdot:"\u2251",DotEqual:"\u2250",dotminus:"\u2238",dotplus:"\u2214",dotsquare:"\u22A1",doublebarwedge:"\u2306",DoubleContourIntegral:"\u222F",DoubleDot:"\xA8",DoubleDownArrow:"\u21D3",DoubleLeftArrow:"\u21D0",DoubleLeftRightArrow:"\u21D4",DoubleLeftTee:"\u2AE4",DoubleLongLeftArrow:"\u27F8",DoubleLongLeftRightArrow:"\u27FA",DoubleLongRightArrow:"\u27F9",DoubleRightArrow:"\u21D2",DoubleRightTee:"\u22A8",DoubleUpArrow:"\u21D1",DoubleUpDownArrow:"\u21D5",DoubleVerticalBar:"\u2225",DownArrow:"\u2193",Downarrow:"\u21D3",downarrow:"\u2193",DownArrowBar:"\u2913",DownArrowUpArrow:"\u21F5",DownBreve:"\u0311",downdownarrows:"\u21CA",downharpoonleft:"\u21C3",downharpoonright:"\u21C2",DownLeftRightVector:"\u2950",DownLeftTeeVector:"\u295E",DownLeftVector:"\u21BD",DownLeftVectorBar:"\u2956",DownRightTeeVector:"\u295F",DownRightVector:"\u21C1",DownRightVectorBar:"\u2957",DownTee:"\u22A4",DownTeeArrow:"\u21A7",drbkarow:"\u2910",drcorn:"\u231F",drcrop:"\u230C",Dscr:"\u{1D49F}",dscr:"\u{1D4B9}",DScy:"\u0405",dscy:"\u0455",dsol:"\u29F6",Dstrok:"\u0110",dstrok:"\u0111",dtdot:"\u22F1",dtri:"\u25BF",dtrif:"\u25BE",duarr:"\u21F5",duhar:"\u296F",dwangle:"\u29A6",DZcy:"\u040F",dzcy:"\u045F",dzigrarr:"\u27FF",Eacute:"\xC9",eacute:"\xE9",easter:"\u2A6E",Ecaron:"\u011A",ecaron:"\u011B",ecir:"\u2256",Ecirc:"\xCA",ecirc:"\xEA",ecolon:"\u2255",Ecy:"\u042D",ecy:"\u044D",eDDot:"\u2A77",Edot:"\u0116",eDot:"\u2251",edot:"\u0117",ee:"\u2147",efDot:"\u2252",Efr:"\u{1D508}",efr:"\u{1D522}",eg:"\u2A9A",Egrave:"\xC8",egrave:"\xE8",egs:"\u2A96",egsdot:"\u2A98",el:"\u2A99",Element:"\u2208",elinters:"\u23E7",ell:"\u2113",els:"\u2A95",elsdot:"\u2A97",Emacr:"\u0112",emacr:"\u0113",empty:"\u2205",emptyset:"\u2205",EmptySmallSquare:"\u25FB",emptyv:"\u2205",EmptyVerySmallSquare:"\u25AB",emsp:"\u2003",emsp13:"\u2004",emsp14:"\u2005",ENG:"\u014A",eng:"\u014B",ensp:"\u2002",Eogon:"\u0118",eogon:"\u0119",Eopf:"\u{1D53C}",eopf:"\u{1D556}",epar:"\u22D5",eparsl:"\u29E3",eplus:"\u2A71",epsi:"\u03B5",Epsilon:"\u0395",epsilon:"\u03B5",epsiv:"\u03F5",eqcirc:"\u2256",eqcolon:"\u2255",eqsim:"\u2242",eqslantgtr:"\u2A96",eqslantless:"\u2A95",Equal:"\u2A75",equals:"=",EqualTilde:"\u2242",equest:"\u225F",Equilibrium:"\u21CC",equiv:"\u2261",equivDD:"\u2A78",eqvparsl:"\u29E5",erarr:"\u2971",erDot:"\u2253",Escr:"\u2130",escr:"\u212F",esdot:"\u2250",Esim:"\u2A73",esim:"\u2242",Eta:"\u0397",eta:"\u03B7",ETH:"\xD0",eth:"\xF0",Euml:"\xCB",euml:"\xEB",euro:"\u20AC",excl:"!",exist:"\u2203",Exists:"\u2203",expectation:"\u2130",ExponentialE:"\u2147",exponentiale:"\u2147",fallingdotseq:"\u2252",Fcy:"\u0424",fcy:"\u0444",female:"\u2640",ffilig:"\uFB03",fflig:"\uFB00",ffllig:"\uFB04",Ffr:"\u{1D509}",ffr:"\u{1D523}",filig:"\uFB01",FilledSmallSquare:"\u25FC",FilledVerySmallSquare:"\u25AA",fjlig:"fj",flat:"\u266D",fllig:"\uFB02",fltns:"\u25B1",fnof:"\u0192",Fopf:"\u{1D53D}",fopf:"\u{1D557}",ForAll:"\u2200",forall:"\u2200",fork:"\u22D4",forkv:"\u2AD9",Fouriertrf:"\u2131",fpartint:"\u2A0D",frac12:"\xBD",frac13:"\u2153",frac14:"\xBC",frac15:"\u2155",frac16:"\u2159",frac18:"\u215B",frac23:"\u2154",frac25:"\u2156",frac34:"\xBE",frac35:"\u2157",frac38:"\u215C",frac45:"\u2158",frac56:"\u215A",frac58:"\u215D",frac78:"\u215E",frasl:"\u2044",frown:"\u2322",Fscr:"\u2131",fscr:"\u{1D4BB}",gacute:"\u01F5",Gamma:"\u0393",gamma:"\u03B3",Gammad:"\u03DC",gammad:"\u03DD",gap:"\u2A86",Gbreve:"\u011E",gbreve:"\u011F",Gcedil:"\u0122",Gcirc:"\u011C",gcirc:"\u011D",Gcy:"\u0413",gcy:"\u0433",Gdot:"\u0120",gdot:"\u0121",gE:"\u2267",ge:"\u2265",gEl:"\u2A8C",gel:"\u22DB",geq:"\u2265",geqq:"\u2267",geqslant:"\u2A7E",ges:"\u2A7E",gescc:"\u2AA9",gesdot:"\u2A80",gesdoto:"\u2A82",gesdotol:"\u2A84",gesl:"\u22DB\uFE00",gesles:"\u2A94",Gfr:"\u{1D50A}",gfr:"\u{1D524}",Gg:"\u22D9",gg:"\u226B",ggg:"\u22D9",gimel:"\u2137",GJcy:"\u0403",gjcy:"\u0453",gl:"\u2277",gla:"\u2AA5",glE:"\u2A92",glj:"\u2AA4",gnap:"\u2A8A",gnapprox:"\u2A8A",gnE:"\u2269",gne:"\u2A88",gneq:"\u2A88",gneqq:"\u2269",gnsim:"\u22E7",Gopf:"\u{1D53E}",gopf:"\u{1D558}",grave:"`",GreaterEqual:"\u2265",GreaterEqualLess:"\u22DB",GreaterFullEqual:"\u2267",GreaterGreater:"\u2AA2",GreaterLess:"\u2277",GreaterSlantEqual:"\u2A7E",GreaterTilde:"\u2273",Gscr:"\u{1D4A2}",gscr:"\u210A",gsim:"\u2273",gsime:"\u2A8E",gsiml:"\u2A90",Gt:"\u226B",GT:">",gt:">",gtcc:"\u2AA7",gtcir:"\u2A7A",gtdot:"\u22D7",gtlPar:"\u2995",gtquest:"\u2A7C",gtrapprox:"\u2A86",gtrarr:"\u2978",gtrdot:"\u22D7",gtreqless:"\u22DB",gtreqqless:"\u2A8C",gtrless:"\u2277",gtrsim:"\u2273",gvertneqq:"\u2269\uFE00",gvnE:"\u2269\uFE00",Hacek:"\u02C7",hairsp:"\u200A",half:"\xBD",hamilt:"\u210B",HARDcy:"\u042A",hardcy:"\u044A",hArr:"\u21D4",harr:"\u2194",harrcir:"\u2948",harrw:"\u21AD",Hat:"^",hbar:"\u210F",Hcirc:"\u0124",hcirc:"\u0125",hearts:"\u2665",heartsuit:"\u2665",hellip:"\u2026",hercon:"\u22B9",Hfr:"\u210C",hfr:"\u{1D525}",HilbertSpace:"\u210B",hksearow:"\u2925",hkswarow:"\u2926",hoarr:"\u21FF",homtht:"\u223B",hookleftarrow:"\u21A9",hookrightarrow:"\u21AA",Hopf:"\u210D",hopf:"\u{1D559}",horbar:"\u2015",HorizontalLine:"\u2500",Hscr:"\u210B",hscr:"\u{1D4BD}",hslash:"\u210F",Hstrok:"\u0126",hstrok:"\u0127",HumpDownHump:"\u224E",HumpEqual:"\u224F",hybull:"\u2043",hyphen:"\u2010",Iacute:"\xCD",iacute:"\xED",ic:"\u2063",Icirc:"\xCE",icirc:"\xEE",Icy:"\u0418",icy:"\u0438",Idot:"\u0130",IEcy:"\u0415",iecy:"\u0435",iexcl:"\xA1",iff:"\u21D4",Ifr:"\u2111",ifr:"\u{1D526}",Igrave:"\xCC",igrave:"\xEC",ii:"\u2148",iiiint:"\u2A0C",iiint:"\u222D",iinfin:"\u29DC",iiota:"\u2129",IJlig:"\u0132",ijlig:"\u0133",Im:"\u2111",Imacr:"\u012A",imacr:"\u012B",image:"\u2111",ImaginaryI:"\u2148",imagline:"\u2110",imagpart:"\u2111",imath:"\u0131",imof:"\u22B7",imped:"\u01B5",Implies:"\u21D2",in:"\u2208",incare:"\u2105",infin:"\u221E",infintie:"\u29DD",inodot:"\u0131",Int:"\u222C",int:"\u222B",intcal:"\u22BA",integers:"\u2124",Integral:"\u222B",intercal:"\u22BA",Intersection:"\u22C2",intlarhk:"\u2A17",intprod:"\u2A3C",InvisibleComma:"\u2063",InvisibleTimes:"\u2062",IOcy:"\u0401",iocy:"\u0451",Iogon:"\u012E",iogon:"\u012F",Iopf:"\u{1D540}",iopf:"\u{1D55A}",Iota:"\u0399",iota:"\u03B9",iprod:"\u2A3C",iquest:"\xBF",Iscr:"\u2110",iscr:"\u{1D4BE}",isin:"\u2208",isindot:"\u22F5",isinE:"\u22F9",isins:"\u22F4",isinsv:"\u22F3",isinv:"\u2208",it:"\u2062",Itilde:"\u0128",itilde:"\u0129",Iukcy:"\u0406",iukcy:"\u0456",Iuml:"\xCF",iuml:"\xEF",Jcirc:"\u0134",jcirc:"\u0135",Jcy:"\u0419",jcy:"\u0439",Jfr:"\u{1D50D}",jfr:"\u{1D527}",jmath:"\u0237",Jopf:"\u{1D541}",jopf:"\u{1D55B}",Jscr:"\u{1D4A5}",jscr:"\u{1D4BF}",Jsercy:"\u0408",jsercy:"\u0458",Jukcy:"\u0404",jukcy:"\u0454",Kappa:"\u039A",kappa:"\u03BA",kappav:"\u03F0",Kcedil:"\u0136",kcedil:"\u0137",Kcy:"\u041A",kcy:"\u043A",Kfr:"\u{1D50E}",kfr:"\u{1D528}",kgreen:"\u0138",KHcy:"\u0425",khcy:"\u0445",KJcy:"\u040C",kjcy:"\u045C",Kopf:"\u{1D542}",kopf:"\u{1D55C}",Kscr:"\u{1D4A6}",kscr:"\u{1D4C0}",lAarr:"\u21DA",Lacute:"\u0139",lacute:"\u013A",laemptyv:"\u29B4",lagran:"\u2112",Lambda:"\u039B",lambda:"\u03BB",Lang:"\u27EA",lang:"\u27E8",langd:"\u2991",langle:"\u27E8",lap:"\u2A85",Laplacetrf:"\u2112",laquo:"\xAB",Larr:"\u219E",lArr:"\u21D0",larr:"\u2190",larrb:"\u21E4",larrbfs:"\u291F",larrfs:"\u291D",larrhk:"\u21A9",larrlp:"\u21AB",larrpl:"\u2939",larrsim:"\u2973",larrtl:"\u21A2",lat:"\u2AAB",lAtail:"\u291B",latail:"\u2919",late:"\u2AAD",lates:"\u2AAD\uFE00",lBarr:"\u290E",lbarr:"\u290C",lbbrk:"\u2772",lbrace:"{",lbrack:"[",lbrke:"\u298B",lbrksld:"\u298F",lbrkslu:"\u298D",Lcaron:"\u013D",lcaron:"\u013E",Lcedil:"\u013B",lcedil:"\u013C",lceil:"\u2308",lcub:"{",Lcy:"\u041B",lcy:"\u043B",ldca:"\u2936",ldquo:"\u201C",ldquor:"\u201E",ldrdhar:"\u2967",ldrushar:"\u294B",ldsh:"\u21B2",lE:"\u2266",le:"\u2264",LeftAngleBracket:"\u27E8",LeftArrow:"\u2190",Leftarrow:"\u21D0",leftarrow:"\u2190",LeftArrowBar:"\u21E4",LeftArrowRightArrow:"\u21C6",leftarrowtail:"\u21A2",LeftCeiling:"\u2308",LeftDoubleBracket:"\u27E6",LeftDownTeeVector:"\u2961",LeftDownVector:"\u21C3",LeftDownVectorBar:"\u2959",LeftFloor:"\u230A",leftharpoondown:"\u21BD",leftharpoonup:"\u21BC",leftleftarrows:"\u21C7",LeftRightArrow:"\u2194",Leftrightarrow:"\u21D4",leftrightarrow:"\u2194",leftrightarrows:"\u21C6",leftrightharpoons:"\u21CB",leftrightsquigarrow:"\u21AD",LeftRightVector:"\u294E",LeftTee:"\u22A3",LeftTeeArrow:"\u21A4",LeftTeeVector:"\u295A",leftthreetimes:"\u22CB",LeftTriangle:"\u22B2",LeftTriangleBar:"\u29CF",LeftTriangleEqual:"\u22B4",LeftUpDownVector:"\u2951",LeftUpTeeVector:"\u2960",LeftUpVector:"\u21BF",LeftUpVectorBar:"\u2958",LeftVector:"\u21BC",LeftVectorBar:"\u2952",lEg:"\u2A8B",leg:"\u22DA",leq:"\u2264",leqq:"\u2266",leqslant:"\u2A7D",les:"\u2A7D",lescc:"\u2AA8",lesdot:"\u2A7F",lesdoto:"\u2A81",lesdotor:"\u2A83",lesg:"\u22DA\uFE00",lesges:"\u2A93",lessapprox:"\u2A85",lessdot:"\u22D6",lesseqgtr:"\u22DA",lesseqqgtr:"\u2A8B",LessEqualGreater:"\u22DA",LessFullEqual:"\u2266",LessGreater:"\u2276",lessgtr:"\u2276",LessLess:"\u2AA1",lesssim:"\u2272",LessSlantEqual:"\u2A7D",LessTilde:"\u2272",lfisht:"\u297C",lfloor:"\u230A",Lfr:"\u{1D50F}",lfr:"\u{1D529}",lg:"\u2276",lgE:"\u2A91",lHar:"\u2962",lhard:"\u21BD",lharu:"\u21BC",lharul:"\u296A",lhblk:"\u2584",LJcy:"\u0409",ljcy:"\u0459",Ll:"\u22D8",ll:"\u226A",llarr:"\u21C7",llcorner:"\u231E",Lleftarrow:"\u21DA",llhard:"\u296B",lltri:"\u25FA",Lmidot:"\u013F",lmidot:"\u0140",lmoust:"\u23B0",lmoustache:"\u23B0",lnap:"\u2A89",lnapprox:"\u2A89",lnE:"\u2268",lne:"\u2A87",lneq:"\u2A87",lneqq:"\u2268",lnsim:"\u22E6",loang:"\u27EC",loarr:"\u21FD",lobrk:"\u27E6",LongLeftArrow:"\u27F5",Longleftarrow:"\u27F8",longleftarrow:"\u27F5",LongLeftRightArrow:"\u27F7",Longleftrightarrow:"\u27FA",longleftrightarrow:"\u27F7",longmapsto:"\u27FC",LongRightArrow:"\u27F6",Longrightarrow:"\u27F9",longrightarrow:"\u27F6",looparrowleft:"\u21AB",looparrowright:"\u21AC",lopar:"\u2985",Lopf:"\u{1D543}",lopf:"\u{1D55D}",loplus:"\u2A2D",lotimes:"\u2A34",lowast:"\u2217",lowbar:"_",LowerLeftArrow:"\u2199",LowerRightArrow:"\u2198",loz:"\u25CA",lozenge:"\u25CA",lozf:"\u29EB",lpar:"(",lparlt:"\u2993",lrarr:"\u21C6",lrcorner:"\u231F",lrhar:"\u21CB",lrhard:"\u296D",lrm:"\u200E",lrtri:"\u22BF",lsaquo:"\u2039",Lscr:"\u2112",lscr:"\u{1D4C1}",Lsh:"\u21B0",lsh:"\u21B0",lsim:"\u2272",lsime:"\u2A8D",lsimg:"\u2A8F",lsqb:"[",lsquo:"\u2018",lsquor:"\u201A",Lstrok:"\u0141",lstrok:"\u0142",Lt:"\u226A",LT:"<",lt:"<",ltcc:"\u2AA6",ltcir:"\u2A79",ltdot:"\u22D6",lthree:"\u22CB",ltimes:"\u22C9",ltlarr:"\u2976",ltquest:"\u2A7B",ltri:"\u25C3",ltrie:"\u22B4",ltrif:"\u25C2",ltrPar:"\u2996",lurdshar:"\u294A",luruhar:"\u2966",lvertneqq:"\u2268\uFE00",lvnE:"\u2268\uFE00",macr:"\xAF",male:"\u2642",malt:"\u2720",maltese:"\u2720",Map:"\u2905",map:"\u21A6",mapsto:"\u21A6",mapstodown:"\u21A7",mapstoleft:"\u21A4",mapstoup:"\u21A5",marker:"\u25AE",mcomma:"\u2A29",Mcy:"\u041C",mcy:"\u043C",mdash:"\u2014",mDDot:"\u223A",measuredangle:"\u2221",MediumSpace:"\u205F",Mellintrf:"\u2133",Mfr:"\u{1D510}",mfr:"\u{1D52A}",mho:"\u2127",micro:"\xB5",mid:"\u2223",midast:"*",midcir:"\u2AF0",middot:"\xB7",minus:"\u2212",minusb:"\u229F",minusd:"\u2238",minusdu:"\u2A2A",MinusPlus:"\u2213",mlcp:"\u2ADB",mldr:"\u2026",mnplus:"\u2213",models:"\u22A7",Mopf:"\u{1D544}",mopf:"\u{1D55E}",mp:"\u2213",Mscr:"\u2133",mscr:"\u{1D4C2}",mstpos:"\u223E",Mu:"\u039C",mu:"\u03BC",multimap:"\u22B8",mumap:"\u22B8",nabla:"\u2207",Nacute:"\u0143",nacute:"\u0144",nang:"\u2220\u20D2",nap:"\u2249",napE:"\u2A70\u0338",napid:"\u224B\u0338",napos:"\u0149",napprox:"\u2249",natur:"\u266E",natural:"\u266E",naturals:"\u2115",nbsp:"\xA0",nbump:"\u224E\u0338",nbumpe:"\u224F\u0338",ncap:"\u2A43",Ncaron:"\u0147",ncaron:"\u0148",Ncedil:"\u0145",ncedil:"\u0146",ncong:"\u2247",ncongdot:"\u2A6D\u0338",ncup:"\u2A42",Ncy:"\u041D",ncy:"\u043D",ndash:"\u2013",ne:"\u2260",nearhk:"\u2924",neArr:"\u21D7",nearr:"\u2197",nearrow:"\u2197",nedot:"\u2250\u0338",NegativeMediumSpace:"\u200B",NegativeThickSpace:"\u200B",NegativeThinSpace:"\u200B",NegativeVeryThinSpace:"\u200B",nequiv:"\u2262",nesear:"\u2928",nesim:"\u2242\u0338",NestedGreaterGreater:"\u226B",NestedLessLess:"\u226A",NewLine:`
`,nexist:"\u2204",nexists:"\u2204",Nfr:"\u{1D511}",nfr:"\u{1D52B}",ngE:"\u2267\u0338",nge:"\u2271",ngeq:"\u2271",ngeqq:"\u2267\u0338",ngeqslant:"\u2A7E\u0338",nges:"\u2A7E\u0338",nGg:"\u22D9\u0338",ngsim:"\u2275",nGt:"\u226B\u20D2",ngt:"\u226F",ngtr:"\u226F",nGtv:"\u226B\u0338",nhArr:"\u21CE",nharr:"\u21AE",nhpar:"\u2AF2",ni:"\u220B",nis:"\u22FC",nisd:"\u22FA",niv:"\u220B",NJcy:"\u040A",njcy:"\u045A",nlArr:"\u21CD",nlarr:"\u219A",nldr:"\u2025",nlE:"\u2266\u0338",nle:"\u2270",nLeftarrow:"\u21CD",nleftarrow:"\u219A",nLeftrightarrow:"\u21CE",nleftrightarrow:"\u21AE",nleq:"\u2270",nleqq:"\u2266\u0338",nleqslant:"\u2A7D\u0338",nles:"\u2A7D\u0338",nless:"\u226E",nLl:"\u22D8\u0338",nlsim:"\u2274",nLt:"\u226A\u20D2",nlt:"\u226E",nltri:"\u22EA",nltrie:"\u22EC",nLtv:"\u226A\u0338",nmid:"\u2224",NoBreak:"\u2060",NonBreakingSpace:"\xA0",Nopf:"\u2115",nopf:"\u{1D55F}",Not:"\u2AEC",not:"\xAC",NotCongruent:"\u2262",NotCupCap:"\u226D",NotDoubleVerticalBar:"\u2226",NotElement:"\u2209",NotEqual:"\u2260",NotEqualTilde:"\u2242\u0338",NotExists:"\u2204",NotGreater:"\u226F",NotGreaterEqual:"\u2271",NotGreaterFullEqual:"\u2267\u0338",NotGreaterGreater:"\u226B\u0338",NotGreaterLess:"\u2279",NotGreaterSlantEqual:"\u2A7E\u0338",NotGreaterTilde:"\u2275",NotHumpDownHump:"\u224E\u0338",NotHumpEqual:"\u224F\u0338",notin:"\u2209",notindot:"\u22F5\u0338",notinE:"\u22F9\u0338",notinva:"\u2209",notinvb:"\u22F7",notinvc:"\u22F6",NotLeftTriangle:"\u22EA",NotLeftTriangleBar:"\u29CF\u0338",NotLeftTriangleEqual:"\u22EC",NotLess:"\u226E",NotLessEqual:"\u2270",NotLessGreater:"\u2278",NotLessLess:"\u226A\u0338",NotLessSlantEqual:"\u2A7D\u0338",NotLessTilde:"\u2274",NotNestedGreaterGreater:"\u2AA2\u0338",NotNestedLessLess:"\u2AA1\u0338",notni:"\u220C",notniva:"\u220C",notnivb:"\u22FE",notnivc:"\u22FD",NotPrecedes:"\u2280",NotPrecedesEqual:"\u2AAF\u0338",NotPrecedesSlantEqual:"\u22E0",NotReverseElement:"\u220C",NotRightTriangle:"\u22EB",NotRightTriangleBar:"\u29D0\u0338",NotRightTriangleEqual:"\u22ED",NotSquareSubset:"\u228F\u0338",NotSquareSubsetEqual:"\u22E2",NotSquareSuperset:"\u2290\u0338",NotSquareSupersetEqual:"\u22E3",NotSubset:"\u2282\u20D2",NotSubsetEqual:"\u2288",NotSucceeds:"\u2281",NotSucceedsEqual:"\u2AB0\u0338",NotSucceedsSlantEqual:"\u22E1",NotSucceedsTilde:"\u227F\u0338",NotSuperset:"\u2283\u20D2",NotSupersetEqual:"\u2289",NotTilde:"\u2241",NotTildeEqual:"\u2244",NotTildeFullEqual:"\u2247",NotTildeTilde:"\u2249",NotVerticalBar:"\u2224",npar:"\u2226",nparallel:"\u2226",nparsl:"\u2AFD\u20E5",npart:"\u2202\u0338",npolint:"\u2A14",npr:"\u2280",nprcue:"\u22E0",npre:"\u2AAF\u0338",nprec:"\u2280",npreceq:"\u2AAF\u0338",nrArr:"\u21CF",nrarr:"\u219B",nrarrc:"\u2933\u0338",nrarrw:"\u219D\u0338",nRightarrow:"\u21CF",nrightarrow:"\u219B",nrtri:"\u22EB",nrtrie:"\u22ED",nsc:"\u2281",nsccue:"\u22E1",nsce:"\u2AB0\u0338",Nscr:"\u{1D4A9}",nscr:"\u{1D4C3}",nshortmid:"\u2224",nshortparallel:"\u2226",nsim:"\u2241",nsime:"\u2244",nsimeq:"\u2244",nsmid:"\u2224",nspar:"\u2226",nsqsube:"\u22E2",nsqsupe:"\u22E3",nsub:"\u2284",nsubE:"\u2AC5\u0338",nsube:"\u2288",nsubset:"\u2282\u20D2",nsubseteq:"\u2288",nsubseteqq:"\u2AC5\u0338",nsucc:"\u2281",nsucceq:"\u2AB0\u0338",nsup:"\u2285",nsupE:"\u2AC6\u0338",nsupe:"\u2289",nsupset:"\u2283\u20D2",nsupseteq:"\u2289",nsupseteqq:"\u2AC6\u0338",ntgl:"\u2279",Ntilde:"\xD1",ntilde:"\xF1",ntlg:"\u2278",ntriangleleft:"\u22EA",ntrianglelefteq:"\u22EC",ntriangleright:"\u22EB",ntrianglerighteq:"\u22ED",Nu:"\u039D",nu:"\u03BD",num:"#",numero:"\u2116",numsp:"\u2007",nvap:"\u224D\u20D2",nVDash:"\u22AF",nVdash:"\u22AE",nvDash:"\u22AD",nvdash:"\u22AC",nvge:"\u2265\u20D2",nvgt:">\u20D2",nvHarr:"\u2904",nvinfin:"\u29DE",nvlArr:"\u2902",nvle:"\u2264\u20D2",nvlt:"<\u20D2",nvltrie:"\u22B4\u20D2",nvrArr:"\u2903",nvrtrie:"\u22B5\u20D2",nvsim:"\u223C\u20D2",nwarhk:"\u2923",nwArr:"\u21D6",nwarr:"\u2196",nwarrow:"\u2196",nwnear:"\u2927",Oacute:"\xD3",oacute:"\xF3",oast:"\u229B",ocir:"\u229A",Ocirc:"\xD4",ocirc:"\xF4",Ocy:"\u041E",ocy:"\u043E",odash:"\u229D",Odblac:"\u0150",odblac:"\u0151",odiv:"\u2A38",odot:"\u2299",odsold:"\u29BC",OElig:"\u0152",oelig:"\u0153",ofcir:"\u29BF",Ofr:"\u{1D512}",ofr:"\u{1D52C}",ogon:"\u02DB",Ograve:"\xD2",ograve:"\xF2",ogt:"\u29C1",ohbar:"\u29B5",ohm:"\u03A9",oint:"\u222E",olarr:"\u21BA",olcir:"\u29BE",olcross:"\u29BB",oline:"\u203E",olt:"\u29C0",Omacr:"\u014C",omacr:"\u014D",Omega:"\u03A9",omega:"\u03C9",Omicron:"\u039F",omicron:"\u03BF",omid:"\u29B6",ominus:"\u2296",Oopf:"\u{1D546}",oopf:"\u{1D560}",opar:"\u29B7",OpenCurlyDoubleQuote:"\u201C",OpenCurlyQuote:"\u2018",operp:"\u29B9",oplus:"\u2295",Or:"\u2A54",or:"\u2228",orarr:"\u21BB",ord:"\u2A5D",order:"\u2134",orderof:"\u2134",ordf:"\xAA",ordm:"\xBA",origof:"\u22B6",oror:"\u2A56",orslope:"\u2A57",orv:"\u2A5B",oS:"\u24C8",Oscr:"\u{1D4AA}",oscr:"\u2134",Oslash:"\xD8",oslash:"\xF8",osol:"\u2298",Otilde:"\xD5",otilde:"\xF5",Otimes:"\u2A37",otimes:"\u2297",otimesas:"\u2A36",Ouml:"\xD6",ouml:"\xF6",ovbar:"\u233D",OverBar:"\u203E",OverBrace:"\u23DE",OverBracket:"\u23B4",OverParenthesis:"\u23DC",par:"\u2225",para:"\xB6",parallel:"\u2225",parsim:"\u2AF3",parsl:"\u2AFD",part:"\u2202",PartialD:"\u2202",Pcy:"\u041F",pcy:"\u043F",percnt:"%",period:".",permil:"\u2030",perp:"\u22A5",pertenk:"\u2031",Pfr:"\u{1D513}",pfr:"\u{1D52D}",Phi:"\u03A6",phi:"\u03C6",phiv:"\u03D5",phmmat:"\u2133",phone:"\u260E",Pi:"\u03A0",pi:"\u03C0",pitchfork:"\u22D4",piv:"\u03D6",planck:"\u210F",planckh:"\u210E",plankv:"\u210F",plus:"+",plusacir:"\u2A23",plusb:"\u229E",pluscir:"\u2A22",plusdo:"\u2214",plusdu:"\u2A25",pluse:"\u2A72",PlusMinus:"\xB1",plusmn:"\xB1",plussim:"\u2A26",plustwo:"\u2A27",pm:"\xB1",Poincareplane:"\u210C",pointint:"\u2A15",Popf:"\u2119",popf:"\u{1D561}",pound:"\xA3",Pr:"\u2ABB",pr:"\u227A",prap:"\u2AB7",prcue:"\u227C",prE:"\u2AB3",pre:"\u2AAF",prec:"\u227A",precapprox:"\u2AB7",preccurlyeq:"\u227C",Precedes:"\u227A",PrecedesEqual:"\u2AAF",PrecedesSlantEqual:"\u227C",PrecedesTilde:"\u227E",preceq:"\u2AAF",precnapprox:"\u2AB9",precneqq:"\u2AB5",precnsim:"\u22E8",precsim:"\u227E",Prime:"\u2033",prime:"\u2032",primes:"\u2119",prnap:"\u2AB9",prnE:"\u2AB5",prnsim:"\u22E8",prod:"\u220F",Product:"\u220F",profalar:"\u232E",profline:"\u2312",profsurf:"\u2313",prop:"\u221D",Proportion:"\u2237",Proportional:"\u221D",propto:"\u221D",prsim:"\u227E",prurel:"\u22B0",Pscr:"\u{1D4AB}",pscr:"\u{1D4C5}",Psi:"\u03A8",psi:"\u03C8",puncsp:"\u2008",Qfr:"\u{1D514}",qfr:"\u{1D52E}",qint:"\u2A0C",Qopf:"\u211A",qopf:"\u{1D562}",qprime:"\u2057",Qscr:"\u{1D4AC}",qscr:"\u{1D4C6}",quaternions:"\u210D",quatint:"\u2A16",quest:"?",questeq:"\u225F",QUOT:'"',quot:'"',rAarr:"\u21DB",race:"\u223D\u0331",Racute:"\u0154",racute:"\u0155",radic:"\u221A",raemptyv:"\u29B3",Rang:"\u27EB",rang:"\u27E9",rangd:"\u2992",range:"\u29A5",rangle:"\u27E9",raquo:"\xBB",Rarr:"\u21A0",rArr:"\u21D2",rarr:"\u2192",rarrap:"\u2975",rarrb:"\u21E5",rarrbfs:"\u2920",rarrc:"\u2933",rarrfs:"\u291E",rarrhk:"\u21AA",rarrlp:"\u21AC",rarrpl:"\u2945",rarrsim:"\u2974",Rarrtl:"\u2916",rarrtl:"\u21A3",rarrw:"\u219D",rAtail:"\u291C",ratail:"\u291A",ratio:"\u2236",rationals:"\u211A",RBarr:"\u2910",rBarr:"\u290F",rbarr:"\u290D",rbbrk:"\u2773",rbrace:"}",rbrack:"]",rbrke:"\u298C",rbrksld:"\u298E",rbrkslu:"\u2990",Rcaron:"\u0158",rcaron:"\u0159",Rcedil:"\u0156",rcedil:"\u0157",rceil:"\u2309",rcub:"}",Rcy:"\u0420",rcy:"\u0440",rdca:"\u2937",rdldhar:"\u2969",rdquo:"\u201D",rdquor:"\u201D",rdsh:"\u21B3",Re:"\u211C",real:"\u211C",realine:"\u211B",realpart:"\u211C",reals:"\u211D",rect:"\u25AD",REG:"\xAE",reg:"\xAE",ReverseElement:"\u220B",ReverseEquilibrium:"\u21CB",ReverseUpEquilibrium:"\u296F",rfisht:"\u297D",rfloor:"\u230B",Rfr:"\u211C",rfr:"\u{1D52F}",rHar:"\u2964",rhard:"\u21C1",rharu:"\u21C0",rharul:"\u296C",Rho:"\u03A1",rho:"\u03C1",rhov:"\u03F1",RightAngleBracket:"\u27E9",RightArrow:"\u2192",Rightarrow:"\u21D2",rightarrow:"\u2192",RightArrowBar:"\u21E5",RightArrowLeftArrow:"\u21C4",rightarrowtail:"\u21A3",RightCeiling:"\u2309",RightDoubleBracket:"\u27E7",RightDownTeeVector:"\u295D",RightDownVector:"\u21C2",RightDownVectorBar:"\u2955",RightFloor:"\u230B",rightharpoondown:"\u21C1",rightharpoonup:"\u21C0",rightleftarrows:"\u21C4",rightleftharpoons:"\u21CC",rightrightarrows:"\u21C9",rightsquigarrow:"\u219D",RightTee:"\u22A2",RightTeeArrow:"\u21A6",RightTeeVector:"\u295B",rightthreetimes:"\u22CC",RightTriangle:"\u22B3",RightTriangleBar:"\u29D0",RightTriangleEqual:"\u22B5",RightUpDownVector:"\u294F",RightUpTeeVector:"\u295C",RightUpVector:"\u21BE",RightUpVectorBar:"\u2954",RightVector:"\u21C0",RightVectorBar:"\u2953",ring:"\u02DA",risingdotseq:"\u2253",rlarr:"\u21C4",rlhar:"\u21CC",rlm:"\u200F",rmoust:"\u23B1",rmoustache:"\u23B1",rnmid:"\u2AEE",roang:"\u27ED",roarr:"\u21FE",robrk:"\u27E7",ropar:"\u2986",Ropf:"\u211D",ropf:"\u{1D563}",roplus:"\u2A2E",rotimes:"\u2A35",RoundImplies:"\u2970",rpar:")",rpargt:"\u2994",rppolint:"\u2A12",rrarr:"\u21C9",Rrightarrow:"\u21DB",rsaquo:"\u203A",Rscr:"\u211B",rscr:"\u{1D4C7}",Rsh:"\u21B1",rsh:"\u21B1",rsqb:"]",rsquo:"\u2019",rsquor:"\u2019",rthree:"\u22CC",rtimes:"\u22CA",rtri:"\u25B9",rtrie:"\u22B5",rtrif:"\u25B8",rtriltri:"\u29CE",RuleDelayed:"\u29F4",ruluhar:"\u2968",rx:"\u211E",Sacute:"\u015A",sacute:"\u015B",sbquo:"\u201A",Sc:"\u2ABC",sc:"\u227B",scap:"\u2AB8",Scaron:"\u0160",scaron:"\u0161",sccue:"\u227D",scE:"\u2AB4",sce:"\u2AB0",Scedil:"\u015E",scedil:"\u015F",Scirc:"\u015C",scirc:"\u015D",scnap:"\u2ABA",scnE:"\u2AB6",scnsim:"\u22E9",scpolint:"\u2A13",scsim:"\u227F",Scy:"\u0421",scy:"\u0441",sdot:"\u22C5",sdotb:"\u22A1",sdote:"\u2A66",searhk:"\u2925",seArr:"\u21D8",searr:"\u2198",searrow:"\u2198",sect:"\xA7",semi:";",seswar:"\u2929",setminus:"\u2216",setmn:"\u2216",sext:"\u2736",Sfr:"\u{1D516}",sfr:"\u{1D530}",sfrown:"\u2322",sharp:"\u266F",SHCHcy:"\u0429",shchcy:"\u0449",SHcy:"\u0428",shcy:"\u0448",ShortDownArrow:"\u2193",ShortLeftArrow:"\u2190",shortmid:"\u2223",shortparallel:"\u2225",ShortRightArrow:"\u2192",ShortUpArrow:"\u2191",shy:"\xAD",Sigma:"\u03A3",sigma:"\u03C3",sigmaf:"\u03C2",sigmav:"\u03C2",sim:"\u223C",simdot:"\u2A6A",sime:"\u2243",simeq:"\u2243",simg:"\u2A9E",simgE:"\u2AA0",siml:"\u2A9D",simlE:"\u2A9F",simne:"\u2246",simplus:"\u2A24",simrarr:"\u2972",slarr:"\u2190",SmallCircle:"\u2218",smallsetminus:"\u2216",smashp:"\u2A33",smeparsl:"\u29E4",smid:"\u2223",smile:"\u2323",smt:"\u2AAA",smte:"\u2AAC",smtes:"\u2AAC\uFE00",SOFTcy:"\u042C",softcy:"\u044C",sol:"/",solb:"\u29C4",solbar:"\u233F",Sopf:"\u{1D54A}",sopf:"\u{1D564}",spades:"\u2660",spadesuit:"\u2660",spar:"\u2225",sqcap:"\u2293",sqcaps:"\u2293\uFE00",sqcup:"\u2294",sqcups:"\u2294\uFE00",Sqrt:"\u221A",sqsub:"\u228F",sqsube:"\u2291",sqsubset:"\u228F",sqsubseteq:"\u2291",sqsup:"\u2290",sqsupe:"\u2292",sqsupset:"\u2290",sqsupseteq:"\u2292",squ:"\u25A1",Square:"\u25A1",square:"\u25A1",SquareIntersection:"\u2293",SquareSubset:"\u228F",SquareSubsetEqual:"\u2291",SquareSuperset:"\u2290",SquareSupersetEqual:"\u2292",SquareUnion:"\u2294",squarf:"\u25AA",squf:"\u25AA",srarr:"\u2192",Sscr:"\u{1D4AE}",sscr:"\u{1D4C8}",ssetmn:"\u2216",ssmile:"\u2323",sstarf:"\u22C6",Star:"\u22C6",star:"\u2606",starf:"\u2605",straightepsilon:"\u03F5",straightphi:"\u03D5",strns:"\xAF",Sub:"\u22D0",sub:"\u2282",subdot:"\u2ABD",subE:"\u2AC5",sube:"\u2286",subedot:"\u2AC3",submult:"\u2AC1",subnE:"\u2ACB",subne:"\u228A",subplus:"\u2ABF",subrarr:"\u2979",Subset:"\u22D0",subset:"\u2282",subseteq:"\u2286",subseteqq:"\u2AC5",SubsetEqual:"\u2286",subsetneq:"\u228A",subsetneqq:"\u2ACB",subsim:"\u2AC7",subsub:"\u2AD5",subsup:"\u2AD3",succ:"\u227B",succapprox:"\u2AB8",succcurlyeq:"\u227D",Succeeds:"\u227B",SucceedsEqual:"\u2AB0",SucceedsSlantEqual:"\u227D",SucceedsTilde:"\u227F",succeq:"\u2AB0",succnapprox:"\u2ABA",succneqq:"\u2AB6",succnsim:"\u22E9",succsim:"\u227F",SuchThat:"\u220B",Sum:"\u2211",sum:"\u2211",sung:"\u266A",Sup:"\u22D1",sup:"\u2283",sup1:"\xB9",sup2:"\xB2",sup3:"\xB3",supdot:"\u2ABE",supdsub:"\u2AD8",supE:"\u2AC6",supe:"\u2287",supedot:"\u2AC4",Superset:"\u2283",SupersetEqual:"\u2287",suphsol:"\u27C9",suphsub:"\u2AD7",suplarr:"\u297B",supmult:"\u2AC2",supnE:"\u2ACC",supne:"\u228B",supplus:"\u2AC0",Supset:"\u22D1",supset:"\u2283",supseteq:"\u2287",supseteqq:"\u2AC6",supsetneq:"\u228B",supsetneqq:"\u2ACC",supsim:"\u2AC8",supsub:"\u2AD4",supsup:"\u2AD6",swarhk:"\u2926",swArr:"\u21D9",swarr:"\u2199",swarrow:"\u2199",swnwar:"\u292A",szlig:"\xDF",Tab:" ",target:"\u2316",Tau:"\u03A4",tau:"\u03C4",tbrk:"\u23B4",Tcaron:"\u0164",tcaron:"\u0165",Tcedil:"\u0162",tcedil:"\u0163",Tcy:"\u0422",tcy:"\u0442",tdot:"\u20DB",telrec:"\u2315",Tfr:"\u{1D517}",tfr:"\u{1D531}",there4:"\u2234",Therefore:"\u2234",therefore:"\u2234",Theta:"\u0398",theta:"\u03B8",thetasym:"\u03D1",thetav:"\u03D1",thickapprox:"\u2248",thicksim:"\u223C",ThickSpace:"\u205F\u200A",thinsp:"\u2009",ThinSpace:"\u2009",thkap:"\u2248",thksim:"\u223C",THORN:"\xDE",thorn:"\xFE",Tilde:"\u223C",tilde:"\u02DC",TildeEqual:"\u2243",TildeFullEqual:"\u2245",TildeTilde:"\u2248",times:"\xD7",timesb:"\u22A0",timesbar:"\u2A31",timesd:"\u2A30",tint:"\u222D",toea:"\u2928",top:"\u22A4",topbot:"\u2336",topcir:"\u2AF1",Topf:"\u{1D54B}",topf:"\u{1D565}",topfork:"\u2ADA",tosa:"\u2929",tprime:"\u2034",TRADE:"\u2122",trade:"\u2122",triangle:"\u25B5",triangledown:"\u25BF",triangleleft:"\u25C3",trianglelefteq:"\u22B4",triangleq:"\u225C",triangleright:"\u25B9",trianglerighteq:"\u22B5",tridot:"\u25EC",trie:"\u225C",triminus:"\u2A3A",TripleDot:"\u20DB",triplus:"\u2A39",trisb:"\u29CD",tritime:"\u2A3B",trpezium:"\u23E2",Tscr:"\u{1D4AF}",tscr:"\u{1D4C9}",TScy:"\u0426",tscy:"\u0446",TSHcy:"\u040B",tshcy:"\u045B",Tstrok:"\u0166",tstrok:"\u0167",twixt:"\u226C",twoheadleftarrow:"\u219E",twoheadrightarrow:"\u21A0",Uacute:"\xDA",uacute:"\xFA",Uarr:"\u219F",uArr:"\u21D1",uarr:"\u2191",Uarrocir:"\u2949",Ubrcy:"\u040E",ubrcy:"\u045E",Ubreve:"\u016C",ubreve:"\u016D",Ucirc:"\xDB",ucirc:"\xFB",Ucy:"\u0423",ucy:"\u0443",udarr:"\u21C5",Udblac:"\u0170",udblac:"\u0171",udhar:"\u296E",ufisht:"\u297E",Ufr:"\u{1D518}",ufr:"\u{1D532}",Ugrave:"\xD9",ugrave:"\xF9",uHar:"\u2963",uharl:"\u21BF",uharr:"\u21BE",uhblk:"\u2580",ulcorn:"\u231C",ulcorner:"\u231C",ulcrop:"\u230F",ultri:"\u25F8",Umacr:"\u016A",umacr:"\u016B",uml:"\xA8",UnderBar:"_",UnderBrace:"\u23DF",UnderBracket:"\u23B5",UnderParenthesis:"\u23DD",Union:"\u22C3",UnionPlus:"\u228E",Uogon:"\u0172",uogon:"\u0173",Uopf:"\u{1D54C}",uopf:"\u{1D566}",UpArrow:"\u2191",Uparrow:"\u21D1",uparrow:"\u2191",UpArrowBar:"\u2912",UpArrowDownArrow:"\u21C5",UpDownArrow:"\u2195",Updownarrow:"\u21D5",updownarrow:"\u2195",UpEquilibrium:"\u296E",upharpoonleft:"\u21BF",upharpoonright:"\u21BE",uplus:"\u228E",UpperLeftArrow:"\u2196",UpperRightArrow:"\u2197",Upsi:"\u03D2",upsi:"\u03C5",upsih:"\u03D2",Upsilon:"\u03A5",upsilon:"\u03C5",UpTee:"\u22A5",UpTeeArrow:"\u21A5",upuparrows:"\u21C8",urcorn:"\u231D",urcorner:"\u231D",urcrop:"\u230E",Uring:"\u016E",uring:"\u016F",urtri:"\u25F9",Uscr:"\u{1D4B0}",uscr:"\u{1D4CA}",utdot:"\u22F0",Utilde:"\u0168",utilde:"\u0169",utri:"\u25B5",utrif:"\u25B4",uuarr:"\u21C8",Uuml:"\xDC",uuml:"\xFC",uwangle:"\u29A7",vangrt:"\u299C",varepsilon:"\u03F5",varkappa:"\u03F0",varnothing:"\u2205",varphi:"\u03D5",varpi:"\u03D6",varpropto:"\u221D",vArr:"\u21D5",varr:"\u2195",varrho:"\u03F1",varsigma:"\u03C2",varsubsetneq:"\u228A\uFE00",varsubsetneqq:"\u2ACB\uFE00",varsupsetneq:"\u228B\uFE00",varsupsetneqq:"\u2ACC\uFE00",vartheta:"\u03D1",vartriangleleft:"\u22B2",vartriangleright:"\u22B3",Vbar:"\u2AEB",vBar:"\u2AE8",vBarv:"\u2AE9",Vcy:"\u0412",vcy:"\u0432",VDash:"\u22AB",Vdash:"\u22A9",vDash:"\u22A8",vdash:"\u22A2",Vdashl:"\u2AE6",Vee:"\u22C1",vee:"\u2228",veebar:"\u22BB",veeeq:"\u225A",vellip:"\u22EE",Verbar:"\u2016",verbar:"|",Vert:"\u2016",vert:"|",VerticalBar:"\u2223",VerticalLine:"|",VerticalSeparator:"\u2758",VerticalTilde:"\u2240",VeryThinSpace:"\u200A",Vfr:"\u{1D519}",vfr:"\u{1D533}",vltri:"\u22B2",vnsub:"\u2282\u20D2",vnsup:"\u2283\u20D2",Vopf:"\u{1D54D}",vopf:"\u{1D567}",vprop:"\u221D",vrtri:"\u22B3",Vscr:"\u{1D4B1}",vscr:"\u{1D4CB}",vsubnE:"\u2ACB\uFE00",vsubne:"\u228A\uFE00",vsupnE:"\u2ACC\uFE00",vsupne:"\u228B\uFE00",Vvdash:"\u22AA",vzigzag:"\u299A",Wcirc:"\u0174",wcirc:"\u0175",wedbar:"\u2A5F",Wedge:"\u22C0",wedge:"\u2227",wedgeq:"\u2259",weierp:"\u2118",Wfr:"\u{1D51A}",wfr:"\u{1D534}",Wopf:"\u{1D54E}",wopf:"\u{1D568}",wp:"\u2118",wr:"\u2240",wreath:"\u2240",Wscr:"\u{1D4B2}",wscr:"\u{1D4CC}",xcap:"\u22C2",xcirc:"\u25EF",xcup:"\u22C3",xdtri:"\u25BD",Xfr:"\u{1D51B}",xfr:"\u{1D535}",xhArr:"\u27FA",xharr:"\u27F7",Xi:"\u039E",xi:"\u03BE",xlArr:"\u27F8",xlarr:"\u27F5",xmap:"\u27FC",xnis:"\u22FB",xodot:"\u2A00",Xopf:"\u{1D54F}",xopf:"\u{1D569}",xoplus:"\u2A01",xotime:"\u2A02",xrArr:"\u27F9",xrarr:"\u27F6",Xscr:"\u{1D4B3}",xscr:"\u{1D4CD}",xsqcup:"\u2A06",xuplus:"\u2A04",xutri:"\u25B3",xvee:"\u22C1",xwedge:"\u22C0",Yacute:"\xDD",yacute:"\xFD",YAcy:"\u042F",yacy:"\u044F",Ycirc:"\u0176",ycirc:"\u0177",Ycy:"\u042B",ycy:"\u044B",yen:"\xA5",Yfr:"\u{1D51C}",yfr:"\u{1D536}",YIcy:"\u0407",yicy:"\u0457",Yopf:"\u{1D550}",yopf:"\u{1D56A}",Yscr:"\u{1D4B4}",yscr:"\u{1D4CE}",YUcy:"\u042E",yucy:"\u044E",Yuml:"\u0178",yuml:"\xFF",Zacute:"\u0179",zacute:"\u017A",Zcaron:"\u017D",zcaron:"\u017E",Zcy:"\u0417",zcy:"\u0437",Zdot:"\u017B",zdot:"\u017C",zeetrf:"\u2128",ZeroWidthSpace:"\u200B",Zeta:"\u0396",zeta:"\u03B6",Zfr:"\u2128",zfr:"\u{1D537}",ZHcy:"\u0416",zhcy:"\u0436",zigrarr:"\u21DD",Zopf:"\u2124",zopf:"\u{1D56B}",Zscr:"\u{1D4B5}",zscr:"\u{1D4CF}",zwj:"\u200D",zwnj:"\u200C"}),a.entityMap=a.HTML_ENTITIES},8978:(i,a,o)=>{var l=o(4722);a.DOMImplementation=l.DOMImplementation,a.XMLSerializer=l.XMLSerializer,a.DOMParser=o(5752).DOMParser},4466:(i,a,o)=>{var l=o(4582).NAMESPACE,s=/[A-Z_a-z\xC0-\xD6\xD8-\xF6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD]/,c=new RegExp("[\\-\\.0-9"+s.source.slice(1,-1)+"\\u00B7\\u0300-\\u036F\\u203F-\\u2040]"),u=new RegExp("^"+s.source+c.source+"*(?::"+s.source+c.source+"*)?$");function p(w,C){this.message=w,this.locator=C,Error.captureStackTrace&&Error.captureStackTrace(this,p)}function f(){}function d(w,C){return C.lineNumber=w.lineNumber,C.columnNumber=w.columnNumber,C}function g(w,C,y,S,D,R){function M(X,se,Z){y.attributeNames.hasOwnProperty(X)&&R.fatalError("Attribute "+X+" redefined"),y.addValue(X,se.replace(/[\t\n\r]/g," ").replace(/&#?\w+;/g,D),Z)}for(var I,q=++C,U=0;;){var H=w.charAt(q);switch(H){case"=":if(U===1)I=w.slice(C,q),U=3;else{if(U!==2)throw new Error("attribute equal must after attrName");U=3}break;case"'":case'"':if(U===3||U===1){if(U===1&&(R.warning('attribute value must after "="'),I=w.slice(C,q)),C=q+1,!((q=w.indexOf(H,C))>0))throw new Error("attribute value no end '"+H+"' match");M(I,W=w.slice(C,q),C-1),U=5}else{if(U!=4)throw new Error('attribute value must after "="');M(I,W=w.slice(C,q),C),R.warning('attribute "'+I+'" missed start quot('+H+")!!"),C=q+1,U=5}break;case"/":switch(U){case 0:y.setTagName(w.slice(C,q));case 5:case 6:case 7:U=7,y.closed=!0;case 4:case 1:break;case 2:y.closed=!0;break;default:throw new Error("attribute invalid close char('/')")}break;case"":return R.error("unexpected end of input"),U==0&&y.setTagName(w.slice(C,q)),q;case">":switch(U){case 0:y.setTagName(w.slice(C,q));case 5:case 6:case 7:break;case 4:case 1:(W=w.slice(C,q)).slice(-1)==="/"&&(y.closed=!0,W=W.slice(0,-1));case 2:U===2&&(W=I),U==4?(R.warning('attribute "'+W+'" missed quot(")!'),M(I,W,C)):(l.isHTML(S[""])&&W.match(/^(?:disabled|checked|selected)$/i)||R.warning('attribute "'+W+'" missed value!! "'+W+'" instead!!'),M(W,W,C));break;case 3:throw new Error("attribute value missed!!")}return q;case"\x80":H=" ";default:if(H<=" ")switch(U){case 0:y.setTagName(w.slice(C,q)),U=6;break;case 1:I=w.slice(C,q),U=2;break;case 4:var W=w.slice(C,q);R.warning('attribute "'+W+'" missed quot(")!!'),M(I,W,C);case 5:U=6}else switch(U){case 2:y.tagName,l.isHTML(S[""])&&I.match(/^(?:disabled|checked|selected)$/i)||R.warning('attribute "'+I+'" missed value!! "'+I+'" instead2!!'),M(I,I,C),C=q,U=1;break;case 5:R.warning('attribute space is required"'+I+'"!!');case 6:U=1,C=q;break;case 3:U=4,C=q;break;case 7:throw new Error("elements closed character '/' and '>' must be connected to")}}q++}}function m(w,C,y){for(var S=w.tagName,D=null,R=w.length;R--;){var M=w[R],I=M.qName,q=M.value;if((X=I.indexOf(":"))>0)var U=M.prefix=I.slice(0,X),H=I.slice(X+1),W=U==="xmlns"&&H;else H=I,U=null,W=I==="xmlns"&&"";M.localName=H,W!==!1&&(D==null&&(D={},_(y,y={})),y[W]=D[W]=q,M.uri=l.XMLNS,C.startPrefixMapping(W,q))}for(R=w.length;R--;)(U=(M=w[R]).prefix)&&(U==="xml"&&(M.uri=l.XML),U!=="xmlns"&&(M.uri=y[U||""]));var X;(X=S.indexOf(":"))>0?(U=w.prefix=S.slice(0,X),H=w.localName=S.slice(X+1)):(U=null,H=w.localName=S);var se=w.uri=y[U||""];if(C.startElement(se,H,S,w),!w.closed)return w.currentNSMap=y,w.localNSMap=D,!0;if(C.endElement(se,H,S),D)for(U in D)Object.prototype.hasOwnProperty.call(D,U)&&C.endPrefixMapping(U)}function h(w,C,y,S,D){if(/^(?:script|textarea)$/i.test(y)){var R=w.indexOf("</"+y+">",C),M=w.substring(C+1,R);if(/[&<]/.test(M))return/^script$/i.test(y)?(D.characters(M,0,M.length),R):(M=M.replace(/&#?\w+;/g,S),D.characters(M,0,M.length),R)}return C+1}function b(w,C,y,S){var D=S[y];return D==null&&((D=w.lastIndexOf("</"+y+">"))<C&&(D=w.lastIndexOf("</"+y)),S[y]=D),D<C}function _(w,C){for(var y in w)Object.prototype.hasOwnProperty.call(w,y)&&(C[y]=w[y])}function N(w,C,y,S){if(w.charAt(C+2)==="-")return w.charAt(C+3)==="-"?(D=w.indexOf("-->",C+4))>C?(y.comment(w,C+4,D-C-4),D+3):(S.error("Unclosed comment"),-1):-1;if(w.substr(C+3,6)=="CDATA["){var D=w.indexOf("]]>",C+9);return y.startCDATA(),y.characters(w,C+9,D-C-9),y.endCDATA(),D+3}var R=function(W,X){var se,Z=[],pe=/'[^']+'|"[^"]+"|[^\s<>\/=]+=?|(\/?\s*>|<)/g;for(pe.lastIndex=X,pe.exec(W);se=pe.exec(W);)if(Z.push(se),se[1])return Z}(w,C),M=R.length;if(M>1&&/!doctype/i.test(R[0][0])){var I=R[1][0],q=!1,U=!1;M>3&&(/^public$/i.test(R[2][0])?(q=R[3][0],U=M>4&&R[4][0]):/^system$/i.test(R[2][0])&&(U=R[3][0]));var H=R[M-1];return y.startDTD(I,q,U),y.endDTD(),H.index+H[0].length}return-1}function k(w,C,y){var S=w.indexOf("?>",C);if(S){var D=w.substring(C,S).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);return D?(D[0].length,y.processingInstruction(D[1],D[2]),S+2):-1}return-1}function O(){this.attributeNames={}}p.prototype=new Error,p.prototype.name=p.name,f.prototype={parse:function(w,C,y){var S=this.domBuilder;S.startDocument(),_(C,C={}),function(D,R,M,I,q){function U(ve){var Pe=ve.slice(1,-1);return Object.hasOwnProperty.call(M,Pe)?M[Pe]:Pe.charAt(0)==="#"?function(zt){if(zt>65535){var Lr=55296+((zt-=65536)>>10),Gn=56320+(1023&zt);return String.fromCharCode(Lr,Gn)}return String.fromCharCode(zt)}(parseInt(Pe.substr(1).replace("x","0x"))):(q.error("entity not found:"+ve),ve)}function H(ve){if(ve>ye){var Pe=D.substring(ye,ve).replace(/&#?\w+;/g,U);pe&&W(ye),I.characters(Pe,0,ve-ye),ye=ve}}function W(ve,Pe){for(;ve>=se&&(Pe=Z.exec(D));)X=Pe.index,se=X+Pe[0].length,pe.lineNumber++;pe.columnNumber=ve-X+1}for(var X=0,se=0,Z=/.*(?:\r\n?|\n)|.*$/g,pe=I.locator,ie=[{currentNSMap:R}],ce={},ye=0;;){try{var xe=D.indexOf("<",ye);if(xe<0){if(!D.substr(ye).match(/^\s*$/)){var E=I.doc,x=E.createTextNode(D.substr(ye));E.appendChild(x),I.currentElement=x}return}switch(xe>ye&&H(xe),D.charAt(xe+1)){case"/":var F=D.indexOf(">",xe+3),A=D.substring(xe+2,F).replace(/[ \t\n\r]+$/g,""),L=ie.pop();F<0?(A=D.substring(xe+2).replace(/[\s<].*/,""),q.error("end tag name: "+A+" is not complete:"+L.tagName),F=xe+1+A.length):A.match(/\s</)&&(A=A.replace(/[\s<].*/,""),q.error("end tag name: "+A+" maybe not complete"),F=xe+1+A.length);var j=L.localNSMap,z=L.tagName==A;if(z||L.tagName&&L.tagName.toLowerCase()==A.toLowerCase()){if(I.endElement(L.uri,L.localName,A),j)for(var V in j)Object.prototype.hasOwnProperty.call(j,V)&&I.endPrefixMapping(V);z||q.fatalError("end tag name: "+A+" is not match the current start tagName:"+L.tagName)}else ie.push(L);F++;break;case"?":pe&&W(xe),F=k(D,xe,I);break;case"!":pe&&W(xe),F=N(D,xe,I,q);break;default:pe&&W(xe);var G=new O,de=ie[ie.length-1].currentNSMap,fe=(F=g(D,xe,G,de,U,q),G.length);if(!G.closed&&b(D,F,G.tagName,ce)&&(G.closed=!0,M.nbsp||q.warning("unclosed xml attribute")),pe&&fe){for(var we=d(pe,{}),ft=0;ft<fe;ft++){var Vt=G[ft];W(Vt.offset),Vt.locator=d(pe,{})}I.locator=we,m(G,I,de)&&ie.push(G),I.locator=pe}else m(G,I,de)&&ie.push(G);l.isHTML(G.uri)&&!G.closed?F=h(D,F,G.tagName,U,I):F++}}catch(ve){if(ve instanceof p)throw ve;q.error("element parse error: "+ve),F=-1}F>ye?ye=F:H(Math.max(xe,ye)+1)}}(w,C,y,S,this.errorHandler),S.endDocument()}},O.prototype={setTagName:function(w){if(!u.test(w))throw new Error("invalid tagName:"+w);this.tagName=w},addValue:function(w,C,y){if(!u.test(w))throw new Error("invalid attribute:"+w);this.attributeNames[w]=this.length,this[this.length++]={qName:w,value:C,offset:y}},length:0,getLocalName:function(w){return this[w].localName},getLocator:function(w){return this[w].locator},getQName:function(w){return this[w].qName},getURI:function(w){return this[w].uri},getValue:function(w){return this[w].value}},a.XMLReader=f,a.ParseError=p},8917:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.InvalidNumberOfChildrenError=void 0;var l=o(6200);Object.defineProperty(a,"InvalidNumberOfChildrenError",{enumerable:!0,get:function(){return l.InvalidNumberOfChildrenError}})},6200:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.InvalidNumberOfChildrenError=void 0;class o extends Error{constructor(s,c,u,p="exactly"){super(`${s} tag must have ${p} ${c} children. It's actually ${u}`),this.name="InvalidNumberOfChildrenError"}}a.InvalidNumberOfChildrenError=o},4279:function(i,a,o){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,u,p,f){f===void 0&&(f=p);var d=Object.getOwnPropertyDescriptor(u,p);d&&!("get"in d?!u.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return u[p]}}),Object.defineProperty(c,f,d)}:function(c,u,p,f){f===void 0&&(f=p),c[f]=u[p]}),s=this&&this.__exportStar||function(c,u){for(var p in c)p==="default"||Object.prototype.hasOwnProperty.call(u,p)||l(u,c,p)};Object.defineProperty(a,"__esModule",{value:!0}),s(o(828),a),s(o(5975),a),s(o(799),a),s(o(2424),a)},5975:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.JoinWithManySeparators=void 0;class o{constructor(s){this._separators=s}static join(s,c,u=""){let p=c.length>0?c:u!==void 0?[u]:[];return new o(p)._join(s)}_join(s){return s.reduce((c,u,p,f)=>c+u+(p===f.length-1?"":this._get(p)),"")}_get(s){return this._separators[s]?this._separators[s]:this._separators[this._separators.length-1]}}a.JoinWithManySeparators=o},799:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.mathMLElementToLaTeXConverter=void 0;let l=o(5443);a.mathMLElementToLaTeXConverter=s=>new l.MathMLElementToLatexConverterAdapter(s).toLatexConverter()},2424:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.normalizeWhiteSpaces=void 0,a.normalizeWhiteSpaces=o=>o.replace(/\s+/g," ")},7192:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.BracketWrapper=void 0;let l=o(1855);a.BracketWrapper=class{constructor(){this._open="{",this._close="}"}wrap(s){return new l.Wrapper(this._open,this._close).wrap(s)}}},5025:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.GenericWrapper=void 0;let l=o(1855);a.GenericWrapper=class{constructor(s,c){this._open="\\left"+s,this._close="\\right"+c}wrap(s){return new l.Wrapper(this._open,this._close).wrap(s)}}},828:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.GenericWrapper=a.ParenthesisWrapper=a.BracketWrapper=void 0;var l=o(7192);Object.defineProperty(a,"BracketWrapper",{enumerable:!0,get:function(){return l.BracketWrapper}});var s=o(1168);Object.defineProperty(a,"ParenthesisWrapper",{enumerable:!0,get:function(){return s.ParenthesisWrapper}});var c=o(5025);Object.defineProperty(a,"GenericWrapper",{enumerable:!0,get:function(){return c.GenericWrapper}})},1168:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ParenthesisWrapper=void 0;let l=o(1855);a.ParenthesisWrapper=class{constructor(){this._open="\\left(",this._close="\\right)"}wrap(s){return new l.Wrapper(this._open,this._close).wrap(s)}wrapIfMoreThanOneChar(s){return s.length<=1?s:this.wrap(s)}}},1855:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Wrapper=void 0,a.Wrapper=class{constructor(o,l){this._open=o,this._close=l}wrap(o){return this._open+o+this._close}}},2697:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.VoidMathMLElement=void 0,a.VoidMathMLElement=class{constructor(){this.name="void",this.value="",this.children=[],this.attributes={}}}},4760:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.GenericSpacingWrapper=void 0;let l=o(4279);a.GenericSpacingWrapper=class{constructor(s){this._mathmlElement=s}convert(){return this._mathmlElement.children.map(s=>(0,l.mathMLElementToLaTeXConverter)(s)).map(s=>s.convert()).join(" ")}}},9376:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.GenericUnderOver=void 0;let l=o(799),s=o(8917),c=o(472);a.GenericUnderOver=class{constructor(f){this._mathmlElement=f}convert(){let{name:f,children:d}=this._mathmlElement,g=d.length;if(g!==2)throw new s.InvalidNumberOfChildrenError(f,2,g);let m=(0,l.mathMLElementToLaTeXConverter)(d[0]).convert(),h=(0,l.mathMLElementToLaTeXConverter)(d[1]).convert();return this._applyCommand(m,h)}_applyCommand(f,d){let g=this._mathmlElement.name.match(/under/)?p.Under:p.Over;return new u(g).apply(f,d)}};class u{constructor(d){this._type=d}apply(d,g){return c.latexAccents.includes(g)?`${g}{${d}}`:`${this._defaultCommand}{${g}}{${d}}`}get _defaultCommand(){return this._type===p.Under?"\\underset":"\\overset"}}var p;(function(f){f[f.Under=0]="Under",f[f.Over=1]="Over"})(p||(p={}))},6959:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Void=a.MSpace=a.MRow=a.GenericUnderOver=a.GenericSpacingWrapper=a.MTr=a.MTable=a.MUnderover=a.MText=a.MMultiscripts=a.MSubsup=a.MSub=a.MSup=a.MPhantom=a.MError=a.MEnclose=a.MAction=a.MRoot=a.MFrac=a.MFenced=a.MSqrt=a.MN=a.MO=a.MI=a.Math=void 0;var l=o(393);Object.defineProperty(a,"Math",{enumerable:!0,get:function(){return l.Math}});var s=o(7037);Object.defineProperty(a,"MI",{enumerable:!0,get:function(){return s.MI}});var c=o(3487);Object.defineProperty(a,"MO",{enumerable:!0,get:function(){return c.MO}});var u=o(4464);Object.defineProperty(a,"MN",{enumerable:!0,get:function(){return u.MN}});var p=o(8686);Object.defineProperty(a,"MSqrt",{enumerable:!0,get:function(){return p.MSqrt}});var f=o(9511);Object.defineProperty(a,"MFenced",{enumerable:!0,get:function(){return f.MFenced}});var d=o(6440);Object.defineProperty(a,"MFrac",{enumerable:!0,get:function(){return d.MFrac}});var g=o(6052);Object.defineProperty(a,"MRoot",{enumerable:!0,get:function(){return g.MRoot}});var m=o(1678);Object.defineProperty(a,"MAction",{enumerable:!0,get:function(){return m.MAction}});var h=o(2631);Object.defineProperty(a,"MEnclose",{enumerable:!0,get:function(){return h.MEnclose}});var b=o(1840);Object.defineProperty(a,"MError",{enumerable:!0,get:function(){return b.MError}});var _=o(7443);Object.defineProperty(a,"MPhantom",{enumerable:!0,get:function(){return _.MPhantom}});var N=o(6926);Object.defineProperty(a,"MSup",{enumerable:!0,get:function(){return N.MSup}});var k=o(2564);Object.defineProperty(a,"MSub",{enumerable:!0,get:function(){return k.MSub}});var O=o(1358);Object.defineProperty(a,"MSubsup",{enumerable:!0,get:function(){return O.MSubsup}});var w=o(8303);Object.defineProperty(a,"MMultiscripts",{enumerable:!0,get:function(){return w.MMultiscripts}});var C=o(3951);Object.defineProperty(a,"MText",{enumerable:!0,get:function(){return C.MText}});var y=o(1222);Object.defineProperty(a,"MUnderover",{enumerable:!0,get:function(){return y.MUnderover}});var S=o(2350);Object.defineProperty(a,"MTable",{enumerable:!0,get:function(){return S.MTable}});var D=o(1586);Object.defineProperty(a,"MTr",{enumerable:!0,get:function(){return D.MTr}});var R=o(4760);Object.defineProperty(a,"GenericSpacingWrapper",{enumerable:!0,get:function(){return R.GenericSpacingWrapper}});var M=o(9376);Object.defineProperty(a,"GenericUnderOver",{enumerable:!0,get:function(){return M.GenericUnderOver}});var I=o(6346);Object.defineProperty(a,"MRow",{enumerable:!0,get:function(){return I.MRow}});var q=o(3700);Object.defineProperty(a,"MSpace",{enumerable:!0,get:function(){return q.MSpace}});var U=o(9165);Object.defineProperty(a,"Void",{enumerable:!0,get:function(){return U.Void}})},1678:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MAction=void 0;let l=o(799);a.MAction=class{constructor(s){this._mathmlElement=s}convert(){let{children:s}=this._mathmlElement;return this._isToggle()?s.map(c=>(0,l.mathMLElementToLaTeXConverter)(c)).map(c=>c.convert()).join(" \\Longrightarrow "):(0,l.mathMLElementToLaTeXConverter)(s[0]).convert()}_isToggle(){let{actiontype:s}=this._mathmlElement.attributes;return s==="toggle"||!s}}},393:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Math=void 0;let l=o(799),s=o(2424);a.Math=class{constructor(c){this._mathmlElement=c}convert(){let c=this._mathmlElement.children.map(u=>(0,l.mathMLElementToLaTeXConverter)(u)).map(u=>u.convert()).join(" ");return(0,s.normalizeWhiteSpaces)(c)}}},2631:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MEnclose=void 0;let l=o(799);a.MEnclose=class{constructor(s){this._mathmlElement=s}convert(){let s=this._mathmlElement.children.map(c=>(0,l.mathMLElementToLaTeXConverter)(c)).map(c=>c.convert()).join(" ");return this._notation==="actuarial"?`\\overline{\\left.${s}\\right|}`:this._notation==="radical"?`\\sqrt{${s}}`:["box","roundedbox","circle"].includes(this._notation)?`\\boxed{${s}}`:this._notation==="left"?`\\left|${s}`:this._notation==="right"?`${s}\\right|`:this._notation==="top"?`\\overline{${s}}`:this._notation==="bottom"?`\\underline{${s}}`:this._notation==="updiagonalstrike"?`\\cancel{${s}}`:this._notation==="downdiagonalstrike"?`\\bcancel{${s}}`:this._notation==="updiagonalarrow"?`\\cancelto{}{${s}}`:["verticalstrike","horizontalstrike"].includes(this._notation)?`\\hcancel{${s}}`:this._notation==="madruwb"?`\\underline{${s}\\right|}`:this._notation==="phasorangle"?`{\\angle \\underline{${s}}}`:`\\overline{\\left.\\right)${s}}`}get _notation(){return this._mathmlElement.attributes.notation||"longdiv"}}},1840:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MError=void 0;let l=o(799);a.MError=class{constructor(s){this._mathmlElement=s}convert(){return`\\color{red}{${this._mathmlElement.children.map(s=>(0,l.mathMLElementToLaTeXConverter)(s)).map(s=>s.convert()).join(" ")}}`}}},9511:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MFenced=void 0;let l=o(799),s=o(4279);a.MFenced=class{constructor(f){this._mathmlElement=f,this.open=this._mathmlElement.attributes.open||"",this.close=this._mathmlElement.attributes.close||""}convert(){let f=this._mathmlElement.children.map(b=>(0,l.mathMLElementToLaTeXConverter)(b)).map(b=>b.convert());if(this._isThereRelativeOfName(this._mathmlElement.children,"mtable"))return new u(this.open,this.close).apply(f);let d=this._mathmlElement.attributes.separators,g=d!==void 0,m=d?Array.from(d):[],h=g?"":",";return new c(this.open,this.close,m,h).apply(f)}_isThereRelativeOfName(f,d){return f.some(g=>g.name===d||this._isThereRelativeOfName(g.children,d))}};class c{constructor(d,g,m,h){this.separators=m,this.defaultSeparator=h,this.open=d||"(",this.close=g||")"}apply(d){let g=s.JoinWithManySeparators.join(d,this.separators,this.defaultSeparator);return new s.GenericWrapper(this.open,this.close).wrap(g)}}class u{constructor(d,g){this._genericCommand="matrix",this.separators=new p(d,g)}apply(d){let g=this._command,m=`\\begin{${g}}
${d.join("")}
\\end{${g}}`;return g===this._genericCommand?this.separators.wrap(m):m}get _command(){return this.separators.areParentheses()?"pmatrix":this.separators.areSquareBrackets()?"bmatrix":this.separators.areBrackets()?"Bmatrix":this.separators.areDivides()?"vmatrix":this.separators.areParallels()?"Vmatrix":this.separators.areNotEqual()?this._genericCommand:"bmatrix"}}class p{constructor(d,g){this.open=d,this.close=g}wrap(d){return new s.GenericWrapper(this.open,this.close).wrap(d)}areParentheses(){return this._compare("(",")")}areSquareBrackets(){return this._compare("[","]")}areBrackets(){return this._compare("{","}")}areDivides(){return this._compare("|","|")}areParallels(){return this._compare("||","||")}areNotEqual(){return this.open!==this.close}_compare(d,g){return this.open===d&&this.close===g}}},6440:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MFrac=void 0;let l=o(8917),s=o(4279);a.MFrac=class{constructor(c){this._mathmlElement=c}convert(){let{children:c,name:u}=this._mathmlElement,p=c.length;if(p!==2)throw new l.InvalidNumberOfChildrenError(u,2,p);let f=(0,s.mathMLElementToLaTeXConverter)(c[0]).convert(),d=(0,s.mathMLElementToLaTeXConverter)(c[1]).convert();return this._isBevelled()?`${this._wrapIfMoreThanOneChar(f)}/${this._wrapIfMoreThanOneChar(d)}`:`\\frac{${f}}{${d}}`}_wrapIfMoreThanOneChar(c){return new s.ParenthesisWrapper().wrapIfMoreThanOneChar(c)}_isBevelled(){return!!this._mathmlElement.attributes.bevelled}}},7037:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MI=void 0;let l=o(4279),s=o(5406),c=o(6122);a.MI=class{constructor(p){this.utf8Converter=new c.HashUTF8ToLtXConverter,this._mathmlElement=p}convert(){let p=(0,l.normalizeWhiteSpaces)(this._mathmlElement.value);if(p===" ")return u.apply(p);let f=p.trim(),d=u.apply(f),g=this.utf8Converter.convert(d);return g!==d?g:this.wrapInMathVariant(d,this.getMathVariant(this._mathmlElement.attributes))}getMathVariant(p){if(p&&p.mathvariant)return p.mathvariant}wrapInMathVariant(p,f){switch(f){case"bold":return`\\mathbf{${p}}`;case"italic":return`\\mathit{${p}}`;case"bold-italic":return`\\mathbf{\\mathit{${p}}}`;case"double-struck":return`\\mathbb{${p}}`;case"bold-fraktur":return`\\mathbf{\\mathfrak{${p}}}`;case"script":return`\\mathcal{${p}}`;case"bold-script":return`\\mathbf{\\mathcal{${p}}}`;case"fraktur":return`\\mathfrak{${p}}`;case"sans-serif":return`\\mathsf{${p}}`;case"bold-sans-serif":return`\\mathbf{\\mathsf{${p}}}`;case"sans-serif-italic":return`\\mathsf{\\mathit{${p}}}`;case"sans-serif-bold-italic":return`\\mathbf{\\mathsf{\\mathit{${p}}}}`;case"monospace":return`\\mathtt{${p}}`;default:return p}}};class u{constructor(f){this._value=f}static apply(f){return new u(f)._apply()}_apply(){return this._findByCharacter()||this._findByGlyph()||this._findByNumber()||new c.HashUTF8ToLtXConverter().convert(this._value)}_findByCharacter(){return s.allMathSymbolsByChar[this._value]}_findByGlyph(){return s.allMathSymbolsByGlyph[this._value]}_findByNumber(){return s.mathNumberByGlyph[this._value]}}},8303:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MMultiscripts=void 0;let l=o(4279),s=o(8917);a.MMultiscripts=class{constructor(c){this._mathmlElement=c}convert(){let{name:c,children:u}=this._mathmlElement,p=u.length;if(p<3)throw new s.InvalidNumberOfChildrenError(c,3,p,"at least");let f=(0,l.mathMLElementToLaTeXConverter)(u[0]).convert();return this._prescriptLatex()+this._wrapInParenthesisIfThereIsSpace(f)+this._postscriptLatex()}_prescriptLatex(){let{children:c}=this._mathmlElement,u,p;if(this._isPrescripts(c[1]))u=c[2],p=c[3];else{if(!this._isPrescripts(c[3]))return"";u=c[4],p=c[5]}return`\\_{${(0,l.mathMLElementToLaTeXConverter)(u).convert()}}^{${(0,l.mathMLElementToLaTeXConverter)(p).convert()}}`}_postscriptLatex(){let{children:c}=this._mathmlElement;if(this._isPrescripts(c[1]))return"";let u=c[1],p=c[2];return`_{${(0,l.mathMLElementToLaTeXConverter)(u).convert()}}^{${(0,l.mathMLElementToLaTeXConverter)(p).convert()}}`}_wrapInParenthesisIfThereIsSpace(c){return c.match(/\s+/g)?new l.ParenthesisWrapper().wrap(c):c}_isPrescripts(c){return(c==null?void 0:c.name)==="mprescripts"}}},4464:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MN=void 0;let l=o(4279),s=o(5406);a.MN=class{constructor(c){this._mathmlElement=c}convert(){let c=(0,l.normalizeWhiteSpaces)(this._mathmlElement.value).trim();return s.mathNumberByGlyph[c]||c}}},3487:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MO=void 0;let l=o(4279),s=o(5406);a.MO=class{constructor(u){this._mathmlElement=u}convert(){let u=(0,l.normalizeWhiteSpaces)(this._mathmlElement.value).trim();return c.operate(u)}};class c{constructor(p){this._value=p}static operate(p){return new c(p)._operate()}_operate(){return this._findByCharacter()||this._findByGlyph()||this._findByNumber()||new s.HashUTF8ToLtXConverter().convert(this._value)}_findByCharacter(){return s.allMathOperatorsByChar[this._value]}_findByGlyph(){return s.allMathOperatorsByGlyph[this._value]}_findByNumber(){return s.mathNumberByGlyph[this._value]}}},7443:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MPhantom=void 0,a.MPhantom=class{constructor(o){this._mathmlElement=o}convert(){return""}}},6052:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MRoot=void 0;let l=o(4279),s=o(8917);a.MRoot=class{constructor(c){this._mathmlElement=c}convert(){let{name:c,children:u}=this._mathmlElement,p=u.length;if(p!==2)throw new s.InvalidNumberOfChildrenError(c,2,p);let f=(0,l.mathMLElementToLaTeXConverter)(u[0]).convert();return`\\sqrt[${(0,l.mathMLElementToLaTeXConverter)(u[1]).convert()}]{${f}}`}}},6346:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MRow=void 0;let l=o(4279);a.MRow=class{constructor(s){this._mathmlElement=s}convert(){return this._isLinearSystemPattern()?this._convertAsLinearSystem():this._mathmlElement.children.map(s=>(0,l.mathMLElementToLaTeXConverter)(s)).map(s=>s.convert()).join(" ")}_isLinearSystemPattern(){let{children:s}=this._mathmlElement;if(s.length!==3)return!1;let c=s[0],u=c.name==="mo"&&c.value.trim()==="{",p=s[1].name==="mtable",f=s[2],d=f.name==="mo"&&f.value.trim()==="";return u&&p&&d}_convertAsLinearSystem(){return`\\begin{cases} ${this._mathmlElement.children[1].children.map(s=>(0,l.mathMLElementToLaTeXConverter)(s)).map(s=>s.convert()).join(" \\\\ ")} \\end{cases}`}}},3700:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MSpace=void 0,a.MSpace=class{constructor(o){this._mathmlElement=o}convert(){let{linebreak:o}=this._mathmlElement.attributes;return o==="newline"?" \\\\ ":" "}}},8686:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MSqrt=void 0;let l=o(4279);a.MSqrt=class{constructor(s){this._mathmlElement=s}convert(){return`\\sqrt{${this._mathmlElement.children.map(s=>(0,l.mathMLElementToLaTeXConverter)(s)).map(s=>s.convert()).join(" ")}}`}}},2564:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MSub=void 0;let l=o(4279),s=o(8917);a.MSub=class{constructor(c){this._mathmlElement=c}convert(){let{name:c,children:u}=this._mathmlElement,p=u.length;if(p!==2)throw new s.InvalidNumberOfChildrenError(c,2,p);let f=u[0],d=u[1];return`${this._handleBaseChild(f)}_${this._handleSubscriptChild(d)}`}_handleBaseChild(c){let u=c.children,p=(0,l.mathMLElementToLaTeXConverter)(c).convert();return u.length<=1?p:new l.ParenthesisWrapper().wrapIfMoreThanOneChar(p)}_handleSubscriptChild(c){let u=(0,l.mathMLElementToLaTeXConverter)(c).convert();return new l.BracketWrapper().wrap(u)}}},1358:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MSubsup=void 0;let l=o(4279),s=o(8917);a.MSubsup=class{constructor(c){this._mathmlElement=c}convert(){let{name:c,children:u}=this._mathmlElement,p=u.length;if(p!==3)throw new s.InvalidNumberOfChildrenError(c,3,p);let f=u[0],d=u[1],g=u[2];return`${this._handleBaseChild(f)}_${this._handleSubscriptChild(d)}^${this._handleSuperscriptChild(g)}`}_handleBaseChild(c){let u=c.children,p=(0,l.mathMLElementToLaTeXConverter)(c).convert();return u.length<=1?p:new l.ParenthesisWrapper().wrapIfMoreThanOneChar(p)}_handleSubscriptChild(c){let u=(0,l.mathMLElementToLaTeXConverter)(c).convert();return new l.BracketWrapper().wrap(u)}_handleSuperscriptChild(c){let u=(0,l.mathMLElementToLaTeXConverter)(c).convert();return new l.BracketWrapper().wrap(u)}}},6926:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MSup=void 0;let l=o(4279),s=o(8917);a.MSup=class{constructor(c){this._mathmlElement=c}convert(){let{name:c,children:u}=this._mathmlElement,p=u.length;if(p!==2)throw new s.InvalidNumberOfChildrenError(c,2,p);let f=u[0],d=u[1];return`${this._handleBaseChild(f)}^${this._handleExponentChild(d)}`}_handleBaseChild(c){let u=c.children,p=(0,l.mathMLElementToLaTeXConverter)(c).convert();return u.length<=1?p:new l.ParenthesisWrapper().wrapIfMoreThanOneChar(p)}_handleExponentChild(c){let u=(0,l.mathMLElementToLaTeXConverter)(c).convert();return new l.BracketWrapper().wrap(u)}}},2350:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MTable=void 0;let l=o(4279);a.MTable=class{constructor(s){this._mathmlElement=s,this._addFlagRecursiveIfName(this._mathmlElement.children,"mtable","innerTable")}convert(){let s=this._mathmlElement.children.map(c=>(0,l.mathMLElementToLaTeXConverter)(c)).map(c=>c.convert()).join(` \\\\
`);return this._hasFlag("innerTable")?this._wrap(s):s}_wrap(s){return`\\begin{matrix}${s}\\end{matrix}`}_addFlagRecursiveIfName(s,c,u){s.forEach(p=>{p.name===c&&(p.attributes[u]=u),this._addFlagRecursiveIfName(p.children,c,u)})}_hasFlag(s){return!!this._mathmlElement.attributes[s]}}},3951:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MText=void 0;let l=o(7037);a.MText=class{constructor(c){this._mathmlElement=c}convert(){let{attributes:c,value:u}=this._mathmlElement;return[...u].map(p=>/^[a-zA-Z0-9]$/.test(p)||p===" "?{value:p,isAlphanumeric:!0}:{value:p,isAlphanumeric:!1}).reduce((p,f)=>{if(f.isAlphanumeric){let d=p[p.length-1];if(d&&d.isAlphanumeric)return d.value+=f.value,p}return[...p,f]},[]).map(p=>p.isAlphanumeric?new s(c.mathvariant).apply(p.value):new l.MI({name:"mi",attributes:{},children:[],value:p.value}).convert()).join("")}};class s{constructor(u){this._mathvariant=u||"normal"}apply(u){return this._commands.reduce((p,f,d)=>d===0?`${f}{${u}}`:`${f}{${p}}`,"")}get _commands(){switch(this._mathvariant){case"bold":return["\\textbf"];case"italic":return["\\textit"];case"bold-italic":return["\\textit","\\textbf"];case"double-struck":return["\\mathbb"];case"monospace":return["\\mathtt"];case"bold-fraktur":case"fraktur":return["\\mathfrak"];default:return["\\text"]}}}},1586:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MTr=void 0;let l=o(4279);a.MTr=class{constructor(s){this._mathmlElement=s}convert(){return this._mathmlElement.children.map(s=>(0,l.mathMLElementToLaTeXConverter)(s)).map(s=>s.convert()).join(" & ")}}},1222:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MUnderover=void 0;let l=o(4279),s=o(8917);a.MUnderover=class{constructor(c){this._mathmlElement=c}convert(){let{name:c,children:u}=this._mathmlElement,p=u.length;if(p!==3)throw new s.InvalidNumberOfChildrenError(c,3,p);return`${(0,l.mathMLElementToLaTeXConverter)(u[0]).convert()}_{${(0,l.mathMLElementToLaTeXConverter)(u[1]).convert()}}^{${(0,l.mathMLElementToLaTeXConverter)(u[2]).convert()}}`}}},9165:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.Void=void 0,a.Void=class{constructor(o){this._mathmlElement=o}convert(){return""}}},5443:function(i,a,o){"use strict";var l=this&&this.__createBinding||(Object.create?function(d,g,m,h){h===void 0&&(h=m);var b=Object.getOwnPropertyDescriptor(g,m);b&&!("get"in b?!g.__esModule:b.writable||b.configurable)||(b={enumerable:!0,get:function(){return g[m]}}),Object.defineProperty(d,h,b)}:function(d,g,m,h){h===void 0&&(h=m),d[h]=g[m]}),s=this&&this.__setModuleDefault||(Object.create?function(d,g){Object.defineProperty(d,"default",{enumerable:!0,value:g})}:function(d,g){d.default=g}),c=this&&this.__importStar||function(d){if(d&&d.__esModule)return d;var g={};if(d!=null)for(var m in d)m!=="default"&&Object.prototype.hasOwnProperty.call(d,m)&&l(g,d,m);return s(g,d),g};Object.defineProperty(a,"__esModule",{value:!0}),a.MathMLElementToLatexConverterAdapter=void 0;let u=c(o(6959)),p=o(2697);a.MathMLElementToLatexConverterAdapter=class{constructor(d){this._mathMLElement=d!=null?d:new p.VoidMathMLElement}toLatexConverter(){let{name:d}=this._mathMLElement;return new(f[d]||u.GenericSpacingWrapper)(this._mathMLElement)}};let f={math:u.Math,mi:u.MI,mo:u.MO,mn:u.MN,msqrt:u.MSqrt,mfenced:u.MFenced,mfrac:u.MFrac,mroot:u.MRoot,maction:u.MAction,menclose:u.MEnclose,merror:u.MError,mphantom:u.MPhantom,msup:u.MSup,msub:u.MSub,msubsup:u.MSubsup,mmultiscripts:u.MMultiscripts,mtext:u.MText,munderover:u.MUnderover,mtable:u.MTable,mtr:u.MTr,mover:u.GenericUnderOver,munder:u.GenericUnderOver,mrow:u.MRow,mspace:u.MSpace,mpadded:u.GenericSpacingWrapper,void:u.Void}},5243:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ErrorHandler=void 0,a.ErrorHandler=class{constructor(){this._errors=[],this.errorLocator={}}fixError(o,l){return this._isMissingAttributeValueError(l)?(this._errors.push(l),this._fixMissingAttribute(l,o)):o}isThereAnyErrors(){return this._errors.length>0}cleanErrors(){this._errors=[]}_fixMissingAttribute(o,l){let s=o.split('"')[1];if(s)return l.replace(this._matchMissingValueForAttribute(s),"");for(;this._mathGenericMissingValue().exec(l);)l=l.replace(this._mathGenericMissingValue(),"$1$3");return l}_matchMissingValueForAttribute(o){return new RegExp(`(${o}=(?!("|')))|(${o}(?!("|')))`,"gm")}_mathGenericMissingValue(){return/(\<.* )(\w+=(?!\"|\'))(.*\>)/gm}_isMissingAttributeValueError(o){return!!o.includes("attribute")&&!!o.includes("missed")||o.includes("attribute value missed")}}},9208:function(i,a,o){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,u,p,f){f===void 0&&(f=p);var d=Object.getOwnPropertyDescriptor(u,p);d&&!("get"in d?!u.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return u[p]}}),Object.defineProperty(c,f,d)}:function(c,u,p,f){f===void 0&&(f=p),c[f]=u[p]}),s=this&&this.__exportStar||function(c,u){for(var p in c)p==="default"||Object.prototype.hasOwnProperty.call(u,p)||l(u,c,p)};Object.defineProperty(a,"__esModule",{value:!0}),s(o(9548),a),s(o(5243),a),s(o(1101),a)},1101:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.ElementsToMathMLAdapter=void 0,a.ElementsToMathMLAdapter=class{convert(o){return o.filter(l=>l.tagName!==void 0).map(l=>this._convertElement(l))}_convertElement(o){return{name:o.tagName,attributes:this._convertElementAttributes(o.attributes),value:this._hasElementChild(o)?"":o.textContent||"",children:this._hasElementChild(o)?this.convert(Array.from(o.childNodes)):[]}}_convertElementAttributes(o){return Array.from(o).reduce((l,s)=>Object.assign({[s.nodeName]:s.nodeValue===s.nodeName?"":s.nodeValue},l),{})}_hasElementChild(o){let l=o.childNodes;return!!l&&l.length!==0&&this._isThereAnyNoTextNode(l)}_isThereAnyNoTextNode(o){return Array.from(o).some(l=>l.nodeName!=="#text")}}},9548:function(i,a,o){"use strict";var l=this&&this.__importDefault||function(c){return c&&c.__esModule?c:{default:c}};Object.defineProperty(a,"__esModule",{value:!0}),a.XmlToMathMLAdapter=void 0;let s=l(o(8978));a.XmlToMathMLAdapter=class{constructor(c,u){this._xml="",this._elementsConvertor=c,this._errorHandler=u,this._xmlDOM=new s.default.DOMParser({locator:this._errorHandler.errorLocator,errorHandler:this._fixError.bind(this)})}convert(c){return this._xml=this._removeLineBreaks(c),this._xml=this._removeMsWordPrefixes(this._xml),this._elementsConvertor.convert(this._mathMLElements)}_fixError(c){this._xml=this._errorHandler.fixError(this._xml,c)}_removeLineBreaks(c){return c.replace(/\n|\r\n|\r/g,"")}_removeMsWordPrefixes(c){return c.replace(/mml:/g,"")}get _mathMLElements(){let c=this._xmlDOM.parseFromString(this._xml).getElementsByTagName("math");return this._errorHandler.isThereAnyErrors()&&(this._errorHandler.cleanErrors(),c=this._xmlDOM.parseFromString(this._xml).getElementsByTagName("math")),Array.from(c)}}},7941:function(i,a,o){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,u,p,f){f===void 0&&(f=p);var d=Object.getOwnPropertyDescriptor(u,p);d&&!("get"in d?!u.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return u[p]}}),Object.defineProperty(c,f,d)}:function(c,u,p,f){f===void 0&&(f=p),c[f]=u[p]}),s=this&&this.__exportStar||function(c,u){for(var p in c)p==="default"||Object.prototype.hasOwnProperty.call(u,p)||l(u,c,p)};Object.defineProperty(a,"__esModule",{value:!0}),s(o(8585),a)},8585:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.makeToMathElementsConverter=void 0;let l=o(9208);a.makeToMathElementsConverter=()=>{let s=new l.ElementsToMathMLAdapter,c=new l.ErrorHandler;return new l.XmlToMathMLAdapter(s,c)}},8672:function(i,a,o){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,u,p,f){f===void 0&&(f=p);var d=Object.getOwnPropertyDescriptor(u,p);d&&!("get"in d?!u.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return u[p]}}),Object.defineProperty(c,f,d)}:function(c,u,p,f){f===void 0&&(f=p),c[f]=u[p]}),s=this&&this.__exportStar||function(c,u){for(var p in c)p==="default"||Object.prototype.hasOwnProperty.call(u,p)||l(u,c,p)};Object.defineProperty(a,"__esModule",{value:!0}),s(o(3798),a)},3798:(i,a,o)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.MathMLToLaTeX=void 0;let l=o(5443),s=o(7941);a.MathMLToLaTeX=class{static convert(c){return(0,s.makeToMathElementsConverter)().convert(c).map(u=>new l.MathMLElementToLatexConverterAdapter(u).toLatexConverter()).map(u=>u.convert()).join("").trim()}}},2965:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.allMathOperatorsByChar=void 0,a.allMathOperatorsByChar={_:"\\underline","&#x23E1;":"\\underbrace","&#x23E0;":"\\overbrace","&#x23DF;":"\\underbrace","&#x23DE;":"\\overbrace","&#x23DD;":"\\underbrace","&#x23DC;":"\\overbrace","&#x23B5;":"\\underbrace","&#x23B4;":"\\overbrace","&#x20DC;":"\\square","&#x20DB;":"\\square","&#x2064;":"","&#x2057;":"''''","&#x203E;":"\\bar","&#x2037;":"```","&#x2036;":"``","&#x2035;":"`","&#x2034;":"'''","&#x2033;":"''","&#x201F;":"``","&#x201E;":",,","&#x201B;":"`","&#x201A;":",","&#x302;":"\\hat","&#x2F7;":"\\sim","&#x2DD;":"\\sim","&#x2DC;":"\\sim","&#x2DA;":"\\circ","&#x2D9;":"\\cdot","&#x2D8;":"","&#x2CD;":"\\_","&#x2CB;":"\u02CB","&#x2CA;":"\u02CA","&#x2C9;":"\u02C9","&#x2C7;":"","&#x2C6;":"\\hat","&#xBA;":"o","&#xB9;":"1","&#xB8;":"\xB8","&#xB4;":"\xB4","&#xB3;":"3","&#xB2;":"2","&#xB0;":"\\circ","&#xAF;":"\\bar","&#xAA;":"a","&#xA8;":"\\cdot\\cdot","~":"\\sim","`":"`","^":"\\hat","--":"--","++":"++","&amp;":"\\&","&#x2061;":"","&#x221C;":"\\sqrt[4]{}","&#x221B;":"\\sqrt[3]{}","&#x221A;":"\\sqrt{}","&#x2146;":"d","&#x2145;":"\\mathbb{D}","?":"?","@":"@","//":"//","!!":"!!","!":"!","&#x266F;":"\\#","&#x266E;":"","&#x266D;":"","&#x2032;":"'","&lt;>":"<>","**":"\\star\\star","&#x2207;":"\\nabla","&#x2202;":"\\partial","&#x2299;":"\\bigodot","&#xAC;":"\\neg","&#x2222;":"\\measuredangle","&#x2221;":"\\measuredangle","&#x2220;":"\\angle","&#xF7;":"\\div","/":"/","&#x2216;":"\\backslash","\\":"\\backslash","%":"\\%","&#x2297;":"\\bigotimes","&#xB7;":"\\cdot","&#x2A3F;":"\\coprod","&#x2A2F;":"\\times","&#x22C5;":"\\cdot","&#x22A1;":"\\boxdot","&#x22A0;":"\\boxtimes","&#x2062;":"","&#x2043;":"-","&#x2022;":"\\cdot","&#xD7;":"\\times",".":".","*":"\\star","&#x222A;":"\\cup","&#x2229;":"\\cap","&#x2210;":"\\coprod","&#x220F;":"\\prod","&#x2240;":"","&#x2AFF;":"","&#x2AFC;":"\\mid\\mid\\mid","&#x2A09;":"\\times","&#x2A08;":"","&#x2A07;":"","&#x2A06;":"\\sqcup","&#x2A05;":"\\sqcap","&#x2A02;":"\\otimes","&#x2A00;":"\\odot","&#x22C2;":"\\cap","&#x22C1;":"\\vee","&#x22C0;":"\\wedge","&#x2A04;":"\\uplus","&#x2A03;":"\\cup","&#x22C3;":"\\cup","&#x2A1C;":"\\underline{\\int}","&#x2A1B;":"\\overline{\\int}","&#x2A1A;":"\\int","&#x2A19;":"\\int","&#x2A18;":"\\int","&#x2A17;":"\\int","&#x2A16;":"\\oint","&#x2A15;":"\\oint","&#x2A14;":"\\int","&#x2A13;":"\\int","&#x2A12;":"\\int","&#x2A11;":"\\int","&#x2A10;":"\\int","&#x2A0F;":"\\bcancel{\\int}","&#x2A0E;":"","&#x2A0D;":"\\hcancel{\\int}","&#x2A0C;":"\\iiiint","&#x2233;":"\\oint","&#x2232;":"\\oint","&#x2231;":"\\int","&#x2230;":"\\oiint","&#x222F;":"\\oiint","&#x222E;":"\\oint","&#x222B;":"\\int","&#x2A01;":"\\oplus","&#x2298;":"\\oslash","&#x2296;":"\\ominus","&#x2295;":"\\oplus","&#x222D;":"\\iiint","&#x222C;":"\\iint","&#x2A0B;":"","&#x2A0A;":"","&#x2211;":"\\sum","&#x229F;":"\\boxminus","&#x229E;":"\\boxplus","&#x2214;":"\\dot{+}","&#x2213;":"+-","&#x2212;":"-","&#xB1;":"\\pm","-":"-","+":"+","&#x2B46;":"\\Rrightarrow","&#x2B45;":"\\Lleftarrow","&#x29F4;":":\\rightarrow","&#x29EF;":"","&#x29DF;":"\\bullet-\\bullet","&#x299F;":"\\angle","&#x299E;":"\\measuredangle","&#x299D;":"\\measuredangle","&#x299C;":"\\perp","&#x299B;":"\\measuredangle","&#x299A;":"","&#x2999;":"\\vdots","&#x297F;":"","&#x297E;":"","&#x297D;":"\\prec","&#x297C;":"\\succ","&#x297B;":"\\underset{\\rightarrow}{\\supset}","&#x297A;":"","&#x2979;":"\\underset{\\rightarrow}{\\subset}","&#x2978;":"\\underset{\\rightarrow}{>}","&#x2977;":"","&#x2976;":"\\underset{\\leftarrow}{<}","&#x2975;":"\\underset{\\approx}{\\rightarrow}","&#x2974;":"\\underset{\\sim}{\\rightarrow}","&#x2973;":"\\underset{\\sim}{\\leftarrow}","&#x2972;":"\\overset{\\sim}{\\rightarrow}","&#x2971;":"\\overset{=}{\\rightarrow}","&#x2970;":"","&#x296F;":"","&#x296E;":"","&#x296D;":"\\overline{\\rightharpoondown}","&#x296C;":"\\underline{\\rightharpoonup}","&#x296B;":"\\overline{\\leftharpoondown}","&#x296A;":"\\underline{\\leftharpoonup}","&#x2969;":"\\rightleftharpoons","&#x2968;":"\\rightleftharpoons","&#x2967;":"\\rightleftharpoons","&#x2966;":"\\rightleftharpoons","&#x2965;":"\\Downarrow","&#x2964;":"\\Rightarrow","&#x2963;":"\\Uparrow","&#x2962;":"\\Leftarrow","&#x2961;":"\\downarrow","&#x2960;":"\\uparrow","&#x295F;":"\\rightarrow","&#x295E;":"\\leftarrow","&#x295D;":"\\downarrow","&#x295C;":"\\uparrow","&#x295B;":"\\rightarrow","&#x295A;":"\\leftarrow","&#x2959;":"\\downarrow","&#x2958;":"\\uparrow","&#x2957;":"\\rightarrow","&#x2956;":"\\leftarrow","&#x2955;":"\\downarrow","&#x2954;":"\\uparrow","&#x2953;":"\\rightarrow","&#x2952;":"\\leftarrow","&#x2951;":"\\updownarrow","&#x2950;":"\\leftrightarrow","&#x294F;":"\\updownarrow","&#x294E;":"\\leftrightarrow","&#x294D;":"\\updownarrow","&#x294C;":"\\updownarrow","&#x294B;":"\\leftrightarrow","&#x294A;":"\\leftrightarrow","&#x2949;":"","&#x2948;":"\\leftrightarrow","&#x2947;":"\\nrightarrow","&#x2946;":"","&#x2945;":"","&#x2944;":"\\rightleftarrows","&#x2943;":"\\leftrightarrows","&#x2942;":"\\rightleftarrows","&#x2941;":"\\circlearrowright","&#x2940;":"\\circlearrowleft","&#x293F;":"\\rightarrow","&#x293E;":"\\leftarrow","&#x293D;":"","&#x293C;":"","&#x293B;":"","&#x293A;":"","&#x2939;":"","&#x2938;":"","&#x2937;":"\\Rsh","&#x2936;":"\\Lsh","&#x2935;":"\\downarrow","&#x2934;":"\\uparrow","&#x2933;":"\\leadsto","&#x2932;":"","&#x2931;":"","&#x2930;":"","&#x292F;":"","&#x292E;":"","&#x292D;":"","&#x292C;":"\\times","&#x292B;":"\\times","&#x292A;":"","&#x2929;":"","&#x2928;":"","&#x2927;":"","&#x2926;":"","&#x2925;":"","&#x2924;":"","&#x2923;":"","&#x2922;":"","&#x2921;":"","&#x2920;":"\\mapsto\\cdot","&#x291F;":"\\cdot\\leftarrow","&#x291E;":"\\rightarrow\\cdot","&#x291D;":"\\leftarrow","&#x291C;":"\\rightarrow","&#x291B;":"\\leftarrow","&#x291A;":"\\rightarrow","&#x2919;":"\\leftarrow","&#x2918;":"\\rightarrow","&#x2917;":"\\rightarrow","&#x2916;":"\\rightarrow","&#x2915;":"\\rightarrow","&#x2914;":"\\rightarrow","&#x2913;":"\\downarrow","&#x2912;":"\\uparrow","&#x2911;":"\\rightarrow","&#x2910;":"\\rightarrow","&#x290F;":"\\rightarrow","&#x290E;":"\\leftarrow","&#x290D;":"\\rightarrow","&#x290C;":"\\leftarrow","&#x290B;":"\\Downarrow","&#x290A;":"\\Uparrow","&#x2909;":"\\uparrow","&#x2908;":"\\downarrow","&#x2907;":"\\Rightarrow","&#x2906;":"\\Leftarrow","&#x2905;":"\\mapsto","&#x2904;":"\\nLeftrightarrow","&#x2903;":"\\nRightarrow","&#x2902;":"\\nLeftarrow","&#x2901;":"\\rightsquigarrow","&#x2900;":"\\rightsquigarrow","&#x27FF;":"\\rightsquigarrow","&#x27FE;":"\\Rightarrow","&#x27FD;":"\\Leftarrow","&#x27FC;":"\\mapsto","&#x27FB;":"\\leftarrow","&#x27FA;":"\\Longleftrightarrow","&#x27F9;":"\\Longrightarrow","&#x27F8;":"\\Longleftarrow","&#x27F7;":"\\leftrightarrow","&#x27F6;":"\\rightarrow","&#x27F5;":"\\leftarrow","&#x27F1;":"\\Downarrow","&#x27F0;":"\\Uparrow","&#x22B8;":"\\rightarrow","&#x21FF;":"\\leftrightarrow","&#x21FE;":"\\rightarrow","&#x21FD;":"\\leftarrow","&#x21FC;":"\\nleftrightarrow","&#x21FB;":"\\nrightarrow","&#x21FA;":"\\nleftarrow","&#x21F9;":"\\nleftrightarrow","&#x21F8;":"\\nrightarrow","&#x21F7;":"\\nleftarrow","&#x21F6;":"\\Rrightarrow","&#x21F5;":"","&#x21F4;":"\\rightarrow","&#x21F3;":"\\Updownarrow","&#x21F2;":"\\searrow","&#x21F1;":"\\nwarrow","&#x21F0;":"\\Leftarrow","&#x21EF;":"\\Uparrow","&#x21EE;":"\\Uparrow","&#x21ED;":"\\Uparrow","&#x21EC;":"\\Uparrow","&#x21EB;":"\\Uparrow","&#x21EA;":"\\Uparrow","&#x21E9;":"\\Downarrow","&#x21E8;":"\\Rightarrow","&#x21E7;":"\\Uparrow","&#x21E6;":"\\Leftarrow","&#x21E5;":"\\rightarrow","&#x21E4;":"\\leftarrow","&#x21E3;":"\\downarrow","&#x21E2;":"\\rightarrow","&#x21E1;":"\\uparrow","&#x21E0;":"\\leftarrow","&#x21DF;":"\\downarrow","&#x21DE;":"\\uparrow","&#x21DD;":"\\rightsquigarrow","&#x21DC;":"\\leftarrow","&#x21DB;":"\\Rrightarrow","&#x21DA;":"\\Lleftarrow","&#x21D9;":"\\swarrow","&#x21D8;":"\\searrow","&#x21D7;":"\\nearrow","&#x21D6;":"\\nwarrow","&#x21D5;":"\\Updownarrow","&#x21D4;":"\\Leftrightarrow","&#x21D3;":"\\Downarrow","&#x21D2;":"\\Rightarrow","&#x21D1;":"\\Uparrow","&#x21D0;":"\\Leftarrow","&#x21CF;":"\\nRightarrow","&#x21CE;":"\\nLeftrightarrow","&#x21CD;":"\\nLeftarrow","&#x21CC;":"\\rightleftharpoons","&#x21CB;":"\\leftrightharpoons","&#x21CA;":"\\downdownarrows","&#x21C9;":"\\rightrightarrows","&#x21C8;":"\\upuparrows","&#x21C7;":"\\leftleftarrows","&#x21C6;":"\\leftrightarrows","&#x21C5;":"","&#x21C4;":"\\rightleftarrows","&#x21C3;":"\\downharpoonleft","&#x21C2;":"\\downharpoonright","&#x21C1;":"\\rightharpoondown","&#x21C0;":"\\rightharpoonup","&#x21BF;":"\\upharpoonleft","&#x21BE;":"\\upharpoonright","&#x21BD;":"\\leftharpoondown","&#x21BC;":"\\leftharpoonup","&#x21BB;":"\\circlearrowright","&#x21BA;":"\\circlearrowleft","&#x21B9;":"\\leftrightarrows","&#x21B8;":"\\overline{\\nwarrow}","&#x21B7;":"\\curvearrowright","&#x21B6;":"\\curvearrowleft","&#x21B5;":"\\swarrow","&#x21B4;":"\\searrow","&#x21B3;":"\\Rsh","&#x21B2;":"\\Lsh","&#x21B1;":"\\Rsh","&#x21B0;":"\\Lsh","&#x21AF;":"\\swarrow","&#x21AE;":"","&#x21AD;":"\\leftrightsquigarrow","&#x21AC;":"\\looparrowright","&#x21AB;":"\\looparrowleft","&#x21AA;":"\\hookrightarrow","&#x21A9;":"\\hookleftarrow","&#x21A8;":"\\underline{\\updownarrow}","&#x21A7;":"\\downarrow","&#x21A6;":"\\rightarrowtail","&#x21A5;":"\\uparrow","&#x21A4;":"\\leftarrowtail","&#x21A3;":"\\rightarrowtail","&#x21A2;":"\\leftarrowtail","&#x21A1;":"\\downarrow","&#x21A0;":"\\twoheadrightarrow","&#x219F;":"\\uparrow","&#x219E;":"\\twoheadleftarrow","&#x219D;":"\\nearrow","&#x219C;":"\\nwarrow","&#x219B;":"","&#x219A;":"","&#x2199;":"\\swarrow","&#x2198;":"\\searrow","&#x2197;":"\\nearrow","&#x2196;":"\\nwarrow","&#x2195;":"\\updownarrow","&#x2194;":"\\leftrightarrow","&#x2193;":"\\downarrow","&#x2192;":"\\rightarrow","&#x2191;":"\\uparrow","&#x2190;":"\\leftarrow","|||":"\\left|||\\right.","||":"\\left||\\right.","|":"\\left|\\right.","&#x2AFE;":"","&#x2AFD;":"//","&#x2AFB;":"///","&#x2AFA;":"","&#x2AF9;":"","&#x2AF8;":"","&#x2AF7;":"","&#x2AF6;":"\\vdots","&#x2AF5;":"","&#x2AF4;":"","&#x2AF3;":"","&#x2AF2;":"\\nparallel","&#x2AF1;":"","&#x2AF0;":"","&#x2AEF;":"","&#x2AEE;":"\\bcancel{\\mid}","&#x2AED;":"","&#x2AEC;":"","&#x2AEB;":"","&#x2AEA;":"","&#x2AE9;":"","&#x2AE8;":"\\underline{\\perp}","&#x2AE7;":"\\overline{\\top}","&#x2AE6;":"","&#x2AE5;":"","&#x2AE4;":"","&#x2AE3;":"","&#x2AE2;":"","&#x2AE1;":"","&#x2AE0;":"\\perp","&#x2ADF;":"\\top","&#x2ADE;":"\\dashv","&#x2ADD;&#x338;":"","&#x2ADD;":"","&#x2ADB;":"\\pitchfork","&#x2ADA;":"","&#x2AD9;":"","&#x2AD8;":"","&#x2AD7;":"","&#x2AD6;":"","&#x2AD5;":"","&#x2AD4;":"","&#x2AD3;":"","&#x2AD2;":"","&#x2AD1;":"","&#x2AD0;":"","&#x2ACF;":"","&#x2ACE;":"","&#x2ACD;":"","&#x2ACC;":"\\underset{\\neq}{\\supset}","&#x2ACB;":"\\underset{\\neq}{\\subset}","&#x2ACA;":"\\underset{\\approx}{\\supset}","&#x2AC9;":"\\underset{\\approx}{\\subset}","&#x2AC8;":"\\underset{\\sim}{\\supset}","&#x2AC7;":"\\underset{\\sim}{\\subset}","&#x2AC6;":"\\supseteqq","&#x2AC5;":"\\subseteqq","&#x2AC4;":"\\dot{\\supseteq}","&#x2AC3;":"\\dot{\\subseteq}","&#x2AC2;":"\\underset{\\times}{\\supset}","&#x2AC1;":"\\underset{\\times}{\\subset}","&#x2AC0;":"\\underset{+}{\\supset}","&#x2ABF;":"\\underset{+}{\\subset}","&#x2ABE;":"","&#x2ABD;":"","&#x2ABC;":"\\gg ","&#x2ABB;":"\\ll","&#x2ABA;":"\\underset{\\cancel{\\approx}}{\\succ}","&#x2AB9;":"\\underset{\\cancel{\\approx}}{\\prec}","&#x2AB8;":"\\underset{\\approx}{\\succ}","&#x2AB7;":"\\underset{\\approx}{\\prec}","&#x2AB6;":"\\underset{\\cancel{=}}{\\succ}","&#x2AB5;":"\\underset{\\cancel{=}}{\\prec}","&#x2AB4;":"\\underset{=}{\\succ}","&#x2AB3;":"\\underset{=}{\\prec}","&#x2AB2;":"","&#x2AB1;":"","&#x2AAE;":"","&#x2AAD;":"\\underline{\\hcancel{>}}","&#x2AAC;":"\\underline{\\hcancel{>}}","&#x2AAB;":"\\hcancel{>}","&#x2AAA;":"\\hcancel{<}","&#x2AA9;":"","&#x2AA8;":"","&#x2AA7;":"\\vartriangleright","&#x2AA6;":"\\vartriangleleft","&#x2AA5;":"><","&#x2AA4;":"><","&#x2AA3;":"\\underline{\\ll}","&#x2AA2;&#x338;":"\\cancel{\\gg}","&#x2AA2;":"\\gg","&#x2AA1;&#x338;":"\\cancel{\\ll}","&#x2AA1;":"\\ll","&#x2AA0;":"\\overset{\\sim}{\\geqq}","&#x2A9F;":"\\overset{\\sim}{\\leqq}","&#x2A9E;":"\\overset{\\sim}{>}","&#x2A9D;":"\\overset{\\sim}{<}","&#x2A9C;":"","&#x2A9B;":"","&#x2A9A;":"\\overset{=}{>}","&#x2A99;":"\\overset{=}{<}","&#x2A98;":"","&#x2A97;":"","&#x2A96;":"","&#x2A95;":"","&#x2A94;":"","&#x2A93;":"","&#x2A92;":"\\underset{=}{\\gtrless}","&#x2A91;":"\\underset{=}{\\lessgtr}","&#x2A90;":"\\underset{<}{\\gtrsim}","&#x2A8F;":"\\underset{>}{\\lesssim}","&#x2A8E;":"\\underset{\\simeq}{>}","&#x2A8D;":"\\underset{\\simeq}{<}","&#x2A8C;":"\\gtreqqless","&#x2A8B;":"\\lesseqqgtr","&#x2A8A;":"\\underset{\\cancel{\\approx}}{>}","&#x2A89;":"\\underset{\\approx}{<}","&#x2A86;":"\\underset{\\approx}{>}","&#x2A85;":"\\underset{\\approx}{<}","&#x2A84;":"","&#x2A83;":"","&#x2A82;":"","&#x2A81;":"","&#x2A80;":"","&#x2A7F;":"","&#x2A7E;&#x338;":"\\bcancel{\\geq}","&#x2A7E;":"\\geq","&#x2A7D;&#x338;":"\\bcancel{\\leq}","&#x2A7D;":"\\leq","&#x2A7C;":"","&#x2A7B;":"","&#x2A7A;":"","&#x2A79;":"","&#x2A78;":"\\overset{\\dots}{\\equiv}","&#x2A77;":"","&#x2A76;":"===","&#x2A75;":"==","&#x2A74;":"::=","&#x2A73;":"","&#x2A72;":"\\underset{=}{+}","&#x2A71;":"\\overset{=}{+}","&#x2A70;":"\\overset{\\approx}{=}","&#x2A6F;":"\\overset{\\wedge}{=}","&#x2A6E;":"\\overset{*}{=}","&#x2A6D;":"\\dot{\\approx}","&#x2A6C;":"","&#x2A6B;":"","&#x2A6A;":"\\dot{\\sim}","&#x2A69;":"","&#x2A68;":"","&#x2A67;":"\\dot{\\equiv}","&#x2A66;":"\\underset{\\cdot}{=}","&#x2A65;":"","&#x2A64;":"","&#x2A63;":"\\underset{=}{\\vee}","&#x2A62;":"\\overset{=}{\\vee}","&#x2A61;":"ul(vv)","&#x2A60;":"\\underset{=}{\\wedge}","&#x2A5F;":"\\underline{\\wedge}","&#x2A5E;":"\\overset{=}{\\wedge}","&#x2A5D;":"\\hcancel{\\vee}","&#x2A5C;":"\\hcancel{\\wedge}","&#x2A5B;":"","&#x2A5A;":"","&#x2A59;":"","&#x2A58;":"\\vee","&#x2A57;":"\\wedge","&#x2A56;":"","&#x2A55;":"","&#x2A54;":"","&#x2A53;":"","&#x2A52;":"\\dot{\\vee}","&#x2A51;":"\\dot{\\wedge}","&#x2A50;":"","&#x2A4F;":"","&#x2A4E;":"","&#x2A4D;":"\\overline{\\cap}","&#x2A4C;":"\\overline{\\cup}","&#x2A4B;":"","&#x2A4A;":"","&#x2A49;":"","&#x2A48;":"","&#x2A47;":"","&#x2A46;":"","&#x2A45;":"","&#x2A44;":"","&#x2A43;":"\\overline{\\cap}","&#x2A42;":"\\overline{\\cup}","&#x2A41;":"","&#x2A40;":"","&#x2A3E;":"","&#x2A3D;":"\\llcorner","&#x2A3C;":"\\lrcorner","&#x2A3B;":"","&#x2A3A;":"","&#x2A39;":"","&#x2A38;":"","&#x2A37;":"","&#x2A36;":"\\hat{\\otimes}","&#x2A35;":"","&#x2A34;":"","&#x2A33;":"","&#x2A32;":"\\underline{\\times}","&#x2A31;":"\\underline{\\times}","&#x2A30;":"\\dot{\\times}","&#x2A2E;":"","&#x2A2D;":"","&#x2A2C;":"","&#x2A2B;":"","&#x2A2A;":"","&#x2A29;":"","&#x2A28;":"","&#x2A27;":"","&#x2A26;":"\\underset{\\sim}{+}","&#x2A25;":"\\underset{\\circ}{+}","&#x2A24;":"\\overset{\\sim}{+}","&#x2A23;":"\\hat{+}","&#x2A22;":"\\dot{+}","&#x2A21;":"\\upharpoonright","&#x2A20;":">>","&#x2A1F;":"","&#x2A1E;":"\\triangleleft","&#x2A1D;":"\\bowtie","&#x29FF;":"","&#x29FE;":"+","&#x29FB;":"\\hcancel{|||}","&#x29FA;":"\\hcancel{||}","&#x29F9;":"\\backslash","&#x29F8;":"/","&#x29F7;":"hcancel{\backslash}","&#x29F6;":"","&#x29F5;":"\\backslash","&#x29F2;":"\\Phi","&#x29F1;":"","&#x29F0;":"","&#x29EE;":"","&#x29ED;":"","&#x29EC;":"","&#x29EB;":"\\lozenge","&#x29EA;":"","&#x29E9;":"","&#x29E8;":"","&#x29E7;":"\\ddagger","&#x29E2;":"\\sqcup\\sqcup","&#x29E1;":"","&#x29E0;":"\\square","&#x29DE;":"","&#x29DD;":"","&#x29DC;":"","&#x29DB;":"\\{\\{","&#x29D9;":"\\{","&#x29D8;":"\\}","&#x29D7;":"","&#x29D6;":"","&#x29D5;":"\\bowtie","&#x29D4;":"\\bowtie","&#x29D3;":"\\bowtie","&#x29D2;":"\\bowtie","&#x29D1;":"\\bowtie","&#x29D0;&#x338;":"| \\not\\triangleright","&#x29D0;":"| \\triangleright","&#x29CF;&#x338;":"\\not\\triangleleft |","&#x29CF;":"\\triangleleft |","&#x29CE;":"","&#x29CD;":"\\triangle","&#x29CC;":"","&#x29CB;":"\\underline{\\triangle}","&#x29CA;":"\\dot{\\triangle}","&#x29C9;":"","&#x29C8;":"\\boxed{\\circ}","&#x29C7;":"\\boxed{\\circ}","&#x29C6;":"\\boxed{\\rightarrow}","&#x29C5;":"\\bcancel{\\square}","&#x29C4;":"\\cancel{\\square}","&#x29C3;":"\\odot","&#x29C2;":"\\odot","&#x29BF;":"\\odot","&#x29BE;":"\\odot","&#x29BD;":"\\varnothing","&#x29BC;":"\\oplus","&#x29BB;":"\\otimes","&#x29BA;":"","&#x29B9;":"\\varnothing","&#x29B8;":"\\varnothing","&#x29B7;":"\\ominus","&#x29B6;":"\\ominus","&#x29B5;":"\\ominus","&#x29B4;":"\\vec{\\varnothing}","&#x29B3;":"\\vec{\\varnothing}","&#x29B2;":"\\dot{\\varnothing}","&#x29B1;":"\\overline{\\varnothing}","&#x29B0;":"\\varnothing","&#x29AF;":"","&#x29AE;":"","&#x29AD;":"","&#x29AC;":"","&#x29AB;":"","&#x29AA;":"","&#x29A9;":"","&#x29A8;":"","&#x29A7;":"","&#x29A6;":"","&#x29A5;":"","&#x29A4;":"","&#x29A3;":"","&#x29A2;":"","&#x29A1;":"\\not\\lor","&#x29A0;":"\\bcancel{>}","&#x2982;":":","&#x2981;":"\\circ","&#x2758;":"|","&#x25B2;":"\\bigtriangleup","&#x22FF;":"\\Epsilon","&#x22FE;":"\\overline{\\ni}","&#x22FD;":"\\overline{\\ni}","&#x22FC;":"\\in","&#x22FB;":"\\in","&#x22FA;":"\\in","&#x22F9;":"\\underline{\\in}","&#x22F8;":"\\underline{\\in}","&#x22F7;":"\\overline{\\in}","&#x22F6;":"\\overline{\\in}","&#x22F5;":"\\dot{\\in}","&#x22F4;":"\\in","&#x22F3;":"\\in","&#x22F2;":"\\in","&#x22F0;":"\\ddots","&#x22E9;":"\\underset{\\sim}{\\succ}","&#x22E8;":"\\underset{\\sim}{\\prec}","&#x22E7;":"\\underset{\\not\\sim}{>}","&#x22E6;":"\\underset{\\not\\sim}{<}","&#x22E5;":"\\not\\sqsupseteq","&#x22E4;":"\\not\\sqsubseteq","&#x22E3;":"\\not\\sqsupseteq","&#x22E2;":"\\not\\sqsubseteq","&#x22E1;":"\\nsucc","&#x22E0;":"\\nprec","&#x22DF;":"\\succ","&#x22DE;":"\\prec","&#x22DD;":"\\overline{>}","&#x22DC;":"\\overline{<}","&#x22DB;":"\\underset{>}{\\leq}","&#x22DA;":"\\underset{<}{\\geq}","&#x22D5;":"\\#","&#x22D3;":"\\cup","&#x22D2;":"\\cap","&#x22D1;":"\\supset","&#x22D0;":"\\subset","&#x22CF;":"\\wedge","&#x22CE;":"\\vee","&#x22CD;":"\\simeq","&#x22C8;":"\\bowtie","&#x22C7;":"\\ast","&#x22C6;":"\\star","&#x22C4;":"\\diamond","&#x22BF;":"\\triangle","&#x22BE;":"\\measuredangle","&#x22BD;":"\\overline{\\lor}","&#x22BC;":"\\overline{\\land}","&#x22BB;":"\\underline{\\lor}","&#x22BA;":"\\top","&#x22B9;":"","&#x22B7;":"\\circ\\multimap","&#x22B6;":"\\circ\\multimap","&#x22B3;":"\\triangleright","&#x22B2;":"\\triangleleft","&#x22B1;":"\\succ","&#x22B0;":"\\prec","&#x22AB;":"|\\models","&#x22AA;":"|\\models","&#x22A7;":"\\models","&#x22A6;":"\\vdash","&#x229D;":"\\ominus","&#x229C;":"\\ominus","&#x229B;":"\\odot","&#x229A;":"\\odot","&#x2294;":"\\sqcup","&#x2293;":"\\sqcap","&#x2292;":"\\sqsupseteq","&#x2291;":"\\sqsubseteq","&#x2290;&#x338;":"\\not\\sqsupset","&#x2290;":"\\sqsupset","&#x228F;&#x338;":"\\not\\sqsubset","&#x228F;":"\\sqsubset","&#x228E;":"\\cup","&#x228D;":"\\cup","&#x228C;":"\\cup","&#x227F;&#x338;":"\\not\\succsim","&#x227F;":"\\succsim","&#x227E;":"\\precsim","&#x2279;":"\\not\\overset{>}{<}","&#x2278;":"\\not\\overset{>}{<}","&#x2277;":"\\overset{>}{<}","&#x2276;":"\\overset{<}{>}","&#x2275;":"\\not\\geg","&#x2274;":"\\not\\leq","&#x2273;":"\\geg","&#x2272;":"\\leq","&#x226C;":"","&#x2267;":"\\geg","&#x2266;&#x338;":"\\not\\leq","&#x2266;":"\\leq","&#x2263;":"\\overset{=}{=} ","&#x225E;":"\\overset{m}{=} ","&#x225D;":"\\overset{def}{=}","&#x2258;":"=","&#x2256;":"=","&#x2255;":"=:","&#x2253;":"\\doteq","&#x2252;":"\\doteq","&#x2251;":"\\doteq","&#x2250;":"\\doteq","&#x224F;&#x338;":"","&#x224F;":"","&#x224E;&#x338;":"","&#x224E;":"","&#x224C;":"\\approx","&#x224B;":"\\approx","&#x224A;":"\\approx","&#x2242;&#x338;":"\\neq","&#x2242;":"=","&#x223F;":"\\sim","&#x223E;":"\\infty","&#x223D;&#x331;":"\\sim","&#x223D;":"\\sim","&#x223B;":"\\sim","&#x223A;":":-:","&#x2239;":"-:","&#x2238;":"\\bot","&#x2237;":"::","&#x2236;":":","&#x2223;":"|","&#x221F;":"\\llcorner","&#x2219;":"\\cdot","&#x2218;":"\\circ","&#x2217;":"*","&#x2215;":"/","&#x220E;":"\\square","&#x220D;":"\\ni","&#x220A;":"\\in","&#x2206;":"\\Delta","&#x2044;":"/","&#x2AB0;&#x338;":"\\nsucceq","&#x2AB0;":"\\succeq","&#x2AAF;&#x338;":"\\npreceq","&#x2AAF;":"\\preceq","&#x2A88;":"\\ngeqslant","&#x2A87;":"\\nleqslant","&#x29F3;":"\\Phi","&#x29E6;":"\\models","&#x29E5;":"\\not\\equiv","&#x29E4;":"\\approx\\neq","&#x29E3;":"\\neq","&#x29C1;":"\\circle","&#x29C0;":"\\circle","&#x25E6;":"\\circle","&#x25D7;":"\\circle","&#x25D6;":"\\circle","&#x25CF;":"\\circle","&#x25CE;":"\\circledcirc","&#x25CD;":"\\circledcirc","&#x25CC;":"\\circledcirc","&#x25C9;":"\\circledcirc","&#x25C8;":"\\diamond","&#x25C7;":"\\diamond","&#x25C6;":"\\diamond","&#x25C5;":"\\triangleleft","&#x25C4;":"\\triangleleft","&#x25C3;":"\\triangleleft","&#x25C2;":"\\triangleleft","&#x25C1;":"\\triangleleft","&#x25C0;":"\\triangleleft","&#x25BF;":"\\triangledown","&#x25BE;":"\\triangledown","&#x25BD;":"\\triangledown","&#x25BC;":"\\triangledown","&#x25B9;":"\\triangleright","&#x25B8;":"\\triangleright","&#x25B7;":"\\triangleright","&#x25B6;":"\\triangleright","&#x25B5;":"\\triangle","&#x25B4;":"\\triangle","&#x25B3;":"\\triangle","&#x25B1;":"\\square","&#x25B0;":"\\square","&#x25AF;":"\\square","&#x25AE;":"\\square","&#x25AD;":"\\square","&#x25AB;":"\\square","&#x25AA;":"\\square","&#x25A1;":"\\square","&#x25A0;":"\\square","&#x22ED;":"\\not\\triangleright","&#x22EC;":"\\not\\triangleleft","&#x22EB;":"\\not\\triangleright","&#x22EA;":"\\not\\triangleleft","&#x22D9;":"\\ggg","&#x22D8;":"\\lll","&#x22D7;":"*>","&#x22D6;":"<*","&#x22D4;":"\\pitchfork","&#x22CC;":"","&#x22CB;":"","&#x22CA;":"\\rtimes","&#x22C9;":"\\ltimes","&#x22B5;":"\\triangleright","&#x22B4;":"","&#x22A5;":"\\bot","&#x2281;":"\\nsucc","&#x2280;":"\\preceq","&#x227D;":"\\succeq","&#x227C;":"\\preceq","&#x227B;":"\\succ","&#x227A;":"\\prec","&#x2271;":"\\geq/","&#x2270;":"\\leq/","&#x226D;":"\\neq","&#x226B;&#x338;":"\\not\\gg","&#x226B;":"\\gg","&#x226A;&#x338;":"\\not\\ll","&#x226A;":"\\ll","&#x2269;":"\\ngeqslant","&#x2268;":"\\nleqslant","&#x2261;":"\\equiv","&#x225F;":"\\doteq","&#x225C;":"\\triangleq","&#x225B;":"\\doteq","&#x225A;":"\\triangleq","&#x2259;":"\\triangleq","&#x2257;":"\\doteq","&#x2254;":":=","&#x224D;":"\\asymp","&#x2247;":"\\ncong","&#x2246;":"\\ncong","&#x2245;":"\\cong","&#x2244;":"\\not\\simeq","&#x2243;":"\\simeq","&#x2241;":"\\not\\sim","&#x2226;":"\\not\\parallel","&#x2225;":"\\parallel","&#x2224;":"\\not|","&#x221D;":"\\propto","==":"==","=":"=",":=":":=","/=":"=","-=":"-=","+=":"+=","*=":"*=","!=":"!=","&#x2260;":"\\neq","&#x2262;":"\\equiv /","&#x2249;":"\\approx /","&#x223C;":"sim","&#x2248;":"\\approx","&#x226E;":"</","&lt;":"<","&#x226F;":">/",">=":">=",">":">","&#x2265;":"\\geq","&#x2264;":"\\leq","&lt;=":"<=","&#x228B;":"\\supsetneq","&#x228A;":"\\subsetneq","&#x2289;":"\\nsupseteq","&#x2288;":"\\nsubseteq","&#x2287;":"\\supseteq","&#x2286;":"\\subseteq","&#x2285;":"\\not\\supset","&#x2284;":"\\not\\subset","&#x2283;&#x20D2;":"\\supset |","&#x2283;":"\\supset","&#x2282;&#x20D2;":"\\subset |","&#x2282;":"\\subset","&#x220C;":"\\not\\in","&#x2209;":"\\notin","&#x2208;":"\\in","&#x2201;":"C","&#x2204;":"\\nexists","&#x2203;":"\\exists","&#x2200;":"\\forall","&#x2227;":"\\land","&amp;&amp;":"\\&\\&","&#x2228;":"\\lor","&#x22AF;":"\\cancel{\\vDash}","&#x22AE;":"\\cancel{\\Vdash}","&#x22AD;":"\\nvDash","&#x22AC;":"\\nvDash","&#x22A9;":"\\Vdash","&#x22A8;":"\\vDash","&#x22A4;":"\\top","&#x22A3;":"\\dashv","&#x22A2;":"\\vdash","&#x220B;":"\\ni","&#x22F1;":"\\ddots","&#x22EF;":"\\hdots","&#x22EE;":"\\vdots","&#x2026;":"\\hdots","&#x3F6;":"\\ni",":":":","...":"\\cdots","..":"..","->":"->","&#x2235;":"\\because","&#x2234;":"\\therefore ","&#x2063;":"",",":",",";":";","&#x29FD;":"\\}","&#x29FC;":"\\{","&#x2998;":"\\]","&#x2997;":"\\[","&#x2996;":"\\ll","&#x2995;":"\\gg","&#x2994;":"\\gg","&#x2993;":"\\ll","&#x2992;":"\\gg","&#x2991;":"\\ll","&#x2990;":"\\]","&#x298F;":"\\]","&#x298E;":"\\]","&#x298D;":"\\[","&#x298C;":"\\[","&#x298B;":"\\]","&#x298A;":"\\triangleright","&#x2989;":"\\triangleleft","&#x2988;":"|\\)","&#x2987;":"\\(|","&#x2986;":"|\\)","&#x2985;":"\\(\\(","&#x2984;":"|\\}","&#x2983;":"\\{|","&#x2980;":"\\||","&#x27EF;":"\\left. \\right]","&#x27EE;":"\\left[ \\right.","&#x27ED;":"\\left. \\right]]","&#x27EC;":"\\left[[ \\right.","&#x27EB;":"\\gg","&#x27EA;":"\\ll","&#x27E9;":"\\rangle","&#x27E8;":"\\langle","&#x27E7;":"\\left. \\right]]","&#x27E6;":"\\left[[ \\right.","&#x2773;":"\\left.\\right)","&#x2772;":"\\left(\\right.","&#x232A;":"\\rangle","&#x2329;":"\\langle","&#x230B;":"\\rfloor","&#x230A;":"\\lfloor","&#x2309;":"\\rceil","&#x2308;":"\\lceil","&#x2016;":"\\parallel","}":"\\left.\\right}","{":"\\left{\\right.","]":"\\left]\\right.","[":"\\left[\\right.",")":"\\left.\\right)","(":"\\left(\\right.","&#x201D;":'"',"&#x201C;":"``","&#x2019;":"'","&#x2018;":"`","%CE%B1":"\\alpha","%CE%B2":"\\beta","%CE%B3":"\\gamma","%CE%93":"\\Gamma","%CE%B4":"\\delta","%CE%94":"\\Delta","%CF%B5":"\\epsilon","%CE%B6":"\\zeta","%CE%B7":"\\eta","%CE%B8":"\\theta","%CE%98":"\\Theta","%CE%B9":"\\iota","%CE%BA":"\\kappa","%CE%BB":"\\lambda","%CE%BC":"\\mu","%CE%BD":"\\nu","%CE%BF":"\\omicron","%CF%80":"\\pi","%CE%A0":"\\Pi","%CF%81":"\\pho","%CF%83":"\\sigma","%CE%A3":"\\Sigma","%CF%84":"\\tau","%CF%85":"\\upsilon","%CE%A5":"\\Upsilon","%CF%95":"\\phi","%CE%A6":"\\Phi","%CF%87":"\\chi","%CF%88":"\\psi","%CE%A8":"\\Psi","%CF%89":"\\omega","%CE%A9":"\\Omega"}},9039:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.allMathOperatorsByGlyph=void 0,a.allMathOperatorsByGlyph={_:"\\underline","\u23E1":"\\underbrace","\u23E0":"\\overbrace","\u23DF":"\\underbrace","\u23DE":"\\overbrace","\u23DD":"\\underbrace","\u23DC":"\\overbrace","\u23B5":"\\underbrace","\u23B4":"\\overbrace","\u20DC":"\\square","\u20DB":"\\square","\u2064":"","\u2057":"''''","\u203E":"\\overline","\u2037":"```","\u2036":"``","\u2035":"`","\u2034":"'''","\u2033":"''","\u201F":"``","\u201E":",,","\u201B":"`","\u201A":",","^":"\\hat","\u02F7":"\\sim","\u02DD":"\\sim","\u02DC":"\\sim","\u02DA":"\\circ","\u02D9":"\\cdot","\u02D8":" ","\u02CD":"\\_","\u02CB":"\u02CB","\u02CA":"\u02CA","\u02C9":"\u02C9","\u02C7":"","\u02C6":"\\hat",\u00BA:"o","\xB9":"1","\xB8":",","\xB4":"\xB4","\xB3":"3","\xB2":"2","\xB0":"\\circ","\xAF":"\\bar",\u00AA:"a","\u219B":"\\nrightarrow","\xA8":"\\cdot\\cdot","~":"\\sim","`":"`","--":"--","++":"++","&":"\\&","\u221C":"\\sqrt[4]{}","\u221B":"\\sqrt[3]{}","\u221A":"\\sqrt{}","\u2146":"d","\u2145":"\\mathbb{D}","?":"?","@":"@","//":"//","!!":"!!","!":"!","\u266F":"\\#","\u266E":"","\u266D":"","\u2032":"'","<>":"<>","**":"\\star\\star","\u2207":"\\nabla","\u2202":"\\partial","\u2299":"\\bigodot","\xAC":"\\neg","\u2222":"\\measuredangle","\u2221":"\\measuredangle","\u2220":"\\angle","\xF7":"\\div","/":"/","\u2216":"\\backslash","\\":"\\backslash","%":"\\%","\u2297":"\\bigotimes","\xB7":"\\cdot","\u2A3F":"\\coprod","\u2A2F":"\\times","\u22C5":"\\cdot","\u22A1":"\\boxdot","\u22A0":"\\boxtimes","\u2062":"","\u2043":"-","\u2022":"\\cdot",".":".","*":"\\star","\u222A":"\\cup","\u2229":"\\cap","\u2210":"\\coprod","\u220F":"\\prod","\u2240":"","\u2AFF":"","\u2AFC":"\\mid\\mid\\mid","\u2A09":"\\times","\u2A08":"","\u2A07":"","\u2A06":"\\sqcup","\u2A05":"\\sqcap","\u2A02":"\\otimes","\u2A00":"\\odot","\u22C2":"\\cap","\u22C1":"\\vee","\u22C0":"\\wedge","\u2A04":"\\uplus","\u2A03":"\\cup","\u22C3":"\\cup","\u2A1C":"\\underline{\\int}","\u2A1B":"\\overline{\\int}","\u2A1A":"\\int","\u2A19":"\\int","\u2A18":"\\int","\u2A17":"\\int","\u2A16":"\\oint","\u2A15":"\\oint","\u2A14":"\\int","\u2A13":"\\int","\u2A12":"\\int","\u2A11":"\\int","\u2A10":"\\int","\u2A0F":"\\bcancel{\\int}","\u2A0E":"","\u2A0D":"\\hcancel{\\int}","\u2A0C":"\\iiiint","\u2233":"\\oint","\u2232":"\\oint","\u2231":"\\int","\u2230":"\\oiint","\u222F":"\\oiint","\u222E":"\\oint","\u222B":"\\int","\u2A01":"\\oplus","\u2298":"\\oslash","\u2296":"\\ominus","\u2295":"\\oplus","\u222D":"\\iiint","\u222C":"\\iint","\u2A0B":"","\u2A0A":"","\u2211":"\\sum","\u229F":"\\boxminus","\u229E":"\\boxplus","\u2214":"\\dot{+}","\u2213":"+-","\u2212":"-","\xB1":"\\pm","-":"-","+":"+","\u2B46":"\\Rrightarrow","\u2B45":"\\Lleftarrow","\u29F4":":\\rightarrow","\u29EF":"","\u29DF":"\\bullet-\\bullet","\u299F":"\\angle","\u299E":"\\measuredangle","\u299D":"\\measuredangle","\u299C":"\\perp","\u299B":"\\measuredangle","\u299A":"","\u2999":"\\vdots","\u297F":"","\u297E":"","\u297D":"\\prec","\u297C":"\\succ","\u297B":"\\underset{\\rightarrow}{\\supset}","\u297A":"","\u2979":"\\underset{\\rightarrow}{\\subset}","\u2978":"\\underset{\\rightarrow}{>}","\u2977":"","\u2976":"\\underset{\\leftarrow}{<}","\u2975":"\\underset{\\approx}{\\rightarrow}","\u2974":"\\underset{\\sim}{\\rightarrow}","\u2973":"\\underset{\\sim}{\\leftarrow}","\u2972":"\\overset{\\sim}{\\rightarrow}","\u2971":"\\overset{=}{\\rightarrow}","\u2970":"","\u296F":"","\u296E":"","\u296D":"\\overline{\\rightharpoondown}","\u296C":"\\underline{\\rightharpoonup}","\u296B":"\\overline{\\leftharpoondown}","\u296A":"\\underline{\\leftharpoonup}","\u2969":"\\rightleftharpoons","\u2968":"\\rightleftharpoons","\u2967":"\\rightleftharpoons","\u2966":"\\rightleftharpoons","\u2965":"\\Downarrow","\u2964":"\\Rightarrow","\u2963":"\\Uparrow","\u2962":"\\Leftarrow","\u2961":"\\downarrow","\u2960":"\\uparrow","\u295F":"\\rightarrow","\u295E":"\\leftarrow","\u295D":"\\downarrow","\u295C":"\\uparrow","\u295B":"\\rightarrow","\u295A":"\\leftarrow","\u2959":"\\downarrow","\u2958":"\\uparrow","\u2957":"\\rightarrow","\u2956":"\\leftarrow","\u2955":"\\downarrow","\u2954":"\\uparrow","\u2953":"\\rightarrow","\u2952":"\\leftarrow","\u2951":"\\updownarrow","\u2950":"\\leftrightarrow","\u294F":"\\updownarrow","\u294E":"\\leftrightarrow","\u294D":"\\updownarrow","\u294C":"\\updownarrow","\u294B":"\\leftrightarrow","\u294A":"\\leftrightarrow","\u2949":"","\u2948":"\\leftrightarrow","\u2947":"\\nrightarrow","\u2946":"","\u2945":"","\u2944":"\\rightleftarrows","\u2943":"\\leftrightarrows","\u2942":"\\rightleftarrows","\u2941":"\\circlearrowright","\u2940":"\\circlearrowleft","\u293F":"\\rightarrow","\u293E":"\\leftarrow","\u293D":"\\leftarrow","\u293C":"\\rightarrow","\u293B":"\\rightarrow","\u293A":"\\leftarrow","\u2939":"\\downarrow","\u2938":"\\downarrow","\u2937":"\\Rsh","\u2936":"\\Lsh","\u2935":"\\downarrow","\u2934":"\\uparrow","\u2933":"\\rightarrow","\u2932":"\\leftarrow","\u2931":" ","\u2930":" ","\u292F":" ","\u292E":" ","\u292D":" ","\u292C":"\\times","\u292B":"\\times","\u292A":" ","\u2929":" ","\u2928":" ","\u2927":" ","\u2926":" ","\u2925":" ","\u2924":" ","\u2923":" ","\u2922":" ","\u2921":" ","\u2920":"\\mapsto\\cdot","\u291F":"\\cdot\\leftarrow","\u291E":"\\rightarrow\\cdot","\u291D":"\\leftarrow","\u291C":"\\rightarrow","\u291B":"\\leftarrow","\u291A":"\\rightarrow","\u2919":"\\leftarrow","\u2918":"\\rightarrow","\u2917":"\\rightarrow","\u2916":"\\rightarrow","\u2915":"\\rightarrow","\u2914":"\\rightarrow","\u2913":"\\downarrow","\u2912":"\\uparrow","\u2911":"\\rightarrow","\u2910":"\\rightarrow","\u290F":"\\rightarrow","\u290E":"\\leftarrow","\u290D":"\\rightarrow","\u290C":"\\leftarrow","\u290B":"\\Downarrow","\u290A":"\\Uparrow","\u2909":"\\uparrow","\u2908":"\\downarrow","\u2907":"\\Rightarrow","\u2906":"\\Leftarrow","\u2905":"\\mapsto","\u2904":"\\nLeftrightarrow","\u2903":"\\nRightarrow","\u2902":"\\nLeftarrow","\u2901":"\\rightsquigarrow","\u2900":"\\rightsquigarrow","\u27FF":"\\rightsquigarrow","\u27FE":"\\Rightarrow","\u27FD":"\\Leftarrow","\u27FC":"\\mapsto","\u27FB":"\\leftarrow","\u27FA":"\\Longleftrightarrow","\u27F9":"\\Longrightarrow","\u27F8":"\\Longleftarrow","\u27F7":"\\leftrightarrow","\u27F6":"\\rightarrow","\u27F5":"\\leftarrow","\u27F1":"\\Downarrow","\u27F0":"\\Uparrow","\u22B8":"\\rightarrow","\u21FF":"\\leftrightarrow","\u21FE":"\\rightarrow","\u21FD":"\\leftarrow","\u21FC":"\\nleftrightarrow","\u21FB":"\\nrightarrow","\u21FA":"\\nleftarrow","\u21F9":"\\nleftrightarrow","\u21F8":"\\nrightarrow","\u21F7":"\\nleftarrow","\u21F6":"\\Rrightarrow","\u21F5":"","\u21F4":"\\rightarrow","\u21F3":"\\Updownarrow","\u21F2":"\\searrow","\u21F1":"\\nwarrow","\u21F0":"\\Leftarrow","\u21EF":"\\Uparrow","\u21EE":"\\Uparrow","\u21ED":"\\Uparrow","\u21EC":"\\Uparrow","\u21EB":"\\Uparrow","\u21EA":"\\Uparrow","\u21E9":"\\Downarrow","\u21E8":"\\Rightarrow","\u21E7":"\\Uparrow","\u21E6":"\\Leftarrow","\u21E5":"\\rightarrow","\u21E4":"\\leftarrow","\u21E3":"\\downarrow","\u21E2":"\\rightarrow","\u21E1":"\\uparrow","\u21E0":"\\leftarrow","\u21DF":"\\downarrow","\u21DE":"\\uparrow","\u21DD":"\\rightsquigarrow","\u21DC":"\\leftarrow","\u21DB":"\\Rrightarrow","\u21DA":"\\Lleftarrow","\u21D9":"\\swarrow","\u21D8":"\\searrow","\u21D7":"\\nearrow","\u21D6":"\\nwarrow","\u21D5":"\\Updownarrow","\u21D4":"\\Leftrightarrow","\u21D3":"\\Downarrow","\u21D2":"\\Rightarrow","\u21D1":"\\Uparrow","\u21D0":"\\Leftarrow","\u21CF":"\\nRightarrow","\u21CE":"\\nLeftrightarrow","\u21CD":"\\nLeftarrow","\u21CC":"\\rightleftharpoons","\u21CB":"\\leftrightharpoons","\u21CA":"\\downdownarrows","\u21C9":"\\rightrightarrows","\u21C8":"\\upuparrows","\u21C7":"\\leftleftarrows","\u21C6":"\\leftrightarrows","\u21C5":"","\u21C4":"\\rightleftarrows","\u21C3":"\\downharpoonleft","\u21C2":"\\downharpoonright","\u21C1":"\\rightharpoondown","\u21C0":"\\rightharpoonup","\u21BF":"\\upharpoonleft","\u21BE":"\\upharpoonright","\u21BD":"\\leftharpoondown","\u21BC":"\\leftharpoonup","\u21BB":"\\circlearrowright","\u21BA":"\\circlearrowleft","\u21B9":"\\leftrightarrows","\u21B8":"\\overline{\\nwarrow}","\u21B7":"\\curvearrowright","\u21B6":"\\curvearrowleft","\u21B5":"\\swarrow","\u21B4":"\\searrow","\u21B3":"\\Rsh","\u21B2":"\\Lsh","\u21B1":"\\Rsh","\u21B0":"\\Lsh","\u21AF":"\\swarrow","\u21AE":"","\u21AD":"\\leftrightsquigarrow","\u21AC":"\\looparrowright","\u21AB":"\\looparrowleft","\u21AA":"\\hookrightarrow","\u21A9":"\\hookleftarrow","\u21A8":"\\underline{\\updownarrow}","\u21A7":"\\downarrow","\u21A6":"\\rightarrowtail","\u21A5":"\\uparrow","\u21A4":"\\leftarrowtail","\u21A3":"\\rightarrowtail","\u21A2":"\\leftarrowtail","\u21A1":"\\downarrow","\u21A0":"\\twoheadrightarrow","\u219F":"\\uparrow","\u219E":"\\twoheadleftarrow","\u219D":"\\nearrow","\u219C":"\\nwarrow","\u219A":"","\u2199":"\\swarrow","\u2198":"\\searrow","\u2197":"\\nearrow","\u2196":"\\nwarrow","\u2195":"\\updownarrow","\u2194":"\\leftrightarrow","\u2193":"\\downarrow","\u2192":"\\rightarrow","\u2191":"\\uparrow","\u2190":"\\leftarrow","|||":"\\left|||\\right.","||":"\\left||\\right.","|":"\\mid","\u2AFE":"","\u2AFD":"//","\u2AFB":"///","\u2AFA":"","\u2AF9":"","\u2AF8":"","\u2AF7":"","\u2AF6":"\\vdots","\u2AF5":"","\u2AF4":"","\u2AF3":"","\u2AF2":"\\nparallel","\u2AF1":"","\u2AF0":"","\u2AEF":"","\u2AEE":"\\bcancel{\\mid}","\u2AED":"","\u2AEC":"","\u2AEB":"","\u2AEA":"","\u2AE9":"","\u2AE8":"\\underline{\\perp}","\u2AE7":"\\overline{\\top}","\u2AE6":"","\u2AE5":"","\u2AE4":"","\u2AE3":"","\u2AE2":"","\u2AE1":"","\u2AE0":"\\perp","\u2ADF":"\\top","\u2ADE":"\\dashv","\u2ADD\u0338":"","\u2ADD":"","\u2ADB":"\\pitchfork","\u2ADA":"","\u2AD9":"","\u2AD8":"","\u2AD7":"","\u2AD6":"","\u2AD5":"","\u2AD4":"","\u2AD3":"","\u2AD2":"","\u2AD1":"","\u2AD0":"","\u2ACF":"","\u2ACE":"","\u2ACD":"","\u2ACC":"\\underset{\\neq}{\\supset}","\u2ACB":"\\underset{\\neq}{\\subset}","\u2ACA":"\\underset{\\approx}{\\supset}","\u2AC9":"\\underset{\\approx}{\\subset}","\u2AC8":"\\underset{\\sim}{\\supset}","\u2AC7":"\\underset{\\sim}{\\subset}","\u2AC6":"\\supseteqq","\u2AC5":"\\subseteqq","\u2AC4":"\\dot{\\supseteq}","\u2AC3":"\\dot{\\subseteq}","\u2AC2":"\\underset{\\times}{\\supset}","\u2AC1":"\\underset{\\times}{\\subset}","\u2AC0":"\\underset{+}{\\supset}","\u2ABF":"\\underset{+}{\\subset}","\u2ABE":"","\u2ABD":"","\u2ABC":"\\gg ","\u2ABB":"\\ll","\u2ABA":"\\underset{\\cancel{\\approx}}{\\succ}","\u2AB9":"\\underset{\\cancel{\\approx}}{\\prec}","\u2AB8":"\\underset{\\approx}{\\succ}","\u2AB7":"\\underset{\\approx}{\\prec}","\u2AB6":"\\underset{\\cancel{=}}{\\succ}","\u2AB5":"\\underset{\\cancel{=}}{\\prec}","\u2AB4":"\\underset{=}{\\succ}","\u2AB3":"\\underset{=}{\\prec}","\u2AB2":"","\u2AB1":"","\u2AAE":"","\u2AAD":"\\underline{\\hcancel{>}}","\u2AAC":"\\underline{\\hcancel{>}}","\u2AAB":"\\hcancel{>}","\u2AAA":"\\hcancel{<}","\u2AA9":"","\u2AA8":"","\u2AA7":"\\vartriangleright","\u2AA6":"\\vartriangleleft","\u2AA5":"><","\u2AA4":"><","\u2AA3":"\\underline{\\ll}","\u2AA2\u0338":"\\cancel{\\gg}","\u2AA2":"\\gg","\u2AA1\u0338":"\\cancel{\\ll}","\u2AA1":"\\ll","\u2AA0":"\\overset{\\sim}{\\geqq}","\u2A9F":"\\overset{\\sim}{\\leqq}","\u2A9E":"\\overset{\\sim}{>}","\u2A9D":"\\overset{\\sim}{<}","\u2A9C":"","\u2A9B":"","\u2A9A":"\\overset{=}{>}","\u2A99":"\\overset{=}{<}","\u2A98":"","\u2A97":"","\u2A96":"","\u2A95":"","\u2A94":"","\u2A93":"","\u2A92":"\\underset{=}{\\gtrless}","\u2A91":"\\underset{=}{\\lessgtr}","\u2A90":"\\underset{<}{\\gtrsim}","\u2A8F":"\\underset{>}{\\lesssim}","\u2A8E":"\\underset{\\simeq}{>}","\u2A8D":"\\underset{\\simeq}{<}","\u2A8C":"\\gtreqqless","\u2A8B":"\\lesseqqgtr","\u2A8A":"\\underset{\\cancel{\\approx}}{>}","\u2A89":"\\underset{\\approx}{<}","\u2A86":"\\underset{\\approx}{>}","\u2A85":"\\underset{\\approx}{<}","\u2A84":"","\u2A83":"","\u2A82":"","\u2A81":"","\u2A80":"","\u2A7F":"","\u2A7E\u0338":"\\bcancel{\\geq}","\u2A7E":"\\geq","\u2A7D\u0338":"\\bcancel{\\leq}","\u2A7D":"\\leq","\u2A7C":"","\u2A7B":"","\u2A7A":"","\u2A79":"","\u2A78":"\\overset{\\dots}{\\equiv}","\u2A77":"","\u2A76":"===","\u2A75":"==","\u2A74":"::=","\u2A73":"","\u2A72":"\\underset{=}{+}","\u2A71":"\\overset{=}{+}","\u2A70":"\\overset{\\approx}{=}","\u2A6F":"\\overset{\\wedge}{=}","\u2A6E":"\\overset{*}{=}","\u2A6D":"\\dot{\\approx}","\u2A6C":"","\u2A6B":"","\u2A6A":"\\dot{\\sim}","\u2A69":"","\u2A68":"","\u2A67":"\\dot{\\equiv}","\u2A66":"\\underset{\\cdot}{=}","\u2A65":"","\u2A64":"","\u2A63":"\\underset{=}{\\vee}","\u2A62":"\\overset{=}{\\vee}","\u2A61":"ul(vv)","\u2A60":"\\underset{=}{\\wedge}","\u2A5F":"\\underline{\\wedge}","\u2A5E":"\\overset{=}{\\wedge}","\u2A5D":"\\hcancel{\\vee}","\u2A5C":"\\hcancel{\\wedge}","\u2A5B":"","\u2A5A":"","\u2A59":"","\u2A58":"\\vee","\u2A57":"\\wedge","\u2A56":"","\u2A55":"","\u2A54":"","\u2A53":"","\u2A52":"\\dot{\\vee}","\u2A51":"\\dot{\\wedge}","\u2A50":"","\u2A4F":"","\u2A4E":"","\u2A4D":"\\overline{\\cap}","\u2A4C":"\\overline{\\cup}","\u2A4B":"","\u2A4A":"","\u2A49":"","\u2A48":"","\u2A47":"","\u2A46":"","\u2A45":"","\u2A44":"","\u2A43":"\\overline{\\cap}","\u2A42":"\\overline{\\cup}","\u2A41":"","\u2A40":"","\u2A3E":"","\u2A3D":"\\llcorner","\u2A3C":"\\lrcorner","\u2A3B":"","\u2A3A":"","\u2A39":"","\u2A38":"","\u2A37":"","\u2A36":"\\hat{\\otimes}","\u2A35":"","\u2A34":"","\u2A33":"","\u2A32":"\\underline{\\times}","\u2A31":"\\underline{\\times}","\u2A30":"\\dot{\\times}","\u2A2E":"\\bigodot","\u2A2D":"\\bigodot","\u2A2C":"","\u2A2B":"","\u2A2A":"","\u2A29":"","\u2A28":"","\u2A27":"","\u25FB":"\\Box","\u2A26":"\\underset{\\sim}{+}","\u2A25":"\\underset{\\circ}{+}","\u2A24":"\\overset{\\sim}{+}","\u2A23":"\\hat{+}","\u2A22":"\\dot{+}","\u2A21":"\\upharpoonright","\u2A20":">>","\u2A1F":"","\u2A1E":"\\triangleleft","\u2A1D":"\\bowtie","\u29FF":"","\u29FE":"+","\u29FB":"\\hcancel{|||}","\u29FA":"\\hcancel{||}","\u29F9":"\\backslash","\u29F8":"/","\u29F7":"hcancel{\backslash}","\u29F6":"","\u29F5":"\\backslash","\u29F2":"\\Phi","\u29F1":"","\u29F0":"","\u29EE":"","\u29ED":"","\u29EC":"","\u29EB":"\\lozenge","\u29EA":"","\u29E9":"","\u29E8":"","\u29E7":"\\ddagger","\u29E2":"\\sqcup\\sqcup","\u29E1":"","\u29E0":"\\square","\u29DE":"","\u29DD":"","\u29DC":"","\u29DB":"\\{\\{","\u29D9":"\\{","\u29D8":"\\}","\u29D7":"","\u29D6":"","\u29D5":"\\bowtie","\u29D4":"\\bowtie","\u29D3":"\\bowtie","\u29D2":"\\bowtie","\u29D1":"\\bowtie","\u29D0\u0338":"| \\not\\triangleright","\u29D0":"| \\triangleright","\u29CF\u0338":"\\not\\triangleleft |","\u29CF":"\\triangleleft |","\u29CE":"","\u29CD":"\\triangle","\u29CC":"","\u29CB":"\\underline{\\triangle}","\u29CA":"\\dot{\\triangle}","\u29C9":"","\u29C8":"\\boxed{\\circ}","\u29C7":"\\boxed{\\circ}","\u29C6":"\\boxed{\\rightarrow}","\u29C5":"\\bcancel{\\square}","\u29C4":"\\cancel{\\square}","\u29C3":"\\odot","\u29C2":"\\odot","\u29BF":"\\odot","\u29BE":"\\odot","\u29BD":"\\varnothing","\u29BC":"\\oplus","\u29BB":"\\otimes","\u29BA":"","\u29B9":"\\varnothing","\u29B8":"\\varnothing","\u29B7":"\\ominus","\u29B6":"\\ominus","\u29B5":"\\ominus","\u29B4":"\\vec{\\varnothing}","\u29B3":"\\vec{\\varnothing}","\u29B2":"\\dot{\\varnothing}","\u29B1":"\\overline{\\varnothing}","\u29B0":"\\varnothing","\u29AF":"\\measuredangle","\u29AE":"\\measuredangle","\u29AD":"\\measuredangle","\u29AC":"\\measuredangle","\u29AB":"\\measuredangle","\u29AA":"\\measuredangle","\u29A9":"\\measuredangle","\u29A8":"\\measuredangle","\u29A7":"","\u29A6":"","\u29A5":"","\u29A4":"","\u29A3":"\\ulcorner","\u29A2":"\\measuredangle","\u29A1":"\\not\\lor","\u29A0":"\\bcancel{>}","\u2982":":","\u2981":"\\cdot","\u2758":"\\mid","\u25B2":"\\bigtriangleup","\u22FF":"\\Epsilon","\u22FE":"\\overline{\\ni}","\u22FD":"\\overline{\\ni}","\u22FC":"\\in","\u22FB":"\\in","\u22FA":"\\in","\u22F9":"\\underline{\\in}","\u22F8":"\\underline{\\in}","\u22F7":"\\overline{\\in}","\u22F6":"\\overline{\\in}","\u22F5":"\\dot{\\in}","\u22F4":"\\in","\u22F3":"\\in","\u22F2":"\\in","\u22F0":"\\ddots","\u0589":":","\u22E9":"\\underset{\\sim}{\\succ}","\u22E8":"\\underset{\\sim}{\\prec}","\u22E7":"\\underset{\\not\\sim}{>}","\u22E6":"\\underset{\\not\\sim}{<}","\u22E5":"\\not\\sqsupseteq","\u22E4":"\\not\\sqsubseteq","\u22E3":"\\not\\sqsupseteq","\u22E2":"\\not\\sqsubseteq","\u22E1":"\\nsucc","\u22E0":"\\nprec","\u22DF":"\\succ","\u22DE":"\\prec","\u22DD":"\\overline{>}","\u22DC":"\\overline{<}","\u22DB":"\\underset{>}{\\leq}","\u22DA":"\\underset{<}{\\geq}","\u22D5":"\\#","\u22D3":"\\cup","\u22D2":"\\cap","\u22D1":"\\supset","\u22D0":"\\subset","\u22CF":"\\wedge","\u22CE":"\\vee","\u22CD":"\\simeq","\u22C8":"\\Join","\u22C7":"\\ast","\u22C6":"\\star","\u22C4":"\\diamond","\u22BF":"\\triangle","\u22BE":"\\measuredangle","\u22BD":"\\overline{\\lor}","\u22BC":"\\overline{\\land}","\u22BB":"\\underline{\\lor}","\u22BA":"\\top",\u571F:"\\pm",\u5341:"+","\u22B9":"","\u22B7":"\\circ\\multimap","\u22B6":"\\circ\\multimap","\u22B3":"\\triangleright","\u22B2":"\\triangleleft","\u22B1":"\\succ","\u22B0":"\\prec","\u22AB":"|\\models","\u22AA":"|\\models","\u22A7":"\\models","\u22A6":"\\vdash","\u229D":"\\ominus","\u229C":"\\ominus","\u229B":"\\odot","\u229A":"\\odot","\u2294":"\\sqcup","\u2293":"\\sqcap","\u2292":"\\sqsupseteq","\u2291":"\\sqsubseteq","\u2290\u0338":"\\not\\sqsupset","\u2290":"\\sqsupset","\u228F\u0338":"\\not\\sqsubset","\u228F":"\\sqsubset","\u228E":"\\cup","\u228D":"\\cup","\u228C":"\\cup","\u227F\u0338":"\\not\\succsim","\u227F":"\\succsim","\u227E":"\\precsim","\u2279":"\\not\\overset{>}{<}","\u2278":"\\not\\overset{>}{<}","\u2277":"\\overset{>}{<}","\u2276":"\\overset{<}{>}","\u2275":"\\not\\geg","\u2274":"\\not\\leq","\u2273":"\\geg","\u2272":"\\leq","\u226C":"","\u2267":"\\geg","\u2266\u0338":"\\not\\leq","\u2266":"\\leq","\u2263":"\\overset{=}{=} ","\u225E":"\\overset{m}{=} ","\u225D":"\\overset{def}{=}","\u2258":"=","\u2256":"=","\u2255":"=:","\u2253":"\\doteq","\u2252":"\\doteq","\u2251":"\\doteq","\u2250":"\\doteq","\u224F\u0338":"","\u224F":"","\u224E\u0338":"","\u224E":"","\u224C":"\\approx","\u224B":"\\approx","\u224A":"\\approx","\u2242\u0338":"\\neq","\u2242":"=","\u223F":"\\sim","\u223E":"\\infty","\u223D\u0331":"\\sim","\u223D":"\\sim","\u223B":"\\sim","\u223A":":-:","\u2239":"-:","\u2238":"\\bot","\u2237":"::","\u2236":":","\u2223":"\\mid","\u221F":"\\llcorner","\u2218":"\\circ","\u2217":"*","\u2215":"/","\u220E":"\\square","\u220D":"\\ni","\u220A":"\\in","\u2206":"\\Delta","\u2044":"/","\u2AB0\u0338":"\\nsucceq","\u2AB0":"\\succeq","\u2AAF\u0338":"\\npreceq","\u2AAF":"\\preceq","\u2A88":"\\ngeqslant","\u2A87":"\\nleqslant","\u29F3":"\\Phi","\u29E6":"\\models","\u29E5":"\\not\\equiv","\u29E4":"\\approx\\neq","\u29E3":"\\neq","\u29C1":"\\circle","\u29C0":"\\circle","\u25E6":"\\circle","\u25D7":"\\circle","\u25D6":"\\circle","\u25CF":"\\circle","\u25CE":"\\circledcirc","\u25CD":"\\circledcirc","\u25CC":"\\circledcirc","\u25C9":"\\circledcirc","\u25C8":"\\diamond","\u25C7":"\\diamond","\u25C6":"\\diamond","\u25C5":"\\triangleleft","\u25C4":"\\triangleleft","\u25C3":"\\triangleleft","\u25C2":"\\triangleleft","\u25C1":"\\triangleleft","\u25C0":"\\triangleleft","\u25BF":"\\triangledown","\u25BE":"\\triangledown","\u25BD":"\\triangledown","\u25BC":"\\triangledown","\u25B9":"\\triangleright","\u25B8":"\\triangleright","\u25B7":"\\triangleright","\u25B6":"\\triangleright","\u25B5":"\\triangle","\u25B4":"\\triangle","\u25B3":"\\triangle","\u25B1":"\\square","\u25B0":"\\blacksquare","\u25AF":"\\square","\u25AE":"\\blacksquare","\u25AD":"\\square","\u25AB":"\\square","\u25AA":"\\square","\u25A1":"\\square","\u25A0":"\\blacksquare","\u22ED":"\\not\\triangleright","\u22EC":"\\not\\triangleleft","\u22EB":"\\not\\triangleright","\u22EA":"\\not\\triangleleft","\u22D9":"\\ggg","\u22D8":"\\lll","\u22D7":"*>","\u22D6":"<*","\u22D4":"\\pitchfork","\u22CC":"","\u22CB":"\\bowtie","\u22CA":"\\ltimes","\u22C9":"\\rtimes","\u22B5":"\\triangleright","\\triangleleft":"","\u22A5":"\\bot","\u2281":"\\nsucc","\u2280":"\\preceq","\u227D":"\\succeq","\u227C":"\\preceq","\u227B":"\\succ","\u227A":"\\prec","\u2271":"\\geq/","\u2270":"\\leq/","\u226D":"\\neq","\u226B\u0338":"\\not\\gg","\u226B":"\\gg","\u226A\u0338":"\\not\\ll","\u226A":"\\ll","\u2269":"\\ngeqslant","\u2268":"\\nleqslant","\u2261":"\\equiv","\u225F":"\\doteq","\u225C":"\\triangleq","\u225B":"\\doteq","\u225A":"\\triangleq","\u2259":"\\triangleq","\u2257":"\\doteq","\u2254":":=","\u224D":"\\asymp","\u2247":"\\ncong","\u2246":"\\ncong","\u2245":"\\cong","\u2244":"\\not\\simeq","\u2243":"\\simeq","\u2241":"\\not\\sim","\u2226":"\\not\\parallel","\u2225":"\\parallel","\u2224":"\\not|","\u221D":"\\propto","==":"==","=":"=",":=":":=","/=":"=","-=":"-=","+=":"+=","*=":"*=","!=":"!=","\u2260":"\\neq","\u2262":"\\equiv /","\u2249":"\\approx /","\u223C":"sim","\u2248":"\\approx","\u226E":"</","<":"<","\u226F":">/",">=":">=",">":">","\u2265":"\\geq","\u2264":"\\leq","<=":"<=","\u228B":"\\supsetneq","\u228A":"\\subsetneq","\u2289":"\\nsupseteq","\u2288":"\\nsubseteq","\u2287":"\\supseteq","\u2286":"\\subseteq","\u2285":"\\not\\supset","\u2284":"\\not\\subset","\u2283\u20D2":"\\supset |","\u2283":"\\supset","\u2282\u20D2":"\\subset |","\u2282":"\\subset","\u220C":"\\not\\in","\u2209":"\\notin","\u2208":"\\in","\u2201":"C","\u2204":"\\nexists","\u2203":"\\exists","\u2200":"\\forall","\u2227":"\\land","&&":"\\&\\&","\u2228":"\\lor","\u22AF":"\\cancel{\\vDash}","\u22AE":"\\cancel{\\Vdash}","\u22AD":"\\nvDash","\u22AC":"\\nvDash","\u22A9":"\\Vdash","\u22A8":"\\vDash","\u22A4":"\\top","\u22A3":"\\dashv","\u22A2":"\\vdash","\u220B":"\\ni","\u22F1":"\\ddots","\u22EF":"\\hdots","\u22EE":"\\vdots","\u03F6":"\\ni",":":":","...":"\\cdots","..":"..","->":"->","\u2235":"\\because","\u2234":"\\therefore ","\u2063":"\\llbracket",",":",",";":";","\u29FD":"\\}","\u29FC":"\\{","\u2998":"\\]","\u2997":"\\[","\u2996":"\\ll","\u2995":"\\gg","\u2994":"\\gg","\u2993":"\\ll","\u2992":"\\gg","\u2991":"\\ll","\u2990":"\\]","\u298F":"\\]","\u298E":"\\]","\u298D":"\\[","\u298C":"\\[","\u298B":"\\]","\u298A":"\\triangleright","\u2989":"\\triangleleft","\u2988":"|\\)","\u2987":"\\(|","\u2986":"|\\)","\u2985":"\\(\\(","\u2984":"|\\}","\u2983":"\\{|","\u2980":"\\||","\u27EF":"\\left. \\right]","\u27EE":"\\left[ \\right.","\u27ED":"\\left. \\right]]","\u27EC":"\\left[[ \\right.","\u27EB":"\\gg","\u27EA":"\\ll","\u27E7":"\\)|","\u27E6":"\\(|","\u2773":"\\left.\\right)","\u2772":"\\left(\\right.","\u232A":"\\rangle","\u2329":"\\langle","\u230B":"\\rfloor","\u230A":"\\lfloor","\u2309":"\\rceil","\u2308":"\\lceil","\u2016":"\\parallel","}":"\\left.\\right}","{":"\\left{\\right.","]":"\\left]\\right.","[":"\\left[\\right.",")":"\\left.\\right)","(":"\\left(\\right.","\u201D":'\\"',"\u201C":"\\text{``}","\u2019":"'","\u2018":"`",\u03B1:"\\alpha",\u03B2:"\\beta",\u03B3:"\\gamma",\u0393:"\\Gamma",\u03B4:"\\delta",\u0394:"\\Delta","\u03F5":"\\epsilon",\u03B6:"\\zeta",\u03B7:"\\eta",\u03B8:"\\theta",\u0398:"\\Theta",\u03B9:"\\iota",\u03BA:"\\kappa",\u03BB:"\\lambda",\u03BD:"\\nu",\u03BF:"\\omicron",\u03C0:"\\pi",\u03A0:"\\Pi",\u03C1:"\\rho",\u03C3:"\\sigma",\u03A3:"\\Sigma",\u03C4:"\\tau",\u03C5:"\\upsilon",\u03A5:"\\Upsilon",\u03D5:"\\phi",\u03A6:"\\Phi",\u03C7:"\\chi",\u03C8:"\\psi",\u03A8:"\\Psi",\u03C9:"\\omega",\u03A9:"\\Omega",\u2126:"\\Omega","\u2205":"\\emptyset","\u27F2":"\\circlearrowleft","\u27F3":"\\circlearrowright","\xD7":"\\times","\xBD":"\\dfrac{1}{2}",\u03BC:"\\mu",\u04E8:"\\theta","\u2713":"\\checkmark","\u27E9":"\\rangle","\u27E8":"\\langle","\xBC":"\\dfrac{1}{4}","\u2026":"\\ldots",\u210F:"\\hbar",\u211C:"\\mathfrak{R}",\u0472:"\\theta",\u00D8:"\\emptyset",\u03F1:"\\varrho",\u0444:"\\phi",\u2107:"\\varepsilon",T:"T","\u2219":"\\cdot",\u03A1:"P","\u221E":"\\infty",\u1401:"\\nabla",\u019E:"\\eta","\u207A":"^{+}","\u207B":"^{-}","\u207C":"^{=}","\u207D":"^{(}","\u207E":"^{)}","\u3017":"\\)|","\u3016":"\\langle","\u037E":";","\u0D66":"\\circ","\u2534":"\\perp","\u2715":"\\times","\u23BB":"-","\xBB":"\\gg","\u2B06":"\\uparrow","\u2B07":"\\downarrow","\u2B05":"\\leftarrow","\u27A1":"\\rightarrow","\u23BC":"-","\u239C":"\\mid","\u23A5":"\\mid",\u0127:"\\hbar","\u2B95":"\\rightarrow","\u30FB":"\\cdot","\xA6":"\\mid","\xA3":"\\pounds","\xA5":"\\yen","\u2717":"\\times","\u2714":"\\checkmark",\u207F:"^{n}","\xAB":"\\ll",\u0E40:"\\prime","\u2020":"\\dagger","\u2502":"\\mid",$:"\\$","#":"\\#","\u2103":"\\text{\\textdegree C}","\u2109":"\\text{\\textdegree F}","\u2588":"\\blacksquare","\u2127":"\\mho","\u2147":"\\text{e}",\u027C:"r","\u2021":"\\ddagger",\u1F31:"i",\u03D2:"\\Upsilon","\u{1D6FF}":"\\delta","\u02F3":"\\cdot",\u0473:"\\theta","\u{1D719}":"\\phi",\u041F:"\\prod",\u043E:"o",\u0452:"\\hbar","\u0245":"\\Lambda","\u0964":"\\mid","\u20AC":"\\euro",\u1FE1:"\\bar{u}",\u03C6:"\\varphi","\u023C":"c","\u{1D7AE}":"\\epsilon",\u03A7:"\\mathsf{X}","\u2099":"_{n}"}},8249:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.allMathSymbolsByChar=void 0,a.allMathSymbolsByChar={"&#xA0;":"\\textrm{ }","&#x2203;":"\\exists","&#x2200;":"\\forall","&#x21D4;":"\\iff","&#x21D2;":"=>","&#xAC;":"\\neg","&#x2124;":"\\mathbb{Z}","&#x211D;":"\\mathbb{R}","&#x211A;":"\\mathbb{Q}","&#x2115;":"\\mathbb{N}","&#x2102;":"CC","&#x25A1;":"\\square","&#x22C4;":"\\diamond","&#x25B3;":"\\triangle","&#x2322;":"\\frown","&#x2220;":"\\angle","&#x22F1;":"\\ddots","&#x22EE;":"\\vdots","&#x2235;":"\\because","&#x2234;":"\\therefore","&#x2135;":"\\aleph","&#x2205;":"\\oslash","&#xB1;":"\\pm","&#x2207;":"\\nabla","&#x2202;":"\\partial","&#x222E;":"\\oint","&#x222B;":"\\int","&#x22C3;":"\\cup","&#x222A;":"\\cup","&#x22C2;":"\\cap","&#x2229;":"\\cap","&#x22C1;":"\\vee","&#x2228;":"\\vee","&#x22C0;":"\\wedge","&#x2227;":"\\wedge","&#x220F;":"\\prod","&#x2211;":"\\sum","&#x2299;":"\\bigodot","&#x2297;":"\\bigoplus","&#x2295;":"o+","&#x2218;":"@","&#x22C8;":"\\bowtie","&#x22CA;":"\\rtimes","&#x22C9;":"\\ltimes","&#xF7;":"\\div","&#xD7;":"\\times","\\":"\\backslash","&#x22C6;":"\\star","&#x2217;":"\\star","&#x22C5;":"\\cdot","&#x3A9;":"\\Omega","&#x3C9;":"\\omega","&#x3A8;":"\\Psi","&#x3C8;":"\\psi","&#x3C7;":"\\chi","&#x3C6;":"\\varphi","&#x3A6;":"\\Phi","&#x3D5;":"\\phi","&#x3C5;":"\\upsilon","&#x3C4;":"\\tau","&#x3A3;":"\\Sigma","&#x3C3;":"\\sigma","&#x3C1;":"\\rho","&#x3A0;":"\\Pi","&#x3C0;":"\\pi","&#x39E;":"\\Xi","&#x3BE;":"\\xi","&#x3BD;":"\\nu","&#x3BC;":"\\mu","&#x39B;":"\\Lambda","&#x3BB;":"\\lambda","&#x3BA;":"\\kappa","&#x3B9;":"\\iota","&#x3D1;":"\\vartheta","&#x398;":"\\Theta","&#x3B8;":"\\theta","&#x3B7;":"\\eta","&#x3B6;":"\\zeta","&#x25B;":"\\varepsilon","&#x3B5;":"\\epsilon","&#x394;":"\\Delta","&#x3B4;":"\\delta","&#x393;":"\\Gamma","&#x3B3;":"\\gamma","&#x3B2;":"\\beta","&#x3B1;":"\\alpha","&#x221E;":"\\infty","\u202C":"\\text{\\textdir TRT}","\u200E":"\\text{\\textdir LTR}"}},8171:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.allMathSymbolsByGlyph=void 0,a.allMathSymbolsByGlyph={" ":"\\textrm{ }","\u2203":"\\exists","\u2200":"\\forall","\u21D4":"\\iff","\u21D2":"\\Rightarrow","\xAC":"\\neg","\u25A1":"\\square","\u22C4":"\\diamond","\u25B3":"\\triangle","\u2322":"\\frown","\u2220":"\\angle","\u22F1":"\\ddots","\u22EE":"\\vdots","\u2235":"\\because","\u2234":"\\therefore",\u2135:"\\aleph","\u2205":"\\emptyset","\xB1":"\\pm","\u2207":"\\nabla","\u2202":"\\partial","\u222E":"\\oint","\u222B":"\\int","\u22C3":"\\cup","\u222A":"\\cup","\u22C2":"\\cap","\u2229":"\\cap","\u22C1":"\\vee","\u2228":"\\vee","\u22C0":"\\wedge","\u2227":"\\wedge","\u220F":"\\prod","\u2211":"\\sum","\u2299":"\\bigodot","\u2297":"\\bigoplus","\u2295":"o+","\u2218":"@","\u22C8":"\\bowtie","\u22CA":"\\rtimes","\u22C9":"\\ltimes","\xF7":"\\div","\xD7":"\\times","\\":"\\backslash","\u22C6":"\\star","\u2217":"\\star","\u22C5":"\\cdot",\u03A9:"\\Omega",\u03C9:"\\omega",\u03A8:"\\Psi",\u03C8:"\\psi",\u03C7:"\\chi",\u03C6:"\\varphi",\u03A6:"\\Phi",\u03D5:"\\phi",\u03C5:"\\upsilon",\u03C4:"\\tau",\u03A3:"\\Sigma",\u03C3:"\\sigma",\u03C1:"\\rho",\u03A0:"\\Pi",\u03C0:"\\pi",\u039E:"\\Xi",\u03BE:"\\xi",\u03BD:"\\nu",\u03BC:"\\mu",\u039B:"\\Lambda",\u03BB:"\\lambda",\u03BA:"\\kappa",\u03B9:"\\iota",\u03D1:"\\vartheta",\u0398:"\\Theta",\u03B8:"\\theta",\u03B7:"\\eta",\u03B6:"\\zeta",\u025B:"\\varepsilon",\u03B5:"\\epsilon",\u0394:"\\Delta",\u03B4:"\\delta",\u0393:"\\Gamma",\u03B3:"\\gamma",\u03B2:"\\beta",\u03B1:"\\alpha","\u221E":"\\infty","\u03F5":"\\epsilon",\u00B5:"\\mu","\xB2":"^{2}",\u0131:"\\imath","\u220E":"\\blacksquare",\u0E21:"\\mathbf{m}",\u2126:"\\Omega","\u27F2":"\\circlearrowleft","\u27F3":"\\circlearrowright",\u0924:" ","\xA5":"\\yen","\u207D":"^{(}","\u207E":"^{)}",\u00DF:"\\ss",\u040B:"\\hbar","\u29B5":"\\ominus","\u22BF":"\\bigtriangleup","\u219B'":"\\nrightarrow","\u2020":"\\dagger",\u0E40:"\\prime",\u767D:" ","\u2FF1":" ",\u2138:"\\wp",\uD4F0:" ",\u207F:"^{n}","\u2714":"\\checkmark","\u2717":"\\times","\xBD":"\\dfrac{1}{2}",\u04E8:"\\theta","\u2713":"\\checkmark","\u27E9":"\\rangle","\u27E8":"\\langle","\u2329":"\\langle","\xBC":"\\dfrac{1}{4}","\u2026":"\\ldots",\u210F:"\\hbar",\u211C:"\\mathfrak{R}",\u0472:"\\theta",\u00D8:"\\emptyset",\u03F1:"\\varrho",\u0444:"\\phi",T:"T","\u2219":"\\cdot",\u03A1:"P",\u1401:"\\nabla",\u019E:"\\eta",\u0263:"\\gamma",\u045B:"\\hbar",\u0190:"\\varepsilon","\u2145":"\\_{D}","\u{1D706}":"\\lambda","\u3017":"\\rangle","\u3016":"\\langle","\u037E":";","\u{1D465}":"x","\u{1D466}":"y","\u{1D467}":"z","\u{1D456}":"i","\u{1D457}":"j","\u{1D458}":"k","\u{1D45A}":"m","\u{1D452}":"e","\u{1D45F}":"r",\u0273:"\\eta","\u{1D6FD}":"\\beta","\u2375":"\\omega","\u2118":"\\wp","\u{1D70B}":"\\pi",\u0404:"\\epsilon",\u0454:"\\epsilon","\u{1D700}":"\\epsilon",\u043F:"\\pi",\u039D:"\\nu",\u0275:"\\theta","\u{1D713}":"\\psi","\u03F4":"\\theta",\u0278:"\\phi","\u04F6":"\\Gamma",\u026D:"\\ell",\u028B:"\\upsilon","\u{1D6DF}":"\\varphi","\u236C":"\\theta",\u0424:"\\Phi","\u{1D711}":"\\varphi","\u2148":"i",\u03BF:"o",\u01A1:"o",\u0192:"f","\u2374":"\\rho","\u{1F1FD}":"x","\u{1D45D}":"p","\u{1D45E}":"q","\u{1D460}":"s","\u{1D461}":"t","\u{1D462}":"u","\u{1D463}":"v","\u{1D464}":"w","\u{1D44E}":"a","\u{1D44F}":"b","\u{1D450}":"c","\u{1D451}":"d","\u{1D453}":"f","\u{1D454}":"g","\u{1D459}":"l","\u{1D45B}":"n","\u{1D45C}":"o","\u{1D500}":"w","\u{1D69F}":"v",\u1E41:"m","\u0D66":"\\circ","\u2534":"\\perp","\u2715":"\\times","\u2223":"\\mid",\u0553:"\\Phi","\u239C":"\\mid",\u0127:"\\hbar",\u1348:" ","\u29A8":"\\llbracket",\u1EBF:"\\hat{e}","\xA2":"\\cent","\u2939":"\\downarrow","\u2938":"\\downarrow","\u2937":"\\Rsh","\u2936":"\\Lsh","\u2935":"\\downarrow","\u2934":"\\uparrow","\u2933":"\\rightarrow","|":"\\mid","\u23A5":"\\mid","\u2665":"\\heartsuit",\u041E:"0",\u03A5:"Y",\u0445:"x","\u{1D4CF}":"z","\u{1D4CE}":"y","\u{1D4CD}":"x",\u0440:"p",\u0430:"a","\xA3":"\\pounds",m:"m","\u{1D6B5}":"\\Xi","\u24EA":"\\textcircled{0}","\u2460":"\\textcircled{1}","\u2461":"\\textcircled{2}","\u2462":"\\textcircled{3}","\u2463":"\\textcircled{4}","\u2464":"\\textcircled{5}","\u2465":"\\textcircled{6}","\u2466":"\\textcircled{7}","\u2467":"\\textcircled{8}","\u2468":"\\textcircled{9}","\u2469":"\\textcircled{10}","\u246A":"\\textcircled{11}","\u246B":"\\textcircled{12}","\u246C":"\\textcircled{13}","\u246D":"\\textcircled{14}","\u246E":"\\textcircled{15}","\u246F":"\\textcircled{16}","\u2470":"\\textcircled{17}","\u2471":"\\textcircled{18}","\u2472":"\\textcircled{19}","\u2473":"\\textcircled{20}","\u3251":"\\textcircled{21}","\u3252":"\\textcircled{22}","\u3253":"\\textcircled{23}","\u3254":"\\textcircled{24}","\u3255":"\\textcircled{25}","\u3256":"\\textcircled{26}","\u3257":"\\textcircled{27}","\u3258":"\\textcircled{28}","\u3259":"\\textcircled{29}","\u325A":"\\textcircled{30}","\u325B":"\\textcircled{31}","\u325C":"\\textcircled{32}","\u325D":"\\textcircled{33}","\u325E":"\\textcircled{34}","\u325F":"\\textcircled{35}","\u32B1":"\\textcircled{36}","\u32B2":"\\textcircled{37}","\u32B3":"\\textcircled{38}","\u32B4":"\\textcircled{39}","\u32B5":"\\textcircled{40}","\u32B6":"\\textcircled{41}","\u32B7":"\\textcircled{42}","\u32B8":"\\textcircled{43}","\u32B9":"\\textcircled{44}","\u32BA":"\\textcircled{45}","\u32BB":"\\textcircled{46}","\u32BC":"\\textcircled{47}","\u32BD":"\\textcircled{48}","\u32BE":"\\textcircled{49}","\u32BF":"\\textcircled{50}","&":"\\&","\u2016":"\\parallel","%":"\\%","\u201C":"\\text{``}",$:"\\$","#":"\\#","\u2103":"\\text{\\textdegree C}","\u2109":"\\text{\\textdegree F}","\u2588":"\\blacksquare","\u2127":"\\mho","\u230B":"\\rfloor","\u230A":"\\lfloor","\u2309":"\\rceil","\u2308":"\\lceil",\u2107:"\\varepsilon","\u2147":"\\text{e}",\u027C:"r","\u219B":"\\nrightarrow","\u02C6":"\\hat{}","\u203E":"\\overline","\u2192":"\\rightarrow","\u2021":"\\ddagger","\u30FB":"\\cdot","\u25B1":"\\square","\u2206":"\\Delta",\u1F31:"i","\u2221":"\\angle",\u03D2:"\\Upsilon","\u2193":"\\downarrow","\u2191":"\\uparrow","\xBB":"\\gg","\u22A4":"\\top","\u29F8":"/","\u{1D6FF}":"\\delta","\u02F3":"\\cdot","\u0589":":","\u29AA":"\\measuredangle","\u29A9":"\\measuredangle","\u29AB":"\\measuredangle","\u2981":"\\cdot",\u0473:"\\theta","\u29A2":"\\measuredangle","\xB8":",","\u23BB":"\\overline","\u27E6":"\\llbracket","\u{1D719}":"\\phi",\u041F:"\\prod",\u043E:"o","\u2248":"\\approx","\u2264":"\\leq",\u0452:"\\hbar","\u0245":"\\Lambda",\u571F:"\\pm","\u23BC":"-",\u5341:"+","\u2260":"\\neq","\u2190":"\\leftarrow","\u0964":"\\mid","\u20AC":"\\euro","\u02D8":" ",\u1FE1:"\\bar{u}","\u2225":"\\parallel","\u2194":"\\leftrightarrow","\u221A":"\\sqrt{}","\u023C":"c","\u{1D7AE}":"\\epsilon","\xB7":"\\cdot","\u29AC":"\\measuredangle","\u29AE":"\\measuredangle","\u29AD":"\\measuredangle","\xAB":"\\ll",\u03A7:"\\mathsf{X}","\u2502":"\\mid","\u232A":"\\rangle","\u2099":"_{n}","\u25AB":"\\square","\u25CF":"\\circle","\u201D":'\\"'}},5406:function(i,a,o){"use strict";var l=this&&this.__createBinding||(Object.create?function(c,u,p,f){f===void 0&&(f=p);var d=Object.getOwnPropertyDescriptor(u,p);d&&!("get"in d?!u.__esModule:d.writable||d.configurable)||(d={enumerable:!0,get:function(){return u[p]}}),Object.defineProperty(c,f,d)}:function(c,u,p,f){f===void 0&&(f=p),c[f]=u[p]}),s=this&&this.__exportStar||function(c,u){for(var p in c)p==="default"||Object.prototype.hasOwnProperty.call(u,p)||l(u,c,p)};Object.defineProperty(a,"__esModule",{value:!0}),s(o(2965),a),s(o(9039),a),s(o(8249),a),s(o(8171),a),s(o(472),a),s(o(4320),a),s(o(6122),a)},472:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.latexAccents=void 0,a.latexAccents=["\\hat","\\bar","\\underbrace","\\overbrace"]},4320:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.mathNumberByGlyph=void 0,a.mathNumberByGlyph={"\u2080":"_{0}","\u2081":"_{1}","\u2082":"_{2}","\u2083":"_{3}","\u2084":"_{4}","\u2085":"_{5}","\u2086":"_{6}","\u2087":"_{7}","\u2088":"_{8}","\u2089":"_{9}","\u2070":"^{0}","\xB9":"^{1}","\xB2":"^{2}","\xB3":"^{3}","\u2074":"^{4}","\u2075":"^{5}","\u2076":"^{6}","\u2077":"^{7}","\u2078":"^{8}","\u2079":"^{9}",\u207F:"^{n}","\u2099":"_{n}","\u24EA":"\\textcircled{0}","\u2460":"\\textcircled{1}","\u2461":"\\textcircled{2}","\u2462":"\\textcircled{3}","\u2463":"\\textcircled{4}","\u2464":"\\textcircled{5}","\u2465":"\\textcircled{6}","\u2466":"\\textcircled{7}","\u2467":"\\textcircled{8}","\u2468":"\\textcircled{9}","\u2469":"\\textcircled{10}","\u246A":"\\textcircled{11}","\u246B":"\\textcircled{12}","\u246C":"\\textcircled{13}","\u246D":"\\textcircled{14}","\u246E":"\\textcircled{15}","\u246F":"\\textcircled{16}","\u2470":"\\textcircled{17}","\u2471":"\\textcircled{18}","\u2472":"\\textcircled{19}","\u2473":"\\textcircled{20}","\u3251":"\\textcircled{21}","\u3252":"\\textcircled{22}","\u3253":"\\textcircled{23}","\u3254":"\\textcircled{24}","\u3255":"\\textcircled{25}","\u3256":"\\textcircled{26}","\u3257":"\\textcircled{27}","\u3258":"\\textcircled{28}","\u3259":"\\textcircled{29}","\u325A":"\\textcircled{30}","\u325B":"\\textcircled{31}","\u325C":"\\textcircled{32}","\u325D":"\\textcircled{33}","\u325E":"\\textcircled{34}","\u325F":"\\textcircled{35}","\u32B1":"\\textcircled{36}","\u32B2":"\\textcircled{37}","\u32B3":"\\textcircled{38}","\u32B4":"\\textcircled{39}","\u32B5":"\\textcircled{40}","\u32B6":"\\textcircled{41}","\u32B7":"\\textcircled{42}","\u32B8":"\\textcircled{43}","\u32B9":"\\textcircled{44}","\u32BA":"\\textcircled{45}","\u32BB":"\\textcircled{46}","\u32BC":"\\textcircled{47}","\u32BD":"\\textcircled{48}","\u32BE":"\\textcircled{49}","\u32BF":"\\textcircled{50}","\xBD":"\\dfrac{1}{2}","\u2153":"\\dfrac{1}{3}","\u2154":"\\dfrac{2}{3}","\xBC":"\\dfrac{1}{4}","\xBE":"\\dfrac{3}{4}","\u2155":"\\dfrac{1}{5}","\u2156":"\\dfrac{2}{5}","\u2157":"\\dfrac{3}{5}","\u2158":"\\dfrac{4}{5}","\u2159":"\\dfrac{1}{6}","\u215A":"\\dfrac{5}{6}","\u2150":"\\dfrac{1}{7}","\u215B":"\\dfrac{1}{8}","\u215C":"\\dfrac{3}{8}","\u215D":"\\dfrac{5}{8}","\u215E":"\\dfrac{7}{8}","\u2151":"\\dfrac{1}{9}","\u2152":"\\dfrac{1}{10}"}},6122:(i,a)=>{"use strict";Object.defineProperty(a,"__esModule",{value:!0}),a.HashUTF8ToLtXConverter=void 0,a.HashUTF8ToLtXConverter=class{convert(c){if(c.match(/[a-z0-9]/i))return c;let u=o[c];return u?this.convertAccentCharToLtX(u)||c:this.convertSpecialCharToLtX(c)||c}convertAccentCharToLtX(c){let{char:u,accent:p}=c,f=l[p];return f?`\\${f}{${u}}`:null}convertSpecialCharToLtX(c){let u=s[c];if(!u)return null;let{letter:p,fontCmd:f}=u;return`\\${f}{${p}}`}};let o={\u00E1:{char:"a",accent:"\xB4"},\u00E0:{char:"a",accent:"`"},\u00E2:{char:"a",accent:"^"},\u00E3:{char:"a",accent:"~"},\u00E4:{char:"a",accent:"\xA8"},\u00E5:{char:"a",accent:"\u02DA"},\u0105:{char:"a",accent:"\u02D9"},\u0103:{char:"a",accent:"\u02D8"},\u01CE:{char:"a",accent:"\u02C7"},\u01DF:{char:"a",accent:"\u02C6"},\u01FB:{char:"a",accent:"\u02D9"},\u01E1:{char:"a",accent:"-"},\u0101:{char:"a",accent:"-"},\u00E9:{char:"e",accent:"\xB4"},\u00E8:{char:"e",accent:"`"},\u00EA:{char:"e",accent:"^"},\u00EB:{char:"e",accent:"\xA8"},\u0119:{char:"e",accent:"\u02D9"},\u011B:{char:"e",accent:"\u02C7"},\u0207:{char:"i",accent:"^"},\u0451:{char:"e",accent:"\xA8"},\u0113:{char:"e",accent:"-"},\u00ED:{char:"i",accent:"\xB4"},\u00EC:{char:"i",accent:"`"},\u00EE:{char:"i",accent:"^"},\u00EF:{char:"i",accent:"\xA8"},\u012F:{char:"i",accent:"\u02D9"},\u01D0:{char:"i",accent:"\u02C7"},\u0209:{char:"i",accent:"`"},\u020B:{char:"i",accent:"\xA8"},\u012B:{char:"i",accent:"-"},\u00F3:{char:"o",accent:"\xB4"},\u00F2:{char:"o",accent:"`"},\u00F4:{char:"o",accent:"^"},\u00F5:{char:"o",accent:"~"},\u00F6:{char:"o",accent:"\xA8"},\u0151:{char:"o",accent:"\u02DD"},\u01D2:{char:"o",accent:"\u02C7"},\u020D:{char:"o",accent:"`"},\u020F:{char:"o",accent:"\xA8"},\u022B:{char:"o",accent:"\u02D8"},\u022D:{char:"o",accent:"\u02DD"},\u022F:{char:"o",accent:"\u02D9"},\u014D:{char:"o",accent:"-"},\u00FA:{char:"u",accent:"\xB4"},\u00F9:{char:"u",accent:"`"},\u00FB:{char:"u",accent:"^"},\u00FC:{char:"u",accent:"\xA8"},\u0171:{char:"u",accent:"\u02DD"},\u01D4:{char:"u",accent:"\u02C7"},\u01D6:{char:"u",accent:"\xA8"},\u01D8:{char:"u",accent:"\xA8"},\u01DA:{char:"u",accent:"\xA8"},\u01DC:{char:"u",accent:"\xA8"},\u0215:{char:"u",accent:"`"},\u0217:{char:"u",accent:"\xA8"},\u016B:{char:"u",accent:"-"},\u00FD:{char:"y",accent:"\xB4"},\u1EF3:{char:"y",accent:"`"},\u0177:{char:"y",accent:"^"},\u00FF:{char:"y",accent:"\xA8"},\u0233:{char:"y",accent:"-"},\u00C1:{char:"A",accent:"\xB4"},\u00C0:{char:"A",accent:"`"},\u00C2:{char:"A",accent:"^"},\u00C3:{char:"A",accent:"~"},\u00C4:{char:"A",accent:"\xA8"},\u00C5:{char:"A",accent:"\u02DA"},\u212B:{char:"A",accent:"\u02DA"},\u0226:{char:"A",accent:"\u02D9"},\u0102:{char:"A",accent:"\u02D8"},\u01CD:{char:"A",accent:"\u02C7"},\u01DE:{char:"A",accent:"\u02DD"},\u01FA:{char:"A",accent:"\u02DA"},\u01E0:{char:"A",accent:"-"},\u0100:{char:"A",accent:"-"},\u00C9:{char:"E",accent:"\xB4"},\u00C8:{char:"E",accent:"`"},\u0116:{char:"E",accent:"\u02D9"},\u00CA:{char:"E",accent:"^"},\u00CB:{char:"E",accent:"\xA8"},\u011A:{char:"E",accent:"\u02C7"},\u0204:{char:"E",accent:"`"},\u0206:{char:"E",accent:"\xA8"},\u0112:{char:"E",accent:"-"},\u00CD:{char:"I",accent:"\xB4"},\u00CC:{char:"I",accent:"`"},\u00CE:{char:"I",accent:"^"},\u00CF:{char:"I",accent:"\xA8"},\u012C:{char:"I",accent:"\u02D8"},\u01CF:{char:"I",accent:"\u02C7"},\u0208:{char:"I",accent:"`"},\u020A:{char:"I",accent:"\xA8"},\u012A:{char:"I",accent:"-"},\u00D3:{char:"O",accent:"\xB4"},\u00D2:{char:"O",accent:"`"},\u00D4:{char:"O",accent:"^"},\u00D5:{char:"O",accent:"~"},\u00D6:{char:"O",accent:"\xA8"},\u0150:{char:"O",accent:"\u02DD"},\u01D1:{char:"O",accent:"\u02C7"},\u020C:{char:"O",accent:"`"},\u020E:{char:"O",accent:"\xA8"},\u022A:{char:"O",accent:"\u02D8"},\u022C:{char:"O",accent:"\u02DD"},\u022E:{char:"O",accent:"\u02D9"},\u014C:{char:"O",accent:"-"},\u00DA:{char:"U",accent:"\xB4"},\u00D9:{char:"U",accent:"`"},\u00DB:{char:"U",accent:"^"},\u00DC:{char:"U",accent:"\xA8"},\u0170:{char:"U",accent:"\u02DD"},\u01D3:{char:"U",accent:"\u02C7"},\u01D5:{char:"U",accent:"\xA8"},\u0214:{char:"U",accent:"`"},\u0216:{char:"U",accent:"\xA8"},\u016A:{char:"U",accent:"-"},\u00DD:{char:"Y",accent:"\xB4"},\u1EF2:{char:"Y",accent:"`"},\u0176:{char:"Y",accent:"^"},\u0178:{char:"Y",accent:"\xA8"},\u0232:{char:"Y",accent:"-"},\u00F1:{char:"n",accent:"~"},\u00D1:{char:"N",accent:"~"},\u00E7:{char:"c",accent:"\u02D9"},\u00C7:{char:"C",accent:"\u02D9"},\u1E7D:{char:"v",accent:"~"},\u1E7C:{char:"V",accent:"~"},\u0135:{char:"j",accent:"^"},\u0134:{char:"J",accent:"^"},\u017A:{char:"z",accent:"\xB4"},\u0179:{char:"Z",accent:"\xB4"},\u017B:{char:"Z",accent:"^"},\u017C:{char:"z",accent:"^"},\u017D:{char:"Z",accent:"\u02C7"},\u017E:{char:"z",accent:"\u02C7"},\u1E91:{char:"z",accent:"\u02C6"}},l={"\xB4":"acute","`":"grave","^":"hat","~":"tilde","\xA8":"ddot","\u02DA":"mathring","\u02D8":"breve","\u02C7":"check","\u02DD":"H","\u02D9":"dot","-":"bar","\u02C6":"hat","\u02DC":"tilde"},s={"\u{1D400}":{letter:"A",fontCmd:"mathbf"},"\u{1D401}":{letter:"B",fontCmd:"mathbf"},"\u{1D402}":{letter:"C",fontCmd:"mathbf"},"\u{1D403}":{letter:"D",fontCmd:"mathbf"},"\u{1D404}":{letter:"E",fontCmd:"mathbf"},\u0395:{letter:"E",fontCmd:"mathbf"},"\u{1D405}":{letter:"F",fontCmd:"mathbf"},"\u{1D406}":{letter:"G",fontCmd:"mathbf"},"\u{1D407}":{letter:"H",fontCmd:"mathbf"},"\u{1D408}":{letter:"I",fontCmd:"mathbf"},"\u{1D409}":{letter:"J",fontCmd:"mathbf"},"\u{1D40A}":{letter:"K",fontCmd:"mathbf"},"\u{1D40B}":{letter:"L",fontCmd:"mathbf"},"\u{1D40C}":{letter:"M",fontCmd:"mathbf"},"\u{1D40D}":{letter:"N",fontCmd:"mathbf"},"\u{1D40E}":{letter:"O",fontCmd:"mathbf"},"\u{1D40F}":{letter:"P",fontCmd:"mathbf"},"\u{1D410}":{letter:"Q",fontCmd:"mathbf"},"\u{1D411}":{letter:"R",fontCmd:"mathbf"},"\u{1D412}":{letter:"S",fontCmd:"mathbf"},"\u{1D413}":{letter:"T",fontCmd:"mathbf"},"\u{1D414}":{letter:"U",fontCmd:"mathbf"},"\u{1D415}":{letter:"V",fontCmd:"mathbf"},"\u{1D416}":{letter:"W",fontCmd:"mathbf"},"\u{1D417}":{letter:"X",fontCmd:"mathbf"},"\u{1D786}":{letter:"X",fontCmd:"mathbf"},"\u{1D418}":{letter:"Y",fontCmd:"mathbf"},"\u{1D419}":{letter:"Z",fontCmd:"mathbf"},"\u{1D7CE}":{letter:"0",fontCmd:"mathbf"},"\u{1D7CF}":{letter:"1",fontCmd:"mathbf"},"\u{1D7D0}":{letter:"2",fontCmd:"mathbf"},"\u{1D7D1}":{letter:"3",fontCmd:"mathbf"},"\u{1D7D2}":{letter:"4",fontCmd:"mathbf"},"\u{1D7D3}":{letter:"5",fontCmd:"mathbf"},"\u{1D7D4}":{letter:"6",fontCmd:"mathbf"},"\u{1D7D5}":{letter:"7",fontCmd:"mathbf"},"\u{1D7D6}":{letter:"8",fontCmd:"mathbf"},"\u{1D7D7}":{letter:"9",fontCmd:"mathbf"},"\u{1D434}":{letter:"A",fontCmd:"mathit"},"\u{1D435}":{letter:"B",fontCmd:"mathit"},"\u{1D436}":{letter:"C",fontCmd:"mathit"},"\u{1D437}":{letter:"D",fontCmd:"mathit"},"\u{1D438}":{letter:"E",fontCmd:"mathit"},"\u{1D439}":{letter:"F",fontCmd:"mathit"},"\u{1D43A}":{letter:"G",fontCmd:"mathit"},"\u{1D43B}":{letter:"H",fontCmd:"mathit"},"\u{1D43C}":{letter:"I",fontCmd:"mathit"},\u0399:{letter:"I",fontCmd:"mathit"},"\u{1D43D}":{letter:"J",fontCmd:"mathit"},"\u{1D43E}":{letter:"K",fontCmd:"mathit"},"\u{1D43F}":{letter:"L",fontCmd:"mathit"},"\u{1D440}":{letter:"M",fontCmd:"mathit"},"\u{1D441}":{letter:"N",fontCmd:"mathit"},"\u{1D442}":{letter:"O",fontCmd:"mathit"},"\u{1D443}":{letter:"P",fontCmd:"mathit"},"\u{1D444}":{letter:"Q",fontCmd:"mathit"},"\u{1D445}":{letter:"R",fontCmd:"mathit"},"\u{1D446}":{letter:"S",fontCmd:"mathit"},"\u{1D447}":{letter:"T",fontCmd:"mathit"},"\u{1D448}":{letter:"U",fontCmd:"mathit"},"\u{1D449}":{letter:"V",fontCmd:"mathit"},"\u{1D44A}":{letter:"W",fontCmd:"mathit"},"\u{1D44B}":{letter:"X",fontCmd:"mathit"},"\u{1D44C}":{letter:"Y",fontCmd:"mathit"},"\u{1D44D}":{letter:"Z",fontCmd:"mathit"},"\u{1D538}":{letter:"A",fontCmd:"mathbb"},"\u{1D539}":{letter:"B",fontCmd:"mathbb"},\u2102:{letter:"C",fontCmd:"mathbb"},"\u{1D53B}":{letter:"D",fontCmd:"mathbb"},"\u{1D53C}":{letter:"E",fontCmd:"mathbb"},"\u{1D53D}":{letter:"F",fontCmd:"mathbb"},"\u{1D53E}":{letter:"G",fontCmd:"mathbb"},\u210D:{letter:"H",fontCmd:"mathbb"},"\u{1D540}":{letter:"I",fontCmd:"mathbb"},"\u{1D541}":{letter:"J",fontCmd:"mathbb"},"\u{1D542}":{letter:"K",fontCmd:"mathbb"},"\u{1D543}":{letter:"L",fontCmd:"mathbb"},"\u{1D544}":{letter:"M",fontCmd:"mathbb"},\u2115:{letter:"N",fontCmd:"mathbb"},"\u{1D546}":{letter:"O",fontCmd:"mathbb"},\u2119:{letter:"P",fontCmd:"mathbb"},\u211A:{letter:"Q",fontCmd:"mathbb"},\u211D:{letter:"R",fontCmd:"mathbb"},"\u{1D54A}":{letter:"S",fontCmd:"mathbb"},"\u{1D54B}":{letter:"T",fontCmd:"mathbb"},"\u{1D54C}":{letter:"U",fontCmd:"mathbb"},"\u{1D54D}":{letter:"V",fontCmd:"mathbb"},"\u{1D54E}":{letter:"W",fontCmd:"mathbb"},"\u{1D54F}":{letter:"X",fontCmd:"mathbb"},"\u{1D550}":{letter:"Y",fontCmd:"mathbb"},\u2124:{letter:"Z",fontCmd:"mathbb"},"\u{1D7D8}":{letter:"0",fontCmd:"mathbb"},"\u{1D7D9}":{letter:"1",fontCmd:"mathbb"},"\u{1D7DA}":{letter:"2",fontCmd:"mathbb"},"\u{1D7DB}":{letter:"3",fontCmd:"mathbb"},"\u{1D7DC}":{letter:"4",fontCmd:"mathbb"},"\u{1D7DD}":{letter:"5",fontCmd:"mathbb"},"\u{1D7DE}":{letter:"6",fontCmd:"mathbb"},"\u{1D7DF}":{letter:"7",fontCmd:"mathbb"},"\u{1D7E0}":{letter:"8",fontCmd:"mathbb"},"\u{1D7E1}":{letter:"9",fontCmd:"mathbb"},"\u{1D49C}":{letter:"A",fontCmd:"mathcal"},"\u{1D4D0}":{letter:"A",fontCmd:"mathcal"},\u212C:{letter:"B",fontCmd:"mathcal"},"\u{1D49E}":{letter:"C",fontCmd:"mathcal"},"\u{1D49F}":{letter:"D",fontCmd:"mathcal"},"\u{1D4D3}":{letter:"D",fontCmd:"mathcal"},\u2130:{letter:"E",fontCmd:"mathcal"},\u2131:{letter:"F",fontCmd:"mathcal"},"\u{1D4D5}":{letter:"F",fontCmd:"mathcal"},"\u{1D4A2}":{letter:"G",fontCmd:"mathcal"},\u210B:{letter:"H",fontCmd:"mathcal"},\u2110:{letter:"I",fontCmd:"mathcal"},"\u{1D4A5}":{letter:"J",fontCmd:"mathcal"},"\u{1D4A6}":{letter:"K",fontCmd:"mathcal"},\u2112:{letter:"L",fontCmd:"mathcal"},"\u{1D4DB}":{letter:"L",fontCmd:"mathcal"},\u2133:{letter:"M",fontCmd:"mathcal"},"\u{1D4A9}":{letter:"N",fontCmd:"mathcal"},"\u{1D4AA}":{letter:"O",fontCmd:"mathcal"},"\u{1D4DE}":{letter:"O",fontCmd:"mathcal"},"\u{1D4AB}":{letter:"P",fontCmd:"mathcal"},"\u{1D4AC}":{letter:"Q",fontCmd:"mathcal"},\u211B:{letter:"R",fontCmd:"mathcal"},"\u{1D57D}":{letter:"R",fontCmd:"mathcal"},"\u211F":{letter:"R",fontCmd:"mathcal"},"\u{1D4AE}":{letter:"S",fontCmd:"mathcal"},"\u{1D4AF}":{letter:"T",fontCmd:"mathcal"},"\u{1D4B0}":{letter:"U",fontCmd:"mathcal"},"\u{1D4B1}":{letter:"V",fontCmd:"mathcal"},"\u{1D4B2}":{letter:"W",fontCmd:"mathcal"},"\u{1D4B3}":{letter:"X",fontCmd:"mathcal"},"\u{1D4B4}":{letter:"Y",fontCmd:"mathcal"},"\u{1D4B5}":{letter:"Z",fontCmd:"mathcal"},"\u{1D504}":{letter:"A",fontCmd:"mathfrak"},"\u{1D505}":{letter:"B",fontCmd:"mathfrak"},\u212D:{letter:"C",fontCmd:"mathfrak"},"\u{1D507}":{letter:"D",fontCmd:"mathfrak"},"\u{1D508}":{letter:"E",fontCmd:"mathfrak"},"\u{1D509}":{letter:"F",fontCmd:"mathfrak"},"\u{1D50A}":{letter:"G",fontCmd:"mathfrak"},\u210C:{letter:"H",fontCmd:"mathfrak"},\u2111:{letter:"I",fontCmd:"mathfrak"},"\u{1D50D}":{letter:"J",fontCmd:"mathfrak"},"\u{1D50E}":{letter:"K",fontCmd:"mathfrak"},"\u{1D50F}":{letter:"L",fontCmd:"mathfrak"},"\u{1D510}":{letter:"M",fontCmd:"mathfrak"},"\u{1D511}":{letter:"N",fontCmd:"mathfrak"},"\u{1D512}":{letter:"O",fontCmd:"mathfrak"},"\u{1D513}":{letter:"P",fontCmd:"mathfrak"},"\u{1D514}":{letter:"Q",fontCmd:"mathfrak"},\u211C:{letter:"R",fontCmd:"mathfrak"},"\u{1D516}":{letter:"S",fontCmd:"mathfrak"},"\u{1D517}":{letter:"T",fontCmd:"mathfrak"},"\u{1D518}":{letter:"U",fontCmd:"mathfrak"},"\u{1D519}":{letter:"V",fontCmd:"mathfrak"},"\u{1D51A}":{letter:"W",fontCmd:"mathfrak"},"\u{1D51B}":{letter:"X",fontCmd:"mathfrak"},"\u{1D51C}":{letter:"Y",fontCmd:"mathfrak"},\u2128:{letter:"Z",fontCmd:"mathfrak"},"\u{1D5A0}":{letter:"A",fontCmd:"mathsf"},\u0391:{letter:"A",fontCmd:"mathsf"},"\u{1D5A1}":{letter:"B",fontCmd:"mathsf"},\u0392:{letter:"B",fontCmd:"mathsf"},"\u{1D5A2}":{letter:"C",fontCmd:"mathsf"},"\u{1D5A3}":{letter:"D",fontCmd:"mathsf"},"\u{1D5A4}":{letter:"E",fontCmd:"mathsf"},"\u{1D5A5}":{letter:"F",fontCmd:"mathsf"},"\u{1D5A6}":{letter:"G",fontCmd:"mathsf"},"\u{1D5A7}":{letter:"H",fontCmd:"mathsf"},"\u{1D5A8}":{letter:"I",fontCmd:"mathsf"},"\u{1D5A9}":{letter:"J",fontCmd:"mathsf"},"\u0237":{letter:"J",fontCmd:"mathsf"},"\u{1D5AA}":{letter:"K",fontCmd:"mathsf"},\u039A:{letter:"K",fontCmd:"mathsf"},"\u{1D5AB}":{letter:"L",fontCmd:"mathsf"},"\u{1D5AC}":{letter:"M",fontCmd:"mathsf"},"\u{1D5AD}":{letter:"N",fontCmd:"mathsf"},"\u{1D5AE}":{letter:"O",fontCmd:"mathsf"},"\u{1D5AF}":{letter:"P",fontCmd:"mathsf"},"\u{1D5B0}":{letter:"Q",fontCmd:"mathsf"},"\u{1D5B1}":{letter:"R",fontCmd:"mathsf"},"\u{1D5B2}":{letter:"S",fontCmd:"mathsf"},"\u{1D5B3}":{letter:"T",fontCmd:"mathsf"},"\u{1D5B4}":{letter:"U",fontCmd:"mathsf"},"\u{1D5B5}":{letter:"V",fontCmd:"mathsf"},"\u{1D5B6}":{letter:"W",fontCmd:"mathsf"},"\u{1D5B7}":{letter:"X",fontCmd:"mathsf"},\u03A7:{letter:"X",fontCmd:"mathsf"},"\u{1D5B8}":{letter:"Y",fontCmd:"mathsf"},"\u{1D5B9}":{letter:"Z",fontCmd:"mathsf"},"\u{1D6A8}":{letter:"A",fontCmd:"mathtt"},"\u{1D6A9}":{letter:"B",fontCmd:"mathtt"},"\u{1D6AA}":{letter:"\\Gamma",fontCmd:"mathtt"},"\u{1D6AB}":{letter:"\\Delta",fontCmd:"mathtt"},"\u{1D6AC}":{letter:"E",fontCmd:"mathtt"},"\u{1D6AD}":{letter:"F",fontCmd:"mathtt"},"\u{1D6AE}":{letter:"G",fontCmd:"mathtt"},"\u{1D6AF}":{letter:"\\Theta",fontCmd:"mathtt"},"\u{1D6B0}":{letter:"I",fontCmd:"mathtt"},"\u{1D6B1}":{letter:"J",fontCmd:"mathtt"},"\u{1D6B2}":{letter:"\\Lambda",fontCmd:"mathtt"},"\u{1D6B3}":{letter:"L",fontCmd:"mathtt"},"\u{1D6B4}":{letter:"M",fontCmd:"mathtt"},"\u{1D6B5}":{letter:"\\Pi",fontCmd:"mathtt"},"\u{1D6B6}":{letter:"O",fontCmd:"mathtt"},"\u{1D6B7}":{letter:"\\Pi",fontCmd:"mathtt"},"\u{1D6B8}":{letter:"Q",fontCmd:"mathtt"},"\u{1D6B9}":{letter:"R",fontCmd:"mathtt"},"\u{1D6BA}":{letter:"S",fontCmd:"mathtt"},"\u{1D6BB}":{letter:"T",fontCmd:"mathtt"},"\u{1D6BC}":{letter:"U",fontCmd:"mathtt"},"\u{1D6BD}":{letter:"\\Phi",fontCmd:"mathtt"},"\u{1D6BE}":{letter:"W",fontCmd:"mathtt"},"\u{1D6BF}":{letter:"\\Psi",fontCmd:"mathtt"},"\u{1D6C0}":{letter:"\\Omega",fontCmd:"mathtt"}}}},t={};function e(i){var a=t[i];if(a!==void 0)return a.exports;var o=t[i]={exports:{}};return r[i].call(o.exports,o,o.exports,e),o.exports}var n={};return(()=>{"use strict";var i=n;Object.defineProperty(i,"__esModule",{value:!0}),i.MathMLToLaTeX=void 0;var a=e(8672);Object.defineProperty(i,"MathMLToLaTeX",{enumerable:!0,get:function(){return a.MathMLToLaTeX}})})(),n})())});var r1={};ot(r1,{ATTACHMENT_EXTS:()=>qn,AUTH_REDIRECT_URI:()=>Uo,ImportContext:()=>Ko,ImporterModal:()=>Vi,default:()=>Xo});module.exports=Ug(r1);var Fr=require("obsidian");var Fe=require("obsidian");var lr=class{constructor(t){this.importer=t,this.app=t.app}};var Zn=class extends lr{constructor(t,e){super(t),this.scan=e.mergableDataObject,this.objects=this.scan.mergeableDataObjectData.mergeableDataObjectEntry}async format(t,e){let n=[];for(let i of this.objects){if(!i.customMap)continue;let a=i.customMap.mapEntry[0].value.stringValue,o=await this.importer.database.get`
SELECT z_pk, zmedia, ztypeuti FROM ziccloudsyncingobject
WHERE zidentifier = ${a}`,l=await this.importer.resolveAttachment(o.Z_PK,"com.apple.notes.gallery");if(l||(l=await this.importer.resolveAttachment(o.ZMEDIA,o.ZTYPEUTI)),l)n.push(this.importer.app.fileManager.generateMarkdownLink(l,e));else return"**Cannot decode scan**"}return`
${n.join(`
`)}
`}};Zn.protobufType="ciofecaforensics.MergableDataProto";var Kn=class extends lr{constructor(e,n){super(e);this.rowLocations={};this.columnLocations={};this.table=n.mergableDataObject;let i=this.table.mergeableDataObjectData;this.keys=i.mergeableDataObjectKeyItem,this.types=i.mergeableDataObjectTypeItem,this.uuids=i.mergeableDataObjectUuidItem.map(this.uuidToString),this.objects=i.mergeableDataObjectEntry}async parse(){let e=this.objects.find(i=>i.customMap&&this.types[i.customMap.type]=="com.apple.notes.ICTable");if(!e)return null;let n=null;for(let i of e.customMap.mapEntry){let a=this.objects[i.value.objectIndex];switch(this.keys[i.key]){case"crRows":[this.rowLocations,this.rowCount]=this.findLocations(a);break;case"crColumns":[this.columnLocations,this.columnCount]=this.findLocations(a);break;case"cellColumns":n=a;break}}return n?await this.computeCells(n):null}findLocations(e){let n=[],i={};for(let a of e.orderedSet.ordering.array.attachment)n.push(this.uuidToString(a.uuid));for(let a of e.orderedSet.ordering.contents.element){let o=this.getTargetUuid(a.key),l=this.getTargetUuid(a.value);i[l]=n.indexOf(o)}return[i,n.length]}async computeCells(e){let n=Array(this.rowCount).fill(0).map(()=>Array(this.columnCount));for(let i of e.dictionary.element){let a=this.columnLocations[this.getTargetUuid(i.key)],o=this.objects[i.value.objectIndex];for(let l of o.dictionary.element){let s=this.rowLocations[this.getTargetUuid(l.key)],c=this.objects[l.value.objectIndex];if(!(s in n)||!c)continue;let u=new Br(this.importer,c);n[s][a]=await u.format(!0)}}return n}async format(){let e=await this.parse();if(!e)return"";let n=`
`;for(let i=0;i<e.length;i++)n+=`| ${e[i].join(" | ")} |
`,i==0&&(n+=`|${" -- |".repeat(e[0].length)}
`);return n+`
`}getTargetUuid(e){let i=this.objects[e.objectIndex].customMap.mapEntry[0].value.unsignedIntegerValue;return this.uuids[i]}uuidToString(e){return Buffer.from(e).toString("hex")}};Kn.protobufType="ciofecaforensics.MergableDataProto";var Hg=/(^\s+|(?:\s+)?\n(?:\s+)?|\s+$)/,is=/applenotes:note\/([-0-9a-f]+)(?:\?ownerIdentifier=.*)?/,Wg=".AppleColorEmojiUI",Ic=[100,101,102,103],Br=class extends lr{constructor(e,n){super(e);this.listNumber=0;this.listIndent=0;this.multiRun=0;this.note=n.note}parseTokens(){let e=0,n=0,i=0,a=[];for(;e<this.note.attributeRun.length;){let o,l="",s=!0;do o=this.note.attributeRun[e],i=i+o.length,l+=this.note.noteText.substring(n,i),n=i,s=e==this.note.attributeRun.length-1?!1:Fc(o,this.note.attributeRun[e+1]),e++;while(s);for(let c of l.split(Hg))c&&a.push({attr:o,fragment:c})}return a}async format(e=!1,n=""){var l;let i=this.parseTokens(),a=!e&&this.importer.omitFirstLine&&this.note.noteText.contains(`
`),o="";for(let s=0;s<i.length;s++){let{attr:c,fragment:u}=i[s];if(a)if(u.contains(`
`)||c.attachmentInfo)a=!1;else continue;c.fragment=u,c.atLineStart=s==0?!0:(l=i[s-1])==null?void 0:l.fragment.contains(`
`),o+=this.formatMultiRun(c),!/\S/.test(c.fragment)||this.multiRun==1?o+=c.fragment:c.attachmentInfo?o+=await this.formatAttachment(c,n):c.superscript||c.underlined||c.color||c.font||this.multiRun==2?o+=await this.formatHtmlAttr(c):o+=await this.formatAttr(c)}return this.multiRun!=0&&(o+=this.formatMultiRun({})),e&&o.replace(`
`,"<br>").replace("|","&#124;"),o.trim()}formatMultiRun(e){var a,o,l,s,c,u;let n=(a=e.paragraphStyle)==null?void 0:a.styleType,i="";switch(this.multiRun){case 3:(((o=e.paragraphStyle)==null?void 0:o.indentAmount)==0&&!Ic.includes(n)||Vg(e))&&(this.multiRun=0);break;case 1:n!=4&&(this.multiRun=0,i+="```\n");break;case 2:(l=e.paragraphStyle)!=null&&l.alignment||(this.multiRun=0,i+=`</p>
`);break}if(this.multiRun==0){if(n==4)this.multiRun=1,i+="\n```\n";else if(Ic.includes(n))this.multiRun=3,(s=e.paragraphStyle)!=null&&s.indentAmount&&(i+=`
- &nbsp;
`);else if((c=e.paragraphStyle)!=null&&c.alignment){this.multiRun=2;let p=this.convertAlign((u=e==null?void 0:e.paragraphStyle)==null?void 0:u.alignment);i+=`
<p style="text-align:${p};margin:0">`}}return i}async formatHtmlAttr(e){var i,a;e.strikethrough&&(e.fragment=`<s>${e.fragment}</s>`),e.underlined&&(e.fragment=`<u>${e.fragment}</u>`),e.superscript==1&&(e.fragment=`<sup>${e.fragment}</sup>`),e.superscript==-1&&(e.fragment=`<sub>${e.fragment}</sub>`);let n="";switch(e.fontWeight){case 1:e.fragment=`<b>${e.fragment}</b>`;break;case 2:e.fragment=`<i>${e.fragment}</i>`;break;case 3:e.fragment=`<b><i>${e.fragment}</i></b>`;break}return(i=e.font)!=null&&i.fontName&&e.font.fontName!==Wg&&(n+=`font-family:${e.font.fontName};`),(a=e.font)!=null&&a.pointSize&&(n+=`font-size:${e.font.pointSize}pt;`),e.color&&(n+=`color:${this.convertColor(e.color)};`),e.link&&!is.test(e.link)?(n&&(n=` style="${n}"`),e.fragment=`<a href="${e.link}" rel="noopener" class="external-link" target="_blank"${n}>${e.fragment}</a>`):n&&(e.link&&(e.fragment=await this.getInternalLink(e.link,e.fragment)),e.fragment=`<span style="${n}">${e.fragment}</span>`),e.atLineStart?this.formatParagraph(e):e.fragment}async formatAttr(e){switch(e.fragment=e.fragment.replace(/([\[\]])/g,"\\$1"),e.fontWeight){case 1:e.fragment=`**${e.fragment}**`;break;case 2:e.fragment=`*${e.fragment}*`;break;case 3:e.fragment=`***${e.fragment}***`;break}return e.strikethrough&&(e.fragment=`~~${e.fragment}~~`),e.link&&e.link!=e.fragment&&(is.test(e.link)?e.fragment=await this.getInternalLink(e.link,e.fragment):e.fragment=`[${e.fragment}](${e.link})`),e.atLineStart?this.formatParagraph(e):e.fragment}formatParagraph(e){var o,l,s,c,u,p;let n=" ".repeat(((o=e.paragraphStyle)==null?void 0:o.indentAmount)||0),i=(l=e.paragraphStyle)==null?void 0:l.styleType,a=(s=e.paragraphStyle)!=null&&s.blockquote?"> ":"";switch(this.listNumber!=0&&(i!==102||this.listIndent!==((c=e.paragraphStyle)==null?void 0:c.indentAmount))&&(this.listIndent=((u=e.paragraphStyle)==null?void 0:u.indentAmount)||0,this.listNumber=0),i){case 0:return`${a}# ${e.fragment}`;case 1:return`${a}## ${e.fragment}`;case 2:return`${a}### ${e.fragment}`;case 101:case 100:return`${a}${n}- ${e.fragment}`;case 102:return this.listNumber++,`${a}${n}${this.listNumber}. ${e.fragment}`;case 103:let f=(p=e.paragraphStyle.checklist)!=null&&p.done?"[x]":"[ ]";return`${a}${n}- ${f} ${e.fragment}`}return this.multiRun==3&&(a+=n),`${a}${e.fragment}`}async formatAttachment(e,n){var c,u,p;let i,a,o;switch((c=e.attachmentInfo)==null?void 0:c.typeUti){case"com.apple.notes.inlinetextattachment.hashtag":case"com.apple.notes.inlinetextattachment.mention":return i=await this.importer.database.get`
SELECT zalttext FROM ziccloudsyncingobject
WHERE zidentifier = ${e.attachmentInfo.attachmentIdentifier}`,i.ZALTTEXT;case"com.apple.notes.inlinetextattachment.link":return i=await this.importer.database.get`
SELECT ztokencontentidentifier FROM ziccloudsyncingobject
WHERE zidentifier = ${e.attachmentInfo.attachmentIdentifier}`,await this.getInternalLink(i.ZTOKENCONTENTIDENTIFIER,void 0,n);case"com.apple.notes.table":return i=await this.importer.database.get`
SELECT hex(zmergeabledata1) as zhexdata FROM ziccloudsyncingobject
WHERE zidentifier = ${e.attachmentInfo.attachmentIdentifier}`,o=this.importer.decodeData(i.zhexdata,Kn),await o.format();case"public.url":return i=await this.importer.database.get`
SELECT ztitle, zurlstring FROM ziccloudsyncingobject
WHERE zidentifier = ${e.attachmentInfo.attachmentIdentifier}`,`[**${i.ZTITLE}**](${i.ZURLSTRING})`;case"com.apple.notes.gallery":return i=await this.importer.database.get`
SELECT hex(zmergeabledata1) as zhexdata FROM ziccloudsyncingobject
WHERE zidentifier = ${e.attachmentInfo.attachmentIdentifier}`,o=this.importer.decodeData(i.zhexdata,Zn),await o.format(!1,n);case"com.apple.paper.doc.scan":case"com.apple.drawing":case"com.apple.drawing.2":case"com.apple.paper":i=await this.importer.database.get`
SELECT z_pk, zhandwritingsummary
FROM (SELECT *, NULL AS zhandwritingsummary FROM ziccloudsyncingobject)
WHERE zidentifier = ${e.attachmentInfo.attachmentIdentifier}`,a=i==null?void 0:i.Z_PK;break;default:i=await this.importer.database.get`
SELECT zmedia FROM ziccloudsyncingobject
WHERE zidentifier = ${(u=e.attachmentInfo)==null?void 0:u.attachmentIdentifier}`,a=i==null?void 0:i.ZMEDIA;break}if(!a)return` **(unknown attachment: ${(p=e.attachmentInfo)==null?void 0:p.typeUti})** `;let l=await this.importer.resolveAttachment(a,e.attachmentInfo.typeUti),s=l?`
${this.app.fileManager.generateMarkdownLink(l,n)}
`:" **(error reading attachment)**";return this.importer.includeHandwriting&&i.ZHANDWRITINGSUMMARY&&(s=`
> [!Handwriting]-
> ${i.ZHANDWRITINGSUMMARY.replace(`
`,`
> `)}${s}`),s}async getInternalLink(e,n=void 0,i=""){let a=e.match(is)[1],o=await this.importer.database.get`
SELECT z_pk FROM ziccloudsyncingobject
WHERE zidentifier = ${a.toUpperCase()}`,l=await this.importer.resolveNote(o.Z_PK);return l?this.app.fileManager.generateMarkdownLink(l,i,void 0,n):"(unknown file link)"}convertColor(e){let n="#";for(let i of Object.values(e))n+=Math.floor(i*255).toString(16);return n}convertAlign(e){switch(e){default:return"left";case 1:return"center";case 2:return"right";case 3:return"justify"}}};Br.protobufType="ciofecaforensics.Document";function Vg(r){return r.attachmentInfo?!r.attachmentInfo.typeUti.includes("com.apple.notes.inlinetextattachment"):!1}function Fc(r,t){var e,n;if(!t||r.$type!=t.$type)return!1;for(let i of r.$type.fieldsArray)if(i.name!="length"){if((e=r[i.name])!=null&&e.$type&&((n=t[i.name])!=null&&n.$type)){if(!Fc(r[i.name],t[i.name]))return!1}else if(r[i.name]!=t[i.name])return!1}return!0}var Lc={nested:{ciofecaforensics:{nested:{Color:{fields:{red:{type:"float",id:1},green:{type:"float",id:2},blue:{type:"float",id:3},alpha:{type:"float",id:4}}},AttachmentInfo:{fields:{attachmentIdentifier:{type:"string",id:1},typeUti:{type:"string",id:2}}},Font:{fields:{fontName:{type:"string",id:1},pointSize:{type:"float",id:2},fontHints:{type:"int32",id:3}}},ParagraphStyle:{fields:{styleType:{type:"int32",id:1,options:{default:-1}},alignment:{type:"int32",id:2},indentAmount:{type:"int32",id:4},checklist:{type:"Checklist",id:5},blockquote:{type:"int32",id:8}}},Checklist:{fields:{uuid:{type:"bytes",id:1},done:{type:"int32",id:2}}},DictionaryElement:{fields:{key:{type:"ObjectID",id:1},value:{type:"ObjectID",id:2}}},Dictionary:{fields:{element:{rule:"repeated",type:"DictionaryElement",id:1,options:{packed:!1}}}},ObjectID:{fields:{unsignedIntegerValue:{type:"uint64",id:2},stringValue:{type:"string",id:4},objectIndex:{type:"int32",id:6}}},RegisterLatest:{fields:{contents:{type:"ObjectID",id:2}}},MapEntry:{fields:{key:{type:"int32",id:1},value:{type:"ObjectID",id:2}}},AttributeRun:{fields:{length:{type:"int32",id:1},paragraphStyle:{type:"ParagraphStyle",id:2},font:{type:"Font",id:3},fontWeight:{type:"int32",id:5},underlined:{type:"int32",id:6},strikethrough:{type:"int32",id:7},superscript:{type:"int32",id:8},link:{type:"string",id:9},color:{type:"Color",id:10},attachmentInfo:{type:"AttachmentInfo",id:12}}},NoteStoreProto:{fields:{document:{type:"Document",id:2}}},Document:{fields:{version:{type:"int32",id:2},note:{type:"Note",id:3}}},Note:{fields:{noteText:{type:"string",id:2},attributeRun:{rule:"repeated",type:"AttributeRun",id:5,options:{packed:!1}}}},MergableDataProto:{fields:{mergableDataObject:{type:"MergableDataObject",id:2}}},MergableDataObject:{fields:{version:{type:"int32",id:2},mergeableDataObjectData:{type:"MergeableDataObjectData",id:3}}},MergeableDataObjectData:{fields:{mergeableDataObjectEntry:{rule:"repeated",type:"MergeableDataObjectEntry",id:3,options:{packed:!1}},mergeableDataObjectKeyItem:{rule:"repeated",type:"string",id:4},mergeableDataObjectTypeItem:{rule:"repeated",type:"string",id:5},mergeableDataObjectUuidItem:{rule:"repeated",type:"bytes",id:6}}},MergeableDataObjectEntry:{fields:{registerLatest:{type:"RegisterLatest",id:1},list:{type:"List",id:5},dictionary:{type:"Dictionary",id:6},unknownMessage:{type:"UnknownMergeableDataObjectEntryMessage",id:9},note:{type:"Note",id:10},customMap:{type:"MergeableDataObjectMap",id:13},orderedSet:{type:"OrderedSet",id:16}}},UnknownMergeableDataObjectEntryMessage:{fields:{unknownEntry:{type:"UnknownMergeableDataObjectEntryMessageEntry",id:1}}},UnknownMergeableDataObjectEntryMessageEntry:{fields:{unknownInt1:{type:"int32",id:1},unknownInt2:{type:"int64",id:2}}},MergeableDataObjectMap:{fields:{type:{type:"int32",id:1},mapEntry:{rule:"repeated",type:"MapEntry",id:3,options:{packed:!1}}}},OrderedSet:{fields:{ordering:{type:"OrderedSetOrdering",id:1},elements:{type:"Dictionary",id:2}}},OrderedSetOrdering:{fields:{array:{type:"OrderedSetOrderingArray",id:1},contents:{type:"Dictionary",id:2}}},OrderedSetOrderingArray:{fields:{contents:{type:"Note",id:1},attachment:{rule:"repeated",type:"OrderedSetOrderingArrayAttachment",id:2,options:{packed:!1}}}},OrderedSetOrderingArrayAttachment:{fields:{index:{type:"int32",id:1},uuid:{type:"bytes",id:2}}},List:{fields:{listEntry:{rule:"repeated",type:"ListEntry",id:1,options:{packed:!1}}}},ListEntry:{fields:{id:{type:"ObjectID",id:2},details:{type:"ListEntryDetails",id:3},additionalDetails:{type:"ListEntryDetails",id:4}}},ListEntryDetails:{fields:{listEntryDetailsKey:{type:"ListEntryDetailsKey",id:1},id:{type:"ObjectID",id:2}}},ListEntryDetailsKey:{fields:{listEntryDetailsTypeIndex:{type:"int32",id:1},listEntryDetailsKey:{type:"int32",id:2}}}}}}};var ct=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],ru=1440,zg=0,Gg=4,Yg=9,Zg=5,Kg=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],Xg=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],Jg=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],Qg=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],e0=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],t0=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],cr=15;function ls(){let r=this,t,e,n,i,a,o;function l(c,u,p,f,d,g,m,h,b,_,N){let k,O,w,C,y,S,D,R,M,I,q,U,H,W,X;I=0,y=p;do n[c[u+I]]++,I++,y--;while(y!==0);if(n[0]==p)return m[0]=-1,h[0]=0,0;for(R=h[0],S=1;S<=cr&&n[S]===0;S++);for(D=S,R<S&&(R=S),y=cr;y!==0&&n[y]===0;y--);for(w=y,R>y&&(R=y),h[0]=R,W=1<<S;S<y;S++,W<<=1)if((W-=n[S])<0)return-3;if((W-=n[y])<0)return-3;for(n[y]+=W,o[1]=S=0,I=1,H=2;--y!==0;)o[H]=S+=n[I],H++,I++;y=0,I=0;do(S=c[u+I])!==0&&(N[o[S]++]=y),I++;while(++y<p);for(p=o[w],o[0]=y=0,I=0,C=-1,U=-R,a[0]=0,q=0,X=0;D<=w;D++)for(k=n[D];k--!==0;){for(;D>U+R;){if(C++,U+=R,X=w-U,X=X>R?R:X,(O=1<<(S=D-U))>k+1&&(O-=k+1,H=D,S<X))for(;++S<X&&!((O<<=1)<=n[++H]);)O-=n[H];if(X=1<<S,_[0]+X>ru)return-3;a[C]=q=_[0],_[0]+=X,C!==0?(o[C]=y,i[0]=S,i[1]=R,S=y>>>U-R,i[2]=q-a[C-1]-S,b.set(i,(a[C-1]+S)*3)):m[0]=q}for(i[1]=D-U,I>=p?i[0]=192:N[I]<f?(i[0]=N[I]<256?0:96,i[2]=N[I++]):(i[0]=g[N[I]-f]+16+64,i[2]=d[N[I++]-f]),O=1<<D-U,S=y>>>U;S<X;S+=O)b.set(i,(q+S)*3);for(S=1<<D-1;(y&S)!==0;S>>>=1)y^=S;for(y^=S,M=(1<<U)-1;(y&M)!=o[C];)C--,U-=R,M=(1<<U)-1}return W!==0&&w!=1?-5:0}function s(c){let u;for(t||(t=[],e=[],n=new Int32Array(cr+1),i=[],a=new Int32Array(cr),o=new Int32Array(cr+1)),e.length<c&&(e=[]),u=0;u<c;u++)e[u]=0;for(u=0;u<cr+1;u++)n[u]=0;for(u=0;u<3;u++)i[u]=0;a.set(n.subarray(0,cr),0),o.set(n.subarray(0,cr+1),0)}r.inflate_trees_bits=function(c,u,p,f,d){let g;return s(19),t[0]=0,g=l(c,0,19,19,null,null,p,u,f,t,e),g==-3?d.msg="oversubscribed dynamic bit lengths tree":(g==-5||u[0]===0)&&(d.msg="incomplete dynamic bit lengths tree",g=-3),g},r.inflate_trees_dynamic=function(c,u,p,f,d,g,m,h,b){let _;return s(288),t[0]=0,_=l(p,0,c,257,Jg,Qg,g,f,h,t,e),_!=0||f[0]===0?(_==-3?b.msg="oversubscribed literal/length tree":_!=-4&&(b.msg="incomplete literal/length tree",_=-3),_):(s(288),_=l(p,c,u,0,e0,t0,m,d,h,t,e),_!=0||d[0]===0&&c>257?(_==-3?b.msg="oversubscribed distance tree":_==-5?(b.msg="incomplete distance tree",_=-3):_!=-4&&(b.msg="empty distance tree with lengths",_=-3),_):0)}}ls.inflate_trees_fixed=function(r,t,e,n){return r[0]=Yg,t[0]=Zg,e[0]=Kg,n[0]=Xg,0};var Ki=0,Mc=1,$c=2,Bc=3,qc=4,jc=5,Uc=6,as=7,Hc=8,Xi=9;function r0(){let r=this,t,e=0,n,i=0,a=0,o=0,l=0,s=0,c=0,u=0,p,f=0,d,g=0;function m(h,b,_,N,k,O,w,C){let y,S,D,R,M,I,q,U,H,W,X,se,Z,pe,ie,ce;q=C.next_in_index,U=C.avail_in,M=w.bitb,I=w.bitk,H=w.write,W=H<w.read?w.read-H-1:w.end-H,X=ct[h],se=ct[b];do{for(;I<20;)U--,M|=(C.read_byte(q++)&255)<<I,I+=8;if(y=M&X,S=_,D=N,ce=(D+y)*3,(R=S[ce])===0){M>>=S[ce+1],I-=S[ce+1],w.win[H++]=S[ce+2],W--;continue}do{if(M>>=S[ce+1],I-=S[ce+1],(R&16)!==0){for(R&=15,Z=S[ce+2]+(M&ct[R]),M>>=R,I-=R;I<15;)U--,M|=(C.read_byte(q++)&255)<<I,I+=8;y=M&se,S=k,D=O,ce=(D+y)*3,R=S[ce];do if(M>>=S[ce+1],I-=S[ce+1],(R&16)!==0){for(R&=15;I<R;)U--,M|=(C.read_byte(q++)&255)<<I,I+=8;if(pe=S[ce+2]+(M&ct[R]),M>>=R,I-=R,W-=Z,H>=pe)ie=H-pe,H-ie>0&&2>H-ie?(w.win[H++]=w.win[ie++],w.win[H++]=w.win[ie++],Z-=2):(w.win.set(w.win.subarray(ie,ie+2),H),H+=2,ie+=2,Z-=2);else{ie=H-pe;do ie+=w.end;while(ie<0);if(R=w.end-ie,Z>R){if(Z-=R,H-ie>0&&R>H-ie)do w.win[H++]=w.win[ie++];while(--R!==0);else w.win.set(w.win.subarray(ie,ie+R),H),H+=R,ie+=R,R=0;ie=0}}if(H-ie>0&&Z>H-ie)do w.win[H++]=w.win[ie++];while(--Z!==0);else w.win.set(w.win.subarray(ie,ie+Z),H),H+=Z,ie+=Z,Z=0;break}else if((R&64)===0)y+=S[ce+2],y+=M&ct[R],ce=(D+y)*3,R=S[ce];else return C.msg="invalid distance code",Z=C.avail_in-U,Z=I>>3<Z?I>>3:Z,U+=Z,q-=Z,I-=Z<<3,w.bitb=M,w.bitk=I,C.avail_in=U,C.total_in+=q-C.next_in_index,C.next_in_index=q,w.write=H,-3;while(!0);break}if((R&64)===0){if(y+=S[ce+2],y+=M&ct[R],ce=(D+y)*3,(R=S[ce])===0){M>>=S[ce+1],I-=S[ce+1],w.win[H++]=S[ce+2],W--;break}}else return(R&32)!==0?(Z=C.avail_in-U,Z=I>>3<Z?I>>3:Z,U+=Z,q-=Z,I-=Z<<3,w.bitb=M,w.bitk=I,C.avail_in=U,C.total_in+=q-C.next_in_index,C.next_in_index=q,w.write=H,1):(C.msg="invalid literal/length code",Z=C.avail_in-U,Z=I>>3<Z?I>>3:Z,U+=Z,q-=Z,I-=Z<<3,w.bitb=M,w.bitk=I,C.avail_in=U,C.total_in+=q-C.next_in_index,C.next_in_index=q,w.write=H,-3)}while(!0)}while(W>=258&&U>=10);return Z=C.avail_in-U,Z=I>>3<Z?I>>3:Z,U+=Z,q-=Z,I-=Z<<3,w.bitb=M,w.bitk=I,C.avail_in=U,C.total_in+=q-C.next_in_index,C.next_in_index=q,w.write=H,0}r.init=function(h,b,_,N,k,O){t=Ki,c=h,u=b,p=_,f=N,d=k,g=O,n=null},r.proc=function(h,b,_){let N,k,O,w=0,C=0,y=0,S,D,R,M;for(y=b.next_in_index,S=b.avail_in,w=h.bitb,C=h.bitk,D=h.write,R=D<h.read?h.read-D-1:h.end-D;;)switch(t){case Ki:if(R>=258&&S>=10&&(h.bitb=w,h.bitk=C,b.avail_in=S,b.total_in+=y-b.next_in_index,b.next_in_index=y,h.write=D,_=m(c,u,p,f,d,g,h,b),y=b.next_in_index,S=b.avail_in,w=h.bitb,C=h.bitk,D=h.write,R=D<h.read?h.read-D-1:h.end-D,_!=0)){t=_==1?as:Xi;break}a=c,n=p,i=f,t=Mc;case Mc:for(N=a;C<N;){if(S!==0)_=0;else return h.bitb=w,h.bitk=C,b.avail_in=S,b.total_in+=y-b.next_in_index,b.next_in_index=y,h.write=D,h.inflate_flush(b,_);S--,w|=(b.read_byte(y++)&255)<<C,C+=8}if(k=(i+(w&ct[N]))*3,w>>>=n[k+1],C-=n[k+1],O=n[k],O===0){o=n[k+2],t=Uc;break}if((O&16)!==0){l=O&15,e=n[k+2],t=$c;break}if((O&64)===0){a=O,i=k/3+n[k+2];break}if((O&32)!==0){t=as;break}return t=Xi,b.msg="invalid literal/length code",_=-3,h.bitb=w,h.bitk=C,b.avail_in=S,b.total_in+=y-b.next_in_index,b.next_in_index=y,h.write=D,h.inflate_flush(b,_);case $c:for(N=l;C<N;){if(S!==0)_=0;else return h.bitb=w,h.bitk=C,b.avail_in=S,b.total_in+=y-b.next_in_index,b.next_in_index=y,h.write=D,h.inflate_flush(b,_);S--,w|=(b.read_byte(y++)&255)<<C,C+=8}e+=w&ct[N],w>>=N,C-=N,a=u,n=d,i=g,t=Bc;case Bc:for(N=a;C<N;){if(S!==0)_=0;else return h.bitb=w,h.bitk=C,b.avail_in=S,b.total_in+=y-b.next_in_index,b.next_in_index=y,h.write=D,h.inflate_flush(b,_);S--,w|=(b.read_byte(y++)&255)<<C,C+=8}if(k=(i+(w&ct[N]))*3,w>>=n[k+1],C-=n[k+1],O=n[k],(O&16)!==0){l=O&15,s=n[k+2],t=qc;break}if((O&64)===0){a=O,i=k/3+n[k+2];break}return t=Xi,b.msg="invalid distance code",_=-3,h.bitb=w,h.bitk=C,b.avail_in=S,b.total_in+=y-b.next_in_index,b.next_in_index=y,h.write=D,h.inflate_flush(b,_);case qc:for(N=l;C<N;){if(S!==0)_=0;else return h.bitb=w,h.bitk=C,b.avail_in=S,b.total_in+=y-b.next_in_index,b.next_in_index=y,h.write=D,h.inflate_flush(b,_);S--,w|=(b.read_byte(y++)&255)<<C,C+=8}s+=w&ct[N],w>>=N,C-=N,t=jc;case jc:for(M=D-s;M<0;)M+=h.end;for(;e!==0;){if(R===0&&(D==h.end&&h.read!==0&&(D=0,R=D<h.read?h.read-D-1:h.end-D),R===0&&(h.write=D,_=h.inflate_flush(b,_),D=h.write,R=D<h.read?h.read-D-1:h.end-D,D==h.end&&h.read!==0&&(D=0,R=D<h.read?h.read-D-1:h.end-D),R===0)))return h.bitb=w,h.bitk=C,b.avail_in=S,b.total_in+=y-b.next_in_index,b.next_in_index=y,h.write=D,h.inflate_flush(b,_);h.win[D++]=h.win[M++],R--,M==h.end&&(M=0),e--}t=Ki;break;case Uc:if(R===0&&(D==h.end&&h.read!==0&&(D=0,R=D<h.read?h.read-D-1:h.end-D),R===0&&(h.write=D,_=h.inflate_flush(b,_),D=h.write,R=D<h.read?h.read-D-1:h.end-D,D==h.end&&h.read!==0&&(D=0,R=D<h.read?h.read-D-1:h.end-D),R===0)))return h.bitb=w,h.bitk=C,b.avail_in=S,b.total_in+=y-b.next_in_index,b.next_in_index=y,h.write=D,h.inflate_flush(b,_);_=0,h.win[D++]=o,R--,t=Ki;break;case as:if(C>7&&(C-=8,S++,y--),h.write=D,_=h.inflate_flush(b,_),D=h.write,R=D<h.read?h.read-D-1:h.end-D,h.read!=h.write)return h.bitb=w,h.bitk=C,b.avail_in=S,b.total_in+=y-b.next_in_index,b.next_in_index=y,h.write=D,h.inflate_flush(b,_);t=Hc;case Hc:return _=1,h.bitb=w,h.bitk=C,b.avail_in=S,b.total_in+=y-b.next_in_index,b.next_in_index=y,h.write=D,h.inflate_flush(b,_);case Xi:return _=-3,h.bitb=w,h.bitk=C,b.avail_in=S,b.total_in+=y-b.next_in_index,b.next_in_index=y,h.write=D,h.inflate_flush(b,_);default:return _=-2,h.bitb=w,h.bitk=C,b.avail_in=S,b.total_in+=y-b.next_in_index,b.next_in_index=y,h.write=D,h.inflate_flush(b,_)}},r.free=function(){}}var Wc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],gn=0,os=1,Vc=2,zc=3,Gc=4,Yc=5,Ji=6,Qi=7,Zc=8,qr=9;function n0(r,t){let e=this,n=gn,i=0,a=0,o=0,l,s=[0],c=[0],u=new r0,p=0,f=new Int32Array(ru*3),d=0,g=new ls;e.bitk=0,e.bitb=0,e.win=new Uint8Array(t),e.end=t,e.read=0,e.write=0,e.reset=function(m,h){h&&(h[0]=d),n==Ji&&u.free(m),n=gn,e.bitk=0,e.bitb=0,e.read=e.write=0},e.reset(r,null),e.inflate_flush=function(m,h){let b,_,N;return _=m.next_out_index,N=e.read,b=(N<=e.write?e.write:e.end)-N,b>m.avail_out&&(b=m.avail_out),b!==0&&h==-5&&(h=0),m.avail_out-=b,m.total_out+=b,m.next_out.set(e.win.subarray(N,N+b),_),_+=b,N+=b,N==e.end&&(N=0,e.write==e.end&&(e.write=0),b=e.write-N,b>m.avail_out&&(b=m.avail_out),b!==0&&h==-5&&(h=0),m.avail_out-=b,m.total_out+=b,m.next_out.set(e.win.subarray(N,N+b),_),_+=b,N+=b),m.next_out_index=_,e.read=N,h},e.proc=function(m,h){let b,_,N,k,O,w,C,y;for(k=m.next_in_index,O=m.avail_in,_=e.bitb,N=e.bitk,w=e.write,C=w<e.read?e.read-w-1:e.end-w;;){let S,D,R,M,I,q,U,H;switch(n){case gn:for(;N<3;){if(O!==0)h=0;else return e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);O--,_|=(m.read_byte(k++)&255)<<N,N+=8}switch(b=_&7,p=b&1,b>>>1){case 0:_>>>=3,N-=3,b=N&7,_>>>=b,N-=b,n=os;break;case 1:S=[],D=[],R=[[]],M=[[]],ls.inflate_trees_fixed(S,D,R,M),u.init(S[0],D[0],R[0],0,M[0],0),_>>>=3,N-=3,n=Ji;break;case 2:_>>>=3,N-=3,n=zc;break;case 3:return _>>>=3,N-=3,n=qr,m.msg="invalid block type",h=-3,e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h)}break;case os:for(;N<32;){if(O!==0)h=0;else return e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);O--,_|=(m.read_byte(k++)&255)<<N,N+=8}if((~_>>>16&65535)!=(_&65535))return n=qr,m.msg="invalid stored block lengths",h=-3,e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);i=_&65535,_=N=0,n=i!==0?Vc:p!==0?Qi:gn;break;case Vc:if(O===0||C===0&&(w==e.end&&e.read!==0&&(w=0,C=w<e.read?e.read-w-1:e.end-w),C===0&&(e.write=w,h=e.inflate_flush(m,h),w=e.write,C=w<e.read?e.read-w-1:e.end-w,w==e.end&&e.read!==0&&(w=0,C=w<e.read?e.read-w-1:e.end-w),C===0)))return e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);if(h=0,b=i,b>O&&(b=O),b>C&&(b=C),e.win.set(m.read_buf(k,b),w),k+=b,O-=b,w+=b,C-=b,(i-=b)!==0)break;n=p!==0?Qi:gn;break;case zc:for(;N<14;){if(O!==0)h=0;else return e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);O--,_|=(m.read_byte(k++)&255)<<N,N+=8}if(a=b=_&16383,(b&31)>29||(b>>5&31)>29)return n=qr,m.msg="too many length or distance symbols",h=-3,e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);if(b=258+(b&31)+(b>>5&31),!l||l.length<b)l=[];else for(y=0;y<b;y++)l[y]=0;_>>>=14,N-=14,o=0,n=Gc;case Gc:for(;o<4+(a>>>10);){for(;N<3;){if(O!==0)h=0;else return e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);O--,_|=(m.read_byte(k++)&255)<<N,N+=8}l[Wc[o++]]=_&7,_>>>=3,N-=3}for(;o<19;)l[Wc[o++]]=0;if(s[0]=7,b=g.inflate_trees_bits(l,s,c,f,m),b!=0)return h=b,h==-3&&(l=null,n=qr),e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);o=0,n=Yc;case Yc:for(;b=a,!(o>=258+(b&31)+(b>>5&31));){let W,X;for(b=s[0];N<b;){if(O!==0)h=0;else return e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);O--,_|=(m.read_byte(k++)&255)<<N,N+=8}if(b=f[(c[0]+(_&ct[b]))*3+1],X=f[(c[0]+(_&ct[b]))*3+2],X<16)_>>>=b,N-=b,l[o++]=X;else{for(y=X==18?7:X-14,W=X==18?11:3;N<b+y;){if(O!==0)h=0;else return e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);O--,_|=(m.read_byte(k++)&255)<<N,N+=8}if(_>>>=b,N-=b,W+=_&ct[y],_>>>=y,N-=y,y=o,b=a,y+W>258+(b&31)+(b>>5&31)||X==16&&y<1)return l=null,n=qr,m.msg="invalid bit length repeat",h=-3,e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);X=X==16?l[y-1]:0;do l[y++]=X;while(--W!==0);o=y}}if(c[0]=-1,I=[],q=[],U=[],H=[],I[0]=9,q[0]=6,b=a,b=g.inflate_trees_dynamic(257+(b&31),1+(b>>5&31),l,I,q,U,H,f,m),b!=0)return b==-3&&(l=null,n=qr),h=b,e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);u.init(I[0],q[0],f,U[0],f,H[0]),n=Ji;case Ji:if(e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,(h=u.proc(e,m,h))!=1)return e.inflate_flush(m,h);if(h=0,u.free(m),k=m.next_in_index,O=m.avail_in,_=e.bitb,N=e.bitk,w=e.write,C=w<e.read?e.read-w-1:e.end-w,p===0){n=gn;break}n=Qi;case Qi:if(e.write=w,h=e.inflate_flush(m,h),w=e.write,C=w<e.read?e.read-w-1:e.end-w,e.read!=e.write)return e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);n=Zc;case Zc:return h=1,e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);case qr:return h=-3,e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h);default:return h=-2,e.bitb=_,e.bitk=N,m.avail_in=O,m.total_in+=k-m.next_in_index,m.next_in_index=k,e.write=w,e.inflate_flush(m,h)}}},e.free=function(m){e.reset(m,null),e.win=null,f=null},e.set_dictionary=function(m,h,b){e.win.set(m.subarray(h,h+b),0),e.read=e.write=b},e.sync_point=function(){return n==os?1:0}}var i0=32,a0=8,o0=0,Kc=1,Xc=2,Jc=3,Qc=4,eu=5,ss=6,Xn=7,tu=12,ur=13,s0=[0,0,255,255];function l0(){let r=this;r.mode=0,r.method=0,r.was=[0],r.need=0,r.marker=0,r.wbits=0;function t(e){return!e||!e.istate?-2:(e.total_in=e.total_out=0,e.msg=null,e.istate.mode=Xn,e.istate.blocks.reset(e,null),0)}r.inflateEnd=function(e){return r.blocks&&r.blocks.free(e),r.blocks=null,0},r.inflateInit=function(e,n){return e.msg=null,r.blocks=null,n<8||n>15?(r.inflateEnd(e),-2):(r.wbits=n,e.istate.blocks=new n0(e,1<<n),t(e),0)},r.inflate=function(e,n){let i,a;if(!e||!e.istate||!e.next_in)return-2;let o=e.istate;for(n=n==Gg?-5:0,i=-5;;)switch(o.mode){case o0:if(e.avail_in===0)return i;if(i=n,e.avail_in--,e.total_in++,((o.method=e.read_byte(e.next_in_index++))&15)!=a0){o.mode=ur,e.msg="unknown compression method",o.marker=5;break}if((o.method>>4)+8>o.wbits){o.mode=ur,e.msg="invalid win size",o.marker=5;break}o.mode=Kc;case Kc:if(e.avail_in===0)return i;if(i=n,e.avail_in--,e.total_in++,a=e.read_byte(e.next_in_index++)&255,((o.method<<8)+a)%31!==0){o.mode=ur,e.msg="incorrect header check",o.marker=5;break}if((a&i0)===0){o.mode=Xn;break}o.mode=Xc;case Xc:if(e.avail_in===0)return i;i=n,e.avail_in--,e.total_in++,o.need=(e.read_byte(e.next_in_index++)&255)<<24&4278190080,o.mode=Jc;case Jc:if(e.avail_in===0)return i;i=n,e.avail_in--,e.total_in++,o.need+=(e.read_byte(e.next_in_index++)&255)<<16&16711680,o.mode=Qc;case Qc:if(e.avail_in===0)return i;i=n,e.avail_in--,e.total_in++,o.need+=(e.read_byte(e.next_in_index++)&255)<<8&65280,o.mode=eu;case eu:return e.avail_in===0?i:(i=n,e.avail_in--,e.total_in++,o.need+=e.read_byte(e.next_in_index++)&255,o.mode=ss,2);case ss:return o.mode=ur,e.msg="need dictionary",o.marker=0,-2;case Xn:if(i=o.blocks.proc(e,i),i==-3){o.mode=ur,o.marker=0;break}if(i==0&&(i=n),i!=1)return i;i=n,o.blocks.reset(e,o.was),o.mode=tu;case tu:return e.avail_in=0,1;case ur:return-3;default:return-2}},r.inflateSetDictionary=function(e,n,i){let a=0,o=i;if(!e||!e.istate||e.istate.mode!=ss)return-2;let l=e.istate;return o>=1<<l.wbits&&(o=(1<<l.wbits)-1,a=i-o),l.blocks.set_dictionary(n,a,o),l.mode=Xn,0},r.inflateSync=function(e){let n,i,a,o,l;if(!e||!e.istate)return-2;let s=e.istate;if(s.mode!=ur&&(s.mode=ur,s.marker=0),(n=e.avail_in)===0)return-5;for(i=e.next_in_index,a=s.marker;n!==0&&a<4;)e.read_byte(i)==s0[a]?a++:e.read_byte(i)!==0?a=0:a=4-a,i++,n--;return e.total_in+=i-e.next_in_index,e.next_in_index=i,e.avail_in=n,s.marker=a,a!=4?-3:(o=e.total_in,l=e.total_out,t(e),e.total_in=o,e.total_out=l,s.mode=Xn,0)},r.inflateSyncPoint=function(e){return!e||!e.istate||!e.istate.blocks?-2:e.istate.blocks.sync_point()}}function nu(){}nu.prototype={inflateInit(r){let t=this;return t.istate=new l0,r||(r=15),t.istate.inflateInit(t,r)},inflate(r){let t=this;return t.istate?t.istate.inflate(t,r):-2},inflateEnd(){let r=this;if(!r.istate)return-2;let t=r.istate.inflateEnd(r);return r.istate=null,t},inflateSync(){let r=this;return r.istate?r.istate.inflateSync(r):-2},inflateSetDictionary(r,t){let e=this;return e.istate?e.istate.inflateSetDictionary(e,r,t):-2},read_byte(r){return this.next_in[r]},read_buf(r,t){return this.next_in.subarray(r,r+t)}};function iu(r){let t=this,e=new nu,n=r&&r.chunkSize?Math.floor(r.chunkSize*2):128*1024,i=zg,a=new Uint8Array(n),o=!1;e.inflateInit(),e.next_out=a,t.append=function(l,s){let c=[],u,p,f=0,d=0,g=0;if(l.length!==0){e.next_in_index=0,e.next_in=l,e.avail_in=l.length;do{if(e.next_out_index=0,e.avail_out=n,e.avail_in===0&&!o&&(e.next_in_index=0,o=!0),u=e.inflate(i),o&&u===-5){if(e.avail_in!==0)throw new Error("inflating: bad input")}else if(u!==0&&u!==1)throw new Error("inflating: "+e.msg);if((o||u===1)&&e.avail_in===l.length)throw new Error("inflating: bad input");e.next_out_index&&(e.next_out_index===n?c.push(new Uint8Array(a)):c.push(a.subarray(0,e.next_out_index))),g+=e.next_out_index,s&&e.next_in_index>0&&e.next_in_index!=f&&(s(e.next_in_index),f=e.next_in_index)}while(e.avail_in>0||e.avail_out===0);return c.length>1?(p=new Uint8Array(g),c.forEach(function(m){p.set(m,d),d+=m.length})):p=c[0]?new Uint8Array(c[0]):new Uint8Array,p}},t.flush=function(){e.inflateEnd()}}var cs="/",M1=new Date(2107,11,31),$1=new Date(1980,0,1),ke=void 0,ut="undefined",Yt="function";var Jn=class{constructor(t){return class extends TransformStream{constructor(e,n){let i=new t(n);super({transform(a,o){o.enqueue(i.append(a))},flush(a){let o=i.flush();o&&a.enqueue(o)}})}}}};var c0=64,au=2;try{typeof navigator!=ut&&navigator.hardwareConcurrency&&(au=navigator.hardwareConcurrency)}catch(r){}var u0={chunkSize:512*1024,maxWorkers:au,terminateWorkerTimeout:5e3,useWebWorkers:!0,useCompressionStream:!0,workerScripts:ke,CompressionStreamNative:typeof CompressionStream!=ut&&CompressionStream,DecompressionStreamNative:typeof DecompressionStream!=ut&&DecompressionStream},dr=Object.assign({},u0);function us(){return dr}function ou(r){return Math.max(r.chunkSize,c0)}function ea(r){let{baseURL:t,chunkSize:e,maxWorkers:n,terminateWorkerTimeout:i,useCompressionStream:a,useWebWorkers:o,Deflate:l,Inflate:s,CompressionStream:c,DecompressionStream:u,workerScripts:p}=r;if(pr("baseURL",t),pr("chunkSize",e),pr("maxWorkers",n),pr("terminateWorkerTimeout",i),pr("useCompressionStream",a),pr("useWebWorkers",o),l&&(dr.CompressionStream=new Jn(l)),s&&(dr.DecompressionStream=new Jn(s)),pr("CompressionStream",c),pr("DecompressionStream",u),p!==ke){let{deflate:f,inflate:d}=p;if((f||d)&&(dr.workerScripts||(dr.workerScripts={})),f){if(!Array.isArray(f))throw new Error("workerScripts.deflate must be an array");dr.workerScripts.deflate=f}if(d){if(!Array.isArray(d))throw new Error("workerScripts.inflate must be an array");dr.workerScripts.inflate=d}}}function pr(r,t){t!==ke&&(dr[r]=t)}var su=[];for(let r=0;r<256;r++){let t=r;for(let e=0;e<8;e++)t&1?t=t>>>1^3988292384:t=t>>>1;su[r]=t}var Zt=class{constructor(t){this.crc=t||-1}append(t){let e=this.crc|0;for(let n=0,i=t.length|0;n<i;n++)e=e>>>8^su[(e^t[n])&255];this.crc=e}get(){return~this.crc}};var Qn=class extends TransformStream{constructor(){let t,e=new Zt;super({transform(n,i){e.append(n),i.enqueue(n)},flush(){let n=new Uint8Array(4);new DataView(n.buffer).setUint32(0,e.get()),t.value=n}}),t=this}};function lu(r){if(typeof TextEncoder==ut){r=unescape(encodeURIComponent(r));let t=new Uint8Array(r.length);for(let e=0;e<t.length;e++)t[e]=r.charCodeAt(e);return t}else return new TextEncoder().encode(r)}var Ke={concat(r,t){if(r.length===0||t.length===0)return r.concat(t);let e=r[r.length-1],n=Ke.getPartial(e);return n===32?r.concat(t):Ke._shiftRight(t,n,e|0,r.slice(0,r.length-1))},bitLength(r){let t=r.length;if(t===0)return 0;let e=r[t-1];return(t-1)*32+Ke.getPartial(e)},clamp(r,t){if(r.length*32<t)return r;r=r.slice(0,Math.ceil(t/32));let e=r.length;return t=t&31,e>0&&t&&(r[e-1]=Ke.partial(t,r[e-1]&2147483648>>t-1,1)),r},partial(r,t,e){return r===32?t:(e?t|0:t<<32-r)+r*1099511627776},getPartial(r){return Math.round(r/1099511627776)||32},_shiftRight(r,t,e,n){for(n===void 0&&(n=[]);t>=32;t-=32)n.push(e),e=0;if(t===0)return n.concat(r);for(let o=0;o<r.length;o++)n.push(e|r[o]>>>t),e=r[o]<<32-t;let i=r.length?r[r.length-1]:0,a=Ke.getPartial(i);return n.push(Ke.partial(t+a&31,t+a>32?e:n.pop(),1)),n}},ei={bytes:{fromBits(r){let e=Ke.bitLength(r)/8,n=new Uint8Array(e),i;for(let a=0;a<e;a++)(a&3)===0&&(i=r[a/4]),n[a]=i>>>24,i<<=8;return n},toBits(r){let t=[],e,n=0;for(e=0;e<r.length;e++)n=n<<8|r[e],(e&3)===3&&(t.push(n),n=0);return e&3&&t.push(Ke.partial(8*(e&3),n)),t}}},cu={};cu.sha1=class{constructor(r){let t=this;t.blockSize=512,t._init=[1732584193,4023233417,2562383102,271733878,3285377520],t._key=[1518500249,1859775393,2400959708,3395469782],r?(t._h=r._h.slice(0),t._buffer=r._buffer.slice(0),t._length=r._length):t.reset()}reset(){let r=this;return r._h=r._init.slice(0),r._buffer=[],r._length=0,r}update(r){let t=this;typeof r=="string"&&(r=ei.utf8String.toBits(r));let e=t._buffer=Ke.concat(t._buffer,r),n=t._length,i=t._length=n+Ke.bitLength(r);if(i>9007199254740991)throw new Error("Cannot hash more than 2^53 - 1 bits");let a=new Uint32Array(e),o=0;for(let l=t.blockSize+n-(t.blockSize+n&t.blockSize-1);l<=i;l+=t.blockSize)t._block(a.subarray(16*o,16*(o+1))),o+=1;return e.splice(0,16*o),t}finalize(){let r=this,t=r._buffer,e=r._h;t=Ke.concat(t,[Ke.partial(1,1)]);for(let n=t.length+2;n&15;n++)t.push(0);for(t.push(Math.floor(r._length/4294967296)),t.push(r._length|0);t.length;)r._block(t.splice(0,16));return r.reset(),e}_f(r,t,e,n){if(r<=19)return t&e|~t&n;if(r<=39)return t^e^n;if(r<=59)return t&e|t&n|e&n;if(r<=79)return t^e^n}_S(r,t){return t<<r|t>>>32-r}_block(r){let t=this,e=t._h,n=Array(80);for(let c=0;c<16;c++)n[c]=r[c];let i=e[0],a=e[1],o=e[2],l=e[3],s=e[4];for(let c=0;c<=79;c++){c>=16&&(n[c]=t._S(1,n[c-3]^n[c-8]^n[c-14]^n[c-16]));let u=t._S(5,i)+t._f(c,a,o,l)+s+n[c]+t._key[Math.floor(c/20)]|0;s=l,l=o,o=t._S(30,a),a=i,i=u}e[0]=e[0]+i|0,e[1]=e[1]+a|0,e[2]=e[2]+o|0,e[3]=e[3]+l|0,e[4]=e[4]+s|0}};var ps={};ps.aes=class{constructor(r){let t=this;t._tables=[[[],[],[],[],[]],[[],[],[],[],[]]],t._tables[0][0][0]||t._precompute();let e=t._tables[0][4],n=t._tables[1],i=r.length,a,o,l,s=1;if(i!==4&&i!==6&&i!==8)throw new Error("invalid aes key size");for(t._key=[o=r.slice(0),l=[]],a=i;a<4*i+28;a++){let c=o[a-1];(a%i===0||i===8&&a%i===4)&&(c=e[c>>>24]<<24^e[c>>16&255]<<16^e[c>>8&255]<<8^e[c&255],a%i===0&&(c=c<<8^c>>>24^s<<24,s=s<<1^(s>>7)*283)),o[a]=o[a-i]^c}for(let c=0;a;c++,a--){let u=o[c&3?a:a-4];a<=4||c<4?l[c]=u:l[c]=n[0][e[u>>>24]]^n[1][e[u>>16&255]]^n[2][e[u>>8&255]]^n[3][e[u&255]]}}encrypt(r){return this._crypt(r,0)}decrypt(r){return this._crypt(r,1)}_precompute(){let r=this._tables[0],t=this._tables[1],e=r[4],n=t[4],i=[],a=[],o,l,s,c;for(let u=0;u<256;u++)a[(i[u]=u<<1^(u>>7)*283)^u]=u;for(let u=o=0;!e[u];u^=l||1,o=a[o]||1){let p=o^o<<1^o<<2^o<<3^o<<4;p=p>>8^p&255^99,e[u]=p,n[p]=u,c=i[s=i[l=i[u]]];let f=c*16843009^s*65537^l*257^u*16843008,d=i[p]*257^p*16843008;for(let g=0;g<4;g++)r[g][u]=d=d<<24^d>>>8,t[g][p]=f=f<<24^f>>>8}for(let u=0;u<5;u++)r[u]=r[u].slice(0),t[u]=t[u].slice(0)}_crypt(r,t){if(r.length!==4)throw new Error("invalid aes block size");let e=this._key[t],n=e.length/4-2,i=[0,0,0,0],a=this._tables[t],o=a[0],l=a[1],s=a[2],c=a[3],u=a[4],p=r[0]^e[0],f=r[t?3:1]^e[1],d=r[2]^e[2],g=r[t?1:3]^e[3],m=4,h,b,_;for(let N=0;N<n;N++)h=o[p>>>24]^l[f>>16&255]^s[d>>8&255]^c[g&255]^e[m],b=o[f>>>24]^l[d>>16&255]^s[g>>8&255]^c[p&255]^e[m+1],_=o[d>>>24]^l[g>>16&255]^s[p>>8&255]^c[f&255]^e[m+2],g=o[g>>>24]^l[p>>16&255]^s[f>>8&255]^c[d&255]^e[m+3],m+=4,p=h,f=b,d=_;for(let N=0;N<4;N++)i[t?3&-N:N]=u[p>>>24]<<24^u[f>>16&255]<<16^u[d>>8&255]<<8^u[g&255]^e[m++],h=p,p=f,f=d,d=g,g=h;return i}};var uu={getRandomValues(r){let t=new Uint32Array(r.buffer),e=n=>{let i=987654321,a=4294967295;return function(){return i=36969*(i&65535)+(i>>16)&a,n=18e3*(n&65535)+(n>>16)&a,(((i<<16)+n&a)/4294967296+.5)*(Math.random()>.5?1:-1)}};for(let n=0,i;n<r.length;n+=4){let a=e((i||Math.random())*4294967296);i=a()*987654071,t[n/4]=a()*4294967296|0}return r}},ds={};ds.ctrGladman=class{constructor(r,t){this._prf=r,this._initIv=t,this._iv=t}reset(){this._iv=this._initIv}update(r){return this.calculate(this._prf,r,this._iv)}incWord(r){if((r>>24&255)===255){let t=r>>16&255,e=r>>8&255,n=r&255;t===255?(t=0,e===255?(e=0,n===255?n=0:++n):++e):++t,r=0,r+=t<<16,r+=e<<8,r+=n}else r+=1<<24;return r}incCounter(r){(r[0]=this.incWord(r[0]))===0&&(r[1]=this.incWord(r[1]))}calculate(r,t,e){let n;if(!(n=t.length))return[];let i=Ke.bitLength(t);for(let a=0;a<n;a+=4){this.incCounter(e);let o=r.encrypt(e);t[a]^=o[0],t[a+1]^=o[1],t[a+2]^=o[2],t[a+3]^=o[3]}return Ke.clamp(t,i)}};var fr={importKey(r){return new fr.hmacSha1(ei.bytes.toBits(r))},pbkdf2(r,t,e,n){if(e=e||1e4,n<0||e<0)throw new Error("invalid params to pbkdf2");let i=(n>>5)+1<<2,a,o,l,s,c,u=new ArrayBuffer(i),p=new DataView(u),f=0,d=Ke;for(t=ei.bytes.toBits(t),c=1;f<(i||1);c++){for(a=o=r.encrypt(d.concat(t,[c])),l=1;l<e;l++)for(o=r.encrypt(o),s=0;s<o.length;s++)a[s]^=o[s];for(l=0;f<(i||1)&&l<a.length;l++)p.setInt32(f,a[l]),f+=4}return u.slice(0,n/8)}};fr.hmacSha1=class{constructor(r){let t=this,e=t._hash=cu.sha1,n=[[],[]];t._baseHash=[new e,new e];let i=t._baseHash[0].blockSize/32;r.length>i&&(r=new e().update(r).finalize());for(let a=0;a<i;a++)n[0][a]=r[a]^909522486,n[1][a]=r[a]^1549556828;t._baseHash[0].update(n[0]),t._baseHash[1].update(n[1]),t._resultHash=new e(t._baseHash[0])}reset(){let r=this;r._resultHash=new r._hash(r._baseHash[0]),r._updated=!1}update(r){let t=this;t._updated=!0,t._resultHash.update(r)}digest(){let r=this,t=r._resultHash.finalize(),e=new r._hash(r._baseHash[1]).update(t).finalize();return r.reset(),e}encrypt(r){if(this._updated)throw new Error("encrypt on already updated hmac called!");return this.update(r),this.digest(r)}};var p0=typeof crypto!=ut&&typeof crypto.getRandomValues==Yt,mr="Invalid password",jr="Invalid signature",Kt="zipjs-abort-check-password";function ta(r){return p0?crypto.getRandomValues(r):uu.getRandomValues(r)}var bn=16,d0="raw",fu={name:"PBKDF2"},f0={name:"HMAC"},m0="SHA-1",h0=Object.assign({hash:f0},fu),fs=Object.assign({iterations:1e3,hash:{name:m0}},fu),g0=["deriveBits"],ri=[8,12,16],ti=[16,24,32],hr=10,b0=[0,0,0,0],ia=typeof crypto!=ut,ai=ia&&crypto.subtle,mu=ia&&typeof ai!=ut,It=ei.bytes,y0=ps.aes,x0=ds.ctrGladman,w0=fr.hmacSha1,pu=ia&&mu&&typeof ai.importKey==Yt,du=ia&&mu&&typeof ai.deriveBits==Yt,ra=class extends TransformStream{constructor({password:t,rawPassword:e,signed:n,encryptionStrength:i,checkPasswordOnly:a}){super({start(){Object.assign(this,{ready:new Promise(o=>this.resolveReady=o),password:bu(t,e),signed:n,strength:i-1,pending:new Uint8Array})},async transform(o,l){let s=this,{password:c,strength:u,resolveReady:p,ready:f}=s;c?(await v0(s,u,c,ht(o,0,ri[u]+2)),o=ht(o,ri[u]+2),a?l.error(new Error(Kt)):p()):await f;let d=new Uint8Array(o.length-hr-(o.length-hr)%bn);l.enqueue(hu(s,o,d,0,hr,!0))},async flush(o){let{signed:l,ctr:s,hmac:c,pending:u,ready:p}=this;if(c&&s){await p;let f=ht(u,0,u.length-hr),d=ht(u,u.length-hr),g=new Uint8Array;if(f.length){let m=ii(It,f);c.update(m);let h=s.update(m);g=ni(It,h)}if(l){let m=ht(ni(It,c.digest()),0,hr);for(let h=0;h<hr;h++)if(m[h]!=d[h])throw new Error(jr)}o.enqueue(g)}}})}},na=class extends TransformStream{constructor({password:t,rawPassword:e,encryptionStrength:n}){let i;super({start(){Object.assign(this,{ready:new Promise(a=>this.resolveReady=a),password:bu(t,e),strength:n-1,pending:new Uint8Array})},async transform(a,o){let l=this,{password:s,strength:c,resolveReady:u,ready:p}=l,f=new Uint8Array;s?(f=await E0(l,c,s),u()):await p;let d=new Uint8Array(f.length+a.length-a.length%bn);d.set(f,0),o.enqueue(hu(l,a,d,f.length,0))},async flush(a){let{ctr:o,hmac:l,pending:s,ready:c}=this;if(l&&o){await c;let u=new Uint8Array;if(s.length){let p=o.update(ii(It,s));l.update(p),u=ni(It,p)}i.signature=ni(It,l.digest()).slice(0,hr),a.enqueue(ms(u,i.signature))}}}),i=this}};function hu(r,t,e,n,i,a){let{ctr:o,hmac:l,pending:s}=r,c=t.length-i;s.length&&(t=ms(s,t),e=A0(e,c-c%bn));let u;for(u=0;u<=c-bn;u+=bn){let p=ii(It,ht(t,u,u+bn));a&&l.update(p);let f=o.update(p);a||l.update(f),e.set(ni(It,f),u+n)}return r.pending=ht(t,u),e}async function v0(r,t,e,n){let i=await gu(r,t,e,ht(n,0,ri[t])),a=ht(n,ri[t]);if(i[0]!=a[0]||i[1]!=a[1])throw new Error(mr)}async function E0(r,t,e){let n=ta(new Uint8Array(ri[t])),i=await gu(r,t,e,n);return ms(n,i)}async function gu(r,t,e,n){r.password=null;let i=await T0(d0,e,h0,!1,g0),a=await _0(Object.assign({salt:n},fs),i,8*(ti[t]*2+2)),o=new Uint8Array(a),l=ii(It,ht(o,0,ti[t])),s=ii(It,ht(o,ti[t],ti[t]*2)),c=ht(o,ti[t]*2);return Object.assign(r,{keys:{key:l,authentication:s,passwordVerification:c},ctr:new x0(new y0(l),Array.from(b0)),hmac:new w0(s)}),c}async function T0(r,t,e,n,i){if(pu)try{return await ai.importKey(r,t,e,n,i)}catch(a){return pu=!1,fr.importKey(t)}else return fr.importKey(t)}async function _0(r,t,e){if(du)try{return await ai.deriveBits(r,t,e)}catch(n){return du=!1,fr.pbkdf2(t,r.salt,fs.iterations,e)}else return fr.pbkdf2(t,r.salt,fs.iterations,e)}function bu(r,t){return t===ke?lu(r):t}function ms(r,t){let e=r;return r.length+t.length&&(e=new Uint8Array(r.length+t.length),e.set(r,0),e.set(t,r.length)),e}function A0(r,t){if(t&&t>r.length){let e=r;r=new Uint8Array(t),r.set(e,0)}return r}function ht(r,t,e){return r.subarray(t,e)}function ni(r,t){return r.fromBits(t)}function ii(r,t){return r.toBits(t)}var yn=12,aa=class extends TransformStream{constructor({password:t,passwordVerification:e,checkPasswordOnly:n}){super({start(){Object.assign(this,{password:t,passwordVerification:e}),vu(this,t)},transform(i,a){let o=this;if(o.password){let l=yu(o,i.subarray(0,yn));if(o.password=null,l[yn-1]!=o.passwordVerification)throw new Error(mr);i=i.subarray(yn)}n?a.error(new Error(Kt)):a.enqueue(yu(o,i))}})}},oa=class extends TransformStream{constructor({password:t,passwordVerification:e}){super({start(){Object.assign(this,{password:t,passwordVerification:e}),vu(this,t)},transform(n,i){let a=this,o,l;if(a.password){a.password=null;let s=ta(new Uint8Array(yn));s[yn-1]=a.passwordVerification,o=new Uint8Array(n.length+s.length),o.set(xu(a,s),0),l=yn}else o=new Uint8Array(n.length),l=0;o.set(xu(a,n),l),i.enqueue(o)}})}};function yu(r,t){let e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=Eu(r)^t[n],hs(r,e[n]);return e}function xu(r,t){let e=new Uint8Array(t.length);for(let n=0;n<t.length;n++)e[n]=Eu(r)^t[n],hs(r,t[n]);return e}function vu(r,t){let e=[305419896,591751049,878082192];Object.assign(r,{keys:e,crcKey0:new Zt(e[0]),crcKey2:new Zt(e[2])});for(let n=0;n<t.length;n++)hs(r,t.charCodeAt(n))}function hs(r,t){let[e,n,i]=r.keys;r.crcKey0.append([t]),e=~r.crcKey0.get(),n=wu(Math.imul(wu(n+Tu(e)),134775813)+1),r.crcKey2.append([n>>>24]),i=~r.crcKey2.get(),r.keys=[e,n,i]}function Eu(r){let t=r.keys[2]|2;return Tu(Math.imul(t,t^1)>>>8)}function Tu(r){return r&255}function wu(r){return r&4294967295}var _u="deflate-raw",sa=class extends TransformStream{constructor(t,{chunkSize:e,CompressionStream:n,CompressionStreamNative:i}){super({});let{compressed:a,encrypted:o,useCompressionStream:l,zipCrypto:s,signed:c,level:u}=t,p=this,f,d,g=Au(super.readable);(!o||s)&&c&&(f=new Qn,g=Ft(g,f)),a&&(g=ku(g,l,{level:u,chunkSize:e},i,n)),o&&(s?g=Ft(g,new oa(t)):(d=new na(t),g=Ft(g,d))),Cu(p,g,()=>{let m;o&&!s&&(m=d.signature),(!o||s)&&c&&(m=new DataView(f.value.buffer).getUint32(0)),p.signature=m})}},la=class extends TransformStream{constructor(t,{chunkSize:e,DecompressionStream:n,DecompressionStreamNative:i}){super({});let{zipCrypto:a,encrypted:o,signed:l,signature:s,compressed:c,useCompressionStream:u}=t,p,f,d=Au(super.readable);o&&(a?d=Ft(d,new aa(t)):(f=new ra(t),d=Ft(d,f))),c&&(d=ku(d,u,{chunkSize:e},i,n)),(!o||a)&&l&&(p=new Qn,d=Ft(d,p)),Cu(this,d,()=>{if((!o||a)&&l){let g=new DataView(p.value.buffer);if(s!=g.getUint32(0,!1))throw new Error(jr)}})}};function Au(r){return Ft(r,new TransformStream({transform(t,e){t&&t.length&&e.enqueue(t)}}))}function Cu(r,t,e){t=Ft(t,new TransformStream({flush:e})),Object.defineProperty(r,"readable",{get(){return t}})}function ku(r,t,e,n,i){try{let a=t&&n?n:i;r=Ft(r,new a(_u,e))}catch(a){if(t)try{r=Ft(r,new i(_u,e))}catch(o){return r}else return r}return r}function Ft(r,t){return r.pipeThrough(t)}var Pu="message",Nu="start",Su="pull",gs="data",Du="ack",bs="close",Ru="deflate",pa="inflate";var ca=class extends TransformStream{constructor(t,e){super({});let n=this,{codecType:i}=t,a;i.startsWith(Ru)?a=sa:i.startsWith(pa)&&(a=la);let o=0,l=0,s=new a(t,e),c=super.readable,u=new TransformStream({transform(f,d){f&&f.length&&(l+=f.length,d.enqueue(f))},flush(){Object.assign(n,{inputSize:l})}}),p=new TransformStream({transform(f,d){f&&f.length&&(o+=f.length,d.enqueue(f))},flush(){let{signature:f}=s;Object.assign(n,{signature:f,outputSize:o,inputSize:l})}});Object.defineProperty(n,"readable",{get(){return c.pipeThrough(u).pipeThrough(s).pipeThrough(p)}})}},ua=class extends TransformStream{constructor(t){let e;super({transform:n,flush(i){e&&e.length&&i.enqueue(e)}});function n(i,a){if(e){let o=new Uint8Array(e.length+i.length);o.set(e),o.set(i,e.length),i=o,e=null}i.length>t?(a.enqueue(i.slice(0,t)),n(i.slice(t),a)):e=i}}};var Fu=typeof Worker!=ut;var xn=class{constructor(t,{readable:e,writable:n},{options:i,config:a,streamOptions:o,useWebWorkers:l,transferStreams:s,scripts:c},u){let{signal:p}=o;return Object.assign(t,{busy:!0,readable:e.pipeThrough(new ua(a.chunkSize)).pipeThrough(new xs(e,o),{signal:p}),writable:n,options:Object.assign({},i),scripts:c,transferStreams:s,terminate(){return new Promise(f=>{let{worker:d,busy:g}=t;d?(g?t.resolveTerminated=f:(d.terminate(),f()),t.interface=null):f()})},onTaskFinished(){let{resolveTerminated:f}=t;f&&(t.resolveTerminated=null,t.terminated=!0,t.worker.terminate(),f()),t.busy=!1,u(t)}}),(l&&Fu?C0:Lu)(t,a)}},xs=class extends TransformStream{constructor(t,{onstart:e,onprogress:n,size:i,onend:a}){let o=0;super({async start(){e&&await ys(e,i)},async transform(l,s){o+=l.length,n&&await ys(n,o,i),s.enqueue(l)},async flush(){t.size=o,a&&await ys(a,o)}})}};async function ys(r,...t){try{await r(...t)}catch(e){}}function Lu(r,t){return{run:()=>k0(r,t)}}function C0(r,t){let{baseURL:e,chunkSize:n}=t;if(!r.interface){let i;try{i=S0(r.scripts[0],e,r)}catch(a){return Fu=!1,Lu(r,t)}Object.assign(r,{worker:i,interface:{run:()=>P0(r,{chunkSize:n})}})}return r.interface}async function k0({options:r,readable:t,writable:e,onTaskFinished:n},i){try{let a=new ca(r,i);await t.pipeThrough(a).pipeTo(e,{preventClose:!0,preventAbort:!0});let{signature:o,inputSize:l,outputSize:s}=a;return{signature:o,inputSize:l,outputSize:s}}finally{n()}}async function P0(r,t){let e,n,i=new Promise((f,d)=>{e=f,n=d});Object.assign(r,{reader:null,writer:null,resolveResult:e,rejectResult:n,result:i});let{readable:a,options:o,scripts:l}=r,{writable:s,closed:c}=N0(r.writable),u=da({type:Nu,scripts:l.slice(1),options:o,config:t,readable:a,writable:s},r);u||Object.assign(r,{reader:a.getReader(),writer:s.getWriter()});let p=await i;return u||await s.getWriter().close(),await c,p}function N0(r){let t,e=new Promise(i=>t=i);return{writable:new WritableStream({async write(i){let a=r.getWriter();await a.ready,await a.write(i),a.releaseLock()},close(){t()},abort(i){return r.getWriter().abort(i)}}),closed:e}}var Ou=!0,Iu=!0;function S0(r,t,e){let n={type:"module"},i,a;typeof r==Yt&&(r=r());try{i=new URL(r,t)}catch(o){i=r}if(Ou)try{a=new Worker(i)}catch(o){Ou=!1,a=new Worker(i,n)}else a=new Worker(i,n);return a.addEventListener(Pu,o=>D0(o,e)),a}function da(r,{worker:t,writer:e,onTaskFinished:n,transferStreams:i}){try{let{value:a,readable:o,writable:l}=r,s=[];if(a&&(a.byteLength<a.buffer.byteLength?r.value=a.buffer.slice(0,a.byteLength):r.value=a.buffer,s.push(r.value)),i&&Iu?(o&&s.push(o),l&&s.push(l)):r.readable=r.writable=null,s.length)try{return t.postMessage(r,s),!0}catch(c){Iu=!1,r.readable=r.writable=null,t.postMessage(r)}else t.postMessage(r)}catch(a){throw e&&e.releaseLock(),n(),a}}async function D0({data:r},t){let{type:e,value:n,messageId:i,result:a,error:o}=r,{reader:l,writer:s,resolveResult:c,rejectResult:u,onTaskFinished:p}=t;try{if(o){let{message:d,stack:g,code:m,name:h}=o,b=new Error(d);Object.assign(b,{stack:g,code:m,name:h}),f(b)}else{if(e==Su){let{value:d,done:g}=await l.read();da({type:gs,value:d,done:g,messageId:i},t)}e==gs&&(await s.ready,await s.write(new Uint8Array(n)),da({type:Du,messageId:i},t)),e==bs&&f(null,a)}}catch(d){da({type:bs,messageId:i},t),f(d)}function f(d,g){d?u(d):c(g),s&&s.releaseLock(),p()}}var Ur=[],ws=[];var Mu=0;async function Bu(r,t){let{options:e,config:n}=t,{transferStreams:i,useWebWorkers:a,useCompressionStream:o,codecType:l,compressed:s,signed:c,encrypted:u}=e,{workerScripts:p,maxWorkers:f}=n;t.transferStreams=i||i===ke;let d=!s&&!c&&!u&&!t.transferStreams;return t.useWebWorkers=!d&&(a||a===ke&&n.useWebWorkers),t.scripts=t.useWebWorkers&&p?p[l]:[],e.useCompressionStream=o||o===ke&&n.useCompressionStream,(await g()).run();async function g(){let h=Ur.find(b=>!b.busy);if(h)return $u(h),new xn(h,r,t,m);if(Ur.length<f){let b={indexWorker:Mu};return Mu++,Ur.push(b),new xn(b,r,t,m)}else return new Promise(b=>ws.push({resolve:b,stream:r,workerOptions:t}))}function m(h){if(ws.length){let[{resolve:b,stream:_,workerOptions:N}]=ws.splice(0,1);b(new xn(h,_,N,m))}else h.worker?($u(h),R0(h,t)):Ur=Ur.filter(b=>b!=h)}}function R0(r,t){let{config:e}=t,{terminateWorkerTimeout:n}=e;Number.isFinite(n)&&n>=0&&(r.terminated?r.terminated=!1:r.terminateTimeout=setTimeout(async()=>{Ur=Ur.filter(i=>i!=r);try{await r.terminate()}catch(i){}},n))}function $u(r){let{terminateTimeout:t}=r;t&&(clearTimeout(t),r.terminateTimeout=null)}var O0="Writer iterator completed too soon";var I0="Content-Type";var F0=64*1024,qu="writable",oi=class{constructor(){this.size=0}init(){this.initialized=!0}},wn=class extends oi{get readable(){let t=this,{chunkSize:e=F0}=t,n=new ReadableStream({start(){this.chunkOffset=0},async pull(i){let{offset:a=0,size:o,diskNumberStart:l}=n,{chunkOffset:s}=this,c=o===ke?e:Math.min(e,o-s),u=await Ve(t,a+s,c,l);i.enqueue(u),s+e>o||o===ke&&!u.length&&c?i.close():this.chunkOffset+=e}});return n}};var gr=class extends wn{constructor(t){super(),Object.assign(this,{blob:t,size:t.size})}async readUint8Array(t,e){let n=this,i=t+e,o=await(t||i<n.size?n.blob.slice(t,i):n.blob).arrayBuffer();return o.byteLength>e&&(o=o.slice(t,i)),new Uint8Array(o)}},si=class extends oi{constructor(t){super();let e=this,n=new TransformStream,i=[];t&&i.push([I0,t]),Object.defineProperty(e,qu,{get(){return n.writable}}),e.blob=new Response(n.readable,{headers:i}).blob()}getData(){return this.blob}};var fa=class extends si{constructor(t){super(t),Object.assign(this,{encoding:t,utf8:!t||t.toLowerCase()=="utf-8"})}async getData(){let{encoding:t,utf8:e}=this,n=await super.getData();if(n.text&&e)return n.text();{let i=new FileReader;return new Promise((a,o)=>{Object.assign(i,{onload:({target:l})=>a(l.result),onerror:()=>o(i.error)}),i.readAsText(n,t)})}}};var vs=class extends wn{constructor(t){super(),this.readers=t}async init(){let t=this,{readers:e}=t;t.lastDiskNumber=0,t.lastDiskOffset=0,await Promise.all(e.map(async(n,i)=>{await n.init(),i!=e.length-1&&(t.lastDiskOffset+=n.size),t.size+=n.size})),super.init()}async readUint8Array(t,e,n=0){let i=this,{readers:a}=this,o,l=n;l==-1&&(l=a.length-1);let s=t;for(;s>=a[l].size;)s-=a[l].size,l++;let c=a[l],u=c.size;if(s+e<=u)o=await Ve(c,s,e);else{let p=u-s;o=new Uint8Array(e),o.set(await Ve(c,s,p)),o.set(await i.readUint8Array(t+p,e-p,n),p)}return i.lastDiskNumber=Math.max(l,i.lastDiskNumber),o}},ma=class extends oi{constructor(t,e=4294967295){super();let n=this;Object.assign(n,{diskNumber:0,diskOffset:0,size:0,maxSize:e,availableSize:e});let i,a,o,l=new WritableStream({async write(u){let{availableSize:p}=n;if(o)u.length>=p?(await s(u.slice(0,p)),await c(),n.diskOffset+=i.size,n.diskNumber++,o=null,await this.write(u.slice(p))):await s(u);else{let{value:f,done:d}=await t.next();if(d&&!f)throw new Error(O0);i=f,i.size=0,i.maxSize&&(n.maxSize=i.maxSize),n.availableSize=n.maxSize,await li(i),a=f.writable,o=a.getWriter(),await this.write(u)}},async close(){await o.ready,await c()}});Object.defineProperty(n,qu,{get(){return l}});async function s(u){let p=u.length;p&&(await o.ready,await o.write(u),i.size+=p,n.size+=p,n.availableSize-=p)}async function c(){a.size=i.size,await o.close()}}};async function li(r,t){if(r.init&&!r.initialized)await r.init(t);else return Promise.resolve()}function ju(r){return Array.isArray(r)&&(r=new vs(r)),r instanceof ReadableStream&&(r={readable:r}),r}function Uu(r){r.writable===ke&&typeof r.next==Yt&&(r=new ma(r)),r instanceof WritableStream&&(r={writable:r});let{writable:t}=r;return t.size===ke&&(t.size=0),r instanceof ma||Object.assign(r,{diskNumber:0,diskOffset:0,availableSize:1/0,maxSize:1/0}),r}function Ve(r,t,e,n){return r.readUint8Array(t,e,n)}var Hu="\0\u263A\u263B\u2665\u2666\u2663\u2660\u2022\u25D8\u25CB\u25D9\u2642\u2640\u266A\u266B\u263C\u25BA\u25C4\u2195\u203C\xB6\xA7\u25AC\u21A8\u2191\u2193\u2192\u2190\u221F\u2194\u25B2\u25BC !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\u2302\xC7\xFC\xE9\xE2\xE4\xE0\xE5\xE7\xEA\xEB\xE8\xEF\xEE\xEC\xC4\xC5\xC9\xE6\xC6\xF4\xF6\xF2\xFB\xF9\xFF\xD6\xDC\xA2\xA3\xA5\u20A7\u0192\xE1\xED\xF3\xFA\xF1\xD1\xAA\xBA\xBF\u2310\xAC\xBD\xBC\xA1\xAB\xBB\u2591\u2592\u2593\u2502\u2524\u2561\u2562\u2556\u2555\u2563\u2551\u2557\u255D\u255C\u255B\u2510\u2514\u2534\u252C\u251C\u2500\u253C\u255E\u255F\u255A\u2554\u2569\u2566\u2560\u2550\u256C\u2567\u2568\u2564\u2565\u2559\u2558\u2552\u2553\u256B\u256A\u2518\u250C\u2588\u2584\u258C\u2590\u2580\u03B1\xDF\u0393\u03C0\u03A3\u03C3\xB5\u03C4\u03A6\u0398\u03A9\u03B4\u221E\u03C6\u03B5\u2229\u2261\xB1\u2265\u2264\u2320\u2321\xF7\u2248\xB0\u2219\xB7\u221A\u207F\xB2\u25A0 ".split(""),L0=Hu.length==256;function Wu(r){if(L0){let t="";for(let e=0;e<r.length;e++)t+=Hu[r[e]];return t}else return new TextDecoder().decode(r)}function ci(r,t){return t&&t.trim().toLowerCase()=="cp437"?Wu(r):new TextDecoder(t).decode(r)}var Es="filename",Ts="rawFilename",_s="comment",As="rawComment",Cs="uncompressedSize",ks="compressedSize",Ps="offset",ha="diskNumberStart",ga="lastModDate",ba="rawLastModDate",Ns="lastAccessDate",Vu="rawLastAccessDate",Ss="creationDate",zu="rawCreationDate",M0="internalFileAttribute",$0="internalFileAttributes",B0="externalFileAttribute",q0="externalFileAttributes",j0="msDosCompatible",U0="zip64",H0="encrypted",W0="version",V0="versionMadeBy",z0="zipCrypto",G0="directory",Y0="executable",Z0=[Es,Ts,ks,Cs,ga,ba,_s,As,Ns,Ss,Ps,ha,ha,M0,$0,B0,q0,j0,U0,H0,W0,V0,z0,G0,Y0,"bitFlag","signature","filenameUTF8","commentUTF8","compressionMethod","extraField","rawExtraField","extraFieldZip64","extraFieldUnicodePath","extraFieldUnicodeComment","extraFieldAES","extraFieldNTFS","extraFieldExtendedTimestamp"],ui=class{constructor(t){Z0.forEach(e=>this[e]=t[e])}};var Os="File format is not recognized",db="End of central directory not found",fb="End of Zip64 central directory locator not found",mb="Central directory header not found",hb="Local file header not found",gb="Zip64 extra field not found",bb="File contains encrypted entry",yb="Encryption method not supported",tp="Compression method not supported",rp="Split zip file",np="utf-8",ip="cp437",xb=[[Cs,4294967295],[ks,4294967295],[Ps,4294967295],[ha,65535]],wb={[65535]:{getValue:Ne,bytes:4},[4294967295]:{getValue:ya,bytes:8}},Vr=class{constructor(t,e={}){Object.assign(this,{reader:ju(t),options:e,config:us()})}async*getEntriesGenerator(t={}){let e=this,{reader:n}=e,{config:i}=e;if(await li(n),(n.size===ke||!n.readUint8Array)&&(n=new gr(await new Response(n.readable).blob()),await li(n)),n.size<22)throw new Error(Os);n.chunkSize=ou(i);let a=await Ab(n,101010256,n.size,22,65535*16);if(!a){let D=await Ve(n,0,4),R=$e(D);throw Ne(R)==134695760?new Error(rp):new Error(db)}let o=$e(a),l=Ne(o,12),s=Ne(o,16),c=a.offset,u=Me(o,20),p=c+22+u,f=Me(o,4),d=n.lastDiskNumber||0,g=Me(o,6),m=Me(o,8),h=0,b=0;if(s==4294967295||l==4294967295||m==65535||g==65535){let D=await Ve(n,a.offset-20,20),R=$e(D);if(Ne(R,0)==117853008){s=ya(R,8);let M=await Ve(n,s,56,-1),I=$e(M),q=a.offset-20-56;if(Ne(I,0)!=101075792&&s!=q){let U=s;s=q,h=s-U,M=await Ve(n,s,56,-1),I=$e(M)}if(Ne(I,0)!=101075792)throw new Error(fb);f==65535&&(f=Ne(I,16)),g==65535&&(g=Ne(I,20)),m==65535&&(m=ya(I,32)),l==4294967295&&(l=ya(I,40)),s-=l}}if(s>=n.size&&(h=n.size-s-l-22,s=n.size-l-22),d!=f)throw new Error(rp);if(s<0)throw new Error(Os);let _=0,N=await Ve(n,s,l,g),k=$e(N);if(l){let D=a.offset-l;if(Ne(k,_)!=33639248&&s!=D){let R=s;s=D,h+=s-R,N=await Ve(n,s,l,g),k=$e(N)}}let O=a.offset-s-(n.lastDiskOffset||0);if(l!=O&&O>=0&&(l=O,N=await Ve(n,s,l,g),k=$e(N)),s<0||s>=n.size)throw new Error(Os);let w=Xe(e,t,"filenameEncoding"),C=Xe(e,t,"commentEncoding");for(let D=0;D<m;D++){let R=new Fs(n,i,e.options);if(Ne(k,_)!=33639248)throw new Error(mb);op(R,k,_+6);let M=!!R.bitFlag.languageEncodingFlag,I=_+46,q=I+R.filenameLength,U=q+R.extraFieldLength,H=Me(k,_+4),W=H>>8==0,X=H>>8==3,se=N.subarray(I,q),Z=Me(k,_+32),pe=U+Z,ie=N.subarray(U,pe),ce=M,ye=M,xe=Ne(k,_+38),E=W&&(vn(k,_+38)&16)==16||X&&(xe>>16&16384)==16384||se.length&&se[se.length-1]==cs.charCodeAt(0),x=X&&(xe>>16&73)==73,F=Ne(k,_+42)+h;Object.assign(R,{versionMadeBy:H,msDosCompatible:W,compressedSize:0,uncompressedSize:0,commentLength:Z,directory:E,offset:F,diskNumberStart:Me(k,_+34),internalFileAttributes:Me(k,_+36),externalFileAttributes:xe,rawFilename:se,filenameUTF8:ce,commentUTF8:ye,rawExtraField:N.subarray(q,U),executable:x}),R.internalFileAttribute=R.internalFileAttributes,R.externalFileAttribute=R.externalFileAttributes;let A=Xe(e,t,"decodeText")||ci,L=ce?np:w||ip,j=ye?np:C||ip,z=A(se,L);z===ke&&(z=ci(se,L));let V=A(ie,j);V===ke&&(V=ci(ie,j)),Object.assign(R,{rawComment:ie,filename:z,comment:V,directory:E||z.endsWith(cs)}),b=Math.max(F,b),sp(R,R,k,_+6),R.zipCrypto=R.encrypted&&!R.extraFieldAES;let G=new ui(R);G.getData=(fe,we)=>R.getData(fe,G,we),_=pe;let{onprogress:de}=t;if(de)try{await de(D+1,m,new ui(R))}catch(fe){}yield G}let y=Xe(e,t,"extractPrependedData"),S=Xe(e,t,"extractAppendedData");return y&&(e.prependedData=b>0?await Ve(n,0,b):new Uint8Array),e.comment=u?await Ve(n,c+22,u):new Uint8Array,S&&(e.appendedData=p<n.size?await Ve(n,p,n.size-p):new Uint8Array),!0}async getEntries(t={}){let e=[];for await(let n of this.getEntriesGenerator(t))e.push(n);return e}async close(){}};var Fs=class{constructor(t,e,n){Object.assign(this,{reader:t,config:e,options:n})}async getData(t,e,n={}){let i=this,{reader:a,offset:o,diskNumberStart:l,extraFieldAES:s,compressionMethod:c,config:u,bitFlag:p,signature:f,rawLastModDate:d,uncompressedSize:g,compressedSize:m}=i,h=e.localDirectory={},b=await Ve(a,o,30,l),_=$e(b),N=Xe(i,n,"password"),k=Xe(i,n,"rawPassword"),O=Xe(i,n,"passThrough");if(N=N&&N.length&&N,k=k&&k.length&&k,s&&s.originalCompressionMethod!=99)throw new Error(tp);if(c!=0&&c!=8&&!O)throw new Error(tp);if(Ne(_,0)!=67324752)throw new Error(hb);op(h,_,4),h.rawExtraField=h.extraFieldLength?await Ve(a,o+30+h.filenameLength,h.extraFieldLength,l):new Uint8Array,sp(i,h,_,4,!0),Object.assign(e,{lastAccessDate:h.lastAccessDate,creationDate:h.creationDate});let w=i.encrypted&&h.encrypted&&!O,C=w&&!s;if(O||(e.zipCrypto=C),w){if(!C&&s.strength===ke)throw new Error(yb);if(!N&&!k)throw new Error(bb)}let y=o+30+h.filenameLength+h.extraFieldLength,S=m,D=a.readable;Object.assign(D,{diskNumberStart:l,offset:y,size:S});let R=Xe(i,n,"signal"),M=Xe(i,n,"checkPasswordOnly");M&&(t=new WritableStream),t=Uu(t),await li(t,O?m:g);let{writable:I}=t,{onstart:q,onprogress:U,onend:H}=n,W={options:{codecType:pa,password:N,rawPassword:k,zipCrypto:C,encryptionStrength:s&&s.strength,signed:Xe(i,n,"checkSignature")&&!O,passwordVerification:C&&(p.dataDescriptor?d>>>8&255:f>>>24&255),signature:f,compressed:c!=0&&!O,encrypted:i.encrypted&&!O,useWebWorkers:Xe(i,n,"useWebWorkers"),useCompressionStream:Xe(i,n,"useCompressionStream"),transferStreams:Xe(i,n,"transferStreams"),checkPasswordOnly:M},config:u,streamOptions:{signal:R,size:S,onstart:q,onprogress:U,onend:H}},X=0;try{({outputSize:X}=await Bu({readable:D,writable:I},W))}catch(se){if(!M||se.message!=Kt)throw se}finally{let se=Xe(i,n,"preventClose");I.size+=X,!se&&!I.locked&&await I.getWriter().close()}return M?ke:t.getData?t.getData():I}};function op(r,t,e){let n=r.rawBitFlag=Me(t,e+2),i=(n&1)==1,a=Ne(t,e+6);Object.assign(r,{encrypted:i,version:Me(t,e),bitFlag:{level:(n&6)>>1,dataDescriptor:(n&8)==8,languageEncodingFlag:(n&2048)==2048},rawLastModDate:a,lastModDate:Cb(a),filenameLength:Me(t,e+22),extraFieldLength:Me(t,e+24)})}function sp(r,t,e,n,i){let{rawExtraField:a}=t,o=t.extraField=new Map,l=$e(new Uint8Array(a)),s=0;try{for(;s<a.length;){let b=Me(l,s),_=Me(l,s+2);o.set(b,{type:b,data:a.slice(s+4,s+4+_)}),s+=4+_}}catch(b){}let c=Me(e,n+4);Object.assign(t,{signature:Ne(e,n+10),uncompressedSize:Ne(e,n+18),compressedSize:Ne(e,n+14)});let u=o.get(1);u&&(vb(u,t),t.extraFieldZip64=u);let p=o.get(28789);p&&(ap(p,Es,Ts,t,r),t.extraFieldUnicodePath=p);let f=o.get(25461);f&&(ap(f,_s,As,t,r),t.extraFieldUnicodeComment=f);let d=o.get(39169);d?(Eb(d,t,c),t.extraFieldAES=d):t.compressionMethod=c;let g=o.get(10);g&&(Tb(g,t),t.extraFieldNTFS=g);let m=o.get(21589);m&&(_b(m,t,i),t.extraFieldExtendedTimestamp=m);let h=o.get(6534);h&&(t.extraFieldUSDZ=h)}function vb(r,t){t.zip64=!0;let e=$e(r.data),n=xb.filter(([i,a])=>t[i]==a);for(let i=0,a=0;i<n.length;i++){let[o,l]=n[i];if(t[o]==l){let s=wb[l];t[o]=r[o]=s.getValue(e,a),a+=s.bytes}else if(r[o])throw new Error(gb)}}function ap(r,t,e,n,i){let a=$e(r.data),o=new Zt;o.append(i[e]);let l=$e(new Uint8Array(4));l.setUint32(0,o.get(),!0);let s=Ne(a,1);Object.assign(r,{version:vn(a,0),[t]:ci(r.data.subarray(5)),valid:!i.bitFlag.languageEncodingFlag&&s==Ne(l,0)}),r.valid&&(n[t]=r[t],n[t+"UTF8"]=!0)}function Eb(r,t,e){let n=$e(r.data),i=vn(n,4);Object.assign(r,{vendorVersion:vn(n,0),vendorId:vn(n,2),strength:i,originalCompressionMethod:e,compressionMethod:Me(n,5)}),t.compressionMethod=r.compressionMethod}function Tb(r,t){let e=$e(r.data),n=4,i;try{for(;n<r.data.length&&!i;){let a=Me(e,n),o=Me(e,n+2);a==1&&(i=r.data.slice(n+4,n+4+o)),n+=4+o}}catch(a){}try{if(i&&i.length==24){let a=$e(i),o=a.getBigUint64(0,!0),l=a.getBigUint64(8,!0),s=a.getBigUint64(16,!0);Object.assign(r,{rawLastModDate:o,rawLastAccessDate:l,rawCreationDate:s});let c=Is(o),u=Is(l),p=Is(s),f={lastModDate:c,lastAccessDate:u,creationDate:p};Object.assign(r,f),Object.assign(t,f)}}catch(a){}}function _b(r,t,e){let n=$e(r.data),i=vn(n,0),a=[],o=[];e?((i&1)==1&&(a.push(ga),o.push(ba)),(i&2)==2&&(a.push(Ns),o.push(Vu)),(i&4)==4&&(a.push(Ss),o.push(zu))):r.data.length>=5&&(a.push(ga),o.push(ba));let l=1;a.forEach((s,c)=>{if(r.data.length>=l+4){let u=Ne(n,l);t[s]=r[s]=new Date(u*1e3);let p=o[c];r[p]=u}l+=4})}async function Ab(r,t,e,n,i){let a=new Uint8Array(4),o=$e(a);kb(o,0,t);let l=n+i;return await s(n)||await s(Math.min(l,e));async function s(c){let u=e-c,p=await Ve(r,u,c);for(let f=p.length-n;f>=0;f--)if(p[f]==a[0]&&p[f+1]==a[1]&&p[f+2]==a[2]&&p[f+3]==a[3])return{offset:u+f,buffer:p.slice(f,f+n).buffer}}}function Xe(r,t,e){return t[e]===ke?r.options[e]:t[e]}function Cb(r){let t=(r&4294901760)>>16,e=r&65535;try{return new Date(1980+((t&65024)>>9),((t&480)>>5)-1,t&31,(e&63488)>>11,(e&2016)>>5,(e&31)*2,0)}catch(n){}}function Is(r){return new Date(Number(r/BigInt(1e4)-BigInt(116444736e5)))}function vn(r,t){return r.getUint8(t)}function Me(r,t){return r.getUint16(t,!0)}function Ne(r,t){return r.getUint32(t,!0)}function ya(r,t){return Number(r.getBigUint64(t,!0))}function kb(r,t,e){r.setUint32(t,e,!0)}function $e(r){return new DataView(r.buffer)}ea({Inflate:iu});var Gr=require("obsidian");function lp(r){let t=()=>URL.createObjectURL(new Blob([`const{Array:e,Object:t,Number:n,Math:r,Error:s,Uint8Array:i,Uint16Array:o,Uint32Array:c,Int32Array:f,Map:a,DataView:l,Promise:u,TextEncoder:w,crypto:h,postMessage:d,TransformStream:p,ReadableStream:y,WritableStream:m,CompressionStream:b,DecompressionStream:g}=self;class k{constructor(e){return class extends p{constructor(t,n){const r=new e(n);super({transform(e,t){t.enqueue(r.append(e))},flush(e){const t=r.flush();t&&e.enqueue(t)}})}}}}const v=[];for(let e=0;256>e;e++){let t=e;for(let e=0;8>e;e++)1&t?t=t>>>1^3988292384:t>>>=1;v[e]=t}class S{constructor(e){this.t=e||-1}append(e){let t=0|this.t;for(let n=0,r=0|e.length;r>n;n++)t=t>>>8^v[255&(t^e[n])];this.t=t}get(){return~this.t}}class z extends p{constructor(){let e;const t=new S;super({transform(e,n){t.append(e),n.enqueue(e)},flush(){const n=new i(4);new l(n.buffer).setUint32(0,t.get()),e.value=n}}),e=this}}const C={concat(e,t){if(0===e.length||0===t.length)return e.concat(t);const n=e[e.length-1],r=C.i(n);return 32===r?e.concat(t):C.o(t,r,0|n,e.slice(0,e.length-1))},l(e){const t=e.length;if(0===t)return 0;const n=e[t-1];return 32*(t-1)+C.i(n)},u(e,t){if(32*e.length<t)return e;const n=(e=e.slice(0,r.ceil(t/32))).length;return t&=31,n>0&&t&&(e[n-1]=C.h(t,e[n-1]&2147483648>>t-1,1)),e},h:(e,t,n)=>32===e?t:(n?0|t:t<<32-e)+1099511627776*e,i:e=>r.round(e/1099511627776)||32,o(e,t,n,r){for(void 0===r&&(r=[]);t>=32;t-=32)r.push(n),n=0;if(0===t)return r.concat(e);for(let s=0;s<e.length;s++)r.push(n|e[s]>>>t),n=e[s]<<32-t;const s=e.length?e[e.length-1]:0,i=C.i(s);return r.push(C.h(t+i&31,t+i>32?n:r.pop(),1)),r}},x={p:{m(e){const t=C.l(e)/8,n=new i(t);let r;for(let s=0;t>s;s++)0==(3&s)&&(r=e[s/4]),n[s]=r>>>24,r<<=8;return n},g(e){const t=[];let n,r=0;for(n=0;n<e.length;n++)r=r<<8|e[n],3==(3&n)&&(t.push(r),r=0);return 3&n&&t.push(C.h(8*(3&n),r)),t}}},_=class{constructor(e){const t=this;t.blockSize=512,t.k=[1732584193,4023233417,2562383102,271733878,3285377520],t.v=[1518500249,1859775393,2400959708,3395469782],e?(t.S=e.S.slice(0),t.C=e.C.slice(0),t._=e._):t.reset()}reset(){const e=this;return e.S=e.k.slice(0),e.C=[],e._=0,e}update(e){const t=this;"string"==typeof e&&(e=x.A.g(e));const n=t.C=C.concat(t.C,e),r=t._,i=t._=r+C.l(e);if(i>9007199254740991)throw new s("Cannot hash more than 2^53 - 1 bits");const o=new c(n);let f=0;for(let e=t.blockSize+r-(t.blockSize+r&t.blockSize-1);i>=e;e+=t.blockSize)t.I(o.subarray(16*f,16*(f+1))),f+=1;return n.splice(0,16*f),t}D(){const e=this;let t=e.C;const n=e.S;t=C.concat(t,[C.h(1,1)]);for(let e=t.length+2;15&e;e++)t.push(0);for(t.push(r.floor(e._/4294967296)),t.push(0|e._);t.length;)e.I(t.splice(0,16));return e.reset(),n}V(e,t,n,r){return e>19?e>39?e>59?e>79?void 0:t^n^r:t&n|t&r|n&r:t^n^r:t&n|~t&r}P(e,t){return t<<e|t>>>32-e}I(t){const n=this,s=n.S,i=e(80);for(let e=0;16>e;e++)i[e]=t[e];let o=s[0],c=s[1],f=s[2],a=s[3],l=s[4];for(let e=0;79>=e;e++){16>e||(i[e]=n.P(1,i[e-3]^i[e-8]^i[e-14]^i[e-16]));const t=n.P(5,o)+n.V(e,c,f,a)+l+i[e]+n.v[r.floor(e/20)]|0;l=a,a=f,f=n.P(30,c),c=o,o=t}s[0]=s[0]+o|0,s[1]=s[1]+c|0,s[2]=s[2]+f|0,s[3]=s[3]+a|0,s[4]=s[4]+l|0}},A={getRandomValues(e){const t=new c(e.buffer),n=e=>{let t=987654321;const n=4294967295;return()=>(t=36969*(65535&t)+(t>>16)&n,(((t<<16)+(e=18e3*(65535&e)+(e>>16)&n)&n)/4294967296+.5)*(r.random()>.5?1:-1))};for(let s,i=0;i<e.length;i+=4){const e=n(4294967296*(s||r.random()));s=987654071*e(),t[i/4]=4294967296*e()|0}return e}},I={importKey:e=>new I.R(x.p.g(e)),B(e,t,n,r){if(n=n||1e4,0>r||0>n)throw new s("invalid params to pbkdf2");const i=1+(r>>5)<<2;let o,c,f,a,u;const w=new ArrayBuffer(i),h=new l(w);let d=0;const p=C;for(t=x.p.g(t),u=1;(i||1)>d;u++){for(o=c=e.encrypt(p.concat(t,[u])),f=1;n>f;f++)for(c=e.encrypt(c),a=0;a<c.length;a++)o[a]^=c[a];for(f=0;(i||1)>d&&f<o.length;f++)h.setInt32(d,o[f]),d+=4}return w.slice(0,r/8)},R:class{constructor(e){const t=this,n=t.M=_,r=[[],[]];t.K=[new n,new n];const s=t.K[0].blockSize/32;e.length>s&&(e=(new n).update(e).D());for(let t=0;s>t;t++)r[0][t]=909522486^e[t],r[1][t]=1549556828^e[t];t.K[0].update(r[0]),t.K[1].update(r[1]),t.U=new n(t.K[0])}reset(){const e=this;e.U=new e.M(e.K[0]),e.N=!1}update(e){this.N=!0,this.U.update(e)}digest(){const e=this,t=e.U.D(),n=new e.M(e.K[1]).update(t).D();return e.reset(),n}encrypt(e){if(this.N)throw new s("encrypt on already updated hmac called!");return this.update(e),this.digest(e)}}},D=void 0!==h&&"function"==typeof h.getRandomValues,V="Invalid password",P="Invalid signature",R="zipjs-abort-check-password";function B(e){return D?h.getRandomValues(e):A.getRandomValues(e)}const E=16,M={name:"PBKDF2"},K=t.assign({hash:{name:"HMAC"}},M),U=t.assign({iterations:1e3,hash:{name:"SHA-1"}},M),N=["deriveBits"],O=[8,12,16],T=[16,24,32],W=10,j=[0,0,0,0],H="undefined",L="function",F=typeof h!=H,q=F&&h.subtle,G=F&&typeof q!=H,J=x.p,Q=class{constructor(e){const t=this;t.O=[[[],[],[],[],[]],[[],[],[],[],[]]],t.O[0][0][0]||t.T();const n=t.O[0][4],r=t.O[1],i=e.length;let o,c,f,a=1;if(4!==i&&6!==i&&8!==i)throw new s("invalid aes key size");for(t.v=[c=e.slice(0),f=[]],o=i;4*i+28>o;o++){let e=c[o-1];(o%i==0||8===i&&o%i==4)&&(e=n[e>>>24]<<24^n[e>>16&255]<<16^n[e>>8&255]<<8^n[255&e],o%i==0&&(e=e<<8^e>>>24^a<<24,a=a<<1^283*(a>>7))),c[o]=c[o-i]^e}for(let e=0;o;e++,o--){const t=c[3&e?o:o-4];f[e]=4>=o||4>e?t:r[0][n[t>>>24]]^r[1][n[t>>16&255]]^r[2][n[t>>8&255]]^r[3][n[255&t]]}}encrypt(e){return this.W(e,0)}decrypt(e){return this.W(e,1)}T(){const e=this.O[0],t=this.O[1],n=e[4],r=t[4],s=[],i=[];let o,c,f,a;for(let e=0;256>e;e++)i[(s[e]=e<<1^283*(e>>7))^e]=e;for(let l=o=0;!n[l];l^=c||1,o=i[o]||1){let i=o^o<<1^o<<2^o<<3^o<<4;i=i>>8^255&i^99,n[l]=i,r[i]=l,a=s[f=s[c=s[l]]];let u=16843009*a^65537*f^257*c^16843008*l,w=257*s[i]^16843008*i;for(let n=0;4>n;n++)e[n][l]=w=w<<24^w>>>8,t[n][i]=u=u<<24^u>>>8}for(let n=0;5>n;n++)e[n]=e[n].slice(0),t[n]=t[n].slice(0)}W(e,t){if(4!==e.length)throw new s("invalid aes block size");const n=this.v[t],r=n.length/4-2,i=[0,0,0,0],o=this.O[t],c=o[0],f=o[1],a=o[2],l=o[3],u=o[4];let w,h,d,p=e[0]^n[0],y=e[t?3:1]^n[1],m=e[2]^n[2],b=e[t?1:3]^n[3],g=4;for(let e=0;r>e;e++)w=c[p>>>24]^f[y>>16&255]^a[m>>8&255]^l[255&b]^n[g],h=c[y>>>24]^f[m>>16&255]^a[b>>8&255]^l[255&p]^n[g+1],d=c[m>>>24]^f[b>>16&255]^a[p>>8&255]^l[255&y]^n[g+2],b=c[b>>>24]^f[p>>16&255]^a[y>>8&255]^l[255&m]^n[g+3],g+=4,p=w,y=h,m=d;for(let e=0;4>e;e++)i[t?3&-e:e]=u[p>>>24]<<24^u[y>>16&255]<<16^u[m>>8&255]<<8^u[255&b]^n[g++],w=p,p=y,y=m,m=b,b=w;return i}},X=class{constructor(e,t){this.j=e,this.H=t,this.L=t}reset(){this.L=this.H}update(e){return this.F(this.j,e,this.L)}q(e){if(255==(e>>24&255)){let t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}G(e){0===(e[0]=this.q(e[0]))&&(e[1]=this.q(e[1]))}F(e,t,n){let r;if(!(r=t.length))return[];const s=C.l(t);for(let s=0;r>s;s+=4){this.G(n);const r=e.encrypt(n);t[s]^=r[0],t[s+1]^=r[1],t[s+2]^=r[2],t[s+3]^=r[3]}return C.u(t,s)}},Y=I.R;let Z=F&&G&&typeof q.importKey==L,$=F&&G&&typeof q.deriveBits==L;class ee extends p{constructor({password:e,signed:n,encryptionStrength:r,checkPasswordOnly:o}){super({start(){t.assign(this,{ready:new u((e=>this.J=e)),password:e,signed:n,X:r-1,pending:new i})},async transform(e,t){const n=this,{password:r,X:c,J:f,ready:a}=n;r?(await(async(e,t,n,r)=>{const i=await re(e,t,n,ie(r,0,O[t])),o=ie(r,O[t]);if(i[0]!=o[0]||i[1]!=o[1])throw new s(V)})(n,c,r,ie(e,0,O[c]+2)),e=ie(e,O[c]+2),o?t.error(new s(R)):f()):await a;const l=new i(e.length-W-(e.length-W)%E);t.enqueue(ne(n,e,l,0,W,!0))},async flush(e){const{signed:t,Y:n,Z:r,pending:o,ready:c}=this;await c;const f=ie(o,0,o.length-W),a=ie(o,o.length-W);let l=new i;if(f.length){const e=ce(J,f);r.update(e);const t=n.update(e);l=oe(J,t)}if(t){const e=ie(oe(J,r.digest()),0,W);for(let t=0;W>t;t++)if(e[t]!=a[t])throw new s(P)}e.enqueue(l)}})}}class te extends p{constructor({password:e,encryptionStrength:n}){let r;super({start(){t.assign(this,{ready:new u((e=>this.J=e)),password:e,X:n-1,pending:new i})},async transform(e,t){const n=this,{password:r,X:s,J:o,ready:c}=n;let f=new i;r?(f=await(async(e,t,n)=>{const r=B(new i(O[t]));return se(r,await re(e,t,n,r))})(n,s,r),o()):await c;const a=new i(f.length+e.length-e.length%E);a.set(f,0),t.enqueue(ne(n,e,a,f.length,0))},async flush(e){const{Y:t,Z:n,pending:s,ready:o}=this;await o;let c=new i;if(s.length){const e=t.update(ce(J,s));n.update(e),c=oe(J,e)}r.signature=oe(J,n.digest()).slice(0,W),e.enqueue(se(c,r.signature))}}),r=this}}function ne(e,t,n,r,s,o){const{Y:c,Z:f,pending:a}=e,l=t.length-s;let u;for(a.length&&(t=se(a,t),n=((e,t)=>{if(t&&t>e.length){const n=e;(e=new i(t)).set(n,0)}return e})(n,l-l%E)),u=0;l-E>=u;u+=E){const e=ce(J,ie(t,u,u+E));o&&f.update(e);const s=c.update(e);o||f.update(s),n.set(oe(J,s),u+r)}return e.pending=ie(t,u),n}async function re(n,r,s,o){n.password=null;const c=(e=>{if(void 0===w){const t=new i((e=unescape(encodeURIComponent(e))).length);for(let n=0;n<t.length;n++)t[n]=e.charCodeAt(n);return t}return(new w).encode(e)})(s),f=await(async(e,t,n,r,s)=>{if(!Z)return I.importKey(t);try{return await q.importKey("raw",t,n,!1,s)}catch(e){return Z=!1,I.importKey(t)}})(0,c,K,0,N),a=await(async(e,t,n)=>{if(!$)return I.B(t,e.salt,U.iterations,n);try{return await q.deriveBits(e,t,n)}catch(r){return $=!1,I.B(t,e.salt,U.iterations,n)}})(t.assign({salt:o},U),f,8*(2*T[r]+2)),l=new i(a),u=ce(J,ie(l,0,T[r])),h=ce(J,ie(l,T[r],2*T[r])),d=ie(l,2*T[r]);return t.assign(n,{keys:{key:u,$:h,passwordVerification:d},Y:new X(new Q(u),e.from(j)),Z:new Y(h)}),d}function se(e,t){let n=e;return e.length+t.length&&(n=new i(e.length+t.length),n.set(e,0),n.set(t,e.length)),n}function ie(e,t,n){return e.subarray(t,n)}function oe(e,t){return e.m(t)}function ce(e,t){return e.g(t)}class fe extends p{constructor({password:e,passwordVerification:n,checkPasswordOnly:r}){super({start(){t.assign(this,{password:e,passwordVerification:n}),we(this,e)},transform(e,t){const n=this;if(n.password){const t=le(n,e.subarray(0,12));if(n.password=null,t[11]!=n.passwordVerification)throw new s(V);e=e.subarray(12)}r?t.error(new s(R)):t.enqueue(le(n,e))}})}}class ae extends p{constructor({password:e,passwordVerification:n}){super({start(){t.assign(this,{password:e,passwordVerification:n}),we(this,e)},transform(e,t){const n=this;let r,s;if(n.password){n.password=null;const t=B(new i(12));t[11]=n.passwordVerification,r=new i(e.length+t.length),r.set(ue(n,t),0),s=12}else r=new i(e.length),s=0;r.set(ue(n,e),s),t.enqueue(r)}})}}function le(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=de(e)^t[r],he(e,n[r]);return n}function ue(e,t){const n=new i(t.length);for(let r=0;r<t.length;r++)n[r]=de(e)^t[r],he(e,t[r]);return n}function we(e,n){const r=[305419896,591751049,878082192];t.assign(e,{keys:r,ee:new S(r[0]),te:new S(r[2])});for(let t=0;t<n.length;t++)he(e,n.charCodeAt(t))}function he(e,t){let[n,s,i]=e.keys;e.ee.append([t]),n=~e.ee.get(),s=ye(r.imul(ye(s+pe(n)),134775813)+1),e.te.append([s>>>24]),i=~e.te.get(),e.keys=[n,s,i]}function de(e){const t=2|e.keys[2];return pe(r.imul(t,1^t)>>>8)}function pe(e){return 255&e}function ye(e){return 4294967295&e}const me="deflate-raw";class be extends p{constructor(e,{chunkSize:t,CompressionStream:n,CompressionStreamNative:r}){super({});const{compressed:s,encrypted:i,useCompressionStream:o,zipCrypto:c,signed:f,level:a}=e,u=this;let w,h,d=ke(super.readable);i&&!c||!f||(w=new z,d=ze(d,w)),s&&(d=Se(d,o,{level:a,chunkSize:t},r,n)),i&&(c?d=ze(d,new ae(e)):(h=new te(e),d=ze(d,h))),ve(u,d,(async()=>{let e;i&&!c&&(e=h.signature),i&&!c||!f||(e=new l(w.value.buffer).getUint32(0)),u.signature=e}))}}class ge extends p{constructor(e,{chunkSize:t,DecompressionStream:n,DecompressionStreamNative:r}){super({});const{zipCrypto:i,encrypted:o,signed:c,signature:f,compressed:a,useCompressionStream:u}=e;let w,h,d=ke(super.readable);o&&(i?d=ze(d,new fe(e)):(h=new ee(e),d=ze(d,h))),a&&(d=Se(d,u,{chunkSize:t},r,n)),o&&!i||!c||(w=new z,d=ze(d,w)),ve(this,d,(async()=>{if((!o||i)&&c){const e=new l(w.value.buffer);if(f!=e.getUint32(0,!1))throw new s(P)}}))}}function ke(e){return ze(e,new p({transform(e,t){e&&e.length&&t.enqueue(e)}}))}function ve(e,n,r){n=ze(n,new p({flush:r})),t.defineProperty(e,"readable",{get:()=>n})}function Se(e,t,n,r,s){try{e=ze(e,new(t&&r?r:s)(me,n))}catch(r){if(!t)throw r;e=ze(e,new s(me,n))}return e}function ze(e,t){return e.pipeThrough(t)}const Ce="data";class xe extends p{constructor(e,n){super({});const r=this,{codecType:s}=e;let i;s.startsWith("deflate")?i=be:s.startsWith("inflate")&&(i=ge);let o=0;const c=new i(e,n),f=super.readable,a=new p({transform(e,t){e&&e.length&&(o+=e.length,t.enqueue(e))},flush(){const{signature:e}=c;t.assign(r,{signature:e,size:o})}});t.defineProperty(r,"readable",{get:()=>f.pipeThrough(c).pipeThrough(a)})}}const _e=new a,Ae=new a;let Ie=0;async function De(e){try{const{options:t,scripts:r,config:s}=e;r&&r.length&&importScripts.apply(void 0,r),self.initCodec&&self.initCodec(),s.CompressionStreamNative=self.CompressionStream,s.DecompressionStreamNative=self.DecompressionStream,self.Deflate&&(s.CompressionStream=new k(self.Deflate)),self.Inflate&&(s.DecompressionStream=new k(self.Inflate));const i={highWaterMark:1,size:()=>s.chunkSize},o=e.readable||new y({async pull(e){const t=new u((e=>_e.set(Ie,e)));Ve({type:"pull",messageId:Ie}),Ie=(Ie+1)%n.MAX_SAFE_INTEGER;const{value:r,done:s}=await t;e.enqueue(r),s&&e.close()}},i),c=e.writable||new m({async write(e){let t;const r=new u((e=>t=e));Ae.set(Ie,t),Ve({type:Ce,value:e,messageId:Ie}),Ie=(Ie+1)%n.MAX_SAFE_INTEGER,await r}},i),f=new xe(t,s);await o.pipeThrough(f).pipeTo(c,{preventClose:!0,preventAbort:!0});try{await c.getWriter().close()}catch(e){}const{signature:a,size:l}=f;Ve({type:"close",result:{signature:a,size:l}})}catch(e){Pe(e)}}function Ve(e){let{value:t}=e;if(t)if(t.length)try{t=new i(t),e.value=t.buffer,d(e,[e.value])}catch(t){d(e)}else d(e);else d(e)}function Pe(e){const{message:t,stack:n,code:r,name:s}=e;d({error:{message:t,stack:n,code:r,name:s}})}addEventListener("message",(({data:e})=>{const{type:t,messageId:n,value:r,done:s}=e;try{if("start"==t&&De(e),t==Ce){const e=_e.get(n);_e.delete(n),e({value:new i(r),done:s})}if("ack"==t){const e=Ae.get(n);Ae.delete(n),e()}}catch(e){Pe(e)}}));const Re=-2;function Be(t){return Ee(t.map((([t,n])=>new e(t).fill(n,0,t))))}function Ee(t){return t.reduce(((t,n)=>t.concat(e.isArray(n)?Ee(n):n)),[])}const Me=[0,1,2,3].concat(...Be([[2,4],[2,5],[4,6],[4,7],[8,8],[8,9],[16,10],[16,11],[32,12],[32,13],[64,14],[64,15],[2,0],[1,16],[1,17],[2,18],[2,19],[4,20],[4,21],[8,22],[8,23],[16,24],[16,25],[32,26],[32,27],[64,28],[64,29]]));function Ke(){const e=this;function t(e,t){let n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}e.ne=n=>{const s=e.re,i=e.ie.se,o=e.ie.oe;let c,f,a,l=-1;for(n.ce=0,n.fe=573,c=0;o>c;c++)0!==s[2*c]?(n.ae[++n.ce]=l=c,n.le[c]=0):s[2*c+1]=0;for(;2>n.ce;)a=n.ae[++n.ce]=2>l?++l:0,s[2*a]=1,n.le[a]=0,n.ue--,i&&(n.we-=i[2*a+1]);for(e.he=l,c=r.floor(n.ce/2);c>=1;c--)n.de(s,c);a=o;do{c=n.ae[1],n.ae[1]=n.ae[n.ce--],n.de(s,1),f=n.ae[1],n.ae[--n.fe]=c,n.ae[--n.fe]=f,s[2*a]=s[2*c]+s[2*f],n.le[a]=r.max(n.le[c],n.le[f])+1,s[2*c+1]=s[2*f+1]=a,n.ae[1]=a++,n.de(s,1)}while(n.ce>=2);n.ae[--n.fe]=n.ae[1],(t=>{const n=e.re,r=e.ie.se,s=e.ie.pe,i=e.ie.ye,o=e.ie.me;let c,f,a,l,u,w,h=0;for(l=0;15>=l;l++)t.be[l]=0;for(n[2*t.ae[t.fe]+1]=0,c=t.fe+1;573>c;c++)f=t.ae[c],l=n[2*n[2*f+1]+1]+1,l>o&&(l=o,h++),n[2*f+1]=l,f>e.he||(t.be[l]++,u=0,i>f||(u=s[f-i]),w=n[2*f],t.ue+=w*(l+u),r&&(t.we+=w*(r[2*f+1]+u)));if(0!==h){do{for(l=o-1;0===t.be[l];)l--;t.be[l]--,t.be[l+1]+=2,t.be[o]--,h-=2}while(h>0);for(l=o;0!==l;l--)for(f=t.be[l];0!==f;)a=t.ae[--c],a>e.he||(n[2*a+1]!=l&&(t.ue+=(l-n[2*a+1])*n[2*a],n[2*a+1]=l),f--)}})(n),((e,n,r)=>{const s=[];let i,o,c,f=0;for(i=1;15>=i;i++)s[i]=f=f+r[i-1]<<1;for(o=0;n>=o;o++)c=e[2*o+1],0!==c&&(e[2*o]=t(s[c]++,c))})(s,e.he,n.be)}}function Ue(e,t,n,r,s){const i=this;i.se=e,i.pe=t,i.ye=n,i.oe=r,i.me=s}Ke.ge=[0,1,2,3,4,5,6,7].concat(...Be([[2,8],[2,9],[2,10],[2,11],[4,12],[4,13],[4,14],[4,15],[8,16],[8,17],[8,18],[8,19],[16,20],[16,21],[16,22],[16,23],[32,24],[32,25],[32,26],[31,27],[1,28]])),Ke.ke=[0,1,2,3,4,5,6,7,8,10,12,14,16,20,24,28,32,40,48,56,64,80,96,112,128,160,192,224,0],Ke.ve=[0,1,2,3,4,6,8,12,16,24,32,48,64,96,128,192,256,384,512,768,1024,1536,2048,3072,4096,6144,8192,12288,16384,24576],Ke.Se=e=>256>e?Me[e]:Me[256+(e>>>7)],Ke.ze=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Ke.Ce=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],Ke.xe=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Ke._e=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];const Ne=Be([[144,8],[112,9],[24,7],[8,8]]);Ue.Ae=Ee([12,140,76,204,44,172,108,236,28,156,92,220,60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,150,86,214,54,182,118,246,14,142,78,206,46,174,110,238,30,158,94,222,62,190,126,254,1,129,65,193,33,161,97,225,17,145,81,209,49,177,113,241,9,137,73,201,41,169,105,233,25,153,89,217,57,185,121,249,5,133,69,197,37,165,101,229,21,149,85,213,53,181,117,245,13,141,77,205,45,173,109,237,29,157,93,221,61,189,125,253,19,275,147,403,83,339,211,467,51,307,179,435,115,371,243,499,11,267,139,395,75,331,203,459,43,299,171,427,107,363,235,491,27,283,155,411,91,347,219,475,59,315,187,443,123,379,251,507,7,263,135,391,71,327,199,455,39,295,167,423,103,359,231,487,23,279,151,407,87,343,215,471,55,311,183,439,119,375,247,503,15,271,143,399,79,335,207,463,47,303,175,431,111,367,239,495,31,287,159,415,95,351,223,479,63,319,191,447,127,383,255,511,0,64,32,96,16,80,48,112,8,72,40,104,24,88,56,120,4,68,36,100,20,84,52,116,3,131,67,195,35,163,99,227].map(((e,t)=>[e,Ne[t]])));const Oe=Be([[30,5]]);function Te(e,t,n,r,s){const i=this;i.Ie=e,i.De=t,i.Ve=n,i.Pe=r,i.Re=s}Ue.Be=Ee([0,16,8,24,4,20,12,28,2,18,10,26,6,22,14,30,1,17,9,25,5,21,13,29,3,19,11,27,7,23].map(((e,t)=>[e,Oe[t]]))),Ue.Ee=new Ue(Ue.Ae,Ke.ze,257,286,15),Ue.Me=new Ue(Ue.Be,Ke.Ce,0,30,15),Ue.Ke=new Ue(null,Ke.xe,0,19,7);const We=[new Te(0,0,0,0,0),new Te(4,4,8,4,1),new Te(4,5,16,8,1),new Te(4,6,32,32,1),new Te(4,4,16,16,2),new Te(8,16,32,32,2),new Te(8,16,128,128,2),new Te(8,32,128,256,2),new Te(32,128,258,1024,2),new Te(32,258,258,4096,2)],je=["need dictionary","stream end","","","stream error","data error","","buffer error","",""],He=113,Le=666,Fe=262;function qe(e,t,n,r){const s=e[2*t],i=e[2*n];return i>s||s==i&&r[t]<=r[n]}function Ge(){const e=this;let t,n,s,c,f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z,C,x,_,A,I,D,V,P,R,B,E,M,K;const U=new Ke,N=new Ke,O=new Ke;let T,W,j,H,L,F;function q(){let t;for(t=0;286>t;t++)E[2*t]=0;for(t=0;30>t;t++)M[2*t]=0;for(t=0;19>t;t++)K[2*t]=0;E[512]=1,e.ue=e.we=0,W=j=0}function G(e,t){let n,r=-1,s=e[1],i=0,o=7,c=4;0===s&&(o=138,c=3),e[2*(t+1)+1]=65535;for(let f=0;t>=f;f++)n=s,s=e[2*(f+1)+1],++i<o&&n==s||(c>i?K[2*n]+=i:0!==n?(n!=r&&K[2*n]++,K[32]++):i>10?K[36]++:K[34]++,i=0,r=n,0===s?(o=138,c=3):n==s?(o=6,c=3):(o=7,c=4))}function J(t){e.Ue[e.pending++]=t}function Q(e){J(255&e),J(e>>>8&255)}function X(e,t){let n;const r=t;F>16-r?(n=e,L|=n<<F&65535,Q(L),L=n>>>16-F,F+=r-16):(L|=e<<F&65535,F+=r)}function Y(e,t){const n=2*e;X(65535&t[n],65535&t[n+1])}function Z(e,t){let n,r,s=-1,i=e[1],o=0,c=7,f=4;for(0===i&&(c=138,f=3),n=0;t>=n;n++)if(r=i,i=e[2*(n+1)+1],++o>=c||r!=i){if(f>o)do{Y(r,K)}while(0!=--o);else 0!==r?(r!=s&&(Y(r,K),o--),Y(16,K),X(o-3,2)):o>10?(Y(18,K),X(o-11,7)):(Y(17,K),X(o-3,3));o=0,s=r,0===i?(c=138,f=3):r==i?(c=6,f=3):(c=7,f=4)}}function $(){16==F?(Q(L),L=0,F=0):8>F||(J(255&L),L>>>=8,F-=8)}function ee(t,n){let s,i,o;if(e.Ne[W]=t,e.Oe[W]=255&n,W++,0===t?E[2*n]++:(j++,t--,E[2*(Ke.ge[n]+256+1)]++,M[2*Ke.Se(t)]++),0==(8191&W)&&V>2){for(s=8*W,i=C-k,o=0;30>o;o++)s+=M[2*o]*(5+Ke.Ce[o]);if(s>>>=3,j<r.floor(W/2)&&s<r.floor(i/2))return!0}return W==T-1}function te(t,n){let r,s,i,o,c=0;if(0!==W)do{r=e.Ne[c],s=e.Oe[c],c++,0===r?Y(s,t):(i=Ke.ge[s],Y(i+256+1,t),o=Ke.ze[i],0!==o&&(s-=Ke.ke[i],X(s,o)),r--,i=Ke.Se(r),Y(i,n),o=Ke.Ce[i],0!==o&&(r-=Ke.ve[i],X(r,o)))}while(W>c);Y(256,t),H=t[513]}function ne(){F>8?Q(L):F>0&&J(255&L),L=0,F=0}function re(t,n,r){X(0+(r?1:0),3),((t,n)=>{ne(),H=8,Q(n),Q(~n),e.Ue.set(u.subarray(t,t+n),e.pending),e.pending+=n})(t,n)}function se(n){((t,n,r)=>{let s,i,o=0;V>0?(U.ne(e),N.ne(e),o=(()=>{let t;for(G(E,U.he),G(M,N.he),O.ne(e),t=18;t>=3&&0===K[2*Ke._e[t]+1];t--);return e.ue+=14+3*(t+1),t})(),s=e.ue+3+7>>>3,i=e.we+3+7>>>3,i>s||(s=i)):s=i=n+5,n+4>s||-1==t?i==s?(X(2+(r?1:0),3),te(Ue.Ae,Ue.Be)):(X(4+(r?1:0),3),((e,t,n)=>{let r;for(X(e-257,5),X(t-1,5),X(n-4,4),r=0;n>r;r++)X(K[2*Ke._e[r]+1],3);Z(E,e-1),Z(M,t-1)})(U.he+1,N.he+1,o+1),te(E,M)):re(t,n,r),q(),r&&ne()})(0>k?-1:k,C-k,n),k=C,t.Te()}function ie(){let e,n,r,s;do{if(s=w-_-C,0===s&&0===C&&0===_)s=f;else if(-1==s)s--;else if(C>=f+f-Fe){u.set(u.subarray(f,f+f),0),x-=f,C-=f,k-=f,e=y,r=e;do{n=65535&d[--r],d[r]=f>n?0:n-f}while(0!=--e);e=f,r=e;do{n=65535&h[--r],h[r]=f>n?0:n-f}while(0!=--e);s+=f}if(0===t.We)return;e=t.je(u,C+_,s),_+=e,3>_||(p=255&u[C],p=(p<<g^255&u[C+1])&b)}while(Fe>_&&0!==t.We)}function oe(e){let t,n,r=I,s=C,i=A;const o=C>f-Fe?C-(f-Fe):0;let c=B;const a=l,w=C+258;let d=u[s+i-1],p=u[s+i];R>A||(r>>=2),c>_&&(c=_);do{if(t=e,u[t+i]==p&&u[t+i-1]==d&&u[t]==u[s]&&u[++t]==u[s+1]){s+=2,t++;do{}while(u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&u[++s]==u[++t]&&w>s);if(n=258-(w-s),s=w-258,n>i){if(x=e,i=n,n>=c)break;d=u[s+i-1],p=u[s+i]}}}while((e=65535&h[e&a])>o&&0!=--r);return i>_?_:i}e.le=[],e.be=[],e.ae=[],E=[],M=[],K=[],e.de=(t,n)=>{const r=e.ae,s=r[n];let i=n<<1;for(;i<=e.ce&&(i<e.ce&&qe(t,r[i+1],r[i],e.le)&&i++,!qe(t,s,r[i],e.le));)r[n]=r[i],n=i,i<<=1;r[n]=s},e.He=(t,S,x,W,j,G)=>(W||(W=8),j||(j=8),G||(G=0),t.Le=null,-1==S&&(S=6),1>j||j>9||8!=W||9>x||x>15||0>S||S>9||0>G||G>2?Re:(t.Fe=e,a=x,f=1<<a,l=f-1,m=j+7,y=1<<m,b=y-1,g=r.floor((m+3-1)/3),u=new i(2*f),h=[],d=[],T=1<<j+6,e.Ue=new i(4*T),s=4*T,e.Ne=new o(T),e.Oe=new i(T),V=S,P=G,(t=>(t.qe=t.Ge=0,t.Le=null,e.pending=0,e.Je=0,n=He,c=0,U.re=E,U.ie=Ue.Ee,N.re=M,N.ie=Ue.Me,O.re=K,O.ie=Ue.Ke,L=0,F=0,H=8,q(),(()=>{w=2*f,d[y-1]=0;for(let e=0;y-1>e;e++)d[e]=0;D=We[V].De,R=We[V].Ie,B=We[V].Ve,I=We[V].Pe,C=0,k=0,_=0,v=A=2,z=0,p=0})(),0))(t))),e.Qe=()=>42!=n&&n!=He&&n!=Le?Re:(e.Oe=null,e.Ne=null,e.Ue=null,d=null,h=null,u=null,e.Fe=null,n==He?-3:0),e.Xe=(e,t,n)=>{let r=0;return-1==t&&(t=6),0>t||t>9||0>n||n>2?Re:(We[V].Re!=We[t].Re&&0!==e.qe&&(r=e.Ye(1)),V!=t&&(V=t,D=We[V].De,R=We[V].Ie,B=We[V].Ve,I=We[V].Pe),P=n,r)},e.Ze=(e,t,r)=>{let s,i=r,o=0;if(!t||42!=n)return Re;if(3>i)return 0;for(i>f-Fe&&(i=f-Fe,o=r-i),u.set(t.subarray(o,o+i),0),C=i,k=i,p=255&u[0],p=(p<<g^255&u[1])&b,s=0;i-3>=s;s++)p=(p<<g^255&u[s+2])&b,h[s&l]=d[p],d[p]=s;return 0},e.Ye=(r,i)=>{let o,w,m,I,R;if(i>4||0>i)return Re;if(!r.$e||!r.et&&0!==r.We||n==Le&&4!=i)return r.Le=je[4],Re;if(0===r.tt)return r.Le=je[7],-5;var B;if(t=r,I=c,c=i,42==n&&(w=8+(a-8<<4)<<8,m=(V-1&255)>>1,m>3&&(m=3),w|=m<<6,0!==C&&(w|=32),w+=31-w%31,n=He,J((B=w)>>8&255),J(255&B)),0!==e.pending){if(t.Te(),0===t.tt)return c=-1,0}else if(0===t.We&&I>=i&&4!=i)return t.Le=je[7],-5;if(n==Le&&0!==t.We)return r.Le=je[7],-5;if(0!==t.We||0!==_||0!=i&&n!=Le){switch(R=-1,We[V].Re){case 0:R=(e=>{let n,r=65535;for(r>s-5&&(r=s-5);;){if(1>=_){if(ie(),0===_&&0==e)return 0;if(0===_)break}if(C+=_,_=0,n=k+r,(0===C||C>=n)&&(_=C-n,C=n,se(!1),0===t.tt))return 0;if(C-k>=f-Fe&&(se(!1),0===t.tt))return 0}return se(4==e),0===t.tt?4==e?2:0:4==e?3:1})(i);break;case 1:R=(e=>{let n,r=0;for(;;){if(Fe>_){if(ie(),Fe>_&&0==e)return 0;if(0===_)break}if(3>_||(p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C),0===r||(C-r&65535)>f-Fe||2!=P&&(v=oe(r)),3>v)n=ee(0,255&u[C]),_--,C++;else if(n=ee(C-x,v-3),_-=v,v>D||3>_)C+=v,v=0,p=255&u[C],p=(p<<g^255&u[C+1])&b;else{v--;do{C++,p=(p<<g^255&u[C+2])&b,r=65535&d[p],h[C&l]=d[p],d[p]=C}while(0!=--v);C++}if(n&&(se(!1),0===t.tt))return 0}return se(4==e),0===t.tt?4==e?2:0:4==e?3:1})(i);break;case 2:R=(e=>{let n,r,s=0;for(;;){if(Fe>_){if(ie(),Fe>_&&0==e)return 0;if(0===_)break}if(3>_||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C),A=v,S=x,v=2,0!==s&&D>A&&f-Fe>=(C-s&65535)&&(2!=P&&(v=oe(s)),5>=v&&(1==P||3==v&&C-x>4096)&&(v=2)),3>A||v>A)if(0!==z){if(n=ee(0,255&u[C-1]),n&&se(!1),C++,_--,0===t.tt)return 0}else z=1,C++,_--;else{r=C+_-3,n=ee(C-1-S,A-3),_-=A-1,A-=2;do{++C>r||(p=(p<<g^255&u[C+2])&b,s=65535&d[p],h[C&l]=d[p],d[p]=C)}while(0!=--A);if(z=0,v=2,C++,n&&(se(!1),0===t.tt))return 0}}return 0!==z&&(n=ee(0,255&u[C-1]),z=0),se(4==e),0===t.tt?4==e?2:0:4==e?3:1})(i)}if(2!=R&&3!=R||(n=Le),0==R||2==R)return 0===t.tt&&(c=-1),0;if(1==R){if(1==i)X(2,3),Y(256,Ue.Ae),$(),9>1+H+10-F&&(X(2,3),Y(256,Ue.Ae),$()),H=7;else if(re(0,0,!1),3==i)for(o=0;y>o;o++)d[o]=0;if(t.Te(),0===t.tt)return c=-1,0}}return 4!=i?0:1}}function Je(){const e=this;e.nt=0,e.rt=0,e.We=0,e.qe=0,e.tt=0,e.Ge=0}function Qe(e){const t=new Je,n=(o=e&&e.chunkSize?e.chunkSize:65536)+5*(r.floor(o/16383)+1);var o;const c=new i(n);let f=e?e.level:-1;void 0===f&&(f=-1),t.He(f),t.$e=c,this.append=(e,r)=>{let o,f,a=0,l=0,u=0;const w=[];if(e.length){t.nt=0,t.et=e,t.We=e.length;do{if(t.rt=0,t.tt=n,o=t.Ye(0),0!=o)throw new s("deflating: "+t.Le);t.rt&&(t.rt==n?w.push(new i(c)):w.push(c.subarray(0,t.rt))),u+=t.rt,r&&t.nt>0&&t.nt!=a&&(r(t.nt),a=t.nt)}while(t.We>0||0===t.tt);return w.length>1?(f=new i(u),w.forEach((e=>{f.set(e,l),l+=e.length}))):f=w[0]?new i(w[0]):new i,f}},this.flush=()=>{let e,r,o=0,f=0;const a=[];do{if(t.rt=0,t.tt=n,e=t.Ye(4),1!=e&&0!=e)throw new s("deflating: "+t.Le);n-t.tt>0&&a.push(c.slice(0,t.rt)),f+=t.rt}while(t.We>0||0===t.tt);return t.Qe(),r=new i(f),a.forEach((e=>{r.set(e,o),o+=e.length})),r}}Je.prototype={He(e,t){const n=this;return n.Fe=new Ge,t||(t=15),n.Fe.He(n,e,t)},Ye(e){const t=this;return t.Fe?t.Fe.Ye(t,e):Re},Qe(){const e=this;if(!e.Fe)return Re;const t=e.Fe.Qe();return e.Fe=null,t},Xe(e,t){const n=this;return n.Fe?n.Fe.Xe(n,e,t):Re},Ze(e,t){const n=this;return n.Fe?n.Fe.Ze(n,e,t):Re},je(e,t,n){const r=this;let s=r.We;return s>n&&(s=n),0===s?0:(r.We-=s,e.set(r.et.subarray(r.nt,r.nt+s),t),r.nt+=s,r.qe+=s,s)},Te(){const e=this;let t=e.Fe.pending;t>e.tt&&(t=e.tt),0!==t&&(e.$e.set(e.Fe.Ue.subarray(e.Fe.Je,e.Fe.Je+t),e.rt),e.rt+=t,e.Fe.Je+=t,e.Ge+=t,e.tt-=t,e.Fe.pending-=t,0===e.Fe.pending&&(e.Fe.Je=0))}};const Xe=-2,Ye=-3,Ze=-5,$e=[0,1,3,7,15,31,63,127,255,511,1023,2047,4095,8191,16383,32767,65535],et=[96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,192,80,7,10,0,8,96,0,8,32,0,9,160,0,8,0,0,8,128,0,8,64,0,9,224,80,7,6,0,8,88,0,8,24,0,9,144,83,7,59,0,8,120,0,8,56,0,9,208,81,7,17,0,8,104,0,8,40,0,9,176,0,8,8,0,8,136,0,8,72,0,9,240,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,200,81,7,13,0,8,100,0,8,36,0,9,168,0,8,4,0,8,132,0,8,68,0,9,232,80,7,8,0,8,92,0,8,28,0,9,152,84,7,83,0,8,124,0,8,60,0,9,216,82,7,23,0,8,108,0,8,44,0,9,184,0,8,12,0,8,140,0,8,76,0,9,248,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,196,81,7,11,0,8,98,0,8,34,0,9,164,0,8,2,0,8,130,0,8,66,0,9,228,80,7,7,0,8,90,0,8,26,0,9,148,84,7,67,0,8,122,0,8,58,0,9,212,82,7,19,0,8,106,0,8,42,0,9,180,0,8,10,0,8,138,0,8,74,0,9,244,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,204,81,7,15,0,8,102,0,8,38,0,9,172,0,8,6,0,8,134,0,8,70,0,9,236,80,7,9,0,8,94,0,8,30,0,9,156,84,7,99,0,8,126,0,8,62,0,9,220,82,7,27,0,8,110,0,8,46,0,9,188,0,8,14,0,8,142,0,8,78,0,9,252,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,194,80,7,10,0,8,97,0,8,33,0,9,162,0,8,1,0,8,129,0,8,65,0,9,226,80,7,6,0,8,89,0,8,25,0,9,146,83,7,59,0,8,121,0,8,57,0,9,210,81,7,17,0,8,105,0,8,41,0,9,178,0,8,9,0,8,137,0,8,73,0,9,242,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,202,81,7,13,0,8,101,0,8,37,0,9,170,0,8,5,0,8,133,0,8,69,0,9,234,80,7,8,0,8,93,0,8,29,0,9,154,84,7,83,0,8,125,0,8,61,0,9,218,82,7,23,0,8,109,0,8,45,0,9,186,0,8,13,0,8,141,0,8,77,0,9,250,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,198,81,7,11,0,8,99,0,8,35,0,9,166,0,8,3,0,8,131,0,8,67,0,9,230,80,7,7,0,8,91,0,8,27,0,9,150,84,7,67,0,8,123,0,8,59,0,9,214,82,7,19,0,8,107,0,8,43,0,9,182,0,8,11,0,8,139,0,8,75,0,9,246,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,206,81,7,15,0,8,103,0,8,39,0,9,174,0,8,7,0,8,135,0,8,71,0,9,238,80,7,9,0,8,95,0,8,31,0,9,158,84,7,99,0,8,127,0,8,63,0,9,222,82,7,27,0,8,111,0,8,47,0,9,190,0,8,15,0,8,143,0,8,79,0,9,254,96,7,256,0,8,80,0,8,16,84,8,115,82,7,31,0,8,112,0,8,48,0,9,193,80,7,10,0,8,96,0,8,32,0,9,161,0,8,0,0,8,128,0,8,64,0,9,225,80,7,6,0,8,88,0,8,24,0,9,145,83,7,59,0,8,120,0,8,56,0,9,209,81,7,17,0,8,104,0,8,40,0,9,177,0,8,8,0,8,136,0,8,72,0,9,241,80,7,4,0,8,84,0,8,20,85,8,227,83,7,43,0,8,116,0,8,52,0,9,201,81,7,13,0,8,100,0,8,36,0,9,169,0,8,4,0,8,132,0,8,68,0,9,233,80,7,8,0,8,92,0,8,28,0,9,153,84,7,83,0,8,124,0,8,60,0,9,217,82,7,23,0,8,108,0,8,44,0,9,185,0,8,12,0,8,140,0,8,76,0,9,249,80,7,3,0,8,82,0,8,18,85,8,163,83,7,35,0,8,114,0,8,50,0,9,197,81,7,11,0,8,98,0,8,34,0,9,165,0,8,2,0,8,130,0,8,66,0,9,229,80,7,7,0,8,90,0,8,26,0,9,149,84,7,67,0,8,122,0,8,58,0,9,213,82,7,19,0,8,106,0,8,42,0,9,181,0,8,10,0,8,138,0,8,74,0,9,245,80,7,5,0,8,86,0,8,22,192,8,0,83,7,51,0,8,118,0,8,54,0,9,205,81,7,15,0,8,102,0,8,38,0,9,173,0,8,6,0,8,134,0,8,70,0,9,237,80,7,9,0,8,94,0,8,30,0,9,157,84,7,99,0,8,126,0,8,62,0,9,221,82,7,27,0,8,110,0,8,46,0,9,189,0,8,14,0,8,142,0,8,78,0,9,253,96,7,256,0,8,81,0,8,17,85,8,131,82,7,31,0,8,113,0,8,49,0,9,195,80,7,10,0,8,97,0,8,33,0,9,163,0,8,1,0,8,129,0,8,65,0,9,227,80,7,6,0,8,89,0,8,25,0,9,147,83,7,59,0,8,121,0,8,57,0,9,211,81,7,17,0,8,105,0,8,41,0,9,179,0,8,9,0,8,137,0,8,73,0,9,243,80,7,4,0,8,85,0,8,21,80,8,258,83,7,43,0,8,117,0,8,53,0,9,203,81,7,13,0,8,101,0,8,37,0,9,171,0,8,5,0,8,133,0,8,69,0,9,235,80,7,8,0,8,93,0,8,29,0,9,155,84,7,83,0,8,125,0,8,61,0,9,219,82,7,23,0,8,109,0,8,45,0,9,187,0,8,13,0,8,141,0,8,77,0,9,251,80,7,3,0,8,83,0,8,19,85,8,195,83,7,35,0,8,115,0,8,51,0,9,199,81,7,11,0,8,99,0,8,35,0,9,167,0,8,3,0,8,131,0,8,67,0,9,231,80,7,7,0,8,91,0,8,27,0,9,151,84,7,67,0,8,123,0,8,59,0,9,215,82,7,19,0,8,107,0,8,43,0,9,183,0,8,11,0,8,139,0,8,75,0,9,247,80,7,5,0,8,87,0,8,23,192,8,0,83,7,51,0,8,119,0,8,55,0,9,207,81,7,15,0,8,103,0,8,39,0,9,175,0,8,7,0,8,135,0,8,71,0,9,239,80,7,9,0,8,95,0,8,31,0,9,159,84,7,99,0,8,127,0,8,63,0,9,223,82,7,27,0,8,111,0,8,47,0,9,191,0,8,15,0,8,143,0,8,79,0,9,255],tt=[80,5,1,87,5,257,83,5,17,91,5,4097,81,5,5,89,5,1025,85,5,65,93,5,16385,80,5,3,88,5,513,84,5,33,92,5,8193,82,5,9,90,5,2049,86,5,129,192,5,24577,80,5,2,87,5,385,83,5,25,91,5,6145,81,5,7,89,5,1537,85,5,97,93,5,24577,80,5,4,88,5,769,84,5,49,92,5,12289,82,5,13,90,5,3073,86,5,193,192,5,24577],nt=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],rt=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,112,112],st=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],it=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function ot(){let e,t,n,r,s,i;function o(e,t,o,c,f,a,l,u,w,h,d){let p,y,m,b,g,k,v,S,z,C,x,_,A,I,D;C=0,g=o;do{n[e[t+C]]++,C++,g--}while(0!==g);if(n[0]==o)return l[0]=-1,u[0]=0,0;for(S=u[0],k=1;15>=k&&0===n[k];k++);for(v=k,k>S&&(S=k),g=15;0!==g&&0===n[g];g--);for(m=g,S>g&&(S=g),u[0]=S,I=1<<k;g>k;k++,I<<=1)if(0>(I-=n[k]))return Ye;if(0>(I-=n[g]))return Ye;for(n[g]+=I,i[1]=k=0,C=1,A=2;0!=--g;)i[A]=k+=n[C],A++,C++;g=0,C=0;do{0!==(k=e[t+C])&&(d[i[k]++]=g),C++}while(++g<o);for(o=i[m],i[0]=g=0,C=0,b=-1,_=-S,s[0]=0,x=0,D=0;m>=v;v++)for(p=n[v];0!=p--;){for(;v>_+S;){if(b++,_+=S,D=m-_,D=D>S?S:D,(y=1<<(k=v-_))>p+1&&(y-=p+1,A=v,D>k))for(;++k<D&&(y<<=1)>n[++A];)y-=n[A];if(D=1<<k,h[0]+D>1440)return Ye;s[b]=x=h[0],h[0]+=D,0!==b?(i[b]=g,r[0]=k,r[1]=S,k=g>>>_-S,r[2]=x-s[b-1]-k,w.set(r,3*(s[b-1]+k))):l[0]=x}for(r[1]=v-_,o>C?d[C]<c?(r[0]=256>d[C]?0:96,r[2]=d[C++]):(r[0]=a[d[C]-c]+16+64,r[2]=f[d[C++]-c]):r[0]=192,y=1<<v-_,k=g>>>_;D>k;k+=y)w.set(r,3*(x+k));for(k=1<<v-1;0!=(g&k);k>>>=1)g^=k;for(g^=k,z=(1<<_)-1;(g&z)!=i[b];)b--,_-=S,z=(1<<_)-1}return 0!==I&&1!=m?Ze:0}function c(o){let c;for(e||(e=[],t=[],n=new f(16),r=[],s=new f(15),i=new f(16)),t.length<o&&(t=[]),c=0;o>c;c++)t[c]=0;for(c=0;16>c;c++)n[c]=0;for(c=0;3>c;c++)r[c]=0;s.set(n.subarray(0,15),0),i.set(n.subarray(0,16),0)}this.st=(n,r,s,i,f)=>{let a;return c(19),e[0]=0,a=o(n,0,19,19,null,null,s,r,i,e,t),a==Ye?f.Le="oversubscribed dynamic bit lengths tree":a!=Ze&&0!==r[0]||(f.Le="incomplete dynamic bit lengths tree",a=Ye),a},this.it=(n,r,s,i,f,a,l,u,w)=>{let h;return c(288),e[0]=0,h=o(s,0,n,257,nt,rt,a,i,u,e,t),0!=h||0===i[0]?(h==Ye?w.Le="oversubscribed literal/length tree":-4!=h&&(w.Le="incomplete literal/length tree",h=Ye),h):(c(288),h=o(s,n,r,0,st,it,l,f,u,e,t),0!=h||0===f[0]&&n>257?(h==Ye?w.Le="oversubscribed distance tree":h==Ze?(w.Le="incomplete distance tree",h=Ye):-4!=h&&(w.Le="empty distance tree with lengths",h=Ye),h):0)}}function ct(){const e=this;let t,n,r,s,i=0,o=0,c=0,f=0,a=0,l=0,u=0,w=0,h=0,d=0;function p(e,t,n,r,s,i,o,c){let f,a,l,u,w,h,d,p,y,m,b,g,k,v,S,z;d=c.nt,p=c.We,w=o.ot,h=o.ct,y=o.write,m=y<o.read?o.read-y-1:o.end-y,b=$e[e],g=$e[t];do{for(;20>h;)p--,w|=(255&c.ft(d++))<<h,h+=8;if(f=w&b,a=n,l=r,z=3*(l+f),0!==(u=a[z]))for(;;){if(w>>=a[z+1],h-=a[z+1],0!=(16&u)){for(u&=15,k=a[z+2]+(w&$e[u]),w>>=u,h-=u;15>h;)p--,w|=(255&c.ft(d++))<<h,h+=8;for(f=w&g,a=s,l=i,z=3*(l+f),u=a[z];;){if(w>>=a[z+1],h-=a[z+1],0!=(16&u)){for(u&=15;u>h;)p--,w|=(255&c.ft(d++))<<h,h+=8;if(v=a[z+2]+(w&$e[u]),w>>=u,h-=u,m-=k,v>y){S=y-v;do{S+=o.end}while(0>S);if(u=o.end-S,k>u){if(k-=u,y-S>0&&u>y-S)do{o.lt[y++]=o.lt[S++]}while(0!=--u);else o.lt.set(o.lt.subarray(S,S+u),y),y+=u,S+=u,u=0;S=0}}else S=y-v,y-S>0&&2>y-S?(o.lt[y++]=o.lt[S++],o.lt[y++]=o.lt[S++],k-=2):(o.lt.set(o.lt.subarray(S,S+2),y),y+=2,S+=2,k-=2);if(y-S>0&&k>y-S)do{o.lt[y++]=o.lt[S++]}while(0!=--k);else o.lt.set(o.lt.subarray(S,S+k),y),y+=k,S+=k,k=0;break}if(0!=(64&u))return c.Le="invalid distance code",k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,Ye;f+=a[z+2],f+=w&$e[u],z=3*(l+f),u=a[z]}break}if(0!=(64&u))return 0!=(32&u)?(k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,1):(c.Le="invalid literal/length code",k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,Ye);if(f+=a[z+2],f+=w&$e[u],z=3*(l+f),0===(u=a[z])){w>>=a[z+1],h-=a[z+1],o.lt[y++]=a[z+2],m--;break}}else w>>=a[z+1],h-=a[z+1],o.lt[y++]=a[z+2],m--}while(m>=258&&p>=10);return k=c.We-p,k=k>h>>3?h>>3:k,p+=k,d-=k,h-=k<<3,o.ot=w,o.ct=h,c.We=p,c.qe+=d-c.nt,c.nt=d,o.write=y,0}e.init=(e,i,o,c,f,a)=>{t=0,u=e,w=i,r=o,h=c,s=f,d=a,n=null},e.ut=(e,y,m)=>{let b,g,k,v,S,z,C,x=0,_=0,A=0;for(A=y.nt,v=y.We,x=e.ot,_=e.ct,S=e.write,z=S<e.read?e.read-S-1:e.end-S;;)switch(t){case 0:if(z>=258&&v>=10&&(e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,m=p(u,w,r,h,s,d,e,y),A=y.nt,v=y.We,x=e.ot,_=e.ct,S=e.write,z=S<e.read?e.read-S-1:e.end-S,0!=m)){t=1==m?7:9;break}c=u,n=r,o=h,t=1;case 1:for(b=c;b>_;){if(0===v)return e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(A++))<<_,_+=8}if(g=3*(o+(x&$e[b])),x>>>=n[g+1],_-=n[g+1],k=n[g],0===k){f=n[g+2],t=6;break}if(0!=(16&k)){a=15&k,i=n[g+2],t=2;break}if(0==(64&k)){c=k,o=g/3+n[g+2];break}if(0!=(32&k)){t=7;break}return t=9,y.Le="invalid literal/length code",m=Ye,e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);case 2:for(b=a;b>_;){if(0===v)return e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(A++))<<_,_+=8}i+=x&$e[b],x>>=b,_-=b,c=w,n=s,o=d,t=3;case 3:for(b=c;b>_;){if(0===v)return e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(A++))<<_,_+=8}if(g=3*(o+(x&$e[b])),x>>=n[g+1],_-=n[g+1],k=n[g],0!=(16&k)){a=15&k,l=n[g+2],t=4;break}if(0==(64&k)){c=k,o=g/3+n[g+2];break}return t=9,y.Le="invalid distance code",m=Ye,e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);case 4:for(b=a;b>_;){if(0===v)return e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);m=0,v--,x|=(255&y.ft(A++))<<_,_+=8}l+=x&$e[b],x>>=b,_-=b,t=5;case 5:for(C=S-l;0>C;)C+=e.end;for(;0!==i;){if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.wt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);e.lt[S++]=e.lt[C++],z--,C==e.end&&(C=0),i--}t=0;break;case 6:if(0===z&&(S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z&&(e.write=S,m=e.wt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,S==e.end&&0!==e.read&&(S=0,z=S<e.read?e.read-S-1:e.end-S),0===z)))return e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);m=0,e.lt[S++]=f,z--,t=0;break;case 7:if(_>7&&(_-=8,v++,A--),e.write=S,m=e.wt(y,m),S=e.write,z=S<e.read?e.read-S-1:e.end-S,e.read!=e.write)return e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);t=8;case 8:return m=1,e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);case 9:return m=Ye,e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m);default:return m=Xe,e.ot=x,e.ct=_,y.We=v,y.qe+=A-y.nt,y.nt=A,e.write=S,e.wt(y,m)}},e.ht=()=>{}}ot.dt=(e,t,n,r)=>(e[0]=9,t[0]=5,n[0]=et,r[0]=tt,0);const ft=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];function at(e,t){const n=this;let r,s=0,o=0,c=0,a=0;const l=[0],u=[0],w=new ct;let h=0,d=new f(4320);const p=new ot;n.ct=0,n.ot=0,n.lt=new i(t),n.end=t,n.read=0,n.write=0,n.reset=(e,t)=>{t&&(t[0]=0),6==s&&w.ht(e),s=0,n.ct=0,n.ot=0,n.read=n.write=0},n.reset(e,null),n.wt=(e,t)=>{let r,s,i;return s=e.rt,i=n.read,r=(i>n.write?n.end:n.write)-i,r>e.tt&&(r=e.tt),0!==r&&t==Ze&&(t=0),e.tt-=r,e.Ge+=r,e.$e.set(n.lt.subarray(i,i+r),s),s+=r,i+=r,i==n.end&&(i=0,n.write==n.end&&(n.write=0),r=n.write-i,r>e.tt&&(r=e.tt),0!==r&&t==Ze&&(t=0),e.tt-=r,e.Ge+=r,e.$e.set(n.lt.subarray(i,i+r),s),s+=r,i+=r),e.rt=s,n.read=i,t},n.ut=(e,t)=>{let i,f,y,m,b,g,k,v;for(m=e.nt,b=e.We,f=n.ot,y=n.ct,g=n.write,k=g<n.read?n.read-g-1:n.end-g;;){let S,z,C,x,_,A,I,D;switch(s){case 0:for(;3>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}switch(i=7&f,h=1&i,i>>>1){case 0:f>>>=3,y-=3,i=7&y,f>>>=i,y-=i,s=1;break;case 1:S=[],z=[],C=[[]],x=[[]],ot.dt(S,z,C,x),w.init(S[0],z[0],C[0],0,x[0],0),f>>>=3,y-=3,s=6;break;case 2:f>>>=3,y-=3,s=3;break;case 3:return f>>>=3,y-=3,s=9,e.Le="invalid block type",t=Ye,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t)}break;case 1:for(;32>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}if((~f>>>16&65535)!=(65535&f))return s=9,e.Le="invalid stored block lengths",t=Ye,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);o=65535&f,f=y=0,s=0!==o?2:0!==h?7:0;break;case 2:if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);if(0===k&&(g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k&&(n.write=g,t=n.wt(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,g==n.end&&0!==n.read&&(g=0,k=g<n.read?n.read-g-1:n.end-g),0===k)))return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);if(t=0,i=o,i>b&&(i=b),i>k&&(i=k),n.lt.set(e.je(m,i),g),m+=i,b-=i,g+=i,k-=i,0!=(o-=i))break;s=0!==h?7:0;break;case 3:for(;14>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}if(c=i=16383&f,(31&i)>29||(i>>5&31)>29)return s=9,e.Le="too many length or distance symbols",t=Ye,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);if(i=258+(31&i)+(i>>5&31),!r||r.length<i)r=[];else for(v=0;i>v;v++)r[v]=0;f>>>=14,y-=14,a=0,s=4;case 4:for(;4+(c>>>10)>a;){for(;3>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}r[ft[a++]]=7&f,f>>>=3,y-=3}for(;19>a;)r[ft[a++]]=0;if(l[0]=7,i=p.st(r,l,u,d,e),0!=i)return(t=i)==Ye&&(r=null,s=9),n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);a=0,s=5;case 5:for(;i=c,258+(31&i)+(i>>5&31)>a;){let o,w;for(i=l[0];i>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}if(i=d[3*(u[0]+(f&$e[i]))+1],w=d[3*(u[0]+(f&$e[i]))+2],16>w)f>>>=i,y-=i,r[a++]=w;else{for(v=18==w?7:w-14,o=18==w?11:3;i+v>y;){if(0===b)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);t=0,b--,f|=(255&e.ft(m++))<<y,y+=8}if(f>>>=i,y-=i,o+=f&$e[v],f>>>=v,y-=v,v=a,i=c,v+o>258+(31&i)+(i>>5&31)||16==w&&1>v)return r=null,s=9,e.Le="invalid bit length repeat",t=Ye,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);w=16==w?r[v-1]:0;do{r[v++]=w}while(0!=--o);a=v}}if(u[0]=-1,_=[],A=[],I=[],D=[],_[0]=9,A[0]=6,i=c,i=p.it(257+(31&i),1+(i>>5&31),r,_,A,I,D,d,e),0!=i)return i==Ye&&(r=null,s=9),t=i,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);w.init(_[0],A[0],d,I[0],d,D[0]),s=6;case 6:if(n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,1!=(t=w.ut(n,e,t)))return n.wt(e,t);if(t=0,w.ht(e),m=e.nt,b=e.We,f=n.ot,y=n.ct,g=n.write,k=g<n.read?n.read-g-1:n.end-g,0===h){s=0;break}s=7;case 7:if(n.write=g,t=n.wt(e,t),g=n.write,k=g<n.read?n.read-g-1:n.end-g,n.read!=n.write)return n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);s=8;case 8:return t=1,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);case 9:return t=Ye,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t);default:return t=Xe,n.ot=f,n.ct=y,e.We=b,e.qe+=m-e.nt,e.nt=m,n.write=g,n.wt(e,t)}}},n.ht=e=>{n.reset(e,null),n.lt=null,d=null},n.yt=(e,t,r)=>{n.lt.set(e.subarray(t,t+r),0),n.read=n.write=r},n.bt=()=>1==s?1:0}const lt=13,ut=[0,0,255,255];function wt(){const e=this;function t(e){return e&&e.gt?(e.qe=e.Ge=0,e.Le=null,e.gt.mode=7,e.gt.kt.reset(e,null),0):Xe}e.mode=0,e.method=0,e.vt=[0],e.St=0,e.marker=0,e.zt=0,e.Ct=t=>(e.kt&&e.kt.ht(t),e.kt=null,0),e.xt=(n,r)=>(n.Le=null,e.kt=null,8>r||r>15?(e.Ct(n),Xe):(e.zt=r,n.gt.kt=new at(n,1<<r),t(n),0)),e._t=(e,t)=>{let n,r;if(!e||!e.gt||!e.et)return Xe;const s=e.gt;for(t=4==t?Ze:0,n=Ze;;)switch(s.mode){case 0:if(0===e.We)return n;if(n=t,e.We--,e.qe++,8!=(15&(s.method=e.ft(e.nt++)))){s.mode=lt,e.Le="unknown compression method",s.marker=5;break}if(8+(s.method>>4)>s.zt){s.mode=lt,e.Le="invalid win size",s.marker=5;break}s.mode=1;case 1:if(0===e.We)return n;if(n=t,e.We--,e.qe++,r=255&e.ft(e.nt++),((s.method<<8)+r)%31!=0){s.mode=lt,e.Le="incorrect header check",s.marker=5;break}if(0==(32&r)){s.mode=7;break}s.mode=2;case 2:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St=(255&e.ft(e.nt++))<<24&4278190080,s.mode=3;case 3:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St+=(255&e.ft(e.nt++))<<16&16711680,s.mode=4;case 4:if(0===e.We)return n;n=t,e.We--,e.qe++,s.St+=(255&e.ft(e.nt++))<<8&65280,s.mode=5;case 5:return 0===e.We?n:(n=t,e.We--,e.qe++,s.St+=255&e.ft(e.nt++),s.mode=6,2);case 6:return s.mode=lt,e.Le="need dictionary",s.marker=0,Xe;case 7:if(n=s.kt.ut(e,n),n==Ye){s.mode=lt,s.marker=0;break}if(0==n&&(n=t),1!=n)return n;n=t,s.kt.reset(e,s.vt),s.mode=12;case 12:return e.We=0,1;case lt:return Ye;default:return Xe}},e.At=(e,t,n)=>{let r=0,s=n;if(!e||!e.gt||6!=e.gt.mode)return Xe;const i=e.gt;return s<1<<i.zt||(s=(1<<i.zt)-1,r=n-s),i.kt.yt(t,r,s),i.mode=7,0},e.It=e=>{let n,r,s,i,o;if(!e||!e.gt)return Xe;const c=e.gt;if(c.mode!=lt&&(c.mode=lt,c.marker=0),0===(n=e.We))return Ze;for(r=e.nt,s=c.marker;0!==n&&4>s;)e.ft(r)==ut[s]?s++:s=0!==e.ft(r)?0:4-s,r++,n--;return e.qe+=r-e.nt,e.nt=r,e.We=n,c.marker=s,4!=s?Ye:(i=e.qe,o=e.Ge,t(e),e.qe=i,e.Ge=o,c.mode=7,0)},e.Dt=e=>e&&e.gt&&e.gt.kt?e.gt.kt.bt():Xe}function ht(){}function dt(e){const t=new ht,n=e&&e.chunkSize?r.floor(2*e.chunkSize):131072,o=new i(n);let c=!1;t.xt(),t.$e=o,this.append=(e,r)=>{const f=[];let a,l,u=0,w=0,h=0;if(0!==e.length){t.nt=0,t.et=e,t.We=e.length;do{if(t.rt=0,t.tt=n,0!==t.We||c||(t.nt=0,c=!0),a=t._t(0),c&&a===Ze){if(0!==t.We)throw new s("inflating: bad input")}else if(0!==a&&1!==a)throw new s("inflating: "+t.Le);if((c||1===a)&&t.We===e.length)throw new s("inflating: bad input");t.rt&&(t.rt===n?f.push(new i(o)):f.push(o.subarray(0,t.rt))),h+=t.rt,r&&t.nt>0&&t.nt!=u&&(r(t.nt),u=t.nt)}while(t.We>0||0===t.tt);return f.length>1?(l=new i(h),f.forEach((e=>{l.set(e,w),w+=e.length}))):l=f[0]?new i(f[0]):new i,l}},this.flush=()=>{t.Ct()}}ht.prototype={xt(e){const t=this;return t.gt=new wt,e||(e=15),t.gt.xt(t,e)},_t(e){const t=this;return t.gt?t.gt._t(t,e):Xe},Ct(){const e=this;if(!e.gt)return Xe;const t=e.gt.Ct(e);return e.gt=null,t},It(){const e=this;return e.gt?e.gt.It(e):Xe},At(e,t){const n=this;return n.gt?n.gt.At(n,e,t):Xe},ft(e){return this.et[e]},je(e,t){return this.et.subarray(e,e+t)}},self.initCodec=()=>{self.Deflate=Qe,self.Inflate=dt};
`],{type:"text/javascript"}));r({workerScripts:{inflate:[t],deflate:[t]}})}lp(ea);var ue=Gr.Platform.isDesktopApp?window.require("node:original-fs"):null,gt=Gr.Platform.isDesktopApp?ue.promises:null,Je=Gr.Platform.isDesktopApp?window.require("node:os"):null,K=Gr.Platform.isDesktopApp?window.require("node:path"):null,pi=Gr.Platform.isDesktopApp?window.require("node:url"):null,cp=Gr.Platform.isDesktopApp?window.require("node:zlib"):null;function En(r,t=0,e=r.byteLength-t){return r.buffer.slice(r.byteOffset+t,r.byteOffset+t+e)}var bt=class{constructor(t){this.type="file";this.filepath=t;let e=this.name=K.basename(t);this.fullpath=e;let n=K.extname(e);this.extension=n.substring(1).toLowerCase(),this.basename=K.basename(e,n)}async readText(){return gt.readFile(this.filepath,"utf8")}async read(){let t=await gt.readFile(this.filepath);return En(t)}async readZip(t){let e=null;try{e=await gt.open(this.filepath,"r");let n=await e.stat();return await t(new Vr(new Ls(e,n.size)))}finally{await(e==null?void 0:e.close())}}createReadStream(){return ue.createReadStream(this.filepath)}toString(){return this.filepath}},zr=class r{constructor(t){this.type="folder";this.filepath=t,this.name=K.basename(t)}async list(){let{filepath:t}=this,e=await gt.readdir(t,{withFileTypes:!0}),n=[];for(let i of e)i.isFile()?n.push(new bt(K.join(t,i.name))):i.isDirectory()&&n.push(new r(K.join(t,i.name)));return n}toString(){return this.filepath}},xa=class{constructor(t){this.type="file";this.file=t;let e=this.name=t.name;this.fullpath=e;let{basename:n,extension:i}=le(e);this.basename=n,this.extension=i}readText(){let{file:t}=this;return t.text?t.text():new Promise((e,n)=>{let i=new FileReader;i.addEventListener("load",()=>e(i.result)),i.addEventListener("error",n),i.readAsText(this.file)})}async read(){let{file:t}=this;return t.arrayBuffer?t.arrayBuffer():new Promise((e,n)=>{let i=new FileReader;i.addEventListener("load",()=>e(i.result)),i.addEventListener("error",n),i.readAsArrayBuffer(this.file)})}async readZip(t){return t(new Vr(new gr(this.file)))}toString(){return this.file.toString()}};async function Ms(r,t){let e=[];for(let n of r)try{n.type==="folder"?e.push(...await Ms(await n.list(),t)):n.type==="file"&&(!t||t(n))&&e.push(n)}catch(i){console.log("Skipping path: ",n.name,i)}return e}function le(r){let t=Math.max(r.lastIndexOf("/"),r.lastIndexOf("\\")),e=r,n="";t>=0&&(e=r.substring(t+1),n=r.substring(0,t));let[i,a]=Tn(e);return{parent:n,name:e,basename:i,extension:a}}function Tn(r){let t=r.lastIndexOf("."),e=r,n="";return t>0&&(e=r.substring(0,t),n=r.substring(t+1).toLowerCase()),[e,n]}var Ls=class extends wn{constructor(t,e){super(t),this.fd=t,this.size=e}async readUint8Array(t,e){let n=Buffer.alloc(e),i=await this.fd.read(n,0,e,t);return new Uint8Array(En(n,0,i.bytesRead))}};var up=require("obsidian"),Pb=/[/\\]/g,Nb=/[\?<>:\*\|"]/g,Sb=/[\x00-\x1f\x80-\x9f]/g,Db=/^\.+$/,Rb=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,Ob=/[\. ]+$/,Ib=/^\./,Fb=/[\[\]#|^]/g;function _e(r){return r.replace(Pb,"-").replace(Nb,"").replace(Sb,"").replace(Db,"").replace(Ob,"").replace(Rb,"").replace(Ib,"").replace(Fb,"").trim()||"Untitled"}function _n(r){let t=[];for(let e=0;e<r;e++)t.push((Math.random()*16|0).toString(16));return t.join("")}function At(r){return new DOMParser().parseFromString(r,"text/html").documentElement}function Lb(r){return r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength)}function $s(r){return Lb(new TextEncoder().encode(r))}function yr(r){return Object.isEmpty(r)?"":`---
`+(0,up.stringifyYaml)(r)+`---
`}function di(r,t,e="..."){return r.length<t?r:r.substring(0,t)+e}function Ct(r){if(typeof r=="object"&&r!==null&&"message"in r&&typeof r.message=="string")return r.message}var Be=require("obsidian");var pp=300,Ee=class{constructor(t,e){this.files=[];this.outputLocation="";this.notAvailable=!1;this.outputFolder=null;this.app=t,this.vault=t.vault,this.modal=e,this.init()}async showTemplateConfiguration(t,e){return null}registerAuthCallback(t){this.modal.plugin.registerAuthCallback(t)}addFileChooserSetting(t,e,n=!1,i,a){let o=new Be.Setting(this.modal.contentEl).setName("Files to import").setDesc(i||"Pick the files that you want to import.").addButton(s=>s.setButtonText(n?"Choose files":"Choose file").onClick(async()=>{if(Be.Platform.isDesktopApp){let c=["openFile","dontAddToRecent"];n&&c.push("multiSelections");let u=window.electron.remote.dialog.showOpenDialogSync({title:"Pick files to import",properties:c,filters:[{name:t,extensions:e}],defaultPath:a||void 0});u&&u.length>0&&(this.files=u.map(p=>new bt(p)),l())}else{let c=createEl("input");c.type="file",c.accept=e.map(u=>"."+u.toLowerCase()).join(","),c.addEventListener("change",()=>{if(!c.files)return;let u=Array.from(c.files);u.length>0&&(this.files=u.map(p=>new xa(p)).filter(p=>e.contains(p.extension)),l())}),c.click()}}));n&&Be.Platform.isDesktopApp&&o.addButton(s=>s.setButtonText("Choose folders").onClick(async()=>{if(Be.Platform.isDesktopApp){let c=window.electron.remote.dialog.showOpenDialogSync({title:"Pick folders to import",properties:["openDirectory","multiSelections","dontAddToRecent"],defaultPath:a||void 0});if(c&&c.length>0){o.setDesc("Reading folders...");let u=c.map(p=>new zr(p));this.files=await Ms(u,p=>e.contains(p.extension)),l()}}}));let l=()=>{let s=document.createDocumentFragment(),c=this.files.length,u=this.files.map(p=>p.name).join(", ");u.length>pp&&(u=u.substring(0,pp)+"..."),s.createEl("span",{text:`These ${c} files will be imported: `}),s.createEl("br"),s.createEl("span",{cls:"u-pop",text:u}),o.setDesc(s)}}addOutputLocationSetting(t){this.outputLocation=t,new Be.Setting(this.modal.contentEl).setName("Output folder").setDesc("Choose a folder in the vault to put the imported files. Leave empty to output to vault root.").addText(e=>e.setValue(t).onChange(n=>{this.outputLocation=n,this.outputFolder=null}))}async getOutputFolder(){if(this.outputFolder)return this.outputFolder;let{vault:t}=this.app,e=this.outputLocation;e===""&&(e="/"),e=(0,Be.normalizePath)(e);let n=t.getAbstractFileByPath(e);return(n===null||!(n instanceof Be.TFolder))&&(await t.createFolder(e),n=t.getAbstractFileByPath(e)),n instanceof Be.TFolder?(this.outputFolder=n,n):null}async getAvailablePathForAttachment(t,e,n){let i=null;if(n){let{parent:f}=le(n);if(f){let d=this.vault.getAbstractFileByPath((0,Be.normalizePath)(f));d instanceof Be.TFolder&&(i={parent:d})}}if(!i){let f=await this.getOutputFolder();i=f?{parent:f}:null}let{basename:a,extension:o}=le(t),l=await this.vault.getAvailablePathForAttachments(a,o,i),s=le(l),c=s.extension?"."+s.extension:"."+o,u=1,p=l;for(;e.includes(p)||this.vault.getAbstractFileByPath(p);)p=K.join(s.parent,`${s.name} ${u}${c}`),u++;return(0,Be.normalizePath)(p)}async pause(t,e,n){let i=new Promise(a=>setTimeout(a,t*1e3));if(n){let a=n.statusMessage;n.status(`\u23F8\uFE0F Pausing import for ${t} seconds (${e})`),await i,n.status(a)}else await i}sanitizeFilePath(t){return t.replace(/[:|?<>*\\]/g,"")}async createFolders(t){let e=t.split("/").map(a=>a.replace(/^\.+/,"")).join("/"),n=(0,Be.normalizePath)(e),i=this.vault.getAbstractFileByPathInsensitive(n);if(i&&i instanceof Be.TFolder)return i;if(await this.vault.createFolder(n),i=this.vault.getAbstractFileByPathInsensitive(n),!(i instanceof Be.TFolder))throw new Error(`Failed to create folder at "${t}"`);return i}async saveAsMarkdownFile(t,e,n){let i=_e(e);return await this.app.fileManager.createNewMarkdownFile(t,i,n)}};var Ef=Yn(pf());var Il=require("obsidian");var df=r=>{let e=Ha.execSync(`${r} --version`).toString().toString().match(/(\d+)\.(\d+).(\d+)/);return(e==null?void 0:e[1])>3||(e==null?void 0:e[2])>32},ff=r=>{let t=[];if(!r)return t;let e=[],n=0,i=-1,a={};for(;n<r.length;){let o="";if(r[n]==="'")for(n++;n<r.length;)if(r[n]!=="'"){let l=r.indexOf("'",n);o+=r.substring(n,l),n=l}else if(r[n+1]==="'")o+=r[n],n+=2;else{n++;break}else if(r[n]==="N")o=null,n+=4;else{let l=Math.min(...[r.indexOf(",",n),r.indexOf(`
`,n)].filter(s=>s>0),r.length-1);o=parseFloat(r.substring(n,l)),n=l}i==-1?e.push(o):(a[e[i]]=o,i++),(r[n]==`
`||e.length<i)&&(i!==-1&&t.push(a),i=0,a={}),n++}return t};function mf(r){for(var t=r[0],e=1,n=arguments.length;e<n;e++)t+=arguments[e]+r[e];return t}var{isArray:Yy}=Array,Wa=class extends String{},hf=(r,...t)=>{let e=[r[0]],n=[e];for(let i=0;i<t.length;i++)t[i]instanceof Wa?e[e.length-1]+=t[i]+r[i+1]:(Yy(t[i])?(e.push(...t[i].slice(1).map(a=>",")),n.push(...t[i].length?t[i]:[""])):n.push(t[i]),e.push(r[i+1]));return n},gf=r=>new Wa(r);var _i=(r,t)=>{let e="SQLITE_ERROR",n=new Error(e+": "+t);return n.code=e,r(n),""},bf=(...r)=>gf(mf(...r)),{from:Zy}=Array,Ky=/'/g,Xy=r=>r.toString(16).padStart(2,"0"),Jy=r=>`x'${Zy(r,Xy).join("")}'`,Qy=r=>{switch(typeof r){case"string":return"'"+r.replace(Ky,"''")+"'";case"number":if(!isFinite(r))return;case"boolean":return+r;case"object":case"undefined":switch(!0){case!r:return"NULL";case r instanceof Date:return"'"+r.toISOString()+"'";case r instanceof Buffer:case r instanceof ArrayBuffer:r=new Uint8Array(r);case r instanceof Uint8Array:case r instanceof Uint8ClampedArray:return Jy(r)}}},Dl=(r,t)=>{let[e,...n]=hf(...t),i=[e[0]];for(let o=0;o<n.length;o++){let l=Qy(n[o]);if(l===void 0)return _i(r,"incompatible "+typeof l+"value");i.push(l,e[o+1])}let a=i.join("").trim();return a.length?a:_i(r,"empty query")};var Rl=Il.Platform.isDesktopApp?window.require("node:crypto"):null,Ha=Il.Platform.isDesktopApp?window.require("node:child_process"):null,Fl=Rl==null?void 0:Rl.randomUUID(),ex=`[{"_":"${Fl}"}]
`,tx=`'_'
'${Fl}'
`,{isArray:rx}=Array,{parse:xf}=JSON,{defineProperty:nx}=Object,ix=()=>{},ax=(r,t,e,n,i,a)=>{let o=[],{stdout:l,stderr:s}=Ha.spawn(n,i,a).on("close",u=>{if(c||u!==0){u!==0&&_i(t,"busy DB or query too slow");return}let p=o.join("").trim();if(e==="query")r(p);else{let f=xf(p||"[]");r(e==="get"&&rx(f)?f.shift():f)}});l.on("data",u=>{o.push(u)});let c=!1;s.on("data",u=>{c=!0,_i(t,"".trim.call(u))})},ox=(r,t,e)=>{let n=df(r),i=n?ex:tx,{stdin:a,stdout:o,stderr:l}=Ha.spawn(r,t);n?a.write(`.mode json
`):a.write(`.mode quote
.headers on
`),e&&a.write(`.timeout ${e}
`);let s=Promise.resolve();return(c,u,p,f,d)=>{p==="close"?(a.write(`.quit
`),s=null):s&&(s=s.then(()=>new Promise(g=>{let m="",h=N=>{m+=N;let k=!1;for(;m.endsWith(i);)k=!0,m=m.slice(0,-i.length);if(k){for(_();m.startsWith(i);)m=m.slice(i.length);if(p==="query")c(m);else{let O=n?xf(m||"[]"):ff(m);c(p==="get"?O.shift():O)}}},b=N=>{_(),u(new Error(N))},_=()=>{g(),o.removeListener("data",h),l.removeListener("data",b)};o.on("data",h),l.once("data",b),a.write(`${d[d.length-1]};
`),a.write(`SELECT '${Fl}' as _;
`)})))}},Ol=(r,t,e,n,i)=>(...a)=>new Promise((o,l)=>{let s=Dl(l,a);s.length&&(r==="get"&&/^SELECT\s+/i.test(s)&&!/\s+LIMIT\s+\d+$/i.test(s)&&(s+=" LIMIT 1"),e(o,l,r,t,n.concat(s),i))}),yf="";function Ll(r,t={}){r===":memory:"&&(r=yf||(yf=K.join(Je.tmpdir(),randomUUID())));let e=t.timeout||0,n=t.bin||"sqlite3",i=[r,"-bail"],a={timeout:e};t.readonly&&i.push("-readonly"),e&&i.push("-cmd",".timeout "+e);let o=i.concat("-json"),l=t.exec||(t.persistent?ox(n,i,e):ax);return{transaction(){let s=[];return nx((...c)=>{s.push(c)},"commit",{value(){return new Promise((c,u)=>{let p=["BEGIN TRANSACTION"];for(let f of s){let d=Dl(u,f);if(!d.length)return;p.push(d)}p.push("COMMIT"),l(c,u,"query",n,i.concat(p.join(";")),a)})}})},query:Ol("query",n,l,i,a),get:Ol("get",n,l,o,a),all:Ol("all",n,l,o,a),close:t.persistent?()=>l(null,null,"close"):ix,raw:bf}}var Ml="Library/Group Containers/group.com.apple.notes",wf="NoteStore.sqlite",sx=978307200,vf="apple-notes-importer-file-prefix";var Va=class extends Ee{constructor(){super(...arguments);this.owners={};this.resolvedAccounts={};this.resolvedFiles={};this.resolvedFolders={};this.multiAccount=!1;this.noteCount=0;this.parsedNotes=0;this.omitFirstLine=!0;this.importTrashed=!1;this.includeHandwriting=!1;this.duplicateHandling="import-updated";this.trashFolders=[]}init(){if(!Fe.Platform.isMacOS||!Fe.Platform.isDesktop){this.modal.contentEl.createEl("p",{text:"Due to platform limitations, Apple Notes cannot be exported from this device. Open your vault on a Mac to export from Apple Notes."}),this.notAvailable=!0;return}this.addOutputLocationSetting("Apple Notes");let e=localStorage.getItem(vf)||"";this.filePrefixFormat=e,new Fe.Setting(this.modal.contentEl).setName("File prefix format").setDesc("Format for the creation date prefix in filenames. Use YYYY, MM, DD for year, month, day. Leave blank for no prefix.").addText(n=>n.setValue(e).setPlaceholder("YYYY-MM-DD").onChange(async i=>{this.filePrefixFormat=i,localStorage.setItem(vf,i)})),new Fe.Setting(this.modal.contentEl).setName("Import recently deleted notes").setDesc('Import notes in the "Recently Deleted" folder. Unlike in Apple Notes, they will not be automatically removed after a set amount of time.').addToggle(n=>n.setValue(!1).onChange(async i=>this.importTrashed=i)),new Fe.Setting(this.modal.contentEl).setName("Omit first line").setDesc("Don't include the first line in the text, since Apple Notes uses it as the title. It will still be used as the note name.").addToggle(n=>n.setValue(!0).onChange(async i=>this.omitFirstLine=i)),new Fe.Setting(this.modal.contentEl).setName("Include handwriting text").setDesc("When Apple Notes has detected handwriting in drawings, include it as text before the drawing.").addToggle(n=>n.setValue(!1).onChange(async i=>this.includeHandwriting=i)),new Fe.Setting(this.modal.contentEl).setName("Handle duplicate files").setDesc("How to handle notes that already exist in the vault.").addDropdown(n=>n.addOption("skip","Skip import").addOption("import-updated","Import only updated").addOption("create-copy","Create a copy").setValue("import-updated").onChange(async i=>this.duplicateHandling=i))}async getNotesDatabase(){let e=K.join(Je.homedir(),Ml),n=window.electron.remote.dialog.showOpenDialogSync({defaultPath:e,properties:["openDirectory"],message:'Select the "group.com.apple.notes" folder to allow Obsidian to read Apple Notes data.'});if(!(n!=null&&n.includes(e)))return new Fe.Notice("Data import failed. Ensure you have selected the correct Apple Notes data folder."),null;let i=K.join(e,wf),a=K.join(Je.tmpdir(),wf);return await gt.copyFile(i,a),await gt.copyFile(i+"-shm",a+"-shm"),await gt.copyFile(i+"-wal",a+"-wal"),new Ll(a,{readonly:!0,persistent:!0})}async import(e){if(this.ctx=e,this.protobufRoot=Ef.Root.fromJSON(Lc),this.rootFolder=await this.getOutputFolder(),!this.rootFolder){new Fe.Notice("Please select a location to export to.");return}if(this.database=await this.getNotesDatabase(),!this.database)return;this.keys=Object.fromEntries((await this.database.all`SELECT z_ent, z_name FROM z_primarykey`).map(o=>[o.Z_NAME,o.Z_ENT]));let n=await this.database.all`
SELECT z_pk FROM ziccloudsyncingobject WHERE z_ent = ${this.keys.ICAccount}
`,i=await this.database.all`
SELECT z_pk, ztitle2 FROM ziccloudsyncingobject WHERE z_ent = ${this.keys.ICFolder}
`;for(let o of n)await this.resolveAccount(o.Z_PK);for(let o of i)try{await this.resolveFolder(o.Z_PK)}catch(l){this.ctx.reportFailed(o.ZTITLE2,Ct(l)),console.error(l)}let a=await this.database.all`
SELECT
z_pk, zfolder, ztitle1 FROM ziccloudsyncingobject
WHERE
z_ent = ${this.keys.ICNote}
AND ztitle1 IS NOT NULL
AND zfolder NOT IN (${this.trashFolders})
`;this.noteCount=a.length;for(let o of a)try{await this.resolveNote(o.Z_PK)}catch(l){this.ctx.reportFailed(o.ZTITLE1,Ct(l)),console.error(l)}this.database.close()}async resolveAccount(e){!this.multiAccount&&Object.keys(this.resolvedAccounts).length&&(this.multiAccount=!0);let n=await this.database.get`
SELECT zname, zidentifier FROM ziccloudsyncingobject
WHERE z_ent = ${this.keys.ICAccount} AND z_pk = ${e}
`;this.resolvedAccounts[e]={name:n.ZNAME,uuid:n.ZIDENTIFIER,path:K.join(Je.homedir(),Ml,"Accounts",n.ZIDENTIFIER)}}async resolveFolder(e){var o;if(e in this.resolvedFiles)return this.resolvedFolders[e];let n=await this.database.get`
SELECT ztitle2, zparent, zidentifier, zfoldertype, zowner
FROM ziccloudsyncingobject
WHERE z_ent = ${this.keys.ICFolder} AND z_pk = ${e}
`,i;if(n.ZFOLDERTYPE==3)return null;if(!this.importTrashed&&n.ZFOLDERTYPE==1)return this.trashFolders.push(e),null;if(n.ZPARENT!==null)i=((o=await this.resolveFolder(n.ZPARENT))==null?void 0:o.path)+"/";else if(this.multiAccount){let l=this.resolvedAccounts[n.ZOWNER].name;i=`${this.rootFolder.path}/${l}/`}else i=`${this.rootFolder.path}/`;n.ZIDENTIFIER.startsWith("DefaultFolder")||(i+=_e(n.ZTITLE2));let a=await this.createFolders(i);return this.resolvedFolders[e]=a,this.owners[e]=n.ZOWNER,a}async resolveNote(e){if(e in this.resolvedFiles)return this.resolvedFiles[e];let n=await this.database.get`
SELECT
nd.z_pk, hex(nd.zdata) as zhexdata, zcso.ztitle1, zfolder,
zcreationdate1, zcreationdate2, zcreationdate3, zmodificationdate1, zispasswordprotected
FROM
zicnotedata AS nd,
(SELECT
*, NULL AS zcreationdate3, NULL AS zcreationdate2,
NULL AS zispasswordprotected FROM ziccloudsyncingobject
) AS zcso
WHERE
zcso.z_pk = nd.znote
AND zcso.z_pk = ${e}
`;if(n.ZISPASSWORDPROTECTED)return this.ctx.reportSkipped(n.ZTITLE1,"note is password protected"),null;let i=this.resolvedFolders[n.ZFOLDER]||this.rootFolder,a=n.ZTITLE1;if(this.filePrefixFormat){let u=this.decodeTime(n.ZCREATIONDATE3||n.ZCREATIONDATE2||n.ZCREATIONDATE1);a=`${(0,Fe.moment)(u).format(this.filePrefixFormat)} ${a}`}let o=K.join(i.path,`${a}.md`),l=this.vault.getAbstractFileByPath(o);if(l&&l instanceof Fe.TFile){if(this.duplicateHandling==="skip")return this.ctx.reportSkipped(n.ZTITLE1,"note is a duplicate"),l;if(this.duplicateHandling==="import-updated"){let u=this.decodeTime(n.ZMODIFICATIONDATE1),p=l.stat.mtime;if(u<=p)return this.ctx.reportSkipped(n.ZTITLE1,"note unchanged since last import"),l}}let s=await this.saveAsMarkdownFile(i,`${a}.md`,"");this.ctx.status(`Importing note ${a}`),this.resolvedFiles[e]=s,this.owners[e]=this.owners[n.ZFOLDER];let c=this.decodeData(n.zhexdata,Br);return this.vault.modify(s,await c.format(!1,s.path),{ctime:this.decodeTime(n.ZCREATIONDATE3||n.ZCREATIONDATE2||n.ZCREATIONDATE1),mtime:this.decodeTime(n.ZMODIFICATIONDATE1)}),this.parsedNotes++,this.ctx.reportProgress(this.parsedNotes,this.noteCount),this.ctx.reportNoteSuccess(a),s}async resolveAttachment(e,n){if(e in this.resolvedFiles)return this.resolvedFiles[e];let i,a,o,l,s;switch(n){case"com.apple.paper.doc.scan":l=await this.database.get`
SELECT
zidentifier, zfallbackpdfgeneration, zcreationdate, zmodificationdate, znote
FROM
(SELECT *, NULL AS zfallbackpdfgeneration FROM ziccloudsyncingobject)
WHERE
z_ent = ${this.keys.ICAttachment}
AND z_pk = ${e}
`,i=K.join("FallbackPDFs",l.ZIDENTIFIER,l.ZFALLBACKPDFGENERATION||"","FallbackPDF.pdf"),a="Scan",o="pdf";break;case"com.apple.notes.gallery":l=await this.database.get`
SELECT
zidentifier, zsizeheight, zsizewidth, zcreationdate, zmodificationdate, znote
FROM ziccloudsyncingobject
WHERE
z_ent = ${this.keys.ICAttachment}
AND z_pk = ${e}
`,i=K.join("Previews",`${l.ZIDENTIFIER}-1-${l.ZSIZEWIDTH}x${l.ZSIZEHEIGHT}-0.jpeg`),a="Scan Page",o="jpg";break;case"com.apple.paper":l=await this.database.get`
SELECT
zidentifier, zfallbackimagegeneration, zcreationdate, zmodificationdate,
znote, zhandwritingsummary
FROM
(SELECT *, NULL AS zfallbackimagegeneration FROM ziccloudsyncingobject)
WHERE
z_ent = ${this.keys.ICAttachment}
AND z_pk = ${e}
`,l.ZFALLBACKIMAGEGENERATION?i=K.join("FallbackImages",l.ZIDENTIFIER,l.ZFALLBACKIMAGEGENERATION,"FallbackImage.png"):i=K.join("FallbackImages",`${l.ZIDENTIFIER}.jpg`),a="Drawing",o="png";break;default:l=await this.database.get`
SELECT
a.zidentifier, a.zfilename,
a.zgeneration1, b.zcreationdate, b.zmodificationdate, b.znote
FROM
(SELECT *, NULL AS zgeneration1 FROM ziccloudsyncingobject) AS a,
ziccloudsyncingobject AS b
WHERE
a.z_ent = ${this.keys.ICMedia}
AND a.z_pk = ${e}
AND a.z_pk = b.zmedia
`,i=K.join("Media",l.ZIDENTIFIER,l.ZGENERATION1||"",l.ZFILENAME),[a,o]=Tn(l.ZFILENAME);break}let c=a;if(this.filePrefixFormat&&l.ZCREATIONDATE){let g=this.decodeTime(l.ZCREATIONDATE);c=`${(0,Fe.moment)(g).format(this.filePrefixFormat)} ${a}`}let u=await this.getAvailablePathForAttachment(`${c}.${o}`,[]),{parent:p}=le(u),f=K.join(p,`${c}.${o}`),d=this.vault.getAbstractFileByPath(f);if(d&&d instanceof Fe.TFile){if(this.duplicateHandling==="skip")return this.ctx.reportSkipped(c,"attachment already exists"),d;if(this.duplicateHandling==="import-updated"){let g=this.decodeTime(l.ZMODIFICATIONDATE),m=d.stat.mtime;if(g<=m)return this.ctx.reportSkipped(c,"attachment unchanged since last import"),d}}try{let g=await this.getAttachmentSource(this.resolvedAccounts[this.owners[l.ZNOTE]],i),m=await this.getAvailablePathForAttachment(`${c}.${o}`,[]);s=await this.vault.createBinary(m,En(g),{ctime:this.decodeTime(l.ZCREATIONDATE),mtime:this.decodeTime(l.ZMODIFICATIONDATE)})}catch(g){return this.ctx.reportFailed(i),console.error(g),null}return this.resolvedFiles[e]=s,this.ctx.reportAttachmentSuccess(`${c}.${o}`),s}decodeData(e,n){let i=cp.gunzipSync(Buffer.from(e,"hex")),a=this.protobufRoot.lookupType(n.protobufType).decode(i);return new n(this,a)}decodeTime(e){return!e||e<1?new Date().getTime():Math.floor((e+sx)*1e3)}async getAttachmentSource(e,n){try{return await gt.readFile(K.join(e.path,n))}catch(i){return await gt.readFile(K.join(Je.homedir(),Ml,n))}}async saveAsMarkdownFile(e,n,i){if(this.duplicateHandling==="skip"||this.duplicateHandling==="import-updated"){let a=_e(n),o=K.join(e.path,a),l=this.vault.getAbstractFileByPath(o);if(l&&l instanceof Fe.TFile)return l}return super.saveAsMarkdownFile(e,n,i)}};var Qe=require("obsidian");var lx="dddd, D MMMM YYYY",cx="Journal",ux=new Map([["generic-map","location"],["multi-pin-map","location"]]),px=new Set(["photo","live-photo","video"]),dx=".p2, .p3",fx=[".gridItemOverlayHeader",".gridItemOverlayFooter",".gridItemOverlayText",".activityType",".activityMetrics",".activityMetricsDistance",".activityMetricsCalories",".activityMetricsDuration",".mediaTitle",".mediaArtist",".mediaCategory"],Qr={Skip:"skip",ImportUpdated:"import-updated",CreateCopy:"create-copy"},Tf=Qr.ImportUpdated,za=class extends Ee{constructor(){super(...arguments);this.frontMatterEnabled=!0;this.duplicateHandling=Tf}init(){let e=Ex();this.addFileChooserSetting("Journal entries",["htm","html"],!0,"Pick the Journal app exported folder",e),new Qe.Setting(this.modal.contentEl).setName("Journal metadata").setHeading(),new Qe.Setting(this.modal.contentEl).setName("Add metadata as frontmatter").setDesc("Capture state-of-mind, contact, and similar tokens in YAML when available.").addToggle(n=>{n.setValue(this.frontMatterEnabled),n.onChange(i=>{this.frontMatterEnabled=i})}),new Qe.Setting(this.modal.contentEl).setName("Handle duplicate files").setDesc("How to handle entries that already exist in the vault.").addDropdown(n=>{n.addOption(Qr.Skip,"Skip import").addOption(Qr.ImportUpdated,"Import only updated").addOption(Qr.CreateCopy,"Create a copy").setValue(Tf).onChange(i=>{this.duplicateHandling=i})}),this.addOutputLocationSetting(cx)}async import(e){if(this.files.length===0){new Qe.Notice("Please pick at least one file to import.");return}let n=await this.getOutputFolder();if(!n){new Qe.Notice("Please select a location to export to.");return}e.reportProgress(0,this.files.length);for(let i=0;i<this.files.length;i++){if(e.isCancelled())return;let a=this.files[i];if(a.name==="index.html"){e.reportSkipped(a.fullpath,"index file is not a journal entry"),e.reportProgress(i+1,this.files.length);continue}try{e.status(`Importing note ${a.basename}`),await this.importEntry(e,n,a)&&e.reportNoteSuccess(a.fullpath)}catch(o){e.reportFailed(a.fullpath,o)}e.reportProgress(i+1,this.files.length)}}async importEntry(e,n,i){var m,h;let a=await i.readText(),o=At(a),l=this.frontMatterEnabled?(m=bx(o))!=null?m:{}:{},s=mx(o);s&&(l.date=s);let c=hx(o),u=(0,Qe.htmlToMarkdown)(c);if(Object.keys(l).length>0){let b=yr(l);b&&(u=b+u)}let p=_e(i.basename),f=n.path==="/"?"":n.path,d=(0,Qe.normalizePath)(K.join(f,p+".md")),g=(h=this.vault.getAbstractFileByPath(d))!=null?h:this.vault.getAbstractFileByPathInsensitive(d);return this.duplicateHandling===Qr.CreateCopy?(await this.saveAsMarkdownFile(n,i.basename,u),!0):g instanceof Qe.TFile?this.duplicateHandling===Qr.Skip?(e.reportSkipped(i.fullpath,"file already exists"),!1):this.duplicateHandling===Qr.ImportUpdated&&await this.vault.read(g)===u?(e.reportSkipped(i.fullpath,"journal entry unchanged since last import"),!1):(await this.vault.modify(g,u),!0):(await this.vault.create(d,u),!0)}};function mx(r){var n,i;let t=(i=(n=r.querySelector(".pageHeader"))==null?void 0:n.textContent)==null?void 0:i.trim();if(!t)return;let e=(0,Qe.moment)(t,lx);if(e.isValid())return e.format("YYYY-MM-DD")}function hx(r){var a;let t=document.implementation.createHTMLDocument(""),e=t.createElement("article");t.body.appendChild(e);let n=(a=r.querySelector(".reflectionPrompt"))==null?void 0:a.textContent;gx(t,e,n);let i=Array.from(r.querySelectorAll(dx));for(let o of i)e.appendChild(t.importNode(o,!0));return t.documentElement}function gx(r,t,e){let n=e==null?void 0:e.trim();if(!n)return;let i=r.createElement("p");i.textContent=n,t.appendChild(i)}function bx(r){var i;let t=new Map,e=Array.from(r.querySelectorAll(".assetGrid .gridItem"));for(let a of e){let o=yx(a);if(!o||px.has(o))continue;let l=xx(a);if(l.length===0)continue;let s=(i=t.get(o))!=null?i:new Set;for(let c of l)s.add(c);t.set(o,s)}if(t.size===0)return null;let n={};for(let[a,o]of t){let l=Array.from(o);l.length>0&&(n[a]=l)}return Object.keys(n).length===0?null:n}function yx(r){var i;let t=Array.from(r.classList).find(a=>a.startsWith("assetType_"));if(!t)return;let e=t.slice(10);if(!e)return;let n=e.replace(/(\w)([A-Z])/g,"$1-$2").replace(/_/g,"-").toLowerCase();return(i=ux.get(n))!=null?i:n}function xx(r){let t=vx(r);return wx(t)}function wx(r){let t=new Set;for(let e of r)for(let n of e.split(",")){let i=n.trim();i&&t.add(i)}return Array.from(t)}function vx(r){let t=new Set,e=i=>{let a=i==null?void 0:i.trim();a&&t.add(a)};for(let i of fx){let a=Array.from(r.querySelectorAll(i));for(let o of a)e(o.textContent)}let n=Array.from(r.querySelectorAll("[aria-label],[title],[alt]"));for(let i of n)e(i.getAttribute("aria-label")),e(i.getAttribute("title")),e(i.getAttribute("alt"));return Array.from(t)}function Ex(){if(!ue||!K||!Je||Je.platform()!=="darwin")return;let r=K.join(Je.homedir(),"Library","Mobile Documents","com~apple~CloudDocs","Journal","AppleJournalEntries");try{if(ue.existsSync(r))return r}catch(t){return}}var Ar=require("obsidian");var Ai=class{constructor(t,e){this.type="file";this.entry=e,this.fullpath=t.fullpath+"/"+e.filename;let{parent:n,name:i,basename:a,extension:o}=le(e.filename);this.parent=n,this.name=i,this.basename=a,this.extension=o}async readText(){return this.entry.getData(new fa)}async read(){return(await this.entry.getData(new si)).arrayBuffer()}get filepath(){return this.entry.filename}get size(){return this.entry.uncompressedSize}get ctime(){return this.entry.creationDate}get mtime(){return this.entry.lastModDate}async readZip(t){return t(new Vr(new gr(new Blob([await this.read()]))))}};async function er(r,t){await r.readZip(async e=>{let i=(await e.getEntries()).filter(a=>!a.directory&&!!a.getData).map(a=>new Ai(r,a));return t(e,i)})}var Ga=class extends Ee{constructor(){super(...arguments);this.attachmentMap={};this.flattenTags=!1;this.storeId=!1}init(){this.addFileChooserSetting("Bear2bk",["bear2bk"]),this.addOutputLocationSetting("Bear"),new Ar.Setting(this.modal.contentEl).setName("Flatten nested tags").setDesc("When enabled, tags will be split on slashes (/) during import.").addToggle(e=>e.setValue(!1).onChange(async n=>this.flattenTags=n)),new Ar.Setting(this.modal.contentEl).setName("Store note identifiers in front matter").setDesc("Links will be automatically updated. Enable this if the note identifier is used outside of linking between notes.").addToggle(e=>e.setValue(!1).onChange(async n=>this.storeId=n))}extractTagsFromContent(e){let n=new Set,i=/(?<!\S)#([A-Za-zÀ-ÖØ-öø-įĴ-őŔ-žǍ-ǰǴ-ǵǸ-țȞ-ȟȤ-ȳɃɆ-ɏḀ-ẞƀ-ƓƗ-ƚƝ-ơƤ-ƥƫ-ưƲ-ƶẠ-ỿ0-9_][A-Za-zÀ-ÖØ-öø-įĴ-őŔ-žǍ-ǰǴ-ǵǸ-țȞ-ȟȤ-ȳɃɆ-ɏḀ-ẞƀ-ƓƗ-ƚƝ-ơƤ-ƥƫ-ưƲ-ƶẠ-ỿ0-9_/\-]*[A-Za-zÀ-ÖØ-öø-įĴ-őŔ-žǍ-ǰǴ-ǵǸ-țȞ-ȟȤ-ȳɃɆ-ɏḀ-ẞƀ-ƓƗ-ƚƝ-ơƤ-ƥƫ-ưƲ-ƶẠ-ỿ0-9_]|[A-Za-zÀ-ÖØ-öø-įĴ-őŔ-žǍ-ǰǴ-ǵǸ-țȞ-ȟȤ-ȳɃɆ-ɏḀ-ẞƀ-ƓƗ-ƚƝ-ơƤ-ƥƫ-ưƲ-ƶẠ-ỿ0-9_]+)(?![#\w/])/g,a;for(;(a=i.exec(e))!==null;){let l=a[1].trim();if(l!=="")if(this.flattenTags&&l.includes("/")){let s=l.split("/");for(let c of s)n.add(c)}else n.add(l)}return Array.from(n)}async import(e){let n={},{files:i}=this;if(i.length===0){new Ar.Notice("Please pick at least one file to import.");return}let a=await this.getOutputFolder();if(!a){new Ar.Notice("Please select a location to export to.");return}let o=a,l=new RegExp("\\[[^\\]]*\\]\\((assets/[^\\)]+)\\)","gm"),s=await this.createFolders(`${a.path}/archive`),c=await this.createFolders(`${a.path}/trash`);for(let u of i){if(e.isCancelled())return;e.status("Processing "+u.name),await er(u,async(p,f)=>{let d=await this.collectMetadata(e,f);for(let g of f){if(e.isCancelled())return;let{fullpath:m,filepath:h,parent:b,name:_,extension:N}=g;if(!(_==="info.json"||_==="tags.json"||_==="backup.json")){e.status("Processing "+_);try{if(N==="md"||N==="markdown"){let k=le(b).basename;e.status("Importing note "+k);let O=await g.readText();O=this.removeMarkdownHeader(k,O);let w=[...O.matchAll(l)];if(w.length>0)for(let M of w){let[I,q]=M,U=K.join(b,decodeURI(q)),H=await this.getAttachmentStoragePath(U);H=encodeURI(H);let W=I.replace(q,H);O=O.replace(I,W)}O=O.replace(/#([^\n#]+?[^\s])#/g,(M,I)=>"#"+I.replace(/\s+/g,"_")),O=O.replace(/#([^0-9\s#]+)/g,(M,I)=>{let q=I.replace(/[^A-Za-zÀ-ÖØ-öø-įĴ-őŔ-žǍ-ǰǴ-ǵǸ-țȞ-ȟȤ-ȳɃɆ-ɏḀ-ẞƀ-ƓƗ-ƚƝ-ơƤ-ƥƫ-ưƲ-ƶẠ-ỿ0-9_/\-]/g,"_");return q=q.replace(/_+/g,"_"),"#"+q});let C=this.extractTagsFromContent(O),y=k,S=d[b],D=o;(S==null?void 0:S.archivedtime)!==void 0?D=s:(S==null?void 0:S.trashedtime)!==void 0&&(D=c);let R=await this.saveAsMarkdownFile(D,y,O);(this.storeId||S!=null&&S.archivedtime||S!=null&&S.trashedtime||C.length>0)&&await this.updateNoteFrontmatter(S,R,C),S!=null&&S.ctime&&(S!=null&&S.mtime)&&await this.modifFileTimestamps(S,R),n[S==null?void 0:S.id]={filename:y,metadata:S,file:R},e.reportNoteSuccess(k)}else if(h.match(/\/assets\//g)){e.status("Importing asset "+g.name);let k=await this.getAttachmentStoragePath(g.filepath),O=await g.read(),w={};g.ctime&&(w.ctime=g.ctime.getTime()),g.mtime&&(w.mtime=g.mtime.getTime()),Object.keys(w).length>0?await this.vault.createBinary(k,O,w):await this.vault.createBinary(k,O),e.reportAttachmentSuccess(g.fullpath)}else e.reportSkipped(m,"unknown type of file")}catch(k){e.reportFailed(m,k)}}}})}e.status("Updating internal links\u2026"),this.updateNotesLinks(n)}async updateNoteFrontmatter(e,n,i){let a={ctime:e==null?void 0:e.ctime,mtime:e==null?void 0:e.mtime};this.app.fileManager.processFrontMatter(n,o=>{this.storeId&&(e!=null&&e.id)&&(o.id=e.id),e!=null&&e.archivedtime&&(o.archived=new Date(e.archivedtime).toISOString().slice(0,19)),e!=null&&e.trashedtime&&(o.trashed=new Date(e.trashedtime).toISOString().slice(0,19)),i.length>0&&(o.tags=i)},a)}async modifFileTimestamps(e,n){let i={ctime:e.ctime,mtime:e.mtime};await this.vault.append(n,"",i)}updateNotesLinks(e){let n=Object.values(e).map(async i=>{let{metadata:a,file:o}=i,l={ctime:a==null?void 0:a.ctime,mtime:a==null?void 0:a.mtime};await this.vault.process(o,s=>s.replace(/bear:\/\/x-callback-url\/open-note\?id=([A-Z0-9\-]+)/g,(c,u)=>{var f;let p=(f=e[u])==null?void 0:f.filename;return p?encodeURI(p.normalize("NFC")):c}),l)});return Promise.all(n).then(()=>{})}async collectMetadata(e,n){let i={};for(let a of n){if(e.isCancelled())return i;if(a.name!=="info.json")continue;let o=await a.readText(),s=JSON.parse(o)["net.shinyfrog.bear"],c=s.uniqueIdentifier,u=Date.parse(s.creationDate),p=Date.parse(s.modificationDate),f=Date.parse(s.archivedDate),d=Date.parse(s.trashedDate);i[a.parent]={id:c,ctime:isNaN(u)?void 0:u,mtime:isNaN(p)?void 0:p,archivedtime:isNaN(f)||s.archived!==1?void 0:f,trashedtime:isNaN(d)||s.trashed!==1?void 0:d}}return i}async getAttachmentStoragePath(e){let n=(0,Ar.normalizePath)(e);if(this.attachmentMap[n])return this.attachmentMap[n];let i=Object.values(this.attachmentMap),a=await this.getAvailablePathForAttachment(n,i);return a=a.replace(/:/g,""),this.attachmentMap[n]=a,a}removeMarkdownHeader(e,n){if(!n.startsWith("# "))return n;let i=n.indexOf(`
`),a=i>0?n.substring(2,i):n.substring(2);return a=a.trim(),a!==e.trim()&&a!==""?n:i>0?n.substring(i+1):""}};var tr=require("obsidian");var Cr=require("obsidian"),Ya=class{constructor(t){var e,n,i,a,o;this.fields=t.fields,this.placeholderSyntax=t.placeholderSyntax||"{{field_name}}",this.config={titleTemplate:((e=t.defaults)==null?void 0:e.titleTemplate)||"",locationTemplate:((n=t.defaults)==null?void 0:n.locationTemplate)||"",propertyNames:((i=t.defaults)==null?void 0:i.propertyNames)||new Map,propertyValues:((a=t.defaults)==null?void 0:a.propertyValues)||new Map,bodyTemplate:((o=t.defaults)==null?void 0:o.bodyTemplate)||""}}async show(t){return new Promise(e=>{t.empty(),t.createEl("p",{text:`Configure how your data should be imported. Use ${this.placeholderSyntax} syntax to reference field values.`}),new Cr.Setting(t).setName("Note title").setDesc("Template for the note title. Use {{field_name}} to insert values.").addText(l=>l.setPlaceholder("{{Title}}").setValue(this.config.titleTemplate).onChange(s=>{this.config.titleTemplate=s})),new Cr.Setting(t).setName("Note location").setDesc("Template for note location/path. Use {{field_name}} to organize notes.").addText(l=>l.setPlaceholder("{{Category}}/{{Subcategory}}").setValue(this.config.locationTemplate).onChange(s=>{this.config.locationTemplate=s})),t.createDiv({cls:"importer-frontmatter-header"}).createEl("h4",{text:"Properties"});let i=t.createDiv("importer-column-list"),a=i.createDiv("importer-column-header-row");a.createDiv("importer-column-name-col").setText("Property name"),a.createDiv("importer-column-value-col").setText("Property value"),a.createDiv("importer-column-example-col").setText("Example"),a.createDiv("importer-column-delete-col");for(let l of this.fields){let s=i.createDiv("importer-column-row"),u=s.createDiv("importer-column-name-col").createEl("input",{type:"text",cls:"importer-column-property",value:this.config.propertyNames.get(l.id)||""});u.addEventListener("input",()=>{this.config.propertyNames.set(l.id,u.value)});let f=s.createDiv("importer-column-value-col").createEl("input",{type:"text",cls:"importer-column-property",value:this.config.propertyValues.get(l.id)||""});f.addEventListener("input",()=>{this.config.propertyValues.set(l.id,f.value)});let d=s.createDiv("importer-column-example-col"),g=l.exampleValue||"",m=g.length>50?g.substring(0,50)+"...":g;d.setText(m||"\u2014");let b=s.createDiv("importer-column-delete-col").createEl("button",{cls:"clickable-icon",attr:{"aria-label":"Delete property"}});(0,Cr.setIcon)(b,"trash-2"),b.addEventListener("click",()=>{this.config.propertyNames.delete(l.id),this.config.propertyValues.delete(l.id),s.remove()})}new Cr.Setting(t).setName("Note content").setDesc("Template for the note content. Use {{field_name}} to insert values.").addTextArea(l=>{l.setPlaceholder("{{Content}}").setValue(this.config.bodyTemplate).onChange(s=>{this.config.bodyTemplate=s}),l.inputEl.rows=6});let o=t.createDiv("modal-button-container");o.createEl("button",{cls:"mod-cta",text:"Continue"},l=>{l.addEventListener("click",()=>{if(!this.config.titleTemplate.trim()){new Cr.Notice("Please provide a note title template.");return}e(this.config)})}),o.createEl("button",{text:"Cancel"},l=>{l.addEventListener("click",()=>{e(null)})})})}};function Ci(r,t){return r?r.replace(/\{\{\s*([^}]+?)\s*\}\}/g,(e,n)=>{let i=n.trim();return t[i]!==void 0?t[i]:e}):""}function Tx(r){let t=r.trim().toLowerCase();return t==="null"||t==="undefined"||r===""?"":t==="true"||t==="false"?t:isNaN(Number(r))?JSON.stringify(r):r}function _f(r,t,e){if(t.size===0)return"";let n=["---"];for(let[i,a]of t){if(!a)continue;let o=e.get(i)||"";if(!o)continue;let l=Ci(o,r),s=Tx(l);n.push(`${a}: ${s}`)}return n.push("---"),n.join(`
`)}var Dn=require("obsidian");async function Af(r,t,e,n){let i=(0,Dn.stringifyYaml)(e),a=(0,Dn.normalizePath)(K.join(r.path,t+".base")),o=n.getAbstractFileByPath(a);return o instanceof Dn.TFile?(await n.modify(o,i),o):await n.create(a,i)}var Za=class extends Ee{constructor(){super(...arguments);this.csvHeaders=[];this.csvRows=[];this.config=null}init(){this.addFileChooserSetting("CSV",["csv"]),this.addOutputLocationSetting("CSV import"),this.hasHeaderRow=!0,new tr.Setting(this.modal.contentEl).setName("CSV has header row").setDesc("If enabled, the first row of the CSV file will be treated as column headers.").addToggle(e=>{e.setValue(this.hasHeaderRow),e.onChange(async n=>{this.hasHeaderRow=n})})}async showTemplateConfiguration(e,n){let{files:i}=this;if(i.length===0)return new tr.Notice("Please pick at least one CSV file to import."),!1;if(i.length>1)return new tr.Notice("CSV files must be imported one at a time."),!1;let a=i[0];if(e.isCancelled())return!1;e.status("Parsing "+a.name);let o=await a.readText(),l=this.parseCSV(o);if(this.csvHeaders.length===0&&l.rows.length>0&&(this.csvHeaders=l.headers),this.csvRows.push(...l.rows),this.csvHeaders.length===0||this.csvRows.length===0)return new tr.Notice("No data found in CSV file(s)."),!1;let s=this.csvHeaders.map(d=>({id:d,label:d,exampleValue:this.findExampleValue(d)})),c=new Map,u=new Map;this.csvHeaders.forEach(d=>{c.set(d,this.sanitizeYAMLKey(d)),u.set(d,`{{${d}}}`)});let p=this.csvHeaders.length>0?`{{${this.csvHeaders[0]}}}`:"",f=new Ya({fields:s,defaults:{titleTemplate:p,locationTemplate:"",bodyTemplate:"",propertyNames:c,propertyValues:u},placeholderSyntax:"{{column_name}}"});return this.config=await f.show(n),this.config!==null}async import(e){if(!this.config){new tr.Notice("Configuration is missing.");return}await this.processRows(e)}findExampleValue(e){for(let n of this.csvRows){let i=n[e];if(i&&i.trim().length>0)return i}return""}parseCSV(e){let n=this.splitCSVLines(e);if(n.length===0)return{headers:[],rows:[]};let i,a;this.hasHeaderRow?(i=this.parseCSVLine(n[0]),a=1):(i=this.parseCSVLine(n[0]).map((s,c)=>`Column ${c+1}`),a=0);let o=[];for(let l=a;l<n.length;l++){let s=this.parseCSVLine(n[l]);if(s.length===0)continue;let c={};for(let u=0;u<i.length;u++)c[i[u]]=s[u]||"";o.push(c)}return{headers:i,rows:o}}splitCSVLines(e){let n=[],i="",a=!1;for(let o=0;o<e.length;o++){let l=e[o],s=e[o+1];l==='"'?(i+=l,a&&s==='"'?(i+='"',o++):a=!a):l===`
`&&!a?(i.trim().length>0&&n.push(i),i=""):l==="\r"&&s===`
`&&!a?(i.trim().length>0&&n.push(i),i="",o++):l==="\r"&&!a?(i.trim().length>0&&n.push(i),i=""):i+=l}return i.trim().length>0&&n.push(i),n}parseCSVLine(e){let n=[],i="",a=!1,o=!0;for(let l=0;l<e.length;l++){let s=e[l],c=e[l+1];s==='"'&&o?(a=!0,o=!1):s==='"'&&a?c==='"'?(i+='"',l++):a=!1:s===","&&!a?(n.push(i),i="",o=!0):(s!==" "||!o||i.length>0)&&(i+=s,o=!1)}return n.push(i),n.map(l=>l.trim())}sanitizeYAMLKey(e){return e.replace(/[^\w\s-]/g,"")}async processRows(e){if(!this.config){new tr.Notice("Configuration is missing.");return}let n=await this.getOutputFolder();if(!n){new tr.Notice("Please select a location to export to.");return}e.reportProgress(0,this.csvRows.length);for(let i=0;i<this.csvRows.length;i++){if(e.isCancelled())return;let a=this.csvRows[i];try{let o=Ci(this.config.titleTemplate,a);if(!o.trim()){e.reportSkipped(`Row ${i+1}`,"Empty title");continue}e.status(`Creating note: ${o}`);let l=Ci(this.config.locationTemplate,a),s=await this.getTargetFolder(n,l),c="",u=_f(a,this.config.propertyNames,this.config.propertyValues);u&&(c+=u+`
`);let p=Ci(this.config.bodyTemplate,a);p&&(c+=p),await this.saveAsMarkdownFile(s,o,c),e.reportNoteSuccess(o)}catch(o){e.reportFailed(`Row ${i+1}`,o)}e.reportProgress(i+1,this.csvRows.length)}!e.isCancelled()&&n.path!==""&&await this.createBase(n)}async createBase(e){try{let i=["file.name",...Array.from(this.config.propertyNames.values()).filter(s=>s&&s.trim())],a=e.name,o=e.parent||e,l={filters:`file.folder == "${e.path}"`,views:[{type:"table",name:"Table",order:i}]};await Af(o,a,l,this.app.vault)}catch(n){console.error("Failed to create Base file:",n)}}async getTargetFolder(e,n){if(!n||!n.trim())return e;let i=this.sanitizeFilePath(n),a=e.path+"/"+i;return await this.createFolders(a)}};var Oi=require("obsidian");var Dh=require("obsidian");var Cf=require("obsidian");var kf=r=>({...r,created:ki(r.created),statusupdated:ki(r.statusupdated),updated:ki(r.updated),duedate:ki(r.duedate),taskflag:r.taskflag==="true",reminderdate:r.reminder?ki(r.reminder.reminderdate):void 0,sortweight:r.sortweight}),ki=r=>r?(0,Cf.moment)(r,"YYYYMMDDThhmmssZ").toDate():void 0;var um=Yn(Uf());var Oe=r=>{let t={get(e,n){return e[n]}};return new Proxy(r.attributes,t)};var Hf="\n```\n",jl=r=>{let t=Oe(r);return t.style&&t.style.value.indexOf("-en-codeblock:true")>=0},Ix=r=>{let t=Oe(r),e="padding-left:",n=0;return t.style&&t.style.value.indexOf(e)>=0&&(n=Math.floor(t.style.value.split(e)[1].split("px")[0]/20)),n},Ul=r=>r.replace(/\\(.)/g,"$1"),Wf=(r,t)=>{let e=Ix(t);return r=`${" ".repeat(e)}${r}`,jl(t)?(r=Ul(r),`${Hf}${r}${Hf}`):t.parentElement&&jl(t.parentElement)&&t.parentElement.firstElementChild===t?`${r}`:t.parentElement&&jl(t.parentElement)?`
${r}`:t.isBlock?`
${r}
`:r};var Ka="\n```\n",Fx="-en-codeblock:true",Lx=/\b(Courier|Mono|Consolas|Console|Inconsolata|Pitch|Monaco|monospace)\b/,Vf=r=>{var a,o;if(r.nodeType!==1)return null;let t=r.childNodes,e=t.length;if(e>1)return"mixed";if(e===1){let l=Vf(t[0]);if(l)return l}let n=Oe(r);if(r.tagName==="FONT")return(a=n.face)==null?void 0:a.value;let i=(o=n.style)==null?void 0:o.value;if(i){let l=i.match(/font-family:([^;]+)/);if(l)return l[1]}return null},Pi=r=>{var i;let e=(i=Oe(r).style)==null?void 0:i.value;if(e&&e.includes(Fx))return!0;let n=Vf(r);return!!n&&Lx.test(n)},zf=(r,t)=>{if(Pi(t)){let e=t.previousSibling,n=e&&e.tagName===t.tagName&&Pi(e),i=t.nextSibling,a=i&&i.tagName===t.tagName&&Pi(i);return n||a?(r=n?`
${r}`:`${Ka}${r}`,r=a?`${r}
`:`${r}${Ka}`,r):(r=Ul(r),r.trim()?`${Ka}${r}${Ka}`:r)}return t.parentElement&&Pi(t.parentElement)&&t.parentElement.firstElementChild===t?r:t.parentElement&&Pi(t.parentElement)?`
${r}`:t.isBlock?`
${r}
`:r};var Tt=r=>t=>t.nodeName===r||t.nodeName.toLowerCase()===r;var Gf={filter:Tt("IMG"),replacement:(r,t)=>{let e=Oe(t);if(!e.src)return"";let n=e.src.value,i=t.width||"",a=t.height||"",o=n;Q.sanitizeResourceNameSpaces?o=o.replace(/ /g,Q.replacementChar):Q.urlEncodeFileNamesAndLinks&&(o=encodeURI(o));let l=i||a?` =${i}x${a}`:"";if(Q.keepImageSize)return l=i||a?`|${i||0}x${a||0}`:"",o.startsWith("./")?`![[${o}${l}]]`:`![${l}](${o})`;if(!n.match(/^[a-z]+:/))return`![[${o}]]`;let s=e.src.value.split("/");return`![${s[s.length-1]}](${o})`}};var et=class r{constructor(){this.noteIdNameMap={},this.noteIdNameTOCMap={}}static getInstance(){return r.instance||(r.instance=new r),r.instance}addItemToMap(t){this.noteIdNameMap[t.url]={...this.noteIdNameMap[t.url],title:t.title,noteName:this.currentNoteName,notebookName:this.currentNotebookName,uniqueEnd:t.uniqueEnd}}addItemToTOCMap(t){this.noteIdNameTOCMap[t.url]={...this.noteIdNameMap[t.url],title:t.title,noteName:this.currentNoteName,notebookName:this.currentNotebookName,uniqueEnd:t.uniqueEnd}}getNoteIdNameMap(){return this.noteIdNameMap}getNoteIdNameTOCMap(){return this.noteIdNameTOCMap}getAllNoteIdNameMap(){return{...this.noteIdNameMap,...this.noteIdNameTOCMap}}getNoteIdNameMapByNoteTitle(t){return Object.values(this.getAllNoteIdNameMap()).filter(e=>e.title===t)}setCurrentNotebookName(t){this.currentNotebookName=t}getCurrentNotebookName(){return this.currentNotebookName}setCurrentNotebookFullpath(t){this.currentNotebookFullpath=t}setCurrentNoteName(t){this.currentNoteName=t}getCurrentNoteName(){return this.currentNoteName}getCurrentNotePath(){return this.currentNotePath}setCurrentNotePath(t){this.currentNotePath=t}getCurrentNotebookFullpath(){return this.currentNotebookFullpath}};var Zf=require("obsidian");var Rn=r=>r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");var Mx={"application/andrew-inset":"ez","application/applixware":"aw","application/atom+xml":"atom","application/atomcat+xml":"atomcat","application/atomdeleted+xml":"atomdeleted","application/atomsvc+xml":"atomsvc","application/atsc-dwd+xml":"dwd","application/atsc-held+xml":"held","application/atsc-rsat+xml":"rsat","application/bdoc":"bdoc","application/calendar+xml":"xcs","application/ccxml+xml":"ccxml","application/cdfx+xml":"cdfx","application/cdmi-capability":"cdmia","application/cdmi-container":"cdmic","application/cdmi-domain":"cdmid","application/cdmi-object":"cdmio","application/cdmi-queue":"cdmiq","application/cpl+xml":"cpl","application/cu-seeme":"cu","application/dash+xml":"mpd","application/dash-patch+xml":"mpp","application/davmount+xml":"davmount","application/docbook+xml":"dbk","application/dssc+der":"dssc","application/dssc+xml":"xdssc","application/ecmascript":"es","application/emma+xml":"emma","application/emotionml+xml":"emotionml","application/epub+zip":"epub","application/exi":"exi","application/express":"exp","application/fdt+xml":"fdt","application/font-tdpfr":"pfr","application/geo+json":"geojson","application/gml+xml":"gml","application/gpx+xml":"gpx","application/gxf":"gxf","application/gzip":"gz","application/hjson":"hjson","application/hyperstudio":"stk","application/inkml+xml":"ink","application/ipfix":"ipfix","application/its+xml":"its","application/java-archive":"jar","application/java-serialized-object":"ser","application/java-vm":"class","application/javascript":"js","application/json":"json","application/json5":"json5","application/jsonml+json":"jsonml","application/ld+json":"jsonld","application/lgr+xml":"lgr","application/lost+xml":"lostxml","application/mac-binhex40":"hqx","application/mac-compactpro":"cpt","application/mads+xml":"mads","application/manifest+json":"webmanifest","application/marc":"mrc","application/marcxml+xml":"mrcx","application/mathematica":"ma","application/mathml+xml":"mathml","application/mbox":"mbox","application/media-policy-dataset+xml":"mpf","application/mediaservercontrol+xml":"mscml","application/metalink+xml":"metalink","application/metalink4+xml":"meta4","application/mets+xml":"mets","application/mmt-aei+xml":"maei","application/mmt-usd+xml":"musd","application/mods+xml":"mods","application/mp21":"m21","application/mp4":"mp4s","application/msword":"doc","application/mxf":"mxf","application/n-quads":"nq","application/n-triples":"nt","application/node":"cjs","application/octet-stream":"bin","application/oda":"oda","application/oebps-package+xml":"opf","application/ogg":"ogx","application/omdoc+xml":"omdoc","application/onenote":"onetoc","application/oxps":"oxps","application/p2p-overlay+xml":"relo","application/patch-ops-error+xml":"xer","application/pdf":"pdf","application/pgp-encrypted":"pgp","application/pgp-keys":"asc","application/pgp-signature":"asc","application/pics-rules":"prf","application/pkcs10":"p10","application/pkcs7-mime":"p7m","application/pkcs7-signature":"p7s","application/pkcs8":"p8","application/pkix-attr-cert":"ac","application/pkix-cert":"cer","application/pkix-crl":"crl","application/pkix-pkipath":"pkipath","application/pkixcmp":"pki","application/pls+xml":"pls","application/postscript":"ai","application/provenance+xml":"provx","application/prs.cww":"cww","application/pskc+xml":"pskcxml","application/raml+yaml":"raml","application/rdf+xml":"rdf","application/reginfo+xml":"rif","application/relax-ng-compact-syntax":"rnc","application/resource-lists+xml":"rl","application/resource-lists-diff+xml":"rld","application/rls-services+xml":"rs","application/route-apd+xml":"rapd","application/route-s-tsid+xml":"sls","application/route-usd+xml":"rusd","application/rpki-ghostbusters":"gbr","application/rpki-manifest":"mft","application/rpki-roa":"roa","application/rsd+xml":"rsd","application/rss+xml":"rss","application/rtf":"rtf","application/sbml+xml":"sbml","application/scvp-cv-request":"scq","application/scvp-cv-response":"scs","application/scvp-vp-request":"spq","application/scvp-vp-response":"spp","application/sdp":"sdp","application/senml+xml":"senmlx","application/sensml+xml":"sensmlx","application/set-payment-initiation":"setpay","application/set-registration-initiation":"setreg","application/shf+xml":"shf","application/sieve":"siv","application/smil+xml":"smi","application/sparql-query":"rq","application/sparql-results+xml":"srx","application/srgs":"gram","application/srgs+xml":"grxml","application/sru+xml":"sru","application/ssdl+xml":"ssdl","application/ssml+xml":"ssml","application/swid+xml":"swidtag","application/tei+xml":"tei","application/thraud+xml":"tfi","application/timestamped-data":"tsd","application/toml":"toml","application/trig":"trig","application/ttml+xml":"ttml","application/ubjson":"ubj","application/urc-ressheet+xml":"rsheet","application/urc-targetdesc+xml":"td","application/vnd.1000minds.decision-model+xml":"1km","application/vnd.3gpp.pic-bw-large":"plb","application/vnd.3gpp.pic-bw-small":"psb","application/vnd.3gpp.pic-bw-var":"pvb","application/vnd.3gpp2.tcap":"tcap","application/vnd.3m.post-it-notes":"pwn","application/vnd.accpac.simply.aso":"aso","application/vnd.accpac.simply.imp":"imp","application/vnd.acucobol":"acu","application/vnd.acucorp":"atc","application/vnd.adobe.air-application-installer-package+zip":"air","application/vnd.adobe.formscentral.fcdt":"fcdt","application/vnd.adobe.fxp":"fxp","application/vnd.adobe.xdp+xml":"xdp","application/vnd.adobe.xfdf":"xfdf","application/vnd.age":"age","application/vnd.ahead.space":"ahead","application/vnd.airzip.filesecure.azf":"azf","application/vnd.airzip.filesecure.azs":"azs","application/vnd.amazon.ebook":"azw","application/vnd.americandynamics.acc":"acc","application/vnd.amiga.ami":"ami","application/vnd.android.package-archive":"apk","application/vnd.anser-web-certificate-issue-initiation":"cii","application/vnd.anser-web-funds-transfer-initiation":"fti","application/vnd.antix.game-component":"atx","application/vnd.apple.installer+xml":"mpkg","application/vnd.apple.keynote":"key","application/vnd.apple.mpegurl":"m3u8","application/vnd.apple.numbers":"numbers","application/vnd.apple.pages":"pages","application/vnd.apple.pkpass":"pkpass","application/vnd.aristanetworks.swi":"swi","application/vnd.astraea-software.iota":"iota","application/vnd.audiograph":"aep","application/vnd.balsamiq.bmml+xml":"bmml","application/vnd.blueice.multipass":"mpm","application/vnd.bmi":"bmi","application/vnd.businessobjects":"rep","application/vnd.chemdraw+xml":"cdxml","application/vnd.chipnuts.karaoke-mmd":"mmd","application/vnd.cinderella":"cdy","application/vnd.citationstyles.style+xml":"csl","application/vnd.claymore":"cla","application/vnd.cloanto.rp9":"rp9","application/vnd.clonk.c4group":"c4g","application/vnd.cluetrust.cartomobile-config":"c11amc","application/vnd.cluetrust.cartomobile-config-pkg":"c11amz","application/vnd.commonspace":"csp","application/vnd.contact.cmsg":"cdbcmsg","application/vnd.cosmocaller":"cmc","application/vnd.crick.clicker":"clkx","application/vnd.crick.clicker.keyboard":"clkk","application/vnd.crick.clicker.palette":"clkp","application/vnd.crick.clicker.template":"clkt","application/vnd.crick.clicker.wordbank":"clkw","application/vnd.criticaltools.wbs+xml":"wbs","application/vnd.ctc-posml":"pml","application/vnd.cups-ppd":"ppd","application/vnd.curl.car":"car","application/vnd.curl.pcurl":"pcurl","application/vnd.dart":"dart","application/vnd.data-vision.rdz":"rdz","application/vnd.dbf":"dbf","application/vnd.dece.data":"uvf","application/vnd.dece.ttml+xml":"uvt","application/vnd.dece.unspecified":"uvx","application/vnd.dece.zip":"uvz","application/vnd.denovo.fcselayout-link":"fe_launch","application/vnd.dna":"dna","application/vnd.dolby.mlp":"mlp","application/vnd.dpgraph":"dpg","application/vnd.dreamfactory":"dfac","application/vnd.ds-keypoint":"kpxx","application/vnd.dvb.ait":"ait","application/vnd.dvb.service":"svc","application/vnd.dynageo":"geo","application/vnd.ecowin.chart":"mag","application/vnd.enliven":"nml","application/vnd.epson.esf":"esf","application/vnd.epson.msf":"msf","application/vnd.epson.quickanime":"qam","application/vnd.epson.salt":"slt","application/vnd.epson.ssf":"ssf","application/vnd.eszigno3+xml":"es3","application/vnd.ezpix-album":"ez2","application/vnd.ezpix-package":"ez3","application/vnd.fdf":"fdf","application/vnd.fdsn.mseed":"mseed","application/vnd.fdsn.seed":"seed","application/vnd.flographit":"gph","application/vnd.fluxtime.clip":"ftc","application/vnd.framemaker":"fm","application/vnd.frogans.fnc":"fnc","application/vnd.frogans.ltf":"ltf","application/vnd.fsc.weblaunch":"fsc","application/vnd.fujitsu.oasys":"oas","application/vnd.fujitsu.oasys2":"oa2","application/vnd.fujitsu.oasys3":"oa3","application/vnd.fujitsu.oasysgp":"fg5","application/vnd.fujitsu.oasysprs":"bh2","application/vnd.fujixerox.ddd":"ddd","application/vnd.fujixerox.docuworks":"xdw","application/vnd.fujixerox.docuworks.binder":"xbd","application/vnd.fuzzysheet":"fzs","application/vnd.genomatix.tuxedo":"txd","application/vnd.geogebra.file":"ggb","application/vnd.geogebra.tool":"ggt","application/vnd.geometry-explorer":"gex","application/vnd.geonext":"gxt","application/vnd.geoplan":"g2w","application/vnd.geospace":"g3w","application/vnd.gmx":"gmx","application/vnd.google-apps.document":"gdoc","application/vnd.google-apps.presentation":"gslides","application/vnd.google-apps.spreadsheet":"gsheet","application/vnd.google-earth.kml+xml":"kml","application/vnd.google-earth.kmz":"kmz","application/vnd.grafeq":"gqf","application/vnd.groove-account":"gac","application/vnd.groove-help":"ghf","application/vnd.groove-identity-message":"gim","application/vnd.groove-injector":"grv","application/vnd.groove-tool-message":"gtm","application/vnd.groove-tool-template":"tpl","application/vnd.groove-vcard":"vcg","application/vnd.hal+xml":"hal","application/vnd.handheld-entertainment+xml":"zmm","application/vnd.hbci":"hbci","application/vnd.hhe.lesson-player":"les","application/vnd.hp-hpgl":"hpgl","application/vnd.hp-hpid":"hpid","application/vnd.hp-hps":"hps","application/vnd.hp-jlyt":"jlt","application/vnd.hp-pcl":"pcl","application/vnd.hp-pclxl":"pclxl","application/vnd.hydrostatix.sof-data":"sfd-hdstx","application/vnd.ibm.minipay":"mpy","application/vnd.ibm.modcap":"afp","application/vnd.ibm.rights-management":"irm","application/vnd.ibm.secure-container":"sc","application/vnd.iccprofile":"icc","application/vnd.igloader":"igl","application/vnd.immervision-ivp":"ivp","application/vnd.immervision-ivu":"ivu","application/vnd.insors.igm":"igm","application/vnd.intercon.formnet":"xpw","application/vnd.intergeo":"i2g","application/vnd.intu.qbo":"qbo","application/vnd.intu.qfx":"qfx","application/vnd.ipunplugged.rcprofile":"rcprofile","application/vnd.irepository.package+xml":"irp","application/vnd.is-xpr":"xpr","application/vnd.isac.fcs":"fcs","application/vnd.jam":"jam","application/vnd.jcp.javame.midlet-rms":"rms","application/vnd.jisp":"jisp","application/vnd.joost.joda-archive":"joda","application/vnd.kahootz":"ktz","application/vnd.kde.karbon":"karbon","application/vnd.kde.kchart":"chrt","application/vnd.kde.kformula":"kfo","application/vnd.kde.kivio":"flw","application/vnd.kde.kontour":"kon","application/vnd.kde.kpresenter":"kpr","application/vnd.kde.kspread":"ksp","application/vnd.kde.kword":"kwd","application/vnd.kenameaapp":"htke","application/vnd.kidspiration":"kia","application/vnd.kinar":"kne","application/vnd.koan":"skp","application/vnd.kodak-descriptor":"sse","application/vnd.las.las+xml":"lasxml","application/vnd.llamagraphics.life-balance.desktop":"lbd","application/vnd.llamagraphics.life-balance.exchange+xml":"lbe","application/vnd.lotus-1-2-3":"123","application/vnd.lotus-approach":"apr","application/vnd.lotus-freelance":"pre","application/vnd.lotus-notes":"nsf","application/vnd.lotus-organizer":"org","application/vnd.lotus-screencam":"scm","application/vnd.lotus-wordpro":"lwp","application/vnd.macports.portpkg":"portpkg","application/vnd.mapbox-vector-tile":"mvt","application/vnd.mcd":"mcd","application/vnd.medcalcdata":"mc1","application/vnd.mediastation.cdkey":"cdkey","application/vnd.mfer":"mwf","application/vnd.mfmp":"mfm","application/vnd.micrografx.flo":"flo","application/vnd.micrografx.igx":"igx","application/vnd.mif":"mif","application/vnd.mobius.daf":"daf","application/vnd.mobius.dis":"dis","application/vnd.mobius.mbk":"mbk","application/vnd.mobius.mqy":"mqy","application/vnd.mobius.msl":"msl","application/vnd.mobius.plc":"plc","application/vnd.mobius.txf":"txf","application/vnd.mophun.application":"mpn","application/vnd.mophun.certificate":"mpc","application/vnd.mozilla.xul+xml":"xul","application/vnd.ms-artgalry":"cil","application/vnd.ms-cab-compressed":"cab","application/vnd.ms-excel":"xls","application/vnd.ms-excel.addin.macroenabled.12":"xlam","application/vnd.ms-excel.sheet.binary.macroenabled.12":"xlsb","application/vnd.ms-excel.sheet.macroenabled.12":"xlsm","application/vnd.ms-excel.template.macroenabled.12":"xltm","application/vnd.ms-fontobject":"eot","application/vnd.ms-htmlhelp":"chm","application/vnd.ms-ims":"ims","application/vnd.ms-lrm":"lrm","application/vnd.ms-officetheme":"thmx","application/vnd.ms-outlook":"msg","application/vnd.ms-pki.seccat":"cat","application/vnd.ms-pki.stl":"stl","application/vnd.ms-powerpoint":"ppt","application/vnd.ms-powerpoint.addin.macroenabled.12":"ppam","application/vnd.ms-powerpoint.presentation.macroenabled.12":"pptm","application/vnd.ms-powerpoint.slide.macroenabled.12":"sldm","application/vnd.ms-powerpoint.slideshow.macroenabled.12":"ppsm","application/vnd.ms-powerpoint.template.macroenabled.12":"potm","application/vnd.ms-project":"mpp","application/vnd.ms-word.document.macroenabled.12":"docm","application/vnd.ms-word.template.macroenabled.12":"dotm","application/vnd.ms-works":"wps","application/vnd.ms-wpl":"wpl","application/vnd.ms-xpsdocument":"xps","application/vnd.mseq":"mseq","application/vnd.musician":"mus","application/vnd.muvee.style":"msty","application/vnd.mynfc":"taglet","application/vnd.neurolanguage.nlu":"nlu","application/vnd.nitf":"ntf","application/vnd.noblenet-directory":"nnd","application/vnd.noblenet-sealer":"nns","application/vnd.noblenet-web":"nnw","application/vnd.nokia.n-gage.ac+xml":"ac","application/vnd.nokia.n-gage.data":"ngdat","application/vnd.nokia.n-gage.symbian.install":"n-gage","application/vnd.nokia.radio-preset":"rpst","application/vnd.nokia.radio-presets":"rpss","application/vnd.novadigm.edm":"edm","application/vnd.novadigm.edx":"edx","application/vnd.novadigm.ext":"ext","application/vnd.oasis.opendocument.chart":"odc","application/vnd.oasis.opendocument.chart-template":"otc","application/vnd.oasis.opendocument.database":"odb","application/vnd.oasis.opendocument.formula":"odf","application/vnd.oasis.opendocument.formula-template":"odft","application/vnd.oasis.opendocument.graphics":"odg","application/vnd.oasis.opendocument.graphics-template":"otg","application/vnd.oasis.opendocument.image":"odi","application/vnd.oasis.opendocument.image-template":"oti","application/vnd.oasis.opendocument.presentation":"odp","application/vnd.oasis.opendocument.presentation-template":"otp","application/vnd.oasis.opendocument.spreadsheet":"ods","application/vnd.oasis.opendocument.spreadsheet-template":"ots","application/vnd.oasis.opendocument.text":"odt","application/vnd.oasis.opendocument.text-master":"odm","application/vnd.oasis.opendocument.text-template":"ott","application/vnd.oasis.opendocument.text-web":"oth","application/vnd.olpc-sugar":"xo","application/vnd.oma.dd2+xml":"dd2","application/vnd.openblox.game+xml":"obgx","application/vnd.openofficeorg.extension":"oxt","application/vnd.openstreetmap.data+xml":"osm","application/vnd.openxmlformats-officedocument.presentationml.presentation":"pptx","application/vnd.openxmlformats-officedocument.presentationml.slide":"sldx","application/vnd.openxmlformats-officedocument.presentationml.slideshow":"ppsx","application/vnd.openxmlformats-officedocument.presentationml.template":"potx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.template":"xltx","application/vnd.openxmlformats-officedocument.wordprocessingml.document":"docx","application/vnd.openxmlformats-officedocument.wordprocessingml.template":"dotx","application/vnd.osgeo.mapguide.package":"mgp","application/vnd.osgi.dp":"dp","application/vnd.osgi.subsystem":"esa","application/vnd.palm":"pdb","application/vnd.pawaafile":"paw","application/vnd.pg.format":"str","application/vnd.pg.osasli":"ei6","application/vnd.picsel":"efif","application/vnd.pmi.widget":"wg","application/vnd.pocketlearn":"plf","application/vnd.powerbuilder6":"pbd","application/vnd.previewsystems.box":"box","application/vnd.proteus.magazine":"mgz","application/vnd.publishare-delta-tree":"qps","application/vnd.pvi.ptid1":"ptid","application/vnd.quark.quarkxpress":"qxd","application/vnd.rar":"rar","application/vnd.realvnc.bed":"bed","application/vnd.recordare.musicxml":"mxl","application/vnd.recordare.musicxml+xml":"musicxml","application/vnd.rig.cryptonote":"cryptonote","application/vnd.rim.cod":"cod","application/vnd.rn-realmedia":"rm","application/vnd.rn-realmedia-vbr":"rmvb","application/vnd.route66.link66+xml":"link66","application/vnd.sailingtracker.track":"st","application/vnd.seemail":"see","application/vnd.sema":"sema","application/vnd.semd":"semd","application/vnd.semf":"semf","application/vnd.shana.informed.formdata":"ifm","application/vnd.shana.informed.formtemplate":"itp","application/vnd.shana.informed.interchange":"iif","application/vnd.shana.informed.package":"ipk","application/vnd.simtech-mindmapper":"twd","application/vnd.smaf":"mmf","application/vnd.smart.teacher":"teacher","application/vnd.software602.filler.form+xml":"fo","application/vnd.solent.sdkm+xml":"sdkm","application/vnd.spotfire.dxp":"dxp","application/vnd.spotfire.sfs":"sfs","application/vnd.stardivision.calc":"sdc","application/vnd.stardivision.draw":"sda","application/vnd.stardivision.impress":"sdd","application/vnd.stardivision.math":"smf","application/vnd.stardivision.writer":"sdw","application/vnd.stardivision.writer-global":"sgl","application/vnd.stepmania.package":"smzip","application/vnd.stepmania.stepchart":"sm","application/vnd.sun.wadl+xml":"wadl","application/vnd.sun.xml.calc":"sxc","application/vnd.sun.xml.calc.template":"stc","application/vnd.sun.xml.draw":"sxd","application/vnd.sun.xml.draw.template":"std","application/vnd.sun.xml.impress":"sxi","application/vnd.sun.xml.impress.template":"sti","application/vnd.sun.xml.math":"sxm","application/vnd.sun.xml.writer":"sxw","application/vnd.sun.xml.writer.global":"sxg","application/vnd.sun.xml.writer.template":"stw","application/vnd.sus-calendar":"sus","application/vnd.svd":"svd","application/vnd.symbian.install":"sis","application/vnd.syncml+xml":"xsm","application/vnd.syncml.dm+wbxml":"bdm","application/vnd.syncml.dm+xml":"xdm","application/vnd.syncml.dmddf+xml":"ddf","application/vnd.tao.intent-module-archive":"tao","application/vnd.tcpdump.pcap":"pcap","application/vnd.tmobile-livetv":"tmo","application/vnd.trid.tpt":"tpt","application/vnd.triscape.mxs":"mxs","application/vnd.trueapp":"tra","application/vnd.ufdl":"ufd","application/vnd.uiq.theme":"utz","application/vnd.umajin":"umj","application/vnd.unity":"unityweb","application/vnd.uoml+xml":"uoml","application/vnd.vcx":"vcx","application/vnd.visio":"vsd","application/vnd.visionary":"vis","application/vnd.vsf":"vsf","application/vnd.wap.wbxml":"wbxml","application/vnd.wap.wmlc":"wmlc","application/vnd.wap.wmlscriptc":"wmlsc","application/vnd.webturbo":"wtb","application/vnd.wolfram.player":"nbp","application/vnd.wordperfect":"wpd","application/vnd.wqd":"wqd","application/vnd.wt.stf":"stf","application/vnd.xara":"xar","application/vnd.xfdl":"xfdl","application/vnd.yamaha.hv-dic":"hvd","application/vnd.yamaha.hv-script":"hvs","application/vnd.yamaha.hv-voice":"hvp","application/vnd.yamaha.openscoreformat":"osf","application/vnd.yamaha.openscoreformat.osfpvg+xml":"osfpvg","application/vnd.yamaha.smaf-audio":"saf","application/vnd.yamaha.smaf-phrase":"spf","application/vnd.yellowriver-custom-menu":"cmp","application/vnd.zul":"zir","application/vnd.zzazz.deck+xml":"zaz","application/voicexml+xml":"vxml","application/wasm":"wasm","application/watcherinfo+xml":"wif","application/widget":"wgt","application/winhlp":"hlp","application/wsdl+xml":"wsdl","application/wspolicy+xml":"wspolicy","application/x-7z-compressed":"7z","application/x-abiword":"abw","application/x-ace-compressed":"ace","application/x-apple-diskimage":"dmg","application/x-arj":"arj","application/x-authorware-bin":"aab","application/x-authorware-map":"aam","application/x-authorware-seg":"aas","application/x-bcpio":"bcpio","application/x-bdoc":"bdoc","application/x-bittorrent":"torrent","application/x-blorb":"blb","application/x-bzip":"bz","application/x-bzip2":"bz2","application/x-cbr":"cbr","application/x-cdlink":"vcd","application/x-cfs-compressed":"cfs","application/x-chat":"chat","application/x-chess-pgn":"pgn","application/x-chrome-extension":"crx","application/x-cocoa":"cco","application/x-conference":"nsc","application/x-cpio":"cpio","application/x-csh":"csh","application/x-debian-package":"deb","application/x-dgc-compressed":"dgc","application/x-director":"dir","application/x-doom":"wad","application/x-dtbncx+xml":"ncx","application/x-dtbook+xml":"dtb","application/x-dtbresource+xml":"res","application/x-dvi":"dvi","application/x-envoy":"evy","application/x-eva":"eva","application/x-font-bdf":"bdf","application/x-font-ghostscript":"gsf","application/x-font-linux-psf":"psf","application/x-font-pcf":"pcf","application/x-font-snf":"snf","application/x-font-type1":"pfa","application/x-freearc":"arc","application/x-futuresplash":"spl","application/x-gca-compressed":"gca","application/x-glulx":"ulx","application/x-gnumeric":"gnumeric","application/x-gramps-xml":"gramps","application/x-gtar":"gtar","application/x-hdf":"hdf","application/x-httpd-php":"php","application/x-install-instructions":"install","application/x-iso9660-image":"iso","application/x-iwork-keynote-sffkey":"key","application/x-iwork-numbers-sffnumbers":"numbers","application/x-iwork-pages-sffpages":"pages","application/x-java-archive-diff":"jardiff","application/x-java-jnlp-file":"jnlp","application/x-keepass2":"kdbx","application/x-latex":"latex","application/x-lua-bytecode":"luac","application/x-lzh-compressed":"lzh","application/x-makeself":"run","application/x-mie":"mie","application/x-mobipocket-ebook":"prc","application/x-ms-application":"application","application/x-ms-shortcut":"lnk","application/x-ms-wmd":"wmd","application/x-ms-wmz":"wmz","application/x-ms-xbap":"xbap","application/x-msaccess":"mdb","application/x-msbinder":"obd","application/x-mscardfile":"crd","application/x-msclip":"clp","application/x-msdos-program":"exe","application/x-msdownload":"exe","application/x-msmediaview":"mvb","application/x-msmetafile":"wmf","application/x-msmoney":"mny","application/x-mspublisher":"pub","application/x-msschedule":"scd","application/x-msterminal":"trm","application/x-mswrite":"wri","application/x-netcdf":"nc","application/x-ns-proxy-autoconfig":"pac","application/x-nzb":"nzb","application/x-perl":"pl","application/x-pilot":"prc","application/x-pkcs12":"p12","application/x-pkcs7-certificates":"p7b","application/x-pkcs7-certreqresp":"p7r","application/x-rar-compressed":"rar","application/x-redhat-package-manager":"rpm","application/x-research-info-systems":"ris","application/x-sea":"sea","application/x-sh":"sh","application/x-shar":"shar","application/x-shockwave-flash":"swf","application/x-silverlight-app":"xap","application/x-sql":"sql","application/x-stuffit":"sit","application/x-stuffitx":"sitx","application/x-subrip":"srt","application/x-sv4cpio":"sv4cpio","application/x-sv4crc":"sv4crc","application/x-t3vm-image":"t3","application/x-tads":"gam","application/x-tar":"tar","application/x-tcl":"tcl","application/x-tex":"tex","application/x-tex-tfm":"tfm","application/x-texinfo":"texinfo","application/x-tgif":"obj","application/x-ustar":"ustar","application/x-virtualbox-hdd":"hdd","application/x-virtualbox-ova":"ova","application/x-virtualbox-ovf":"ovf","application/x-virtualbox-vbox":"vbox","application/x-virtualbox-vbox-extpack":"vbox-extpack","application/x-virtualbox-vdi":"vdi","application/x-virtualbox-vhd":"vhd","application/x-virtualbox-vmdk":"vmdk","application/x-wais-source":"src","application/x-web-app-manifest+json":"webapp","application/x-x509-ca-cert":"der","application/x-xfig":"fig","application/x-xliff+xml":"xlf","application/x-xpinstall":"xpi","application/x-xz":"xz","application/x-zmachine":"z1","application/xaml+xml":"xaml","application/xcap-att+xml":"xav","application/xcap-caps+xml":"xca","application/xcap-diff+xml":"xdf","application/xcap-el+xml":"xel","application/xcap-ns+xml":"xns","application/xenc+xml":"xenc","application/xhtml+xml":"xhtml","application/xliff+xml":"xlf","application/xml":"xml","application/xml-dtd":"dtd","application/xop+xml":"xop","application/xproc+xml":"xpl","application/xslt+xml":"xsl","application/xspf+xml":"xspf","application/xv+xml":"mxml","application/yang":"yang","application/yin+xml":"yin","application/zip":"zip","audio/3gpp":"3gpp","audio/adpcm":"adp","audio/amr":"amr","audio/basic":"au","audio/midi":"mid","audio/mobile-xmf":"mxmf","audio/mp3":"mp3","audio/mp4":"m4a","audio/mpeg":"mpga","audio/ogg":"oga","audio/s3m":"s3m","audio/silk":"sil","audio/vnd.dece.audio":"uva","audio/vnd.digital-winds":"eol","audio/vnd.dra":"dra","audio/vnd.dts":"dts","audio/vnd.dts.hd":"dtshd","audio/vnd.lucent.voice":"lvp","audio/vnd.ms-playready.media.pya":"pya","audio/vnd.nuera.ecelp4800":"ecelp4800","audio/vnd.nuera.ecelp7470":"ecelp7470","audio/vnd.nuera.ecelp9600":"ecelp9600","audio/vnd.rip":"rip","audio/wav":"wav","audio/wave":"wav","audio/webm":"weba","audio/x-aac":"aac","audio/x-aiff":"aif","audio/x-caf":"caf","audio/x-flac":"flac","audio/x-m4a":"m4a","audio/x-matroska":"mka","audio/x-mpegurl":"m3u","audio/x-ms-wax":"wax","audio/x-ms-wma":"wma","audio/x-pn-realaudio":"ram","audio/x-pn-realaudio-plugin":"rmp","audio/x-realaudio":"ra","audio/x-wav":"wav","audio/xm":"xm","chemical/x-cdx":"cdx","chemical/x-cif":"cif","chemical/x-cmdf":"cmdf","chemical/x-cml":"cml","chemical/x-csml":"csml","chemical/x-xyz":"xyz","font/collection":"ttc","font/otf":"otf","font/ttf":"ttf","font/woff":"woff","font/woff2":"woff2","image/aces":"exr","image/apng":"apng","image/avci":"avci","image/avcs":"avcs","image/avif":"avif","image/bmp":"bmp","image/cgm":"cgm","image/dicom-rle":"drle","image/emf":"emf","image/fits":"fits","image/g3fax":"g3","image/gif":"gif","image/heic":"heic","image/heic-sequence":"heics","image/heif":"heif","image/heif-sequence":"heifs","image/hej2k":"hej2","image/hsj2":"hsj2","image/ief":"ief","image/jls":"jls","image/jp2":"jp2","image/jpeg":"jpeg","image/jph":"jph","image/jphc":"jhc","image/jpm":"jpm","image/jpx":"jpx","image/jxr":"jxr","image/jxra":"jxra","image/jxrs":"jxrs","image/jxs":"jxs","image/jxsc":"jxsc","image/jxsi":"jxsi","image/jxss":"jxss","image/ktx":"ktx","image/ktx2":"ktx2","image/png":"png","image/prs.btif":"btif","image/prs.pti":"pti","image/sgi":"sgi","image/svg+xml":"svg","image/t38":"t38","image/tiff":"tif","image/tiff-fx":"tfx","image/vnd.adobe.photoshop":"psd","image/vnd.airzip.accelerator.azv":"azv","image/vnd.dece.graphic":"uvi","image/vnd.djvu":"djvu","image/vnd.dvb.subtitle":"sub","image/vnd.dwg":"dwg","image/vnd.dxf":"dxf","image/vnd.fastbidsheet":"fbs","image/vnd.fpx":"fpx","image/vnd.fst":"fst","image/vnd.fujixerox.edmics-mmr":"mmr","image/vnd.fujixerox.edmics-rlc":"rlc","image/vnd.microsoft.icon":"ico","image/vnd.ms-dds":"dds","image/vnd.ms-modi":"mdi","image/vnd.ms-photo":"wdp","image/vnd.net-fpx":"npx","image/vnd.pco.b16":"b16","image/vnd.tencent.tap":"tap","image/vnd.valve.source.texture":"vtf","image/vnd.wap.wbmp":"wbmp","image/vnd.xiff":"xif","image/vnd.zbrush.pcx":"pcx","image/webp":"webp","image/wmf":"wmf","image/x-3ds":"3ds","image/x-cmu-raster":"ras","image/x-cmx":"cmx","image/x-freehand":"fh","image/x-icon":"ico","image/x-jng":"jng","image/x-mrsid-image":"sid","image/x-ms-bmp":"bmp","image/x-pcx":"pcx","image/x-pict":"pic","image/x-portable-anymap":"pnm","image/x-portable-bitmap":"pbm","image/x-portable-graymap":"pgm","image/x-portable-pixmap":"ppm","image/x-rgb":"rgb","image/x-tga":"tga","image/x-xbitmap":"xbm","image/x-xpixmap":"xpm","image/x-xwindowdump":"xwd","message/disposition-notification":"disposition-notification","message/global":"u8msg","message/global-delivery-status":"u8dsn","message/global-disposition-notification":"u8mdn","message/global-headers":"u8hdr","message/rfc822":"eml","message/vnd.wfa.wsc":"wsc","model/3mf":"3mf","model/gltf+json":"gltf","model/gltf-binary":"glb","model/iges":"igs","model/mesh":"msh","model/mtl":"mtl","model/obj":"obj","model/step+xml":"stpx","model/step+zip":"stpz","model/step-xml+zip":"stpxz","model/stl":"stl","model/vnd.collada+xml":"dae","model/vnd.dwf":"dwf","model/vnd.gdl":"gdl","model/vnd.gtw":"gtw","model/vnd.mts":"mts","model/vnd.opengex":"ogex","model/vnd.parasolid.transmit.binary":"x_b","model/vnd.parasolid.transmit.text":"x_t","model/vnd.sap.vds":"vds","model/vnd.usdz+zip":"usdz","model/vnd.valve.source.compiled-map":"bsp","model/vnd.vtu":"vtu","model/vrml":"wrl","model/x3d+binary":"x3db","model/x3d+fastinfoset":"x3db","model/x3d+vrml":"x3dv","model/x3d+xml":"x3d","model/x3d-vrml":"x3dv","text/cache-manifest":"appcache","text/calendar":"ics","text/coffeescript":"coffee","text/css":"css","text/csv":"csv","text/html":"html","text/jade":"jade","text/jsx":"jsx","text/less":"less","text/markdown":"markdown","text/mathml":"mml","text/mdx":"mdx","text/n3":"n3","text/plain":"txt","text/prs.lines.tag":"dsc","text/richtext":"rtx","text/rtf":"rtf","text/sgml":"sgml","text/shex":"shex","text/slim":"slim","text/spdx":"spdx","text/stylus":"stylus","text/tab-separated-values":"tsv","text/troff":"t","text/turtle":"ttl","text/uri-list":"uri","text/vcard":"vcard","text/vnd.curl":"curl","text/vnd.curl.dcurl":"dcurl","text/vnd.curl.mcurl":"mcurl","text/vnd.curl.scurl":"scurl","text/vnd.dvb.subtitle":"sub","text/vnd.familysearch.gedcom":"ged","text/vnd.fly":"fly","text/vnd.fmi.flexstor":"flx","text/vnd.graphviz":"gv","text/vnd.in3d.3dml":"3dml","text/vnd.in3d.spot":"spot","text/vnd.sun.j2me.app-descriptor":"jad","text/vnd.wap.wml":"wml","text/vnd.wap.wmlscript":"wmls","text/vtt":"vtt","text/x-asm":"s","text/x-c":"c","text/x-component":"htc","text/x-fortran":"f","text/x-handlebars-template":"hbs","text/x-java-source":"java","text/x-lua":"lua","text/x-markdown":"mkd","text/x-nfo":"nfo","text/x-opml":"opml","text/x-org":"org","text/x-pascal":"p","text/x-processing":"pde","text/x-sass":"sass","text/x-scss":"scss","text/x-setext":"etx","text/x-sfv":"sfv","text/x-suse-ymp":"ymp","text/x-uuencode":"uu","text/x-vcalendar":"vcs","text/x-vcard":"vcf","text/xml":"xml","text/yaml":"yaml","video/3gpp":"3gp","video/3gpp2":"3g2","video/h261":"h261","video/h263":"h263","video/h264":"h264","video/iso.segment":"m4s","video/jpeg":"jpgv","video/jpm":"jpm","video/mj2":"mj2","video/mp2t":"ts","video/mp4":"mp4","video/mpeg":"mpeg","video/ogg":"ogv","video/quicktime":"qt","video/vnd.dece.hd":"uvh","video/vnd.dece.mobile":"uvm","video/vnd.dece.pd":"uvp","video/vnd.dece.sd":"uvs","video/vnd.dece.video":"uvv","video/vnd.dvb.file":"dvb","video/vnd.fvt":"fvt","video/vnd.mpegurl":"mxu","video/vnd.ms-playready.media.pyv":"pyv","video/vnd.uvvu.mp4":"uvu","video/vnd.vivo":"viv","video/webm":"webm","video/x-f4v":"f4v","video/x-fli":"fli","video/x-flv":"flv","video/x-m4v":"m4v","video/x-matroska":"mkv","video/x-mng":"mng","video/x-ms-asf":"asf","video/x-ms-vob":"vob","video/x-ms-wm":"wm","video/x-ms-wmv":"wmv","video/x-ms-wmx":"wmx","video/x-ms-wvx":"wvx","video/x-msvideo":"avi","video/x-sgi-movie":"movie","video/x-smv":"smv","x-conference/x-cooltalk":"ice"},$x=/^\s*([^;\s]*)(?:;|\s|$)/;function On(r){if(!r||typeof r!="string")return"";let t=$x.exec(r);return t&&Mx[t[1].toLowerCase()]||""}var Xa=100,Bx=50,In=r=>_e(r).replace(/[\[\]\#\^]/g,""),Ni=(r,t)=>ue.readdirSync(r).filter(n=>{let i=n.split(".").slice(0,-1).join("."),a=Rn(t),o=i.match(new RegExp(`${a}\\.\\d+`));return i===t||o}).length,Kf=(r,t)=>{let e=Q.useUniqueUnknownFileNames?"unknown_filename"+(Math.random().toString(16)+"0000000").slice(2,10):"unknown_filename",n=Ux(t),i=e;if(t["resource-attributes"]&&t["resource-attributes"]["file-name"]){let l=t["resource-attributes"]["file-name"].substr(0,Bx);i=le(l).basename}i=i.replace(/[/\\?%*:|"<>\[\]\+]/g,"-"),Q.sanitizeResourceNameSpaces&&(i=i.replace(/ /g,Q.replacementChar));let a=Ni(r,i);return{fileName:`${a>0?`${i}.${a}`:i}.${n}`,extension:n,index:a}},Yf=r=>In(r.title?`${r.title.toString()}`:"Untitled"),Xf=(r,t,e="md")=>`${Hl(r,t)}.${e}`,qx=r=>{if(!(r["resource-attributes"]&&r["resource-attributes"]["file-name"]))return"";let t=r["resource-attributes"]["file-name"].split(".");return t.length>1?t[t.length-1]:void 0},jx=r=>{let t=r.mime;return t&&On(t)||""},Ux=r=>qx(r)||jx(r)||"dat",Hx=(r,t)=>(0,Zf.moment)(r.created).format("YYYYMMDDHHmm"),Hl=(r,t)=>{let e,n=Yf(t);if(Q.isZettelkastenNeeded||Q.useZettelIdAsFilename){let i=Hx(t,r),a=Ni(r,i),o=" ";if(e=a!==0?`${i}.${a}`:i,!Q.useZettelIdAsFilename&&n!=="Untitled"){let l=Xa-e.length-o.length,s=n.substring(0,Math.max(0,l));e=`${e}${o}${s}`}}else{n.length>Xa&&(n=n.substring(0,Xa),console.warn(`Note title too long (${Yf(t).length} chars), truncated to ${Xa} chars`));let i=Ni(r,n);e=i===0?n:`${n}.${i}`}return e};var Jf=r=>r==="Table of Contents";var Wx=r=>r.replace(/\[|\]/g,""),Vx=r=>r.replace(/\\/g,""),em={filter:Tt("A"),replacement:(r,t)=>{let e=Oe(t);if(!e.href)return"";let n=Ja(Q).turndown(Wx(t.innerHTML));n=Vx(n);let i="",a=n.match(/^(#{1,6} )(.*)/);a&&(i=a[1],n=a[2]);let o=e.href.value,l=e.type?e.type.value:void 0,s=Q.urlEncodeFileNamesAndLinks?encodeURI(o):o;if(l==="file")return`![[${s}]]`;if(o.match(/^(https?:|www\.|file:|ftp:|mailto:)/))return i+Yx(n,o);if(o.startsWith("evernote://")){let c=In(n),u=et.getInstance(),p=_n(6);return Jf(u.getCurrentNoteName())?u.addItemToTOCMap({url:o,title:c,uniqueEnd:p}):u.addItemToMap({url:o,title:c,uniqueEnd:p}),i+`[[${o}]]`}return i+`[[${s}${n===s?"":`|${n}`}]]`}},zx={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},tm=/&(?:amp|lt|gt|quot|#39);/g,Gx=RegExp(tm.source);function Qf(r){return r&&Gx.test(r)?r.replace(tm,t=>zx[t]):r}var Yx=(r,t)=>!r||Qf(r)===Qf(t)?Q.generateNakedUrls?t:`<${t}>`:`[${r}](${t})`;var ze={bold:"**",italic:"_",highlight:"==",strikethrough:"~~"};var Zx="-evernote-highlight:true;",Kx="--en-highlight",Xx="bold",Jx="italic",rm={filter:Tt("SPAN"),replacement:(r,t)=>{let e=Oe(t);if(e.style&&r.trim()!==""){let n=e.style.value;if(r!=="<YARLE_NEWLINE_PLACEHOLDER>"){let i=n.includes(Xx),a=n.includes(Jx);if(i&&!a)return`${ze.bold}${r}${ze.bold}`;if(!i&&a)return`${ze.italic}${r}${ze.italic}`;if(i&&a)return`${ze.italic}${ze.bold}${r}${ze.bold}${ze.italic}`}return n.includes(Zx)||n.includes(Kx)?`${ze.highlight}${r}${ze.highlight}`:r}return r}};var nm={filter:["del","s","strike"],replacement:r=>`${ze.strikethrough}${r}${ze.strikethrough}`};var im={filter:Tt("EN-TODO"),replacement:(r,t)=>{var i,a;let e=Oe(t);return`${((a=(i=t.parentElement)==null?void 0:i.nodeName)==null?void 0:a.toUpperCase())==="LI"?"":"- "}${e.checked&&e.checked.value==="true"?"[x]":"[ ]"} ${r}`}};var am={filter:Tt("BR"),replacement:(r,t)=>"<YARLE_NEWLINE_PLACEHOLDER>"};var Qx=r=>{let t=Oe(r);return t.style&&t.style.value.indexOf("--en-task-group:true")>=0},ew=r=>Oe(r).style.value.split("--en-id:")[1].split(";")[0],om={filter:Tt("DIV"),replacement:(r,t)=>Qx(t)?`<YARLE-EN-V10-TASK>${ew(t)}</YARLE-EN-V10-TASK>`:Q.monospaceIsCodeBlock?zf(r,t):Wf(r,t)};var sm={filter:["i"],replacement:r=>r.trim()!==""?`${ze.italic}${r}${ze.italic}`:r};var Qa="- [ ]",eo="- [x]";var lm=" ",cm={filter:"li",replacement:(r,t,e)=>{let n=p=>{let f=Oe(p);return f.style&&f.style.value.indexOf("--en-checked:true;")>=0},i=p=>{let f=Oe(p);return f.style&&f.style.value.indexOf("--en-checked:false;")>=0},a=r.match(/^\n*/)[0].length||0,o=lm.repeat(a),l=r.replace(/^\n+/,"").replace(/\n+$/,`
`).replace(/\n/gm,`
${lm}`),s=a>0?o:n(t)?`${eo} `:i(t)?`${Qa} `:"* ",c=t.parentNode;if(c.nodeName==="OL"){let p=c.getAttribute("start"),f=Array.prototype.indexOf.call(c.children,t);s=`${p?Number(p)+f:f+1}. `}let u;return u=s+l+(t.nextSibling&&!/\n$/.test(l)?`
`:""),u}};var Ja=r=>{let t=new window.TurndownService({br:"",...r.turndownOptions,blankReplacement:(e,n)=>n.isBlock?`
`:"",keepReplacement:(e,n)=>n.isBlock?`
${n.outerHTML}
`:n.outerHTML,defaultReplacement:(e,n)=>n.isBlock?`
${e}
`:e});return t.use(um.gfm),t.addRule("span",rm),t.addRule("strikethrough",nm),t.addRule("evernote task items",im),t.addRule("wikistyle links",em),t.addRule("images",Gf),t.addRule("list",cm),t.addRule("italic",sm),r.keepMDCharactersOfENNotes&&(t.escape=e=>e),t.addRule("divBlock",om),r.keepOriginalAmountOfNewlines&&t.addRule("newline",am),t};var pm=r=>{r.replaceWith(...Array.from(r.children))},dm=r=>{let t=r.parentElement;t.replaceWith(...Array.from(t.childNodes)),t.append(...Array.from(r.childNodes)),r.appendChild(t)},tw=r=>(Array.from(r.querySelectorAll("span>en-todo")).forEach(dm),Array.from(r.querySelectorAll("a>en-todo")).forEach(dm),r),rw=r=>{let t=r.replace(/<li>/g,"<li><div>");return t=t.replace(/<\/li>/g,"</div></li>"),t=t.replace(/<li><div>(\s)*<div>/g,"<li><div>"),t=t.replace(/<\/div>(\s)*<\/div><\/li>/g,"</div></li>"),t},nw=r=>{var a;let t=Array.from(r.getElementsByTagName("ul")),e=Array.from(r.getElementsByTagName("ol")),n=t.concat(e);n.forEach(o=>{o.parentElement.tagName==="LI"&&o.parentElement.replaceWith(o),o.previousElementSibling&&o.previousElementSibling.tagName==="LI"&&o.previousElementSibling.appendChild(o)});for(let o of n){let l=o.parentElement;(l==null?void 0:l.tagName)==="DIV"&&((a=l==null?void 0:l.parentElement)==null?void 0:a.tagName)==="UL"&&pm(l),((l==null?void 0:l.tagName)==="UL"||(l==null?void 0:l.tagName)==="OL")&&(l==null?void 0:l.childNodes.length)===1&&pm(l)}let i=Array.from(r.getElementsByTagName("li"));for(let o of i){let l=o.firstElementChild;if(l&&l.tagName==="DIV"){let s=Array.from(l.childNodes);l.replaceWith(...s)}}return r},fm=(r,{htmlContent:t})=>{let e=t.replace(/<!DOCTYPE en-note [^>]*>/,"<!DOCTYPE html>").replace(/(<a [^>]*)\/>/,"$1></a>").replace(/<div[^\/\<]*\/>/g,""),n=new DOMParser().parseFromString(rw(e),"text/html").getElementsByTagName("en-note").item(0),i=Ja(r).turndown(tw(nw(n))),a=new RegExp("<YARLE_NEWLINE_PLACEHOLDER>","g");return i=i.replace(a,""),i&&i!=="undefined"?{content:i}:{content:""}};var ah=Yn(require("crypto"));var rr=require("obsidian");var mm=(r,t)=>({createdAt:iw(r),updatedAt:aw(r),sourceUrl:ow(r),location:sw(r),reminderTime:lw(r),reminderOrder:cw(r),reminderDoneTime:uw(r),notebookName:t});var iw=r=>!Q.skipCreationTime&&r.created?(0,rr.moment)(r.created).format(Q.dateFormat):"",aw=r=>!Q.skipUpdateTime&&r.updated?(0,rr.moment)(r.updated).format(Q.dateFormat):"",ow=r=>!Q.skipSourceUrl&&r["note-attributes"]?r["note-attributes"]["source-url"]:"",sw=r=>!Q.skipLocation&&r["note-attributes"]&&r["note-attributes"].longitude?`${r["note-attributes"].latitude},${r["note-attributes"].longitude}`:"",lw=r=>!Q.skipReminderTime&&r["note-attributes"]&&r["note-attributes"]["reminder-time"]?(0,rr.moment)(r["note-attributes"]["reminder-time"]).format(Q.dateFormat):"",cw=r=>!Q.skipReminderOrder&&r["note-attributes"]&&r["note-attributes"]["reminder-order"]?r["note-attributes"]["reminder-order"]:"",uw=r=>!Q.skipReminderDoneTime&&r["note-attributes"]&&r["note-attributes"]["reminder-done-time"]?(0,rr.moment)(r["note-attributes"]["reminder-done-time"]).format(Q.dateFormat):"",hm=r=>({tags:pw(r)}),pw=r=>{if(!Q.skipTags&&r.tag){let t=Array.isArray(r.tag)?r.tag:[r.tag],e=Q.nestedTags;return t.map(i=>{let a=i.toString().replace(/^#/,"");e&&(a=a.replace(new RegExp(Rn(e.separatorInEN),"g"),e.replaceSeparatorWith));let o=e&&e.replaceSpaceWith||"-";return a=a.replace(/ /g,o),`${Q.useHashTags?"#":""}${a}`}).join(" ")}return""},Wl;try{Wl=window.require("btime")}catch(r){}var to=(r,t)=>{let e=(0,rr.moment)(t.created).valueOf();e>0&&Wl&&Wl.btime(r,e);let i=(0,rr.moment)(t.updated).valueOf()/1e3;try{ue.utimesSync(r,i,i)}catch(a){}},gm=r=>r["resource-attributes"]&&r["resource-attributes"].timestamp?(0,rr.moment)(r["resource-attributes"].timestamp):(0,rr.moment)();var bm=(r,t,e)=>{let n=r.lastIndexOf(t);return n<0?r:r.substring(0,n)+e+r.substring(n+t.length)};var Ye={mdPath:"",resourcePath:""},no=249,Vl=100,ym=(r,t,e="")=>{let n=t,i=t,a=1,o=`${r}${K.sep}${i}${e}`;for(;ue.existsSync(o);)if(i=`${n} (${a})`,o=`${r}${K.sep}${i}${e}`,a++,a>9999)throw new Error(`Too many duplicate items with name: ${t}`);return i},xm=(r,t)=>{let e=Hl(r,t).replace(/\s/g,"_");return ym(Ye.resourcePath,e,".resources")},wm=(r,t)=>{if(r.length<=11)throw Error("FATAL: note folder directory path exceeds the OS limitation. Please pick a destination closer to the root folder.");return`${Gl()}${K.sep}${r}`.length<no?r:`${r.slice(0,no-11)}_${t}.md`},dw=(r,t,e)=>{let i=et.getInstance().getNoteIdNameMapByNoteTitle(In(r.title))[0]||{uniqueEnd:_n(6)};if(t.length<=11)throw Error("FATAL: note folder directory path exceeds the OS limitation. Please pick a destination closer to the root folder.");return`${e.slice(0,no-11)}_${i.uniqueEnd}.md`},fw=(r,t,e)=>{let n=Xf(r,t,e),i=`${r}${K.sep}${In(n)}`;return i.length<no?i:dw(t,n,i)},vm=r=>fw(Ye.mdPath,r,"md");var mw=r=>{ue.existsSync(r)&&(ue.rmSync?ue.rmSync(r,{recursive:!0,force:!0}):ue.rmdirSync(r,{recursive:!0})),ue.mkdirSync(r)},Em=r=>{let t=`${K.sep}${Q.resourcesDir}`;return Q.haveGlobalResources?`..${t}`:Q.haveEnexLevelResources?`.${t}`:`.${t}${K.sep}${xm(Ye.mdPath,r)}.resources`},zl=r=>Q.haveGlobalResources?K.resolve(Ye.resourcePath,"..","..",Q.resourcesDir):Q.haveEnexLevelResources?Ye.resourcePath:`${Ye.resourcePath}${K.sep}${xm(Ye.mdPath,r)}.resources`,ro=new Map,Tm=r=>{let t=zl(r);ro.has(t)||ro.set(t,0);let e=ro.get(t)||0;(Q.haveEnexLevelResources||Q.haveGlobalResources)&&e>=1||(mw(t),ro.set(t,e+1))},_m=r=>{let t=r.split("@@@"),e=t.pop();return e||(e=r),{notebookName:e,notebookFolderNames:t}},Am=r=>{if(!(r instanceof bt))throw new Error("Evernote import currently only works on desktop");let{notebookName:t}=_m(r.basename);return{fullpath:bm(r.fullpath,r.basename,t||r.basename),basename:t}},Cm=(r,t)=>{let{notebookFolderNames:e}=_m(r.basename);return ue.mkdirSync(K.join(t.outputDir,...e),{recursive:!0}),[t.outputDir,...e].join(t.pathSeparator)},km=(r,t)=>{let e=r.basename;Nm(e,t)},Pm=(r,t)=>{let e=r.basename;Nm(e,t)},Nm=(r,t)=>{let e=K.isAbsolute(t.outputDir)?t.outputDir:`${process.cwd()}${K.sep}${t.outputDir}`;if(Ye.mdPath=`${e}${K.sep}`,Ye.resourcePath=`${e}${K.sep}${t.resourcesDir}`,!t.skipEnexFileNameFromOutputPath){let n=r;r.length>Vl&&(n=r.substring(0,Vl),console.warn(`ENEX filename too long (${r.length} chars), truncated to ${Vl} chars: ${n}`)),n=ym(e,n),Ye.mdPath=`${Ye.mdPath}${n}`,Ye.resourcePath=`${e}${K.sep}${n}${K.sep}${t.resourcesDir}`}ue.mkdirSync(Ye.mdPath,{recursive:!0}),!t.haveEnexLevelResources&&!t.haveGlobalResources&&ue.mkdirSync(Ye.resourcePath,{recursive:!0}),console.log(`path ${Ye.mdPath} created`)},Gl=()=>Ye.mdPath;var Sm=r=>!!r.resource,Dm=r=>r["note-attributes"]&&(r["note-attributes"]["source-application"]==="webclipper.evernote"||r["note-attributes"].source==="web.clip7");var Yl={};ot(Yl,{CONTENT_PLACEHOLDER:()=>hw,END_BLOCK:()=>bw,START_BLOCK:()=>gw});var hw="{content}",gw="{content-block}",bw="{end-content-block}";var Pr=({template:r,check:t,startBlockPlaceholder:e,endBlockPlaceholder:n,valuePlaceholder:i,value:a})=>{if(a&&t())return r.replace(new RegExp(`${e}`,"g"),"").replace(new RegExp(`${n}`,"g"),"").replace(new RegExp(`${i}`,"g"),a);let o=`${e}([\\d\\D])(?:.|(\r
|\r|
))*?(?=${n})${n}`;return r.replace(new RegExp(o,"g"),"")};var Nr=(r,t,e,n)=>({template:r,check:t,startBlockPlaceholder:e.START_BLOCK,endBlockPlaceholder:e.END_BLOCK,valuePlaceholder:e.CONTENT_PLACEHOLDER,value:n});var Rm=(r,t,e)=>{let n=Nr(t,e,Yl,r.content);return Pr(n)};var Si={};ot(Si,{CONTENT_PLACEHOLDER:()=>yw,END_BLOCK:()=>ww,START_BLOCK:()=>xw});var yw="{tags}",xw="{tags-block}",ww="{end-tags-block}";var Om=(r,t,e)=>{let n=Nr(t,e,Si,r.tags);return Pr(n)};var Zl={};ot(Zl,{CONTENT_PLACEHOLDER:()=>vw,END_BLOCK:()=>Tw,START_BLOCK:()=>Ew});var vw="{title}",Ew="{title-block}",Tw="{end-title-block}";var Im=(r,t,e)=>{let n=Nr(t,e,Zl,r.title);return Pr(n)};var tn={};ot(tn,{CONTENT_PLACEHOLDER:()=>_w,END_BLOCK:()=>Cw,START_BLOCK:()=>Aw});var _w="{created-at}",Aw="{created-at-block}",Cw="{end-created-at-block}";var Ze=(r,t,e)=>r.replace(new RegExp(`${t.CONTENT_PLACEHOLDER}`,"g"),e||"").replace(new RegExp(`${t.START_BLOCK}`,"g"),"").replace(new RegExp(`${t.END_BLOCK}`,"g"),"");var Fm=(r,t)=>Ze(t,tn,r.createdAt);var rn={};ot(rn,{CONTENT_PLACEHOLDER:()=>kw,END_BLOCK:()=>Nw,START_BLOCK:()=>Pw});var kw="{updated-at}",Pw="{updated-at-block}",Nw="{end-updated-at-block}";var Lm=(r,t)=>Ze(t,rn,r.updatedAt);var nn={};ot(nn,{CONTENT_PLACEHOLDER:()=>Sw,END_BLOCK:()=>Rw,START_BLOCK:()=>Dw});var Sw="{source-url}",Dw="{source-url-block}",Rw="{end-source-url-block}";var Mm=(r,t)=>Ze(t,nn,r.sourceUrl);var an={};ot(an,{CONTENT_PLACEHOLDER:()=>Ow,END_BLOCK:()=>Fw,START_BLOCK:()=>Iw});var Ow="{location}",Iw="{location-block}",Fw="{end-location-block}";var $m=(r,t)=>Ze(t,an,r.location);var on={};ot(on,{CONTENT_PLACEHOLDER:()=>Lw,END_BLOCK:()=>$w,START_BLOCK:()=>Mw});var Lw="{notebook}",Mw="{notebook-block}",$w="{end-notebook-block}";var Bm=(r,t)=>Ze(t,on,r.notebookName);var Fn={};ot(Fn,{CONTENT_PLACEHOLDER:()=>Bw,END_BLOCK:()=>jw,START_BLOCK:()=>qw});var Bw="{reminder-time}",qw="{reminder-time-block}",jw="{end-reminder-time-block}";var qm=(r,t)=>Ze(t,Fn,r.reminderTime);var Ln={};ot(Ln,{CONTENT_PLACEHOLDER:()=>Uw,END_BLOCK:()=>Ww,START_BLOCK:()=>Hw});var Uw="{reminder-order}",Hw="{reminder-order-block}",Ww="{end-reminder-order-block}";var jm=(r,t)=>Ze(t,Ln,r.reminderOrder);var Mn={};ot(Mn,{CONTENT_PLACEHOLDER:()=>Vw,END_BLOCK:()=>Gw,START_BLOCK:()=>zw});var Vw="{reminder-done-time}",zw="{reminder-done-time-block}",Gw="{end-reminder-done-time-block}";var Um=(r,t)=>Ze(t,Mn,r.reminderDoneTime);var Di={};ot(Di,{CONTENT_PLACEHOLDER:()=>Yw,END_BLOCK:()=>Kw,START_BLOCK:()=>Zw});var Yw="{tags-yaml-list}",Zw="{tags-yaml-list-block}",Kw="{end-tags-yaml-list-block}";var Hm=(r,t,e)=>{let n;r.tags&&(n=`
`+r.tags.split(" ").map(a=>` - ${a.replace(/^#/,"")}`).join(`
`));let i=Nr(t,e,Di,n);return Pr(i)};var Kl="{metadata-block}",Xl="{end-metadata-block}";var Wm=`\r?
?`;var Le=(r,t)=>r.replace(new RegExp(`${t.START_BLOCK}(?<=${t.START_BLOCK})(.*)(?=${t.END_BLOCK})${t.END_BLOCK}${Wm}`,"g"),"");var Vm=r=>Le(r,tn);var zm=r=>Le(r,rn);var Gm=r=>Le(r,nn);var Ym=r=>Le(r,on);var Zm=r=>Le(r,an);var io={};ot(io,{CONTENT_PLACEHOLDER:()=>Jw,END_BLOCK:()=>ev,START_BLOCK:()=>Qw});var Jw="{link-to-original}",Qw="{link-to-original-block}",ev="{end-link-to-original-block}";var Km=r=>Le(r,io);var Xm=r=>Le(r,Fn);var Jm=r=>Le(r,Mn);var Qm=r=>Le(r,Ln);var eh=(r,t)=>{let e=t.currentTemplate;return e=Im(r,e,()=>r.title),e=Om(r,e,()=>!t.skipTags),e=Hm(r,e,()=>!t.skipTags),e=Rm(r,e,()=>r.content),e=Km(e),e=!t.skipCreationTime&&r.createdAt?Fm(r,e):Vm(e),e=!t.skipUpdateTime&&r.updatedAt?Lm(r,e):zm(e),e=!t.skipSourceUrl&&r.sourceUrl?Mm(r,e):Gm(e),e=!t.skipLocation&&r.location?$m(r,e):Zm(e),e=t.isNotebookNameNeeded&&r.notebookName?Bm(r,e):Ym(e),e=!t.skipReminderTime&&r.reminderTime?qm(r,e):Xm(e),e=!t.skipReminderOrder&&r.reminderOrder?jm(r,e):Qm(e),e=!t.skipReminderDoneTime&&r.reminderDoneTime?Um(r,e):Jm(e),e=e.replace(Kl,"").replace(Xl,""),e};var th=(r,t,e)=>{try{ue.writeFileSync(r,t),to(r,e)}catch(n){throw console.error("Cannot write file ",n),n}};var rh=(r,t)=>{let e=vm(t);et.getInstance().setCurrentNotePath(e),th(e,r,t),console.log(`Note saved to ${e}`)};var oh=r=>{let t=new RegExp(`\\${K.sep}`,"g"),e=Em(r).replace(t,Q.pathSeparator||"/");return{absoluteResourceWorkDir:zl(r),relativeResourceWorkDir:e}},sh=r=>{let t={},e=r.content,{absoluteResourceWorkDir:n,relativeResourceWorkDir:i}=oh(r);if(console.log(`relative resource work dir: ${i}`),console.log(`absolute resource work dir: ${n}`),Tm(r),Array.isArray(r.resource))for(let a of r.resource)t={...t,...ih(n,a)};else t={...t,...ih(n,r.resource)};for(let a of Object.keys(t))e=tv(e,t,a,i);return e},tv=(r,t,e,n)=>{let i=`${n}${Q.pathSeparator}${t[e].fileName.replace(/ /g," ")}`;console.log(`mediaReference src ${i} added`);let a,o=`<en-media ([^>]*)hash="${e}".([^>]*)>`,l=new RegExp(o,"g"),s=r.match(l),c=s&&s.length>0&&s[0].split("type=");if(c&&c.length>1&&c[1].startsWith('"image')){let u=s[0].match(/width="(\w+)"/),p=u?` width="${u[1]}"`:"",f=s[0].match(/height="(\w+)"/),d=f?` height="${f[1]}"`:"";a=r.replace(l,`<img src="${i}"${p}${d} alt="${t[e].fileName}">`)}else a=r.replace(l,`<a href="${i}" type="file">${t[e].fileName}</a>`);return a},ih=(r,t)=>{let e={};if(!t.data||!t.data.$text)return console.warn("Resource data is missing or empty, skipping resource:",t),e;let n=t.data.$text,i=gm(t),o=Kf(r,t).fileName,l=`${r}${K.sep}${o}`;console.log(t),console.log(n);let s=Buffer.from(n,"base64");ue.writeFileSync(l,s);let c=i.valueOf()/1e3;try{ue.utimesSync(l,c,c)}catch(u){}if(t.recognition&&o){let u=t.recognition.match(/[a-f0-9]{32}/);console.log(`resource ${o} added with hash ${u}`),e[u]={fileName:o,alreadyUsed:!1}}else{let u=ah.default.createHash("md5");u.update(s);let p=u.digest("hex");e[p]={fileName:o,alreadyUsed:!1}}return e},lh=(r,t)=>{if(t.indexOf('src="data:')<0)return t;let{absoluteResourceWorkDir:e,relativeResourceWorkDir:n}=oh(r);return ue.mkdirSync(e,{recursive:!0}),t.replace(/src="data:([^;,]*)(;base64)?,([^"]*)"/g,(i,a,o,l)=>{let s=rv(a,o===";base64",l,e,r);return`src="${`${n}${Q.pathSeparator}${s}`}"`})},rv=(r,t,e,n,i)=>{let a="embedded",o=nv(r)||".dat",l=Ni(n,a),s=l<1?`${a}.${o}`:`${a}.${l}.${o}`,c=`${n}${K.sep}${s}`;return t||(e=decodeURIComponent(e)),ue.writeFileSync(c,e,t?"base64":void 0),to(c,i),console.log(`data url resource ${s} added`),s},nv=r=>r.split("/").pop().split("+")[0];var ch=(r,t)=>{let e=new Date;et.getInstance().setCurrentNoteName(r.title),Array.isArray(r.content)&&(r.content=r.content.join(""));let i={title:r.title,content:r.content,htmlContent:r.content,originalContent:r.content};console.log(`Converting for note "${i.title}" started at ${e}...`);try{Sm(r)&&(i.htmlContent=sh(r)),i.htmlContent=lh(r,i.htmlContent),i={...i,...fm(Q,i)},i={...i,...mm(r,t)},i={...i,...hm(r)};let a=eh(i,Q);rh(a,r)}catch(a){throw console.error(`Failed to convert note: ${i.title}`,a),a}finally{let a=new Date,o=(a.getTime()-e.getTime())/1e3;console.log(`Conversion for note "${i.title}" finished at ${a}. Took ${o} seconds`)}};var dh=require("obsidian");var uh=r=>r.taskstatus==="open"?Qa:eo;var iv="\u{1F53C}",av="\u{1F53D}",ov="\u{1F4C5}",sv="\u23F3",fh=(r,t)=>{let e=uh(r),n=r.title?` ${r.title}`:"",i=Q.obsidianTaskTag!==""?` ${Q.obsidianTaskTag}`:"",a=r.duedate&&!isNaN(r.duedate.getTime())?` ${ov} ${ph(r.duedate)}`:"",o=r.reminderdate?` ${sv} ${ph(r.reminderdate)}`:"",l=r.taskflag?` ${iv}`:` ${av}`;return`${e}${i}${n}${a}${o}${l}`},ph=r=>(0,dh.moment)(r).format("YYYY-MM-DD").toString();var Ql=(r,t,e)=>{let n=ue.readdirSync(r);return t=t||[],n.forEach(i=>{ue.statSync(`${r}${K.sep}${i}`).isDirectory()?t=Ql(`${r}${K.sep}${i}`,t,e):(e&&K.extname(i)==`.${e}`||!e)&&t.push(K.join(r,"/",i))}),t};var mh=(r,t)=>{let n=et.getInstance().getAllNoteIdNameMap(),i=Object.entries(n);if(i.length===0)return;console.log("About to update links...");let a=[];for(let o of t)Ql(o,a,"");for(let o of t){console.log(`Notebook: ${o}`);let s=ue.readdirSync(o).filter(c=>K.extname(c).toLowerCase()===".md");console.log(`${s.length} files to check for links`);for(let c of s){let u=K.join(o,c),p=ue.readFileSync(u,"utf8"),f=p;for(let[d,g]of i){let m=g.uniqueEnd,h=g.title;a.find(O=>O.includes(m))&&(h=wm(h,m));let b=g.notebookName,_=r.urlEncodeFileNamesAndLinks?encodeURI(h):h,N=_;b&&!o.endsWith(b)&&(N=`${b}/${_}`);let k=new RegExp(Rn(d),"g");f=f.replace(k,N)}p!==f&&(console.log(`File written: ${u}`),ue.writeFileSync(u,f))}}console.log("Link update complete.")};var hh=r=>sn(tn,r);var gh=r=>sn(an,r),bh=r=>sn(on,r);var yh=r=>sn(nn,r),xh=r=>sn(Si,r)||sn(Di,r);var wh=r=>sn(rn,r),sn=(r,t)=>t.includes(r.START_BLOCK)&&t.includes(r.CONTENT_PLACEHOLDER)&&t.includes(r.END_BLOCK);var vh=`---
`,lv=`{source-url-block}source: {source-url}{end-source-url-block}
`,cv=`{tags-yaml-list-block}
tags: {tags-yaml-list}
{end-tags-yaml-list-block}`,uv=`{content-block}{content}{end-content-block}
`,Eh=vh+cv+lv+vh+uv;var Cv=Dh.Platform.isDesktopApp?Sh():null,so={enexSources:[],currentTemplate:"",outputDir:"./mdNotes",isMetadataNeeded:!1,isNotebookNameNeeded:!1,isZettelkastenNeeded:!1,useZettelIdAsFilename:!1,plainTextNotesOnly:!1,skipWebClips:!1,useHashTags:!0,nestedTags:{separatorInEN:"_",replaceSeparatorWith:"/",replaceSpaceWith:"-"},obsidianTaskTag:"",urlEncodeFileNamesAndLinks:!1,sanitizeResourceNameSpaces:!1,replacementChar:"_",pathSeparator:"/",resourcesDir:"_resources",turndownOptions:{headingStyle:"atx"}},kv="@@@",Q={...so};function Pv(r){return r==null?r:JSON.parse(JSON.stringify(r))}function Rh(r,...t){for(let e of t)for(let n of Object.keys(e)){let i=e[n],a=r[n];!Array.isArray(i)&&typeof i=="object"&&!Array.isArray(a)&&typeof a=="object"?r[n]=Rh({},a,i):r[n]=Pv(i)}return r}var Nv=r=>{Q=Rh({},so,r);let t=Q.templateFile?ue.readFileSync(Q.templateFile,"utf-8"):Eh;t=Q.currentTemplate?Q.currentTemplate:t,Q.skipCreationTime=!hh(t),Q.skipLocation=!gh(t),Q.skipSourceUrl=!yh(t),Q.skipTags=!xh(t),Q.skipUpdateTime=!wh(t),Q.isNotebookNameNeeded=bh(t),Q.currentTemplate=t,console.log(`Current config is: ${JSON.stringify(Q,null,4)}`),console.log(`Path separator:${K.sep}`)},Sv=async(r,t,e)=>{if(!(t instanceof bt))throw new Error("Evernote import currently only works on desktop");let n=et.getInstance();e.status("Processing "+t.name),console.log(`Getting stream from ${t}`);let i=t.createReadStream(),a={},o=n.getCurrentNotebookName();return new Promise((l,s)=>{let c=f=>(e.reportFailed(n.getCurrentNotebookFullpath(),f),s(f)),u=Cv(i),p=null;u.on("tag:note-attributes",f=>{p=f}),u.on("tag:note",f=>{if(e.isCancelled()){i.close();return}if(r.skipWebClips&&Dm(f))e.reportSkipped(f.title);else{e.status("Importing note "+f.title),p&&(f["note-attributes"]=p);try{ch(f,o),e.reportNoteSuccess(o+"/"+f.title)}catch(g){return e.reportFailed(f.title||t,g),l()}}p=null;let d=n.getCurrentNotePath();if(d)for(let g of Object.keys(a)){let m=`<YARLE-EN-V10-TASK>${g}</YARLE-EN-V10-TASK>`,h=ue.readFileSync(d,"utf8"),b=new Map([...a[g]].sort()),_=h.replace(m,[...b.values()].join(`
`));ue.writeFileSync(d,_)}}),u.on("tag:task",f=>{let d=kf(f);a[d.taskgroupnotelevelid]||(a[d.taskgroupnotelevelid]=new Map),a[d.taskgroupnotelevelid].set(d.sortweight,fh(d,o))}),u.on("end",l),u.on("error",c),i.on("error",c)})};async function Oh(r,t){Nv(r);let e=[],n=r.outputDir;for(let i of r.enexSources){if(t.isCancelled())return;let a,o=et.getInstance();i.basename.includes(kv)?(r.outputDir=Cm(i,r),a=Am(i),Pm(a,r),o.setCurrentNotebookName(a.basename),o.setCurrentNotebookFullpath(a.fullpath)):(km(i,r),o.setCurrentNotebookName(i.basename),o.setCurrentNotebookFullpath(i.fullpath)),await Sv(r,i,t),e.push(Gl()),r.outputDir=n}t.isCancelled()||await mh(r,e)}var lo=class extends Ee{init(){this.addFileChooserSetting("Evernote",["enex"],!0),this.addOutputLocationSetting("Evernote")}async import(t){let{files:e}=this;if(e.length===0){new Oi.Notice("Please pick at least one file to import.");return}let n=await this.getOutputFolder();if(!n){new Oi.Notice("Please select a location to export to.");return}let{app:i}=this,a=i.vault.adapter;if(!(a instanceof Oi.FileSystemAdapter))return;let o={...so,enexSources:e,outputDir:K.join(a.getBasePath(),n.path)};await Oh(o,t)}};var tt=require("obsidian");var co=class extends Ee{init(){this.addFileChooserSetting("HTML",["htm","html"],!0),this.addAttachmentSizeLimit(0),this.addMinimumImageSize(65),this.addOutputLocationSetting("HTML import")}addAttachmentSizeLimit(t){this.attachmentSizeLimit=t*10**6,new tt.Setting(this.modal.contentEl).setName("Attachment size limit (MB)").setDesc("Set 0 to disable.").addText(e=>e.then(({inputEl:n})=>{n.type="number",n.step="0.1"}).setValue(t.toString()).onChange(n=>{let i=["+","-"].includes(n)?0:Number(n);if(Number.isNaN(i)||i<0){e.setValue((this.attachmentSizeLimit/10**6).toString());return}this.attachmentSizeLimit=i*10**6}))}addMinimumImageSize(t){this.minimumImageSize=t,new tt.Setting(this.modal.contentEl).setName("Minimum image size (px)").setDesc("Set 0 to disable.").addText(e=>e.then(({inputEl:n})=>n.type="number").setValue(t.toString()).onChange(n=>{let i=["+","-"].includes(n)?0:Number(n);if(!Number.isInteger(i)||i<0){e.setValue(this.minimumImageSize.toString());return}this.minimumImageSize=i}))}async import(t){let{files:e}=this;if(e.length===0){new tt.Notice("Please pick at least one file to import.");return}let n=await this.getOutputFolder();if(!n){new tt.Notice("Please select a location to export to.");return}let i=new Map;t.reportProgress(0,e.length);for(let s=0;s<e.length;s++){if(t.isCancelled())return;let c=e[s],u=await this.processFile(t,n,c);u&&i.set(c instanceof bt?pi.pathToFileURL(c.filepath).href:c.name,{file:c,tFile:u}),t.reportProgress(s+1,e.length)}let{metadataCache:a}=this.app,o,l=new Promise(s=>{o=s});a.onCleanCache(async()=>{for(let[s,{file:c,tFile:u}]of i){if(t.isCancelled())break;try{let p=await this.app.vault.cachedRead(u),f=a.computeMetadataAsync?await a.computeMetadataAsync($s(p)):a.getFileCache(u);if(!f)continue;let d=[];if(f.links)for(let{link:g,position:m,displayText:h}of f.links){let{path:b,subpath:_}=(0,tt.parseLinktext)(g),N;if(pi){let O=new URL(encodeURI(b),s);O.hash="",O.search="",N=decodeURIComponent(O.href)}else N=le(b.replace(/#/gu,"%23")).name;let k=i.get(N);if(k){let O=this.app.fileManager.generateMarkdownLink(k.tFile,u.path,_,h);d.push({from:m.start.offset,to:m.end.offset,text:O})}}d.sort((g,m)=>m.from-g.from);for(let g of d)p=p.substring(0,g.from)+g.text+p.substring(g.to);await this.vault.modify(u,p)}catch(p){t.reportFailed(c.fullpath,p)}}o()}),await l}async processFile(t,e,n){t.status("Processing "+n.name);try{let i=await n.readText(),a=At(i);Dv(a);let o=n instanceof bt?pi.pathToFileURL(n.filepath):void 0,l=o?new URL("./",o.href).href:void 0,s=new Map,c=new Map;for(let f of a.findAll("img, audio, video")){if(t.isCancelled())return;let d=f.getAttribute("src");if(d)try{let g=new URL(d.startsWith("//")?`https:${d}`:d,o);if(g.protocol==="data:")continue;let m=g.href,h=s.get(m);s.has(m)||(t.status("Downloading attachment for "+n.name),h=await this.downloadAttachment(e,f,g,l),s.set(m,h),h?(c.set(h.path,h),t.reportAttachmentSuccess(h.name)):t.reportSkipped(d)),h&&(f.setAttribute("src",h.path.replace(/ /g,"%20")),f instanceof HTMLImageElement||f.replaceWith(createEl("img",{attr:{src:h.path.replace(/ /g,"%20"),alt:f.getAttr("alt")}})))}catch(g){t.reportFailed(d,g)}}let u=(0,tt.htmlToMarkdown)(a),p=await this.saveAsMarkdownFile(e,n.basename,u);if(!Object.isEmpty(s)){let{metadataCache:f}=this.app,d;f.computeMetadataAsync?d=await f.computeMetadataAsync($s(u)):d=await new Promise(m=>{let h=f.getFileCache(p);if(h)return m(h);let b=f.on("changed",(_,N,k)=>{_===p&&(f.offref(b),m(k))})});let g=[];if(d.embeds){for(let{link:m,position:h}of d.embeds)if(c.has(m)){let b=this.app.fileManager.generateMarkdownLink(c.get(m),p.path);g.push({from:h.start.offset,to:h.end.offset,text:b})}}g.sort((m,h)=>h.from-m.from);for(let m of g)u=u.substring(0,m.from)+m.text+u.substring(m.to);await this.vault.modify(p,u)}return t.reportNoteSuccess(n.fullpath),p}catch(i){t.reportFailed(n.fullpath,i)}return null}async downloadAttachment(t,e,n,i){let a="",o="",l;switch(n.protocol){case"file:":if(i&&!n.href.startsWith(i))throw new Error("File path is outside the allowed directory");let u=pi.fileURLToPath(n.href);({basename:a,extension:o}=le(u)),l=En(await gt.readFile(u));break;case"https:":case"http:":let p=await Ov(n),f=Rv(n);a=f.basename,l=p.data,o=On(p.mime)||f.extension;break;default:throw new Error(n.href)}if(!this.filterAttachmentSize(l)||e instanceof HTMLImageElement&&!await this.filterImageSize(l))return null;if(!o)if(e instanceof HTMLImageElement)o="png";else if(e instanceof HTMLAudioElement)o="mp3";else if(e instanceof HTMLVideoElement)o="mp4";else return null;let s=await this.createFolders((0,tt.normalizePath)(t.path+"/Attachments")),c=await this.vault.getAvailablePath(s.getParentPrefix()+a,o);return await this.vault.createBinary(c,l)}filterAttachmentSize(t){let{byteLength:e}=t;return!this.attachmentSizeLimit||e<=this.attachmentSizeLimit}async filterImageSize(t){if(!this.minimumImageSize)return!0;let e;try{e=await Iv(t)}catch(a){return!0}let{height:n,width:i}=e;return i>=this.minimumImageSize&&n>=this.minimumImageSize}};function Ih(r,t){let e=r.getAttribute(t);e!==null&&r.setAttribute(t,e.replace(/ /gu,"%20"))}function Dv(r){r.findAll("a").forEach(t=>Ih(t,"href")),r.findAll("audio, img, video").forEach(t=>Ih(t,"src"))}function Rv(r){return le((0,tt.normalizePath)(decodeURIComponent(r.pathname)))}async function Ov(r){var e,n;try{let i=await fetch(r,{mode:"cors",referrerPolicy:"no-referrer"});if(i.ok)return{data:await i.arrayBuffer(),mime:(e=i.headers.get("Content-Type"))!=null?e:""}}catch(i){}let t=await(0,tt.requestUrl)(r.href);return{data:t.arrayBuffer,mime:(n=t.headers["Content-Type"])!=null?n:""}}async function Iv(r){let t=new Image,e=URL.createObjectURL(new Blob([r]));try{return await new Promise((n,i)=>{t.addEventListener("error",({error:a})=>i(a),{once:!0,passive:!0}),t.addEventListener("load",()=>n({height:t.naturalHeight,width:t.naturalWidth}),{once:!0,passive:!0}),t.src=e})}finally{URL.revokeObjectURL(e)}}var Bn=require("obsidian");var Fv=/(#[^ ^#]*)/g,Lv=/[\\:*?<>\"|!@#$%^&()+=\`\'~;,.]/g;function rc(r){let t=r.replace(Lv,"");return t=t.split(" ").join("-"),isNaN(t[0])||(t="_"+t),t}function nc(r){return r.replace(Fv,t=>"#"+rc(t))}function Fh(r){return r.charAt(0).toUpperCase()+r.slice(1).toLowerCase()}var Mv=["zip"],$v=["json"],Bv=["html","txt"],uo=class extends Ee{constructor(){super(...arguments);this.importArchived=!1;this.importTrashed=!1}init(){this.addFileChooserSetting("Notes & attachments",[...Mv,...$v,...qn],!0),this.importArchivedSetting=new Bn.Setting(this.modal.contentEl).setName("Import archived notes").setDesc("If imported, files archived in Google Keep will be tagged as archived.").addToggle(e=>{e.setValue(this.importArchived),e.onChange(async n=>{this.importArchived=n})}),this.importTrashedSetting=new Bn.Setting(this.modal.contentEl).setName("Import deleted notes").setDesc("If imported, files deleted in Google Keep will be tagged as deleted. Deleted notes will only exist in your Google export if deleted recently.").addToggle(e=>{e.setValue(this.importTrashed),e.onChange(async n=>{this.importTrashed=n})}),this.addOutputLocationSetting("Google Keep")}async import(e){let{files:n}=this;if(n.length===0){new Bn.Notice("Please pick at least one file to import.");return}let i=await this.getOutputFolder();if(!i){new Bn.Notice("Please select a location to import your files to.");return}let a=`${i.path}/Assets`;for(let o of n){if(e.isCancelled())return;await this.handleFile(o,i,a,e)}}async handleFile(e,n,i,a){let{fullpath:o,name:l,extension:s}=e;a.status("Processing "+l);try{s==="zip"?await this.readZipEntries(e,n,i,a):s==="json"?await this.importKeepNote(e,n,a):qn.contains(s)?(a.status("Importing attachment "+l),await this.copyFile(e,i),a.reportAttachmentSuccess(o)):!(e instanceof Ai)&&!Bv.contains(s)&&a.reportSkipped(o)}catch(c){a.reportFailed(o,c)}}async readZipEntries(e,n,i,a){await er(e,async(o,l)=>{for(let s of l){if(a.isCancelled())return;await this.handleFile(s,n,i,a)}})}async importKeepNote(e,n,i){let{fullpath:a,basename:o}=e;i.status("Importing note "+o);let l=await e.readText(),s=JSON.parse(l);if(!s||!s.userEditedTimestampUsec||!s.createdTimestampUsec){i.reportFailed(a,"Invalid Google Keep JSON");return}if(s.isArchived&&!this.importArchived){i.reportSkipped(a,"Archived note");return}if(s.isTrashed&&!this.importTrashed){i.reportSkipped(a,"Deleted note");return}await this.convertKeepJson(s,n,o),i.reportNoteSuccess(a)}async copyFile(e,n){let i=await this.createFolders(n),a=await e.read();await this.vault.createBinary(`${i.path}/${e.name}`,a)}async convertKeepJson(e,n,i){let a=[],o={};if(e.title){let c=e.title.split(`
`).filter(u=>u!==i);c.length>0&&(o.aliases=c)}let l=[];if(e.color&&e.color!=="DEFAULT"){let c=e.color.toLowerCase();c=Fh(c),l.push(`Keep/Color/${c}`)}if(e.isPinned&&l.push("Keep/Pinned"),e.attachments&&l.push("Keep/Attachment"),e.isArchived&&l.push("Keep/Archived"),e.isTrashed&&l.push("Keep/Deleted"),e.labels)for(let c of e.labels)l.push(`Keep/Label/${c.name}`);if(l.length>0&&(o.tags=l.map(c=>rc(c))),a.push(yr(o)),e.textContent&&(a.push(`
`),a.push(nc(e.textContent))),e.listContent){let c=[];for(let u of e.listContent){if(!u.text)continue;let p=`- [${u.isChecked?"X":" "}] ${u.text}`;c.push(nc(p))}a.push(`
`),a.push(c.join(`
`))}if(e.attachments){a.push(`
`);for(let c of e.attachments)a.push(`![[${c.filePath}]]`)}let s=await this.saveAsMarkdownFile(n,i,a.join(""));await this.vault.append(s,"",{ctime:e.createdTimestampUsec/1e3,mtime:e.userEditedTimestampUsec/1e3})}};var ir=require("obsidian");var ic=require("obsidian");function Lh({info:r,vault:t,targetFolderPath:e,parentsInSubfolders:n}){let i=t.getAllLoadedFiles(),a=new Set,o=new Set(i.map(l=>l.name));n&&jv(r),qv({info:r,pathDuplicateChecks:a,titleDuplicateChecks:o}),Uv({info:r,loadedFiles:i,titleDuplicateChecks:o,targetFolderPath:e})}function qv({info:r,pathDuplicateChecks:t,titleDuplicateChecks:e}){for(let n of Object.values(r.idsToFileInfo)){let i=r.getPathForFile(n);if(t.has(`${i}${n.title}`)){let a=2;for(n.title=n.title+" "+a;t.has(`${i}${n.title}`);)a++,n.title=`${n.title.replace(/ \d+$/,"")} ${a}`}e.has(n.title+".md")&&(n.fullLinkPathNeeded=!0),t.add(`${i}${n.title}`),e.add(n.title+".md")}}function jv(r){let t=new Set(Object.values(r.idsToFileInfo).map(e=>e.parentIds).concat(Object.values(r.pathsToAttachmentInfo).map(e=>e.parentIds)).map(e=>e.length>0?e[e.length-1]:""));for(let e of Object.keys(r.idsToFileInfo))t.has(e)&&r.idsToFileInfo[e].parentIds.push(e)}function Uv({info:r,loadedFiles:t,titleDuplicateChecks:e,targetFolderPath:n}){var s;let i=new Set(t.filter(c=>!c.path.endsWith(".md")).map(c=>c.path)),a=r.attachmentPath,o=/^\.\//.test(a),l=(s=a.match(/\.\/(.*)/))==null?void 0:s[1];for(let c of Object.values(r.pathsToAttachmentInfo)){e.has(c.nameWithExtension)&&(c.fullLinkPathNeeded=!0);let u="";if(o?u=(0,ic.normalizePath)(`${n}${r.getPathForFile(c)}${l!=null?l:""}`):u=(0,ic.normalizePath)(a+"/"),u.endsWith("/")||(u+="/"),i.has(u+c.nameWithExtension)){let p=2,{basename:f,extension:d}=le(c.path);for(;i.has(`${u}${f} ${p}.${d}`);)p++;c.nameWithExtension=`${f} ${p}.${d}`}c.targetParentFolder=u,i.add(u+c.nameWithExtension),e.add(c.nameWithExtension)}}var jn=require("obsidian");var Mh=r=>r.replace(/-/g,"").replace(/[ -]?[a-z0-9]{32}(\.|$)/,"$1"),nr=r=>{var t;return(t=r.replace(/-/g,"").match(/([a-z0-9]{32})(\?|\.|$)/))==null?void 0:t[1]},ac=r=>{let{parent:t}=le(r);return t.split("/").map(e=>nr(e)).filter(e=>e)};function oc(r){return r.hour()===0&&r.minute()===0?r.format("YYYY-MM-DD"):r.format("YYYY-MM-DDTHH:mm")}function $h(r){return r.replace(/^(\.\.\/)+/,"")}function Bh(r){let t=/#\d*?(?:[-_/a-z]|[^\x00-\x7F])/gi;if(!t.test(r))return r;let e=r.split(`
`);for(let n=0;n<e.length;n++){let i=e[n].match(t);if(!i)continue;let a=e[n];for(let o of i)new RegExp(`\\[\\[[^\\]]*${o}(?:.*[^\\]])?\\]\\]|\\[[^\\]]*${o}[^\\]]*\\]\\([^\\)]*\\)|\\[[^\\]]*\\]\\([^\\)]*${o}[^\\)]*\\)|\\\\${o}|\`[^\`]*${o}[^\`]*\``).test(a)||(a=a.replace(o,"\\"+o));e[n]=a}return r=e.join(`
`),r}function sc(r){r.replaceWith(...Array.from(r.childNodes))}async function Yh(r,t){var u;let e=await t.readText(),n=At(e),i=n.find("div[class=page-body]");if(i===null)throw new Error("page body was not found");let a=qh(r,i);Gh(r,a,!0);let o={},l=n.find("table[class=properties] > tbody");if(l){let p=qh(r,l);Gh(r,p,!1),u2(l);for(let f of Array.from(l.rows)){let d=Wv(f);d&&(d.title=="Tags"&&(d.title="tags",typeof d.content=="string"?d.content=d.content.replace(/ /g,"-"):d.content instanceof Array&&(d.content=d.content.map(g=>g.replace(/ /g,"-")))),o[d.title]=d.content)}}e2(i,["strong","em","mark","del"]),Xv(i),zv(i),o2(i),Zv(i),a2(i),Xh(i),Vh(i,"div.indented"),Vh(i,"details"),s2(i),zh(i,"ul"),zh(i,"ol"),l2(i),c2(i),i2(i),Jv(i);let s=(0,jn.htmlToMarkdown)(i.innerHTML);r.singleLineBreaks&&(s=s.replace(/\n\n(?!>)/g,`
`)),s=Bh(s),s=Vv(s);let c=(u=n.find("p[class*=page-description]"))==null?void 0:u.textContent;return c&&(s=c+`
`+s),yr(o)+s}var Hv=new Map([["checkbox",["checkbox"]],["date",["created_time","last_edited_time","date"]],["list",["file","multi_select","relation"]],["number",["number","auto_increment_id"]],["text",["email","person","phone_number","text","url","status","select","formula","rollup","last_edited_by","created_by"]]]);function Wv(r){var o,l,s,c,u,p;let t=(o=r.className.match(/property-row-(.*)/))==null?void 0:o[1];if(!t)throw new Error("property type not found for: "+r);let e=(0,jn.htmlToMarkdown)((l=r.cells[0].textContent)!=null?l:""),n=r.cells[1],i;for(let[f,d]of Hv.entries())if(d.includes(t)){i=f;break}if(!i)throw new Error("type not found for: "+n);let a="";switch(i){case"checkbox":a=n.innerHTML.includes("checkbox-on");break;case"number":if(a=Number(n.textContent),isNaN(a))return;break;case"date":Xh(n);let f=n.getElementsByTagName("time");if(f.length===0)a="";else if(f.length===1)a=oc((0,jn.moment)((s=f.item(0))==null?void 0:s.textContent));else{let m=[];for(let h=0;h<f.length;h++)m.push(oc((0,jn.moment)((c=f.item(h))==null?void 0:c.textContent)));a=m.join(" - ")}if(a.length===0)return;break;case"list":let d=n.children,g=[];for(let m=0;m<d.length;m++){let h=(u=d.item(m))==null?void 0:u.textContent;h&&g.push(h)}if(a=g,a.length===0)return;break;case"text":if(a=(p=n.textContent)!=null?p:"",a.length===0)return;break}return{title:e,content:a}}function qh(r,t){var n,i;let e=[];for(let a of t.findAll("a")){let o=$h(decodeURI((n=a.getAttribute("href"))!=null?n:"")),l=nr(o),s=Object.keys(r.pathsToAttachmentInfo).find(c=>c.includes(o));l&&o.endsWith(".html")?e.push({type:"relation",a,id:l}):s?e.push({type:"attachment",a,path:s}):l&&o.startsWith("#")&&((i=a.parentElement)!=null&&i.classList.contains("table_of_contents-item"))&&e.push({type:"toc-item",a,id:l})}return e}function Vv(r){let t=/\[\[[^\]]*(\\\\)\|[^\]]*\]\]/,e=r.match(new RegExp(t,"g"));return e==null||e.forEach(n=>{r=r.replace(n,n.replace(/\\\\\|/g,"\\|"))}),r}function zv(r){Qv(r,"style"),Zh(r,"span.notion-text-equation-token");let t=r.ownerDocument,e=r.findAll("figure.equation");for(let i of e){let a=i.find("annotation");if(!a)continue;let o=t.createElement("div");o.className="annotation",o.appendText(`$$${jh(a.textContent)}$$`),i.replaceWith(o)}let n=r.findAll("span.notion-text-equation-token");for(let i of n){let a=i.find("annotation");a&&i.replaceWith(`$${jh(a.textContent,!0)}$`)}}function jh(r,t=!1){var n;let e=new RegExp(/^(?:\s|\\\\|\\\s)*(.*?)[\s\\]*$/,"s");return(n=r==null?void 0:r.replace(e,"$1").replace(/[\r\n]+/g,t?" ":`
`))!=null?n:""}function Gv(r){var e;let t=(e=r.match(/^[^\.\?\!\n]*[\.\?\!]?/))==null?void 0:e[0];return t!=null?t:""}function Yv(r){var t;return!!/callout|bookmark/.test((t=r.getAttribute("class"))!=null?t:"")}function Zv(r){var e;let t=r.ownerDocument;for(let n of r.findAll("figure.callout")){let i=(e=n.lastElementChild)==null?void 0:e.childNodes;if(!i)continue;let a=t.createElement("blockquote");a.append(...Array.from(i)),Kv(a),n.replaceWith(a)}}function Kv(r){var a,o,l;let t=r.firstChild,e=(a=t==null?void 0:t.nodeName)!=null?a:"",n=r.ownerDocument.createElement("p"),i="";e=="#text"?i=(o=t==null?void 0:t.textContent)!=null?o:"":e=="P"?i=t.innerHTML:["EM","STRONG","DEL","MARK"].includes(e)?i=t.outerHTML:r.prepend(n),i=i.replace(/<br>/g,"&lt;br&gt;"),n.innerHTML=`[!important] ${i}`,(l=r.firstChild)==null||l.replaceWith(n)}function Xv(r){var t,e,n;for(let i of r.findAll("a.bookmark.source")){let a=i.getAttribute("href"),o=(t=i.find("div.bookmark-title"))==null?void 0:t.textContent,l=Gv((n=(e=i.find("div.bookmark-description"))==null?void 0:e.textContent)!=null?n:""),s=`> [!info] ${o}
> ${l}
> [${a}](${a})
`;i.nextElementSibling&&Yv(i.nextElementSibling)&&(s+=`
`),i.replaceWith(s)}}function Jv(r){var t,e,n;for(let i of r.findAll("span[class=user]"))i.innerText=(t=i.textContent)!=null?t:"";for(let i of r.findAll("td div[class*=checkbox]")){let a=createSpan();a.setText(i.hasClass("checkbox-on")?"X":""),i.replaceWith(a)}for(let i of r.findAll("table span[class*=selected-value]"))((e=i.parentElement)==null?void 0:e.lastElementChild)!==i&&i.setText(i.textContent+", ");for(let i of r.findAll("a[href]"))if(!/^(https?:\/\/|www\.)/.test(i.href)){let a=createSpan();a.setText((n=i.textContent)!=null?n:""),i.replaceWith(a)}}function Qv(r,t){for(let e of r.findAll(t))e.remove()}function e2(r,t){for(let e of t)t2(r,e);for(let e of t)r2(r,e);for(let e of t)Zh(r,e);for(let e of t)n2(r,e)}function t2(r,t){for(let e of r.findAll(t)){if(!e.parentElement||e.parentElement.tagName===t.toUpperCase())continue;let n=e.find(t);for(;n;)sc(n),n=e.find(t)}}function r2(r,t){let e=r.findAll(t);if(!e)return;let n=new RegExp(`</${t}>( *)<${t}>`,"g");for(let i of e){if(!i||!i.parentElement)continue;let a=i.parentElement,o=a==null?void 0:a.innerHTML;a.innerHTML=o==null?void 0:o.replace(n,"$1")}}function Zh(r,t){let e=r.findAll(t);if(e)for(let n of e){let i=n.previousSibling;(i==null?void 0:i.nodeName)=="BR"&&(i==null||i.remove())}}function n2(r,t){let e=r.innerHTML,n=e.match(new RegExp(`<${t}>.*?</${t}>`,"sg"));if(n){for(let i of n.filter(a=>a.includes("<br>")))e=e.replace(i,i.split("<br>").join(`</${t}><br><${t}>`));r.innerHTML=e}}function Uh(r){var t;return Number((t=r==null?void 0:r.classList[1].slice(-1))!=null?t:-1)}function Kh(r,t){let e=Uh(r),n=Uh(t);if(e>n&&t.childElementCount==1){let i=createEl("ul");i.append(r),t.append(i)}else if(e>n&&t.childElementCount==2){let i=t.lastElementChild;i==null||i.append(r)}else if(e==n){let i=t.parentElement;i==null||i.append(r)}else e<n&&(t=t.parentElement.parentElement,Kh(r,t))}function Hh(r){var e;let t=createEl("li");return t.className=r.className,t.append((e=r.firstElementChild)!=null?e:""),t}function i2(r){let t=r.find(".table_of_contents"),e=t==null?void 0:t.children;if(!t||e.length==0)return;let n=createEl("ul"),i=Hh(e[0]);n.append(i);let a=i;for(let o=1;o<e.length;o++)i=Hh(e[o]),Kh(i,a),a=i;t.replaceWith(n)}function a2(r){r.innerHTML=r.innerHTML.replace(/(?:\n|<br ?\/>)/g,"<br>");for(let t of r.findAll("code"))for(let e of t.findAll("br"))e.replaceWith(`
`)}function o2(r){var t;for(let e of r.findAll("link"))e.innerText=(t=e.textContent)!=null?t:""}function Xh(r){var t,e;for(let n of r.findAll("time"))n.textContent=(e=(t=n.textContent)==null?void 0:t.replace(/@/g,""))!=null?e:""}var Wh={"1.875em":"h1","1.5em":"h2","1.25em":"h3"};function s2(r){var e;let t=r.findAll("summary");for(let n of t){let i=n.getAttribute("style");if(i){for(let a of Object.keys(Wh))if(i.includes(a)){n.replaceWith(createEl(Wh[a],{text:(e=n.textContent)!=null?e:""}));break}}}}function Vh(r,t){let e=r.findAll(t);for(let n of e)sc(n)}function l2(r){for(let t of r.findAll(".language-Mermaid"))t.removeClass("language-Mermaid"),t.addClass("language-mermaid")}function zh(r,t){for(let e of r.findAll(t)){let n=[],i=[],a=e;for(;a.tagName===t.toUpperCase();){n.push(a);for(let l=0;l<a.children.length;l++)i.push(a.children[l]);if(!a.nextElementSibling||a.getAttribute("class")!==a.nextElementSibling.getAttribute("class"))break;a=a.nextElementSibling}let o=r.createEl(t);for(let l of i)o.appendChild(l);n[0].replaceWith(o),n.slice(1).forEach(l=>l.remove())}}function c2(r){for(let t of r.findAll(".checkbox.checkbox-on"))t.replaceWith("[x] ");for(let t of r.findAll(".checkbox.checkbox-off"))t.replaceWith("[ ] ")}function u2(r){var e;let t=r.findAll("a");if(t.length===0)return r;for(let n of t){let i=createSpan();i.setText((e=n.getAttribute("href"))!=null?e:""),n.replaceWith(i)}}function Gh(r,t,e){var n,i,a;for(let o of t){let l=createSpan(),s="";switch(o.type){case"relation":let c=r.idsToFileInfo[o.id];if(c){let f=o.a.closest("table");s=`[[${c.fullLinkPathNeeded?`${r.getPathForFile(c)}${c.title}${f?"\\":""}|${c.title}`:c.title}]]`}else{console.warn("missing relation data for id: "+o.id);let{basename:f}=le(decodeURI((n=o.a.getAttribute("href"))!=null?n:""));s=`[[${Mh(f)}]]`}break;case"attachment":let u=r.pathsToAttachmentInfo[o.path];if(!u){console.warn("missing attachment data for: "+o.path);continue}s=`${e?"!":""}[[${u.fullLinkPathNeeded?u.targetParentFolder+u.nameWithExtension+"|"+u.nameWithExtension:u.nameWithExtension}]]`;break;case"toc-item":s=(i=o.a.textContent)!=null?i:"";let p=(a=s.endsWith("]"))!=null?a:!1;s=`[[#${s+(p?" ":"")}]]`}l.setText(s),o.a.replaceWith(l)}}var po=class{constructor(t,e){this.idsToFileInfo={};this.pathsToAttachmentInfo={};this.attachmentPath=t,this.singleLineBreaks=e}getPathForFile(t){let{idsToFileInfo:e}=this,n=t.path.split("/");if(t.parentIds.length>0){let l=t.parentIds.map(s=>{var c,u,p;return(p=(c=e[s])==null?void 0:c.title)!=null?p:(u=n.find(f=>f.contains(s)))==null?void 0:u.replace(` ${s}`,"")}).filter(s=>s).map(s=>s.replace(/[\. ]+$/,""));if(l.length>0)return l.join("/")+"/"}let{parent:i}=le(t.path);if(!i)return"";let o=i.split("/").filter(l=>l.length>0).map(l=>l.replace(/\s+[a-z0-9]{32}$/,"").trim()).filter(l=>l.length>0).map(l=>l.replace(/[\. ]+$/,"")).join("/");return o?o+"/":""}};async function Qh(r,t){var n,i;let{filepath:e}=t;if(t.extension==="html"){let a=await t.readText(),o=At(a),s=o.find("body").children,c;for(let g=0;g<s.length&&(c=nr((n=s[g].getAttr("id"))!=null?n:""),!c);g++);if(!c)throw new Error("no id found for: "+e);let u=Jh(o,"property-row-created_time"),p=Jh(o,"property-row-last_edited_time"),f=((i=o.find("title"))==null?void 0:i.textContent)||"Untitled",d=p2(_e(f.replace(/\n/g," ").replace(/[:\/]/g,"-").replace(/#/g,"").trim()));r.idsToFileInfo[c]={path:e,parentIds:ac(e),ctime:u,mtime:p,title:d,fullLinkPathNeeded:!1}}else r.pathsToAttachmentInfo[e]={path:e,parentIds:ac(e),nameWithExtension:_e(decodeURIComponent(t.name)),targetParentFolder:"",fullLinkPathNeeded:!1}}function p2(r){if(r.length<200)return r;let t=r.split(" "),e=[],n=0,i=0,a=!1;for(;n<200;){if(!t[i]){a=!0;break}e.push(t[i]),n+=t[i].length+1,i++}let o=e.join(" ");return a||(o+="..."),o}function d2(r){let t=r.startsWith("@")?r.substr(1).trim():r.trim(),e=new Date(t);return isNaN(e.getTime())?null:e}function Jh(r,t){let e=r.querySelector(`tr.${t}`);if(e){let n=e.querySelector("time");return n&&n.textContent?d2(n.textContent):null}return null}var fo=class extends Ee{init(){this.parentsInSubfolders=!0,this.addFileChooserSetting("Exported Notion",["zip"]),this.addOutputLocationSetting("Notion"),new ir.Setting(this.modal.contentEl).setName("Save parent pages in subfolders").setDesc("Places the parent database pages in the same folder as the nested content.").addToggle(t=>t.setValue(this.parentsInSubfolders).onChange(e=>this.parentsInSubfolders=e)),new ir.Setting(this.modal.contentEl).setName("Single line breaks").setDesc("Separate Notion blocks with only one line break (default is 2).").addToggle(t=>t.setValue(this.singleLineBreaks).onChange(e=>{this.singleLineBreaks=e}))}async import(t){var f;let{vault:e,parentsInSubfolders:n,files:i}=this;if(i.length===0){new ir.Notice("Please pick at least one file to import.");return}let a=await this.getOutputFolder();if(!a){new ir.Notice("Please select a location to export to.");return}let o=a.path;o=(0,ir.normalizePath)(o),o!=null&&o.endsWith("/")||(o+="/");let l=new po((f=e.getConfig("attachmentFolderPath"))!=null?f:"",this.singleLineBreaks);t.status("Looking for files to import");let s=0;if(await lc(t,i,async d=>{try{await Qh(l,d),s=Object.keys(l.idsToFileInfo).length+Object.keys(l.pathsToAttachmentInfo).length,t.reportProgress(0,s)}catch(g){t.reportSkipped(d.fullpath)}}),t.isCancelled())return;t.status("Resolving links and de-duplicating files"),Lh({vault:e,info:l,targetFolderPath:o,parentsInSubfolders:n});let c=new Set([o]),u=Object.values(l.idsToFileInfo).map(d=>o+l.getPathForFile(d)).concat(Object.values(l.pathsToAttachmentInfo).map(d=>d.targetParentFolder));for(let d of u)c.add(d);for(let d of c){if(t.isCancelled())return;await this.createFolders(d)}let p=0;t.status("Starting import"),await lc(t,i,async d=>{p++,t.reportProgress(p,s);try{if(d.extension==="html"){let g=nr(d.name);if(!g)throw new Error("ids not found for "+d.filepath);let m=l.idsToFileInfo[g];if(!m)throw new Error("file info not found for "+d.filepath);t.status(`Importing note ${m.title}`);let h=await Yh(l,d),b={};m.ctime&&(b.ctime=m.ctime.getTime(),b.mtime=m.ctime.getTime()),m.mtime&&(b.mtime=m.mtime.getTime());let _=`${o}${l.getPathForFile(m)}${m.title}.md`;await e.create(_,h,b),t.reportNoteSuccess(d.fullpath)}else{let g=l.pathsToAttachmentInfo[d.filepath];if(!g)throw new Error("attachment info not found for "+d.filepath);t.status(`Importing attachment ${d.name}`);let m=await d.read();await e.createBinary(`${g.targetParentFolder}${g.nameWithExtension}`,m),t.reportAttachmentSuccess(d.fullpath)}}catch(g){if(Ct(g)==="page body was not found"){t.reportSkipped(d.fullpath,"page body was not found");return}t.reportFailed(d.fullpath,g)}})}};async function lc(r,t,e){for(let n of t){if(r.isCancelled())return;try{await er(n,async(i,a)=>{for(let o of a){if(r.isCancelled())return;if(o.extension==="md"&&nr(o.name))throw new ir.Notice("Notion Markdown export detected. Please export Notion data to HTML instead."),r.cancel(),new Error("Notion importer uses only HTML exports. Please use the correct format.");if(!(o.extension==="csv"&&nr(o.name))&&o.name!=="index.html")if(o.extension==="zip"&&o.parent==="")try{await lc(r,[o],e)}catch(l){r.reportFailed(o.fullpath)}else await e(o)}})}catch(i){r.reportFailed(n.fullpath)}}}var ne=require("obsidian");var Ag=Yn(dg());function Ht(r,t){return`[[${r}:${t}]]`}function Mi(r,t){let e=[],n=new RegExp(`\\[\\[${t}:([a-f0-9-]+)\\]\\]`,"g"),i;for(;(i=n.exec(r))!==null;)e.push(i[1]);return e}var mg={if:{type:"global"},now:{type:"global"},today:{type:"global"},toNumber:{type:"global",obsidianName:"number"},length:{type:"property",obsidianName:"length",argCount:1},format:{type:"method",obsidianName:"toString",argCount:1},contains:{type:"method",obsidianName:"contains",argCount:2},lower:{type:"method",obsidianName:"lower",argCount:1},upper:{type:"method",obsidianName:"upper",argCount:1},replace:{type:"method",obsidianName:"replace",argCount:3},substring:{type:"method",obsidianName:"slice",argCount:3},reverse:{type:"method",obsidianName:"reverse",argCount:1},sort:{type:"method",obsidianName:"sort",argCount:1},unique:{type:"method",obsidianName:"unique",argCount:1},flat:{type:"method",obsidianName:"flat",argCount:1},join:{type:"method",obsidianName:"join",argCount:2},includes:{type:"method",obsidianName:"contains",argCount:2},slice:{type:"method",obsidianName:"slice",argCount:3},map:{type:"method",obsidianName:"map",argCount:2},filter:{type:"method",obsidianName:"filter",argCount:2},abs:{type:"method",obsidianName:"abs",argCount:1},ceil:{type:"method",obsidianName:"ceil",argCount:1},floor:{type:"method",obsidianName:"floor",argCount:1},round:{type:"method",obsidianName:"round",argCount:1},formatDate:{type:"method",obsidianName:"format",argCount:2},parseDate:{type:"global",obsidianName:"date"},date:{type:"property",obsidianName:"day",argCount:1},year:{type:"property",obsidianName:"year",argCount:1},month:{type:"property",obsidianName:"month",argCount:1},hour:{type:"property",obsidianName:"hour",argCount:1},minute:{type:"property",obsidianName:"minute",argCount:1},at:{type:"operator",argCount:2},first:{type:"operator",argCount:1},last:{type:"operator",argCount:1},add:{type:"operator",argCount:2},subtract:{type:"operator",argCount:2},multiply:{type:"operator",argCount:2},divide:{type:"operator",argCount:2},mod:{type:"operator",argCount:2},equal:{type:"operator",argCount:2},unequal:{type:"operator",argCount:2}};function Bi(r){if(!r||typeof r!="string")return!1;let t=["sqrt","exp","ln","log10","log2","sign","cbrt","pi","e","pow","replaceAll","match","repeat","split","trim","style","unstyle","empty","ifs","dateBetween","dateRange","dateStart","dateEnd","timestamp","fromTimestamp","day","week","name","email","find","findIndex","some","every","let","lets","id","link"],e=/([a-zA-Z_][a-zA-Z0-9_]*)\s*\(/g,n=r.matchAll(e);for(let i of n){let a=i[1];if(a!=="prop"&&!(a==="sum"||a==="mean"||a==="median"||a==="max"||a==="min")&&!mg[a])return t.includes(a),!1}return!0}function hg(r,t){let e=r;if(t&&(e=e.replace(/\{\{notion:block_property:([^:]+):[^}]+\}\}/g,(l,s)=>{for(let[,c]of Object.entries(t))if(c.id===s)return`prop("${c.name}")`;return l})),!Bi(e))return null;e=e.replace(/prop\s*\(\s*"([^"]+)"\s*\)/g,(l,s)=>`note["${s}"]`),e=e.replace(/\.length\s*\(\s*\)/g,".length");let n=[];e=e.replace(/parseDate\s*\(([^()]*)\)/g,(l,s)=>{let c=n.length;return n.push(s),`__PARSEDATE_${c}__`});let i=!0,a=20,o=0;for(;i&&o<a;){i=!1,o++;let l=/(?<![.\w])([a-zA-Z_][a-zA-Z0-9_]*)\s*\(/g,s,c=!1;for(;(s=l.exec(e))!==null&&!c;){let u=s[1],p=s.index,f=s.index+s[0].length-1,d=q2(e,f);if(d===-1)continue;let g=d+1,m=e.substring(f+1,d);if(u.startsWith("__PARSEDATE_"))continue;let h=null;if(u==="test"){let b=$i(m);if(b.length===2){let _=b[0],k=b[1].trim();(k.startsWith('"')&&k.endsWith('"')||k.startsWith("'")&&k.endsWith("'"))&&(k=k.slice(1,-1)),h=`/${k}/.matches(${_})`}}if(u==="sum"||u==="mean"||u==="median"||u==="max"||u==="min"){let b=$i(m);b.length>0&&(h=`[${b.join(", ")}].flat().${u}()`)}if(u==="dateAdd"){let b=fg(m,"+");b&&(h=b)}else if(u==="dateSubtract"){let b=fg(m,"-");b&&(h=b)}else if(u!=="fromTimestamp"){let b=mg[u];if(b)if(b.type==="global"){if(b.obsidianName){let _=$i(m);h=`${b.obsidianName}(${_.join(", ")})`}}else{let _=$i(m);if(b.type==="property")_.length===1&&(h=`(${_[0]}).${b.obsidianName}`);else if(b.type==="method"){if(_.length>=1){let N=_[0],k=_.slice(1);(u==="map"||u==="filter")&&(k=k.map(O=>O.replace(/\bcurrent\b/g,"value"))),k.length>0?h=`(${N}).${b.obsidianName}(${k.join(", ")})`:h=`(${N}).${b.obsidianName}()`}}else if(b.type==="operator"){if(u==="at"&&_.length===2)h=`(${_[0]})[${_[1]}]`;else if(u==="first"&&_.length===1)h=`(${_[0]})[0]`;else if(u==="last"&&_.length===1)h=`(${_[0]})[-1]`;else if(_.length===2){let k={add:"+",subtract:"-",multiply:"*",divide:"/",mod:"%",equal:"==",unequal:"!="}[u];k&&(h=`(${_[0]} ${k} ${_[1]})`)}}}}if(h!==null){i=!0,c=!0,e=e.substring(0,p)+h+e.substring(g);break}}}for(let l=0;l<n.length;l++)e=e.replace(new RegExp(`__PARSEDATE_${l}__`,"g"),`date(${n[l]})`);return e}function $i(r){if(!r.trim())return[];let t=[],e="",n=0,i=!1,a="";for(let o=0;o<r.length;o++){let l=r[o];i?(e+=l,l===a&&r[o-1]!=="\\"&&(i=!1)):l==='"'||l==="'"?(i=!0,a=l,e+=l):l==="("||l==="["?(n++,e+=l):l===")"||l==="]"?(n--,e+=l):l===","&&n===0?(t.push(e.trim()),e=""):e+=l}return e.trim()&&t.push(e.trim()),t}function fg(r,t){let e=$i(r);if(e.length!==3)return null;let n=e[0],i=e[1],o=e[2].trim();(o.startsWith('"')&&o.endsWith('"')||o.startsWith("'")&&o.endsWith("'"))&&(o=o.slice(1,-1));let s={years:"y",quarters:"q",months:"M",weeks:"w",days:"d",hours:"h",minutes:"m"}[o]||o;return`(${n}) ${t} '${i}${s}'`}function q2(r,t){let e=1,n=!1,i="";for(let a=t+1;a<r.length;a++){let o=r[a],l=a>0?r[a-1]:"";if(n)o===i&&l!=="\\"&&(n=!1);else if(o==='"'||o==="'")n=!0,i=o;else if(o==="(")e++;else if(o===")"&&(e--,e===0))return a}return-1}function So(r){return!r||typeof r!="object"?null:r.expression||null}var Ot=require("obsidian");async function fc(r,t){let{vault:e,ctx:n,downloadExternalAttachments:i,currentPageTitle:a,incrementalImport:o}=t;if(!(r.type==="file"||r.type==="external"&&i))return{path:r.url,isLocal:!1};let s=r.name||j2(r.url)||a||"attachment";s=_e(s);try{n.status(`Downloading attachment: ${s}...`);let c=await(0,Ot.requestUrl)({url:r.url,method:"GET",throw:!1});if(c.status!==200)return console.error(`Failed to download attachment "${s}": ${c.status}`),n.reportFailed(`Attachment: ${s}`,`HTTP ${c.status}`),{path:r.url,isLocal:!1};let[u,p]=Tn(s);if(!p){let b=c.headers["content-type"]||c.headers["Content-Type"];if(b){let _=On(b);_&&(s=`${u}.${_}`)}}let f;if(t.getAvailableAttachmentPath)f=await t.getAvailableAttachmentPath(s);else{let b=t.currentFilePath||t.currentFolderPath||"";f=b?(0,Ot.normalizePath)(`${b}/${s}`):s}if(console.log(`[ATTACHMENT] Incremental import enabled: ${o}, Original filename: ${s}`),console.log(`[ATTACHMENT] Available target path: ${f}`),o){let{parent:b,basename:_}=le(f),N=_+(p?`.${p}`:"");if(console.log(`[ATTACHMENT] Target full filename: ${N}`),N!==s){console.log(`[ATTACHMENT] Filename changed (${s} \u2192 ${N}), original file exists`);let k=(0,Ot.normalizePath)(`${b}/${s}`);console.log(`[ATTACHMENT] Checking original file: ${k}`);let O=e.getAbstractFileByPath(k);if(O&&O instanceof Ot.TFile){let w=c.arrayBuffer.byteLength;if(console.log(`[ATTACHMENT] Downloaded size: ${w} bytes, Existing size: ${O.stat.size} bytes`),O.stat.size===w){console.log(`[ATTACHMENT] Skipping attachment (same size): ${s}`),n.reportSkipped(`Attachment: ${s}`,"already exists with same size (incremental import)");let{parent:C,basename:y}=le(k);return{path:(0,Ot.normalizePath)(C?`${C}/${y}`:y),isLocal:!0,filename:s}}else console.log(`[ATTACHMENT] Sizes don't match, will save as new file: ${N}`)}}else console.log("[ATTACHMENT] Filename unchanged, original file doesn't exist")}let d={};r.created_time&&(d.ctime=new Date(r.created_time).getTime()),r.last_edited_time&&(d.mtime=new Date(r.last_edited_time).getTime()),await e.createBinary(f,c.arrayBuffer,d);let{parent:g,basename:m}=le(f);return{path:(0,Ot.normalizePath)(g?`${g}/${m}`:m),isLocal:!0,filename:s}}catch(c){let u=c instanceof Error?c.message:String(c);return console.error(`Failed to download attachment "${s}":`,c),n.reportFailed(`Attachment: ${s}`,u),{path:r.url,isLocal:!1}}}function j2(r){try{let n=new URL(r).pathname.split("/"),i=n[n.length-1];return decodeURIComponent(i)||"attachment"}catch(t){return"attachment"}}function gg(r){let t=r.type,e=null;if(t==="image")e=r.image;else if(t==="video")e=r.video;else if(t==="file")e=r.file;else if(t==="pdf")e=r.pdf;else return null;return e?e.type==="file"&&e.file?{type:"file",url:e.file.url,name:e.name,created_time:r.created_time,last_edited_time:r.last_edited_time}:e.type==="external"&&e.external?{type:"external",url:e.external.url,name:e.name,created_time:r.created_time,last_edited_time:r.last_edited_time}:null:null}function qi(r){let t=r.type,e=[];return t==="image"&&r.image.caption?e=r.image.caption:t==="video"&&r.video.caption?e=r.video.caption:t==="file"&&r.file.caption?e=r.file.caption:t==="pdf"&&r.pdf.caption?e=r.pdf.caption:t==="bookmark"&&r.bookmark.caption?e=r.bookmark.caption:t==="link_preview"&&r.link_preview.caption?e=r.link_preview.caption:t==="embed"&&r.embed.caption&&(e=r.embed.caption),e.map(n=>n.plain_text).join("")||""}function U2(r){var d;let{result:t,vault:e,app:n,sourceFilePath:i,caption:a="",isEmbed:o=!1,forceWikiLink:l=!1}=r;if(!t.isLocal)return o?`![${a}](${t.path})`:`[${a||"Link"}](${t.path})`;let[,s]=Tn(t.filename||""),c=s?`${t.path}.${s}`:t.path,u=e.getAbstractFileByPath((0,Ot.normalizePath)(c));if(!u||!(u instanceof Ot.TFile)){let g=l||((d=e.getConfig("useWikiLinks"))!=null?d:!0),m=o?"!":"";if(g)return a?`${m}[[${c}|${a}]]`:`${m}[[${c}]]`;{let h=a||c;return o?`![${h}](${c})`:`[${h}](${c})`}}let p;l?p=`[[${c}]]`:p=n.fileManager.generateMarkdownLink(u,i);let f=o?"!":"";if(a){if(p.startsWith("[["))return`${f}${p.slice(0,-2)}|${a}]]`;{let g=p.slice(p.indexOf("](")+1);return`${f}[${a}]${g}`}}return`${f}${p}`}async function Do(r,t,e){let{caption:n="",isEmbed:i=!1,fallbackText:a="file",forceWikiLink:o=!1}=e||{};try{let l=await fc(r,t);l.isLocal&&t.onAttachmentDownloaded&&t.onAttachmentDownloaded();let s=t.currentFilePath||t.currentFolderPath||"";return U2({result:l,vault:t.vault,app:t.app,sourceFilePath:s,caption:n,isEmbed:i,forceWikiLink:o})}catch(l){console.error("Failed to download and format attachment:",l);let s=n||r.name||a;return`${i?"!":""}[${s}](${r.url})`}}var mc=3;async function Oo(r,t,e,n){let i=n==null?void 0:n.get(r);return i||(i=await hc(t,r,e),n&&n.set(r,i)),i}async function Io(r){let{block:t,client:e,ctx:n,blocksCache:i,processor:a,errorContext:o}=r;if(t.has_children)try{let l=await Oo(t.id,e,n,i);return l.length===0?void 0:await a(l)}catch(l){let s=o||"block",c=l instanceof Error?l.message:String(l);console.error(`Failed to fetch children for ${s} ${t.id}:`,l),n.reportFailed(`Fetch children for ${s} ${t.id}`,c);return}}async function _t(r,t,e=0){try{return await r()}catch(n){if(n.code==="rate_limited"||n.status===429){if(e>=mc)throw new Error(`Rate limit exceeded after ${mc} retries`);let i=1;n.headers&&n.headers["retry-after"]?i=parseInt(n.headers["retry-after"],10):i=Math.pow(2,e);let a=t.statusMessage;return t.status(`Rate limited. Waiting ${i} seconds before retry (${e+1}/${mc})...`),await new Promise(o=>setTimeout(o,i*1e3)),t.status(a),_t(r,t,e+1)}throw n}}async function hc(r,t,e){var a;let n=[],i;do{let o=await _t(()=>r.blocks.children.list({block_id:t,start_cursor:i,page_size:100}),e),l=o.results.filter(s=>"type"in s);n.push(...l),i=o.has_more&&(a=o.next_cursor)!=null?a:void 0}while(i);return n}async function gc(r,t,e,n){for(let i of t){if(i.type==="child_page")return!0;if(i.type==="child_database")try{let a=await _t(()=>r.databases.retrieve({database_id:i.id}),e);if(a.data_sources&&a.data_sources.length>0)return!0}catch(a){let o=a instanceof Error?a.message:String(a);console.warn(`[hasChildPagesOrDatabases] Failed to check database ${i.id}, skipping:`,o)}if(i.has_children)try{let a=await Oo(i.id,r,e,n);if(a.length>0&&await gc(r,a,e,n))return!0}catch(a){let o=a instanceof Error?a.message:String(a);console.error(`Failed to fetch children for block ${i.id}:`,a),e.reportFailed(`Fetch children for block ${i.id}`,o)}}return!1}function yg(r){let t=r.properties;for(let e in t){let n=t[e];if(n.type==="title"&&n.title.length>0)return n.title.map(i=>i.plain_text).join("")}return"Untitled"}async function xg(r){let{page:t,formulaStrategy:e="hybrid",databaseProperties:n,client:i,ctx:a}=r,o={"notion-id":t.id};t.cover&&(o.cover=H2(t.cover));let l=t.properties;for(let s in l){let c=l[s];if(c.type==="title")continue;if(c.type==="formula"){if(W2(s,n,e)){let f=bg(c);f!=null&&(o[s]=f)}continue}if(c.type==="people"&&i&&a){let p=await V2(c,i,a);p!=null&&(o[s]=p);continue}if(c.type==="files"&&r.vault&&r.app&&a){let p=await z2(c,r);p!=null&&(o[s]=p);continue}let u=bg(c);u!=null&&(o[s]=u)}return o}function H2(r){var t,e;return r?r.type==="external"&&((t=r.external)!=null&&t.url)?r.external.url:r.type==="file"&&((e=r.file)!=null&&e.url)?r.file.url:null:null}function W2(r,t,e){if(e==="static")return!0;if(e==="function")return!1;if(t&&t[r]){let n=So(t[r].formula);if(n&&Bi(n))return!1}return!0}async function V2(r,t,e){if(!r.people||!Array.isArray(r.people))return[];let n=[];for(let i of r.people)if(i.name)n.push(i.name);else if(i.object==="user"&&i.id)try{let a=await _t(()=>t.users.retrieve({user_id:i.id}),e);if(a&&"name"in a){let o=a.name||a.id;n.push(o)}else n.push(i.id)}catch(a){console.warn(`Failed to fetch user ${i.id}:`,a),n.push(i.id)}else n.push(i.id);return n}async function z2(r,t){var p,f,d,g;if(!r.files||r.files.length===0)return null;let{vault:e,app:n,ctx:i,currentFilePath:a,currentFolderPath:o,incrementalImport:l,onAttachmentDownloaded:s,getAvailableAttachmentPath:c}=t;if(!e||!n||!i)return r.files.map(m=>{var h,b;return m.type==="file"?((h=m.file)==null?void 0:h.url)||"":m.type==="external"&&((b=m.external)==null?void 0:b.url)||""}).filter(m=>m);let u=[];for(let m of r.files)try{let h=null;if(m.type==="file"&&((p=m.file)!=null&&p.url)?h={type:"file",url:m.file.url,name:m.name}:m.type==="external"&&((f=m.external)!=null&&f.url)&&(h={type:"external",url:m.external.url,name:m.name}),!h)continue;let b=await Do(h,{vault:e,app:n,ctx:i,currentFilePath:a,currentFolderPath:o,downloadExternalAttachments:!0,incrementalImport:l||!1,onAttachmentDownloaded:s,getAvailableAttachmentPath:c},{isEmbed:!1,fallbackText:h.name||"file",forceWikiLink:!0});u.push(b)}catch(h){console.error("Failed to download file attachment:",h),m.type==="file"&&((d=m.file)!=null&&d.url)?u.push(m.file.url):m.type==="external"&&((g=m.external)!=null&&g.url)&&u.push(m.external.url)}return u.length>0?u:null}function Ro(r){if(/^\d{4}-\d{2}-\d{2}$/.test(r))return r;try{let t=new Date(r),e=t.getFullYear(),n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),a=String(t.getHours()).padStart(2,"0"),o=String(t.getMinutes()).padStart(2,"0"),l=String(t.getSeconds()).padStart(2,"0");return`${e}-${n}-${i}T${a}:${o}:${l}`}catch(t){return console.warn(`Failed to parse date: ${r}`,t),r}}function bg(r){var t,e,n,i,a,o,l,s,c,u,p,f,d,g,m,h,b,_,N,k,O;switch(r.type){case"number":return r.number;case"checkbox":return r.checkbox;case"select":return((t=r.select)==null?void 0:t.name)||null;case"multi_select":return((e=r.multi_select)==null?void 0:e.map(y=>y.name))||[];case"status":return((n=r.status)==null?void 0:n.name)||null;case"date":if(!r.date)return null;let w=Ro(r.date.start);if(r.date.end){let y=Ro(r.date.end);return`${w} to ${y}`}return w;case"email":return r.email;case"url":return r.url;case"phone_number":return r.phone_number;case"rich_text":return((i=r.rich_text)==null?void 0:i.map(y=>y.plain_text).join(""))||"";case"people":return((a=r.people)==null?void 0:a.map(y=>{var S;return y.name?y.name:y.type==="person"&&((S=y.person)!=null&&S.email)?y.person.email:y.id}))||[];case"files":return((o=r.files)==null?void 0:o.map(y=>{var S,D;return y.type==="file"?((S=y.file)==null?void 0:S.url)||"":y.type==="external"&&((D=y.external)==null?void 0:D.url)||""}).filter(y=>y))||[];case"formula":if(!r.formula)return null;let C=r.formula;switch(C.type){case"string":return C.string;case"number":return C.number;case"boolean":return C.boolean;case"date":return((l=C.date)==null?void 0:l.start)||null;default:return null}case"relation":return((s=r.relation)==null?void 0:s.map(y=>y.id))||[];case"rollup":return null;case"created_time":return r.created_time?Ro(r.created_time):null;case"created_by":return(c=r.created_by)!=null&&c.name?r.created_by.name:((u=r.created_by)==null?void 0:u.type)==="person"&&((p=r.created_by.person)!=null&&p.email)?r.created_by.person.email:((f=r.created_by)==null?void 0:f.id)||null;case"last_edited_time":return r.last_edited_time?Ro(r.last_edited_time):null;case"last_edited_by":return(d=r.last_edited_by)!=null&&d.name?r.last_edited_by.name:((g=r.last_edited_by)==null?void 0:g.type)==="person"&&((m=r.last_edited_by.person)!=null&&m.email)?r.last_edited_by.person.email:((h=r.last_edited_by)==null?void 0:h.id)||null;case"unique_id":return(b=r.unique_id)!=null&&b.prefix?`${r.unique_id.prefix}-${r.unique_id.number}`:((_=r.unique_id)==null?void 0:_.number)||null;case"verification":return((N=r.verification)==null?void 0:N.state)||null;case"button":return null;case"place":return((k=r.place)==null?void 0:k.lat)!=null&&((O=r.place)==null?void 0:O.lon)!=null?[String(r.place.lat),String(r.place.lon)]:null;default:return String(r[r.type]||"")}}var zn=require("obsidian");var Vn=require("obsidian");function Fo(r,t,e){let i=(0,Vn.normalizePath)(`${t}/${e}`),a=1;for(;r.getAbstractFileByPath(i);)i=(0,Vn.normalizePath)(`${t}/${e} ${a}`),a++;return i}function un(r,t,e){let n=(0,Vn.normalizePath)(`${t}/${e}`),i=n,a=1;for(console.log(`[GET UNIQUE FILE] Checking: ${n}`);r.getAbstractFileByPath(i);){let o=e.lastIndexOf(".");if(o>0){let l=e.substring(0,o),s=e.substring(o);i=(0,Vn.normalizePath)(`${t}/${l} ${a}${s}`)}else i=(0,Vn.normalizePath)(`${t}/${e} ${a}`);console.log(`[GET UNIQUE FILE] Path exists, trying: ${i}`),a++}return console.log(`[GET UNIQUE FILE] Final path: ${i}`),i}function wg(r,t){for(let[e,n]of Object.entries(t)){let i=r.metadataTypeManager.getAssignedWidget(e);i?console.log(`[Property Types] Skipping "${e}" (already has type: ${i})`):(r.metadataTypeManager.setType(e,n),console.log(`[Property Types] Setting type for "${e}": ${n}`))}}var Lo={image:{type:"image",isEmbed:!0,fallbackText:"Image"},video:{type:"video",isEmbed:!0,fallbackText:"Video"},file:{type:"file",isEmbed:!1,fallbackText:"File"},pdf:{type:"pdf",isEmbed:!0,fallbackText:"PDF"}};async function pn(r,t,e,n){return await Io({block:r,client:t.client,ctx:t.ctx,blocksCache:t.blocksCache,processor:async i=>{let a=e!==void 0?{...t,indentLevel:e}:t;return await Mo(i,a)},errorContext:n})}function G2(r){return!r||r.type!=="paragraph"?!1:r.paragraph.rich_text.length===0}async function Eg(r,t,e,n){let a=`> [!note]+ ${r}
`,o=await pn(t,e,0,n);if(o){let l=o.split(`
`).map(s=>`> ${s}`).join(`
`);a+=l}return a}function Y2(r,t,e){let n=(e==null?void 0:e.indentLevel)||0,i=(e==null?void 0:e.singleLineBreaks)||!1,a=["bulleted_list_item","numbered_list_item","to_do"],o=a.includes(r),l=a.includes(t);return n>0?!!(["callout","toggle","quote","table"].includes(r)||t==="table"):i?!!(["callout","toggle","quote"].includes(r)||o&&!l||r==="table"||t==="table"||t==="divider"):!(o&&l)}async function Mo(r,t){let e=[];for(let n=0;n<r.length&&!t.ctx.isCancelled();n++){let i=r[n];if(i.type!=="numbered_list_item"&&t.listCounters){let o=t.indentLevel||0,l=[];t.listCounters.forEach((s,c)=>{c>o&&l.push(c)}),l.forEach(s=>t.listCounters.delete(s))}let a=await Z2(i,t);if(a===""&&i.type==="paragraph")e.push("");else if(a&&(e.push(a),n<r.length-1)){let o=r[n+1],s=!((t==null?void 0:t.singleLineBreaks)||!1)&&G2(o);Y2(i.type,o.type,t)&&!s&&e.push("")}}return e.join(`
`)}async function Z2(r,t){var i;let e=r.type,n="";switch(e){case"paragraph":n=K2(r,t);break;case"heading_1":case"heading_2":case"heading_3":n=await X2(r,t);break;case"bulleted_list_item":n=await J2(r,t);break;case"to_do":n=await Q2(r,t);break;case"column_list":n=await eE(r,t);break;case"toggle":n=await iE(r,t);break;case"synced_block":n=await nE(r,t);break;case"table":n=await aE(r,t);break;case"numbered_list_item":n=await oE(r,t);break;case"quote":n=await sE(r,t);break;case"callout":n=await lE(r,t);break;case"divider":n=cE(r);break;case"equation":n=uE(r);break;case"code":n=pE(r,t);break;case"image":n=await dE(r,t);break;case"video":n=await mE(r,t);break;case"file":n=await hE(r,t);break;case"pdf":n=await gE(r,t);break;case"bookmark":n=yE(r);break;case"embed":n=xE(r);break;case"link_preview":n=wE(r);break;case"child_database":let a=t.isProcessingSyncedBlock||!1,o=t.indentLevel||0,l=a?"SYNCED_CHILD_DATABASE":"DATABASE_PLACEHOLDER",s=Ht(l,r.id);o>0?n=" ".repeat(o)+s:n=s;break;case"child_page":let c=t.isProcessingSyncedBlock||!1,u=t.indentLevel||0;if(c){let p=r.id,f=Ht("SYNCED_CHILD_PAGE",p);u>0?n=" ".repeat(u)+f:n=f}else if(t.importPageCallback){let p=((i=r.child_page)==null?void 0:i.title)||"Untitled";try{await t.importPageCallback(r.id,t.currentFolderPath);let f=(0,zn.normalizePath)(`${t.currentFolderPath}/${_e(p)}.md`),d=t.vault.getAbstractFileByPath(f),g;if(d&&d instanceof zn.TFile){let m=t.currentFilePath||t.currentFolderPath;g=t.app.fileManager.generateMarkdownLink(d,m)}else g=`[[${p}]]`;u>0?n=" ".repeat(u)+g:n=g}catch(f){let d=f instanceof Error?f.message:String(f);console.error(`Failed to import child page "${p}":`,f),t.ctx.reportFailed(`Child page: ${p}`,d),n=`<!-- Failed to import child page: ${d} -->`}}else console.warn(`child_page block ${r.id} skipped: no import callback provided`),n="";break;default:console.log(`Unsupported block type: ${e}`),n=""}return n}function K2(r,t){return r.type!=="paragraph"?"":sr(r.paragraph.rich_text,t)}async function X2(r,t){let e=(t==null?void 0:t.indentLevel)||0,n=" ".repeat(e),i="",a;if(r.type==="heading_1")i="# ",a=r.heading_1;else if(r.type==="heading_2")i="## ",a=r.heading_2;else if(r.type==="heading_3")i="### ",a=r.heading_3;else return"";let o=a.is_toggleable||!1,l=sr(a.rich_text,t);return o&&r.has_children?await Eg(i+l,r,t,"toggleable heading"):n+i+l}async function J2(r,t){if(r.type!=="bulleted_list_item")return"";let e=t.indentLevel||0,i=" ".repeat(e)+"- "+sr(r.bulleted_list_item.rich_text,t),a=await pn(r,t,e+1,"bulleted list item");return a&&(i+=`
`+a),i}async function Q2(r,t){if(r.type!=="to_do")return"";let e=t.indentLevel||0,n=" ".repeat(e),i=r.to_do.checked?"[x]":"[ ]",a=n+"- "+i+" "+sr(r.to_do.rich_text,t),o=await pn(r,t,e+1,"to-do item");return o&&(a+=`
`+o),a}async function eE(r,t){return r.type!=="column_list"?"":await Io({block:r,client:t.client,ctx:t.ctx,blocksCache:t.blocksCache,processor:async n=>{let i="";for(let a=0;a<n.length;a++){let o=n[a];if(o.type!=="column"){console.warn(`Expected column block, got ${o.type}`);continue}i+=`<!-- Column ${a+1} -->
`;let l=await tE(o,t);l&&(i+=l),a<n.length-1&&(i+=`
`)}return i},errorContext:"column_list"})||""}async function tE(r,t){return r.type!=="column"?"":await pn(r,t,void 0,"column")||""}async function rE(r,t){let{client:e,ctx:n,vault:i,currentFolderPath:a,currentPageTitle:o}=t;if(!a)throw new Error("currentFolderPath is required for synced blocks");let s=`${o||"Page"} synced block`;try{let c=await e.blocks.retrieve({block_id:r});if(!("type"in c))throw new Error(`Retrieved block ${r} is partial, cannot process synced block`);let p=c.has_children?await Oo(r,e,n,t.blocksCache):[],f=un(i,a,`${s}.md`),d={...t,currentFilePath:f,isProcessingSyncedBlock:!0},g=await Mo(p,d),m=Mi(g,"SYNCED_CHILD_PAGE");if(t.syncedChildPagePlaceholders&&m.length>0){let b=t.syncedChildPagePlaceholders.get(f)||new Set;m.forEach(_=>b.add(_)),t.syncedChildPagePlaceholders.set(f,b)}let h=Mi(g,"SYNCED_CHILD_DATABASE");if(t.syncedChildDatabasePlaceholders&&h.length>0){let b=t.syncedChildDatabasePlaceholders.get(f)||new Set;h.forEach(_=>b.add(_)),t.syncedChildDatabasePlaceholders.set(f,b)}return await i.create(f,g),console.log(`Created synced block file: ${f}`),f}catch(c){let u=c instanceof Error?c.message:String(c);throw console.error(`Failed to create synced block file "${s}":`,c),t.ctx.reportFailed(`Synced block: ${s}`,u),c}}async function nE(r,t){if(r.type!=="synced_block")return"";let e=r.synced_block;if(!e)return"";let{syncedBlocksMap:n}=t;if(!n)return console.error("syncedBlocksMap is required for synced blocks"),"";let a=e.synced_from===null?r.id:e.synced_from.block_id,o=n.get(a);if(!o)try{o=await rE(a,t),n.set(a,o)}catch(s){let c=s instanceof Error?s.message:String(s);return console.error(`Failed to process synced block ${a}:`,s),`<!-- Failed to import synced block: ${c} -->`}let l=t.vault.getAbstractFileByPath((0,zn.normalizePath)(o));if(l&&l instanceof zn.TFile){let s=t.currentFilePath||t.currentFolderPath;return`!${t.app.fileManager.generateMarkdownLink(l,s)}`}else{let{basename:s}=le(o);return`![[${s}]]`}}async function iE(r,t){if(r.type!=="toggle")return"";let n=r.toggle,i=sr(n.rich_text,t);return await Eg(i,r,t,"toggle block")}async function aE(r,t){if(r.type!=="table")return"";let i=r.table.table_width||0,a=new Array(i).fill("left"),o=await Io({block:r,client:t.client,ctx:t.ctx,blocksCache:t.blocksCache,processor:async l=>{let s=[];for(let c=0;c<l.length;c++){let u=l[c];if(u.type!=="table_row")continue;let f=u.table_row;if(!f.cells)continue;let d=f.cells,g=[];for(let m=0;m<d.length;m++){let h=d[m],b=sr(h,t);b=b.replace(/\n/g,"<br>"),b.trim()||(b=" "),g.push(b)}if(s.push("| "+g.join(" | ")+" |"),c===0){let m=a.map(h=>{switch(h){case"left":return"---";case"center":return":---:";case"right":return"---:";default:return"---"}});s.push("| "+m.join(" | ")+" |")}}return s},errorContext:"table"});return!o||o.length===0?"":o.join(`
`)}async function oE(r,t){if(r.type!=="numbered_list_item")return"";let e=t.indentLevel||0;t.listCounters||(t.listCounters=new Map);let n=(t.listCounters.get(e)||0)+1;t.listCounters.set(e,n);let a=" ".repeat(e)+`${n}. `+sr(r.numbered_list_item.rich_text,t),o=await pn(r,t,e+1,"numbered list item");return o&&(a+=`
`+o),a}async function sE(r,t){if(r.type!=="quote")return"";let e="> "+sr(r.quote.rich_text,t),n=await pn(r,t,0,"quote block");if(n){let i=n.split(`
`).map(a=>`> ${a}`).join(`
`);e+=`
`+i}return e}async function lE(r,t){if(r.type!=="callout")return"";let n=r.callout,i=n.icon&&"emoji"in n.icon?n.icon.emoji:"\u{1F4CC}",a=sr(n.rich_text,t),o="note";i==="\u{1F4A1}"||i==="\u26A1"?o="tip":i==="\u26A0\uFE0F"||i==="\u2757"?o="warning":i==="\u274C"||i==="\u{1F6AB}"?o="danger":i==="\u2705"||i==="\u2714\uFE0F"?o="success":i==="\u2139\uFE0F"||i==="\u2139"?o="info":(i==="\u2753"||i==="\u{1F914}")&&(o="question");let l=`> [!${o}] ${i}
`;l+=`> ${a}`;let s=await pn(r,t,0,"callout block");if(s){let c=s.split(`
`).map(u=>`> ${u}`).join(`
`);l+=`
`+c}return l}function cE(r){return r.type!=="divider"?"":"---"}function uE(r){if(r.type!=="equation")return"";let e=r.equation;return e.expression?`$$
${e.expression}
$$`:""}function pE(r,t){if(r.type!=="code")return"";let n=r.code;if(!n)return"";let i=n.rich_text.map(o=>o.plain_text||"").join("");return`\`\`\`${n.language||""}
${i}
\`\`\``}async function $o(r,t,e){let{type:n,isEmbed:i,fallbackText:a,beforeDownload:o}=e,l=gg(r);if(!l)return"";let s=qi(r);if(o){let c=o(l,r);if(c!==null)return c}try{return await Do(l,t,{caption:s,isEmbed:i,fallbackText:a})}catch(c){let u=c instanceof Error?c.message:String(c);console.error(`Failed to convert ${n} block:`,c),t.ctx.reportFailed(`${n.charAt(0).toUpperCase()+n.slice(1)} attachment`,u);let p=s||l.name||a;return`${i?"!":""}[${p}](${l.url})`}}async function dE(r,t){return r.type!=="image"?"":$o(r,t,Lo.image)}function fE(r){return r.includes("youtube.com")||r.includes("youtu.be")}async function mE(r,t){return r.type!=="video"?"":$o(r,t,{...Lo.video,beforeDownload:(e,n)=>e.type==="external"&&fE(e.url)?`![${qi(n)||""}](${e.url})`:null})}async function hE(r,t){return r.type!=="file"?"":$o(r,t,Lo.file)}async function gE(r,t){return r.type!=="pdf"?"":$o(r,t,Lo.pdf)}function bE(r){return r.includes("youtube.com")||r.includes("youtu.be")||r.includes("twitter.com")||r.includes("x.com")}function yE(r){if(r.type!=="bookmark")return"";let n=r.bookmark.url||"",i=qi(r);return i?`[${i}](${n})`:`[${n}](${n})`}function xE(r){if(r.type!=="embed")return"";let n=r.embed.url||"",i=qi(r);return bE(n)?`![${i||""}](${n})`:i?`[${i}](${n})`:`[${n}](${n})`}function wE(r){if(r.type!=="link_preview")return"";let n=r.link_preview.url||"";return`[${n}](${n})`}function sr(r,t){return!r||r.length===0?"":r.map(e=>{var a;let n=e.type,i="";return n==="text"?i=e.plain_text||"":n==="mention"?i=vE(e,t):n==="equation"&&(i=`$${(((a=e.equation)==null?void 0:a.expression)||"").trim()}$`),e.annotations&&n!=="equation"&&(e.annotations.bold&&(i=`**${i}**`),e.annotations.italic&&(i=`*${i}*`),e.annotations.code&&(i=`\`${i}\``),e.annotations.strikethrough&&(i=`~~${i}~~`),e.annotations.underline&&(i=`<u>${i}</u>`),e.annotations.color&&e.annotations.color.includes("background")&&(i=`==${i}==`)),e.href&&n!=="mention"&&(i=`[${i}](${e.href})`),i}).join("")}function vE(r,t){var i,a,o;let e=r.mention;if(!e)return r.plain_text||"";switch(e.type){case"database":return t!=null&&t.mentionedIds&&t.mentionedIds.add(e.database.id),Ht("NOTION_DB",e.database.id);case"page":return t!=null&&t.mentionedIds&&t.mentionedIds.add(e.page.id),Ht("NOTION_PAGE",e.page.id);case"date":let l=e.date,s="";return l.start&&(s=l.start,l.end&&(s+=` \u2192 ${l.end}`)),` ${s} `;case"link_mention":let c=((i=e.link_mention)==null?void 0:i.href)||"";return`[${((a=e.link_mention)==null?void 0:a.title)||r.plain_text||c}](${c})`;case"user":let p=e.user;if(p){let g=p.name||r.plain_text||"";return p.type==="person"&&((o=p.person)!=null&&o.email)?` [${g}](mailto:${p.person.email}) `:` ${g} `}return` ${r.plain_text||""} `;default:return` ${r.plain_text||""} `}}var Wt=require("obsidian");var it={CHECKBOX:"checkbox",DATE:"date",DATETIME:"datetime",MULTITEXT:"multitext",NUMBER:"number",TEXT:"text"};async function EE(r,t){var i;if(r.type!=="child_database")return"";let e=r.id,n="Untitled Database";try{let a=await Bo(e,t);n=a.sanitizedTitle;let o=t.vault.getAbstractFileByPath((0,Wt.normalizePath)(a.baseFilePath));if(o&&o instanceof Wt.TFile){let l=t.currentFilePath||t.currentPageFolderPath;return`!${t.app.fileManager.generateMarkdownLink(o,l)}`}else return`![[${a.sanitizedTitle}.base]]`}catch(a){let o=a instanceof Error?a.message:String(a);return o.includes("Linked database")||o.includes("not supported by Notion API")?(console.log(`Skipping linked database (block ID: ${e})`),"<!-- Linked database (not supported by Notion API) -->"):(o.includes("Could not find database with ID")||o.includes("APIResponseError"))&&((i=r.child_database)==null?void 0:i.title)==="Untitled"&&!r.has_children?(console.log(`Skipping linked database view (block ID: ${e}) - this is a reference to an existing database`),"<!-- Linked database view (skipped - references an existing database) -->"):(console.error(`Failed to convert database "${n}":`,a),t.ctx.reportFailed(`Database: ${n}`,o),`<!-- Failed to import database: ${o} -->`)}}async function TE(r,t,e){var a;let n=[],i;do{let o=await _t(()=>r.dataSources.query({data_source_id:t,start_cursor:i,page_size:100}),e),l=o.results.filter(s=>s.object==="page");n.push(...l),i=o.has_more&&(a=o.next_cursor)!=null?a:void 0}while(i);return n}function _E(r){return r.title&&r.title.length>0?r.title.map(t=>t.plain_text).join(""):"Untitled Database"}async function Bo(r,t,e=!1){let{ctx:n,currentPageFolderPath:i,client:a,vault:o,formulaStrategy:l,processedDatabases:s,relationPlaceholders:c,importPageCallback:u,onPagesDiscovered:p,databasePropertyName:f="base"}=t,d,g="Untitled Database";if(e)d=r,n.status(`Processing database from data source: ${d}...`);else{let D=await _t(()=>a.databases.retrieve({database_id:r}),n),R=_E(D);if(g=_e(R||"Untitled Database"),n.status(`Processing database: ${g}...`),!D.data_sources||D.data_sources.length===0){let M="Linked database (not supported by Notion API)";throw console.warn(`Skipping linked database (ID: ${r}): ${M}`),new Error(M)}d=D.data_sources[0].id}let m=await _t(()=>a.dataSources.retrieve({data_source_id:d}),n),h=m.properties||{};if(e){let D=m,R=D.name||(D.title&&Array.isArray(D.title)?D.title.map(M=>{var I;return((I=M.text)==null?void 0:I.content)||M.plain_text||""}).join("").trim():null)||"Untitled Database";g=_e(R),n.status(`Processing database: ${g}...`)}let b=await TE(a,d,n);n.status(`Found ${b.length} pages in database ${g}`);let _=[];try{_=(await _t(()=>a.dataSources.listTemplates({data_source_id:d}),n)).templates||[],_.length>0&&n.status(`Found ${_.length} template(s) in database ${g}`)}catch(D){console.warn(`Failed to fetch templates for database ${g}:`,D)}p&&p(b.length);let N=(0,Wt.normalizePath)(i?`${i}/${g}`:g),k;await o.adapter.exists(N)?k=N:(k=Fo(o,i,g),await o.createFolder((0,Wt.normalizePath)(k)));let O=await AE({vault:o,databaseName:g,databaseFolderPath:k,dataSourceProperties:h,formulaStrategy:l,databasePropertyName:f}),{basename:w}=le(O),C=`${w}.base`;for(let D of b){if(n.isCancelled())break;await u(D.id,k,C)}if(_.length>0)for(let D of _){if(n.isCancelled())break;n.status(`Importing template: ${D.name}...`);let R=`${g} ${D.name}`;await u(D.id,k,void 0,R)}let y=PE(h,b);wg(t.app,y);let S={id:r,title:g,folderPath:k,baseFilePath:O,properties:h,dataSourceId:d};return s.set(r,S),await SE(b,h,c),{sanitizedTitle:g,baseFilePath:O,databasePages:b,dataSourceId:d,dataSourceProperties:h}}async function AE(r){let{vault:t,databaseName:e,databaseFolderPath:n,dataSourceProperties:i,formulaStrategy:a="hybrid",databasePropertyName:o="base"}=r,l=CE({databaseName:e,dataSourceProperties:i,formulaStrategy:a,databasePropertyName:o}),s=(0,Wt.normalizePath)(`${n}/${e}.base`);if(await t.adapter.exists(s)){let u=t.getAbstractFileByPath(s);return u instanceof Wt.TFile?await t.modify(u,l):await t.adapter.write(s,l),s}let c=un(t,n,`${e}.base`);return await t.create(c,l),c}function CE(r){let{databaseName:t,dataSourceProperties:e,formulaStrategy:n="hybrid",databasePropertyName:i="base"}=r,{formulas:a,regularProperties:o,titlePropertyName:l}=kE(e,n),s=["file.name"];for(let u of o)s.push(u.key);for(let u of a)s.push(u.key);let c={filters:{and:[`note["${i}"] == link("${t}.base")`]}};if(a.length>0){c.formulas={};for(let u of a){let p=u.key.replace(/^formula\./,"");c.formulas[p]=u.config.formula}}if(o.length>0||l){c.properties={},l&&(c.properties["file.name"]={displayName:l});for(let u of o)c.properties[u.key]={displayName:u.config.displayName}}return c.views=[{type:"table",name:"Table View",order:s}],`# ${t}
${(0,Wt.stringifyYaml)(c)}`}function kE(r,t="hybrid"){let e={},n=null;for(let[o,l]of Object.entries(r)){let s=l.type,c=l.name||o;switch(s){case"title":n=c;break;case"formula":let u=So(l.formula);if(t==="static")e[o]={displayName:c};else if(t==="hybrid")if(u&&Bi(u)){let f=hg(u,r);f&&(e[`formula.${o}`]={displayName:c,formula:f})}else console.warn(`\u26A0\uFE0F Formula "${c}" cannot be converted to Obsidian syntax, falling back to text property.`),console.warn(` Original: ${u}`),console.warn(" Reason: Contains unsupported functions (e.g., substring, slice, split, format, etc.)"),e[o]={displayName:c};break;case"relation":e[o]={displayName:c,isRelation:!0,relationConfig:l.relation};break;case"rollup":let p=NE(l.rollup);p?e[`formula.${o}`]={displayName:c,formula:p}:console.warn(`Failed to convert rollup property "${c}" to formula.`);break;case"button":break;default:e[o]={displayName:c}}}let i=[],a=[];for(let[o,l]of Object.entries(e))l.formula?i.push({key:o,config:l}):a.push({key:o,config:l});return{formulas:i,regularProperties:a,titlePropertyName:n}}function PE(r,t){let e={};for(let[n,i]of Object.entries(r)){let a=i.type,o=i.name||n;switch(a){case"checkbox":e[o]=it.CHECKBOX;break;case"date":let l=!1,s=!1;for(let c of t){let u=c.properties;if(u&&u[n]){let p=u[n];if(p.type==="date"&&p.date){if(p.date.end){l=!0;break}p.date.start&&p.date.start.includes("T")&&(s=!0)}}}l?e[o]=it.TEXT:e[o]=s?it.DATETIME:it.DATE;break;case"number":e[o]=it.NUMBER;break;case"select":case"status":e[o]=it.TEXT;break;case"multi_select":e[o]=it.MULTITEXT;break;case"title":break;case"rich_text":case"url":case"email":case"phone_number":e[o]=it.TEXT;break;case"formula":break;case"relation":e[o]=it.MULTITEXT;break;case"rollup":break;case"people":e[o]=it.MULTITEXT;break;case"files":e[o]=it.MULTITEXT;break;case"created_time":case"last_edited_time":e[o]=it.DATETIME;break;case"created_by":case"last_edited_by":e[o]=it.TEXT;break;case"button":break;case"place":e[o]=it.MULTITEXT;break;default:console.log(`Unsupported property type: ${a}, treating as text`),e[o]=it.TEXT}}return e}function NE(r){if(!r)return null;let t=r.relation_property_name||r.relation_property_key,e=r.rollup_property_name||r.rollup_property_key,n=r.function;if(!t||!n)return null;let i=t;switch(n){case"show_original":if(e){let a=e;return`note["${i}"].map(value.asFile().properties["${a}"])`}return`note["${i}"]`;case"show_unique":if(e){let a=e;return`note["${i}"].map(value.asFile().properties["${a}"]).flat().unique()`}return`note["${i}"].unique()`;case"count":return`note["${i}"].length`;case"count_values":if(e){let a=e;return`note["${i}"].map(value.asFile().properties["${a}"]).flat().length`}return`note["${i}"].length`;case"unique":if(e){let a=e;return`note["${i}"].map(value.asFile().properties["${a}"]).flat().unique().length`}return`note["${i}"].unique().length`;case"empty":if(e){let a=e;return`note["${i}"].filter(value.asFile().properties["${a}"] == null || value.asFile().properties["${a}"] == "" || (typeof value.asFile().properties["${a}"] == "object" && value.asFile().properties["${a}"].length == 0)).length`}return`if(note["${i}"].length == 0, 1, 0)`;case"not_empty":if(e){let a=e;return`note["${i}"].filter(value.asFile().properties["${a}"] != null && value.asFile().properties["${a}"] != "" && !(typeof value.asFile().properties["${a}"] == "object" && value.asFile().properties["${a}"].length == 0)).length`}return`if(note["${i}"].length > 0, 1, 0)`;case"percent_empty":if(e){let a=e,o=`note["${i}"].length`,l=`note["${i}"].filter(value.asFile().properties["${a}"] == null || value.asFile().properties["${a}"] == "" || (typeof value.asFile().properties["${a}"] == "object" && value.asFile().properties["${a}"].length == 0)).length`;return`if(${o} == 0, 0, (${l} / ${o}) * 100)`}return`if(note["${i}"].length == 0, 100, 0)`;case"percent_not_empty":if(e){let a=e,o=`note["${i}"].length`,l=`note["${i}"].filter(value.asFile().properties["${a}"] != null && value.asFile().properties["${a}"] != "" && !(typeof value.asFile().properties["${a}"] == "object" && value.asFile().properties["${a}"].length == 0)).length`;return`if(${o} == 0, 0, (${l} / ${o}) * 100)`}return`if(note["${i}"].length > 0, 100, 0)`;case"earliest_date":if(e){let a=e;return`${`note["${i}"].map(value.asFile().properties["${a}"]).filter(value != null).map(date(value)).sort()`}[0]`}return console.warn('\u26A0\uFE0F Rollup function "earliest_date" requires a target property.'),null;case"latest_date":if(e){let a=e;return`${`note["${i}"].map(value.asFile().properties["${a}"]).filter(value != null).map(date(value)).sort()`}[-1]`}return console.warn('\u26A0\uFE0F Rollup function "latest_date" requires a target property.'),null;case"date_range":if(e){let a=e,o=`note["${i}"].map(value.asFile().properties["${a}"]).filter(value != null).map(date(value)).sort()`,l=`${o}[0]`,s=`${o}[-1]`;return`(${l}).format("YYYY-MM-DD") + " \u2192 " + (${s}).format("YYYY-MM-DD")`}return console.warn('\u26A0\uFE0F Rollup function "date_range" requires a target property.'),null;default:return console.warn(`\u26A0\uFE0F Unsupported rollup function: "${n}"`),console.warn(" This rollup property will be skipped."),console.warn(" Please report this to the plugin developer if this is a valid Notion rollup function."),null}}async function SE(r,t,e){var i;let n={};for(let[a,o]of Object.entries(t))o.type==="relation"&&(n[a]=o);if(Object.keys(n).length!==0)for(let a of r){let o=a.properties;for(let[l,s]of Object.entries(n)){let c=o[l];if(c&&c.type==="relation"&&c.relation){let u=c.relation.map(p=>p.id);if(u.length>0){let p=s.type==="relation"&&"relation"in s&&((i=s.relation)==null?void 0:i.database_id)||"";e.push({pageId:a.id,propertyKey:l,relatedPageIds:u,targetDatabaseId:p})}}}}}function Tg(r,t,e){for(let n of r){if(n.id===t)return n;if(n.has_children){let i=[];if(e&&e.has(n.id)&&(i=e.get(n.id)),i.length>0){let a=Tg(i,t,e);if(a)return a}}}return null}async function _g(r,t,e){let n=Mi(r,"DATABASE_PLACEHOLDER");if(n.length===0)return r;let i=r;for(let a of n){let o=Ht("DATABASE_PLACEHOLDER",a),l=Tg(t,a,e.blocksCache);if(l&&l.type==="child_database")try{let s=await EE(l,e);i=i.replace(o,s)}catch(s){let c=s instanceof Error?s.message:String(s);console.error(`Failed to process database ${a}:`,s),i=i.replace(o,`<!-- Failed to import database: ${c} -->`)}else console.warn(`Database block not found for placeholder: ${a}`)}return i}var qo=class extends Ee{constructor(){super(...arguments);this.notionToken="";this.formulaStrategy="hybrid";this.downloadExternalAttachments=!1;this.singleLineBreaks=!1;this.coverPropertyName="cover";this.databasePropertyName="base";this.incrementalImport=!1;this.notionClient=null;this.processedPages=new Set;this.requestCount=0;this.totalNodesToImport=0;this.selectedNodeIds=new Set;this.pageTree=[];this.pageTreeContainer=null;this.listPagesButton=null;this.toggleSelectButton=null;this.outputRootPath="";this.processedDatabases=new Map;this.relationPlaceholders=[];this.processedPagesCount=0;this.attachmentsDownloaded=0;this.notionIdToPath=new Map;this.mentionPlaceholders=new Map;this.syncedBlocksMap=new Map;this.syncedChildPagePlaceholders=new Map;this.syncedChildDatabasePlaceholders=new Map}init(){this.addOutputLocationSetting("Notion"),new ne.Setting(this.modal.contentEl).setName("Notion API token").setDesc(this.createTokenDescription()).addText(l=>l.setPlaceholder("ntn_...").setValue(this.notionToken).onChange(s=>{this.notionToken=s.trim()}).then(s=>{s.inputEl.type="password"}));let e=new ne.Setting(this.modal.contentEl).setName("Select pages to import").setDesc('Click "Load" to see data you can import. If a page or database is missing, check that your Notion integration has access to it.'),n=null,i=null;e.addButton(l=>(n=l,l.setButtonText("Select all").onClick(()=>{this.toggleSelectButton=n,this.handleToggleSelectClick()}),l.buttonEl&&(l.buttonEl.addClass("notion-toggle-button"),l.buttonEl.style.display="none"),l)),e.addButton(l=>(i=l,l.setButtonText("Load").onClick(async()=>{try{this.listPagesButton=i,this.toggleSelectButton=n,await this.loadPageTree()}catch(s){console.error("[Notion Importer] Error in loadPageTree:",s),new ne.Notice(`Failed to load pages: ${Ct(s)}`)}}),l.buttonEl&&(l.buttonEl.addClass("notion-load-button"),l.buttonEl.addClass("mod-cta")),l));let a=this.modal.contentEl.createDiv();a.addClass("file-tree","publish-section"),this.pageTreeContainer=a.createDiv("publish-change-list"),this.pageTreeContainer.style.maxHeight="200px",this.pageTreeContainer.style.overflowY="auto",this.pageTreeContainer.style.border="1px solid var(--background-modifier-border)",this.pageTreeContainer.style.borderRadius="var(--radius-s)",this.pageTreeContainer.style.backgroundColor="var(--background-primary-alt)",this.pageTreeContainer.style.padding="var(--size-4-2)";let o=this.pageTreeContainer.createDiv();o.style.color="var(--text-muted)",o.style.fontSize="var(--font-ui-small)",o.style.textAlign="center",o.style.padding="30px 10px",o.setText('Click "Load" to load your Notion pages and databases.'),new ne.Setting(this.modal.contentEl).setName("Incremental import").setDesc("Adds a notion-id property to pages so that future imports can skip pages that have already been imported.").addToggle(l=>l.setValue(!1).onChange(s=>{this.incrementalImport=s})),new ne.Setting(this.modal.contentEl).setName("Convert formulas").setDesc(this.createFormulaStrategyDescription()).addDropdown(l=>{l.addOption("hybrid","Obsidian syntax").addOption("static","Static values").setValue("hybrid").onChange(s=>{this.formulaStrategy=s})}),new ne.Setting(this.modal.contentEl).setName("Download external attachments").setDesc(this.createAttachmentDescription()).addToggle(l=>{l.setValue(!1).onChange(s=>{this.downloadExternalAttachments=s})}),new ne.Setting(this.modal.contentEl).setName("Single line breaks").setDesc("Separate Notion blocks with only one line break instead of two. Some blocks (lists, toggles, tables) will still use double line breaks when required for proper Markdown syntax.").addToggle(l=>{l.setValue(!1).onChange(s=>{this.singleLineBreaks=s})}),new ne.Setting(this.modal.contentEl).setName("Cover property name").setDesc(this.createCoverPropertyDescription()).addText(l=>l.setPlaceholder("cover").setValue("cover").onChange(s=>{this.coverPropertyName=s.trim()||"cover"})),new ne.Setting(this.modal.contentEl).setName("Database property name").setDesc('Property name in page frontmatter to link pages to their database .base file (default: "base")').addText(l=>l.setPlaceholder("base").setValue("base").onChange(s=>{this.databasePropertyName=s.trim()||"base"}))}createTokenDescription(){let e=document.createDocumentFragment();return e.appendText("To get an API token create an integration in Notion and give it access to pages in your workspace. "),e.createEl("a",{text:"Get API token.",href:"https://www.notion.so/profile/integrations"}),e}createFormulaStrategyDescription(){let e=document.createDocumentFragment();return e.appendText("By default Notion formulas are converted to Obsidian syntax. If any Notion syntax is not supported the static values will be saved instead. Alternatively you can import all formulas as static values."),e}createAttachmentDescription(){let e=document.createDocumentFragment();return e.appendText("Download external attachments (external URLs) to local files. Notion-hosted files are always downloaded. "),e.createEl("br"),e.appendText("Attachments will be saved according to your vault's attachment folder settings."),e}createCoverPropertyDescription(){let e=document.createDocumentFragment();return e.appendText("Property name for page cover image in YAML frontmatter. "),e.createEl("br"),e.appendText(`Leave as "cover" if you don't have conflicts with existing properties.`),e}initializeNotionClient(){this.notionClient=new Ag.Client({auth:this.notionToken,notionVersion:"2025-09-03",fetch:async(e,n)=>{let i=e.toString();try{let a=await(0,ne.requestUrl)({url:i,method:(n==null?void 0:n.method)||"GET",headers:n==null?void 0:n.headers,body:n==null?void 0:n.body,throw:!1});return new Response(a.arrayBuffer,{status:a.status,statusText:a.status.toString(),headers:new Headers(a.headers)})}catch(a){throw console.error("Request failed:",a),a}}})}async loadPageTree(){var e;if(!this.notionToken){new ne.Notice("Please enter your Notion API token first.");return}if(this.listPagesButton){this.listPagesButton.setDisabled(!0),this.listPagesButton.setButtonText("Loading...");try{this.initializeNotionClient();let n={status:c=>{this.listPagesButton&&this.listPagesButton.setButtonText(c)},isCancelled:()=>!1,reportFailed:(c,u)=>{console.error(`Failed: ${c}`,u)},statusMessage:""},i=[],a,o=0;do{o++,n.status(`Loading... (${i.length} items, page ${o})`);let c=await _t(()=>this.notionClient.search({start_cursor:a,page_size:100}),n);i.push(...c.results),a=c.has_more?c.next_cursor:void 0}while(a);let l=new Set;for(let c of i)c.object==="data_source"?c.database_parent&&c.database_parent.type==="block_id"&&l.add(c.id):c.object==="page"&&c.parent&&c.parent.type==="block_id"&&l.add(c.id);let s=[];for(let c of i)if(!l.has(c.id)){if(c.object==="data_source"&&c.database_parent&&c.database_parent.type==="page_id"){let u=c.database_parent.page_id;if(l.has(u))continue}if(c.object==="page"&&c.parent&&c.parent.type==="data_source_id"){let u=c.parent.data_source_id;if(l.has(u))continue}if(c.object==="page"||c.object==="data_source"){let u=c.object==="data_source",p=this.extractItemTitle(c,u?"Untitled Database":"Untitled"),f=u?c.database_parent:c.parent,d=this.extractParentId(f,u?"database":"page");s.push({id:c.id,title:p,type:u?"database":"page",parentId:d})}}this.pageTree=this.buildTree(s),this.renderPageTree(),this.toggleSelectButton&&this.toggleSelectButton.buttonEl&&(this.toggleSelectButton.buttonEl.style.display=""),new ne.Notice(`Found ${s.length} pages and databases.`)}catch(n){console.error("[Notion Importer] Failed to load pages:",n),new ne.Notice(`Failed to load pages: ${(e=Ct(n))!=null?e:"Unknown error"}`)}finally{this.listPagesButton&&(this.listPagesButton.setDisabled(!1),this.listPagesButton.setButtonText("Refresh"))}}}extractItemTitle(e,n="Untitled"){let i;if(e.title)i=e.title;else if(e.properties)for(let o in e.properties){let l=e.properties[o];if(l.type==="title"&&l.title){i=l.title;break}}return!i||!Array.isArray(i)?n:i.map(o=>{var l;return((l=o.text)==null?void 0:l.content)||o.plain_text||""}).join("").trim()||n}extractParentId(e,n){if(!e)return null;switch(e.type){case"page_id":return e.page_id;case"data_source_id":return e.data_source_id;case"database_id":return e.database_id;case"workspace":return null;case"block_id":return console.warn("[Notion Importer] block_id parent should be filtered before calling extractParentId"),null;default:let i=e;return console.warn(`[Notion Importer] Unexpected parent type for ${n}:`,i),null}}findNodeById(e,n){for(let i of e){if(i.id===n)return i;if(i.children.length>0){let a=this.findNodeById(i.children,n);if(a)return a}}return null}buildTree(e){let n=new Map,i=[];for(let o of e)n.set(o.id,{id:o.id,title:o.title,type:o.type,parentId:o.parentId,children:[],selected:!1,disabled:!1,collapsed:!0});for(let o of n.values())o.parentId&&n.has(o.parentId)?n.get(o.parentId).children.push(o):i.push(o);let a=o=>{o.sort((l,s)=>l.title.localeCompare(s.title));for(let l of o)a(l.children)};return a(i),i}renderPageTree(){if(this.pageTreeContainer||(this.pageTreeContainer=this.modal.contentEl.querySelector(".publish-change-list")),!this.pageTreeContainer){console.error("[Notion Importer] Container not found!");return}if(this.pageTreeContainer.empty(),this.pageTree.length===0){this.pageTreeContainer.createEl("div",{text:"No pages or databases found. Make sure your integration has access to the pages you want to import.",cls:"notion-tree-empty"});return}for(let e of this.pageTree)this.renderTreeNode(this.pageTreeContainer,e,0);this.toggleSelectButton&&this.updateToggleButtonText()}renderTreeNode(e,n,i){let a=e.createDiv("tree-item"),o=a.createDiv("tree-item-self");if(o.addClass("is-clickable"),n.children.length>0?(o.addClass("mod-collapsible"),o.addClass("mod-folder")):o.addClass("mod-file"),n.disabled&&(o.addClass("is-disabled"),o.style.opacity="0.5",o.style.pointerEvents="none"),n.children.length>0){let f=o.createDiv("tree-item-icon collapse-icon");(0,ne.setIcon)(f,"right-triangle"),n.collapsed&&(f.addClass("is-collapsed"),a.addClass("is-collapsed")),n.disabled&&(f.style.pointerEvents="auto");let d=a,g,m;f.addEventListener("click",h=>{h.stopPropagation(),n.collapsed=!n.collapsed,g||(g=d.querySelector(".tree-item-children")),m||(m=d.querySelector(".file-tree-item-icon")),n.collapsed?(f.addClass("is-collapsed"),d.addClass("is-collapsed"),g&&(g.style.display="none"),n.type!=="database"&&m&&(m.empty(),(0,ne.setIcon)(m,"folder"))):(f.removeClass("is-collapsed"),d.removeClass("is-collapsed"),g&&(g.style.display=""),n.type!=="database"&&m&&(m.empty(),(0,ne.setIcon)(m,"folder-open")))})}let l=o.createDiv("tree-item-inner file-tree-item"),s=l.createEl("input",{type:"checkbox",cls:"file-tree-item-checkbox"});s.checked=n.selected,s.disabled=n.disabled,n.disabled||s.addEventListener("change",()=>{this.toggleNodeSelection(n,s.checked),this.renderPageTree()});let c=l.createDiv("file-tree-item-icon");n.type==="database"?(0,ne.setIcon)(c,"database"):n.children.length>0?(0,ne.setIcon)(c,n.collapsed?"folder":"folder-open"):(0,ne.setIcon)(c,"file"),l.createDiv("file-tree-item-title").setText(n.title);let p=a.createDiv("tree-item-children");if(n.collapsed&&(p.style.display="none"),n.children.length>0)for(let f of n.children)this.renderTreeNode(p,f,i+1)}toggleNodeSelection(e,n){e.selected=n,n?this.selectAllChildren(e,!0):this.enableAllChildren(e)}selectAllNodes(e){let n=i=>{i.disabled||(i.selected=e,e?this.selectAllChildren(i,!0):this.enableAllChildren(i));for(let a of i.children)n(a)};for(let i of this.pageTree)n(i)}selectAllChildren(e,n){for(let i of e.children)i.selected=n,i.disabled=n,this.selectAllChildren(i,n)}enableAllChildren(e){for(let n of e.children)n.disabled=!1,n.selected=!1,this.enableAllChildren(n)}areAllNodesSelected(){let e=n=>{for(let i of n)if(!i.selected||!e(i.children))return!1;return!0};return e(this.pageTree)}handleToggleSelectClick(){if(this.pageTree.length===0){new ne.Notice("Please list importable pages first.");return}this.areAllNodesSelected()?this.selectAllNodes(!1):this.selectAllNodes(!0),this.renderPageTree()}updateToggleButtonText(){if(!this.toggleSelectButton)return;let e=this.areAllNodesSelected();this.toggleSelectButton.setButtonText(e?"Deselect all":"Select all")}getSelectedNodeIds(){let e=[],n=0;this.selectedNodeIds.clear();let i=a=>{for(let o of a)o.selected&&(o.type==="page"&&(n++,this.selectedNodeIds.add(o.id)),o.disabled||e.push(o.id)),i(o.children)};return i(this.pageTree),this.totalNodesToImport=n,e}async import(e){if(!this.notionToken){new ne.Notice("Please enter your Notion API token.");return}let n=this.getSelectedNodeIds();if(n.length===0){new ne.Notice("Please select at least one page or database to import.");return}let i=await this.getOutputFolder();if(!i){new ne.Notice("Please select a location to export to.");return}e.status("Connecting to Notion API...");try{this.initializeNotionClient(),e.status("Fetching page content from Notion..."),this.processedPages.clear(),this.processedDatabases.clear(),this.relationPlaceholders=[],this.processedPagesCount=0,this.attachmentsDownloaded=0,e.status(`Preparing to import ${this.totalNodesToImport} item(s)...`),e.reportProgress(0,this.totalNodesToImport),this.outputRootPath=i.path,e.status(`Importing ${n.length} item(s)...`);for(let a=0;a<n.length&&!e.isCancelled();a++){let o=n[a];e.status(`Importing item ${a+1}/${n.length}...`);try{let l=this.findNodeById(this.pageTree,o);if(!l){console.warn(`Could not find node with ID: ${o}`),e.reportFailed(`Import item ${o}`,"Item not found in tree");continue}l.type==="database"?await this.importTopLevelDatabase(e,o,i.path,{isDataSourceId:!0}):l.type==="page"?await this.fetchAndImportPage({ctx:e,pageId:o,parentPath:i.path}):(console.warn(`Unknown node type: ${l.type} (ID: ${o})`),e.reportFailed(`Import item ${o}`,`Unknown type: ${l.type}`))}catch(l){console.error(`Failed to import item ${o}:`,l),e.reportFailed(`Import item ${o}`,l)}}e.status("Processing relation links..."),await this.replaceRelationPlaceholders(e),e.status("Processing mention links..."),await this.replaceMentionPlaceholdersInAllFiles(e),e.status("Processing synced block child references..."),await this.replaceSyncedChildPlaceholders(e),this.incrementalImport||(e.status("Cleaning up notion-id attributes..."),await this.cleanupNotionIds(e)),e.status("Import completed successfully!")}catch(a){console.error("Notion API import error:",a),e.reportFailed("Notion API import",a),new ne.Notice(`Import failed: ${Ct(a)}`)}}async importTopLevelDatabase(e,n,i,a={}){if(e.isCancelled())return;let{isDataSourceId:o=!1}=a;try{await Bo(n,{ctx:e,currentPageFolderPath:i,currentFilePath:void 0,client:this.notionClient,vault:this.vault,app:this.app,outputRootPath:this.outputRootPath,formulaStrategy:this.formulaStrategy,processedDatabases:this.processedDatabases,relationPlaceholders:this.relationPlaceholders,databasePropertyName:this.databasePropertyName,importPageCallback:async(l,s,c,u)=>{await this.fetchAndImportPage({ctx:e,pageId:l,parentPath:s,databaseTag:c,customFileName:u})},onPagesDiscovered:l=>{}},o)}catch(l){throw console.error(`Failed to import database ${n}:`,l),l}}async fetchAndImportPage(e){let{ctx:n,pageId:i,parentPath:a,databaseTag:o,customFileName:l}=e;if(!n.isCancelled()&&!this.processedPages.has(i)){this.processedPages.add(i);try{let s=await _t(()=>this.notionClient.pages.retrieve({page_id:i}),n),c=yg(s),u=l?_e(l):_e(c||"Untitled");n.status(`Importing: ${u}`);let p=new Map,f=await hc(this.notionClient,i,n);p.set(i,f);let d=await gc(this.notionClient,f,n,p),g,m,h=!1;if(d){let w=(0,ne.normalizePath)(a?`${a}/${u}`:u);this.vault.getAbstractFileByPath(w)instanceof ne.TFolder?g=w:(g=Fo(this.vault,a,u),await this.createFolders(g));let y=`${u}.md`,S=(0,ne.normalizePath)(`${g}/${y}`);h=await this.shouldSkipExistingFile(S,i,n),m=S}else{g=a;let w=await this.getUniqueFilePathWithIncrementalCheck(a,`${u}.md`,i,n);if(!w){this.selectedNodeIds.has(i)&&(this.processedPagesCount++,n.reportProgress(this.processedPagesCount,this.totalNodesToImport));return}m=w}let{parent:b}=le(m),_=new Set,N=await Mo(f,{ctx:n,currentFolderPath:b,currentFilePath:m,client:this.notionClient,vault:this.vault,app:this.app,downloadExternalAttachments:this.downloadExternalAttachments,singleLineBreaks:this.singleLineBreaks,incrementalImport:this.incrementalImport,indentLevel:0,blocksCache:p,mentionedIds:_,syncedBlocksMap:this.syncedBlocksMap,outputRootPath:this.outputRootPath,syncedChildPagePlaceholders:this.syncedChildPagePlaceholders,syncedChildDatabasePlaceholders:this.syncedChildDatabasePlaceholders,currentPageTitle:u,importPageCallback:async(w,C)=>{await this.fetchAndImportPage({ctx:n,pageId:w,parentPath:C})},onAttachmentDownloaded:()=>{this.attachmentsDownloaded++,n.attachments=this.attachmentsDownloaded,n.attachmentCountEl.setText(this.attachmentsDownloaded.toString())},getAvailableAttachmentPath:async w=>await this.getAvailablePathForAttachment(w,[],m)});N=await _g(N,f,{ctx:n,currentPageFolderPath:g,currentFilePath:m,client:this.notionClient,vault:this.vault,app:this.app,outputRootPath:this.outputRootPath,formulaStrategy:this.formulaStrategy,processedDatabases:this.processedDatabases,relationPlaceholders:this.relationPlaceholders,databasePropertyName:this.databasePropertyName,blocksCache:p,importPageCallback:async(w,C,y,S)=>{await this.fetchAndImportPage({ctx:n,pageId:w,parentPath:C,databaseTag:y,customFileName:S})},onPagesDiscovered:w=>{}}),p.clear();let k={"notion-id":s.id};o&&(k[this.databasePropertyName]=`[[${o}]]`);let O=await xg({page:s,formulaStrategy:this.formulaStrategy,client:this.notionClient,ctx:n,vault:this.vault,app:this.app,currentFilePath:m,currentFolderPath:g,downloadExternalAttachments:this.downloadExternalAttachments,incrementalImport:this.incrementalImport,onAttachmentDownloaded:()=>{this.attachmentsDownloaded++,n.attachmentCountEl.setText(this.attachmentsDownloaded.toString())},getAvailableAttachmentPath:async w=>await this.getAvailablePathForAttachment(w,[],m)});for(let w in O)w!=="notion-id"&&(k[w]=O[w]);if(k.cover&&typeof k.cover=="string")try{let w=k.cover,C=!w.includes("secure.notion-static.com"),y=await fc({type:C?"external":"file",url:w,name:u},{ctx:n,currentFolderPath:b,currentFilePath:m,client:this.notionClient,vault:this.vault,app:this.app,downloadExternalAttachments:!0,incrementalImport:this.incrementalImport,currentPageTitle:u,getAvailableAttachmentPath:async S=>await this.getAvailablePathForAttachment(S,[],m)});if(y.isLocal&&y.filename){this.attachmentsDownloaded++,n.attachments=this.attachmentsDownloaded,n.attachmentCountEl.setText(this.attachmentsDownloaded.toString());let S=y.filename.substring(y.filename.lastIndexOf(".")),R=`[[${y.path+S}]]`;this.coverPropertyName!=="cover"?(delete k.cover,k[this.coverPropertyName]=R):k.cover=R}else if(console.warn(`Failed to download cover image, keeping original URL: ${y.path}`),this.coverPropertyName!=="cover"){let S=k.cover;delete k.cover,k[this.coverPropertyName]=S}}catch(w){console.error("Failed to download cover image:",w)}if(!h){let w=yr(k)+N;console.log(`[CREATE FILE] About to create file: ${m}, Page ID: ${i}, Page Title: ${u}`);let{parent:C,name:y}=le(m),S=un(this.vault,C,y);console.log(`[CREATE FILE] Final path after uniqueness check: ${S}`);try{let R={};s.created_time&&(R.ctime=new Date(s.created_time).getTime()),s.last_edited_time&&(R.mtime=new Date(s.last_edited_time).getTime()),await this.vault.create((0,ne.normalizePath)(S),w,R),console.log(`[CREATE FILE] Successfully created: ${S}`)}catch(R){throw console.error(`[CREATE FILE] Failed to create file: ${S}`),console.error(`[CREATE FILE] Page ID: ${i}, Page Title: ${u}`),console.error("[CREATE FILE] Error:",R),R}let D=S.replace(/\.md$/,"");this.notionIdToPath.set(i,D),_.size>0&&this.mentionPlaceholders.set(S,_)}this.selectedNodeIds.has(i)&&(this.processedPagesCount++,n.reportProgress(this.processedPagesCount,this.totalNodesToImport))}catch(s){console.error(`Failed to import page ${i}:`,s);let c=`Page ${i.substring(0,8)}...`,u=s instanceof Error?s.message:String(s);console.error(`Error details - Page ID: ${i}, Error: ${u}`),s instanceof Error&&s.stack&&console.error("Stack trace:",s.stack),n.reportFailed(c,u),this.selectedNodeIds.has(i)&&(this.processedPagesCount++,n.reportProgress(this.processedPagesCount,this.totalNodesToImport))}}}async replaceRelationPlaceholders(e){if(this.relationPlaceholders.length===0)return;e.status(`Replacing ${this.relationPlaceholders.length} relation placeholders...`);let n=1,i=0,a=10;for(;n<=a;){let o=this.relationPlaceholders.length;if(n>1&&o===i){e.status("No new relations discovered. Relation processing complete.");break}e.status(`Round ${n}: Processing ${o} relation placeholders...`),i=o;let l=new Set,s=new Set;for(let c of this.relationPlaceholders)for(let u of c.relatedPageIds)this.notionIdToPath.get(u)||(l.add(u),c.targetDatabaseId&&s.add(c.targetDatabaseId));if(s.size>0){e.status(`Round ${n}: Found ${s.size} unimported databases with relations. Importing...`);let c=this.outputRootPath,u=0;for(let p of s){if(e.isCancelled())break;if(!this.processedDatabases.has(p))try{await this.importUnimportedDatabase(e,p,c),u++}catch(f){console.error(`Failed to import unimported database ${p}:`,f)}}if(e.status(`Round ${n}: Imported ${u} databases.`),u>0){n++;continue}}break}n>a&&console.warn(`\u26A0\uFE0F Reached maximum rounds (${a}) for relation processing. Some relations may not be resolved.`),e.status("Replacing relation placeholders with wiki links...");for(let o of this.relationPlaceholders){if(e.isCancelled())break;try{let l=this.notionIdToPath.get(o.pageId);if(!l){console.warn(`Could not find file path for page: ${o.pageId}`);continue}let s=this.vault.getAbstractFileByPath(l+".md");if(!s||!(s instanceof ne.TFile)){console.warn(`Could not find page file: ${l}`);continue}let c=await this.vault.read(s),u=/^---\n([\s\S]*?)\n---/;if(!c.match(u)){console.warn(`No frontmatter found in file: ${s.path}`);continue}let f=c;for(let d of o.relatedPageIds){let g=this.notionIdToPath.get(d);if(g){let m=this.vault.getAbstractFileByPath(g+".md");if(m instanceof ne.TFile){let h=m.basename,b=`"[[${g}|${h}]]"`;f=f.replace(new RegExp(`${d}`,"g"),b)}else console.warn(`Could not find related page file: ${g}`)}else console.warn(`Could not find related page: ${d}`)}f!==c&&await ji(this.vault,s,f)}catch(l){let s=l instanceof Error?l.message:String(l);console.error(`Failed to replace relation placeholder for page ${o.pageId}:`,l),e.reportFailed(`Relation page ${o.pageId}`,s)}}}async importUnimportedDatabase(e,n,i){let a="Untitled Database";try{e.status(`Importing unimported database ${n}...`);let o={ctx:e,currentPageFolderPath:i,currentFilePath:void 0,client:this.notionClient,vault:this.vault,app:this.app,outputRootPath:this.outputRootPath,formulaStrategy:this.formulaStrategy,processedDatabases:this.processedDatabases,relationPlaceholders:this.relationPlaceholders,importPageCallback:async(s,c,u,p)=>{await this.fetchAndImportPage({ctx:e,pageId:s,parentPath:c,databaseTag:u,customFileName:p})},databasePropertyName:this.databasePropertyName};a=(await Bo(n,o)).sanitizedTitle}catch(o){let l=o instanceof Error?o.message:String(o);console.error(`Failed to import unimported database "${a}":`,o),e.reportFailed(`Database: ${a}`,l)}}async replaceMentionPlaceholdersInAllFiles(e){if(this.mentionPlaceholders.size===0)return;e.status("Replacing mention placeholders...");let n=0,i=0;for(let[a,o]of this.mentionPlaceholders){if(e.isCancelled())break;try{let l=this.vault.getAbstractFileByPath((0,ne.normalizePath)(a));if(!l||!(l instanceof ne.TFile)){console.warn(`Could not find source file: ${a}`);continue}let s=await this.vault.read(l),c=s;for(let u of o){let p;if(p=this.notionIdToPath.get(u),!p){let d=this.processedDatabases.get(u);d&&(p=d.baseFilePath.replace(/\.base$/,""))}if(!p){console.warn(`No mapping found for mention: ${u}`);continue}let f=this.vault.getAbstractFileByPath(p+".md");if(f||(f=this.vault.getAbstractFileByPath(p+".base")),f instanceof ne.TFile){let d=this.app.fileManager.generateMarkdownLink(f,l.path),g=new RegExp(`\\[\\[NOTION_(PAGE|DB):${u}\\]\\]`,"g"),m=s.match(g);m&&(s=s.replace(g,d),n+=m.length)}else console.warn(`Target file not found: ${p}`)}s!==c&&(await ji(this.vault,l,s),i++)}catch(l){let s=l instanceof Error?l.message:String(l);console.error(`Failed to process mentions in file ${a}:`,l),e.reportFailed(`Mention file ${a}`,s)}}e.status(`Replaced ${n} mention links in ${i} files.`)}async replaceSyncedChildPlaceholders(e){if(this.syncedChildPagePlaceholders.size===0&&this.syncedChildDatabasePlaceholders.size===0)return;e.status("Replacing synced block child references...");let n=0,i=0,a=0;for(let[o,l]of this.syncedChildPagePlaceholders){if(e.isCancelled())break;try{let s=this.vault.getAbstractFileByPath((0,ne.normalizePath)(o));if(!s||!(s instanceof ne.TFile)){console.warn(`Could not find synced block file: ${o}`);continue}let c=await this.vault.read(s),u=c;for(let p of l){let f=Ht("SYNCED_CHILD_PAGE",p);if(c.includes(f)){let d=this.notionIdToPath.get(p);if(!d)try{await this.fetchAndImportPage({ctx:e,pageId:p,parentPath:this.outputRootPath}),a++}catch(g){console.warn(`Failed to import synced child page ${p}:`,g),c=c.replace(f,"**Page** _(no access)_");continue}if(d=this.notionIdToPath.get(p),d){let g=this.vault.getAbstractFileByPath(d+".md");if(g&&g instanceof ne.TFile){let m=this.app.fileManager.generateMarkdownLink(g,s.path);c=c.replace(f,m),n++}}}}c!==u&&(await ji(this.vault,s,c),i++)}catch(s){let c=s instanceof Error?s.message:String(s);console.error(`Failed to process synced child page placeholders in file ${o}:`,s),e.reportFailed(`Synced block file ${o}`,c)}}for(let[o,l]of this.syncedChildDatabasePlaceholders){if(e.isCancelled())break;try{let s=this.vault.getAbstractFileByPath((0,ne.normalizePath)(o));if(!s||!(s instanceof ne.TFile)){console.warn(`Could not find synced block file: ${o}`);continue}let c=await this.vault.read(s),u=c;for(let p of l){let f=Ht("SYNCED_CHILD_DATABASE",p);if(c.includes(f)){let d=this.processedDatabases.get(p);if(!d)try{await this.importTopLevelDatabase(e,p,this.outputRootPath),a++}catch(g){console.warn(`Failed to import synced child database ${p}:`,g),c=c.replace(f,"**Database** _(no access)_");continue}if(d=this.processedDatabases.get(p),d){let g=d.baseFilePath.replace(/\.base$/,""),m=this.vault.getAbstractFileByPath(g+".base");if(m&&m instanceof ne.TFile){let h=this.app.fileManager.generateMarkdownLink(m,s.path);c=c.replace(f,h),n++}}}}c!==u&&(await ji(this.vault,s,c),i++)}catch(s){let c=s instanceof Error?s.message:String(s);console.error(`Failed to process synced child database placeholders in file ${o}:`,s),e.reportFailed(`Synced block file ${o}`,c)}}e.status(`Replaced ${n} synced child references in ${i} files (imported ${a} new items).`)}async shouldSkipExistingFile(e,n,i){let a=this.vault.getAbstractFileByPath((0,ne.normalizePath)(e));if(!a||!(a instanceof ne.TFile))return!1;try{let o=await this.vault.read(a),l=o.match(/^notion-id:\s*(.+)$/m);if(l&&l[1].trim()===n){let{basename:c}=le(e);i.reportSkipped(c,"already exists with same notion-id");let u=e.replace(/\.md$/,"");return this.notionIdToPath.set(n,u),await this.collectUnresolvedPlaceholders(o,n,e),!0}return!1}catch(o){return console.error(`Failed to read file ${e} for duplicate check:`,o),!1}}async collectUnresolvedPlaceholders(e,n,i){let a=/^---\n([\s\S]*?)\n---/,o=e.match(a);if(o){let m=o[1],h=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,b=m.match(h);if(b&&b.length>0){let _=m.split(`
`),N=null,k=new Map;for(let O of _){let w=O.match(/^([a-zA-Z0-9_-]+):\s*$/);if(w){N=w[1];continue}if(N){let C=O.match(h);if(C)for(let y of C)O.includes(`[[${y}`)||(k.has(N)||k.set(N,[]),k.get(N).push(y))}}for(let[O,w]of k.entries())w.length>0&&this.relationPlaceholders.push({pageId:n,propertyKey:O,relatedPageIds:w,targetDatabaseId:""});k.size>0&&console.log(`[Incremental Import] Collected ${k.size} unresolved relation(s) from skipped file: ${n}`)}}let l=/\[\[NOTION_PAGE:([a-f0-9-]+)\]\]/g,s=/\[\[NOTION_DB:([a-f0-9-]+)\]\]/g,c=new Set,u;for(;(u=l.exec(e))!==null;)c.add(u[1]);for(;(u=s.exec(e))!==null;)c.add(u[1]);c.size>0&&(this.mentionPlaceholders.set(i,c),console.log(`[Incremental Import] Collected ${c.size} unresolved mention(s) from skipped file: ${i}`));let p=/\[\[SYNCED_CHILD_PAGE:([a-f0-9-]+)\]\]/g,f=/\[\[SYNCED_CHILD_DATABASE:([a-f0-9-]+)\]\]/g,d=new Set,g=new Set;for(;(u=p.exec(e))!==null;)d.add(u[1]);for(;(u=f.exec(e))!==null;)g.add(u[1]);d.size>0&&(this.syncedChildPagePlaceholders.set(i,d),console.log(`[Incremental Import] Collected ${d.size} unresolved synced child page(s) from skipped file: ${i}`)),g.size>0&&(this.syncedChildDatabasePlaceholders.set(i,g),console.log(`[Incremental Import] Collected ${g.size} unresolved synced child database(s) from skipped file: ${i}`))}async getUniqueFilePathWithIncrementalCheck(e,n,i,a){let o=e?`${e}/${n}`:n;return await this.shouldSkipExistingFile(o,i,a)?null:this.vault.getAbstractFileByPath((0,ne.normalizePath)(o))?un(this.vault,e,n):o}async cleanupNotionIds(e){if(this.notionIdToPath.size===0)return;let n=0,i=0;for(let a of this.notionIdToPath.values()){if(e.isCancelled())break;try{let o=this.vault.getAbstractFileByPath(a+".md");if(!o||!(o instanceof ne.TFile))continue;let l=await this.vault.read(o),s=/^---\n([\s\S]*?)\n---/,c=l.match(s);if(!c)continue;let u=c[1];if(!/^notion-id:\s*.+$/m.test(u))continue;let f=u.split(`
`).filter(g=>!g.match(/^notion-id:\s*.+$/)).join(`
`),d=l.replace(s,`---
${f}
---`);await ji(this.vault,o,d),n++}catch(o){console.error(`Failed to clean notion-id from file: ${a}`,o),i++}}n>0&&console.log(`\u2713 Cleaned notion-id from ${n} file(s)`),i>0&&console.warn(`\u26A0\uFE0F Failed to clean notion-id from ${i} file(s)`)}};function ji(r,t,e){return r.modify(t,e,{mtime:t.stat.mtime,ctime:t.stat.ctime})}var Ue=require("obsidian");function Ui(r){return r instanceof HTMLElement?r.style.fontFamily.includes("Consolas"):!1}function bc(r){return r!=null&&r instanceof HTMLParagraphElement&&Array.from(r.childNodes).every(t=>Ui(t)||Hi(t))}function yc(r){var t;return Ui(r)&&r.nodeName==="SPAN"&&xc(r).length===0&&Array.from(r.childNodes).every(e=>e.nodeType===Node.TEXT_NODE)&&!((t=r.textContent)!=null&&t.trim().includes(`
`))}function Cg(r){return Ui(r)&&!yc(r)}function Hi(r){return r instanceof HTMLBRElement}function xc(r){let t=[],e=r.nextSibling;for(;Ui(e)||Hi(e);)t.push(e),e=e.nextSibling;let n=t.findLastIndex(Ui);return n===-1?[]:(t.length=n+1,t)}var DE="http://www.w3.org/2003/InkML";var kg={color:"#000000",width:70,height:70,transparency:0};function RE(r){let t=r.match(/<\/(?:inkml:)?ink>/);return t&&t.index!==void 0?r.substring(0,t.index+t[0].length):r}function wc(r,t){let e=Array.from(r.getElementsByTagNameNS(DE,t));return e.length===0&&(e=Array.from(r.getElementsByTagName(t))),e}function OE(r){let t=new Map,e=wc(r,"brush");for(let n of e){let i=n.getAttributeNS("http://www.w3.org/XML/1998/namespace","id")||n.getAttribute("xml:id")||n.getAttribute("id");if(!i)continue;let a={...kg},o=wc(n,"brushProperty");for(let l of o){let s=l.getAttribute("name"),c=l.getAttribute("value");if(!(!s||c===null))switch(s){case"color":a.color=c;break;case"width":a.width=parseFloat(c);break;case"height":a.height=parseFloat(c);break;case"transparency":a.transparency=parseFloat(c);break}}t.set(i,a)}return t}function IE(r){let t=RE(r),n=new DOMParser().parseFromString(t,"text/xml"),i=n.querySelector("parsererror");if(i)throw new Error(`Failed to parse InkML: ${i.textContent}`);let a=OE(n),o=wc(n,"trace"),l=[];for(let s of o){let c=s.getAttributeNS("http://www.w3.org/XML/1998/namespace","id")||s.getAttribute("xml:id")||s.getAttribute("id")||"0",u=s.getAttribute("brushRef")||"";u.startsWith("#")&&(u=u.substring(1));let p=a.get(u)||kg,d=(s.textContent||"").replace(/\n/g,"").split(",").map(g=>g.trim().split(" ").filter(m=>m.length>0).map(m=>{let h=parseFloat(m);return Number.isInteger(h)?Math.round(h):Math.round(h*1e4)})).filter(g=>g.length>=2);l.push({id:c,coords:d,brush:p})}return l}function FE(r){let t=1/0,e=1/0,n=-1/0,i=-1/0;for(let a of r)for(let o of a.coords)o.length>=2&&(t=Math.min(t,o[0]),e=Math.min(e,o[1]),n=Math.max(n,o[0]),i=Math.max(i,o[1]));return{minX:t,minY:e,maxX:n,maxY:i}}function Pg(r){if(!r||r.trim().length===0)return null;let t=IE(r);if(t.length===0)return null;let{minX:e,minY:n,maxX:i,maxY:a}=FE(t),o=i-e+10*2,l=a-n+10*2,s=[];for(let c of t){if(c.coords.length===0)continue;let u=c.brush.color,p=c.brush.width,f=1-c.brush.transparency,d=f<1?` opacity="${f.toFixed(2)}"`:"";if(c.coords.length===1){let g=c.coords[0][0]-e+10,m=c.coords[0][1]-n+10;s.push(`<circle cx="${g}" cy="${m}" r="${p/2}" fill="${u}"${d}/>`)}else{let g=c.coords.map((m,h)=>{let b=m[0]-e+10,_=m[1]-n+10;return h===0?`M ${b} ${_}`:`L ${b} ${_}`}).join(" ");s.push(`<path d="${g}" stroke="${u}" stroke-width="${p}" fill="none" stroke-linecap="round" stroke-linejoin="round"${d}/>`)}}return`<svg xmlns="http://www.w3.org/2000/svg" width="${o}" height="${l}" viewBox="0 0 ${o} ${l}">${s.join(`
`)}</svg>`}var Og=Yn(Ng()),Ec="onenote-importer-refresh-token",Sg="66553851-08fa-44f2-8bb1-1436f121a73d",Dg=["user.read","notes.read"],LE=/<(object|iframe)([^>]*)\/>/g,Rg=/(<\/p>)\s*(<p[^>]*>)|\n \n/g,ME=5,$E=new RegExp(/^data:[\w\d]+\/[\w\d]+;base64,/);function BE(r){throw new Error("Didn't expect to get here")}function qE(r){if(r==null)throw new Error("response is nullish");if(typeof r!="object")throw new Error("response is not an object type");if("@odata.nextLink"in r){let t=r["@odata.nextLink"];if(typeof t!="string")throw new Error(`Link of unknown type: ${typeof t}`)}if(!("value"in r))throw new Error("Expected response to have a 'value' property");if(!Array.isArray(r.value))throw new Error("Expected response to have an error in 'value' property")}function jE(r){return r instanceof HTMLElement}var jo=class extends Ee{constructor(){super(...arguments);this.importPreviouslyImported=!1;this.importIncompatibleAttachments=!1;this.selectedIds=[];this.notebooks=[];this.graphData={state:_n(32),accessToken:""};this.attachmentDownloadPauseCounter=0;this.rememberMe=!1;this.lastSuccessfulFetchTime=performance.now()}async init(){this.addOutputLocationSetting("OneNote"),new Ue.Setting(this.modal.contentEl).setName("Import incompatible attachments").setDesc("Imports incompatible attachments which cannot be embedded in Obsidian, such as .exe files.").addToggle(i=>i.setValue(!1).onChange(a=>this.importIncompatibleAttachments=a)),new Ue.Setting(this.modal.contentEl).setName("Skip previously imported").setDesc("If enabled, notes imported previously by this plugin will be skipped.").addToggle(i=>i.setValue(!0).onChange(a=>this.importPreviouslyImported=!a));let e=!1;if(this.retrieveRefreshToken())try{await this.updateAccessToken(),e=!0}catch(i){}this.microsoftAccountSetting=new Ue.Setting(this.modal.contentEl).setName("Sign in with your Microsoft account").setDesc("You need to sign in to import your OneNote data.").addButton(i=>i.setCta().setButtonText("Sign in").onClick(()=>{this.registerAuthCallback(this.authenticateUser.bind(this));let a=new URLSearchParams({client_id:Sg,scope:"offline_access "+Dg.join(" "),response_type:"code",redirect_uri:Uo,response_mode:"query",state:this.graphData.state});window.open(`https://login.microsoftonline.com/common/oauth2/v2.0/authorize?${a.toString()}`)})),this.microsoftAccountSetting.settingEl.toggle(!e);let n=new Ue.Setting(this.modal.contentEl).setName("Remember me").setDesc("If checked, you will be automatically logged in for subsequent imports.").addToggle(i=>{i.onChange(a=>{this.rememberMe=a,a&&this.refreshToken?this.storeRefreshToken(this.refreshToken):this.clearStoredRefreshToken()})});n.settingEl.toggle(!e),this.switchUserSetting=new Ue.Setting(this.modal.contentEl).addButton(i=>i.setCta().setButtonText("Switch user").onClick(()=>{this.microsoftAccountSetting.settingEl.show(),n.settingEl.show(),this.clearStoredRefreshToken(),this.switchUserSetting.settingEl.hide(),this.contentArea.empty()})),this.loadingArea=this.modal.contentEl.createDiv({text:"Loading notebooks..."}),this.loadingArea.hide(),this.contentArea=this.modal.contentEl.createDiv(),this.contentArea.hide(),e?(await this.setSwitchUser(),await this.showSectionPickerUI()):this.switchUserSetting.settingEl.hide()}async authenticateUser(e){try{if(e.state!==this.graphData.state)throw new Error(`An incorrect state was returned.
Expected state: ${this.graphData.state}
Returned state: ${e.state}`);await this.updateAccessToken(e.code),await this.setSwitchUser(),await this.showSectionPickerUI()}catch(n){console.error("An error occurred while we were trying to sign you in. Error details: ",n),this.modal.contentEl.createEl("div",{text:"An error occurred while trying to sign you in."}).createEl("details",{text:String(n)}).createEl("summary",{text:"Click here to show error details"})}}async setSwitchUser(){let e=await this.fetchResource("https://graph.microsoft.com/v1.0/me","json");this.switchUserSetting.setDesc(`Signed in as ${e.displayName} (${e.mail}). If that's not the correct account, sign in again.`),this.switchUserSetting.settingEl.show(),this.microsoftAccountSetting.settingEl.hide()}async updateAccessToken(e){let n=new URLSearchParams({client_id:Sg,scope:"offline_access "+Dg.join(" "),redirect_uri:Uo});if(e)n.set("code",e),n.set("grant_type","authorization_code");else{let a=this.retrieveRefreshToken();if(!a)throw new Error("Missing token required for authentication. Please try logging in again.");n.set("refresh_token",a),n.set("grant_type","refresh_token")}let i=await(0,Ue.requestUrl)({method:"POST",url:"https://login.microsoftonline.com/common/oauth2/v2.0/token",contentType:"application/x-www-form-urlencoded",body:n.toString()}).json;if(!i.access_token)throw new Error(`Unexpected data was returned instead of an access token. Error details: ${i}`);i.refresh_token&&this.storeRefreshToken(i.refresh_token),this.graphData.accessToken=i.access_token}storeRefreshToken(e){this.refreshToken=e,this.rememberMe&&localStorage.setItem(Ec,e)}retrieveRefreshToken(){return this.refreshToken?this.refreshToken:localStorage.getItem(Ec)}clearStoredRefreshToken(){localStorage.removeItem(Ec)}async showSectionPickerUI(){var a,o;this.loadingArea.show(),this.selectedIds=[];let e="https://graph.microsoft.com/v1.0/me/onenote/notebooks",n=new URLSearchParams({$expand:"sections($select=id,displayName),sectionGroups($expand=sections,sectionGroups)",$select:"id,displayName,lastModifiedDateTime",$orderby:"lastModifiedDateTime DESC"}),i=`${e}?${n.toString()}`;try{this.notebooks=(await this.fetchResource(i,"json-wrapped")).value,this.contentArea.empty(),this.contentArea.createEl("h4",{text:"Choose data to import"});for(let l of this.notebooks){if(((a=l.sectionGroups)==null?void 0:a.length)!==0)for(let c of l.sectionGroups)await this.fetchNestedSectionGroups(c);let s=this.contentArea.createDiv();new Ue.Setting(s).setName(l.displayName).setDesc(`Last edited on: ${Ue.moment.utc(l.lastModifiedDateTime).format("Do MMMM YYYY")}. Contains ${(o=l.sections)==null?void 0:o.length} sections.`).addButton(c=>c.setCta().setButtonText("Select all").onClick(()=>{s.querySelectorAll('input[type="checkbox"]:not(:checked)').forEach(u=>u.click())})),this.renderHierarchy(l,s)}}catch(l){console.error("An error occurred while fetching your OneNote data: ",l),this.showContentAreaErrorMessage()}this.loadingArea.hide(),this.contentArea.show()}async fetchNestedSectionGroups(e){if(e.sectionGroups=(await this.fetchResource(e.sectionGroupsUrl+"?$expand=sectionGroups($expand=sections),sections","json-wrapped")).value,e.sectionGroups)for(let n=0;n<e.sectionGroups.length;n++)await this.fetchNestedSectionGroups(e.sectionGroups[n])}renderHierarchy(e,n){if(e.sectionGroups)for(let i of e.sectionGroups){let a=n.createDiv({attr:{style:"padding-inline-start: 1em; padding-top: 8px"}});a.createEl("strong",{text:i.displayName}),this.renderHierarchy(i,a)}if(e.sections){let i=n.createEl("ul",{attr:{style:"padding-inline-start: 1em;"}});for(let a of e.sections){let l=i.createEl("li",{cls:"task-list-item"}).createEl("label"),s=l.createEl("input");s.type="checkbox",l.appendChild(document.createTextNode(a.displayName)),l.createEl("br"),s.addEventListener("change",()=>{if(s.checked)this.selectedIds.push(a.id);else{let c=this.selectedIds.findIndex(u=>u===a.id);c!==-1&&this.selectedIds.splice(c,1)}})}}}showContentAreaErrorMessage(){this.contentArea.empty(),this.contentArea.createEl("p",{text:"Microsoft OneNote has limited how fast notes can be imported. Please try again in 1 hour to continue importing."}),this.contentArea.show(),this.loadingArea.hide()}async import(e){var c,u;let n=new Set,i=await this.modal.plugin.loadData();i.importers.onenote||(i.importers.onenote={previouslyImportedIDs:[]});for(let p of i.importers.onenote.previouslyImportedIDs)n.add(p);if(!await this.getOutputFolder()){new Ue.Notice("Please select a location to export to.");return}if(!this.graphData.accessToken){new Ue.Notice("Please sign in to your Microsoft Account.");return}e.status("Starting OneNote import");let o=0,l=0,s=0;for(let p of this.selectedIds){let f=`https://graph.microsoft.com/v1.0/me/onenote/sections/${p}/pages`,d=new URLSearchParams({$select:"id,title,createdDateTime,lastModifiedDateTime,level,order,contentUrl",$orderby:"order",pagelevel:"true"}),g=`${f}?${d.toString()}`,m=null;try{m=(await this.fetchResource(g,"json-wrapped",e)).value}catch(h){console.error(`Failed to fetch pages for section ${p}, skipping to next section.`,h),e.status("Failed to fetch pages for a section, skipping to next section.");return}if(m){o+=m.length,this.insertPagesToSection(m,p),e.reportProgress(l,o);for(let h=0;h<m.length;h++){if(e.isCancelled())return;let b=m[h];if(b.title||(b.title=`Untitled-${(0,Ue.moment)().format("YYYYMMDDHHmmss")}`),!this.importPreviouslyImported&&b.id&&n.has(b.id)){e.reportSkipped(b.title,"it was previously imported");continue}try{e.status(`Importing note ${b.title}`),await this.processFile(e,await this.fetchResource(`https://graph.microsoft.com/v1.0/me/onenote/pages/${b.id}/content?includeInkML=true`,"text",e),b),b.id&&(n.add(b.id),i.importers.onenote.previouslyImportedIDs=Array.from(n),await this.modal.plugin.saveData(i)),s=0}catch(_){if(s++,e.reportFailed(b.title,String(_)),s>5||this.modal.abortController.signal.aborted){let N=this.modal.abortController.signal.aborted?(c=Ct(_))!=null?c:String(_):"Microsoft OneNote returned too many consecutive errors.";e.status(N);for(let k=h+1;k<m.length;k++){let O=m[k];e.reportSkipped((u=O.title)!=null?u:"<unknown>","import was canceled (after too many pages failed to load)")}e.reportProgress(o,o);return}}e.reportProgress(++l,o)}}}}insertPagesToSection(e,n,i){if(!i){for(let a of this.notebooks)this.insertPagesToSection(e,n,a);return}if(i.sectionGroups){let a=i.sectionGroups;for(let o of a)this.insertPagesToSection(e,n,o)}if(i.sections){let a=i;for(let o of a.sections)o.id===n&&(o.pages=e)}}async processFile(e,n,i){var a,o;try{let l=this.convertFormat(n),s=await this.getOutputFolder(),c=this.getEntityPathNoParent(i.id,s.name),u;await this.vault.adapter.exists(c)?u=this.vault.getAbstractFileByPath(c):u=await this.vault.createFolder(c);let p="";try{let N=Pg(l.inkml);if(N){let k=`${i.title} - Ink.svg`;await this.vault.create(`${u.path}/${k}`,N),p=`
![[${k}]]
`,e.reportAttachmentSuccess(k)}}catch(N){console.error("Failed to convert InkML to SVG in page:",i.title,N)}let f=this.convertTags(At(l.html)),d=await this.getAllAttachments(e,f.replace(Rg,"<br />"));this.combineCodeBlocksAsNecessary(d),this.styledElementToHTML(d),this.convertInternalLinks(d),this.convertMathML(d),this.removeExtraListItemParagraphs(d),this.escapeTextNodes(d);let g=(0,Ue.htmlToMarkdown)(d).trim().replace(Rg," ");p&&(g+=p);let m=await this.saveAsMarkdownFile(u,i.title,g),h=i!=null&&i.lastModifiedDateTime?Date.parse(i.lastModifiedDateTime):null,b=i!=null&&i.createdDateTime?Date.parse(i.createdDateTime):null,_={ctime:(a=b!=null?b:h)!=null?a:Date.now(),mtime:(o=h!=null?h:b)!=null?o:Date.now()};await this.vault.append(m,"",_),e.reportNoteSuccess(i.title)}catch(l){e.reportFailed(i.title,l)}}convertMathML(e){var i,a;let n=Array.from(e.querySelectorAll("math"));for(let o of n)try{let l=o.outerHTML,c=`$${Og.MathMLToLaTeX.convert(l)}$`,u=document.createTextNode(c);(i=o.parentNode)==null||i.replaceChild(u,o)}catch(l){console.warn("Failed to convert MathML to LaTeX:",l);let s=document.createTextNode("[Math equation - conversion failed]");(a=o.parentNode)==null||a.replaceChild(s,o)}}isLatexMath(e){let n=e.trim();return n.startsWith("$")&&n.endsWith("$")||n.startsWith("$$")&&n.endsWith("$$")}escapeTextNodes(e){if(e.nodeType===Node.TEXT_NODE&&e.textContent){if(this.isLatexMath(e.textContent))return;e.textContent=e.textContent.replace(/([<>])/g,"\\$1")}else for(let n=0;n<e.childNodes.length;n++)this.escapeTextNodes(e.childNodes[n])}convertFormat(e){let n={html:"",inkml:""},i=e.split(`
`,1)[0];e.slice(0,-2);let a=e.split(i);if(a.shift(),a.length===2)for(let o of a){let s=o.split(`
`).find(u=>u.includes("Content-Type")).split(";")[0].split(":")[1].trim(),c=o.split(`
`).slice(2).join(`
`).trim();s==="text/html"?n.html=c:s==="application/inkml+xml"&&(n.inkml=c)}else throw new Error("The input string is incorrect and may be missing data. Inputted string: "+e);return n}convertTags(e){var i,a;let n=Array.from(e.querySelectorAll("[data-tag]"));for(let o of n)if((i=o.getAttribute("data-tag"))!=null&&i.contains("to-do")){let s=o.getAttribute("data-tag")==="to-do:completed"?"[x]":"[ ]";o.innerHTML=`- ${s} ${o.innerHTML}`}else{let l=(a=o.getAttribute("data-tag"))==null?void 0:a.split(",");l==null||l.forEach(s=>{o.innerHTML=o.innerHTML+` #${s.replace(":","-")} `})}return e.outerHTML}convertInternalLinks(e){let n=e.findAll("a");for(let i of n)if(i.href.startsWith("onenote:")){let a=i.href.indexOf("#")+1,o=i.href.indexOf("&",a);i.href=i.href.slice(a,o)}}getEntityPathNoParent(e,n){for(let i of this.notebooks){let a=this.getEntityPath(e,`${n}/${i.displayName}`,i);if(a)return a}return null}getEntityPath(e,n,i){let a=null;if("sectionGroups"in i&&i.sectionGroups){let o=this.searchSectionGroups(e,n,i.sectionGroups);o!==null&&(a=o)}if("sections"in i&&i.sections){let o=this.searchSectionGroups(e,n,i.sections);o!==null&&(a=o)}if("pages"in i&&i.pages){let o=this.searchPages(e,n,i);o!==null&&(a=o)}return a&&(a=this.sanitizeFilePath(a)),a}searchPages(e,n,i){var o;let a=null;for(let l=0;l<i.pages.length;l++){let s=i.pages[l],c=(o=s.contentUrl.split("page-id=")[1])==null?void 0:o.split("}")[0];if(s.id===e||c===e){if(s.level===0)i.pages[l+1]&&i.pages[l+1].level!==0?a=`${n}/${s.title}`:a=n;else{a=n;for(let u=i.pages.indexOf(s)-1;u>=0;u--)if(i.pages[u].level===s.level-1){a+="/"+i.pages[u].title;break}}break}}return a}searchSectionGroups(e,n,i){let a=null;for(let o of i)if(o.id===e)a=`${n}/${o.displayName}`;else{let l=this.getEntityPath(e,`${n}/${o.displayName}`,o);if(l){a=l;break}}return a}sanitizeOCRText(e){return e=e.replace(/[^\w\d\s.,!?]/g,""),e=e.replace(/\s+/g," ").trim(),e.length>50&&(e=e.substring(0,50)+"..."),e}async getAllAttachments(e,n){var s,c,u,p;let i=At(n.replace(LE,"<$1$2></$1>")),a=i.findAll("object"),o=i.findAll("img"),l=i.findAll("iframe");for(let f of a){for(;f.firstChild;)(s=f.parentNode)==null||s.insertBefore(f.firstChild,f.nextSibling);let d=f.getAttribute("data-attachment").split("."),g=d[d.length-1];if(!(!qn.contains(g)&&!this.importIncompatibleAttachments)){let m=f.getAttribute("data-attachment"),h=f.getAttribute("data"),b=await this.fetchAttachment(e,m,h),_=document.createElement("p");_.innerText=`![[${b}]]`,(c=f.parentNode)==null||c.replaceChild(_,f)}}for(let f=0;f<o.length;f++){let d=o[f],m=d.getAttribute("data-fullres-src-type").split("/")[1],b=`Exported image ${(0,Ue.moment)().format("YYYYMMDDHHmmss")}-${f}.${m}`,_=d.getAttribute("data-fullres-src"),N=await this.fetchAttachment(e,b,_);N&&(d.src=encodeURI(N),!d.alt||$E.test(d.alt)?d.alt="Exported image":d.alt=this.sanitizeOCRText(d.alt)||"Exported image")}for(let f of l)if(f.src.contains("youtube.com")||f.src.contains("youtu.be")){let d=document.createTextNode(`![Embedded YouTube video](${f.src})`);(u=f.parentNode)==null||u.replaceChild(d,f)}else{let d=document.createElement("a");d.href=f.src,(p=f.parentNode)==null||p.replaceChild(d,f)}return i}async fetchAttachment(e,n,i){this.attachmentDownloadPauseCounter===7&&await new Promise(a=>{e.status("Pausing attachment download to avoid rate limiting."),this.attachmentDownloadPauseCounter=0,setTimeout(a,3e3)}),this.attachmentDownloadPauseCounter++,e.status("Downloading attachment "+n);try{let a=await this.getAvailablePathForAttachment(n,[]),o=await this.fetchResource(i,"file",e);return await this.app.vault.createBinary(a,o),e.reportAttachmentSuccess(n),a}catch(a){e.reportFailed(n),console.error(a)}}combineCodeBlocksAsNecessary(e){let n=e.querySelectorAll("p:has(+ br + p)");Array.from(n).reverse().forEach(i=>{let a=i,o=i.nextElementSibling;if(!Hi(o))throw new Error(`Expected a <br> element after the paragraph, but found: ${o==null?void 0:o.nodeName}`);let l=o.nextElementSibling;bc(a)&&bc(l)&&(a.appendChild(o),a.appendChild(o.cloneNode()),a.insertAdjacentHTML("beforeend",l.innerHTML),l.remove())})}styledElementToHTML(e){let n={"font-weight:bold":"b","font-style:italic":"i","text-decoration:underline":"u","text-decoration:line-through":"s","background-color":"mark"};e.findAll("cite").forEach(o=>o.innerHTML="> "+o.innerHTML+"<br>"),e.querySelectorAll("*").forEach(o=>{if(e.contains(o))if(yc(o)){let l=document.createElement("code");l.innerHTML=o.innerHTML,o.replaceWith(l)}else if(Cg(o)){let l=[o.innerHTML];xc(o).forEach(c=>{l.push(Hi(c)?`
`:c.innerHTML),c.remove()});let s=document.createElement("pre");s.innerHTML="```\n"+l.join("")+"\n```",o.replaceWith(s)}else if(o.nodeName==="TD"){o.removeAttribute("style");return}else{let l=o.getAttribute("style")||"",s=Object.keys(n).find(c=>l.includes(c));if(s){let c=n[s],u=document.createElement(c);u.innerHTML=o.innerHTML,o.replaceWith(u)}}})}removeExtraListItemParagraphs(e){e.querySelectorAll("li > p:first-child").forEach(n=>{jE(n)&&n.style.marginBottom==="0pt"&&n.style.marginTop==="0pt"&&n.replaceWith(...Array.from(n.childNodes))})}async fetchResource(e,n,i,a=0){var s;if(a>=ME)throw new Error("Exceeded maximum retry attempts");let o=performance.now()-this.lastSuccessfulFetchTime,l=1e3*60*90;if(o>l&&this.modal.abortController.abort("stalled for >90 minutes"),this.modal.abortController.signal.aborted){let c=(s=this.modal.abortController.signal.reason)!=null?s:"no reason given";throw new Error(`The import was aborted (${c})`)}try{a>0&&console.log(`Retry attempt #${a} for ${e}`);let c=await fetch(e,{headers:{Authorization:`Bearer ${this.graphData.accessToken}`},signal:this.modal.abortController.signal});if(c.ok){let u;switch(n){case"text":u=await c.text();break;case"file":u=await c.arrayBuffer();break;case"json":u=await c.json();break;case"json-wrapped":u=await c.json(),qE(u),"@odata.nextLink"in u&&u.value.push(...(await this.fetchResource(u["@odata.nextLink"],"json-wrapped",i)).value);break;default:BE(n)}return this.lastSuccessfulFetchTime=performance.now(),u}else{let u=null,p=await c.json();if(p.hasOwnProperty("error")&&(u=p.error),console.log("An error has occurred while fetching an resource:",u||p),(u==null?void 0:u.code)==="40001"||(u==null?void 0:u.code)==="InvalidAuthenticationToken"||c.status===401)return await this.updateAccessToken(),this.fetchResource(e,n,i,a+1);if((u==null?void 0:u.code)==="20166"||c.status===429){let d=c.headers.get("Retry-After"),g=d?+d*1:60;return console.log(`Rate limit exceeded, waiting for: ${g} seconds`),await this.pause(g,"OneNote API is rate-limiting us",i),this.fetchResource(e,n,i,a)}return this.fetchResource(e,n,i,a+1)}}catch(c){return console.error(`An internal error occurred while trying to fetch '${e}'. Error details: `,c),this.fetchResource(e,n,i,a+1)}}};var Or=require("obsidian");var Ig=require("obsidian"),UE=/[\?<>\\:\*\|"]/g,HE=/[\x00-\x1f\x80-\x9f]/g,WE=/^\.+$/,VE=/^(con|prn|aux|nul|com[0-9]|lpt[0-9])(\..*)?$/i,zE=/[\. ]+$/,GE=/^\./,YE=/\[/g,ZE=/\]/g;function Ho(r){return r.replace(UE,"").replace(HE,"").replace(WE,"").replace(zE,"").replace(VE,"").replace(YE,"").replace(ZE,"").replace(GE,"")}function Wo(r,t){let e="MMMM Do, YYYY",n=(0,Ig.moment)(r,e);return n.format(e)!==r?r:n.isValid()?n.format(t):r}var Vo=require("obsidian"),KE=["POMO","word-count","date","slider","encrypt","TaoOfRoam","orphans","count","character-count","comment-button","query","streak","attr-table","mentions","search","roam/render","calc"],XE=new RegExp(`\\{\\{(\\[\\[)?(${KE.join("|")})(\\]\\])?.*?\\}\\}(\\})?`,"g"),JE=/{{pdf:|{{\[\[pdf|{{\[\[audio|{{audio:|{{video:|{{\[\[video/,Fg=/https:\/\/firebasestorage(.*?)\?alt(.*?)\)/,QE=/https:\/\/firebasestorage(.*?)\?alt(.*?)/,e1=/(?<=\(\()\b(.*?)\b(?=\)\))/g,zo=class extends Ee{constructor(){super(...arguments);this.downloadAttachments=!1;this.fileDateYAML=!1;this.titleYAML=!1;this.newestTimestamp=0;this.oldestTimestamp=0}init(){this.addFileChooserSetting("Roam (.json)",["json"]),this.addOutputLocationSetting("Roam"),this.userDNPFormat=this.getUserDNPFormat(),new Or.Setting(this.modal.contentEl).setName("Import settings").setHeading(),new Or.Setting(this.modal.contentEl).setName("Download all attachments").setDesc("If enabled, all attachments uploaded to Roam will be downloaded to your attachments folder.").addToggle(e=>{e.setValue(this.downloadAttachments),e.onChange(async n=>{this.downloadAttachments=n})}),new Or.Setting(this.modal.contentEl).setName("Add YAML created/update date").setDesc("If enabled, notes will have the create-time and edit-time from Roam added as properties.").addToggle(e=>{e.setValue(this.fileDateYAML),e.onChange(async n=>{this.fileDateYAML=n})}),new Or.Setting(this.modal.contentEl).setName("Add YAML title").setDesc("If enabled, notes will have the full title added as a property (regardless of illegal file name characters).").addToggle(e=>{e.setValue(this.titleYAML),e.onChange(async n=>{this.titleYAML=n})})}async import(e){this.progress=e;let{files:n}=this;if(n.length===0){new Or.Notice("Please pick at least one file to import.");return}let i=await this.getOutputFolder();if(!i){new Or.Notice("Please select a location to export to.");return}for(let a of n){if(e.isCancelled())return;let o=_e(a.basename),l=`${i.path}/${o}`,s=`${i.path}/${o}/Attachments`;await this.createFolders(l),await this.createFolders(s);let c=await a.readText(),u=JSON.parse(c),[p,f]=this.preprocess(u),d=new Map;for(let b in u){let _=u[b],N=Wo(Ho(_.title),this.userDNPFormat).trim();if(N===""){e.reportFailed(_.uid,"Title is empty"),console.error("Cannot import data with an empty title",_);continue}let k=`${l}/${N}.md`,O=this.titleYAML?_.title:"",w=0,C=0;if(this.fileDateYAML){let S=_["create-time"],D=_["edit-time"];typeof S=="number"&&(w=S),typeof D=="number"&&(C=D)}let y=await this.jsonToMarkdown(l,s,_,"",!1,O,w,C);d.set(k,y)}for(let b of f.values()){let _=await this.roamMarkupScrubber(l,s,b.blockString,!0),N=await this.extractAndProcessBlockReferences(d,p,l,_),k=`${l}/${b.pageName}.md`,O=d.get(k);if(O){let w=O.split(`
`),C=w.findIndex(y=>y.contains("* "+_));C!==-1&&(w[C]=w[C].replace(_,N)),d.set(k,w.join(`
`))}}let{vault:g}=this,m=d.size,h=1;for(let[b,_]of d.entries()){if(e.isCancelled())return;try{let{parent:N}=le(b);await this.createFolders(N);let k=g.getAbstractFileByPath(b);k?await g.modify(k,_):await g.create(b,_),e.reportNoteSuccess(b),e.reportProgress(h,m)}catch(N){console.error("Error saving Markdown to file:",b,N),e.reportFailed(b)}h++}}}getUserDNPFormat(){let e=this.app.internalPlugins.getPluginById("daily-notes").instance;return e?e.options.format||"YYYY-MM-DD":(console.log('Daily note plugin is not enabled. Roam import defaulting to "YYYY-MM-DD" format.'),"YYYY-MM-DD")}preprocess(e){let n=new Map,i=new Map,a=this.userDNPFormat;function o(l,s){if(s.uid){let c=new Date(l.uid);if(!isNaN(c.getTime())){let f=Wo(l.title,a);l.title=f}let u={pageName:Ho(l.title),blockString:s.string};/.*?(\(\(.*?\)\)).*?/g.test(s.string)&&i.set(s.uid,u),n.set(s.uid,u)}if(s.children)for(let c of s.children)o(l,c)}for(let l of e)if(l.children)for(let s of l.children)o(l,s);return[n,i]}async roamMarkupScrubber(e,n,i,a=!1){return i=i.replace(XE,""),i.substring(0,8)==":hiccup "&&i.includes(":hr")?"---":(i=i.replace(/\[\[(.*?)\]\]/g,(o,l)=>`[[${Wo(Ho(l),this.userDNPFormat)}]]`),i=i.replace(/\[\[(.*\/.*)\]\]/g,(o,l)=>`[[${e}/${l}|${l}]]`),i=i.replace(/\[.+?\]\((\(.+?\)\))\)/g,"$1"),i=i.replace(/\[(.+?)\]\(\[\[(.+?)\]\]\)/g,"[[$2|$1]]"),i=i.replace(/\[\[>\]\]/g,">"),i=i.replace(/{{TODO}}|{{\[\[TODO\]\]}}/g,"[ ]"),i=i.replace(/{{DONE}}|{{\[\[DONE\]\]}}/g,"[x]"),i=i.replace("::",":"),i=i.replace(/{{.*?\bvideo\b.*?(\bhttp.*?\byoutu.*?)}}/g,"![]($1)"),i=i.replace(/(https?:\/\/twitter\.com\/(?:#!\/)?\w+\/status\/\d+(?:\?[\w=&-]+)?)/g,"![]($1)"),i=i.replace(/\_\_(.+?)\_\_/g,"*$1*"),i=i.replace(/\^\^(.+?)\^\^/g,"==$1=="),i=i.replace(/{{\[{0,2}embed.*?(\(\(.*?\)\)).*?}}/g,"$1"),i=i.replace(/{{\[{0,2}embed.*?(\[\[.*?\]\]).*?}}/g,"$1"),this.downloadAttachments&&!a&&i.includes("firebasestorage")&&(i=await this.downloadFirebaseFile(i,n)),i)}async jsonToMarkdown(e,n,i,a="",o=!1,l,s,c){let u=[],p=[],f=i["edit-time"],d=i["create-time"];if(this.newestTimestamp<this.oldestTimestamp&&(this.oldestTimestamp=this.newestTimestamp),this.newestTimestamp=!f||c>f?c:f,d!==void 0?s>10?this.oldestTimestamp=Math.min(s,d):this.oldestTimestamp=d:this.oldestTimestamp=s,"string"in i&&i.string){let g=i.heading?"#".repeat(i.heading)+" ":"",m=await this.roamMarkupScrubber(e,n,i.string);u.push(`${o?a+"* ":a}${g}${m}`)}if(i.children)for(let g of i.children)u.push(await this.jsonToMarkdown(e,n,g,a+" ",!0,"",this.oldestTimestamp,this.newestTimestamp));if((this.fileDateYAML||this.titleYAML)&&!o){let g=this.oldestTimestamp;if(p.push("---"),this.titleYAML&&p.push(`title: "${l}"`),this.fileDateYAML){let m="YYYY-MM-DD HH:mm:ss",h=this.newestTimestamp?(0,Vo.moment)(this.newestTimestamp).format(m):(0,Vo.moment)(new Date).format(m),b=g?(0,Vo.moment)(g).format(m):h;p.push("created: "+b),p.push("updated: "+h)}p.push("---"),u.unshift(p.join(`
`))}return u.join(`
`)}async modifySourceBlockString(e,n,i,a){if(!n.blockString.endsWith("^"+a)){let o=`${i}/${n.pageName}.md`,l=e.get(o);if(l){let s=l.split(`
`),c=s.findIndex(u=>u.contains("* "+n.blockString));if(c!==-1){let u=n.blockString+" ^"+a;s[c]=s[c].replace(n.blockString,u),n.blockString=n.blockString+" ^"+a}e.set(o,s.join(`
`))}}}async extractAndProcessBlockReferences(e,n,i,a){let o=a.match(e1);if(!o)return a;let l=[];for(let u of o)try{let p=n.get(u);if(!p){l.push(u);continue}let f=p.blockString.replace(/\[\[|\]\]/g,""),d=`[[${i}/${p.pageName}#^${u}|${f}]]`;await this.modifySourceBlockString(e,p,i,u),l.push(d)}catch(p){l.push(u)}let s=0;return a.replace(/\(\(\b.*?\b\)\)/g,()=>l[s++])}async downloadFirebaseFile(e,n){let{progress:i,vault:a}=this,o="";try{let l,s;if(JE.test(e)?(l=e.match(/https:\/\/firebasestorage(.*?)\?alt(.*?)\}/),s=e.match(/{{.*https:\/\/firebasestorage.*?alt=media&.*?(?=\s|$)/)):Fg.test(e)?(l=e.match(Fg),s=e.match(/!\[.*https:\/\/firebasestorage.*?alt=media&.*?(?=\s|$)/)):(l=e.match(QE),s=e.match(/https:\/\/firebasestorage.*?alt=media&.*?(?=\s|$)/)),l&&s){let c="https://firebasestorage"+l[1],u=decodeURIComponent(c.split("/").last()||"");if(u){let m=u.split("/");m.length>1&&(m.splice(-1,1),this.createFolders(`${n}/${m.join("/")}`))}else{let m=Math.floor(Date.now()/1e3),h=c.slice(-5).match(/(.*?)\.(.+)/);if(!h)return i.reportSkipped(l[1],"Unexpected file extension"),e;u=`${m}.${h[2]}`}let p=`${n}/${u}`;if(a.getAbstractFileByPath(p))return i.reportSkipped(l[1],"File already exists"),e;o=l[0].slice(0,-1);let g=await(await fetch(o,{})).arrayBuffer();return await a.createBinary(p,g),i.reportAttachmentSuccess(o),e.replace(s[0],`![[${p}]]`)}}catch(l){console.error(l),i.reportFailed(o,l)}return e}};var Ir=require("obsidian");var Lg=/!\[\]\(assets\/([^)]*)\)/g,Go=class extends Ee{init(){Ir.Platform.isMacOS||this.modal.contentEl.createEl("p",{text:"Due to platform limitations, only textpack and zip files can be imported from this device. Open your vault on a Mac to import textbundle files."});let t=Ir.Platform.isMacOS?["textbundle","textpack","zip"]:["textpack","zip"];this.addFileChooserSetting("Textbundle",t,!0),this.addOutputLocationSetting("Textbundle")}async import(t){let{files:e}=this;if(e.length===0){new Ir.Notice("Please pick at least one file to import.");return}let n=await this.getOutputFolder();if(!n){new Ir.Notice("Please select a location to export to.");return}this.attachmentsFolderPath=await this.createFolders(`${n.path}/assets`);for(let i of e)if(i.extension==="textpack")await er(i,async(a,o)=>{await this.process(t,i.name,o)});else if(i.extension==="zip")await er(i,async(a,o)=>{let l=this.groupFilesByTextbundle(i.name,o);for(let s of l)await this.process(t,i.name,s)});else{let o=await new zr(`${i.toString()}/`).list();await this.process(t,i.name,o)}}groupFilesByTextbundle(t,e){let n={},i=t+"/",a=".textbundle";for(let o of e){if(!o.fullpath.startsWith(i)){console.log("Skipping",o.fullpath);continue}let l=o.fullpath.slice(i.length);if(l.startsWith("._")||l.startsWith("__MACOSX")){console.log("Skipping",o.fullpath);continue}let s=l.indexOf(a);if(s===-1){console.log("Skipping",o.fullpath);continue}let c=l.slice(0,s)+".textbundle";if(l.slice(s+a.length+1).startsWith("._")){console.log("Skipping",o.fullpath);continue}c in n?n[c].push(o):n[c]=[o]}return Object.values(n)}async process(t,e,n){let i=n.find(a=>a.name==="info.json");if(i){let a=await i.readText(),o=JSON.parse(a);if(o.hasOwnProperty("type")&&o.type!=="net.daringfireball.markdown"){t.reportSkipped(e,"The textbundle does not contain markdown");return}}for(let a of n)if(!a.name.startsWith("._"))try{if(a.type==="file"&&(a.extension==="md"||a.extension==="markdown")){let o="parent"in a?a.parent:e;o=o.replace(/.textbundle$/,"");let l=await a.readText();l.match(Lg)&&(l=l.replace(Lg,`![[${this.attachmentsFolderPath.path}/$1]]`));let s=(0,Ir.normalizePath)(o),c=await this.getOutputFolder();await this.saveAsMarkdownFile(c,s,l),t.reportNoteSuccess(o)}else if(a.type==="file"&&a.fullpath.contains("assets/"))await this.importAsset(t,a);else if(a.type==="folder"){let{basename:o}=le(a.toString());if(o!=="assets")continue;let s=await new zr(`${a.toString()}/`).list();for(let c of s)await this.importAsset(t,c)}else a.name!=="info.json"&&t.reportSkipped(a.name,"the file is not a media or markdown file.")}catch(o){t.reportFailed(a.name,o)}}async importAsset(t,e){if(e.type==="folder"){t.reportSkipped(e.name);return}let n=`${this.attachmentsFolderPath.path}/${e.name}`;this.vault.getAbstractFileByPath(n)&&t.reportSkipped(e.name,"the file already exists.");let a=await e.read();await this.vault.createBinary(n,a),t.reportAttachmentSuccess(e.name)}};var lt=require("obsidian");var Yo=class{constructor(){this.activeFormatStack=[];this.todoEnabled=!0;this.currentTodoHeading=null;this.keepTitleMode="automatic"}setTodoEnabled(t){this.todoEnabled=t}setKeepTitleMode(t){this.keepTitleMode=t}isFullyStrikethrough(t){return t.every(e=>e.xmlPath.includes("strikethrough"))}isTodoTitle(t){return/to ?do/i.test(t)}updateTodoContext(t,e){if(!this.currentTodoHeading||t<=this.currentTodoHeading.level){let n=this.isTodoTitle(e);this.currentTodoHeading=n?{level:t}:null}}isTodoMode(){return this.todoEnabled&&this.currentTodoHeading!==null}parseTomboyDate(t){if(!t)return;let e=t.replace(",",".");return new Date(e)}parseTomboyXML(t){var d,g,m;let n=new DOMParser().parseFromString(t,"text/xml"),i=((d=n.querySelector("title"))==null?void 0:d.textContent)||"Untitled",a=n.querySelector("text"),o=[];a&&(o=this.parseContentStructure(a));let l=n.querySelector("tags"),s=l!=null&&l.textContent?l.textContent.split(",").map(h=>h.trim()):[],c=n.querySelector("create-date"),u=n.querySelector("last-change-date"),p=this.parseTomboyDate((g=c==null?void 0:c.textContent)!=null?g:void 0),f=this.parseTomboyDate((m=u==null?void 0:u.textContent)!=null?m:void 0);return{title:i,content:o,tags:s,createDate:p,lastChangeDate:f}}parseContentStructure(t){let e=t.querySelector("note-content");if(!e)return[];let n=this.extractContentSections(e,"");return this.splitAndGroupSectionsIntoLines(n)}splitAndGroupSectionsIntoLines(t){let e=[];t.forEach(a=>{let o=a.text.split(`
`);o.forEach((l,s)=>{l&&e.push({text:l,xmlPath:a.xmlPath}),s<o.length-1&&e.push({text:`
`,xmlPath:"newline"})})});let n=[],i=[];return e.forEach(a=>{a.xmlPath==="newline"?(n.push({contentSections:i}),i=[]):i.push(a)}),i.length>0&&n.push({contentSections:i}),n}extractContentSections(t,e){let n=[];return t.childNodes.forEach(i=>{if(i.nodeType===Node.TEXT_NODE){let a=i.textContent||"";a.length>0&&n.push({text:a,xmlPath:e})}else if(i.nodeType===Node.ELEMENT_NODE){let a=i,o=a.tagName,l=e?`${e}/${o}`:o;a.textContent?!Array.from(a.childNodes).some(c=>c.nodeType===Node.TEXT_NODE&&c.textContent&&c.textContent.length>0)&&a.children.length===0?n.push({text:a.textContent,xmlPath:l}):n.push(...this.extractContentSections(a,l)):n.push(...this.extractContentSections(a,l))}}),n}convertToMarkdown(t){this.updateTodoContext(1,t.title);let e=this.convertStructuredContent(t.content),n=_e(t.title),i=t.title!==n,a=!1;switch(this.keepTitleMode){case"yes":a=!0;break;case"no":a=!1;break;case"automatic":default:a=i;break}let o=e.split(`
`),l=this.escapeMarkdownSpecialChars(t.title);if(o.length>0&&o[0].trim()===l.trim())if(a)o[0]=`# ${t.title}`,e=o.join(`
`);else{let d=1;for(;d<o.length&&o[d].trim()==="";)d++;e=o.slice(d).join(`
`)}let s=["---"];if(t.createDate){let d=t.createDate.toISOString().split(".")[0];s.push(`created: ${d}`)}if(t.lastChangeDate){let d=t.lastChangeDate.toISOString().split(".")[0];s.push(`changed: ${d}`)}let c="system:notebook:",u=t.tags.filter(d=>d.startsWith(c)).map(d=>d.substring(c.length));t.tags.contains("system:template")&&u.push("template"),u.length>0&&s.push(`tags: [${u.map(d=>`"${d}"`).join(", ")}]`);let f="";return s.length>1&&(s.push("---"),f=s.join(`
`)+`
`),f+e}escapeMarkdownSpecialChars(t){return t.replace(/([\\`*_\[\]#])/g,"\\$1")}formatLineStream(t,e,n=!1){let i="",a=new Set,o="";for(t.forEach((l,s)=>{let c=l.text,u=l.xmlPath.includes("link:internal"),{coreText:p,leadingWhitespace:f,trailingWhitespace:d}=this.extractWhitespaceFromText(c),g=u?_e(p):this.escapeMarkdownSpecialChars(p),m={strikethrough:!n&&l.xmlPath.includes("strikethrough"),highlight:l.xmlPath.includes("highlight"),bold:!e&&l.xmlPath.includes("bold"),italic:l.xmlPath.includes("italic"),monospace:l.xmlPath.includes("monospace")},h=this.calculateFormattingChanges(a,m);i+=h.closeTags,i+=o+f,i+=h.openTags,h.openingSpans&&h.openingSpans.forEach(b=>this.activeFormatStack.push(b)),u&&(i+="[["),i+=g,u&&(i+="]]"),a=new Set(Object.keys(m).filter(b=>m[b])),o=d});this.activeFormatStack.length>0;)i+=this.activeFormatStack.pop().closeTag;return i}calculateFormattingChanges(t,e){let n=[];for(;this.activeFormatStack.length>0;){let a=this.activeFormatStack[this.activeFormatStack.length-1],o=a.format;if(!e[o])n.push(a.closeTag),this.activeFormatStack.pop();else break}let i=[];return Object.keys(e).forEach(a=>{if(e[a]&&!t.has(a)){let o=this.getMarkdownTag(a),l={format:a,openTag:o.open,closeTag:o.close};i.push(l)}}),{closeTags:n.join(""),openTags:i.map(a=>a.openTag).join(""),openingSpans:i}}getMarkdownTag(t){switch(t){case"bold":return{open:"**",close:"**"};case"italic":return{open:"*",close:"*"};case"strikethrough":return{open:"~~",close:"~~"};case"monospace":return{open:"`",close:"`"};case"highlight":return{open:"==",close:"=="};default:return{open:"",close:""}}}extractWhitespaceFromText(t){let e=t.match(/^\s*/)[0],n=t.match(/\s*$/)[0];return e.length===t.length?{coreText:"",leadingWhitespace:t,trailingWhitespace:""}:{coreText:t.substring(e.length,t.length-n.length),leadingWhitespace:e,trailingWhitespace:n}}convertStructuredContent(t){let e="";return t.forEach((n,i)=>{let a="",o=n.contentSections[0],l="",s=this.isTodoMode(),c=!1;if(o&&o.xmlPath.includes("list-item")){let f=(o.xmlPath.match(/\/list\//g)||[]).length,d=" ".repeat(f);if(s){c=this.isFullyStrikethrough(n.contentSections);let g=c?"[x]":"[ ]";l=d+"- "+g+" "}else l=d+"- "}let u="",p=!1;if(n.contentSections.length>0&&l===""){let f=n.contentSections.map(h=>h.xmlPath),d=f.every(h=>h.includes("bold")),g=f.every(h=>h.includes("size:huge")),m=f.every(h=>h.includes("size:large"));if(d||g||m){let h=6;g?h-=4:m&&(h-=2),d&&(h-=1,p=!0),u="#".repeat(h)+" ";let _=n.contentSections.map(N=>N.text).join("").trim();this.updateTodoContext(h,_)}}a=this.formatLineStream(n.contentSections,p,c),u?e+=u+a.trim():e+=l+a,i<t.length-1&&(e+=`
`)}),e}};var Zo=class extends Ee{getDefaultTomboyPath(){if(!lt.Platform.isDesktopApp||!Je||!K)return"";try{if(lt.Platform.isMacOS)return K.join(Je.homedir(),"Library","Application Support","Tomboy");if(lt.Platform.isWin)return K.join(process.env.APPDATA||"","Roaming","Tomboy");if(lt.Platform.isLinux){let t=Je.homedir();return K.join(t,".local","share","tomboy")}}catch(t){console.warn("Error detecting default Tomboy path:",t)}return""}getOSSpecificDescription(){return lt.Platform.isMacOS?"Tomboy notes are typically found in: ~/Library/Application Support/Tomboy":lt.Platform.isWin?"Tomboy notes are typically found in: %APPDATA%\\Tomboy":lt.Platform.isLinux?"Tomboy notes are typically found in: ~/.local/share/tomboy - or GNote: ~/.local/share/gnote":"Pick the files that you want to import."}init(){this.todoEnabled=!0,this.coreConverter=new Yo,this.keepTitleMode="automatic",this.addFileChooserSetting("Tomboy/Gnote",["note"],!0,this.getOSSpecificDescription(),this.getDefaultTomboyPath()),this.addOutputLocationSetting("Tomboy"),new lt.Setting(this.modal.contentEl).setName("Convert TODO lists to checkboxes").setDesc('When enabled, lists in notes with "TODO" in the title will be converted to task lists with checkboxes. Strikethrough items will be marked as completed.').addToggle(t=>{t.setValue(this.todoEnabled).onChange(e=>this.todoEnabled=e)}),new lt.Setting(this.modal.contentEl).setName("Keep title in Markdown").setDesc('Choose whether to keep the note title in the Markdown content. "Automatic" keeps titles only when special characters are lost in filename conversion.').addDropdown(t=>{t.addOption("automatic","Automatic").addOption("yes","Keep titles").addOption("no","Filename only").setValue(this.keepTitleMode).onChange(e=>this.keepTitleMode=e)})}async import(t){let{files:e}=this;if(e.length===0){new lt.Notice("Please pick at least one file to import.");return}let n=await this.getOutputFolder();if(!n){new lt.Notice("Please select a location to export to.");return}this.coreConverter.setTodoEnabled(this.todoEnabled),this.coreConverter.setKeepTitleMode(this.keepTitleMode),t.reportProgress(0,e.length);for(let i=0;i<e.length;i++){if(t.isCancelled())return;let a=e[i];t.status("Processing "+a.name);try{await this.processFile(t,n,a),t.reportNoteSuccess(a.fullpath)}catch(o){t.reportFailed(a.fullpath,o)}t.reportProgress(i+1,e.length)}}async processFile(t,e,n){let i=await n.readText(),a=this.coreConverter.parseTomboyXML(i),o=this.coreConverter.convertToMarkdown(a);await this.saveAsMarkdownFile(e,a.title,o)}};var Uo="obsidian://importer-auth/",qn=["png","webp","jpg","jpeg","gif","bmp","svg","mpg","m4a","webm","wav","ogv","3gp","mov","mp4","mkv","pdf"],Ko=class{constructor(t){this.notes=0;this.attachments=0;this.skipped=[];this.failed=[];this.maxFileNameLength=100;this.statusMessage="";this.cancelled=!1;this.el=t,this.createProgressUI(t)}createProgressUI(t){t.empty(),this.el=t,this.statusEl=t.createDiv("importer-status"),this.progressBarEl=t.createDiv("importer-progress-bar",e=>{this.progressBarInnerEl=e.createDiv("importer-progress-bar-inner")}),t.createDiv("importer-stats-container",e=>{e.createDiv("importer-stat mod-imported",n=>{this.importedCountEl=n.createDiv({cls:"importer-stat-count",text:this.notes.toString()}),n.createDiv({cls:"importer-stat-name",text:"imported"})}),e.createDiv("importer-stat mod-attachments",n=>{this.attachmentCountEl=n.createDiv({cls:"importer-stat-count",text:this.attachments.toString()}),n.createDiv({cls:"importer-stat-name",text:"attachments"})}),e.createDiv("importer-stat mod-remaining",n=>{this.remainingCountEl=n.createDiv({cls:"importer-stat-count",text:"0"}),n.createDiv({cls:"importer-stat-name",text:"remaining"})}),e.createDiv("importer-stat mod-skipped",n=>{this.skippedCountEl=n.createDiv({cls:"importer-stat-count",text:this.skipped.length.toString()}),n.createDiv({cls:"importer-stat-name",text:"skipped"})}),e.createDiv("importer-stat mod-failed",n=>{this.failedCountEl=n.createDiv({cls:"importer-stat-count",text:this.failed.length.toString()}),n.createDiv({cls:"importer-stat-name",text:"failed"})})}),this.importLogEl=t.createDiv("importer-log"),this.importLogEl.hide()}status(t){this.statusMessage=t,this.statusEl.setText(t.trim()+"...")}reportNoteSuccess(t){this.notes++,this.importedCountEl.setText(this.notes.toString())}reportAttachmentSuccess(t){this.attachments++,this.attachmentCountEl.setText(this.attachments.toString())}reportSkipped(t,e){let{importLogEl:n}=this;this.skipped.push(t),this.skippedCountEl.setText(this.skipped.length.toString()),console.log("Import skipped",t,e),this.importLogEl.createDiv("list-item",i=>{i.createSpan({cls:"importer-error",text:"Skipped: "}),i.createSpan({text:`"${di(t,this.maxFileNameLength)}"`+(e?` because ${di(String(e),this.maxFileNameLength)}`:"")})}),n.scrollTop=n.scrollHeight,n.show()}reportFailed(t,e){let{importLogEl:n}=this;this.failed.push(t),this.failedCountEl.setText(this.failed.length.toString()),console.log("Import failed",t,e),this.importLogEl.createDiv("list-item",i=>{i.createSpan({cls:"importer-error",text:"Failed: "}),i.createSpan({text:`"${di(t,this.maxFileNameLength)}"`+(e?` because ${di(String(e),this.maxFileNameLength)}`:"")})}),n.scrollTop=n.scrollHeight,n.show()}reportProgress(t,e){e<=0||(console.log("Current progress:",(100*t/e).toFixed(1)+"%"),this.remainingCountEl.setText((e-t).toString()),this.importedCountEl.setText(t.toString()),this.progressBarInnerEl.style.width=(100*t/e).toFixed(1)+"%")}cancel(){this.cancelled=!0,this.progressBarEl.hide(),this.statusEl.hide()}hideStatus(){this.progressBarEl.hide(),this.statusEl.hide()}isCancelled(){return this.cancelled}},t1={importers:{onenote:{previouslyImportedIDs:[]}}},Xo=class extends Fr.Plugin{async onload(){this.importers={"apple-notes":{name:"Apple Notes",optionText:"Apple Notes",importer:Va,helpPermalink:"import/apple-notes"},"apple-journal":{name:"Apple Journal",optionText:"Apple Journal (HTML export)",importer:za,formatDescription:"Import your Journal app entries to Obsidian"},bear:{name:"Bear",optionText:"Bear (.bear2bk)",importer:Ga,helpPermalink:"import/bear"},csv:{name:"CSV",optionText:"CSV (.csv)",importer:Za,helpPermalink:"import/csv"},evernote:{name:"Evernote",optionText:"Evernote (.enex)",importer:lo,helpPermalink:"import/evernote"},keep:{name:"Google Keep",optionText:"Google Keep (.zip/.json)",importer:uo,helpPermalink:"import/google-keep"},html:{name:"HTML files",optionText:"HTML (.html)",importer:co,helpPermalink:"import/html"},onenote:{name:"Microsoft OneNote",optionText:"Microsoft OneNote",importer:jo,helpPermalink:"import/onenote"},"notion-api":{name:"Notion (API)",optionText:"Notion (API)",importer:qo,helpPermalink:"import/notion"},notion:{name:"Notion",optionText:"Notion (.zip)",importer:fo,helpPermalink:"import/notion",formatDescription:"Export your Notion workspace to HTML format."},"roam-json":{name:"Roam Research",optionText:"Roam Research (.json)",importer:zo,helpPermalink:"import/roam",formatDescription:"Export your Roam Research workspace to JSON format."},textbundle:{name:"Textbundle files",optionText:"Textbundle (.textbundle, .textpack)",importer:Go,helpPermalink:"import/textbundle"},tomboy:{name:"Tomboy/Gnote",optionText:"Tomboy/Gnote (.note)",importer:Zo}},this.addRibbonIcon("lucide-import","Open Importer",()=>{new Vi(this.app,this).open()}),this.addCommand({id:"open-modal",name:"Open importer",callback:()=>{new Vi(this.app,this).open()}}),this.registerObsidianProtocolHandler("importer-auth",t=>{if(this.authCallback){this.authCallback(t),this.authCallback=void 0;return}new Fr.Notice("Unexpected auth event. Please restart the auth process.")})}onunload(){}async loadData(){return Object.assign({},t1,await super.loadData())}async saveData(t){await super.saveData(t)}registerAuthCallback(t){this.authCallback=t}},Vi=class extends Fr.Modal{constructor(e,n){super(e);this.current=null;this.plugin=n,this.titleEl.setText("Import data into Obsidian"),this.modalEl.addClass("mod-importer"),this.abortController=new AbortController;let i=Object.keys(n.importers);i.length>0&&(this.selectedId=i[0],this.updateContent())}updateContent(){let{contentEl:e,selectedId:n}=this,i=this.plugin.importers,a=i[n];e.empty();let o=new DocumentFragment;if(o.createSpan({text:"The format to be imported."}),a.formatDescription&&(o.createEl("br"),o.createSpan({text:a.formatDescription})),a.helpPermalink&&(o.createEl("br"),o.createEl("a",{text:`Learn more about importing from ${a.name}.`,href:`https://help.obsidian.md/${a.helpPermalink}`})),new Fr.Setting(e).setName("File format").setDesc(o).addDropdown(l=>{for(let s in i)i.hasOwnProperty(s)&&l.addOption(s,i[s].optionText);l.onChange(s=>{i.hasOwnProperty(s)&&(this.selectedId=s,this.updateContent())}),l.setValue(this.selectedId)}),n&&i.hasOwnProperty(n)){let l=this.importer=new a.importer(this.app,this);if(l.notAvailable)return;e.createDiv("modal-button-container",s=>{s.createEl("button",{cls:"mod-cta",text:"Import"},c=>{c.addEventListener("click",async()=>{this.current&&this.current.cancel(),e.empty();let u=e.createDiv(),p=this.current=new Ko(u);if(await l.showTemplateConfiguration(p,u)===!1){this.current=null,this.updateContent();return}e.empty();let d=e.createDiv();p.createProgressUI(d);let g=e.createDiv("modal-button-container"),m=g.createEl("button",{cls:"mod-danger",text:"Stop"},h=>{h.addEventListener("click",()=>{p.cancel(),m.detach()})});try{await l.import(p)}finally{this.current===p&&(this.current=null),g.empty(),g.createEl("button",{text:"Import more"},h=>{h.addEventListener("click",()=>this.updateContent())}),g.createEl("button",{cls:"mod-cta",text:"Done"},h=>{h.addEventListener("click",()=>this.close())}),p.hideStatus()}})})})}}onClose(){let{contentEl:e,current:n}=this;e.empty(),this.abortController.abort("import was canceled by user"),n&&n.cancel()}};
/*! Bundled license information:
sax/lib/sax.js:
(*! http://mths.be/fromcodepoint v0.1.0 by @mathias *)
*/
/* nosourcemap */