@loftyshaky/shared 2.0.0 → 2.2.0
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.
- package/_locales/en/messages.json +38 -20
- package/_locales/ru/messages.json +40 -22
- package/announcement.js +1 -1
- package/app.js +1 -1
- package/chunk-error.js +1 -1
- package/chunk-index.js +1 -1
- package/chunk-merge.js +5 -0
- package/chunk-pickr.min.js +1 -1
- package/chunk-title.js +3 -3
- package/chunk-viewport.js +1 -1
- package/dependencies.js +1 -1
- package/dependencies.txt +75 -87
- package/ext.js +1 -1
- package/inputs.js +1 -1
- package/js/apps.js +17 -4
- package/js/projects_path.js +1 -1
- package/package.json +1 -1
- package/scss/settings/ext_version.scss +2 -2
- package/scss/settings/main.scss +2 -1
- package/scss/settings/sections.scss +1 -0
- package/scss/shared/btns.scss +15 -1
- package/scss/shared/checkboxes.scss +1 -0
- package/scss/shared/colors.scss +1 -1
- package/scss/shared/group.scss +10 -1
- package/scss/shared/inputs.scss +2 -3
- package/scss/shared/main.scss +10 -0
- package/scss/shared/themes/general/template.scss +25 -25
- package/scss/shared/transitions.scss +1 -0
- package/settings.d.ts +1 -1
- package/settings.js +1 -1
- package/shared.d.ts +1 -1
- package/shared.js +1 -1
- package/shared_clean.d.ts +1 -1
- package/shared_clean.js +1 -1
- package/ts/error_modules/crash_handler/components/body.d.ts +1 -1
- package/ts/error_modules/crash_handler/components/prop_types/body.d.ts +0 -1
- package/ts/error_modules/error/data/error.d.ts +1 -1
- package/ts/error_modules/error/scripts/notification.d.ts +1 -1
- package/ts/error_modules_clean/error/data/error.d.ts +1 -1
- package/ts/error_modules_clean/error/interfaces/show_error.d.ts +1 -0
- package/ts/error_modules_clean/error/interfaces/show_error_state_1.d.ts +1 -0
- package/ts/error_modules_clean/error/interfaces/show_error_state_1_f.d.ts +1 -1
- package/ts/error_modules_clean/error/interfaces/show_error_state_2.d.ts +1 -0
- package/ts/error_modules_clean/error/interfaces/show_error_state_2_f.d.ts +1 -1
- package/ts/inputs/color/data/color.d.ts +1 -1
- package/ts/inputs/color/data/visibility.d.ts +1 -1
- package/ts/inputs/components/prop_types/checkbox.d.ts +1 -0
- package/ts/inputs/components/prop_types/input_item.d.ts +0 -1
- package/ts/inputs/data/input_width.d.ts +16 -15
- package/ts/inputs/data/nested_input.d.ts +2 -2
- package/ts/inputs/data/upload_box.d.ts +1 -1
- package/ts/inputs/scripts/resolve.d.ts +2 -3
- package/ts/settings/internal.d.ts +2 -2
- package/ts/settings/optional_permissions/data/permission.d.ts +4 -1
- package/ts/settings/optional_permissions/interfaces/index.d.ts +1 -0
- package/ts/settings/optional_permissions/interfaces/show_enable_permissions_notification_permission.d.ts +7 -0
- package/ts/settings/{settings → sections}/data/back_up.d.ts +1 -1
- package/ts/settings/sections/data/index.d.ts +2 -0
- package/ts/settings/{settings → sections}/data/sections.d.ts +13 -13
- package/ts/settings/sections/scripts/index.d.ts +1 -0
- package/ts/settings/{settings → sections}/scripts/theme.d.ts +1 -1
- package/ts/shared/data/data/cache.d.ts +15 -0
- package/ts/shared/data/data/index.d.ts +2 -0
- package/ts/shared/{settings → data}/data/settings.d.ts +1 -2
- package/ts/shared/internal.d.ts +1 -1
- package/ts/shared/schema/data/schema.d.ts +5 -3
- package/ts/shared/tab_index/scripts/tab_index.d.ts +2 -2
- package/ts/shared/tr/components/prop_types/base_tr.d.ts +0 -1
- package/ts/shared/tr/data/transition.d.ts +2 -2
- package/ts/shared_clean/css_vars/scripts/css_vars.d.ts +1 -1
- package/ts/shared_clean/data/data/index.d.ts +1 -0
- package/ts/shared_clean/{settings → data}/data/settings.d.ts +3 -8
- package/ts/shared_clean/data/scripts/cache.d.ts +17 -5
- package/ts/shared_clean/data/scripts/index.d.ts +2 -0
- package/ts/shared_clean/data/scripts/settings.d.ts +12 -0
- package/ts/shared_clean/data/scripts/sync.d.ts +11 -0
- package/ts/shared_clean/ext.d.ts +3 -0
- package/ts/shared_clean/internal.d.ts +1 -1
- package/ts/shared_clean/no_tr/scripts/state.d.ts +2 -2
- package/ts/shared_clean/schema/data/schema.d.ts +10 -6
- package/ts/shared_clean/service_worker/scripts/service_worker.d.ts +1 -3
- package/ts/shared_clean/theme/scripts/theme.d.ts +2 -2
- package/ts/shared_clean/utils/scripts/utils.d.ts +2 -2
- package/ts/shared_clean/viewport/scripts/viewport.d.ts +1 -1
- package/ts/shared_clean/x.d.ts +11 -1
- package/ts/settings/settings/data/index.d.ts +0 -2
- package/ts/settings/settings/scripts/index.d.ts +0 -1
- package/ts/shared/settings/data/index.d.ts +0 -1
- package/ts/shared_clean/settings/data/index.d.ts +0 -1
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
+
"input_min_width_css": {
|
|
3
|
+
"message": "300"
|
|
4
|
+
},
|
|
5
|
+
"input_max_width_css": {
|
|
6
|
+
"message": "600"
|
|
7
|
+
},
|
|
2
8
|
"an_error_occured_msg": {
|
|
3
9
|
"message": "An error occured."
|
|
4
10
|
},
|
|
@@ -21,10 +27,10 @@
|
|
|
21
27
|
"message": "Reload"
|
|
22
28
|
},
|
|
23
29
|
"cant_render_ui_error": {
|
|
24
|
-
"message": "
|
|
30
|
+
"message": "Unable to render the user interface."
|
|
25
31
|
},
|
|
26
32
|
"dependencicies_from_other_page_loaded_into_this_page_alert": {
|
|
27
|
-
"message": "DEPENDENCIES FROM
|
|
33
|
+
"message": "DEPENDENCIES FROM ANOTHER PAGE ACCIDENTALLY LOADED INTO THIS PAGE!!!\n\nCULPRIT PAGE: "
|
|
28
34
|
},
|
|
29
35
|
"announcement_title_text": {
|
|
30
36
|
"message": "Announcement"
|
|
@@ -32,15 +38,6 @@
|
|
|
32
38
|
"dependencies_title_text": {
|
|
33
39
|
"message": "Dependencies"
|
|
34
40
|
},
|
|
35
|
-
"browse_link_btn_text": {
|
|
36
|
-
"message": "Browse"
|
|
37
|
-
},
|
|
38
|
-
"drag_files_msg_text": {
|
|
39
|
-
"message": "or drag files here"
|
|
40
|
-
},
|
|
41
|
-
"loading_msg_text": {
|
|
42
|
-
"message": "Loading..."
|
|
43
|
-
},
|
|
44
41
|
"settings_title_text": {
|
|
45
42
|
"message": "Settings"
|
|
46
43
|
},
|
|
@@ -50,8 +47,8 @@
|
|
|
50
47
|
"links_section_text": {
|
|
51
48
|
"message": "Links"
|
|
52
49
|
},
|
|
53
|
-
"
|
|
54
|
-
"message": "
|
|
50
|
+
"permissions_section_text": {
|
|
51
|
+
"message": "Permissions"
|
|
55
52
|
},
|
|
56
53
|
"restore_section_text": {
|
|
57
54
|
"message": "Restore"
|
|
@@ -62,6 +59,21 @@
|
|
|
62
59
|
"offers_section_text": {
|
|
63
60
|
"message": "Offers"
|
|
64
61
|
},
|
|
62
|
+
"browse_link_btn_text": {
|
|
63
|
+
"message": "Browse"
|
|
64
|
+
},
|
|
65
|
+
"drag_files_msg_text": {
|
|
66
|
+
"message": "or drag files here"
|
|
67
|
+
},
|
|
68
|
+
"loading_msg_text": {
|
|
69
|
+
"message": "Loading..."
|
|
70
|
+
},
|
|
71
|
+
"tabs_permission_chrome_label_text": {
|
|
72
|
+
"message": "[tabs] Read your browsing history"
|
|
73
|
+
},
|
|
74
|
+
"tabs_permission_edge_label_text": {
|
|
75
|
+
"message": "[tabs] Read your browsing history"
|
|
76
|
+
},
|
|
65
77
|
"download_back_up_btn_text": {
|
|
66
78
|
"message": "Download back up"
|
|
67
79
|
},
|
|
@@ -132,22 +144,22 @@
|
|
|
132
144
|
"message": "Restore default palette"
|
|
133
145
|
},
|
|
134
146
|
"show_content_link_btn_text": {
|
|
135
|
-
"message": "
|
|
147
|
+
"message": "Reveal these settings ⯆"
|
|
136
148
|
},
|
|
137
149
|
"hide_content_link_btn_text": {
|
|
138
150
|
"message": "Hide these settings ⯅"
|
|
139
151
|
},
|
|
140
152
|
"color_help_text": {
|
|
141
|
-
"message": "Right-click
|
|
153
|
+
"message": "Right-click the main or palette color buttons to select a custom color. Alternatively, you can use the Tab key to navigate to the main or palette color buttons, then press Ctrl/Shift/Alt + Enter to choose a custom color."
|
|
142
154
|
},
|
|
143
155
|
"privacy_policy_link_text": {
|
|
144
156
|
"message": "📜 Privacy policy"
|
|
145
157
|
},
|
|
146
158
|
"rate_link_text": {
|
|
147
|
-
"message": "⭐️
|
|
159
|
+
"message": "⭐️ Enjoying this extension? Please rate it!"
|
|
148
160
|
},
|
|
149
161
|
"help_translating_link_text": {
|
|
150
|
-
"message": "🈯 Help
|
|
162
|
+
"message": "🈯 Help translate this extension into your language"
|
|
151
163
|
},
|
|
152
164
|
"facebook_page_link_text": {
|
|
153
165
|
"message": "🖼️ Follow my Facebook page"
|
|
@@ -162,7 +174,7 @@
|
|
|
162
174
|
"message": "🧩 Dependencies"
|
|
163
175
|
},
|
|
164
176
|
"offer_tinkoff_black_text": {
|
|
165
|
-
"message": "
|
|
177
|
+
"message": "Sign up for a Tinkoff Black card using @this link@ and receive 500 rubles."
|
|
166
178
|
},
|
|
167
179
|
"offer_tinkoff_investments_brokerage_account_text": {
|
|
168
180
|
"message": "Open a brokerage account with Tinkoff Investments using @this link@ and get a share of up to 20,000 rubles."
|
|
@@ -254,10 +266,16 @@
|
|
|
254
266
|
"youre_now_a_developer_notification": {
|
|
255
267
|
"message": "You're now a developer!"
|
|
256
268
|
},
|
|
269
|
+
"backup_permissions_start_notification": {
|
|
270
|
+
"message": "The extension has detected the following permission in your backup: "
|
|
271
|
+
},
|
|
272
|
+
"backup_permissions_end_notification": {
|
|
273
|
+
"message": ". Please navigate to the \"Permissions\" section and enable all required permissions to ensure the extension functions correctly."
|
|
274
|
+
},
|
|
257
275
|
"invalid_file_type_back_up_error": {
|
|
258
|
-
"message": "Invalid file type. Upload
|
|
276
|
+
"message": "Invalid file type. Upload the previously downloaded JSON backup file."
|
|
259
277
|
},
|
|
260
278
|
"unable_to_access_settings_error": {
|
|
261
|
-
"message": "Fatal error
|
|
279
|
+
"message": "Fatal error: Unable to access settings. Please try to re-enable or reinstall the extension."
|
|
262
280
|
}
|
|
263
281
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"message": "Сообщение ошибки: "
|
|
13
13
|
},
|
|
14
14
|
"error_keep_visible_msg_text": {
|
|
15
|
-
"message": "Нажмите в любое
|
|
15
|
+
"message": "Нажмите в любое место, чтобы отменить скрытие этого сообщения."
|
|
16
16
|
},
|
|
17
17
|
"error_more_info_btn_text": {
|
|
18
18
|
"message": "Больше информации"
|
|
@@ -21,19 +21,16 @@
|
|
|
21
21
|
"message": "Перезагрузить"
|
|
22
22
|
},
|
|
23
23
|
"cant_render_ui_error": {
|
|
24
|
-
"message": "
|
|
24
|
+
"message": "Невозможно отобразить пользовательский интерфейс."
|
|
25
25
|
},
|
|
26
|
-
"
|
|
27
|
-
"message": "
|
|
26
|
+
"dependencicies_from_other_page_loaded_into_this_page_alert": {
|
|
27
|
+
"message": "ЗАВИСИМОСТИ С ДРУГОЙ СТРАНИЦЫ СЛУЧАЙНО ЗАГРУЗИЛИСЬ НА ЭТУ СТРАНИЦУ!!!\n\nСТРАНИЦА-ВИНОВНИК: "
|
|
28
28
|
},
|
|
29
29
|
"announcement_title_text": {
|
|
30
|
-
"message": "
|
|
31
|
-
},
|
|
32
|
-
"drag_files_msg_text": {
|
|
33
|
-
"message": "файлы или перетащите их сюда"
|
|
30
|
+
"message": "Объявление"
|
|
34
31
|
},
|
|
35
|
-
"
|
|
36
|
-
"message": "
|
|
32
|
+
"dependencies_title_text": {
|
|
33
|
+
"message": "Зависимости"
|
|
37
34
|
},
|
|
38
35
|
"settings_title_text": {
|
|
39
36
|
"message": "Настройки"
|
|
@@ -44,18 +41,33 @@
|
|
|
44
41
|
"links_section_text": {
|
|
45
42
|
"message": "Ссылки"
|
|
46
43
|
},
|
|
47
|
-
"
|
|
48
|
-
"message": "
|
|
44
|
+
"permissions_section_text": {
|
|
45
|
+
"message": "Разрешения"
|
|
49
46
|
},
|
|
50
47
|
"restore_section_text": {
|
|
51
48
|
"message": "Восстановление"
|
|
52
49
|
},
|
|
53
50
|
"admin_section_text": {
|
|
54
|
-
"message": "
|
|
51
|
+
"message": "Администратор"
|
|
55
52
|
},
|
|
56
53
|
"offers_section_text": {
|
|
57
54
|
"message": "Предложения"
|
|
58
55
|
},
|
|
56
|
+
"browse_link_btn_text": {
|
|
57
|
+
"message": "Выберите"
|
|
58
|
+
},
|
|
59
|
+
"drag_files_msg_text": {
|
|
60
|
+
"message": "файлы или перетащите их сюда"
|
|
61
|
+
},
|
|
62
|
+
"loading_msg_text": {
|
|
63
|
+
"message": "Идёт загрузка..."
|
|
64
|
+
},
|
|
65
|
+
"tabs_permission_chrome_label_text": {
|
|
66
|
+
"message": "[tabs] Чтение истории просмотров"
|
|
67
|
+
},
|
|
68
|
+
"tabs_permission_edge_label_text": {
|
|
69
|
+
"message": "[tabs] Чтение вашего журнала браузера"
|
|
70
|
+
},
|
|
59
71
|
"download_back_up_btn_text": {
|
|
60
72
|
"message": "Скачать резорвную копию"
|
|
61
73
|
},
|
|
@@ -69,7 +81,7 @@
|
|
|
69
81
|
"message": "Перезагрузить расширение"
|
|
70
82
|
},
|
|
71
83
|
"options_page_theme_label_text": {
|
|
72
|
-
"message": "Тема страницы
|
|
84
|
+
"message": "Тема страницы настроек"
|
|
73
85
|
},
|
|
74
86
|
"transition_duration_label_text": {
|
|
75
87
|
"message": "Продолжительность анимации (мс)"
|
|
@@ -132,16 +144,16 @@
|
|
|
132
144
|
"message": "Скрыть эти настройки ⯅"
|
|
133
145
|
},
|
|
134
146
|
"color_help_text": {
|
|
135
|
-
"message": "
|
|
147
|
+
"message": "Для выбора пользовательского цвета нажмите правой кнопкой мыши на кнопку основного цвета или цвета палитры. Вы также можете использовать клавишу Tab для навигации к этим кнопкам и затем нажать Ctrl/Shift/Alt + Enter, чтобы выбрать пользовательский цвет."
|
|
136
148
|
},
|
|
137
149
|
"privacy_policy_link_text": {
|
|
138
150
|
"message": "📜 Политика конфиденциальности"
|
|
139
151
|
},
|
|
140
152
|
"rate_link_text": {
|
|
141
|
-
"message": "⭐️
|
|
153
|
+
"message": "⭐️ Понравилось расширение? Пожалуйста, оцените его!"
|
|
142
154
|
},
|
|
143
155
|
"help_translating_link_text": {
|
|
144
|
-
"message": "🈯 Помогите перевести это расширение на
|
|
156
|
+
"message": "🈯 Помогите перевести это расширение на ваш язык"
|
|
145
157
|
},
|
|
146
158
|
"facebook_page_link_text": {
|
|
147
159
|
"message": "🖼️ Подписывайтесь на мою страницу в Facebook"
|
|
@@ -150,7 +162,7 @@
|
|
|
150
162
|
"message": "📢 Страница поддержки"
|
|
151
163
|
},
|
|
152
164
|
"theme_path_link_text": {
|
|
153
|
-
"message": "🛠️ Создайте
|
|
165
|
+
"message": "🛠️ Создайте собственную тему для Chrome с помощью приложения ThemePath"
|
|
154
166
|
},
|
|
155
167
|
"dependencies_link_text": {
|
|
156
168
|
"message": "🧩 Зависимости"
|
|
@@ -159,7 +171,7 @@
|
|
|
159
171
|
"message": "Оформите карту Tinkoff Black по @этой ссылке@ и получите 500 рублей."
|
|
160
172
|
},
|
|
161
173
|
"offer_tinkoff_investments_brokerage_account_text": {
|
|
162
|
-
"message": "Откройте брокерский счёт в Тинькофф Инвестиции по @этой ссылке@ и получите акцию до
|
|
174
|
+
"message": "Откройте брокерский счёт в Тинькофф Инвестиции по @этой ссылке@ и получите акцию на сумму до 20 000 рублей."
|
|
163
175
|
},
|
|
164
176
|
"offer_clear_new_tab_text": {
|
|
165
177
|
"message": "Установите расширение @Clear New Tab@, позволяющее удалить всё со страницы новой вкладки, сохранив фон темы, или установить любое изображение, GIF или видео в качестве обоев."
|
|
@@ -183,15 +195,21 @@
|
|
|
183
195
|
"message": "Восстановить настройки по умолчанию?"
|
|
184
196
|
},
|
|
185
197
|
"restore_default_palette_confirm": {
|
|
186
|
-
"message": "Восстановить палитру
|
|
198
|
+
"message": "Восстановить палитру по умолчанию?"
|
|
187
199
|
},
|
|
188
200
|
"youre_now_a_developer_notification": {
|
|
189
201
|
"message": "Вы стали разработчиком!"
|
|
190
202
|
},
|
|
203
|
+
"backup_permissions_start_notification": {
|
|
204
|
+
"message": "Расширение обнаружило следующие разрешения в вашей резервной копии: "
|
|
205
|
+
},
|
|
206
|
+
"backup_permissions_end_notification": {
|
|
207
|
+
"message": ". Пожалуйста, перейдите в раздел «Разрешения» и включите все необходимые разрешения, чтобы расширение работало правильно."
|
|
208
|
+
},
|
|
191
209
|
"invalid_file_type_back_up_error": {
|
|
192
|
-
"message": "Недопустимый тип файла. Загрузите ранее
|
|
210
|
+
"message": "Недопустимый тип файла. Загрузите ранее загруженный файл резервной копии JSON."
|
|
193
211
|
},
|
|
194
212
|
"unable_to_access_settings_error": {
|
|
195
|
-
"message": "
|
|
213
|
+
"message": "Фатальная ошибка: доступ к настройкам невозможен. Пожалуйста, попробуйте отключить и снова включить расширение или переустановить его."
|
|
196
214
|
}
|
|
197
215
|
}
|
package/announcement.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Copyright 2024
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
"use strict";var title=require("./chunk-title.js"),React=require("react"),viewport=require("./chunk-viewport.js");require("react-dom");const Body=title.observer((()=>React.createElement("div",{className:"main"},React.createElement("h1",{className:"header"},viewport.Title.get()),React.createElement("div",{className:"msg_to_user",dangerouslySetInnerHTML:{__html:ext.msg(`msg_to_user_${env.browser}_text`)}}))));var index=Object.freeze({__proto__:null,Body:Body});exports.c_announcement=index;
|
|
5
|
+
"use strict";var title=require("./chunk-title.js"),React=require("react"),viewport=require("./chunk-viewport.js");require("react-dom"),require("./chunk-merge.js");const Body=title.observer((()=>React.createElement("div",{className:"main"},React.createElement("h1",{className:"header"},viewport.Title.get()),React.createElement("div",{className:"msg_to_user",dangerouslySetInnerHTML:{__html:ext.msg(`msg_to_user_${env.browser}_text`)}}))));var index=Object.freeze({__proto__:null,Body:Body});exports.c_announcement=index;
|
package/app.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Copyright 2024
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
"use strict";var viewport=require("./chunk-viewport.js"),error=require("./chunk-error.js");globalThis.page="front_end",globalThis.is_node="undefined"!=typeof process&&"node"===process.release.name;globalThis.misplaced_dependency=culprit_page=>err((()=>{if(page!==culprit_page){const msg=`DEPENDENCIES FROM THE OTHER PAGE ACCIDENTALLY LOADED INTO THIS PAGE!!!\nCULPRIT PAGE: ${culprit_page.toUpperCase()}`;"back_end"===page?console.log(msg):alert(msg)}}),"shr_1193");const App=class{static get_instance(){return this.instance||(this.instance=new this)}constructor(){this.log_error=(error_obj,error_code)=>{error.Error.output(error_obj,error_code)},this.origin=globalThis.location?globalThis.location.origin:"",this.app_root="",this.get_app_version=()=>{try{return env.version}catch(error_obj){this.log_error(error_obj,"shr_1238")}return""},this.get_language=()=>n(data)&&n(data.settings)&&data.settings.locale?data.settings.locale:"en",this.content_dir=()=>{try{if(globalThis.is_node){return require("path").join(this.app_root,"public","assets")}return n(env)&&"adonis_app"===env.env?`${this.origin}/assets/`:"dist/"}catch(error_obj){this.log_error(error_obj,"shr_1237")}return""},this.read_data_into_vars=()=>viewport.__awaiter(this,void 0,void 0,(function*(){try{const set_messages_json=
|
|
5
|
+
"use strict";var viewport=require("./chunk-viewport.js"),error=require("./chunk-error.js");globalThis.page="front_end",globalThis.is_node="undefined"!=typeof process&&"node"===process.release.name;globalThis.misplaced_dependency=culprit_page=>err((()=>{if(page!==culprit_page){const msg=`DEPENDENCIES FROM THE OTHER PAGE ACCIDENTALLY LOADED INTO THIS PAGE!!!\nCULPRIT PAGE: ${culprit_page.toUpperCase()}`;"back_end"===page?console.log(msg):alert(msg)}}),"shr_1193");const App=class{static get_instance(){return this.instance||(this.instance=new this)}constructor(){this.log_error=(error_obj,error_code)=>{error.Error.output(error_obj,error_code)},this.origin=globalThis.location?globalThis.location.origin:"",this.app_root="",this.get_app_version=()=>{try{return env.version}catch(error_obj){this.log_error(error_obj,"shr_1238")}return""},this.get_language=()=>n(data)&&n(data.settings.prefs)&&data.settings.prefs.locale?data.settings.prefs.locale:"en",this.content_dir=()=>{try{if(globalThis.is_node){return require("path").join(this.app_root,"public","assets")}return n(env)&&"adonis_app"===env.env?`${this.origin}/assets/`:"dist/"}catch(error_obj){this.log_error(error_obj,"shr_1237")}return""},this.read_data_into_vars=()=>viewport.__awaiter(this,void 0,void 0,(function*(){try{const set_messages_json=_a=>viewport.__awaiter(this,[_a],void 0,(function*({locale:locale}){try{if(globalThis.is_node){const path=require("path"),fs=require("fs-extra"),messages_path=path.join(this.content_dir(),"_locales",locale,"messages.json");fs.existsSync(messages_path)&&(this[`messages_${locale}_json`]=fs.readJSONSync(messages_path))}else{const path=`${this.content_dir()}_locales/${locale}/messages.json`;if((yield fetch(path,{method:"HEAD"})).ok){const response=yield fetch(path);this[`messages_${locale}_json`]=yield response.json()}}}catch(error_obj){this.log_error(error_obj,"shr_1233")}}));yield set_messages_json({locale:"en"}),yield set_messages_json({locale:"ru"}),yield set_messages_json({locale:"de"})}catch(error_obj){this.log_error(error_obj,"shr_1191")}return""})),this.msg=msg=>{try{const get_msgs=({user_language:user_language})=>this[`messages_${user_language}_json`]||{},user_language=this.get_language(),is_english=user_language.includes("en"),en_msgs=get_msgs({user_language:"en"}),localized_msgs=is_english?void 0:get_msgs({user_language:user_language});let msg_2=n(en_msgs[msg])&&n(en_msgs[msg].message)?en_msgs[msg].message:"";return is_english||(msg_2=n(localized_msgs)&&n(localized_msgs[msg])&&n(localized_msgs[msg].message)?localized_msgs[msg].message:msg_2),n(msg_2)?msg_2:""}catch(error_obj){this.log_error(error_obj,"shr_1192")}return""},this.read_env_into_global_var=()=>viewport.__awaiter(this,void 0,void 0,(function*(){try{let env_file_text="";if(globalThis.is_node){const path=require("path");env_file_text=require("fs-extra").readFileSync(path.join(this.content_dir(),"env.js"),{encoding:"utf8"})}else{const response=yield fetch(`${this.origin}/env.js`);env_file_text=yield response.text()}globalThis.env=JSON.parse(env_file_text.replace("globalThis.env = ",""))}catch(error_obj){this.log_error(error_obj,"shr_1232")}})),this.get_input_errors=(errors,match_rules)=>{try{const input_errors=[];if(!errors.success)return errors.messages.errors.forEach((error=>{match_rules.forEach((match_rule=>{const exclusion_matched=n(match_rule.rules_exclude)&&match_rule.rules_exclude.some((rule_exclude=>rule_exclude===match_rule.rule));!(error.field!==match_rule.field||n(match_rule.rule)&&error.rule!==match_rule.rule||exclusion_matched)&&input_errors.push(match_rule.input_error)}))})),input_errors}catch(error_obj){this.log_error(error_obj,"shr_1242")}return[]}}}.get_instance();globalThis.app=App,err((()=>{const title=globalThis.document?document.querySelector("title"):void 0;globalThis.page=n(title)&&n(title.dataset.page)?title.dataset.page:"back_end"}),"shr_1190"),exports.App=App;
|
package/chunk-error.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Copyright 2024
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
"use strict";var viewport=require("./chunk-viewport.js");globalThis.show_err_ribbon=(error_obj,error_code,{error_msg_key:error_msg_key="",notification_type:notification_type="error",hide_delay:hide_delay=Error$1.hide_delay,silent:silent=!1,persistent:persistent=!1,exit:exit=!1,is_fullscreen:is_fullscreen=!1,prevent_subsequent_errors:prevent_subsequent_errors=!1}={})=>Error$1.show(error_obj,error_code,{error_msg_key:error_msg_key,notification_type:notification_type,silent:silent,persistent:persistent,exit:exit,hide_delay:hide_delay,is_fullscreen:is_fullscreen,prevent_subsequent_errors:prevent_subsequent_errors}),globalThis.err=(f,error_code,{error_msg_key:error_msg_key="",silent:silent=!1,persistent:persistent=!1,exit:exit=!1,hide_delay:hide_delay=Error$1.hide_delay,is_fullscreen:is_fullscreen=!1,prevent_subsequent_errors:prevent_subsequent_errors=!1}={})=>{try{return f()}catch(error_obj){Error$1.show(error_obj,error_code,{error_msg_key:error_msg_key,silent:silent,persistent:persistent,exit:exit,hide_delay:hide_delay,is_fullscreen:is_fullscreen,prevent_subsequent_errors:prevent_subsequent_errors})}},globalThis.err_async=(f,error_code,{error_msg_key:error_msg_key="",silent:silent=!1,persistent:persistent=!1,exit:exit=!1,hide_delay:hide_delay=Error$1.hide_delay,is_fullscreen:is_fullscreen=!1,prevent_subsequent_errors:prevent_subsequent_errors=!1}={})
|
|
5
|
+
"use strict";var viewport=require("./chunk-viewport.js");globalThis.show_err_ribbon=(error_obj,error_code,{error_msg_key:error_msg_key="",alt_msg:alt_msg="",notification_type:notification_type="error",hide_delay:hide_delay=Error$1.hide_delay,silent:silent=!1,persistent:persistent=!1,exit:exit=!1,is_fullscreen:is_fullscreen=!1,prevent_subsequent_errors:prevent_subsequent_errors=!1}={})=>Error$1.show(error_obj,error_code,{error_msg_key:error_msg_key,alt_msg:alt_msg,notification_type:notification_type,silent:silent,persistent:persistent,exit:exit,hide_delay:hide_delay,is_fullscreen:is_fullscreen,prevent_subsequent_errors:prevent_subsequent_errors}),globalThis.err=(f,error_code,{error_msg_key:error_msg_key="",alt_msg:alt_msg="",silent:silent=!1,persistent:persistent=!1,exit:exit=!1,hide_delay:hide_delay=Error$1.hide_delay,is_fullscreen:is_fullscreen=!1,prevent_subsequent_errors:prevent_subsequent_errors=!1}={})=>{try{return f()}catch(error_obj){Error$1.show(error_obj,error_code,{error_msg_key:error_msg_key,alt_msg:alt_msg,silent:silent,persistent:persistent,exit:exit,hide_delay:hide_delay,is_fullscreen:is_fullscreen,prevent_subsequent_errors:prevent_subsequent_errors})}},globalThis.err_async=(f_1,error_code_1,...args_1)=>viewport.__awaiter(void 0,[f_1,error_code_1,...args_1],void 0,(function*(f,error_code,{error_msg_key:error_msg_key="",alt_msg:alt_msg="",silent:silent=!1,persistent:persistent=!1,exit:exit=!1,hide_delay:hide_delay=Error$1.hide_delay,is_fullscreen:is_fullscreen=!1,prevent_subsequent_errors:prevent_subsequent_errors=!1}={}){try{return yield f()}catch(error_obj){Error$1.show(error_obj,error_code,{error_msg_key:error_msg_key,alt_msg:alt_msg,silent:silent,persistent:persistent,exit:exit,hide_delay:hide_delay,is_fullscreen:is_fullscreen,prevent_subsequent_errors:prevent_subsequent_errors})}})),globalThis.throw_err=msg=>{throw new Error(msg)},globalThis.throw_err_obj=error_obj=>{throw error_obj},globalThis.err_obj=msg=>new Error(msg);const Error$1=class{constructor(){this.hide_delay=5e3,this.prevent_subsequent_errors=!1,this.show=(error_obj,error_code,{error_msg_key:error_msg_key="",alt_msg:alt_msg="",notification_type:notification_type="error",hide_delay:hide_delay=this.hide_delay,silent:silent=!1,persistent:persistent=!1,exit:exit=!1,is_fullscreen:is_fullscreen=!1,prevent_subsequent_errors:prevent_subsequent_errors=!1,show_error_state_1:show_error_state_1,show_error_state_2:show_error_state_2}={})=>{const prevent_subsequent_errors_final=prevent_subsequent_errors||this.prevent_subsequent_errors,silent_final=prevent_subsequent_errors_final?this.prevent_subsequent_errors:silent,persistent_final=!!prevent_subsequent_errors_final||persistent,error_ui_is_visible=!(x.in_service_worker||silent_final||error_obj&&error_obj.silent);if(n(show_error_state_1)&&show_error_state_1(error_obj,{error_msg_key:error_msg_key,alt_msg:alt_msg,notification_type:notification_type,hide_delay:hide_delay,is_fullscreen:is_fullscreen,error_ui_is_visible:error_ui_is_visible,persistent_final:persistent_final,prevent_subsequent_errors:prevent_subsequent_errors}),error_obj&&error_code){if(n(show_error_state_2)&&show_error_state_2(error_obj,error_code,{error_msg_key:error_msg_key,alt_msg:alt_msg,error_ui_is_visible:error_ui_is_visible,silent_final:silent_final}),error_obj.exit||exit){const updated_error_obj=error_obj,set_updated_error_obj_propery=({key:key,undefined_property:undefined_property})=>{updated_error_obj[key]=n(error_obj[key])?error_obj[key]:undefined_property};throw set_updated_error_obj_propery({key:"error_code",undefined_property:error_code}),set_updated_error_obj_propery({key:"error_msg",undefined_property:error_msg_key||alt_msg}),set_updated_error_obj_propery({key:"silent",undefined_property:silent_final}),set_updated_error_obj_propery({key:"persistent",undefined_property:persistent_final}),set_updated_error_obj_propery({key:"exit",undefined_property:exit}),set_updated_error_obj_propery({key:"hide_delay",undefined_property:hide_delay}),updated_error_obj}this.output(error_obj,error_code)}prevent_subsequent_errors&&(this.prevent_subsequent_errors=!0)},this.output=(error_obj,error_code)=>{const line="---------------------------",separator_bottom=`\n${line}`,error_code_and_msg=`${`${line}\n`}Code: ${error_code}\nMessage: ${error_obj.message}`,console_output=error_obj.stack?`${error_code_and_msg}\nStack: ${error_obj.stack+separator_bottom}`:error_code_and_msg+separator_bottom;console.error(console_output)}}static get_instance(){return this.instance||(this.instance=new this)}}.get_instance();exports.Error=Error$1;
|
package/chunk-index.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Copyright 2024
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
"use strict";var viewport=require("./chunk-viewport.js"),t=Object.freeze({__proto__:null});var vars=Object.freeze({__proto__:null,scrollbar_width:17,transpaerent_1px_png:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="});var index$a=Object.freeze({__proto__:null,TransformItem:class{constructor(obj){this.update_existing_val=!1,this.create_property_if_it_doesnt_exist=!0,Object.assign(this,obj),this.old_key=obj.old_key,this.new_key=obj.new_key,this.new_val=obj.new_val}}}),index$9=Object.freeze({__proto__:null,Colors:viewport.Colors}),index$8=Object.freeze({__proto__:null,CssVars:viewport.CssVars}),index$7=Object.freeze({__proto__:null,Cache:viewport.Cache}),index$6=Object.freeze({__proto__:null,State:viewport.State}),index$5=Object.freeze({__proto__:null,ServiceWorker:viewport.ServiceWorker}),index$4=Object.freeze({__proto__:null,Theme:viewport.Theme}),index$3=Object.freeze({__proto__:null,Utils:viewport.Utils}),index$2=Object.freeze({__proto__:null,Viewport:viewport.Viewport}),index$1=Object.freeze({__proto__:null}),index=Object.freeze({__proto__:null});exports.index=index$a,exports.index$1=index$9,exports.index$10=index,exports.index$2=index$8,exports.index$3=index$7,exports.index$4=index$6,exports.index$5=index$5,exports.index$6=index$4,exports.index$7=index$3,exports.index$8=index$2,exports.index$9=index$1,exports.t=t,exports.vars=vars;
|
|
5
|
+
"use strict";var viewport=require("./chunk-viewport.js"),t=Object.freeze({__proto__:null});var vars=Object.freeze({__proto__:null,scrollbar_width:17,transpaerent_1px_png:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNkYAAAAAYAAjCB0C8AAAAASUVORK5CYII="});var index$a=Object.freeze({__proto__:null,TransformItem:class{constructor(obj){this.update_existing_val=!1,this.create_property_if_it_doesnt_exist=!0,Object.assign(this,obj),this.old_key=obj.old_key,this.new_key=obj.new_key,this.new_val=obj.new_val}}}),index$9=Object.freeze({__proto__:null,Colors:viewport.Colors}),index$8=Object.freeze({__proto__:null,CssVars:viewport.CssVars}),index$7=Object.freeze({__proto__:null,Cache:viewport.Cache,Class:viewport.Class,Settings:viewport.Settings$1,Sync:viewport.Sync}),index$6=Object.freeze({__proto__:null,State:viewport.State}),index$5=Object.freeze({__proto__:null,ServiceWorker:viewport.ServiceWorker}),index$4=Object.freeze({__proto__:null,Theme:viewport.Theme}),index$3=Object.freeze({__proto__:null,Utils:viewport.Utils}),index$2=Object.freeze({__proto__:null,Viewport:viewport.Viewport}),index$1=Object.freeze({__proto__:null}),index=Object.freeze({__proto__:null});exports.index=index$a,exports.index$1=index$9,exports.index$10=index,exports.index$2=index$8,exports.index$3=index$7,exports.index$4=index$6,exports.index$5=index$5,exports.index$6=index$4,exports.index$7=index$3,exports.index$8=index$2,exports.index$9=index$1,exports.t=t,exports.vars=vars;
|
package/chunk-merge.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2024
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
"use strict";var viewport=require("./chunk-viewport.js"),baseAssignValue=viewport._baseAssignValue,eq$1=viewport.eq_1;var _assignMergeValue=function(object,key,value){(void 0!==value&&!eq$1(object[key],value)||void 0===value&&!(key in object))&&baseAssignValue(object,key,value)},isArrayLike$1=viewport.isArrayLike_1,isObjectLike$1=viewport.isObjectLike_1;var isArrayLikeObject_1=function(value){return isObjectLike$1(value)&&isArrayLike$1(value)},baseGetTag=viewport._baseGetTag,getPrototype=viewport._getPrototype,isObjectLike=viewport.isObjectLike_1,funcProto=Function.prototype,objectProto=Object.prototype,funcToString=funcProto.toString,hasOwnProperty=objectProto.hasOwnProperty,objectCtorString=funcToString.call(Object);var isPlainObject_1=function(value){if(!isObjectLike(value)||"[object Object]"!=baseGetTag(value))return!1;var proto=getPrototype(value);if(null===proto)return!0;var Ctor=hasOwnProperty.call(proto,"constructor")&&proto.constructor;return"function"==typeof Ctor&&Ctor instanceof Ctor&&funcToString.call(Ctor)==objectCtorString};var _safeGet=function(object,key){if(("constructor"!==key||"function"!=typeof object[key])&&"__proto__"!=key)return object[key]},copyObject=viewport._copyObject,keysIn$1=viewport.keysIn_1;var toPlainObject_1=function(value){return copyObject(value,keysIn$1(value))},assignMergeValue$1=_assignMergeValue,cloneBuffer=viewport._cloneBufferExports,cloneTypedArray=viewport._cloneTypedArray,copyArray=viewport._copyArray,initCloneObject=viewport._initCloneObject,isArguments=viewport.isArguments_1,isArray=viewport.isArray_1,isArrayLikeObject=isArrayLikeObject_1,isBuffer=viewport.isBufferExports,isFunction=viewport.isFunction_1,isObject$2=viewport.isObject_1,isPlainObject=isPlainObject_1,isTypedArray=viewport.isTypedArray_1,safeGet$1=_safeGet,toPlainObject=toPlainObject_1;var _baseMergeDeep=function(object,source,key,srcIndex,mergeFunc,customizer,stack){var objValue=safeGet$1(object,key),srcValue=safeGet$1(source,key),stacked=stack.get(srcValue);if(stacked)assignMergeValue$1(object,key,stacked);else{var newValue=customizer?customizer(objValue,srcValue,key+"",object,source,stack):void 0,isCommon=void 0===newValue;if(isCommon){var isArr=isArray(srcValue),isBuff=!isArr&&isBuffer(srcValue),isTyped=!isArr&&!isBuff&&isTypedArray(srcValue);newValue=srcValue,isArr||isBuff||isTyped?isArray(objValue)?newValue=objValue:isArrayLikeObject(objValue)?newValue=copyArray(objValue):isBuff?(isCommon=!1,newValue=cloneBuffer(srcValue,!0)):isTyped?(isCommon=!1,newValue=cloneTypedArray(srcValue,!0)):newValue=[]:isPlainObject(srcValue)||isArguments(srcValue)?(newValue=objValue,isArguments(objValue)?newValue=toPlainObject(objValue):isObject$2(objValue)&&!isFunction(objValue)||(newValue=initCloneObject(srcValue))):isCommon=!1}isCommon&&(stack.set(srcValue,newValue),mergeFunc(newValue,srcValue,srcIndex,customizer,stack),stack.delete(srcValue)),assignMergeValue$1(object,key,newValue)}},Stack=viewport._Stack,assignMergeValue=_assignMergeValue,baseFor=viewport._baseFor,baseMergeDeep=_baseMergeDeep,isObject$1=viewport.isObject_1,keysIn=viewport.keysIn_1,safeGet=_safeGet;var _baseMerge=function baseMerge$1(object,source,srcIndex,customizer,stack){object!==source&&baseFor(source,(function(srcValue,key){if(stack||(stack=new Stack),isObject$1(srcValue))baseMergeDeep(object,source,key,srcIndex,baseMerge$1,customizer,stack);else{var newValue=customizer?customizer(safeGet(object,key),srcValue,key+"",object,source,stack):void 0;void 0===newValue&&(newValue=srcValue),assignMergeValue(object,key,newValue)}}),keysIn)};var apply=function(func,thisArg,args){switch(args.length){case 0:return func.call(thisArg);case 1:return func.call(thisArg,args[0]);case 2:return func.call(thisArg,args[0],args[1]);case 3:return func.call(thisArg,args[0],args[1],args[2])}return func.apply(thisArg,args)},nativeMax=Math.max;var _overRest=function(func,start,transform){return start=nativeMax(void 0===start?func.length-1:start,0),function(){for(var args=arguments,index=-1,length=nativeMax(args.length-start,0),array=Array(length);++index<length;)array[index]=args[start+index];index=-1;for(var otherArgs=Array(start+1);++index<start;)otherArgs[index]=args[index];return otherArgs[start]=transform(array),apply(func,this,otherArgs)}};var constant=function(value){return function(){return value}},defineProperty=viewport._defineProperty,identity$1=viewport.identity_1,_baseSetToString=defineProperty?function(func,string){return defineProperty(func,"toString",{configurable:!0,enumerable:!1,value:constant(string),writable:!0})}:identity$1,nativeNow=Date.now;var _setToString=function(func){var count=0,lastCalled=0;return function(){var stamp=nativeNow(),remaining=16-(stamp-lastCalled);if(lastCalled=stamp,remaining>0){if(++count>=800)return arguments[0]}else count=0;return func.apply(void 0,arguments)}}(_baseSetToString),identity=viewport.identity_1,overRest=_overRest,setToString=_setToString;var _baseRest=function(func,start){return setToString(overRest(func,start,identity),func+"")},eq=viewport.eq_1,isArrayLike=viewport.isArrayLike_1,isIndex=viewport._isIndex,isObject=viewport.isObject_1;var baseRest=_baseRest,isIterateeCall=function(value,index,object){if(!isObject(object))return!1;var type=typeof index;return!!("number"==type?isArrayLike(object)&&isIndex(index,object.length):"string"==type&&index in object)&&eq(object[index],value)};var baseMerge=_baseMerge,merge_1=function(assigner){return baseRest((function(object,sources){var index=-1,length=sources.length,customizer=length>1?sources[length-1]:void 0,guard=length>2?sources[2]:void 0;for(customizer=assigner.length>3&&"function"==typeof customizer?(length--,customizer):void 0,guard&&isIterateeCall(sources[0],sources[1],guard)&&(customizer=length<3?void 0:customizer,length=1),object=Object(object);++index<length;){var source=sources[index];source&&assigner(object,source,index,customizer)}return object}))}((function(object,source,srcIndex){baseMerge(object,source,srcIndex)})),merge$1=viewport.getDefaultExportFromCjs(merge_1);exports._baseRest=_baseRest,exports.isArrayLikeObject_1=isArrayLikeObject_1,exports.merge=merge$1;
|
package/chunk-pickr.min.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
* Copyright 2024
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
-
"use strict";var viewport=require("./chunk-viewport.js");function _mergeNamespaces(n,m){return m.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(k){if("default"!==k&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:!0,get:function(){return e[k]}})}}))})),Object.freeze(n)}var pickr_min$2={exports:{}};self;var pickr_minExports=pickr_min$2.exports=(()=>(()=>{var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{default:()=>E});var o={};function n(t,e,o,n,i={}){e instanceof HTMLCollection||e instanceof NodeList?e=Array.from(e):Array.isArray(e)||(e=[e]),Array.isArray(o)||(o=[o]);for(const s of e)for(const e of o)s[t](e,n,{capture:!1,...i});return Array.prototype.slice.call(arguments,1)}t.r(o),t.d(o,{adjustableInputNumbers:()=>p,createElementFromString:()=>r,createFromTemplate:()=>a,eventPath:()=>l,off:()=>s,on:()=>i,resolveElement:()=>c});const i=n.bind(null,"addEventListener"),s=n.bind(null,"removeEventListener");function r(t){const e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function a(t){const e=(t,e)=>{const o=t.getAttribute(e);return t.removeAttribute(e),o},o=(t,n={})=>{const i=e(t,":obj"),s=e(t,":ref"),r=i?n[i]={}:n;s&&(n[s]=t);for(const n of Array.from(t.children)){const t=e(n,":arr"),i=o(n,t?{}:r);t&&(r[t]||(r[t]=[])).push(Object.keys(i).length?i:n)}return n};return o(r(t))}function l(t){let e=t.path||t.composedPath&&t.composedPath();if(e)return e;let o=t.target.parentElement;for(e=[t.target,o];o=o.parentElement;)e.push(o);return e.push(document,window),e}function c(t){return t instanceof Element?t:"string"==typeof t?t.split(/>>/g).reduce(((t,e,o,n)=>(t=t.querySelector(e),o<n.length-1?t.shadowRoot:t)),document):null}function p(t,e=(t=>t)){function o(o){const n=[.001,.01,.1][Number(o.shiftKey||2*o.ctrlKey)]*(o.deltaY<0?1:-1);let i=0,s=t.selectionStart;t.value=t.value.replace(/[\d.]+/g,((t,o)=>o<=s&&o+t.length>=s?(s=o,e(Number(t),n,i)):(i++,t))),t.focus(),t.setSelectionRange(s,s),o.preventDefault(),t.dispatchEvent(new Event("input"))}i(t,"focus",(()=>i(window,"wheel",o,{passive:!1}))),i(t,"blur",(()=>s(window,"wheel",o)))}const{min:u,max:h,floor:d,round:m}=Math;function f(t,e,o){e/=100,o/=100;const n=d(t=t/360*6),i=t-n,s=o*(1-e),r=o*(1-i*e),a=o*(1-(1-i)*e),l=n%6;return[255*[o,r,s,s,a,o][l],255*[a,o,o,r,s,s][l],255*[s,s,a,o,o,r][l]]}function v(t,e,o){const n=(2-(e/=100))*(o/=100)/2;return 0!==n&&(e=1===n?0:n<.5?e*o/(2*n):e*o/(2-2*n)),[t,100*e,100*n]}function b(t,e,o){const n=u(t/=255,e/=255,o/=255),i=h(t,e,o),s=i-n;let r,a;if(0===s)r=a=0;else{a=s/i;const n=((i-t)/6+s/2)/s,l=((i-e)/6+s/2)/s,c=((i-o)/6+s/2)/s;t===i?r=c-l:e===i?r=1/3+n-c:o===i&&(r=2/3+l-n),r<0?r+=1:r>1&&(r-=1)}return[360*r,100*a,100*i]}function y(t,e,o,n){return e/=100,o/=100,[...b(255*(1-u(1,(t/=100)*(1-(n/=100))+n)),255*(1-u(1,e*(1-n)+n)),255*(1-u(1,o*(1-n)+n)))]}function g(t,e,o){e/=100;const n=2*(e*=(o/=100)<.5?o:1-o)/(o+e)*100,i=100*(o+e);return[t,isNaN(n)?0:n,i]}function _(t){return b(...t.match(/.{2}/g).map((t=>parseInt(t,16))))}function A(t=0,e=0,o=0,n=1){const i=(t,e)=>(o=-1)=>e(~o?t.map((t=>Number(t.toFixed(o)))):t),s={h:t,s:e,v:o,a:n,toHSVA(){const t=[s.h,s.s,s.v,s.a];return t.toString=i(t,(t=>`hsva(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toHSLA(){const t=[...v(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`hsla(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toRGBA(){const t=[...f(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${s.a})`)),t},toCMYK(){const t=function(t,e,o){const n=f(t,e,o),i=n[0]/255,s=n[1]/255,r=n[2]/255,a=u(1-i,1-s,1-r);return[100*(1===a?0:(1-i-a)/(1-a)),100*(1===a?0:(1-s-a)/(1-a)),100*(1===a?0:(1-r-a)/(1-a)),100*a]}(s.h,s.s,s.v);return t.toString=i(t,(t=>`cmyk(${t[0]}%, ${t[1]}%, ${t[2]}%, ${t[3]}%)`)),t},toHEXA(){const t=function(t,e,o){return f(t,e,o).map((t=>m(t).toString(16).padStart(2,"0")))}(s.h,s.s,s.v),e=s.a>=1?"":Number((255*s.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return e&&t.push(e),t.toString=()=>`#${t.join("").toUpperCase()}`,t},clone:()=>A(s.h,s.s,s.v,s.a)};return s}const $=t=>Math.max(Math.min(t,1),0);function C(t){const e={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},t),_keyboard(t){const{options:o}=e,{type:n,key:i}=t;if(document.activeElement===o.wrapper){const{lock:o}=e.options,s="ArrowUp"===i,r="ArrowRight"===i,a="ArrowDown"===i,l="ArrowLeft"===i;if("keydown"===n&&(s||r||a||l)){let n=0,i=0;"v"===o?n=s||r?1:-1:"h"===o?n=s||r?-1:1:(i=s?-1:a?1:0,n=l?-1:r?1:0),e.update($(e.cache.x+.01*n),$(e.cache.y+.01*i)),t.preventDefault()}else i.startsWith("Arrow")&&(e.options.onstop(),t.preventDefault())}},_tapstart(t){i(document,["mouseup","touchend","touchcancel"],e._tapstop),i(document,["mousemove","touchmove"],e._tapmove),t.cancelable&&t.preventDefault(),e._tapmove(t)},_tapmove(t){const{options:o,cache:n}=e,{lock:i,element:s,wrapper:r}=o,a=r.getBoundingClientRect();let l=0,c=0;if(t){const e=t&&t.touches&&t.touches[0];l=t?(e||t).clientX:0,c=t?(e||t).clientY:0,l<a.left?l=a.left:l>a.left+a.width&&(l=a.left+a.width),c<a.top?c=a.top:c>a.top+a.height&&(c=a.top+a.height),l-=a.left,c-=a.top}else n&&(l=n.x*a.width,c=n.y*a.height);"h"!==i&&(s.style.left=`calc(${l/a.width*100}% - ${s.offsetWidth/2}px)`),"v"!==i&&(s.style.top=`calc(${c/a.height*100}% - ${s.offsetHeight/2}px)`),e.cache={x:l/a.width,y:c/a.height};const p=$(l/a.width),u=$(c/a.height);switch(i){case"v":return o.onchange(p);case"h":return o.onchange(u);default:return o.onchange(p,u)}},_tapstop(){e.options.onstop(),s(document,["mouseup","touchend","touchcancel"],e._tapstop),s(document,["mousemove","touchmove"],e._tapmove)},trigger(){e._tapmove()},update(t=0,o=0){const{left:n,top:i,width:s,height:r}=e.options.wrapper.getBoundingClientRect();"h"===e.options.lock&&(o=t),e._tapmove({clientX:n+s*t,clientY:i+r*o})},destroy(){const{options:t,_tapstart:o,_keyboard:n}=e;s(document,["keydown","keyup"],n),s([t.wrapper,t.element],"mousedown",o),s([t.wrapper,t.element],"touchstart",o,{passive:!1})}},{options:o,_tapstart:n,_keyboard:r}=e;return i([o.wrapper,o.element],"mousedown",n),i([o.wrapper,o.element],"touchstart",n,{passive:!1}),i(document,["keydown","keyup"],r),e}function k(t={}){t=Object.assign({onchange:()=>0,className:"",elements:[]},t);const e=i(t.elements,"click",(e=>{t.elements.forEach((o=>o.classList[e.target===o?"add":"remove"](t.className))),t.onchange(e),e.stopPropagation()}));return{destroy:()=>s(...e)}}const S={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8,padding:0};class E{static utils=o;static version="1.9.0";static I18N_DEFAULTS={"ui:dialog":"color picker dialog","btn:toggle":"toggle color picker dialog","btn:swatch":"color swatch","btn:last-color":"use previous color","btn:save":"Save","btn:cancel":"Cancel","btn:clear":"Clear","aria:btn:save":"save and close","aria:btn:cancel":"cancel and close","aria:btn:clear":"clear and close","aria:input":"color input field","aria:palette":"color selection area","aria:hue":"hue selection slider","aria:opacity":"selection slider"};static DEFAULT_OPTIONS={appClass:null,theme:"classic",useAsButton:!1,padding:8,disabled:!1,comparison:!0,closeOnScroll:!1,outputPrecision:0,lockOpacity:!1,autoReposition:!0,container:"body",components:{interaction:{}},i18n:{},swatches:null,inline:!1,sliders:null,default:"#42445a",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"};_initializingActive=!0;_recalc=!0;_nanopop=null;_root=null;_color=A();_lastColor=A();_swatchColors=[];_setupAnimationFrame=null;_eventListener={init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]};constructor(t){this.options=t=Object.assign({...E.DEFAULT_OPTIONS},t);const{swatches:e,components:o,theme:n,sliders:i,lockOpacity:s,padding:r}=t;["nano","monolith"].includes(n)&&!i&&(t.sliders="h"),o.interaction||(o.interaction={});const{preview:a,opacity:l,hue:c,palette:p}=o;o.opacity=!s&&l,o.palette=p||a||l||c,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),e&&e.length&&e.forEach((t=>this.addSwatch(t)));const{button:u,app:h}=this._root;this._nanopop=((t,e,o)=>{const n="object"!=typeof t||t instanceof HTMLElement?{reference:t,popper:e,...o}:t;return{update(t=n){const{reference:e,popper:o}=Object.assign(n,t);if(!o||!e)throw new Error("Popper- or reference-element missing.");return((t,e,o)=>{const{container:n,arrow:i,margin:s,padding:r,position:a,variantFlipOrder:l,positionFlipOrder:c}={container:document.documentElement.getBoundingClientRect(),...S,...o},{left:p,top:u}=e.style;e.style.left="0",e.style.top="0";const h=t.getBoundingClientRect(),d=e.getBoundingClientRect(),m={t:h.top-d.height-s,b:h.bottom+s,r:h.right+s,l:h.left-d.width-s},f={vs:h.left,vm:h.left+h.width/2-d.width/2,ve:h.left+h.width-d.width,hs:h.top,hm:h.bottom-h.height/2-d.height/2,he:h.bottom-d.height},[v,b="middle"]=a.split("-"),y=c[v],g=l[b],{top:_,left:w,bottom:A,right:$}=n;for(const t of y){const o="t"===t||"b"===t;let n=m[t];const[s,a]=o?["top","left"]:["left","top"],[l,c]=o?[d.height,d.width]:[d.width,d.height],[p,u]=o?[A,$]:[$,A],[v,b]=o?[_,w]:[w,_];if(!(n<v||n+l+r>p))for(const p of g){let m=f[(o?"v":"h")+p];if(!(m<b||m+c+r>u)){if(m-=d[a],n-=d[s],e.style[a]=`${m}px`,e.style[s]=`${n}px`,i){const t=o?h.width/2:h.height/2,e=2*t<c?h[a]+t:m+c/2;n<h[s]&&(n+=l),i.style[a]=`${e}px`,i.style[s]=`${n}px`}return t+p}}}return e.style.left=p,e.style.top=u,null})(e,o,n)}}})(u,h,{margin:r}),u.setAttribute("role","button"),u.setAttribute("aria-label",this._t("btn:toggle"));const d=this;this._setupAnimationFrame=requestAnimationFrame((function e(){if(!h.offsetWidth)return requestAnimationFrame(e);d.setColor(t.default),d._rePositioningPicker(),t.defaultRepresentation&&(d._representation=t.defaultRepresentation,d.setColorRepresentation(d._representation)),t.showAlways&&d.show(),d._initializingActive=!1,d._emit("init")}))}static create=t=>new E(t);_preBuild(){const{options:t}=this;for(const e of["el","container"])t[e]=c(t[e]);this._root=(t=>{const{components:e,useAsButton:o,inline:n,appClass:i,theme:s,lockOpacity:r}=t.options,l=t=>t?"":'style="display:none" hidden',c=e=>t._t(e),p=a(`\n <div :ref="root" class="pickr">\n\n ${o?"":'<button type="button" :ref="button" class="pcr-button"></button>'}\n\n <div :ref="app" class="pcr-app ${i||""}" data-theme="${s}" ${n?'style="position: unset"':""} aria-label="${c("ui:dialog")}" role="window">\n <div class="pcr-selection" ${l(e.palette)}>\n <div :obj="preview" class="pcr-color-preview" ${l(e.preview)}>\n <button type="button" :ref="lastColor" class="pcr-last-color" aria-label="${c("btn:last-color")}"></button>\n <div :ref="currentColor" class="pcr-current-color"></div>\n </div>\n\n <div :obj="palette" class="pcr-color-palette">\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="palette" class="pcr-palette" tabindex="0" aria-label="${c("aria:palette")}" role="listbox"></div>\n </div>\n\n <div :obj="hue" class="pcr-color-chooser" ${l(e.hue)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-hue pcr-slider" tabindex="0" aria-label="${c("aria:hue")}" role="slider"></div>\n </div>\n\n <div :obj="opacity" class="pcr-color-opacity" ${l(e.opacity)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-opacity pcr-slider" tabindex="0" aria-label="${c("aria:opacity")}" role="slider"></div>\n </div>\n </div>\n\n <div class="pcr-swatches ${e.palette?"":"pcr-last"}" :ref="swatches"></div>\n\n <div :obj="interaction" class="pcr-interaction" ${l(Object.keys(e.interaction).length)}>\n <input :ref="result" class="pcr-result" type="text" spellcheck="false" ${l(e.interaction.input)} aria-label="${c("aria:input")}">\n\n <input :arr="options" class="pcr-type" data-type="HEXA" value="${r?"HEX":"HEXA"}" type="button" ${l(e.interaction.hex)}>\n <input :arr="options" class="pcr-type" data-type="RGBA" value="${r?"RGB":"RGBA"}" type="button" ${l(e.interaction.rgba)}>\n <input :arr="options" class="pcr-type" data-type="HSLA" value="${r?"HSL":"HSLA"}" type="button" ${l(e.interaction.hsla)}>\n <input :arr="options" class="pcr-type" data-type="HSVA" value="${r?"HSV":"HSVA"}" type="button" ${l(e.interaction.hsva)}>\n <input :arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ${l(e.interaction.cmyk)}>\n\n <input :ref="save" class="pcr-save" value="${c("btn:save")}" type="button" ${l(e.interaction.save)} aria-label="${c("aria:btn:save")}">\n <input :ref="cancel" class="pcr-cancel" value="${c("btn:cancel")}" type="button" ${l(e.interaction.cancel)} aria-label="${c("aria:btn:cancel")}">\n <input :ref="clear" class="pcr-clear" value="${c("btn:clear")}" type="button" ${l(e.interaction.clear)} aria-label="${c("aria:btn:clear")}">\n </div>\n </div>\n </div>\n `),u=p.interaction;return u.options.find((t=>!t.hidden&&!t.classList.add("active"))),u.type=()=>u.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root)}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app)}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide()}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[n,i]=o.match(/^[vh]+$/g)?o:[],s=()=>this._color||(this._color=this._lastColor.clone()),r={palette:C({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,n){if(!e.palette)return;const i=s(),{_root:r,options:a}=t,{lastColor:l,currentColor:c}=r.preview;t._recalc&&(i.s=100*o,i.v=100-100*n,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||l.style.setProperty("--pcr-color",p):(r.button.style.setProperty("--pcr-color",p),r.button.classList.remove("clear"));const u=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[u===o.toHEXA().toString()?"add":"remove"]("pcr-active");c.style.setProperty("--pcr-color",p)}}),hue:C({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const n=s();t._recalc&&(n.h=360*o),this.element.style.backgroundColor=`hsl(${n.h}, 100%, 50%)`,r.palette.trigger()}}),opacity:C({lock:"v"===n?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const n=s();t._recalc&&(n.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${n.a})`,r.palette.trigger()}}),selectable:k({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch")}})};this._components=r}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel")})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide()})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation()})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null)})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const n=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===n||t.code===n)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!l(e).some((e=>e===t.app||e===t.button))&&this.hide()}),{capture:!0}))}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,n)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[n],s=t+(e>=100?1e3*o:o);return s<=0?0:Number((s<e?s:e).toPrecision(3))}return t}))}if(e.autoReposition&&!e.inline){let t=null;const n=this;o.push(i(window,["scroll","resize"],(()=>{n.isOpen()&&(e.closeOnScroll&&n.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){n._rePositioningPicker(),null!==t&&requestAnimationFrame(e)}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)))}),{capture:!0}))}this._eventBindings=o}_rePositioningPicker(){const{options:t}=this;if(!t.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px"}}_updateOutput(t){const{_root:e,_color:o,options:n}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(n.outputPrecision):""}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this)}_clearColor(t=!1){const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"))}_parseLocalColor(t){const{values:e,type:o,a:n}=function(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return"#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)/i,rgba:/^rgba?\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D*?(([\d.]+)(%?)|$)/i,hsla:/^hsla?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hsva:/^hsva?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let n;t:for(const i in e)if(n=e[i].exec(t))switch(i){case"cmyk":{const[,t,e,s,r]=o(n);if(t>100||e>100||s>100||r>100)break t;return{values:y(t,e,s,r),type:i}}case"rgba":{let[,t,,e,,s,,,r]=o(n);if(t="%"===n[2]?t/100*255:t,e="%"===n[4]?e/100*255:e,s="%"===n[6]?s/100*255:s,r="%"===n[9]?r/100:r,t>255||e>255||s>255||r<0||r>1)break t;return{values:[...b(t,e,s),r],a:r,type:i}}case"hexa":{let[,t]=n;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[..._(e),o],a:o,type:i}}case"hsla":{let[,t,e,s,,r]=o(n);if(r="%"===n[6]?r/100:r,t>360||e>100||s>100||r<0||r>1)break t;return{values:[...g(t,e,s),r],a:r,type:i}}case"hsva":{let[,t,e,s,,r]=o(n);if(r="%"===n[6]?r/100:r,t>360||e>100||s>100||r<0||r>1)break t;return{values:[t,e,s,r],a:r,type:i}}}return{values:null,type:null}}(t),{lockOpacity:i}=this.options,s=void 0!==n&&1!==n;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&s?null:e,type:o}}_t(t){return this.options.i18n[t]||E.I18N_DEFAULTS[t]}_emit(t,...e){this._eventListener[t].forEach((t=>t(...e,this)))}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],n=o.indexOf(e);return~n&&o.splice(n,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,n=A(...e),s=r(`<button type="button" style="--pcr-color: ${n.toRGBA().toString(0)}" aria-label="${this._t("btn:swatch")}"/>`);return o.swatches.appendChild(s),t.push({el:s,color:n}),this._eventBindings.push(i(s,"click",(()=>{this.setHSVA(...n.toHSVA(),!0),this._emit("swatchselect",n),this._emit("change",n,"swatch",this)}))),!0}return!1}removeSwatch(t){const e=this._swatchColors[t];if(e){const{el:o}=e;return this._root.swatches.removeChild(o),this._swatchColors.splice(t,1),!0}return!1}applyColor(t=!1){const{preview:e,button:o}=this._root,n=this._color.toRGBA().toString(0);return e.lastColor.style.setProperty("--pcr-color",n),this.options.useAsButton||o.style.setProperty("--pcr-color",n),o.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this._emit("save",this._color),this}destroy(){cancelAnimationFrame(this._setupAnimationFrame),this._eventBindings.forEach((t=>s(...t))),Object.keys(this._components).forEach((t=>this._components[t].destroy()))}destroyAndRemove(){this.destroy();const{root:t,app:e}=this._root;t.parentElement&&t.parentElement.removeChild(t),e.parentElement.removeChild(e),Object.keys(this).forEach((t=>this[t]=null))}hide(){return!!this.isOpen()&&(this._root.app.classList.remove("visible"),this._emit("hide"),!0)}show(){return!this.options.disabled&&!this.isOpen()&&(this._root.app.classList.add("visible"),this._rePositioningPicker(),this._emit("show",this._color),this)}isOpen(){return this._root.app.classList.contains("visible")}setHSVA(t=360,e=0,o=0,n=1,i=!1){const s=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||o<0||o>100||n<0||n>1)return!1;this._color=A(t,e,o,n);const{hue:r,opacity:a,palette:l}=this._components;return r.update(t/360),a.update(n),l.update(e/100,1-o/100),i||this.applyColor(),s&&this._updateOutput(),this._recalc=s,!0}setColor(t,e=!1){if(null===t)return this._clearColor(e),!0;const{values:o,type:n}=this._parseLocalColor(t);if(o){const t=n.toUpperCase(),{options:i}=this._root.interaction,s=i.find((e=>e.getAttribute("data-type")===t));if(s&&!s.hidden)for(const t of i)t.classList[t===s?"add":"remove"]("active");return!!this.setHSVA(...o,e)&&this.setColorRepresentation(t)}return!1}setColorRepresentation(t){return t=t.toUpperCase(),!!this._root.interaction.options.find((e=>e.getAttribute("data-type").startsWith(t)&&!e.click()))}getColorRepresentation(){return this._representation}getColor(){return this._color}getSelectedColor(){return this._lastColor}getRoot(){return this._root}disable(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}enable(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}return e.default})())(),pickr_min$1=_mergeNamespaces({__proto__:null,default:viewport.getDefaultExportFromCjs(pickr_minExports)},[pickr_minExports]);exports.pickr_min=pickr_min$1;
|
|
5
|
+
"use strict";var viewport=require("./chunk-viewport.js");function _mergeNamespaces(n,m){return m.forEach((function(e){e&&"string"!=typeof e&&!Array.isArray(e)&&Object.keys(e).forEach((function(k){if("default"!==k&&!(k in n)){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:!0,get:function(){return e[k]}})}}))})),Object.freeze(n)}var pickr_min$2={exports:{}};self;var pickr_minExports=pickr_min$2.exports=(()=>(()=>{var t={d:(e,o)=>{for(var n in o)t.o(o,n)&&!t.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:o[n]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e),r:t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})}},e={};t.d(e,{default:()=>E});var o={};function n(t,e,o,n,i={}){e instanceof HTMLCollection||e instanceof NodeList?e=Array.from(e):Array.isArray(e)||(e=[e]),Array.isArray(o)||(o=[o]);for(const s of e)for(const e of o)s[t](e,n,{capture:!1,...i});return Array.prototype.slice.call(arguments,1)}t.r(o),t.d(o,{adjustableInputNumbers:()=>p,createElementFromString:()=>r,createFromTemplate:()=>a,eventPath:()=>l,off:()=>s,on:()=>i,resolveElement:()=>c});const i=n.bind(null,"addEventListener"),s=n.bind(null,"removeEventListener");function r(t){const e=document.createElement("div");return e.innerHTML=t.trim(),e.firstElementChild}function a(t){const e=(t,e)=>{const o=t.getAttribute(e);return t.removeAttribute(e),o},o=(t,n={})=>{const i=e(t,":obj"),s=e(t,":ref"),r=i?n[i]={}:n;s&&(n[s]=t);for(const n of Array.from(t.children)){const t=e(n,":arr"),i=o(n,t?{}:r);t&&(r[t]||(r[t]=[])).push(Object.keys(i).length?i:n)}return n};return o(r(t))}function l(t){let e=t.path||t.composedPath&&t.composedPath();if(e)return e;let o=t.target.parentElement;for(e=[t.target,o];o=o.parentElement;)e.push(o);return e.push(document,window),e}function c(t){return t instanceof Element?t:"string"==typeof t?t.split(/>>/g).reduce(((t,e,o,n)=>(t=t.querySelector(e),o<n.length-1?t.shadowRoot:t)),document):null}function p(t,e=(t=>t)){function o(o){const n=[.001,.01,.1][Number(o.shiftKey||2*o.ctrlKey)]*(o.deltaY<0?1:-1);let i=0,s=t.selectionStart;t.value=t.value.replace(/[\d.]+/g,((t,o)=>o<=s&&o+t.length>=s?(s=o,e(Number(t),n,i)):(i++,t))),t.focus(),t.setSelectionRange(s,s),o.preventDefault(),t.dispatchEvent(new Event("input"))}i(t,"focus",(()=>i(window,"wheel",o,{passive:!1}))),i(t,"blur",(()=>s(window,"wheel",o)))}const{min:u,max:h,floor:d,round:m}=Math;function f(t,e,o){e/=100,o/=100;const n=d(t=t/360*6),i=t-n,s=o*(1-e),r=o*(1-i*e),a=o*(1-(1-i)*e),l=n%6;return[255*[o,r,s,s,a,o][l],255*[a,o,o,r,s,s][l],255*[s,s,a,o,o,r][l]]}function v(t,e,o){const n=(2-(e/=100))*(o/=100)/2;return 0!==n&&(e=1===n?0:n<.5?e*o/(2*n):e*o/(2-2*n)),[t,100*e,100*n]}function b(t,e,o){const n=u(t/=255,e/=255,o/=255),i=h(t,e,o),s=i-n;let r,a;if(0===s)r=a=0;else{a=s/i;const n=((i-t)/6+s/2)/s,l=((i-e)/6+s/2)/s,c=((i-o)/6+s/2)/s;t===i?r=c-l:e===i?r=1/3+n-c:o===i&&(r=2/3+l-n),r<0?r+=1:r>1&&(r-=1)}return[360*r,100*a,100*i]}function y(t,e,o,n){return e/=100,o/=100,[...b(255*(1-u(1,(t/=100)*(1-(n/=100))+n)),255*(1-u(1,e*(1-n)+n)),255*(1-u(1,o*(1-n)+n)))]}function g(t,e,o){e/=100;const n=2*(e*=(o/=100)<.5?o:1-o)/(o+e)*100,i=100*(o+e);return[t,isNaN(n)?0:n,i]}function _(t){return b(...t.match(/.{2}/g).map((t=>parseInt(t,16))))}function A(t=0,e=0,o=0,n=1){const i=(t,e)=>(o=-1)=>e(~o?t.map((t=>Number(t.toFixed(o)))):t),s={h:t,s:e,v:o,a:n,toHSVA(){const t=[s.h,s.s,s.v,s.a];return t.toString=i(t,(t=>`hsva(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toHSLA(){const t=[...v(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`hsla(${t[0]}, ${t[1]}%, ${t[2]}%, ${s.a})`)),t},toRGBA(){const t=[...f(s.h,s.s,s.v),s.a];return t.toString=i(t,(t=>`rgba(${t[0]}, ${t[1]}, ${t[2]}, ${s.a})`)),t},toCMYK(){const t=function(t,e,o){const n=f(t,e,o),i=n[0]/255,s=n[1]/255,r=n[2]/255,a=u(1-i,1-s,1-r);return[100*(1===a?0:(1-i-a)/(1-a)),100*(1===a?0:(1-s-a)/(1-a)),100*(1===a?0:(1-r-a)/(1-a)),100*a]}(s.h,s.s,s.v);return t.toString=i(t,(t=>`cmyk(${t[0]}%, ${t[1]}%, ${t[2]}%, ${t[3]}%)`)),t},toHEXA(){const t=function(t,e,o){return f(t,e,o).map((t=>m(t).toString(16).padStart(2,"0")))}(s.h,s.s,s.v),e=s.a>=1?"":Number((255*s.a).toFixed(0)).toString(16).toUpperCase().padStart(2,"0");return e&&t.push(e),t.toString=()=>`#${t.join("").toUpperCase()}`,t},clone:()=>A(s.h,s.s,s.v,s.a)};return s}const $=t=>Math.max(Math.min(t,1),0);function C(t){const e={options:Object.assign({lock:null,onchange:()=>0,onstop:()=>0},t),_keyboard(t){const{options:o}=e,{type:n,key:i}=t;if(document.activeElement===o.wrapper){const{lock:o}=e.options,s="ArrowUp"===i,r="ArrowRight"===i,a="ArrowDown"===i,l="ArrowLeft"===i;if("keydown"===n&&(s||r||a||l)){let n=0,i=0;"v"===o?n=s||r?1:-1:"h"===o?n=s||r?-1:1:(i=s?-1:a?1:0,n=l?-1:r?1:0),e.update($(e.cache.x+.01*n),$(e.cache.y+.01*i)),t.preventDefault()}else i.startsWith("Arrow")&&(e.options.onstop(),t.preventDefault())}},_tapstart(t){i(document,["mouseup","touchend","touchcancel"],e._tapstop),i(document,["mousemove","touchmove"],e._tapmove),t.cancelable&&t.preventDefault(),e._tapmove(t)},_tapmove(t){const{options:o,cache:n}=e,{lock:i,element:s,wrapper:r}=o,a=r.getBoundingClientRect();let l=0,c=0;if(t){const e=t&&t.touches&&t.touches[0];l=t?(e||t).clientX:0,c=t?(e||t).clientY:0,l<a.left?l=a.left:l>a.left+a.width&&(l=a.left+a.width),c<a.top?c=a.top:c>a.top+a.height&&(c=a.top+a.height),l-=a.left,c-=a.top}else n&&(l=n.x*a.width,c=n.y*a.height);"h"!==i&&(s.style.left=`calc(${l/a.width*100}% - ${s.offsetWidth/2}px)`),"v"!==i&&(s.style.top=`calc(${c/a.height*100}% - ${s.offsetHeight/2}px)`),e.cache={x:l/a.width,y:c/a.height};const p=$(l/a.width),u=$(c/a.height);switch(i){case"v":return o.onchange(p);case"h":return o.onchange(u);default:return o.onchange(p,u)}},_tapstop(){e.options.onstop(),s(document,["mouseup","touchend","touchcancel"],e._tapstop),s(document,["mousemove","touchmove"],e._tapmove)},trigger(){e._tapmove()},update(t=0,o=0){const{left:n,top:i,width:s,height:r}=e.options.wrapper.getBoundingClientRect();"h"===e.options.lock&&(o=t),e._tapmove({clientX:n+s*t,clientY:i+r*o})},destroy(){const{options:t,_tapstart:o,_keyboard:n}=e;s(document,["keydown","keyup"],n),s([t.wrapper,t.element],"mousedown",o),s([t.wrapper,t.element],"touchstart",o,{passive:!1})}},{options:o,_tapstart:n,_keyboard:r}=e;return i([o.wrapper,o.element],"mousedown",n),i([o.wrapper,o.element],"touchstart",n,{passive:!1}),i(document,["keydown","keyup"],r),e}function k(t={}){t=Object.assign({onchange:()=>0,className:"",elements:[]},t);const e=i(t.elements,"click",(e=>{t.elements.forEach((o=>o.classList[e.target===o?"add":"remove"](t.className))),t.onchange(e),e.stopPropagation()}));return{destroy:()=>s(...e)}}const S={variantFlipOrder:{start:"sme",middle:"mse",end:"ems"},positionFlipOrder:{top:"tbrl",right:"rltb",bottom:"btrl",left:"lrbt"},position:"bottom",margin:8,padding:0};class E{static utils=o;static version="1.9.1";static I18N_DEFAULTS={"ui:dialog":"color picker dialog","btn:toggle":"toggle color picker dialog","btn:swatch":"color swatch","btn:last-color":"use previous color","btn:save":"Save","btn:cancel":"Cancel","btn:clear":"Clear","aria:btn:save":"save and close","aria:btn:cancel":"cancel and close","aria:btn:clear":"clear and close","aria:input":"color input field","aria:palette":"color selection area","aria:hue":"hue selection slider","aria:opacity":"selection slider"};static DEFAULT_OPTIONS={appClass:null,theme:"classic",useAsButton:!1,padding:8,disabled:!1,comparison:!0,closeOnScroll:!1,outputPrecision:0,lockOpacity:!1,autoReposition:!0,container:"body",components:{interaction:{}},i18n:{},swatches:null,inline:!1,sliders:null,default:"#42445a",defaultRepresentation:null,position:"bottom-middle",adjustableNumbers:!0,showAlways:!1,closeWithKey:"Escape"};_initializingActive=!0;_recalc=!0;_nanopop=null;_root=null;_color=A();_lastColor=A();_swatchColors=[];_setupAnimationFrame=null;_eventListener={init:[],save:[],hide:[],show:[],clear:[],change:[],changestop:[],cancel:[],swatchselect:[]};constructor(t){this.options=t=Object.assign({...E.DEFAULT_OPTIONS},t);const{swatches:e,components:o,theme:n,sliders:i,lockOpacity:s,padding:r}=t;["nano","monolith"].includes(n)&&!i&&(t.sliders="h"),o.interaction||(o.interaction={});const{preview:a,opacity:l,hue:c,palette:p}=o;o.opacity=!s&&l,o.palette=p||a||l||c,this._preBuild(),this._buildComponents(),this._bindEvents(),this._finalBuild(),e&&e.length&&e.forEach((t=>this.addSwatch(t)));const{button:u,app:h}=this._root;this._nanopop=((t,e,o)=>{const n="object"!=typeof t||t instanceof HTMLElement?{reference:t,popper:e,...o}:t;return{update(t=n){const{reference:e,popper:o}=Object.assign(n,t);if(!o||!e)throw new Error("Popper- or reference-element missing.");return((t,e,o)=>{const{container:n,arrow:i,margin:s,padding:r,position:a,variantFlipOrder:l,positionFlipOrder:c}={container:document.documentElement.getBoundingClientRect(),...S,...o},{left:p,top:u}=e.style;e.style.left="0",e.style.top="0";const h=t.getBoundingClientRect(),d=e.getBoundingClientRect(),m={t:h.top-d.height-s,b:h.bottom+s,r:h.right+s,l:h.left-d.width-s},f={vs:h.left,vm:h.left+h.width/2-d.width/2,ve:h.left+h.width-d.width,hs:h.top,hm:h.bottom-h.height/2-d.height/2,he:h.bottom-d.height},[v,b="middle"]=a.split("-"),y=c[v],g=l[b],{top:_,left:w,bottom:A,right:$}=n;for(const t of y){const o="t"===t||"b"===t;let n=m[t];const[s,a]=o?["top","left"]:["left","top"],[l,c]=o?[d.height,d.width]:[d.width,d.height],[p,u]=o?[A,$]:[$,A],[v,b]=o?[_,w]:[w,_];if(!(n<v||n+l+r>p))for(const p of g){let m=f[(o?"v":"h")+p];if(!(m<b||m+c+r>u)){if(m-=d[a],n-=d[s],e.style[a]=`${m}px`,e.style[s]=`${n}px`,i){const e=o?h.width/2:h.height/2,r=c/2,u=e>r,d=m+{s:u?r:e,m:r,e:u?r:c-e}[p],f=n+{t:l,b:0,r:0,l:l}[t];i.style[a]=`${d}px`,i.style[s]=`${f}px`}return t+p}}}return e.style.left=p,e.style.top=u,null})(e,o,n)}}})(u,h,{margin:r}),u.setAttribute("role","button"),u.setAttribute("aria-label",this._t("btn:toggle"));const d=this;this._setupAnimationFrame=requestAnimationFrame((function e(){if(!h.offsetWidth)return requestAnimationFrame(e);d.setColor(t.default),d._rePositioningPicker(),t.defaultRepresentation&&(d._representation=t.defaultRepresentation,d.setColorRepresentation(d._representation)),t.showAlways&&d.show(),d._initializingActive=!1,d._emit("init")}))}static create=t=>new E(t);_preBuild(){const{options:t}=this;for(const e of["el","container"])t[e]=c(t[e]);this._root=(t=>{const{components:e,useAsButton:o,inline:n,appClass:i,theme:s,lockOpacity:r}=t.options,l=t=>t?"":'style="display:none" hidden',c=e=>t._t(e),p=a(`\n <div :ref="root" class="pickr">\n\n ${o?"":'<button type="button" :ref="button" class="pcr-button"></button>'}\n\n <div :ref="app" class="pcr-app ${i||""}" data-theme="${s}" ${n?'style="position: unset"':""} aria-label="${c("ui:dialog")}" role="window">\n <div class="pcr-selection" ${l(e.palette)}>\n <div :obj="preview" class="pcr-color-preview" ${l(e.preview)}>\n <button type="button" :ref="lastColor" class="pcr-last-color" aria-label="${c("btn:last-color")}"></button>\n <div :ref="currentColor" class="pcr-current-color"></div>\n </div>\n\n <div :obj="palette" class="pcr-color-palette">\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="palette" class="pcr-palette" tabindex="0" aria-label="${c("aria:palette")}" role="listbox"></div>\n </div>\n\n <div :obj="hue" class="pcr-color-chooser" ${l(e.hue)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-hue pcr-slider" tabindex="0" aria-label="${c("aria:hue")}" role="slider"></div>\n </div>\n\n <div :obj="opacity" class="pcr-color-opacity" ${l(e.opacity)}>\n <div :ref="picker" class="pcr-picker"></div>\n <div :ref="slider" class="pcr-opacity pcr-slider" tabindex="0" aria-label="${c("aria:opacity")}" role="slider"></div>\n </div>\n </div>\n\n <div class="pcr-swatches ${e.palette?"":"pcr-last"}" :ref="swatches"></div>\n\n <div :obj="interaction" class="pcr-interaction" ${l(Object.keys(e.interaction).length)}>\n <input :ref="result" class="pcr-result" type="text" spellcheck="false" ${l(e.interaction.input)} aria-label="${c("aria:input")}">\n\n <input :arr="options" class="pcr-type" data-type="HEXA" value="${r?"HEX":"HEXA"}" type="button" ${l(e.interaction.hex)}>\n <input :arr="options" class="pcr-type" data-type="RGBA" value="${r?"RGB":"RGBA"}" type="button" ${l(e.interaction.rgba)}>\n <input :arr="options" class="pcr-type" data-type="HSLA" value="${r?"HSL":"HSLA"}" type="button" ${l(e.interaction.hsla)}>\n <input :arr="options" class="pcr-type" data-type="HSVA" value="${r?"HSV":"HSVA"}" type="button" ${l(e.interaction.hsva)}>\n <input :arr="options" class="pcr-type" data-type="CMYK" value="CMYK" type="button" ${l(e.interaction.cmyk)}>\n\n <input :ref="save" class="pcr-save" value="${c("btn:save")}" type="button" ${l(e.interaction.save)} aria-label="${c("aria:btn:save")}">\n <input :ref="cancel" class="pcr-cancel" value="${c("btn:cancel")}" type="button" ${l(e.interaction.cancel)} aria-label="${c("aria:btn:cancel")}">\n <input :ref="clear" class="pcr-clear" value="${c("btn:clear")}" type="button" ${l(e.interaction.clear)} aria-label="${c("aria:btn:clear")}">\n </div>\n </div>\n </div>\n `),u=p.interaction;return u.options.find((t=>!t.hidden&&!t.classList.add("active"))),u.type=()=>u.options.find((t=>t.classList.contains("active"))),p})(this),t.useAsButton&&(this._root.button=t.el),t.container.appendChild(this._root.root)}_finalBuild(){const t=this.options,e=this._root;if(t.container.removeChild(e.root),t.inline){const o=t.el.parentElement;t.el.nextSibling?o.insertBefore(e.app,t.el.nextSibling):o.appendChild(e.app)}else t.container.appendChild(e.app);t.useAsButton?t.inline&&t.el.remove():t.el.parentNode.replaceChild(e.root,t.el),t.disabled&&this.disable(),t.comparison||(e.button.style.transition="none",t.useAsButton||(e.preview.lastColor.style.transition="none")),this.hide()}_buildComponents(){const t=this,e=this.options.components,o=(t.options.sliders||"v").repeat(2),[n,i]=o.match(/^[vh]+$/g)?o:[],s=()=>this._color||(this._color=this._lastColor.clone()),r={palette:C({element:t._root.palette.picker,wrapper:t._root.palette.palette,onstop:()=>t._emit("changestop","slider",t),onchange(o,n){if(!e.palette)return;const i=s(),{_root:r,options:a}=t,{lastColor:l,currentColor:c}=r.preview;t._recalc&&(i.s=100*o,i.v=100-100*n,i.v<0&&(i.v=0),t._updateOutput("slider"));const p=i.toRGBA().toString(0);this.element.style.background=p,this.wrapper.style.background=`\n linear-gradient(to top, rgba(0, 0, 0, ${i.a}), transparent),\n linear-gradient(to left, hsla(${i.h}, 100%, 50%, ${i.a}), rgba(255, 255, 255, ${i.a}))\n `,a.comparison?a.useAsButton||t._lastColor||l.style.setProperty("--pcr-color",p):(r.button.style.setProperty("--pcr-color",p),r.button.classList.remove("clear"));const u=i.toHEXA().toString();for(const{el:e,color:o}of t._swatchColors)e.classList[u===o.toHEXA().toString()?"add":"remove"]("pcr-active");c.style.setProperty("--pcr-color",p)}}),hue:C({lock:"v"===i?"h":"v",element:t._root.hue.picker,wrapper:t._root.hue.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.hue||!e.palette)return;const n=s();t._recalc&&(n.h=360*o),this.element.style.backgroundColor=`hsl(${n.h}, 100%, 50%)`,r.palette.trigger()}}),opacity:C({lock:"v"===n?"h":"v",element:t._root.opacity.picker,wrapper:t._root.opacity.slider,onstop:()=>t._emit("changestop","slider",t),onchange(o){if(!e.opacity||!e.palette)return;const n=s();t._recalc&&(n.a=Math.round(100*o)/100),this.element.style.background=`rgba(0, 0, 0, ${n.a})`,r.palette.trigger()}}),selectable:k({elements:t._root.interaction.options,className:"active",onchange(e){t._representation=e.target.getAttribute("data-type").toUpperCase(),t._recalc&&t._updateOutput("swatch")}})};this._components=r}_bindEvents(){const{_root:t,options:e}=this,o=[i(t.interaction.clear,"click",(()=>this._clearColor())),i([t.interaction.cancel,t.preview.lastColor],"click",(()=>{this.setHSVA(...(this._lastColor||this._color).toHSVA(),!0),this._emit("cancel")})),i(t.interaction.save,"click",(()=>{!this.applyColor()&&!e.showAlways&&this.hide()})),i(t.interaction.result,["keyup","input"],(t=>{this.setColor(t.target.value,!0)&&!this._initializingActive&&(this._emit("change",this._color,"input",this),this._emit("changestop","input",this)),t.stopImmediatePropagation()})),i(t.interaction.result,["focus","blur"],(t=>{this._recalc="blur"===t.type,this._recalc&&this._updateOutput(null)})),i([t.palette.palette,t.palette.picker,t.hue.slider,t.hue.picker,t.opacity.slider,t.opacity.picker],["mousedown","touchstart"],(()=>this._recalc=!0),{passive:!0})];if(!e.showAlways){const n=e.closeWithKey;o.push(i(t.button,"click",(()=>this.isOpen()?this.hide():this.show())),i(document,"keyup",(t=>this.isOpen()&&(t.key===n||t.code===n)&&this.hide())),i(document,["touchstart","mousedown"],(e=>{this.isOpen()&&!l(e).some((e=>e===t.app||e===t.button))&&this.hide()}),{capture:!0}))}if(e.adjustableNumbers){const e={rgba:[255,255,255,1],hsva:[360,100,100,1],hsla:[360,100,100,1],cmyk:[100,100,100,100]};p(t.interaction.result,((t,o,n)=>{const i=e[this.getColorRepresentation().toLowerCase()];if(i){const e=i[n],s=t+(e>=100?1e3*o:o);return s<=0?0:Number((s<e?s:e).toPrecision(3))}return t}))}if(e.autoReposition&&!e.inline){let t=null;const n=this;o.push(i(window,["scroll","resize"],(()=>{n.isOpen()&&(e.closeOnScroll&&n.hide(),null===t?(t=setTimeout((()=>t=null),100),requestAnimationFrame((function e(){n._rePositioningPicker(),null!==t&&requestAnimationFrame(e)}))):(clearTimeout(t),t=setTimeout((()=>t=null),100)))}),{capture:!0}))}this._eventBindings=o}_rePositioningPicker(){const{options:t}=this;if(!t.inline&&!this._nanopop.update({container:document.body.getBoundingClientRect(),position:t.position})){const t=this._root.app,e=t.getBoundingClientRect();t.style.top=(window.innerHeight-e.height)/2+"px",t.style.left=(window.innerWidth-e.width)/2+"px"}}_updateOutput(t){const{_root:e,_color:o,options:n}=this;if(e.interaction.type()){const t=`to${e.interaction.type().getAttribute("data-type")}`;e.interaction.result.value="function"==typeof o[t]?o[t]().toString(n.outputPrecision):""}!this._initializingActive&&this._recalc&&this._emit("change",o,t,this)}_clearColor(t=!1){const{_root:e,options:o}=this;o.useAsButton||e.button.style.setProperty("--pcr-color","rgba(0, 0, 0, 0.15)"),e.button.classList.add("clear"),o.showAlways||this.hide(),this._lastColor=null,this._initializingActive||t||(this._emit("save",null),this._emit("clear"))}_parseLocalColor(t){const{values:e,type:o,a:n}=function(t){t=t.match(/^[a-zA-Z]+$/)?function(t){if("black"===t.toLowerCase())return"#000";const e=document.createElement("canvas").getContext("2d");return e.fillStyle=t,"#000"===e.fillStyle?null:e.fillStyle}(t):t;const e={cmyk:/^cmyk\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)/i,rgba:/^rgba?\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D+([\d.]+)(%?)\D*?(([\d.]+)(%?)|$)/i,hsla:/^hsla?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hsva:/^hsva?\D+([\d.]+)\D+([\d.]+)\D+([\d.]+)\D*?(([\d.]+)(%?)|$)/i,hexa:/^#?(([\dA-Fa-f]{3,4})|([\dA-Fa-f]{6})|([\dA-Fa-f]{8}))$/i},o=t=>t.map((t=>/^(|\d+)\.\d+|\d+$/.test(t)?Number(t):void 0));let n;t:for(const i in e)if(n=e[i].exec(t))switch(i){case"cmyk":{const[,t,e,s,r]=o(n);if(t>100||e>100||s>100||r>100)break t;return{values:y(t,e,s,r),type:i}}case"rgba":{let[,t,,e,,s,,,r]=o(n);if(t="%"===n[2]?t/100*255:t,e="%"===n[4]?e/100*255:e,s="%"===n[6]?s/100*255:s,r="%"===n[9]?r/100:r,t>255||e>255||s>255||r<0||r>1)break t;return{values:[...b(t,e,s),r],a:r,type:i}}case"hexa":{let[,t]=n;4!==t.length&&3!==t.length||(t=t.split("").map((t=>t+t)).join(""));const e=t.substring(0,6);let o=t.substring(6);return o=o?parseInt(o,16)/255:void 0,{values:[..._(e),o],a:o,type:i}}case"hsla":{let[,t,e,s,,r]=o(n);if(r="%"===n[6]?r/100:r,t>360||e>100||s>100||r<0||r>1)break t;return{values:[...g(t,e,s),r],a:r,type:i}}case"hsva":{let[,t,e,s,,r]=o(n);if(r="%"===n[6]?r/100:r,t>360||e>100||s>100||r<0||r>1)break t;return{values:[t,e,s,r],a:r,type:i}}}return{values:null,type:null}}(t),{lockOpacity:i}=this.options,s=void 0!==n&&1!==n;return e&&3===e.length&&(e[3]=void 0),{values:!e||i&&s?null:e,type:o}}_t(t){return this.options.i18n[t]||E.I18N_DEFAULTS[t]}_emit(t,...e){this._eventListener[t].forEach((t=>t(...e,this)))}on(t,e){return this._eventListener[t].push(e),this}off(t,e){const o=this._eventListener[t]||[],n=o.indexOf(e);return~n&&o.splice(n,1),this}addSwatch(t){const{values:e}=this._parseLocalColor(t);if(e){const{_swatchColors:t,_root:o}=this,n=A(...e),s=r(`<button type="button" style="--pcr-color: ${n.toRGBA().toString(0)}" aria-label="${this._t("btn:swatch")}"/>`);return o.swatches.appendChild(s),t.push({el:s,color:n}),this._eventBindings.push(i(s,"click",(()=>{this.setHSVA(...n.toHSVA(),!0),this._emit("swatchselect",n),this._emit("change",n,"swatch",this)}))),!0}return!1}removeSwatch(t){const e=this._swatchColors[t];if(e){const{el:o}=e;return this._root.swatches.removeChild(o),this._swatchColors.splice(t,1),!0}return!1}applyColor(t=!1){const{preview:e,button:o}=this._root,n=this._color.toRGBA().toString(0);return e.lastColor.style.setProperty("--pcr-color",n),this.options.useAsButton||o.style.setProperty("--pcr-color",n),o.classList.remove("clear"),this._lastColor=this._color.clone(),this._initializingActive||t||this._emit("save",this._color),this}destroy(){cancelAnimationFrame(this._setupAnimationFrame),this._eventBindings.forEach((t=>s(...t))),Object.keys(this._components).forEach((t=>this._components[t].destroy()))}destroyAndRemove(){this.destroy();const{root:t,app:e}=this._root;t.parentElement&&t.parentElement.removeChild(t),e.parentElement.removeChild(e),Object.keys(this).forEach((t=>this[t]=null))}hide(){return!!this.isOpen()&&(this._root.app.classList.remove("visible"),this._emit("hide"),!0)}show(){return!this.options.disabled&&!this.isOpen()&&(this._root.app.classList.add("visible"),this._rePositioningPicker(),this._emit("show",this._color),this)}isOpen(){return this._root.app.classList.contains("visible")}setHSVA(t=360,e=0,o=0,n=1,i=!1){const s=this._recalc;if(this._recalc=!1,t<0||t>360||e<0||e>100||o<0||o>100||n<0||n>1)return!1;this._color=A(t,e,o,n);const{hue:r,opacity:a,palette:l}=this._components;return r.update(t/360),a.update(n),l.update(e/100,1-o/100),i||this.applyColor(),s&&this._updateOutput(),this._recalc=s,!0}setColor(t,e=!1){if(null===t)return this._clearColor(e),!0;const{values:o,type:n}=this._parseLocalColor(t);if(o){const t=n.toUpperCase(),{options:i}=this._root.interaction,s=i.find((e=>e.getAttribute("data-type")===t));if(s&&!s.hidden)for(const t of i)t.classList[t===s?"add":"remove"]("active");return!!this.setHSVA(...o,e)&&this.setColorRepresentation(t)}return!1}setColorRepresentation(t){return t=t.toUpperCase(),!!this._root.interaction.options.find((e=>e.getAttribute("data-type").startsWith(t)&&!e.click()))}getColorRepresentation(){return this._representation}getColor(){return this._color}getSelectedColor(){return this._lastColor}getRoot(){return this._root}disable(){return this.hide(),this.options.disabled=!0,this._root.button.classList.add("disabled"),this}enable(){return this.options.disabled=!1,this._root.button.classList.remove("disabled"),this}}return e.default})())(),pickr_min$1=_mergeNamespaces({__proto__:null,default:viewport.getDefaultExportFromCjs(pickr_minExports)},[pickr_minExports]);exports.pickr_min=pickr_min$1;
|