Skip to content
Snippets Groups Projects
index.js 7.35 MiB
Newer Older
  • Learn to ignore specific revisions
  • Hugo NOUTS's avatar
    Hugo NOUTS committed
    
        return XMLDocument;
    
      })(XMLNode);
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1509 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var XMLDOMConfiguration, XMLDOMErrorHandler, XMLDOMStringList;
    
    
    build-token's avatar
    build-token committed
      XMLDOMErrorHandler = __webpack_require__(1510);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLDOMStringList = __webpack_require__(1511);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
      module.exports = XMLDOMConfiguration = (function() {
        function XMLDOMConfiguration() {
          var clonedSelf;
          this.defaultParams = {
            "canonical-form": false,
            "cdata-sections": false,
            "comments": false,
            "datatype-normalization": false,
            "element-content-whitespace": true,
            "entities": true,
            "error-handler": new XMLDOMErrorHandler(),
            "infoset": true,
            "validate-if-schema": false,
            "namespaces": true,
            "namespace-declarations": true,
            "normalize-characters": false,
            "schema-location": '',
            "schema-type": '',
            "split-cdata-sections": true,
            "validate": false,
            "well-formed": true
          };
          this.params = clonedSelf = Object.create(this.defaultParams);
        }
    
        Object.defineProperty(XMLDOMConfiguration.prototype, 'parameterNames', {
          get: function() {
            return new XMLDOMStringList(Object.keys(this.defaultParams));
          }
        });
    
        XMLDOMConfiguration.prototype.getParameter = function(name) {
          if (this.params.hasOwnProperty(name)) {
            return this.params[name];
          } else {
            return null;
          }
        };
    
        XMLDOMConfiguration.prototype.canSetParameter = function(name, value) {
          return true;
        };
    
        XMLDOMConfiguration.prototype.setParameter = function(name, value) {
          if (value != null) {
            return this.params[name] = value;
          } else {
            return delete this.params[name];
          }
        };
    
        return XMLDOMConfiguration;
    
      })();
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1510 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var XMLDOMErrorHandler;
    
      module.exports = XMLDOMErrorHandler = (function() {
        function XMLDOMErrorHandler() {}
    
        XMLDOMErrorHandler.prototype.handleError = function(error) {
          throw new Error(error);
        };
    
        return XMLDOMErrorHandler;
    
      })();
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1511 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var XMLDOMStringList;
    
      module.exports = XMLDOMStringList = (function() {
        function XMLDOMStringList(arr) {
          this.arr = arr || [];
        }
    
        Object.defineProperty(XMLDOMStringList.prototype, 'length', {
          get: function() {
            return this.arr.length;
          }
        });
    
        XMLDOMStringList.prototype.item = function(index) {
          return this.arr[index] || null;
        };
    
        XMLDOMStringList.prototype.contains = function(str) {
          return this.arr.indexOf(str) !== -1;
        };
    
        return XMLDOMStringList;
    
      })();
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1512 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var DocumentPosition, NodeType, XMLCData, XMLComment, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLNamedNodeMap, XMLNode, XMLNodeList, XMLProcessingInstruction, XMLRaw, XMLText, getValue, isEmpty, isFunction, isObject, ref1,
        hasProp = {}.hasOwnProperty;
    
    
    build-token's avatar
    build-token committed
      ref1 = __webpack_require__(1506), isObject = ref1.isObject, isFunction = ref1.isFunction, isEmpty = ref1.isEmpty, getValue = ref1.getValue;
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
      XMLElement = null;
    
      XMLCData = null;
    
      XMLComment = null;
    
      XMLDeclaration = null;
    
      XMLDocType = null;
    
      XMLRaw = null;
    
      XMLText = null;
    
      XMLProcessingInstruction = null;
    
      XMLDummy = null;
    
      NodeType = null;
    
      XMLNodeList = null;
    
      XMLNamedNodeMap = null;
    
      DocumentPosition = null;
    
      module.exports = XMLNode = (function() {
        function XMLNode(parent1) {
          this.parent = parent1;
          if (this.parent) {
            this.options = this.parent.options;
            this.stringify = this.parent.stringify;
          }
          this.value = null;
          this.children = [];
          this.baseURI = null;
          if (!XMLElement) {
    
    build-token's avatar
    build-token committed
            XMLElement = __webpack_require__(1513);
            XMLCData = __webpack_require__(1517);
            XMLComment = __webpack_require__(1519);
            XMLDeclaration = __webpack_require__(1520);
            XMLDocType = __webpack_require__(1521);
            XMLRaw = __webpack_require__(1526);
            XMLText = __webpack_require__(1527);
            XMLProcessingInstruction = __webpack_require__(1528);
            XMLDummy = __webpack_require__(1529);
            NodeType = __webpack_require__(1514);
            XMLNodeList = __webpack_require__(1530);
            XMLNamedNodeMap = __webpack_require__(1516);
            DocumentPosition = __webpack_require__(1531);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    215196 215197 215198 215199 215200 215201 215202 215203 215204 215205 215206 215207 215208 215209 215210 215211 215212 215213 215214 215215 215216 215217 215218 215219 215220 215221 215222 215223 215224 215225 215226 215227 215228 215229 215230 215231 215232 215233 215234 215235 215236 215237 215238 215239 215240 215241 215242 215243 215244 215245 215246 215247 215248 215249 215250 215251 215252 215253 215254 215255 215256 215257 215258 215259 215260 215261 215262 215263 215264 215265 215266 215267 215268 215269 215270 215271 215272 215273 215274 215275 215276 215277 215278 215279 215280 215281 215282 215283 215284 215285 215286 215287 215288 215289 215290 215291 215292 215293 215294 215295 215296 215297 215298 215299 215300 215301 215302 215303 215304 215305 215306 215307 215308 215309 215310 215311 215312 215313 215314 215315 215316 215317 215318 215319 215320 215321 215322 215323 215324 215325 215326 215327 215328 215329 215330 215331 215332 215333 215334 215335 215336 215337 215338 215339 215340 215341 215342 215343 215344 215345 215346 215347 215348 215349 215350 215351 215352 215353 215354 215355 215356 215357 215358 215359 215360 215361 215362 215363 215364 215365 215366 215367 215368 215369 215370 215371 215372 215373 215374 215375 215376 215377 215378 215379 215380 215381 215382 215383 215384 215385 215386 215387 215388 215389 215390 215391 215392 215393 215394 215395 215396 215397 215398 215399 215400 215401 215402 215403 215404 215405 215406 215407 215408 215409 215410 215411 215412 215413 215414 215415 215416 215417 215418 215419 215420 215421 215422 215423 215424 215425 215426 215427 215428 215429 215430 215431 215432 215433 215434 215435 215436 215437 215438 215439 215440 215441 215442 215443 215444 215445 215446 215447 215448 215449 215450 215451 215452 215453 215454 215455 215456 215457 215458 215459 215460 215461 215462 215463 215464 215465 215466 215467 215468 215469 215470 215471 215472 215473 215474 215475 215476 215477 215478 215479 215480 215481 215482 215483 215484 215485 215486 215487 215488 215489 215490 215491 215492 215493 215494 215495 215496 215497 215498 215499 215500 215501 215502 215503 215504 215505 215506 215507 215508 215509 215510 215511 215512 215513 215514 215515 215516 215517 215518 215519 215520 215521 215522 215523 215524 215525 215526 215527 215528 215529 215530 215531 215532 215533 215534 215535 215536 215537 215538 215539 215540 215541 215542 215543 215544 215545 215546 215547 215548 215549 215550 215551 215552 215553 215554 215555 215556 215557 215558 215559 215560 215561 215562 215563 215564 215565 215566 215567 215568 215569 215570 215571 215572 215573 215574 215575 215576 215577 215578 215579 215580 215581 215582 215583 215584 215585 215586 215587 215588 215589 215590 215591 215592 215593 215594 215595 215596 215597 215598 215599 215600 215601 215602 215603 215604 215605 215606 215607 215608 215609 215610 215611 215612 215613 215614 215615 215616 215617 215618 215619 215620 215621 215622 215623 215624 215625 215626 215627 215628 215629 215630 215631 215632 215633 215634 215635 215636 215637 215638 215639 215640 215641 215642 215643 215644 215645 215646 215647 215648 215649 215650 215651 215652 215653 215654 215655 215656 215657 215658 215659 215660 215661 215662 215663 215664 215665 215666 215667 215668 215669 215670 215671 215672 215673 215674 215675 215676 215677 215678 215679 215680 215681 215682 215683 215684 215685 215686 215687 215688 215689 215690 215691 215692 215693 215694 215695 215696 215697 215698 215699 215700 215701 215702 215703 215704 215705 215706 215707 215708 215709 215710 215711 215712 215713 215714 215715 215716 215717 215718 215719 215720 215721 215722 215723 215724 215725 215726 215727 215728 215729 215730 215731 215732 215733 215734 215735 215736 215737 215738 215739 215740 215741 215742 215743 215744 215745 215746 215747 215748 215749 215750 215751 215752 215753 215754 215755 215756 215757 215758 215759 215760 215761 215762 215763 215764 215765 215766 215767 215768 215769 215770 215771 215772 215773 215774 215775 215776 215777 215778 215779 215780 215781 215782 215783 215784 215785 215786 215787 215788 215789 215790 215791 215792 215793 215794 215795 215796 215797 215798 215799 215800 215801 215802 215803 215804 215805 215806 215807 215808 215809 215810 215811 215812 215813 215814 215815 215816 215817 215818 215819 215820 215821 215822 215823 215824 215825 215826 215827 215828 215829 215830 215831 215832 215833 215834 215835 215836 215837 215838 215839 215840 215841 215842 215843 215844 215845 215846 215847 215848 215849 215850 215851 215852 215853 215854 215855 215856 215857 215858 215859 215860 215861 215862 215863 215864 215865 215866 215867 215868 215869 215870 215871 215872 215873 215874 215875 215876 215877 215878 215879 215880 215881 215882 215883 215884 215885 215886 215887 215888 215889 215890 215891 215892 215893 215894 215895 215896 215897 215898 215899 215900 215901 215902 215903 215904 215905 215906 215907 215908 215909 215910 215911 215912 215913 215914 215915 215916 215917 215918 215919 215920 215921 215922 215923 215924 215925 215926
          }
        }
    
        Object.defineProperty(XMLNode.prototype, 'nodeName', {
          get: function() {
            return this.name;
          }
        });
    
        Object.defineProperty(XMLNode.prototype, 'nodeType', {
          get: function() {
            return this.type;
          }
        });
    
        Object.defineProperty(XMLNode.prototype, 'nodeValue', {
          get: function() {
            return this.value;
          }
        });
    
        Object.defineProperty(XMLNode.prototype, 'parentNode', {
          get: function() {
            return this.parent;
          }
        });
    
        Object.defineProperty(XMLNode.prototype, 'childNodes', {
          get: function() {
            if (!this.childNodeList || !this.childNodeList.nodes) {
              this.childNodeList = new XMLNodeList(this.children);
            }
            return this.childNodeList;
          }
        });
    
        Object.defineProperty(XMLNode.prototype, 'firstChild', {
          get: function() {
            return this.children[0] || null;
          }
        });
    
        Object.defineProperty(XMLNode.prototype, 'lastChild', {
          get: function() {
            return this.children[this.children.length - 1] || null;
          }
        });
    
        Object.defineProperty(XMLNode.prototype, 'previousSibling', {
          get: function() {
            var i;
            i = this.parent.children.indexOf(this);
            return this.parent.children[i - 1] || null;
          }
        });
    
        Object.defineProperty(XMLNode.prototype, 'nextSibling', {
          get: function() {
            var i;
            i = this.parent.children.indexOf(this);
            return this.parent.children[i + 1] || null;
          }
        });
    
        Object.defineProperty(XMLNode.prototype, 'ownerDocument', {
          get: function() {
            return this.document() || null;
          }
        });
    
        Object.defineProperty(XMLNode.prototype, 'textContent', {
          get: function() {
            var child, j, len, ref2, str;
            if (this.nodeType === NodeType.Element || this.nodeType === NodeType.DocumentFragment) {
              str = '';
              ref2 = this.children;
              for (j = 0, len = ref2.length; j < len; j++) {
                child = ref2[j];
                if (child.textContent) {
                  str += child.textContent;
                }
              }
              return str;
            } else {
              return null;
            }
          },
          set: function(value) {
            throw new Error("This DOM method is not implemented." + this.debugInfo());
          }
        });
    
        XMLNode.prototype.setParent = function(parent) {
          var child, j, len, ref2, results;
          this.parent = parent;
          if (parent) {
            this.options = parent.options;
            this.stringify = parent.stringify;
          }
          ref2 = this.children;
          results = [];
          for (j = 0, len = ref2.length; j < len; j++) {
            child = ref2[j];
            results.push(child.setParent(this));
          }
          return results;
        };
    
        XMLNode.prototype.element = function(name, attributes, text) {
          var childNode, item, j, k, key, lastChild, len, len1, ref2, ref3, val;
          lastChild = null;
          if (attributes === null && (text == null)) {
            ref2 = [{}, null], attributes = ref2[0], text = ref2[1];
          }
          if (attributes == null) {
            attributes = {};
          }
          attributes = getValue(attributes);
          if (!isObject(attributes)) {
            ref3 = [attributes, text], text = ref3[0], attributes = ref3[1];
          }
          if (name != null) {
            name = getValue(name);
          }
          if (Array.isArray(name)) {
            for (j = 0, len = name.length; j < len; j++) {
              item = name[j];
              lastChild = this.element(item);
            }
          } else if (isFunction(name)) {
            lastChild = this.element(name.apply());
          } else if (isObject(name)) {
            for (key in name) {
              if (!hasProp.call(name, key)) continue;
              val = name[key];
              if (isFunction(val)) {
                val = val.apply();
              }
              if (!this.options.ignoreDecorators && this.stringify.convertAttKey && key.indexOf(this.stringify.convertAttKey) === 0) {
                lastChild = this.attribute(key.substr(this.stringify.convertAttKey.length), val);
              } else if (!this.options.separateArrayItems && Array.isArray(val) && isEmpty(val)) {
                lastChild = this.dummy();
              } else if (isObject(val) && isEmpty(val)) {
                lastChild = this.element(key);
              } else if (!this.options.keepNullNodes && (val == null)) {
                lastChild = this.dummy();
              } else if (!this.options.separateArrayItems && Array.isArray(val)) {
                for (k = 0, len1 = val.length; k < len1; k++) {
                  item = val[k];
                  childNode = {};
                  childNode[key] = item;
                  lastChild = this.element(childNode);
                }
              } else if (isObject(val)) {
                if (!this.options.ignoreDecorators && this.stringify.convertTextKey && key.indexOf(this.stringify.convertTextKey) === 0) {
                  lastChild = this.element(val);
                } else {
                  lastChild = this.element(key);
                  lastChild.element(val);
                }
              } else {
                lastChild = this.element(key, val);
              }
            }
          } else if (!this.options.keepNullNodes && text === null) {
            lastChild = this.dummy();
          } else {
            if (!this.options.ignoreDecorators && this.stringify.convertTextKey && name.indexOf(this.stringify.convertTextKey) === 0) {
              lastChild = this.text(text);
            } else if (!this.options.ignoreDecorators && this.stringify.convertCDataKey && name.indexOf(this.stringify.convertCDataKey) === 0) {
              lastChild = this.cdata(text);
            } else if (!this.options.ignoreDecorators && this.stringify.convertCommentKey && name.indexOf(this.stringify.convertCommentKey) === 0) {
              lastChild = this.comment(text);
            } else if (!this.options.ignoreDecorators && this.stringify.convertRawKey && name.indexOf(this.stringify.convertRawKey) === 0) {
              lastChild = this.raw(text);
            } else if (!this.options.ignoreDecorators && this.stringify.convertPIKey && name.indexOf(this.stringify.convertPIKey) === 0) {
              lastChild = this.instruction(name.substr(this.stringify.convertPIKey.length), text);
            } else {
              lastChild = this.node(name, attributes, text);
            }
          }
          if (lastChild == null) {
            throw new Error("Could not create any elements with: " + name + ". " + this.debugInfo());
          }
          return lastChild;
        };
    
        XMLNode.prototype.insertBefore = function(name, attributes, text) {
          var child, i, newChild, refChild, removed;
          if (name != null ? name.type : void 0) {
            newChild = name;
            refChild = attributes;
            newChild.setParent(this);
            if (refChild) {
              i = children.indexOf(refChild);
              removed = children.splice(i);
              children.push(newChild);
              Array.prototype.push.apply(children, removed);
            } else {
              children.push(newChild);
            }
            return newChild;
          } else {
            if (this.isRoot) {
              throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
            }
            i = this.parent.children.indexOf(this);
            removed = this.parent.children.splice(i);
            child = this.parent.element(name, attributes, text);
            Array.prototype.push.apply(this.parent.children, removed);
            return child;
          }
        };
    
        XMLNode.prototype.insertAfter = function(name, attributes, text) {
          var child, i, removed;
          if (this.isRoot) {
            throw new Error("Cannot insert elements at root level. " + this.debugInfo(name));
          }
          i = this.parent.children.indexOf(this);
          removed = this.parent.children.splice(i + 1);
          child = this.parent.element(name, attributes, text);
          Array.prototype.push.apply(this.parent.children, removed);
          return child;
        };
    
        XMLNode.prototype.remove = function() {
          var i, ref2;
          if (this.isRoot) {
            throw new Error("Cannot remove the root element. " + this.debugInfo());
          }
          i = this.parent.children.indexOf(this);
          [].splice.apply(this.parent.children, [i, i - i + 1].concat(ref2 = [])), ref2;
          return this.parent;
        };
    
        XMLNode.prototype.node = function(name, attributes, text) {
          var child, ref2;
          if (name != null) {
            name = getValue(name);
          }
          attributes || (attributes = {});
          attributes = getValue(attributes);
          if (!isObject(attributes)) {
            ref2 = [attributes, text], text = ref2[0], attributes = ref2[1];
          }
          child = new XMLElement(this, name, attributes);
          if (text != null) {
            child.text(text);
          }
          this.children.push(child);
          return child;
        };
    
        XMLNode.prototype.text = function(value) {
          var child;
          if (isObject(value)) {
            this.element(value);
          }
          child = new XMLText(this, value);
          this.children.push(child);
          return this;
        };
    
        XMLNode.prototype.cdata = function(value) {
          var child;
          child = new XMLCData(this, value);
          this.children.push(child);
          return this;
        };
    
        XMLNode.prototype.comment = function(value) {
          var child;
          child = new XMLComment(this, value);
          this.children.push(child);
          return this;
        };
    
        XMLNode.prototype.commentBefore = function(value) {
          var child, i, removed;
          i = this.parent.children.indexOf(this);
          removed = this.parent.children.splice(i);
          child = this.parent.comment(value);
          Array.prototype.push.apply(this.parent.children, removed);
          return this;
        };
    
        XMLNode.prototype.commentAfter = function(value) {
          var child, i, removed;
          i = this.parent.children.indexOf(this);
          removed = this.parent.children.splice(i + 1);
          child = this.parent.comment(value);
          Array.prototype.push.apply(this.parent.children, removed);
          return this;
        };
    
        XMLNode.prototype.raw = function(value) {
          var child;
          child = new XMLRaw(this, value);
          this.children.push(child);
          return this;
        };
    
        XMLNode.prototype.dummy = function() {
          var child;
          child = new XMLDummy(this);
          return child;
        };
    
        XMLNode.prototype.instruction = function(target, value) {
          var insTarget, insValue, instruction, j, len;
          if (target != null) {
            target = getValue(target);
          }
          if (value != null) {
            value = getValue(value);
          }
          if (Array.isArray(target)) {
            for (j = 0, len = target.length; j < len; j++) {
              insTarget = target[j];
              this.instruction(insTarget);
            }
          } else if (isObject(target)) {
            for (insTarget in target) {
              if (!hasProp.call(target, insTarget)) continue;
              insValue = target[insTarget];
              this.instruction(insTarget, insValue);
            }
          } else {
            if (isFunction(value)) {
              value = value.apply();
            }
            instruction = new XMLProcessingInstruction(this, target, value);
            this.children.push(instruction);
          }
          return this;
        };
    
        XMLNode.prototype.instructionBefore = function(target, value) {
          var child, i, removed;
          i = this.parent.children.indexOf(this);
          removed = this.parent.children.splice(i);
          child = this.parent.instruction(target, value);
          Array.prototype.push.apply(this.parent.children, removed);
          return this;
        };
    
        XMLNode.prototype.instructionAfter = function(target, value) {
          var child, i, removed;
          i = this.parent.children.indexOf(this);
          removed = this.parent.children.splice(i + 1);
          child = this.parent.instruction(target, value);
          Array.prototype.push.apply(this.parent.children, removed);
          return this;
        };
    
        XMLNode.prototype.declaration = function(version, encoding, standalone) {
          var doc, xmldec;
          doc = this.document();
          xmldec = new XMLDeclaration(doc, version, encoding, standalone);
          if (doc.children.length === 0) {
            doc.children.unshift(xmldec);
          } else if (doc.children[0].type === NodeType.Declaration) {
            doc.children[0] = xmldec;
          } else {
            doc.children.unshift(xmldec);
          }
          return doc.root() || doc;
        };
    
        XMLNode.prototype.dtd = function(pubID, sysID) {
          var child, doc, doctype, i, j, k, len, len1, ref2, ref3;
          doc = this.document();
          doctype = new XMLDocType(doc, pubID, sysID);
          ref2 = doc.children;
          for (i = j = 0, len = ref2.length; j < len; i = ++j) {
            child = ref2[i];
            if (child.type === NodeType.DocType) {
              doc.children[i] = doctype;
              return doctype;
            }
          }
          ref3 = doc.children;
          for (i = k = 0, len1 = ref3.length; k < len1; i = ++k) {
            child = ref3[i];
            if (child.isRoot) {
              doc.children.splice(i, 0, doctype);
              return doctype;
            }
          }
          doc.children.push(doctype);
          return doctype;
        };
    
        XMLNode.prototype.up = function() {
          if (this.isRoot) {
            throw new Error("The root node has no parent. Use doc() if you need to get the document object.");
          }
          return this.parent;
        };
    
        XMLNode.prototype.root = function() {
          var node;
          node = this;
          while (node) {
            if (node.type === NodeType.Document) {
              return node.rootObject;
            } else if (node.isRoot) {
              return node;
            } else {
              node = node.parent;
            }
          }
        };
    
        XMLNode.prototype.document = function() {
          var node;
          node = this;
          while (node) {
            if (node.type === NodeType.Document) {
              return node;
            } else {
              node = node.parent;
            }
          }
        };
    
        XMLNode.prototype.end = function(options) {
          return this.document().end(options);
        };
    
        XMLNode.prototype.prev = function() {
          var i;
          i = this.parent.children.indexOf(this);
          if (i < 1) {
            throw new Error("Already at the first node. " + this.debugInfo());
          }
          return this.parent.children[i - 1];
        };
    
        XMLNode.prototype.next = function() {
          var i;
          i = this.parent.children.indexOf(this);
          if (i === -1 || i === this.parent.children.length - 1) {
            throw new Error("Already at the last node. " + this.debugInfo());
          }
          return this.parent.children[i + 1];
        };
    
        XMLNode.prototype.importDocument = function(doc) {
          var clonedRoot;
          clonedRoot = doc.root().clone();
          clonedRoot.parent = this;
          clonedRoot.isRoot = false;
          this.children.push(clonedRoot);
          return this;
        };
    
        XMLNode.prototype.debugInfo = function(name) {
          var ref2, ref3;
          name = name || this.name;
          if ((name == null) && !((ref2 = this.parent) != null ? ref2.name : void 0)) {
            return "";
          } else if (name == null) {
            return "parent: <" + this.parent.name + ">";
          } else if (!((ref3 = this.parent) != null ? ref3.name : void 0)) {
            return "node: <" + name + ">";
          } else {
            return "node: <" + name + ">, parent: <" + this.parent.name + ">";
          }
        };
    
        XMLNode.prototype.ele = function(name, attributes, text) {
          return this.element(name, attributes, text);
        };
    
        XMLNode.prototype.nod = function(name, attributes, text) {
          return this.node(name, attributes, text);
        };
    
        XMLNode.prototype.txt = function(value) {
          return this.text(value);
        };
    
        XMLNode.prototype.dat = function(value) {
          return this.cdata(value);
        };
    
        XMLNode.prototype.com = function(value) {
          return this.comment(value);
        };
    
        XMLNode.prototype.ins = function(target, value) {
          return this.instruction(target, value);
        };
    
        XMLNode.prototype.doc = function() {
          return this.document();
        };
    
        XMLNode.prototype.dec = function(version, encoding, standalone) {
          return this.declaration(version, encoding, standalone);
        };
    
        XMLNode.prototype.e = function(name, attributes, text) {
          return this.element(name, attributes, text);
        };
    
        XMLNode.prototype.n = function(name, attributes, text) {
          return this.node(name, attributes, text);
        };
    
        XMLNode.prototype.t = function(value) {
          return this.text(value);
        };
    
        XMLNode.prototype.d = function(value) {
          return this.cdata(value);
        };
    
        XMLNode.prototype.c = function(value) {
          return this.comment(value);
        };
    
        XMLNode.prototype.r = function(value) {
          return this.raw(value);
        };
    
        XMLNode.prototype.i = function(target, value) {
          return this.instruction(target, value);
        };
    
        XMLNode.prototype.u = function() {
          return this.up();
        };
    
        XMLNode.prototype.importXMLBuilder = function(doc) {
          return this.importDocument(doc);
        };
    
        XMLNode.prototype.replaceChild = function(newChild, oldChild) {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        XMLNode.prototype.removeChild = function(oldChild) {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        XMLNode.prototype.appendChild = function(newChild) {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        XMLNode.prototype.hasChildNodes = function() {
          return this.children.length !== 0;
        };
    
        XMLNode.prototype.cloneNode = function(deep) {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        XMLNode.prototype.normalize = function() {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        XMLNode.prototype.isSupported = function(feature, version) {
          return true;
        };
    
        XMLNode.prototype.hasAttributes = function() {
          return this.attribs.length !== 0;
        };
    
        XMLNode.prototype.compareDocumentPosition = function(other) {
          var ref, res;
          ref = this;
          if (ref === other) {
            return 0;
          } else if (this.document() !== other.document()) {
            res = DocumentPosition.Disconnected | DocumentPosition.ImplementationSpecific;
            if (Math.random() < 0.5) {
              res |= DocumentPosition.Preceding;
            } else {
              res |= DocumentPosition.Following;
            }
            return res;
          } else if (ref.isAncestor(other)) {
            return DocumentPosition.Contains | DocumentPosition.Preceding;
          } else if (ref.isDescendant(other)) {
            return DocumentPosition.Contains | DocumentPosition.Following;
          } else if (ref.isPreceding(other)) {
            return DocumentPosition.Preceding;
          } else {
            return DocumentPosition.Following;
          }
        };
    
        XMLNode.prototype.isSameNode = function(other) {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        XMLNode.prototype.lookupPrefix = function(namespaceURI) {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        XMLNode.prototype.isDefaultNamespace = function(namespaceURI) {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        XMLNode.prototype.lookupNamespaceURI = function(prefix) {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        XMLNode.prototype.isEqualNode = function(node) {
          var i, j, ref2;
          if (node.nodeType !== this.nodeType) {
            return false;
          }
          if (node.children.length !== this.children.length) {
            return false;
          }
          for (i = j = 0, ref2 = this.children.length - 1; 0 <= ref2 ? j <= ref2 : j >= ref2; i = 0 <= ref2 ? ++j : --j) {
            if (!this.children[i].isEqualNode(node.children[i])) {
              return false;
            }
          }
          return true;
        };
    
        XMLNode.prototype.getFeature = function(feature, version) {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        XMLNode.prototype.setUserData = function(key, data, handler) {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        XMLNode.prototype.getUserData = function(key) {
          throw new Error("This DOM method is not implemented." + this.debugInfo());
        };
    
        XMLNode.prototype.contains = function(other) {
          if (!other) {
            return false;
          }
          return other === this || this.isDescendant(other);
        };
    
        XMLNode.prototype.isDescendant = function(node) {
          var child, isDescendantChild, j, len, ref2;
          ref2 = this.children;
          for (j = 0, len = ref2.length; j < len; j++) {
            child = ref2[j];
            if (node === child) {
              return true;
            }
            isDescendantChild = child.isDescendant(node);
            if (isDescendantChild) {
              return true;
            }
          }
          return false;
        };
    
        XMLNode.prototype.isAncestor = function(node) {
          return node.isDescendant(this);
        };
    
        XMLNode.prototype.isPreceding = function(node) {
          var nodePos, thisPos;
          nodePos = this.treePosition(node);
          thisPos = this.treePosition(this);
          if (nodePos === -1 || thisPos === -1) {
            return false;
          } else {
            return nodePos < thisPos;
          }
        };
    
        XMLNode.prototype.isFollowing = function(node) {
          var nodePos, thisPos;
          nodePos = this.treePosition(node);
          thisPos = this.treePosition(this);
          if (nodePos === -1 || thisPos === -1) {
            return false;
          } else {
            return nodePos > thisPos;
          }
        };
    
        XMLNode.prototype.treePosition = function(node) {
          var found, pos;
          pos = 0;
          found = false;
          this.foreachTreeNode(this.document(), function(childNode) {
            pos++;
            if (!found && childNode === node) {
              return found = true;
            }
          });
          if (found) {
            return pos;
          } else {
            return -1;
          }
        };
    
        XMLNode.prototype.foreachTreeNode = function(node, func) {
          var child, j, len, ref2, res;
          node || (node = this.document());
          ref2 = node.children;
          for (j = 0, len = ref2.length; j < len; j++) {
            child = ref2[j];
            if (res = func(child)) {
              return res;
            } else {
              res = this.foreachTreeNode(child, func);
              if (res) {
                return res;
              }
            }
          }
        };
    
        return XMLNode;
    
      })();
    
    }).call(this);
    
    
    /***/ }),
    
    build-token's avatar
    build-token committed
    /* 1513 */
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    /***/ (function(module, __unused_webpack_exports, __webpack_require__) {
    
    // Generated by CoffeeScript 1.12.7
    (function() {
      var NodeType, XMLAttribute, XMLElement, XMLNamedNodeMap, XMLNode, getValue, isFunction, isObject, ref,
        extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
        hasProp = {}.hasOwnProperty;
    
    
    build-token's avatar
    build-token committed
      ref = __webpack_require__(1506), isObject = ref.isObject, isFunction = ref.isFunction, getValue = ref.getValue;
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLNode = __webpack_require__(1512);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      NodeType = __webpack_require__(1514);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLAttribute = __webpack_require__(1515);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
    
    build-token's avatar
    build-token committed
      XMLNamedNodeMap = __webpack_require__(1516);
    
    Hugo NOUTS's avatar
    Hugo NOUTS committed
    
      module.exports = XMLElement = (function(superClass) {
        extend(XMLElement, superClass);
    
        function XMLElement(parent, name, attributes) {
          var child, j, len, ref1;
          XMLElement.__super__.constructor.call(this, parent);
          if (name == null) {
            throw new Error("Missing element name. " + this.debugInfo());
          }
          this.name = this.stringify.name(name);
          this.type = NodeType.Element;
          this.attribs = {};
          this.schemaTypeInfo = null;
          if (attributes != null) {
            this.attribute(attributes);
          }
          if (parent.type === NodeType.Document) {
            this.isRoot = true;
            this.documentObject = parent;
            parent.rootObject = this;
            if (parent.children) {
              ref1 = parent.children;
              for (j = 0, len = ref1.length; j < len; j++) {
                child = ref1[j];
                if (child.type === NodeType.DocType) {
                  child.name = this.name;
                  break;
                }
              }
            }
          }
        }
    
        Object.defineProperty(XMLElement.prototype, 'tagName', {
          get: function() {
            return this.name;
          }
        });
    
        Object.defineProperty(XMLElement.prototype, 'namespaceURI', {
          get: function() {
            return '';
          }
        });
    
        Object.defineProperty(XMLElement.prototype, 'prefix', {
          get: function() {
            return '';
          }
        });
    
        Object.defineProperty(XMLElement.prototype, 'localName', {
          get: function() {
            return this.name;
          }