@customviews-js/customviews 1.1.5 → 1.1.7

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.
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @customviews-js/customviews v1.1.4
2
+ * @customviews-js/customviews v1.1.7
3
3
  * (c) 2025 Chan Ger Teck
4
4
  * Released under the MIT License.
5
5
  */
@@ -269,102 +269,6 @@ class VisibilityManager {
269
269
  }
270
270
  }
271
271
 
272
- /** --- Icon utilities --- */
273
- function ensureFontAwesomeInjected() {
274
- const isFontAwesomeLoaded = Array.from(document.styleSheets).some(sheet => sheet.href && (sheet.href.includes('font-awesome') || sheet.href.includes('fontawesome')));
275
- if (isFontAwesomeLoaded)
276
- return;
277
- const link = document.createElement('link');
278
- link.rel = 'stylesheet';
279
- link.href = 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css';
280
- link.setAttribute('data-customviews-fontawesome', 'true');
281
- document.head.appendChild(link);
282
- }
283
- function replaceIconShortcodes(text) {
284
- // Matches :fa-*, :fas-*, :fab-* etc.
285
- return text.replace(/:(fa[b|s|r]?)-([\w-]+):/g, (_, style, icon) => {
286
- // style = fa, fas, fab, far, etc.
287
- // Default to "fa" if only "fa-" is given
288
- return `<i class="${style} fa-${icon}"></i>`;
289
- });
290
- }
291
- /** --- Basic renderers --- */
292
- function renderImage(el, asset) {
293
- if (!asset.src)
294
- return;
295
- el.innerHTML = '';
296
- const img = document.createElement('img');
297
- img.src = asset.src;
298
- img.alt = asset.alt || '';
299
- // Apply custom styling if provided
300
- if (asset.className) {
301
- img.className = asset.className;
302
- }
303
- if (asset.style) {
304
- img.setAttribute('style', asset.style);
305
- }
306
- // Default styles (can be overridden by asset.style)
307
- img.style.maxWidth = img.style.maxWidth || '100%';
308
- img.style.height = img.style.height || 'auto';
309
- img.style.display = img.style.display || 'block';
310
- el.appendChild(img);
311
- }
312
- function renderText(el, asset) {
313
- if (asset.content != null) {
314
- el.textContent = asset.content;
315
- }
316
- // Apply custom styling if provided
317
- if (asset.className) {
318
- el.className = asset.className;
319
- }
320
- if (asset.style) {
321
- el.setAttribute('style', asset.style);
322
- }
323
- }
324
- function renderHtml(el, asset) {
325
- if (asset.content != null) {
326
- el.innerHTML = asset.content;
327
- }
328
- // Apply custom styling if provided
329
- if (asset.className) {
330
- el.className = asset.className;
331
- }
332
- if (asset.style) {
333
- el.setAttribute('style', asset.style);
334
- }
335
- }
336
- /** --- Unified asset renderer --- */
337
- function detectAssetType(asset) {
338
- // If src exists, it's an image
339
- if (asset.src)
340
- return 'image';
341
- // If content contains HTML tags, it's HTML
342
- if (asset.content && /<[^>]+>/.test(asset.content)) {
343
- return 'html';
344
- }
345
- return 'text';
346
- }
347
- function renderAssetInto(el, assetId, assetsManager) {
348
- const asset = assetsManager.get(assetId);
349
- if (!asset)
350
- return;
351
- const type = asset.type || detectAssetType(asset);
352
- switch (type) {
353
- case 'image':
354
- renderImage(el, asset);
355
- break;
356
- case 'text':
357
- renderText(el, asset);
358
- break;
359
- case 'html':
360
- renderHtml(el, asset);
361
- break;
362
- default:
363
- el.innerHTML = asset.content || String(asset);
364
- console.warn('[CustomViews] Unknown asset type:', type);
365
- }
366
- }
367
-
368
272
  // Constants for selectors
369
273
  const TABGROUP_SELECTOR = 'cv-tabgroup';
370
274
  const TAB_SELECTOR = 'cv-tab';
@@ -451,37 +355,35 @@ class TabManager {
451
355
  tabEl.classList.remove('cv-visible');
452
356
  }
453
357
  }
358
+ /**
359
+ * Extract header and body content from header component syntax: <cv-tab-header> and <cv-tab-body>
360
+ * Returns null if using old attribute-based syntax.
361
+ *
362
+ * @param tabEl The <cv-tab> element to inspect
363
+ * @returns Object with extracted content, or null if new syntax not used
364
+ */
365
+ static extractTabContent(tabEl) {
366
+ // Look for direct children
367
+ let headerEl = tabEl.querySelector(':scope > cv-tab-header');
368
+ if (!headerEl) {
369
+ return null;
370
+ }
371
+ const headerHTML = headerEl.innerHTML.trim();
372
+ // Find body element
373
+ let bodyEl = tabEl.querySelector(':scope > cv-tab-body');
374
+ // Fallback: try finding both header and body
375
+ // without :scope (in case of DOM manipulation) by iterating through tabEl.children if needed
376
+ return {
377
+ headerHTML,
378
+ bodyEl
379
+ };
380
+ }
454
381
  /**
455
382
  * Build navigation for tab groups with nav="auto" (one-time setup)
456
383
  */
