@wavemaker/angular-app 11.14.2-rc.6311 → 11.14.4-rc.647538

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.
@@ -5867,14 +5867,14 @@ function createNgModuleType(meta) {
5867
5867
  if (meta.kind === R3NgModuleMetadataKind.Local) {
5868
5868
  return new ExpressionType$1(meta.type.value);
5869
5869
  }
5870
- const { type: moduleType, declarations, exports: exports$1, imports, includeImportTypes, publicDeclarationTypes, } = meta;
5870
+ const { type: moduleType, declarations, exports, imports, includeImportTypes, publicDeclarationTypes, } = meta;
5871
5871
  return new ExpressionType$1(importExpr(Identifiers.NgModuleDeclaration, [
5872
5872
  new ExpressionType$1(moduleType.type),
5873
5873
  publicDeclarationTypes === null
5874
5874
  ? tupleTypeOf(declarations)
5875
5875
  : tupleOfTypes(publicDeclarationTypes),
5876
5876
  includeImportTypes ? tupleTypeOf(imports) : NONE_TYPE,
5877
- tupleTypeOf(exports$1),
5877
+ tupleTypeOf(exports),
5878
5878
  ]));
5879
5879
  }
5880
5880
  /**
@@ -37811,14 +37811,14 @@ function requireDom () {
37811
37811
  ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]="DOMString size error"),2);
37812
37812
  var HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]="Hierarchy request error"),3);
37813
37813
  ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]="Wrong document"),4);
37814
- ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
37814
+ var INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]="Invalid character"),5);
37815
37815
  ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]="No data allowed"),6);
37816
37816
  ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]="No modification allowed"),7);
37817
37817
  var NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]="Not found"),8);
37818
37818
  ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]="Not supported"),9);
37819
37819
  var INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]="Attribute in use"),10);
37820
37820
  //level2
37821
- ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
37821
+ var INVALID_STATE_ERR = ExceptionCode.INVALID_STATE_ERR = ((ExceptionMessage[11]="Invalid state"),11);
37822
37822
  ExceptionCode.SYNTAX_ERR = ((ExceptionMessage[12]="Syntax error"),12);
37823
37823
  ExceptionCode.INVALID_MODIFICATION_ERR = ((ExceptionMessage[13]="Invalid modification"),13);
37824
37824
  ExceptionCode.NAMESPACE_ERR = ((ExceptionMessage[14]="Invalid namespace"),14);
@@ -37868,9 +37868,10 @@ function requireDom () {
37868
37868
  item: function(index) {
37869
37869
  return index >= 0 && index < this.length ? this[index] : null;
37870
37870
  },
37871
- toString:function(isHTML,nodeFilter){
37871
+ toString:function(isHTML,nodeFilter,options){
37872
+ var requireWellFormed = !!options && !!options.requireWellFormed;
37872
37873
  for(var buf = [], i = 0;i<this.length;i++){
37873
- serializeToString(this[i],buf,isHTML,nodeFilter);
37874
+ serializeToString(this[i],buf,isHTML,nodeFilter,null,requireWellFormed);
37874
37875
  }
37875
37876
  return buf.join('');
37876
37877
  },
@@ -38115,13 +38116,28 @@ function requireDom () {
38115
38116
  /**
38116
38117
  * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
38117
38118
  *
38118
- * __This behavior is slightly different from the in the specs__:
38119
+ * __This implementation differs from the specification:__
38119
38120
  * - this implementation is not validating names or qualified names
38120
38121
  * (when parsing XML strings, the SAX parser takes care of that)
38121
38122
  *
38123
+ * Note: `internalSubset` can only be introduced via a direct property write to `node.internalSubset` after creation.
38124
+ * Creation-time validation of `publicId`, `systemId` is not enforced.
38125
+ * The serializer-level check covers all mutation vectors, including direct property writes.
38126
+ * `internalSubset` is only serialized as `[ ... ]` when both `publicId` and `systemId` are
38127
+ * absent (empty or `'.'`) — if either external identifier is present, `internalSubset` is
38128
+ * silently omitted from the serialized output.
38129
+ *
38122
38130
  * @param {string} qualifiedName
38123
38131
  * @param {string} [publicId]
38132
+ * The external subset public identifier. Stored verbatim including surrounding quotes.
38133
+ * When serialized with `requireWellFormed: true` (via the 4th-parameter options object),
38134
+ * throws `DOMException` with code `INVALID_STATE_ERR` if the value is non-empty and does
38135
+ * not match the XML `PubidLiteral` production (W3C DOM Parsing §3.2.1.3; XML 1.0 [12]).
38124
38136
  * @param {string} [systemId]
38137
+ * The external subset system identifier. Stored verbatim including surrounding quotes.
38138
+ * When serialized with `requireWellFormed: true`, throws `DOMException` with code
38139
+ * `INVALID_STATE_ERR` if the value is non-empty and does not match the XML `SystemLiteral`
38140
+ * production (W3C DOM Parsing §3.2.1.3; XML 1.0 [11]).
38125
38141
  * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation
38126
38142
  * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`
38127
38143
  *
@@ -38187,18 +38203,44 @@ function requireDom () {
38187
38203
  return cloneNode(this.ownerDocument||this,this,deep);
38188
38204
  },
38189
38205
  // Modified in DOM Level 2:
38190
- normalize:function(){
38191
- var child = this.firstChild;
38192
- while(child){
38193
- var next = child.nextSibling;
38194
- if(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){
38195
- this.removeChild(next);
38196
- child.appendData(next.data);
38197
- }else {
38198
- child.normalize();
38199
- child = next;
38200
- }
38201
- }
38206
+ /**
38207
+ * Puts the specified node and all of its subtree into a "normalized" form. In a normalized
38208
+ * subtree, no text nodes in the subtree are empty and there are no adjacent text nodes.
38209
+ *
38210
+ * Specifically, this method merges any adjacent text nodes (i.e., nodes for which `nodeType`
38211
+ * is `TEXT_NODE`) into a single node with the combined data. It also removes any empty text
38212
+ * nodes.
38213
+ *
38214
+ * This method iteratively traverses all child nodes to normalize all descendant nodes within
38215
+ * the subtree.
38216
+ *
38217
+ * @throws {DOMException}
38218
+ * May throw a DOMException if operations within removeChild or appendData (which are
38219
+ * potentially invoked in this method) do not meet their specific constraints.
38220
+ * @see {@link Node.removeChild}
38221
+ * @see {@link CharacterData.appendData}
38222
+ * @see ../docs/walk-dom.md.
38223
+ */
38224
+ normalize: function () {
38225
+ walkDOM(this, null, {
38226
+ enter: function (node) {
38227
+ // Merge adjacent text children of node before walkDOM schedules them.
38228
+ // walkDOM reads lastChild/previousSibling after enter returns, so the
38229
+ // surviving post-merge children are what it descends into.
38230
+ var child = node.firstChild;
38231
+ while (child) {
38232
+ var next = child.nextSibling;
38233
+ if (next !== null && next.nodeType === TEXT_NODE && child.nodeType === TEXT_NODE) {
38234
+ node.removeChild(next);
38235
+ child.appendData(next.data);
38236
+ // Do not advance child: re-check new nextSibling for another text run
38237
+ } else {
38238
+ child = next;
38239
+ }
38240
+ }
38241
+ return true; // descend into surviving children
38242
+ },
38243
+ });
38202
38244
  },
38203
38245
  // Introduced in DOM Level 2:
