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Aa,QAAQ,oBACnC,OAAO,QAAU,cACjB,OAAO,QAAiB,QAAI","file":"/npm/docxtemplater@3.63.2/js/docxtemplater.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/docxtemplater@3.63.2/js/docxtemplater.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","\"use strict\";\n\nvar _excluded = [\"modules\"];\nfunction ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }\nfunction _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }\nfunction _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }\nfunction _slicedToArray(r, e) { return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest(); }\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\nfunction _unsupportedIterableToArray(r, a) { if (r) { if (\"string\" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }\nfunction _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }\nfunction _iterableToArrayLimit(r, l) { var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }\nfunction _arrayWithHoles(r) { if (Array.isArray(r)) return r; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nfunction _objectWithoutProperties(e, t) { if (null == e) return {}; var o, r, i = _objectWithoutPropertiesLoose(e, t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(e); for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]); } return i; }\nfunction _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }\nfunction _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\"); }\nfunction _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }\nfunction _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", { writable: !1 }), e; }\nfunction _toPropertyKey(t) { var i = _toPrimitive(t, \"string\"); return \"symbol\" == _typeof(i) ? i : i + \"\"; }\nfunction _toPrimitive(t, r) { if (\"object\" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || \"default\"); if (\"object\" != _typeof(i)) return i; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (\"string\" === r ? String : Number)(t); }\nvar DocUtils = require(\"./doc-utils.js\");\nDocUtils.traits = require(\"./traits.js\");\nDocUtils.moduleWrapper = require(\"./module-wrapper.js\");\nvar commonModule = require(\"./modules/common.js\");\nvar createScope = require(\"./scope-manager.js\");\nvar Lexer = require(\"./lexer.js\");\nvar _require = require(\"./get-tags.js\"),\n  _getTags = _require.getTags;\nvar logErrors = require(\"./error-logger.js\");\nvar collectContentTypes = require(\"./collect-content-types.js\");\nvar _require2 = require(\"./errors.js\"),\n  throwMultiError = _require2.throwMultiError,\n  throwResolveBeforeCompile = _require2.throwResolveBeforeCompile,\n  throwRenderInvalidTemplate = _require2.throwRenderInvalidTemplate,\n  throwRenderTwice = _require2.throwRenderTwice,\n  XTInternalError = _require2.XTInternalError,\n  XTTemplateError = _require2.XTTemplateError,\n  throwFileTypeNotIdentified = _require2.throwFileTypeNotIdentified,\n  throwFileTypeNotHandled = _require2.throwFileTypeNotHandled,\n  throwApiVersionError = _require2.throwApiVersionError;\nvar getDefaults = DocUtils.getDefaults,\n  str2xml = DocUtils.str2xml,\n  xml2str = DocUtils.xml2str,\n  moduleWrapper = DocUtils.moduleWrapper,\n  concatArrays = DocUtils.concatArrays,\n  uniq = DocUtils.uniq,\n  getDuplicates = DocUtils.getDuplicates,\n  stableSort = DocUtils.stableSort,\n  pushArray = DocUtils.pushArray;\nvar ctXML = \"[Content_Types].xml\";\nvar relsFile = \"_rels/.rels\";\nvar currentModuleApiVersion = [3, 46, 0];\nfunction zipFileOrder(files) {\n  var allFiles = [];\n  for (var name in files) {\n    allFiles.push(name);\n  }\n  /*\n   * The first files that need to be put in the zip file are :\n   * [Content_Types].xml and _rels/.rels\n   */\n  var resultFiles = [ctXML, relsFile];\n\n  /*\n   * The next files that should be in the zip file are :\n   *\n   * - word/* (ie word/document.xml, word/header1.xml, ...)\n   * - xl/* (ie xl/worksheets/sheet1.xml)\n   * - ppt/* (ie ppt/slides/slide1.xml)\n   */\n  var prefixes = [\"word/\", \"xl/\", \"ppt/\"];\n  for (var _i2 = 0; _i2 < allFiles.length; _i2++) {\n    var _name = allFiles[_i2];\n    for (var _i4 = 0; _i4 < prefixes.length; _i4++) {\n      var prefix = prefixes[_i4];\n      if (_name.indexOf(\"\".concat(prefix)) === 0) {\n        resultFiles.push(_name);\n      }\n    }\n  }\n  /*\n   * Push the rest of files, such as docProps/core.xml and docProps/app.xml\n   */\n  for (var _i6 = 0; _i6 < allFiles.length; _i6++) {\n    var _name2 = allFiles[_i6];\n    if (resultFiles.indexOf(_name2) === -1) {\n      resultFiles.push(_name2);\n    }\n  }\n  return resultFiles;\n}\nfunction deprecatedMessage(obj, message) {\n  if (obj.hideDeprecations === true) {\n    return;\n  }\n  // eslint-disable-next-line no-console\n  console.warn(message);\n}\nfunction deprecatedMethod(obj, method) {\n  if (obj.hideDeprecations === true) {\n    return;\n  }\n  return deprecatedMessage(obj, \"Deprecated method \\\".\".concat(method, \"\\\", view upgrade guide : https://docxtemplater.com/docs/api/#upgrade-guide, stack : \").concat(new Error().stack));\n}\nfunction dropUnsupportedFileTypesModules(doc) {\n  doc.modules = doc.modules.filter(function (module) {\n    if (!module.supportedFileTypes) {\n      return true;\n    }\n    if (!Array.isArray(module.supportedFileTypes)) {\n      throw new Error(\"The supportedFileTypes field of the module must be an array\");\n    }\n    var isSupportedModule = module.supportedFileTypes.includes(doc.fileType);\n    if (!isSupportedModule) {\n      module.on(\"detached\");\n    }\n    return isSupportedModule;\n  });\n}\nfunction verifyErrors(doc) {\n  var compiled = doc.compiled;\n  doc.errors = concatArrays(Object.keys(compiled).map(function (name) {\n    return compiled[name].allErrors;\n  }));\n  if (doc.errors.length !== 0) {\n    if (doc.options.errorLogging) {\n      logErrors(doc.errors, doc.options.errorLogging);\n    }\n    throwMultiError(doc.errors);\n  }\n}\nvar Docxtemplater = /*#__PURE__*/function () {\n  function Docxtemplater(zip) {\n    var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},\n      _ref$modules = _ref.modules,\n      modules = _ref$modules === void 0 ? [] : _ref$modules,\n      options = _objectWithoutProperties(_ref, _excluded);\n    _classCallCheck(this, Docxtemplater);\n    this.targets = [];\n    this.rendered = false;\n    this.scopeManagers = {};\n    this.compiled = {};\n    this.modules = [commonModule()];\n    this.xmlDocuments = {};\n    if (arguments.length === 0) {\n      deprecatedMessage(this, \"Deprecated docxtemplater constructor with no arguments, view upgrade guide : https://docxtemplater.com/docs/api/#upgrade-guide, stack : \".concat(new Error().stack));\n      this.hideDeprecations = true;\n      this.setOptions(options);\n    } else {\n      this.hideDeprecations = true;\n      this.setOptions(options);\n      if (!zip || !zip.files || typeof zip.file !== \"function\") {\n        throw new Error(\"The first argument of docxtemplater's constructor must be a valid zip file (jszip v2 or pizzip v3)\");\n      }\n      if (!Array.isArray(modules)) {\n        throw new Error(\"The modules argument of docxtemplater's constructor must be an array\");\n      }\n      for (var _i8 = 0; _i8 < modules.length; _i8++) {\n        var _module = modules[_i8];\n        this.attachModule(_module);\n      }\n      this.loadZip(zip);\n      this.compile();\n      this.v4Constructor = true;\n    }\n    this.hideDeprecations = false;\n  }\n  return _createClass(Docxtemplater, [{\n    key: \"verifyApiVersion\",\n    value: function verifyApiVersion(neededVersion) {\n      neededVersion = neededVersion.split(\".\").map(function (i) {\n        return parseInt(i, 10);\n      });\n      if (neededVersion.length !== 3) {\n        throwApiVersionError(\"neededVersion is not a valid version\", {\n          neededVersion: neededVersion,\n          explanation: \"the neededVersion must be an array of length 3\"\n        });\n      }\n      if (neededVersion[0] !== currentModuleApiVersion[0]) {\n        throwApiVersionError(\"The major api version do not match, you probably have to update docxtemplater with npm install --save docxtemplater\", {\n          neededVersion: neededVersion,\n          currentModuleApiVersion: currentModuleApiVersion,\n          explanation: \"moduleAPIVersionMismatch : needed=\".concat(neededVersion.join(\".\"), \", current=\").concat(currentModuleApiVersion.join(\".\"))\n        });\n      }\n      if (neededVersion[1] > currentModuleApiVersion[1]) {\n        throwApiVersionError(\"The minor api version is not uptodate, you probably have to update docxtemplater with npm install --save docxtemplater\", {\n          neededVersion: neededVersion,\n          currentModuleApiVersion: currentModuleApiVersion,\n          explanation: \"moduleAPIVersionMismatch : needed=\".concat(neededVersion.join(\".\"), \", current=\").concat(currentModuleApiVersion.join(\".\"))\n        });\n      }\n      if (neededVersion[1] === currentModuleApiVersion[1] && neededVersion[2] > currentModuleApiVersion[2]) {\n        throwApiVersionError(\"The patch api version is not uptodate, you probably have to update docxtemplater with npm install --save docxtemplater\", {\n          neededVersion: neededVersion,\n          currentModuleApiVersion: currentModuleApiVersion,\n          explanation: \"moduleAPIVersionMismatch : needed=\".concat(neededVersion.join(\".\"), \", current=\").concat(currentModuleApiVersion.join(\".\"))\n        });\n      }\n      return true;\n    }\n  }, {\n    key: \"setModules\",\n    value: function setModules(obj) {\n      for (var _i10 = 0, _this$modules2 = this.modules; _i10 < _this$modules2.length; _i10++) {\n        var _module2 = _this$modules2[_i10];\n        _module2.set(obj);\n      }\n    }\n  }, {\n    key: \"sendEvent\",\n    value: function sendEvent(eventName) {\n      for (var _i12 = 0, _this$modules4 = this.modules; _i12 < _this$modules4.length; _i12++) {\n        var _module3 = _this$modules4[_i12];\n        _module3.on(eventName);\n      }\n    }\n  }, {\n    key: \"attachModule\",\n    value: function attachModule(module) {\n      if (this.v4Constructor) {\n        throw new XTInternalError(\"attachModule() should not be called manually when using the v4 constructor\");\n      }\n      deprecatedMethod(this, \"attachModule\");\n      var moduleType = _typeof(module);\n      if (moduleType === \"function\") {\n        throw new XTInternalError(\"Cannot attach a class/function as a module. Most probably you forgot to instantiate the module by using `new` on the module.\");\n      }\n      if (!module || moduleType !== \"object\") {\n        throw new XTInternalError(\"Cannot attachModule with a falsy value\");\n      }\n      if (module.requiredAPIVersion) {\n        this.verifyApiVersion(module.requiredAPIVersion);\n      }\n      if (module.attached === true) {\n        if (typeof module.clone === \"function\") {\n          module = module.clone();\n        } else {\n          throw new Error(\"Cannot attach a module that was already attached : \\\"\".concat(module.name, \"\\\". The most likely cause is that you are instantiating the module at the root level, and using it for multiple instances of Docxtemplater\"));\n        }\n      }\n      module.attached = true;\n      var wrappedModule = moduleWrapper(module);\n      this.modules.push(wrappedModule);\n      wrappedModule.on(\"attached\");\n      if (this.fileType) {\n        dropUnsupportedFileTypesModules(this);\n      }\n      return this;\n    }\n  }, {\n    key: \"setOptions\",\n    value: function setOptions(options) {\n      var _this$delimiters, _this$delimiters2;\n      if (this.v4Constructor) {\n        throw new Error(\"setOptions() should not be called manually when using the v4 constructor\");\n      }\n      deprecatedMethod(this, \"setOptions\");\n      if (!options) {\n        throw new Error(\"setOptions should be called with an object as first parameter\");\n      }\n      this.options = {};\n      var defaults = getDefaults();\n      for (var key in defaults) {\n        var defaultValue = defaults[key];\n        this.options[key] = options[key] != null ? options[key] : this[key] || defaultValue;\n        this[key] = this.options[key];\n      }\n      (_this$delimiters = this.delimiters).start && (_this$delimiters.start = DocUtils.utf8ToWord(this.delimiters.start));\n      (_this$delimiters2 = this.delimiters).end && (_this$delimiters2.end = DocUtils.utf8ToWord(this.delimiters.end));\n      return this;\n    }\n  }, {\n    key: \"loadZip\",\n    value: function loadZip(zip) {\n      if (this.v4Constructor) {\n        throw new Error(\"loadZip() should not be called manually when using the v4 constructor\");\n      }\n      deprecatedMethod(this, \"loadZip\");\n      if (zip.loadAsync) {\n        throw new XTInternalError(\"Docxtemplater doesn't handle JSZip version >=3, please use pizzip\");\n      }\n      this.zip = zip;\n      this.updateFileTypeConfig();\n      this.modules = concatArrays([this.fileTypeConfig.baseModules.map(function (moduleFunction) {\n        return moduleFunction();\n      }), this.modules]);\n      for (var _i14 = 0, _this$modules6 = this.modules; _i14 < _this$modules6.length; _i14++) {\n        var _module4 = _this$modules6[_i14];\n        _module4.zip = this.zip;\n        _module4.docxtemplater = this;\n      }\n      dropUnsupportedFileTypesModules(this);\n      return this;\n    }\n  }, {\n    key: \"precompileFile\",\n    value: function precompileFile(fileName) {\n      var currentFile = this.createTemplateClass(fileName);\n      currentFile.preparse();\n      this.compiled[fileName] = currentFile;\n    }\n  }, {\n    key: \"compileFile\",\n    value: function compileFile(fileName) {\n      this.compiled[fileName].parse();\n    }\n  }, {\n    key: \"getScopeManager\",\n    value: function getScopeManager(to, currentFile, tags) {\n      var _this$scopeManagers;\n      (_this$scopeManagers = this.scopeManagers)[to] || (_this$scopeManagers[to] = createScope({\n        tags: tags,\n        parser: this.parser,\n        cachedParsers: currentFile.cachedParsers\n      }));\n      return this.scopeManagers[to];\n    }\n  }, {\n    key: \"resolveData\",\n    value: function resolveData(data) {\n      var _this = this;\n      deprecatedMethod(this, \"resolveData\");\n      var errors = [];\n      if (!Object.keys(this.compiled).length) {\n        throwResolveBeforeCompile();\n      }\n      return Promise.resolve(data).then(function (data) {\n        _this.data = data;\n        _this.setModules({\n          data: _this.data,\n          Lexer: Lexer\n        });\n        _this.mapper = _this.modules.reduce(function (value, module) {\n          return module.getRenderedMap(value);\n        }, {});\n        return Promise.all(Object.keys(_this.mapper).map(function (to) {\n          var _this$mapper$to = _this.mapper[to],\n            from = _this$mapper$to.from,\n            data = _this$mapper$to.data;\n          return Promise.resolve(data).then(function (data) {\n            var currentFile = _this.compiled[from];\n            currentFile.filePath = to;\n            currentFile.scopeManager = _this.getScopeManager(to, currentFile, data);\n            return currentFile.resolveTags(data).then(function (result) {\n              currentFile.scopeManager.finishedResolving = true;\n              return result;\n            }, function (errs) {\n              pushArray(errors, errs);\n            });\n          });\n        })).then(function (resolved) {\n          if (errors.length !== 0) {\n            if (_this.options.errorLogging) {\n              logErrors(errors, _this.options.errorLogging);\n            }\n            throwMultiError(errors);\n          }\n          return concatArrays(resolved);\n        });\n      });\n    }\n  }, {\n    key: \"reorderModules\",\n    value: function reorderModules() {\n      /**\n       * Modules will be sorted according to priority.\n       *\n       * Input example:\n       * [\n       *   { priority: 1, name: \"FooMod\" },\n       *   { priority: -1, name: \"XMod\" },\n       *   { priority: 4, name: \"OtherMod\" }\n       * ]\n       *\n       * Output example (sorted by priority in descending order):\n       * [\n       *   { priority: 4, name: \"OtherMod\" },\n       *   { priority: 1, name: \"FooMod\" },\n       *   { priority: -1, name: \"XMod\" }\n       * ]\n       * Tested in #test-reorder-modules\n       */\n      this.modules = stableSort(this.modules, function (m1, m2) {\n        return (m2.priority || 0) - (m1.priority || 0);\n      });\n    }\n  }, {\n    key: \"throwIfDuplicateModules\",\n    value: function throwIfDuplicateModules() {\n      var duplicates = getDuplicates(this.modules.map(function (_ref2) {\n        var name = _ref2.name;\n        return name;\n      }));\n      if (duplicates.length > 0) {\n        throw new XTInternalError(\"Detected duplicate module \\\"\".concat(duplicates[0], \"\\\"\"));\n      }\n    }\n  }, {\n    key: \"compile\",\n    value: function compile() {\n      var _this2 = this;\n      deprecatedMethod(this, \"compile\");\n      this.updateFileTypeConfig();\n      this.throwIfDuplicateModules();\n      this.reorderModules();\n      if (Object.keys(this.compiled).length) {\n        return this;\n      }\n      this.options = this.modules.reduce(function (options, module) {\n        return module.optionsTransformer(options, _this2);\n      }, this.options);\n      this.options.xmlFileNames = uniq(this.options.xmlFileNames);\n      for (var _i16 = 0, _this$options$xmlFile2 = this.options.xmlFileNames; _i16 < _this$options$xmlFile2.length; _i16++) {\n        var fileName = _this$options$xmlFile2[_i16];\n        var content = this.zip.files[fileName].asText();\n        this.xmlDocuments[fileName] = str2xml(content);\n      }\n      this.setModules({\n        zip: this.zip,\n        xmlDocuments: this.xmlDocuments\n      });\n      this.getTemplatedFiles();\n      /*\n       * Loop inside all templatedFiles (ie xml files with content).\n       * Sometimes they don't exist (footer.xml for example)\n       */\n      this.sendEvent(\"before-preparse\");\n      for (var _i18 = 0, _this$templatedFiles2 = this.templatedFiles; _i18 < _this$templatedFiles2.length; _i18++) {\n        var _fileName = _this$templatedFiles2[_i18];\n        if (this.zip.files[_fileName] != null) {\n          this.precompileFile(_fileName);\n        }\n      }\n      this.sendEvent(\"after-preparse\");\n      for (var _i20 = 0, _this$templatedFiles4 = this.templatedFiles; _i20 < _this$templatedFiles4.length; _i20++) {\n        var _fileName2 = _this$templatedFiles4[_i20];\n        if (this.zip.files[_fileName2] != null) {\n          this.compiled[_fileName2].parse({\n            noPostParse: true\n          });\n        }\n      }\n      this.sendEvent(\"after-parse\");\n      for (var _i22 = 0, _this$templatedFiles6 = this.templatedFiles; _i22 < _this$templatedFiles6.length; _i22++) {\n        var _fileName3 = _this$templatedFiles6[_i22];\n        if (this.zip.files[_fileName3] != null) {\n          this.compiled[_fileName3].postparse();\n        }\n      }\n      this.sendEvent(\"after-postparse\");\n      this.setModules({\n        compiled: this.compiled\n      });\n      verifyErrors(this);\n      return this;\n    }\n  }, {\n    key: \"getRelsTypes\",\n    value: function getRelsTypes() {\n      var rootRels = this.zip.files[relsFile];\n      var rootRelsXml = rootRels ? str2xml(rootRels.asText()) : null;\n      var rootRelationships = rootRelsXml ? rootRelsXml.getElementsByTagName(\"Relationship\") : [];\n      var relsTypes = {};\n      for (var _i24 = 0; _i24 < rootRelationships.length; _i24++) {\n        var relation = rootRelationships[_i24];\n        relsTypes[relation.getAttribute(\"Target\")] = relation.getAttribute(\"Type\");\n      }\n      return relsTypes;\n    }\n  }, {\n    key: \"getContentTypes\",\n    value: function getContentTypes() {\n      var contentTypes = this.zip.files[ctXML];\n      var contentTypeXml = contentTypes ? str2xml(contentTypes.asText()) : null;\n      var overrides = contentTypeXml ? contentTypeXml.getElementsByTagName(\"Override\") : null;\n      var defaults = contentTypeXml ? contentTypeXml.getElementsByTagName(\"Default\") : null;\n      return {\n        overrides: overrides,\n        defaults: defaults,\n        contentTypes: contentTypes,\n        contentTypeXml: contentTypeXml\n      };\n    }\n  }, {\n    key: \"updateFileTypeConfig\",\n    value: function updateFileTypeConfig() {\n      this.relsTypes = this.getRelsTypes();\n      var _this$getContentTypes = this.getContentTypes(),\n        overrides = _this$getContentTypes.overrides,\n        defaults = _this$getContentTypes.defaults,\n        contentTypes = _this$getContentTypes.contentTypes,\n        contentTypeXml = _this$getContentTypes.contentTypeXml;\n      if (contentTypeXml) {\n        this.filesContentTypes = collectContentTypes(overrides, defaults, this.zip);\n        this.invertedContentTypes = DocUtils.invertMap(this.filesContentTypes);\n        this.setModules({\n          contentTypes: this.contentTypes,\n          invertedContentTypes: this.invertedContentTypes\n        });\n      }\n      var fileType;\n      if (this.zip.files.mimetype) {\n        fileType = \"odt\";\n      }\n      for (var _i26 = 0, _this$modules8 = this.modules; _i26 < _this$modules8.length; _i26++) {\n        var _module5 = _this$modules8[_i26];\n        fileType = _module5.getFileType({\n          zip: this.zip,\n          contentTypes: contentTypes,\n          contentTypeXml: contentTypeXml,\n          overrides: overrides,\n          defaults: defaults,\n          doc: this\n        }) || fileType;\n      }\n      if (fileType === \"odt\") {\n        throwFileTypeNotHandled(fileType);\n      }\n      if (!fileType) {\n        throwFileTypeNotIdentified(this.zip);\n      }\n      for (var _i28 = 0, _this$modules10 = this.modules; _i28 < _this$modules10.length; _i28++) {\n        var _module6 = _this$modules10[_i28];\n        for (var _i30 = 0, _ref4 = _module6.xmlContentTypes || []; _i30 < _ref4.length; _i30++) {\n          var contentType = _ref4[_i30];\n          pushArray(this.options.xmlFileNames, this.invertedContentTypes[contentType] || []);\n        }\n      }\n      this.fileType = fileType;\n      dropUnsupportedFileTypesModules(this);\n      this.fileTypeConfig = this.options.fileTypeConfig || this.fileTypeConfig;\n      if (!this.fileTypeConfig) {\n        if (Docxtemplater.FileTypeConfig[this.fileType]) {\n          this.fileTypeConfig = Docxtemplater.FileTypeConfig[this.fileType]();\n        } else {\n          /*\n           * Error case handled since v3.60.2\n           * Throw specific error when trying to template xlsx file without xlsxmodule\n           */\n          var message = \"Filetype \\\"\".concat(this.fileType, \"\\\" is not supported\");\n          var id = \"filetype_not_supported\";\n          if (this.fileType === \"xlsx\") {\n            message = \"Filetype \\\"\".concat(this.fileType, \"\\\" is supported only with the paid XlsxModule\");\n            id = \"xlsx_filetype_needs_xlsx_module\";\n          }\n          var err = new XTTemplateError(message);\n          err.properties = {\n            id: id,\n            explanation: message\n          };\n          throw err;\n        }\n      }\n      return this;\n    }\n  }, {\n    key: \"renderAsync\",\n    value: function renderAsync(data) {\n      var _this3 = this;\n      this.hideDeprecations = true;\n      var promise = this.resolveData(data);\n      this.hideDeprecations = false;\n      return promise.then(function () {\n        return _this3.render();\n      });\n    }\n  }, {\n    key: \"render\",\n    value: function render(data) {\n      if (this.rendered) {\n        throwRenderTwice();\n      }\n      this.rendered = true;\n      if (Object.keys(this.compiled).length === 0) {\n        this.compile();\n      }\n      if (this.errors.length > 0) {\n        throwRenderInvalidTemplate();\n      }\n      if (arguments.length > 0) {\n        this.data = data;\n      }\n      this.setModules({\n        data: this.data,\n        Lexer: Lexer\n      });\n      this.mapper || (this.mapper = this.modules.reduce(function (value, module) {\n        return module.getRenderedMap(value);\n      }, {}));\n      var output = [];\n      for (var to in this.mapper) {\n        var _this$mapper$to2 = this.mapper[to],\n          from = _this$mapper$to2.from,\n          _data = _this$mapper$to2.data;\n        var currentFile = this.compiled[from];\n        currentFile.scopeManager = this.getScopeManager(to, currentFile, _data);\n        currentFile.render(to);\n        output.push([to, currentFile.content, currentFile]);\n        delete currentFile.content;\n      }\n      for (var _i32 = 0; _i32 < output.length; _i32++) {\n        var outputPart = output[_i32];\n        var _outputPart = _slicedToArray(outputPart, 3),\n          content = _outputPart[1],\n          _currentFile = _outputPart[2];\n        for (var _i34 = 0, _this$modules12 = this.modules; _i34 < _this$modules12.length; _i34++) {\n          var _module7 = _this$modules12[_i34];\n          if (_module7.preZip) {\n            var result = _module7.preZip(content, _currentFile);\n            if (typeof result === \"string\") {\n              outputPart[1] = result;\n            }\n          }\n        }\n      }\n      for (var _i36 = 0; _i36 < output.length; _i36++) {\n        var _output$_i = _slicedToArray(output[_i36], 2),\n          _to = _output$_i[0],\n          _content = _output$_i[1];\n        this.zip.file(_to, _content, {\n          createFolders: true\n        });\n      }\n      verifyErrors(this);\n      this.sendEvent(\"syncing-zip\");\n      this.syncZip();\n      // The synced-zip event is used in the subtemplate module for example\n      this.sendEvent(\"synced-zip\");\n      return this;\n    }\n  }, {\n    key: \"syncZip\",\n    value: function syncZip() {\n      for (var fileName in this.xmlDocuments) {\n        this.zip.remove(fileName);\n        var content = xml2str(this.xmlDocuments[fileName]);\n        this.zip.file(fileName, content, {\n          createFolders: true\n        });\n      }\n    }\n  }, {\n    key: \"setData\",\n    value: function setData(data) {\n      deprecatedMethod(this, \"setData\");\n      this.data = data;\n      return this;\n    }\n  }, {\n    key: \"getZip\",\n    value: function getZip() {\n      return this.zip;\n    }\n  }, {\n    key: \"createTemplateClass\",\n    value: function createTemplateClass(path) {\n      var content = this.zip.files[path].asText();\n      return this.createTemplateClassFromContent(content, path);\n    }\n  }, {\n    key: \"createTemplateClassFromContent\",\n    value: function createTemplateClassFromContent(content, filePath) {\n      var xmltOptions = {\n        filePath: filePath,\n        contentType: this.filesContentTypes[filePath],\n        relsType: this.relsTypes[filePath]\n      };\n      var defaults = getDefaults();\n      var defaultKeys = pushArray(Object.keys(defaults), [\"filesContentTypes\", \"fileTypeConfig\", \"fileType\", \"modules\"]);\n      for (var _i38 = 0; _i38 < defaultKeys.length; _i38++) {\n        var key = defaultKeys[_i38];\n        xmltOptions[key] = this[key];\n      }\n      return new Docxtemplater.XmlTemplater(content, xmltOptions);\n    }\n  }, {\n    key: \"getFullText\",\n    value: function getFullText(path) {\n      return this.createTemplateClass(path || this.fileTypeConfig.textPath(this)).getFullText();\n    }\n  }, {\n    key: \"getTemplatedFiles\",\n    value: function getTemplatedFiles() {\n      this.templatedFiles = this.fileTypeConfig.getTemplatedFiles(this.zip);\n      pushArray(this.templatedFiles, this.targets);\n      this.templatedFiles = uniq(this.templatedFiles);\n      return this.templatedFiles;\n    }\n  }, {\n    key: \"getTags\",\n    value: function getTags() {\n      var result = {\n        headers: [],\n        footers: []\n      };\n      for (var key in this.compiled) {\n        var contentType = this.filesContentTypes[key];\n        if (contentType === \"application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml\") {\n          result.document = {\n            target: key,\n            tags: _getTags(this.compiled[key].postparsed)\n          };\n        }\n        if (contentType === \"application/vnd.openxmlformats-officedocument.wordprocessingml.header+xml\") {\n          result.headers.push({\n            target: key,\n            tags: _getTags(this.compiled[key].postparsed)\n          });\n        }\n        if (contentType === \"application/vnd.openxmlformats-officedocument.wordprocessingml.footer+xml\") {\n          result.footers.push({\n            target: key,\n            tags: _getTags(this.compiled[key].postparsed)\n          });\n        }\n      }\n      return result;\n    }\n\n    /* Export functions, present since 3.62.0 */\n  }, {\n    key: \"toBuffer\",\n    value: function toBuffer(options) {\n      return this.getZip().generate(_objectSpread(_objectSpread({\n        compression: \"DEFLATE\",\n        fileOrder: zipFileOrder\n      }, options), {}, {\n        type: \"nodebuffer\"\n      }));\n    }\n  }, {\n    key: \"toBlob\",\n    value: function toBlob(options) {\n      return this.getZip().generate(_objectSpread(_objectSpread({\n        compression: \"DEFLATE\",\n        fileOrder: zipFileOrder\n      }, options), {}, {\n        type: \"blob\"\n      }));\n    }\n  }, {\n    key: \"toBase64\",\n    value: function toBase64(options) {\n      return this.getZip().generate(_objectSpread(_objectSpread({\n        compression: \"DEFLATE\",\n        fileOrder: zipFileOrder\n      }, options), {}, {\n        type: \"base64\"\n      }));\n    }\n  }, {\n    key: \"toUint8Array\",\n    value: function toUint8Array(options) {\n      return this.getZip().generate(_objectSpread(_objectSpread({\n        compression: \"DEFLATE\",\n        fileOrder: zipFileOrder\n      }, options), {}, {\n        type: \"uint8array\"\n      }));\n    }\n  }, {\n    key: \"toArrayBuffer\",\n    value: function toArrayBuffer(options) {\n      return this.getZip().generate(_objectSpread(_objectSpread({\n        compression: \"DEFLATE\",\n        fileOrder: zipFileOrder\n      }, options), {}, {\n        type: \"arraybuffer\"\n      }));\n    }\n  }]);\n}();\nDocxtemplater.DocUtils = DocUtils;\nDocxtemplater.Errors = require(\"./errors.js\");\nDocxtemplater.XmlTemplater = require(\"./xml-templater.js\");\nDocxtemplater.FileTypeConfig = require(\"./file-type-config.js\");\nDocxtemplater.XmlMatcher = require(\"./xml-matcher.js\");\nmodule.exports = Docxtemplater;\nmodule.exports[\"default\"] = Docxtemplater;"]}