@cdklabs/cdk-construct-connect-datalake 0.0.8 → 0.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/.jsii +9 -9
  2. package/.jsii.tabl.json +1 -1
  3. package/lib/index.js +1 -1
  4. package/node_modules/@aws-sdk/client-cloudformation/package.json +1 -1
  5. package/node_modules/@aws-sdk/client-connect/package.json +1 -1
  6. package/node_modules/@aws-sdk/client-glue/dist-cjs/schemas/schemas_0.js +5 -4
  7. package/node_modules/@aws-sdk/client-glue/dist-es/schemas/schemas_0.js +5 -4
  8. package/node_modules/@aws-sdk/client-glue/dist-types/commands/GetDataQualityRulesetEvaluationRunCommand.d.ts +1 -0
  9. package/node_modules/@aws-sdk/client-glue/dist-types/commands/ListDataQualityRulesetEvaluationRunsCommand.d.ts +1 -0
  10. package/node_modules/@aws-sdk/client-glue/dist-types/commands/StartDataQualityRulesetEvaluationRunCommand.d.ts +1 -0
  11. package/node_modules/@aws-sdk/client-glue/dist-types/models/models_1.d.ts +5 -0
  12. package/node_modules/@aws-sdk/client-glue/dist-types/models/models_2.d.ts +5 -0
  13. package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/models_1.d.ts +1 -0
  14. package/node_modules/@aws-sdk/client-glue/dist-types/ts3.4/models/models_2.d.ts +1 -0
  15. package/node_modules/@aws-sdk/client-glue/package.json +1 -1
  16. package/node_modules/@aws-sdk/client-lakeformation/package.json +1 -1
  17. package/node_modules/@aws-sdk/client-ram/package.json +1 -1
  18. package/node_modules/@aws-sdk/client-sts/package.json +1 -1
  19. package/node_modules/fast-xml-builder/CHANGELOG.md +11 -0
  20. package/node_modules/fast-xml-builder/README.md +53 -2
  21. package/node_modules/fast-xml-builder/lib/fxb.cjs +1 -1
  22. package/node_modules/fast-xml-builder/lib/fxb.d.cts +91 -1
  23. package/node_modules/fast-xml-builder/lib/fxb.min.js +1 -1
  24. package/node_modules/fast-xml-builder/lib/fxb.min.js.map +1 -1
  25. package/node_modules/fast-xml-builder/package.json +3 -2
  26. package/node_modules/fast-xml-builder/src/fxb.d.ts +93 -3
  27. package/node_modules/fast-xml-builder/src/fxb.js +100 -33
  28. package/node_modules/fast-xml-builder/src/orderedJs2Xml.js +91 -37
  29. package/node_modules/strnum/CHANGELOG.md +3 -0
  30. package/node_modules/strnum/package.json +3 -2
  31. package/node_modules/strnum/strnum.js +12 -10
  32. package/node_modules/xml-naming/README.md +189 -0
  33. package/node_modules/xml-naming/package.json +54 -0
  34. package/node_modules/xml-naming/src/index.d.ts +74 -0
  35. package/node_modules/xml-naming/src/index.js +270 -0
  36. package/package.json +10 -10
@@ -1,8 +1,51 @@
1
1
  // const { Expression } = require('path-expression-matcher');
2
2
 
3
- type Matcher = unknown;
3
+ //type Matcher = unknown;
4
4
  type Expression = unknown;
5
5
 
6
+ /**
7
+ * A lightweight, live read-only view of a Matcher instance.
8
+ *
9
+ * Returned by `Matcher.readOnly()`. The same instance is reused across every
10
+ * callback invocation — no allocation overhead per call. Reads directly from
11
+ * the parent Matcher's internal state so it always reflects the current parser
12
+ * position with no copying or freezing.
13
+ */
14
+ class MatcherView {
15
+ readonly separator: string;
16
+
17
+ /** Check if current path matches an Expression. */
18
+ matches(expression: Expression): boolean;
19
+
20
+ /** Get current tag name, or `undefined` if path is empty. */
21
+ getCurrentTag(): string | undefined;
22
+
23
+ /** Get current namespace, or `undefined` if not present. */
24
+ getCurrentNamespace(): string | undefined;
25
+
26
+ /** Get attribute value of the current node. */
27
+ getAttrValue(attrName: string): any;
28
+
29
+ /** Check if the current node has a given attribute. */
30
+ hasAttr(attrName: string): boolean;
31
+
32
+ /** Sibling position of the current node (child index in parent). */
33
+ getPosition(): number;
34
+
35
+ /** Occurrence counter of the current tag name at this level. */
36
+ getCounter(): number;
37
+
38
+ /** Number of nodes in the current path. */
39
+ getDepth(): number;
40
+
41
+ /** Current path as a string (e.g. `"root.users.user"`). */
42
+ toString(separator?: string, includeNamespace?: boolean): string;
43
+
44
+ /** Current path as an array of tag names. */
45
+ toArray(): string[];
46
+ }
47
+
48
+
6
49
  type XmlBuilderOptions = {
7
50
  /**
8
51
  * Give a prefix to the attribute name in the resulting JS object
@@ -164,6 +207,53 @@ type XmlBuilderOptions = {
164
207
  * Defaults to `100`
165
208
  */
166
209
  maxNestedTags?: number;
210
+
211
+ /**
212
+ * Validate or sanitize tag and attribute names before they are written to XML output.
213
+ *
214
+ * The context object provides:
215
+ * - `isAttribute` — `true` when the name being resolved is an attribute name,
216
+ * `false` when it is a tag name.
217
+ * - `matcher` — the current path matcher (readonly). Can be used to inspect the
218
+ * current element path, e.g. via `.toString()` or `.getDepth()`.
219
+ *
220
+ * Return the (possibly transformed) name to use in the output.
221
+ * Throw an error inside the function to reject an invalid name entirely.
222
+ *
223
+ * When set to `false` (default) all names are written as-is, preserving
224
+ * backward-compatible behaviour.
225
+ *
226
+ * @example
227
+ * // Auto-fix invalid names using xml-naming
228
+ * import { sanitize } from 'xml-naming';
229
+ * { sanitizeName: (name) => sanitize(name, 'qName') }
230
+ *
231
+ * @example
232
+ * // Reject invalid names
233
+ * import { qName } from 'xml-naming';
234
+ * { sanitizeName: (name) => { if (!qName(name)) throw new Error(`Invalid XML name: "${name}"`); return name; } }
235
+ *
236
+ * Defaults to `false`
237
+ */
238
+ sanitizeName?: false | ((name: string, context: SanitizeNameContext) => string);
239
+ };
240
+
241
+ /**
242
+ * Context object passed as the second argument to {@link XmlBuilderOptions.sanitizeName}.
243
+ */
244
+ type SanitizeNameContext = {
245
+ /**
246
+ * `true` when the name being resolved is an XML attribute name;
247
+ * `false` when it is an XML element (tag) name.
248
+ */
249
+ isAttribute: boolean;
250
+
251
+ /**
252
+ * The current path matcher at the point where the name is being resolved.
253
+ * Readonly from the callback's perspective — do not call mutating methods.
254
+ * Use `.toString()` to get the current jPath string, `.getDepth()` for nesting depth.
255
+ */
256
+ matcher: MatcherView;
167
257
  };
