reneco-advanced-input-module 0.0.1 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (94) hide show
  1. package/dist/cjs/loader.cjs.js +1 -1
  2. package/dist/cjs/ocr-file-uploader.voice-input-module.entry.cjs.js.map +1 -0
  3. package/dist/cjs/ocr-file-uploader_2.cjs.entry.js +4486 -0
  4. package/dist/cjs/ocr-file-uploader_2.cjs.entry.js.map +1 -0
  5. package/dist/cjs/voice-input-module.cjs.js +1 -1
  6. package/dist/collection/collection-manifest.json +8 -2
  7. package/dist/collection/components/voice-input-module/voice-input-module.css +76 -0
  8. package/dist/collection/components/voice-input-module/voice-input-module.js +218 -72
  9. package/dist/collection/components/voice-input-module/voice-input-module.js.map +1 -1
  10. package/dist/collection/services/llm.service.js +2 -2
  11. package/dist/collection/services/llm.service.js.map +1 -1
  12. package/dist/collection/services/speech-to-text.service.js +2 -4
  13. package/dist/collection/services/speech-to-text.service.js.map +1 -1
  14. package/dist/collection/utils/schema-converter.js +1 -1
  15. package/dist/collection/utils/schema-converter.js.map +1 -1
  16. package/dist/components/ocr-file-uploader.js +9 -0
  17. package/dist/components/ocr-file-uploader.js.map +1 -0
  18. package/dist/components/{file-uploader2.js → ocr-file-uploader2.js} +16 -12
  19. package/dist/components/ocr-file-uploader2.js.map +1 -0
  20. package/dist/components/voice-input-module.js +3257 -93
  21. package/dist/components/voice-input-module.js.map +1 -1
  22. package/dist/esm/loader.js +1 -1
  23. package/dist/esm/ocr-file-uploader.voice-input-module.entry.js.map +1 -0
  24. package/dist/esm/ocr-file-uploader_2.entry.js +4483 -0
  25. package/dist/esm/ocr-file-uploader_2.entry.js.map +1 -0
  26. package/dist/esm/voice-input-module.js +1 -1
  27. package/dist/types/components/voice-input-module/voice-input-module.d.ts +9 -1
  28. package/dist/types/components.d.ts +8 -31
  29. package/dist/types/services/speech-to-text.service.d.ts +1 -1
  30. package/dist/voice-input-module/ocr-file-uploader.voice-input-module.entry.esm.js.map +1 -0
  31. package/dist/voice-input-module/p-37de1da2.entry.js +3 -0
  32. package/dist/voice-input-module/p-37de1da2.entry.js.map +1 -0
  33. package/dist/voice-input-module/voice-input-module.esm.js +1 -1
  34. package/loader/cdn.js +1 -0
  35. package/loader/index.cjs.js +1 -0
  36. package/loader/index.d.ts +24 -0
  37. package/loader/index.es2017.js +1 -0
  38. package/loader/index.js +2 -0
  39. package/package.json +7 -3
  40. package/www/build/index.esm.js +2 -0
  41. package/www/build/index.esm.js.map +1 -0
  42. package/www/build/loader.esm.js.map +1 -0
  43. package/www/build/ocr-file-uploader.voice-input-module.entry.esm.js.map +1 -0
  44. package/www/build/p-37de1da2.entry.js +3 -0
  45. package/www/build/p-37de1da2.entry.js.map +1 -0
  46. package/www/build/p-6438474d.js +2 -0
  47. package/www/build/p-DQuL1Twl.js +2 -0
  48. package/www/build/p-DQuL1Twl.js.map +1 -0
  49. package/www/build/p-jmc2yzBp.js +3 -0
  50. package/www/build/p-jmc2yzBp.js.map +1 -0
  51. package/www/build/voice-input-module.esm.js +2 -0
  52. package/www/build/voice-input-module.esm.js.map +1 -0
  53. package/www/build/voice-input-module.js +33 -0
  54. package/www/host.config.json +15 -0
  55. package/www/index.html +1662 -0
  56. package/.editorconfig +0 -15
  57. package/.prettierrc.json +0 -13
  58. package/api-key-inject.js +0 -46
  59. package/dist/cjs/file-uploader.voice-input-module.entry.cjs.js.map +0 -1
  60. package/dist/cjs/file-uploader_2.cjs.entry.js +0 -1319
  61. package/dist/cjs/file-uploader_2.cjs.entry.js.map +0 -1
  62. package/dist/collection/components/file-uploader/file-uploader.css +0 -26
  63. package/dist/collection/components/file-uploader/file-uploader.js +0 -130
  64. package/dist/collection/components/file-uploader/file-uploader.js.map +0 -1
  65. package/dist/components/file-uploader.d.ts +0 -11
  66. package/dist/components/file-uploader.js +0 -9
  67. package/dist/components/file-uploader.js.map +0 -1
  68. package/dist/components/file-uploader2.js.map +0 -1
  69. package/dist/esm/file-uploader.voice-input-module.entry.js.map +0 -1
  70. package/dist/esm/file-uploader_2.entry.js +0 -1316
  71. package/dist/esm/file-uploader_2.entry.js.map +0 -1
  72. package/dist/types/components/file-uploader/file-uploader.d.ts +0 -8
  73. package/dist/voice-input-module/file-uploader.voice-input-module.entry.esm.js.map +0 -1
  74. package/dist/voice-input-module/p-7b4f33ba.entry.js +0 -2
  75. package/dist/voice-input-module/p-7b4f33ba.entry.js.map +0 -1
  76. package/env-config.js +0 -4
  77. package/inject-env.js +0 -20
  78. package/src/components/file-uploader/file-uploader.css +0 -26
  79. package/src/components/file-uploader/file-uploader.tsx +0 -100
  80. package/src/components/file-uploader/readme.md +0 -31
  81. package/src/components/voice-input-module/readme.md +0 -114
  82. package/src/components/voice-input-module/voice-input-module.css +0 -251
  83. package/src/components/voice-input-module/voice-input-module.tsx +0 -731
  84. package/src/components.d.ts +0 -158
  85. package/src/index.html +0 -663
  86. package/src/index.ts +0 -12
  87. package/src/services/audio-recorder.service.ts +0 -74
  88. package/src/services/llm.service.ts +0 -221
  89. package/src/services/speech-to-text.service.ts +0 -72
  90. package/src/types/form-schema.types.ts +0 -78
  91. package/src/types/service-providers.types.ts +0 -22
  92. package/src/utils/schema-converter.ts +0 -494
  93. package/stencil.config.ts +0 -24
  94. package/tsconfig.json +0 -30
@@ -1,5 +1,5 @@
1
- import { proxyCustomElement, HTMLElement, createEvent, h } from '@stencil/core/internal/client';
2
- import { d as defineCustomElement$2 } from './file-uploader2.js';
1
+ import { proxyCustomElement, HTMLElement as HTMLElement$1, createEvent, h as h$1 } from '@stencil/core/internal/client';
2
+ import { d as defineCustomElement$2 } from './ocr-file-uploader2.js';
3
3
 
