@wavemaker/angular-app 11.14.1-21.64731 → 11.14.1-21.64741
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.
- package/dependencies/pipe-provider.cjs.js +1150 -640
- package/dependencies/transpilation-web.cjs.js +568 -314
- package/dependency-report.html +1 -1
- package/npm-shrinkwrap.json +76 -76
- package/package-lock.json +76 -76
- package/package.json +5 -5
|
@@ -37850,7 +37850,7 @@ function requireDom () {
|
|
|
37850
37850
|
ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
|
|
37851
37851
|
var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
|
|
37852
37852
|
//level2
|
|
37853
|
-
ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
|
|
37853
|
+
var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
|
|
37854
37854
|
ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
|
|
37855
37855
|
ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
|
|
37856
37856
|
ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
|
|
@@ -37900,9 +37900,10 @@ function requireDom () {
|
|
|
37900
37900
|
item: function(index) {
|
|
37901
37901
|
return index >= 0 && index < this.length ? this[index] : null;
|
|
37902
37902
|
},
|
|
37903
|
-
toString:function(isHTML,nodeFilter){
|
|
37903
|
+
toString:function(isHTML,nodeFilter,options){
|
|
37904
|
+
var requireWellFormed = !!options && !!options.requireWellFormed;
|
|
37904
37905
|
for(var buf = [], i = 0;i<this.length;i++){
|
|
37905
|
-
serializeToString(this[i],buf,isHTML,nodeFilter);
|
|
37906
|
+
serializeToString(this[i],buf,isHTML,nodeFilter,null,requireWellFormed);
|
|
37906
37907
|
}
|
|
37907
37908
|
return buf.join('');
|
|
37908
37909
|
},
|
|
@@ -38147,13 +38148,28 @@ function requireDom () {
|
|
|
38147
38148
|
/**
|
|
38148
38149
|
* Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
|
|
38149
38150
|
*
|
|
38150
|
-
* __This
|
|
38151
|
+
* __This implementation differs from the specification:__
|
|
38151
38152
|
* - this implementation is not validating names or qualified names
|
|
38152
38153
|
* (when parsing XML strings, the SAX parser takes care of that)
|
|
38153
38154
|
*
|
|
38155
|
+
* Note: `internalSubset` can only be introduced via a direct property write to `node.internalSubset` after creation.
|
|
38156
|
+
* Creation-time validation of `publicId`, `systemId` is not enforced.
|
|
38157
|
+
* The serializer-level check covers all mutation vectors, including direct property writes.
|
|
38158
|
+
* `internalSubset` is only serialized as `[ ... ]` when both `publicId` and `systemId` are
|
|
38159
|
+
* absent (empty or `'.'`) — if either external identifier is present, `internalSubset` is
|
|
38160
|
+
* silently omitted from the serialized output.
|
|
38161
|
+
*
|
|
38154
38162
|
* @param {string} qualifiedName
|
|
38155
38163
|
* @param {string} [publicId]
|
|
38164
|
+
* The external subset public identifier. Stored verbatim including surrounding quotes.
|
|
38165
|
+
* When serialized with `requireWellFormed: true` (via the 4th-parameter options object),
|
|
38166
|
+
* throws `DOMException` with code `INVALID_STATE_ERR` if the value is non-empty and does
|
|
38167
|
+
* not match the XML `PubidLiteral` production (W3C DOM Parsing §3.2.1.3; XML 1.0 [12]).
|
|
38156
38168
|
* @param {string} [systemId]
|
|
38169
|
+
* The external subset system identifier. Stored verbatim including surrounding quotes.
|
|
38170
|
+
* When serialized with `requireWellFormed: true`, throws `DOMException` with code
|
|
38171
|
+
* `INVALID_STATE_ERR` if the value is non-empty and does not match the XML `SystemLiteral`
|
|
38172
|
+
* production (W3C DOM Parsing §3.2.1.3; XML 1.0 [11]).
|
|
38157
38173
|
* @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation
|
|
38158
38174
|
* or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`
|
|
38159
38175
|
*
|
|
@@ -38219,18 +38235,44 @@ function requireDom () {
|
|
|
38219
38235
|
return cloneNode(this.ownerDocument||this,this,deep);
|
|
38220
38236
|
},
|
|
38221
38237
|
// Modified in DOM Level 2:
|
|
38222
|
-
|
|
38223
|
-
|
|
38224
|
-
|
|
38225
|
-
|
|
38226
|
-
|
|
38227
|
-
|
|
38228
|
-
|
|
38229
|
-
|
|
38230
|
-
|
|
38231
|
-
|
|
38232
|
-
|
|
38233
|
-
|
|
38238
|
+
/**
|
|
38239
|
+
* Puts the specified node and all of its subtree into a "normalized" form. In a normalized
|
|
38240
|
+
* subtree, no text nodes in the subtree are empty and there are no adjacent text nodes.
|
|
38241
|
+
*
|
|
38242
|
+
* Specifically, this method merges any adjacent text nodes (i.e., nodes for which `nodeType`
|
|
38243
|
+
* is `TEXT_NODE`) into a single node with the combined data. It also removes any empty text
|
|
38244
|
+
* nodes.
|
|
38245
|
+
*
|
|
38246
|
+
* This method iteratively traverses all child nodes to normalize all descendant nodes within
|
|
38247
|
+
* the subtree.
|
|
38248
|
+
*
|
|
38249
|
+
* @throws {DOMException}
|
|
38250
|
+
* May throw a DOMException if operations within removeChild or appendData (which are
|
|
38251
|
+
* potentially invoked in this method) do not meet their specific constraints.
|
|
38252
|
+
* @see {@link Node.removeChild}
|
|
38253
|
+
* @see {@link CharacterData.appendData}
|
|
38254
|
+
* @see ../docs/walk-dom.md.
|
|
38255
|
+
*/
|
|
38256
|
+
normalize: function () {
|
|
38257
|
+
walkDOM(this, null, {
|
|
38258
|
+
enter: function (node) {
|
|
38259
|
+
// Merge adjacent text children of node before walkDOM schedules them.
|
|
38260
|
+
// walkDOM reads lastChild/previousSibling after enter returns, so the
|
|
38261
|
+
// surviving post-merge children are what it descends into.
|
|
38262
|
+
var child = node.firstChild;
|
|
38263
|
+
while (child) {
|
|
38264
|
+
var next = child.nextSibling;
|
|
38265
|
+
if (next !== null && next.nodeType === TEXT_NODE && child.nodeType === TEXT_NODE) {
|
|
38266
|
+
node.removeChild(next);
|
|
38267
|
+
child.appendData(next.data);
|
|
38268
|
+
// Do not advance child: re-check new nextSibling for another text run
|
|
38269
|
+
} else {
|
|
38270
|
+
child = next;
|
|
38271
|
+
}
|
|
38272
|
+
}
|
|
38273
|
+
return true; // descend into surviving children
|
|
38274
|
+
},
|
|
38275
|
+
});
|
|
38234
38276
|
},
|
|
38235
38277
|
// Introduced in DOM Level 2:
|
|
38236
38278
|
isSupported:function(feature, version){
|
|
@@ -38306,21 +38348,103 @@ function requireDom () {
|
|
|
38306
38348
|
copy(NodeType,Node.prototype);
|
|
38307
38349
|
|
|
38308
38350
|
/**
|
|
38309
|
-
* @param
|
|
38310
|
-
*
|
|
38351
|
+
* @param {Node} node
|
|
38352
|
+
* Root of the subtree to visit.
|
|
38353
|
+
* @param {function(Node): boolean} callback
|
|
38354
|
+
* Called for each node in depth-first pre-order. Return a truthy value to stop traversal early.
|
|
38355
|
+
* @return {boolean} `true` if traversal was aborted by the callback, `false` otherwise.
|
|
38311
38356
|
*/
|
|
38312
|
-
function _visitNode(node,callback){
|
|
38313
|
-
|
|
38314
|
-
return true;
|
|
38315
|
-
}
|
|
38316
|
-
if(node = node.firstChild){
|
|
38317
|
-
do{
|
|
38318
|
-
if(_visitNode(node,callback)){return true}
|
|
38319
|
-
}while(node=node.nextSibling)
|
|
38320
|
-
}
|
|
38357
|
+
function _visitNode(node, callback) {
|
|
38358
|
+
return walkDOM(node, null, { enter: function (n) { return callback(n) ? walkDOM.STOP : true; } }) === walkDOM.STOP;
|
|
38321
38359
|
}
|
|
38322
38360
|
|
|
38361
|
+
/**
|
|
38362
|
+
* Depth-first pre/post-order DOM tree walker.
|
|
38363
|
+
*
|
|
38364
|
+
* Visits every node in the subtree rooted at `node`. For each node:
|
|
38365
|
+
*
|
|
38366
|
+
* 1. Calls `callbacks.enter(node, context)` before descending into the node's children. The
|
|
38367
|
+
* return value becomes the `context` passed to each child's `enter` call and to the matching
|
|
38368
|
+
* `exit` call.
|
|
38369
|
+
* 2. If `enter` returns `null` or `undefined`, the node's children are skipped;
|
|
38370
|
+
* sibling traversal continues normally.
|
|
38371
|
+
* 3. If `enter` returns `walkDOM.STOP`, the entire traversal is aborted immediately — no
|
|
38372
|
+
* further `enter` or `exit` calls are made.
|
|
38373
|
+
* 4. `lastChild` and `previousSibling` are read **after** `enter` returns, so `enter` may
|
|
38374
|
+
* safely modify the node's own child list before the walker descends. Modifying siblings of
|
|
38375
|
+
* the current node or any other part of the tree produces unpredictable results: nodes already
|
|
38376
|
+
* queued on the stack are visited regardless of DOM changes, and newly inserted nodes outside
|
|
38377
|
+
* the current child list are never visited.
|
|
38378
|
+
* 5. Calls `callbacks.exit(node, context)` (if provided) after all of a node's children have
|
|
38379
|
+
* been visited, passing the same `context` that `enter`
|
|
38380
|
+
* returned for that node.
|
|
38381
|
+
*
|
|
38382
|
+
* This implementation uses an explicit stack and does not recurse — it is safe on arbitrarily
|
|
38383
|
+
* deep trees.
|
|
38384
|
+
*
|
|
38385
|
+
* @param {Node} node
|
|
38386
|
+
* Root of the subtree to walk.
|
|
38387
|
+
* @param {*} context
|
|
38388
|
+
* Initial context value passed to the root node's `enter`.
|
|
38389
|
+
* @param {{ enter: function(Node, *): *, exit?: function(Node, *): void }} callbacks
|
|
38390
|
+
* @returns {void | walkDOM.STOP}
|
|
38391
|
+
* @see ../docs/walk-dom.md.
|
|
38392
|
+
*/
|
|
38393
|
+
function walkDOM(node, context, callbacks) {
|
|
38394
|
+
// Each stack frame is {node, context, phase}:
|
|
38395
|
+
// walkDOM.ENTER — call enter, then push children
|
|
38396
|
+
// walkDOM.EXIT — call exit
|
|
38397
|
+
var stack = [{ node: node, context: context, phase: walkDOM.ENTER }];
|
|
38398
|
+
while (stack.length > 0) {
|
|
38399
|
+
var frame = stack.pop();
|
|
38400
|
+
if (frame.phase === walkDOM.ENTER) {
|
|
38401
|
+
var childContext = callbacks.enter(frame.node, frame.context);
|
|
38402
|
+
if (childContext === walkDOM.STOP) {
|
|
38403
|
+
return walkDOM.STOP;
|
|
38404
|
+
}
|
|
38405
|
+
// Push exit frame before children so it fires after all children are processed (Last In First Out)
|
|
38406
|
+
stack.push({ node: frame.node, context: childContext, phase: walkDOM.EXIT });
|
|
38407
|
+
if (childContext === null || childContext === undefined) {
|
|
38408
|
+
continue; // skip children
|
|
38409
|
+
}
|
|
38410
|
+
// lastChild is read after enter returns, so enter may modify the child list.
|
|
38411
|
+
var child = frame.node.lastChild;
|
|
38412
|
+
// Traverse from lastChild backwards so that pushing onto the stack
|
|
38413
|
+
// naturally yields firstChild on top (processed first).
|
|
38414
|
+
while (child) {
|
|
38415
|
+
stack.push({ node: child, context: childContext, phase: walkDOM.ENTER });
|
|
38416
|
+
child = child.previousSibling;
|
|
38417
|
+
}
|
|
38418
|
+
} else {
|
|
38419
|
+
// frame.phase === walkDOM.EXIT
|
|
38420
|
+
if (callbacks.exit) {
|
|
38421
|
+
callbacks.exit(frame.node, frame.context);
|
|
38422
|
+
}
|
|
38423
|
+
}
|
|
38424
|
+
}
|
|
38425
|
+
}
|
|
38323
38426
|
|
|
38427
|
+
/**
|
|
38428
|
+
* Sentinel value returned from a `walkDOM` `enter` callback to abort the entire traversal
|
|
38429
|
+
* immediately.
|
|
38430
|
+
*
|
|
38431
|
+
* @type {symbol}
|
|
38432
|
+
*/
|
|
38433
|
+
walkDOM.STOP = Symbol('walkDOM.STOP');
|
|
38434
|
+
/**
|
|
38435
|
+
* Phase constant for a stack frame that has not yet been visited.
|
|
38436
|
+
* The `enter` callback is called and children are scheduled.
|
|
38437
|
+
*
|
|
38438
|
+
* @type {number}
|
|
38439
|
+
*/
|
|
38440
|
+
walkDOM.ENTER = 0;
|
|
38441
|
+
/**
|
|
38442
|
+
* Phase constant for a stack frame whose subtree has been fully visited.
|
|
38443
|
+
* The `exit` callback is called.
|
|
38444
|
+
*
|
|
38445
|
+
* @type {number}
|
|
38446
|
+
*/
|
|
38447
|
+
walkDOM.EXIT = 1;
|
|
38324
38448
|
|
|
38325
38449
|
function Document(){
|
|
38326
38450
|
this.ownerDocument = this;
|
|
@@ -38945,6 +39069,23 @@ function requireDom () {
|
|
|
38945
39069
|
node.appendData(data);
|
|
38946
39070
|
return node;
|
|
38947
39071
|
},
|
|
39072
|
+
/**
|
|
39073
|
+
* Returns a ProcessingInstruction node whose target is target and data is data.
|
|
39074
|
+
*
|
|
39075
|
+
* __This implementation differs from the specification:__
|
|
39076
|
+
* - it does not do any input validation on the arguments and doesn't throw "InvalidCharacterError".
|
|
39077
|
+
*
|
|
39078
|
+
* Note: When the resulting document is serialized with `requireWellFormed: true`, the
|
|
39079
|
+
* serializer throws with code `INVALID_STATE_ERR` if `.data` contains `?>` (W3C DOM Parsing
|
|
39080
|
+
* §3.2.1.7). Without that option the data is emitted verbatim.
|
|
39081
|
+
*
|
|
39082
|
+
* @param {string} target
|
|
39083
|
+
* @param {string} data
|
|
39084
|
+
* @returns {ProcessingInstruction}
|
|
39085
|
+
* @see https://developer.mozilla.org/docs/Web/API/Document/createProcessingInstruction
|
|
39086
|
+
* @see https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
|
|
39087
|
+
* @see https://www.w3.org/TR/DOM-Parsing/#dfn-concept-serialize-xml §3.2.1.7
|
|
39088
|
+
*/
|
|
38948
39089
|
createProcessingInstruction : function(target,data){
|
|
38949
39090
|
var node = new ProcessingInstruction();
|
|
38950
39091
|
node.ownerDocument = this;
|
|
@@ -39170,6 +39311,19 @@ function requireDom () {
|
|
|
39170
39311
|
_extends(CDATASection,CharacterData);
|
|
39171
39312
|
|
|
39172
39313
|
|
|
39314
|
+
/**
|
|
39315
|
+
* Represents a DocumentType node (the `<!DOCTYPE ...>` declaration).
|
|
39316
|
+
*
|
|
39317
|
+
* `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
|
|
39318
|
+
* xmldom does not enforce the `readonly` constraint declared by the WHATWG DOM spec —
|
|
39319
|
+
* direct property writes succeed silently. Values are serialized verbatim when
|
|
39320
|
+
* `requireWellFormed` is false (the default). When the serializer is invoked with
|
|
39321
|
+
* `requireWellFormed: true` (via the 4th-parameter options object), it validates each
|
|
39322
|
+
* field and throws `DOMException` with code `INVALID_STATE_ERR` on invalid values.
|
|
39323
|
+
*
|
|
39324
|
+
* @class
|
|
39325
|
+
* @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentType MDN
|
|
39326
|
+
*/
|
|
39173
39327
|
function DocumentType() {
|
|
39174
39328
|
} DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
|
|
39175
39329
|
_extends(DocumentType,Node);
|
|
@@ -39200,22 +39354,45 @@ function requireDom () {
|
|
|
39200
39354
|
/**
|
|
39201
39355
|
* Returns the result of serializing `node` to XML.
|
|
39202
39356
|
*
|
|
39357
|
+
* When `options.requireWellFormed` is `true`, the serializer throws for content that would
|
|
39358
|
+
* produce ill-formed XML.
|
|
39359
|
+
*
|
|
39203
39360
|
* __This implementation differs from the specification:__
|
|
39204
39361
|
* - CDATASection nodes whose data contains `]]>` are serialized by splitting the section
|
|
39205
39362
|
* at each `]]>` occurrence (following W3C DOM Level 3 Core `split-cdata-sections`
|
|
39206
|
-
* default behaviour)
|
|
39363
|
+
* default behaviour) unless `requireWellFormed` is `true`.
|
|
39364
|
+
* - when `requireWellFormed` is `true`, `DOMException` with code `INVALID_STATE_ERR`
|
|
39365
|
+
* is only thrown to prevent injection vectors, not for all the spec mandated checks.
|
|
39207
39366
|
*
|
|
39208
39367
|
* @param {Node} node
|
|
39209
39368
|
* @param {boolean} [isHtml]
|
|
39210
39369
|
* @param {function} [nodeFilter]
|
|
39370
|
+
* @param {Object} [options]
|
|
39371
|
+
* @param {boolean} [options.requireWellFormed=false]
|
|
39372
|
+
* When `true`, throws for content that would produce ill-formed XML.
|
|
39211
39373
|
* @returns {string}
|
|
39374
|
+
* @throws {DOMException}
|
|
39375
|
+
* With code `INVALID_STATE_ERR` when `requireWellFormed` is `true` and:
|
|
39376
|
+
* - a CDATASection node's data contains `"]]>"`,
|
|
39377
|
+
* - a Comment node's data contains `"-->"` (bare `"--"` does not throw on this branch),
|
|
39378
|
+
* - a ProcessingInstruction's data contains `"?>"`,
|
|
39379
|
+
* - a DocumentType's `publicId` is non-empty and does not match the XML `PubidLiteral`
|
|
39380
|
+
* production,
|
|
39381
|
+
* - a DocumentType's `systemId` is non-empty and does not match the XML `SystemLiteral`
|
|
39382
|
+
* production, or
|
|
39383
|
+
* - a DocumentType's `internalSubset` contains `"]>"`.
|
|
39384
|
+
* Note: xmldom does not enforce `readonly` on DocumentType fields — direct property
|
|
39385
|
+
* writes succeed and are covered by the serializer-level checks above.
|
|
39212
39386
|
* @see https://html.spec.whatwg.org/#dom-xmlserializer-serializetostring
|
|
39387
|
+
* @see https://w3c.github.io/DOM-Parsing/#xml-serialization
|
|
39388
|
+
* @see https://github.com/w3c/DOM-Parsing/issues/84
|
|
39213
39389
|
*/
|
|
39214
|
-
XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){
|
|
39215
|
-
return nodeSerializeToString.call(node,isHtml,nodeFilter);
|
|
39390
|
+
XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter,options){
|
|
39391
|
+
return nodeSerializeToString.call(node,isHtml,nodeFilter,options);
|
|
39216
39392
|
};
|
|
39217
39393
|
Node.prototype.toString = nodeSerializeToString;
|
|
39218
|
-
function nodeSerializeToString(isHtml,nodeFilter){
|
|
39394
|
+
function nodeSerializeToString(isHtml,nodeFilter,options){
|
|
39395
|
+
var requireWellFormed = !!options && !!options.requireWellFormed;
|
|
39219
39396
|
var buf = [];
|
|
39220
39397
|
var refNode = this.nodeType == 9 && this.documentElement || this;
|
|
39221
39398
|
var prefix = refNode.prefix;
|
|
@@ -39232,7 +39409,7 @@ function requireDom () {
|
|
|
39232
39409
|
];
|
|
39233
39410
|
}
|
|
39234
39411
|
}
|
|
39235
|
-
serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
|
|
39412
|
+
serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces,requireWellFormed);
|
|
39236
39413
|
//console.log('###',this.nodeType,uri,prefix,buf.join(''))
|
|
39237
39414
|
return buf.join('');
|
|
39238
39415
|
}
|
|
@@ -39281,271 +39458,323 @@ function requireDom () {
|
|
|
39281
39458
|
buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
|
|
39282
39459
|
}
|
|
39283
39460
|
|
|
39284
|
-
function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
|
|
39461
|
+
function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces, requireWellFormed) {
|
|
39285
39462
|
if (!visibleNamespaces) {
|
|
39286
39463
|
visibleNamespaces = [];
|
|
39287
39464
|
}
|
|
39288
|
-
|
|
39289
|
-
|
|
39290
|
-
|
|
39291
|
-
|
|
39292
|
-
|
|
39293
|
-
|
|
39294
|
-
|
|
39295
|
-
|
|
39296
|
-
|
|
39297
|
-
|
|
39298
|
-
|
|
39299
|
-
//buf.sort.apply(attrs, attributeSorter);
|
|
39300
|
-
}
|
|
39301
|
-
|
|
39302
|
-
switch(node.nodeType){
|
|
39303
|
-
case ELEMENT_NODE:
|
|
39304
|
-
var attrs = node.attributes;
|
|
39305
|
-
var len = attrs.length;
|
|
39306
|
-
var child = node.firstChild;
|
|
39307
|
-
var nodeName = node.tagName;
|
|
39308
|
-
|
|
39309
|
-
isHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML;
|
|
39310
|
-
|
|
39311
|
-
var prefixedNodeName = nodeName;
|
|
39312
|
-
if (!isHTML && !node.prefix && node.namespaceURI) {
|
|
39313
|
-
var defaultNS;
|
|
39314
|
-
// lookup current default ns from `xmlns` attribute
|
|
39315
|
-
for (var ai = 0; ai < attrs.length; ai++) {
|
|
39316
|
-
if (attrs.item(ai).name === 'xmlns') {
|
|
39317
|
-
defaultNS = attrs.item(ai).value;
|
|
39318
|
-
break
|
|
39319
|
-
}
|
|
39320
|
-
}
|
|
39321
|
-
if (!defaultNS) {
|
|
39322
|
-
// lookup current default ns in visibleNamespaces
|
|
39323
|
-
for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
|
|
39324
|
-
var namespace = visibleNamespaces[nsi];
|
|
39325
|
-
if (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {
|
|
39326
|
-
defaultNS = namespace.namespace;
|
|
39327
|
-
break
|
|
39465
|
+
walkDOM(node, { ns: visibleNamespaces, isHTML: isHTML }, {
|
|
39466
|
+
enter: function (n, ctx) {
|
|
39467
|
+
var ns = ctx.ns;
|
|
39468
|
+
var html = ctx.isHTML;
|
|
39469
|
+
|
|
39470
|
+
if (nodeFilter) {
|
|
39471
|
+
n = nodeFilter(n);
|
|
39472
|
+
if (n) {
|
|
39473
|
+
if (typeof n == 'string') {
|
|
39474
|
+
buf.push(n);
|
|
39475
|
+
return null;
|
|
39328
39476
|
}
|
|
39477
|
+
} else {
|
|
39478
|
+
return null;
|
|
39329
39479
|
}
|
|
39330
39480
|
}
|
|
39331
|
-
|
|
39332
|
-
|
|
39333
|
-
|
|
39334
|
-
|
|
39335
|
-
|
|
39336
|
-
|
|
39481
|
+
|
|
39482
|
+
switch (n.nodeType) {
|
|
39483
|
+
case ELEMENT_NODE:
|
|
39484
|
+
var attrs = n.attributes;
|
|
39485
|
+
var len = attrs.length;
|
|
39486
|
+
var nodeName = n.tagName;
|
|
39487
|
+
|
|
39488
|
+
html = NAMESPACE.isHTML(n.namespaceURI) || html;
|
|
39489
|
+
|
|
39490
|
+
var prefixedNodeName = nodeName;
|
|
39491
|
+
if (!html && !n.prefix && n.namespaceURI) {
|
|
39492
|
+
var defaultNS;
|
|
39493
|
+
// lookup current default ns from `xmlns` attribute
|
|
39494
|
+
for (var ai = 0; ai < attrs.length; ai++) {
|
|
39495
|
+
if (attrs.item(ai).name === 'xmlns') {
|
|
39496
|
+
defaultNS = attrs.item(ai).value;
|
|
39497
|
+
break;
|
|
39498
|
+
}
|
|
39499
|
+
}
|
|
39500
|
+
if (!defaultNS) {
|
|
39501
|
+
// lookup current default ns in visibleNamespaces
|
|
39502
|
+
for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
|
|
39503
|
+
var nsEntry = ns[nsi];
|
|
39504
|
+
if (nsEntry.prefix === '' && nsEntry.namespace === n.namespaceURI) {
|
|
39505
|
+
defaultNS = nsEntry.namespace;
|
|
39506
|
+
break;
|
|
39507
|
+
}
|
|
39508
|
+
}
|
|
39509
|
+
}
|
|
39510
|
+
if (defaultNS !== n.namespaceURI) {
|
|
39511
|
+
for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
|
|
39512
|
+
var nsEntry = ns[nsi];
|
|
39513
|
+
if (nsEntry.namespace === n.namespaceURI) {
|
|
39514
|
+
if (nsEntry.prefix) {
|
|
39515
|
+
prefixedNodeName = nsEntry.prefix + ':' + nodeName;
|
|
39516
|
+
}
|
|
39517
|
+
break;
|
|
39518
|
+
}
|
|
39519
|
+
}
|
|
39337
39520
|
}
|
|
39338
|
-
break
|
|
39339
39521
|
}
|
|
39340
|
-
}
|
|
39341
|
-
}
|
|
39342
|
-
}
|
|
39343
39522
|
|
|
39344
|
-
|
|
39523
|
+
buf.push('<', prefixedNodeName);
|
|
39524
|
+
|
|
39525
|
+
// Build a fresh namespace snapshot for this element's children.
|
|
39526
|
+
// The slice prevents sibling elements from inheriting each other's declarations.
|
|
39527
|
+
var childNs = ns.slice();
|
|
39528
|
+
for (var i = 0; i < len; i++) {
|
|
39529
|
+
var attr = attrs.item(i);
|
|
39530
|
+
if (attr.prefix == 'xmlns') {
|
|
39531
|
+
childNs.push({ prefix: attr.localName, namespace: attr.value });
|
|
39532
|
+
} else if (attr.nodeName == 'xmlns') {
|
|
39533
|
+
childNs.push({ prefix: '', namespace: attr.value });
|
|
39534
|
+
}
|
|
39535
|
+
}
|
|
39345
39536
|
|
|
39346
|
-
|
|
39347
|
-
|
|
39348
|
-
|
|
39349
|
-
|
|
39350
|
-
|
|
39351
|
-
|
|
39352
|
-
|
|
39353
|
-
|
|
39354
|
-
|
|
39537
|
+
for (var i = 0; i < len; i++) {
|
|
39538
|
+
var attr = attrs.item(i);
|
|
39539
|
+
if (needNamespaceDefine(attr, html, childNs)) {
|
|
39540
|
+
var attrPrefix = attr.prefix || '';
|
|
39541
|
+
var uri = attr.namespaceURI;
|
|
39542
|
+
addSerializedAttribute(buf, attrPrefix ? 'xmlns:' + attrPrefix : 'xmlns', uri);
|
|
39543
|
+
childNs.push({ prefix: attrPrefix, namespace: uri });
|
|
39544
|
+
}
|
|
39545
|
+
// Apply nodeFilter and serialize the attribute.
|
|
39546
|
+
var filteredAttr = nodeFilter ? nodeFilter(attr) : attr;
|
|
39547
|
+
if (filteredAttr) {
|
|
39548
|
+
if (typeof filteredAttr === 'string') {
|
|
39549
|
+
buf.push(filteredAttr);
|
|
39550
|
+
} else {
|
|
39551
|
+
addSerializedAttribute(buf, filteredAttr.name, filteredAttr.value);
|
|
39552
|
+
}
|
|
39553
|
+
}
|
|
39554
|
+
}
|
|
39355
39555
|
|
|
39356
|
-
|
|
39357
|
-
|
|
39358
|
-
|
|
39359
|
-
|
|
39360
|
-
|
|
39361
|
-
|
|
39362
|
-
|
|
39363
|
-
}
|
|
39364
|
-
serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
|
|
39365
|
-
}
|
|
39556
|
+
// add namespace for current node
|
|
39557
|
+
if (nodeName === prefixedNodeName && needNamespaceDefine(n, html, childNs)) {
|
|
39558
|
+
var nodePrefix = n.prefix || '';
|
|
39559
|
+
var uri = n.namespaceURI;
|
|
39560
|
+
addSerializedAttribute(buf, nodePrefix ? 'xmlns:' + nodePrefix : 'xmlns', uri);
|
|
39561
|
+
childNs.push({ prefix: nodePrefix, namespace: uri });
|
|
39562
|
+
}
|
|
39366
39563
|
|
|
39367
|
-
|
|
39368
|
-
|
|
39369
|
-
|
|
39370
|
-
|
|
39371
|
-
|
|
39372
|
-
|
|
39373
|
-
|
|
39564
|
+
var child = n.firstChild;
|
|
39565
|
+
if (child || html && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) {
|
|
39566
|
+
buf.push('>');
|
|
39567
|
+
if (html && /^script$/i.test(nodeName)) {
|
|
39568
|
+
// Inline serialization for <script> children; return null to skip walkDOM descent.
|
|
39569
|
+
while (child) {
|
|
39570
|
+
if (child.data) {
|
|
39571
|
+
buf.push(child.data);
|
|
39572
|
+
} else {
|
|
39573
|
+
serializeToString(child, buf, html, nodeFilter, childNs.slice(), requireWellFormed);
|
|
39574
|
+
}
|
|
39575
|
+
child = child.nextSibling;
|
|
39576
|
+
}
|
|
39577
|
+
buf.push('</', nodeName, '>');
|
|
39578
|
+
return null;
|
|
39579
|
+
}
|
|
39580
|
+
// Return child context; walkDOM descends and exit emits the closing tag.
|
|
39581
|
+
return { ns: childNs, isHTML: html, tag: prefixedNodeName };
|
|
39582
|
+
} else {
|
|
39583
|
+
buf.push('/>');
|
|
39584
|
+
return null;
|
|
39585
|
+
}
|
|
39374
39586
|
|
|
39375
|
-
|
|
39376
|
-
|
|
39377
|
-
|
|
39378
|
-
|
|
39379
|
-
|
|
39380
|
-
|
|
39381
|
-
|
|
39382
|
-
|
|
39383
|
-
|
|
39587
|
+
case DOCUMENT_NODE:
|
|
39588
|
+
case DOCUMENT_FRAGMENT_NODE:
|
|
39589
|
+
// Descend into children; exit is a no-op (tag is null).
|
|
39590
|
+
return { ns: ns.slice(), isHTML: html, tag: null };
|
|
39591
|
+
|
|
39592
|
+
case ATTRIBUTE_NODE:
|
|
39593
|
+
addSerializedAttribute(buf, n.name, n.value);
|
|
39594
|
+
return null;
|
|
39595
|
+
|
|
39596
|
+
case TEXT_NODE:
|
|
39597
|
+
/**
|
|
39598
|
+
* The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
|
|
39599
|
+
* except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
|
|
39600
|
+
* If they are needed elsewhere, they must be escaped using either numeric character references or the strings
|
|
39601
|
+
* `&` and `<` respectively.
|
|
39602
|
+
* The right angle bracket (>) may be represented using the string " > ", and must, for compatibility,
|
|
39603
|
+
* be escaped using either `>` or a character reference when it appears in the string `]]>` in content,
|
|
39604
|
+
* when that string is not marking the end of a CDATA section.
|
|
39605
|
+
*
|
|
39606
|
+
* In the content of elements, character data is any string of characters
|
|
39607
|
+
* which does not contain the start-delimiter of any markup
|
|
39608
|
+
* and does not include the CDATA-section-close delimiter, `]]>`.
|
|
39609
|
+
*
|
|
39610
|
+
* @see https://www.w3.org/TR/xml/#NT-CharData
|
|
39611
|
+
* @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
|
|
39612
|
+
*/
|
|
39613
|
+
buf.push(n.data.replace(/[<&>]/g, _xmlEncoder));
|
|
39614
|
+
return null;
|
|
39615
|
+
|
|
39616
|
+
case CDATA_SECTION_NODE:
|
|
39617
|
+
if (requireWellFormed && n.data.indexOf(']]>') !== -1) {
|
|
39618
|
+
throw new DOMException(INVALID_STATE_ERR, 'The CDATASection data contains "]]>"');
|
|
39384
39619
|
}
|
|
39385
|
-
|
|
39386
|
-
|
|
39387
|
-
|
|
39388
|
-
|
|
39389
|
-
|
|
39390
|
-
|
|
39391
|
-
|
|
39392
|
-
|
|
39393
|
-
|
|
39394
|
-
|
|
39395
|
-
|
|
39396
|
-
|
|
39397
|
-
|
|
39398
|
-
|
|
39399
|
-
|
|
39400
|
-
|
|
39401
|
-
|
|
39402
|
-
|
|
39403
|
-
|
|
39404
|
-
|
|
39405
|
-
|
|
39406
|
-
|
|
39407
|
-
|
|
39408
|
-
|
|
39409
|
-
|
|
39410
|
-
|
|
39411
|
-
|
|
39412
|
-
|
|
39413
|
-
|
|
39414
|
-
|
|
39415
|
-
|
|
39416
|
-
|
|
39417
|
-
|
|
39418
|
-
|
|
39419
|
-
|
|
39420
|
-
|
|
39421
|
-
|
|
39422
|
-
|
|
39423
|
-
|
|
39424
|
-
|
|
39425
|
-
|
|
39426
|
-
|
|
39427
|
-
|
|
39428
|
-
|
|
39429
|
-
|
|
39430
|
-
|
|
39431
|
-
|
|
39432
|
-
|
|
39433
|
-
|
|
39434
|
-
|
|
39435
|
-
|
|
39436
|
-
|
|
39437
|
-
|
|
39438
|
-
|
|
39439
|
-
|
|
39440
|
-
|
|
39441
|
-
|
|
39442
|
-
|
|
39620
|
+
buf.push('<![CDATA[', n.data.replace(/]]>/g, ']]]]><![CDATA[>'), ']]>');
|
|
39621
|
+
return null;
|
|
39622
|
+
|
|
39623
|
+
case COMMENT_NODE:
|
|
39624
|
+
if (requireWellFormed && n.data.indexOf('-->') !== -1) {
|
|
39625
|
+
throw new DOMException(INVALID_STATE_ERR, 'The comment node data contains "-->"');
|
|
39626
|
+
}
|
|
39627
|
+
buf.push('<!--', n.data, '-->');
|
|
39628
|
+
return null;
|
|
39629
|
+
|
|
39630
|
+
case DOCUMENT_TYPE_NODE:
|
|
39631
|
+
if (requireWellFormed) {
|
|
39632
|
+
if (n.publicId && !/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(n.publicId)) {
|
|
39633
|
+
throw new DOMException(INVALID_STATE_ERR, 'DocumentType publicId is not a valid PubidLiteral');
|
|
39634
|
+
}
|
|
39635
|
+
if (n.systemId && !/^("[^"]*"|'[^']*')$/.test(n.systemId)) {
|
|
39636
|
+
throw new DOMException(INVALID_STATE_ERR, 'DocumentType systemId is not a valid SystemLiteral');
|
|
39637
|
+
}
|
|
39638
|
+
if (n.internalSubset && n.internalSubset.indexOf(']>') !== -1) {
|
|
39639
|
+
throw new DOMException(INVALID_STATE_ERR, 'DocumentType internalSubset contains "]>"');
|
|
39640
|
+
}
|
|
39641
|
+
}
|
|
39642
|
+
var pubid = n.publicId;
|
|
39643
|
+
var sysid = n.systemId;
|
|
39644
|
+
buf.push('<!DOCTYPE ', n.name);
|
|
39645
|
+
if (pubid) {
|
|
39646
|
+
buf.push(' PUBLIC ', pubid);
|
|
39647
|
+
if (sysid && sysid != '.') {
|
|
39648
|
+
buf.push(' ', sysid);
|
|
39649
|
+
}
|
|
39650
|
+
buf.push('>');
|
|
39651
|
+
} else if (sysid && sysid != '.') {
|
|
39652
|
+
buf.push(' SYSTEM ', sysid, '>');
|
|
39653
|
+
} else {
|
|
39654
|
+
var sub = n.internalSubset;
|
|
39655
|
+
if (sub) {
|
|
39656
|
+
buf.push(' [', sub, ']');
|
|
39657
|
+
}
|
|
39658
|
+
buf.push('>');
|
|
39659
|
+
}
|
|
39660
|
+
return null;
|
|
39661
|
+
|
|
39662
|
+
case PROCESSING_INSTRUCTION_NODE:
|
|
39663
|
+
if (requireWellFormed && n.data.indexOf('?>') !== -1) {
|
|
39664
|
+
throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
|
|
39665
|
+
}
|
|
39666
|
+
buf.push('<?', n.target, ' ', n.data, '?>');
|
|
39667
|
+
return null;
|
|
39668
|
+
|
|
39669
|
+
case ENTITY_REFERENCE_NODE:
|
|
39670
|
+
buf.push('&', n.nodeName, ';');
|
|
39671
|
+
return null;
|
|
39672
|
+
|
|
39673
|
+
//case ENTITY_NODE:
|
|
39674
|
+
//case NOTATION_NODE:
|
|
39675
|
+
default:
|
|
39676
|
+
buf.push('??', n.nodeName);
|
|
39677
|
+
return null;
|
|
39443
39678
|
}
|
|
39444
|
-
|
|
39445
|
-
|
|
39446
|
-
|
|
39447
|
-
|
|
39448
|
-
var sub = node.internalSubset;
|
|
39449
|
-
if(sub){
|
|
39450
|
-
buf.push(" [",sub,"]");
|
|
39679
|
+
},
|
|
39680
|
+
exit: function (n, childCtx) {
|
|
39681
|
+
if (childCtx && childCtx.tag) {
|
|
39682
|
+
buf.push('</', childCtx.tag, '>');
|
|
39451
39683
|
}
|
|
39452
|
-
|
|
39453
|
-
|
|
39454
|
-
return;
|
|
39455
|
-
case PROCESSING_INSTRUCTION_NODE:
|
|
39456
|
-
return buf.push( "<?",node.target," ",node.data,"?>");
|
|
39457
|
-
case ENTITY_REFERENCE_NODE:
|
|
39458
|
-
return buf.push( '&',node.nodeName,';');
|
|
39459
|
-
//case ENTITY_NODE:
|
|
39460
|
-
//case NOTATION_NODE:
|
|
39461
|
-
default:
|
|
39462
|
-
buf.push('??',node.nodeName);
|
|
39463
|
-
}
|
|
39684
|
+
},
|
|
39685
|
+
});
|
|
39464
39686
|
}
|
|
39465
|
-
|
|
39466
|
-
|
|
39467
|
-
|
|
39468
|
-
|
|
39469
|
-
|
|
39470
|
-
|
|
39471
|
-
|
|
39472
|
-
|
|
39473
|
-
|
|
39474
|
-
|
|
39475
|
-
|
|
39476
|
-
|
|
39477
|
-
|
|
39478
|
-
|
|
39479
|
-
|
|
39480
|
-
|
|
39481
|
-
|
|
39482
|
-
|
|
39483
|
-
|
|
39484
|
-
|
|
39485
|
-
|
|
39486
|
-
|
|
39487
|
-
|
|
39488
|
-
|
|
39489
|
-
|
|
39490
|
-
|
|
39491
|
-
|
|
39492
|
-
|
|
39493
|
-
|
|
39494
|
-
|
|
39495
|
-
|
|
39496
|
-
|
|
39497
|
-
|
|
39498
|
-
|
|
39499
|
-
|
|
39500
|
-
|
|
39501
|
-
|
|
39502
|
-
var child = node.firstChild;
|
|
39503
|
-
while(child){
|
|
39504
|
-
node2.appendChild(importNode(doc,child,deep));
|
|
39505
|
-
child = child.nextSibling;
|
|
39506
|
-
}
|
|
39507
|
-
}
|
|
39508
|
-
return node2;
|
|
39687
|
+
/**
|
|
39688
|
+
* Imports a node from a different document into `doc`, creating a new copy.
|
|
39689
|
+
* Delegates to {@link walkDOM} for traversal. Each node in the subtree is shallow-cloned,
|
|
39690
|
+
* stamped with `doc` as its `ownerDocument`, and detached (`parentNode` set to `null`).
|
|
39691
|
+
* Children are imported recursively when `deep` is `true`; for {@link Attr} nodes `deep` is
|
|
39692
|
+
* always forced to `true`
|
|
39693
|
+
* because an attribute's value lives in a child text node.
|
|
39694
|
+
*
|
|
39695
|
+
* @param {Document} doc
|
|
39696
|
+
* The document that will own the imported node.
|
|
39697
|
+
* @param {Node} node
|
|
39698
|
+
* The node to import.
|
|
39699
|
+
* @param {boolean} deep
|
|
39700
|
+
* If `true`, descendants are imported recursively.
|
|
39701
|
+
* @returns {Node}
|
|
39702
|
+
* The newly imported node, now owned by `doc`.
|
|
39703
|
+
*/
|
|
39704
|
+
function importNode(doc, node, deep) {
|
|
39705
|
+
var destRoot;
|
|
39706
|
+
walkDOM(node, null, {
|
|
39707
|
+
enter: function (srcNode, destParent) {
|
|
39708
|
+
// Shallow-clone the node and stamp it into the target document.
|
|
39709
|
+
var destNode = srcNode.cloneNode(false);
|
|
39710
|
+
destNode.ownerDocument = doc;
|
|
39711
|
+
destNode.parentNode = null;
|
|
39712
|
+
// capture as the root of the imported subtree or attach to parent.
|
|
39713
|
+
if (destParent === null) {
|
|
39714
|
+
destRoot = destNode;
|
|
39715
|
+
} else {
|
|
39716
|
+
destParent.appendChild(destNode);
|
|
39717
|
+
}
|
|
39718
|
+
// ATTRIBUTE_NODE must always be imported deeply: its value lives in a child text node.
|
|
39719
|
+
var shouldDeep = srcNode.nodeType === ATTRIBUTE_NODE || deep;
|
|
39720
|
+
return shouldDeep ? destNode : null;
|
|
39721
|
+
},
|
|
39722
|
+
});
|
|
39723
|
+
return destRoot;
|
|
39509
39724
|
}
|
|
39510
39725
|
//
|
|
39511
39726
|
//var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,
|
|
39512
39727
|
// attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};
|
|
39513
|
-
function cloneNode(doc,node,deep){
|
|
39514
|
-
var
|
|
39515
|
-
|
|
39516
|
-
|
|
39517
|
-
|
|
39518
|
-
|
|
39519
|
-
|
|
39520
|
-
|
|
39728
|
+
function cloneNode(doc, node, deep) {
|
|
39729
|
+
var destRoot;
|
|
39730
|
+
walkDOM(node, null, {
|
|
39731
|
+
enter: function (srcNode, destParent) {
|
|
39732
|
+
// 1. Create a blank node of the same type and copy all scalar own properties.
|
|
39733
|
+
var destNode = new srcNode.constructor();
|
|
39734
|
+
for (var n in srcNode) {
|
|
39735
|
+
if (Object.prototype.hasOwnProperty.call(srcNode, n)) {
|
|
39736
|
+
var v = srcNode[n];
|
|
39737
|
+
if (typeof v != 'object') {
|
|
39738
|
+
if (v != destNode[n]) {
|
|
39739
|
+
destNode[n] = v;
|
|
39740
|
+
}
|
|
39741
|
+
}
|
|
39521
39742
|
}
|
|
39522
39743
|
}
|
|
39523
|
-
|
|
39524
|
-
|
|
39525
|
-
|
|
39526
|
-
|
|
39527
|
-
|
|
39528
|
-
|
|
39529
|
-
|
|
39530
|
-
|
|
39531
|
-
|
|
39532
|
-
|
|
39533
|
-
|
|
39534
|
-
|
|
39535
|
-
|
|
39536
|
-
|
|
39537
|
-
|
|
39538
|
-
|
|
39539
|
-
|
|
39540
|
-
|
|
39541
|
-
|
|
39542
|
-
|
|
39543
|
-
|
|
39544
|
-
|
|
39545
|
-
|
|
39546
|
-
|
|
39547
|
-
|
|
39548
|
-
|
|
39744
|
+
if (srcNode.childNodes) {
|
|
39745
|
+
destNode.childNodes = new NodeList();
|
|
39746
|
+
}
|
|
39747
|
+
destNode.ownerDocument = doc;
|
|
39748
|
+
// 2. Handle node-type-specific setup.
|
|
39749
|
+
// Attributes are not DOM children, so they are cloned inline here
|
|
39750
|
+
// rather than by walkDOM descent.
|
|
39751
|
+
// ATTRIBUTE_NODE forces deep=true so its own children are walked.
|
|
39752
|
+
var shouldDeep = deep;
|
|
39753
|
+
switch (destNode.nodeType) {
|
|
39754
|
+
case ELEMENT_NODE:
|
|
39755
|
+
var attrs = srcNode.attributes;
|
|
39756
|
+
var attrs2 = (destNode.attributes = new NamedNodeMap());
|
|
39757
|
+
var len = attrs.length;
|
|
39758
|
+
attrs2._ownerElement = destNode;
|
|
39759
|
+
for (var i = 0; i < len; i++) {
|
|
39760
|
+
destNode.setAttributeNode(cloneNode(doc, attrs.item(i), true));
|
|
39761
|
+
}
|
|
39762
|
+
break;
|
|
39763
|
+
case ATTRIBUTE_NODE:
|
|
39764
|
+
shouldDeep = true;
|
|
39765
|
+
}
|
|
39766
|
+
// 3. Attach to parent, or capture as the root of the cloned subtree.
|
|
39767
|
+
if (destParent !== null) {
|
|
39768
|
+
destParent.appendChild(destNode);
|
|
39769
|
+
} else {
|
|
39770
|
+
destRoot = destNode;
|
|
39771
|
+
}
|
|
39772
|
+
// 4. Return destNode as the context for children (causes walkDOM to descend),
|
|
39773
|
+
// or null to skip children (shallow clone).
|
|
39774
|
+
return shouldDeep ? destNode : null;
|
|
39775
|
+
},
|
|
39776
|
+
});
|
|
39777
|
+
return destRoot;
|
|
39549
39778
|
}
|
|
39550
39779
|
|
|
39551
39780
|
function __set__(object,key,value){
|
|
@@ -39561,49 +39790,55 @@ function requireDom () {
|
|
|
39561
39790
|
}
|
|
39562
39791
|
});
|
|
39563
39792
|
|
|
39564
|
-
|
|
39565
|
-
|
|
39566
|
-
|
|
39793
|
+
/**
|
|
39794
|
+
* The text content of this node and its descendants.
|
|
39795
|
+
*
|
|
39796
|
+
* Setting `textContent` on an element or document fragment replaces all child nodes with a
|
|
39797
|
+
* single text node; on other nodes it sets `data`, `value`, and `nodeValue` directly.
|
|
39798
|
+
*
|
|
39799
|
+
* @type {string | null}
|
|
39800
|
+
* @see {@link https://dom.spec.whatwg.org/#dom-node-textcontent}
|
|
39801
|
+
*/
|
|
39802
|
+
Object.defineProperty(Node.prototype, 'textContent', {
|
|
39803
|
+
get: function () {
|
|
39804
|
+
if (this.nodeType === ELEMENT_NODE || this.nodeType === DOCUMENT_FRAGMENT_NODE) {
|
|
39805
|
+
var buf = [];
|
|
39806
|
+
walkDOM(this, null, {
|
|
39807
|
+
enter: function (n) {
|
|
39808
|
+
if (n.nodeType === ELEMENT_NODE || n.nodeType === DOCUMENT_FRAGMENT_NODE) {
|
|
39809
|
+
return true; // enter children
|
|
39810
|
+
}
|
|
39811
|
+
if (n.nodeType === PROCESSING_INSTRUCTION_NODE || n.nodeType === COMMENT_NODE) {
|
|
39812
|
+
return null; // excluded from text content
|
|
39813
|
+
}
|
|
39814
|
+
buf.push(n.nodeValue);
|
|
39815
|
+
},
|
|
39816
|
+
});
|
|
39817
|
+
return buf.join('');
|
|
39818
|
+
}
|
|
39819
|
+
return this.nodeValue;
|
|
39567
39820
|
},
|
|
39568
39821
|
|
|
39569
|
-
set:function(data){
|
|
39570
|
-
switch(this.nodeType){
|
|
39571
|
-
|
|
39572
|
-
|
|
39573
|
-
|
|
39574
|
-
|
|
39575
|
-
|
|
39576
|
-
|
|
39577
|
-
|
|
39578
|
-
|
|
39579
|
-
|
|
39822
|
+
set: function (data) {
|
|
39823
|
+
switch (this.nodeType) {
|
|
39824
|
+
case ELEMENT_NODE:
|
|
39825
|
+
case DOCUMENT_FRAGMENT_NODE:
|
|
39826
|
+
while (this.firstChild) {
|
|
39827
|
+
this.removeChild(this.firstChild);
|
|
39828
|
+
}
|
|
39829
|
+
if (data || String(data)) {
|
|
39830
|
+
this.appendChild(this.ownerDocument.createTextNode(data));
|
|
39831
|
+
}
|
|
39832
|
+
break;
|
|
39580
39833
|
|
|
39581
|
-
|
|
39582
|
-
|
|
39583
|
-
|
|
39584
|
-
|
|
39834
|
+
default:
|
|
39835
|
+
this.data = data;
|
|
39836
|
+
this.value = data;
|
|
39837
|
+
this.nodeValue = data;
|
|
39585
39838
|
}
|
|
39586
|
-
}
|
|
39839
|
+
},
|
|
39587
39840
|
});
|
|
39588
39841
|
|
|
39589
|
-
function getTextContent(node){
|
|
39590
|
-
switch(node.nodeType){
|
|
39591
|
-
case ELEMENT_NODE:
|
|
39592
|
-
case DOCUMENT_FRAGMENT_NODE:
|
|
39593
|
-
var buf = [];
|
|
39594
|
-
node = node.firstChild;
|
|
39595
|
-
while(node){
|
|
39596
|
-
if(node.nodeType!==7 && node.nodeType !==8){
|
|
39597
|
-
buf.push(getTextContent(node));
|
|
39598
|
-
}
|
|
39599
|
-
node = node.nextSibling;
|
|
39600
|
-
}
|
|
39601
|
-
return buf.join('');
|
|
39602
|
-
default:
|
|
39603
|
-
return node.nodeValue;
|
|
39604
|
-
}
|
|
39605
|
-
}
|
|
39606
|
-
|
|
39607
39842
|
__set__ = function(object,key,value){
|
|
39608
39843
|
//console.log(value)
|
|
39609
39844
|
object['$$'+key] = value;
|
|
@@ -39619,6 +39854,7 @@ function requireDom () {
|
|
|
39619
39854
|
dom.Element = Element;
|
|
39620
39855
|
dom.Node = Node;
|
|
39621
39856
|
dom.NodeList = NodeList;
|
|
39857
|
+
dom.walkDOM = walkDOM;
|
|
39622
39858
|
dom.XMLSerializer = XMLSerializer;
|
|
39623
39859
|
//}
|
|
39624
39860
|
return dom;
|
|
@@ -100320,13 +100556,13 @@ const FIRST_TIME_WATCH = {};
|
|
|
100320
100556
|
Object.freeze(FIRST_TIME_WATCH);
|
|
100321
100557
|
const arrayConsumer = (listenerFn, restExpr, newVal, oldVal) => {
|
|
100322
100558
|
let data = newVal, formattedData;
|
|
100323
|
-
if (isArray(data)) {
|
|
100559
|
+
if (_.isArray(data)) {
|
|
100324
100560
|
formattedData = data.map(function (datum) {
|
|
100325
100561
|
return findValueOf(datum, restExpr);
|
|
100326
100562
|
});
|
|
100327
100563
|
// If resulting structure is an array of array, flatten it
|
|
100328
|
-
if (isArray(formattedData[0])) {
|
|
100329
|
-
formattedData = flatten
|
|
100564
|
+
if (_.isArray(formattedData[0])) {
|
|
100565
|
+
formattedData = _.flatten(formattedData);
|
|
100330
100566
|
}
|
|
100331
100567
|
listenerFn(formattedData, oldVal);
|
|
100332
100568
|
}
|
|
@@ -100371,6 +100607,19 @@ const $watch = (expr, $scope, $locals, listener, identifier = watchIdGenerator.n
|
|
|
100371
100607
|
};
|
|
100372
100608
|
const $unwatch = identifier => registry.delete(identifier);
|
|
100373
100609
|
window.watchRegistry = registry;
|
|
100610
|
+
window.__WM_DEBUG_WATCHERS__ = false;
|
|
100611
|
+
/*export const $invokeWatchers = (force?: boolean, ignoreMuted?: boolean) => {
|
|
100612
|
+
if (force) {
|
|
100613
|
+
triggerWatchers(ignoreMuted);
|
|
100614
|
+
} else {
|
|
100615
|
+
|
|
100616
|
+
if (skipWatchers) {
|
|
100617
|
+
skipWatchers = false;
|
|
100618
|
+
return;
|
|
100619
|
+
}
|
|
100620
|
+
debouncedTriggerWatchers();
|
|
100621
|
+
}
|
|
100622
|
+
};*/
|
|
100374
100623
|
const $appDigest = (() => {
|
|
100375
100624
|
return (force) => {
|
|
100376
100625
|
{
|
|
@@ -100448,6 +100697,7 @@ const REGEX = {
|
|
|
100448
100697
|
SUPPORTED_AUDIO_FORMAT: /\.(mp3|ogg|webm|wma|3gp|wav|m4a)$/i,
|
|
100449
100698
|
SUPPORTED_VIDEO_FORMAT: /\.(mp4|ogg|webm|wmv|mpeg|mpg|avi|mov)$/i,
|
|
100450
100699
|
VALID_WEB_URL: /^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,
|
|
100700
|
+
VALID_IMAGE_URL: /^(https?|blob|data|file|ftp):/i,
|
|
100451
100701
|
REPLACE_PATTERN: /\$\{([^\}]+)\}/g,
|
|
100452
100702
|
DATA_URL: /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i,
|
|
100453
100703
|
ISO_DATE_FORMAT: /(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(\.\d+)?([+-]\d{2}:?\d{2}|Z)$/
|
|
@@ -100670,6 +100920,9 @@ const isVideoFile = (fileName) => {
|
|
|
100670
100920
|
const isValidWebURL = (url) => {
|
|
100671
100921
|
return (REGEX.VALID_WEB_URL).test(url);
|
|
100672
100922
|
};
|
|
100923
|
+
const isValidImageUrl = (url) => {
|
|
100924
|
+
return (REGEX.VALID_IMAGE_URL).test(url?.trim());
|
|
100925
|
+
};
|
|
100673
100926
|
/*This function returns the url to the resource after checking the validity of url*/
|
|
100674
100927
|
const getResourceURL = (urlString) => {
|
|
100675
100928
|
return urlString;
|
|
@@ -101923,6 +102176,7 @@ var Utils = /*#__PURE__*/Object.freeze({
|
|
|
101923
102176
|
isPageable: isPageable,
|
|
101924
102177
|
isSafari: isSafari,
|
|
101925
102178
|
isTablet: isTablet,
|
|
102179
|
+
isValidImageUrl: isValidImageUrl,
|
|
101926
102180
|
isValidWebURL: isValidWebURL,
|
|
101927
102181
|
isVideoFile: isVideoFile,
|
|
101928
102182
|
loadScript: loadScript,
|