168
258
 
169
259
  interface XMLBuilder {
@@ -1,2 +1,2 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fxb=e():t.fxb=e()}(this,()=>(()=>{"use strict";var t={d:(e,i)=>{for(var r in i)t.o(i,r)&&!t.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:i[r]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>y});class i{constructor(t,e={}){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let i=0,r="";for(;i<t.length;)t[i]===this.separator?i+1<t.length&&t[i+1]===this.separator?(r.trim()&&(e.push(this._parseSegment(r.trim())),r=""),e.push({type:"deep-wildcard"}),i+=2):(r.trim()&&e.push(this._parseSegment(r.trim())),r="",i++):(r+=t[i],i++);return r.trim()&&e.push(this._parseSegment(r.trim())),e}_parseSegment(t){const e={type:"tag"};let i=null,r=t;const s=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(s&&(r=s[1]+s[3],s[2])){const t=s[2].slice(1,-1);t&&(i=t)}let n,o,a=r;if(r.includes("::")){const e=r.indexOf("::");if(n=r.substring(0,e).trim(),a=r.substring(e+2).trim(),!n)throw new Error(`Invalid namespace in pattern: ${t}`)}let h=null;if(a.includes(":")){const t=a.lastIndexOf(":"),e=a.substring(0,t).trim(),i=a.substring(t+1).trim();["first","last","odd","even"].includes(i)||/^nth\(\d+\)$/.test(i)?(o=e,h=i):o=a}else o=a;if(!o)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=o,n&&(e.namespace=n),i)if(i.includes("=")){const t=i.indexOf("=");e.attrName=i.substring(0,t).trim(),e.attrValue=i.substring(t+1).trim()}else e.attrName=i.trim();if(h){const t=h.match(/^nth\((\d+)\)$/);t?(e.position="nth",e.positionValue=parseInt(t[1],10)):e.position=h}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class r{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[]}push(t,e=null,i=null){this.path.length>0&&(this.path[this.path.length-1].values=void 0);const r=this.path.length;this.siblingStacks[r]||(this.siblingStacks[r]=new Map);const s=this.siblingStacks[r],n=i?`${i}:${t}`:t,o=s.get(n)||0;let a=0;for(const t of s.values())a+=t;s.set(n,o+1);const h={tag:t,position:a,counter:o};null!=i&&(h.namespace=i),null!=e&&(h.values=e),this.path.push(h)}pop(){if(0===this.path.length)return;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0===this.path.length)return;const e=this.path[this.path.length-1];return e.values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const i=t||this.separator;return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(i)}toArray(){return this.path.map(t=>t.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++){const i=t[e],r=this.path[e],s=e===this.path.length-1;if(!this._matchSegment(i,r,s))return!1}return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,i=t.length-1;for(;i>=0&&e>=0;){const r=t[i];if("deep-wildcard"===r.type){if(i--,i<0)return!0;const r=t[i];let s=!1;for(let t=e;t>=0;t--){const n=t===this.path.length-1;if(this._matchSegment(r,this.path[t],n)){e=t-1,i--,s=!0;break}}if(!s)return!1}else{const t=e===this.path.length-1;if(!this._matchSegment(r,this.path[e],t))return!1;e--,i--}}return i<0}_matchSegment(t,e,i){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!i)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue){const i=e.values[t.attrName];if(String(i)!==String(t.attrValue))return!1}}if(void 0!==t.position){if(!i)return!1;const r=e.counter??0;if("first"===t.position&&0!==r)return!1;if("odd"===t.position&&r%2!=1)return!1;if("even"===t.position&&r%2!=0)return!1;if("nth"===t.position&&r!==t.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}}function s(t){return String(t).replace(/--/g,"- -").replace(/--/g,"- -").replace(/-$/,"- ")}function n(t){return String(t).replace(/\]\]>/g,"]]]]><![CDATA[>")}function o(t){return String(t).replace(/"/g,"&quot;").replace(/'/g,"&apos;")}function a(t,e){var s="";e.format&&e.indentBy.length>0&&(s="\n");var n=[];if(e.stopNodes&&Array.isArray(e.stopNodes))for(var o=0;o<e.stopNodes.length;o++){var a=e.stopNodes[o];"string"==typeof a?n.push(new i(a)):a instanceof i&&n.push(a)}return h(t,e,s,new r,n)}function h(t,e,i,r,o){var a="",l=!1;if(e.maxNestedTags&&r.getDepth()>e.maxNestedTags)throw new Error("Maximum nested tags exceeded");if(!Array.isArray(t)){if(null!=t){var m=t.toString();return g(m,e)}return""}for(var b=0;b<t.length;b++){var v=t[b],N=c(v);if(void 0!==N){var y=p(v[":@"],e);r.push(N,y);var x=d(r,o);if(N!==e.textNodeName)if(N!==e.cdataPropName)if(N!==e.commentPropName)if("?"!==N[0]){var A=i;""!==A&&(A+=e.indentBy);var S=i+"<"+N+f(v[":@"],e,x),P=void 0;P=x?u(v[N],e):h(v[N],e,A,r,o),-1!==e.unpairedTags.indexOf(N)?e.suppressUnpairedNode?a+=S+">":a+=S+"/>":P&&0!==P.length||!e.suppressEmptyNode?P&&P.endsWith(">")?a+=S+">"+P+i+"</"+N+">":(a+=S+">",P&&""!==i&&(P.includes("/>")||P.includes("</"))?a+=i+e.indentBy+P+i:a+=P,a+="</"+N+">"):a+=S+"/>",l=!0,r.pop()}else{var O=f(v[":@"],e,x),w="?xml"===N?"":i,E=v[N][0][e.textNodeName];a+=w+"<"+N+(E=0!==E.length?" "+E:"")+O+"?>",l=!0,r.pop()}else a+=i+"\x3c!--"+s(v[N][0][e.textNodeName])+"--\x3e",l=!0,r.pop();else l&&(a+=i),a+="<![CDATA["+n(v[N][0][e.textNodeName])+"]]>",l=!1,r.pop();else{var j=v[N];x||(j=g(j=e.tagValueProcessor(N,j),e)),l&&(a+=i),a+=j,l=!1,r.pop()}}}return a}function p(t,e){if(!t||e.ignoreAttributes)return null;var i={},r=!1;for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(i[s.startsWith(e.attributeNamePrefix)?s.substr(e.attributeNamePrefix.length):s]=o(t[s]),r=!0);return r?i:null}function u(t,e){if(!Array.isArray(t))return null!=t?t.toString():"";for(var i="",r=0;r<t.length;r++){var s=t[r],n=c(s);if(n===e.textNodeName)i+=s[n];else if(n===e.cdataPropName)i+=s[n][0][e.textNodeName];else if(n===e.commentPropName)i+=s[n][0][e.textNodeName];else{if(n&&"?"===n[0])continue;if(n){var o=l(s[":@"],e),a=u(s[n],e);a&&0!==a.length?i+="<"+n+o+">"+a+"</"+n+">":i+="<"+n+o+"/>"}}}return i}function l(t,e){var i="";if(t&&!e.ignoreAttributes)for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var s=t[r];!0===s&&e.suppressBooleanAttributes?i+=" "+r.substr(e.attributeNamePrefix.length):i+=" "+r.substr(e.attributeNamePrefix.length)+'="'+o(s)+'"'}return i}function c(t){for(var e=Object.keys(t),i=0;i<e.length;i++){var r=e[i];if(Object.prototype.hasOwnProperty.call(t,r)&&":@"!==r)return r}}function f(t,e,i){var r="";if(t&&!e.ignoreAttributes)for(var s in t)if(Object.prototype.hasOwnProperty.call(t,s)){var n=void 0;!0===(n=i?t[s]:g(n=e.attributeValueProcessor(s,t[s]),e))&&e.suppressBooleanAttributes?r+=" "+s.substr(e.attributeNamePrefix.length):r+=" "+s.substr(e.attributeNamePrefix.length)+'="'+o(n)+'"'}return r}function d(t,e){if(!e||0===e.length)return!1;for(var i=0;i<e.length;i++)if(t.matches(e[i]))return!0;return!1}function g(t,e){if(t&&t.length>0&&e.processEntities)for(var i=0;i<e.entities.length;i++){var r=e.entities[i];t=t.replace(r.regex,r.val)}return t}function m(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function b(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return v(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?v(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}var N={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0};function y(t){if(this.options=Object.assign({},N,t),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(function(t){return"string"==typeof t&&t.startsWith("*.")?".."+t.substring(2):t})),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(var e=0;e<this.options.stopNodes.length;e++){var r=this.options.stopNodes[e];"string"==typeof r?this.stopNodeExpressions.push(new i(r)):r instanceof i&&this.stopNodeExpressions.push(r)}var s;!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn="function"==typeof(s=this.options.ignoreAttributes)?s:Array.isArray(s)?function(t){for(var e,i=function(t,e){var i="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(i)return(i=i.call(t)).next.bind(i);if(Array.isArray(t)||(i=function(t,e){if(t){if("string"==typeof t)return m(t,e);var i={}.toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?m(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var r=0;return function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(s);!(e=i()).done;){var r=e.value;if("string"==typeof r&&t===r)return!0;if(r instanceof RegExp&&r.test(t))return!0}}:function(){return!1},this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=S),this.processTextOrObjNode=x,this.options.format?(this.indentate=A,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function x(t,e,i,r){var s=this.extractAttributes(t);if(r.push(e,s),this.checkStopNode(r)){var n=this.buildRawContent(t),o=this.buildAttributesForStopNode(t);return r.pop(),this.buildObjectNode(n,e,o,i)}var a=this.j2x(t,i+1,r);return r.pop(),void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,a.attrStr,i,r):this.buildObjectNode(a.val,e,a.attrStr,i)}function A(t){return this.options.indentBy.repeat(t)}function S(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}return y.prototype.build=function(t){if(this.options.preserveOrder)return a(t,this.options);var e;Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&((e={})[this.options.arrayNodeName]=t,t=e);var i=new r;return this.j2x(t,0,i).val},y.prototype.j2x=function(t,e,i){var r="",s="";if(this.options.maxNestedTags&&i.getDepth()>=this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");var n=this.options.jPath?i.toString():i,o=this.checkStopNode(i);for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a))if(void 0===t[a])this.isAttribute(a)&&(s+="");else if(null===t[a])this.isAttribute(a)||a===this.options.cdataPropName||a===this.options.commentPropName?s+="":"?"===a[0]?s+=this.indentate(e)+"<"+a+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+a+"/"+this.tagEndChar;else if(t[a]instanceof Date)s+=this.buildTextValNode(t[a],a,"",e,i);else if("object"!=typeof t[a]){var h=this.isAttribute(a);if(h&&!this.ignoreAttributesFn(h,n))r+=this.buildAttrPairStr(h,""+t[a],o);else if(!h)if(a===this.options.textNodeName){var p=this.options.tagValueProcessor(a,""+t[a]);s+=this.replaceEntitiesValue(p)}else{i.push(a);var u=this.checkStopNode(i);if(i.pop(),u){var l=""+t[a];s+=""===l?this.indentate(e)+"<"+a+this.closeTag(a)+this.tagEndChar:this.indentate(e)+"<"+a+">"+l+"</"+a+this.tagEndChar}else s+=this.buildTextValNode(t[a],a,"",e,i)}}else if(Array.isArray(t[a])){for(var c=t[a].length,f="",d="",g=0;g<c;g++){var m=t[a][g];if(void 0===m);else if(null===m)"?"===a[0]?s+=this.indentate(e)+"<"+a+"?"+this.tagEndChar:s+=this.indentate(e)+"<"+a+"/"+this.tagEndChar;else if("object"==typeof m)if(this.options.oneListGroup){i.push(a);var b=this.j2x(m,e+1,i);i.pop(),f+=b.val,this.options.attributesGroupName&&m.hasOwnProperty(this.options.attributesGroupName)&&(d+=b.attrStr)}else f+=this.processTextOrObjNode(m,a,e,i);else if(this.options.oneListGroup){var v=this.options.tagValueProcessor(a,m);f+=v=this.replaceEntitiesValue(v)}else{i.push(a);var N=this.checkStopNode(i);if(i.pop(),N){var y=""+m;f+=""===y?this.indentate(e)+"<"+a+this.closeTag(a)+this.tagEndChar:this.indentate(e)+"<"+a+">"+y+"</"+a+this.tagEndChar}else f+=this.buildTextValNode(m,a,"",e,i)}}this.options.oneListGroup&&(f=this.buildObjectNode(f,a,d,e)),s+=f}else if(this.options.attributesGroupName&&a===this.options.attributesGroupName)for(var x=Object.keys(t[a]),A=x.length,S=0;S<A;S++)r+=this.buildAttrPairStr(x[S],""+t[a][x[S]],o);else s+=this.processTextOrObjNode(t[a],a,e,i);return{attrStr:r,val:s}},y.prototype.buildAttrPairStr=function(t,e,i){return i||(e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e)),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+o(e)+'"'},y.prototype.extractAttributes=function(t){if(!t||"object"!=typeof t)return null;var e={},i=!1;if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){var r=t[this.options.attributesGroupName];for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&(e[s.startsWith(this.options.attributeNamePrefix)?s.substring(this.options.attributeNamePrefix.length):s]=o(r[s]),i=!0)}else for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var a=this.isAttribute(n);a&&(e[a]=o(t[n]),i=!0)}return i?e:null},y.prototype.buildRawContent=function(t){if("string"==typeof t)return t;if("object"!=typeof t||null===t)return String(t);if(void 0!==t[this.options.textNodeName])return t[this.options.textNodeName];var e="";for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)&&!(this.isAttribute(i)||this.options.attributesGroupName&&i===this.options.attributesGroupName)){var r=t[i];if(i===this.options.textNodeName)e+=r;else if(Array.isArray(r))for(var s,n=b(r);!(s=n()).done;){var o=s.value;if("string"==typeof o||"number"==typeof o)e+="<"+i+">"+o+"</"+i+">";else if("object"==typeof o&&null!==o){var a=this.buildRawContent(o),h=this.buildAttributesForStopNode(o);e+=""===a?"<"+i+h+"/>":"<"+i+h+">"+a+"</"+i+">"}}else if("object"==typeof r&&null!==r){var p=this.buildRawContent(r),u=this.buildAttributesForStopNode(r);e+=""===p?"<"+i+u+"/>":"<"+i+u+">"+p+"</"+i+">"}else e+="<"+i+">"+r+"</"+i+">"}return e},y.prototype.buildAttributesForStopNode=function(t){if(!t||"object"!=typeof t)return"";var e="";if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){var i=t[this.options.attributesGroupName];for(var r in i)if(Object.prototype.hasOwnProperty.call(i,r)){var s=r.startsWith(this.options.attributeNamePrefix)?r.substring(this.options.attributeNamePrefix.length):r,n=i[r];!0===n&&this.options.suppressBooleanAttributes?e+=" "+s:e+=" "+s+'="'+n+'"'}}else for(var o in t)if(Object.prototype.hasOwnProperty.call(t,o)){var a=this.isAttribute(o);if(a){var h=t[o];!0===h&&this.options.suppressBooleanAttributes?e+=" "+a:e+=" "+a+'="'+h+'"'}}return e},y.prototype.buildObjectNode=function(t,e,i,r){if(""===t)return"?"===e[0]?this.indentate(r)+"<"+e+i+"?"+this.tagEndChar:this.indentate(r)+"<"+e+i+this.closeTag(e)+this.tagEndChar;var s="</"+e+this.tagEndChar,n="";return"?"===e[0]&&(n="?",s=""),!i&&""!==i||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===n.length?this.indentate(r)+"\x3c!--"+t+"--\x3e"+this.newLine:this.indentate(r)+"<"+e+i+n+this.tagEndChar+t+this.indentate(r)+s:this.indentate(r)+"<"+e+i+n+">"+t+s},y.prototype.closeTag=function(t){var e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":"></"+t,e},y.prototype.checkStopNode=function(t){if(!this.stopNodeExpressions||0===this.stopNodeExpressions.length)return!1;for(var e=0;e<this.stopNodeExpressions.length;e++)if(t.matches(this.stopNodeExpressions[e]))return!0;return!1},y.prototype.buildTextValNode=function(t,e,i,r,o){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName){var a=n(t);return this.indentate(r)+"<![CDATA["+a+"]]>"+this.newLine}if(!1!==this.options.commentPropName&&e===this.options.commentPropName){var h=s(t);return this.indentate(r)+"\x3c!--"+h+"--\x3e"+this.newLine}if("?"===e[0])return this.indentate(r)+"<"+e+i+"?"+this.tagEndChar;var p=this.options.tagValueProcessor(e,t);return""===(p=this.replaceEntitiesValue(p))?this.indentate(r)+"<"+e+i+this.closeTag(e)+this.tagEndChar:this.indentate(r)+"<"+e+i+">"+p+"</"+e+this.tagEndChar},y.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(var e=0;e<this.options.entities.length;e++){var i=this.options.entities[e];t=t.replace(i.regex,i.val)}return t},e})());
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fxb=e():t.fxb=e()}(this,()=>(()=>{"use strict";var t={d:(e,r)=>{for(var i in r)t.o(r,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:r[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.r(e),t.d(e,{default:()=>_});class r{constructor(t,e={},r){this.pattern=t,this.separator=e.separator||".",this.segments=this._parse(t),this.data=r,this._hasDeepWildcard=this.segments.some(t=>"deep-wildcard"===t.type),this._hasAttributeCondition=this.segments.some(t=>void 0!==t.attrName),this._hasPositionSelector=this.segments.some(t=>void 0!==t.position)}_parse(t){const e=[];let r=0,i="";for(;r<t.length;)t[r]===this.separator?r+1<t.length&&t[r+1]===this.separator?(i.trim()&&(e.push(this._parseSegment(i.trim())),i=""),e.push({type:"deep-wildcard"}),r+=2):(i.trim()&&e.push(this._parseSegment(i.trim())),i="",r++):(i+=t[r],r++);return i.trim()&&e.push(this._parseSegment(i.trim())),e}_parseSegment(t){const e={type:"tag"};let r=null,i=t;const s=t.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(s&&(i=s[1]+s[3],s[2])){const t=s[2].slice(1,-1);t&&(r=t)}let n,a,o=i;if(i.includes("::")){const e=i.indexOf("::");if(n=i.substring(0,e).trim(),o=i.substring(e+2).trim(),!n)throw new Error(`Invalid namespace in pattern: ${t}`)}let h=null;if(o.includes(":")){const t=o.lastIndexOf(":"),e=o.substring(0,t).trim(),r=o.substring(t+1).trim();["first","last","odd","even"].includes(r)||/^nth\(\d+\)$/.test(r)?(a=e,h=r):a=o}else a=o;if(!a)throw new Error(`Invalid segment pattern: ${t}`);if(e.tag=a,n&&(e.namespace=n),r)if(r.includes("=")){const t=r.indexOf("=");e.attrName=r.substring(0,t).trim(),e.attrValue=r.substring(t+1).trim()}else e.attrName=r.trim();if(h){const t=h.match(/^nth\((\d+)\)$/);t?(e.position="nth",e.positionValue=parseInt(t[1],10)):e.position=h}return e}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class i{constructor(t){this._matcher=t}get separator(){return this._matcher.separator}getCurrentTag(){const t=this._matcher.path;return t.length>0?t[t.length-1].tag:void 0}getCurrentNamespace(){const t=this._matcher.path;return t.length>0?t[t.length-1].namespace:void 0}getAttrValue(t){const e=this._matcher.path;if(0!==e.length)return e[e.length-1].values?.[t]}hasAttr(t){const e=this._matcher.path;if(0===e.length)return!1;const r=e[e.length-1];return void 0!==r.values&&t in r.values}getPosition(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].position??0}getCounter(){const t=this._matcher.path;return 0===t.length?-1:t[t.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this._matcher.path.length}toString(t,e=!0){return this._matcher.toString(t,e)}toArray(){return this._matcher.path.map(t=>t.tag)}matches(t){return this._matcher.matches(t)}matchesAny(t){return t.matchesAny(this._matcher)}}class s{constructor(t={}){this.separator=t.separator||".",this.path=[],this.siblingStacks=[],this._pathStringCache=null,this._view=new i(this)}push(t,e=null,r=null){this._pathStringCache=null,this.path.length>0&&(this.path[this.path.length-1].values=void 0);const i=this.path.length;this.siblingStacks[i]||(this.siblingStacks[i]=new Map);const s=this.siblingStacks[i],n=r?`${r}:${t}`:t,a=s.get(n)||0;let o=0;for(const t of s.values())o+=t;s.set(n,a+1);const h={tag:t,position:o,counter:a};null!=r&&(h.namespace=r),null!=e&&(h.values=e),this.path.push(h)}pop(){if(0===this.path.length)return;this._pathStringCache=null;const t=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),t}updateCurrent(t){if(this.path.length>0){const e=this.path[this.path.length-1];null!=t&&(e.values=t)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(t){if(0!==this.path.length)return this.path[this.path.length-1].values?.[t]}hasAttr(t){if(0===this.path.length)return!1;const e=this.path[this.path.length-1];return void 0!==e.values&&t in e.values}getPosition(){return 0===this.path.length?-1:this.path[this.path.length-1].position??0}getCounter(){return 0===this.path.length?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(t,e=!0){const r=t||this.separator;if(r===this.separator&&!0===e){if(null!==this._pathStringCache)return this._pathStringCache;const t=this.path.map(t=>t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(r);return this._pathStringCache=t,t}return this.path.map(t=>e&&t.namespace?`${t.namespace}:${t.tag}`:t.tag).join(r)}toArray(){return this.path.map(t=>t.tag)}reset(){this._pathStringCache=null,this.path=[],this.siblingStacks=[]}matches(t){const e=t.segments;return 0!==e.length&&(t.hasDeepWildcard()?this._matchWithDeepWildcard(e):this._matchSimple(e))}_matchSimple(t){if(this.path.length!==t.length)return!1;for(let e=0;e<t.length;e++)if(!this._matchSegment(t[e],this.path[e],e===this.path.length-1))return!1;return!0}_matchWithDeepWildcard(t){let e=this.path.length-1,r=t.length-1;for(;r>=0&&e>=0;){const i=t[r];if("deep-wildcard"===i.type){if(r--,r<0)return!0;const i=t[r];let s=!1;for(let t=e;t>=0;t--)if(this._matchSegment(i,this.path[t],t===this.path.length-1)){e=t-1,r--,s=!0;break}if(!s)return!1}else{if(!this._matchSegment(i,this.path[e],e===this.path.length-1))return!1;e--,r--}}return r<0}_matchSegment(t,e,r){if("*"!==t.tag&&t.tag!==e.tag)return!1;if(void 0!==t.namespace&&"*"!==t.namespace&&t.namespace!==e.namespace)return!1;if(void 0!==t.attrName){if(!r)return!1;if(!e.values||!(t.attrName in e.values))return!1;if(void 0!==t.attrValue&&String(e.values[t.attrName])!==String(t.attrValue))return!1}if(void 0!==t.position){if(!r)return!1;const i=e.counter??0;if("first"===t.position&&0!==i)return!1;if("odd"===t.position&&i%2!=1)return!1;if("even"===t.position&&i%2!=0)return!1;if("nth"===t.position&&i!==t.positionValue)return!1}return!0}matchesAny(t){return t.matchesAny(this)}snapshot(){return{path:this.path.map(t=>({...t})),siblingStacks:this.siblingStacks.map(t=>new Map(t))}}restore(t){this._pathStringCache=null,this.path=t.path.map(t=>({...t})),this.siblingStacks=t.siblingStacks.map(t=>new Map(t))}readOnly(){return this._view}}function n(t){return String(t).replace(/--/g,"- -").replace(/--/g,"- -").replace(/-$/,"- ")}function a(t){return String(t).replace(/\]\]>/g,"]]]]><![CDATA[>")}function o(t){return String(t).replace(/"/g,"&quot;").replace(/'/g,"&apos;")}const h=":A-Za-z_À-ÖØ-öø-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�",p=":A-Za-z_À-˿Ͱ-ͽͿ-҆҈-῿‌-‍⁰-↏Ⰰ-⿯、-퟿豈-﷏ﷰ-�𐀀-󯿿",u=p+"\\-\\.\\d·̀-ͯ҇‿-⁀",l=(t,e,r="")=>{const i=`[${t.replace(":","")}][${e.replace(":","")}]*`;return{name:new RegExp(`^[${t}][${e}]*$`,r),ncName:new RegExp(`^${i}$`,r),qName:new RegExp(`^${i}(?::${i})?$`,r),nmToken:new RegExp(`^[${e}]+$`,r),nmTokens:new RegExp(`^[${e}]+(?:\\s+[${e}]+)*$`,r)}},c=l(h,h+"\\-\\.\\d·̀-ͯ‿-⁀"),f=l(p,u,"u"),d=(t,{xmlVersion:e="1.0"}={})=>((t="1.0")=>"1.1"===t?f:c)(e).qName.test(t);function g(t,e,r,i,s){return r.sanitizeName?d(t,{xmlVersion:s})?t:r.sanitizeName(t,{isAttribute:e,matcher:i.readOnly()}):t}function m(t,e){var i="";e.format&&(i="\n");var n=[];if(e.stopNodes&&Array.isArray(e.stopNodes))for(var a=0;a<e.stopNodes.length;a++){var o=e.stopNodes[a];"string"==typeof o?n.push(new r(o)):o instanceof r&&n.push(o)}var h=function(t,e){if(!Array.isArray(t)||0===t.length)return"1.0";var r=t[0];if("?xml"===x(r)){var i=r[":@"];if(i){var s=e.attributeNamePrefix+"version";if(i[s])return i[s]}}return"1.0"}(t,e);return b(t,e,i,new s,n,h)}function b(t,e,r,i,s,o){var h="",p=!1;if(e.maxNestedTags&&i.getDepth()>e.maxNestedTags)throw new Error("Maximum nested tags exceeded");if(!Array.isArray(t)){if(null!=t){var u=t.toString();return P(u,e)}return""}for(var l=0;l<t.length;l++){var c=t[l],f=x(c);if(void 0!==f){var d=f===e.textNodeName||f===e.cdataPropName||f===e.commentPropName||"?"===f[0]?f:g(f,!1,e,i,o),m=v(c[":@"],e);i.push(d,m);var y=S(i,s);if(d!==e.textNodeName)if(d!==e.cdataPropName)if(d!==e.commentPropName)if("?"!==d[0]){var w=r;""!==w&&(w+=e.indentBy);var E=r+"<"+d+A(c[":@"],e,y,i,o),O=void 0;O=y?N(c[f],e):b(c[f],e,w,i,s,o),-1!==e.unpairedTags.indexOf(d)?e.suppressUnpairedNode?h+=E+">":h+=E+"/>":O&&0!==O.length||!e.suppressEmptyNode?O&&O.endsWith(">")?h+=E+">"+O+r+"</"+d+">":(h+=E+">",O&&""!==r&&(O.includes("/>")||O.includes("</"))?h+=r+e.indentBy+O+r:h+=O,h+="</"+d+">"):h+=E+"/>",p=!0,i.pop()}else h+=("?xml"===d?"":r)+"<"+d+A(c[":@"],e,y,i,o)+"?>",p=!0,i.pop();else h+=r+"\x3c!--"+n(c[f][0][e.textNodeName])+"--\x3e",p=!0,i.pop();else p&&(h+=r),h+="<![CDATA["+a(c[f][0][e.textNodeName])+"]]>",p=!1,i.pop();else{var j=c[f];y||(j=P(j=e.tagValueProcessor(d,j),e)),p&&(h+=r),h+=j,p=!1,i.pop()}}}return h}function v(t,e){if(!t||e.ignoreAttributes)return null;var r={},i=!1;for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s.startsWith(e.attributeNamePrefix)?s.substr(e.attributeNamePrefix.length):s]=o(t[s]),i=!0);return i?r:null}function N(t,e){if(!Array.isArray(t))return null!=t?t.toString():"";for(var r="",i=0;i<t.length;i++){var s=t[i],n=x(s);if(n===e.textNodeName)r+=s[n];else if(n===e.cdataPropName)r+=s[n][0][e.textNodeName];else if(n===e.commentPropName)r+=s[n][0][e.textNodeName];else{if(n&&"?"===n[0])continue;if(n){var a=y(s[":@"],e),o=N(s[n],e);o&&0!==o.length?r+="<"+n+a+">"+o+"</"+n+">":r+="<"+n+a+"/>"}}}return r}function y(t,e){var r="";if(t&&!e.ignoreAttributes)for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var s=t[i];!0===s&&e.suppressBooleanAttributes?r+=" "+i.substr(e.attributeNamePrefix.length):r+=" "+i.substr(e.attributeNamePrefix.length)+'="'+o(s)+'"'}return r}function x(t){for(var e=Object.keys(t),r=0;r<e.length;r++){var i=e[r];if(Object.prototype.hasOwnProperty.call(t,i)&&":@"!==i)return i}}function A(t,e,r,i,s){var n="";if(t&&!e.ignoreAttributes)for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var h=a.substr(e.attributeNamePrefix.length),p=r?h:g(h,!0,e,i,s),u=void 0;!0===(u=r?t[a]:P(u=e.attributeValueProcessor(a,t[a]),e))&&e.suppressBooleanAttributes?n+=" "+p:n+=" "+p+'="'+o(u)+'"'}return n}function S(t,e){if(!e||0===e.length)return!1;for(var r=0;r<e.length;r++)if(t.matches(e[r]))return!0;return!1}function P(t,e){if(t&&t.length>0&&e.processEntities)for(var r=0;r<e.entities.length;r++){var i=e.entities[r];t=t.replace(i.regex,i.val)}return t}function w(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}function E(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return O(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?O(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function O(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,i=Array(e);r<e;r++)i[r]=t[r];return i}var j={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&amp;"},{regex:new RegExp(">","g"),val:"&gt;"},{regex:new RegExp("<","g"),val:"&lt;"},{regex:new RegExp("'","g"),val:"&apos;"},{regex:new RegExp('"',"g"),val:"&quot;"}],processEntities:!0,stopNodes:[],oneListGroup:!1,maxNestedTags:100,jPath:!0,sanitizeName:!1};function _(t){if(this.options=Object.assign({},j,t),this.options.stopNodes&&Array.isArray(this.options.stopNodes)&&(this.options.stopNodes=this.options.stopNodes.map(function(t){return"string"==typeof t&&t.startsWith("*.")?".."+t.substring(2):t})),this.stopNodeExpressions=[],this.options.stopNodes&&Array.isArray(this.options.stopNodes))for(var e=0;e<this.options.stopNodes.length;e++){var i=this.options.stopNodes[e];"string"==typeof i?this.stopNodeExpressions.push(new r(i)):i instanceof r&&this.stopNodeExpressions.push(i)}var s;!0===this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn="function"==typeof(s=this.options.ignoreAttributes)?s:Array.isArray(s)?function(t){for(var e,r=function(t,e){var r="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(r)return(r=r.call(t)).next.bind(r);if(Array.isArray(t)||(r=function(t,e){if(t){if("string"==typeof t)return w(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?w(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){r&&(t=r);var i=0;return function(){return i>=t.length?{done:!0}:{done:!1,value:t[i++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(s);!(e=r()).done;){var i=e.value;if("string"==typeof i&&t===i)return!0;if(i instanceof RegExp&&i.test(t))return!0}}:function(){return!1},this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=$),this.processTextOrObjNode=T,this.options.format?(this.indentate=V,this.tagEndChar=">\n",this.newLine="\n"):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}function C(t,e,r,i,s){return r.sanitizeName?d(t,{xmlVersion:s})?t:r.sanitizeName(t,{isAttribute:e,matcher:i.readOnly()}):t}function T(t,e,r,i,s){var n=this.extractAttributes(t);if(i.push(e,n),this.checkStopNode(i)){var a=this.buildRawContent(t),o=this.buildAttributesForStopNode(t);return i.pop(),this.buildObjectNode(a,e,o,r)}var h=this.j2x(t,r+1,i,s);return i.pop(),"?"===e[0]?this.buildTextValNode("",e,h.attrStr,r,i):void 0!==t[this.options.textNodeName]&&1===Object.keys(t).length?this.buildTextValNode(t[this.options.textNodeName],e,h.attrStr,r,i):this.buildObjectNode(h.val,e,h.attrStr,r)}function V(t){return this.options.indentBy.repeat(t)}function $(t){return!(!t.startsWith(this.options.attributeNamePrefix)||t===this.options.textNodeName)&&t.substr(this.attrPrefixLen)}return _.prototype.build=function(t){if(this.options.preserveOrder)return m(t,this.options);var e;Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&((e={})[this.options.arrayNodeName]=t,t=e);var r=new s,i=function(t,e){var r=t["?xml"];if(r&&"object"==typeof r){if(e.attributesGroupName&&r[e.attributesGroupName]){var i=r[e.attributesGroupName][e.attributeNamePrefix+"version"];if(i)return i}var s=r[e.attributeNamePrefix+"version"];if(s)return s}return"1.0"}(t,this.options);return this.j2x(t,0,r,i).val},_.prototype.j2x=function(t,e,r,i){var s="",n="";if(this.options.maxNestedTags&&r.getDepth()>=this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");var a=this.options.jPath?r.toString():r,o=this.checkStopNode(r);for(var h in t)if(Object.prototype.hasOwnProperty.call(t,h)){var p=h===this.options.textNodeName||h===this.options.cdataPropName||h===this.options.commentPropName||this.options.attributesGroupName&&h===this.options.attributesGroupName||this.isAttribute(h)||"?"===h[0]?h:C(h,!1,this.options,r,i);if(void 0===t[h])this.isAttribute(h)&&(n+="");else if(null===t[h])this.isAttribute(h)||p===this.options.cdataPropName||p===this.options.commentPropName?n+="":"?"===p[0]?n+=this.indentate(e)+"<"+p+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+p+"/"+this.tagEndChar;else if(t[h]instanceof Date)n+=this.buildTextValNode(t[h],p,"",e,r);else if("object"!=typeof t[h]){var u=this.isAttribute(h);if(u&&!this.ignoreAttributesFn(u,a)){var l=C(u,!0,this.options,r,i);s+=this.buildAttrPairStr(l,""+t[h],o)}else if(!u)if(h===this.options.textNodeName){var c=this.options.tagValueProcessor(h,""+t[h]);n+=this.replaceEntitiesValue(c)}else{r.push(p);var f=this.checkStopNode(r);if(r.pop(),f){var d=""+t[h];n+=""===d?this.indentate(e)+"<"+p+this.closeTag(p)+this.tagEndChar:this.indentate(e)+"<"+p+">"+d+"</"+p+this.tagEndChar}else n+=this.buildTextValNode(t[h],p,"",e,r)}}else if(Array.isArray(t[h])){for(var g=t[h].length,m="",b="",v=0;v<g;v++){var N=t[h][v];if(void 0===N);else if(null===N)"?"===p[0]?n+=this.indentate(e)+"<"+p+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+p+"/"+this.tagEndChar;else if("object"==typeof N)if(this.options.oneListGroup){r.push(p);var y=this.j2x(N,e+1,r,i);r.pop(),m+=y.val,this.options.attributesGroupName&&N.hasOwnProperty(this.options.attributesGroupName)&&(b+=y.attrStr)}else m+=this.processTextOrObjNode(N,p,e,r,i);else if(this.options.oneListGroup){var x=this.options.tagValueProcessor(p,N);m+=x=this.replaceEntitiesValue(x)}else{r.push(p);var A=this.checkStopNode(r);if(r.pop(),A){var S=""+N;m+=""===S?this.indentate(e)+"<"+p+this.closeTag(p)+this.tagEndChar:this.indentate(e)+"<"+p+">"+S+"</"+p+this.tagEndChar}else m+=this.buildTextValNode(N,p,"",e,r)}}this.options.oneListGroup&&(m=this.buildObjectNode(m,p,b,e)),n+=m}else if(this.options.attributesGroupName&&h===this.options.attributesGroupName)for(var P=Object.keys(t[h]),w=P.length,E=0;E<w;E++){var O=C(P[E],!0,this.options,r,i);s+=this.buildAttrPairStr(O,""+t[h][P[E]],o)}else n+=this.processTextOrObjNode(t[h],p,e,r,i)}return{attrStr:s,val:n}},_.prototype.buildAttrPairStr=function(t,e,r){return r||(e=this.options.attributeValueProcessor(t,""+e),e=this.replaceEntitiesValue(e)),this.options.suppressBooleanAttributes&&"true"===e?" "+t:" "+t+'="'+o(e)+'"'},_.prototype.extractAttributes=function(t){if(!t||"object"!=typeof t)return null;var e={},r=!1;if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){var i=t[this.options.attributesGroupName];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s.startsWith(this.options.attributeNamePrefix)?s.substring(this.options.attributeNamePrefix.length):s]=o(i[s]),r=!0)}else for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var a=this.isAttribute(n);a&&(e[a]=o(t[n]),r=!0)}return r?e:null},_.prototype.buildRawContent=function(t){if("string"==typeof t)return t;if("object"!=typeof t||null===t)return String(t);if(void 0!==t[this.options.textNodeName])return t[this.options.textNodeName];var e="";for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&!(this.isAttribute(r)||this.options.attributesGroupName&&r===this.options.attributesGroupName)){var i=t[r];if(r===this.options.textNodeName)e+=i;else if(Array.isArray(i))for(var s,n=E(i);!(s=n()).done;){var a=s.value;if("string"==typeof a||"number"==typeof a)e+="<"+r+">"+a+"</"+r+">";else if("object"==typeof a&&null!==a){var o=this.buildRawContent(a),h=this.buildAttributesForStopNode(a);e+=""===o?"<"+r+h+"/>":"<"+r+h+">"+o+"</"+r+">"}}else if("object"==typeof i&&null!==i){var p=this.buildRawContent(i),u=this.buildAttributesForStopNode(i);e+=""===p?"<"+r+u+"/>":"<"+r+u+">"+p+"</"+r+">"}else e+="<"+r+">"+i+"</"+r+">"}return e},_.prototype.buildAttributesForStopNode=function(t){if(!t||"object"!=typeof t)return"";var e="";if(this.options.attributesGroupName&&t[this.options.attributesGroupName]){var r=t[this.options.attributesGroupName];for(var i in r)if(Object.prototype.hasOwnProperty.call(r,i)){var s=i.startsWith(this.options.attributeNamePrefix)?i.substring(this.options.attributeNamePrefix.length):i,n=r[i];!0===n&&this.options.suppressBooleanAttributes?e+=" "+s:e+=" "+s+'="'+n+'"'}}else for(var a in t)if(Object.prototype.hasOwnProperty.call(t,a)){var o=this.isAttribute(a);if(o){var h=t[a];!0===h&&this.options.suppressBooleanAttributes?e+=" "+o:e+=" "+o+'="'+h+'"'}}return e},_.prototype.buildObjectNode=function(t,e,r,i){if(""===t)return"?"===e[0]?this.indentate(i)+"<"+e+r+"?"+this.tagEndChar:this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar;if("?"===e[0])return this.indentate(i)+"<"+e+r+"?"+this.tagEndChar;var s="</"+e+this.tagEndChar,n="";return"?"===e[0]&&(n="?",s=""),!r&&""!==r||-1!==t.indexOf("<")?!1!==this.options.commentPropName&&e===this.options.commentPropName&&0===n.length?this.indentate(i)+"\x3c!--"+t+"--\x3e"+this.newLine:this.indentate(i)+"<"+e+r+n+this.tagEndChar+t+this.indentate(i)+s:this.indentate(i)+"<"+e+r+n+">"+t+s},_.prototype.closeTag=function(t){var e="";return-1!==this.options.unpairedTags.indexOf(t)?this.options.suppressUnpairedNode||(e="/"):e=this.options.suppressEmptyNode?"/":"></"+t,e},_.prototype.checkStopNode=function(t){if(!this.stopNodeExpressions||0===this.stopNodeExpressions.length)return!1;for(var e=0;e<this.stopNodeExpressions.length;e++)if(t.matches(this.stopNodeExpressions[e]))return!0;return!1},_.prototype.buildTextValNode=function(t,e,r,i,s){if(!1!==this.options.cdataPropName&&e===this.options.cdataPropName){var o=a(t);return this.indentate(i)+"<![CDATA["+o+"]]>"+this.newLine}if(!1!==this.options.commentPropName&&e===this.options.commentPropName){var h=n(t);return this.indentate(i)+"\x3c!--"+h+"--\x3e"+this.newLine}if("?"===e[0])return this.indentate(i)+"<"+e+r+"?"+this.tagEndChar;var p=this.options.tagValueProcessor(e,t);return""===(p=this.replaceEntitiesValue(p))?this.indentate(i)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(i)+"<"+e+r+">"+p+"</"+e+this.tagEndChar},_.prototype.replaceEntitiesValue=function(t){if(t&&t.length>0&&this.options.processEntities)for(var e=0;e<this.options.entities.length;e++){var r=this.options.entities[e];t=t.replace(r.regex,r.val)}return t},e})());
2
2
  //# sourceMappingURL=fxb.min.js.map