@sankhyalabs/sankhyablocks 10.1.0-dev.6 → 10.1.0-dev.61

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 (590) hide show
  1. package/LICENSE +4 -1
  2. package/dist/cjs/{ConfigStorage-72f34bd4.js → ConfigStorage-156bfcac.js} +19 -2
  3. package/dist/cjs/ContinuousInsertUtils-1ae0c6ac.js +41 -0
  4. package/dist/cjs/{DataFetcher-991b0349.js → DataFetcher-d13b4637.js} +121 -69
  5. package/dist/cjs/{FormConfigHelper-e253a418.js → FormConfigHelper-28fe4668.js} +3 -1
  6. package/dist/cjs/FormConfigHelper-c5f5473a.js +342 -0
  7. package/dist/cjs/{ISave-ebf6b4ed.js → ISave-55d9dcc3.js} +1 -1
  8. package/dist/cjs/ImageUtils-d6139911.js +144 -0
  9. package/dist/cjs/{PersonalizedFilterUtils-7259cf65.js → PersonalizedFilterUtils-263e4d24.js} +65 -5
  10. package/dist/cjs/{SnkFormConfigManager-cdbb29d4.js → SnkFormConfigManager-5cb9a39c.js} +5 -5
  11. package/dist/cjs/{SnkMultiSelectionListDataSource-011bec79.js → SnkMultiSelectionListDataSource-5c5badfc.js} +146 -74
  12. package/dist/cjs/{auth-fetcher-c3cac878.js → auth-fetcher-d1715459.js} +1 -1
  13. package/dist/cjs/config-header.cjs.entry.js +1 -1
  14. package/dist/cjs/configs-button.cjs.entry.js +1 -1
  15. package/dist/cjs/css-shim-a27d231b.js +6 -0
  16. package/dist/cjs/{dataunit-fetcher-8bf469e7.js → dataunit-fetcher-fae710c5.js} +91 -110
  17. package/dist/cjs/dom-ff96a4bc.js +75 -0
  18. package/dist/cjs/field-config_2.cjs.entry.js +3 -3
  19. package/dist/cjs/fields-layout.cjs.entry.js +6 -6
  20. package/dist/cjs/fields-selector.cjs.entry.js +3 -3
  21. package/dist/cjs/{filter-type.enum-2bb46d2a.js → filter-type.enum-b3b388af.js} +7 -0
  22. package/dist/cjs/{form-config-fetcher-c7af90d8.js → form-config-fetcher-bbebdcb8.js} +41 -5
  23. package/dist/cjs/guides-configurator.cjs.entry.js +3 -3
  24. package/dist/cjs/{index-1cf293c1.js → index-1894343a.js} +1547 -207
  25. package/dist/cjs/{index-e3e39724.js → index-bc950921.js} +6 -0
  26. package/dist/cjs/{index-13d05f03.js → index-f0fe7e6e.js} +90 -21
  27. package/dist/cjs/loader.cjs.js +16 -2
  28. package/dist/cjs/pesquisa-grid_2.cjs.entry.js +6 -6
  29. package/dist/cjs/sankhyablocks.cjs.js +132 -4
  30. package/dist/cjs/shadow-css-7e3e0ab1.js +389 -0
  31. package/dist/cjs/snk-actions-button_9.cjs.entry.js +169 -120
  32. package/dist/cjs/snk-actions-form.cjs.entry.js +1 -1
  33. package/dist/cjs/snk-application.cjs.entry.js +28 -9
  34. package/dist/cjs/snk-attach_11.cjs.entry.js +2971 -0
  35. package/dist/cjs/snk-client-confirm.cjs.entry.js +1 -1
  36. package/dist/cjs/snk-configurator.cjs.entry.js +3 -1
  37. package/dist/cjs/snk-crud.cjs.entry.js +149 -102
  38. package/dist/cjs/snk-custom-slot-elements.cjs.entry.js +1 -1
  39. package/dist/cjs/snk-custom-slot-guide.cjs.entry.js +40 -0
  40. package/dist/cjs/snk-data-exporter.cjs.entry.js +62 -16
  41. package/dist/cjs/{snk-data-unit-7d587ad5.js → snk-data-unit-32237a2d.js} +12 -3
  42. package/dist/cjs/snk-data-unit.cjs.entry.js +4 -4
  43. package/dist/cjs/snk-detail-view.cjs.entry.js +32 -20
  44. package/dist/cjs/snk-dynaform-config-header_5.cjs.entry.js +739 -0
  45. package/dist/cjs/snk-dynaform-detail-view_2.cjs.entry.js +961 -0
  46. package/dist/cjs/snk-dynaform-field-config_2.cjs.entry.js +327 -0
  47. package/dist/cjs/snk-dynaform-guides-view-2c7c6ce4.js +1094 -0
  48. package/dist/cjs/snk-dynaform-guides-view.cjs.entry.js +23 -0
  49. package/dist/cjs/snk-dynaform.cjs.entry.js +679 -0
  50. package/dist/cjs/snk-entity-list.cjs.entry.js +1 -1
  51. package/dist/cjs/snk-entity-search.cjs.entry.js +211 -0
  52. package/dist/cjs/snk-exporter-email-sender.cjs.entry.js +2 -2
  53. package/dist/cjs/{snk-expression-group_2.cjs.entry.js → snk-expression-group_4.cjs.entry.js} +422 -19
  54. package/dist/cjs/snk-filter-bar_4.cjs.entry.js +175 -121
  55. package/dist/cjs/snk-filter-binary-select.cjs.entry.js +1 -1
  56. package/dist/cjs/snk-filter-checkbox-list.cjs.entry.js +1 -1
  57. package/dist/cjs/snk-filter-multi-select.cjs.entry.js +1 -1
  58. package/dist/cjs/snk-filter-number.cjs.entry.js +11 -7
  59. package/dist/cjs/snk-filter-period.cjs.entry.js +14 -7
  60. package/dist/cjs/snk-filter-search.cjs.entry.js +11 -1
  61. package/dist/cjs/snk-filter-text.cjs.entry.js +2 -2
  62. package/dist/cjs/snk-form-summary.cjs.entry.js +1 -1
  63. package/dist/cjs/snk-form-view.cjs.entry.js +70 -8
  64. package/dist/cjs/snk-form_2.cjs.entry.js +21 -11
  65. package/dist/cjs/snk-grid.cjs.entry.js +91 -36
  66. package/dist/cjs/{snk-guides-viewer-366d5c32.js → snk-guides-viewer-67b9cca9.js} +78 -214
  67. package/dist/cjs/snk-guides-viewer.cjs.entry.js +10 -18
  68. package/dist/cjs/snk-layout-form-config.cjs.entry.js +71 -0
  69. package/dist/cjs/snk-personalized-filter-editor.cjs.entry.js +1 -1
  70. package/dist/cjs/snk-pesquisa.cjs.entry.js +6 -7
  71. package/dist/cjs/snk-print-selector.cjs.entry.js +1 -1
  72. package/dist/cjs/snk-taskbar.cjs.entry.js +184 -127
  73. package/dist/cjs/{sortable.esm-9a110bb7.js → sortable.esm-b87669ab.js} +76 -90
  74. package/dist/cjs/taskbar-elements-25f800b3.js +152 -0
  75. package/dist/cjs/taskbarUtils-99aaa01f.js +236 -0
  76. package/dist/cjs/teste-pesquisa.cjs.entry.js +1 -1
  77. package/dist/collection/collection-manifest.json +26 -0
  78. package/dist/collection/components/snk-actions-button/actions/executor/launch-screen.executor.js +6 -3
  79. package/dist/collection/components/snk-actions-button/snk-actions-button.js +30 -6
  80. package/dist/collection/components/snk-application/errorhandler/snk-error-handler.js +1 -0
  81. package/dist/collection/components/snk-application/snk-application.js +20 -2
  82. package/dist/collection/components/snk-attach/snk-attach.css +29 -7
  83. package/dist/collection/components/snk-attach/snk-attach.js +93 -18
  84. package/dist/collection/components/snk-configurator/snk-configurator.js +2 -0
  85. package/dist/collection/components/snk-crud/snk-crud.css +55 -0
  86. package/dist/collection/components/snk-crud/snk-crud.js +169 -98
  87. package/dist/collection/components/snk-crud/subcomponents/GuideBuilder.js +1 -1
  88. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.css +4 -1
  89. package/dist/collection/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.js +21 -7
  90. package/dist/collection/components/snk-crud/subcomponents/snk-entity-search.css +17 -0
  91. package/dist/collection/components/snk-crud/subcomponents/snk-entity-search.js +330 -0
  92. package/dist/collection/components/snk-crud/subcomponents/snk-form-view.js +90 -8
  93. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.css +22 -8
  94. package/dist/collection/components/snk-crud/subcomponents/snk-guides-viewer.js +89 -204
  95. package/dist/collection/components/snk-crud/utils/taskbarUtils.js +163 -0
  96. package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.css +3 -0
  97. package/dist/collection/components/snk-custom-slot-guide/snk-custom-slot-guide.js +95 -0
  98. package/dist/collection/components/snk-data-exporter/exporter-email-sender/snk-exporter-email-sender.js +1 -1
  99. package/dist/collection/components/snk-data-exporter/exporter-strategy/ClientSideExporterStrategy.js +2 -2
  100. package/dist/collection/components/snk-data-exporter/interfaces/IExporterProvider.js +78 -23
  101. package/dist/collection/components/snk-data-exporter/snk-data-exporter.js +28 -5
  102. package/dist/collection/components/snk-data-exporter/structure/ItemBuilder.js +43 -2
  103. package/dist/collection/components/snk-data-unit/snk-data-unit.js +9 -0
  104. package/dist/collection/components/snk-dynaform/interfaces/PropsCustomEditor.js +1 -0
  105. package/dist/collection/components/snk-dynaform/interfaces/PropsCustomRender.js +1 -0
  106. package/dist/collection/components/snk-dynaform/snk-dynaform.css +69 -0
  107. package/dist/collection/components/snk-dynaform/snk-dynaform.js +1661 -0
  108. package/dist/collection/components/snk-dynaform/subcomponents/CardFormResizeObserver.js +26 -0
  109. package/dist/collection/components/snk-dynaform/subcomponents/GuideBuilder.js +51 -0
  110. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.css +182 -0
  111. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.js +1015 -0
  112. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.css +98 -0
  113. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.js +590 -0
  114. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-guides-view/snk-dynaform-guides-view.css +321 -0
  115. package/dist/collection/components/snk-dynaform/subcomponents/snk-dynaform-guides-view/snk-dynaform-guides-view.js +1587 -0
  116. package/dist/collection/components/snk-dynaform-form-config/FormConfigHelper.js +325 -0
  117. package/dist/collection/components/snk-dynaform-form-config/SnkFormConfigManager.js +219 -0
  118. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.css +17 -0
  119. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.js +236 -0
  120. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.css +41 -0
  121. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.js +170 -0
  122. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.css +22 -0
  123. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.js +408 -0
  124. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-item.css +88 -0
  125. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-item.js +209 -0
  126. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.css +167 -0
  127. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.js +655 -0
  128. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.css +42 -0
  129. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.js +171 -0
  130. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-form-config.css +66 -0
  131. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-form-config.js +557 -0
  132. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.css +80 -0
  133. package/dist/collection/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.js +326 -0
  134. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-number.js +12 -8
  135. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-period.js +14 -7
  136. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-search.js +30 -0
  137. package/dist/collection/components/snk-filter-bar/filter-item/editors/snk-filter-text.js +1 -1
  138. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-detail.js +10 -4
  139. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.css +5 -1
  140. package/dist/collection/components/snk-filter-bar/filter-item/snk-filter-item.js +28 -2
  141. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.css +7 -1
  142. package/dist/collection/components/snk-filter-bar/filter-modal/snk-filter-modal.js +27 -9
  143. package/dist/collection/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.js +33 -0
  144. package/dist/collection/components/snk-filter-bar/snk-filter-bar.css +1 -6
  145. package/dist/collection/components/snk-filter-bar/snk-filter-bar.js +166 -78
  146. package/dist/collection/components/snk-form-config/FormConfigHelper.js +3 -1
  147. package/dist/collection/components/snk-form-config/SnkFormConfigManager.js +3 -3
  148. package/dist/collection/components/snk-form-config/field-item/field-config/field-config.css +1 -0
  149. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.css +16 -0
  150. package/dist/collection/components/snk-form-config/fields-layout/fields-layout.js +4 -4
  151. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.css +3 -4
  152. package/dist/collection/components/snk-form-config/guides-configurator/guides-configurator.js +2 -2
  153. package/dist/collection/components/snk-form-config/snk-form-config.js +15 -5
  154. package/dist/collection/components/snk-grid/snk-grid.css +33 -5
  155. package/dist/collection/components/snk-grid/snk-grid.js +199 -24
  156. package/dist/collection/components/snk-grid-config/snk-grid-config.js +153 -51
  157. package/dist/collection/components/snk-image-input/snk-image-input.css +3 -0
  158. package/dist/collection/components/snk-image-input/snk-image-input.js +338 -0
  159. package/dist/collection/components/snk-image-input/utils/ImageUtils.js +135 -0
  160. package/dist/collection/components/snk-layout-form-config/snk-layout-form-config.js +1 -1
  161. package/dist/collection/components/snk-layout-form-config/snk-view-representation/snk-view-representation.js +1 -1
  162. package/dist/collection/components/snk-personalized-filter/snk-personalized-filter.js +1 -1
  163. package/dist/collection/components/snk-personalized-filter/subcomponents/snk-filter-param-config/utils/PersonalizedFilterUtils.js +13 -0
  164. package/dist/collection/components/snk-pesquisa/snk-pesquisa.js +0 -4
  165. package/dist/collection/components/snk-simple-crud/snk-simple-crud.js +34 -22
  166. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.css +8 -0
  167. package/dist/collection/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.js +38 -2
  168. package/dist/collection/components/snk-taskbar/elements/taskbar-elements.js +54 -37
  169. package/dist/collection/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.js +27 -1
  170. package/dist/collection/components/snk-taskbar/processor/simple-taskbar-processor.js +55 -0
  171. package/dist/collection/components/snk-taskbar/snk-taskbar.css +44 -1
  172. package/dist/collection/components/snk-taskbar/snk-taskbar.js +248 -132
  173. package/dist/collection/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.css +12 -0
  174. package/dist/collection/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.js +19 -0
  175. package/dist/collection/lib/@types/index.js +6 -0
  176. package/dist/collection/lib/configs/ConfigStorage.js +5 -0
  177. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/DataUnitDataLoader.js +1 -1
  178. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.js +51 -4
  179. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.js +24 -2
  180. package/dist/collection/lib/http/data-fetcher/fetchers/data-unit/helpers/DataUnitDataLoaderHelper.js +15 -104
  181. package/dist/collection/lib/http/data-fetcher/fetchers/form-config-fetcher.js +22 -4
  182. package/dist/collection/lib/http/data-fetcher/fetchers/grid-config-fetcher.js +12 -0
  183. package/dist/collection/lib/http/data-fetcher/fetchers/resource-fetcher.js +18 -0
  184. package/dist/collection/lib/message/SnkMessageBuilder.js +11 -2
  185. package/dist/collection/lib/message/messageResourceEnUSUtils.js +2 -0
  186. package/dist/collection/lib/message/messageResourceEsESUtils.js +2 -0
  187. package/dist/collection/lib/message/messageResourcePtBRUtils.js +2 -0
  188. package/dist/collection/lib/message/resources/en-us/dataUnitDataLoaderHelper.msg.js +0 -13
  189. package/dist/collection/lib/message/resources/en-us/snk-crud.msg.js +13 -1
  190. package/dist/collection/lib/message/resources/en-us/snk-form.msg.js +1 -0
  191. package/dist/collection/lib/message/resources/en-us/snk-image-input.msg.js +11 -0
  192. package/dist/collection/lib/message/resources/en-us/snk-layout-form-config.msg.js +10 -2
  193. package/dist/collection/lib/message/resources/es-es/dataUnitDataLoaderHelper.msg.js +0 -13
  194. package/dist/collection/lib/message/resources/es-es/snk-crud.msg.js +13 -1
  195. package/dist/collection/lib/message/resources/es-es/snk-form.msg.js +1 -0
  196. package/dist/collection/lib/message/resources/es-es/snk-image-input.msg.js +11 -0
  197. package/dist/collection/lib/message/resources/es-es/snk-layout-form-config.msg.js +8 -0
  198. package/dist/collection/lib/message/resources/pt-br/dataUnitDataLoaderHelper.msg.js +0 -13
  199. package/dist/collection/lib/message/resources/pt-br/snk-configurator.msg.js +1 -1
  200. package/dist/collection/lib/message/resources/pt-br/snk-crud.msg.js +13 -1
  201. package/dist/collection/lib/message/resources/pt-br/snk-form.msg.js +1 -0
  202. package/dist/collection/lib/message/resources/pt-br/snk-image-input.msg.js +11 -0
  203. package/dist/collection/lib/message/resources/pt-br/snk-layout-form-config.msg.js +10 -2
  204. package/dist/collection/lib/utils/CrudUtils.js +7 -4
  205. package/dist/components/ConfigStorage.js +17 -0
  206. package/dist/components/ContinuousInsertUtils.js +86 -28
  207. package/dist/components/DataFetcher.js +3 -2731
  208. package/dist/components/ISave.js +6 -0
  209. package/dist/components/PersonalizedFilterUtils.js +13 -0
  210. package/dist/components/SnkFormConfigManager.js +3 -3
  211. package/dist/components/SnkMessageBuilder.js +2804 -0
  212. package/dist/components/dataunit-fetcher.js +91 -110
  213. package/dist/components/field-config2.js +4 -2
  214. package/dist/components/fields-layout2.js +4 -4
  215. package/dist/components/form-config-fetcher.js +40 -4
  216. package/dist/components/guides-configurator2.js +2 -2
  217. package/dist/components/index.d.ts +16 -0
  218. package/dist/components/index.js +16 -0
  219. package/dist/components/index2.js +90 -21
  220. package/dist/components/snk-actions-button2.js +15 -9
  221. package/dist/components/snk-application2.js +22 -2
  222. package/dist/components/snk-attach2.js +69 -27
  223. package/dist/components/snk-configurator2.js +2 -0
  224. package/dist/components/snk-crud.js +240 -176
  225. package/dist/components/snk-custom-slot-guide.d.ts +11 -0
  226. package/dist/components/snk-custom-slot-guide.js +55 -0
  227. package/dist/components/snk-data-exporter2.js +56 -9
  228. package/dist/components/snk-data-unit2.js +10 -1
  229. package/dist/components/snk-detail-view2.js +227 -318
  230. package/dist/components/snk-dynaform-config-header.d.ts +11 -0
  231. package/dist/components/snk-dynaform-config-header.js +6 -0
  232. package/dist/components/snk-dynaform-config-header2.js +103 -0
  233. package/dist/components/snk-dynaform-configs-button.d.ts +11 -0
  234. package/dist/components/snk-dynaform-configs-button.js +6 -0
  235. package/dist/components/snk-dynaform-configs-button2.js +76 -0
  236. package/dist/components/snk-dynaform-detail-view.d.ts +11 -0
  237. package/dist/components/snk-dynaform-detail-view.js +6 -0
  238. package/dist/components/snk-dynaform-detail-view2.js +2213 -0
  239. package/dist/components/snk-dynaform-field-config.d.ts +11 -0
  240. package/dist/components/snk-dynaform-field-config.js +6 -0
  241. package/dist/components/snk-dynaform-field-config2.js +605 -0
  242. package/dist/components/snk-dynaform-field-item.d.ts +11 -0
  243. package/dist/components/snk-dynaform-field-item.js +6 -0
  244. package/dist/components/snk-dynaform-field-item2.js +96 -0
  245. package/dist/components/snk-dynaform-fields-layout.d.ts +11 -0
  246. package/dist/components/snk-dynaform-fields-layout.js +6 -0
  247. package/dist/components/snk-dynaform-fields-layout2.js +428 -0
  248. package/dist/components/snk-dynaform-fields-selector.d.ts +11 -0
  249. package/dist/components/snk-dynaform-fields-selector.js +6 -0
  250. package/dist/components/snk-dynaform-fields-selector2.js +104 -0
  251. package/dist/components/snk-dynaform-form-config.d.ts +11 -0
  252. package/dist/components/snk-dynaform-form-config.js +6 -0
  253. package/dist/components/snk-dynaform-form-config2.js +430 -0
  254. package/dist/components/snk-dynaform-form-view.d.ts +11 -0
  255. package/dist/components/snk-dynaform-form-view.js +6 -0
  256. package/dist/components/snk-dynaform-form-view2.js +272 -0
  257. package/dist/components/snk-dynaform-guides-configurator.d.ts +11 -0
  258. package/dist/components/snk-dynaform-guides-configurator.js +6 -0
  259. package/dist/components/snk-dynaform-guides-configurator2.js +173 -0
  260. package/dist/components/snk-dynaform-guides-view.d.ts +11 -0
  261. package/dist/components/snk-dynaform-guides-view.js +6 -0
  262. package/dist/components/snk-dynaform.d.ts +11 -0
  263. package/dist/components/snk-dynaform.js +1007 -0
  264. package/dist/components/snk-entity-search.d.ts +11 -0
  265. package/dist/components/snk-entity-search.js +6 -0
  266. package/dist/components/snk-entity-search2.js +231 -0
  267. package/dist/components/snk-exporter-email-sender2.js +1 -1
  268. package/dist/components/snk-filter-bar2.js +116 -80
  269. package/dist/components/snk-filter-detail2.js +10 -4
  270. package/dist/components/snk-filter-item2.js +9 -3
  271. package/dist/components/snk-filter-modal-item2.js +15 -1
  272. package/dist/components/snk-filter-modal2.js +27 -10
  273. package/dist/components/snk-filter-number.js +11 -7
  274. package/dist/components/snk-filter-period.js +13 -6
  275. package/dist/components/snk-filter-search.js +12 -1
  276. package/dist/components/snk-filter-text.js +1 -1
  277. package/dist/components/snk-form-config2.js +15 -5
  278. package/dist/components/snk-form-view2.js +79 -10
  279. package/dist/components/snk-grid-config2.js +109 -50
  280. package/dist/components/snk-grid2.js +132 -65
  281. package/dist/components/snk-image-input.d.ts +11 -0
  282. package/dist/components/snk-image-input.js +6 -0
  283. package/dist/components/snk-image-input2.js +316 -0
  284. package/dist/components/snk-layout-form-config2.js +1 -1
  285. package/dist/components/snk-personalized-filter2.js +1 -1
  286. package/dist/components/snk-pesquisa2.js +0 -1
  287. package/dist/components/snk-simple-crud2.js +46 -45
  288. package/dist/components/snk-taskbar-skeleton.d.ts +11 -0
  289. package/dist/components/snk-taskbar-skeleton.js +6 -0
  290. package/dist/components/snk-taskbar-skeleton2.js +29 -0
  291. package/dist/components/snk-taskbar2.js +256 -176
  292. package/dist/components/snk-view-representation2.js +1 -1
  293. package/dist/components/sortable.esm.js +76 -90
  294. package/dist/components/taskbar-actions-button2.js +21 -2
  295. package/dist/components/taskbar-split-button2.js +10 -1
  296. package/dist/components/taskbarUtils.js +229 -0
  297. package/dist/esm/{ConfigStorage-22324b6b.js → ConfigStorage-0d1c0695.js} +19 -2
  298. package/dist/esm/ContinuousInsertUtils-bce77dc1.js +39 -0
  299. package/dist/esm/{DataFetcher-450828a0.js → DataFetcher-70de9419.js} +121 -49
  300. package/dist/esm/{FormConfigHelper-e89ca25c.js → FormConfigHelper-d09669f3.js} +3 -1
  301. package/dist/esm/FormConfigHelper-efc29480.js +328 -0
  302. package/dist/esm/{ISave-61153166.js → ISave-f5704813.js} +1 -1
  303. package/dist/esm/ImageUtils-efbea0e4.js +138 -0
  304. package/dist/esm/{PersonalizedFilterUtils-2db38ff2.js → PersonalizedFilterUtils-45b5803c.js} +62 -2
  305. package/dist/esm/{SnkFormConfigManager-b5a92e12.js → SnkFormConfigManager-e7f05f79.js} +5 -5
  306. package/dist/esm/{SnkMultiSelectionListDataSource-d7ce2e54.js → SnkMultiSelectionListDataSource-6ac291a9.js} +141 -69
  307. package/dist/esm/{auth-fetcher-eef9d01e.js → auth-fetcher-e34880e5.js} +1 -1
  308. package/dist/esm/config-header.entry.js +1 -1
  309. package/dist/esm/configs-button.entry.js +1 -1
  310. package/dist/esm/css-shim-9f2d321e.js +4 -0
  311. package/dist/esm/{dataunit-fetcher-da9596f6.js → dataunit-fetcher-d26e4a08.js} +91 -110
  312. package/dist/esm/dom-64053c71.js +73 -0
  313. package/dist/esm/field-config_2.entry.js +3 -3
  314. package/dist/esm/fields-layout.entry.js +6 -6
  315. package/dist/esm/fields-selector.entry.js +3 -3
  316. package/dist/esm/{filter-type.enum-f6a8fe23.js → filter-type.enum-62b7fe88.js} +8 -1
  317. package/dist/esm/{form-config-fetcher-8d0a5e1c.js → form-config-fetcher-98c42169.js} +41 -5
  318. package/dist/esm/guides-configurator.entry.js +3 -3
  319. package/dist/esm/{index-479e1293.js → index-04f73a26.js} +1539 -207
  320. package/dist/esm/{index-b40568ff.js → index-c6721886.js} +6 -0
  321. package/dist/esm/{index-446f9341.js → index-ea250be6.js} +90 -21
  322. package/dist/esm/loader.js +17 -3
  323. package/dist/esm/pesquisa-grid_2.entry.js +6 -6
  324. package/dist/esm/sankhyablocks.js +133 -5
  325. package/dist/esm/shadow-css-98135883.js +387 -0
  326. package/dist/esm/snk-actions-button_9.entry.js +170 -121
  327. package/dist/esm/snk-actions-form.entry.js +1 -1
  328. package/dist/esm/snk-application.entry.js +28 -9
  329. package/dist/esm/snk-attach_11.entry.js +2957 -0
  330. package/dist/esm/snk-client-confirm.entry.js +1 -1
  331. package/dist/esm/snk-configurator.entry.js +3 -1
  332. package/dist/esm/snk-crud.entry.js +149 -102
  333. package/dist/esm/snk-custom-slot-elements.entry.js +1 -1
  334. package/dist/esm/snk-custom-slot-guide.entry.js +36 -0
  335. package/dist/esm/snk-data-exporter.entry.js +62 -16
  336. package/dist/esm/{snk-data-unit-99616a07.js → snk-data-unit-ff57ac90.js} +12 -3
  337. package/dist/esm/snk-data-unit.entry.js +4 -4
  338. package/dist/esm/snk-detail-view.entry.js +32 -20
  339. package/dist/esm/snk-dynaform-config-header_5.entry.js +731 -0
  340. package/dist/esm/snk-dynaform-detail-view_2.entry.js +956 -0
  341. package/dist/esm/snk-dynaform-field-config_2.entry.js +322 -0
  342. package/dist/esm/snk-dynaform-guides-view-0dfbefc1.js +1091 -0
  343. package/dist/esm/snk-dynaform-guides-view.entry.js +15 -0
  344. package/dist/esm/snk-dynaform.entry.js +675 -0
  345. package/dist/esm/snk-entity-list.entry.js +1 -1
  346. package/dist/esm/snk-entity-search.entry.js +207 -0
  347. package/dist/esm/snk-exporter-email-sender.entry.js +2 -2
  348. package/dist/esm/{snk-expression-group_2.entry.js → snk-expression-group_4.entry.js} +407 -6
  349. package/dist/esm/snk-filter-bar_4.entry.js +153 -99
  350. package/dist/esm/snk-filter-binary-select.entry.js +1 -1
  351. package/dist/esm/snk-filter-checkbox-list.entry.js +1 -1
  352. package/dist/esm/snk-filter-multi-select.entry.js +1 -1
  353. package/dist/esm/snk-filter-number.entry.js +11 -7
  354. package/dist/esm/snk-filter-period.entry.js +14 -7
  355. package/dist/esm/snk-filter-search.entry.js +11 -1
  356. package/dist/esm/snk-filter-text.entry.js +2 -2
  357. package/dist/esm/snk-form-summary.entry.js +1 -1
  358. package/dist/esm/snk-form-view.entry.js +71 -9
  359. package/dist/esm/snk-form_2.entry.js +21 -11
  360. package/dist/esm/snk-grid.entry.js +89 -34
  361. package/dist/esm/{snk-guides-viewer-240de636.js → snk-guides-viewer-31a0a23d.js} +79 -215
  362. package/dist/esm/snk-guides-viewer.entry.js +10 -18
  363. package/dist/esm/snk-layout-form-config.entry.js +67 -0
  364. package/dist/esm/snk-personalized-filter-editor.entry.js +1 -1
  365. package/dist/esm/snk-pesquisa.entry.js +6 -7
  366. package/dist/esm/snk-print-selector.entry.js +1 -1
  367. package/dist/esm/snk-taskbar.entry.js +185 -128
  368. package/dist/esm/{sortable.esm-842f85a3.js → sortable.esm-bc277c12.js} +76 -90
  369. package/dist/esm/taskbar-elements-ba9d6889.js +149 -0
  370. package/dist/esm/taskbarUtils-cb9db0d9.js +230 -0
  371. package/dist/esm/teste-pesquisa.entry.js +1 -1
  372. package/dist/sankhyablocks/{p-840fb68c.js → p-097d75b3.js} +2 -2
  373. package/dist/sankhyablocks/{p-7f7fe6c4.entry.js → p-0a160fb5.entry.js} +1 -1
  374. package/dist/sankhyablocks/p-0dbd53d9.js +1 -0
  375. package/dist/sankhyablocks/p-12579574.entry.js +1 -0
  376. package/dist/sankhyablocks/p-129a4906.entry.js +1 -0
  377. package/dist/sankhyablocks/{p-162bddae.entry.js → p-175c9576.entry.js} +1 -1
  378. package/dist/sankhyablocks/p-19351985.entry.js +1 -0
  379. package/dist/sankhyablocks/p-1d31aec3.entry.js +1 -0
  380. package/dist/sankhyablocks/{p-cb4343c4.entry.js → p-1d7d5814.entry.js} +1 -1
  381. package/dist/sankhyablocks/p-24b059ee.entry.js +1 -0
  382. package/dist/sankhyablocks/{p-f5e942b7.entry.js → p-250b273e.entry.js} +1 -1
  383. package/dist/sankhyablocks/p-26f1919e.entry.js +1 -0
  384. package/dist/sankhyablocks/p-2c4f7fdd.entry.js +1 -0
  385. package/dist/sankhyablocks/p-2c9d0870.js +2 -0
  386. package/dist/sankhyablocks/{p-75af335e.entry.js → p-2ebda226.entry.js} +1 -1
  387. package/dist/sankhyablocks/p-2ec98523.js +1 -0
  388. package/dist/sankhyablocks/p-3a35917e.entry.js +1 -0
  389. package/dist/sankhyablocks/p-449dfe55.entry.js +1 -0
  390. package/dist/sankhyablocks/p-46d7e2de.js +1 -0
  391. package/dist/sankhyablocks/p-4dd574d6.js +1 -0
  392. package/dist/sankhyablocks/p-541c72ec.entry.js +1 -0
  393. package/dist/sankhyablocks/p-58709cf9.js +1 -0
  394. package/dist/sankhyablocks/{p-27482793.entry.js → p-5aae5c74.entry.js} +1 -1
  395. package/dist/sankhyablocks/p-5aeae67f.js +1 -0
  396. package/dist/sankhyablocks/p-5d50f59a.entry.js +1 -0
  397. package/dist/sankhyablocks/p-5ef0e9a8.entry.js +1 -0
  398. package/dist/sankhyablocks/p-6e0ec0e4.entry.js +1 -0
  399. package/dist/sankhyablocks/p-6f60df43.js +1 -0
  400. package/dist/sankhyablocks/{p-825098c1.entry.js → p-752c57f4.entry.js} +1 -1
  401. package/dist/sankhyablocks/{p-e258de96.entry.js → p-76729994.entry.js} +1 -1
  402. package/dist/sankhyablocks/{p-62e9b9b8.entry.js → p-846d8f79.entry.js} +1 -1
  403. package/dist/sankhyablocks/p-855ccf64.entry.js +1 -0
  404. package/dist/sankhyablocks/p-885262ce.entry.js +1 -0
  405. package/dist/sankhyablocks/{p-118c221e.js → p-8b4d6719.js} +1 -1
  406. package/dist/sankhyablocks/p-8d1ef77a.js +60 -0
  407. package/dist/sankhyablocks/{p-7d6f1285.js → p-8d81c8d3.js} +2 -2
  408. package/dist/sankhyablocks/{p-3d41f5a8.entry.js → p-8d946600.entry.js} +1 -1
  409. package/dist/sankhyablocks/p-8f5dd87d.entry.js +1 -0
  410. package/dist/sankhyablocks/p-90037547.js +1 -0
  411. package/dist/sankhyablocks/{p-96d45943.entry.js → p-90ae6c2e.entry.js} +1 -1
  412. package/dist/sankhyablocks/{p-0b9a42ad.entry.js → p-9742ea0e.entry.js} +1 -1
  413. package/dist/sankhyablocks/p-9e02a785.js +1 -0
  414. package/dist/sankhyablocks/{p-2fdac5e6.entry.js → p-9e109f5e.entry.js} +1 -1
  415. package/dist/sankhyablocks/p-9e7dc97d.entry.js +1 -0
  416. package/dist/sankhyablocks/p-a25ab2ff.entry.js +1 -0
  417. package/dist/sankhyablocks/p-a2a9f520.entry.js +1 -0
  418. package/dist/sankhyablocks/p-a46ac091.js +1 -0
  419. package/dist/sankhyablocks/p-a696bbcd.entry.js +1 -0
  420. package/dist/sankhyablocks/p-a73b6b00.js +1 -0
  421. package/dist/sankhyablocks/p-a9012341.entry.js +11 -0
  422. package/dist/sankhyablocks/p-abcb646d.js +1 -0
  423. package/dist/sankhyablocks/{p-180716b2.entry.js → p-ae326d06.entry.js} +1 -1
  424. package/dist/sankhyablocks/p-af673291.js +1 -0
  425. package/dist/sankhyablocks/p-b555ce38.entry.js +1 -0
  426. package/dist/sankhyablocks/p-bd2a845c.js +1 -0
  427. package/dist/sankhyablocks/p-c3ec6642.js +19 -0
  428. package/dist/sankhyablocks/p-c4b34e2b.entry.js +1 -0
  429. package/dist/sankhyablocks/{p-92cfc028.js → p-c9440c8a.js} +1 -1
  430. package/dist/sankhyablocks/p-ca3728c0.entry.js +1 -0
  431. package/dist/sankhyablocks/p-cbb8e351.js +7 -0
  432. package/dist/sankhyablocks/p-cd153f71.entry.js +1 -0
  433. package/dist/sankhyablocks/p-ce8ccd72.entry.js +1 -0
  434. package/dist/sankhyablocks/{p-4c763b10.entry.js → p-d657f71f.entry.js} +1 -1
  435. package/dist/sankhyablocks/p-da455c82.js +12 -0
  436. package/dist/sankhyablocks/p-e5a3711f.js +1 -0
  437. package/dist/sankhyablocks/{p-9a63f3f7.entry.js → p-e737fd5a.entry.js} +1 -1
  438. package/dist/sankhyablocks/p-eac48627.js +1 -0
  439. package/dist/sankhyablocks/p-ec7c87bb.js +28 -0
  440. package/dist/sankhyablocks/p-ee56dda6.entry.js +1 -0
  441. package/dist/sankhyablocks/{p-667cab42.entry.js → p-f152ef98.entry.js} +1 -1
  442. package/dist/sankhyablocks/{p-7e250432.entry.js → p-f7170e10.entry.js} +1 -1
  443. package/dist/sankhyablocks/{p-7345782c.entry.js → p-f921270b.entry.js} +1 -1
  444. package/dist/sankhyablocks/p-fb6e3c65.entry.js +1 -0
  445. package/dist/sankhyablocks/sankhyablocks.esm.js +1 -1
  446. package/dist/types/components/snk-actions-button/snk-actions-button.d.ts +4 -0
  447. package/dist/types/components/snk-application/snk-application.d.ts +1 -1
  448. package/dist/types/components/snk-attach/snk-attach.d.ts +22 -4
  449. package/dist/types/components/snk-crud/snk-crud.d.ts +33 -11
  450. package/dist/types/components/snk-crud/subcomponents/snk-detail-view/snk-detail-view.d.ts +3 -2
  451. package/dist/types/components/snk-crud/subcomponents/snk-entity-search.d.ts +62 -0
  452. package/dist/types/components/snk-crud/subcomponents/snk-form-view.d.ts +12 -0
  453. package/dist/types/components/snk-crud/subcomponents/snk-guides-viewer.d.ts +13 -25
  454. package/dist/types/components/snk-crud/utils/taskbarUtils.d.ts +13 -0
  455. package/dist/types/components/snk-custom-slot-guide/snk-custom-slot-guide.d.ts +16 -0
  456. package/dist/types/components/snk-data-exporter/interfaces/IExporterProvider.d.ts +8 -0
  457. package/dist/types/components/snk-data-exporter/snk-data-exporter.d.ts +4 -0
  458. package/dist/types/components/snk-data-exporter/structure/ItemBuilder.d.ts +16 -0
  459. package/dist/types/components/snk-data-unit/snk-data-unit.d.ts +1 -0
  460. package/dist/types/components/snk-dynaform/interfaces/PropsCustomEditor.d.ts +4 -0
  461. package/dist/types/components/snk-dynaform/interfaces/PropsCustomRender.d.ts +4 -0
  462. package/dist/types/components/snk-dynaform/subcomponents/CardFormResizeObserver.d.ts +1 -0
  463. package/dist/types/components/snk-dynaform/subcomponents/GuideBuilder.d.ts +14 -0
  464. package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-detail-view/snk-dynaform-detail-view.d.ts +169 -0
  465. package/dist/types/components/snk-dynaform/subcomponents/snk-dynaform-form-view/snk-dynaform-form-view.d.ts +108 -0
  466. package/dist/types/components/snk-dynaform-form-config/FormConfigHelper.d.ts +36 -0
  467. package/dist/types/components/snk-dynaform-form-config/SnkFormConfigManager.d.ts +35 -0
  468. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-config-header.d.ts +23 -0
  469. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-config-header/snk-dynaform-configs-button/snk-dynaform-configs-button.d.ts +19 -0
  470. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-field-item/snk-dynaform-field-config/snk-dynaform-field-config.d.ts +56 -0
  471. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-fields-layout/snk-dynaform-fields-layout.d.ts +74 -0
  472. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-fields-selector/snk-dynaform-fields-selector.d.ts +21 -0
  473. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-form-config.d.ts +95 -0
  474. package/dist/types/components/snk-dynaform-form-config/snk-dynaform-guides-configurator/snk-dynaform-guides-configurator.d.ts +35 -0
  475. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-number.d.ts +1 -1
  476. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-period.d.ts +1 -0
  477. package/dist/types/components/snk-filter-bar/filter-item/editors/snk-filter-search.d.ts +1 -0
  478. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-detail.d.ts +1 -1
  479. package/dist/types/components/snk-filter-bar/filter-item/snk-filter-item.d.ts +5 -1
  480. package/dist/types/components/snk-filter-bar/filter-modal/snk-filter-modal.d.ts +2 -1
  481. package/dist/types/components/snk-filter-bar/filter-modal/subcomponents/snk-filter-modal-item.d.ts +1 -0
  482. package/dist/types/components/snk-filter-bar/snk-filter-bar.d.ts +33 -16
  483. package/dist/types/components/snk-form-config/FormConfigHelper.d.ts +1 -1
  484. package/dist/types/components/snk-form-config/fields-layout/fields-layout.d.ts +2 -2
  485. package/dist/types/components/snk-form-config/guides-configurator/guides-configurator.d.ts +1 -1
  486. package/dist/types/components/snk-form-config/snk-form-config.d.ts +2 -1
  487. package/dist/types/components/snk-grid/snk-grid.d.ts +37 -1
  488. package/dist/types/components/snk-grid-config/snk-grid-config.d.ts +11 -0
  489. package/dist/types/components/snk-image-input/snk-image-input.d.ts +57 -0
  490. package/dist/types/components/snk-image-input/utils/ImageUtils.d.ts +15 -0
  491. package/dist/types/components/snk-personalized-filter/interfaces/IParameter.d.ts +1 -0
  492. package/dist/types/components/snk-pesquisa/snk-pesquisa.d.ts +0 -1
  493. package/dist/types/components/snk-simple-crud/snk-simple-crud.d.ts +4 -1
  494. package/dist/types/components/snk-taskbar/elements/taskbar-actions-button/taskbar-actions-button.d.ts +6 -0
  495. package/dist/types/components/snk-taskbar/elements/taskbar-elements.d.ts +29 -2
  496. package/dist/types/components/snk-taskbar/elements/taskbar-split-button/taskbar-split-button.d.ts +5 -0
  497. package/dist/types/components/snk-taskbar/processor/simple-taskbar-processor.d.ts +31 -0
  498. package/dist/types/components/snk-taskbar/snk-taskbar.d.ts +32 -21
  499. package/dist/types/components/snk-taskbar/subcomponents/snk-taskbar-skeleton.d.ts +3 -0
  500. package/dist/types/components.d.ts +2640 -1183
  501. package/dist/types/lib/@types/index.d.ts +6 -0
  502. package/dist/types/lib/configs/ConfigStorage.d.ts +1 -0
  503. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/cache/PreloadManager.d.ts +1 -0
  504. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/dataunit-fetcher.d.ts +2 -1
  505. package/dist/types/lib/http/data-fetcher/fetchers/data-unit/helpers/DataUnitDataLoaderHelper.d.ts +3 -1
  506. package/dist/types/lib/http/data-fetcher/fetchers/fetchDataExporter/interfaces/IFetchDataExporterParams.d.ts +2 -0
  507. package/dist/types/lib/http/data-fetcher/fetchers/form-config-fetcher.d.ts +1 -0
  508. package/dist/types/lib/http/data-fetcher/fetchers/grid-config-fetcher.d.ts +1 -0
  509. package/dist/types/lib/http/data-fetcher/fetchers/resource-fetcher.d.ts +1 -0
  510. package/dist/types/lib/message/resources/en-us/snk-image-input.msg.d.ts +1 -0
  511. package/dist/types/lib/message/resources/es-es/snk-image-input.msg.d.ts +1 -0
  512. package/dist/types/lib/message/resources/pt-br/snk-image-input.msg.d.ts +1 -0
  513. package/package.json +11 -8
  514. package/react/components.d.ts +16 -0
  515. package/react/components.js +16 -0
  516. package/react/components.js.map +1 -1
  517. package/dist/cjs/default-filters-a09bf82b.js +0 -8
  518. package/dist/cjs/index-62760a9c.js +0 -49
  519. package/dist/cjs/index-8d94b7e0.js +0 -7
  520. package/dist/cjs/snk-attach.cjs.entry.js +0 -910
  521. package/dist/cjs/snk-default-filter.cjs.entry.js +0 -77
  522. package/dist/cjs/snk-filter-advanced-mode_2.cjs.entry.js +0 -61
  523. package/dist/cjs/snk-filter-detail.cjs.entry.js +0 -198
  524. package/dist/cjs/snk-filter-field-search_2.cjs.entry.js +0 -408
  525. package/dist/cjs/snk-filter-modal-item.cjs.entry.js +0 -108
  526. package/dist/cjs/snk-personalized-filter.cjs.entry.js +0 -357
  527. package/dist/cjs/snk-simple-bar.cjs.entry.js +0 -45
  528. package/dist/cjs/snk-simple-crud.cjs.entry.js +0 -870
  529. package/dist/cjs/taskbar-elements-fb5d1e08.js +0 -132
  530. package/dist/cjs/taskbar-processor-2fba34a8.js +0 -53
  531. package/dist/esm/default-filters-50105e43.js +0 -8
  532. package/dist/esm/index-620ac460.js +0 -7
  533. package/dist/esm/index-8acbae97.js +0 -49
  534. package/dist/esm/snk-attach.entry.js +0 -906
  535. package/dist/esm/snk-default-filter.entry.js +0 -73
  536. package/dist/esm/snk-filter-advanced-mode_2.entry.js +0 -56
  537. package/dist/esm/snk-filter-detail.entry.js +0 -194
  538. package/dist/esm/snk-filter-field-search_2.entry.js +0 -403
  539. package/dist/esm/snk-filter-modal-item.entry.js +0 -104
  540. package/dist/esm/snk-personalized-filter.entry.js +0 -353
  541. package/dist/esm/snk-simple-bar.entry.js +0 -41
  542. package/dist/esm/snk-simple-crud.entry.js +0 -866
  543. package/dist/esm/taskbar-elements-faaf5d8f.js +0 -129
  544. package/dist/esm/taskbar-processor-3436124c.js +0 -51
  545. package/dist/sankhyablocks/p-002d4d2b.js +0 -1
  546. package/dist/sankhyablocks/p-093f58fa.entry.js +0 -1
  547. package/dist/sankhyablocks/p-0948dc0a.entry.js +0 -11
  548. package/dist/sankhyablocks/p-0f3698af.js +0 -1
  549. package/dist/sankhyablocks/p-1a0caadb.js +0 -1
  550. package/dist/sankhyablocks/p-1a9c5684.entry.js +0 -1
  551. package/dist/sankhyablocks/p-1d589380.entry.js +0 -1
  552. package/dist/sankhyablocks/p-21107f0d.entry.js +0 -1
  553. package/dist/sankhyablocks/p-28f50632.js +0 -1
  554. package/dist/sankhyablocks/p-39be771c.js +0 -1
  555. package/dist/sankhyablocks/p-3ed04f0d.entry.js +0 -1
  556. package/dist/sankhyablocks/p-471b34f4.entry.js +0 -1
  557. package/dist/sankhyablocks/p-4963dd2a.entry.js +0 -1
  558. package/dist/sankhyablocks/p-49ddc27a.entry.js +0 -1
  559. package/dist/sankhyablocks/p-51833248.js +0 -7
  560. package/dist/sankhyablocks/p-55798617.js +0 -1
  561. package/dist/sankhyablocks/p-55f6fef2.entry.js +0 -1
  562. package/dist/sankhyablocks/p-56f16390.entry.js +0 -1
  563. package/dist/sankhyablocks/p-58683e28.js +0 -60
  564. package/dist/sankhyablocks/p-5ea893c5.entry.js +0 -1
  565. package/dist/sankhyablocks/p-60dd1d27.entry.js +0 -1
  566. package/dist/sankhyablocks/p-62aef37a.js +0 -1
  567. package/dist/sankhyablocks/p-669bb869.entry.js +0 -1
  568. package/dist/sankhyablocks/p-6a4b21dd.js +0 -1
  569. package/dist/sankhyablocks/p-6ee2ca7a.entry.js +0 -1
  570. package/dist/sankhyablocks/p-7cac3870.entry.js +0 -1
  571. package/dist/sankhyablocks/p-84345e7a.js +0 -1
  572. package/dist/sankhyablocks/p-86e54841.entry.js +0 -1
  573. package/dist/sankhyablocks/p-88b337fe.entry.js +0 -1
  574. package/dist/sankhyablocks/p-91005a00.entry.js +0 -1
  575. package/dist/sankhyablocks/p-91a9abb6.entry.js +0 -1
  576. package/dist/sankhyablocks/p-988afe78.js +0 -1
  577. package/dist/sankhyablocks/p-ada013c0.entry.js +0 -1
  578. package/dist/sankhyablocks/p-b568c1d4.js +0 -1
  579. package/dist/sankhyablocks/p-b7e891cc.entry.js +0 -1
  580. package/dist/sankhyablocks/p-b987e15d.js +0 -1
  581. package/dist/sankhyablocks/p-c35fc941.js +0 -26
  582. package/dist/sankhyablocks/p-c3dbf441.entry.js +0 -1
  583. package/dist/sankhyablocks/p-c4fcf1fb.entry.js +0 -1
  584. package/dist/sankhyablocks/p-c98c79c3.entry.js +0 -1
  585. package/dist/sankhyablocks/p-cadf4846.entry.js +0 -1
  586. package/dist/sankhyablocks/p-d8d8169b.js +0 -2
  587. package/dist/sankhyablocks/p-e91c3c57.entry.js +0 -1
  588. package/dist/sankhyablocks/p-ea729922.entry.js +0 -1
  589. package/dist/sankhyablocks/p-ec5fbad8.js +0 -1
  590. package/dist/sankhyablocks/p-f4184ce7.js +0 -1
