UNPKG

@restnfeel/agentc-starter-kit

Version:

한국어 기업용 CMS 모듈 - Task Master AI와 함께 빠르게 웹사이트를 구현할 수 있는 재사용 가능한 컴포넌트 시스템

315 lines (276 loc) 12.2 kB
import { __module as XMLStreamWriter$1 } from '../../../_virtual/XMLStreamWriter2.js'; import { __require as requireXMLDeclaration } from './XMLDeclaration.js'; import { __require as requireXMLDocType } from './XMLDocType.js'; import { __require as requireXMLCData } from './XMLCData.js'; import { __require as requireXMLComment } from './XMLComment.js'; import { __require as requireXMLElement } from './XMLElement.js'; import { __require as requireXMLRaw } from './XMLRaw.js'; import { __require as requireXMLText } from './XMLText.js'; import { __require as requireXMLProcessingInstruction } from './XMLProcessingInstruction.js'; import { __require as requireXMLDummy } from './XMLDummy.js'; import { __require as requireXMLDTDAttList } from './XMLDTDAttList.js'; import { __require as requireXMLDTDElement } from './XMLDTDElement.js'; import { __require as requireXMLDTDEntity } from './XMLDTDEntity.js'; import { __require as requireXMLDTDNotation } from './XMLDTDNotation.js'; import { __require as requireXMLWriterBase } from './XMLWriterBase.js'; var XMLStreamWriter = XMLStreamWriter$1.exports; var hasRequiredXMLStreamWriter; function requireXMLStreamWriter () { if (hasRequiredXMLStreamWriter) return XMLStreamWriter$1.exports; hasRequiredXMLStreamWriter = 1; // Generated by CoffeeScript 1.12.7 (function() { var XMLCData, XMLComment, XMLDTDAttList, XMLDTDElement, XMLDTDEntity, XMLDTDNotation, XMLDeclaration, XMLDocType, XMLDummy, XMLElement, XMLProcessingInstruction, XMLRaw, XMLText, XMLWriterBase, 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; XMLDeclaration = /*@__PURE__*/ requireXMLDeclaration(); XMLDocType = /*@__PURE__*/ requireXMLDocType(); XMLCData = /*@__PURE__*/ requireXMLCData(); XMLComment = /*@__PURE__*/ requireXMLComment(); XMLElement = /*@__PURE__*/ requireXMLElement(); XMLRaw = /*@__PURE__*/ requireXMLRaw(); XMLText = /*@__PURE__*/ requireXMLText(); XMLProcessingInstruction = /*@__PURE__*/ requireXMLProcessingInstruction(); XMLDummy = /*@__PURE__*/ requireXMLDummy(); XMLDTDAttList = /*@__PURE__*/ requireXMLDTDAttList(); XMLDTDElement = /*@__PURE__*/ requireXMLDTDElement(); XMLDTDEntity = /*@__PURE__*/ requireXMLDTDEntity(); XMLDTDNotation = /*@__PURE__*/ requireXMLDTDNotation(); XMLWriterBase = /*@__PURE__*/ requireXMLWriterBase(); XMLStreamWriter$1.exports = (function(superClass) { extend(XMLStreamWriter, superClass); function XMLStreamWriter(stream, options) { XMLStreamWriter.__super__.constructor.call(this, options); this.stream = stream; } XMLStreamWriter.prototype.document = function(doc) { var child, i, j, len, len1, ref, ref1, results; ref = doc.children; for (i = 0, len = ref.length; i < len; i++) { child = ref[i]; child.isLastRootNode = false; } doc.children[doc.children.length - 1].isLastRootNode = true; ref1 = doc.children; results = []; for (j = 0, len1 = ref1.length; j < len1; j++) { child = ref1[j]; if (child instanceof XMLDummy) { continue; } switch (false) { case !(child instanceof XMLDeclaration): results.push(this.declaration(child)); break; case !(child instanceof XMLDocType): results.push(this.docType(child)); break; case !(child instanceof XMLComment): results.push(this.comment(child)); break; case !(child instanceof XMLProcessingInstruction): results.push(this.processingInstruction(child)); break; default: results.push(this.element(child)); } } return results; }; XMLStreamWriter.prototype.attribute = function(att) { return this.stream.write(' ' + att.name + '="' + att.value + '"'); }; XMLStreamWriter.prototype.cdata = function(node, level) { return this.stream.write(this.space(level) + '<![CDATA[' + node.text + ']]>' + this.endline(node)); }; XMLStreamWriter.prototype.comment = function(node, level) { return this.stream.write(this.space(level) + '<!-- ' + node.text + ' -->' + this.endline(node)); }; XMLStreamWriter.prototype.declaration = function(node, level) { this.stream.write(this.space(level)); this.stream.write('<?xml version="' + node.version + '"'); if (node.encoding != null) { this.stream.write(' encoding="' + node.encoding + '"'); } if (node.standalone != null) { this.stream.write(' standalone="' + node.standalone + '"'); } this.stream.write(this.spacebeforeslash + '?>'); return this.stream.write(this.endline(node)); }; XMLStreamWriter.prototype.docType = function(node, level) { var child, i, len, ref; level || (level = 0); this.stream.write(this.space(level)); this.stream.write('<!DOCTYPE ' + node.root().name); if (node.pubID && node.sysID) { this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"'); } else if (node.sysID) { this.stream.write(' SYSTEM "' + node.sysID + '"'); } if (node.children.length > 0) { this.stream.write(' ['); this.stream.write(this.endline(node)); ref = node.children; for (i = 0, len = ref.length; i < len; i++) { child = ref[i]; switch (false) { case !(child instanceof XMLDTDAttList): this.dtdAttList(child, level + 1); break; case !(child instanceof XMLDTDElement): this.dtdElement(child, level + 1); break; case !(child instanceof XMLDTDEntity): this.dtdEntity(child, level + 1); break; case !(child instanceof XMLDTDNotation): this.dtdNotation(child, level + 1); break; case !(child instanceof XMLCData): this.cdata(child, level + 1); break; case !(child instanceof XMLComment): this.comment(child, level + 1); break; case !(child instanceof XMLProcessingInstruction): this.processingInstruction(child, level + 1); break; default: throw new Error("Unknown DTD node type: " + child.constructor.name); } } this.stream.write(']'); } this.stream.write(this.spacebeforeslash + '>'); return this.stream.write(this.endline(node)); }; XMLStreamWriter.prototype.element = function(node, level) { var att, child, i, len, name, ref, ref1, space; level || (level = 0); space = this.space(level); this.stream.write(space + '<' + node.name); ref = node.attributes; for (name in ref) { if (!hasProp.call(ref, name)) continue; att = ref[name]; this.attribute(att); } if (node.children.length === 0 || node.children.every(function(e) { return e.value === ''; })) { if (this.allowEmpty) { this.stream.write('></' + node.name + '>'); } else { this.stream.write(this.spacebeforeslash + '/>'); } } else if (this.pretty && node.children.length === 1 && (node.children[0].value != null)) { this.stream.write('>'); this.stream.write(node.children[0].value); this.stream.write('</' + node.name + '>'); } else { this.stream.write('>' + this.newline); ref1 = node.children; for (i = 0, len = ref1.length; i < len; i++) { child = ref1[i]; switch (false) { case !(child instanceof XMLCData): this.cdata(child, level + 1); break; case !(child instanceof XMLComment): this.comment(child, level + 1); break; case !(child instanceof XMLElement): this.element(child, level + 1); break; case !(child instanceof XMLRaw): this.raw(child, level + 1); break; case !(child instanceof XMLText): this.text(child, level + 1); break; case !(child instanceof XMLProcessingInstruction): this.processingInstruction(child, level + 1); break; case !(child instanceof XMLDummy): break; default: throw new Error("Unknown XML node type: " + child.constructor.name); } } this.stream.write(space + '</' + node.name + '>'); } return this.stream.write(this.endline(node)); }; XMLStreamWriter.prototype.processingInstruction = function(node, level) { this.stream.write(this.space(level) + '<?' + node.target); if (node.value) { this.stream.write(' ' + node.value); } return this.stream.write(this.spacebeforeslash + '?>' + this.endline(node)); }; XMLStreamWriter.prototype.raw = function(node, level) { return this.stream.write(this.space(level) + node.value + this.endline(node)); }; XMLStreamWriter.prototype.text = function(node, level) { return this.stream.write(this.space(level) + node.value + this.endline(node)); }; XMLStreamWriter.prototype.dtdAttList = function(node, level) { this.stream.write(this.space(level) + '<!ATTLIST ' + node.elementName + ' ' + node.attributeName + ' ' + node.attributeType); if (node.defaultValueType !== '#DEFAULT') { this.stream.write(' ' + node.defaultValueType); } if (node.defaultValue) { this.stream.write(' "' + node.defaultValue + '"'); } return this.stream.write(this.spacebeforeslash + '>' + this.endline(node)); }; XMLStreamWriter.prototype.dtdElement = function(node, level) { this.stream.write(this.space(level) + '<!ELEMENT ' + node.name + ' ' + node.value); return this.stream.write(this.spacebeforeslash + '>' + this.endline(node)); }; XMLStreamWriter.prototype.dtdEntity = function(node, level) { this.stream.write(this.space(level) + '<!ENTITY'); if (node.pe) { this.stream.write(' %'); } this.stream.write(' ' + node.name); if (node.value) { this.stream.write(' "' + node.value + '"'); } else { if (node.pubID && node.sysID) { this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"'); } else if (node.sysID) { this.stream.write(' SYSTEM "' + node.sysID + '"'); } if (node.nData) { this.stream.write(' NDATA ' + node.nData); } } return this.stream.write(this.spacebeforeslash + '>' + this.endline(node)); }; XMLStreamWriter.prototype.dtdNotation = function(node, level) { this.stream.write(this.space(level) + '<!NOTATION ' + node.name); if (node.pubID && node.sysID) { this.stream.write(' PUBLIC "' + node.pubID + '" "' + node.sysID + '"'); } else if (node.pubID) { this.stream.write(' PUBLIC "' + node.pubID + '"'); } else if (node.sysID) { this.stream.write(' SYSTEM "' + node.sysID + '"'); } return this.stream.write(this.spacebeforeslash + '>' + this.endline(node)); }; XMLStreamWriter.prototype.endline = function(node) { if (!node.isLastRootNode) { return this.newline; } else { return ''; } }; return XMLStreamWriter; })(XMLWriterBase); }).call(XMLStreamWriter); return XMLStreamWriter$1.exports; } export { requireXMLStreamWriter as __require }; //# sourceMappingURL=XMLStreamWriter.js.map