4
4
  class AudioRecorderService {
5
5
  constructor() {
@@ -84,13 +84,11 @@ class WhisperSpeechToTextService {
84
84
  // Check if it's available as a global variable or through other means
85
85
  return window[name] || undefined;
86
86
  }
87
- async transcribe(audioBlob, lang = 'en') {
87
+ async transcribe(audioContent, lang = 'en') {
88
88
  var _a;
89
89
  try {
90
90
  const formData = new FormData();
91
- // Convert webm to a format Whisper can handle
92
- const audioFile = new File([audioBlob], 'audio.webm', { type: 'audio/webm' });
93
- formData.append('file', audioFile);
91
+ formData.append('file', audioContent);
94
92
  formData.append('model', 'gpt-4o-transcribe'); // >>> tronque le texte ?
95
93
  // formData.append('model', 'gpt-4o-mini-transcribe');// >>> tronque le texte ?
96
94
  // formData.append('model', 'whisper-1');
@@ -179,7 +177,7 @@ class OpenAILLMService {
179
177
  1. Only extract values that can be confidently determined from the transcription
180
178
  2. Respect field types (string, number, datetime, boolean, select)
181
179
  3. For datetime fields, use ISO format (YYYY-MM-DDTHH:MM)
182
- 4. For date fields, use the following format: DD/MM/YYY
180
+ 4. For date fields, use the following format: DD/MM/YYYY
183
181
  5. For boolean fields, interpret yes/no, true/false, positive/negative responses
184
182
  6. For select fields, use exact option values from the provided choices
185
183
  7. Only include fields where relevant information is found
@@ -242,7 +240,7 @@ class OpenAILLMService {
242
240
  1. Only fill fields that can be confidently determined from the transcription
243
241
  2. Respect field types (string, number, date, boolean, select)
244
242
  3. For datetime fields, use ISO format (YYYY-MM-DDTHH:MM)
245
- 4. For date fields, use the following format: DD/MM/YYY
243
+ 4. For date fields, use the following format: DD/MM/YYYY
246
244
  5. For boolean fields, interpret yes/no, true/false, positive/negative responses
247
245
  6. For select fields, match the closest option from the provided choices
248
246
  7. Leave fields empty if no relevant information is found
@@ -573,7 +571,7 @@ class SchemaConverter {
573
571
  // Handle select options
574
572
  if (field.type.toLowerCase() === 'select') {
575
573
  try {
576
- const response = await fetch(`${classificationRootURL}/api/v1/classification/getList/${field.ControlType.toLowerCase() == 'termpicker' ? "position" : "thesaurus"}/?StartNodeID=${field_TypeId}&Language=${lang}`);
574
+ const response = await fetch(`${classificationRootURL}/ng/api/v1/classification/getList/${field.ControlType.toLowerCase() == 'termpicker' ? "Position" : "Thesaurus"}/?StartNodeID=${field_TypeId}`);
577
575
  if (!response.ok)
578
576
  throw new Error(`HTTP error! status: ${response.status}`);
579
577
  const data = await response.json();
@@ -743,9 +741,3042 @@ class SchemaConverter {
743
741
  }
744
742
  }
745
743
 
746
- const voiceInputModuleCss = ":host{display:block;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif}.voice-recorder-container{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:1rem;border:1px solid #e5e7eb;border-radius:0.5rem;background:#ffffff;max-width:100px;margin:0 auto}.voice-recorder-container-debug{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:1rem;border:1px solid #e5e7eb;border-radius:0.5rem;background:#ffffff;max-width:800px;margin:0 auto}.record-button{display:flex;align-items:center;justify-content:center;width:50px;height:50px;border:none;border-radius:50%;background:#ee4444;color:white;cursor:pointer;transition:all 0.2s ease;position:relative;overflow:hidden}.record-button:hover:not(:disabled){background:#dd3333;transform:scale(1.05)}.record-button:disabled{opacity:0.6;cursor:not-allowed}.record-button.recording{background:#dd3333;animation:pulse 1.5s infinite}.record-button.processing{background:#3b82f6}@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(239, 68, 68, 0.7)}70%{box-shadow:0 0 0 10px rgba(239, 68, 68, 0)}100%{box-shadow:0 0 0 0 rgba(239, 68, 68, 0)}}.record-icon{width:24px;height:24px;fill:currentColor}.status-text{font-size:0.875rem;color:#6b7280;text-align:center;min-height:1.25rem}.status-text.error{color:#ee4444}.status-text.success{color:#10b981}.debug-panel{width:100%;margin-top:1rem;padding:1rem;background:#f9fafb;border:1px solid #e5e7eb;border-radius:0.375rem;font-family:'Monaco', 'Menlo', 'Ubuntu Mono', monospace;font-size:0.75rem}.debug-title{font-weight:600;margin-bottom:0.5rem;color:#374151}.debug-content{white-space:pre-wrap;word-break:break-word;color:#6b7280;max-height:200px;overflow-y:auto}.permissions-warning{padding:0.75rem;background:#fef3c7;border:1px solid #f59e0b;border-radius:0.375rem;color:#92400e;font-size:0.875rem;text-align:center}.form-preview{width:100%;margin-top:1rem;padding:1rem;background:#f8fafc;border:1px solid #e2e8f0;border-radius:0.375rem}.form-preview-title{font-weight:600;margin-bottom:0.5rem;color:#1e293b}.form-field{margin-bottom:0.5rem;font-size:0.875rem}.field-name{font-weight:500;color:#475569}.field-value{color:#64748b;margin-left:0.5rem}.field-value.filled{color:#059669;font-weight:500}.voice-filled-form{display:flex;flex-direction:column;gap:1rem;margin-top:1rem}.form-group{display:flex;flex-direction:column;gap:0.25rem}.form-label{font-weight:500;color:#374151;font-size:0.875rem}.required{color:#ee4444;margin-left:0.125rem}.form-input{padding:0.5rem;border:1px solid #d1d5db;border-radius:0.375rem;font-size:0.875rem;transition:border-color 0.2s ease}.form-input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59, 130, 246, 0.1)}.form-checkbox{width:auto;padding:0;margin:0}select.form-input{background-color:white;cursor:pointer}input[type=\"date\"].form-input{cursor:pointer}.readonly-select{background:#f9fafb;border:1px solid #d1d5db;border-radius:0.375rem;padding:0.5rem}.select-placeholder{font-size:0.875rem;color:#6b7280;margin-bottom:0.5rem}.select-options-list{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:0.25rem}.select-option{background:#e5e7eb;padding:0.25rem 0.5rem;border-radius:0.25rem;font-size:0.875rem;color:#374151}";
744
+ const NAMESPACE = 'ocr-file-uploader';
745
+ const BUILD = /* ocr-file-uploader */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: false, updatable: true};
747
746
 
748
- const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecorder extends HTMLElement {
747
+ /*
748
+ Stencil Client Platform v4.40.1 | MIT Licensed | https://stenciljs.com
749
+ */
750
+ var __create = Object.create;
751
+ var __defProp = Object.defineProperty;
752
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
753
+ var __getOwnPropNames = Object.getOwnPropertyNames;
754
+ var __getProtoOf = Object.getPrototypeOf;
755
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
756
+ var __typeError = (msg) => {
757
+ throw TypeError(msg);
758
+ };
759
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
760
+ var __commonJS = (cb, mod) => function __require() {
761
+ return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
762
+ };
763
+ var __export = (target, all) => {
764
+ for (var name in all)
765
+ __defProp(target, name, { get: all[name], enumerable: true });
766
+ };
767
+ var __copyProps = (to, from, except, desc) => {
768
+ if (from && typeof from === "object" || typeof from === "function") {
769
+ for (let key of __getOwnPropNames(from))
770
+ if (!__hasOwnProp.call(to, key) && key !== except)
771
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
772
+ }
773
+ return to;
774
+ };
775
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
776
+ // If the importer is in node compatibility mode or this is not an ESM
777
+ // file that has been converted to a CommonJS file using a Babel-
778
+ // compatible transform (i.e. "__esModule" has not been set), then set
779
+ // "default" to the CommonJS "module.exports" for node compatibility.
780
+ __defProp(target, "default", { value: mod, enumerable: true }) ,
781
+ mod
782
+ ));
783
+ var __publicField = (obj, key, value) => __defNormalProp(obj, key + "" , value);
784
+ var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
785
+ var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
786
+ var __privateAdd = (obj, member, value) => member.has(obj) ? __typeError("Cannot add the same private member more than once") : member instanceof WeakSet ? member.add(obj) : member.set(obj, value);
787
+ var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), member.set(obj, value), value);
788
+ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method);
789
+
790
+ // node_modules/balanced-match/index.js
791
+ var require_balanced_match = __commonJS({
792
+ "node_modules/balanced-match/index.js"(exports, module) {
793
+ module.exports = balanced;
794
+ function balanced(a, b, str) {
795
+ if (a instanceof RegExp) a = maybeMatch(a, str);
796
+ if (b instanceof RegExp) b = maybeMatch(b, str);
797
+ var r = range(a, b, str);
798
+ return r && {
799
+ start: r[0],
800
+ end: r[1],
801
+ pre: str.slice(0, r[0]),
802
+ body: str.slice(r[0] + a.length, r[1]),
803
+ post: str.slice(r[1] + b.length)
804
+ };
805
+ }
806
+ function maybeMatch(reg, str) {
807
+ var m = str.match(reg);
808
+ return m ? m[0] : null;
809
+ }
810
+ balanced.range = range;
811
+ function range(a, b, str) {
812
+ var begs, beg, left, right, result;
813
+ var ai = str.indexOf(a);
814
+ var bi = str.indexOf(b, ai + 1);
815
+ var i2 = ai;
816
+ if (ai >= 0 && bi > 0) {
817
+ if (a === b) {
818
+ return [ai, bi];
819
+ }
820
+ begs = [];
821
+ left = str.length;
822
+ while (i2 >= 0 && !result) {
823
+ if (i2 == ai) {
824
+ begs.push(i2);
825
+ ai = str.indexOf(a, i2 + 1);
826
+ } else if (begs.length == 1) {
827
+ result = [begs.pop(), bi];
828
+ } else {
829
+ beg = begs.pop();
830
+ if (beg < left) {
831
+ left = beg;
832
+ right = bi;
833
+ }
834
+ bi = str.indexOf(b, i2 + 1);
835
+ }
836
+ i2 = ai < bi && ai >= 0 ? ai : bi;
837
+ }
838
+ if (begs.length) {
839
+ result = [left, right];
840
+ }
841
+ }
842
+ return result;
843
+ }
844
+ }
845
+ });
846
+
847
+ // node_modules/brace-expansion/index.js
848
+ var require_brace_expansion = __commonJS({
849
+ "node_modules/brace-expansion/index.js"(exports, module) {
850
+ var balanced = require_balanced_match();
851
+ module.exports = expandTop;
852
+ var escSlash = "\0SLASH" + Math.random() + "\0";
853
+ var escOpen = "\0OPEN" + Math.random() + "\0";
854
+ var escClose = "\0CLOSE" + Math.random() + "\0";
855
+ var escComma = "\0COMMA" + Math.random() + "\0";
856
+ var escPeriod = "\0PERIOD" + Math.random() + "\0";
857
+ function numeric(str) {
858
+ return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
859
+ }
860
+ function escapeBraces(str) {
861
+ return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
862
+ }
863
+ function unescapeBraces(str) {
864
+ return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
865
+ }
866
+ function parseCommaParts(str) {
867
+ if (!str)
868
+ return [""];
869
+ var parts = [];
870
+ var m = balanced("{", "}", str);
871
+ if (!m)
872
+ return str.split(",");
873
+ var pre = m.pre;
874
+ var body = m.body;
875
+ var post = m.post;
876
+ var p = pre.split(",");
877
+ p[p.length - 1] += "{" + body + "}";
878
+ var postParts = parseCommaParts(post);
879
+ if (post.length) {
880
+ p[p.length - 1] += postParts.shift();
881
+ p.push.apply(p, postParts);
882
+ }
883
+ parts.push.apply(parts, p);
884
+ return parts;
885
+ }
886
+ function expandTop(str) {
887
+ if (!str)
888
+ return [];
889
+ if (str.substr(0, 2) === "{}") {
890
+ str = "\\{\\}" + str.substr(2);
891
+ }
892
+ return expand2(escapeBraces(str), true).map(unescapeBraces);
893
+ }
894
+ function embrace(str) {
895
+ return "{" + str + "}";
896
+ }
897
+ function isPadded(el) {
898
+ return /^-?0\d/.test(el);
899
+ }
900
+ function lte(i2, y) {
901
+ return i2 <= y;
902
+ }
903
+ function gte(i2, y) {
904
+ return i2 >= y;
905
+ }
906
+ function expand2(str, isTop) {
907
+ var expansions = [];
908
+ var m = balanced("{", "}", str);
909
+ if (!m) return [str];
910
+ var pre = m.pre;
911
+ var post = m.post.length ? expand2(m.post, false) : [""];
912
+ if (/\$$/.test(m.pre)) {
913
+ for (var k = 0; k < post.length; k++) {
914
+ var expansion = pre + "{" + m.body + "}" + post[k];
915
+ expansions.push(expansion);
916
+ }
917
+ } else {
918
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
919
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
920
+ var isSequence = isNumericSequence || isAlphaSequence;
921
+ var isOptions = m.body.indexOf(",") >= 0;
922
+ if (!isSequence && !isOptions) {
923
+ if (m.post.match(/,(?!,).*\}/)) {
924
+ str = m.pre + "{" + m.body + escClose + m.post;
925
+ return expand2(str);
926
+ }
927
+ return [str];
928
+ }
929
+ var n;
930
+ if (isSequence) {
931
+ n = m.body.split(/\.\./);
932
+ } else {
933
+ n = parseCommaParts(m.body);
934
+ if (n.length === 1) {
935
+ n = expand2(n[0], false).map(embrace);
936
+ if (n.length === 1) {
937
+ return post.map(function(p) {
938
+ return m.pre + n[0] + p;
939
+ });
940
+ }
941
+ }
942
+ }
943
+ var N;
944
+ if (isSequence) {
945
+ var x = numeric(n[0]);
946
+ var y = numeric(n[1]);
947
+ var width = Math.max(n[0].length, n[1].length);
948
+ var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
949
+ var test = lte;
950
+ var reverse = y < x;
951
+ if (reverse) {
952
+ incr *= -1;
953
+ test = gte;
954
+ }
955
+ var pad = n.some(isPadded);
956
+ N = [];
957
+ for (var i2 = x; test(i2, y); i2 += incr) {
958
+ var c;
959
+ if (isAlphaSequence) {
960
+ c = String.fromCharCode(i2);
961
+ if (c === "\\")
962
+ c = "";
963
+ } else {
964
+ c = String(i2);
965
+ if (pad) {
966
+ var need = width - c.length;
967
+ if (need > 0) {
968
+ var z = new Array(need + 1).join("0");
969
+ if (i2 < 0)
970
+ c = "-" + z + c.slice(1);
971
+ else
972
+ c = z + c;
973
+ }
974
+ }
975
+ }
976
+ N.push(c);
977
+ }
978
+ } else {
979
+ N = [];
980
+ for (var j = 0; j < n.length; j++) {
981
+ N.push.apply(N, expand2(n[j], false));
982
+ }
983
+ }
984
+ for (var j = 0; j < N.length; j++) {
985
+ for (var k = 0; k < post.length; k++) {
986
+ var expansion = pre + N[j] + post[k];
987
+ if (!isTop || isSequence || expansion)
988
+ expansions.push(expansion);
989
+ }
990
+ }
991
+ }
992
+ return expansions;
993
+ }
994
+ }
995
+ });
996
+
997
+ // src/utils/constants.ts
998
+ var SVG_NS = "http://www.w3.org/2000/svg";
999
+ var HTML_NS = "http://www.w3.org/1999/xhtml";
1000
+
1001
+ // src/client/client-host-ref.ts
1002
+ var getHostRef = (ref) => {
1003
+ if (ref.__stencil__getHostRef) {
1004
+ return ref.__stencil__getHostRef();
1005
+ }
1006
+ return void 0;
1007
+ };
1008
+ var registerHost = (hostElement, cmpMeta) => {
1009
+ const hostRef = {
1010
+ $flags$: 0,
1011
+ $hostElement$: hostElement,
1012
+ $cmpMeta$: cmpMeta,
1013
+ $instanceValues$: /* @__PURE__ */ new Map(),
1014
+ $serializerValues$: /* @__PURE__ */ new Map()
1015
+ };
1016
+ {
1017
+ hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
1018
+ hostElement["s-p"] = [];
1019
+ hostElement["s-rc"] = [];
1020
+ }
1021
+ {
1022
+ hostRef.$fetchedCbList$ = [];
1023
+ }
1024
+ const ref = hostRef;
1025
+ hostElement.__stencil__getHostRef = () => ref;
1026
+ return ref;
1027
+ };
1028
+ var isMemberInElement = (elm, memberName) => memberName in elm;
1029
+ var consoleError = (e, el) => (0, console.error)(e, el);
1030
+
1031
+ // src/client/client-load-module.ts
1032
+ var cmpModules = /* @__PURE__ */ new Map();
1033
+ var loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1034
+ const exportName = cmpMeta.$tagName$.replace(/-/g, "_");
1035
+ const bundleId = cmpMeta.$lazyBundleId$;
1036
+ if (!bundleId) {
1037
+ return void 0;
1038
+ }
1039
+ const module = cmpModules.get(bundleId) ;
1040
+ if (module) {
1041
+ return module[exportName];
1042
+ }
1043
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
1044
+ return import(
1045
+ /* @vite-ignore */
1046
+ /* webpackInclude: /\.entry\.js$/ */
1047
+ /* webpackExclude: /\.system\.entry\.js$/ */
1048
+ /* webpackMode: "lazy" */
1049
+ `./${bundleId}.entry.js${""}`
1050
+ ).then(
1051
+ (importedModule) => {
1052
+ {
1053
+ cmpModules.set(bundleId, importedModule);
1054
+ }
1055
+ return importedModule[exportName];
1056
+ },
1057
+ (e) => {
1058
+ consoleError(e, hostRef.$hostElement$);
1059
+ }
1060
+ );
1061
+ };
1062
+
1063
+ // src/client/client-style.ts
1064
+ var styles = /* @__PURE__ */ new Map();
1065
+ var HYDRATED_CSS = "{visibility:hidden}.hydrated{visibility:inherit}";
1066
+ var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
1067
+ var win = typeof window !== "undefined" ? window : {};
1068
+ var plt = {
1069
+ $flags$: 0,
1070
+ $resourcesUrl$: "",
1071
+ jmp: (h2) => h2(),
1072
+ raf: (h2) => requestAnimationFrame(h2),
1073
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
1074
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1075
+ ce: (eventName, opts) => new CustomEvent(eventName, opts)
1076
+ };
1077
+ var promiseResolve = (v) => Promise.resolve(v);
1078
+ var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
1079
+ try {
1080
+ if (!win.document.adoptedStyleSheets) {
1081
+ return false;
1082
+ }
1083
+ new CSSStyleSheet();
1084
+ return typeof new CSSStyleSheet().replaceSync === "function";
1085
+ } catch (e) {
1086
+ }
1087
+ return false;
1088
+ })() ;
1089
+ var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @__PURE__ */ (() => !!win.document && Object.getOwnPropertyDescriptor(win.document.adoptedStyleSheets, "length").writable)() : false;
1090
+ var queuePending = false;
1091
+ var queueDomReads = [];
1092
+ var queueDomWrites = [];
1093
+ var queueTask = (queue, write) => (cb) => {
1094
+ queue.push(cb);
1095
+ if (!queuePending) {
1096
+ queuePending = true;
1097
+ if (plt.$flags$ & 4 /* queueSync */) {
1098
+ nextTick(flush);
1099
+ } else {
1100
+ plt.raf(flush);
1101
+ }
1102
+ }
1103
+ };
1104
+ var consume = (queue) => {
1105
+ for (let i2 = 0; i2 < queue.length; i2++) {
1106
+ try {
1107
+ queue[i2](performance.now());
1108
+ } catch (e) {
1109
+ consoleError(e);
1110
+ }
1111
+ }
1112
+ queue.length = 0;
1113
+ };
1114
+ var flush = () => {
1115
+ consume(queueDomReads);
1116
+ {
1117
+ consume(queueDomWrites);
1118
+ if (queuePending = queueDomReads.length > 0) {
1119
+ plt.raf(flush);
1120
+ }
1121
+ }
1122
+ };
1123
+ var nextTick = (cb) => promiseResolve().then(cb);
1124
+ var writeTask = /* @__PURE__ */ queueTask(queueDomWrites);
1125
+ var isComplexType = (o) => {
1126
+ o = typeof o;
1127
+ return o === "object" || o === "function";
1128
+ };
1129
+
1130
+ // node_modules/minimatch/dist/esm/index.js
1131
+ var import_brace_expansion = __toESM(require_brace_expansion());
1132
+
1133
+ // node_modules/minimatch/dist/esm/assert-valid-pattern.js
1134
+ var MAX_PATTERN_LENGTH = 1024 * 64;
1135
+ var assertValidPattern = (pattern) => {
1136
+ if (typeof pattern !== "string") {
1137
+ throw new TypeError("invalid pattern");
1138
+ }
1139
+ if (pattern.length > MAX_PATTERN_LENGTH) {
1140
+ throw new TypeError("pattern is too long");
1141
+ }
1142
+ };
1143
+
1144
+ // node_modules/minimatch/dist/esm/brace-expressions.js
1145
+ var posixClasses = {
1146
+ "[:alnum:]": ["\\p{L}\\p{Nl}\\p{Nd}", true],
1147
+ "[:alpha:]": ["\\p{L}\\p{Nl}", true],
1148
+ "[:ascii:]": ["\\x00-\\x7f", false],
1149
+ "[:blank:]": ["\\p{Zs}\\t", true],
1150
+ "[:cntrl:]": ["\\p{Cc}", true],
1151
+ "[:digit:]": ["\\p{Nd}", true],
1152
+ "[:graph:]": ["\\p{Z}\\p{C}", true, true],
1153
+ "[:lower:]": ["\\p{Ll}", true],
1154
+ "[:print:]": ["\\p{C}", true],
1155
+ "[:punct:]": ["\\p{P}", true],
1156
+ "[:space:]": ["\\p{Z}\\t\\r\\n\\v\\f", true],
1157
+ "[:upper:]": ["\\p{Lu}", true],
1158
+ "[:word:]": ["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}", true],
1159
+ "[:xdigit:]": ["A-Fa-f0-9", false]
1160
+ };
1161
+ var braceEscape = (s) => s.replace(/[[\]\\-]/g, "\\$&");
1162
+ var regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
1163
+ var rangesToString = (ranges) => ranges.join("");
1164
+ var parseClass = (glob, position) => {
1165
+ const pos = position;
1166
+ if (glob.charAt(pos) !== "[") {
1167
+ throw new Error("not in a brace expression");
1168
+ }
1169
+ const ranges = [];
1170
+ const negs = [];
1171
+ let i2 = pos + 1;
1172
+ let sawStart = false;
1173
+ let uflag = false;
1174
+ let escaping = false;
1175
+ let negate = false;
1176
+ let endPos = pos;
1177
+ let rangeStart = "";
1178
+ WHILE: while (i2 < glob.length) {
1179
+ const c = glob.charAt(i2);
1180
+ if ((c === "!" || c === "^") && i2 === pos + 1) {
1181
+ negate = true;
1182
+ i2++;
1183
+ continue;
1184
+ }
1185
+ if (c === "]" && sawStart && !escaping) {
1186
+ endPos = i2 + 1;
1187
+ break;
1188
+ }
1189
+ sawStart = true;
1190
+ if (c === "\\") {
1191
+ if (!escaping) {
1192
+ escaping = true;
1193
+ i2++;
1194
+ continue;
1195
+ }
1196
+ }
1197
+ if (c === "[" && !escaping) {
1198
+ for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
1199
+ if (glob.startsWith(cls, i2)) {
1200
+ if (rangeStart) {
1201
+ return ["$.", false, glob.length - pos, true];
1202
+ }
1203
+ i2 += cls.length;
1204
+ if (neg)
1205
+ negs.push(unip);
1206
+ else
1207
+ ranges.push(unip);
1208
+ uflag = uflag || u;
1209
+ continue WHILE;
1210
+ }
1211
+ }
1212
+ }
1213
+ escaping = false;
1214
+ if (rangeStart) {
1215
+ if (c > rangeStart) {
1216
+ ranges.push(braceEscape(rangeStart) + "-" + braceEscape(c));
1217
+ } else if (c === rangeStart) {
1218
+ ranges.push(braceEscape(c));
1219
+ }
1220
+ rangeStart = "";
1221
+ i2++;
1222
+ continue;
1223
+ }
1224
+ if (glob.startsWith("-]", i2 + 1)) {
1225
+ ranges.push(braceEscape(c + "-"));
1226
+ i2 += 2;
1227
+ continue;
1228
+ }
1229
+ if (glob.startsWith("-", i2 + 1)) {
1230
+ rangeStart = c;
1231
+ i2 += 2;
1232
+ continue;
1233
+ }
1234
+ ranges.push(braceEscape(c));
1235
+ i2++;
1236
+ }
1237
+ if (endPos < i2) {
1238
+ return ["", false, 0, false];
1239
+ }
1240
+ if (!ranges.length && !negs.length) {
1241
+ return ["$.", false, glob.length - pos, true];
1242
+ }
1243
+ if (negs.length === 0 && ranges.length === 1 && /^\\?.$/.test(ranges[0]) && !negate) {
1244
+ const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
1245
+ return [regexpEscape(r), false, endPos - pos, false];
1246
+ }
1247
+ const sranges = "[" + (negate ? "^" : "") + rangesToString(ranges) + "]";
1248
+ const snegs = "[" + (negate ? "" : "^") + rangesToString(negs) + "]";
1249
+ const comb = ranges.length && negs.length ? "(" + sranges + "|" + snegs + ")" : ranges.length ? sranges : snegs;
1250
+ return [comb, uflag, endPos - pos, true];
1251
+ };
1252
+
1253
+ // node_modules/minimatch/dist/esm/unescape.js
1254
+ var unescape = (s, { windowsPathsNoEscape = false } = {}) => {
1255
+ return windowsPathsNoEscape ? s.replace(/\[([^\/\\])\]/g, "$1") : s.replace(/((?!\\).|^)\[([^\/\\])\]/g, "$1$2").replace(/\\([^\/])/g, "$1");
1256
+ };
1257
+
1258
+ // node_modules/minimatch/dist/esm/ast.js
1259
+ var types = /* @__PURE__ */ new Set(["!", "?", "+", "*", "@"]);
1260
+ var isExtglobType = (c) => types.has(c);
1261
+ var startNoTraversal = "(?!(?:^|/)\\.\\.?(?:$|/))";
1262
+ var startNoDot = "(?!\\.)";
1263
+ var addPatternStart = /* @__PURE__ */ new Set(["[", "."]);
1264
+ var justDots = /* @__PURE__ */ new Set(["..", "."]);
1265
+ var reSpecials = new Set("().*{}+?[]^$\\!");
1266
+ var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
1267
+ var qmark = "[^/]";
1268
+ var star = qmark + "*?";
1269
+ var starNoEmpty = qmark + "+?";
1270
+ var _root, _hasMagic, _uflag, _parts, _parent, _parentIndex, _negs, _filledNegs, _options, _toString, _emptyExt, _AST_instances, fillNegs_fn, _AST_static, parseAST_fn, partsToRegExp_fn, parseGlob_fn;
1271
+ var _AST = class _AST {
1272
+ constructor(type, parent, options = {}) {
1273
+ __privateAdd(this, _AST_instances);
1274
+ __publicField(this, "type");
1275
+ __privateAdd(this, _root);
1276
+ __privateAdd(this, _hasMagic);
1277
+ __privateAdd(this, _uflag, false);
1278
+ __privateAdd(this, _parts, []);
1279
+ __privateAdd(this, _parent);
1280
+ __privateAdd(this, _parentIndex);
1281
+ __privateAdd(this, _negs);
1282
+ __privateAdd(this, _filledNegs, false);
1283
+ __privateAdd(this, _options);
1284
+ __privateAdd(this, _toString);
1285
+ // set to true if it's an extglob with no children
1286
+ // (which really means one child of '')
1287
+ __privateAdd(this, _emptyExt, false);
1288
+ this.type = type;
1289
+ if (type)
1290
+ __privateSet(this, _hasMagic, true);
1291
+ __privateSet(this, _parent, parent);
1292
+ __privateSet(this, _root, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _root) : this);
1293
+ __privateSet(this, _options, __privateGet(this, _root) === this ? options : __privateGet(__privateGet(this, _root), _options));
1294
+ __privateSet(this, _negs, __privateGet(this, _root) === this ? [] : __privateGet(__privateGet(this, _root), _negs));
1295
+ if (type === "!" && !__privateGet(__privateGet(this, _root), _filledNegs))
1296
+ __privateGet(this, _negs).push(this);
1297
+ __privateSet(this, _parentIndex, __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0);
1298
+ }
1299
+ get hasMagic() {
1300
+ if (__privateGet(this, _hasMagic) !== void 0)
1301
+ return __privateGet(this, _hasMagic);
1302
+ for (const p of __privateGet(this, _parts)) {
1303
+ if (typeof p === "string")
1304
+ continue;
1305
+ if (p.type || p.hasMagic)
1306
+ return __privateSet(this, _hasMagic, true);
1307
+ }
1308
+ return __privateGet(this, _hasMagic);
1309
+ }
1310
+ // reconstructs the pattern
1311
+ toString() {
1312
+ if (__privateGet(this, _toString) !== void 0)
1313
+ return __privateGet(this, _toString);
1314
+ if (!this.type) {
1315
+ return __privateSet(this, _toString, __privateGet(this, _parts).map((p) => String(p)).join(""));
1316
+ } else {
1317
+ return __privateSet(this, _toString, this.type + "(" + __privateGet(this, _parts).map((p) => String(p)).join("|") + ")");
1318
+ }
1319
+ }
1320
+ push(...parts) {
1321
+ for (const p of parts) {
1322
+ if (p === "")
1323
+ continue;
1324
+ if (typeof p !== "string" && !(p instanceof _AST && __privateGet(p, _parent) === this)) {
1325
+ throw new Error("invalid part: " + p);
1326
+ }
1327
+ __privateGet(this, _parts).push(p);
1328
+ }
1329
+ }
1330
+ toJSON() {
1331
+ var _a;
1332
+ const ret = this.type === null ? __privateGet(this, _parts).slice().map((p) => typeof p === "string" ? p : p.toJSON()) : [this.type, ...__privateGet(this, _parts).map((p) => p.toJSON())];
1333
+ if (this.isStart() && !this.type)
1334
+ ret.unshift([]);
1335
+ if (this.isEnd() && (this === __privateGet(this, _root) || __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")) {
1336
+ ret.push({});
1337
+ }
1338
+ return ret;
1339
+ }
1340
+ isStart() {
1341
+ var _a;
1342
+ if (__privateGet(this, _root) === this)
1343
+ return true;
1344
+ if (!((_a = __privateGet(this, _parent)) == null ? void 0 : _a.isStart()))
1345
+ return false;
1346
+ if (__privateGet(this, _parentIndex) === 0)
1347
+ return true;
1348
+ const p = __privateGet(this, _parent);
1349
+ for (let i2 = 0; i2 < __privateGet(this, _parentIndex); i2++) {
1350
+ const pp = __privateGet(p, _parts)[i2];
1351
+ if (!(pp instanceof _AST && pp.type === "!")) {
1352
+ return false;
1353
+ }
1354
+ }
1355
+ return true;
1356
+ }
1357
+ isEnd() {
1358
+ var _a, _b, _c;
1359
+ if (__privateGet(this, _root) === this)
1360
+ return true;
1361
+ if (((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!")
1362
+ return true;
1363
+ if (!((_b = __privateGet(this, _parent)) == null ? void 0 : _b.isEnd()))
1364
+ return false;
1365
+ if (!this.type)
1366
+ return (_c = __privateGet(this, _parent)) == null ? void 0 : _c.isEnd();
1367
+ const pl = __privateGet(this, _parent) ? __privateGet(__privateGet(this, _parent), _parts).length : 0;
1368
+ return __privateGet(this, _parentIndex) === pl - 1;
1369
+ }
1370
+ copyIn(part) {
1371
+ if (typeof part === "string")
1372
+ this.push(part);
1373
+ else
1374
+ this.push(part.clone(this));
1375
+ }
1376
+ clone(parent) {
1377
+ const c = new _AST(this.type, parent);
1378
+ for (const p of __privateGet(this, _parts)) {
1379
+ c.copyIn(p);
1380
+ }
1381
+ return c;
1382
+ }
1383
+ static fromGlob(pattern, options = {}) {
1384
+ var _a;
1385
+ const ast = new _AST(null, void 0, options);
1386
+ __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, pattern, ast, 0, options);
1387
+ return ast;
1388
+ }
1389
+ // returns the regular expression if there's magic, or the unescaped
1390
+ // string if not.
1391
+ toMMPattern() {
1392
+ if (this !== __privateGet(this, _root))
1393
+ return __privateGet(this, _root).toMMPattern();
1394
+ const glob = this.toString();
1395
+ const [re, body, hasMagic, uflag] = this.toRegExpSource();
1396
+ const anyMagic = hasMagic || __privateGet(this, _hasMagic) || __privateGet(this, _options).nocase && !__privateGet(this, _options).nocaseMagicOnly && glob.toUpperCase() !== glob.toLowerCase();
1397
+ if (!anyMagic) {
1398
+ return body;
1399
+ }
1400
+ const flags = (__privateGet(this, _options).nocase ? "i" : "") + (uflag ? "u" : "");
1401
+ return Object.assign(new RegExp(`^${re}$`, flags), {
1402
+ _src: re,
1403
+ _glob: glob
1404
+ });
1405
+ }
1406
+ get options() {
1407
+ return __privateGet(this, _options);
1408
+ }
1409
+ // returns the string match, the regexp source, whether there's magic
1410
+ // in the regexp (so a regular expression is required) and whether or
1411
+ // not the uflag is needed for the regular expression (for posix classes)
1412
+ // TODO: instead of injecting the start/end at this point, just return
1413
+ // the BODY of the regexp, along with the start/end portions suitable
1414
+ // for binding the start/end in either a joined full-path makeRe context
1415
+ // (where we bind to (^|/), or a standalone matchPart context (where
1416
+ // we bind to ^, and not /). Otherwise slashes get duped!
1417
+ //
1418
+ // In part-matching mode, the start is:
1419
+ // - if not isStart: nothing
1420
+ // - if traversal possible, but not allowed: ^(?!\.\.?$)
1421
+ // - if dots allowed or not possible: ^
1422
+ // - if dots possible and not allowed: ^(?!\.)
1423
+ // end is:
1424
+ // - if not isEnd(): nothing
1425
+ // - else: $
1426
+ //
1427
+ // In full-path matching mode, we put the slash at the START of the
1428
+ // pattern, so start is:
1429
+ // - if first pattern: same as part-matching mode
1430
+ // - if not isStart(): nothing
1431
+ // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
1432
+ // - if dots allowed or not possible: /
1433
+ // - if dots possible and not allowed: /(?!\.)
1434
+ // end is:
1435
+ // - if last pattern, same as part-matching mode
1436
+ // - else nothing
1437
+ //
1438
+ // Always put the (?:$|/) on negated tails, though, because that has to be
1439
+ // there to bind the end of the negated pattern portion, and it's easier to
1440
+ // just stick it in now rather than try to inject it later in the middle of
1441
+ // the pattern.
1442
+ //
1443
+ // We can just always return the same end, and leave it up to the caller
1444
+ // to know whether it's going to be used joined or in parts.
1445
+ // And, if the start is adjusted slightly, can do the same there:
1446
+ // - if not isStart: nothing
1447
+ // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
1448
+ // - if dots allowed or not possible: (?:/|^)
1449
+ // - if dots possible and not allowed: (?:/|^)(?!\.)
1450
+ //
1451
+ // But it's better to have a simpler binding without a conditional, for
1452
+ // performance, so probably better to return both start options.
1453
+ //
1454
+ // Then the caller just ignores the end if it's not the first pattern,
1455
+ // and the start always gets applied.
1456
+ //
1457
+ // But that's always going to be $ if it's the ending pattern, or nothing,
1458
+ // so the caller can just attach $ at the end of the pattern when building.
1459
+ //
1460
+ // So the todo is:
1461
+ // - better detect what kind of start is needed
1462
+ // - return both flavors of starting pattern
1463
+ // - attach $ at the end of the pattern when creating the actual RegExp
1464
+ //
1465
+ // Ah, but wait, no, that all only applies to the root when the first pattern
1466
+ // is not an extglob. If the first pattern IS an extglob, then we need all
1467
+ // that dot prevention biz to live in the extglob portions, because eg
1468
+ // +(*|.x*) can match .xy but not .yx.
1469
+ //
1470
+ // So, return the two flavors if it's #root and the first child is not an
1471
+ // AST, otherwise leave it to the child AST to handle it, and there,
1472
+ // use the (?:^|/) style of start binding.
1473
+ //
1474
+ // Even simplified further:
1475
+ // - Since the start for a join is eg /(?!\.) and the start for a part
1476
+ // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
1477
+ // or start or whatever) and prepend ^ or / at the Regexp construction.
1478
+ toRegExpSource(allowDot) {
1479
+ var _a;
1480
+ const dot = allowDot != null ? allowDot : !!__privateGet(this, _options).dot;
1481
+ if (__privateGet(this, _root) === this)
1482
+ __privateMethod(this, _AST_instances, fillNegs_fn).call(this);
1483
+ if (!this.type) {
1484
+ const noEmpty = this.isStart() && this.isEnd();
1485
+ const src = __privateGet(this, _parts).map((p) => {
1486
+ var _a2;
1487
+ const [re, _, hasMagic, uflag] = typeof p === "string" ? __privateMethod(_a2 = _AST, _AST_static, parseGlob_fn).call(_a2, p, __privateGet(this, _hasMagic), noEmpty) : p.toRegExpSource(allowDot);
1488
+ __privateSet(this, _hasMagic, __privateGet(this, _hasMagic) || hasMagic);
1489
+ __privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
1490
+ return re;
1491
+ }).join("");
1492
+ let start2 = "";
1493
+ if (this.isStart()) {
1494
+ if (typeof __privateGet(this, _parts)[0] === "string") {
1495
+ const dotTravAllowed = __privateGet(this, _parts).length === 1 && justDots.has(__privateGet(this, _parts)[0]);
1496
+ if (!dotTravAllowed) {
1497
+ const aps = addPatternStart;
1498
+ const needNoTrav = (
1499
+ // dots are allowed, and the pattern starts with [ or .
1500
+ dot && aps.has(src.charAt(0)) || // the pattern starts with \., and then [ or .
1501
+ src.startsWith("\\.") && aps.has(src.charAt(2)) || // the pattern starts with \.\., and then [ or .
1502
+ src.startsWith("\\.\\.") && aps.has(src.charAt(4))
1503
+ );
1504
+ const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
1505
+ start2 = needNoTrav ? startNoTraversal : needNoDot ? startNoDot : "";
1506
+ }
1507
+ }
1508
+ }
1509
+ let end = "";
1510
+ if (this.isEnd() && __privateGet(__privateGet(this, _root), _filledNegs) && ((_a = __privateGet(this, _parent)) == null ? void 0 : _a.type) === "!") {
1511
+ end = "(?:$|\\/)";
1512
+ }
1513
+ const final2 = start2 + src + end;
1514
+ return [
1515
+ final2,
1516
+ unescape(src),
1517
+ __privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
1518
+ __privateGet(this, _uflag)
1519
+ ];
1520
+ }
1521
+ const repeated = this.type === "*" || this.type === "+";
1522
+ const start = this.type === "!" ? "(?:(?!(?:" : "(?:";
1523
+ let body = __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, dot);
1524
+ if (this.isStart() && this.isEnd() && !body && this.type !== "!") {
1525
+ const s = this.toString();
1526
+ __privateSet(this, _parts, [s]);
1527
+ this.type = null;
1528
+ __privateSet(this, _hasMagic, void 0);
1529
+ return [s, unescape(this.toString()), false, false];
1530
+ }
1531
+ let bodyDotAllowed = !repeated || allowDot || dot || false ? "" : __privateMethod(this, _AST_instances, partsToRegExp_fn).call(this, true);
1532
+ if (bodyDotAllowed === body) {
1533
+ bodyDotAllowed = "";
1534
+ }
1535
+ if (bodyDotAllowed) {
1536
+ body = `(?:${body})(?:${bodyDotAllowed})*?`;
1537
+ }
1538
+ let final = "";
1539
+ if (this.type === "!" && __privateGet(this, _emptyExt)) {
1540
+ final = (this.isStart() && !dot ? startNoDot : "") + starNoEmpty;
1541
+ } else {
1542
+ const close = this.type === "!" ? (
1543
+ // !() must match something,but !(x) can match ''
1544
+ "))" + (this.isStart() && !dot && !allowDot ? startNoDot : "") + star + ")"
1545
+ ) : this.type === "@" ? ")" : this.type === "?" ? ")?" : this.type === "+" && bodyDotAllowed ? ")" : this.type === "*" && bodyDotAllowed ? `)?` : `)${this.type}`;
1546
+ final = start + body + close;
1547
+ }
1548
+ return [
1549
+ final,
1550
+ unescape(body),
1551
+ __privateSet(this, _hasMagic, !!__privateGet(this, _hasMagic)),
1552
+ __privateGet(this, _uflag)
1553
+ ];
1554
+ }
1555
+ };
1556
+ _root = new WeakMap();
1557
+ _hasMagic = new WeakMap();
1558
+ _uflag = new WeakMap();
1559
+ _parts = new WeakMap();
1560
+ _parent = new WeakMap();
1561
+ _parentIndex = new WeakMap();
1562
+ _negs = new WeakMap();
1563
+ _filledNegs = new WeakMap();
1564
+ _options = new WeakMap();
1565
+ _toString = new WeakMap();
1566
+ _emptyExt = new WeakMap();
1567
+ _AST_instances = new WeakSet();
1568
+ fillNegs_fn = function() {
1569
+ if (this !== __privateGet(this, _root))
1570
+ throw new Error("should only call on root");
1571
+ if (__privateGet(this, _filledNegs))
1572
+ return this;
1573
+ this.toString();
1574
+ __privateSet(this, _filledNegs, true);
1575
+ let n;
1576
+ while (n = __privateGet(this, _negs).pop()) {
1577
+ if (n.type !== "!")
1578
+ continue;
1579
+ let p = n;
1580
+ let pp = __privateGet(p, _parent);
1581
+ while (pp) {
1582
+ for (let i2 = __privateGet(p, _parentIndex) + 1; !pp.type && i2 < __privateGet(pp, _parts).length; i2++) {
1583
+ for (const part of __privateGet(n, _parts)) {
1584
+ if (typeof part === "string") {
1585
+ throw new Error("string part in extglob AST??");
1586
+ }
1587
+ part.copyIn(__privateGet(pp, _parts)[i2]);
1588
+ }
1589
+ }
1590
+ p = pp;
1591
+ pp = __privateGet(p, _parent);
1592
+ }
1593
+ }
1594
+ return this;
1595
+ };
1596
+ _AST_static = new WeakSet();
1597
+ parseAST_fn = function(str, ast, pos, opt) {
1598
+ var _a, _b;
1599
+ let escaping = false;
1600
+ let inBrace = false;
1601
+ let braceStart = -1;
1602
+ let braceNeg = false;
1603
+ if (ast.type === null) {
1604
+ let i3 = pos;
1605
+ let acc2 = "";
1606
+ while (i3 < str.length) {
1607
+ const c = str.charAt(i3++);
1608
+ if (escaping || c === "\\") {
1609
+ escaping = !escaping;
1610
+ acc2 += c;
1611
+ continue;
1612
+ }
1613
+ if (inBrace) {
1614
+ if (i3 === braceStart + 1) {
1615
+ if (c === "^" || c === "!") {
1616
+ braceNeg = true;
1617
+ }
1618
+ } else if (c === "]" && !(i3 === braceStart + 2 && braceNeg)) {
1619
+ inBrace = false;
1620
+ }
1621
+ acc2 += c;
1622
+ continue;
1623
+ } else if (c === "[") {
1624
+ inBrace = true;
1625
+ braceStart = i3;
1626
+ braceNeg = false;
1627
+ acc2 += c;
1628
+ continue;
1629
+ }
1630
+ if (!opt.noext && isExtglobType(c) && str.charAt(i3) === "(") {
1631
+ ast.push(acc2);
1632
+ acc2 = "";
1633
+ const ext2 = new _AST(c, ast);
1634
+ i3 = __privateMethod(_a = _AST, _AST_static, parseAST_fn).call(_a, str, ext2, i3, opt);
1635
+ ast.push(ext2);
1636
+ continue;
1637
+ }
1638
+ acc2 += c;
1639
+ }
1640
+ ast.push(acc2);
1641
+ return i3;
1642
+ }
1643
+ let i2 = pos + 1;
1644
+ let part = new _AST(null, ast);
1645
+ const parts = [];
1646
+ let acc = "";
1647
+ while (i2 < str.length) {
1648
+ const c = str.charAt(i2++);
1649
+ if (escaping || c === "\\") {
1650
+ escaping = !escaping;
1651
+ acc += c;
1652
+ continue;
1653
+ }
1654
+ if (inBrace) {
1655
+ if (i2 === braceStart + 1) {
1656
+ if (c === "^" || c === "!") {
1657
+ braceNeg = true;
1658
+ }
1659
+ } else if (c === "]" && !(i2 === braceStart + 2 && braceNeg)) {
1660
+ inBrace = false;
1661
+ }
1662
+ acc += c;
1663
+ continue;
1664
+ } else if (c === "[") {
1665
+ inBrace = true;
1666
+ braceStart = i2;
1667
+ braceNeg = false;
1668
+ acc += c;
1669
+ continue;
1670
+ }
1671
+ if (isExtglobType(c) && str.charAt(i2) === "(") {
1672
+ part.push(acc);
1673
+ acc = "";
1674
+ const ext2 = new _AST(c, part);
1675
+ part.push(ext2);
1676
+ i2 = __privateMethod(_b = _AST, _AST_static, parseAST_fn).call(_b, str, ext2, i2, opt);
1677
+ continue;
1678
+ }
1679
+ if (c === "|") {
1680
+ part.push(acc);
1681
+ acc = "";
1682
+ parts.push(part);
1683
+ part = new _AST(null, ast);
1684
+ continue;
1685
+ }
1686
+ if (c === ")") {
1687
+ if (acc === "" && __privateGet(ast, _parts).length === 0) {
1688
+ __privateSet(ast, _emptyExt, true);
1689
+ }
1690
+ part.push(acc);
1691
+ acc = "";
1692
+ ast.push(...parts, part);
1693
+ return i2;
1694
+ }
1695
+ acc += c;
1696
+ }
1697
+ ast.type = null;
1698
+ __privateSet(ast, _hasMagic, void 0);
1699
+ __privateSet(ast, _parts, [str.substring(pos - 1)]);
1700
+ return i2;
1701
+ };
1702
+ partsToRegExp_fn = function(dot) {
1703
+ return __privateGet(this, _parts).map((p) => {
1704
+ if (typeof p === "string") {
1705
+ throw new Error("string type in extglob ast??");
1706
+ }
1707
+ const [re, _, _hasMagic2, uflag] = p.toRegExpSource(dot);
1708
+ __privateSet(this, _uflag, __privateGet(this, _uflag) || uflag);
1709
+ return re;
1710
+ }).filter((p) => !(this.isStart() && this.isEnd()) || !!p).join("|");
1711
+ };
1712
+ parseGlob_fn = function(glob, hasMagic, noEmpty = false) {
1713
+ let escaping = false;
1714
+ let re = "";
1715
+ let uflag = false;
1716
+ for (let i2 = 0; i2 < glob.length; i2++) {
1717
+ const c = glob.charAt(i2);
1718
+ if (escaping) {
1719
+ escaping = false;
1720
+ re += (reSpecials.has(c) ? "\\" : "") + c;
1721
+ continue;
1722
+ }
1723
+ if (c === "\\") {
1724
+ if (i2 === glob.length - 1) {
1725
+ re += "\\\\";
1726
+ } else {
1727
+ escaping = true;
1728
+ }
1729
+ continue;
1730
+ }
1731
+ if (c === "[") {
1732
+ const [src, needUflag, consumed, magic] = parseClass(glob, i2);
1733
+ if (consumed) {
1734
+ re += src;
1735
+ uflag = uflag || needUflag;
1736
+ i2 += consumed - 1;
1737
+ hasMagic = hasMagic || magic;
1738
+ continue;
1739
+ }
1740
+ }
1741
+ if (c === "*") {
1742
+ if (noEmpty && glob === "*")
1743
+ re += starNoEmpty;
1744
+ else
1745
+ re += star;
1746
+ hasMagic = true;
1747
+ continue;
1748
+ }
1749
+ if (c === "?") {
1750
+ re += qmark;
1751
+ hasMagic = true;
1752
+ continue;
1753
+ }
1754
+ re += regExpEscape(c);
1755
+ }
1756
+ return [re, unescape(glob), !!hasMagic, uflag];
1757
+ };
1758
+ __privateAdd(_AST, _AST_static);
1759
+ var AST = _AST;
1760
+
1761
+ // node_modules/minimatch/dist/esm/escape.js
1762
+ var escape = (s, { windowsPathsNoEscape = false } = {}) => {
1763
+ return windowsPathsNoEscape ? s.replace(/[?*()[\]]/g, "[$&]") : s.replace(/[?*()[\]\\]/g, "\\$&");
1764
+ };
1765
+
1766
+ // node_modules/minimatch/dist/esm/index.js
1767
+ var minimatch = (p, pattern, options = {}) => {
1768
+ assertValidPattern(pattern);
1769
+ if (!options.nocomment && pattern.charAt(0) === "#") {
1770
+ return false;
1771
+ }
1772
+ return new Minimatch(pattern, options).match(p);
1773
+ };
1774
+ var starDotExtRE = /^\*+([^+@!?\*\[\(]*)$/;
1775
+ var starDotExtTest = (ext2) => (f) => !f.startsWith(".") && f.endsWith(ext2);
1776
+ var starDotExtTestDot = (ext2) => (f) => f.endsWith(ext2);
1777
+ var starDotExtTestNocase = (ext2) => {
1778
+ ext2 = ext2.toLowerCase();
1779
+ return (f) => !f.startsWith(".") && f.toLowerCase().endsWith(ext2);
1780
+ };
1781
+ var starDotExtTestNocaseDot = (ext2) => {
1782
+ ext2 = ext2.toLowerCase();
1783
+ return (f) => f.toLowerCase().endsWith(ext2);
1784
+ };
1785
+ var starDotStarRE = /^\*+\.\*+$/;
1786
+ var starDotStarTest = (f) => !f.startsWith(".") && f.includes(".");
1787
+ var starDotStarTestDot = (f) => f !== "." && f !== ".." && f.includes(".");
1788
+ var dotStarRE = /^\.\*+$/;
1789
+ var dotStarTest = (f) => f !== "." && f !== ".." && f.startsWith(".");
1790
+ var starRE = /^\*+$/;
1791
+ var starTest = (f) => f.length !== 0 && !f.startsWith(".");
1792
+ var starTestDot = (f) => f.length !== 0 && f !== "." && f !== "..";
1793
+ var qmarksRE = /^\?+([^+@!?\*\[\(]*)?$/;
1794
+ var qmarksTestNocase = ([$0, ext2 = ""]) => {
1795
+ const noext = qmarksTestNoExt([$0]);
1796
+ if (!ext2)
1797
+ return noext;
1798
+ ext2 = ext2.toLowerCase();
1799
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
1800
+ };
1801
+ var qmarksTestNocaseDot = ([$0, ext2 = ""]) => {
1802
+ const noext = qmarksTestNoExtDot([$0]);
1803
+ if (!ext2)
1804
+ return noext;
1805
+ ext2 = ext2.toLowerCase();
1806
+ return (f) => noext(f) && f.toLowerCase().endsWith(ext2);
1807
+ };
1808
+ var qmarksTestDot = ([$0, ext2 = ""]) => {
1809
+ const noext = qmarksTestNoExtDot([$0]);
1810
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
1811
+ };
1812
+ var qmarksTest = ([$0, ext2 = ""]) => {
1813
+ const noext = qmarksTestNoExt([$0]);
1814
+ return !ext2 ? noext : (f) => noext(f) && f.endsWith(ext2);
1815
+ };
1816
+ var qmarksTestNoExt = ([$0]) => {
1817
+ const len = $0.length;
1818
+ return (f) => f.length === len && !f.startsWith(".");
1819
+ };
1820
+ var qmarksTestNoExtDot = ([$0]) => {
1821
+ const len = $0.length;
1822
+ return (f) => f.length === len && f !== "." && f !== "..";
1823
+ };
1824
+ var defaultPlatform = typeof process === "object" && process ? typeof process.env === "object" && process.env && process.env.__MINIMATCH_TESTING_PLATFORM__ || process.platform : "posix";
1825
+ var path = {
1826
+ win32: { sep: "\\" },
1827
+ posix: { sep: "/" }
1828
+ };
1829
+ var sep = defaultPlatform === "win32" ? path.win32.sep : path.posix.sep;
1830
+ minimatch.sep = sep;
1831
+ var GLOBSTAR = Symbol("globstar **");
1832
+ minimatch.GLOBSTAR = GLOBSTAR;
1833
+ var qmark2 = "[^/]";
1834
+ var star2 = qmark2 + "*?";
1835
+ var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
1836
+ var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
1837
+ var filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
1838
+ minimatch.filter = filter;
1839
+ var ext = (a, b = {}) => Object.assign({}, a, b);
1840
+ var defaults = (def) => {
1841
+ if (!def || typeof def !== "object" || !Object.keys(def).length) {
1842
+ return minimatch;
1843
+ }
1844
+ const orig = minimatch;
1845
+ const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
1846
+ return Object.assign(m, {
1847
+ Minimatch: class Minimatch extends orig.Minimatch {
1848
+ constructor(pattern, options = {}) {
1849
+ super(pattern, ext(def, options));
1850
+ }
1851
+ static defaults(options) {
1852
+ return orig.defaults(ext(def, options)).Minimatch;
1853
+ }
1854
+ },
1855
+ AST: class AST extends orig.AST {
1856
+ /* c8 ignore start */
1857
+ constructor(type, parent, options = {}) {
1858
+ super(type, parent, ext(def, options));
1859
+ }
1860
+ /* c8 ignore stop */
1861
+ static fromGlob(pattern, options = {}) {
1862
+ return orig.AST.fromGlob(pattern, ext(def, options));
1863
+ }
1864
+ },
1865
+ unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
1866
+ escape: (s, options = {}) => orig.escape(s, ext(def, options)),
1867
+ filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
1868
+ defaults: (options) => orig.defaults(ext(def, options)),
1869
+ makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
1870
+ braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
1871
+ match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
1872
+ sep: orig.sep,
1873
+ GLOBSTAR
1874
+ });
1875
+ };
1876
+ minimatch.defaults = defaults;
1877
+ var braceExpand = (pattern, options = {}) => {
1878
+ assertValidPattern(pattern);
1879
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
1880
+ return [pattern];
1881
+ }
1882
+ return (0, import_brace_expansion.default)(pattern);
1883
+ };
1884
+ minimatch.braceExpand = braceExpand;
1885
+ var makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
1886
+ minimatch.makeRe = makeRe;
1887
+ var match = (list, pattern, options = {}) => {
1888
+ const mm = new Minimatch(pattern, options);
1889
+ list = list.filter((f) => mm.match(f));
1890
+ if (mm.options.nonull && !list.length) {
1891
+ list.push(pattern);
1892
+ }
1893
+ return list;
1894
+ };
1895
+ minimatch.match = match;
1896
+ var globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
1897
+ var regExpEscape2 = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
1898
+ var Minimatch = class {
1899
+ options;
1900
+ set;
1901
+ pattern;
1902
+ windowsPathsNoEscape;
1903
+ nonegate;
1904
+ negate;
1905
+ comment;
1906
+ empty;
1907
+ preserveMultipleSlashes;
1908
+ partial;
1909
+ globSet;
1910
+ globParts;
1911
+ nocase;
1912
+ isWindows;
1913
+ platform;
1914
+ windowsNoMagicRoot;
1915
+ regexp;
1916
+ constructor(pattern, options = {}) {
1917
+ assertValidPattern(pattern);
1918
+ options = options || {};
1919
+ this.options = options;
1920
+ this.pattern = pattern;
1921
+ this.platform = options.platform || defaultPlatform;
1922
+ this.isWindows = this.platform === "win32";
1923
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
1924
+ if (this.windowsPathsNoEscape) {
1925
+ this.pattern = this.pattern.replace(/\\/g, "/");
1926
+ }
1927
+ this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
1928
+ this.regexp = null;
1929
+ this.negate = false;
1930
+ this.nonegate = !!options.nonegate;
1931
+ this.comment = false;
1932
+ this.empty = false;
1933
+ this.partial = !!options.partial;
1934
+ this.nocase = !!this.options.nocase;
1935
+ this.windowsNoMagicRoot = options.windowsNoMagicRoot !== void 0 ? options.windowsNoMagicRoot : !!(this.isWindows && this.nocase);
1936
+ this.globSet = [];
1937
+ this.globParts = [];
1938
+ this.set = [];
1939
+ this.make();
1940
+ }
1941
+ hasMagic() {
1942
+ if (this.options.magicalBraces && this.set.length > 1) {
1943
+ return true;
1944
+ }
1945
+ for (const pattern of this.set) {
1946
+ for (const part of pattern) {
1947
+ if (typeof part !== "string")
1948
+ return true;
1949
+ }
1950
+ }
1951
+ return false;
1952
+ }
1953
+ debug(..._) {
1954
+ }
1955
+ make() {
1956
+ const pattern = this.pattern;
1957
+ const options = this.options;
1958
+ if (!options.nocomment && pattern.charAt(0) === "#") {
1959
+ this.comment = true;
1960
+ return;
1961
+ }
1962
+ if (!pattern) {
1963
+ this.empty = true;
1964
+ return;
1965
+ }
1966
+ this.parseNegate();
1967
+ this.globSet = [...new Set(this.braceExpand())];
1968
+ if (options.debug) {
1969
+ this.debug = (...args) => console.error(...args);
1970
+ }
1971
+ this.debug(this.pattern, this.globSet);
1972
+ const rawGlobParts = this.globSet.map((s) => this.slashSplit(s));
1973
+ this.globParts = this.preprocess(rawGlobParts);
1974
+ this.debug(this.pattern, this.globParts);
1975
+ let set = this.globParts.map((s, _, __) => {
1976
+ if (this.isWindows && this.windowsNoMagicRoot) {
1977
+ const isUNC = s[0] === "" && s[1] === "" && (s[2] === "?" || !globMagic.test(s[2])) && !globMagic.test(s[3]);
1978
+ const isDrive = /^[a-z]:/i.test(s[0]);
1979
+ if (isUNC) {
1980
+ return [...s.slice(0, 4), ...s.slice(4).map((ss) => this.parse(ss))];
1981
+ } else if (isDrive) {
1982
+ return [s[0], ...s.slice(1).map((ss) => this.parse(ss))];
1983
+ }
1984
+ }
1985
+ return s.map((ss) => this.parse(ss));
1986
+ });
1987
+ this.debug(this.pattern, set);
1988
+ this.set = set.filter((s) => s.indexOf(false) === -1);
1989
+ if (this.isWindows) {
1990
+ for (let i2 = 0; i2 < this.set.length; i2++) {
1991
+ const p = this.set[i2];
1992
+ if (p[0] === "" && p[1] === "" && this.globParts[i2][2] === "?" && typeof p[3] === "string" && /^[a-z]:$/i.test(p[3])) {
1993
+ p[2] = "?";
1994
+ }
1995
+ }
1996
+ }
1997
+ this.debug(this.pattern, this.set);
1998
+ }
1999
+ // various transforms to equivalent pattern sets that are
2000
+ // faster to process in a filesystem walk. The goal is to
2001
+ // eliminate what we can, and push all ** patterns as far
2002
+ // to the right as possible, even if it increases the number
2003
+ // of patterns that we have to process.
2004
+ preprocess(globParts) {
2005
+ if (this.options.noglobstar) {
2006
+ for (let i2 = 0; i2 < globParts.length; i2++) {
2007
+ for (let j = 0; j < globParts[i2].length; j++) {
2008
+ if (globParts[i2][j] === "**") {
2009
+ globParts[i2][j] = "*";
2010
+ }
2011
+ }
2012
+ }
2013
+ }
2014
+ const { optimizationLevel = 1 } = this.options;
2015
+ if (optimizationLevel >= 2) {
2016
+ globParts = this.firstPhasePreProcess(globParts);
2017
+ globParts = this.secondPhasePreProcess(globParts);
2018
+ } else if (optimizationLevel >= 1) {
2019
+ globParts = this.levelOneOptimize(globParts);
2020
+ } else {
2021
+ globParts = this.adjascentGlobstarOptimize(globParts);
2022
+ }
2023
+ return globParts;
2024
+ }
2025
+ // just get rid of adjascent ** portions
2026
+ adjascentGlobstarOptimize(globParts) {
2027
+ return globParts.map((parts) => {
2028
+ let gs = -1;
2029
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
2030
+ let i2 = gs;
2031
+ while (parts[i2 + 1] === "**") {
2032
+ i2++;
2033
+ }
2034
+ if (i2 !== gs) {
2035
+ parts.splice(gs, i2 - gs);
2036
+ }
2037
+ }
2038
+ return parts;
2039
+ });
2040
+ }
2041
+ // get rid of adjascent ** and resolve .. portions
2042
+ levelOneOptimize(globParts) {
2043
+ return globParts.map((parts) => {
2044
+ parts = parts.reduce((set, part) => {
2045
+ const prev = set[set.length - 1];
2046
+ if (part === "**" && prev === "**") {
2047
+ return set;
2048
+ }
2049
+ if (part === "..") {
2050
+ if (prev && prev !== ".." && prev !== "." && prev !== "**") {
2051
+ set.pop();
2052
+ return set;
2053
+ }
2054
+ }
2055
+ set.push(part);
2056
+ return set;
2057
+ }, []);
2058
+ return parts.length === 0 ? [""] : parts;
2059
+ });
2060
+ }
2061
+ levelTwoFileOptimize(parts) {
2062
+ if (!Array.isArray(parts)) {
2063
+ parts = this.slashSplit(parts);
2064
+ }
2065
+ let didSomething = false;
2066
+ do {
2067
+ didSomething = false;
2068
+ if (!this.preserveMultipleSlashes) {
2069
+ for (let i2 = 1; i2 < parts.length - 1; i2++) {
2070
+ const p = parts[i2];
2071
+ if (i2 === 1 && p === "" && parts[0] === "")
2072
+ continue;
2073
+ if (p === "." || p === "") {
2074
+ didSomething = true;
2075
+ parts.splice(i2, 1);
2076
+ i2--;
2077
+ }
2078
+ }
2079
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
2080
+ didSomething = true;
2081
+ parts.pop();
2082
+ }
2083
+ }
2084
+ let dd = 0;
2085
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
2086
+ const p = parts[dd - 1];
2087
+ if (p && p !== "." && p !== ".." && p !== "**") {
2088
+ didSomething = true;
2089
+ parts.splice(dd - 1, 2);
2090
+ dd -= 2;
2091
+ }
2092
+ }
2093
+ } while (didSomething);
2094
+ return parts.length === 0 ? [""] : parts;
2095
+ }
2096
+ // First phase: single-pattern processing
2097
+ // <pre> is 1 or more portions
2098
+ // <rest> is 1 or more portions
2099
+ // <p> is any portion other than ., .., '', or **
2100
+ // <e> is . or ''
2101
+ //
2102
+ // **/.. is *brutal* for filesystem walking performance, because
2103
+ // it effectively resets the recursive walk each time it occurs,
2104
+ // and ** cannot be reduced out by a .. pattern part like a regexp
2105
+ // or most strings (other than .., ., and '') can be.
2106
+ //
2107
+ // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
2108
+ // <pre>/<e>/<rest> -> <pre>/<rest>
2109
+ // <pre>/<p>/../<rest> -> <pre>/<rest>
2110
+ // **/**/<rest> -> **/<rest>
2111
+ //
2112
+ // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
2113
+ // this WOULD be allowed if ** did follow symlinks, or * didn't
2114
+ firstPhasePreProcess(globParts) {
2115
+ let didSomething = false;
2116
+ do {
2117
+ didSomething = false;
2118
+ for (let parts of globParts) {
2119
+ let gs = -1;
2120
+ while (-1 !== (gs = parts.indexOf("**", gs + 1))) {
2121
+ let gss = gs;
2122
+ while (parts[gss + 1] === "**") {
2123
+ gss++;
2124
+ }
2125
+ if (gss > gs) {
2126
+ parts.splice(gs + 1, gss - gs);
2127
+ }
2128
+ let next = parts[gs + 1];
2129
+ const p = parts[gs + 2];
2130
+ const p2 = parts[gs + 3];
2131
+ if (next !== "..")
2132
+ continue;
2133
+ if (!p || p === "." || p === ".." || !p2 || p2 === "." || p2 === "..") {
2134
+ continue;
2135
+ }
2136
+ didSomething = true;
2137
+ parts.splice(gs, 1);
2138
+ const other = parts.slice(0);
2139
+ other[gs] = "**";
2140
+ globParts.push(other);
2141
+ gs--;
2142
+ }
2143
+ if (!this.preserveMultipleSlashes) {
2144
+ for (let i2 = 1; i2 < parts.length - 1; i2++) {
2145
+ const p = parts[i2];
2146
+ if (i2 === 1 && p === "" && parts[0] === "")
2147
+ continue;
2148
+ if (p === "." || p === "") {
2149
+ didSomething = true;
2150
+ parts.splice(i2, 1);
2151
+ i2--;
2152
+ }
2153
+ }
2154
+ if (parts[0] === "." && parts.length === 2 && (parts[1] === "." || parts[1] === "")) {
2155
+ didSomething = true;
2156
+ parts.pop();
2157
+ }
2158
+ }
2159
+ let dd = 0;
2160
+ while (-1 !== (dd = parts.indexOf("..", dd + 1))) {
2161
+ const p = parts[dd - 1];
2162
+ if (p && p !== "." && p !== ".." && p !== "**") {
2163
+ didSomething = true;
2164
+ const needDot = dd === 1 && parts[dd + 1] === "**";
2165
+ const splin = needDot ? ["."] : [];
2166
+ parts.splice(dd - 1, 2, ...splin);
2167
+ if (parts.length === 0)
2168
+ parts.push("");
2169
+ dd -= 2;
2170
+ }
2171
+ }
2172
+ }
2173
+ } while (didSomething);
2174
+ return globParts;
2175
+ }
2176
+ // second phase: multi-pattern dedupes
2177
+ // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
2178
+ // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
2179
+ // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
2180
+ //
2181
+ // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
2182
+ // ^-- not valid because ** doens't follow symlinks
2183
+ secondPhasePreProcess(globParts) {
2184
+ for (let i2 = 0; i2 < globParts.length - 1; i2++) {
2185
+ for (let j = i2 + 1; j < globParts.length; j++) {
2186
+ const matched = this.partsMatch(globParts[i2], globParts[j], !this.preserveMultipleSlashes);
2187
+ if (!matched)
2188
+ continue;
2189
+ globParts[i2] = matched;
2190
+ globParts[j] = [];
2191
+ }
2192
+ }
2193
+ return globParts.filter((gs) => gs.length);
2194
+ }
2195
+ partsMatch(a, b, emptyGSMatch = false) {
2196
+ let ai = 0;
2197
+ let bi = 0;
2198
+ let result = [];
2199
+ let which = "";
2200
+ while (ai < a.length && bi < b.length) {
2201
+ if (a[ai] === b[bi]) {
2202
+ result.push(which === "b" ? b[bi] : a[ai]);
2203
+ ai++;
2204
+ bi++;
2205
+ } else if (emptyGSMatch && a[ai] === "**" && b[bi] === a[ai + 1]) {
2206
+ result.push(a[ai]);
2207
+ ai++;
2208
+ } else if (emptyGSMatch && b[bi] === "**" && a[ai] === b[bi + 1]) {
2209
+ result.push(b[bi]);
2210
+ bi++;
2211
+ } else if (a[ai] === "*" && b[bi] && (this.options.dot || !b[bi].startsWith(".")) && b[bi] !== "**") {
2212
+ if (which === "b")
2213
+ return false;
2214
+ which = "a";
2215
+ result.push(a[ai]);
2216
+ ai++;
2217
+ bi++;
2218
+ } else if (b[bi] === "*" && a[ai] && (this.options.dot || !a[ai].startsWith(".")) && a[ai] !== "**") {
2219
+ if (which === "a")
2220
+ return false;
2221
+ which = "b";
2222
+ result.push(b[bi]);
2223
+ ai++;
2224
+ bi++;
2225
+ } else {
2226
+ return false;
2227
+ }
2228
+ }
2229
+ return a.length === b.length && result;
2230
+ }
2231
+ parseNegate() {
2232
+ if (this.nonegate)
2233
+ return;
2234
+ const pattern = this.pattern;
2235
+ let negate = false;
2236
+ let negateOffset = 0;
2237
+ for (let i2 = 0; i2 < pattern.length && pattern.charAt(i2) === "!"; i2++) {
2238
+ negate = !negate;
2239
+ negateOffset++;
2240
+ }
2241
+ if (negateOffset)
2242
+ this.pattern = pattern.slice(negateOffset);
2243
+ this.negate = negate;
2244
+ }
2245
+ // set partial to true to test if, for example,
2246
+ // "/a/b" matches the start of "/*/b/*/d"
2247
+ // Partial means, if you run out of file before you run
2248
+ // out of pattern, then that's fine, as long as all
2249
+ // the parts match.
2250
+ matchOne(file, pattern, partial = false) {
2251
+ const options = this.options;
2252
+ if (this.isWindows) {
2253
+ const fileDrive = typeof file[0] === "string" && /^[a-z]:$/i.test(file[0]);
2254
+ const fileUNC = !fileDrive && file[0] === "" && file[1] === "" && file[2] === "?" && /^[a-z]:$/i.test(file[3]);
2255
+ const patternDrive = typeof pattern[0] === "string" && /^[a-z]:$/i.test(pattern[0]);
2256
+ const patternUNC = !patternDrive && pattern[0] === "" && pattern[1] === "" && pattern[2] === "?" && typeof pattern[3] === "string" && /^[a-z]:$/i.test(pattern[3]);
2257
+ const fdi = fileUNC ? 3 : fileDrive ? 0 : void 0;
2258
+ const pdi = patternUNC ? 3 : patternDrive ? 0 : void 0;
2259
+ if (typeof fdi === "number" && typeof pdi === "number") {
2260
+ const [fd, pd] = [file[fdi], pattern[pdi]];
2261
+ if (fd.toLowerCase() === pd.toLowerCase()) {
2262
+ pattern[pdi] = fd;
2263
+ if (pdi > fdi) {
2264
+ pattern = pattern.slice(pdi);
2265
+ } else if (fdi > pdi) {
2266
+ file = file.slice(fdi);
2267
+ }
2268
+ }
2269
+ }
2270
+ }
2271
+ const { optimizationLevel = 1 } = this.options;
2272
+ if (optimizationLevel >= 2) {
2273
+ file = this.levelTwoFileOptimize(file);
2274
+ }
2275
+ this.debug("matchOne", this, { file, pattern });
2276
+ this.debug("matchOne", file.length, pattern.length);
2277
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
2278
+ this.debug("matchOne loop");
2279
+ var p = pattern[pi];
2280
+ var f = file[fi];
2281
+ this.debug(pattern, p, f);
2282
+ if (p === false) {
2283
+ return false;
2284
+ }
2285
+ if (p === GLOBSTAR) {
2286
+ this.debug("GLOBSTAR", [pattern, p, f]);
2287
+ var fr = fi;
2288
+ var pr = pi + 1;
2289
+ if (pr === pl) {
2290
+ this.debug("** at the end");
2291
+ for (; fi < fl; fi++) {
2292
+ if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
2293
+ return false;
2294
+ }
2295
+ return true;
2296
+ }
2297
+ while (fr < fl) {
2298
+ var swallowee = file[fr];
2299
+ this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
2300
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
2301
+ this.debug("globstar found match!", fr, fl, swallowee);
2302
+ return true;
2303
+ } else {
2304
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
2305
+ this.debug("dot detected!", file, fr, pattern, pr);
2306
+ break;
2307
+ }
2308
+ this.debug("globstar swallow a segment, and continue");
2309
+ fr++;
2310
+ }
2311
+ }
2312
+ if (partial) {
2313
+ this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
2314
+ if (fr === fl) {
2315
+ return true;
2316
+ }
2317
+ }
2318
+ return false;
2319
+ }
2320
+ let hit;
2321
+ if (typeof p === "string") {
2322
+ hit = f === p;
2323
+ this.debug("string match", p, f, hit);
2324
+ } else {
2325
+ hit = p.test(f);
2326
+ this.debug("pattern match", p, f, hit);
2327
+ }
2328
+ if (!hit)
2329
+ return false;
2330
+ }
2331
+ if (fi === fl && pi === pl) {
2332
+ return true;
2333
+ } else if (fi === fl) {
2334
+ return partial;
2335
+ } else if (pi === pl) {
2336
+ return fi === fl - 1 && file[fi] === "";
2337
+ } else {
2338
+ throw new Error("wtf?");
2339
+ }
2340
+ }
2341
+ braceExpand() {
2342
+ return braceExpand(this.pattern, this.options);
2343
+ }
2344
+ parse(pattern) {
2345
+ assertValidPattern(pattern);
2346
+ const options = this.options;
2347
+ if (pattern === "**")
2348
+ return GLOBSTAR;
2349
+ if (pattern === "")
2350
+ return "";
2351
+ let m;
2352
+ let fastTest = null;
2353
+ if (m = pattern.match(starRE)) {
2354
+ fastTest = options.dot ? starTestDot : starTest;
2355
+ } else if (m = pattern.match(starDotExtRE)) {
2356
+ fastTest = (options.nocase ? options.dot ? starDotExtTestNocaseDot : starDotExtTestNocase : options.dot ? starDotExtTestDot : starDotExtTest)(m[1]);
2357
+ } else if (m = pattern.match(qmarksRE)) {
2358
+ fastTest = (options.nocase ? options.dot ? qmarksTestNocaseDot : qmarksTestNocase : options.dot ? qmarksTestDot : qmarksTest)(m);
2359
+ } else if (m = pattern.match(starDotStarRE)) {
2360
+ fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
2361
+ } else if (m = pattern.match(dotStarRE)) {
2362
+ fastTest = dotStarTest;
2363
+ }
2364
+ const re = AST.fromGlob(pattern, this.options).toMMPattern();
2365
+ if (fastTest && typeof re === "object") {
2366
+ Reflect.defineProperty(re, "test", { value: fastTest });
2367
+ }
2368
+ return re;
2369
+ }
2370
+ makeRe() {
2371
+ if (this.regexp || this.regexp === false)
2372
+ return this.regexp;
2373
+ const set = this.set;
2374
+ if (!set.length) {
2375
+ this.regexp = false;
2376
+ return this.regexp;
2377
+ }
2378
+ const options = this.options;
2379
+ const twoStar = options.noglobstar ? star2 : options.dot ? twoStarDot : twoStarNoDot;
2380
+ const flags = new Set(options.nocase ? ["i"] : []);
2381
+ let re = set.map((pattern) => {
2382
+ const pp = pattern.map((p) => {
2383
+ if (p instanceof RegExp) {
2384
+ for (const f of p.flags.split(""))
2385
+ flags.add(f);
2386
+ }
2387
+ return typeof p === "string" ? regExpEscape2(p) : p === GLOBSTAR ? GLOBSTAR : p._src;
2388
+ });
2389
+ pp.forEach((p, i2) => {
2390
+ const next = pp[i2 + 1];
2391
+ const prev = pp[i2 - 1];
2392
+ if (p !== GLOBSTAR || prev === GLOBSTAR) {
2393
+ return;
2394
+ }
2395
+ if (prev === void 0) {
2396
+ if (next !== void 0 && next !== GLOBSTAR) {
2397
+ pp[i2 + 1] = "(?:\\/|" + twoStar + "\\/)?" + next;
2398
+ } else {
2399
+ pp[i2] = twoStar;
2400
+ }
2401
+ } else if (next === void 0) {
2402
+ pp[i2 - 1] = prev + "(?:\\/|" + twoStar + ")?";
2403
+ } else if (next !== GLOBSTAR) {
2404
+ pp[i2 - 1] = prev + "(?:\\/|\\/" + twoStar + "\\/)" + next;
2405
+ pp[i2 + 1] = GLOBSTAR;
2406
+ }
2407
+ });
2408
+ return pp.filter((p) => p !== GLOBSTAR).join("/");
2409
+ }).join("|");
2410
+ const [open, close] = set.length > 1 ? ["(?:", ")"] : ["", ""];
2411
+ re = "^" + open + re + close + "$";
2412
+ if (this.negate)
2413
+ re = "^(?!" + re + ").+$";
2414
+ try {
2415
+ this.regexp = new RegExp(re, [...flags].join(""));
2416
+ } catch (ex) {
2417
+ this.regexp = false;
2418
+ }
2419
+ return this.regexp;
2420
+ }
2421
+ slashSplit(p) {
2422
+ if (this.preserveMultipleSlashes) {
2423
+ return p.split("/");
2424
+ } else if (this.isWindows && /^\/\/[^\/]+/.test(p)) {
2425
+ return ["", ...p.split(/\/+/)];
2426
+ } else {
2427
+ return p.split(/\/+/);
2428
+ }
2429
+ }
2430
+ match(f, partial = this.partial) {
2431
+ this.debug("match", f, this.pattern);
2432
+ if (this.comment) {
2433
+ return false;
2434
+ }
2435
+ if (this.empty) {
2436
+ return f === "";
2437
+ }
2438
+ if (f === "/" && partial) {
2439
+ return true;
2440
+ }
2441
+ const options = this.options;
2442
+ if (this.isWindows) {
2443
+ f = f.split("\\").join("/");
2444
+ }
2445
+ const ff = this.slashSplit(f);
2446
+ this.debug(this.pattern, "split", ff);
2447
+ const set = this.set;
2448
+ this.debug(this.pattern, "set", set);
2449
+ let filename = ff[ff.length - 1];
2450
+ if (!filename) {
2451
+ for (let i2 = ff.length - 2; !filename && i2 >= 0; i2--) {
2452
+ filename = ff[i2];
2453
+ }
2454
+ }
2455
+ for (let i2 = 0; i2 < set.length; i2++) {
2456
+ const pattern = set[i2];
2457
+ let file = ff;
2458
+ if (options.matchBase && pattern.length === 1) {
2459
+ file = [filename];
2460
+ }
2461
+ const hit = this.matchOne(file, pattern, partial);
2462
+ if (hit) {
2463
+ if (options.flipNegate) {
2464
+ return true;
2465
+ }
2466
+ return !this.negate;
2467
+ }
2468
+ }
2469
+ if (options.flipNegate) {
2470
+ return false;
2471
+ }
2472
+ return this.negate;
2473
+ }
2474
+ static defaults(def) {
2475
+ return minimatch.defaults(def).Minimatch;
2476
+ }
2477
+ };
2478
+ minimatch.AST = AST;
2479
+ minimatch.Minimatch = Minimatch;
2480
+ minimatch.escape = escape;
2481
+ minimatch.unescape = unescape;
2482
+
2483
+ // src/utils/query-nonce-meta-tag-content.ts
2484
+ function queryNonceMetaTagContent(doc) {
2485
+ var _a, _b, _c;
2486
+ return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
2487
+ }
2488
+
2489
+ // src/utils/regular-expression.ts
2490
+ var escapeRegExpSpecialCharacters = (text) => {
2491
+ return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
2492
+ };
2493
+
2494
+ // src/utils/result.ts
2495
+ var result_exports = {};
2496
+ __export(result_exports, {
2497
+ err: () => err,
2498
+ map: () => map,
2499
+ ok: () => ok,
2500
+ unwrap: () => unwrap,
2501
+ unwrapErr: () => unwrapErr
2502
+ });
2503
+ var ok = (value) => ({
2504
+ isOk: true,
2505
+ isErr: false,
2506
+ value
2507
+ });
2508
+ var err = (value) => ({
2509
+ isOk: false,
2510
+ isErr: true,
2511
+ value
2512
+ });
2513
+ function map(result, fn) {
2514
+ if (result.isOk) {
2515
+ const val = fn(result.value);
2516
+ if (val instanceof Promise) {
2517
+ return val.then((newVal) => ok(newVal));
2518
+ } else {
2519
+ return ok(val);
2520
+ }
2521
+ }
2522
+ if (result.isErr) {
2523
+ const value = result.value;
2524
+ return err(value);
2525
+ }
2526
+ throw "should never get here";
2527
+ }
2528
+ var unwrap = (result) => {
2529
+ if (result.isOk) {
2530
+ return result.value;
2531
+ } else {
2532
+ throw result.value;
2533
+ }
2534
+ };
2535
+ var unwrapErr = (result) => {
2536
+ if (result.isErr) {
2537
+ return result.value;
2538
+ } else {
2539
+ throw result.value;
2540
+ }
2541
+ };
2542
+
2543
+ // src/utils/style.ts
2544
+ function createStyleSheetIfNeededAndSupported(styles2) {
2545
+ return void 0;
2546
+ }
2547
+
2548
+ // src/utils/shadow-root.ts
2549
+ var globalStyleSheet;
2550
+ function createShadowRoot(cmpMeta) {
2551
+ var _a;
2552
+ const opts = { mode: "open" };
2553
+ const shadowRoot = this.attachShadow(opts);
2554
+ if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
2555
+ if (globalStyleSheet) {
2556
+ if (supportsMutableAdoptedStyleSheets) {
2557
+ shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
2558
+ } else {
2559
+ shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
2560
+ }
2561
+ }
2562
+ }
2563
+ var createTime = (fnName, tagName = "") => {
2564
+ {
2565
+ return () => {
2566
+ return;
2567
+ };
2568
+ }
2569
+ };
2570
+ var uniqueTime = (key, measureText) => {
2571
+ {
2572
+ return () => {
2573
+ return;
2574
+ };
2575
+ }
2576
+ };
2577
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
2578
+ var registerStyle = (scopeId2, cssText, allowCS) => {
2579
+ let style = styles.get(scopeId2);
2580
+ if (supportsConstructableStylesheets && allowCS) {
2581
+ style = style || new CSSStyleSheet();
2582
+ if (typeof style === "string") {
2583
+ style = cssText;
2584
+ } else {
2585
+ style.replaceSync(cssText);
2586
+ }
2587
+ } else {
2588
+ style = cssText;
2589
+ }
2590
+ styles.set(scopeId2, style);
2591
+ };
2592
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
2593
+ var _a, _b, _c;
2594
+ const scopeId2 = getScopeId(cmpMeta);
2595
+ const style = styles.get(scopeId2);
2596
+ if (!win.document) {
2597
+ return scopeId2;
2598
+ }
2599
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
2600
+ if (style) {
2601
+ if (typeof style === "string") {
2602
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
2603
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
2604
+ let styleElm;
2605
+ if (!appliedStyles) {
2606
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2607
+ }
2608
+ if (!appliedStyles.has(scopeId2)) {
2609
+ styleElm = win.document.createElement("style");
2610
+ styleElm.innerHTML = style;
2611
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
2612
+ if (nonce != null) {
2613
+ styleElm.setAttribute("nonce", nonce);
2614
+ }
2615
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
2616
+ if (styleContainerNode.nodeName === "HEAD") {
2617
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
2618
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
2619
+ styleContainerNode.insertBefore(
2620
+ styleElm,
2621
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
2622
+ );
2623
+ } else if ("host" in styleContainerNode) {
2624
+ if (supportsConstructableStylesheets) {
2625
+ const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
2626
+ const stylesheet = new currentWindow.CSSStyleSheet();
2627
+ stylesheet.replaceSync(style);
2628
+ if (supportsMutableAdoptedStyleSheets) {
2629
+ styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
2630
+ } else {
2631
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
2632
+ }
2633
+ } else {
2634
+ const existingStyleContainer = styleContainerNode.querySelector("style");
2635
+ if (existingStyleContainer) {
2636
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
2637
+ } else {
2638
+ styleContainerNode.prepend(styleElm);
2639
+ }
2640
+ }
2641
+ } else {
2642
+ styleContainerNode.append(styleElm);
2643
+ }
2644
+ }
2645
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
2646
+ styleContainerNode.insertBefore(styleElm, null);
2647
+ }
2648
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
2649
+ styleElm.innerHTML += SLOT_FB_CSS;
2650
+ }
2651
+ if (appliedStyles) {
2652
+ appliedStyles.add(scopeId2);
2653
+ }
2654
+ }
2655
+ } else {
2656
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
2657
+ if (!appliedStyles) {
2658
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
2659
+ }
2660
+ if (!appliedStyles.has(scopeId2)) {
2661
+ const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
2662
+ let stylesheet;
2663
+ if (style.constructor === currentWindow.CSSStyleSheet) {
2664
+ stylesheet = style;
2665
+ } else {
2666
+ stylesheet = new currentWindow.CSSStyleSheet();
2667
+ for (let i2 = 0; i2 < style.cssRules.length; i2++) {
2668
+ stylesheet.insertRule(style.cssRules[i2].cssText, i2);
2669
+ }
2670
+ }
2671
+ if (supportsMutableAdoptedStyleSheets) {
2672
+ styleContainerNode.adoptedStyleSheets.push(stylesheet);
2673
+ } else {
2674
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
2675
+ }
2676
+ appliedStyles.add(scopeId2);
2677
+ }
2678
+ }
2679
+ }
2680
+ return scopeId2;
2681
+ };
2682
+ var attachStyles = (hostRef) => {
2683
+ const cmpMeta = hostRef.$cmpMeta$;
2684
+ const elm = hostRef.$hostElement$;
2685
+ const flags = cmpMeta.$flags$;
2686
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
2687
+ const scopeId2 = addStyle(
2688
+ elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
2689
+ cmpMeta);
2690
+ if (flags & 10 /* needsScopedEncapsulation */) {
2691
+ elm["s-sc"] = scopeId2;
2692
+ elm.classList.add(scopeId2 + "-h");
2693
+ }
2694
+ endAttachStyles();
2695
+ };
2696
+ var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
2697
+ var h = (nodeName, vnodeData, ...children) => {
2698
+ let child = null;
2699
+ let key = null;
2700
+ let simple = false;
2701
+ let lastSimple = false;
2702
+ const vNodeChildren = [];
2703
+ const walk = (c) => {
2704
+ for (let i2 = 0; i2 < c.length; i2++) {
2705
+ child = c[i2];
2706
+ if (Array.isArray(child)) {
2707
+ walk(child);
2708
+ } else if (child != null && typeof child !== "boolean") {
2709
+ if (simple = !isComplexType(child)) {
2710
+ child = String(child);
2711
+ }
2712
+ if (simple && lastSimple) {
2713
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
2714
+ } else {
2715
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
2716
+ }
2717
+ lastSimple = simple;
2718
+ }
2719
+ }
2720
+ };
2721
+ walk(children);
2722
+ const vnode = newVNode(nodeName, null);
2723
+ vnode.$attrs$ = vnodeData;
2724
+ if (vNodeChildren.length > 0) {
2725
+ vnode.$children$ = vNodeChildren;
2726
+ }
2727
+ {
2728
+ vnode.$key$ = key;
2729
+ }
2730
+ return vnode;
2731
+ };
2732
+ var newVNode = (tag, text) => {
2733
+ const vnode = {
2734
+ $flags$: 0,
2735
+ $tag$: tag,
2736
+ $text$: text,
2737
+ $elm$: null,
2738
+ $children$: null
2739
+ };
2740
+ {
2741
+ vnode.$attrs$ = null;
2742
+ }
2743
+ {
2744
+ vnode.$key$ = null;
2745
+ }
2746
+ return vnode;
2747
+ };
2748
+ var Host = {};
2749
+ var isHost = (node) => node && node.$tag$ === Host;
2750
+ var createSupportsRuleRe = (selector) => {
2751
+ const safeSelector2 = escapeRegExpSpecialCharacters(selector);
2752
+ return new RegExp(
2753
+ // First capture group: match any context before the selector that's not inside @supports selector()
2754
+ // Using negative lookahead to avoid matching inside @supports selector(...) condition
2755
+ `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
2756
+ "g"
2757
+ );
2758
+ };
2759
+ createSupportsRuleRe("::slotted");
2760
+ createSupportsRuleRe(":host");
2761
+ createSupportsRuleRe(":host-context");
2762
+ var parsePropertyValue = (propValue, propType, isFormAssociated) => {
2763
+ if (propValue != null && !isComplexType(propValue)) {
2764
+ if (propType & 4 /* Boolean */) {
2765
+ {
2766
+ return propValue === "false" ? false : propValue === "" || !!propValue;
2767
+ }
2768
+ }
2769
+ if (propType & 1 /* String */) {
2770
+ return String(propValue);
2771
+ }
2772
+ return propValue;
2773
+ }
2774
+ return propValue;
2775
+ };
2776
+ var emitEvent = (elm, name, opts) => {
2777
+ const ev = plt.ce(name, opts);
2778
+ elm.dispatchEvent(ev);
2779
+ return ev;
2780
+ };
2781
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
2782
+ if (oldValue === newValue) {
2783
+ return;
2784
+ }
2785
+ let isProp = isMemberInElement(elm, memberName);
2786
+ let ln = memberName.toLowerCase();
2787
+ if (memberName === "class") {
2788
+ const classList = elm.classList;
2789
+ const oldClasses = parseClassList(oldValue);
2790
+ let newClasses = parseClassList(newValue);
2791
+ {
2792
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
2793
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
2794
+ }
2795
+ } else if (memberName === "style") {
2796
+ {
2797
+ for (const prop in oldValue) {
2798
+ if (!newValue || newValue[prop] == null) {
2799
+ if (prop.includes("-")) {
2800
+ elm.style.removeProperty(prop);
2801
+ } else {
2802
+ elm.style[prop] = "";
2803
+ }
2804
+ }
2805
+ }
2806
+ }
2807
+ for (const prop in newValue) {
2808
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
2809
+ if (prop.includes("-")) {
2810
+ elm.style.setProperty(prop, newValue[prop]);
2811
+ } else {
2812
+ elm.style[prop] = newValue[prop];
2813
+ }
2814
+ }
2815
+ }
2816
+ } else if (memberName === "key") ; else if (memberName === "ref") {
2817
+ if (newValue) {
2818
+ newValue(elm);
2819
+ }
2820
+ } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
2821
+ if (memberName[2] === "-") {
2822
+ memberName = memberName.slice(3);
2823
+ } else if (isMemberInElement(win, ln)) {
2824
+ memberName = ln.slice(2);
2825
+ } else {
2826
+ memberName = ln[2] + memberName.slice(3);
2827
+ }
2828
+ if (oldValue || newValue) {
2829
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
2830
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
2831
+ if (oldValue) {
2832
+ plt.rel(elm, memberName, oldValue, capture);
2833
+ }
2834
+ if (newValue) {
2835
+ plt.ael(elm, memberName, newValue, capture);
2836
+ }
2837
+ }
2838
+ } else {
2839
+ const isComplex = isComplexType(newValue);
2840
+ if ((isProp || isComplex && newValue !== null) && !isSvg) {
2841
+ try {
2842
+ if (!elm.tagName.includes("-")) {
2843
+ const n = newValue == null ? "" : newValue;
2844
+ if (memberName === "list") {
2845
+ isProp = false;
2846
+ } else if (oldValue == null || elm[memberName] != n) {
2847
+ if (typeof elm.__lookupSetter__(memberName) === "function") {
2848
+ elm[memberName] = n;
2849
+ } else {
2850
+ elm.setAttribute(memberName, n);
2851
+ }
2852
+ }
2853
+ } else if (elm[memberName] !== newValue) {
2854
+ elm[memberName] = newValue;
2855
+ }
2856
+ } catch (e) {
2857
+ }
2858
+ }
2859
+ if (newValue == null || newValue === false) {
2860
+ if (newValue !== false || elm.getAttribute(memberName) === "") {
2861
+ {
2862
+ elm.removeAttribute(memberName);
2863
+ }
2864
+ }
2865
+ } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
2866
+ newValue = newValue === true ? "" : newValue;
2867
+ {
2868
+ elm.setAttribute(memberName, newValue);
2869
+ }
2870
+ }
2871
+ }
2872
+ };
2873
+ var parseClassListRegex = /\s/;
2874
+ var parseClassList = (value) => {
2875
+ if (typeof value === "object" && value && "baseVal" in value) {
2876
+ value = value.baseVal;
2877
+ }
2878
+ if (!value || typeof value !== "string") {
2879
+ return [];
2880
+ }
2881
+ return value.split(parseClassListRegex);
2882
+ };
2883
+ var CAPTURE_EVENT_SUFFIX = "Capture";
2884
+ var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
2885
+
2886
+ // src/runtime/vdom/update-element.ts
2887
+ var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
2888
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
2889
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
2890
+ const newVnodeAttrs = newVnode.$attrs$ || {};
2891
+ {
2892
+ for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
2893
+ if (!(memberName in newVnodeAttrs)) {
2894
+ setAccessor(
2895
+ elm,
2896
+ memberName,
2897
+ oldVnodeAttrs[memberName],
2898
+ void 0,
2899
+ isSvgMode2,
2900
+ newVnode.$flags$);
2901
+ }
2902
+ }
2903
+ }
2904
+ for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
2905
+ setAccessor(
2906
+ elm,
2907
+ memberName,
2908
+ oldVnodeAttrs[memberName],
2909
+ newVnodeAttrs[memberName],
2910
+ isSvgMode2,
2911
+ newVnode.$flags$);
2912
+ }
2913
+ };
2914
+ function sortedAttrNames(attrNames) {
2915
+ return attrNames.includes("ref") ? (
2916
+ // we need to sort these to ensure that `'ref'` is the last attr
2917
+ [...attrNames.filter((attr) => attr !== "ref"), "ref"]
2918
+ ) : (
2919
+ // no need to sort, return the original array
2920
+ attrNames
2921
+ );
2922
+ }
2923
+ var hostTagName;
2924
+ var isSvgMode = false;
2925
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
2926
+ const newVNode2 = newParentVNode.$children$[childIndex];
2927
+ let i2 = 0;
2928
+ let elm;
2929
+ let childNode;
2930
+ {
2931
+ if (!isSvgMode) {
2932
+ isSvgMode = newVNode2.$tag$ === "svg";
2933
+ }
2934
+ if (!win.document) {
2935
+ throw new Error(
2936
+ "You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
2937
+ );
2938
+ }
2939
+ elm = newVNode2.$elm$ = win.document.createElementNS(
2940
+ isSvgMode ? SVG_NS : HTML_NS,
2941
+ newVNode2.$tag$
2942
+ ) ;
2943
+ if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
2944
+ isSvgMode = false;
2945
+ }
2946
+ {
2947
+ updateElement(null, newVNode2, isSvgMode);
2948
+ }
2949
+ if (newVNode2.$children$) {
2950
+ const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
2951
+ for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
2952
+ childNode = createElm(oldParentVNode, newVNode2, i2);
2953
+ if (childNode) {
2954
+ appendTarget.appendChild(childNode);
2955
+ }
2956
+ }
2957
+ }
2958
+ {
2959
+ if (newVNode2.$tag$ === "svg") {
2960
+ isSvgMode = false;
2961
+ } else if (elm.tagName === "foreignObject") {
2962
+ isSvgMode = true;
2963
+ }
2964
+ }
2965
+ }
2966
+ elm["s-hn"] = hostTagName;
2967
+ return elm;
2968
+ };
2969
+ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
2970
+ let containerElm = parentElm;
2971
+ let childNode;
2972
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
2973
+ containerElm = containerElm.shadowRoot;
2974
+ }
2975
+ if (parentVNode.$tag$ === "template") {
2976
+ containerElm = containerElm.content;
2977
+ }
2978
+ for (; startIdx <= endIdx; ++startIdx) {
2979
+ if (vnodes[startIdx]) {
2980
+ childNode = createElm(null, parentVNode, startIdx);
2981
+ if (childNode) {
2982
+ vnodes[startIdx].$elm$ = childNode;
2983
+ insertBefore(containerElm, childNode, before);
2984
+ }
2985
+ }
2986
+ }
2987
+ };
2988
+ var removeVnodes = (vnodes, startIdx, endIdx) => {
2989
+ for (let index = startIdx; index <= endIdx; ++index) {
2990
+ const vnode = vnodes[index];
2991
+ if (vnode) {
2992
+ const elm = vnode.$elm$;
2993
+ nullifyVNodeRefs(vnode);
2994
+ if (elm) {
2995
+ elm.remove();
2996
+ }
2997
+ }
2998
+ }
2999
+ };
3000
+ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
3001
+ let oldStartIdx = 0;
3002
+ let newStartIdx = 0;
3003
+ let idxInOld = 0;
3004
+ let i2 = 0;
3005
+ let oldEndIdx = oldCh.length - 1;
3006
+ let oldStartVnode = oldCh[0];
3007
+ let oldEndVnode = oldCh[oldEndIdx];
3008
+ let newEndIdx = newCh.length - 1;
3009
+ let newStartVnode = newCh[0];
3010
+ let newEndVnode = newCh[newEndIdx];
3011
+ let node;
3012
+ let elmToMove;
3013
+ const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
3014
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
3015
+ if (oldStartVnode == null) {
3016
+ oldStartVnode = oldCh[++oldStartIdx];
3017
+ } else if (oldEndVnode == null) {
3018
+ oldEndVnode = oldCh[--oldEndIdx];
3019
+ } else if (newStartVnode == null) {
3020
+ newStartVnode = newCh[++newStartIdx];
3021
+ } else if (newEndVnode == null) {
3022
+ newEndVnode = newCh[--newEndIdx];
3023
+ } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
3024
+ patch(oldStartVnode, newStartVnode, isInitialRender);
3025
+ oldStartVnode = oldCh[++oldStartIdx];
3026
+ newStartVnode = newCh[++newStartIdx];
3027
+ } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
3028
+ patch(oldEndVnode, newEndVnode, isInitialRender);
3029
+ oldEndVnode = oldCh[--oldEndIdx];
3030
+ newEndVnode = newCh[--newEndIdx];
3031
+ } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
3032
+ patch(oldStartVnode, newEndVnode, isInitialRender);
3033
+ insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
3034
+ oldStartVnode = oldCh[++oldStartIdx];
3035
+ newEndVnode = newCh[--newEndIdx];
3036
+ } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
3037
+ patch(oldEndVnode, newStartVnode, isInitialRender);
3038
+ insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
3039
+ oldEndVnode = oldCh[--oldEndIdx];
3040
+ newStartVnode = newCh[++newStartIdx];
3041
+ } else {
3042
+ idxInOld = -1;
3043
+ {
3044
+ for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
3045
+ if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
3046
+ idxInOld = i2;
3047
+ break;
3048
+ }
3049
+ }
3050
+ }
3051
+ if (idxInOld >= 0) {
3052
+ elmToMove = oldCh[idxInOld];
3053
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
3054
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
3055
+ } else {
3056
+ patch(elmToMove, newStartVnode, isInitialRender);
3057
+ oldCh[idxInOld] = void 0;
3058
+ node = elmToMove.$elm$;
3059
+ }
3060
+ newStartVnode = newCh[++newStartIdx];
3061
+ } else {
3062
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
3063
+ newStartVnode = newCh[++newStartIdx];
3064
+ }
3065
+ if (node) {
3066
+ {
3067
+ insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
3068
+ }
3069
+ }
3070
+ }
3071
+ }
3072
+ if (oldStartIdx > oldEndIdx) {
3073
+ addVnodes(
3074
+ parentElm,
3075
+ newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
3076
+ newVNode2,
3077
+ newCh,
3078
+ newStartIdx,
3079
+ newEndIdx
3080
+ );
3081
+ } else if (newStartIdx > newEndIdx) {
3082
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
3083
+ }
3084
+ };
3085
+ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
3086
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
3087
+ if (!isInitialRender) {
3088
+ return leftVNode.$key$ === rightVNode.$key$;
3089
+ }
3090
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
3091
+ leftVNode.$key$ = rightVNode.$key$;
3092
+ }
3093
+ return true;
3094
+ }
3095
+ return false;
3096
+ };
3097
+ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
3098
+ const elm = newVNode2.$elm$ = oldVNode.$elm$;
3099
+ const oldChildren = oldVNode.$children$;
3100
+ const newChildren = newVNode2.$children$;
3101
+ const tag = newVNode2.$tag$;
3102
+ {
3103
+ {
3104
+ isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
3105
+ }
3106
+ {
3107
+ updateElement(oldVNode, newVNode2, isSvgMode);
3108
+ }
3109
+ if (oldChildren !== null && newChildren !== null) {
3110
+ updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
3111
+ } else if (newChildren !== null) {
3112
+ addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
3113
+ } else if (
3114
+ // don't do this on initial render as it can cause non-hydrated content to be removed
3115
+ !isInitialRender && BUILD.updatable && oldChildren !== null
3116
+ ) {
3117
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
3118
+ } else ;
3119
+ if (isSvgMode && tag === "svg") {
3120
+ isSvgMode = false;
3121
+ }
3122
+ }
3123
+ };
3124
+ var nullifyVNodeRefs = (vNode) => {
3125
+ {
3126
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
3127
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
3128
+ }
3129
+ };
3130
+ var insertBefore = (parent, newNode, reference) => {
3131
+ {
3132
+ return parent == null ? void 0 : parent.insertBefore(newNode, reference);
3133
+ }
3134
+ };
3135
+ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
3136
+ const hostElm = hostRef.$hostElement$;
3137
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
3138
+ const isHostElement = isHost(renderFnResults);
3139
+ const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
3140
+ hostTagName = hostElm.tagName;
3141
+ if (isInitialLoad && rootVnode.$attrs$) {
3142
+ for (const key of Object.keys(rootVnode.$attrs$)) {
3143
+ if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
3144
+ rootVnode.$attrs$[key] = hostElm[key];
3145
+ }
3146
+ }
3147
+ }
3148
+ rootVnode.$tag$ = null;
3149
+ rootVnode.$flags$ |= 4 /* isHost */;
3150
+ hostRef.$vnode$ = rootVnode;
3151
+ rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
3152
+ patch(oldVNode, rootVnode, isInitialLoad);
3153
+ };
3154
+
3155
+ // src/runtime/update-component.ts
3156
+ var attachToAncestor = (hostRef, ancestorComponent) => {
3157
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
3158
+ const index = ancestorComponent["s-p"].push(
3159
+ new Promise(
3160
+ (r) => hostRef.$onRenderResolve$ = () => {
3161
+ ancestorComponent["s-p"].splice(index - 1, 1);
3162
+ r();
3163
+ }
3164
+ )
3165
+ );
3166
+ }
3167
+ };
3168
+ var scheduleUpdate = (hostRef, isInitialLoad) => {
3169
+ {
3170
+ hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
3171
+ }
3172
+ if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
3173
+ hostRef.$flags$ |= 512 /* needsRerender */;
3174
+ return;
3175
+ }
3176
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
3177
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
3178
+ if (isInitialLoad) {
3179
+ queueMicrotask(() => {
3180
+ dispatch();
3181
+ });
3182
+ return;
3183
+ }
3184
+ return writeTask(dispatch) ;
3185
+ };
3186
+ var dispatchHooks = (hostRef, isInitialLoad) => {
3187
+ const elm = hostRef.$hostElement$;
3188
+ const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
3189
+ const instance = hostRef.$lazyInstance$ ;
3190
+ if (!instance) {
3191
+ throw new Error(
3192
+ `Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
3193
+ );
3194
+ }
3195
+ let maybePromise;
3196
+ if (isInitialLoad) {
3197
+ {
3198
+ if (hostRef.$fetchedCbList$.length) {
3199
+ hostRef.$fetchedCbList$.forEach((cb) => cb(elm));
3200
+ }
3201
+ }
3202
+ maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
3203
+ } else {
3204
+ maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
3205
+ }
3206
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
3207
+ endSchedule();
3208
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
3209
+ };
3210
+ var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
3211
+ console.error(err2);
3212
+ fn();
3213
+ }) : fn();
3214
+ var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
3215
+ var updateComponent = async (hostRef, instance, isInitialLoad) => {
3216
+ var _a;
3217
+ const elm = hostRef.$hostElement$;
3218
+ const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
3219
+ const rc = elm["s-rc"];
3220
+ if (isInitialLoad) {
3221
+ attachStyles(hostRef);
3222
+ }
3223
+ const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
3224
+ {
3225
+ callRender(hostRef, instance, elm, isInitialLoad);
3226
+ }
3227
+ if (rc) {
3228
+ rc.map((cb) => cb());
3229
+ elm["s-rc"] = void 0;
3230
+ }
3231
+ endRender();
3232
+ endUpdate();
3233
+ {
3234
+ const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
3235
+ const postUpdate = () => postUpdateComponent(hostRef);
3236
+ if (childrenPromises.length === 0) {
3237
+ postUpdate();
3238
+ } else {
3239
+ Promise.all(childrenPromises).then(postUpdate);
3240
+ hostRef.$flags$ |= 4 /* isWaitingForChildren */;
3241
+ childrenPromises.length = 0;
3242
+ }
3243
+ }
3244
+ };
3245
+ var callRender = (hostRef, instance, elm, isInitialLoad) => {
3246
+ try {
3247
+ instance = instance.render() ;
3248
+ {
3249
+ hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
3250
+ }
3251
+ {
3252
+ hostRef.$flags$ |= 2 /* hasRendered */;
3253
+ }
3254
+ {
3255
+ {
3256
+ {
3257
+ renderVdom(hostRef, instance, isInitialLoad);
3258
+ }
3259
+ }
3260
+ }
3261
+ } catch (e) {
3262
+ consoleError(e, hostRef.$hostElement$);
3263
+ }
3264
+ return null;
3265
+ };
3266
+ var postUpdateComponent = (hostRef) => {
3267
+ const tagName = hostRef.$cmpMeta$.$tagName$;
3268
+ const elm = hostRef.$hostElement$;
3269
+ const endPostUpdate = createTime("postUpdate", tagName);
3270
+ const instance = hostRef.$lazyInstance$ ;
3271
+ const ancestorComponent = hostRef.$ancestorComponent$;
3272
+ safeCall(instance, "componentDidRender", void 0, elm);
3273
+ if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
3274
+ hostRef.$flags$ |= 64 /* hasLoadedComponent */;
3275
+ {
3276
+ addHydratedFlag(elm);
3277
+ }
3278
+ safeCall(instance, "componentDidLoad", void 0, elm);
3279
+ endPostUpdate();
3280
+ {
3281
+ hostRef.$onReadyResolve$(elm);
3282
+ if (!ancestorComponent) {
3283
+ appDidLoad();
3284
+ }
3285
+ }
3286
+ } else {
3287
+ safeCall(instance, "componentDidUpdate", void 0, elm);
3288
+ endPostUpdate();
3289
+ }
3290
+ {
3291
+ if (hostRef.$onRenderResolve$) {
3292
+ hostRef.$onRenderResolve$();
3293
+ hostRef.$onRenderResolve$ = void 0;
3294
+ }
3295
+ if (hostRef.$flags$ & 512 /* needsRerender */) {
3296
+ nextTick(() => scheduleUpdate(hostRef, false));
3297
+ }
3298
+ hostRef.$flags$ &= -517;
3299
+ }
3300
+ };
3301
+ var appDidLoad = (who) => {
3302
+ nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
3303
+ };
3304
+ var safeCall = (instance, method, arg, elm) => {
3305
+ if (instance && instance[method]) {
3306
+ try {
3307
+ return instance[method](arg);
3308
+ } catch (e) {
3309
+ consoleError(e, elm);
3310
+ }
3311
+ }
3312
+ return void 0;
3313
+ };
3314
+ var addHydratedFlag = (elm) => {
3315
+ var _a;
3316
+ return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
3317
+ };
3318
+
3319
+ // src/runtime/set-value.ts
3320
+ var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
3321
+ var setValue = (ref, propName, newVal, cmpMeta) => {
3322
+ const hostRef = getHostRef(ref);
3323
+ if (!hostRef) {
3324
+ return;
3325
+ }
3326
+ if (!hostRef) {
3327
+ throw new Error(
3328
+ `Couldn't find host element for "${cmpMeta.$tagName$}" as it is unknown to this Stencil runtime. This usually happens when integrating a 3rd party Stencil component with another Stencil component or application. Please reach out to the maintainers of the 3rd party Stencil component or report this on the Stencil Discord server (https://chat.stenciljs.com) or comment on this similar [GitHub issue](https://github.com/stenciljs/core/issues/5457).`
3329
+ );
3330
+ }
3331
+ const oldVal = hostRef.$instanceValues$.get(propName);
3332
+ const flags = hostRef.$flags$;
3333
+ const instance = hostRef.$lazyInstance$ ;
3334
+ newVal = parsePropertyValue(
3335
+ newVal,
3336
+ cmpMeta.$members$[propName][0]);
3337
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
3338
+ const didValueChange = newVal !== oldVal && !areBothNaN;
3339
+ if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
3340
+ hostRef.$instanceValues$.set(propName, newVal);
3341
+ if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
3342
+ if (instance.componentShouldUpdate) {
3343
+ if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
3344
+ return;
3345
+ }
3346
+ }
3347
+ scheduleUpdate(hostRef, false);
3348
+ }
3349
+ }
3350
+ };
3351
+
3352
+ // src/runtime/proxy-component.ts
3353
+ var proxyComponent = (Cstr, cmpMeta, flags) => {
3354
+ var _a, _b;
3355
+ const prototype = Cstr.prototype;
3356
+ if (cmpMeta.$members$ || BUILD.propChangeCallback) {
3357
+ const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
3358
+ members.map(([memberName, [memberFlags]]) => {
3359
+ if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
3360
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
3361
+ if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
3362
+ if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
3363
+ if (flags & 1 /* isElementConstructor */ || !origGetter) {
3364
+ Object.defineProperty(prototype, memberName, {
3365
+ get() {
3366
+ {
3367
+ if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
3368
+ return getValue(this, memberName);
3369
+ }
3370
+ const ref = getHostRef(this);
3371
+ const instance = ref ? ref.$lazyInstance$ : prototype;
3372
+ if (!instance) return;
3373
+ return instance[memberName];
3374
+ }
3375
+ },
3376
+ configurable: true,
3377
+ enumerable: true
3378
+ });
3379
+ }
3380
+ Object.defineProperty(prototype, memberName, {
3381
+ set(newValue) {
3382
+ const ref = getHostRef(this);
3383
+ if (!ref) {
3384
+ return;
3385
+ }
3386
+ if (origSetter) {
3387
+ const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
3388
+ if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
3389
+ newValue = ref.$instanceValues$.get(memberName);
3390
+ }
3391
+ origSetter.apply(this, [
3392
+ parsePropertyValue(
3393
+ newValue,
3394
+ memberFlags)
3395
+ ]);
3396
+ newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
3397
+ setValue(this, memberName, newValue, cmpMeta);
3398
+ return;
3399
+ }
3400
+ {
3401
+ if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
3402
+ setValue(this, memberName, newValue, cmpMeta);
3403
+ if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
3404
+ ref.$fetchedCbList$.push(() => {
3405
+ if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
3406
+ ref.$lazyInstance$[memberName] = newValue;
3407
+ }
3408
+ });
3409
+ }
3410
+ return;
3411
+ }
3412
+ const setterSetVal = () => {
3413
+ const currentValue = ref.$lazyInstance$[memberName];
3414
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
3415
+ ref.$instanceValues$.set(memberName, currentValue);
3416
+ }
3417
+ ref.$lazyInstance$[memberName] = parsePropertyValue(
3418
+ newValue,
3419
+ memberFlags);
3420
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
3421
+ };
3422
+ if (ref.$lazyInstance$) {
3423
+ setterSetVal();
3424
+ } else {
3425
+ ref.$fetchedCbList$.push(() => {
3426
+ setterSetVal();
3427
+ });
3428
+ }
3429
+ }
3430
+ }
3431
+ });
3432
+ }
3433
+ });
3434
+ if ((flags & 1 /* isElementConstructor */)) {
3435
+ const attrNameToPropName = /* @__PURE__ */ new Map();
3436
+ prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
3437
+ plt.jmp(() => {
3438
+ var _a2;
3439
+ const propName = attrNameToPropName.get(attrName);
3440
+ const hostRef = getHostRef(this);
3441
+ if (this.hasOwnProperty(propName) && BUILD.lazyLoad) {
3442
+ newValue = this[propName];
3443
+ delete this[propName];
3444
+ }
3445
+ if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
3446
+ this[propName] == newValue) {
3447
+ return;
3448
+ } else if (propName == null) {
3449
+ const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
3450
+ if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && newValue !== oldValue) {
3451
+ const instance = hostRef.$lazyInstance$ ;
3452
+ const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
3453
+ entry == null ? void 0 : entry.forEach((watcher) => {
3454
+ const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
3455
+ if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
3456
+ instance[watchMethodName].call(instance, newValue, oldValue, attrName);
3457
+ }
3458
+ });
3459
+ }
3460
+ return;
3461
+ }
3462
+ const propFlags = members.find(([m]) => m === propName);
3463
+ if (propFlags && propFlags[1][0] & 4 /* Boolean */) {
3464
+ newValue = newValue === null || newValue === "false" ? false : true;
3465
+ }
3466
+ const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
3467
+ if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
3468
+ this[propName] = newValue;
3469
+ }
3470
+ });
3471
+ };
3472
+ Cstr.observedAttributes = Array.from(
3473
+ /* @__PURE__ */ new Set([
3474
+ ...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
3475
+ ...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
3476
+ const attrName = m[1] || propName;
3477
+ attrNameToPropName.set(attrName, propName);
3478
+ return attrName;
3479
+ })
3480
+ ])
3481
+ );
3482
+ }
3483
+ }
3484
+ return Cstr;
3485
+ };
3486
+
3487
+ // src/runtime/initialize-component.ts
3488
+ var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
3489
+ let Cstr;
3490
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
3491
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
3492
+ const bundleId = cmpMeta.$lazyBundleId$;
3493
+ if (bundleId) {
3494
+ const CstrImport = loadModule(cmpMeta, hostRef);
3495
+ if (CstrImport && "then" in CstrImport) {
3496
+ const endLoad = uniqueTime();
3497
+ Cstr = await CstrImport;
3498
+ endLoad();
3499
+ } else {
3500
+ Cstr = CstrImport;
3501
+ }
3502
+ if (!Cstr) {
3503
+ throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
3504
+ }
3505
+ if (!Cstr.isProxied) {
3506
+ proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
3507
+ Cstr.isProxied = true;
3508
+ }
3509
+ const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
3510
+ {
3511
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
3512
+ }
3513
+ try {
3514
+ new Cstr(hostRef);
3515
+ } catch (e) {
3516
+ consoleError(e, elm);
3517
+ }
3518
+ {
3519
+ hostRef.$flags$ &= -9 /* isConstructingInstance */;
3520
+ }
3521
+ endNewInstance();
3522
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
3523
+ } else {
3524
+ Cstr = elm.constructor;
3525
+ const cmpTag = elm.localName;
3526
+ customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
3527
+ }
3528
+ if (Cstr && Cstr.style) {
3529
+ let style;
3530
+ if (typeof Cstr.style === "string") {
3531
+ style = Cstr.style;
3532
+ }
3533
+ const scopeId2 = getScopeId(cmpMeta);
3534
+ if (!styles.has(scopeId2) || BUILD.hotModuleReplacement) {
3535
+ const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
3536
+ registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
3537
+ endRegisterStyles();
3538
+ }
3539
+ }
3540
+ }
3541
+ const ancestorComponent = hostRef.$ancestorComponent$;
3542
+ const schedule = () => scheduleUpdate(hostRef, true);
3543
+ if (ancestorComponent && ancestorComponent["s-rc"]) {
3544
+ ancestorComponent["s-rc"].push(schedule);
3545
+ } else {
3546
+ schedule();
3547
+ }
3548
+ };
3549
+ var fireConnectedCallback = (instance, elm) => {
3550
+ {
3551
+ safeCall(instance, "connectedCallback", void 0, elm);
3552
+ }
3553
+ };
3554
+
3555
+ // src/runtime/connected-callback.ts
3556
+ var connectedCallback = (elm) => {
3557
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
3558
+ const hostRef = getHostRef(elm);
3559
+ if (!hostRef) {
3560
+ return;
3561
+ }
3562
+ const cmpMeta = hostRef.$cmpMeta$;
3563
+ const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
3564
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
3565
+ hostRef.$flags$ |= 1 /* hasConnected */;
3566
+ {
3567
+ let ancestorComponent = elm;
3568
+ while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
3569
+ if (ancestorComponent["s-p"]) {
3570
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
3571
+ break;
3572
+ }
3573
+ }
3574
+ }
3575
+ if (cmpMeta.$members$) {
3576
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
3577
+ if (memberFlags & 31 /* Prop */ && memberName in elm && elm[memberName] !== Object.prototype[memberName]) {
3578
+ const value = elm[memberName];
3579
+ delete elm[memberName];
3580
+ elm[memberName] = value;
3581
+ }
3582
+ });
3583
+ }
3584
+ {
3585
+ initializeComponent(elm, hostRef, cmpMeta);
3586
+ }
3587
+ } else {
3588
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
3589
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
3590
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
3591
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$, elm));
3592
+ }
3593
+ }
3594
+ endConnected();
3595
+ }
3596
+ };
3597
+ var disconnectInstance = (instance, elm) => {
3598
+ {
3599
+ safeCall(instance, "disconnectedCallback", void 0, elm || instance);
3600
+ }
3601
+ };
3602
+ var disconnectedCallback = async (elm) => {
3603
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
3604
+ const hostRef = getHostRef(elm);
3605
+ if (hostRef == null ? void 0 : hostRef.$lazyInstance$) {
3606
+ disconnectInstance(hostRef.$lazyInstance$, elm);
3607
+ } else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
3608
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$, elm));
3609
+ }
3610
+ }
3611
+ if (rootAppliedStyles.has(elm)) {
3612
+ rootAppliedStyles.delete(elm);
3613
+ }
3614
+ if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
3615
+ rootAppliedStyles.delete(elm.shadowRoot);
3616
+ }
3617
+ };
3618
+
3619
+ // src/runtime/bootstrap-lazy.ts
3620
+ var bootstrapLazy = (lazyBundles, options = {}) => {
3621
+ var _a;
3622
+ if (!win.document) {
3623
+ console.warn("Stencil: No document found. Skipping bootstrapping lazy components.");
3624
+ return;
3625
+ }
3626
+ const endBootstrap = createTime();
3627
+ const cmpTags = [];
3628
+ const exclude = options.exclude || [];
3629
+ const customElements2 = win.customElements;
3630
+ const head = win.document.head;
3631
+ const metaCharset = /* @__PURE__ */ head.querySelector("meta[charset]");
3632
+ const dataStyles = /* @__PURE__ */ win.document.createElement("style");
3633
+ const deferredConnectedCallbacks = [];
3634
+ let appLoadFallback;
3635
+ let isBootstrapping = true;
3636
+ Object.assign(plt, options);
3637
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
3638
+ let hasSlotRelocation = false;
3639
+ lazyBundles.map((lazyBundle) => {
3640
+ lazyBundle[1].map((compactMeta) => {
3641
+ const cmpMeta = {
3642
+ $flags$: compactMeta[0],
3643
+ $tagName$: compactMeta[1],
3644
+ $members$: compactMeta[2],
3645
+ $listeners$: compactMeta[3]
3646
+ };
3647
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
3648
+ hasSlotRelocation = true;
3649
+ }
3650
+ {
3651
+ cmpMeta.$members$ = compactMeta[2];
3652
+ }
3653
+ const tagName = transformTag(cmpMeta.$tagName$);
3654
+ const HostElement = class extends HTMLElement {
3655
+ // StencilLazyHost
3656
+ constructor(self) {
3657
+ super(self);
3658
+ this.hasRegisteredEventListeners = false;
3659
+ self = this;
3660
+ registerHost(self, cmpMeta);
3661
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
3662
+ {
3663
+ if (!self.shadowRoot) {
3664
+ createShadowRoot.call(self, cmpMeta);
3665
+ } else {
3666
+ if (self.shadowRoot.mode !== "open") {
3667
+ throw new Error(
3668
+ `Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${self.shadowRoot.mode} but Stencil only supports open shadow roots.`
3669
+ );
3670
+ }
3671
+ }
3672
+ }
3673
+ }
3674
+ }
3675
+ connectedCallback() {
3676
+ const hostRef = getHostRef(this);
3677
+ if (!hostRef) {
3678
+ return;
3679
+ }
3680
+ if (!this.hasRegisteredEventListeners) {
3681
+ this.hasRegisteredEventListeners = true;
3682
+ }
3683
+ if (appLoadFallback) {
3684
+ clearTimeout(appLoadFallback);
3685
+ appLoadFallback = null;
3686
+ }
3687
+ if (isBootstrapping) {
3688
+ deferredConnectedCallbacks.push(this);
3689
+ } else {
3690
+ plt.jmp(() => connectedCallback(this));
3691
+ }
3692
+ }
3693
+ disconnectedCallback() {
3694
+ plt.jmp(() => disconnectedCallback(this));
3695
+ plt.raf(() => {
3696
+ var _a3;
3697
+ const hostRef = getHostRef(this);
3698
+ if (!hostRef) {
3699
+ return;
3700
+ }
3701
+ const i2 = deferredConnectedCallbacks.findIndex((host) => host === this);
3702
+ if (i2 > -1) {
3703
+ deferredConnectedCallbacks.splice(i2, 1);
3704
+ }
3705
+ if (((_a3 = hostRef == null ? void 0 : hostRef.$vnode$) == null ? void 0 : _a3.$elm$) instanceof Node && !hostRef.$vnode$.$elm$.isConnected) {
3706
+ delete hostRef.$vnode$.$elm$;
3707
+ }
3708
+ });
3709
+ }
3710
+ componentOnReady() {
3711
+ var _a3;
3712
+ return (_a3 = getHostRef(this)) == null ? void 0 : _a3.$onReadyPromise$;
3713
+ }
3714
+ };
3715
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
3716
+ if (!exclude.includes(tagName) && !customElements2.get(tagName)) {
3717
+ cmpTags.push(tagName);
3718
+ customElements2.define(
3719
+ tagName,
3720
+ proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */)
3721
+ );
3722
+ }
3723
+ });
3724
+ });
3725
+ if (cmpTags.length > 0) {
3726
+ if (hasSlotRelocation) {
3727
+ dataStyles.textContent += SLOT_FB_CSS;
3728
+ }
3729
+ {
3730
+ dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
3731
+ }
3732
+ if (dataStyles.innerHTML.length) {
3733
+ dataStyles.setAttribute("data-styles", "");
3734
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
3735
+ if (nonce != null) {
3736
+ dataStyles.setAttribute("nonce", nonce);
3737
+ }
3738
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
3739
+ }
3740
+ }
3741
+ isBootstrapping = false;
3742
+ if (deferredConnectedCallbacks.length) {
3743
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
3744
+ } else {
3745
+ {
3746
+ plt.jmp(() => appLoadFallback = setTimeout(appDidLoad, 30));
3747
+ }
3748
+ }
3749
+ endBootstrap();
3750
+ };
3751
+ function transformTag(tag) {
3752
+ return tag;
3753
+ }
3754
+
3755
+ const globalScripts = () => {};
3756
+
3757
+ const defineCustomElements = async (win, options) => {
3758
+ if (typeof window === 'undefined') return undefined;
3759
+ await globalScripts();
3760
+ return bootstrapLazy([["ocr-file-uploader",[[1,"ocr-file-uploader",{"batch":[4],"callback":[16],"jsonSchema":[1,"json-schema"]}]]]], options);
3761
+ };
3762
+
3763
+ (function(){if("undefined"!==typeof window&&void 0!==window.Reflect&&void 0!==window.customElements){var a=HTMLElement;window.HTMLElement=function(){return Reflect.construct(a,[],this.constructor)};HTMLElement.prototype=a.prototype;HTMLElement.prototype.constructor=HTMLElement;Object.setPrototypeOf(HTMLElement,a);}})();
3764
+
3765
+ const voiceInputModuleCss = ":host{display:block;font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif}.row-audio-area{display:flex;flex-direction:row}.voice-recorder-container{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:1rem;border:1px solid #e5e7eb;border-radius:0.5rem;background:#ffffff;max-width:100px;margin:0 auto}.voice-recorder-container-debug{display:flex;flex-direction:column;align-items:center;gap:1rem;padding:1rem;border:1px solid #e5e7eb;border-radius:0.5rem;background:#ffffff;max-width:800px;margin:0 auto}.upload-record-container{display:inline-block;cursor:pointer;width:50px;height:50px}.upload-record-button{display:flex;align-items:center;justify-content:center;transition:transform 0.2s ease, box-shadow 0.2s ease;user-select:none}.upload-record-button svg{width:50px;height:50px;stroke:#4444ee}.upload-record-button svg path{fill:#4444ee}.upload-record-button:hover svg{transform:scale(1.05);stroke:#4444ee}.record-button{display:flex;align-items:center;justify-content:center;width:50px;height:50px;border:none;border-radius:50%;background:#ee4444;color:white;cursor:pointer;transition:all 0.2s ease;position:relative;overflow:hidden}.record-button:hover:not(:disabled){background:#dd3333;transform:scale(1.05)}.record-button:disabled{opacity:0.6;cursor:not-allowed}.record-button.recording{background:#dd3333;animation:pulse 1.5s infinite}.record-button.processing{background:#3b82f6}@keyframes pulse{0%{box-shadow:0 0 0 0 rgba(239, 68, 68, 0.7)}70%{box-shadow:0 0 0 10px rgba(239, 68, 68, 0)}100%{box-shadow:0 0 0 0 rgba(239, 68, 68, 0)}}.record-icon{width:24px;height:24px;fill:currentColor}.status-text{font-size:0.875rem;color:#6b7280;text-align:center;min-height:1.25rem}.status-text.error{color:#ee4444}.status-text.success{color:#10b981}.debug-panel{width:100%;margin-top:1rem;padding:1rem;background:#f9fafb;border:1px solid #e5e7eb;border-radius:0.375rem;font-family:'Monaco', 'Menlo', 'Ubuntu Mono', monospace;font-size:0.75rem}.debug-title{font-weight:600;margin-bottom:0.5rem;color:#374151}.debug-content{white-space:pre-wrap;word-break:break-word;color:#6b7280;max-height:200px;overflow-y:auto}.permissions-warning{padding:0.75rem;background:#fef3c7;border:1px solid #f59e0b;border-radius:0.375rem;color:#92400e;font-size:0.875rem;text-align:center}.form-preview{width:100%;margin-top:1rem;padding:1rem;background:#f8fafc;border:1px solid #e2e8f0;border-radius:0.375rem}.form-preview-title{font-weight:600;margin-bottom:0.5rem;color:#1e293b}.form-field{margin-bottom:0.5rem;font-size:0.875rem}.field-name{font-weight:500;color:#475569}.field-value{color:#64748b;margin-left:0.5rem}.field-value.filled{color:#059669;font-weight:500}.voice-filled-form{display:flex;flex-direction:column;gap:1rem;margin-top:1rem}.form-group{display:flex;flex-direction:column;gap:0.25rem}.form-label{font-weight:500;color:#374151;font-size:0.875rem}.required{color:#ee4444;margin-left:0.125rem}.form-input{padding:0.5rem;border:1px solid #d1d5db;border-radius:0.375rem;font-size:0.875rem;transition:border-color 0.2s ease}.form-input:focus{outline:none;border-color:#3b82f6;box-shadow:0 0 0 3px rgba(59, 130, 246, 0.1)}.form-checkbox{width:auto;padding:0;margin:0}select.form-input{background-color:white;cursor:pointer}input[type=\"date\"].form-input{cursor:pointer}.readonly-select{background:#f9fafb;border:1px solid #d1d5db;border-radius:0.375rem;padding:0.5rem}.select-placeholder{font-size:0.875rem;color:#6b7280;margin-bottom:0.5rem}.select-options-list{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:0.25rem}.select-option{background:#e5e7eb;padding:0.25rem 0.5rem;border-radius:0.25rem;font-size:0.875rem;color:#374151}.multiselect-container{display:flex;flex-direction:column;gap:0.5rem;padding:0.5rem;border:1px solid #d1d5db;border-radius:0.375rem;background:white}.multiselect-option{display:flex;align-items:center;gap:0.5rem;padding:0.5rem;border-radius:0.25rem;cursor:pointer;transition:background 0.2s ease}.multiselect-option:hover{background:#f3f4f6}.multiselect-option input[type=\"checkbox\"]{width:18px;height:18px;cursor:pointer}.multiselect-option input[type=\"checkbox\"]:checked+.multiselect-label{font-weight:600;color:#059669}.multiselect-label{font-size:0.875rem;color:#374151;user-select:none}";
3766
+
3767
+ // Initialize OCR
3768
+ defineCustomElements();
3769
+ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecorder extends HTMLElement$1 {
3770
+ get parsedInputTypes() {
3771
+ if (!this.inputTypes)
3772
+ return [];
3773
+ try {
3774
+ return JSON.parse(this.inputTypes.replace(/'/g, '"'));
3775
+ }
3776
+ catch (_a) {
3777
+ return this.inputTypes.split(',').map(type => type.trim());
3778
+ }
3779
+ }
749
3780
  constructor() {
750
3781
  super();
751
3782
  this.__registerHost();
@@ -757,7 +3788,7 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
757
3788
  this.context = undefined;
758
3789
  this.classificationRootUrl = 'http://localhost';
759
3790
  this.language = 'en';
760
- this.voiceOrOcr = undefined;
3791
+ this.inputTypes = '';
761
3792
  this.debug = false;
762
3793
  this.renderForm = false;
763
3794
  this.displayStatus = false;
@@ -768,6 +3799,18 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
768
3799
  this.filledData = null;
769
3800
  this.debugInfo = {};
770
3801
  this.isReadonlyMode = true; // Start in readonly preview mode
3802
+ this.triggerAudioRecordUpload = () => {
3803
+ this.fileInputAudioRecord.click();
3804
+ };
3805
+ this.handleAudioRecordChange = async (event) => {
3806
+ const input = event.target;
3807
+ if (!input.files || input.files.length === 0)
3808
+ return;
3809
+ const file = input.files[0];
3810
+ // Here you can handle the file upload to your API
3811
+ console.log('Selected file:', file);
3812
+ this.processAudioContent(file);
3813
+ };
771
3814
  this.audioRecorder = new AudioRecorderService();
772
3815
  }
773
3816
  componentWillLoad() {
@@ -798,7 +3841,10 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
798
3841
  config: this.parsedConfig
799
3842
  });
800
3843
  this.hasError = false;
801
- this.statusMessage = (this.language == 'en' ? 'Click to start recording' : 'Cliquer pour enregistrer');
3844
+ this.statusMessage = (this.language == 'en' ? 'Select an input method' : 'Sélectionner une méthode de saisie');
3845
+ if (this.parsedInputTypes.length === 0) {
3846
+ this.inputTypes = 'voice';
3847
+ }
802
3848
  }
803
3849
  }
