ui_bibz 3.0.13 → 4.0.0.beta4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +3 -3
- data/.github/workflows/linter.yml +13 -12
- data/.overcommit.yml +6 -0
- data/.rubocop.yml +6 -0
- data/.ruby-version +1 -1
- data/Gemfile +19 -12
- data/Gemfile.lock +219 -148
- data/app/assets/config/ui_bibz.js +14 -0
- data/app/assets/javascripts/controllers/combobox_controller.js +37 -0
- data/app/assets/javascripts/forms/formula.js +82 -0
- data/app/assets/javascripts/forms/input-connected.js +132 -0
- data/app/assets/javascripts/forms/jquery.multi-select-extend.js +52 -0
- data/app/assets/javascripts/forms.js +160 -0
- data/app/assets/javascripts/interfaces.js +56 -0
- data/app/assets/javascripts/tables.js +49 -0
- data/app/assets/javascripts/ui_bibz_js.js +37 -0
- data/app/assets/stylesheets/navigations/_nav.sass +2 -0
- data/app/assets/stylesheets/navigations/_navbar.sass +12 -0
- data/app/assets/stylesheets/navigations/_progress_bar.sass +2 -0
- data/app/assets/stylesheets/navigations/_toolbar.sass +3 -0
- data/app/assets/stylesheets/sass/_boxes.sass +1 -0
- data/app/assets/stylesheets/sass/_containers.sass +2 -0
- data/app/assets/stylesheets/sass/_fixes.sass +2 -0
- data/app/assets/stylesheets/sass/_forms.sass +9 -0
- data/app/assets/stylesheets/sass/_navigations.sass +4 -0
- data/app/assets/stylesheets/sass/_notifications.sass +4 -0
- data/app/assets/stylesheets/sass/_tables.sass +2 -0
- data/app/assets/stylesheets/sass/_variables_mixins_functions.sass +3 -0
- data/app/assets/stylesheets/sass/boxes/_card.sass +4 -0
- data/app/assets/stylesheets/sass/containers/_panel.scss +330 -0
- data/app/assets/stylesheets/sass/forms/_bootstrap_select.sass +5 -0
- data/app/assets/stylesheets/sass/forms/_button.sass +3 -0
- data/app/assets/stylesheets/sass/forms/_combobox.sass +32 -0
- data/app/assets/stylesheets/sass/forms/_date_picker.sass +3 -0
- data/app/assets/stylesheets/sass/forms/_form_check.sass +10 -0
- data/app/assets/stylesheets/sass/forms/_formula_field.sass +17 -0
- data/app/assets/stylesheets/sass/forms/_multiselect.sass +44 -0
- data/app/assets/stylesheets/sass/forms/_range.sass +44 -0
- data/app/assets/stylesheets/sass/forms/_slider.sass +136 -0
- data/app/assets/stylesheets/sass/forms/_surround_field.sass +25 -0
- data/app/assets/stylesheets/sass/notifications/_badge.sass +5 -0
- data/app/assets/stylesheets/sass/notifications/_glyph.sass +3 -0
- data/app/assets/stylesheets/sass/notifications/_star.sass +2 -0
- data/app/assets/stylesheets/sass/notifications/_toast.sass +3 -0
- data/app/assets/stylesheets/sass/tables/_table.sass +39 -0
- data/app/assets/stylesheets/sass/tables/_table_card.sass +39 -0
- data/app/assets/stylesheets/ui_bibz.sass +26 -0
- data/bin/test +3 -5
- data/config/importmap.rb +21 -0
- data/config/initializers/assets.rb +5 -0
- data/config/initializers/will_paginate.rb +1 -3
- data/lib/ui_bibz/builders/data_html_options_builder.rb +118 -0
- data/lib/ui_bibz/builders/html_classes_builder.rb +89 -0
- data/lib/ui_bibz/builders/html_options_builder.rb +22 -0
- data/lib/ui_bibz/factory_methods/component_initialize_factory_method.rb +33 -0
- data/lib/ui_bibz/helpers/ui/core/boxes_helper.rb +12 -12
- data/lib/ui_bibz/helpers/ui/core/forms_helper.rb +58 -50
- data/lib/ui_bibz/helpers/ui/core/icons_helper.rb +6 -6
- data/lib/ui_bibz/helpers/ui/core/layouts_helper.rb +2 -2
- data/lib/ui_bibz/helpers/ui/core/lists_helper.rb +2 -2
- data/lib/ui_bibz/helpers/ui/core/navigations_helper.rb +12 -12
- data/lib/ui_bibz/helpers/ui/core/notifications_helper.rb +4 -4
- data/lib/ui_bibz/helpers/ui/core/windows_helper.rb +10 -2
- data/lib/ui_bibz/helpers/ui/ux_helper.rb +2 -2
- data/lib/ui_bibz/helpers/utils_helper.rb +2 -2
- data/lib/ui_bibz/infos.rb +3 -3
- data/lib/ui_bibz/inputs/ui_bibz_form/ui_bibz_form_builder.rb +12 -12
- data/lib/ui_bibz/inputs/ui_bibz_inputs/collection_input.rb +1 -1
- data/lib/ui_bibz/inputs/ui_bibz_inputs/ui_combobox_field_input.rb +15 -0
- data/lib/ui_bibz/rails/engine.rb +21 -4
- data/lib/ui_bibz/strategies/component_initialize_abstract_strategy.rb +27 -0
- data/lib/ui_bibz/strategies/component_initialize_block_strategy.rb +31 -0
- data/lib/ui_bibz/strategies/component_initialize_hash_strategy.rb +18 -0
- data/lib/ui_bibz/strategies/component_initialize_standard_strategy.rb +18 -0
- data/lib/ui_bibz/ui/concerns/card_itemable_concern.rb +4 -4
- data/lib/ui_bibz/ui/concerns/notification_concern.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card_accordion.rb +4 -4
- data/lib/ui_bibz/ui/core/boxes/card_column.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card_deck.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/card_grid.rb +0 -3
- data/lib/ui_bibz/ui/core/boxes/card_group.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/card_body.rb +9 -9
- data/lib/ui_bibz/ui/core/boxes/components/card_col.rb +2 -2
- data/lib/ui_bibz/ui/core/boxes/components/card_list_group.rb +1 -1
- data/lib/ui_bibz/ui/core/boxes/components/card_row.rb +1 -1
- data/lib/ui_bibz/ui/core/component.rb +13 -62
- data/lib/ui_bibz/ui/core/forms/buttons/button.rb +3 -1
- data/lib/ui_bibz/ui/core/forms/buttons/button_group.rb +11 -11
- data/lib/ui_bibz/ui/core/forms/choices/box_switch_field.rb +7 -7
- data/lib/ui_bibz/ui/core/forms/choices/checkbox_field.rb +2 -2
- data/lib/ui_bibz/ui/core/forms/choices/choice_group.rb +5 -6
- data/lib/ui_bibz/ui/core/forms/choices/components/choice.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/dates/date_picker_field.rb +15 -15
- data/lib/ui_bibz/ui/core/forms/dropdowns/components/dropdown_link.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/dropdowns/dropdown.rb +5 -5
- data/lib/ui_bibz/ui/core/forms/numbers/slider_field.rb +1 -1
- data/lib/ui_bibz/ui/core/forms/selects/dropdown_select_field.rb +10 -10
- data/lib/ui_bibz/ui/core/forms/selects/multi_column_field.rb +2 -2
- data/lib/ui_bibz/ui/core/forms/surrounds/surround_field.rb +32 -32
- data/lib/ui_bibz/ui/core/forms/textareas/markdown_editor_field.rb +7 -8
- data/lib/ui_bibz/ui/core/forms/texts/combobox_field.rb +96 -0
- data/lib/ui_bibz/ui/core/icons/components/glyph_text.rb +1 -1
- data/lib/ui_bibz/ui/core/icons/glyph.rb +4 -3
- data/lib/ui_bibz/ui/core/layouts/row.rb +2 -2
- data/lib/ui_bibz/ui/core/lists/components/list.rb +4 -4
- data/lib/ui_bibz/ui/core/lists/list_group.rb +1 -1
- data/lib/ui_bibz/ui/core/navigations/breadcrumb.rb +6 -4
- data/lib/ui_bibz/ui/core/navigations/components/nav_link_span.rb +1 -2
- data/lib/ui_bibz/ui/core/navigations/components/navbar_form.rb +6 -5
- data/lib/ui_bibz/ui/core/navigations/components/toolbar_form.rb +2 -2
- data/lib/ui_bibz/ui/core/navigations/nav.rb +10 -6
- data/lib/ui_bibz/ui/core/navigations/navbar.rb +21 -19
- data/lib/ui_bibz/ui/core/navigations/pagination.rb +3 -3
- data/lib/ui_bibz/ui/core/navigations/toolbar.rb +5 -5
- data/lib/ui_bibz/ui/core/notifications/alert.rb +4 -5
- data/lib/ui_bibz/ui/core/notifications/badge.rb +6 -2
- data/lib/ui_bibz/ui/core/notifications/components/toast_header.rb +1 -1
- data/lib/ui_bibz/ui/core/notifications/progress_bar.rb +3 -3
- data/lib/ui_bibz/ui/core/notifications/toast.rb +8 -9
- data/lib/ui_bibz/ui/core/windows/components/offcanvas_body.rb +47 -0
- data/lib/ui_bibz/ui/core/windows/components/offcanvas_header.rb +54 -0
- data/lib/ui_bibz/ui/core/windows/modal.rb +9 -9
- data/lib/ui_bibz/ui/core/windows/offcanvas.rb +84 -0
- data/lib/ui_bibz/ui/extensions/core/component/glyph_extension.rb +4 -20
- data/lib/ui_bibz/ui/extensions/core/component/klass_extension.rb +11 -19
- data/lib/ui_bibz/ui/extensions/core/forms/connect_extension.rb +1 -1
- data/lib/ui_bibz/ui/ux/containers/components/panel_column.rb +3 -3
- data/lib/ui_bibz/ui/ux/containers/components/panel_deck.rb +3 -3
- data/lib/ui_bibz/ui/ux/containers/components/panel_group.rb +3 -3
- data/lib/ui_bibz/ui/ux/containers/components/panel_header.rb +4 -4
- data/lib/ui_bibz/ui/ux/containers/panel.rb +13 -13
- data/lib/ui_bibz/ui/ux/tables/components/actions.rb +4 -4
- data/lib/ui_bibz/ui/ux/tables/components/column.rb +1 -1
- data/lib/ui_bibz/ui/ux/tables/components/columns.rb +2 -2
- data/lib/ui_bibz/ui/ux/tables/extensions/sortable.rb +1 -1
- data/lib/ui_bibz/ui/ux/tables/table.rb +5 -5
- data/lib/ui_bibz/ui/ux/tables/table_card.rb +6 -6
- data/lib/ui_bibz/ui/ux/tables/table_search_field.rb +1 -1
- data/lib/ui_bibz/utils/breakdown_class_name_generator.rb +3 -3
- data/lib/ui_bibz/utils/screwdriver.rb +1 -1
- data/lib/ui_bibz/view_objects/glyph_component_view_object.rb +38 -0
- data/lib/ui_bibz.rb +26 -0
- data/test/builders/data_html_classes_builder_test.rb +37 -0
- data/test/builders/html_classes_builder_test.rb +76 -0
- data/test/dummy/Rakefile +1 -1
- data/test/dummy/app/assets/stylesheets/application.css +1 -15
- data/test/dummy/app/channels/application_cable/channel.rb +6 -0
- data/test/dummy/app/channels/application_cable/connection.rb +6 -0
- data/test/dummy/app/jobs/application_job.rb +9 -0
- data/test/dummy/app/mailers/application_mailer.rb +6 -0
- data/test/dummy/app/views/layouts/application.html.erb +10 -12
- data/test/dummy/app/views/layouts/mailer.html.erb +13 -0
- data/test/dummy/app/views/layouts/mailer.text.erb +1 -0
- data/test/dummy/bin/rails +3 -3
- data/test/dummy/bin/rake +2 -2
- data/test/dummy/bin/setup +12 -12
- data/test/dummy/config/application.rb +13 -17
- data/test/dummy/config/boot.rb +3 -3
- data/test/dummy/config/database.yml +2 -2
- data/test/dummy/config/environment.rb +1 -1
- data/test/dummy/config/environments/development.rb +21 -16
- data/test/dummy/config/environments/production.rb +16 -41
- data/test/dummy/config/environments/test.rb +19 -8
- data/test/dummy/config/importmap.rb +11 -0
- data/test/dummy/config/initializers/content_security_policy.rb +21 -24
- data/test/dummy/config/initializers/filter_parameter_logging.rb +6 -2
- data/test/dummy/config/initializers/inflections.rb +4 -4
- data/test/dummy/config/initializers/permissions_policy.rb +12 -0
- data/test/dummy/config/locales/en.yml +13 -3
- data/test/dummy/config/puma.rb +7 -2
- data/test/dummy/config/storage.yml +5 -5
- data/test/dummy/config.ru +2 -1
- data/test/simple_form_test.rb +24 -24
- data/test/ui/core/boxes/card_test.rb +2 -1
- data/test/ui/core/component_test.rb +2 -2
- data/test/ui/core/forms/buttons/button_group_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_link_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_refresh_test.rb +1 -1
- data/test/ui/core/forms/buttons/button_test.rb +2 -2
- data/test/ui/core/forms/choices/box_switch_field_test.rb +10 -10
- data/test/ui/core/forms/choices/checkbox_field_test.rb +1 -1
- data/test/ui/core/forms/choices/choice_group_test.rb +1 -1
- data/test/ui/core/forms/dropdowns/dropdown_test.rb +1 -1
- data/test/ui/core/forms/numbers/formula_field_test.rb +1 -1
- data/test/ui/core/forms/selects/dropdown_select_field_test.rb +2 -2
- data/test/ui/core/forms/selects/select_field_test.rb +1 -1
- data/test/ui/core/forms/surrounds/surround_field_test.rb +4 -4
- data/test/ui/core/forms/texts/auto_complete_field_test.rb +2 -2
- data/test/ui/core/forms/texts/combobox_field_test.rb +19 -0
- data/test/ui/core/icons/glyph_test.rb +8 -4
- data/test/ui/core/icons/star_test.rb +12 -6
- data/test/ui/core/navigations/breadcrumb_test.rb +1 -1
- data/test/ui/core/navigations/link_test.rb +1 -1
- data/test/ui/core/navigations/nav_test.rb +11 -0
- data/test/ui/core/notifications/alert_test.rb +1 -1
- data/test/ui/core/notifications/badge_test.rb +3 -3
- data/test/ui/core/notifications/popover_test.rb +4 -4
- data/test/ui/core/notifications/spinner_test.rb +1 -1
- data/test/ui/core/notifications/toast_test.rb +1 -1
- data/test/ui/core/notifications/tooltip_test.rb +4 -4
- data/test/ui/core/windows/offcanvas_test.rb +27 -0
- data/test/ui/ux/containers/panel_test.rb +1 -1
- data/test/ui/ux/tables/table_test.rb +3 -3
- data/test/view_objects/glyph_component_view_object_test.rb +17 -0
- data/ui_bibz.gemspec +6 -20
- data/vendor/assets/fonts/fontawesome/fa-brands-400.ttf +0 -0
- data/vendor/assets/fonts/fontawesome/fa-brands-400.woff2 +0 -0
- data/vendor/assets/fonts/fontawesome/fa-regular-400.ttf +0 -0
- data/vendor/assets/fonts/fontawesome/fa-regular-400.woff2 +0 -0
- data/vendor/assets/fonts/fontawesome/fa-solid-900.ttf +0 -0
- data/vendor/assets/fonts/fontawesome/fa-solid-900.woff2 +0 -0
- data/vendor/assets/fonts/fontawesome/fa-v4compatibility.ttf +0 -0
- data/vendor/assets/fonts/fontawesome/fa-v4compatibility.woff2 +0 -0
- data/vendor/assets/javascripts/bootstrap-markdown.js +1 -1555
- data/vendor/assets/javascripts/bootstrap-multiselect.min.js +40 -1176
- data/vendor/assets/javascripts/bootstrap-switch.min.js +9 -21
- data/vendor/assets/javascripts/bs-custom-file-input.min.js +0 -1
- data/vendor/assets/javascripts/debounce.js +51 -0
- data/vendor/assets/javascripts/fontawesome/all.js +5977 -0
- data/vendor/assets/javascripts/fontawesome/all.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/brands.js +749 -0
- data/vendor/assets/javascripts/fontawesome/brands.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/conflict-detection.js +1138 -0
- data/vendor/assets/javascripts/fontawesome/conflict-detection.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/fontawesome.js +3126 -0
- data/vendor/assets/javascripts/fontawesome/fontawesome.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/regular.js +445 -0
- data/vendor/assets/javascripts/fontawesome/regular.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/solid.js +1672 -0
- data/vendor/assets/javascripts/fontawesome/solid.min.js +6 -0
- data/vendor/assets/javascripts/fontawesome/v4-shims.js +225 -0
- data/vendor/assets/javascripts/fontawesome/v4-shims.min.js +6 -0
- data/vendor/assets/javascripts/fuzzysort.js +562 -0
- data/vendor/assets/javascripts/jquery-3.7.0.min.js +2 -0
- data/vendor/assets/javascripts/jquery.multi-select.min.js +725 -1
- data/vendor/assets/stylesheets/bootstrap-multiselect.sass +115 -0
- data/vendor/assets/stylesheets/bootstrap-switch.scss +211 -0
- data/vendor/assets/stylesheets/fontawesome/_animated.scss +142 -9
- data/vendor/assets/stylesheets/fontawesome/_bordered-pulled.scss +13 -13
- data/vendor/assets/stylesheets/fontawesome/_core.scss +28 -6
- data/vendor/assets/stylesheets/fontawesome/_fixed-width.scss +2 -1
- data/vendor/assets/stylesheets/fontawesome/_functions.scss +57 -0
- data/vendor/assets/stylesheets/fontawesome/_icons.scss +7 -1438
- data/vendor/assets/stylesheets/fontawesome/_list.scss +4 -4
- data/vendor/assets/stylesheets/fontawesome/_mixins.scss +53 -34
- data/vendor/assets/stylesheets/fontawesome/_rotated-flipped.scss +25 -18
- data/vendor/assets/stylesheets/fontawesome/_screen-reader.scss +12 -3
- data/vendor/assets/stylesheets/fontawesome/_shims.scss +640 -664
- data/vendor/assets/stylesheets/fontawesome/_sizing.scss +16 -0
- data/vendor/assets/stylesheets/fontawesome/_stacked.scss +5 -4
- data/vendor/assets/stylesheets/fontawesome/_variables.scss +4896 -1393
- data/vendor/assets/stylesheets/fontawesome/brands.scss +17 -10
- data/vendor/assets/stylesheets/fontawesome/fontawesome.scss +7 -2
- data/vendor/assets/stylesheets/fontawesome/regular.scss +13 -10
- data/vendor/assets/stylesheets/fontawesome/solid.scss +13 -11
- data/vendor/assets/stylesheets/fontawesome/v4-shims.scss +6 -1
- data/vendor/assets/stylesheets/multi-select.css +92 -0
- metadata +126 -348
- data/.gitlab-ci.yml +0 -17
- data/.travis.yml +0 -24
- data/lib/ui_bibz/ui/extensions/core/component/popover_extension.rb +0 -70
- data/structure.md +0 -68
- data/test/dummy/README.rdoc +0 -28
- data/test/dummy/app/assets/javascripts/application.js +0 -13
- data/test/dummy/app/javascripts/packs/index.js +0 -3
- data/test/dummy/config/initializers/application_controller_renderer.rb +0 -9
- data/test/dummy/config/initializers/assets.rb +0 -14
- data/test/dummy/config/initializers/backtrace_silencers.rb +0 -8
- data/test/dummy/config/initializers/cookies_serializer.rb +0 -7
- data/test/dummy/config/initializers/mime_types.rb +0 -5
- data/test/dummy/config/initializers/session_store.rb +0 -5
- data/test/dummy/config/initializers/ui_bibz.rb +0 -5
- data/test/dummy/config/initializers/wrap_parameters.rb +0 -16
- data/test/dummy/config/secrets.yml +0 -22
- data/test/dummy/config/spring.rb +0 -8
- data/test/dummy/test/models/user_test.rb +0 -9
- data/vendor/assets/fonts/fa-brands-400.eot +0 -0
- data/vendor/assets/fonts/fa-brands-400.svg +0 -3570
- data/vendor/assets/fonts/fa-brands-400.ttf +0 -0
- data/vendor/assets/fonts/fa-brands-400.woff +0 -0
- data/vendor/assets/fonts/fa-brands-400.woff2 +0 -0
- data/vendor/assets/fonts/fa-regular-400.eot +0 -0
- data/vendor/assets/fonts/fa-regular-400.svg +0 -803
- data/vendor/assets/fonts/fa-regular-400.ttf +0 -0
- data/vendor/assets/fonts/fa-regular-400.woff +0 -0
- data/vendor/assets/fonts/fa-regular-400.woff2 +0 -0
- data/vendor/assets/fonts/fa-solid-900.eot +0 -0
- data/vendor/assets/fonts/fa-solid-900.svg +0 -4938
- data/vendor/assets/fonts/fa-solid-900.ttf +0 -0
- data/vendor/assets/fonts/fa-solid-900.woff +0 -0
- data/vendor/assets/fonts/fa-solid-900.woff2 +0 -0
- data/vendor/assets/javascripts/all.js +0 -4441
- data/vendor/assets/javascripts/all.min.js +0 -5
- data/vendor/assets/stylesheets/all.min.css +0 -5
- data/vendor/assets/stylesheets/fontawesome/_larger.scss +0 -23
- data/vendor/assets/stylesheets/svg-with-js.css +0 -5
- /data/{test/dummy/app/mailers/.keep → app/assets/stylesheets/sass/forms/_dropdown.sass} +0 -0
- /data/{test/dummy/app/views/users/index.html.erb → app/assets/stylesheets/sass/forms/_input_refresh_button.sass} +0 -0
@@ -0,0 +1,1138 @@
|
|
1
|
+
/*!
|
2
|
+
* Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com
|
3
|
+
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
|
4
|
+
* Copyright 2023 Fonticons, Inc.
|
5
|
+
*/
|
6
|
+
(function (global, factory) {
|
7
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory() :
|
8
|
+
typeof define === 'function' && define.amd ? define(factory) :
|
9
|
+
(factory());
|
10
|
+
}(this, (function () { 'use strict';
|
11
|
+
|
12
|
+
function ownKeys(object, enumerableOnly) {
|
13
|
+
var keys = Object.keys(object);
|
14
|
+
|
15
|
+
if (Object.getOwnPropertySymbols) {
|
16
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
17
|
+
enumerableOnly && (symbols = symbols.filter(function (sym) {
|
18
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
19
|
+
})), keys.push.apply(keys, symbols);
|
20
|
+
}
|
21
|
+
|
22
|
+
return keys;
|
23
|
+
}
|
24
|
+
|
25
|
+
function _objectSpread2(target) {
|
26
|
+
for (var i = 1; i < arguments.length; i++) {
|
27
|
+
var source = null != arguments[i] ? arguments[i] : {};
|
28
|
+
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
|
29
|
+
_defineProperty(target, key, source[key]);
|
30
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
|
31
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
32
|
+
});
|
33
|
+
}
|
34
|
+
|
35
|
+
return target;
|
36
|
+
}
|
37
|
+
|
38
|
+
function _typeof(obj) {
|
39
|
+
"@babel/helpers - typeof";
|
40
|
+
|
41
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
42
|
+
return typeof obj;
|
43
|
+
} : function (obj) {
|
44
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
45
|
+
}, _typeof(obj);
|
46
|
+
}
|
47
|
+
|
48
|
+
function _defineProperty(obj, key, value) {
|
49
|
+
if (key in obj) {
|
50
|
+
Object.defineProperty(obj, key, {
|
51
|
+
value: value,
|
52
|
+
enumerable: true,
|
53
|
+
configurable: true,
|
54
|
+
writable: true
|
55
|
+
});
|
56
|
+
} else {
|
57
|
+
obj[key] = value;
|
58
|
+
}
|
59
|
+
|
60
|
+
return obj;
|
61
|
+
}
|
62
|
+
|
63
|
+
function _toConsumableArray(arr) {
|
64
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
65
|
+
}
|
66
|
+
|
67
|
+
function _arrayWithoutHoles(arr) {
|
68
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
69
|
+
}
|
70
|
+
|
71
|
+
function _iterableToArray(iter) {
|
72
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
73
|
+
}
|
74
|
+
|
75
|
+
function _unsupportedIterableToArray(o, minLen) {
|
76
|
+
if (!o) return;
|
77
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
78
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
79
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
80
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
81
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
82
|
+
}
|
83
|
+
|
84
|
+
function _arrayLikeToArray(arr, len) {
|
85
|
+
if (len == null || len > arr.length) len = arr.length;
|
86
|
+
|
87
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
88
|
+
|
89
|
+
return arr2;
|
90
|
+
}
|
91
|
+
|
92
|
+
function _nonIterableSpread() {
|
93
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
94
|
+
}
|
95
|
+
|
96
|
+
var _WINDOW = {};
|
97
|
+
var _DOCUMENT = {};
|
98
|
+
|
99
|
+
try {
|
100
|
+
if (typeof window !== 'undefined') _WINDOW = window;
|
101
|
+
if (typeof document !== 'undefined') _DOCUMENT = document;
|
102
|
+
} catch (e) {}
|
103
|
+
|
104
|
+
var _ref = _WINDOW.navigator || {},
|
105
|
+
_ref$userAgent = _ref.userAgent,
|
106
|
+
userAgent = _ref$userAgent === void 0 ? '' : _ref$userAgent;
|
107
|
+
var WINDOW = _WINDOW;
|
108
|
+
var DOCUMENT = _DOCUMENT;
|
109
|
+
var IS_BROWSER = !!WINDOW.document;
|
110
|
+
var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';
|
111
|
+
var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
|
112
|
+
|
113
|
+
var functions = [];
|
114
|
+
|
115
|
+
var listener = function listener() {
|
116
|
+
DOCUMENT.removeEventListener('DOMContentLoaded', listener);
|
117
|
+
loaded = 1;
|
118
|
+
functions.map(function (fn) {
|
119
|
+
return fn();
|
120
|
+
});
|
121
|
+
};
|
122
|
+
|
123
|
+
var loaded = false;
|
124
|
+
|
125
|
+
if (IS_DOM) {
|
126
|
+
loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
|
127
|
+
if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
|
128
|
+
}
|
129
|
+
|
130
|
+
function domready (fn) {
|
131
|
+
if (!IS_DOM) return;
|
132
|
+
loaded ? setTimeout(fn, 0) : functions.push(fn);
|
133
|
+
}
|
134
|
+
|
135
|
+
function report (_ref) {
|
136
|
+
var nodesTested = _ref.nodesTested,
|
137
|
+
nodesFound = _ref.nodesFound;
|
138
|
+
var timedOutTests = {};
|
139
|
+
|
140
|
+
for (var key in nodesFound) {
|
141
|
+
if (!(nodesTested.conflict[key] || nodesTested.noConflict[key])) {
|
142
|
+
timedOutTests[key] = nodesFound[key];
|
143
|
+
}
|
144
|
+
}
|
145
|
+
|
146
|
+
var conflictsCount = Object.keys(nodesTested.conflict).length;
|
147
|
+
|
148
|
+
if (conflictsCount > 0) {
|
149
|
+
console.info("%cConflict".concat(conflictsCount > 1 ? 's' : '', " found:"), 'color: darkred; font-size: large');
|
150
|
+
var data = {};
|
151
|
+
|
152
|
+
for (var _key in nodesTested.conflict) {
|
153
|
+
var item = nodesTested.conflict[_key];
|
154
|
+
data[_key] = {
|
155
|
+
'tagName': item.tagName,
|
156
|
+
'src/href': item.src || item.href || 'n/a',
|
157
|
+
'innerText excerpt': item.innerText && item.innerText !== '' ? item.innerText.slice(0, 200) + '...' : '(empty)'
|
158
|
+
};
|
159
|
+
}
|
160
|
+
|
161
|
+
console.table(data);
|
162
|
+
}
|
163
|
+
|
164
|
+
var noConflictsCount = Object.keys(nodesTested.noConflict).length;
|
165
|
+
|
166
|
+
if (noConflictsCount > 0) {
|
167
|
+
console.info("%cNo conflict".concat(noConflictsCount > 1 ? 's' : '', " found with ").concat(noConflictsCount === 1 ? 'this' : 'these', ":"), 'color: green; font-size: large');
|
168
|
+
var _data = {};
|
169
|
+
|
170
|
+
for (var _key2 in nodesTested.noConflict) {
|
171
|
+
var _item = nodesTested.noConflict[_key2];
|
172
|
+
_data[_key2] = {
|
173
|
+
'tagName': _item.tagName,
|
174
|
+
'src/href': _item.src || _item.href || 'n/a',
|
175
|
+
'innerText excerpt': _item.innerText && _item.innerText !== '' ? _item.innerText.slice(0, 200) + '...' : '(empty)'
|
176
|
+
};
|
177
|
+
}
|
178
|
+
|
179
|
+
console.table(_data);
|
180
|
+
}
|
181
|
+
|
182
|
+
var timeOutCount = Object.keys(timedOutTests).length;
|
183
|
+
|
184
|
+
if (timeOutCount > 0) {
|
185
|
+
console.info("%cLeftovers--we timed out before collecting test results for ".concat(timeOutCount === 1 ? 'this' : 'these', ":"), 'color: blue; font-size: large');
|
186
|
+
var _data2 = {};
|
187
|
+
|
188
|
+
for (var _key3 in timedOutTests) {
|
189
|
+
var _item2 = timedOutTests[_key3];
|
190
|
+
_data2[_key3] = {
|
191
|
+
'tagName': _item2.tagName,
|
192
|
+
'src/href': _item2.src || _item2.href || 'n/a',
|
193
|
+
'innerText excerpt': _item2.innerText && _item2.innerText !== '' ? _item2.innerText.slice(0, 200) + '...' : '(empty)'
|
194
|
+
};
|
195
|
+
}
|
196
|
+
|
197
|
+
console.table(_data2);
|
198
|
+
}
|
199
|
+
}
|
200
|
+
|
201
|
+
var commonjsGlobal = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
202
|
+
|
203
|
+
function createCommonjsModule(fn, module) {
|
204
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
205
|
+
}
|
206
|
+
|
207
|
+
var md5 = createCommonjsModule(function (module) {
|
208
|
+
|
209
|
+
(function ($) {
|
210
|
+
/**
|
211
|
+
* Add integers, wrapping at 2^32.
|
212
|
+
* This uses 16-bit operations internally to work around bugs in interpreters.
|
213
|
+
*
|
214
|
+
* @param {number} x First integer
|
215
|
+
* @param {number} y Second integer
|
216
|
+
* @returns {number} Sum
|
217
|
+
*/
|
218
|
+
|
219
|
+
function safeAdd(x, y) {
|
220
|
+
var lsw = (x & 0xffff) + (y & 0xffff);
|
221
|
+
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
|
222
|
+
return msw << 16 | lsw & 0xffff;
|
223
|
+
}
|
224
|
+
/**
|
225
|
+
* Bitwise rotate a 32-bit number to the left.
|
226
|
+
*
|
227
|
+
* @param {number} num 32-bit number
|
228
|
+
* @param {number} cnt Rotation count
|
229
|
+
* @returns {number} Rotated number
|
230
|
+
*/
|
231
|
+
|
232
|
+
|
233
|
+
function bitRotateLeft(num, cnt) {
|
234
|
+
return num << cnt | num >>> 32 - cnt;
|
235
|
+
}
|
236
|
+
/**
|
237
|
+
* Basic operation the algorithm uses.
|
238
|
+
*
|
239
|
+
* @param {number} q q
|
240
|
+
* @param {number} a a
|
241
|
+
* @param {number} b b
|
242
|
+
* @param {number} x x
|
243
|
+
* @param {number} s s
|
244
|
+
* @param {number} t t
|
245
|
+
* @returns {number} Result
|
246
|
+
*/
|
247
|
+
|
248
|
+
|
249
|
+
function md5cmn(q, a, b, x, s, t) {
|
250
|
+
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
|
251
|
+
}
|
252
|
+
/**
|
253
|
+
* Basic operation the algorithm uses.
|
254
|
+
*
|
255
|
+
* @param {number} a a
|
256
|
+
* @param {number} b b
|
257
|
+
* @param {number} c c
|
258
|
+
* @param {number} d d
|
259
|
+
* @param {number} x x
|
260
|
+
* @param {number} s s
|
261
|
+
* @param {number} t t
|
262
|
+
* @returns {number} Result
|
263
|
+
*/
|
264
|
+
|
265
|
+
|
266
|
+
function md5ff(a, b, c, d, x, s, t) {
|
267
|
+
return md5cmn(b & c | ~b & d, a, b, x, s, t);
|
268
|
+
}
|
269
|
+
/**
|
270
|
+
* Basic operation the algorithm uses.
|
271
|
+
*
|
272
|
+
* @param {number} a a
|
273
|
+
* @param {number} b b
|
274
|
+
* @param {number} c c
|
275
|
+
* @param {number} d d
|
276
|
+
* @param {number} x x
|
277
|
+
* @param {number} s s
|
278
|
+
* @param {number} t t
|
279
|
+
* @returns {number} Result
|
280
|
+
*/
|
281
|
+
|
282
|
+
|
283
|
+
function md5gg(a, b, c, d, x, s, t) {
|
284
|
+
return md5cmn(b & d | c & ~d, a, b, x, s, t);
|
285
|
+
}
|
286
|
+
/**
|
287
|
+
* Basic operation the algorithm uses.
|
288
|
+
*
|
289
|
+
* @param {number} a a
|
290
|
+
* @param {number} b b
|
291
|
+
* @param {number} c c
|
292
|
+
* @param {number} d d
|
293
|
+
* @param {number} x x
|
294
|
+
* @param {number} s s
|
295
|
+
* @param {number} t t
|
296
|
+
* @returns {number} Result
|
297
|
+
*/
|
298
|
+
|
299
|
+
|
300
|
+
function md5hh(a, b, c, d, x, s, t) {
|
301
|
+
return md5cmn(b ^ c ^ d, a, b, x, s, t);
|
302
|
+
}
|
303
|
+
/**
|
304
|
+
* Basic operation the algorithm uses.
|
305
|
+
*
|
306
|
+
* @param {number} a a
|
307
|
+
* @param {number} b b
|
308
|
+
* @param {number} c c
|
309
|
+
* @param {number} d d
|
310
|
+
* @param {number} x x
|
311
|
+
* @param {number} s s
|
312
|
+
* @param {number} t t
|
313
|
+
* @returns {number} Result
|
314
|
+
*/
|
315
|
+
|
316
|
+
|
317
|
+
function md5ii(a, b, c, d, x, s, t) {
|
318
|
+
return md5cmn(c ^ (b | ~d), a, b, x, s, t);
|
319
|
+
}
|
320
|
+
/**
|
321
|
+
* Calculate the MD5 of an array of little-endian words, and a bit length.
|
322
|
+
*
|
323
|
+
* @param {Array} x Array of little-endian words
|
324
|
+
* @param {number} len Bit length
|
325
|
+
* @returns {Array<number>} MD5 Array
|
326
|
+
*/
|
327
|
+
|
328
|
+
|
329
|
+
function binlMD5(x, len) {
|
330
|
+
/* append padding */
|
331
|
+
x[len >> 5] |= 0x80 << len % 32;
|
332
|
+
x[(len + 64 >>> 9 << 4) + 14] = len;
|
333
|
+
var i;
|
334
|
+
var olda;
|
335
|
+
var oldb;
|
336
|
+
var oldc;
|
337
|
+
var oldd;
|
338
|
+
var a = 1732584193;
|
339
|
+
var b = -271733879;
|
340
|
+
var c = -1732584194;
|
341
|
+
var d = 271733878;
|
342
|
+
|
343
|
+
for (i = 0; i < x.length; i += 16) {
|
344
|
+
olda = a;
|
345
|
+
oldb = b;
|
346
|
+
oldc = c;
|
347
|
+
oldd = d;
|
348
|
+
a = md5ff(a, b, c, d, x[i], 7, -680876936);
|
349
|
+
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
|
350
|
+
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
|
351
|
+
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
|
352
|
+
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
|
353
|
+
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
|
354
|
+
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
|
355
|
+
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
|
356
|
+
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
|
357
|
+
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
|
358
|
+
c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
|
359
|
+
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
|
360
|
+
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
|
361
|
+
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
|
362
|
+
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
|
363
|
+
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
|
364
|
+
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
|
365
|
+
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
|
366
|
+
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
|
367
|
+
b = md5gg(b, c, d, a, x[i], 20, -373897302);
|
368
|
+
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
|
369
|
+
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
|
370
|
+
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
|
371
|
+
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
|
372
|
+
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
|
373
|
+
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
|
374
|
+
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
|
375
|
+
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
|
376
|
+
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
|
377
|
+
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
|
378
|
+
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
|
379
|
+
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
|
380
|
+
a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
|
381
|
+
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
|
382
|
+
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
|
383
|
+
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
|
384
|
+
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
|
385
|
+
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
|
386
|
+
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
|
387
|
+
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
|
388
|
+
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
|
389
|
+
d = md5hh(d, a, b, c, x[i], 11, -358537222);
|
390
|
+
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
|
391
|
+
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
|
392
|
+
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
|
393
|
+
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
|
394
|
+
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
|
395
|
+
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
|
396
|
+
a = md5ii(a, b, c, d, x[i], 6, -198630844);
|
397
|
+
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
|
398
|
+
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
|
399
|
+
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
|
400
|
+
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
|
401
|
+
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
|
402
|
+
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
|
403
|
+
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
|
404
|
+
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
|
405
|
+
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
|
406
|
+
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
|
407
|
+
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
|
408
|
+
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
|
409
|
+
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
|
410
|
+
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
|
411
|
+
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
|
412
|
+
a = safeAdd(a, olda);
|
413
|
+
b = safeAdd(b, oldb);
|
414
|
+
c = safeAdd(c, oldc);
|
415
|
+
d = safeAdd(d, oldd);
|
416
|
+
}
|
417
|
+
|
418
|
+
return [a, b, c, d];
|
419
|
+
}
|
420
|
+
/**
|
421
|
+
* Convert an array of little-endian words to a string
|
422
|
+
*
|
423
|
+
* @param {Array<number>} input MD5 Array
|
424
|
+
* @returns {string} MD5 string
|
425
|
+
*/
|
426
|
+
|
427
|
+
|
428
|
+
function binl2rstr(input) {
|
429
|
+
var i;
|
430
|
+
var output = '';
|
431
|
+
var length32 = input.length * 32;
|
432
|
+
|
433
|
+
for (i = 0; i < length32; i += 8) {
|
434
|
+
output += String.fromCharCode(input[i >> 5] >>> i % 32 & 0xff);
|
435
|
+
}
|
436
|
+
|
437
|
+
return output;
|
438
|
+
}
|
439
|
+
/**
|
440
|
+
* Convert a raw string to an array of little-endian words
|
441
|
+
* Characters >255 have their high-byte silently ignored.
|
442
|
+
*
|
443
|
+
* @param {string} input Raw input string
|
444
|
+
* @returns {Array<number>} Array of little-endian words
|
445
|
+
*/
|
446
|
+
|
447
|
+
|
448
|
+
function rstr2binl(input) {
|
449
|
+
var i;
|
450
|
+
var output = [];
|
451
|
+
output[(input.length >> 2) - 1] = undefined;
|
452
|
+
|
453
|
+
for (i = 0; i < output.length; i += 1) {
|
454
|
+
output[i] = 0;
|
455
|
+
}
|
456
|
+
|
457
|
+
var length8 = input.length * 8;
|
458
|
+
|
459
|
+
for (i = 0; i < length8; i += 8) {
|
460
|
+
output[i >> 5] |= (input.charCodeAt(i / 8) & 0xff) << i % 32;
|
461
|
+
}
|
462
|
+
|
463
|
+
return output;
|
464
|
+
}
|
465
|
+
/**
|
466
|
+
* Calculate the MD5 of a raw string
|
467
|
+
*
|
468
|
+
* @param {string} s Input string
|
469
|
+
* @returns {string} Raw MD5 string
|
470
|
+
*/
|
471
|
+
|
472
|
+
|
473
|
+
function rstrMD5(s) {
|
474
|
+
return binl2rstr(binlMD5(rstr2binl(s), s.length * 8));
|
475
|
+
}
|
476
|
+
/**
|
477
|
+
* Calculates the HMAC-MD5 of a key and some data (raw strings)
|
478
|
+
*
|
479
|
+
* @param {string} key HMAC key
|
480
|
+
* @param {string} data Raw input string
|
481
|
+
* @returns {string} Raw MD5 string
|
482
|
+
*/
|
483
|
+
|
484
|
+
|
485
|
+
function rstrHMACMD5(key, data) {
|
486
|
+
var i;
|
487
|
+
var bkey = rstr2binl(key);
|
488
|
+
var ipad = [];
|
489
|
+
var opad = [];
|
490
|
+
var hash;
|
491
|
+
ipad[15] = opad[15] = undefined;
|
492
|
+
|
493
|
+
if (bkey.length > 16) {
|
494
|
+
bkey = binlMD5(bkey, key.length * 8);
|
495
|
+
}
|
496
|
+
|
497
|
+
for (i = 0; i < 16; i += 1) {
|
498
|
+
ipad[i] = bkey[i] ^ 0x36363636;
|
499
|
+
opad[i] = bkey[i] ^ 0x5c5c5c5c;
|
500
|
+
}
|
501
|
+
|
502
|
+
hash = binlMD5(ipad.concat(rstr2binl(data)), 512 + data.length * 8);
|
503
|
+
return binl2rstr(binlMD5(opad.concat(hash), 512 + 128));
|
504
|
+
}
|
505
|
+
/**
|
506
|
+
* Convert a raw string to a hex string
|
507
|
+
*
|
508
|
+
* @param {string} input Raw input string
|
509
|
+
* @returns {string} Hex encoded string
|
510
|
+
*/
|
511
|
+
|
512
|
+
|
513
|
+
function rstr2hex(input) {
|
514
|
+
var hexTab = '0123456789abcdef';
|
515
|
+
var output = '';
|
516
|
+
var x;
|
517
|
+
var i;
|
518
|
+
|
519
|
+
for (i = 0; i < input.length; i += 1) {
|
520
|
+
x = input.charCodeAt(i);
|
521
|
+
output += hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f);
|
522
|
+
}
|
523
|
+
|
524
|
+
return output;
|
525
|
+
}
|
526
|
+
/**
|
527
|
+
* Encode a string as UTF-8
|
528
|
+
*
|
529
|
+
* @param {string} input Input string
|
530
|
+
* @returns {string} UTF8 string
|
531
|
+
*/
|
532
|
+
|
533
|
+
|
534
|
+
function str2rstrUTF8(input) {
|
535
|
+
return unescape(encodeURIComponent(input));
|
536
|
+
}
|
537
|
+
/**
|
538
|
+
* Encodes input string as raw MD5 string
|
539
|
+
*
|
540
|
+
* @param {string} s Input string
|
541
|
+
* @returns {string} Raw MD5 string
|
542
|
+
*/
|
543
|
+
|
544
|
+
|
545
|
+
function rawMD5(s) {
|
546
|
+
return rstrMD5(str2rstrUTF8(s));
|
547
|
+
}
|
548
|
+
/**
|
549
|
+
* Encodes input string as Hex encoded string
|
550
|
+
*
|
551
|
+
* @param {string} s Input string
|
552
|
+
* @returns {string} Hex encoded string
|
553
|
+
*/
|
554
|
+
|
555
|
+
|
556
|
+
function hexMD5(s) {
|
557
|
+
return rstr2hex(rawMD5(s));
|
558
|
+
}
|
559
|
+
/**
|
560
|
+
* Calculates the raw HMAC-MD5 for the given key and data
|
561
|
+
*
|
562
|
+
* @param {string} k HMAC key
|
563
|
+
* @param {string} d Input string
|
564
|
+
* @returns {string} Raw MD5 string
|
565
|
+
*/
|
566
|
+
|
567
|
+
|
568
|
+
function rawHMACMD5(k, d) {
|
569
|
+
return rstrHMACMD5(str2rstrUTF8(k), str2rstrUTF8(d));
|
570
|
+
}
|
571
|
+
/**
|
572
|
+
* Calculates the Hex encoded HMAC-MD5 for the given key and data
|
573
|
+
*
|
574
|
+
* @param {string} k HMAC key
|
575
|
+
* @param {string} d Input string
|
576
|
+
* @returns {string} Raw MD5 string
|
577
|
+
*/
|
578
|
+
|
579
|
+
|
580
|
+
function hexHMACMD5(k, d) {
|
581
|
+
return rstr2hex(rawHMACMD5(k, d));
|
582
|
+
}
|
583
|
+
/**
|
584
|
+
* Calculates MD5 value for a given string.
|
585
|
+
* If a key is provided, calculates the HMAC-MD5 value.
|
586
|
+
* Returns a Hex encoded string unless the raw argument is given.
|
587
|
+
*
|
588
|
+
* @param {string} string Input string
|
589
|
+
* @param {string} [key] HMAC key
|
590
|
+
* @param {boolean} [raw] Raw output switch
|
591
|
+
* @returns {string} MD5 output
|
592
|
+
*/
|
593
|
+
|
594
|
+
|
595
|
+
function md5(string, key, raw) {
|
596
|
+
if (!key) {
|
597
|
+
if (!raw) {
|
598
|
+
return hexMD5(string);
|
599
|
+
}
|
600
|
+
|
601
|
+
return rawMD5(string);
|
602
|
+
}
|
603
|
+
|
604
|
+
if (!raw) {
|
605
|
+
return hexHMACMD5(key, string);
|
606
|
+
}
|
607
|
+
|
608
|
+
return rawHMACMD5(key, string);
|
609
|
+
}
|
610
|
+
|
611
|
+
if (module.exports) {
|
612
|
+
module.exports = md5;
|
613
|
+
} else {
|
614
|
+
$.md5 = md5;
|
615
|
+
}
|
616
|
+
})(commonjsGlobal);
|
617
|
+
});
|
618
|
+
|
619
|
+
function md5ForNode(node) {
|
620
|
+
if (null === node || 'object' !== _typeof(node)) return undefined;
|
621
|
+
|
622
|
+
if (node.src) {
|
623
|
+
return md5(node.src);
|
624
|
+
} else if (node.href) {
|
625
|
+
return md5(node.href);
|
626
|
+
} else if (node.innerText && '' !== node.innerText) {
|
627
|
+
// eslint-disable-line yoda
|
628
|
+
return md5(node.innerText);
|
629
|
+
} else {
|
630
|
+
return undefined;
|
631
|
+
}
|
632
|
+
}
|
633
|
+
|
634
|
+
var diagScriptId = 'fa-kits-diag';
|
635
|
+
var nodeUnderTestId = 'fa-kits-node-under-test';
|
636
|
+
var md5Attr = 'data-md5';
|
637
|
+
var detectionIgnoreAttr = 'data-fa-detection-ignore';
|
638
|
+
var timeoutAttr = 'data-fa-detection-timeout';
|
639
|
+
var resultsCollectionMaxWaitAttr = 'data-fa-detection-results-collection-max-wait';
|
640
|
+
|
641
|
+
var silenceErrors = function silenceErrors(e) {
|
642
|
+
e.preventDefault();
|
643
|
+
e.stopPropagation();
|
644
|
+
};
|
645
|
+
|
646
|
+
function pollUntil(_ref) {
|
647
|
+
var _ref$fn = _ref.fn,
|
648
|
+
fn = _ref$fn === void 0 ? function () {
|
649
|
+
return true;
|
650
|
+
} : _ref$fn,
|
651
|
+
_ref$initialDuration = _ref.initialDuration,
|
652
|
+
initialDuration = _ref$initialDuration === void 0 ? 1 : _ref$initialDuration,
|
653
|
+
_ref$maxDuration = _ref.maxDuration,
|
654
|
+
maxDuration = _ref$maxDuration === void 0 ? WINDOW.FontAwesomeDetection.timeout : _ref$maxDuration,
|
655
|
+
_ref$showProgress = _ref.showProgress,
|
656
|
+
showProgress = _ref$showProgress === void 0 ? false : _ref$showProgress,
|
657
|
+
progressIndicator = _ref.progressIndicator;
|
658
|
+
return new Promise(function (resolve, reject) {
|
659
|
+
// eslint-disable-line compat/compat
|
660
|
+
function poll(duration, cumulativeDuration) {
|
661
|
+
setTimeout(function () {
|
662
|
+
var result = fn();
|
663
|
+
|
664
|
+
if (showProgress) {
|
665
|
+
console.info(progressIndicator);
|
666
|
+
}
|
667
|
+
|
668
|
+
if (!!result) {
|
669
|
+
// eslint-disable-line no-extra-boolean-cast
|
670
|
+
resolve(result);
|
671
|
+
} else {
|
672
|
+
var nextDuration = 250;
|
673
|
+
var nextCumulativeDuration = nextDuration + cumulativeDuration;
|
674
|
+
|
675
|
+
if (nextCumulativeDuration <= maxDuration) {
|
676
|
+
poll(nextDuration, nextCumulativeDuration);
|
677
|
+
} else {
|
678
|
+
reject('timeout'); // eslint-disable-line prefer-promise-reject-errors
|
679
|
+
}
|
680
|
+
}
|
681
|
+
}, duration);
|
682
|
+
}
|
683
|
+
|
684
|
+
poll(initialDuration, 0);
|
685
|
+
});
|
686
|
+
}
|
687
|
+
|
688
|
+
function detectWebfontConflicts() {
|
689
|
+
var linkTags = Array.from(DOCUMENT.getElementsByTagName('link')).filter(function (t) {
|
690
|
+
return !t.hasAttribute(detectionIgnoreAttr);
|
691
|
+
});
|
692
|
+
var styleTags = Array.from(DOCUMENT.getElementsByTagName('style')).filter(function (t) {
|
693
|
+
if (t.hasAttribute(detectionIgnoreAttr)) {
|
694
|
+
return false;
|
695
|
+
} // If the browser has loaded the FA5 CSS, let's not test that <style> element.
|
696
|
+
// Its enough that we'll be testing for traces of the corresponding JS being loaded, and testing
|
697
|
+
// this <style> would only produce a false negative anyway.
|
698
|
+
|
699
|
+
|
700
|
+
if (WINDOW.FontAwesomeConfig && t.innerText.match(new RegExp("svg:not\\(:root\\)\\.".concat(WINDOW.FontAwesomeConfig.replacementClass)))) {
|
701
|
+
return false;
|
702
|
+
}
|
703
|
+
|
704
|
+
return true;
|
705
|
+
});
|
706
|
+
|
707
|
+
function runDiag(scriptOrLinkTag, md5) {
|
708
|
+
var diagFrame = DOCUMENT.createElement('iframe'); // Using "visibility: hidden; position: absolute" instead of "display: none;" because
|
709
|
+
// Firefox will not return the expected results for getComputedStyle if our iframe has display: none.
|
710
|
+
|
711
|
+
diagFrame.setAttribute('style', 'visibility: hidden; position: absolute; height: 0; width: 0;');
|
712
|
+
var testIconId = 'fa-test-icon-' + md5;
|
713
|
+
var iTag = DOCUMENT.createElement('i');
|
714
|
+
iTag.setAttribute('class', 'fa fa-coffee');
|
715
|
+
iTag.setAttribute('id', testIconId);
|
716
|
+
var diagScript = DOCUMENT.createElement('script');
|
717
|
+
diagScript.setAttribute('id', diagScriptId); // WARNING: this function will be toString()'d and assigned to innerText of the diag script
|
718
|
+
// element that we'll be putting into a diagnostic iframe.
|
719
|
+
// That means that this code won't compile until after the outer script has run and injected
|
720
|
+
// this code into the iframe. There are some compile time errors that might occur there.
|
721
|
+
// For example, using single line (double-slash) comments like this one inside that function
|
722
|
+
// will probably cause it to choke. Chrome will show an error like this:
|
723
|
+
// Uncaught SyntaxError: Unexpected end of input
|
724
|
+
|
725
|
+
var diagScriptFun = function diagScriptFun(nodeUnderTestId, testIconId, md5, parentOrigin) {
|
726
|
+
parent.FontAwesomeDetection.__pollUntil({
|
727
|
+
fn: function fn() {
|
728
|
+
var iEl = document.getElementById(testIconId);
|
729
|
+
var computedStyle = window.getComputedStyle(iEl);
|
730
|
+
var fontFamily = computedStyle.getPropertyValue('font-family');
|
731
|
+
|
732
|
+
if (!!fontFamily.match(/FontAwesome/) || !!fontFamily.match(/Font Awesome [56]/)) {
|
733
|
+
return true;
|
734
|
+
} else {
|
735
|
+
return false;
|
736
|
+
}
|
737
|
+
}
|
738
|
+
}).then(function () {
|
739
|
+
var node = document.getElementById(nodeUnderTestId);
|
740
|
+
parent.postMessage({
|
741
|
+
type: 'fontawesome-conflict',
|
742
|
+
technology: 'webfont',
|
743
|
+
href: node.href,
|
744
|
+
innerText: node.innerText,
|
745
|
+
tagName: node.tagName,
|
746
|
+
md5: md5
|
747
|
+
}, parentOrigin);
|
748
|
+
}).catch(function (e) {
|
749
|
+
var node = document.getElementById(nodeUnderTestId);
|
750
|
+
|
751
|
+
if (e === 'timeout') {
|
752
|
+
parent.postMessage({
|
753
|
+
type: 'no-conflict',
|
754
|
+
technology: 'webfont',
|
755
|
+
href: node.src,
|
756
|
+
innerText: node.innerText,
|
757
|
+
tagName: node.tagName,
|
758
|
+
md5: md5
|
759
|
+
}, parentOrigin);
|
760
|
+
} else {
|
761
|
+
console.error(e);
|
762
|
+
}
|
763
|
+
});
|
764
|
+
};
|
765
|
+
|
766
|
+
var parentOrigin = WINDOW.location.origin === 'file://' ? '*' : WINDOW.location.origin;
|
767
|
+
diagScript.innerText = "(".concat(diagScriptFun.toString(), ")('").concat(nodeUnderTestId, "', '").concat(testIconId || 'foo', "', '").concat(md5, "', '").concat(parentOrigin, "');");
|
768
|
+
|
769
|
+
diagFrame.onload = function () {
|
770
|
+
diagFrame.contentWindow.addEventListener('error', silenceErrors, true);
|
771
|
+
diagFrame.contentDocument.head.appendChild(diagScript);
|
772
|
+
diagFrame.contentDocument.head.appendChild(scriptOrLinkTag);
|
773
|
+
diagFrame.contentDocument.body.appendChild(iTag);
|
774
|
+
};
|
775
|
+
|
776
|
+
domready(function () {
|
777
|
+
return DOCUMENT.body.appendChild(diagFrame);
|
778
|
+
});
|
779
|
+
}
|
780
|
+
|
781
|
+
var cssByMD5 = {};
|
782
|
+
|
783
|
+
for (var i = 0; i < linkTags.length; i++) {
|
784
|
+
var linkUnderTest = DOCUMENT.createElement('link');
|
785
|
+
linkUnderTest.setAttribute('id', nodeUnderTestId);
|
786
|
+
linkUnderTest.setAttribute('href', linkTags[i].href);
|
787
|
+
linkUnderTest.setAttribute('rel', linkTags[i].rel);
|
788
|
+
var md5ForLink = md5ForNode(linkTags[i]);
|
789
|
+
linkUnderTest.setAttribute(md5Attr, md5ForLink);
|
790
|
+
cssByMD5[md5ForLink] = linkTags[i];
|
791
|
+
runDiag(linkUnderTest, md5ForLink);
|
792
|
+
}
|
793
|
+
|
794
|
+
for (var _i = 0; _i < styleTags.length; _i++) {
|
795
|
+
var styleUnderTest = DOCUMENT.createElement('style');
|
796
|
+
styleUnderTest.setAttribute('id', nodeUnderTestId);
|
797
|
+
var md5ForStyle = md5ForNode(styleTags[_i]);
|
798
|
+
styleUnderTest.setAttribute(md5Attr, md5ForStyle);
|
799
|
+
styleUnderTest.innerText = styleTags[_i].innerText;
|
800
|
+
cssByMD5[md5ForStyle] = styleTags[_i];
|
801
|
+
runDiag(styleUnderTest, md5ForStyle);
|
802
|
+
}
|
803
|
+
|
804
|
+
return cssByMD5;
|
805
|
+
}
|
806
|
+
|
807
|
+
function detectSvgConflicts(currentScript) {
|
808
|
+
var scripts = Array.from(DOCUMENT.scripts).filter(function (t) {
|
809
|
+
return !t.hasAttribute(detectionIgnoreAttr) && t !== currentScript;
|
810
|
+
});
|
811
|
+
var scriptsByMD5 = {};
|
812
|
+
|
813
|
+
var _loop = function _loop(scriptIdx) {
|
814
|
+
var diagFrame = DOCUMENT.createElement('iframe');
|
815
|
+
diagFrame.setAttribute('style', 'display:none;');
|
816
|
+
var scriptUnderTest = DOCUMENT.createElement('script');
|
817
|
+
scriptUnderTest.setAttribute('id', nodeUnderTestId);
|
818
|
+
var md5ForScript = md5ForNode(scripts[scriptIdx]);
|
819
|
+
scriptUnderTest.setAttribute(md5Attr, md5ForScript);
|
820
|
+
scriptsByMD5[md5ForScript] = scripts[scriptIdx];
|
821
|
+
|
822
|
+
if (scripts[scriptIdx].src !== '') {
|
823
|
+
scriptUnderTest.src = scripts[scriptIdx].src;
|
824
|
+
}
|
825
|
+
|
826
|
+
if (scripts[scriptIdx].innerText !== '') {
|
827
|
+
scriptUnderTest.innerText = scripts[scriptIdx].innerText;
|
828
|
+
}
|
829
|
+
|
830
|
+
scriptUnderTest.async = true;
|
831
|
+
var diagScript = DOCUMENT.createElement('script');
|
832
|
+
diagScript.setAttribute('id', diagScriptId);
|
833
|
+
var parentOrigin = WINDOW.location.origin === 'file://' ? '*' : WINDOW.location.origin;
|
834
|
+
|
835
|
+
var diagScriptFun = function diagScriptFun(nodeUnderTestId, md5, parentOrigin) {
|
836
|
+
parent.FontAwesomeDetection.__pollUntil({
|
837
|
+
fn: function fn() {
|
838
|
+
return !!window.FontAwesomeConfig || !!window.FontAwesomeKitConfig;
|
839
|
+
}
|
840
|
+
}).then(function () {
|
841
|
+
var scriptNode = document.getElementById(nodeUnderTestId);
|
842
|
+
parent.postMessage({
|
843
|
+
type: 'fontawesome-conflict',
|
844
|
+
technology: 'js',
|
845
|
+
src: scriptNode.src,
|
846
|
+
innerText: scriptNode.innerText,
|
847
|
+
tagName: scriptNode.tagName,
|
848
|
+
md5: md5
|
849
|
+
}, parentOrigin);
|
850
|
+
}).catch(function (e) {
|
851
|
+
var scriptNode = document.getElementById(nodeUnderTestId);
|
852
|
+
|
853
|
+
if (e === 'timeout') {
|
854
|
+
parent.postMessage({
|
855
|
+
type: 'no-conflict',
|
856
|
+
src: scriptNode.src,
|
857
|
+
innerText: scriptNode.innerText,
|
858
|
+
tagName: scriptNode.tagName,
|
859
|
+
md5: md5
|
860
|
+
}, parentOrigin);
|
861
|
+
} else {
|
862
|
+
console.error(e);
|
863
|
+
}
|
864
|
+
});
|
865
|
+
};
|
866
|
+
|
867
|
+
diagScript.innerText = "(".concat(diagScriptFun.toString(), ")('").concat(nodeUnderTestId, "', '").concat(md5ForScript, "', '").concat(parentOrigin, "');");
|
868
|
+
|
869
|
+
diagFrame.onload = function () {
|
870
|
+
diagFrame.contentWindow.addEventListener('error', silenceErrors, true);
|
871
|
+
diagFrame.contentDocument.head.appendChild(diagScript);
|
872
|
+
diagFrame.contentDocument.head.appendChild(scriptUnderTest);
|
873
|
+
};
|
874
|
+
|
875
|
+
domready(function () {
|
876
|
+
return DOCUMENT.body.appendChild(diagFrame);
|
877
|
+
});
|
878
|
+
};
|
879
|
+
|
880
|
+
for (var scriptIdx = 0; scriptIdx < scripts.length; scriptIdx++) {
|
881
|
+
_loop(scriptIdx);
|
882
|
+
}
|
883
|
+
|
884
|
+
return scriptsByMD5;
|
885
|
+
}
|
886
|
+
|
887
|
+
function setDoneResults(_ref2) {
|
888
|
+
var nodesTested = _ref2.nodesTested,
|
889
|
+
nodesFound = _ref2.nodesFound;
|
890
|
+
WINDOW.FontAwesomeDetection = WINDOW.FontAwesomeDetection || {};
|
891
|
+
WINDOW.FontAwesomeDetection.nodesTested = nodesTested;
|
892
|
+
WINDOW.FontAwesomeDetection.nodesFound = nodesFound;
|
893
|
+
WINDOW.FontAwesomeDetection.detectionDone = true;
|
894
|
+
}
|
895
|
+
|
896
|
+
function conflictDetection() {
|
897
|
+
var report$$1 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : function () {};
|
898
|
+
var nodesTested = {
|
899
|
+
conflict: {},
|
900
|
+
noConflict: {}
|
901
|
+
};
|
902
|
+
|
903
|
+
WINDOW.onmessage = function (e) {
|
904
|
+
if (WINDOW.location.origin === 'file://' || e.origin === WINDOW.location.origin) {
|
905
|
+
if (e && e.data) {
|
906
|
+
if (e.data.type === 'fontawesome-conflict') {
|
907
|
+
nodesTested.conflict[e.data.md5] = e.data;
|
908
|
+
} else if (e.data.type === 'no-conflict') {
|
909
|
+
nodesTested.noConflict[e.data.md5] = e.data;
|
910
|
+
}
|
911
|
+
}
|
912
|
+
}
|
913
|
+
};
|
914
|
+
|
915
|
+
var scriptsToTest = detectSvgConflicts(DOCUMENT.currentScript);
|
916
|
+
var cssToTest = detectWebfontConflicts();
|
917
|
+
|
918
|
+
var nodesFound = _objectSpread2(_objectSpread2({}, scriptsToTest), cssToTest);
|
919
|
+
|
920
|
+
var testCount = Object.keys(scriptsToTest).length + Object.keys(cssToTest).length; // The resultsCollectionMaxWait allows for the time between when the tests running under
|
921
|
+
// child iframes call postMessage with their results, and when the parent window
|
922
|
+
// receives and handles those events with window.onmessage.
|
923
|
+
// Making it configurable allows us to test the scenario where this timeout is exceeded.
|
924
|
+
// Naming it something very different from "timeout" is to help avoid the potential ambiguity between
|
925
|
+
// these two timeout-related settings.
|
926
|
+
|
927
|
+
var masterTimeout = WINDOW.FontAwesomeDetection.timeout + WINDOW.FontAwesomeDetection.resultsCollectionMaxWait;
|
928
|
+
console.group('Font Awesome Detector');
|
929
|
+
|
930
|
+
if (testCount === 0) {
|
931
|
+
console.info('%cAll Good!', 'color: green; font-size: large');
|
932
|
+
console.info('We didn\'t find anything that needs testing for conflicts. Ergo, no conflicts.');
|
933
|
+
} else {
|
934
|
+
console.info("Testing ".concat(testCount, " possible conflicts."));
|
935
|
+
console.info("We'll wait about ".concat(Math.round(WINDOW.FontAwesomeDetection.timeout / 10) / 100, " seconds while testing these and\n") + "then up to another ".concat(Math.round(WINDOW.FontAwesomeDetection.resultsCollectionMaxWait / 10) / 100, " to allow the browser time\n") + "to accumulate the results. But we'll probably be outta here way before then.\n\n");
|
936
|
+
console.info("You can adjust those durations by assigning values to these attributes on the <script> element that loads this detection:");
|
937
|
+
console.info("\t%c".concat(timeoutAttr, "%c: milliseconds to wait for each test before deciding whether it's a conflict."), 'font-weight: bold;', 'font-size: normal;');
|
938
|
+
console.info("\t%c".concat(resultsCollectionMaxWaitAttr, "%c: milliseconds to wait for the browser to accumulate test results before giving up."), 'font-weight: bold;', 'font-size: normal;');
|
939
|
+
pollUntil({
|
940
|
+
// Give this overall timer a little extra cushion
|
941
|
+
maxDuration: masterTimeout,
|
942
|
+
showProgress: true,
|
943
|
+
progressIndicator: 'waiting...',
|
944
|
+
fn: function fn() {
|
945
|
+
return Object.keys(nodesTested.conflict).length + Object.keys(nodesTested.noConflict).length >= testCount;
|
946
|
+
}
|
947
|
+
}).then(function () {
|
948
|
+
console.info('DONE!');
|
949
|
+
setDoneResults({
|
950
|
+
nodesTested: nodesTested,
|
951
|
+
nodesFound: nodesFound
|
952
|
+
});
|
953
|
+
report$$1({
|
954
|
+
nodesTested: nodesTested,
|
955
|
+
nodesFound: nodesFound
|
956
|
+
});
|
957
|
+
console.groupEnd();
|
958
|
+
}).catch(function (e) {
|
959
|
+
if (e === 'timeout') {
|
960
|
+
console.info('TIME OUT! We waited until we got tired. Here\'s what we found:');
|
961
|
+
setDoneResults({
|
962
|
+
nodesTested: nodesTested,
|
963
|
+
nodesFound: nodesFound
|
964
|
+
});
|
965
|
+
report$$1({
|
966
|
+
nodesTested: nodesTested,
|
967
|
+
nodesFound: nodesFound
|
968
|
+
});
|
969
|
+
} else {
|
970
|
+
console.info('Whoops! We hit an error:', e);
|
971
|
+
console.info('Here\'s what we\'d found up until that error:');
|
972
|
+
setDoneResults({
|
973
|
+
nodesTested: nodesTested,
|
974
|
+
nodesFound: nodesFound
|
975
|
+
});
|
976
|
+
report$$1({
|
977
|
+
nodesTested: nodesTested,
|
978
|
+
nodesFound: nodesFound
|
979
|
+
});
|
980
|
+
}
|
981
|
+
|
982
|
+
console.groupEnd();
|
983
|
+
});
|
984
|
+
}
|
985
|
+
} // Allow clients to access, and in some cases, override some properties
|
986
|
+
|
987
|
+
var initialConfig = WINDOW.FontAwesomeDetection || {}; // These can be overridden
|
988
|
+
|
989
|
+
var _default = {
|
990
|
+
report: report,
|
991
|
+
timeout: +(DOCUMENT.currentScript.getAttribute(timeoutAttr) || "2000"),
|
992
|
+
resultsCollectionMaxWait: +(DOCUMENT.currentScript.getAttribute(resultsCollectionMaxWaitAttr) || "5000")
|
993
|
+
};
|
994
|
+
|
995
|
+
var _config = _objectSpread2(_objectSpread2(_objectSpread2({}, _default), initialConfig), {}, {
|
996
|
+
// These cannot be overridden
|
997
|
+
__pollUntil: pollUntil,
|
998
|
+
md5ForNode: md5ForNode,
|
999
|
+
detectionDone: false,
|
1000
|
+
nodesTested: null,
|
1001
|
+
nodesFound: null
|
1002
|
+
});
|
1003
|
+
|
1004
|
+
WINDOW.FontAwesomeDetection = _config;
|
1005
|
+
|
1006
|
+
var _familyProxy, _familyProxy2, _familyProxy3, _familyProxy4, _familyProxy5;
|
1007
|
+
var PRODUCTION = function () {
|
1008
|
+
try {
|
1009
|
+
return process.env.NODE_ENV === 'production';
|
1010
|
+
} catch (e) {
|
1011
|
+
return false;
|
1012
|
+
}
|
1013
|
+
}();
|
1014
|
+
var FAMILY_CLASSIC = 'classic';
|
1015
|
+
var FAMILY_SHARP = 'sharp';
|
1016
|
+
var FAMILIES = [FAMILY_CLASSIC, FAMILY_SHARP];
|
1017
|
+
|
1018
|
+
function familyProxy(obj) {
|
1019
|
+
// Defaults to the classic family if family is not available
|
1020
|
+
return new Proxy(obj, {
|
1021
|
+
get: function get(target, prop) {
|
1022
|
+
return prop in target ? target[prop] : target[FAMILY_CLASSIC];
|
1023
|
+
}
|
1024
|
+
});
|
1025
|
+
}
|
1026
|
+
var PREFIX_TO_STYLE = familyProxy((_familyProxy = {}, _defineProperty(_familyProxy, FAMILY_CLASSIC, {
|
1027
|
+
'fa': 'solid',
|
1028
|
+
'fas': 'solid',
|
1029
|
+
'fa-solid ': 'solid',
|
1030
|
+
'far': 'regular',
|
1031
|
+
'fa-regular': 'regular',
|
1032
|
+
'fal': 'light',
|
1033
|
+
'fa-light': 'light',
|
1034
|
+
'fat': 'thin',
|
1035
|
+
'fa-thin': 'thin',
|
1036
|
+
'fad': 'duotone',
|
1037
|
+
'fa-duotone': 'duotone',
|
1038
|
+
'fab': 'brands',
|
1039
|
+
'fa-brands': 'brands',
|
1040
|
+
'fak': 'kit',
|
1041
|
+
'fa-kit': 'kit'
|
1042
|
+
}), _defineProperty(_familyProxy, FAMILY_SHARP, {
|
1043
|
+
'fa': 'solid',
|
1044
|
+
'fass': 'solid',
|
1045
|
+
'fa-solid ': 'solid',
|
1046
|
+
'fasr': 'regular',
|
1047
|
+
'fa-regular': 'regular',
|
1048
|
+
'fasl': 'light',
|
1049
|
+
'fa-light': 'light'
|
1050
|
+
}), _familyProxy));
|
1051
|
+
var STYLE_TO_PREFIX = familyProxy((_familyProxy2 = {}, _defineProperty(_familyProxy2, FAMILY_CLASSIC, {
|
1052
|
+
'solid': 'fas',
|
1053
|
+
'regular': 'far',
|
1054
|
+
'light': 'fal',
|
1055
|
+
'thin': 'fat',
|
1056
|
+
'duotone': 'fad',
|
1057
|
+
'brands': 'fab',
|
1058
|
+
'kit': 'fak'
|
1059
|
+
}), _defineProperty(_familyProxy2, FAMILY_SHARP, {
|
1060
|
+
'solid': 'fass',
|
1061
|
+
'regular': 'fasr',
|
1062
|
+
'light': 'fasl'
|
1063
|
+
}), _familyProxy2));
|
1064
|
+
var PREFIX_TO_LONG_STYLE = familyProxy((_familyProxy3 = {}, _defineProperty(_familyProxy3, FAMILY_CLASSIC, {
|
1065
|
+
'fab': 'fa-brands',
|
1066
|
+
'fad': 'fa-duotone',
|
1067
|
+
'fak': 'fa-kit',
|
1068
|
+
'fal': 'fa-light',
|
1069
|
+
'far': 'fa-regular',
|
1070
|
+
'fas': 'fa-solid ',
|
1071
|
+
'fat': 'fa-thin'
|
1072
|
+
}), _defineProperty(_familyProxy3, FAMILY_SHARP, {
|
1073
|
+
'fass': 'fa-solid ',
|
1074
|
+
'fasr': 'fa-regular',
|
1075
|
+
'fasl': 'fa-light'
|
1076
|
+
}), _familyProxy3));
|
1077
|
+
var LONG_STYLE_TO_PREFIX = familyProxy((_familyProxy4 = {}, _defineProperty(_familyProxy4, FAMILY_CLASSIC, {
|
1078
|
+
'fa-brands': 'fab',
|
1079
|
+
'fa-duotone': 'fad',
|
1080
|
+
'fa-kit': 'fak',
|
1081
|
+
'fa-light': 'fal',
|
1082
|
+
'fa-regular': 'far',
|
1083
|
+
'fa-solid ': 'fas',
|
1084
|
+
'fa-thin': 'fat'
|
1085
|
+
}), _defineProperty(_familyProxy4, FAMILY_SHARP, {
|
1086
|
+
'fa-solid ': 'fass',
|
1087
|
+
'fa-regular': 'fasr',
|
1088
|
+
'fa-light': 'fasl'
|
1089
|
+
}), _familyProxy4));
|
1090
|
+
var FONT_WEIGHT_TO_PREFIX = familyProxy((_familyProxy5 = {}, _defineProperty(_familyProxy5, FAMILY_CLASSIC, {
|
1091
|
+
'900': 'fas',
|
1092
|
+
'400': 'far',
|
1093
|
+
'normal': 'far',
|
1094
|
+
'300': 'fal',
|
1095
|
+
'100': 'fat'
|
1096
|
+
}), _defineProperty(_familyProxy5, FAMILY_SHARP, {
|
1097
|
+
'900': 'fass',
|
1098
|
+
'400': 'fasr',
|
1099
|
+
'300': 'fasl'
|
1100
|
+
}), _familyProxy5));
|
1101
|
+
var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
|
1102
|
+
var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
|
1103
|
+
var DUOTONE_CLASSES = {
|
1104
|
+
GROUP: 'duotone-group',
|
1105
|
+
SWAP_OPACITY: 'swap-opacity',
|
1106
|
+
PRIMARY: 'primary',
|
1107
|
+
SECONDARY: 'secondary'
|
1108
|
+
};
|
1109
|
+
var prefixes = new Set();
|
1110
|
+
Object.keys(STYLE_TO_PREFIX[FAMILY_CLASSIC]).map(prefixes.add.bind(prefixes));
|
1111
|
+
Object.keys(STYLE_TO_PREFIX[FAMILY_SHARP]).map(prefixes.add.bind(prefixes));
|
1112
|
+
var RESERVED_CLASSES = [].concat(FAMILIES, _toConsumableArray(prefixes), ['2xs', 'xs', 'sm', 'lg', 'xl', '2xl', 'beat', 'border', 'fade', 'beat-fade', 'bounce', 'flip-both', 'flip-horizontal', 'flip-vertical', 'flip', 'fw', 'inverse', 'layers-counter', 'layers-text', 'layers', 'li', 'pull-left', 'pull-right', 'pulse', 'rotate-180', 'rotate-270', 'rotate-90', 'rotate-by', 'shake', 'spin-pulse', 'spin-reverse', 'spin', 'stack-1x', 'stack-2x', 'stack', 'ul', DUOTONE_CLASSES.GROUP, DUOTONE_CLASSES.SWAP_OPACITY, DUOTONE_CLASSES.PRIMARY, DUOTONE_CLASSES.SECONDARY]).concat(oneToTen.map(function (n) {
|
1113
|
+
return "".concat(n, "x");
|
1114
|
+
})).concat(oneToTwenty.map(function (n) {
|
1115
|
+
return "w-".concat(n);
|
1116
|
+
}));
|
1117
|
+
|
1118
|
+
function bunker(fn) {
|
1119
|
+
try {
|
1120
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
1121
|
+
args[_key - 1] = arguments[_key];
|
1122
|
+
}
|
1123
|
+
|
1124
|
+
fn.apply(void 0, args);
|
1125
|
+
} catch (e) {
|
1126
|
+
if (!PRODUCTION) {
|
1127
|
+
throw e;
|
1128
|
+
}
|
1129
|
+
}
|
1130
|
+
}
|
1131
|
+
|
1132
|
+
bunker(function () {
|
1133
|
+
if (IS_BROWSER && IS_DOM) {
|
1134
|
+
conflictDetection(window.FontAwesomeDetection.report);
|
1135
|
+
}
|
1136
|
+
});
|
1137
|
+
|
1138
|
+
})));
|