@icure/form 2.0.7 → 2.0.9

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 (46) hide show
  1. package/.yarn/cache/@icure-motss-app-datepicker-npm-6.0.0-rc.40-ca1da7abbb-9bbe2bed34.zip +0 -0
  2. package/.yarn/cache/@lit-labs-ssr-dom-shim-npm-1.4.0-e5ef5fbeba-e267c25576.zip +0 -0
  3. package/.yarn/cache/@lit-reactive-element-npm-2.1.1-3875228c32-b9bbc9c089.zip +0 -0
  4. package/.yarn/cache/{lit-element-npm-4.1.1-bb20932b82-74d0f2d6fb.zip → lit-element-npm-4.2.1-b5bc114ced-5925326176.zip} +0 -0
  5. package/.yarn/cache/{lit-html-npm-3.2.1-1662fc597d-1bacd9f8b2.zip → lit-html-npm-3.3.1-e3722d4f4a-de07c66945.zip} +0 -0
  6. package/.yarn/cache/{lit-npm-3.2.1-27cb5b7782-ee22bbc53d.zip → lit-npm-3.3.1-8f683c51f1-fb88f1ff80.zip} +0 -0
  7. package/.yarn/cache/prosemirror-model-npm-1.25.3-95b23ed79b-2720e49795.zip +0 -0
  8. package/.yarn/cache/prosemirror-transform-npm-1.10.4-f765dfe652-7b8b3ed82c.zip +0 -0
  9. package/.yarn/cache/prosemirror-view-npm-1.41.2-7f800b4d2b-263f15bec9.zip +0 -0
  10. package/.yarn/cache/tslib-npm-2.8.1-66590b21b8-e4aba30e63.zip +0 -0
  11. package/.yarn/install-state.gz +0 -0
  12. package/components/common/metadata-buttons-bar.d.ts +1 -1
  13. package/components/common/metadata-buttons-bar.js +5 -16
  14. package/components/common/metadata-buttons-bar.js.map +1 -1
  15. package/components/icure-date-picker/index.d.ts +2 -2
  16. package/components/icure-date-picker/index.js +5 -5
  17. package/components/icure-date-picker/index.js.map +1 -1
  18. package/components/icure-text-field/index.js +11 -25
  19. package/components/icure-text-field/index.js.map +1 -1
  20. package/components/icure-text-field/schema/markdown-schema.js +2 -2
  21. package/components/icure-text-field/schema/markdown-schema.js.map +1 -1
  22. package/icure/form-values-container.d.ts +13 -4
  23. package/icure/form-values-container.js +68 -26
  24. package/icure/form-values-container.js.map +1 -1
  25. package/package.json +2 -2
  26. package/.yarn/cache/@lit-labs-ssr-dom-shim-npm-1.2.1-d14ce3e3e5-5667c44f58.zip +0 -0
  27. package/.yarn/cache/@lit-reactive-element-npm-2.0.4-4836436301-368d788d9e.zip +0 -0
  28. package/.yarn/cache/app-datepicker-npm-6.0.0-rc.33-f74d593ddf-6490949c45.zip +0 -0
  29. package/.yarn/cache/lit-ntml-npm-3.0.6-98ebc6c1ac-2917c778d9.zip +0 -0
  30. package/.yarn/cache/lodash-es-npm-4.17.21-b45832dfce-05cbffad6e.zip +0 -0
  31. package/.yarn/cache/nodemod-npm-3.0.6-844d650911-47ffe619b3.zip +0 -0
  32. package/.yarn/cache/normalize-diacritics-npm-3.0.12-93e2346015-5ddc2cfaf8.zip +0 -0
  33. package/.yarn/cache/parse5-npm-6.0.1-70a35a494a-7d569a176c.zip +0 -0
  34. package/.yarn/cache/prosemirror-model-npm-1.23.0-57eb718541-f5ab1593cb.zip +0 -0
  35. package/.yarn/cache/prosemirror-transform-npm-1.10.0-c36ebced12-4cacb4ef83.zip +0 -0
  36. package/.yarn/cache/prosemirror-view-npm-1.34.3-c79b7cffaa-622a9e4061.zip +0 -0
  37. package/.yarn/cache/tslib-npm-2.7.0-21668f5c21-1606d5c89f.zip +0 -0
  38. package/components/icure-text-field/schema/items-list.d.ts +0 -3
  39. package/components/icure-text-field/schema/items-list.js +0 -31
  40. package/components/icure-text-field/schema/items-list.js.map +0 -1
  41. package/components/themes/ehr-lite/index.d.ts +0 -1
  42. package/components/themes/ehr-lite/index.js +0 -321
  43. package/components/themes/ehr-lite/index.js.map +0 -1
  44. package/utils/icure-utils.d.ts +0 -16
  45. package/utils/icure-utils.js +0 -105
  46. package/utils/icure-utils.js.map +0 -1
