UNPKG

docxtemplater

Version:

Generate docx, pptx, and xlsx from templates (Word, Powerpoint and Excel documents), from Node.js, the Browser and the command line

1 lines 92.3 kB
!function(){var e={60:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(536),s=r(207).isContent,l=r(946),u=l.throwRawTagShouldBeOnlyTextInParagraph,p=l.getInvalidRawXMLValueException,c=r(899),f="rawxml";function h(e){for(var t=e.part,r=e.left,n=e.right,o=e.postparsed,i=e.index,a=o.slice(r+1,n),l=0,p=a.length;l<p;l++)if(l!==i-r-1){var c=a[l];s(c)&&u({paragraphParts:a,part:t})}return t}var d=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="RawXmlModule",this.prefix="@"},t=[{key:"optionsTransformer",value:function(e,t){return this.fileTypeConfig=t.fileTypeConfig,e}},{key:"matchers",value:function(){return[[this.prefix,f]]}},{key:"postparse",value:function(e){return a.expandToOne(e,{moduleName:f,getInner:h,expandTo:this.fileTypeConfig.tagRawXml,error:{message:"Raw tag not in paragraph",id:"raw_tag_outerxml_invalid",explanation:function(e){return'The tag "'.concat(e.value,'" is not inside a paragraph, putting raw tags inside an inline loop is disallowed.')}}})}},{key:"render",value:function(e,t){if(e.module!==f)return null;var r,n=[];try{null!=(r=t.scopeManager.getValue(e.value,{part:e}))||(r=t.nullGetter(e))}catch(e){return n.push(e),{errors:n}}return"string"==typeof(r=r||"")?{value:r}:{errors:[p({tag:e.value,value:r,offset:e.offset})]}}}],t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();e.exports=function(){return c(new d)}},183:function(e){function t(e){var t,r,n,o,i=0,a=e.length;for(n=0;n<a;n++)55296==(64512&(t=e.charCodeAt(n)))&&n+1<a&&56320==(64512&(r=e.charCodeAt(n+1)))&&(t=65536+(t-55296<<10)+(r-56320),n++),i+=t<128?1:t<2048?2:t<65536?3:4;var s=new Uint8Array(i);for(o=0,n=0;o<i;n++)55296==(64512&(t=e.charCodeAt(n)))&&n+1<a&&56320==(64512&(r=e.charCodeAt(n+1)))&&(t=65536+(t-55296<<10)+(r-56320),n++),t<128?s[o++]=t:t<2048?(s[o++]=192|t>>>6,s[o++]=128|63&t):t<65536?(s[o++]=224|t>>>12,s[o++]=128|t>>>6&63,s[o++]=128|63&t):(s[o++]=240|t>>>18,s[o++]=128|t>>>12&63,s[o++]=128|t>>>6&63,s[o++]=128|63&t);return s}e.exports=function(e,r){for(var n=0,o=r.modules;n<o.length;n++)e=o[n].postrender(e,r);for(var i=0,a=r.joinUncorrupt(e,r),s="",l=0,u=[],p=0,c=a.length;p<c;p++){var f=a[p];if(f.length+l>65536){var h=t(s);i+=h.length,u.push(h),s=""}s+=f,l+=f.length,delete a[p]}var d=t(s);i+=d.length,u.push(d);for(var v=new Uint8Array(i),g=0,m=0;m<u.length;m++){for(var y=u[m],b=0;b<y.length;++b)v[b+g]=y[b];g+=y.length}return v}},201:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(798),s=r(207),l=s.getLeft,u=s.getRight,p=s.pushArray,c=r(899),f=r(536).getExpandToDefault,h=r(946),d=h.getUnmatchedLoopException,v=h.getClosingTagNotMatchOpeningTag,g=h.getUnbalancedLoopException;function m(e){switch(e.location){case"start":return 1;case"end":return-1}}function y(e,t){return null!=e&&null!=t&&("start"===e.part.location&&"end"===t.part.location&&e.part.value===t.part.value||""===t.part.value)}function b(e){for(var t=0,r=[];t<e.length;){var n=e[t].part;if("end"===n.location){if(0===t)return e.splice(0,1),r.push(d(n)),{traits:e,errors:r};var o=t,i=t-1,a=1;if(y(e[i],e[o]))return e.splice(o,1),e.splice(i,1),{errors:r,traits:e};for(;a<50;){var s=e[i-a],l=e[o+a];if(y(s,e[o]))return e.splice(o,1),e.splice(i-a,1),{errors:r,traits:e};if(y(e[i],l))return e.splice(o+a,1),e.splice(i,1),{errors:r,traits:e};a++}return r.push(v({tags:[e[i].part,e[o].part]})),e.splice(o,1),e.splice(i,1),{traits:e,errors:r}}t++}for(var u=0;u<e.length;u++){var p=e[u].part;r.push(d(p))}return{traits:[],errors:r}}var x=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="ExpandPairTrait"},t=[{key:"optionsTransformer",value:function(e,t){return t.options.paragraphLoop&&p(t.fileTypeConfig.expandTags,t.fileTypeConfig.onParagraphLoop),this.expandTags=t.fileTypeConfig.expandTags,e}},{key:"postparse",value:function(e,t){var r=this,n=t.getTraits,o=t.postparse,i=t.fileType,s=n("expandPair",e);s=s.map((function(e){return e||[]}));var c=function(e){var t={},r=[],n=[],o=[];for(p(o,e);o.length>0;){var i=b(o);p(r,i.errors),o=i.traits}if(r.length>0)return{pairs:n,errors:r};for(var a=0,s=0;s<e.length;s++){var l=e[s],u=m(l.part);if(a+=u,1===u)t[a]=l;else{var c=t[a+1];0===a&&n.push([c,l])}a=a>=0?a:0}return{pairs:n,errors:r}}(s=a(s)),h=c.pairs,d=c.errors,v=0,y=null,x=h.map((function(t){var n,o,a=t[0].part.expandTo;if("auto"===a&&"text"!==i){var s=f(e,t,r.expandTags);s.error&&d.push(s.error),a=s.value}if(!a||"text"===i){var p=t[0].offset,c=t[1].offset;return p<v&&!r.docxtemplater.options.syntax.allowUnbalancedLoops&&d.push(g(t,y)),y=t,v=c,[p,c]}try{n=l(e,a,t[0].offset)}catch(e){d.push(e)}try{o=u(e,a,t[1].offset)}catch(e){d.push(e)}return n<v&&!r.docxtemplater.options.syntax.allowUnbalancedLoops&&d.push(g(t,y)),v=o,y=t,[n,o]}));if(d.length>0)return{postparsed:e,errors:d};var w,T=0;return{postparsed:e.reduce((function(t,r,n){var i=T<h.length&&x[T][0]<=n&&n<=x[T][1],a=h[T],s=x[T];if(!i)return t.push(r),t;if(s[0]===n&&(w=[]),a[0].offset!==n&&a[1].offset!==n&&w.push(r),s[1]===n){var l=e[a[0].offset];l.subparsed=o(w,{basePart:l}),l.endLindex=a[1].part.lIndex,delete l.location,delete l.expandTo,t.push(l),T++;for(var u=x[T];u&&u[0]<n;)T++,u=x[T]}return t}),[]),errors:d}}}],t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();e.exports=function(){return c(new x)}},207:function(e,t,r){function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var o=r(673),i=o.DOMParser,a=o.XMLSerializer,s=r(946).throwXmlTagNotFound,l=r(320),u=l.last,p=l.first;function c(e){return{get:function(t){return"."===e?t:t?t[e]:t}}}var f={},h=[["&","&amp;"],["<","&lt;"],[">","&gt;"],['"',"&quot;"],["'","&apos;"]],d=h.map((function(e){var t,r,o=(r=2,function(e){if(Array.isArray(e))return e}(t=e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],l=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(t,r)||function(e,t){if(e){if("string"==typeof e)return n(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}}(t,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),i=o[0],a=o[1];return{rstart:new RegExp(a,"g"),rend:new RegExp(i,"g"),start:a,end:i}})),v=new RegExp(String.fromCharCode(160),"g");function g(e,t){return e==="</"+t+">"}function m(e,t){return 0===e.indexOf("<"+t)&&-1!==[">"," ","/"].indexOf(e[t.length+1])}function y(e,t,r){"string"==typeof t&&(t=[t]);for(var n=1,o=r,i=e.length;o<i;o++)for(var a=e[o],s=0,l=t;s<l.length;s++){var u=l[s];if(g(a.value,u)&&n--,m(a.value,u)&&n++,0===n)return o}return null}function b(e,t,r){"string"==typeof t&&(t=[t]);for(var n=1,o=r;o>=0;o--)for(var i=e[o],a=0,s=t;a<s.length;a++){var l=s[a];if(m(i.value,l)&&n--,g(i.value,l)&&n++,0===n)return o}return null}var x=/[\x00-\x08\x0B\x0C\x0E-\x1F]/g;e.exports={endsWith:function(e,t){return-1!==e.indexOf(t,e.length-t.length)},startsWith:function(e,t){return e.substring(0,t.length)===t},isContent:function(e){var t=e.type,r=e.position;return"placeholder"===t||"content"===t&&"insidetag"===r},isParagraphStart:function(e){var t=e.type,r=e.tag,n=e.position;return-1!==["w:p","a:p"].indexOf(r)&&"tag"===t&&"start"===n},isParagraphEnd:function(e){var t=e.type,r=e.tag,n=e.position;return-1!==["w:p","a:p"].indexOf(r)&&"tag"===t&&"end"===n},isTagStart:function(e,t){var r=t.type,n=t.tag,o=t.position;return"tag"===r&&n===e&&("start"===o||"selfclosing"===o)},isTagEnd:function(e,t){var r=t.type,n=t.tag,o=t.position;return"tag"===r&&n===e&&"end"===o},isTextStart:function(e){var t=e.type,r=e.position;return e.text&&"tag"===t&&"start"===r},isTextEnd:function(e){var t=e.type,r=e.position;return e.text&&"tag"===t&&"end"===r},isStarting:m,isEnding:g,isModule:function(e,t){var r=e.module,n=e.type;return t instanceof Array||(t=[t]),"placeholder"===n&&-1!==t.indexOf(r)},uniq:function(e){for(var t={},r=[],n=0,o=e.length;n<o;++n)t[e[n]]||(t[e[n]]=!0,r.push(e[n]));return r},getDuplicates:function(e){for(var t=[],r={},n=[],o=0,i=e.length;o<i;++o)r[e[o]]?t.push(e[o]):(r[e[o]]=!0,n.push(e[o]));return t},chunkBy:function(e,t){for(var r=[[]],n=0;n<e.length;n++){var o=e[n],i=r[r.length-1],a=t(o);"start"===a?r.push([o]):"end"===a?(i.push(o),r.push([])):i.push(o)}for(var s=[],l=0;l<r.length;l++){var u=r[l];u.length>0&&s.push(u)}return s},last:u,first:p,xml2str:function(e){return(new a).serializeToString(e).replace(/xmlns(:[a-z0-9]+)?="" ?/g,"")},str2xml:function(e){return 65279===e.charCodeAt(0)&&(e=e.substr(1)),(new i).parseFromString(e,"text/xml")},getRightOrNull:y,getRight:function(e,t,r){var n=y(e,t,r);if(null!==n)return n;s({position:"right",element:t,parsed:e,index:r})},getLeftOrNull:b,getLeft:function(e,t,r){var n=b(e,t,r);if(null!==n)return n;s({position:"left",element:t,parsed:e,index:r})},pregMatchAll:function(e,t){for(var r,n=[];null!=(r=e.exec(t));)n.push({array:r,offset:r.index});return n},convertSpaces:function(e){return e.replace(v," ")},charMapRegexes:d,hasCorruptCharacters:function(e){return x.lastIndex=0,x.test(e)},removeCorruptCharacters:function(e){return"string"!=typeof e&&(e=String(e)),e.replace(x,"")},getDefaults:function(){return{errorLogging:"json",stripInvalidXMLChars:!1,paragraphLoop:!1,nullGetter:function(e){return e.module?"":"undefined"},xmlFileNames:["[Content_Types].xml"],parser:c,linebreaks:!1,fileTypeConfig:null,delimiters:{start:"{",end:"}"},syntax:{changeDelimiterPrefix:"="}}},wordToUtf8:function(e){for(var t=d.length-1;t>=0;t--){var r=d[t];e=e.replace(r.rstart,r.end)}return e},utf8ToWord:function(e){var t;e=e.toString();for(var r=0,n=d.length;r<n;r++)t=d[r],e=e.replace(t.rend,t.start);return e},concatArrays:function(e){for(var t=[],r=0;r<e.length;r++)for(var n=e[r],o=0;o<n.length;o++){var i=n[o];t.push(i)}return t},pushArray:function(e,t){if(!t)return e;for(var r=0,n=t.length;r<n;r++)e.push(t[r]);return e},invertMap:function(e){var t={};for(var r in e){var n=e[r];t[n]||(t[n]=[]),t[n].push(r)}return t},charMap:h,getSingleAttribute:function(e,t){var r=e.indexOf(" ".concat(t,'="'));if(-1===r)return null;var n=e.substr(r).search(/["']/)+r,o=e.substr(n+1).search(/["']/)+n;return e.substr(n+1,o-n)},setSingleAttribute:function(e,t,r){var n;if(f[t]?n=f[t]:(n=new RegExp("(<.* ".concat(t,'=")([^"]*)(".*)$')),f[t]=n),n.test(e))return e.replace(n,"$1".concat(r,"$3"));var o=e.lastIndexOf("/>");return-1===o&&(o=e.lastIndexOf(">")),e.substr(0,o)+" ".concat(t,'="').concat(r,'"')+e.substr(o)},isWhiteSpace:function(e){return/^[ \n\r\t]+$/.test(e)},stableSort:function(e,t){return e.map((function(e,t){return{item:e,index:t}})).sort((function(e,r){return t(e.item,r.item)||e.index-r.index})).map((function(e){return e.item}))}}},208:function(e,t,r){var n=r(207),o=n.startsWith,i=n.endsWith,a=n.isStarting,s=n.isEnding,l=n.isWhiteSpace,u=r(322);e.exports=function(e,t){var r=t.fileTypeConfig.tagShouldContain||[],n="",p=-1;-1!==u.docx.indexOf(t.contentType)&&(e=function(e){for(var t="",r=0,n=e.length;r<n;r++){var a=e[r];l(a)||o(a,"<w:bookmarkEnd")||(i(t,"</w:tbl>")&&(o(a,"<w:p")||o(a,"<w:tbl")||o(a,"<w:sectPr")||(a="<w:p/>".concat(a))),t=a,e[r]=a)}return e}(e));for(var c=-1,f=0,h=r.length;f<h;f++)for(var d=r[f],v=d.tag,g=d.shouldContain,m=d.value,y=d.drop,b=d.dropParent,x=0,w=e.length;x<w;x++){var T=e[x];if(p===f){if(s(T,v))if(p=-1,b){for(var P=-1,O=c;O>0;O--)if(a(e[O],b)){P=O;break}for(var S=P;S<=e.length;S++){if(s(e[S],b)){e[S]="";break}e[S]=""}}else{for(var j=c;j<=x;j++)e[j]="";y||(e[x]=n+m+T)}n+=T;for(var E=0,C=g.length;E<C;E++){var k=g[E];if(a(T,k)){p=-1;break}}}-1===p&&a(T,v)&&-1===T.substr(1).indexOf("<")&&("/"===T[T.length-2]?e[x]="":(c=x,p=f,n=T))}return e}},245:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(207),s=a.pushArray,l=a.wordToUtf8,u=a.convertSpaces,p=r(367),c=r(263),f=r(690),h=r(789),d=r(183),v=r(945),g=r(208);e.exports=function(){return e=function e(t,r){for(var n in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.cachedParsers={},this.content=t,r)this[n]=r[n];this.setModules({inspect:{filePath:r.filePath}})},t=[{key:"resolveTags",value:function(e){var t=this;this.tags=e;var r=this.getOptions(),n=this.filePath;r.scopeManager=this.scopeManager,r.resolve=v;var o=[];return Promise.all(this.modules.map((function(e){return Promise.resolve(e.preResolve(r)).catch((function(e){o.push(e)}))}))).then((function(){if(0!==o.length)throw o;return v(r).then((function(e){var o=e.resolved,i=e.errors;if(0!==(i=i.map((function(e){var t;return e instanceof Error||(e=new Error(e)),(t=e).properties||(t.properties={}),e.properties.file=n,e}))).length)throw i;return Promise.all(o).then((function(e){return r.scopeManager.root.finishedResolving=!0,r.scopeManager.resolved=e,t.setModules({inspect:{resolved:e,filePath:n}}),e}))})).catch((function(e){throw t.errorChecker(e),e}))}))}},{key:"getFullText",value:function(){return e=this.content,t=this.fileTypeConfig.tagsXmlTextArray,r=p(e,t).matches.map((function(e){return e.array[2]})),l(u(r.join("")));var e,t,r}},{key:"setModules",value:function(e){for(var t=0,r=this.modules;t<r.length;t++)r[t].set(e)}},{key:"preparse",value:function(){this.allErrors=[],this.xmllexed=c.xmlparse(this.content,{text:this.fileTypeConfig.tagsXmlTextArray,other:this.fileTypeConfig.tagsXmlLexedArray}),this.setModules({inspect:{filePath:this.filePath,xmllexed:this.xmllexed}});var e=c.parse(this.xmllexed,this.delimiters,this.syntax,this.fileType),t=e.lexed,r=e.errors;s(this.allErrors,r),this.lexed=t,this.setModules({inspect:{filePath:this.filePath,lexed:this.lexed}});var n=this.getOptions();this.lexed=f.preparse(this.lexed,this.modules,n)}},{key:"parse",value:function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).noPostParse;this.setModules({inspect:{filePath:this.filePath}});var t=this.getOptions();return this.parsed=f.parse(this.lexed,this.modules,t),this.setModules({inspect:{filePath:this.filePath,parsed:this.parsed}}),e?this:this.postparse()}},{key:"postparse",value:function(){var e=this.getOptions(),t=f.postparse(this.parsed,this.modules,e),r=t.postparsed,n=t.errors;return this.postparsed=r,this.setModules({inspect:{filePath:this.filePath,postparsed:this.postparsed}}),s(this.allErrors,n),this.errorChecker(this.allErrors),this}},{key:"errorChecker",value:function(e){for(var t=0,r=e;t<r.length;t++){var n=r[t];n.properties||(n.properties={}),n.properties.file=this.filePath}for(var o=0,i=this.modules;o<i.length;o++)e=i[o].errorsTransformer(e)}},{key:"baseNullGetter",value:function(e,t){var r=this,n=this.modules.reduce((function(n,o){return null!=n?n:o.nullGetter(e,t,r)}),null);return null!=n?n:this.nullGetter(e,t)}},{key:"getOptions",value:function(){return{compiled:this.postparsed,cachedParsers:this.cachedParsers,tags:this.tags,modules:this.modules,parser:this.parser,contentType:this.contentType,relsType:this.relsType,baseNullGetter:this.baseNullGetter.bind(this),filePath:this.filePath,fileTypeConfig:this.fileTypeConfig,fileType:this.fileType,linebreaks:this.linebreaks,stripInvalidXMLChars:this.stripInvalidXMLChars}}},{key:"render",value:function(e){this.filePath=e;var t=this.getOptions();t.resolved=this.scopeManager.resolved,t.scopeManager=this.scopeManager,t.render=h,t.joinUncorrupt=g;var r=h(t),n=r.errors,o=r.parts;return n.length>0?(this.allErrors=n,this.errorChecker(n),this):(this.content=d(o,t),this.setModules({inspect:{filePath:this.filePath,content:this.content}}),this)}}],t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}()},263:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],l=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return i(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?i(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){l(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function l(e,t,r){return(t=function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var u=r(946),p=u.getUnclosedTagException,c=u.getUnopenedTagException,f=u.getDuplicateOpenTagException,h=u.getDuplicateCloseTagException,d=u.throwMalformedXml,v=u.throwXmlInvalid,g=u.XTTemplateError,m=r(207),y=m.isTextStart,b=m.isTextEnd,x=m.wordToUtf8,w=m.pushArray;function T(e,t){return e[0]<=t.offset&&t.offset<e[1]}function P(e,t){return y(e)?(t&&d(),!0):b(e)?(t||d(),!1):t}function O(e){var t="",r=1,n=e.indexOf(" ");return"/"===e[e.length-2]?(t="selfclosing",-1===n&&(n=e.length-2)):"/"===e[1]?(r=2,t="end",-1===n&&(n=e.length-1)):(t="start",-1===n&&(n=e.length-1)),{tag:e.slice(r,n),position:t}}function S(e,t){return-1===e&&-1===t?0:e===t?1:-1===e||-1===t?t<e?2:3:e<t?2:3}function j(e){var t=e.split(" ");if(2!==t.length){var r=new g("New Delimiters cannot be parsed");throw r.properties={id:"change_delimiters_invalid",explanation:"Cannot parser delimiters"},r}var n=o(t,2),i=n[0],a=n[1];if(0===i.length||0===a.length){var s=new g("New Delimiters cannot be parsed");throw s.properties={id:"change_delimiters_invalid",explanation:"Cannot parser delimiters"},s}return[i,a]}function E(e,t,r){var n=e.map((function(e){return e.value})).join(""),i=function(e,t,r){var n=[],i=t.start,a=t.end,s=-1,l=!1;if(null==i&&null==a)return[];for(;;){var u=e.indexOf(i,s+1),p=e.indexOf(a,s+1),c=null,f=void 0,h=S(u,p);switch(1===h&&(h=l?3:2),h){case 0:return n;case 3:l=!1,s=p,c="end",f=a.length;break;case 2:l=!0,s=u,c="start",f=i.length}if(r.changeDelimiterPrefix&&2===h&&e[s+i.length]===r.changeDelimiterPrefix){n.push({offset:u,position:"start",length:i.length,changedelimiter:!0});var d=e.indexOf(r.changeDelimiterPrefix,s+i.length+1),v=e.indexOf(a,d+1);n.push({offset:v,position:"end",length:a.length,changedelimiter:!0});var g=o(j(e.substr(s+i.length+1,d-s-i.length-1)),2);i=g[0],a=g[1],s=v}else n.push({offset:s,position:c,length:f})}}(n,t,r),a=0,l=e.map((function(e){return{offset:(a+=e.value.length)-e.value.length,lIndex:e.lIndex}})),u=function(e,t,r){var n,o=[],i=!1,a={offset:0},l=e.reduce((function(e,l){var u=l.position,d=l.offset,v=a.offset,g=a.length;if(n=t.substr(v,d-v),i&&"start"===u){if(v+g===d&&(n=t.substr(v,d-v+g+4),!r.allowUnclosedTag))return o.push(f({xtag:n,offset:v})),a=l,e.push(s(s({},l),{},{error:!0})),e;if(!r.allowUnclosedTag)return o.push(p({xtag:x(n),offset:v})),a=l,e.push(s(s({},l),{},{error:!0})),e;e.pop()}return i||"end"!==u?(i="start"===u,a=l,e.push(l),e):r.allowUnopenedTag?e:v+g===d?(n=t.substr(v-4,d-v+g+4),o.push(h({xtag:n,offset:v})),a=l,e.push(s(s({},l),{},{error:!0})),e):(o.push(c({xtag:n,offset:d})),a=l,e.push(s(s({},l),{},{error:!0})),e)}),[]);if(i){var u=a.offset;n=t.substr(u,t.length-u),r.allowUnclosedTag?l.pop():o.push(p({xtag:x(n),offset:u}))}return{delimiterWithErrors:l,errors:o}}(i,n,r),d=u.delimiterWithErrors,v=u.errors,g=0,m=0,y=l.map((function(t,r){for(var n=t.offset,o=[n,n+e[r].value.length],i=e[r].value,a=[];m<d.length&&T(o,d[m]);)a.push(d[m]),m++;var s=[],l=0;g>0&&(l=g,g=0);for(var u=0;u<a.length;u++){var p=a[u],c=i.substr(l,p.offset-n-l);if(p.changedelimiter)"start"===p.position?c.length>0&&s.push({type:"content",value:c}):l=p.offset-n+p.length;else{c.length>0&&(s.push({type:"content",value:c}),l+=c.length);var f={type:"delimiter",position:p.position,offset:l+n};s.push(f),l=p.offset-n+p.length}}g=l-i.length;var h=i.substr(l);return h.length>0&&s.push({type:"content",value:h}),s}),this);return{parsed:y,errors:v}}function C(e){return"content"===e.type&&"insidetag"===e.position}e.exports={parseDelimiters:E,parse:function(e,t,r,n){!function(e,t){for(var r=!1,n=0;n<e.length;n++){var o=e[n];r=P(o,r),"content"===o.type&&(o.position=r?"insidetag":"outsidetag"),"text"!==t&&C(o)&&(o.value=o.value.replace(/>/g,"&gt;"))}}(e,n);for(var o=E(e.filter(C),t,r),i=o.parsed,a=o.errors,s=[],l=0,u=0,p=0;p<e.length;p++){var c=e[p];if(C(c)){for(var f=0,h=i[l];f<h.length;f++){var d=h[f];"content"===d.type&&(d.position="insidetag"),d.lIndex=u++}w(s,i[l]),l++}else c.lIndex=u++,s.push(c)}return{errors:a,lexed:s}},xmlparse:function(e,t){var r=function(e,t,r){for(var n=0,o=e.length,i={},a=0;a<t.length;a++)i[t[a]]=!0;for(var s=0;s<r.length;s++)i[r[s]]=!1;for(var l=[];n<o&&-1!==(n=e.indexOf("<",n));){var u=n,p=e.indexOf("<",n+1);(-1===(n=e.indexOf(">",n))||-1!==p&&n>p)&&v(e,u);var c=e.slice(u,n+1),f=O(c),h=f.tag,d=f.position,g=i[h];null!=g&&l.push({type:"tag",position:d,text:g,offset:u,value:c,tag:h})}return l}(e,t.text,t.other),n=0,o=r.reduce((function(t,r){return e.length>n&&r.offset-n>0&&t.push({type:"content",value:e.substr(n,r.offset-n)}),n=r.offset+r.value.length,delete r.offset,t.push(r),t}),[]);return e.length>n&&o.push({type:"content",value:e.substr(n)}),o}}},271:function(e,t,r){var n=r(885),o=r(522),i=r(60),a=r(201),s=r(307);e.exports={docx:function(){return{getTemplatedFiles:function(){return[]},textPath:function(e){return e.textTarget},tagsXmlTextArray:["Company","HyperlinkBase","Manager","cp:category","cp:keywords","dc:creator","dc:description","dc:subject","dc:title","cp:contentStatus","w:t","a:t","m:t","vt:lpstr","vt:lpwstr"],tagsXmlLexedArray:["w:proofState","w:tc","w:tr","w:tbl","w:body","w:document","w:p","w:r","w:br","w:rPr","w:pPr","w:spacing","w:sdtContent","w:sdt","w:drawing","w:sectPr","w:type","w:headerReference","w:footerReference","w:bookmarkStart","w:bookmarkEnd","w:commentRangeStart","w:commentRangeEnd","w:commentReference"],droppedTagsInsidePlaceholder:["w:p","w:br","w:bookmarkStart","w:bookmarkEnd"],expandTags:[{contains:"w:tc",expand:"w:tr"}],onParagraphLoop:[{contains:"w:p",expand:"w:p",onlyTextInTag:!0}],tagRawXml:"w:p",baseModules:[n,o,a,i,s],tagShouldContain:[{tag:"w:sdtContent",shouldContain:["w:p","w:r","w:commentRangeStart","w:sdt"],value:"<w:p></w:p>"},{tag:"w:tc",shouldContain:["w:p"],value:"<w:p></w:p>"},{tag:"w:tr",shouldContain:["w:tc"],drop:!0},{tag:"w:tbl",shouldContain:["w:tr"],drop:!0}]}},pptx:function(){return{getTemplatedFiles:function(){return[]},textPath:function(e){return e.textTarget},tagsXmlTextArray:["Company","HyperlinkBase","Manager","cp:category","cp:keywords","dc:creator","dc:description","dc:subject","dc:title","a:t","m:t","vt:lpstr","vt:lpwstr"],tagsXmlLexedArray:["p:sp","a:tc","a:tr","a:tbl","a:graphicData","a:p","a:r","a:rPr","p:txBody","a:txBody","a:off","a:ext","p:graphicFrame","p:xfrm","a16:rowId","a:endParaRPr"],droppedTagsInsidePlaceholder:["a:p","a:endParaRPr"],expandTags:[{contains:"a:tc",expand:"a:tr"}],onParagraphLoop:[{contains:"a:p",expand:"a:p",onlyTextInTag:!0}],tagRawXml:"p:sp",baseModules:[n,a,i,s],tagShouldContain:[{tag:"a:tbl",shouldContain:["a:tr"],dropParent:"p:graphicFrame"},{tag:"p:txBody",shouldContain:["a:p"],value:"<a:p></a:p>"},{tag:"a:txBody",shouldContain:["a:p"],value:"<a:p></a:p>"}]}}}},307:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(899),s=r(946),l=s.getScopeCompilationError,u=s.getCorruptCharactersException,p=r(207),c=p.utf8ToWord,f=p.hasCorruptCharacters,h=p.removeCorruptCharacters,d=r(356),v=d.settingsContentType,g=d.coreContentType,m=d.appContentType,y=d.customContentType,b={docx:"w",pptx:"a"},x=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="Render",this.recordRun=!1,this.recordedRun=[]},t=[{key:"optionsTransformer",value:function(e,t){return this.parser=t.parser,this.fileType=t.fileType,e}},{key:"set",value:function(e){e.compiled&&(this.compiled=e.compiled),null!=e.data&&(this.data=e.data)}},{key:"getRenderedMap",value:function(e){var t=this;return Object.keys(this.compiled).reduce((function(e,r){return e[r]={from:r,data:t.data},e}),e)}},{key:"postparse",value:function(e,t){for(var r=[],n=0;n<e.length;n++){var o=e[n];if("placeholder"===o.type){var i=o.value;try{t.cachedParsers[o.lIndex]=this.parser(i,{tag:o})}catch(e){r.push(l({tag:i,rootError:e,offset:o.offset}))}}}return{postparsed:e,errors:r}}},{key:"render",value:function(e,t){var r=t.contentType,n=t.scopeManager,o=t.linebreaks,i=t.nullGetter,a=t.fileType,s=t.stripInvalidXMLChars;if(o&&-1!==[v,g,m,y].indexOf(r)&&(o=!1),o&&this.recordRuns(e),"placeholder"===e.type&&!e.module){var l;try{l=n.getValue(e.value,{part:e})}catch(e){return{errors:[e]}}if(null!=l||(l=i(e)),"string"==typeof l)if(s)l=h(l);else if(-1!==["docx","pptx","xlsx"].indexOf(a)&&f(l))return{errors:[u({tag:e.value,value:l,offset:e.offset})]};return"text"===a?{value:l}:{value:o&&"string"==typeof l?this.renderLineBreaks(l):c(l)}}}},{key:"recordRuns",value:function(e){e.tag==="".concat(b[this.fileType],":r")?this.recordedRun=[]:e.tag==="".concat(b[this.fileType],":rPr")?("start"===e.position&&(this.recordRun=!0,this.recordedRun=[e.value]),"end"!==e.position&&"selfclosing"!==e.position||(this.recordedRun.push(e.value),this.recordRun=!1)):this.recordRun&&this.recordedRun.push(e.value)}},{key:"renderLineBreaks",value:function(e){var t=this,r=b[this.fileType],n="docx"===this.fileType?"<w:r><w:br/></w:r>":"<a:br/>",o=e.split("\n"),i=this.recordedRun.join("");return o.map((function(e){return c(e)})).reduce((function(e,a,s){return e.push(a),s<o.length-1&&e.push("</".concat(r,":t></").concat(r,":r>").concat(n,"<").concat(r,":r>").concat(i,"<").concat(r,":t").concat("docx"===t.fileType?' xml:space="preserve"':"",">")),e}),[])}}],t&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();e.exports=function(){return a(new x)}},320:function(e){e.exports={last:function(e){return e[e.length-1]},first:function(e){return e[0]}}},322:function(e){var t=["application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml","application/vnd.ms-word.document.macroEnabled.main+xml","application/vnd.openxmlformats-officedocument.wordprocessingml.template.main+xml","application/vnd.ms-word.template.macroEnabledTemplate.main+xml"],r={main:t,docx:["application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml"].concat(t,["application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml","application/vnd.openxmlformats-officedocument.wordprocessingml.footnotes+xml","application/vnd.openxmlformats-officedocument.wordprocessingml.comments+xml"]),pptx:["application/vnd.openxmlformats-officedocument.presentationml.slide+xml","application/vnd.openxmlformats-officedocument.presentationml.slideMaster+xml","application/vnd.openxmlformats-officedocument.presentationml.slideLayout+xml","application/vnd.openxmlformats-officedocument.presentationml.presentation.main+xml"],xlsx:["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml","application/vnd.ms-excel.sheet.macroEnabled.main+xml","application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"]};e.exports=r},356:function(e){e.exports={settingsContentType:"application/vnd.openxmlformats-officedocument.wordprocessingml.settings+xml",coreContentType:"application/vnd.openxmlformats-package.core-properties+xml",appContentType:"application/vnd.openxmlformats-officedocument.extended-properties+xml",customContentType:"application/vnd.openxmlformats-officedocument.custom-properties+xml",diagramDataContentType:"application/vnd.openxmlformats-officedocument.drawingml.diagramData+xml",diagramDrawingContentType:"application/vnd.ms-office.drawingml.diagramDrawing+xml"}},367:function(e,t,r){var n=r(207).pregMatchAll;e.exports=function(e,t){var r={content:e},o=t.join("|"),i=new RegExp("(?:(<(?:".concat(o,")[^>]*>)([^<>]*)</(?:").concat(o,")>)|(<(?:").concat(o,")[^>]*/>)"),"g");return r.matches=n(i,r.content),r}},438:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(207).pushArray,s=r(899),l=r(322),u=r(356),p=[u.settingsContentType,u.coreContentType,u.appContentType,u.customContentType,u.diagramDataContentType,u.diagramDrawingContentType],c=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="Common"},(t=[{key:"getFileType",value:function(e){var t=e.doc,r=t.invertedContentTypes;if(r){for(var n=0;n<p.length;n++){var o=p[n];r[o]&&a(t.targets,r[o])}for(var i,s=["docx","pptx","xlsx"],u=0;u<s.length;u++){for(var c=s[u],f=l[c],h=0;h<f.length;h++){var d=f[h];if(r[d])for(var v=0,g=r[d];v<g.length;v++){var m=g[v];t.relsTypes[m]&&-1===["http://purl.oclc.org/ooxml/officeDocument/relationships/officeDocument","http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument"].indexOf(t.relsTypes[m])||(i=c,-1===l.main.indexOf(d)&&d!==l.pptx[0]||t.textTarget||(t.textTarget=m),"xlsx"!==i&&t.targets.push(m))}}if(i)return i}return i}}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();e.exports=function(){return s(new c)}},460:function(e,t,r){var n=r(207).pushArray;function o(e,t){return t instanceof Error?n(Object.getOwnPropertyNames(t),["stack"]).reduce((function(e,r){return e[r]=t[r],"stack"===r&&(e[r]=t[r].toString()),e}),{}):t}e.exports=function(e,t){if(console.log(JSON.stringify({error:e},o,"json"===t?2:null)),e.properties&&e.properties.errors instanceof Array){var r=e.properties.errors.map((function(e){return e.properties.explanation})).join("\n");console.log("errorMessages",r)}}},522:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(899),s=r(207),l=s.isTextStart,u=s.isTextEnd,p=s.endsWith,c=s.startsWith,f=s.pushArray;function h(e,t){var r=e[t].value;return"</w:t>"===e[t+1].value||-1!==r.indexOf('xml:space="preserve"')?r:r.substr(0,r.length-1)+' xml:space="preserve">'}var d=function(){return e=function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.name="SpacePreserveModule"},(t=[{key:"postparse",value:function(e,t){var r=[],n=!1,o=0,i=0,a=e.reduce((function(e,a){return function(e){return l(e)&&"w:t"===e.tag}(a)&&(n=!0,i=r.length),n?(r.push(a),function(e,t){return e&&e.basePart&&t.length>1}(t,r)&&(o=t.basePart.endLindex,r[0].value=h(r,0)),function(e,t){return"placeholder"===e.type&&t.length>1}(a,r)&&(r[i].value=h(r,i),o=a.endLindex),u(a)&&a.lIndex>o&&(0!==o&&(r[i].value=h(r,i)),f(e,r),r=[],n=!1,o=0,i=0),e):(e.push(a),e)}),[]);return f(a,r),a}},{key:"postrender",value:function(e){for(var t="",r=0,n=0,o=e.length;n<o;n++){var i=e[n];""!==i&&(p(t,'<w:t xml:space="preserve">')&&c(i,"</w:t>")&&(e[r]=t.substr(0,t.length-26)+"<w:t/>",i=i.substr(6)),t=i,r=n,e[n]=i)}return e}}])&&o(e.prototype,t),Object.defineProperty(e,"prototype",{writable:!1}),e;var e,t}();e.exports=function(){return a(new d)}},536:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],l=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||i(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(e,t){if(e){if("string"==typeof e)return a(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?a(e,t):void 0}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach((function(t){u(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t,r){return(t=function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var p=r(207),c=p.getRightOrNull,f=p.getRight,h=p.getLeft,d=p.getLeftOrNull,v=p.chunkBy,g=p.isTagStart,m=p.isTagEnd,y=p.isContent,b=p.last,x=p.first,w=r(946),T=w.XTTemplateError,P=w.throwExpandNotFound,O=w.getLoopPositionProducesInvalidXMLError;function S(e,t){return 0!==e.length&&0===b(e).substr(1).indexOf(t)}function j(e,t,r,n){var o=e.expandTo||n.expandTo;if(o){var i,a;try{a=h(r,o,t),i=f(r,o,t)}catch(i){var s=l({part:e,rootError:i,postparsed:r,expandTo:o,index:t},n.error);if(n.onError&&"ignore"===n.onError(s))return;P(s)}return[a,i]}}function E(e,t,r,n){var i=o(e,2),a=i[0],s=i[1],l=r.indexOf(t),u=r.slice(a,l),p=r.slice(l+1,s+1),c=n.getInner({postparse:n.postparse,index:l,part:t,leftParts:u,rightParts:p,left:a,right:s,postparsed:r});return c.length||(c.expanded=[u,p],c=[c]),{left:a,right:s,inner:c}}e.exports={expandToOne:function(e,t){var r,n=[];e.errors&&(n=e.errors,e=e.postparsed);for(var s=[],u=0,p=e.length;u<p;u++){var c=e[u];if("placeholder"===c.type&&c.module===t.moduleName&&!c.subparsed&&!c.expanded)try{var f=j(c,u,e,t);if(!f)continue;var h=o(f,2),d=h[0],v=h[1];s.push({left:d,right:v,part:c,i:u,leftPart:e[d],rightPart:e[v]})}catch(e){n.push(e)}}s.sort((function(e,t){return e.left===t.left?t.part.lIndex<e.part.lIndex?1:-1:t.left<e.left?1:-1}));for(var g=-1,m=0,y=0,b=s.length;y<b;y++){var x,w=s[y];if(g=Math.max(g,y>0?s[y-1].right:0),!(w.left<g)){var P=void 0;try{P=E([w.left+m,w.right+m],w.part,e,t)}catch(r){if(t.onError&&"ignore"===t.onError(l({part:w.part,rootError:r,postparsed:e,expandOne:E},t.errors)))continue;if(!(r instanceof T))throw r;n.push(r)}P&&(m+=P.inner.length-(P.right+1-P.left),(x=e).splice.apply(x,[P.left,P.right+1-P.left].concat(function(e){if(Array.isArray(e))return a(e)}(r=P.inner)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(r)||i(r)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())))}}return{postparsed:e,errors:n}},getExpandToDefault:function(e,t,r){var n=function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r],o=n.position,i=n.value,a=n.tag;a&&("end"===o?S(t,a)?t.pop():t.push(i):"start"===o&&t.push(i))}return t}(e.slice(t[0].offset,t[1].offset));if(n.filter((function(e){return"/"===e[1]})).length!==n.filter((function(e){return"/"!==e[1]&&"/"!==e[e.length-2]})).length)return{error:O({tag:x(t).part.value,offset:[x(t).part.offset,b(t).part.offset]})};for(var o,i=function(){var o=r[a],i=o.contains,s=o.expand,l=o.onlyTextInTag;if(function(e,t){for(var r=0;r<t.length;r++)if(0===t[r].indexOf("<".concat(e)))return!0;return!1}(i,n)){if(l){var u=d(e,i,t[0].offset),p=c(e,i,t[1].offset);if(null===u||null===p)return 0;var f=v(e.slice(u,p),(function(e){return g(i,e)?"start":m(i,e)?"end":null})),h=x(f),w=b(f),T=h.filter(y),P=w.filter(y);if(1!==T.length||1!==P.length)return 0}return{v:{value:s}}}},a=0;a<r.length;a++)if(0!==(o=i())&&o)return o.v;return{}}}},650:function(e){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}var r=new RegExp(String.fromCharCode(160),"g");function n(e){return e.replace(r," ")}e.exports={match:function(e,r){var o=t(e);return"string"===o?n(r.substr(0,e.length))===e:e instanceof RegExp?e.test(n(r)):"function"===o?!!e(r):void 0},getValue:function(e,r){var o=t(e);return"string"===o?n(r).substr(e.length):e instanceof RegExp?n(r).match(e)[1]:"function"===o?e(r):void 0},getValues:function(e,r){var o=t(e);return"string"===o?[r,n(r).substr(e.length)]:e instanceof RegExp?n(r).match(e):"function"===o?[r,e(r)]:void 0}}},673:function(e){e.exports={XMLSerializer:window.XMLSerializer,DOMParser:window.DOMParser,XMLDocument:window.XMLDocument}},690:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach((function(t){a(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function a(e,t,r){return(t=function(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,i,a,s=[],l=!0,u=!1;try{if(i=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=i.call(r)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,o=e}finally{try{if(!l&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(u)throw o}}return s}}(e,t)||function(e,t){if(e){if("string"==typeof e)return l(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?l(e,t):void 0}}(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}var u=r(207),p=u.wordToUtf8,c=u.pushArray,f=r(650),h=f.match,d=f.getValue,v=f.getValues;var g={preparse:function(e,t,r){return function(e,r){for(var n=0;n<t.length;n++)e=t[n].preparse(e,r)||e;return e}(e,r)},parse:function(e,t,r){var n,o=!1,a="",l=[],u=r.fileTypeConfig.droppedTagsInsidePlaceholder||[];return e.reduce((function(e,f){return"delimiter"===f.type?(o="start"===f.position,"end"===f.position&&(r.parse=function(e){return function(e,t){var r,n=t.modules,o=t.startOffset,a=t.lIndex;t.offset=o,t.match=h,t.getValue=d,t.getValues=v;var l=function(e,t){for(var r=[],n=0;n<e.length;n++){var o=e[n];if(o.matchers){var i=o.matchers(t);if(!(i instanceof Array))throw new Error("module matcher returns a non array");c(r,i)}}return r}(n,t),u=function(e,t,r){for(var n=[],o=0;o<e.length;o++){var a=e[o],l=s(a,2),u=l[0],p=l[1],c=a[2]||{};if(r.match(u,t)){var f=r.getValues(u,t);if("function"==typeof c&&(c=c(f)),!c.value){var h=s(f,2);c.value=h[1]}n.push(i({type:"placeholder",prefix:u,module:p,onMatch:c.onMatch,priority:c.priority},c))}}return n}(l,e,t);if(u.length>0){for(var p=null,f=0;f<u.length;f++){var g=u[f];g.priority||(g.priority=-g.value.length),(!p||g.priority>p.priority)&&(p=g)}return p.offset=o,delete p.priority,p.endLindex=a,p.lIndex=a,p.raw=e,p.onMatch&&p.onMatch(p),delete p.onMatch,delete p.prefix,p}for(var m=0;m<n.length;m++)if(r=n[m].parse(e,t))return r.offset=o,r.endLindex=a,r.lIndex=a,r.raw=e,r;return{type:"placeholder",value:e,offset:o,endLindex:a,lIndex:a}}(e,i(i(i({},r),f),{},{startOffset:n,modules:t}))},e.push(r.parse(p(a))),c(e,l),l=[]),"start"===f.position&&(l=[],n=f.offset),a="",e):o?"content"!==f.type||"insidetag"!==f.position?(-1!==u.indexOf(f.tag)||l.push(f),e):(a+=f.value,e):(e.push(f),e)}),[])},postparse:function(e,t,r){function n(e,r){return t.map((function(t){return t.getTraits(e,r)}))}var o=[];return{postparsed:function e(r,a){return t.reduce((function(t,r){var s=r.postparse(t,i(i({},a),{},{postparse:function(t,r){return e(t,i(i({},a),r))},getTraits:n}));return null==s?t:s.errors?(c(o,s.errors),s.postparsed):s}),r)}(e,r),errors:o}}};e.exports=g},779:function(e,t,r){function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,i(n.key),n)}}function i(e){var t=function(e){if("object"!=n(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=n(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==n(t)?t:t+""}var a=r(946).getScopeParserExecutionError,s=r(320).last,l=r(207).concatArrays;function u(e,t){for(var r,n=e.length>>>0,o=0;o<n;o++)if(r=e[o],t.call(this,r,o,e))return r}function p(e,t,r){var n,o,i=this,s=this.scopeList[r];if(this.root.finishedResolving){for(var l=this.resolved,c=function(){var e=i.scopeLindex[f];l=(l=u(l,(function(t){return t.lIndex===e}))).value[i.scopePathItem[f]]},f=this.resolveOffset,h=this.scopePath.length;f<h;f++)c();return u(l,(function(e){return t.part.lIndex===e.lIndex})).value}o=this.cachedParsers&&t.part?this.cachedParsers[t.part.lIndex]?this.cachedParsers[t.part.lIndex]:this.cachedParsers[t.part.lIndex]=this.parser(e,{tag:t.part,scopePath:this.scopePath}):this.parser(e,{tag:t.part,scopePath:this.scopePath});try{n=o.get(s,this.getContext(t,r))}catch(r){throw a({tag:e,scope:s,error:r,offset:t.part.offset})}return null==n&&r>0?p.call(this,e,t,r-1):n}function c(e,t,r){var n,o=this,i=this.scopeList[r];return n=this.cachedParsers&&t.part?this.cachedParsers[t.part.lIndex]?this.cachedParsers[t.part.lIndex]:this.cachedParsers[t.part.lIndex]=this.parser(e,{tag:t.part,scopePath:this.scopePath}):this.parser(e,{tag:t.part,scopePath:this.scopePath}),Promise.resolve().then((function(){return n.get(i,o.getContext(t,r))})).catch((function(r){throw a({tag:e,scope:i,error:r,offset:t.part.offset})})).then((function(n){return null==n&&r>0?c.call(o,e,t,r-1):n}))}var f=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.root=t.root||this,this.resolveOffset=t.resolveOffset||0,this.scopePath=t.scopePath,this.scopePathItem=t.scopePathItem,this.scopePathLength=t.scopePathLength,this.scopeList=t.scopeList,this.scopeType="",this.scopeTypes=t.scopeTypes,this.scopeLindex=t.scopeLindex,this.parser=t.parser,this.resolved=t.resolved,this.cachedParsers=t.cachedParsers}return t=e,(r=[{key:"loopOver",value:function(e,t,r,n){return this.loopOverValue(this.getValue(e,n),t,r)}},{key:"functorIfInverted",value:function(e,t,r,n,o){return e&&t(r,n,o),e}},{key:"isValueFalsy",value:function(e,t){return null==e||!e||"[object Array]"===t&&0===e.length}},{key:"loopOverValue",value:function(e,t,r){this.root.finishedResolving&&(r=!1);var n=Object.prototype.toString.call(e);i