804
3850
  catch (error) {
@@ -849,14 +3895,17 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
849
3895
  });
850
3896
  }
851
3897
  }
852
- async processJsonForm(jsonForm) {
853
- // console.log("processJsonForm", jsonForm);
3898
+ async processJsonForm(ocrData) {
3899
+ console.log("processJsonForm", ocrData);
854
3900
  try {
855
3901
  this.isProcessing = true;
856
3902
  this.statusMessage = (this.language == 'en' ? 'Processing json...' : `Traitement du json ...`);
3903
+ // Extract content from OCR format
3904
+ const extractedData = (ocrData === null || ocrData === void 0 ? void 0 : ocrData.content) || ocrData;
3905
+ const jsonForm = JSON.stringify(extractedData);
857
3906
  // Fill form using LLM
858
3907
  this.statusMessage = (this.language == 'en' ? 'Filling form fields...' : 'Remplissage du formulaire ...');
859
- const trimmedSchema = this.trimSchemaForAI(this.parsedSchema);
3908
+ const trimmedSchema = await this.trimSchemaForAI(this.parsedSchema);
860
3909
  const filledSchema = await this.llmService.fillFormFromJson(jsonForm, trimmedSchema);
861
3910
  // Extract filled data
862
3911
  this.filledData = this.extractFilledData(filledSchema);
@@ -880,13 +3929,46 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
880
3929
  this.formFilled.emit({
881
3930
  success: false,
882
3931
  error: error.message,
883
- jsonForm: jsonForm
3932
+ jsonForm: JSON.stringify(ocrData)
884
3933
  });
885
3934
  }
886
3935
  finally {
887
3936
  this.isProcessing = false;
888
3937
  }
889
3938
  }
3939
+ async processAudioContent(audioFile) {
3940
+ this.updateDebugInfo('Audio Captured', {
3941
+ size: audioFile.size,
3942
+ type: audioFile.type
3943
+ });
3944
+ // Transcribe audio
3945
+ this.statusMessage = (this.language == 'en' ? 'Transcribing speech...' : 'Transcription du texte ...');
3946
+ const transcription = await this.speechToTextService.transcribe(audioFile, this.language);
3947
+ this.transcription = transcription;
3948
+ this.updateDebugInfo('Transcription Complete', { transcription });
3949
+ if (!transcription.trim()) {
3950
+ throw new Error('No speech detected in the recording');
3951
+ }
3952
+ // Fill form using LLM
3953
+ this.statusMessage = (this.language == 'en' ? 'Filling form fields...' : 'Remplissage du formulaire ...');
3954
+ const trimmedSchema = await this.trimSchemaForAI(this.parsedSchema);
3955
+ const filledSchema = await this.llmService.fillFormFromTranscription(transcription, trimmedSchema);
3956
+ // Extract filled data
3957
+ this.filledData = this.extractFilledData(filledSchema);
3958
+ this.updateDebugInfo('Form Filled', {
3959
+ filledSchema,
3960
+ extractedData: this.filledData
3961
+ });
3962
+ this.parsedSchema = this.filledData;
3963
+ this.statusMessage = (this.language == 'en' ? 'Form completed!' : 'Formulaire remplis !');
3964
+ this.hasError = false;
3965
+ // Emit success event
3966
+ this.formFilled.emit({
3967
+ success: true,
3968
+ data: this.filledData,
3969
+ transcription: transcription
3970
+ });
3971
+ }
890
3972
  async stopRecordingAndProcess() {
891
3973
  try {
892
3974
  this.isRecording = false;
@@ -899,37 +3981,8 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
899
3981
  });
900
3982
  // Stop recording and get audio blob
901
3983
  const audioBlob = await this.audioRecorder.stopRecording();
902
- this.updateDebugInfo('Audio Captured', {
903
- size: audioBlob.size,
904
- type: audioBlob.type
905
- });
906
- // Transcribe audio
907
- this.statusMessage = (this.language == 'en' ? 'Transcribing speech...' : 'Transcription du texte ...');
908
- const transcription = await this.speechToTextService.transcribe(audioBlob, this.language);
909
- this.transcription = transcription;
910
- this.updateDebugInfo('Transcription Complete', { transcription });
911
- if (!transcription.trim()) {
912
- throw new Error('No speech detected in the recording');
913
- }
914
- // Fill form using LLM
915
- this.statusMessage = (this.language == 'en' ? 'Filling form fields...' : 'Remplissage du formulaire ...');
916
- const trimmedSchema = this.trimSchemaForAI(this.parsedSchema);
917
- const filledSchema = await this.llmService.fillFormFromTranscription(transcription, trimmedSchema);
918
- // Extract filled data
919
- this.filledData = this.extractFilledData(filledSchema);
920
- this.updateDebugInfo('Form Filled', {
921
- filledSchema,
922
- extractedData: this.filledData
923
- });
924
- this.parsedSchema = this.filledData;
925
- this.statusMessage = (this.language == 'en' ? 'Form completed!' : 'Formulaire remplis !');
926
- this.hasError = false;
927
- // Emit success event
928
- this.formFilled.emit({
929
- success: true,
930
- data: this.filledData,
931
- transcription: transcription
932
- });
3984
+ const audioContent = new File([audioBlob], 'audio.webm', { type: 'audio/webm' });
3985
+ this.processAudioContent(audioContent);
933
3986
  }
