coer-elements 0.0.12 → 0.0.13

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. package/components/index.d.ts +12 -0
  2. package/components/lib/coer-button/coer-button.component.d.ts +3 -3
  3. package/components/lib/coer-checkbox/coer-checkbox.component.d.ts +28 -0
  4. package/components/lib/coer-filebox/coer-filebox.component.d.ts +33 -0
  5. package/components/lib/coer-form/coer-form.component.d.ts +33 -0
  6. package/components/lib/coer-grid/coer-grid.component.d.ts +53 -0
  7. package/components/lib/coer-grid/coer-grid.extension.d.ts +105 -0
  8. package/components/lib/coer-modal/coer-modal.component.d.ts +38 -0
  9. package/components/lib/coer-numberbox/coer-numberbox.component.d.ts +56 -0
  10. package/components/lib/coer-page-title/coer-page-title.component.d.ts +12 -0
  11. package/components/lib/coer-selectbox/coer-selectbox.component.d.ts +75 -0
  12. package/components/lib/coer-switch/coer-switch.component.d.ts +31 -0
  13. package/components/lib/coer-tab/coer-tab.component.d.ts +35 -0
  14. package/components/lib/coer-textarea/coer-textarea.component.d.ts +51 -0
  15. package/components/lib/coer-textbox/coer-textbox.component.d.ts +57 -0
  16. package/components/lib/components.module.d.ts +24 -5
  17. package/directives/index.d.ts +3 -0
  18. package/directives/lib/coer-ref.directive.d.ts +14 -0
  19. package/directives/lib/directives.module.d.ts +8 -0
  20. package/directives/lib/life-cycle.directive.d.ts +14 -0
  21. package/esm2022/components/index.mjs +13 -1
  22. package/esm2022/components/lib/coer-button/coer-button.component.mjs +2 -2
  23. package/esm2022/components/lib/coer-checkbox/coer-checkbox.component.mjs +84 -0
  24. package/esm2022/components/lib/coer-filebox/coer-filebox.component.mjs +104 -0
  25. package/esm2022/components/lib/coer-form/coer-form.component.mjs +102 -0
  26. package/esm2022/components/lib/coer-grid/coer-grid.component.mjs +515 -0
  27. package/esm2022/components/lib/coer-grid/coer-grid.extension.mjs +412 -0
  28. package/esm2022/components/lib/coer-modal/coer-modal.component.mjs +108 -0
  29. package/esm2022/components/lib/coer-numberbox/coer-numberbox.component.mjs +260 -0
  30. package/esm2022/components/lib/coer-page-title/coer-page-title.component.mjs +44 -0
  31. package/esm2022/components/lib/coer-selectbox/coer-selectbox.component.mjs +339 -0
  32. package/esm2022/components/lib/coer-switch/coer-switch.component.mjs +94 -0
  33. package/esm2022/components/lib/coer-tab/coer-tab.component.mjs +116 -0
  34. package/esm2022/components/lib/coer-textarea/coer-textarea.component.mjs +157 -0
  35. package/esm2022/components/lib/coer-textbox/coer-textbox.component.mjs +196 -0
  36. package/esm2022/components/lib/components.module.mjs +93 -57
  37. package/esm2022/directives/index.mjs +4 -0
  38. package/esm2022/directives/lib/coer-ref.directive.mjs +23 -0
  39. package/esm2022/directives/lib/directives.module.mjs +25 -0
  40. package/esm2022/directives/lib/life-cycle.directive.mjs +29 -0
  41. package/esm2022/interfaces/coer-filebox/index.mjs +3 -0
  42. package/esm2022/interfaces/coer-grid/index.mjs +21 -0
  43. package/esm2022/interfaces/index.mjs +1 -3
  44. package/esm2022/interfaces/lib/coer-filebox/file-image.interface.mjs +2 -0
  45. package/esm2022/interfaces/lib/coer-filebox/file.interface.mjs +2 -0
  46. package/esm2022/interfaces/lib/coer-grid/grid-button-by-row.interface.mjs +2 -0
  47. package/esm2022/interfaces/lib/coer-grid/grid-checkbox.interface.mjs +2 -0
  48. package/esm2022/interfaces/lib/coer-grid/grid-coer-numberbox.interface.mjs +2 -0
  49. package/esm2022/interfaces/lib/coer-grid/grid-coer-selectbox.interface.mjs +2 -0
  50. package/esm2022/interfaces/lib/coer-grid/grid-coer-switch.interface.mjs +2 -0
  51. package/esm2022/interfaces/lib/coer-grid/grid-coer-textbox.interface.mjs +2 -0
  52. package/esm2022/interfaces/lib/coer-grid/grid-column.interface.mjs +2 -0
  53. package/esm2022/interfaces/lib/coer-grid/grid-data-source.interface.mjs +2 -0
  54. package/esm2022/interfaces/lib/coer-grid/grid-header-button.interface.mjs +2 -0
  55. package/esm2022/interfaces/lib/coer-grid/grid-header-export-button.interface.mjs +2 -0
  56. package/esm2022/interfaces/lib/coer-grid/grid-header.interface.mjs +2 -0
  57. package/esm2022/interfaces/lib/coer-grid/grid-import.interface.mjs +2 -0
  58. package/esm2022/interfaces/lib/coer-grid/grid-input-checkbox.interface.mjs +2 -0
  59. package/esm2022/interfaces/lib/coer-grid/grid-input-switch-change.interface.mjs +2 -0
  60. package/esm2022/interfaces/lib/coer-grid/grid-input-textbox.interface.mjs +2 -0
  61. package/esm2022/interfaces/lib/coer-grid/grid-item.interface.mjs +2 -0
  62. package/esm2022/interfaces/lib/coer-grid/grid-keyup-enter.interface.mjs +2 -0
  63. package/esm2022/interfaces/lib/coer-grid/grid-length.interface.mjs +2 -0
  64. package/esm2022/interfaces/lib/coer-grid/grid-search.interface.mjs +2 -0
  65. package/esm2022/interfaces/lib/coer-grid/grid-sort.interface.mjs +2 -0
  66. package/esm2022/interfaces/lib/menu/menu-option-selected.interface.mjs +2 -0
  67. package/esm2022/interfaces/lib/menu/menu.interface.mjs +2 -0
  68. package/esm2022/interfaces/lib/page-title/breadcrumb.interface.mjs +2 -0
  69. package/esm2022/interfaces/lib/page-title/go-back.interface.mjs +2 -0
  70. package/esm2022/interfaces/page-title/index.mjs +3 -0
  71. package/esm2022/pipes/index.mjs +5 -0
  72. package/esm2022/pipes/lib/html.pipe.mjs +18 -0
  73. package/esm2022/pipes/lib/no-image.pipe.mjs +23 -0
  74. package/esm2022/pipes/lib/numeric-format.pipe.mjs +15 -0
  75. package/esm2022/pipes/lib/pipes.module.mjs +31 -0
  76. package/esm2022/public_api.mjs +3 -1
  77. package/esm2022/signals/lib/breakpoint.signal.mjs +2 -2
  78. package/esm2022/signals/lib/is-loading.signal.mjs +2 -2
  79. package/esm2022/signals/lib/is-modal-open.signal.mjs +2 -2
  80. package/esm2022/tools/index.mjs +3 -2
  81. package/esm2022/tools/lib/breadcrumbs.class.mjs +2 -2
  82. package/esm2022/tools/lib/date-time.class.mjs +14 -7
  83. package/esm2022/tools/lib/files.class.mjs +2 -2
  84. package/esm2022/tools/lib/menu.class.mjs +23 -0
  85. package/esm2022/tools/lib/page.class.mjs +6 -6
  86. package/esm2022/tools/lib/screen.class.mjs +9 -1
  87. package/esm2022/tools/lib/source.class.mjs +3 -3
  88. package/esm2022/tools/lib/tools.mjs +220 -0
  89. package/fesm2022/coer-elements.mjs +3266 -603
  90. package/fesm2022/coer-elements.mjs.map +1 -1
  91. package/interfaces/coer-filebox/index.d.ts +2 -0
  92. package/interfaces/coer-grid/index.d.ts +20 -0
  93. package/interfaces/index.d.ts +0 -2
  94. package/interfaces/lib/coer-filebox/file-image.interface.d.ts +14 -0
  95. package/interfaces/lib/coer-filebox/file.interface.d.ts +5 -0
  96. package/interfaces/lib/coer-grid/grid-button-by-row.interface.d.ts +6 -0
  97. package/interfaces/lib/coer-grid/grid-checkbox.interface.d.ts +5 -0
  98. package/interfaces/lib/coer-grid/grid-coer-numberbox.interface.d.ts +12 -0
  99. package/interfaces/lib/coer-grid/grid-coer-selectbox.interface.d.ts +9 -0
  100. package/interfaces/lib/coer-grid/grid-coer-switch.interface.d.ts +6 -0
  101. package/interfaces/lib/coer-grid/grid-coer-textbox.interface.d.ts +11 -0
  102. package/interfaces/lib/coer-grid/grid-column.interface.d.ts +22 -0
  103. package/interfaces/lib/coer-grid/grid-data-source.interface.d.ts +6 -0
  104. package/interfaces/lib/coer-grid/grid-header-button.interface.d.ts +8 -0
  105. package/interfaces/lib/coer-grid/grid-header-export-button.interface.d.ts +10 -0
  106. package/interfaces/lib/coer-grid/grid-header.interface.d.ts +5 -0
  107. package/interfaces/lib/coer-grid/grid-import.interface.d.ts +4 -0
  108. package/interfaces/lib/coer-grid/grid-input-checkbox.interface.d.ts +5 -0
  109. package/interfaces/lib/coer-grid/grid-input-switch-change.interface.d.ts +5 -0
  110. package/interfaces/lib/coer-grid/grid-input-textbox.interface.d.ts +5 -0
  111. package/interfaces/lib/coer-grid/grid-item.interface.d.ts +5 -0
  112. package/interfaces/lib/coer-grid/grid-keyup-enter.interface.d.ts +6 -0
  113. package/interfaces/lib/coer-grid/grid-length.interface.d.ts +5 -0
  114. package/interfaces/lib/coer-grid/grid-search.interface.d.ts +4 -0
  115. package/interfaces/lib/coer-grid/grid-sort.interface.d.ts +5 -0
  116. package/interfaces/lib/menu/menu-option-selected.interface.d.ts +9 -0
  117. package/interfaces/lib/menu/menu.interface.d.ts +6 -0
  118. package/interfaces/page-title/index.d.ts +2 -0
  119. package/package.json +1 -1
  120. package/pipes/index.d.ts +4 -0
  121. package/pipes/lib/html.pipe.d.ts +10 -0
  122. package/pipes/lib/no-image.pipe.d.ts +7 -0
  123. package/pipes/lib/numeric-format.pipe.d.ts +7 -0
  124. package/pipes/lib/pipes.module.d.ts +9 -0
  125. package/public_api.d.ts +2 -0
  126. package/signals/lib/is-loading.signal.d.ts +1 -1
  127. package/signals/lib/is-modal-open.signal.d.ts +1 -1
  128. package/src/interfaces/coer-filebox/index.ts +2 -0
  129. package/src/interfaces/coer-grid/index.ts +20 -0
  130. package/src/interfaces/index.ts +1 -3
  131. package/src/interfaces/lib/coer-filebox/file-image.interface.ts +14 -0
  132. package/src/interfaces/lib/coer-filebox/file.interface.ts +5 -0
  133. package/src/interfaces/lib/coer-grid/grid-button-by-row.interface.ts +7 -0
  134. package/src/interfaces/lib/coer-grid/grid-checkbox.interface.ts +5 -0
  135. package/src/interfaces/lib/coer-grid/grid-coer-numberbox.interface.ts +12 -0
  136. package/src/interfaces/lib/coer-grid/grid-coer-selectbox.interface.ts +9 -0
  137. package/src/interfaces/lib/coer-grid/grid-coer-switch.interface.ts +6 -0
  138. package/src/interfaces/lib/coer-grid/grid-coer-textbox.interface.ts +11 -0
  139. package/src/interfaces/lib/coer-grid/grid-column.interface.ts +23 -0
  140. package/src/interfaces/lib/coer-grid/grid-data-source.interface.ts +6 -0
  141. package/src/interfaces/lib/coer-grid/grid-header-button.interface.ts +8 -0
  142. package/src/interfaces/lib/coer-grid/grid-header-export-button.interface.ts +10 -0
  143. package/src/interfaces/lib/coer-grid/grid-header.interface.ts +5 -0
  144. package/src/interfaces/lib/coer-grid/grid-import.interface.ts +4 -0
  145. package/src/interfaces/lib/coer-grid/grid-input-checkbox.interface.ts +5 -0
  146. package/src/interfaces/lib/coer-grid/grid-input-switch-change.interface.ts +5 -0
  147. package/src/interfaces/lib/coer-grid/grid-input-textbox.interface.ts +5 -0
  148. package/src/interfaces/lib/coer-grid/grid-item.interface.ts +5 -0
  149. package/src/interfaces/lib/coer-grid/grid-keyup-enter.interface.ts +6 -0
  150. package/src/interfaces/lib/coer-grid/grid-length.interface.ts +5 -0
  151. package/src/interfaces/lib/coer-grid/grid-search.interface.ts +4 -0
  152. package/src/interfaces/lib/coer-grid/grid-sort.interface.ts +5 -0
  153. package/src/interfaces/lib/menu/menu-option-selected.interface.ts +10 -0
  154. package/src/interfaces/lib/menu/menu-selected.interface.ts +11 -0
  155. package/src/interfaces/lib/menu/menu.interface.ts +6 -0
  156. package/src/interfaces/menu/index.ts +3 -0
  157. package/src/interfaces/page-title/index.ts +2 -0
  158. package/tools/index.d.ts +2 -1
  159. package/tools/lib/breadcrumbs.class.d.ts +1 -1
  160. package/tools/lib/date-time.class.d.ts +4 -2
  161. package/tools/lib/menu.class.d.ts +8 -0
  162. package/tools/lib/page.class.d.ts +4 -3
  163. package/tools/lib/screen.class.d.ts +3 -1
  164. package/tools/lib/source.class.d.ts +1 -1
  165. package/tools/lib/{generi-tools.d.ts → tools.d.ts} +7 -5
  166. package/esm2022/interfaces/lib/breadcrumb.interface.mjs +0 -2
  167. package/esm2022/interfaces/lib/go-back.interface.mjs +0 -2
  168. package/esm2022/tools/lib/generi-tools.mjs +0 -199
  169. /package/interfaces/lib/{breadcrumb.interface.d.ts → page-title/breadcrumb.interface.d.ts} +0 -0
  170. /package/interfaces/lib/{go-back.interface.d.ts → page-title/go-back.interface.d.ts} +0 -0
  171. /package/src/interfaces/lib/{breadcrumb.interface.ts → page-title/breadcrumb.interface.ts} +0 -0
  172. /package/src/interfaces/lib/{go-back.interface.ts → page-title/go-back.interface.ts} +0 -0
  173. /package/src/styles/{coer-elements.scss → index.scss} +0 -0
