import{parse as e,format as t}from"@citation-js/name";import{parse as r,format as i}from"@citation-js/date";import o from"citeproc";import n from"js-yaml";var a={__proto__:null,currentVersion:function(){return this.log.length},retrieveVersion:function(e=1){if(e<=0||e>this.currentVersion())return null;{const[t,r]=this.log[e-1],i=new this.constructor(JSON.parse(t),JSON.parse(r));return i.log=this.log.slice(0,e),i}},retrieveLastVersion:function(){return this.retrieveVersion(this.currentVersion())},undo:function(e=1){return this.retrieveVersion(this.currentVersion()-e)},save:function(){return this.log.push([JSON.stringify(this.data),JSON.stringify(this._options)]),this}};const s=["real","string"],l=["json","html","string","rtf"],c=["csl","bibtex","bibtxt","citation-*","ris","ndjson"],u=["string","function"];function m(e){if("object"!=typeof e)throw new TypeError("Options not an object!");const{format:t,type:r,style:i,lang:o,append:n,prepend:a}=e;if(t&&!s.includes(t))throw new TypeError(`Option format ("${t}") should be one of: ${s}`);if(r&&!l.includes(r))throw new TypeError(`Option type ("${r}") should be one of: ${l}`);if(i&&!c.includes(i)&&!/^citation/.test(i))throw new TypeError(`Option style ("${i}") should be one of: ${c}`);if(o&&"string"!=typeof o)throw new TypeError("Option lang should be a string, but is a "+typeof o);if(a&&!u.includes(typeof a))throw new TypeError("Option prepend should be a string or a function, but is a "+typeof a);if(n&&!u.includes(typeof n))throw new TypeError("Option append should be a string or a function, but is a "+typeof n);if(/^citation/.test(i)&&"json"===r)throw new Error(`Combination type/style of json/citation-* is not valid: ${r}/${i}`);return!0}var p={__proto__:null,options:function(e,t){return m(e),t&&this.save(),Object.assign(this._options,e),this},defaultOptions:{format:"real",type:"json",style:"csl",lang:"en-US"}};function f(e){switch(e){case void 0:return"Undefined";case null:return"Null";default:return e.constructor.name}}function h(e){switch(typeof e){case"string":return"String";case"object":if(Array.isArray(e))return"Array";if("Object"===f(e))return"SimpleObject";if("Null"!==f(e))return"ComplexObject";default:return"Primitive"}}var d={__proto__:null,typeOf:f,dataTypeOf:h};function g(e,t){if(e._graph){const r=t.findIndex(({type:e})=>"@else/list+object"===e);-1!==r&&t.splice(r+1,0,...e._graph.slice(0,-1))}return e._graph=t,e}function b(e){return delete e._graph,e}var y={__proto__:null,applyGraph:g,removeGraph:b};const v={_output(e,t,r){this._log.push(t,r),this._levels.indexOf(e)v._output(e,t,r);v._console="function"==typeof console.Console?new console.Console(process.stderr):console;const w={},x={},k={};function T(e,t){switch(t){case"Array":return 0===e.length||e.every(e=>"@csl/object"===j(e))?"@csl/list+object":"@else/list+object";case"SimpleObject":case"ComplexObject":return"@csl/object";default:return"@invalid"}}function O(e=[],t){for(const r of e)if(w[r].predicate(t))return O(w[r].extensions,t)||r}function j(e){const t=h(e);return"Array"===t&&0===e.length?T(e,t):O(x[t],e)||T(e,t)}function E(e,{dataType:t,predicate:r,extends:i}){let o=[];if(e in k&&(o=k[e],delete k[e],v.debug("[core]",`Subclasses "${o}" finally registered to parent type "${e}"`)),w[e]={predicate:r,extensions:o},i){const t=w[i];t?t.extensions.push(e):(k[i]||(k[i]=[]),k[i].push(e),v.debug("[core]",`Subclass "${e}" is waiting on parent type "${i}"`))}else(x[t]||(x[t]=[])).push(e)}function S(e){delete w[e];const t=[...Object.keys(x).map(e=>x[e]),...Object.keys(w).map(e=>w[e].extensions).filter(e=>e.length>0)];t.forEach(t=>{const r=t.indexOf(e);r>-1&&t.splice(r,1)})}const _=/^(?:@(.+?))(?:\/(?:(.+?)\+)?(?:(.+)))?$/;class A{constructor(e){var t,r,i;t=this,i=["String","Array","SimpleObject","ComplexObject","Primitive"],r=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(r="validDataTypes"),r in t?Object.defineProperty(t,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[r]=i,this.data=e}validateDataType(){const e=this.data.dataType;if(e&&!this.validDataTypes.includes(e))throw new RangeError(`dataType was ${e}; expected one of ${this.validDataTypes}`)}validateParseType(){const e=this.data.predicate;if(e&&!(e instanceof RegExp||"function"==typeof e))throw new TypeError(`predicate was ${typeof e}; expected RegExp or function`)}validateTokenList(){const e=this.data.tokenList;if(e&&"object"!=typeof e)throw new TypeError(`tokenList was ${typeof e}; expected object or RegExp`)}validatePropertyConstraint(){const e=this.data.propertyConstraint;if(e&&"object"!=typeof e)throw new TypeError(`propertyConstraint was ${typeof e}; expected array or object`)}validateElementConstraint(){const e=this.data.elementConstraint;if(e&&"string"!=typeof e)throw new TypeError(`elementConstraint was ${typeof e}; expected string`)}validateExtends(){const e=this.data.extends;if(e&&"string"!=typeof e)throw new TypeError(`extends was ${typeof e}; expected string`)}validate(){if(null===this.data||"object"!=typeof this.data)throw new TypeError(`typeParser was ${typeof this.data}; expected object`);this.validateDataType(),this.validateParseType(),this.validateTokenList(),this.validatePropertyConstraint(),this.validateElementConstraint(),this.validateExtends()}parseTokenList(){let e=this.data.tokenList;if(!e)return[];e instanceof RegExp&&(e={token:e});const{token:t,split:r=/\s+/,trim:i=!0,every:o=!0}=e,n=o?"every":"some";return[e=>(e=>i?e.trim():e)(e).split(r)[n](e=>t.test(e))]}parsePropertyConstraint(){return[].concat(this.data.propertyConstraint||[]).map(({props:e,match:t,value:r})=>{switch(e=[].concat(e),t){case"any":case"some":return t=>e.some(e=>e in t&&(!r||r(t[e])));case"none":return t=>!e.some(e=>e in t&&(!r||r(t[e])));default:return t=>e.every(e=>e in t&&(!r||r(t[e])))}})}parseElementConstraint(){const e=this.data.elementConstraint;return e?[t=>t.every(t=>j(t)===e)]:[]}parsePredicate(){return this.data.predicate instanceof RegExp?[this.data.predicate.test.bind(this.data.predicate)]:this.data.predicate?[this.data.predicate]:[]}getCombinedPredicate(){const e=[...this.parsePredicate(),...this.parseTokenList(),...this.parsePropertyConstraint(),...this.parseElementConstraint()];return 0===e.length?()=>!0:1===e.length?e[0]:t=>e.every(e=>e(t))}getDataType(){return this.data.dataType?this.data.dataType:this.data.predicate instanceof RegExp||this.data.tokenList?"String":this.data.elementConstraint?"Array":"Primitive"}get dataType(){return this.getDataType()}get predicate(){return this.getCombinedPredicate()}get extends(){return this.data.extends}}class P{constructor(e,{async:t}={}){this.parser=e,this.async=t}validate(){const e=this.parser;if("function"!=typeof e)throw new TypeError(`parser was ${typeof e}; expected function`)}}class C{constructor(e,t={}){this.format=e,t.parseType&&(this.typeParser=new A(t.parseType)),t.parse&&(this.dataParser=new P(t.parse,{async:!1})),t.parseAsync&&(this.asyncDataParser=new P(t.parseAsync,{async:!0}))}validateFormat(){const e=this.format;if(!_.test(e))throw new TypeError(`format name was "${e}"; didn't match expected pattern`)}validate(){this.validateFormat(),this.typeParser&&this.typeParser.validate(),this.dataParser&&this.dataParser.validate(),this.asyncDataParser&&this.asyncDataParser.validate()}}var R={__proto__:null,TypeParser:A,DataParser:P,FormatParser:C};function I(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function B(e){for(var t=1;t"number"==typeof e)?e:!t||e.some(e=>isNaN(parseInt(e)))?void 0:e.map(e=>parseInt(e))}function F(e,t){if(e=H("language",e,t),!0===$[e])return e;if(t){if(e in $)return $[e];if(e.toLowerCase()!==e)return F(e.toLowerCase(),t)}}function H(e,t,r){const i=[].concat(M[e]);switch(M[e]){case L:return N(t,r);case D:return function(e,t){if(e instanceof Array){const r=e.map(e=>N(e,t)).filter(Boolean);return r.length?r:void 0}}(t,r);case z:return function(e,t){const r="date-parts";if("object"==typeof e&&null!==e){if(e[r]instanceof Array&&e[r].every(e=>e instanceof Array)){const i=e[r].map(e=>q(e,t)).filter(Boolean);return i.length?B(B({},e),{},{"date-parts":i}):void 0}if(e instanceof Array&&e.every(e=>e[r]instanceof Array)){const i=e.map(e=>q(e[r],t)).filter(Boolean);return i.length?{"date-parts":i}:void 0}if(e[r]instanceof Array){const i=q(e[r],t);return i&&{"date-parts":[i]}}return"literal"in e||"raw"in e?e:void 0}}(t,r);case U:return F(t,r)}if(r){if("string"==typeof t&&i.includes("number")&&!i.includes("string")&&!isNaN(+t))return parseFloat(t);if("number"==typeof t&&i.includes("string")&&!i.includes("number"))return t.toString();if(Array.isArray(t)&&t.length)return H(e,t[0],r)}if(i.includes(typeof t))return t}function G(e,t=!0){return e.map(function(e){const r={};for(const i in e){const o=H(i,e[i],t);void 0!==o&&(r[i]=o)}return r})}var J={__proto__:null,clean:G};function V(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function K(e){for(var t=1;tY(e,t));else{const i={};for(const r in e)i[r]=Y(e[r],t);r=i}return t.delete(e),r}var Z="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Q(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function ee(e){var t={exports:{}};return e(t,t.exports),t.exports}for(var te=[],re=[],ie="undefined"!=typeof Uint8Array?Uint8Array:Array,oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ne=0;ne<64;++ne)te[ne]=oe[ne],re[oe.charCodeAt(ne)]=ne;function ae(e,t,r){for(var i,o=[],n=t;n>18&63]+te[i>>12&63]+te[i>>6&63]+te[63&i]);return o.join("")}re["-".charCodeAt(0)]=62,re["_".charCodeAt(0)]=63;var se=function(e,t,r,i,o){var n,a,s=8*o-i-1,l=(1<>1,u=-7,m=r?o-1:0,p=r?-1:1,f=e[t+m];for(m+=p,n=f&(1<<-u)-1,f>>=-u,u+=s;u>0;n=256*n+e[t+m],m+=p,u-=8);for(a=n&(1<<-u)-1,n>>=-u,u+=i;u>0;a=256*a+e[t+m],m+=p,u-=8);if(0===n)n=1-c;else{if(n===l)return a?NaN:Infinity*(f?-1:1);a+=Math.pow(2,i),n-=c}return(f?-1:1)*a*Math.pow(2,n-i)},le=function(e,t,r,i,o,n){var a,s,l,c=8*n-o-1,u=(1<>1,p=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,f=i?0:n-1,h=i?1:-1,d=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||Infinity===t?(s=isNaN(t)?1:0,a=u):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),(t+=a+m>=1?p/l:p*Math.pow(2,1-m))*l>=2&&(a++,l/=2),a+m>=u?(s=0,a=u):a+m>=1?(s=(t*l-1)*Math.pow(2,o),a+=m):(s=t*Math.pow(2,m-1)*Math.pow(2,o),a=0));o>=8;e[r+f]=255&s,f+=h,s/=256,o-=8);for(a=a<0;e[r+f]=255&a,f+=h,a/=256,c-=8);e[r+f-h]|=128*d},ce=ee(function(e,t){var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=n,t.SlowBuffer=function(e){return+e!=e&&(e=0),n.alloc(+e)},t.INSPECT_MAX_BYTES=50;var i=2147483647;function o(e){if(e>i)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,n.prototype),t}function n(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return a(e,t,r)}function a(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!n.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|p(e,t),i=o(r),a=i.write(e,t);return a!==r&&(i=i.slice(0,a)),i}(e,t);if(ArrayBuffer.isView(e))return function(e){if(U(e,Uint8Array)){var t=new Uint8Array(e);return u(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(U(e,ArrayBuffer)||e&&U(e.buffer,ArrayBuffer))return u(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(U(e,SharedArrayBuffer)||e&&U(e.buffer,SharedArrayBuffer)))return u(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var i=e.valueOf&&e.valueOf();if(null!=i&&i!==e)return n.from(i,t,r);var a=function(e){if(n.isBuffer(e)){var t=0|m(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||$(e.length)?o(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(a)return a;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return n.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function s(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return s(e),o(e<0?0:0|m(e))}function c(e){for(var t=e.length<0?0:0|m(e.length),r=o(t),i=0;i=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return 0|e}function p(e,t){if(n.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||U(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return L(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return D(e).length;default:if(o)return i?-1:L(e).length;t=(""+t).toLowerCase(),o=!0}}function f(e,t,r){var i=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return S(this,t,r);case"utf8":case"utf-8":return T(this,t,r);case"ascii":return j(this,t,r);case"latin1":case"binary":return E(this,t,r);case"base64":return k(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _(this,t,r);default:if(i)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),i=!0}}function h(e,t,r){var i=e[t];e[t]=e[r],e[r]=i}function d(e,t,r,i,o){if(0===e.length)return-1;if("string"==typeof r?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),$(r=+r)&&(r=o?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(o)return-1;r=e.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof t&&(t=n.from(t,i)),n.isBuffer(t))return 0===t.length?-1:g(e,t,r,i,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,i,o);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,i,o){var n,a=1,s=e.length,l=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return-1;a=2,s/=2,l/=2,r/=2}function c(e,t){return 1===a?e[t]:e.readUInt16BE(t*a)}if(o){var u=-1;for(n=r;ns&&(r=s-l),n=r;n>=0;n--){for(var m=!0,p=0;po&&(i=o):i=o;var n=t.length;i>n/2&&(i=n/2);for(var a=0;a>8,o.push(r%256),o.push(i);return o}(t,e.length-r),e,r,i)}function k(e,t,r){return function(e){for(var t,r=e.length,i=r%3,o=[],n=16383,a=0,s=r-i;as?s:a+n));return 1===i?o.push(te[(t=e[r-1])>>2]+te[t<<4&63]+"=="):2===i&&o.push(te[(t=(e[r-2]<<8)+e[r-1])>>10]+te[t>>4&63]+te[t<<2&63]+"="),o.join("")}(0===t&&r===e.length?e:e.slice(t,r))}function T(e,t,r){r=Math.min(e.length,r);for(var i=[],o=t;o239?4:c>223?3:c>191?2:1;if(o+m<=r)switch(m){case 1:c<128&&(u=c);break;case 2:128==(192&(n=e[o+1]))&&(l=(31&c)<<6|63&n)>127&&(u=l);break;case 3:a=e[o+2],128==(192&(n=e[o+1]))&&128==(192&a)&&(l=(15&c)<<12|(63&n)<<6|63&a)>2047&&(l<55296||l>57343)&&(u=l);break;case 4:a=e[o+2],s=e[o+3],128==(192&(n=e[o+1]))&&128==(192&a)&&128==(192&s)&&(l=(15&c)<<18|(63&n)<<12|(63&a)<<6|63&s)>65535&&l<1114112&&(u=l)}null===u?(u=65533,m=1):u>65535&&(i.push((u-=65536)>>>10&1023|55296),u=56320|1023&u),i.push(u),o+=m}return function(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);for(var r="",i=0;ii.length?n.from(a).copy(i,o):Uint8Array.prototype.set.call(i,a,o);else{if(!n.isBuffer(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(i,o)}o+=a.length}return i},n.byteLength=p,n.prototype._isBuffer=!0,n.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;tr&&(e+=" ... "),""},r&&(n.prototype[r]=n.prototype.inspect),n.prototype.compare=function(e,t,r,i,o){if(U(e,Uint8Array)&&(e=n.from(e,e.offset,e.byteLength)),!n.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===o&&(o=this.length),t<0||r>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&t>=r)return 0;if(i>=o)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(o>>>=0)-(i>>>=0),s=(r>>>=0)-(t>>>=0),l=Math.min(a,s),c=this.slice(i,o),u=e.slice(t,r),m=0;m>>=0,isFinite(r)?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0)}var o=this.length-t;if((void 0===r||r>o)&&(r=o),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");for(var n=!1;;)switch(i){case"hex":return b(this,e,t,r);case"utf8":case"utf-8":return y(this,e,t,r);case"ascii":case"latin1":case"binary":return v(this,e,t,r);case"base64":return w(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return x(this,e,t,r);default:if(n)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),n=!0}},n.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function j(e,t,r){var i="";r=Math.min(e.length,r);for(var o=t;oi)&&(r=i);for(var o="",n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function P(e,t,r,i,o,a){if(!n.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||te.length)throw new RangeError("Index out of range")}function C(e,t,r,i,o,n){if(r+i>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function R(e,t,r,i,o){return t=+t,r>>>=0,o||C(e,0,r,4),le(e,t,r,i,23,4),r+4}function I(e,t,r,i,o){return t=+t,r>>>=0,o||C(e,0,r,8),le(e,t,r,i,52,8),r+8}n.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||A(e,t,this.length);for(var i=this[e],o=1,n=0;++n>>=0,t>>>=0,r||A(e,t,this.length);for(var i=this[e+--t],o=1;t>0&&(o*=256);)i+=this[e+--t]*o;return i},n.prototype.readUint8=n.prototype.readUInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),this[e]},n.prototype.readUint16LE=n.prototype.readUInt16LE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]|this[e+1]<<8},n.prototype.readUint16BE=n.prototype.readUInt16BE=function(e,t){return e>>>=0,t||A(e,2,this.length),this[e]<<8|this[e+1]},n.prototype.readUint32LE=n.prototype.readUInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},n.prototype.readUint32BE=n.prototype.readUInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},n.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);for(var i=this[e],o=1,n=0;++n=(o*=128)&&(i-=Math.pow(2,8*t)),i},n.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||A(e,t,this.length);for(var i=t,o=1,n=this[e+--i];i>0&&(o*=256);)n+=this[e+--i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*t)),n},n.prototype.readInt8=function(e,t){return e>>>=0,t||A(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},n.prototype.readInt16LE=function(e,t){e>>>=0,t||A(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt16BE=function(e,t){e>>>=0,t||A(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},n.prototype.readInt32LE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},n.prototype.readInt32BE=function(e,t){return e>>>=0,t||A(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},n.prototype.readFloatLE=function(e,t){return e>>>=0,t||A(e,4,this.length),se(this,e,!0,23,4)},n.prototype.readFloatBE=function(e,t){return e>>>=0,t||A(e,4,this.length),se(this,e,!1,23,4)},n.prototype.readDoubleLE=function(e,t){return e>>>=0,t||A(e,8,this.length),se(this,e,!0,52,8)},n.prototype.readDoubleBE=function(e,t){return e>>>=0,t||A(e,8,this.length),se(this,e,!1,52,8)},n.prototype.writeUintLE=n.prototype.writeUIntLE=function(e,t,r,i){e=+e,t>>>=0,r>>>=0,i||P(this,e,t,r,Math.pow(2,8*r)-1,0);var o=1,n=0;for(this[t]=255&e;++n>>=0,r>>>=0,i||P(this,e,t,r,Math.pow(2,8*r)-1,0);var o=r-1,n=1;for(this[t+o]=255&e;--o>=0&&(n*=256);)this[t+o]=e/n&255;return t+r},n.prototype.writeUint8=n.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,255,0),this[t]=255&e,t+1},n.prototype.writeUint16LE=n.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},n.prototype.writeUint16BE=n.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},n.prototype.writeUint32LE=n.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},n.prototype.writeUint32BE=n.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},n.prototype.writeIntLE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var o=Math.pow(2,8*r-1);P(this,e,t,r,o-1,-o)}var n=0,a=1,s=0;for(this[t]=255&e;++n>0)-s&255;return t+r},n.prototype.writeIntBE=function(e,t,r,i){if(e=+e,t>>>=0,!i){var o=Math.pow(2,8*r-1);P(this,e,t,r,o-1,-o)}var n=r-1,a=1,s=0;for(this[t+n]=255&e;--n>=0&&(a*=256);)e<0&&0===s&&0!==this[t+n+1]&&(s=1),this[t+n]=(e/a>>0)-s&255;return t+r},n.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},n.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},n.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},n.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},n.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||P(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},n.prototype.writeFloatLE=function(e,t,r){return R(this,e,t,!0,r)},n.prototype.writeFloatBE=function(e,t,r){return R(this,e,t,!1,r)},n.prototype.writeDoubleLE=function(e,t,r){return I(this,e,t,!0,r)},n.prototype.writeDoubleBE=function(e,t,r){return I(this,e,t,!1,r)},n.prototype.copy=function(e,t,r,i){if(!n.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a55295&&r<57344){if(!o){if(r>56319){(t-=3)>-1&&n.push(239,191,189);continue}if(a+1===i){(t-=3)>-1&&n.push(239,191,189);continue}o=r;continue}if(r<56320){(t-=3)>-1&&n.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(t-=3)>-1&&n.push(239,191,189);if(o=null,r<128){if((t-=1)<0)break;n.push(r)}else if(r<2048){if((t-=2)<0)break;n.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;n.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;n.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return n}function D(e){return function(e){var t,r,i=function(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}(e),o=i[0],n=i[1],a=new ie(function(e,t,r){return 3*(t+r)/4-r}(0,o,n)),s=0,l=n>0?o-4:o;for(r=0;r>16&255,a[s++]=t>>8&255,a[s++]=255&t;return 2===n&&(t=re[e.charCodeAt(r)]<<2|re[e.charCodeAt(r+1)]>>4,a[s++]=255&t),1===n&&(t=re[e.charCodeAt(r)]<<10|re[e.charCodeAt(r+1)]<<4|re[e.charCodeAt(r+2)]>>2,a[s++]=t>>8&255,a[s++]=255&t),a}(function(e){if((e=(e=e.split("=")[0]).trim().replace(B,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function z(e,t,r,i){for(var o=0;o=t.length||o>=e.length);++o)t[o+r]=e[o];return o}function U(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function $(e){return e!=e}var M=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var i=16*r,o=0;o<16;++o)t[i+o]=e[r]+e[o];return t}()});const{Buffer:ue}=ce;function me(...e){const t=new me.Request(...e),r=new XMLHttpRequest;r.withCredentials="include"===t.credentials,r.timeout=t[pe].timeout,r.open(t.method,t.url,!1);let i=!1;try{r.responseType="arraybuffer"}catch(e){r.overrideMimeType("text/plain; charset=x-user-defined"),i=!0}for(const e of t.headers)r.setRequestHeader(...e);r.send(t.body||null);let o=r.getAllResponseHeaders();o=o&&o.split("\r\n").filter(Boolean).map(e=>e.split(": ",2));let n=r.response;if(i){const e=ue.alloc(n.length);for(let t=0;t=200&&e<300}get redirected(){return this[pe].redirected}get status(){return this[pe].status}get statusText(){return this[pe].statusText}get url(){return this[pe].url}clone(){return this.redirect(this[pe].url,this[pe].status)}redirect(e,t){ye(this);const r=new ge(this[pe].body,{headers:this[pe].headers,status:t||this[pe].status,statusText:he[t]||this[pe].statusText});return r[pe].url=e||this[pe].url,r[pe].redirected=this[pe].redirected,r}}class be{constructor(e){this[pe]={body:ue.from(e),bodyUsed:!1}}get bodyUsed(){return this[pe].bodyUsed}static mixin(e){for(const t of Object.getOwnPropertyNames(be.prototype)){if("constructor"===t)continue;const r=Object.getOwnPropertyDescriptor(be.prototype,t);Object.defineProperty(e,t,{...r,enumerable:!0})}}arrayBuffer(){const e=ve(this);return e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength)}blob(){const e=this.headers&&this.headers.get("content-type");return new Blob([ve(this)],e&&{type:e})}text(){return ve(this).toString()}json(){try{return JSON.parse(ve(this).toString())}catch(e){throw new TypeError(`invalid json response body at ${this.url} reason: ${e.message}`,"invalid-json")}}buffer(){return ve(this).clone()}}function ye(e){if(e.bodyUsed)throw new TypeError(`body used already for: ${e.url}`)}function ve(e){return ye(e),e[pe].bodyUsed=!0,e[pe].body||ue.alloc(0)}be.mixin(de.prototype),be.mixin(ge.prototype);class we{constructor(e){if(e instanceof me.Headers)this[pe]={...e[pe]};else if(this[pe]={},Array.isArray(e))for(const[t,r]of e)this.append(t,r);else if("object"==typeof e)for(const t in e)this.set(t,e[t])}append(e,t){e=e.toLowerCase(),this[pe][e]||(this[pe][e]=[]),this[pe][e].push(t)}delete(e){delete this[pe][e.toLowerCase()]}set(e,t){this[pe][e.toLowerCase()]=[t]}entries(){const e=[];for(const t in this[pe])for(const r of this[pe][t])e.push([t,r]);return e}get(e){return(e=e.toLowerCase())in this[pe]?this[pe][e].join(", "):null}keys(){return Object.keys(this[pe])}has(e){return e.toLowerCase()in this[pe]}values(){const e=[];for(const t in this[pe])for(const r of this[pe][t])e.push(r);return e}*[Symbol.iterator](){for(const e in this[pe])for(const t of this[pe][e])yield[e,t]}}me.Headers=we,me.Request=de,me.Response=ge;var xe=ee(function(e,t){!function(r){e.exports=function(e){var i=e&&e.Promise||r.Promise,o=e&&e.XMLHttpRequest||r.XMLHttpRequest;return function(){var e=Object.create(r,{fetch:{value:void 0,writable:!0}});return function(t){var r=void 0!==e&&e||"undefined"!=typeof self&&self||void 0!==r&&r,n="URLSearchParams"in r,a="Symbol"in r&&"iterator"in Symbol,s="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),l="FormData"in r,c="ArrayBuffer"in r;if(c)var u=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],m=ArrayBuffer.isView||function(e){return e&&u.indexOf(Object.prototype.toString.call(e))>-1};function p(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function f(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return a&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function g(e){if(e.bodyUsed)return i.reject(new TypeError("Already read"));e.bodyUsed=!0}function b(e){return new i(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function y(e){var t=new FileReader,r=b(t);return t.readAsArrayBuffer(e),r}function v(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function w(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:s&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:l&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():c&&s&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=v(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):c&&(ArrayBuffer.prototype.isPrototypeOf(e)||m(e))?this._bodyArrayBuffer=v(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var e=g(this);if(e)return e;if(this._bodyBlob)return i.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return i.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return i.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?g(this)||(ArrayBuffer.isView(this._bodyArrayBuffer)?i.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):i.resolve(this._bodyArrayBuffer)):this.blob().then(y)}),this.text=function(){var e,t,r,o=g(this);if(o)return o;if(this._bodyBlob)return e=this._bodyBlob,r=b(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return i.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),i=0;i-1?i:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var n=/([?&])_=[^&]*/;n.test(this.url)?this.url=this.url.replace(n,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function T(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),i=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(i),decodeURIComponent(o))}}),t}function O(e,t){if(!(this instanceof O))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}k.prototype.clone=function(){return new k(this,{body:this._bodyInit})},w.call(k.prototype),w.call(O.prototype),O.prototype.clone=function(){return new O(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},O.error=function(){var e=new O(null,{status:0,statusText:""});return e.type="error",e};var j=[301,302,303,307,308];O.redirect=function(e,t){if(-1===j.indexOf(t))throw new RangeError("Invalid status code");return new O(null,{status:t,headers:{location:e}})},t.DOMException=r.DOMException;try{new t.DOMException}catch(e){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,n){return new i(function(i,a){var l=new k(e,n);if(l.signal&&l.signal.aborted)return a(new t.DOMException("Aborted","AbortError"));var u=new o;function m(){u.abort()}u.onload=function(){var e,t,r={status:u.status,statusText:u.statusText,headers:(e=u.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e}).forEach(function(e){var r=e.split(":"),i=r.shift().trim();if(i){var o=r.join(":").trim();t.append(i,o)}}),t)};r.url="responseURL"in u?u.responseURL:r.headers.get("X-Request-URL");var o="response"in u?u.response:u.responseText;setTimeout(function(){i(new O(o,r))},0)},u.onerror=function(){setTimeout(function(){a(new TypeError("Network request failed"))},0)},u.ontimeout=function(){setTimeout(function(){a(new TypeError("Network request failed"))},0)},u.onabort=function(){setTimeout(function(){a(new t.DOMException("Aborted","AbortError"))},0)},u.open(l.method,function(e){try{return""===e&&r.location.href?r.location.href:e}catch(t){return e}}(l.url),!0),"include"===l.credentials?u.withCredentials=!0:"omit"===l.credentials&&(u.withCredentials=!1),"responseType"in u&&(s?u.responseType="blob":c&&l.headers.get("Content-Type")&&-1!==l.headers.get("Content-Type").indexOf("application/octet-stream")&&(u.responseType="arraybuffer")),!n||"object"!=typeof n.headers||n.headers instanceof d?l.headers.forEach(function(e,t){u.setRequestHeader(t,e)}):Object.getOwnPropertyNames(n.headers).forEach(function(e){u.setRequestHeader(e,f(n.headers[e]))}),l.signal&&(l.signal.addEventListener("abort",m),u.onreadystatechange=function(){4===u.readyState&&l.signal.removeEventListener("abort",m)}),u.send(void 0===l._bodyInit?null:l._bodyInit)})}E.polyfill=!0,r.fetch||(r.fetch=E,r.Headers=d,r.Request=k,r.Response=O),t.Headers=d,t.Request=k,t.Response=O,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}(t),{fetch:e.fetch,Headers:e.Headers,Request:e.Request,Response:e.Response,DOMException:e.DOMException}}()}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:Z)});const ke="undefined"!=typeof location&&"undefined"!=typeof navigator;function Te(e,t){let r;for(;void 0===r||e.includes(r);)r=`${t}${Math.random().toString().slice(2)}`;return r}"function"==typeof fetch&&ke?(fetch,Headers):/*@__PURE__*/Q(xe)(),"undefined"!=typeof process&&process&&process.release&&"node"===process.release.name&&process.version&&process;class Oe{constructor(e={}){this.data=e}set(e,t){return this.data[e]=t,this}add(...e){return this.set(...e)}delete(e){return delete this.data[e],this}remove(...e){return this.delete(...e)}get(e){return this.data[e]}has(e){return Object.prototype.hasOwnProperty.call(this.data,e)}list(){return Object.keys(this.data)}}class je{constructor(e,t){this.rules=e,this.defaultState=t,this.mainRule=Object.keys(e)[0],this.log=[]}parse(e,t){return this.lexer=e,this.token=this.lexer.next(),this.state=Y(this.defaultState),this.log=[],this.consumeRule(t||this.mainRule)}matchEndOfFile(){return!this.token}matchToken(e){return this.token&&e===this.token.type}consumeToken(e,t){const r=this.token;if(!e||r&&r.type===e)return this.token=this.lexer.next(),r;if(!t){const t=new SyntaxError(this.lexer.formatError(r,`expected "${e}", got ${r?`"${r.type}"`:"EOF"}`));throw t.message+=` (${this.log.join("->")})`,t}}consumeRule(e){this.log.push(e);const t=this.rules[e].call(this);return this.log.pop(),t}}function Ee(e,t){return t=t===Se.CONVERT_TO_SOURCE,e=e.map(e=>function(e,t){let r,i,o,n;if("string"==typeof e)r=i=e;else{if(!e)return null;r=t?e.target:e.source,i=t?e.source:e.target,e.convert&&(o=t?e.convert.toSource:e.convert.toTarget),e.when&&(n=t?e.when.target:e.when.source,null!=n&&(n=function(e){return function(t){return"boolean"==typeof e?e:Object.keys(e).every(r=>{const i=e[r];return!0===i?r in t:!1===i?!(r in t):"function"==typeof i?i(t[r]):Array.isArray(i)?i.includes(t[r]):t[r]===i})}}(n)))}return r=[].concat(r).filter(Boolean),i=[].concat(i).filter(Boolean),{inputProp:r,outputProp:i,convert:o,condition:n}}(e,t)).filter(Boolean),function(t){const r={};for(const{inputProp:i,outputProp:o,convert:n,condition:a}of e){if(0===o.length)continue;if(a&&!a(t))continue;if(0!==i.length&&i.every(e=>!(e in t)))continue;let e=i.map(e=>t[e]);if(n)try{const r=n.apply(t,e);e=1===o.length?[r]:r}catch(e){throw new Error(`Failed to convert ${i} to ${o}`,{cause:e})}o.forEach((t,i)=>{const o=e[i];void 0!==o&&(r[t]=o)})}return r}}class Se{constructor(e){this.convertToSource=Ee(e,Se.CONVERT_TO_SOURCE),this.convertToTarget=Ee(e,Se.CONVERT_TO_TARGET)}}Se.CONVERT_TO_SOURCE=Symbol("convert to source"),Se.CONVERT_TO_TARGET=Symbol("convert to target");class _e{constructor(e,t={}){this.options=Object.assign({generateGraph:!0,forceType:j(e),maxChainLength:10,strict:!0,target:"@csl/list+object"},t),this.type=this.options.forceType,this.data="object"==typeof e?Y(e):e,this.graph=[{type:this.type,data:e}],this.iteration=0}iterate(){if(0!==this.iteration){const e=Ne(this.type);this.type=e&&e.outputs?e.outputs:j(this.data),this.graph.push({type:this.type})}return!this.error&&this.type!==this.options.target&&(this.iteration>=this.options.maxChainLength?(this.error=new RangeError(`Max. number of parsing iterations reached (${function(e){return e.reduce((e,t)=>{const r=e[e.length-1];return r&&r.type===t.type?r.count=r.count+1||2:e.push(t),e},[]).map(e=>(e.count>1?e.count+"x ":"")+e.type).join(" -> ")}(this.graph)})`),!1):(this.iteration++,!0))}end(){if(this.error){if(v.error("[core]",this.error.message),!1!==this.options.strict)throw this.error;return[]}return"@csl/list+object"===this.options.target?W(this.data).map(this.options.generateGraph?e=>g(e,this.graph):b):this.data}}const Ae=(...e)=>{const t=new _e(...e);for(;t.iterate();)try{t.data=Le(t.data,t.type)}catch(e){t.error=e}return t.end()},Pe=async(...e)=>{const t=new _e(...e);for(;t.iterate();)t.data=await De(t.data,t.type).catch(e=>{t.error=e});return t.end()},Ce={},Re={},Ie={"@csl/object":e=>[e],"@csl/list+object":e=>e,"@else/list+object":e=>e.map(Ae).flat(),"@invalid":()=>{throw new Error("This format is not supported or recognized")}},Be={"@else/list+object":async e=>(await Promise.all(e.map(Pe))).flat()};function Le(e,t){if("function"==typeof Ce[t])return Ce[t](e);if("function"==typeof Ie[t])return Ie[t](e);throw new TypeError(`No synchronous parser found for ${t}`)}async function De(e,t){if("function"==typeof Re[t])return Re[t](e);if("function"==typeof Be[t])return Be[t](e);if(Ue(t,!1))return Le(e,t);throw new TypeError(`No parser found for ${t}`)}function ze(e,{parser:t,async:r}){r?Re[e]=t:Ce[e]=t}function Ue(e,t){return t?Re[e]||Be[e]:Ce[e]||Ie[e]}function $e(e,t){delete(t?Re:Ce)[e]}const Me={};function Ne(e){return Me[e]}var qe={__proto__:null,util:Object.assign({},d,y,R,J),add:function(e,t){const r=new C(e,t);r.validate();const i=Me[e]||(Me[e]={});r.typeParser&&(E(e,r.typeParser),i.type=!0),r.dataParser&&(ze(e,r.dataParser),i.data=!0),r.asyncDataParser&&(ze(e,r.asyncDataParser),i.asyncData=!0),t.outputs&&(i.outputs=t.outputs)},get:Ne,remove:function(e){const t=Me[e];t&&(t.type&&S(e),t.data&&$e(e),t.asyncData&&$e(e,!0),delete Me[e])},has:function(e){return e in Me},list:function(){return Object.keys(Me)},chain:Ae,chainLink:e=>{const t=j(e);return Le(t.match(/array|object/)?Y(e):e,t)},chainAsync:Pe,chainLinkAsync:async e=>{const t=j(e);return De(t.match(/array|object/)?Y(e):e,t)},type:j,addTypeParser:E,hasTypeParser:function(e){return Object.prototype.hasOwnProperty.call(w,e)},removeTypeParser:S,listTypeParser:function(){return Object.keys(w)},treeTypeParser:function(){const e=t=>({name:t,children:w[t].extensions.map(e)});return{name:"Type tree",children:Object.keys(x).map(t=>({name:t,children:x[t].map(e)}))}},typeMatcher:_,data:Le,dataAsync:De,addDataParser:ze,hasDataParser:Ue,removeDataParser:$e,listDataParser:function(e){return Object.keys(e?Re:Ce)}},Fe={__proto__:null,add:function(e,t={},r=!1){return!0!==t&&!0!==r||this.save(),this.data.push(...Ae(e,t)),this.data.filter(e=>!Object.prototype.hasOwnProperty.call(e,"id")).forEach(e=>{e.id=Te(this.getIds(),"temp_id_")}),this},addAsync:async function(e,t={},r=!1){return!0!==t&&!0!==r||this.save(),this.data.push(...await Pe(e,t)),this.data.filter(e=>!Object.prototype.hasOwnProperty.call(e,"id")).forEach(e=>{e.id=Te(this.getIds(),"temp_id_")}),this},set:function(e,t={},r=!1){return!0!==t&&!0!==r||this.save(),this.data=[],"boolean"!=typeof t?this.add(e,t):this.add(e)},setAsync:async function(e,t={},r=!1){return!0!==t&&!0!==r||this.save(),this.data=[],"boolean"!=typeof t?this.addAsync(e,t):this.addAsync(e)},reset:function(e){return e&&this.save(),this.data=[],this._options={},this}};function He(e){if("citation-label"in e)return e["citation-label"];let t="";return e.author&&(t+=e.author[0].family||e.author[0].literal),e.issued&&e.issued["date-parts"]&&e.issued["date-parts"][0]&&(t+=e.issued["date-parts"][0][0]),e["year-suffix"]?t+=e["year-suffix"]:e.title&&(t+=e.title.replace(/<\/?.*?>/g,"").match(/^(?:(?:the|a|an)\s+)?(\S+)/i)[1]),t}var Ge={label:e=>e.reduce((e,t)=>(e[t.id]=He(t),e),{})};function Je(e,r,i="label"===r){let o=i?He(e):e[r];switch(r){case"author":case"editor":return o.map(e=>e.literal||e.family||t(e));case"accessed":case"issued":return o["date-parts"][0];case"page":return o.split("-").map(e=>parseInt(e));case"edition":case"issue":case"volume":return o=parseInt(o),isNaN(o)?-Infinity:o;default:return o||-Infinity}}function Ve(e,t,r,i=/^!/.test(r)){const o=Je(e,r=r.replace(/^!/,"")),n=Je(t,r);return(i?-1:1)*(o>n?1:o{const i=e.slice();let o=0;for(;!o&&i.length;)o=Ve(t,r,i.shift());return o}}(...e,"label")),this}};const We=new Oe;function Xe(e,t,...r){if(!We.has(e))throw new Error(`Output format "${e}" unavailable`);return We.get(e)(t,...r)}var Ye={__proto__:null,register:We,add:function(e,t){!function(e,t){if("string"!=typeof e)throw new TypeError("Invalid output format name, expected string, got "+typeof e);if("function"!=typeof t)throw new TypeError("Invalid formatter, expected function, got "+typeof t)}(e,t),We.set(e,t)},remove:function(e){We.remove(e)},has:function(e){return We.has(e)},list:function(){return We.list()},format:Xe},Ze={__proto__:null,getIds:function(){return this.data.map(e=>e.id)},format:function(e,...t){return Xe(e,G(this.data),...t)},get:function(e={}){m(e);const t=Object.assign({},this.defaultOptions,this._options.output,e),{type:r,style:i}=t,[o,n]=i.split("-"),a="citation"===o?"bibliography":"csl"===o?"data":o,s="string"===r?"text":"json"===r?"object":r;let l;switch(a){case"bibliography":{const{lang:e,append:r,prepend:i}=t;l={template:n,lang:e,format:s,append:r,prepend:i};break}case"data":case"bibtex":case"bibtxt":case"ndjson":case"ris":l={type:s};break;default:throw new Error(`Invalid style "${a}"`)}const c=this.format(a,Object.assign(l,e._newOptions)),{format:u}=t;if("real"===u&&"html"===s&&"undefined"!=typeof document&&"function"==typeof document.createElement){const e=document.createElement("div");return e.innerHTML=c,e.firstChild}return"string"===u&&"object"==typeof c?JSON.stringify(c):c}},Qe={__proto__:null,async:function(e,t,r){"function"!=typeof t||r||(r=t,t=void 0);const i=(new this).setAsync(e,t);return"function"==typeof r?void i.then(r):i},validateOutputOptions:m,validateOptions:function(e){if("object"!=typeof e)throw new TypeError("Options should be an object");if(e.output)m(e.output);else{if(e.maxChainLength&&"number"!=typeof e.maxChainLength)throw new TypeError("Option maxChainLength should be a number");if(e.forceType&&"string"!=typeof e.forceType)throw new TypeError("Option forceType should be a string");if(null!=e.generateGraph&&"boolean"!=typeof e.generateGraph)throw new TypeError("Option generateGraph should be a boolean");if(null!=e.strict&&"boolean"!=typeof e.strict)throw new TypeError("Option strict should be a boolean");if(null!=e.target&&"string"!=typeof e.target)throw new TypeError("Option target should be a boolean")}return!0}};function et(e,t={}){return this instanceof et?(this._options=t,this.log=[],this.data=[],this.set(e,t),this.options(t),this):new et(e,t)}Object.assign(et.prototype,a,p,Fe,Ke,Ze),et.prototype[Symbol.iterator]=function*(){yield*this.data},Object.assign(et,Qe);const tt=new Oe({html:{bibliographyContainer:['
',"
"],entry:['
',"
"],list:['
    ',"
"],listItem:["
  • ","
  • "]},text:{bibliographyContainer:["","\n"],entry:["","\n"],list:["\n",""],listItem:["\t","\n"]}});function rt(e){return tt.has(e)}function it(e){if(!tt.has(e))throw new Error(`Dict "${e}" unavailable`);return tt.get(e)}var ot={__proto__:null,register:tt,add:function(e,t){!function(e,t){if("string"!=typeof e)throw new TypeError("Invalid dict name, expected string, got "+typeof e);if("object"!=typeof t)throw new TypeError("Invalid dict, expected object, got "+typeof t);for(const e in t){const r=t[e];if(!Array.isArray(r)||r.some(e=>"string"!=typeof e))throw new TypeError(`Invalid dict entry "${e}", expected array of strings`)}}(e,t),tt.set(e,t)},remove:function(e){tt.remove(e)},has:rt,list:function(){return tt.list()},get:it,htmlDict:{wr_start:'
    ',wr_end:"
    ",en_start:'
    ',en_end:"
    ",ul_start:'
      ',ul_end:"
    ",li_start:"
  • ",li_end:"
  • "},textDict:{wr_start:"",wr_end:"\n",en_start:"",en_end:"\n",ul_start:"\n",ul_end:"",li_start:"\t",li_end:"\n"}};const nt={};var at={__proto__:null,add:function(e,t){nt[e]=t},get:function(e){return nt[e]},has:function(e){return Object.prototype.hasOwnProperty.call(nt,e)},remove:function(e){delete nt[e]},list:function(){return Object.keys(nt)}};const st={input:qe,output:Ye,dict:ot,config:at},lt={};function ct(e,t={}){const r=lt[e]={};for(const i in t){if("config"===i){r.config={[e]:t.config},st.config.add(e,t.config);continue}const o=r[i]={},n=t[i];for(const e in n){const t=n[e];o[e]=!0,st[i].add(e,t)}}}var ut={__proto__:null,add:ct,remove:function(e){const t=lt[e];for(const e in t){const r=t[e];for(const t in r)st[e].remove(t)}delete lt[e]},has:function(e){return e in lt},list:function(){return Object.keys(lt)},input:qe,output:Ye,dict:ot,config:at};function mt(){return[]}const pt=[[/((?:\[|:|,)\s*)'((?:\\'|[^'])*?[^\\])?'(?=\s*(?:\]|}|,))/g,'$1"$2"'],[/((?:(?:"|]|}|\/[gmiuys]|\.|(?:\d|\.|-)*\d)\s*,|{)\s*)(?:"([^":\n]+?)"|'([^":\n]+?)'|([^":\n]+?))(\s*):/g,'$1"$2$3$4"$5:']],ft={"@empty/text":{parse:mt,parseType:{dataType:"String",predicate:e=>""===e}},"@empty/whitespace+text":{parse:mt,parseType:{dataType:"String",predicate:/^\s+$/}},"@empty":{parse:mt,parseType:{dataType:"Primitive",predicate:e=>null==e}},"@else/json":{parse:function(e){if("string"!=typeof e)return JSON.parse(e);try{return JSON.parse(e)}catch(t){return v.debug("[plugin-common]","Invalid JSON, switching to experimental parser"),pt.forEach(([t,r])=>{e=e.replace(t,r)}),JSON.parse(e)}},parseType:{dataType:"String",predicate:/^\s*(\{[\S\s]*\}|\[[\S\s]*\])\s*$/}},"@else/url":{parseType:{dataType:"String",predicate:/^https?:\/\/(([\w-]+\.)*[\w-]+)(:\d+)?(\/[^?/]*)*(\?[^#]*)?(#.*)?$/i}},"@else/jquery":{parse:function(e){return e.val()||e.text()||e.html()},parseType:{dataType:"ComplexObject",predicate:e=>"undefined"!=typeof jQuery&&e instanceof jQuery}},"@else/html":{parse:function(e){return e.value||e.textContent},parseType:{dataType:"ComplexObject",predicate:e=>"undefined"!=typeof HTMLElement&&e instanceof HTMLElement}}};function ht(e,t,r){return e+(tgt(e,t)):Object.keys(e).filter(t=>JSON.stringify(e[t])).map(r=>`"${r}": ${gt(e[r],t)}`),i=i.map(ht).map(e=>t.listItem.join(e)),i=t.list.join(i.join("")),r?`[${i}]`:`{${i}}`}function gt(e,t){return"object"==typeof e&&null!==e?0===e.length?"[]":0===Object.keys(e).length?"{}":dt(e,t):JSON.stringify(e)}var bt={data:(e,{type:t,format:r=t||"text",version:i="1.0.2"}={})=>(i<"1.0.2"&&(e=X(e)),"object"===r?Y(e):"text"===r?JSON.stringify(e,null,2):(v.warn("[core]","This feature (JSON output with special formatting) is unstable. See https://github.com/larsgw/citation.js/issues/144"),function(e,t){let r=e.map(e=>dt(e,t));return r=r.map(ht).map(e=>t.entry.join(e)),r=r.join(""),t.bibliographyContainer.join(`[${r}]`)}(e,it(r)))),ndjson:(e,{version:t="1.0.2"}={})=>(t<"1.0.2"&&(e=X(e)),e.map(e=>JSON.stringify(e)).join("\n"))};function yt(t){const{firstname:r,lastname:i,firstName:o=r,lastName:n=i}=t;return o&&n?{given:o,family:n}:t.name?e(t.name):void 0}ct("@else",{input:ft,output:Object.assign({},bt,Ge)});const vt=["PMID","PMCID","DOI","ISBN"],wt=["ISSN"];function xt(e,t){const r={};for(const i in e){const o=i.toUpperCase();t.includes(o)&&(r[o]=e[i])}if(e.identifier)for(let{id:i,type:o=""}of e.identifier)o=o.toUpperCase(),t.includes(o)&&(r[o]=i);return r}const kt={article:"article",book:"book",booklet:"book",proceedings:"book",mastersthesis:"thesis",inbook:"chapter",incollection:"chapter",conference:"paper-conference",inproceedings:"paper-conference",manual:"report",misc:"document",online:"website",patent:"patent",phdthesis:"thesis",techreport:"report",unpublished:"manuscript"};function Tt(e){const t={type:kt[e.type]||"document",title:e.title};if(e.author&&(t.author=e.author.map(yt).filter(Boolean)),e.editor&&(t.editor=e.editor.map(yt).filter(Boolean)),e.reviewer&&(e.author&&(t["reviewed-author"]=t.author),t.author=e.reviewer.map(yt).filter(Boolean)),Array.isArray(e.keywords)?t.keyword=e.keywords.join():e.keywords&&(t.keyword=e.keywords),e.publisher&&(t.publisher=e.publisher.name||e.publisher),e.date&&e.date.published?t.issued=r(e.date.published):e.year&&(t.issued={"date-parts":[[+e.year]]}),e.date&&e.date.submitted&&(t.submitted=r(e.date.submitted)),e.journal){const r=e.journal;r.name&&(t["container-title"]=r.name),r.volume&&(t.volume=r.volume),r.issue&&(t.issue=r.issue),Object.assign(t,xt(r,wt)),r.firstpage&&(t["page-first"]=r.firstpage),r.pages?t.page=r.pages.replace("--","-"):r.firstpage&&r.lastpage&&(t.page=r.firstpage+"-"+r.lastpage)}return e.link&&"object"==typeof e.link[0]&&(t.URL=e.link[0].url),Object.assign(t,xt(e,vt)),e.cid?t.id=e.cid:t.DOI&&(t.id=t.DOI),t}const Ot=["fulltext_html","fulltext_xml","fulltext_pdf"],jt=["name","lastname","lastName","firstname","firstName"],Et={"@bibjson/quickscrape+record+object":{parse:function(e){return Object.assign(Tt(e),{type:"article-journal"})},parseType:{propertyConstraint:{props:"link",value:e=>Ot.some(t=>e.find(({type:e})=>e===t))},extends:"@bibjson/record+object"}},"@bibjson/record+object":{parse:function(e){return Tt(e)},parseType:{dataType:"SimpleObject",propertyConstraint:[{props:"title"},{props:["author","editor"],match:"some",value:e=>Array.isArray(e)&&e[0]&&jt.some(t=>t in e[0])}]}},"@bibjson/collection+object":{parse:e=>e.records,parseType:{dataType:"SimpleObject",propertyConstraint:[{props:"metadata",value:e=>"collection"in e},{props:"records",value:e=>Array.isArray(e)}]}}};ct("@bibjson",{input:Et});var St=ee(function(e){!function(t,r){e.exports?e.exports=r():t.moo=r()}(Z,function(){var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,r="boolean"==typeof(new RegExp).sticky;function i(e){return e&&"[object RegExp]"===t.call(e)}function o(e){return e&&"object"==typeof e&&!i(e)&&!Array.isArray(e)}function n(e){return e.length?"(?:"+e.map(function(e){return"(?:"+e+")"}).join("|")+")":"(?!)"}function a(e){if("string"==typeof e)return"(?:"+e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")+")";if(i(e)){if(e.ignoreCase)throw new Error("RegExp /i flag not allowed");if(e.global)throw new Error("RegExp /g flag is implied");if(e.sticky)throw new Error("RegExp /y flag is implied");if(e.multiline)throw new Error("RegExp /m flag is implied");return e.source}throw new Error("Not a pattern: "+e)}function s(e,t){return e.length>t?e:Array(t-e.length+1).join(" ")+e}function l(t,r){if(o(r)||(r={match:r}),r.include)throw new Error("Matching rules cannot also include states");var n={defaultType:t,lineBreaks:!!r.error||!!r.fallback,pop:!1,next:null,push:null,error:!1,fallback:!1,value:null,type:null,shouldThrow:!1};for(var a in r)e.call(r,a)&&(n[a]=r[a]);if("string"==typeof n.type&&t!==n.type)throw new Error("Type transform cannot be a string (type '"+n.type+"' for token '"+t+"')");var s=n.match;return n.match=Array.isArray(s)?s:s?[s]:[],n.match.sort(function(e,t){return i(e)&&i(t)?0:i(t)?-1:i(e)?1:t.length-e.length}),n}function c(e){return Array.isArray(e)?function(e){for(var t=[],r=0;r0)throw new Error("RegExp has capture groups: "+v+"\nUse (?: … ) instead");if(!h.lineBreaks&&v.test("\n"))throw new Error("Rule should declare lineBreaks: "+v);p.push("("+y+")")}}var w=o&&o.fallback,x=r&&!w?"ym":"gm",k=r||w?"":"|";return!0===c&&(x+="u"),{regexp:new RegExp(n(p)+k,x),groups:m,fast:s,error:o||u}}function p(e,t,r){var i=e&&(e.push||e.next);if(i&&!r[i])throw new Error("Missing state '"+i+"' (in token '"+e.defaultType+"' of state '"+t+"')");if(e&&e.pop&&1!=+e.pop)throw new Error("pop must be 1 (in token '"+e.defaultType+"' of state '"+t+"')")}var f=function(e,t){this.startState=t,this.states=e,this.buffer="",this.stack=[],this.reset()};f.prototype.reset=function(e,t){return this.buffer=e||"",this.index=0,this.line=t?t.line:1,this.col=t?t.col:1,this.queuedToken=t?t.queuedToken:null,this.queuedText=t?t.queuedText:"",this.queuedThrow=t?t.queuedThrow:null,this.setState(t?t.state:this.startState),this.stack=t&&t.stack?t.stack.slice():[],this},f.prototype.save=function(){return{line:this.line,col:this.col,state:this.state,stack:this.stack.slice(),queuedToken:this.queuedToken,queuedText:this.queuedText,queuedThrow:this.queuedThrow}},f.prototype.setState=function(e){if(e&&this.state!==e){this.state=e;var t=this.states[e];this.groups=t.groups,this.error=t.error,this.re=t.regexp,this.fast=t.fast}},f.prototype.popState=function(){this.setState(this.stack.pop())},f.prototype.pushState=function(e){this.stack.push(this.state),this.setState(e)};var h=r?function(e,t){return e.exec(t)}:function(e,t){var r=e.exec(t);return 0===r[0].length?null:r};function d(){return this.value}if(f.prototype._getGroup=function(e){for(var t=this.groups.length,r=0;r",textbackslash:"\\",textasciicircum:"^",textunderscore:"_",textbraceleft:"{",textbar:"|",textbraceright:"}",textasciitilde:"~",textexclamdown:"¡",textcent:"¢",textsterling:"£",textcurrency:"¤",textyen:"¥",textbrokenbar:"¦",textsection:"§",textasciidieresis:"¨",textcopyright:"©",textordfeminine:"ª",guillemetleft:"«",guillemotleft:"«",textlnot:"¬",textregistered:"®",textasciimacron:"¯",textdegree:"°",textpm:"±",texttwosuperior:"²",textthreesuperior:"³",textasciiacute:"´",textmu:"µ",textparagraph:"¶",textperiodcentered:"·",textonesuperior:"¹",textordmasculine:"º",guillemetright:"»",guillemotright:"»",textonequarter:"¼",textonehalf:"½",textthreequarters:"¾",textquestiondown:"¿",AE:"Æ",DH:"Ð",texttimes:"×",O:"Ø",TH:"Þ",ss:"ß",ae:"æ",dh:"ð",textdiv:"÷",o:"ø",th:"þ",DJ:"Đ",dj:"đ",i:"ı",IJ:"IJ",ij:"ij",L:"Ł",l:"ł",NG:"Ŋ",ng:"ŋ",OE:"Œ",oe:"œ",textflorin:"ƒ",j:"ȷ",textasciicaron:"ˇ",textasciibreve:"˘",textacutedbl:"˝",textgravedbl:"˵",texttildelow:"˷",textbaht:"฿",SS:"ẞ",textcompwordmark:"‌",textendash:"–",textemdash:"—",textbardbl:"‖",textquoteleft:"‘",textquoteright:"’",quotesinglbase:"‚",textquotedblleft:"“",textquotedblright:"”",quotedblbase:"„",textdagger:"†",textdaggerdbl:"‡",textbullet:"•",textellipsis:"…",textperthousand:"‰",textpertenthousand:"‱",guilsinglleft:"‹",guilsinglright:"›",textreferencemark:"※",textinterrobang:"‽",textfractionsolidus:"⁄",textlquill:"⁅",textrquill:"⁆",textdiscount:"⁒",textcolonmonetary:"₡",textlira:"₤",textnaira:"₦",textwon:"₩",textdong:"₫",texteuro:"€",textpeso:"₱",textcelsius:"℃",textnumero:"№",textcircledP:"℗",textrecipe:"℞",textservicemark:"℠",texttrademark:"™",textohm:"Ω",textmho:"℧",textestimated:"℮",textleftarrow:"←",textuparrow:"↑",textrightarrow:"→",textdownarrow:"↓",textminus:"−",Hwithstroke:"Ħ",hwithstroke:"ħ",textasteriskcentered:"∗",textsurd:"√",textlangle:"〈",textrangle:"〉",textblank:"␢",textvisiblespace:"␣",textopenbullet:"◦",textbigcircle:"◯",textmusicalnote:"♪",textmarried:"⚭",textdivorced:"⚮",textinterrobangdown:"⸘",textcommabelow:null,copyright:"©"},Bt={Gamma:"Γ",Delta:"Δ",Theta:"Θ",Lambda:"Λ",Xi:"Ξ",Pi:"Π",Sigma:"Σ",Phi:"Φ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",varepsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",pi:"π",rho:"ρ",varsigma:"ς",sigma:"σ",tau:"τ",upsilon:"υ",varphi:"φ",chi:"χ",psi:"ψ",omega:"ω",vartheta:"ϑ",Upsilon:"ϒ",phi:"ϕ",varpi:"ϖ",varrho:"ϱ",epsilon:"ϵ"},Lt={jan:"01",feb:"02",mar:"03",apr:"04",may:"05",jun:"06",jul:"07",aug:"08",sep:"09",oct:"10",nov:"11",dec:"12",acmcs:"ACM Computing Surveys",acta:"Acta Informatica",cacm:"Communications of the ACM",ibmjrd:"IBM Journal of Research and Development",ibmsj:"IBM Systems Journal",ieeese:"IEEE Transactions on Software Engineering",ieeetc:"IEEE Transactions on Computers",ieeetcad:"IEEE Transactions on Computer-Aided Design of Integrated Circuits",ipl:"Information Processing Letters",jacm:"Journal of the ACM",jcss:"Journal of Computer and System Sciences",scp:"Science of Computer Programming",sicomp:"SIAM Journal on Computing",tocs:"ACM Transactions on Computer Systems",tods:"ACM Transactions on Database Systems",tog:"ACM Transactions on Graphics",toms:"ACM Transactions on Mathematical Software",toois:"ACM Transactions on Office Information Systems",toplas:"ACM Transactions on Programming Languages and Systems",tcs:"Theoretical Computer Science"},Dt={it:"italics",itshape:"italics",sl:"italics",slshape:"italics",em:"italics",bf:"bold",bfseries:"bold",sc:"smallcaps",scshape:"smallcaps",rm:void 0,sf:void 0,tt:void 0},zt={textit:"italics",textsl:"italics",emph:"italics",mkbibitalic:"italics",mkbibemph:"italics",textbf:"bold",strong:"bold",mkbibbold:"bold",textsc:"smallcaps",textsuperscript:"superscript",textsubscript:"subscript",enquote:"quotes",mkbibquote:"quotes",textmd:void 0,textrm:void 0,textsf:void 0,texttt:void 0,textup:void 0},Ut={italics:["",""],bold:["",""],superscript:["",""],subscript:["",""],smallcaps:['',""],nocase:['',""],quotes:["“","”"]},$t={ElsevierGlyph:e=>String.fromCharCode(parseInt(e,16)),href:(e,t)=>e,url:e=>e},Mt=/---?|''|``|~/g,Nt={"--":"–","---":"—","``":"“","''":"”","~":" "},qt={"^":"superscript",sp:"superscript",_:"subscript",sb:"subscript",mathrm:void 0},Ft={"^":{0:"⁰",1:"¹",2:"²",3:"³",4:"⁴",5:"⁵",6:"⁶",7:"⁷",8:"⁸",9:"⁹","+":"⁺","-":"⁻","=":"⁼","(":"⁽",")":"⁾",i:"ⁱ",n:"ⁿ"},_:{0:"₀",1:"₁",2:"₂",3:"₃",4:"₄",5:"₅",6:"₆",7:"₇",8:"₈",9:"₉","+":"₊","-":"₋","=":"₌","(":"₍",")":"₎",a:"ₐ",e:"ₑ",o:"ₒ",x:"ₓ",ə:"ₔ",h:"ₕ",k:"ₖ",l:"ₗ",m:"ₘ",n:"ₙ",s:"ₚ",p:"ₛ",t:"ₜ"}},Ht=["american","british","canadian","english","australian","newzealand","usenglish","ukenglish","en","eng","en-au","en-bz","en-ca","en-cb","en-gb","en-ie","en-jm","en-nz","en-ph","en-tt","en-us","en-za","en-zw","anglais"];var Gt={constants:{__proto__:null,required:Pt,fieldTypes:Ct,diacritics:Rt,commands:It,mathCommands:Bt,defaultStrings:Lt,formattingEnvs:Dt,formattingCommands:zt,formatting:Ut,argumentCommands:$t,ligaturePattern:Mt,ligatures:Nt,mathScriptFormatting:qt,mathScripts:Ft,sentenceCaseLanguages:Ht},types:{biblatex:_t,bibtex:At},parse:{biblatex:!0,strict:!1,sentenceCase:"never"},format:{useIdAsLabel:!1,checkLabel:!0,asciiOnly:!0},biber:{annotationMarker:"+an",namedAnnotationMarker:":"}};function Jt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function Vt(e){for(var t=1;t{const[,t,r]=e.match(tr)||[];if(t&&r){const e={type:"book",label:t,properties:{}};return r.trim().split(rr).filter(e=>e).forEach(t=>{let[r,i]=t.split(ir);i&&(r=r.trim(),i=i.trim(),"type"===r?e.type=i:e.properties[r]=i)}),e}return{}},nr=new Set(["the","a","an"]),ar=/(?:<\/?.*?>|[\u0020-\u002F\u003A-\u0040\u005B-\u005E\u0060\u007B-\u007F])+/g,sr=/[^\u0020-\u007F]+/g;function lr(e){return null===e?"null":void 0===e?"undefined":Gt.format.checkLabel?e.toString().replace(ar,""):e.toString()}function cr(e){return e?e.normalize("NFKD").replace(sr,"").split(ar).find(e=>e.length&&!nr.has(e.toLowerCase())):""}const ur=new Se([{source:"given",target:"given"},{source:"family",target:"family"},{source:"suffix",target:"suffix"},{source:"prefix",target:"non-dropping-particle"},{source:"family",target:"literal",when:{source:!1,target:{family:!1,given:!1}}}]),mr=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],pr="BibTeX type",fr="BibTeX label",hr={jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12,january:1,february:2,march:3,april:4,may:5,june:6,july:7,august:8,september:9,october:10,november:11,december:12},dr={bathesis:"Bachelor's thesis",mathesis:"Master's thesis",phdthesis:"PhD thesis",candthesis:"Candidate thesis",techreport:"technical report",resreport:"research report",software:"computer software",datacd:"data cd",audiocd:"audio cd",patent:"patent",patentde:"German patent",patenteu:"European patent",patentfr:"French patent",patentuk:"British patent",patentus:"U.S. patent",patreq:"patent request",patreqde:"German patent request",patreqeu:"European patent request",patreqfr:"French patent request",patrequk:"British patent request",patrequs:"U.S. patent request"},gr=/(^(?:ISAN )?(?:[0-9a-f]{4}-){4}[0-9a-z](?:-(?:[0-9a-f]{4}-){2}[0-9a-z])?$)|(^(?:979-?0-?|M-?)(?:\d{9}|(?=[\d-]{11}$)\d+-\d+-\d)$)|(^ISRN .{1,36}$)|(^(?:ISWC )?T-?\d{9}-?\d$)/i;function br(e){if(null==e)return[];if(+e)return[parseInt(e,10)];if((e=e.trim().toLowerCase())in hr)return[hr[e]];const t=e.split(/\s+/);let r,i;return t[0]in hr?(r=hr[t[0]],i=parseInt(t[1])):t[1]in hr&&(r=hr[t[1]],i=parseInt(t[0])),i?[r,i]:r?[r]:[]}const yr={PICK:{toTarget:(...e)=>e.find(Boolean),toSource:e=>[e]},DATE:{toTarget(e){const t=e.split("/").map(e=>e&&".."!==e?function(e){const t=e.split("T")[0].replace(/[?~%]$/,"").split("-"),r=+t[0].replace(/^Y(?=-?\d{4}\d+)/,"").replace(/X/g,"0"),i=+t[1],o=+t[2];return!i||i>20?[r]:o?[r,i,o]:[r,i]}(e):void 0);return isNaN(t[0][0])?{literal:e}:{"date-parts":t}},toSource(e){if("date-parts"in e)return e["date-parts"].map(e=>e.map(e=>e.toString().padStart(2,"0")).join("-")).join("/")}},YEAR_MONTH:{toTarget:(e,t,r)=>isNaN(+e)?{literal:e}:isNaN(+r)||isNaN(+t)?{"date-parts":[[+e,...br(t)]]}:{"date-parts":[[+e,+t,+r]]},toSource(e){if("date-parts"in e){const[t,r,i]=e["date-parts"][0];return[t.toString(),r?i?`${mr[r-1]} ${i}`:r:void 0]}return[]}},EPRINT:{toTarget(e,t){if("pubmed"===t)return e},toSource:e=>[e,"pubmed"]},EVENT_TITLE:{toTarget:(e,t)=>(t&&(e+=" ("+t+")"),e),toSource:e=>e.match(/^(.+)(?: \((.+)\))?$/).slice(1,3)},HOW_PUBLISHED:{toTarget(e){if(e.startsWith("http"))return e}},KEYWORDS:{toTarget:e=>e.join(","),toSource:e=>e.split(",")},LABEL:{toTarget:e=>[e,e],toSource:(e,t,r,i,o,n)=>t&&function(e){return!Gt.format.checkLabel||!e.match(ar)}(t)?t:Gt.format.useIdAsLabel?lr(e):function(e,t,r,i){let o="";return e&&e[0]&&(o+=cr(e[0].family||e[0].literal)),t&&t["date-parts"]&&t["date-parts"][0]&&(o+=t["date-parts"][0][0]),r?o+=r:i&&(o+=cr(i)),o}(r,i,o,n)||lr(e)},NAMES:{toTarget:e=>e.map(ur.convertToTarget),toSource:e=>e.map(ur.convertToSource)},NAMES_ORCID:{toTarget:(e,t)=>e.map((e,r)=>{var i;const o=ur.convertToTarget(e);return"string"==typeof(null==t||null===(i=t.item)||void 0===i?void 0:i[r])&&(o._orcid=t.item[r]),o}),toSource(e){const t=[],r=[];for(let i=0;ie.replace(/[–—]/,"-"),toSource:e=>e.replace("-","--")},STANDARD_NUMBERS:{toTarget:(...e)=>e.find(Boolean),toSource(e){const t=e.toString().match(gr);return t?t.slice(1,5):[]}},STATUS:{toSource(e){if(/^(inpreparation|submitted|forthcoming|inpress|prepublished)$/i.test(e))return e}},TITLE:{toTarget:(e,t,r)=>(t&&(e+=": "+t),e),toSource:e=>[e]}},vr=[{source:"note",target:"accessed",when:{source:!1,target:{note:!1,addendum:!1}},convert:{toSource:e=>`[Online; accessed ${i(e)}]`}},{source:"numpages",target:"number-of-pages",when:{source:{pagetotal:!1},target:!1}},{source:"pmid",target:"PMID",when:{source:{eprinttype:e=>"pmid"!==e,archiveprefix:e=>"pmid"!==e},target:!1}},{source:"pmcid",target:"PMCID",when:{target:!1}},{source:"s2id",target:"custom",convert:{toTarget:e=>({S2ID:e}),toSource:({S2ID:e})=>e}}];var wr=new Se([{source:"annote",target:"annote",when:{source:{annotation:!1},target:!1}},{source:"address",target:"publisher-place",convert:yr.PICK,when:{source:{location:!1},target:!1}},{source:["eprint","archiveprefix"],target:"PMID",convert:yr.EPRINT,when:{source:{eprinttype:!1},target:!1}},{source:"journal",target:"container-title",when:{source:{maintitle:!1,booktitle:!1,journaltitle:!1},target:!1}},{source:"school",target:"publisher",convert:yr.PICK,when:{source:{institution:!1,organization:!1,publisher:!1},target:!1}},...vr,{source:"abstract",target:"abstract"},{source:"urldate",target:"accessed",convert:yr.DATE},{source:"annotation",target:"annote"},{source:["author","author+an:orcid"],target:"author",convert:yr.NAMES_ORCID},{source:"library",target:"call-number"},{source:"chapter",target:"chapter-number"},{source:"bookauthor",target:"container-author",convert:yr.NAMES},{source:["maintitle","mainsubtitle","maintitleaddon"],target:"container-title",when:{source:!0,target:{"number-of-volumes":!0}},convert:yr.TITLE},{source:["booktitle","booksubtitle","booktitleaddon"],target:"container-title",when:{source:{maintitle:!1},target:{"number-of-volumes":!1,type:e=>!e||!e.startsWith("article")}},convert:yr.TITLE},{source:["journaltitle","journalsubtitle","journaltitleaddon"],target:"container-title",when:{source:{[pr]:"article"},target:{type:["article","article-newspaper","article-journal","article-magazine"]}},convert:yr.TITLE},{source:"shortjournal",target:"container-title-short",when:{source:{[pr]:"article"},target:{type:["article","article-newspaper","article-journal","article-magazine"]}}},{source:"shortjournal",target:"journalAbbreviation",when:{source:!1,target:{"container-title-short":!1}}},{source:"number",target:"collection-number",when:{source:{[pr]:["book","mvbook","inbook","bookinbook","suppbook","collection","mvcollection","incollection","suppcollection","manual","suppperiodical","proceedings","mvproceedings","refererence"]},target:{type:["bill","book","broadcast","chapter","dataset","entry","entry-dictionary","entry-encyclopedia","figure","graphic","interview","legislation","legal_case","manuscript","map","motion_picture","musical_score","pamphlet","post","post-weblog","personal_communication","review","review-book","song","speech","thesis","treaty","webpage"]}}},{source:"series",target:"collection-title"},{source:"shortseries",target:"collection-title-short"},{source:"doi",target:"DOI"},{source:"edition",target:"edition"},{source:"editor",target:"editor",convert:yr.NAMES},{source:[pr,"entrysubtype","type"],target:["type","genre"],convert:{toTarget:(e,t,r)=>(r||("mastersthesis"===e&&(r="mathesis"),"phdthesis"===e&&(r="phdthesis"),"techreport"===e&&(r="techreport")),[_t.source[e]||"document",r||t]),toSource(e,t){const r=_t.target[e]||"misc";return t in dr?[r,void 0,t]:[r,t]}}},{source:pr,when:{target:{type:!1}},convert:{toSource:()=>"misc"}},{source:"eventdate",target:"event-date",convert:yr.DATE},{source:"venue",target:"event-place"},{source:["eventtitle","eventtitleaddon"],target:"event-title",convert:yr.EVENT_TITLE},{source:["eventtitle","eventtitleaddon"],target:"event",convert:yr.EVENT_TITLE,when:{source:!1,target:{"event-title":!1}}},{source:fr,target:["id","citation-key","author","issued","year-suffix","title"],convert:yr.LABEL},{source:"isbn",target:"ISBN"},{source:"issn",target:"ISSN"},{source:"issue",target:"issue",when:{source:{number:!1,[pr]:["article","periodical"]},target:{issue:e=>"string"==typeof e&&!e.match(/\d+/),type:["article","article-journal","article-newspaper","article-magazine","periodical"]}}},{source:"number",target:"issue",when:{source:{[pr]:["article","periodical","inproceedings"]},target:{issue:e=>e&&("number"==typeof e||e.match(/\d+/)),type:["article","article-journal","article-newspaper","article-magazine","paper-conference","periodical"]}}},{source:"date",target:"issued",convert:yr.DATE},{source:["year","month","day"],target:"issued",convert:yr.YEAR_MONTH,when:{source:{date:!1},target:!1}},{source:"location",target:"jurisdiction",when:{source:{type:"patent"},target:{type:"patent"}}},{source:"keywords",target:"keyword",convert:yr.KEYWORDS},{source:"language",target:"language",convert:yr.PICK},{source:"langid",target:"language",when:{source:{language:!1},target:!1}},{source:"note",target:"note"},{source:"addendum",target:"note",when:{source:{note:!1},target:!1}},{source:"eid",target:"number",when:{target:{type:["article-journal"]}}},{source:["isan","ismn","isrn","iswc"],target:"number",convert:yr.STANDARD_NUMBERS,when:{source:{[pr]:e=>"patent"!==e},target:{type:e=>"patent"!==e}}},{source:"number",target:"number",when:{source:{[pr]:["patent","report","techreport","legislation"]},target:{type:["patent","report","legislation"]}}},{source:"origdate",target:"original-date",convert:yr.DATE},{source:"origlocation",target:"original-publisher-place",convert:yr.PICK},{source:"origpublisher",target:"original-publisher",convert:yr.PICK},{source:"origtitle",target:"original-title"},{source:"pages",target:"page",when:{source:{bookpagination:[void 0,"page"]}},convert:yr.PAGES},{source:"pagetotal",target:"number-of-pages"},{source:"part",target:"part-number"},{source:["eprint","eprinttype"],target:"PMID",convert:yr.EPRINT},{source:"location",target:"publisher-place",convert:yr.PICK},{source:"publisher",target:"publisher",convert:yr.PICK,when:{source:!0,target:{type:["article","article-journal","article-magazine","article-newspaper","bill","book","broadcast","chapter","classic","collection","dataset","document","entry","entry-dictionary","entry-encyclopedia","event","figure","graphic","hearing","interview","legal_case","legislation","manuscript","map","motion_picture","musical_score","pamphlet","paper-conference","patent","performance","periodical","personal_communication","post","post-weblog","regulation","review","review-book","software","song","speech","standard","treaty"]}}},{source:"organization",target:"publisher",convert:yr.PICK,when:{source:{publisher:!1},target:{type:"webpage"}}},{source:"institution",target:"publisher",convert:yr.PICK,when:{source:{publisher:!1,organization:!1},target:{type:["report","thesis"]}}},{source:"howpublished",target:"publisher",convert:yr.PICK,when:{source:{howpublished:e=>e&&!e.startsWith("http"),publisher:!1,organization:!1,institution:!1},target:{type:"manuscript"}}},{source:["pages","bookpagination"],target:"section",when:{source:{bookpagination:"section"},target:{page:!1}},convert:{toTarget:e=>e,toSource:e=>[e,"section"]}},{source:"pubstate",target:"status",convert:yr.STATUS},{source:"shorttitle",target:"title-short"},{source:"shorttitle",target:"shortTitle",when:{source:!1,target:{"title-short":!1}}},{source:["title","subtitle","titleaddon"],target:"title",convert:yr.TITLE},{source:"translator",target:"translator",convert:yr.NAMES},{source:"url",target:"URL"},{source:"howpublished",target:"URL",convert:yr.HOW_PUBLISHED,when:{source:{url:!1},target:!1}},{source:"version",target:"version"},{source:"volume",target:"volume"},{source:"volumes",target:"number-of-volumes"},{source:["issuetitle","issuesubtitle","issuetitleaddon"],target:"volume-title",convert:yr.TITLE}]),xr=new Se([{source:"note",target:"accessed",when:{source:!1,target:{note:!1}},convert:{toSource:e=>`[Online; accessed ${i(e)}]`}},{source:"annote",target:"annote"},{source:"address",target:"publisher-place",convert:yr.PICK},{source:"author",target:"author",convert:yr.NAMES},{source:"chapter",target:"chapter-number"},{source:"number",target:"collection-number",when:{source:{[pr]:["book","mvbook","inbook","collection","mvcollection","incollection","suppcollection","manual","suppperiodical","proceedings","mvproceedings","refererence"]},target:{type:["bill","book","broadcast","chapter","dataset","entry","entry-dictionary","entry-encyclopedia","figure","graphic","interview","legislation","legal_case","manuscript","map","motion_picture","musical_score","pamphlet","post","post-weblog","personal_communication","review","review-book","song","speech","thesis","treaty","webpage"]}}},{source:"series",target:"collection-title"},{source:"booktitle",target:"container-title",when:{target:{type:["chapter","paper-conference"]}}},{source:"journal",target:"container-title",when:{source:{[pr]:"article"},target:{type:["article","article-newspaper","article-journal","article-magazine"]}}},{source:"doi",target:"DOI"},{source:"edition",target:"edition"},{source:"editor",target:"editor",convert:yr.NAMES},{source:fr,target:["id","citation-key","author","issued","year-suffix","title"],convert:yr.LABEL},{source:"isbn",target:"ISBN"},{source:"issn",target:"ISSN"},{source:"number",target:"issue",when:{source:{[pr]:["article","periodical","inproceedings"]},target:{issue:e=>"number"==typeof e||"string"==typeof e&&e.match(/\d+/),type:["article","article-journal","article-newspaper","article-magazine","paper-conference","periodical"]}}},{source:["year","month","day"],target:"issued",convert:yr.YEAR_MONTH},{source:"note",target:"note"},{source:"number",target:"number",when:{source:{[pr]:["patent","report","techreport"]},target:{type:["patent","report"]}}},{source:"eid",target:"number",when:{source:{number:!1},target:{type:["article-journal"]}}},{source:"pages",target:"page",convert:yr.PAGES},{source:"publisher",target:"publisher",convert:yr.PICK,when:{target:{type:["article","article-journal","article-magazine","article-newspaper","bill","book","broadcast","chapter","classic","collection","dataset","document","entry","entry-dictionary","entry-encyclopedia","event","figure","graphic","hearing","interview","legal_case","legislation","map","motion_picture","musical_score","pamphlet","patent","performance","periodical","personal_communication","post","post-weblog","regulation","review","review-book","software","song","speech","standard","treaty","webpage"]}}},{source:"organization",target:"publisher",convert:yr.PICK,when:{source:{publisher:!1},target:{type:"paper-conference"}}},{source:"institution",target:"publisher",convert:yr.PICK,when:{source:{publisher:!1,organization:!1},target:{type:"report"}}},{source:"school",target:"publisher",convert:yr.PICK,when:{source:{institution:!1,organization:!1,publisher:!1},target:{type:"thesis"}}},{source:"howpublished",target:"publisher",convert:yr.PICK,when:{source:{howpublished:e=>e&&!e.startsWith("http"),publisher:!1,organization:!1,institution:!1,school:!1},target:{type:"manuscript"}}},{source:"title",target:"title"},{source:[pr,"type"],target:["type","genre"],convert:{toTarget(e,t){const r=At.source[e]||"document";return t?[r,t]:"mastersthesis"===e?[r,"Master's thesis"]:"phdthesis"===e?[r,"PhD thesis"]:[r]},toSource(e,t){const r=At.target[e]||"misc";return/^(master'?s|diploma) thesis$/i.test(t)?["mastersthesis"]:/^(phd|doctoral) thesis$/i.test(t)?["phdthesis"]:[r,t]}}},{source:pr,when:{target:{type:!1}},convert:{toSource:()=>"misc"}},{source:"url",target:"URL"},{source:"howpublished",target:"URL",convert:yr.HOW_PUBLISHED,when:{target:{publisher:!1}}},{source:"volume",target:"volume"}]);function kr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}const Tr=new Set(["book","inbook","bookinbook","suppbook"]),Or=new Set(["inbook","bookinbook","suppbook"]),jr=new Set(["collection","reference","incollection","inreference","suppcollection"]),Er=new Set(["incollection","inreference","suppcollection"]),Sr=new Set(["proceedings","inproceedings"]),_r=new Set(["inproceedings"]),Ar=new Set(["article","suppperiodical"]),Pr={mvbook:["main",Tr],mvcollection:["main",jr],mvreference:["main",jr],mvproceedings:["main",Sr],book:["book",Or],collection:["book",Er],reference:["book",Er],proceedings:["book",_r],periodical:["journal",Ar]};function Cr(e,t,r){if(t.crossref in r){const i=r[t.crossref];if(i.properties===t)return t;const o=function(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);for(i=0;i=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function Ir(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function Br(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,"string");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}function Lr(e,t){const r={};for(const t of e)r[t.label]=t;return e.map(({type:e,label:i,properties:o})=>t.convertToTarget(function(e){for(var t=1;t{const r=t.convertToSource(e),{[pr]:i,[fr]:o}=r;return{type:i,label:o,properties:Rr(r,[pr,fr].map(Br))}})}function zr(e){const t=e.toUpperCase(),r=e.toLowerCase();for(let i=0;i1;){const{value:r,hyphenated:i}=e.shift();t+=r+(i?"-":" ")}const r=t+e[0].value;return r[0]&&r}function $r(e){if(e[0][0].label){const t={};for(const[{value:r,label:i}]of e)t[i]=r;return t}const t={},[r,i,o]=function(e,t=!0){const r=[],i=[];if(t)for(;e.length>1&&!1!==e[0].upperCase;){for(r.push(...i),i.length=0;e.length>1&&!1!==e[0].upperCase&&!e[0].hyphenated;)r.push(e.shift());for(;e.length>0&&!1!==e[0].upperCase&&e[0].hyphenated;)i.push(e.shift())}const o=[],n=[];for(;e.length>1;){for(o.push(...n),n.length=0;e.length>1&&!1===e[0].upperCase;)o.push(e.shift());for(;e.length>0&&!1!==e[0].upperCase;)n.push(e.shift())}return i.length&&n.unshift(...i),e.length&&n.push(e[0]),[Ur(r),Ur(o),Ur(n)]}(e[0],1===e.length);return o&&(t.family=o),i&&(t.prefix=i),3===e.length?(t.given=Ur(e[2]),t.suffix=Ur(e[1])):2===e.length?t.given=Ur(e[1]):r&&(t.given=r),t}function Mr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function Nr(e){for(var t=1;te.slice(1).trim()},lbrace:{match:"{",push:"bracedLiteral"},mathShift:{match:"$",push:"mathLiteral"},whitespace:{match:/[\s]+|~/,lineBreaks:!0,value:e=>"~"===e?" ":" "}},Fr=St.states({stringLiteral:Nr(Nr({},qr),{},{text:/[^{$}\s~\\]+/}),namesLiteral:Nr(Nr({and:/\s+[aA][nN][dD]\s+/,comma:",",hyphen:"-",equals:"="},qr),{},{text:/[^{$}\s~\\,=-]+/}),listLiteral:Nr(Nr({and:/\s+and\s+/},qr),{},{text:/[^{$}\s~\\]+/}),separatedLiteral:Nr(Nr({comma:","},qr),{},{text:/[^{$}\s~\\,]+/}),annotation:Nr(Nr({},qr),{},{colon:":",equals:"=",comma:",",semicolon:";",quote:'"',itemCount:/\d+/,text:/[^{$}\s~\\":;,=]+/}),bracedLiteral:Nr(Nr({},qr),{},{rbrace:{match:"}",pop:!0},text:/[^{$}\s~\\]+/}),mathLiteral:Nr(Nr({},qr),{},{mathShift:{match:"$",pop:!0},script:/[\^_]/,text:/[^{$}\s~\\^_]+/}),environment:Nr(Nr({commandEnd:{match:"\\end",pop:!0}},qr),{},{text:/[^{$}\s~\\]+/})});function Hr(e,t){return t in Ut?e&&Ut[t].join(e):e}const Gr=new je({String(){let e="";for(;!this.matchEndOfFile();)e+=this.consumeRule("Text");return e},StringNames(){const e=[];for(;;){if(this.consumeToken("whitespace",!0),e.push(this.consumeRule("Name")),this.consumeToken("whitespace",!0),this.matchEndOfFile())return e;this.consumeToken("and")}},Name(){const e=[];for(;;){if(e.push(this.consumeRule("NamePiece")),this.matchEndOfFile()||this.matchToken("and"))return $r(e);this.consumeToken("comma"),this.consumeToken("whitespace",!0)}},NamePiece(){const e=[];for(;;){const t=this.consumeRule("NameToken");if(t.label)return t.label=Ur([...e,{value:t.label}]),[t];if(e.push(t),this.matchEndOfFile()||this.matchToken("and")||this.matchToken("comma"))return e;for(;this.matchToken("hyphen")||this.matchToken("whitespace");)this.consumeToken()}},NameToken(){let e=null,t="";for(;;)if(null===e&&this.matchToken("text")){const r=this.consumeToken().value;t+=r,e=zr(r)}else{if(this.matchEndOfFile()||this.matchToken("and")||this.matchToken("comma")||this.matchToken("whitespace"))return{value:t,upperCase:e};if(this.matchToken("hyphen"))return{value:t,upperCase:e,hyphenated:!0};if(this.matchToken("equals")){this.consumeToken("equals");const e=this.consumeRule("NamePiece");return e[0].label&&(t+="="+e[0].label),{value:Ur(e),label:t}}t+=this.consumeRule("Text")}},StringList(){const e=[];for(;!this.matchEndOfFile();){let t="";for(;!this.matchEndOfFile()&&!this.matchToken("and");)t+=this.consumeRule("Text");e.push(t),this.consumeToken("and",!0)}return 1===e.length?e[0]:e},StringSeparated(){const e=[];for(;!this.matchEndOfFile();){let t="";for(;!this.matchEndOfFile()&&!this.matchToken("comma");)t+=this.consumeRule("Text");e.push(t.trim()),this.consumeToken("comma",!0),this.consumeToken("whitespace",!0)}return e},StringVerbatim(){let e="";for(;!this.matchEndOfFile();)e+=this.consumeToken().text;return e},StringUri(){const e=this.consumeRule("StringVerbatim");try{return decodeURI(e)===e?encodeURI(e):e}catch(t){return encodeURI(e)}},StringTitleCase(){this.state.sentenceCase=!0;let e="";for(;!this.matchEndOfFile();)e+=this.consumeRule("Text");return e},Annotations(){const e={};for(;;){const{scope:t,item:r,part:i,value:o}=this.consumeRule("Annotation");if("part"===t?(e.part||(e.part=[]),e.part[r]||(e.part[r]={}),e.part[r][i]=o):"item"===t?(e.item||(e.item=[]),e.item[r]=o):e.field=o,this.matchEndOfFile())break;this.consumeToken("semicolon"),this.consumeRule("_")}return e},Annotation(){const e={};if(this.matchToken("itemCount")?(e.item=parseInt(this.consumeToken("itemCount"))-1,this.matchToken("colon")?(this.consumeToken("colon"),e.part=this.consumeToken("text"),e.scope="part"):e.scope="item"):e.scope="field",this.consumeToken("equals"),this.consumeRule("_"),this.matchToken("quote")){this.consumeToken("quote");let t="";for(;!this.matchToken("quote");)this.matchToken("itemCount")||this.matchToken("colon")||this.matchToken("comma")||this.matchToken("semicolon")||this.matchToken("equals")?(t+=this.token.value,this.token=this.lexer.next()):t+=this.consumeRule("Text");this.consumeToken("quote"),e.value=t,this.consumeRule("_")}else{e.value=[];let t="";for(;;)if(t+=this.consumeRule("Text"),this.matchToken("comma"))this.consumeToken("comma"),this.consumeRule("_"),e.value.push(t),t="";else if(this.matchEndOfFile()||this.matchToken("semicolon")){e.value.push(t);break}}return e},BracketString(){var e;let t="";this.consumeToken("lbrace");const r=this.state.sentenceCase;for(this.state.sentenceCase=r&&this.matchToken("command"),(e=this.state).partlyLowercase&&(e.partlyLowercase=this.state.sentenceCase);!this.matchToken("rbrace");)t+=this.consumeRule("Text");const i=r&&!this.state.sentenceCase&&this.state.partlyLowercase;return this.state.sentenceCase=r,this.consumeToken("rbrace"),i?Hr(t,"nocase"):t},MathString(){let e="";for(this.consumeToken("mathShift");!this.matchToken("mathShift");)if(this.matchToken("script")){const t=this.consumeToken("script").value,r=this.consumeRule("Text").split("");r.every(e=>e in Ft[t])?e+=r.map(e=>Ft[t][e]).join(""):e+=Ut[qt[t]].join(r.join(""))}else{if(this.matchToken("command")){const t=this.token.value;if(t in qt){this.consumeToken("command"),e+=Hr(this.consumeRule("BracketString"),qt[t]);continue}}e+=this.consumeRule("Text")}return this.consumeToken("mathShift"),e},Text(){if(this.matchToken("lbrace"))return this.consumeRule("BracketString");if(this.matchToken("mathShift"))return this.consumeRule("MathString");if(this.matchToken("whitespace"))return this.consumeToken("whitespace").value;if(this.matchToken("commandBegin"))return this.consumeRule("EnclosedEnv");if(this.matchToken("command"))return this.consumeRule("Command");const e=this.consumeToken("text").value.replace(Mt,e=>Nt[e]),t=this.state.afterPunctuation;var r;if(this.state.afterPunctuation=/[?!.:]$/.test(e),!this.state.sentenceCase)return(r=this.state).partlyLowercase||(r.partlyLowercase=e===e.toLowerCase()&&e!==e.toUpperCase()),e;const[i,...o]=e,n=o.join(""),a=n.toLowerCase();return n!==a?e:t?i+a:e.toLowerCase()},Command(){const e=this.consumeToken("command"),t=e.value;if(t in Dt)return Hr(this.consumeRule("Env"),Dt[t]);if(t in zt)return Hr(this.consumeRule("BracketString"),zt[t]);if(t in It)return It[t];if(t in Bt)return Bt[t];if(t in Rt&&!this.matchEndOfFile()){const e=this.consumeRule("Text");return(e[0]+Rt[t]).normalize("NFC")+e.slice(1)}if(t in $t){const e=$t[t],r=[];let i=e.length;for(;i-- >0;)this.consumeToken("whitespace",!0),r.push(this.consumeRule("BracketString"));return e(...r)}return/^[&%$#_{}]$/.test(t)?e.text.slice(1):e.text},Env(){let e="";for(;!this.matchEndOfFile()&&!this.matchToken("rbrace");)e+=this.consumeRule("Text");return e},EnclosedEnv(){this.consumeToken("commandBegin");const e=this.consumeRule("BracketString");let t="";for(;!this.matchToken("commandEnd");)t+=this.consumeRule("Text");const r=this.consumeToken("commandEnd"),i=this.consumeRule("BracketString");if(e!==i)throw new SyntaxError(this.lexer.formatError(r,`environment started with "${e}", ended with "${i}"`));return Hr(t,Dt[e])},_(){for(;this.matchToken("whitespace");)this.consumeToken("whitespace")}},{sentenceCase:!1,partlyLowercase:!1,afterPunctuation:!0});function Jr(e){return Ht.includes(e.toLowerCase())}function Vr(e){if("name"===e[1])return"namesLiteral";switch(e[0]){case"list":return"listLiteral";case"separated":return"separatedLiteral";default:return"stringLiteral"}}function Kr(e,t,r=[]){const i=Ct[t]||[];return Gr.parse(Fr.reset(e,{state:Vr(i),line:0,col:0}),function(e,t){if("name"===e[1])return"list"===e[0]?"StringNames":"Name";if("title"===e[1]){const e=Gt.parse.sentenceCase;return"always"===e||"english"===e&&function(e){return Array.isArray(e)?e.every(Jr):Jr(e)}(t)?"StringTitleCase":"String"}switch("field"===e[0]?e[1]:e[0]){case"list":return"StringList";case"separated":return"StringSeparated";case"verbatim":return"StringVerbatim";case"uri":return"StringUri";default:return"String"}}(i,r))}function Wr(e){return Gr.parse(Fr.reset(e,{state:"annotation",line:0,col:0}),"Annotations")}function Xr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,i)}return r}function Yr(e){for(var t=1;te in n)?e.push(r.join("/")):"string"!=typeof r||r in n||e.push(r);e.length&&r.push([o,`missing fields: ${e.join(", ")}`])}else r.push([o,`invalid type: "${i}"`]);if(r.length)throw new RangeError(["Invalid entries:"].concat(r.map(([e,t])=>` - ${e} has ${t}`)).join("\n"))}function Qr(e){const t={};"language"in e.properties&&(t.language=Kr(e.properties.language,"language"));for(const r in e.properties){const i=e.properties[r];""!==i&&(t[r]=Kr(i+"",r,t.language))}for(const r in e.annotations)for(const i in e.annotations[r])t[r+"+an:"+i]=Wr(e.annotations[r][i]);return Yr(Yr({},e),{},{properties:t})}function ei(e){return Gt.parse.strict&&Zr(e,Pt.biblatex),function(e){return Lr(e,wr)}(e.map(Qr))}function ti(e){return Gt.parse.strict&&Zr(e,Pt.bibtex),function(e){return Lr(e,xr)}(e.map(Qr))}const ri={"@biblatex/text":{parse:Qt,parseType:{dataType:"String",predicate:/@\s{0,5}[A-Za-z]{1,13}\s{0,5}\{\s{0,5}[^@{}"=,\\\s]{0,100}\s{0,5},[\s\S]*\}/}},"@biblatex/entry+object":{parse:e=>ei([e]),parseType:{dataType:"SimpleObject",propertyConstraint:{props:["type","label","properties"]}}},"@biblatex/entries+list":{parse:ei,parseType:{elementConstraint:"@biblatex/entry+object"}},"@bibtex/text":{parse:Qt,outputs:"@bibtex/entries+list"},"@bibtex/entry+object":{parse:e=>ti([e])},"@bibtex/entries+list":{parse:ti},"@bibtxt/text":{parse:e=>e.trim().split(er).map(or),parseType:{dataType:"String",predicate:/^\s*(\[(?!\s*[{[]).*?\]\s*(\n\s*[^[]((?!:)\S)+\s*:\s*.+?\s*)*\s*)+$/}}},ii={};for(const e in It)ii[It[e]]=e;for(const e in Rt)ii[Rt[e]]=e;for(const e in Nt)ii[Nt[e]]=e;const oi={};for(const e in Bt)oi[Bt[e]]=e;const ni=/[^a-zA-Z0-9\s!"#%&'()*+,\-./:;=?@[\]{}\u0300-\u0308\u030a-\u030c\u0332\u0323\u0327\u0328\u0361\u0326]/g,ai=/.[\u0300-\u0308\u030a-\u030c\u0332\u0323\u0327\u0328\u0361\u0326]+/g,si=/[\u0300-\u0308\u030a-\u030c\u0332\u0323\u0327\u0328\u0361\u0326]/g,li={separated:",",list:" and "},ci={i:"\\textit{",b:"\\textbf{",sc:"\\textsc{",sup:"\\textsuperscript{",sub:"\\textsubscript{",'span style="font-variant:small-caps;"':"\\textsc{",'span class="nocase"':"{"};function ui(e){return Gt.format.asciiOnly?e.normalize("NFKD").replace(ni,e=>function(e){return e in ii?ii[e]in Nt?ii[e]:`\\${ii[e]}{}`:e in oi?`$\\${oi[e]}$`:""}(e)).replace(ai,e=>Array.from(e).reduce((e,t)=>`{\\${ii[t]} ${e}}`)).replace(si,""):e}function mi(e){const t=[];let r=e.split(/<(\/?(?:i|b|sc|sup|sub|span)|span .*?)>/g);return r=r.map((e,r)=>r%2==0?ui(e):e in ci?(t.push("/"+e.split(" ")[0]),ci[e]):e===t[t.length-1]?(t.pop(),"}"):""),r.join("")}function pi(e,t){switch(t){case"title":return mi(e).split(/(:\s*)/).map((e,t)=>t%2?e:e.replace(/([^\\])\b([a-z]*[A-Z].*?)\b/g,"$1{$2}")).join("");case"literal":return mi(e.toString());case"name":return function(e){if(e.family&&!e.prefix&&!e.given&!e.suffix)return e.family.includes(li.list)?e.family:`{${e.family}}`;const t=[""];return e.prefix&&e.family&&(t[0]+=e.prefix+" "),e.family&&(t[0]+=e.family),e.suffix?(t.push(e.suffix),t.push(e.given||"")):t.push(e.given),ui(t.join(", ").trim())}(e);case"verbatim":case"uri":return e.toString();default:return ui(e.toString())}}function fi(e){return Array.isArray(e)?e.map(e=>ui(e).replace(/([;,"])/g,"{$1}")).join(", "):'"'+ui(e).replace(/(["])/g,"{$1}")+'"'}function hi(e,t){if(!(e in Ct))return pi(t,"verbatim");const[r,i]=Ct[e];return r in li?function(e,t,r){const i=li[r];return e.map(e=>{const r=pi(e,t);return r.includes(i)?`{${r}}`:r}).join(i)}(t,i,r):pi(t,i)}function di(e){const t=[];if(e.field&&t.push("="+fi(e.field)),e.item)for(const[r,i]of Object.entries(e.item)){if(!i)continue;const e=parseInt(r)+1;t.push(e+"="+fi(i))}if(e.part)for(const[r,i]of Object.entries(e.part)){if(!i)continue;const e=parseInt(r)+1;for(const r in i)i[r]&&t.push(e+":"+r+"="+fi(i[r]))}return t.join("; ")}function gi({type:e,label:t,properties:r}){const i={type:e,label:t,properties:{}};for(const e in r){const t=r[e],[o,n]=e.split("+an:");n?(i.annotations||(i.annotations={}),i.annotations[o]||(i.annotations[o]={}),i.annotations[o][n]=di(t)):i.properties[e]=hi(e,t)}return i}function bi(e){return function(e){return Dr(e,xr)}(e).map(gi)}function yi(e,t,r){return r.listItem.join(`${e} = {${t}},`)}function vi(e,t){const r=e.map(e=>function(e,t){const r=[];for(const i in e.properties)if(r.push(yi(i,e.properties[i],t)),e.annotations&&e.annotations[i])for(const o in e.annotations[i]){let n=i+Gt.biber.annotationMarker;"default"!==o&&(n+=Gt.biber.namedAnnotationMarker+o),r.push(yi(n,e.annotations[i][o],t))}return t.entry.join(`@${e.type}{${e.label},${t.list.join(r.join(""))}}`)}(e,t)).join("");return t.bibliographyContainer.join(r)}const wi=function(e,t){return function(r,i={}){const{type:o,format:n=o||"text"}=i;if(r=e(r),"object"===n)return r;if(rt(n))return t(r,it(n),i);throw new RangeError(`Output dictionary "${n}" not available`)}};var xi={bibtex:wi(bi,vi),biblatex:wi(function(e){return function(e){return Dr(e,wr)}(e).map(gi)},vi),bibtxt:wi(bi,function(e,t){const r=e.map(e=>function({type:e,label:t,properties:r},i){const o=Object.entries(r).concat([["type",e]]).map(([e,t])=>i.listItem.join(`${e}: ${t}`));return i.entry.join(`[${t}]${i.list.join(o.join(""))}`)}(e,t)).join("\n");return t.bibliographyContainer.join(r)})};ct("@bibtex",{input:ri,output:xi,config:Gt});const ki=new Oe({"en-US":'Andrew DunningSebastian KarcherRintze M. ZelleDenis MeierBrenton M. WiernikThis work is licensed under a Creative Commons Attribution-ShareAlike 3.0 License2015-10-10T23:31:02+00:00advance online publicationalbumaudio recordingfilmhenceforthloc. cit.no placen.p.no publishern.p.onop. cit.original work publishedpersonal communicationpodcastpodcast episodepreprintradio broadcastradio seriesradio series episodespecial issuespecial sectiontelevision broadcasttelevision seriestelevision series episodevideoworking paperaccessedandand othersanonymousanon.atavailable atbycircac.citededitioneditionsed.et al.forthcomingfromibid.inin pressinternetinterviewletterno daten.d.onlinepresented at thereferencereferencesref.refs.retrievedscaleversionpreprintjournal articlemagazine articlenewspaper articlebillbookbroadcastbook chapterclassiccollectiondatasetdocumententrydictionary entryencyclopedia entryeventgraphichearinginterviewlegal caselegislationmanuscriptmapvideo recordingmusical scorepamphletconference paperpatentperformanceperiodicalpersonal communicationpostblog postregulationreportreviewbook reviewsoftwareaudio recordingpresentationstandardthesistreatywebpagejournal art.mag. art.newspaper art.bk.bk. chap.doc.graph.interv.MSvideo rec.rep.rev.bk. rev.audio rec.ADBCBCECE:,;thstndrdthththfirstsecondthirdfourthfifthsixthseventheighthninthtenthactactsappendixappendicesarticlearticlescanoncanonslocationlocationsequationequationsrulerulesscenescenestabletablestitletitlesbookbookschapterchapterscolumncolumnsfigurefiguresfoliofoliosnumbernumberslinelinesnotenotesopusoperapagepagespagepagesparagraphparagraphspartpartssectionsectionssub verbosub verbisverseversesvolumevolumesapp.apps.art.arts.loc.locs.eq.eqs.r.rr.sc.scs.tbl.tbls.tit.tits.bk.bks.chap.chaps.col.cols.fig.figs.fol.fols.no.nos.l.ll.n.nn.op.opp.p.pp.p.pp.para.paras.pt.pts.sec.secs.s.v.s.vv.v.vv.vol.vols.¶¶§§§chairchairscompilercompilerscontributorcontributorscuratorcuratorsexecutive producerexecutive producersguestguestshosthostsnarratornarratorsorganizerorganizersperformerperformersproducerproducerswriterwritersseries creatorseries creatorsdirectordirectorseditoreditorseditoreditorsillustratorillustratorstranslatortranslatorseditor & translatoreditors & translatorscomp.comps.contrib.contribs.cur.curs.exec. prod.exec. prods.narr.narrs.org.orgs.perf.perfs.prod.prods.writ.writs.cre.cres.dir.dirs.ed.eds.ed.eds.ill.ills.tran.trans.ed. & tran.eds. & trans.chaired bycompiled bywithcurated byexecutive produced bywith guesthosted bynarrated byorganized byperformed byproduced bywritten bycreated bybydirected byedited byedited byillustrated byinterview bytobytranslated byedited & translated bycomp. byw.cur. byexec. prod. byw. guesthosted bynarr. byorg. byperf. byprod. bywrit. bycre. bydir. byed. byed. byillus. bytrans. byed. & trans. byJanuaryFebruaryMarchAprilMayJuneJulyAugustSeptemberOctoberNovemberDecemberJan.Feb.Mar.Apr.MayJun.Jul.Aug.Sep.Oct.Nov.Dec.SpringSummerAutumnWinter'}),Ti=new Oe({apa:''}),Oi=Symbol.for("proxied"),ji=function(e){const t=function(t,r){if(t.sys.wrapBibliographyEntry){const[e,i]=t.sys.wrapBibliographyEntry(this.system_id);r=[e,r,i].join("")}return e.call(this,t,r)};return t[Oi]=!0,t};for(const e in o.Output.Formats){const t=o.Output.Formats[e]["@bibliography/entry"];t&&!t[Oi]&&(o.Output.Formats[e]["@bibliography/entry"]=ji(t))}function Ei(e){if(ki.has(e))return ki.get(e);const t=e.replace("-","_");return ki.has(t)?ki.get(t):{}}const Si={},_i=function(e,t,r,i){if(!o.Output.Formats[i]||!o.Output.Formats[i]["@bibliography/entry"])throw new TypeError(`Cannot find format '${i}'`);const n=e.reduce((e,t)=>(e[t.id]=t,e),{}),a=Ti.get(Ti.has(t)?t:"apa"),s=function(e,t,r,i,n){const a=`${e}|${t}`;let s;return Si[a]instanceof o.Engine?(s=Si[a],s.sys.retrieveItem=i,s.sys.wrapBibliographyEntry=void 0,s.updateItems([])):s=Si[a]=new o.Engine({retrieveLocale:n,retrieveItem:i},r,t,!0),s}(t,r=ki.has(r)?r:void 0,a,function(e){if(Object.prototype.hasOwnProperty.call(n,e))return n[e];throw new Error(`Cannot find entry with id '${e}'`)},Ei);return s.setOutputFormat(i),s.opt.development_extensions.wrap_url_and_doi=!1,s},Ai=(e,t)=>"function"==typeof t?t(e):t||"";function Pi(e){return"object"==typeof e?e:{id:e}}function Ci(e){return e.citationItems?e:{citationItems:[].concat(e).map(Pi),properties:{noteIndex:0}}}function Ri(e){return e?e.map(Ci):[]}function Ii(){return Ii=Object.assign?Object.assign.bind():function(e){for(var t=1;te);e=X(e);const s=_i(e,r,i,o),l=s.updateItems(a,n);if(t.append||t.prepend){const r=e.reduce((e,t)=>(e[t.id]=t,e),{});s.sys.wrapBibliographyEntry=function(e){const i=r[e];return[Ai(i,t.prepend),Ai(i,t.append)]}}t.hyperlinks&&(s.opt.development_extensions.wrap_url_and_doi=!0);const c=s.makeBibliography(),[{bibstart:u,bibend:m},p]=c,f=p.map((e,t)=>e.replace(/^\s*<[a-z]+/i,`$& data-csl-entry-id="${l[t]}"`));return t.asEntryArray?f.map((e,t)=>[l[t],e]):u+f.join("")+m},citation:function(e,t={}){const{template:r="apa",lang:i,format:o="text"}=t,n=e.map(({id:e})=>e),a=t.entry?t.entry:n;e=X(e);const s=_i(e,r,i,o),l=Ri(t.citationsPre),c=Ci(a),u=Ri(t.citationsPost);return s.rebuildProcessorState([...l,c,...u],o,[])[l.length][2]}},config:{engine:_i,locales:ki,templates:Ti}});const Bi="tag:yaml.org,2002:timestamp",Li=n.DEFAULT_SCHEMA.compiledTypeMap.scalar[Bi],Di=new n.Type(Bi,{kind:"scalar",resolve:Li.resolve,construct:Li.construct,instanceOf:Date,represent:e=>e.toISOString().split("T")[0]}),zi=n.DEFAULT_SCHEMA.extend({implicit:[Di],explicit:[]});ct("@else",{input:{"@else/yaml":{parseType:{dataType:"String",tokenList:{split:/\n(\s{2})*(-\s)?/,token:/^[\w-]*: /,every:!1}},parse:e=>n.load(e,{json:!0})}},output:{yaml:e=>n.dump(e,{schema:zi})}});const Ui={art:"graphic",article:"article-journal",audiovisual:"motion_picture",bill:"bill",blog:"post-weblog",book:"book",catalogue:"collection",conference:"event","conference-paper":"paper-conference",data:"dataset",database:"dataset",dictionary:"entry-dictionary","edited-work":"document",encyclopedia:"entry-encyclopedia","film-broadcast":"broadcast",generic:"document","government-document":"regulation",grant:"document",hearing:"hearing","historical-work":"classic","legal-case":"legal_case","legal-rule":"legislation","magazine-article":"article-magazine",manual:"report",map:"map",multimedia:"motion_picture",music:"musical_score","newspaper-article":"article-newspaper",pamphlet:"pamphlet",patent:"patent","personal-communication":"personal_communication",proceedings:"book",report:"report",serial:"periodical",slides:"speech",software:"software","software-code":"software","software-container":"software","software-executable":"software","software-virtual-machine":"software","sound-recording":"song",standard:"standard",statute:"legislation",thesis:"thesis",unpublished:"article",video:"motion_picture",website:"webpage"},$i={article:"article","article-journal":"article","article-magazine":"magazine-article","article-newspaper":"newspaper-article",bill:"bill",book:"book",broadcast:"film-broadcast",chapter:"generic",classic:"historical-work",collection:"catalogue",dataset:"data",document:"generic",entry:"generic","entry-dictionary":"dictionary","entry-encyclopedia":"encyclopedia",event:"conference",figure:"generic",graphic:"art",hearing:"hearing",interview:"sound-recording",legal_case:"legal-case",legislation:"statute",manuscript:"historical-work",map:"map",motion_picture:"film-broadcast",musical_score:"music",pamphlet:"pamphlet","paper-conference":"conference-paper",patent:"patent",performance:"generic",periodical:"serial",personal_communication:"personal-communication",post:"serial","post-weblog":"blog",regulation:"government-document",report:"report",review:"generic","review-book":"generic",software:"software",song:"sound-recording",speech:"slides",standard:"standard",thesis:"thesis",treaty:"generic",webpage:"website"},Mi=new Se([{source:"family-names",target:"family"},{source:"given-names",target:"given"},{source:"name-particle",target:"non-dropping-particle"},{source:"name-suffix",target:"suffix"},{source:"name",target:"literal"},{source:"orcid",target:"_orcid"}]),Ni={names:{toTarget:e=>e.map(Mi.convertToTarget),toSource:e=>e.map(Mi.convertToSource)},publisher:{toTarget:({name:e,city:t,region:r,country:i})=>[e,[t,r,i].filter(Boolean).join(", ")||void 0],toSource(e,t){const r={name:e};if(t){const e=t.split(", ");r.country=e.pop(),2===e.length&&(r.region=e.pop()),1===e.length&&(r.city=e.pop())}return r}},date:{toTarget:e=>e instanceof Date?r(e.toISOString()):r(new Date(e).toISOString()),toSource(e){if(e.raw)return e.raw;const[t,r,i]=e["date-parts"][0];return i?new Date(Date.UTC(t,r-1,i)):r?new Date(Date.UTC(t,r-1)):new Date(Date.UTC(t))}}},qi=["abstract",{source:"authors",target:"author",convert:Ni.names},{source:"date-released",target:"issued",when:{target:{type:"software"}},convert:Ni.date},{source:"doi",target:"DOI"},{source:"identifiers",target:["DOI","ISBN","ISSN","PMCID","PMID","URL"],convert:{toTarget(e){const t=Array(6).fill(void 0);for(const{type:r,value:i}of e)this.doi||"doi"!==r||(t[0]=i),this.url||"url"!==r||(t[5]=i),"other"===r&&i.startsWith("urn:isbn:")&&(t[1]=i.slice(9)),"other"===r&&i.startsWith("urn:issn:")&&(t[2]=i.slice(9)),"other"===r&&i.startsWith("pmcid:")&&(t[3]=i.slice(6)),"other"===r&&i.startsWith("pmid:")&&(t[4]=i.slice(5));return t},toSource:(e,t,r,i,o,n)=>[e&&{type:"doi",value:e},n&&{type:"url",value:n},t&&{type:"other",value:`urn:isbn:${t}`},r&&{type:"other",value:`urn:issn:${r}`},i&&{type:"other",value:`pmcid:${i}`},o&&{type:"other",value:`pmid:${o}`}].filter(Boolean)}},{source:"keywords",target:"keyword",convert:{toTarget:e=>e.join(","),toSource:e=>e.split(/,\s*/g)}},{source:"title",target:"title",when:{source:{term:!1,entry:!1},target:{type:e=>!["entry","entry-dictionary","entry-encyclopedia"].includes(e)}}},{source:"title",target:"container-title",when:{source:{entry:!0,journal:!1},target:{type:["entry"]}}},{source:"title",target:"container-title",when:{source:{term:!0,journal:!1},target:{type:["entry-dictionary","entry-encyclopedia"]}}},{source:"url",target:"URL"},"version"],Fi=[{source:"type",target:"type",convert:{toSource:e=>"dataset"===e?"dataset":"software",toTarget:e=>"dataset"===e?"dataset":"software"}},...qi],Hi=[...qi,{source:"abbreviation",target:"title-short"},{source:"abbreviation",target:"shortTitle"},"collection-title",{source:"recipients",target:"recipient",convert:Ni.names},{source:"senders",target:"authors",convert:Ni.names},{source:"conference",target:["event-title","event-date","event-place","event"],convert:{toSource(e,t,r,i){const o={name:e||i};return r&&(o.location=r),t&&(o["date-start"]=Ni.date.toSource(t),t["date-parts"]&&2===t["date-parts"].length&&(o["date-end"]=Ni.date.toSource({"date-parts":[t["date-parts"][1]]}))),o},toTarget:e=>[e.name,r(e["date-start"].toISOString(),e["date-end"].toISOString()),e.location]}},{source:"database",target:"source"},{source:"date-accessed",target:"accessed",convert:Ni.date},{source:"date-downloaded",target:"accessed",convert:Ni.date,when:{source:{"date-accessed":!1},target:!1}},{source:"date-published",target:"issued",convert:Ni.date,when:{source:{"date-released":!1},target(){return"book"!==this.type||!this.version}}},{source:["year","month"],target:"issued",when:{source:{"date-published":!1,"date-released":!1,year:!0}},convert:{toTarget:(e,t)=>({"date-parts":[t?[e,t]:[e]]}),toSource(e){const[t,r]=e["date-parts"][0];return[t,r]}}},{source:"year-original",target:"original-date",convert:{toTarget:e=>({"date-parts":[[e]]}),toSource:e=>e["date-parts"][0][0]}},"edition",{source:"editors",target:"editor",convert:Ni.names},{source:"editors-series",target:"collection-editor",convert:Ni.names},{source:"entry",target:"title",when:{source:{term:!1},target:{type:"entry"}}},{source:"term",target:"title",when:{target:{type:["entry-dictionary","entry-encyclopedia"]}}},{source:"format",target:"dimensions"},"medium",{source:"data-type",target:"genre",when:{target:{type:e=>"thesis"!==e}}},{source:"thesis-type",target:"genre",when:{source:{"data-type":!1},target:{type:"thesis"}}},{source:"isbn",target:"ISBN"},{source:"issn",target:"ISSN"},{source:"pmcid",target:"PMCID"},"issue",{source:"journal",target:"container-title"},{source:"volume-title",target:"volume-title"},{source:"issue-title",target:"volume-title",when:{source:{"volume-title":!1},target:!1}},{source:"languages",target:"language",when:{target:!0,source:{language:e=>/[a-z]{2,3}/.test(e)}},convert:{toSource:e=>[e],toTarget:e=>e[0]}},{source:"location",target:["archive","archive-place"],convert:Ni.publisher},{source:"notes",target:"note",when:{source:{scope:!1}}},{source:"scope",target:"note",when:{target:!1}},"number",{source:"patent-states",target:"jurisdiction",when:{target:!1},convert:{toTarget:e=>e.join(", ")}},{source:["institution","department"],target:["publisher","publisher-place"],when:{source:{publisher:!1},target:{type:"thesis"}},convert:{toTarget(e,t){const[r,i]=Ni.publisher.toTarget(e);return[t?`${t}, ${r}`:r,i]},toSource:(e,t)=>[Ni.publisher.toSource(e,t)]}},{source:"publisher",target:["publisher","publisher-place"],when:{target:{type:e=>"thesis"!==e}},convert:Ni.publisher},"section",{source:"status",target:"status",when:{source:!0,target:{status:["in-preparation","abstract","submitted","in-press","advance-online","preprint"]}}},{source:"start",target:"page-first",when:{target:{page:!1}}},{source:["start","end"],target:"page",convert:{toTarget:(e,t)=>t?`${e}-${t}`:e,toSource(e){const[t,r]=e.split("-");return r?[t,r]:[t]}}},{source:"pages",target:"number-of-pages"},{source:"translators",target:"translator",convert:Ni.names},{source:"type",target:"type",convert:{toTarget:e=>Ui[e]||"document",toSource(e){return"book"===e&&this["event-title"]?"proceedings":$i[e]||"generic"}}},"volume",{source:"number-volumes",target:"number-of-volumes"}],Gi=new Se(Fi),Ji=new Se(Hi),Vi="1.2.0";function Ki(e){"DOI"in e?e.id=e.DOI:"URL"in e&&(e.id=e.URL.replace("http://","").replace("https://",""))}function Wi(e,t){if(!(this instanceof Wi))return new Wi(e,t);const r=new et(e,t);this._options=r._options,this.log=r.log,this.data=r.data}ct("@cff",{input:{"@cff/object":{parseType:{dataType:"SimpleObject",propertyConstraint:{props:"cff-version"}},parse:function(e){const t=Gi.convertToTarget(e);e["cff-version"]<="1.1.0"&&(t.type=Ui.software),t._cff_mainReference=!0,Ki(t);const r=[t];if(e["preferred-citation"]){const t=Ji.convertToTarget(e["preferred-citation"]);Ki(t),r.push(t)}return Array.isArray(e.references)&&r.push(...e.references.map(Ji.convertToTarget)),r}}},output:{cff(e,t={}){const r=function(e,t={}){e=e.slice();const{main:r,preferred:i,cffVersion:o=Vi,message:n="Please cite the following works when using this software."}=t;let a;const s=e.findIndex(e=>i&&e.id===i);o>="1.2.0"&&s>-1&&(a=Ji.convertToSource(...e.splice(s,1)));let l=e.findIndex(e=>r?e.id===r:e._cff_mainReference);l=l>-1?l:0;const c=e[l]?Gi.convertToSource(...e.splice(l,1)):{};c&&o<"1.2.0"&&delete c.type;const u=Ii({"cff-version":o,message:n},c);return a&&(u["preferred-citation"]=a),e.length&&(u.references=e.map(Ji.convertToSource)),u}(e,t);return"object"===t.type?r:Xe("yaml",r)}}}),Wi.plugins=function e(t){const r={};for(const i in t)r[i]="object"==typeof t[i]?e(t[i]):t[i];return r}(ut);export{Wi as default}; //# sourceMappingURL=cite.mjs.map