@@ -0,0 +1 @@
1
+ import{r as t,e as i,h as s,f as e,F as n,g as a}from"./p-2c9d0870.js";import{ApplicationContext as o,DataType as r,Action as l,UserInterface as h,StringUtils as d,DataUnitLoaderUtils as c,DataUnit as u,ElementIDUtils as v,ObjectUtils as m,KeyboardManager as f}from"@sankhyalabs/core";import{D as p,S as g}from"./p-4dd574d6.js";import{S as b}from"./p-097d75b3.js";import{P as k}from"./p-abcb646d.js";import{P as w,D as _,I as y}from"./p-8d1ef77a.js";import{F as C}from"./p-ff1990ad.js";import{F as z}from"./p-ec7c87bb.js";import{V as x,S as A}from"./p-9019a32f.js";import{A as S}from"./p-9e02a785.js";import{T as O}from"./p-2ec98523.js";import{A as F,F as I}from"./p-0dbd53d9.js";import{focusOnFieldSerch as E,SEARCH_FIELD_FULL_WIDTH as P,FormLayout as N,ApplicationUtils as T,CSSVarsUtils as L,buildFieldSearch as D}from"@sankhyalabs/ezui/dist/collection/utils";import{DataBinder as j}from"@sankhyalabs/ezui/dist/collection/utils/form";import{g as R,b as M,s as U,a as V,d as B}from"./p-af673291.js";import{P as K,a as G,D as $}from"./p-58709cf9.js";import{E as q}from"./p-1a68fb59.js";import{C as H,P as Q}from"./p-8d81c8d3.js";import{s as J}from"./p-a73b6b00.js";import{S as W,T as X,R as Y,a as Z,b as tt}from"./p-bd2a845c.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import{S as it}from"./p-c9440c8a.js";import{C as st}from"./p-e5a3711f.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-7dd49d15.js";import"./p-8f3f2306.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils/InMemoryFilterColumnDataSource";class et{constructor(t){this.dataUnitName=t}async save({dataUnit:t,record:i,updatingFields:s,operation:e}){var n,a;const o="INSERT"==e,r=o?s:i;if(!o&&(null==s?void 0:s.DESCRICAO)&&(null==s?void 0:s.DESCRICAO)!==(null==i?void 0:i.DESCRICAO))throw new Error(b.DESCRIPTION_CANNOT_BE_CHANGED);const l={anexo:{codata:o?null==s?void 0:s.REGISTER_KEY:null==i?void 0:i.CODATA,sequencia:(null==r?void 0:r.SEQUENCIA)||"0",tipo:(null==r?void 0:r.TIPO)||"N",descricao:null==r?void 0:r.DESCRICAO,arquivo:null===(a=null===(n=s.CAMINHO_ARQUIVO)||void 0===n?void 0:n[0])||void 0===a?void 0:a.name,ehInclusao:o?"S":"N",ehArquivoRepositorio:"N"}};return new Promise(((i,e)=>{p.get().callServiceBroker("Attach.save",JSON.stringify(l)).then((e=>{var n;return i([Object.assign(Object.assign(Object.assign({},e),s),{__owner__dataunit__name__:null!==(n=this.dataUnitName)&&void 0!==n?n:t})])})).catch((t=>e(t)))}))}async edit(t){throw new Error("Method not implemented.")}async delete(t){var i={anexo:{codata:t.CODATA,tipo:t.TIPO,descricao:t.DESCRICAO}};const s=await p.get().callServiceBroker("Attach.remove",JSON.stringify(i));return Promise.resolve(s)}async getDownloadKey(t){var i,s,e;if("S"==t.EHARQUIVOREPOSITORIO){const e={config:{path:t.ARQUIVO,tipoconteudo:t.TIPOCONTEUDO}},n=await p.get().callServiceBroker("RepositorioArquivoSP.abreArquivo",JSON.stringify(e));return Promise.resolve({chave:{valor:null===(s=null===(i=null==n?void 0:n.responseBody)||void 0===i?void 0:i.chave)||void 0===s?void 0:s.valor}})}const n={anexo:{codata:t.CODATA,codemp:t.CODEMP,sequencia:t.SEQUENCIA,tipo:t.TIPO,descricao:t.DESCRICAO,tipoConteudo:t.TIPOCONTEUDO}},a=await p.get().callServiceBroker("Attach.view",JSON.stringify(n));return(null==a?void 0:a.chaveAnexo)?Promise.resolve({chave:{valor:null===(e=null==a?void 0:a.chaveAnexo)||void 0===e?void 0:e.idChaveAnexo}}):Promise.reject(new Error("File not found."))}}const nt="AnexoSistemaSP.salvar",at="AnexoSistemaSP.excluir",ot="AnexoSistemaSP.baixar";class rt{constructor(t,i){var s;this.entityName=t,this.dataUnitName=i,this.validateFields=t=>{if(t.LINK&&t.NOMEARQUIVO)throw new Error(b.LINK_AND_FILE_AT_THE_SAME_TIME);if(!t.LINK&&!t.NOMEARQUIVO)throw new Error(b.ANY_LINK_OR_FILE_FILLED);if(!this._registerKey)throw new Error("Register key can not be null")},this.resourceID=window.resourceID||(null===(s=window.workspace)||void 0===s?void 0:s.resourceID)}set registerKey(t){this._registerKey=t}async save(t){var i,s;let{updatingFields:e}=t;e=Object.assign(Object.assign({},e),{NOMEARQUIVO:null===(i=e.NOMEARQUIVO)||void 0===i?void 0:i[0]});try{this.validateFields(e);const t=e.LINK?null:e.NOMEARQUIVO,i={serviceName:nt,requestBody:{params:{resourceID:this.resourceID,description:e.DESCRICAO,fileSelect:t?1:0,keySession:null===(s=null==t?void 0:t.properties)||void 0===s?void 0:s.fileNameTmp,nameAttach:null==t?void 0:t.name,link:e.LINK,nameEntity:this.entityName,pkEntity:this._registerKey,typeAcess:e.TIPOACESSO,typeApres:e.TIPOAPRES}}},n=await p.get().callServiceBroker(nt,JSON.stringify(i));return Promise.resolve([Object.assign(Object.assign(Object.assign({},n),e),{ARQUIVOOULINK:e.LINK?e.LINK:null==t?void 0:t.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}async edit(t){var i,s,e;let{updatingFields:n,record:a}=t;const o=t=>void 0!==n[t]?n[t]:a[t],r=o("NOMEARQUIVO"),l=null===(s=null===(i=n.NOMEARQUIVO)||void 0===i?void 0:i[0])||void 0===s?void 0:s.downloadURL;n=Object.assign(Object.assign({},n),{DESCRICAO:o("DESCRICAO"),LINK:o("LINK"),TIPOACESSO:o("TIPOACESSO"),TIPOAPRES:o("TIPOAPRES"),CHAVEARQUIVO:a.CHAVEARQUIVO,NOMEARQUIVO:null==r?void 0:r[0]});const h=n.LINK?null:n.NOMEARQUIVO;try{this.validateFields(n);const t={serviceName:nt,requestBody:{params:{resourceID:this.resourceID,nuAttach:null==a?void 0:a.NUATTACH,description:n.DESCRICAO,fileSelect:l?1:0,keySession:null===(e=null==h?void 0:h.properties)||void 0===e?void 0:e.fileNameTmp,keyAttach:n.CHAVEARQUIVO,nameAttach:null==h?void 0:h.name,link:n.LINK,nameEntity:this.entityName,pkEntity:this._registerKey,typeAcess:n.TIPOACESSO,typeApres:n.TIPOAPRES}}},i=await p.get().callServiceBroker(nt,JSON.stringify(t));return Promise.resolve([Object.assign(Object.assign(Object.assign({},i),n),{ARQUIVOOULINK:n.LINK?n.LINK:null==h?void 0:h.name,__owner__dataunit__name__:this.dataUnitName})])}catch(t){return Promise.reject(t)}}delete(t){var i;const s=(null===(i=t.NOMEARQUIVO)||void 0===i?void 0:i[0])||{},e={serviceName:at,requestBody:{paramsDelete:{keyAttach:t.CHAVEARQUIVO,nameAttach:null==s?void 0:s.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO}}};return new Promise(((t,i)=>{p.get().callServiceBroker(at,JSON.stringify(e)).then((i=>t(i))).catch((t=>i(t)))}))}getDownloadKey(t){var i;const s=(null===(i=t.NOMEARQUIVO)||void 0===i?void 0:i[0])||{},e={serviceName:ot,requestBody:{paramsDown:{nameAttach:null==s?void 0:s.name,nameEntity:t.NOMEINSTANCIA,nuAttach:t.NUATTACH,pkEntity:t.PKREGISTRO,keyAttach:t.CHAVEARQUIVO}}};return new Promise(((t,i)=>{p.get().callServiceBroker(ot,JSON.stringify(e)).then((i=>t(i))).catch((t=>i(t)))}))}}class lt{constructor(t,i){this.entityName=t,this.getMessage=i,this._application=o.getContextValue("__SNK__APPLICATION__")}initLoaders(t,i,s){this.loader||(this.loader=t.dataLoader),t.dataLoader=(t,i)=>this.dataLoader(t,i),t.saveLoader=(t,e)=>this.saveLoader(e,i).then((t=>(t.length&&s(),t))),t.removeLoader=(t,e)=>this.removeLoader(t,e,i).then((t=>(t.length&&s(),t)))}metadataLoader(t){throw new Error("Method not implemented.")}dataLoader(t,i){return new Promise((s=>{this.loader(t,i).then((t=>{const i=((null==t?void 0:t.records)||[]).map((t=>{let i;return t.LINK||(i=[{name:t.NOMEARQUIVO}]),Object.assign(Object.assign({},t),{ARQUIVOOULINK:t.LINK?t.LINK:t.NOMEARQUIVO,NOMEARQUIVO:i})}));s(Object.assign(Object.assign({},t),{records:i}))}))}))}saveLoader(t,i){return new Promise((s=>{var e;const n=Array.isArray(t)?t[0]:{};((null===(e=null==n?void 0:n.record)||void 0===e?void 0:e.NUATTACH)>=0?i.edit.bind(i):i.save.bind(i))(n).then((t=>{s(t)})).catch((t=>t.message===b.LINK_AND_FILE_AT_THE_SAME_TIME?(this._application.alert(this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.title"),this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.message")),s([])):t.message===b.ANY_LINK_OR_FILE_FILLED?(this._application.alert(this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.title"),this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.message")),s([])):t.message?(this._application.error(t.title||t.name,t.message),s([])):void s([])))}))}removeLoader(t,i,s){return new Promise((e=>{const{records:n}=t.getSelectionInfo(),a=n[0];s.delete(a).then((()=>(w.removeRecords(t,[a]),e(i))))}))}getFilters(t){return[{name:"AttachmentsByPK",expression:"this.PKREGISTRO = :PKREGISTRO",params:[{name:"PKREGISTRO",dataType:r.TEXT,value:`${t}_${this.entityName}`}]}]}getInterceptions(t,i,s){return new Promise((e=>i.type===l.EDITION_CANCELED?t.isDirty()?this._application.confirm(this.getMessage("snkAttach.cancelConfirmation.title"),this.getMessage("snkAttach.cancelConfirmation.message")).then((t=>t?(s.goToView(x.GRID),e(i)):e(void 0))):e(i):i.type===l.DATA_SAVED?(t.loadData(),e(i)):void e(i)))}}let ht;const dt=t=>(ht||(ht=new g),ht.getMessage(t)),ct={grid:{columns:[{name:"CODATA",orderIndex:0,width:0},{name:"DESCRICAO",orderIndex:1,width:0},{name:"ARQUIVO",orderIndex:2,width:0},{name:"DTALTER",orderIndex:3,width:0},{name:"USUARIO",orderIndex:4,width:0}]},form:{emptyConfig:!1,fields:[{name:"DESCRICAO",label:dt("snkAttach.attachMetadata.lblDescription"),visible:!0,readOnly:!1,required:!0},{name:"CAMINHO_ARQUIVO",label:dt("snkAttach.attachMetadata.lblFile"),visible:!0,readOnly:!1,required:!0}]}},ut={name:"Attach",label:"Attach List",fields:[{name:"CODATA",label:dt("snkAttach.attachMetadata.lblCode"),dataType:r.TEXT},{name:"DESCRICAO",label:dt("snkAttach.attachMetadata.lblDescription"),dataType:r.TEXT,readOnly:!1},{name:"ARQUIVO",label:dt("snkAttach.attachMetadata.lblFileOrLink"),dataType:r.TEXT},{name:"USUARIO",label:dt("snkAttach.attachMetadata.lblUser"),dataType:r.TEXT},{name:"DTALTER",label:dt("snkAttach.attachMetadata.lblDate"),dataType:r.TEXT},{name:"CAMINHO_ARQUIVO",label:dt("snkAttach.attachMetadata.lblFileUpload"),dataType:r.OBJECT,userInterface:h.FILE,readOnly:!1,required:!0,visible:!0,properties:{subTitle:dt("snkAttach.attachMetadata.lblSubTitle"),MAX_FILES:1,STORAGESTRATEGY:"SESSION",INTERNAL_FILENAME:"Attach.upload"}}]};class vt{constructor(t){this.getMessage=t,this._records=[],this._application=o.getContextValue("__SNK__APPLICATION__")}initLoaders(t,i,s){t.metadataLoader=t=>this.metadataLoader(t),t.dataLoader=(t,i)=>this.dataLoader(t,i),t.saveLoader=(t,e)=>this.saveLoader(e,i).then((t=>(t.length&&s(),t))),t.removeLoader=(t,e)=>this.removeLoader(t,e,i).then((t=>(t.length&&s(),t)))}metadataLoader(t){return Promise.resolve(ut)}async dataLoader(t,i){if(!i.source)return Promise.resolve({records:this._records});if(!Number.isNaN(Number(i.source))){const t={criteria:{codata:i.source,tipoAnexo:"N"}},s=await this._application.getDataFetcher(),{anexos:{anexo:e=[]}}=await s.callServiceBroker("Attach.load",JSON.stringify(t)),n=[];e.forEach((t=>{n.push(Object.assign({__record__id__:d.generateUUID(),CAMINHO_ARQUIVO:[{name:null==t?void 0:t.ARQUIVO}]},t))})),this._records=n}return c.buildLoadDataResponse(this._records,t,i)}saveLoader(t,i){return new Promise((s=>{const e=Array.isArray(t)?t[0]:{};i.save(e).then(s).catch((t=>t.message===b.DESCRIPTION_CANNOT_BE_CHANGED?(this._application.alert(this.getMessage("snkAttach.alertValidation.descriptionCannotBeChanged.title"),this.getMessage("snkAttach.alertValidation.descriptionCannotBeChanged.message")),s([])):t.message===b.LINK_AND_FILE_AT_THE_SAME_TIME?(this._application.alert(this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.title"),this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.message")),s([])):t.message===b.ANY_LINK_OR_FILE_FILLED?(this._application.alert(this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.title"),this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.message")),s([])):t.message?(this._application.error(t.title||t.name,t.message),s([])):void s([])))}))}removeLoader(t,i,s){return new Promise((e=>{t.getSelectionInfo().records.forEach((async t=>{this._application.hasAccess(S.REMOVE).then((async n=>{n&&(await s.delete(t),e(i))}))}))}))}getFilters(){throw new Error("Method not implemented.")}getInterceptions(t,i,s){return new Promise((e=>{var n,a,o,r,h,d;switch(i.type){case l.EDITION_CANCELED:return t.isDirty()?this._application.confirm(this.getMessage("snkAttach.cancelConfirmation.title"),this.getMessage("snkAttach.cancelConfirmation.message")).then((t=>t?(s.goToView(x.GRID),e(i)):e(void 0))):e(i);case l.DATA_SAVED:return t.loadData(void 0,void 0,!1,null===(o=null===(a=null===(n=null==i?void 0:i.payload)||void 0===n?void 0:n.records)||void 0===a?void 0:a[0])||void 0===o?void 0:o.REGISTER_KEY),e(i);case l.RECORDS_REMOVED:return t.loadData(void 0,void 0,!1,null===(d=null===(h=null===(r=null==i?void 0:i.payload)||void 0===r?void 0:r.cachedRecords)||void 0===h?void 0:h[0])||void 0===d?void 0:d.CODATA),e(i)}e(i)}))}}let mt;const ft=t=>{var i;if(!mt){const t=o.getContextValue("__SNK__APPLICATION__");mt=null==t?void 0:t.messagesBuilder}return null===(i=null==mt?void 0:mt.getMessage)||void 0===i?void 0:i.call(mt,t,null)},pt={DOWNLOAD:{hint:ft("snkAttach.taskbar.titleDownload"),name:"DOWNLOAD",iconName:"file-download"},LINK:{hint:ft("snkAttach.taskbar.titleLink"),name:"LINK",iconName:"launch"}},gt=()=>{const t=[O.REMOVE,"DOWNLOAD","LINK"];return{getButtons:(t,i,s)=>{const e=s.indexOf(O.REFRESH);if((null==i?void 0:i.insertionMode)||(null==i?void 0:i.isDirty))return s.reverse();-1!==e&&s.splice(e,1);const{selectedRecord:n}=i||{},a=(null==n?void 0:n.LINK)?pt.LINK:pt.DOWNLOAD;s.splice(s.indexOf(O.DIVIDER)+1,0,O.REMOVE,a,O.DIVIDER);const o=[O.CLONE,O.DATA_EXPORTER],r=Array.from(new Set(s.filter((t=>!o.includes(t)))));return r.splice(r.indexOf(a)+1,0,O.DIVIDER),r},isEnabled:(i,s,e)=>{const n=void 0!==(null==s?void 0:s.selectedRecord);return!(t.includes(e)&&!n)}}},bt={grid:{columns:[{name:"ARQUIVOOULINK",orderIndex:0,width:0},{name:"DESCRICAO",orderIndex:1,width:0},{name:"DHCAD",orderIndex:2,width:0},{name:"DHALTER",orderIndex:3,width:0},{name:"TIPOAPRES",orderIndex:4,width:0},{name:"TIPOACESSO",orderIndex:5,width:0},{name:"CODUSU",orderIndex:6,width:0},{name:"CODUSUALT",orderIndex:7,width:0}]},form:{emptyConfig:!1,fields:[{name:"DESCRICAO",required:!0},{name:"TIPOAPRES",required:!0},{name:"TIPOACESSO",required:!0},{name:"LINK"},{name:"NOMEARQUIVO"}]}},kt=class{constructor(s){t(this,s),this.ezClosePopup=i(this,"ezClosePopup",7),this.handleTaskbarClick=async({detail:t})=>{if(["DOWNLOAD","LINK"].includes(t))return this.downloadAttachment(this._currentDataUnit.getSelectedRecord());"Attach"===this.fetcherType&&["SAVE"].includes(t)&&this._currentDataUnit.isDirty()&&await this._currentDataUnit.setFieldValue("REGISTER_KEY",this.registerKey)},this.handleBack=()=>{this._currentDataUnit.cancelEdition().then((t=>{t&&this.close()}))},this.handleFinish=()=>{if(!this._currentDataUnit.isDirty())return this.close();this.validateAnexoSistema()&&this._currentDataUnit.saveData().then((()=>{this.showFinishedToast(),this.close()}))},this._isOpen=!1,this.gridLegacyConfigName=void 0,this.fetcherType=void 0,this.fetcher=void 0,this.dataUnit=void 0,this.dataUnitBuilder=void 0,this.registerKey=void 0,this.entityName=void 0,this.messagesBuilder=void 0,this._currentFetcher=void 0,this._currentDataUnit=void 0,this.crudConfig=void 0,this._appResourceID=void 0}async open(){this._isOpen=!0,this._currentDataUnit||await this.initAttach(),this._refPopup&&(this._refPopup.opened=!0),this.fetcherType||(this.fetcherType="AnexoSistema"),null==this._currentDataUnit&&this.loadAttachmentDataUnit()}async close(){this._isOpen=!1,this._refPopup&&(this._refPopup.opened=!1)}async registerKeyWatcher(t,i){var s;null==this._currentDataUnit&&this.loadAttachmentDataUnit(),i!==t&&(this._currentFetcher instanceof rt&&(this._currentFetcher.registerKey=t),await(null===(s=this._currentDataUnit)||void 0===s?void 0:s.loadData()))}getAnexoSistemaFetcherInstance(){var t;const i=new rt(this.entityName,null===(t=this._currentDataUnit)||void 0===t?void 0:t.name);return i.registerKey=this.registerKey,i}async initAttach(){var t,i,s,e,n;if(this.fetcherType||this.registerKey){if(this.fetcherType||(this.fetcherType="AnexoSistema"),this.returnToGridMode(),"AnexoSistema"===this.fetcherType)return this._currentFetcher=this.getAnexoSistemaFetcherInstance(),null===(t=this._currentDataUnitBuilder)||void 0===t||t.initLoaders(this._currentDataUnit,this._currentFetcher,this.returnToGridMode.bind(this)),void await(null===(i=this._currentDataUnit)||void 0===i?void 0:i.loadData());if("Attach"===this.fetcherType&&(null===(s=this.registerKey)||void 0===s?void 0:s.split("_").length)>1)return;await(null===(e=this._currentDataUnit)||void 0===e?void 0:e.loadMetadata()),await(null===(n=this._currentDataUnit)||void 0===n?void 0:n.loadData(void 0,void 0,!0,this.registerKey))}}getMessage(t,i){if(this.messagesBuilder)return this.messagesBuilder.getMessage(t,i)}showFinishedToast(){this._application.info(this.getMessage("snkAttach.finishedMessage"),{iconName:"check"})}downloadAttachment(t){if(!t)throw new Error(this.getMessage("snkAttach.alertValidation.noRecordSelected.message"));t.LINK?window.open(`${t.LINK}`):this._currentFetcher.getDownloadKey(t).then((({chave:i})=>{var s;let e=!1;(null===(s=null==t?void 0:t.ARQUIVO)||void 0===s?void 0:s.endsWith(".pdf"))||(e=!0),window.open(`/mge/visualizadorArquivos.mge?chaveArquivo=${i.valor}${e?"&forcarDownload=S":""}`)}))}returnToGridMode(){var t;null===(t=this._currentDataUnit)||void 0===t||t.clearSelection(),this._crudElement&&this._crudElement.goToView(x.GRID)}async loadAttachmentDataUnit(){try{switch(this.fetcherType){case"AnexoSistema":await this.loadAnexoSistema();break;case"Attach":await this.loadAttach();break;default:this._currentFetcher=this.fetcher,this._currentDataUnit=this.dataUnit,this._currentDataUnitBuilder=this.dataUnitBuilder}}catch(t){throw new Error("There was an error while creating the data unit")}}async loadAnexoSistema(){var t,i;let s;this._currentDataUnit=(new _).getDataUnit("AnexoSistema","br.com.sankhya.core.v3.anexoSistema"),this._currentFetcher=this.getAnexoSistemaFetcherInstance(),this._currentDataUnit.metadata||(await(null===(t=this._currentDataUnit)||void 0===t?void 0:t.loadMetadata()),this.crudConfig=this.entityName?{form:null==bt?void 0:bt.form}:Object.assign({},bt),s={grid:null==bt?void 0:bt.grid}),this.initDataUnitLoaders(),this._currentDataUnit.addFilterProvider({getFilter:()=>this._currentDataUnitBuilder.getFilters(this.registerKey)}),this._currentDataUnit.addInterceptor({interceptAction:t=>this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit,t,this._crudElement)}),await(null===(i=this._currentDataUnit)||void 0===i?void 0:i.loadData()),this.disableEditFieldsNotInForm(s)}async loadAttach(){var t,i;let s;this._currentFetcher=new et,this._currentDataUnit=new u(y.IN_MEMORY_DATA_UNIT_NAME),this._currentDataUnit.pageSize=150,this.initDataUnitLoaders(),this._currentDataUnit.addInterceptor({interceptAction:t=>{var i;return t.type===l.METADATA_LOADED&&(this.crudConfig=this.entityName?{form:null==ct?void 0:ct.form}:Object.assign({},ct),s={grid:null==ct?void 0:ct.grid},null===(i=this._crudElement)||void 0===i||i.updateConfig()),this._currentDataUnitBuilder.getInterceptions(this._currentDataUnit,t,this._crudElement)}}),this._currentDataUnit.metadata||(await(null===(t=this._currentDataUnit)||void 0===t?void 0:t.loadMetadata()),this.crudConfig=this.entityName?{form:null==ct?void 0:ct.form}:Object.assign({},ct),s={grid:null==ct?void 0:ct.grid},await(null===(i=this._currentDataUnit)||void 0===i?void 0:i.loadData(void 0,void 0,!0,this.registerKey)),this.disableEditFieldsNotInForm(s))}initDataUnitLoaders(){var t,i;"AnexoSistema"===this.fetcherType&&(this._currentFetcher=this.getAnexoSistemaFetcherInstance(),this._currentDataUnitBuilder=new lt(this.entityName,this.getMessage.bind(this)),null===(t=this._currentDataUnitBuilder)||void 0===t||t.initLoaders(this._currentDataUnit,this._currentFetcher,this.returnToGridMode.bind(this))),"Attach"===this.fetcherType&&(this._currentFetcher=new et,this._currentDataUnitBuilder=new vt(this.getMessage.bind(this)),null===(i=this._currentDataUnitBuilder)||void 0===i||i.initLoaders(this._currentDataUnit,this._currentFetcher,(async()=>{this.returnToGridMode(),await this._currentDataUnit.loadData(void 0,void 0,!0,this.registerKey)})))}disableEditFieldsNotInForm(t){var i,s,e,n,a;const o=(null===(s=null===(i=this._crudElement)||void 0===i?void 0:i.gridConfig)||void 0===s?void 0:s.columns)||(null===(e=null==t?void 0:t.grid)||void 0===e?void 0:e.columns)||(null===(a=null===(n=this.crudConfig)||void 0===n?void 0:n.grid)||void 0===a?void 0:a.columns);this.getGridLegacyConfigName()&&this._currentDataUnit.disableField("ARQUIVOOULINK"),null==o||o.forEach((t=>{var i,s;const e=t.name;(null===(s=null===(i=this.crudConfig)||void 0===i?void 0:i.form)||void 0===s?void 0:s.fields.some((t=>(null==t?void 0:t.name)===e)))||this._currentDataUnit.disableField(e)}))}validateAnexoSistema(){var t;if(this._currentFetcher instanceof rt)try{let i=this._currentDataUnit.getSelectedRecord();i=Object.assign(Object.assign({},i),{NOMEARQUIVO:null===(t=i.NOMEARQUIVO)||void 0===t?void 0:t[0]}),this._currentFetcher.validateFields(i)}catch(t){if(t.message===b.LINK_AND_FILE_AT_THE_SAME_TIME)return this._application.alert(this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.title"),this.getMessage("snkAttach.alertValidation.fileAndLinkAtTheSameTime.message")),!1;if(t.message===b.ANY_LINK_OR_FILE_FILLED)return this._application.alert(this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.title"),this.getMessage("snkAttach.alertValidation.anyLinkOrFileFilled.message")),!1}return!0}async componentWillLoad(){this._application=o.getContextValue("__SNK__APPLICATION__"),this._application&&(this._appResourceID=await this._application.getResourceID()),await this.initAttach()}async handleOnDataStateChange({detail:t}){"Attach"===this.fetcherType&&(t.insertionMode?this._currentDataUnit.enableField("DESCRICAO"):this._currentDataUnit.disableField("DESCRICAO"),await this._currentDataUnit.loadMetadata())}isScreenVariation(){var t;return!!(null===(t=this._appResourceID)||void 0===t?void 0:t.includes("__"))}getGridLegacyConfigName(){if(!this.isScreenVariation())return this.gridLegacyConfigName?this.gridLegacyConfigName:this.entityName?"GrdCfgHtml5:grdcfg.dynaform.anexo."+this.entityName:this.entityName}render(){var t,i;return s("ez-popup",{ref:t=>this._refPopup=t,size:"x-large",ezTitle:this.getMessage("snkAttach.title"),useHeader:!1,autoClose:!1,onEzClosePopup:()=>this.close()},this._isOpen&&this._currentDataUnit&&s("main",{class:"snk-attach__main"},s("header",{class:"snk-attach__header"},s("section",null,s("ez-button",{class:"ez-padding-right--medium",title:this.getMessage("snkSimpleBar.backTitle"),mode:"icon",iconName:"arrow_back",size:"medium",onClick:()=>this.handleBack()}),s("div",{class:"snk-attach__file-info"},s("span",{class:"ez-title--primary ez-text ez-text--large ez-text--bold"},this.getMessage("snkAttach.title")),s("span",{class:"ez-text ez-text--medium ez-text--secondary"},this.getMessage("snkAttach.description")))),s("ez-button",{class:"ez-button--primary",label:this.getMessage("snkAttach.finish"),onClick:this.handleFinish})),s("div",{class:"snk-attach__crud-section"},s("snk-simple-crud",{ref:t=>this._crudElement=t,dataUnit:this._currentDataUnit,taskbarManager:gt(),gridConfig:null===(t=this.crudConfig)||void 0===t?void 0:t.grid,formConfig:null===(i=this.crudConfig)||void 0===i?void 0:i.form,useCancelConfirm:!1,onActionClick:this.handleTaskbarClick,messagesBuilder:this.messagesBuilder,onDataStateChange:this.handleOnDataStateChange.bind(this),multipleSelection:!0,configName:this.isScreenVariation()?void 0:this.entityName?"AnexoSistema_"+this.entityName:void 0,ignoreReadOnlyFormFields:!!this.entityName,gridLegacyConfigName:this.getGridLegacyConfigName(),outlineMode:!0}))))}static get watchers(){return{registerKey:["registerKeyWatcher"]}}};kt.style=".snk-attach__header.sc-snk-attach{display:flex;justify-content:space-between;align-items:center;margin-bottom:var(--space--6, 6px)}.snk-attach__header.sc-snk-attach>section.sc-snk-attach{display:flex;align-items:center}.snk-attach__file-info.sc-snk-attach{display:flex;flex-direction:column;justify-content:center;gap:var(--space--8, 8px)}.snk-attach__main.sc-snk-attach{display:flex;flex-direction:column;height:100%}.ez-box__container.sc-snk-attach{height:100%}.snk-attach__crud-section.sc-snk-attach{padding:1px;display:flex;flex-direction:column;height:100%;width:100%}";const wt=class{constructor(s){t(this,s),this.actionSelected=i(this,"actionSelected",7),this.OFFSET_HEIGHT=5,this.getMessage=void 0,this.hasDefaultFilter=!1,this._opened=!1}repositionDropDown(){if(!this._refIcon||!this._refDropdown)return;const t=this._refIcon.getBoundingClientRect(),i=this._refDropdown.getBoundingClientRect();this._refDropdown.style.top=t.y+t.height+this.OFFSET_HEIGHT+"px",this._refDropdown.style.left=t.x+t.width/2-i.width+"px"}toggleDropdown(){this._opened=!this._opened}closeDropdown(t){const i=null==t?void 0:t.target;i&&(i.closest("#dropdown-parent-demo")||(this._opened=!1))}buildItems(){return[{id:F.EDIT,label:this.getMessage("defaultFilter.edit")},{id:F.REMOVE,label:this.getMessage("defaultFilter.remove")}]}onValueSelected({detail:t}){this._opened=!1,this.actionSelected.emit(t.id)}openCreateNewFilter(){this.actionSelected.emit(F.CREATE)}componentDidRender(){this.repositionDropDown()}componentWillLoad(){this._items=this.buildItems(),document.removeEventListener("scroll",this.repositionDropDown.bind(this)),document.addEventListener("scroll",this.repositionDropDown.bind(this))}render(){return this.hasDefaultFilter?s(e,null,s("button",{class:"default_container",onClick:this.toggleDropdown.bind(this)},s("span",null,this.getMessage("defaultFilter.title")),s("ez-icon",{ref:t=>this._refIcon=t,iconName:"dots-vertical"})),this._opened&&s("ez-dropdown",{ref:t=>this._refDropdown=t,items:this._items,onEzClick:this.onValueSelected.bind(this),onEzOutsideClick:this.closeDropdown.bind(this)})):s(e,null,s("button",{class:"default_container new_filter",onClick:this.openCreateNewFilter.bind(this)},s("span",null,this.getMessage("defaultFilter.create"))))}};wt.style=".sc-snk-default-filter-h{display:flex;justify-content:flex-end}.default_container.sc-snk-default-filter{border:none;background:none;display:flex;align-items:center;gap:var(--space--3xs, 4px);font-family:var(--font-pattern);color:var(--title--primary, #2b3a54);font-size:var(--text--medium, 14px);padding:0;outline:none}.default_container.sc-snk-default-filter ez-icon.sc-snk-default-filter{cursor:pointer}.default_container.sc-snk-default-filter ez-icon.sc-snk-default-filter:hover{color:var(--color--primary-600)}.new_filter.sc-snk-default-filter{cursor:pointer;margin:0 var(--space--3xs, 4px)}.new_filter.sc-snk-default-filter:hover{color:var(--color--primary-600)}";const _t=class{constructor(e){t(this,e),this.snkContentCardChanged=i(this,"snkContentCardChanged",7),this.snkRequestClearFieldToFocus=i(this,"snkRequestClearFieldToFocus",7),this._customEditors=new Map,this._fieldProps=new Map,this.dataUnitObserver=async t=>{var i;if(t.type===l.RECORDS_COPIED){const s=this.buildSourceRecordPK(t);null===(i=this.getImageField())||void 0===i||i.forEach((async t=>{var i;null===(i=this.dataUnit)||void 0===i||i.setFieldValue(t.name,JSON.stringify(s))}))}},this.customUiBuilders=new Map([[h.IMAGE,t=>{var{name:i}=t,e=function(t,i){var s={};for(var e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.indexOf(e)<0&&(s[e]=t[e]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(e=Object.getOwnPropertySymbols(t);n<e.length;n++)i.indexOf(e[n])<0&&Object.prototype.propertyIsEnumerable.call(t,e[n])&&(s[e[n]]=t[e[n]])}return s}(t,["name"]);return s("snk-image-input",Object.assign({dataUnit:this.dataUnit,maxSize:1/0,fieldName:i,entityName:this.entityPath},e))}]]),this._singleColumn=!1,this._currentFormLayout=void 0,this.fieldSearch=void 0,this.label=void 0,this.name=void 0,this.fields=void 0,this.formMetadata=void 0,this.dataUnit=void 0,this.recordsValidator=void 0,this.fieldToFocus=void 0,this.customEditors=void 0,this.fieldsProps=void 0,this.entityPath=void 0}async showUp(){var t,i;this._formView&&(null===(i=(t=this._formView).showUp)||void 0===i||i.call(t))}async addCustomEditor(t,i,s){var e,n;if(this._formView)return void(null===(n=(e=this._formView).addCustomEditor)||void 0===n||n.call(e,t,i,s));const a=new Map(this._customEditors);a.set(t,{customEditor:i,detailContext:null!=s?s:""}),this._customEditors=a}async setFieldProp(t,i,s){const e=this._fieldProps.get(t)||[];this._fieldProps.set(t,[...e,{propName:i,value:s}])}async showSearchField(){if(!this._headerContainer||!this._ezPopoverFieldColumn)return;const t=this._headerContainer.getBoundingClientRect();this.fieldSearch&&(await E(this.fieldSearch),this._ezPopoverFieldColumn.showUnder(this._headerContainer,{horizontalGap:t.width-P,verticalGap:-1*t.height}))}observePropsCustomEditor(t){for(const i in t)this.addCustomEditor(i,t[i])}async observeFieldsProps(t){for(const i in t){const s=t[i],e=Object.keys(s);for(const t of e)await this.setFieldProp(i,t,s[t])}}async observeDataUnit(t,i){t!==i&&t&&t.subscribe(this.dataUnitObserver)}bindFields(t){var i;null==this._dataBinder&&null!=this.dataUnit&&(this._dataBinder=new j(this.dataUnit)),this._dataBinder&&this.dataUnit&&this.formMetadata&&this._dataBinder.bind(t,null===(i=this.dataUnit)||void 0===i?void 0:i.dataUnitId,this.formMetadata,this.recordsValidator)}disconnectedCallback(){null!=this._dataBinder&&this._dataBinder.onDisconnectedCallback(),this.dataUnit&&this.dataUnit.unsubscribe(this.dataUnitObserver)}async componentWillLoad(){await this.initLayoutFormConfig()}componentDidLoad(){this.customEditors&&this.observePropsCustomEditor(this.customEditors),this.fieldsProps&&this.observeFieldsProps(this.fieldsProps)}async initLayoutFormConfig(){const t=o.getContextValue("__SNK__APPLICATION__"),i=await(null==t?void 0:t.getLayoutFormConfig());i&&(this.setSingleColumn(i),this.registerNotifyListeners(i))}setSingleColumn(t){this._singleColumn=(null==t?void 0:t.config)===N.CASCADE||(null==t?void 0:t.config)===N.CLASSIC_CASCADE,this._currentFormLayout=null==t?void 0:t.config}registerNotifyListeners(t){var i;t&&(null===(i=t.onConfigChange)||void 0===i||i.call(t,(t=>{this._singleColumn=t===N.CASCADE||t===N.CLASSIC_CASCADE,this._currentFormLayout=t})))}componentDidRender(){var t;this.setCustomEditors(),this.setFieldProps(),this.fieldToFocus&&(null===(t=this.fields)||void 0===t?void 0:t.some((t=>t.name===this.fieldToFocus)))&&requestAnimationFrame((()=>{var t,i;null===(t=this._dataBinder)||void 0===t||t.setFocus(this.fieldToFocus),null===(i=this.snkRequestClearFieldToFocus)||void 0===i||i.emit()}))}setCustomEditors(){var t,i;if(this._formView)for(const[s,e]of this._customEditors)null===(i=(t=this._formView).addCustomEditor)||void 0===i||i.call(t,s,e.customEditor,e.detailContext),this._customEditors.delete(s)}setFieldProps(){if(this._formView)for(const[t,i]of this._fieldProps)i.forEach((i=>{var s,e;null===(e=(s=this._formView).setFieldProp)||void 0===e||e.call(s,t,i.propName,i.value),this._fieldProps.delete(t)}))}buildSourceRecordPK(t){var i,s,e;const n=(null===(i=t.payload)||void 0===i?void 0:i[0])||{},a=JSON.parse(atob(n.__record__source__id__||""));if(delete a.__DATA_UNIT_NAME__,!this.dataUnit)return{};const o=null!==(s=R(this.dataUnit))&&void 0!==s?s:{},r=Object.keys(o),l={};for(const t of r)l[t]=null===(e=a[t])||void 0===e?void 0:e.value;return l}getImageField(){var t;return null===(t=this.dataUnit)||void 0===t?void 0:t.metadata.fields.filter((t=>t.userInterface===h.IMAGE))}render(){return s(e,null,s("slot",null),s("ez-form-view",{ref:t=>this._formView=t,fields:this.fields,onEzContentReady:t=>this.bindFields(t.detail),singleColumn:this._singleColumn,customUiBuilders:this.customUiBuilders,formLayout:this._currentFormLayout}),this.fieldSearch&&s("ez-popover",{ref:t=>this._ezPopoverFieldColumn=t,overlayType:"none"},this.fieldSearch))}static get watchers(){return{customEditors:["observePropsCustomEditor"],fieldsProps:["observeFieldsProps"],dataUnit:["observeDataUnit"]}}};_t.style=".sc-snk-dynaform-form-view-h{display:flex;flex-direction:column;width:100%;flex-wrap:wrap;background-color:var(--background--xlight);padding:var(--space--12, 12px);padding-right:0;border-radius:var(--border--radius-medium);border:1px solid var(--color--petroleum-100, #C8CCD3);--ez-form-card-summary-field-content-weight:700}ez-form-view.sc-snk-dynaform-form-view{padding-right:var(--space--12, 12px);--ez-form-view__item--padding:0;min-height:0;overflow-y:auto;scrollbar-width:auto;scrollbar-color:var(--color--strokes, #E1E2E5) transparent}ez-form-view.sc-snk-dynaform-form-view::-webkit-scrollbar{width:14px;height:14px}ez-form-view.sc-snk-dynaform-form-view::-webkit-scrollbar-track{background:transparent}ez-form-view.sc-snk-dynaform-form-view::-webkit-scrollbar-thumb{background-color:var(--color--strokes, #E1E2E5);border-radius:999px;border:2px solid transparent;background-clip:padding-box}ez-form-view.sc-snk-dynaform-form-view::-webkit-scrollbar-thumb:hover{background-color:var(--color--petroleum-100, #C8CCD3);background-clip:padding-box}ez-form-view.sc-snk-dynaform-form-view::-webkit-scrollbar-corner{background:transparent}.level-path.sc-snk-dynaform-form-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.summary-wrapper.sc-snk-dynaform-form-view{display:flex;overflow:hidden}.summary-header.sc-snk-dynaform-form-view{border-bottom:1px solid var(--color--strokes);margin-bottom:var(--space--medium);padding-bottom:var(--space--medium)}.summary-container.sc-snk-dynaform-form-view{display:flex;flex-direction:column}.summary-container.sc-snk-dynaform-form-view{padding-right:calc(var(--space--extra-large) / 1.5)}.summary-field.sc-snk-dynaform-form-view{min-width:30px;max-width:200px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.summary-field__title.sc-snk-dynaform-form-view{color:var(--text--primary, #626e82);font-size:var(--title--small);white-space:nowrap;font-weight:var(--text-weight--medium)}.summary-field__content.sc-snk-dynaform-form-view{color:var(--title--primary, #2b3a54);font-size:var(--text--large);font-weight:var(--ez-form-card-summary-field-content-weight)}";const yt=class{constructor(s){t(this,s),this.ezExpressionChange=i(this,"ezExpressionChange",7),this.filterAssistent=void 0,this.application=void 0}getMessage(t,i){return this.application.messagesBuilder.getMessage(t,i)}render(){var t;return s(e,null,s("span",{class:"ez-title ez-title--small ez-padding-bottom--small snk-filter-advanced-mode__title"},this.getMessage("snkPersonalizedFilter.info.applyExpression")),s("ez-text-area",{rows:9,label:this.getMessage("snkPersonalizedFilter.info.labelExpression"),value:null===(t=this.filterAssistent)||void 0===t?void 0:t.expression,onEzChange:t=>this.ezExpressionChange.emit(t.detail)}))}};yt.style=".sc-snk-filter-advanced-mode-h{display:block;--snk-personalized-filter--title--color:var(--title--primary, #2B3A54)}.snk-filter-advanced-mode__title.sc-snk-filter-advanced-mode{color:var(--snk-personalized-filter--title--color)}";const Ct=class{constructor(s){t(this,s),this.ezChangeFilter=i(this,"ezChangeFilter",7),this.filterAssistent=void 0,this.messagesBuilder=void 0,this.filterId=void 0,this.entityUri=void 0,this.application=void 0,this.isDefaultFilter=!1}getMessage(t,i){return this.application.messagesBuilder.getMessage(t,i)}async handleFilterGroupChange(){const t=await this._mainExpressionGroup.getExpressionGroup();this.filterAssistent=Object.assign(Object.assign({},this.filterAssistent),{assistent:t}),this.filterAssistent.parameters=K.buildVariableParameters(this.filterAssistent.assistent),this.filterAssistent.expression=K.buildGroupExpression(this.filterAssistent.assistent),this.ezChangeFilter.emit(this.filterAssistent)}render(){var t,i;return s(e,null,s("div",{class:"ez-padding-top--small snk-personalized-filter__group"},s("snk-expression-group",{ref:t=>this._mainExpressionGroup=t,group:null===(t=this.filterAssistent)||void 0===t?void 0:t.assistent,messagesBuilder:this.messagesBuilder,onEzFilterGroupChange:this.handleFilterGroupChange.bind(this),filterId:this.filterId,entityURI:this.entityUri,isDefaultFilter:this.isDefaultFilter})),s("div",{class:"ez-margin-top--auto"},s("div",{class:"snk-personalized-filter__expression-input--line"}),s("ez-collapsible-box",{label:this.getMessage("snkPersonalizedFilter.info.titleCollapsible"),headerSize:"medium",value:!0},s("div",{class:"ez-box"},s("div",{class:"ez-box__container--external"},s("div",{class:"ez-box__container--internal"},s("span",{class:"ez-box__container--title"},this.getMessage("snkPersonalizedFilter.info.labelExpression")),s("span",{class:"ez-box__container--expression"},null===(i=this.filterAssistent)||void 0===i?void 0:i.expression)))))))}};Ct.style=".sc-snk-filter-assistent-mode-h{display:flex;flex-direction:column;height:100%;--text-area--font-family:var(--font-pattern, Arial);--text-area__label--floating--top:var(--space--small, 6px);--snk-filter-assistent-mode__container--border-radius:var(--border--radius-medium, 12px);--snk-filter-assistent-mode__container--background:var(--background--medium, #f0f3f7);--snk-filter-assistent-mode__container--margin:var(--space--small, 6px) var(--space--medium, 12px)}.ez-box__container--external.sc-snk-filter-assistent-mode{height:100px;width:100%;overflow-y:auto;background-color:var(--snk-filter-assistent-mode__container--background);border-radius:var(--snk-filter-assistent-mode__container--border-radius)}.ez-box__container--internal.sc-snk-filter-assistent-mode{margin:var(--snk-filter-assistent-mode__container--margin)}.ez-box__container--title.sc-snk-filter-assistent-mode{display:block;user-select:none;font-family:var(--text-area--font-family);font-size:var(--text--extra-small);color:var(--title--primary);top:var(--text-area__label--floating--top)}.ez-box__container--expression.sc-snk-filter-assistent-mode{display:block;font-family:var(--text-area--font-family);font-size:var(--text--medium);color:var(--title--primary);top:var(--text-area__label--floating--top)}.snk-personalized-filter__expression-input--line.sc-snk-filter-assistent-mode{width:100%;height:2px;background-color:var(--snk-personalized-filter--background-color-line);margin-top:var(--snk-personalized-filter--margin-line);margin-bottom:var(--snk-personalized-filter--margin-line)}";const zt=class{constructor(s){t(this,s),this.filterChange=i(this,"filterChange",7),this.config=void 0,this.getMessage=void 0,this.showHardFixed=!0,this.removalBlocked=!1}async setFocusField(){var t,i,s,e;this._editor&&(this._editor.setFocus?null===(i=null===(t=this._editor)||void 0===t?void 0:t.setFocus)||void 0===i||i.call(t):this._editor.focus&&(null===(e=null===(s=this._editor)||void 0===s?void 0:s.focus)||void 0===e||e.call(s)))}async clearValue(){this._editor&&this._editor.clearValue&&await this._editor.clearValue()}observeConfig(t){var i,s;this._editor&&(this._editor.config=t),null===(s=null===(i=this._editor)||void 0===i?void 0:i.reloadList)||void 0===s||s.call(i),this._customElementObject=this.getContentEditor()}componentDidLoad(){if(this._element){v.addIDInfo(this._element);const t=this._element.getAttribute(v.DATA_ELEMENT_ID_ATTRIBUTE_NAME);this._idContentEditor=`${t}_${this.config.id}`}}changeConfig(t){this.filterChange.emit(t)}getContentEditor(){switch(this.config.type){case C.BINARY_SELECT:return{tag:"snk-filter-binary-select"};case C.MULTI_SELECT:return{tag:"snk-filter-multi-select"};case C.PERIOD:return{tag:"snk-filter-period"};case C.SEARCH:return{tag:"snk-filter-search"};case C.NUMBER:return{tag:"snk-filter-number"};case C.PERSONALIZED:return{tag:"snk-personalized-filter-editor",props:{presentationMode:q.CHIP,onValueChanged:t=>this.handleValueChanged(t)}};case C.CHECK_BOX_LIST:return{tag:"snk-filter-checkbox-list",props:{onValueChanged:t=>this.config=Object.assign(Object.assign({},this.config),{value:t.detail})}};case C.MULTI_LIST:return{tag:"snk-entity-list",props:{onValueChanged:t=>this.config=Object.assign(Object.assign({},this.config),{value:t.detail})}}}return{tag:"snk-filter-text"}}handleValueChanged({detail:t}){const i=(null==t?void 0:t.items)||this.config.groupedItems;this.config=Object.assign(Object.assign({},this.config),{groupedItems:i,visible:(i||[]).filter((t=>t.visible)).length>0})}removeItem(){const t=this.config.type===C.MULTI_LIST&&Array.isArray(this.config.value)?this.config.value.map((t=>Object.assign(Object.assign({},t),{check:!1}))):void 0,i=Object.assign(Object.assign({},this.config),{visible:!1,fixed:!1,value:t});null!=i.groupedItems&&(i.groupedItems=i.groupedItems.map((t=>Object.assign(Object.assign({},t),{visible:!1,fixed:!1,value:void 0})))),this.changeConfig(i)}removeItemFromGroup(t){return Object.assign(Object.assign({},t),{visible:!1,fixed:!1,value:void 0})}getPopUpHeaderButtons(){return s(n,null,!this.removalBlocked&&!this.config.removalBlocked&&this.buildIcon(this.getMessage("snkFilterBar.removeFilter"),"delete",(()=>this.removeItem())),this.showHardFixed&&!this.config.hardFixed&&this.buildIcon(this.getMessage(this.config.fixed?"snkFilterBar.unpinFilter":"snkFilterBar.pinFilter"),this.config.fixed?"un-pin":"push-pin",(()=>this.changeConfig(Object.assign(Object.assign({},this.config),{fixed:!this.config.fixed})))))}buildIcon(t,i,e){return s("button",{onClick:()=>e(),class:"sc-snk-filter-bar snk-filter-item__editor-header-button",ref:i=>i&&this.buildIdButton(i,t)},s("ez-icon",Object.assign({title:t,iconName:i},{[v.DATA_ELEMENT_ID_ATTRIBUTE_NAME]:`${v.getInternalIDInfo(`_${t}`)}`})))}buildIdButton(t,i){if(!t)return;const s={id:i};t.removeAttribute(v.DATA_ELEMENT_ID_ATTRIBUTE_NAME),v.addIDInfoIfNotExists(t,"button",s)}clearBinarySelectValues(){var t;const i=this._editor||{};null===(t=i.resetValues)||void 0===t||t.call(i),this.config=m.copy(this.originalConfig),this.changeConfig(Object.assign(Object.assign({},this.config),{value:void 0}))}async apply(){var t,i;let s=null===(t=this._editor)||void 0===t?void 0:t.value;if("function"==typeof(null===(i=this._editor)||void 0===i?void 0:i.getValueAsync)&&(s=await this._editor.getValueAsync()),!K.validateVariableValues(this.config,s))return T.alert(this.getMessage("snkFilterBar.filterModal.validations.notFullFilled.title"),this.getMessage("snkFilterBar.filterModal.validations.notFullFilled.message"));const e=void 0!==s?s:this.config.value;this.changeConfig(Object.assign(Object.assign({},this.config),{visible:this.isVisible(),value:e}))}isVisible(){return!(this.config.groupedItems&&this.config.groupedItems.length>0)||this.config.groupedItems.filter((t=>t.visible)).length>0}clear(){var t;if(this.config.type!==C.BINARY_SELECT){if(C.MULTI_LIST===this.config.type){const i=m.copy(this.config);return null===(t=i.value)||void 0===t||t.forEach((t=>!!t&&(t.check=!1))),void(this.config=m.copy(i))}this.changeConfig(Object.assign(Object.assign({},this.config),{value:void 0}))}else this.clearBinarySelectValues()}filterCanBeCleared(){return this.config.type!==C.PERSONALIZED}onKeyDonwListener(t){"Enter"===t.key&&this.apply()}buildRightSlot(t){return s("ez-icon",{iconName:"delete",onClick:()=>this.removeValueFromConfig(t)})}removeValueFromConfig(t){var i,s;if(this.config){const e=m.copy(this.config),n=null===(i=e.value)||void 0===i?void 0:i.findIndex((i=>(null==i?void 0:i.id)===t.id));null===(s=e.value)||void 0===s||s.splice(n,1),this.config=m.copy(e)}}componentWillLoad(){this.originalConfig=m.copy(this.config),this._customElementObject=this.getContentEditor()}render(){const{tag:t,props:i}=this._customElementObject;return s(e,null,s("div",{class:"col ez-col--sd-12 ez-align--right ez-padding-medium ez-flex--align-items-center"},s("div",{class:"ez-text ez-title ez-title--small ez-padding--small sc-snk-filter-bar snk-filter-item__editor-header"},this.config.detailTitle),this.getPopUpHeaderButtons()),s(t,Object.assign({maxHeightList:"240px",ref:t=>this._editor=t,value:this.config.value,config:this.config,onKeyDown:t=>this.onKeyDonwListener(t),"data-element-id":this._idContentEditor,getMessage:this.getMessage,rightListSlotBuilder:t=>this.buildRightSlot(t)},i)),s("hr",{class:"sc-snk-filter-bar snk-filter__popover-rule"}),s("div",{class:"ez-col ez-col--sd-12 ez-align--right"},this.filterCanBeCleared()&&s("ez-button",{label:this.getMessage("snkFilterBar.cleanFilter"),onClick:()=>this.clear(),size:"small"}),s("ez-button",{ref:t=>this._applyButton=t,label:this.getMessage("snkFilterBar.applyFilter"),onClick:()=>this.apply(),size:"small",class:"ez-button--primary ez-padding-left--medium"})))}get _element(){return a(this)}static get watchers(){return{config:["observeConfig"]}}},xt=class{constructor(s){t(this,s),this.filterChange=i(this,"filterChange",7),this.editPersonalizedFilter=i(this,"editPersonalizedFilter",7),this.addPersonalizedFilter=i(this,"addPersonalizedFilter",7),this.filterItem=void 0,this.configName=void 0,this.resourceID=void 0}getContentEditorConfig(){const t={presentationMode:q.MODAL};switch(this.filterItem.type){case C.BINARY_SELECT:return{tag:"snk-filter-binary-select",props:t};case C.MULTI_SELECT:return{tag:"snk-filter-multi-select"};case C.PERIOD:return{tag:"snk-filter-period",props:t};case C.SEARCH:return{tag:"snk-filter-search"};case C.NUMBER:return{tag:"snk-filter-number",props:t};case C.PERSONALIZED:return this.buildSnkFilterPersonalizedProps();case C.CHECK_BOX_LIST:return{tag:"snk-filter-checkbox-list",props:t};case C.MULTI_LIST:return{tag:"snk-entity-list",props:{maxHeightList:"640px",rightListSlotBuilder:t=>this.buildRightSlot(t)}}}return{tag:"snk-filter-text"}}buildSnkFilterPersonalizedProps(){return{tag:"snk-personalized-filter-editor",props:{onEditFilter:t=>this.editPersonalizedFilter.emit(t.detail),onAddFilter:()=>this.addPersonalizedFilter.emit()}}}isVisible(t){return!!this.filterItem.visible||void 0!==t}updateFilterValue(t){var i,s;const e=void 0!==(null==t?void 0:t.value)?t.value:t;this.filterItem=Object.assign(Object.assign({},this.filterItem),null!=this.filterItem.groupedItems?{visible:e>0,value:e,groupedItems:t.items}:{value:this.filterItem.type===(C.SEARCH||C.CHECK_BOX_LIST)?t:e,visible:this.isVisible(e)}),this._editor&&(this._editor.config=this.filterItem),null===(s=null===(i=this._editor)||void 0===i?void 0:i.reloadList)||void 0===s||s.call(i),this.filterChange.emit(this.filterItem)}async syncEditorValue(){const t=this._editor;if(t&&"function"==typeof t.getValueAsync){const i=await t.getValueAsync();null!=i&&this.updateFilterValue(i)}}handleDeleteFilter(t,i){i===C.PERSONALIZED&&H.removePersonalizedFilter(t,this.resourceID,this.configName)}componentDidLoad(){if(this._element){v.addIDInfo(this._element);const t=this._element.getAttribute(v.DATA_ELEMENT_ID_ATTRIBUTE_NAME);this._idContentEditor=`${t}_${this.filterItem.id}`}}buildRightSlot(t){return s("ez-icon",{iconName:"delete",onClick:()=>this.removeValueFromConfig(t)})}removeValueFromConfig(t){var i,s,e;const n=null===(s=null===(i=this.filterItem)||void 0===i?void 0:i.value)||void 0===s?void 0:s.findIndex((({id:i})=>i===t.id)),a=m.copy(this.filterItem);null===(e=null==a?void 0:a.value)||void 0===e||e.splice(n,1),this.updateFilterValue(a.value)}canShowDetailModal(){const{CUSTOM_FILTER:t,OTHER_FILTERS:i}=I;return![t,i].includes(this.filterItem.filterType)&&this.filterItem.type!==C.BINARY_SELECT}render(){const{tag:t,props:i}=this.getContentEditorConfig();return s(e,null,s("div",{class:"ez-flex ez-flex--column grow"},this.canShowDetailModal()&&s("label",{class:"ez-text ez-text--medium ez-text--primary ez-margin-bottom--extra-small",htmlFor:`filter-item-${this.filterItem.id}`},this.filterItem.detailModal),s(t,Object.assign({ref:t=>this._editor=t,id:`filter-item-${this.filterItem.id}`,config:this.filterItem,value:this.filterItem.value,onValueChanged:t=>this.updateFilterValue(t.detail),"data-element-id":this._idContentEditor},i))))}get _element(){return a(this)}};xt.style=".grow{flex-grow:1}.gap{gap:4px}";const At=class{constructor(s){t(this,s),this.imageError=i(this,"imageError",7),this.dataUnitObserver=async t=>{var i;if([l.NEXT_SELECTED,l.PREVIOUS_SELECTED].includes(t.type))return void await this.loadImage();const s=(null===(i=t.payload)||void 0===i?void 0:i.selection)||[];t.type===l.SELECTION_CHANGED&&s.length>0?await this.loadImage():t.type!==l.RECORDS_ADDED?t.type!==l.EDITION_CANCELED||await this.loadImage():await this.clearImage()},this.dataUnit=void 0,this.fieldName=void 0,this.entityName=void 0,this.enabled=!0,this.acceptType=void 0,this.maxSize=void 0,this.label=void 0,this.imageValue=void 0,this.loading=!0}async reloadImage(t){await this.loadImage(t)}getMessage(t,i){return this.messagesBuilder||(this.messagesBuilder=new g),this.messagesBuilder.getMessage(t,i)}async clearImage(){var t;null===(t=this._loadAbortController)||void 0===t||t.abort(),this.imageValue=void 0}async handleImageChange(t){const i=t.detail;if(!i)return await this.clearImage(),void await this.updatedataUnitField(!0);const s=await M(i);if(this.maxSize&&s.size>1024*this.maxSize){const t=this.getMessage("snkImageInput.errorImageSize")+this.maxSize+"(KB)";return this.imageError.emit(t),void(this.application&&await this.application.error(this.getMessage("snkImageInput.errorTitle"),t))}this.imageValue=i,await U(s,this.entityName,this.fieldName),await this.updatedataUnitField()}async updatedataUnitField(t=!1){this.dataUnit&&this.dataUnit.getSelectedRecord()&&(t?await this.dataUnit.setFieldValue(this.fieldName,"deletado"):await this.dataUnit.setFieldValue(this.fieldName,`$file.session.key{${V(this.entityName,this.fieldName)}}`))}async handleImageError(t){this.imageError.emit(t.detail),this.application&&await this.application.error(this.getMessage("snkImageInput.errorTitle"),t.detail)}getPksFromDataUnit(){if(!this.dataUnit)return;const t=this.dataUnit.getSelectedRecord();if(!t)return;const i=t[this.fieldName];if(i)try{return JSON.parse(i)}catch(t){return void console.error("Error parsing PK from data unit field:",t)}}async loadImage(t){var i,s;null===(i=this._loadAbortController)||void 0===i||i.abort();const e=new AbortController;if(this._loadAbortController=e,this.loading=!0,this.dataUnit&&this.entityName){t=null!==(s=null!=t?t:this.getPksFromDataUnit())&&void 0!==s?s:R(this.dataUnit);const i=await B(t,this.fieldName,this.entityName,e.signal);if(e.signal.aborted)return;this.imageValue=i}this.loading=!1}async componentWillLoad(){this.application=o.getContextValue("__SNK__APPLICATION__"),this.messagesBuilder||(this.messagesBuilder=new g),this.dataUnit&&this.dataUnit.subscribe(this.dataUnitObserver)}disconnectedCallback(){this.dataUnit&&this.dataUnit.unsubscribe(this.dataUnitObserver)}async componentDidLoad(){await this.loadImage()}render(){return s(e,null,s("ez-image-input",{enabled:this.enabled,label:this.label,name:this.fieldName,value:this.imageValue,maxFileSize:this.maxSize?1024*this.maxSize:void 0,accept:this.acceptType||"image/png,image/jpeg,image/gif",onEzChange:t=>this.handleImageChange(t),onEzError:t=>this.handleImageError(t),loading:this.loading}))}};At.style=":host{display:block}";const St=class{constructor(s){t(this,s),this.ezCancel=i(this,"ezCancel",7),this.ezSave=i(this,"ezSave",7),this.ezAfterSave=i(this,"ezAfterSave",7),this._personalizedFilterFetcher=new Q,this._filterMetadataStorage=new Map,this._dataSourceFetcher={fetchData:async t=>{let i=null==t?void 0:t.uri;if(d.isEmpty(i)&&(i=this.entityUri),!this._filterMetadataStorage.has(i)){const t=await this._personalizedFilterFetcher.loadFields(i);this._filterMetadataStorage.set(i,t)}return this._filterMetadataStorage.get(i)}},this._filterAssistentMode=!0,this._filterAssistent=void 0,this.messagesBuilder=void 0,this.entityUri=void 0,this.filterId=void 0,this.configName=void 0,this.resourceID=void 0,this.isDefaultFilter=!1}async createPersonalizedFilter(){const t={name:"",active:!0,expression:"",parameters:[],assistent:{id:d.generateUUID(),items:[{id:d.generateUUID(),entityName:"",fieldName:"",description:"",fieldLabel:this.getMessage("snkPersonalizedFilter.info.labelDefaultValue"),type:void 0,expression:void 0,operand:void 0,paramVariable:!1,value:void 0,systemConfig:null,userConfig:null}],childrenGroups:[],operand:G.AND}};this.isDefaultFilter&&this.buildDataDefaultFilter(t),this._originalFilterAssistent=m.copy(t),this._filterAssistent=m.copy(t)}loadFilter(t,i){null!=t&&i!=t&&null!=this.resourceID&&(t!==$.id?H.loadPersonalizedFilter(t,this.resourceID,this.configName).then((t=>{const i=this.applyDefaultValues(t);this._filterAssistent=i,this._originalFilterAssistent=m.copy(i),this._filterAssistentMode=this._filterAssistent.hasOwnProperty("assistent")&&null!=this._filterAssistent.assistent})):H.loadDefaultFilter(t,this.resourceID,this.configName).then((t=>{const i=this.applyDefaultValues(t);this._filterAssistent=i,this._originalFilterAssistent=m.copy(i),this._filterAssistentMode=this._filterAssistent.hasOwnProperty("assistent")&&null!=this._filterAssistent.assistent})))}componentWillLoad(){var t;null==J.get(`filterFieldsDataSource.${this.entityUri}`)&&J.set(`filterFieldsDataSource.${this.entityUri}`,this._dataSourceFetcher),this.messagesBuilder||(this._application=o.getContextValue("__SNK__APPLICATION__"),this.messagesBuilder=null===(t=this._application)||void 0===t?void 0:t.messagesBuilder),this.loadFilter(this.filterId,void 0)}componentDidRender(){var t;null===(t=this._viewStackRef)||void 0===t||t.show(this._filterAssistentMode?0:1),this._elButtonMode&&this._elButtonMode.setAttribute(v.DATA_ELEMENT_ID_ATTRIBUTE_NAME,v.getInternalIDInfo(this._filterAssistentMode?"advancedMode_ezButton":"assistentMode_ezButton"))}buildDataDefaultFilter(t){t.name=$.name,t.id=$.id}getMessage(t,i){return this._application.messagesBuilder.getMessage(t,i)}async saveFilter(){let t;t=this.isDefaultFilter?await H.saveDefaultFilter(this._filterAssistent,this.resourceID,this.configName):await H.savePersonalizedFilter(this._filterAssistent,this.resourceID,this.configName),this._elButtonSave.enabled=!1,T.info(this.getMessage(`snkPersonalizedFilter.${this._filterAssistent.id?"confirmEdit":"confirmSave"}.title`),{iconName:"check"});const i=Object.assign(Object.assign({},t),this._filterAssistent);i.parameters=K.buildVariableParameters(this._filterAssistent.assistent),this._originalFilterAssistent=m.copy(i),this._filterAssistent=m.copy(i),this.ezAfterSave.emit()}removeFilter(){H.removePersonalizedFilter(this._filterAssistent,this.resourceID,this.configName)}hasChangesToSave(){return JSON.stringify(this._filterAssistent)===JSON.stringify(this._originalFilterAssistent)}async handleSave(){if(this._filterAssistentMode){if(!K.validateFields(this._filterAssistent.assistent)||!this._filterAssistent.name)return this._application.error(this.getMessage("snkPersonalizedFilter.error.title"),this.getMessage("snkPersonalizedFilter.error.description"));this.saveAssistentMode()}else{if(!this._filterAssistent.expression||!this._filterAssistent.name)return this._application.error(this.getMessage("snkPersonalizedFilter.error.title"),this.getMessage("snkPersonalizedFilter.error.description"));if(!await this.validateExpressionBeforeSaving())return;this.saveAdvancedMode()}}saveAssistentMode(){const{assistent:t,expression:i}=this._filterAssistent,s=t?K.buildGroupExpression(t):i;this._filterAssistent.expression=s,this.ezSave.emit(s),this.saveFilter()}saveAdvancedMode(){this._originalFilterAssistent.expression!==this._filterAssistent.expression&&this._filterAssistent.assistent?T.confirm(this.getMessage("snkPersonalizedFilter.confirmSaveModeAdvanced.title"),this.getMessage("snkPersonalizedFilter.confirmSaveModeAdvanced.description")).then((t=>{t&&this.saveAndTransformToAdvancedMode()})):this._filterAssistent.assistent?this.saveAssistentMode():this.saveAndTransformToAdvancedMode()}saveAndTransformToAdvancedMode(){this._filterAssistent.assistent=void 0,this.ezSave.emit(this._filterAssistent.expression),this.saveFilter()}async validateExpressionBeforeSaving(){const{valid:t,message:i=""}=await this._personalizedFilterFetcher.validatePersonalizedFilter(this.entityUri,this._filterAssistent.expression);return t||this._application.error(this.getMessage("snkPersonalizedFilter.errorValidation.title"),i.replace(/.*Exception: /,"")),t}handleCancel(){if(this.hasChangesToSave())return this.ezCancel.emit();T.confirm(this.getMessage("snkPersonalizedFilter.confirmCancel.title"),this.getMessage("snkPersonalizedFilter.confirmCancel.description")).then((t=>{var i;t&&(this._filterAssistent=m.copy(null!==(i=this._originalFilterAssistent)&&void 0!==i?i:{}),this.ezCancel.emit(),this._elButtonSave.enabled=!1)}))}handleTitleChange(t){this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{name:t}),this._elButtonSave.enabled=!this.hasChangesToSave()}applyDefaultValues(t){return this.addLabelToItems(t),this.addFilterGroupCondition(t),t}addFilterGroupCondition(t){t.assistent&&!t.assistent.operand&&(t.assistent.operand=G.AND)}addLabelToItems(t){t.assistent&&t.assistent.items&&t.assistent.items.length>0&&t.assistent.items.forEach((i=>{if(null==i.fieldLabel){const s=(t.parameters||[]).find((t=>t.fieldName===i.fieldName));s&&(i.fieldLabel=s.label)}}))}handleExpressionChangeAdvancedMode(t){this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{expression:t}),this._elButtonSave.enabled=!this.hasChangesToSave()}handleChangeFilterAssistentMode(t){this._elButtonSave.enabled=!this.hasChangesToSave(),this._filterAssistent=Object.assign({},t)}selectField(t){if(!("name"in t))return;const i=this.buildExpression(t.entityName,t.name,t.entityPath);this._elAdvancedMode.querySelector("ez-text-area").appendTextToSelection(i)}buildExpression(t,i,s){return s.length>0&&s.shift(),s.length>0?`${s.join("->")}->${i}`:`${t}.${i}`}onAddField(t){this._elAdvancedMode.querySelector("ez-text-area").setFocus(),t.setBlur(),this._elFilterFieldSearch&&this._elFilterFieldSearch.show(t,{horizontalGap:0,verticalGap:12,fromRight:!0})}renderButtonAddField(){if(!this._filterAssistentMode)return s(n,null,s("ez-button",{class:"snk-personalized-filter__button-mode",label:this.getMessage("snkPersonalizedFilter.info.addField"),enabled:!0,onClick:t=>this.onAddField(t.target)},s("ez-icon",{class:"ez-padding-right--small",slot:"leftIcon",iconName:"plus"})),s("snk-filter-field-search",{class:"ez-padding-left--medium",ref:t=>this._elFilterFieldSearch=t,onEzSelectFilterItem:t=>this.selectField(t.detail),fieldsDataSource:this._dataSourceFetcher}))}buildContainerPersonalizedFilter(){return s("ez-view-stack",{ref:t=>this._viewStackRef=t},s("stack-item",null,this._filterAssistentMode&&s("snk-filter-assistent-mode",{filterAssistent:this._filterAssistent,messagesBuilder:this.messagesBuilder,filterId:this.filterId,entityUri:this.entityUri,application:this._application,onEzChangeFilter:t=>this.handleChangeFilterAssistentMode(t.detail),isDefaultFilter:this.isDefaultFilter})),s("stack-item",null,s("snk-filter-advanced-mode",{ref:t=>this._elAdvancedMode=t,filterAssistent:this._filterAssistent,application:this._application,onEzExpressionChange:t=>this.handleExpressionChangeAdvancedMode(t.detail)})))}handleModeChange(){var t,i;if(this._filterAssistentMode)T.confirm(this.getMessage("snkPersonalizedFilter.confirmChangeModeAssistent.title"),this.getMessage("snkPersonalizedFilter.confirmChangeModeAssistent.description")).then((t=>{if(t&&(this._filterAssistentMode=!this._filterAssistentMode,!this.hasChangesToSave())){const t=K.buildGroupExpression(this._filterAssistent.assistent);this._filterAssistent.expression=t,this._elButtonSave.enabled=!this.hasChangesToSave()}}));else if((null===(t=this._filterAssistent)||void 0===t?void 0:t.expression)===(null===(i=this._originalFilterAssistent)||void 0===i?void 0:i.expression))this._filterAssistentMode=!this._filterAssistentMode;else{const t=this._filterAssistent.expression,i=K.buildGroupExpression(this._filterAssistent.assistent);t!==i?T.confirm(this.getMessage("snkPersonalizedFilter.confirmChangeModeAdvanced.title"),this.getMessage("snkPersonalizedFilter.confirmChangeModeAdvanced.description")).then((t=>{t&&(this._filterAssistent=Object.assign(Object.assign({},this._filterAssistent),{expression:i}),this._filterAssistentMode=!this._filterAssistentMode)})):this._filterAssistentMode=!this._filterAssistentMode}}buildTitle(){return this.getMessage(this.isDefaultFilter&&!this.filterId?"snkPersonalizedFilter.info.titleCreateDefault":this.isDefaultFilter&&this.filterId?"snkPersonalizedFilter.info.titleEditDefault":this.filterId?"snkPersonalizedFilter.info.titleEdit":"snkPersonalizedFilter.info.titleAdd")}render(){var t,i,n,a;if((null===(t=this._filterAssistent)||void 0===t?void 0:t.assistent)||!this._filterAssistentMode)return s(e,null,s("div",{class:"snk-personalized-filter"},s("div",null,s("snk-simple-bar",{label:this.buildTitle(),onExit:()=>this.handleCancel()},s("div",{class:"snk-personalized-filter__header-actions",slot:"rightSlot"},s("ez-button",{label:this.getMessage("snkPersonalizedFilter.info.labelCancel"),onClick:()=>this.handleCancel()}),s("ez-button",{ref:t=>this._elButtonSave=t,enabled:!1,class:"ez-button--primary",label:this.getMessage("snkPersonalizedFilter.info.labelSave"),onClick:this.handleSave.bind(this)})))),s("div",{class:"ez-box ez-margin-bottom--medium ez-box__main"},s("div",{class:"ez-box__container"},s("div",{class:"ez-flex ez-flex--column ez-size-width--full"},s("div",{class:"ez-flex"},s("ez-tooltip",{message:this.getMessage("snkPersonalizedFilter.info.textInputDisabled"),active:this.isDefaultFilter},s("ez-text-input",{class:"ez-padding-right--medium",label:this.getMessage("snkPersonalizedFilter.info.labelNameFilter"),value:null===(i=this._filterAssistent)||void 0===i?void 0:i.name,onEzChange:t=>this.handleTitleChange(t.detail),enabled:!this.isDefaultFilter})),this.renderButtonAddField(),s("ez-button",{ref:t=>this._elButtonMode=t,class:"snk-personalized-filter__button-mode",label:this.getMessage(this._filterAssistentMode?"snkPersonalizedFilter.info.activeModeAdvanced":"snkPersonalizedFilter.info.activeModeAssistent"),onClick:()=>this.handleModeChange(),"data-tooltip":this._filterAssistentMode||(null===(n=this._filterAssistent)||void 0===n?void 0:n.assistent)?void 0:this.getMessage("snkPersonalizedFilter.info.tooltipDisabledAssistentMode"),"data-flow":"bottom",enabled:!this._filterAssistent.name||Boolean(this._filterAssistentMode||(null===(a=this._filterAssistent)||void 0===a?void 0:a.assistent))})),this.buildContainerPersonalizedFilter())))))}static get watchers(){return{filterId:["loadFilter"]}}};St.style=".sc-snk-personalized-filter-h{display:flex;height:100%;padding:var(--space--large, 24px);--snk-personalized-filter--width:100%;--snk-personalized-filter--height:100%;--snk-personalized-filter--background-color-line:var(--color--disable-secondary);--snk-personalized-filter--margin-line:var(--border--radius-medium, 12px)}.snk-personalized-filter.sc-snk-personalized-filter{height:var(--snk-personalized-filter--width);width:var(--snk-personalized-filter--height)}.snk-personalized-filter__header-actions.sc-snk-personalized-filter{display:flex;gap:var(--space--medium)}.snk-personalized-filter__group.sc-snk-personalized-filter{flex:1}.snk-personalized-filter__expression-input--line.sc-snk-personalized-filter{width:100%;height:2px;background-color:var(--snk-personalized-filter--background-color-line);margin-top:var(--snk-personalized-filter--margin-line);margin-bottom:var(--snk-personalized-filter--margin-line)}.ez-box__main.sc-snk-personalized-filter{height:90%}.snk-personalized-filter__button-mode.sc-snk-personalized-filter{height:35px}";const Ot=class{constructor(s){t(this,s),this.clickBreadcrumbItem=i(this,"clickBreadcrumbItem",3),this.exit=i(this,"exit",3),this.label=void 0,this.breadcrumbItens=void 0,this.messagesBuilder=void 0}getMessage(t,i){var s;return this.messagesBuilder?this.messagesBuilder.getMessage(t,i):(null===(s=this._application)||void 0===s?void 0:s.messagesBuilder)?this._application.messagesBuilder.getMessage(t,i):void 0}componentDidLoad(){this._element&&(v.addIDInfo(this._element),this._application=o.getContextValue("__SNK__APPLICATION__"))}render(){return s("div",{class:"simple-bar__container ez-margin-vertical--small ez-padding--extra-small"},s("div",{class:"simple-bar__left-slot"},s("ez-button",{class:"ez-padding-right--medium",title:this.getMessage("snkSimpleBar.backTitle"),mode:"icon",iconName:"arrow_back",size:"medium",onClick:()=>this.exit.emit()}),s("div",{class:"simple-bar__column"},s("h1",{class:"ez-title ez-title--primary ez-title--extra-large"},this.label),s("ez-breadcrumb",{items:this.breadcrumbItens,onSelectedItem:({detail:t})=>this.clickBreadcrumbItem.emit(t)}))),s("div",{class:"simple-bar__right-slot"},s("slot",{name:"rightSlot"})))}get _element(){return a(this)}};Ot.style=".sc-snk-simple-bar-h{display:flex;height:100%;width:100%}.simple-bar__container.sc-snk-simple-bar{flex:1;display:flex;align-items:stretch;gap:var(--space--small)}.simple-bar__left-slot.sc-snk-simple-bar{min-width:280px;flex:1;display:flex;align-items:center}.simple-bar__right-slot.sc-snk-simple-bar{flex:1;display:flex;align-items:center;justify-content:flex-end}.simple-bar__column.sc-snk-simple-bar{flex:1;display:flex;flex-direction:column}";const Ft=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","MORE_OPTIONS"],It=["INSERT","REFRESH","PREVIOUS","NEXT","DIVIDER","CLONE","REMOVE","DIVIDER","MORE_OPTIONS"],Et=class{constructor(s){t(this,s),this.dataStateChange=i(this,"dataStateChange",3),this.dataUnitReady=i(this,"dataUnitReady",3),this.actionClick=i(this,"actionClick",7),this.formItemsReady=i(this,"formItemsReady",7),this.configuratorSave=i(this,"configuratorSave",7),this.configuratorCancel=i(this,"configuratorCancel",7),this._multiSelectionListDataSource=new W,this._formConfigFetcher=new z,this._customEditors=new Map,this._customRenders=new Map,this._container=void 0,this._showPopUpGridConfig=!1,this._currentViewMode=x.GRID,this._config=void 0,this._fieldToGetFocus=void 0,this._customContainerId=`SNK-SIMPLE-CRUD-CUSTOM-CONTAINER-${d.generateUUID()}`,this.enableLockManagerLoadingComp=!1,this.enableLockManagerTaskbarClick=!1,this.dataState=void 0,this.dataUnit=void 0,this.entityName=void 0,this.mode=A.SERVER,this.gridConfig=void 0,this.formConfig=void 0,this._formFields=[],this._fieldsProps=new Map,this.enableContinuousInsert=!1,this.multipleSelection=void 0,this.useCancelConfirm=!0,this.pageSize=150,this.resourceID=void 0,this.enableGridInsert=!1,this.paginationCounterMode="auto",this.taskbarManager=void 0,this.messagesBuilder=void 0,this.useEnterLikeTab=!1,this.actionsList=void 0,this.configName=void 0,this.showConfiguratorButtons=!1,this.gridLegacyConfigName=void 0,this.formLegacyConfigName=void 0,this.ignoreReadOnlyFormFields=!1,this.autoFocus=!0,this.domainMessagesBuilder=void 0,this.multipleEditionEnabled=!0,this.layoutFormConfig=!0,this.disableGridEdition=!1,this.autoLoad=void 0,this.outlineMode=!1}async addCustomEditor(t,i){if(this._grid&&this._form)return this._grid.addCustomEditor(t,i),void this._form.addCustomEditor(t,i);const s=new Map(this._customEditors);s.set(t,i),this._customEditors=s}async addGridCustomRender(t,i){if(this._grid)return void this._grid.addGridCustomRender(t,i);const s=new Map(this._customRenders);s.set(t,i),this._customRenders=s}async handleResourceIDChanged(t,i){d.isEmpty(t)||t!==i&&(await this.loadFormConfig(!0),await this.loadGridConfig(!0))}async addCustomValueFormatter(t,i){this._grid.addCustomValueFormatter(t,i)}async removeCustomValueFormatter(t){this._grid.removeCustomValueFormatter(t)}async setFieldProp(t,i,s){const e=new Map(this._fieldsProps),n=this._fieldsProps.get(t);e.set(t,Object.assign(Object.assign({},n),{[i]:s})),this._fieldsProps=e}loadTaskbarProcessor(){const t={};t[Pt.FORM_REGULAR]=this.getButtons(!1,[O.GRID_MODE],!0),t[Pt.GRID_REGULAR]=this.getButtons(!1,[O.DATA_EXPORTER,O.FORM_MODE]),t[Pt.FORM_SELECTED]=this.getButtons(!0,[O.GRID_MODE],!0),t[Pt.GRID_SELECTED]=this.getGridSelectedButtonsCallBack.bind(this),t[Pt.FINISH_EDITION]=this.getFinishEditionButtonsCallback.bind(this),t[Pt.MULTIPLE_EDITION]=[O.CANCEL],this._taskbarProcessor=new X(t)}getGridSelectedButtonsCallBack(){var t,i,s;return this.multipleEditionEnabled&&1!==(null===(s=null===(i=null===(t=this.dataState)||void 0===t?void 0:t.selectionInfo)||void 0===i?void 0:i.records)||void 0===s?void 0:s.length)?this.getButtons(!0,[O.UPDATE_MULTIPLE,O.DATA_EXPORTER,O.FORM_MODE]):this.getButtons(!0,[O.DATA_EXPORTER,O.FORM_MODE])}getFinishEditionButtonsCallback(){const t=[O.CANCEL,O.SAVE];return this.enableGridInsert&&this._currentViewMode!==x.ATTACHMENT&&t.push(this._currentViewMode===x.GRID?O.FORM_MODE:O.GRID_MODE),t}getButtons(t,i,s){let e=t?It:Ft;return(s||this.mode===A.IN_MEMORY)&&(e=e.filter((t=>t!==O.REFRESH))),this.addConfigButton(e.concat(i))}addConfigButton(t){return void 0===this.configName||this.configName&&this.gridLegacyConfigName?t:t.concat(O.CONFIGURATOR)}get application(){return o.getContextValue("__SNK__APPLICATION__")}async goToView(t){this._currentViewMode=t,this._viewStack&&(t===x.GRID&&(this.dataUnit.isMultipleEdition=!1),this._viewStack.show(t)),t===x.GRID&&requestAnimationFrame((()=>this.focusToGrid())),t===x.FORM&&requestAnimationFrame((()=>this.focusToForm()))}actionClickListener(t){this.handleTaskbarAction(t.detail),t.stopPropagation()}handleTaskbarAction(t){switch(t){case O.CONFIGURATOR:this._snkConfigurator.open();break;case O.GRID_MODE:this.goToView(x.GRID);break;case O.FORM_MODE:this.goToView(x.FORM);break;case O.UPDATE_MULTIPLE:this.dataUnit.isMultipleEdition=!0,this.goToView(x.FORM)}}async onChangeEntityName(t){if(this.dataUnit)return;const i=o.getContextValue("__SNK__APPLICATION__");this.dataUnit=await i.getDataUnit(t,null,null,this.configName)}onModeChange(){this.mode==A.IN_MEMORY&&this.initInMemoryDataUnit()}observeDataState(t,i){this.handleDataStateChange(t,i)}async observeFormLegacy(t,i){await this.handleUpdateFormLegacyConfig(t,i)}async observeGridLegacy(t,i){await this.handleUpdateGridLegacyConfig(t,i)}async handleDataStateChange(t,i){m.objectToString(i)!=m.objectToString(t)&&this.dataStateChange.emit(t),await this.processRmPrecision()}async processRmPrecision(){var t,i;const s=await this._snkDataUnit.getFieldsWithRmPrecision();for(const e of s||[]){if(!e)continue;const s=null===(i=null===(t=this.dataState)||void 0===t?void 0:t.rowMetadata)||void 0===i?void 0:i.getProp("rm_precision",e);(s||0===s)&&(await this.setFieldProp(e,"precision",s),await this.setFieldProp(e,"prettyPrecision",s))}this._rmPrecisionCustomValueFormatter.setDataState(this.dataState)}async handleUpdateGridLegacyConfig(t,i){null!=t&&t!=i&&this._gridConfigAlreadyLoaded&&await this.loadGridConfig(!0)}async handleUpdateFormLegacyConfig(t,i){null!=t&&t!=i&&this._formConfigAlreadyLoaded&&await this.loadFormConfig(!0)}async openConfig(t){await this._snkConfigurator.close(),t===x.GRID?await this.openGridConfig():t===x.FORM&&await this.openFormConfig()}async openGridConfig(){var t,i,s,e;const n=null!==(i=await(null===(t=this._grid)||void 0===t?void 0:t.getColumns()))&&void 0!==i?i:[],a=null!==(e=await(null===(s=this._grid)||void 0===s?void 0:s.getColumnsState()))&&void 0!==e?e:[];this._snkGridConfig.columns=a.filter((t=>t.name)),this._snkGridConfig.originalColumns=n.filter((t=>t.name)),this._snkGridConfig.selectedIndex=0,this._showPopUpGridConfig=!0}async openFormConfig(){(this.formLegacyConfigName||this.configName)&&await this._snkSimpleFormConfig.show()}addGridLegacyConfigName(){this.gridLegacyConfigName&&this.configName&&H.addGridLegacyConfig(this.configName,this.gridLegacyConfigName)}loadGridConfig(t){if(void 0!==this.configName&&(null==this.gridConfig&&!this._gridConfigAlreadyLoaded||t))return this.addGridLegacyConfigName(),this._gridConfigAlreadyLoaded=!0,new Promise(((t,i)=>{H.loadGridConfig(this.configName,this.resolveResourceID()).then((i=>{this.setGridConfig(i),t()})).catch((t=>{i(t)}))}))}formConfigIsLoaded(){return null!=this.formConfig||this._formConfigAlreadyLoaded}async loadFormConfig(t=!1,i=!1){if(void 0===this.configName)return;if(null==this._formConfigManager&&(this._formConfigManager=new it(this.configName,this.resolveResourceID(),void 0,this.dataUnit),this._formConfigManager.setConfig(this.formConfig)),this.formConfigIsLoaded()&&!t)return;this._formConfigAlreadyLoaded=!0;let s=await this._formConfigFetcher.fetchLegacyConfigurableForm(this.formLegacyConfigName);if(null!=s)return this._formConfigManager.setConfig(s),void this.setFormConfig(s,i);this.setFormConfig(await this._formConfigManager.loadConfig())}async componentWillRender(){this.loadTaskbarProcessor(),this._resourceID=await this.application.getResourceID(),this.dataExporterProviderStore(),this.dataExporterProviderStore(),this._taskbarProcessor.process(this.getTaskBarId(),this.taskbarManager,this.dataState,this.getTaskBarDisabledButtons()),void 0!==this.configName&&(null!=this.gridConfig||this._gridConfigAlreadyLoaded||(await this.addGridLegacyConfigName(),await this.loadGridConfig(),await this.loadFormConfig()))}componentDidRender(){this._rmPrecisionCustomValueFormatter.setGrid(this._grid),this.addGridCustomValueFormattters(),this.setFieldsProps(),this.setCustomRenders(),this.setCustomEditors()}componentWillLoad(){this.processMetadata(),this.onModeChange(),this.configDatasource(),this._rmPrecisionCustomValueFormatter=new Y,this._continuousInsertUtils=new st(this.application,this.resolveResourceID(),this.configName),this.enableGridInsert&&this._continuousInsertUtils.getConfig().then((t=>this.enableContinuousInsert=t))}componentDidLoad(){L.applyVarsGrid(this._element,this._grid),this.initKeyboardManager(),this.dataUnit.subscribe(this.dataUnitActionHandler.bind(this))}async dataUnitActionHandler(t){t.type!==l.EDITION_CANCELED&&t.type!==l.DATA_SAVED||this.dataUnit.isMultipleEdition&&this.goToView(x.GRID)}getMessage(t,i){var s;return null===(s=this.messagesBuilder)||void 0===s?void 0:s.getMessage(t,i)}disconnectedCallback(){var t;null===(t=this._keyboardManager)||void 0===t||t.unbindAllShortcutKeys()}setCustomRenders(){if(this._grid)for(const[t,i]of this._customRenders)this._grid.addGridCustomRender(t,i),this._customRenders.delete(t)}setCustomEditors(){if(this._grid&&this._form)for(const[t,i]of this._customEditors)this._grid.addCustomEditor(t,i),this._form.addCustomEditor(t,i),this._customEditors.delete(t)}configDatasource(){this._multiSelectionListDataSource.setApplication(this.application),this._multiSelectionListDataSource.setDataUnit(this.dataUnit)}setFieldsProps(){if(this._form)for(const[t,i]of this._fieldsProps){for(const s in i)this._form.setFieldProp(t,s,i[s]);this._fieldsProps.delete(t)}}getTaskBarId(){var t,i;return(null===(t=this.dataState)||void 0===t?void 0:t.isDirty)?Pt.FINISH_EDITION:this.dataUnit.isMultipleEdition?Pt.MULTIPLE_EDITION:(null===(i=this.dataState)||void 0===i?void 0:i.selectionInfo)&&!this.dataState.selectionInfo.isAllRecords()&&this.dataState.selectionInfo.length>0?this._currentViewMode===x.GRID?Pt.GRID_SELECTED:Pt.FORM_SELECTED:this._currentViewMode===x.GRID?Pt.GRID_REGULAR:Pt.FORM_REGULAR}initInMemoryDataUnit(){this._inMemoryLoader=new y(this._metadata,void 0,{autoLoad:this.autoLoad}),this.dataUnit=this._inMemoryLoader.dataUnit,this.dataUnitReady.emit(this.dataUnit)}setMetadata(t){return this._inMemoryLoader?this._inMemoryLoader.metadata=t:this.dataUnit&&(this.dataUnit.metadata=t),Promise.resolve()}setRecords(t){return this._inMemoryLoader?this._inMemoryLoader.records=t:this.dataUnit&&(this.dataUnit.records=t),Promise.resolve()}getRecords(){return Promise.resolve(this.dataUnit.records)}async openConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.open()}async closeConfigurator(){var t;null===(t=this._snkConfigurator)||void 0===t||t.close()}async updateConfig(){null==this._formConfigManager&&(this._formConfigManager=new it(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}processMetadata(){const t=this._element.querySelectorAll("snk-field-metadata"),i=[],s={fields:[],emptyConfig:!1};t.forEach((t=>{const e={name:t.getAttribute("name")||t.getAttribute("label"),label:t.getAttribute("label"),dataType:r[t.getAttribute("dataType")]||r.TEXT,userInterface:h[t.getAttribute("userInterface")]||h.SHORTTEXT,readOnly:"true"==t.getAttribute("readOnly"),required:"true"==t.getAttribute("required"),tab:t.getAttribute("tab")||void 0,visible:"false"!=t.getAttribute("visible")};s.fields.push({name:e.name,tab:e.tab,visible:e.visible}),i.push(e)})),i.length>0&&(this.formConfig||(this.formConfig=s),this._metadata={name:"SimpleCrud",label:"SimpleCrud",fields:i})}addGridCustomValueFormattters(){var t,i,s;const e=(null===(t=this._metadata)||void 0===t?void 0:t.fields)||(null===(s=null===(i=this.dataUnit)||void 0===i?void 0:i.metadata)||void 0===s?void 0:s.fields);if(!e)return;const n=[];e.forEach((t=>{var i;(null===(i=t.properties)||void 0===i?void 0:i.rm_precision)&&!n.includes(t.name)&&n.push(t.name)})),n.forEach((t=>{this.addCustomValueFormatter(t,this._rmPrecisionCustomValueFormatter)}))}onDataStateChange(t){this.dataState=Object.assign({},t.detail)}getTaskBarDisabledButtons(){var t,i,s,e,n,a;const o=[];return(null===(t=this.dataState)||void 0===t?void 0:t.hasNext)||o.push(O.NEXT),(null===(i=this.dataState)||void 0===i?void 0:i.hasPrevious)||o.push(O.PREVIOUS),(null===(e=null===(s=this.dataState)||void 0===s?void 0:s.selectionInfo)||void 0===e?void 0:e.isEmpty())&&o.push(O.FORM_MODE),(null===(a=null===(n=this.dataState)||void 0===n?void 0:n.selectionInfo)||void 0===a?void 0:a.length)>1&&o.push(O.CLONE),o}handleCancelEdit(){var t;(null===(t=this.dataState)||void 0===t?void 0:t.recordsIsEmpty)&&(this.goToView(x.GRID),this.dataUnit.clearSelection())}handleConfiguratorEvent(t,i){t.stopImmediatePropagation(),"SAVE"!==i?this.configuratorCancel.emit():this.configuratorSave.emit()}onSelectField(t){null!=t&&(this._fieldToGetFocus=t.value)}getFieldSearch(t,i){return null!=this._fieldSearch||(this._splitButtonForm=t,this._fieldSearch=D(i,(({argument:t})=>this.fieldsOptionLoader(t)),(t=>this.onSelectField(t)))),this._fieldSearch}getFormFields(){var t,i;return null!==(i=null===(t=this.formConfig)||void 0===t?void 0:t.fields)&&void 0!==i?i:this._formFields}handleFormSetFields(t){m.equals(this._formFields,t)||(this._formFields=null!=t?t:[])}fieldsOptionLoader(t){const i=null==t?void 0:t.toLowerCase(),s=this.getFormFields().map((t=>{var i;return null===(i=this.dataUnit)||void 0===i?void 0:i.getField(t.name)})).filter((t=>{var s,e;return(null===(s=t.name)||void 0===s?void 0:s.toLowerCase().includes(i))||(null===(e=t.label)||void 0===e?void 0:e.toLowerCase().includes(i))})).map((t=>({value:t.name,label:t.label})));return Promise.resolve(s)}isGridInsertActive(){return this.enableGridInsert&&this.dataUnit.hasNewRecord()}getColumnSearch(t,i){return null!=this._columnSearch||(this._splitButton=t,this._columnSearch=D(i,(({argument:t})=>new Promise((i=>{this._grid.filterColumns(t).then((t=>{i(t.filter((t=>!t.hidden)).map((t=>({label:t.label,value:t.name}))))}))}))),(t=>{null!=t&&this._grid.locateColumn(t.value)}))),this._columnSearch}getActionsList(){const t=[];if(this.enableGridInsert&&t.push(this._continuousInsertUtils.actionContinuousInsert(this.enableContinuousInsert,(()=>{this.enableContinuousInsert=!this.enableContinuousInsert,this._continuousInsertUtils.handleSaveConfig(this.enableContinuousInsert)}))),this.isGridInsertActive())return t;if(null!=this.taskbarManager&&null!=this.taskbarManager.getMoreOptions){const i=this.getTopTaskBarId();return t.concat(this.taskbarManager.getMoreOptions(i,this.configName,this.dataState,this.actionsList))}return t.concat(this.actionsList)}getSettingsListGrid(){return[{value:d.generateUUID(),label:this.getMessage("snkSimpleCrud.findColumn"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(t,i)=>this.getColumnSearch(t,i)}]}getSettingsListForm(){return[{value:d.generateUUID(),label:this.getMessage("snkSimpleCrud.findFields"),disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(t,i)=>this.getFieldSearch(t,i)}]}getTopTaskBarId(){var t;return(null===(t=this.dataState)||void 0===t?void 0:t.isDirty)?`snkGridTopTaskbar.finish_edition${k.PRIMARY}`:`snkGridTopTaskbar.regular${k.PRIMARY}`}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}gridConfigChangeHandler(t){t.stopPropagation(),this.configName&&H.saveGridConfig(t.detail,this.configName,this.resolveResourceID())}modalConfigChangeHandler(t){const i=t.detail;this._grid.setColumnsState(i.columns).then((()=>{this.setGridConfig(i),this.closeGridConfig(),this.dataExporterProviderStore()})),t.stopPropagation()}async dataExporterProviderStore(){if(null==this.dataUnit)return;if(null==this._grid)return;const t=new tt(this.dataUnit,this._grid);J.set("exporterProviders",Object.assign(Object.assign({},J.get("exporterProviders")),{[this.getDataExporterStoreKey()]:t}))}getDataExporterStoreKey(){return`SnkSimpleCrudDataExporter:${null==this.configName?this.dataUnit.name:this.configName}`}setGridConfig(t){this.gridConfig=t,Z.assertDefaultSorting(this.gridConfig,this.dataUnit)}setFormConfig(t,i){this.formConfig&&!i||(this.formConfig=t)}closeGridConfig(){this._showPopUpGridConfig=!1}getPageSize(){return this.mode===A.IN_MEMORY?0:null==this.pageSize?150:this.pageSize}resolveResourceID(){return d.isEmpty(this.resourceID)?this._resourceID:this.resourceID}getFormConfig(){var t;const i=null===(t=this._formConfigManager)||void 0===t?void 0:t.getConfig(this.dataUnit,this.ignoreReadOnlyFormFields);return this.configName||i?i:this.formConfig}updateFormConfig(){let t=this.formConfig;null==this.formLegacyConfigName&&(t=Object.assign(Object.assign({},this.formConfig),{fields:this.dataUnit.metadata.fields})),this.setFormConfig(t,!0),null==this._formConfigManager&&(this._formConfigManager=new it(this.configName,this.resolveResourceID())),this._formConfigManager.setConfig(this.formConfig)}handleDataUnitOnInsertionMode(){this.enableGridInsert||this.goToView(x.FORM)}async initKeyboardManager(){var t;this._keyboardManager=new f({propagate:!1,element:this._element});const i=this.dataUnit||await(null===(t=this._snkDataUnit)||void 0===t?void 0:t.getDataUnit());null!=i&&this._keyboardManager.bind("F7",(()=>i.saveData()),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.saveData"),element:this._element}).bind("F8",i.addRecord.bind(i),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.addRecord"),element:this._element}).bind("F9",i.removeSelectedRecords.bind(i),{description:this.getMessage("snkSimpleCrud.keyboardShortcuts.removeRecord"),element:this._element}).bind("Escape",(()=>{i.isDirty()&&i.cancelEdition()}),{debounceTime:1e3,description:this.getMessage("snkSimpleCrud.keyboardShortcuts.cancelAction"),element:this._element})}async handleFormConfigSaved(){await this.loadFormConfig(!0,!0)}focusToGrid(){this._grid.focus()}focusToForm(){this._form.focus()}renderTaskbarContent(t){var i;return s("snk-taskbar",{class:"ez-box--no-outline ez-box "+(this._currentViewMode===x.FORM?(this.outlineMode?"ez-box--outline":"ez-box--shadow-xsmall")+" ez-padding--small":""),dataUnit:this.dataUnit,primaryButton:(null===(i=this.dataState)||void 0===i?void 0:i.isDirty)?"SAVE":"INSERT","data-element-id":"grid_left",messagesBuilder:this.messagesBuilder,buttons:this._taskbarProcessor.buttons,actionsList:this.getActionsList(),actionsSettingsList:t===x.GRID?this.getSettingsListGrid():this.getSettingsListForm(),disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,"data-exporter-store-key":this.getDataExporterStoreKey(),slot:"leftButtons",presentationMode:k.SECONDARY,tabindex:"0"},s("slot",{name:"TASKBAR_CUSTOM_ELEMENTS"}))}render(){var t;if(null!=this.dataUnit)return s("snk-data-unit",{ref:t=>this._snkDataUnit=t,class:"simple-crud__container",dataUnit:this.dataUnit,useCancelConfirm:this.useCancelConfirm,onDataStateChange:t=>this.onDataStateChange(t),onCancelEdition:this.handleCancelEdit.bind(this),pageSize:this.getPageSize(),onInsertionMode:this.handleDataUnitOnInsertionMode.bind(this),onDataUnitReady:t=>this.dataUnitReady.emit(t.detail),onMessagesBuilderUpdated:t=>this.messagesBuilder=t.detail,onDataUnitFieldsHidded:this.updateFormConfig.bind(this),domainMessagesBuilder:this.domainMessagesBuilder},s("header",null,s("slot",{name:"snkSimpleCrudHeader"})),s("section",{class:`ez-box ez-box--no-outline ${this.outlineMode?"ez-box--outline":"ez-box--shadow"} simple-crud__container-section`,ref:t=>this._container=t,tabindex:"0"},s("ez-view-stack",{ref:t=>this._viewStack=t,"data-element-id":"simple-crud"},s("stack-item",null,s("ez-grid",{class:"ez-margin-bottom--large ez-box--no-outline",ref:t=>this._grid=t,dataUnit:this.dataUnit,config:this.gridConfig,"no-header":!0,multipleSelection:this.multipleSelection,onEzDoubleClick:()=>this.goToView(x.FORM),onConfigChange:t=>this.gridConfigChangeHandler(t),columnfilterDataSource:this.dataUnit.name&&this.dataUnit.name.includes(y.IN_MEMORY_DATA_UNIT_NAME)?void 0:this._multiSelectionListDataSource,useEnterLikeTab:this.useEnterLikeTab,autoFocus:this.autoFocus,enableGridInsert:this.enableGridInsert,enableContinuousInsert:this.enableContinuousInsert,enableLockManagerTaskbarClick:this.enableLockManagerTaskbarClick,enableLockManagerLoadingComp:this.enableLockManagerLoadingComp,outlineMode:this.outlineMode,tabindex:"0",paginationCounterMode:this.paginationCounterMode,canEdit:!this.disableGridEdition},this.renderTaskbarContent(x.GRID),s("div",{slot:"footer"},s("slot",{name:"snkSimpleCrudFooter"})))),s("stack-item",null,this.renderTaskbarContent(x.FORM),s("ez-form",{ref:t=>this._form=t,class:"ez-margin-top--large ez-box--no-outline",dataUnit:this.dataUnit,config:this.getFormConfig(),fieldToFocus:this._fieldToGetFocus,onEzFormSetFields:t=>this.handleFormSetFields(t.detail),onEzFormRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),elementFocusSearchField:this._container,tabindex:"0"}),s("slot",{name:"snkSimpleCrudFormFooter"}),s("snk-simple-form-config",{ref:t=>this._snkSimpleFormConfig=t,dataUnit:this.dataUnit,onSnkConfigSaved:this.handleFormConfigSaved.bind(this),configName:null!==(t=this.formLegacyConfigName)&&void 0!==t?t:this.configName,messagesBuilder:this.messagesBuilder})),this.messagesBuilder&&s("snk-configurator",{ref:t=>this._snkConfigurator=t,viewMode:this._currentViewMode,messagesBuilder:this.messagesBuilder,onConfigSelected:t=>this.goToView(t.detail),onOpenConfig:t=>this.openConfig(t.detail),showActionButtons:this.showConfiguratorButtons,onSave:t=>this.handleConfiguratorEvent(t,"SAVE"),onCancel:t=>this.handleConfiguratorEvent(t,"CANCEL"),resourceID:this.resolveResourceID(),customContainerId:this._customContainerId,layoutFormConfig:this.layoutFormConfig})),s("div",{id:`${this._customContainerId}`},s("slot",{name:"SnkConfigContainerSlot"}))),s("ez-popup",{size:"medium",heightMode:"auto",useHeader:!1,opened:this._showPopUpGridConfig,onEzClosePopup:()=>this.closeGridConfig()},s("snk-grid-config",{ref:t=>this._snkGridConfig=t,config:this.gridConfig,"data-element-id":this._element.getAttribute(v.DATA_ELEMENT_ID_ATTRIBUTE_NAME),selectedIndex:0,configName:this.configName,onConfigChange:t=>this.modalConfigChangeHandler(t),onConfigCancel:()=>this.closeGridConfig(),resourceID:this.resolveResourceID()})))}get _element(){return a(this)}static get watchers(){return{resourceID:["handleResourceIDChanged"],entityName:["onChangeEntityName"],mode:["onModeChange"],dataState:["observeDataState"],formLegacyConfigName:["observeFormLegacy"],gridLegacyConfigName:["observeGridLegacy"]}}};var Pt;!function(t){t.FORM_REGULAR="snkSimpleCrudTaskbar.form_regular",t.GRID_REGULAR="snkSimpleCrudTaskbar.grid_regular",t.FORM_SELECTED="snkSimpleCrudTaskbar.form_selected",t.GRID_SELECTED="snkSimpleCrudTaskbar.grid_selected",t.FINISH_EDITION="snkSimpleCrudTaskbar.finish_edition",t.MULTIPLE_EDITION="snkSimpleCrudTaskbar.multiple_edition"}(Pt||(Pt={})),Et.style=".sc-snk-simple-crud-h{display:flex;height:100%;width:100%;--snk-simple-crud-grid--min-height:300px}.simple-crud__container.sc-snk-simple-crud{display:grid;grid-template-rows:auto 1fr;height:100%;width:100%}.simple-crud__container-section.sc-snk-simple-crud{flex-wrap:unset;flex-direction:column}.simple-crud__form--hidden.sc-snk-simple-crud{display:none}ez-grid.sc-snk-simple-crud{--ez-grid__container--shadow:none;--ez-grid__container--shadow--outline:none;--ez-grid--min-height:var(--snk-simple-crud-grid--min-height)}ez-form.sc-snk-simple-crud{min-height:300px}";export{kt as snk_attach,wt as snk_default_filter,_t as snk_dynaform_form_view,yt as snk_filter_advanced_mode,Ct as snk_filter_assistent_mode,zt as snk_filter_detail,xt as snk_filter_modal_item,At as snk_image_input,St as snk_personalized_filter,Ot as snk_simple_bar,Et as snk_simple_crud}
@@ -0,0 +1 @@
1
+ import{r as s,h as t}from"./p-2c9d0870.js";import"./p-4dd574d6.js";import"./p-097d75b3.js";import{ApplicationContext as i}from"@sankhyalabs/core";import"./p-abcb646d.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8d1ef77a.js";import"./p-ff1990ad.js";import{F as a}from"./p-ec7c87bb.js";import"./p-9019a32f.js";import{FormLayout as e}from"@sankhyalabs/ezui/dist/collection/utils";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";const o=class{constructor(t){s(this,t),this._formConfigFetcher=new a,this.messagesBuilder=void 0,this.layoutType=e.SIDE_BY_SIDE}async save(){this._LayoutFormConfigSingleton.setConfig(this.layoutType),this._formConfigFetcher.saveLayoutFormConfig("formColCfg."+this._resourceID,{config:this.layoutType,newConfig:!0})}async componentWillLoad(){const s=i.getContextValue("__SNK__APPLICATION__");this._LayoutFormConfigSingleton=await(null==s?void 0:s.getLayoutFormConfig()),this._resourceID=await(null==s?void 0:s.getResourceID()),this.setLayoutInit()}setLayoutInit(){if(!this._LayoutFormConfigSingleton)return;const{config:s}=this._LayoutFormConfigSingleton;if(null==s)return void(this.layoutType=e.SIDE_BY_SIDE);const t=Number(s);this.layoutType=Object.values(e).includes(t)?t:e.SIDE_BY_SIDE}toggleLayout(s){this.layoutType=s}getMessage(s,t){var i;return null===(i=this.messagesBuilder)||void 0===i?void 0:i.getMessage(s,t)}render(){return t("div",{class:"ez-flex ez-flex--column"},t("div",{class:"ez-margin-bottom--small"},t("ez-check",{label:this.getMessage("snkLayoutFormConfig.cascadeLayout.label"),class:"ez-margin-bottom--small",onEzChange:()=>this.toggleLayout(e.CASCADE),value:this.layoutType===e.CASCADE}),t("snk-view-representation",{mode:e.CASCADE}),t("label",{class:"ez-label ez-margin--small ez-flex ez-text--medium"},this.getMessage("snkLayoutFormConfig.cascadeLayout.description"))),t("div",{class:"ez-margin-bottom--small"},t("ez-check",{label:this.getMessage("snkLayoutFormConfig.classicCascadeLayout.label"),class:"ez-margin-bottom--small",onEzChange:()=>this.toggleLayout(e.CLASSIC_CASCADE),value:this.layoutType===e.CLASSIC_CASCADE}),t("snk-view-representation",{mode:e.CLASSIC_CASCADE}),t("label",{class:"ez-label ez-margin--small ez-flex ez-text--medium"},this.getMessage("snkLayoutFormConfig.classicCascadeLayout.description"))),t("div",{class:"ez-margin-bottom--small"},t("ez-check",{label:this.getMessage("snkLayoutFormConfig.sideBySideLayout.label"),class:"ez-margin-bottom--small",onEzChange:()=>this.toggleLayout(e.SIDE_BY_SIDE),value:this.layoutType===e.SIDE_BY_SIDE}),t("snk-view-representation",{mode:e.SIDE_BY_SIDE}),t("label",{class:"ez-label ez-margin--small ez-flex ez-text--medium"},this.getMessage("snkLayoutFormConfig.sideBySideLayout.description"))),t("div",null,t("ez-check",{label:this.getMessage("snkLayoutFormConfig.classicSideBySideLayout.label"),class:"ez-margin-bottom--small",onEzChange:()=>this.toggleLayout(e.CLASSIC_SIDE_BY_SIDE),value:this.layoutType===e.CLASSIC_SIDE_BY_SIDE}),t("snk-view-representation",{mode:e.CLASSIC_SIDE_BY_SIDE}),t("label",{class:"ez-label ez-margin--small ez-flex ez-text--medium"},this.getMessage("snkLayoutFormConfig.classicSideBySideLayout.description"))))}};o.style=".sc-snk-layout-form-config-h{display:block}";export{o as snk_layout_form_config}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,g as e}from"./p-d8d8169b.js";import{ElementIDUtils as h,ApplicationContext as r}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";const o=class{constructor(i){t(this,i),this.valueChanged=s(this,"valueChanged",7),this._isSearchPlus=!1,this.config=void 0,this.value=void 0,this.errorMessage=void 0}async ezChangeListener(t){this.errorMessage=void 0,this.value=this._isSearchPlus?await this._searchInput.getValueAsync():this._searchInput.value,this.valueChanged.emit(this.value)}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}doSearch(t,s,i=!1){const e=r.getContextValue("__SNK__APPLICATION__"),h=i?e.executePreparedSearchPlus:e.executePreparedSearch;return new Promise(((i,r)=>{h.bind(e)(t,s,this.config.props.searchContext).then((t=>{i(t)})).catch((t=>{r(t)}))}))}async setFocus(){this._searchInput.setFocus()}async clearValue(){this.value=this.config.value,this._searchInput&&(this._searchInput.value=this.config.value)}getInputItem(){var t;return this._isSearchPlus=1==(null===(t=this.config.props)||void 0===t?void 0:t.useSearchPlus),i("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},i(this._isSearchPlus?"ez-search-plus":"ez-search",{id:this.config.id,suppressEmptyOption:!0,value:this.config.value,label:this.config.label,enabled:this.config.enabled,ref:t=>this._searchInput=t,optionLoader:({mode:t,argument:s})=>this.doSearch(t,s,this._isSearchPlus),errorMessage:this.errorMessage}))}render(){if(this.config&&this.config.type===a.SEARCH)return this.getInputItem()}get _element(){return e(this)}};export{o as snk_filter_search}
1
+ import{r as t,e as s,h as i,g as e}from"./p-2c9d0870.js";import{ElementIDUtils as h,ApplicationContext as r}from"@sankhyalabs/core";import{F as a}from"./p-ff1990ad.js";const o=class{constructor(i){t(this,i),this.valueChanged=s(this,"valueChanged",7),this._isSearchPlus=!1,this.config=void 0,this.value=void 0,this.errorMessage=void 0}async ezChangeListener(t){this.errorMessage=void 0,this.value=this._isSearchPlus?await this._searchInput.getValueAsync():this._searchInput.value,this.valueChanged.emit(this.value)}componentDidLoad(){this._element&&h.addIDInfo(this._element,"filterContentEditor")}doSearch(t,s,i=!1){const e=r.getContextValue("__SNK__APPLICATION__"),h=i?e.executePreparedSearchPlus:e.executePreparedSearch;return new Promise(((i,r)=>{h.bind(e)(t,s,this.config.props.searchContext).then((t=>{i(t)})).catch((t=>{r(t)}))}))}async setFocus(){this._searchInput.setFocus()}async clearValue(){this.value=this.config.value,this._searchInput&&(this._searchInput.value=this.config.value)}async getValueAsync(){return this.value=this._isSearchPlus?await this._searchInput.getValueAsync():this._searchInput.value,this.value}getInputItem(){var t;return this._isSearchPlus=1==(null===(t=this.config.props)||void 0===t?void 0:t.useSearchPlus),i("ez-tooltip",{active:!1===this.config.enabled,message:this.config.disabledMessage,type:"warning"},i(this._isSearchPlus?"ez-search-plus":"ez-search",{id:this.config.id,suppressEmptyOption:!0,value:this.config.value,label:this.config.label,enabled:this.config.enabled,ref:t=>this._searchInput=t,optionLoader:({mode:t,argument:s})=>this.doSearch(t,s,this._isSearchPlus),errorMessage:this.errorMessage}))}render(){if(this.config&&this.config.type===a.SEARCH)return this.getInputItem()}get _element(){return e(this)}};export{o as snk_filter_search}
@@ -0,0 +1 @@
1
+ import{r as i,e,h as t,f as s,i as n,g as o}from"./p-2c9d0870.js";import{ApplicationUtils as a}from"@sankhyalabs/ezui/dist/collection/utils";import{ObjectUtils as r,StringUtils as d,ArrayUtils as l}from"@sankhyalabs/core";import{S as c}from"./p-cbb8e351.js";import{a as h,G as u}from"./p-9019a32f.js";import{S as f,f as g,I as m}from"./p-46d7e2de.js";const p=class{constructor(t){i(this,t),this.configClose=e(this,"configClose",7),this.saveConfig=e(this,"saveConfig",7),this.isEditingGuide=!1,this.isEditingGroup=!1,this.configOptions=[],this.selectedConfig=void 0,this.messagesBuilder=void 0,this.hasChanges=!1,this.optionConfigChanged=!1}handleIsEditingGuideName({detail:i}){this.isEditingGuide=i}handleIsEditingGroupName({detail:i}){this.isEditingGroup=i}saveFormConfig(){if(this.isEditingGuide||this.isEditingGroup){const i=this.getMessage("snkFormConfig.confirm.title"),e=this.getMessage(this.isEditingGuide?"snkFormConfig.alert.titleGuideEditing":"snkFormConfig.alert.titleGroupEditing");a.alert(i,e)}else this.saveConfig.emit()}async closeFormConfig(){if(this.hasChanges){const i=this.getMessage("snkFormConfig.confirm.title"),e=this.getMessage("snkFormConfig.confirm.cancel");if(!await a.confirm(i,e))return}this.configClose.emit()}getMessage(i,e){return this.messagesBuilder.getMessage(i,e)}openConfirmDialog(i="",e=this.getMessage("snkFormConfig.confirm.title")){return a.confirm(e,i)}async applyOptionConfig(){var i,e;const t=null!==(e=null===(i=this.selectedConfig)||void 0===i?void 0:i.name)&&void 0!==e?e:this.getMessage("snkFormConfig.configs.selectedConfig"),s=this.getMessage("snkFormConfig.confirm.apply").replace("{0}",t);await this.openConfirmDialog(s)&&this.saveConfig.emit()}renderSaveActions(){if(this.hasChanges||this.optionConfigChanged)return t("div",{class:"right-group"},t("ez-button",{title:this.getMessage("snkFormConfig.actions.cancel"),label:this.getMessage("snkFormConfig.actions.cancel"),onClick:this.closeFormConfig.bind(this),size:"medium"}),t("ez-button",this.hasChanges?{title:this.getMessage("snkFormConfig.actions.save"),label:this.getMessage("snkFormConfig.actions.save"),class:"ez-button--primary ez-padding-left--medium",onClick:()=>this.saveFormConfig(),size:"medium"}:{title:this.getMessage("snkFormConfig.actions.save"),label:this.getMessage("snkFormConfig.applyConfig"),class:"ez-button--primary ez-padding-left--medium",onClick:async()=>await this.applyOptionConfig(),size:"medium"}))}render(){return t(s,null,t("div",{class:"left-group"},t("ez-button",{mode:"icon",title:this.getMessage("snkFormConfig.goBackTitle"),iconName:"arrow_back",size:"small",onClick:this.closeFormConfig.bind(this),id:"formConfigToBack"}),t("h1",{class:"ez-title ez-title--primary ez-title--extra-large ez-padding--small"},this.getMessage("snkFormConfig.title")),t("snk-dynaform-configs-button",{hasChanges:this.hasChanges,configOptions:this.configOptions,selectedConfig:this.selectedConfig,messagesBuilder:this.messagesBuilder})),this.renderSaveActions())}};p.style=".sc-snk-dynaform-config-header-h{display:flex;padding-top:var(--space--12, 12px);align-items:center;width:100%;justify-content:space-between}.left-group.sc-snk-dynaform-config-header{display:flex;gap:var(--space--8, 8px);align-items:center}.right-group.sc-snk-dynaform-config-header{display:flex}";const b=class{constructor(t){i(this,t),this.formConfigOptionSelected=e(this,"formConfigOptionSelected",7),this.configOptions=[],this.selectedConfig=void 0,this.hasChanges=!1,this.messagesBuilder=void 0}getMessage(i,e){return this.messagesBuilder.getMessage(i,e)}async showShareConfigOptions(){this._refOptionsPopover&&this._refShareConfigBtn&&await this._refOptionsPopover.showUnder(this._refShareConfigBtn)}async handleSelectOption(i){if(!r.equals(i,this.selectedConfig)){if(this.hasChanges){const i=this.getMessage("snkFormConfig.confirm.title"),e=this.getMessage("snkFormConfig.confirm.cancel");if(!await a.confirm(i,e))return}this.selectedConfig=i,this.formConfigOptionSelected.emit(i),await this._refOptionsPopover.hide()}}getButtonLabel(){var i,e;return null!==(e=null===(i=this.selectedConfig)||void 0===i?void 0:i.name)&&void 0!==e?e:this.getMessage("snkFormConfig.configs.buttonLabel")}renderConfigOptions(){return this.configOptions.map((i=>t("div",{class:"main-item",onClick:async()=>await this.handleSelectOption(i)},t("span",{class:"item-label"}," ",i.name),this.renderCheckIcon(i))))}renderCheckIcon(i){if(this.selectedConfig&&this.selectedConfig.origin===i.origin)return t("ez-icon",{iconName:"check"})}render(){return t(s,null,t("ez-button",{ref:i=>this._refShareConfigBtn=i,label:this.getButtonLabel(),onClick:async()=>await this.showShareConfigOptions()},t("ez-icon",{slot:"rightIcon",iconName:"chevron-down"})),t("ez-popover-plus",{ref:i=>this._refOptionsPopover=i,autoClose:!0,overlayType:"none"},t("div",{class:"dropdown-container"},this.renderConfigOptions())))}};b.style=".dropdown-container.sc-snk-dynaform-configs-button{font-family:'Roboto';font-size:12px;font-weight:400;display:flex;flex-direction:column;color:#2b3a54;width:200px}.main-item.sc-snk-dynaform-configs-button{padding:12px;font-size:14px;cursor:pointer;transition:all .2s ease-in-out;display:flex;flex-direction:row;gap:8px;align-items:center;justify-content:start}.main-item.sc-snk-dynaform-configs-button ez-icon.sc-snk-dynaform-configs-button{--ez-icon--color:#008561}.main-item.sc-snk-dynaform-configs-button:nth-of-type(1){padding-bottom:6px}.main-item.sc-snk-dynaform-configs-button:nth-of-type(2){padding-top:6px}.main-item.sc-snk-dynaform-configs-button:hover{background-color:#FAFCFF}.item-label.sc-snk-dynaform-configs-button{display:flex}";const v=class{constructor(t){i(this,t),this.isEditingGuideName=e(this,"isEditingGuideName",7),this.isEditingGroupName=e(this,"isEditingGroupName",7),this.layoutChanged=e(this,"layoutChanged",7),this.setFieldListAsAvailable=e(this,"setFieldListAsAvailable",7),this.guideRenamed=e(this,"guideRenamed",7),this.ID_GROUPS="container-groups",this.ID_FIELDS="container-fields",this.reservedGuideNames=[h.main.toLowerCase(),h.general.toLocaleLowerCase()],this.groupsListMemory=[],this.groupsRefList=[],this.sortableInstances=[],this.isEditGuideNameActive=!1,this.selectedGuide=void 0,this.groupsList=[],this.guideNames=[],this.dataUnit=void 0,this.isMainSection=!1,this.messagesBuilder=void 0}onMessagesBuilderChange(){this.setCustomCSSProperties()}handleFieldConfigChanged({detail:i}){var e;if((null===(e=this.selectedGuide)||void 0===e?void 0:e.name)&&i.tab&&i.tab!==this.selectedGuide.name)return;const t=this.groupsListMemory.find((e=>e.name===i.group));if(!t)return;const s=t.fields.map((e=>e.name===i.name?i:e)),n=this.groupsListMemory.map((i=>i.name===t.name?{name:i.name,fields:s}:i));this.applyGroupUpdate(n)}observeSelectedGuide(){this.isEditGuideNameActive=!1,n(this),this.isEditingGroupName.emit(!1)}observeGroupList(i){this.groupsListMemory=[...i]}observeIsEditGuideNameActive(i){this.isEditingGuideName.emit(i)}async addFieldToLayout(i){i.group=u.noGroup,i.tab=this.selectedGuide.name;const e=this.getFixedFieldsGroup(),t={name:u.noGroup,fields:e?[...e.fields,i]:[i]},s=e?[t,...this.groupsListMemory.slice(1)]:[t,...this.groupsListMemory];this.applyGroupUpdate(s)}getFixedFieldsGroup(){return this.groupsListMemory.find((i=>i.name===u.noGroup))}getMessage(i,e){return this.messagesBuilder.getMessage(i,e)}handleAddGroup(){const i={name:this.buildNewGroupName(),fields:[]},e=[...this.groupsListMemory,i];this.applyGroupUpdate(e)}buildNewGroupName(){var i,e;const t=this.getMessage("snkFormConfig.form.newGroup"),s=null!==(e=null===(i=this.groupsListMemory.filter((i=>i.name.includes(t))))||void 0===i?void 0:i.length)&&void 0!==e?e:0;return 0===s?t:`${t} (${s})`}makeDynamicFieldsContainersDraggable(){this.groupsList.filter((i=>i.name!==u.noGroup)).forEach((i=>{this.makeFieldContainerDraggable(this.getFieldsContainerId(i.name))}))}getInstanceSuffix(){var i,e;return d.replaceBlankCharacters(null!==(e=null===(i=this.selectedGuide)||void 0===i?void 0:i.name)&&void 0!==e?e:"")}getGroupsContainerId(){return`${this.ID_GROUPS}-${this.getInstanceSuffix()}`}getNoGroupContainerId(){return`${u.noGroup}-${this.getInstanceSuffix()}`}getFieldsContainerId(i){return`${this.ID_FIELDS}-${this.getInstanceSuffix()}-${d.replaceBlankCharacters(i)}`}handleSortGroups(i){var e;const t=null===(e=i.to)||void 0===e?void 0:e.children;if(!t)return;const s=Array.from(t).map((i=>i.getAttribute("data-group-name"))),n=[],o=this.getFixedFieldsGroup();o&&n.push(o),s.forEach((i=>{const e=this.groupsListMemory.find((e=>e.name===i));e&&n.push(e)})),this.applyGroupUpdate(n)}handleFieldsChanged(i){let e=[...this.groupsListMemory];e=[...this.handleFieldsOnGroupUpdate(e,i,f.FROM)],e=[...this.handleFieldsOnGroupUpdate(e,i,f.TO)],this.applyGroupUpdate(e)}applyGroupUpdate(i){var e;return null===(e=this.groupsRefList)||void 0===e||e.forEach((i=>null==i?void 0:i.cancelEdition())),!r.equals(i,this.groupsListMemory)&&(this.groupsListMemory=[...i],this.layoutChanged.emit(this.groupsListMemory),!0)}handleFieldsOnGroupUpdate(i,e,t){const s=e[t];return this.el.contains(s)?s.id===m?i:this.updateGroupList(i,s,t,e):i}updateGroupList(i,e,t,s){const n=e.getAttribute("data-group-name"),o={name:n,fields:g(s,t,n,this.selectedGuide.name)};return this.upsertGroup(i,o)}upsertGroup(i,e){return i.some((i=>i.name===e.name))?this.replaceGroup(i,e):e.name===u.noGroup?[e,...i]:[...i,e]}replaceGroup(i,e){return i.map((i=>i.name===e.name?e:i))}destroySortableInstances(){this.sortableInstances.forEach((i=>{var e;try{null===(e=null==i?void 0:i.destroy)||void 0===e||e.call(i)}catch(i){}})),this.sortableInstances=[]}makeGroupsDraggable(){try{const i=this.getContainerElement(this.getGroupsContainerId());if(!i)return;this.sortableInstances.push(new c(i,{group:"groups",ghostClass:"ghost",direction:"horizontal",animation:15,onSort:i=>this.handleSortGroups(i)}))}catch(i){console.error(this.getMessage("snkFormConfig.errors.failMakeGroupsDraggable"),this.getGroupsContainerId())}}makeFieldContainerDraggable(i){try{const e=this.getContainerElement(i);if(!e)return;this.sortableInstances.push(new c(e,{group:"fields",ghostClass:"ghost",direction:"vertical",animation:15,onAdd:i=>this.handleFieldsChanged(i),onRemove:i=>this.handleFieldsChanged(i),onSort:i=>this.handleFieldsChanged(i)}))}catch(e){console.error(this.getMessage("snkFormConfig.errors.failMakeFieldContainerDraggable"),i)}}getContainerElement(i){return this.el.querySelector(`[id="${i}"]`)}handleSetFieldAsAvailable(i){var e;const t=null!==(e=i.group)&&void 0!==e?e:u.noGroup,s=this.groupsListMemory.find((i=>i.name===t)).fields.filter((e=>e.name!==i.name)),n=[...this.replaceGroup(this.groupsListMemory,{name:t,fields:s})];this.applyGroupUpdate(n)}removeGroup(i){var e,t;const s=null!==(t=null===(e=this.groupsListMemory.find((e=>e.name===i.name)))||void 0===e?void 0:e.fields)&&void 0!==t?t:[],n=[...this.groupsListMemory.filter((e=>e.name!==i.name))];this.applyGroupUpdate(n)&&this.setFieldListAsAvailable.emit(s)}handleRenameGroup(i){const{value:e,newValue:t}=i.detail,s=this.groupsListMemory.map((i=>{if(i.name!==e)return Object.assign({},i);const s=i.fields.map((i=>Object.assign(Object.assign({},i),{group:t})));return{name:t,fields:s}}));this.applyGroupUpdate(s)}canSaveGroup(i,e){if(!this.groupsList.some((e=>{var t;return(null!==(t=e.name)&&void 0!==t?t:"").toLocaleLowerCase()===(null!=i?i:"").toLocaleLowerCase()})))return!0;const t=this.getMessage("snkFormConfig.confirm.title"),s=this.buildDuplicatedGroupNameContent(i);return a.alert(t,s).then((()=>{var i;return null===(i=this.groupsRefList[e])||void 0===i?void 0:i.applyFocusTextEdit()})),!1}buildDuplicatedGroupNameContent(i){const e=this.selectedGuide.name;return`\n ${this.getMessage("snkFormConfig.alert.titleGroupExists")}\n <b>${i}</b>\n ${this.getMessage("snkFormConfig.alert.inTab")}\n <b>${e===h.main?this.getMessage("snkFormConfig.form.mainArea"):e}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}buildDuplicatedTabNameContent(i){return`\n ${this.getMessage("snkFormConfig.alert.titleGuideExists")}\n <b>${i}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}buildReservedTabNameContent(i){return`\n ${this.getMessage("snkFormConfig.alert.titleGuideReservedName")}\n <br/><br/>\n <b>${i}</b>.\n <br/><br/>\n ${this.getMessage("snkFormConfig.alert.infoValidTitle")}\n `}renderFields(i){if(0!==i.length)return i.map((i=>t("snk-dynaform-field-item",{key:i.name,fieldConfig:i,onLayoutConfig:!0,dataUnit:this.dataUnit,messagesBuilder:this.messagesBuilder,onSetFieldAsAvailable:i=>this.handleSetFieldAsAvailable(i.detail)})))}renderDraggableGroups(){return this.groupsList.filter((i=>i.name!==u.noGroup)).map(((i,e)=>{var s;return t("div",{key:i.name,class:"group-config","data-group-name":i.name},t("ez-collapsible-box",{ref:i=>this.groupsRefList[e]=i,label:i.name,headerSize:"large",editable:!0,removable:!0,"icon-placement":"left",onEzRemove:()=>this.removeGroup(i),onEzSaveEditLabel:i=>this.handleRenameGroup(i),onEzEditLabelMode:({detail:i})=>this.isEditingGroupName.emit(i),conditionalSave:i=>this.canSaveGroup(i,e)},t("div",{id:this.getFieldsContainerId(i.name),class:"group-content "+((null===(s=i.fields)||void 0===s?void 0:s.length)?"":"empty-content"),"data-group-name":i.name},this.renderFields(i.fields))))}))}renderFixedFields(){var i,e;const t=null!==(e=null===(i=this.groupsList.find((i=>i.name===u.noGroup)))||void 0===i?void 0:i.fields)&&void 0!==e?e:[];return this.renderFields(t)}handleRenameGuide(i){const{value:e,newValue:t}=i.detail;if(this.isEditGuideNameActive=!1,t===e)return;const s=this.guideNames.includes(t.toLowerCase()),n=this.reservedGuideNames.includes(t.toLowerCase());if(n||s){const i=this.getMessage("snkFormConfig.confirm.title"),e=n?this.buildReservedTabNameContent(t):this.buildDuplicatedTabNameContent(t);a.alert(i,e).then((()=>this._refTextEdit.applyFocusSelect()))}else this.guideRenamed.emit(t)}cancelEditGuideName(){this.isEditGuideNameActive=!1}async startGuideNameEdition(){this.isEditGuideNameActive=!0,setTimeout((async()=>{await this._refTextEdit.applyFocusSelect()}),200)}getTextEditStyle(){return{fontSize:"20px",fontWeight:"500",fontFamily:"Roboto"}}renderGuideName(){var i,e;return this.isEditGuideNameActive?t("div",{class:"guide-header"},t("ez-text-edit",{class:"collapsible-box__text-edit",ref:i=>this._refTextEdit=i,value:null===(i=this.selectedGuide)||void 0===i?void 0:i.label,styled:this.getTextEditStyle(),onSaveEdition:i=>this.handleRenameGuide(i),onCancelEdition:()=>this.cancelEditGuideName()})):t("div",{class:"guide-header"},t("span",{class:"guide-header-label"},null===(e=this.selectedGuide)||void 0===e?void 0:e.label),this.renderEditGuideNameButton())}renderEditGuideNameButton(){var i;if(!this.isMainSection&&(null===(i=this.selectedGuide)||void 0===i?void 0:i.name)!==h.main)return t("ez-button",{mode:"icon",class:"ez-button--tertiary",onClick:()=>this.startGuideNameEdition(),size:"medium",iconName:"edit",title:this.getMessage("snkFormConfig.buttons.rename")})}setCustomCSSProperties(){document.documentElement.style.setProperty("--empty-content-message",`"${this.getMessage("snkFormConfig.form.labelDropField")}"`),document.documentElement.style.setProperty("--no-group-message",`"${this.getMessage("snkFormConfig.form.subTitleInfo")}"`)}componentWillLoad(){var i;this.groupsListMemory=[...null!==(i=this.groupsList)&&void 0!==i?i:[]]}componentDidRender(){this.destroySortableInstances(),this.makeGroupsDraggable(),this.makeDynamicFieldsContainersDraggable(),this.makeFieldContainerDraggable(this.getNoGroupContainerId()),this.setCustomCSSProperties()}disconnectedCallback(){this.destroySortableInstances()}render(){var i;if(!this.selectedGuide)return t(s,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},t("span",{class:"no-guide-selected"},this.getMessage("snkFormConfig.form.noGuideSelected")));if(this.selectedGuide.isCustom||this.selectedGuide.isDetail)return t(s,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"},t("div",{class:"message-container"},t("h1",{class:"no-guide-selected"},this.getMessage("snkFormConfig.form.canNotEditCustomGuide")),t("span",{class:"message-config-detail"},this.getMessage("snkFormConfig.form.canNotEditDetailGuide"))));const e=this.isMainSection||(null===(i=this.selectedGuide)||void 0===i?void 0:i.name)===h.main;return t(s,{class:"ez-flex-item--auto ez-size-height--full ez-box ez-padding--medium content-container"+(e?" is-main-section":"")},this.renderGuideName(),t("div",{class:"layout-container"},t("ez-scroller",{direction:"vertical",activeShadow:!0},t("div",{class:"no-group-container"},t("div",{id:this.getNoGroupContainerId(),class:"group-content","data-group-name":u.noGroup},this.renderFixedFields())),t("hr",null),t("div",{id:this.getGroupsContainerId(),class:"groups-container"},this.renderDraggableGroups()))),t("div",{class:"add-group-container",onClick:this.handleAddGroup.bind(this)},t("ez-icon",{slot:"leftIcon",iconName:"plus"}),t("span",null,this.getMessage("snkFormConfig.form.createNewGroup"))))}get el(){return o(this)}static get watchers(){return{messagesBuilder:["onMessagesBuilderChange"],selectedGuide:["observeSelectedGuide"],groupsList:["observeGroupList"],isEditGuideNameActive:["observeIsEditGuideNameActive"]}}};v.style='.sc-snk-dynaform-fields-layout-h{display:flex;padding:12px;box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));border-radius:var(--border--radius-medium, 6px);height:100%;min-height:0;flex-direction:column;box-sizing:border-box}.is-main-section.sc-snk-dynaform-fields-layout-h{height:100%;border:1px solid var(--color--gray-90, #EAEAEA);flex:1 1 auto;min-height:0;flex-direction:row;overflow:auto}.is-main-section.sc-snk-dynaform-fields-layout-h .layout-container.sc-snk-dynaform-fields-layout{flex:1 1 auto;min-height:0;width:100%}.layout-container.sc-snk-dynaform-fields-layout{container-type:inline-size;display:flex;flex-direction:column;overflow:hidden;flex:1 1 auto;min-height:0;width:100%}.layout-container.sc-snk-dynaform-fields-layout>ez-scroller.sc-snk-dynaform-fields-layout{flex:1 1 auto;min-height:0;display:flex;flex-direction:column}.guide-header.sc-snk-dynaform-fields-layout{display:flex;width:100%;font-size:20px;border-bottom:1px solid #dce0e8;margin-bottom:6px;align-items:center;height:45px}.guide-header.sc-snk-dynaform-fields-layout ez-button.sc-snk-dynaform-fields-layout{transition:all 0.2s ease-in-out;visibility:hidden;opacity:0}.guide-header.sc-snk-dynaform-fields-layout:hover ez-button.sc-snk-dynaform-fields-layout{visibility:visible;opacity:1}.guide-header-label.sc-snk-dynaform-fields-layout{display:block;padding:10px 0}.group-config.sc-snk-dynaform-fields-layout{padding:12px 0;display:flex;flex-direction:column;width:100%}.group-content.sc-snk-dynaform-fields-layout{display:grid;gap:12px;min-height:65px;width:100%;padding:6px 0;grid-template-columns:repeat(auto-fill, minmax(250px, 1fr))}.group-content.empty-content.sc-snk-dynaform-fields-layout{position:relative}.group-content.empty-content.sc-snk-dynaform-fields-layout::before{content:var(--empty-content-message, "Arraste e solte um campo aqui");color:#cbcfd7;font-size:16px;font-weight:500;text-align:center;position:absolute;inset:0;display:flex;align-items:center;justify-content:center;pointer-events:none;transition:opacity 0.3s;height:100%;box-sizing:border-box;padding:10px;background:#f9f9f9;border:1px dashed #dce0e8;border-radius:6px}.no-group-container.sc-snk-dynaform-fields-layout{padding:12px 0;width:100%;border-bottom:1px solid #dce0e8}.no-group-container.sc-snk-dynaform-fields-layout::before{content:var(--no-group-message, "Inclua estes campos nos grupos ou deixe-os separados no topo do formulário");width:100%;display:block;font-size:16px;font-weight:400;color:#AFB6C0;padding-bottom:12px}.add-group-container.sc-snk-dynaform-fields-layout{display:flex;align-items:center;border-top:1px solid #dce0e8;padding-top:22px;padding-bottom:12px;gap:6px;cursor:pointer;justify-content:center;width:100%;height:55px}.no-guide-selected.sc-snk-dynaform-fields-layout{display:block;margin:auto;font-size:24px;color:#AFB6C0;font-weight:500}.message-container.sc-snk-dynaform-fields-layout{margin:auto;display:flex;flex-direction:column;justify-content:center;align-items:center}.message-config-detail.sc-snk-dynaform-fields-layout{display:block;margin:auto;font-size:var(--font-size--medium, 16px);color:#AFB6C0;font-weight:var(--font-weight--medium, 500)}.ghost.sc-snk-dynaform-fields-layout{opacity:.5;background:#c8fbe2}';const y=class{constructor(t){i(this,t),this.fieldListChanged=e(this,"fieldListChanged",7),this.availableFields=[],this.dataUnit=void 0,this.filterTerm="",this.messagesBuilder=void 0}onAddField(i){const e=this.addItemInPosition(i.newIndex,i.item.fieldConfig);this.fieldListChanged.emit(e)}addItemInPosition(i,e){return[...this.availableFields.slice(0,i),e,...this.availableFields.slice(i)]}onRemoveField(i){const e=i.item,t=e.fieldConfig.name,s=[...this.availableFields.filter((i=>i.name!==t))];this.fieldListChanged.emit(s),requestAnimationFrame((()=>e.remove()))}renderFields(){return l.applyStringFilter(this.filterTerm,this.availableFields).map((i=>t("snk-dynaform-field-item",{key:i.name,dataUnit:this.dataUnit,fieldConfig:i,messagesBuilder:this.messagesBuilder})))}getCountText(){return this.availableFields.length?1===this.availableFields.length?this.getMessage("snkFormConfig.availableFields.labelOneField"):`${this.availableFields.length} ${this.getMessage("snkFormConfig.availableFields.labelAvailableFields")}`:this.getMessage("snkFormConfig.availableFields.labelNoFields")}initializeDraggableContainer(){new c(this.el.querySelector(`#${m}`),{group:"fields",direction:"vertical",ghostClass:"ghost",animation:15,onAdd:i=>this.onAddField(i),onRemove:i=>this.onRemoveField(i)})}getMessage(i,e){var t;return null===(t=this.messagesBuilder)||void 0===t?void 0:t.getMessage(i,e)}componentDidRender(){this.initializeDraggableContainer()}render(){return t(s,{class:"ez-col ez-col--sd-4 ez-col--tb-4 ez-padding--medium"},t("span",{class:"fields-label ez-padding-bottom--small"},this.getMessage("snkFormConfig.availableFields.title")),t("ez-filter-input",{class:"filter-input",slot:"content",mode:"slim",label:this.getMessage("snkFormConfig.availableFields.labelSearchField"),onEzChange:i=>this.filterTerm=i.detail}),t("span",{class:"fields-count"},this.getCountText()),t("ez-scroller",{direction:"vertical",activeShadow:!0},t("div",{id:m,class:"fields-container"},this.renderFields())))}get el(){return o(this)}};y.style=".sc-snk-dynaform-fields-selector-h{width:33.33333%;display:flex;box-shadow:var(--shadow--small, 0 0 16px rgba(0, 38, 111, 0.07));border-radius:var(--border--radius-medium, 6px);height:var(--snk-form-config-container-height);max-width:260px}.fields-label.sc-snk-dynaform-fields-selector{display:block;font-size:16px;font-weight:500;width:100%}.fields-count.sc-snk-dynaform-fields-selector{display:block;color:#AFB6C0;font-size:14px;padding:12px 0;font-weight:400;width:100%}.fields-container.sc-snk-dynaform-fields-selector{display:flex;flex-direction:column;gap:12px;height:calc(100vh - 220px);width:100%}.ghost.sc-snk-dynaform-fields-selector{opacity:.5;background:#c8fbe2}.filter-input.sc-snk-dynaform-fields-selector{padding-right:var(--space--2xs, 8px)}";const k=class{constructor(t){i(this,t),this.guideSelected=e(this,"guideSelected",7),this.guideListChanged=e(this,"guideListChanged",7),this.guideDeleted=e(this,"guideDeleted",7),this.createNewGuide=e(this,"createNewGuide",7),this.sortLogic=(i,e)=>{var t,s;return(null!==(t=i.order)&&void 0!==t?t:Number.MAX_VALUE)-(null!==(s=e.order)&&void 0!==s?s:Number.MAX_VALUE)},this.handleAddGuide=()=>{this.createNewGuide.emit()},this.mainGuide=void 0,this.visibleGuides=[],this.hiddenGuides=[],this.guidesList=[],this.selectedGuide=void 0,this.mainGuideName=void 0,this.messagesBuilder=void 0}observeGuidesList(i){this.initGuidesConfig(i)}observeMainGuideName(){this.initGuidesConfig(this.guidesList)}observeSelectedGuide(i){this.guideSelected.emit(i)}componentWillLoad(){this.initGuidesConfig(this.guidesList)}getMessage(i,e){return this.messagesBuilder.getMessage(i,e)}initGuidesConfig(i){const e=this.mainGuideName,t=i=>!!e&&i.name===e,s=i.filter((i=>i.visible&&!t(i))),n=i.filter((i=>!i.visible&&!t(i)));this.visibleGuides=[...s].sort(this.sortLogic),this.hiddenGuides=[...n].sort(this.sortLogic),this.mainGuide=i.find((i=>t(i)))}handleSelectGuide(i,e){e.stopPropagation(),this.selectedGuide=i}toggleGuideVisibility(i,e){e.stopPropagation();const t=Object.assign(Object.assign({},i),{visible:!i.visible});let s,n;i.visible?(s=this.visibleGuides.filter((e=>e.name!==i.name)),n=[...this.hiddenGuides,t]):(s=[...this.visibleGuides,t],n=this.hiddenGuides.filter((e=>e.name!==i.name))),this.applyGuidesUpdate([...s,...n])}adjustListOrder(i){return i.map(((i,e)=>Object.assign(Object.assign({},i),{order:e})))}applyGuidesUpdate(i){let e=this.adjustListOrder(i);this.mainGuide&&(e=[this.mainGuide,...e]),r.equals(e,this.guidesList)||this.guideListChanged.emit(e)}async handleDeleteGuide(i,e){e.stopPropagation();const t=this.getMessage("snkFormConfig.confirm.title"),s=this.getMessage("snkFormConfig.confirm.deleteGuide").replace("{0}",i.label);if(!await a.confirm(t,s))return;this.guideDeleted.emit(i);const n=this.getMessage("snkFormConfig.info.successfullyGuideDeleted").replace("{0}",i.label);a.info(n)}buildTabs(){return this.visibleGuides.map(((i,e)=>({tabKey:i.name,label:i.label,index:e})))}handleTabChange(i){var e;if(!i)return;const t=this.guidesList.find((e=>e.name===i.tabKey));t&&t.name!==(null===(e=this.selectedGuide)||void 0===e?void 0:e.name)&&(this.selectedGuide=t)}handleReorder(i){const e=i.map((i=>this.visibleGuides.find((e=>e.name===i.tabKey)))).filter(Boolean);this.applyGuidesUpdate([...e,...this.hiddenGuides])}renderTabActions(){return this.visibleGuides.map(((i,e)=>{const s=i.isCustom||i.isDetail;return t("div",{key:i.name,slot:`tab${e}`,class:"tab-actions",onClick:i=>i.stopPropagation()},t("ez-button",{mode:"icon",class:"ez-button--tertiary tab-action-btn",size:"small",iconName:"eye-off",title:this.getMessage("snkFormConfig.guidesConfigurator.actions.hide"),onClick:e=>this.toggleGuideVisibility(i,e)}),t("ez-button",{mode:"icon",class:"ez-button--tertiary tab-action-btn",size:"small",iconName:"delete",isDisabled:s,title:this.getMessage(s?"snkFormConfig.guidesConfigurator.canNotDeleteCustomGuide":"snkFormConfig.guidesConfigurator.actions.delete"),onClick:e=>this.handleDeleteGuide(i,e)}))}))}renderHiddenGuidesBar(){return 0===this.hiddenGuides.length?null:t("div",{class:"hidden-guides-bar"},t("span",{class:"hidden-guides-label"},this.getMessage("snkFormConfig.guidesConfigurator.hiddenGuides"),":"),this.hiddenGuides.map((i=>{const e=i.isCustom||i.isDetail;return t("div",{key:i.name,class:"hidden-guide-chip",title:i.label},t("span",{class:"chip-label",onClick:e=>this.handleSelectGuide(i,e)},i.label),t("ez-button",{mode:"icon",class:"ez-button--tertiary",size:"small",iconName:"eye",title:this.getMessage("snkFormConfig.guidesConfigurator.actions.show"),onClick:e=>this.toggleGuideVisibility(i,e)}),t("ez-button",{mode:"icon",class:"ez-button--tertiary",size:"small",iconName:"delete",isDisabled:e,title:this.getMessage(e?"snkFormConfig.guidesConfigurator.canNotDeleteCustomGuide":"snkFormConfig.guidesConfigurator.actions.delete"),onClick:e=>this.handleDeleteGuide(i,e)}))})))}render(){var i;const e=this.buildTabs();return t("div",{class:"guides-tab-configurator"},t("div",{class:"tab-bar-row"},t("ez-tabselector",{class:"guides-tabselector",tabs:e,selectedTab:null===(i=this.selectedGuide)||void 0===i?void 0:i.name,reorderable:!0,onEzChange:i=>this.handleTabChange(i.detail),onEzReorder:i=>this.handleReorder(i.detail)},this.renderTabActions()),t("ez-button",{label:this.getMessage("snkFormConfig.guidesConfigurator.createNewGuide"),variant:"secondary",size:"medium",leftIconName:"plus",onClick:this.handleAddGuide})),this.renderHiddenGuidesBar())}static get watchers(){return{guidesList:["observeGuidesList"],mainGuideName:["observeMainGuideName"],selectedGuide:["observeSelectedGuide"]}}};k.style=".guides-tab-configurator.sc-snk-dynaform-guides-configurator{display:flex;flex-direction:column;width:100%;gap:var(--spece--8, 8px)}.tab-bar-row.sc-snk-dynaform-guides-configurator{display:flex;flex-direction:row;align-items:center;gap:var(--space--12, 12px);width:100%}.guides-tabselector.sc-snk-dynaform-guides-configurator{flex:1;min-width:0}.tab-actions.sc-snk-dynaform-guides-configurator{display:inline-flex;align-items:center;gap:var(--space--2, 2px);margin-left:var(--space--6, 6px)}.tab-actions.sc-snk-dynaform-guides-configurator ez-button.sc-snk-dynaform-guides-configurator{width:var(--space--20, 20px);align-items:center;justify-content:center;display:flex}.hidden-guides-bar.sc-snk-dynaform-guides-configurator{display:flex;flex-direction:row;flex-wrap:wrap;align-items:center;gap:var(--space--8, 8px);padding:var(--space--8, 8px) 0;border-top:1px solid #dce0e8}.hidden-guides-label.sc-snk-dynaform-guides-configurator{font-size:var(--space--12, 12px);color:#afb6c0;white-space:nowrap}.hidden-guide-chip.sc-snk-dynaform-guides-configurator{display:flex;align-items:center;gap:4px;padding:2px var(--space--8, 8px);border:1px solid #dce0e8;border-radius:var(--space--12, 12px);background:#f5f7fa;transition:background 0.15s ease-in-out}.hidden-guide-chip.sc-snk-dynaform-guides-configurator:hover{background:#e2eaf4}.hidden-guide-chip.sc-snk-dynaform-guides-configurator ez-button.sc-snk-dynaform-guides-configurator{width:var(--space--20, 20px);align-items:center;justify-content:center;display:flex}.chip-label.sc-snk-dynaform-guides-configurator{font-size:13px;max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;cursor:pointer}";export{p as snk_dynaform_config_header,b as snk_dynaform_configs_button,v as snk_dynaform_fields_layout,y as snk_dynaform_fields_selector,k as snk_dynaform_guides_configurator}
@@ -1 +1 @@
1
- import{r as t,c as s,h as i,H as e,F as a}from"./p-d8d8169b.js";import{I as o}from"./p-58683e28.js";import"./p-39be771c.js";import{P as r}from"./p-840fb68c.js";import"@sankhyalabs/core";import"./p-0f3698af.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-c35fc941.js";import"./p-9019a32f.js";import{ApplicationUtils as n}from"@sankhyalabs/ezui/dist/collection/utils";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-8d884fab.js";const h=class{constructor(i){t(this,i),this.pesquisaGridSelectItem=s(this,"pesquisaGridSelectItem",7),this._pesquisaFetcher=new r,this.metadata=void 0,this.dataSource=[],this.pkField=void 0,this.descriptionField=void 0,this.entityName=void 0,this.shouldLoadConfig=!1,this._gridConfig=void 0,this._inMemoryLoader=void 0,this._dataunit=void 0}observeDataSource(t){this._inMemoryLoader&&this._dataunit&&t&&(this._inMemoryLoader.records=[...t])}observeMetadata(){this.initializeDataUnit()}async observeShouldLoadConfig(t){t&&!this._gridConfig&&await this.loadGridConfig()}async loadGridConfig(){this._gridConfig=await this._pesquisaFetcher.loadPesquisaGridConfig(this.entityName)}initializeDataUnit(){var t;this.metadata&&!this._dataunit&&(this._inMemoryLoader=new o(this.metadata,null!==(t=this.dataSource)&&void 0!==t?t:[]),this._dataunit=this._inMemoryLoader.dataUnit,this._dataunit.pageSize=0)}handleDbClick(t){this.pesquisaGridSelectItem.emit({value:t[this.pkField],label:t[this.descriptionField]})}async handleConfigChanged({detail:t}){var s;const i=null!==(s=null==t?void 0:t.columns)&&void 0!==s?s:[];await this._pesquisaFetcher.savePesquisaGridConfig(this.entityName,i)}render(){if(this.metadata&&this._dataunit)return i(e,null,i("ez-grid",{dataUnit:this._dataunit,config:this._gridConfig,mode:"simple",autoFocus:!1,onEzDoubleClick:({detail:t})=>this.handleDbClick(t),onConfigChange:async t=>this.handleConfigChanged(t)}))}static get watchers(){return{dataSource:["observeDataSource"],metadata:["observeMetadata"],shouldLoadConfig:["observeShouldLoadConfig"]}}};h.style=".sc-pesquisa-grid-h{background:var(--background--xlight, #FFF);overflow-x:auto}ez-grid.sc-pesquisa-grid{--ez-grid__container--shadow:none;--ez-grid__header--shadow:none}";const l=class{constructor(i){t(this,i),this.pesquisaTreeSelectItem=s(this,"pesquisaTreeSelectItem",7),this.treeLoader=void 0,this.argument=void 0,this.allowsNonAnalytic=!1,this.shouldLoadTree=!1,this.messagesBuilder=void 0,this.items=[]}async applyFilter(){await this._tree.applyFilter(this.argument)}async observeShouldLoadTree(t){!t||this.items.length>0||await this.loadTree()}async loadTree(){if(!this.shouldLoadTree)return;if(!this.treeLoader||"function"!=typeof this.treeLoader)return;const t=await this.treeLoader((this.argument||"").trim());this.items=[...t]}expandOrCloseAllItems(t,s){return t.map((t=>Object.assign(Object.assign({},t),{expanded:s,children:t.children?this.expandOrCloseAllItems(t.children,s):void 0})))}handleExpandAll(){this.items=[...this.expandOrCloseAllItems(this.items,!0)]}handleCloseAll(){this.items=[...this.expandOrCloseAllItems(this.items,!1)]}handleDbClick(t){var s;if(this.allowsNonAnalytic||(null===(s=t.props)||void 0===s?void 0:s.analitico))this.pesquisaTreeSelectItem.emit({value:t.id,label:t.label});else{const t=this.getMessage("snkPesquisa.tree.errorTitle"),s=this.getMessage("snkPesquisa.tree.nonAnalyticError");n.error(t,s)}}renderEmptyMessage(){return i("div",{class:"ez-flex ez-flex--justify-center ez-flex--align-items-center ez-margin--large ez-text ez-text--xlarge ez-text--secondary"},i("span",null,this.getMessage("snkPesquisa.tree.emptyMessage")))}getMessage(t,s){return this.messagesBuilder.getMessage(t,s)}render(){var t;return i(e,null,(null===(t=this.items)||void 0===t?void 0:t.length)?i(a,null,i("div",{class:"actions-container"},i("ez-button",{size:"small",mode:"icon",class:"ez-margin-right--small",iconName:"show-list",title:this.getMessage("snkPesquisa.tree.expandButton"),onClick:()=>this.handleExpandAll()}),i("ez-button",{size:"small",mode:"icon",iconName:"hide-list",title:this.getMessage("snkPesquisa.tree.collapseButton"),onClick:()=>this.handleCloseAll()})),i("ez-tree",{ref:t=>this._tree=t,onEzDbClickItem:({detail:t})=>this.handleDbClick(t),items:this.items})):this.renderEmptyMessage())}static get watchers(){return{shouldLoadTree:["observeShouldLoadTree"]}}};l.style=".sc-pesquisa-tree-h{--snk-pesquisa--tree__action-container--top:var(--space--sm);--snk-pesquisa--tree__action-container--right:var(--space--small);--snk-pesquisa--tree__min-height:var(--space--extra-large);background:var(--background--xlight, #FFF);position:relative;min-height:var(--snk-pesquisa--tree__min-height);height:100%;display:block;overflow-y:auto}.sc-pesquisa-tree-h:hover .actions-container.sc-pesquisa-tree{display:flex}.actions-container.sc-pesquisa-tree{flex-direction:row;position:absolute;top:var(--snk-pesquisa--tree__action-container--top);right:var(--snk-pesquisa--tree__action-container--right);display:none}";export{h as pesquisa_grid,l as pesquisa_tree}
1
+ import{r as t,e as s,h as i,f as e,F as a}from"./p-2c9d0870.js";import{I as o}from"./p-8d1ef77a.js";import"./p-4dd574d6.js";import{P as r}from"./p-097d75b3.js";import"@sankhyalabs/core";import"./p-abcb646d.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-ff1990ad.js";import"./p-ec7c87bb.js";import"./p-9019a32f.js";import{ApplicationUtils as n}from"@sankhyalabs/ezui/dist/collection/utils";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-8d884fab.js";const h=class{constructor(i){t(this,i),this.pesquisaGridSelectItem=s(this,"pesquisaGridSelectItem",7),this._pesquisaFetcher=new r,this.metadata=void 0,this.dataSource=[],this.pkField=void 0,this.descriptionField=void 0,this.entityName=void 0,this.shouldLoadConfig=!1,this._gridConfig=void 0,this._inMemoryLoader=void 0,this._dataunit=void 0}observeDataSource(t){this._inMemoryLoader&&this._dataunit&&t&&(this._inMemoryLoader.records=[...t])}observeMetadata(){this.initializeDataUnit()}async observeShouldLoadConfig(t){t&&!this._gridConfig&&await this.loadGridConfig()}async loadGridConfig(){this._gridConfig=await this._pesquisaFetcher.loadPesquisaGridConfig(this.entityName)}initializeDataUnit(){var t;this.metadata&&!this._dataunit&&(this._inMemoryLoader=new o(this.metadata,null!==(t=this.dataSource)&&void 0!==t?t:[]),this._dataunit=this._inMemoryLoader.dataUnit,this._dataunit.pageSize=0)}handleDbClick(t){this.pesquisaGridSelectItem.emit({value:t[this.pkField],label:t[this.descriptionField]})}async handleConfigChanged({detail:t}){var s;const i=null!==(s=null==t?void 0:t.columns)&&void 0!==s?s:[];await this._pesquisaFetcher.savePesquisaGridConfig(this.entityName,i)}render(){if(this.metadata&&this._dataunit)return i(e,null,i("ez-grid",{dataUnit:this._dataunit,config:this._gridConfig,mode:"simple",autoFocus:!1,onEzDoubleClick:({detail:t})=>this.handleDbClick(t),onConfigChange:async t=>this.handleConfigChanged(t)}))}static get watchers(){return{dataSource:["observeDataSource"],metadata:["observeMetadata"],shouldLoadConfig:["observeShouldLoadConfig"]}}};h.style=".sc-pesquisa-grid-h{background:var(--background--xlight, #FFF);overflow-x:auto}ez-grid.sc-pesquisa-grid{--ez-grid__container--shadow:none;--ez-grid__header--shadow:none}";const l=class{constructor(i){t(this,i),this.pesquisaTreeSelectItem=s(this,"pesquisaTreeSelectItem",7),this.treeLoader=void 0,this.argument=void 0,this.allowsNonAnalytic=!1,this.shouldLoadTree=!1,this.messagesBuilder=void 0,this.items=[]}async applyFilter(){await this._tree.applyFilter(this.argument)}async observeShouldLoadTree(t){!t||this.items.length>0||await this.loadTree()}async loadTree(){if(!this.shouldLoadTree)return;if(!this.treeLoader||"function"!=typeof this.treeLoader)return;const t=await this.treeLoader((this.argument||"").trim());this.items=[...t]}expandOrCloseAllItems(t,s){return t.map((t=>Object.assign(Object.assign({},t),{expanded:s,children:t.children?this.expandOrCloseAllItems(t.children,s):void 0})))}handleExpandAll(){this.items=[...this.expandOrCloseAllItems(this.items,!0)]}handleCloseAll(){this.items=[...this.expandOrCloseAllItems(this.items,!1)]}handleDbClick(t){var s;if(this.allowsNonAnalytic||(null===(s=t.props)||void 0===s?void 0:s.analitico))this.pesquisaTreeSelectItem.emit({value:t.id,label:t.label});else{const t=this.getMessage("snkPesquisa.tree.errorTitle"),s=this.getMessage("snkPesquisa.tree.nonAnalyticError");n.error(t,s)}}renderEmptyMessage(){return i("div",{class:"ez-flex ez-flex--justify-center ez-flex--align-items-center ez-margin--large ez-text ez-text--xlarge ez-text--secondary"},i("span",null,this.getMessage("snkPesquisa.tree.emptyMessage")))}getMessage(t,s){return this.messagesBuilder.getMessage(t,s)}render(){var t;return i(e,null,(null===(t=this.items)||void 0===t?void 0:t.length)?i(a,null,i("div",{class:"actions-container"},i("ez-button",{size:"small",mode:"icon",class:"ez-margin-right--small",iconName:"show-list",title:this.getMessage("snkPesquisa.tree.expandButton"),onClick:()=>this.handleExpandAll()}),i("ez-button",{size:"small",mode:"icon",iconName:"hide-list",title:this.getMessage("snkPesquisa.tree.collapseButton"),onClick:()=>this.handleCloseAll()})),i("ez-tree",{ref:t=>this._tree=t,onEzDbClickItem:({detail:t})=>this.handleDbClick(t),items:this.items})):this.renderEmptyMessage())}static get watchers(){return{shouldLoadTree:["observeShouldLoadTree"]}}};l.style=".sc-pesquisa-tree-h{--snk-pesquisa--tree__action-container--top:var(--space--sm);--snk-pesquisa--tree__action-container--right:var(--space--small);--snk-pesquisa--tree__min-height:var(--space--extra-large);background:var(--background--xlight, #FFF);position:relative;min-height:var(--snk-pesquisa--tree__min-height);height:100%;display:block;overflow-y:auto}.sc-pesquisa-tree-h:hover .actions-container.sc-pesquisa-tree{display:flex}.actions-container.sc-pesquisa-tree{flex-direction:row;position:absolute;top:var(--snk-pesquisa--tree__action-container--top);right:var(--snk-pesquisa--tree__action-container--right);display:none}";export{h as pesquisa_grid,l as pesquisa_tree}
@@ -0,0 +1 @@
1
+ import{r as o,e as r,h as t,g as i}from"./p-2c9d0870.js";import{ApplicationContext as n}from"@sankhyalabs/core";import{V as s}from"./p-9019a32f.js";import{A as a}from"./p-dc36cfbf.js";const l=class{constructor(t){o(this,t),this.configSelected=r(this,"configSelected",7),this.openConfig=r(this,"openConfig",7),this.save=r(this,"save",7),this.cancel=r(this,"cancel",7),this._opened=!1,this._permissions=void 0,this.showActionButtons=!1,this.configName=void 0,this.resourceID=void 0,this.viewMode=s.GRID,this.customContainerId=void 0,this.layoutFormConfig=!0,this.entityName=void 0,this.disableNumberingConfig=!1,this.messagesBuilder=void 0}async open(){this._opened=!0,this.configSelected.emit(this.getViewModeValue()),this.modal.heightMode="full"}async close(){this.closeConfig()}closeConfig(){this._opened=!1}onViewModeChanged(o){this.viewMode=null==o?void 0:o.detail,this.configSelected.emit(this.viewMode)}onClickOpenConfig(){this.openConfig.emit(this.viewMode)}isAllowed(o){return!a[o]||!!this._permissions&&(this._permissions.isSup||this._permissions[o])}enableModeConfig(){return!(!this.isAllowed(a.CONFIG_GRID)||!this.isAllowed(a.CONFIG))}getViewModeValue(){return null!=this._permissions&&(this.isAllowed(a.CONFIG_GRID)?this.isAllowed(a.CONFIG)||(this.viewMode=s.GRID):this.viewMode=s.FORM),this.viewMode}getMessage(o){var r;return null===(r=this.messagesBuilder)||void 0===r?void 0:r.getMessage(o,{})}async handleSave(){var o;this.disableNumberingConfig||await(null===(o=this._snkNumberingConfig)||void 0===o?void 0:o.save())?(this.layoutFormConfig&&this._snkLayoutFormConfig.save(),this.save.emit(),this.closeConfig()):this.closeConfig()}componentWillLoad(){this._application=n.getContextValue("__SNK__APPLICATION__"),this._application?this._application.getAllAccess(this.resourceID).then((o=>this._permissions=o)):this._permissions={}}componentDidRender(){if(!this.customContainerId)return;const o=document.querySelector(`#${this.customContainerId}`),r=null==o?void 0:o.querySelector("#SnkConfigContainerSlot");if(!r)return;const t=r.firstElementChild;if(!t)return;const i=this._element.querySelector("#slotContainer");null==i||i.appendChild(t)}render(){return t("ez-modal",{ref:o=>this.modal=o,opened:this._opened,"close-esc":!1,"close-outside-click":!1,"modal-size":"small",scrim:"light",onEzCloseModal:()=>this.closeConfig()},t("div",{class:"snk-configurator"},t("div",{class:"snk-configurator__header"},t("label",{class:"snk-configurator__title"},this.getMessage("snkConfigurator.titleConfigurations")),t("div",{class:"snk-configurator__button-close"},t("ez-button",{mode:"icon",iconName:"close",size:"medium",onClick:()=>this.closeConfig()}))),t("div",{class:"snk-configurator__main"},t("ez-collapsible-box",{boxBordered:!0,label:this.getMessage("snkConfigurator.subTitleModeConfig"),headerSize:"medium",class:"snk-configurator__collapsable-box"},t("ez-radio-button",{value:this.getViewModeValue().toString(),onEzChange:o=>this.onViewModeChanged(o),enabled:this.enableModeConfig()},t("ez-radio-button-option",{label:this.getMessage("snkConfigurator.labelGrid"),value:s.GRID}),t("ez-radio-button-option",{label:this.getMessage("snkConfigurator.labelForm"),value:s.FORM})),t("div",{class:"snk-configurator__collsable-box-action"},t("ez-button",{label:this.getMessage(this.viewMode===s.GRID?"snkConfigurator.labelConfigGrid":"snkConfigurator.labelConfigForm"),class:"snk-configurator__button-config ez-button--secondary",onClick:()=>this.onClickOpenConfig(),id:"openConfigurator"}))),this.layoutFormConfig&&t("ez-collapsible-box",{boxBordered:!0,value:!0,label:this.getMessage("snkConfigurator.labelLayoutForm"),headerSize:"medium",class:"snk-configurator__collapsable-box ez-margin-top--medium"},t("div",{class:"ez-flex ez-flex--column ez-size-width--full"},t("snk-layout-form-config",{ref:o=>this._snkLayoutFormConfig=o,messagesBuilder:this.messagesBuilder}))),!this.disableNumberingConfig&&t("ez-collapsible-box",{boxBordered:!0,value:!0,label:this.getMessage("snkConfigurator.labelNumberingConfig"),headerSize:"medium",class:"snk-configurator__collapsable-box ez-margin-top--medium"},t("div",{class:"ez-flex ez-flex--column ez-size-width--full"},t("snk-numbering-config",{ref:o=>this._snkNumberingConfig=o,messagesBuilder:this.messagesBuilder,entityName:this.entityName,resourceID:this.resourceID}))),t("div",{id:"slotContainer",class:"snk-configurator__outline"})),this.showActionButtons&&t("div",{class:"snk-configurator__action-buttons"},t("ez-button",{label:this.getMessage("snkConfigurator.buttons.cancel"),onClick:()=>this.cancel.emit()}),t("ez-button",{label:this.getMessage("snkConfigurator.buttons.save"),onClick:()=>this.handleSave(),class:"ez-button--primary"}))))}get _element(){return i(this)}};l.style='.sc-snk-configurator-h{--snk-configurator__button-close--padding-left:var(--space--medium, 12px);--snk-configurator__title--color:var(--title--primary, #2B3A54);--snk-configurator__title--font-family:var(--font-pattern, "Roboto");--snk-configurator__title--font-size:var(--title--large, 20px);--snk-configurator__title--font-weight:var(--text-weight--extra-large, 700);--snk-configurator__subtitle--color:var(--title--primary, #2B3A54);--snk-configurator__subtitle--font-family:var(--font-pattern, "Roboto");--snk-configurator__subtitle--font-size:var(--text--medium, 14px);--snk-configurator__subtitle--font-weight:var(--text-weight--large, 600);--snk-configurator__scrollbar--color-default:var(--scrollbar--default, #626e82);--snk-configurator__scrollbar--color-background:var(--scrollbar--background, #E5EAF0);--snk-configurator__scrollbar--color-hover:var(--scrollbar--hover, #2B3A54);--snk-configurator__scrollbar--color-clicked:var(--scrollbar--clicked, #a2abb9);--snk-configurator__scrollbar--border-radius:var(--border--radius-small, 6px);--snk-configurator__scrollbar--width:var(--space--small, 6px)}.snk-configurator.sc-snk-configurator{display:grid;grid-template-rows:auto 1fr auto;max-height:100%;width:100%}.snk-configurator__collsable-box-action.sc-snk-configurator{width:100%}.snk-configurator__action-buttons.sc-snk-configurator{display:flex;flex-direction:row;justify-content:flex-end;gap:var(--space--medium)}.snk-configurator__outline.sc-snk-configurator{display:flex;flex-direction:column;gap:var(--space--small);margin-top:var(--space--small);margin-bottom:var(--space--large)}@media screen and (min-width: 480px){.snk-configurator.sc-snk-configurator{width:359px;max-width:359px}}.snk-configurator__button-config.sc-snk-configurator{--ez-button--min-width:100%}.snk-configurator__header.sc-snk-configurator{display:flex;justify-content:space-between;align-items:center;width:100%}.snk-configurator__title.sc-snk-configurator{display:flex;margin:0;line-height:normal;letter-spacing:0em;text-align:left;color:var(--snk-configurator__title--color);font-size:var(--snk-configurator__title--font-size);font-family:var(--snk-configurator__title--font-family);font-weight:var(--snk-configurator__title--font-weight)}.snk-configurator__subtitle.sc-snk-configurator{display:flex;margin:0;padding-top:var(--space--medium);padding-bottom:var(--space--small);color:var(--snk-configurator__subtitle--color);font-size:var(--snk-configurator__subtitle--font-size);font-family:var(--snk-configurator__subtitle--font-family);font-weight:var(--snk-configurator__subtitle--font-weight)}.snk-configurator__button-close.sc-snk-configurator{padding-left:var(--snk-configurator__button-close--padding-left)}.snk-configurator__main.sc-snk-configurator{overflow-y:auto;scrollbar-width:thin;margin:var(--space--medium) 0;scrollbar-color:var(--snk-configurator__scrollbar--color-clicked) var(--snk-configurator__scrollbar--color-background)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar{background-color:var(--snk-configurator__scrollbar--color-background);width:var(--snk-configurator__scrollbar--width);max-width:var(--snk-configurator__scrollbar--width);min-width:var(--snk-configurator__scrollbar--width)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-track{background-color:var(--snk-configurator__scrollbar--color-background);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb{background-color:var(--snk-configurator__scrollbar--color-default);border-radius:var(--snk-configurator__scrollbar--border-radius)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:hover,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:hover{background-color:var(--snk-configurator__scrollbar--color-hover)}.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:vertical:active,.snk-configurator__main.sc-snk-configurator::-webkit-scrollbar-thumb:horizontal:active{background-color:var(--snk-configurator__scrollbar--color-clicked)}';export{l as snk_configurator}
@@ -0,0 +1 @@
1
+ import{r as i,i as t,h as e,f as s,g as o,e as a}from"./p-2c9d0870.js";import{Action as n,StringUtils as r,KeyboardManager as d,ObjectUtils as l,ApplicationContext as h}from"@sankhyalabs/core";import{S as c,a as u}from"./p-5aeae67f.js";import{buildFormMetadata as v,FormMetadata as f,buildFormConfigFromDataUnit as m}from"@sankhyalabs/ezui/dist/collection/utils/form";import{S as g}from"./p-4dd574d6.js";import"./p-097d75b3.js";import{P as p}from"./p-abcb646d.js";import"@sankhyalabs/ezui/dist/collection/utils/constants";import"@sankhyalabs/core/dist/dataunit/metadata/UnitMetadata";import"./p-8d1ef77a.js";import"./p-ff1990ad.js";import{U as b}from"./p-ec7c87bb.js";import{V as k,a as y,G as w}from"./p-9019a32f.js";import{T as C}from"./p-2ec98523.js";import{buildFieldSearch as x,SHORTCUT_SEARCH_FIELD as S,ApplicationUtils as _}from"@sankhyalabs/ezui/dist/collection/utils";import{S as F,D as E,g as A}from"./p-6f60df43.js";import{b as T,a as z,c as D,d as G,g as L,u as N,e as M}from"./p-46d7e2de.js";import"./p-8d81c8d3.js";import"./p-8d884fab.js";import"@sankhyalabs/ezui/dist/collection/components/ez-grid/utils";import"@sankhyalabs/core/dist/utils/SortingUtils";import"./p-688dcb4c.js";import"./p-a73b6b00.js";const I=class{constructor(t){i(this,t),this._taskbarProcessor=new F(E),this._didInitialLoad=!1,this._currentView=0,this.attachmentRegisterKey=void 0,this._fieldToGetFocus=void 0,this._hasToCreateFieldSearch=!0,this._selectedSheet=void 0,this._internalErrorTabs=new Set,this._selectedRecordPKDisplay=void 0,this.formConfigManager=void 0,this.dataUnitName=void 0,this.resourceID=void 0,this.entityName=void 0,this.label=void 0,this.dataUnit=void 0,this.selectedForm=void 0,this.dataState=void 0,this.messagesBuilder=void 0,this.canEdit=!0,this.taskbarCustomContainerId=void 0,this.customEditors=void 0,this.customRenders=void 0,this.presentationMode=p.SECONDARY}observeDataUnit(i,t){null==i||i.subscribe(this.dataUnitActionHandler.bind(this)),null==t||t.unsubscribe(this.dataUnitActionHandler)}observerDataState(i,t){const e=!(null==t?void 0:t.insertionMode)&&(null==i?void 0:i.insertionMode),s=(null==t?void 0:t.insertionMode)&&!(null==i?void 0:i.insertionMode);(e||s)&&this.loadMetadata(),null!=this._formMetadata&&(this.selectedSheetIsDetail()||(e&&setTimeout((()=>{this.changeViewMode(k.FORM)}),0),s&&this.changeViewMode(k.GRID)))}async changeViewMode(i){this._viewStack&&(this._viewStack.show(i),this._currentView=i)}async configGrid(){this._snkGrid&&this._snkGrid.showConfig()}async showUp(){this._snkFormView&&this._snkFormView.showUp(),this._snkGrid&&this._snkGrid.scrollIntoView({behavior:"smooth",block:"start"})}async addCustomEditor(i,t){var e,s;const o=this.normalizeDataUnitName();null===(e=this._snkGrid)||void 0===e||e.addCustomEditor(i,t,o),null===(s=this._snkFormView)||void 0===s||s.addCustomEditor(i,t,o)}async observerPropsCustomEditor(i){for(const t in i)await this.addCustomEditor(t,i[t])}async addGridCustomRender(i,t){var e;const s=this.normalizeDataUnitName();await(null===(e=this._snkGrid)||void 0===e?void 0:e.addGridCustomRender(i,t,s))}onContentCardChanged(i){c.updateContentCard(i.detail.formName,i.detail.cardConfig,i.detail.propertyChanged,this.formConfigManager).then((()=>t(this))),i.stopPropagation()}async observeCustomRenders(i){for(const t in i){const e=i[t];await this.addGridCustomRender(t,e)}}loadMetadata(){if(!this.dataUnit||!this.formConfigManager)return;if(!this.formConfigManager.isLoaded)return;const i=this.formConfigManager.getConfig(this.dataUnit);this._formMetadata=v(null==i||0===i.fields.length?void 0:i,this.dataUnit,!0),this.initSelectedSheet()}initSelectedSheet(){if(!this._formMetadata)return void(this._selectedSheet=void 0);const i=this._formMetadata.getAllSheets();if(i&&0!==i.size){if(this._selectedSheet&&this._selectedSheet.name!==I.MAIN_TAB){const t=i.get(this._selectedSheet.name);if(t)return void(this._selectedSheet=t)}this._selectedSheet=this.getFirstNonMainSheet(i)}else this._selectedSheet=void 0}getFirstNonMainSheet(i){for(const[t,e]of i)if(t!==I.MAIN_TAB)return e}dataUnitReadyHandler(i){this.dataUnit=i.detail,this.loadMetadata(),this.ensureInitialLoad()}ensureInitialLoad(){var i,t,e,s,o;if(this._didInitialLoad)return;const a=this.dataUnit,n=null===(i=null==a?void 0:a.getParentDataUnit)||void 0===i?void 0:i.call(a);(null===(t=null==n?void 0:n.getSelectedRecord)||void 0===t?void 0:t.call(n))&&0===(null!==(s=null===(e=null==a?void 0:a.records)||void 0===e?void 0:e.length)&&void 0!==s?s:0)&&(this._didInitialLoad=!0,null===(o=null==a?void 0:a.loadData)||void 0===o||o.call(a))}getFormFields(){var i,t,e;const s=null===(t=null===(i=this._formMetadata)||void 0===i?void 0:i.getAllSheets())||void 0===t?void 0:t.get(I.MAIN_TAB);return null!==(e=null==s?void 0:s.fields)&&void 0!==e?e:[]}hasNonMainSheets(){if(!this._formMetadata)return!1;for(const i of this._formMetadata.getAllSheets().keys())if(i!==I.MAIN_TAB)return!0;return!1}selectedSheetIsDetail(){return!!this._selectedSheet&&null!=f.getDetailName(this._selectedSheet.name)}isSheetDisabled(i){var t;if(null==f.getDetailName(i.name))return!1;const e=null===(t=this.dataUnit)||void 0===t?void 0:t.getSelectedRecord();return!e||!this.dataUnit||this.dataUnit.isNewRecord(e.__record__id__)||this.dataUnit.isMultipleEdition}buildInternalTabItems(){return this._formMetadata?Array.from(this._formMetadata.getAllSheets().values()).filter((i=>i.name!==I.MAIN_TAB)).map(((i,t)=>({tabKey:i.name,label:i.label,index:t,disabled:this.isSheetDisabled(i),rightIcon:this._internalErrorTabs.has(i.name)?"alert-circle-inverted":void 0}))):[]}onInternalTabChange(i){var t,e;if(i.tabKey===I.MAIN_TAB)return;const s=null===(e=null===(t=this._formMetadata)||void 0===t?void 0:t.getAllSheets())||void 0===e?void 0:e.get(i.tabKey);s&&!this.isSheetDisabled(s)&&(this._selectedSheet=s)}executeActionHandler(i){var t;i.detail===C.GRID_MODE&&(this.changeViewMode(k.GRID),i.stopPropagation()),i.detail===C.UPDATE_MULTIPLE&&this.dataUnit&&(this.dataUnit.isMultipleEdition=!0,this.changeViewMode(k.FORM),i.stopPropagation()),i.detail!==C.FORM_MODE&&i.detail!==C.UPDATE&&i.detail!==C.INSERT||(this.changeViewMode(k.FORM),i.stopPropagation()),i.detail===C.ATTACH&&(null===(t=this._snkAttach)||void 0===t||t.open(),i.stopPropagation())}async getAttachmentRegisterKey(){if(this._snkDataUnit)return(await this._snkDataUnit.getSelectedRecordsIDsInfo()).map((({value:i})=>i)).join("_")}async handleDataStateChange({detail:i}){var t;this.dataState=i,void 0!==i.selectedRecord&&this._snkDataUnit&&(this.attachmentRegisterKey=null!==(t=await this.getAttachmentRegisterKey())&&void 0!==t?t:void 0),this._selectedRecordPKDisplay=this.buildSelectedRecordPKDisplay()}buildSelectedRecordPKDisplay(){var i,t,e,s,o,a,n;if(!this.dataUnit)return;if(null===(i=this.dataState)||void 0===i?void 0:i.insertionMode){const i=null===(t=this.messagesBuilder)||void 0===t?void 0:t.getMessage("snkCrud.newRecord");return i?{message:i}:void 0}const r=this.dataUnit.getSelectedRecord();if(!r)return;const d=[],l=null!==(s=null===(e=this.dataUnit.metadata)||void 0===e?void 0:e.fields)&&void 0!==s?s:[];for(const i of l){if("true"!==(null===(o=i.properties)||void 0===o?void 0:o.isPrimaryKey))continue;const t=r[i.name],e=null!==(a=null==t?void 0:t.value)&&void 0!==a?a:t;null!=e&&""!==e&&d.push({label:null!==(n=i.label)&&void 0!==n?n:i.name,value:String(e)})}return d.length?{items:d}:void 0}renderSelectedRecordHeader(){var i;if(!this.label&&!this._selectedRecordPKDisplay)return;const t=this._selectedRecordPKDisplay;if(t){if(t.message)return e("div",{class:"selected-record-header selected-record-header--message"},e("span",{class:"selected-record-header__message"},t.message));if(null===(i=t.items)||void 0===i?void 0:i.length)return e("div",{class:"selected-record-header",role:"group"},t.items.map(((i,t)=>[t>0&&e("span",{class:"selected-record-header__separator","aria-hidden":"true"}),e("div",{class:"selected-record-header__chip"},e("span",{class:"selected-record-header__label"},i.label,":"),e("span",{class:"selected-record-header__value"},i.value))])))}}componentWillLoad(){var i;this._configName=`dynaform.${this.entityName}`,this.formConfigManager=new u(this._configName,null!==(i=this.resourceID)&&void 0!==i?i:"",(()=>this.loadMetadata()),this.dataUnit),this.formConfigManager.loadConfig(),null==this.messagesBuilder&&(this.messagesBuilder=new g(this.entityName))}componentWillRender(){this.initializeTaskbarProcessor()}initializeTaskbarProcessor(){if(!this.dataState)return;const i=this.buildDetailTaskbarManager(),t=A(this.dataState,this.presentationMode);this._taskbarProcessor.process(t,i,this.dataState,[],[])}buildDetailTaskbarManager(){const i=[C.CANCEL,C.SAVE],t=this._currentView;return{getButtons:(e,s,o)=>{var a,n,r;if(!e)return[];if((null==s?void 0:s.insertionMode)||(null==s?void 0:s.isDirty))return i;let d=[...o];if(t===k.FORM){const i=d.indexOf(C.FORM_MODE);i>-1&&(d=[...d.slice(0,i),C.GRID_MODE,...d.slice(i+1)])}if((null!==(r=null===(n=null===(a=null==s?void 0:s.selectionInfo)||void 0===a?void 0:a.records)||void 0===n?void 0:n.length)&&void 0!==r?r:0)>1){const i=d.indexOf(C.UPDATE);i>-1&&(d=[...d.slice(0,i),C.UPDATE_MULTIPLE,...d.slice(i+1)])}return d},isEnabled:(i,t,e,s)=>t?!(void 0===t.selectedRecord&&[C.UPDATE,C.REMOVE,C.ATTACH,C.CLONE].includes(e))&&!(e===C.PREVIOUS&&!t.hasPrevious)&&!(e===C.NEXT&&!t.hasNext)&&(e!==C.INSERT||!t.insertionMode)&&s:s}}async componentDidLoad(){this.customEditors&&await this.observerPropsCustomEditor(this.customEditors),this.customRenders&&await this.observeCustomRenders(this.customRenders),this.initKeyboardManager()}disconnectedCallback(){var i;null===(i=this._keyboardManager)||void 0===i||i.unbindAllShortcutKeys()}async dataUnitActionHandler(i){var t;if(i.type===n.FIELD_INVALIDATED){const e=this.findSheetOfField(null===(t=i.payload)||void 0===t?void 0:t.fieldName);e&&(this._internalErrorTabs=new Set([...this._internalErrorTabs,e]))}}findSheetOfField(i){var t;if(!i||!this._formMetadata)return;const e=this._formMetadata.getAllSheets();for(const[s,o]of e)if(null===(t=o.fields)||void 0===t?void 0:t.some((t=>t.name===i)))return s}normalizeDataUnitName(){var i,t;return null!==(t=null===(i=this.dataUnitName)||void 0===i?void 0:i.replace(/\//g,">"))&&void 0!==t?t:""}getSettingsListForm(){var i,t;return[{value:r.generateUUID(),label:null!==(t=null===(i=this.messagesBuilder)||void 0===i?void 0:i.getMessage("snkCrud.findColumn",void 0))&&void 0!==t?t:"",disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>this.getFieldsSearch(t)}]}getFieldsSearch(i){var t;return(void 0===this._fieldSearch||this._hasToCreateFieldSearch)&&(this._hasToCreateFieldSearch=!1,this._fieldSearch=x(i,(({argument:i})=>this.fieldsOptionLoader(i)),(i=>this.onSelectField(i)))),null!==(t=this._fieldSearch)&&void 0!==t?t:document.createElement("div")}fieldsOptionLoader(i){const t=null==i?void 0:i.toLowerCase(),e=this.getFormFields().map((i=>{var t;return null===(t=this.dataUnit)||void 0===t?void 0:t.getField(i.name)})).filter((i=>{var e,s;if(i)return(null===(e=i.name)||void 0===e?void 0:e.toLowerCase().includes(t))||(null===(s=i.label)||void 0===s?void 0:s.toLowerCase().includes(t))})).map((i=>{if(i)return{value:i.name,label:i.label}}));return Promise.resolve(e)}onSelectField(i){null!=i&&(this._fieldToGetFocus=i.value)}clearFieldToFocusHandler(){this._fieldToGetFocus=void 0}getColumnSearch(i){var t;return void 0!==this._columnSearch?this._columnSearch:(this._columnSearch=x(i,(({argument:i})=>new Promise((t=>{var e;null===(e=this._snkGrid)||void 0===e||e.filterColumns(i).then((i=>{t(i.filter((i=>!i.hidden)).map((i=>({label:i.label,value:i.name}))))}))}))),(i=>{var t;null!=i&&(null===(t=this._snkGrid)||void 0===t||t.locateColumn(i.value))})),null!==(t=this._columnSearch)&&void 0!==t?t:document.createElement("div"))}buildTaskbarCustomActionsList(){return[this.buildSearchColumnTaskbarAction()]}buildSearchColumnTaskbarAction(){var i,t;return{value:r.generateUUID(),label:null!==(t=null===(i=this.messagesBuilder)||void 0===i?void 0:i.getMessage("snkGrid.findColumn",{}))&&void 0!==t?t:"",disableCloseOnSelect:!0,eagerInitialize:!0,itemBuilder:(i,t)=>{var e;return null!==(e=this.getColumnSearch(t))&&void 0!==e?e:document.createElement("div")}}}async initKeyboardManager(){var i;this._keyboardManager=new d({propagate:!1,element:this._element}),this._keyboardManager.bind(S,(async()=>{var i;await(null===(i=this._snkFormView)||void 0===i?void 0:i.showSearchField())}),{description:null===(i=this.messagesBuilder)||void 0===i?void 0:i.getMessage("snkSimpleCrud.findFields"),element:this._element})}renderTabSelector(){if(!this.hasNonMainSheets())return;const i=this._selectedSheet&&this._selectedSheet.name!==I.MAIN_TAB?this._selectedSheet.name:void 0;return e("ez-tabselector",{class:"ez-tabselector-internal",tabs:this.buildInternalTabItems(),selectedTab:i,onEzChange:i=>this.onInternalTabChange(i.detail)})}renderSelectedSheetContent(){if(!this._selectedSheet||this._selectedSheet.name===I.MAIN_TAB)return;const i=f.getDetailName(this._selectedSheet.name);return i?e("snk-dynaform-detail-view",{key:`sub_${this.dataUnitName}_${this._selectedSheet.name}`,dataUnitName:`${this.dataUnitName}/${i}`,entityName:i,label:this._selectedSheet.label,resourceID:this.resourceID,canEdit:this.canEdit,messagesBuilder:this.messagesBuilder,customEditors:this.customEditors,customRenders:this.customRenders,presentationMode:this.presentationMode,taskbarCustomContainerId:this.taskbarCustomContainerId}):e("snk-dynaform-form-view",{key:`sheet_${this._selectedSheet.name}`,name:this._selectedSheet.name,formMetadata:this._formMetadata,dataUnit:this.dataUnit,fields:this._selectedSheet.fields,fieldToFocus:this._fieldToGetFocus,label:this._selectedSheet.label,onSnkRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),fieldSearch:this._fieldSearch})}renderViewStack(){var i,t;return e("ez-view-stack",{ref:i=>this._viewStack=i},e("stack-item",{class:"ez-size-width--full ez-size-height--full"},e("snk-grid",{class:"ez-size-width--full ez-size-height--full",ref:i=>{i&&(this._snkGrid=i)},configName:this._configName,messagesBuilder:this.messagesBuilder,onGridDoubleClick:()=>this.changeViewMode(k.FORM),onActionClick:i=>this.executeActionHandler(i),presentationMode:this.presentationMode,canEdit:this.canEdit,isDetail:!0,taskbarCustomContainerId:this.taskbarCustomContainerId,gridHeaderCustomSlotId:"DETAIL_GRID_HEADER_CUSTOM_ELEMENTS",topTaskbarCustomSlotId:"DETAIL_GRID_TASKBAR_CUSTOM_ELEMENTS",outlineMode:!0,enableGridInsert:!0,autoLoad:!0,multipleEditionEnabled:!0,multipleSelection:!0,hideHeader:!0,hideGridTaskbar:!0})),e("stack-item",{class:"ez-size-width--full ez-size-height--full grid-container"},e("div",{class:"form-and-detail-container"},e("snk-dynaform-form-view",{ref:i=>{i&&(this._snkFormView=i)},name:I.MAIN_TAB,formMetadata:this._formMetadata,dataUnit:this.dataUnit,fields:this.getFormFields(),fieldToFocus:this._fieldToGetFocus,label:this.label,onSnkRequestClearFieldToFocus:this.clearFieldToFocusHandler.bind(this),fieldSearch:this._fieldSearch},this.renderSelectedRecordHeader()),this.renderTabSelector(),this.renderSelectedSheetContent())),e("snk-attach",{ref:i=>this._snkAttach=i,registerKey:null!==(i=this.attachmentRegisterKey)&&void 0!==i?i:"",messagesBuilder:this.messagesBuilder,entityName:null!==(t=this.entityName)&&void 0!==t?t:""}))}render(){return e(s,null,e("snk-data-unit",{ref:i=>{i&&(this._snkDataUnit=i)},dataUnitName:`${this.dataUnitName}`,onDataUnitReady:i=>this.dataUnitReadyHandler(i),entityName:this.entityName,onDataStateChange:this.handleDataStateChange.bind(this),ignoreSaveMessage:this._currentView===k.GRID,messagesBuilder:this.messagesBuilder,configName:this._configName},e("snk-taskbar",{key:"detailViewTaskbar",class:"form-taskbar","data-element-id":"detail_top",configName:this._configName,messagesBuilder:this.messagesBuilder,buttons:this._taskbarProcessor.buttons,disabledButtons:this._taskbarProcessor.disabledButtons,customButtons:this._taskbarProcessor.customButtons,primaryButton:"INSERT",overflowStrategy:"hiddenItems",alignRigth:!0,sizeButtons:"small",presentationMode:this.presentationMode,onActionClick:i=>this.executeActionHandler(i),dataUnit:this.dataUnit,resourceID:this.resourceID,customContainerId:this.taskbarCustomContainerId,customSlotId:"DETAIL_TASKBAR_CUSTOM_ELEMENTS",actionsSettingsList:this.getSettingsListForm(),customActionsList:this.buildTaskbarCustomActionsList()},e("slot",{name:"DETAIL_TASKBAR_CUSTOM_ELEMENTS"})),this.renderViewStack()))}get _element(){return o(this)}static get watchers(){return{dataUnit:["observeDataUnit"],dataState:["observerDataState"],customEditors:["observerPropsCustomEditor"],customRenders:["observeCustomRenders"]}}};I.MAIN_TAB="__main",I.style=".sc-snk-dynaform-detail-view-h{display:flex;row-gap:24px;flex-direction:column;width:100%;height:100%;overflow-x:hidden;overflow-y:auto;padding:var(--space--4, 4px);scrollbar-width:auto;scrollbar-color:var(--color--strokes, #E1E2E5) transparent}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar{width:var(--space--14, 14px);height:var(--space--14, 14px)}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar-track{background:transparent}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar-thumb{background-color:var(--color--strokes, #E1E2E5);border-radius:var(--border--radius-100, 100px);border:2px solid transparent;background-clip:padding-box}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar-thumb:hover{background-color:var(--color--petroleum-100, #C8CCD3);background-clip:padding-box}.sc-snk-dynaform-detail-view-h::-webkit-scrollbar-corner{background:transparent}.level-path.sc-snk-dynaform-detail-view{color:var(--color--title-primary, #2B3A54);font-weight:var(--text-weight--medium, 400);padding-right:3px}.grid-container.sc-snk-dynaform-detail-view{min-height:100px;height:100%;width:100%;display:flex;flex-wrap:wrap;text-decoration:none;border-radius:var(--border--radius-medium);background-color:var(--color--gray-70, #FFFFFF);border:1px solid var(--color--petroleum-100, #C8CCD3)}.detail-header.sc-snk-dynaform-detail-view{padding-bottom:0}snk-data-unit.sc-snk-dynaform-detail-view{flex:1;min-height:0;gap:var(--space--12, 12px);display:flex;flex-direction:column}snk-data-unit.sc-snk-dynaform-detail-view ez-view-stack.sc-snk-dynaform-detail-view{flex:1;min-height:0}snk-grid.sc-snk-dynaform-detail-view{height:100%;--snk-grid-margin:0px;--snk-grid-box-shadow:none;--snk-grid-min-height:135px}.form-and-detail-container.sc-snk-dynaform-detail-view>ez-tabselector.sc-snk-dynaform-detail-view{flex-shrink:0}.form-and-detail-container.sc-snk-dynaform-detail-view{display:flex;flex-direction:column;height:100%;width:100%;overflow:auto;padding:var(--space--12, 12px);scrollbar-width:auto;scrollbar-color:var(--color--strokes, #E1E2E5) transparent}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar{width:var(--space--14, 14px);height:var(--space--14, 14px)}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar-track{background:transparent}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar-thumb{background-color:var(--color--strokes, #E1E2E5);border-radius:var(--border--radius-100, 100px);border:2px solid transparent;background-clip:padding-box}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar-thumb:hover{background-color:var(--color--petroleum-100, #C8CCD3);background-clip:padding-box}.form-and-detail-container.sc-snk-dynaform-detail-view::-webkit-scrollbar-corner{background:transparent}.ez-tabselector-internal.sc-snk-dynaform-detail-view{margin:var(--space--8, 8px) 0}.selected-record-header.sc-snk-dynaform-detail-view{display:flex;align-items:center;flex-wrap:wrap;gap:var(--space--8, 8px) var(--space--12, 12px);padding:var(--space--12, 12px) var(--space--16, 16px);margin-bottom:var(--space--12, 12px);background:var(--color--gray-80, #F9F9F9);border-radius:var(--border--radius-12, 12px);font-family:var(--font--pattern);border:1px solid var(--color--petroleum-100, #C8CCD3);border-left:4px solid var(--color--ocean-green-500, #00B07E)}.selected-record-header--message.sc-snk-dynaform-detail-view{border-left-color:var(--color--primary, #007EFF)}.selected-record-header__message.sc-snk-dynaform-detail-view{font-size:var(--font-size--default, 14px);font-weight:var(--font-weight--medium, 500);color:var(--color--title-primary, #2B3A54)}.selected-record-header__chip.sc-snk-dynaform-detail-view{display:inline-flex;flex-direction:row;align-items:center;gap:var(--space--4, 4px);min-width:0}.selected-record-header__label.sc-snk-dynaform-detail-view{font-size:var(--font-size--xs, 11px);font-weight:var(--font-weight--medium, 500);text-transform:uppercase;letter-spacing:0.04em;color:var(--color--text-secondary, #6E7A8A)}.selected-record-header__value.sc-snk-dynaform-detail-view{font-size:var(--font-size--md, 15px);font-weight:var(--font-weight--semibold, 600);color:var(--color--ocean-green-1000, #00281D);line-height:1.2;word-break:break-word}.selected-record-header__separator.sc-snk-dynaform-detail-view{display:inline-block;align-self:stretch;width:1px;background:var(--color--petroleum-100, #C8CCD3);margin:0 var(--space--4, 4px)}";const R=class{constructor(t){i(this,t),this.configClose=a(this,"configClose",7),this.configChange=a(this,"configChange",7),this.guidesMap=new Map,this.availableFields=[],this.guidesList=[],this.groupsList=[],this.mainGuide=void 0,this.mainGroupsList=[],this.selectedGuide=void 0,this._formConfig={},this.configOptions=[],this.originalConfigSelected=void 0,this.configSelected=void 0,this.hasChanges=!1,this.optionConfigChanged=!1,this.dataUnit=void 0,this.configManager=void 0,this.ignoreReadOnlyFormFields=void 0,this.messagesBuilder=void 0,this.customGuidesConfig=[]}handleFieldConfigChanged(){this.hasChanges=!0}async handleFormConfigOptionSelected({detail:i}){this.configSelected=i,this.selectedGuide=void 0,await this.loadConfigByUser(),this.optionConfigChanged=!l.equals(this.configSelected,this.originalConfigSelected),this.configSelected.origin===b.DEFAULT&&(this.hasChanges=!1)}async handleAddFieldToGuide({detail:i}){var t,e;const s=this.selectedGuide&&!this.selectedGuide.isCustom&&!this.selectedGuide.isDetail;s||!this.selectedGuide||!this.selectedGuide.isCustom&&!this.selectedGuide.isDetail?s||this.mainGuide?(this.availableFields=[...this.availableFields.filter((t=>t.name!==i.name))],s?await(null===(t=this.refFieldsLayout)||void 0===t?void 0:t.addFieldToLayout(i)):await(null===(e=this.refMainFieldsLayout)||void 0===e?void 0:e.addFieldToLayout(i))):this.showNoGuideSelectedDialog():this.showCanNotAddFieldToGuideDialog()}async handleSetFieldAsAvailable({detail:i}){this.availableFields.some((t=>t.name===i.name))||(this.availableFields=[...this.availableFields,i])}async handleRemoveFieldFromAvailable({detail:i}){this.availableFields=this.availableFields.filter((t=>t.name!==i.name))}observeSelectedGuide(i){var t,e;if((null==i?void 0:i.name)&&(null===(t=this.mainGuide)||void 0===t?void 0:t.name)&&i.name===this.mainGuide.name)return void(this.selectedGuide=void 0);const s=null!==(e=this.guidesMap.get(null==i?void 0:i.name))&&void 0!==e?e:[];this.groupsList=[...s]}observeConfigManager(){this.loadFormConfig()}showNoGuideSelectedDialog(){const i=this.getMessage("snkFormConfig.noGuideSelected.title"),t=this.getMessage("snkFormConfig.noGuideSelected.message");_.alert(i,t)}showCanNotAddFieldToGuideDialog(){const i=this.getMessage("snkFormConfig.canNotAddFieldToGuide.title"),t=this.getMessage("snkFormConfig.canNotAddFieldToGuide.message");_.alert(i,t)}getMessage(i,t){return this.messagesBuilder.getMessage(i,t)}async initializeUserConfig(){if(null!=this.configManager)try{const i=await this.configManager.fetchUserAvailableConfigs();this.configOptions=i;const t=null==this._formConfig||this._formConfig.defaultConfiguration?b.DEFAULT:b.USER;this.configSelected=null==i?void 0:i.find((i=>i.origin===t)),this.originalConfigSelected=null==i?void 0:i.find((i=>i.origin===t))}catch(i){console.error(this.getMessage("snkFormConfig.errors.failFetchUserConfig")),console.error(i)}}async loadConfigByUser(){this.configManager&&this.configSelected&&(this.isConfigDefaultSelected()?await this.handleLoadDefaultConfig():this.loadFormConfig())}async handleLoadDefaultConfig(){const i=await this.configManager.fetchDefaultConfig();if(i)return void this.loadFormConfig(i);const t=this.configManager.getEmptyConfig();t&&this.loadFormConfig(t)}isConfigDefaultSelected(){return this.configSelected.origin===b.DEFAULT}loadFormConfig(i){this._formConfig=i||this.getConfig(),this.loadGuides(),this.initializeAvailableFields()}initializeAvailableFields(){var i;if(null==(null===(i=this._formConfig)||void 0===i?void 0:i.fields))return;const t=[...this._formConfig.fields];this.availableFields=this.dataUnit.metadata.fields.filter((({name:i,visible:e,properties:s})=>{const o=t.some((({name:t})=>t===i));return o||!0!==s.visibleOnConfig||e?!0===e&&!1===o:s.visibleOnConfig}))}getInitialOrder(i){var t,e;return Array.isArray(null===(t=this._formConfig)||void 0===t?void 0:t.tabs)?null===(e=this._formConfig.tabs)||void 0===e?void 0:e.length:i.length>0?Math.max(...i.map((i=>i.order))):0}loadGuides(){var i,t,e,s;this.guidesList=[],this.guidesList.push(...T(this._formConfig,this.getMessage("snkFormConfig.form.mainArea"),this.dataUnit,y.general)),this.guidesList.push(...z(this.dataUnit,this.getInitialOrder(this.guidesList),this.guidesList)),this.guidesList.push(...D(this.customGuidesConfig,this.guidesList)),this.guidesMap=G(null===(i=this._formConfig)||void 0===i?void 0:i.fields,this.guidesList,this.dataUnit,y.general),this.mainGuide=this.guidesList.find((i=>i.name===y.main)),this.mainGroupsList=(null===(t=this.mainGuide)||void 0===t?void 0:t.name)?[...null!==(s=null===(e=this.guidesMap)||void 0===e?void 0:e.get(this.mainGuide.name))&&void 0!==s?s:[]]:[],this.ensureSelectedGuide()}ensureSelectedGuide(){if(this.selectedGuide&&this.guidesList.some((i=>i.name===this.selectedGuide.name)))return;const i=this.guidesList.filter((i=>{var t;return i.visible&&i.name!==(null===(t=this.mainGuide)||void 0===t?void 0:t.name)})).sort(((i,t)=>{var e,s;return(null!==(e=i.order)&&void 0!==e?e:Number.MAX_VALUE)-(null!==(s=t.order)&&void 0!==s?s:Number.MAX_VALUE)}))[0];this.selectedGuide=i}getConfig(){let i=this.configManager.getConfig(this.dataUnit,!1);return i.fields&&0===i.fields.length&&(i=void 0),null==i&&(i=m(this.dataUnit)),l.copy(i)}handleSelectGuide({detail:i}){this.selectedGuide=i}handleLayoutChanged({detail:i}){this.selectedGuide&&(this.hasChanges=!0,this.groupsList=[...i],this.guidesMap.set(this.selectedGuide.name,[...i]))}handleMainLayoutChanged({detail:i}){var t;(null===(t=this.mainGuide)||void 0===t?void 0:t.name)&&(this.hasChanges=!0,this.mainGroupsList=[...i],this.guidesMap.set(this.mainGuide.name,[...i]))}getIsDefaultConfig(){var i;return(null===(i=this.configSelected)||void 0===i?void 0:i.origin)===b.DEFAULT&&!0===this.optionConfigChanged&&!1===this.hasChanges}getTabsToSave(){return this.guidesList.map((i=>({name:i.name,label:i.name===y.main?i.name:i.label,order:i.name===y.main?0:i.order,visible:i.visible})))}async handleSaveConfig(){var i;const t=await this.configManager.saveConfig(this.buildConfigToSave());this.configSelected=null===(i=this.configOptions)||void 0===i?void 0:i.find((i=>i.origin===(this.hasChanges?b.USER:b.DEFAULT))),this.originalConfigSelected=this.configSelected,this.hasChanges=!1,this.optionConfigChanged=!1,_.info(this.getMessage("snkFormConfig.info.successfullyConfigSaved"),{iconName:"check"}),this.configChange.emit(t)}buildConfigToSave(){const i=l.copy(this._formConfig);return i.tabs=this.getTabsToSave(),i.fields=L(this.guidesMap),i.defaultConfiguration=this.getIsDefaultConfig(),i}handleAvailableFieldListChanged({detail:i}){this.availableFields=[...i]}handleSetFieldListAsAvailable({detail:i}){this.availableFields=[...this.availableFields,...i]}handleGuideDeleted({detail:i}){var t,e;const s=i.name,o=null!==(t=this.guidesMap.get(s))&&void 0!==t?t:[],a=[];o.forEach((i=>a.push(...i.fields))),this.availableFields=[...this.availableFields,...a],this.guidesList=[...this.guidesList.filter((i=>i.name!==s))],this.guidesMap.delete(s),(null===(e=this.selectedGuide)||void 0===e?void 0:e.name)===s&&(this.selectedGuide=void 0,this.ensureSelectedGuide()),this.hasChanges=!0}handleGuideListChanged({detail:i}){this.hasChanges=!0,this.guidesList=[...i]}handleGuideRenamed({detail:i}){var t;const e=this.selectedGuide;if(!(null==e?void 0:e.name))return;const s=e.name,o=null!==(t=this.guidesMap.get(s))&&void 0!==t?t:[],a=N(o,i);this.guidesMap.delete(s),this.guidesMap.set(i,a);const n={name:i,label:i,visible:e.visible,order:e.order};this.guidesList=[...this.guidesList.map((i=>i.name===s?n:i))],this.groupsList=[...a],this.selectedGuide=n,this.hasChanges=!0}handleCreateNewGuide(){const i=M(this.guidesList,this.getMessage.bind(this)),t={name:i,label:i,visible:!0,order:this.guidesList.length+1},e={name:w.noGroup,fields:[]};this.guidesList=[...this.guidesList,t],this.guidesMap.set(i,[e]),this.selectedGuide=t,this.hasChanges=!0}getGuideNames(){return[...this.guidesList.map((i=>i.name.toLowerCase())),this.getMessage("snkFormConfig.form.mainArea").toLowerCase()]}async componentWillRender(){if(null==this.messagesBuilder){const i=h.getContextValue("__SNK__APPLICATION__");this.messagesBuilder=i.messagesBuilder}}async componentWillLoad(){this.loadFormConfig(),await this.initializeUserConfig()}render(){var i;return e(s,null,e("snk-dynaform-config-header",{configOptions:this.configOptions,selectedConfig:this.configSelected,messagesBuilder:this.messagesBuilder,hasChanges:this.hasChanges,optionConfigChanged:this.optionConfigChanged,onConfigClose:()=>this.configClose.emit(),onSaveConfig:async()=>await this.handleSaveConfig()}),e("div",{class:"form-config-body"},e("div",{class:"form-config-layout"},e("snk-dynaform-fields-selector",{dataUnit:this.dataUnit,availableFields:this.availableFields,onFieldListChanged:this.handleAvailableFieldListChanged.bind(this),messagesBuilder:this.messagesBuilder}),e("div",{class:"main-editing-area"},this.mainGuide&&e("div",{class:"main-fields-section"},e("snk-dynaform-fields-layout",{ref:i=>this.refMainFieldsLayout=i,selectedGuide:this.mainGuide,guideNames:this.getGuideNames(),groupsList:this.mainGroupsList,messagesBuilder:this.messagesBuilder,dataUnit:this.dataUnit,isMainSection:!0,onLayoutChanged:this.handleMainLayoutChanged.bind(this),onSetFieldListAsAvailable:this.handleSetFieldListAsAvailable.bind(this)})),e("snk-dynaform-guides-configurator",{messagesBuilder:this.messagesBuilder,guidesList:this.guidesList,selectedGuide:this.selectedGuide,mainGuideName:null===(i=this.mainGuide)||void 0===i?void 0:i.name,onGuideSelected:this.handleSelectGuide.bind(this),onGuideListChanged:this.handleGuideListChanged.bind(this),onCreateNewGuide:this.handleCreateNewGuide.bind(this),onGuideDeleted:this.handleGuideDeleted.bind(this)}),e("snk-dynaform-fields-layout",{ref:i=>this.refFieldsLayout=i,selectedGuide:this.selectedGuide,guideNames:this.getGuideNames(),groupsList:this.groupsList,messagesBuilder:this.messagesBuilder,dataUnit:this.dataUnit,onGuideRenamed:this.handleGuideRenamed.bind(this),onLayoutChanged:this.handleLayoutChanged.bind(this),onSetFieldListAsAvailable:this.handleSetFieldListAsAvailable.bind(this)})))))}static get watchers(){return{selectedGuide:["observeSelectedGuide"],configManager:["observeConfigManager"]}}};R.style='.sc-snk-dynaform-form-config-h{display:flex;flex-direction:column;height:100vh;width:100%;font-family:var(--font-pattern, "Roboto");background:white;color:#2b3a54;--snk-form-config-container-height:calc(100vh - 95px);outline:none}.form-config-body.sc-snk-dynaform-form-config{height:var(--snk-form-config-container-height);overflow:hidden;padding-top:var(--space--12, 12px)}.form-config-layout.sc-snk-dynaform-form-config{display:flex;flex-direction:row;height:100%;gap:20px;align-items:stretch}.main-editing-area.sc-snk-dynaform-form-config{display:flex;flex-direction:column;flex:1;min-width:0;height:100%;overflow:hidden;gap:12px}.main-editing-area.sc-snk-dynaform-form-config>snk-dynaform-fields-layout.sc-snk-dynaform-form-config{flex:1 1 auto;min-height:0;overflow:auto;flex-direction:row}.main-editing-area.sc-snk-dynaform-form-config>snk-dynaform-guides-configurator.sc-snk-dynaform-form-config{flex:0 0 auto}.main-fields-section.sc-snk-dynaform-form-config{flex:0 0 40vh;display:flex;flex-direction:column;min-height:0;overflow:hidden}.guide-header.sc-snk-dynaform-form-config{display:flex;width:100%;padding-bottom:12px;border-bottom:1px solid #dce0e8;height:30px;font-weight:500;font-size:16px}';export{I as snk_dynaform_detail_view,R as snk_dynaform_form_config}
@@ -0,0 +1,2 @@
1
+ const e="sankhyablocks",t={allRenderFn:!0,appendChildSlotFix:!1,asyncLoading:!0,asyncQueue:!1,attachStyles:!0,cloneNodeFix:!1,cmpDidLoad:!0,cmpDidRender:!0,cmpDidUnload:!1,cmpDidUpdate:!0,cmpShouldUpdate:!0,cmpWillLoad:!0,cmpWillRender:!0,cmpWillUpdate:!0,connectedCallback:!0,constructableCSS:!0,cssAnnotations:!0,cssVarShim:!1,devTools:!1,disconnectedCallback:!0,dynamicImportShim:!1,element:!1,event:!0,hasRenderFn:!0,hostListener:!0,hostListenerTarget:!0,hostListenerTargetBody:!0,hostListenerTargetDocument:!1,hostListenerTargetParent:!1,hostListenerTargetWindow:!0,hotModuleReplacement:!1,hydrateClientSide:!1,hydrateServerSide:!1,hydratedAttribute:!1,hydratedClass:!0,initializeNextTick:!1,invisiblePrehydration:!1,isDebug:!1,isDev:!1,isTesting:!1,lazyLoad:!0,lifecycle:!0,lifecycleDOMEvents:!1,member:!0,method:!0,mode:!1,observeAttribute:!0,profile:!1,prop:!0,propBoolean:!0,propMutable:!0,propNumber:!0,propString:!0,reflect:!0,safari10:!1,scoped:!0,scopedSlotTextContentFix:!1,scriptDataOpts:!1,shadowDelegatesFocus:!1,shadowDom:!0,shadowDomShim:!1,slot:!0,slotChildNodesFix:!1,slotRelocation:!0,state:!0,style:!0,svg:!1,taskQueue:!0,transformTagName:!1,updatable:!0,vdomAttribute:!0,vdomClass:!0,vdomFunctional:!0,vdomKey:!0,vdomListener:!0,vdomPropOrAttr:!0,vdomRef:!0,vdomRender:!0,vdomStyle:!0,vdomText:!0,vdomXlink:!0,watchCallback:!0};let n,o,s,l,r=0,i=!1,c=!1,a=!1,d=!1,u=null,f=0,p=!1;const m={isDev:!!t.isDev,isBrowser:!0,isServer:!1,isTesting:!!t.isTesting},h={},$=e=>{const t=new URL(e,ht.t);return t.origin!==ut.location.origin?t.href:t.pathname},y=(e,n="")=>{if(t.profile&&performance.mark){const t=`st:${e}:${n}:${r++}`;return performance.mark(t),()=>performance.measure(`[Stencil] ${e}() <${n}>`,t)}return()=>{}},b="s-id",v="sty-id",g="c-id",w="http://www.w3.org/1999/xlink",C={},S=e=>"object"==(e=typeof e)||"function"===e;function k(e){var t,n,o;return null!==(o=null===(n=null===(t=e.head)||void 0===t?void 0:t.querySelector('meta[name="csp-nonce"]'))||void 0===n?void 0:n.getAttribute("content"))&&void 0!==o?o:void 0}const x=(e,n,...o)=>{let s=null,l=null,r=null,i=!1,c=!1;const a=[],d=n=>{for(let o=0;o<n.length;o++)s=n[o],Array.isArray(s)?d(s):null!=s&&"boolean"!=typeof s&&((i="function"!=typeof e&&!S(s))?s+="":t.isDev&&"function"!=typeof e&&void 0===s.o&&st("vNode passed as children has unexpected type.\nMake sure it's using the correct h() function.\nEmpty objects can also be the cause, look for JSX comments that became objects."),i&&c?a[a.length-1].l+=s:a.push(i?T(null,s):s),c=i)};if(d(o),n&&(t.isDev&&"input"===e&&D(n),t.vdomKey&&n.key&&(l=n.key),t.slotRelocation&&n.name&&(r=n.name),t.vdomClass)){const e=n.className||n.class;e&&(n.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}if(t.isDev&&a.some(R)&&st("The <Host> must be the single root component. Make sure:\n- You are NOT using hostData() and <Host> in the same component.\n- <Host> is used once, and it's the single root component of the render() function."),t.vdomFunctional&&"function"==typeof e)return e(null===n?{}:n,a,j);const u=T(e,null);return u.i=n,a.length>0&&(u.u=a),t.vdomKey&&(u.p=l),t.slotRelocation&&(u.m=r),u},T=(e,n)=>{const o={o:0,$:e,l:n,v:null,u:null};return t.vdomAttribute&&(o.i=null),t.vdomKey&&(o.p=null),t.slotRelocation&&(o.m=null),o},L={},R=e=>e&&e.$===L,j={forEach:(e,t)=>e.map(E).forEach(t),map:(e,t)=>e.map(E).map(t).map(O)},E=e=>({vattrs:e.i,vchildren:e.u,vkey:e.p,vname:e.m,vtag:e.$,vtext:e.l}),O=e=>{if("function"==typeof e.vtag){const t=Object.assign({},e.vattrs);return e.vkey&&(t.key=e.vkey),e.vname&&(t.name=e.vname),x(e.vtag,t,...e.vchildren||[])}const t=T(e.vtag,e.vtext);return t.i=e.vattrs,t.u=e.vchildren,t.p=e.vkey,t.m=e.vname,t},D=e=>{const t=Object.keys(e),n=t.indexOf("value");if(-1===n)return;const o=t.indexOf("type"),s=t.indexOf("min"),l=t.indexOf("max"),r=t.indexOf("step");(n<o||n<s||n<l||n<r)&&lt('The "value" prop of <input> should be set after "min", "max", "type" and "step"')},M=(e,n,o,s,l,r,i)=>{let c,a,d,u;if(1===r.nodeType){for(c=r.getAttribute(g),c&&(a=c.split("."),a[0]!==i&&"0"!==a[0]||(d={o:0,g:a[0],C:a[1],S:a[2],k:a[3],$:r.tagName.toLowerCase(),v:r,i:null,u:null,p:null,m:null,l:null},n.push(d),r.removeAttribute(g),e.u||(e.u=[]),e.u[d.k]=d,e=d,s&&"0"===d.S&&(s[d.k]=d.v))),u=r.childNodes.length-1;u>=0;u--)M(e,n,o,s,l,r.childNodes[u],i);if(r.shadowRoot)for(u=r.shadowRoot.childNodes.length-1;u>=0;u--)M(e,n,o,s,l,r.shadowRoot.childNodes[u],i)}else if(8===r.nodeType)a=r.nodeValue.split("."),a[1]!==i&&"0"!==a[1]||(c=a[0],d={o:0,g:a[1],C:a[2],S:a[3],k:a[4],v:r,i:null,u:null,p:null,m:null,$:null,l:null},"t"===c?(d.v=r.nextSibling,d.v&&3===d.v.nodeType&&(d.l=d.v.textContent,n.push(d),r.remove(),e.u||(e.u=[]),e.u[d.k]=d,s&&"0"===d.S&&(s[d.k]=d.v))):d.g===i&&("s"===c?(d.$="slot",r["s-sn"]=a[5]?d.m=a[5]:"",r["s-sr"]=!0,t.shadowDom&&s&&(d.v=pt.createElement(d.$),d.m&&d.v.setAttribute("name",d.m),r.parentNode.insertBefore(d.v,r),r.remove(),"0"===d.S&&(s[d.k]=d.v)),o.push(d),e.u||(e.u=[]),e.u[d.k]=d):"r"===c&&(t.shadowDom&&s?r.remove():t.slotRelocation&&(l["s-cr"]=r,r["s-cn"]=!0))));else if(e&&"style"===e.$){const t=T(null,r.textContent);t.v=r,t.k="0",e.u=[t]}},N=(e,t)=>{if(1===e.nodeType){let n=0;for(;n<e.childNodes.length;n++)N(e.childNodes[n],t);if(e.shadowRoot)for(n=0;n<e.shadowRoot.childNodes.length;n++)N(e.shadowRoot.childNodes[n],t)}else if(8===e.nodeType){const n=e.nodeValue.split(".");"o"===n[0]&&(t.set(n[1]+"."+n[2],e),e.nodeValue="",e["s-en"]=n[3])}},P=e=>dt.map((t=>t(e))).find((e=>!!e)),I=(e,n)=>null==e||S(e)?e:t.propBoolean&&4&n?"false"!==e&&(""===e||!!e):t.propNumber&&2&n?parseFloat(e):t.propString&&1&n?e+"":e,U=e=>t.lazyLoad?Ge(e).T:e,H=(e,n,o)=>{const s=U(e);return{emit:e=>(t.isDev&&!s.isConnected&&lt(`The "${n}" event was emitted, but the dispatcher node is no longer connected to the dom.`),F(s,n,{bubbles:!!(4&o),composed:!!(2&o),cancelable:!!(1&o),detail:e}))}},F=(e,t,n)=>{const o=ht.ce(t,n);return e.dispatchEvent(o),o},W=new WeakMap,A=(e,t,n)=>{let o=at.get(e);bt&&n?(o=o||new CSSStyleSheet,"string"==typeof o?o=t:o.replaceSync(t)):o=t,at.set(e,o)},_=(e,n,o)=>{var s;let l=z(n,o);const r=at.get(l);if(!t.attachStyles)return l;if(e=11===e.nodeType?e:pt,r)if("string"==typeof r){let n,o=W.get(e=e.head||e);if(o||W.set(e,o=new Set),!o.has(l)){if(t.hydrateClientSide&&e.host&&(n=e.querySelector(`[${v}="${l}"]`)))n.innerHTML=r;else{n=pt.createElement("style"),n.innerHTML=r;const o=null!==(s=ht.L)&&void 0!==s?s:k(pt);null!=o&&n.setAttribute("nonce",o),(t.hydrateServerSide||t.hotModuleReplacement)&&n.setAttribute(v,l),e.insertBefore(n,e.querySelector("link"))}o&&o.add(l)}}else t.constructableCSS&&!e.adoptedStyleSheets.includes(r)&&(e.adoptedStyleSheets=[...e.adoptedStyleSheets,r]);return l},V=e=>{const n=e.R,o=e.T,s=n.o,l=y("attachStyles",n.j),r=_(t.shadowDom&&$t&&o.shadowRoot?o.shadowRoot:o.getRootNode(),n,e.O);(t.shadowDom||t.scoped)&&t.cssAnnotations&&10&s&&(o["s-sc"]=r,o.classList.add(r+"-h"),t.scoped&&2&s&&o.classList.add(r+"-s")),l()},z=(e,n)=>"sc-"+(t.mode&&n&&32&e.o?e.j+"-"+n:e.j),B=e=>e.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g,"$1{"),X=(e,n,o,s,l,r)=>{if(o!==s){let i=tt(e,n),c=n.toLowerCase();if(t.vdomClass&&"class"===n){const t=e.classList,n=J(o),l=J(s);t.remove(...n.filter((e=>e&&!l.includes(e)))),t.add(...l.filter((e=>e&&!n.includes(e))))}else if(t.vdomStyle&&"style"===n){if(t.updatable)for(const n in o)s&&null!=s[n]||(!t.hydrateServerSide&&n.includes("-")?e.style.removeProperty(n):e.style[n]="");for(const n in s)o&&s[n]===o[n]||(!t.hydrateServerSide&&n.includes("-")?e.style.setProperty(n,s[n]):e.style[n]=s[n])}else if(t.vdomKey&&"key"===n);else if(t.vdomRef&&"ref"===n)s&&s(e);else if(!t.vdomListener||(t.lazyLoad?i:e.__lookupSetter__(n))||"o"!==n[0]||"n"!==n[1]){if(t.vdomPropOrAttr){const a=S(s);if((i||a&&null!==s)&&!l)try{if(e.tagName.includes("-"))e[n]=s;else{const t=null==s?"":s;"list"===n?i=!1:null!=o&&e[n]==t||(e[n]=t)}}catch(e){}let d=!1;t.vdomXlink&&c!==(c=c.replace(/^xlink\:?/,""))&&(n=c,d=!0),null==s||!1===s?!1===s&&""!==e.getAttribute(n)||(t.vdomXlink&&d?e.removeAttributeNS(w,n):e.removeAttribute(n)):(!i||4&r||l)&&!a&&(s=!0===s?"":s,t.vdomXlink&&d?e.setAttributeNS(w,n,s):e.setAttribute(n,s))}}else n="-"===n[2]?n.slice(3):tt(ut,c)?c.slice(2):c[2]+n.slice(3),o&&ht.rel(e,n,o,!1),s&&ht.ael(e,n,s,!1)}},q=/\s/,J=e=>e?e.split(q):[],Q=(e,n,o,s)=>{const l=11===n.v.nodeType&&n.v.host?n.v.host:n.v,r=e&&e.i||C,i=n.i||C;if(t.updatable)for(s in r)s in i||X(l,s,r[s],void 0,o,n.o);for(s in i)X(l,s,r[s],i[s],o,n.o)},Y=(e,l,r,c)=>{const u=l.u[r];let f,p,m,h=0;if(t.slotRelocation&&!i&&(a=!0,"slot"===u.$&&(n&&c.classList.add(n+"-s"),u.o|=u.u?2:1)),t.isDev&&u.v&&st(`The JSX ${null!==u.l?`"${u.l}" text`:`"${u.$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`),t.vdomText&&null!==u.l)f=u.v=pt.createTextNode(u.l);else if(t.slotRelocation&&1&u.o)f=u.v=t.isDebug||t.hydrateServerSide?de(u):pt.createTextNode("");else{if(t.svg&&!d&&(d="svg"===u.$),f=u.v=t.svg?pt.createElementNS(d?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",t.slotRelocation&&2&u.o?"slot-fb":u.$):pt.createElement(t.slotRelocation&&2&u.o?"slot-fb":u.$),t.svg&&d&&"foreignObject"===u.$&&(d=!1),t.vdomAttribute&&Q(null,u,d),(t.shadowDom||t.scoped)&&null!=n&&f["s-si"]!==n&&f.classList.add(f["s-si"]=n),u.u)for(h=0;h<u.u.length;++h)p=Y(e,u,h,f),p&&f.appendChild(p);t.svg&&("svg"===u.$?d=!1:"foreignObject"===f.tagName&&(d=!0))}return t.slotRelocation&&(f["s-hn"]=s,3&u.o&&(f["s-sr"]=!0,f["s-cr"]=o,f["s-sn"]=u.m||"",m=e&&e.u&&e.u[r],m&&m.$===u.$&&e.v&&K(e.v,!1))),f},K=(e,t)=>{ht.o|=1;const n=e.childNodes;for(let e=n.length-1;e>=0;e--){const o=n[e];o["s-hn"]!==s&&o["s-ol"]&&(ne(o).insertBefore(o,te(o)),o["s-ol"].remove(),o["s-ol"]=void 0,a=!0),t&&K(o,t)}ht.o&=-2},G=(e,n,o,l,r,i)=>{let c,a=t.slotRelocation&&e["s-cr"]&&e["s-cr"].parentNode||e;for(t.shadowDom&&a.shadowRoot&&a.tagName===s&&(a=a.shadowRoot);r<=i;++r)l[r]&&(c=Y(null,o,r,e),c&&(l[r].v=c,a.insertBefore(c,t.slotRelocation?te(n):n)))},Z=(e,n,o,s,l)=>{for(;n<=o;++n)(s=e[n])&&(l=s.v,ce(s),t.slotRelocation&&(c=!0,l["s-ol"]?l["s-ol"].remove():K(l,!0)),l.remove())},ee=(e,n)=>e.$===n.$&&(t.slotRelocation&&"slot"===e.$?e.m===n.m:!t.vdomKey||e.p===n.p),te=e=>e&&e["s-ol"]||e,ne=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,oe=(e,n)=>{const o=n.v=e.v,s=e.u,l=n.u,r=n.$,i=n.l;let c;t.vdomText&&null!==i?t.vdomText&&t.slotRelocation&&(c=o["s-cr"])?c.parentNode.textContent=i:t.vdomText&&e.l!==i&&(o.data=i):(t.svg&&(d="svg"===r||"foreignObject"!==r&&d),(t.vdomAttribute||t.reflect)&&(t.slot&&"slot"===r||Q(e,n,d)),t.updatable&&null!==s&&null!==l?((e,n,o,s)=>{let l,r,i=0,c=0,a=0,d=0,u=n.length-1,f=n[0],p=n[u],m=s.length-1,h=s[0],$=s[m];for(;i<=u&&c<=m;)if(null==f)f=n[++i];else if(null==p)p=n[--u];else if(null==h)h=s[++c];else if(null==$)$=s[--m];else if(ee(f,h))oe(f,h),f=n[++i],h=s[++c];else if(ee(p,$))oe(p,$),p=n[--u],$=s[--m];else if(ee(f,$))!t.slotRelocation||"slot"!==f.$&&"slot"!==$.$||K(f.v.parentNode,!1),oe(f,$),e.insertBefore(f.v,p.v.nextSibling),f=n[++i],$=s[--m];else if(ee(p,h))!t.slotRelocation||"slot"!==f.$&&"slot"!==$.$||K(p.v.parentNode,!1),oe(p,h),e.insertBefore(p.v,f.v),p=n[--u],h=s[++c];else{if(a=-1,t.vdomKey)for(d=i;d<=u;++d)if(n[d]&&null!==n[d].p&&n[d].p===h.p){a=d;break}t.vdomKey&&a>=0?(r=n[a],r.$!==h.$?l=Y(n&&n[c],o,a,e):(oe(r,h),n[a]=void 0,l=r.v),h=s[++c]):(l=Y(n&&n[c],o,c,e),h=s[++c]),l&&(t.slotRelocation?ne(f.v).insertBefore(l,te(f.v)):f.v.parentNode.insertBefore(l,f.v))}i>u?G(e,null==s[m+1]?null:s[m+1].v,o,s,c,m):t.updatable&&c>m&&Z(n,i,u)})(o,s,n,l):null!==l?(t.updatable&&t.vdomText&&null!==e.l&&(o.textContent=""),G(o,null,n,l,0,l.length-1)):t.updatable&&null!==s&&Z(s,0,s.length-1),t.svg&&d&&"svg"===r&&(d=!1))},se=e=>{const t=e.childNodes;let n,o,s,l,r,i;for(o=0,s=t.length;o<s;o++)if(n=t[o],1===n.nodeType){if(n["s-sr"])for(r=n["s-sn"],n.hidden=!1,l=0;l<s;l++)if(i=t[l].nodeType,t[l]["s-hn"]!==n["s-hn"]||""!==r){if(1===i&&r===t[l].getAttribute("slot")){n.hidden=!0;break}}else if(1===i||3===i&&""!==t[l].textContent.trim()){n.hidden=!0;break}se(n)}},le=[],re=e=>{let t,n,o,s,l,r,i=0;const a=e.childNodes,d=a.length;for(;i<d;i++){if(t=a[i],t["s-sr"]&&(n=t["s-cr"])&&n.parentNode)for(o=n.parentNode.childNodes,s=t["s-sn"],r=o.length-1;r>=0;r--)n=o[r],n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||(ie(n,s)?(l=le.find((e=>e.D===n)),c=!0,n["s-sn"]=n["s-sn"]||s,l?l.M=t:le.push({M:t,D:n}),n["s-sr"]&&le.map((e=>{ie(e.D,n["s-sn"])&&(l=le.find((e=>e.D===n)),l&&!e.M&&(e.M=l.M))}))):le.some((e=>e.D===n))||le.push({D:n}));1===t.nodeType&&re(t)}},ie=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,ce=e=>{t.vdomRef&&(e.i&&e.i.ref&&e.i.ref(null),e.u&&e.u.map(ce))},ae=(e,l)=>{const r=e.T,d=e.R,u=e.N||T(null,null),f=R(l)?l:x(null,null,l);if(s=r.tagName,t.isDev&&Array.isArray(l)&&l.some(R))throw Error(`The <Host> must be the single root component.\nLooks like the render() function of "${s.toLowerCase()}" is returning an array that contains the <Host>.\n\nThe render() function should look like this instead:\n\nrender() {\n // Do not return an array\n return (\n <Host>{content}</Host>\n );\n}\n `);if(t.reflect&&d.P&&(f.i=f.i||{},d.P.map((([e,t])=>f.i[t]=r[e]))),f.$=null,f.o|=4,e.N=f,f.v=u.v=t.shadowDom&&r.shadowRoot||r,(t.scoped||t.shadowDom)&&(n=r["s-sc"]),t.slotRelocation&&(o=r["s-cr"],i=$t&&0!=(1&d.o),c=!1),oe(u,f),t.slotRelocation){if(ht.o|=1,a){let e,n,o,s,l,r;re(f.v);let i=0;for(;i<le.length;i++)e=le[i],n=e.D,n["s-ol"]||(o=t.isDebug||t.hydrateServerSide?ue(n):pt.createTextNode(""),o["s-nr"]=n,n.parentNode.insertBefore(n["s-ol"]=o,n));for(i=0;i<le.length;i++)if(e=le[i],n=e.D,e.M){for(s=e.M.parentNode,l=e.M.nextSibling,o=n["s-ol"];o=o.previousSibling;)if(r=o["s-nr"],r&&r["s-sn"]===n["s-sn"]&&s===r.parentNode&&(r=r.nextSibling,!r||!r["s-nr"])){l=r;break}(!l&&s!==n.parentNode||n.nextSibling!==l)&&n!==l&&(!n["s-hn"]&&n["s-ol"]&&(n["s-hn"]=n["s-ol"].parentNode.nodeName),s.insertBefore(n,l))}else 1===n.nodeType&&(n.hidden=!0)}c&&se(f.v),ht.o&=-2,le.length=0}},de=e=>pt.createComment(`<slot${e.m?' name="'+e.m+'"':""}> (host=${s.toLowerCase()})`),ue=e=>pt.createComment("org-location for "+(e.localName?`<${e.localName}> (host=${e["s-hn"]})`:`[${e.textContent}]`)),fe=(e,n)=>{t.asyncLoading&&n&&!e.I&&n["s-p"]&&n["s-p"].push(new Promise((t=>e.I=t)))},pe=(e,n)=>{if(t.taskQueue&&t.updatable&&(e.o|=16),t.asyncLoading&&4&e.o)return void(e.o|=512);fe(e,e.U);const o=()=>me(e,n);return t.taskQueue?Rt(o):o()},me=(e,n)=>{const o=e.T,s=y("scheduleUpdate",e.R.j),l=t.lazyLoad?e.F:o;let r;return n?(t.lazyLoad&&t.hostListener&&(e.o|=256,e.W&&(e.W.map((([e,t])=>ge(l,e,t))),e.W=null)),Ce(o,"componentWillLoad"),t.cmpWillLoad&&(r=ge(l,"componentWillLoad"))):(Ce(o,"componentWillUpdate"),t.cmpWillUpdate&&(r=ge(l,"componentWillUpdate"))),Ce(o,"componentWillRender"),t.cmpWillRender&&(r=we(r,(()=>ge(l,"componentWillRender")))),s(),we(r,(()=>he(e,l,n)))},he=async(e,n,o)=>{const s=e.T,l=y("update",e.R.j),r=s["s-rc"];t.style&&o&&V(e);const i=y("render",e.R.j);if(t.isDev&&(e.o|=1024),t.hydrateServerSide?await $e(e,n,s):$e(e,n,s),t.isDev&&(e.A++,e.o&=-1025),t.hydrateServerSide)try{ke(s),o&&(1&e.R.o?s["s-en"]="":2&e.R.o&&(s["s-en"]="c"))}catch(e){nt(e,s)}if(t.asyncLoading&&r&&(r.map((e=>e())),s["s-rc"]=void 0),i(),l(),t.asyncLoading){const t=s["s-p"],n=()=>ye(e);0===t.length?n():(Promise.all(t).then(n),e.o|=4,t.length=0)}else ye(e)},$e=(e,n,o)=>{const s=!!t.allRenderFn,l=!!t.lazyLoad,r=!!t.taskQueue,i=!!t.updatable;try{if(u=n,n=(s||n.render)&&n.render(),i&&r&&(e.o&=-17),(i||l)&&(e.o|=2),t.hasRenderFn||t.reflect)if(t.vdomRender||t.reflect){if(t.hydrateServerSide)return Promise.resolve(n).then((t=>ae(e,t)));ae(e,n)}else o.textContent=n}catch(t){nt(t,e.T)}return u=null,null},ye=e=>{const n=e.R.j,o=e.T,s=y("postUpdate",n),l=t.lazyLoad?e.F:o,r=e.U;t.cmpDidRender&&(t.isDev&&(e.o|=1024),ge(l,"componentDidRender"),t.isDev&&(e.o&=-1025)),Ce(o,"componentDidRender"),64&e.o?(t.cmpDidUpdate&&(t.isDev&&(e.o|=1024),ge(l,"componentDidUpdate"),t.isDev&&(e.o&=-1025)),Ce(o,"componentDidUpdate"),s()):(e.o|=64,t.asyncLoading&&t.cssAnnotations&&Se(o),t.cmpDidLoad&&(t.isDev&&(e.o|=2048),ge(l,"componentDidLoad"),t.isDev&&(e.o&=-2049)),Ce(o,"componentDidLoad"),s(),t.asyncLoading&&(e._(o),r||ve(n))),t.hotModuleReplacement&&o["s-hmr-load"]&&o["s-hmr-load"](),t.method&&t.lazyLoad&&e.V(o),t.asyncLoading&&(e.I&&(e.I(),e.I=void 0),512&e.o&&Tt((()=>pe(e,!1))),e.o&=-517)},be=e=>{if(t.updatable){const t=Ge(e),n=t.T.isConnected;return n&&2==(18&t.o)&&pe(t,!1),n}return!1},ve=n=>{t.cssAnnotations&&Se(pt.documentElement),t.asyncQueue&&(ht.o|=2),Tt((()=>F(ut,"appload",{detail:{namespace:e}}))),t.profile&&performance.measure&&performance.measure(`[Stencil] ${e} initial load (by ${n})`,"st:app:start")},ge=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){nt(e)}},we=(e,t)=>e&&e.then?e.then(t):t(),Ce=(n,o)=>{t.lifecycleDOMEvents&&F(n,"stencil_"+o,{bubbles:!0,composed:!0,detail:{namespace:e}})},Se=e=>t.hydratedClass?e.classList.add("hydrated"):t.hydratedAttribute?e.setAttribute("hydrated",""):void 0,ke=e=>{const t=e.children;if(null!=t)for(let e=0,n=t.length;e<n;e++){const n=t[e];"function"==typeof n.connectedCallback&&n.connectedCallback(),ke(n)}},xe=(e,t)=>Ge(e).B.get(t),Te=(e,n,o,s)=>{const l=Ge(e),r=t.lazyLoad?l.T:e,i=l.B.get(n),c=l.o,a=t.lazyLoad?l.F:r;if(o=I(o,s.X[n][0]),(!t.lazyLoad||!(8&c)||void 0===i)&&o!==i&&(!Number.isNaN(i)||!Number.isNaN(o))&&(l.B.set(n,o),t.isDev&&(1024&l.o?lt(`The state/prop "${n}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`,"\nElement",r,"\nNew value",o,"\nOld value",i):2048&l.o&&lt(`The state/prop "${n}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`,"\nElement",r,"\nNew value",o,"\nOld value",i)),!t.lazyLoad||a)){if(t.watchCallback&&s.q&&128&c){const e=s.q[n];e&&e.map((e=>{try{a[e](o,i,n)}catch(e){nt(e,r)}}))}if(t.updatable&&2==(18&c)){if(t.cmpShouldUpdate&&a.componentShouldUpdate&&!1===a.componentShouldUpdate(o,i,n))return;pe(l,!1)}}},Le=(e,n,o)=>{if(t.member&&n.X){t.watchCallback&&e.watchers&&(n.q=e.watchers);const s=Object.entries(n.X),l=e.prototype;if(s.map((([e,[s]])=>{(t.prop||t.state)&&(31&s||(!t.lazyLoad||2&o)&&32&s)?Object.defineProperty(l,e,{get(){return xe(this,e)},set(l){t.isDev&&0==(1&o)&&0==(8&Ge(this).o)&&0!=(31&s)&&0==(1024&s)&&lt(`@Prop() "${e}" on <${n.j}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`),Te(this,e,l,n)},configurable:!0,enumerable:!0}):t.lazyLoad&&t.method&&1&o&&64&s&&Object.defineProperty(l,e,{value(...t){const n=Ge(this);return n.J.then((()=>n.F[e](...t)))}})})),t.observeAttribute&&(!t.lazyLoad||1&o)){const o=new Map;l.attributeChangedCallback=function(e,t,n){ht.jmp((()=>{const t=o.get(e);if(this.hasOwnProperty(t))n=this[t],delete this[t];else if(l.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==n)return;this[t]=(null!==n||"boolean"!=typeof this[t])&&n}))},e.observedAttributes=s.filter((([e,t])=>15&t[0])).map((([e,s])=>{const l=s[1]||e;return o.set(l,e),t.reflect&&512&s[0]&&n.P.push([e,l]),l}))}}return e},Re=async(e,n,o,s,l)=>{if((t.lazyLoad||t.hydrateServerSide||t.style)&&0==(32&n.o)){if(t.lazyLoad||t.hydrateClientSide){if(n.o|=32,(l=ct(o,n,s)).then){const e=((e,n)=>t.profile&&performance.mark?(0===performance.getEntriesByName(e,"mark").length&&performance.mark(e),()=>{0===performance.getEntriesByName(n,"measure").length&&performance.measure(n,e)}):()=>{})(`st:load:${o.j}:${n.O}`,`[Stencil] Load module for <${o.j}>`);l=await l,e()}if((t.isDev||t.isDebug)&&!l)throw Error(`Constructor for "${o.j}#${n.O}" was not found`);t.member&&!l.isProxied&&(t.watchCallback&&(o.q=l.watchers),Le(l,o,2),l.isProxied=!0);const e=y("createInstance",o.j);t.member&&(n.o|=8);try{new l(n)}catch(e){nt(e)}t.member&&(n.o&=-9),t.watchCallback&&(n.o|=128),e(),je(n.F)}else l=e.constructor,n.o|=32,customElements.whenDefined(o.j).then((()=>n.o|=128));if(t.style&&l.style){let s=l.style;t.mode&&"string"!=typeof s&&(s=s[n.O=P(e)],t.hydrateServerSide&&n.O&&e.setAttribute("s-mode",n.O));const r=z(o,n.O);if(!at.has(r)){const e=y("registerStyles",o.j);!t.hydrateServerSide&&t.shadowDom&&t.shadowDomShim&&8&o.o&&(s=await import("./p-da455c82.js").then((e=>e.scopeCss(s,r,!1)))),A(r,s,!!(1&o.o)),e()}}}const r=n.U,i=()=>pe(n,!0);t.asyncLoading&&r&&r["s-rc"]?r["s-rc"].push(i):i()},je=e=>{t.lazyLoad&&t.connectedCallback&&ge(e,"connectedCallback")},Ee=e=>{if(0==(1&ht.o)){const n=Ge(e),o=n.R,s=y("connectedCallback",o.j);if(t.hostListenerTargetParent&&Ve(e,n,o.Y,!0),1&n.o)Ve(e,n,o.Y,!1),je(n.F);else{let s;if(n.o|=1,t.hydrateClientSide&&(s=e.getAttribute(b),s)){if(t.shadowDom&&$t&&1&o.o){const n=t.mode?_(e.shadowRoot,o,e.getAttribute("s-mode")):_(e.shadowRoot,o);e.classList.remove(n+"-h",n+"-s")}((e,n,o,s)=>{const l=y("hydrateClient",n),r=e.shadowRoot,i=[],c=t.shadowDom&&r?[]:null,a=s.N=T(n,null);ht.K||N(pt.body,ht.K=new Map),e[b]=o,e.removeAttribute(b),M(a,i,[],c,e,e,o),i.map((e=>{const t=e.g+"."+e.C,o=ht.K.get(t),s=e.v;o&&$t&&""===o["s-en"]&&o.parentNode.insertBefore(s,o.nextSibling),r||(s["s-hn"]=n,o&&(s["s-ol"]=o,s["s-ol"]["s-nr"]=s)),ht.K.delete(t)})),t.shadowDom&&r&&c.map((e=>{e&&r.appendChild(e)})),l()})(e,o.j,s,n)}if(t.slotRelocation&&!s&&(t.hydrateServerSide||(t.slot||t.shadowDom)&&12&o.o)&&Oe(e),t.asyncLoading){let o=e;for(;o=o.parentNode||o.host;)if(t.hydrateClientSide&&1===o.nodeType&&o.hasAttribute("s-id")&&o["s-p"]||o["s-p"]){fe(n,n.U=o);break}}t.prop&&!t.hydrateServerSide&&o.X&&Object.entries(o.X).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),t.initializeNextTick?Tt((()=>Re(e,n,o))):Re(e,n,o)}s()}},Oe=e=>{const n=e["s-cr"]=pt.createComment(t.isDebug?`content-ref (host=${e.localName})`:"");n["s-cn"]=!0,e.insertBefore(n,e.firstChild)},De=e=>{if(0==(1&ht.o)){const n=Ge(e),o=t.lazyLoad?n.F:e;t.hostListener&&n.G&&(n.G.map((e=>e())),n.G=void 0),t.lazyLoad&&t.disconnectedCallback&&ge(o,"disconnectedCallback"),t.cmpDidUnload&&ge(o,"componentDidUnload")}},Me=(e,n)=>{const o={o:n[0],j:n[1]};t.member&&(o.X=n[2]),t.hostListener&&(o.Y=n[3]),t.watchCallback&&(o.q=e.q),t.reflect&&(o.P=[]),t.shadowDom&&!$t&&1&o.o&&(o.o|=8);const s=e.prototype.connectedCallback,l=e.prototype.disconnectedCallback;return Object.assign(e.prototype,{__registerHost(){et(this,o)},connectedCallback(){Ee(this),t.connectedCallback&&s&&s.call(this)},disconnectedCallback(){De(this),t.disconnectedCallback&&l&&l.call(this)},__attachShadow(){$t?this.attachShadow(t.shadowDelegatesFocus?{mode:"open",delegatesFocus:!!(16&o.o)}:{mode:"open"}):this.shadowRoot=this}}),e.is=o.j,Le(e,o,3)},Ne=e=>{const n=e.cloneNode;e.cloneNode=function(e){const o=this,s=!!t.shadowDom&&o.shadowRoot&&$t,l=n.call(o,!!s&&e);if(t.slot&&!s&&e){let e,n,s=0;const r=["s-id","s-cr","s-lr","s-rc","s-sc","s-p","s-cn","s-sr","s-sn","s-hn","s-ol","s-nr","s-si"];for(;s<o.childNodes.length;s++)e=o.childNodes[s]["s-nr"],n=r.every((e=>!o.childNodes[s][e])),e&&(t.appendChildSlotFix&&l.__appendChild?l.__appendChild(e.cloneNode(!0)):l.appendChild(e.cloneNode(!0))),n&&l.appendChild(o.childNodes[s].cloneNode(!0))}return l}},Pe=e=>{e.__appendChild=e.appendChild,e.appendChild=function(e){const t=e["s-sn"]=He(e),n=Fe(this.childNodes,t);if(n){const o=We(n,t),s=o[o.length-1];return s.parentNode.insertBefore(e,s.nextSibling)}return this.__appendChild(e)}},Ie=(e,n)=>{if(t.scoped&&2&n.o){const t=Object.getOwnPropertyDescriptor(Node.prototype,"textContent");Object.defineProperty(e,"__textContent",t),Object.defineProperty(e,"textContent",{get(){var e;const t=Fe(this.childNodes,"");return 3===(null===(e=null==t?void 0:t.nextSibling)||void 0===e?void 0:e.nodeType)?t.nextSibling.textContent:t?t.textContent:this.__textContent},set(e){var t;const n=Fe(this.childNodes,"");if(3===(null===(t=null==n?void 0:n.nextSibling)||void 0===t?void 0:t.nodeType))n.nextSibling.textContent=e;else if(n)n.textContent=e;else{this.__textContent=e;const t=this["s-cr"];t&&this.insertBefore(t,this.firstChild)}}})}},Ue=(e,t)=>{class n extends Array{item(e){return this[e]}}if(8&t.o){const t=e.__lookupGetter__("childNodes");Object.defineProperty(e,"children",{get(){return this.childNodes.map((e=>1===e.nodeType))}}),Object.defineProperty(e,"childElementCount",{get:()=>e.children.length}),Object.defineProperty(e,"childNodes",{get(){const e=t.call(this);if(0==(1&ht.o)&&2&Ge(this).o){const t=new n;for(let n=0;n<e.length;n++){const o=e[n]["s-nr"];o&&t.push(o)}return t}return n.from(e)}})}},He=e=>e["s-sn"]||1===e.nodeType&&e.getAttribute("slot")||"",Fe=(e,t)=>{let n,o=0;for(;o<e.length;o++){if(n=e[o],n["s-sr"]&&n["s-sn"]===t)return n;if(n=Fe(n.childNodes,t),n)return n}return null},We=(e,t)=>{const n=[e];for(;(e=e.nextSibling)&&e["s-sn"]===t;)n.push(e);return n},Ae=(e,n={})=>{var o;t.profile&&performance.mark&&performance.mark("st:app:start"),(()=>{if(t.devTools){const e=ut.stencil=ut.stencil||{},t=e.inspect;e.inspect=e=>{let n=(e=>{const t=Ge(e);if(!t)return;const n=t.o,o=t.T;return{renderCount:t.A,flags:{hasRendered:!!(2&n),hasConnected:!!(1&n),isWaitingForChildren:!!(4&n),isConstructingInstance:!!(8&n),isQueuedForUpdate:!!(16&n),hasInitializedComponent:!!(32&n),hasLoadedComponent:!!(64&n),isWatchReady:!!(128&n),isListenReady:!!(256&n),needsRerender:!!(512&n)},instanceValues:t.B,ancestorComponent:t.U,hostElement:o,lazyInstance:t.F,vnode:t.N,modeName:t.O,onReadyPromise:t.Z,onReadyResolve:t._,onInstancePromise:t.J,onInstanceResolve:t.V,onRenderResolve:t.I,queuedListeners:t.W,rmListeners:t.G,"s-id":o["s-id"],"s-cr":o["s-cr"],"s-lr":o["s-lr"],"s-p":o["s-p"],"s-rc":o["s-rc"],"s-sc":o["s-sc"]}})(e);return n||"function"!=typeof t||(n=t(e)),n}}})();const s=y("bootstrapLazy"),l=[],r=n.exclude||[],i=ut.customElements,c=pt.head,a=c.querySelector("meta[charset]"),d=pt.createElement("style"),u=[],f=pt.querySelectorAll(`[${v}]`);let p,m=!0,h=0;if(Object.assign(ht,n),ht.t=new URL(n.resourcesUrl||"./",pt.baseURI).href,t.asyncQueue&&n.syncQueue&&(ht.o|=4),t.hydrateClientSide&&(ht.o|=2),t.hydrateClientSide&&t.shadowDom)for(;h<f.length;h++)A(f[h].getAttribute(v),B(f[h].innerHTML),!0);if(e.map((e=>{e[1].map((o=>{const s={o:o[0],j:o[1],X:o[2],Y:o[3]};t.member&&(s.X=o[2]),t.hostListener&&(s.Y=o[3]),t.reflect&&(s.P=[]),t.watchCallback&&(s.q={}),t.shadowDom&&!$t&&1&s.o&&(s.o|=8);const c=t.transformTagName&&n.transformTagName?n.transformTagName(s.j):s.j,a=class extends HTMLElement{constructor(e){super(e),et(e=this,s),t.shadowDom&&1&s.o&&($t?e.attachShadow(t.shadowDelegatesFocus?{mode:"open",delegatesFocus:!!(16&s.o)}:{mode:"open"}):t.hydrateServerSide||"shadowRoot"in e||(e.shadowRoot=e)),t.slotChildNodesFix&&Ue(e,s)}connectedCallback(){p&&(clearTimeout(p),p=null),m?u.push(this):ht.jmp((()=>Ee(this)))}disconnectedCallback(){ht.jmp((()=>De(this)))}componentOnReady(){return Ge(this).Z}};t.cloneNodeFix&&Ne(a.prototype),t.appendChildSlotFix&&Pe(a.prototype),t.hotModuleReplacement&&(a.prototype["s-hmr"]=function(e){((e,t,n)=>{const o=Ge(e);o.o=1,e["s-hmr-load"]=()=>{delete e["s-hmr-load"]},Re(e,o,t,n)})(this,s,e)}),t.scopedSlotTextContentFix&&Ie(a.prototype,s),s.ee=e[0],r.includes(c)||i.get(c)||(l.push(c),i.define(c,Le(a,s,1)))}))})),t.invisiblePrehydration&&(t.hydratedClass||t.hydratedAttribute)){d.innerHTML=l+"{visibility:hidden}.hydrated{visibility:inherit}",d.setAttribute("data-styles","");const e=null!==(o=ht.L)&&void 0!==o?o:k(pt);null!=e&&d.setAttribute("nonce",e),c.insertBefore(d,a?a.nextSibling:c.firstChild)}m=!1,u.length?u.map((e=>e.connectedCallback())):ht.jmp(t.profile?()=>p=setTimeout(ve,30,"timeout"):()=>p=setTimeout(ve,30)),s()},_e=(e,t)=>t,Ve=(e,n,o,s)=>{t.hostListener&&o&&(t.hostListenerTargetParent&&(o=o.filter(s?([e])=>32&e:([e])=>!(32&e))),o.map((([o,s,l])=>{const r=t.hostListenerTarget?Be(e,o):e,i=ze(n,l),c=Xe(o);ht.ael(r,s,i,c),(n.G=n.G||[]).push((()=>ht.rel(r,s,i,c)))})))},ze=(e,n)=>o=>{try{t.lazyLoad?256&e.o?e.F[n](o):(e.W=e.W||[]).push([n,o]):e.T[n](o)}catch(e){nt(e)}},Be=(e,n)=>t.hostListenerTargetDocument&&4&n?pt:t.hostListenerTargetWindow&&8&n?ut:t.hostListenerTargetBody&&16&n?pt.body:t.hostListenerTargetParent&&32&n?e.parentElement:e,Xe=e=>({passive:0!=(1&e),capture:0!=(2&e)}),qe=e=>ht.L=e,Je=(e,t,n,o)=>{null!=t&&(null!=t["s-nr"]&&o.push(t),1===t.nodeType&&t.childNodes.forEach((t=>{const s=Ge(t);null==s||n.staticComponents.has(t.nodeName.toLowerCase())||Qe(e,t,s.N,n,{nodeIds:0}),Je(e,t,n,o)})))},Qe=(e,t,n,o,s)=>{if(null!=n){const l=++o.hostIds;if(t.setAttribute(b,l),null!=t["s-cr"]&&(t["s-cr"].nodeValue="r."+l),null!=n.u){const t=0;n.u.forEach(((n,o)=>{Ye(e,n,s,l,t,o)}))}if(t&&n&&n.v&&!t.hasAttribute("c-id")){const e=t.parentElement;if(e&&e.childNodes){const o=Array.from(e.childNodes),s=o.find((e=>8===e.nodeType&&e["s-sr"]));if(s){const e=o.indexOf(t)-1;n.v.setAttribute(g,`${s["s-host-id"]}.${s["s-node-id"]}.0.${e}`)}}}}},Ye=(e,t,n,o,s,l)=>{const r=t.v;if(null==r)return;const i=n.nodeIds++,c=`${o}.${i}.${s}.${l}`;if(r["s-host-id"]=o,r["s-node-id"]=i,1===r.nodeType)r.setAttribute(g,c);else if(3===r.nodeType){const t=r.parentNode,n=t.nodeName;if("STYLE"!==n&&"SCRIPT"!==n){const n=e.createComment("t."+c);t.insertBefore(n,r)}}else 8===r.nodeType&&r["s-sr"]&&(r.nodeValue=`s.${c}.${r["s-sn"]||""}`);if(null!=t.u){const l=s+1;t.u.forEach(((t,s)=>{Ye(e,t,n,o,l,s)}))}},Ke=new WeakMap,Ge=e=>Ke.get(e),Ze=(e,t)=>Ke.set(t.F=e,t),et=(e,n)=>{const o={o:0,T:e,R:n,B:new Map};return t.isDev&&(o.A=0),t.method&&t.lazyLoad&&(o.J=new Promise((e=>o.V=e))),t.asyncLoading&&(o.Z=new Promise((e=>o._=e)),e["s-p"]=[],e["s-rc"]=[]),Ve(e,o,n.Y,!1),Ke.set(e,o)},tt=(e,t)=>t in e,nt=(e,t)=>(l||console.error)(e,t),ot=t.isTesting?["STENCIL:"]:["%cstencil","color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px"],st=(...e)=>console.error(...ot,...e),lt=(...e)=>console.warn(...ot,...e),rt=(...e)=>console.info(...ot,...e),it=new Map,ct=(e,n,o)=>{const s=e.j.replace(/-/g,"_"),l=e.ee;if(t.isDev&&"string"!=typeof l)return void st(`Trying to lazily load component <${e.j}> with style mode "${n.O}", but it does not exist.`);const r=!t.hotModuleReplacement&&it.get(l);return r?r[s]:import(`./${l}.entry.js${t.hotModuleReplacement&&o?"?s-hmr="+o:""}`).then((e=>(t.hotModuleReplacement||it.set(l,e),e[s])),nt)
2
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/},at=new Map,dt=[],ut="undefined"!=typeof window?window:{},ft=t.cssVarShim?ut.CSS:null,pt=ut.document||{head:{}},mt=ut.HTMLElement||class{},ht={o:0,t:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,o)=>e.addEventListener(t,n,o),rel:(e,t,n,o)=>e.removeEventListener(t,n,o),ce:(e,t)=>new CustomEvent(e,t)},$t=!t.shadowDomShim||!t.shadowDom||(()=>(pt.head.attachShadow+"").indexOf("[native")>-1)(),yt=e=>Promise.resolve(e),bt=!!t.constructableCSS&&(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),vt=[],gt=[],wt=[],Ct=(e,t)=>n=>{e.push(n),p||(p=!0,t&&4&ht.o?Tt(xt):ht.raf(xt))},St=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){nt(e)}e.length=0},kt=(e,t)=>{let n=0,o=0;for(;n<e.length&&(o=performance.now())<t;)try{e[n++](o)}catch(e){nt(e)}n===e.length?e.length=0:0!==n&&e.splice(0,n)},xt=()=>{if(t.asyncQueue&&f++,St(vt),t.asyncQueue){const e=2==(6&ht.o)?performance.now()+14*Math.ceil(.1*f):1/0;kt(gt,e),kt(wt,e),gt.length>0&&(wt.push(...gt),gt.length=0),(p=vt.length+gt.length+wt.length>0)?ht.raf(xt):f=0}else St(gt),(p=vt.length>0)&&ht.raf(xt)},Tt=e=>yt().then(e),Lt=Ct(vt,!1),Rt=Ct(gt,!0),jt=Object.freeze({__proto__:null,Build:m,CSS:ft,Context:h,Fragment:_e,H:mt,HTMLElement:mt,Host:L,STENCIL_DEV_MODE:ot,addHostEventListeners:Ve,bootstrapLazy:Ae,cmpModules:it,connectedCallback:Ee,consoleDevError:st,consoleDevInfo:rt,consoleDevWarn:lt,consoleError:nt,createEvent:H,defineCustomElement:(e,t)=>{customElements.define(t[1],Me(e,t))},disconnectedCallback:De,doc:pt,forceModeUpdate:e=>{if(t.style&&t.mode&&!t.lazyLoad){const t=P(e),n=Ge(e);if(n.O!==t){const o=n.R,s=e["s-sc"],l=z(o,t),r=e.constructor.style[t],i=o.o;r&&(at.has(l)||A(l,r,!!(1&i)),n.O=t,e.classList.remove(s+"-h",s+"-s"),V(n),be(e))}}},forceUpdate:be,getAssetPath:$,getConnect:(e,t)=>{const n=()=>{let e=pt.querySelector(t);return e||(e=pt.createElement(t),pt.body.appendChild(e)),"function"==typeof e.componentOnReady?e.componentOnReady():Promise.resolve(e)};return{create:(...e)=>n().then((t=>t.create(...e))),componentOnReady:n}},getContext:(e,n)=>n in h?h[n]:"window"===n?ut:"document"===n?pt:"isServer"===n||"isPrerender"===n?!!t.hydrateServerSide:"isClient"===n?!t.hydrateServerSide:"resourcesUrl"===n||"publicPath"===n?$("."):"queue"===n?{write:Rt,read:Lt,tick:{then:e=>Tt(e)}}:void 0,getElement:U,getHostRef:Ge,getMode:e=>Ge(e).O,getRenderingRef:()=>u,getValue:xe,h:x,insertVdomAnnotations:(e,t)=>{if(null!=e){const n={hostIds:0,rootLevelIds:0,staticComponents:new Set(t)},o=[];Je(e,e.body,n,o),o.forEach((t=>{if(null!=t){const o=t["s-nr"];let s=o["s-host-id"],l=o["s-node-id"],r=`${s}.${l}`;if(null==s)if(s=0,n.rootLevelIds++,l=n.rootLevelIds,r=`${s}.${l}`,1===o.nodeType)o.setAttribute(g,r);else if(3===o.nodeType){if(0===s&&""===o.nodeValue.trim())return void t.remove();const n=e.createComment(r);n.nodeValue="t."+r,o.parentNode.insertBefore(n,o)}let i="o."+r;const c=t.parentElement;c&&(""===c["s-en"]?i+=".":"c"===c["s-en"]&&(i+=".c")),t.nodeValue=i}}))}},isMemberInElement:tt,loadModule:ct,modeResolutionChain:dt,nextTick:Tt,parsePropertyValue:I,plt:ht,postUpdateComponent:ye,promiseResolve:yt,proxyComponent:Le,proxyCustomElement:Me,readTask:Lt,registerHost:et,registerInstance:Ze,renderVdom:ae,setAssetPath:e=>ht.t=e,setErrorHandler:e=>l=e,setMode:e=>dt.push(e),setNonce:qe,setPlatformHelpers:e=>{Object.assign(ht,e)},setPlatformOptions:e=>Object.assign(ht,e),setValue:Te,styles:at,supportsConstructableStylesheets:bt,supportsListenerOptions:!0,supportsShadow:$t,win:ut,writeTask:Rt,BUILD:t,Env:{},NAMESPACE:e});export{t as B,ft as C,_e as F,mt as H,e as N,jt as S,ht as a,Ae as b,rt as c,pt as d,H as e,L as f,U as g,x as h,be as i,yt as p,Ze as r,qe as s,ut as w}
@@ -1 +1 @@
1
- import{r as i,c as t,h as s,H as n}from"./p-d8d8169b.js";import{ApplicationUtils as e}from"@sankhyalabs/ezui/dist/collection/utils";const o=class{constructor(s){i(this,s),this.configClose=t(this,"configClose",7),this.saveConfig=t(this,"saveConfig",7),this.isEditingGuide=!1,this.isEditingGroup=!1,this.configOptions=[],this.selectedConfig=void 0,this.messagesBuilder=void 0,this.hasChanges=!1,this.optionConfigChanged=!1}handleIsEditingGuideName({detail:i}){this.isEditingGuide=i}handleIsEditingGroupName({detail:i}){this.isEditingGroup=i}saveFormConfig(){if(this.isEditingGuide||this.isEditingGroup){const i=this.getMessage("snkFormConfig.confirm.title"),t=this.getMessage(this.isEditingGuide?"snkFormConfig.alert.titleGuideEditing":"snkFormConfig.alert.titleGroupEditing");e.alert(i,t)}else this.saveConfig.emit()}async closeFormConfig(){if(this.hasChanges){const i=this.getMessage("snkFormConfig.confirm.title"),t=this.getMessage("snkFormConfig.confirm.cancel");if(!await e.confirm(i,t))return}this.configClose.emit()}getMessage(i,t){return this.messagesBuilder.getMessage(i,t)}openConfirmDialog(i="",t=this.getMessage("snkFormConfig.confirm.title")){return e.confirm(t,i)}async applyOptionConfig(){var i,t;const s=null!==(t=null===(i=this.selectedConfig)||void 0===i?void 0:i.name)&&void 0!==t?t:this.getMessage("snkFormConfig.configs.selectedConfig"),n=this.getMessage("snkFormConfig.confirm.apply").replace("{0}",s);await this.openConfirmDialog(n)&&this.saveConfig.emit()}renderSaveActions(){if(this.hasChanges||this.optionConfigChanged)return s("div",{class:"right-group"},s("ez-button",{title:this.getMessage("snkFormConfig.actions.cancel"),label:this.getMessage("snkFormConfig.actions.cancel"),onClick:this.closeFormConfig.bind(this),size:"medium"}),s("ez-button",this.hasChanges?{title:this.getMessage("snkFormConfig.actions.save"),label:this.getMessage("snkFormConfig.actions.save"),class:"ez-button--primary ez-padding-left--medium",onClick:()=>this.saveFormConfig(),size:"medium"}:{title:this.getMessage("snkFormConfig.actions.save"),label:this.getMessage("snkFormConfig.applyConfig"),class:"ez-button--primary ez-padding-left--medium",onClick:async()=>await this.applyOptionConfig(),size:"medium"}))}render(){return s(n,null,s("div",{class:"left-group"},s("ez-button",{mode:"icon",title:this.getMessage("snkFormConfig.goBackTitle"),iconName:"arrow_back",class:"ez-padding--small",size:"small",onClick:this.closeFormConfig.bind(this),id:"formConfigToBack"}),s("h1",{class:"ez-title ez-title--primary ez-title--extra-large ez-padding--small"},this.getMessage("snkFormConfig.title")),s("configs-button",{hasChanges:this.hasChanges,configOptions:this.configOptions,selectedConfig:this.selectedConfig,messagesBuilder:this.messagesBuilder})),this.renderSaveActions())}};o.style=".sc-config-header-h{display:flex;padding-top:12px;padding-left:12px;align-items:center;width:100%;justify-content:space-between}.left-group.sc-config-header{display:flex;gap:8px}.right-group.sc-config-header{padding-right:18px;display:flex}";export{o as config_header}
1
+ import{r as i,e as t,h as s,f as n}from"./p-2c9d0870.js";import{ApplicationUtils as e}from"@sankhyalabs/ezui/dist/collection/utils";const o=class{constructor(s){i(this,s),this.configClose=t(this,"configClose",7),this.saveConfig=t(this,"saveConfig",7),this.isEditingGuide=!1,this.isEditingGroup=!1,this.configOptions=[],this.selectedConfig=void 0,this.messagesBuilder=void 0,this.hasChanges=!1,this.optionConfigChanged=!1}handleIsEditingGuideName({detail:i}){this.isEditingGuide=i}handleIsEditingGroupName({detail:i}){this.isEditingGroup=i}saveFormConfig(){if(this.isEditingGuide||this.isEditingGroup){const i=this.getMessage("snkFormConfig.confirm.title"),t=this.getMessage(this.isEditingGuide?"snkFormConfig.alert.titleGuideEditing":"snkFormConfig.alert.titleGroupEditing");e.alert(i,t)}else this.saveConfig.emit()}async closeFormConfig(){if(this.hasChanges){const i=this.getMessage("snkFormConfig.confirm.title"),t=this.getMessage("snkFormConfig.confirm.cancel");if(!await e.confirm(i,t))return}this.configClose.emit()}getMessage(i,t){return this.messagesBuilder.getMessage(i,t)}openConfirmDialog(i="",t=this.getMessage("snkFormConfig.confirm.title")){return e.confirm(t,i)}async applyOptionConfig(){var i,t;const s=null!==(t=null===(i=this.selectedConfig)||void 0===i?void 0:i.name)&&void 0!==t?t:this.getMessage("snkFormConfig.configs.selectedConfig"),n=this.getMessage("snkFormConfig.confirm.apply").replace("{0}",s);await this.openConfirmDialog(n)&&this.saveConfig.emit()}renderSaveActions(){if(this.hasChanges||this.optionConfigChanged)return s("div",{class:"right-group"},s("ez-button",{title:this.getMessage("snkFormConfig.actions.cancel"),label:this.getMessage("snkFormConfig.actions.cancel"),onClick:this.closeFormConfig.bind(this),size:"medium"}),s("ez-button",this.hasChanges?{title:this.getMessage("snkFormConfig.actions.save"),label:this.getMessage("snkFormConfig.actions.save"),class:"ez-button--primary ez-padding-left--medium",onClick:()=>this.saveFormConfig(),size:"medium"}:{title:this.getMessage("snkFormConfig.actions.save"),label:this.getMessage("snkFormConfig.applyConfig"),class:"ez-button--primary ez-padding-left--medium",onClick:async()=>await this.applyOptionConfig(),size:"medium"}))}render(){return s(n,null,s("div",{class:"left-group"},s("ez-button",{mode:"icon",title:this.getMessage("snkFormConfig.goBackTitle"),iconName:"arrow_back",class:"ez-padding--small",size:"small",onClick:this.closeFormConfig.bind(this),id:"formConfigToBack"}),s("h1",{class:"ez-title ez-title--primary ez-title--extra-large ez-padding--small"},this.getMessage("snkFormConfig.title")),s("configs-button",{hasChanges:this.hasChanges,configOptions:this.configOptions,selectedConfig:this.selectedConfig,messagesBuilder:this.messagesBuilder})),this.renderSaveActions())}};o.style=".sc-config-header-h{display:flex;padding-top:12px;padding-left:12px;align-items:center;width:100%;justify-content:space-between}.left-group.sc-config-header{display:flex;gap:8px}.right-group.sc-config-header{padding-right:18px;display:flex}";export{o as config_header}