@@ -1,3 +0,0 @@
1
- import { SchemaSpec } from 'prosemirror-model';
2
- export type ItemsListSchema = 'items-list';
3
- export declare function getItemsListSpec(): SchemaSpec;
@@ -1,31 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getItemsListSpec = void 0;
4
- const utils_1 = require("./utils");
5
- function getItemsListSpec() {
6
- return {
7
- nodes: (0, utils_1.reduceNodes)({
8
- doc: {
9
- content: 'paragraph*',
10
- parseDOM: [{ tag: 'ul' }],
11
- toDOM() {
12
- return ['ul', 0];
13
- },
14
- },
15
- paragraph: {
16
- content: 'inline*',
17
- group: 'block',
18
- parseDOM: [{ tag: 'li' }],
19
- toDOM() {
20
- return ['li', 0];
21
- },
22
- },
23
- text: {
24
- group: 'inline',
25
- },
26
- }),
27
- marks: {},
28
- };
29
- }
30
- exports.getItemsListSpec = getItemsListSpec;
31
- //# sourceMappingURL=items-list.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"items-list.js","sourceRoot":"","sources":["../../../../tmp/components/icure-text-field/schema/items-list.ts"],"names":[],"mappings":";;;AACA,mCAAqC;AAIrC,SAAgB,gBAAgB;IAC/B,OAAO;QACN,KAAK,EAAE,IAAA,mBAAW,EAAC;YAClB,GAAG,EAAE;gBACJ,OAAO,EAAE,YAAY;gBACrB,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;gBACzB,KAAK;oBACJ,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;gBACjB,CAAC;aACD;YAED,SAAS,EAAE;gBACV,OAAO,EAAE,SAAS;gBAClB,KAAK,EAAE,OAAO;gBACd,QAAQ,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,EAAE,CAAC;gBACzB,KAAK;oBACJ,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAA;gBACjB,CAAC;aACD;YAED,IAAI,EAAE;gBACL,KAAK,EAAE,QAAQ;aACf;SACD,CAAC;QACF,KAAK,EAAE,EAAE;KACT,CAAA;AACF,CAAC;AA1BD,4CA0BC","sourcesContent":["import { SchemaSpec } from 'prosemirror-model'\nimport { reduceNodes } from './utils'\n\nexport type ItemsListSchema = 'items-list'\n\nexport function getItemsListSpec(): SchemaSpec {\n\treturn {\n\t\tnodes: reduceNodes({\n\t\t\tdoc: {\n\t\t\t\tcontent: 'paragraph*',\n\t\t\t\tparseDOM: [{ tag: 'ul' }],\n\t\t\t\ttoDOM() {\n\t\t\t\t\treturn ['ul', 0]\n\t\t\t\t},\n\t\t\t},\n\n\t\t\tparagraph: {\n\t\t\t\tcontent: 'inline*',\n\t\t\t\tgroup: 'block',\n\t\t\t\tparseDOM: [{ tag: 'li' }],\n\t\t\t\ttoDOM() {\n\t\t\t\t\treturn ['li', 0]\n\t\t\t\t},\n\t\t\t},\n\n\t\t\ttext: {\n\t\t\t\tgroup: 'inline',\n\t\t\t},\n\t\t}),\n\t\tmarks: {},\n\t}\n}\n"]}
@@ -1 +0,0 @@
1
- export {};
@@ -1,321 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const fields_1 = require("../../icure-form/fields");
4
- const icure_button_group_1 = require("../../icure-button-group");
5
- const icure_date_picker_1 = require("../../icure-date-picker");
6
- const icure_dropdown_field_1 = require("../../icure-dropdown-field");
7
- const icure_form_1 = require("../../icure-form");
8
- const icure_label_1 = require("../../icure-label");
9
- const icure_text_field_1 = require("../../icure-text-field");
10
- // @ts-ignore
11
- const lit_1 = require("lit");
12
- const ehrLiteCss = (0, lit_1.css) `.icure-form {
13
- row-gap: 24px;
14
- }
15
-
16
- .icure-text-field, .icure-button-group {
17
- width: 100%;
18
- }
19
- .icure-text-field > .icure-label, .icure-button-group > .icure-label {
20
- color: #1D2235;
21
- font-size: 14px;
22
- font-weight: 400;
23
- }
24
- .icure-text-field > .icure-label > span, .icure-button-group > .icure-label > span {
25
- display: block;
26
- word-wrap: break-word;
27
- overflow: auto;
28
- font-weight: 400;
29
- }
30
- .icure-text-field > .icure-input, .icure-button-group > .icure-input {
31
- flex: 1 1 auto;
32
- width: auto;
33
- }
34
- .icure-text-field > .icure-label, .icure-button-group > .icure-label {
35
- transform: translate(0, 0) scale(1);
36
- }
37
- .icure-text-field .icure-input,
38
- .icure-text-field .input-container, .icure-button-group .icure-input,
39
- .icure-button-group .input-container {
40
- cursor: pointer;
41
- border-radius: 6px;
42
- padding: 4px 8px;
43
- width: 100%;
44
- box-sizing: border-box;
45
- border-width: 1px;
46
- border-style: solid;
47
- outline: 0;
48
- font: inherit;
49
- font-size: 13px;
50
- line-height: 1.4em;
51
- display: flex;
52
- align-items: center;
53
- vertical-align: middle;
54
- position: relative;
55
- -webkit-appearance: none;
56
- background-color: #ffffff;
57
- border-color: #DDE3E7;
58
- color: #1D2235;
59
- box-sizing: border-box;
60
- }
61
- .icure-text-field .icure-input:focus, .icure-text-field .icure-input:focus-within,
62
- .icure-text-field .input-container:focus,
63
- .icure-text-field .input-container:focus-within, .icure-button-group .icure-input:focus, .icure-button-group .icure-input:focus-within,
64
- .icure-button-group .input-container:focus,
65
- .icure-button-group .input-container:focus-within {
66
- box-shadow: 0px 0px 0px 2px rgba(61, 135, 197, 0.2);
67
- border-color: #084B83;
68
- }
69
- .icure-text-field .icure-input:hover,
70
- .icure-text-field .input-container:hover, .icure-button-group .icure-input:hover,
71
- .icure-button-group .input-container:hover {
72
- border-color: #084B83;
73
- box-shadow: none;
74
- }
75
- .icure-text-field .icure-input:hover:focus, .icure-text-field .icure-input:hover:focus-within,
76
- .icure-text-field .input-container:hover:focus,
77
- .icure-text-field .input-container:hover:focus-within, .icure-button-group .icure-input:hover:focus, .icure-button-group .icure-input:hover:focus-within,
78
- .icure-button-group .input-container:hover:focus,
79
- .icure-button-group .input-container:hover:focus-within {
80
- box-shadow: 0px 0px 0px 2px rgba(61, 135, 197, 0.2);
81
- border-color: #084B83;
82
- }
83
- .icure-text-field .icure-input .ProseMirror,
84
- .icure-text-field .input-container .ProseMirror, .icure-button-group .icure-input .ProseMirror,
85
- .icure-button-group .input-container .ProseMirror {
86
- padding: 0;
87
- font-size: 13px;
88
- line-height: 1.4em;
89
- color: #1D2235;
90
- }
91
- .icure-text-field .icure-input .ProseMirror .date,
92
- .icure-text-field .input-container .ProseMirror .date, .icure-button-group .icure-input .ProseMirror .date,
93
- .icure-button-group .input-container .ProseMirror .date {
94
- padding: 1px;
95
- }
96
- .icure-text-field .icure-input .ProseMirror .time,
97
- .icure-text-field .input-container .ProseMirror .time, .icure-button-group .icure-input .ProseMirror .time,
98
- .icure-button-group .input-container .ProseMirror .time {
99
- padding: 1px;
100
- }
101
- .icure-text-field .icure-input .ProseMirror:focus .focused, .icure-text-field .icure-input .ProseMirror:hover,
102
- .icure-text-field .input-container .ProseMirror:focus .focused,
103
- .icure-text-field .input-container .ProseMirror:hover, .icure-button-group .icure-input .ProseMirror:focus .focused, .icure-button-group .icure-input .ProseMirror:hover,
104
- .icure-button-group .input-container .ProseMirror:focus .focused,
105
- .icure-button-group .input-container .ProseMirror:hover {
106
- border-color: #084B83;
107
- }
108
- .icure-text-field .icure-input > svg,
109
- .icure-text-field .input-container > svg, .icure-button-group .icure-input > svg,
110
- .icure-button-group .input-container > svg {
111
- opacity: 0.5;
112
- }
113
- .icure-text-field .icure-input > svg path,
114
- .icure-text-field .input-container > svg path, .icure-button-group .icure-input > svg path,
115
- .icure-button-group .input-container > svg path {
116
- fill: #656565;
117
- }
118
- .icure-text-field .icure-input .extra,
119
- .icure-text-field .input-container .extra, .icure-button-group .icure-input .extra,
120
- .icure-button-group .input-container .extra {
121
- height: 20px;
122
- }
123
- .icure-text-field .icure-input .extra > .info,
124
- .icure-text-field .input-container .extra > .info, .icure-button-group .icure-input .extra > .info,
125
- .icure-button-group .input-container .extra > .info {
126
- color: #656565;
127
- opacity: 0.5;
128
- }
129
- .icure-text-field .icure-input .extra .buttons-container .btn svg path,
130
- .icure-text-field .input-container .extra .buttons-container .btn svg path, .icure-button-group .icure-input .extra .buttons-container .btn svg path,
131
- .icure-button-group .input-container .extra .buttons-container .btn svg path {
132
- fill: #656565;
133
- opacity: 0.5;
134
- }
135
- .icure-text-field .icure-input .extra .buttons-container .btn svg path:hover,
136
- .icure-text-field .input-container .extra .buttons-container .btn svg path:hover, .icure-button-group .icure-input .extra .buttons-container .btn svg path:hover,
137
- .icure-button-group .input-container .extra .buttons-container .btn svg path:hover {
138
- fill: #656565;
139
- opacity: 1;
140
- }
141
-
142
- input[type=radio] {
143
- margin-top: -1px;
144
- vertical-align: middle;
145
- }
146
-
147
- .icure-checkbox:hover {
148
- border-color: #DCE7F2;
149
- }
150
- .icure-checkbox:checked {
151
- accent-color: #084B83;
152
- }
153
-
154
- .icure-button-group > .icure-label {
155
- z-index: 1;
156
- pointer-events: none;
157
- line-height: 1.4em;
158
- cursor: text;
159
- font-size: 14px;
160
- top: calc(1.4em + 5px);
161
- left: 9px;
162
- color: #1D2235;
163
- align-items: center;
164
- height: 28px;
165
- max-width: 85%;
166
- min-width: 0;
167
- padding-bottom: 8px;
168
- }
169
- .icure-button-group > .icure-label > span {
170
- display: block;
171
- white-space: nowrap;
172
- text-overflow: ellipsis;
173
- overflow: hidden;
174
- padding-right: 8px;
175
- }
176
- .icure-button-group > div {
177
- display: grid;
178
- }
179
- .icure-button-group > div > div {
180
- display: flex;
181
- align-items: center;
182
- gap: 6px;
183
- }
184
- .icure-button-group > div > div > .icure-button-group-label {
185
- z-index: 1;
186
- line-height: 1.4em;
187
- cursor: text;
188
- font-size: 14px;
189
- top: calc(1.4em + 5px);
190
- left: 9px;
191
- transition: transform 0.2s ease-out, color 0.2s ease-out;
192
- color: #1D2235;
193
- display: flex;
194
- align-items: center;
195
- max-width: 85%;
196
- min-width: 0;
197
- }
198
- .icure-button-group > div > div > .icure-button-group-label > span {
199
- display: block;
200
- white-space: nowrap;
201
- text-overflow: ellipsis;
202
- overflow: hidden;
203
- padding-right: 8px;
204
- }
205
- .icure-button-group > .icure-input {
206
- flex: 1 1 auto;
207
- width: auto;
208
- }
209
-
210
- .icure-input #editor {
211
- color: #1D2235;
212
- }
213
- .icure-input #editor.tokens-list .ProseMirror li, .icure-input #editor.styled-tokens-list .ProseMirror li {
214
- background-color: #DCE7F2;
215
- }
216
- .icure-input #editor.tokens-list .ProseMirror li span:after, .icure-input #editor.styled-tokens-list .ProseMirror li span:after {
217
- background: transparent url("data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxu cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGlkPSJPdXRsaW5lIiB2aWV3 Qm94PSIwIDAgMjQgMjQiIHN0cm9rZT0iIzg4ODg4OCIgZmlsbD0iIzg4ODg4OCIg d2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiPjxwYXRoIGQ9Ik0xNiw4YTEsMSwwLDAs MC0xLjQxNCwwTDEyLDEwLjU4Niw5LjQxNCw4QTEsMSwwLDAsMCw4LDkuNDE0TDEw LjU4NiwxMiw4LDE0LjU4NkExLDEsMCwwLDAsOS40MTQsMTZMMTIsMTMuNDE0LDE0 LjU4NiwxNkExLDEsMCwwLDAsMTYsMTQuNTg2TDEzLjQxNCwxMiwxNiw5LjQxNEEx LDEsMCwwLDAsMTYsOFoiLz48cGF0aCBkPSJNMTIsMEExMiwxMiwwLDEsMCwyNCwx MiwxMi4wMTMsMTIuMDEzLDAsMCwwLDEyLDBabTAsMjJBMTAsMTAsMCwxLDEsMjIs MTIsMTAuMDExLDEwLjAxMSwwLDAsMSwxMiwyMloiLz48L3N2Zz4K") no-repeat center/16px;
218
- }
219
- .icure-input #editor.items-list .ProseMirror li {
220
- border-bottom: 1px dotted #8DA6BF;
221
- }
222
- .icure-input .extra {
223
- padding-right: 0;
224
- }
225
- .icure-input .select-arrow {
226
- opacity: 1;
227
- }
228
- .icure-input .select-arrow svg {
229
- width: 15px;
230
- height: 15px;
231
- }
232
- .icure-input .select-arrow svg path {
233
- fill: #9CA8B2;
234
- }
235
- .icure-input .options {
236
- padding: 2px;
237
- display: flex;
238
- flex-direction: column;
239
- align-items: flex-start;
240
- gap: 2px;
241
- border-radius: 6px;
242
- background: white;
243
- box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.12), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 9px 28px 0px rgba(0, 0, 0, 0.05);
244
- }
245
- .icure-input .options .option {
246
- height: auto;
247
- min-height: unset;
248
- display: flex;
249
- padding: 8px;
250
- align-items: center;
251
- align-self: stretch;
252
- border-radius: 4px;
253
- background: white;
254
- color: #1D2235;
255
- font-size: 12px;
256
- font-style: normal;
257
- font-weight: 400;
258
- line-height: normal;
259
- cursor: pointer;
260
- }
261
- .icure-input .options .option:hover {
262
- background: #DCE7F2;
263
- color: #084B83;
264
- }
265
- .icure-input:hover .select-arrow svg path, .icure-input:focus .select-arrow svg path {
266
- fill: #084B83;
267
- }`;
268
- class EhrLiteIcureButtonGroup extends icure_button_group_1.IcureButtonGroup {
269
- static get styles() {
270
- return [...icure_button_group_1.IcureButtonGroup.styles, ehrLiteCss];
271
- }
272
- }
273
- class EhrLiteIcureDatePickerField extends icure_date_picker_1.IcureDatePickerField {
274
- static get styles() {
275
- return [...icure_date_picker_1.IcureDatePickerField.styles, ehrLiteCss];
276
- }
277
- }
278
- class EhrLiteIcureDropdownField extends icure_dropdown_field_1.IcureDropdownField {
279
- static get styles() {
280
- return [...icure_dropdown_field_1.IcureDropdownField.styles, ehrLiteCss];
281
- }
282
- }
283
- class EhrLiteIcureForm extends icure_form_1.IcureForm {
284
- static get styles() {
285
- return [...icure_form_1.IcureForm.styles, ehrLiteCss];
286
- }
287
- }
288
- class EhrLiteIcureLabel extends icure_label_1.IcureLabel {
289
- static get styles() {
290
- return [...icure_label_1.IcureLabel.styles, ehrLiteCss];
291
- }
292
- }
293
- class EhrLiteIcureTextField extends icure_text_field_1.IcureTextField {
294
- static get styles() {
295
- return [...icure_text_field_1.IcureTextField.styles, ehrLiteCss];
296
- }
297
- }
298
- class EhrLiteLabel extends fields_1.Label {
299
- static get styles() {
300
- return [...fields_1.Label.styles, ehrLiteCss];
301
- }
302
- }
303
- customElements.define('icure-form-checkbox', fields_1.CheckBox);
304
- customElements.define('icure-form-date-picker', fields_1.DatePicker);
305
- customElements.define('icure-form-date-time-picker', fields_1.DateTimePicker);
306
- customElements.define('icure-form-dropdown-field', fields_1.DropdownField);
307
- customElements.define('icure-button-group', EhrLiteIcureButtonGroup);
308
- customElements.define('icure-date-picker-field', EhrLiteIcureDatePickerField);
309
- customElements.define('icure-dropdown-field', EhrLiteIcureDropdownField);
310
- customElements.define('icure-form', EhrLiteIcureForm);
311
- customElements.define('icure-label', EhrLiteIcureLabel);
312
- customElements.define('icure-text-field', EhrLiteIcureTextField);
313
- customElements.define('icure-form-items-list-field', fields_1.ItemsListField);
314
- customElements.define('icure-form-label', EhrLiteLabel);
315
- customElements.define('icure-form-measure-field', fields_1.MeasureField);
316
- customElements.define('icure-form-number-field', fields_1.NumberField);
317
- customElements.define('icure-form-radio-button', fields_1.RadioButton);
318
- customElements.define('icure-form-text-field', fields_1.TextField);
319
- customElements.define('icure-form-time-picker', fields_1.TimePicker);
320
- customElements.define('icure-form-token-field', fields_1.TokenField);
321
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../tmp/components/themes/ehr-lite/index.ts"],"names":[],"mappings":";;AAAA,oDAagC;AAChC,iEAA2D;AAC3D,+DAA8D;AAC9D,qEAA+D;AAC/D,iDAA4C;AAC5C,mDAA8C;AAC9C,6DAAuD;AAEvD,aAAa;AACb,6BAA0B;AAC1B,MAAM,UAAU,GAAG,IAAA,SAAG,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC,CAAA;AAC3D,cAAc,CAAC,MAAM,CAAC,6BAA6B,EAAE,uBAAc,CAAC,CAAA;AACpE,cAAc,CAAC,MAAM,CAAC,2BAA2B,EAAE,sBAAa,CAAC,CAAA;AACjE,cAAc,CAAC,MAAM,CAAC,oBAAoB,EAAE,uBAAuB,CAAC,CAAA;AACpE,cAAc,CAAC,MAAM,CAAC,yBAAyB,EAAE,2BAA2B,CAAC,CAAA;AAC7E,cAAc,CAAC,MAAM,CAAC,sBAAsB,EAAE,yBAAyB,CAAC,CAAA;AACxE,cAAc,CAAC,MAAM,CAAC,YAAY,EAAE,gBAAgB,CAAC,CAAA;AACrD,cAAc,CAAC,MAAM,CAAC,aAAa,EAAE,iBAAiB,CAAC,CAAA;AACvD,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,qBAAqB,CAAC,CAAA;AAChE,cAAc,CAAC,MAAM,CAAC,6BAA6B,EAAE,uBAAc,CAAC,CAAA;AACpE,cAAc,CAAC,MAAM,CAAC,kBAAkB,EAAE,YAAY,CAAC,CAAA;AACvD,cAAc,CAAC,MAAM,CAAC,0BAA0B,EAAE,qBAAY,CAAC,CAAA;AAC/D,cAAc,CAAC,MAAM,CAAC,yBAAyB,EAAE,oBAAW,CAAC,CAAA;AAC7D,cAAc,CAAC,MAAM,CAAC,yBAAyB,EAAE,oBAAW,CAAC,CAAA;AAC7D,cAAc,CAAC,MAAM,CAAC,uBAAuB,EAAE,kBAAS,CAAC,CAAA;AACzD,cAAc,CAAC,MAAM,CAAC,wBAAwB,EAAE,mBAAU,CAAC,CAAA;AAC3D,cAAc,CAAC,MAAM,CAAC,wBAAwB,EAAE,mBAAU,CAAC,CAAA","sourcesContent":["import {\n\tCheckBox,\n\tDatePicker,\n\tDateTimePicker,\n\tDropdownField,\n\tItemsListField,\n\tLabel,\n\tMeasureField,\n\tNumberField,\n\tRadioButton,\n\tTextField,\n\tTimePicker,\n\tTokenField,\n} from '../../icure-form/fields'\nimport { IcureButtonGroup } from '../../icure-button-group'\nimport { IcureDatePickerField } from '../../icure-date-picker'\nimport { IcureDropdownField } from '../../icure-dropdown-field'\nimport { IcureForm } from '../../icure-form'\nimport { IcureLabel } from '../../icure-label'\nimport { IcureTextField } from '../../icure-text-field'\n\n// @ts-ignore\nimport { css } from 'lit';\nconst ehrLiteCss = css`.icure-form {\n row-gap: 24px;\n}\n\n.icure-text-field, .icure-button-group {\n width: 100%;\n}\n.icure-text-field > .icure-label, .icure-button-group > .icure-label {\n color: #1D2235;\n font-size: 14px;\n font-weight: 400;\n}\n.icure-text-field > .icure-label > span, .icure-button-group > .icure-label > span {\n display: block;\n word-wrap: break-word;\n overflow: auto;\n font-weight: 400;\n}\n.icure-text-field > .icure-input, .icure-button-group > .icure-input {\n flex: 1 1 auto;\n width: auto;\n}\n.icure-text-field > .icure-label, .icure-button-group > .icure-label {\n transform: translate(0, 0) scale(1);\n}\n.icure-text-field .icure-input,\n.icure-text-field .input-container, .icure-button-group .icure-input,\n.icure-button-group .input-container {\n cursor: pointer;\n border-radius: 6px;\n padding: 4px 8px;\n width: 100%;\n box-sizing: border-box;\n border-width: 1px;\n border-style: solid;\n outline: 0;\n font: inherit;\n font-size: 13px;\n line-height: 1.4em;\n display: flex;\n align-items: center;\n vertical-align: middle;\n position: relative;\n -webkit-appearance: none;\n background-color: #ffffff;\n border-color: #DDE3E7;\n color: #1D2235;\n box-sizing: border-box;\n}\n.icure-text-field .icure-input:focus, .icure-text-field .icure-input:focus-within,\n.icure-text-field .input-container:focus,\n.icure-text-field .input-container:focus-within, .icure-button-group .icure-input:focus, .icure-button-group .icure-input:focus-within,\n.icure-button-group .input-container:focus,\n.icure-button-group .input-container:focus-within {\n box-shadow: 0px 0px 0px 2px rgba(61, 135, 197, 0.2);\n border-color: #084B83;\n}\n.icure-text-field .icure-input:hover,\n.icure-text-field .input-container:hover, .icure-button-group .icure-input:hover,\n.icure-button-group .input-container:hover {\n border-color: #084B83;\n box-shadow: none;\n}\n.icure-text-field .icure-input:hover:focus, .icure-text-field .icure-input:hover:focus-within,\n.icure-text-field .input-container:hover:focus,\n.icure-text-field .input-container:hover:focus-within, .icure-button-group .icure-input:hover:focus, .icure-button-group .icure-input:hover:focus-within,\n.icure-button-group .input-container:hover:focus,\n.icure-button-group .input-container:hover:focus-within {\n box-shadow: 0px 0px 0px 2px rgba(61, 135, 197, 0.2);\n border-color: #084B83;\n}\n.icure-text-field .icure-input .ProseMirror,\n.icure-text-field .input-container .ProseMirror, .icure-button-group .icure-input .ProseMirror,\n.icure-button-group .input-container .ProseMirror {\n padding: 0;\n font-size: 13px;\n line-height: 1.4em;\n color: #1D2235;\n}\n.icure-text-field .icure-input .ProseMirror .date,\n.icure-text-field .input-container .ProseMirror .date, .icure-button-group .icure-input .ProseMirror .date,\n.icure-button-group .input-container .ProseMirror .date {\n padding: 1px;\n}\n.icure-text-field .icure-input .ProseMirror .time,\n.icure-text-field .input-container .ProseMirror .time, .icure-button-group .icure-input .ProseMirror .time,\n.icure-button-group .input-container .ProseMirror .time {\n padding: 1px;\n}\n.icure-text-field .icure-input .ProseMirror:focus .focused, .icure-text-field .icure-input .ProseMirror:hover,\n.icure-text-field .input-container .ProseMirror:focus .focused,\n.icure-text-field .input-container .ProseMirror:hover, .icure-button-group .icure-input .ProseMirror:focus .focused, .icure-button-group .icure-input .ProseMirror:hover,\n.icure-button-group .input-container .ProseMirror:focus .focused,\n.icure-button-group .input-container .ProseMirror:hover {\n border-color: #084B83;\n}\n.icure-text-field .icure-input > svg,\n.icure-text-field .input-container > svg, .icure-button-group .icure-input > svg,\n.icure-button-group .input-container > svg {\n opacity: 0.5;\n}\n.icure-text-field .icure-input > svg path,\n.icure-text-field .input-container > svg path, .icure-button-group .icure-input > svg path,\n.icure-button-group .input-container > svg path {\n fill: #656565;\n}\n.icure-text-field .icure-input .extra,\n.icure-text-field .input-container .extra, .icure-button-group .icure-input .extra,\n.icure-button-group .input-container .extra {\n height: 20px;\n}\n.icure-text-field .icure-input .extra > .info,\n.icure-text-field .input-container .extra > .info, .icure-button-group .icure-input .extra > .info,\n.icure-button-group .input-container .extra > .info {\n color: #656565;\n opacity: 0.5;\n}\n.icure-text-field .icure-input .extra .buttons-container .btn svg path,\n.icure-text-field .input-container .extra .buttons-container .btn svg path, .icure-button-group .icure-input .extra .buttons-container .btn svg path,\n.icure-button-group .input-container .extra .buttons-container .btn svg path {\n fill: #656565;\n opacity: 0.5;\n}\n.icure-text-field .icure-input .extra .buttons-container .btn svg path:hover,\n.icure-text-field .input-container .extra .buttons-container .btn svg path:hover, .icure-button-group .icure-input .extra .buttons-container .btn svg path:hover,\n.icure-button-group .input-container .extra .buttons-container .btn svg path:hover {\n fill: #656565;\n opacity: 1;\n}\n\ninput[type=radio] {\n margin-top: -1px;\n vertical-align: middle;\n}\n\n.icure-checkbox:hover {\n border-color: #DCE7F2;\n}\n.icure-checkbox:checked {\n accent-color: #084B83;\n}\n\n.icure-button-group > .icure-label {\n z-index: 1;\n pointer-events: none;\n line-height: 1.4em;\n cursor: text;\n font-size: 14px;\n top: calc(1.4em + 5px);\n left: 9px;\n color: #1D2235;\n align-items: center;\n height: 28px;\n max-width: 85%;\n min-width: 0;\n padding-bottom: 8px;\n}\n.icure-button-group > .icure-label > span {\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n padding-right: 8px;\n}\n.icure-button-group > div {\n display: grid;\n}\n.icure-button-group > div > div {\n display: flex;\n align-items: center;\n gap: 6px;\n}\n.icure-button-group > div > div > .icure-button-group-label {\n z-index: 1;\n line-height: 1.4em;\n cursor: text;\n font-size: 14px;\n top: calc(1.4em + 5px);\n left: 9px;\n transition: transform 0.2s ease-out, color 0.2s ease-out;\n color: #1D2235;\n display: flex;\n align-items: center;\n max-width: 85%;\n min-width: 0;\n}\n.icure-button-group > div > div > .icure-button-group-label > span {\n display: block;\n white-space: nowrap;\n text-overflow: ellipsis;\n overflow: hidden;\n padding-right: 8px;\n}\n.icure-button-group > .icure-input {\n flex: 1 1 auto;\n width: auto;\n}\n\n.icure-input #editor {\n color: #1D2235;\n}\n.icure-input #editor.tokens-list .ProseMirror li, .icure-input #editor.styled-tokens-list .ProseMirror li {\n background-color: #DCE7F2;\n}\n.icure-input #editor.tokens-list .ProseMirror li span:after, .icure-input #editor.styled-tokens-list .ProseMirror li span:after {\n background: transparent url(\"data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxu cz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGlkPSJPdXRsaW5lIiB2aWV3 Qm94PSIwIDAgMjQgMjQiIHN0cm9rZT0iIzg4ODg4OCIgZmlsbD0iIzg4ODg4OCIg d2lkdGg9IjUxMiIgaGVpZ2h0PSI1MTIiPjxwYXRoIGQ9Ik0xNiw4YTEsMSwwLDAs MC0xLjQxNCwwTDEyLDEwLjU4Niw5LjQxNCw4QTEsMSwwLDAsMCw4LDkuNDE0TDEw LjU4NiwxMiw4LDE0LjU4NkExLDEsMCwwLDAsOS40MTQsMTZMMTIsMTMuNDE0LDE0 LjU4NiwxNkExLDEsMCwwLDAsMTYsMTQuNTg2TDEzLjQxNCwxMiwxNiw5LjQxNEEx LDEsMCwwLDAsMTYsOFoiLz48cGF0aCBkPSJNMTIsMEExMiwxMiwwLDEsMCwyNCwx MiwxMi4wMTMsMTIuMDEzLDAsMCwwLDEyLDBabTAsMjJBMTAsMTAsMCwxLDEsMjIs MTIsMTAuMDExLDEwLjAxMSwwLDAsMSwxMiwyMloiLz48L3N2Zz4K\") no-repeat center/16px;\n}\n.icure-input #editor.items-list .ProseMirror li {\n border-bottom: 1px dotted #8DA6BF;\n}\n.icure-input .extra {\n padding-right: 0;\n}\n.icure-input .select-arrow {\n opacity: 1;\n}\n.icure-input .select-arrow svg {\n width: 15px;\n height: 15px;\n}\n.icure-input .select-arrow svg path {\n fill: #9CA8B2;\n}\n.icure-input .options {\n padding: 2px;\n display: flex;\n flex-direction: column;\n align-items: flex-start;\n gap: 2px;\n border-radius: 6px;\n background: white;\n box-shadow: 0px 3px 6px 0px rgba(0, 0, 0, 0.12), 0px 6px 16px 0px rgba(0, 0, 0, 0.08), 0px 9px 28px 0px rgba(0, 0, 0, 0.05);\n}\n.icure-input .options .option {\n height: auto;\n min-height: unset;\n display: flex;\n padding: 8px;\n align-items: center;\n align-self: stretch;\n border-radius: 4px;\n background: white;\n color: #1D2235;\n font-size: 12px;\n font-style: normal;\n font-weight: 400;\n line-height: normal;\n cursor: pointer;\n}\n.icure-input .options .option:hover {\n background: #DCE7F2;\n color: #084B83;\n}\n.icure-input:hover .select-arrow svg path, .icure-input:focus .select-arrow svg path {\n fill: #084B83;\n}` \nclass EhrLiteIcureButtonGroup extends IcureButtonGroup {\n\tstatic get styles() {\n\t\treturn [...IcureButtonGroup.styles, ehrLiteCss]\n\t}\n}\nclass EhrLiteIcureDatePickerField extends IcureDatePickerField {\n\tstatic get styles() {\n\t\treturn [...IcureDatePickerField.styles, ehrLiteCss]\n\t}\n}\nclass EhrLiteIcureDropdownField extends IcureDropdownField {\n\tstatic get styles() {\n\t\treturn [...IcureDropdownField.styles, ehrLiteCss]\n\t}\n}\nclass EhrLiteIcureForm extends IcureForm {\n\tstatic get styles() {\n\t\treturn [...IcureForm.styles, ehrLiteCss]\n\t}\n}\nclass EhrLiteIcureLabel extends IcureLabel {\n\tstatic get styles() {\n\t\treturn [...IcureLabel.styles, ehrLiteCss]\n\t}\n}\nclass EhrLiteIcureTextField extends IcureTextField {\n\tstatic get styles() {\n\t\treturn [...IcureTextField.styles, ehrLiteCss]\n\t}\n}\nclass EhrLiteLabel extends Label {\n\tstatic get styles() {\n\t\treturn [...Label.styles, ehrLiteCss]\n\t}\n}\n\ncustomElements.define('icure-form-checkbox', CheckBox)\ncustomElements.define('icure-form-date-picker', DatePicker)\ncustomElements.define('icure-form-date-time-picker', DateTimePicker)\ncustomElements.define('icure-form-dropdown-field', DropdownField)\ncustomElements.define('icure-button-group', EhrLiteIcureButtonGroup)\ncustomElements.define('icure-date-picker-field', EhrLiteIcureDatePickerField)\ncustomElements.define('icure-dropdown-field', EhrLiteIcureDropdownField)\ncustomElements.define('icure-form', EhrLiteIcureForm)\ncustomElements.define('icure-label', EhrLiteIcureLabel)\ncustomElements.define('icure-text-field', EhrLiteIcureTextField)\ncustomElements.define('icure-form-items-list-field', ItemsListField)\ncustomElements.define('icure-form-label', EhrLiteLabel)\ncustomElements.define('icure-form-measure-field', MeasureField)\ncustomElements.define('icure-form-number-field', NumberField)\ncustomElements.define('icure-form-radio-button', RadioButton)\ncustomElements.define('icure-form-text-field', TextField)\ncustomElements.define('icure-form-time-picker', TimePicker)\ncustomElements.define('icure-form-token-field', TokenField)\n"]}
@@ -1,16 +0,0 @@
1
- import { CodeStub, Content, Service } from '@icure/api';
2
- export declare function anyDateToDate(dateOrEpochOrLongCalendar?: Date | number): Date | undefined;
3
- export declare function dateToFuzzyDate(date: Date): number;
4
- export declare function anyDateToFuzzyDate(dateOrEpochOrLongCalendar: Date | number): number | undefined;
5
- export declare function currentTime(): string;
6
- export declare function currentDate(): string;
7
- export declare function currentDateTime(): string;
8
- export declare function isCodeEqual(c1: CodeStub, c2: CodeStub): boolean;
9
- export declare function areCodesEqual(c1s: CodeStub[], c2s: CodeStub[]): boolean;
10
- export declare function isServiceEqual(svc1: Service, svc2: Service): boolean;
11
- export declare function isContentEqual(content1: Content | undefined, content2: Content | undefined): boolean;
12
- export declare function isServiceContentEqual(content1: {
13
- [language: string]: Content;
14
- }, content2: {
15
- [language: string]: Content;
16
- }): boolean;
@@ -1,105 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.isServiceContentEqual = exports.isContentEqual = exports.isServiceEqual = exports.areCodesEqual = exports.isCodeEqual = exports.currentDateTime = exports.currentDate = exports.currentTime = exports.anyDateToFuzzyDate = exports.dateToFuzzyDate = exports.anyDateToDate = void 0;
7
- const parse_1 = __importDefault(require("date-fns/parse"));
8
- function anyDateToDate(dateOrEpochOrLongCalendar) {
9
- if (dateOrEpochOrLongCalendar instanceof Date) {
10
- return anyDateToDate(+dateOrEpochOrLongCalendar);
11
- }
12
- if (!dateOrEpochOrLongCalendar && dateOrEpochOrLongCalendar !== 0) {
13
- return undefined;
14
- }
15
- if (dateOrEpochOrLongCalendar >= 18000101 && dateOrEpochOrLongCalendar < 25400000) {
16
- return (0, parse_1.default)('' + dateOrEpochOrLongCalendar, 'yyyyMMdd', new Date());
17
- }
18
- else if (dateOrEpochOrLongCalendar >= 18000101000000) {
19
- return (0, parse_1.default)('' + dateOrEpochOrLongCalendar, 'yyyyMMddHHmmss', new Date());
20
- }
21
- else {
22
- return new Date(dateOrEpochOrLongCalendar);
23
- }
24
- }
25
- exports.anyDateToDate = anyDateToDate;
26
- function dateToFuzzyDate(date) {
27
- return parseInt(`${date.getFullYear()}${(date.getMonth() + 1).toString().padStart(2, '0')}${date.getDate().toString().padStart(2, '0')}${date.getHours().toString().padStart(2, '0')}:${date
28
- .getMinutes()
29
- .toString()
30
- .padStart(2, '0')}:${date.getSeconds().toString().padStart(2, '0')}`);
31
- }
32
- exports.dateToFuzzyDate = dateToFuzzyDate;
33
- function anyDateToFuzzyDate(dateOrEpochOrLongCalendar) {
34
- const date = anyDateToDate(dateOrEpochOrLongCalendar);
35
- if (!date) {
36
- return undefined;
37
- }
38
- return dateToFuzzyDate(date);
39
- }
40
- exports.anyDateToFuzzyDate = anyDateToFuzzyDate;
41
- function currentTime() {
42
- const now = new Date();
43
- return `${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}:${now.getSeconds().toString().padStart(2, '0')}`;
44
- }
45
- exports.currentTime = currentTime;
46
- function currentDate() {
47
- const now = new Date();
48
- return `${now.getDate().toString().padStart(2, '0')}/${(now.getMonth() + 1).toString().padStart(2, '0')}/${now.getFullYear()}`;
49
- }
50
- exports.currentDate = currentDate;
51
- function currentDateTime() {
52
- return `${currentDate()} ${currentTime()}`;
53
- }
54
- exports.currentDateTime = currentDateTime;
55
- function isCodeEqual(c1, c2) {
56
- var _a, _b;
57
- const idParts1 = (_a = c1.id) === null || _a === void 0 ? void 0 : _a.split('|');
58
- const idParts2 = (_b = c2.id) === null || _b === void 0 ? void 0 : _b.split('|');
59
- const type1 = c1.type || (idParts1 === null || idParts1 === void 0 ? void 0 : idParts1[0]);
60
- const type2 = c2.type || (idParts2 === null || idParts2 === void 0 ? void 0 : idParts2[0]);
61
- const code1 = c1.code || (idParts1 === null || idParts1 === void 0 ? void 0 : idParts1[1]);
62
- const code2 = c2.code || (idParts2 === null || idParts2 === void 0 ? void 0 : idParts2[1]);
63
- const version1 = c1.version || (idParts1 === null || idParts1 === void 0 ? void 0 : idParts1[2]);
64
- const version2 = c2.version || (idParts2 === null || idParts2 === void 0 ? void 0 : idParts2[2]);
65
- return type1 === type2 && code1 === code2 && version1 === version2;
66
- }
67
- exports.isCodeEqual = isCodeEqual;
68
- function areCodesEqual(c1s, c2s) {
69
- return c1s.every((c1) => c2s.some((c2) => isCodeEqual(c1, c2)) || false) && c2s.every((c2) => c1s.some((c1) => isCodeEqual(c1, c2)) || false);
70
- }
71
- exports.areCodesEqual = areCodesEqual;
72
- function isServiceEqual(svc1, svc2) {
73
- return (svc1.id === svc2.id && svc1.valueDate === svc2.valueDate && areCodesEqual(svc1.codes || [], svc2.codes || []) && isServiceContentEqual(svc1.content || {}, svc2.content || {}));
74
- }
75
- exports.isServiceEqual = isServiceEqual;
76
- function isContentEqual(content1, content2) {
77
- var _a, _b;
78
- if (!content1 && !content2) {
79
- return true;
80
- }
81
- if (!content1 || !content2) {
82
- return false;
83
- }
84
- return (((!content1.binaryValue && !content2.binaryValue) || content1.binaryValue === content2.binaryValue) &&
85
- (((content1.booleanValue === null || content1.booleanValue === undefined) && (content2.booleanValue === null || content2.booleanValue === undefined)) ||
86
- content1.booleanValue === content2.booleanValue) &&
87
- ((!content1.documentId && !content2.documentId) || content1.documentId === content2.documentId) &&
88
- (((content1.fuzzyDateValue === null || content1.fuzzyDateValue === undefined) && (content2.fuzzyDateValue === null || content2.fuzzyDateValue === undefined)) ||
89
- content1.fuzzyDateValue === content2.fuzzyDateValue) &&
90
- ((!content1.instantValue && !content2.instantValue) || content1.instantValue === content2.instantValue) &&
91
- ((!content1.measureValue && !content2.measureValue) || content1.measureValue === content2.measureValue) &&
92
- ((!content1.medicationValue && !content2.medicationValue) || content1.medicationValue === content2.medicationValue) &&
93
- ((!content1.stringValue && !content2.stringValue) || content1.stringValue === content2.stringValue) &&
94
- (((content1.numberValue === null || content1.numberValue === undefined) && (content2.numberValue === null || content2.numberValue === undefined)) ||
95
- content1.numberValue === content2.numberValue) &&
96
- ((!content1.compoundValue && !content2.compoundValue) ||
97
- ((((_a = content1.compoundValue) === null || _a === void 0 ? void 0 : _a.every((s1) => { var _a; return (_a = content2.compoundValue) === null || _a === void 0 ? void 0 : _a.some((s2) => isServiceEqual(s1, s2)); })) || false) &&
98
- (((_b = content2 === null || content2 === void 0 ? void 0 : content2.compoundValue) === null || _b === void 0 ? void 0 : _b.every((s2) => { var _a; return (_a = content1 === null || content1 === void 0 ? void 0 : content1.compoundValue) === null || _a === void 0 ? void 0 : _a.some((s1) => isServiceEqual(s1, s2)); })) || false))));
99
- }
100
- exports.isContentEqual = isContentEqual;
101
- function isServiceContentEqual(content1, content2) {
102
- return Object.keys(content1).reduce((isEqual, lng) => isEqual && isContentEqual(content1[lng], content2[lng]), true);
103
- }
104
- exports.isServiceContentEqual = isServiceContentEqual;
105
- //# sourceMappingURL=icure-utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"icure-utils.js","sourceRoot":"","sources":["../../tmp/utils/icure-utils.ts"],"names":[],"mappings":";;;;;;AAAA,2DAAkC;AAGlC,SAAgB,aAAa,CAAC,yBAAyC;IACtE,IAAI,yBAAyB,YAAY,IAAI,EAAE,CAAC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AI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA,EAAA,CAAC,KAAI,KAAK,CAAC;gBAC9G,CAAC,CAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,aAAa,0CAAE,KAAK,CAAC,CAAC,EAAE,EAAE,EAAE,WAAC,OAAA,MAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,aAAa,0CAAE,IAAI,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA,EAAA,CAAC,KAAI,KAAK,CAAC,CAAC,CAAC,CACpH,CAAA;AACF,CAAC;AAxBD,wCAwBC;AAED,SAAgB,qBAAqB,CAAC,QAAyC,EAAE,QAAyC;IACzH,OAAO,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE,CAAC,OAAO,IAAI,cAAc,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAe,CAAC,CAAA;AAChI,CAAC;AAFD,sDAEC","sourcesContent":["import parse from 'date-fns/parse'\nimport { CodeStub, Content, Service } from '@icure/api'\n\nexport function anyDateToDate(dateOrEpochOrLongCalendar?: Date | number): Date | undefined {\n\tif (dateOrEpochOrLongCalendar instanceof Date) {\n\t\treturn anyDateToDate(+dateOrEpochOrLongCalendar)\n\t}\n\tif (!dateOrEpochOrLongCalendar && dateOrEpochOrLongCalendar !== 0) {\n\t\treturn undefined\n\t}\n\tif (dateOrEpochOrLongCalendar >= 18000101 && dateOrEpochOrLongCalendar < 25400000) {\n\t\treturn parse('' + dateOrEpochOrLongCalendar, 'yyyyMMdd', new Date())\n\t} else if (dateOrEpochOrLongCalendar >= 18000101000000) {\n\t\treturn parse('' + dateOrEpochOrLongCalendar, 'yyyyMMddHHmmss', new Date())\n\t} else {\n\t\treturn new Date(dateOrEpochOrLongCalendar)\n\t}\n}\n\nexport function dateToFuzzyDate(date: Date): number {\n\treturn parseInt(\n\t\t`${date.getFullYear()}${(date.getMonth() + 1).toString().padStart(2, '0')}${date.getDate().toString().padStart(2, '0')}${date.getHours().toString().padStart(2, '0')}:${date\n\t\t\t.getMinutes()\n\t\t\t.toString()\n\t\t\t.padStart(2, '0')}:${date.getSeconds().toString().padStart(2, '0')}`,\n\t)\n}\n\nexport function anyDateToFuzzyDate(dateOrEpochOrLongCalendar: Date | number) {\n\tconst date = anyDateToDate(dateOrEpochOrLongCalendar)\n\tif (!date) {\n\t\treturn undefined\n\t}\n\treturn dateToFuzzyDate(date)\n}\n\nexport function currentTime() {\n\tconst now = new Date()\n\treturn `${now.getHours().toString().padStart(2, '0')}:${now.getMinutes().toString().padStart(2, '0')}:${now.getSeconds().toString().padStart(2, '0')}`\n}\n\nexport function currentDate() {\n\tconst now = new Date()\n\treturn `${now.getDate().toString().padStart(2, '0')}/${(now.getMonth() + 1).toString().padStart(2, '0')}/${now.getFullYear()}`\n}\n\nexport function currentDateTime() {\n\treturn `${currentDate()} ${currentTime()}`\n}\n\nexport function isCodeEqual(c1: CodeStub, c2: CodeStub): boolean {\n\tconst idParts1 = c1.id?.split('|')\n\tconst idParts2 = c2.id?.split('|')\n\tconst type1 = c1.type || idParts1?.[0]\n\tconst type2 = c2.type || idParts2?.[0]\n\tconst code1 = c1.code || idParts1?.[1]\n\tconst code2 = c2.code || idParts2?.[1]\n\tconst version1 = c1.version || idParts1?.[2]\n\tconst version2 = c2.version || idParts2?.[2]\n\treturn type1 === type2 && code1 === code2 && version1 === version2\n}\n\nexport function areCodesEqual(c1s: CodeStub[], c2s: CodeStub[]): boolean {\n\treturn c1s.every((c1) => c2s.some((c2) => isCodeEqual(c1, c2)) || false) && c2s.every((c2) => c1s.some((c1) => isCodeEqual(c1, c2)) || false)\n}\n\nexport function isServiceEqual(svc1: Service, svc2: Service): boolean {\n\treturn (\n\t\tsvc1.id === svc2.id && svc1.valueDate === svc2.valueDate && areCodesEqual(svc1.codes || [], svc2.codes || []) && isServiceContentEqual(svc1.content || {}, svc2.content || {})\n\t)\n}\n\nexport function isContentEqual(content1: Content | undefined, content2: Content | undefined): boolean {\n\tif (!content1 && !content2) {\n\t\treturn true\n\t}\n\tif (!content1 || !content2) {\n\t\treturn false\n\t}\n\treturn (\n\t\t((!content1.binaryValue && !content2.binaryValue) || content1.binaryValue === content2.binaryValue) &&\n\t\t(((content1.booleanValue === null || content1.booleanValue === undefined) && (content2.booleanValue === null || content2.booleanValue === undefined)) ||\n\t\t\tcontent1.booleanValue === content2.booleanValue) &&\n\t\t((!content1.documentId && !content2.documentId) || content1.documentId === content2.documentId) &&\n\t\t(((content1.fuzzyDateValue === null || content1.fuzzyDateValue === undefined) && (content2.fuzzyDateValue === null || content2.fuzzyDateValue === undefined)) ||\n\t\t\tcontent1.fuzzyDateValue === content2.fuzzyDateValue) &&\n\t\t((!content1.instantValue && !content2.instantValue) || content1.instantValue === content2.instantValue) &&\n\t\t((!content1.measureValue && !content2.measureValue) || content1.measureValue === content2.measureValue) &&\n\t\t((!content1.medicationValue && !content2.medicationValue) || content1.medicationValue === content2.medicationValue) &&\n\t\t((!content1.stringValue && !content2.stringValue) || content1.stringValue === content2.stringValue) &&\n\t\t(((content1.numberValue === null || content1.numberValue === undefined) && (content2.numberValue === null || content2.numberValue === undefined)) ||\n\t\t\tcontent1.numberValue === content2.numberValue) &&\n\t\t((!content1.compoundValue && !content2.compoundValue) ||\n\t\t\t((content1.compoundValue?.every((s1) => content2.compoundValue?.some((s2) => isServiceEqual(s1, s2))) || false) &&\n\t\t\t\t(content2?.compoundValue?.every((s2) => content1?.compoundValue?.some((s1) => isServiceEqual(s1, s2))) || false)))\n\t)\n}\n\nexport function isServiceContentEqual(content1: { [language: string]: Content }, content2: { [language: string]: Content }): boolean {\n\treturn Object.keys(content1).reduce((isEqual, lng) => isEqual && isContentEqual(content1[lng], content2[lng]), true as boolean)\n}\n"]}