934
3987
  catch (error) {
935
3988
  this.hasError = true;
@@ -953,11 +4006,13 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
953
4006
  // console.log("extractFilledData", filledData);
954
4007
  const updatedSchema = JSON.parse(JSON.stringify(this.parsedSchema));
955
4008
  switch (this.context) {
4009
+ case "ecoteka":
4010
+ // console.log("TODO extractFilledData", filledData);
956
4011
  case "ng":
957
4012
  if (filledData === null || filledData === void 0 ? void 0 : filledData.fields) {
958
4013
  // Map AI response back to original schema structure
959
4014
  filledData.fields.forEach((field) => {
960
- const originalField = updatedSchema.Children.find((child) => child.System_Name === field.name);
4015
+ const originalField = updatedSchema.Children.find((child) => { var _a; return child.System_Name === field.name || ((_a = child.Settings) === null || _a === void 0 ? void 0 : _a.Label) === field.name; });
961
4016
  if (originalField && field.value !== undefined && field.value !== null && field.value !== '') {
962
4017
  if (!originalField.Settings)
963
4018
  originalField.Settings = {};
@@ -980,9 +4035,6 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
980
4035
  });
981
4036
  }
982
4037
  break;
983
- case "ecoteka":
984
- // console.log("TODO extractFilledData", filledData);
985
- break;
986
4038
  case "track":
987
4039
  default:
988
4040
  Object.entries(filledData.fields).forEach(([fieldID, field]) => {
@@ -1005,28 +4057,33 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
1005
4057
  // console.log("extractFilledData result", updatedSchema);
1006
4058
  return updatedSchema;
1007
4059
  }
1008
- trimSchemaForAI(schema) {
4060
+ async trimSchemaForAI(schema) {
1009
4061
  var _a, _b;
1010
4062
  // console.log("trimSchemaForAI", schema);
1011
4063
  switch (this.context) {
1012
- case 'ng':
4064
+ case "ecoteka":
4065
+ // console.log("TODO trimSchemaForAI", schema)
4066
+ case "ng":
1013
4067
  const trimmed = { fields: [] };
1014
4068
  schema.Children.forEach((child) => {
4069
+ var _a;
1015
4070
  if (!child.System_Name || !child.Type)
1016
4071
  return;
1017
4072
  const fieldData = {
1018
- name: child.System_Name,
4073
+ name: child.Label || ((_a = child.Settings) === null || _a === void 0 ? void 0 : _a.Label) || child.System_Name,
1019
4074
  type: this.mapFieldType(child.Type)
1020
4075
  };
1021
4076
  // Add options for classification/select fields
1022
- if (child.Type === 'InputClassification' && child.Children && child.Children.length > 0) {
4077
+ const selectTypes = ['InputClassification', 'select'];
4078
+ if (selectTypes.includes(child.Type) && child.Children && child.Children.length > 0) {
1023
4079
  fieldData.options = child.Children.map((option) => option.System_Name || option.Label || option.toString());
1024
4080
  }
4081
+ console.log("fieldData", fieldData);
1025
4082
  trimmed.fields.push(fieldData);
1026
4083
  });
1027
4084
  // console.log("Schema apres transformation, contexte NG:", trimmed);
1028
4085
  return trimmed;
1029
- case 'ecoll-veto':
4086
+ case "ecoll-veto":
1030
4087
  // console.log("TODO trimSchemaForAI", schema)
1031
4088
  const mergedItemsSchema = (this.parsedSchema[0].items).concat(this.parsedSchema[1].items);
1032
4089
  if (mergedItemsSchema) {
@@ -1035,10 +4092,35 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
1035
4092
  description: 'Form Description',
1036
4093
  schema: {}
1037
4094
  };
1038
- Object.entries(mergedItemsSchema).forEach(([key, field]) => {
4095
+ Object.entries(mergedItemsSchema).forEach(async ([key, field]) => {
1039
4096
  const fieldName = field.name;
1040
4097
  const fieldType = this.mapFieldType(field.type);
1041
4098
  const fieldLabel = field.label || fieldName;
4099
+ if (['position', 'thesaurus'].includes(fieldType)) {
4100
+ try {
4101
+ const response = await fetch(`${this.classificationRootUrl}/ng/api/v1/classification/getList/${fieldType.toLowerCase() == 'position' ? "Position" : "Thesaurus"}/?StartNodeID=${field.config.options.options.startNode}`);
4102
+ if (!response.ok)
4103
+ throw new Error(`HTTP error! status: ${response.status}`);
4104
+ const data = await response.json();
4105
+ if (Array.isArray(data)) {
4106
+ const options = data.map(item => ({
4107
+ value: item.ID,
4108
+ label: item.System_Name
4109
+ }));
4110
+ if (options.length > 0) {
4111
+ field.pickerOptions = options;
4112
+ // TODO on degage les quotes simples temporairement, a corriger
4113
+ field.options = options.map(option => option.label.replace("'", ""));
4114
+ }
4115
+ }
4116
+ else {
4117
+ console.error("Unexpected API response format:", data);
4118
+ }
4119
+ }
4120
+ catch (error) {
4121
+ console.error("Error fetching classification data:", error);
4122
+ }
4123
+ }
1042
4124
  trimmedSchema.schema[fieldName] = {
1043
4125
  type: fieldType,
1044
4126
  title: fieldLabel,
@@ -1050,10 +4132,7 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
1050
4132
  // console.log("Schema apres transformation, contexte Track:", trimmedSchema);
1051
4133
  return trimmedSchema;
1052
4134
  }
1053
- case "ecoteka":
1054
- // console.log("TODO trimSchemaForAI", schema)
1055
- break;
1056
- case 'track':
4135
+ case "track":
1057
4136
  default:
1058
4137
  // Handle simple schema format (backward compatibility)
1059
4138
  if ((_a = schema === null || schema === void 0 ? void 0 : schema.schema) !== null && _a !== void 0 ? _a : schema === null || schema === void 0 ? void 0 : schema.fields) {
@@ -1089,16 +4168,20 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
1089
4168
  'InputTextArea': 'string',
1090
4169
  'InputDateTimePicker': 'datetime',
1091
4170
  'InputDecimal': 'number',
1092
- 'InputClassification': 'select',
4171
+ 'InputClassification': 'classification',
1093
4172
  'InputCheckbox': 'boolean',
1094
4173
  'InputTextTranslation': 'string',
1095
- 'thesaurus': 'string',
1096
- 'position': 'string',
4174
+ 'InputMultiSelect': 'multiselect',
4175
+ 'thesaurus': 'thesaurus',
4176
+ 'position': 'position',
1097
4177
  'text': 'string',
1098
4178
  'textarea': 'string',
1099
4179
  'number': 'number',
1100
4180
  'date': 'date',
1101
- 'datetime': 'datetime'
4181
+ 'datetime': 'datetime',
4182
+ 'select': 'select',
4183
+ 'multiselect': 'multiselect',
4184
+ 'checkbox': 'checkbox'
1102
4185
  };
1103
4186
  return typeMapping[type] || 'string';
1104
4187
  }
@@ -1117,12 +4200,63 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
1117
4200
  return SchemaConverter.convertJsonToXmlLegacy(jsonForm);
1118
4201
  }
1119
4202
  renderUploadButton() {
1120
- if (!['ocr', 'both'].includes(this.voiceOrOcr))
4203
+ if (!this.parsedInputTypes.includes('ocr'))
1121
4204
  return;
1122
- return (h("file-uploader", { batch: false, callback: (data) => { this.processJsonForm(data); } }));
4205
+ return (h$1("ocr-file-uploader", { batch: false, "json-schema": this.convertSchemaToOcrFormat(this.parsedSchema), callback: (data) => { this.processJsonForm(data); } }));
4206
+ }
4207
+ convertSchemaToOcrFormat(schema) {
4208
+ const ocrSchema = {
4209
+ type: "object",
4210
+ additionalProperties: false,
4211
+ properties: {
4212
+ meta: {
4213
+ type: "object",
4214
+ additionalProperties: false,
4215
+ properties: {
4216
+ page: { type: "integer" },
4217
+ confiance_global: { type: "number" }
4218
+ },
4219
+ required: ["page", "confiance_global"]
4220
+ },
4221
+ content: {
4222
+ type: "object",
4223
+ additionalProperties: false,
4224
+ properties: {},
4225
+ required: []
4226
+ }
4227
+ },
4228
+ required: ["meta", "content"]
4229
+ };
4230
+ if (schema === null || schema === void 0 ? void 0 : schema.Children) {
4231
+ schema.Children.forEach((child) => {
4232
+ var _a;
4233
+ if (child.System_Name && child.Type) {
4234
+ const fieldLabel = ((_a = child.Settings) === null || _a === void 0 ? void 0 : _a.Label) || child.System_Name;
4235
+ const fieldType = this.mapOcrFieldType(child.Type);
4236
+ ocrSchema.properties.content.properties[fieldLabel] = {
4237
+ anyOf: [{ type: fieldType }, { type: "null" }]
4238
+ };
4239
+ }
4240
+ });
4241
+ }
4242
+ return JSON.stringify(ocrSchema);
4243
+ }
4244
+ mapOcrFieldType(type) {
4245
+ const typeMapping = {
4246
+ 'InputInteger': 'number',
4247
+ 'InputDecimal': 'number',
4248
+ 'InputDateTimePicker': 'string',
4249
+ 'InputCheckbox': 'boolean'
4250
+ };
4251
+ return typeMapping[type] || 'string';
4252
+ }
4253
+ renderUploadRecordButton() {
4254
+ if (!this.parsedInputTypes.includes('audio'))
4255
+ return;
4256
+ return (h$1("div", { class: "upload-record-container", onClick: this.triggerAudioRecordUpload }, h$1("input", { type: "file", ref: el => (this.fileInputAudioRecord = el), onChange: this.handleAudioRecordChange, style: { display: 'none' } }), h$1("div", { class: 'upload-record-button' }, h$1("svg", { width: "800px", height: "800px", viewBox: "0 0 24 24", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, h$1("path", { "fill-rule": "evenodd", "clip-rule": "evenodd", d: "M12 2.75C6.89137 2.75 2.75 6.89137 2.75 12C2.75 17.1086 6.89137 21.25 12 21.25C12.6345 21.25 13.2534 21.1862 13.8508 21.065C14.2567 20.9826 14.6526 21.2448 14.735 21.6508C14.8174 22.0567 14.5551 22.4526 14.1492 22.535C13.4541 22.6761 12.7353 22.75 12 22.75C6.06294 22.75 1.25 17.9371 1.25 12C1.25 6.06294 6.06294 1.25 12 1.25C17.9371 1.25 22.75 6.06294 22.75 12C22.75 12.7353 22.6761 13.4541 22.535 14.1492C22.4526 14.5551 22.0567 14.8174 21.6508 14.735C21.2448 14.6526 20.9826 14.2567 21.065 13.8508C21.1862 13.2534 21.25 12.6345 21.25 12C21.25 6.89137 17.1086 2.75 12 2.75ZM12.7676 8.52584C12.7661 8.53409 12.7604 8.56729 12.7564 8.64336C12.7502 8.76101 12.75 8.91982 12.75 9.17082C12.75 9.27795 12.7501 9.33904 12.7518 9.38529C12.7528 9.41425 12.7542 9.42649 12.7546 9.42955C12.7662 9.48945 12.7993 9.54303 12.8477 9.58021C12.8502 9.58194 12.8606 9.58864 12.886 9.60252C12.9266 9.62468 12.9812 9.65209 13.0771 9.7L14.3938 10.3584C14.6183 10.4706 14.7604 10.5414 14.8684 10.5885C14.9382 10.6189 14.9705 10.6287 14.9785 10.631C15.0885 10.6405 15.1917 10.5767 15.2324 10.4742C15.2339 10.4659 15.2396 10.4327 15.2436 10.3566C15.2498 10.239 15.25 10.0802 15.25 9.82918C15.25 9.72205 15.2499 9.66096 15.2482 9.61471C15.2472 9.58575 15.2458 9.57351 15.2454 9.57045C15.2338 9.51055 15.2007 9.45697 15.1523 9.41979C15.1498 9.41805 15.1394 9.41136 15.114 9.39748C15.0734 9.37533 15.0188 9.34791 14.9229 9.3L13.6062 8.64164C13.3817 8.52939 13.2396 8.45859 13.1316 8.41151C13.0617 8.38107 13.0295 8.37131 13.0215 8.36896C12.9115 8.35945 12.8083 8.42327 12.7676 8.52584ZM12.75 11.2135L13.7396 11.7083C13.9425 11.8098 14.1204 11.8987 14.269 11.9635C14.4199 12.0293 14.5988 12.097 14.7972 12.1202C15.6037 12.2142 16.3689 11.7413 16.6454 10.978C16.7134 10.7901 16.7328 10.5998 16.7415 10.4355C16.75 10.2735 16.75 10.0747 16.75 9.8479V9.82918C16.75 9.81565 16.75 9.80205 16.75 9.78837C16.7503 9.62647 16.7505 9.45474 16.7188 9.28904C16.638 8.86674 16.4045 8.48898 16.0629 8.22783C15.9289 8.12535 15.7752 8.04877 15.6303 7.97658C15.618 7.97048 15.6059 7.96441 15.5938 7.95836L14.2603 7.29164C14.0575 7.19022 13.8796 7.10128 13.731 7.03647C13.5801 6.97071 13.4012 6.90297 13.2028 6.87982C12.3963 6.78575 11.6311 7.25868 11.3546 8.02203C11.2866 8.20986 11.2672 8.40019 11.2585 8.56454C11.2519 8.68919 11.2504 8.83571 11.2501 9L11.25 9.11944C11.25 9.13026 11.25 9.14115 11.25 9.1521V9.17082C11.25 9.18435 11.25 9.19795 11.25 9.21163C11.2499 9.23918 11.2499 9.26701 11.25 9.29505V12.5499C10.875 12.3581 10.4501 12.25 10 12.25C8.48122 12.25 7.25 13.4812 7.25 15C7.25 16.5188 8.48122 17.75 10 17.75C11.5188 17.75 12.75 16.5188 12.75 15V11.2135ZM11.25 15C11.25 14.3096 10.6904 13.75 10 13.75C9.30964 13.75 8.75 14.3096 8.75 15C8.75 15.6904 9.30964 16.25 10 16.25C10.6904 16.25 11.25 15.6904 11.25 15ZM17.4697 14.4697C17.7626 14.1768 18.2374 14.1768 18.5303 14.4697L21.0303 16.9697C21.3232 17.2626 21.3232 17.7374 21.0303 18.0303C20.7374 18.3232 20.2626 18.3232 19.9697 18.0303L18.75 16.8107V22C18.75 22.4142 18.4142 22.75 18 22.75C17.5858 22.75 17.25 22.4142 17.25 22V16.8107L16.0303 18.0303C15.7374 18.3232 15.2626 18.3232 14.9697 18.0303C14.6768 17.7374 14.6768 17.2626 14.9697 16.9697L17.4697 14.4697Z" })))));
1123
4257
  }
1124
4258
  renderRecordButton() {
1125
- if (!['voice', 'both', undefined].includes(this.voiceOrOcr))
4259
+ if (!this.parsedInputTypes.includes('voice'))
1126
4260
  return;
1127
4261
  const buttonClass = [
1128
4262
  'record-button',
@@ -1130,7 +4264,7 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
1130
4264
  this.isProcessing && 'processing'
1131
4265
  ].filter(Boolean).join(' ');
1132
4266
  const isDisabled = this.isProcessing || this.hasError;
1133
- return (h("button", { class: buttonClass, onClick: () => this.handleRecordClick(), disabled: isDisabled, "aria-label": this.isRecording ? 'Stop recording' : 'Start recording' }, this.isProcessing ? (h("svg", { class: "record-icon", viewBox: "0 0 24 24" }, h("circle", { cx: "12", cy: "12", r: "3" }, h("animate", { attributeName: "r", values: "3;6;3", dur: "1s", repeatCount: "indefinite" }), h("animate", { attributeName: "opacity", values: "1;0.3;1", dur: "1s", repeatCount: "indefinite" })))) : this.isRecording ? (h("svg", { class: "record-icon", viewBox: "0 0 24 24" }, h("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" }))) : (h("svg", { class: "record-icon", viewBox: "0 0 24 24" }, h("circle", { cx: "12", cy: "12", r: "8" })))));
4267
+ return (h$1("button", { class: buttonClass, onClick: () => this.handleRecordClick(), disabled: isDisabled, "aria-label": this.isRecording ? 'Stop recording' : 'Start recording' }, this.isProcessing ? (h$1("svg", { class: "record-icon", viewBox: "0 0 24 24" }, h$1("circle", { cx: "12", cy: "12", r: "3" }, h$1("animate", { attributeName: "r", values: "3;6;3", dur: "1s", repeatCount: "indefinite" }), h$1("animate", { attributeName: "opacity", values: "1;0.3;1", dur: "1s", repeatCount: "indefinite" })))) : this.isRecording ? (h$1("svg", { class: "record-icon", viewBox: "0 0 24 24" }, h$1("rect", { x: "6", y: "6", width: "12", height: "12", rx: "2" }))) : (h$1("svg", { class: "record-icon", viewBox: "0 0 24 24" }, h$1("circle", { cx: "12", cy: "12", r: "8" })))));
1134
4268
  }
1135
4269
  renderStatusMessage() {
1136
4270
  const statusClass = [
@@ -1138,20 +4272,22 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
1138
4272
  this.hasError && 'error',
1139
4273
  this.filledData && !this.hasError && 'success'
1140
4274
  ].filter(Boolean).join(' ');
1141
- return h("div", { class: statusClass }, this.statusMessage);
4275
+ return h$1("div", { class: statusClass }, this.statusMessage);
1142
4276
  }
1143
4277
  renderFormPreview() {
1144
4278
  if (!this.parsedSchema)
1145
4279
  return null;
1146
4280
  const isPreview = this.isReadonlyMode && !this.filledData;
1147
4281
  const title = isPreview ? 'Form Preview (Voice input to fill)' : 'Voice-Filled Form:';
1148
- return (h("div", { class: "form-preview" }, h("div", { class: "form-preview-title" }, title), h("form", { class: "voice-filled-form" }, this.renderFormFields())));
4282
+ return (h$1("div", { class: "form-preview" }, h$1("div", { class: "form-preview-title" }, title), h$1("form", { class: "voice-filled-form" }, this.renderFormFields())));
1149
4283
  }
1150
4284
  renderFormFields() {
1151
4285
  // console.log("renderFormFields", this.parsedSchema);
1152
4286
  if (!this.parsedSchema)
1153
4287
  return null;
1154
4288
  switch (this.context) {
4289
+ case "ecoteka":
4290
+ // console.log("TODO renderFormFields", this.parsedSchema);
1155
4291
  case "ng":
1156
4292
  return this.parsedSchema.Children.map((child) => {
1157
4293
  var _a, _b, _c;
@@ -1162,7 +4298,7 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
1162
4298
  const fieldLabel = ((_a = child.Settings) === null || _a === void 0 ? void 0 : _a.Label) || child.System_Name;
1163
4299
  const isRequired = child.Required || false;
1164
4300
  const fieldValue = (_b = child.Settings) === null || _b === void 0 ? void 0 : _b.Default_Value;
1165
- return (h("div", { class: "form-group", key: fieldName }, h("label", { htmlFor: fieldName, class: "form-label" }, fieldLabel, isRequired && h("span", { class: "required" }, "*")), this.renderFormField(fieldName, {
4301
+ return (h$1("div", { class: "form-group", key: fieldName }, h$1("label", { htmlFor: fieldName, class: "form-label" }, fieldLabel, isRequired && h$1("span", { class: "required" }, "*")), this.renderFormField(fieldName, {
1166
4302
  type: fieldType,
1167
4303
  title: fieldLabel,
1168
4304
  required: isRequired,
@@ -1180,22 +4316,41 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
1180
4316
  const fieldLabel = field.label || fieldName;
1181
4317
  const isRequired = field.required || false;
1182
4318
  const fieldValue = this.parsedSchema[2][fieldName];
1183
- return (h("div", { class: "form-group", key: fieldName }, h("label", { htmlFor: fieldName, class: "form-label" }, fieldLabel, isRequired && h("span", { class: "required" }, "*")), this.renderFormField(fieldName, field, ((_b = (_a = this.filledData) === null || _a === void 0 ? void 0 : _a[fieldName]) !== null && _b !== void 0 ? _b : fieldValue))));
4319
+ // if (['position', 'thesaurus'].includes(field.type)) {
4320
+ // try {
4321
+ // const response = await fetch(`${this.classificationRootUrl}/ng/api/v1/classification/getList/${fieldType.toLowerCase() == 'position' ? "Position" : "Thesaurus"}/?StartNodeID=${field.config.options.options.startNode}`);
4322
+ // if (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);
4323
+ // const data = await response.json();
4324
+ // if (Array.isArray(data)) {
4325
+ // const options = data.map(item => ({
4326
+ // value: item.ID,
4327
+ // label: item.System_Name
4328
+ // }));
4329
+ // if (options.length > 0) {
4330
+ // field.pickerOptions = options;
4331
+ // // TODO on degage les quotes simples temporairement, a corriger
4332
+ // field.options = options.map(option => option.label.replace("'", ""));
4333
+ // }
4334
+ // } else {
4335
+ // console.error("Unexpected API response format:", data);
4336
+ // }
4337
+ // } catch (error) {
4338
+ // console.error("Error fetching classification data:", error);
4339
+ // }
4340
+ // }
4341
+ console.log("filling with", field);
4342
+ return (h$1("div", { class: "form-group", key: fieldName }, h$1("label", { htmlFor: fieldName, class: "form-label" }, fieldLabel, isRequired && h$1("span", { class: "required" }, "*")), this.renderFormField(fieldName, field, ((_b = (_a = this.filledData) === null || _a === void 0 ? void 0 : _a[fieldName]) !== null && _b !== void 0 ? _b : fieldValue))));
1184
4343
  });
1185
- case "ecoteka":
1186
- // console.log("TODO renderFormFields", this.parsedSchema);
1187
- break;
1188
4344
  case "track":
1189
4345
  default:
1190
4346
  return Object.entries(this.parsedSchema.fields).map(([fieldName, field]) => {
1191
4347
  var _a, _b;
1192
- return (h("div", { class: "form-group", key: fieldName }, h("label", { htmlFor: fieldName, class: "form-label" }, field.title || fieldName, field.required && h("span", { class: "required" }, "*")), this.renderFormField(fieldName, field, ((_b = (_a = this.filledData) === null || _a === void 0 ? void 0 : _a[fieldName]) !== null && _b !== void 0 ? _b : field.value))));
4348
+ return (h$1("div", { class: "form-group", key: fieldName }, h$1("label", { htmlFor: fieldName, class: "form-label" }, field.title || fieldName, field.required && h$1("span", { class: "required" }, "*")), this.renderFormField(fieldName, field, ((_b = (_a = this.filledData) === null || _a === void 0 ? void 0 : _a[fieldName]) !== null && _b !== void 0 ? _b : field.value))));
1193
4349
  });
1194
4350
  }
1195
- return null;
1196
4351
  }
1197
4352
  renderFormField(fieldName, field, value) {
1198
- var _a, _b;
4353
+ var _a, _b, _c, _d;
1199
4354
  const isReadonly = this.isReadonlyMode && !this.filledData;
1200
4355
  const commonProps = {
1201
4356
  id: fieldName,
@@ -1205,32 +4360,41 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
1205
4360
  disabled: isReadonly
1206
4361
  };
1207
4362
  switch (field.type) {
4363
+ case 'multiselect':
4364
+ if (isReadonly) {
4365
+ return (h$1("div", { class: "readonly-select" }, h$1("div", { class: "select-placeholder" }, "Available options:"), h$1("ul", { class: "select-options-list" }, (_a = field.options) === null || _a === void 0 ? void 0 : _a.map(option => (h$1("li", { class: "select-option" }, option))))));
4366
+ }
4367
+ const selectedValues = Array.isArray(value) ? value : (value ? [value] : []);
4368
+ return (h$1("div", { class: "multiselect-container" }, (_b = field.options) === null || _b === void 0 ? void 0 : _b.map(option => {
4369
+ const isChecked = selectedValues.some(v => (v === null || v === void 0 ? void 0 : v.toString().toLowerCase()) === (option === null || option === void 0 ? void 0 : option.toString().toLowerCase()));
4370
+ return (h$1("label", { class: "multiselect-option" }, h$1("input", { type: "checkbox", name: fieldName, value: option, checked: isChecked, disabled: isReadonly }), h$1("span", { class: "multiselect-label" }, option)));
4371
+ })));
1208
4372
  case 'select':
1209
4373
  if (isReadonly) {
1210
4374
  // In readonly mode, show all options as a list instead of dropdown
1211
- return (h("div", { class: "readonly-select" }, h("div", { class: "select-placeholder" }, "Available options:"), h("ul", { class: "select-options-list" }, (_a = field.options) === null || _a === void 0 ? void 0 : _a.map(option => (h("li", { class: "select-option" }, option))))));
4375
+ return (h$1("div", { class: "readonly-select" }, h$1("div", { class: "select-placeholder" }, "Available options:"), h$1("ul", { class: "select-options-list" }, (_c = field.options) === null || _c === void 0 ? void 0 : _c.map(option => (h$1("li", { class: "select-option" }, option))))));
1212
4376
  }
1213
- return (h("select", { id: fieldName, name: fieldName, class: "form-input", required: field.required }, h("option", { value: "" }, "-- Select --"), (_b = field.options) === null || _b === void 0 ? void 0 :
1214
- _b.map(option => (h("option", { value: option, selected: value === option }, option)))));
4377
+ return (h$1("select", { id: fieldName, name: fieldName, class: "form-input", required: field.required }, h$1("option", { value: "" }, "-- Select --"), (_d = field.options) === null || _d === void 0 ? void 0 :
4378
+ _d.map(option => (h$1("option", { value: option, selected: value === option }, option)))));
1215
4379
  case 'boolean':
1216
- return (h("input", Object.assign({}, commonProps, { type: "checkbox", class: "form-checkbox", checked: value === true || value === 'true' })));
4380
+ return (h$1("input", Object.assign({}, commonProps, { type: "checkbox", class: "form-checkbox", checked: value === true || value === 'true' })));
1217
4381
  case 'number':
1218
- return (h("input", Object.assign({}, commonProps, { type: "number", min: field.min, max: field.max, step: "any", value: value || '' })));
4382
+ return (h$1("input", Object.assign({}, commonProps, { type: "number", min: field.min, max: field.max, step: "any", value: value || '' })));
1219
4383
  case 'date':
1220
- return (h("input", Object.assign({}, commonProps, { type: 'date', value: value ? (([d, m, y]) => `${y}-${m}-${d}`)(value.split("/")) : '' })));
4384
+ return (h$1("input", Object.assign({}, commonProps, { type: 'date', value: value ? (([d, m, y]) => `${y}-${m}-${d}`)(value.split("/")) : '' })));
1221
4385
  case 'datetime':
1222
- return (h("input", Object.assign({}, commonProps, { type: 'datetime-local', value: value || '' })));
4386
+ return (h$1("input", Object.assign({}, commonProps, { type: 'datetime-local', value: value || '' })));
1223
4387
  default: // string
1224
- return (h("input", Object.assign({}, commonProps, { type: "text", pattern: field.pattern, placeholder: field.description, value: value || '' })));
4388
+ return (h$1("input", Object.assign({}, commonProps, { type: "text", pattern: field.pattern, placeholder: field.description, value: value || '' })));
1225
4389
  }
1226
4390
  }
1227
4391
  renderDebugPanel() {
1228
4392
  if (!this.debug)
1229
4393
  return null;
1230
- return (h("div", { class: "debug-panel" }, h("div", { class: "debug-title" }, "Debug Information:"), h("div", { class: "debug-content" }, JSON.stringify(this.debugInfo, null, 2))));
4394
+ return (h$1("div", { class: "debug-panel" }, h$1("div", { class: "debug-title" }, "Debug Information:"), h$1("div", { class: "debug-content" }, JSON.stringify(this.debugInfo, null, 2))));
1231
4395
  }
1232
4396
  render() {
1233
- return (h("div", { key: '40d850c62945b71d22c1fcb6181c9e8aba0f2a05' }, h("div", { key: 'da8aa5b7f122471a8d4d49662d418bd925f1d84c', class: "voice-recorder-container" + (this.debug || this.renderForm ? "-debug" : "") }, this.renderRecordButton(), this.displayStatus ? this.renderStatusMessage() : "", this.renderUploadButton(), this.renderForm ? this.renderFormPreview() : "", this.debug ? this.renderDebugPanel() : "")));
4397
+ return (h$1("div", { key: '2eddc02481849fda4e6d9e245d4c3c668938b84c' }, h$1("div", { key: 'eb1bc3cfcf0a19c54f5b2ab1ce488fa289a0dc68', class: "voice-recorder-container" + (this.debug || this.renderForm ? "-debug" : "") }, h$1("div", { key: 'b93900dce4b0de5d830f4f8517d4e56dc746efbb', class: "row-audio-area" }, this.renderRecordButton(), this.renderUploadRecordButton()), this.displayStatus ? this.renderStatusMessage() : "", this.renderUploadButton(), this.renderForm ? this.renderFormPreview() : "", this.debug ? this.renderDebugPanel() : "")));
1234
4398
  }
1235
4399
  static get watchers() { return {
1236
4400
  "formJson": ["initializeServices"],
@@ -1244,7 +4408,7 @@ const VoiceFormRecorder = /*@__PURE__*/ proxyCustomElement(class VoiceFormRecord
1244
4408
  "context": [1],
1245
4409
  "classificationRootUrl": [1, "classification-root-url"],
1246
4410
  "language": [1],
1247
- "voiceOrOcr": [1, "voice-or-ocr"],
4411
+ "inputTypes": [1, "input-types"],
1248
4412
  "debug": [4],
1249
4413
  "renderForm": [4, "render-form"],
1250
4414
  "displayStatus": [4, "display-status"],
@@ -1268,14 +4432,14 @@ function defineCustomElement$1() {
1268
4432
  if (typeof customElements === "undefined") {
1269
4433
  return;
1270
4434
  }
1271
- const components = ["voice-input-module", "file-uploader"];
4435
+ const components = ["voice-input-module", "ocr-file-uploader"];
1272
4436
  components.forEach(tagName => { switch (tagName) {
1273
4437
  case "voice-input-module":
1274
4438
  if (!customElements.get(tagName)) {
1275
4439
  customElements.define(tagName, VoiceFormRecorder);
1276
4440
  }
1277
4441
  break;
1278
- case "file-uploader":
4442
+ case "ocr-file-uploader":
1279
4443
  if (!customElements.get(tagName)) {
1280
4444
  defineCustomElement$2();
1281
4445
  }