38204
38246
  isSupported:function(feature, version){
@@ -38274,21 +38316,103 @@ function requireDom () {
38274
38316
  copy(NodeType,Node.prototype);
38275
38317
 
38276
38318
  /**
38277
- * @param callback return true for continue,false for break
38278
- * @return boolean true: break visit;
38319
+ * @param {Node} node
38320
+ * Root of the subtree to visit.
38321
+ * @param {function(Node): boolean} callback
38322
+ * Called for each node in depth-first pre-order. Return a truthy value to stop traversal early.
38323
+ * @return {boolean} `true` if traversal was aborted by the callback, `false` otherwise.
38279
38324
  */
38280
- function _visitNode(node,callback){
38281
- if(callback(node)){
38282
- return true;
38283
- }
38284
- if(node = node.firstChild){
38285
- do{
38286
- if(_visitNode(node,callback)){return true}
38287
- }while(node=node.nextSibling)
38288
- }
38325
+ function _visitNode(node, callback) {
38326
+ return walkDOM(node, null, { enter: function (n) { return callback(n) ? walkDOM.STOP : true; } }) === walkDOM.STOP;
38289
38327
  }
38290
38328
 
38329
+ /**
38330
+ * Depth-first pre/post-order DOM tree walker.
38331
+ *
38332
+ * Visits every node in the subtree rooted at `node`. For each node:
38333
+ *
38334
+ * 1. Calls `callbacks.enter(node, context)` before descending into the node's children. The
38335
+ * return value becomes the `context` passed to each child's `enter` call and to the matching
38336
+ * `exit` call.
38337
+ * 2. If `enter` returns `null` or `undefined`, the node's children are skipped;
38338
+ * sibling traversal continues normally.
38339
+ * 3. If `enter` returns `walkDOM.STOP`, the entire traversal is aborted immediately — no
38340
+ * further `enter` or `exit` calls are made.
38341
+ * 4. `lastChild` and `previousSibling` are read **after** `enter` returns, so `enter` may
38342
+ * safely modify the node's own child list before the walker descends. Modifying siblings of
38343
+ * the current node or any other part of the tree produces unpredictable results: nodes already
38344
+ * queued on the stack are visited regardless of DOM changes, and newly inserted nodes outside
38345
+ * the current child list are never visited.
38346
+ * 5. Calls `callbacks.exit(node, context)` (if provided) after all of a node's children have
38347
+ * been visited, passing the same `context` that `enter`
38348
+ * returned for that node.
38349
+ *
38350
+ * This implementation uses an explicit stack and does not recurse — it is safe on arbitrarily
38351
+ * deep trees.
38352
+ *
38353
+ * @param {Node} node
38354
+ * Root of the subtree to walk.
38355
+ * @param {*} context
38356
+ * Initial context value passed to the root node's `enter`.
38357
+ * @param {{ enter: function(Node, *): *, exit?: function(Node, *): void }} callbacks
38358
+ * @returns {void | walkDOM.STOP}
38359
+ * @see ../docs/walk-dom.md.
38360
+ */
38361
+ function walkDOM(node, context, callbacks) {
38362
+ // Each stack frame is {node, context, phase}:
38363
+ // walkDOM.ENTER — call enter, then push children
38364
+ // walkDOM.EXIT — call exit
38365
+ var stack = [{ node: node, context: context, phase: walkDOM.ENTER }];
38366
+ while (stack.length > 0) {
38367
+ var frame = stack.pop();
38368
+ if (frame.phase === walkDOM.ENTER) {
38369
+ var childContext = callbacks.enter(frame.node, frame.context);
38370
+ if (childContext === walkDOM.STOP) {
38371
+ return walkDOM.STOP;
38372
+ }
38373
+ // Push exit frame before children so it fires after all children are processed (Last In First Out)
38374
+ stack.push({ node: frame.node, context: childContext, phase: walkDOM.EXIT });
38375
+ if (childContext === null || childContext === undefined) {
38376
+ continue; // skip children
38377
+ }
38378
+ // lastChild is read after enter returns, so enter may modify the child list.
38379
+ var child = frame.node.lastChild;
38380
+ // Traverse from lastChild backwards so that pushing onto the stack
38381
+ // naturally yields firstChild on top (processed first).
38382
+ while (child) {
38383
+ stack.push({ node: child, context: childContext, phase: walkDOM.ENTER });
38384
+ child = child.previousSibling;
38385
+ }
38386
+ } else {
38387
+ // frame.phase === walkDOM.EXIT
38388
+ if (callbacks.exit) {
38389
+ callbacks.exit(frame.node, frame.context);
38390
+ }
38391
+ }
38392
+ }
38393
+ }
38291
38394
 
38395
+ /**
38396
+ * Sentinel value returned from a `walkDOM` `enter` callback to abort the entire traversal
38397
+ * immediately.
38398
+ *
38399
+ * @type {symbol}
38400
+ */
38401
+ walkDOM.STOP = Symbol('walkDOM.STOP');
38402
+ /**
38403
+ * Phase constant for a stack frame that has not yet been visited.
38404
+ * The `enter` callback is called and children are scheduled.
38405
+ *
38406
+ * @type {number}
38407
+ */
38408
+ walkDOM.ENTER = 0;
38409
+ /**
38410
+ * Phase constant for a stack frame whose subtree has been fully visited.
38411
+ * The `exit` callback is called.
38412
+ *
38413
+ * @type {number}
38414
+ */
38415
+ walkDOM.EXIT = 1;
38292
38416
 
38293
38417
  function Document(){
38294
38418
  this.ownerDocument = this;
@@ -38892,12 +39016,44 @@ function requireDom () {
38892
39016
  node.appendData(data);
38893
39017
  return node;
38894
39018
  },
39019
+ /**
39020
+ * Returns a new CDATASection node whose data is `data`.
39021
+ *
39022
+ * __This implementation differs from the specification:__
39023
+ * - calling this method on an HTML document does not throw `NotSupportedError`.
39024
+ *
39025
+ * @param {string} data
39026
+ * @returns {CDATASection}
39027
+ * @throws DOMException with code `INVALID_CHARACTER_ERR` if `data` contains `"]]>"`.
39028
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/createCDATASection
39029
+ * @see https://dom.spec.whatwg.org/#dom-document-createcdatasection
39030
+ */
38895
39031
  createCDATASection : function(data){
39032
+ if (data.indexOf(']]>') !== -1) {
39033
+ throw new DOMException(INVALID_CHARACTER_ERR, 'data contains "]]>"');
39034
+ }
38896
39035
  var node = new CDATASection();
38897
39036
  node.ownerDocument = this;
38898
39037
  node.appendData(data);
38899
39038
  return node;
38900
39039
  },
39040
+ /**
39041
+ * Returns a ProcessingInstruction node whose target is target and data is data.
39042
+ *
39043
+ * __This implementation differs from the specification:__
39044
+ * - it does not do any input validation on the arguments and doesn't throw "InvalidCharacterError".
39045
+ *
39046
+ * Note: When the resulting document is serialized with `requireWellFormed: true`, the
39047
+ * serializer throws with code `INVALID_STATE_ERR` if `.data` contains `?>` (W3C DOM Parsing
39048
+ * §3.2.1.7). Without that option the data is emitted verbatim.
39049
+ *
39050
+ * @param {string} target
39051
+ * @param {string} data
39052
+ * @returns {ProcessingInstruction}
39053
+ * @see https://developer.mozilla.org/docs/Web/API/Document/createProcessingInstruction
39054
+ * @see https://dom.spec.whatwg.org/#dom-document-createprocessinginstruction
39055
+ * @see https://www.w3.org/TR/DOM-Parsing/#dfn-concept-serialize-xml §3.2.1.7
39056
+ */
38901
39057
  createProcessingInstruction : function(target,data){
38902
39058
  var node = new ProcessingInstruction();
38903
39059
  node.ownerDocument = this;
@@ -39123,6 +39279,19 @@ function requireDom () {
39123
39279
  _extends(CDATASection,CharacterData);
39124
39280
 
39125
39281
 
39282
+ /**
39283
+ * Represents a DocumentType node (the `<!DOCTYPE ...>` declaration).
39284
+ *
39285
+ * `publicId`, `systemId`, and `internalSubset` are plain own-property assignments.
39286
+ * xmldom does not enforce the `readonly` constraint declared by the WHATWG DOM spec —
39287
+ * direct property writes succeed silently. Values are serialized verbatim when
39288
+ * `requireWellFormed` is false (the default). When the serializer is invoked with
39289
+ * `requireWellFormed: true` (via the 4th-parameter options object), it validates each
39290
+ * field and throws `DOMException` with code `INVALID_STATE_ERR` on invalid values.
39291
+ *
39292
+ * @class
39293
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DocumentType MDN
39294
+ */
39126
39295
  function DocumentType() {
39127
39296
  } DocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;
39128
39297
  _extends(DocumentType,Node);
@@ -39150,11 +39319,48 @@ function requireDom () {
39150
39319
  ProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;
39151
39320
  _extends(ProcessingInstruction,Node);
39152
39321
  function XMLSerializer(){}
39153
- XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){
39154
- return nodeSerializeToString.call(node,isHtml,nodeFilter);
39322
+ /**
39323
+ * Returns the result of serializing `node` to XML.
39324
+ *
39325
+ * When `options.requireWellFormed` is `true`, the serializer throws for content that would
39326
+ * produce ill-formed XML.
39327
+ *
39328
+ * __This implementation differs from the specification:__
39329
+ * - CDATASection nodes whose data contains `]]>` are serialized by splitting the section
39330
+ * at each `]]>` occurrence (following W3C DOM Level 3 Core `split-cdata-sections`
39331
+ * default behaviour) unless `requireWellFormed` is `true`.
39332
+ * - when `requireWellFormed` is `true`, `DOMException` with code `INVALID_STATE_ERR`
39333
+ * is only thrown to prevent injection vectors, not for all the spec mandated checks.
39334
+ *
39335
+ * @param {Node} node
39336
+ * @param {boolean} [isHtml]
39337
+ * @param {function} [nodeFilter]
39338
+ * @param {Object} [options]
39339
+ * @param {boolean} [options.requireWellFormed=false]
39340
+ * When `true`, throws for content that would produce ill-formed XML.
39341
+ * @returns {string}
39342
+ * @throws {DOMException}
39343
+ * With code `INVALID_STATE_ERR` when `requireWellFormed` is `true` and:
39344
+ * - a CDATASection node's data contains `"]]>"`,
39345
+ * - a Comment node's data contains `"-->"` (bare `"--"` does not throw on this branch),
39346
+ * - a ProcessingInstruction's data contains `"?>"`,
39347
+ * - a DocumentType's `publicId` is non-empty and does not match the XML `PubidLiteral`
39348
+ * production,
39349
+ * - a DocumentType's `systemId` is non-empty and does not match the XML `SystemLiteral`
39350
+ * production, or
39351
+ * - a DocumentType's `internalSubset` contains `"]>"`.
39352
+ * Note: xmldom does not enforce `readonly` on DocumentType fields — direct property
39353
+ * writes succeed and are covered by the serializer-level checks above.
39354
+ * @see https://html.spec.whatwg.org/#dom-xmlserializer-serializetostring
39355
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serialization
39356
+ * @see https://github.com/w3c/DOM-Parsing/issues/84
39357
+ */
39358
+ XMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter,options){
39359
+ return nodeSerializeToString.call(node,isHtml,nodeFilter,options);
39155
39360
  };
39156
39361
  Node.prototype.toString = nodeSerializeToString;
39157
- function nodeSerializeToString(isHtml,nodeFilter){
39362
+ function nodeSerializeToString(isHtml,nodeFilter,options){
39363
+ var requireWellFormed = !!options && !!options.requireWellFormed;
39158
39364
  var buf = [];
39159
39365
  var refNode = this.nodeType == 9 && this.documentElement || this;
39160
39366
  var prefix = refNode.prefix;
@@ -39171,7 +39377,7 @@ function requireDom () {
39171
39377
  ];
39172
39378
  }
39173
39379
  }
39174
- serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);
39380
+ serializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces,requireWellFormed);
39175
39381
  //console.log('###',this.nodeType,uri,prefix,buf.join(''))
39176
39382
  return buf.join('');
39177
39383
  }
@@ -39220,271 +39426,323 @@ function requireDom () {
39220
39426
  buf.push(' ', qualifiedName, '="', value.replace(/[<>&"\t\n\r]/g, _xmlEncoder), '"');
39221
39427
  }
39222
39428
 
39223
- function serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){
39429
+ function serializeToString(node, buf, isHTML, nodeFilter, visibleNamespaces, requireWellFormed) {
39224
39430
  if (!visibleNamespaces) {
39225
39431
  visibleNamespaces = [];
39226
39432
  }
39227
-
39228
- if(nodeFilter){
39229
- node = nodeFilter(node);
39230
- if(node){
39231
- if(typeof node == 'string'){
39232
- buf.push(node);
39233
- return;
39234
- }
39235
- }else {
39236
- return;
39237
- }
39238
- //buf.sort.apply(attrs, attributeSorter);
39239
- }
39240
-
39241
- switch(node.nodeType){
39242
- case ELEMENT_NODE:
39243
- var attrs = node.attributes;
39244
- var len = attrs.length;
39245
- var child = node.firstChild;
39246
- var nodeName = node.tagName;
39247
-
39248
- isHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML;
39249
-
39250
- var prefixedNodeName = nodeName;
39251
- if (!isHTML && !node.prefix && node.namespaceURI) {
39252
- var defaultNS;
39253
- // lookup current default ns from `xmlns` attribute
39254
- for (var ai = 0; ai < attrs.length; ai++) {
39255
- if (attrs.item(ai).name === 'xmlns') {
39256
- defaultNS = attrs.item(ai).value;
39257
- break
39258
- }
39259
- }
39260
- if (!defaultNS) {
39261
- // lookup current default ns in visibleNamespaces
39262
- for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
39263
- var namespace = visibleNamespaces[nsi];
39264
- if (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {
39265
- defaultNS = namespace.namespace;
39266
- break
39433
+ walkDOM(node, { ns: visibleNamespaces, isHTML: isHTML }, {
39434
+ enter: function (n, ctx) {
39435
+ var ns = ctx.ns;
39436
+ var html = ctx.isHTML;
39437
+
39438
+ if (nodeFilter) {
39439
+ n = nodeFilter(n);
39440
+ if (n) {
39441
+ if (typeof n == 'string') {
39442
+ buf.push(n);
39443
+ return null;
39267
39444
  }
39445
+ } else {
39446
+ return null;
39268
39447
  }
39269
39448
  }
39270
- if (defaultNS !== node.namespaceURI) {
39271
- for (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {
39272
- var namespace = visibleNamespaces[nsi];
39273
- if (namespace.namespace === node.namespaceURI) {
39274
- if (namespace.prefix) {
39275
- prefixedNodeName = namespace.prefix + ':' + nodeName;
39449
+
39450
+ switch (n.nodeType) {
39451
+ case ELEMENT_NODE:
39452
+ var attrs = n.attributes;
39453
+ var len = attrs.length;
39454
+ var nodeName = n.tagName;
39455
+
39456
+ html = NAMESPACE.isHTML(n.namespaceURI) || html;
39457
+
39458
+ var prefixedNodeName = nodeName;
39459
+ if (!html && !n.prefix && n.namespaceURI) {
39460
+ var defaultNS;
39461
+ // lookup current default ns from `xmlns` attribute
39462
+ for (var ai = 0; ai < attrs.length; ai++) {
39463
+ if (attrs.item(ai).name === 'xmlns') {
39464
+ defaultNS = attrs.item(ai).value;
39465
+ break;
39466
+ }
39467
+ }
39468
+ if (!defaultNS) {
39469
+ // lookup current default ns in visibleNamespaces
39470
+ for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
39471
+ var nsEntry = ns[nsi];
39472
+ if (nsEntry.prefix === '' && nsEntry.namespace === n.namespaceURI) {
39473
+ defaultNS = nsEntry.namespace;
39474
+ break;
39475
+ }
39476
+ }
39477
+ }
39478
+ if (defaultNS !== n.namespaceURI) {
39479
+ for (var nsi = ns.length - 1; nsi >= 0; nsi--) {
39480
+ var nsEntry = ns[nsi];
39481
+ if (nsEntry.namespace === n.namespaceURI) {
39482
+ if (nsEntry.prefix) {
39483
+ prefixedNodeName = nsEntry.prefix + ':' + nodeName;
39484
+ }
39485
+ break;
39486
+ }
39487
+ }
39276
39488
  }
39277
- break
39278
39489
  }
39279
- }
39280
- }
39281
- }
39282
39490
 
39283
- buf.push('<', prefixedNodeName);
39491
+ buf.push('<', prefixedNodeName);
39492
+
39493
+ // Build a fresh namespace snapshot for this element's children.
39494
+ // The slice prevents sibling elements from inheriting each other's declarations.
39495
+ var childNs = ns.slice();
39496
+ for (var i = 0; i < len; i++) {
39497
+ var attr = attrs.item(i);
39498
+ if (attr.prefix == 'xmlns') {
39499
+ childNs.push({ prefix: attr.localName, namespace: attr.value });
39500
+ } else if (attr.nodeName == 'xmlns') {
39501
+ childNs.push({ prefix: '', namespace: attr.value });
39502
+ }
39503
+ }
39284
39504
 
39285
- for(var i=0;i<len;i++){
39286
- // add namespaces for attributes
39287
- var attr = attrs.item(i);
39288
- if (attr.prefix == 'xmlns') {
39289
- visibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });
39290
- }else if(attr.nodeName == 'xmlns'){
39291
- visibleNamespaces.push({ prefix: '', namespace: attr.value });
39292
- }
39293
- }
39505
+ for (var i = 0; i < len; i++) {
39506
+ var attr = attrs.item(i);
39507
+ if (needNamespaceDefine(attr, html, childNs)) {
39508
+ var attrPrefix = attr.prefix || '';
39509
+ var uri = attr.namespaceURI;
39510
+ addSerializedAttribute(buf, attrPrefix ? 'xmlns:' + attrPrefix : 'xmlns', uri);
39511
+ childNs.push({ prefix: attrPrefix, namespace: uri });
39512
+ }
39513
+ // Apply nodeFilter and serialize the attribute.
39514
+ var filteredAttr = nodeFilter ? nodeFilter(attr) : attr;
39515
+ if (filteredAttr) {
39516
+ if (typeof filteredAttr === 'string') {
39517
+ buf.push(filteredAttr);
39518
+ } else {
39519
+ addSerializedAttribute(buf, filteredAttr.name, filteredAttr.value);
39520
+ }
39521
+ }
39522
+ }
39294
39523
 
39295
- for(var i=0;i<len;i++){
39296
- var attr = attrs.item(i);
39297
- if (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {
39298
- var prefix = attr.prefix||'';
39299
- var uri = attr.namespaceURI;
39300
- addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
39301
- visibleNamespaces.push({ prefix: prefix, namespace:uri });
39302
- }
39303
- serializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);
39304
- }
39524
+ // add namespace for current node
39525
+ if (nodeName === prefixedNodeName && needNamespaceDefine(n, html, childNs)) {
39526
+ var nodePrefix = n.prefix || '';
39527
+ var uri = n.namespaceURI;
39528
+ addSerializedAttribute(buf, nodePrefix ? 'xmlns:' + nodePrefix : 'xmlns', uri);
39529
+ childNs.push({ prefix: nodePrefix, namespace: uri });
39530
+ }
39305
39531
 
39306
- // add namespace for current node
39307
- if (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {
39308
- var prefix = node.prefix||'';
39309
- var uri = node.namespaceURI;
39310
- addSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : "xmlns", uri);
39311
- visibleNamespaces.push({ prefix: prefix, namespace:uri });
39312
- }
39532
+ var child = n.firstChild;
39533
+ if (child || html && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)) {
39534
+ buf.push('>');
39535
+ if (html && /^script$/i.test(nodeName)) {
39536
+ // Inline serialization for <script> children; return null to skip walkDOM descent.
39537
+ while (child) {
39538
+ if (child.data) {
39539
+ buf.push(child.data);
39540
+ } else {
39541
+ serializeToString(child, buf, html, nodeFilter, childNs.slice(), requireWellFormed);
39542
+ }
39543
+ child = child.nextSibling;
39544
+ }
39545
+ buf.push('</', nodeName, '>');
39546
+ return null;
39547
+ }
39548
+ // Return child context; walkDOM descends and exit emits the closing tag.
39549
+ return { ns: childNs, isHTML: html, tag: prefixedNodeName };
39550
+ } else {
39551
+ buf.push('/>');
39552
+ return null;
39553
+ }
39313
39554
 
39314
- if(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){
39315
- buf.push('>');
39316
- //if is cdata child node
39317
- if(isHTML && /^script$/i.test(nodeName)){
39318
- while(child){
39319
- if(child.data){
39320
- buf.push(child.data);
39321
- }else {
39322
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
39555
+ case DOCUMENT_NODE:
39556
+ case DOCUMENT_FRAGMENT_NODE:
39557
+ // Descend into children; exit is a no-op (tag is null).
39558
+ return { ns: ns.slice(), isHTML: html, tag: null };
39559
+
39560
+ case ATTRIBUTE_NODE:
39561
+ addSerializedAttribute(buf, n.name, n.value);
39562
+ return null;
39563
+
39564
+ case TEXT_NODE:
39565
+ /**
39566
+ * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
39567
+ * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
39568
+ * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
39569
+ * `&amp;` and `&lt;` respectively.
39570
+ * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
39571
+ * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
39572
+ * when that string is not marking the end of a CDATA section.
39573
+ *
39574
+ * In the content of elements, character data is any string of characters
39575
+ * which does not contain the start-delimiter of any markup
39576
+ * and does not include the CDATA-section-close delimiter, `]]>`.
39577
+ *
39578
+ * @see https://www.w3.org/TR/xml/#NT-CharData
39579
+ * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
39580
+ */
39581
+ buf.push(n.data.replace(/[<&>]/g, _xmlEncoder));
39582
+ return null;
39583
+
39584
+ case CDATA_SECTION_NODE:
39585
+ if (requireWellFormed && n.data.indexOf(']]>') !== -1) {
39586
+ throw new DOMException(INVALID_STATE_ERR, 'The CDATASection data contains "]]>"');
39323
39587
  }
39324
- child = child.nextSibling;
39325
- }
39326
- }else
39327
- {
39328
- while(child){
39329
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
39330
- child = child.nextSibling;
39331
- }
39332
- }
39333
- buf.push('</',prefixedNodeName,'>');
39334
- }else {
39335
- buf.push('/>');
39336
- }
39337
- // remove added visible namespaces
39338
- //visibleNamespaces.length = startVisibleNamespaces;
39339
- return;
39340
- case DOCUMENT_NODE:
39341
- case DOCUMENT_FRAGMENT_NODE:
39342
- var child = node.firstChild;
39343
- while(child){
39344
- serializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());
39345
- child = child.nextSibling;
39346
- }
39347
- return;
39348
- case ATTRIBUTE_NODE:
39349
- return addSerializedAttribute(buf, node.name, node.value);
39350
- case TEXT_NODE:
39351
- /**
39352
- * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,
39353
- * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.
39354
- * If they are needed elsewhere, they must be escaped using either numeric character references or the strings
39355
- * `&amp;` and `&lt;` respectively.
39356
- * The right angle bracket (>) may be represented using the string " &gt; ", and must, for compatibility,
39357
- * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,
39358
- * when that string is not marking the end of a CDATA section.
39359
- *
39360
- * In the content of elements, character data is any string of characters
39361
- * which does not contain the start-delimiter of any markup
39362
- * and does not include the CDATA-section-close delimiter, `]]>`.
39363
- *
39364
- * @see https://www.w3.org/TR/xml/#NT-CharData
39365
- * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node
39366
- */
39367
- return buf.push(node.data
39368
- .replace(/[<&>]/g,_xmlEncoder)
39369
- );
39370
- case CDATA_SECTION_NODE:
39371
- return buf.push( '<![CDATA[',node.data,']]>');
39372
- case COMMENT_NODE:
39373
- return buf.push( "<!--",node.data,"-->");
39374
- case DOCUMENT_TYPE_NODE:
39375
- var pubid = node.publicId;
39376
- var sysid = node.systemId;
39377
- buf.push('<!DOCTYPE ',node.name);
39378
- if(pubid){
39379
- buf.push(' PUBLIC ', pubid);
39380
- if (sysid && sysid!='.') {
39381
- buf.push(' ', sysid);
39588
+ buf.push('<![CDATA[', n.data.replace(/]]>/g, ']]]]><![CDATA[>'), ']]>');
39589
+ return null;
39590
+
39591
+ case COMMENT_NODE:
39592
+ if (requireWellFormed && n.data.indexOf('-->') !== -1) {
39593
+ throw new DOMException(INVALID_STATE_ERR, 'The comment node data contains "-->"');
39594
+ }
39595
+ buf.push('<!--', n.data, '-->');
39596
+ return null;
39597
+
39598
+ case DOCUMENT_TYPE_NODE:
39599
+ if (requireWellFormed) {
39600
+ if (n.publicId && !/^("[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%']*"|'[\x20\r\na-zA-Z0-9\-()+,.\/:=?;!*#@$_%'"]*')$/.test(n.publicId)) {
39601
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType publicId is not a valid PubidLiteral');
39602
+ }
39603
+ if (n.systemId && !/^("[^"]*"|'[^']*')$/.test(n.systemId)) {
39604
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType systemId is not a valid SystemLiteral');
39605
+ }
39606
+ if (n.internalSubset && n.internalSubset.indexOf(']>') !== -1) {
39607
+ throw new DOMException(INVALID_STATE_ERR, 'DocumentType internalSubset contains "]>"');
39608
+ }
39609
+ }
39610
+ var pubid = n.publicId;
39611
+ var sysid = n.systemId;
39612
+ buf.push('<!DOCTYPE ', n.name);
39613
+ if (pubid) {
39614
+ buf.push(' PUBLIC ', pubid);
39615
+ if (sysid && sysid != '.') {
39616
+ buf.push(' ', sysid);
39617
+ }
39618
+ buf.push('>');
39619
+ } else if (sysid && sysid != '.') {
39620
+ buf.push(' SYSTEM ', sysid, '>');
39621
+ } else {
39622
+ var sub = n.internalSubset;
39623
+ if (sub) {
39624
+ buf.push(' [', sub, ']');
39625
+ }
39626
+ buf.push('>');
39627
+ }
39628
+ return null;
39629
+
39630
+ case PROCESSING_INSTRUCTION_NODE:
39631
+ if (requireWellFormed && n.data.indexOf('?>') !== -1) {
39632
+ throw new DOMException(INVALID_STATE_ERR, 'The ProcessingInstruction data contains "?>"');
39633
+ }
39634
+ buf.push('<?', n.target, ' ', n.data, '?>');
39635
+ return null;
39636
+
39637
+ case ENTITY_REFERENCE_NODE:
39638
+ buf.push('&', n.nodeName, ';');
39639
+ return null;
39640
+
39641
+ //case ENTITY_NODE:
39642
+ //case NOTATION_NODE:
39643
+ default:
39644
+ buf.push('??', n.nodeName);
39645
+ return null;
39382
39646
  }
39383
- buf.push('>');
39384
- }else if(sysid && sysid!='.'){
39385
- buf.push(' SYSTEM ', sysid, '>');
39386
- }else {
39387
- var sub = node.internalSubset;
39388
- if(sub){
39389
- buf.push(" [",sub,"]");
39647
+ },
39648
+ exit: function (n, childCtx) {
39649
+ if (childCtx && childCtx.tag) {
39650
+ buf.push('</', childCtx.tag, '>');
39390
39651
  }
39391
- buf.push(">");
39392
- }
39393
- return;
39394
- case PROCESSING_INSTRUCTION_NODE:
39395
- return buf.push( "<?",node.target," ",node.data,"?>");
39396
- case ENTITY_REFERENCE_NODE:
39397
- return buf.push( '&',node.nodeName,';');
39398
- //case ENTITY_NODE:
39399
- //case NOTATION_NODE:
39400
- default:
39401
- buf.push('??',node.nodeName);
39402
- }
39652
+ },
39653
+ });
39403
39654
  }
39404
- function importNode(doc,node,deep){
39405
- var node2;
39406
- switch (node.nodeType) {
39407
- case ELEMENT_NODE:
39408
- node2 = node.cloneNode(false);
39409
- node2.ownerDocument = doc;
39410
- //var attrs = node2.attributes;
39411
- //var len = attrs.length;
39412
- //for(var i=0;i<len;i++){
39413
- //node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));
39414
- //}
39415
- case DOCUMENT_FRAGMENT_NODE:
39416
- break;
39417
- case ATTRIBUTE_NODE:
39418
- deep = true;
39419
- break;
39420
- //case ENTITY_REFERENCE_NODE:
39421
- //case PROCESSING_INSTRUCTION_NODE:
39422
- ////case TEXT_NODE:
39423
- //case CDATA_SECTION_NODE:
39424
- //case COMMENT_NODE:
39425
- // deep = false;
39426
- // break;
39427
- //case DOCUMENT_NODE:
39428
- //case DOCUMENT_TYPE_NODE:
39429
- //cannot be imported.
39430
- //case ENTITY_NODE:
39431
- //case NOTATION_NODE:
39432
- //can not hit in level3
39433
- //default:throw e;
39434
- }
39435
- if(!node2){
39436
- node2 = node.cloneNode(false);//false
39437
- }
39438
- node2.ownerDocument = doc;
39439
- node2.parentNode = null;
39440
- if(deep){
39441
- var child = node.firstChild;
39442
- while(child){
39443
- node2.appendChild(importNode(doc,child,deep));
39444
- child = child.nextSibling;
39445
- }
39446
- }
39447
- return node2;
39655
+ /**
39656
+ * Imports a node from a different document into `doc`, creating a new copy.
39657
+ * Delegates to {@link walkDOM} for traversal. Each node in the subtree is shallow-cloned,
39658
+ * stamped with `doc` as its `ownerDocument`, and detached (`parentNode` set to `null`).
39659
+ * Children are imported recursively when `deep` is `true`; for {@link Attr} nodes `deep` is
39660
+ * always forced to `true`
39661
+ * because an attribute's value lives in a child text node.
39662
+ *
39663
+ * @param {Document} doc
39664
+ * The document that will own the imported node.
39665
+ * @param {Node} node
39666
+ * The node to import.
39667
+ * @param {boolean} deep
39668
+ * If `true`, descendants are imported recursively.
39669
+ * @returns {Node}
39670
+ * The newly imported node, now owned by `doc`.
39671
+ */
39672
+ function importNode(doc, node, deep) {
39673
+ var destRoot;
39674
+ walkDOM(node, null, {
39675
+ enter: function (srcNode, destParent) {
39676
+ // Shallow-clone the node and stamp it into the target document.
39677
+ var destNode = srcNode.cloneNode(false);
39678
+ destNode.ownerDocument = doc;
39679
+ destNode.parentNode = null;
39680
+ // capture as the root of the imported subtree or attach to parent.
39681
+ if (destParent === null) {
39682
+ destRoot = destNode;
39683
+ } else {
39684
+ destParent.appendChild(destNode);
39685
+ }
39686
+ // ATTRIBUTE_NODE must always be imported deeply: its value lives in a child text node.
39687
+ var shouldDeep = srcNode.nodeType === ATTRIBUTE_NODE || deep;
39688
+ return shouldDeep ? destNode : null;
39689
+ },
39690
+ });
39691
+ return destRoot;
39448
39692
  }
39449
39693
  //
39450
39694
  //var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,
39451
39695
  // attributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};
39452
- function cloneNode(doc,node,deep){
39453
- var node2 = new node.constructor();
39454
- for (var n in node) {
39455
- if (Object.prototype.hasOwnProperty.call(node, n)) {
39456
- var v = node[n];
39457
- if (typeof v != "object") {
39458
- if (v != node2[n]) {
39459
- node2[n] = v;
39696
+ function cloneNode(doc, node, deep) {
39697
+ var destRoot;
39698
+ walkDOM(node, null, {
39699
+ enter: function (srcNode, destParent) {
39700
+ // 1. Create a blank node of the same type and copy all scalar own properties.
39701
+ var destNode = new srcNode.constructor();
39702
+ for (var n in srcNode) {
39703
+ if (Object.prototype.hasOwnProperty.call(srcNode, n)) {
39704
+ var v = srcNode[n];
39705
+ if (typeof v != 'object') {
39706
+ if (v != destNode[n]) {
39707
+ destNode[n] = v;
39708
+ }
39709
+ }
39460
39710
  }
39461
39711
  }
39462
- }
39463
- }
39464
- if(node.childNodes){
39465
- node2.childNodes = new NodeList();
39466
- }
39467
- node2.ownerDocument = doc;
39468
- switch (node2.nodeType) {
39469
- case ELEMENT_NODE:
39470
- var attrs = node.attributes;
39471
- var attrs2 = node2.attributes = new NamedNodeMap();
39472
- var len = attrs.length;
39473
- attrs2._ownerElement = node2;
39474
- for(var i=0;i<len;i++){
39475
- node2.setAttributeNode(cloneNode(doc,attrs.item(i),true));
39476
- }
39477
- break; case ATTRIBUTE_NODE:
39478
- deep = true;
39479
- }
39480
- if(deep){
39481
- var child = node.firstChild;
39482
- while(child){
39483
- node2.appendChild(cloneNode(doc,child,deep));
39484
- child = child.nextSibling;
39485
- }
39486
- }
39487
- return node2;
39712
+ if (srcNode.childNodes) {
39713
+ destNode.childNodes = new NodeList();
39714
+ }
39715
+ destNode.ownerDocument = doc;
39716
+ // 2. Handle node-type-specific setup.
39717
+ // Attributes are not DOM children, so they are cloned inline here
39718
+ // rather than by walkDOM descent.
39719
+ // ATTRIBUTE_NODE forces deep=true so its own children are walked.
39720
+ var shouldDeep = deep;
39721
+ switch (destNode.nodeType) {
39722
+ case ELEMENT_NODE:
39723
+ var attrs = srcNode.attributes;
39724
+ var attrs2 = (destNode.attributes = new NamedNodeMap());
39725
+ var len = attrs.length;
39726
+ attrs2._ownerElement = destNode;
39727
+ for (var i = 0; i < len; i++) {
39728
+ destNode.setAttributeNode(cloneNode(doc, attrs.item(i), true));
39729
+ }
39730
+ break;
39731
+ case ATTRIBUTE_NODE:
39732
+ shouldDeep = true;
39733
+ }
39734
+ // 3. Attach to parent, or capture as the root of the cloned subtree.
39735
+ if (destParent !== null) {
39736
+ destParent.appendChild(destNode);
39737
+ } else {
39738
+ destRoot = destNode;
39739
+ }
39740
+ // 4. Return destNode as the context for children (causes walkDOM to descend),
39741
+ // or null to skip children (shallow clone).
39742
+ return shouldDeep ? destNode : null;
39743
+ },
39744
+ });
39745
+ return destRoot;
39488
39746
  }
39489
39747
 
39490
39748
  function __set__(object,key,value){
@@ -39500,49 +39758,55 @@ function requireDom () {
39500
39758
  }
39501
39759
  });
39502
39760
 
39503
- Object.defineProperty(Node.prototype,'textContent',{
39504
- get:function(){
39505
- return getTextContent(this);
39761
+ /**
39762
+ * The text content of this node and its descendants.
39763
+ *
39764
+ * Setting `textContent` on an element or document fragment replaces all child nodes with a
39765
+ * single text node; on other nodes it sets `data`, `value`, and `nodeValue` directly.
39766
+ *
39767
+ * @type {string | null}
39768
+ * @see {@link https://dom.spec.whatwg.org/#dom-node-textcontent}
39769
+ */
39770
+ Object.defineProperty(Node.prototype, 'textContent', {
39771
+ get: function () {
39772
+ if (this.nodeType === ELEMENT_NODE || this.nodeType === DOCUMENT_FRAGMENT_NODE) {
39773
+ var buf = [];
39774
+ walkDOM(this, null, {
39775
+ enter: function (n) {
39776
+ if (n.nodeType === ELEMENT_NODE || n.nodeType === DOCUMENT_FRAGMENT_NODE) {
39777
+ return true; // enter children
39778
+ }
39779
+ if (n.nodeType === PROCESSING_INSTRUCTION_NODE || n.nodeType === COMMENT_NODE) {
39780
+ return null; // excluded from text content
39781
+ }
39782
+ buf.push(n.nodeValue);
39783
+ },
39784
+ });
39785
+ return buf.join('');
39786
+ }
39787
+ return this.nodeValue;
39506
39788
  },
39507
39789
 
39508
- set:function(data){
39509
- switch(this.nodeType){
39510
- case ELEMENT_NODE:
39511
- case DOCUMENT_FRAGMENT_NODE:
39512
- while(this.firstChild){
39513
- this.removeChild(this.firstChild);
39514
- }
39515
- if(data || String(data)){
39516
- this.appendChild(this.ownerDocument.createTextNode(data));
39517
- }
39518
- break;
39790
+ set: function (data) {
39791
+ switch (this.nodeType) {
39792
+ case ELEMENT_NODE:
39793
+ case DOCUMENT_FRAGMENT_NODE:
39794
+ while (this.firstChild) {
39795
+ this.removeChild(this.firstChild);
39796
+ }
39797
+ if (data || String(data)) {
39798
+ this.appendChild(this.ownerDocument.createTextNode(data));
39799
+ }
39800
+ break;
39519
39801
 
39520
- default:
39521
- this.data = data;
39522
- this.value = data;
39523
- this.nodeValue = data;
39802
+ default:
39803
+ this.data = data;
39804
+ this.value = data;
39805
+ this.nodeValue = data;
39524
39806
  }
39525
- }
39807
+ },
39526
39808
  });
39527
39809
 
39528
- function getTextContent(node){
39529
- switch(node.nodeType){
39530
- case ELEMENT_NODE:
39531
- case DOCUMENT_FRAGMENT_NODE:
39532
- var buf = [];
39533
- node = node.firstChild;
39534
- while(node){
39535
- if(node.nodeType!==7 && node.nodeType !==8){
39536
- buf.push(getTextContent(node));
39537
- }
39538
- node = node.nextSibling;
39539
- }
39540
- return buf.join('');
39541
- default:
39542
- return node.nodeValue;
39543
- }
39544
- }
39545
-
39546
39810
  __set__ = function(object,key,value){
39547
39811
  //console.log(value)
39548
39812
  object['$$'+key] = value;
@@ -39558,6 +39822,7 @@ function requireDom () {
39558
39822
  dom.Element = Element;
39559
39823
  dom.Node = Node;
39560
39824
  dom.NodeList = NodeList;
39825
+ dom.walkDOM = walkDOM;
39561
39826
  dom.XMLSerializer = XMLSerializer;
39562
39827
  //}
39563
39828
  return dom;
@@ -39572,7 +39837,7 @@ var hasRequiredEntities;
39572
39837
  function requireEntities () {
39573
39838
  if (hasRequiredEntities) return entities;
39574
39839
  hasRequiredEntities = 1;
39575
- (function (exports$1) {
39840
+ (function (exports) {
39576
39841
 
39577
39842
  var freeze = requireConventions().freeze;
39578
39843
 
@@ -39583,7 +39848,7 @@ function requireEntities () {
39583
39848
  * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0
39584
39849
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML Wikipedia
39585
39850
  */
39586
- exports$1.XML_ENTITIES = freeze({
39851
+ exports.XML_ENTITIES = freeze({
39587
39852
  amp: '&',
39588
39853
  apos: "'",
39589
39854
  gt: '>',
@@ -39605,7 +39870,7 @@ function requireEntities () {
39605
39870
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)
39606
39871
  * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)
39607
39872
  */
39608
- exports$1.HTML_ENTITIES = freeze({
39873
+ exports.HTML_ENTITIES = freeze({
39609
39874
  Aacute: '\u00C1',
39610
39875
  aacute: '\u00E1',
39611
39876
  Abreve: '\u0102',
@@ -41737,7 +42002,7 @@ function requireEntities () {
41737
42002
  * @deprecated use `HTML_ENTITIES` instead
41738
42003
  * @see HTML_ENTITIES
41739
42004
  */
41740
- exports$1.entityMap = exports$1.HTML_ENTITIES;
42005
+ exports.entityMap = exports.HTML_ENTITIES;
41741
42006
  } (entities));
41742
42007
  return entities;
41743
42008
  }
@@ -42348,7 +42613,7 @@ function requireSax () {
42348
42613
  function parseInstruction(source,start,domBuilder){
42349
42614
  var end = source.indexOf('?>',start);
42350
42615
  if(end){
42351
- var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)\s*$/);
42616
+ var match = source.substring(start,end).match(/^<\?(\S*)\s*([\s\S]*?)$/);
42352
42617
  if(match){
42353
42618
  match[0].length;
42354
42619
  domBuilder.processingInstruction(match[1], match[2]) ;
@@ -43545,7 +43810,7 @@ var hasRequiredMoment;
43545
43810
  function requireMoment () {
43546
43811
  if (hasRequiredMoment) return moment$1.exports;
43547
43812
  hasRequiredMoment = 1;
43548
- (function (module, exports$1) {
43813
+ (function (module, exports) {
43549
43814
  (function (global, factory) {
43550
43815
  module.exports = factory() ;
43551
43816
  }(this, (function () {
@@ -49235,7 +49500,7 @@ function requireMomentTimezone () {
49235
49500
  hasRequiredMomentTimezone = 1;
49236
49501
  (function (module) {
49237
49502
  //! moment-timezone.js
49238
- //! version : 0.6.0
49503
+ //! version : 0.6.2
49239
49504
  //! Copyright (c) JS Foundation and other contributors
49240
49505
  //! license : MIT
49241
49506
  //! github.com/moment/moment-timezone
@@ -49261,7 +49526,7 @@ function requireMomentTimezone () {
49261
49526
  // return moment;
49262
49527
  // }
49263
49528
 
49264
- var VERSION = "0.6.0",
49529
+ var VERSION = "0.6.2",
49265
49530
  zones = {},
49266
49531
  links = {},
49267
49532
  countries = {},
@@ -81680,7 +81945,7 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
81680
81945
  verifySemanticsOfNgModuleImport(modOrStandaloneCmpt, moduleType);
81681
81946
  verifySemanticsOfNgModuleDef(modOrStandaloneCmpt, false, moduleType);
81682
81947
  });
81683
- const exports$1 = maybeUnwrapFn(ngModuleDef.exports);
81948
+ const exports = maybeUnwrapFn(ngModuleDef.exports);
81684
81949
  declarations.forEach(verifyDeclarationsHaveDefinitions);
81685
81950
  declarations.forEach(verifyDirectivesHaveSelector);
81686
81951
  declarations.forEach((declarationType) => verifyNotStandalone(declarationType, moduleType));
@@ -81688,7 +81953,7 @@ function verifySemanticsOfNgModuleDef(moduleType, allowDuplicateDeclarationsInRo
81688
81953
  ...declarations.map(resolveForwardRef),
81689
81954
  ...flatten(imports.map(computeCombinedExports)).map(resolveForwardRef),
81690
81955
  ];
81691
- exports$1.forEach(verifyExportsAreDeclaredOrReExported);
81956
+ exports.forEach(verifyExportsAreDeclaredOrReExported);
81692
81957
  declarations.forEach((decl) => verifyDeclarationIsUnique(decl, allowDuplicateDeclarationsInRoot));
81693
81958
  const ngModule = getAnnotation(moduleType, 'NgModule');
81694
81959
  if (ngModule) {
@@ -99707,11 +99972,11 @@ const getRowActionAttrs = attrs => {
99707
99972
  return tmpl;
99708
99973
  };
99709
99974
 
99710
- const $RAF = window.requestAnimationFrame;
99975
+ const $RAF$1 = window.requestAnimationFrame;
99711
99976
  const $RAFQueue = [];
99712
99977
  const invokeLater = fn => {
99713
99978
  if (!$RAFQueue.length) {
99714
- $RAF(() => {
99979
+ $RAF$1(() => {
99715
99980
  $RAFQueue.forEach(f => f());
99716
99981
  $RAFQueue.length = 0;
99717
99982
  });
@@ -99719,23 +99984,7 @@ const invokeLater = fn => {
99719
99984
  $RAFQueue.push(fn);
99720
99985
  };
99721
99986
  const setAttr = (node, attrName, val, sync) => {
99722
- const task = () => {
99723
- if (node instanceof Element) {
99724
- // Handle tabindex specifically - ensure it's a valid string representation
99725
- if (attrName === 'tabindex') {
99726
- // Convert to string, handling 0, null, undefined, and NaN
99727
- if (val === null || val === undefined || (typeof val === 'number' && isNaN(val))) {
99728
- node.removeAttribute(attrName);
99729
- }
99730
- else {
99731
- node.setAttribute(attrName, String(val));
99732
- }
99733
- }
99734
- else {
99735
- node.setAttribute(attrName, val);
99736
- }
99737
- }
99738
- };
99987
+ const task = () => node instanceof Element && node.setAttribute(attrName, val);
99739
99988
  invokeLater(task);
99740
99989
  };
99741
99990
 
@@ -100269,220 +100518,70 @@ const getFnForEventExpr = (expr) => {
100269
100518
  return fnExecutor(expr, ExpressionType.Action);
100270
100519
  };
100271
100520
 
100272
- // Constants
100273
- const WIDGET_ID_REGEX = /^(widget-[^_]+)/;
100274
- const WIDGET_PROPERTY_REGEX = /^widget-[^_]+_(.+)$/;
100275
- const ARRAY_INDEX_PLACEHOLDER = '[$i]';
100276
- const ARRAY_INDEX_ZERO = '[0]';
100277
100521
  const registry = new Map();
100278
100522
  const watchIdGenerator = new IDGenerator('watch-id-');
100279
- const FIRST_TIME_WATCH = Object.freeze({});
100280
- /**
100281
- * Extracts widget ID from identifier (e.g., "widget-id23_eventsource" -> "widget-id23")
100282
- */
100283
- const getWidgetId = (identifier) => {
100284
- if (!identifier || typeof identifier !== 'string') {
100285
- return null;
100286
- }
100287
- const match = identifier.match(WIDGET_ID_REGEX);
100288
- return match ? match[1] : null;
100289
- };
100290
- /**
100291
- * Extracts property name from identifier (e.g., "widget-id23_eventsource" -> "eventsource")
100292
- */
100293
- const getPropertyName = (identifier) => {
100294
- if (!identifier || typeof identifier !== 'string') {
100295
- return identifier;
100296
- }
100297
- const match = identifier.match(WIDGET_PROPERTY_REGEX);
100298
- return match ? match[1] : identifier;
100299
- };
100300
- /**
100301
- * Array consumer wrapper for array-based expressions
100302
- */
100523
+ const FIRST_TIME_WATCH = {};
100524
+ Object.freeze(FIRST_TIME_WATCH);
100303
100525
  const arrayConsumer = (listenerFn, restExpr, newVal, oldVal) => {
100304
- if (!isArray(newVal)) {
100305
- return;
100306
- }
100307
- let formattedData = newVal.map(datum => findValueOf(datum, restExpr));
100308
- // Flatten if result is array of arrays
100309
- if (isArray(formattedData[0])) {
100310
- formattedData = flatten$1(formattedData);
100526
+ let data = newVal, formattedData;
100527
+ if (isArray(data)) {
100528
+ formattedData = data.map(function (datum) {
100529
+ return findValueOf(datum, restExpr);
100530
+ });
100531
+ // If resulting structure is an array of array, flatten it
100532
+ if (isArray(formattedData[0])) {
100533
+ formattedData = flatten$1(formattedData);
100534
+ }
100535
+ listenerFn(formattedData, oldVal);
100311
100536
  }
100312
- listenerFn(formattedData, oldVal);
100313
100537
  };
100314
- /**
100315
- * Updates watch info for array expressions
100316
- */
100317
- const getUpdatedWatchInfo = (expr, acceptsArray, listener) => {
100318
- const regex = /\[\$i\]/g;
100538
+ const getUpdatedWatcInfo = (expr, acceptsArray, listener) => {
100539
+ // listener doesn't accept array
100540
+ // replace all `[$i]` with `[0]` and return the expression
100541
+ let regex = /\[\$i\]/g, $I = '[$i]', $0 = '[0]';
100319
100542
  if (!acceptsArray) {
100320
100543
  return {
100321
- expr: expr.replace(regex, ARRAY_INDEX_ZERO),
100322
- listener
100544
+ 'expr': expr.replace(regex, $0),
100545
+ 'listener': listener
100323
100546
  };
100324
100547
  }
100325
- const lastIndex = expr.lastIndexOf(ARRAY_INDEX_PLACEHOLDER);
100326
- const baseExpr = expr.substring(0, lastIndex).replace(ARRAY_INDEX_PLACEHOLDER, ARRAY_INDEX_ZERO);
100327
- const restExpr = expr.substring(lastIndex + 5);
100328
- const arrayConsumerFn = restExpr
100329
- ? arrayConsumer.bind(undefined, listener, restExpr)
100330
- : listener;
100548
+ // listener accepts array
100549
+ // replace all except the last `[$i]` with `[0]` and return the expression.
100550
+ var index = expr.lastIndexOf($I), _expr = expr.substr(0, index).replace($I, $0), restExpr = expr.substr(index + 5), arrayConsumerFn = listener;
100551
+ if (restExpr) {
100552
+ arrayConsumerFn = arrayConsumer.bind(undefined, listener, restExpr);
100553
+ }
100331
100554
  return {
100332
- expr: baseExpr,
100333
- listener: arrayConsumerFn
100555
+ 'expr': _expr,
100556
+ 'listener': arrayConsumerFn
100334
100557
  };
100335
100558
  };
100336
- /**
100337
- * Determines if an expression is static (doesn't need to be watched)
100338
- */
100339
- const STATIC_EXPRESSION_NAMES = [
100340
- "row.getProperty('investment')",
100341
- "row.getProperty('factsheetLink')",
100342
- "row.getProperty('isRebalanceEligible')"
100343
- ];
100344
- const isStaticExpression = (expr) => {
100345
- if (typeof expr !== 'string') {
100346
- return false;
100347
- }
100348
- const trimmedExpr = expr.trim();
100349
- // Expressions that always evaluate to localization strings
100350
- // if (trimmedExpr.includes('appLocale')) {
100351
- // return true;
100352
- // }
100353
- // Hard-coded static expression names
100354
- if (STATIC_EXPRESSION_NAMES.includes(trimmedExpr)) {
100355
- return true;
100356
- }
100357
- return false;
100358
- };
100359
- /**
100360
- * Gets the scope type from the scope object
100361
- */
100362
- const getScopeType = ($scope) => {
100363
- if (!$scope) {
100364
- return null;
100365
- }
100366
- if ($scope.pageName)
100367
- return 'Page';
100368
- if ($scope.prefabName)
100369
- return 'Prefab';
100370
- if ($scope.partialName)
100371
- return 'Partial';
100372
- // Check for App scope
100373
- if ($scope.Variables !== undefined &&
100374
- $scope.Actions !== undefined &&
100375
- !$scope.pageName &&
100376
- !$scope.prefabName &&
100377
- !$scope.partialName) {
100378
- return 'App';
100379
- }
100380
- if ($scope.constructor?.name === 'AppRef') {
100381
- return 'App';
100382
- }
100383
- return null;
100384
- };
100385
- /**
100386
- * Gets scope name based on scope type
100387
- */
100388
- const getScopeName = ($scope, scopeType) => {
100389
- if (!scopeType || !$scope) {
100390
- return null;
100391
- }
100392
- switch (scopeType) {
100393
- case 'Prefab': return $scope.prefabName || null;
100394
- case 'Partial': return $scope.partialName || null;
100395
- case 'Page': return $scope.pageName || null;
100396
- default: return null;
100397
- }
100398
- };
100399
- /**
100400
- * Main watch function
100401
- */
100402
100559
  const $watch = (expr, $scope, $locals, listener, identifier = watchIdGenerator.nextUid(), doNotClone = false, config = {}, isMuted) => {
100403
- // Handle array expressions
100404
- if (expr.includes(ARRAY_INDEX_PLACEHOLDER)) {
100405
- const watchInfo = getUpdatedWatchInfo(expr, config.arrayType || config.isList || false, listener);
100560
+ if (expr.indexOf('[$i]') !== -1) {
100561
+ let watchInfo = getUpdatedWatcInfo(expr, config && (config.arrayType || config.isList), listener);
100406
100562
  expr = watchInfo.expr;
100407
100563
  listener = watchInfo.listener;
100408
100564
  }
100409
- // Handle static expressions
100410
- if (isStaticExpression(expr)) {
100411
- try {
100412
- const fn = $parseExpr(expr);
100413
- const staticValue = fn($scope, $locals);
100414
- listener(staticValue, FIRST_TIME_WATCH);
100415
- }
100416
- catch (e) {
100417
- console.warn(`Error evaluating static expression '${expr}':`, e);
100418
- listener(undefined, FIRST_TIME_WATCH);
100419
- }
100420
- return () => { }; // No-op unsubscribe
100421
- }
100422
100565
  const fn = $parseExpr();
100423
- const scopeType = getScopeType($scope);
100424
- const scopeName = getScopeName($scope, scopeType);
100425
- const watchInfo = {
100426
- fn: fn.bind(null, $scope, $locals),
100566
+ registry.set(identifier, {
100567
+ fn: fn.bind(expr, $scope, $locals),
100427
100568
  listener,
100428
100569
  expr,
100429
100570
  last: FIRST_TIME_WATCH,
100430
100571
  doNotClone,
100431
- isMuted,
100432
- scopeType,
100433
- scopeName
100434
- };
100435
- // Store in registry
100436
- const widgetId = getWidgetId(identifier);
100437
- if (widgetId) {
100438
- const propertyName = getPropertyName(identifier);
100439
- if (!registry.has(widgetId)) {
100440
- registry.set(widgetId, {});
100441
- }
100442
- const widgetGroup = registry.get(widgetId);
100443
- widgetGroup[propertyName] = watchInfo;
100444
- }
100445
- else {
100446
- registry.set(identifier, watchInfo);
100447
- }
100572
+ isMuted: isMuted
100573
+ });
100448
100574
  return () => $unwatch(identifier);
100449
100575
  };
100450
- /**
100451
- * Unwatches a single identifier
100452
- */
100453
- const $unwatch = (identifier) => {
100454
- const widgetId = getWidgetId(identifier);
100455
- if (widgetId) {
100456
- const propertyName = getPropertyName(identifier);
100457
- const widgetGroup = registry.get(widgetId);
100458
- if (widgetGroup && typeof widgetGroup === 'object' && !widgetGroup.fn) {
100459
- const watchInfo = widgetGroup[propertyName];
100460
- if (watchInfo) {
100461
- delete widgetGroup[propertyName];
100462
- // Clean up empty widget groups
100463
- if (Object.keys(widgetGroup).length === 0) {
100464
- registry.delete(widgetId);
100465
- }
100466
- return true;
100467
- }
100468
- }
100469
- }
100470
- // Fallback to direct lookup
100471
- if (registry.has(identifier)) {
100472
- registry.delete(identifier);
100473
- return true;
100474
- }
100475
- return false;
100476
- };
100576
+ const $unwatch = identifier => registry.delete(identifier);
100577
+ window.watchRegistry = registry;
100477
100578
  const $appDigest = (() => {
100478
- return (force = false) => {
100579
+ return (force) => {
100479
100580
  {
100480
100581
  return;
100481
100582
  }
100482
100583
  };
100483
100584
  })();
100484
- // Export registry for debugging
100485
- window.watchRegistry = registry;
100486
100585
 
100487
100586
  var ComponentType;
100488
100587
  (function (ComponentType) {
@@ -100553,7 +100652,6 @@ const REGEX = {
100553
100652
  SUPPORTED_AUDIO_FORMAT: /\.(mp3|ogg|webm|wma|3gp|wav|m4a)$/i,
100554
100653
  SUPPORTED_VIDEO_FORMAT: /\.(mp4|ogg|webm|wmv|mpeg|mpg|avi|mov)$/i,
100555
100654
  VALID_WEB_URL: /^(http[s]?:\/\/)(www\.){0,1}[a-zA-Z0-9=:?\/\.\-]+(\.[a-zA-Z]{2,5}[\.]{0,1})?/,
100556
- VALID_IMAGE_URL: /^(https?|blob|data|file|ftp):/i,
100557
100655
  REPLACE_PATTERN: /\$\{([^\}]+)\}/g,
100558
100656
  DATA_URL: /^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*)\s*$/i,
100559
100657
  ISO_DATE_FORMAT: /(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(\.\d+)?([+-]\d{2}:?\d{2}|Z)$/
@@ -100776,9 +100874,6 @@ const isVideoFile = (fileName) => {
100776
100874
  const isValidWebURL = (url) => {
100777
100875
  return (REGEX.VALID_WEB_URL).test(url);
100778
100876
  };
100779
- const isValidImageUrl = (url) => {
100780
- return (REGEX.VALID_IMAGE_URL).test(url?.trim());
100781
- };
100782
100877
  /*This function returns the url to the resource after checking the validity of url*/
100783
100878
  const getResourceURL = (urlString) => {
100784
100879
  return urlString;
@@ -102032,7 +102127,6 @@ var Utils = /*#__PURE__*/Object.freeze({
102032
102127
  isPageable: isPageable,
102033
102128
  isSafari: isSafari,
102034
102129
  isTablet: isTablet,
102035
- isValidImageUrl: isValidImageUrl,
102036
102130
  isValidWebURL: isValidWebURL,
102037
102131
  isVideoFile: isVideoFile,
102038
102132
  loadScript: loadScript,
@@ -102126,10 +102220,7 @@ class EventNotifier {
102126
102220
  return noop;
102127
102221
  }
102128
102222
  destroy() {
102129
- this._subject.next(null); // optional
102130
- this._subject.complete(); // clears all observers
102131
- this._isInitialized = false;
102132
- this._eventsBeforeInit = [];
102223
+ this._subject.complete();
102133
102224
  }
102134
102225
  }
102135
102226
  let MINIMUM_TAB_WIDTH = 768;
@@ -102144,11 +102235,9 @@ class Viewport {
102144
102235
  this.isTabletType = false;
102145
102236
  this._eventNotifier = new EventNotifier(true);
102146
102237
  this.setScreenType();
102147
- // MEMORY LEAK FIX: Store bound function reference for proper removal
102148
- this.boundResizeFn = this.resizeFn.bind(this);
102149
- window.addEventListener("resize" /* ViewportEvent.RESIZE */, this.boundResizeFn);
102150
- this.mediaQuery = window.matchMedia('(orientation: portrait)');
102151
- if (this.mediaQuery.matches) {
102238
+ window.addEventListener("resize" /* ViewportEvent.RESIZE */, this.resizeFn.bind(this));
102239
+ const query = window.matchMedia('(orientation: portrait)');
102240
+ if (query.matches) {
102152
102241
  this.orientation.isPortrait = true;
102153
102242
  }
102154
102243
  else {
@@ -102156,10 +102245,8 @@ class Viewport {
102156
102245
  }
102157
102246
  // Add a media query change listener
102158
102247
  // addEventListener is not supported ios browser
102159
- if (this.mediaQuery.addEventListener) {
102160
- // MEMORY LEAK FIX: Store bound function reference for proper removal
102161
- this.boundOrientationChange = ($event) => this.orientationChange($event, !$event.matches);
102162
- this.mediaQuery.addEventListener('change', this.boundOrientationChange);
102248
+ if (query.addEventListener) {
102249
+ query.addEventListener('change', $event => this.orientationChange($event, !$event.matches));
102163
102250
  }
102164
102251
  }
102165
102252
  update(selectedViewPort) {
@@ -102186,14 +102273,14 @@ class Viewport {
102186
102273
  return this._eventNotifier.subscribe(eventName, callback);
102187
102274
  }
102188
102275
  notify(eventName, ...data) {
102189
- this._eventNotifier.notify(eventName, ...data);
102276
+ this._eventNotifier.notify.apply(this._eventNotifier, arguments);
102190
102277
  }
102191
102278
  setScreenType() {
102192
102279
  const $el = document.querySelector('.wm-app');
102193
102280
  this.screenWidth = $el.clientWidth;
102194
102281
  this.screenHeight = $el.clientHeight;
102195
- // const minValue = this.screenWidth < this.screenHeight ? this.screenWidth : this.screenHeight;
102196
- // const maxValue = this.screenWidth > this.screenHeight ? this.screenWidth : this.screenHeight;
102282
+ this.screenWidth < this.screenHeight ? this.screenWidth : this.screenHeight;
102283
+ this.screenWidth > this.screenHeight ? this.screenWidth : this.screenHeight;
102197
102284
  this.isTabletType = false;
102198
102285
  this.isMobileType = false;
102199
102286
  if (get$1(this.selectedViewPort, 'deviceCategory')) {
@@ -102225,17 +102312,7 @@ class Viewport {
102225
102312
  }
102226
102313
  ngOnDestroy() {
102227
102314
  this._eventNotifier.destroy();
102228
- // MEMORY LEAK FIX: Remove resize event listener using stored bound function reference
102229
- if (this.boundResizeFn) {
102230
- window.removeEventListener('resize', this.boundResizeFn);
102231
- this.boundResizeFn = null;
102232
- }
102233
- // MEMORY LEAK FIX: Remove media query orientation change listener
102234
- if (this.mediaQuery && this.boundOrientationChange && this.mediaQuery.removeEventListener) {
102235
- this.mediaQuery.removeEventListener('change', this.boundOrientationChange);
102236
- this.boundOrientationChange = null;
102237
- }
102238
- this.mediaQuery = null;
102315
+ window.removeEventListener('resize', this.resizeFn);
102239
102316
  }
102240
102317
  static { this.ɵfac = ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: Viewport, deps: [], target: FactoryTarget.Injectable }); }
102241
102318
  static { this.ɵprov = ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: Viewport, providedIn: 'root' }); }