quartz-research-note/content/.obsidian/plugins/obsidian-zotero-desktop-connector/main.js

192 lines
976 KiB
JavaScript
Raw Normal View History

2024-02-04 14:26:02 +00:00
var aT=Object.create;var Yr=Object.defineProperty;var nT=Object.getOwnPropertyDescriptor;var iT=Object.getOwnPropertyNames;var rT=Object.getPrototypeOf,oT=Object.prototype.hasOwnProperty;var O=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),sT=(e,t)=>{for(var a in t)Yr(e,a,{get:t[a],enumerable:!0})},Tm=(e,t,a,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of iT(t))!oT.call(e,i)&&i!==a&&Yr(e,i,{get:()=>t[i],enumerable:!(n=nT(t,i))||n.enumerable});return e};var _e=(e,t,a)=>(a=e!=null?aT(rT(e)):{},Tm(t||!e||!e.__esModule?Yr(a,"default",{value:e,enumerable:!0}):a,e)),lT=e=>Tm(Yr({},"__esModule",{value:!0}),e);var Rm=O((hD,Om)=>{Om.exports=Pm;Pm.sync=uT;var km=require("fs");function cT(e,t){var a=t.pathExt!==void 0?t.pathExt:process.env.PATHEXT;if(!a||(a=a.split(";"),a.indexOf("")!==-1))return!0;for(var n=0;n<a.length;n++){var i=a[n].toLowerCase();if(i&&e.substr(-i.length).toLowerCase()===i)return!0}return!1}function Fm(e,t,a){return!e.isSymbolicLink()&&!e.isFile()?!1:cT(t,a)}function Pm(e,t,a){km.stat(e,function(n,i){a(n,n?!1:Fm(i,e,t))})}function uT(e,t){return Fm(km.statSync(e),e,t)}});var Mm=O((vD,Lm)=>{Lm.exports=Nm;Nm.sync=pT;var Bm=require("fs");function Nm(e,t,a){Bm.stat(e,function(n,i){a(n,n?!1:jm(i,t))})}function pT(e,t){return jm(Bm.statSync(e),t)}function jm(e,t){return e.isFile()&&dT(e,t)}function dT(e,t){var a=e.mode,n=e.uid,i=e.gid,r=t.uid!==void 0?t.uid:process.getuid&&process.getuid(),o=t.gid!==void 0?t.gid:process.getgid&&process.getgid(),s=parseInt("100",8),l=parseInt("010",8),u=parseInt("001",8),c=s|l,f=a&u||a&l&&i===o||a&s&&n===r||a&c&&r===0;return f}});var Mc=O((gD,Dm)=>{var bD=require("fs"),Kr;process.platform==="win32"||global.TESTING_WINDOWS?Kr=Rm():Kr=Mm();Dm.exports=Lc;Lc.sync=fT;function Lc(e,t,a){if(typeof t=="function"&&(a=t,t={}),!a){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){Lc(e,t||{},function(r,o){r?i(r):n(o)})})}Kr(e,t||{},function(n,i){n&&(n.code==="EACCES"||t&&t.ignoreErrors)&&(n=null,i=!1),a(n,i)})}function fT(e,t){try{return Kr.sync(e,t||{})}catch(a){if(t&&t.ignoreErrors||a.code==="EACCES")return!1;throw a}}});var Jm=O((xD,Um)=>{var Cn=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",zm=require("path"),mT=Cn?";":":",Gm=Mc(),Hm=e=>Object.assign(new Error(`not found: ${e}`),{code:"ENOENT"}),Wm=(e,t)=>{let a=t.colon||mT,n=e.match(/\//)||Cn&&e.match(/\\/)?[""]:[...Cn?[process.cwd()]:[],...(t.path||process.env.PATH||"").split(a)],i=Cn?t.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",r=Cn?i.split(a):[""];return Cn&&e.indexOf(".")!==-1&&r[0]!==""&&r.unshift(""),{pathEnv:n,pathExt:r,pathExtExe:i}},Vm=(e,t,a)=>{typeof t=="function"&&(a=t,t={}),t||(t={});let{pathEnv:n,pathExt:i,pathExtExe:r}=Wm(e,t),o=[],s=u=>new Promise((c,f)=>{if(u===n.length)return t.all&&o.length?c(o):f(Hm(e));let p=n[u],b=/^".*"$/.test(p)?p.slice(1,-1):p,d=zm.join(b,e),m=!b&&/^\.[\\\/]/.test(e)?e.slice(0,2)+d:d;c(l(m,u,0))}),l=(u,c,f)=>new Promise((p,b)=>{if(f===i.length)return p(s(c+1));let d=i[f];Gm(u+d,{pathExt:r},(m,h)=>{if(!m&&h)if(t.all)o.push(u+d);else return p(u+d);return p(l(u,c,f+1))})});return a?s(0).then(u=>a(null,u),a):s(0)},hT=(e,t)=>{t=t||{};let{pathEnv:a,pathExt:n,pathExtExe:i}=Wm(e,t),r=[];for(let o=0;o<a.length;o++){let s=a[o],l=/^".*"$/.test(s)?s.slice(1,-1):s,u=zm.join(l,e),c=!l&&/^\.[\\\/]/.test(e)?e.slice(0,2)+u:u;for(let f=0;f<n.length;f++){let p=c+n[f];try{if(Gm.sync(p,{pathExt:i}))if(t.all)r.push(p);else return p}catch(b){}}}if(t.all&&r.length)return r;if(t.nothrow)return null;throw Hm(e)};Um.exports=Vm;Vm.sync=hT});var zc=O((yD,Dc)=>{"use strict";var Zm=(e={})=>{let t=e.env||process.env;return(e.platform||process.platform)!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};Dc.exports=Zm;Dc.exports.default=Zm});var Ym=O((wD,$m)=>{"use strict";var qm=require("path"),vT=Jm(),bT=zc();function Xm(e,t){let a=e.options.env||process.env,n=process.cwd(),i=e.options.cwd!=null,r=i&&process.chdir!==void 0&&!process.chdir.disabled;if(r)try{process
`:`
2024-02-04 14:26:02 +00:00
`.charCodeAt(),a=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,e.length-1)),e[e.length-1]===a&&(e=e.slice(0,e.length-1)),e}});var gh=O((FD,ki)=>{"use strict";var Ti=require("path"),vh=zc(),bh=e=>{e={cwd:process.cwd(),path:process.env[vh()],execPath:process.execPath,...e};let t,a=Ti.resolve(e.cwd),n=[];for(;t!==a;)n.push(Ti.join(a,"node_modules/.bin")),t=a,a=Ti.resolve(a,"..");let i=Ti.resolve(e.cwd,e.execPath,"..");return n.push(i),n.concat(e.path).join(Ti.delimiter)};ki.exports=bh;ki.exports.default=bh;ki.exports.env=e=>{e={env:process.env,...e};let t={...e.env},a=vh({env:t});return e.path=t[a],t[a]=ki.exports(e),t}});var yh=O((PD,Xc)=>{"use strict";var xh=(e,t)=>{for(let a of Reflect.ownKeys(t))Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(t,a));return e};Xc.exports=xh;Xc.exports.default=xh});var Eh=O((OD,eo)=>{"use strict";var NT=yh(),Qr=new WeakMap,wh=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let a,n=0,i=e.displayName||e.name||"<anonymous>",r=function(...o){if(Qr.set(r,++n),n===1)a=e.apply(this,o),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return a};return NT(r,e),Qr.set(r,n),r};eo.exports=wh;eo.exports.default=wh;eo.exports.callCount=e=>{if(!Qr.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return Qr.get(e)}});var Sh=O(to=>{"use strict";Object.defineProperty(to,"__esModule",{value:!0});to.SIGNALS=void 0;var jT=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:
${n.message}`:m,x=[v,t,e].filter(Boolean).join(`
`);return h?(n.originalMessage=n.message,n.message=x):n=new Error(x),n.shortMessage=v,n.command=o,n.escapedCommand=s,n.exitCode=r,n.signal=i,n.signalDescription=p,n.stdout=e,n.stderr=t,a!==void 0&&(n.all=a),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=u,n.killed=c&&!l,n};kh.exports=t4});var Oh=O((MD,Yc)=>{"use strict";var no=["stdin","stdout","stderr"],a4=e=>no.some(t=>e[t]!==void 0),Ph=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return no.map(n=>e[n]);if(a4(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${no.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let a=Math.max(t.length,no.length);return Array.from({length:a},(n,i)=>t[i])};Yc.exports=Ph;Yc.exports.node=e=>{let t=Ph(e);return t==="ipc"?"ipc":t===void 0||typeof t=="string"?[t,t,t,"ipc"]:t.includes("ipc")?t:[...t,"ipc"]}});var Rh=O((DD,io)=>{io.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"];process.platform!=="win32"&&io.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");process.platform==="linux"&&io.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")});var eu=O((zD,Fn)=>{var Ge=global.process,qa=function(e){return e&&typeof e=="object"&&typeof e.removeListener=="function"&&typeof e.emit=="function"&&typeof e.reallyExit=="function"&&typeof e.listeners=="function"&&typeof e.kill=="function"&&typeof e.pid=="number"&&typeof e.on=="function"};qa(Ge)?(Bh=require("assert"),Tn=Rh(),Nh=/^win/i.test(Ge.platform),Fi=require("events"),typeof Fi!="function"&&(Fi=Fi.EventEmitter),Ge.__signal_exit_emitter__?at=Ge.__signal_exit_emitter__:(at=Ge.__signal_exit_emitter__=new Fi,at.count=0,at.emitted={}),at.infinite||(at.setMaxListeners(1/0),at.infinite=!0),Fn.exports=function(e,t){if(!qa(global.process))return function(){};Bh.equal(typeof e,"function","a callback must be provided for exit handler"),kn===!1&&Kc();var a="exit";t&&t.alwaysLast&&(a="afterexit");var n=function(){at.removeListener(a,e),at.listeners("exit").length===0&&at.listeners("afterexit").length===0&&ro()};return at.on(a,e),n},ro=function(){!kn||!qa(global.process)||(kn=!1,Tn.forEach(function(t){try{Ge.removeListener(t,oo[t])}catch(a){}}),Ge.emit=so,Ge.reallyExit=Qc,at.count-=1)},Fn.exports.unload=ro,Xa=function(t,a,n){at.emitted[t]||(at.emitted[t]=!0,at.emit(t,a,n))},oo={},Tn.forEach(function(e){oo[e]=function(){if(qa(global.process)){var a=Ge.listeners(e);a.length===at.count&&(ro(),Xa("exit",null,e),Xa("afterexit",null,e),Nh&&e==="SIGHUP"&&(e="SIGINT"),Ge.kill(Ge.pid,e))}}}),Fn.exports.signals=function(){return Tn},kn=!1,Kc=function(){kn||!qa(global.process)||(kn=!0,at.count+=1,Tn=Tn.filter(function(t){try{return Ge.on(t,oo[t]),!0}catch(a){return!1}}),Ge.emit=Lh,Ge.reallyExit=jh)},Fn.exports.load=Kc,Qc=Ge.reallyExit,jh=function(t){qa(global.process)&&(Ge.exitCode=t||0,Xa("exit",Ge.exitCode,null),Xa("afterexit",Ge.exitCode,null),Qc.call(Ge,Ge.exitCode))},so=Ge.emit,Lh=function(t,a){if(t==="exit"&&qa(global.process)){a!==void 0&&(Ge.exitCode=a);var n=so.apply(this,arguments);return Xa("exit",Ge.exitCode,null),Xa("afterexit",Ge.exitCode,null),n}else return so.apply(this,arguments)}):Fn.exports=function(){return function(){}};var Bh,Tn,Nh,Fi,at,ro,Xa,oo,kn,Kc,Qc,jh,so,Lh});var Dh=O((GD,Mh)=>{"use strict";var n4=require("os"),i4=eu(),r4=1e3*5,o4=(e,t="SIGTERM",a={})=>{let n=e(t);return s4(e,t,a,n),n},s4=(e,t,a,n)=>{if(!l4(t,a,n))return;let i=u4(a),r=setTimeout(()=>{e("SIGKILL")},i);r.unref&&r.unref()},l4=(e,{forceKillAfterTimeout:t},a)=>c4(e)&&t!==!1&&a,c4=e=>e===n4.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",u4=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return r4;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},p4=(e,t)=>{e.kill()&&(t.isCanceled=!0)},d4=(e,t,a)=>{e.kill(t),a(Object.assign(new Er
/* [wrapped with `+t+`] */
2024-02-04 14:26:02 +00:00
`)}function GF(e,t){return t=t==null?K5:t,!!t&&(typeof e=="number"||fF.test(e))&&e>-1&&e%1==0&&e<t}function HF(e){return!!$b&&$b in e}function WF(e,t){for(var a=e.length,n=kF(t.length,a),i=BF(e);n--;){var r=t[n];e[n]=GF(r,a)?i[r]:void 0}return e}var cg=Yb?function(e,t,a){var n=t+"";return Yb(e,"toString",{configurable:!0,enumerable:!1,value:YF(zF(n,UF(DF(n),a)))})}:KF;function VF(e){if(e!=null){try{return rg.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function UF(e,t){return bF(eF,function(a){var n="_."+a[0];t&a[1]&&!gF(e,n)&&e.push(n)}),e.sort()}function Gu(e,t,a){t=a?void 0:t;var n=MF(e,Qa,void 0,void 0,void 0,void 0,void 0,t);return n.placeholder=Gu.placeholder,n}function JF(e){var t=Dn(e)?og.call(e):"";return t==tF||t==aF}function Dn(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function ZF(e){return!!e&&typeof e=="object"}function qF(e){return typeof e=="symbol"||ZF(e)&&og.call(e)==nF}function XF(e){if(!e)return e===0?e:0;if(e=$F(e),e===qb||e===-qb){var t=e<0?-1:1;return t*Q5}return e===e?e:0}function Qb(e){var t=XF(e),a=t%1;return t===t?a?t-a:t:0}function $F(e){if(typeof e=="number")return e;if(qF(e))return Xb;if(Dn(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Dn(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(rF,"");var a=uF.test(e);return a||dF.test(e)?mF(e.slice(2),a?2:8):cF.test(e)?Xb:+e}function YF(e){return function(){return e}}function KF(e){return e}Gu.placeholder={};ug.exports=Gu});var Zg=O((mz,Jg)=>{"use strict";var{PassThrough:LP}=require("stream");Jg.exports=e=>{e={...e};let{array:t}=e,{encoding:a}=e,n=a==="buffer",i=!1;t?i=!(a||n):a=a||"utf8",n&&(a=null);let r=new LP({objectMode:i});a&&r.setEncoding(a);let o=0,s=[];return r.on("data",l=>{s.push(l),i?o=s.length:o+=l.length}),r.getBufferedValue=()=>t?s:n?Buffer.concat(s,o):s.join(""),r.getBufferedLength=()=>o,r}});var qg=O((hz,Yi)=>{"use strict";var{constants:MP}=require("buffer"),DP=require("stream"),{promisify:zP}=require("util"),GP=Zg(),HP=zP(DP.pipeline),vs=class extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}};async function Yu(e,t){if(!e)throw new Error("Expected a stream");t={maxBuffer:1/0,...t};let{maxBuffer:a}=t,n=GP(t);return await new Promise((i,r)=>{let o=s=>{s&&n.getBufferedLength()<=MP.MAX_LENGTH&&(s.bufferedData=n.getBufferedValue()),r(s)};(async()=>{try{await HP(e,n),i()}catch(s){o(s)}})(),n.on("data",()=>{n.getBufferedLength()>a&&o(new vs)})}),n.getBufferedValue()}Yi.exports=Yu;Yi.exports.buffer=(e,t)=>Yu(e,{...t,encoding:"buffer"});Yi.exports.array=(e,t)=>Yu(e,{...t,array:!0});Yi.exports.MaxBufferError=vs});var Ax=O((tr,up)=>{(function(t,a){typeof tr=="object"&&typeof up=="object"?up.exports=a():typeof define=="function"&&define.amd?define([],a):typeof tr=="object"?tr.nunjucks=a():t.nunjucks=a()})(typeof self!="undefined"?self:tr,function(){return function(e){var t={};function a(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,a),i.l=!0,i.exports}return a.m=e,a.c=t,a.d=function(n,i,r){a.o(n,i)||Object.defineProperty(n,i,{configurable:!1,enumerable:!0,get:r})},a.n=function(n){var i=n&&n.__esModule?function(){return n.default}:function(){return n};return a.d(i,"a",i),i},a.o=function(n,i){return Object.prototype.hasOwnProperty.call(n,i)},a.p="",a(a.s=11)}([function(e,s,a){"use strict";var n=Array.prototype,i=Object.prototype,r={"&":"&amp;",'"':"&quot;","'":"&#39;","<":"&lt;",">":"&gt;","\\":"&#92;"},o=/[&"'<>\\]/g,s=e.exports={};function l(T,N){return i.hasOwnProperty.call(T,N)}s.hasOwnProp=l;function u(T){return r[T]}function c(T,N,M){if(M.Update||(M=new s.TemplateError(M)),M.Update(T),!N){var D=M;M=new Error(D.message),M.name=D.name}return M}s._prettifyError=c;function f(T,N,M){var D,V;T instanceof Error&&(V=T,T=V.name+": "+V.message),Object.setPrototypeOf?(D=new Error(T),Object.setPrototypeOf(D,f.prototype)):(D=this,Object.defineProperty(D,"message",{enumerable:!1,writable:!0,value:T})),Object.defineProperty(D,"name",{value:"Template render error"}),Error.captureStackTrace&&Error.captureStackTrace(D,th
`,this.firstUpdate&&(oe+=" "),this.message=oe+(this.message||""),this.firstUpdate=!1,this},D}Object.setPrototypeOf?Object.setPrototypeOf(f.prototype,Error.prototype):f.prototype=Object.create(Error.prototype,{constructor:{value:f}}),s.TemplateError=f;function p(T){return T.replace(o,u)}s.escape=p;function b(T){return i.toString.call(T)==="[object Function]"}s.isFunction=b;function d(T){return i.toString.call(T)==="[object Array]"}s.isArray=d;function m(T){return i.toString.call(T)==="[object String]"}s.isString=m;function h(T){return i.toString.call(T)==="[object Object]"}s.isObject=h;function v(T){return T?typeof T=="string"?T.split("."):[T]:[]}function x(T){var N=v(T);return function(D){for(var V=D,q=0;q<N.length;q++){var Z=N[q];if(l(V,Z))V=V[Z];else return}return V}}s.getAttrGetter=x;function E(T,N,M){for(var D={},V=b(N)?N:x(N),q=0;q<T.length;q++){var Z=T[q],pe=V(Z,q);if(pe===void 0&&M===!0)throw new TypeError('groupby: attribute "'+N+'" resolved to undefined');(D[pe]||(D[pe]=[])).push(Z)}return D}s.groupBy=E;function g(T){return Array.prototype.slice.call(T)}s.toArray=g;function w(T){var N=[];if(!T)return N;for(var M=T.length,D=g(arguments).slice(1),V=-1;++V<M;)P(D,T[V])===-1&&N.push(T[V]);return N}s.without=w;function C(T,N){for(var M="",D=0;D<N;D++)M+=T;return M}s.repeat=C;function y(T,N,M){if(T!=null){if(n.forEach&&T.forEach===n.forEach)T.forEach(N,M);else if(T.length===+T.length)for(var D=0,V=T.length;D<V;D++)N.call(M,T[D],D,T)}}s.each=y;function S(T,N){var M=[];if(T==null)return M;if(n.map&&T.map===n.map)return T.map(N);for(var D=0;D<T.length;D++)M[M.length]=N(T[D],D);return T.length===+T.length&&(M.length=T.length),M}s.map=S;function A(T,N,M){var D=-1;function V(){D++,D<T.length?N(T[D],D,V,M):M()}V()}s.asyncIter=A;function _(T,N,M){var D=F(T||{}),V=D.length,q=-1;function Z(){q++;var pe=D[q];q<V?N(pe,T[pe],q,V,Z):M()}Z()}s.asyncFor=_;function P(T,N,M){return Array.prototype.indexOf.call(T||[],N,M)}s.indexOf=P;function F(T){var N=[];for(var M in T)l(T,M)&&N.push(M);return N}s.keys=F;function B(T){return F(T).map(function(N){return[N,T[N]]})}s._entries=B;function j(T){return F(T).map(function(N){return T[N]})}s._values=j;function L(T,N){return T=T||{},F(N).forEach(function(M){T[M]=N[M]}),T}s._assign=s.extend=L;function k(T,N){if(d(N)||m(N))return N.indexOf(T)!==-1;if(h(N))return T in N;throw new Error('Cannot use "in" operator to search for "'+T+'" in unexpected types.')}s.inOperator=k},function(e,t,a){"use strict";function n(m,h){for(var v=0;v<h.length;v++){var x=h[v];x.enumerable=x.enumerable||!1,x.configurable=!0,"value"in x&&(x.writable=!0),Object.defineProperty(m,r(x.key),x)}}function i(m,h,v){return h&&n(m.prototype,h),v&&n(m,v),Object.defineProperty(m,"prototype",{writable:!1}),m}function r(m){var h=o(m,"string");return typeof h=="symbol"?h:String(h)}function o(m,h){if(typeof m!="object"||m===null)return m;var v=m[Symbol.toPrimitive];if(v!==void 0){var x=v.call(m,h||"default");if(typeof x!="object")return x;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(m)}function s(m,h){m.prototype=Object.create(h.prototype),m.prototype.constructor=m,l(m,h)}function l(m,h){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(x,E){return x.__proto__=E,x},l(m,h)}var u=a(16),c=a(0);function f(m,h){return typeof m!="function"||typeof h!="function"?h:function(){var x=this.parent;this.parent=m;var E=h.apply(this,arguments);return this.parent=x,E}}function p(m,h,v){v=v||{},c.keys(v).forEach(function(E){v[E]=f(m.prototype[E],v[E])});var x=function(E){s(g,E);function g(){return E.apply(this,arguments)||this}return i(g,[{key:"typename",get:function(){return h}}]),g}(m);return c._assign(x.prototype,v),x}var b=function(){function m(){this.init.apply(this,arguments)}var h=m.prototype;return h.init=function(){},m.extend=function(x,E){return typeof x=="object"&&(E=x,x="anonymous"),p(this,x,E)},i(m,[{key:"typename",get:function(){return this.constructor.name}}]),m}(),d=function(m){s(h,m);function h(){var x,E;return E=m.call(this)||this,(x=E).init.apply(x,arguments)
`);ge.forEach(function(Ie,Xe){Ie&&(we&&Xe>0||!we)&&process.stdout.write(" ".repeat(ie));var St=Xe===ge.length-1?"":`
2024-02-04 14:26:02 +00:00
`;process.stdout.write(""+Ie+St)})}function Ii(te,ie){if(ie=ie||0,Sn(te.typename+": ",ie),te instanceof d)Sn(`
`),te.children.forEach(function(Ie){Ii(Ie,ie+2)});else if(te instanceof Nc)Sn(te.extName+"."+te.prop+`
`),te.args&&Ii(te.args,ie+2),te.contentArgs&&te.contentArgs.forEach(function(Ie){Ii(Ie,ie+2)});else{var we=[],ge=null;te.iterFields(function(Ie,Xe){Ie instanceof p?we.push([Xe,Ie]):(ge=ge||{},ge[Xe]=Ie)}),ge?Sn(JSON.stringify(ge,null,2)+`
`,null,!0):Sn(`
`),we.forEach(function(Ie){var Xe=Ie[0],St=Ie[1];Sn("["+Xe+"] =>",ie+2),Ii(St,ie+4)})}}e.exports={Node:p,Root:m,NodeList:d,Value:b,Literal:h,Symbol:v,Group:x,Array:E,Pair:g,Dict:w,Output:X,Capture:$,TemplateData:he,If:y,IfAsync:S,InlineIf:A,For:_,AsyncEach:P,AsyncAll:F,Macro:B,Caller:j,Import:L,FromImport:k,FunCall:T,Filter:N,FilterAsync:M,KeywordArgs:D,Block:V,Super:q,Extends:pe,Include:fe,Set:ee,Switch:oe,Case:U,LookupVal:C,BinOp:ze,In:ht,Is:R,Or:z,And:J,Not:H,Add:ne,Concat:K,Sub:Ae,Mul:ue,Div:Ne,FloorDiv:Nt,Mod:Vt,Pow:Ia,Neg:q_,Pos:X_,Compare:$_,CompareOperand:Y_,CallExtension:Nc,CallExtensionAsync:K_,printNodes:Ii}},function(e,t){},function(e,t,a){"use strict";function n(h,v){h.prototype=Object.create(v.prototype),h.prototype.constructor=h,i(h,v)}function i(h,v){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(E,g){return E.__proto__=g,E},i(h,v)}var r=a(8),o=a(17),s=a(3),l=a(0),u=l.TemplateError,c=a(2),f=c.Frame,p=a(1),b=p.Obj,d={"==":"==","===":"===","!=":"!=","!==":"!==","<":"<",">":">","<=":"<=",">=":">="},m=function(h){n(v,h);function v(){return h.apply(this,arguments)||this}var x=v.prototype;return x.init=function(g,w){this.templateName=g,this.codebuf=[],this.lastId=0,this.buffer=null,this.bufferStack=[],this._scopeClosers="",this.inBlock=!1,this.throwOnUndefined=w},x.fail=function(g,w,C){throw w!==void 0&&(w+=1),C!==void 0&&(C+=1),new u(g,w,C)},x._pushBuffer=function(){var g=this._tmpid();return this.bufferStack.push(this.buffer),this.buffer=g,this._emit("var "+this.buffer+' = "";'),g},x._popBuffer=function(){this.buffer=this.bufferStack.pop()},x._emit=function(g){this.codebuf.push(g)},x._emitLine=function(g){this._emit(g+`
`)},x._emitLines=function(){for(var g=this,w=arguments.length,C=new Array(w),y=0;y<w;y++)C[y]=arguments[y];C.forEach(function(S){return g._emitLine(S)})},x._emitFuncBegin=function(g,w){this.buffer="output",this._scopeClosers="",this._emitLine("function "+w+"(env, context, frame, runtime, cb) {"),this._emitLine("var lineno = "+g.lineno+";"),this._emitLine("var colno = "+g.colno+";"),this._emitLine("var "+this.buffer+' = "";'),this._emitLine("try {")},x._emitFuncEnd=function(g){g||this._emitLine("cb(null, "+this.buffer+");"),this._closeScopeLevels(),this._emitLine("} catch (e) {"),this._emitLine(" cb(runtime.handleError(e, lineno, colno));"),this._emitLine("}"),this._emitLine("}"),this.buffer=null},x._addScopeLevel=function(){this._scopeClosers+="})"},x._closeScopeLevels=function(){this._emitLine(this._scopeClosers+";"),this._scopeClosers=""},x._withScopedSyntax=function(g){var w=this._scopeClosers;this._scopeClosers="",g.call(this),this._closeScopeLevels(),this._scopeClosers=w},x._makeCallback=function(g){var w=this._tmpid();return"function("+w+(g?","+g:"")+`) {
2024-02-04 14:26:02 +00:00
if(`+w+") { cb("+w+"); return; }"},x._tmpid=function(){return this.lastId++,"t_"+this.lastId},x._templateName=function(){return this.templateName==null?"undefined":JSON.stringify(this.templateName)},x._compileChildren=function(g,w){var C=this;g.children.forEach(function(y){C.compile(y,w)})},x._compileAggregate=function(g,w,C,y){var S=this;C&&this._emit(C),g.children.forEach(function(A,_){_>0&&S._emit(","),S.compile(A,w)}),y&&this._emit(y)},x._compileExpression=function(g,w){this.assertType(g,s.Literal,s.Symbol,s.Group,s.Array,s.Dict,s.FunCall,s.Caller,s.Filter,s.LookupVal,s.Compare,s.InlineIf,s.In,s.Is,s.And,s.Or,s.Not,s.Add,s.Concat,s.Sub,s.Mul,s.Div,s.FloorDiv,s.Mod,s.Pow,s.Neg,s.Pos,s.Compare,s.NodeList),this.compile(g,w)},x.assertType=function(g){for(var w=arguments.length,C=new Array(w>1?w-1:0),y=1;y<w;y++)C[y-1]=arguments[y];C.some(function(S){return g instanceof S})||this.fail("assertType: invalid type: "+g.typename,g.lineno,g.colno)},x.compileCallExtension=function(g,w,C){var y=this,S=g.args,A=g.contentArgs,_=typeof g.autoescape=="boolean"?g.autoescape:!0;if(C||this._emit(this.buffer+" += runtime.suppressValue("),this._emit('env.getExtension("'+g.extName+'")["'+g.prop+'"]('),this._emit("context"),(S||A)&&this._emit(","),S&&(S instanceof s.NodeList||this.fail("compileCallExtension: arguments must be a NodeList, use `parser.parseSignature`"),S.children.forEach(function(F,B){y._compileExpression(F,w),(B!==S.children.length-1||A.length)&&y._emit(",")})),A.length&&A.forEach(function(F,B){if(B>0&&y._emit(","),F){y._emitLine("function(cb) {"),y._emitLine("if(!cb) { cb = function(err) { if(err) { throw err; }}}");var j=y._pushBuffer();y._withScopedSyntax(function(){y.compile(F,w),y._emitLine("cb(null, "+j+");")}),y._popBuffer(),y._emitLine("return "+j+";"),y._emitLine("}")}else y._emit("null")}),C){var P=this._tmpid();this._emitLine(", "+this._makeCallback(P)),this._emitLine(this.buffer+" += runtime.suppressValue("+P+", "+_+" && env.opts.autoescape);"),this._addScopeLevel()}else this._emit(")"),this._emit(", "+_+` && env.opts.autoescape);
`)},x.compileCallExtensionAsync=function(g,w){this.compileCallExtension(g,w,!0)},x.compileNodeList=function(g,w){this._compileChildren(g,w)},x.compileLiteral=function(g){if(typeof g.value=="string"){var w=g.value.replace(/\\/g,"\\\\");w=w.replace(/"/g,'\\"'),w=w.replace(/\n/g,"\\n"),w=w.replace(/\r/g,"\\r"),w=w.replace(/\t/g,"\\t"),w=w.replace(/\u2028/g,"\\u2028"),this._emit('"'+w+'"')}else g.value===null?this._emit("null"):this._emit(g.value.toString())},x.compileSymbol=function(g,w){var C=g.value,y=w.lookup(C);y?this._emit(y):this._emit('runtime.contextOrFrameLookup(context, frame, "'+C+'")')},x.compileGroup=function(g,w){this._compileAggregate(g,w,"(",")")},x.compileArray=function(g,w){this._compileAggregate(g,w,"[","]")},x.compileDict=function(g,w){this._compileAggregate(g,w,"{","}")},x.compilePair=function(g,w){var C=g.key,y=g.value;C instanceof s.Symbol?C=new s.Literal(C.lineno,C.colno,C.value):C instanceof s.Literal&&typeof C.value=="string"||this.fail("compilePair: Dict keys must be strings or names",C.lineno,C.colno),this.compile(C,w),this._emit(": "),this._compileExpression(y,w)},x.compileInlineIf=function(g,w){this._emit("("),this.compile(g.cond,w),this._emit("?"),this.compile(g.body,w),this._emit(":"),g.else_!==null?this.compile(g.else_,w):this._emit('""'),this._emit(")")},x.compileIn=function(g,w){this._emit("runtime.inOperator("),this.compile(g.left,w),this._emit(","),this.compile(g.right,w),this._emit(")")},x.compileIs=function(g,w){var C=g.right.name?g.right.name.value:g.right.value;this._emit('env.getTest("'+C+'").call(context, '),this.compile(g.left,w),g.right.args&&(this._emit(","),this.compile(g.right.args,w)),this._emit(") === true")},x._binOpEmitter=function(g,w,C){this.compile(g.left,w),this._emit(C),this.compile(g.right,w)},x.compileOr=function(g,w){return this._binOpEmitter(g,w," || ")},x.compileAnd=function(g,w){return this._binOpEmitter(g,w," && ")},x.compileAdd=function(g,w){return this._binOpEmitter(g,w," + ")},x.compileConcat=function(g,w){return this._binOpEmitter(g,w,' + "" + ')},x.compileSub=function(g,w){return this._binOpEmitter(g,w," - ")},x.compileMul=function(g,w){return this._binOpEmitter(g,w," * ")},x.compileDiv=function(g,w){return this._binOpEmitter(g,w," / ")},x.compileMod=function(g,w){return this._binOpEmitter(g,w," % ")},x.compileNot=function(g,w){this._emit("!"),this.compile(g.target,w)},x.compileFloorDiv=function(g,w){this._emit("Math.floor("),this.compile(g.left,w),this._emit(" / "),this.compile(g.right,w),this._emit(")")},x.compilePow=function(g,w){this._emit("Math.pow("),this.compile(g.left,w),this._emit(", "),this.compile(g.right,w),this._emit(")")},x.compileNeg=function(g,w){this._emit("-"),this.compile(g.target,w)},x.compilePos=function(g,w){this._emit("+"),this.compile(g.target,w)},x.compileCompare=function(g,w){var C=this;this.compile(g.expr,w),g.ops.forEach(function(y){C._emit(" "+d[y.type]+" "),C.compile(y.expr,w)})},x.compileLookupVal=function(g,w){this._emit("runtime.memberLookup(("),this._compileExpression(g.target,w),this._emit("),"),this._compileExpression(g.val,w),this._emit(")")},x._getNodeName=function(g){switch(g.typename){case"Symbol":return g.value;case"FunCall":return"the return value of ("+this._getNodeName(g.name)+")";case"LookupVal":return this._getNodeName(g.target)+'["'+this._getNodeName(g.val)+'"]';case"Literal":return g.value.toString();default:return"--expression--"}},x.compileFunCall=function(g,w){this._emit("(lineno = "+g.lineno+", colno = "+g.colno+", "),this._emit("runtime.callWrap("),this._compileExpression(g.name,w),this._emit(', "'+this._getNodeName(g.name).replace(/"/g,'\\"')+'", context, '),this._compileAggregate(g.args,w,"[","])"),this._emit(")")},x.compileFilter=function(g,w){var C=g.name;this.assertType(C,s.Symbol),this._emit('env.getFilter("'+C.value+'").call(context, '),this._compileAggregate(g.args,w),this._emit(")")},x.compileFilterAsync=function(g,w){var C=g.name,y=g.symbol.value;this.assertType(C,s.Symbol),w.set(y,y),this._emit('env.getFilter("'+C.value+'").call(context, '),this._compileAggregate(g.args,w),this._emitLine(", "
else {`),this._withScopedSyntax(function(){y.compile(g.else_,w),C&&y._emit("cb()")})):C&&(this._emitLine(`}
2024-02-04 14:26:02 +00:00
else {`),this._emit("cb()")),this._emitLine("}")},x.compileIfAsync=function(g,w){this._emit("(function(cb) {"),this.compileIf(g,w,!0),this._emit("})("+this._makeCallback()),this._addScopeLevel()},x._emitLoopBindings=function(g,w,C,y){var S=this,A=[{name:"index",val:C+" + 1"},{name:"index0",val:C},{name:"revindex",val:y+" - "+C},{name:"revindex0",val:y+" - "+C+" - 1"},{name:"first",val:C+" === 0"},{name:"last",val:C+" === "+y+" - 1"},{name:"length",val:y}];A.forEach(function(_){S._emitLine('frame.set("loop.'+_.name+'", '+_.val+");")})},x.compileFor=function(g,w){var C=this,y=this._tmpid(),S=this._tmpid(),A=this._tmpid();if(w=w.push(),this._emitLine("frame = frame.push();"),this._emit("var "+A+" = "),this._compileExpression(g.arr,w),this._emitLine(";"),this._emit("if("+A+") {"),this._emitLine(A+" = runtime.fromIterator("+A+");"),g.name instanceof s.Array){this._emitLine("var "+y+";"),this._emitLine("if(runtime.isArray("+A+")) {"),this._emitLine("var "+S+" = "+A+".length;"),this._emitLine("for("+y+"=0; "+y+" < "+A+".length; "+y+"++) {"),g.name.children.forEach(function(k,T){var N=C._tmpid();C._emitLine("var "+N+" = "+A+"["+y+"]["+T+"];"),C._emitLine('frame.set("'+k+'", '+A+"["+y+"]["+T+"]);"),w.set(g.name.children[T].value,N)}),this._emitLoopBindings(g,A,y,S),this._withScopedSyntax(function(){C.compile(g.body,w)}),this._emitLine("}"),this._emitLine("} else {");var _=g.name.children,P=_[0],F=_[1],B=this._tmpid(),j=this._tmpid();w.set(P.value,B),w.set(F.value,j),this._emitLine(y+" = -1;"),this._emitLine("var "+S+" = runtime.keys("+A+").length;"),this._emitLine("for(var "+B+" in "+A+") {"),this._emitLine(y+"++;"),this._emitLine("var "+j+" = "+A+"["+B+"];"),this._emitLine('frame.set("'+P.value+'", '+B+");"),this._emitLine('frame.set("'+F.value+'", '+j+");"),this._emitLoopBindings(g,A,y,S),this._withScopedSyntax(function(){C.compile(g.body,w)}),this._emitLine("}"),this._emitLine("}")}else{var L=this._tmpid();w.set(g.name.value,L),this._emitLine("var "+S+" = "+A+".length;"),this._emitLine("for(var "+y+"=0; "+y+" < "+A+".length; "+y+"++) {"),this._emitLine("var "+L+" = "+A+"["+y+"];"),this._emitLine('frame.set("'+g.name.value+'", '+L+");"),this._emitLoopBindings(g,A,y,S),this._withScopedSyntax(function(){C.compile(g.body,w)}),this._emitLine("}")}this._emitLine("}"),g.else_&&(this._emitLine("if (!"+S+") {"),this.compile(g.else_,w),this._emitLine("}")),this._emitLine("frame = frame.pop();")},x._compileAsyncLoop=function(g,w,C){var y=this,S=this._tmpid(),A=this._tmpid(),_=this._tmpid(),P=C?"asyncAll":"asyncEach";if(w=w.push(),this._emitLine("frame = frame.push();"),this._emit("var "+_+" = runtime.fromIterator("),this._compileExpression(g.arr,w),this._emitLine(");"),g.name instanceof s.Array){var F=g.name.children.length;this._emit("runtime."+P+"("+_+", "+F+", function("),g.name.children.forEach(function(L){y._emit(L.value+",")}),this._emit(S+","+A+",next) {"),g.name.children.forEach(function(L){var k=L.value;w.set(k,k),y._emitLine('frame.set("'+k+'", '+k+");")})}else{var B=g.name.value;this._emitLine("runtime."+P+"("+_+", 1, function("+B+", "+S+", "+A+",next) {"),this._emitLine('frame.set("'+B+'", '+B+");"),w.set(B,B)}this._emitLoopBindings(g,_,S,A),this._withScopedSyntax(function(){var L;C&&(L=y._pushBuffer()),y.compile(g.body,w),y._emitLine("next("+S+(L?","+L:"")+");"),C&&y._popBuffer()});var j=this._tmpid();this._emitLine("}, "+this._makeCallback(j)),this._addScopeLevel(),C&&this._emitLine(this.buffer+" += "+j+";"),g.else_&&(this._emitLine("if (!"+_+".length) {"),this.compile(g.else_,w),this._emitLine("}")),this._emitLine("frame = frame.pop();")},x.compileAsyncEach=function(g,w){this._compileAsyncLoop(g,w)},x.compileAsyncAll=function(g,w){this._compileAsyncLoop(g,w,!0)},x._compileMacro=function(g,w){var C=this,y=[],S=null,A="macro_"+this._tmpid(),_=w!==void 0;g.args.children.forEach(function(k,T){T===g.args.children.length-1&&k instanceof s.Dict?S=k:(C.assertType(k,s.Symbol),y.push(k))});var P=[].concat(y.map(function(k){return"l_"+k.value}),["kwargs"]),F=y.map(function(k){return'"'+k.value+'"'}),B=(S&&S.children||[]).map(functio
`))})},x.compileRoot=function(g,w){var C=this;w&&this.fail("compileRoot: root node can't have frame"),w=new f,this._emitFuncBegin(g,"root"),this._emitLine("var parentTemplate = null;"),this._compileChildren(g,w),this._emitLine("if(parentTemplate) {"),this._emitLine("parentTemplate.rootRenderFunc(env, context, frame, runtime, cb);"),this._emitLine("} else {"),this._emitLine("cb(null, "+this.buffer+");"),this._emitLine("}"),this._emitFuncEnd(!0),this.inBlock=!0;var y=[],S=g.findAll(s.Block);S.forEach(function(A,_){var P=A.name.value;if(y.indexOf(P)!==-1)throw new Error('Block "'+P+'" defined more than once.');y.push(P),C._emitFuncBegin(A,"b_"+P);var F=new f;C._emitLine("var frame = frame.push(true);"),C.compile(A.body,F),C._emitFuncEnd()}),this._emitLine("return {"),S.forEach(function(A,_){var P="b_"+A.name.value;C._emitLine(P+": "+P+",")}),this._emitLine(`root: root
2024-02-04 14:26:02 +00:00
};`)},x.compile=function(g,w){var C=this["compile"+g.typename];C?C.call(this,g,w):this.fail("compile: Cannot compile node: "+g.typename,g.lineno,g.colno)},x.getCode=function(){return this.codebuf.join("")},v}(b);e.exports={compile:function(v,x,E,g,w){w===void 0&&(w={});var C=new m(g,w.throwOnUndefined),y=(E||[]).map(function(A){return A.preprocess}).filter(function(A){return!!A}),S=y.reduce(function(A,_){return _(A)},v);return C.compile(o.transform(r.parse(S,E,w),x,g)),C.getCode()},Compiler:m}},function(e,t,a){"use strict";function n(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,i(l,u)}function i(l,u){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,p){return f.__proto__=p,f},i(l,u)}var r=a(4),o=a(1),s=o.EmitterObj;e.exports=function(l){n(u,l);function u(){return l.apply(this,arguments)||this}var c=u.prototype;return c.resolve=function(p,b){return r.resolve(r.dirname(p),b)},c.isRelative=function(p){return p.indexOf("./")===0||p.indexOf("../")===0},u}(s)},function(e,t,a){"use strict";function n(F,B){F.prototype=Object.create(B.prototype),F.prototype.constructor=F,i(F,B)}function i(F,B){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(L,k){return L.__proto__=k,L},i(F,B)}var r=a(12),o=a(15),s=a(0),l=a(5),u=a(18),c=a(10),f=c.FileSystemLoader,p=c.WebLoader,b=c.PrecompiledLoader,d=a(20),m=a(21),h=a(1),v=h.Obj,x=h.EmitterObj,E=a(2),g=E.handleError,w=E.Frame,C=a(22);function y(F,B,j){r(function(){F(B,j)})}var S={type:"code",obj:{root:function(B,j,L,k,T){try{T(null,"")}catch(N){T(g(N,null,null))}}}},A=function(F){n(B,F);function B(){return F.apply(this,arguments)||this}var j=B.prototype;return j.init=function(k,T){var N=this;T=this.opts=T||{},this.opts.dev=!!T.dev,this.opts.autoescape=T.autoescape!=null?T.autoescape:!0,this.opts.throwOnUndefined=!!T.throwOnUndefined,this.opts.trimBlocks=!!T.trimBlocks,this.opts.lstripBlocks=!!T.lstripBlocks,this.loaders=[],k?this.loaders=s.isArray(k)?k:[k]:f?this.loaders=[new f("views")]:p&&(this.loaders=[new p("/views")]),typeof window!="undefined"&&window.nunjucksPrecompiled&&this.loaders.unshift(new b(window.nunjucksPrecompiled)),this._initLoaders(),this.globals=m(),this.filters={},this.tests={},this.asyncFilters=[],this.extensions={},this.extensionsList=[],s._entries(u).forEach(function(M){var D=M[0],V=M[1];return N.addFilter(D,V)}),s._entries(d).forEach(function(M){var D=M[0],V=M[1];return N.addTest(D,V)})},j._initLoaders=function(){var k=this;this.loaders.forEach(function(T){T.cache={},typeof T.on=="function"&&(T.on("update",function(N,M){T.cache[N]=null,k.emit("update",N,M,T)}),T.on("load",function(N,M){k.emit("load",N,M,T)}))})},j.invalidateCache=function(){this.loaders.forEach(function(k){k.cache={}})},j.addExtension=function(k,T){return T.__name=k,this.extensions[k]=T,this.extensionsList.push(T),this},j.removeExtension=function(k){var T=this.getExtension(k);T&&(this.extensionsList=s.without(this.extensionsList,T),delete this.extensions[k])},j.getExtension=function(k){return this.extensions[k]},j.hasExtension=function(k){return!!this.extensions[k]},j.addGlobal=function(k,T){return this.globals[k]=T,this},j.getGlobal=function(k){if(typeof this.globals[k]=="undefined")throw new Error("global not found: "+k);return this.globals[k]},j.addFilter=function(k,T,N){var M=T;return N&&this.asyncFilters.push(k),this.filters[k]=M,this},j.getFilter=function(k){if(!this.filters[k])throw new Error("filter not found: "+k);return this.filters[k]},j.addTest=function(k,T){return this.tests[k]=T,this},j.getTest=function(k){if(!this.tests[k])throw new Error("test not found: "+k);return this.tests[k]},j.resolveTemplate=function(k,T,N){var M=k.isRelative&&T?k.isRelative(N):!1;return M&&k.resolve?k.resolve(T,N):N},j.getTemplate=function(k,T,N,M,D){var V=this,q=this,Z=null;if(k&&k.raw&&(k=k.raw),s.isFunction(N)&&(D=N,N=null,T=T||!1),s.isFunction(T)&&(D=T,T=!1),k instanceof P)Z=k;else{if(typeof k!="string")throw new Error("template names must be a string: "+k);for(var pe=0;pe<this.loaders.length;pe++){var fe=this.loaders[pe];if(Z=fe.cache[this.reso
\r\xA0`,r="()[]{}%*-+~/#,:|.<>=!",o="0123456789",s="{%",l="%}",u="{{",c="}}",f="{#",p="#}",b="string",d="whitespace",m="data",h="block-start",v="block-end",x="variable-start",E="variable-end",g="comment",w="left-paren",C="right-paren",y="left-bracket",S="right-bracket",A="left-curly",_="right-curly",P="operator",F="comma",B="colon",j="tilde",L="pipe",k="int",T="float",N="boolean",M="none",D="symbol",V="special",q="regex";function Z(fe,ee,oe,U){return{type:fe,value:ee,lineno:oe,colno:U}}var pe=function(){function fe(oe,U){this.str=oe,this.index=0,this.len=oe.length,this.lineno=0,this.colno=0,this.in_code=!1,U=U||{};var X=U.tags||{};this.tags={BLOCK_START:X.blockStart||s,BLOCK_END:X.blockEnd||l,VARIABLE_START:X.variableStart||u,VARIABLE_END:X.variableEnd||c,COMMENT_START:X.commentStart||f,COMMENT_END:X.commentEnd||p},this.trimBlocks=!!U.trimBlocks,this.lstripBlocks=!!U.lstripBlocks}var ee=fe.prototype;return ee.nextToken=function(){var U=this.lineno,X=this.colno,$;if(this.in_code){var he=this.current();if(this.isFinished())return null;if(he==='"'||he==="'")return Z(b,this._parseString(he),U,X);if($=this._extract(i))return Z(d,$,U,X);if(($=this._extractString(this.tags.BLOCK_END))||($=this._extractString("-"+this.tags.BLOCK_END)))return this.in_code=!1,this.trimBlocks&&(he=this.current(),he===`
`?this.forward():he==="\r"&&(this.forward(),he=this.current(),he===`
2024-02-04 14:26:02 +00:00
`?this.forward():this.back())),Z(v,$,U,X);if(($=this._extractString(this.tags.VARIABLE_END))||($=this._extractString("-"+this.tags.VARIABLE_END)))return this.in_code=!1,Z(E,$,U,X);if(he==="r"&&this.str.charAt(this.index+1)==="/"){this.forwardN(2);for(var qe="";!this.isFinished();)if(this.current()==="/"&&this.previous()!=="\\"){this.forward();break}else qe+=this.current(),this.forward();for(var ze=["g","i","m","y"],ht="";!this.isFinished();){var R=ze.indexOf(this.current())!==-1;if(R)ht+=this.current(),this.forward();else break}return Z(q,{body:qe,flags:ht},U,X)}else if(r.indexOf(he)!==-1){this.forward();var z=["==","===","!=","!==","<=",">=","//","**"],J=he+this.current(),H;switch(n.indexOf(z,J)!==-1&&(this.forward(),he=J,n.indexOf(z,J+this.current())!==-1&&(he=J+this.current(),this.forward())),he){case"(":H=w;break;case")":H=C;break;case"[":H=y;break;case"]":H=S;break;case"{":H=A;break;case"}":H=_;break;case",":H=F;break;case":":H=B;break;case"~":H=j;break;case"|":H=L;break;default:H=P}return Z(H,he,U,X)}else if($=this._extractUntil(i+r),$.match(/^[-+]?[0-9]+$/))if(this.current()==="."){this.forward();var ne=this._extract(o);return Z(T,$+"."+ne,U,X)}else return Z(k,$,U,X);else{if($.match(/^(true|false)$/))return Z(N,$,U,X);if($==="none")return Z(M,$,U,X);if($==="null")return Z(M,$,U,X);if($)return Z(D,$,U,X);throw new Error("Unexpected value while parsing: "+$)}}else{var K=this.tags.BLOCK_START.charAt(0)+this.tags.VARIABLE_START.charAt(0)+this.tags.COMMENT_START.charAt(0)+this.tags.COMMENT_END.charAt(0);if(this.isFinished())return null;if(($=this._extractString(this.tags.BLOCK_START+"-"))||($=this._extractString(this.tags.BLOCK_START)))return this.in_code=!0,Z(h,$,U,X);if(($=this._extractString(this.tags.VARIABLE_START+"-"))||($=this._extractString(this.tags.VARIABLE_START)))return this.in_code=!0,Z(x,$,U,X);$="";var Ae,ue=!1;for(this._matches(this.tags.COMMENT_START)&&(ue=!0,$=this._extractString(this.tags.COMMENT_START));(Ae=this._extractUntil(K))!==null;)if($+=Ae,(this._matches(this.tags.BLOCK_START)||this._matches(this.tags.VARIABLE_START)||this._matches(this.tags.COMMENT_START))&&!ue){if(this.lstripBlocks&&this._matches(this.tags.BLOCK_START)&&this.colno>0&&this.colno<=$.length){var Ne=$.slice(-this.colno);if(/^\s+$/.test(Ne)&&($=$.slice(0,-this.colno),!$.length))return this.nextToken()}break}else if(this._matches(this.tags.COMMENT_END)){if(!ue)throw new Error("unexpected end of comment");$+=this._extractString(this.tags.COMMENT_END);break}else $+=this.current(),this.forward();if(Ae===null&&ue)throw new Error("expected end of comment, got end of file");return Z(ue?g:m,$,U,X)}},ee._parseString=function(U){this.forward();for(var X="";!this.isFinished()&&this.current()!==U;){var $=this.current();if($==="\\"){switch(this.forward(),this.current()){case"n":X+=`
`;break;case"t":X+=" ";break;case"r":X+="\r";break;default:X+=this.current()}this.forward()}else X+=$,this.forward()}return this.forward(),X},ee._matches=function(U){if(this.index+U.length>this.len)return null;var X=this.str.slice(this.index,this.index+U.length);return X===U},ee._extractString=function(U){return this._matches(U)?(this.forwardN(U.length),U):null},ee._extractUntil=function(U){return this._extractMatching(!0,U||"")},ee._extract=function(U){return this._extractMatching(!1,U)},ee._extractMatching=function(U,X){if(this.isFinished())return null;var $=X.indexOf(this.current());if(U&&$===-1||!U&&$!==-1){var he=this.current();this.forward();for(var qe=X.indexOf(this.current());(U&&qe===-1||!U&&qe!==-1)&&!this.isFinished();)he+=this.current(),this.forward(),qe=X.indexOf(this.current());return he}return""},ee._extractRegex=function(U){var X=this.currentStr().match(U);return X?(this.forwardN(X[0].length),X):null},ee.isFinished=function(){return this.index>=this.len},ee.forwardN=function(U){for(var X=0;X<U;X++)this.forward()},ee.forward=function(){this.index++,this.previous()===`
`?(this.lineno++,this.colno=0):this.colno++},ee.backN=function(U){for(var X=0;X<U;X++)this.back()},ee.back=function(){if(this.index--,this.current()===`
`){this.lineno--;var U=this.src.lastIndexOf(`
`,this.index-1);U===-1?this.colno=this.index:this.colno=this.index-U}else this.colno--},ee.current=function(){return this.isFinished()?"":this.str.charAt(this.index)},ee.currentStr=function(){return this.isFinished()?"":this.str.substr(this.index)},ee.previous=function(){return this.str.charAt(this.index-1)},fe}();e.exports={lex:function(ee,oe){return new pe(ee,oe)},TOKEN_STRING:b,TOKEN_WHITESPACE:d,TOKEN_DATA:m,TOKEN_BLOCK_START:h,TOKEN_BLOCK_END:v,TOKEN_VARIABLE_START:x,TOKEN_VARIABLE_END:E,TOKEN_COMMENT:g,TOKEN_LEFT_PAREN:w,TOKEN_RIGHT_PAREN:C,TOKEN_LEFT_BRACKET:y,TOKEN_RIGHT_BRACKET:S,TOKEN_LEFT_CURLY:A,TOKEN_RIGHT_CURLY:_,TOKEN_OPERATOR:P,TOKEN_COMMA:F,TOKEN_COLON:B,TOKEN_TILDE:j,TOKEN_PIPE:L,TOKEN_INT:k,TOKEN_FLOAT:T,TOKEN_BOOLEAN:N,TOKEN_NONE:M,TOKEN_SYMBOL:D,TOKEN_SPECIAL:V,TOKEN_REGEX:q}},function(e,t,a){"use strict";function n(u,c){u.prototype=Object.create(c.prototype),u.prototype.constructor=u,i(u,c)}function i(u,c){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(p,b){return p.__proto__=b,p},i(u,c)}var r=a(6),o=a(19),s=o.PrecompiledLoader,l=function(u){n(c,u);function c(p,b){var d;return d=u.call(this)||this,d.baseURL=p||".",b=b||{},d.useCache=!!b.useCache,d.async=!!b.async,d}var f=c.prototype;return f.resolve=function(b,d){throw new Error("relative templates not support in the browser yet")},f.getSource=function(b,d){var m=this,h=this.useCache,v;return this.fetch(this.baseURL+"/"+b,function(x,E){if(x)if(d)d(x.content);else if(x.status===404)v=null;else throw x.content;else v={src:E,path:b,noCache:!h},m.emit("load",b,v),d&&d(null,v)}),v},f.fetch=function(b,d){if(typeof window=="undefined")throw new Error("WebLoader can only by used in a browser");var m=new XMLHttpRequest,h=!0;m.onreadystatechange=function(){m.readyState===4&&h&&(h=!1,m.status===0||m.status===200?d(null,m.responseText):d({status:m.status,content:m.responseText}))},b+=(b.indexOf("?")===-1?"?":"&")+"s="+new Date().getTime(),m.open("GET",b,this.async),m.send()},c}(r);e.exports={WebLoader:l,PrecompiledLoader:s}},function(e,t,a){"use strict";var n=a(0),i=a(7),r=i.Environment,o=i.Template,s=a(6),l=a(10),u=a(23),c=a(5),f=a(8),p=a(9),b=a(2),d=a(3),m=a(25),h;function v(x,E){E=E||{},n.isObject(x)&&(E=x,x=null);var g;return l.FileSystemLoader?g=new l.FileSystemLoader(x,{watch:E.watch,noCache:E.noCache}):l.WebLoader&&(g=new l.WebLoader(x,{useCache:E.web&&E.web.useCache,async:E.web&&E.web.async})),h=new r(g,E),E&&E.express&&h.express(E.express),h}e.exports={Environment:r,Template:o,Loader:s,FileSystemLoader:l.FileSystemLoader,NodeResolveLoader:l.NodeResolveLoader,PrecompiledLoader:l.PrecompiledLoader,WebLoader:l.WebLoader,compiler:c,parser:f,lexer:p,runtime:b,lib:n,nodes:d,installJinjaCompat:m,configure:v,reset:function(){h=void 0},compile:function(E,g,w,C){return h||v(),new o(E,g,w,C)},render:function(E,g,w){return h||v(),h.render(E,g,w)},renderString:function(E,g,w){return h||v(),h.renderString(E,g,w)},precompile:u?u.precompile:void 0,precompileString:u?u.precompileString:void 0}},function(e,t,a){"use strict";var n=a(13),i=[],r=[],o=n.makeRequestCallFromTimer(s);function s(){if(r.length)throw r.shift()}e.exports=l;function l(c){var f;i.length?f=i.pop():f=new u,f.task=c,n(f)}function u(){this.task=null}u.prototype.call=function(){try{this.task.call()}catch(c){l.onerror?l.onerror(c):(r.push(c),o())}finally{this.task=null,i[i.length]=this}}},function(e,t,a){"use strict";(function(n){e.exports=i;function i(m){r.length||(s(),o=!0),r[r.length]=m}var r=[],o=!1,s,l=0,u=1024;function c(){for(;l<r.length;){var m=l;if(l=l+1,r[m].call(),l>u){for(var h=0,v=r.length-l;h<v;h++)r[h]=r[h+l];r.length-=l,l=0}}r.length=0,l=0,o=!1}var f=typeof n!="undefined"?n:self,p=f.MutationObserver||f.WebKitMutationObserver;typeof p=="function"?s=b(c):s=d(c),i.requestFlush=s;function b(m){var h=1,v=new p(m),x=document.createTextNode("");return v.observe(x,{characterData:!0}),function(){h=-h,x.data=h}}function d(m){return function(){var v=setTimeout(E,0),x=setInterval(E,50);function E(){clearTimeout(v),clearInterval(x),m()}}}i.makeRequestCallFromTimer=d}).call(t,a(14
`),ne=n.repeat(" ",z),K=H.map(function(Ae,ue){return ue===0&&!J?Ae:""+ne+Ae}).join(`
`);return i.copySafeness(R,K)}r.indent=E;function g(R,z,J){return z=z||"",J&&(R=n.map(R,function(H){return H[J]})),R.join(z)}r.join=g;function w(R){return R[R.length-1]}r.last=w;function C(R){var z=o(R,"");return z!==void 0?typeof Map=="function"&&z instanceof Map||typeof Set=="function"&&z instanceof Set?z.size:n.isObject(z)&&!(z instanceof i.SafeString)?n.keys(z).length:z.length:0}r.length=C;function y(R){if(n.isString(R))return R.split("");if(n.isObject(R))return n._entries(R||{}).map(function(z){var J=z[0],H=z[1];return{key:J,value:H}});if(n.isArray(R))return R;throw new n.TemplateError("list filter: type not iterable")}r.list=y;function S(R){return R=o(R,""),R.toLowerCase()}r.lower=S;function A(R){return R==null?"":i.copySafeness(R,R.replace(/\r\n|\n/g,`<br />
`))}r.nl2br=A;function _(R){return R[Math.floor(Math.random()*R.length)]}r.random=_;function P(R){function z(J,H,ne){H===void 0&&(H="truthy");var K=this,Ae=K.env.getTest(H);return n.toArray(J).filter(function(Ne){return Ae.call(K,Ne,ne)===R})}return z}r.reject=P(!1);function F(R,z){return R.filter(function(J){return!J[z]})}r.rejectattr=F,r.select=P(!0);function B(R,z){return R.filter(function(J){return!!J[z]})}r.selectattr=B;function j(R,z,J,H){var ne=R;if(z instanceof RegExp)return R.replace(z,J);typeof H=="undefined"&&(H=-1);var K="";if(typeof z=="number")z=""+z;else if(typeof z!="string")return R;if(typeof R=="number"&&(R=""+R),typeof R!="string"&&!(R instanceof i.SafeString))return R;if(z==="")return K=J+R.split("").join(J)+J,i.copySafeness(R,K);var Ae=R.indexOf(z);if(H===0||Ae===-1)return R;for(var ue=0,Ne=0;Ae>-1&&(H===-1||Ne<H);)K+=R.substring(ue,Ae)+J,ue=Ae+z.length,Ne++,Ae=R.indexOf(z,ue);return ue<R.length&&(K+=R.substring(ue)),i.copySafeness(ne,K)}r.replace=j;function L(R){var z;return n.isString(R)?z=y(R):z=n.map(R,function(J){return J}),z.reverse(),n.isString(R)?i.copySafeness(R,z.join("")):z}r.reverse=L;function k(R,z,J){z=z||0;var H=Math.pow(10,z),ne;return J==="ceil"?ne=Math.ceil:J==="floor"?ne=Math.floor:ne=Math.round,ne(R*H)/H}r.round=k;function T(R,z,J){for(var H=Math.floor(R.length/z),ne=R.length%z,K=[],Ae=0,ue=0;ue<z;ue++){var Ne=Ae+ue*H;ue<ne&&Ae++;var Nt=Ae+(ue+1)*H,Vt=R.slice(Ne,Nt);J&&ue>=ne&&Vt.push(J),K.push(Vt)}return K}r.slice=T;function N(R,z,J){return J===void 0&&(J=0),z&&(R=n.map(R,function(H){return H[z]})),J+R.reduce(function(H,ne){return H+ne},0)}r.sum=N,r.sort=i.makeMacro(["value","reverse","case_sensitive","attribute"],[],function(z,J,H,ne){var K=this,Ae=n.map(z,function(Ne){return Ne}),ue=n.getAttrGetter(ne);return Ae.sort(function(Ne,Nt){var Vt=ne?ue(Ne):Ne,Ia=ne?ue(Nt):Nt;if(K.env.opts.throwOnUndefined&&ne&&(Vt===void 0||Ia===void 0))throw new TypeError('sort: attribute "'+ne+'" resolved to undefined');return!H&&n.isString(Vt)&&n.isString(Ia)&&(Vt=Vt.toLowerCase(),Ia=Ia.toLowerCase()),Vt<Ia?J?1:-1:Vt>Ia?J?-1:1:0}),Ae});function M(R){return i.copySafeness(R,R)}r.string=M;function D(R,z){R=o(R,"");var J=/<\/?([a-z][a-z0-9]*)\b[^>]*>|<!--[\s\S]*?-->/gi,H=q(R.replace(J,"")),ne="";return z?ne=H.replace(/^ +| +$/gm,"").replace(/ +/g," ").replace(/(\r\n)/g,`
`).replace(/\n\n\n+/g,`
2024-02-04 14:26:02 +00:00
`):ne=H.replace(/\s+/gi," "),i.copySafeness(R,ne)}r.striptags=D;function V(R){R=o(R,"");var z=R.split(" ").map(function(J){return u(J)});return i.copySafeness(R,z.join(" "))}r.title=V;function q(R){return i.copySafeness(R,R.replace(/^\s*|\s*$/g,""))}r.trim=q;function Z(R,z,J,H){var ne=R;if(R=o(R,""),z=z||255,R.length<=z)return R;if(J)R=R.substring(0,z);else{var K=R.lastIndexOf(" ",z);K===-1&&(K=z),R=R.substring(0,K)}return R+=H!=null?H:"...",i.copySafeness(ne,R)}r.truncate=Z;function pe(R){return R=o(R,""),R.toUpperCase()}r.upper=pe;function fe(R){var z=encodeURIComponent;if(n.isString(R))return z(R);var J=n.isArray(R)?R:n._entries(R);return J.map(function(H){var ne=H[0],K=H[1];return z(ne)+"="+z(K)}).join("&")}r.urlencode=fe;var ee=/^(?:\(|<|&lt;)?(.*?)(?:\.|,|\)|\n|&gt;)?$/,oe=/^[\w.!#$%&'*+\-\/=?\^`{|}~]+@[a-z\d\-]+(\.[a-z\d\-]+)+$/i,U=/^https?:\/\/.*$/,X=/^www\./,$=/\.(?:org|net|com)(?:\:|\/|$)/;function he(R,z,J){s(z)&&(z=1/0);var H=J===!0?' rel="nofollow"':"",ne=R.split(/(\s+)/).filter(function(K){return K&&K.length}).map(function(K){var Ae=K.match(ee),ue=Ae?Ae[1]:K,Ne=ue.substr(0,z);return U.test(ue)?'<a href="'+ue+'"'+H+">"+Ne+"</a>":X.test(ue)?'<a href="http://'+ue+'"'+H+">"+Ne+"</a>":oe.test(ue)?'<a href="mailto:'+ue+'">'+ue+"</a>":$.test(ue)?'<a href="http://'+ue+'"'+H+">"+Ne+"</a>":K});return ne.join("")}r.urlize=he;function qe(R){R=o(R,"");var z=R?R.match(/\w+/g):null;return z?z.length:null}r.wordcount=qe;function ze(R,z){var J=parseFloat(R);return s(J)?z:J}r.float=ze;var ht=i.makeMacro(["value","default","base"],[],function(z,J,H){H===void 0&&(H=10);var ne=parseInt(z,H);return s(ne)?J:ne});r.int=ht,r.d=r.default,r.e=r.escape},function(e,t,a){"use strict";function n(s,l){s.prototype=Object.create(l.prototype),s.prototype.constructor=s,i(s,l)}function i(s,l){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,f){return c.__proto__=f,c},i(s,l)}var r=a(6),o=function(s){n(l,s);function l(c){var f;return f=s.call(this)||this,f.precompiled=c||{},f}var u=l.prototype;return u.getSource=function(f){return this.precompiled[f]?{src:{type:"code",obj:this.precompiled[f]},path:f}:null},l}(r);e.exports={PrecompiledLoader:o}},function(e,t,a){"use strict";var n=a(2).SafeString;function i(_){return typeof _=="function"}t.callable=i;function r(_){return _!==void 0}t.defined=r;function o(_,P){return _%P===0}t.divisibleby=o;function s(_){return _ instanceof n}t.escaped=s;function l(_,P){return _===P}t.equalto=l,t.eq=t.equalto,t.sameas=t.equalto;function u(_){return _%2===0}t.even=u;function c(_){return!_}t.falsy=c;function f(_,P){return _>=P}t.ge=f;function p(_,P){return _>P}t.greaterthan=p,t.gt=t.greaterthan;function b(_,P){return _<=P}t.le=b;function d(_,P){return _<P}t.lessthan=d,t.lt=t.lessthan;function m(_){return _.toLowerCase()===_}t.lower=m;function h(_,P){return _!==P}t.ne=h;function v(_){return _===null}t.null=v;function x(_){return typeof _=="number"}t.number=x;function E(_){return _%2===1}t.odd=E;function g(_){return typeof _=="string"}t.string=g;function w(_){return!!_}t.truthy=w;function C(_){return _===void 0}t.undefined=C;function y(_){return _.toUpperCase()===_}t.upper=y;function S(_){return typeof Symbol!="undefined"?!!_[Symbol.iterator]:Array.isArray(_)||typeof _=="string"}t.iterable=S;function A(_){var P=_!=null&&typeof _=="object"&&!Array.isArray(_);return Set?P&&!(_ instanceof Set):P}t.mapping=A},function(e,t,a){"use strict";function n(o){var s=-1;return{current:null,reset:function(){s=-1,this.current=null},next:function(){return s++,s>=o.length&&(s=0),this.current=o[s],this.current}}}function i(o){o=o||",";var s=!0;return function(){var l=s?"":o;return s=!1,l}}function r(){return{range:function(s,l,u){typeof l=="undefined"?(l=s,s=0,u=1):u||(u=1);var c=[];if(u>0)for(var f=s;f<l;f+=u)c.push(f);else for(var p=s;p>l;p+=u)c.push(p);return c},cycler:function(){return n(Array.prototype.slice.call(arguments))},joiner:function(s){return i(s)}}}e.exports=r},function(e,t,a){var n=a(4);e.exports=function(r,o){function s(l,u){if(this.name=l,this.path=l,this.defaultEngine=u.defaultEngine,this.ext=n.e
`+u+`
})();
`,r.asFunction&&(o+="return function(ctx, cb) { return nunjucks.render("+l+`, ctx, cb); }
`),o+=`})();
2024-02-04 14:26:02 +00:00
`}return o}e.exports=n},function(e,t,a){function n(){"use strict";var i=this.runtime,r=this.lib,o=this.compiler.Compiler,s=this.parser.Parser,l=this.nodes,u=this.lexer,c=i.contextOrFrameLookup,f=i.memberLookup,p,b;o&&(p=o.prototype.assertType),s&&(b=s.prototype.parseAggregate);function d(){i.contextOrFrameLookup=c,i.memberLookup=f,o&&(o.prototype.assertType=p),s&&(s.prototype.parseAggregate=b)}i.contextOrFrameLookup=function(C,y,S){var A=c.apply(this,arguments);if(A!==void 0)return A;switch(S){case"True":return!0;case"False":return!1;case"None":return null;default:return}};function m(w){return{index:w.index,lineno:w.lineno,colno:w.colno}}if(l&&o&&s){var h=l.Node.extend("Slice",{fields:["start","stop","step"],init:function(C,y,S,A,_){S=S||new l.Literal(C,y,null),A=A||new l.Literal(C,y,null),_=_||new l.Literal(C,y,1),this.parent(C,y,S,A,_)}});o.prototype.assertType=function(C){C instanceof h||p.apply(this,arguments)},o.prototype.compileSlice=function(C,y){this._emit("("),this._compileExpression(C.start,y),this._emit("),("),this._compileExpression(C.stop,y),this._emit("),("),this._compileExpression(C.step,y),this._emit(")")},s.prototype.parseAggregate=function(){var C=this,y=m(this.tokens);y.colno--,y.index--;try{return b.apply(this)}catch(L){var S=m(this.tokens),A=function(){return r._assign(C.tokens,S),L};r._assign(this.tokens,y),this.peeked=!1;var _=this.peekToken();if(_.type!==u.TOKEN_LEFT_BRACKET)throw A();this.nextToken();for(var P=new h(_.lineno,_.colno),F=!1,B=0;B<=P.fields.length&&!this.skip(u.TOKEN_RIGHT_BRACKET);B++){if(B===P.fields.length)if(F)this.fail("parseSlice: too many slice components",_.lineno,_.colno);else break;if(this.skip(u.TOKEN_COLON))F=!0;else{var j=P.fields[B];P[j]=this.parseExpression(),F=this.skip(u.TOKEN_COLON)||F}}if(!F)throw A();return new l.Array(_.lineno,_.colno,[P])}}}function v(w,C,y,S){w=w||[],C===null&&(C=S<0?w.length-1:0),y===null?y=S<0?-1:w.length:y<0&&(y+=w.length),C<0&&(C+=w.length);for(var A=[],_=C;!(_<0||_>w.length||S>0&&_>=y||S<0&&_<=y);_+=S)A.push(i.memberLookup(w,_));return A}function x(w,C){return Object.prototype.hasOwnProperty.call(w,C)}var E={pop:function(C){if(C===void 0)return this.pop();if(C>=this.length||C<0)throw new Error("KeyError");return this.splice(C,1)},append:function(C){return this.push(C)},remove:function(C){for(var y=0;y<this.length;y++)if(this[y]===C)return this.splice(y,1);throw new Error("ValueError")},count:function(C){for(var y=0,S=0;S<this.length;S++)this[S]===C&&y++;return y},index:function(C){var y;if((y=this.indexOf(C))===-1)throw new Error("ValueError");return y},find:function(C){return this.indexOf(C)},insert:function(C,y){return this.splice(C,0,y)}},g={items:function(){return r._entries(this)},values:function(){return r._values(this)},keys:function(){return r.keys(this)},get:function(C,y){var S=this[C];return S===void 0&&(S=y),S},has_key:function(C){return x(this,C)},pop:function(C,y){var S=this[C];if(S===void 0&&y!==void 0)S=y;else{if(S===void 0)throw new Error("KeyError");delete this[C]}return S},popitem:function(){var C=r.keys(this);if(!C.length)throw new Error("KeyError");var y=C[0],S=this[y];return delete this[y],[y,S]},setdefault:function(C,y){return y===void 0&&(y=null),C in this||(this[C]=y),this[C]},update:function(C){return r._assign(this,C),null}};return g.iteritems=g.items,g.itervalues=g.values,g.iterkeys=g.keys,i.memberLookup=function(C,y,S){return arguments.length===4?v.apply(this,arguments):(C=C||{},r.isArray(C)&&x(E,y)?E[y].bind(C):r.isObject(C)&&x(g,y)?g[y].bind(C):f.apply(this,arguments))},d}e.exports=n}])})});var Bs=O((Sp,ey)=>{var Rs=require("buffer"),ea=Rs.Buffer;function Qx(e,t){for(var a in e)t[a]=e[a]}ea.from&&ea.alloc&&ea.allocUnsafe&&ea.allocUnsafeSlow?ey.exports=Rs:(Qx(Rs,Sp),Sp.Buffer=pn);function pn(e,t,a){return ea(e,t,a)}pn.prototype=Object.create(ea.prototype);Qx(ea,pn);pn.from=function(e,t,a){if(typeof e=="number")throw new TypeError("Argument must not be a number");return ea(e,t,a)};pn.alloc=function(e,t,a){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=ea(e);return t!==void 0?typeo
GFS4: `),console.error(e)});We[ct]||(gy=global[ct]||[],yy(We,gy),We.close=function(e){function t(a,n){return e.call(We,a,function(i){i||xy(),typeof n=="function"&&n.apply(this,arguments)})}return Object.defineProperty(t,Ms,{value:e}),t}(We.close),We.closeSync=function(e){function t(a){e.apply(We,arguments),xy()}return Object.defineProperty(t,Ms,{value:e}),t}(We.closeSync),/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")&&process.on("exit",function(){dn(We[ct]),require("assert").equal(We[ct].length,0)}));var gy;global[ct]||yy(global,We[ct]);Tp.exports=Ip(c3(We));process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!We.__patched&&(Tp.exports=Ip(We),We.__patched=!0);function Ip(e){s3(e),e.gracefulify=Ip,e.createReadStream=w,e.createWriteStream=C;var t=e.readFile;e.readFile=a;function a(A,_,P){return typeof _=="function"&&(P=_,_=null),F(A,_,P);function F(B,j,L,k){return t(B,j,function(T){T&&(T.code==="EMFILE"||T.code==="ENFILE")?Jn([F,[B,j,L],T,k||Date.now(),Date.now()]):typeof L=="function"&&L.apply(this,arguments)})}}var n=e.writeFile;e.writeFile=i;function i(A,_,P,F){return typeof P=="function"&&(F=P,P=null),B(A,_,P,F);function B(j,L,k,T,N){return n(j,L,k,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?Jn([B,[j,L,k,T],M,N||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var r=e.appendFile;r&&(e.appendFile=o);function o(A,_,P,F){return typeof P=="function"&&(F=P,P=null),B(A,_,P,F);function B(j,L,k,T,N){return r(j,L,k,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?Jn([B,[j,L,k,T],M,N||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var s=e.copyFile;s&&(e.copyFile=l);function l(A,_,P,F){return typeof P=="function"&&(F=P,P=0),B(A,_,P,F);function B(j,L,k,T,N){return s(j,L,k,function(M){M&&(M.code==="EMFILE"||M.code==="ENFILE")?Jn([B,[j,L,k,T],M,N||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}var u=e.readdir;e.readdir=f;var c=/^v[0-5]\./;function f(A,_,P){typeof _=="function"&&(P=_,_=null);var F=c.test(process.version)?function(L,k,T,N){return u(L,B(L,k,T,N))}:function(L,k,T,N){return u(L,k,B(L,k,T,N))};return F(A,_,P);function B(j,L,k,T){return function(N,M){N&&(N.code==="EMFILE"||N.code==="ENFILE")?Jn([F,[j,L,k],N,T||Date.now(),Date.now()]):(M&&M.sort&&M.sort(),typeof k=="function"&&k.call(this,N,M))}}}if(process.version.substr(0,4)==="v0.8"){var p=l3(e);v=p.ReadStream,E=p.WriteStream}var b=e.ReadStream;b&&(v.prototype=Object.create(b.prototype),v.prototype.open=x);var d=e.WriteStream;d&&(E.prototype=Object.create(d.prototype),E.prototype.open=g),Object.defineProperty(e,"ReadStream",{get:function(){return v},set:function(A){v=A},enumerable:!0,configurable:!0}),Object.defineProperty(e,"WriteStream",{get:function(){return E},set:function(A){E=A},enumerable:!0,configurable:!0});var m=v;Object.defineProperty(e,"FileReadStream",{get:function(){return m},set:function(A){m=A},enumerable:!0,configurable:!0});var h=E;Object.defineProperty(e,"FileWriteStream",{get:function(){return h},set:function(A){h=A},enumerable:!0,configurable:!0});function v(A,_){return this instanceof v?(b.apply(this,arguments),this):v.apply(Object.create(v.prototype),arguments)}function x(){var A=this;S(A.path,A.flags,A.mode,function(_,P){_?(A.autoClose&&A.destroy(),A.emit("error",_)):(A.fd=P,A.emit("open",P),A.read())})}function E(A,_){return this instanceof E?(d.apply(this,arguments),this):E.apply(Object.create(E.prototype),arguments)}function g(){var A=this;S(A.path,A.flags,A.mode,function(_,P){_?(A.destroy(),A.emit("error",_)):(A.fd=P,A.emit("open",P))})}function w(A,_){return new e.ReadStream(A,_)}function C(A,_){return new e.WriteStream(A,_)}var y=e.open;e.open=S;function S(A,_,P,F){return typeof P=="function"&&(F=P,P=null),B(A,_,P,F);function B(j,L,k,T,N){return y(j,L,k,function(M,D){M&&(M.code==="EMFILE"||M.code==="ENFILE")?Jn([B,[j,L,k,T],M,N||Date.now(),Date.now()]):typeof T=="function"&&T.apply(this,arguments)})}}return e}function Jn(e){dn("ENQUEUE",e[0].name,e[1]),We[ct].push(e),_p()}var Ls;function xy(){for(var e=Date.now(),t=0;t<We[ct].length;++t)We[ct][t].length>2&&(We[
`)),e.linkname&&(t+=$p(" linkpath="+e.linkname+`
`));var a=e.pax;if(a)for(var n in a)t+=$p(" "+n+"="+a[n]+`
2024-02-04 14:26:02 +00:00
`);return k6(t)};ei.decodePax=function(e){for(var t={};e.length;){for(var a=0;a<e.length&&e[a]!==32;)a++;var n=parseInt(e.slice(0,a).toString(),10);if(!n)return t;var i=e.slice(a+1,n-1).toString(),r=i.indexOf("=");if(r===-1)return t;t[i.slice(0,r)]=i.slice(r+1),e=e.slice(n)}return t};ei.encode=function(e){var t=F6(512),a=e.name,n="";if(e.typeflag===5&&a[a.length-1]!=="/"&&(a+="/"),Buffer.byteLength(a)!==a.length)return null;for(;Buffer.byteLength(a)>100;){var i=a.indexOf("/");if(i===-1)return null;n+=n?"/"+a.slice(0,i):a.slice(0,i),a=a.slice(i+1)}return Buffer.byteLength(a)>100||Buffer.byteLength(n)>155||e.linkname&&Buffer.byteLength(e.linkname)>100?null:(t.write(a),t.write(La(e.mode&B6,6),100),t.write(La(e.uid,6),108),t.write(La(e.gid,6),116),t.write(La(e.size,11),124),t.write(La(e.mtime.getTime()/1e3|0,11),136),t[156]=xw+L6(e.type),e.linkname&&t.write(e.linkname,157),t.write(R6,257),e.uname&&t.write(e.uname,265),e.gname&&t.write(e.gname,297),t.write(La(e.devmajor||0,6),329),t.write(La(e.devminor||0,6),337),n&&t.write(n,345),t.write(La(ww(t),6),148),t)};ei.decode=function(e,t){var a=e[156]===0?0:e[156]-xw,n=Qn(e,0,100,t),i=Ma(e,100,8),r=Ma(e,108,8),o=Ma(e,116,8),s=Ma(e,124,12),l=Ma(e,136,12),u=j6(a),c=e[157]===0?null:Qn(e,157,100,t),f=Qn(e,265,32),p=Qn(e,297,32),b=Ma(e,329,8),d=Ma(e,337,8);e[345]&&(n=Qn(e,345,155,t)+"/"+n),a===0&&n&&n[n.length-1]==="/"&&(a=5);var m=ww(e);if(m===8*32)return null;if(m!==Ma(e,148,8))throw new Error("Invalid tar header. Maybe the tar is corrupted or it needs to be gunzipped?");return{name:n,mode:i,uid:r,gid:o,size:s,mtime:new Date(1e3*l),type:u,linkname:c,uname:f,gname:p,devmajor:b,devminor:d}}});var Kp=O((wH,Cw)=>{"use strict";Cw.exports=xa;var Ys=ja(),Sw=Object.create(Zn());Sw.inherits=fn();Sw.inherits(xa,Ys);function D6(e,t){var a=this._transformState;a.transforming=!1;var n=a.writecb;if(!n)return this.emit("error",new Error("write callback called multiple times"));a.writechunk=null,a.writecb=null,t!=null&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function xa(e){if(!(this instanceof xa))return new xa(e);Ys.call(this,e),this._transformState={afterTransform:D6.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",z6)}function z6(){var e=this;typeof this._flush=="function"?this._flush(function(t,a){Ew(e,t,a)}):Ew(this,null,null)}xa.prototype.push=function(e,t){return this._transformState.needTransform=!1,Ys.prototype.push.call(this,e,t)};xa.prototype._transform=function(e,t,a){throw new Error("_transform() is not implemented")};xa.prototype._write=function(e,t,a){var n=this._transformState;if(n.writecb=a,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};xa.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&t.writecb&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};xa.prototype._destroy=function(e,t){var a=this;Ys.prototype._destroy.call(this,e,function(n){t(n),a.emit("close")})};function Ew(e,t,a){if(t)return e.emit("error",t);if(a!=null&&e.push(a),e._writableState.length)throw new Error("Calling transform done when ws.length != 0");if(e._transformState.transforming)throw new Error("Calling transform done when still transforming");return e.push(null)}});var Tw=O((EH,_w)=>{"use strict";_w.exports=ur;var Aw=Kp(),Iw=Object.create(Zn());Iw.inherits=fn();Iw.inherits(ur,Aw);function ur(e){if(!(this instanceof ur))return new ur(e);Aw.call(this,e)}ur.prototype._transform=function(e,t,a){a(null,e)}});var ti=O((ta,kw)=>{ta=kw.exports=Gp();ta.Stream=ta;ta.Readable=ta;ta.Writable=Vp();ta.Duplex=ja();ta.Transform=Kp();ta.PassThrough=Tw()});var jw=O((SH,Nw)=>{var Pw=require
${n.slice(0,77)}...`,e,a),this.name="ParseError",this.statusCode=t,this.statusMessage=ef.STATUS_CODES[this.statusCode]}};la.exports.HTTPError=class extends sa{constructor(e,t,a,n){t?t=t.replace(/\r?\n/g," ").trim():t=ef.STATUS_CODES[e],super(`Response code ${e} (${t})`,{},n),this.name="HTTPError",this.statusCode=e,this.statusMessage=t,this.headers=a}};la.exports.MaxRedirectsError=class extends sa{constructor(e,t,a){super("Redirected 10 times. Aborting.",{},a),this.name="MaxRedirectsError",this.statusCode=e,this.statusMessage=ef.STATUS_CODES[this.statusCode],this.redirectUrls=t}};la.exports.UnsupportedProtocolError=class extends sa{constructor(e){super(`Unsupported protocol "${e.protocol}"`,{},e),this.name="UnsupportedProtocolError"}};la.exports.CancelError=MN.CancelError});var qC=O((pV,ZC)=>{"use strict";var WC=require("events"),zN=require("http"),GN=require("https"),NC=require("stream").PassThrough,HN=require("stream").Transform,Tr=require("url"),jC=require("fs"),LC=require("querystring"),MC=ZS(),WN=qS(),VN=rC(),xe=Zd(),DC=cC(),UN=pC(),JN=fC(),ZN=hC(),qN=jd(),zC=vC(),XN=Md(),$N=gC(),YN=_C(),KN=Yd(),QN=Qd(),GC=OC(),Rl=Bs().Buffer,HC=RC(),ej=BC(),tj=new Set([300,301,302,303,304,305,307,308]),aj=new Set([300,303,307,308]),tf=e=>xe.nodeStream(e)&&xe.function(e.getBoundary),nj=e=>{let t=e.body;return e.headers["content-length"]?Number(e.headers["content-length"]):!t&&!e.stream?0:xe.string(t)?Rl.byteLength(t):tf(t)?GC(t.getLength.bind(t))():t instanceof jC.ReadStream?GC(jC.stat)(t.path).then(a=>a.size):xe.nodeStream(t)&&xe.buffer(t._buffer)?t._buffer.length:null};function VC(e){e=e||{};let t=new WC,a=e.href||Tr.resolve(Tr.format(e),e.path),n=[],i=xe.object(e.agent)?e.agent:null,r=0,o,s,l=0,u=c=>{if(c.protocol!=="http:"&&c.protocol!=="https:"){t.emit("error",new tt.UnsupportedProtocolError(c));return}let f=c.protocol==="https:"?GN:zN;if(i){let m=c.protocol==="https:"?"https":"http";c.agent=i[m]||c.agent}if(c.useElectronNet&&process.versions.electron){let m=require("electron");f=m.net||m.remote.net}let p,d=new MC(f.request,c.cache)(c,m=>{clearInterval(p),t.emit("uploadProgress",{percent:1,transferred:l,total:s});let h=m.statusCode;m.url=o||a,m.requestUrl=a;let v=c.followRedirect&&"location"in m.headers,x=v&&tj.has(h);if(v&&aj.has(h)||x&&(c.method==="GET"||c.method==="HEAD")){if(m.resume(),h===303&&(c.method="GET"),n.length>=10){t.emit("error",new tt.MaxRedirectsError(h,n,c),null,m);return}let g=Rl.from(m.headers.location,"binary").toString();o=Tr.resolve(Tr.format(c),g),n.push(o);let w=Object.assign({},c,Tr.parse(o));t.emit("redirect",m,w),u(w);return}setImmediate(()=>{try{ij(m,c,t,n)}catch(g){t.emit("error",g)}})});d.on("error",m=>{m instanceof MC.RequestError?t.emit("error",new tt.RequestError(m,c)):t.emit("error",new tt.CacheError(m,c))}),d.once("request",m=>{let h=!1;m.once("abort",v=>{h=!0}),m.once("error",v=>{if(clearInterval(p),h)return;let x=c.retries(++r,v);if(x){setTimeout(u,x,c);return}t.emit("error",new tt.RequestError(v,c))}),t.once("request",v=>{t.emit("uploadProgress",{percent:0,transferred:0,total:s});let x=v.connection;if(x){let E=x.connecting===void 0?x._connecting:x.connecting,g=()=>{p=setInterval(()=>{if(x.destroyed){clearInterval(p);return}let C=l,y=v._header?Rl.byteLength(v._header):0;l=x.bytesWritten-y,s&&l>s&&(l=s),!(l===C||l===s)&&t.emit("uploadProgress",{percent:s?l/s:0,transferred:l,total:s})},150)};E?x.once("connect",g):g()}}),c.gotTimeout&&(clearInterval(p),UN(m,c.gotTimeout)),setImmediate(()=>{t.emit("request",m)})})};return setImmediate(()=>{Promise.resolve(nj(e)).then(c=>{s=c,xe.undefined(e.headers["content-length"])&&xe.undefined(e.headers["transfer-encoding"])&&tf(e.body)&&(e.headers["content-length"]=c),u(e)}).catch(c=>{t.emit("error",c)})}),t}function ij(e,t,a,n){let i=Number(e.headers["content-length"])||null,r=0,o=new HN({transform(l,u,c){r+=l.length;let f=i?r/i:0;f<1&&a.emit("downloadProgress",{percent:f,transferred:r,total:i}),c(null,l)},flush(l){a.emit("downloadProgress",{percent:1,transferred:r,total:i}),l()}});XN(e,o),o.redirectUrls=n;let s=t.decompress===!0&&xe.function(zC)&&t.method
`).filter(n=>!!n)){let[n,...i]=a.split("=");t[n]=i.join("=")}return t};async function pv(e){if(fo.default.platform==="win32")return fo.default.env;try{let{stdout:t}=await(0,uv.default)(e||cv,rk,{env:ok});return sk(t)}catch(t){if(e)throw t;return fo.default.env}}async function dv(){let{PATH:e}=await pv();return e}var Ba=require("obsidian");var Ni,Q,bv,lk,$a,fv,gv,lu,xv,mo={},yv=[],ck=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,bo=Array.isArray;function ma(e,t){for(var a in t)e[a]=t[a];return e}function wv(e){var t=e.parentNode;t&&t.removeChild(e)}function se(e,t,a){var n,i,r,o={};for(r in t)r=="key"?n=t[r]:r=="ref"?i=t[r]:o[r]=t[r];if(arguments.length>2&&(o.children=arguments.length>3?Ni.call(arguments,2):a),typeof e=="function"&&e.defaultProps!=null)for(r in e.defaultProps)o[r]===void 0&&(o[r]=e.defaultProps[r]);return Ri(e,o,n,i,null)}function Ri(e,t,a,n,i){var r={type:e,props:t,key:a,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:i==null?++bv:i};return i==null&&Q.vnode!=null&&Q.vnode(r),r}function uu(){return{current:null}}function rt(e){return e.children}function Ct(e,t){this.props=e,this.context=t}function Bi(e,t){if(t==null)return e.__?Bi(e.__,e.__.__k.indexOf(e)+1):null;for(var a;t<e.__k.length;t++)if((a=e.__k[t])!=null&&a.__e!=null)return a.__e;return typeof e.type=="function"?Bi(e):null}function Ev(e){var t,a;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((a=e.__k[t])!=null&&a.__e!=null){e.__e=e.__c.base=a.__e;break}return Ev(e)}}function cu(e){(!e.__d&&(e.__d=!0)&&$a.push(e)&&!ho.__r++||fv!==Q.debounceRendering)&&((fv=Q.debounceRendering)||gv)(ho)}function ho(){var e,t,a,n,i,r,o,s;for($a.sort(lu);e=$a.shift();)e.__d&&(t=$a.length,n=void 0,i=void 0,o=(r=(a=e).__v).__e,(s=a.__P)&&(n=[],(i=ma({},r)).__v=r.__v+1,pu(s,r,i,a.__n,s.ownerSVGElement!==void 0,r.__h!=null?[o]:null,n,o==null?Bi(r):o,r.__h),_v(n,r),r.__e!=o&&Ev(r)),$a.length>t&&$a.sort(lu));ho.__r=0}function Sv(e,t,a,n,i,r,o,s,l,u){var c,f,p,b,d,m,h,v=n&&n.__k||yv,x=v.length;for(a.__k=[],c=0;c<t.length;c++)if((b=a.__k[c]=(b=t[c])==null||typeof b=="boolean"||typeof b=="function"?null:typeof b=="string"||typeof b=="number"||typeof b=="bigint"?Ri(null,b,null,null,b):bo(b)?Ri(rt,{children:b},null,null,null):b.__b>0?Ri(b.type,b.props,b.key,b.ref?b.ref:null,b.__v):b)!=null){if(b.__=a,b.__b=a.__b+1,(p=v[c])===null||p&&b.key==p.key&&b.type===p.type)v[c]=void 0;else for(f=0;f<x;f++){if((p=v[f])&&b.key==p.key&&b.type===p.type){v[f]=void 0;break}p=null}pu(e,b,p=p||mo,i,r,o,s,l,u),d=b.__e,(f=b.ref)&&p.ref!=f&&(h||(h=[]),p.ref&&h.push(p.ref,null,b),h.push(f,b.__c||d,b)),d!=null?(m==null&&(m=d),typeof b.type=="function"&&b.__k===p.__k?b.__d=l=Cv(b,l,e):l=Av(e,b,p,v,d,l),typeof a.type=="function"&&(a.__d=l)):l&&p.__e==l&&l.parentNode!=e&&(l=Bi(p))}for(a.__e=m,c=x;c--;)v[c]!=null&&(typeof a.type=="function"&&v[c].__e!=null&&v[c].__e==a.__d&&(a.__d=Iv(n).nextSibling),kv(v[c],v[c]));if(h)for(c=0;c<h.length;c++)Tv(h[c],h[++c],h[++c])}function Cv(e,t,a){for(var n,i=e.__k,r=0;i&&r<i.length;r++)(n=i[r])&&(n.__=e,t=typeof n.type=="function"?Cv(n,t,a):Av(a,n,n,i,n.__e,t));return t}function $t(e,t){return t=t||[],e==null||typeof e=="boolean"||(bo(e)?e.some(function(a){$t(a,t)}):t.push(e)),t}function Av(e,t,a,n,i,r){var o,s,l;if(t.__d!==void 0)o=t.__d,t.__d=void 0;else if(a==null||i!=r||i.parentNode==null)e:if(r==null||r.parentNode!==e)e.appendChild(i),o=null;else{for(s=r,l=0;(s=s.nextSibling)&&l<n.length;l+=1)if(s==i)break e;e.insertBefore(i,r),o=r}return o!==void 0?o:i.nextSibling}function Iv(e){var t,a,n;if(e.type==null||typeof e.type=="string")return e.__e;if(e.__k){for(t=e.__k.length-1;t>=0;t--)if((a=e.__k[t])&&(n=Iv(a)))return n}return null}function uk(e,t,a,n,i){var r;for(r in a)r==="children"||r==="key"||r in t||vo(e,r,null,a[r],n);for(r in t)i&&typeof t[r]!="function"||r==="children"||r==="key"||r==="value"||r==="checked"||a[r]===t[r]||vo(e,r,t[r],a[r],n)}function mv(e,t,a){t[0]==="-"?e.setProperty(t,a==null?"":a):e[t]=a==null?"":typeof a!="number"||ck.test(t)?a:a+"px"}fu
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Le(e,t){return Fu(e)||Pu(e,t)||Gi(e,t)||Ou()}var Uu=_e(Ab()),Hu=_e(Jb()),Wu=_e(pg());function dg(e){var t=e[0],a=e[1],n=e[2],i,r,o;return i=t*1+a*0+n*1.13983,r=t*1+a*-.39465+n*-.5806,o=t*1+a*2.02311+n*0,i=Math.min(Math.max(0,i),1),r=Math.min(Math.max(0,r),1),o=Math.min(Math.max(0,o),1),[i*255,r*255,o*255]}function fg(e){var t=e[0]/255,a=e[1]/255,n=e[2]/255,i=t*.299+a*.587+n*.114,r=t*-.14713+a*-.28886+n*.436,o=t*.615+a*-.51499+n*-.10001;return[i,r,o]}function mg(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),a.push.apply(a,n)}return a}function It(e){for(var t=1;t<arguments.length;t++){var a=arguments[t]!=null?arguments[t]:{};t%2?mg(Object(a),!0).forEach(function(n){jt(e,n,a[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):mg(Object(a)).forEach(function(n){Object.defineProperty(e,n,Object.getOwnPropertyDescriptor(a,n))})}return e}var vg=Uu.default,hg=Object.keys(vg),QF=function(t){return t<.25?1:t<.5?.9-t:1.1-t},eP=function(t){var a=(0,Hu.default)(t),n=fg(a.array()),i=Le(n,3),r=i[0],o=i[1],s=i[2],l=[QF(r),o,s],u=dg(l);return Hu.default.rgb(u).hex()},zn=function(t){return function(a){return{className:[a.className,t.className].filter(Boolean).join(" "),style:It(It({},a.style||{}),t.style||{})}}},tP=function(t,a){if(t===void 0)return a;if(a===void 0)return t;var n=ft(t),i=ft(a);switch(n){case"string":switch(i){case"string":return[a,t].filter(Boolean).join(" ");case"object":return zn({className:t,style:a});case"function":return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return zn({className:t})(a.apply(void 0,[r].concat(s)))}}break;case"object":switch(i){case"string":return zn({className:a,style:t});case"object":return It(It({},a),t);case"function":return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return zn({style:t})(a.apply(void 0,[r].concat(s)))}}break;case"function":switch(i){case"string":return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return t.apply(void 0,[zn(r)({className:a})].concat(s))};case"object":return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return t.apply(void 0,[zn(r)({style:a})].concat(s))};case"function":return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),l=1;l<o;l++)s[l-1]=arguments[l];return t.apply(void 0,[a.apply(void 0,[r].concat(s))].concat(s))}}}},aP=function(t,a){var n=Object.keys(a);for(var i in t)n.indexOf(i)===-1&&n.push(i);return n.reduce(function(r,o){return r[o]=tP(t[o],a[o]),r},{})},nP=function(t,a){for(var n=arguments.length,i=new Array(n>2?n-2:0),r=2;r<n;r++)i[r-2]=arguments[r];if(a===null)return t;Array.isArray(a)||(a=[a]);var o=a.map(function(l){return t[l]}).filter(Boolean),s=o.reduce(function(l,u){return typeof u=="string"?l.className=[l.className,u].filter(Boolean).join(" "):ft(u)==="object"?l.style=It(It({},l.style),u):typeof u=="function"&&(l=It(It({},l),u.apply(void 0,[l].concat(i)))),l},{className:"",style:{}});return s.className||delete s.className,Object.keys(s.style).length===0&&delete s.style,s},Vu=function(t){return Object.keys(t).reduce(function(a,n){return a[n]=/^base/.test(n)?eP(t[n]):n==="scheme"?t[n]+":inverted":t[n],a},{})},bg=(0,Wu.default)(function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},n=t.defaultBase16,i=n===void 0?vg:n,r=t.base16Themes,o=r===void 0?null:r,s=iP(a,o);s&&(a=It(It({},s),a));for(var l=hg.reduce(function(m,h){return m[h]=a[h]||i[h],m},{}),u=Object.keys(a).reduce(function(m,h){return hg.indexOf(h)===-1&&(m[h]=a[h]),m},{}),c=e(l),f=aP(u,c),p=arguments.length,b=new Array(p>3?p-3:0),d=3;d<p;d++)b[d-3]=arguments[d];return(0,Wu.default)(nP,2).apply(void 0,[f].concat(b))},3),gg=f
`:`
2024-02-04 14:26:02 +00:00
`.charCodeAt(),a=typeof e=="string"?"\r":"\r".charCodeAt();return e[e.length-1]===t&&(e=e.slice(0,-1)),e[e.length-1]===a&&(e=e.slice(0,-1)),e}var Xi=_e(require("node:process"),1),Gn=_e(require("node:path"),1),Cg=_e(require("node:url"),1);function ds(e={}){let{env:t=process.env,platform:a=process.platform}=e;return a!=="win32"?"PATH":Object.keys(t).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"}function fP(e={}){let{cwd:t=Xi.default.cwd(),path:a=Xi.default.env[ds()],execPath:n=Xi.default.execPath}=e,i,r=t instanceof URL?Cg.default.fileURLToPath(t):t,o=Gn.default.resolve(r),s=[];for(;i!==o;)s.push(Gn.default.join(o,"node_modules/.bin")),i=o,o=Gn.default.resolve(o,"..");return s.push(Gn.default.resolve(r,n,"..")),[...s,a].join(Gn.default.delimiter)}function Ag({env:e=Xi.default.env,...t}={}){e={...e};let a=ds({env:e});return t.path=e[a],e[a]=fP(t),e}var mP=(e,t,a,n)=>{if(a==="length"||a==="prototype"||a==="arguments"||a==="caller")return;let i=Object.getOwnPropertyDescriptor(e,a),r=Object.getOwnPropertyDescriptor(t,a);!hP(i,r)&&n||Object.defineProperty(e,a,r)},hP=function(e,t){return e===void 0||e.configurable||e.writable===t.writable&&e.enumerable===t.enumerable&&e.configurable===t.configurable&&(e.writable||e.value===t.value)},vP=(e,t)=>{let a=Object.getPrototypeOf(t);a!==Object.getPrototypeOf(e)&&Object.setPrototypeOf(e,a)},bP=(e,t)=>`/* Wrapped ${e}*/
${t}`,gP=Object.getOwnPropertyDescriptor(Function.prototype,"toString"),xP=Object.getOwnPropertyDescriptor(Function.prototype.toString,"name"),yP=(e,t,a)=>{let n=a===""?"":`with ${a.trim()}() `,i=bP.bind(null,n,t.toString());Object.defineProperty(i,"name",xP),Object.defineProperty(e,"toString",{...gP,value:i})};function Zu(e,t,{ignoreNonConfigurable:a=!1}={}){let{name:n}=e;for(let i of Reflect.ownKeys(t))mP(e,t,i,a);return vP(e,t),yP(e,t,n),e}var fs=new WeakMap,Ig=(e,t={})=>{if(typeof e!="function")throw new TypeError("Expected a function");let a,n=0,i=e.displayName||e.name||"<anonymous>",r=function(...o){if(fs.set(r,++n),n===1)a=e.apply(this,o),e=null;else if(t.throw===!0)throw new Error(`Function \`${i}\` can only be called once`);return a};return Zu(r,e),fs.set(r,n),r};Ig.callCount=e=>{if(!fs.has(e))throw new Error(`The given function \`${e.name}\` is not wrapped by the \`onetime\` package`);return fs.get(e)};var _g=Ig;var Rg=require("node:os");var Tg=()=>{let e=Fg-kg+1;return Array.from({length:e},wP)},wP=(e,t)=>({name:`SIGRT${t+1}`,number:kg+t,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),kg=34,Fg=64;var Og=require("node:os");var Pg=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,
${n.message}`:m,x=[v,t,e].filter(Boolean).join(`
`);return h?(n.originalMessage=n.message,n.message=x):n=new Error(x),n.shortMessage=v,n.command=o,n.escapedCommand=s,n.exitCode=r,n.signal=i,n.signalDescription=p,n.stdout=e,n.stderr=t,a!==void 0&&(n.all=a),"bufferedData"in n&&delete n.bufferedData,n.failed=!0,n.timedOut=!!l,n.isCanceled=u,n.killed=c&&!l,n};var ms=["stdin","stdout","stderr"],kP=e=>ms.some(t=>e[t]!==void 0),Ng=e=>{if(!e)return;let{stdio:t}=e;if(t===void 0)return ms.map(n=>e[n]);if(kP(e))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${ms.map(n=>`\`${n}\``).join(", ")}`);if(typeof t=="string")return t;if(!Array.isArray(t))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof t}\``);let a=Math.max(t.length,ms.length);return Array.from({length:a},(n,i)=>t[i])};var jg=_e(require("node:os"),1),Lg=_e(eu(),1),FP=1e3*5,Mg=(e,t="SIGTERM",a={})=>{let n=e(t);return PP(e,t,a,n),n},PP=(e,t,a,n)=>{if(!OP(t,a,n))return;let i=BP(a),r=setTimeout(()=>{e("SIGKILL")},i);r.unref&&r.unref()},OP=(e,{forceKillAfterTimeout:t},a)=>RP(e)&&t!==!1&&a,RP=e=>e===jg.default.constants.signals.SIGTERM||typeof e=="string"&&e.toUpperCase()==="SIGTERM",BP=({forceKillAfterTimeout:e=!0})=>{if(e===!0)return FP;if(!Number.isFinite(e)||e<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`);return e},Dg=(e,t)=>{e.kill()&&(t.isCanceled=!0)},NP=(e,t,a)=>{e.kill(t),a(Object.assign(new Error("Timed out"),{timedOut:!0,signal:t}))},zg=(e,{timeout:t,killSignal:a="SIGTERM"},n)=>{if(t===0||t===void 0)return n;let i,r=new Promise((s,l)=>{i=setTimeout(()=>{NP(e,a,l)},t)}),o=n.finally(()=>{clearTimeout(i)});return Promise.race([r,o])},Gg=({timeout:e})=>{if(e!==void 0&&(!Number.isFinite(e)||e<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${e}\` (${typeof e})`)},Hg=async(e,{cleanup:t,detached:a},n)=>{if(!t||a)return n;let i=(0,Lg.default)(()=>{e.kill()});return n.finally(()=>{i()})};var Wg=require("node:fs"),Vg=require("node:child_process");function hs(e){return e!==null&&typeof e=="object"&&typeof e.pipe=="function"}function Xu(e){return hs(e)&&e.writable!==!1&&typeof e._write=="function"&&typeof e._writableState=="object"}var jP=e=>e instanceof Vg.ChildProcess&&typeof e.then=="function",$u=(e,t,a)=>{if(typeof a=="string")return e[t].pipe((0,Wg.createWriteStream)(a)),e;if(Xu(a))return e[t].pipe(a),e;if(!jP(a))throw new TypeError("The second argument must be a string, a stream or an Execa child process.");if(!Xu(a.stdin))throw new TypeError("The target child process's stdin must be available.");return e[t].pipe(a.stdin),a},Ug=e=>{e.stdout!==null&&(e.pipeStdout=$u.bind(void 0,e,"stdout")),e.stderr!==null&&(e.pipeStderr=$u.bind(void 0,e,"stderr")),e.all!==void 0&&(e.pipeAll=$u.bind(void 0,e,"all"))};var bs=require("node:fs");var ep=_e(qg(),1),Xg=_e(au(),1),$g=e=>{if(e!==void 0)throw new TypeError("The `input` and `inputFile` options cannot be both set.")},WP=({input:e,inputFile:t})=>typeof t!="string"?e:($g(e),(0,bs.readFileSync)(t)),Yg=e=>{let t=WP(e);if(hs(t))throw new TypeError("The `input` option cannot be a stream in sync mode");return t},VP=({input:e,inputFile:t})=>typeof t!="string"?e:($g(e),(0,bs.createReadStream)(t)),Kg=(e,t)=>{let a=VP(t);a!==void 0&&(hs(a)?a.pipe(e.stdin):e.stdin.end(a))},Qg=(e,{all:t})=>{if(!t||!e.stdout&&!e.stderr)return;let a=(0,Xg.default)();return e.stdout&&a.add(e.stdout),e.stderr&&a.add(e.stderr),a},Ku=async(e,t)=>{if(!(!e||t===void 0)){e.destroy();try{return await t}catch(a){return a.bufferedData}}},Qu=(e,{encoding:t,buffer:a,maxBuffer:n})=>{if(!(!e||!a))return t?(0,ep.default)(e,{encoding:t,maxBuffer:n}):ep.default.buffer(e,{maxBuffer:n})},ex=async({stdout:e,stderr:t,all:a},{encoding:n,buffer:i,maxBuffer:r},o)=>{let s=Qu(e,{encoding:n,buffer:i,maxBuffer:r}),l=Qu(t,{encoding:n,buffer:i,maxBuffer:r}),u=Qu(a,{encoding:n,buffer:i,maxBuffer:r*2});try{return await Promise.all([o,s,l,u])}catch(c){return Promise.all([{error:c,signal:c.signal,timedOut:c.timedOut},Ku(e,s),Ku(t,l),Ku(a,u)])}};
`)};var QP=1e3*1e3*100,eO=({env:e,extendEnv:t,preferLocal:a,localDir:n,execPath:i})=>{let r=t?{...Ki.default.env,...e}:e;return a?Ag({env:r,cwd:n,execPath:i}):r},mx=(e,t,a={})=>{let n=fx.default._parse(e,t,a);return e=n.command,t=n.args,a=n.options,a={maxBuffer:QP,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:a.cwd||Ki.default.cwd(),execPath:Ki.default.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,verbose:cx,...a},a.env=eO(a),a.stdio=Ng(a),Ki.default.platform==="win32"&&dx.default.basename(e,".exe")==="cmd"&&t.unshift("/q"),{file:e,args:t,options:a,parsed:n}},Qi=(e,t,a)=>typeof t!="string"&&!px.Buffer.isBuffer(t)?a===void 0?void 0:"":e.stripFinalNewline?Ju(t):t;function er(e,t,a){let n=mx(e,t,a),i=ap(e,t),r=np(e,t);rp(r,n.options),Gg(n.options);let o;try{o=xs.default.spawn(n.file,n.args,n.options)}catch(b){let d=new xs.default.ChildProcess,m=Promise.reject($i({error:b,stdout:"",stderr:"",all:"",command:i,escapedCommand:r,parsed:n,timedOut:!1,isCanceled:!1,killed:!1}));return tp(d,m),d}let s=tx(o),l=zg(o,n.options,s),u=Hg(o,n.options,l),c={isCanceled:!1};o.kill=Mg.bind(null,o.kill.bind(o)),o.cancel=Dg.bind(null,o,c);let p=_g(async()=>{let[{error:b,exitCode:d,signal:m,timedOut:h},v,x,E]=await ex(o,n.options,u),g=Qi(n.options,v),w=Qi(n.options,x),C=Qi(n.options,E);if(b||d!==0||m!==null){let y=$i({error:b,exitCode:d,signal:m,stdout:g,stderr:w,all:C,command:i,escapedCommand:r,parsed:n,timedOut:h,isCanceled:c.isCanceled||(n.options.signal?n.options.signal.aborted:!1),killed:o.killed});if(!n.options.reject)return y;throw y}return{command:i,escapedCommand:r,exitCode:0,stdout:g,stderr:w,all:C,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}});return Kg(o,n.options),o.all=Qg(o,n.options),Ug(o),tp(o,p),o}function tO(e,t,a){let n=mx(e,t,a),i=ap(e,t),r=np(e,t);rp(r,n.options);let o=Yg(n.options),s;try{s=xs.default.spawnSync(n.file,n.args,{...n.options,input:o})}catch(c){throw $i({error:c,stdout:"",stderr:"",all:"",command:i,escapedCommand:r,parsed:n,timedOut:!1,isCanceled:!1,killed:!1})}let l=Qi(n.options,s.stdout,s.error),u=Qi(n.options,s.stderr,s.error);if(s.error||s.status!==0||s.signal!==null){let c=$i({stdout:l,stderr:u,error:s.error,signal:s.signal,exitCode:s.status,command:i,escapedCommand:r,parsed:n,timedOut:s.error&&s.error.code==="ETIMEDOUT",isCanceled:!1,killed:s.signal!==null});if(!n.options.reject)return c;throw c}return{command:i,escapedCommand:r,exitCode:0,stdout:l,stderr:u,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}var aO=({input:e,inputFile:t,stdio:a})=>e===void 0&&t===void 0&&a===void 0?{stdin:"inherit"}:{},ux=(e={})=>({preferLocal:!0,...aO(e),...e});function hx(e){function t(a,...n){if(!Array.isArray(a))return hx({...e,...a});let[i,...r]=ip(a,n);return er(i,r,ux(e))}return t.sync=(a,...n)=>{if(!Array.isArray(a))throw new TypeError("Please use $(options).sync`command` instead of $.sync(options)`command`.");let[i,...r]=ip(a,n);return tO(i,r,ux(e))},t}var Bz=hx();var lt=_e(require("fs")),op=require("obsidian"),tn=_e(require("os")),Lt=_e(require("path"));function sp(){return require("electron").remote.BrowserWindow.getFocusedWindow()}function lp(e){return e<10?`0${e}`:e.toString()}function an(){return app.vault.adapter.getBasePath()}function _t(){return Lt.default.join(an(),"./.obsidian/plugins/obsidian-zotero-desktop-connector/")}function nn(){return tn.default.platform()==="win32"?"pdfannots2json.exe":`pdfannots2json-${tn.default.platform()}-${tn.default.arch()}`}function vx(){tn.default.platform()!=="win32"&&lt.default.renameSync(Lt.default.join(_t(),cp()),Lt.default.join(_t(),nn()))}function cp(){return tn.default.platform()==="win32"?"pdfannots2json.exe":"pdfannots2json"}function bx(){return tn.default.platform()==="win32"?"pdf-annots2json.exe":"pdf-annots2json"}function Hn(e){return e?lt.default.existsSync(e):lt.default.existsSync(Lt.default.join(_t(),nn()))}function gx(e){return e?lt.default.existsSync(e):lt.default.existsSync(Lt.default.join(_t(),cp()))}function xx(){return lt.default.existsSync(Lt.default.join(_t(),bx()))}function yx(){lt.default.rmSync(Lt.default
{%- if creators and creators.length > 0 -%}
{%- for creator in creators -%}
{%- if creator.name -%}
{{creator.name}}
{%- else -%}
{{creator.firstName}} {{creator.lastName}}
{%- endif -%}
{% if not loop.last %}, {% endif %}
{%- endfor -%}
{%- endif -%}
2024-02-04 14:26:02 +00:00
`,pO=`
{%- if attachments and attachments.length > 0 -%}
{%- set file = attachments | filterby("path", "endswith", ".pdf") | first -%}
{%- if file and file.path and file.path.endsWith(".pdf") -%}
[{{file.title}}](file://{{file.path | replace(" ", "%20")}})
{%- endif -%}
{%- endif -%}
2024-02-04 14:26:02 +00:00
`,dO=`
{%- if attachments and attachments.length > 0 -%}
{%- set file = attachments | filterby("path", "endswith", ".pdf") | first -%}
{%- if file and file.path and file.path.endsWith(".pdf") -%}
[{{file.title}}]({{file.desktopURI}})
{%- endif -%}
{%- endif -%}
2024-02-04 14:26:02 +00:00
`,_x=`
{%- if annotations and annotations.length > 0 -%}
{%- set annots = annotations | filterby("date", "dateafter", lastExportDate) -%}
{%- if annots.length > 0 %}
**Imported: {{importDate | format("YYYY-MM-DD")}}**
{% for annotation in annots -%}
{%- if annotation.annotatedText -%}
> \u201C{{annotation.annotatedText}}\u201D{% if annotation.color %} {{annotation.colorCategory}} {{annotation.type | capitalize}} {% else %} {{annotation.type | capitalize}} {% endif %}[Page {{annotation.page}}]({{annotation.attachment.desktopURI.replace("select", "open-pdf")}}?page={{annotation.pageLabel}}&annotation={{annotation.id}})
{%- endif %}
{%- if annotation.imageRelativePath -%}
> ![[{{annotation.imageRelativePath}}]]
{%- endif %}
{% if annotation.comment %}
{{annotation.comment}}
{% endif %}
{% endfor -%}
{%- endif -%}
{%- endif -%}
2024-02-04 14:26:02 +00:00
`;async function ws(e,t){var r,o,s;if(!t)return t;let a=(t.creators||[]).reduce((l,u)=>(l[u.creatorType]||(l[u.creatorType]=[]),l[u.creatorType].push(u),l),{});await Promise.all(Object.keys(a).map(async l=>{t[`${l}s`]=(await bt(e,uO,{creators:a[l]})).trim()}));let n=(await bt(e,pO,t)).trim();n&&(t.pdfLink=n);let i=(await bt(e,dO,t)).trim();if(i&&(t.pdfZoteroLink=i),(r=t.notes)!=null&&r.length){let l=t.notes.reduce((u,c)=>c.note?`${u}
${c.note.trim()}`:u,"").trim();l&&(t.markdownNotes=l)}return(o=t.tags)!=null&&o.length&&(t.allTags=t.tags.map(l=>l.tag).join(", "),t.hashTags=t.tags.map(l=>`#${l.tag.replace(/\s+/g,"-")}`).join(", ")),(s=t.annotations)!=null&&s.length&&(t.formattedAnnotationsNew=(await bt(e,_x,t)).trim(),t.formattedAnnotations=(await bt(e,_x,{...t,lastExportDate:(0,Tx.moment)(0)})).trim()),t}var Pa=require("obsidian");var kx=require("obsidian"),nt=class extends kx.Modal{constructor(a,n){super(a);this.message=n}onOpen(){this.contentEl.createDiv({text:this.message})}onClose(){this.contentEl.empty()}};var Es=_e(require("path")),Mt={"Content-Type":"application/json","User-Agent":"obsidian/zotero",Accept:"application/json",Connection:"keep-alive"};function Dt(e,t){return e==="Zotero"?"23119":e==="Juris-M"?"24119":t||"23119"}async function Ss(e){let t=Es.default.dirname(e);await app.vault.adapter.exists(t)||await app.vault.createFolder(t)}function Fx(e){return e.replace(/\s*[*?]+\s*/g," ").trim().replace(/\s*[:"<>|]+\s*/g," - ").trim()}function Vn(e){let t=Es.default.parse(e),a=Fx(t.dir),n=Fx(t.name);return Es.default.join(a,`${n}${t.ext}`)}function fO(e){let t="0",a="0",n="0";e.length==4?(t="0x"+e[1]+e[1],a="0x"+e[2]+e[2],n="0x"+e[3]+e[3]):e.length==7&&(t="0x"+e[1]+e[2],a="0x"+e[3]+e[4],n="0x"+e[5]+e[6]);let i=+t/255,r=+a/255,o=+n/255,s=Math.min(i,r,o),l=Math.max(i,r,o),u=l-s,c=0,f=0,p=0;return u==0?c=0:l==i?c=(r-o)/u%6:l==r?c=(o-i)/u+2:c=(i-r)/u+4,c=Math.round(c*60),c<0&&(c+=360),p=(l+s)/2,f=u==0?0:u/(1-Math.abs(2*p-1)),f=+(f*100).toFixed(1),p=+(p*100).toFixed(1),{h:c,s:f,l:p}}function Px(e){let{h:t,s:a,l:n}=fO(e);return n<12?"Black":n>98?"White":a<2?"Gray":t<15?"Red":t<45?"Orange":t<65?"Yellow":t<170?"Green":t<190?"Cyan":t<263?"Blue":t<280?"Purple":t<335?"Magenta":"Red"}function Qt(e,t,a){let n=t.split("/").pop(),i=`zotero://${e}`,r="";if(/group/.test(t)?r=t.replace("http://zotero.org",i):r=`${i}/library/items/${n}`,a){let o=new URLSearchParams(a);r+=`?${o}`}return r}var Pe=require("obsidian");var dp=class e{constructor(t){this.compare=t;this.heapArray=[];this._limit=0}static getChildrenIndexOf(t){return[t*2+1,t*2+2]}static getParentIndexOf(t){if(t<=0)return-1;let a=t%2?1:2;return Math.floor((t-a)/2)}push(t){return this._sortNodeUp(this.heapArray.push(t)-1),!0}length(){return this.heapArray.length}peek(){return this.heapArray[0]}pop(){let t=this.heapArray.pop();return this.length()>0&&t!==void 0?this.replace(t):t}replace(t){let a=this.heapArray[0];return this.heapArray[0]=t,this._sortNodeDown(0),a}size(){return this.length()}_moveNode(t,a){[this.heapArray[t],this.heapArray[a]]=[this.heapArray[a],this.heapArray[t]]}_sortNodeDown(t){let a=t<this.heapArray.length-1,n=this.heapArray[t],i=(r,o)=>(this.heapArray.length>o&&this.compare(this.heapArray[o],this.heapArray[r])<0&&(r=o),r);for(;a;){let r=e.getChildrenIndexOf(t),o=r.reduce(i,r[0]),s=this.heapArray[o];typeof s!="undefined"&&this.compare(n,s)>0?(this._moveNode(t,o),t=o):a=!1}}_sortNodeUp(t){let a=t>0;for(;a;){let n=e.getParentIndexOf(t);n>=0&&this.compare(this.heapArray[n],this.heapArray[t])>0?(this._moveNode(t,n),t=n):a=!1}}};function mO(e,t){return e.prio-t.prio||e.counter-t.counter}var fp=class{constructor(t,a){this.maxConcurrent=t||1,this.minCycle=a||0,this.queueRunning=new Map,this.queueWaiting=new dp(mO),this.lastRun=0,this.nextTimer=null,this.counter=0}tryRun(){for(;this.queueWaiting.size()>0&&this.queueRunning.size<this.maxConcurrent;){if(Date.now()-this.lastRun<this.minCycle){this.nextTimer===null&&(this.nextTimer=new Promise(a=>activeWindow.setTimeout(()=>{this.nextTimer=null,this.tryRun(),a()},this.minCycle-Date.now()+this.lastRun)));return}let t=this.queueWaiting.pop();if(t!==void 0){let a,i={wait:new Promise(o=>{a=o}),signal:a},r={hash:t.hash,prio:t.prio,finish:i};if(this.queueRunning.has(t.hash))throw new Error("async-await-queue: duplicate hash "+t.hash);this.queueRunning.set(t.hash,r),this.lastRun=Date.now(),t.start.signal()}}}end(t){let a=this.queueRunning.get(t);if(a===void 0)throw new Error("async-await-queue: queue desync for "+t);this.queueRunning.delete(t),a.finish.s
2024-02-04 14:26:02 +00:00
%% Import Date: ${(0,sn.moment)().toISOString(!0)} %%
`}function Gx(e){let t=e.match(/%% Begin annotations %%([\w\W]+)%% End annotations %%/);return t&&t[1]?t[1].trim():""}function Hx(e){return`
%% Begin annotations %%
${e}
%% End annotations %%
2024-02-04 14:26:02 +00:00
`}function ln(e){return e.startsWith("/")?e.replace(/^\/+/,""):e}function bp(e){return e.endsWith(".md")||(e+=".md"),e.startsWith("/")&&(e=ln(e)),e}async function gp(e,t,a,n){let i=new DOMParser().parseFromString(t,"text/html"),r=i.querySelectorAll("[data-annotation]"),o=i.querySelectorAll("[data-citation]");for(let s of Array.from(r))try{let l=s.dataset.annotation,u=l?JSON.parse(decodeURIComponent(l)):null;if(!u)return;let c=u.annotationKey,f=s instanceof HTMLImageElement;if(f){let p=a[c];if(p){let b=cn.default.parse(p),d=await bO(c,b.ext.slice(1),n),h=cn.default.parse(cn.default.join(an(),d)).dir;(0,Oa.existsSync)(h)||(0,Oa.mkdirSync)(h,{recursive:!0});let v=cn.default.join(b.dir,`${c}${b.ext}`);try{if(!(0,Oa.existsSync)(v)){let x=v;if(v=p,!(0,Oa.existsSync)(v))throw new Error("Cannot find annotation image: "+x)}(0,Oa.copyFileSync)(v,cn.default.join(an(),d))}catch(x){new zt.Notice("Error: unable to copy annotation image from Zotero into your vault",7e3),console.error(x)}s.src=d}}s.insertAdjacentElement(f?"afterend":"beforebegin",createEl("a",{text:"Go to annotation",href:Qt("open-pdf",u.attachmentURI,{page:u.pageLabel,annotation:u.annotationKey})})),f?s.insertAdjacentElement("afterend",createEl("br")):s.insertAdjacentElement("beforebegin",createSpan({text:" "}))}catch(l){console.error(l)}return o.forEach(s=>{var l;try{let u=s.dataset.citation,c=u?JSON.parse(decodeURIComponent(u)):null;if(!c||!c.citationItems.length||!((l=c.citationItems[0].uris)!=null&&l.length))return;let f=s.querySelector("span");if(!f)return;let p=f.innerText;f.empty(),f.createEl("a",{text:p,href:Qt("select",c.citationItems[0].uris[0])})}catch(u){console.error(u)}}),i.body.innerHTML}async function xp(e,t){let a=await on(e);if(!a.length)return;let n=await Ox(a,e);if(!n){new zt.Notice("No notes found for selected items",7e3);return}let i=Object.keys(n);if(!i.length){new zt.Notice("No notes found for selected items",7e3);return}let r={};for(let s of a){let l=await Cs(s,e);if(l){let u={};l.forEach(c=>{var f;(f=c.annotations)==null||f.forEach(p=>{p.annotationType==="image"&&(u[p.key]=p.annotationImagePath)})}),r[s.key]=u}}let o={};for(let s of i){let l=[];for(let u of n[s])l.push((0,zt.htmlToMarkdown)(await gp(s,u,r[s],t)));o[s]=l.join(`
2024-02-04 14:26:02 +00:00
`)}return o}async function bO(e,t,a){let n=app.vault.getConfig("attachmentFolderPath"),i=n==="."||n==="./",r=null;n.startsWith("./")&&(r=n.slice(2)),i?n=a||"":r&&(n=cn.default.join(a||"",r)),n=(0,zt.normalizePath)(n);let o=app.vault.getAbstractFileByPathInsensitive(n);return!o&&r&&(await app.vault.createFolder(n),o=app.vault.getAbstractFileByPathInsensitive(n)),o instanceof zt.TFolder?`${o.getParentPrefix()+e}.${t}`:`${e}.${t}`}function Wx(e,t){e.replaceSelection(Object.values(t).join(`
2024-02-04 14:26:02 +00:00
`))}async function Vx(e,t){let a=Object.keys(t),n=[];for(let i of a){let r=await gO(e,i,t[i]);if(!r)break;n.push(r)}return n.map(i=>i.path)}async function gO(e,t,a){let n=(0,zt.normalizePath)(Vn(ln(`${e}/${t}.md`))),i=app.vault.getAbstractFileByPath(n);try{i?await app.vault.modify(i,a):(await Ss(n),i=await app.vault.create(n,a))}catch(r){return console.error(r),new zt.Notice(`Error creating file "${n}": ${r.message}`,1e4),null}return i}var un=require("obsidian"),_s=_e(require("path"));var xO={noWrite:"-w",imageOutputPath:"-o",imageBaseName:"-n",imageFormat:"-f",imageDPI:"-d",imageQuality:"-q",ignoreBefore:"-b",attemptOCR:"-e",ocrLang:"-l",tesseractPath:"--tesseract-path",tessDataDir:"--tess-data-dir"};async function yp(e,t,a){let n=new nt(app,"Extracting annotations...");n.open();let i=[e];Object.keys(t).forEach(r=>{let o=t[r];if(o===""||o===void 0)return"";let s=xO[r];typeof o=="boolean"?o&&i.push(s):(i.push(s),typeof o=="string"&&o.startsWith("-")?i.push(`"${o}"`):i.push(o.toString()))});try{if(!Cx(a))return new un.Notice("Error: PDF utility is not executable",1e4),"[]";let o=await er(a||_s.default.join(_t(),nn()),i);if(n.close(),o.stderr.toLowerCase().includes("password"))return new un.Notice(`Error opening ${_s.default.basename(e)}: PDF is password protected`,1e4),"[]";if(o.stderr&&!o.stderr.includes("warning"))throw new un.Notice(`Error processing PDF: ${o.stderr}`,1e4),new Error(o.stderr);return o.stdout}catch(r){if(n.close(),r.message.toLowerCase().includes("password"))return new un.Notice(`Error opening ${_s.default.basename(e)}: PDF is password protected`,1e4),"[]";if(r.message.toLowerCase().includes("type3"))return new un.Notice(`Error processing annotations: ${r.message}`,1e4),"[]";throw console.error(r),new un.Notice(`Error processing PDF: ${r.message}`,1e4),r}}async function yO(e,t,a,n,i){t.note&&(t.note=(0,Be.htmlToMarkdown)(await gp(e.key,t.note,{}))),t.dateAdded&&(t.dateAdded=(0,Be.moment)(t.dateAdded)),t.dateModified&&(t.dateModified=(0,Be.moment)(t.dateModified)),t.desktopURI=Qt("select",t.uri),t.relations=await Zx(t,e.library,a,n,i)}function wO(e){var t;e.dateAdded&&(e.dateAdded=(0,Be.moment)(e.dateAdded)),e.dateModified&&(e.dateModified=(0,Be.moment)(e.dateModified)),e.uri&&(e.itemKey=e.uri.split("/").pop(),e.desktopURI=e.select||Qt("select",e.uri),(t=e.path)!=null&&t.endsWith(".pdf")&&(e.pdfURI=Qt("open-pdf",e.uri)))}function Ux(e,t,a){e.date=(0,Be.moment)(e.date),e.attachment=t,e.source="pdf",e.imagePath&&(e.imageBaseName=Jt.default.basename(e.imagePath),e.imageExtension=Jt.default.extname(e.imagePath).slice(1),e.imageRelativePath=(0,Be.normalizePath)(Jt.default.join(a,e.imageBaseName))),e.desktopURI=Qt("open-pdf",t.uri,{page:e.pageLabel})}function Jx(e,t,a,n,i,r=!1){var l;let o=e.annotationPosition.rects[0],s={date:(0,Be.moment)(e.dateModified),attachment:t,page:e.annotationPosition.pageIndex+1,pageLabel:e.annotationPageLabel,id:e.key,type:e.annotationType,x:o[0],y:o[1],color:e.annotationColor,colorCategory:Px(e.annotationColor),desktopURI:Qt("open-pdf",t.uri,{page:e.annotationPageLabel,annotation:e.key}),source:"zotero"};if(e.annotationText&&(s.annotatedText=e.annotationText),e.annotationComment&&(s.comment=e.annotationComment),e.annotationImagePath){let u=Jt.default.parse(e.annotationImagePath);s.imageBaseName=`${i}-${s.page}-x${Math.round(s.x)}-y${Math.round(s.y)}${u.ext}`,s.imageRelativePath=(0,Be.normalizePath)(Jt.default.join(n,s.imageBaseName)),s.imageExtension=u.ext.slice(1);let c=Jt.default.join(a,s.imageBaseName);if(r){(0,Ra.existsSync)(a)||(0,Ra.mkdirSync)(a,{recursive:!0});let f=Jt.default.join(u.dir,`${e.key}${u.ext}`);try{if(!(0,Ra.existsSync)(f)){let p=f;if(f=e.annotationImagePath,!(0,Ra.existsSync)(f))throw new Error("Cannot find annotation image: "+p)}(0,Ra.copyFileSync)(f,c)}catch(p){new Be.Notice("Error: unable to copy annotation image from Zotero into your vault",7e3),console.error(p)}}s.imagePath=c}return(l=e.tags)!=null&&l.length&&(s.tags=e.tags,s.allTags=e.tags.map(u=>u.tag).join(", "),s.hashTags=e.tags.map(u=>`#${u.tag.replace(/\s+/g,"-")}`).join(", ")),s}function Fs(e){let
${r}
${o}`}}}catch(n){}return a}function Ts(e,t,a){new Be.Notice(createFragment(n=>{n.createSpan({text:`Error parsing template "${t}": `}),n.createEl("code",{text:qx(e,a)})}),1e4)}function ks(e,t,a){return new Error(`Error parsing template "${t}": ${qx(e,a)}`)}async function wp(e,t,a,n){let{template:i,headerTemplate:r,annotationTemplate:o,footerTemplate:s}=await Dx(e);if(!i&&!r&&!o&&!s)throw new Error(`No templates found for export ${e.exportFormat.name}`);let l="",u=!1;if(i){try{l=await bt(e.exportFormat.templatePath,i,t),u=Kt.hasPersist(l)}catch(m){if(n)throw ks(m,e.exportFormat.templatePath,i);return Ts(m,e.exportFormat.templatePath,i),!1}return u?vp(l):l}let c="",f="",p="";try{c=r?await bt(e.exportFormat.headerTemplatePath,r,t):""}catch(m){if(n)throw ks(m,e.exportFormat.headerTemplatePath,r);return Ts(m,e.exportFormat.headerTemplatePath,r),!1}try{f=o?await bt(e.exportFormat.annotationTemplatePath,o,t):""}catch(m){if(n)throw ks(m,e.exportFormat.annotationTemplatePath,o);return Ts(m,e.exportFormat.annotationTemplatePath,o),!1}try{p=s?await bt(e.exportFormat.footerTemplatePath,s,t):""}catch(m){if(n)throw ks(m,e.exportFormat.footerTemplatePath,s);return Ts(m,e.exportFormat.footerTemplatePath,s),!1}let b=[];r&&c.trim()&&b.push(c);let d=o&&(a+f).trim();return d&&b.push(Hx(a+f)),s&&p.trim()&&b.push(p),d?vp(b.join("")):b.join("")}function EO({exportFormat:e}){return e.templatePath||e.headerTemplatePath||e.annotationTemplatePath||e.footerTemplatePath||""}async function Xx(e,t){let a={};try{let n=rn(e);n&&(a=(await Cs(n,t)||[]).reduce((r,o)=>(o!=null&&o.path&&(r[o.path]=o),r),{}))}catch(n){console.error(n)}return a}async function $x(e,t,a){var i;let n=t.attachments.find(r=>{var o,s;return((o=r.path)==null?void 0:o.endsWith(".pdf"))&&((s=r.annotations)==null?void 0:s.length)});return t.annotations=(i=n==null?void 0:n.annotations)!=null?i:[],t.lastImportDate=a,t.lastExportDate=a,t.isFirstImport=a.valueOf()===0,await ws(e,t)}async function Ep(e,t){var h,v;let a=(0,Be.moment)(),{database:n,exportFormat:i,settings:r}=e,o=EO(e),s=Hn(),l=t||await on(n);if(!l.length)return[];let u=l[0].library,c;try{c=await nr(l,n,u)}catch(x){return[]}let f=[];for(let x of c)await Ps(x,a,n,i.cslStyle);let p=an(),b=new Map,d=async(x,E)=>{if(!b.has(x)){let g=app.vault.getAbstractFileByPath(x),w=g?await app.vault.cachedRead(g):"",C=g?Gx(w):"",y=g?zx(w):(0,Be.moment)(0);b.set(x,{item:E,file:g,fileContent:w,lastImportDate:y,existingAnnotations:C})}},m=async x=>(0,Be.normalizePath)(Vn(ln(await bt(o,i.outputPathTemplate,x))));for(let x=0,E=c.length;x<E;x++){let g=c[x],w=g.attachments,C=await Xx(g,n);if(!w.length){let y=await ws(o,{annotations:[],...g}),S=await m(y);await d(S,g);continue}for(let y=0,S=w.length;y<S;y++){let A=w[y],_=A.path,P=_==null?void 0:_.endsWith(".pdf"),F=await ws(o,{annotations:[],...A,...g}),B=i.imageOutputPathTemplate?(0,Be.normalizePath)(Vn(ln(await bt(o,i.imageOutputPathTemplate,F)))):"",j=Jt.default.resolve(p,B),L=i.imageBaseNameTemplate?Vn(ln(await bt(o,i.imageBaseNameTemplate,F))):"image",k=await m(F),T=[];if(P&&((v=(h=C[_])==null?void 0:h.annotations)==null||v.forEach(N=>{var M;(M=N.annotationPosition.rects)!=null&&M.length&&T.push(Jx(N,A,j,B,L,!0))})),T.length&&r.shouldConcat&&(T=Fs(T)),P&&s)try{let N=await yp(_,{imageBaseName:L,imageDPI:r.pdfExportImageDPI,imageFormat:r.pdfExportImageFormat,imageOutputPath:j,imageQuality:r.pdfExportImageQuality,attemptOCR:r.pdfExportImageOCR,ocrLang:r.pdfExportImageOCRLang,tesseractPath:r.pdfExportImageTesseractPath,tessDataDir:r.pdfExportImageTessDataDir},r.exeOverridePath),M=JSON.parse(N);for(let D of M)Ux(D,A,B);r.shouldConcat&&M.length&&(M=Fs(M)),T.push(...M)}catch(N){}T.length&&(A.annotations=T),await d(k,g)}}for(let[x,E]of b.entries())try{let{existingAnnotations:g,file:w,fileContent:C,item:y,lastImportDate:S}=E,A=await $x(x,y,S),_=await wp(e,Kt.prepareTemplateData(A,C),g);if(!_)continue;w?await app.vault.modify(w,_):(await Ss(x),await app.vault.create(x,_)),f.push(x)}catch(g){new Be.Notice(`Import failed for ${x}, check developer console for details`,7e3),console.error(g)}return f}async funct
2024-02-04 14:26:02 +00:00
{% item %}
{% endfor %}`)})),o.preventDefault(),s.showAtMouseEvent(o)}},a?"Template Data":e[0])},kO=e=>e.map(PO).reverse().join(""),FO=/^[$_\p{ID_Start}][$\u200c\u200d\p{ID_Continue}]*$/u,PO=(e,t,a)=>typeof e=="number"?`[${e}]`:FO.test(e)?t===a.length-1?`${e}`:`.${e}`:`[${JSON.stringify(e)}]`,OO=/^#(?:[\dA-F]{3}){1,2}$|^#(?:[\dA-F]{4}){1,2}$/i,RO=(e,t)=>t instanceof Ba.moment?I.createElement(I.Fragment,null,"\u{1F4C5} ",t.format("l LTS")):typeof t=="string"&&OO.test(t)?I.createElement(I.Fragment,null,I.createElement("span",{style:{backgroundColor:t},className:"zt-color-chip"}),t):typeof t=="string"&&t.length>800?t.slice(0,800)+"...":e;var ZA=_e(UA()),Zl=require("obsidian"),Sf=_e(require("os"));var JA=require("obsidian");function ca({name:e,className:t}){return I.createElement("span",{"data-icon":e,className:t,ref:a=>{a&&(0,JA.setIcon)(a,e)}})}function s9({name:e,description:t}){return I.createElement("div",{className:"setting-item-info"},I.createElement("div",{className:"setting-item-name"},e),I.createElement("div",{className:"setting-item-description"},t))}function He({name:e,description:t,children:a,isHeading:n}){return I.createElement("div",{className:`zt-setting-item setting-item${n?" setting-item-heading":""}`},I.createElement(s9,{name:e,description:t}),I.createElement("div",{className:"setting-item-control"},a))}var Va="1.0.15",Cf=1,l9={darwin:{x64:`https://github.com/mgmeyers/pdfannots2json/releases/download/${Va}/pdfannots2json.Mac.Intel.tar.gz`,arm64:`https://github.com/mgmeyers/pdfannots2json/releases/download/${Va}/pdfannots2json.Mac.M1.tar.gz`},linux:{x64:`https://github.com/mgmeyers/pdfannots2json/releases/download/${Va}/pdfannots2json.Linux.x64.tar.gz`},win32:{x64:`https://github.com/mgmeyers/pdfannots2json/releases/download/${Va}/pdfannots2json.Windows.x64.zip`}};function c9(){let e=l9[Sf.default.platform()];if(!e)return null;let t=e[Sf.default.arch()];return t||null}async function Af(){let e=c9();if(console.log("Obsidian Zotero Integration: Downloading "+e),!e)return!1;try{xx()&&Ex(),gx()&&wx(),Hn()&&yx(),await(0,ZA.default)(e,_t(),{extract:!0}),vx()}catch(t){console.error(t),new Zl.Notice("Error downloading PDF utility. Check the console for more details.",1e4)}return!0}function qA(e){let[t,a]=I.useState(null),[n,i]=I.useState(!1),[r,o]=I.useState(!1),[s,l]=I.useState(e.settings.exeOverridePath),u=I.useMemo(()=>(0,Zl.debounce)(m=>{l(m),e.updateSetting("exeOverridePath",m)},150,!0),[]);I.useEffect(()=>{let m=Hn(s);o(m),m&&Sx(s).then(h=>{a(`v${Va}`===h)}).catch(()=>{})},[s]);let c=I.useCallback(()=>{i(!0),Af().then(m=>{i(!1),m&&(a(!0),o(!0))})},[]),f=["Extracting data from PDFs requires an external tool.","This plugin will still work without it, but annotations will not be included in exports."],b=I.createElement(He,{name:"PDF Utility Path Override",description:I.createElement(I.Fragment,null,"Override the path to the PDF utility. Specify an absolute path to the pdfannots2json executable."," ",I.createElement("a",{href:"https://github.com/mgmeyers/pdfannots2json/releases",target:"_blank",rel:"noreferrer"},"Download the executable here.")," ","You may need to provide Obsidian the appropriate OS permissions to access the executable.")},I.createElement("input",{onChange:m=>u(m.target.value),type:"text",spellCheck:!1,value:s}),I.createElement("div",{className:"clickable-icon setting-editor-extra-setting-button","aria-label":"Select the pdfannots2json executable",onClick:()=>{let m=require("electron").remote.dialog.showOpenDialogSync({properties:["openFile"]});m&&m.length&&u(m[0])}},I.createElement(ca,{name:"lucide-folder-open"})));if(r&&t)return I.createElement(I.Fragment,null,I.createElement(He,{name:"PDF Utility",description:f.join(" ")},I.createElement("div",{className:"zt-asset-success"},I.createElement("div",{className:"zt-asset-success__icon"},I.createElement(ca,{name:"check-small"})),I.createElement("div",{className:"zt-asset-success__message"},"PDF utility is up to date."))),b);let d=I.createElement(I.Fragment,null,f.join(" ")," ",r&&I.createElement("strong",{className:"mod-warning"},"The PDF extraction tool req
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ql(e){return Rf(e)||Bf(e)||Gi(e)||Nf()}function m9(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}function h9(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),e.nonce!==void 0&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}var l2=function(){function e(a){var n=this;this._insertTag=function(i){var r;n.tags.length===0?n.insertionPoint?r=n.insertionPoint.nextSibling:n.prepend?r=n.container.firstChild:r=n.before:r=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(i,r),n.tags.push(i)},this.isSpeedy=a.speedy===void 0?!0:a.speedy,this.tags=[],this.ctr=0,this.nonce=a.nonce,this.key=a.key,this.container=a.container,this.prepend=a.prepend,this.insertionPoint=a.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(n){n.forEach(this._insertTag)},t.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(h9(this));var i=this.tags[this.tags.length-1];if(!1)var r;if(this.isSpeedy){var o=m9(i);try{o.insertRule(n,o.cssRules.length)}catch(s){}}else i.appendChild(document.createTextNode(n));this.ctr++},t.flush=function(){this.tags.forEach(function(n){return n.parentNode&&n.parentNode.removeChild(n)}),this.tags=[],this.ctr=0},e}();var dt="-ms-",jr="-moz-",Se="-webkit-",Xl="comm",mi="rule",hi="decl";var c2="@import";var $l="@keyframes";var u2="@layer";var p2=Math.abs,xn=String.fromCharCode,d2=Object.assign;function f2(e,t){return $e(e,0)^45?(((t<<2^$e(e,0))<<2^$e(e,1))<<2^$e(e,2))<<2^$e(e,3):0}function Yl(e){return e.trim()}function jf(e,t){return(e=t.exec(e))?e[0]:e}function ye(e,t,a){return e.replace(t,a)}function Lr(e,t){return e.indexOf(t)}function $e(e,t){return e.charCodeAt(t)|0}function Ua(e,t,a){return e.slice(t,a)}function yt(e){return e.length}function bi(e){return e.length}function gi(e,t){return t.push(e),e}function Lf(e,t){return e.map(t).join("")}var Kl=1,xi=1,m2=0,wt=0,Qe=0,wi="";function Mr(e,t,a,n,i,r,o){return{value:e,root:t,parent:a,type:n,props:i,children:r,line:Kl,column:xi,length:o,return:""}}function Ei(e,t){return d2(Mr("",null,null,"",null,null,0),e,{length:-e.length},t)}function h2(){return Qe}function v2(){return Qe=wt>0?$e(wi,--wt):0,xi--,Qe===10&&(xi=1,Kl--),Qe}function Et(){return Qe=wt<m2?$e(wi,wt++):0,xi++,Qe===10&&(xi=1,Kl++),Qe}function Ht(){return $e(wi,wt)}function Dr(){return wt}function Si(e,t){return Ua(wi,e,t)}function yi(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Ql(e){return Kl=xi=1,m2=yt(wi=e),wt=0,[]}function ec(e){return wi="",e}function Ci(e){return Yl(Si(wt-1,Mf(e===91?e+2:e===40?e+1:e)))}function b2(e){for(;(Qe=Ht())&&Qe<33;)Et();return yi(e)>2||yi(Qe)>3?"":" "}function g2(e,t){for(;--t&&Et()&&!(Qe<48||Qe>102||Qe>57&&Qe<65||Qe>70&&Qe<97););return Si(e,Dr()+(t<6&&Ht()==32&&Et()==32))}function Mf(e){for(;Et();)switch(Qe){case e:return wt;case 34:case 39:e!==34&&e!==39&&Mf(Qe);break;case 40:e===41&&Mf(e);break;case 92:Et();break}return wt}function x2(e,t){for(;Et()&&e+Qe!==47+10;)if(e+Qe===42+42&&Ht()===47)break;return"/*"+Si(t,wt-1)+"*"+xn(e===47?e:Et())}function y2(e){for(;!yi(Ht());)Et();return Si(e,wt)}function S2(e){return ec(tc("",null,null,null,[""],e=Ql(e),0,[0],e))}function tc(e,t,a,n,i,r,o,s,l){for(var u=0,c=0,f=o,p=0,b=0,d=0,m=1,h=1,v=1,x=0,E="",g=i,w=r,C=n,y=E;h;)switch(d=x,x=Et()){case 40:if(d!=108&&$e(y,f-1)==58){Lr(y+=ye(Ci(x),"&","&\f"),"&\f")!=-1&&(v=-1);break}case 34:case 39:case 91:y+=Ci(x);break;case 9:case 10:case 13:case 32:y+=b2(d);break;case 92:y+=g2(Dr()-1,7);continue;case 47:switch(Ht()){case 42:case 47:gi(v9(x2(Et(),Dr()),t,a),l);break;default:y+="/"}break;case 123*m:s[u++]=yt(y)*v;case 125*m:case 59:case 0:switch(x){case 0:case 125:
0%, 80%, 100% { opacity: 0; }
40% { opacity: 1; }
2024-02-04 14:26:02 +00:00
`]))),DI=function(t,a){var n=t.isFocused,i=t.size,r=t.theme,o=r.colors,s=r.spacing.baseUnit;return ae({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},a?{}:{color:n?o.neutral60:o.neutral20,padding:s*2})},rm=function(t){var a=t.delay,n=t.offset;return re("span",{css:Gr({animation:"".concat(wL," 1s ease-in-out ").concat(a,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},zI=function(t){var a=t.innerProps,n=t.isRtl;return re("div",W({},Ze(t,"loadingIndicator",{indicator:!0,"loading-indicator":!0}),a),re(rm,{delay:0,offset:n}),re(rm,{delay:160,offset:!0}),re(rm,{delay:320,offset:!n}))};zI.defaultProps={size:4};var GI=function(t,a){var n=t.isDisabled,i=t.isFocused,r=t.theme,o=r.colors,s=r.borderRadius,l=r.spacing;return ae({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},a?{}:{backgroundColor:n?o.neutral5:o.neutral0,borderColor:n?o.neutral10:i?o.primary:o.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(o.primary):void 0,"&:hover":{borderColor:i?o.primary:o.neutral30}})},EL=function(t){var a=t.children,n=t.isDisabled,i=t.isFocused,r=t.innerRef,o=t.innerProps,s=t.menuIsOpen;return re("div",W({ref:r},Ze(t,"control",{control:!0,"control--is-disabled":n,"control--is-focused":i,"control--menu-is-open":s}),o),a)},SL=EL,CL=["data"],HI=function(t,a){var n=t.theme.spacing;return a?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},AL=function(t){var a=t.children,n=t.cx,i=t.getStyles,r=t.getClassNames,o=t.Heading,s=t.headingProps,l=t.innerProps,u=t.label,c=t.theme,f=t.selectProps;return re("div",W({},Ze(t,"group",{group:!0}),l),re(o,W({},s,{selectProps:f,theme:c,getStyles:i,getClassNames:r,cx:n}),u),re("div",null,a))},WI=function(t,a){var n=t.theme,i=n.colors,r=n.spacing;return ae({label:"group",cursor:"default",display:"block"},a?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:r.baseUnit*3,paddingRight:r.baseUnit*3,textTransform:"uppercase"})},IL=function(t){var a=pI(t);a.data;var n=Wt(a,CL);return re("div",W({},Ze(t,"groupHeading",{"group-heading":!0}),n))},_L=AL,TL=["innerRef","isDisabled","isHidden","inputClassName"],VI=function(t,a){var n=t.isDisabled,i=t.value,r=t.theme,o=r.spacing,s=r.colors;return ae(ae({visibility:n?"hidden":"visible",transform:i?"translateZ(0)":""},kL),a?{}:{margin:o.baseUnit/2,paddingBottom:o.baseUnit/2,paddingTop:o.baseUnit/2,color:s.neutral80})},UI={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},kL={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":ae({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},UI)},FL=function(t){return ae({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},UI)},PL=function(t){var a=t.cx,n=t.value,i=pI(t),r=i.innerRef,o=i.isDisabled,s=i.isHidden,l=i.inputClassName,u=Wt(i,TL);return re("div",W({},Ze(t,"input",{"input-container":!0}),{"data-value":n||""}),re("input",W({className:a({input:!0},l),ref:r,style:FL(s),disabled:o},u)))},OL=PL,JI=function(t,a){var n=t.theme,i=n.spacing,r=n.borderRadius,o=n.colors;return ae({label:"multiValue",display:"flex",minWidth:0},a?{}:{backgroundColor:o.neutral10,borderRadius:r/2,margin:i.baseUnit/2})},ZI=function(t,a){var n=t.theme,i=n.borderRadius,r=n.colors,o=t.cropWithEllipsis;return ae({overflow:"hidden",textOverflow:o||o===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},a?{}:{borderRadius:i/2,color:r.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},qI=function(t,a){var n=t.theme,i=n.spacing,r=n.borderRadius,o=n.colors,s=t.isFocused;return ae({alignItems:"center",display:"flex"},a?{}:{borderRadius:r/2,backgroundColor:s?o.dangerLight:voi
/*! Bundled license information:
nunjucks/browser/nunjucks.js:
(*! Browser bundle of nunjucks 3.2.4 *)
safe-buffer/index.js:
(*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
content-disposition/index.js:
(*!
* content-disposition
* Copyright(c) 2014-2017 Douglas Christopher Wilson
* MIT Licensed
*)
object-assign/index.js:
(*
object-assign
(c) Sindre Sorhus
@license MIT
*)
is-natural-number/index.js:
(*!
* is-natural-number.js | MIT (c) Shinnosuke Watanabe
* https://github.com/shinnn/is-natural-number.js
*)
strip-dirs/index.js:
(*!
* strip-dirs | MIT (c) Shinnosuke Watanabe
* https://github.com/shinnn/node-strip-dirs
*)
has-symbol-support-x/index.js:
(**
* @file Tests if ES6 Symbol is supported.
* @version 1.4.2
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module has-symbol-support-x
*)
has-to-string-tag-x/index.js:
(**
* @file Tests if ES6 @@toStringTag is supported.
* @see {@link http://www.ecma-international.org/ecma-262/6.0/#sec-@@tostringtag|26.3.1 @@toStringTag}
* @version 1.4.1
* @author Xotic750 <Xotic750@gmail.com>
* @copyright Xotic750
* @license {@link <https://opensource.org/licenses/MIT> MIT}
* @module has-to-string-tag-x
*)
mime-db/index.js:
(*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*)
react-is/cjs/react-is.production.min.js:
(** @license React v16.13.1
* react-is.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*)
*/