@gemx-dev/clarity-visualize 0.8.52 → 0.8.53

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.
@@ -384,6 +384,247 @@ var EnrichHelper = /** @class */ (function () {
384
384
  return EnrichHelper;
385
385
  }());
386
386
 
387
+ /**
388
+ * Creates a canvas as sibling to the iframe (same parent container)
389
+ * This allows the canvas to avoid z-index conflicts with top-layer elements inside iframe
390
+ *
391
+ * @param iframeDoc - Document inside the iframe
392
+ * @param canvasId - ID for the canvas element
393
+ * @returns Canvas info with cleanup function
394
+ */
395
+ function createParentWindowCanvas(iframeDoc) {
396
+ var _a, _b;
397
+ // Check if we're inside an iframe
398
+ if (iframeDoc.defaultView === ((_a = iframeDoc.defaultView) === null || _a === void 0 ? void 0 : _a.top)) {
399
+ throw new Error('Not in iframe: ' + iframeDoc.defaultView);
400
+ }
401
+ try {
402
+ var parentWindow = (_b = iframeDoc.defaultView) === null || _b === void 0 ? void 0 : _b.parent;
403
+ var parentDoc = parentWindow === null || parentWindow === void 0 ? void 0 : parentWindow.document;
404
+ if (!parentDoc)
405
+ throw new Error('Parent document not found');
406
+ var iframe = parentDoc.getElementById('clarity-iframe');
407
+ if (!iframe)
408
+ throw new Error('Iframe not found');
409
+ var targetIframe = iframe;
410
+ var iframeParent = targetIframe.parentElement;
411
+ if (!iframeParent)
412
+ throw new Error('Iframe parent not found');
413
+ // Create canvas as sibling to iframe
414
+ var canvas_1 = parentDoc.getElementById("clarity-heatmap-canvas" /* Constant.HeatmapCanvas */);
415
+ if (canvas_1 === null) {
416
+ canvas_1 = parentDoc.createElement('canvas');
417
+ canvas_1.id = "clarity-heatmap-canvas" /* Constant.HeatmapCanvas */;
418
+ canvas_1.width = 0;
419
+ canvas_1.height = 0;
420
+ canvas_1.style.position = "absolute" /* Constant.Absolute */;
421
+ canvas_1.style.zIndex = "".concat(2147483647 /* Setting.ZIndex */);
422
+ canvas_1.style.pointerEvents = 'none'; // Allow clicks to pass through
423
+ iframeParent.appendChild(canvas_1);
424
+ }
425
+ // // Set canvas size to match iframe
426
+ // const updateCanvasSize = () => {
427
+ // canvas.width = targetIframe!.offsetWidth;
428
+ // canvas.height = targetIframe!.offsetHeight;
429
+ // };
430
+ // updateCanvasSize();
431
+ // Insert canvas as sibling to iframe (in same parent container)
432
+ // iframeParent.appendChild(canvas);
433
+ // Update size on resize
434
+ // const handleUpdate = () => updateCanvasSize();
435
+ // parentWindow!.addEventListener('resize', handleUpdate, true);
436
+ var cleanup = function () {
437
+ // parentWindow!.removeEventListener('resize', handleUpdate, true);
438
+ if (canvas_1.parentNode) {
439
+ canvas_1.parentNode.removeChild(canvas_1);
440
+ }
441
+ };
442
+ return {
443
+ canvas: canvas_1,
444
+ iframe: targetIframe,
445
+ cleanup: cleanup
446
+ };
447
+ }
448
+ catch (e) {
449
+ throw new Error(e);
450
+ }
451
+ }
452
+
453
+ /**
454
+ * Custom module for rendering HTML Dialog elements
455
+ * Handles proper visualization of modal dialogs in the top-layer
456
+ */
457
+ /**
458
+ * Pending dialogs tracking for synchronization
459
+ * Used to track when all dialogs have finished rendering
460
+ * Uses Set to avoid counting the same dialog multiple times
461
+ */
462
+ var pendingDialogs = new Set();
463
+ var resolveDialogsRendered = null;
464
+ var dialogsRenderedPromise = null;
465
+ /**
466
+ * Returns a promise that resolves when all pending dialogs are rendered
467
+ */
468
+ function waitForDialogsRendered() {
469
+ if (pendingDialogs.size === 0) {
470
+ // No pending dialogs, resolve immediately
471
+ return Promise.resolve();
472
+ }
473
+ // Return existing promise if already waiting
474
+ if (dialogsRenderedPromise) {
475
+ return dialogsRenderedPromise;
476
+ }
477
+ // Create new promise
478
+ dialogsRenderedPromise = new Promise(function (resolve) {
479
+ resolveDialogsRendered = resolve;
480
+ });
481
+ return dialogsRenderedPromise;
482
+ }
483
+ /**
484
+ * Resets the dialog rendering state
485
+ * Should be called before starting a new render cycle
486
+ */
487
+ function resetDialogRenderState() {
488
+ pendingDialogs.clear();
489
+ resolveDialogsRendered = null;
490
+ dialogsRenderedPromise = null;
491
+ }
492
+ /**
493
+ * Extracts dialog rendering options from node attributes
494
+ *
495
+ * @param attributes - Node attributes containing dialog state
496
+ * @param dialogElement - The dialog element being rendered
497
+ * @returns Dialog render options
498
+ */
499
+ function getDialogRenderOptions(attributes, dialogElement) {
500
+ return {
501
+ isModal: attributes["gx-dialog-modal" /* LayoutConstants.GXDialogModal */] === "true",
502
+ shouldBeOpen: attributes["open"] !== undefined,
503
+ isExistingDialog: !!dialogElement
504
+ };
505
+ }
506
+ /**
507
+ * Shows a dialog element with proper modal/non-modal handling
508
+ * Modal dialogs are shown via showModal() to render in top-layer with backdrop
509
+ * Non-modal dialogs are shown via show() method
510
+ *
511
+ * @param dialogElement - The dialog element to show
512
+ * @param isModal - Whether this is a modal dialog
513
+ * @param onError - Optional error callback
514
+ */
515
+ function showDialog(dialogElement, isModal, onError) {
516
+ try {
517
+ if (!dialogElement.isConnected) {
518
+ notifyDialogComplete(dialogElement);
519
+ return;
520
+ }
521
+ if (!dialogElement.open) {
522
+ notifyDialogComplete(dialogElement);
523
+ return;
524
+ }
525
+ dialogElement.close();
526
+ if (isModal) {
527
+ dialogElement.showModal();
528
+ }
529
+ else {
530
+ dialogElement.show();
531
+ }
532
+ // Wait for animations/transitions to complete
533
+ waitForDialogAnimation(dialogElement).then(function () {
534
+ notifyDialogComplete(dialogElement);
535
+ });
536
+ }
537
+ catch (e) {
538
+ console.error('❌ Error showing dialog:', e);
539
+ if (onError) {
540
+ onError(e);
541
+ }
542
+ // Still mark as complete even on error
543
+ notifyDialogComplete(dialogElement);
544
+ }
545
+ }
546
+ /**
547
+ * Waits for dialog animations/transitions to complete
548
+ * Listens for animationend and transitionend events with timeout fallback
549
+ */
550
+ function waitForDialogAnimation(dialogElement) {
551
+ return new Promise(function (resolve) {
552
+ var resolved = false;
553
+ var timeoutMs = 1000; // Maximum wait time for animations
554
+ var complete = function () {
555
+ if (resolved)
556
+ return;
557
+ resolved = true;
558
+ cleanup();
559
+ resolve();
560
+ };
561
+ // Fallback timeout in case no animation events fire
562
+ var timeout = setTimeout(complete, timeoutMs);
563
+ // Listen for animation end
564
+ var onAnimationEnd = function (e) {
565
+ if (e.target === dialogElement) {
566
+ complete();
567
+ }
568
+ };
569
+ // Listen for transition end
570
+ var onTransitionEnd = function (TransitionEvent) {
571
+ if (TransitionEvent.target === dialogElement) {
572
+ complete();
573
+ }
574
+ };
575
+ var cleanup = function () {
576
+ clearTimeout(timeout);
577
+ dialogElement.removeEventListener('animationend', onAnimationEnd);
578
+ dialogElement.removeEventListener('transitionend', onTransitionEnd);
579
+ };
580
+ dialogElement.addEventListener('animationend', onAnimationEnd, { once: true });
581
+ dialogElement.addEventListener('transitionend', onTransitionEnd, { once: true });
582
+ // If no animations/transitions, resolve after one frame
583
+ requestAnimationFrame(function () {
584
+ var computedStyle = window.getComputedStyle(dialogElement);
585
+ var hasAnimation = computedStyle.animationName !== 'none';
586
+ var hasTransition = computedStyle.transitionDuration !== '0s';
587
+ if (!hasAnimation && !hasTransition) {
588
+ complete();
589
+ }
590
+ });
591
+ });
592
+ }
593
+ /**
594
+ * Internal: Notify that a dialog has completed rendering
595
+ */
596
+ function notifyDialogComplete(dialogElement) {
597
+ pendingDialogs.delete(dialogElement);
598
+ // If all dialogs are done, resolve the promise
599
+ if (pendingDialogs.size === 0 && resolveDialogsRendered) {
600
+ resolveDialogsRendered();
601
+ resolveDialogsRendered = null;
602
+ dialogsRenderedPromise = null;
603
+ }
604
+ }
605
+ /**
606
+ * Handles dialog rendering based on its state
607
+ * This is the main entry point for dialog rendering logic
608
+ *
609
+ * @param dialogElement - The dialog element to render
610
+ * @param options - Dialog render options
611
+ * @param onError - Optional error callback
612
+ */
613
+ function renderDialog(dialogElement, options, onError) {
614
+ var isModal = options.isModal, shouldBeOpen = options.shouldBeOpen, isExistingDialog = options.isExistingDialog;
615
+ if (!shouldBeOpen)
616
+ return;
617
+ // Add dialog to pending set (Set automatically handles duplicates)
618
+ pendingDialogs.add(dialogElement);
619
+ var doShow = function () { return showDialog(dialogElement, isModal, onError); };
620
+ if (isExistingDialog) {
621
+ doShow();
622
+ }
623
+ else {
624
+ setTimeout(doShow, 0);
625
+ }
626
+ }
627
+
387
628
  var HeatmapHelper = /** @class */ (function () {
388
629
  function HeatmapHelper(state, layout) {
389
630
  var _this = this;
@@ -398,6 +639,7 @@ var HeatmapHelper = /** @class */ (function () {
398
639
  this.layout = null;
399
640
  this.scrollAvgFold = null;
400
641
  this.addScrollMakers = false;
642
+ this.parentCanvasInfo = null;
401
643
  this.reset = function () {
402
644
  _this.data = null;
403
645
  _this.scrollData = null;
@@ -405,6 +647,11 @@ var HeatmapHelper = /** @class */ (function () {
405
647
  _this.offscreenRing = null;
406
648
  _this.gradientPixels = null;
407
649
  _this.timeout = null;
650
+ // Cleanup parent canvas if it exists
651
+ if (_this.parentCanvasInfo) {
652
+ _this.parentCanvasInfo.cleanup();
653
+ _this.parentCanvasInfo = null;
654
+ }
408
655
  // Reset resize observer
409
656
  if (_this.observer) {
410
657
  _this.observer.disconnect();
@@ -429,41 +676,55 @@ var HeatmapHelper = /** @class */ (function () {
429
676
  canvas.style.top = win.pageYOffset + "px" /* Constant.Pixel */;
430
677
  canvas.getContext("2d" /* Constant.Context */).clearRect(0, 0, canvas.width, canvas.height);
431
678
  }
679
+ // Cleanup parent canvas before reset
680
+ if (_this.parentCanvasInfo) {
681
+ _this.parentCanvasInfo.cleanup();
682
+ _this.parentCanvasInfo = null;
683
+ }
432
684
  _this.reset();
433
685
  };
434
- this.scroll = function (activity, avgFold, addMarkers) {
435
- _this.scrollData = _this.scrollData || activity;
436
- _this.scrollAvgFold = avgFold != null ? avgFold : _this.scrollAvgFold;
437
- _this.addScrollMakers = addMarkers != null ? addMarkers : _this.addScrollMakers;
438
- var canvas = _this.overlay();
439
- var context = canvas.getContext("2d" /* Constant.Context */);
440
- var doc = _this.state.window.document;
441
- var body = doc.body;
442
- var de = doc.documentElement;
443
- var height = Math.max(body.scrollHeight, body.offsetHeight, de.clientHeight, de.scrollHeight, de.offsetHeight);
444
- canvas.height = Math.min(height, 65535 /* Setting.ScrollCanvasMaxHeight */);
445
- canvas.style.top = 0 + "px" /* Constant.Pixel */;
446
- if (canvas.width > 0 && canvas.height > 0) {
447
- if (_this.scrollData) {
448
- var grd = context.createLinearGradient(0, 0, 0, canvas.height);
449
- for (var _i = 0, _a = _this.scrollData; _i < _a.length; _i++) {
450
- var currentCombination = _a[_i];
451
- var huePercentView = 1 - (currentCombination.cumulativeSum / _this.scrollData[0].cumulativeSum);
452
- var percentView = (currentCombination.scrollReachY / 100) * (height / canvas.height);
453
- var hue = huePercentView * 240 /* Setting.MaxHue */;
454
- if (percentView <= 1) {
455
- grd.addColorStop(percentView, "hsla(".concat(hue, ", 100%, 50%, 0.6)"));
686
+ this.scroll = function (activity, avgFold, addMarkers) { return __awaiter(_this, void 0, void 0, function () {
687
+ var canvas, context, doc, body, de, height, grd, _i, _a, currentCombination, huePercentView, percentView, hue;
688
+ return __generator(this, function (_b) {
689
+ switch (_b.label) {
690
+ case 0: return [4 /*yield*/, this.waitForDialogs()];
691
+ case 1:
692
+ _b.sent();
693
+ this.scrollData = this.scrollData || activity;
694
+ this.scrollAvgFold = avgFold != null ? avgFold : this.scrollAvgFold;
695
+ this.addScrollMakers = addMarkers != null ? addMarkers : this.addScrollMakers;
696
+ canvas = this.overlay();
697
+ context = canvas.getContext("2d" /* Constant.Context */);
698
+ doc = this.state.window.document;
699
+ body = doc.body;
700
+ de = doc.documentElement;
701
+ height = Math.max(body.scrollHeight, body.offsetHeight, de.clientHeight, de.scrollHeight, de.offsetHeight);
702
+ canvas.height = Math.min(height, 65535 /* Setting.ScrollCanvasMaxHeight */);
703
+ canvas.style.top = 0 + "px" /* Constant.Pixel */;
704
+ if (canvas.width > 0 && canvas.height > 0) {
705
+ if (this.scrollData) {
706
+ grd = context.createLinearGradient(0, 0, 0, canvas.height);
707
+ for (_i = 0, _a = this.scrollData; _i < _a.length; _i++) {
708
+ currentCombination = _a[_i];
709
+ huePercentView = 1 - (currentCombination.cumulativeSum / this.scrollData[0].cumulativeSum);
710
+ percentView = (currentCombination.scrollReachY / 100) * (height / canvas.height);
711
+ hue = huePercentView * 240 /* Setting.MaxHue */;
712
+ if (percentView <= 1) {
713
+ grd.addColorStop(percentView, "hsla(".concat(hue, ", 100%, 50%, 0.6)"));
714
+ }
715
+ }
716
+ // Fill with gradient
717
+ context.fillStyle = grd;
718
+ context.fillRect(0, 0, canvas.width, canvas.height);
719
+ if (this.addScrollMakers) {
720
+ this.addInfoMarkers(context, this.scrollData, canvas.width, canvas.height, this.scrollAvgFold);
721
+ }
722
+ }
456
723
  }
457
- }
458
- // Fill with gradient
459
- context.fillStyle = grd;
460
- context.fillRect(0, 0, canvas.width, canvas.height);
461
- if (_this.addScrollMakers) {
462
- _this.addInfoMarkers(context, _this.scrollData, canvas.width, canvas.height, _this.scrollAvgFold);
463
- }
724
+ return [2 /*return*/];
464
725
  }
465
- }
466
- };
726
+ });
727
+ }); };
467
728
  this.addInfoMarkers = function (context, scrollMapInfo, width, height, avgFold) {
468
729
  _this.addMarker(context, width, "Average Fold" /* Constant.AverageFold */, avgFold, 84 /* Setting.MarkerMediumWidth */);
469
730
  var markers = [75, 50, 25];
@@ -495,45 +756,50 @@ var HeatmapHelper = /** @class */ (function () {
495
756
  context.font = "500 12px Segoe UI" /* Setting.CanvasTextFont */;
496
757
  context.fillText(label, 5 /* Setting.MarkerPadding */, markerY + 5 /* Setting.MarkerPadding */);
497
758
  };
498
- this.click = function (activity) {
499
- _this.data = _this.data || activity;
500
- var heat = _this.transform();
501
- var canvas = _this.overlay();
502
- var ctx = canvas.getContext("2d" /* Constant.Context */);
503
- if (canvas.width > 0 && canvas.height > 0) {
504
- // To speed up canvas rendering, we draw ring & gradient on an offscreen canvas, so we can use drawImage API
505
- // Canvas performance tips: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Optimizing_canvas
506
- // Pre-render similar primitives or repeating objects on an offscreen canvas
507
- var ring = _this.getRing();
508
- var gradient = _this.getGradient();
509
- // Render activity for each (x,y) coordinate in our data
510
- for (var _i = 0, heat_1 = heat; _i < heat_1.length; _i++) {
511
- var entry = heat_1[_i];
512
- ctx.globalAlpha = entry.a;
513
- ctx.drawImage(ring, entry.x - 20 /* Setting.Radius */, entry.y - 20 /* Setting.Radius */);
514
- }
515
- // Add color to the canvas based on alpha value of each pixel
516
- var pixels = ctx.getImageData(0, 0, canvas.width, canvas.height);
517
- for (var i = 0; i < pixels.data.length; i += 4) {
518
- // For each pixel, we have 4 entries in data array: (r,g,b,a)
519
- // To pick the right color from gradient pixels, we look at the alpha value of the pixel
520
- // Alpha value ranges from 0-255
521
- var alpha = pixels.data[i + 3];
522
- if (alpha > 0) {
523
- var offset = (alpha - 1) * 4;
524
- pixels.data[i] = gradient.data[offset];
525
- pixels.data[i + 1] = gradient.data[offset + 1];
526
- pixels.data[i + 2] = gradient.data[offset + 2];
527
- }
759
+ this.click = function (activity) { return __awaiter(_this, void 0, void 0, function () {
760
+ var heat, canvas, ctx, ring, gradient, _i, heat_1, entry, pixels, i, alpha, offset;
761
+ return __generator(this, function (_a) {
762
+ switch (_a.label) {
763
+ case 0: return [4 /*yield*/, this.waitForDialogs()];
764
+ case 1:
765
+ _a.sent();
766
+ this.data = this.data || activity;
767
+ heat = this.transform();
768
+ canvas = this.overlay();
769
+ ctx = canvas.getContext("2d" /* Constant.Context */);
770
+ if (canvas.width > 0 && canvas.height > 0) {
771
+ ring = this.getRing();
772
+ gradient = this.getGradient();
773
+ // Render activity for each (x,y) coordinate in our data
774
+ for (_i = 0, heat_1 = heat; _i < heat_1.length; _i++) {
775
+ entry = heat_1[_i];
776
+ ctx.globalAlpha = entry.a;
777
+ ctx.drawImage(ring, entry.x - 20 /* Setting.Radius */, entry.y - 20 /* Setting.Radius */);
778
+ }
779
+ pixels = ctx.getImageData(0, 0, canvas.width, canvas.height);
780
+ for (i = 0; i < pixels.data.length; i += 4) {
781
+ alpha = pixels.data[i + 3];
782
+ if (alpha > 0) {
783
+ offset = (alpha - 1) * 4;
784
+ pixels.data[i] = gradient.data[offset];
785
+ pixels.data[i + 1] = gradient.data[offset + 1];
786
+ pixels.data[i + 2] = gradient.data[offset + 2];
787
+ }
788
+ }
789
+ ctx.putImageData(pixels, 0, 0);
790
+ }
791
+ return [2 /*return*/];
528
792
  }
529
- ctx.putImageData(pixels, 0, 0);
530
- }
531
- };
793
+ });
794
+ }); };
532
795
  this.overlay = function () {
533
796
  // Create canvas for visualizing heatmap
534
797
  var doc = _this.state.window.document;
535
798
  var win = _this.state.window;
536
799
  var de = doc.documentElement;
800
+ var isPortalCanvas = _this.state.options.portalCanvas;
801
+ if (isPortalCanvas)
802
+ return _this.createPortalCanvas(doc, win, de);
537
803
  var canvas = doc.getElementById("clarity-heatmap-canvas" /* Constant.HeatmapCanvas */);
538
804
  if (canvas === null) {
539
805
  canvas = doc.createElement("CANVAS" /* Constant.Canvas */);
@@ -667,6 +933,95 @@ var HeatmapHelper = /** @class */ (function () {
667
933
  }
668
934
  return visibility && r.bottom >= 0 && r.top <= height;
669
935
  };
936
+ this.waitForDialogs = function () { return __awaiter(_this, void 0, void 0, function () {
937
+ var isPortalCanvas;
938
+ return __generator(this, function (_a) {
939
+ switch (_a.label) {
940
+ case 0:
941
+ isPortalCanvas = this.state.options.portalCanvas;
942
+ if (!isPortalCanvas)
943
+ return [2 /*return*/];
944
+ return [4 /*yield*/, waitForDialogsRendered()];
945
+ case 1:
946
+ _a.sent();
947
+ return [2 /*return*/];
948
+ }
949
+ });
950
+ }); };
951
+ this.createPortalCanvas = function (doc, win, de) {
952
+ var _a;
953
+ var canvas = null;
954
+ try {
955
+ canvas = (_a = _this.parentCanvasInfo) === null || _a === void 0 ? void 0 : _a.canvas;
956
+ if (!canvas) {
957
+ _this.parentCanvasInfo = createParentWindowCanvas(doc);
958
+ canvas = _this.parentCanvasInfo.canvas;
959
+ // Add event listeners only once when canvas is created
960
+ win.addEventListener("scroll", _this.redraw, true);
961
+ win.addEventListener("resize", _this.redraw, true);
962
+ _this.observer = _this.state.window["ResizeObserver"] ? new ResizeObserver(_this.redraw) : null;
963
+ if (_this.observer) {
964
+ _this.observer.observe(doc.body);
965
+ }
966
+ }
967
+ canvas.width = de.clientWidth;
968
+ canvas.height = de.clientHeight + 4; // TODO: GEMX VERIFY
969
+ canvas.style.top = '0';
970
+ canvas.style.left = '0';
971
+ canvas.getContext("2d" /* Constant.Context */).clearRect(0, 0, canvas.width, canvas.height);
972
+ _this.parentCanvasInfo.canvas = canvas;
973
+ return canvas;
974
+ }
975
+ catch (error) {
976
+ console.error("\uD83D\uDE80 \uD83D\uDC25 ~ HeatmapHelper ~ createPortalCanvas:", error);
977
+ }
978
+ return null;
979
+ };
980
+ this.visibleV2 = function (el, r, height) {
981
+ var doc = _this.state.window.document;
982
+ var visibility = r.height > height ? true : false;
983
+ if (visibility === false && r.width > 0 && r.height > 0) {
984
+ while (!visibility && doc) {
985
+ var shadowElement = null;
986
+ var elements = doc.elementsFromPoint(r.left + (r.width / 2), r.top + (r.height / 2));
987
+ // Check if only dialog and HTML are returned (element is behind dialog)
988
+ var hasOnlyDialogAndHtml = elements.length === 2 &&
989
+ elements[0].tagName === 'DIALOG' &&
990
+ elements[1].tagName === 'HTML';
991
+ // If element is behind a dialog, assume it's visible
992
+ // (we can't check through top-layer, so trust the element exists)
993
+ if (hasOnlyDialogAndHtml) {
994
+ visibility = true;
995
+ break;
996
+ }
997
+ for (var _i = 0, elements_2 = elements; _i < elements_2.length; _i++) {
998
+ var e = elements_2[_i];
999
+ // Check if this is the target element BEFORE skipping dialogs
1000
+ // This handles case where target element IS a dialog
1001
+ if (e === el) {
1002
+ visibility = true;
1003
+ shadowElement = e.shadowRoot && e.shadowRoot != doc ? e.shadowRoot : null;
1004
+ break;
1005
+ }
1006
+ // Skip dialog elements - treat as transparent for checking elements behind
1007
+ if (e.tagName === 'DIALOG') {
1008
+ continue;
1009
+ }
1010
+ // Skip canvas and clarity elements
1011
+ if (e.tagName === "CANVAS" /* Constant.Canvas */ ||
1012
+ (e.id && e.id.indexOf("clarity-" /* Constant.ClarityPrefix */) === 0)) {
1013
+ continue;
1014
+ }
1015
+ // This is the first non-ignored element
1016
+ visibility = e === el;
1017
+ shadowElement = e.shadowRoot && e.shadowRoot != doc ? e.shadowRoot : null;
1018
+ break;
1019
+ }
1020
+ doc = shadowElement;
1021
+ }
1022
+ }
1023
+ return visibility && r.bottom >= 0 && r.top <= height;
1024
+ };
670
1025
  this.state = state;
671
1026
  this.layout = layout;
672
1027
  }
@@ -1194,101 +1549,6 @@ var sharedStyle = `iframe[data-clarity-unavailable-small], iframe[data-clarity-u
1194
1549
  border-color: #827DFF;
1195
1550
  }`;
1196
1551
 
1197
- /**
1198
- * Custom module for rendering HTML Dialog elements
1199
- * Handles proper visualization of modal dialogs in the top-layer
1200
- */
1201
- /**
1202
- * Extracts dialog rendering options from node attributes
1203
- *
1204
- * @param attributes - Node attributes containing dialog state
1205
- * @param dialogElement - The dialog element being rendered
1206
- * @returns Dialog render options
1207
- */
1208
- function getDialogRenderOptions(attributes, dialogElement) {
1209
- return {
1210
- isModal: attributes["gx-dialog-modal" /* LayoutConstants.GXDialogModal */] === "true",
1211
- shouldBeOpen: attributes["open"] !== undefined,
1212
- isExistingDialog: !!dialogElement
1213
- };
1214
- }
1215
- /**
1216
- * Shows a dialog element with proper modal/non-modal handling
1217
- * Modal dialogs are shown via showModal() to render in top-layer with backdrop
1218
- * Non-modal dialogs are shown via show() method
1219
- *
1220
- * @param dialogElement - The dialog element to show
1221
- * @param isModal - Whether this is a modal dialog
1222
- * @param onError - Optional error callback
1223
- */
1224
- function showDialog(dialogElement, isModal, onError) {
1225
- try {
1226
- if (!dialogElement.isConnected) {
1227
- console.warn('⚠️ Dialog not connected to DOM, skipping show');
1228
- return;
1229
- }
1230
- // IMPORTANT: If dialog is already open (from HTML attribute),
1231
- // we need to close and reopen to ensure showModal() is called
1232
- // and dialog enters top-layer properly
1233
- if (dialogElement.open) {
1234
- dialogElement.close();
1235
- }
1236
- if (isModal) {
1237
- dialogElement.showModal();
1238
- }
1239
- else {
1240
- dialogElement.show();
1241
- }
1242
- }
1243
- catch (e) {
1244
- console.error('❌ Error showing dialog:', e);
1245
- if (onError) {
1246
- onError(e);
1247
- }
1248
- }
1249
- }
1250
- /**
1251
- * Closes a dialog element safely
1252
- *
1253
- * @param dialogElement - The dialog element to close
1254
- */
1255
- function closeDialog(dialogElement) {
1256
- try {
1257
- if (dialogElement.open) {
1258
- dialogElement.close();
1259
- }
1260
- }
1261
- catch (e) {
1262
- console.warn('⚠️ Error closing dialog:', e);
1263
- }
1264
- }
1265
- /**
1266
- * Handles dialog rendering based on its state
1267
- * This is the main entry point for dialog rendering logic
1268
- *
1269
- * @param dialogElement - The dialog element to render
1270
- * @param options - Dialog render options
1271
- * @param onError - Optional error callback
1272
- */
1273
- function renderDialog(dialogElement, options, onError) {
1274
- var isModal = options.isModal, shouldBeOpen = options.shouldBeOpen, isExistingDialog = options.isExistingDialog;
1275
- if (shouldBeOpen) {
1276
- var doShow = function () { return showDialog(dialogElement, isModal, onError); };
1277
- if (isExistingDialog) {
1278
- // Dialog already exists, call immediately
1279
- doShow();
1280
- }
1281
- else {
1282
- // New dialog, wait for DOM insertion
1283
- setTimeout(doShow, 0);
1284
- }
1285
- }
1286
- else if (dialogElement.open) {
1287
- // Dialog should be closed
1288
- closeDialog(dialogElement);
1289
- }
1290
- }
1291
-
1292
1552
  var blobUnavailableSvgEnglish = `background: url("data:image/svg+xml,%3Csvg width='100%25' viewBox='0 0 100 80' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='100' height='80' fill='%23FBFBFE'/%3E%3Cpath d='M55.75 11C57.5449 11 59 12.4551 59 14.25V25.75C59 27.5449 57.5449 29 55.75 29H44.25C42.4551 29 41 27.5449 41 25.75V14.25C41 12.4551 42.4551 11 44.25 11H55.75ZM56.3305 27.4014L50.5247 21.7148C50.2596 21.4553 49.8501 21.4316 49.5588 21.644L49.4752 21.7148L43.6685 27.4011C43.8504 27.4651 44.0461 27.5 44.25 27.5H55.75C55.9535 27.5 56.1489 27.4653 56.3305 27.4014L50.5247 21.7148L56.3305 27.4014ZM55.75 12.5H44.25C43.2835 12.5 42.5 13.2835 42.5 14.25V25.75C42.5 25.9584 42.5364 26.1583 42.6033 26.3437L48.4258 20.643C49.2589 19.8273 50.5675 19.7885 51.4458 20.5266L51.5742 20.6431L57.3964 26.3447C57.4634 26.159 57.5 25.9588 57.5 25.75V14.25C57.5 13.2835 56.7165 12.5 55.75 12.5ZM53.2521 14.5C54.4959 14.5 55.5042 15.5083 55.5042 16.7521C55.5042 17.9959 54.4959 19.0042 53.2521 19.0042C52.0083 19.0042 51 17.9959 51 16.7521C51 15.5083 52.0083 14.5 53.2521 14.5ZM53.2521 16C52.8367 16 52.5 16.3367 52.5 16.7521C52.5 17.1675 52.8367 17.5042 53.2521 17.5042C53.6675 17.5042 54.0042 17.1675 54.0042 16.7521C54.0042 16.3367 53.6675 16 53.2521 16Z' fill='%23020057'/%3E%3Cpath d='M25.8418 52.6484C25.2207 52.9766 24.4473 53.1406 23.5215 53.1406C22.3262 53.1406 21.3691 52.7559 20.6504 51.9863C19.9316 51.2168 19.5723 50.207 19.5723 48.957C19.5723 47.6133 19.9766 46.5273 20.7852 45.6992C21.5938 44.8711 22.6191 44.457 23.8613 44.457C24.6582 44.457 25.3184 44.5723 25.8418 44.8027V45.8516C25.2402 45.5156 24.5762 45.3477 23.8496 45.3477C22.8848 45.3477 22.1016 45.6699 21.5 46.3145C20.9023 46.959 20.6035 47.8203 20.6035 48.8984C20.6035 49.9219 20.8828 50.7383 21.4414 51.3477C22.0039 51.9531 22.7402 52.2559 23.6504 52.2559C24.4941 52.2559 25.2246 52.0684 25.8418 51.6934V52.6484ZM28.3848 53H27.4238V44.1172H28.3848V53ZM34.625 53H33.6641V52.0625H33.6406C33.2227 52.7812 32.6074 53.1406 31.7949 53.1406C31.1973 53.1406 30.7285 52.9824 30.3887 52.666C30.0527 52.3496 29.8848 51.9297 29.8848 51.4062C29.8848 50.2852 30.5449 49.6328 31.8652 49.4492L33.6641 49.1973C33.6641 48.1777 33.252 47.668 32.4277 47.668C31.7051 47.668 31.0527 47.9141 30.4707 48.4062V47.4219C31.0605 47.0469 31.7402 46.8594 32.5098 46.8594C33.9199 46.8594 34.625 47.6055 34.625 49.0977V53ZM33.6641 49.9648L32.2168 50.1641C31.7715 50.2266 31.4355 50.3379 31.209 50.498C30.9824 50.6543 30.8691 50.9336 30.8691 51.3359C30.8691 51.6289 30.9727 51.8691 31.1797 52.0566C31.3906 52.2402 31.6699 52.332 32.0176 52.332C32.4941 52.332 32.8867 52.166 33.1953 51.834C33.5078 51.498 33.6641 51.0742 33.6641 50.5625V49.9648ZM39.5645 47.9727C39.3965 47.8438 39.1543 47.7793 38.8379 47.7793C38.4277 47.7793 38.084 47.9727 37.8066 48.3594C37.5332 48.7461 37.3965 49.2734 37.3965 49.9414V53H36.4355V47H37.3965V48.2363H37.4199C37.5566 47.8145 37.7656 47.4863 38.0469 47.252C38.3281 47.0137 38.6426 46.8945 38.9902 46.8945C39.2402 46.8945 39.4316 46.9219 39.5645 46.9766V47.9727ZM41.0996 45.4766C40.9277 45.4766 40.7812 45.418 40.6602 45.3008C40.5391 45.1836 40.4785 45.0352 40.4785 44.8555C40.4785 44.6758 40.5391 44.5273 40.6602 44.4102C40.7812 44.2891 40.9277 44.2285 41.0996 44.2285C41.2754 44.2285 41.4238 44.2891 41.5449 44.4102C41.6699 44.5273 41.7324 44.6758 41.7324 44.8555C41.7324 45.0273 41.6699 45.1738 41.5449 45.2949C41.4238 45.416 41.2754 45.4766 41.0996 45.4766ZM41.5684 53H40.6074V47H41.5684V53ZM46.2969 52.9414C46.0703 53.0664 45.7715 53.1289 45.4004 53.1289C44.3496 53.1289 43.8242 52.543 43.8242 51.3711V47.8203H42.793V47H43.8242V45.5352L44.7852 45.2246V47H46.2969V47.8203H44.7852V51.2012C44.7852 51.6035 44.8535 51.8906 44.9902 52.0625C45.127 52.2344 45.3535 52.3203 45.6699 52.3203C45.9121 52.3203 46.1211 52.2539 46.2969 52.1211V52.9414ZM52.3555 47L49.5957 53.9609C49.1035 55.2031 48.4121 55.8242 47.5215 55.8242C47.2715 55.8242 47.0625 55.7988 46.8945 55.748V54.8867C47.1016 54.957 47.291 54.9922 47.4629 54.9922C47.9473 54.9922 48.3105 54.7031 48.5527 54.125L49.0332 52.9883L46.6895 47H47.7559L49.3789 51.6172C49.3984 51.6758 49.4395 51.8281 49.502 52.0742H49.5371C49.5566 51.9805 49.5957 51.832 49.6543 51.6289L51.3594 47H52.3555ZM60.7754 52.7246C60.3145 53.002 59.7676 53.1406 59.1348 53.1406C58.2793 53.1406 57.5879 52.8633 57.0605 52.3086C56.5371 51.75 56.2754 51.0273 56.2754 50.1406C56.2754 49.1523 56.5586 48.3594 57.125 47.7617C57.6914 47.1602 58.4473 46.8594 59.3926 46.8594C59.9199 46.8594 60.3848 46.957 60.7871 47.1523V48.1367C60.3418 47.8242 59.8652 47.668 59.3574 47.668C58.7441 47.668 58.2402 47.8887 57.8457 48.3301C57.4551 48.7676 57.2598 49.3438 57.2598 50.0586C57.2598 50.7617 57.4434 51.3164 57.8105 51.7227C58.1816 52.1289 58.6777 52.332 59.2988 52.332C59.8223 52.332 60.3145 52.1582 60.7754 51.8105V52.7246ZM66.5234 53H65.5625V52.0625H65.5391C65.1211 52.7812 64.5059 53.1406 63.6934 53.1406C63.0957 53.1406 62.627 52.9824 62.2871 52.666C61.9512 52.3496 61.7832 51.9297 61.7832 51.4062C61.7832 50.2852 62.4434 49.6328 63.7637 49.4492L65.5625 49.1973C65.5625 48.1777 65.1504 47.668 64.3262 47.668C63.6035 47.668 62.9512 47.9141 62.3691 48.4062V47.4219C62.959 47.0469 63.6387 46.8594 64.4082 46.8594C65.8184 46.8594 66.5234 47.6055 66.5234 49.0977V53ZM65.5625 49.9648L64.1152 50.1641C63.6699 50.2266 63.334 50.3379 63.1074 50.498C62.8809 50.6543 62.7676 50.9336 62.7676 51.3359C62.7676 51.6289 62.8711 51.8691 63.0781 52.0566C63.2891 52.2402 63.5684 52.332 63.916 52.332C64.3926 52.332 64.7852 52.166 65.0938 51.834C65.4062 51.498 65.5625 51.0742 65.5625 50.5625V49.9648ZM73.3145 53H72.3535V49.5781C72.3535 48.3047 71.8887 47.668 70.959 47.668C70.4785 47.668 70.0801 47.8496 69.7637 48.2129C69.4512 48.5723 69.2949 49.0273 69.2949 49.5781V53H68.334V47H69.2949V47.9961H69.3184C69.7715 47.2383 70.4277 46.8594 71.2871 46.8594C71.9434 46.8594 72.4453 47.0723 72.793 47.498C73.1406 47.9199 73.3145 48.5312 73.3145 49.332V53ZM76.3145 44.457L75.4941 47.0703H74.8027L75.4531 44.457H76.3145ZM80.668 52.9414C80.4414 53.0664 80.1426 53.1289 79.7715 53.1289C78.7207 53.1289 78.1953 52.543 78.1953 51.3711V47.8203H77.1641V47H78.1953V45.5352L79.1562 45.2246V47H80.668V47.8203H79.1562V51.2012C79.1562 51.6035 79.2246 51.8906 79.3613 52.0625C79.498 52.2344 79.7246 52.3203 80.041 52.3203C80.2832 52.3203 80.4922 52.2539 80.668 52.1211V52.9414ZM15.3887 63.9727C15.2207 63.8438 14.9785 63.7793 14.6621 63.7793C14.252 63.7793 13.9082 63.9727 13.6309 64.3594C13.3574 64.7461 13.2207 65.2734 13.2207 65.9414V69H12.2598V63H13.2207V64.2363H13.2441C13.3809 63.8145 13.5898 63.4863 13.8711 63.252C14.1523 63.0137 14.4668 62.8945 14.8145 62.8945C15.0645 62.8945 15.2559 62.9219 15.3887 62.9766V63.9727ZM21.2539 66.2402H17.0176C17.0332 66.9082 17.2129 67.4238 17.5566 67.7871C17.9004 68.1504 18.373 68.332 18.9746 68.332C19.6504 68.332 20.2715 68.1094 20.8379 67.6641V68.5664C20.3105 68.9492 19.6133 69.1406 18.7461 69.1406C17.8984 69.1406 17.2324 68.8691 16.748 68.3262C16.2637 67.7793 16.0215 67.0117 16.0215 66.0234C16.0215 65.0898 16.2852 64.3301 16.8125 63.7441C17.3438 63.1543 18.002 62.8594 18.7871 62.8594C19.5723 62.8594 20.1797 63.1133 20.6094 63.6211C21.0391 64.1289 21.2539 64.834 21.2539 65.7363V66.2402ZM20.2695 65.4258C20.2656 64.8711 20.1309 64.4395 19.8652 64.1309C19.6035 63.8223 19.2383 63.668 18.7695 63.668C18.3164 63.668 17.9316 63.8301 17.6152 64.1543C17.2988 64.4785 17.1035 64.9023 17.0293 65.4258H20.2695ZM27.0078 69H26.0469V68.0625H26.0234C25.6055 68.7812 24.9902 69.1406 24.1777 69.1406C23.5801 69.1406 23.1113 68.9824 22.7715 68.666C22.4355 68.3496 22.2676 67.9297 22.2676 67.4062C22.2676 66.2852 22.9277 65.6328 24.248 65.4492L26.0469 65.1973C26.0469 64.1777 25.6348 63.668 24.8105 63.668C24.0879 63.668 23.4355 63.9141 22.8535 64.4062V63.4219C23.4434 63.0469 24.123 62.8594 24.8926 62.8594C26.3027 62.8594 27.0078 63.6055 27.0078 65.0977V69ZM26.0469 65.9648L24.5996 66.1641C24.1543 66.2266 23.8184 66.3379 23.5918 66.498C23.3652 66.6543 23.252 66.9336 23.252 67.3359C23.252 67.6289 23.3555 67.8691 23.5625 68.0566C23.7734 68.2402 24.0527 68.332 24.4004 68.332C24.877 68.332 25.2695 68.166 25.5781 67.834C25.8906 67.498 26.0469 67.0742 26.0469 66.5625V65.9648ZM33.9395 69H32.9785V67.9805H32.9551C32.5098 68.7539 31.8223 69.1406 30.8926 69.1406C30.1387 69.1406 29.5352 68.873 29.082 68.3379C28.6328 67.7988 28.4082 67.0664 28.4082 66.1406C28.4082 65.1484 28.6582 64.3535 29.1582 63.7559C29.6582 63.1582 30.3242 62.8594 31.1562 62.8594C31.9805 62.8594 32.5801 63.1836 32.9551 63.832H32.9785V60.1172H33.9395V69ZM32.9785 66.2871V65.4023C32.9785 64.918 32.8184 64.5078 32.498 64.1719C32.1777 63.8359 31.7715 63.668 31.2793 63.668C30.6934 63.668 30.2324 63.8828 29.8965 64.3125C29.5605 64.7422 29.3926 65.3359 29.3926 66.0938C29.3926 66.7852 29.5527 67.332 29.873 67.7344C30.1973 68.1328 30.6309 68.332 31.1738 68.332C31.709 68.332 32.1426 68.1387 32.4746 67.752C32.8105 67.3652 32.9785 66.877 32.9785 66.2871ZM39.3066 69V60.5977H41.6973C42.4238 60.5977 43 60.7754 43.4258 61.1309C43.8516 61.4863 44.0645 61.9492 44.0645 62.5195C44.0645 62.9961 43.9355 63.4102 43.6777 63.7617C43.4199 64.1133 43.0645 64.3633 42.6113 64.5117V64.5352C43.1777 64.6016 43.6309 64.8164 43.9707 65.1797C44.3105 65.5391 44.4805 66.0078 44.4805 66.5859C44.4805 67.3047 44.2227 67.8867 43.707 68.332C43.1914 68.7773 42.541 69 41.7559 69H39.3066ZM40.291 61.4883V64.2012H41.2988C41.8379 64.2012 42.2617 64.0723 42.5703 63.8145C42.8789 63.5527 43.0332 63.1855 43.0332 62.7129C43.0332 61.8965 42.4961 61.4883 41.4219 61.4883H40.291ZM40.291 65.0859V68.1094H41.627C42.2051 68.1094 42.6523 67.9727 42.9688 67.6992C43.2891 67.4258 43.4492 67.0508 43.4492 66.5742C43.4492 65.582 42.7734 65.0859 41.4219 65.0859H40.291ZM47.0176 69H46.0566V60.1172H47.0176V69ZM51.4707 69.1406C50.584 69.1406 49.875 68.8613 49.3438 68.3027C48.8164 67.7402 48.5527 66.9961 48.5527 66.0703C48.5527 65.0625 48.8281 64.2754 49.3789 63.709C49.9297 63.1426 50.6738 62.8594 51.6113 62.8594C52.5059 62.8594 53.2031 63.1348 53.7031 63.6855C54.207 64.2363 54.459 65 54.459 65.9766C54.459 66.9336 54.1875 67.7012 53.6445 68.2793C53.1055 68.8535 52.3809 69.1406 51.4707 69.1406ZM51.541 63.668C50.9238 63.668 50.4355 63.8789 50.0762 64.3008C49.7168 64.7188 49.5371 65.2969 49.5371 66.0352C49.5371 66.7461 49.7188 67.3066 50.082 67.7168C50.4453 68.127 50.9316 68.332 51.541 68.332C52.1621 68.332 52.6387 68.1309 52.9707 67.7285C53.3066 67.3262 53.4746 66.7539 53.4746 66.0117C53.4746 65.2617 53.3066 64.6836 52.9707 64.2773C52.6387 63.8711 52.1621 63.668 51.541 63.668ZM56.9785 68.1328H56.9551V69H55.9941V60.1172H56.9551V64.0547H56.9785C57.4512 63.2578 58.1426 62.8594 59.0527 62.8594C59.8223 62.8594 60.4238 63.1289 60.8574 63.668C61.2949 64.2031 61.5137 64.9219 61.5137 65.8242C61.5137 66.8281 61.2695 67.6328 60.7812 68.2383C60.293 68.8398 59.625 69.1406 58.7773 69.1406C57.9844 69.1406 57.3848 68.8047 56.9785 68.1328ZM56.9551 65.7129V66.5508C56.9551 67.0469 57.1152 67.4688 57.4355 67.8164C57.7598 68.1602 58.1699 68.332 58.666 68.332C59.248 68.332 59.7031 68.1094 60.0312 67.6641C60.3633 67.2188 60.5293 66.5996 60.5293 65.8066C60.5293 65.1387 60.375 64.6152 60.0664 64.2363C59.7578 63.8574 59.3398 63.668 58.8125 63.668C58.2539 63.668 57.8047 63.8633 57.4648 64.2539C57.125 64.6406 56.9551 65.127 56.9551 65.7129ZM71.4629 69H70.502V67.9805H70.4785C70.0332 68.7539 69.3457 69.1406 68.416 69.1406C67.6621 69.1406 67.0586 68.873 66.6055 68.3379C66.1562 67.7988 65.9316 67.0664 65.9316 66.1406C65.9316 65.1484 66.1816 64.3535 66.6816 63.7559C67.1816 63.1582 67.8477 62.8594 68.6797 62.8594C69.5039 62.8594 70.1035 63.1836 70.4785 63.832H70.502V60.1172H71.4629V69ZM70.502 66.2871V65.4023C70.502 64.918 70.3418 64.5078 70.0215 64.1719C69.7012 63.8359 69.2949 63.668 68.8027 63.668C68.2168 63.668 67.7559 63.8828 67.4199 64.3125C67.084 64.7422 66.916 65.3359 66.916 66.0938C66.916 66.7852 67.0762 67.332 67.3965 67.7344C67.7207 68.1328 68.1543 68.332 68.6973 68.332C69.2324 68.332 69.666 68.1387 69.998 67.752C70.334 67.3652 70.502 66.877 70.502 66.2871ZM77.7031 69H76.7422V68.0625H76.7188C76.3008 68.7812 75.6855 69.1406 74.873 69.1406C74.2754 69.1406 73.8066 68.9824 73.4668 68.666C73.1309 68.3496 72.9629 67.9297 72.9629 67.4062C72.9629 66.2852 73.623 65.6328 74.9434 65.4492L76.7422 65.1973C76.7422 64.1777 76.3301 63.668 75.5059 63.668C74.7832 63.668 74.1309 63.9141 73.5488 64.4062V63.4219C74.1387 63.0469 74.8184 62.8594 75.5879 62.8594C76.998 62.8594 77.7031 63.6055 77.7031 65.0977V69ZM76.7422 65.9648L75.2949 66.1641C74.8496 66.2266 74.5137 66.3379 74.2871 66.498C74.0605 66.6543 73.9473 66.9336 73.9473 67.3359C73.9473 67.6289 74.0508 67.8691 74.2578 68.0566C74.4688 68.2402 74.748 68.332 75.0957 68.332C75.5723 68.332 75.9648 68.166 76.2734 67.834C76.5859 67.498 76.7422 67.0742 76.7422 66.5625V65.9648ZM82.2969 68.9414C82.0703 69.0664 81.7715 69.1289 81.4004 69.1289C80.3496 69.1289 79.8242 68.543 79.8242 67.3711V63.8203H78.793V63H79.8242V61.5352L80.7852 61.2246V63H82.2969V63.8203H80.7852V67.2012C80.7852 67.6035 80.8535 67.8906 80.9902 68.0625C81.127 68.2344 81.3535 68.3203 81.6699 68.3203C81.9121 68.3203 82.1211 68.2539 82.2969 68.1211V68.9414ZM87.875 69H86.9141V68.0625H86.8906C86.4727 68.7812 85.8574 69.1406 85.0449 69.1406C84.4473 69.1406 83.9785 68.9824 83.6387 68.666C83.3027 68.3496 83.1348 67.9297 83.1348 67.4062C83.1348 66.2852 83.7949 65.6328 85.1152 65.4492L86.9141 65.1973C86.9141 64.1777 86.502 63.668 85.6777 63.668C84.9551 63.668 84.3027 63.9141 83.7207 64.4062V63.4219C84.3105 63.0469 84.9902 62.8594 85.7598 62.8594C87.1699 62.8594 87.875 63.6055 87.875 65.0977V69ZM86.9141 65.9648L85.4668 66.1641C85.0215 66.2266 84.6855 66.3379 84.459 66.498C84.2324 66.6543 84.1191 66.9336 84.1191 67.3359C84.1191 67.6289 84.2227 67.8691 84.4297 68.0566C84.6406 68.2402 84.9199 68.332 85.2676 68.332C85.7441 68.332 86.1367 68.166 86.4453 67.834C86.7578 67.498 86.9141 67.0742 86.9141 66.5625V65.9648Z' fill='%23020057'/%3E%3C/svg%3E%0A") no-repeat center center;`;
1293
1553
 
1294
1554
  var blobUnavailableSvgSmall = `background: url("data:image/svg+xml,%3Csvg width='100%25' viewBox='0 0 40 40' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='40' height='40' fill='%23FBFBFE'/%3E%3Cpath d='M25.75 11C27.5449 11 29 12.4551 29 14.25V25.75C29 27.5449 27.5449 29 25.75 29H14.25C12.4551 29 11 27.5449 11 25.75V14.25C11 12.4551 12.4551 11 14.25 11H25.75ZM26.3305 27.4014L20.5247 21.7148C20.2596 21.4553 19.8501 21.4316 19.5588 21.644L19.4752 21.7148L13.6685 27.4011C13.8504 27.4651 14.0461 27.5 14.25 27.5H25.75C25.9535 27.5 26.1489 27.4653 26.3305 27.4014L20.5247 21.7148L26.3305 27.4014ZM25.75 12.5H14.25C13.2835 12.5 12.5 13.2835 12.5 14.25V25.75C12.5 25.9584 12.5364 26.1583 12.6033 26.3437L18.4258 20.643C19.2589 19.8273 20.5675 19.7885 21.4458 20.5266L21.5742 20.6431L27.3964 26.3447C27.4634 26.159 27.5 25.9588 27.5 25.75V14.25C27.5 13.2835 26.7165 12.5 25.75 12.5ZM23.2521 14.5C24.4959 14.5 25.5042 15.5083 25.5042 16.7521C25.5042 17.9959 24.4959 19.0042 23.2521 19.0042C22.0083 19.0042 21 17.9959 21 16.7521C21 15.5083 22.0083 14.5 23.2521 14.5ZM23.2521 16C22.8367 16 22.5 16.3367 22.5 16.7521C22.5 17.1675 22.8367 17.5042 23.2521 17.5042C23.6675 17.5042 24.0042 17.1675 24.0042 16.7521C24.0042 16.3367 23.6675 16 23.2521 16Z' fill='%23020057'/%3E%3C/svg%3E%0A") no-repeat center center;`;
@@ -1449,6 +1709,8 @@ var LayoutHelper = /** @class */ (function () {
1449
1709
  _this.hashMapAlpha = {};
1450
1710
  _this.hashMapBeta = {};
1451
1711
  _this.primaryHtmlNodeId = null;
1712
+ // Reset dialog render state for new render cycle
1713
+ resetDialogRenderState();
1452
1714
  };
1453
1715
  this.get = function (hash) {
1454
1716
  if (hash in _this.hashMapBeta && _this.hashMapBeta[hash].isConnected) {
@@ -1760,21 +2022,10 @@ var LayoutHelper = /** @class */ (function () {
1760
2022
  }
1761
2023
  case "DIALOG":
1762
2024
  {
1763
- // Use custom module for dialog rendering
1764
- var dialogElement = _this.element(node.id);
1765
- dialogElement = dialogElement ? dialogElement : _this.createElement(doc, node.tag);
1766
- if (!node.attributes) {
1767
- node.attributes = {};
1768
- }
1769
- // Extract render options before cleaning attributes
1770
- var renderOptions = getDialogRenderOptions(node.attributes, dialogElement);
1771
- // TODO: Clean custom tracking attributes
1772
- // node.attributes = dialogCustom.cleanDialogAttributes(node.attributes);
1773
- // Set attributes and insert into DOM
1774
- _this.setAttributes(dialogElement, node);
1775
- insert(node, parent_1, dialogElement, pivot);
1776
- // Render dialog with proper modal/non-modal handling
1777
- renderDialog(dialogElement, renderOptions, _this.state.options.logerror);
2025
+ _this.insertDefaultElement(node, parent_1, pivot, doc, insert);
2026
+ var domElement = _this.element(node.id);
2027
+ var renderOptions = getDialogRenderOptions(node.attributes, domElement);
2028
+ renderDialog(domElement, renderOptions, _this.state.options.logerror);
1778
2029
  break;
1779
2030
  }
1780
2031
  default:
@@ -2138,7 +2389,7 @@ var Visualizer = /** @class */ (function () {
2138
2389
  return false;
2139
2390
  }
2140
2391
  };
2141
- this.html = function (decoded, target, hash, useproxy, logerror, shortCircuitStrategy) {
2392
+ this.html = function (decoded, target, portalCanvas, hash, useproxy, logerror, shortCircuitStrategy) {
2142
2393
  if (hash === void 0) { hash = null; }
2143
2394
  if (shortCircuitStrategy === void 0) { shortCircuitStrategy = 0 /* ShortCircuitStrategy.None */; }
2144
2395
  return __awaiter(_this, void 0, void 0, function () {
@@ -2151,7 +2402,7 @@ var Visualizer = /** @class */ (function () {
2151
2402
  case 1:
2152
2403
  _b.trys.push([1, 10, , 11]);
2153
2404
  merged = this.merge(decoded);
2154
- return [4 /*yield*/, this.setup(target, { version: decoded[0].envelope.version, dom: merged.dom, useproxy: useproxy })];
2405
+ return [4 /*yield*/, this.setup(target, { version: decoded[0].envelope.version, dom: merged.dom, useproxy: useproxy, portalCanvas: portalCanvas })];
2155
2406
  case 2:
2156
2407
  _b.sent();
2157
2408
  _b.label = 3;