@@ -0,0 +1,102 @@
1
+ import { Component, inject, input } from '@angular/core';
2
+ import { CoerAlert } from '../../lib/coer-alert/coer-alert.component';
3
+ import { Tools } from '../../../tools/lib/tools';
4
+ import * as i0 from "@angular/core";
5
+ import * as i1 from "@angular/forms";
6
+ export class CoerForm {
7
+ constructor() {
8
+ //Injection
9
+ this.alert = inject(CoerAlert);
10
+ this.formGroup = input.required();
11
+ this.isLoading = input(false);
12
+ this.isDisabled = input(false);
13
+ /** */
14
+ this.IsInvalidControl = (formControlName) => {
15
+ return Tools.IsNotNull(this.formGroup().get(formControlName))
16
+ ? (this.formGroup().get(formControlName).touched && this.formGroup().get(formControlName).invalid)
17
+ : true;
18
+ };
19
+ }
20
+ get _isDisabled() {
21
+ return this.isLoading() || this.isDisabled();
22
+ }
23
+ /** */
24
+ TouchForm() {
25
+ this.formGroup().markAllAsTouched();
26
+ }
27
+ /** */
28
+ SetControlValue(formControlName, value) {
29
+ if (Tools.IsNotNull(this.formGroup().get(formControlName))) {
30
+ this.formGroup().get(formControlName).setValue(value);
31
+ }
32
+ else {
33
+ this.alert.Warning(`${formControlName} Control`, 'Not Found');
34
+ }
35
+ }
36
+ /** */
37
+ GetControlValue(formControlName) {
38
+ return Tools.IsNotNull(this.formGroup().get(formControlName))
39
+ ? this.formGroup().get(formControlName).value
40
+ : null;
41
+ }
42
+ /** Get form value */
43
+ GetValue() {
44
+ return Tools.BreakReference(this.formGroup().value);
45
+ }
46
+ /** */
47
+ Reset(properties = null) {
48
+ if (Tools.IsNull(properties))
49
+ this.formGroup().reset();
50
+ else
51
+ this.formGroup().reset(properties);
52
+ }
53
+ /**
54
+ * Mark all controls as touched.
55
+ * If form is invalid emit a warning and focus first invalid control.
56
+ */
57
+ IsValid() {
58
+ this.TouchForm();
59
+ if (this.formGroup().invalid) {
60
+ this.alert.Warning('Please complete the required fields', 'Instructions', 'fa-solid fa-list-check');
61
+ this.Focus();
62
+ }
63
+ return {
64
+ isValid: this.formGroup().valid,
65
+ formValue: this.GetValue()
66
+ };
67
+ }
68
+ /** Focus the especified control or first invalid control */
69
+ Focus(formControl = null) {
70
+ const formControlCollection = new Map();
71
+ const formControlErrorCollection = new Map();
72
+ for (const property of Tools.GetObjectProperties(this.formGroup().controls)) {
73
+ formControlErrorCollection.set(property, this.formGroup().controls[property].errors);
74
+ const htmlElement = document.querySelector(`[formcontrolname='${property}'] input`);
75
+ if (Tools.IsNotNull(htmlElement))
76
+ formControlCollection.set(property, htmlElement);
77
+ }
78
+ if (formControlCollection.size > 0) {
79
+ if (Tools.IsNull(formControl)) {
80
+ for (const [property, error] of formControlErrorCollection) {
81
+ if (Tools.IsNotNull(error)) {
82
+ formControl = property;
83
+ break;
84
+ }
85
+ }
86
+ if (Tools.IsNull(formControl)) {
87
+ formControl = Array.from(formControlCollection.keys())[0];
88
+ }
89
+ }
90
+ const element = formControlCollection.get(formControl);
91
+ if (Tools.IsNotNull(element))
92
+ element.focus();
93
+ }
94
+ }
95
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerForm, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
96
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "17.3.12", type: CoerForm, selector: "coer-form", inputs: { formGroup: { classPropertyName: "formGroup", publicName: "formGroup", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null }, isDisabled: { classPropertyName: "isDisabled", publicName: "isDisabled", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<form [formGroup]=\"formGroup()\" autocomplete=\"off\" class=\"coer-form\">\r\n <fieldset [disabled]=\"_isDisabled\">\r\n <ng-content></ng-content>\r\n </fieldset>\r\n</form>", styles: [""], dependencies: [{ kind: "directive", type: i1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i1.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }] }); }
97
+ }
98
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.12", ngImport: i0, type: CoerForm, decorators: [{
99
+ type: Component,
100
+ args: [{ selector: 'coer-form', template: "<form [formGroup]=\"formGroup()\" autocomplete=\"off\" class=\"coer-form\">\r\n <fieldset [disabled]=\"_isDisabled\">\r\n <ng-content></ng-content>\r\n </fieldset>\r\n</form>" }]
101
+ }] });
102
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29lci1mb3JtLmNvbXBvbmVudC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL2NvZXItZWxlbWVudHMvc3JjL2NvbXBvbmVudHMvbGliL2NvZXItZm9ybS9jb2VyLWZvcm0uY29tcG9uZW50LnRzIiwiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvY29lci1lbGVtZW50cy9zcmMvY29tcG9uZW50cy9saWIvY29lci1mb3JtL2NvZXItZm9ybS5jb21wb25lbnQuaHRtbCJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFekQsT0FBTyxFQUFFLFNBQVMsRUFBRSxNQUFNLDJDQUEyQyxDQUFDO0FBQ3RFLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQzs7O0FBT2pELE1BQU0sT0FBTyxRQUFRO0lBTHJCO1FBT0ksV0FBVztRQ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XG4gICAgICAgIGlmKGZvcm1Db250cm9sQ29sbGVjdGlvbi5zaXplID4gMCkge1xyXG4gICAgICAgICAgICBpZihUb29scy5Jc051bGwoZm9ybUNvbnRyb2wpKSB7XHJcbiAgICAgICAgICAgICAgICBmb3IoY29uc3QgW3Byb3BlcnR5LCBlcnJvcl0gb2YgZm9ybUNvbnRyb2xFcnJvckNvbGxlY3Rpb24pIHtcclxuICAgICAgICAgICAgICAgICAgICBpZiAoVG9vbHMuSXNOb3ROdWxsKGVycm9yKSkge1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBmb3JtQ29udHJvbCA9IHByb3BlcnR5O1xyXG4gICAgICAgICAgICAgICAgICAgICAgICBicmVhaztcclxuICAgICAgICAgICAgICAgICAgICB9XHJcbiAgICAgICAgICAgICAgICB9XHJcblxyXG4gICAgICAgICAgICAgICAgaWYoVG9vbHMuSXNOdWxsKGZvcm1Db250cm9sKSkge1xyXG4gICAgICAgICAgICAgICAgICAgIGZvcm1Db250cm9sID0gQXJyYXkuZnJvbShmb3JtQ29udHJvbENvbGxlY3Rpb24ua2V5cygpKVswXTtcclxuICAgICAgICAgICAgICAgIH1cclxuICAgICAgICAgICAgfVxyXG5cclxuICAgICAgICAgICAgY29uc3QgZWxlbWVudDogYW55ID0gZm9ybUNvbnRyb2xDb2xsZWN0aW9uLmdldChmb3JtQ29udHJvbCEpO1xyXG4gICAgICAgICAgICBpZihUb29scy5Jc05vdE51bGwoZWxlbWVudCkpIGVsZW1lbnQuZm9jdXMoKTtcclxuICAgICAgICB9XHJcbiAgICB9XHJcbn0iLCI8Zm9ybSBbZm9ybUdyb3VwXT1cImZvcm1Hcm91cCgpXCIgYXV0b2NvbXBsZXRlPVwib2ZmXCIgY2xhc3M9XCJjb2VyLWZvcm1cIj5cclxuICAgIDxmaWVsZHNldCBbZGlzYWJsZWRdPVwiX2lzRGlzYWJsZWRcIj5cclxuICAgICAgICA8bmctY29udGVudD48L25nLWNvbnRlbnQ+XHJcbiAgICA8L2ZpZWxkc2V0PlxyXG48L2Zvcm0+Il19