{ "version": 3, "sources": ["index.js", "sax-ts/sax.js", "lib/xml-utils/uncapitalize.js", "lib/parsers/parse-xml.js", "xml-loader.js", "html-loader.js", "lib/xml-utils/xml-utils.js"], "sourcesContent": ["// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nexport { XMLLoader } from \"./xml-loader.js\";\nexport { HTMLLoader } from \"./html-loader.js\";\nexport { SAXParser as SAXParser } from \"./sax-ts/sax.js\";\n// Utilities\nexport { convertXMLValueToArray, convertXMLFieldToArrayInPlace } from \"./lib/xml-utils/xml-utils.js\";\n// Experimental\nexport { uncapitalize as _uncapitalize, uncapitalizeKeys as _uncapitalizeKeys } from \"./lib/xml-utils/uncapitalize.js\";\n", "// loaders.gl\n// SPDX-License-Identifier: MIT\n// Copyright (c) vis.gl contributors\nconst DEFAULT_SAX_EVENTS = {\n ontext: () => { },\n onprocessinginstruction: () => { },\n onsgmldeclaration: () => { },\n ondoctype: () => { },\n oncomment: () => { },\n onopentagstart: () => { },\n onattribute: () => { },\n onopentag: () => { },\n onclosetag: () => { },\n onopencdata: () => { },\n oncdata: () => { },\n onclosecdata: () => { },\n onerror: () => { },\n onend: () => { },\n onready: () => { },\n onscript: () => { },\n onopennamespace: () => { },\n onclosenamespace: () => { }\n};\nconst DEFAULT_SAX_PARSER_OPTIONS = {\n ...DEFAULT_SAX_EVENTS,\n strict: false,\n MAX_BUFFER_LENGTH: 64 * 1024,\n lowercase: false,\n lowercasetags: false,\n noscript: false,\n strictEntities: false,\n xmlns: undefined,\n position: undefined,\n trim: undefined,\n normalize: undefined\n};\nconst EVENTS = [\n 'text',\n 'processinginstruction',\n 'sgmldeclaration',\n 'doctype',\n 'comment',\n 'opentagstart',\n 'attribute',\n 'opentag',\n 'closetag',\n 'opencdata',\n 'cdata',\n 'closecdata',\n 'error',\n 'end',\n 'ready',\n 'script',\n 'opennamespace',\n 'closenamespace'\n];\nconst BUFFERS = [\n 'comment',\n 'sgmlDecl',\n 'textNode',\n 'tagName',\n 'doctype',\n 'procInstName',\n 'procInstBody',\n 'entity',\n 'attribName',\n 'attribValue',\n 'cdata',\n 'script'\n];\nconst nameStart = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\nconst nameBody = /[:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\nconst entityStart = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]/;\nconst entityBody = /[#:_A-Za-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u00B7\\u0300-\\u036F\\u203F-\\u2040.\\d-]/;\nexport const ENTITIES = {\n amp: '&',\n gt: '>',\n lt: '<',\n quot: '\"',\n apos: \"'\",\n AElig: 198,\n Aacute: 193,\n Acirc: 194,\n Agrave: 192,\n Aring: 197,\n Atilde: 195,\n Auml: 196,\n Ccedil: 199,\n ETH: 208,\n Eacute: 201,\n Ecirc: 202,\n Egrave: 200,\n Euml: 203,\n Iacute: 205,\n Icirc: 206,\n Igrave: 204,\n Iuml: 207,\n Ntilde: 209,\n Oacute: 211,\n Ocirc: 212,\n Ograve: 210,\n Oslash: 216,\n Otilde: 213,\n Ouml: 214,\n THORN: 222,\n Uacute: 218,\n Ucirc: 219,\n Ugrave: 217,\n Uuml: 220,\n Yacute: 221,\n aacute: 225,\n acirc: 226,\n aelig: 230,\n agrave: 224,\n aring: 229,\n atilde: 227,\n auml: 228,\n ccedil: 231,\n eacute: 233,\n ecirc: 234,\n egrave: 232,\n eth: 240,\n euml: 235,\n iacute: 237,\n icirc: 238,\n igrave: 236,\n iuml: 239,\n ntilde: 241,\n oacute: 243,\n ocirc: 244,\n ograve: 242,\n oslash: 248,\n otilde: 245,\n ouml: 246,\n szlig: 223,\n thorn: 254,\n uacute: 250,\n ucirc: 251,\n ugrave: 249,\n uuml: 252,\n yacute: 253,\n yuml: 255,\n copy: 169,\n reg: 174,\n nbsp: 160,\n iexcl: 161,\n cent: 162,\n pound: 163,\n curren: 164,\n yen: 165,\n brvbar: 166,\n sect: 167,\n uml: 168,\n ordf: 170,\n laquo: 171,\n not: 172,\n shy: 173,\n macr: 175,\n deg: 176,\n plusmn: 177,\n sup1: 185,\n sup2: 178,\n sup3: 179,\n acute: 180,\n micro: 181,\n para: 182,\n middot: 183,\n cedil: 184,\n ordm: 186,\n raquo: 187,\n frac14: 188,\n frac12: 189,\n frac34: 190,\n iquest: 191,\n times: 215,\n divide: 247,\n OElig: 338,\n oelig: 339,\n Scaron: 352,\n scaron: 353,\n Yuml: 376,\n fnof: 402,\n circ: 710,\n tilde: 732,\n Alpha: 913,\n Beta: 914,\n Gamma: 915,\n Delta: 916,\n Epsilon: 917,\n Zeta: 918,\n Eta: 919,\n Theta: 920,\n Iota: 921,\n Kappa: 922,\n Lambda: 923,\n Mu: 924,\n Nu: 925,\n Xi: 926,\n Omicron: 927,\n Pi: 928,\n Rho: 929,\n Sigma: 931,\n Tau: 932,\n Upsilon: 933,\n Phi: 934,\n Chi: 935,\n Psi: 936,\n Omega: 937,\n alpha: 945,\n beta: 946,\n gamma: 947,\n delta: 948,\n epsilon: 949,\n zeta: 950,\n eta: 951,\n theta: 952,\n iota: 953,\n kappa: 954,\n lambda: 955,\n mu: 956,\n nu: 957,\n xi: 958,\n omicron: 959,\n pi: 960,\n rho: 961,\n sigmaf: 962,\n sigma: 963,\n tau: 964,\n upsilon: 965,\n phi: 966,\n chi: 967,\n psi: 968,\n omega: 969,\n thetasym: 977,\n upsih: 978,\n piv: 982,\n ensp: 8194,\n emsp: 8195,\n thinsp: 8201,\n zwnj: 8204,\n zwj: 8205,\n lrm: 8206,\n rlm: 8207,\n ndash: 8211,\n mdash: 8212,\n lsquo: 8216,\n rsquo: 8217,\n sbquo: 8218,\n ldquo: 8220,\n rdquo: 8221,\n bdquo: 8222,\n dagger: 8224,\n Dagger: 8225,\n bull: 8226,\n hellip: 8230,\n permil: 8240,\n prime: 8242,\n Prime: 8243,\n lsaquo: 8249,\n rsaquo: 8250,\n oline: 8254,\n frasl: 8260,\n euro: 8364,\n image: 8465,\n weierp: 8472,\n real: 8476,\n trade: 8482,\n alefsym: 8501,\n larr: 8592,\n uarr: 8593,\n rarr: 8594,\n darr: 8595,\n harr: 8596,\n crarr: 8629,\n lArr: 8656,\n uArr: 8657,\n rArr: 8658,\n dArr: 8659,\n hArr: 8660,\n forall: 8704,\n part: 8706,\n exist: 8707,\n empty: 8709,\n nabla: 8711,\n isin: 8712,\n notin: 8713,\n ni: 8715,\n prod: 8719,\n sum: 8721,\n minus: 8722,\n lowast: 8727,\n radic: 8730,\n prop: 8733,\n infin: 8734,\n ang: 8736,\n and: 8743,\n or: 8744,\n cap: 8745,\n cup: 8746,\n int: 8747,\n there4: 8756,\n sim: 8764,\n cong: 8773,\n asymp: 8776,\n ne: 8800,\n equiv: 8801,\n le: 8804,\n ge: 8805,\n sub: 8834,\n sup: 8835,\n nsub: 8836,\n sube: 8838,\n supe: 8839,\n oplus: 8853,\n otimes: 8855,\n perp: 8869,\n sdot: 8901,\n lceil: 8968,\n rceil: 8969,\n lfloor: 8970,\n rfloor: 8971,\n lang: 9001,\n rang: 9002,\n loz: 9674,\n spades: 9824,\n clubs: 9827,\n hearts: 9829,\n diams: 9830\n};\nObject.keys(ENTITIES).forEach((key) => {\n const e = ENTITIES[key];\n ENTITIES[key] = typeof e === 'number' ? String.fromCharCode(e) : e;\n});\n/**\n * Internal helper class\n */\nclass SAX {\n EVENTS = EVENTS;\n ENTITIES = {\n // TODO: make it readonly, needed for entity-mega test\n // amp, gt, lt, quot and apos are resolved to strings instead of numerical\n // codes, IDK why\n ...ENTITIES\n };\n XML_ENTITIES = {\n amp: '&',\n gt: '>',\n lt: '<',\n quot: '\"',\n apos: \"'\"\n };\n S = 0;\n opt;\n trackPosition = false;\n column = 0;\n line = 0;\n c = '';\n error;\n q = '';\n bufferCheckPosition;\n closed = false;\n tags = [];\n looseCase = '';\n closedRoot = false;\n sawRoot = false;\n strict = false;\n tag;\n strictEntities;\n state;\n noscript = false;\n attribList = [];\n ns;\n position = 0;\n STATE = {\n BEGIN: this.S++, // leading byte order mark or whitespace\n BEGIN_WHITESPACE: this.S++, // leading whitespace\n TEXT: this.S++, // general stuff\n TEXT_ENTITY: this.S++, // & and such.\n OPEN_WAKA: this.S++, // <\n SGML_DECL: this.S++, // \n SCRIPT: this.S++, //