457
384
  static buildNavs(rootEl, cfgGroups, onTabClick, onTabDoubleClick) {
458
385
  // Find all cv-tabgroup elements with nav="auto" or no nav attribute
459
386
  const tabGroups = rootEl.querySelectorAll(NAV_AUTO_SELECTOR);
460
- // Check if any tab headers contain Font Awesome shortcodes
461
- // Inject Font Awesome CSS only if needed
462
- let hasFontAwesomeShortcodes = false;
463
- tabGroups.forEach((groupEl) => {
464
- const groupId = groupEl.getAttribute('id');
465
- if (!groupId)
466
- return;
467
- const tabElements = Array.from(groupEl.children).filter((child) => child.tagName.toLowerCase() === 'cv-tab');
468
- // Check for Font Awesome shortcodes in tab headers
469
- tabElements.forEach((tabEl) => {
470
- const tabId = tabEl.getAttribute('id');
471
- if (!tabId)
472
- return;
473
- const splitIds = this.splitTabIds(tabId);
474
- const firstId = splitIds[0] || tabId;
475
- const header = tabEl.getAttribute('header') || this.getTabLabel(firstId, groupId, cfgGroups) || firstId || '';
476
- if (/:fa-[\w-]+:/.test(header)) {
477
- hasFontAwesomeShortcodes = true;
478
- }
479
- });
480
- });
481
- // Inject Font Awesome only if shortcodes are found
482
- if (hasFontAwesomeShortcodes) {
483
- ensureFontAwesomeInjected();
484
- }
485
387
  tabGroups.forEach((groupEl) => {
486
388
  const groupId = groupEl.getAttribute('id');
487
389
  if (!groupId)
@@ -510,78 +412,71 @@ class TabManager {
510
412
  groupEl.insertBefore(navContainer, groupEl.firstChild);
511
413
  // Build nav items
512
414
  tabElements.forEach((tabEl) => {
513
- const tabId = tabEl.getAttribute('id');
514
- if (!tabId)
415
+ const rawTabId = tabEl.getAttribute('id');
416
+ if (!rawTabId)
515
417
  return;
516
- const splitIds = this.splitTabIds(tabId);
517
- // Header demarcation: if header contains |, split and use per tab.
518
- // If header attribute is present and not demarcated, use it as the fallback header.
519
- const headerAttr = tabEl.getAttribute('header') || '';
520
- let headerParts = [];
521
- if (headerAttr && headerAttr.includes('|')) {
522
- headerParts = headerAttr.split('|').map(h => h.trim());
523
- }
524
- const firstId = splitIds[0] || tabId;
525
- let fallbackHeader = '';
526
- if (headerAttr && !headerAttr.includes('|')) {
527
- // Single header provided on the element: use for all split IDs
528
- fallbackHeader = headerAttr;
418
+ const splitIds = this.splitTabIds(rawTabId);
419
+ // If multiple IDs, use the first as primary
420
+ const tabId = splitIds[0] || rawTabId;
421
+ // Get header for this tab - prefer new syntax over old attribute syntax
422
+ const extractedHeaderAndBody = this.extractTabContent(tabEl);
423
+ let header = '';
424
+ // use <cv-tab-header> content if available
425
+ if (extractedHeaderAndBody && extractedHeaderAndBody.headerHTML) {
426
+ header = extractedHeaderAndBody.headerHTML;
529
427
  }
530
428
  else {
531
- // No header attribute or multi-part header: use config label or id as fallback
532
- fallbackHeader = this.getTabLabel(firstId, groupId, cfgGroups) || firstId || '';
533
- }
534
- // Create nav links for each split ID
535
- splitIds.forEach((splitId, idx) => {
536
- const listItem = document.createElement('li');
537
- listItem.className = 'nav-item';
538
- const navLink = document.createElement('a');
539
- navLink.className = 'nav-link';
540
- // Use demarcated header if available, else prefer config label for this specific splitId
541
- let header = fallbackHeader;
542
- if (headerParts.length === splitIds.length) {
543
- header = headerParts[idx] ?? fallbackHeader;
544
- }
545
- else if (!headerAttr || headerAttr.includes('|')) {
546
- // Prefer the config label for the individual splitId over using firstId
547
- header = this.getTabLabel(splitId, groupId, cfgGroups) || splitId || '';
548
- }
549
- navLink.innerHTML = replaceIconShortcodes(header);
550
- navLink.href = '#';
551
- navLink.setAttribute('data-tab-id', splitId);
552
- navLink.setAttribute('data-group-id', groupId);
553
- navLink.setAttribute('role', 'tab');
554
- // Check if this split ID is active (same logic as applySelections)
555
- const activeTabId = this.resolveActiveTabForGroup(groupId, {}, cfgGroups, groupEl); // Pass empty tabs for initial state
556
- const isActive = splitIds.includes(activeTabId || '');
557
- if (isActive) {
558
- navLink.classList.add('active');
559
- navLink.setAttribute('aria-selected', 'true');
429
+ // use header attribute if available
430
+ const headerAttr = tabEl.getAttribute('header') || '';
431
+ if (headerAttr) {
432
+ header = headerAttr;
560
433
  }
561
434
  else {
562
- navLink.setAttribute('aria-selected', 'false');
435
+ // Use config label or id as fallback
436
+ header = this.getTabLabel(tabId, groupId, cfgGroups) || tabId || '';
563
437
  }
564
- // Add click handler for local tab switch
565
- if (onTabClick) {
566
- navLink.addEventListener('click', (e) => {
567
- e.preventDefault();
568
- // console.log("Single-click detected");
569
- onTabClick(groupId, splitId, groupEl);
570
- });
571
- }
572
- // Add double-click handler for sync
573
- if (onTabDoubleClick) {
574
- navLink.addEventListener('dblclick', (e) => {
575
- e.preventDefault();
576
- // console.log("Double-click detected");
577
- onTabDoubleClick(groupId, splitId, groupEl);
578
- });
579
- }
580
- // Add tooltip for UX feedback (use native title attribute)
581
- navLink.setAttribute('title', 'Double click to change switch tabs across all groups');
582
- listItem.appendChild(navLink);
583
- navContainer.appendChild(listItem);
584
- });
438
+ }
439
+ // Create a single nav link for this tab element
440
+ const listItem = document.createElement('li');
441
+ listItem.className = 'nav-item';
442
+ const navLink = document.createElement('a');
443
+ navLink.className = 'nav-link';
444
+ navLink.innerHTML = header;
445
+ navLink.href = '#';
446
+ navLink.setAttribute('data-tab-id', tabId);
447
+ navLink.setAttribute('data-raw-tab-id', rawTabId);
448
+ navLink.setAttribute('data-group-id', groupId);
449
+ navLink.setAttribute('role', 'tab');
450
+ // Check if any of the split IDs is active
451
+ const activeTabId = this.resolveActiveTabForGroup(groupId, {}, cfgGroups, groupEl); // Pass empty tabs for initial state
452
+ const isActive = splitIds.includes(activeTabId || '');
453
+ if (isActive) {
454
+ navLink.classList.add('active');
455
+ navLink.setAttribute('aria-selected', 'true');
456
+ }
457
+ else {
458
+ navLink.setAttribute('aria-selected', 'false');
459
+ }
460
+ // Add click handler for local tab switch (if split id, switches to default first ID)
461
+ if (onTabClick) {
462
+ navLink.addEventListener('click', (e) => {
463
+ e.preventDefault();
464
+ // console.log("Single-click detected");
465
+ onTabClick(groupId, tabId, groupEl);
466
+ });
467
+ }
468
+ // Add double-click handler for sync
469
+ if (onTabDoubleClick) {
470
+ navLink.addEventListener('dblclick', (e) => {
471
+ e.preventDefault();
472
+ // console.log("Double-click detected");
473
+ onTabDoubleClick(groupId, tabId, groupEl);
474
+ });
475
+ }
476
+ // Add tooltip for UX feedback (use native title attribute)
477
+ navLink.setAttribute('title', 'Double click to change switch tabs across all groups');
478
+ listItem.appendChild(navLink);
479
+ navContainer.appendChild(listItem);
585
480
  });
586
481
  // Add bottom border line at the end of the tab group
587
482
  const bottomBorder = document.createElement('div');
@@ -645,12 +540,12 @@ class TabManager {
645
540
  static updateNavActiveState(groupEl, activeTabId) {
646
541
  const navLinks = groupEl.querySelectorAll('.nav-link');
647
542
  navLinks.forEach((link) => {
648
- const linkTabId = link.getAttribute('data-tab-id');
649
- if (!linkTabId)
543
+ const rawTabId = link.getAttribute('data-raw-tab-id');
544
+ if (!rawTabId)
650
545
  return;
651
- // Check if activeTabId matches or is in the split IDs of this link
652
- const splitIds = this.splitTabIds(linkTabId);
653
- const isActive = linkTabId === activeTabId || splitIds.includes(activeTabId);
546
+ // Check if activeTabId is in the split IDs of this link
547
+ const splitIds = this.splitTabIds(rawTabId);
548
+ const isActive = splitIds.includes(activeTabId);
654
549
  if (isActive) {
655
550
  link.classList.add('active');
656
551
  link.setAttribute('aria-selected', 'true');
@@ -677,12 +572,12 @@ class TabManager {
677
572
  // Update nav links for this group
678
573
  const navLinks = groupEl.querySelectorAll('.nav-link');
679
574
  navLinks.forEach((link) => {
680
- const linkTabId = link.getAttribute('data-tab-id');
681
- if (!linkTabId)
575
+ const rawTabId = link.getAttribute('data-raw-tab-id');
576
+ if (!rawTabId)
682
577
  return;
683
- // Check if activeTabId matches or is in the split IDs of this link
684
- const splitIds = this.splitTabIds(linkTabId);
685
- const isActive = linkTabId === activeTabId || splitIds.includes(activeTabId);
578
+ // Check if activeTabId is in the split IDs of this link
579
+ const splitIds = this.splitTabIds(rawTabId);
580
+ const isActive = splitIds.includes(activeTabId);
686
581
  if (isActive) {
687
582
  link.classList.add('active');
688
583
  link.setAttribute('aria-selected', 'true');
@@ -783,6 +678,83 @@ class AssetsManager {
783
678
  }
784
679
  }
785
680
 
681
+ /** --- Basic renderers --- */
682
+ function renderImage(el, asset) {
683
+ if (!asset.src)
684
+ return;
685
+ el.innerHTML = '';
686
+ const img = document.createElement('img');
687
+ img.src = asset.src;
688
+ img.alt = asset.alt || '';
689
+ // Apply custom styling if provided
690
+ if (asset.className) {
691
+ img.className = asset.className;
692
+ }
693
+ if (asset.style) {
694
+ img.setAttribute('style', asset.style);
695
+ }
696
+ // Default styles (can be overridden by asset.style)
697
+ img.style.maxWidth = img.style.maxWidth || '100%';
698
+ img.style.height = img.style.height || 'auto';
699
+ img.style.display = img.style.display || 'block';
700
+ el.appendChild(img);
701
+ }
702
+ function renderText(el, asset) {
703
+ if (asset.content != null) {
704
+ el.textContent = asset.content;
705
+ }
706
+ // Apply custom styling if provided
707
+ if (asset.className) {
708
+ el.className = asset.className;
709
+ }
710
+ if (asset.style) {
711
+ el.setAttribute('style', asset.style);
712
+ }
713
+ }
714
+ function renderHtml(el, asset) {
715
+ if (asset.content != null) {
716
+ el.innerHTML = asset.content;
717
+ }
718
+ // Apply custom styling if provided
719
+ if (asset.className) {
720
+ el.className = asset.className;
721
+ }
722
+ if (asset.style) {
723
+ el.setAttribute('style', asset.style);
724
+ }
725
+ }
726
+ /** --- Unified asset renderer --- */
727
+ function detectAssetType(asset) {
728
+ // If src exists, it's an image
729
+ if (asset.src)
730
+ return 'image';
731
+ // If content contains HTML tags, it's HTML
732
+ if (asset.content && /<[^>]+>/.test(asset.content)) {
733
+ return 'html';
734
+ }
735
+ return 'text';
736
+ }
737
+ function renderAssetInto(el, assetId, assetsManager) {
738
+ const asset = assetsManager.get(assetId);
739
+ if (!asset)
740
+ return;
741
+ const type = asset.type || detectAssetType(asset);
742
+ switch (type) {
743
+ case 'image':
744
+ renderImage(el, asset);
745
+ break;
746
+ case 'text':
747
+ renderText(el, asset);
748
+ break;
749
+ case 'html':
750
+ renderHtml(el, asset);
751
+ break;
752
+ default:
753
+ el.innerHTML = asset.content || String(asset);
754
+ console.warn('[CustomViews] Unknown asset type:', type);
755
+ }
756
+ }
757
+
786
758
  // Constants for selectors
787
759
  const TOGGLE_DATA_SELECTOR = "[data-cv-toggle], [data-customviews-toggle]";
788
760
  const TOGGLE_ELEMENT_SELECTOR = "cv-toggle";
@@ -850,166 +822,188 @@ class ToggleManager {
850
822
  /**
851
823
  * Styles for toggle visibility and animations
852
824
  */
853
- const TOGGLE_STYLES = `
854
- /* Core toggle visibility transitions */
855
- [data-cv-toggle], [data-customviews-toggle], cv-toggle {
856
- transition: opacity 150ms ease,
857
- transform 150ms ease,
858
- max-height 200ms ease,
859
- margin 150ms ease;
860
- will-change: opacity, transform, max-height, margin;
861
- }
862
-
863
- .cv-visible {
864
- opacity: 1 !important;
865
- transform: translateY(0) !important;
866
- max-height: var(--cv-max-height, 9999px) !important;
867
- }
868
-
869
- .cv-hidden {
870
- opacity: 0 !important;
871
- transform: translateY(-4px) !important;
872
- pointer-events: none !important;
873
- padding-top: 0 !important;
874
- padding-bottom: 0 !important;
875
- border-top-width: 0 !important;
876
- border-bottom-width: 0 !important;
877
- max-height: 0 !important;
878
- margin-top: 0 !important;
879
- margin-bottom: 0 !important;
880
- overflow: hidden !important;
881
- }
825
+ const TOGGLE_STYLES = `
826
+ /* Core toggle visibility transitions */
827
+ [data-cv-toggle], [data-customviews-toggle], cv-toggle {
828
+ transition: opacity 150ms ease,
829
+ transform 150ms ease,
830
+ max-height 200ms ease,
831
+ margin 150ms ease;
832
+ will-change: opacity, transform, max-height, margin;
833
+ }
834
+
835
+ .cv-visible {
836
+ opacity: 1 !important;
837
+ transform: translateY(0) !important;
838
+ max-height: var(--cv-max-height, 9999px) !important;
839
+ }
840
+
841
+ .cv-hidden {
842
+ opacity: 0 !important;
843
+ transform: translateY(-4px) !important;
844
+ pointer-events: none !important;
845
+ padding-top: 0 !important;
846
+ padding-bottom: 0 !important;
847
+ border-top-width: 0 !important;
848
+ border-bottom-width: 0 !important;
849
+ max-height: 0 !important;
850
+ margin-top: 0 !important;
851
+ margin-bottom: 0 !important;
852
+ overflow: hidden !important;
853
+ }
882
854
  `;
883
855
 
884
856
  /**
885
857
  * Styles for tab groups and tab navigation
886
858
  */
887
- const TAB_STYLES = `
888
- /* Tab navigation styles - Bootstrap-style tabs matching MarkBind */
889
- .cv-tabs-nav {
890
- display: flex;
891
- flex-wrap: wrap;
892
- padding-left: 0;
893
- margin-top: 0.5rem;
894
- margin-bottom: 1rem;
895
- list-style: none;
896
- border-bottom: 1px solid #dee2e6;
897
- }
898
-
899
- .cv-tabs-nav .nav-item {
900
- margin-bottom: -1px;
901
- list-style: none;
902
- display: inline-block;
903
- }
904
-
905
- .cv-tabs-nav .nav-link {
906
- display: block;
907
- padding: 0.5rem 1rem;
908
- color: #495057;
909
- text-decoration: none;
910
- background-color: transparent;
911
- border: 1px solid transparent;
912
- border-top-left-radius: 0.25rem;
913
- border-top-right-radius: 0.25rem;
914
- transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
915
- cursor: pointer;
916
- }
917
-
918
- .cv-tabs-nav .nav-link:hover,
919
- .cv-tabs-nav .nav-link:focus {
920
- border-color: #e9ecef #e9ecef #dee2e6;
921
- isolation: isolate;
922
- }
923
-
924
- .cv-tabs-nav .nav-link.active {
925
- color: #495057;
926
- background-color: #fff;
927
- border-color: #dee2e6 #dee2e6 #fff;
928
- }
929
-
930
- .cv-tabs-nav .nav-link:focus {
931
- outline: 0;
932
- box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
933
- }
934
-
935
- /* Legacy button-based nav (deprecated, kept for compatibility) */
936
- .cv-tabs-nav-item {
937
- background: none;
938
- border: none;
939
- border-bottom: 2px solid transparent;
940
- padding: 0.5rem 1rem;
941
- cursor: pointer;
942
- font-size: 1rem;
943
- color: #6c757d;
944
- transition: color 150ms ease, border-color 150ms ease;
945
- }
946
-
947
- .cv-tabs-nav-item:hover {
948
- color: #495057;
949
- border-bottom-color: #dee2e6;
950
- }
951
-
952
- .cv-tabs-nav-item.active {
953
- color: #007bff;
954
- border-bottom-color: #007bff;
955
- font-weight: 500;
956
- }
957
-
958
- .cv-tabs-nav-item:focus {
959
- outline: 2px solid #007bff;
960
- outline-offset: 2px;
961
- }
962
-
963
- /* Tab panel base styles */
964
- cv-tab {
965
- display: block;
966
- }
967
-
968
- /* Override visibility for tab panels - use display instead of collapse animation */
969
- cv-tab.cv-hidden {
970
- display: none !important;
971
- }
972
-
973
- cv-tab.cv-visible {
974
- display: block !important;
975
- }
976
-
977
- cv-tabgroup {
978
- display: block;
979
- margin-bottom: 1.5rem;
980
- }
981
-
982
- /* Bottom border line for tab groups */
983
- .cv-tabgroup-bottom-border {
984
- border-bottom: 1px solid #dee2e6;
985
- margin-top: 1rem;
986
- }
987
-
988
- /* Tab content wrapper */
989
- .cv-tab-content {
990
- padding: 1rem 0;
991
- }
992
-
993
- /* Viewer-controlled nav visibility: hide nav containers when requested */
994
- .cv-tabs-nav-hidden {
995
- display: none !important;
996
- }
997
-
998
- /* Print-friendly: hide tab navigation when printing to reduce clutter */
999
- @media print {
1000
- .cv-tabs-nav {
1001
- display: none !important;
1002
- }
1003
- }
859
+ const TAB_STYLES = `
860
+ /* Tab navigation styles - Bootstrap-style tabs matching MarkBind */
861
+ .cv-tabs-nav {
862
+ display: flex;
863
+ flex-wrap: wrap;
864
+ padding-left: 0;
865
+ margin-top: 0.5rem;
866
+ margin-bottom: 1rem;
867
+ list-style: none;
868
+ border-bottom: 1px solid #dee2e6;
869
+
870
+ align-items: stretch;
871
+ }
872
+
873
+ .cv-tabs-nav .nav-item {
874
+ margin-bottom: -1px;
875
+ list-style: none;
876
+ display: flex; /* was inline-block → make flex to stretch height */
877
+ align-items: stretch; /* stretch link to full height */
878
+ }
879
+
880
+ .cv-tabs-nav .nav-link {
881
+ display: flex;
882
+ align-items: center;
883
+ justify-content: center;
884
+ padding: 0.5rem 1rem;
885
+ color: #495057;
886
+ text-decoration: none;
887
+ background-color: transparent;
888
+ border: 1px solid transparent;
889
+ border-top-left-radius: 0.25rem;
890
+ border-top-right-radius: 0.25rem;
891
+ transition: color 0.15s ease-in-out, background-color 0.15s ease-in-out, border-color 0.15s ease-in-out;
892
+ cursor: pointer;
893
+ min-height: 2.5rem;
894
+ box-sizing: border-box;
895
+ }
896
+
897
+ .cv-tabs-nav .nav-link p {
898
+ margin: 0; /* remove default margins */
899
+ display: inline; /* or inline-block */
900
+ }
901
+
902
+ .cv-tabs-nav .nav-link:hover,
903
+ .cv-tabs-nav .nav-link:focus {
904
+ border-color: #e9ecef #e9ecef #dee2e6;
905
+ isolation: isolate;
906
+ }
907
+
908
+ .cv-tabs-nav .nav-link.active {
909
+ color: #495057;
910
+ background-color: #fff;
911
+ border-color: #dee2e6 #dee2e6 #fff;
912
+ }
913
+
914
+ .cv-tabs-nav .nav-link:focus {
915
+ outline: 0;
916
+ box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
917
+ }
918
+
919
+ /* Legacy button-based nav (deprecated, kept for compatibility) */
920
+ .cv-tabs-nav-item {
921
+ background: none;
922
+ border: none;
923
+ border-bottom: 2px solid transparent;
924
+ padding: 0.5rem 1rem;
925
+ cursor: pointer;
926
+ font-size: 1rem;
927
+ color: #6c757d;
928
+ transition: color 150ms ease, border-color 150ms ease;
929
+ }
930
+
931
+ .cv-tabs-nav-item:hover {
932
+ color: #495057;
933
+ border-bottom-color: #dee2e6;
934
+ }
935
+
936
+ .cv-tabs-nav-item.active {
937
+ color: #007bff;
938
+ border-bottom-color: #007bff;
939
+ font-weight: 500;
940
+ }
941
+
942
+ .cv-tabs-nav-item:focus {
943
+ outline: 2px solid #007bff;
944
+ outline-offset: 2px;
945
+ }
946
+
947
+ /* Tab panel base styles */
948
+ cv-tab {
949
+ display: block;
950
+ }
951
+
952
+ /* Hide cv-tab-header source element; content is extracted to nav link */
953
+ cv-tab-header {
954
+ display: none !important;
955
+ }
956
+
957
+ /* Allow cv-tab-body to flow naturally */
958
+ cv-tab-body {
959
+ display: block;
960
+ }
961
+
962
+ /* Override visibility for tab panels - use display instead of collapse animation */
963
+ cv-tab.cv-hidden {
964
+ display: none !important;
965
+ }
966
+
967
+ cv-tab.cv-visible {
968
+ display: block !important;
969
+ }
970
+
971
+ cv-tabgroup {
972
+ display: block;
973
+ margin-bottom: 1.5rem;
974
+ }
975
+
976
+ /* Bottom border line for tab groups */
977
+ .cv-tabgroup-bottom-border {
978
+ border-bottom: 1px solid #dee2e6;
979
+ margin-top: 1rem;
980
+ }
981
+
982
+ /* Tab content wrapper */
983
+ .cv-tab-content {
984
+ padding: 1rem 0;
985
+ }
986
+
987
+ /* Viewer-controlled nav visibility: hide nav containers when requested */
988
+ .cv-tabs-nav-hidden {
989
+ display: none !important;
990
+ }
991
+
992
+ /* Print-friendly: hide tab navigation when printing to reduce clutter */
993
+ @media print {
994
+ .cv-tabs-nav {
995
+ display: none !important;
996
+ }
997
+ }
1004
998
  `;
1005
999
 
1006
1000
  /**
1007
1001
  * Combined core styles for toggles and tabs
1008
1002
  */
1009
- const CORE_STYLES = `
1010
- ${TOGGLE_STYLES}
1011
-
1012
- ${TAB_STYLES}
1003
+ const CORE_STYLES = `
1004
+ ${TOGGLE_STYLES}
1005
+
1006
+ ${TAB_STYLES}
1013
1007
  `;
1014
1008
  /**
1015
1009
  * Add styles for hiding and showing toggles animations and transitions to the document head
@@ -1327,6 +1321,24 @@ class CVToggle extends HTMLElement {
1327
1321
  // Element is managed by Core
1328
1322
  }
1329
1323
  }
1324
+ /**
1325
+ * <cv-tab-header> element - represents tab header with rich HTML formatting
1326
+ * Content is extracted and used in the navigation link
1327
+ */
1328
+ class CVTabHeader extends HTMLElement {
1329
+ connectedCallback() {
1330
+ // Element is a semantic container; TabManager extracts its content
1331
+ }
1332
+ }
1333
+ /**
1334
+ * <cv-tab-body> element - represents tab body content
1335
+ * Semantic container for tab panel content
1336
+ */
1337
+ class CVTabBody extends HTMLElement {
1338
+ connectedCallback() {
1339
+ // Element is a semantic container; visibility managed by TabManager
1340
+ }
1341
+ }
1330
1342
  /**
1331
1343
  * Register custom elements
1332
1344
  */
@@ -1341,6 +1353,12 @@ function registerCustomElements() {
1341
1353
  if (!customElements.get('cv-toggle')) {
1342
1354
  customElements.define('cv-toggle', CVToggle);
1343
1355
  }
1356
+ if (!customElements.get('cv-tab-header')) {
1357
+ customElements.define('cv-tab-header', CVTabHeader);
1358
+ }
1359
+ if (!customElements.get('cv-tab-body')) {
1360
+ customElements.define('cv-tab-body', CVTabBody);
1361
+ }
1344
1362
  }
1345
1363
 
1346
1364
  /**
@@ -1403,993 +1421,993 @@ class CustomViews {
1403
1421
  * Note: Styles are kept as a TypeScript string for compatibility with the build system.
1404
1422
  * This approach ensures the styles are properly bundled and don't require separate CSS file handling.
1405
1423
  */
1406
- const WIDGET_STYLES = `
1407
- /* Rounded rectangle widget icon styles */
1408
- .cv-widget-icon {
1409
- position: fixed;
1410
- /* Slightly transparent by default so the widget is subtle at the page edge */
1411
- background: rgba(255, 255, 255, 0.92);
1412
- color: rgba(0, 0, 0, 0.9);
1413
- opacity: 0.6;
1414
- display: flex;
1415
- align-items: center;
1416
- justify-content: center;
1417
- font-size: 18px;
1418
- font-weight: bold;
1419
- cursor: pointer;
1420
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1421
- z-index: 9998;
1422
- transition: all 0.3s ease;
1423
- font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
1424
- }
1425
-
1426
- .cv-widget-icon:hover {
1427
- /* Become fully opaque on hover to improve readability */
1428
- background: rgba(255, 255, 255, 1);
1429
- color: rgba(0, 0, 0, 1);
1430
- opacity: 1;
1431
- }
1432
-
1433
- /* Top-right: rounded end on left, sticks out leftward on hover */
1434
- .cv-widget-top-right {
1435
- top: 20px;
1436
- right: 0;
1437
- border-radius: 18px 0 0 18px;
1438
- padding-left: 8px;
1439
- justify-content: flex-start;
1440
- }
1441
-
1442
- /* Top-left: rounded end on right, sticks out rightward on hover */
1443
- .cv-widget-top-left {
1444
- top: 20px;
1445
- left: 0;
1446
- border-radius: 0 18px 18px 0;
1447
- padding-right: 8px;
1448
- justify-content: flex-end;
1449
- }
1450
-
1451
- /* Bottom-right: rounded end on left, sticks out leftward on hover */
1452
- .cv-widget-bottom-right {
1453
- bottom: 20px;
1454
- right: 0;
1455
- border-radius: 18px 0 0 18px;
1456
- padding-left: 8px;
1457
- justify-content: flex-start;
1458
- }
1459
-
1460
- /* Bottom-left: rounded end on right, sticks out rightward on hover */
1461
- .cv-widget-bottom-left {
1462
- bottom: 20px;
1463
- left: 0;
1464
- border-radius: 0 18px 18px 0;
1465
- padding-right: 8px;
1466
- justify-content: flex-end;
1467
- }
1468
-
1469
- /* Middle-left: rounded end on right, sticks out rightward on hover */
1470
- .cv-widget-middle-left {
1471
- top: 50%;
1472
- left: 0;
1473
- transform: translateY(-50%);
1474
- border-radius: 0 18px 18px 0;
1475
- padding-right: 8px;
1476
- justify-content: flex-end;
1477
- }
1478
-
1479
- /* Middle-right: rounded end on left, sticks out leftward on hover */
1480
- .cv-widget-middle-right {
1481
- top: 50%;
1482
- right: 0;
1483
- transform: translateY(-50%);
1484
- border-radius: 18px 0 0 18px;
1485
- padding-left: 8px;
1486
- justify-content: flex-start;
1487
- }
1488
-
1489
- .cv-widget-top-right,
1490
- .cv-widget-middle-right,
1491
- .cv-widget-bottom-right,
1492
- .cv-widget-top-left,
1493
- .cv-widget-middle-left,
1494
- .cv-widget-bottom-left {
1495
- height: 36px;
1496
- width: 36px;
1497
- }
1498
-
1499
- .cv-widget-middle-right:hover,
1500
- .cv-widget-top-right:hover,
1501
- .cv-widget-bottom-right:hover,
1502
- .cv-widget-top-left:hover,
1503
- .cv-widget-middle-left:hover,
1504
- .cv-widget-bottom-left:hover {
1505
- width: 55px;
1506
- }
1507
-
1508
- /* Modal content styles */
1509
- .cv-widget-section {
1510
- margin-bottom: 16px;
1511
- }
1512
-
1513
- .cv-widget-section:last-child {
1514
- margin-bottom: 0;
1515
- }
1516
-
1517
- .cv-widget-section label {
1518
- display: block;
1519
- margin-bottom: 4px;
1520
- font-weight: 500;
1521
- color: #555;
1522
- }
1523
-
1524
- .cv-widget-profile-select,
1525
- .cv-widget-state-select {
1526
- width: 100%;
1527
- padding: 8px 12px;
1528
- border: 1px solid #ddd;
1529
- border-radius: 4px;
1530
- background: white;
1531
- font-size: 14px;
1532
- }
1533
-
1534
- .cv-widget-profile-select:focus,
1535
- .cv-widget-state-select:focus {
1536
- outline: none;
1537
- border-color: #007bff;
1538
- box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
1539
- }
1540
-
1541
- .cv-widget-profile-select:disabled,
1542
- .cv-widget-state-select:disabled {
1543
- background: #f8f9fa;
1544
- color: #6c757d;
1545
- cursor: not-allowed;
1546
- }
1547
-
1548
- .cv-widget-current {
1549
- margin: 16px 0;
1550
- padding: 12px;
1551
- background: #f8f9fa;
1552
- border-radius: 4px;
1553
- border-left: 4px solid #007bff;
1554
- }
1555
-
1556
- .cv-widget-current label {
1557
- font-size: 12px;
1558
- text-transform: uppercase;
1559
- letter-spacing: 0.5px;
1560
- color: #666;
1561
- margin-bottom: 4px;
1562
- }
1563
-
1564
- .cv-widget-current-view {
1565
- font-weight: 500;
1566
- color: #333;
1567
- }
1568
-
1569
- .cv-widget-reset {
1570
- width: 100%;
1571
- padding: 8px 16px;
1572
- background: #dc3545;
1573
- color: white;
1574
- border: none;
1575
- border-radius: 4px;
1576
- cursor: pointer;
1577
- font-size: 14px;
1578
- font-weight: 500;
1579
- }
1580
-
1581
- .cv-widget-reset:hover {
1582
- background: #c82333;
1583
- }
1584
-
1585
- .cv-widget-reset:active {
1586
- background: #bd2130;
1587
- }
1588
-
1589
- /* Responsive design for mobile */
1590
- @media (max-width: 768px) {
1591
- .cv-widget-top-right,
1592
- .cv-widget-top-left {
1593
- top: 10px;
1594
- }
1595
-
1596
- .cv-widget-bottom-right,
1597
- .cv-widget-bottom-left {
1598
- bottom: 10px;
1599
- }
1600
-
1601
- /* All widgets stay flush with screen edges */
1602
- .cv-widget-top-right,
1603
- .cv-widget-bottom-right,
1604
- .cv-widget-middle-right {
1605
- right: 0;
1606
- }
1607
-
1608
- .cv-widget-top-left,
1609
- .cv-widget-bottom-left,
1610
- .cv-widget-middle-left {
1611
- left: 0;
1612
- }
1613
-
1614
- /* Slightly smaller on mobile */
1615
- .cv-widget-icon {
1616
- width: 60px;
1617
- height: 32px;
1618
- }
1619
-
1620
- .cv-widget-icon:hover {
1621
- width: 75px;
1622
- }
1623
- }
1624
-
1625
- /* Modal styles */
1626
- .cv-widget-modal-overlay {
1627
- position: fixed;
1628
- top: 0;
1629
- left: 0;
1630
- right: 0;
1631
- bottom: 0;
1632
- background: rgba(0, 0, 0, 0.5);
1633
- display: flex;
1634
- align-items: center;
1635
- justify-content: center;
1636
- z-index: 10002;
1637
- animation: fadeIn 0.2s ease;
1638
- }
1639
-
1640
- @keyframes fadeIn {
1641
- from { opacity: 0; }
1642
- to { opacity: 1; }
1643
- }
1644
-
1645
- .cv-widget-modal {
1646
- background: white;
1647
- border-radius: 0.75rem;
1648
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
1649
- max-width: 32rem;
1650
- width: 90vw;
1651
- max-height: 80vh;
1652
- animation: slideIn 0.2s ease;
1653
- display: flex;
1654
- flex-direction: column;
1655
- }
1656
-
1657
- @keyframes slideIn {
1658
- from {
1659
- opacity: 0;
1660
- transform: scale(0.9) translateY(-20px);
1661
- }
1662
- to {
1663
- opacity: 1;
1664
- transform: scale(1) translateY(0);
1665
- }
1666
- }
1667
-
1668
- .cv-modal-header {
1669
- display: flex;
1670
- align-items: center;
1671
- justify-content: space-between;
1672
- padding: 0.5rem 1rem;
1673
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1674
- }
1675
-
1676
- .cv-modal-header-content {
1677
- display: flex;
1678
- align-items: center;
1679
- gap: 0.75rem;
1680
- }
1681
-
1682
- .cv-modal-icon {
1683
- position: relative;
1684
- width: 1rem;
1685
- height: 1rem;
1686
- display: flex;
1687
- align-items: center;
1688
- justify-content: center;
1689
- border-radius: 9999px;
1690
- }
1691
-
1692
- .cv-modal-icon-svg {
1693
- width: 100%;
1694
- height: 100%;
1695
- opacity: 1;
1696
- }
1697
-
1698
- .cv-modal-title {
1699
- font-size: 1.125rem;
1700
- font-weight: bold;
1701
- color: rgba(0, 0, 0, 0.9);
1702
- margin: 0;
1703
- }
1704
-
1705
- .cv-modal-close {
1706
- width: 2rem;
1707
- height: 2rem;
1708
- display: flex;
1709
- align-items: center;
1710
- justify-content: center;
1711
- border-radius: 9999px;
1712
- background: transparent;
1713
- border: none;
1714
- color: rgba(0, 0, 0, 0.6);
1715
- cursor: pointer;
1716
- transition: all 0.2s ease;
1717
- }
1718
-
1719
- .cv-modal-close:hover {
1720
- background: rgba(62, 132, 244, 0.1);
1721
- color: #3e84f4;
1722
- }
1723
-
1724
- .cv-modal-close-icon {
1725
- width: 1.25rem;
1726
- height: 1.25rem;
1727
- }
1728
-
1729
- .cv-modal-main {
1730
- padding: 1rem;
1731
- flex: 1;
1732
- display: flex;
1733
- flex-direction: column;
1734
- gap: 1rem;
1735
- overflow-y: auto;
1736
- max-height: calc(80vh - 8rem);
1737
- }
1738
-
1739
- .cv-modal-description {
1740
- font-size: 0.875rem;
1741
- color: rgba(0, 0, 0, 0.8);
1742
- margin: 0;
1743
- line-height: 1.4;
1744
- }
1745
-
1746
- .cv-content-section,
1747
- .cv-tab-groups-section {
1748
- display: flex;
1749
- flex-direction: column;
1750
- gap: 0.75rem;
1751
- }
1752
-
1753
- .cv-section-heading {
1754
- font-size: 1rem;
1755
- font-weight: bold;
1756
- color: rgba(0, 0, 0, 0.9);
1757
- margin: 0;
1758
- }
1759
-
1760
- .cv-widget-modal-actions {
1761
- margin-top: 20px;
1762
- padding-top: 16px;
1763
- border-top: 1px solid #e9ecef;
1764
- }
1765
-
1766
- .cv-widget-restore {
1767
- width: 100%;
1768
- padding: 10px 16px;
1769
- background: #28a745;
1770
- color: white;
1771
- border: none;
1772
- border-radius: 4px;
1773
- cursor: pointer;
1774
- font-size: 14px;
1775
- font-weight: 500;
1776
- }
1777
-
1778
- .cv-widget-restore:hover {
1779
- background: #218838;
1780
- }
1781
-
1782
- .cv-widget-create-state {
1783
- width: 100%;
1784
- padding: 10px 16px;
1785
- background: #007bff;
1786
- color: white;
1787
- border: none;
1788
- border-radius: 4px;
1789
- cursor: pointer;
1790
- font-size: 14px;
1791
- font-weight: 500;
1792
- margin-bottom: 10px;
1793
- }
1794
-
1795
- .cv-widget-create-state:hover {
1796
- background: #0056b3;
1797
- }
1798
-
1799
- .cv-widget-theme-dark .cv-widget-modal {
1800
- background: #101722;
1801
- color: #e2e8f0;
1802
- }
1803
-
1804
- .cv-widget-theme-dark .cv-modal-header {
1805
- border-color: rgba(255, 255, 255, 0.1);
1806
- }
1807
-
1808
- .cv-widget-theme-dark .cv-modal-title {
1809
- color: #e2e8f0;
1810
- }
1811
-
1812
- .cv-widget-theme-dark .cv-modal-close {
1813
- color: rgba(255, 255, 255, 0.6);
1814
- }
1815
-
1816
- .cv-widget-theme-dark .cv-modal-close:hover {
1817
- background: rgba(62, 132, 244, 0.2);
1818
- color: #3e84f4;
1819
- }
1820
-
1821
- .cv-widget-theme-dark .cv-modal-description {
1822
- color: rgba(255, 255, 255, 0.8);
1823
- }
1824
-
1825
- .cv-widget-theme-dark .cv-section-heading {
1826
- color: #e2e8f0;
1827
- }
1828
-
1829
- .cv-widget-theme-dark .cv-toggles-container
1830
- .cv-widget-theme-dark .cv-tabgroups-container {
1831
- border-color: rgba(255, 255, 255, 0.1);
1832
- }
1833
-
1834
- .cv-widget-theme-dark .cv-toggle-card,
1835
- .cv-widget-theme-dark .cv-tabgroup-card {
1836
- background: #101722;
1837
- border-color: rgba(255, 255, 255, 0.1);
1838
- }
1839
-
1840
- .cv-widget-theme-dark .cv-toggle-title,
1841
- .cv-widget-theme-dark .cv-tabgroup-title {
1842
- color: #e2e8f0;
1843
- }
1844
-
1845
- .cv-widget-theme-dark .cv-toggle-description,
1846
- .cv-widget-theme-dark .cv-tabgroup-description {
1847
- color: rgba(255, 255, 255, 0.6);
1848
- }
1849
-
1850
- .cv-widget-theme-dark .cv-toggle-slider {
1851
- background: rgba(255, 255, 255, 0.2);
1852
- }
1853
-
1854
- .cv-widget-theme-dark .cv-tab-group-description {
1855
- color: rgba(255, 255, 255, 0.8);
1856
- }
1857
-
1858
- .cv-widget-theme-dark .cv-tabgroup-select {
1859
- background: #101722;
1860
- border-color: rgba(255, 255, 255, 0.2);
1861
- color: #e2e8f0;
1862
- }
1863
-
1864
- .cv-widget-theme-dark .cv-modal-footer {
1865
- border-color: rgba(255, 255, 255, 0.1);
1866
- background: #101722;
1867
- }
1868
-
1869
- .cv-widget-theme-dark .cv-reset-btn {
1870
- color: #e2e8f0;
1871
- background: rgba(255, 255, 255, 0.1);
1872
- }
1873
-
1874
- .cv-widget-theme-dark .cv-reset-btn:hover {
1875
- background: rgba(255, 255, 255, 0.2);
1876
- }
1877
-
1878
- /* Custom state creator styles */
1879
- .cv-custom-state-modal {
1880
- max-width: 500px;
1881
- }
1882
-
1883
- .cv-custom-state-form .cv-section-header {
1884
- font-size: 16px;
1885
- font-weight: 600;
1886
- color: #333;
1887
- border-bottom: 1px solid #e9ecef;
1888
- padding-bottom: 5px;
1889
- }
1890
-
1891
- .cv-custom-state-form p {
1892
- font-size: 15px;
1893
- line-height: 1.6;
1894
- color: #555;
1895
- margin-bottom: 24px;
1896
- text-align: justify;
1897
- }
1898
-
1899
- .cv-custom-state-section {
1900
- margin-bottom: 16px;
1901
- }
1902
-
1903
- .cv-custom-state-section label {
1904
- display: block;
1905
- margin-bottom: 4px;
1906
- font-weight: 500;
1907
- color: #555;
1908
- }
1909
-
1910
- .cv-custom-state-input {
1911
- width: 100%;
1912
- padding: 8px 12px;
1913
- border: 1px solid #ddd;
1914
- border-radius: 4px;
1915
- background: white;
1916
- font-size: 14px;
1917
- }
1918
-
1919
- .cv-custom-state-input:focus {
1920
- outline: none;
1921
- border-color: #007bff;
1922
- box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
1923
- }
1924
-
1925
- /* Toggles Container */
1926
- .cv-toggles-container {
1927
- display: flex;
1928
- flex-direction: column;
1929
- gap: 0.5rem;
1930
- border-radius: 0.5rem;
1931
- border: 1px solid rgba(0, 0, 0, 0.1);
1932
- overflow: hidden;
1933
- }
1934
-
1935
- .cv-toggle-card,
1936
- .cv-tabgroup-card {
1937
- background: white;
1938
- border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1939
- }
1940
-
1941
- .cv-toggle-card:last-child {
1942
- border-bottom: none;
1943
- }
1944
-
1945
- .cv-toggle-content {
1946
- display: flex;
1947
- align-items: center;
1948
- justify-content: space-between;
1949
- padding: 0.75rem;
1950
- }
1951
-
1952
- .cv-toggle-title {
1953
- font-weight: 500;
1954
- font-size: 0.875rem;
1955
- color: rgba(0, 0, 0, 0.9);
1956
- margin: 0 0 0.125rem 0;
1957
- }
1958
-
1959
- .cv-toggle-description {
1960
- font-size: 0.75rem;
1961
- color: rgba(0, 0, 0, 0.6);
1962
- margin: 0;
1963
- }
1964
-
1965
- .cv-toggle-label{
1966
- position: relative;
1967
- display: inline-block;
1968
- width: 2.75rem;
1969
- height: 1.5rem;
1970
- cursor: pointer;
1971
- }
1972
-
1973
- .cv-toggle-input {
1974
- opacity: 0;
1975
- width: 0;
1976
- height: 0;
1977
- }
1978
-
1979
- .cv-toggle-slider {
1980
- position: absolute;
1981
- top: 0;
1982
- left: 0;
1983
- right: 0;
1984
- bottom: 0;
1985
- background: rgba(0, 0, 0, 0.2);
1986
- border-radius: 9999px;
1987
- transition: background-color 0.2s ease;
1988
- }
1989
-
1990
- .cv-toggle-slider:before {
1991
- position: absolute;
1992
- content: "";
1993
- height: 1rem;
1994
- width: 1rem;
1995
- left: 0.25rem;
1996
- bottom: 0.25rem;
1997
- background: white;
1998
- border-radius: 50%;
1999
- transition: transform 0.2s ease;
2000
- }
2001
-
2002
- .cv-toggle-input:checked + .cv-toggle-slider {
2003
- background: #3e84f4;
2004
- }
2005
-
2006
- .cv-toggle-input:checked + .cv-toggle-slider:before {
2007
- transform: translateX(1.25rem);
2008
- }
2009
-
2010
- /* Dark theme toggle switch styles */
2011
- .cv-widget-theme-dark .cv-toggle-switch {
2012
- background: #4a5568;
2013
- }
2014
-
2015
- .cv-widget-theme-dark .cv-toggle-switch:hover {
2016
- background: #5a6578;
2017
- }
2018
-
2019
- .cv-widget-theme-dark .cv-toggle-switch.cv-toggle-active {
2020
- background: #63b3ed;
2021
- }
2022
-
2023
- .cv-widget-theme-dark .cv-toggle-switch.cv-toggle-active:hover {
2024
- background: #4299e1;
2025
- }
2026
-
2027
- /* Tab Groups Container */
2028
- .cv-tab-groups-list {
2029
- display: flex;
2030
- flex-direction: column;
2031
- gap: 1px;
2032
- border: 1px solid rgba(0, 0, 0, 0.1);
2033
- border-radius: 0.5rem;
2034
- overflow: hidden;
2035
- }
2036
-
2037
- /* Tab Group Card - Header (Navigation Headers toggle) */
2038
- .cv-tabgroup-card.cv-tabgroup-header {
2039
- display: flex;
2040
- align-items: center;
2041
- justify-content: space-between;
2042
- padding: 0.75rem;
2043
- border-bottom: 0px;
2044
- }
2045
-
2046
- .cv-tabgroup-card.cv-tabgroup-header .cv-tabgroup-row {
2047
- display: flex;
2048
- align-items: center;
2049
- justify-content: space-between;
2050
- width: 100%;
2051
- gap: 1rem;
2052
- }
2053
-
2054
- /* Tab Group Card - Items */
2055
- .cv-tabgroup-card.cv-tabgroup-item {
2056
- display: flex;
2057
- flex-direction: column;
2058
- gap: 0.5rem;
2059
- padding: 0.75rem;
2060
- background: white;
2061
- border-bottom: 1px solid rgba(0, 0, 0, 0.05);
2062
- }
2063
-
2064
- .cv-tabgroup-card.cv-tabgroup-item:last-child {
2065
- border-bottom: none;
2066
- }
2067
-
2068
- /* Tab Group Info */
2069
- .cv-tabgroup-info {
2070
- flex: 1;
2071
- }
2072
-
2073
- .cv-tabgroup-title {
2074
- font-weight: 500;
2075
- font-size: 0.875rem;
2076
- color: rgba(0, 0, 0, 0.9);
2077
- margin: 0 0 0.25rem 0;
2078
- }
2079
-
2080
- .cv-tabgroup-description {
2081
- font-size: 0.75rem;
2082
- color: rgba(0, 0, 0, 0.6);
2083
- margin: 0;
2084
- line-height: 1.3;
2085
- }
2086
-
2087
- /* Tab Group Label (for select dropdowns) */
2088
- .cv-tabgroup-label {
2089
- font-size: 0.875rem;
2090
- color: rgba(0, 0, 0, 0.8);
2091
- margin: 0;
2092
- line-height: 1.4;
2093
- font-weight: 500;
2094
- display: block;
2095
- cursor: pointer;
2096
- }
2097
-
2098
- /* Tab Group Select */
2099
- .cv-tabgroup-select {
2100
- width: 100%;
2101
- border-radius: 0.5rem;
2102
- background: white;
2103
- border: 1px solid rgba(0, 0, 0, 0.15);
2104
- color: rgba(0, 0, 0, 0.9);
2105
- padding: 0.5rem 0.75rem;
2106
- font-size: 0.875rem;
2107
- cursor: pointer;
2108
- transition: all 0.15s ease;
2109
- font-family: inherit;
2110
- }
2111
-
2112
- .cv-tabgroup-select:hover {
2113
- border-color: rgba(0, 0, 0, 0.25);
2114
- }
2115
-
2116
- .cv-tabgroup-select:focus {
2117
- outline: none;
2118
- border-color: #3e84f4;
2119
- box-shadow: 0 0 0 2px rgba(62, 132, 244, 0.2);
2120
- }
2121
-
2122
- /* Modern Toggle Switch */
2123
- .cv-toggle-switch {
2124
- position: relative;
2125
- display: inline-flex;
2126
- align-items: center;
2127
- width: 44px;
2128
- height: 24px;
2129
- background: rgba(0, 0, 0, 0.1);
2130
- border-radius: 9999px;
2131
- padding: 2px;
2132
- box-sizing: border-box;
2133
- cursor: pointer;
2134
- transition: background-color 0.2s ease;
2135
- border: none;
2136
- }
2137
-
2138
- .cv-toggle-switch input {
2139
- display: none;
2140
- }
2141
-
2142
- .cv-toggle-switch .cv-switch-bg {
2143
- position: absolute;
2144
- inset: 0;
2145
- border-radius: 9999px;
2146
- background: rgba(0, 0, 0, 0.1);
2147
- transition: background-color 0.2s ease;
2148
- pointer-events: none;
2149
- }
2150
-
2151
- .cv-toggle-switch .cv-switch-knob {
2152
- position: relative;
2153
- width: 20px;
2154
- height: 20px;
2155
- background: white;
2156
- border-radius: 50%;
2157
- box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
2158
- transition: transform 0.2s ease;
2159
- z-index: 1;
2160
- }
2161
-
2162
- .cv-toggle-switch input:checked + .cv-switch-bg {
2163
- background: #3e84f4;
2164
- }
2165
-
2166
- .cv-toggle-switch input:checked ~ .cv-switch-knob {
2167
- transform: translateX(20px);
2168
- }
2169
-
2170
- /* Dark Theme - Tab Groups */
2171
- .cv-widget-theme-dark .cv-tabgroup-card.cv-tabgroup-header {
2172
- background: #101722;
2173
- border-bottom-color: rgba(255, 255, 255, 0.1);
2174
- }
2175
-
2176
- .cv-widget-theme-dark .cv-tabgroup-card.cv-tabgroup-item {
2177
- background: #101722;
2178
- border-bottom-color: rgba(255, 255, 255, 0.05);
2179
- }
2180
-
2181
- .cv-widget-theme-dark .cv-tabgroup-title {
2182
- color: #e2e8f0;
2183
- }
2184
-
2185
- .cv-widget-theme-dark .cv-tabgroup-description {
2186
- color: rgba(255, 255, 255, 0.6);
2187
- }
2188
-
2189
- .cv-widget-theme-dark .cv-tabgroup-label {
2190
- color: rgba(255, 255, 255, 0.8);
2191
- }
2192
-
2193
- .cv-widget-theme-dark .cv-tab-groups-list {
2194
- border-color: rgba(255, 255, 255, 0.1);
2195
- }
2196
-
2197
- .cv-widget-theme-dark .cv-tabgroup-select {
2198
- background: #101722;
2199
- border-color: rgba(255, 255, 255, 0.15);
2200
- color: #e2e8f0;
2201
- }
2202
-
2203
- .cv-widget-theme-dark .cv-tabgroup-select:hover {
2204
- border-color: rgba(255, 255, 255, 0.25);
2205
- }
2206
-
2207
- .cv-widget-theme-dark .cv-tabgroup-select:focus {
2208
- border-color: #60a5fa;
2209
- box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
2210
- }
2211
-
2212
- /* Dark Theme - Toggle Switch */
2213
- .cv-widget-theme-dark .cv-toggle-switch .cv-switch-bg {
2214
- background: rgba(255, 255, 255, 0.1);
2215
- }
2216
-
2217
- .cv-widget-theme-dark .cv-toggle-switch .cv-switch-knob {
2218
- background: #e2e8f0;
2219
- }
2220
-
2221
- .cv-widget-theme-dark .cv-toggle-switch input:checked + .cv-switch-bg {
2222
- background: #63b3ed;
2223
- }
2224
-
2225
- .cv-modal-footer {
2226
- display: flex;
2227
- justify-content: space-between;
2228
- align-items: center;
2229
- padding: 0.75rem;
2230
- border-top: 1px solid rgba(0, 0, 0, 0.1);
2231
- }
2232
-
2233
- .cv-reset-btn,
2234
- .cv-share-btn {
2235
- display: flex;
2236
- align-items: center;
2237
- gap: 0.5rem;
2238
- padding: 0.375rem 0.75rem;
2239
- border-radius: 0.5rem;
2240
- font-weight: 600;
2241
- font-size: 0.875rem;
2242
- cursor: pointer;
2243
- transition: all 0.2s ease;
2244
- border: none;
2245
- }
2246
-
2247
- .cv-reset-btn {
2248
- color: rgba(0, 0, 0, 0.9);
2249
- background: rgba(0, 0, 0, 0.1);
2250
- }
2251
-
2252
- .cv-reset-btn:hover {
2253
- background: rgba(0, 0, 0, 0.2);
2254
- }
2255
-
2256
- .cv-share-btn {
2257
- color: white;
2258
- background: #3e84f4;
2259
- }
2260
-
2261
- .cv-share-btn:hover {
2262
- background: rgba(62, 132, 244, 0.9);
2263
- }
2264
-
2265
- .cv-btn-icon {
2266
- width: 1rem;
2267
- height: 1rem;
2268
- }
2269
-
2270
- /* Dark theme custom state styles */
2271
- /* Welcome modal styles */
2272
- .cv-welcome-modal {
2273
- max-width: 32rem;
2274
- width: 90vw;
2275
- background: white;
2276
- border-radius: 0.75rem;
2277
- box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
2278
- animation: slideIn 0.2s ease;
2279
- display: flex;
2280
- flex-direction: column;
2281
- }
2282
-
2283
- .cv-modal-main {
2284
- padding: 1rem;
2285
- flex: 1;
2286
- display: flex;
2287
- flex-direction: column;
2288
- gap: 1rem;
2289
- overflow-y: auto;
2290
- max-height: calc(80vh - 8rem);
2291
- }
2292
-
2293
- .cv-welcome-message {
2294
- font-size: 0.875rem;
2295
- color: rgba(0, 0, 0, 0.8);
2296
- margin: 0;
2297
- line-height: 1.4;
2298
- text-align: center;
2299
- }
2300
-
2301
- .cv-welcome-message a {
2302
- color: #3e84f4;
2303
- text-align: justify;
2304
- text-decoration: none;
2305
- }
2306
-
2307
- .cv-welcome-message a:hover {
2308
- text-decoration: underline;
2309
- }
2310
-
2311
- .cv-welcome-widget-preview {
2312
- display: flex;
2313
- align-items: center;
2314
- justify-content: center;
2315
- gap: 1rem;
2316
- padding: 1rem;
2317
- background: #f8f9fa;
2318
- border-radius: 0.5rem;
2319
- margin: 1rem 0;
2320
- }
2321
-
2322
- .cv-welcome-widget-icon {
2323
- width: 2rem;
2324
- height: 2rem;
2325
- background: rgba(62, 132, 244, 0.1);
2326
- border-radius: 9999px;
2327
- display: flex;
2328
- align-items: center;
2329
- justify-content: center;
2330
- animation: cv-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
2331
- color: #3e84f4;
2332
- }
2333
-
2334
- .cv-welcome-widget-label {
2335
- font-size: 0.875rem;
2336
- font-weight: 500;
2337
- color: rgba(0, 0, 0, 0.8);
2338
- margin: 0;
2339
- }
2340
-
2341
- .cv-welcome-got-it {
2342
- width: 100%;
2343
- background: #3e84f4;
2344
- color: white;
2345
- font-weight: 600;
2346
- padding: 0.75rem 1rem;
2347
- border-radius: 0.5rem;
2348
- border: none;
2349
- cursor: pointer;
2350
- font-size: 0.875rem;
2351
- transition: background-color 0.2s ease;
2352
- outline: none;
2353
- }
2354
-
2355
- .cv-welcome-got-it:hover {
2356
- background: rgba(62, 132, 244, 0.9);
2357
- }
2358
-
2359
- .cv-welcome-got-it:focus {
2360
- box-shadow: 0 0 0 2px rgba(62, 132, 244, 0.5);
2361
- }
2362
-
2363
- /* Animations */
2364
- @keyframes cv-pulse {
2365
- 0%, 100% {
2366
- opacity: 1;
2367
- }
2368
- 50% {
2369
- opacity: 0.5;
2370
- }
2371
- }
2372
-
2373
- /* Dark theme welcome modal styles */
2374
- .cv-widget-theme-dark .cv-welcome-modal {
2375
- background: #101722;
2376
- }
2377
-
2378
- .cv-widget-theme-dark .cv-welcome-message {
2379
- color: rgba(255, 255, 255, 0.8);
2380
- }
2381
-
2382
- .cv-widget-theme-dark .cv-welcome-message a {
2383
- color: #60a5fa;
2384
- }
2385
-
2386
- .cv-widget-theme-dark .cv-welcome-widget-preview {
2387
- background: rgba(255, 255, 255, 0.1);
2388
- }
2389
-
2390
- .cv-widget-theme-dark .cv-welcome-widget-label {
2391
- color: #e2e8f0;
2392
- }
1424
+ const WIDGET_STYLES = `
1425
+ /* Rounded rectangle widget icon styles */
1426
+ .cv-widget-icon {
1427
+ position: fixed;
1428
+ /* Slightly transparent by default so the widget is subtle at the page edge */
1429
+ background: rgba(255, 255, 255, 0.92);
1430
+ color: rgba(0, 0, 0, 0.9);
1431
+ opacity: 0.6;
1432
+ display: flex;
1433
+ align-items: center;
1434
+ justify-content: center;
1435
+ font-size: 18px;
1436
+ font-weight: bold;
1437
+ cursor: pointer;
1438
+ box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
1439
+ z-index: 9998;
1440
+ transition: all 0.3s ease;
1441
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
1442
+ }
1443
+
1444
+ .cv-widget-icon:hover {
1445
+ /* Become fully opaque on hover to improve readability */
1446
+ background: rgba(255, 255, 255, 1);
1447
+ color: rgba(0, 0, 0, 1);
1448
+ opacity: 1;
1449
+ }
1450
+
1451
+ /* Top-right: rounded end on left, sticks out leftward on hover */
1452
+ .cv-widget-top-right {
1453
+ top: 20px;
1454
+ right: 0;
1455
+ border-radius: 18px 0 0 18px;
1456
+ padding-left: 8px;
1457
+ justify-content: flex-start;
1458
+ }
1459
+
1460
+ /* Top-left: rounded end on right, sticks out rightward on hover */
1461
+ .cv-widget-top-left {
1462
+ top: 20px;
1463
+ left: 0;
1464
+ border-radius: 0 18px 18px 0;
1465
+ padding-right: 8px;
1466
+ justify-content: flex-end;
1467
+ }
1468
+
1469
+ /* Bottom-right: rounded end on left, sticks out leftward on hover */
1470
+ .cv-widget-bottom-right {
1471
+ bottom: 20px;
1472
+ right: 0;
1473
+ border-radius: 18px 0 0 18px;
1474
+ padding-left: 8px;
1475
+ justify-content: flex-start;
1476
+ }
1477
+
1478
+ /* Bottom-left: rounded end on right, sticks out rightward on hover */
1479
+ .cv-widget-bottom-left {
1480
+ bottom: 20px;
1481
+ left: 0;
1482
+ border-radius: 0 18px 18px 0;
1483
+ padding-right: 8px;
1484
+ justify-content: flex-end;
1485
+ }
1486
+
1487
+ /* Middle-left: rounded end on right, sticks out rightward on hover */
1488
+ .cv-widget-middle-left {
1489
+ top: 50%;
1490
+ left: 0;
1491
+ transform: translateY(-50%);
1492
+ border-radius: 0 18px 18px 0;
1493
+ padding-right: 8px;
1494
+ justify-content: flex-end;
1495
+ }
1496
+
1497
+ /* Middle-right: rounded end on left, sticks out leftward on hover */
1498
+ .cv-widget-middle-right {
1499
+ top: 50%;
1500
+ right: 0;
1501
+ transform: translateY(-50%);
1502
+ border-radius: 18px 0 0 18px;
1503
+ padding-left: 8px;
1504
+ justify-content: flex-start;
1505
+ }
1506
+
1507
+ .cv-widget-top-right,
1508
+ .cv-widget-middle-right,
1509
+ .cv-widget-bottom-right,
1510
+ .cv-widget-top-left,
1511
+ .cv-widget-middle-left,
1512
+ .cv-widget-bottom-left {
1513
+ height: 36px;
1514
+ width: 36px;
1515
+ }
1516
+
1517
+ .cv-widget-middle-right:hover,
1518
+ .cv-widget-top-right:hover,
1519
+ .cv-widget-bottom-right:hover,
1520
+ .cv-widget-top-left:hover,
1521
+ .cv-widget-middle-left:hover,
1522
+ .cv-widget-bottom-left:hover {
1523
+ width: 55px;
1524
+ }
1525
+
1526
+ /* Modal content styles */
1527
+ .cv-widget-section {
1528
+ margin-bottom: 16px;
1529
+ }
1530
+
1531
+ .cv-widget-section:last-child {
1532
+ margin-bottom: 0;
1533
+ }
1534
+
1535
+ .cv-widget-section label {
1536
+ display: block;
1537
+ margin-bottom: 4px;
1538
+ font-weight: 500;
1539
+ color: #555;
1540
+ }
1541
+
1542
+ .cv-widget-profile-select,
1543
+ .cv-widget-state-select {
1544
+ width: 100%;
1545
+ padding: 8px 12px;
1546
+ border: 1px solid #ddd;
1547
+ border-radius: 4px;
1548
+ background: white;
1549
+ font-size: 14px;
1550
+ }
1551
+
1552
+ .cv-widget-profile-select:focus,
1553
+ .cv-widget-state-select:focus {
1554
+ outline: none;
1555
+ border-color: #007bff;
1556
+ box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
1557
+ }
1558
+
1559
+ .cv-widget-profile-select:disabled,
1560
+ .cv-widget-state-select:disabled {
1561
+ background: #f8f9fa;
1562
+ color: #6c757d;
1563
+ cursor: not-allowed;
1564
+ }
1565
+
1566
+ .cv-widget-current {
1567
+ margin: 16px 0;
1568
+ padding: 12px;
1569
+ background: #f8f9fa;
1570
+ border-radius: 4px;
1571
+ border-left: 4px solid #007bff;
1572
+ }
1573
+
1574
+ .cv-widget-current label {
1575
+ font-size: 12px;
1576
+ text-transform: uppercase;
1577
+ letter-spacing: 0.5px;
1578
+ color: #666;
1579
+ margin-bottom: 4px;
1580
+ }
1581
+
1582
+ .cv-widget-current-view {
1583
+ font-weight: 500;
1584
+ color: #333;
1585
+ }
1586
+
1587
+ .cv-widget-reset {
1588
+ width: 100%;
1589
+ padding: 8px 16px;
1590
+ background: #dc3545;
1591
+ color: white;
1592
+ border: none;
1593
+ border-radius: 4px;
1594
+ cursor: pointer;
1595
+ font-size: 14px;
1596
+ font-weight: 500;
1597
+ }
1598
+
1599
+ .cv-widget-reset:hover {
1600
+ background: #c82333;
1601
+ }
1602
+
1603
+ .cv-widget-reset:active {
1604
+ background: #bd2130;
1605
+ }
1606
+
1607
+ /* Responsive design for mobile */
1608
+ @media (max-width: 768px) {
1609
+ .cv-widget-top-right,
1610
+ .cv-widget-top-left {
1611
+ top: 10px;
1612
+ }
1613
+
1614
+ .cv-widget-bottom-right,
1615
+ .cv-widget-bottom-left {
1616
+ bottom: 10px;
1617
+ }
1618
+
1619
+ /* All widgets stay flush with screen edges */
1620
+ .cv-widget-top-right,
1621
+ .cv-widget-bottom-right,
1622
+ .cv-widget-middle-right {
1623
+ right: 0;
1624
+ }
1625
+
1626
+ .cv-widget-top-left,
1627
+ .cv-widget-bottom-left,
1628
+ .cv-widget-middle-left {
1629
+ left: 0;
1630
+ }
1631
+
1632
+ /* Slightly smaller on mobile */
1633
+ .cv-widget-icon {
1634
+ width: 60px;
1635
+ height: 32px;
1636
+ }
1637
+
1638
+ .cv-widget-icon:hover {
1639
+ width: 75px;
1640
+ }
1641
+ }
1642
+
1643
+ /* Modal styles */
1644
+ .cv-widget-modal-overlay {
1645
+ position: fixed;
1646
+ top: 0;
1647
+ left: 0;
1648
+ right: 0;
1649
+ bottom: 0;
1650
+ background: rgba(0, 0, 0, 0.5);
1651
+ display: flex;
1652
+ align-items: center;
1653
+ justify-content: center;
1654
+ z-index: 10002;
1655
+ animation: fadeIn 0.2s ease;
1656
+ }
1657
+
1658
+ @keyframes fadeIn {
1659
+ from { opacity: 0; }
1660
+ to { opacity: 1; }
1661
+ }
1662
+
1663
+ .cv-widget-modal {
1664
+ background: white;
1665
+ border-radius: 0.75rem;
1666
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
1667
+ max-width: 32rem;
1668
+ width: 90vw;
1669
+ max-height: 80vh;
1670
+ animation: slideIn 0.2s ease;
1671
+ display: flex;
1672
+ flex-direction: column;
1673
+ }
1674
+
1675
+ @keyframes slideIn {
1676
+ from {
1677
+ opacity: 0;
1678
+ transform: scale(0.9) translateY(-20px);
1679
+ }
1680
+ to {
1681
+ opacity: 1;
1682
+ transform: scale(1) translateY(0);
1683
+ }
1684
+ }
1685
+
1686
+ .cv-modal-header {
1687
+ display: flex;
1688
+ align-items: center;
1689
+ justify-content: space-between;
1690
+ padding: 0.5rem 1rem;
1691
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1692
+ }
1693
+
1694
+ .cv-modal-header-content {
1695
+ display: flex;
1696
+ align-items: center;
1697
+ gap: 0.75rem;
1698
+ }
1699
+
1700
+ .cv-modal-icon {
1701
+ position: relative;
1702
+ width: 1rem;
1703
+ height: 1rem;
1704
+ display: flex;
1705
+ align-items: center;
1706
+ justify-content: center;
1707
+ border-radius: 9999px;
1708
+ }
1709
+
1710
+ .cv-modal-icon-svg {
1711
+ width: 100%;
1712
+ height: 100%;
1713
+ opacity: 1;
1714
+ }
1715
+
1716
+ .cv-modal-title {
1717
+ font-size: 1.125rem;
1718
+ font-weight: bold;
1719
+ color: rgba(0, 0, 0, 0.9);
1720
+ margin: 0;
1721
+ }
1722
+
1723
+ .cv-modal-close {
1724
+ width: 2rem;
1725
+ height: 2rem;
1726
+ display: flex;
1727
+ align-items: center;
1728
+ justify-content: center;
1729
+ border-radius: 9999px;
1730
+ background: transparent;
1731
+ border: none;
1732
+ color: rgba(0, 0, 0, 0.6);
1733
+ cursor: pointer;
1734
+ transition: all 0.2s ease;
1735
+ }
1736
+
1737
+ .cv-modal-close:hover {
1738
+ background: rgba(62, 132, 244, 0.1);
1739
+ color: #3e84f4;
1740
+ }
1741
+
1742
+ .cv-modal-close-icon {
1743
+ width: 1.25rem;
1744
+ height: 1.25rem;
1745
+ }
1746
+
1747
+ .cv-modal-main {
1748
+ padding: 1rem;
1749
+ flex: 1;
1750
+ display: flex;
1751
+ flex-direction: column;
1752
+ gap: 1rem;
1753
+ overflow-y: auto;
1754
+ max-height: calc(80vh - 8rem);
1755
+ }
1756
+
1757
+ .cv-modal-description {
1758
+ font-size: 0.875rem;
1759
+ color: rgba(0, 0, 0, 0.8);
1760
+ margin: 0;
1761
+ line-height: 1.4;
1762
+ }
1763
+
1764
+ .cv-content-section,
1765
+ .cv-tab-groups-section {
1766
+ display: flex;
1767
+ flex-direction: column;
1768
+ gap: 0.75rem;
1769
+ }
1770
+
1771
+ .cv-section-heading {
1772
+ font-size: 1rem;
1773
+ font-weight: bold;
1774
+ color: rgba(0, 0, 0, 0.9);
1775
+ margin: 0;
1776
+ }
1777
+
1778
+ .cv-widget-modal-actions {
1779
+ margin-top: 20px;
1780
+ padding-top: 16px;
1781
+ border-top: 1px solid #e9ecef;
1782
+ }
1783
+
1784
+ .cv-widget-restore {
1785
+ width: 100%;
1786
+ padding: 10px 16px;
1787
+ background: #28a745;
1788
+ color: white;
1789
+ border: none;
1790
+ border-radius: 4px;
1791
+ cursor: pointer;
1792
+ font-size: 14px;
1793
+ font-weight: 500;
1794
+ }
1795
+
1796
+ .cv-widget-restore:hover {
1797
+ background: #218838;
1798
+ }
1799
+
1800
+ .cv-widget-create-state {
1801
+ width: 100%;
1802
+ padding: 10px 16px;
1803
+ background: #007bff;
1804
+ color: white;
1805
+ border: none;
1806
+ border-radius: 4px;
1807
+ cursor: pointer;
1808
+ font-size: 14px;
1809
+ font-weight: 500;
1810
+ margin-bottom: 10px;
1811
+ }
1812
+
1813
+ .cv-widget-create-state:hover {
1814
+ background: #0056b3;
1815
+ }
1816
+
1817
+ .cv-widget-theme-dark .cv-widget-modal {
1818
+ background: #101722;
1819
+ color: #e2e8f0;
1820
+ }
1821
+
1822
+ .cv-widget-theme-dark .cv-modal-header {
1823
+ border-color: rgba(255, 255, 255, 0.1);
1824
+ }
1825
+
1826
+ .cv-widget-theme-dark .cv-modal-title {
1827
+ color: #e2e8f0;
1828
+ }
1829
+
1830
+ .cv-widget-theme-dark .cv-modal-close {
1831
+ color: rgba(255, 255, 255, 0.6);
1832
+ }
1833
+
1834
+ .cv-widget-theme-dark .cv-modal-close:hover {
1835
+ background: rgba(62, 132, 244, 0.2);
1836
+ color: #3e84f4;
1837
+ }
1838
+
1839
+ .cv-widget-theme-dark .cv-modal-description {
1840
+ color: rgba(255, 255, 255, 0.8);
1841
+ }
1842
+
1843
+ .cv-widget-theme-dark .cv-section-heading {
1844
+ color: #e2e8f0;
1845
+ }
1846
+
1847
+ .cv-widget-theme-dark .cv-toggles-container
1848
+ .cv-widget-theme-dark .cv-tabgroups-container {
1849
+ border-color: rgba(255, 255, 255, 0.1);
1850
+ }
1851
+
1852
+ .cv-widget-theme-dark .cv-toggle-card,
1853
+ .cv-widget-theme-dark .cv-tabgroup-card {
1854
+ background: #101722;
1855
+ border-color: rgba(255, 255, 255, 0.1);
1856
+ }
1857
+
1858
+ .cv-widget-theme-dark .cv-toggle-title,
1859
+ .cv-widget-theme-dark .cv-tabgroup-title {
1860
+ color: #e2e8f0;
1861
+ }
1862
+
1863
+ .cv-widget-theme-dark .cv-toggle-description,
1864
+ .cv-widget-theme-dark .cv-tabgroup-description {
1865
+ color: rgba(255, 255, 255, 0.6);
1866
+ }
1867
+
1868
+ .cv-widget-theme-dark .cv-toggle-slider {
1869
+ background: rgba(255, 255, 255, 0.2);
1870
+ }
1871
+
1872
+ .cv-widget-theme-dark .cv-tab-group-description {
1873
+ color: rgba(255, 255, 255, 0.8);
1874
+ }
1875
+
1876
+ .cv-widget-theme-dark .cv-tabgroup-select {
1877
+ background: #101722;
1878
+ border-color: rgba(255, 255, 255, 0.2);
1879
+ color: #e2e8f0;
1880
+ }
1881
+
1882
+ .cv-widget-theme-dark .cv-modal-footer {
1883
+ border-color: rgba(255, 255, 255, 0.1);
1884
+ background: #101722;
1885
+ }
1886
+
1887
+ .cv-widget-theme-dark .cv-reset-btn {
1888
+ color: #e2e8f0;
1889
+ background: rgba(255, 255, 255, 0.1);
1890
+ }
1891
+
1892
+ .cv-widget-theme-dark .cv-reset-btn:hover {
1893
+ background: rgba(255, 255, 255, 0.2);
1894
+ }
1895
+
1896
+ /* Custom state creator styles */
1897
+ .cv-custom-state-modal {
1898
+ max-width: 500px;
1899
+ }
1900
+
1901
+ .cv-custom-state-form .cv-section-header {
1902
+ font-size: 16px;
1903
+ font-weight: 600;
1904
+ color: #333;
1905
+ border-bottom: 1px solid #e9ecef;
1906
+ padding-bottom: 5px;
1907
+ }
1908
+
1909
+ .cv-custom-state-form p {
1910
+ font-size: 15px;
1911
+ line-height: 1.6;
1912
+ color: #555;
1913
+ margin-bottom: 24px;
1914
+ text-align: justify;
1915
+ }
1916
+
1917
+ .cv-custom-state-section {
1918
+ margin-bottom: 16px;
1919
+ }
1920
+
1921
+ .cv-custom-state-section label {
1922
+ display: block;
1923
+ margin-bottom: 4px;
1924
+ font-weight: 500;
1925
+ color: #555;
1926
+ }
1927
+
1928
+ .cv-custom-state-input {
1929
+ width: 100%;
1930
+ padding: 8px 12px;
1931
+ border: 1px solid #ddd;
1932
+ border-radius: 4px;
1933
+ background: white;
1934
+ font-size: 14px;
1935
+ }
1936
+
1937
+ .cv-custom-state-input:focus {
1938
+ outline: none;
1939
+ border-color: #007bff;
1940
+ box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
1941
+ }
1942
+
1943
+ /* Toggles Container */
1944
+ .cv-toggles-container {
1945
+ display: flex;
1946
+ flex-direction: column;
1947
+ gap: 0.5rem;
1948
+ border-radius: 0.5rem;
1949
+ border: 1px solid rgba(0, 0, 0, 0.1);
1950
+ overflow: hidden;
1951
+ }
1952
+
1953
+ .cv-toggle-card,
1954
+ .cv-tabgroup-card {
1955
+ background: white;
1956
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
1957
+ }
1958
+
1959
+ .cv-toggle-card:last-child {
1960
+ border-bottom: none;
1961
+ }
1962
+
1963
+ .cv-toggle-content {
1964
+ display: flex;
1965
+ align-items: center;
1966
+ justify-content: space-between;
1967
+ padding: 0.75rem;
1968
+ }
1969
+
1970
+ .cv-toggle-title {
1971
+ font-weight: 500;
1972
+ font-size: 0.875rem;
1973
+ color: rgba(0, 0, 0, 0.9);
1974
+ margin: 0 0 0.125rem 0;
1975
+ }
1976
+
1977
+ .cv-toggle-description {
1978
+ font-size: 0.75rem;
1979
+ color: rgba(0, 0, 0, 0.6);
1980
+ margin: 0;
1981
+ }
1982
+
1983
+ .cv-toggle-label{
1984
+ position: relative;
1985
+ display: inline-block;
1986
+ width: 2.75rem;
1987
+ height: 1.5rem;
1988
+ cursor: pointer;
1989
+ }
1990
+
1991
+ .cv-toggle-input {
1992
+ opacity: 0;
1993
+ width: 0;
1994
+ height: 0;
1995
+ }
1996
+
1997
+ .cv-toggle-slider {
1998
+ position: absolute;
1999
+ top: 0;
2000
+ left: 0;
2001
+ right: 0;
2002
+ bottom: 0;
2003
+ background: rgba(0, 0, 0, 0.2);
2004
+ border-radius: 9999px;
2005
+ transition: background-color 0.2s ease;
2006
+ }
2007
+
2008
+ .cv-toggle-slider:before {
2009
+ position: absolute;
2010
+ content: "";
2011
+ height: 1rem;
2012
+ width: 1rem;
2013
+ left: 0.25rem;
2014
+ bottom: 0.25rem;
2015
+ background: white;
2016
+ border-radius: 50%;
2017
+ transition: transform 0.2s ease;
2018
+ }
2019
+
2020
+ .cv-toggle-input:checked + .cv-toggle-slider {
2021
+ background: #3e84f4;
2022
+ }
2023
+
2024
+ .cv-toggle-input:checked + .cv-toggle-slider:before {
2025
+ transform: translateX(1.25rem);
2026
+ }
2027
+
2028
+ /* Dark theme toggle switch styles */
2029
+ .cv-widget-theme-dark .cv-toggle-switch {
2030
+ background: #4a5568;
2031
+ }
2032
+
2033
+ .cv-widget-theme-dark .cv-toggle-switch:hover {
2034
+ background: #5a6578;
2035
+ }
2036
+
2037
+ .cv-widget-theme-dark .cv-toggle-switch.cv-toggle-active {
2038
+ background: #63b3ed;
2039
+ }
2040
+
2041
+ .cv-widget-theme-dark .cv-toggle-switch.cv-toggle-active:hover {
2042
+ background: #4299e1;
2043
+ }
2044
+
2045
+ /* Tab Groups Container */
2046
+ .cv-tab-groups-list {
2047
+ display: flex;
2048
+ flex-direction: column;
2049
+ gap: 1px;
2050
+ border: 1px solid rgba(0, 0, 0, 0.1);
2051
+ border-radius: 0.5rem;
2052
+ overflow: hidden;
2053
+ }
2054
+
2055
+ /* Tab Group Card - Header (Navigation Headers toggle) */
2056
+ .cv-tabgroup-card.cv-tabgroup-header {
2057
+ display: flex;
2058
+ align-items: center;
2059
+ justify-content: space-between;
2060
+ padding: 0.75rem;
2061
+ border-bottom: 0px;
2062
+ }
2063
+
2064
+ .cv-tabgroup-card.cv-tabgroup-header .cv-tabgroup-row {
2065
+ display: flex;
2066
+ align-items: center;
2067
+ justify-content: space-between;
2068
+ width: 100%;
2069
+ gap: 1rem;
2070
+ }
2071
+
2072
+ /* Tab Group Card - Items */
2073
+ .cv-tabgroup-card.cv-tabgroup-item {
2074
+ display: flex;
2075
+ flex-direction: column;
2076
+ gap: 0.5rem;
2077
+ padding: 0.75rem;
2078
+ background: white;
2079
+ border-bottom: 1px solid rgba(0, 0, 0, 0.05);
2080
+ }
2081
+
2082
+ .cv-tabgroup-card.cv-tabgroup-item:last-child {
2083
+ border-bottom: none;
2084
+ }
2085
+
2086
+ /* Tab Group Info */
2087
+ .cv-tabgroup-info {
2088
+ flex: 1;
2089
+ }
2090
+
2091
+ .cv-tabgroup-title {
2092
+ font-weight: 500;
2093
+ font-size: 0.875rem;
2094
+ color: rgba(0, 0, 0, 0.9);
2095
+ margin: 0 0 0.25rem 0;
2096
+ }
2097
+
2098
+ .cv-tabgroup-description {
2099
+ font-size: 0.75rem;
2100
+ color: rgba(0, 0, 0, 0.6);
2101
+ margin: 0;
2102
+ line-height: 1.3;
2103
+ }
2104
+
2105
+ /* Tab Group Label (for select dropdowns) */
2106
+ .cv-tabgroup-label {
2107
+ font-size: 0.875rem;
2108
+ color: rgba(0, 0, 0, 0.8);
2109
+ margin: 0;
2110
+ line-height: 1.4;
2111
+ font-weight: 500;
2112
+ display: block;
2113
+ cursor: pointer;
2114
+ }
2115
+
2116
+ /* Tab Group Select */
2117
+ .cv-tabgroup-select {
2118
+ width: 100%;
2119
+ border-radius: 0.5rem;
2120
+ background: white;
2121
+ border: 1px solid rgba(0, 0, 0, 0.15);
2122
+ color: rgba(0, 0, 0, 0.9);
2123
+ padding: 0.5rem 0.75rem;
2124
+ font-size: 0.875rem;
2125
+ cursor: pointer;
2126
+ transition: all 0.15s ease;
2127
+ font-family: inherit;
2128
+ }
2129
+
2130
+ .cv-tabgroup-select:hover {
2131
+ border-color: rgba(0, 0, 0, 0.25);
2132
+ }
2133
+
2134
+ .cv-tabgroup-select:focus {
2135
+ outline: none;
2136
+ border-color: #3e84f4;
2137
+ box-shadow: 0 0 0 2px rgba(62, 132, 244, 0.2);
2138
+ }
2139
+
2140
+ /* Modern Toggle Switch */
2141
+ .cv-toggle-switch {
2142
+ position: relative;
2143
+ display: inline-flex;
2144
+ align-items: center;
2145
+ width: 44px;
2146
+ height: 24px;
2147
+ background: rgba(0, 0, 0, 0.1);
2148
+ border-radius: 9999px;
2149
+ padding: 2px;
2150
+ box-sizing: border-box;
2151
+ cursor: pointer;
2152
+ transition: background-color 0.2s ease;
2153
+ border: none;
2154
+ }
2155
+
2156
+ .cv-toggle-switch input {
2157
+ display: none;
2158
+ }
2159
+
2160
+ .cv-toggle-switch .cv-switch-bg {
2161
+ position: absolute;
2162
+ inset: 0;
2163
+ border-radius: 9999px;
2164
+ background: rgba(0, 0, 0, 0.1);
2165
+ transition: background-color 0.2s ease;
2166
+ pointer-events: none;
2167
+ }
2168
+
2169
+ .cv-toggle-switch .cv-switch-knob {
2170
+ position: relative;
2171
+ width: 20px;
2172
+ height: 20px;
2173
+ background: white;
2174
+ border-radius: 50%;
2175
+ box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
2176
+ transition: transform 0.2s ease;
2177
+ z-index: 1;
2178
+ }
2179
+
2180
+ .cv-toggle-switch input:checked + .cv-switch-bg {
2181
+ background: #3e84f4;
2182
+ }
2183
+
2184
+ .cv-toggle-switch input:checked ~ .cv-switch-knob {
2185
+ transform: translateX(20px);
2186
+ }
2187
+
2188
+ /* Dark Theme - Tab Groups */
2189
+ .cv-widget-theme-dark .cv-tabgroup-card.cv-tabgroup-header {
2190
+ background: #101722;
2191
+ border-bottom-color: rgba(255, 255, 255, 0.1);
2192
+ }
2193
+
2194
+ .cv-widget-theme-dark .cv-tabgroup-card.cv-tabgroup-item {
2195
+ background: #101722;
2196
+ border-bottom-color: rgba(255, 255, 255, 0.05);
2197
+ }
2198
+
2199
+ .cv-widget-theme-dark .cv-tabgroup-title {
2200
+ color: #e2e8f0;
2201
+ }
2202
+
2203
+ .cv-widget-theme-dark .cv-tabgroup-description {
2204
+ color: rgba(255, 255, 255, 0.6);
2205
+ }
2206
+
2207
+ .cv-widget-theme-dark .cv-tabgroup-label {
2208
+ color: rgba(255, 255, 255, 0.8);
2209
+ }
2210
+
2211
+ .cv-widget-theme-dark .cv-tab-groups-list {
2212
+ border-color: rgba(255, 255, 255, 0.1);
2213
+ }
2214
+
2215
+ .cv-widget-theme-dark .cv-tabgroup-select {
2216
+ background: #101722;
2217
+ border-color: rgba(255, 255, 255, 0.15);
2218
+ color: #e2e8f0;
2219
+ }
2220
+
2221
+ .cv-widget-theme-dark .cv-tabgroup-select:hover {
2222
+ border-color: rgba(255, 255, 255, 0.25);
2223
+ }
2224
+
2225
+ .cv-widget-theme-dark .cv-tabgroup-select:focus {
2226
+ border-color: #60a5fa;
2227
+ box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.2);
2228
+ }
2229
+
2230
+ /* Dark Theme - Toggle Switch */
2231
+ .cv-widget-theme-dark .cv-toggle-switch .cv-switch-bg {
2232
+ background: rgba(255, 255, 255, 0.1);
2233
+ }
2234
+
2235
+ .cv-widget-theme-dark .cv-toggle-switch .cv-switch-knob {
2236
+ background: #e2e8f0;
2237
+ }
2238
+
2239
+ .cv-widget-theme-dark .cv-toggle-switch input:checked + .cv-switch-bg {
2240
+ background: #63b3ed;
2241
+ }
2242
+
2243
+ .cv-modal-footer {
2244
+ display: flex;
2245
+ justify-content: space-between;
2246
+ align-items: center;
2247
+ padding: 0.75rem;
2248
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
2249
+ }
2250
+
2251
+ .cv-reset-btn,
2252
+ .cv-share-btn {
2253
+ display: flex;
2254
+ align-items: center;
2255
+ gap: 0.5rem;
2256
+ padding: 0.375rem 0.75rem;
2257
+ border-radius: 0.5rem;
2258
+ font-weight: 600;
2259
+ font-size: 0.875rem;
2260
+ cursor: pointer;
2261
+ transition: all 0.2s ease;
2262
+ border: none;
2263
+ }
2264
+
2265
+ .cv-reset-btn {
2266
+ color: rgba(0, 0, 0, 0.9);
2267
+ background: rgba(0, 0, 0, 0.1);
2268
+ }
2269
+
2270
+ .cv-reset-btn:hover {
2271
+ background: rgba(0, 0, 0, 0.2);
2272
+ }
2273
+
2274
+ .cv-share-btn {
2275
+ color: white;
2276
+ background: #3e84f4;
2277
+ }
2278
+
2279
+ .cv-share-btn:hover {
2280
+ background: rgba(62, 132, 244, 0.9);
2281
+ }
2282
+
2283
+ .cv-btn-icon {
2284
+ width: 1rem;
2285
+ height: 1rem;
2286
+ }
2287
+
2288
+ /* Dark theme custom state styles */
2289
+ /* Welcome modal styles */
2290
+ .cv-welcome-modal {
2291
+ max-width: 32rem;
2292
+ width: 90vw;
2293
+ background: white;
2294
+ border-radius: 0.75rem;
2295
+ box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
2296
+ animation: slideIn 0.2s ease;
2297
+ display: flex;
2298
+ flex-direction: column;
2299
+ }
2300
+
2301
+ .cv-modal-main {
2302
+ padding: 1rem;
2303
+ flex: 1;
2304
+ display: flex;
2305
+ flex-direction: column;
2306
+ gap: 1rem;
2307
+ overflow-y: auto;
2308
+ max-height: calc(80vh - 8rem);
2309
+ }
2310
+
2311
+ .cv-welcome-message {
2312
+ font-size: 0.875rem;
2313
+ color: rgba(0, 0, 0, 0.8);
2314
+ margin: 0;
2315
+ line-height: 1.4;
2316
+ text-align: center;
2317
+ }
2318
+
2319
+ .cv-welcome-message a {
2320
+ color: #3e84f4;
2321
+ text-align: justify;
2322
+ text-decoration: none;
2323
+ }
2324
+
2325
+ .cv-welcome-message a:hover {
2326
+ text-decoration: underline;
2327
+ }
2328
+
2329
+ .cv-welcome-widget-preview {
2330
+ display: flex;
2331
+ align-items: center;
2332
+ justify-content: center;
2333
+ gap: 1rem;
2334
+ padding: 1rem;
2335
+ background: #f8f9fa;
2336
+ border-radius: 0.5rem;
2337
+ margin: 1rem 0;
2338
+ }
2339
+
2340
+ .cv-welcome-widget-icon {
2341
+ width: 2rem;
2342
+ height: 2rem;
2343
+ background: rgba(62, 132, 244, 0.1);
2344
+ border-radius: 9999px;
2345
+ display: flex;
2346
+ align-items: center;
2347
+ justify-content: center;
2348
+ animation: cv-pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
2349
+ color: #3e84f4;
2350
+ }
2351
+
2352
+ .cv-welcome-widget-label {
2353
+ font-size: 0.875rem;
2354
+ font-weight: 500;
2355
+ color: rgba(0, 0, 0, 0.8);
2356
+ margin: 0;
2357
+ }
2358
+
2359
+ .cv-welcome-got-it {
2360
+ width: 100%;
2361
+ background: #3e84f4;
2362
+ color: white;
2363
+ font-weight: 600;
2364
+ padding: 0.75rem 1rem;
2365
+ border-radius: 0.5rem;
2366
+ border: none;
2367
+ cursor: pointer;
2368
+ font-size: 0.875rem;
2369
+ transition: background-color 0.2s ease;
2370
+ outline: none;
2371
+ }
2372
+
2373
+ .cv-welcome-got-it:hover {
2374
+ background: rgba(62, 132, 244, 0.9);
2375
+ }
2376
+
2377
+ .cv-welcome-got-it:focus {
2378
+ box-shadow: 0 0 0 2px rgba(62, 132, 244, 0.5);
2379
+ }
2380
+
2381
+ /* Animations */
2382
+ @keyframes cv-pulse {
2383
+ 0%, 100% {
2384
+ opacity: 1;
2385
+ }
2386
+ 50% {
2387
+ opacity: 0.5;
2388
+ }
2389
+ }
2390
+
2391
+ /* Dark theme welcome modal styles */
2392
+ .cv-widget-theme-dark .cv-welcome-modal {
2393
+ background: #101722;
2394
+ }
2395
+
2396
+ .cv-widget-theme-dark .cv-welcome-message {
2397
+ color: rgba(255, 255, 255, 0.8);
2398
+ }
2399
+
2400
+ .cv-widget-theme-dark .cv-welcome-message a {
2401
+ color: #60a5fa;
2402
+ }
2403
+
2404
+ .cv-widget-theme-dark .cv-welcome-widget-preview {
2405
+ background: rgba(255, 255, 255, 0.1);
2406
+ }
2407
+
2408
+ .cv-widget-theme-dark .cv-welcome-widget-label {
2409
+ color: #e2e8f0;
2410
+ }
2393
2411
  `;
2394
2412
  /**
2395
2413
  * Inject widget styles into the document head
@@ -2412,34 +2430,34 @@ function injectWidgetStyles() {
2412
2430
  * Settings gear icon for modal header
2413
2431
  */
2414
2432
  function getGearIcon() {
2415
- return `<svg class="cv-modal-icon-svg" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2416
- <path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M12 8.00002C9.79085 8.00002 7.99999 9.79088 7.99999 12C7.99999 14.2092 9.79085 16 12 16C14.2091 16 16 14.2092 16 12C16 9.79088 14.2091 8.00002 12 8.00002ZM9.99999 12C9.99999 10.8955 10.8954 10 12 10C13.1046 10 14 10.8955 14 12C14 13.1046 13.1046 14 12 14C10.8954 14 9.99999 13.1046 9.99999 12Z" fill="#0F1729"/>
2417
- <path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M10.7673 1.01709C10.9925 0.999829 11.2454 0.99993 11.4516 1.00001L12.5484 1.00001C12.7546 0.99993 13.0075 0.999829 13.2327 1.01709C13.4989 1.03749 13.8678 1.08936 14.2634 1.26937C14.7635 1.49689 15.1915 1.85736 15.5007 2.31147C15.7454 2.67075 15.8592 3.0255 15.9246 3.2843C15.9799 3.50334 16.0228 3.75249 16.0577 3.9557L16.1993 4.77635L16.2021 4.77788C16.2369 4.79712 16.2715 4.81659 16.306 4.8363L16.3086 4.83774L17.2455 4.49865C17.4356 4.42978 17.6693 4.34509 17.8835 4.28543C18.1371 4.2148 18.4954 4.13889 18.9216 4.17026C19.4614 4.20998 19.9803 4.39497 20.4235 4.70563C20.7734 4.95095 21.0029 5.23636 21.1546 5.4515C21.2829 5.63326 21.4103 5.84671 21.514 6.02029L22.0158 6.86003C22.1256 7.04345 22.2594 7.26713 22.3627 7.47527C22.4843 7.7203 22.6328 8.07474 22.6777 8.52067C22.7341 9.08222 22.6311 9.64831 22.3803 10.1539C22.1811 10.5554 21.9171 10.8347 21.7169 11.0212C21.5469 11.1795 21.3428 11.3417 21.1755 11.4746L20.5 12L21.1755 12.5254C21.3428 12.6584 21.5469 12.8205 21.7169 12.9789C21.9171 13.1653 22.1811 13.4446 22.3802 13.8461C22.631 14.3517 22.7341 14.9178 22.6776 15.4794C22.6328 15.9253 22.4842 16.2797 22.3626 16.5248C22.2593 16.7329 22.1255 16.9566 22.0158 17.14L21.5138 17.9799C21.4102 18.1535 21.2828 18.3668 21.1546 18.5485C21.0028 18.7637 20.7734 19.0491 20.4234 19.2944C19.9803 19.6051 19.4613 19.7901 18.9216 19.8298C18.4954 19.8612 18.1371 19.7852 17.8835 19.7146C17.6692 19.6549 17.4355 19.5703 17.2454 19.5014L16.3085 19.1623L16.306 19.1638C16.2715 19.1835 16.2369 19.2029 16.2021 19.2222L16.1993 19.2237L16.0577 20.0443C16.0228 20.2475 15.9799 20.4967 15.9246 20.7157C15.8592 20.9745 15.7454 21.3293 15.5007 21.6886C15.1915 22.1427 14.7635 22.5032 14.2634 22.7307C13.8678 22.9107 13.4989 22.9626 13.2327 22.983C13.0074 23.0002 12.7546 23.0001 12.5484 23H11.4516C11.2454 23.0001 10.9925 23.0002 10.7673 22.983C10.5011 22.9626 10.1322 22.9107 9.73655 22.7307C9.23648 22.5032 8.80849 22.1427 8.49926 21.6886C8.25461 21.3293 8.14077 20.9745 8.07542 20.7157C8.02011 20.4967 7.97723 20.2475 7.94225 20.0443L7.80068 19.2237L7.79791 19.2222C7.7631 19.2029 7.72845 19.1835 7.69396 19.1637L7.69142 19.1623L6.75458 19.5014C6.5645 19.5702 6.33078 19.6549 6.11651 19.7146C5.86288 19.7852 5.50463 19.8611 5.07841 19.8298C4.53866 19.7901 4.01971 19.6051 3.57654 19.2944C3.2266 19.0491 2.99714 18.7637 2.84539 18.5485C2.71718 18.3668 2.58974 18.1534 2.4861 17.9798L1.98418 17.14C1.87447 16.9566 1.74067 16.7329 1.63737 16.5248C1.51575 16.2797 1.36719 15.9253 1.32235 15.4794C1.26588 14.9178 1.36897 14.3517 1.61976 13.8461C1.81892 13.4446 2.08289 13.1653 2.28308 12.9789C2.45312 12.8205 2.65717 12.6584 2.82449 12.5254L3.47844 12.0054V11.9947L2.82445 11.4746C2.65712 11.3417 2.45308 11.1795 2.28304 11.0212C2.08285 10.8347 1.81888 10.5554 1.61972 10.1539C1.36893 9.64832 1.26584 9.08224 1.3223 8.52069C1.36714 8.07476 1.51571 7.72032 1.63732 7.47528C1.74062 7.26715 1.87443 7.04347 1.98414 6.86005L2.48605 6.02026C2.58969 5.84669 2.71714 5.63326 2.84534 5.45151C2.9971 5.23637 3.22655 4.95096 3.5765 4.70565C4.01966 4.39498 4.53862 4.20999 5.07837 4.17027C5.50458 4.1389 5.86284 4.21481 6.11646 4.28544C6.33072 4.34511 6.56444 4.4298 6.75451 4.49867L7.69141 4.83775L7.69394 4.8363C7.72844 4.8166 7.7631 4.79712 7.79791 4.77788L7.80068 4.77635L7.94225 3.95571C7.97723 3.7525 8.02011 3.50334 8.07542 3.2843C8.14077 3.0255 8.25461 2.67075 8.49926 2.31147C8.80849 1.85736 9.23648 1.49689 9.73655 1.26937C10.1322 1.08936 10.5011 1.03749 10.7673 1.01709ZM14.0938 4.3363C14.011 3.85634 13.9696 3.61637 13.8476 3.43717C13.7445 3.2858 13.6019 3.16564 13.4352 3.0898C13.2378 3.00002 12.9943 3.00002 12.5073 3.00002H11.4927C11.0057 3.00002 10.7621 3.00002 10.5648 3.0898C10.3981 3.16564 10.2555 3.2858 10.1524 3.43717C10.0304 3.61637 9.98895 3.85634 9.90615 4.3363L9.75012 5.24064C9.69445 5.56333 9.66662 5.72467 9.60765 5.84869C9.54975 5.97047 9.50241 6.03703 9.40636 6.13166C9.30853 6.22804 9.12753 6.3281 8.76554 6.52822C8.73884 6.54298 8.71227 6.55791 8.68582 6.57302C8.33956 6.77078 8.16643 6.86966 8.03785 6.90314C7.91158 6.93602 7.83293 6.94279 7.70289 6.93196C7.57049 6.92094 7.42216 6.86726 7.12551 6.7599L6.11194 6.39308C5.66271 6.2305 5.43809 6.14921 5.22515 6.16488C5.04524 6.17811 4.87225 6.23978 4.72453 6.34333C4.5497 6.46589 4.42715 6.67094 4.18206 7.08103L3.72269 7.84965C3.46394 8.2826 3.33456 8.49907 3.31227 8.72078C3.29345 8.90796 3.32781 9.09665 3.41141 9.26519C3.51042 9.4648 3.7078 9.62177 4.10256 9.9357L4.82745 10.5122C5.07927 10.7124 5.20518 10.8126 5.28411 10.9199C5.36944 11.036 5.40583 11.1114 5.44354 11.2504C5.47844 11.379 5.47844 11.586 5.47844 12C5.47844 12.414 5.47844 12.621 5.44354 12.7497C5.40582 12.8887 5.36944 12.9641 5.28413 13.0801C5.20518 13.1875 5.07927 13.2876 4.82743 13.4879L4.10261 14.0643C3.70785 14.3783 3.51047 14.5352 3.41145 14.7349C3.32785 14.9034 3.29349 15.0921 3.31231 15.2793C3.33461 15.501 3.46398 15.7174 3.72273 16.1504L4.1821 16.919C4.4272 17.3291 4.54974 17.5342 4.72457 17.6567C4.8723 17.7603 5.04528 17.8219 5.2252 17.8352C5.43813 17.8508 5.66275 17.7695 6.11199 17.607L7.12553 17.2402C7.42216 17.1328 7.5705 17.0791 7.7029 17.0681C7.83294 17.0573 7.91159 17.064 8.03786 17.0969C8.16644 17.1304 8.33956 17.2293 8.68582 17.427C8.71228 17.4421 8.73885 17.4571 8.76554 17.4718C9.12753 17.6719 9.30853 17.772 9.40635 17.8684C9.50241 17.963 9.54975 18.0296 9.60765 18.1514C9.66662 18.2754 9.69445 18.4367 9.75012 18.7594L9.90615 19.6637C9.98895 20.1437 10.0304 20.3837 10.1524 20.5629C10.2555 20.7142 10.3981 20.8344 10.5648 20.9102C10.7621 21 11.0057 21 11.4927 21H12.5073C12.9943 21 13.2378 21 13.4352 20.9102C13.6019 20.8344 13.7445 20.7142 13.8476 20.5629C13.9696 20.3837 14.011 20.1437 14.0938 19.6637L14.2499 18.7594C14.3055 18.4367 14.3334 18.2754 14.3923 18.1514C14.4502 18.0296 14.4976 17.963 14.5936 17.8684C14.6915 17.772 14.8725 17.6719 15.2344 17.4718C15.2611 17.4571 15.2877 17.4421 15.3141 17.427C15.6604 17.2293 15.8335 17.1304 15.9621 17.0969C16.0884 17.064 16.167 17.0573 16.2971 17.0681C16.4295 17.0791 16.5778 17.1328 16.8744 17.2402L17.888 17.607C18.3372 17.7696 18.5619 17.8509 18.7748 17.8352C18.9547 17.8219 19.1277 17.7603 19.2754 17.6567C19.4502 17.5342 19.5728 17.3291 19.8179 16.919L20.2773 16.1504C20.536 15.7175 20.6654 15.501 20.6877 15.2793C20.7065 15.0921 20.6721 14.9034 20.5885 14.7349C20.4895 14.5353 20.2921 14.3783 19.8974 14.0643L19.1726 13.4879C18.9207 13.2876 18.7948 13.1875 18.7159 13.0801C18.6306 12.9641 18.5942 12.8887 18.5564 12.7497C18.5215 12.6211 18.5215 12.414 18.5215 12C18.5215 11.586 18.5215 11.379 18.5564 11.2504C18.5942 11.1114 18.6306 11.036 18.7159 10.9199C18.7948 10.8126 18.9207 10.7124 19.1725 10.5122L19.8974 9.9357C20.2922 9.62176 20.4896 9.46479 20.5886 9.26517C20.6722 9.09664 20.7065 8.90795 20.6877 8.72076C20.6654 8.49906 20.5361 8.28259 20.2773 7.84964L19.8179 7.08102C19.5728 6.67093 19.4503 6.46588 19.2755 6.34332C19.1277 6.23977 18.9548 6.1781 18.7748 6.16486C18.5619 6.14919 18.3373 6.23048 17.888 6.39307L16.8745 6.75989C16.5778 6.86725 16.4295 6.92093 16.2971 6.93195C16.167 6.94278 16.0884 6.93601 15.9621 6.90313C15.8335 6.86965 15.6604 6.77077 15.3142 6.57302C15.2877 6.55791 15.2611 6.54298 15.2345 6.52822C14.8725 6.3281 14.6915 6.22804 14.5936 6.13166C14.4976 6.03703 14.4502 5.97047 14.3923 5.84869C14.3334 5.72467 14.3055 5.56332 14.2499 5.24064L14.0938 4.3363Z" fill="#0F1729"/>
2433
+ return `<svg class="cv-modal-icon-svg" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2434
+ <path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M12 8.00002C9.79085 8.00002 7.99999 9.79088 7.99999 12C7.99999 14.2092 9.79085 16 12 16C14.2091 16 16 14.2092 16 12C16 9.79088 14.2091 8.00002 12 8.00002ZM9.99999 12C9.99999 10.8955 10.8954 10 12 10C13.1046 10 14 10.8955 14 12C14 13.1046 13.1046 14 12 14C10.8954 14 9.99999 13.1046 9.99999 12Z" fill="#0F1729"/>
2435
+ <path xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" d="M10.7673 1.01709C10.9925 0.999829 11.2454 0.99993 11.4516 1.00001L12.5484 1.00001C12.7546 0.99993 13.0075 0.999829 13.2327 1.01709C13.4989 1.03749 13.8678 1.08936 14.2634 1.26937C14.7635 1.49689 15.1915 1.85736 15.5007 2.31147C15.7454 2.67075 15.8592 3.0255 15.9246 3.2843C15.9799 3.50334 16.0228 3.75249 16.0577 3.9557L16.1993 4.77635L16.2021 4.77788C16.2369 4.79712 16.2715 4.81659 16.306 4.8363L16.3086 4.83774L17.2455 4.49865C17.4356 4.42978 17.6693 4.34509 17.8835 4.28543C18.1371 4.2148 18.4954 4.13889 18.9216 4.17026C19.4614 4.20998 19.9803 4.39497 20.4235 4.70563C20.7734 4.95095 21.0029 5.23636 21.1546 5.4515C21.2829 5.63326 21.4103 5.84671 21.514 6.02029L22.0158 6.86003C22.1256 7.04345 22.2594 7.26713 22.3627 7.47527C22.4843 7.7203 22.6328 8.07474 22.6777 8.52067C22.7341 9.08222 22.6311 9.64831 22.3803 10.1539C22.1811 10.5554 21.9171 10.8347 21.7169 11.0212C21.5469 11.1795 21.3428 11.3417 21.1755 11.4746L20.5 12L21.1755 12.5254C21.3428 12.6584 21.5469 12.8205 21.7169 12.9789C21.9171 13.1653 22.1811 13.4446 22.3802 13.8461C22.631 14.3517 22.7341 14.9178 22.6776 15.4794C22.6328 15.9253 22.4842 16.2797 22.3626 16.5248C22.2593 16.7329 22.1255 16.9566 22.0158 17.14L21.5138 17.9799C21.4102 18.1535 21.2828 18.3668 21.1546 18.5485C21.0028 18.7637 20.7734 19.0491 20.4234 19.2944C19.9803 19.6051 19.4613 19.7901 18.9216 19.8298C18.4954 19.8612 18.1371 19.7852 17.8835 19.7146C17.6692 19.6549 17.4355 19.5703 17.2454 19.5014L16.3085 19.1623L16.306 19.1638C16.2715 19.1835 16.2369 19.2029 16.2021 19.2222L16.1993 19.2237L16.0577 20.0443C16.0228 20.2475 15.9799 20.4967 15.9246 20.7157C15.8592 20.9745 15.7454 21.3293 15.5007 21.6886C15.1915 22.1427 14.7635 22.5032 14.2634 22.7307C13.8678 22.9107 13.4989 22.9626 13.2327 22.983C13.0074 23.0002 12.7546 23.0001 12.5484 23H11.4516C11.2454 23.0001 10.9925 23.0002 10.7673 22.983C10.5011 22.9626 10.1322 22.9107 9.73655 22.7307C9.23648 22.5032 8.80849 22.1427 8.49926 21.6886C8.25461 21.3293 8.14077 20.9745 8.07542 20.7157C8.02011 20.4967 7.97723 20.2475 7.94225 20.0443L7.80068 19.2237L7.79791 19.2222C7.7631 19.2029 7.72845 19.1835 7.69396 19.1637L7.69142 19.1623L6.75458 19.5014C6.5645 19.5702 6.33078 19.6549 6.11651 19.7146C5.86288 19.7852 5.50463 19.8611 5.07841 19.8298C4.53866 19.7901 4.01971 19.6051 3.57654 19.2944C3.2266 19.0491 2.99714 18.7637 2.84539 18.5485C2.71718 18.3668 2.58974 18.1534 2.4861 17.9798L1.98418 17.14C1.87447 16.9566 1.74067 16.7329 1.63737 16.5248C1.51575 16.2797 1.36719 15.9253 1.32235 15.4794C1.26588 14.9178 1.36897 14.3517 1.61976 13.8461C1.81892 13.4446 2.08289 13.1653 2.28308 12.9789C2.45312 12.8205 2.65717 12.6584 2.82449 12.5254L3.47844 12.0054V11.9947L2.82445 11.4746C2.65712 11.3417 2.45308 11.1795 2.28304 11.0212C2.08285 10.8347 1.81888 10.5554 1.61972 10.1539C1.36893 9.64832 1.26584 9.08224 1.3223 8.52069C1.36714 8.07476 1.51571 7.72032 1.63732 7.47528C1.74062 7.26715 1.87443 7.04347 1.98414 6.86005L2.48605 6.02026C2.58969 5.84669 2.71714 5.63326 2.84534 5.45151C2.9971 5.23637 3.22655 4.95096 3.5765 4.70565C4.01966 4.39498 4.53862 4.20999 5.07837 4.17027C5.50458 4.1389 5.86284 4.21481 6.11646 4.28544C6.33072 4.34511 6.56444 4.4298 6.75451 4.49867L7.69141 4.83775L7.69394 4.8363C7.72844 4.8166 7.7631 4.79712 7.79791 4.77788L7.80068 4.77635L7.94225 3.95571C7.97723 3.7525 8.02011 3.50334 8.07542 3.2843C8.14077 3.0255 8.25461 2.67075 8.49926 2.31147C8.80849 1.85736 9.23648 1.49689 9.73655 1.26937C10.1322 1.08936 10.5011 1.03749 10.7673 1.01709ZM14.0938 4.3363C14.011 3.85634 13.9696 3.61637 13.8476 3.43717C13.7445 3.2858 13.6019 3.16564 13.4352 3.0898C13.2378 3.00002 12.9943 3.00002 12.5073 3.00002H11.4927C11.0057 3.00002 10.7621 3.00002 10.5648 3.0898C10.3981 3.16564 10.2555 3.2858 10.1524 3.43717C10.0304 3.61637 9.98895 3.85634 9.90615 4.3363L9.75012 5.24064C9.69445 5.56333 9.66662 5.72467 9.60765 5.84869C9.54975 5.97047 9.50241 6.03703 9.40636 6.13166C9.30853 6.22804 9.12753 6.3281 8.76554 6.52822C8.73884 6.54298 8.71227 6.55791 8.68582 6.57302C8.33956 6.77078 8.16643 6.86966 8.03785 6.90314C7.91158 6.93602 7.83293 6.94279 7.70289 6.93196C7.57049 6.92094 7.42216 6.86726 7.12551 6.7599L6.11194 6.39308C5.66271 6.2305 5.43809 6.14921 5.22515 6.16488C5.04524 6.17811 4.87225 6.23978 4.72453 6.34333C4.5497 6.46589 4.42715 6.67094 4.18206 7.08103L3.72269 7.84965C3.46394 8.2826 3.33456 8.49907 3.31227 8.72078C3.29345 8.90796 3.32781 9.09665 3.41141 9.26519C3.51042 9.4648 3.7078 9.62177 4.10256 9.9357L4.82745 10.5122C5.07927 10.7124 5.20518 10.8126 5.28411 10.9199C5.36944 11.036 5.40583 11.1114 5.44354 11.2504C5.47844 11.379 5.47844 11.586 5.47844 12C5.47844 12.414 5.47844 12.621 5.44354 12.7497C5.40582 12.8887 5.36944 12.9641 5.28413 13.0801C5.20518 13.1875 5.07927 13.2876 4.82743 13.4879L4.10261 14.0643C3.70785 14.3783 3.51047 14.5352 3.41145 14.7349C3.32785 14.9034 3.29349 15.0921 3.31231 15.2793C3.33461 15.501 3.46398 15.7174 3.72273 16.1504L4.1821 16.919C4.4272 17.3291 4.54974 17.5342 4.72457 17.6567C4.8723 17.7603 5.04528 17.8219 5.2252 17.8352C5.43813 17.8508 5.66275 17.7695 6.11199 17.607L7.12553 17.2402C7.42216 17.1328 7.5705 17.0791 7.7029 17.0681C7.83294 17.0573 7.91159 17.064 8.03786 17.0969C8.16644 17.1304 8.33956 17.2293 8.68582 17.427C8.71228 17.4421 8.73885 17.4571 8.76554 17.4718C9.12753 17.6719 9.30853 17.772 9.40635 17.8684C9.50241 17.963 9.54975 18.0296 9.60765 18.1514C9.66662 18.2754 9.69445 18.4367 9.75012 18.7594L9.90615 19.6637C9.98895 20.1437 10.0304 20.3837 10.1524 20.5629C10.2555 20.7142 10.3981 20.8344 10.5648 20.9102C10.7621 21 11.0057 21 11.4927 21H12.5073C12.9943 21 13.2378 21 13.4352 20.9102C13.6019 20.8344 13.7445 20.7142 13.8476 20.5629C13.9696 20.3837 14.011 20.1437 14.0938 19.6637L14.2499 18.7594C14.3055 18.4367 14.3334 18.2754 14.3923 18.1514C14.4502 18.0296 14.4976 17.963 14.5936 17.8684C14.6915 17.772 14.8725 17.6719 15.2344 17.4718C15.2611 17.4571 15.2877 17.4421 15.3141 17.427C15.6604 17.2293 15.8335 17.1304 15.9621 17.0969C16.0884 17.064 16.167 17.0573 16.2971 17.0681C16.4295 17.0791 16.5778 17.1328 16.8744 17.2402L17.888 17.607C18.3372 17.7696 18.5619 17.8509 18.7748 17.8352C18.9547 17.8219 19.1277 17.7603 19.2754 17.6567C19.4502 17.5342 19.5728 17.3291 19.8179 16.919L20.2773 16.1504C20.536 15.7175 20.6654 15.501 20.6877 15.2793C20.7065 15.0921 20.6721 14.9034 20.5885 14.7349C20.4895 14.5353 20.2921 14.3783 19.8974 14.0643L19.1726 13.4879C18.9207 13.2876 18.7948 13.1875 18.7159 13.0801C18.6306 12.9641 18.5942 12.8887 18.5564 12.7497C18.5215 12.6211 18.5215 12.414 18.5215 12C18.5215 11.586 18.5215 11.379 18.5564 11.2504C18.5942 11.1114 18.6306 11.036 18.7159 10.9199C18.7948 10.8126 18.9207 10.7124 19.1725 10.5122L19.8974 9.9357C20.2922 9.62176 20.4896 9.46479 20.5886 9.26517C20.6722 9.09664 20.7065 8.90795 20.6877 8.72076C20.6654 8.49906 20.5361 8.28259 20.2773 7.84964L19.8179 7.08102C19.5728 6.67093 19.4503 6.46588 19.2755 6.34332C19.1277 6.23977 18.9548 6.1781 18.7748 6.16486C18.5619 6.14919 18.3373 6.23048 17.888 6.39307L16.8745 6.75989C16.5778 6.86725 16.4295 6.92093 16.2971 6.93195C16.167 6.94278 16.0884 6.93601 15.9621 6.90313C15.8335 6.86965 15.6604 6.77077 15.3142 6.57302C15.2877 6.55791 15.2611 6.54298 15.2345 6.52822C14.8725 6.3281 14.6915 6.22804 14.5936 6.13166C14.4976 6.03703 14.4502 5.97047 14.3923 5.84869C14.3334 5.72467 14.3055 5.56332 14.2499 5.24064L14.0938 4.3363Z" fill="#0F1729"/>
2418
2436
  </svg>`;
2419
2437
  }
2420
2438
  /**
2421
2439
  * Close/X icon for modal close button
2422
2440
  */
2423
2441
  function getCloseIcon() {
2424
- return `<svg class="cv-modal-close-icon" fill="currentColor" height="20px" viewBox="0 0 256 256" width="20px" xmlns="http://www.w3.org/2000/svg">
2425
- <path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>
2442
+ return `<svg class="cv-modal-close-icon" fill="currentColor" height="20px" viewBox="0 0 256 256" width="20px" xmlns="http://www.w3.org/2000/svg">
2443
+ <path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>
2426
2444
  </svg>`;
2427
2445
  }
2428
2446
  /**
2429
2447
  * Reset/refresh icon for reset button
2430
2448
  */
2431
2449
  function getResetIcon() {
2432
- return `<svg class="cv-btn-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2433
- <path d="M22.719 12A10.719 10.719 0 0 1 1.28 12h.838a9.916 9.916 0 1 0 1.373-5H8v1H2V2h1v4.2A10.71 10.71 0 0 1 22.719 12z"/><path fill="none" d="M0 0h24v24H0z"/>
2450
+ return `<svg class="cv-btn-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2451
+ <path d="M22.719 12A10.719 10.719 0 0 1 1.28 12h.838a9.916 9.916 0 1 0 1.373-5H8v1H2V2h1v4.2A10.71 10.71 0 0 1 22.719 12z"/><path fill="none" d="M0 0h24v24H0z"/>
2434
2452
  </svg>`;
2435
2453
  }
2436
2454
  /**
2437
2455
  * Share icon for share button
2438
2456
  */
2439
2457
  function getShareIcon() {
2440
- return `<svg class="cv-btn-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2441
- <path xmlns="http://www.w3.org/2000/svg" d="M6 11C6 8.17157 6 6.75736 6.87868 5.87868C7.75736 5 9.17157 5 12 5H15C17.8284 5 19.2426 5 20.1213 5.87868C21 6.75736 21 8.17157 21 11V16C21 18.8284 21 20.2426 20.1213 21.1213C19.2426 22 17.8284 22 15 22H12C9.17157 22 7.75736 22 6.87868 21.1213C6 20.2426 6 18.8284 6 16V11Z" stroke="#1C274C" stroke-width="1.5"/>
2442
- <path xmlns="http://www.w3.org/2000/svg" opacity="0.5" d="M6 19C4.34315 19 3 17.6569 3 16V10C3 6.22876 3 4.34315 4.17157 3.17157C5.34315 2 7.22876 2 11 2H15C16.6569 2 18 3.34315 18 5" stroke="#1C274C" stroke-width="1.5"/>
2458
+ return `<svg class="cv-btn-icon" fill="currentColor" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
2459
+ <path xmlns="http://www.w3.org/2000/svg" d="M6 11C6 8.17157 6 6.75736 6.87868 5.87868C7.75736 5 9.17157 5 12 5H15C17.8284 5 19.2426 5 20.1213 5.87868C21 6.75736 21 8.17157 21 11V16C21 18.8284 21 20.2426 20.1213 21.1213C19.2426 22 17.8284 22 15 22H12C9.17157 22 7.75736 22 6.87868 21.1213C6 20.2426 6 18.8284 6 16V11Z" stroke="#1C274C" stroke-width="1.5"/>
2460
+ <path xmlns="http://www.w3.org/2000/svg" opacity="0.5" d="M6 19C4.34315 19 3 17.6569 3 16V10C3 6.22876 3 4.34315 4.17157 3.17157C5.34315 2 7.22876 2 11 2H15C16.6569 2 18 3.34315 18 5" stroke="#1C274C" stroke-width="1.5"/>
2443
2461
  </svg>`;
2444
2462
  }
2445
2463
 
@@ -2543,123 +2561,101 @@ class CustomViewsWidget {
2543
2561
  this.modal = document.createElement('div');
2544
2562
  this.modal.className = 'cv-widget-modal-overlay';
2545
2563
  this.applyThemeToModal();
2546
- const toggleControlsHtml = toggles.map(toggle => `
2547
- <div class="cv-toggle-card">
2548
- <div class="cv-toggle-content">
2549
- <div>
2550
- <p class="cv-toggle-title">${this.formatToggleName(toggle)}</p>
2551
- </div>
2552
- <label class="cv-toggle-label">
2553
- <input class="cv-toggle-input" type="checkbox" data-toggle="${toggle}"/>
2554
- <span class="cv-toggle-slider"></span>
2555
- </label>
2556
- </div>
2557
- </div>
2564
+ const toggleControlsHtml = toggles.map(toggle => `
2565
+ <div class="cv-toggle-card">
2566
+ <div class="cv-toggle-content">
2567
+ <div>
2568
+ <p class="cv-toggle-title">${this.formatToggleName(toggle)}</p>
2569
+ </div>
2570
+ <label class="cv-toggle-label">
2571
+ <input class="cv-toggle-input" type="checkbox" data-toggle="${toggle}"/>
2572
+ <span class="cv-toggle-slider"></span>
2573
+ </label>
2574
+ </div>
2575
+ </div>
2558
2576
  `).join('');
2559
2577
  // Todo: Re-add description if needed (Line 168, add label field to toggles if needed change structure)
2560
2578
  // <p class="cv-toggle-description">Show or hide the ${this.formatToggleName(toggle).toLowerCase()} area </p>
2561
2579
  // Get tab groups
2562
2580
  const tabGroups = this.core.getTabGroups();
2563
2581
  let tabGroupControlsHTML = '';
2564
- // Check if any tab group or tab labels contain Font Awesome shortcodes
2565
- let hasFontAwesomeShortcodes = false;
2566
2582
  if (this.options.showTabGroups && tabGroups && tabGroups.length > 0) {
2567
- for (const group of tabGroups) {
2568
- if (group.label && /:fa-[\w-]+:/.test(group.label)) {
2569
- hasFontAwesomeShortcodes = true;
2570
- break;
2571
- }
2572
- for (const tab of group.tabs) {
2573
- if (tab.label && /:fa-[\w-]+:/.test(tab.label)) {
2574
- hasFontAwesomeShortcodes = true;
2575
- break;
2576
- }
2577
- }
2578
- if (hasFontAwesomeShortcodes)
2579
- break;
2580
- }
2581
- }
2582
- // Inject Font Awesome only if shortcodes are found
2583
- if (hasFontAwesomeShortcodes) {
2584
- ensureFontAwesomeInjected();
2585
- }
2586
- if (this.options.showTabGroups && tabGroups && tabGroups.length > 0) {
2587
- tabGroupControlsHTML = `
2588
- <div class="cv-tabgroup-card cv-tabgroup-header">
2589
- <div class="cv-tabgroup-row">
2590
- <div class="cv-tabgroup-info">
2591
- <p class="cv-tabgroup-title">Navigation Headers</p>
2592
- <p class="cv-tabgroup-description">Show or hide navigation headers</p>
2593
- </div>
2594
- <label class="cv-toggle-switch cv-nav-toggle">
2595
- <input class="cv-nav-pref-input" type="checkbox" aria-label="Show or hide navigation headers" />
2596
- <span class="cv-switch-bg"></span>
2597
- <span class="cv-switch-knob"></span>
2598
- </label>
2599
- </div>
2600
- </div>
2601
- <div class="cv-tab-groups-list">
2602
- ${tabGroups.map(group => `
2603
- <div class="cv-tabgroup-card cv-tabgroup-item">
2604
- <label class="cv-tabgroup-label" for="tab-group-${group.id}">
2605
- ${replaceIconShortcodes(group.label || group.id)}
2606
- </label>
2607
- <select id="tab-group-${group.id}" class="cv-tabgroup-select" data-group-id="${group.id}">
2608
- ${group.tabs.map(tab => `<option value="${tab.id}">${replaceIconShortcodes(tab.label || tab.id)}</option>`).join('')}
2609
- </select>
2610
- </div>
2611
- `).join('')}
2612
- </div>
2583
+ tabGroupControlsHTML = `
2584
+ <div class="cv-tabgroup-card cv-tabgroup-header">
2585
+ <div class="cv-tabgroup-row">
2586
+ <div class="cv-tabgroup-info">
2587
+ <p class="cv-tabgroup-title">Navigation Headers</p>
2588
+ <p class="cv-tabgroup-description">Show or hide navigation headers</p>
2589
+ </div>
2590
+ <label class="cv-toggle-switch cv-nav-toggle">
2591
+ <input class="cv-nav-pref-input" type="checkbox" aria-label="Show or hide navigation headers" />
2592
+ <span class="cv-switch-bg"></span>
2593
+ <span class="cv-switch-knob"></span>
2594
+ </label>
2595
+ </div>
2596
+ </div>
2597
+ <div class="cv-tab-groups-list">
2598
+ ${tabGroups.map(group => `
2599
+ <div class="cv-tabgroup-card cv-tabgroup-item">
2600
+ <label class="cv-tabgroup-label" for="tab-group-${group.id}">
2601
+ ${group.label || group.id}
2602
+ </label>
2603
+ <select id="tab-group-${group.id}" class="cv-tabgroup-select" data-group-id="${group.id}">
2604
+ ${group.tabs.map(tab => `<option value="${tab.id}">${tab.label || tab.id}</option>`).join('')}
2605
+ </select>
2606
+ </div>
2607
+ `).join('')}
2608
+ </div>
2613
2609
  `;
2614
2610
  }
2615
- this.modal.innerHTML = `
2616
- <div class="cv-widget-modal cv-custom-state-modal">
2617
- <header class="cv-modal-header">
2618
- <div class="cv-modal-header-content">
2619
- <div class="cv-modal-icon">
2620
- ${getGearIcon()}
2621
- </div>
2622
- <div class="cv-modal-title">${this.options.title}</div>
2623
- </div>
2624
- <button class="cv-modal-close" aria-label="Close modal">
2625
- ${getCloseIcon()}
2626
- </button>
2627
- </header>
2628
- <main class="cv-modal-main">
2629
- ${this.options.description ? `<p class="cv-modal-description">${this.options.description}</p>` : ''}
2630
-
2631
- ${toggles.length ? `
2632
- <div class="cv-content-section">
2633
- <div class="cv-section-heading">Toggles</div>
2634
- <div class="cv-toggles-container">
2635
- ${toggleControlsHtml}
2636
- </div>
2637
- </div>
2638
- ` : ''}
2639
-
2640
- ${this.options.showTabGroups && tabGroups && tabGroups.length > 0 ? `
2641
- <div class="cv-content-section">
2642
- <div class="cv-section-heading">Tab Groups</div>
2643
- <div class="cv-tabgroups-container">
2644
- ${tabGroupControlsHTML}
2645
- </div>
2646
- </div>
2647
- ` : ''}
2648
- </main>
2649
-
2650
- <footer class="cv-modal-footer">
2651
- ${this.options.showReset ? `
2652
- <button class="cv-reset-btn">
2653
- ${getResetIcon()}
2654
- <span>Reset to Default</span>
2655
- </button>
2656
- ` : ''}
2657
- <button class="cv-share-btn">
2658
- ${getShareIcon()}
2659
- <span>Copy Shareable URL</span>
2660
- </button>
2661
- </footer>
2662
- </div>
2611
+ this.modal.innerHTML = `
2612
+ <div class="cv-widget-modal cv-custom-state-modal">
2613
+ <header class="cv-modal-header">
2614
+ <div class="cv-modal-header-content">
2615
+ <div class="cv-modal-icon">
2616
+ ${getGearIcon()}
2617
+ </div>
2618
+ <div class="cv-modal-title">${this.options.title}</div>
2619
+ </div>
2620
+ <button class="cv-modal-close" aria-label="Close modal">
2621
+ ${getCloseIcon()}
2622
+ </button>
2623
+ </header>
2624
+ <main class="cv-modal-main">
2625
+ ${this.options.description ? `<p class="cv-modal-description">${this.options.description}</p>` : ''}
2626
+
2627
+ ${toggles.length ? `
2628
+ <div class="cv-content-section">
2629
+ <div class="cv-section-heading">Toggles</div>
2630
+ <div class="cv-toggles-container">
2631
+ ${toggleControlsHtml}
2632
+ </div>
2633
+ </div>
2634
+ ` : ''}
2635
+
2636
+ ${this.options.showTabGroups && tabGroups && tabGroups.length > 0 ? `
2637
+ <div class="cv-content-section">
2638
+ <div class="cv-section-heading">Tab Groups</div>
2639
+ <div class="cv-tabgroups-container">
2640
+ ${tabGroupControlsHTML}
2641
+ </div>
2642
+ </div>
2643
+ ` : ''}
2644
+ </main>
2645
+
2646
+ <footer class="cv-modal-footer">
2647
+ ${this.options.showReset ? `
2648
+ <button class="cv-reset-btn">
2649
+ ${getResetIcon()}
2650
+ <span>Reset to Default</span>
2651
+ </button>
2652
+ ` : ''}
2653
+ <button class="cv-share-btn">
2654
+ ${getShareIcon()}
2655
+ <span>Copy Shareable URL</span>
2656
+ </button>
2657
+ </footer>
2658
+ </div>
2663
2659
  `;
2664
2660
  document.body.appendChild(this.modal);
2665
2661
  this.attachStateModalEventListeners();
@@ -2835,7 +2831,7 @@ class CustomViewsWidget {
2835
2831
  });
2836
2832
  // Load tab group selections
2837
2833
  const activeTabs = this.core.getCurrentActiveTabs();
2838
- const tabGroupSelects = this.modal.querySelectorAll('.cv-tab-groupselect');
2834
+ const tabGroupSelects = this.modal.querySelectorAll('.cv-tabgroup-select');
2839
2835
  tabGroupSelects.forEach(select => {
2840
2836
  const groupId = select.dataset.groupId;
2841
2837
  if (groupId && activeTabs[groupId]) {
@@ -2893,29 +2889,29 @@ class CustomViewsWidget {
2893
2889
  this.modal = document.createElement('div');
2894
2890
  this.modal.className = 'cv-widget-modal-overlay cv-welcome-modal-overlay';
2895
2891
  this.applyThemeToModal();
2896
- this.modal.innerHTML = `
2897
- <div class="cv-widget-modal cv-welcome-modal">
2898
- <header class="cv-modal-header">
2899
- <div class="cv-modal-header-content">
2900
- <div class="cv-modal-icon">
2901
- ${getGearIcon()}
2902
- </div>
2903
- <h1 class="cv-modal-title">${this.options.welcomeTitle}</h1>
2904
- </div>
2905
- </header>
2906
- <div class="cv-modal-main">
2907
- <p class="cv-welcome-message">${this.options.welcomeMessage}</p>
2908
-
2909
- <div class="cv-welcome-widget-preview">
2910
- <div class="cv-welcome-widget-icon">
2911
- ${getGearIcon()}
2912
- </div>
2913
- <p class="cv-welcome-widget-label">Look for this widget</p>
2914
- </div>
2915
-
2916
- <button class="cv-welcome-got-it">Got it!</button>
2917
- </div>
2918
- </div>
2892
+ this.modal.innerHTML = `
2893
+ <div class="cv-widget-modal cv-welcome-modal">
2894
+ <header class="cv-modal-header">
2895
+ <div class="cv-modal-header-content">
2896
+ <div class="cv-modal-icon">
2897
+ ${getGearIcon()}
2898
+ </div>
2899
+ <h1 class="cv-modal-title">${this.options.welcomeTitle}</h1>
2900
+ </div>
2901
+ </header>
2902
+ <div class="cv-modal-main">
2903
+ <p class="cv-welcome-message">${this.options.welcomeMessage}</p>
2904
+
2905
+ <div class="cv-welcome-widget-preview">
2906
+ <div class="cv-welcome-widget-icon">
2907
+ ${getGearIcon()}
2908
+ </div>
2909
+ <p class="cv-welcome-widget-label">Look for this widget</p>
2910
+ </div>
2911
+
2912
+ <button class="cv-welcome-got-it">Got it!</button>
2913
+ </div>
2914
+ </div>
2919
2915
  `;
2920
2916
  document.body.appendChild(this.modal);
2921
2917
  this.attachWelcomeModalEventListeners();
@@ -2983,22 +2979,13 @@ function initializeFromScript() {
2983
2979
  let scriptTag = document.currentScript;
2984
2980
  // Fallback if currentScript is not available (executed after page load)
2985
2981
  if (!scriptTag) {
2986
- // Try to find the script tag by looking for our script
2987
- const scripts = document.querySelectorAll('script[src*="@customviews-js"]');
2988
- if (scripts.length > 0) {
2989
- // Find the most specific match (to avoid matching other custom-views scripts)
2990
- for (let i = 0; i < scripts.length; i++) {
2991
- const script = scripts[i];
2992
- const src = script.getAttribute('src') || '';
2993
- // Look for .min.js or .js at the end, or the package root
2994
- if (src.match(/@customviews-js\/customviews(\.min)?\.js($|\?)/) || src.includes('@customviews-js/customviews')) {
2995
- scriptTag = script;
2996
- break;
2997
- }
2998
- }
2999
- // If no specific match found, use the first one
3000
- if (!scriptTag) {
3001
- scriptTag = scripts[0];
2982
+ // Match the actual CustomViews bundle files (e.g., custom-views.min.js, custom-views.js)
2983
+ for (const script of document.scripts) {
2984
+ const src = script.src || '';
2985
+ // Match filenames like: custom-views.min.js, custom-views.js, custom-views.esm.js
2986
+ if (/custom-views(?:\.min)?\.(?:esm\.)?js($|\?)/i.test(src)) {
2987
+ scriptTag = script;
2988
+ break;
3002
2989
  }
3003
2990
  }
3004
2991
  }