!function(t){function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var n={};e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e(e.s=704)}({375:function(t,e,n){"use strict";function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){if(!t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!e||"object"!=typeof e&&"function"!=typeof e?t:e}function i(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function, not "+typeof e);t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),e&&(Object.setPrototypeOf?Object.setPrototypeOf(t,e):t.__proto__=e)}var a=function(){function t(t,e){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:[],f=document.createElement("div");if(f.id=t.bibliographyId,f.setAttribute("data-reflist",JSON.stringify(n.map(function(t){return t.id}))),(o=f.classList).add.apply(o,[t.bibliographyId].concat(r(d))),f.classList.contains(t.staticBibClass)&&(f.classList.remove(t.bibliographyId),f.removeAttribute("id"),0===n.length)){var h=top.ABT.i18n.errors.warnings;return f.innerHTML=""+h.warning+": "+h.noBib+".",f}if(a){var y=void 0;"toggle"===u?(y=document.createElement("button"),y.classList.add(t.bibliographyId+"__heading",t.bibliographyId+"__heading_toggle"),y.setAttribute("aria-expanded","false"),y.setAttribute("aria-controls",this.bibliographyId+"__container"),y.setAttribute("data-heading-level",c)):(y=document.createElement(c),y.classList.add(t.bibliographyId+"__heading")),y.textContent=a,f.appendChild(y)}var v=document.createElement("div");v.id=this.bibliographyId+"__container",v.classList.add(this.bibliographyId+"__container"),f.appendChild(v);var p=!0,b=!1,m=void 0;try{for(var g,E=n[Symbol.iterator]();!(p=(g=E.next()).done);p=!0){var C=g.value,w=document.createElement("div");w.id=C.id,w.innerHTML=C.html,v.appendChild(w)}}catch(t){b=!0,m=t}finally{try{!p&&E.return&&E.return()}finally{if(b)throw m}}return f}},{key:"createFootnoteSection",value:function(e){var n,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],a=document.createElement("div");a.id=t.footnoteId,(n=a.classList).add.apply(n,[t.footnoteId].concat(r(o)));var l=document.createElement("div");l.classList.add(t.footnoteId+"__heading"),l.textContent=top.ABT.i18n.misc.footnotes,a.appendChild(l);var c=!0,s=!1,u=void 0;try{for(var d,f=Array.from(e.entries())[Symbol.iterator]();!(c=(d=f.next()).done);c=!0){var h=d.value,y=i(h,2),v=y[0],p=y[1],b=document.createElement("div");b.classList.add(t.footnoteId+"__item");var m=document.createElement("span");m.classList.add(t.footnoteId+"__number"),m.textContent="["+(v+1)+"]";var g=document.createElement("span");g.classList.add(t.footnoteId+"__content"),g.innerHTML=p,b.appendChild(m),b.appendChild(g),a.appendChild(b)}}catch(t){s=!0,u=t}finally{try{!c&&f.return&&f.return()}finally{if(s)throw u}}return a}},{key:"createInlineElement",value:function(e){var n,o=e.classNames,i=void 0===o?[]:o,a=l(e,["classNames"]),c=a.id,s=a.innerHTML,u=a.reflist,d=document.createElement("span");return d.id=c,(n=d.classList).add.apply(n,[t.citationClass].concat(r(i))),d.innerHTML=s,d.setAttribute("data-reflist",u),"note"===a.kind&&d.setAttribute("data-footnote",a.footnote),d}}]),t}();s.events=c,s.bibliographyId="abt-bibliography",s.citationClass="abt-citation",s.footnoteId="abt-footnote",s.staticBibClass="abt-static-bib",e.default=s},415:function(t,e,n){"use strict";function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e2&&void 0!==arguments[2]&&arguments[2]?this.setStaticBibliography(e):this.setStandardBibliography(t,e)}},{key:"setLoadingState",value:function(t){this.editor.setProgressState(t||!1)}},{key:"bindEvents",value:function(){var t=this;this.editor.on("focusin",function(){t.selectionCache=Object.assign({},t.selectionCache,{fresh:!1})}),this.editor.on("focusout",function(){t.selectionCache={fresh:!0,selection:t.selection,bookmark:t.editor.selection.getBookmark(1)}}),this.editor.on("hide",function(){dispatchEvent(new CustomEvent(u.default.events.UNAVAILABLE))}),this.editor.on("show",function(){dispatchEvent(new CustomEvent(u.default.events.AVAILABLE))}),this.editor.on("Undo",function(){dispatchEvent(new CustomEvent(u.default.events.UNDO))}),this.editor.addShortcut("meta+alt+r","Add Reference",function(){return dispatchEvent(new CustomEvent(u.default.events.ADD_REFERENCE))}),this.editor.addShortcut("meta+alt+p","Pin Reference List",function(){return dispatchEvent(new CustomEvent(u.default.events.TOGGLE_PINNED))}),this.editorCitationObserver.observe(this.editor.getBody(),{childList:!0,subtree:!0})}},{key:"composeFootnotes",value:function(){var t=this.editor.getDoc(),e=[].concat(r(t.querySelectorAll("."+u.default.citationClass).entries())).reduce(function(t,e){var n=l(e,2),o=n[0],i=n[1];i.innerHTML="["+(o+1)+"]";var a=i.getAttribute("data-footnote");return a?[].concat(r(t),[a]):t},[]);if(0!==e.length){var n=this.editor.selection.getBookmark(),o=u.default.createFootnoteSection(e,["noselect","mceNonEditable"]),i=this.editor.getBody();this.editor.selection.setCursorLocation(i,i.childNodes.length),this.editor.insertContent(o.outerHTML),this.editor.selection.moveToBookmark(n)}}},{key:"setStandardBibliography",value:function(t,e){if("boolean"!=typeof e&&0!==e.length){var n=u.default.createBibliographyElement(t,e,["noselect","mceNonEditable"]),r=this.editor.selection.getBookmark(),o=this.editor.getBody();this.editor.selection.setCursorLocation(o,o.childNodes.length),this.editor.insertContent(n.outerHTML),this.editor.selection.moveToBookmark(r)}}},{key:"setStaticBibliography",value:function(t){var e="boolean"==typeof t?[]:t,n=u.default.createBibliographyElement({},e,[""+u.default.staticBibClass,"noselect","mceNonEditable"]);this.selectionCache.fresh&&this.editor.selection.moveToBookmark(this.selectionCache.bookmark),this.editor.insertContent(n.outerHTML)}},{key:"citationIds",get:function(){return[].concat(r(this.editor.getDoc().querySelectorAll("*:not(.mce-offscreen-selection) > ."+u.default.citationClass))).map(function(t){return t.id})}},{key:"citationsByIndex",get:function(){var t=this.editor.getDoc(),e=[].concat(r(t.querySelectorAll("\n *:not(.mce-offscreen-selection) >\n ."+u.default.citationClass+"\n "))),n=null!==t.querySelector("#"+u.default.footnoteId);return e.reduce(function(t,e,o){var i=e.getAttribute("data-reflist");if(!i)return t;var a=JSON.parse(i);return[].concat(r(t),[{citationID:e.id,citationItems:a.map(function(t){return{id:t}}),properties:{index:o,noteIndex:n?1:0}}])},[])}},{key:"relativeCitationPositions",get:function(){var t=this,e=this.editor.getDoc(),n=this.selectionCache.fresh?this.selectionCache.bookmark:this.editor.selection.getBookmark(1),o=n.rng.startContainer;return[].concat(r(e.querySelectorAll("\n *:not(.mce-offscreen-selection) >\n ."+u.default.citationClass+"\n "))).reduce(function(e,n,i){if(!n.parentNode)throw new Error("parentNode not defined for citation");switch(o.compareDocumentPosition(n)){case Node.DOCUMENT_POSITION_PRECEDING:e.itemsPreceding=[].concat(r(e.itemsPreceding),[[n.id,i]]);break;case Node.DOCUMENT_POSITION_FOLLOWING:e.itemsFollowing=[].concat(r(e.itemsFollowing),[[n.id,i+1]]);break;default:n.parentElement.removeChild(n),t.editor.selection.moveToBookmark(t.selectionCache.bookmark)}return e},{itemsPreceding:[],itemsFollowing:[]})}},{key:"selection",get:function(){return this.selectionCache.fresh?this.selectionCache.selection:this.editor.selection.getContent({format:"html"})}}]),e}(u.default);e.default=d},704:function(t,e,n){t.exports=n(415)}}); //# sourceMappingURL=tinymce.js.map