citeproc-plus
Version:
Citeproc-js + citation styles bundled
1 lines • 364 kB
JavaScript
function t(t,e){return e.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(i){if("default"!==i&&!(i in t)){var s=Object.getOwnPropertyDescriptor(e,i);Object.defineProperty(t,i,s.get?s:{enumerable:!0,get:function(){return e[i]}})}}))})),Object.freeze(t)}function e(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var i,s,r,n,a,o,l,u,p,h,c={PROCESSOR_VERSION:"1.4.61",error:function(t){throw"undefined"==typeof Error?new Error("citeproc-js error: "+t):"citeproc-js error: "+t},debug:function(t){"undefined"==typeof console?dump("CSL: "+t+"\n"):console.log("citeproc-js warning: "+t)},toLocaleUpperCase(t){var e=this.tmp.lang_array;try{t=t.toLocaleUpperCase(e)}catch(e){t=t.toUpperCase()}return t},toLocaleLowerCase(t){var e=this.tmp.lang_array;try{t=t.toLocaleLowerCase(e)}catch(e){t=t.toLowerCase()}return t},LOCATOR_LABELS_REGEXP:new RegExp("^((vrs|sv|subpara|op|subch|add|amend|annot|app|art|bibliog|bk|ch|cl|col|cmt|dec|dept|div|ex|fig|fld|fol|n|hypo|illus|intro|l|no|p|pp|para|pt|pmbl|princ|pub|r|rn|sched|sec|ser|subdiv|subsec|supp|tbl|tit|vol)\\.)\\s+(.*)"),STATUTE_SUBDIV_PLAIN_REGEX:/(?:(?:^| )(?:vrs|sv|subpara|op|subch|add|amend|annot|app|art|bibliog|bk|ch|cl|col|cmt|dec|dept|div|ex|fig|fld|fol|n|hypo|illus|intro|l|no|p|pp|para|pt|pmbl|princ|pub|r|rn|sched|sec|ser|subdiv|subsec|supp|tbl|tit|vol)\. *)/,STATUTE_SUBDIV_PLAIN_REGEX_FRONT:/(?:^\s*[.,;]*\s*(?:vrs|sv|subpara|op|subch|add|amend|annot|app|art|bibliog|bk|ch|cl|col|cmt|dec|dept|div|ex|fig|fld|fol|n|hypo|illus|intro|l|no|p|pp|para|pt|pmbl|princ|pub|r|rn|sched|sec|ser|subdiv|subsec|supp|tbl|tit|vol)\. *)/,STATUTE_SUBDIV_STRINGS:{"vrs.":"verse","sv.":"sub-verbo","subpara.":"subparagraph","op.":"opus","subch.":"subchapter","add.":"addendum","amend.":"amendment","annot.":"annotation","app.":"appendix","art.":"article","bibliog.":"bibliography","bk.":"book","ch.":"chapter","cl.":"clause","col.":"column","cmt.":"comment","dec.":"decision","dept.":"department","ex.":"example","fig.":"figure","fld.":"field","fol.":"folio","n.":"note","hypo.":"hypothetical","illus.":"illustration","intro.":"introduction","l.":"line","no.":"issue","p.":"page","pp.":"page","para.":"paragraph","pt.":"part","pmbl.":"preamble","princ.":"principle","pub.":"publication","r.":"rule","rn.":"randnummer","sched.":"schedule","sec.":"section","ser.":"series,","subdiv.":"subdivision","subsec.":"subsection","supp.":"supplement","tbl.":"table","tit.":"title","vol.":"volume"},STATUTE_SUBDIV_STRINGS_REVERSE:{verse:"vrs.","sub-verbo":"sv.","sub verbo":"sv.",subparagraph:"subpara.",opus:"op.",subchapter:"subch.",addendum:"add.",amendment:"amend.",annotation:"annot.",appendix:"app.",article:"art.",bibliography:"bibliog.",book:"bk.",chapter:"ch.",clause:"cl.",column:"col.",comment:"cmt.",decision:"dec.",department:"dept.",example:"ex.",figure:"fig.",field:"fld.",folio:"fol.",note:"n.",hypothetical:"hypo.",illustration:"illus.",introduction:"intro.",line:"l.",issue:"no.",page:"p.",paragraph:"para.",part:"pt.",preamble:"pmbl.",principle:"princ.",publication:"pub.",rule:"r.",randnummer:"rn.",schedule:"sched.",section:"sec.","series,":"ser.",subdivision:"subdiv.",subsection:"subsec.",supplement:"supp.",table:"tbl.",title:"tit.",volume:"vol."},LOCATOR_LABELS_MAP:{vrs:"verse",sv:"sub-verbo",subpara:"subparagraph",op:"opus",subch:"subchapter",add:"addendum",amend:"amendment",annot:"annotation",app:"appendix",art:"article",bibliog:"bibliography",bk:"book",ch:"chapter",cl:"clause",col:"column",cmt:"comment",dec:"decision",dept:"department",ex:"example",fig:"figure",fld:"field",fol:"folio",n:"note",hypo:"hypothetical",illus:"illustration",intro:"introduction",l:"line",no:"issue",p:"page",pp:"page",para:"paragraph",pt:"part",pmbl:"preamble",princ:"principle",pub:"publication",r:"rule",rn:"randnummer",sched:"schedule",sec:"section",ser:"series,",subdiv:"subdivision",subsec:"subsection",supp:"supplement",tbl:"table",tit:"title",vol:"volume"},MODULE_MACROS:{"juris-pretitle":!0,"juris-title":!0,"juris-pretitle-short":!0,"juris-title-short":!0,"juris-main":!0,"juris-main-short":!0,"juris-tail":!0,"juris-tail-short":!0,"juris-locator":!0},MODULE_TYPES:{legal_case:!0,legislation:!0,bill:!0,hearing:!0,gazette:!0,report:!0,regulation:!0,standard:!0,patent:!0,locator:!0},checkNestedBrace:function(t){"note"===t.opt.xclass?(this.depth=0,this.update=function(t){for(var e=(t=t||"").split(/([\(\)])/),i=1,s=e.length;i<s;i+=2)"("===e[i]?(1==this.depth%2&&(e[i]="["),this.depth+=1):")"===e[i]&&(0==this.depth%2&&(e[i]="]"),this.depth-=1);return e.join("")}):this.update=function(t){return t}},MULTI_FIELDS:["event","publisher","publisher-place","event-place","title","container-title","collection-title","authority","genre","title-short","medium","country","jurisdiction","archive","archive-place"],LangPrefsMap:{title:"titles","title-short":"titles",event:"titles",genre:"titles",medium:"titles","container-title":"journals","collection-title":"titles",archive:"journals",publisher:"publishers",authority:"publishers","publisher-place":"places","event-place":"places","archive-place":"places",jurisdiction:"places",number:"places",edition:"places",issue:"places",volume:"places"},AbbreviationSegments:function(){this["container-title"]={},this["collection-title"]={},this["institution-entire"]={},this["institution-part"]={},this.nickname={},this.number={},this.title={},this.place={},this.hereinafter={},this.classic={},this["container-phrase"]={},this["title-phrase"]={}},getAbbrevsDomain:function(t,e,i){var s=null;if(t.opt.availableAbbrevDomains&&e&&"default"!==e){var r=t.locale[t.opt.lang].opts["jurisdiction-preference"],n=null;if(t.locale[i]&&(n=t.locale[i].opts["jurisdiction-preference"]),n)for(var a=n.length-1;a>-1;a--)if(t.opt.availableAbbrevDomains[e].indexOf(n[a])>-1){s=n[a];break}if(!s&&r)for(a=r.length-1;a>-1;a--)if(t.opt.availableAbbrevDomains[e].indexOf(r[a])>-1){s=r[a];break}}return s},FIELD_CATEGORY_REMAP:{title:"title","container-title":"container-title","collection-title":"collection-title",country:"place",number:"number",place:"place",archive:"container-title","title-short":"title",genre:"title",event:"title",medium:"title","archive-place":"place","publisher-place":"place","event-place":"place",jurisdiction:"place","language-name":"place","language-name-original":"place","call-number":"number","chapter-number":"number","collection-number":"number",edition:"number",page:"number",issue:"number",locator:"number","locator-extra":"number","number-of-pages":"number","number-of-volumes":"number",volume:"number","citation-number":"number",publisher:"institution-part"},parseLocator:function(t){if(this.opt.development_extensions.locator_date_and_revision&&t.locator){t.locator=""+t.locator;var e=t.locator.indexOf("|");if(e>-1){var i=t.locator;t.locator=i.slice(0,e);var s=(i=i.slice(e+1)).match(/^([0-9]{4}-[0-9]{2}-[0-9]{2}).*/);s&&(t["locator-date"]=this.fun.dateparser.parseDateToObject(s[1]),i=i.slice(s[1].length)),t["locator-extra"]=i.replace(/^\s+/,"").replace(/\s+$/,"")}}return t.locator&&(t.locator=(""+t.locator).replace(/\s+$/,"")),t},normalizeLocaleStr:function(t){if(t){var e=t.split("-");return e[0]=e[0].toLowerCase(),e[1]&&(e[1]=e[1].toUpperCase()),e.join("-")}},parseNoteFieldHacks:function(t,e,i){if("string"==typeof t.note){for(var s=[],r=t.note.split("\n"),n=0,a=r.length;n<a;n++){s=[];var o=(f=r[n]).match(c.NOTE_FIELDS_REGEXP);if(o){for(var l=f.split(c.NOTE_FIELDS_REGEXP),u=0,p=l.length-1;u<p;u++)s.push(l[u]),s.push(o[u]);s.push(l[l.length-1]);for(u=1,p=s.length;u<p&&(!s[u-1].trim()||!(n>0||u>1)||s[u-1].match(c.NOTE_FIELD_REGEXP));u+=2)s[u]="\n"+s[u].slice(2,-1).trim()+"\n";r[n]=s.join("")}}var h=0,m={};for(n=0,a=(r=r.join("\n").split("\n")).length;n<a;n++){var f,d=(f=r[n]).match(c.NOTE_FIELD_REGEXP);if(f.trim()){if(!d){if(0===n)continue;h=n;break}var g=d[1],b=d[2].replace(/^\s+/,"").replace(/\s+$/,"");if("type"===g)t.type=b,r[n]="";else if(c.DATE_VARIABLES.indexOf(g.replace(/^alt-/,""))>-1)t[g]&&!i||(t[g]=c.DateParser.parseDateToArray(b),(!e||e[g]&&this.isDateString(b))&&(r[n]=""));else if(!t[g]){if(c.NAME_VARIABLES.indexOf(g.replace(/^alt-/,""))>-1){m[g]||(m[g]=[]);var _=b.split(/\s*\|\|\s*/);if(1===_.length)m[g].push({literal:_[0]});else if(2===_.length){var v={family:_[0],given:_[1]};c.parseParticles(v),m[g].push(v)}}else t[g]=b;e&&!e[g]||(r[n]="")}}}for(var g in m)t[g]=m[g];if(e){r[h].trim()&&(r[h]="\n"+r[h]);for(n=h-1;n>-1;n--)r[n].trim()||(r=r.slice(0,n).concat(r.slice(n+1)))}t.note=r.join("\n").trim()}},checkPrefixSpaceAppend:function(t,e){e||(e="");var i="",s=e.replace(/<[^>]+>/g,"").replace(/["'\u201d\u2019\u00bb\u202f\u00a0 ]+$/g,""),r=s.slice(-1);return(s.match(c.ENDSWITH_ROMANESQUE_REGEXP)||c.TERMINAL_PUNCTUATION.slice(0,-1).indexOf(r)>-1||r.match(/[\)\],0-9]/))&&(i=" "),e=(e+i).replace(/\s+/g," ")},checkIgnorePredecessor:function(t,e){var i=e.replace(/<[^>]+>/g,"").replace(/["'\u201d\u2019\u00bb\u202f\u00a0 ]+$/g,"").slice(-1);return c.TERMINAL_PUNCTUATION.slice(0,-1).indexOf(i)>-1&&e.trim().indexOf(" ")>-1&&(t.tmp.term_predecessor=!1,!0)},checkSuffixSpacePrepend:function(t,e){return e?((e.match(c.STARTSWITH_ROMANESQUE_REGEXP)||["[","("].indexOf(e.slice(0,1))>-1)&&(e=" "+e),e):""},GENDERS:["masculine","feminine"],ERROR_NO_RENDERED_FORM:1,PREVIEW:"Just for laughs.",ASSUME_ALL_ITEMS_REGISTERED:2,START:0,END:1,SINGLETON:2,SEEN:6,SUCCESSOR:3,SUCCESSOR_OF_SUCCESSOR:4,SUPPRESS:5,SINGULAR:0,PLURAL:1,LITERAL:!0,BEFORE:1,AFTER:2,DESCENDING:1,ASCENDING:2,PRIMARY:1,SECONDARY:2,POSITION_FIRST:0,POSITION_SUBSEQUENT:1,POSITION_IBID:2,POSITION_IBID_WITH_LOCATOR:3,POSITION_CONTAINER_SUBSEQUENT:4,POSITION_MAP:{0:0,4:1,1:2,2:3,3:4},POSITION_TEST_VARS:["position","first-reference-note-number","near-note"],AREAS:["citation","citation_sort","bibliography","bibliography_sort","intext"],CITE_FIELDS:["first-reference-note-number","first-container-reference-note-number","locator","locator-extra"],SWAPPING_PUNCTUATION:[".","!","?",":",","],TERMINAL_PUNCTUATION:[":",".",";","!","?"," "],NONE:0,NUMERIC:1,POSITION:2,TRIGRAPH:3,DATE_PARTS:["year","month","day"],DATE_PARTS_ALL:["year","month","day","season"],DATE_PARTS_INTERNAL:["year","month","day","year_end","month_end","day_end"],NAME_PARTS:["non-dropping-particle","family","given","dropping-particle","suffix","literal"],DISAMBIGUATE_OPTIONS:["disambiguate-add-names","disambiguate-add-givenname","disambiguate-add-year-suffix"],GIVENNAME_DISAMBIGUATION_RULES:["all-names","all-names-with-initials","primary-name","primary-name-with-initials","by-cite"],NAME_ATTRIBUTES:["and","delimiter-precedes-last","delimiter-precedes-et-al","initialize-with","initialize","name-as-sort-order","sort-separator","et-al-min","et-al-use-first","et-al-subsequent-min","et-al-subsequent-use-first","form","prefix","suffix","delimiter"],LOOSE:0,STRICT:1,TOLERANT:2,PREFIX_PUNCTUATION:/[.;:]\s*$/,SUFFIX_PUNCTUATION:/^\s*[.;:,\(\)]/,NUMBER_REGEXP:/(?:^\d+|\d+$)/,NAME_INITIAL_REGEXP:/^([A-Z\u0e01-\u0e5b\u00c0-\u017f\u0400-\u042f\u0590-\u05d4\u05d6-\u05ff\u0600-\u06ff\u0370\u0372\u0376\u0386\u0388-\u03ab\u03e2\u03e4\u03e6\u03e8\u03ea\u03ec\u03ee\u03f4\u03f7\u03fd-\u03ff])([a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0400-\u052f\u0600-\u06ff\u0370-\u03ff\u1f00-\u1fff]*|)(\.)*/,ROMANESQUE_REGEXP:/[-0-9a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]/,ROMANESQUE_NOT_REGEXP:/[^a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]/g,STARTSWITH_ROMANESQUE_REGEXP:/^[&a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]/,ENDSWITH_ROMANESQUE_REGEXP:/[.;:&a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]$/,ALL_ROMANESQUE_REGEXP:/^[a-zA-Z\u0e01-\u0e5b\u00c0-\u017f\u0370-\u03ff\u0400-\u052f\u0590-\u05d4\u05d6-\u05ff\u1f00-\u1fff\u0600-\u06ff\u200c\u200d\u200e\u0218\u0219\u021a\u021b\u202a-\u202e]+$/,VIETNAMESE_SPECIALS:/[\u00c0-\u00c3\u00c8-\u00ca\u00cc\u00cd\u00d2-\u00d5\u00d9\u00da\u00dd\u00e0-\u00e3\u00e8-\u00ea\u00ec\u00ed\u00f2-\u00f5\u00f9\u00fa\u00fd\u0101\u0103\u0110\u0111\u0128\u0129\u0168\u0169\u01a0\u01a1\u01af\u01b0\u1ea0-\u1ef9]/,VIETNAMESE_NAMES:/^(?:(?:[.AaBbCcDdEeGgHhIiKkLlMmNnOoPpQqRrSsTtUuVvXxYy \u00c0-\u00c3\u00c8-\u00ca\u00cc\u00cd\u00d2-\u00d5\u00d9\u00da\u00dd\u00e0-\u00e3\u00e8-\u00ea\u00ec\u00ed\u00f2-\u00f5\u00f9\u00fa\u00fd\u0101\u0103\u0110\u0111\u0128\u0129\u0168\u0169\u01a0\u01a1\u01af\u01b0\u1ea0-\u1ef9]{2,6})(\s+|$))+$/,NOTE_FIELDS_REGEXP:/\{:(?:[\-_a-z]+|[A-Z]+):[^\}]+\}/g,NOTE_FIELD_REGEXP:/^([\-_a-z]+|[A-Z]+):\s*([^\}]+)$/,PARTICLE_GIVEN_REGEXP:/^([^ ]+(?:\u02bb |\u2019 | |\' ) *)(.+)$/,PARTICLE_FAMILY_REGEXP:/^([^ ]+(?:\-|\u02bb|\u2019| |\') *)(.+)$/,DISPLAY_CLASSES:["block","left-margin","right-inline","indent"],NAME_VARIABLES:["author","chair","collection-editor","compiler","composer","container-author","contributor","curator","director","editor","editor-translator","editorial-director","executive-producer","guest","host","illustrator","interviewer","narrator","organizer","original-author","performer","producer","recipient","reviewed-author","script-writer","series-creator","translator","commenter"],CREATORS:["author","chair","collection-editor","compiler","composer","container-author","contributor","curator","director","editor","editor-translator","editorial-director","executive-producer","guest","host","illustrator","interviewer","narrator","organizer","original-author","performer","producer","recipient","reviewed-author","script-writer","series-creator","translator","commenter"],NUMERIC_VARIABLES:["call-number","chapter-number","collection-number","division","edition","page","issue","locator","locator-extra","number","number-of-pages","number-of-volumes","part-number","printing-number","section","supplement-number","version","volume","supplement","citation-number"],DATE_VARIABLES:["locator-date","issued","event-date","accessed","original-date","publication-date","available-date","submitted","alt-issued","alt-event"],VARIABLES_WITH_SHORT_FORM:["title","container-title"],TITLE_FIELD_SPLITS:function(t){for(var e=["title","short","main","sub","subjoin"],i={},s=0,r=e.length;s<r;s++)i[e[s]]=t+"title"+("title"===e[s]?"":"-"+e[s]);return i},demoteNoiseWords:function(t,e,i){var s=t.locale[t.opt.lang].opts["leading-noise-words"];if(e&&i){(e=e.split(/\s+/)).reverse();for(var r=[],n=e.length-1;n>-1&&s.indexOf(e[n].toLowerCase())>-1;n+=-1)r.push(e.pop());e.reverse();var a=e.join(" "),o=r.join(" ");"drop"!==i&&o?"demote"===i&&(e=[a,o].join(", ")):e=a}return e},extractTitleAndSubtitle:function(t,e){var i=e?" ":"",s=[""];this.opt.development_extensions.split_container_title&&s.push("container-");for(var r=0,n=s.length;r<n;r++){var a=s[r],o=c.TITLE_FIELD_SPLITS(a),l=[!1];if(t.multi)for(var u in t.multi._keys[o.short])l.push(u);for(var p=0,h=l.length;p<h;p++){var m={};(u=l[p])?(t.multi._keys[o.title]&&(m[o.title]=t.multi._keys[o.title][u]),t.multi._keys[o.short]&&(m[o.short]=t.multi._keys[o.short][u])):(m[o.title]=t[o.title],m[o.short]=t[o.short]),m[o.main]=m[o.title],m[o.sub]=!1;var f=m[o.short];if(m[o.title]){if(f&&f.toLowerCase()===m[o.title].toLowerCase())m[o.main]=m[o.title],m[o.subjoin]="",m[o.sub]="";else if(f){var d=m[o.title].slice(f.replace(/[\?\!]+$/,"").length),g=m[o.title].replace(d.replace(/^[\?\!]+/,""),"").trim();if((v=c.TITLE_SPLIT_REGEXP.matchfirst.exec(d))&&g.toLowerCase()===f.toLowerCase())m[o.main]=g,m[o.subjoin]=v[1].replace(/[\?\!]+(\s*)$/,"$1"),m[o.sub]=d.replace(c.TITLE_SPLIT_REGEXP.matchfirst,""),this.opt.development_extensions.force_short_title_casing_alignment&&(m[o.short]=m[o.main]);else 3==(b=c.TITLE_SPLIT(m[o.title])).length?(m[o.main]=b[0],m[o.subjoin]=b[1],m[o.sub]=b[2]):(m[o.main]=m[o.title],m[o.subjoin]="",m[o.sub]="")}else{var b;if(3==(b=c.TITLE_SPLIT(m[o.title])).length){if(m[o.main]=b[0],m[o.subjoin]=b[1],m[o.sub]=b[2],this.opt.development_extensions.implicit_short_title&&"legal_case"!==t.type&&!t[o.short]&&!m[o.main].match(/^[\-\.[0-9]+$/)){var _=m[o.subjoin].trim();-1===["?","!"].indexOf(_)&&(_=""),m[o.short]=m[o.main]+_}}else m[o.main]=m[o.title],m[o.subjoin]="",m[o.sub]=""}if(m[o.subjoin]&&m[o.subjoin].match(/([\?\!])/)){var v=m[o.subjoin].match(/(\s*)$/);m[o.main]=m[o.main]+i+m[o.subjoin].trim(),m[o.subjoin]=v[1]}}if(m[o.subjoin]&&(m[o.subjoin].indexOf(":")>-1&&(m[o.subjoin]=i+": "),(m[o.subjoin].indexOf("-")>-1||m[o.subjoin].indexOf("—")>-1)&&(m[o.subjoin]="—")),u)for(var y in m)t.multi._keys[y]||(t.multi._keys[y]={}),t.multi._keys[y][u]=m[y];else for(var y in m)t[y]=m[y]}}},titlecaseSentenceOrNormal:function(t,e,i,s,r){var n=c.TITLE_FIELD_SPLITS(i),a={};if(s&&e.multi?(e.multi._keys[n.title]&&(a[n.title]=e.multi._keys[n.title][s]),e.multi._keys[n.main]&&(a[n.main]=e.multi._keys[n.main][s]),e.multi._keys[n.sub]&&(a[n.sub]=e.multi._keys[n.sub][s]),e.multi._keys[n.subjoin]&&(a[n.subjoin]=e.multi._keys[n.subjoin][s])):(a[n.title]=e[n.title],a[n.main]=e[n.main],a[n.sub]=e[n.sub],a[n.subjoin]=e[n.subjoin]),a[n.main]&&a[n.sub]){var o=a[n.main],l=a[n.subjoin],u=a[n.sub];return r?(o=c.Output.Formatters.sentence(t,o),u=c.Output.Formatters.sentence(t,u)):t.opt.development_extensions.uppercase_subtitles&&(u=c.Output.Formatters["capitalize-first"](t,u)),[o,l,u].join("")}if(a[n.title]){if(r)return c.Output.Formatters.sentence(t,a[n.title]);if(t.opt.development_extensions.uppercase_subtitles){for(var p=c.TITLE_SPLIT(a[n.title]),h=0,m=p.length;h<m;h+=2)p[h]=c.Output.Formatters["capitalize-first"](t,p[h]);for(h=1,m=p.length-1;h<m;h+=2){var f=p[h].match(/([:\?\!] )/);if(f){var d="fr"===t.opt["default-locale"][0].slice(0,2).toLowerCase()?" ":"";p[h]=d+f[1]}(p[h].indexOf("-")>-1||p[h].indexOf("—")>-1)&&(p[h]="—")}return a[n.title]=p.join(""),a[n.title]}return a[n.title]}return""},getSafeEscape:function(t){if(["bibliography","citation"].indexOf(t.tmp.area)>-1){var e=[];return t.opt.development_extensions.thin_non_breaking_space_html_hack&&"html"===t.opt.mode&&e.push((function(t){return t.replace(/\u202f/g,'<span style="white-space:nowrap"> </span>')})),e.length?function(i){for(var s=0,r=e.length;s<r;s+=1)i=e[s](i);return c.Output.Formats[t.opt.mode].text_escape(i)}:c.Output.Formats[t.opt.mode].text_escape}return function(t){return t}},SKIP_WORDS:["about","above","across","afore","after","against","al","along","alongside","amid","amidst","among","amongst","anenst","apropos","apud","around","as","aside","astride","at","athwart","atop","barring","before","behind","below","beneath","beside","besides","between","beyond","but","by","circa","despite","down","during","et","except","for","forenenst","from","given","in","inside","into","lest","like","modulo","near","next","notwithstanding","of","off","on","onto","out","over","per","plus","pro","qua","sans","since","than","through"," thru","throughout","thruout","till","to","toward","towards","under","underneath","until","unto","up","upon","versus","vs.","v.","vs","v","via","vis-à-vis","with","within","without","according to","ahead of","apart from","as for","as of","as per","as regards","aside from","back to","because of","close to","due to","except for","far from","inside of","instead of","near to","next to","on to","out from","out of","outside of","prior to","pursuant to","rather than","regardless of","such as","that of","up to","where as","or","yet","so","for","and","nor","a","an","the","de","d'","von","van","c","ca"],FORMAT_KEY_SEQUENCE:["@strip-periods","@font-style","@font-variant","@font-weight","@text-decoration","@vertical-align","@quotes"],INSTITUTION_KEYS:["font-style","font-variant","font-weight","text-decoration","text-case"],SUFFIX_CHARS:"a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z",ROMAN_NUMERALS:[["","i","ii","iii","iv","v","vi","vii","viii","ix"],["","x","xx","xxx","xl","l","lx","lxx","lxxx","xc"],["","c","cc","ccc","cd","d","dc","dcc","dccc","cm"],["","m","mm","mmm","mmmm","mmmmm"]],LANGS:{"af-ZA":"Afrikaans",ar:"Arabic","bg-BG":"Bulgarian","ca-AD":"Catalan","cs-CZ":"Czech","da-DK":"Danish","de-AT":"Austrian","de-CH":"German (CH)","de-DE":"German (DE)","el-GR":"Greek","en-GB":"English (GB)","en-US":"English (US)","es-ES":"Spanish","et-EE":"Estonian",eu:"European","fa-IR":"Persian","fi-FI":"Finnish","fr-CA":"French (CA)","fr-FR":"French (FR)","he-IL":"Hebrew","hr-HR":"Croatian","hu-HU":"Hungarian","is-IS":"Icelandic","it-IT":"Italian","ja-JP":"Japanese","km-KH":"Khmer","ko-KR":"Korean","lt-LT":"Lithuanian","lv-LV":"Latvian","mn-MN":"Mongolian","nb-NO":"Norwegian (Bokmål)","nl-NL":"Dutch","nn-NO":"Norwegian (Nynorsk)","pl-PL":"Polish","pt-BR":"Portuguese (BR)","pt-PT":"Portuguese (PT)","ro-RO":"Romanian","ru-RU":"Russian","sk-SK":"Slovak","sl-SI":"Slovenian","sr-RS":"Serbian","sv-SE":"Swedish","th-TH":"Thai","tr-TR":"Turkish","uk-UA":"Ukrainian","vi-VN":"Vietnamese","zh-CN":"Chinese (CN)","zh-TW":"Chinese (TW)"},LANG_BASES:{af:"af_ZA",ar:"ar",bg:"bg_BG",ca:"ca_AD",cs:"cs_CZ",da:"da_DK",de:"de_DE",el:"el_GR",en:"en_US",es:"es_ES",et:"et_EE",eu:"eu",fa:"fa_IR",fi:"fi_FI",fr:"fr_FR",he:"he_IL",hr:"hr-HR",hu:"hu_HU",is:"is_IS",it:"it_IT",ja:"ja_JP",km:"km_KH",ko:"ko_KR",lt:"lt_LT",lv:"lv-LV",mn:"mn_MN",nb:"nb_NO",nl:"nl_NL",nn:"nn-NO",pl:"pl_PL",pt:"pt_PT",ro:"ro_RO",ru:"ru_RU",sk:"sk_SK",sl:"sl_SI",sr:"sr_RS",sv:"sv_SE",th:"th_TH",tr:"tr_TR",uk:"uk_UA",vi:"vi_VN",zh:"zh_CN"},SUPERSCRIPTS:{"ª":"a","²":"2","³":"3","¹":"1","º":"o","ʰ":"h","ʱ":"ɦ","ʲ":"j","ʳ":"r","ʴ":"ɹ","ʵ":"ɻ","ʶ":"ʁ","ʷ":"w","ʸ":"y","ˠ":"ɣ","ˡ":"l","ˢ":"s","ˣ":"x","ˤ":"ʕ","ᴬ":"A","ᴭ":"Æ","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴲ":"Ǝ","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴽ":"Ȣ","ᴾ":"P","ᴿ":"R","ᵀ":"T","ᵁ":"U","ᵂ":"W","ᵃ":"a","ᵄ":"ɐ","ᵅ":"ɑ","ᵆ":"ᴂ","ᵇ":"b","ᵈ":"d","ᵉ":"e","ᵊ":"ə","ᵋ":"ɛ","ᵌ":"ɜ","ᵍ":"g","ᵏ":"k","ᵐ":"m","ᵑ":"ŋ","ᵒ":"o","ᵓ":"ɔ","ᵔ":"ᴖ","ᵕ":"ᴗ","ᵖ":"p","ᵗ":"t","ᵘ":"u","ᵙ":"ᴝ","ᵚ":"ɯ","ᵛ":"v","ᵜ":"ᴥ","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"φ","ᵡ":"χ","⁰":"0","ⁱ":"i","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","⁺":"+","⁻":"−","⁼":"=","⁽":"(","⁾":")","ⁿ":"n","℠":"SM","™":"TM","㆒":"一","㆓":"二","㆔":"三","㆕":"四","㆖":"上","㆗":"中","㆘":"下","㆙":"甲","㆚":"乙","㆛":"丙","㆜":"丁","㆝":"天","㆞":"地","㆟":"人","ˀ":"ʔ","ˁ":"ʕ","ۥ":"و","ۦ":"ي"},SUPERSCRIPTS_REGEXP:new RegExp("[ª²³¹ºʰʱʲʳʴʵʶʷʸˠˡˢˣˤᴬᴭᴮᴰᴱᴲᴳᴴᴵᴶᴷᴸᴹᴺᴼᴽᴾᴿᵀᵁᵂᵃᵄᵅᵆᵇᵈᵉᵊᵋᵌᵍᵏᵐᵑᵒᵓᵔᵕᵖᵗᵘᵙᵚᵛᵜᵝᵞᵟᵠᵡ⁰ⁱ⁴⁵⁶⁷⁸⁹⁺⁻⁼⁽⁾ⁿ℠™㆒㆓㆔㆕㆖㆗㆘㆙㆚㆛㆜㆝㆞㆟ˀˁۥۦ]","g"),UPDATE_GROUP_CONTEXT_CONDITION:function(t,e,i,s,r){if(t.opt.use_context_condition){var n=t.tmp.group_context.tip;n.condition?(n.condition.termtxt||(n.condition.termtxt=e,n.condition.valueTerm=i),n.value_seen||"comma-safe-numbers-only"!==n.condition.test||r&&(n.value_seen=!0,r.match(/^[0-9]/)||(t.tmp.just_did_number=!1))):s&&s.decorations.filter((t=>"@vertical-align"===t[0])).length>0||s&&s.strings.suffix?t.tmp.just_did_number=!1:e&&(e.match(/[0-9]$/)?t.tmp.just_did_number=!0:t.tmp.just_did_number=!1)}},EVALUATE_GROUP_CONDITION:function(t,e){if(t.opt.use_context_condition){var i,s="comma-safe-numbers-only"===e.condition.test;if("empty-label"===e.condition.test)i=!e.condition.termtxt;else if("empty-label-no-decor"===e.condition.test)i=!e.condition.termtxt||e.condition.termtxt.indexOf("%s")>-1;else if(["comma-safe","comma-safe-numbers-only"].indexOf(e.condition.test)>-1){var r=e.condition.termtxt,n=!1;e.condition.termtxt&&(n=e.condition.termtxt.slice(0,1).match(c.ALL_ROMANESQUE_REGEXP)),i=t.tmp.just_did_number?e.condition.valueTerm?!s:!r||(n?!s:["always","after-number"].indexOf(t.opt.require_comma_on_symbol)>-1):!e.condition.valueTerm&&(!!r&&(n?!s:"always"===t.opt.require_comma_on_symbol))}if(i)var a=!1;else a=!0;return e.condition.not&&(a=!a),a}},SYS_OPTIONS:["prioritize_disambiguate_condition","csl_reverse_lookup_support","main_title_from_short_title","uppercase_subtitles","force_short_title_casing_alignment","implicit_short_title","split_container_title"],TITLE_SPLIT_REGEXP:(i=["\\.\\s+","\\!\\s+","\\?\\s+","\\s*::*\\s+","\\s*—\\s*","\\s+\\-\\s+","\\s*\\-\\-\\-*\\s*"],{match:new RegExp("("+i.join("|")+")","g"),matchfirst:new RegExp("^("+i.join("|")+")"),split:new RegExp("(?:"+i.join("|")+")")}),TITLE_SPLIT:function(t){if(!t)return t;for(var e=t.match(c.TITLE_SPLIT_REGEXP.match),i=t.split(c.TITLE_SPLIT_REGEXP.split),s=i.length-2;s>-1;s--)i[s]=i[s].trim(),i[s]&&i[s].slice(-1).toLowerCase()!==i[s].slice(-1)?(i[s]=i[s]+e[s]+i[s+1],i=i.slice(0,s+1).concat(i.slice(s+2))):i=i.slice(0,s+1).concat([e[s]]).concat(i.slice(s+1));return i},GET_COURT_CLASS:function(t,e,i){var s="",r=null,n=e.jurisdiction?e.jurisdiction.split(":")[0]:null,a="court_condition_classes";return i&&(a="court_key_classes"),n&&e.authority&&("string"==typeof e.authority?r=e.authority:e.authority[0]&&e.authority[0].literal&&(r=e.authority[0].literal)),r&&(this.lang&&t.locale[this.lang].opts[a]&&t.locale[this.lang].opts[a][n]&&t.locale[this.lang].opts[a][n][r]?s=t.locale[this.lang].opts[a][n][r]:t.locale[t.opt["default-locale"][0]].opts[a]&&t.locale[t.opt["default-locale"][0]].opts[a][n]&&t.locale[t.opt["default-locale"][0]].opts[a][n][r]&&(s=t.locale[t.opt["default-locale"][0]].opts[a][n][r])),s},SET_COURT_CLASSES:function(t,e,i,s){for(var r=i.getNodesByName(s,"court-class"),n=0,a=i.numberofnodes(r);n<a;n+=1){var o=r[n],l=i.attributes(o),u=l["@name"],p=l["@country"],h=l["@courts"],c="court_key_classes";if(t.registry&&(c="court_condition_classes"),u&&p&&h){h=h.trim().split(/\s+/),t.locale[e].opts[c]||(t.locale[e].opts[c]={}),t.locale[e].opts[c][p]||(t.locale[e].opts[c][p]={});for(var m=0,f=h.length;m<f;m++)t.locale[e].opts[c][p][h[m]]=u}}},INIT_JURISDICTION_MACROS:function(t,e,i,s){if(e["best-jurisdiction"])return!0;if(!t.sys.retrieveStyleModule||!c.MODULE_MACROS[s]||!e.jurisdiction)return!1;var r=t.getJurisdictionList(e.jurisdiction);if(!t.opt.jurisdictions_seen[r[0]]){var n=t.retrieveAllStyleModules(r);for(var a in n){var o=t.loadStyleModule(a,n[a]);o&&(n[o]||(Object.assign(n,t.retrieveAllStyleModules([o])),t.loadStyleModule(o,n[o],!0)))}}r=t.getJurisdictionList(e.jurisdiction);t.opt.parallel.enable&&(t.parallel||(t.parallel=new c.Parallel(t)));for(var l=0,u=r.length;l<u;l++){a=r[l];if(i&&t.juris[a]&&!i["best-jurisdiction"]&&t.juris[a].types.locator&&(e["best-jurisdiction"]=a),t.juris[a]&&t.juris[a].types[e.type])return e["best-jurisdiction"]=a,!0}return!1}};c.XmlJSON=function(t){this.dataObj=t,this.institution={name:"institution",attrs:{"institution-parts":"long",delimiter:", "},children:[{name:"institution-part",attrs:{name:"long"},children:[]}]}},c.XmlJSON.prototype.clean=function(t){return t},c.XmlJSON.prototype.getStyleId=function(t,e){var i="id";e&&(i="title");for(var s="",r=t.children,n=0,a=r.length;n<a;n++)if("info"===r[n].name)for(var o=r[n].children,l=0,u=o.length;l<u;l++)o[l].name===i&&(s=o[l].children[0]);return s},c.XmlJSON.prototype.children=function(t){return!(!t||!t.children.length)&&t.children.slice()},c.XmlJSON.prototype.nodename=function(t){return t?t.name:null},c.XmlJSON.prototype.attributes=function(t){var e={};for(var i in t.attrs)e["@"+i]=t.attrs[i];return e},c.XmlJSON.prototype.content=function(t){var e="";if(!t||!t.children)return e;for(var i=0,s=t.children.length;i<s;i+=1)"string"==typeof t.children[i]&&(e+=t.children[i]);return e},c.XmlJSON.prototype.namespace={},c.XmlJSON.prototype.numberofnodes=function(t){return t&&"number"==typeof t.length?t.length:0},c.XmlJSON.prototype.getAttributeValue=function(t,e,i){var s="";return i&&(e=i+":"+e),t&&t.attrs&&(s=t.attrs[e]?t.attrs[e]:""),s},c.XmlJSON.prototype.getNodeValue=function(t,e){var i="";if(e)for(var s=0,r=t.children.length;s<r;s+=1)t.children[s].name===e&&(i=t.children[s].children.length?t.children[s]:"");else t&&(i=t);return i&&i.children&&1==i.children.length&&"string"==typeof i.children[0]&&(i=i.children[0]),i},c.XmlJSON.prototype.setAttributeOnNodeIdentifiedByNameAttribute=function(t,e,i,s,r){"@"===s.slice(0,1)&&(s=s.slice(1));for(var n=0,a=t.children.length;n<a;n+=1)t.children[n].name===e&&t.children[n].attrs.name===i&&(t.children[n].attrs[s]=r)},c.XmlJSON.prototype.deleteNodeByNameAttribute=function(t,e){var i,s;for(i=0,s=t.children.length;i<s;i+=1)t.children[i]&&"string"!=typeof t.children[i]&&t.children[i].attrs.name==e&&(t.children=t.children.slice(0,i).concat(t.children.slice(i+1)))},c.XmlJSON.prototype.deleteAttribute=function(t,e){void 0!==t.attrs[e]&&t.attrs.pop(e)},c.XmlJSON.prototype.setAttribute=function(t,e,i){return t.attrs[e]=i,!1},c.XmlJSON.prototype.nodeCopy=function(t,e){if(!e)e={};if("object"==typeof e&&void 0===e.length)for(var i in t)"string"==typeof t[i]?e[i]=t[i]:"object"==typeof t[i]&&(void 0===t[i].length?e[i]=this.nodeCopy(t[i],{}):e[i]=this.nodeCopy(t[i],[]));else for(var s=0,r=t.length;s<r;s+=1)"string"==typeof t[s]?e[s]=t[s]:e[s]=this.nodeCopy(t[s],{});return e},c.XmlJSON.prototype.getNodesByName=function(t,e,i,s){if(!s)s=[];if(!t||!t.children)return s;e===t.name&&(i?i===t.attrs.name&&s.push(t):s.push(t));for(var r=0,n=t.children.length;r<n;r+=1)"object"==typeof t.children[r]&&this.getNodesByName(t.children[r],e,i,s);return s},c.XmlJSON.prototype.nodeNameIs=function(t,e){return void 0!==t&&e==t.name},c.XmlJSON.prototype.makeXml=function(t){return"string"==typeof t&&(t="<"===t.slice(0,1)?this.jsonStringWalker.walkToObject(t):JSON.parse(t)),t},c.XmlJSON.prototype.insertChildNodeAfter=function(t,e,i,s){for(var r=0,n=t.children.length;r<n;r+=1)if(e===t.children[r]){t.children=t.children.slice(0,r).concat([s]).concat(t.children.slice(r+1));break}return t},c.XmlJSON.prototype.insertPublisherAndPlace=function(t){if("group"===t.name){for(var e=!0,i=["publisher","publisher-place"],s=0,r=t.children.length;s<r;s+=1){var n=i.indexOf(t.children[s].attrs.variable);if(!("text"===t.children[s].name&&n>-1)||t.children[s].attrs.prefix||t.children[s].attrs.suffix){e=!1;break}i=i.slice(0,n).concat(i.slice(n+1))}e&&!i.length&&(t.attrs["has-publisher-and-publisher-place"]=!0)}for(s=0,r=t.children.length;s<r;s+=1)"object"==typeof t.children[s]&&this.insertPublisherAndPlace(t.children[s])},c.XmlJSON.prototype.isChildOfSubstitute=function(t){if(t.length>0){var e=t.slice();return"substitute"===e.pop()||this.isChildOfSubstitute(e)}return!1},c.XmlJSON.prototype.addMissingNameNodes=function(t,e){if(e||(e=[]),"names"===t.name&&!this.isChildOfSubstitute(e)){for(var i=!0,s=0,r=t.children.length;s<r;s++)if("name"===t.children[s].name){i=!1;break}i&&(t.children=[{name:"name",attrs:{},children:[]}].concat(t.children))}e.push(t.name);for(s=0,r=t.children.length;s<r;s+=1)"object"==typeof t.children[s]&&this.addMissingNameNodes(t.children[s],e);e.pop()},c.XmlJSON.prototype.addInstitutionNodes=function(t){if("names"===t.name){for(var e={},i=-1,s=0,r=t.children.length;s<r;s+=1){if("name"==t.children[s].name){for(var n in t.children[s].attrs)e[n]=t.children[s].attrs[n];e.delimiter=t.children[s].attrs.delimiter,e.and=t.children[s].attrs.and,i=s;for(var a=0,o=t.children[s].children.length;a<o;a+=1)if("family"===t.children[s].children[a].attrs.name)for(var n in t.children[s].children[a].attrs)e[n]=t.children[s].children[a].attrs[n]}if("institution"==t.children[s].name){i=-1;break}}if(i>-1){var l=this.nodeCopy(this.institution);for(s=0,r=c.INSTITUTION_KEYS.length;s<r;s+=1){var u=c.INSTITUTION_KEYS[s];void 0!==e[u]&&(l.children[0].attrs[u]=e[u]),e.delimiter&&(l.attrs.delimiter=e.delimiter),e.and&&(l.attrs.and=e.and)}t.children=t.children.slice(0,i+1).concat([l]).concat(t.children.slice(i+1))}}for(s=0,r=t.children.length;s<r;s+=1)"string"!=typeof t.children[s]&&this.addInstitutionNodes(t.children[s])},c.XmlJSON.prototype.flagDateMacros=function(t){for(var e=0,i=t.children.length;e<i;e+=1)"macro"===t.children[e].name&&this.inspectDateMacros(t.children[e])&&(t.children[e].attrs["macro-has-date"]="true")},c.XmlJSON.prototype.inspectDateMacros=function(t){if(!t||!t.children)return!1;if("date"===t.name)return!0;for(var e=0,i=t.children.length;e<i;e+=1)if(this.inspectDateMacros(t.children[e]))return!0;return!1},c.stripXmlProcessingInstruction=function(t){return t?t=(t=(t=(t=t.replace(/^<\?[^?]+\?>/,"")).replace(/<!--[^>]+-->/g,"")).replace(/^\s+/g,"")).replace(/\s+$/g,""):t},c.getSortCompare=function(t){if(c.stringCompare)return c.stringCompare;var e,i=this,s={sensitivity:"base",ignorePunctuation:!0,numeric:!0};t||(t="en-US");var r=function(t){return t.replace(/^[\[\]\'\"]*/g,"")},n=!!(e=function(e,r){return c.toLocaleLowerCase.call(i,e).localeCompare(c.toLocaleLowerCase.call(i,r),t,s)})("[x","x")&&function(t,i){return e(r(t),r(i))};return function(t,i){return n?n(t,i):e(t,i)}},c.ambigConfigDiff=function(t,e){var i,s,r,n;if(t.names.length!==e.names.length)return 1;for(i=0,s=t.names.length;i<s;i+=1){if(t.names[i]!==e.names[i])return 1;for(r=0,n=t.givens[i];r<n;r+=1)if(t.givens[i][r]!==e.givens[i][r])return 1}return t.disambiguate!=e.disambiguate||t.year_suffix!==e.year_suffix?1:0},c.cloneAmbigConfig=function(t,e){var i,s,r,n,a,o={names:[],givens:[],year_suffix:!1,disambiguate:!1};for(i=0,s=t.names.length;i<s;i+=1)a=t.names[i],o.names[i]=a;for(i=0,s=t.givens.length;i<s;i+=1){for(a=[],r=0,n=t.givens[i].length;r<n;r+=1)a.push(t.givens[i][r]);o.givens.push(a)}return e?(o.year_suffix=e.year_suffix,o.disambiguate=e.disambiguate):(o.year_suffix=t.year_suffix,o.disambiguate=t.disambiguate),o},c.getAmbigConfig=function(){var t;return(t=this.tmp.disambig_request)||(t=this.tmp.disambig_settings),c.cloneAmbigConfig(t)},c.getMaxVals=function(){return this.tmp.names_max.mystack.slice()},c.getMinVal=function(){return this.tmp["et-al-min"]},c.tokenExec=function(t,e,i){var s,r;s=t.next,r=!1;t.test&&(s=function(e){return e?(this.tmp.jump.replace("succeed"),t.succeed):(this.tmp.jump.replace("fail"),t.fail)}.call(this,t.test(e,i)));for(var n=0,a=t.execs.length;n<a;n++)(r=t.execs[n].call(t,this,e,i))&&(s=r);return s},c.expandMacro=function(t,e){var i,s,r;i=t.postponed_macro;var n=t.strings.sort_direction;t=new c.Token("group",c.START);var a=!1,o=!1;(s=this.cslXml.getNodesByName(this.cslXml.dataObj,"macro",i)).length&&(o=this.cslXml.getAttributeValue(s[0],"cslid"),a=this.cslXml.getAttributeValue(s[0],"macro-has-date")),a&&(i=i+"@"+this.build.current_default_locale,p=function(t){t.tmp.extension&&(t.tmp["doing-macro-with-date"]=!0)},t.execs.push(p)),this.build.macro_stack.indexOf(i)>-1?c.error('CSL processor error: call to macro "'+i+'" would cause an infinite loop'):this.build.macro_stack.push(i),t.cslid=o,c.MODULE_MACROS[i]&&(t.juris=i,this.opt.update_mode=c.POSITION),c.Node.group.build.call(t,this,e,!0),this.cslXml.getNodeValue(s)||c.error('CSL style error: undefined macro "'+i+'"');var l,u=c.getMacroTarget.call(this,i);if(u&&(c.buildMacro.call(this,u,s),c.configureMacro.call(this,u)),!this.build.extension){var p=(l=i,function(t,e,i){for(var s=0;s<t.macros[l].length;)s=c.tokenExec.call(t,t.macros[l][s],e,i)}),h=new c.Token("text",c.SINGLETON);h.execs.push(p),e.push(h)}(r=new c.Token("group",c.END)).strings.sort_direction=n,a&&(p=function(t){t.tmp.extension&&(t.tmp["doing-macro-with-date"]=!1)},r.execs.push(p)),t.juris&&(r.juris=i),c.Node.group.build.call(r,this,e,!0),this.build.macro_stack.pop()},c.getMacroTarget=function(t){var e=!1;return this.build.extension?e=this[this.build.root+this.build.extension].tokens:this.macros[t]||(e=[],this.macros[t]=e),e},c.buildMacro=function(t,e){c.makeBuilder(this,t)(void 0===e.length?e:e[0])},c.configureMacro=function(t){this.build.extension||this.configureTokenList(t)},c.XmlToToken=function(t,e,i,s){var r,n,a,o,l,u;if(r=t.cslXml.nodename(this),!t.build.skip||t.build.skip===r)if(r){if(c.Node[t.cslXml.nodename(this)]||c.error('Undefined node name "'+r+'".'),a=t.cslXml.attributes(this),o=c.setDecorations.call(this,t,a),l=new c.Token(r,e),e!==c.END||"if"===r||"else-if"===r||"layout"===r){for(var p in a)if(a.hasOwnProperty(p)){if(e===c.END&&"@language"!==p&&"@locale"!==p)continue;if(a.hasOwnProperty(p))if(c.Attributes[p])try{c.Attributes[p].call(l,t,""+a[p])}catch(t){c.error(p+" attribute: "+t)}else c.debug('warning: undefined attribute "'+p+'" in style')}l.decorations=o,c.DATE_VARIABLES.indexOf(a["@variable"])>-1&&s.push(l.variables)}else e===c.END&&a["@variable"]&&(l.hasVariable=!0,c.DATE_VARIABLES.indexOf(a["@variable"])>-1&&(l.variables=s.pop()));u=i||t[t.build.area].tokens,c.Node[r].build.call(l,t,u,!0)}else(n=t.cslXml.content(this))&&(t.build.text=n)},c.DateParser=function(){for(var t=[["明治",1867],["大正",1911],["昭和",1925],["平成",1988]],e=0,i=t.length;e<i;e++){t[e][0];var s=t[e][1]}var r=[],n={};for(e=0,i=t.length;e<i;e++){var a=t[e];s=a[0];r.push(s),n[a[0]]=a[1]}var o=r.join("|"),l=new RegExp("(?:"+o+")(?:[0-9]+)"),u=new RegExp("(?:"+o+")(?:[0-9]+)","g"),p=/(\u6708|\u5E74)/g,h=/\u65E5/g,m=/\u301c/g,f="([?0-9]{4}(?:%%NUMD%%[?0-9]{1,2}){0,2}(?![0-9])|(?:[?0-9]{1,2}%%NUMD%%){0,2}[?0-9]{4}(?![0-9])|[?0-9]{1,3}|[%%DATED%%]|[?~]|[^-/~?0-9]+)",d=new RegExp(f.replace(/%%NUMD%%/g,"-").replace(/%%DATED%%/g,"-")),g=new RegExp(f.replace(/%%NUMD%%/g,"-").replace(/%%DATED%%/g,"/")),b=new RegExp(f.replace(/%%NUMD%%/g,"/").replace(/%%DATED%%/g,"-"));this.monthStrings="january february march april may june july august september october november december spring summer fall winter spring summer".split(" "),this.setOrderDayMonth=function(){this.monthGuess=1,this.dayGuess=0},this.setOrderMonthDay=function(){this.monthGuess=0,this.dayGuess=1},this.resetDateParserMonths=function(){this.monthSets=[];for(var t=0,e=this.monthStrings.length;t<e;t++)this.monthSets.push([this.monthStrings[t]]);this.monthAbbrevs=[];for(t=0,e=this.monthSets.length;t<e;t++){this.monthAbbrevs.push([]);for(var i=0,s=this.monthSets[t].length;i<s;i++)this.monthAbbrevs[t].push(this.monthSets[t][0].slice(0,3))}this.monthRexes=[];for(t=0,e=this.monthAbbrevs.length;t<e;t++)this.monthRexes.push(new RegExp("(?:"+this.monthAbbrevs[t].join("|")+")"))},this.addDateParserMonths=function(t){if("string"==typeof t&&(t=t.split(/\s+/)),12===t.length||16===t.length){for(var e=0,i=t.length;e<i;e++){for(var s=null,r=!1,n=3,a={},o=0,l=this.monthAbbrevs.length;o<l;o++){if(a[o]={},o===e){for(var u=0,p=this.monthAbbrevs[e].length;u<p;u++)if(this.monthAbbrevs[e][u]===t[e].slice(0,this.monthAbbrevs[e][u].length)){r=!0;break}}else for(u=0,p=this.monthAbbrevs[o].length;u<p;u++)if(s=this.monthAbbrevs[o][u].length,this.monthAbbrevs[o][u]===t[e].slice(0,s)){for(;this.monthSets[o][u].slice(0,s)===t[e].slice(0,s);){if(s>t[e].length||s>this.monthSets[o][u].length){c.debug("unable to disambiguate month string in date parser: "+t[e]);break}s+=1}n=s,a[o][u]=s}for(var h in a)for(var m in a[h])s=a[h][m],h=parseInt(h,10),m=parseInt(m,10),this.monthAbbrevs[h][m]=this.monthSets[h][m].slice(0,s)}r||(this.monthSets[e].push(t[e]),this.monthAbbrevs[e].push(t[e].slice(0,n)))}this.monthRexes=[],this.monthRexStrs=[];for(e=0,i=this.monthAbbrevs.length;e<i;e++)this.monthRexes.push(new RegExp("^(?:"+this.monthAbbrevs[e].join("|")+")")),this.monthRexStrs.push("^(?:"+this.monthAbbrevs[e].join("|")+")");if(18===this.monthAbbrevs.length)for(e=12,i=14;e<i;e++)this.monthRexes[e+4]=new RegExp("^(?:"+this.monthAbbrevs[e].join("|")+")"),this.monthRexStrs[e+4]="^(?:"+this.monthAbbrevs[e].join("|")+")"}else c.debug("month [+season] list of "+t.length+", expected 12 or 16. Ignoring.")},this.convertDateObjectToArray=function(t){t["date-parts"]=[],t["date-parts"].push([]);for(var e,i=0,s=0,r=3;s<r&&t[e=["year","month","day"][s]];s++)i+=1,t["date-parts"][0].push(t[e]),delete t[e];t["date-parts"].push([]);for(s=0,r=i;s<r&&t[e=["year_end","month_end","day_end"][s]];s++)t["date-parts"][1].push(t[e]),delete t[e];return t["date-parts"][0].length!==t["date-parts"][1].length&&t["date-parts"].pop(),t},this.convertDateObjectToString=function(t){for(var e=[],i=0;i<3&&t[c.DATE_PARTS_ALL[i]];i+=1)e.push(t[c.DATE_PARTS_ALL[i]]);return e.join("-")},this._parseNumericDate=function(t,e,i,s){i||(i="");for(var r=s.split(e),n=0,a=r.length;n<a;n++)if(4===r[n].length){t["year"+i]=r[n].replace(/^0*/,""),r=n?r.slice(0,n):r.slice(1);break}for(n=0,a=r.length;n<a;n++)r[n]=parseInt(r[n],10);if(1===r.length||2===r.length&&!r[1])(o=r[0])&&(t["month"+i]=""+r[0]);else if(2===r.length)if(r[this.monthGuess]>12){var o=r[this.dayGuess],l=r[this.monthGuess];o&&(t["month"+i]=""+o,l&&(t["day"+i]=""+l))}else{o=r[this.monthGuess],l=r[this.dayGuess];o&&(t["month"+i]=""+o,l&&(t["day"+i]=""+l))}},this.parseDateToObject=function(t){var e,i=t,s=-1,r=-1,a=!1;if(t){if("-"===(t=t.replace(/^(.*[0-9])T[0-9].*/,"$1")).slice(0,1)&&(a=!0,t=t.slice(1)),t.match(/^[0-9]{1,3}$/))for(;t.length<4;)t="0"+t;if(E=(t=(t=""+t).replace(/\s*[0-9]{2}:[0-9]{2}(?::[0-9]+)/,"")).match(p)){var o=(t=(t=(t=(t=(t=(t=t.replace(/\s+/g,"")).replace(h,"")).replace(p,"-")).replace(m,"/")).replace(/\-\//g,"/")).replace(/-$/g,"")).split(l);e=[];var f=t.match(u);if(f){for(var _=[],v=0,y=f.length;v<y;v++)_=_.concat(f[v].match(/([^0-9]+)([0-9]+)/).slice(1));for(v=0,y=o.length;v<y;v++)if(e.push(o[v]),v!==y-1){var x=2*v;e.push(_[x]),e.push(_[x+1])}}else e=o;for(v=1,y=e.length;v<y;v+=3)e[v+1]=n[e[v]]+parseInt(e[v+1],10),e[v]="";s=(t=(t=(t=(t=e.join("")).replace(/\s*-\s*$/,"").replace(/\s*-\s*\//,"/")).replace(/\.\s*$/,"")).replace(/\.(?! )/,"")).indexOf("/"),r=t.indexOf("-")}}var I,O,S="",T="",N={};if('"'===(t=t.replace(/([A-Za-z])\./g,"$1")).slice(0,1)&&'"'===t.slice(-1))return N.literal=t.slice(1,-1),N;s>-1&&r>-1?t.split("/").length>3?(I="-",O="/",e=(t=t.replace(/\_/g,"-")).split(b)):(I="/",O="-",e=(t=t.replace(/\_/g,"/")).split(g)):(I="-",O="-",e=(t=(t=t.replace(/\//g,"-")).replace(/\_/g,"-")).split(d));var A=[];for(v=0,y=e.length;v<y;v++){var E;(E=e[v].match(/^\s*([\-\/]|[^\-\/\~\?0-9]+|[\-~?0-9]+)\s*$/))&&A.push(E[1])}var k=A.indexOf(I),R=[],w=!1;k>-1?(R.push([0,k]),R.push([k+1,A.length]),w=!0):R.push([0,A.length]);var j="";for(v=0,y=R.length;v<y;v++){var L=R[v],C=A.slice(L[0],L[1]);t:for(var P=0,D=C.length;P<D;P++){var U=C[P];if(U.indexOf(O)>-1)this._parseNumericDate(N,O,j,U);else if(U.match(/[0-9]{4}/))N["year"+j]=U.replace(/^0*/,"");else{("~"===U||"?"===U||"c"===U||U.match(/^cir/))&&(N.circa=!0);for(var q=0,B=this.monthRexes.length;q<B;q++)if(U.toLocaleLowerCase().match(this.monthRexes[q])){N["month"+j]=""+(parseInt(q,10)+1);continue t}U.match(/^[0-9]+$/)&&(S=U),U.toLocaleLowerCase().match(/^bc/)&&S?(N["year"+j]=""+-1*S,S=""):U.toLocaleLowerCase().match(/^ad/)&&S?(N["year"+j]=""+S,S=""):!U.toLocaleLowerCase().match(/(?:mic|tri|hil|eas)/)||N["season"+j]||(T=U)}}S&&(N["day"+j]=S,S=""),T&&!N["season"+j]&&(N["season"+j]=T.trim(),T=""),j="_end"}if(w)for(P=0,D=c.DATE_PARTS_ALL.length;P<D;P++){var M=c.DATE_PARTS_ALL[P];N[M]&&!N[M+"_end"]?N[M+"_end"]=N[M]:!N[M]&&N[M+"_end"]&&(N[M]=N[M+"_end"])}(!N.year||N.year&&N.day&&!N.month)&&(N={literal:i});var z=["year","month","day","year_end","month_end","day_end"];for(v=0,y=z.length;v<y;v++){var G=z[v];"string"==typeof N[G]&&N[G].match(/^[0-9]+$/)&&(N[G]=parseInt(N[G],10))}return a&&Object.keys(N).indexOf("year")>-1&&(N.year=-1*N.year),N},this.parseDateToArray=function(t){return this.convertDateObjectToArray(this.parseDateToObject(t))},this.parseDateToString=function(t){return this.convertDateObjectToString(this.parseDateToObject(t))},this.parse=function(t){return this.parseDateToObject(t)},this.setOrderMonthDay(),this.resetDateParserMonths()},c.DateParser=new c.DateParser,c.Engine=function(t,e,i,s){var r,n;for(var a in this.processor_version=c.PROCESSOR_VERSION,this.csl_version="1.0",this.sys=t,"function"!=typeof Object.assign&&Object.defineProperty(Object,"assign",{value:function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var s=arguments[i];if(null!=s)for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(e[r]=s[r])}return e},writable:!0,configurable:!0}),t.variableWrapper&&(c.VARIABLE_WRAPPER_PREPUNCT_REX=new RegExp("^(["+[" "].concat(c.SWAPPING_PUNCTUATION).join("")+"]*)(.*)")),c.retrieveStyleModule&&(this.sys.retrieveStyleModule=c.retrieveStyleModule),c.getAbbreviation&&(this.sys.getAbbreviation=c.getAbbreviation),this.sys.stringCompare&&(c.stringCompare=this.sys.stringCompare),this.sys.AbbreviationSegments=c.AbbreviationSegments,this.transform=new c.Transform(this),this.setParseNames=function(t){this.opt["parse-names"]=t},this.opt=new c.Engine.Opt,this.tmp=new c.Engine.Tmp,this.build=new c.Engine.Build,this.fun=new c.Engine.Fun(this),this.configure=new c.Engine.Configure,this.citation_sort=new c.Engine.CitationSort,this.bibliography_sort=new c.Engine.BibliographySort,this.citation=new c.Engine.Citation(this),this.bibliography=new c.Engine.Bibliography,this.intext=new c.Engine.InText,this.output=new c.Output.Queue(this),this.dateput=new c.Output.Queue(this),this.cslXml=new c.XmlJSON(e),c.SYS_OPTIONS){var o=c.SYS_OPTIONS[a];"boolean"==typeof this.sys[o]&&(this.opt.development_extensions[o]=this.sys[o])}(this.opt.development_extensions.uppercase_subtitles||this.opt.development_extensions.implicit_short_title)&&(this.opt.development_extensions.main_title_from_short_title=!0),this.opt.development_extensions.csl_reverse_lookup_support&&(this.build.cslNodeId=0,this.setCslNodeIds=function(t,e){var i=this.cslXml.children(t);this.cslXml.setAttribute(t,"cslid",this.build.cslNodeId),this.opt.nodenames.push(e),this.build.cslNodeId+=1;for(var s=0,r=this.cslXml.numberofnodes(i);s<r;s+=1)(e=this.cslXml.nodename(i[s]))&&this.setCslNodeIds(i[s],e)},this.setCslNodeIds(this.cslXml.dataObj,"style")),this.cslXml.addMissingNameNodes(this.cslXml.dataObj),this.cslXml.addInstitutionNodes(this.cslXml.dataObj),this.cslXml.insertPublisherAndPlace(this.cslXml.dataObj),this.cslXml.flagDateMacros(this.cslXml.dataObj),void 0===this.cslXml.attributes(this.cslXml.dataObj)["@sort-separator"]&&this.cslXml.setAttribute(this.cslXml.dataObj,"sort-separator",", "),this.opt["initialize-with-hyphen"]=!0,this.setStyleAttributes(),this.opt.xclass=this.cslXml.getAttributeValue(this.cslXml.dataObj,"class"),this.opt.class=this.opt.xclass,this.opt.styleID=this.cslXml.getStyleId(this.cslXml.dataObj),this.opt.styleName=this.cslXml.getStyleId(this.cslXml.dataObj,!0),"1.1m"===this.opt.version.slice(0,4)&&(this.opt.development_extensions.consolidate_legal_items=!0,this.opt.development_extensions.consolidate_container_items=!0,this.opt.development_extensions.main_title_from_short_title=!0,this.opt.development_extensions.expect_and_symbol_form=!0,this.opt.development_extensions.require_explicit_legal_case_title_short=!0,this.opt.development_extensions.force_jurisdiction=!0,this.opt.development_extensions.force_title_abbrev_fallback=!0),i&&(i=i.replace("_","-"),i=c.normalizeLocaleStr(i)),this.opt["default-locale"][0]&&(this.opt["default-locale"][0]=this.opt["default-locale"][0].replace("_","-"),this.opt["default-locale"][0]=c.normalizeLocaleStr(this.opt["default-locale"][0])),i&&s&&(this.opt["default-locale"]=[i]),i&&!s&&this.opt["default-locale"][0]&&(i=this.opt["default-locale"][0]),0===this.opt["default-locale"].length&&(i||(i="en-US"),this.opt["default-locale"].push("en-US")),i||(i=this.opt["default-locale"][0]),r=c.localeResolve(i),this.opt.lang=r.best,this.opt["default-locale"][0]=r.best,this.locale={},this.opt["default-locale-sort"]||(this.opt["default-locale-sort"]=this.opt["default-locale"][0]),"dale|".localeCompare("daleb",this.opt["default-locale-sort"])>-1?this.opt.sort_sep="@":this.opt.sort_sep="|",this.localeConfigure(r),this.locale[this.opt.lang].opts["skip-words-regexp"]=(n=(n=this.locale[this.opt.lang].opts["skip-words"]).slice(),new RegExp("(?:(?:[?!:]*\\s+|-|^)(?:"+n.join("|")+")(?=[!?:]*\\s+|-|$))","g")),this.output.adjust=new c.Output.Queue.adjust(this.getOpt("punctuation-in-quote")),this.registry=new c.Registry(this),this.macros={},this.build.area="citation";var l=this.cslXml.getNodesByName(this.cslXml.dataObj,this.build.area);this.buildTokenLists(l,this[this.build.area].tokens),this.build.area="bibliography";l=this.cslXml.getNodesByName(this.cslXml.dataObj,this.build.area);this.buildTokenLists(l,this[this.build.area].tokens),this.build.area="intext";l=this.cslXml.getNodesByName(this.cslXml.dataObj,this.build.area);this.buildTokenLists(l,this[this.build.area].tokens),this.opt.parallel.enable&&(this.parallel=new c.Parallel(this)),this.juris={},this.configureTokenLists(),this.disambiguate=new c.Disambiguation(this),this.splice_delimiter=!1,this.fun.dateparser=c.DateParser,this.fun.flipflopper=new c.Util.FlipFlopper(this),this.setCloseQuotesArray(),this.fun.ordinalizer.init(this),this.fun.long_ordinalizer.init(this),this.fun.page_mangler=c.Util.PageRangeMangler.getFunction(this,"page"),this.fun.year_mangler=c.Util.PageRangeMangler.getFunction(this,"year"),this.setOutputFormat("html")},c.Engine.prototype.setCloseQuotesArray=function(){var t;(t=[]).push(this.getTerm("close-quote")),t.push(this.getTerm("close-inner-quote")),t.push('"'),t.push("'"),this.opt.close_quotes_array=t},c.makeBuilder=function(t,e){var i=[],s=[];function r(r){s.push(r),c.XmlToToken.call(r,t,c.START,e,i)}function n(){var r=s.pop();c.XmlToToken.call(r,t,c.END,e,i)}function a(s){c.XmlToToken.call(s,t,c.SINGLETON,e,i)}return function e(i,s,o){i||(i=[]),void 0===i.length&&(i=[i]);for(var l=0;l<i.length;l++){var u=i[l];null!==t.cslXml.nodename(u)&&(s&&"date"===t.cslXml.nodename(u)&&(c.Util.fixDateNode.call(t,s,l,u),u=t.cslXml.children(s)[l]),t.cslXml.numberofnodes(t.cslXml.children(u))?(r(u),e(t.cslXml.children(u),u),n()):a(u))}}},c.Engine.prototype.buildTokenLists=function(t,e){this.cslXml.getNodeValue(t)&&c.makeBuilder(this,e)(void 0===t.length?t:t[0])},c.Engine.prototype.setStyleAttributes=function(){var t,e,i={};for(e in i.name=this.cslXml.nodename(this.cslXml.dataObj),t=this.cslXml.attributes(this.cslXml.dataObj))t.hasOwnProperty(e)&&c.Attributes[e].call(i,this,t[e])},c.Engine.prototype.getTerm=function(t,e,i,s,r,n){var a;t&&t.match(/[A-Z]/)&&t===t.toUpperCase()&&(c.debug("Warning: term key is in uppercase form: "+t),t=t.toLowerCase()),a=n?this.opt["default-locale"][0]:this.opt.la