Version Description
Release date: February 02, 2022
Changelog: - Clicking on the buttons in the editor preview now opens it's settings page - New: Hold CTRL + click to test the button action - Fixed an issue where the label is not visible when using "Place label inside button" - Fixed an issue where using a different language on PHP 8.0 or higher crashes the editor - Fixed bug in the tour - Fixed an issue with box shadows - Fixed new group/button pulse animation - Fixed a bug with opening groups - Renewed copy URL to clipboard functions - Many UI and UX improvements - Removed unused code
If you experience bugs, problems or you just have some feedback, let us know on our Buttonizer community!
Download this release
Release Info
Developer | buttonizer |
Plugin | Smart Floating / Sticky Buttons – Call, Sharing, Chat Widgets & More – Buttonizer |
Version | 2.6.1 |
Comparing to | |
See all releases |
Code changes from version 2.6.0 to 2.6.1
- app/Admin/Admin.php +20 -3
- assets/dashboard.css +8 -6
- assets/dashboard.js +13989 -9079
app/Admin/Admin.php
CHANGED
@@ -160,6 +160,8 @@ class Admin
|
|
160 |
'nonce' => wp_create_nonce( 'wp_rest' ),
|
161 |
'version' => BUTTONIZER_VERSION,
|
162 |
'dir' => plugins_url( '', BUTTONIZER_PLUGIN_DIR ),
|
|
|
|
|
163 |
'assets' => plugins_url( '/assets', BUTTONIZER_PLUGIN_DIR ),
|
164 |
'security' => wp_create_nonce( "save_buttonizer" ),
|
165 |
'fontawesome_current_version' => FONTAWESOME_CURRENT_VERSION,
|
@@ -170,13 +172,28 @@ class Admin
|
|
170 |
'php_version' => PHP_VERSION,
|
171 |
'migration_version' => BUTTONIZER_LAST_MIGRATION,
|
172 |
] );
|
173 |
-
// Buttonizer translations
|
174 |
-
$set = ( new Translations() )->get();
|
175 |
-
wp_localize_script( 'buttonizer_admin_js', 'buttonizer_translations', $set );
|
176 |
wp_enqueue_script( 'buttonizer_admin_js' );
|
177 |
// Import our own template
|
178 |
require_once BUTTONIZER_DIR . '/app/Admin/template.php';
|
179 |
exit;
|
180 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
181 |
|
182 |
}
|
160 |
'nonce' => wp_create_nonce( 'wp_rest' ),
|
161 |
'version' => BUTTONIZER_VERSION,
|
162 |
'dir' => plugins_url( '', BUTTONIZER_PLUGIN_DIR ),
|
163 |
+
'localePath' => plugins_url( '/locale', BUTTONIZER_PLUGIN_DIR ),
|
164 |
+
'locale' => $this->getEditorLanguage(),
|
165 |
'assets' => plugins_url( '/assets', BUTTONIZER_PLUGIN_DIR ),
|
166 |
'security' => wp_create_nonce( "save_buttonizer" ),
|
167 |
'fontawesome_current_version' => FONTAWESOME_CURRENT_VERSION,
|
172 |
'php_version' => PHP_VERSION,
|
173 |
'migration_version' => BUTTONIZER_LAST_MIGRATION,
|
174 |
] );
|
|
|
|
|
|
|
175 |
wp_enqueue_script( 'buttonizer_admin_js' );
|
176 |
// Import our own template
|
177 |
require_once BUTTONIZER_DIR . '/app/Admin/template.php';
|
178 |
exit;
|
179 |
}
|
180 |
+
|
181 |
+
private function getEditorLanguage()
|
182 |
+
{
|
183 |
+
switch ( get_locale() ) {
|
184 |
+
case "nl_NL":
|
185 |
+
return "nl";
|
186 |
+
case "it_IT":
|
187 |
+
return "it";
|
188 |
+
case "pt_BR":
|
189 |
+
return "pt_br";
|
190 |
+
case "ro_RO":
|
191 |
+
return "ro_ro";
|
192 |
+
case "tr_TR":
|
193 |
+
return "tr_tr";
|
194 |
+
default:
|
195 |
+
return 'en';
|
196 |
+
}
|
197 |
+
}
|
198 |
|
199 |
}
|
assets/dashboard.css
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*
|
10 |
* Buttonizer is Freemium software. The free version (build) does not contain premium functionality.
|
11 |
*
|
12 |
-
* (C) 2017-2022 Buttonizer v2.6.
|
13 |
*
|
14 |
*/
|
15 |
/*!
|
@@ -23,7 +23,7 @@
|
|
23 |
*
|
24 |
* Buttonizer is Freemium software. The free version (build) does not contain premium functionality.
|
25 |
*
|
26 |
-
* (C) 2017-2022 Buttonizer v2.6.
|
27 |
*
|
28 |
*/
|
29 |
@import url(https://fonts.googleapis.com/css?family=Roboto:400,500,700&display=swap);
|
@@ -36,7 +36,7 @@
|
|
36 |
.knowledgebase-link{color:#2f7789;text-decoration:none}.knowledgebase-link.medium{font-size:14px !important}.knowledgebase-link.small{font-size:12px !important}.knowledgebase-link:hover{text-decoration:underline}.knowledgebase-icon{color:#2f7789}
|
37 |
.button-container{margin:0 0 13px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;padding:10px;border:1px solid #e2e2e2;background-color:#fff}.button-container .button-name{max-width:100%}.button-container .button-name .button-name-span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;max-width:100%}.button-container .button-name.drag-icon{min-width:10px}.button-container .button-header{display:flex}.button-container .button-header .button-actions{margin-left:auto;flex-shrink:0}.button-container .button-settings{display:flex}.button-container .button-settings .button-title{display:inline-flex;height:30px;align-items:center;margin-right:10px;font-size:14px}.button-container .button-settings button{height:30px}.button-container .button-settings .button-visibility{flex-grow:1}.button-container .button-settings .button-visibility button{width:40px;min-width:40px;margin:0 2px}.button-container .button-settings .button-actions button{min-width:35px}.button-container .button-settings .clear{clear:both}
|
38 |
#group-button-extra-buttons div[class^=MuiListItemIcon-root]{min-width:45px}#group-button-extra-buttons div[class^=MuiListItemIcon-root] .fas,#group-button-extra-buttons div[class^=MuiListItemIcon-root] .far{overflow:unset;font-size:1rem;margin-left:5px;text-align:center}
|
39 |
-
.button-group-container{padding:10px;margin-bottom:15px;border:2px #fff solid;position:relative}.button-group-container.currentDrop{border:2px #f9bf87 solid}.button-group-container .group-info{display:flex}.button-group-container .group-info .group-arrow{display:inline-block;min-width:17px;text-align:left;font-size:12px}.button-group-container .group-info .group-arrow i{-webkit-transition:all 150ms ease;-moz-transition:all 150ms ease;-ms-transition:all 150ms ease;-o-transition:all 150ms ease;transition:all 150ms ease}.button-group-container .group-info .group-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block}.button-group-container .group-info .group-action-spacer{flex-grow:1}.button-group-container .group-info .group-actions{flex-grow:0;flex-shrink:0;margin-left:20px}.button-group-container .buttons{display:none}.button-group-container.opened .group-info .group-arrow i{transform:rotate(90deg)}.button-group-container.opened .buttons{display:block;border-radius:10px;padding:10px;border:2px #fff solid;transition:border .5s}.button-group-container.opened .buttons.currentDrop{border:2px #f9bf87 solid}.button-group-container.opened .buttons.currentDrop .button-container{opacity:.5}.button-group-container.opened .buttons.currentDrop .button-container.currentDrag{opacity:1}.button-group-container.new-group::before,.button-group-container.new-group::after{content:"";position:absolute;
|
40 |
.templates-dialog ::-webkit-scrollbar{width:10px}.templates-dialog ::-webkit-scrollbar-track{background:#f1f1f1}.templates-dialog ::-webkit-scrollbar-thumb{background:#888}.templates-dialog ::-webkit-scrollbar-thumb:hover{background:#555}.templates-dialog .MuiDialog-paperFullWidth{padding:30px}.templates-dialog .MuiButton-outlined{background-color:#fff;color:#2a7688;border:1px solid #73a8b4}.templates-dialog .header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;position:relative}.templates-dialog .header .titles h2{color:#2a7688;text-transform:uppercase;font-size:32px}.templates-dialog .header .titles .title{padding:0}.templates-dialog .header .titles .subtitle{margin:0;color:#2a7688;font-weight:normal;font-size:18px}.templates-dialog .header .close-button{cursor:pointer;font-size:24px;color:#2a7688;position:absolute;right:0;top:0}.templates-dialog .container-filter-buttons{padding:8px 55px 0px 24px}.templates-dialog .container-filter-buttons .midsection{display:flex;align-items:center;margin:20px 0 40px;padding:0;border:none;overflow:visible}.templates-dialog .container-filter-buttons .midsection .button-group{min-width:fit-content}.templates-dialog .container-filter-buttons .midsection .button-group .buttons-numbers{margin:10px 20px 20px 0;display:flex}.templates-dialog .container-filter-buttons .midsection .button-group .buttons-numbers .current{background-color:#fce8d4;color:#f08419;border:1px solid #f08419}.templates-dialog .select-all{opacity:0;visibility:hidden}.templates-dialog .select-all.visible{opacity:1;visibility:visible}.search-results{position:absolute;margin-top:-30px}.loading{text-align:center;height:500px;justify-content:center;display:flex}.loading p{font-family:Arial,"Helvetica Neue"}.template{display:grid;grid-template-columns:repeat(auto-fit, 202px);grid-gap:1.5rem;grid-template-rows:repeat(6, 177px);height:500px}.template .type{border:1px solid #2a7688;height:175px;width:200px;color:#2a7688;position:relative;border-radius:5px;display:flex;cursor:pointer;grid-column:1;grid-row:1}.template .type img{max-width:100%;margin:auto;max-height:85%;user-select:none}.template .type .category{position:absolute;top:15px;right:10px;font-size:12px}.template .type .default-option{width:100%;display:flex;align-items:center;flex-direction:column;font-size:14px;align-self:center}.template .type .default-option .fa-plus-circle{font-size:40px;margin-bottom:12px}.template .container{display:grid}.template .container .checkbox{margin:10px 0;transition:all .2s ease-in-out;opacity:1;grid-column:1;grid-row:1;height:24px;width:24px;margin:5px;z-index:1}.template .container .checkbox.hidden{opacity:0;visibility:hidden}.template .container .select{visibility:hidden;opacity:0;display:flex;align-items:center;position:absolute;bottom:0;grid-column-gap:5px;padding:5px 15px;border-top:1px solid #2a7688;border-right:1px solid #2a7688;border-top-right-radius:3px;border-bottom-right-radius:3px;border-top-left-radius:3px;font-size:13px;transition:all .2s ease-in-out}.template .container:hover .select{visibility:visible;opacity:1}.template .container:hover .checkbox.hidden{opacity:1;visibility:visible}
|
41 |
.buttonizer-premium{background:#2d7688;background:-moz-linear-gradient(-45deg, #2d7688 0%, #187287 50%, #187287 50%, #f0841a 51%, #e8832c 98%);background:-webkit-linear-gradient(-45deg, #2d7688 0%, #187287 50%, #187287 50%, #f0841a 51%, #e8832c 98%);background:linear-gradient(135deg, #2d7688 0%, #187287 50%, #187287 50%, #f0841a 51%, #e8832c 98%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr="#2d7688", endColorstr="#e8832c",GradientType=1 );color:#fff;font-weight:500;font-size:13px;line-height:17px;padding:4px 20px;display:inline-block;vertical-align:middle;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;margin-left:10px}.buttonizer-premium.premium-right{position:absolute;right:30px;top:19px;z-index:9}.buttonizer-premium::after{content:"PRO"}.MuiFormControl-root:not(.MuiTextField-root) .buttonizer-premium{margin-right:15px}
|
42 |
.item-not-found{text-align:center;padding:40px 0}.item-not-found i{font-size:50px;display:block;margin:30px auto}.item-not-found h4{font-size:15px;margin:28px 0}
|
@@ -46,11 +46,12 @@
|
|
46 |
.settings-container{display:flex;position:relative;margin:15px 0}.settings-container.disabled{opacity:.5;user-select:none}.settings-title{padding-right:15px;padding:4.9px 15px 4.9px 0;margin-right:auto;flex-shrink:0;font-size:14px}.settings-title span,.settings-title i{padding-left:5px;font-size:14px;line-height:14px}.settings-content{display:flex;flex-shrink:1;align-self:center}.container-full-width .settings-content{width:66.666%}
|
47 |
.desktop-mobile-visibility button{min-width:40px;width:40px}.desktop-mobile-visibility button.buttonMobile{margin-right:5px}
|
48 |
.button-action-value a,.button-action-subject a{font-size:14px !important;text-decoration:none;color:#2f7789}.button-action-value .MuiTextField-root,.button-action-subject .MuiTextField-root{margin-bottom:15px}.button-action-value .MuiTextField-root label,.button-action-subject .MuiTextField-root label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.button-action-value .MuiTextField-root label:not(.Mui-focused),.button-action-subject .MuiTextField-root label:not(.Mui-focused){width:92%}
|
|
|
49 |
.button-action .button-action-type{padding-bottom:20px}.button-action code{padding:3px 5px 2px 5px;margin:0 1px;background:rgba(0,0,0,.07)}
|
50 |
.form-icon-selector .selector{overflow:hidden;border-radius:4px;cursor:pointer;width:100%}.form-icon-selector .selector .viewer{width:100%;height:65px;background-color:#ddd;display:block;border-radius:0 0 4px 4px;color:#fff;text-align:center}.form-icon-selector .selector span{border-radius:0 0 4px 4px;display:block;color:#fff;text-align:center}
|
51 |
-
.color-picker-main{width:100%;display:flex;justify-content:flex-end}.color-picker-main .color-picker{display:flex;width:100%;cursor:pointer;justify-content:flex-end;height:28px}.color-picker-main .color-picker .gpw{width:100%;background:url(./images/transparent.png) repeat;border-radius:5px 0 0 5px;box-shadow:0 1px 1px 0 rgba(60,64,67,.08),0 1px 3px 1px rgba(60,64,67,.16);overflow:hidden;padding:0}.color-picker-main .color-picker .gpw span.color-preview{display:block;height:100%;background:#f08419}.color-picker-main .color-picker .color-button{height:100%;border-radius:0 5px 5px 0;margin-left:1px;margin-right:0px;box-shadow:0 1px 1px 0 rgba(60,64,67,.08),0 1px 3px 1px rgba(60,64,67,.16)}.color-picker-main.small .color-picker{display:inline-flex;width:100%;cursor:pointer;justify-content:flex-end;height:28px}.color-picker-main.small .color-picker .gpw{position:absolute;max-width:92px;border-radius:5px;height:inherit}.color-picker-main.small .color-picker .color-button{height:100%;border-radius:5px;
|
52 |
.color-picker-container{width:300px;max-width:100%}.color-picker-container .color-container{background:url(./images/transparent.png) repeat}.color-picker-container .color-container .current-color input{height:62px;line-height:62px;text-align:center;color:#fff;font-size:18px;font-weight:500;border:0;padding:0;background:rgba(0,0,0,0);width:100%;border-radius:0;outline:none;font-family:Roboto,sans-serif}.color-picker-container .buttons{text-align:right;padding:5px 10px 10px}.color-picker-container .buttons button{margin-left:5px}.no-select-color-container{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
53 |
-
.slider-container{margin-bottom:15px}.slider-container-input{margin-left:20px;height:28px;max-width:78px;flex-shrink:0}.slider-container-input input{font-size:14px}.slider-container-input input::-webkit-outer-spin-button,.slider-container-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.slider-container-input input[type=number]{-moz-appearance:textfield}
|
54 |
.disable-setting.disabled{position:relative}.disable-setting.disabled .settings{opacity:.5;pointer-events:none}.disable-setting.disabled .disable-content{position:absolute;bottom:0;top:0;left:0;right:0;text-align:center;max-width:100%;color:#2f7789;font-weight:900;display:flex;align-items:center;user-select:none}.disable-setting.disabled .disable-content .buttonizer-premium{margin-right:30px;margin-left:auto}
|
55 |
.textfield-corners-input{height:100%;max-width:80px;padding-right:5px !important;margin:0 !important}.textfield-corners-input.textfield-corners-select{max-width:35px}.textfield-corners-input .MuiSelect-root{font-size:12px;padding:5px 12px 5px 8px !important}.textfield-corners-input .MuiSvgIcon-root{font-size:1rem;right:0;top:50%;transform:translateY(-50%)}.textfield-corners-input input{font-size:14px;padding:5px 8px}.textfield-corners-input input::-webkit-outer-spin-button,.textfield-corners-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.textfield-corners-input input[type=number]{-moz-appearance:textfield}.textfield-corners-input .MuiInputAdornment-root{margin-left:5px}.textfield-corners-input .MuiInputAdornment-root>p{font-size:14px}.textfield-corners-menu li{padding-left:8px;padding-right:8px;font-size:14px}
|
56 |
.box-shadow-input{height:100%;max-width:50px;padding-right:5px !important;margin:0 !important}.box-shadow-input .MuiOutlinedInput-adornedEnd{padding-right:5px}.box-shadow-input .MuiOutlinedInput-adornedEnd input{font-size:14px;padding:7px 5px}.box-shadow-input .MuiOutlinedInput-adornedEnd input::-webkit-outer-spin-button,.box-shadow-input .MuiOutlinedInput-adornedEnd input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.box-shadow-input .MuiOutlinedInput-adornedEnd input[type=number]{-moz-appearance:textfield}.box-shadow-input .MuiOutlinedInput-adornedEnd .box-shadow-input-adornment{color:rgba(0,0,0,.54);font-size:.7rem}.box-shadow-input .MuiInputAdornment-root{margin-left:5px}.box-shadow-input .MuiInputAdornment-root>p{font-size:14px}
|
@@ -703,6 +704,7 @@ tr.introjs-showElement > th {
|
|
703 |
.tourDialog,.videoDialog,.centerTopDialog,.centerBottomDialog,.centerVideoDialog{padding:15px;min-width:400px;background-color:#d7e5e9;background-repeat:no-repeat;background-image:url(./images/buttonizer-logo.png);background-position:left 30px bottom 20px;background-size:50px}.tourDialog .introjs-tooltip-header,.videoDialog .introjs-tooltip-header,.centerTopDialog .introjs-tooltip-header,.centerBottomDialog .introjs-tooltip-header,.centerVideoDialog .introjs-tooltip-header{position:relative}.tourDialog .introjs-tooltip-header .introjs-tooltip-title,.videoDialog .introjs-tooltip-header .introjs-tooltip-title,.centerTopDialog .introjs-tooltip-header .introjs-tooltip-title,.centerBottomDialog .introjs-tooltip-header .introjs-tooltip-title,.centerVideoDialog .introjs-tooltip-header .introjs-tooltip-title{font-size:22px;color:#2f788a}.tourDialog .introjs-tooltip-header .introjs-skipbutton,.videoDialog .introjs-tooltip-header .introjs-skipbutton,.centerTopDialog .introjs-tooltip-header .introjs-skipbutton,.centerBottomDialog .introjs-tooltip-header .introjs-skipbutton,.centerVideoDialog .introjs-tooltip-header .introjs-skipbutton{color:#000;padding:5px;position:absolute;right:0;top:0}.tourDialog .introjs-tooltiptext,.videoDialog .introjs-tooltiptext,.centerTopDialog .introjs-tooltiptext,.centerBottomDialog .introjs-tooltiptext,.centerVideoDialog .introjs-tooltiptext{font-size:14px;color:#000}.tourDialog .introjs-tooltiptext a,.videoDialog .introjs-tooltiptext a,.centerTopDialog .introjs-tooltiptext a,.centerBottomDialog .introjs-tooltiptext a,.centerVideoDialog .introjs-tooltiptext a{color:#000;text-decoration:none}.tourDialog .introjs-tooltiptext #myVideo,.videoDialog .introjs-tooltiptext #myVideo,.centerTopDialog .introjs-tooltiptext #myVideo,.centerBottomDialog .introjs-tooltiptext #myVideo,.centerVideoDialog .introjs-tooltiptext #myVideo{width:100%;margin-top:-25px}.tourDialog .introjs-tooltiptext h2,.videoDialog .introjs-tooltiptext h2,.centerTopDialog .introjs-tooltiptext h2,.centerBottomDialog .introjs-tooltiptext h2,.centerVideoDialog .introjs-tooltiptext h2{color:#2f788a;margin:50px 0 10px}.tourDialog .introjs-progress,.videoDialog .introjs-progress,.centerTopDialog .introjs-progress,.centerBottomDialog .introjs-progress,.centerVideoDialog .introjs-progress{margin:20px;height:5px;background-color:#fff}.tourDialog .introjs-progress .introjs-progressbar,.videoDialog .introjs-progress .introjs-progressbar,.centerTopDialog .introjs-progress .introjs-progressbar,.centerBottomDialog .introjs-progress .introjs-progressbar,.centerVideoDialog .introjs-progress .introjs-progressbar{background-color:gray}.tourDialog .introjs-tooltipbuttons,.videoDialog .introjs-tooltipbuttons,.centerTopDialog .introjs-tooltipbuttons,.centerBottomDialog .introjs-tooltipbuttons,.centerVideoDialog .introjs-tooltipbuttons{border:none;margin-top:20px;float:right;display:flex;align-items:center}.tourDialog .introjs-tooltipbuttons .introjs-prevbutton,.tourDialog .introjs-tooltipbuttons .introjs-nextbutton,.videoDialog .introjs-tooltipbuttons .introjs-prevbutton,.videoDialog .introjs-tooltipbuttons .introjs-nextbutton,.centerTopDialog .introjs-tooltipbuttons .introjs-prevbutton,.centerTopDialog .introjs-tooltipbuttons .introjs-nextbutton,.centerBottomDialog .introjs-tooltipbuttons .introjs-prevbutton,.centerBottomDialog .introjs-tooltipbuttons .introjs-nextbutton,.centerVideoDialog .introjs-tooltipbuttons .introjs-prevbutton,.centerVideoDialog .introjs-tooltipbuttons .introjs-nextbutton{border:none;text-shadow:none;text-transform:uppercase;font-weight:bolder;font-size:12px}.tourDialog .introjs-tooltipbuttons .introjs-prevbutton,.videoDialog .introjs-tooltipbuttons .introjs-prevbutton,.centerTopDialog .introjs-tooltipbuttons .introjs-prevbutton,.centerBottomDialog .introjs-tooltipbuttons .introjs-prevbutton,.centerVideoDialog .introjs-tooltipbuttons .introjs-prevbutton{color:#2f788a;background:none}.tourDialog .introjs-tooltipbuttons .introjs-nextbutton,.videoDialog .introjs-tooltipbuttons .introjs-nextbutton,.centerTopDialog .introjs-tooltipbuttons .introjs-nextbutton,.centerBottomDialog .introjs-tooltipbuttons .introjs-nextbutton,.centerVideoDialog .introjs-tooltipbuttons .introjs-nextbutton{color:#fff;background-color:#ef790c;box-shadow:rgba(0,0,0,.24) 0px 3px 8px;margin-left:5px;padding:10px 15px}.tourDialog .introjs-arrow.left,.videoDialog .introjs-arrow.left,.centerTopDialog .introjs-arrow.left,.centerBottomDialog .introjs-arrow.left,.centerVideoDialog .introjs-arrow.left{border-right-color:#d7e5e9}.tourDialog .introjs-arrow.left-bottom,.videoDialog .introjs-arrow.left-bottom,.centerTopDialog .introjs-arrow.left-bottom,.centerBottomDialog .introjs-arrow.left-bottom,.centerVideoDialog .introjs-arrow.left-bottom{border-right-color:#d7e5e9}.tourDialog .introjs-arrow.right,.videoDialog .introjs-arrow.right,.centerTopDialog .introjs-arrow.right,.centerBottomDialog .introjs-arrow.right,.centerVideoDialog .introjs-arrow.right{border-left-color:#d7e5e9}.tourDialog .introjs-arrow.top,.videoDialog .introjs-arrow.top,.centerTopDialog .introjs-arrow.top,.centerBottomDialog .introjs-arrow.top,.centerVideoDialog .introjs-arrow.top{border-bottom-color:#d7e5e9}.tourDialog .introjs-arrow.top-middle,.videoDialog .introjs-arrow.top-middle,.centerTopDialog .introjs-arrow.top-middle,.centerBottomDialog .introjs-arrow.top-middle,.centerVideoDialog .introjs-arrow.top-middle{border-bottom-color:#d7e5e9}.tourDialog .introjs-arrow.bottom,.videoDialog .introjs-arrow.bottom,.centerTopDialog .introjs-arrow.bottom,.centerBottomDialog .introjs-arrow.bottom,.centerVideoDialog .introjs-arrow.bottom{border-top-color:#d7e5e9}.tourDialog .introjs-arrow.bottom-middle,.videoDialog .introjs-arrow.bottom-middle,.centerTopDialog .introjs-arrow.bottom-middle,.centerBottomDialog .introjs-arrow.bottom-middle,.centerVideoDialog .introjs-arrow.bottom-middle{border-top-color:#d7e5e9}.tourDialog .introjs-arrow.bottom-right,.videoDialog .introjs-arrow.bottom-right,.centerTopDialog .introjs-arrow.bottom-right,.centerBottomDialog .introjs-arrow.bottom-right,.centerVideoDialog .introjs-arrow.bottom-right{border-top-color:#d7e5e9}.videoDialog,.centerVideoDialog{background-image:url(./images/white-background.jpg);background-position:inherit;background-size:620px}.centerTopDialog,.centerVideoDialog{margin-top:20px}.centerBottomDialog{margin:-20px;margin-left:0}
|
704 |
.changelog-dialog ::-webkit-scrollbar{width:10px}.changelog-dialog ::-webkit-scrollbar-track{background:#f1f1f1}.changelog-dialog ::-webkit-scrollbar-thumb{background:#888}.changelog-dialog ::-webkit-scrollbar-thumb:hover{background:#555}.changelog-dialog img{margin-top:-8px}.changelog-dialog .close-down{position:absolute;color:#2f7789;cursor:pointer;margin:5px;right:0;font-size:20px;width:38px;height:38px}.changelog-dialog .MuiDialogTitle-root{padding-bottom:0}.changelog-dialog h2{color:#2f7789;font-size:28px}.changelog-dialog .content{padding:0 24px;margin-bottom:20px}.changelog-dialog .content h3{font-size:20px;color:#535353;font-weight:500;margin:25px 0 10px}.changelog-dialog .content .list ul{margin:0;padding-left:20px;color:#535353}.changelog-dialog .content .list .name{font-weight:500}.changelog-dialog .content .list .info{margin-bottom:10px}.changelog-dialog .progress-bar{display:flex;align-items:center;margin:0 200px}.changelog-dialog .progress-bar .dot{height:10px;width:10px;background-color:#f0f0f0;border-radius:50%;margin:0 3px}.changelog-dialog .footer{flex-direction:column}.changelog-dialog .footer .primary-button{margin:10px auto}.changelog-dialog .footer .pagination{display:flex;margin:20px 0}.changelog-dialog .footer .pagination .previous,.changelog-dialog .footer .pagination .next{background:#f0f0f0;color:#f08419;font-size:14px;cursor:pointer;width:38px;height:38px}.changelog-dialog .footer .external-link{color:#2f7789;font-size:14px;margin-bottom:10px;border-radius:unset}.changelog-dialog .footer .external-link .fa-external-link-alt{margin-left:10px;font-size:14px}.changelog-dialog .footer .version{font-size:12px;margin-bottom:20px}
|
705 |
.buzzy-urlbar{background:#f0f0f0;border-bottom:1px solid #d2d2d2;position:absolute;top:-65px;left:0;right:0;z-index:999;max-width:1300px;height:60px;transition:all 250ms ease-in-out}.buzzy-urlbar.ready{top:0}.whitten{background:#fff}@media screen and (min-width: 769px){body:not(.hide-buttonizer-bar) .buzzy-urlbar{left:431px}}@media screen and (max-width: 769px){body:not(.hide-buttonizer-bar) .buzzy-urlbar{display:none}}
|
|
|
706 |
.btnizr-wp-icon {
|
707 |
background: url(./images/wp-icon.png);
|
708 |
}
|
@@ -735,5 +737,5 @@ tr.introjs-showElement > th {
|
|
735 |
background: url(./videos/tour_style.mp4);
|
736 |
}
|
737 |
|
738 |
-
#wpadminbar,#adminmenumain{display:none}#wpcontent,#wpfooter{margin:0;padding:0}.buttonizer-admin-overlay{text-align:center;padding:40px 20px}.buttonizer-initialized .buttonizer-admin-overlay{display:none}html{padding:0 !important}.screen-reader-text{display:none}body.buttonizer-loaded{background:#191e23}.button.button-red{background:#ba0000;border-color:#a00 #900 #900;-webkit-box-shadow:0 1px 0 #900;box-shadow:0 1px 0 #900;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #900,1px 0 1px #900,0 1px 1px #900,-1px 0 1px #900}.button.button-red:hover{background:#c20000 !important;border-color:#900 !important;color:#fff}.button.button-red:active,.button.button-red:focus{background:#a00 !important;border-color:#900 !important;-webkit-box-shadow:inset 0 2px 0 #900;box-shadow:inset 0 2px 0 #900;vertical-align:top;color:#fff}.button.button-red.button-centered-reset{margin:0 auto;padding:4px 20px;height:auto;font-size:15px}.button.button-red.button-centered-reset i{margin-right:10px}.label-settings{display:flex}.label-settings .title{min-width:calc(100% / 3);width:calc(100% / 3)}.label-settings .mdc-slider{width:calc(100% /3)}.icon-settings{display:flex}.icon-settings .title{min-width:calc(100% / 3);width:calc(100% / 3)}.icon-settings .mdc-text-field.small{width:calc(100% / 3) !important;height:28px !important}.icon-settings .mdc-text-field.small .material-icons.mdc-text-field__icon.icon{bottom:9px !important;font-size:10px;margin-right:-8px}.icon-settings .mdc-text-field.small .material-icons.mdc-text-field__icon.text{bottom:6px !important;font-size:10px;margin-right:-9px}.icon-settings .mdc-text-field.small .mdc-text-field__input{padding:0;padding-left:16px !important;padding-right:24px !important;height:28px !important;font-size:14px !important}.buttonizer-preview{position:fixed;left:431px;right:0;top:0;bottom:0;transition:transform 250ms ease-in-out;padding-top:61px}.buttonizer-preview.is-wp-version{padding-top:0}@media screen and (max-width: 769px){.buttonizer-preview{left:0}}.buttonizer-preview.frame-size-tablet{width:720px;max-width:720px;left:50%;margin-left:-170px;right:unset;z-index:-1}.buttonizer-preview.frame-size-mobile{width:340px;height:650px;max-width:340px;top:50%;left:50%;margin-top:-300px;margin-left:15px;right:unset;z-index:-1}.buttonizer-preview iframe{transition:all 250ms ease-in-out}.buttonizer-preview iframe.waitfor{transform:scale(0.8);opacity:0}.hide-bar-button{display:block;position:fixed;left:429px;top:50%;cursor:pointer;margin-top:-30px;z-index:2;height:60px;line-height:60px;width:20px;border-radius:0 10px 10px 0;background:#f0f0f0;border:1px solid #d2d2d2;border-left:1px solid transparent !important;text-align:center;color:#5d5d5d !important;text-decoration:none;transition:all 250ms ease-out;-moz-transition:all 250ms ease-out;-webkit-transition:all 250ms ease-out}.hide-bar-button .fas{margin-left:-4px;color:#2f7789}@media screen and (max-width: 769px){.hide-bar-button{left:unset !important;right:0;top:40px;width:auto;height:auto;line-height:20px;border:0;background:unset;padding:0 20px}.hide-bar-button:before,.hide-bar-button:after{content:none !important}.hide-bar-button:focus{border-left:none !important}}.hide-bar-button .fa-chevron-right{display:none}.hide-bar-button:before{content:"";position:absolute;background-color:transparent;top:-20px;height:20px;width:10px;left:0;box-sizing:inherit;border-bottom-left-radius:10px;box-shadow:0 10px 0 0 #f0f0f0;border-bottom:1px solid #d2d2d2;border-left:1px solid #d2d2d2;transition:all 250ms ease-out;-moz-transition:all 250ms ease-out;-webkit-transition:all 250ms ease-out}.hide-bar-button:after{content:"";position:absolute;background-color:transparent;bottom:-20px;height:20px;width:10px;left:0;box-sizing:inherit;border-top-left-radius:10px;box-shadow:0 -10px 0 0 #f0f0f0;border-top:1px solid #d2d2d2;border-left:1px solid #d2d2d2;transition:all 250ms ease-out;-moz-transition:all 250ms ease-out;-webkit-transition:all 250ms ease-out}.hide-bar-button:focus{outline:none;outline-style:none;box-shadow:none;box-sizing:border-box;border-left:1px solid #f0f0f0}@media screen and (max-width: 769px){body.hide-buttonizer-bar .hide-bar-button{top:110px}}.buttonizer-app .buttonizer-bar,.buttonizer-app .buttonizer-preview,.buttonizer-app .hide-bar-button{transition:all 250ms ease-out;-moz-transition:all 250ms ease-out;-webkit-transition:all 250ms ease-out}@media screen and (max-width: 769px){body.buttonizer-mobile-hide .buttonizer-preview{transform:translateX(100%)}}body.hide-buttonizer-bar .buttonizer-app .buttonizer-bar{transform:translateX(-100%)}body.hide-buttonizer-bar .buttonizer-app .buttonizer-preview,body.hide-buttonizer-bar .buttonizer-app .hide-bar-button{left:-2px}body.hide-buttonizer-bar .buttonizer-app .fas{margin-left:-1px}body.hide-buttonizer-bar .buttonizer-app .hide-bar-button .fa-chevron-right{display:inline-block}body.hide-buttonizer-bar .buttonizer-app .hide-bar-button .fa-chevron-left{display:none}@media screen and (max-width: 769px){body.hide-buttonizer-bar .buttonizer-preview{transform:translateX(0)}}body{color:#717171}.mdc-card{border-radius:4px;background-color:#fff;display:flex;flex-direction:column;box-sizing:border-box;box-shadow:0 1px 1px 0 rgba(60,64,67,.08),0 1px 3px 1px rgba(60,64,67,.16)}.collapsible-group{margin:15px 0 !important}.collapsible-group .collapsible-body{padding:15px}.collapsible-group .collapsible-body .setting-group-title{font-size:13px;color:#888;text-transform:uppercase;font-weight:500}.collapsible-group .collapsible-body .setting-group-title~.setting-group-title{padding-top:10px}.collapsible-group .mdc-button.mdc-button--bold{font-size:13px}.MuiSelect-small .MuiSelect-select{font-size:14px;padding:9px 12px}.Mui-buzz-disabled{color:rgba(0,0,0,.26) !important;cursor:default !important}.Mui-buzz-premium.MuiButton-textPrimary{color:rgba(0,0,0,.26)}.Mui-buzz-premium.MuiButton-containedPrimary{background:rgba(0,0,0,.26)}.Mui-buzz-premium.MuiTabs-root .MuiTab-root{color:rgba(0,0,0,.26)}.Mui-buzz-premium.MuiTabs-root .MuiTabs-indicator{background-color:rgba(0,0,0,.26)}.MuiInputBase-root input[type=number]{-moz-appearance:textfield}.MuiInputBase-root input[type=number]::-webkit-outer-spin-button,.MuiInputBase-root input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}body{font-family:"Roboto","Helvetica","Arial",sans-serif}body.buttonizer-initialized{background:#181818}.tippy-tooltip{background:#6d6d6d;color:#fff}.buttonizer-app{font-family:Roboto,sans-serif;position:fixed;top:0;bottom:0;left:0;right:0}.buttonizer-app a,.buttonizer-app input{box-shadow:none}.buttonizer-app hr{margin-bottom:14px}.dashboard-warning-msg{padding:12px;margin-bottom:15px;font-size:14px;line-height:20px;border:2px solid rgba(240,132,25,.5);color:#f08419;display:block}.dashboard-warning-msg b{display:block}.dashboard-warning-msg a{color:#f08419}iframe{border:0}.simplebar-scrollbar.simplebar-visible:before{opacity:.38 !important}p{font-size:14px;margin-top:5px}
|
739 |
form{display:flex;flex-direction:column;align-items:stretch}form .MuiTextField-root{margin:1em}form .fullwidth-label{align-items:stretch !important}form .crash-report{margin-top:2em}
|
9 |
*
|
10 |
* Buttonizer is Freemium software. The free version (build) does not contain premium functionality.
|
11 |
*
|
12 |
+
* (C) 2017-2022 Buttonizer v2.6.1
|
13 |
*
|
14 |
*/
|
15 |
/*!
|
23 |
*
|
24 |
* Buttonizer is Freemium software. The free version (build) does not contain premium functionality.
|
25 |
*
|
26 |
+
* (C) 2017-2022 Buttonizer v2.6.1
|
27 |
*
|
28 |
*/
|
29 |
@import url(https://fonts.googleapis.com/css?family=Roboto:400,500,700&display=swap);
|
36 |
.knowledgebase-link{color:#2f7789;text-decoration:none}.knowledgebase-link.medium{font-size:14px !important}.knowledgebase-link.small{font-size:12px !important}.knowledgebase-link:hover{text-decoration:underline}.knowledgebase-icon{color:#2f7789}
|
37 |
.button-container{margin:0 0 13px;-webkit-border-radius:7px;-moz-border-radius:7px;border-radius:7px;padding:10px;border:1px solid #e2e2e2;background-color:#fff}.button-container .button-name{max-width:100%}.button-container .button-name .button-name-span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block;max-width:100%}.button-container .button-name.drag-icon{min-width:10px}.button-container .button-header{display:flex}.button-container .button-header .button-actions{margin-left:auto;flex-shrink:0}.button-container .button-settings{display:flex}.button-container .button-settings .button-title{display:inline-flex;height:30px;align-items:center;margin-right:10px;font-size:14px}.button-container .button-settings button{height:30px}.button-container .button-settings .button-visibility{flex-grow:1}.button-container .button-settings .button-visibility button{width:40px;min-width:40px;margin:0 2px}.button-container .button-settings .button-actions button{min-width:35px}.button-container .button-settings .clear{clear:both}
|
38 |
#group-button-extra-buttons div[class^=MuiListItemIcon-root]{min-width:45px}#group-button-extra-buttons div[class^=MuiListItemIcon-root] .fas,#group-button-extra-buttons div[class^=MuiListItemIcon-root] .far{overflow:unset;font-size:1rem;margin-left:5px;text-align:center}
|
39 |
+
.button-group-container{padding:10px;margin-bottom:15px;border:2px #fff solid;position:relative}.button-group-container.currentDrop{border:2px #f9bf87 solid}.button-group-container .group-info{display:flex}.button-group-container .group-info .group-arrow{display:inline-block;min-width:17px;text-align:left;font-size:12px}.button-group-container .group-info .group-arrow i{-webkit-transition:all 150ms ease;-moz-transition:all 150ms ease;-ms-transition:all 150ms ease;-o-transition:all 150ms ease;transition:all 150ms ease}.button-group-container .group-info .group-name{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:inline-block}.button-group-container .group-info .group-action-spacer{flex-grow:1}.button-group-container .group-info .group-actions{flex-grow:0;flex-shrink:0;margin-left:20px}.button-group-container .buttons{display:none}.button-group-container.opened .group-info .group-arrow i{transform:rotate(90deg)}.button-group-container.opened .buttons{display:block;border-radius:10px;padding:10px;border:2px #fff solid;transition:border .5s}.button-group-container.opened .buttons.currentDrop{border:2px #f9bf87 solid}.button-group-container.opened .buttons.currentDrop .button-container{opacity:.5}.button-group-container.opened .buttons.currentDrop .button-container.currentDrag{opacity:1}.button-group-container.new-group::before,.button-group-container.new-group::after{content:"";position:absolute;inset:0px;z-index:-1;display:block;background:#f08419;border-radius:10px}.button-group-container.new-group::before{animation:buttonizer-pulse-new-group 1s 0s ease-out}.button-group-container.new-group::after{animation:buttonizer-pulse-new-group 1s .185s ease-out}@keyframes buttonizer-pulse-new-group{0%{opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";margin:0px}5%{opacity:1;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"}100%{margin:-20px;opacity:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=0)"}}
|
40 |
.templates-dialog ::-webkit-scrollbar{width:10px}.templates-dialog ::-webkit-scrollbar-track{background:#f1f1f1}.templates-dialog ::-webkit-scrollbar-thumb{background:#888}.templates-dialog ::-webkit-scrollbar-thumb:hover{background:#555}.templates-dialog .MuiDialog-paperFullWidth{padding:30px}.templates-dialog .MuiButton-outlined{background-color:#fff;color:#2a7688;border:1px solid #73a8b4}.templates-dialog .header{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;position:relative}.templates-dialog .header .titles h2{color:#2a7688;text-transform:uppercase;font-size:32px}.templates-dialog .header .titles .title{padding:0}.templates-dialog .header .titles .subtitle{margin:0;color:#2a7688;font-weight:normal;font-size:18px}.templates-dialog .header .close-button{cursor:pointer;font-size:24px;color:#2a7688;position:absolute;right:0;top:0}.templates-dialog .container-filter-buttons{padding:8px 55px 0px 24px}.templates-dialog .container-filter-buttons .midsection{display:flex;align-items:center;margin:20px 0 40px;padding:0;border:none;overflow:visible}.templates-dialog .container-filter-buttons .midsection .button-group{min-width:fit-content}.templates-dialog .container-filter-buttons .midsection .button-group .buttons-numbers{margin:10px 20px 20px 0;display:flex}.templates-dialog .container-filter-buttons .midsection .button-group .buttons-numbers .current{background-color:#fce8d4;color:#f08419;border:1px solid #f08419}.templates-dialog .select-all{opacity:0;visibility:hidden}.templates-dialog .select-all.visible{opacity:1;visibility:visible}.search-results{position:absolute;margin-top:-30px}.loading{text-align:center;height:500px;justify-content:center;display:flex}.loading p{font-family:Arial,"Helvetica Neue"}.template{display:grid;grid-template-columns:repeat(auto-fit, 202px);grid-gap:1.5rem;grid-template-rows:repeat(6, 177px);height:500px}.template .type{border:1px solid #2a7688;height:175px;width:200px;color:#2a7688;position:relative;border-radius:5px;display:flex;cursor:pointer;grid-column:1;grid-row:1}.template .type img{max-width:100%;margin:auto;max-height:85%;user-select:none}.template .type .category{position:absolute;top:15px;right:10px;font-size:12px}.template .type .default-option{width:100%;display:flex;align-items:center;flex-direction:column;font-size:14px;align-self:center}.template .type .default-option .fa-plus-circle{font-size:40px;margin-bottom:12px}.template .container{display:grid}.template .container .checkbox{margin:10px 0;transition:all .2s ease-in-out;opacity:1;grid-column:1;grid-row:1;height:24px;width:24px;margin:5px;z-index:1}.template .container .checkbox.hidden{opacity:0;visibility:hidden}.template .container .select{visibility:hidden;opacity:0;display:flex;align-items:center;position:absolute;bottom:0;grid-column-gap:5px;padding:5px 15px;border-top:1px solid #2a7688;border-right:1px solid #2a7688;border-top-right-radius:3px;border-bottom-right-radius:3px;border-top-left-radius:3px;font-size:13px;transition:all .2s ease-in-out}.template .container:hover .select{visibility:visible;opacity:1}.template .container:hover .checkbox.hidden{opacity:1;visibility:visible}
|
41 |
.buttonizer-premium{background:#2d7688;background:-moz-linear-gradient(-45deg, #2d7688 0%, #187287 50%, #187287 50%, #f0841a 51%, #e8832c 98%);background:-webkit-linear-gradient(-45deg, #2d7688 0%, #187287 50%, #187287 50%, #f0841a 51%, #e8832c 98%);background:linear-gradient(135deg, #2d7688 0%, #187287 50%, #187287 50%, #f0841a 51%, #e8832c 98%);filter:progid:DXImageTransform.Microsoft.gradient( startColorstr="#2d7688", endColorstr="#e8832c",GradientType=1 );color:#fff;font-weight:500;font-size:13px;line-height:17px;padding:4px 20px;display:inline-block;vertical-align:middle;border-radius:4px;-moz-border-radius:4px;-webkit-border-radius:4px;margin-left:10px}.buttonizer-premium.premium-right{position:absolute;right:30px;top:19px;z-index:9}.buttonizer-premium::after{content:"PRO"}.MuiFormControl-root:not(.MuiTextField-root) .buttonizer-premium{margin-right:15px}
|
42 |
.item-not-found{text-align:center;padding:40px 0}.item-not-found i{font-size:50px;display:block;margin:30px auto}.item-not-found h4{font-size:15px;margin:28px 0}
|
46 |
.settings-container{display:flex;position:relative;margin:15px 0}.settings-container.disabled{opacity:.5;user-select:none}.settings-title{padding-right:15px;padding:4.9px 15px 4.9px 0;margin-right:auto;flex-shrink:0;font-size:14px}.settings-title span,.settings-title i{padding-left:5px;font-size:14px;line-height:14px}.settings-content{display:flex;flex-shrink:1;align-self:center}.container-full-width .settings-content{width:66.666%}
|
47 |
.desktop-mobile-visibility button{min-width:40px;width:40px}.desktop-mobile-visibility button.buttonMobile{margin-right:5px}
|
48 |
.button-action-value a,.button-action-subject a{font-size:14px !important;text-decoration:none;color:#2f7789}.button-action-value .MuiTextField-root,.button-action-subject .MuiTextField-root{margin-bottom:15px}.button-action-value .MuiTextField-root label,.button-action-subject .MuiTextField-root label{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.button-action-value .MuiTextField-root label:not(.Mui-focused),.button-action-subject .MuiTextField-root label:not(.Mui-focused){width:92%}
|
49 |
+
._1YZvvOJR8sP_M0t1T18Fek{position:relative}._1YZvvOJR8sP_M0t1T18Fek button{position:absolute;right:10px;bottom:10px;z-index:10}._1YZvvOJR8sP_M0t1T18Fek textarea{display:block;width:100%;min-width:100%;max-width:100%;overflow-x:scroll;height:120px;margin:0 1px;background:rgba(0,0,0,.07);border:0;padding:15px;box-sizing:border-box;resize:none;white-space:pre;font-size:12px;margin-bottom:15px}
|
50 |
.button-action .button-action-type{padding-bottom:20px}.button-action code{padding:3px 5px 2px 5px;margin:0 1px;background:rgba(0,0,0,.07)}
|
51 |
.form-icon-selector .selector{overflow:hidden;border-radius:4px;cursor:pointer;width:100%}.form-icon-selector .selector .viewer{width:100%;height:65px;background-color:#ddd;display:block;border-radius:0 0 4px 4px;color:#fff;text-align:center}.form-icon-selector .selector span{border-radius:0 0 4px 4px;display:block;color:#fff;text-align:center}
|
52 |
+
.color-picker-main{width:100%;display:flex;justify-content:flex-end}.color-picker-main .color-picker{display:flex;width:100%;cursor:pointer;justify-content:flex-end;height:28px}.color-picker-main .color-picker .gpw{width:100%;background:url(./images/transparent.png) repeat;border-radius:5px 0 0 5px;box-shadow:0 1px 1px 0 rgba(60,64,67,.08),0 1px 3px 1px rgba(60,64,67,.16);overflow:hidden;padding:0}.color-picker-main .color-picker .gpw span.color-preview{display:block;height:100%;background:#f08419}.color-picker-main .color-picker .color-button{height:100%;border-radius:0 5px 5px 0;margin-left:1px;margin-right:0px;box-shadow:0 1px 1px 0 rgba(60,64,67,.08),0 1px 3px 1px rgba(60,64,67,.16)}.color-picker-main.small .color-picker{display:inline-flex;width:100%;cursor:pointer;justify-content:flex-end;height:28px}.color-picker-main.small .color-picker .gpw{position:absolute;max-width:92px;border-radius:5px;height:inherit}.color-picker-main.small .color-picker .color-button{height:100%;border-radius:5px;min-width:92px;transition:all 250ms ease-in-out 0s}.gpw .popover .type-selector{margin:3px;width:100%}
|
53 |
.color-picker-container{width:300px;max-width:100%}.color-picker-container .color-container{background:url(./images/transparent.png) repeat}.color-picker-container .color-container .current-color input{height:62px;line-height:62px;text-align:center;color:#fff;font-size:18px;font-weight:500;border:0;padding:0;background:rgba(0,0,0,0);width:100%;border-radius:0;outline:none;font-family:Roboto,sans-serif}.color-picker-container .buttons{text-align:right;padding:5px 10px 10px}.color-picker-container .buttons button{margin-left:5px}.no-select-color-container{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
|
54 |
+
.slider-container{margin-bottom:15px}.slider-container-input{margin-left:20px;height:28px;max-width:78px;flex-shrink:0}.slider-container-input input{font-size:14px}.slider-container-input input::-webkit-outer-spin-button,.slider-container-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.slider-container-input input[type=number]{-moz-appearance:textfield}.MuiSlider-thumb,.MuiSlider-track{color:#2f7789}
|
55 |
.disable-setting.disabled{position:relative}.disable-setting.disabled .settings{opacity:.5;pointer-events:none}.disable-setting.disabled .disable-content{position:absolute;bottom:0;top:0;left:0;right:0;text-align:center;max-width:100%;color:#2f7789;font-weight:900;display:flex;align-items:center;user-select:none}.disable-setting.disabled .disable-content .buttonizer-premium{margin-right:30px;margin-left:auto}
|
56 |
.textfield-corners-input{height:100%;max-width:80px;padding-right:5px !important;margin:0 !important}.textfield-corners-input.textfield-corners-select{max-width:35px}.textfield-corners-input .MuiSelect-root{font-size:12px;padding:5px 12px 5px 8px !important}.textfield-corners-input .MuiSvgIcon-root{font-size:1rem;right:0;top:50%;transform:translateY(-50%)}.textfield-corners-input input{font-size:14px;padding:5px 8px}.textfield-corners-input input::-webkit-outer-spin-button,.textfield-corners-input input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.textfield-corners-input input[type=number]{-moz-appearance:textfield}.textfield-corners-input .MuiInputAdornment-root{margin-left:5px}.textfield-corners-input .MuiInputAdornment-root>p{font-size:14px}.textfield-corners-menu li{padding-left:8px;padding-right:8px;font-size:14px}
|
57 |
.box-shadow-input{height:100%;max-width:50px;padding-right:5px !important;margin:0 !important}.box-shadow-input .MuiOutlinedInput-adornedEnd{padding-right:5px}.box-shadow-input .MuiOutlinedInput-adornedEnd input{font-size:14px;padding:7px 5px}.box-shadow-input .MuiOutlinedInput-adornedEnd input::-webkit-outer-spin-button,.box-shadow-input .MuiOutlinedInput-adornedEnd input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}.box-shadow-input .MuiOutlinedInput-adornedEnd input[type=number]{-moz-appearance:textfield}.box-shadow-input .MuiOutlinedInput-adornedEnd .box-shadow-input-adornment{color:rgba(0,0,0,.54);font-size:.7rem}.box-shadow-input .MuiInputAdornment-root{margin-left:5px}.box-shadow-input .MuiInputAdornment-root>p{font-size:14px}
|
704 |
.tourDialog,.videoDialog,.centerTopDialog,.centerBottomDialog,.centerVideoDialog{padding:15px;min-width:400px;background-color:#d7e5e9;background-repeat:no-repeat;background-image:url(./images/buttonizer-logo.png);background-position:left 30px bottom 20px;background-size:50px}.tourDialog .introjs-tooltip-header,.videoDialog .introjs-tooltip-header,.centerTopDialog .introjs-tooltip-header,.centerBottomDialog .introjs-tooltip-header,.centerVideoDialog .introjs-tooltip-header{position:relative}.tourDialog .introjs-tooltip-header .introjs-tooltip-title,.videoDialog .introjs-tooltip-header .introjs-tooltip-title,.centerTopDialog .introjs-tooltip-header .introjs-tooltip-title,.centerBottomDialog .introjs-tooltip-header .introjs-tooltip-title,.centerVideoDialog .introjs-tooltip-header .introjs-tooltip-title{font-size:22px;color:#2f788a}.tourDialog .introjs-tooltip-header .introjs-skipbutton,.videoDialog .introjs-tooltip-header .introjs-skipbutton,.centerTopDialog .introjs-tooltip-header .introjs-skipbutton,.centerBottomDialog .introjs-tooltip-header .introjs-skipbutton,.centerVideoDialog .introjs-tooltip-header .introjs-skipbutton{color:#000;padding:5px;position:absolute;right:0;top:0}.tourDialog .introjs-tooltiptext,.videoDialog .introjs-tooltiptext,.centerTopDialog .introjs-tooltiptext,.centerBottomDialog .introjs-tooltiptext,.centerVideoDialog .introjs-tooltiptext{font-size:14px;color:#000}.tourDialog .introjs-tooltiptext a,.videoDialog .introjs-tooltiptext a,.centerTopDialog .introjs-tooltiptext a,.centerBottomDialog .introjs-tooltiptext a,.centerVideoDialog .introjs-tooltiptext a{color:#000;text-decoration:none}.tourDialog .introjs-tooltiptext #myVideo,.videoDialog .introjs-tooltiptext #myVideo,.centerTopDialog .introjs-tooltiptext #myVideo,.centerBottomDialog .introjs-tooltiptext #myVideo,.centerVideoDialog .introjs-tooltiptext #myVideo{width:100%;margin-top:-25px}.tourDialog .introjs-tooltiptext h2,.videoDialog .introjs-tooltiptext h2,.centerTopDialog .introjs-tooltiptext h2,.centerBottomDialog .introjs-tooltiptext h2,.centerVideoDialog .introjs-tooltiptext h2{color:#2f788a;margin:50px 0 10px}.tourDialog .introjs-progress,.videoDialog .introjs-progress,.centerTopDialog .introjs-progress,.centerBottomDialog .introjs-progress,.centerVideoDialog .introjs-progress{margin:20px;height:5px;background-color:#fff}.tourDialog .introjs-progress .introjs-progressbar,.videoDialog .introjs-progress .introjs-progressbar,.centerTopDialog .introjs-progress .introjs-progressbar,.centerBottomDialog .introjs-progress .introjs-progressbar,.centerVideoDialog .introjs-progress .introjs-progressbar{background-color:gray}.tourDialog .introjs-tooltipbuttons,.videoDialog .introjs-tooltipbuttons,.centerTopDialog .introjs-tooltipbuttons,.centerBottomDialog .introjs-tooltipbuttons,.centerVideoDialog .introjs-tooltipbuttons{border:none;margin-top:20px;float:right;display:flex;align-items:center}.tourDialog .introjs-tooltipbuttons .introjs-prevbutton,.tourDialog .introjs-tooltipbuttons .introjs-nextbutton,.videoDialog .introjs-tooltipbuttons .introjs-prevbutton,.videoDialog .introjs-tooltipbuttons .introjs-nextbutton,.centerTopDialog .introjs-tooltipbuttons .introjs-prevbutton,.centerTopDialog .introjs-tooltipbuttons .introjs-nextbutton,.centerBottomDialog .introjs-tooltipbuttons .introjs-prevbutton,.centerBottomDialog .introjs-tooltipbuttons .introjs-nextbutton,.centerVideoDialog .introjs-tooltipbuttons .introjs-prevbutton,.centerVideoDialog .introjs-tooltipbuttons .introjs-nextbutton{border:none;text-shadow:none;text-transform:uppercase;font-weight:bolder;font-size:12px}.tourDialog .introjs-tooltipbuttons .introjs-prevbutton,.videoDialog .introjs-tooltipbuttons .introjs-prevbutton,.centerTopDialog .introjs-tooltipbuttons .introjs-prevbutton,.centerBottomDialog .introjs-tooltipbuttons .introjs-prevbutton,.centerVideoDialog .introjs-tooltipbuttons .introjs-prevbutton{color:#2f788a;background:none}.tourDialog .introjs-tooltipbuttons .introjs-nextbutton,.videoDialog .introjs-tooltipbuttons .introjs-nextbutton,.centerTopDialog .introjs-tooltipbuttons .introjs-nextbutton,.centerBottomDialog .introjs-tooltipbuttons .introjs-nextbutton,.centerVideoDialog .introjs-tooltipbuttons .introjs-nextbutton{color:#fff;background-color:#ef790c;box-shadow:rgba(0,0,0,.24) 0px 3px 8px;margin-left:5px;padding:10px 15px}.tourDialog .introjs-arrow.left,.videoDialog .introjs-arrow.left,.centerTopDialog .introjs-arrow.left,.centerBottomDialog .introjs-arrow.left,.centerVideoDialog .introjs-arrow.left{border-right-color:#d7e5e9}.tourDialog .introjs-arrow.left-bottom,.videoDialog .introjs-arrow.left-bottom,.centerTopDialog .introjs-arrow.left-bottom,.centerBottomDialog .introjs-arrow.left-bottom,.centerVideoDialog .introjs-arrow.left-bottom{border-right-color:#d7e5e9}.tourDialog .introjs-arrow.right,.videoDialog .introjs-arrow.right,.centerTopDialog .introjs-arrow.right,.centerBottomDialog .introjs-arrow.right,.centerVideoDialog .introjs-arrow.right{border-left-color:#d7e5e9}.tourDialog .introjs-arrow.top,.videoDialog .introjs-arrow.top,.centerTopDialog .introjs-arrow.top,.centerBottomDialog .introjs-arrow.top,.centerVideoDialog .introjs-arrow.top{border-bottom-color:#d7e5e9}.tourDialog .introjs-arrow.top-middle,.videoDialog .introjs-arrow.top-middle,.centerTopDialog .introjs-arrow.top-middle,.centerBottomDialog .introjs-arrow.top-middle,.centerVideoDialog .introjs-arrow.top-middle{border-bottom-color:#d7e5e9}.tourDialog .introjs-arrow.bottom,.videoDialog .introjs-arrow.bottom,.centerTopDialog .introjs-arrow.bottom,.centerBottomDialog .introjs-arrow.bottom,.centerVideoDialog .introjs-arrow.bottom{border-top-color:#d7e5e9}.tourDialog .introjs-arrow.bottom-middle,.videoDialog .introjs-arrow.bottom-middle,.centerTopDialog .introjs-arrow.bottom-middle,.centerBottomDialog .introjs-arrow.bottom-middle,.centerVideoDialog .introjs-arrow.bottom-middle{border-top-color:#d7e5e9}.tourDialog .introjs-arrow.bottom-right,.videoDialog .introjs-arrow.bottom-right,.centerTopDialog .introjs-arrow.bottom-right,.centerBottomDialog .introjs-arrow.bottom-right,.centerVideoDialog .introjs-arrow.bottom-right{border-top-color:#d7e5e9}.videoDialog,.centerVideoDialog{background-image:url(./images/white-background.jpg);background-position:inherit;background-size:620px}.centerTopDialog,.centerVideoDialog{margin-top:20px}.centerBottomDialog{margin:-20px;margin-left:0}
|
705 |
.changelog-dialog ::-webkit-scrollbar{width:10px}.changelog-dialog ::-webkit-scrollbar-track{background:#f1f1f1}.changelog-dialog ::-webkit-scrollbar-thumb{background:#888}.changelog-dialog ::-webkit-scrollbar-thumb:hover{background:#555}.changelog-dialog img{margin-top:-8px}.changelog-dialog .close-down{position:absolute;color:#2f7789;cursor:pointer;margin:5px;right:0;font-size:20px;width:38px;height:38px}.changelog-dialog .MuiDialogTitle-root{padding-bottom:0}.changelog-dialog h2{color:#2f7789;font-size:28px}.changelog-dialog .content{padding:0 24px;margin-bottom:20px}.changelog-dialog .content h3{font-size:20px;color:#535353;font-weight:500;margin:25px 0 10px}.changelog-dialog .content .list ul{margin:0;padding-left:20px;color:#535353}.changelog-dialog .content .list .name{font-weight:500}.changelog-dialog .content .list .info{margin-bottom:10px}.changelog-dialog .progress-bar{display:flex;align-items:center;margin:0 200px}.changelog-dialog .progress-bar .dot{height:10px;width:10px;background-color:#f0f0f0;border-radius:50%;margin:0 3px}.changelog-dialog .footer{flex-direction:column}.changelog-dialog .footer .primary-button{margin:10px auto}.changelog-dialog .footer .pagination{display:flex;margin:20px 0}.changelog-dialog .footer .pagination .previous,.changelog-dialog .footer .pagination .next{background:#f0f0f0;color:#f08419;font-size:14px;cursor:pointer;width:38px;height:38px}.changelog-dialog .footer .external-link{color:#2f7789;font-size:14px;margin-bottom:10px;border-radius:unset}.changelog-dialog .footer .external-link .fa-external-link-alt{margin-left:10px;font-size:14px}.changelog-dialog .footer .version{font-size:12px;margin-bottom:20px}
|
706 |
.buzzy-urlbar{background:#f0f0f0;border-bottom:1px solid #d2d2d2;position:absolute;top:-65px;left:0;right:0;z-index:999;max-width:1300px;height:60px;transition:all 250ms ease-in-out}.buzzy-urlbar.ready{top:0}.whitten{background:#fff}@media screen and (min-width: 769px){body:not(.hide-buttonizer-bar) .buzzy-urlbar{left:431px}}@media screen and (max-width: 769px){body:not(.hide-buttonizer-bar) .buzzy-urlbar{display:none}}
|
707 |
+
.GoB-rFmXaQiCtLHiw5bE0{display:inline-block;margin-right:10px;border:1px solid #fff;padding:2px 5px;border-radius:4px}.QZVwpvNWXvaP4Bg5_NwrC{margin:0 10px}
|
708 |
.btnizr-wp-icon {
|
709 |
background: url(./images/wp-icon.png);
|
710 |
}
|
737 |
background: url(./videos/tour_style.mp4);
|
738 |
}
|
739 |
|
740 |
+
#wpadminbar,#adminmenumain{display:none}#wpcontent,#wpfooter{margin:0;padding:0}.buttonizer-admin-overlay{text-align:center;padding:40px 20px}.buttonizer-initialized .buttonizer-admin-overlay{display:none}html{padding:0 !important}.screen-reader-text{display:none}body.buttonizer-loaded{background:#191e23}.button.button-red{background:#ba0000;border-color:#a00 #900 #900;-webkit-box-shadow:0 1px 0 #900;box-shadow:0 1px 0 #900;color:#fff;text-decoration:none;text-shadow:0 -1px 1px #900,1px 0 1px #900,0 1px 1px #900,-1px 0 1px #900}.button.button-red:hover{background:#c20000 !important;border-color:#900 !important;color:#fff}.button.button-red:active,.button.button-red:focus{background:#a00 !important;border-color:#900 !important;-webkit-box-shadow:inset 0 2px 0 #900;box-shadow:inset 0 2px 0 #900;vertical-align:top;color:#fff}.button.button-red.button-centered-reset{margin:0 auto;padding:4px 20px;height:auto;font-size:15px}.button.button-red.button-centered-reset i{margin-right:10px}.label-settings{display:flex}.label-settings .title{min-width:calc(100% / 3);width:calc(100% / 3)}.label-settings .mdc-slider{width:calc(100% /3)}.icon-settings{display:flex}.icon-settings .title{min-width:calc(100% / 3);width:calc(100% / 3)}.icon-settings .mdc-text-field.small{width:calc(100% / 3) !important;height:28px !important}.icon-settings .mdc-text-field.small .material-icons.mdc-text-field__icon.icon{bottom:9px !important;font-size:10px;margin-right:-8px}.icon-settings .mdc-text-field.small .material-icons.mdc-text-field__icon.text{bottom:6px !important;font-size:10px;margin-right:-9px}.icon-settings .mdc-text-field.small .mdc-text-field__input{padding:0;padding-left:16px !important;padding-right:24px !important;height:28px !important;font-size:14px !important}.buttonizer-preview{position:fixed;left:431px;right:0;top:0;bottom:0;transition:transform 250ms ease-in-out;padding-top:61px}.buttonizer-preview.is-wp-version{padding-top:0}@media screen and (max-width: 769px){.buttonizer-preview{left:0}}.buttonizer-preview.frame-size-tablet{width:720px;max-width:720px;left:50%;margin-left:-170px;right:unset;z-index:-1}.buttonizer-preview.frame-size-mobile{width:340px;height:650px;max-width:340px;top:50%;left:50%;margin-top:-300px;margin-left:15px;right:unset;z-index:-1}.buttonizer-preview iframe{transition:all 250ms ease-in-out}.buttonizer-preview iframe.waitfor{transform:scale(0.8);opacity:0}.hide-bar-button{display:block;position:fixed;left:429px;top:50%;cursor:pointer;margin-top:-30px;z-index:2;height:60px;line-height:60px;width:20px;border-radius:0 10px 10px 0;background:#f0f0f0;border:1px solid #d2d2d2;border-left:1px solid transparent !important;text-align:center;color:#5d5d5d !important;text-decoration:none;transition:all 250ms ease-out;-moz-transition:all 250ms ease-out;-webkit-transition:all 250ms ease-out}.hide-bar-button .fas{margin-left:-4px;color:#2f7789}@media screen and (max-width: 769px){.hide-bar-button{left:unset !important;right:0;top:40px;width:auto;height:auto;line-height:20px;border:0;background:unset;padding:0 20px}.hide-bar-button:before,.hide-bar-button:after{content:none !important}.hide-bar-button:focus{border-left:none !important}}.hide-bar-button .fa-chevron-right{display:none}.hide-bar-button:before{content:"";position:absolute;background-color:transparent;top:-20px;height:20px;width:10px;left:0;box-sizing:inherit;border-bottom-left-radius:10px;box-shadow:0 10px 0 0 #f0f0f0;border-bottom:1px solid #d2d2d2;border-left:1px solid #d2d2d2;transition:all 250ms ease-out;-moz-transition:all 250ms ease-out;-webkit-transition:all 250ms ease-out}.hide-bar-button:after{content:"";position:absolute;background-color:transparent;bottom:-20px;height:20px;width:10px;left:0;box-sizing:inherit;border-top-left-radius:10px;box-shadow:0 -10px 0 0 #f0f0f0;border-top:1px solid #d2d2d2;border-left:1px solid #d2d2d2;transition:all 250ms ease-out;-moz-transition:all 250ms ease-out;-webkit-transition:all 250ms ease-out}.hide-bar-button:focus{outline:none;outline-style:none;box-shadow:none;box-sizing:border-box;border-left:1px solid #f0f0f0}@media screen and (max-width: 769px){body.hide-buttonizer-bar .hide-bar-button{top:110px}}.buttonizer-app .buttonizer-bar,.buttonizer-app .buttonizer-preview,.buttonizer-app .hide-bar-button{transition:all 250ms ease-out;-moz-transition:all 250ms ease-out;-webkit-transition:all 250ms ease-out}@media screen and (max-width: 769px){body.buttonizer-mobile-hide .buttonizer-preview{transform:translateX(100%)}}body.hide-buttonizer-bar .buttonizer-app .buttonizer-bar{transform:translateX(-100%)}body.hide-buttonizer-bar .buttonizer-app .buttonizer-preview,body.hide-buttonizer-bar .buttonizer-app .hide-bar-button{left:-2px}body.hide-buttonizer-bar .buttonizer-app .fas{margin-left:-1px}body.hide-buttonizer-bar .buttonizer-app .hide-bar-button .fa-chevron-right{display:inline-block}body.hide-buttonizer-bar .buttonizer-app .hide-bar-button .fa-chevron-left{display:none}@media screen and (max-width: 769px){body.hide-buttonizer-bar .buttonizer-preview{transform:translateX(0)}}body{color:#717171}.mdc-card{border-radius:4px;background-color:#fff;display:flex;flex-direction:column;box-sizing:border-box;box-shadow:0 1px 1px 0 rgba(60,64,67,.08),0 1px 3px 1px rgba(60,64,67,.16)}.collapsible-group{margin:15px 0 !important}.collapsible-group .collapsible-body{padding:15px}.collapsible-group .collapsible-body .setting-group-title{font-size:13px;color:#888;text-transform:uppercase;font-weight:500}.collapsible-group .collapsible-body .setting-group-title~.setting-group-title{padding-top:10px}.collapsible-group .mdc-button.mdc-button--bold{font-size:13px}.MuiSelect-small .MuiSelect-select{font-size:14px;padding:9px 12px}.Mui-buzz-disabled{color:rgba(0,0,0,.26) !important;cursor:default !important}.Mui-buzz-premium.MuiButton-textPrimary{color:rgba(0,0,0,.26)}.Mui-buzz-premium.MuiButton-containedPrimary{background:rgba(0,0,0,.26)}.Mui-buzz-premium.MuiTabs-root .MuiTab-root{color:rgba(0,0,0,.26)}.Mui-buzz-premium.MuiTabs-root .MuiTabs-indicator{background-color:rgba(0,0,0,.26)}.MuiInputBase-root input[type=number]{-moz-appearance:textfield}.MuiInputBase-root input[type=number]::-webkit-outer-spin-button,.MuiInputBase-root input[type=number]::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}body{font-family:"Roboto","Helvetica","Arial",sans-serif}body.buttonizer-initialized{background:#181818}.tippy-tooltip{background:#6d6d6d;color:#fff}.buttonizer-app{font-family:Roboto,sans-serif;position:fixed;top:0;bottom:0;left:0;right:0}.buttonizer-app a,.buttonizer-app input{box-shadow:none}.buttonizer-app hr{margin-bottom:14px}.dashboard-warning-msg{padding:12px;margin-bottom:15px;font-size:14px;line-height:20px;border:2px solid rgba(240,132,25,.5);color:#f08419;display:block}.dashboard-warning-msg b{display:block}.dashboard-warning-msg a{color:#f08419}iframe{border:0}.simplebar-scrollbar.simplebar-visible:before{opacity:.38 !important}p{font-size:14px;margin-top:5px}@media screen and (max-width: 1730px){.dashboard-notifications{top:70px !important;right:15px !important}}@media screen and (min-width: 1730px){.dashboard-notifications{top:70px !important;right:calc(100vw - 1730px + 15px) !important}}
|
741 |
form{display:flex;flex-direction:column;align-items:stretch}form .MuiTextField-root{margin:1em}form .fullwidth-label{align-items:stretch !important}form .crash-report{margin-top:2em}
|
assets/dashboard.js
CHANGED
@@ -9,7 +9,7 @@
|
|
9 |
*
|
10 |
* Buttonizer is Freemium software. The free version (build) does not contain premium functionality.
|
11 |
*
|
12 |
-
* (C) 2017-2022 Buttonizer v2.6.
|
13 |
*
|
14 |
*/
|
15 |
/*!
|
@@ -23,7 +23,7 @@
|
|
23 |
*
|
24 |
* Buttonizer is Freemium software. The free version (build) does not contain premium functionality.
|
25 |
*
|
26 |
-
* (C) 2017-2022 Buttonizer v2.6.
|
27 |
*
|
28 |
*/
|
29 |
/******/ (function() { // webpackBootstrap
|
@@ -48,6 +48,19 @@ function _arrayLikeToArray(arr, len) {
|
|
48 |
|
49 |
/***/ }),
|
50 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51 |
/***/ 83614:
|
52 |
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
53 |
|
@@ -100,6 +113,9 @@ function _defineProperties(target, props) {
|
|
100 |
function _createClass(Constructor, protoProps, staticProps) {
|
101 |
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
102 |
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
|
|
|
|
|
103 |
return Constructor;
|
104 |
}
|
105 |
|
@@ -186,6 +202,19 @@ function _iterableToArray(iter) {
|
|
186 |
|
187 |
/***/ }),
|
188 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
189 |
/***/ 62303:
|
190 |
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
191 |
|
@@ -271,7 +300,7 @@ function _setPrototypeOf(o, p) {
|
|
271 |
|
272 |
/***/ }),
|
273 |
|
274 |
-
/***/
|
275 |
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
276 |
|
277 |
"use strict";
|
@@ -281,13 +310,11 @@ __webpack_require__.d(__webpack_exports__, {
|
|
281 |
"Z": function() { return /* binding */ _slicedToArray; }
|
282 |
});
|
283 |
|
284 |
-
|
285 |
-
|
286 |
-
if (Array.isArray(arr)) return arr;
|
287 |
-
}
|
288 |
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
289 |
function _iterableToArrayLimit(arr, i) {
|
290 |
-
var _i = arr
|
291 |
|
292 |
if (_i == null) return;
|
293 |
var _arr = [];
|
@@ -317,17 +344,15 @@ function _iterableToArrayLimit(arr, i) {
|
|
317 |
}
|
318 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
319 |
var unsupportedIterableToArray = __webpack_require__(82961);
|
320 |
-
|
321 |
-
|
322 |
-
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
323 |
-
}
|
324 |
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
325 |
|
326 |
|
327 |
|
328 |
|
329 |
function _slicedToArray(arr, i) {
|
330 |
-
return
|
331 |
}
|
332 |
|
333 |
/***/ }),
|
@@ -363,17 +388,11 @@ function _toConsumableArray(arr) {
|
|
363 |
function _typeof(obj) {
|
364 |
"@babel/helpers - typeof";
|
365 |
|
366 |
-
|
367 |
-
|
368 |
-
|
369 |
-
|
370 |
-
}
|
371 |
-
_typeof = function _typeof(obj) {
|
372 |
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
373 |
-
};
|
374 |
-
}
|
375 |
-
|
376 |
-
return _typeof(obj);
|
377 |
}
|
378 |
|
379 |
/***/ }),
|
@@ -407,8 +426,7 @@ function _interopRequireDefault(obj) {
|
|
407 |
};
|
408 |
}
|
409 |
|
410 |
-
module.exports = _interopRequireDefault;
|
411 |
-
module.exports.default = module.exports, module.exports.__esModule = true;
|
412 |
|
413 |
/***/ }),
|
414 |
|
@@ -417,19 +435,17 @@ module.exports.default = module.exports, module.exports.__esModule = true;
|
|
417 |
|
418 |
var _typeof = __webpack_require__(50008).default;
|
419 |
|
420 |
-
function _getRequireWildcardCache() {
|
421 |
if (typeof WeakMap !== "function") return null;
|
422 |
-
var
|
423 |
-
|
424 |
-
_getRequireWildcardCache = function _getRequireWildcardCache() {
|
425 |
-
return
|
426 |
-
};
|
427 |
-
|
428 |
-
return cache;
|
429 |
}
|
430 |
|
431 |
-
function _interopRequireWildcard(obj) {
|
432 |
-
if (obj && obj.__esModule) {
|
433 |
return obj;
|
434 |
}
|
435 |
|
@@ -439,7 +455,7 @@ function _interopRequireWildcard(obj) {
|
|
439 |
};
|
440 |
}
|
441 |
|
442 |
-
var cache = _getRequireWildcardCache();
|
443 |
|
444 |
if (cache && cache.has(obj)) {
|
445 |
return cache.get(obj);
|
@@ -449,7 +465,7 @@ function _interopRequireWildcard(obj) {
|
|
449 |
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
450 |
|
451 |
for (var key in obj) {
|
452 |
-
if (Object.prototype.hasOwnProperty.call(obj, key)) {
|
453 |
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
454 |
|
455 |
if (desc && (desc.get || desc.set)) {
|
@@ -469,8 +485,7 @@ function _interopRequireWildcard(obj) {
|
|
469 |
return newObj;
|
470 |
}
|
471 |
|
472 |
-
module.exports = _interopRequireWildcard;
|
473 |
-
module.exports.default = module.exports, module.exports.__esModule = true;
|
474 |
|
475 |
/***/ }),
|
476 |
|
@@ -480,25 +495,14 @@ module.exports.default = module.exports, module.exports.__esModule = true;
|
|
480 |
function _typeof(obj) {
|
481 |
"@babel/helpers - typeof";
|
482 |
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
module.exports.default = module.exports, module.exports.__esModule = true;
|
489 |
-
} else {
|
490 |
-
module.exports = _typeof = function _typeof(obj) {
|
491 |
-
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
492 |
-
};
|
493 |
-
|
494 |
-
module.exports.default = module.exports, module.exports.__esModule = true;
|
495 |
-
}
|
496 |
-
|
497 |
-
return _typeof(obj);
|
498 |
}
|
499 |
|
500 |
-
module.exports = _typeof;
|
501 |
-
module.exports.default = module.exports, module.exports.__esModule = true;
|
502 |
|
503 |
/***/ }),
|
504 |
|
@@ -594,6 +598,117 @@ exports.Z = function (_ref) {
|
|
594 |
|
595 |
/***/ }),
|
596 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
597 |
/***/ 59693:
|
598 |
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
599 |
|
@@ -1477,8 +1592,8 @@ var shape = {
|
|
1477 |
borderRadius: 4
|
1478 |
};
|
1479 |
/* harmony default export */ var styles_shape = (shape);
|
1480 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js +
|
1481 |
-
var slicedToArray = __webpack_require__(
|
1482 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
1483 |
var esm_typeof = __webpack_require__(90484);
|
1484 |
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
|
@@ -2137,127 +2252,16 @@ function createChainedFunction() {
|
|
2137 |
|
2138 |
/***/ }),
|
2139 |
|
2140 |
-
/***/
|
2141 |
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
2142 |
|
2143 |
"use strict";
|
2144 |
-
|
2145 |
-
|
2146 |
-
|
2147 |
-
|
2148 |
-
|
2149 |
-
|
2150 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/extends.js
|
2151 |
-
var esm_extends = __webpack_require__(22122);
|
2152 |
-
// EXTERNAL MODULE: ./node_modules/react/index.js
|
2153 |
-
var react = __webpack_require__(67294);
|
2154 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
2155 |
-
var objectWithoutProperties = __webpack_require__(81253);
|
2156 |
-
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
|
2157 |
-
var prop_types = __webpack_require__(45697);
|
2158 |
-
// EXTERNAL MODULE: ./node_modules/clsx/dist/clsx.m.js
|
2159 |
-
var clsx_m = __webpack_require__(86010);
|
2160 |
-
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/styles/withStyles.js + 1 modules
|
2161 |
-
var withStyles = __webpack_require__(14670);
|
2162 |
-
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/utils/capitalize.js
|
2163 |
-
var capitalize = __webpack_require__(93871);
|
2164 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/SvgIcon/SvgIcon.js
|
2165 |
-
|
2166 |
-
|
2167 |
-
|
2168 |
-
|
2169 |
-
|
2170 |
-
|
2171 |
-
|
2172 |
-
var styles = function styles(theme) {
|
2173 |
-
return {
|
2174 |
-
/* Styles applied to the root element. */
|
2175 |
-
root: {
|
2176 |
-
userSelect: 'none',
|
2177 |
-
width: '1em',
|
2178 |
-
height: '1em',
|
2179 |
-
display: 'inline-block',
|
2180 |
-
fill: 'currentColor',
|
2181 |
-
flexShrink: 0,
|
2182 |
-
fontSize: theme.typography.pxToRem(24),
|
2183 |
-
transition: theme.transitions.create('fill', {
|
2184 |
-
duration: theme.transitions.duration.shorter
|
2185 |
-
})
|
2186 |
-
},
|
2187 |
-
|
2188 |
-
/* Styles applied to the root element if `color="primary"`. */
|
2189 |
-
colorPrimary: {
|
2190 |
-
color: theme.palette.primary.main
|
2191 |
-
},
|
2192 |
-
|
2193 |
-
/* Styles applied to the root element if `color="secondary"`. */
|
2194 |
-
colorSecondary: {
|
2195 |
-
color: theme.palette.secondary.main
|
2196 |
-
},
|
2197 |
-
|
2198 |
-
/* Styles applied to the root element if `color="action"`. */
|
2199 |
-
colorAction: {
|
2200 |
-
color: theme.palette.action.active
|
2201 |
-
},
|
2202 |
-
|
2203 |
-
/* Styles applied to the root element if `color="error"`. */
|
2204 |
-
colorError: {
|
2205 |
-
color: theme.palette.error.main
|
2206 |
-
},
|
2207 |
-
|
2208 |
-
/* Styles applied to the root element if `color="disabled"`. */
|
2209 |
-
colorDisabled: {
|
2210 |
-
color: theme.palette.action.disabled
|
2211 |
-
},
|
2212 |
-
|
2213 |
-
/* Styles applied to the root element if `fontSize="inherit"`. */
|
2214 |
-
fontSizeInherit: {
|
2215 |
-
fontSize: 'inherit'
|
2216 |
-
},
|
2217 |
-
|
2218 |
-
/* Styles applied to the root element if `fontSize="small"`. */
|
2219 |
-
fontSizeSmall: {
|
2220 |
-
fontSize: theme.typography.pxToRem(20)
|
2221 |
-
},
|
2222 |
-
|
2223 |
-
/* Styles applied to the root element if `fontSize="large"`. */
|
2224 |
-
fontSizeLarge: {
|
2225 |
-
fontSize: theme.typography.pxToRem(35)
|
2226 |
-
}
|
2227 |
-
};
|
2228 |
-
};
|
2229 |
-
var SvgIcon = /*#__PURE__*/react.forwardRef(function SvgIcon(props, ref) {
|
2230 |
-
var children = props.children,
|
2231 |
-
classes = props.classes,
|
2232 |
-
className = props.className,
|
2233 |
-
_props$color = props.color,
|
2234 |
-
color = _props$color === void 0 ? 'inherit' : _props$color,
|
2235 |
-
_props$component = props.component,
|
2236 |
-
Component = _props$component === void 0 ? 'svg' : _props$component,
|
2237 |
-
_props$fontSize = props.fontSize,
|
2238 |
-
fontSize = _props$fontSize === void 0 ? 'default' : _props$fontSize,
|
2239 |
-
htmlColor = props.htmlColor,
|
2240 |
-
titleAccess = props.titleAccess,
|
2241 |
-
_props$viewBox = props.viewBox,
|
2242 |
-
viewBox = _props$viewBox === void 0 ? '0 0 24 24' : _props$viewBox,
|
2243 |
-
other = (0,objectWithoutProperties/* default */.Z)(props, ["children", "classes", "className", "color", "component", "fontSize", "htmlColor", "titleAccess", "viewBox"]);
|
2244 |
-
|
2245 |
-
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
2246 |
-
className: (0,clsx_m/* default */.Z)(classes.root, className, color !== 'inherit' && classes["color".concat((0,capitalize/* default */.Z)(color))], fontSize !== 'default' && classes["fontSize".concat((0,capitalize/* default */.Z)(fontSize))]),
|
2247 |
-
focusable: "false",
|
2248 |
-
viewBox: viewBox,
|
2249 |
-
color: htmlColor,
|
2250 |
-
"aria-hidden": titleAccess ? undefined : true,
|
2251 |
-
role: titleAccess ? 'img' : undefined,
|
2252 |
-
ref: ref
|
2253 |
-
}, other), children, titleAccess ? /*#__PURE__*/react.createElement("title", null, titleAccess) : null);
|
2254 |
-
});
|
2255 |
-
false ? 0 : void 0;
|
2256 |
-
SvgIcon.muiName = 'SvgIcon';
|
2257 |
-
/* harmony default export */ var SvgIcon_SvgIcon = ((0,withStyles/* default */.Z)(styles, {
|
2258 |
-
name: 'MuiSvgIcon'
|
2259 |
-
})(SvgIcon));
|
2260 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/utils/createSvgIcon.js
|
2261 |
|
2262 |
|
2263 |
|
@@ -2267,15 +2271,15 @@ SvgIcon.muiName = 'SvgIcon';
|
|
2267 |
|
2268 |
function createSvgIcon(path, displayName) {
|
2269 |
var Component = function Component(props, ref) {
|
2270 |
-
return /*#__PURE__*/
|
2271 |
ref: ref
|
2272 |
}, props), path);
|
2273 |
};
|
2274 |
|
2275 |
if (false) {}
|
2276 |
|
2277 |
-
Component.muiName =
|
2278 |
-
return /*#__PURE__*/
|
2279 |
}
|
2280 |
|
2281 |
/***/ }),
|
@@ -2349,8 +2353,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
2349 |
var capitalize = __webpack_require__(93871);
|
2350 |
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/utils/createChainedFunction.js
|
2351 |
var createChainedFunction = __webpack_require__(82568);
|
2352 |
-
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/utils/createSvgIcon.js
|
2353 |
-
var createSvgIcon = __webpack_require__(
|
2354 |
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/utils/debounce.js
|
2355 |
var debounce = __webpack_require__(79437);
|
2356 |
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/utils/deprecatedPropType.js
|
@@ -2832,6 +2836,34 @@ exports.Z = _default;
|
|
2832 |
|
2833 |
/***/ }),
|
2834 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2835 |
/***/ 2108:
|
2836 |
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
2837 |
|
@@ -7523,7 +7555,7 @@ module.exports = JSON.parse('{"name":"axios","version":"0.21.4","description":"P
|
|
7523 |
|
7524 |
/***/ }),
|
7525 |
|
7526 |
-
/***/
|
7527 |
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
7528 |
|
7529 |
"use strict";
|
@@ -8587,398 +8619,3190 @@ function uniqueCharset() {
|
|
8587 |
|
8588 |
|
8589 |
|
8590 |
-
// EXTERNAL MODULE: ./node_modules/
|
8591 |
-
var
|
8592 |
-
|
8593 |
-
|
8594 |
-
|
8595 |
-
|
8596 |
-
for (var _len = arguments.length, formats = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
8597 |
-
formats[_key - 1] = arguments[_key];
|
8598 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8599 |
|
8600 |
-
|
8601 |
-
if (
|
8602 |
-
|
8603 |
-
var args = arguments;
|
8604 |
-
return this.replace(/{(\d+)}/g, function (match, number) {
|
8605 |
-
return typeof args[number] != "undefined" ? args[number] : match;
|
8606 |
-
});
|
8607 |
-
};
|
8608 |
}
|
8609 |
|
8610 |
-
|
8611 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8612 |
|
8613 |
-
|
8614 |
-
|
|
|
|
|
|
|
8615 |
}
|
8616 |
|
8617 |
-
return
|
8618 |
}
|
8619 |
-
;// CONCATENATED MODULE: ./
|
8620 |
-
function
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8621 |
|
8622 |
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { helpers_ownKeys(Object(source), true).forEach(function (key) { helpers_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { helpers_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
8623 |
|
8624 |
-
function helpers_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
8625 |
|
8626 |
|
|
|
|
|
|
|
|
|
8627 |
|
8628 |
|
8629 |
|
8630 |
|
8631 |
-
|
8632 |
-
|
8633 |
-
|
8634 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8635 |
};
|
8636 |
-
/**
|
8637 |
-
* Create api request
|
8638 |
-
*maar j
|
8639 |
-
* @param {*} endpoint
|
8640 |
-
* @param {*} data
|
8641 |
-
*/
|
8642 |
|
8643 |
-
function
|
8644 |
-
|
8645 |
-
|
8646 |
|
8647 |
-
|
8648 |
-
data.headers = {
|
8649 |
-
Authorization: "Bearer ".concat(buttonizer_admin.auth)
|
8650 |
-
};
|
8651 |
-
} // WordPress version
|
8652 |
-
else {
|
8653 |
-
data.headers = {
|
8654 |
-
"X-WP-Nonce": buttonizer_admin.nonce
|
8655 |
-
};
|
8656 |
-
} // With credentials
|
8657 |
|
|
|
|
|
8658 |
|
8659 |
-
|
8660 |
-
|
8661 |
-
|
8662 |
-
|
8663 |
-
|
8664 |
-
|
8665 |
-
|
8666 |
-
|
8667 |
-
|
8668 |
-
|
8669 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8670 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8671 |
|
8672 |
-
|
8673 |
-
|
8674 |
-
|
8675 |
-
|
8676 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8677 |
return;
|
8678 |
}
|
8679 |
|
8680 |
-
|
8681 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8682 |
}
|
8683 |
|
8684 |
-
|
8685 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8686 |
});
|
|
|
|
|
|
|
8687 |
}
|
8688 |
-
function
|
8689 |
-
|
8690 |
-
|
8691 |
-
|
8692 |
-
|
8693 |
-
|
8694 |
-
|
8695 |
-
apiRequest(previousFailedRequest.endpoint, previousFailedRequest.data).then(function (data) {
|
8696 |
-
previousFailedRequest.resolve(data);
|
8697 |
-
resolve();
|
8698 |
-
})["catch"](function (e) {
|
8699 |
-
return reject(e);
|
8700 |
-
});
|
8701 |
});
|
8702 |
}
|
8703 |
-
/**
|
8704 |
-
* init store
|
8705 |
-
*/
|
8706 |
|
8707 |
-
function
|
8708 |
-
|
8709 |
-
|
8710 |
-
|
8711 |
-
|
8712 |
-
|
8713 |
-
|
8714 |
-
|
8715 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8716 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
8717 |
};
|
8718 |
}
|
8719 |
-
/**
|
8720 |
-
* Convert data to models
|
8721 |
-
*
|
8722 |
-
* @param result
|
8723 |
-
* @return {obj} converted data
|
8724 |
-
*/
|
8725 |
|
8726 |
-
function
|
8727 |
-
var
|
8728 |
-
|
8729 |
-
|
8730 |
|
8731 |
-
|
8732 |
-
|
8733 |
-
|
|
|
|
|
|
|
8734 |
|
8735 |
-
|
8736 |
-
|
8737 |
-
|
8738 |
-
|
8739 |
-
|
8740 |
-
|
8741 |
-
|
8742 |
-
|
8743 |
-
});
|
8744 |
-
var timeSchedules = {};
|
8745 |
-
var pageRules = {};
|
8746 |
|
8747 |
-
if (
|
8748 |
-
|
8749 |
-
|
8750 |
-
|
8751 |
-
|
8752 |
-
weekdays: timeSchedule.weekdays || weekdays.map(function (weekday) {
|
8753 |
-
return {
|
8754 |
-
opened: true,
|
8755 |
-
open: "8:00",
|
8756 |
-
close: "17:00",
|
8757 |
-
weekday: weekday
|
8758 |
-
};
|
8759 |
-
}),
|
8760 |
-
start_date: timeSchedule.start_date || dateToFormat(new Date()),
|
8761 |
-
end_date: timeSchedule.end_date || null,
|
8762 |
-
dates: timeSchedule.dates || []
|
8763 |
-
};
|
8764 |
-
});
|
8765 |
-
} // Add page rules data with placeholders
|
8766 |
|
|
|
|
|
|
|
8767 |
|
8768 |
-
|
8769 |
-
|
8770 |
-
|
8771 |
-
|
8772 |
-
|
8773 |
-
|
8774 |
-
|
8775 |
-
|
8776 |
-
|
8777 |
-
|
8778 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8779 |
});
|
8780 |
}
|
8781 |
|
8782 |
-
return
|
8783 |
-
hasChanges: data.changes,
|
8784 |
-
buttons: buttons,
|
8785 |
-
groups: groups,
|
8786 |
-
timeSchedules: timeSchedules,
|
8787 |
-
pageRules: pageRules,
|
8788 |
-
settings: data.settings,
|
8789 |
-
premium: data.premium,
|
8790 |
-
premium_code: data.premium_code,
|
8791 |
-
version: data.version,
|
8792 |
-
wordpress: data.wordpress,
|
8793 |
-
info: data.info,
|
8794 |
-
is_opt_in: data.is_opt_in,
|
8795 |
-
latest_tour_update: data.latest_tour_update,
|
8796 |
-
identifier: data.identifier ? data.identifier : null,
|
8797 |
-
additional_permissions: data.additional_permissions,
|
8798 |
-
domain: data.domain
|
8799 |
-
};
|
8800 |
}
|
8801 |
-
|
8802 |
-
|
8803 |
-
|
8804 |
-
|
|
|
|
|
|
|
8805 |
});
|
8806 |
-
|
8807 |
-
|
|
|
|
|
|
|
8808 |
|
|
|
|
|
8809 |
|
8810 |
-
|
8811 |
-
|
8812 |
-
|
8813 |
-
|
8814 |
-
*/
|
8815 |
|
8816 |
-
|
8817 |
-
return {
|
8818 |
-
type: actionTypes[model].ADD_MODEL,
|
8819 |
-
payload: data
|
8820 |
-
};
|
8821 |
}
|
8822 |
-
/**
|
8823 |
-
* Add relation between button and group
|
8824 |
-
* @param {string} button_id
|
8825 |
-
* @param {string} group_id
|
8826 |
-
*/
|
8827 |
|
8828 |
-
function
|
8829 |
-
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
8830 |
-
return {
|
8831 |
-
type: buttonizer_constants_actionTypes.ADD_RELATION,
|
8832 |
-
payload: {
|
8833 |
-
button_id: button_id,
|
8834 |
-
group_id: group_id,
|
8835 |
-
index: index
|
8836 |
-
}
|
8837 |
-
};
|
8838 |
-
}
|
8839 |
-
/**
|
8840 |
-
* Change relations (for drag n drop)
|
8841 |
-
* @param {string} button_id button id to change relations
|
8842 |
-
* @param {string} new_group_id new group id
|
8843 |
-
*/
|
8844 |
|
8845 |
-
function
|
8846 |
-
|
8847 |
-
|
8848 |
-
|
8849 |
-
|
8850 |
-
|
8851 |
-
|
8852 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8853 |
}
|
8854 |
-
};
|
8855 |
-
}
|
8856 |
-
/**
|
8857 |
-
* Remove relation between button and group
|
8858 |
-
* @param {string} button_id
|
8859 |
-
* @param {string} group_id
|
8860 |
-
*/
|
8861 |
|
8862 |
-
|
8863 |
-
|
8864 |
-
|
8865 |
-
|
8866 |
-
|
8867 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8868 |
}
|
8869 |
-
|
|
|
|
|
|
|
|
|
8870 |
}
|
8871 |
-
/**
|
8872 |
-
* Set key of model id to value specified
|
8873 |
-
*
|
8874 |
-
* @param {string} model model of object to change value on
|
8875 |
-
* @param {string} id button or group id
|
8876 |
-
* @param {string} key key of value to change
|
8877 |
-
* @param {any} value new value to set
|
8878 |
-
*/
|
8879 |
|
8880 |
-
var
|
8881 |
-
|
8882 |
-
|
8883 |
-
|
8884 |
-
|
8885 |
-
|
8886 |
-
|
8887 |
-
|
8888 |
-
|
8889 |
-
|
8890 |
-
|
8891 |
};
|
8892 |
-
} // if not, just set it normally
|
8893 |
|
|
|
8894 |
|
8895 |
-
|
8896 |
-
|
8897 |
-
|
8898 |
-
|
8899 |
-
key: key,
|
8900 |
-
value: value
|
8901 |
}
|
8902 |
-
|
8903 |
-
};
|
8904 |
-
|
8905 |
-
|
8906 |
-
|
8907 |
-
|
8908 |
-
setting: setting,
|
8909 |
-
value: value
|
8910 |
}
|
8911 |
-
|
8912 |
-
|
8913 |
-
|
8914 |
-
return {
|
8915 |
-
type: buttonizer_constants_actionTypes.SET_MISC_VALUE,
|
8916 |
-
payload: {
|
8917 |
-
setting: setting,
|
8918 |
-
value: value
|
8919 |
}
|
8920 |
-
};
|
8921 |
-
};
|
8922 |
-
/**
|
8923 |
-
* Time Schedule Actions
|
8924 |
-
*/
|
8925 |
-
//
|
8926 |
|
8927 |
-
|
8928 |
-
|
8929 |
-
|
8930 |
-
|
8931 |
-
|
8932 |
-
|
8933 |
-
|
8934 |
-
|
|
|
8935 |
}
|
8936 |
-
}
|
8937 |
-
|
8938 |
-
|
8939 |
-
|
8940 |
-
|
8941 |
-
|
8942 |
-
|
|
|
8943 |
}
|
8944 |
-
}
|
8945 |
-
|
8946 |
-
|
8947 |
-
|
8948 |
-
|
8949 |
-
|
8950 |
-
|
8951 |
-
|
8952 |
-
key: key
|
8953 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8954 |
}
|
8955 |
-
}
|
8956 |
-
|
8957 |
-
|
8958 |
-
|
8959 |
-
|
8960 |
-
|
8961 |
-
|
8962 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8963 |
}
|
8964 |
-
}
|
8965 |
-
|
8966 |
-
|
8967 |
-
|
8968 |
-
|
8969 |
-
|
8970 |
-
*/
|
8971 |
|
8972 |
-
|
8973 |
-
|
8974 |
-
|
8975 |
-
|
8976 |
-
|
8977 |
-
|
8978 |
-
|
8979 |
}
|
8980 |
-
}
|
8981 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8982 |
/**
|
8983 |
* Removes record to store
|
8984 |
* @param {int} model_id id of model to remove
|
@@ -9031,7 +11855,7 @@ function selectors_getGroupCount() {
|
|
9031 |
return Object.keys(state.groups).length;
|
9032 |
}
|
9033 |
;// CONCATENATED MODULE: ./node_modules/immer/dist/immer.esm.js
|
9034 |
-
function n(n){for(var t=arguments.length,r=Array(t>1?t-1:0),e=1;e<t;e++)r[e-1]=arguments[e];if(false){ var i, o; }throw Error("[Immer] minified error nr: "+n+(r.length?" "+r.map((function(n){return"'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function t(n){return!!n&&!!n[Q]}function r(n){return!!n&&(function(n){if(!n||"object"!=typeof n)return!1;var t=Object.getPrototypeOf(n);if(null===t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===Z}(n)||Array.isArray(n)||!!n[L]||!!n.constructor[L]||s(n)||v(n))}function e(r){return t(r)||n(23,r),r[Q].t}function i(n,t,r){void 0===r&&(r=!1),0===o(n)?(r?Object.keys:nn)(n).forEach((function(e){r&&"symbol"==typeof e||t(e,n[e],n)})):n.forEach((function(r,e){return t(e,r,n)}))}function o(n){var t=n[Q];return t?t.i>3?t.i-4:t.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,t){return 2===o(n)?n.has(t):Object.prototype.hasOwnProperty.call(n,t)}function a(n,t){return 2===o(n)?n.get(t):n[t]}function f(n,t,r){var e=o(n);2===e?n.set(t,r):3===e?(n.delete(t),n.add(r)):n[t]=r}function c(n,t){return n===t?0!==n||1/n==1/t:n!=n&&t!=t}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var t=tn(n);delete t[Q];for(var r=nn(t),e=0;e<r.length;e++){var i=r[e],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]})}return Object.create(Object.getPrototypeOf(n),t)}function d(n,e){return void 0===e&&(e=!1),y(n)||t(n)||!r(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,t){return d(t,!0)}),!0),n)}function h(){n(2)}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(t){var r=rn[t];return r||n(18,t),r}function m(n,t){rn[n]||(rn[n]=t)}function _(){return true||0,U}function j(n,t){t&&(b("Patches"),n.u=[],n.s=[],n.v=t)}function O(n){g(n),n.p.forEach(S),n.p=null}function g(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var t=n[Q];0===t.i||1===t.i?t.j():t.O=!0}function P(t,e){e._=e.p.length;var i=e.p[0],o=void 0!==t&&t!==i;return e.h.g||b("ES5").S(e,t,o),o?(i[Q].P&&(O(e),n(4)),r(t)&&(t=M(e,t),e.l||x(e,t)),e.u&&b("Patches").M(i[Q],t,e.u,e.s)):t=M(e,i,[]),O(e),e.u&&e.v(e.u,e.s),t!==H?t:void 0}function M(n,t,r){if(y(t))return t;var e=t[Q];if(!e)return i(t,(function(i,o){return A(n,e,t,i,o,r)}),!0),t;if(e.A!==n)return t;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(t,i){return A(n,e,o,t,i,r)})),x(n,o,!1),r&&n.u&&b("Patches").R(e,r,n.u,n.s)}return e.o}function A(e,i,o,a,c,s){if( false&&0,t(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!t(v))return;e.m=!1}if(r(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,t,r){void 0===r&&(r=!1),n.h.F&&n.m&&d(t,r)}function z(n,t){var r=n[Q];return(r?p(r):n)[t]}function I(n,t){if(t in n)for(var r=Object.getPrototypeOf(n);r;){var e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=Object.getPrototypeOf(r)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function R(n,t,r){var e=s(t)?b("MapSet").N(t,r):v(t)?b("MapSet").T(t,r):n.g?function(n,t){var r=Array.isArray(n),e={i:r?1:0,A:t?t.A:_(),P:!1,I:!1,D:{},l:t,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;r&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(t,r):b("ES5").J(t,r);return(r?r.A:_()).p.push(e),e}function D(e){return t(e)||n(22,e),function n(t){if(!r(t))return t;var e,u=t[Q],c=o(t);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=F(t,c),u.I=!1}else e=F(t,c);return i(e,(function(t,r){u&&a(u.t,t)===r||f(e,t,n(r))})),3===c?new Set(e):e}(e)}function F(n,t){switch(t){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function N(){function r(n,t){var r=s[n];return r?r.enumerable=t:s[n]=r={configurable:!0,enumerable:t,get:function(){var t=this[Q];return false&&0,en.get(t,n)},set:function(t){var r=this[Q]; false&&0,en.set(r,n,t)}},r}function e(n){for(var t=n.length-1;t>=0;t--){var r=n[t][Q];if(!r.P)switch(r.i){case 5:a(r)&&k(r);break;case 4:o(r)&&k(r)}}}function o(n){for(var t=n.t,r=n.k,e=nn(r),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=t[o];if(void 0===a&&!u(t,o))return!0;var f=r[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!t[Q];return e.length!==nn(t).length+(v?0:1)}function a(n){var t=n.k;if(t.length!==n.t.length)return!0;var r=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!r||r.get)}function f(t){t.O&&n(3,JSON.stringify(p(t)))}var s={};m("ES5",{J:function(n,t){var e=Array.isArray(n),i=function(n,t){if(n){for(var e=Array(t.length),i=0;i<t.length;i++)Object.defineProperty(e,""+i,r(i,!0));return e}var o=tn(t);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=r(f,n||!!o[f].enumerable)}return Object.create(Object.getPrototypeOf(t),o)}(e,n),o={i:e?5:4,A:t?t.A:_(),P:!1,I:!1,D:{},l:t,t:n,k:i,o:null,O:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,r,o){o?t(r)&&r[Q].A===n&&e(n.p):(n.u&&function n(t){if(t&&"object"==typeof t){var r=t[Q];if(r){var e=r.t,o=r.k,f=r.D,c=r.i;if(4===c)i(o,(function(t){t!==Q&&(void 0!==e[t]||u(e,t)?f[t]||n(o[t]):(f[t]=!0,k(r)))})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(r))}));else if(5===c){if(a(r)&&(k(r),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)void 0===f[l]&&n(o[l])}}}}(n.p[0]),e(n.p))},K:function(n){return 4===n.i?o(n):a(n)}})}function T(){function e(n){if(!r(n))return n;if(Array.isArray(n))return n.map(e);if(s(n))return new Map(Array.from(n.entries()).map((function(n){return[n[0],e(n[1])]})));if(v(n))return new Set(Array.from(n).map(e));var t=Object.create(Object.getPrototypeOf(n));for(var i in n)t[i]=e(n[i]);return u(n,L)&&(t[L]=n[L]),t}function f(n){return t(n)?e(n):n}var c="add";m("Patches",{$:function(t,r){return r.forEach((function(r){for(var i=r.path,u=r.op,f=t,s=0;s<i.length-1;s++){var v=o(f),p=""+i[s];0!==v&&1!==v||"__proto__"!==p&&"constructor"!==p||n(24),"function"==typeof f&&"prototype"===p&&n(24),"object"!=typeof(f=a(f,p))&&n(15,i.join("/"))}var l=o(f),d=e(r.value),h=i[i.length-1];switch(u){case"replace":switch(l){case 2:return f.set(h,d);case 3:n(16);default:return f[h]=d}case c:switch(l){case 1:return f.splice(h,0,d);case 2:return f.set(h,d);case 3:return f.add(d);default:return f[h]=d}case"remove":switch(l){case 1:return f.splice(h,1);case 2:return f.delete(h);case 3:return f.delete(r.value);default:return delete f[h]}default:n(17,u)}})),t},R:function(n,t,r,e){switch(n.i){case 0:case 4:case 2:return function(n,t,r,e){var o=n.t,s=n.o;i(n.D,(function(n,i){var v=a(o,n),p=a(s,n),l=i?u(o,n)?"replace":c:"remove";if(v!==p||"replace"!==l){var d=t.concat(n);r.push("remove"===l?{op:l,path:d}:{op:l,path:d,value:p}),e.push(l===c?{op:"remove",path:d}:"remove"===l?{op:c,path:d,value:f(v)}:{op:"replace",path:d,value:f(v)})}}))}(n,t,r,e);case 5:case 1:return function(n,t,r,e){var i=n.t,o=n.D,u=n.o;if(u.length<i.length){var a=[u,i];i=a[0],u=a[1];var s=[e,r];r=s[0],e=s[1]}for(var v=0;v<i.length;v++)if(o[v]&&u[v]!==i[v]){var p=t.concat([v]);r.push({op:"replace",path:p,value:f(u[v])}),e.push({op:"replace",path:p,value:f(i[v])})}for(var l=i.length;l<u.length;l++){var d=t.concat([l]);r.push({op:c,path:d,value:f(u[l])})}i.length<u.length&&e.push({op:"replace",path:t.concat(["length"]),value:i.length})}(n,t,r,e);case 3:return function(n,t,r,e){var i=n.t,o=n.o,u=0;i.forEach((function(n){if(!o.has(n)){var i=t.concat([u]);r.push({op:"remove",path:i,value:n}),e.unshift({op:c,path:i,value:n})}u++})),u=0,o.forEach((function(n){if(!i.has(n)){var o=t.concat([u]);r.push({op:c,path:o,value:n}),e.unshift({op:"remove",path:o,value:n})}u++}))}(n,t,r,e)}},M:function(n,t,r,e){r.push({op:"replace",path:[],value:t===H?void 0:t}),e.push({op:"replace",path:[],value:n.t})}})}function C(){function t(n,t){function r(){this.constructor=n}a(n,t),n.prototype=(r.prototype=t.prototype,new r)}function e(n){n.o||(n.D=new Map,n.o=new Map(n.t))}function o(n){n.o||(n.o=new Set,n.t.forEach((function(t){if(r(t)){var e=R(n.A.h,t,n);n.p.set(t,e),n.o.add(e)}else n.o.add(t)})))}function u(t){t.O&&n(3,JSON.stringify(p(t)))}var a=function(n,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r])})(n,t)},f=function(){function n(n,t){return this[Q]={i:2,l:t,A:t?t.A:_(),P:!1,I:!1,o:void 0,D:void 0,t:n,k:this,C:!1,O:!1},this}t(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return p(this[Q]).size}}),o.has=function(n){return p(this[Q]).has(n)},o.set=function(n,t){var r=this[Q];return u(r),p(r).has(n)&&p(r).get(n)===t||(e(r),k(r),r.D.set(n,!0),r.o.set(n,t),r.D.set(n,!0)),this},o.delete=function(n){if(!this.has(n))return!1;var t=this[Q];return u(t),e(t),k(t),t.D.set(n,!1),t.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.D=new Map,i(n.t,(function(t){n.D.set(t,!1)})),n.o.clear())},o.forEach=function(n,t){var r=this;p(this[Q]).forEach((function(e,i){n.call(t,r.get(i),i,r)}))},o.get=function(n){var t=this[Q];u(t);var i=p(t).get(n);if(t.I||!r(i))return i;if(i!==t.t.get(n))return i;var o=R(t.A.h,i,t);return e(t),t.o.set(n,o),o},o.keys=function(){return p(this[Q]).keys()},o.values=function(){var n,t=this,r=this.keys();return(n={})[V]=function(){return t.values()},n.next=function(){var n=r.next();return n.done?n:{done:!1,value:t.get(n.value)}},n},o.entries=function(){var n,t=this,r=this.keys();return(n={})[V]=function(){return t.entries()},n.next=function(){var n=r.next();if(n.done)return n;var e=t.get(n.value);return{done:!1,value:[n.value,e]}},n},o[V]=function(){return this.entries()},n}(),c=function(){function n(n,t){return this[Q]={i:3,l:t,A:t?t.A:_(),P:!1,I:!1,o:void 0,t:n,k:this,p:new Map,O:!1,C:!1},this}t(n,Set);var r=n.prototype;return Object.defineProperty(r,"size",{get:function(){return p(this[Q]).size}}),r.has=function(n){var t=this[Q];return u(t),t.o?!!t.o.has(n)||!(!t.p.has(n)||!t.o.has(t.p.get(n))):t.t.has(n)},r.add=function(n){var t=this[Q];return u(t),this.has(n)||(o(t),k(t),t.o.add(n)),this},r.delete=function(n){if(!this.has(n))return!1;var t=this[Q];return u(t),o(t),k(t),t.o.delete(n)||!!t.p.has(n)&&t.o.delete(t.p.get(n))},r.clear=function(){var n=this[Q];u(n),p(n).size&&(o(n),k(n),n.o.clear())},r.values=function(){var n=this[Q];return u(n),o(n),n.o.values()},r.entries=function(){var n=this[Q];return u(n),o(n),n.o.entries()},r.keys=function(){return this.values()},r[V]=function(){return this.values()},r.forEach=function(n,t){for(var r=this.values(),e=r.next();!e.done;)n.call(t,e.value,e.value,this),e=r.next()},n}();m("MapSet",{N:function(n,t){return new f(n,t)},T:function(n,t){return new c(n,t)}})}function J(){N(),C(),T()}function K(n){return n}function $(n){return n}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",V="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return"Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return"Unsupported patch operation: "+n},18:function(n){return"The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return"'current' expects a draft, got: "+n},23:function(n){return"'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,tn=Object.getOwnPropertyDescriptors||function(n){var t={};return nn(n).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(n,r)})),t},rn={},en={get:function(n,t){if(t===Q)return n;var e=p(n);if(!u(e,t))return function(n,t,r){var e,i=I(t,r);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,t);var i=e[t];return n.I||!r(i)?i:i===z(n.t,t)?(E(n),n.o[t]=R(n.A.h,i,n)):i},has:function(n,t){return t in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,t,r){var e=I(p(n),t);if(null==e?void 0:e.set)return e.set.call(n.k,r),!0;if(!n.P){var i=z(p(n),t),o=null==i?void 0:i[Q];if(o&&o.t===r)return n.o[t]=r,n.D[t]=!1,!0;if(c(r,i)&&(void 0!==r||u(n.t,t)))return!0;E(n),k(n)}return n.o[t]===r&&"number"!=typeof r&&(void 0!==r||t in n.o)||(n.o[t]=r,n.D[t]=!0,!0)},deleteProperty:function(n,t){return void 0!==z(n.t,t)||t in n.t?(n.D[t]=!1,E(n),k(n)):delete n.D[t],n.o&&delete n.o[t],!0},getOwnPropertyDescriptor:function(n,t){var r=p(n),e=Reflect.getOwnPropertyDescriptor(r,t);return e?{writable:!0,configurable:1!==n.i||"length"!==t,enumerable:e.enumerable,value:r[t]}:e},defineProperty:function(){n(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12)}},on={};i(en,(function(n,t){on[n]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),on.deleteProperty=function(t,r){return false&&0,en.deleteProperty.call(this,t[0],r)},on.set=function(t,r,e){return false&&0,en.set.call(this,t[0],r,e,t[0])};var un=function(){function e(t){var e=this;this.g=B,this.F=!0,this.produce=function(t,i,o){if("function"==typeof t&&"function"!=typeof i){var u=i;i=t;var a=e;return function(n){var t=this;void 0===n&&(n=u);for(var r=arguments.length,e=Array(r>1?r-1:0),o=1;o<r;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var r;return(r=i).call.apply(r,[t,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),r(t)){var c=w(e),s=R(e,t,void 0),v=!0;try{f=i(s),v=!1}finally{v?O(c):g(c)}return"undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw O(c),n})):(j(c,o),P(f,c))}if(!t||"object"!=typeof t){if((f=i(t))===H)return;return void 0===f&&(f=t),e.F&&d(f,!0),f}n(21,t)},this.produceWithPatches=function(n,t){return"function"==typeof n?function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return e.produceWithPatches(t,(function(t){return n.apply(void 0,[t].concat(i))}))}:[e.produce(n,t,(function(n,t){r=n,i=t})),r,i];var r,i},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var i=e.prototype;return i.createDraft=function(e){r(e)||n(8),t(e)&&(e=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,g(i),o},i.finishDraft=function(t,r){var e=t&&t[Q]; false&&(0);var i=e.A;return j(i,r),P(void 0,i)},i.setAutoFreeze=function(n){this.F=n},i.setUseProxies=function(t){t&&!B&&n(20),this.g=t},i.applyPatches=function(n,r){var e;for(e=r.length-1;e>=0;e--){var i=r[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}var o=b("Patches").$;return t(n)?o(n,r):this.produce(n,(function(n){return o(n,r.slice(e+1))}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);/* harmony default export */ var immer_esm = (fn);
|
9035 |
//# sourceMappingURL=immer.esm.js.map
|
9036 |
|
9037 |
;// CONCATENATED MODULE: ./src/js/dashboard/store/actions/savingHelpers.js
|
@@ -9347,7 +12171,7 @@ var logger_global = (0,misc/* getGlobalObject */.Rf)();
|
|
9347 |
/** Prefix for logging strings */
|
9348 |
var PREFIX = 'Sentry Logger ';
|
9349 |
/** JSDoc */
|
9350 |
-
var
|
9351 |
/** JSDoc */
|
9352 |
function Logger() {
|
9353 |
this._enabled = false;
|
@@ -9403,7 +12227,7 @@ var Logger = /** @class */ (function () {
|
|
9403 |
}());
|
9404 |
// Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
|
9405 |
logger_global.__SENTRY__ = logger_global.__SENTRY__ || {};
|
9406 |
-
var logger = logger_global.__SENTRY__.logger || (logger_global.__SENTRY__.logger = new
|
9407 |
|
9408 |
//# sourceMappingURL=logger.js.map
|
9409 |
// EXTERNAL MODULE: ./node_modules/@sentry/utils/esm/node.js
|
@@ -11595,7 +14419,7 @@ var merge_default = /*#__PURE__*/__webpack_require__.n(lodash_merge);
|
|
11595 |
var isEqual = __webpack_require__(18446);
|
11596 |
var isEqual_default = /*#__PURE__*/__webpack_require__.n(isEqual);
|
11597 |
;// CONCATENATED MODULE: ./src/js/dashboard/store/actions/Queue.js
|
11598 |
-
function
|
11599 |
|
11600 |
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
11601 |
|
@@ -11609,7 +14433,7 @@ function Queue_defineProperty(obj, key, value) { if (key in obj) { Object.define
|
|
11609 |
|
11610 |
var SavingQueue = /*#__PURE__*/function () {
|
11611 |
function SavingQueue() {
|
11612 |
-
|
11613 |
}
|
11614 |
|
11615 |
_createClass(SavingQueue, null, [{
|
@@ -12483,8 +15307,6 @@ var useIsFocusVisible = __webpack_require__(24896);
|
|
12483 |
var toConsumableArray = __webpack_require__(78927);
|
12484 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
12485 |
var objectWithoutPropertiesLoose = __webpack_require__(19756);
|
12486 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
12487 |
-
var assertThisInitialized = __webpack_require__(63349);
|
12488 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
12489 |
var inheritsLoose = __webpack_require__(41788);
|
12490 |
;// CONCATENATED MODULE: ./node_modules/react-transition-group/esm/TransitionGroupContext.js
|
@@ -13444,7 +16266,7 @@ var ButtonBase = /*#__PURE__*/react.forwardRef(function ButtonBase(props, ref) {
|
|
13444 |
name: 'MuiButtonBase'
|
13445 |
})(ButtonBase));
|
13446 |
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/utils/capitalize.js
|
13447 |
-
var
|
13448 |
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/Button/Button.js
|
13449 |
|
13450 |
|
@@ -13763,13 +16585,13 @@ var Button = /*#__PURE__*/react.forwardRef(function Button(props, ref) {
|
|
13763 |
other = (0,objectWithoutProperties/* default */.Z)(props, ["children", "classes", "className", "color", "component", "disabled", "disableElevation", "disableFocusRipple", "endIcon", "focusVisibleClassName", "fullWidth", "size", "startIcon", "type", "variant"]);
|
13764 |
|
13765 |
var startIcon = startIconProp && /*#__PURE__*/react.createElement("span", {
|
13766 |
-
className: (0,clsx_m/* default */.Z)(classes.startIcon, classes["iconSize".concat((0,
|
13767 |
}, startIconProp);
|
13768 |
var endIcon = endIconProp && /*#__PURE__*/react.createElement("span", {
|
13769 |
-
className: (0,clsx_m/* default */.Z)(classes.endIcon, classes["iconSize".concat((0,
|
13770 |
}, endIconProp);
|
13771 |
return /*#__PURE__*/react.createElement(ButtonBase_ButtonBase, (0,esm_extends/* default */.Z)({
|
13772 |
-
className: (0,clsx_m/* default */.Z)(classes.root, classes[variant], className, color === 'inherit' ? classes.colorInherit : color !== 'default' && classes["".concat(variant).concat((0,
|
13773 |
component: component,
|
13774 |
disabled: disabled,
|
13775 |
focusRipple: !disableFocusRipple,
|
@@ -19794,7 +22616,7 @@ function Tippy(_ref) {
|
|
19794 |
var currentX = false;
|
19795 |
var currentY = false;
|
19796 |
return /*#__PURE__*/react.createElement(tippy_react_esm, {
|
19797 |
-
content: (0,clsx_m/* default */.Z)(props.content, props.shiftClick && " (".concat(translate("utils.shift_click"), ")")),
|
19798 |
hideOnClick: props.hideOnClick,
|
19799 |
theme: "material" // duration={[100, 100]}
|
19800 |
,
|
@@ -20038,7 +22860,7 @@ var ButtonGroup = /*#__PURE__*/react.forwardRef(function ButtonGroup(props, ref)
|
|
20038 |
variant = _props$variant === void 0 ? 'outlined' : _props$variant,
|
20039 |
other = (0,objectWithoutProperties/* default */.Z)(props, ["children", "classes", "className", "color", "component", "disabled", "disableElevation", "disableFocusRipple", "disableRipple", "fullWidth", "orientation", "size", "variant"]);
|
20040 |
|
20041 |
-
var buttonClassName = (0,clsx_m/* default */.Z)(classes.grouped, classes["grouped".concat((0,
|
20042 |
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
20043 |
role: "group",
|
20044 |
className: (0,clsx_m/* default */.Z)(classes.root, className, fullWidth && classes.fullWidth, disableElevation && classes.disableElevation, variant === 'contained' && classes.contained, orientation === 'vertical' && classes.vertical),
|
@@ -20278,8 +23100,6 @@ function PublishButton(_ref) {
|
|
20278 |
hasChanges: state.misc.hasChanges
|
20279 |
};
|
20280 |
})(PublishButton));
|
20281 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
20282 |
-
var defineProperty = __webpack_require__(96156);
|
20283 |
// EXTERNAL MODULE: ./node_modules/@material-ui/styles/esm/useTheme/useTheme.js
|
20284 |
var useTheme = __webpack_require__(159);
|
20285 |
// EXTERNAL MODULE: ./node_modules/@material-ui/styles/esm/getThemeProps/getThemeProps.js
|
@@ -20362,14 +23182,6 @@ if (false) {}
|
|
20362 |
var createChainedFunction = __webpack_require__(82568);
|
20363 |
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/styles/zIndex.js
|
20364 |
var zIndex = __webpack_require__(92781);
|
20365 |
-
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
20366 |
-
function classCallCheck_classCallCheck(instance, Constructor) {
|
20367 |
-
if (!(instance instanceof Constructor)) {
|
20368 |
-
throw new TypeError("Cannot call a class as a function");
|
20369 |
-
}
|
20370 |
-
}
|
20371 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
20372 |
-
var createClass = __webpack_require__(5991);
|
20373 |
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/utils/getScrollbarSize.js
|
20374 |
// A change of the browser zoom change the scrollbar size.
|
20375 |
// Credit https://github.com/twbs/bootstrap/blob/3ffe3a5d82f6f561b82ff78d82b32a7d14aed558/js/src/modal.js#L512-L519
|
@@ -20528,7 +23340,7 @@ function getHiddenSiblings(container) {
|
|
20528 |
|
20529 |
var ModalManager = /*#__PURE__*/function () {
|
20530 |
function ModalManager() {
|
20531 |
-
|
20532 |
|
20533 |
// this.modals[modalIndex] = modal
|
20534 |
this.modals = []; // this.containers[containerIndex] = {
|
@@ -21104,8 +23916,8 @@ var Modal = /*#__PURE__*/react.forwardRef(function Modal(inProps, ref) {
|
|
21104 |
});
|
21105 |
false ? 0 : void 0;
|
21106 |
/* harmony default export */ var Modal_Modal = (Modal);
|
21107 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js +
|
21108 |
-
var slicedToArray = __webpack_require__(
|
21109 |
;// CONCATENATED MODULE: ./node_modules/react-transition-group/esm/config.js
|
21110 |
/* harmony default export */ var config = ({
|
21111 |
disabled: false
|
@@ -21519,7 +24331,7 @@ var Transition = /*#__PURE__*/function (_React$Component) {
|
|
21519 |
Transition.contextType = TransitionGroupContext;
|
21520 |
Transition.propTypes = false ? 0 : {}; // Name the function so it is clearer in the documentation
|
21521 |
|
21522 |
-
function
|
21523 |
|
21524 |
Transition.defaultProps = {
|
21525 |
in: false,
|
@@ -21528,12 +24340,12 @@ Transition.defaultProps = {
|
|
21528 |
appear: false,
|
21529 |
enter: true,
|
21530 |
exit: true,
|
21531 |
-
onEnter:
|
21532 |
-
onEntering:
|
21533 |
-
onEntered:
|
21534 |
-
onExit:
|
21535 |
-
onExiting:
|
21536 |
-
onExited:
|
21537 |
};
|
21538 |
Transition.UNMOUNTED = UNMOUNTED;
|
21539 |
Transition.EXITED = EXITED;
|
@@ -22056,7 +24868,7 @@ var Dialog = /*#__PURE__*/react.forwardRef(function Dialog(props, ref) {
|
|
22056 |
onExited: onExited,
|
22057 |
role: "none presentation"
|
22058 |
}, TransitionProps), /*#__PURE__*/react.createElement("div", {
|
22059 |
-
className: (0,clsx_m/* default */.Z)(classes.container, classes["scroll".concat((0,
|
22060 |
onMouseUp: handleBackdropClick,
|
22061 |
onMouseDown: handleMouseDown
|
22062 |
}, /*#__PURE__*/react.createElement(PaperComponent, (0,esm_extends/* default */.Z)({
|
@@ -22065,7 +24877,7 @@ var Dialog = /*#__PURE__*/react.forwardRef(function Dialog(props, ref) {
|
|
22065 |
"aria-describedby": ariaDescribedby,
|
22066 |
"aria-labelledby": ariaLabelledby
|
22067 |
}, PaperProps, {
|
22068 |
-
className: (0,clsx_m/* default */.Z)(classes.paper, classes["paperScroll".concat((0,
|
22069 |
}), children))));
|
22070 |
});
|
22071 |
false ? 0 : void 0;
|
@@ -22248,7 +25060,7 @@ var Typography = /*#__PURE__*/react.forwardRef(function Typography(props, ref) {
|
|
22248 |
|
22249 |
var Component = component || (paragraph ? 'p' : variantMapping[variant] || defaultVariantMapping[variant]) || 'span';
|
22250 |
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
22251 |
-
className: (0,clsx_m/* default */.Z)(classes.root, className, variant !== 'inherit' && classes[variant], color !== 'initial' && classes["color".concat((0,
|
22252 |
ref: ref
|
22253 |
}, other));
|
22254 |
});
|
@@ -22409,13 +25221,6 @@ function ConfirmDialog_extends() { ConfirmDialog_extends = Object.assign || func
|
|
22409 |
|
22410 |
|
22411 |
|
22412 |
-
var defaultButtons = [{
|
22413 |
-
value: "cancel",
|
22414 |
-
text: translate("modal.cancel")
|
22415 |
-
}, {
|
22416 |
-
value: "confirm",
|
22417 |
-
text: translate("common.confirm")
|
22418 |
-
}];
|
22419 |
function ConfirmDialog(_ref) {
|
22420 |
var onClose = _ref.onClose,
|
22421 |
_ref$icon = _ref.icon,
|
@@ -22435,6 +25240,13 @@ function ConfirmDialog(_ref) {
|
|
22435 |
className = _ref.className,
|
22436 |
_ref$testId = _ref.testId,
|
22437 |
testId = _ref$testId === void 0 ? null : _ref$testId;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
22438 |
|
22439 |
var handleClose = function handleClose(status) {
|
22440 |
onClose(status);
|
@@ -22591,7 +25403,7 @@ var IconButton = /*#__PURE__*/react.forwardRef(function IconButton(props, ref) {
|
|
22591 |
other = (0,objectWithoutProperties/* default */.Z)(props, ["edge", "children", "classes", "className", "color", "disabled", "disableFocusRipple", "size"]);
|
22592 |
|
22593 |
return /*#__PURE__*/react.createElement(ButtonBase_ButtonBase, (0,esm_extends/* default */.Z)({
|
22594 |
-
className: (0,clsx_m/* default */.Z)(classes.root, className, color !== 'default' && classes["color".concat((0,
|
22595 |
'start': classes.edgeStart,
|
22596 |
'end': classes.edgeEnd
|
22597 |
}[edge]),
|
@@ -26810,7 +29622,7 @@ var Icon = /*#__PURE__*/react.forwardRef(function Icon(props, ref) {
|
|
26810 |
other = (0,objectWithoutProperties/* default */.Z)(props, ["classes", "className", "color", "component", "fontSize"]);
|
26811 |
|
26812 |
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
26813 |
-
className: (0,clsx_m/* default */.Z)('material-icons', classes.root, className, color !== 'inherit' && classes["color".concat((0,
|
26814 |
"aria-hidden": true,
|
26815 |
ref: ref
|
26816 |
}, other));
|
@@ -27374,7 +30186,9 @@ var DeleteButton = /*#__PURE__*/react.forwardRef(function (_ref, ref) {
|
|
27374 |
return /*#__PURE__*/react.createElement(Typography_Typography, null, translate("modal.remove.".concat(model, ".cannot_delete")));
|
27375 |
}
|
27376 |
|
27377 |
-
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(Typography_Typography, null, translate("modal.remove.".concat(model, ".question"))), model === "group" && /*#__PURE__*/react.createElement(Typography_Typography, null, translate("modal.remove.group.question_multiple_buttons",
|
|
|
|
|
27378 |
style: {
|
27379 |
marginTop: 15
|
27380 |
}
|
@@ -28090,7 +30904,7 @@ var InputBase = /*#__PURE__*/react.forwardRef(function InputBase(props, ref) {
|
|
28090 |
}
|
28091 |
}, [muiFormControl, startAdornment]);
|
28092 |
return /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
28093 |
-
className: (0,clsx_m/* default */.Z)(classes.root, classes["color".concat((0,
|
28094 |
onClick: handleClick,
|
28095 |
ref: ref
|
28096 |
}, other), startAdornment, /*#__PURE__*/react.createElement(FormControl_FormControlContext.Provider, {
|
@@ -28577,7 +31391,7 @@ var NotchedOutline = /*#__PURE__*/react.forwardRef(function NotchedOutline(props
|
|
28577 |
var labelWidth = labelWidthProp > 0 ? labelWidthProp * 0.75 + 8 : 0.01;
|
28578 |
return /*#__PURE__*/react.createElement("fieldset", (0,esm_extends/* default */.Z)({
|
28579 |
"aria-hidden": true,
|
28580 |
-
style: (0,esm_extends/* default */.Z)((0,defineProperty/* default */.Z)({}, "padding".concat((0,
|
28581 |
className: (0,clsx_m/* default */.Z)(classes.root, className),
|
28582 |
ref: ref
|
28583 |
}, other), /*#__PURE__*/react.createElement("legend", {
|
@@ -28839,7 +31653,7 @@ var FormLabel = /*#__PURE__*/react.forwardRef(function FormLabel(props, ref) {
|
|
28839 |
states: ['color', 'required', 'focused', 'disabled', 'error', 'filled']
|
28840 |
});
|
28841 |
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
28842 |
-
className: (0,clsx_m/* default */.Z)(classes.root, classes["color".concat((0,
|
28843 |
ref: ref
|
28844 |
}, other), children, fcs.required && /*#__PURE__*/react.createElement("span", {
|
28845 |
"aria-hidden": true,
|
@@ -29174,7 +31988,7 @@ var FormControl = /*#__PURE__*/react.forwardRef(function FormControl(props, ref)
|
|
29174 |
return /*#__PURE__*/react.createElement(FormControl_FormControlContext.Provider, {
|
29175 |
value: childContext
|
29176 |
}, /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
29177 |
-
className: (0,clsx_m/* default */.Z)(classes.root, className, margin !== 'none' && classes["margin".concat((0,
|
29178 |
ref: ref
|
29179 |
}, other), children));
|
29180 |
});
|
@@ -29274,8 +32088,6 @@ var FormHelperText = /*#__PURE__*/react.forwardRef(function FormHelperText(props
|
|
29274 |
})(FormHelperText));
|
29275 |
// EXTERNAL MODULE: ./node_modules/@material-ui/styles/esm/mergeClasses/mergeClasses.js
|
29276 |
var mergeClasses = __webpack_require__(65835);
|
29277 |
-
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
29278 |
-
var esm_typeof = __webpack_require__(90484);
|
29279 |
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/Grow/Grow.js
|
29280 |
|
29281 |
|
@@ -30662,7 +33474,7 @@ var SelectInput = /*#__PURE__*/react.forwardRef(function SelectInput(props, ref)
|
|
30662 |
className: classes.nativeInput,
|
30663 |
autoFocus: autoFocus
|
30664 |
}, other)), /*#__PURE__*/react.createElement(IconComponent, {
|
30665 |
-
className: (0,clsx_m/* default */.Z)(classes.icon, classes["icon".concat((0,
|
30666 |
}), /*#__PURE__*/react.createElement(Menu_Menu, (0,esm_extends/* default */.Z)({
|
30667 |
id: "menu-".concat(name || ''),
|
30668 |
anchorEl: displayNode,
|
@@ -30683,8 +33495,8 @@ var SelectInput = /*#__PURE__*/react.forwardRef(function SelectInput(props, ref)
|
|
30683 |
});
|
30684 |
false ? 0 : void 0;
|
30685 |
/* harmony default export */ var Select_SelectInput = (SelectInput);
|
30686 |
-
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/utils/createSvgIcon.js
|
30687 |
-
var createSvgIcon = __webpack_require__(
|
30688 |
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/svg-icons/ArrowDropDown.js
|
30689 |
|
30690 |
|
@@ -30723,7 +33535,7 @@ var NativeSelectInput = /*#__PURE__*/react.forwardRef(function NativeSelectInput
|
|
30723 |
disabled: disabled,
|
30724 |
ref: inputRef || ref
|
30725 |
}, other)), props.multiple ? null : /*#__PURE__*/react.createElement(IconComponent, {
|
30726 |
-
className: (0,clsx_m/* default */.Z)(classes.icon, classes["icon".concat((0,
|
30727 |
}));
|
30728 |
});
|
30729 |
false ? 0 : void 0;
|
@@ -31180,6 +33992,514 @@ var TextField = /*#__PURE__*/react.forwardRef(function TextField(props, ref) {
|
|
31180 |
/* harmony default export */ var TextField_TextField = ((0,withStyles/* default */.Z)(TextField_styles, {
|
31181 |
name: 'MuiTextField'
|
31182 |
})(TextField));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31183 |
;// CONCATENATED MODULE: ./src/js/dashboard/Components/KnowledgeBaseLink/KnowledgeBaseLink.js
|
31184 |
|
31185 |
|
@@ -31203,11 +34523,16 @@ function KnowledgeBaseLink(_ref) {
|
|
31203 |
return /*#__PURE__*/react.createElement("a", {
|
31204 |
href: "https://community.buttonizer.pro/knowledgebase/".concat(articleId),
|
31205 |
target: "_blank",
|
31206 |
-
className: (0,clsx_m/* default */.Z)("knowledgebase-link", size)
|
31207 |
-
|
31208 |
-
|
|
|
|
|
|
|
|
|
|
|
31209 |
}
|
31210 |
-
});
|
31211 |
}
|
31212 |
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Dialogs/FormDialog.js
|
31213 |
function FormDialog_extends() { FormDialog_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return FormDialog_extends.apply(this, arguments); }
|
@@ -31238,14 +34563,6 @@ function FormDialog_objectWithoutPropertiesLoose(source, excluded) { if (source
|
|
31238 |
|
31239 |
|
31240 |
|
31241 |
-
var FormDialog_defaultButtons = [{
|
31242 |
-
value: "cancel",
|
31243 |
-
text: translate("modal.cancel")
|
31244 |
-
}, {
|
31245 |
-
value: "confirm",
|
31246 |
-
text: translate("common.confirm"),
|
31247 |
-
focus: true
|
31248 |
-
}];
|
31249 |
function FormDialog(_ref) {
|
31250 |
var open = _ref.open,
|
31251 |
buttons = _ref.buttons,
|
@@ -31267,12 +34584,21 @@ function FormDialog(_ref) {
|
|
31267 |
kbLink = _ref$kbLink === void 0 ? null : _ref$kbLink,
|
31268 |
props = FormDialog_objectWithoutProperties(_ref, ["open", "buttons", "onClose", "text", "title", "defaultValue", "canBeEmpty", "maxWidth", "fullWidth", "cancelIfSameAsFirstValue", "clearOnConfirm", "kbLink"]);
|
31269 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31270 |
var _React$useState = react.useState(defaultValue === "" ? "" : defaultValue || " "),
|
31271 |
_React$useState2 = FormDialog_slicedToArray(_React$useState, 2),
|
31272 |
value = _React$useState2[0],
|
31273 |
setValue = _React$useState2[1];
|
31274 |
|
31275 |
-
if (!buttons) buttons =
|
31276 |
|
31277 |
var beforeClose = function beforeClose(action) {
|
31278 |
if (action !== "cancel" && !canBeEmpty && value == "") {
|
@@ -31613,6 +34939,9 @@ function downloadObjectAsJson(exportObj, exportName) {
|
|
31613 |
downloadAnchorNode.click();
|
31614 |
downloadAnchorNode.remove();
|
31615 |
}
|
|
|
|
|
|
|
31616 |
;// CONCATENATED MODULE: ./src/js/dashboard/store/actions/exportHelpers.js
|
31617 |
|
31618 |
|
@@ -38178,14 +41507,451 @@ function getCaptureBindings(_ref) {
|
|
38178 |
}
|
38179 |
|
38180 |
event.preventDefault();
|
38181 |
-
var actions = phase.actions.fluidLift(point);
|
38182 |
-
setPhase({
|
38183 |
-
type: 'DRAGGING',
|
38184 |
-
actions: actions
|
38185 |
-
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38186 |
}
|
38187 |
}, {
|
38188 |
-
eventName: '
|
38189 |
fn: function fn(event) {
|
38190 |
var phase = getPhase();
|
38191 |
|
@@ -38201,53 +41967,49 @@ function getCaptureBindings(_ref) {
|
|
38201 |
completed();
|
38202 |
}
|
38203 |
}, {
|
38204 |
-
eventName: '
|
38205 |
fn: function fn(event) {
|
38206 |
-
if (getPhase().type
|
38207 |
-
|
|
|
38208 |
}
|
38209 |
|
|
|
38210 |
cancel();
|
38211 |
}
|
38212 |
}, {
|
38213 |
-
eventName: '
|
38214 |
fn: function fn(event) {
|
38215 |
var phase = getPhase();
|
|
|
|
|
38216 |
|
38217 |
-
if (
|
38218 |
-
cancel();
|
38219 |
return;
|
38220 |
}
|
38221 |
|
38222 |
-
|
38223 |
-
|
38224 |
-
|
38225 |
return;
|
38226 |
}
|
38227 |
|
38228 |
-
|
38229 |
-
|
38230 |
-
|
38231 |
-
|
38232 |
-
|
38233 |
-
|
38234 |
-
|
38235 |
-
|
38236 |
-
passive: true,
|
38237 |
-
capture: false
|
38238 |
-
},
|
38239 |
-
fn: function fn() {
|
38240 |
-
if (getPhase().type === 'PENDING') {
|
38241 |
-
cancel();
|
38242 |
}
|
38243 |
-
}
|
38244 |
-
}, {
|
38245 |
-
eventName: 'webkitmouseforcedown',
|
38246 |
-
fn: function fn(event) {
|
38247 |
-
var phase = getPhase();
|
38248 |
-
!(phase.type !== 'IDLE') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
38249 |
|
38250 |
-
if (
|
|
|
|
|
|
|
|
|
|
|
38251 |
cancel();
|
38252 |
return;
|
38253 |
}
|
@@ -38260,25 +42022,23 @@ function getCaptureBindings(_ref) {
|
|
38260 |
}];
|
38261 |
}
|
38262 |
|
38263 |
-
function
|
38264 |
-
var phaseRef = (0,react.useRef)(idle$
|
38265 |
var unbindEventsRef = (0,react.useRef)(react_beautiful_dnd_esm_noop);
|
|
|
|
|
|
|
|
|
|
|
|
|
38266 |
var startCaptureBinding = useMemo(function () {
|
38267 |
return {
|
38268 |
-
eventName: '
|
38269 |
-
fn: function
|
38270 |
if (event.defaultPrevented) {
|
38271 |
return;
|
38272 |
}
|
38273 |
|
38274 |
-
if (event.button !== primaryButton) {
|
38275 |
-
return;
|
38276 |
-
}
|
38277 |
-
|
38278 |
-
if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) {
|
38279 |
-
return;
|
38280 |
-
}
|
38281 |
-
|
38282 |
var draggableId = api.findClosestDraggableId(event);
|
38283 |
|
38284 |
if (!draggableId) {
|
@@ -38293,55 +42053,25 @@ function useMouseSensor(api) {
|
|
38293 |
return;
|
38294 |
}
|
38295 |
|
38296 |
-
event.
|
|
|
|
|
38297 |
var point = {
|
38298 |
-
x:
|
38299 |
-
y:
|
38300 |
};
|
38301 |
unbindEventsRef.current();
|
38302 |
startPendingDrag(actions, point);
|
38303 |
}
|
38304 |
};
|
38305 |
}, [api]);
|
38306 |
-
var preventForcePressBinding = useMemo(function () {
|
38307 |
-
return {
|
38308 |
-
eventName: 'webkitmouseforcewillbegin',
|
38309 |
-
fn: function fn(event) {
|
38310 |
-
if (event.defaultPrevented) {
|
38311 |
-
return;
|
38312 |
-
}
|
38313 |
-
|
38314 |
-
var id = api.findClosestDraggableId(event);
|
38315 |
-
|
38316 |
-
if (!id) {
|
38317 |
-
return;
|
38318 |
-
}
|
38319 |
-
|
38320 |
-
var options = api.findOptionsForDraggable(id);
|
38321 |
-
|
38322 |
-
if (!options) {
|
38323 |
-
return;
|
38324 |
-
}
|
38325 |
-
|
38326 |
-
if (options.shouldRespectForcePress) {
|
38327 |
-
return;
|
38328 |
-
}
|
38329 |
-
|
38330 |
-
if (!api.canGetLock(id)) {
|
38331 |
-
return;
|
38332 |
-
}
|
38333 |
-
|
38334 |
-
event.preventDefault();
|
38335 |
-
}
|
38336 |
-
};
|
38337 |
-
}, [api]);
|
38338 |
var listenForCapture = useCallback(function listenForCapture() {
|
38339 |
var options = {
|
38340 |
-
|
38341 |
-
|
38342 |
};
|
38343 |
-
unbindEventsRef.current = bindEvents(window, [
|
38344 |
-
}, [
|
38345 |
var stop = useCallback(function () {
|
38346 |
var current = phaseRef.current;
|
38347 |
|
@@ -38349,10 +42079,14 @@ function useMouseSensor(api) {
|
|
38349 |
return;
|
38350 |
}
|
38351 |
|
38352 |
-
|
|
|
|
|
|
|
|
|
38353 |
unbindEventsRef.current();
|
38354 |
listenForCapture();
|
38355 |
-
}, [listenForCapture]);
|
38356 |
var cancel = useCallback(function () {
|
38357 |
var phase = phaseRef.current;
|
38358 |
stop();
|
@@ -38372,7240 +42106,7974 @@ function useMouseSensor(api) {
|
|
38372 |
capture: true,
|
38373 |
passive: false
|
38374 |
};
|
38375 |
-
var
|
38376 |
cancel: cancel,
|
38377 |
completed: stop,
|
38378 |
-
getPhase:
|
38379 |
-
|
38380 |
-
|
38381 |
-
|
38382 |
-
|
38383 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38384 |
});
|
38385 |
-
|
38386 |
-
}, [cancel, stop]);
|
38387 |
var startPendingDrag = useCallback(function startPendingDrag(actions, point) {
|
38388 |
-
!(
|
38389 |
-
|
|
|
38390 |
type: 'PENDING',
|
38391 |
point: point,
|
38392 |
-
actions: actions
|
38393 |
-
|
|
|
38394 |
bindCapturingEvents();
|
38395 |
-
}, [bindCapturingEvents]);
|
38396 |
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function mount() {
|
38397 |
listenForCapture();
|
38398 |
return function unmount() {
|
38399 |
unbindEventsRef.current();
|
|
|
|
|
|
|
|
|
|
|
|
|
38400 |
};
|
38401 |
-
}, [listenForCapture]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38402 |
}
|
38403 |
|
38404 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38405 |
|
38406 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38407 |
|
38408 |
-
|
|
|
|
|
|
|
38409 |
|
38410 |
-
|
38411 |
-
|
38412 |
-
|
38413 |
-
|
38414 |
}
|
38415 |
|
38416 |
-
|
38417 |
-
|
38418 |
-
|
|
|
38419 |
}
|
38420 |
|
38421 |
-
|
38422 |
-
|
38423 |
-
|
38424 |
-
|
38425 |
-
|
38426 |
-
|
38427 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38428 |
}
|
38429 |
|
38430 |
-
|
38431 |
-
|
38432 |
-
|
38433 |
-
|
38434 |
-
|
38435 |
|
38436 |
-
|
38437 |
-
|
38438 |
-
|
38439 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38440 |
}
|
|
|
|
|
38441 |
|
38442 |
-
|
38443 |
-
|
38444 |
-
|
38445 |
-
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38446 |
}
|
|
|
|
|
|
|
|
|
|
|
38447 |
|
38448 |
-
|
38449 |
-
|
38450 |
-
|
38451 |
-
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38452 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38453 |
|
38454 |
-
|
38455 |
-
|
38456 |
-
|
38457 |
-
|
38458 |
-
|
|
|
|
|
38459 |
|
38460 |
-
|
38461 |
-
|
38462 |
-
|
38463 |
-
|
38464 |
|
38465 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38466 |
}
|
38467 |
-
},
|
38468 |
-
|
38469 |
-
|
38470 |
-
|
38471 |
-
|
38472 |
-
|
38473 |
-
|
38474 |
-
|
38475 |
-
|
38476 |
-
},
|
38477 |
-
|
38478 |
-
|
38479 |
-
},
|
38480 |
-
|
38481 |
-
|
38482 |
-
|
38483 |
-
|
38484 |
-
|
38485 |
-
|
38486 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38487 |
}
|
38488 |
-
}, {
|
38489 |
-
eventName: supportedEventName,
|
38490 |
-
fn: cancel
|
38491 |
-
}];
|
38492 |
-
}
|
38493 |
|
38494 |
-
|
38495 |
-
var unbindEventsRef = (0,react.useRef)(noop$1);
|
38496 |
-
var startCaptureBinding = useMemo(function () {
|
38497 |
-
return {
|
38498 |
-
eventName: 'keydown',
|
38499 |
-
fn: function onKeyDown(event) {
|
38500 |
-
if (event.defaultPrevented) {
|
38501 |
-
return;
|
38502 |
-
}
|
38503 |
|
38504 |
-
|
38505 |
-
|
38506 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38507 |
|
38508 |
-
|
|
|
|
|
|
|
38509 |
|
38510 |
-
|
38511 |
-
|
38512 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
38513 |
|
38514 |
-
|
38515 |
-
|
38516 |
-
|
|
|
38517 |
|
38518 |
-
|
38519 |
-
|
38520 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38521 |
|
38522 |
-
|
38523 |
-
var isCapturing = true;
|
38524 |
-
var actions = preDrag.snapLift();
|
38525 |
-
unbindEventsRef.current();
|
38526 |
|
38527 |
-
|
38528 |
-
|
38529 |
-
|
38530 |
-
|
38531 |
-
listenForCapture();
|
38532 |
-
}
|
38533 |
|
38534 |
-
|
38535 |
-
|
38536 |
-
|
38537 |
-
|
38538 |
-
|
38539 |
-
|
38540 |
-
|
38541 |
-
|
38542 |
-
|
38543 |
-
|
38544 |
-
|
|
|
38545 |
};
|
38546 |
-
|
38547 |
-
|
38548 |
-
|
38549 |
-
|
38550 |
-
|
38551 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38552 |
};
|
38553 |
-
}, [
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38554 |
}
|
38555 |
|
38556 |
-
var
|
38557 |
-
|
38558 |
-
|
38559 |
-
|
38560 |
-
|
|
|
|
|
|
|
|
|
38561 |
|
38562 |
-
function
|
38563 |
-
|
38564 |
-
|
38565 |
-
|
38566 |
-
|
38567 |
-
|
38568 |
-
|
38569 |
-
|
38570 |
-
|
38571 |
-
|
38572 |
-
|
38573 |
-
|
38574 |
-
|
38575 |
-
|
38576 |
-
|
38577 |
-
|
38578 |
-
|
38579 |
-
|
38580 |
-
|
38581 |
-
|
38582 |
-
|
|
|
|
|
38583 |
|
38584 |
-
|
38585 |
-
|
38586 |
-
|
|
|
|
|
38587 |
|
38588 |
-
|
38589 |
-
|
38590 |
-
|
38591 |
-
eventName: supportedEventName,
|
38592 |
-
fn: cancel
|
38593 |
-
}];
|
38594 |
-
}
|
38595 |
|
38596 |
-
function
|
38597 |
-
|
38598 |
-
|
38599 |
-
getPhase = _ref2.getPhase;
|
38600 |
-
return [{
|
38601 |
-
eventName: 'touchmove',
|
38602 |
-
options: {
|
38603 |
-
capture: false
|
38604 |
-
},
|
38605 |
-
fn: function fn(event) {
|
38606 |
-
var phase = getPhase();
|
38607 |
|
38608 |
-
|
38609 |
-
|
38610 |
-
|
38611 |
-
}
|
38612 |
|
38613 |
-
|
38614 |
-
|
38615 |
-
|
38616 |
-
|
38617 |
-
|
38618 |
-
|
38619 |
-
|
38620 |
-
|
38621 |
-
event.preventDefault();
|
38622 |
-
phase.actions.move(point);
|
38623 |
-
}
|
38624 |
-
}, {
|
38625 |
-
eventName: 'touchend',
|
38626 |
-
fn: function fn(event) {
|
38627 |
-
var phase = getPhase();
|
38628 |
|
38629 |
-
|
38630 |
-
|
38631 |
-
|
38632 |
-
|
38633 |
|
38634 |
-
|
38635 |
-
|
38636 |
-
|
38637 |
-
});
|
38638 |
-
completed();
|
38639 |
-
}
|
38640 |
-
}, {
|
38641 |
-
eventName: 'touchcancel',
|
38642 |
-
fn: function fn(event) {
|
38643 |
-
if (getPhase().type !== 'DRAGGING') {
|
38644 |
-
cancel();
|
38645 |
-
return;
|
38646 |
-
}
|
38647 |
|
38648 |
-
|
38649 |
-
|
38650 |
-
|
38651 |
-
}, {
|
38652 |
-
eventName: 'touchforcechange',
|
38653 |
-
fn: function fn(event) {
|
38654 |
-
var phase = getPhase();
|
38655 |
-
!(phase.type !== 'IDLE') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
38656 |
-
var touch = event.touches[0];
|
38657 |
|
38658 |
-
|
38659 |
-
|
38660 |
-
|
|
|
|
|
38661 |
|
38662 |
-
|
|
|
|
|
38663 |
|
38664 |
-
|
38665 |
-
|
38666 |
-
|
38667 |
|
38668 |
-
|
|
|
|
|
|
|
38669 |
|
38670 |
-
|
38671 |
-
|
38672 |
-
|
38673 |
-
}
|
38674 |
|
38675 |
-
|
38676 |
-
|
|
|
38677 |
|
38678 |
-
|
38679 |
-
|
38680 |
-
|
38681 |
-
return;
|
38682 |
-
}
|
38683 |
|
38684 |
-
|
38685 |
-
|
38686 |
-
}
|
38687 |
|
38688 |
-
|
38689 |
-
|
38690 |
-
|
38691 |
-
|
38692 |
-
fn: cancel
|
38693 |
-
}];
|
38694 |
-
}
|
38695 |
|
38696 |
-
|
38697 |
-
var phaseRef = (0,react.useRef)(idle$2);
|
38698 |
-
var unbindEventsRef = (0,react.useRef)(react_beautiful_dnd_esm_noop);
|
38699 |
-
var getPhase = useCallback(function getPhase() {
|
38700 |
-
return phaseRef.current;
|
38701 |
-
}, []);
|
38702 |
-
var setPhase = useCallback(function setPhase(phase) {
|
38703 |
-
phaseRef.current = phase;
|
38704 |
-
}, []);
|
38705 |
-
var startCaptureBinding = useMemo(function () {
|
38706 |
-
return {
|
38707 |
-
eventName: 'touchstart',
|
38708 |
-
fn: function onTouchStart(event) {
|
38709 |
-
if (event.defaultPrevented) {
|
38710 |
-
return;
|
38711 |
-
}
|
38712 |
|
38713 |
-
|
|
|
|
|
38714 |
|
38715 |
-
|
38716 |
-
|
38717 |
-
}
|
38718 |
|
38719 |
-
|
38720 |
-
|
38721 |
-
|
|
|
|
|
|
|
38722 |
|
38723 |
-
|
38724 |
-
|
38725 |
-
|
|
|
38726 |
|
38727 |
-
|
38728 |
-
var clientX = touch.clientX,
|
38729 |
-
clientY = touch.clientY;
|
38730 |
-
var point = {
|
38731 |
-
x: clientX,
|
38732 |
-
y: clientY
|
38733 |
-
};
|
38734 |
-
unbindEventsRef.current();
|
38735 |
-
startPendingDrag(actions, point);
|
38736 |
-
}
|
38737 |
-
};
|
38738 |
-
}, [api]);
|
38739 |
-
var listenForCapture = useCallback(function listenForCapture() {
|
38740 |
-
var options = {
|
38741 |
-
capture: true,
|
38742 |
-
passive: false
|
38743 |
-
};
|
38744 |
-
unbindEventsRef.current = bindEvents(window, [startCaptureBinding], options);
|
38745 |
-
}, [startCaptureBinding]);
|
38746 |
-
var stop = useCallback(function () {
|
38747 |
-
var current = phaseRef.current;
|
38748 |
|
38749 |
-
|
38750 |
-
|
38751 |
-
|
38752 |
|
38753 |
-
|
38754 |
-
|
38755 |
-
}
|
38756 |
|
38757 |
-
|
38758 |
-
|
38759 |
-
|
38760 |
-
|
38761 |
-
|
38762 |
-
|
38763 |
-
|
|
|
38764 |
|
38765 |
-
|
38766 |
-
|
38767 |
-
|
38768 |
-
|
38769 |
-
|
|
|
|
|
|
|
|
|
38770 |
|
38771 |
-
|
38772 |
-
|
|
|
38773 |
}
|
38774 |
-
}, [stop]);
|
38775 |
-
var bindCapturingEvents = useCallback(function bindCapturingEvents() {
|
38776 |
-
var options = {
|
38777 |
-
capture: true,
|
38778 |
-
passive: false
|
38779 |
-
};
|
38780 |
-
var args = {
|
38781 |
-
cancel: cancel,
|
38782 |
-
completed: stop,
|
38783 |
-
getPhase: getPhase
|
38784 |
-
};
|
38785 |
-
var unbindTarget = bindEvents(window, getHandleBindings(args), options);
|
38786 |
-
var unbindWindow = bindEvents(window, getWindowBindings(args), options);
|
38787 |
|
38788 |
-
|
38789 |
-
|
38790 |
-
|
38791 |
-
|
38792 |
-
|
38793 |
-
|
38794 |
-
|
38795 |
-
!(phase.type === 'PENDING') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
38796 |
-
var actions = phase.actions.fluidLift(phase.point);
|
38797 |
-
setPhase({
|
38798 |
-
type: 'DRAGGING',
|
38799 |
-
actions: actions,
|
38800 |
-
hasMoved: false
|
38801 |
-
});
|
38802 |
-
}, [getPhase, setPhase]);
|
38803 |
-
var startPendingDrag = useCallback(function startPendingDrag(actions, point) {
|
38804 |
-
!(getPhase().type === 'IDLE') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
38805 |
-
var longPressTimerId = setTimeout(startDragging, timeForLongPress);
|
38806 |
-
setPhase({
|
38807 |
-
type: 'PENDING',
|
38808 |
-
point: point,
|
38809 |
-
actions: actions,
|
38810 |
-
longPressTimerId: longPressTimerId
|
38811 |
});
|
38812 |
-
|
38813 |
-
|
38814 |
-
|
38815 |
-
|
38816 |
-
|
38817 |
-
|
38818 |
-
|
38819 |
-
|
38820 |
-
|
38821 |
-
|
38822 |
-
|
|
|
|
|
38823 |
}
|
38824 |
};
|
38825 |
-
}
|
38826 |
-
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function webkitHack() {
|
38827 |
-
var unbind = bindEvents(window, [{
|
38828 |
-
eventName: 'touchmove',
|
38829 |
-
fn: function fn() {},
|
38830 |
-
options: {
|
38831 |
-
capture: false,
|
38832 |
-
passive: false
|
38833 |
-
}
|
38834 |
-
}]);
|
38835 |
-
return unbind;
|
38836 |
-
}, []);
|
38837 |
-
}
|
38838 |
|
38839 |
-
|
38840 |
-
|
38841 |
-
|
38842 |
-
|
38843 |
-
|
38844 |
-
|
38845 |
});
|
38846 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38847 |
|
38848 |
-
var
|
38849 |
-
|
38850 |
-
button: true,
|
38851 |
-
textarea: true,
|
38852 |
-
select: true,
|
38853 |
-
option: true,
|
38854 |
-
optgroup: true,
|
38855 |
-
video: true,
|
38856 |
-
audio: true
|
38857 |
-
};
|
38858 |
|
38859 |
-
|
38860 |
-
|
38861 |
-
return false;
|
38862 |
}
|
38863 |
|
38864 |
-
|
38865 |
-
|
38866 |
-
if (hasAnInteractiveTag) {
|
38867 |
-
return true;
|
38868 |
}
|
38869 |
|
38870 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38871 |
|
38872 |
-
|
38873 |
-
|
38874 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38875 |
|
38876 |
-
|
38877 |
-
|
38878 |
-
|
|
|
38879 |
|
38880 |
-
|
38881 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38882 |
|
38883 |
-
|
38884 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38885 |
|
38886 |
-
|
38887 |
-
|
38888 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
38889 |
|
38890 |
-
|
|
|
|
|
|
|
38891 |
}
|
38892 |
|
38893 |
-
var
|
38894 |
-
return
|
38895 |
-
}
|
38896 |
|
38897 |
-
function
|
38898 |
-
|
38899 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38900 |
|
38901 |
-
|
38902 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38903 |
|
38904 |
-
|
38905 |
-
|
38906 |
-
|
38907 |
|
38908 |
-
|
38909 |
-
|
38910 |
-
return name in Element.prototype;
|
38911 |
-
});
|
38912 |
-
return value || base;
|
38913 |
-
}();
|
38914 |
|
38915 |
-
|
38916 |
-
|
38917 |
-
|
38918 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38919 |
|
38920 |
-
|
38921 |
-
|
38922 |
-
|
38923 |
|
38924 |
-
|
38925 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38926 |
|
38927 |
-
|
38928 |
-
|
38929 |
-
|
38930 |
-
|
|
|
|
|
|
|
38931 |
|
38932 |
-
|
38933 |
-
}
|
|
|
|
|
|
|
|
|
38934 |
|
38935 |
-
|
38936 |
-
|
38937 |
}
|
38938 |
|
38939 |
-
function
|
38940 |
-
var target = event.target;
|
38941 |
-
|
38942 |
-
if (!react_beautiful_dnd_esm_isElement(target)) {
|
38943 |
-
false ? 0 : void 0;
|
38944 |
-
return null;
|
38945 |
-
}
|
38946 |
|
38947 |
-
|
38948 |
-
|
|
|
|
|
|
|
38949 |
|
38950 |
-
|
38951 |
-
|
38952 |
-
|
|
|
38953 |
|
38954 |
-
if (
|
38955 |
-
|
38956 |
-
return null;
|
38957 |
}
|
38958 |
|
38959 |
-
|
38960 |
-
|
38961 |
-
|
38962 |
-
function tryGetClosestDraggableIdFromEvent(contextId, event) {
|
38963 |
-
var handle = findClosestDragHandleFromEvent(contextId, event);
|
38964 |
-
|
38965 |
-
if (!handle) {
|
38966 |
-
return null;
|
38967 |
}
|
38968 |
|
38969 |
-
return
|
38970 |
-
|
|
|
|
|
|
|
|
|
38971 |
|
38972 |
-
function
|
38973 |
-
var
|
38974 |
-
|
38975 |
-
|
38976 |
-
|
|
|
|
|
|
|
38977 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
38978 |
|
38979 |
-
|
38980 |
-
|
38981 |
-
|
|
|
|
|
|
|
38982 |
|
38983 |
-
|
38984 |
-
|
38985 |
-
|
38986 |
-
|
|
|
|
|
|
|
38987 |
|
38988 |
-
|
38989 |
-
|
|
|
38990 |
|
38991 |
-
function
|
38992 |
-
|
38993 |
-
|
|
|
38994 |
|
38995 |
-
|
38996 |
-
|
38997 |
-
|
38998 |
-
|
38999 |
-
|
39000 |
|
39001 |
-
|
39002 |
-
|
39003 |
-
false ? 0 : void 0;
|
39004 |
}
|
39005 |
|
39006 |
-
|
39007 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39008 |
|
39009 |
-
|
39010 |
-
|
39011 |
-
|
|
|
39012 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39013 |
|
39014 |
-
|
39015 |
-
}
|
39016 |
|
39017 |
-
|
|
|
|
|
|
|
39018 |
}
|
39019 |
|
39020 |
-
function
|
39021 |
-
|
39022 |
-
|
39023 |
-
registry = _ref2.registry,
|
39024 |
-
draggableId = _ref2.draggableId;
|
39025 |
|
39026 |
-
|
39027 |
-
|
39028 |
-
|
|
|
|
|
39029 |
|
39030 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39031 |
|
39032 |
-
if (!
|
39033 |
-
|
39034 |
-
return false;
|
39035 |
}
|
39036 |
|
39037 |
-
|
39038 |
-
return false;
|
39039 |
-
}
|
39040 |
|
39041 |
-
if (
|
39042 |
-
return
|
39043 |
}
|
39044 |
|
39045 |
-
|
39046 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39047 |
|
39048 |
-
|
39049 |
-
|
39050 |
-
|
39051 |
-
|
39052 |
-
|
39053 |
-
|
39054 |
-
|
39055 |
-
sourceEvent = _ref3.sourceEvent;
|
39056 |
-
var shouldStart = canStart({
|
39057 |
-
lockAPI: lockAPI,
|
39058 |
-
store: store,
|
39059 |
-
registry: registry,
|
39060 |
-
draggableId: draggableId
|
39061 |
});
|
|
|
39062 |
|
39063 |
-
|
39064 |
-
|
39065 |
-
}
|
39066 |
|
39067 |
-
|
39068 |
-
|
39069 |
|
39070 |
-
|
39071 |
-
|
39072 |
-
|
39073 |
-
}
|
39074 |
|
39075 |
-
|
39076 |
-
|
39077 |
-
|
|
|
|
|
|
|
39078 |
|
39079 |
-
|
39080 |
-
|
|
|
|
|
39081 |
|
39082 |
-
|
39083 |
-
|
39084 |
-
|
|
|
39085 |
|
39086 |
-
|
39087 |
-
return lockAPI.isActive(lock);
|
39088 |
}
|
39089 |
|
39090 |
-
function
|
39091 |
-
if (
|
39092 |
-
|
39093 |
-
|
39094 |
-
|
39095 |
-
|
39096 |
-
|
39097 |
-
store.dispatch(getAction());
|
39098 |
}
|
39099 |
-
}
|
39100 |
|
39101 |
-
|
39102 |
-
|
39103 |
-
|
39104 |
-
|
39105 |
-
|
39106 |
-
|
39107 |
}
|
39108 |
|
39109 |
-
if (
|
39110 |
-
|
39111 |
-
|
|
|
|
|
|
|
39112 |
}
|
39113 |
|
39114 |
-
|
39115 |
-
|
|
|
|
|
|
|
|
|
39116 |
|
39117 |
-
|
39118 |
-
if (options === void 0) {
|
39119 |
-
options = {
|
39120 |
-
shouldBlockNextClick: false
|
39121 |
-
};
|
39122 |
-
}
|
39123 |
|
39124 |
-
|
|
|
|
|
|
|
39125 |
|
39126 |
-
|
39127 |
-
|
39128 |
-
|
39129 |
-
|
39130 |
-
|
39131 |
-
|
39132 |
-
|
39133 |
-
capture: true
|
39134 |
-
}
|
39135 |
-
}]);
|
39136 |
-
setTimeout(unbind);
|
39137 |
-
}
|
39138 |
|
39139 |
-
|
39140 |
-
|
39141 |
-
reason: reason
|
39142 |
-
}));
|
39143 |
-
}
|
39144 |
|
39145 |
-
|
39146 |
-
|
39147 |
-
|
39148 |
-
|
39149 |
-
|
39150 |
-
|
39151 |
-
|
39152 |
-
|
39153 |
-
},
|
39154 |
-
shouldRespectForcePress: getShouldRespectForcePress,
|
39155 |
-
drop: function drop(options) {
|
39156 |
-
return finish('DROP', options);
|
39157 |
-
},
|
39158 |
-
cancel: function cancel(options) {
|
39159 |
-
return finish('CANCEL', options);
|
39160 |
-
}
|
39161 |
-
}, args.actions);
|
39162 |
}
|
39163 |
|
39164 |
-
|
39165 |
-
|
39166 |
-
tryDispatchWhenDragging(function () {
|
39167 |
-
return move({
|
39168 |
-
client: client
|
39169 |
-
});
|
39170 |
-
});
|
39171 |
-
});
|
39172 |
-
var api = lift$1({
|
39173 |
-
liftActionArgs: {
|
39174 |
-
id: draggableId,
|
39175 |
-
clientSelection: clientSelection,
|
39176 |
-
movementMode: 'FLUID'
|
39177 |
-
},
|
39178 |
-
cleanup: function cleanup() {
|
39179 |
-
return move$1.cancel();
|
39180 |
-
},
|
39181 |
-
actions: {
|
39182 |
-
move: move$1
|
39183 |
-
}
|
39184 |
-
});
|
39185 |
-
return (0,esm_extends/* default */.Z)({}, api, {
|
39186 |
-
move: move$1
|
39187 |
-
});
|
39188 |
}
|
39189 |
|
39190 |
-
|
39191 |
-
|
39192 |
-
|
39193 |
-
|
39194 |
-
|
39195 |
-
|
39196 |
-
return tryDispatchWhenDragging(moveRight);
|
39197 |
-
},
|
39198 |
-
moveDown: function moveDown$1() {
|
39199 |
-
return tryDispatchWhenDragging(moveDown);
|
39200 |
-
},
|
39201 |
-
moveLeft: function moveLeft$1() {
|
39202 |
-
return tryDispatchWhenDragging(moveLeft);
|
39203 |
-
}
|
39204 |
-
};
|
39205 |
-
return lift$1({
|
39206 |
-
liftActionArgs: {
|
39207 |
-
id: draggableId,
|
39208 |
-
clientSelection: getBorderBoxCenterPosition(el),
|
39209 |
-
movementMode: 'SNAP'
|
39210 |
-
},
|
39211 |
-
cleanup: react_beautiful_dnd_esm_noop,
|
39212 |
-
actions: actions
|
39213 |
-
});
|
39214 |
}
|
39215 |
|
39216 |
-
|
39217 |
-
|
39218 |
-
expected: 'PRE_DRAG',
|
39219 |
-
phase: phase,
|
39220 |
-
isLockActive: isLockActive,
|
39221 |
-
shouldWarn: true
|
39222 |
-
});
|
39223 |
|
39224 |
-
|
39225 |
-
|
39226 |
-
|
39227 |
}
|
39228 |
|
39229 |
-
|
39230 |
-
|
39231 |
-
|
39232 |
-
|
39233 |
-
|
39234 |
-
|
39235 |
-
|
39236 |
-
|
39237 |
-
|
39238 |
-
|
39239 |
-
|
39240 |
-
|
39241 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39242 |
};
|
39243 |
-
return
|
39244 |
}
|
39245 |
|
39246 |
-
|
39247 |
-
|
39248 |
-
|
39249 |
-
|
39250 |
-
|
39251 |
-
|
39252 |
-
|
39253 |
-
|
39254 |
-
|
39255 |
-
|
39256 |
-
|
39257 |
-
|
39258 |
-
|
39259 |
-
|
39260 |
-
|
39261 |
-
|
39262 |
-
|
39263 |
-
|
39264 |
-
|
39265 |
-
|
39266 |
-
|
39267 |
-
|
39268 |
-
|
39269 |
-
|
39270 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39271 |
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function () {
|
39272 |
-
|
39273 |
-
|
39274 |
-
|
39275 |
-
|
39276 |
-
lockAPI: lockAPI,
|
39277 |
-
registry: registry,
|
39278 |
-
store: store,
|
39279 |
-
draggableId: draggableId
|
39280 |
-
});
|
39281 |
-
}, [lockAPI, registry, store]);
|
39282 |
-
var tryGetLock = useCallback(function (draggableId, forceStop, options) {
|
39283 |
-
return tryStart({
|
39284 |
-
lockAPI: lockAPI,
|
39285 |
-
registry: registry,
|
39286 |
-
contextId: contextId,
|
39287 |
-
store: store,
|
39288 |
-
draggableId: draggableId,
|
39289 |
-
forceSensorStop: forceStop,
|
39290 |
-
sourceEvent: options && options.sourceEvent ? options.sourceEvent : null
|
39291 |
-
});
|
39292 |
-
}, [contextId, lockAPI, registry, store]);
|
39293 |
-
var findClosestDraggableId = useCallback(function (event) {
|
39294 |
-
return tryGetClosestDraggableIdFromEvent(contextId, event);
|
39295 |
-
}, [contextId]);
|
39296 |
-
var findOptionsForDraggable = useCallback(function (id) {
|
39297 |
-
var entry = registry.draggable.findById(id);
|
39298 |
-
return entry ? entry.options : null;
|
39299 |
}, [registry.draggable]);
|
39300 |
-
|
39301 |
-
if (
|
|
|
39302 |
return;
|
39303 |
}
|
39304 |
|
39305 |
-
|
|
|
|
|
|
|
|
|
39306 |
|
39307 |
-
|
39308 |
-
|
|
|
|
|
39309 |
}
|
39310 |
-
}, [lockAPI, store]);
|
39311 |
-
var isLockClaimed = useCallback(lockAPI.isClaimed, [lockAPI]);
|
39312 |
-
var api = useMemo(function () {
|
39313 |
-
return {
|
39314 |
-
canGetLock: canGetLock,
|
39315 |
-
tryGetLock: tryGetLock,
|
39316 |
-
findClosestDraggableId: findClosestDraggableId,
|
39317 |
-
findOptionsForDraggable: findOptionsForDraggable,
|
39318 |
-
tryReleaseLock: tryReleaseLock,
|
39319 |
-
isLockClaimed: isLockClaimed
|
39320 |
-
};
|
39321 |
-
}, [canGetLock, tryGetLock, findClosestDraggableId, findOptionsForDraggable, tryReleaseLock, isLockClaimed]);
|
39322 |
-
useValidateSensorHooks(useSensors);
|
39323 |
|
39324 |
-
|
39325 |
-
|
39326 |
-
|
39327 |
-
|
39328 |
|
39329 |
-
|
39330 |
-
|
39331 |
-
|
39332 |
-
onBeforeDragStart: props.onBeforeDragStart,
|
39333 |
-
onDragStart: props.onDragStart,
|
39334 |
-
onDragEnd: props.onDragEnd,
|
39335 |
-
onDragUpdate: props.onDragUpdate
|
39336 |
-
};
|
39337 |
-
};
|
39338 |
|
39339 |
-
|
39340 |
-
!lazyRef.current ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
39341 |
-
return lazyRef.current;
|
39342 |
-
}
|
39343 |
|
39344 |
-
|
39345 |
-
|
39346 |
-
|
39347 |
-
sensors = props.sensors,
|
39348 |
-
nonce = props.nonce,
|
39349 |
-
dragHandleUsageInstructions = props.dragHandleUsageInstructions;
|
39350 |
-
var lazyStoreRef = (0,react.useRef)(null);
|
39351 |
-
useStartupValidation();
|
39352 |
-
var lastPropsRef = usePrevious(props);
|
39353 |
-
var getResponders = useCallback(function () {
|
39354 |
-
return createResponders(lastPropsRef.current);
|
39355 |
-
}, [lastPropsRef]);
|
39356 |
-
var announce = useAnnouncer(contextId);
|
39357 |
-
var dragHandleUsageInstructionsId = useHiddenTextElement({
|
39358 |
-
contextId: contextId,
|
39359 |
-
text: dragHandleUsageInstructions
|
39360 |
});
|
39361 |
-
|
39362 |
-
|
39363 |
-
|
39364 |
-
|
39365 |
-
|
39366 |
-
|
39367 |
-
|
39368 |
-
|
39369 |
-
|
39370 |
-
updateDroppableIsCombineEnabled: updateDroppableIsCombineEnabled,
|
39371 |
-
collectionStarting: collectionStarting
|
39372 |
-
}, lazyDispatch);
|
39373 |
-
}, [lazyDispatch]);
|
39374 |
-
var registry = useRegistry();
|
39375 |
-
var dimensionMarshal = useMemo(function () {
|
39376 |
-
return createDimensionMarshal(registry, marshalCallbacks);
|
39377 |
-
}, [registry, marshalCallbacks]);
|
39378 |
-
var autoScroller = useMemo(function () {
|
39379 |
-
return createAutoScroller((0,esm_extends/* default */.Z)({
|
39380 |
-
scrollWindow: scrollWindow,
|
39381 |
-
scrollDroppable: dimensionMarshal.scrollDroppable
|
39382 |
-
}, bindActionCreators({
|
39383 |
-
move: move
|
39384 |
-
}, lazyDispatch)));
|
39385 |
-
}, [dimensionMarshal.scrollDroppable, lazyDispatch]);
|
39386 |
-
var focusMarshal = useFocusMarshal(contextId);
|
39387 |
-
var store = useMemo(function () {
|
39388 |
-
return react_beautiful_dnd_esm_createStore({
|
39389 |
-
announce: announce,
|
39390 |
-
autoScroller: autoScroller,
|
39391 |
-
dimensionMarshal: dimensionMarshal,
|
39392 |
-
focusMarshal: focusMarshal,
|
39393 |
-
getResponders: getResponders,
|
39394 |
-
styleMarshal: styleMarshal
|
39395 |
-
});
|
39396 |
-
}, [announce, autoScroller, dimensionMarshal, focusMarshal, getResponders, styleMarshal]);
|
39397 |
-
|
39398 |
-
if (false) {}
|
39399 |
|
39400 |
-
|
39401 |
-
|
39402 |
-
|
39403 |
-
var state = current.getState();
|
39404 |
|
39405 |
-
|
39406 |
-
|
39407 |
-
|
39408 |
-
|
39409 |
-
var isDragging = useCallback(function () {
|
39410 |
-
var state = getStore(lazyStoreRef).getState();
|
39411 |
-
return state.isDragging || state.phase === 'DROP_ANIMATING';
|
39412 |
-
}, []);
|
39413 |
-
var appCallbacks = useMemo(function () {
|
39414 |
-
return {
|
39415 |
-
isDragging: isDragging,
|
39416 |
-
tryAbort: tryResetStore
|
39417 |
-
};
|
39418 |
-
}, [isDragging, tryResetStore]);
|
39419 |
-
setCallbacks(appCallbacks);
|
39420 |
-
var getCanLift = useCallback(function (id) {
|
39421 |
-
return canStartDrag(getStore(lazyStoreRef).getState(), id);
|
39422 |
}, []);
|
39423 |
-
var
|
39424 |
-
return
|
39425 |
}, []);
|
39426 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39427 |
return {
|
39428 |
-
|
39429 |
-
|
39430 |
-
|
39431 |
-
|
39432 |
-
isMovementAllowed: getIsMovementAllowed,
|
39433 |
-
dragHandleUsageInstructionsId: dragHandleUsageInstructionsId,
|
39434 |
-
registry: registry
|
39435 |
};
|
39436 |
-
}, [
|
39437 |
-
|
39438 |
-
|
39439 |
-
|
39440 |
-
|
39441 |
-
|
39442 |
-
|
39443 |
-
|
39444 |
-
|
39445 |
-
|
39446 |
-
|
39447 |
-
return react.createElement(AppContext.Provider, {
|
39448 |
-
value: appContext
|
39449 |
-
}, react.createElement(components_Provider, {
|
39450 |
-
context: StoreContext,
|
39451 |
-
store: store
|
39452 |
-
}, props.children));
|
39453 |
-
}
|
39454 |
|
39455 |
-
|
39456 |
-
function
|
39457 |
-
|
39458 |
-
|
39459 |
-
|
39460 |
-
|
39461 |
-
|
39462 |
-
|
39463 |
-
|
|
|
|
|
|
|
|
|
39464 |
|
39465 |
-
function
|
39466 |
-
|
39467 |
-
|
39468 |
-
|
39469 |
-
|
39470 |
-
|
39471 |
-
|
39472 |
-
|
39473 |
-
|
39474 |
-
|
39475 |
-
|
39476 |
-
|
39477 |
-
|
39478 |
-
|
39479 |
-
|
39480 |
-
|
39481 |
-
|
39482 |
-
|
39483 |
-
|
39484 |
-
|
39485 |
-
|
39486 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39487 |
}
|
39488 |
|
39489 |
-
var
|
39490 |
-
return
|
39491 |
-
|
39492 |
-
};
|
39493 |
-
};
|
39494 |
|
39495 |
-
var
|
39496 |
-
var
|
39497 |
-
|
39498 |
|
39499 |
-
|
39500 |
-
|
39501 |
-
}
|
39502 |
|
39503 |
-
|
39504 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39505 |
};
|
39506 |
|
39507 |
-
var
|
39508 |
-
|
39509 |
-
var overflow = {
|
39510 |
-
overflowX: style.overflowX,
|
39511 |
-
overflowY: style.overflowY
|
39512 |
-
};
|
39513 |
-
return isEither(overflow, isScroll) || isEither(overflow, isAuto);
|
39514 |
};
|
39515 |
|
39516 |
-
|
39517 |
-
|
39518 |
-
return
|
39519 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39520 |
|
39521 |
-
var
|
39522 |
-
|
39523 |
-
|
|
|
|
|
39524 |
|
39525 |
-
|
39526 |
-
|
39527 |
-
|
|
|
|
|
|
|
|
|
39528 |
|
39529 |
-
|
39530 |
-
|
39531 |
-
overflowX: htmlStyle.overflowX,
|
39532 |
-
overflowY: htmlStyle.overflowY
|
39533 |
-
};
|
39534 |
|
39535 |
-
|
39536 |
-
|
39537 |
-
|
39538 |
|
39539 |
-
|
39540 |
-
|
39541 |
-
|
|
|
39542 |
|
39543 |
-
var
|
39544 |
-
if (el == null) {
|
39545 |
-
return null;
|
39546 |
-
}
|
39547 |
|
39548 |
-
|
39549 |
-
|
39550 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39551 |
|
39552 |
-
if (el === document.documentElement) {
|
39553 |
return null;
|
39554 |
-
}
|
39555 |
|
39556 |
-
|
39557 |
-
|
39558 |
-
}
|
39559 |
|
39560 |
-
|
39561 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39562 |
|
39563 |
-
var
|
39564 |
-
|
39565 |
-
|
|
|
|
|
|
|
|
|
39566 |
}
|
|
|
39567 |
|
39568 |
-
|
39569 |
-
|
39570 |
-
|
39571 |
-
|
39572 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39573 |
|
39574 |
-
|
39575 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39576 |
|
39577 |
-
var
|
39578 |
-
|
39579 |
-
x: el.scrollLeft,
|
39580 |
-
y: el.scrollTop
|
39581 |
};
|
39582 |
-
});
|
39583 |
|
39584 |
-
var
|
39585 |
-
|
39586 |
-
|
39587 |
-
|
|
|
39588 |
|
39589 |
-
|
|
|
|
|
|
|
39590 |
|
39591 |
-
|
39592 |
-
|
39593 |
-
|
39594 |
|
39595 |
-
|
39596 |
-
};
|
39597 |
|
39598 |
-
var
|
39599 |
-
|
39600 |
-
|
39601 |
-
|
39602 |
-
|
39603 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
39604 |
};
|
39605 |
-
});
|
39606 |
|
39607 |
-
var
|
39608 |
-
|
39609 |
-
|
39610 |
-
|
39611 |
-
|
39612 |
-
direction = _ref.direction,
|
39613 |
-
client = _ref.client,
|
39614 |
-
page = _ref.page,
|
39615 |
-
closest = _ref.closest;
|
39616 |
|
39617 |
-
|
39618 |
-
if (!closest) {
|
39619 |
-
return null;
|
39620 |
}
|
39621 |
|
39622 |
-
|
39623 |
-
|
39624 |
-
|
39625 |
-
|
39626 |
-
|
39627 |
-
height: frameClient.paddingBox.height,
|
39628 |
-
width: frameClient.paddingBox.width
|
39629 |
-
});
|
39630 |
-
return {
|
39631 |
-
pageMarginBox: closest.page.marginBox,
|
39632 |
-
frameClient: frameClient,
|
39633 |
-
scrollSize: scrollSize,
|
39634 |
-
shouldClipSubject: closest.shouldClipSubject,
|
39635 |
-
scroll: {
|
39636 |
-
initial: closest.scroll,
|
39637 |
-
current: closest.scroll,
|
39638 |
-
max: maxScroll,
|
39639 |
-
diff: {
|
39640 |
-
value: origin,
|
39641 |
-
displacement: origin
|
39642 |
-
}
|
39643 |
}
|
39644 |
-
};
|
39645 |
-
}();
|
39646 |
|
39647 |
-
|
39648 |
-
|
39649 |
-
page: page,
|
39650 |
-
withPlaceholder: null,
|
39651 |
-
axis: axis,
|
39652 |
-
frame: frame
|
39653 |
-
});
|
39654 |
-
var dimension = {
|
39655 |
-
descriptor: descriptor,
|
39656 |
-
isCombineEnabled: isCombineEnabled,
|
39657 |
-
isFixedOnPage: isFixedOnPage,
|
39658 |
-
axis: axis,
|
39659 |
-
isEnabled: isEnabled,
|
39660 |
-
client: client,
|
39661 |
-
page: page,
|
39662 |
-
frame: frame,
|
39663 |
-
subject: subject
|
39664 |
-
};
|
39665 |
-
return dimension;
|
39666 |
-
});
|
39667 |
|
39668 |
-
|
39669 |
-
|
39670 |
|
39671 |
-
|
39672 |
-
|
39673 |
-
}
|
39674 |
|
39675 |
-
|
39676 |
-
|
39677 |
-
|
39678 |
|
39679 |
-
var
|
39680 |
-
|
39681 |
-
var bottom = top + closestScrollable.scrollHeight;
|
39682 |
-
var right = left + closestScrollable.scrollWidth;
|
39683 |
-
var paddingBox = {
|
39684 |
-
top: top,
|
39685 |
-
right: right,
|
39686 |
-
bottom: bottom,
|
39687 |
-
left: left
|
39688 |
};
|
39689 |
-
|
39690 |
-
|
39691 |
-
borderBox: borderBox,
|
39692 |
-
margin: base.margin,
|
39693 |
-
border: base.border,
|
39694 |
-
padding: base.padding
|
39695 |
-
});
|
39696 |
-
return client;
|
39697 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39698 |
|
39699 |
-
|
39700 |
-
var
|
39701 |
-
|
39702 |
-
env = _ref.env,
|
39703 |
-
windowScroll = _ref.windowScroll,
|
39704 |
-
direction = _ref.direction,
|
39705 |
-
isDropDisabled = _ref.isDropDisabled,
|
39706 |
-
isCombineEnabled = _ref.isCombineEnabled,
|
39707 |
-
shouldClipSubject = _ref.shouldClipSubject;
|
39708 |
-
var closestScrollable = env.closestScrollable;
|
39709 |
-
var client = getClient(ref, closestScrollable);
|
39710 |
-
var page = withScroll(client, windowScroll);
|
39711 |
|
39712 |
-
|
39713 |
-
|
39714 |
-
|
39715 |
-
}
|
39716 |
|
39717 |
-
|
39718 |
-
|
39719 |
-
|
39720 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39721 |
};
|
|
|
|
|
|
|
39722 |
return {
|
39723 |
-
|
39724 |
-
|
39725 |
-
|
39726 |
-
scrollSize: scrollSize,
|
39727 |
-
shouldClipSubject: shouldClipSubject
|
39728 |
};
|
39729 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39730 |
|
39731 |
-
|
39732 |
-
|
39733 |
-
|
39734 |
-
|
39735 |
-
isFixedOnPage: env.isFixedOnPage,
|
39736 |
-
direction: direction,
|
39737 |
-
client: client,
|
39738 |
-
page: page,
|
39739 |
-
closest: closest
|
39740 |
-
});
|
39741 |
-
return dimension;
|
39742 |
-
});
|
39743 |
|
39744 |
-
var
|
39745 |
-
|
39746 |
};
|
39747 |
-
|
39748 |
-
|
|
|
39749 |
};
|
39750 |
-
var getListenerOptions = (function (options) {
|
39751 |
-
return options.shouldPublishImmediately ? immediate : delayed;
|
39752 |
-
});
|
39753 |
|
39754 |
-
function
|
39755 |
-
var
|
39756 |
-
|
39757 |
-
|
39758 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39759 |
|
39760 |
-
var
|
39761 |
-
|
39762 |
-
};
|
39763 |
|
39764 |
-
function
|
39765 |
-
var whileDraggingRef = (0,react.useRef)(null);
|
39766 |
-
var appContext = useRequiredContext(AppContext);
|
39767 |
-
var uniqueId = useUniqueId('droppable');
|
39768 |
-
var registry = appContext.registry,
|
39769 |
-
marshal = appContext.marshal;
|
39770 |
-
var previousRef = usePrevious(args);
|
39771 |
-
var descriptor = useMemo(function () {
|
39772 |
return {
|
39773 |
-
|
39774 |
-
type:
|
39775 |
-
|
|
|
|
|
|
|
39776 |
};
|
39777 |
-
}
|
39778 |
-
var
|
39779 |
-
|
39780 |
-
|
39781 |
-
!whileDraggingRef.current ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
39782 |
-
var scroll = {
|
39783 |
-
x: x,
|
39784 |
-
y: y
|
39785 |
-
};
|
39786 |
-
marshal.updateDroppableScroll(descriptor.id, scroll);
|
39787 |
-
});
|
39788 |
-
}, [descriptor.id, marshal]);
|
39789 |
-
var getClosestScroll = useCallback(function () {
|
39790 |
-
var dragging = whileDraggingRef.current;
|
39791 |
|
39792 |
-
if (
|
39793 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39794 |
}
|
39795 |
|
39796 |
-
|
39797 |
-
|
39798 |
-
|
39799 |
-
var scroll = getClosestScroll();
|
39800 |
-
memoizedUpdateScroll(scroll.x, scroll.y);
|
39801 |
-
}, [getClosestScroll, memoizedUpdateScroll]);
|
39802 |
-
var scheduleScrollUpdate = useMemo(function () {
|
39803 |
-
return raf_schd_esm(updateScroll);
|
39804 |
-
}, [updateScroll]);
|
39805 |
-
var onClosestScroll = useCallback(function () {
|
39806 |
-
var dragging = whileDraggingRef.current;
|
39807 |
-
var closest = getClosestScrollableFromDrag(dragging);
|
39808 |
-
!(dragging && closest) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
39809 |
-
var options = dragging.scrollOptions;
|
39810 |
|
39811 |
-
if (
|
39812 |
-
|
39813 |
-
return;
|
39814 |
}
|
39815 |
|
39816 |
-
|
39817 |
-
|
39818 |
-
|
39819 |
-
|
39820 |
-
|
39821 |
-
var ref = previous.getDroppableRef();
|
39822 |
-
!ref ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
39823 |
-
var env = getEnv(ref);
|
39824 |
-
var dragging = {
|
39825 |
-
ref: ref,
|
39826 |
-
descriptor: descriptor,
|
39827 |
-
env: env,
|
39828 |
-
scrollOptions: options
|
39829 |
};
|
39830 |
-
|
39831 |
-
|
39832 |
-
|
39833 |
-
|
39834 |
-
|
39835 |
-
|
39836 |
-
|
39837 |
-
isDropDisabled: previous.isDropDisabled,
|
39838 |
-
isCombineEnabled: previous.isCombineEnabled,
|
39839 |
-
shouldClipSubject: !previous.ignoreContainerClipping
|
39840 |
-
});
|
39841 |
-
var scrollable = env.closestScrollable;
|
39842 |
|
39843 |
-
|
39844 |
-
|
39845 |
-
|
|
|
|
|
39846 |
|
39847 |
-
|
39848 |
-
|
39849 |
|
39850 |
-
|
39851 |
-
|
39852 |
-
|
39853 |
-
var dragging = whileDraggingRef.current;
|
39854 |
-
var closest = getClosestScrollableFromDrag(dragging);
|
39855 |
-
!(dragging && closest) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
39856 |
-
return getScroll$1(closest);
|
39857 |
-
}, []);
|
39858 |
-
var dragStopped = useCallback(function () {
|
39859 |
-
var dragging = whileDraggingRef.current;
|
39860 |
-
!dragging ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
39861 |
-
var closest = getClosestScrollableFromDrag(dragging);
|
39862 |
-
whileDraggingRef.current = null;
|
39863 |
|
39864 |
-
|
39865 |
-
|
|
|
39866 |
}
|
39867 |
|
39868 |
-
|
39869 |
-
|
39870 |
-
|
39871 |
-
|
39872 |
-
|
39873 |
-
var dragging = whileDraggingRef.current;
|
39874 |
-
!dragging ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
39875 |
-
var closest = getClosestScrollableFromDrag(dragging);
|
39876 |
-
!closest ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
39877 |
-
closest.scrollTop += change.y;
|
39878 |
-
closest.scrollLeft += change.x;
|
39879 |
-
}, []);
|
39880 |
-
var callbacks = useMemo(function () {
|
39881 |
-
return {
|
39882 |
-
getDimensionAndWatchScroll: getDimensionAndWatchScroll,
|
39883 |
-
getScrollWhileDragging: getScrollWhileDragging,
|
39884 |
-
dragStopped: dragStopped,
|
39885 |
-
scroll: scroll
|
39886 |
-
};
|
39887 |
-
}, [dragStopped, getDimensionAndWatchScroll, getScrollWhileDragging, scroll]);
|
39888 |
-
var entry = useMemo(function () {
|
39889 |
-
return {
|
39890 |
-
uniqueId: uniqueId,
|
39891 |
-
descriptor: descriptor,
|
39892 |
-
callbacks: callbacks
|
39893 |
-
};
|
39894 |
-
}, [callbacks, descriptor, uniqueId]);
|
39895 |
-
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function () {
|
39896 |
-
publishedDescriptorRef.current = entry.descriptor;
|
39897 |
-
registry.droppable.register(entry);
|
39898 |
-
return function () {
|
39899 |
-
if (whileDraggingRef.current) {
|
39900 |
-
false ? 0 : void 0;
|
39901 |
-
dragStopped();
|
39902 |
}
|
39903 |
|
39904 |
-
|
39905 |
-
};
|
39906 |
-
}, [callbacks, descriptor, dragStopped, entry, marshal, registry.droppable]);
|
39907 |
-
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function () {
|
39908 |
-
if (!whileDraggingRef.current) {
|
39909 |
-
return;
|
39910 |
-
}
|
39911 |
|
39912 |
-
|
39913 |
-
}, [args.isDropDisabled, marshal]);
|
39914 |
-
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function () {
|
39915 |
-
if (!whileDraggingRef.current) {
|
39916 |
-
return;
|
39917 |
}
|
39918 |
|
39919 |
-
|
39920 |
-
|
39921 |
-
}
|
39922 |
|
39923 |
-
|
|
|
|
|
39924 |
|
39925 |
-
var
|
39926 |
-
|
39927 |
-
|
39928 |
-
margin: react_beautiful_dnd_esm_noSpacing
|
39929 |
-
};
|
39930 |
|
39931 |
-
|
39932 |
-
|
39933 |
-
|
39934 |
-
animate = _ref.animate;
|
39935 |
|
39936 |
-
|
39937 |
-
|
39938 |
-
|
39939 |
|
39940 |
-
|
39941 |
-
|
39942 |
-
}
|
39943 |
|
39944 |
-
|
39945 |
-
height: placeholder.client.borderBox.height,
|
39946 |
-
width: placeholder.client.borderBox.width,
|
39947 |
-
margin: placeholder.client.margin
|
39948 |
};
|
|
|
|
|
|
|
|
|
|
|
39949 |
};
|
39950 |
|
39951 |
-
|
39952 |
-
|
39953 |
-
|
39954 |
-
|
39955 |
-
|
39956 |
-
|
39957 |
-
|
39958 |
-
|
39959 |
-
|
39960 |
-
|
39961 |
-
|
39962 |
-
|
39963 |
-
|
39964 |
-
|
39965 |
-
marginTop: size.margin.top,
|
39966 |
-
marginRight: size.margin.right,
|
39967 |
-
marginBottom: size.margin.bottom,
|
39968 |
-
marginLeft: size.margin.left,
|
39969 |
-
flexShrink: '0',
|
39970 |
-
flexGrow: '0',
|
39971 |
-
pointerEvents: 'none',
|
39972 |
-
transition: animate !== 'none' ? react_beautiful_dnd_esm_transitions.placeholder : null
|
39973 |
-
};
|
39974 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
39975 |
|
39976 |
-
function Placeholder(props) {
|
39977 |
-
var animateOpenTimerRef = (0,react.useRef)(null);
|
39978 |
-
var tryClearAnimateOpenTimer = useCallback(function () {
|
39979 |
-
if (!animateOpenTimerRef.current) {
|
39980 |
-
return;
|
39981 |
-
}
|
39982 |
|
39983 |
-
clearTimeout(animateOpenTimerRef.current);
|
39984 |
-
animateOpenTimerRef.current = null;
|
39985 |
-
}, []);
|
39986 |
-
var animate = props.animate,
|
39987 |
-
onTransitionEnd = props.onTransitionEnd,
|
39988 |
-
onClose = props.onClose,
|
39989 |
-
contextId = props.contextId;
|
39990 |
|
39991 |
-
|
39992 |
-
|
39993 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
39994 |
|
39995 |
-
|
39996 |
-
|
39997 |
-
|
39998 |
-
|
39999 |
|
40000 |
-
if (animate !== 'open') {
|
40001 |
-
tryClearAnimateOpenTimer();
|
40002 |
-
setIsAnimatingOpenOnMount(false);
|
40003 |
-
return noop$2;
|
40004 |
-
}
|
40005 |
|
40006 |
-
if (animateOpenTimerRef.current) {
|
40007 |
-
return noop$2;
|
40008 |
-
}
|
40009 |
|
40010 |
-
animateOpenTimerRef.current = setTimeout(function () {
|
40011 |
-
animateOpenTimerRef.current = null;
|
40012 |
-
setIsAnimatingOpenOnMount(false);
|
40013 |
-
});
|
40014 |
-
return tryClearAnimateOpenTimer;
|
40015 |
-
}, [animate, isAnimatingOpenOnMount, tryClearAnimateOpenTimer]);
|
40016 |
-
var onSizeChangeEnd = useCallback(function (event) {
|
40017 |
-
if (event.propertyName !== 'height') {
|
40018 |
-
return;
|
40019 |
-
}
|
40020 |
|
40021 |
-
|
|
|
|
|
|
|
40022 |
|
40023 |
-
|
40024 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40025 |
}
|
40026 |
-
}, [animate, onClose, onTransitionEnd]);
|
40027 |
-
var style = getStyle({
|
40028 |
-
isAnimatingOpenOnMount: isAnimatingOpenOnMount,
|
40029 |
-
animate: props.animate,
|
40030 |
-
placeholder: props.placeholder
|
40031 |
-
});
|
40032 |
-
return react.createElement(props.placeholder.tagName, {
|
40033 |
-
style: style,
|
40034 |
-
'data-rbd-placeholder-context-id': contextId,
|
40035 |
-
onTransitionEnd: onSizeChangeEnd,
|
40036 |
-
ref: props.innerRef
|
40037 |
-
});
|
40038 |
}
|
|
|
|
|
40039 |
|
40040 |
-
|
|
|
40041 |
|
40042 |
-
|
|
|
|
|
40043 |
|
40044 |
-
function checkIsValidInnerRef(el) {
|
40045 |
-
!(el && isHtmlElement(el)) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
40046 |
-
}
|
40047 |
|
40048 |
-
|
40049 |
-
|
40050 |
-
|
|
|
|
|
40051 |
|
40052 |
-
|
40053 |
-
|
40054 |
-
|
40055 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40056 |
}
|
|
|
|
|
40057 |
|
40058 |
-
var
|
40059 |
-
var props = _ref.props;
|
40060 |
-
!props.droppableId ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
40061 |
-
!(typeof props.droppableId === 'string') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
40062 |
-
}, function _boolean(_ref2) {
|
40063 |
-
var props = _ref2.props;
|
40064 |
-
!isBoolean(props.isDropDisabled) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
40065 |
-
!isBoolean(props.isCombineEnabled) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
40066 |
-
!isBoolean(props.ignoreContainerClipping) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
40067 |
-
}, function ref(_ref3) {
|
40068 |
-
var getDroppableRef = _ref3.getDroppableRef;
|
40069 |
-
checkIsValidInnerRef(getDroppableRef());
|
40070 |
-
}];
|
40071 |
-
var standard = [function placeholder(_ref4) {
|
40072 |
-
var props = _ref4.props,
|
40073 |
-
getPlaceholderRef = _ref4.getPlaceholderRef;
|
40074 |
|
40075 |
-
|
40076 |
-
|
40077 |
-
|
|
|
|
|
40078 |
|
40079 |
-
|
40080 |
|
40081 |
-
if (ref) {
|
40082 |
-
return;
|
40083 |
-
}
|
40084 |
|
40085 |
-
false ? 0 : void 0;
|
40086 |
-
}];
|
40087 |
-
var virtual = [function hasClone(_ref5) {
|
40088 |
-
var props = _ref5.props;
|
40089 |
-
!props.renderClone ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
40090 |
-
}, function hasNoPlaceholder(_ref6) {
|
40091 |
-
var getPlaceholderRef = _ref6.getPlaceholderRef;
|
40092 |
-
!!getPlaceholderRef() ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
40093 |
-
}];
|
40094 |
-
function useValidation(args) {
|
40095 |
-
useDevSetupWarning(function () {
|
40096 |
-
runChecks(args, shared);
|
40097 |
|
40098 |
-
|
40099 |
-
|
40100 |
-
|
|
|
|
|
|
|
|
|
|
|
40101 |
|
40102 |
-
|
40103 |
-
|
40104 |
-
|
40105 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40106 |
}
|
|
|
|
|
40107 |
|
40108 |
-
|
40109 |
-
(0,inheritsLoose/* default */.Z)(AnimateInOut, _React$PureComponent);
|
40110 |
|
40111 |
-
|
40112 |
-
var _this;
|
40113 |
|
40114 |
-
|
40115 |
-
args[_key] = arguments[_key];
|
40116 |
-
}
|
40117 |
|
40118 |
-
|
40119 |
-
_this.state = {
|
40120 |
-
isVisible: Boolean(_this.props.on),
|
40121 |
-
data: _this.props.on,
|
40122 |
-
animate: _this.props.shouldAnimate && _this.props.on ? 'open' : 'none'
|
40123 |
-
};
|
40124 |
|
40125 |
-
|
40126 |
-
if (_this.state.animate !== 'close') {
|
40127 |
-
return;
|
40128 |
-
}
|
40129 |
|
40130 |
-
|
40131 |
-
isVisible: false
|
40132 |
-
});
|
40133 |
-
};
|
40134 |
|
40135 |
-
|
40136 |
-
}
|
40137 |
|
40138 |
-
|
40139 |
-
if (!props.shouldAnimate) {
|
40140 |
-
return {
|
40141 |
-
isVisible: Boolean(props.on),
|
40142 |
-
data: props.on,
|
40143 |
-
animate: 'none'
|
40144 |
-
};
|
40145 |
-
}
|
40146 |
|
40147 |
-
|
40148 |
-
return {
|
40149 |
-
isVisible: true,
|
40150 |
-
data: props.on,
|
40151 |
-
animate: 'open'
|
40152 |
-
};
|
40153 |
-
}
|
40154 |
|
40155 |
-
|
40156 |
-
return {
|
40157 |
-
isVisible: true,
|
40158 |
-
data: state.data,
|
40159 |
-
animate: 'close'
|
40160 |
-
};
|
40161 |
-
}
|
40162 |
|
40163 |
-
|
40164 |
-
isVisible: false,
|
40165 |
-
animate: 'close',
|
40166 |
-
data: null
|
40167 |
-
};
|
40168 |
-
};
|
40169 |
|
40170 |
-
var _proto = AnimateInOut.prototype;
|
40171 |
|
40172 |
-
_proto.render = function render() {
|
40173 |
-
if (!this.state.isVisible) {
|
40174 |
-
return null;
|
40175 |
-
}
|
40176 |
|
40177 |
-
var provided = {
|
40178 |
-
onClose: this.onClose,
|
40179 |
-
data: this.state.data,
|
40180 |
-
animate: this.state.animate
|
40181 |
-
};
|
40182 |
-
return this.props.children(provided);
|
40183 |
-
};
|
40184 |
|
40185 |
-
return AnimateInOut;
|
40186 |
-
}(react.PureComponent);
|
40187 |
|
40188 |
-
var
|
40189 |
-
|
40190 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40191 |
};
|
40192 |
|
40193 |
-
var
|
40194 |
-
|
40195 |
-
return react_beautiful_dnd_esm_transitions.drop(dropping.duration);
|
40196 |
-
}
|
40197 |
|
40198 |
-
|
40199 |
-
return react_beautiful_dnd_esm_transitions.snap;
|
40200 |
-
}
|
40201 |
|
40202 |
-
|
40203 |
-
|
40204 |
|
40205 |
-
|
40206 |
-
if (!isCombining) {
|
40207 |
-
return null;
|
40208 |
-
}
|
40209 |
|
40210 |
-
|
40211 |
-
|
|
|
40212 |
|
40213 |
-
|
40214 |
-
if (dragging.forceShouldAnimate != null) {
|
40215 |
-
return dragging.forceShouldAnimate;
|
40216 |
-
}
|
40217 |
|
40218 |
-
|
40219 |
-
|
|
|
40220 |
|
40221 |
-
|
40222 |
-
var dimension = dragging.dimension;
|
40223 |
-
var box = dimension.client;
|
40224 |
-
var offset = dragging.offset,
|
40225 |
-
combineWith = dragging.combineWith,
|
40226 |
-
dropping = dragging.dropping;
|
40227 |
-
var isCombining = Boolean(combineWith);
|
40228 |
-
var shouldAnimate = getShouldDraggingAnimate(dragging);
|
40229 |
-
var isDropAnimating = Boolean(dropping);
|
40230 |
-
var transform = isDropAnimating ? transforms.drop(offset, isCombining) : transforms.moveTo(offset);
|
40231 |
-
var style = {
|
40232 |
-
position: 'fixed',
|
40233 |
-
top: box.marginBox.top,
|
40234 |
-
left: box.marginBox.left,
|
40235 |
-
boxSizing: 'border-box',
|
40236 |
-
width: box.borderBox.width,
|
40237 |
-
height: box.borderBox.height,
|
40238 |
-
transition: getDraggingTransition(shouldAnimate, dropping),
|
40239 |
-
transform: transform,
|
40240 |
-
opacity: getDraggingOpacity(isCombining, isDropAnimating),
|
40241 |
-
zIndex: isDropAnimating ? zIndexOptions.dropAnimating : zIndexOptions.dragging,
|
40242 |
-
pointerEvents: 'none'
|
40243 |
-
};
|
40244 |
-
return style;
|
40245 |
-
}
|
40246 |
|
40247 |
-
function
|
40248 |
-
|
40249 |
-
|
40250 |
-
|
40251 |
-
};
|
40252 |
-
}
|
40253 |
|
40254 |
-
function
|
40255 |
-
|
40256 |
-
|
|
|
40257 |
|
40258 |
-
|
40259 |
-
|
40260 |
-
|
40261 |
-
|
|
|
|
|
40262 |
|
40263 |
-
|
40264 |
-
|
40265 |
-
|
40266 |
-
|
40267 |
-
var placeholder = {
|
40268 |
-
client: client,
|
40269 |
-
tagName: el.tagName.toLowerCase(),
|
40270 |
-
display: computedStyles.display
|
40271 |
-
};
|
40272 |
-
var displaceBy = {
|
40273 |
-
x: client.marginBox.width,
|
40274 |
-
y: client.marginBox.height
|
40275 |
-
};
|
40276 |
-
var dimension = {
|
40277 |
-
descriptor: descriptor,
|
40278 |
-
placeholder: placeholder,
|
40279 |
-
displaceBy: displaceBy,
|
40280 |
-
client: client,
|
40281 |
-
page: page
|
40282 |
-
};
|
40283 |
-
return dimension;
|
40284 |
-
}
|
40285 |
|
40286 |
-
|
40287 |
-
|
40288 |
-
|
40289 |
-
|
40290 |
-
|
40291 |
-
|
40292 |
-
shouldRespectForcePress = args.shouldRespectForcePress,
|
40293 |
-
isEnabled = args.isEnabled;
|
40294 |
-
var options = useMemo(function () {
|
40295 |
-
return {
|
40296 |
-
canDragInteractiveElements: canDragInteractiveElements,
|
40297 |
-
shouldRespectForcePress: shouldRespectForcePress,
|
40298 |
-
isEnabled: isEnabled
|
40299 |
-
};
|
40300 |
-
}, [canDragInteractiveElements, isEnabled, shouldRespectForcePress]);
|
40301 |
-
var getDimension = useCallback(function (windowScroll) {
|
40302 |
-
var el = getDraggableRef();
|
40303 |
-
!el ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
40304 |
-
return getDimension$1(descriptor, el, windowScroll);
|
40305 |
-
}, [descriptor, getDraggableRef]);
|
40306 |
-
var entry = useMemo(function () {
|
40307 |
-
return {
|
40308 |
-
uniqueId: uniqueId,
|
40309 |
-
descriptor: descriptor,
|
40310 |
-
options: options,
|
40311 |
-
getDimension: getDimension
|
40312 |
-
};
|
40313 |
-
}, [descriptor, getDimension, options, uniqueId]);
|
40314 |
-
var publishedRef = (0,react.useRef)(entry);
|
40315 |
-
var isFirstPublishRef = (0,react.useRef)(true);
|
40316 |
-
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function () {
|
40317 |
-
registry.draggable.register(publishedRef.current);
|
40318 |
-
return function () {
|
40319 |
-
return registry.draggable.unregister(publishedRef.current);
|
40320 |
-
};
|
40321 |
-
}, [registry.draggable]);
|
40322 |
-
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function () {
|
40323 |
-
if (isFirstPublishRef.current) {
|
40324 |
-
isFirstPublishRef.current = false;
|
40325 |
-
return;
|
40326 |
-
}
|
40327 |
|
40328 |
-
|
40329 |
-
|
40330 |
-
|
40331 |
-
}, [entry, registry.draggable]);
|
40332 |
-
}
|
40333 |
|
40334 |
-
|
40335 |
-
|
40336 |
-
|
40337 |
-
return "Draggable[id: " + id + "]: ";
|
40338 |
-
}
|
40339 |
|
40340 |
-
|
40341 |
-
|
40342 |
-
!(typeof id === 'string') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
40343 |
-
!isInteger(props.index) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
40344 |
|
40345 |
-
|
40346 |
-
|
40347 |
-
|
|
|
40348 |
|
40349 |
-
|
|
|
40350 |
|
40351 |
-
|
40352 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
40353 |
}
|
40354 |
-
}
|
40355 |
-
|
40356 |
-
function
|
40357 |
-
|
40358 |
-
|
40359 |
-
|
40360 |
-
|
40361 |
-
|
40362 |
-
|
40363 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40364 |
|
40365 |
-
|
40366 |
-
|
40367 |
-
}
|
40368 |
|
40369 |
-
|
40370 |
-
|
40371 |
-
|
40372 |
-
|
40373 |
-
|
40374 |
-
|
40375 |
-
return ref.current;
|
40376 |
-
}, []);
|
40377 |
|
40378 |
-
|
40379 |
-
contextId = _useRequiredContext.contextId,
|
40380 |
-
dragHandleUsageInstructionsId = _useRequiredContext.dragHandleUsageInstructionsId,
|
40381 |
-
registry = _useRequiredContext.registry;
|
40382 |
|
40383 |
-
|
40384 |
-
type = _useRequiredContext2.type,
|
40385 |
-
droppableId = _useRequiredContext2.droppableId;
|
40386 |
|
40387 |
-
|
40388 |
-
return {
|
40389 |
-
id: props.draggableId,
|
40390 |
-
index: props.index,
|
40391 |
-
type: type,
|
40392 |
-
droppableId: droppableId
|
40393 |
-
};
|
40394 |
-
}, [props.draggableId, props.index, type, droppableId]);
|
40395 |
-
var children = props.children,
|
40396 |
-
draggableId = props.draggableId,
|
40397 |
-
isEnabled = props.isEnabled,
|
40398 |
-
shouldRespectForcePress = props.shouldRespectForcePress,
|
40399 |
-
canDragInteractiveElements = props.canDragInteractiveElements,
|
40400 |
-
isClone = props.isClone,
|
40401 |
-
mapped = props.mapped,
|
40402 |
-
dropAnimationFinishedAction = props.dropAnimationFinished;
|
40403 |
-
useValidation$1(props, contextId, getRef);
|
40404 |
-
useClonePropValidation(isClone);
|
40405 |
|
40406 |
-
|
40407 |
-
var forPublisher = useMemo(function () {
|
40408 |
-
return {
|
40409 |
-
descriptor: descriptor,
|
40410 |
-
registry: registry,
|
40411 |
-
getDraggableRef: getRef,
|
40412 |
-
canDragInteractiveElements: canDragInteractiveElements,
|
40413 |
-
shouldRespectForcePress: shouldRespectForcePress,
|
40414 |
-
isEnabled: isEnabled
|
40415 |
-
};
|
40416 |
-
}, [descriptor, registry, getRef, canDragInteractiveElements, shouldRespectForcePress, isEnabled]);
|
40417 |
-
useDraggablePublisher(forPublisher);
|
40418 |
-
}
|
40419 |
|
40420 |
-
|
40421 |
-
return isEnabled ? {
|
40422 |
-
tabIndex: 0,
|
40423 |
-
role: 'button',
|
40424 |
-
'aria-describedby': dragHandleUsageInstructionsId,
|
40425 |
-
'data-rbd-drag-handle-draggable-id': draggableId,
|
40426 |
-
'data-rbd-drag-handle-context-id': contextId,
|
40427 |
-
draggable: false,
|
40428 |
-
onDragStart: preventHtml5Dnd
|
40429 |
-
} : null;
|
40430 |
-
}, [contextId, dragHandleUsageInstructionsId, draggableId, isEnabled]);
|
40431 |
-
var onMoveEnd = useCallback(function (event) {
|
40432 |
-
if (mapped.type !== 'DRAGGING') {
|
40433 |
-
return;
|
40434 |
-
}
|
40435 |
|
40436 |
-
|
40437 |
-
|
40438 |
-
|
40439 |
|
40440 |
-
if (event.propertyName !== 'transform') {
|
40441 |
-
return;
|
40442 |
-
}
|
40443 |
|
40444 |
-
dropAnimationFinishedAction();
|
40445 |
-
}, [dropAnimationFinishedAction, mapped]);
|
40446 |
-
var provided = useMemo(function () {
|
40447 |
-
var style = getStyle$1(mapped);
|
40448 |
-
var onTransitionEnd = mapped.type === 'DRAGGING' && mapped.dropping ? onMoveEnd : null;
|
40449 |
-
var result = {
|
40450 |
-
innerRef: setRef,
|
40451 |
-
draggableProps: {
|
40452 |
-
'data-rbd-draggable-context-id': contextId,
|
40453 |
-
'data-rbd-draggable-id': draggableId,
|
40454 |
-
style: style,
|
40455 |
-
onTransitionEnd: onTransitionEnd
|
40456 |
-
},
|
40457 |
-
dragHandleProps: dragHandleProps
|
40458 |
-
};
|
40459 |
-
return result;
|
40460 |
-
}, [contextId, dragHandleProps, draggableId, mapped, onMoveEnd, setRef]);
|
40461 |
-
var rubric = useMemo(function () {
|
40462 |
-
return {
|
40463 |
-
draggableId: descriptor.id,
|
40464 |
-
type: descriptor.type,
|
40465 |
-
source: {
|
40466 |
-
index: descriptor.index,
|
40467 |
-
droppableId: descriptor.droppableId
|
40468 |
-
}
|
40469 |
-
};
|
40470 |
-
}, [descriptor.droppableId, descriptor.id, descriptor.index, descriptor.type]);
|
40471 |
-
return children(provided, mapped.snapshot, rubric);
|
40472 |
-
}
|
40473 |
|
40474 |
-
var isStrictEqual = (function (a, b) {
|
40475 |
-
return a === b;
|
40476 |
-
});
|
40477 |
|
40478 |
-
var whatIsDraggedOverFromResult = (function (result) {
|
40479 |
-
var combine = result.combine,
|
40480 |
-
destination = result.destination;
|
40481 |
|
40482 |
-
if (destination) {
|
40483 |
-
return destination.droppableId;
|
40484 |
-
}
|
40485 |
|
40486 |
-
if (combine) {
|
40487 |
-
return combine.droppableId;
|
40488 |
-
}
|
40489 |
|
40490 |
-
return null;
|
40491 |
-
});
|
40492 |
|
40493 |
-
var getCombineWithFromResult = function getCombineWithFromResult(result) {
|
40494 |
-
return result.combine ? result.combine.draggableId : null;
|
40495 |
-
};
|
40496 |
|
40497 |
-
var getCombineWithFromImpact = function getCombineWithFromImpact(impact) {
|
40498 |
-
return impact.at && impact.at.type === 'COMBINE' ? impact.at.combine.draggableId : null;
|
40499 |
-
};
|
40500 |
|
40501 |
-
function getDraggableSelector() {
|
40502 |
-
var memoizedOffset = memoize_one_esm(function (x, y) {
|
40503 |
-
return {
|
40504 |
-
x: x,
|
40505 |
-
y: y
|
40506 |
-
};
|
40507 |
-
});
|
40508 |
-
var getMemoizedSnapshot = memoize_one_esm(function (mode, isClone, draggingOver, combineWith, dropping) {
|
40509 |
-
return {
|
40510 |
-
isDragging: true,
|
40511 |
-
isClone: isClone,
|
40512 |
-
isDropAnimating: Boolean(dropping),
|
40513 |
-
dropAnimation: dropping,
|
40514 |
-
mode: mode,
|
40515 |
-
draggingOver: draggingOver,
|
40516 |
-
combineWith: combineWith,
|
40517 |
-
combineTargetFor: null
|
40518 |
-
};
|
40519 |
-
});
|
40520 |
-
var getMemoizedProps = memoize_one_esm(function (offset, mode, dimension, isClone, draggingOver, combineWith, forceShouldAnimate) {
|
40521 |
-
return {
|
40522 |
-
mapped: {
|
40523 |
-
type: 'DRAGGING',
|
40524 |
-
dropping: null,
|
40525 |
-
draggingOver: draggingOver,
|
40526 |
-
combineWith: combineWith,
|
40527 |
-
mode: mode,
|
40528 |
-
offset: offset,
|
40529 |
-
dimension: dimension,
|
40530 |
-
forceShouldAnimate: forceShouldAnimate,
|
40531 |
-
snapshot: getMemoizedSnapshot(mode, isClone, draggingOver, combineWith, null)
|
40532 |
-
}
|
40533 |
-
};
|
40534 |
-
});
|
40535 |
|
40536 |
-
var selector = function selector(state, ownProps) {
|
40537 |
-
if (state.isDragging) {
|
40538 |
-
if (state.critical.draggable.id !== ownProps.draggableId) {
|
40539 |
-
return null;
|
40540 |
-
}
|
40541 |
|
40542 |
-
var offset = state.current.client.offset;
|
40543 |
-
var dimension = state.dimensions.draggables[ownProps.draggableId];
|
40544 |
-
var draggingOver = whatIsDraggedOver(state.impact);
|
40545 |
-
var combineWith = getCombineWithFromImpact(state.impact);
|
40546 |
-
var forceShouldAnimate = state.forceShouldAnimate;
|
40547 |
-
return getMemoizedProps(memoizedOffset(offset.x, offset.y), state.movementMode, dimension, ownProps.isClone, draggingOver, combineWith, forceShouldAnimate);
|
40548 |
-
}
|
40549 |
|
40550 |
-
if (state.phase === 'DROP_ANIMATING') {
|
40551 |
-
var completed = state.completed;
|
40552 |
|
40553 |
-
|
40554 |
-
|
40555 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40556 |
|
40557 |
-
|
40558 |
-
|
40559 |
-
|
40560 |
-
|
40561 |
|
40562 |
-
|
|
|
|
|
|
|
40563 |
|
40564 |
-
|
|
|
|
|
|
|
40565 |
|
40566 |
-
|
40567 |
-
|
40568 |
-
|
40569 |
-
|
40570 |
-
moveTo: state.newHomeClientOffset,
|
40571 |
-
opacity: _combineWith ? combine.opacity.drop : null,
|
40572 |
-
scale: _combineWith ? combine.scale.drop : null
|
40573 |
-
};
|
40574 |
-
return {
|
40575 |
-
mapped: {
|
40576 |
-
type: 'DRAGGING',
|
40577 |
-
offset: state.newHomeClientOffset,
|
40578 |
-
dimension: _dimension,
|
40579 |
-
dropping: dropping,
|
40580 |
-
draggingOver: _draggingOver,
|
40581 |
-
combineWith: _combineWith,
|
40582 |
-
mode: mode,
|
40583 |
-
forceShouldAnimate: null,
|
40584 |
-
snapshot: getMemoizedSnapshot(mode, isClone, _draggingOver, _combineWith, dropping)
|
40585 |
-
}
|
40586 |
-
};
|
40587 |
-
}
|
40588 |
|
40589 |
-
|
40590 |
-
};
|
40591 |
|
40592 |
-
|
40593 |
-
|
|
|
40594 |
|
40595 |
-
|
40596 |
-
return {
|
40597 |
-
isDragging: false,
|
40598 |
-
isDropAnimating: false,
|
40599 |
-
isClone: false,
|
40600 |
-
dropAnimation: null,
|
40601 |
-
mode: null,
|
40602 |
-
draggingOver: null,
|
40603 |
-
combineTargetFor: combineTargetFor,
|
40604 |
-
combineWith: null
|
40605 |
-
};
|
40606 |
-
}
|
40607 |
|
40608 |
-
|
40609 |
-
|
40610 |
-
|
40611 |
-
|
40612 |
-
|
40613 |
-
|
40614 |
-
|
40615 |
-
|
40616 |
-
|
|
|
40617 |
|
40618 |
-
|
40619 |
-
|
40620 |
-
|
40621 |
-
|
40622 |
-
y: y
|
40623 |
-
};
|
40624 |
-
});
|
40625 |
-
var getMemoizedSnapshot = memoize_one_esm(getSecondarySnapshot);
|
40626 |
-
var getMemoizedProps = memoize_one_esm(function (offset, combineTargetFor, shouldAnimateDisplacement) {
|
40627 |
-
if (combineTargetFor === void 0) {
|
40628 |
-
combineTargetFor = null;
|
40629 |
-
}
|
40630 |
|
40631 |
-
|
40632 |
-
mapped: {
|
40633 |
-
type: 'SECONDARY',
|
40634 |
-
offset: offset,
|
40635 |
-
combineTargetFor: combineTargetFor,
|
40636 |
-
shouldAnimateDisplacement: shouldAnimateDisplacement,
|
40637 |
-
snapshot: getMemoizedSnapshot(combineTargetFor)
|
40638 |
-
}
|
40639 |
-
};
|
40640 |
-
});
|
40641 |
|
40642 |
-
|
40643 |
-
|
40644 |
-
|
|
|
|
|
40645 |
|
40646 |
-
|
40647 |
-
|
40648 |
-
|
40649 |
-
|
40650 |
-
var combineTargetFor = combine && combine.draggableId === ownId ? draggingId : null;
|
40651 |
|
40652 |
-
|
40653 |
-
|
40654 |
-
|
40655 |
-
|
40656 |
|
40657 |
-
|
40658 |
-
|
40659 |
-
}
|
40660 |
|
40661 |
-
|
|
|
40662 |
|
40663 |
-
|
|
|
|
|
|
|
40664 |
|
40665 |
-
|
40666 |
-
|
40667 |
|
40668 |
-
|
40669 |
-
|
40670 |
-
}
|
40671 |
|
40672 |
-
|
40673 |
-
|
40674 |
-
|
40675 |
-
|
|
|
|
|
|
|
40676 |
|
40677 |
-
|
40678 |
-
|
40679 |
-
|
40680 |
-
|
40681 |
-
|
40682 |
|
40683 |
-
|
40684 |
-
}
|
40685 |
|
40686 |
-
|
40687 |
-
|
|
|
|
|
40688 |
|
40689 |
-
|
40690 |
-
|
40691 |
-
|
|
|
40692 |
|
40693 |
-
|
40694 |
-
|
|
|
40695 |
|
40696 |
-
|
40697 |
-
|
|
|
40698 |
|
40699 |
-
|
40700 |
-
|
|
|
|
|
40701 |
|
40702 |
-
|
40703 |
-
|
40704 |
-
|
|
|
|
|
40705 |
|
40706 |
-
|
40707 |
-
|
40708 |
-
|
|
|
|
|
|
|
|
|
40709 |
|
40710 |
-
|
40711 |
-
|
40712 |
-
|
40713 |
-
|
40714 |
-
|
40715 |
-
|
40716 |
-
context: StoreContext,
|
40717 |
-
pure: true,
|
40718 |
-
areStatePropsEqual: isStrictEqual
|
40719 |
-
})(Draggable);
|
40720 |
|
40721 |
-
function PrivateDraggable(props) {
|
40722 |
-
var droppableContext = useRequiredContext(DroppableContext);
|
40723 |
-
var isUsingCloneFor = droppableContext.isUsingCloneFor;
|
40724 |
|
40725 |
-
|
40726 |
-
|
40727 |
-
|
|
|
40728 |
|
40729 |
-
return react.createElement(ConnectedDraggable, props);
|
40730 |
-
}
|
40731 |
-
function PublicDraggable(props) {
|
40732 |
-
var isEnabled = typeof props.isDragDisabled === 'boolean' ? !props.isDragDisabled : true;
|
40733 |
-
var canDragInteractiveElements = Boolean(props.disableInteractiveElementBlocking);
|
40734 |
-
var shouldRespectForcePress = Boolean(props.shouldRespectForcePress);
|
40735 |
-
return react.createElement(PrivateDraggable, (0,esm_extends/* default */.Z)({}, props, {
|
40736 |
-
isClone: false,
|
40737 |
-
isEnabled: isEnabled,
|
40738 |
-
canDragInteractiveElements: canDragInteractiveElements,
|
40739 |
-
shouldRespectForcePress: shouldRespectForcePress
|
40740 |
-
}));
|
40741 |
-
}
|
40742 |
|
40743 |
-
|
40744 |
-
|
40745 |
-
|
40746 |
-
|
40747 |
-
|
40748 |
-
|
40749 |
-
|
40750 |
-
|
40751 |
-
|
40752 |
-
|
40753 |
-
|
40754 |
-
|
40755 |
-
|
40756 |
-
|
40757 |
-
|
40758 |
-
|
40759 |
-
|
40760 |
-
|
40761 |
-
|
40762 |
-
|
40763 |
-
|
40764 |
-
|
40765 |
-
|
40766 |
-
|
40767 |
-
|
40768 |
-
|
40769 |
-
|
40770 |
-
|
40771 |
-
|
40772 |
-
|
40773 |
-
|
40774 |
-
|
40775 |
-
|
40776 |
-
|
40777 |
-
|
40778 |
-
|
40779 |
-
|
40780 |
-
|
40781 |
-
|
40782 |
-
|
40783 |
-
|
|
|
40784 |
}
|
40785 |
-
},
|
40786 |
-
|
40787 |
-
|
40788 |
-
|
40789 |
-
|
40790 |
-
|
40791 |
-
|
40792 |
-
|
40793 |
-
|
40794 |
-
|
40795 |
-
|
40796 |
-
|
40797 |
-
|
40798 |
-
|
40799 |
-
|
40800 |
-
|
40801 |
-
|
40802 |
-
|
40803 |
-
|
40804 |
-
|
40805 |
-
|
40806 |
-
|
40807 |
-
|
40808 |
-
|
40809 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40810 |
});
|
40811 |
});
|
40812 |
-
|
40813 |
-
|
40814 |
-
innerRef: setDroppableRef,
|
40815 |
-
placeholder: placeholder,
|
40816 |
-
droppableProps: {
|
40817 |
-
'data-rbd-droppable-id': droppableId,
|
40818 |
-
'data-rbd-droppable-context-id': contextId
|
40819 |
-
}
|
40820 |
-
};
|
40821 |
-
}, [contextId, droppableId, placeholder, setDroppableRef]);
|
40822 |
-
var isUsingCloneFor = useClone ? useClone.dragging.draggableId : null;
|
40823 |
-
var droppableContext = useMemo(function () {
|
40824 |
-
return {
|
40825 |
-
droppableId: droppableId,
|
40826 |
-
type: type,
|
40827 |
-
isUsingCloneFor: isUsingCloneFor
|
40828 |
-
};
|
40829 |
-
}, [droppableId, isUsingCloneFor, type]);
|
40830 |
|
40831 |
-
function getClone() {
|
40832 |
-
if (!useClone) {
|
40833 |
-
return null;
|
40834 |
-
}
|
40835 |
|
40836 |
-
var dragging = useClone.dragging,
|
40837 |
-
render = useClone.render;
|
40838 |
-
var node = react.createElement(PrivateDraggable, {
|
40839 |
-
draggableId: dragging.draggableId,
|
40840 |
-
index: dragging.source.index,
|
40841 |
-
isClone: true,
|
40842 |
-
isEnabled: true,
|
40843 |
-
shouldRespectForcePress: false,
|
40844 |
-
canDragInteractiveElements: true
|
40845 |
-
}, function (draggableProvided, draggableSnapshot) {
|
40846 |
-
return render(draggableProvided, draggableSnapshot, dragging);
|
40847 |
-
});
|
40848 |
-
return react_dom.createPortal(node, getContainerForClone());
|
40849 |
-
}
|
40850 |
|
40851 |
-
return react.createElement(DroppableContext.Provider, {
|
40852 |
-
value: droppableContext
|
40853 |
-
}, children(provided, snapshot), getClone());
|
40854 |
-
}
|
40855 |
|
40856 |
-
var isMatchingType = function isMatchingType(type, critical) {
|
40857 |
-
return type === critical.droppable.type;
|
40858 |
-
};
|
40859 |
|
40860 |
-
|
40861 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40862 |
};
|
|
|
|
|
|
|
40863 |
|
40864 |
-
var
|
40865 |
-
var
|
40866 |
-
|
40867 |
-
|
40868 |
-
|
40869 |
-
|
40870 |
-
|
40871 |
-
|
40872 |
-
|
40873 |
-
|
40874 |
-
|
40875 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40876 |
|
40877 |
-
var
|
40878 |
-
|
40879 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
40880 |
|
40881 |
-
var
|
40882 |
-
return {
|
40883 |
-
draggableId: descriptor.id,
|
40884 |
-
type: descriptor.type,
|
40885 |
-
source: {
|
40886 |
-
index: descriptor.index,
|
40887 |
-
droppableId: descriptor.droppableId
|
40888 |
-
}
|
40889 |
-
};
|
40890 |
-
});
|
40891 |
-
var getMapProps = memoize_one_esm(function (id, isEnabled, isDraggingOverForConsumer, isDraggingOverForImpact, dragging, renderClone) {
|
40892 |
-
var draggableId = dragging.descriptor.id;
|
40893 |
-
var isHome = dragging.descriptor.droppableId === id;
|
40894 |
|
40895 |
-
|
40896 |
-
|
40897 |
-
|
40898 |
-
dragging: getDraggableRubric(dragging.descriptor)
|
40899 |
-
} : null;
|
40900 |
-
var _snapshot = {
|
40901 |
-
isDraggingOver: isDraggingOverForConsumer,
|
40902 |
-
draggingOverWith: isDraggingOverForConsumer ? draggableId : null,
|
40903 |
-
draggingFromThisWith: draggableId,
|
40904 |
-
isUsingPlaceholder: true
|
40905 |
-
};
|
40906 |
-
return {
|
40907 |
-
placeholder: dragging.placeholder,
|
40908 |
-
shouldAnimatePlaceholder: false,
|
40909 |
-
snapshot: _snapshot,
|
40910 |
-
useClone: useClone
|
40911 |
-
};
|
40912 |
}
|
40913 |
|
40914 |
-
if (
|
40915 |
-
|
40916 |
}
|
|
|
40917 |
|
40918 |
-
|
40919 |
-
|
|
|
40920 |
}
|
40921 |
|
40922 |
-
|
40923 |
-
|
40924 |
-
|
40925 |
-
|
40926 |
-
isUsingPlaceholder: true
|
40927 |
-
};
|
40928 |
-
return {
|
40929 |
-
placeholder: dragging.placeholder,
|
40930 |
-
shouldAnimatePlaceholder: true,
|
40931 |
-
snapshot: snapshot,
|
40932 |
-
useClone: null
|
40933 |
-
};
|
40934 |
-
});
|
40935 |
|
40936 |
-
var
|
40937 |
-
var
|
40938 |
-
|
40939 |
-
var isEnabled = !ownProps.isDropDisabled;
|
40940 |
-
var renderClone = ownProps.renderClone;
|
40941 |
|
40942 |
-
if (
|
40943 |
-
|
|
|
|
|
|
|
40944 |
|
40945 |
-
|
40946 |
-
return idleWithoutAnimation;
|
40947 |
-
}
|
40948 |
|
40949 |
-
|
40950 |
-
|
40951 |
-
|
40952 |
}
|
|
|
40953 |
|
40954 |
-
|
40955 |
-
|
40956 |
-
|
40957 |
-
|
40958 |
-
|
40959 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
40960 |
|
40961 |
-
|
|
|
|
|
|
|
|
|
40962 |
|
40963 |
-
return getMapProps(id, isEnabled, whatIsDraggedOverFromResult(completed.result) === id, whatIsDraggedOver(completed.impact) === id, _dragging, renderClone);
|
40964 |
-
}
|
40965 |
|
40966 |
-
|
40967 |
-
|
|
|
40968 |
|
40969 |
-
|
40970 |
-
|
40971 |
-
|
|
|
40972 |
|
40973 |
-
var wasOver = whatIsDraggedOver(_completed.impact) === id;
|
40974 |
-
var wasCombining = Boolean(_completed.impact.at && _completed.impact.at.type === 'COMBINE');
|
40975 |
-
var isHome = _completed.critical.droppable.id === id;
|
40976 |
|
40977 |
-
|
40978 |
-
|
40979 |
-
|
40980 |
|
40981 |
-
|
40982 |
-
|
40983 |
-
|
|
|
40984 |
|
40985 |
-
return idleWithoutAnimation;
|
40986 |
-
}
|
40987 |
|
40988 |
-
|
40989 |
-
|
|
|
40990 |
|
40991 |
-
|
40992 |
-
|
40993 |
-
|
40994 |
-
|
40995 |
-
};
|
40996 |
|
40997 |
-
function getBody() {
|
40998 |
-
!document.body ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
40999 |
-
return document.body;
|
41000 |
-
}
|
41001 |
|
41002 |
-
var react_beautiful_dnd_esm_defaultProps = {
|
41003 |
-
mode: 'standard',
|
41004 |
-
type: 'DEFAULT',
|
41005 |
-
direction: 'vertical',
|
41006 |
-
isDropDisabled: false,
|
41007 |
-
isCombineEnabled: false,
|
41008 |
-
ignoreContainerClipping: false,
|
41009 |
-
renderClone: null,
|
41010 |
-
getContainerForClone: getBody
|
41011 |
-
};
|
41012 |
-
var ConnectedDroppable = connect(makeMapStateToProps$1, mapDispatchToProps$1, null, {
|
41013 |
-
context: StoreContext,
|
41014 |
-
pure: true,
|
41015 |
-
areStatePropsEqual: isStrictEqual
|
41016 |
-
})(Droppable);
|
41017 |
-
ConnectedDroppable.defaultProps = react_beautiful_dnd_esm_defaultProps;
|
41018 |
|
41019 |
|
41020 |
|
41021 |
-
;// CONCATENATED MODULE: ./src/js/utils/cookies.js
|
41022 |
-
/**
|
41023 |
-
* Get cookie util
|
41024 |
-
*
|
41025 |
-
* @param {string} cname
|
41026 |
-
*/
|
41027 |
-
// Get cookie
|
41028 |
-
function getCookie(name) {
|
41029 |
-
var value = "; ".concat(document.cookie);
|
41030 |
-
var parts = value.split("; ".concat(name, "="));
|
41031 |
-
if (parts.length === 2) return parts.pop().split(";").shift();
|
41032 |
-
return false;
|
41033 |
-
} // Set cookie
|
41034 |
|
41035 |
-
function setCookie(cname, value) {
|
41036 |
-
document.cookie = cname + "=" + value;
|
41037 |
-
}
|
41038 |
-
;// CONCATENATED MODULE: ./src/js/utils/ImportData.js
|
41039 |
|
41040 |
|
41041 |
|
41042 |
|
41043 |
-
function ImportData(currentGroup, foundGroup, foundButtons, index) {
|
41044 |
-
var redirect = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
41045 |
-
var dispatch = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : window.store.dispatch;
|
41046 |
-
var state = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : window.store.getState();
|
41047 |
|
41048 |
-
// Should import into a group
|
41049 |
-
if (currentGroup) {
|
41050 |
-
if (foundGroup && foundButtons) {
|
41051 |
-
// Replace Current Group
|
41052 |
-
console.log("Replace current group"); // addGroup(foundGroup);
|
41053 |
|
41054 |
-
replaceGroup(currentGroup.id, foundGroup, foundButtons, dispatch, state);
|
41055 |
-
}
|
41056 |
|
41057 |
-
|
41058 |
-
|
41059 |
-
|
41060 |
-
|
41061 |
-
|
41062 |
-
|
41063 |
-
addButton(button, currentGroup.id, index || currentGroup.children.length + key + 1, dispatch, redirect);
|
41064 |
-
});
|
41065 |
-
}
|
41066 |
-
} // Should create a new group
|
41067 |
-
else if (foundGroup && !currentGroup) {
|
41068 |
-
console.log("Should create a new group");
|
41069 |
-
importGroup(foundGroup, foundButtons, index, dispatch);
|
41070 |
-
} else if (foundButtons && !foundGroup && !currentGroup) {
|
41071 |
-
console.log("Should create a new group with imported button");
|
41072 |
-
importGroup(foundGroup, foundButtons, index, dispatch);
|
41073 |
-
}
|
41074 |
-
}
|
41075 |
-
function ImportRawData(data, index, currentGroup, redirect) {
|
41076 |
-
var foundGroup, foundButtons;
|
41077 |
|
41078 |
-
|
41079 |
-
|
41080 |
|
41081 |
-
|
41082 |
-
|
41083 |
-
} // Import a group
|
41084 |
|
|
|
|
|
41085 |
|
41086 |
-
|
41087 |
-
|
41088 |
-
|
41089 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41090 |
}
|
|
|
41091 |
|
41092 |
-
|
41093 |
-
|
41094 |
-
|
41095 |
-
|
41096 |
-
|
41097 |
-
|
41098 |
-
|
41099 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
41100 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41101 |
|
41102 |
-
ImportData(currentGroup, foundGroup, foundButtons, index, redirect);
|
41103 |
-
} catch (e) {
|
41104 |
-
alert(translate("import_export.import.warning.malformed"));
|
41105 |
-
}
|
41106 |
-
}
|
41107 |
-
;// CONCATENATED MODULE: ./src/js/dashboard/Components/TrashButton/TrashButton.js
|
41108 |
-
function TrashButton_extends() { TrashButton_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return TrashButton_extends.apply(this, arguments); }
|
41109 |
|
41110 |
-
|
|
|
|
|
41111 |
|
41112 |
-
|
|
|
|
|
|
|
41113 |
|
41114 |
-
function TrashButton_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
41115 |
|
41116 |
-
function TrashButton_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = TrashButton_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
41117 |
|
41118 |
-
function TrashButton_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
41119 |
|
41120 |
|
41121 |
|
41122 |
-
function TrashButton(_ref) {
|
41123 |
-
var _ref$disabled = _ref.disabled,
|
41124 |
-
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
41125 |
-
_onClick = _ref.onClick,
|
41126 |
-
iconProps = _ref.iconProps,
|
41127 |
-
_ref$icon = _ref.icon,
|
41128 |
-
icon = _ref$icon === void 0 ? "fas fa-undo" : _ref$icon,
|
41129 |
-
props = TrashButton_objectWithoutProperties(_ref, ["disabled", "onClick", "iconProps", "icon"]);
|
41130 |
|
41131 |
-
return /*#__PURE__*/react.createElement(IconButton_IconButton, TrashButton_extends({
|
41132 |
-
onClick: function onClick() {
|
41133 |
-
return _onClick();
|
41134 |
-
},
|
41135 |
-
disabled: disabled,
|
41136 |
-
size: "small",
|
41137 |
-
style: TrashButton_objectSpread({
|
41138 |
-
fontSize: "14px",
|
41139 |
-
marginLeft: "5px",
|
41140 |
-
height: "30px",
|
41141 |
-
width: "30px",
|
41142 |
-
alignSelf: "center"
|
41143 |
-
}, props.style),
|
41144 |
-
color: "primary"
|
41145 |
-
}, props), /*#__PURE__*/react.createElement(Icon_Icon, TrashButton_extends({
|
41146 |
-
fontSize: "inherit",
|
41147 |
-
className: icon
|
41148 |
-
}, iconProps)));
|
41149 |
-
}
|
41150 |
-
;// CONCATENATED MODULE: ./src/js/dashboard/Components/FileDragAndDrop/FileDragAndDrop.js
|
41151 |
-
function FileDragAndDrop_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FileDragAndDrop_typeof = function _typeof(obj) { return typeof obj; }; } else { FileDragAndDrop_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FileDragAndDrop_typeof(obj); }
|
41152 |
|
41153 |
-
function FileDragAndDrop_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
41154 |
|
41155 |
-
function FileDragAndDrop_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
41156 |
|
41157 |
-
function FileDragAndDrop_createClass(Constructor, protoProps, staticProps) { if (protoProps) FileDragAndDrop_defineProperties(Constructor.prototype, protoProps); if (staticProps) FileDragAndDrop_defineProperties(Constructor, staticProps); return Constructor; }
|
41158 |
|
41159 |
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
41160 |
|
41161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41162 |
|
41163 |
-
|
|
|
|
|
|
|
41164 |
|
41165 |
-
|
|
|
|
|
|
|
|
|
41166 |
|
41167 |
-
|
|
|
|
|
|
|
|
|
41168 |
|
41169 |
-
|
|
|
41170 |
|
41171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41172 |
|
41173 |
-
|
|
|
|
|
|
|
|
|
|
|
41174 |
|
|
|
|
|
|
|
|
|
|
|
|
|
41175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
41176 |
|
|
|
|
|
|
|
|
|
|
|
|
|
41177 |
|
|
|
|
|
|
|
|
|
|
|
|
|
41178 |
|
41179 |
-
|
41180 |
-
|
41181 |
-
|
41182 |
-
border: "
|
41183 |
-
|
41184 |
-
|
41185 |
-
|
41186 |
-
|
41187 |
-
|
41188 |
-
|
41189 |
-
|
41190 |
-
|
41191 |
-
|
41192 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41193 |
},
|
41194 |
-
text: {
|
41195 |
-
fontSize: "35px",
|
41196 |
-
color: theme.palette.primary.main
|
41197 |
-
}
|
41198 |
-
};
|
41199 |
-
};
|
41200 |
|
41201 |
-
|
41202 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
41203 |
|
41204 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41205 |
|
41206 |
-
|
41207 |
-
|
41208 |
|
41209 |
-
|
|
|
41210 |
|
41211 |
-
|
41212 |
-
|
41213 |
-
}
|
41214 |
|
41215 |
-
|
|
|
41216 |
|
41217 |
-
|
41218 |
-
|
41219 |
-
|
|
|
|
|
|
|
41220 |
|
41221 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
41222 |
|
41223 |
-
|
41224 |
-
|
41225 |
-
|
41226 |
-
}
|
41227 |
|
41228 |
-
|
41229 |
-
|
41230 |
-
|
41231 |
-
|
41232 |
|
41233 |
-
|
41234 |
-
|
41235 |
-
|
41236 |
-
|
41237 |
-
|
41238 |
-
|
|
|
|
|
41239 |
|
41240 |
-
|
41241 |
-
|
41242 |
-
|
41243 |
-
|
|
|
41244 |
|
41245 |
-
|
41246 |
-
|
41247 |
-
|
41248 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
41249 |
}
|
41250 |
-
}
|
41251 |
-
|
41252 |
-
FileDragAndDrop_defineProperty(_assertThisInitialized(_this), "handleDrop", function (e) {
|
41253 |
-
e.preventDefault();
|
41254 |
-
e.stopPropagation();
|
41255 |
|
41256 |
-
|
41257 |
-
|
41258 |
-
|
|
|
|
|
|
|
|
|
41259 |
|
41260 |
-
|
41261 |
-
|
|
|
|
|
|
|
|
|
|
|
41262 |
|
41263 |
-
|
41264 |
-
|
|
|
|
|
|
|
41265 |
}
|
41266 |
-
}
|
41267 |
|
41268 |
-
|
41269 |
-
|
|
|
|
|
|
|
|
|
|
|
41270 |
|
41271 |
-
|
41272 |
-
|
41273 |
-
|
41274 |
-
|
41275 |
-
|
41276 |
-
|
41277 |
-
div.addEventListener("dragover", this.handleDrag);
|
41278 |
-
div.addEventListener("drop", this.handleDrop);
|
41279 |
-
}
|
41280 |
-
}, {
|
41281 |
-
key: "componentWillUnmount",
|
41282 |
-
value: function componentWillUnmount() {
|
41283 |
-
var div = this.dropRef.current;
|
41284 |
-
div.removeEventListener("dragenter", this.handleDragIn);
|
41285 |
-
div.removeEventListener("dragleave", this.handleDragOut);
|
41286 |
-
div.removeEventListener("dragover", this.handleDrag);
|
41287 |
-
div.removeEventListener("drop", this.handleDrop);
|
41288 |
-
}
|
41289 |
-
}, {
|
41290 |
-
key: "render",
|
41291 |
-
value: function render() {
|
41292 |
-
var classes = this.props.classes;
|
41293 |
-
return /*#__PURE__*/react.createElement("div", {
|
41294 |
-
style: {
|
41295 |
-
display: "inline-block",
|
41296 |
-
position: "relative"
|
41297 |
-
},
|
41298 |
-
ref: this.dropRef
|
41299 |
-
}, this.state.drag && /*#__PURE__*/react.createElement("div", {
|
41300 |
-
className: classes.border
|
41301 |
-
}, /*#__PURE__*/react.createElement("span", {
|
41302 |
-
className: classes.text
|
41303 |
-
}, translate("import_export.import.drag_drop"))), this.props.children);
|
41304 |
}
|
41305 |
-
}
|
|
|
41306 |
|
41307 |
-
|
41308 |
-
|
|
|
|
|
|
|
|
|
41309 |
|
41310 |
-
/* harmony default export */ var FileDragAndDrop_FileDragAndDrop = ((0,withStyles/* default */.Z)(FileDragAndDrop_styles)(FileDragAndDrop));
|
41311 |
-
// EXTERNAL MODULE: ./node_modules/lodash/cloneDeep.js
|
41312 |
-
var cloneDeep = __webpack_require__(50361);
|
41313 |
-
var cloneDeep_default = /*#__PURE__*/__webpack_require__.n(cloneDeep);
|
41314 |
-
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Containers/ContainerActions/ImportButton.js
|
41315 |
-
function ImportButton_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
41316 |
|
41317 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41318 |
|
41319 |
-
|
|
|
41320 |
|
41321 |
-
|
|
|
|
|
41322 |
|
41323 |
-
|
|
|
|
|
|
|
41324 |
|
41325 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
41326 |
|
41327 |
-
|
|
|
|
|
|
|
41328 |
|
41329 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41330 |
|
|
|
|
|
|
|
|
|
41331 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41332 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41333 |
|
|
|
41334 |
|
|
|
|
|
|
|
|
|
|
|
41335 |
|
|
|
41336 |
|
|
|
|
|
|
|
|
|
|
|
41337 |
|
|
|
41338 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41339 |
|
|
|
41340 |
|
|
|
41341 |
|
|
|
41342 |
|
|
|
41343 |
|
41344 |
-
function
|
41345 |
-
var _ref$isGroup = _ref.isGroup,
|
41346 |
-
isGroup = _ref$isGroup === void 0 ? true : _ref$isGroup,
|
41347 |
-
_ref$currentGroup = _ref.currentGroup,
|
41348 |
-
currentGroup = _ref$currentGroup === void 0 ? null : _ref$currentGroup,
|
41349 |
-
_ref$label = _ref.label,
|
41350 |
-
label = _ref$label === void 0 ? "Import Group" : _ref$label,
|
41351 |
-
index = _ref.index,
|
41352 |
-
_ref$kbLink = _ref.kbLink,
|
41353 |
-
kbLink = _ref$kbLink === void 0 ? null : _ref$kbLink,
|
41354 |
-
inDropdown = _ref.inDropdown,
|
41355 |
-
onClose = _ref.onClose;
|
41356 |
|
41357 |
-
|
41358 |
-
_useState2 = ImportButton_slicedToArray(_useState, 2),
|
41359 |
-
dialogOpened = _useState2[0],
|
41360 |
-
setDialogOpened = _useState2[1];
|
41361 |
|
41362 |
-
|
41363 |
-
_useState4 = ImportButton_slicedToArray(_useState3, 2),
|
41364 |
-
fileSelected = _useState4[0],
|
41365 |
-
setFileSelected = _useState4[1];
|
41366 |
|
41367 |
-
|
41368 |
-
_useState6 = ImportButton_slicedToArray(_useState5, 2),
|
41369 |
-
foundButtons = _useState6[0],
|
41370 |
-
setFoundButtons = _useState6[1];
|
41371 |
|
41372 |
-
var _useState7 = (0,react.useState)(false),
|
41373 |
-
_useState8 = ImportButton_slicedToArray(_useState7, 2),
|
41374 |
-
foundGroup = _useState8[0],
|
41375 |
-
setFoundGroup = _useState8[1];
|
41376 |
|
41377 |
-
var importFileUploader = (0,react.useRef)(null);
|
41378 |
|
41379 |
-
var onFileSelect = function onFileSelect(files) {
|
41380 |
-
// Get file
|
41381 |
-
var file = files[0]; // Read the file
|
41382 |
|
41383 |
-
var readFile = new FileReader(); // After reading the file
|
41384 |
|
41385 |
-
readFile.addEventListener("load", /*#__PURE__*/function () {
|
41386 |
-
var _ref2 = ImportButton_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(fileReaderEvent) {
|
41387 |
-
var result, fileResult, group, button, migratedData;
|
41388 |
-
return regeneratorRuntime.wrap(function _callee$(_context) {
|
41389 |
-
while (1) {
|
41390 |
-
switch (_context.prev = _context.next) {
|
41391 |
-
case 0:
|
41392 |
-
result = fileReaderEvent.target.result;
|
41393 |
-
_context.prev = 1;
|
41394 |
-
fileResult = JSON.parse(result); // Malformed data
|
41395 |
|
41396 |
-
if (!(!fileResult.export_type || fileResult.export_type === "group" && !fileResult.buttons)) {
|
41397 |
-
_context.next = 5;
|
41398 |
-
break;
|
41399 |
-
}
|
41400 |
|
41401 |
-
throw new Error(translate("import_export.import.warning.invalid"));
|
41402 |
|
41403 |
-
case 5:
|
41404 |
-
if (!isGroup) {
|
41405 |
-
_context.next = 28;
|
41406 |
-
break;
|
41407 |
-
}
|
41408 |
|
41409 |
-
if (!(fileResult.export_type === "group")) {
|
41410 |
-
_context.next = 19;
|
41411 |
-
break;
|
41412 |
-
}
|
41413 |
|
41414 |
-
if (!(fileResult.buttons.length === 0)) {
|
41415 |
-
_context.next = 10;
|
41416 |
-
break;
|
41417 |
-
}
|
41418 |
|
41419 |
-
|
41420 |
-
|
|
|
|
|
|
|
|
|
41421 |
|
41422 |
-
case 10:
|
41423 |
-
group = fileResult; // An old export file. Might need migration
|
41424 |
|
41425 |
-
|
41426 |
-
|
41427 |
-
|
41428 |
-
}
|
41429 |
|
41430 |
-
_context.next = 14;
|
41431 |
-
return migrateData(fileResult);
|
41432 |
|
41433 |
-
|
41434 |
-
|
|
|
41435 |
|
41436 |
-
|
41437 |
-
|
41438 |
-
|
41439 |
-
|
41440 |
-
|
41441 |
-
|
41442 |
-
|
41443 |
|
41444 |
-
|
41445 |
-
|
41446 |
-
|
41447 |
-
|
41448 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41449 |
|
41450 |
-
|
|
|
41451 |
|
41452 |
-
|
41453 |
-
|
41454 |
-
|
41455 |
-
|
|
|
|
|
|
|
|
|
41456 |
|
41457 |
-
|
41458 |
-
|
41459 |
-
|
41460 |
-
|
41461 |
|
41462 |
-
|
41463 |
-
|
41464 |
-
|
|
|
41465 |
|
41466 |
-
|
41467 |
-
|
41468 |
-
|
|
|
41469 |
|
41470 |
-
|
41471 |
-
setFileSelected(true);
|
41472 |
-
_context.next = 35;
|
41473 |
-
break;
|
41474 |
|
41475 |
-
|
41476 |
-
|
41477 |
-
|
41478 |
-
console.error(_context.t0);
|
41479 |
-
alert(translate("import_export.import.warning.malformed"));
|
41480 |
|
41481 |
-
|
41482 |
-
|
41483 |
-
|
41484 |
-
|
41485 |
-
|
41486 |
-
|
41487 |
-
|
|
|
|
|
41488 |
|
41489 |
-
|
41490 |
-
|
41491 |
-
};
|
41492 |
-
}());
|
41493 |
-
readFile.readAsText(file);
|
41494 |
-
}; // Import the files
|
41495 |
|
|
|
|
|
|
|
|
|
41496 |
|
41497 |
-
|
41498 |
-
|
41499 |
-
|
41500 |
-
} // Reset
|
41501 |
|
|
|
|
|
41502 |
|
41503 |
-
|
41504 |
-
|
41505 |
-
|
41506 |
-
setFoundGroup(false);
|
41507 |
};
|
41508 |
|
41509 |
-
|
41510 |
-
|
41511 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41512 |
},
|
41513 |
-
|
41514 |
-
|
41515 |
-
|
41516 |
-
})), /*#__PURE__*/react.createElement(
|
41517 |
-
|
41518 |
-
},
|
41519 |
style: {
|
41520 |
-
|
41521 |
-
},
|
41522 |
-
onClick: function onClick() {
|
41523 |
-
return setDialogOpened(true);
|
41524 |
-
},
|
41525 |
-
color: "primary",
|
41526 |
-
variant: "text",
|
41527 |
-
size: "small",
|
41528 |
-
startIcon: /*#__PURE__*/react.createElement(Icon_Icon, {
|
41529 |
-
className: "fas fa-file-import"
|
41530 |
-
}),
|
41531 |
-
"data-testid": "import-new-group"
|
41532 |
-
}, label), /*#__PURE__*/react.createElement(Dialog_Dialog, {
|
41533 |
-
open: dialogOpened,
|
41534 |
-
onClose: function onClose() {
|
41535 |
-
return setDialogOpened(false);
|
41536 |
-
},
|
41537 |
-
maxWidth: false,
|
41538 |
-
"aria-labelledby": "import-button-dialog-title",
|
41539 |
-
"aria-describedby": "import-button-dialog-description",
|
41540 |
-
"data-testid": "dialog:import-dialog"
|
41541 |
-
}, /*#__PURE__*/react.createElement(FileDragAndDrop_FileDragAndDrop, {
|
41542 |
-
handleDrop: function handleDrop(files) {
|
41543 |
-
if (files.length === 0) return;
|
41544 |
-
onFileSelect(files);
|
41545 |
}
|
41546 |
-
}, /*#__PURE__*/react.createElement(
|
41547 |
-
|
41548 |
-
|
41549 |
-
|
41550 |
-
|
41551 |
-
|
41552 |
-
|
41553 |
-
|
41554 |
-
|
41555 |
-
|
41556 |
-
|
41557 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41558 |
}
|
41559 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41560 |
style: {
|
41561 |
-
|
41562 |
-
|
41563 |
-
},
|
41564 |
-
onClick: function onClick() {
|
41565 |
-
return importFileUploader.current.click();
|
41566 |
}
|
41567 |
-
},
|
41568 |
-
|
41569 |
-
id: "input",
|
41570 |
-
"data-testid": "import-input",
|
41571 |
-
ref: importFileUploader,
|
41572 |
-
accept: "application/JSON",
|
41573 |
-
onChange: function onChange(e) {
|
41574 |
-
if (e.target.files.length === 0) return;
|
41575 |
-
onFileSelect(e.target.files);
|
41576 |
-
},
|
41577 |
style: {
|
41578 |
-
|
41579 |
-
width: 0,
|
41580 |
-
height: 0
|
41581 |
-
}
|
41582 |
-
})), fileSelected && /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(DialogContentText_DialogContentText, {
|
41583 |
-
component: "div"
|
41584 |
-
}, currentGroup && isGroup && foundGroup ? /*#__PURE__*/react.createElement("span", {
|
41585 |
-
dangerouslySetInnerHTML: {
|
41586 |
-
__html: translate("import_export.import.warning.replace")
|
41587 |
-
}
|
41588 |
-
}) : !currentGroup && isGroup && !foundGroup && foundButtons ? "Create a new group including this button:" : translate("import_export.import.warning.preview")), foundGroup && /*#__PURE__*/react.createElement(DialogContentText_DialogContentText, {
|
41589 |
-
"data-testid": "import-found-group",
|
41590 |
-
component: "div",
|
41591 |
-
key: foundGroup.id
|
41592 |
-
}, /*#__PURE__*/react.createElement("i", null, translate("common.group"), " "), ":", " ", dlv_umd_default()(foundGroup, "name", "Unnamed"), ".", " ", /*#__PURE__*/react.createElement(PropertyList, {
|
41593 |
-
properties: foundGroup,
|
41594 |
-
type: "Group"
|
41595 |
-
}), /*#__PURE__*/react.createElement(TrashButton, {
|
41596 |
-
onClick: function onClick() {
|
41597 |
-
return setFoundGroup(false);
|
41598 |
-
},
|
41599 |
-
"data-testid": "import-delete",
|
41600 |
-
size: "medium",
|
41601 |
-
icon: "fas fa-trash"
|
41602 |
-
})), foundButtons && foundButtons.map(function (button, key) {
|
41603 |
-
return /*#__PURE__*/react.createElement(DialogContentText_DialogContentText, {
|
41604 |
-
"data-testid": "import-found-buttons",
|
41605 |
-
component: "div",
|
41606 |
-
key: key
|
41607 |
-
}, /*#__PURE__*/react.createElement("i", null, translate("common.button"), " ", key + 1, " "), ": ", dlv_umd_default()(button, "name", "Unnamed"), ".", /*#__PURE__*/react.createElement(PropertyList, {
|
41608 |
-
properties: button
|
41609 |
-
}), /*#__PURE__*/react.createElement(TrashButton, {
|
41610 |
-
disabled: foundButtons.length === 1,
|
41611 |
-
onClick: function onClick() {
|
41612 |
-
var currentButtons = cloneDeep_default()(foundButtons);
|
41613 |
-
currentButtons.splice(key, 1);
|
41614 |
-
setFoundButtons(currentButtons);
|
41615 |
-
},
|
41616 |
-
"data-testid": "import-delete",
|
41617 |
-
size: "medium",
|
41618 |
-
icon: "fas fa-trash"
|
41619 |
-
}));
|
41620 |
-
}))), /*#__PURE__*/react.createElement("div", {
|
41621 |
-
style: kbLink && {
|
41622 |
-
display: "flex",
|
41623 |
-
justifyContent: "space-between",
|
41624 |
-
alignItems: "center ",
|
41625 |
-
paddingLeft: "24px"
|
41626 |
-
}
|
41627 |
-
}, /*#__PURE__*/react.createElement(KnowledgeBaseLink, {
|
41628 |
-
articleId: kbLink,
|
41629 |
-
tiny: true,
|
41630 |
-
setting: translate("import_export.import_export")
|
41631 |
-
}), /*#__PURE__*/react.createElement(DialogActions_DialogActions, null, /*#__PURE__*/react.createElement(Button_Button, {
|
41632 |
-
onClick: function onClick() {
|
41633 |
-
return setDialogOpened(false);
|
41634 |
-
},
|
41635 |
-
color: "primary"
|
41636 |
-
}, translate("modal.cancel")), fileSelected && /*#__PURE__*/react.createElement(Button_Button, {
|
41637 |
-
onClick: function onClick() {
|
41638 |
-
return setFileSelected(null);
|
41639 |
},
|
41640 |
-
|
41641 |
-
|
|
|
|
|
|
|
|
|
|
|
41642 |
onClick: function onClick() {
|
41643 |
-
|
41644 |
-
onClose();
|
41645 |
},
|
41646 |
color: "primary",
|
41647 |
-
|
41648 |
-
"data-testid": "
|
41649 |
-
}, translate("
|
41650 |
-
}
|
41651 |
-
|
41652 |
-
function migrateData(data) {
|
41653 |
-
return new Promise(function (resolve, reject) {
|
41654 |
-
apiRequest("/import_migrate", {
|
41655 |
-
method: "POST",
|
41656 |
-
data: {
|
41657 |
-
data: data
|
41658 |
-
}
|
41659 |
-
}).then(function (_ref3) {
|
41660 |
-
var data = _ref3.data;
|
41661 |
-
|
41662 |
-
if (data.success) {
|
41663 |
-
resolve(data.results);
|
41664 |
-
}
|
41665 |
-
})["catch"](function (e) {
|
41666 |
-
reject(e);
|
41667 |
-
console.error(e);
|
41668 |
-
console.error("Buttonizer: OH NO! ERROR: '" + e.statusText + "'. That's all we know... Please check your PHP logs or contact Buttonizer support if you need help.");
|
41669 |
-
console.error("Buttonizer: Visit our community on https://community.buttonizer.pro/");
|
41670 |
-
});
|
41671 |
-
});
|
41672 |
}
|
41673 |
-
;// CONCATENATED MODULE: ./
|
41674 |
-
|
41675 |
-
|
41676 |
|
|
|
41677 |
|
|
|
41678 |
|
|
|
41679 |
|
|
|
41680 |
|
|
|
41681 |
|
|
|
41682 |
|
|
|
41683 |
|
|
|
41684 |
|
41685 |
-
var
|
41686 |
-
|
41687 |
-
|
41688 |
-
|
41689 |
-
|
41690 |
-
|
41691 |
-
|
41692 |
-
|
41693 |
-
|
41694 |
-
|
41695 |
-
|
41696 |
-
|
41697 |
-
|
41698 |
-
|
41699 |
-
|
41700 |
-
|
41701 |
-
|
41702 |
-
|
41703 |
-
|
41704 |
-
|
41705 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41706 |
*/
|
|
|
41707 |
|
41708 |
-
var
|
41709 |
-
var
|
41710 |
-
|
41711 |
-
|
41712 |
-
|
41713 |
-
className = props.className,
|
41714 |
-
defaultChecked = props.defaultChecked,
|
41715 |
-
disabledProp = props.disabled,
|
41716 |
-
icon = props.icon,
|
41717 |
-
id = props.id,
|
41718 |
-
inputProps = props.inputProps,
|
41719 |
-
inputRef = props.inputRef,
|
41720 |
-
name = props.name,
|
41721 |
-
onBlur = props.onBlur,
|
41722 |
-
onChange = props.onChange,
|
41723 |
-
onFocus = props.onFocus,
|
41724 |
-
readOnly = props.readOnly,
|
41725 |
-
required = props.required,
|
41726 |
-
tabIndex = props.tabIndex,
|
41727 |
-
type = props.type,
|
41728 |
-
value = props.value,
|
41729 |
-
other = (0,objectWithoutProperties/* default */.Z)(props, ["autoFocus", "checked", "checkedIcon", "classes", "className", "defaultChecked", "disabled", "icon", "id", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "readOnly", "required", "tabIndex", "type", "value"]);
|
41730 |
-
|
41731 |
-
var _useControlled = (0,useControlled/* default */.Z)({
|
41732 |
-
controlled: checkedProp,
|
41733 |
-
default: Boolean(defaultChecked),
|
41734 |
-
name: 'SwitchBase',
|
41735 |
-
state: 'checked'
|
41736 |
-
}),
|
41737 |
-
_useControlled2 = (0,slicedToArray/* default */.Z)(_useControlled, 2),
|
41738 |
-
checked = _useControlled2[0],
|
41739 |
-
setCheckedState = _useControlled2[1];
|
41740 |
-
|
41741 |
-
var muiFormControl = useFormControl_useFormControl();
|
41742 |
-
|
41743 |
-
var handleFocus = function handleFocus(event) {
|
41744 |
-
if (onFocus) {
|
41745 |
-
onFocus(event);
|
41746 |
-
}
|
41747 |
-
|
41748 |
-
if (muiFormControl && muiFormControl.onFocus) {
|
41749 |
-
muiFormControl.onFocus(event);
|
41750 |
-
}
|
41751 |
-
};
|
41752 |
-
|
41753 |
-
var handleBlur = function handleBlur(event) {
|
41754 |
-
if (onBlur) {
|
41755 |
-
onBlur(event);
|
41756 |
}
|
|
|
|
|
|
|
41757 |
|
41758 |
-
|
41759 |
-
|
|
|
|
|
|
|
41760 |
}
|
|
|
|
|
|
|
|
|
|
|
41761 |
};
|
|
|
41762 |
|
41763 |
-
|
41764 |
-
|
41765 |
-
|
41766 |
-
|
41767 |
-
|
41768 |
-
|
41769 |
-
|
|
|
|
|
41770 |
}
|
41771 |
};
|
|
|
41772 |
|
41773 |
-
|
41774 |
-
|
41775 |
-
if (muiFormControl) {
|
41776 |
-
if (typeof disabled === 'undefined') {
|
41777 |
-
disabled = muiFormControl.disabled;
|
41778 |
-
}
|
41779 |
-
}
|
41780 |
-
|
41781 |
-
var hasLabelFor = type === 'checkbox' || type === 'radio';
|
41782 |
-
return /*#__PURE__*/react.createElement(IconButton_IconButton, (0,esm_extends/* default */.Z)({
|
41783 |
-
component: "span",
|
41784 |
-
className: (0,clsx_m/* default */.Z)(classes.root, className, checked && classes.checked, disabled && classes.disabled),
|
41785 |
-
disabled: disabled,
|
41786 |
-
tabIndex: null,
|
41787 |
-
role: undefined,
|
41788 |
-
onFocus: handleFocus,
|
41789 |
-
onBlur: handleBlur,
|
41790 |
-
ref: ref
|
41791 |
-
}, other), /*#__PURE__*/react.createElement("input", (0,esm_extends/* default */.Z)({
|
41792 |
-
autoFocus: autoFocus,
|
41793 |
-
checked: checkedProp,
|
41794 |
-
defaultChecked: defaultChecked,
|
41795 |
-
className: classes.input,
|
41796 |
-
disabled: disabled,
|
41797 |
-
id: hasLabelFor && id,
|
41798 |
-
name: name,
|
41799 |
-
onChange: handleInputChange,
|
41800 |
-
readOnly: readOnly,
|
41801 |
-
ref: inputRef,
|
41802 |
-
required: required,
|
41803 |
-
tabIndex: tabIndex,
|
41804 |
-
type: type,
|
41805 |
-
value: value
|
41806 |
-
}, inputProps)), checked ? checkedIcon : icon);
|
41807 |
-
}); // NB: If changed, please update Checkbox, Switch and Radio
|
41808 |
-
// so that the API documentation is updated.
|
41809 |
-
|
41810 |
-
false ? 0 : void 0;
|
41811 |
-
/* harmony default export */ var internal_SwitchBase = ((0,withStyles/* default */.Z)(SwitchBase_styles, {
|
41812 |
-
name: 'PrivateSwitchBase'
|
41813 |
-
})(SwitchBase));
|
41814 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/svg-icons/CheckBoxOutlineBlank.js
|
41815 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41816 |
|
41817 |
/**
|
41818 |
-
*
|
|
|
|
|
|
|
|
|
41819 |
*/
|
41820 |
-
|
41821 |
-
|
41822 |
-
|
41823 |
-
}
|
41824 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/svg-icons/CheckBox.js
|
41825 |
-
|
41826 |
|
41827 |
/**
|
41828 |
-
*
|
|
|
|
|
|
|
|
|
41829 |
*/
|
41830 |
-
|
41831 |
-
|
41832 |
-
|
41833 |
-
}
|
41834 |
-
|
41835 |
-
|
|
|
|
|
|
|
41836 |
|
41837 |
/**
|
41838 |
-
*
|
|
|
|
|
|
|
|
|
41839 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
41840 |
|
41841 |
-
|
41842 |
-
|
41843 |
-
|
41844 |
-
|
41845 |
-
|
41846 |
-
|
41847 |
-
|
41848 |
-
|
41849 |
-
|
41850 |
-
|
41851 |
-
|
41852 |
-
|
41853 |
-
|
41854 |
-
|
41855 |
-
|
41856 |
-
|
41857 |
-
|
41858 |
-
var Checkbox_styles = function styles(theme) {
|
41859 |
-
return {
|
41860 |
-
/* Styles applied to the root element. */
|
41861 |
-
root: {
|
41862 |
-
color: theme.palette.text.secondary
|
41863 |
-
},
|
41864 |
|
41865 |
-
|
41866 |
-
|
|
|
|
|
|
|
|
|
|
|
41867 |
|
41868 |
-
|
41869 |
-
disabled: {},
|
41870 |
|
41871 |
-
|
41872 |
-
|
|
|
|
|
41873 |
|
41874 |
-
|
41875 |
-
|
41876 |
-
|
41877 |
-
color: theme.palette.primary.main,
|
41878 |
-
'&:hover': {
|
41879 |
-
backgroundColor: (0,colorManipulator/* fade */.U1)(theme.palette.primary.main, theme.palette.action.hoverOpacity),
|
41880 |
-
// Reset on touch devices, it doesn't add specificity
|
41881 |
-
'@media (hover: none)': {
|
41882 |
-
backgroundColor: 'transparent'
|
41883 |
-
}
|
41884 |
-
}
|
41885 |
-
},
|
41886 |
-
'&$disabled': {
|
41887 |
-
color: theme.palette.action.disabled
|
41888 |
-
}
|
41889 |
-
},
|
41890 |
|
41891 |
-
|
41892 |
-
|
41893 |
-
'&$checked': {
|
41894 |
-
color: theme.palette.secondary.main,
|
41895 |
-
'&:hover': {
|
41896 |
-
backgroundColor: (0,colorManipulator/* fade */.U1)(theme.palette.secondary.main, theme.palette.action.hoverOpacity),
|
41897 |
-
// Reset on touch devices, it doesn't add specificity
|
41898 |
-
'@media (hover: none)': {
|
41899 |
-
backgroundColor: 'transparent'
|
41900 |
-
}
|
41901 |
-
}
|
41902 |
-
},
|
41903 |
-
'&$disabled': {
|
41904 |
-
color: theme.palette.action.disabled
|
41905 |
-
}
|
41906 |
-
}
|
41907 |
-
};
|
41908 |
-
};
|
41909 |
-
var defaultCheckedIcon = /*#__PURE__*/react.createElement(CheckBox, null);
|
41910 |
-
var defaultIcon = /*#__PURE__*/react.createElement(CheckBoxOutlineBlank, null);
|
41911 |
-
var defaultIndeterminateIcon = /*#__PURE__*/react.createElement(IndeterminateCheckBox, null);
|
41912 |
-
var Checkbox = /*#__PURE__*/react.forwardRef(function Checkbox(props, ref) {
|
41913 |
-
var _props$checkedIcon = props.checkedIcon,
|
41914 |
-
checkedIcon = _props$checkedIcon === void 0 ? defaultCheckedIcon : _props$checkedIcon,
|
41915 |
-
classes = props.classes,
|
41916 |
-
_props$color = props.color,
|
41917 |
-
color = _props$color === void 0 ? 'secondary' : _props$color,
|
41918 |
-
_props$icon = props.icon,
|
41919 |
-
iconProp = _props$icon === void 0 ? defaultIcon : _props$icon,
|
41920 |
-
_props$indeterminate = props.indeterminate,
|
41921 |
-
indeterminate = _props$indeterminate === void 0 ? false : _props$indeterminate,
|
41922 |
-
_props$indeterminateI = props.indeterminateIcon,
|
41923 |
-
indeterminateIconProp = _props$indeterminateI === void 0 ? defaultIndeterminateIcon : _props$indeterminateI,
|
41924 |
-
inputProps = props.inputProps,
|
41925 |
-
_props$size = props.size,
|
41926 |
-
size = _props$size === void 0 ? 'medium' : _props$size,
|
41927 |
-
other = (0,objectWithoutProperties/* default */.Z)(props, ["checkedIcon", "classes", "color", "icon", "indeterminate", "indeterminateIcon", "inputProps", "size"]);
|
41928 |
|
41929 |
-
|
41930 |
-
|
41931 |
-
|
41932 |
-
|
41933 |
-
|
41934 |
-
|
41935 |
-
|
41936 |
-
|
41937 |
-
|
41938 |
-
|
41939 |
-
inputProps: (0,esm_extends/* default */.Z)({
|
41940 |
-
'data-indeterminate': indeterminate
|
41941 |
-
}, inputProps),
|
41942 |
-
icon: /*#__PURE__*/react.cloneElement(icon, {
|
41943 |
-
fontSize: icon.props.fontSize === undefined && size === "small" ? size : icon.props.fontSize
|
41944 |
-
}),
|
41945 |
-
checkedIcon: /*#__PURE__*/react.cloneElement(indeterminateIcon, {
|
41946 |
-
fontSize: indeterminateIcon.props.fontSize === undefined && size === "small" ? size : indeterminateIcon.props.fontSize
|
41947 |
-
}),
|
41948 |
-
ref: ref
|
41949 |
-
}, other));
|
41950 |
-
});
|
41951 |
-
false ? 0 : void 0;
|
41952 |
-
/* harmony default export */ var Checkbox_Checkbox = ((0,withStyles/* default */.Z)(Checkbox_styles, {
|
41953 |
-
name: 'MuiCheckbox'
|
41954 |
-
})(Checkbox));
|
41955 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/svg-icons/Cancel.js
|
41956 |
|
|
|
|
|
41957 |
|
41958 |
/**
|
41959 |
-
*
|
|
|
|
|
|
|
|
|
41960 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41961 |
|
41962 |
-
|
41963 |
-
|
41964 |
-
|
41965 |
-
|
41966 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
41967 |
|
|
|
41968 |
|
|
|
|
|
|
|
|
|
|
|
|
|
41969 |
|
|
|
41970 |
|
|
|
|
|
|
|
41971 |
|
|
|
|
|
|
|
|
|
|
|
41972 |
|
|
|
|
|
41973 |
|
|
|
|
|
41974 |
|
|
|
|
|
|
|
|
|
|
|
41975 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
41976 |
|
|
|
|
|
41977 |
|
41978 |
-
|
41979 |
-
|
41980 |
-
|
41981 |
-
|
41982 |
-
|
41983 |
-
|
41984 |
-
|
41985 |
-
|
41986 |
-
|
41987 |
-
|
41988 |
-
|
41989 |
-
|
41990 |
-
|
41991 |
-
backgroundColor: backgroundColor,
|
41992 |
-
borderRadius: 32 / 2,
|
41993 |
-
whiteSpace: 'nowrap',
|
41994 |
-
transition: theme.transitions.create(['background-color', 'box-shadow']),
|
41995 |
-
// label will inherit this from root, then `clickable` class overrides this for both
|
41996 |
-
cursor: 'default',
|
41997 |
-
// We disable the focus ring for mouse, touch and keyboard users.
|
41998 |
-
outline: 0,
|
41999 |
-
textDecoration: 'none',
|
42000 |
-
border: 'none',
|
42001 |
-
// Remove `button` border
|
42002 |
-
padding: 0,
|
42003 |
-
// Remove `button` padding
|
42004 |
-
verticalAlign: 'middle',
|
42005 |
-
boxSizing: 'border-box',
|
42006 |
-
'&$disabled': {
|
42007 |
-
opacity: 0.5,
|
42008 |
-
pointerEvents: 'none'
|
42009 |
-
},
|
42010 |
-
'& $avatar': {
|
42011 |
-
marginLeft: 5,
|
42012 |
-
marginRight: -6,
|
42013 |
-
width: 24,
|
42014 |
-
height: 24,
|
42015 |
-
color: theme.palette.type === 'light' ? theme.palette.grey[700] : theme.palette.grey[300],
|
42016 |
-
fontSize: theme.typography.pxToRem(12)
|
42017 |
-
},
|
42018 |
-
'& $avatarColorPrimary': {
|
42019 |
-
color: theme.palette.primary.contrastText,
|
42020 |
-
backgroundColor: theme.palette.primary.dark
|
42021 |
-
},
|
42022 |
-
'& $avatarColorSecondary': {
|
42023 |
-
color: theme.palette.secondary.contrastText,
|
42024 |
-
backgroundColor: theme.palette.secondary.dark
|
42025 |
-
},
|
42026 |
-
'& $avatarSmall': {
|
42027 |
-
marginLeft: 4,
|
42028 |
-
marginRight: -4,
|
42029 |
-
width: 18,
|
42030 |
-
height: 18,
|
42031 |
-
fontSize: theme.typography.pxToRem(10)
|
42032 |
-
}
|
42033 |
-
},
|
42034 |
|
42035 |
-
|
42036 |
-
|
42037 |
-
|
42038 |
-
|
42039 |
|
42040 |
-
|
42041 |
-
|
42042 |
-
|
42043 |
-
|
42044 |
-
|
42045 |
|
42046 |
-
|
42047 |
-
colorSecondary: {
|
42048 |
-
backgroundColor: theme.palette.secondary.main,
|
42049 |
-
color: theme.palette.secondary.contrastText
|
42050 |
-
},
|
42051 |
|
42052 |
-
|
42053 |
-
|
|
|
|
|
42054 |
|
42055 |
-
|
42056 |
-
|
42057 |
-
userSelect: 'none',
|
42058 |
-
WebkitTapHighlightColor: 'transparent',
|
42059 |
-
cursor: 'pointer',
|
42060 |
-
'&:hover, &:focus': {
|
42061 |
-
backgroundColor: (0,colorManipulator/* emphasize */._4)(backgroundColor, 0.08)
|
42062 |
-
},
|
42063 |
-
'&:active': {
|
42064 |
-
boxShadow: theme.shadows[1]
|
42065 |
-
}
|
42066 |
-
},
|
42067 |
|
42068 |
-
|
42069 |
-
|
42070 |
-
|
42071 |
-
|
42072 |
-
|
42073 |
-
|
|
|
|
|
42074 |
|
42075 |
-
|
42076 |
-
|
42077 |
-
|
42078 |
-
|
42079 |
-
|
42080 |
-
|
|
|
|
|
|
|
|
|
42081 |
|
42082 |
-
|
42083 |
-
|
42084 |
-
'&:focus': {
|
42085 |
-
backgroundColor: (0,colorManipulator/* emphasize */._4)(backgroundColor, 0.08)
|
42086 |
-
}
|
42087 |
-
},
|
42088 |
|
42089 |
-
|
42090 |
-
|
42091 |
-
|
42092 |
-
|
42093 |
-
|
42094 |
-
},
|
42095 |
|
42096 |
-
|
42097 |
-
|
42098 |
-
'&:focus': {
|
42099 |
-
backgroundColor: (0,colorManipulator/* emphasize */._4)(theme.palette.secondary.main, 0.2)
|
42100 |
-
}
|
42101 |
-
},
|
42102 |
|
42103 |
-
|
42104 |
-
|
42105 |
-
|
42106 |
-
|
42107 |
-
|
42108 |
-
|
42109 |
-
|
42110 |
-
|
42111 |
-
|
42112 |
-
|
42113 |
-
|
42114 |
-
marginLeft: 2
|
42115 |
-
},
|
42116 |
-
'& $icon': {
|
42117 |
-
marginLeft: 4
|
42118 |
-
},
|
42119 |
-
'& $iconSmall': {
|
42120 |
-
marginLeft: 2
|
42121 |
-
},
|
42122 |
-
'& $deleteIcon': {
|
42123 |
-
marginRight: 5
|
42124 |
-
},
|
42125 |
-
'& $deleteIconSmall': {
|
42126 |
-
marginRight: 3
|
42127 |
-
}
|
42128 |
-
},
|
42129 |
|
42130 |
-
|
42131 |
-
|
42132 |
-
|
42133 |
-
|
42134 |
-
|
42135 |
-
|
42136 |
-
|
42137 |
-
|
|
|
42138 |
|
42139 |
-
|
42140 |
-
|
42141 |
-
|
42142 |
-
|
42143 |
-
|
42144 |
-
|
42145 |
-
|
42146 |
-
|
42147 |
-
|
42148 |
|
42149 |
-
|
42150 |
-
|
|
|
42151 |
|
42152 |
-
|
42153 |
-
|
42154 |
|
42155 |
-
|
42156 |
-
|
|
|
42157 |
|
42158 |
-
|
42159 |
-
|
|
|
|
|
42160 |
|
42161 |
-
|
42162 |
-
|
42163 |
-
|
42164 |
-
|
42165 |
-
|
42166 |
-
},
|
42167 |
|
42168 |
-
|
42169 |
-
|
42170 |
-
|
42171 |
-
|
42172 |
-
|
42173 |
-
marginRight: -4
|
42174 |
-
},
|
42175 |
|
42176 |
-
|
42177 |
-
|
42178 |
-
|
42179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
42180 |
|
42181 |
-
|
42182 |
-
|
42183 |
-
|
42184 |
-
|
|
|
|
|
42185 |
|
42186 |
-
/* Styles applied to the label `span` element. */
|
42187 |
-
label: {
|
42188 |
-
overflow: 'hidden',
|
42189 |
-
textOverflow: 'ellipsis',
|
42190 |
-
paddingLeft: 12,
|
42191 |
-
paddingRight: 12,
|
42192 |
-
whiteSpace: 'nowrap'
|
42193 |
-
},
|
42194 |
|
42195 |
-
/* Styles applied to the label `span` element if `size="small"`. */
|
42196 |
-
labelSmall: {
|
42197 |
-
paddingLeft: 8,
|
42198 |
-
paddingRight: 8
|
42199 |
-
},
|
42200 |
|
42201 |
-
/* Styles applied to the `deleteIcon` element. */
|
42202 |
-
deleteIcon: {
|
42203 |
-
WebkitTapHighlightColor: 'transparent',
|
42204 |
-
color: deleteIconColor,
|
42205 |
-
height: 22,
|
42206 |
-
width: 22,
|
42207 |
-
cursor: 'pointer',
|
42208 |
-
margin: '0 5px 0 -6px',
|
42209 |
-
'&:hover': {
|
42210 |
-
color: (0,colorManipulator/* fade */.U1)(deleteIconColor, 0.4)
|
42211 |
-
}
|
42212 |
-
},
|
42213 |
|
42214 |
-
/* Styles applied to the `deleteIcon` element if `size="small"`. */
|
42215 |
-
deleteIconSmall: {
|
42216 |
-
height: 16,
|
42217 |
-
width: 16,
|
42218 |
-
marginRight: 4,
|
42219 |
-
marginLeft: -4
|
42220 |
-
},
|
42221 |
|
42222 |
-
|
42223 |
-
|
42224 |
-
|
42225 |
-
|
42226 |
-
|
42227 |
-
|
42228 |
-
|
|
|
|
|
|
|
|
|
42229 |
|
42230 |
-
|
42231 |
-
|
42232 |
-
color: (0,colorManipulator/* fade */.U1)(theme.palette.secondary.contrastText, 0.7),
|
42233 |
-
'&:hover, &:active': {
|
42234 |
-
color: theme.palette.secondary.contrastText
|
42235 |
-
}
|
42236 |
-
},
|
42237 |
|
42238 |
-
|
42239 |
-
|
42240 |
-
|
42241 |
-
'&:hover, &:active': {
|
42242 |
-
color: theme.palette.primary.main
|
42243 |
-
}
|
42244 |
-
},
|
42245 |
|
42246 |
-
|
42247 |
-
|
42248 |
-
|
42249 |
-
'&:hover, &:active': {
|
42250 |
-
color: theme.palette.secondary.main
|
42251 |
}
|
42252 |
}
|
42253 |
-
}
|
|
|
|
|
42254 |
};
|
42255 |
|
42256 |
-
function isDeleteKeyboardEvent(keyboardEvent) {
|
42257 |
-
return keyboardEvent.key === 'Backspace' || keyboardEvent.key === 'Delete';
|
42258 |
-
}
|
42259 |
/**
|
42260 |
-
*
|
|
|
|
|
|
|
|
|
42261 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
42262 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42263 |
|
42264 |
-
|
42265 |
-
|
42266 |
-
|
42267 |
-
|
42268 |
-
|
42269 |
-
|
42270 |
-
|
42271 |
-
|
42272 |
-
|
42273 |
-
|
42274 |
-
|
42275 |
-
|
42276 |
-
|
42277 |
-
|
42278 |
-
onDelete = props.onDelete,
|
42279 |
-
onKeyDown = props.onKeyDown,
|
42280 |
-
onKeyUp = props.onKeyUp,
|
42281 |
-
_props$size = props.size,
|
42282 |
-
size = _props$size === void 0 ? 'medium' : _props$size,
|
42283 |
-
_props$variant = props.variant,
|
42284 |
-
variant = _props$variant === void 0 ? 'default' : _props$variant,
|
42285 |
-
other = (0,objectWithoutProperties/* default */.Z)(props, ["avatar", "classes", "className", "clickable", "color", "component", "deleteIcon", "disabled", "icon", "label", "onClick", "onDelete", "onKeyDown", "onKeyUp", "size", "variant"]);
|
42286 |
-
|
42287 |
-
var chipRef = react.useRef(null);
|
42288 |
-
var handleRef = (0,useForkRef/* default */.Z)(chipRef, ref);
|
42289 |
-
|
42290 |
-
var handleDeleteIconClick = function handleDeleteIconClick(event) {
|
42291 |
-
// Stop the event from bubbling up to the `Chip`
|
42292 |
-
event.stopPropagation();
|
42293 |
-
|
42294 |
-
if (onDelete) {
|
42295 |
-
onDelete(event);
|
42296 |
-
}
|
42297 |
-
};
|
42298 |
-
|
42299 |
-
var handleKeyDown = function handleKeyDown(event) {
|
42300 |
-
// Ignore events from children of `Chip`.
|
42301 |
-
if (event.currentTarget === event.target && isDeleteKeyboardEvent(event)) {
|
42302 |
-
// will be handled in keyUp, otherwise some browsers
|
42303 |
-
// might init navigation
|
42304 |
-
event.preventDefault();
|
42305 |
-
}
|
42306 |
-
|
42307 |
-
if (onKeyDown) {
|
42308 |
-
onKeyDown(event);
|
42309 |
-
}
|
42310 |
-
};
|
42311 |
-
|
42312 |
-
var handleKeyUp = function handleKeyUp(event) {
|
42313 |
-
// Ignore events from children of `Chip`.
|
42314 |
-
if (event.currentTarget === event.target) {
|
42315 |
-
if (onDelete && isDeleteKeyboardEvent(event)) {
|
42316 |
-
onDelete(event);
|
42317 |
-
} else if (event.key === 'Escape' && chipRef.current) {
|
42318 |
-
chipRef.current.blur();
|
42319 |
-
}
|
42320 |
-
}
|
42321 |
-
|
42322 |
-
if (onKeyUp) {
|
42323 |
-
onKeyUp(event);
|
42324 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42325 |
};
|
42326 |
|
42327 |
-
|
42328 |
-
var
|
42329 |
-
var
|
42330 |
-
var
|
42331 |
-
component: 'div'
|
42332 |
-
} : {};
|
42333 |
-
var deleteIcon = null;
|
42334 |
|
42335 |
-
|
42336 |
-
|
42337 |
-
deleteIcon = deleteIconProp && /*#__PURE__*/react.isValidElement(deleteIconProp) ? /*#__PURE__*/react.cloneElement(deleteIconProp, {
|
42338 |
-
className: (0,clsx_m/* default */.Z)(deleteIconProp.props.className, classes.deleteIcon, customClasses),
|
42339 |
-
onClick: handleDeleteIconClick
|
42340 |
-
}) : /*#__PURE__*/react.createElement(Cancel, {
|
42341 |
-
className: (0,clsx_m/* default */.Z)(classes.deleteIcon, customClasses),
|
42342 |
-
onClick: handleDeleteIconClick
|
42343 |
-
});
|
42344 |
-
}
|
42345 |
|
42346 |
-
|
|
|
|
|
|
|
|
|
|
|
42347 |
|
42348 |
-
|
42349 |
-
|
42350 |
-
className: (0,clsx_m/* default */.Z)(classes.avatar, avatarProp.props.className, small && classes.avatarSmall, color !== 'default' && classes["avatarColor".concat((0,capitalize/* default */.Z)(color))])
|
42351 |
-
});
|
42352 |
}
|
42353 |
|
42354 |
-
|
42355 |
-
|
42356 |
-
if (iconProp && /*#__PURE__*/react.isValidElement(iconProp)) {
|
42357 |
-
icon = /*#__PURE__*/react.cloneElement(iconProp, {
|
42358 |
-
className: (0,clsx_m/* default */.Z)(classes.icon, iconProp.props.className, small && classes.iconSmall, color !== 'default' && classes["iconColor".concat((0,capitalize/* default */.Z)(color))])
|
42359 |
-
});
|
42360 |
-
}
|
42361 |
|
42362 |
-
|
|
|
42363 |
|
42364 |
-
|
42365 |
-
|
42366 |
-
|
42367 |
-
|
42368 |
-
|
42369 |
-
}[color]], disabled && classes.disabled, small && classes.sizeSmall, clickable && classes.clickable, onDelete && classes.deletable),
|
42370 |
-
"aria-disabled": disabled ? true : undefined,
|
42371 |
-
tabIndex: clickable || onDelete ? 0 : undefined,
|
42372 |
-
onClick: onClick,
|
42373 |
-
onKeyDown: handleKeyDown,
|
42374 |
-
onKeyUp: handleKeyUp,
|
42375 |
-
ref: handleRef
|
42376 |
-
}, moreProps, other), avatar || icon, /*#__PURE__*/react.createElement("span", {
|
42377 |
-
className: (0,clsx_m/* default */.Z)(classes.label, small && classes.labelSmall)
|
42378 |
-
}, label), deleteIcon);
|
42379 |
-
});
|
42380 |
-
false ? 0 : void 0;
|
42381 |
-
/* harmony default export */ var Chip_Chip = ((0,withStyles/* default */.Z)(Chip_styles, {
|
42382 |
-
name: 'MuiChip'
|
42383 |
-
})(Chip));
|
42384 |
-
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Dialogs/TemplatesDialog/TemplateOptions.js
|
42385 |
-
function TemplateOptions_slicedToArray(arr, i) { return TemplateOptions_arrayWithHoles(arr) || TemplateOptions_iterableToArrayLimit(arr, i) || TemplateOptions_unsupportedIterableToArray(arr, i) || TemplateOptions_nonIterableRest(); }
|
42386 |
|
42387 |
-
|
|
|
|
|
42388 |
|
42389 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42390 |
|
42391 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
42392 |
|
42393 |
-
|
|
|
|
|
|
|
42394 |
|
42395 |
-
|
|
|
|
|
|
|
42396 |
|
42397 |
-
|
|
|
|
|
42398 |
|
42399 |
-
|
|
|
42400 |
|
42401 |
-
function
|
|
|
42402 |
|
|
|
|
|
|
|
|
|
42403 |
|
|
|
|
|
42404 |
|
|
|
|
|
|
|
|
|
|
|
|
|
42405 |
|
|
|
|
|
42406 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42407 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42408 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42409 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42410 |
|
|
|
42411 |
|
42412 |
-
var
|
42413 |
-
var
|
42414 |
-
// Filter correct buttons
|
42415 |
-
if (template.export_type !== filterButtons) {
|
42416 |
-
return false;
|
42417 |
-
} // Hide wrong menu styles
|
42418 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42419 |
|
42420 |
-
|
42421 |
-
if (!filterFrameDesign.includes(dlv_umd_default()(template, "group_type", "default"))) return false;
|
42422 |
-
} // Hide filtered button actions
|
42423 |
|
|
|
|
|
|
|
|
|
|
|
42424 |
|
42425 |
-
|
42426 |
-
|
|
|
|
|
|
|
|
|
|
|
42427 |
}
|
42428 |
-
|
42429 |
-
return true;
|
42430 |
-
});
|
42431 |
-
var defaultButton = {
|
42432 |
-
name: translate("utils.new_button"),
|
42433 |
-
show_mobile: true,
|
42434 |
-
show_desktop: true
|
42435 |
-
};
|
42436 |
-
|
42437 |
-
if (filterButtons === "group") {
|
42438 |
-
filteredList.unshift({
|
42439 |
-
data: {
|
42440 |
-
name: translate("utils.new_group"),
|
42441 |
-
show_mobile: true,
|
42442 |
-
show_desktop: true
|
42443 |
-
},
|
42444 |
-
buttons: [defaultButton],
|
42445 |
-
export_type: "group"
|
42446 |
-
});
|
42447 |
-
} else if (filterButtons === "button") {
|
42448 |
-
filteredList.unshift(TemplateOptions_objectSpread(TemplateOptions_objectSpread({}, defaultButton), {}, {
|
42449 |
-
export_type: "button"
|
42450 |
-
}));
|
42451 |
}
|
42452 |
|
42453 |
-
|
42454 |
-
|
|
|
|
|
|
|
|
|
|
|
42455 |
|
42456 |
-
|
42457 |
-
|
42458 |
-
currentGroup = _ref.currentGroup,
|
42459 |
-
onClose = _ref.onClose,
|
42460 |
-
returnedTemplates = _ref.returnedTemplates,
|
42461 |
-
filterButtons = _ref.filterButtons,
|
42462 |
-
filterFrameDesign = _ref.filterFrameDesign,
|
42463 |
-
filterPopularAction = _ref.filterPopularAction;
|
42464 |
|
42465 |
-
|
42466 |
-
|
42467 |
-
|
42468 |
-
setImportFilteredList = _useState2[1];
|
42469 |
|
42470 |
-
|
42471 |
-
|
42472 |
-
isLoading = _useState4[0],
|
42473 |
-
setIsLoading = _useState4[1];
|
42474 |
|
42475 |
-
|
42476 |
-
|
42477 |
-
|
42478 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42479 |
|
42480 |
-
|
|
|
|
|
42481 |
|
42482 |
-
var
|
42483 |
-
var selectedIndex = selected.indexOf(id);
|
42484 |
-
var newSelected = [];
|
42485 |
|
42486 |
-
|
42487 |
-
|
42488 |
-
|
42489 |
-
|
42490 |
-
}
|
42491 |
-
|
42492 |
-
|
42493 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42494 |
}
|
42495 |
-
|
42496 |
-
setSelected(newSelected);
|
42497 |
};
|
42498 |
|
42499 |
-
var
|
42500 |
-
|
42501 |
-
|
|
|
|
|
42502 |
});
|
|
|
|
|
|
|
42503 |
|
42504 |
-
|
42505 |
-
|
42506 |
-
|
|
|
|
|
42507 |
|
42508 |
-
|
42509 |
-
};
|
42510 |
|
42511 |
-
var
|
42512 |
-
onClose();
|
42513 |
-
setSelected([]);
|
42514 |
-
};
|
42515 |
|
42516 |
-
(
|
42517 |
-
|
42518 |
-
setImportFilteredList(result);
|
42519 |
-
setIsLoading(false);
|
42520 |
-
})["catch"](function (err) {
|
42521 |
-
console.error(err);
|
42522 |
-
});
|
42523 |
-
}, []);
|
42524 |
-
(0,react.useEffect)(function () {
|
42525 |
-
setSelected([]);
|
42526 |
-
}, [filterButtons, filterFrameDesign, filterPopularAction]);
|
42527 |
-
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(DialogContent_DialogContent, null, !isLoading && returnedTemplates && /*#__PURE__*/react.createElement("p", {
|
42528 |
-
className: "search-results"
|
42529 |
-
}, /*#__PURE__*/react.createElement("span", {
|
42530 |
-
dangerouslySetInnerHTML: {
|
42531 |
-
__html: translate("utils.templates.found", "", filteredTemplateList.length)
|
42532 |
-
}
|
42533 |
-
})), isLoading && /*#__PURE__*/react.createElement("div", {
|
42534 |
-
className: "loading"
|
42535 |
-
}, /*#__PURE__*/react.createElement("div", {
|
42536 |
-
style: {
|
42537 |
-
alignSelf: "center"
|
42538 |
-
}
|
42539 |
-
}, /*#__PURE__*/react.createElement("svg", {
|
42540 |
-
width: "60",
|
42541 |
-
height: "60",
|
42542 |
-
viewBox: "0 0 38 38",
|
42543 |
-
xmlns: "http://www.w3.org/2000/svg",
|
42544 |
-
stroke: "#2f788a"
|
42545 |
-
}, /*#__PURE__*/react.createElement("g", {
|
42546 |
-
fill: "none",
|
42547 |
-
fillRule: "evenodd"
|
42548 |
-
}, /*#__PURE__*/react.createElement("g", {
|
42549 |
-
transform: "translate(1 1)",
|
42550 |
-
strokeWidth: "2"
|
42551 |
-
}, /*#__PURE__*/react.createElement("circle", {
|
42552 |
-
strokeOpacity: ".5",
|
42553 |
-
cx: "18",
|
42554 |
-
cy: "18",
|
42555 |
-
r: "18"
|
42556 |
-
}), /*#__PURE__*/react.createElement("path", {
|
42557 |
-
d: "M36 18c0-9.94-8.06-18-18-18"
|
42558 |
-
}, /*#__PURE__*/react.createElement("animateTransform", {
|
42559 |
-
attributeName: "transform",
|
42560 |
-
type: "rotate",
|
42561 |
-
from: "0 18 18",
|
42562 |
-
to: "360 18 18",
|
42563 |
-
dur: "1s",
|
42564 |
-
repeatCount: "indefinite"
|
42565 |
-
}))))), /*#__PURE__*/react.createElement("p", null, translate("loading.loading")))), !isLoading && /*#__PURE__*/react.createElement("div", {
|
42566 |
-
className: "template"
|
42567 |
-
}, filteredTemplateList.map(function (template, key) {
|
42568 |
-
return /*#__PURE__*/react.createElement("div", {
|
42569 |
-
key: key,
|
42570 |
-
className: "container",
|
42571 |
-
"data-testid": "templates:template-option"
|
42572 |
-
}, filterButtons === "button" && /*#__PURE__*/react.createElement(Checkbox_Checkbox, {
|
42573 |
-
checked: selected.includes(key),
|
42574 |
-
onChange: function onChange() {
|
42575 |
-
handleCheckboxSelect(key);
|
42576 |
-
},
|
42577 |
-
className: (0,clsx_m/* default */.Z)("checkbox", selected.length === 0 && "hidden"),
|
42578 |
-
"data-testid": "templates:template-option-checkbox"
|
42579 |
-
}), /*#__PURE__*/react.createElement("div", {
|
42580 |
-
className: "type",
|
42581 |
-
onClick: function onClick() {
|
42582 |
-
if (selected.length > 0) {
|
42583 |
-
return handleCheckboxSelect(key);
|
42584 |
-
}
|
42585 |
|
42586 |
-
|
42587 |
-
|
42588 |
-
|
42589 |
-
|
42590 |
-
|
42591 |
-
|
42592 |
-
|
42593 |
-
|
42594 |
-
|
42595 |
-
|
42596 |
-
|
42597 |
-
|
42598 |
-
|
42599 |
-
|
42600 |
-
|
42601 |
-
key: key,
|
42602 |
-
label: template.name
|
42603 |
-
}), /*#__PURE__*/react.createElement("div", {
|
42604 |
-
className: "select"
|
42605 |
-
}, selected.includes(key) ? /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("i", {
|
42606 |
-
className: "fa fa-check-circle",
|
42607 |
-
"aria-hidden": "true"
|
42608 |
-
}), translate("templates.selected")) : /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("i", {
|
42609 |
-
className: "fa fa-plus-circle",
|
42610 |
-
"aria-hidden": "true"
|
42611 |
-
}), translate("templates.select")))));
|
42612 |
-
}))), /*#__PURE__*/react.createElement(DialogActions_DialogActions, {
|
42613 |
-
style: {
|
42614 |
-
marginTop: "20px",
|
42615 |
-
justifyContent: "space-between"
|
42616 |
-
}
|
42617 |
-
}, /*#__PURE__*/react.createElement(ImportButton, {
|
42618 |
-
index: index,
|
42619 |
-
style: {
|
42620 |
-
fontSize: 13
|
42621 |
-
},
|
42622 |
-
currentGroup: currentGroup,
|
42623 |
-
label: filterButtons === "button" ? translate("import_export.import.new_group.button") : translate("import_export.import.new_group.group"),
|
42624 |
-
kbLink: 653,
|
42625 |
-
onClose: handleClose
|
42626 |
-
}), selected.length > 0 && /*#__PURE__*/react.createElement(Button_Button, {
|
42627 |
-
className: (0,clsx_m/* default */.Z)("select-all", selected.length > 0 && "visible"),
|
42628 |
-
variant: "contained",
|
42629 |
-
onClick: function onClick() {
|
42630 |
-
return handleSelectImport();
|
42631 |
-
},
|
42632 |
-
color: "primary",
|
42633 |
-
size: "small",
|
42634 |
-
"data-testid": "templates:insert-selected"
|
42635 |
-
}, translate("templates.insert"))));
|
42636 |
}
|
42637 |
-
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Settings/ButtonAction/ButtonActionOptions.js
|
42638 |
-
function ButtonActionOptions_toConsumableArray(arr) { return ButtonActionOptions_arrayWithoutHoles(arr) || ButtonActionOptions_iterableToArray(arr) || ButtonActionOptions_unsupportedIterableToArray(arr) || ButtonActionOptions_nonIterableSpread(); }
|
42639 |
|
42640 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42641 |
|
42642 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42643 |
|
42644 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42645 |
|
42646 |
-
|
|
|
42647 |
|
42648 |
-
|
|
|
|
|
|
|
|
|
42649 |
|
42650 |
-
|
|
|
|
|
|
|
|
|
|
|
42651 |
|
42652 |
-
|
|
|
|
|
|
|
|
|
|
|
42653 |
|
42654 |
-
|
|
|
42655 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42656 |
|
42657 |
-
|
42658 |
-
|
42659 |
-
|
42660 |
-
|
42661 |
-
|
42662 |
-
|
42663 |
-
|
42664 |
-
|
42665 |
-
|
42666 |
-
|
42667 |
-
|
42668 |
-
|
42669 |
-
|
42670 |
-
|
42671 |
-
|
42672 |
-
|
42673 |
-
|
42674 |
-
|
42675 |
-
|
42676 |
-
}
|
42677 |
-
|
42678 |
-
|
42679 |
-
|
42680 |
-
|
42681 |
-
label: translate("settings.button_action.actions.go_back_one_page")
|
42682 |
-
}, {
|
42683 |
-
value: "javascript_pro",
|
42684 |
-
label: translate("settings.button_action.actions.javascript.name"),
|
42685 |
-
isPro: true
|
42686 |
-
}, {
|
42687 |
-
value: "socialsharing",
|
42688 |
-
label: translate("settings.button_action.actions.social_sharing.social_sharing")
|
42689 |
-
}].filter(function (obj) {
|
42690 |
-
return window.buttonizer_admin.is_stand_alone ? typeof obj.standalone === "undefined" : true;
|
42691 |
-
}).map(function (obj) {
|
42692 |
-
return ButtonActionOptions_objectSpread(ButtonActionOptions_objectSpread({}, obj), {}, {
|
42693 |
-
group: "popular"
|
42694 |
-
});
|
42695 |
-
});
|
42696 |
-
var chat = [{
|
42697 |
-
value: "sms",
|
42698 |
-
label: translate("settings.button_action.actions.chat.sms")
|
42699 |
-
}, {
|
42700 |
-
value: "messenger_chat",
|
42701 |
-
label: translate("settings.button_action.actions.chat.messenger_chat")
|
42702 |
-
}, {
|
42703 |
-
value: "messenger",
|
42704 |
-
label: translate("settings.button_action.actions.chat.messenger_link")
|
42705 |
-
}, {
|
42706 |
-
value: "twitter_dm",
|
42707 |
-
label: translate("settings.button_action.actions.chat.twitter_dm")
|
42708 |
-
}, {
|
42709 |
-
value: "skype",
|
42710 |
-
label: translate("settings.button_action.actions.chat.skype")
|
42711 |
-
}, {
|
42712 |
-
value: "line",
|
42713 |
-
label: translate("settings.button_action.actions.chat.line")
|
42714 |
-
}, {
|
42715 |
-
value: "telegram",
|
42716 |
-
label: translate("settings.button_action.actions.chat.telegram")
|
42717 |
-
}, {
|
42718 |
-
value: "viber",
|
42719 |
-
label: translate("settings.button_action.actions.chat.viber")
|
42720 |
-
}, {
|
42721 |
-
value: "signal_group",
|
42722 |
-
label: translate("settings.button_action.actions.chat.signal_group")
|
42723 |
-
}].map(function (obj) {
|
42724 |
-
return ButtonActionOptions_objectSpread(ButtonActionOptions_objectSpread({}, obj), {}, {
|
42725 |
-
group: "chat"
|
42726 |
-
});
|
42727 |
-
});
|
42728 |
-
var socialMedia = [{
|
42729 |
-
value: "facebook",
|
42730 |
-
label: translate("settings.button_action.actions.social_media.facebook")
|
42731 |
-
}, {
|
42732 |
-
value: "twitter",
|
42733 |
-
label: translate("settings.button_action.actions.social_media.twitter")
|
42734 |
-
}, {
|
42735 |
-
value: "instagram",
|
42736 |
-
label: translate("settings.button_action.actions.social_media.instagram")
|
42737 |
-
}, {
|
42738 |
-
value: "snapchat",
|
42739 |
-
label: translate("settings.button_action.actions.social_media.snapchat")
|
42740 |
-
}, {
|
42741 |
-
value: "linkedin",
|
42742 |
-
label: translate("settings.button_action.actions.social_media.linkedin")
|
42743 |
-
}, {
|
42744 |
-
value: "vk",
|
42745 |
-
label: translate("settings.button_action.actions.social_media.vk")
|
42746 |
-
}, {
|
42747 |
-
value: "waze",
|
42748 |
-
label: translate("settings.button_action.actions.social_media.waze")
|
42749 |
-
}].map(function (obj) {
|
42750 |
-
return ButtonActionOptions_objectSpread(ButtonActionOptions_objectSpread({}, obj), {}, {
|
42751 |
-
group: "social_media"
|
42752 |
-
});
|
42753 |
-
});
|
42754 |
-
var popup = [{
|
42755 |
-
value: "poptin",
|
42756 |
-
label: "Poptin"
|
42757 |
-
}, {
|
42758 |
-
value: "elementor_popup",
|
42759 |
-
label: "Elementor Popup"
|
42760 |
-
}, {
|
42761 |
-
value: "popup_maker",
|
42762 |
-
label: "Popup Maker"
|
42763 |
-
}, {
|
42764 |
-
value: "popups",
|
42765 |
-
label: "Popups - WordPress Popup"
|
42766 |
-
}, {
|
42767 |
-
value: "wppopups",
|
42768 |
-
label: "WP Popups - WordPress Popup builder"
|
42769 |
-
}].map(function (obj) {
|
42770 |
-
return ButtonActionOptions_objectSpread(ButtonActionOptions_objectSpread({}, obj), {}, {
|
42771 |
-
group: "popup"
|
42772 |
-
});
|
42773 |
-
});
|
42774 |
-
var other = [{
|
42775 |
-
value: "clipboard",
|
42776 |
-
label: translate("settings.button_action.actions.clipboard")
|
42777 |
-
}, {
|
42778 |
-
value: "print",
|
42779 |
-
label: translate("settings.button_action.actions.print_page")
|
42780 |
-
}].map(function (obj) {
|
42781 |
-
return ButtonActionOptions_objectSpread(ButtonActionOptions_objectSpread({}, obj), {}, {
|
42782 |
-
group: "actions"
|
42783 |
});
|
42784 |
-
|
42785 |
-
|
42786 |
-
|
42787 |
-
|
42788 |
-
*
|
42789 |
-
*
|
42790 |
-
* @
|
42791 |
-
*
|
42792 |
-
*
|
42793 |
-
*
|
42794 |
-
*
|
42795 |
-
*
|
42796 |
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
42797 |
-
* copies of the Software, and to permit persons to whom the Software is
|
42798 |
-
* furnished to do so, subject to the following conditions:
|
42799 |
-
*
|
42800 |
-
* The above copyright notice and this permission notice shall be included in all
|
42801 |
-
* copies or substantial portions of the Software.
|
42802 |
-
*
|
42803 |
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
42804 |
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
42805 |
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
42806 |
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
42807 |
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
42808 |
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
42809 |
-
* SOFTWARE.
|
42810 |
*/
|
42811 |
-
|
|
|
42812 |
|
42813 |
-
|
42814 |
-
|
42815 |
-
|
42816 |
-
|
42817 |
-
return 1;
|
42818 |
}
|
42819 |
-
|
42820 |
-
|
42821 |
-
|
|
|
|
|
|
|
|
|
42822 |
|
42823 |
-
|
42824 |
-
var called = false;
|
42825 |
-
return function () {
|
42826 |
-
if (called) {
|
42827 |
-
return;
|
42828 |
}
|
42829 |
-
|
42830 |
-
|
42831 |
-
|
42832 |
-
fn();
|
42833 |
-
});
|
42834 |
-
};
|
42835 |
}
|
42836 |
|
42837 |
-
|
42838 |
-
|
42839 |
-
|
42840 |
-
|
42841 |
-
|
42842 |
-
|
42843 |
-
|
42844 |
-
|
42845 |
-
|
42846 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42847 |
};
|
42848 |
-
}
|
42849 |
|
42850 |
-
|
|
|
42851 |
|
42852 |
-
|
42853 |
-
|
42854 |
-
|
42855 |
-
|
42856 |
-
|
42857 |
-
|
42858 |
-
|
42859 |
-
|
42860 |
-
|
42861 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42862 |
|
42863 |
/**
|
42864 |
-
*
|
42865 |
* @method
|
42866 |
* @memberof Popper.Utils
|
42867 |
-
* @
|
42868 |
-
* @returns {Boolean} answer to: is a function?
|
42869 |
*/
|
42870 |
-
function
|
42871 |
-
|
42872 |
-
|
|
|
|
|
|
|
42873 |
}
|
42874 |
|
42875 |
/**
|
42876 |
-
* Get
|
42877 |
* @method
|
42878 |
* @memberof Popper.Utils
|
42879 |
-
* @argument {
|
42880 |
-
* @
|
42881 |
*/
|
42882 |
-
function
|
42883 |
-
|
42884 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42885 |
}
|
42886 |
-
|
42887 |
-
var window = element.ownerDocument.defaultView;
|
42888 |
-
var css = window.getComputedStyle(element, null);
|
42889 |
-
return property ? css[property] : css;
|
42890 |
}
|
42891 |
|
42892 |
/**
|
42893 |
-
*
|
42894 |
* @method
|
42895 |
-
* @memberof Popper
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42896 |
* @argument {Element} element
|
42897 |
-
* @returns {
|
42898 |
*/
|
42899 |
-
function
|
42900 |
-
|
42901 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42902 |
}
|
42903 |
-
|
42904 |
}
|
42905 |
|
42906 |
/**
|
42907 |
-
*
|
42908 |
* @method
|
42909 |
* @memberof Popper.Utils
|
42910 |
-
* @
|
42911 |
-
* @returns {Element} scroll parent
|
42912 |
*/
|
42913 |
-
function
|
42914 |
-
//
|
42915 |
-
|
42916 |
-
|
42917 |
-
}
|
42918 |
|
42919 |
-
|
42920 |
-
|
42921 |
-
|
42922 |
-
|
42923 |
-
|
42924 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42925 |
}
|
|
|
42926 |
|
42927 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42928 |
|
42929 |
-
|
42930 |
-
|
42931 |
-
|
42932 |
-
|
42933 |
|
42934 |
-
|
42935 |
-
|
42936 |
-
|
|
|
|
|
|
|
|
|
42937 |
|
42938 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42939 |
}
|
42940 |
|
42941 |
/**
|
42942 |
-
*
|
42943 |
* @method
|
42944 |
* @memberof Popper.Utils
|
42945 |
-
* @param {
|
42946 |
-
* @
|
42947 |
*/
|
42948 |
-
function
|
42949 |
-
return
|
42950 |
}
|
42951 |
|
42952 |
-
var isIE11 = popper_isBrowser && !!(window.MSInputMethodContext && document.documentMode);
|
42953 |
-
var isIE10 = popper_isBrowser && /MSIE 10/.test(navigator.userAgent);
|
42954 |
-
|
42955 |
/**
|
42956 |
-
*
|
42957 |
* @method
|
42958 |
* @memberof Popper.Utils
|
42959 |
-
* @
|
42960 |
-
* @
|
|
|
42961 |
*/
|
42962 |
-
function
|
42963 |
-
|
42964 |
-
|
42965 |
-
|
42966 |
-
|
42967 |
-
|
42968 |
-
|
42969 |
-
|
|
|
42970 |
}
|
42971 |
|
42972 |
/**
|
42973 |
-
*
|
42974 |
* @method
|
42975 |
* @memberof Popper.Utils
|
42976 |
-
* @argument {Element} element
|
42977 |
-
* @
|
|
|
42978 |
*/
|
42979 |
-
function
|
42980 |
-
|
42981 |
-
|
42982 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
42983 |
|
42984 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42985 |
|
42986 |
-
//
|
42987 |
-
|
42988 |
-
|
42989 |
-
|
42990 |
-
|
|
|
|
|
42991 |
}
|
42992 |
|
42993 |
-
|
|
|
42994 |
|
42995 |
-
|
42996 |
-
|
42997 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42998 |
|
42999 |
-
//
|
43000 |
-
//
|
43001 |
-
|
43002 |
-
|
43003 |
-
}
|
43004 |
|
43005 |
-
|
43006 |
-
}
|
43007 |
|
43008 |
-
|
43009 |
-
|
|
|
43010 |
|
43011 |
-
|
43012 |
-
return false;
|
43013 |
-
}
|
43014 |
-
return nodeName === 'HTML' || popper_getOffsetParent(element.firstElementChild) === element;
|
43015 |
}
|
43016 |
|
43017 |
/**
|
43018 |
-
*
|
43019 |
-
* @method
|
43020 |
* @memberof Popper.Utils
|
43021 |
-
* @argument {
|
43022 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43023 |
*/
|
43024 |
-
function
|
43025 |
-
|
43026 |
-
|
43027 |
-
|
|
|
|
|
43028 |
|
43029 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43030 |
}
|
43031 |
|
|
|
|
|
43032 |
/**
|
43033 |
-
*
|
43034 |
-
* @
|
43035 |
-
* @
|
43036 |
-
* @argument {
|
43037 |
-
* @
|
43038 |
-
* @returns {Element} common offset parent
|
43039 |
*/
|
43040 |
-
function
|
43041 |
-
|
43042 |
-
|
43043 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43044 |
}
|
|
|
43045 |
|
43046 |
-
|
43047 |
-
var
|
43048 |
-
var start = order ? element1 : element2;
|
43049 |
-
var end = order ? element2 : element1;
|
43050 |
|
43051 |
-
//
|
43052 |
-
var
|
43053 |
-
|
43054 |
-
|
43055 |
-
var commonAncestorContainer = range.commonAncestorContainer;
|
43056 |
|
43057 |
-
|
43058 |
|
43059 |
-
|
43060 |
-
|
43061 |
-
return commonAncestorContainer;
|
43062 |
-
}
|
43063 |
|
43064 |
-
|
43065 |
-
|
|
|
|
|
43066 |
|
43067 |
-
//
|
43068 |
-
|
43069 |
-
|
43070 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43071 |
} else {
|
43072 |
-
|
43073 |
}
|
43074 |
-
|
43075 |
-
|
43076 |
-
|
43077 |
-
|
43078 |
-
|
43079 |
-
|
43080 |
-
|
43081 |
-
|
43082 |
-
|
43083 |
-
|
43084 |
-
|
43085 |
-
|
43086 |
-
|
43087 |
-
|
43088 |
-
|
43089 |
-
|
43090 |
-
|
43091 |
-
var
|
43092 |
-
|
43093 |
-
|
|
|
43094 |
}
|
43095 |
|
43096 |
-
|
43097 |
-
|
|
|
|
|
43098 |
|
43099 |
-
|
43100 |
-
|
43101 |
-
|
43102 |
-
|
43103 |
-
* @param {Object} rect - Rect object you want to change
|
43104 |
-
* @param {HTMLElement} element - The element from the function reads the scroll values
|
43105 |
-
* @param {Boolean} subtract - set to true if you want to subtract the scroll values
|
43106 |
-
* @return {Object} rect - The modifier rect object
|
43107 |
-
*/
|
43108 |
-
function includeScroll(rect, element) {
|
43109 |
-
var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
43110 |
|
43111 |
-
|
43112 |
-
var scrollLeft = popper_getScroll(element, 'left');
|
43113 |
-
var modifier = subtract ? -1 : 1;
|
43114 |
-
rect.top += scrollTop * modifier;
|
43115 |
-
rect.bottom += scrollTop * modifier;
|
43116 |
-
rect.left += scrollLeft * modifier;
|
43117 |
-
rect.right += scrollLeft * modifier;
|
43118 |
-
return rect;
|
43119 |
}
|
43120 |
|
43121 |
-
|
43122 |
-
* Helper to
|
|
|
43123 |
* @method
|
43124 |
* @memberof Popper.Utils
|
43125 |
-
* @param {
|
43126 |
-
*
|
43127 |
-
* @param {String}
|
43128 |
-
* @
|
43129 |
*/
|
|
|
|
|
|
|
|
|
|
|
43130 |
|
43131 |
-
function
|
43132 |
-
|
43133 |
-
|
43134 |
|
43135 |
-
|
|
|
|
|
|
|
|
|
|
|
43136 |
}
|
43137 |
|
43138 |
-
|
43139 |
-
|
43140 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
43141 |
|
43142 |
-
|
43143 |
-
|
43144 |
-
|
43145 |
-
|
43146 |
|
43147 |
-
|
43148 |
-
height: popper_getSize('Height', body, html, computedStyle),
|
43149 |
-
width: popper_getSize('Width', body, html, computedStyle)
|
43150 |
-
};
|
43151 |
-
}
|
43152 |
|
43153 |
-
|
43154 |
-
if (
|
43155 |
-
|
43156 |
-
}
|
43157 |
-
};
|
43158 |
|
43159 |
-
|
43160 |
-
|
43161 |
-
|
43162 |
-
|
43163 |
-
|
43164 |
-
|
43165 |
-
|
43166 |
-
|
|
|
|
|
43167 |
}
|
43168 |
}
|
43169 |
|
43170 |
-
|
43171 |
-
|
43172 |
-
|
43173 |
-
|
43174 |
-
};
|
43175 |
-
}();
|
43176 |
-
|
43177 |
|
|
|
43178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
43179 |
|
|
|
|
|
|
|
|
|
43180 |
|
43181 |
-
|
43182 |
-
if (
|
43183 |
-
|
43184 |
-
value: value,
|
43185 |
-
enumerable: true,
|
43186 |
-
configurable: true,
|
43187 |
-
writable: true
|
43188 |
-
});
|
43189 |
-
} else {
|
43190 |
-
obj[key] = value;
|
43191 |
}
|
|
|
|
|
|
|
|
|
|
|
43192 |
|
43193 |
-
|
43194 |
-
|
43195 |
|
43196 |
-
|
43197 |
-
|
43198 |
-
|
|
|
|
|
|
|
43199 |
|
43200 |
-
|
43201 |
-
|
43202 |
-
|
43203 |
-
|
43204 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43205 |
}
|
|
|
|
|
43206 |
|
43207 |
-
|
43208 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43209 |
|
43210 |
/**
|
43211 |
-
* Given
|
|
|
|
|
43212 |
* @method
|
43213 |
* @memberof Popper.Utils
|
43214 |
-
* @argument {
|
43215 |
-
* @
|
|
|
43216 |
*/
|
43217 |
-
function
|
43218 |
-
|
43219 |
-
|
43220 |
-
|
43221 |
-
|
|
|
43222 |
}
|
43223 |
|
|
|
|
|
|
|
|
|
|
|
|
|
43224 |
/**
|
43225 |
-
*
|
43226 |
-
* @
|
43227 |
-
* @
|
43228 |
-
* @
|
43229 |
-
* @
|
43230 |
*/
|
43231 |
-
function
|
43232 |
-
|
43233 |
-
|
43234 |
-
|
43235 |
-
|
43236 |
-
// This isn't reproducible in IE10 compatibility mode of IE11
|
43237 |
-
try {
|
43238 |
-
if (popper_isIE(10)) {
|
43239 |
-
rect = element.getBoundingClientRect();
|
43240 |
-
var scrollTop = popper_getScroll(element, 'top');
|
43241 |
-
var scrollLeft = popper_getScroll(element, 'left');
|
43242 |
-
rect.top += scrollTop;
|
43243 |
-
rect.left += scrollLeft;
|
43244 |
-
rect.bottom += scrollTop;
|
43245 |
-
rect.right += scrollLeft;
|
43246 |
-
} else {
|
43247 |
-
rect = element.getBoundingClientRect();
|
43248 |
-
}
|
43249 |
-
} catch (e) {}
|
43250 |
|
43251 |
-
|
43252 |
-
|
43253 |
-
|
43254 |
-
|
43255 |
-
height: rect.bottom - rect.top
|
43256 |
-
};
|
43257 |
|
43258 |
-
|
43259 |
-
var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
|
43260 |
-
var width = sizes.width || element.clientWidth || result.width;
|
43261 |
-
var height = sizes.height || element.clientHeight || result.height;
|
43262 |
|
43263 |
-
var
|
43264 |
-
var
|
|
|
43265 |
|
43266 |
-
|
43267 |
-
// we make this check conditional for performance reasons
|
43268 |
-
if (horizScrollbar || vertScrollbar) {
|
43269 |
-
var styles = getStyleComputedProperty(element);
|
43270 |
-
horizScrollbar -= popper_getBordersSize(styles, 'x');
|
43271 |
-
vertScrollbar -= popper_getBordersSize(styles, 'y');
|
43272 |
|
43273 |
-
|
43274 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43275 |
}
|
43276 |
|
43277 |
-
|
43278 |
-
|
|
|
|
|
43279 |
|
43280 |
-
|
43281 |
-
|
43282 |
|
43283 |
-
|
43284 |
-
|
43285 |
-
var childrenRect = popper_getBoundingClientRect(children);
|
43286 |
-
var parentRect = popper_getBoundingClientRect(parent);
|
43287 |
-
var scrollParent = popper_getScrollParent(children);
|
43288 |
|
43289 |
-
|
43290 |
-
|
43291 |
-
|
43292 |
|
43293 |
-
|
43294 |
-
|
43295 |
-
|
43296 |
-
|
43297 |
-
}
|
43298 |
-
var offsets = getClientRect({
|
43299 |
-
top: childrenRect.top - parentRect.top - borderTopWidth,
|
43300 |
-
left: childrenRect.left - parentRect.left - borderLeftWidth,
|
43301 |
-
width: childrenRect.width,
|
43302 |
-
height: childrenRect.height
|
43303 |
-
});
|
43304 |
-
offsets.marginTop = 0;
|
43305 |
-
offsets.marginLeft = 0;
|
43306 |
|
43307 |
-
|
43308 |
-
// we do this only on HTML because it's the only element that behaves
|
43309 |
-
// differently when margins are applied to it. The margins are included in
|
43310 |
-
// the box of the documentElement, in the other cases not.
|
43311 |
-
if (!isIE10 && isHTML) {
|
43312 |
-
var marginTop = parseFloat(styles.marginTop);
|
43313 |
-
var marginLeft = parseFloat(styles.marginLeft);
|
43314 |
|
43315 |
-
|
43316 |
-
|
43317 |
-
offsets.left -= borderLeftWidth - marginLeft;
|
43318 |
-
offsets.right -= borderLeftWidth - marginLeft;
|
43319 |
|
43320 |
-
//
|
43321 |
-
|
43322 |
-
offsets.marginLeft = marginLeft;
|
43323 |
-
}
|
43324 |
|
43325 |
-
|
43326 |
-
|
43327 |
-
}
|
43328 |
|
43329 |
-
|
43330 |
-
}
|
43331 |
|
43332 |
-
|
43333 |
-
|
|
|
43334 |
|
43335 |
-
|
43336 |
-
|
43337 |
-
|
43338 |
-
var height = Math.max(html.clientHeight, window.innerHeight || 0);
|
43339 |
|
43340 |
-
|
43341 |
-
|
|
|
43342 |
|
43343 |
-
|
43344 |
-
top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
|
43345 |
-
left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
|
43346 |
-
width: width,
|
43347 |
-
height: height
|
43348 |
-
};
|
43349 |
|
43350 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43351 |
}
|
43352 |
|
43353 |
/**
|
43354 |
-
*
|
43355 |
-
* @
|
43356 |
-
* @
|
43357 |
-
* @argument {
|
43358 |
-
* @
|
43359 |
-
* @returns {Boolean} answer to "isFixed?"
|
43360 |
*/
|
43361 |
-
function
|
43362 |
-
var
|
43363 |
-
|
43364 |
-
|
43365 |
-
|
43366 |
-
|
43367 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43368 |
}
|
43369 |
-
|
43370 |
-
|
43371 |
-
return false;
|
43372 |
}
|
43373 |
-
|
|
|
43374 |
}
|
43375 |
|
43376 |
/**
|
43377 |
-
*
|
43378 |
-
* @
|
43379 |
-
* @memberof
|
43380 |
-
* @
|
43381 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
43382 |
*/
|
|
|
|
|
|
|
|
|
|
|
43383 |
|
43384 |
-
|
43385 |
-
|
43386 |
-
|
43387 |
-
return document.documentElement;
|
43388 |
}
|
43389 |
-
|
43390 |
-
|
43391 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43392 |
}
|
43393 |
-
return el || document.documentElement;
|
43394 |
}
|
43395 |
|
43396 |
/**
|
43397 |
-
*
|
43398 |
-
* @
|
43399 |
-
* @memberof
|
43400 |
-
* @
|
43401 |
-
* @
|
43402 |
-
* @
|
43403 |
-
* @
|
43404 |
-
* @
|
43405 |
-
* @returns {
|
43406 |
*/
|
43407 |
-
function
|
43408 |
-
var
|
43409 |
-
|
43410 |
-
// NOTE: 1 DOM access here
|
43411 |
-
|
43412 |
-
var boundaries = { top: 0, left: 0 };
|
43413 |
-
var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
|
43414 |
|
43415 |
-
//
|
43416 |
-
|
43417 |
-
|
43418 |
-
|
43419 |
-
// Handle other cases based on DOM element used as boundaries
|
43420 |
-
var boundariesNode = void 0;
|
43421 |
-
if (boundariesElement === 'scrollParent') {
|
43422 |
-
boundariesNode = popper_getScrollParent(popper_getParentNode(reference));
|
43423 |
-
if (boundariesNode.nodeName === 'BODY') {
|
43424 |
-
boundariesNode = popper.ownerDocument.documentElement;
|
43425 |
-
}
|
43426 |
-
} else if (boundariesElement === 'window') {
|
43427 |
-
boundariesNode = popper.ownerDocument.documentElement;
|
43428 |
-
} else {
|
43429 |
-
boundariesNode = boundariesElement;
|
43430 |
-
}
|
43431 |
|
43432 |
-
|
|
|
|
|
|
|
|
|
43433 |
|
43434 |
-
|
43435 |
-
|
43436 |
-
|
43437 |
-
|
43438 |
-
|
43439 |
|
43440 |
-
|
43441 |
-
|
43442 |
-
boundaries.left += offsets.left - offsets.marginLeft;
|
43443 |
-
boundaries.right = width + offsets.left;
|
43444 |
-
} else {
|
43445 |
-
// for all the other DOM elements, this one is good
|
43446 |
-
boundaries = offsets;
|
43447 |
-
}
|
43448 |
}
|
43449 |
|
43450 |
-
//
|
43451 |
-
|
43452 |
-
var
|
43453 |
-
|
43454 |
-
boundaries.top += isPaddingNumber ? padding : padding.top || 0;
|
43455 |
-
boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
|
43456 |
-
boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
|
43457 |
-
|
43458 |
-
return boundaries;
|
43459 |
-
}
|
43460 |
|
43461 |
-
|
43462 |
-
|
43463 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43464 |
|
43465 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43466 |
}
|
43467 |
|
43468 |
/**
|
43469 |
-
*
|
43470 |
-
*
|
43471 |
-
* @method
|
43472 |
-
* @memberof Popper.Utils
|
43473 |
* @argument {Object} data - The data object generated by update method
|
43474 |
* @argument {Object} options - Modifiers configuration and options
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43475 |
* @returns {Object} The data object, properly modified
|
43476 |
*/
|
43477 |
-
function
|
43478 |
-
var
|
43479 |
|
43480 |
-
|
43481 |
-
|
|
|
|
|
|
|
43482 |
}
|
43483 |
|
43484 |
-
|
43485 |
-
|
43486 |
-
|
43487 |
-
|
43488 |
-
|
43489 |
-
|
43490 |
-
|
43491 |
-
|
43492 |
-
width: boundaries.right - refRect.right,
|
43493 |
-
height: boundaries.height
|
43494 |
-
},
|
43495 |
-
bottom: {
|
43496 |
-
width: boundaries.width,
|
43497 |
-
height: boundaries.bottom - refRect.bottom
|
43498 |
-
},
|
43499 |
-
left: {
|
43500 |
-
width: refRect.left - boundaries.left,
|
43501 |
-
height: boundaries.height
|
43502 |
-
}
|
43503 |
-
};
|
43504 |
-
|
43505 |
-
var sortedAreas = Object.keys(rects).map(function (key) {
|
43506 |
-
return popper_extends({
|
43507 |
-
key: key
|
43508 |
-
}, rects[key], {
|
43509 |
-
area: getArea(rects[key])
|
43510 |
-
});
|
43511 |
-
}).sort(function (a, b) {
|
43512 |
-
return b.area - a.area;
|
43513 |
-
});
|
43514 |
-
|
43515 |
-
var filteredAreas = sortedAreas.filter(function (_ref2) {
|
43516 |
-
var width = _ref2.width,
|
43517 |
-
height = _ref2.height;
|
43518 |
-
return width >= popper.clientWidth && height >= popper.clientHeight;
|
43519 |
-
});
|
43520 |
|
43521 |
-
|
|
|
|
|
43522 |
|
43523 |
-
var
|
43524 |
|
43525 |
-
|
43526 |
-
|
|
|
|
|
|
|
43527 |
|
43528 |
-
|
43529 |
-
* Get offsets to the reference element
|
43530 |
-
* @method
|
43531 |
-
* @memberof Popper.Utils
|
43532 |
-
* @param {Object} state
|
43533 |
-
* @param {Element} popper - the popper element
|
43534 |
-
* @param {Element} reference - the reference element (the popper will be relative to this)
|
43535 |
-
* @param {Element} fixedPosition - is in fixed position mode
|
43536 |
-
* @returns {Object} An object containing the offsets which will be applied to the popper
|
43537 |
-
*/
|
43538 |
-
function getReferenceOffsets(state, popper, reference) {
|
43539 |
-
var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
43540 |
|
43541 |
-
var
|
43542 |
-
|
43543 |
-
}
|
43544 |
|
43545 |
-
|
43546 |
-
|
43547 |
-
|
43548 |
-
|
43549 |
-
|
43550 |
-
|
43551 |
-
|
43552 |
-
|
43553 |
-
|
43554 |
-
|
43555 |
-
|
43556 |
-
|
43557 |
-
|
43558 |
-
|
43559 |
-
|
|
|
43560 |
};
|
43561 |
-
return result;
|
43562 |
-
}
|
43563 |
|
43564 |
-
|
43565 |
-
|
43566 |
-
|
43567 |
-
* @memberof Popper.Utils
|
43568 |
-
* @argument {String} placement
|
43569 |
-
* @returns {String} flipped placement
|
43570 |
-
*/
|
43571 |
-
function popper_getOppositePlacement(placement) {
|
43572 |
-
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
43573 |
-
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
43574 |
-
return hash[matched];
|
43575 |
});
|
|
|
|
|
|
|
|
|
43576 |
}
|
43577 |
|
43578 |
/**
|
43579 |
-
*
|
43580 |
-
* @
|
43581 |
-
* @
|
43582 |
-
* @
|
43583 |
-
* @
|
43584 |
-
* @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
|
43585 |
-
* @param {String} placement - one of the valid placement options
|
43586 |
-
* @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
|
43587 |
*/
|
43588 |
-
function
|
43589 |
-
placement = placement
|
|
|
|
|
43590 |
|
43591 |
-
//
|
43592 |
-
|
|
|
|
|
|
|
43593 |
|
43594 |
-
|
43595 |
-
|
43596 |
-
width:
|
43597 |
-
height: popperRect.height
|
43598 |
-
};
|
43599 |
|
43600 |
-
|
43601 |
-
|
43602 |
-
|
43603 |
-
|
43604 |
-
var measurement = isHoriz ? 'height' : 'width';
|
43605 |
-
var secondaryMeasurement = !isHoriz ? 'height' : 'width';
|
43606 |
|
43607 |
-
|
43608 |
-
if (placement === secondarySide) {
|
43609 |
-
popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
|
43610 |
-
} else {
|
43611 |
-
popperOffsets[secondarySide] = referenceOffsets[popper_getOppositePlacement(secondarySide)];
|
43612 |
}
|
43613 |
|
43614 |
-
return
|
43615 |
}
|
43616 |
|
43617 |
/**
|
43618 |
-
*
|
43619 |
-
* @
|
43620 |
-
* @
|
43621 |
-
* @argument {
|
43622 |
-
* @
|
43623 |
-
* @argument value
|
43624 |
-
* @returns index or -1
|
43625 |
*/
|
43626 |
-
function
|
43627 |
-
|
43628 |
-
|
43629 |
-
return arr.find(check);
|
43630 |
}
|
43631 |
|
43632 |
-
|
43633 |
-
|
43634 |
-
|
|
|
43635 |
|
43636 |
-
|
43637 |
-
|
43638 |
-
|
43639 |
-
|
43640 |
-
|
43641 |
-
|
43642 |
-
|
43643 |
-
|
43644 |
-
|
43645 |
-
|
43646 |
-
|
43647 |
-
|
43648 |
-
|
43649 |
-
|
43650 |
-
|
|
|
43651 |
}
|
43652 |
|
43653 |
-
|
43654 |
-
var match = popper_find(arr, function (obj) {
|
43655 |
-
return obj[prop] === value;
|
43656 |
-
});
|
43657 |
-
return arr.indexOf(match);
|
43658 |
}
|
43659 |
|
43660 |
/**
|
43661 |
-
*
|
43662 |
-
*
|
43663 |
-
* @method
|
43664 |
-
* @
|
43665 |
-
* @
|
43666 |
-
* @param {Array} modifiers
|
43667 |
-
* @param {String} ends - Optional modifier name used as stopper
|
43668 |
-
* @returns {dataObject}
|
43669 |
*/
|
43670 |
-
function
|
43671 |
-
var
|
|
|
|
|
|
|
|
|
43672 |
|
43673 |
-
|
43674 |
-
if (modifier['function']) {
|
43675 |
-
// eslint-disable-line dot-notation
|
43676 |
-
console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
|
43677 |
-
}
|
43678 |
-
var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
|
43679 |
-
if (modifier.enabled && isFunction(fn)) {
|
43680 |
-
// Add properties to offsets to make them a complete clientRect object
|
43681 |
-
// we do this before each modifier to make sure the previous one doesn't
|
43682 |
-
// mess with these values
|
43683 |
-
data.offsets.popper = getClientRect(data.offsets.popper);
|
43684 |
-
data.offsets.reference = getClientRect(data.offsets.reference);
|
43685 |
|
43686 |
-
|
43687 |
-
|
43688 |
-
|
|
|
|
|
|
|
43689 |
|
43690 |
return data;
|
43691 |
}
|
43692 |
|
43693 |
/**
|
43694 |
-
*
|
43695 |
-
*
|
43696 |
-
*
|
43697 |
-
*
|
43698 |
-
*
|
|
|
|
|
|
|
|
|
43699 |
*/
|
43700 |
-
function popper_update() {
|
43701 |
-
// if popper is destroyed, don't perform any further update
|
43702 |
-
if (this.state.isDestroyed) {
|
43703 |
-
return;
|
43704 |
-
}
|
43705 |
|
43706 |
-
|
43707 |
-
|
43708 |
-
|
43709 |
-
|
43710 |
-
|
43711 |
-
|
43712 |
-
|
43713 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43714 |
|
43715 |
-
|
43716 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43717 |
|
43718 |
-
|
43719 |
-
|
43720 |
-
|
43721 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43722 |
|
43723 |
-
|
43724 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43725 |
|
43726 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43727 |
|
43728 |
-
|
43729 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43730 |
|
43731 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43732 |
|
43733 |
-
|
43734 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43735 |
|
43736 |
-
|
43737 |
-
|
43738 |
-
|
43739 |
-
|
43740 |
-
|
43741 |
-
|
43742 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43743 |
}
|
43744 |
-
}
|
43745 |
-
|
43746 |
-
/**
|
43747 |
-
* Helper used to know if the given modifier is enabled.
|
43748 |
-
* @method
|
43749 |
-
* @memberof Popper.Utils
|
43750 |
-
* @returns {Boolean}
|
43751 |
-
*/
|
43752 |
-
function isModifierEnabled(modifiers, modifierName) {
|
43753 |
-
return modifiers.some(function (_ref) {
|
43754 |
-
var name = _ref.name,
|
43755 |
-
enabled = _ref.enabled;
|
43756 |
-
return enabled && name === modifierName;
|
43757 |
-
});
|
43758 |
-
}
|
43759 |
|
43760 |
/**
|
43761 |
-
*
|
43762 |
-
*
|
43763 |
-
* @
|
43764 |
-
* @
|
43765 |
-
* @
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43766 |
*/
|
43767 |
-
function getSupportedPropertyName(property) {
|
43768 |
-
var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
|
43769 |
-
var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
|
43770 |
-
|
43771 |
-
for (var i = 0; i < prefixes.length; i++) {
|
43772 |
-
var prefix = prefixes[i];
|
43773 |
-
var toCheck = prefix ? '' + prefix + upperProp : property;
|
43774 |
-
if (typeof document.body.style[toCheck] !== 'undefined') {
|
43775 |
-
return toCheck;
|
43776 |
-
}
|
43777 |
-
}
|
43778 |
-
return null;
|
43779 |
-
}
|
43780 |
|
43781 |
/**
|
43782 |
-
*
|
43783 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43784 |
* @memberof Popper
|
43785 |
*/
|
43786 |
-
|
43787 |
-
|
|
|
|
|
|
|
|
|
43788 |
|
43789 |
-
|
43790 |
-
|
43791 |
-
|
43792 |
-
|
43793 |
-
|
43794 |
-
this.popper.style.left = '';
|
43795 |
-
this.popper.style.right = '';
|
43796 |
-
this.popper.style.bottom = '';
|
43797 |
-
this.popper.style.willChange = '';
|
43798 |
-
this.popper.style[getSupportedPropertyName('transform')] = '';
|
43799 |
-
}
|
43800 |
|
43801 |
-
|
|
|
|
|
|
|
|
|
43802 |
|
43803 |
-
|
43804 |
-
|
43805 |
-
|
43806 |
-
|
43807 |
-
|
43808 |
-
|
43809 |
-
}
|
43810 |
|
43811 |
-
/**
|
43812 |
-
|
43813 |
-
|
43814 |
-
|
43815 |
-
|
43816 |
-
|
43817 |
-
|
43818 |
-
return ownerDocument ? ownerDocument.defaultView : window;
|
43819 |
-
}
|
43820 |
|
43821 |
-
|
43822 |
-
|
43823 |
-
|
43824 |
-
|
|
|
|
|
|
|
|
|
|
|
43825 |
|
43826 |
-
|
43827 |
-
|
43828 |
-
|
43829 |
-
|
43830 |
-
|
|
|
|
|
43831 |
|
43832 |
/**
|
43833 |
-
*
|
43834 |
-
* @
|
43835 |
-
* @memberof Popper.Utils
|
43836 |
-
* @private
|
43837 |
*/
|
43838 |
-
function setupEventListeners(reference, options, state, updateBound) {
|
43839 |
-
// Resize event listener on window
|
43840 |
-
state.updateBound = updateBound;
|
43841 |
-
popper_getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
|
43842 |
-
|
43843 |
-
// Scroll event listener on scroll parents
|
43844 |
-
var scrollElement = popper_getScrollParent(reference);
|
43845 |
-
attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
|
43846 |
-
state.scrollElement = scrollElement;
|
43847 |
-
state.eventsEnabled = true;
|
43848 |
-
|
43849 |
-
return state;
|
43850 |
-
}
|
43851 |
|
43852 |
/**
|
43853 |
-
*
|
43854 |
-
*
|
43855 |
-
* @method
|
43856 |
-
* @memberof Popper
|
43857 |
*/
|
43858 |
-
function enableEventListeners() {
|
43859 |
-
if (!this.state.eventsEnabled) {
|
43860 |
-
this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
|
43861 |
-
}
|
43862 |
-
}
|
43863 |
|
43864 |
-
|
43865 |
-
|
43866 |
-
|
43867 |
-
|
43868 |
-
|
43869 |
-
|
43870 |
-
|
43871 |
-
|
43872 |
-
|
|
|
|
|
|
|
|
|
43873 |
|
43874 |
-
|
43875 |
-
|
43876 |
-
target.removeEventListener('scroll', state.updateBound);
|
43877 |
-
});
|
43878 |
|
43879 |
-
|
43880 |
-
|
43881 |
-
|
43882 |
-
state.scrollElement = null;
|
43883 |
-
state.eventsEnabled = false;
|
43884 |
-
return state;
|
43885 |
-
}
|
43886 |
|
43887 |
-
|
43888 |
-
|
43889 |
-
* when they are triggered. It also won't trigger `onUpdate` callback anymore,
|
43890 |
-
* unless you call `update` method manually.
|
43891 |
-
* @method
|
43892 |
-
* @memberof Popper
|
43893 |
-
*/
|
43894 |
-
function disableEventListeners() {
|
43895 |
-
if (this.state.eventsEnabled) {
|
43896 |
-
cancelAnimationFrame(this.scheduleUpdate);
|
43897 |
-
this.state = removeEventListeners(this.reference, this.state);
|
43898 |
-
}
|
43899 |
-
}
|
43900 |
|
43901 |
-
|
43902 |
-
|
43903 |
-
* @method
|
43904 |
-
* @memberof Popper.Utils
|
43905 |
-
* @param {*} input to check
|
43906 |
-
* @return {Boolean}
|
43907 |
-
*/
|
43908 |
-
function isNumeric(n) {
|
43909 |
-
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
|
43910 |
-
}
|
43911 |
|
43912 |
-
|
43913 |
-
|
43914 |
-
|
43915 |
-
|
43916 |
-
|
43917 |
-
|
43918 |
-
* Object with a list of properties and values which will be applied to the element
|
43919 |
-
*/
|
43920 |
-
function setStyles(element, styles) {
|
43921 |
-
Object.keys(styles).forEach(function (prop) {
|
43922 |
-
var unit = '';
|
43923 |
-
// add unit if the value is numeric and is one of the following
|
43924 |
-
if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
|
43925 |
-
unit = 'px';
|
43926 |
-
}
|
43927 |
-
element.style[prop] = styles[prop] + unit;
|
43928 |
-
});
|
43929 |
-
}
|
43930 |
|
43931 |
-
|
43932 |
-
|
43933 |
-
|
43934 |
-
* @memberof Popper.Utils
|
43935 |
-
* @argument {Element} element - Element to apply the attributes to
|
43936 |
-
* @argument {Object} styles
|
43937 |
-
* Object with a list of properties and values which will be applied to the element
|
43938 |
-
*/
|
43939 |
-
function setAttributes(element, attributes) {
|
43940 |
-
Object.keys(attributes).forEach(function (prop) {
|
43941 |
-
var value = attributes[prop];
|
43942 |
-
if (value !== false) {
|
43943 |
-
element.setAttribute(prop, attributes[prop]);
|
43944 |
-
} else {
|
43945 |
-
element.removeAttribute(prop);
|
43946 |
-
}
|
43947 |
-
});
|
43948 |
-
}
|
43949 |
|
43950 |
-
|
43951 |
-
|
43952 |
-
|
43953 |
-
|
43954 |
-
|
43955 |
-
* @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
|
43956 |
-
* @argument {Object} options - Modifiers configuration and options
|
43957 |
-
* @returns {Object} The same data object
|
43958 |
-
*/
|
43959 |
-
function applyStyle(data) {
|
43960 |
-
// any property present in `data.styles` will be applied to the popper,
|
43961 |
-
// in this way we can make the 3rd party modifiers add custom styles to it
|
43962 |
-
// Be aware, modifiers could override the properties defined in the previous
|
43963 |
-
// lines of this modifier!
|
43964 |
-
setStyles(data.instance.popper, data.styles);
|
43965 |
|
43966 |
-
|
43967 |
-
|
43968 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43969 |
|
43970 |
-
|
43971 |
-
|
43972 |
-
|
43973 |
-
|
|
|
|
|
|
|
|
|
|
|
43974 |
|
43975 |
-
|
43976 |
-
|
43977 |
|
43978 |
-
|
43979 |
-
|
43980 |
-
|
43981 |
-
|
43982 |
-
|
43983 |
-
* @memberof Popper.modifiers
|
43984 |
-
* @param {HTMLElement} reference - The reference element used to position the popper
|
43985 |
-
* @param {HTMLElement} popper - The HTML element used as popper
|
43986 |
-
* @param {Object} options - Popper.js options
|
43987 |
-
*/
|
43988 |
-
function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
|
43989 |
-
// compute reference element offsets
|
43990 |
-
var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
|
43991 |
|
43992 |
-
|
43993 |
-
|
43994 |
-
// and refer to originalPlacement to know the original value
|
43995 |
-
var placement = popper_computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
|
43996 |
|
43997 |
-
|
|
|
43998 |
|
43999 |
-
// Apply `position` to popper before anything else because
|
44000 |
-
// without the position applied we can't guarantee correct computations
|
44001 |
-
setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
|
44002 |
|
44003 |
-
|
44004 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44005 |
|
44006 |
/**
|
44007 |
-
*
|
44008 |
-
*
|
44009 |
-
*
|
44010 |
-
*
|
44011 |
-
* @returns {Object} The popper's position offsets rounded
|
44012 |
-
*
|
44013 |
-
* The tale of pixel-perfect positioning. It's still not 100% perfect, but as
|
44014 |
-
* good as it can be within reason.
|
44015 |
-
* Discussion here: https://github.com/FezVrasta/popper.js/pull/715
|
44016 |
-
*
|
44017 |
-
* Low DPI screens cause a popper to be blurry if not using full pixels (Safari
|
44018 |
-
* as well on High DPI screens).
|
44019 |
*
|
44020 |
-
*
|
44021 |
-
*
|
|
|
44022 |
*
|
44023 |
-
*
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44024 |
*/
|
44025 |
-
function getRoundedOffsets(data, shouldRound) {
|
44026 |
-
var _data$offsets = data.offsets,
|
44027 |
-
popper = _data$offsets.popper,
|
44028 |
-
reference = _data$offsets.reference;
|
44029 |
-
var round = Math.round,
|
44030 |
-
floor = Math.floor;
|
44031 |
|
44032 |
-
var noRound = function noRound(v) {
|
44033 |
-
return v;
|
44034 |
-
};
|
44035 |
|
44036 |
-
|
44037 |
-
|
|
|
44038 |
|
44039 |
-
|
44040 |
-
|
44041 |
-
var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
|
44042 |
-
var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
|
44043 |
|
44044 |
-
|
44045 |
-
var verticalToInteger = !shouldRound ? noRound : round;
|
44046 |
|
44047 |
-
return {
|
44048 |
-
left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
|
44049 |
-
top: verticalToInteger(popper.top),
|
44050 |
-
bottom: verticalToInteger(popper.bottom),
|
44051 |
-
right: horizontalToInteger(popper.right)
|
44052 |
-
};
|
44053 |
-
}
|
44054 |
|
44055 |
-
var isFirefox = popper_isBrowser && /Firefox/i.test(navigator.userAgent);
|
44056 |
|
44057 |
-
/**
|
44058 |
-
* @function
|
44059 |
-
* @memberof Modifiers
|
44060 |
-
* @argument {Object} data - The data object generated by `update` method
|
44061 |
-
* @argument {Object} options - Modifiers configuration and options
|
44062 |
-
* @returns {Object} The data object, properly modified
|
44063 |
-
*/
|
44064 |
-
function computeStyle(data, options) {
|
44065 |
-
var x = options.x,
|
44066 |
-
y = options.y;
|
44067 |
-
var popper = data.offsets.popper;
|
44068 |
|
44069 |
-
// Remove this legacy support in Popper.js v2
|
44070 |
|
44071 |
-
var legacyGpuAccelerationOption = popper_find(data.instance.modifiers, function (modifier) {
|
44072 |
-
return modifier.name === 'applyStyle';
|
44073 |
-
}).gpuAcceleration;
|
44074 |
-
if (legacyGpuAccelerationOption !== undefined) {
|
44075 |
-
console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
|
44076 |
-
}
|
44077 |
-
var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
|
44078 |
|
44079 |
-
var offsetParent = popper_getOffsetParent(data.instance.popper);
|
44080 |
-
var offsetParentRect = popper_getBoundingClientRect(offsetParent);
|
44081 |
|
44082 |
-
// Styles
|
44083 |
-
var styles = {
|
44084 |
-
position: popper.position
|
44085 |
-
};
|
44086 |
|
44087 |
-
var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
|
44088 |
|
44089 |
-
var sideA = x === 'bottom' ? 'top' : 'bottom';
|
44090 |
-
var sideB = y === 'right' ? 'left' : 'right';
|
44091 |
|
44092 |
-
// if gpuAcceleration is set to `true` and transform is supported,
|
44093 |
-
// we use `translate3d` to apply the position to the popper we
|
44094 |
-
// automatically use the supported prefixed version if needed
|
44095 |
-
var prefixedProperty = getSupportedPropertyName('transform');
|
44096 |
|
44097 |
-
// now, let's make a step back and look at this code closely (wtf?)
|
44098 |
-
// If the content of the popper grows once it's been positioned, it
|
44099 |
-
// may happen that the popper gets misplaced because of the new content
|
44100 |
-
// overflowing its reference element
|
44101 |
-
// To avoid this problem, we provide two options (x and y), which allow
|
44102 |
-
// the consumer to define the offset origin.
|
44103 |
-
// If we position a popper on top of a reference element, we can set
|
44104 |
-
// `x` to `top` to make the popper grow towards its top instead of
|
44105 |
-
// its bottom.
|
44106 |
-
var left = void 0,
|
44107 |
-
top = void 0;
|
44108 |
-
if (sideA === 'bottom') {
|
44109 |
-
// when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
|
44110 |
-
// and not the bottom of the html element
|
44111 |
-
if (offsetParent.nodeName === 'HTML') {
|
44112 |
-
top = -offsetParent.clientHeight + offsets.bottom;
|
44113 |
-
} else {
|
44114 |
-
top = -offsetParentRect.height + offsets.bottom;
|
44115 |
-
}
|
44116 |
-
} else {
|
44117 |
-
top = offsets.top;
|
44118 |
-
}
|
44119 |
-
if (sideB === 'right') {
|
44120 |
-
if (offsetParent.nodeName === 'HTML') {
|
44121 |
-
left = -offsetParent.clientWidth + offsets.right;
|
44122 |
-
} else {
|
44123 |
-
left = -offsetParentRect.width + offsets.right;
|
44124 |
-
}
|
44125 |
-
} else {
|
44126 |
-
left = offsets.left;
|
44127 |
-
}
|
44128 |
-
if (gpuAcceleration && prefixedProperty) {
|
44129 |
-
styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
|
44130 |
-
styles[sideA] = 0;
|
44131 |
-
styles[sideB] = 0;
|
44132 |
-
styles.willChange = 'transform';
|
44133 |
-
} else {
|
44134 |
-
// othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
|
44135 |
-
var invertTop = sideA === 'bottom' ? -1 : 1;
|
44136 |
-
var invertLeft = sideB === 'right' ? -1 : 1;
|
44137 |
-
styles[sideA] = top * invertTop;
|
44138 |
-
styles[sideB] = left * invertLeft;
|
44139 |
-
styles.willChange = sideA + ', ' + sideB;
|
44140 |
-
}
|
44141 |
|
44142 |
-
|
44143 |
-
var
|
44144 |
-
'x-placement': data.placement
|
44145 |
-
};
|
44146 |
|
44147 |
-
|
44148 |
-
|
44149 |
-
|
44150 |
-
data.arrowStyles = popper_extends({}, data.offsets.arrow, data.arrowStyles);
|
44151 |
|
44152 |
-
|
44153 |
-
|
|
|
44154 |
|
44155 |
-
|
44156 |
-
|
44157 |
-
* It checks if the needed modifier is listed and enabled.
|
44158 |
-
* @method
|
44159 |
-
* @memberof Popper.Utils
|
44160 |
-
* @param {Array} modifiers - list of modifiers
|
44161 |
-
* @param {String} requestingName - name of requesting modifier
|
44162 |
-
* @param {String} requestedName - name of requested modifier
|
44163 |
-
* @returns {Boolean}
|
44164 |
-
*/
|
44165 |
-
function isModifierRequired(modifiers, requestingName, requestedName) {
|
44166 |
-
var requesting = popper_find(modifiers, function (_ref) {
|
44167 |
-
var name = _ref.name;
|
44168 |
-
return name === requestingName;
|
44169 |
-
});
|
44170 |
|
44171 |
-
|
44172 |
-
|
44173 |
-
});
|
44174 |
|
44175 |
-
|
44176 |
-
|
44177 |
-
|
44178 |
-
|
|
|
44179 |
}
|
44180 |
-
return isRequired;
|
44181 |
}
|
44182 |
|
|
|
|
|
|
|
|
|
|
|
|
|
44183 |
/**
|
44184 |
-
*
|
44185 |
-
* @memberof Modifiers
|
44186 |
-
* @argument {Object} data - The data object generated by update method
|
44187 |
-
* @argument {Object} options - Modifiers configuration and options
|
44188 |
-
* @returns {Object} The data object, properly modified
|
44189 |
*/
|
44190 |
-
function popper_arrow(data, options) {
|
44191 |
-
var _data$offsets$arrow;
|
44192 |
|
44193 |
-
|
44194 |
-
|
44195 |
-
|
44196 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44197 |
|
44198 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44199 |
|
44200 |
-
|
44201 |
-
|
44202 |
-
|
44203 |
|
44204 |
-
|
44205 |
-
|
44206 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44207 |
}
|
44208 |
-
}
|
44209 |
-
|
44210 |
-
|
44211 |
-
|
44212 |
-
console.warn('WARNING: `arrow.element` must be child of its popper element!');
|
44213 |
-
return data;
|
44214 |
}
|
44215 |
-
}
|
44216 |
|
44217 |
-
|
44218 |
-
|
44219 |
-
|
44220 |
-
|
44221 |
|
44222 |
-
|
|
|
|
|
44223 |
|
44224 |
-
|
44225 |
-
var sideCapitalized = isVertical ? 'Top' : 'Left';
|
44226 |
-
var side = sideCapitalized.toLowerCase();
|
44227 |
-
var altSide = isVertical ? 'left' : 'top';
|
44228 |
-
var opSide = isVertical ? 'bottom' : 'right';
|
44229 |
-
var arrowElementSize = getOuterSizes(arrowElement)[len];
|
44230 |
|
44231 |
-
|
44232 |
-
// extends keepTogether behavior making sure the popper and its
|
44233 |
-
// reference have enough pixels in conjunction
|
44234 |
-
//
|
44235 |
|
44236 |
-
|
44237 |
-
|
44238 |
-
|
44239 |
-
|
44240 |
-
|
44241 |
-
|
44242 |
-
|
44243 |
-
|
44244 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44245 |
|
44246 |
-
|
44247 |
-
|
|
|
44248 |
|
44249 |
-
|
44250 |
-
|
44251 |
-
|
44252 |
-
|
44253 |
-
var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
|
44254 |
-
var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
|
44255 |
|
44256 |
-
|
44257 |
-
|
|
|
44258 |
|
44259 |
-
|
44260 |
-
|
|
|
|
|
44261 |
|
44262 |
-
|
44263 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44264 |
|
44265 |
-
|
44266 |
-
|
44267 |
-
* @method
|
44268 |
-
* @memberof Popper.Utils
|
44269 |
-
* @argument {String} placement variation
|
44270 |
-
* @returns {String} flipped placement variation
|
44271 |
-
*/
|
44272 |
-
function getOppositeVariation(variation) {
|
44273 |
-
if (variation === 'end') {
|
44274 |
-
return 'start';
|
44275 |
-
} else if (variation === 'start') {
|
44276 |
-
return 'end';
|
44277 |
}
|
44278 |
-
return variation;
|
44279 |
-
}
|
44280 |
|
44281 |
-
|
44282 |
-
|
44283 |
-
|
44284 |
-
* - `auto`
|
44285 |
-
* - `top`
|
44286 |
-
* - `right`
|
44287 |
-
* - `bottom`
|
44288 |
-
* - `left`
|
44289 |
-
*
|
44290 |
-
* Each placement can have a variation from this list:
|
44291 |
-
* - `-start`
|
44292 |
-
* - `-end`
|
44293 |
-
*
|
44294 |
-
* Variations are interpreted easily if you think of them as the left to right
|
44295 |
-
* written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
|
44296 |
-
* is right.<br />
|
44297 |
-
* Vertically (`left` and `right`), `start` is top and `end` is bottom.
|
44298 |
-
*
|
44299 |
-
* Some valid examples are:
|
44300 |
-
* - `top-end` (on top of reference, right aligned)
|
44301 |
-
* - `right-start` (on right of reference, top aligned)
|
44302 |
-
* - `bottom` (on bottom, centered)
|
44303 |
-
* - `auto-end` (on the side with more space available, alignment depends by placement)
|
44304 |
-
*
|
44305 |
-
* @static
|
44306 |
-
* @type {Array}
|
44307 |
-
* @enum {String}
|
44308 |
-
* @readonly
|
44309 |
-
* @method placements
|
44310 |
-
* @memberof Popper
|
44311 |
-
*/
|
44312 |
-
var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
|
44313 |
|
44314 |
-
|
44315 |
-
|
|
|
|
|
|
|
|
|
|
|
44316 |
|
44317 |
-
|
44318 |
-
|
44319 |
-
|
44320 |
-
|
44321 |
-
|
44322 |
-
|
44323 |
-
|
44324 |
-
|
44325 |
-
|
44326 |
-
|
44327 |
-
|
44328 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44329 |
|
44330 |
-
var index = validPlacements.indexOf(placement);
|
44331 |
-
var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
|
44332 |
-
return counter ? arr.reverse() : arr;
|
44333 |
-
}
|
44334 |
|
44335 |
-
var BEHAVIORS = {
|
44336 |
-
FLIP: 'flip',
|
44337 |
-
CLOCKWISE: 'clockwise',
|
44338 |
-
COUNTERCLOCKWISE: 'counterclockwise'
|
44339 |
-
};
|
44340 |
|
44341 |
-
/**
|
44342 |
-
* @function
|
44343 |
-
* @memberof Modifiers
|
44344 |
-
* @argument {Object} data - The data object generated by update method
|
44345 |
-
* @argument {Object} options - Modifiers configuration and options
|
44346 |
-
* @returns {Object} The data object, properly modified
|
44347 |
-
*/
|
44348 |
-
function popper_flip(data, options) {
|
44349 |
-
// if `inner` modifier is enabled, we can't use the `flip` modifier
|
44350 |
-
if (isModifierEnabled(data.instance.modifiers, 'inner')) {
|
44351 |
-
return data;
|
44352 |
-
}
|
44353 |
|
44354 |
-
if (data.flipped && data.placement === data.originalPlacement) {
|
44355 |
-
// seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
|
44356 |
-
return data;
|
44357 |
-
}
|
44358 |
|
44359 |
-
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
|
44360 |
|
44361 |
-
var placement = data.placement.split('-')[0];
|
44362 |
-
var placementOpposite = popper_getOppositePlacement(placement);
|
44363 |
-
var variation = data.placement.split('-')[1] || '';
|
44364 |
|
44365 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44366 |
|
44367 |
-
|
44368 |
-
|
44369 |
-
|
44370 |
-
|
44371 |
-
case BEHAVIORS.CLOCKWISE:
|
44372 |
-
flipOrder = clockwise(placement);
|
44373 |
-
break;
|
44374 |
-
case BEHAVIORS.COUNTERCLOCKWISE:
|
44375 |
-
flipOrder = clockwise(placement, true);
|
44376 |
-
break;
|
44377 |
-
default:
|
44378 |
-
flipOrder = options.behavior;
|
44379 |
-
}
|
44380 |
|
44381 |
-
|
44382 |
-
|
44383 |
-
|
44384 |
-
}
|
44385 |
|
44386 |
-
|
44387 |
-
|
|
|
|
|
|
|
44388 |
|
44389 |
-
|
44390 |
-
|
|
|
|
|
44391 |
|
44392 |
-
|
44393 |
-
|
44394 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44395 |
|
44396 |
-
|
44397 |
-
|
44398 |
-
|
44399 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
44400 |
|
44401 |
-
var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
|
44402 |
|
44403 |
-
|
44404 |
-
|
|
|
44405 |
|
44406 |
-
|
44407 |
-
|
|
|
|
|
44408 |
|
44409 |
-
// flips variation if popper content overflows boundaries
|
44410 |
-
var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
|
44411 |
|
44412 |
-
|
|
|
|
|
44413 |
|
44414 |
-
|
44415 |
-
|
44416 |
-
|
|
|
|
|
|
|
44417 |
|
44418 |
-
if (overlapsRef || overflowsBoundaries) {
|
44419 |
-
placement = flipOrder[index + 1];
|
44420 |
-
}
|
44421 |
|
44422 |
-
if (flippedVariation) {
|
44423 |
-
variation = getOppositeVariation(variation);
|
44424 |
-
}
|
44425 |
|
44426 |
-
data.placement = placement + (variation ? '-' + variation : '');
|
44427 |
|
44428 |
-
|
44429 |
-
// any additional property we may add in the future
|
44430 |
-
data.offsets.popper = popper_extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
|
44431 |
|
44432 |
-
|
44433 |
-
|
44434 |
-
|
44435 |
-
|
|
|
44436 |
}
|
44437 |
|
44438 |
-
|
44439 |
-
|
44440 |
-
|
44441 |
-
|
44442 |
-
|
44443 |
-
|
44444 |
-
|
44445 |
-
|
44446 |
-
|
44447 |
-
|
44448 |
-
|
|
|
|
|
|
|
|
|
|
|
44449 |
|
44450 |
-
|
44451 |
-
|
44452 |
-
|
44453 |
-
var side = isVertical ? 'right' : 'bottom';
|
44454 |
-
var opSide = isVertical ? 'left' : 'top';
|
44455 |
-
var measurement = isVertical ? 'width' : 'height';
|
44456 |
|
44457 |
-
|
44458 |
-
|
44459 |
-
|
44460 |
-
if (popper[opSide] > floor(reference[side])) {
|
44461 |
-
data.offsets.popper[opSide] = floor(reference[side]);
|
44462 |
-
}
|
44463 |
|
44464 |
-
|
44465 |
-
|
44466 |
|
44467 |
-
|
44468 |
-
|
44469 |
-
|
44470 |
-
* @memberof {modifiers~offset}
|
44471 |
-
* @private
|
44472 |
-
* @argument {String} str - Value + unit string
|
44473 |
-
* @argument {String} measurement - `height` or `width`
|
44474 |
-
* @argument {Object} popperOffsets
|
44475 |
-
* @argument {Object} referenceOffsets
|
44476 |
-
* @returns {Number|String}
|
44477 |
-
* Value in pixels, or original string if no values were extracted
|
44478 |
-
*/
|
44479 |
-
function toValue(str, measurement, popperOffsets, referenceOffsets) {
|
44480 |
-
// separate value from unit
|
44481 |
-
var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
|
44482 |
-
var value = +split[1];
|
44483 |
-
var unit = split[2];
|
44484 |
|
44485 |
-
|
44486 |
-
|
44487 |
-
|
44488 |
-
}
|
44489 |
|
44490 |
-
|
44491 |
-
|
44492 |
-
|
44493 |
-
|
44494 |
-
|
44495 |
-
break;
|
44496 |
-
case '%':
|
44497 |
-
case '%r':
|
44498 |
-
default:
|
44499 |
-
element = referenceOffsets;
|
44500 |
-
}
|
44501 |
|
44502 |
-
|
44503 |
-
|
44504 |
-
|
44505 |
-
|
44506 |
-
var size = void 0;
|
44507 |
-
if (unit === 'vh') {
|
44508 |
-
size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
44509 |
-
} else {
|
44510 |
-
size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
|
44511 |
}
|
44512 |
-
return size / 100 * value;
|
44513 |
-
} else {
|
44514 |
-
// if is an explicit pixel unit, we get rid of the unit and keep the value
|
44515 |
-
// if is an implicit unit, it's px, and we return just the value
|
44516 |
-
return value;
|
44517 |
}
|
|
|
|
|
44518 |
}
|
44519 |
|
44520 |
-
|
44521 |
-
* Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
|
44522 |
-
* @function
|
44523 |
-
* @memberof {modifiers~offset}
|
44524 |
-
* @private
|
44525 |
-
* @argument {String} offset
|
44526 |
-
* @argument {Object} popperOffsets
|
44527 |
-
* @argument {Object} referenceOffsets
|
44528 |
-
* @argument {String} basePlacement
|
44529 |
-
* @returns {Array} a two cells array with x and y offsets in numbers
|
44530 |
-
*/
|
44531 |
-
function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
|
44532 |
-
var offsets = [0, 0];
|
44533 |
|
44534 |
-
|
44535 |
-
|
44536 |
-
|
44537 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44538 |
|
44539 |
-
|
44540 |
-
// The regex addresses values with the plus or minus sign in front (+10, -20, etc)
|
44541 |
-
var fragments = offset.split(/(\+|\-)/).map(function (frag) {
|
44542 |
-
return frag.trim();
|
44543 |
-
});
|
44544 |
|
44545 |
-
|
44546 |
-
|
44547 |
-
var
|
44548 |
-
|
44549 |
-
}));
|
44550 |
|
44551 |
-
|
44552 |
-
|
44553 |
-
|
44554 |
|
44555 |
-
|
44556 |
-
|
44557 |
-
|
44558 |
-
var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
|
44559 |
|
44560 |
-
|
44561 |
-
|
44562 |
-
// Most of the units rely on the orientation of the popper
|
44563 |
-
var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
|
44564 |
-
var mergeWithPrevious = false;
|
44565 |
-
return op
|
44566 |
-
// This aggregates any `+` or `-` sign that aren't considered operators
|
44567 |
-
// e.g.: 10 + +5 => [10, +, +5]
|
44568 |
-
.reduce(function (a, b) {
|
44569 |
-
if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
|
44570 |
-
a[a.length - 1] = b;
|
44571 |
-
mergeWithPrevious = true;
|
44572 |
-
return a;
|
44573 |
-
} else if (mergeWithPrevious) {
|
44574 |
-
a[a.length - 1] += b;
|
44575 |
-
mergeWithPrevious = false;
|
44576 |
-
return a;
|
44577 |
-
} else {
|
44578 |
-
return a.concat(b);
|
44579 |
-
}
|
44580 |
-
}, [])
|
44581 |
-
// Here we convert the string values into number values (in px)
|
44582 |
-
.map(function (str) {
|
44583 |
-
return toValue(str, measurement, popperOffsets, referenceOffsets);
|
44584 |
-
});
|
44585 |
-
});
|
44586 |
|
44587 |
-
|
44588 |
-
|
44589 |
-
|
44590 |
-
|
44591 |
-
|
44592 |
-
|
44593 |
-
|
44594 |
-
|
44595 |
-
return offsets;
|
44596 |
-
}
|
44597 |
|
44598 |
-
|
44599 |
-
|
44600 |
-
|
44601 |
-
|
44602 |
-
|
44603 |
-
|
44604 |
-
|
44605 |
-
|
44606 |
-
|
44607 |
-
function popper_offset(data, _ref) {
|
44608 |
-
var offset = _ref.offset;
|
44609 |
-
var placement = data.placement,
|
44610 |
-
_data$offsets = data.offsets,
|
44611 |
-
popper = _data$offsets.popper,
|
44612 |
-
reference = _data$offsets.reference;
|
44613 |
|
44614 |
-
var
|
|
|
|
|
44615 |
|
44616 |
-
var
|
44617 |
-
|
44618 |
-
offsets = [+offset, 0];
|
44619 |
-
} else {
|
44620 |
-
offsets = parseOffset(offset, popper, reference, basePlacement);
|
44621 |
-
}
|
44622 |
|
44623 |
-
|
44624 |
-
|
44625 |
-
|
44626 |
-
|
44627 |
-
|
44628 |
-
|
44629 |
-
|
44630 |
-
|
44631 |
-
popper.top -= offsets[1];
|
44632 |
-
} else if (basePlacement === 'bottom') {
|
44633 |
-
popper.left += offsets[0];
|
44634 |
-
popper.top += offsets[1];
|
44635 |
-
}
|
44636 |
|
44637 |
-
|
44638 |
-
|
44639 |
-
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44640 |
|
44641 |
-
|
44642 |
-
|
44643 |
-
|
44644 |
-
|
44645 |
-
|
44646 |
-
|
44647 |
-
|
44648 |
-
|
44649 |
-
|
44650 |
|
44651 |
-
|
44652 |
-
|
44653 |
-
|
44654 |
-
|
44655 |
-
|
44656 |
-
|
|
|
|
|
44657 |
|
44658 |
-
|
44659 |
-
//
|
44660 |
-
// the
|
44661 |
-
|
44662 |
-
|
44663 |
-
|
44664 |
-
|
44665 |
-
transform = popperStyles[transformProp];
|
44666 |
|
44667 |
-
|
44668 |
-
popperStyles.left = '';
|
44669 |
-
popperStyles[transformProp] = '';
|
44670 |
|
44671 |
-
var
|
|
|
|
|
|
|
|
|
|
|
|
|
44672 |
|
44673 |
-
|
44674 |
-
|
44675 |
-
|
44676 |
-
|
44677 |
-
|
|
|
44678 |
|
44679 |
-
|
|
|
|
|
|
|
44680 |
|
44681 |
-
|
44682 |
-
var popper = data.offsets.popper;
|
44683 |
|
44684 |
-
|
44685 |
-
|
44686 |
-
|
44687 |
-
|
44688 |
-
value = Math.max(popper[placement], boundaries[placement]);
|
44689 |
}
|
44690 |
-
|
44691 |
-
|
44692 |
-
|
44693 |
-
var
|
44694 |
-
|
44695 |
-
if (
|
44696 |
-
|
|
|
|
|
|
|
44697 |
}
|
44698 |
-
return popper_defineProperty({}, mainSide, value);
|
44699 |
}
|
44700 |
-
}
|
44701 |
-
|
44702 |
-
order.forEach(function (placement) {
|
44703 |
-
var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
|
44704 |
-
popper = popper_extends({}, popper, check[side](placement));
|
44705 |
-
});
|
44706 |
|
44707 |
-
|
|
|
|
|
|
|
|
|
|
|
44708 |
|
44709 |
-
|
44710 |
-
|
|
|
|
|
|
|
44711 |
|
44712 |
-
|
44713 |
-
|
44714 |
-
|
44715 |
-
* @argument {Object} data - The data object generated by `update` method
|
44716 |
-
* @argument {Object} options - Modifiers configuration and options
|
44717 |
-
* @returns {Object} The data object, properly modified
|
44718 |
-
*/
|
44719 |
-
function popper_shift(data) {
|
44720 |
-
var placement = data.placement;
|
44721 |
-
var basePlacement = placement.split('-')[0];
|
44722 |
-
var shiftvariation = placement.split('-')[1];
|
44723 |
|
44724 |
-
|
44725 |
-
|
44726 |
-
|
44727 |
-
reference = _data$offsets.reference,
|
44728 |
-
popper = _data$offsets.popper;
|
44729 |
|
44730 |
-
var
|
44731 |
-
var side = isVertical ? 'left' : 'top';
|
44732 |
-
var measurement = isVertical ? 'width' : 'height';
|
44733 |
|
44734 |
-
|
44735 |
-
|
44736 |
-
|
44737 |
-
};
|
44738 |
|
44739 |
-
|
44740 |
-
}
|
44741 |
|
44742 |
-
|
44743 |
-
|
|
|
44744 |
|
44745 |
-
|
44746 |
-
|
44747 |
-
|
44748 |
-
|
44749 |
-
* @argument {Object} options - Modifiers configuration and options
|
44750 |
-
* @returns {Object} The data object, properly modified
|
44751 |
-
*/
|
44752 |
-
function popper_hide(data) {
|
44753 |
-
if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
|
44754 |
-
return data;
|
44755 |
-
}
|
44756 |
|
44757 |
-
|
44758 |
-
var bound = popper_find(data.instance.modifiers, function (modifier) {
|
44759 |
-
return modifier.name === 'preventOverflow';
|
44760 |
-
}).boundaries;
|
44761 |
|
44762 |
-
|
44763 |
-
|
44764 |
-
if (data.hide === true) {
|
44765 |
-
return data;
|
44766 |
}
|
44767 |
|
44768 |
-
data
|
44769 |
-
|
44770 |
-
|
44771 |
-
//
|
44772 |
-
|
44773 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44774 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44775 |
|
44776 |
-
|
44777 |
-
|
44778 |
-
|
44779 |
|
44780 |
-
|
44781 |
-
|
44782 |
|
44783 |
-
|
44784 |
-
|
44785 |
-
|
44786 |
-
* @argument {Object} data - The data object generated by `update` method
|
44787 |
-
* @argument {Object} options - Modifiers configuration and options
|
44788 |
-
* @returns {Object} The data object, properly modified
|
44789 |
-
*/
|
44790 |
-
function inner(data) {
|
44791 |
-
var placement = data.placement;
|
44792 |
-
var basePlacement = placement.split('-')[0];
|
44793 |
-
var _data$offsets = data.offsets,
|
44794 |
-
popper = _data$offsets.popper,
|
44795 |
-
reference = _data$offsets.reference;
|
44796 |
|
44797 |
-
|
|
|
|
|
44798 |
|
44799 |
-
|
|
|
|
|
44800 |
|
44801 |
-
|
44802 |
|
44803 |
-
|
44804 |
-
|
|
|
|
|
44805 |
|
44806 |
-
|
44807 |
-
|
|
|
44808 |
|
44809 |
-
|
44810 |
-
|
44811 |
-
* to its `fn` property.<br />
|
44812 |
-
* These functions will be called on each update, this means that you must
|
44813 |
-
* make sure they are performant enough to avoid performance bottlenecks.
|
44814 |
-
*
|
44815 |
-
* @function ModifierFn
|
44816 |
-
* @argument {dataObject} data - The data object generated by `update` method
|
44817 |
-
* @argument {Object} options - Modifiers configuration and options
|
44818 |
-
* @returns {dataObject} The data object, properly modified
|
44819 |
-
*/
|
44820 |
|
44821 |
-
|
44822 |
-
|
44823 |
-
|
44824 |
-
|
44825 |
-
*
|
44826 |
-
* Usually you don't want to override the `order`, `fn` and `onLoad` props.
|
44827 |
-
* All the other properties are configurations that could be tweaked.
|
44828 |
-
* @namespace modifiers
|
44829 |
-
*/
|
44830 |
-
var modifiers = {
|
44831 |
-
/**
|
44832 |
-
* Modifier used to shift the popper on the start or end of its reference
|
44833 |
-
* element.<br />
|
44834 |
-
* It will read the variation of the `placement` property.<br />
|
44835 |
-
* It can be one either `-end` or `-start`.
|
44836 |
-
* @memberof modifiers
|
44837 |
-
* @inner
|
44838 |
-
*/
|
44839 |
-
shift: {
|
44840 |
-
/** @prop {number} order=100 - Index used to define the order of execution */
|
44841 |
-
order: 100,
|
44842 |
-
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
44843 |
-
enabled: true,
|
44844 |
-
/** @prop {ModifierFn} */
|
44845 |
-
fn: popper_shift
|
44846 |
-
},
|
44847 |
|
44848 |
-
|
44849 |
-
|
44850 |
-
|
44851 |
-
* It accepts the following units:
|
44852 |
-
* - `px` or unit-less, interpreted as pixels
|
44853 |
-
* - `%` or `%r`, percentage relative to the length of the reference element
|
44854 |
-
* - `%p`, percentage relative to the length of the popper element
|
44855 |
-
* - `vw`, CSS viewport width unit
|
44856 |
-
* - `vh`, CSS viewport height unit
|
44857 |
-
*
|
44858 |
-
* For length is intended the main axis relative to the placement of the popper.<br />
|
44859 |
-
* This means that if the placement is `top` or `bottom`, the length will be the
|
44860 |
-
* `width`. In case of `left` or `right`, it will be the `height`.
|
44861 |
-
*
|
44862 |
-
* You can provide a single value (as `Number` or `String`), or a pair of values
|
44863 |
-
* as `String` divided by a comma or one (or more) white spaces.<br />
|
44864 |
-
* The latter is a deprecated method because it leads to confusion and will be
|
44865 |
-
* removed in v2.<br />
|
44866 |
-
* Additionally, it accepts additions and subtractions between different units.
|
44867 |
-
* Note that multiplications and divisions aren't supported.
|
44868 |
-
*
|
44869 |
-
* Valid examples are:
|
44870 |
-
* ```
|
44871 |
-
* 10
|
44872 |
-
* '10%'
|
44873 |
-
* '10, 10'
|
44874 |
-
* '10%, 10'
|
44875 |
-
* '10 + 10%'
|
44876 |
-
* '10 - 5vh + 3%'
|
44877 |
-
* '-10px + 5vh, 5px - 6%'
|
44878 |
-
* ```
|
44879 |
-
* > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
|
44880 |
-
* > with their reference element, unfortunately, you will have to disable the `flip` modifier.
|
44881 |
-
* > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
|
44882 |
-
*
|
44883 |
-
* @memberof modifiers
|
44884 |
-
* @inner
|
44885 |
-
*/
|
44886 |
-
offset: {
|
44887 |
-
/** @prop {number} order=200 - Index used to define the order of execution */
|
44888 |
-
order: 200,
|
44889 |
-
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
44890 |
-
enabled: true,
|
44891 |
-
/** @prop {ModifierFn} */
|
44892 |
-
fn: popper_offset,
|
44893 |
-
/** @prop {Number|String} offset=0
|
44894 |
-
* The offset value as described in the modifier description
|
44895 |
-
*/
|
44896 |
-
offset: 0
|
44897 |
-
},
|
44898 |
|
44899 |
-
|
44900 |
-
|
44901 |
-
*
|
44902 |
-
* A scenario exists where the reference itself is not within the boundaries.<br />
|
44903 |
-
* We can say it has "escaped the boundaries" — or just "escaped".<br />
|
44904 |
-
* In this case we need to decide whether the popper should either:
|
44905 |
-
*
|
44906 |
-
* - detach from the reference and remain "trapped" in the boundaries, or
|
44907 |
-
* - if it should ignore the boundary and "escape with its reference"
|
44908 |
-
*
|
44909 |
-
* When `escapeWithReference` is set to`true` and reference is completely
|
44910 |
-
* outside its boundaries, the popper will overflow (or completely leave)
|
44911 |
-
* the boundaries in order to remain attached to the edge of the reference.
|
44912 |
-
*
|
44913 |
-
* @memberof modifiers
|
44914 |
-
* @inner
|
44915 |
-
*/
|
44916 |
-
preventOverflow: {
|
44917 |
-
/** @prop {number} order=300 - Index used to define the order of execution */
|
44918 |
-
order: 300,
|
44919 |
-
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
44920 |
-
enabled: true,
|
44921 |
-
/** @prop {ModifierFn} */
|
44922 |
-
fn: popper_preventOverflow,
|
44923 |
-
/**
|
44924 |
-
* @prop {Array} [priority=['left','right','top','bottom']]
|
44925 |
-
* Popper will try to prevent overflow following these priorities by default,
|
44926 |
-
* then, it could overflow on the left and on top of the `boundariesElement`
|
44927 |
-
*/
|
44928 |
-
priority: ['left', 'right', 'top', 'bottom'],
|
44929 |
-
/**
|
44930 |
-
* @prop {number} padding=5
|
44931 |
-
* Amount of pixel used to define a minimum distance between the boundaries
|
44932 |
-
* and the popper. This makes sure the popper always has a little padding
|
44933 |
-
* between the edges of its container
|
44934 |
-
*/
|
44935 |
-
padding: 5,
|
44936 |
-
/**
|
44937 |
-
* @prop {String|HTMLElement} boundariesElement='scrollParent'
|
44938 |
-
* Boundaries used by the modifier. Can be `scrollParent`, `window`,
|
44939 |
-
* `viewport` or any DOM element.
|
44940 |
-
*/
|
44941 |
-
boundariesElement: 'scrollParent'
|
44942 |
-
},
|
44943 |
|
44944 |
-
|
44945 |
-
|
44946 |
-
* without leaving any gap between the two. Especially useful when the arrow is
|
44947 |
-
* enabled and you want to ensure that it points to its reference element.
|
44948 |
-
* It cares only about the first axis. You can still have poppers with margin
|
44949 |
-
* between the popper and its reference element.
|
44950 |
-
* @memberof modifiers
|
44951 |
-
* @inner
|
44952 |
-
*/
|
44953 |
-
keepTogether: {
|
44954 |
-
/** @prop {number} order=400 - Index used to define the order of execution */
|
44955 |
-
order: 400,
|
44956 |
-
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
44957 |
-
enabled: true,
|
44958 |
-
/** @prop {ModifierFn} */
|
44959 |
-
fn: keepTogether
|
44960 |
-
},
|
44961 |
|
44962 |
-
|
44963 |
-
|
44964 |
-
|
44965 |
-
|
44966 |
-
|
44967 |
-
|
44968 |
-
* It has no effect if no `arrowElement` is provided.
|
44969 |
-
* @memberof modifiers
|
44970 |
-
* @inner
|
44971 |
-
*/
|
44972 |
-
arrow: {
|
44973 |
-
/** @prop {number} order=500 - Index used to define the order of execution */
|
44974 |
-
order: 500,
|
44975 |
-
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
44976 |
-
enabled: true,
|
44977 |
-
/** @prop {ModifierFn} */
|
44978 |
-
fn: popper_arrow,
|
44979 |
-
/** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
|
44980 |
-
element: '[x-arrow]'
|
44981 |
-
},
|
44982 |
|
44983 |
-
|
44984 |
-
|
44985 |
-
|
44986 |
-
|
44987 |
-
|
44988 |
-
|
44989 |
-
|
44990 |
-
* restart it if it detects the need to flip the placement.
|
44991 |
-
* @memberof modifiers
|
44992 |
-
* @inner
|
44993 |
-
*/
|
44994 |
-
flip: {
|
44995 |
-
/** @prop {number} order=600 - Index used to define the order of execution */
|
44996 |
-
order: 600,
|
44997 |
-
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
44998 |
-
enabled: true,
|
44999 |
-
/** @prop {ModifierFn} */
|
45000 |
-
fn: popper_flip,
|
45001 |
-
/**
|
45002 |
-
* @prop {String|Array} behavior='flip'
|
45003 |
-
* The behavior used to change the popper's placement. It can be one of
|
45004 |
-
* `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
|
45005 |
-
* placements (with optional variations)
|
45006 |
-
*/
|
45007 |
-
behavior: 'flip',
|
45008 |
-
/**
|
45009 |
-
* @prop {number} padding=5
|
45010 |
-
* The popper will flip if it hits the edges of the `boundariesElement`
|
45011 |
-
*/
|
45012 |
-
padding: 5,
|
45013 |
-
/**
|
45014 |
-
* @prop {String|HTMLElement} boundariesElement='viewport'
|
45015 |
-
* The element which will define the boundaries of the popper position.
|
45016 |
-
* The popper will never be placed outside of the defined boundaries
|
45017 |
-
* (except if `keepTogether` is enabled)
|
45018 |
-
*/
|
45019 |
-
boundariesElement: 'viewport',
|
45020 |
-
/**
|
45021 |
-
* @prop {Boolean} flipVariations=false
|
45022 |
-
* The popper will switch placement variation between `-start` and `-end` when
|
45023 |
-
* the reference element overlaps its boundaries.
|
45024 |
-
*
|
45025 |
-
* The original placement should have a set variation.
|
45026 |
-
*/
|
45027 |
-
flipVariations: false,
|
45028 |
-
/**
|
45029 |
-
* @prop {Boolean} flipVariationsByContent=false
|
45030 |
-
* The popper will switch placement variation between `-start` and `-end` when
|
45031 |
-
* the popper element overlaps its reference boundaries.
|
45032 |
-
*
|
45033 |
-
* The original placement should have a set variation.
|
45034 |
-
*/
|
45035 |
-
flipVariationsByContent: false
|
45036 |
-
},
|
45037 |
|
45038 |
-
|
45039 |
-
* Modifier used to make the popper flow toward the inner of the reference element.
|
45040 |
-
* By default, when this modifier is disabled, the popper will be placed outside
|
45041 |
-
* the reference element.
|
45042 |
-
* @memberof modifiers
|
45043 |
-
* @inner
|
45044 |
-
*/
|
45045 |
-
inner: {
|
45046 |
-
/** @prop {number} order=700 - Index used to define the order of execution */
|
45047 |
-
order: 700,
|
45048 |
-
/** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
|
45049 |
-
enabled: false,
|
45050 |
-
/** @prop {ModifierFn} */
|
45051 |
-
fn: inner
|
45052 |
-
},
|
45053 |
|
45054 |
-
|
45055 |
-
|
45056 |
-
|
45057 |
-
|
45058 |
-
|
45059 |
-
|
45060 |
-
|
45061 |
-
|
45062 |
-
|
45063 |
-
|
45064 |
-
hide: {
|
45065 |
-
/** @prop {number} order=800 - Index used to define the order of execution */
|
45066 |
-
order: 800,
|
45067 |
-
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
45068 |
-
enabled: true,
|
45069 |
-
/** @prop {ModifierFn} */
|
45070 |
-
fn: popper_hide
|
45071 |
-
},
|
45072 |
|
45073 |
-
|
45074 |
-
* Computes the style that will be applied to the popper element to gets
|
45075 |
-
* properly positioned.
|
45076 |
-
*
|
45077 |
-
* Note that this modifier will not touch the DOM, it just prepares the styles
|
45078 |
-
* so that `applyStyle` modifier can apply it. This separation is useful
|
45079 |
-
* in case you need to replace `applyStyle` with a custom implementation.
|
45080 |
-
*
|
45081 |
-
* This modifier has `850` as `order` value to maintain backward compatibility
|
45082 |
-
* with previous versions of Popper.js. Expect the modifiers ordering method
|
45083 |
-
* to change in future major versions of the library.
|
45084 |
-
*
|
45085 |
-
* @memberof modifiers
|
45086 |
-
* @inner
|
45087 |
-
*/
|
45088 |
-
computeStyle: {
|
45089 |
-
/** @prop {number} order=850 - Index used to define the order of execution */
|
45090 |
-
order: 850,
|
45091 |
-
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
45092 |
-
enabled: true,
|
45093 |
-
/** @prop {ModifierFn} */
|
45094 |
-
fn: computeStyle,
|
45095 |
-
/**
|
45096 |
-
* @prop {Boolean} gpuAcceleration=true
|
45097 |
-
* If true, it uses the CSS 3D transformation to position the popper.
|
45098 |
-
* Otherwise, it will use the `top` and `left` properties
|
45099 |
-
*/
|
45100 |
-
gpuAcceleration: true,
|
45101 |
-
/**
|
45102 |
-
* @prop {string} [x='bottom']
|
45103 |
-
* Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
|
45104 |
-
* Change this if your popper should grow in a direction different from `bottom`
|
45105 |
-
*/
|
45106 |
-
x: 'bottom',
|
45107 |
-
/**
|
45108 |
-
* @prop {string} [x='left']
|
45109 |
-
* Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
|
45110 |
-
* Change this if your popper should grow in a direction different from `right`
|
45111 |
-
*/
|
45112 |
-
y: 'right'
|
45113 |
-
},
|
45114 |
|
45115 |
-
|
45116 |
-
|
45117 |
-
|
45118 |
-
|
45119 |
-
|
45120 |
-
|
45121 |
-
*
|
45122 |
-
* Note that if you disable this modifier, you must make sure the popper element
|
45123 |
-
* has its position set to `absolute` before Popper.js can do its work!
|
45124 |
-
*
|
45125 |
-
* Just disable this modifier and define your own to achieve the desired effect.
|
45126 |
-
*
|
45127 |
-
* @memberof modifiers
|
45128 |
-
* @inner
|
45129 |
-
*/
|
45130 |
-
applyStyle: {
|
45131 |
-
/** @prop {number} order=900 - Index used to define the order of execution */
|
45132 |
-
order: 900,
|
45133 |
-
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
45134 |
-
enabled: true,
|
45135 |
-
/** @prop {ModifierFn} */
|
45136 |
-
fn: applyStyle,
|
45137 |
-
/** @prop {Function} */
|
45138 |
-
onLoad: applyStyleOnLoad,
|
45139 |
-
/**
|
45140 |
-
* @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
|
45141 |
-
* @prop {Boolean} gpuAcceleration=true
|
45142 |
-
* If true, it uses the CSS 3D transformation to position the popper.
|
45143 |
-
* Otherwise, it will use the `top` and `left` properties
|
45144 |
-
*/
|
45145 |
-
gpuAcceleration: undefined
|
45146 |
-
}
|
45147 |
-
};
|
45148 |
|
45149 |
-
|
45150 |
-
|
45151 |
-
|
45152 |
-
* @name dataObject
|
45153 |
-
* @property {Object} data.instance The Popper.js instance
|
45154 |
-
* @property {String} data.placement Placement applied to popper
|
45155 |
-
* @property {String} data.originalPlacement Placement originally defined on init
|
45156 |
-
* @property {Boolean} data.flipped True if popper has been flipped by flip modifier
|
45157 |
-
* @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
|
45158 |
-
* @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
|
45159 |
-
* @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
|
45160 |
-
* @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
|
45161 |
-
* @property {Object} data.boundaries Offsets of the popper boundaries
|
45162 |
-
* @property {Object} data.offsets The measurements of popper, reference and arrow elements
|
45163 |
-
* @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
|
45164 |
-
* @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
|
45165 |
-
* @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
|
45166 |
-
*/
|
45167 |
|
45168 |
-
/**
|
45169 |
-
* Default options provided to Popper.js constructor.<br />
|
45170 |
-
* These can be overridden using the `options` argument of Popper.js.<br />
|
45171 |
-
* To override an option, simply pass an object with the same
|
45172 |
-
* structure of the `options` object, as the 3rd argument. For example:
|
45173 |
-
* ```
|
45174 |
-
* new Popper(ref, pop, {
|
45175 |
-
* modifiers: {
|
45176 |
-
* preventOverflow: { enabled: false }
|
45177 |
-
* }
|
45178 |
-
* })
|
45179 |
-
* ```
|
45180 |
-
* @type {Object}
|
45181 |
-
* @static
|
45182 |
-
* @memberof Popper
|
45183 |
-
*/
|
45184 |
-
var Defaults = {
|
45185 |
-
/**
|
45186 |
-
* Popper's placement.
|
45187 |
-
* @prop {Popper.placements} placement='bottom'
|
45188 |
-
*/
|
45189 |
-
placement: 'bottom',
|
45190 |
|
45191 |
-
|
45192 |
-
|
45193 |
-
* @prop {Boolean} positionFixed=false
|
45194 |
-
*/
|
45195 |
-
positionFixed: false,
|
45196 |
|
45197 |
-
|
45198 |
-
|
45199 |
-
|
45200 |
-
|
45201 |
-
|
45202 |
|
45203 |
-
|
45204 |
-
|
45205 |
-
|
45206 |
-
* @prop {Boolean} removeOnDestroy=false
|
45207 |
-
*/
|
45208 |
-
removeOnDestroy: false,
|
45209 |
|
45210 |
-
|
45211 |
-
|
45212 |
-
|
45213 |
-
|
45214 |
-
|
45215 |
-
|
45216 |
-
|
|
|
|
|
45217 |
|
45218 |
-
|
45219 |
-
|
45220 |
-
* on the initialization/creation of the popper, but only on subsequent
|
45221 |
-
* updates.<br />
|
45222 |
-
* By default, it is set to no-op.<br />
|
45223 |
-
* Access Popper.js instance with `data.instance`.
|
45224 |
-
* @prop {onUpdate}
|
45225 |
-
*/
|
45226 |
-
onUpdate: function onUpdate() {},
|
45227 |
|
45228 |
-
/**
|
45229 |
-
* List of modifiers used to modify the offsets before they are applied to the popper.
|
45230 |
-
* They provide most of the functionalities of Popper.js.
|
45231 |
-
* @prop {modifiers}
|
45232 |
-
*/
|
45233 |
-
modifiers: modifiers
|
45234 |
-
};
|
45235 |
|
45236 |
-
|
45237 |
-
|
45238 |
-
|
45239 |
-
|
|
|
|
|
45240 |
|
45241 |
-
/**
|
45242 |
-
* @callback onUpdate
|
45243 |
-
* @param {dataObject} data
|
45244 |
-
*/
|
45245 |
|
45246 |
-
|
45247 |
-
|
45248 |
-
|
45249 |
-
|
45250 |
-
|
45251 |
-
|
45252 |
-
|
45253 |
-
|
45254 |
-
|
45255 |
-
|
45256 |
-
|
45257 |
-
function Popper(reference, popper) {
|
45258 |
-
var _this = this;
|
45259 |
|
45260 |
-
|
45261 |
-
|
|
|
45262 |
|
45263 |
-
|
45264 |
-
|
45265 |
-
|
|
|
|
|
45266 |
|
45267 |
-
|
45268 |
-
|
|
|
|
|
45269 |
|
45270 |
-
|
45271 |
-
this.options = popper_extends({}, Popper.Defaults, options);
|
45272 |
|
45273 |
-
|
45274 |
-
|
45275 |
-
|
45276 |
-
|
45277 |
-
scrollParents: []
|
45278 |
-
};
|
45279 |
|
45280 |
-
|
45281 |
-
|
45282 |
-
|
|
|
45283 |
|
45284 |
-
|
45285 |
-
this.options.modifiers = {};
|
45286 |
-
Object.keys(popper_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
|
45287 |
-
_this.options.modifiers[name] = popper_extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
|
45288 |
-
});
|
45289 |
|
45290 |
-
|
45291 |
-
|
45292 |
-
|
45293 |
-
|
45294 |
-
}, _this.options.modifiers[name]);
|
45295 |
-
})
|
45296 |
-
// sort the modifiers by order
|
45297 |
-
.sort(function (a, b) {
|
45298 |
-
return a.order - b.order;
|
45299 |
-
});
|
45300 |
|
45301 |
-
|
45302 |
-
|
45303 |
-
|
45304 |
-
|
45305 |
-
|
45306 |
-
|
45307 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45308 |
}
|
|
|
|
|
|
|
|
|
|
|
45309 |
});
|
45310 |
|
45311 |
-
|
45312 |
-
|
|
|
45313 |
|
45314 |
-
|
45315 |
-
|
45316 |
-
// setup event listeners, they will take care of update the position in specific situations
|
45317 |
-
this.enableEventListeners();
|
45318 |
}
|
|
|
45319 |
|
45320 |
-
|
45321 |
-
|
|
|
|
|
45322 |
|
45323 |
-
|
45324 |
-
// class prototype and break stuff like Sinon stubs
|
45325 |
|
|
|
|
|
|
|
|
|
|
|
45326 |
|
45327 |
-
|
45328 |
-
|
45329 |
-
|
45330 |
-
|
45331 |
-
|
45332 |
-
|
45333 |
-
|
45334 |
-
value: function destroy$$1() {
|
45335 |
-
return destroy.call(this);
|
45336 |
-
}
|
45337 |
-
}, {
|
45338 |
-
key: 'enableEventListeners',
|
45339 |
-
value: function enableEventListeners$$1() {
|
45340 |
-
return enableEventListeners.call(this);
|
45341 |
}
|
45342 |
-
}
|
45343 |
-
|
45344 |
-
|
45345 |
-
|
|
|
45346 |
}
|
45347 |
|
45348 |
-
|
45349 |
-
|
45350 |
-
* @method scheduleUpdate
|
45351 |
-
* @memberof Popper
|
45352 |
-
*/
|
45353 |
|
|
|
|
|
|
|
|
|
|
|
|
|
45354 |
|
45355 |
-
|
45356 |
-
|
45357 |
-
|
45358 |
-
* include `popper-utils.js` before `popper.js`.
|
45359 |
-
*
|
45360 |
-
* **DEPRECATION**: This way to access PopperUtils is deprecated
|
45361 |
-
* and will be removed in v2! Use the PopperUtils module directly instead.
|
45362 |
-
* Due to the high instability of the methods contained in Utils, we can't
|
45363 |
-
* guarantee them to follow semver. Use them at your own risk!
|
45364 |
-
* @static
|
45365 |
-
* @private
|
45366 |
-
* @type {Object}
|
45367 |
-
* @deprecated since version 1.8
|
45368 |
-
* @member Utils
|
45369 |
-
* @memberof Popper
|
45370 |
-
*/
|
45371 |
|
45372 |
-
|
45373 |
-
|
45374 |
-
}
|
|
|
45375 |
|
45376 |
-
|
45377 |
-
|
45378 |
-
|
45379 |
-
|
45380 |
-
* in case you don't have a DOM node to use as reference.
|
45381 |
-
*
|
45382 |
-
* ```
|
45383 |
-
* new Popper(referenceObject, popperNode);
|
45384 |
-
* ```
|
45385 |
-
*
|
45386 |
-
* NB: This feature isn't supported in Internet Explorer 10.
|
45387 |
-
* @name referenceObject
|
45388 |
-
* @property {Function} data.getBoundingClientRect
|
45389 |
-
* A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
|
45390 |
-
* @property {number} data.clientWidth
|
45391 |
-
* An ES6 getter that will return the width of the virtual reference element.
|
45392 |
-
* @property {number} data.clientHeight
|
45393 |
-
* An ES6 getter that will return the height of the virtual reference element.
|
45394 |
-
*/
|
45395 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45396 |
|
45397 |
-
|
45398 |
-
|
45399 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45400 |
|
45401 |
-
|
45402 |
-
//# sourceMappingURL=popper.js.map
|
45403 |
|
45404 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45405 |
|
|
|
45406 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45407 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45408 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45409 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45410 |
|
|
|
|
|
|
|
45411 |
|
|
|
|
|
|
|
45412 |
|
|
|
|
|
|
|
|
|
|
|
45413 |
|
|
|
|
|
|
|
45414 |
|
|
|
45415 |
|
|
|
|
|
|
|
45416 |
|
45417 |
-
|
45418 |
-
var direction = theme && theme.direction || 'ltr';
|
45419 |
|
45420 |
-
|
45421 |
-
|
45422 |
-
|
|
|
|
|
|
|
|
|
|
|
45423 |
|
45424 |
-
|
45425 |
-
|
45426 |
-
return 'bottom-start';
|
45427 |
|
45428 |
-
|
45429 |
-
return 'bottom-end';
|
45430 |
|
45431 |
-
|
45432 |
-
|
|
|
|
|
45433 |
|
45434 |
-
|
45435 |
-
|
|
|
|
|
|
|
45436 |
|
45437 |
-
|
45438 |
-
|
45439 |
-
|
45440 |
-
}
|
45441 |
|
45442 |
-
|
45443 |
-
return typeof anchorEl === 'function' ? anchorEl() : anchorEl;
|
45444 |
-
}
|
45445 |
|
45446 |
-
|
45447 |
-
|
45448 |
-
|
45449 |
-
|
45450 |
-
|
|
|
|
|
|
|
|
|
45451 |
|
45452 |
-
|
45453 |
-
var anchorEl = props.anchorEl,
|
45454 |
-
children = props.children,
|
45455 |
-
container = props.container,
|
45456 |
-
_props$disablePortal = props.disablePortal,
|
45457 |
-
disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal,
|
45458 |
-
_props$keepMounted = props.keepMounted,
|
45459 |
-
keepMounted = _props$keepMounted === void 0 ? false : _props$keepMounted,
|
45460 |
-
modifiers = props.modifiers,
|
45461 |
-
open = props.open,
|
45462 |
-
_props$placement = props.placement,
|
45463 |
-
initialPlacement = _props$placement === void 0 ? 'bottom' : _props$placement,
|
45464 |
-
_props$popperOptions = props.popperOptions,
|
45465 |
-
popperOptions = _props$popperOptions === void 0 ? defaultPopperOptions : _props$popperOptions,
|
45466 |
-
popperRefProp = props.popperRef,
|
45467 |
-
style = props.style,
|
45468 |
-
_props$transition = props.transition,
|
45469 |
-
transition = _props$transition === void 0 ? false : _props$transition,
|
45470 |
-
other = (0,objectWithoutProperties/* default */.Z)(props, ["anchorEl", "children", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition"]);
|
45471 |
|
45472 |
-
|
45473 |
-
|
45474 |
-
var popperRef = react.useRef(null);
|
45475 |
-
var handlePopperRef = (0,useForkRef/* default */.Z)(popperRef, popperRefProp);
|
45476 |
-
var handlePopperRefRef = react.useRef(handlePopperRef);
|
45477 |
-
Popper_useEnhancedEffect(function () {
|
45478 |
-
handlePopperRefRef.current = handlePopperRef;
|
45479 |
-
}, [handlePopperRef]);
|
45480 |
-
react.useImperativeHandle(popperRefProp, function () {
|
45481 |
-
return popperRef.current;
|
45482 |
-
}, []);
|
45483 |
|
45484 |
-
|
45485 |
-
|
45486 |
-
|
|
|
|
|
45487 |
|
45488 |
-
var
|
45489 |
-
|
45490 |
-
/**
|
45491 |
-
* placement initialized from prop but can change during lifetime if modifiers.flip.
|
45492 |
-
* modifiers.flip is essentially a flip for controlled/uncontrolled behavior
|
45493 |
-
*/
|
45494 |
|
45495 |
-
|
45496 |
-
|
45497 |
-
|
|
|
45498 |
|
45499 |
-
|
45500 |
-
|
45501 |
-
|
|
|
|
|
45502 |
}
|
45503 |
-
|
45504 |
-
|
45505 |
-
|
|
|
|
|
|
|
45506 |
return;
|
45507 |
}
|
45508 |
|
45509 |
-
if (
|
45510 |
-
|
45511 |
-
|
|
|
|
|
|
|
45512 |
}
|
45513 |
|
45514 |
-
|
45515 |
-
|
45516 |
-
};
|
45517 |
|
45518 |
-
|
|
|
45519 |
|
45520 |
-
if (
|
|
|
45521 |
|
45522 |
-
|
45523 |
-
|
45524 |
-
|
45525 |
-
|
45526 |
-
// It's using scrollParent by default, we can use the viewport when using a portal.
|
45527 |
-
preventOverflow: {
|
45528 |
-
boundariesElement: 'window'
|
45529 |
-
}
|
45530 |
-
}, modifiers, popperOptions.modifiers),
|
45531 |
-
// We could have been using a custom modifier like react-popper is doing.
|
45532 |
-
// But it seems this is the best public API for this use case.
|
45533 |
-
onCreate: (0,createChainedFunction/* default */.Z)(handlePopperUpdate, popperOptions.onCreate),
|
45534 |
-
onUpdate: (0,createChainedFunction/* default */.Z)(handlePopperUpdate, popperOptions.onUpdate)
|
45535 |
-
}));
|
45536 |
-
handlePopperRefRef.current(popper);
|
45537 |
-
}, [anchorEl, disablePortal, modifiers, open, rtlPlacement, popperOptions]);
|
45538 |
-
var handleRef = react.useCallback(function (node) {
|
45539 |
-
(0,setRef/* default */.Z)(ownRef, node);
|
45540 |
-
handleOpen();
|
45541 |
-
}, [ownRef, handleOpen]);
|
45542 |
|
45543 |
-
|
45544 |
-
|
|
|
|
|
|
|
|
|
|
|
45545 |
};
|
45546 |
|
45547 |
-
var
|
45548 |
-
|
45549 |
-
|
45550 |
-
|
|
|
|
|
|
|
45551 |
|
45552 |
-
|
45553 |
-
|
45554 |
};
|
45555 |
|
45556 |
-
var
|
45557 |
-
|
45558 |
-
|
|
|
45559 |
};
|
45560 |
|
45561 |
-
|
45562 |
-
return function () {
|
45563 |
-
|
|
|
|
|
|
|
|
|
45564 |
};
|
45565 |
-
}
|
45566 |
-
|
45567 |
-
|
45568 |
-
|
45569 |
-
handleClose();
|
|
|
|
|
45570 |
}
|
45571 |
-
}
|
45572 |
|
45573 |
-
if (!keepMounted && !open && (!transition || exited)) {
|
45574 |
-
return null;
|
45575 |
-
}
|
45576 |
|
45577 |
-
var
|
45578 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45579 |
};
|
45580 |
|
45581 |
-
|
45582 |
-
|
45583 |
-
|
45584 |
-
|
45585 |
-
|
45586 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45587 |
}
|
45588 |
|
45589 |
-
return
|
45590 |
-
|
45591 |
-
|
45592 |
-
|
45593 |
-
|
45594 |
-
|
45595 |
-
|
45596 |
-
|
45597 |
-
|
45598 |
-
|
45599 |
-
|
45600 |
-
|
45601 |
-
|
45602 |
-
|
45603 |
-
|
45604 |
-
|
45605 |
-
|
45606 |
-
|
45607 |
-
|
45608 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45609 |
|
45610 |
|
45611 |
|
@@ -45613,165 +50081,274 @@ var Popper_Popper = /*#__PURE__*/react.forwardRef(function Popper(props, ref) {
|
|
45613 |
|
45614 |
|
45615 |
|
45616 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45617 |
return {
|
45618 |
/* Styles applied to the root element. */
|
45619 |
root: {
|
45620 |
-
|
45621 |
-
|
45622 |
-
|
45623 |
-
color: theme.palette.text.secondary,
|
45624 |
-
fontFamily: theme.typography.fontFamily,
|
45625 |
-
fontWeight: theme.typography.fontWeightMedium,
|
45626 |
-
fontSize: theme.typography.pxToRem(14)
|
45627 |
-
},
|
45628 |
|
45629 |
-
|
45630 |
-
|
45631 |
-
|
|
|
|
|
|
|
45632 |
},
|
45633 |
|
45634 |
-
/* Styles applied to the root element if `
|
45635 |
-
|
45636 |
-
|
45637 |
},
|
45638 |
|
45639 |
-
/*
|
45640 |
-
|
45641 |
-
|
45642 |
-
|
|
|
|
|
|
|
45643 |
},
|
45644 |
|
45645 |
-
/* Styles applied to the
|
45646 |
-
|
45647 |
-
|
|
|
45648 |
},
|
45649 |
|
45650 |
-
/* Styles applied
|
45651 |
-
|
45652 |
-
position: 'sticky',
|
45653 |
-
top: 0,
|
45654 |
-
zIndex: 1,
|
45655 |
-
backgroundColor: 'inherit'
|
45656 |
-
}
|
45657 |
-
};
|
45658 |
-
};
|
45659 |
-
var ListSubheader = /*#__PURE__*/react.forwardRef(function ListSubheader(props, ref) {
|
45660 |
-
var classes = props.classes,
|
45661 |
-
className = props.className,
|
45662 |
-
_props$color = props.color,
|
45663 |
-
color = _props$color === void 0 ? 'default' : _props$color,
|
45664 |
-
_props$component = props.component,
|
45665 |
-
Component = _props$component === void 0 ? 'li' : _props$component,
|
45666 |
-
_props$disableGutters = props.disableGutters,
|
45667 |
-
disableGutters = _props$disableGutters === void 0 ? false : _props$disableGutters,
|
45668 |
-
_props$disableSticky = props.disableSticky,
|
45669 |
-
disableSticky = _props$disableSticky === void 0 ? false : _props$disableSticky,
|
45670 |
-
_props$inset = props.inset,
|
45671 |
-
inset = _props$inset === void 0 ? false : _props$inset,
|
45672 |
-
other = (0,objectWithoutProperties/* default */.Z)(props, ["classes", "className", "color", "component", "disableGutters", "disableSticky", "inset"]);
|
45673 |
|
45674 |
-
|
45675 |
-
|
45676 |
-
ref: ref
|
45677 |
-
}, other));
|
45678 |
-
});
|
45679 |
-
false ? 0 : void 0;
|
45680 |
-
/* harmony default export */ var ListSubheader_ListSubheader = ((0,withStyles/* default */.Z)(ListSubheader_styles, {
|
45681 |
-
name: 'MuiListSubheader'
|
45682 |
-
})(ListSubheader));
|
45683 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/lab/esm/internal/svg-icons/Close.js
|
45684 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45685 |
|
45686 |
-
|
45687 |
-
|
45688 |
-
|
|
|
|
|
|
|
45689 |
|
45690 |
-
/*
|
45691 |
-
|
45692 |
-
|
45693 |
-
|
45694 |
|
|
|
|
|
|
|
|
|
|
|
|
|
45695 |
|
45696 |
-
|
45697 |
-
* @ignore - internal component.
|
45698 |
-
*/
|
45699 |
|
45700 |
-
/*
|
45701 |
-
|
45702 |
-
|
45703 |
-
|
45704 |
-
|
45705 |
-
|
45706 |
|
|
|
|
|
45707 |
|
|
|
|
|
|
|
|
|
|
|
45708 |
|
|
|
|
|
|
|
|
|
45709 |
|
45710 |
-
/*
|
|
|
|
|
|
|
45711 |
|
45712 |
-
|
45713 |
-
|
|
|
|
|
45714 |
|
45715 |
-
|
45716 |
-
|
45717 |
-
|
|
|
|
|
45718 |
|
45719 |
-
|
45720 |
-
|
45721 |
-
|
45722 |
-
|
45723 |
-
|
45724 |
-
|
45725 |
-
|
45726 |
-
|
45727 |
-
matchFrom = _config$matchFrom === void 0 ? 'any' : _config$matchFrom,
|
45728 |
-
stringify = config.stringify,
|
45729 |
-
_config$trim = config.trim,
|
45730 |
-
trim = _config$trim === void 0 ? false : _config$trim;
|
45731 |
-
return function (options, _ref) {
|
45732 |
-
var inputValue = _ref.inputValue,
|
45733 |
-
getOptionLabel = _ref.getOptionLabel;
|
45734 |
-
var input = trim ? inputValue.trim() : inputValue;
|
45735 |
|
45736 |
-
|
45737 |
-
|
45738 |
-
|
|
|
|
|
45739 |
|
45740 |
-
|
45741 |
-
|
45742 |
-
|
|
|
|
|
45743 |
|
45744 |
-
|
45745 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45746 |
|
45747 |
-
|
45748 |
-
|
45749 |
-
|
|
|
|
|
45750 |
|
45751 |
-
|
45752 |
-
|
|
|
|
|
|
|
45753 |
}
|
45754 |
-
|
45755 |
-
return matchFrom === 'start' ? candidate.indexOf(input) === 0 : candidate.indexOf(input) > -1;
|
45756 |
-
});
|
45757 |
-
return typeof limit === 'number' ? filteredOptions.slice(0, limit) : filteredOptions;
|
45758 |
};
|
45759 |
-
}
|
45760 |
|
45761 |
-
function
|
45762 |
-
|
45763 |
-
|
45764 |
-
|
45765 |
-
|
45766 |
-
}
|
45767 |
|
45768 |
-
return
|
45769 |
}
|
45770 |
|
45771 |
-
var
|
|
|
|
|
45772 |
|
45773 |
-
var
|
45774 |
-
|
|
|
|
|
45775 |
var _props$autoComplete = props.autoComplete,
|
45776 |
autoComplete = _props$autoComplete === void 0 ? false : _props$autoComplete,
|
45777 |
_props$autoHighlight = props.autoHighlight,
|
@@ -45780,12 +50357,19 @@ function useAutocomplete(props) {
|
|
45780 |
autoSelect = _props$autoSelect === void 0 ? false : _props$autoSelect,
|
45781 |
_props$blurOnSelect = props.blurOnSelect,
|
45782 |
blurOnSelect = _props$blurOnSelect === void 0 ? false : _props$blurOnSelect,
|
|
|
|
|
|
|
45783 |
_props$clearOnBlur = props.clearOnBlur,
|
45784 |
clearOnBlur = _props$clearOnBlur === void 0 ? !props.freeSolo : _props$clearOnBlur,
|
45785 |
_props$clearOnEscape = props.clearOnEscape,
|
45786 |
clearOnEscape = _props$clearOnEscape === void 0 ? false : _props$clearOnEscape,
|
45787 |
-
_props$
|
45788 |
-
|
|
|
|
|
|
|
|
|
45789 |
_props$debug = props.debug,
|
45790 |
debug = _props$debug === void 0 ? false : _props$debug,
|
45791 |
_props$defaultValue = props.defaultValue,
|
@@ -45794,25 +50378,33 @@ function useAutocomplete(props) {
|
|
45794 |
disableClearable = _props$disableClearab === void 0 ? false : _props$disableClearab,
|
45795 |
_props$disableCloseOn = props.disableCloseOnSelect,
|
45796 |
disableCloseOnSelect = _props$disableCloseOn === void 0 ? false : _props$disableCloseOn,
|
|
|
|
|
45797 |
_props$disabledItemsF = props.disabledItemsFocusable,
|
45798 |
disabledItemsFocusable = _props$disabledItemsF === void 0 ? false : _props$disabledItemsF,
|
45799 |
_props$disableListWra = props.disableListWrap,
|
45800 |
disableListWrap = _props$disableListWra === void 0 ? false : _props$disableListWra,
|
45801 |
-
_props$
|
45802 |
-
|
|
|
45803 |
_props$filterSelected = props.filterSelectedOptions,
|
45804 |
filterSelectedOptions = _props$filterSelected === void 0 ? false : _props$filterSelected,
|
|
|
|
|
45805 |
_props$freeSolo = props.freeSolo,
|
45806 |
freeSolo = _props$freeSolo === void 0 ? false : _props$freeSolo,
|
|
|
|
|
|
|
|
|
|
|
|
|
45807 |
getOptionDisabled = props.getOptionDisabled,
|
45808 |
_props$getOptionLabel = props.getOptionLabel,
|
45809 |
-
|
45810 |
-
return
|
45811 |
} : _props$getOptionLabel,
|
45812 |
-
|
45813 |
-
getOptionSelected = _props$getOptionSelec === void 0 ? function (option, value) {
|
45814 |
-
return option === value;
|
45815 |
-
} : _props$getOptionSelec,
|
45816 |
groupBy = props.groupBy,
|
45817 |
_props$handleHomeEndK = props.handleHomeEndKeys,
|
45818 |
handleHomeEndKeys = _props$handleHomeEndK === void 0 ? !props.freeSolo : _props$handleHomeEndK,
|
@@ -45820,2235 +50412,2320 @@ function useAutocomplete(props) {
|
|
45820 |
_props$includeInputIn = props.includeInputInList,
|
45821 |
includeInputInList = _props$includeInputIn === void 0 ? false : _props$includeInputIn,
|
45822 |
inputValueProp = props.inputValue,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45823 |
_props$multiple = props.multiple,
|
45824 |
multiple = _props$multiple === void 0 ? false : _props$multiple,
|
|
|
|
|
45825 |
onChange = props.onChange,
|
45826 |
onClose = props.onClose,
|
45827 |
onHighlightChange = props.onHighlightChange,
|
45828 |
onInputChange = props.onInputChange,
|
45829 |
onOpen = props.onOpen,
|
45830 |
-
|
45831 |
_props$openOnFocus = props.openOnFocus,
|
45832 |
openOnFocus = _props$openOnFocus === void 0 ? false : _props$openOnFocus,
|
|
|
|
|
45833 |
options = props.options,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45834 |
_props$selectOnFocus = props.selectOnFocus,
|
45835 |
selectOnFocus = _props$selectOnFocus === void 0 ? !props.freeSolo : _props$selectOnFocus,
|
45836 |
-
|
45837 |
-
|
45838 |
-
|
45839 |
-
|
45840 |
-
|
45841 |
-
|
45842 |
-
var ignoreFocus = react.useRef(false);
|
45843 |
-
var firstFocus = react.useRef(true);
|
45844 |
-
var inputRef = react.useRef(null);
|
45845 |
-
var listboxRef = react.useRef(null);
|
45846 |
-
|
45847 |
-
var _React$useState = react.useState(null),
|
45848 |
-
anchorEl = _React$useState[0],
|
45849 |
-
setAnchorEl = _React$useState[1];
|
45850 |
-
|
45851 |
-
var _React$useState2 = react.useState(-1),
|
45852 |
-
focusedTag = _React$useState2[0],
|
45853 |
-
setFocusedTag = _React$useState2[1];
|
45854 |
|
45855 |
-
var defaultHighlighted = autoHighlight ? 0 : -1;
|
45856 |
-
var highlightedIndexRef = react.useRef(defaultHighlighted);
|
45857 |
|
45858 |
-
var
|
45859 |
-
controlled: valueProp,
|
45860 |
-
default: defaultValue,
|
45861 |
-
name: componentName
|
45862 |
-
}),
|
45863 |
-
_useControlled2 = (0,slicedToArray/* default */.Z)(_useControlled, 2),
|
45864 |
-
value = _useControlled2[0],
|
45865 |
-
setValue = _useControlled2[1];
|
45866 |
|
45867 |
-
var
|
45868 |
-
|
45869 |
-
|
45870 |
-
|
45871 |
-
|
45872 |
-
|
45873 |
-
|
45874 |
-
|
45875 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45876 |
|
45877 |
-
var
|
45878 |
-
focused = _React$useState3[0],
|
45879 |
-
setFocused = _React$useState3[1];
|
45880 |
|
45881 |
-
|
45882 |
-
var
|
|
|
|
|
|
|
|
|
|
|
45883 |
|
45884 |
-
if (
|
45885 |
-
|
45886 |
-
} else if (newValue == null) {
|
45887 |
-
newInputValue = '';
|
45888 |
} else {
|
45889 |
-
|
45890 |
-
|
45891 |
-
|
45892 |
-
|
45893 |
-
|
45894 |
-
|
45895 |
-
|
45896 |
-
|
45897 |
-
setInputValue(newInputValue);
|
45898 |
-
|
45899 |
-
if (onInputChange) {
|
45900 |
-
onInputChange(event, newInputValue, 'reset');
|
45901 |
}
|
45902 |
-
}
|
45903 |
-
react.useEffect(function () {
|
45904 |
-
resetInputValue(null, value);
|
45905 |
-
}, [value, resetInputValue]);
|
45906 |
|
45907 |
-
|
45908 |
-
|
45909 |
-
default: false,
|
45910 |
-
name: componentName,
|
45911 |
-
state: 'open'
|
45912 |
-
}),
|
45913 |
-
_useControlled6 = (0,slicedToArray/* default */.Z)(_useControlled5, 2),
|
45914 |
-
open = _useControlled6[0],
|
45915 |
-
setOpenState = _useControlled6[1];
|
45916 |
|
45917 |
-
|
45918 |
-
|
45919 |
-
|
45920 |
-
|
45921 |
-
|
45922 |
-
|
45923 |
-
return false;
|
45924 |
}
|
|
|
45925 |
|
45926 |
-
|
45927 |
-
|
45928 |
-
|
45929 |
-
|
45930 |
-
|
45931 |
-
|
45932 |
-
|
|
|
|
|
|
|
45933 |
|
45934 |
-
|
|
|
45935 |
|
45936 |
-
var
|
45937 |
-
|
45938 |
-
|
45939 |
-
|
45940 |
-
|
45941 |
-
}
|
45942 |
-
|
|
|
|
|
|
|
|
|
|
|
45943 |
|
45944 |
-
|
45945 |
-
|
45946 |
-
|
45947 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45948 |
}
|
45949 |
-
}, [value, multiple, focusedTag, focusTag]);
|
45950 |
|
45951 |
-
|
45952 |
-
|
45953 |
-
|
45954 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45955 |
|
45956 |
-
|
45957 |
|
45958 |
-
|
45959 |
-
// Out of range
|
45960 |
-
if (direction === 'next' && nextFocus === filteredOptions.length || direction === 'previous' && nextFocus === -1) {
|
45961 |
-
return -1;
|
45962 |
-
}
|
45963 |
|
45964 |
-
|
45965 |
|
45966 |
-
|
45967 |
|
45968 |
-
|
45969 |
-
// Move to the next element.
|
45970 |
-
nextFocus += direction === 'next' ? 1 : -1;
|
45971 |
-
} else {
|
45972 |
-
return nextFocus;
|
45973 |
-
}
|
45974 |
-
}
|
45975 |
-
}
|
45976 |
|
45977 |
-
|
45978 |
-
var event = _ref2.event,
|
45979 |
-
index = _ref2.index,
|
45980 |
-
_ref2$reason = _ref2.reason,
|
45981 |
-
reason = _ref2$reason === void 0 ? 'auto' : _ref2$reason;
|
45982 |
-
highlightedIndexRef.current = index; // does the index exist?
|
45983 |
|
45984 |
-
if (index === -1) {
|
45985 |
-
inputRef.current.removeAttribute('aria-activedescendant');
|
45986 |
-
} else {
|
45987 |
-
inputRef.current.setAttribute('aria-activedescendant', "".concat(id, "-option-").concat(index));
|
45988 |
-
}
|
45989 |
|
45990 |
-
if (onHighlightChange) {
|
45991 |
-
onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
|
45992 |
-
}
|
45993 |
|
45994 |
-
if (!listboxRef.current) {
|
45995 |
-
return;
|
45996 |
-
}
|
45997 |
|
45998 |
-
var prev = listboxRef.current.querySelector('[data-focus]');
|
45999 |
|
46000 |
-
if (prev) {
|
46001 |
-
prev.removeAttribute('data-focus');
|
46002 |
-
}
|
46003 |
|
46004 |
-
var listboxNode = listboxRef.current.parentElement.querySelector('[role="listbox"]'); // "No results"
|
46005 |
|
46006 |
-
if (!listboxNode) {
|
46007 |
-
return;
|
46008 |
-
}
|
46009 |
|
46010 |
-
if (index === -1) {
|
46011 |
-
listboxNode.scrollTop = 0;
|
46012 |
-
return;
|
46013 |
-
}
|
46014 |
|
46015 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46016 |
|
46017 |
-
|
46018 |
-
|
46019 |
-
|
|
|
46020 |
|
46021 |
-
|
46022 |
-
|
46023 |
-
|
46024 |
-
|
46025 |
-
// .scrollIntoView({ scrollMode: 'if-needed', block: 'nearest' });
|
46026 |
|
46027 |
-
|
46028 |
-
|
46029 |
-
|
46030 |
-
|
46031 |
|
46032 |
-
|
46033 |
-
|
46034 |
-
|
46035 |
-
|
46036 |
-
|
46037 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46038 |
});
|
46039 |
-
|
46040 |
-
|
46041 |
-
|
46042 |
-
_ref3$direction = _ref3.direction,
|
46043 |
-
direction = _ref3$direction === void 0 ? 'next' : _ref3$direction,
|
46044 |
-
_ref3$reason = _ref3.reason,
|
46045 |
-
reason = _ref3$reason === void 0 ? 'auto' : _ref3$reason;
|
46046 |
|
46047 |
-
|
46048 |
-
return;
|
46049 |
-
}
|
46050 |
|
46051 |
-
|
46052 |
-
var maxIndex = filteredOptions.length - 1;
|
46053 |
|
46054 |
-
|
46055 |
-
return defaultHighlighted;
|
46056 |
-
}
|
46057 |
|
46058 |
-
|
46059 |
-
return 0;
|
46060 |
-
}
|
46061 |
|
46062 |
-
|
46063 |
-
return maxIndex;
|
46064 |
-
}
|
46065 |
|
46066 |
-
var newIndex = highlightedIndexRef.current + diff;
|
46067 |
|
46068 |
-
if (newIndex < 0) {
|
46069 |
-
if (newIndex === -1 && includeInputInList) {
|
46070 |
-
return -1;
|
46071 |
-
}
|
46072 |
|
46073 |
-
if (disableListWrap && highlightedIndexRef.current !== -1 || Math.abs(diff) > 1) {
|
46074 |
-
return 0;
|
46075 |
-
}
|
46076 |
|
46077 |
-
return maxIndex;
|
46078 |
-
}
|
46079 |
|
46080 |
-
if (newIndex > maxIndex) {
|
46081 |
-
if (newIndex === maxIndex + 1 && includeInputInList) {
|
46082 |
-
return -1;
|
46083 |
-
}
|
46084 |
|
46085 |
-
if (disableListWrap || Math.abs(diff) > 1) {
|
46086 |
-
return maxIndex;
|
46087 |
-
}
|
46088 |
|
46089 |
-
return 0;
|
46090 |
-
}
|
46091 |
|
46092 |
-
return newIndex;
|
46093 |
-
};
|
46094 |
|
46095 |
-
|
46096 |
-
|
46097 |
-
|
46098 |
-
|
46099 |
-
|
46100 |
-
|
|
|
46101 |
|
46102 |
-
|
46103 |
-
|
46104 |
-
|
46105 |
-
|
46106 |
-
|
46107 |
-
|
46108 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46109 |
|
46110 |
-
|
|
|
|
|
|
|
|
|
46111 |
|
46112 |
-
|
46113 |
-
inputRef.current.setSelectionRange(inputValue.length, option.length);
|
46114 |
-
}
|
46115 |
-
}
|
46116 |
-
}
|
46117 |
-
});
|
46118 |
-
var syncHighlightedIndex = react.useCallback(function () {
|
46119 |
-
if (!popupOpen) {
|
46120 |
-
return;
|
46121 |
-
}
|
46122 |
|
46123 |
-
|
46124 |
|
46125 |
-
|
46126 |
-
changeHighlightedIndex({
|
46127 |
-
diff: 'reset'
|
46128 |
-
});
|
46129 |
-
return;
|
46130 |
-
}
|
46131 |
|
46132 |
-
|
46133 |
-
return;
|
46134 |
-
} // Synchronize the value with the highlighted index
|
46135 |
|
|
|
46136 |
|
46137 |
-
|
46138 |
-
var currentOption = filteredOptions[highlightedIndexRef.current]; // Keep the current highlighted index if possible
|
46139 |
|
46140 |
-
|
46141 |
-
return getOptionSelected(currentOption, val);
|
46142 |
-
}) !== -1) {
|
46143 |
-
return;
|
46144 |
-
}
|
46145 |
|
46146 |
-
|
46147 |
-
return getOptionSelected(optionItem, valueItem);
|
46148 |
-
});
|
46149 |
|
46150 |
-
|
46151 |
-
changeHighlightedIndex({
|
46152 |
-
diff: 'reset'
|
46153 |
-
});
|
46154 |
-
} else {
|
46155 |
-
setHighlightedIndex({
|
46156 |
-
index: itemIndex
|
46157 |
-
});
|
46158 |
-
}
|
46159 |
|
46160 |
-
|
46161 |
-
} // Prevent the highlighted index to leak outside the boundaries.
|
46162 |
|
|
|
46163 |
|
46164 |
-
if (highlightedIndexRef.current >= filteredOptions.length - 1) {
|
46165 |
-
setHighlightedIndex({
|
46166 |
-
index: filteredOptions.length - 1
|
46167 |
-
});
|
46168 |
-
return;
|
46169 |
-
} // Restore the focus to the previous index.
|
46170 |
|
46171 |
|
46172 |
-
setHighlightedIndex({
|
46173 |
-
index: highlightedIndexRef.current
|
46174 |
-
}); // Ignore filteredOptions (and options, getOptionSelected, getOptionLabel) not to break the scroll position
|
46175 |
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
46176 |
-
}, [// Only sync the highlighted index when the option switch between empty and not
|
46177 |
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
46178 |
-
filteredOptions.length === 0, // Don't sync the highlighted index with the value when multiple
|
46179 |
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
46180 |
-
multiple ? false : value, filterSelectedOptions, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]);
|
46181 |
-
var handleListboxRef = (0,useEventCallback/* default */.Z)(function (node) {
|
46182 |
-
(0,setRef/* default */.Z)(listboxRef, node);
|
46183 |
|
46184 |
-
if (!node) {
|
46185 |
-
return;
|
46186 |
-
}
|
46187 |
|
46188 |
-
syncHighlightedIndex();
|
46189 |
-
});
|
46190 |
-
react.useEffect(function () {
|
46191 |
-
syncHighlightedIndex();
|
46192 |
-
}, [syncHighlightedIndex]);
|
46193 |
|
46194 |
-
var handleOpen = function handleOpen(event) {
|
46195 |
-
if (open) {
|
46196 |
-
return;
|
46197 |
-
}
|
46198 |
|
46199 |
-
setOpenState(true);
|
46200 |
|
46201 |
-
if (onOpen) {
|
46202 |
-
onOpen(event);
|
46203 |
-
}
|
46204 |
-
};
|
46205 |
|
46206 |
-
var handleClose = function handleClose(event, reason) {
|
46207 |
-
if (!open) {
|
46208 |
-
return;
|
46209 |
-
}
|
46210 |
|
46211 |
-
setOpenState(false);
|
46212 |
|
46213 |
-
if (onClose) {
|
46214 |
-
onClose(event, reason);
|
46215 |
-
}
|
46216 |
-
};
|
46217 |
|
46218 |
-
var handleValue = function handleValue(event, newValue, reason, details) {
|
46219 |
-
if (value === newValue) {
|
46220 |
-
return;
|
46221 |
-
}
|
46222 |
|
46223 |
-
if (onChange) {
|
46224 |
-
onChange(event, newValue, reason, details);
|
46225 |
-
}
|
46226 |
|
46227 |
-
setValue(newValue);
|
46228 |
-
};
|
46229 |
|
46230 |
-
var isTouch = react.useRef(false);
|
46231 |
|
46232 |
-
var selectNewValue = function selectNewValue(event, option) {
|
46233 |
-
var reasonProp = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'select-option';
|
46234 |
-
var origin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'options';
|
46235 |
-
var reason = reasonProp;
|
46236 |
-
var newValue = option;
|
46237 |
|
46238 |
-
if (multiple) {
|
46239 |
-
newValue = Array.isArray(value) ? value.slice() : [];
|
46240 |
|
46241 |
-
if (false) { var matches; }
|
46242 |
|
46243 |
-
var itemIndex = useAutocomplete_findIndex(newValue, function (valueItem) {
|
46244 |
-
return getOptionSelected(option, valueItem);
|
46245 |
-
});
|
46246 |
|
46247 |
-
if (itemIndex === -1) {
|
46248 |
-
newValue.push(option);
|
46249 |
-
} else if (origin !== 'freeSolo') {
|
46250 |
-
newValue.splice(itemIndex, 1);
|
46251 |
-
reason = 'remove-option';
|
46252 |
-
}
|
46253 |
-
}
|
46254 |
|
46255 |
-
resetInputValue(event, newValue);
|
46256 |
-
handleValue(event, newValue, reason, {
|
46257 |
-
option: option
|
46258 |
-
});
|
46259 |
|
46260 |
-
if (!disableCloseOnSelect) {
|
46261 |
-
handleClose(event, reason);
|
46262 |
-
}
|
46263 |
|
46264 |
-
if (blurOnSelect === true || blurOnSelect === 'touch' && isTouch.current || blurOnSelect === 'mouse' && !isTouch.current) {
|
46265 |
-
inputRef.current.blur();
|
46266 |
-
}
|
46267 |
-
};
|
46268 |
|
46269 |
-
function validTagIndex(index, direction) {
|
46270 |
-
if (index === -1) {
|
46271 |
-
return -1;
|
46272 |
-
}
|
46273 |
|
46274 |
-
var nextFocus = index;
|
46275 |
|
46276 |
-
|
46277 |
-
|
46278 |
-
|
46279 |
-
|
46280 |
-
}
|
46281 |
|
46282 |
-
var option = anchorEl.querySelector("[data-tag-index=\"".concat(nextFocus, "\"]")); // Same logic as MenuList.js
|
46283 |
|
46284 |
-
|
46285 |
-
|
46286 |
-
|
46287 |
-
|
46288 |
-
}
|
46289 |
-
}
|
46290 |
-
}
|
46291 |
|
46292 |
-
|
46293 |
-
|
46294 |
-
|
46295 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46296 |
|
46297 |
-
|
46298 |
-
|
|
|
|
|
46299 |
|
46300 |
-
|
46301 |
-
|
46302 |
-
|
46303 |
-
|
46304 |
-
} else {
|
46305 |
-
nextTag += direction === 'next' ? 1 : -1;
|
46306 |
|
46307 |
-
|
46308 |
-
|
46309 |
-
|
|
|
46310 |
|
46311 |
-
|
46312 |
-
nextTag = -1;
|
46313 |
-
}
|
46314 |
-
}
|
46315 |
|
46316 |
-
|
46317 |
-
|
46318 |
-
|
|
|
|
|
|
|
46319 |
};
|
46320 |
|
46321 |
-
|
46322 |
-
|
46323 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46324 |
|
46325 |
-
|
46326 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
46327 |
}
|
|
|
|
|
|
|
|
|
|
|
46328 |
|
46329 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46330 |
};
|
46331 |
|
46332 |
-
|
46333 |
-
|
46334 |
-
|
46335 |
-
|
46336 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46337 |
}
|
46338 |
|
46339 |
-
|
46340 |
-
|
46341 |
-
|
46342 |
-
|
46343 |
-
|
46344 |
-
|
46345 |
-
|
46346 |
-
|
46347 |
-
|
46348 |
-
|
46349 |
-
|
46350 |
-
|
46351 |
-
|
46352 |
-
|
46353 |
-
|
46354 |
-
|
46355 |
-
|
46356 |
-
|
46357 |
-
|
46358 |
-
|
46359 |
-
|
46360 |
-
|
46361 |
-
|
46362 |
-
|
46363 |
-
|
46364 |
-
|
46365 |
-
|
46366 |
-
|
46367 |
-
|
46368 |
-
|
46369 |
-
|
46370 |
-
|
46371 |
-
|
46372 |
-
|
46373 |
-
|
46374 |
-
|
46375 |
-
|
46376 |
-
|
46377 |
-
|
46378 |
-
|
46379 |
-
|
46380 |
-
case 'PageDown':
|
46381 |
-
// Prevent scroll of the page
|
46382 |
-
event.preventDefault();
|
46383 |
-
changeHighlightedIndex({
|
46384 |
-
diff: pageSize,
|
46385 |
-
direction: 'next',
|
46386 |
-
reason: 'keyboard',
|
46387 |
-
event: event
|
46388 |
-
});
|
46389 |
-
handleOpen(event);
|
46390 |
-
break;
|
46391 |
-
|
46392 |
-
case 'ArrowDown':
|
46393 |
-
// Prevent cursor move
|
46394 |
-
event.preventDefault();
|
46395 |
-
changeHighlightedIndex({
|
46396 |
-
diff: 1,
|
46397 |
-
direction: 'next',
|
46398 |
-
reason: 'keyboard',
|
46399 |
-
event: event
|
46400 |
-
});
|
46401 |
-
handleOpen(event);
|
46402 |
-
break;
|
46403 |
-
|
46404 |
-
case 'ArrowUp':
|
46405 |
-
// Prevent cursor move
|
46406 |
-
event.preventDefault();
|
46407 |
-
changeHighlightedIndex({
|
46408 |
-
diff: -1,
|
46409 |
-
direction: 'previous',
|
46410 |
-
reason: 'keyboard',
|
46411 |
-
event: event
|
46412 |
-
});
|
46413 |
-
handleOpen(event);
|
46414 |
-
break;
|
46415 |
-
|
46416 |
-
case 'ArrowLeft':
|
46417 |
-
handleFocusTag(event, 'previous');
|
46418 |
-
break;
|
46419 |
-
|
46420 |
-
case 'ArrowRight':
|
46421 |
-
handleFocusTag(event, 'next');
|
46422 |
-
break;
|
46423 |
-
|
46424 |
-
case 'Enter':
|
46425 |
-
// Wait until IME is settled.
|
46426 |
-
if (event.which === 229) {
|
46427 |
-
break;
|
46428 |
-
}
|
46429 |
-
|
46430 |
-
if (highlightedIndexRef.current !== -1 && popupOpen) {
|
46431 |
-
var option = filteredOptions[highlightedIndexRef.current];
|
46432 |
-
var disabled = getOptionDisabled ? getOptionDisabled(option) : false; // We don't want to validate the form.
|
46433 |
-
|
46434 |
-
event.preventDefault();
|
46435 |
-
|
46436 |
-
if (disabled) {
|
46437 |
-
return;
|
46438 |
-
}
|
46439 |
-
|
46440 |
-
selectNewValue(event, option, 'select-option'); // Move the selection to the end.
|
46441 |
-
|
46442 |
-
if (autoComplete) {
|
46443 |
-
inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);
|
46444 |
-
}
|
46445 |
-
} else if (freeSolo && inputValue !== '' && inputValueIsSelectedValue === false) {
|
46446 |
-
if (multiple) {
|
46447 |
-
// Allow people to add new values before they submit the form.
|
46448 |
-
event.preventDefault();
|
46449 |
-
}
|
46450 |
-
|
46451 |
-
selectNewValue(event, inputValue, 'create-option', 'freeSolo');
|
46452 |
-
}
|
46453 |
-
|
46454 |
-
break;
|
46455 |
-
|
46456 |
-
case 'Escape':
|
46457 |
-
if (popupOpen) {
|
46458 |
-
// Avoid Opera to exit fullscreen mode.
|
46459 |
-
event.preventDefault(); // Avoid the Modal to handle the event.
|
46460 |
-
|
46461 |
-
event.stopPropagation();
|
46462 |
-
handleClose(event, 'escape');
|
46463 |
-
} else if (clearOnEscape && (inputValue !== '' || multiple && value.length > 0)) {
|
46464 |
-
// Avoid Opera to exit fullscreen mode.
|
46465 |
-
event.preventDefault(); // Avoid the Modal to handle the event.
|
46466 |
-
|
46467 |
-
event.stopPropagation();
|
46468 |
-
handleClear(event);
|
46469 |
-
}
|
46470 |
-
|
46471 |
-
break;
|
46472 |
-
|
46473 |
-
case 'Backspace':
|
46474 |
-
if (multiple && inputValue === '' && value.length > 0) {
|
46475 |
-
var index = focusedTag === -1 ? value.length - 1 : focusedTag;
|
46476 |
-
var newValue = value.slice();
|
46477 |
-
newValue.splice(index, 1);
|
46478 |
-
handleValue(event, newValue, 'remove-option', {
|
46479 |
-
option: value[index]
|
46480 |
-
});
|
46481 |
-
}
|
46482 |
-
|
46483 |
-
break;
|
46484 |
-
|
46485 |
-
default:
|
46486 |
-
}
|
46487 |
|
46488 |
-
|
46489 |
-
|
46490 |
-
|
46491 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
46492 |
};
|
46493 |
-
|
46494 |
-
|
46495 |
-
|
46496 |
-
|
46497 |
-
|
46498 |
-
|
46499 |
-
}
|
46500 |
};
|
|
|
|
|
|
|
46501 |
|
46502 |
-
var
|
46503 |
-
|
46504 |
-
if (listboxRef.current !== null && document.activeElement === listboxRef.current.parentElement) {
|
46505 |
-
inputRef.current.focus();
|
46506 |
-
return;
|
46507 |
-
}
|
46508 |
-
|
46509 |
-
setFocused(false);
|
46510 |
-
firstFocus.current = true;
|
46511 |
-
ignoreFocus.current = false;
|
46512 |
|
46513 |
-
|
46514 |
-
|
|
|
|
|
|
|
|
|
46515 |
}
|
|
|
|
|
|
|
46516 |
|
46517 |
-
if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen) {
|
46518 |
-
selectNewValue(event, filteredOptions[highlightedIndexRef.current], 'blur');
|
46519 |
-
} else if (autoSelect && freeSolo && inputValue !== '') {
|
46520 |
-
selectNewValue(event, inputValue, 'blur', 'freeSolo');
|
46521 |
-
} else if (clearOnBlur) {
|
46522 |
-
resetInputValue(event, value);
|
46523 |
-
}
|
46524 |
|
46525 |
-
|
46526 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
46527 |
|
46528 |
-
|
46529 |
-
var newValue = event.target.value;
|
46530 |
|
46531 |
-
|
46532 |
-
setInputValue(newValue);
|
46533 |
|
46534 |
-
|
46535 |
-
onInputChange(event, newValue, 'input');
|
46536 |
-
}
|
46537 |
-
}
|
46538 |
|
46539 |
-
|
46540 |
-
if (!disableClearable && !multiple) {
|
46541 |
-
handleValue(event, null, 'clear');
|
46542 |
-
}
|
46543 |
-
} else {
|
46544 |
-
handleOpen(event);
|
46545 |
-
}
|
46546 |
-
};
|
46547 |
|
46548 |
-
|
46549 |
-
setHighlightedIndex({
|
46550 |
-
event: event,
|
46551 |
-
index: Number(event.currentTarget.getAttribute('data-option-index')),
|
46552 |
-
reason: 'mouse'
|
46553 |
-
});
|
46554 |
-
};
|
46555 |
|
46556 |
-
var handleOptionTouchStart = function handleOptionTouchStart() {
|
46557 |
-
isTouch.current = true;
|
46558 |
-
};
|
46559 |
|
46560 |
-
var handleOptionClick = function handleOptionClick(event) {
|
46561 |
-
var index = Number(event.currentTarget.getAttribute('data-option-index'));
|
46562 |
-
selectNewValue(event, filteredOptions[index], 'select-option');
|
46563 |
-
isTouch.current = false;
|
46564 |
-
};
|
46565 |
|
46566 |
-
|
46567 |
-
return function (event) {
|
46568 |
-
var newValue = value.slice();
|
46569 |
-
newValue.splice(index, 1);
|
46570 |
-
handleValue(event, newValue, 'remove-option', {
|
46571 |
-
option: value[index]
|
46572 |
-
});
|
46573 |
-
};
|
46574 |
-
};
|
46575 |
|
46576 |
-
var handlePopupIndicator = function handlePopupIndicator(event) {
|
46577 |
-
if (open) {
|
46578 |
-
handleClose(event, 'toggleInput');
|
46579 |
-
} else {
|
46580 |
-
handleOpen(event);
|
46581 |
-
}
|
46582 |
-
}; // Prevent input blur when interacting with the combobox
|
46583 |
|
46584 |
|
46585 |
-
var handleMouseDown = function handleMouseDown(event) {
|
46586 |
-
if (event.target.getAttribute('id') !== id) {
|
46587 |
-
event.preventDefault();
|
46588 |
-
}
|
46589 |
-
}; // Focus the input when interacting with the combobox
|
46590 |
|
46591 |
|
46592 |
-
var handleClick = function handleClick() {
|
46593 |
-
inputRef.current.focus();
|
46594 |
|
46595 |
-
if (selectOnFocus && firstFocus.current && inputRef.current.selectionEnd - inputRef.current.selectionStart === 0) {
|
46596 |
-
inputRef.current.select();
|
46597 |
-
}
|
46598 |
|
46599 |
-
firstFocus.current = false;
|
46600 |
-
};
|
46601 |
|
46602 |
-
var handleInputMouseDown = function handleInputMouseDown(event) {
|
46603 |
-
if (inputValue === '' || !open) {
|
46604 |
-
handlePopupIndicator(event);
|
46605 |
-
}
|
46606 |
-
};
|
46607 |
|
46608 |
-
var dirty = freeSolo && inputValue.length > 0;
|
46609 |
-
dirty = dirty || (multiple ? value.length > 0 : value !== null);
|
46610 |
-
var groupedOptions = filteredOptions;
|
46611 |
|
46612 |
-
if (groupBy) {
|
46613 |
-
// used to keep track of key and indexes in the result array
|
46614 |
-
var indexBy = new Map();
|
46615 |
-
var warn = false;
|
46616 |
-
groupedOptions = filteredOptions.reduce(function (acc, option, index) {
|
46617 |
-
var group = groupBy(option);
|
46618 |
|
46619 |
-
if (acc.length > 0 && acc[acc.length - 1].group === group) {
|
46620 |
-
acc[acc.length - 1].options.push(option);
|
46621 |
-
} else {
|
46622 |
-
if (false) {}
|
46623 |
|
46624 |
-
acc.push({
|
46625 |
-
key: index,
|
46626 |
-
index: index,
|
46627 |
-
group: group,
|
46628 |
-
options: [option]
|
46629 |
-
});
|
46630 |
-
}
|
46631 |
|
46632 |
-
|
46633 |
-
|
46634 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46635 |
|
46636 |
-
|
46637 |
-
|
46638 |
-
|
46639 |
-
|
46640 |
-
|
46641 |
-
role: 'combobox',
|
46642 |
-
'aria-expanded': popupOpen
|
46643 |
-
}, other, {
|
46644 |
-
onKeyDown: handleKeyDown(other),
|
46645 |
-
onMouseDown: handleMouseDown,
|
46646 |
-
onClick: handleClick
|
46647 |
-
});
|
46648 |
-
},
|
46649 |
-
getInputLabelProps: function getInputLabelProps() {
|
46650 |
-
return {
|
46651 |
-
id: "".concat(id, "-label"),
|
46652 |
-
htmlFor: id
|
46653 |
-
};
|
46654 |
-
},
|
46655 |
-
getInputProps: function getInputProps() {
|
46656 |
-
return {
|
46657 |
-
id: id,
|
46658 |
-
value: inputValue,
|
46659 |
-
onBlur: handleBlur,
|
46660 |
-
onFocus: handleFocus,
|
46661 |
-
onChange: handleInputChange,
|
46662 |
-
onMouseDown: handleInputMouseDown,
|
46663 |
-
// if open then this is handled imperativeley so don't let react override
|
46664 |
-
// only have an opinion about this when closed
|
46665 |
-
'aria-activedescendant': popupOpen ? '' : null,
|
46666 |
-
'aria-autocomplete': autoComplete ? 'both' : 'list',
|
46667 |
-
'aria-controls': popupOpen ? "".concat(id, "-popup") : null,
|
46668 |
-
// Disable browser's suggestion that might overlap with the popup.
|
46669 |
-
// Handle autocomplete but not autofill.
|
46670 |
-
autoComplete: 'off',
|
46671 |
-
ref: inputRef,
|
46672 |
-
autoCapitalize: 'none',
|
46673 |
-
spellCheck: 'false'
|
46674 |
-
};
|
46675 |
-
},
|
46676 |
-
getClearProps: function getClearProps() {
|
46677 |
-
return {
|
46678 |
-
tabIndex: -1,
|
46679 |
-
onClick: handleClear
|
46680 |
-
};
|
46681 |
-
},
|
46682 |
-
getPopupIndicatorProps: function getPopupIndicatorProps() {
|
46683 |
-
return {
|
46684 |
-
tabIndex: -1,
|
46685 |
-
onClick: handlePopupIndicator
|
46686 |
-
};
|
46687 |
-
},
|
46688 |
-
getTagProps: function getTagProps(_ref4) {
|
46689 |
-
var index = _ref4.index;
|
46690 |
-
return {
|
46691 |
-
key: index,
|
46692 |
-
'data-tag-index': index,
|
46693 |
-
tabIndex: -1,
|
46694 |
-
onDelete: handleTagDelete(index)
|
46695 |
-
};
|
46696 |
-
},
|
46697 |
-
getListboxProps: function getListboxProps() {
|
46698 |
-
return {
|
46699 |
-
role: 'listbox',
|
46700 |
-
id: "".concat(id, "-popup"),
|
46701 |
-
'aria-labelledby': "".concat(id, "-label"),
|
46702 |
-
ref: handleListboxRef,
|
46703 |
-
onMouseDown: function onMouseDown(event) {
|
46704 |
-
// Prevent blur
|
46705 |
-
event.preventDefault();
|
46706 |
-
}
|
46707 |
-
};
|
46708 |
-
},
|
46709 |
-
getOptionProps: function getOptionProps(_ref5) {
|
46710 |
-
var index = _ref5.index,
|
46711 |
-
option = _ref5.option;
|
46712 |
-
var selected = (multiple ? value : [value]).some(function (value2) {
|
46713 |
-
return value2 != null && getOptionSelected(option, value2);
|
46714 |
-
});
|
46715 |
-
var disabled = getOptionDisabled ? getOptionDisabled(option) : false;
|
46716 |
-
return {
|
46717 |
-
key: index,
|
46718 |
-
tabIndex: -1,
|
46719 |
-
role: 'option',
|
46720 |
-
id: "".concat(id, "-option-").concat(index),
|
46721 |
-
onMouseOver: handleOptionMouseOver,
|
46722 |
-
onClick: handleOptionClick,
|
46723 |
-
onTouchStart: handleOptionTouchStart,
|
46724 |
-
'data-option-index': index,
|
46725 |
-
'aria-disabled': disabled,
|
46726 |
-
'aria-selected': selected
|
46727 |
-
};
|
46728 |
-
},
|
46729 |
-
id: id,
|
46730 |
-
inputValue: inputValue,
|
46731 |
-
value: value,
|
46732 |
-
dirty: dirty,
|
46733 |
-
popupOpen: popupOpen,
|
46734 |
-
focused: focused || focusedTag !== -1,
|
46735 |
-
anchorEl: anchorEl,
|
46736 |
-
setAnchorEl: setAnchorEl,
|
46737 |
-
focusedTag: focusedTag,
|
46738 |
-
groupedOptions: groupedOptions
|
46739 |
-
};
|
46740 |
-
}
|
46741 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/lab/esm/Autocomplete/Autocomplete.js
|
46742 |
|
|
|
|
|
|
|
|
|
46743 |
|
|
|
|
|
|
|
|
|
46744 |
|
|
|
|
|
|
|
46745 |
|
|
|
|
|
|
|
|
|
46746 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46747 |
|
|
|
|
|
46748 |
|
|
|
|
|
|
|
|
|
|
|
|
|
46749 |
|
|
|
|
|
|
|
|
|
|
|
|
|
46750 |
|
|
|
|
|
|
|
|
|
46751 |
|
|
|
|
|
|
|
46752 |
|
46753 |
|
|
|
|
|
|
|
46754 |
|
|
|
|
|
46755 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46756 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46757 |
|
46758 |
-
|
46759 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46760 |
|
|
|
46761 |
return {
|
46762 |
-
|
46763 |
-
|
46764 |
-
|
46765 |
-
|
46766 |
-
|
46767 |
-
|
46768 |
-
|
46769 |
-
|
46770 |
-
'&:hover $clearIndicatorDirty': {
|
46771 |
-
visibility: 'visible'
|
46772 |
-
}
|
46773 |
-
}
|
46774 |
-
},
|
46775 |
-
|
46776 |
-
/* Styles applied to the root element if `fullWidth={true}`. */
|
46777 |
-
fullWidth: {
|
46778 |
-
width: '100%'
|
46779 |
},
|
46780 |
-
|
46781 |
-
|
46782 |
-
focused: {},
|
46783 |
-
|
46784 |
-
/* Styles applied to the tag elements, e.g. the chips. */
|
46785 |
-
tag: {
|
46786 |
-
margin: 3,
|
46787 |
-
maxWidth: 'calc(100% - 6px)'
|
46788 |
},
|
46789 |
-
|
46790 |
-
|
46791 |
-
tagSizeSmall: {
|
46792 |
-
margin: 2,
|
46793 |
-
maxWidth: 'calc(100% - 4px)'
|
46794 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
46795 |
|
46796 |
-
/* Styles applied when the popup icon is rendered. */
|
46797 |
-
hasPopupIcon: {},
|
46798 |
|
46799 |
-
/* Styles applied when the clear icon is rendered. */
|
46800 |
-
hasClearIcon: {},
|
46801 |
|
46802 |
-
|
46803 |
-
|
46804 |
-
|
46805 |
-
|
46806 |
-
|
46807 |
-
|
46808 |
-
|
46809 |
-
|
46810 |
-
|
46811 |
-
|
46812 |
-
|
46813 |
-
|
46814 |
-
|
46815 |
-
|
46816 |
-
paddingBottom: 1,
|
46817 |
-
'& $input': {
|
46818 |
-
padding: 4
|
46819 |
-
},
|
46820 |
-
'& $input:first-child': {
|
46821 |
-
padding: '6px 0'
|
46822 |
-
}
|
46823 |
-
},
|
46824 |
-
'&[class*="MuiInput-root"][class*="MuiInput-marginDense"]': {
|
46825 |
-
'& $input': {
|
46826 |
-
padding: '4px 4px 5px'
|
46827 |
-
},
|
46828 |
-
'& $input:first-child': {
|
46829 |
-
padding: '3px 0 6px'
|
46830 |
-
}
|
46831 |
-
},
|
46832 |
-
'&[class*="MuiOutlinedInput-root"]': {
|
46833 |
-
padding: 9,
|
46834 |
-
'$hasPopupIcon &, $hasClearIcon &': {
|
46835 |
-
paddingRight: 26 + 4 + 9
|
46836 |
-
},
|
46837 |
-
'$hasPopupIcon$hasClearIcon &': {
|
46838 |
-
paddingRight: 52 + 4 + 9
|
46839 |
-
},
|
46840 |
-
'& $input': {
|
46841 |
-
padding: '9.5px 4px'
|
46842 |
-
},
|
46843 |
-
'& $input:first-child': {
|
46844 |
-
paddingLeft: 6
|
46845 |
-
},
|
46846 |
-
'& $endAdornment': {
|
46847 |
-
right: 9
|
46848 |
-
}
|
46849 |
-
},
|
46850 |
-
'&[class*="MuiOutlinedInput-root"][class*="MuiOutlinedInput-marginDense"]': {
|
46851 |
-
padding: 6,
|
46852 |
-
'& $input': {
|
46853 |
-
padding: '4.5px 4px'
|
46854 |
-
}
|
46855 |
-
},
|
46856 |
-
'&[class*="MuiFilledInput-root"]': {
|
46857 |
-
paddingTop: 19,
|
46858 |
-
paddingLeft: 8,
|
46859 |
-
'$hasPopupIcon &, $hasClearIcon &': {
|
46860 |
-
paddingRight: 26 + 4 + 9
|
46861 |
-
},
|
46862 |
-
'$hasPopupIcon$hasClearIcon &': {
|
46863 |
-
paddingRight: 52 + 4 + 9
|
46864 |
-
},
|
46865 |
-
'& $input': {
|
46866 |
-
padding: '9px 4px'
|
46867 |
-
},
|
46868 |
-
'& $endAdornment': {
|
46869 |
-
right: 9
|
46870 |
-
}
|
46871 |
-
},
|
46872 |
-
'&[class*="MuiFilledInput-root"][class*="MuiFilledInput-marginDense"]': {
|
46873 |
-
paddingBottom: 1,
|
46874 |
-
'& $input': {
|
46875 |
-
padding: '4.5px 4px'
|
46876 |
-
}
|
46877 |
-
}
|
46878 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
46879 |
|
46880 |
-
/* Styles applied to the input element. */
|
46881 |
-
input: {
|
46882 |
-
flexGrow: 1,
|
46883 |
-
textOverflow: 'ellipsis',
|
46884 |
-
opacity: 0
|
46885 |
-
},
|
46886 |
|
46887 |
-
/* Styles applied to the input element if tag focused. */
|
46888 |
-
inputFocused: {
|
46889 |
-
opacity: 1
|
46890 |
-
},
|
46891 |
|
46892 |
-
/* Styles applied to the endAdornment element. */
|
46893 |
-
endAdornment: {
|
46894 |
-
// We use a position absolute to support wrapping tags.
|
46895 |
-
position: 'absolute',
|
46896 |
-
right: 0,
|
46897 |
-
top: 'calc(50% - 14px)' // Center vertically
|
46898 |
|
46899 |
-
},
|
46900 |
|
46901 |
-
/* Styles applied to the clear indicator. */
|
46902 |
-
clearIndicator: {
|
46903 |
-
marginRight: -2,
|
46904 |
-
padding: 4,
|
46905 |
-
visibility: 'hidden'
|
46906 |
-
},
|
46907 |
|
46908 |
-
/* Styles applied to the clear indicator if the input is dirty. */
|
46909 |
-
clearIndicatorDirty: {},
|
46910 |
|
46911 |
-
/* Styles applied to the popup indicator. */
|
46912 |
-
popupIndicator: {
|
46913 |
-
padding: 2,
|
46914 |
-
marginRight: -2
|
46915 |
-
},
|
46916 |
|
46917 |
-
/* Styles applied to the popup indicator if the popup is open. */
|
46918 |
-
popupIndicatorOpen: {
|
46919 |
-
transform: 'rotate(180deg)'
|
46920 |
-
},
|
46921 |
|
46922 |
-
/* Styles applied to the popper element. */
|
46923 |
-
popper: {
|
46924 |
-
zIndex: theme.zIndex.modal
|
46925 |
-
},
|
46926 |
|
46927 |
-
|
46928 |
-
|
46929 |
-
position: 'absolute'
|
46930 |
-
},
|
46931 |
|
46932 |
-
|
46933 |
-
|
46934 |
-
|
46935 |
-
|
46936 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46937 |
|
46938 |
-
/* Styles applied to the `
|
46939 |
-
|
46940 |
-
|
46941 |
-
|
46942 |
-
|
46943 |
-
|
46944 |
-
|
46945 |
},
|
46946 |
|
46947 |
-
/* Styles applied to the
|
46948 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46949 |
color: theme.palette.text.secondary,
|
46950 |
-
|
|
|
|
|
|
|
|
|
|
|
46951 |
},
|
46952 |
|
46953 |
-
/* Styles applied to the
|
46954 |
-
|
46955 |
color: theme.palette.text.secondary,
|
46956 |
-
|
|
|
|
|
|
|
|
|
|
|
46957 |
},
|
46958 |
|
46959 |
-
/*
|
46960 |
-
|
46961 |
-
minHeight: 48,
|
46962 |
-
display: 'flex',
|
46963 |
-
justifyContent: 'flex-start',
|
46964 |
-
alignItems: 'center',
|
46965 |
-
cursor: 'pointer',
|
46966 |
-
paddingTop: 6,
|
46967 |
-
boxSizing: 'border-box',
|
46968 |
-
outline: '0',
|
46969 |
-
WebkitTapHighlightColor: 'transparent',
|
46970 |
-
paddingBottom: 6,
|
46971 |
-
paddingLeft: 16,
|
46972 |
-
paddingRight: 16
|
46973 |
-
}, (0,defineProperty/* default */.Z)(_option, theme.breakpoints.up('sm'), {
|
46974 |
-
minHeight: 'auto'
|
46975 |
-
}), (0,defineProperty/* default */.Z)(_option, '&[aria-selected="true"]', {
|
46976 |
-
backgroundColor: theme.palette.action.selected
|
46977 |
-
}), (0,defineProperty/* default */.Z)(_option, '&[data-focus="true"]', {
|
46978 |
-
backgroundColor: theme.palette.action.hover
|
46979 |
-
}), (0,defineProperty/* default */.Z)(_option, '&:active', {
|
46980 |
-
backgroundColor: theme.palette.action.selected
|
46981 |
-
}), (0,defineProperty/* default */.Z)(_option, '&[aria-disabled="true"]', {
|
46982 |
-
opacity: theme.palette.action.disabledOpacity,
|
46983 |
-
pointerEvents: 'none'
|
46984 |
-
}), _option),
|
46985 |
|
46986 |
-
/*
|
46987 |
-
|
46988 |
-
|
46989 |
-
|
|
|
|
|
|
|
|
|
|
|
46990 |
},
|
46991 |
|
46992 |
-
/* Styles applied to the
|
46993 |
-
|
46994 |
-
|
46995 |
-
|
46996 |
-
|
46997 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46998 |
}
|
46999 |
};
|
47000 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47001 |
|
47002 |
-
function
|
47003 |
-
|
47004 |
-
|
47005 |
-
|
47006 |
-
other = (0,objectWithoutProperties/* default */.Z)(props, ["anchorEl", "open"]);
|
47007 |
|
47008 |
-
|
47009 |
-
|
|
|
|
|
47010 |
|
47011 |
-
var
|
47012 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47013 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47014 |
|
47015 |
-
|
|
|
|
|
|
|
47016 |
|
47017 |
-
var
|
47018 |
-
|
47019 |
-
|
47020 |
-
|
47021 |
-
|
47022 |
-
|
47023 |
-
|
47024 |
-
|
47025 |
-
|
47026 |
-
|
47027 |
-
|
47028 |
-
|
47029 |
-
|
47030 |
-
|
47031 |
-
clearOnBlur = _props$clearOnBlur === void 0 ? !props.freeSolo : _props$clearOnBlur,
|
47032 |
-
_props$clearOnEscape = props.clearOnEscape,
|
47033 |
-
clearOnEscape = _props$clearOnEscape === void 0 ? false : _props$clearOnEscape,
|
47034 |
-
_props$clearText = props.clearText,
|
47035 |
-
clearText = _props$clearText === void 0 ? 'Clear' : _props$clearText,
|
47036 |
-
_props$closeIcon = props.closeIcon,
|
47037 |
-
closeIcon = _props$closeIcon === void 0 ? Autocomplete_ref : _props$closeIcon,
|
47038 |
-
_props$closeText = props.closeText,
|
47039 |
-
closeText = _props$closeText === void 0 ? 'Close' : _props$closeText,
|
47040 |
-
_props$debug = props.debug,
|
47041 |
-
debug = _props$debug === void 0 ? false : _props$debug,
|
47042 |
-
_props$defaultValue = props.defaultValue,
|
47043 |
-
defaultValue = _props$defaultValue === void 0 ? props.multiple ? [] : null : _props$defaultValue,
|
47044 |
-
_props$disableClearab = props.disableClearable,
|
47045 |
-
disableClearable = _props$disableClearab === void 0 ? false : _props$disableClearab,
|
47046 |
-
_props$disableCloseOn = props.disableCloseOnSelect,
|
47047 |
-
disableCloseOnSelect = _props$disableCloseOn === void 0 ? false : _props$disableCloseOn,
|
47048 |
-
_props$disabled = props.disabled,
|
47049 |
-
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
47050 |
-
_props$disabledItemsF = props.disabledItemsFocusable,
|
47051 |
-
disabledItemsFocusable = _props$disabledItemsF === void 0 ? false : _props$disabledItemsF,
|
47052 |
-
_props$disableListWra = props.disableListWrap,
|
47053 |
-
disableListWrap = _props$disableListWra === void 0 ? false : _props$disableListWra,
|
47054 |
-
_props$disablePortal = props.disablePortal,
|
47055 |
-
disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal,
|
47056 |
-
filterOptions = props.filterOptions,
|
47057 |
-
_props$filterSelected = props.filterSelectedOptions,
|
47058 |
-
filterSelectedOptions = _props$filterSelected === void 0 ? false : _props$filterSelected,
|
47059 |
-
_props$forcePopupIcon = props.forcePopupIcon,
|
47060 |
-
forcePopupIcon = _props$forcePopupIcon === void 0 ? 'auto' : _props$forcePopupIcon,
|
47061 |
-
_props$freeSolo = props.freeSolo,
|
47062 |
-
freeSolo = _props$freeSolo === void 0 ? false : _props$freeSolo,
|
47063 |
-
_props$fullWidth = props.fullWidth,
|
47064 |
-
fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,
|
47065 |
-
_props$getLimitTagsTe = props.getLimitTagsText,
|
47066 |
-
getLimitTagsText = _props$getLimitTagsTe === void 0 ? function (more) {
|
47067 |
-
return "+".concat(more);
|
47068 |
-
} : _props$getLimitTagsTe,
|
47069 |
-
getOptionDisabled = props.getOptionDisabled,
|
47070 |
-
_props$getOptionLabel = props.getOptionLabel,
|
47071 |
-
getOptionLabel = _props$getOptionLabel === void 0 ? function (x) {
|
47072 |
-
return x;
|
47073 |
-
} : _props$getOptionLabel,
|
47074 |
-
getOptionSelected = props.getOptionSelected,
|
47075 |
-
groupBy = props.groupBy,
|
47076 |
-
_props$handleHomeEndK = props.handleHomeEndKeys,
|
47077 |
-
handleHomeEndKeys = _props$handleHomeEndK === void 0 ? !props.freeSolo : _props$handleHomeEndK,
|
47078 |
-
idProp = props.id,
|
47079 |
-
_props$includeInputIn = props.includeInputInList,
|
47080 |
-
includeInputInList = _props$includeInputIn === void 0 ? false : _props$includeInputIn,
|
47081 |
-
inputValueProp = props.inputValue,
|
47082 |
-
_props$limitTags = props.limitTags,
|
47083 |
-
limitTags = _props$limitTags === void 0 ? -1 : _props$limitTags,
|
47084 |
-
_props$ListboxCompone = props.ListboxComponent,
|
47085 |
-
ListboxComponent = _props$ListboxCompone === void 0 ? 'ul' : _props$ListboxCompone,
|
47086 |
-
ListboxProps = props.ListboxProps,
|
47087 |
-
_props$loading = props.loading,
|
47088 |
-
loading = _props$loading === void 0 ? false : _props$loading,
|
47089 |
-
_props$loadingText = props.loadingText,
|
47090 |
-
loadingText = _props$loadingText === void 0 ? 'Loading…' : _props$loadingText,
|
47091 |
-
_props$multiple = props.multiple,
|
47092 |
-
multiple = _props$multiple === void 0 ? false : _props$multiple,
|
47093 |
-
_props$noOptionsText = props.noOptionsText,
|
47094 |
-
noOptionsText = _props$noOptionsText === void 0 ? 'No options' : _props$noOptionsText,
|
47095 |
-
onChange = props.onChange,
|
47096 |
-
onClose = props.onClose,
|
47097 |
-
onHighlightChange = props.onHighlightChange,
|
47098 |
-
onInputChange = props.onInputChange,
|
47099 |
-
onOpen = props.onOpen,
|
47100 |
-
open = props.open,
|
47101 |
-
_props$openOnFocus = props.openOnFocus,
|
47102 |
-
openOnFocus = _props$openOnFocus === void 0 ? false : _props$openOnFocus,
|
47103 |
-
_props$openText = props.openText,
|
47104 |
-
openText = _props$openText === void 0 ? 'Open' : _props$openText,
|
47105 |
-
options = props.options,
|
47106 |
-
_props$PaperComponent = props.PaperComponent,
|
47107 |
-
PaperComponent = _props$PaperComponent === void 0 ? Paper_Paper : _props$PaperComponent,
|
47108 |
-
_props$PopperComponen = props.PopperComponent,
|
47109 |
-
PopperComponentProp = _props$PopperComponen === void 0 ? esm_Popper_Popper : _props$PopperComponen,
|
47110 |
-
_props$popupIcon = props.popupIcon,
|
47111 |
-
popupIcon = _props$popupIcon === void 0 ? Autocomplete_ref2 : _props$popupIcon,
|
47112 |
-
renderGroupProp = props.renderGroup,
|
47113 |
-
renderInput = props.renderInput,
|
47114 |
-
renderOptionProp = props.renderOption,
|
47115 |
-
renderTags = props.renderTags,
|
47116 |
-
_props$selectOnFocus = props.selectOnFocus,
|
47117 |
-
selectOnFocus = _props$selectOnFocus === void 0 ? !props.freeSolo : _props$selectOnFocus,
|
47118 |
-
_props$size = props.size,
|
47119 |
-
size = _props$size === void 0 ? 'medium' : _props$size,
|
47120 |
-
valueProp = props.value,
|
47121 |
-
other = (0,objectWithoutProperties/* default */.Z)(props, ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "classes", "className", "clearOnBlur", "clearOnEscape", "clearText", "closeIcon", "closeText", "debug", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "getOptionSelected", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"]);
|
47122 |
-
/* eslint-enable no-unused-vars */
|
47123 |
|
|
|
|
|
|
|
|
|
47124 |
|
47125 |
-
|
|
|
|
|
|
|
47126 |
|
47127 |
-
|
47128 |
-
|
47129 |
-
|
47130 |
-
|
47131 |
-
|
47132 |
-
|
47133 |
-
|
47134 |
-
|
47135 |
-
|
47136 |
-
|
47137 |
-
|
47138 |
-
|
47139 |
-
|
47140 |
-
|
47141 |
-
|
47142 |
-
|
47143 |
-
|
47144 |
-
|
47145 |
-
|
47146 |
-
|
47147 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47148 |
|
47149 |
-
|
|
|
|
|
47150 |
|
47151 |
-
|
47152 |
-
|
47153 |
-
|
47154 |
-
|
47155 |
-
|
47156 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47157 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47158 |
|
47159 |
-
if (renderTags) {
|
47160 |
-
startAdornment = renderTags(value, getCustomizedTagProps);
|
47161 |
-
} else {
|
47162 |
-
startAdornment = value.map(function (option, index) {
|
47163 |
-
return /*#__PURE__*/react.createElement(Chip_Chip, (0,esm_extends/* default */.Z)({
|
47164 |
-
label: getOptionLabel(option),
|
47165 |
-
size: size
|
47166 |
-
}, getCustomizedTagProps({
|
47167 |
-
index: index
|
47168 |
-
}), ChipProps));
|
47169 |
-
});
|
47170 |
-
}
|
47171 |
-
}
|
47172 |
|
47173 |
-
if (limitTags > -1 && Array.isArray(startAdornment)) {
|
47174 |
-
var more = startAdornment.length - limitTags;
|
47175 |
|
47176 |
-
if (!focused && more > 0) {
|
47177 |
-
startAdornment = startAdornment.splice(0, limitTags);
|
47178 |
-
startAdornment.push( /*#__PURE__*/react.createElement("span", {
|
47179 |
-
className: classes.tag,
|
47180 |
-
key: startAdornment.length
|
47181 |
-
}, getLimitTagsText(more)));
|
47182 |
-
}
|
47183 |
-
}
|
47184 |
|
47185 |
-
var defaultRenderGroup = function defaultRenderGroup(params) {
|
47186 |
-
return /*#__PURE__*/react.createElement("li", {
|
47187 |
-
key: params.key
|
47188 |
-
}, /*#__PURE__*/react.createElement(ListSubheader_ListSubheader, {
|
47189 |
-
className: classes.groupLabel,
|
47190 |
-
component: "div"
|
47191 |
-
}, params.group), /*#__PURE__*/react.createElement("ul", {
|
47192 |
-
className: classes.groupUl
|
47193 |
-
}, params.children));
|
47194 |
-
};
|
47195 |
|
47196 |
-
var renderGroup = renderGroupProp || defaultRenderGroup;
|
47197 |
-
var renderOption = renderOptionProp || getOptionLabel;
|
47198 |
|
47199 |
-
var renderListOption = function renderListOption(option, index) {
|
47200 |
-
var optionProps = getOptionProps({
|
47201 |
-
option: option,
|
47202 |
-
index: index
|
47203 |
-
});
|
47204 |
-
return /*#__PURE__*/react.createElement("li", (0,esm_extends/* default */.Z)({}, optionProps, {
|
47205 |
-
className: classes.option
|
47206 |
-
}), renderOption(option, {
|
47207 |
-
selected: optionProps['aria-selected'],
|
47208 |
-
inputValue: inputValue
|
47209 |
-
}));
|
47210 |
-
};
|
47211 |
|
47212 |
-
|
47213 |
-
|
47214 |
-
|
47215 |
-
|
47216 |
-
|
47217 |
-
|
47218 |
-
|
47219 |
-
|
47220 |
-
fullWidth: true,
|
47221 |
-
size: size === 'small' ? 'small' : undefined,
|
47222 |
-
InputLabelProps: getInputLabelProps(),
|
47223 |
-
InputProps: {
|
47224 |
-
ref: setAnchorEl,
|
47225 |
-
className: classes.inputRoot,
|
47226 |
-
startAdornment: startAdornment,
|
47227 |
-
endAdornment: /*#__PURE__*/react.createElement("div", {
|
47228 |
-
className: classes.endAdornment
|
47229 |
-
}, hasClearIcon ? /*#__PURE__*/react.createElement(IconButton_IconButton, (0,esm_extends/* default */.Z)({}, getClearProps(), {
|
47230 |
-
"aria-label": clearText,
|
47231 |
-
title: clearText,
|
47232 |
-
className: (0,clsx_m/* default */.Z)(classes.clearIndicator, dirty && classes.clearIndicatorDirty)
|
47233 |
-
}), closeIcon) : null, hasPopupIcon ? /*#__PURE__*/react.createElement(IconButton_IconButton, (0,esm_extends/* default */.Z)({}, getPopupIndicatorProps(), {
|
47234 |
-
disabled: disabled,
|
47235 |
-
"aria-label": popupOpen ? closeText : openText,
|
47236 |
-
title: popupOpen ? closeText : openText,
|
47237 |
-
className: (0,clsx_m/* default */.Z)(classes.popupIndicator, popupOpen && classes.popupIndicatorOpen)
|
47238 |
-
}), popupIcon) : null)
|
47239 |
},
|
47240 |
-
|
47241 |
-
|
47242 |
-
disabled: disabled
|
47243 |
-
}, getInputProps())
|
47244 |
-
})), popupOpen && anchorEl ? /*#__PURE__*/react.createElement(PopperComponent, {
|
47245 |
-
className: (0,clsx_m/* default */.Z)(classes.popper, disablePortal && classes.popperDisablePortal),
|
47246 |
-
style: {
|
47247 |
-
width: anchorEl ? anchorEl.clientWidth : null
|
47248 |
},
|
47249 |
-
|
47250 |
-
|
47251 |
-
|
47252 |
-
|
47253 |
-
|
47254 |
-
|
47255 |
-
|
47256 |
-
}, loadingText) : null, groupedOptions.length === 0 && !freeSolo && !loading ? /*#__PURE__*/react.createElement("div", {
|
47257 |
-
className: classes.noOptions
|
47258 |
-
}, noOptionsText) : null, groupedOptions.length > 0 ? /*#__PURE__*/react.createElement(ListboxComponent, (0,esm_extends/* default */.Z)({
|
47259 |
-
className: classes.listbox
|
47260 |
-
}, getListboxProps(), ListboxProps), groupedOptions.map(function (option, index) {
|
47261 |
-
if (groupBy) {
|
47262 |
-
return renderGroup({
|
47263 |
-
key: option.key,
|
47264 |
-
group: option.group,
|
47265 |
-
children: option.options.map(function (option2, index2) {
|
47266 |
-
return renderListOption(option2, option.index + index2);
|
47267 |
-
})
|
47268 |
-
});
|
47269 |
}
|
|
|
|
|
|
|
|
|
|
|
47270 |
|
47271 |
-
|
47272 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47273 |
});
|
47274 |
false ? 0 : void 0;
|
47275 |
-
/* harmony default export */ var
|
47276 |
-
name: '
|
47277 |
-
})(
|
47278 |
-
|
47279 |
-
var lodash_find = __webpack_require__(13311);
|
47280 |
-
var find_default = /*#__PURE__*/__webpack_require__.n(lodash_find);
|
47281 |
-
// EXTERNAL MODULE: ./node_modules/lodash/map.js
|
47282 |
-
var map = __webpack_require__(35161);
|
47283 |
-
var map_default = /*#__PURE__*/__webpack_require__.n(map);
|
47284 |
-
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Dialogs/TemplatesDialog/FilterTemplateOptions.js
|
47285 |
-
function FilterTemplateOptions_extends() { FilterTemplateOptions_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return FilterTemplateOptions_extends.apply(this, arguments); }
|
47286 |
|
47287 |
-
function FilterTemplateOptions_slicedToArray(arr, i) { return FilterTemplateOptions_arrayWithHoles(arr) || FilterTemplateOptions_iterableToArrayLimit(arr, i) || FilterTemplateOptions_unsupportedIterableToArray(arr, i) || FilterTemplateOptions_nonIterableRest(); }
|
47288 |
|
47289 |
-
|
|
|
|
|
47290 |
|
47291 |
-
|
|
|
|
|
|
|
47292 |
|
47293 |
-
function FilterTemplateOptions_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
47294 |
|
47295 |
-
|
|
|
|
|
47296 |
|
47297 |
-
|
|
|
|
|
|
|
47298 |
|
47299 |
|
47300 |
|
|
|
47301 |
|
47302 |
|
47303 |
|
47304 |
|
47305 |
|
47306 |
|
47307 |
-
var FilterTemplateOptions = function FilterTemplateOptions(_ref) {
|
47308 |
-
var _ref$filterOptions = _ref.filterOptions,
|
47309 |
-
filterOptions = _ref$filterOptions === void 0 ? [] : _ref$filterOptions,
|
47310 |
-
setFilterOptions = _ref.setFilterOptions,
|
47311 |
-
filterList = _ref.filterList,
|
47312 |
-
label = _ref.label,
|
47313 |
-
setReturnedTemplates = _ref.setReturnedTemplates,
|
47314 |
-
button = _ref.button;
|
47315 |
|
47316 |
-
|
47317 |
-
|
47318 |
-
|
47319 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
47320 |
|
47321 |
-
|
47322 |
-
|
47323 |
-
|
47324 |
-
|
|
|
|
|
|
|
|
|
47325 |
|
47326 |
-
|
47327 |
-
|
47328 |
-
|
47329 |
-
setCurrentText = _useState6[1];
|
47330 |
|
47331 |
-
|
47332 |
-
|
47333 |
-
|
47334 |
-
|
47335 |
-
|
47336 |
-
|
47337 |
-
|
47338 |
-
|
47339 |
-
|
47340 |
-
|
47341 |
-
|
47342 |
-
|
47343 |
-
|
47344 |
-
|
47345 |
-
|
47346 |
-
|
47347 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47348 |
},
|
47349 |
-
|
47350 |
-
|
47351 |
-
|
47352 |
-
|
47353 |
-
}) : filterList,
|
47354 |
-
value: filterOptions.map(function (item) {
|
47355 |
-
return find_default()(filterList, function (obj) {
|
47356 |
-
return obj.value === item;
|
47357 |
-
});
|
47358 |
-
}),
|
47359 |
-
onChange: function onChange(event, newValue) {
|
47360 |
-
setFilterOptions(map_default()(newValue, "value"));
|
47361 |
-
setCurrentText("");
|
47362 |
-
newValue.length ? setReturnedTemplates(true) : setReturnedTemplates(false);
|
47363 |
},
|
47364 |
-
|
47365 |
-
|
|
|
|
|
47366 |
},
|
47367 |
-
|
47368 |
-
|
|
|
|
|
47369 |
},
|
47370 |
-
|
47371 |
-
|
|
|
|
|
47372 |
},
|
47373 |
-
|
47374 |
-
|
|
|
|
|
|
|
|
|
|
|
47375 |
},
|
47376 |
-
|
47377 |
-
|
47378 |
-
|
47379 |
-
|
47380 |
-
|
47381 |
-
fontSize: "0.8em"
|
47382 |
-
},
|
47383 |
-
"data-testid": "filter-dropdown-icon"
|
47384 |
-
}),
|
47385 |
-
renderInput: function renderInput(params) {
|
47386 |
-
return /*#__PURE__*/react.createElement(TextField_TextField, FilterTemplateOptions_extends({}, params, {
|
47387 |
-
onChange: function onChange(e) {
|
47388 |
-
setCurrentText(e.target.value);
|
47389 |
-
},
|
47390 |
-
label: label,
|
47391 |
-
variant: "outlined",
|
47392 |
-
"data-testid": "filter-dropdown-input"
|
47393 |
-
}));
|
47394 |
},
|
47395 |
-
|
47396 |
-
|
47397 |
-
|
47398 |
-
|
47399 |
-
|
47400 |
-
|
47401 |
-
|
47402 |
-
|
47403 |
-
|
|
|
|
|
47404 |
},
|
47405 |
-
|
47406 |
-
|
47407 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47408 |
};
|
47409 |
-
|
47410 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47411 |
|
47412 |
-
|
47413 |
|
47414 |
-
|
|
|
47415 |
|
47416 |
-
|
|
|
47417 |
|
47418 |
-
|
47419 |
|
47420 |
-
|
|
|
|
|
47421 |
|
|
|
|
|
|
|
|
|
|
|
47422 |
|
|
|
|
|
47423 |
|
|
|
|
|
|
|
47424 |
|
|
|
47425 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47426 |
|
|
|
47427 |
|
|
|
|
|
|
|
|
|
|
|
47428 |
|
|
|
|
|
|
|
|
|
|
|
47429 |
|
47430 |
-
function
|
47431 |
-
|
47432 |
-
|
47433 |
-
_ref$showButtons = _ref.showButtons,
|
47434 |
-
showButtons = _ref$showButtons === void 0 ? false : _ref$showButtons,
|
47435 |
-
index = _ref.index,
|
47436 |
-
currentGroup = _ref.currentGroup;
|
47437 |
|
47438 |
-
var
|
47439 |
-
|
47440 |
-
filterPopularAction = _useState2[0],
|
47441 |
-
setFilterPopularAction = _useState2[1];
|
47442 |
|
47443 |
-
|
47444 |
-
|
47445 |
-
|
47446 |
-
|
47447 |
|
47448 |
-
|
47449 |
-
|
47450 |
-
filterButtons = _useState6[0],
|
47451 |
-
setFilterButtons = _useState6[1];
|
47452 |
|
47453 |
-
|
47454 |
-
|
47455 |
-
returnedTemplates = _useState8[0],
|
47456 |
-
setReturnedTemplates = _useState8[1];
|
47457 |
|
47458 |
-
var
|
47459 |
-
|
47460 |
-
setFilterButtons(showButtons ? "button" : "group");
|
47461 |
-
setReturnedTemplates(false);
|
47462 |
-
setFilterPopularAction([]);
|
47463 |
-
setFilterFrameDesign([]);
|
47464 |
};
|
47465 |
|
47466 |
-
var
|
47467 |
-
|
47468 |
-
|
47469 |
-
}, {
|
47470 |
-
label: "Business",
|
47471 |
-
value: "business"
|
47472 |
-
}, {
|
47473 |
-
label: "Contact",
|
47474 |
-
value: "contact"
|
47475 |
-
}, {
|
47476 |
-
label: "Actions",
|
47477 |
-
value: "actions"
|
47478 |
-
}, {
|
47479 |
-
label: "Social sharing",
|
47480 |
-
value: "social-sharing"
|
47481 |
-
}];
|
47482 |
-
return /*#__PURE__*/react.createElement(Dialog_Dialog, {
|
47483 |
-
open: open,
|
47484 |
-
onClose: function onClose() {
|
47485 |
-
handleCloseDialog();
|
47486 |
-
},
|
47487 |
-
maxWidth: "md",
|
47488 |
-
fullWidth: true,
|
47489 |
-
className: "templates-dialog",
|
47490 |
-
"data-testid": "dialog:templates-dialog",
|
47491 |
-
scroll: "paper"
|
47492 |
-
}, /*#__PURE__*/react.createElement("div", {
|
47493 |
-
className: "header"
|
47494 |
-
}, /*#__PURE__*/react.createElement("div", {
|
47495 |
-
className: "titles"
|
47496 |
-
}, /*#__PURE__*/react.createElement(DialogTitle_DialogTitle, {
|
47497 |
-
className: "title"
|
47498 |
-
}, filterButtons === "button" ? translate("utils.new_button") : translate("utils.new_group")), /*#__PURE__*/react.createElement("h3", {
|
47499 |
-
className: "subtitle"
|
47500 |
-
}, translate("templates.all_templates_description"))), /*#__PURE__*/react.createElement(IconButton_IconButton, {
|
47501 |
-
onClick: function onClick() {
|
47502 |
-
handleCloseDialog();
|
47503 |
-
},
|
47504 |
-
className: "close-button",
|
47505 |
-
"data-testid": "templates-dialog:close-button"
|
47506 |
-
}, /*#__PURE__*/react.createElement(Icon_Icon, {
|
47507 |
-
fontSize: "inherit",
|
47508 |
-
className: "fas fa-times"
|
47509 |
-
}))), /*#__PURE__*/react.createElement("div", {
|
47510 |
-
className: "container-filter-buttons"
|
47511 |
-
}, /*#__PURE__*/react.createElement(DialogContent_DialogContent, {
|
47512 |
-
dividers: true,
|
47513 |
-
className: "midsection"
|
47514 |
-
}, /*#__PURE__*/react.createElement("div", {
|
47515 |
-
className: "button-group"
|
47516 |
-
}, /*#__PURE__*/react.createElement("div", {
|
47517 |
-
className: "buttons-title"
|
47518 |
-
}, translate("templates.number_of_buttons")), /*#__PURE__*/react.createElement("div", {
|
47519 |
-
className: "buttons"
|
47520 |
-
}, /*#__PURE__*/react.createElement("div", {
|
47521 |
-
className: "buttons-numbers"
|
47522 |
-
}, /*#__PURE__*/react.createElement(Button_Button, {
|
47523 |
-
onClick: function onClick() {
|
47524 |
-
setFilterButtons("button");
|
47525 |
-
setFilterPopularAction([]);
|
47526 |
-
setReturnedTemplates(false);
|
47527 |
-
},
|
47528 |
-
className: ("button", filterButtons === "button" ? "current" : null),
|
47529 |
-
variant: "outlined",
|
47530 |
-
style: {
|
47531 |
-
borderRadius: "20px",
|
47532 |
-
marginRight: "10px"
|
47533 |
-
},
|
47534 |
-
"data-testid": "templates:filter-buttons-button"
|
47535 |
-
}, "1"), /*#__PURE__*/react.createElement(Button_Button, {
|
47536 |
-
disabled: showButtons,
|
47537 |
-
onClick: function onClick() {
|
47538 |
-
setFilterButtons("group");
|
47539 |
-
setFilterFrameDesign([]);
|
47540 |
-
setReturnedTemplates(false);
|
47541 |
-
},
|
47542 |
-
className: ("button", filterButtons === "group" ? "current" : null),
|
47543 |
-
variant: "outlined",
|
47544 |
-
style: {
|
47545 |
-
borderRadius: "20px"
|
47546 |
-
},
|
47547 |
-
"data-testid": "templates:filter-buttons-group"
|
47548 |
-
}, "2 +")))), filterButtons === "group" && /*#__PURE__*/react.createElement(FilterTemplateOptions, {
|
47549 |
-
filterOptions: filterFrameDesign,
|
47550 |
-
setFilterOptions: setFilterFrameDesign,
|
47551 |
-
filterList: frameDesignList,
|
47552 |
-
label: translate("templates.framedesign.label"),
|
47553 |
-
setReturnedTemplates: setReturnedTemplates
|
47554 |
-
}), filterButtons === "button" && /*#__PURE__*/react.createElement(FilterTemplateOptions, {
|
47555 |
-
filterOptions: filterPopularAction,
|
47556 |
-
setFilterOptions: setFilterPopularAction,
|
47557 |
-
filterList: ButtonActionOptions,
|
47558 |
-
label: translate("templates.popular_actions.label"),
|
47559 |
-
setReturnedTemplates: setReturnedTemplates,
|
47560 |
-
button: true
|
47561 |
-
}))), /*#__PURE__*/react.createElement(TemplateOptions, {
|
47562 |
-
onClose: handleCloseDialog,
|
47563 |
-
index: index,
|
47564 |
-
currentGroup: currentGroup,
|
47565 |
-
returnedTemplates: returnedTemplates,
|
47566 |
-
filterButtons: filterButtons,
|
47567 |
-
filterFrameDesign: filterFrameDesign,
|
47568 |
-
filterPopularAction: filterPopularAction
|
47569 |
-
}));
|
47570 |
-
}
|
47571 |
|
47572 |
-
|
47573 |
-
|
47574 |
-
|
47575 |
-
|
47576 |
-
|
|
|
47577 |
|
47578 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47579 |
|
47580 |
-
|
|
|
|
|
|
|
47581 |
|
47582 |
-
|
|
|
|
|
47583 |
|
47584 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
47585 |
|
47586 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47587 |
|
47588 |
-
|
|
|
|
|
|
|
|
|
47589 |
|
47590 |
-
|
|
|
|
|
47591 |
|
47592 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47593 |
|
47594 |
-
|
47595 |
|
47596 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47597 |
|
47598 |
-
|
|
|
|
|
|
|
47599 |
|
|
|
|
|
|
|
|
|
|
|
47600 |
|
|
|
|
|
|
|
47601 |
|
|
|
|
|
|
|
|
|
|
|
47602 |
|
|
|
|
|
|
|
|
|
47603 |
|
|
|
|
|
|
|
47604 |
|
|
|
|
|
|
|
47605 |
|
|
|
|
|
|
|
47606 |
|
|
|
|
|
|
|
47607 |
|
|
|
|
|
|
|
|
|
|
|
47608 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47609 |
|
47610 |
|
47611 |
|
47612 |
|
|
|
|
|
|
|
|
|
|
|
|
|
47613 |
|
|
|
|
|
|
|
47614 |
|
|
|
47615 |
|
|
|
47616 |
|
|
|
47617 |
|
|
|
47618 |
|
|
|
47619 |
|
47620 |
|
47621 |
|
47622 |
|
47623 |
|
47624 |
|
47625 |
-
function ButtonGroupContainer_getStyle(style, snapshot) {
|
47626 |
-
if (!snapshot.isDropAnimating) {
|
47627 |
-
return style;
|
47628 |
-
} // patching the existing style
|
47629 |
|
47630 |
|
47631 |
-
|
47632 |
-
|
47633 |
-
|
47634 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
47635 |
|
47636 |
-
function
|
47637 |
-
var
|
|
|
47638 |
groups = _ref.groups,
|
47639 |
-
|
47640 |
-
|
47641 |
-
|
47642 |
-
getButtonsCount = _ref.getButtonsCount,
|
47643 |
-
getGroupCount = _ref.getGroupCount,
|
47644 |
-
removeGroup = _ref.removeGroup,
|
47645 |
-
duplicateGroup = _ref.duplicateGroup,
|
47646 |
-
isNewGroup = _ref.isNewGroup;
|
47647 |
-
|
47648 |
-
var _useState = (0,react.useState)(getCookie("buttonizer_bar_state_opened") ? dlv_umd_default()(JSON.parse(getCookie("buttonizer_bar_state_opened")), groupId, false) : false),
|
47649 |
-
_useState2 = ButtonGroupContainer_slicedToArray(_useState, 2),
|
47650 |
-
opened = _useState2[0],
|
47651 |
-
setOpened = _useState2[1];
|
47652 |
|
47653 |
-
|
47654 |
-
|
47655 |
-
|
47656 |
-
setNewButtonDialogOpened = _useState4[1];
|
47657 |
|
47658 |
-
var
|
47659 |
-
|
47660 |
-
|
47661 |
-
|
47662 |
|
47663 |
-
var
|
47664 |
-
var openCollapsibleGroup = useSelector(function (store) {
|
47665 |
-
return dlv_umd_default()(store, "misc.open_collapsible_group", "button_group_container");
|
47666 |
-
});
|
47667 |
|
47668 |
-
var
|
47669 |
-
|
47670 |
-
currentCookie[groupId] = !opened;
|
47671 |
-
setOpened(!opened);
|
47672 |
-
setCookie("buttonizer_bar_state_opened", JSON.stringify(currentCookie));
|
47673 |
};
|
47674 |
|
47675 |
-
|
47676 |
-
|
47677 |
-
|
47678 |
-
groups: groups,
|
47679 |
-
groupId: groupId,
|
47680 |
-
group: group
|
47681 |
-
});
|
47682 |
-
captureException(new Error("group is undefined. Send groups and groupId data"));
|
47683 |
-
});
|
47684 |
-
}
|
47685 |
-
|
47686 |
-
(0,react.useEffect)(function () {
|
47687 |
-
if (openCollapsibleGroup === "button_group_container") {
|
47688 |
-
setOpened(true);
|
47689 |
-
} else {
|
47690 |
-
setOpened(false);
|
47691 |
-
}
|
47692 |
-
}, [openCollapsibleGroup]);
|
47693 |
-
(0,react.useEffect)(function () {
|
47694 |
-
setGroup(groups[groupId]);
|
47695 |
-
}, [groups[groupId]]);
|
47696 |
-
(0,react.useEffect)(function () {
|
47697 |
-
if (isNewGroup) {
|
47698 |
-
if (buttonGroupContainer && buttonGroupContainer.current) buttonGroupContainer.current.scrollIntoView({
|
47699 |
-
behavior: "smooth"
|
47700 |
-
});
|
47701 |
-
}
|
47702 |
-
}, [isNewGroup]);
|
47703 |
|
47704 |
-
var
|
47705 |
-
|
47706 |
-
|
47707 |
-
|
47708 |
-
|
47709 |
-
}
|
47710 |
-
|
47711 |
-
|
47712 |
-
|
47713 |
-
disabled: true
|
47714 |
-
})));
|
47715 |
};
|
47716 |
|
47717 |
-
|
47718 |
-
|
47719 |
-
|
47720 |
-
|
47721 |
-
|
47722 |
-
|
47723 |
-
|
47724 |
-
|
47725 |
-
|
47726 |
-
|
47727 |
-
|
47728 |
-
|
47729 |
-
|
47730 |
-
|
47731 |
-
|
47732 |
-
|
47733 |
-
|
47734 |
-
className: "
|
47735 |
-
|
47736 |
-
|
47737 |
-
|
47738 |
-
|
47739 |
-
|
47740 |
-
|
47741 |
-
return document.location.hash = "#/group/" + group.id;
|
47742 |
-
},
|
47743 |
-
"data-testid": "edit-button-group",
|
47744 |
-
className: "group-actions edit-button"
|
47745 |
-
}), duplicateButton(), /*#__PURE__*/react.createElement(ContainerActionsDropdown, null, /*#__PURE__*/react.createElement(ContainerActions_RenameButton, {
|
47746 |
-
name: group.name,
|
47747 |
-
onChange: function onChange(val) {
|
47748 |
-
return set("groups", group.id, "name", val);
|
47749 |
-
},
|
47750 |
-
inDropdown: true
|
47751 |
-
}), /*#__PURE__*/react.createElement(ExportButton, {
|
47752 |
-
object: group,
|
47753 |
-
type: "group"
|
47754 |
-
}), /*#__PURE__*/react.createElement(ImportButton, {
|
47755 |
-
currentGroup: group,
|
47756 |
-
label: translate("import_export.import.into_group.button"),
|
47757 |
-
kbLink: 653,
|
47758 |
-
inDropdown: true
|
47759 |
-
}), /*#__PURE__*/react.createElement(ContainerActions_DeleteButton, {
|
47760 |
-
model: "group",
|
47761 |
-
"data-testid": "delete-button-group",
|
47762 |
-
buttonCount: getButtonsCount(group.id),
|
47763 |
-
deleteDisabled: getGroupCount() <= 1,
|
47764 |
-
onClose: function onClose() {
|
47765 |
-
return removeGroup(group.id);
|
47766 |
},
|
47767 |
-
|
47768 |
-
|
47769 |
-
|
47770 |
-
}, provided.droppableProps), group.children.map(function (id, key) {
|
47771 |
-
return /*#__PURE__*/react.createElement(PublicDraggable, {
|
47772 |
-
draggableId: id,
|
47773 |
-
index: key,
|
47774 |
-
key: id
|
47775 |
-
}, function (provided, snapshot) {
|
47776 |
-
return /*#__PURE__*/react.createElement(ButtonContainer_ButtonContainer, {
|
47777 |
-
provided: provided // key={key}
|
47778 |
-
,
|
47779 |
-
groupId: group.id,
|
47780 |
-
buttonId: id,
|
47781 |
-
currentDrag: snapshot.isDragging ? " currentDrag" : "",
|
47782 |
-
styleDrop: ButtonGroupContainer_getStyle(provided.draggableProps.style, snapshot),
|
47783 |
-
openNewButtonDialog: function openNewButtonDialog(shiftKey) {
|
47784 |
-
if (shiftKey) return addButton({
|
47785 |
-
name: translate("utils.new_button")
|
47786 |
-
}, group.id, key + 1);
|
47787 |
-
setNewButtonDialogOpened(key + 1);
|
47788 |
-
}
|
47789 |
-
});
|
47790 |
-
});
|
47791 |
-
}), provided.placeholder, /*#__PURE__*/react.createElement("div", {
|
47792 |
-
style: {
|
47793 |
-
textAlign: "center"
|
47794 |
-
}
|
47795 |
-
}, /*#__PURE__*/react.createElement(TemplatesDialog_TemplatesDialog, {
|
47796 |
-
open: newButtonDialogOpened !== false,
|
47797 |
-
currentGroup: group,
|
47798 |
-
onClose: function onClose() {
|
47799 |
-
return setNewButtonDialogOpened(false);
|
47800 |
},
|
47801 |
-
|
47802 |
-
|
47803 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47804 |
}
|
47805 |
|
47806 |
-
|
|
|
47807 |
return {
|
47808 |
-
getButtonsCount: function getButtonsCount(groupId) {
|
47809 |
-
return selectors_getButtonsCount(groupId, state);
|
47810 |
-
},
|
47811 |
-
getGroupCount: function getGroupCount() {
|
47812 |
-
return selectors_getGroupCount(state);
|
47813 |
-
},
|
47814 |
groups: state.groups,
|
47815 |
-
|
47816 |
-
|
47817 |
-
}
|
47818 |
-
return {
|
47819 |
-
set: function set() {
|
47820 |
-
return dispatch(dataActions_set.apply(void 0, arguments));
|
47821 |
-
},
|
47822 |
-
dispatch: dispatch
|
47823 |
};
|
47824 |
-
}
|
47825 |
-
|
47826 |
-
|
47827 |
|
47828 |
-
var dispatch = _ref3.dispatch,
|
47829 |
-
dispatchProps = ButtonGroupContainer_objectWithoutProperties(_ref3, ["dispatch"]);
|
47830 |
|
47831 |
-
return ButtonGroupContainer_objectSpread(ButtonGroupContainer_objectSpread(ButtonGroupContainer_objectSpread({
|
47832 |
-
removeGroup: function removeGroup(id) {
|
47833 |
-
return GroupActions_removeGroup(id, state, dispatch);
|
47834 |
-
},
|
47835 |
-
duplicateGroup: function duplicateGroup(id, payload) {
|
47836 |
-
return GroupActions_duplicateGroup(id, payload, state, dispatch);
|
47837 |
-
}
|
47838 |
-
}, dispatchProps), stateProps), props);
|
47839 |
-
})(ButtonGroupContainer));
|
47840 |
-
;// CONCATENATED MODULE: ./src/js/dashboard/Components/PremiumTag/PremiumTag.js
|
47841 |
|
47842 |
|
47843 |
-
function PremiumTag() {
|
47844 |
-
return /*#__PURE__*/react.createElement("span", {
|
47845 |
-
className: "buttonizer-premium",
|
47846 |
-
"data-testid": "buttonizer-premium-tag"
|
47847 |
-
});
|
47848 |
-
}
|
47849 |
-
;// CONCATENATED MODULE: ./src/js/dashboard/Pages/Overview/Overview.js
|
47850 |
-
function Overview_slicedToArray(arr, i) { return Overview_arrayWithHoles(arr) || Overview_iterableToArrayLimit(arr, i) || Overview_unsupportedIterableToArray(arr, i) || Overview_nonIterableRest(); }
|
47851 |
|
47852 |
-
function Overview_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
47853 |
|
47854 |
-
function Overview_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Overview_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Overview_arrayLikeToArray(o, minLen); }
|
47855 |
|
47856 |
-
function Overview_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
47857 |
|
47858 |
-
function Overview_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
47859 |
|
47860 |
-
function Overview_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
47861 |
|
|
|
|
|
|
|
|
|
|
|
|
|
47862 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47863 |
|
47864 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47865 |
|
|
|
|
|
|
|
47866 |
|
|
|
47867 |
|
|
|
47868 |
|
|
|
47869 |
|
|
|
47870 |
|
|
|
47871 |
|
|
|
47872 |
|
|
|
47873 |
|
|
|
47874 |
|
47875 |
|
47876 |
|
47877 |
|
47878 |
-
function Overview(_ref) {
|
47879 |
-
var _ref$groups = _ref.groups,
|
47880 |
-
groups = _ref$groups === void 0 ? null : _ref$groups,
|
47881 |
-
changeRelation = _ref.changeRelation,
|
47882 |
-
_ref$testDragSensor = _ref.testDragSensor,
|
47883 |
-
testDragSensor = _ref$testDragSensor === void 0 ? function () {} : _ref$testDragSensor,
|
47884 |
-
hasPremium = _ref.hasPremium,
|
47885 |
-
addGroup = _ref.addGroup,
|
47886 |
-
isPremiumCode = _ref.isPremiumCode,
|
47887 |
-
_ref$scrollBar = _ref.scrollBar,
|
47888 |
-
scrollBar = _ref$scrollBar === void 0 ? false : _ref$scrollBar;
|
47889 |
|
47890 |
-
|
47891 |
-
var
|
47892 |
-
|
47893 |
-
|
47894 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47895 |
|
47896 |
-
|
47897 |
-
_useState4 = Overview_slicedToArray(_useState3, 2),
|
47898 |
-
oldGroups = _useState4[0],
|
47899 |
-
setOldGroups = _useState4[1];
|
47900 |
|
47901 |
-
var
|
47902 |
-
|
47903 |
-
|
47904 |
-
|
47905 |
|
47906 |
(0,react.useEffect)(function () {
|
47907 |
-
|
47908 |
-
|
47909 |
-
if (scrollBar && scrollBar.current) scrollBar.current.scrollTop = 0;
|
47910 |
-
};
|
47911 |
-
}, []);
|
47912 |
-
(0,react.useEffect)(function () {
|
47913 |
-
if (oldGroups !== null) {
|
47914 |
-
// Added a new group
|
47915 |
-
if (Object.keys(groups).length > Object.keys(oldGroups).length) setNewGroup(difference_default()(Object.keys(groups), Object.keys(oldGroups))); // Removed a group
|
47916 |
-
|
47917 |
-
if (Object.keys(groups).length < Object.keys(oldGroups).length) setNewGroup(null);
|
47918 |
-
}
|
47919 |
|
47920 |
-
|
47921 |
-
|
|
|
|
|
|
|
47922 |
|
47923 |
-
|
47924 |
-
|
47925 |
-
|
47926 |
-
|
47927 |
-
|
47928 |
-
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47929 |
|
47930 |
-
|
47931 |
-
var destination = result.destination,
|
47932 |
-
source = result.source,
|
47933 |
-
draggableId = result.draggableId; // Didn't dragged into a group
|
47934 |
|
47935 |
-
|
47936 |
-
return;
|
47937 |
-
} // Didn't dragged into a new location
|
47938 |
|
47939 |
|
47940 |
-
if (source.droppableId === destination.droppableId && source.index === destination.index) {
|
47941 |
-
return;
|
47942 |
-
}
|
47943 |
|
47944 |
-
changeRelation(draggableId, source.droppableId, destination.droppableId, destination.index);
|
47945 |
-
}, [groups]);
|
47946 |
|
47947 |
-
var addGroupButton = function addGroupButton(index) {
|
47948 |
-
/* webpack-strip-block:removed */
|
47949 |
-
return /*#__PURE__*/react.createElement("div", {
|
47950 |
-
style: {
|
47951 |
-
textAlign: "center",
|
47952 |
-
marginTop: "20px"
|
47953 |
-
}
|
47954 |
-
}, /*#__PURE__*/react.createElement(Button_Button, {
|
47955 |
-
onClick: function onClick() {
|
47956 |
-
return app.showPremiumDialog(translate("premium.multiple_button_groups"), "Qxs1oGCVATU");
|
47957 |
-
},
|
47958 |
-
color: "primary",
|
47959 |
-
className: "Mui-buzz-premium",
|
47960 |
-
startIcon: /*#__PURE__*/react.createElement(Icon_Icon, {
|
47961 |
-
className: "fas fa-plus-circle"
|
47962 |
-
}),
|
47963 |
-
"data-testid": "new-group"
|
47964 |
-
}, translate("utils.create_group"), " ", /*#__PURE__*/react.createElement(PremiumTag, null)));
|
47965 |
-
};
|
47966 |
|
47967 |
-
var buttonGroupContainer = function buttonGroupContainer() {
|
47968 |
-
/* webpack-strip-block:removed */
|
47969 |
-
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ConnectedDroppable, {
|
47970 |
-
droppableId: Object.keys(groups)[0]
|
47971 |
-
}, function (provided, snapshot) {
|
47972 |
-
return /*#__PURE__*/react.createElement(ButtonGroupContainer_ButtonGroupContainer, {
|
47973 |
-
groupId: Object.keys(groups)[0],
|
47974 |
-
provided: provided,
|
47975 |
-
currentDrop: snapshot.isDraggingOver ? " currentDrop" : ""
|
47976 |
-
});
|
47977 |
-
}), addGroupButton());
|
47978 |
-
};
|
47979 |
|
47980 |
-
|
47981 |
-
|
47982 |
-
|
47983 |
-
|
47984 |
-
|
47985 |
-
|
47986 |
-
|
47987 |
-
|
47988 |
-
|
47989 |
-
|
47990 |
-
|
47991 |
-
|
47992 |
-
className: "mdc-card dashboard-warning-msg"
|
47993 |
-
}, /*#__PURE__*/react.createElement("b", null, translate("warnings.php_version_outdated.title")), translate("warnings.php_version_outdated.information", buttonizer_admin.php_version), " ", /*#__PURE__*/react.createElement("a", {
|
47994 |
-
href: "https://community.buttonizer.pro/knowledgebase/434",
|
47995 |
-
target: "_blank"
|
47996 |
-
}, translate("common.learn_more"), ".")), /*#__PURE__*/react.createElement(DragDropContext, {
|
47997 |
-
sensors: [testDragSensor],
|
47998 |
-
onDragEnd: onDragEnd,
|
47999 |
-
onDragStart: onDragStart
|
48000 |
-
}, buttonGroupContainer()));
|
48001 |
-
}
|
48002 |
|
48003 |
-
|
48004 |
-
|
48005 |
-
|
48006 |
-
|
48007 |
-
|
48008 |
-
|
48009 |
-
|
48010 |
-
|
48011 |
-
|
48012 |
-
|
48013 |
-
|
48014 |
-
|
48015 |
-
|
48016 |
-
|
48017 |
-
|
48018 |
-
|
48019 |
-
|
48020 |
-
|
48021 |
-
return dispatch(dataActions_changeRelation.apply(void 0, arguments));
|
48022 |
-
}
|
48023 |
-
};
|
48024 |
-
})(Overview));
|
48025 |
-
;// CONCATENATED MODULE: ./src/js/dashboard/Pages/ItemNotFound/ItemNotFound.js
|
48026 |
|
|
|
48027 |
|
|
|
48028 |
|
48029 |
-
function
|
48030 |
-
var _ref$isButtonGroupNot = _ref.isButtonGroupNotFound,
|
48031 |
-
isButtonGroupNotFound = _ref$isButtonGroupNot === void 0 ? false : _ref$isButtonGroupNot;
|
48032 |
-
return /*#__PURE__*/react.createElement("div", {
|
48033 |
-
className: "item-not-found"
|
48034 |
-
}, /*#__PURE__*/react.createElement("div", {
|
48035 |
-
className: "buttonizer-logo"
|
48036 |
-
}, /*#__PURE__*/react.createElement("img", {
|
48037 |
-
src: window.buttonizer_admin.assets + "/images/logo.png"
|
48038 |
-
})), /*#__PURE__*/react.createElement("i", {
|
48039 |
-
className: isButtonGroupNotFound ? "fas fa-binoculars" : "far fa-dizzy"
|
48040 |
-
}), /*#__PURE__*/react.createElement("h4", null, "Sorry! We could not find this ".concat(isButtonGroupNotFound ? "button or group" : "page", "!")), /*#__PURE__*/react.createElement(Button_Button, {
|
48041 |
-
onClick: function onClick() {
|
48042 |
-
document.location.hash = "#/";
|
48043 |
-
},
|
48044 |
-
color: "primary",
|
48045 |
-
variant: "contained",
|
48046 |
-
"data-testid": "return-to-overview"
|
48047 |
-
}, "Return to overview"));
|
48048 |
-
}
|
48049 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/Tab/Tab.js
|
48050 |
|
|
|
48051 |
|
|
|
48052 |
|
48053 |
|
48054 |
|
@@ -48056,344 +52733,309 @@ function ItemNotFound(_ref) {
|
|
48056 |
|
48057 |
|
48058 |
|
|
|
|
|
|
|
|
|
|
|
|
|
48059 |
|
48060 |
-
var
|
48061 |
-
|
|
|
|
|
48062 |
|
48063 |
-
|
48064 |
-
|
48065 |
-
|
48066 |
-
|
48067 |
-
minWidth: 72,
|
48068 |
-
position: 'relative',
|
48069 |
-
boxSizing: 'border-box',
|
48070 |
-
minHeight: 48,
|
48071 |
-
flexShrink: 0,
|
48072 |
-
padding: '6px 12px'
|
48073 |
-
}, (0,defineProperty/* default */.Z)(_extends2, theme.breakpoints.up('sm'), {
|
48074 |
-
padding: '6px 24px'
|
48075 |
-
}), (0,defineProperty/* default */.Z)(_extends2, "overflow", 'hidden'), (0,defineProperty/* default */.Z)(_extends2, "whiteSpace", 'normal'), (0,defineProperty/* default */.Z)(_extends2, "textAlign", 'center'), (0,defineProperty/* default */.Z)(_extends2, theme.breakpoints.up('sm'), {
|
48076 |
-
minWidth: 160
|
48077 |
-
}), _extends2)),
|
48078 |
|
48079 |
-
|
48080 |
-
|
48081 |
-
|
48082 |
-
|
48083 |
-
|
48084 |
-
|
48085 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48086 |
},
|
48087 |
-
|
48088 |
-
|
48089 |
-
|
48090 |
-
|
48091 |
-
|
48092 |
-
|
48093 |
-
|
48094 |
-
|
48095 |
-
|
48096 |
-
|
48097 |
-
|
|
|
48098 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48099 |
|
48100 |
-
|
48101 |
-
textColorPrimary: {
|
48102 |
-
color: theme.palette.text.secondary,
|
48103 |
-
'&$selected': {
|
48104 |
-
color: theme.palette.primary.main
|
48105 |
-
},
|
48106 |
-
'&$disabled': {
|
48107 |
-
color: theme.palette.text.disabled
|
48108 |
-
}
|
48109 |
-
},
|
48110 |
|
48111 |
-
|
48112 |
-
textColorSecondary: {
|
48113 |
-
color: theme.palette.text.secondary,
|
48114 |
-
'&$selected': {
|
48115 |
-
color: theme.palette.secondary.main
|
48116 |
-
},
|
48117 |
-
'&$disabled': {
|
48118 |
-
color: theme.palette.text.disabled
|
48119 |
-
}
|
48120 |
-
},
|
48121 |
|
48122 |
-
|
48123 |
-
selected: {},
|
48124 |
|
48125 |
-
|
48126 |
-
disabled: {},
|
48127 |
|
48128 |
-
|
48129 |
-
fullWidth: {
|
48130 |
-
flexShrink: 1,
|
48131 |
-
flexGrow: 1,
|
48132 |
-
flexBasis: 0,
|
48133 |
-
maxWidth: 'none'
|
48134 |
-
},
|
48135 |
|
48136 |
-
/* Styles applied to the root element if `wrapped={true}`. */
|
48137 |
-
wrapped: {
|
48138 |
-
fontSize: theme.typography.pxToRem(12),
|
48139 |
-
lineHeight: 1.5
|
48140 |
-
},
|
48141 |
|
48142 |
-
/* Styles applied to the `icon` and `label`'s wrapper element. */
|
48143 |
-
wrapper: {
|
48144 |
-
display: 'inline-flex',
|
48145 |
-
alignItems: 'center',
|
48146 |
-
justifyContent: 'center',
|
48147 |
-
width: '100%',
|
48148 |
-
flexDirection: 'column'
|
48149 |
-
}
|
48150 |
-
};
|
48151 |
-
};
|
48152 |
-
var Tab = /*#__PURE__*/react.forwardRef(function Tab(props, ref) {
|
48153 |
-
var classes = props.classes,
|
48154 |
-
className = props.className,
|
48155 |
-
_props$disabled = props.disabled,
|
48156 |
-
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
48157 |
-
_props$disableFocusRi = props.disableFocusRipple,
|
48158 |
-
disableFocusRipple = _props$disableFocusRi === void 0 ? false : _props$disableFocusRi,
|
48159 |
-
fullWidth = props.fullWidth,
|
48160 |
-
icon = props.icon,
|
48161 |
-
indicator = props.indicator,
|
48162 |
-
label = props.label,
|
48163 |
-
onChange = props.onChange,
|
48164 |
-
onClick = props.onClick,
|
48165 |
-
onFocus = props.onFocus,
|
48166 |
-
selected = props.selected,
|
48167 |
-
selectionFollowsFocus = props.selectionFollowsFocus,
|
48168 |
-
_props$textColor = props.textColor,
|
48169 |
-
textColor = _props$textColor === void 0 ? 'inherit' : _props$textColor,
|
48170 |
-
value = props.value,
|
48171 |
-
_props$wrapped = props.wrapped,
|
48172 |
-
wrapped = _props$wrapped === void 0 ? false : _props$wrapped,
|
48173 |
-
other = (0,objectWithoutProperties/* default */.Z)(props, ["classes", "className", "disabled", "disableFocusRipple", "fullWidth", "icon", "indicator", "label", "onChange", "onClick", "onFocus", "selected", "selectionFollowsFocus", "textColor", "value", "wrapped"]);
|
48174 |
|
48175 |
-
var handleClick = function handleClick(event) {
|
48176 |
-
if (onChange) {
|
48177 |
-
onChange(event, value);
|
48178 |
-
}
|
48179 |
|
48180 |
-
|
48181 |
-
|
48182 |
-
|
48183 |
-
|
|
|
48184 |
|
48185 |
-
var
|
48186 |
-
|
48187 |
-
|
48188 |
-
|
48189 |
|
48190 |
-
|
48191 |
-
|
48192 |
-
|
48193 |
-
|
48194 |
|
48195 |
-
|
48196 |
-
|
48197 |
-
|
48198 |
-
|
48199 |
-
role: "tab",
|
48200 |
-
"aria-selected": selected,
|
48201 |
-
disabled: disabled,
|
48202 |
-
onClick: handleClick,
|
48203 |
-
onFocus: handleFocus,
|
48204 |
-
tabIndex: selected ? 0 : -1
|
48205 |
-
}, other), /*#__PURE__*/react.createElement("span", {
|
48206 |
-
className: classes.wrapper
|
48207 |
-
}, icon, label), indicator);
|
48208 |
-
});
|
48209 |
-
false ? 0 : void 0;
|
48210 |
-
/* harmony default export */ var Tab_Tab = ((0,withStyles/* default */.Z)(Tab_styles, {
|
48211 |
-
name: 'MuiTab'
|
48212 |
-
})(Tab));
|
48213 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/utils/scrollLeft.js
|
48214 |
-
// Source from https://github.com/alitaheri/normalize-scroll-left
|
48215 |
-
var cachedType;
|
48216 |
-
/**
|
48217 |
-
* Based on the jquery plugin https://github.com/othree/jquery.rtl-scroll-type
|
48218 |
-
*
|
48219 |
-
* Types of scrollLeft, assuming scrollWidth=100 and direction is rtl.
|
48220 |
-
*
|
48221 |
-
* Type | <- Most Left | Most Right -> | Initial
|
48222 |
-
* ---------------- | ------------ | ------------- | -------
|
48223 |
-
* default | 0 | 100 | 100
|
48224 |
-
* negative (spec*) | -100 | 0 | 0
|
48225 |
-
* reverse | 100 | 0 | 0
|
48226 |
-
*
|
48227 |
-
* Edge 85: default
|
48228 |
-
* Safari 14: negative
|
48229 |
-
* Chrome 85: negative
|
48230 |
-
* Firefox 81: negative
|
48231 |
-
* IE 11: reverse
|
48232 |
-
*
|
48233 |
-
* spec* https://drafts.csswg.org/cssom-view/#dom-window-scroll
|
48234 |
-
*/
|
48235 |
|
48236 |
-
function
|
48237 |
-
|
48238 |
-
|
48239 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48240 |
|
48241 |
-
|
48242 |
-
|
48243 |
-
|
48244 |
-
|
48245 |
-
|
48246 |
-
|
48247 |
-
|
48248 |
-
|
48249 |
-
|
48250 |
-
|
48251 |
-
|
48252 |
-
|
48253 |
-
|
48254 |
-
|
|
|
48255 |
|
48256 |
-
|
48257 |
-
cachedType = 'default';
|
48258 |
-
} else {
|
48259 |
-
dummy.scrollLeft = 1;
|
48260 |
|
48261 |
-
|
48262 |
-
cachedType = 'negative';
|
48263 |
-
}
|
48264 |
-
}
|
48265 |
|
48266 |
-
|
48267 |
-
return cachedType;
|
48268 |
-
} // Based on https://stackoverflow.com/a/24394376
|
48269 |
|
48270 |
-
function
|
48271 |
-
var scrollLeft = element.scrollLeft; // Perform the calculations only when direction is rtl to avoid messing up the ltr bahavior
|
48272 |
|
48273 |
-
|
48274 |
-
return scrollLeft;
|
48275 |
-
}
|
48276 |
|
48277 |
-
var type = detectScrollType();
|
48278 |
|
48279 |
-
switch (type) {
|
48280 |
-
case 'negative':
|
48281 |
-
return element.scrollWidth - element.clientWidth + scrollLeft;
|
48282 |
|
48283 |
-
case 'reverse':
|
48284 |
-
return element.scrollWidth - element.clientWidth - scrollLeft;
|
48285 |
|
48286 |
-
default:
|
48287 |
-
return scrollLeft;
|
48288 |
-
}
|
48289 |
-
}
|
48290 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/animate.js
|
48291 |
-
function easeInOutSin(time) {
|
48292 |
-
return (1 + Math.sin(Math.PI * time - Math.PI / 2)) / 2;
|
48293 |
-
}
|
48294 |
|
48295 |
-
function
|
48296 |
-
var
|
48297 |
-
|
48298 |
-
|
48299 |
-
|
48300 |
-
|
48301 |
-
|
48302 |
-
|
48303 |
-
|
48304 |
-
|
|
|
|
|
48305 |
|
48306 |
-
var
|
48307 |
-
|
48308 |
-
|
|
|
48309 |
|
48310 |
-
var
|
48311 |
-
|
48312 |
-
|
48313 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48314 |
}
|
|
|
|
|
|
|
|
|
|
|
48315 |
|
48316 |
-
|
48317 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48318 |
}
|
48319 |
-
|
48320 |
-
|
48321 |
-
|
48322 |
-
|
48323 |
-
|
48324 |
-
|
48325 |
-
|
48326 |
-
});
|
48327 |
-
return;
|
48328 |
}
|
48329 |
-
|
48330 |
-
requestAnimationFrame(step);
|
48331 |
-
};
|
48332 |
-
|
48333 |
-
if (from === to) {
|
48334 |
-
cb(new Error('Element already at target position'));
|
48335 |
-
return cancel;
|
48336 |
-
}
|
48337 |
-
|
48338 |
-
requestAnimationFrame(step);
|
48339 |
-
return cancel;
|
48340 |
}
|
48341 |
-
;// CONCATENATED MODULE: ./
|
48342 |
-
|
48343 |
-
|
48344 |
-
|
48345 |
-
|
48346 |
-
|
48347 |
-
var ScrollbarSize_styles = {
|
48348 |
-
width: 99,
|
48349 |
-
height: 99,
|
48350 |
-
position: 'absolute',
|
48351 |
-
top: -9999,
|
48352 |
-
overflow: 'scroll'
|
48353 |
-
};
|
48354 |
-
/**
|
48355 |
-
* @ignore - internal component.
|
48356 |
-
* The component originates from https://github.com/STORIS/react-scrollbar-size.
|
48357 |
-
* It has been moved into the core in order to minimize the bundle size.
|
48358 |
-
*/
|
48359 |
|
48360 |
-
function
|
48361 |
-
var onChange = props.onChange,
|
48362 |
-
other = (0,objectWithoutProperties/* default */.Z)(props, ["onChange"]);
|
48363 |
|
48364 |
-
|
48365 |
-
var nodeRef = react.useRef(null);
|
48366 |
|
48367 |
-
|
48368 |
-
scrollbarHeight.current = nodeRef.current.offsetHeight - nodeRef.current.clientHeight;
|
48369 |
-
};
|
48370 |
|
48371 |
-
|
48372 |
-
var handleResize = (0,utils_debounce/* default */.Z)(function () {
|
48373 |
-
var prevHeight = scrollbarHeight.current;
|
48374 |
-
setMeasurements();
|
48375 |
|
48376 |
-
|
48377 |
-
onChange(scrollbarHeight.current);
|
48378 |
-
}
|
48379 |
-
});
|
48380 |
-
window.addEventListener('resize', handleResize);
|
48381 |
-
return function () {
|
48382 |
-
handleResize.clear();
|
48383 |
-
window.removeEventListener('resize', handleResize);
|
48384 |
-
};
|
48385 |
-
}, [onChange]);
|
48386 |
-
react.useEffect(function () {
|
48387 |
-
setMeasurements();
|
48388 |
-
onChange(scrollbarHeight.current);
|
48389 |
-
}, [onChange]);
|
48390 |
-
return /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
48391 |
-
style: ScrollbarSize_styles,
|
48392 |
-
ref: nodeRef
|
48393 |
-
}, other));
|
48394 |
-
}
|
48395 |
-
false ? 0 : void 0;
|
48396 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/Tabs/TabIndicator.js
|
48397 |
|
48398 |
|
48399 |
|
@@ -48401,133 +53043,335 @@ function ScrollbarSize(props) {
|
|
48401 |
|
48402 |
|
48403 |
|
48404 |
-
var
|
48405 |
return {
|
48406 |
-
|
48407 |
-
|
48408 |
-
height: 2,
|
48409 |
-
bottom: 0,
|
48410 |
-
width: '100%',
|
48411 |
-
transition: theme.transitions.create()
|
48412 |
-
},
|
48413 |
-
colorPrimary: {
|
48414 |
-
backgroundColor: theme.palette.primary.main
|
48415 |
-
},
|
48416 |
-
colorSecondary: {
|
48417 |
-
backgroundColor: theme.palette.secondary.main
|
48418 |
},
|
48419 |
-
|
48420 |
-
|
48421 |
-
|
48422 |
-
|
|
|
|
|
|
|
48423 |
}
|
48424 |
};
|
48425 |
-
};
|
48426 |
-
|
48427 |
-
|
48428 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48429 |
|
48430 |
-
var
|
48431 |
-
|
48432 |
-
|
48433 |
-
|
48434 |
-
orientation = props.orientation,
|
48435 |
-
other = (0,objectWithoutProperties/* default */.Z)(props, ["classes", "className", "color", "orientation"]);
|
48436 |
|
48437 |
-
return /*#__PURE__*/react.createElement("span", (0,esm_extends/* default */.Z)({
|
48438 |
-
className: (0,clsx_m/* default */.Z)(classes.root, classes["color".concat((0,capitalize/* default */.Z)(color))], className, orientation === 'vertical' && classes.vertical),
|
48439 |
-
ref: ref
|
48440 |
-
}, other));
|
48441 |
-
});
|
48442 |
-
false ? 0 : void 0;
|
48443 |
-
/* harmony default export */ var Tabs_TabIndicator = ((0,withStyles/* default */.Z)(TabIndicator_styles, {
|
48444 |
-
name: 'PrivateTabIndicator'
|
48445 |
-
})(TabIndicator));
|
48446 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/svg-icons/KeyboardArrowLeft.js
|
48447 |
|
|
|
|
|
|
|
48448 |
|
48449 |
-
/**
|
48450 |
-
* @ignore - internal component.
|
48451 |
-
*/
|
48452 |
|
48453 |
-
|
48454 |
-
|
48455 |
-
}
|
48456 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/svg-icons/KeyboardArrowRight.js
|
48457 |
|
|
|
|
|
|
|
|
|
48458 |
|
48459 |
-
|
48460 |
-
|
48461 |
-
*/
|
48462 |
|
48463 |
-
/* harmony default export */ var KeyboardArrowRight = ((0,createSvgIcon/* default */.Z)( /*#__PURE__*/react.createElement("path", {
|
48464 |
-
d: "M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"
|
48465 |
-
}), 'KeyboardArrowRight'));
|
48466 |
-
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/TabScrollButton/TabScrollButton.js
|
48467 |
|
|
|
|
|
|
|
|
|
48468 |
|
|
|
48469 |
|
48470 |
-
|
|
|
|
|
|
|
48471 |
|
|
|
|
|
|
|
48472 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48473 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48474 |
|
48475 |
|
48476 |
|
48477 |
|
48478 |
-
|
48479 |
-
|
48480 |
-
|
48481 |
-
|
48482 |
-
|
48483 |
-
|
48484 |
-
|
48485 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48486 |
}
|
48487 |
-
},
|
48488 |
-
|
48489 |
-
|
48490 |
-
|
48491 |
-
|
48492 |
-
|
48493 |
-
|
48494 |
-
|
|
|
|
|
|
|
|
|
48495 |
}
|
48496 |
-
},
|
48497 |
-
|
48498 |
-
|
48499 |
-
|
48500 |
-
};
|
|
|
|
|
48501 |
|
48502 |
-
var TabScrollButton_ref = /*#__PURE__*/react.createElement(KeyboardArrowLeft, {
|
48503 |
-
fontSize: "small"
|
48504 |
-
});
|
48505 |
|
48506 |
-
var TabScrollButton_ref2 = /*#__PURE__*/react.createElement(KeyboardArrowRight, {
|
48507 |
-
fontSize: "small"
|
48508 |
-
});
|
48509 |
|
48510 |
-
var TabScrollButton = /*#__PURE__*/react.forwardRef(function TabScrollButton(props, ref) {
|
48511 |
-
var classes = props.classes,
|
48512 |
-
classNameProp = props.className,
|
48513 |
-
direction = props.direction,
|
48514 |
-
orientation = props.orientation,
|
48515 |
-
disabled = props.disabled,
|
48516 |
-
other = (0,objectWithoutProperties/* default */.Z)(props, ["classes", "className", "direction", "orientation", "disabled"]);
|
48517 |
|
48518 |
-
|
48519 |
-
|
48520 |
-
|
48521 |
-
|
48522 |
-
|
48523 |
-
|
48524 |
-
|
48525 |
-
|
48526 |
-
|
48527 |
-
|
48528 |
-
|
48529 |
-
|
48530 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48531 |
|
48532 |
|
48533 |
|
@@ -48535,6 +53379,52 @@ var TabScrollButton = /*#__PURE__*/react.forwardRef(function TabScrollButton(pro
|
|
48535 |
|
48536 |
|
48537 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48538 |
|
48539 |
|
48540 |
|
@@ -48542,620 +53432,573 @@ var TabScrollButton = /*#__PURE__*/react.forwardRef(function TabScrollButton(pro
|
|
48542 |
|
48543 |
|
48544 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48545 |
|
|
|
48546 |
|
|
|
48547 |
|
|
|
48548 |
|
48549 |
-
var
|
48550 |
-
return {
|
48551 |
-
/* Styles applied to the root element. */
|
48552 |
-
root: {
|
48553 |
-
overflow: 'hidden',
|
48554 |
-
minHeight: 48,
|
48555 |
-
WebkitOverflowScrolling: 'touch',
|
48556 |
-
// Add iOS momentum scrolling.
|
48557 |
-
display: 'flex'
|
48558 |
-
},
|
48559 |
|
48560 |
-
|
48561 |
-
vertical: {
|
48562 |
-
flexDirection: 'column'
|
48563 |
-
},
|
48564 |
|
48565 |
-
/* Styles applied to the flex container element. */
|
48566 |
-
flexContainer: {
|
48567 |
-
display: 'flex'
|
48568 |
-
},
|
48569 |
|
48570 |
-
/* Styles applied to the flex container element if `orientation="vertical"`. */
|
48571 |
-
flexContainerVertical: {
|
48572 |
-
flexDirection: 'column'
|
48573 |
-
},
|
48574 |
|
48575 |
-
/* Styles applied to the flex container element if `centered={true}` & `!variant="scrollable"`. */
|
48576 |
-
centered: {
|
48577 |
-
justifyContent: 'center'
|
48578 |
-
},
|
48579 |
|
48580 |
-
/* Styles applied to the tablist element. */
|
48581 |
-
scroller: {
|
48582 |
-
position: 'relative',
|
48583 |
-
display: 'inline-block',
|
48584 |
-
flex: '1 1 auto',
|
48585 |
-
whiteSpace: 'now
|
9 |
*
|
10 |
* Buttonizer is Freemium software. The free version (build) does not contain premium functionality.
|
11 |
*
|
12 |
+
* (C) 2017-2022 Buttonizer v2.6.1
|
13 |
*
|
14 |
*/
|
15 |
/*!
|
23 |
*
|
24 |
* Buttonizer is Freemium software. The free version (build) does not contain premium functionality.
|
25 |
*
|
26 |
+
* (C) 2017-2022 Buttonizer v2.6.1
|
27 |
*
|
28 |
*/
|
29 |
/******/ (function() { // webpackBootstrap
|
48 |
|
49 |
/***/ }),
|
50 |
|
51 |
+
/***/ 59968:
|
52 |
+
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
53 |
+
|
54 |
+
"use strict";
|
55 |
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
56 |
+
/* harmony export */ "Z": function() { return /* binding */ _arrayWithHoles; }
|
57 |
+
/* harmony export */ });
|
58 |
+
function _arrayWithHoles(arr) {
|
59 |
+
if (Array.isArray(arr)) return arr;
|
60 |
+
}
|
61 |
+
|
62 |
+
/***/ }),
|
63 |
+
|
64 |
/***/ 83614:
|
65 |
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
66 |
|
113 |
function _createClass(Constructor, protoProps, staticProps) {
|
114 |
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
115 |
if (staticProps) _defineProperties(Constructor, staticProps);
|
116 |
+
Object.defineProperty(Constructor, "prototype", {
|
117 |
+
writable: false
|
118 |
+
});
|
119 |
return Constructor;
|
120 |
}
|
121 |
|
202 |
|
203 |
/***/ }),
|
204 |
|
205 |
+
/***/ 28970:
|
206 |
+
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
207 |
+
|
208 |
+
"use strict";
|
209 |
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
210 |
+
/* harmony export */ "Z": function() { return /* binding */ _nonIterableRest; }
|
211 |
+
/* harmony export */ });
|
212 |
+
function _nonIterableRest() {
|
213 |
+
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
214 |
+
}
|
215 |
+
|
216 |
+
/***/ }),
|
217 |
+
|
218 |
/***/ 62303:
|
219 |
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
220 |
|
300 |
|
301 |
/***/ }),
|
302 |
|
303 |
+
/***/ 28481:
|
304 |
/***/ (function(__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
|
305 |
|
306 |
"use strict";
|
310 |
"Z": function() { return /* binding */ _slicedToArray; }
|
311 |
});
|
312 |
|
313 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
314 |
+
var arrayWithHoles = __webpack_require__(59968);
|
|
|
|
|
315 |
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
316 |
function _iterableToArrayLimit(arr, i) {
|
317 |
+
var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"];
|
318 |
|
319 |
if (_i == null) return;
|
320 |
var _arr = [];
|
344 |
}
|
345 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
346 |
var unsupportedIterableToArray = __webpack_require__(82961);
|
347 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
348 |
+
var nonIterableRest = __webpack_require__(28970);
|
|
|
|
|
349 |
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
350 |
|
351 |
|
352 |
|
353 |
|
354 |
function _slicedToArray(arr, i) {
|
355 |
+
return (0,arrayWithHoles/* default */.Z)(arr) || _iterableToArrayLimit(arr, i) || (0,unsupportedIterableToArray/* default */.Z)(arr, i) || (0,nonIterableRest/* default */.Z)();
|
356 |
}
|
357 |
|
358 |
/***/ }),
|
388 |
function _typeof(obj) {
|
389 |
"@babel/helpers - typeof";
|
390 |
|
391 |
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
392 |
+
return typeof obj;
|
393 |
+
} : function (obj) {
|
394 |
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
395 |
+
}, _typeof(obj);
|
|
|
|
|
|
|
|
|
|
|
|
|
396 |
}
|
397 |
|
398 |
/***/ }),
|
426 |
};
|
427 |
}
|
428 |
|
429 |
+
module.exports = _interopRequireDefault, module.exports.__esModule = true, module.exports.default = module.exports;
|
|
|
430 |
|
431 |
/***/ }),
|
432 |
|
435 |
|
436 |
var _typeof = __webpack_require__(50008).default;
|
437 |
|
438 |
+
function _getRequireWildcardCache(nodeInterop) {
|
439 |
if (typeof WeakMap !== "function") return null;
|
440 |
+
var cacheBabelInterop = new WeakMap();
|
441 |
+
var cacheNodeInterop = new WeakMap();
|
442 |
+
return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) {
|
443 |
+
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
444 |
+
})(nodeInterop);
|
|
|
|
|
445 |
}
|
446 |
|
447 |
+
function _interopRequireWildcard(obj, nodeInterop) {
|
448 |
+
if (!nodeInterop && obj && obj.__esModule) {
|
449 |
return obj;
|
450 |
}
|
451 |
|
455 |
};
|
456 |
}
|
457 |
|
458 |
+
var cache = _getRequireWildcardCache(nodeInterop);
|
459 |
|
460 |
if (cache && cache.has(obj)) {
|
461 |
return cache.get(obj);
|
465 |
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
466 |
|
467 |
for (var key in obj) {
|
468 |
+
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
469 |
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
470 |
|
471 |
if (desc && (desc.get || desc.set)) {
|
485 |
return newObj;
|
486 |
}
|
487 |
|
488 |
+
module.exports = _interopRequireWildcard, module.exports.__esModule = true, module.exports.default = module.exports;
|
|
|
489 |
|
490 |
/***/ }),
|
491 |
|
495 |
function _typeof(obj) {
|
496 |
"@babel/helpers - typeof";
|
497 |
|
498 |
+
return (module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
499 |
+
return typeof obj;
|
500 |
+
} : function (obj) {
|
501 |
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
502 |
+
}, module.exports.__esModule = true, module.exports.default = module.exports), _typeof(obj);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
503 |
}
|
504 |
|
505 |
+
module.exports = _typeof, module.exports.__esModule = true, module.exports.default = module.exports;
|
|
|
506 |
|
507 |
/***/ }),
|
508 |
|
598 |
|
599 |
/***/ }),
|
600 |
|
601 |
+
/***/ 62087:
|
602 |
+
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
603 |
+
|
604 |
+
"use strict";
|
605 |
+
/* unused harmony export styles */
|
606 |
+
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(22122);
|
607 |
+
/* harmony import */ var _babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(81253);
|
608 |
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294);
|
609 |
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(45697);
|
610 |
+
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
|
611 |
+
/* harmony import */ var clsx__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(86010);
|
612 |
+
/* harmony import */ var _styles_withStyles__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(14670);
|
613 |
+
/* harmony import */ var _utils_capitalize__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(93871);
|
614 |
+
|
615 |
+
|
616 |
+
|
617 |
+
|
618 |
+
|
619 |
+
|
620 |
+
|
621 |
+
var styles = function styles(theme) {
|
622 |
+
return {
|
623 |
+
/* Styles applied to the root element. */
|
624 |
+
root: {
|
625 |
+
userSelect: 'none',
|
626 |
+
width: '1em',
|
627 |
+
height: '1em',
|
628 |
+
display: 'inline-block',
|
629 |
+
fill: 'currentColor',
|
630 |
+
flexShrink: 0,
|
631 |
+
fontSize: theme.typography.pxToRem(24),
|
632 |
+
transition: theme.transitions.create('fill', {
|
633 |
+
duration: theme.transitions.duration.shorter
|
634 |
+
})
|
635 |
+
},
|
636 |
+
|
637 |
+
/* Styles applied to the root element if `color="primary"`. */
|
638 |
+
colorPrimary: {
|
639 |
+
color: theme.palette.primary.main
|
640 |
+
},
|
641 |
+
|
642 |
+
/* Styles applied to the root element if `color="secondary"`. */
|
643 |
+
colorSecondary: {
|
644 |
+
color: theme.palette.secondary.main
|
645 |
+
},
|
646 |
+
|
647 |
+
/* Styles applied to the root element if `color="action"`. */
|
648 |
+
colorAction: {
|
649 |
+
color: theme.palette.action.active
|
650 |
+
},
|
651 |
+
|
652 |
+
/* Styles applied to the root element if `color="error"`. */
|
653 |
+
colorError: {
|
654 |
+
color: theme.palette.error.main
|
655 |
+
},
|
656 |
+
|
657 |
+
/* Styles applied to the root element if `color="disabled"`. */
|
658 |
+
colorDisabled: {
|
659 |
+
color: theme.palette.action.disabled
|
660 |
+
},
|
661 |
+
|
662 |
+
/* Styles applied to the root element if `fontSize="inherit"`. */
|
663 |
+
fontSizeInherit: {
|
664 |
+
fontSize: 'inherit'
|
665 |
+
},
|
666 |
+
|
667 |
+
/* Styles applied to the root element if `fontSize="small"`. */
|
668 |
+
fontSizeSmall: {
|
669 |
+
fontSize: theme.typography.pxToRem(20)
|
670 |
+
},
|
671 |
+
|
672 |
+
/* Styles applied to the root element if `fontSize="large"`. */
|
673 |
+
fontSizeLarge: {
|
674 |
+
fontSize: theme.typography.pxToRem(35)
|
675 |
+
}
|
676 |
+
};
|
677 |
+
};
|
678 |
+
var SvgIcon = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(function SvgIcon(props, ref) {
|
679 |
+
var children = props.children,
|
680 |
+
classes = props.classes,
|
681 |
+
className = props.className,
|
682 |
+
_props$color = props.color,
|
683 |
+
color = _props$color === void 0 ? 'inherit' : _props$color,
|
684 |
+
_props$component = props.component,
|
685 |
+
Component = _props$component === void 0 ? 'svg' : _props$component,
|
686 |
+
_props$fontSize = props.fontSize,
|
687 |
+
fontSize = _props$fontSize === void 0 ? 'default' : _props$fontSize,
|
688 |
+
htmlColor = props.htmlColor,
|
689 |
+
titleAccess = props.titleAccess,
|
690 |
+
_props$viewBox = props.viewBox,
|
691 |
+
viewBox = _props$viewBox === void 0 ? '0 0 24 24' : _props$viewBox,
|
692 |
+
other = (0,_babel_runtime_helpers_esm_objectWithoutProperties__WEBPACK_IMPORTED_MODULE_2__/* .default */ .Z)(props, ["children", "classes", "className", "color", "component", "fontSize", "htmlColor", "titleAccess", "viewBox"]);
|
693 |
+
|
694 |
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(Component, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_3__/* .default */ .Z)({
|
695 |
+
className: (0,clsx__WEBPACK_IMPORTED_MODULE_4__/* .default */ .Z)(classes.root, className, color !== 'inherit' && classes["color".concat((0,_utils_capitalize__WEBPACK_IMPORTED_MODULE_5__/* .default */ .Z)(color))], fontSize !== 'default' && classes["fontSize".concat((0,_utils_capitalize__WEBPACK_IMPORTED_MODULE_5__/* .default */ .Z)(fontSize))]),
|
696 |
+
focusable: "false",
|
697 |
+
viewBox: viewBox,
|
698 |
+
color: htmlColor,
|
699 |
+
"aria-hidden": titleAccess ? undefined : true,
|
700 |
+
role: titleAccess ? 'img' : undefined,
|
701 |
+
ref: ref
|
702 |
+
}, other), children, titleAccess ? /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("title", null, titleAccess) : null);
|
703 |
+
});
|
704 |
+
false ? 0 : void 0;
|
705 |
+
SvgIcon.muiName = 'SvgIcon';
|
706 |
+
/* harmony default export */ __webpack_exports__["Z"] = ((0,_styles_withStyles__WEBPACK_IMPORTED_MODULE_6__/* .default */ .Z)(styles, {
|
707 |
+
name: 'MuiSvgIcon'
|
708 |
+
})(SvgIcon));
|
709 |
+
|
710 |
+
/***/ }),
|
711 |
+
|
712 |
/***/ 59693:
|
713 |
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
714 |
|
1592 |
borderRadius: 4
|
1593 |
};
|
1594 |
/* harmony default export */ var styles_shape = (shape);
|
1595 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
1596 |
+
var slicedToArray = __webpack_require__(28481);
|
1597 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
1598 |
var esm_typeof = __webpack_require__(90484);
|
1599 |
// EXTERNAL MODULE: ./node_modules/prop-types/index.js
|
2252 |
|
2253 |
/***/ }),
|
2254 |
|
2255 |
+
/***/ 63786:
|
2256 |
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
|
2257 |
|
2258 |
"use strict";
|
2259 |
+
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
2260 |
+
/* harmony export */ "Z": function() { return /* binding */ createSvgIcon; }
|
2261 |
+
/* harmony export */ });
|
2262 |
+
/* harmony import */ var _babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(22122);
|
2263 |
+
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(67294);
|
2264 |
+
/* harmony import */ var _SvgIcon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(62087);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2265 |
|
2266 |
|
2267 |
|
2271 |
|
2272 |
function createSvgIcon(path, displayName) {
|
2273 |
var Component = function Component(props, ref) {
|
2274 |
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement(_SvgIcon__WEBPACK_IMPORTED_MODULE_1__/* .default */ .Z, (0,_babel_runtime_helpers_esm_extends__WEBPACK_IMPORTED_MODULE_2__/* .default */ .Z)({
|
2275 |
ref: ref
|
2276 |
}, props), path);
|
2277 |
};
|
2278 |
|
2279 |
if (false) {}
|
2280 |
|
2281 |
+
Component.muiName = _SvgIcon__WEBPACK_IMPORTED_MODULE_1__/* .default.muiName */ .Z.muiName;
|
2282 |
+
return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.memo( /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.forwardRef(Component));
|
2283 |
}
|
2284 |
|
2285 |
/***/ }),
|
2353 |
var capitalize = __webpack_require__(93871);
|
2354 |
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/utils/createChainedFunction.js
|
2355 |
var createChainedFunction = __webpack_require__(82568);
|
2356 |
+
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/utils/createSvgIcon.js
|
2357 |
+
var createSvgIcon = __webpack_require__(63786);
|
2358 |
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/utils/debounce.js
|
2359 |
var debounce = __webpack_require__(79437);
|
2360 |
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/utils/deprecatedPropType.js
|
2836 |
|
2837 |
/***/ }),
|
2838 |
|
2839 |
+
/***/ 49507:
|
2840 |
+
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
2841 |
+
|
2842 |
+
"use strict";
|
2843 |
+
var __webpack_unused_export__;
|
2844 |
+
|
2845 |
+
|
2846 |
+
var _interopRequireDefault = __webpack_require__(95318);
|
2847 |
+
|
2848 |
+
var _interopRequireWildcard = __webpack_require__(20862);
|
2849 |
+
|
2850 |
+
__webpack_unused_export__ = ({
|
2851 |
+
value: true
|
2852 |
+
});
|
2853 |
+
exports.Z = void 0;
|
2854 |
+
|
2855 |
+
var React = _interopRequireWildcard(__webpack_require__(67294));
|
2856 |
+
|
2857 |
+
var _createSvgIcon = _interopRequireDefault(__webpack_require__(2108));
|
2858 |
+
|
2859 |
+
var _default = (0, _createSvgIcon.default)( /*#__PURE__*/React.createElement("path", {
|
2860 |
+
d: "M13 1.07V9h7c0-4.08-3.05-7.44-7-7.93zM4 15c0 4.42 3.58 8 8 8s8-3.58 8-8v-4H4v4zm7-13.93C7.05 1.56 4 4.92 4 9h7V1.07z"
|
2861 |
+
}), 'Mouse');
|
2862 |
+
|
2863 |
+
exports.Z = _default;
|
2864 |
+
|
2865 |
+
/***/ }),
|
2866 |
+
|
2867 |
/***/ 2108:
|
2868 |
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {
|
2869 |
|
7555 |
|
7556 |
/***/ }),
|
7557 |
|
7558 |
+
/***/ 23215:
|
7559 |
/***/ (function(__unused_webpack_module, __unused_webpack___webpack_exports__, __webpack_require__) {
|
7560 |
|
7561 |
"use strict";
|
8619 |
|
8620 |
|
8621 |
|
8622 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/typeof.js
|
8623 |
+
var esm_typeof = __webpack_require__(90484);
|
8624 |
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
8625 |
+
function _classCallCheck(instance, Constructor) {
|
8626 |
+
if (!(instance instanceof Constructor)) {
|
8627 |
+
throw new TypeError("Cannot call a class as a function");
|
|
|
|
|
8628 |
}
|
8629 |
+
}
|
8630 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/createClass.js
|
8631 |
+
var createClass = __webpack_require__(5991);
|
8632 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js
|
8633 |
+
var assertThisInitialized = __webpack_require__(63349);
|
8634 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js
|
8635 |
+
var setPrototypeOf = __webpack_require__(14665);
|
8636 |
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/inherits.js
|
8637 |
|
8638 |
+
function _inherits(subClass, superClass) {
|
8639 |
+
if (typeof superClass !== "function" && superClass !== null) {
|
8640 |
+
throw new TypeError("Super expression must either be null or a function");
|
|
|
|
|
|
|
|
|
|
|
8641 |
}
|
8642 |
|
8643 |
+
subClass.prototype = Object.create(superClass && superClass.prototype, {
|
8644 |
+
constructor: {
|
8645 |
+
value: subClass,
|
8646 |
+
writable: true,
|
8647 |
+
configurable: true
|
8648 |
+
}
|
8649 |
+
});
|
8650 |
+
Object.defineProperty(subClass, "prototype", {
|
8651 |
+
writable: false
|
8652 |
+
});
|
8653 |
+
if (superClass) (0,setPrototypeOf/* default */.Z)(subClass, superClass);
|
8654 |
+
}
|
8655 |
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js
|
8656 |
+
|
8657 |
|
8658 |
+
function _possibleConstructorReturn(self, call) {
|
8659 |
+
if (call && ((0,esm_typeof/* default */.Z)(call) === "object" || typeof call === "function")) {
|
8660 |
+
return call;
|
8661 |
+
} else if (call !== void 0) {
|
8662 |
+
throw new TypeError("Derived constructors may only return object or undefined");
|
8663 |
}
|
8664 |
|
8665 |
+
return (0,assertThisInitialized/* default */.Z)(self);
|
8666 |
}
|
8667 |
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js
|
8668 |
+
function _getPrototypeOf(o) {
|
8669 |
+
_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {
|
8670 |
+
return o.__proto__ || Object.getPrototypeOf(o);
|
8671 |
+
};
|
8672 |
+
return _getPrototypeOf(o);
|
8673 |
+
}
|
8674 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
8675 |
+
var defineProperty = __webpack_require__(96156);
|
8676 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
8677 |
+
var arrayWithHoles = __webpack_require__(59968);
|
8678 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
8679 |
+
var iterableToArray = __webpack_require__(96410);
|
8680 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
8681 |
+
var unsupportedIterableToArray = __webpack_require__(82961);
|
8682 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
8683 |
+
var nonIterableRest = __webpack_require__(28970);
|
8684 |
+
;// CONCATENATED MODULE: ./node_modules/@babel/runtime/helpers/esm/toArray.js
|
8685 |
|
|
|
8686 |
|
|
|
8687 |
|
8688 |
|
8689 |
+
function _toArray(arr) {
|
8690 |
+
return (0,arrayWithHoles/* default */.Z)(arr) || (0,iterableToArray/* default */.Z)(arr) || (0,unsupportedIterableToArray/* default */.Z)(arr) || (0,nonIterableRest/* default */.Z)();
|
8691 |
+
}
|
8692 |
+
;// CONCATENATED MODULE: ./node_modules/i18next/dist/esm/i18next.js
|
8693 |
|
8694 |
|
8695 |
|
8696 |
|
8697 |
+
|
8698 |
+
|
8699 |
+
|
8700 |
+
|
8701 |
+
|
8702 |
+
|
8703 |
+
function i18next_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
8704 |
+
|
8705 |
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { i18next_ownKeys(Object(source), true).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { i18next_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
8706 |
+
|
8707 |
+
var consoleLogger = {
|
8708 |
+
type: 'logger',
|
8709 |
+
log: function log(args) {
|
8710 |
+
this.output('log', args);
|
8711 |
+
},
|
8712 |
+
warn: function warn(args) {
|
8713 |
+
this.output('warn', args);
|
8714 |
+
},
|
8715 |
+
error: function error(args) {
|
8716 |
+
this.output('error', args);
|
8717 |
+
},
|
8718 |
+
output: function output(type, args) {
|
8719 |
+
if (console && console[type]) console[type].apply(console, args);
|
8720 |
+
}
|
8721 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
8722 |
|
8723 |
+
var Logger = function () {
|
8724 |
+
function Logger(concreteLogger) {
|
8725 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
8726 |
|
8727 |
+
_classCallCheck(this, Logger);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8728 |
|
8729 |
+
this.init(concreteLogger, options);
|
8730 |
+
}
|
8731 |
|
8732 |
+
(0,createClass/* default */.Z)(Logger, [{
|
8733 |
+
key: "init",
|
8734 |
+
value: function init(concreteLogger) {
|
8735 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
8736 |
+
this.prefix = options.prefix || 'i18next:';
|
8737 |
+
this.logger = concreteLogger || consoleLogger;
|
8738 |
+
this.options = options;
|
8739 |
+
this.debug = options.debug;
|
8740 |
+
}
|
8741 |
+
}, {
|
8742 |
+
key: "setDebug",
|
8743 |
+
value: function setDebug(bool) {
|
8744 |
+
this.debug = bool;
|
8745 |
+
}
|
8746 |
+
}, {
|
8747 |
+
key: "log",
|
8748 |
+
value: function log() {
|
8749 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
8750 |
+
args[_key] = arguments[_key];
|
8751 |
+
}
|
8752 |
|
8753 |
+
return this.forward(args, 'log', '', true);
|
8754 |
+
}
|
8755 |
+
}, {
|
8756 |
+
key: "warn",
|
8757 |
+
value: function warn() {
|
8758 |
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
8759 |
+
args[_key2] = arguments[_key2];
|
8760 |
+
}
|
8761 |
|
8762 |
+
return this.forward(args, 'warn', '', true);
|
8763 |
+
}
|
8764 |
+
}, {
|
8765 |
+
key: "error",
|
8766 |
+
value: function error() {
|
8767 |
+
for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
|
8768 |
+
args[_key3] = arguments[_key3];
|
8769 |
+
}
|
8770 |
+
|
8771 |
+
return this.forward(args, 'error', '');
|
8772 |
+
}
|
8773 |
+
}, {
|
8774 |
+
key: "deprecate",
|
8775 |
+
value: function deprecate() {
|
8776 |
+
for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {
|
8777 |
+
args[_key4] = arguments[_key4];
|
8778 |
+
}
|
8779 |
+
|
8780 |
+
return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);
|
8781 |
+
}
|
8782 |
+
}, {
|
8783 |
+
key: "forward",
|
8784 |
+
value: function forward(args, lvl, prefix, debugOnly) {
|
8785 |
+
if (debugOnly && !this.debug) return null;
|
8786 |
+
if (typeof args[0] === 'string') args[0] = "".concat(prefix).concat(this.prefix, " ").concat(args[0]);
|
8787 |
+
return this.logger[lvl](args);
|
8788 |
+
}
|
8789 |
+
}, {
|
8790 |
+
key: "create",
|
8791 |
+
value: function create(moduleName) {
|
8792 |
+
return new Logger(this.logger, _objectSpread(_objectSpread({}, {
|
8793 |
+
prefix: "".concat(this.prefix, ":").concat(moduleName, ":")
|
8794 |
+
}), this.options));
|
8795 |
+
}
|
8796 |
+
}]);
|
8797 |
+
|
8798 |
+
return Logger;
|
8799 |
+
}();
|
8800 |
+
|
8801 |
+
var baseLogger = new Logger();
|
8802 |
+
|
8803 |
+
var EventEmitter = function () {
|
8804 |
+
function EventEmitter() {
|
8805 |
+
_classCallCheck(this, EventEmitter);
|
8806 |
+
|
8807 |
+
this.observers = {};
|
8808 |
+
}
|
8809 |
+
|
8810 |
+
(0,createClass/* default */.Z)(EventEmitter, [{
|
8811 |
+
key: "on",
|
8812 |
+
value: function on(events, listener) {
|
8813 |
+
var _this = this;
|
8814 |
+
|
8815 |
+
events.split(' ').forEach(function (event) {
|
8816 |
+
_this.observers[event] = _this.observers[event] || [];
|
8817 |
+
|
8818 |
+
_this.observers[event].push(listener);
|
8819 |
+
});
|
8820 |
+
return this;
|
8821 |
+
}
|
8822 |
+
}, {
|
8823 |
+
key: "off",
|
8824 |
+
value: function off(event, listener) {
|
8825 |
+
if (!this.observers[event]) return;
|
8826 |
+
|
8827 |
+
if (!listener) {
|
8828 |
+
delete this.observers[event];
|
8829 |
return;
|
8830 |
}
|
8831 |
|
8832 |
+
this.observers[event] = this.observers[event].filter(function (l) {
|
8833 |
+
return l !== listener;
|
8834 |
+
});
|
8835 |
+
}
|
8836 |
+
}, {
|
8837 |
+
key: "emit",
|
8838 |
+
value: function emit(event) {
|
8839 |
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
8840 |
+
args[_key - 1] = arguments[_key];
|
8841 |
}
|
8842 |
|
8843 |
+
if (this.observers[event]) {
|
8844 |
+
var cloned = [].concat(this.observers[event]);
|
8845 |
+
cloned.forEach(function (observer) {
|
8846 |
+
observer.apply(void 0, args);
|
8847 |
+
});
|
8848 |
+
}
|
8849 |
+
|
8850 |
+
if (this.observers['*']) {
|
8851 |
+
var _cloned = [].concat(this.observers['*']);
|
8852 |
+
|
8853 |
+
_cloned.forEach(function (observer) {
|
8854 |
+
observer.apply(observer, [event].concat(args));
|
8855 |
+
});
|
8856 |
+
}
|
8857 |
+
}
|
8858 |
+
}]);
|
8859 |
+
|
8860 |
+
return EventEmitter;
|
8861 |
+
}();
|
8862 |
+
|
8863 |
+
function defer() {
|
8864 |
+
var res;
|
8865 |
+
var rej;
|
8866 |
+
var promise = new Promise(function (resolve, reject) {
|
8867 |
+
res = resolve;
|
8868 |
+
rej = reject;
|
8869 |
});
|
8870 |
+
promise.resolve = res;
|
8871 |
+
promise.reject = rej;
|
8872 |
+
return promise;
|
8873 |
}
|
8874 |
+
function makeString(object) {
|
8875 |
+
if (object == null) return '';
|
8876 |
+
return '' + object;
|
8877 |
+
}
|
8878 |
+
function copy(a, s, t) {
|
8879 |
+
a.forEach(function (m) {
|
8880 |
+
if (s[m]) t[m] = s[m];
|
|
|
|
|
|
|
|
|
|
|
|
|
8881 |
});
|
8882 |
}
|
|
|
|
|
|
|
8883 |
|
8884 |
+
function getLastOfPath(object, path, Empty) {
|
8885 |
+
function cleanKey(key) {
|
8886 |
+
return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key;
|
8887 |
+
}
|
8888 |
+
|
8889 |
+
function canNotTraverseDeeper() {
|
8890 |
+
return !object || typeof object === 'string';
|
8891 |
+
}
|
8892 |
+
|
8893 |
+
var stack = typeof path !== 'string' ? [].concat(path) : path.split('.');
|
8894 |
+
|
8895 |
+
while (stack.length > 1) {
|
8896 |
+
if (canNotTraverseDeeper()) return {};
|
8897 |
+
var key = cleanKey(stack.shift());
|
8898 |
+
if (!object[key] && Empty) object[key] = new Empty();
|
8899 |
+
|
8900 |
+
if (Object.prototype.hasOwnProperty.call(object, key)) {
|
8901 |
+
object = object[key];
|
8902 |
+
} else {
|
8903 |
+
object = {};
|
8904 |
}
|
8905 |
+
}
|
8906 |
+
|
8907 |
+
if (canNotTraverseDeeper()) return {};
|
8908 |
+
return {
|
8909 |
+
obj: object,
|
8910 |
+
k: cleanKey(stack.shift())
|
8911 |
};
|
8912 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
8913 |
|
8914 |
+
function setPath(object, path, newValue) {
|
8915 |
+
var _getLastOfPath = getLastOfPath(object, path, Object),
|
8916 |
+
obj = _getLastOfPath.obj,
|
8917 |
+
k = _getLastOfPath.k;
|
8918 |
|
8919 |
+
obj[k] = newValue;
|
8920 |
+
}
|
8921 |
+
function pushPath(object, path, newValue, concat) {
|
8922 |
+
var _getLastOfPath2 = getLastOfPath(object, path, Object),
|
8923 |
+
obj = _getLastOfPath2.obj,
|
8924 |
+
k = _getLastOfPath2.k;
|
8925 |
|
8926 |
+
obj[k] = obj[k] || [];
|
8927 |
+
if (concat) obj[k] = obj[k].concat(newValue);
|
8928 |
+
if (!concat) obj[k].push(newValue);
|
8929 |
+
}
|
8930 |
+
function getPath(object, path) {
|
8931 |
+
var _getLastOfPath3 = getLastOfPath(object, path),
|
8932 |
+
obj = _getLastOfPath3.obj,
|
8933 |
+
k = _getLastOfPath3.k;
|
|
|
|
|
|
|
8934 |
|
8935 |
+
if (!obj) return undefined;
|
8936 |
+
return obj[k];
|
8937 |
+
}
|
8938 |
+
function getPathWithDefaults(data, defaultData, key) {
|
8939 |
+
var value = getPath(data, key);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8940 |
|
8941 |
+
if (value !== undefined) {
|
8942 |
+
return value;
|
8943 |
+
}
|
8944 |
|
8945 |
+
return getPath(defaultData, key);
|
8946 |
+
}
|
8947 |
+
function deepExtend(target, source, overwrite) {
|
8948 |
+
for (var prop in source) {
|
8949 |
+
if (prop !== '__proto__' && prop !== 'constructor') {
|
8950 |
+
if (prop in target) {
|
8951 |
+
if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) {
|
8952 |
+
if (overwrite) target[prop] = source[prop];
|
8953 |
+
} else {
|
8954 |
+
deepExtend(target[prop], source[prop], overwrite);
|
8955 |
+
}
|
8956 |
+
} else {
|
8957 |
+
target[prop] = source[prop];
|
8958 |
+
}
|
8959 |
+
}
|
8960 |
+
}
|
8961 |
+
|
8962 |
+
return target;
|
8963 |
+
}
|
8964 |
+
function regexEscape(str) {
|
8965 |
+
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
|
8966 |
+
}
|
8967 |
+
var _entityMap = {
|
8968 |
+
'&': '&',
|
8969 |
+
'<': '<',
|
8970 |
+
'>': '>',
|
8971 |
+
'"': '"',
|
8972 |
+
"'": ''',
|
8973 |
+
'/': '/'
|
8974 |
+
};
|
8975 |
+
function i18next_escape(data) {
|
8976 |
+
if (typeof data === 'string') {
|
8977 |
+
return data.replace(/[&<>"'\/]/g, function (s) {
|
8978 |
+
return _entityMap[s];
|
8979 |
});
|
8980 |
}
|
8981 |
|
8982 |
+
return data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8983 |
}
|
8984 |
+
var isIE10 = typeof window !== 'undefined' && window.navigator && window.navigator.userAgent && window.navigator.userAgent.indexOf('MSIE') > -1;
|
8985 |
+
var chars = [' ', ',', '?', '!', ';'];
|
8986 |
+
function looksLikeObjectPath(key, nsSeparator, keySeparator) {
|
8987 |
+
nsSeparator = nsSeparator || '';
|
8988 |
+
keySeparator = keySeparator || '';
|
8989 |
+
var possibleChars = chars.filter(function (c) {
|
8990 |
+
return nsSeparator.indexOf(c) < 0 && keySeparator.indexOf(c) < 0;
|
8991 |
});
|
8992 |
+
if (possibleChars.length === 0) return true;
|
8993 |
+
var r = new RegExp("(".concat(possibleChars.map(function (c) {
|
8994 |
+
return c === '?' ? '\\?' : c;
|
8995 |
+
}).join('|'), ")"));
|
8996 |
+
var matched = !r.test(key);
|
8997 |
|
8998 |
+
if (!matched) {
|
8999 |
+
var ki = key.indexOf(keySeparator);
|
9000 |
|
9001 |
+
if (ki > 0 && !r.test(key.substring(0, ki))) {
|
9002 |
+
matched = true;
|
9003 |
+
}
|
9004 |
+
}
|
|
|
9005 |
|
9006 |
+
return matched;
|
|
|
|
|
|
|
|
|
9007 |
}
|
|
|
|
|
|
|
|
|
|
|
9008 |
|
9009 |
+
function ownKeys$1(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9010 |
|
9011 |
+
function _objectSpread$1(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$1(Object(source), true).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$1(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
9012 |
+
|
9013 |
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
9014 |
+
|
9015 |
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
9016 |
+
|
9017 |
+
function deepFind(obj, path) {
|
9018 |
+
var keySeparator = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '.';
|
9019 |
+
if (!obj) return undefined;
|
9020 |
+
if (obj[path]) return obj[path];
|
9021 |
+
var paths = path.split(keySeparator);
|
9022 |
+
var current = obj;
|
9023 |
+
|
9024 |
+
for (var i = 0; i < paths.length; ++i) {
|
9025 |
+
if (!current) return undefined;
|
9026 |
+
|
9027 |
+
if (typeof current[paths[i]] === 'string' && i + 1 < paths.length) {
|
9028 |
+
return undefined;
|
9029 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9030 |
|
9031 |
+
if (current[paths[i]] === undefined) {
|
9032 |
+
var j = 2;
|
9033 |
+
var p = paths.slice(i, i + j).join(keySeparator);
|
9034 |
+
var mix = current[p];
|
9035 |
+
|
9036 |
+
while (mix === undefined && paths.length > i + j) {
|
9037 |
+
j++;
|
9038 |
+
p = paths.slice(i, i + j).join(keySeparator);
|
9039 |
+
mix = current[p];
|
9040 |
+
}
|
9041 |
+
|
9042 |
+
if (mix === undefined) return undefined;
|
9043 |
+
|
9044 |
+
if (path.endsWith(p)) {
|
9045 |
+
if (typeof mix === 'string') return mix;
|
9046 |
+
if (p && typeof mix[p] === 'string') return mix[p];
|
9047 |
+
}
|
9048 |
+
|
9049 |
+
var joinedPath = paths.slice(i + j).join(keySeparator);
|
9050 |
+
if (joinedPath) return deepFind(mix, joinedPath, keySeparator);
|
9051 |
+
return undefined;
|
9052 |
}
|
9053 |
+
|
9054 |
+
current = current[paths[i]];
|
9055 |
+
}
|
9056 |
+
|
9057 |
+
return current;
|
9058 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9059 |
|
9060 |
+
var ResourceStore = function (_EventEmitter) {
|
9061 |
+
_inherits(ResourceStore, _EventEmitter);
|
9062 |
+
|
9063 |
+
var _super = _createSuper(ResourceStore);
|
9064 |
+
|
9065 |
+
function ResourceStore(data) {
|
9066 |
+
var _this;
|
9067 |
+
|
9068 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
9069 |
+
ns: ['translation'],
|
9070 |
+
defaultNS: 'translation'
|
9071 |
};
|
|
|
9072 |
|
9073 |
+
_classCallCheck(this, ResourceStore);
|
9074 |
|
9075 |
+
_this = _super.call(this);
|
9076 |
+
|
9077 |
+
if (isIE10) {
|
9078 |
+
EventEmitter.call((0,assertThisInitialized/* default */.Z)(_this));
|
|
|
|
|
9079 |
}
|
9080 |
+
|
9081 |
+
_this.data = data || {};
|
9082 |
+
_this.options = options;
|
9083 |
+
|
9084 |
+
if (_this.options.keySeparator === undefined) {
|
9085 |
+
_this.options.keySeparator = '.';
|
|
|
|
|
9086 |
}
|
9087 |
+
|
9088 |
+
if (_this.options.ignoreJSONStructure === undefined) {
|
9089 |
+
_this.options.ignoreJSONStructure = true;
|
|
|
|
|
|
|
|
|
|
|
9090 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
9091 |
|
9092 |
+
return _this;
|
9093 |
+
}
|
9094 |
+
|
9095 |
+
(0,createClass/* default */.Z)(ResourceStore, [{
|
9096 |
+
key: "addNamespaces",
|
9097 |
+
value: function addNamespaces(ns) {
|
9098 |
+
if (this.options.ns.indexOf(ns) < 0) {
|
9099 |
+
this.options.ns.push(ns);
|
9100 |
+
}
|
9101 |
}
|
9102 |
+
}, {
|
9103 |
+
key: "removeNamespaces",
|
9104 |
+
value: function removeNamespaces(ns) {
|
9105 |
+
var index = this.options.ns.indexOf(ns);
|
9106 |
+
|
9107 |
+
if (index > -1) {
|
9108 |
+
this.options.ns.splice(index, 1);
|
9109 |
+
}
|
9110 |
}
|
9111 |
+
}, {
|
9112 |
+
key: "getResource",
|
9113 |
+
value: function getResource(lng, ns, key) {
|
9114 |
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
9115 |
+
var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
9116 |
+
var ignoreJSONStructure = options.ignoreJSONStructure !== undefined ? options.ignoreJSONStructure : this.options.ignoreJSONStructure;
|
9117 |
+
var path = [lng, ns];
|
9118 |
+
if (key && typeof key !== 'string') path = path.concat(key);
|
9119 |
+
if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key);
|
9120 |
+
|
9121 |
+
if (lng.indexOf('.') > -1) {
|
9122 |
+
path = lng.split('.');
|
9123 |
+
}
|
9124 |
+
|
9125 |
+
var result = getPath(this.data, path);
|
9126 |
+
if (result || !ignoreJSONStructure || typeof key !== 'string') return result;
|
9127 |
+
return deepFind(this.data && this.data[lng] && this.data[lng][ns], key, keySeparator);
|
9128 |
}
|
9129 |
+
}, {
|
9130 |
+
key: "addResource",
|
9131 |
+
value: function addResource(lng, ns, key, value) {
|
9132 |
+
var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {
|
9133 |
+
silent: false
|
9134 |
+
};
|
9135 |
+
var keySeparator = this.options.keySeparator;
|
9136 |
+
if (keySeparator === undefined) keySeparator = '.';
|
9137 |
+
var path = [lng, ns];
|
9138 |
+
if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);
|
9139 |
+
|
9140 |
+
if (lng.indexOf('.') > -1) {
|
9141 |
+
path = lng.split('.');
|
9142 |
+
value = ns;
|
9143 |
+
ns = path[1];
|
9144 |
+
}
|
9145 |
+
|
9146 |
+
this.addNamespaces(ns);
|
9147 |
+
setPath(this.data, path, value);
|
9148 |
+
if (!options.silent) this.emit('added', lng, ns, key, value);
|
9149 |
}
|
9150 |
+
}, {
|
9151 |
+
key: "addResources",
|
9152 |
+
value: function addResources(lng, ns, resources) {
|
9153 |
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {
|
9154 |
+
silent: false
|
9155 |
+
};
|
|
|
9156 |
|
9157 |
+
for (var m in resources) {
|
9158 |
+
if (typeof resources[m] === 'string' || Object.prototype.toString.apply(resources[m]) === '[object Array]') this.addResource(lng, ns, m, resources[m], {
|
9159 |
+
silent: true
|
9160 |
+
});
|
9161 |
+
}
|
9162 |
+
|
9163 |
+
if (!options.silent) this.emit('added', lng, ns, resources);
|
9164 |
}
|
9165 |
+
}, {
|
9166 |
+
key: "addResourceBundle",
|
9167 |
+
value: function addResourceBundle(lng, ns, resources, deep, overwrite) {
|
9168 |
+
var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {
|
9169 |
+
silent: false
|
9170 |
+
};
|
9171 |
+
var path = [lng, ns];
|
9172 |
+
|
9173 |
+
if (lng.indexOf('.') > -1) {
|
9174 |
+
path = lng.split('.');
|
9175 |
+
deep = resources;
|
9176 |
+
resources = ns;
|
9177 |
+
ns = path[1];
|
9178 |
+
}
|
9179 |
+
|
9180 |
+
this.addNamespaces(ns);
|
9181 |
+
var pack = getPath(this.data, path) || {};
|
9182 |
+
|
9183 |
+
if (deep) {
|
9184 |
+
deepExtend(pack, resources, overwrite);
|
9185 |
+
} else {
|
9186 |
+
pack = _objectSpread$1(_objectSpread$1({}, pack), resources);
|
9187 |
+
}
|
9188 |
+
|
9189 |
+
setPath(this.data, path, pack);
|
9190 |
+
if (!options.silent) this.emit('added', lng, ns, resources);
|
9191 |
+
}
|
9192 |
+
}, {
|
9193 |
+
key: "removeResourceBundle",
|
9194 |
+
value: function removeResourceBundle(lng, ns) {
|
9195 |
+
if (this.hasResourceBundle(lng, ns)) {
|
9196 |
+
delete this.data[lng][ns];
|
9197 |
+
}
|
9198 |
+
|
9199 |
+
this.removeNamespaces(ns);
|
9200 |
+
this.emit('removed', lng, ns);
|
9201 |
+
}
|
9202 |
+
}, {
|
9203 |
+
key: "hasResourceBundle",
|
9204 |
+
value: function hasResourceBundle(lng, ns) {
|
9205 |
+
return this.getResource(lng, ns) !== undefined;
|
9206 |
+
}
|
9207 |
+
}, {
|
9208 |
+
key: "getResourceBundle",
|
9209 |
+
value: function getResourceBundle(lng, ns) {
|
9210 |
+
if (!ns) ns = this.options.defaultNS;
|
9211 |
+
if (this.options.compatibilityAPI === 'v1') return _objectSpread$1(_objectSpread$1({}, {}), this.getResource(lng, ns));
|
9212 |
+
return this.getResource(lng, ns);
|
9213 |
+
}
|
9214 |
+
}, {
|
9215 |
+
key: "getDataByLanguage",
|
9216 |
+
value: function getDataByLanguage(lng) {
|
9217 |
+
return this.data[lng];
|
9218 |
+
}
|
9219 |
+
}, {
|
9220 |
+
key: "hasLanguageSomeTranslations",
|
9221 |
+
value: function hasLanguageSomeTranslations(lng) {
|
9222 |
+
var data = this.getDataByLanguage(lng);
|
9223 |
+
var n = data && Object.keys(data) || [];
|
9224 |
+
return !!n.find(function (v) {
|
9225 |
+
return data[v] && Object.keys(data[v]).length > 0;
|
9226 |
+
});
|
9227 |
+
}
|
9228 |
+
}, {
|
9229 |
+
key: "toJSON",
|
9230 |
+
value: function toJSON() {
|
9231 |
+
return this.data;
|
9232 |
+
}
|
9233 |
+
}]);
|
9234 |
+
|
9235 |
+
return ResourceStore;
|
9236 |
+
}(EventEmitter);
|
9237 |
+
|
9238 |
+
var postProcessor = {
|
9239 |
+
processors: {},
|
9240 |
+
addPostProcessor: function addPostProcessor(module) {
|
9241 |
+
this.processors[module.name] = module;
|
9242 |
+
},
|
9243 |
+
handle: function handle(processors, value, key, options, translator) {
|
9244 |
+
var _this = this;
|
9245 |
+
|
9246 |
+
processors.forEach(function (processor) {
|
9247 |
+
if (_this.processors[processor]) value = _this.processors[processor].process(value, key, options, translator);
|
9248 |
+
});
|
9249 |
+
return value;
|
9250 |
+
}
|
9251 |
+
};
|
9252 |
+
|
9253 |
+
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
9254 |
+
|
9255 |
+
function _objectSpread$2(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
9256 |
+
|
9257 |
+
function _createSuper$1(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$1(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
9258 |
+
|
9259 |
+
function _isNativeReflectConstruct$1() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
9260 |
+
var checkedLoadedFor = {};
|
9261 |
+
|
9262 |
+
var Translator = function (_EventEmitter) {
|
9263 |
+
_inherits(Translator, _EventEmitter);
|
9264 |
+
|
9265 |
+
var _super = _createSuper$1(Translator);
|
9266 |
+
|
9267 |
+
function Translator(services) {
|
9268 |
+
var _this;
|
9269 |
+
|
9270 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
9271 |
+
|
9272 |
+
_classCallCheck(this, Translator);
|
9273 |
+
|
9274 |
+
_this = _super.call(this);
|
9275 |
+
|
9276 |
+
if (isIE10) {
|
9277 |
+
EventEmitter.call((0,assertThisInitialized/* default */.Z)(_this));
|
9278 |
+
}
|
9279 |
+
|
9280 |
+
copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, (0,assertThisInitialized/* default */.Z)(_this));
|
9281 |
+
_this.options = options;
|
9282 |
+
|
9283 |
+
if (_this.options.keySeparator === undefined) {
|
9284 |
+
_this.options.keySeparator = '.';
|
9285 |
+
}
|
9286 |
+
|
9287 |
+
_this.logger = baseLogger.create('translator');
|
9288 |
+
return _this;
|
9289 |
+
}
|
9290 |
+
|
9291 |
+
(0,createClass/* default */.Z)(Translator, [{
|
9292 |
+
key: "changeLanguage",
|
9293 |
+
value: function changeLanguage(lng) {
|
9294 |
+
if (lng) this.language = lng;
|
9295 |
+
}
|
9296 |
+
}, {
|
9297 |
+
key: "exists",
|
9298 |
+
value: function exists(key) {
|
9299 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
9300 |
+
interpolation: {}
|
9301 |
+
};
|
9302 |
+
|
9303 |
+
if (key === undefined || key === null) {
|
9304 |
+
return false;
|
9305 |
+
}
|
9306 |
+
|
9307 |
+
var resolved = this.resolve(key, options);
|
9308 |
+
return resolved && resolved.res !== undefined;
|
9309 |
+
}
|
9310 |
+
}, {
|
9311 |
+
key: "extractFromKey",
|
9312 |
+
value: function extractFromKey(key, options) {
|
9313 |
+
var nsSeparator = options.nsSeparator !== undefined ? options.nsSeparator : this.options.nsSeparator;
|
9314 |
+
if (nsSeparator === undefined) nsSeparator = ':';
|
9315 |
+
var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
9316 |
+
var namespaces = options.ns || this.options.defaultNS || [];
|
9317 |
+
var wouldCheckForNsInKey = nsSeparator && key.indexOf(nsSeparator) > -1;
|
9318 |
+
var seemsNaturalLanguage = !this.options.userDefinedKeySeparator && !options.keySeparator && !this.options.userDefinedNsSeparator && !options.nsSeparator && !looksLikeObjectPath(key, nsSeparator, keySeparator);
|
9319 |
+
|
9320 |
+
if (wouldCheckForNsInKey && !seemsNaturalLanguage) {
|
9321 |
+
var m = key.match(this.interpolator.nestingRegexp);
|
9322 |
+
|
9323 |
+
if (m && m.length > 0) {
|
9324 |
+
return {
|
9325 |
+
key: key,
|
9326 |
+
namespaces: namespaces
|
9327 |
+
};
|
9328 |
+
}
|
9329 |
+
|
9330 |
+
var parts = key.split(nsSeparator);
|
9331 |
+
if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();
|
9332 |
+
key = parts.join(keySeparator);
|
9333 |
+
}
|
9334 |
+
|
9335 |
+
if (typeof namespaces === 'string') namespaces = [namespaces];
|
9336 |
+
return {
|
9337 |
+
key: key,
|
9338 |
+
namespaces: namespaces
|
9339 |
+
};
|
9340 |
+
}
|
9341 |
+
}, {
|
9342 |
+
key: "translate",
|
9343 |
+
value: function translate(keys, options, lastKey) {
|
9344 |
+
var _this2 = this;
|
9345 |
+
|
9346 |
+
if ((0,esm_typeof/* default */.Z)(options) !== 'object' && this.options.overloadTranslationOptionHandler) {
|
9347 |
+
options = this.options.overloadTranslationOptionHandler(arguments);
|
9348 |
+
}
|
9349 |
+
|
9350 |
+
if (!options) options = {};
|
9351 |
+
if (keys === undefined || keys === null) return '';
|
9352 |
+
if (!Array.isArray(keys)) keys = [String(keys)];
|
9353 |
+
var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;
|
9354 |
+
|
9355 |
+
var _this$extractFromKey = this.extractFromKey(keys[keys.length - 1], options),
|
9356 |
+
key = _this$extractFromKey.key,
|
9357 |
+
namespaces = _this$extractFromKey.namespaces;
|
9358 |
+
|
9359 |
+
var namespace = namespaces[namespaces.length - 1];
|
9360 |
+
var lng = options.lng || this.language;
|
9361 |
+
var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;
|
9362 |
+
|
9363 |
+
if (lng && lng.toLowerCase() === 'cimode') {
|
9364 |
+
if (appendNamespaceToCIMode) {
|
9365 |
+
var nsSeparator = options.nsSeparator || this.options.nsSeparator;
|
9366 |
+
return namespace + nsSeparator + key;
|
9367 |
+
}
|
9368 |
+
|
9369 |
+
return key;
|
9370 |
+
}
|
9371 |
+
|
9372 |
+
var resolved = this.resolve(keys, options);
|
9373 |
+
var res = resolved && resolved.res;
|
9374 |
+
var resUsedKey = resolved && resolved.usedKey || key;
|
9375 |
+
var resExactUsedKey = resolved && resolved.exactUsedKey || key;
|
9376 |
+
var resType = Object.prototype.toString.apply(res);
|
9377 |
+
var noObject = ['[object Number]', '[object Function]', '[object RegExp]'];
|
9378 |
+
var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays;
|
9379 |
+
var handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;
|
9380 |
+
var handleAsObject = typeof res !== 'string' && typeof res !== 'boolean' && typeof res !== 'number';
|
9381 |
+
|
9382 |
+
if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(typeof joinArrays === 'string' && resType === '[object Array]')) {
|
9383 |
+
if (!options.returnObjects && !this.options.returnObjects) {
|
9384 |
+
if (!this.options.returnedObjectHandler) {
|
9385 |
+
this.logger.warn('accessing an object - but returnObjects options is not enabled!');
|
9386 |
+
}
|
9387 |
+
|
9388 |
+
return this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, _objectSpread$2(_objectSpread$2({}, options), {}, {
|
9389 |
+
ns: namespaces
|
9390 |
+
})) : "key '".concat(key, " (").concat(this.language, ")' returned an object instead of string.");
|
9391 |
+
}
|
9392 |
+
|
9393 |
+
if (keySeparator) {
|
9394 |
+
var resTypeIsArray = resType === '[object Array]';
|
9395 |
+
var copy = resTypeIsArray ? [] : {};
|
9396 |
+
var newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;
|
9397 |
+
|
9398 |
+
for (var m in res) {
|
9399 |
+
if (Object.prototype.hasOwnProperty.call(res, m)) {
|
9400 |
+
var deepKey = "".concat(newKeyToUse).concat(keySeparator).concat(m);
|
9401 |
+
copy[m] = this.translate(deepKey, _objectSpread$2(_objectSpread$2({}, options), {
|
9402 |
+
joinArrays: false,
|
9403 |
+
ns: namespaces
|
9404 |
+
}));
|
9405 |
+
if (copy[m] === deepKey) copy[m] = res[m];
|
9406 |
+
}
|
9407 |
+
}
|
9408 |
+
|
9409 |
+
res = copy;
|
9410 |
+
}
|
9411 |
+
} else if (handleAsObjectInI18nFormat && typeof joinArrays === 'string' && resType === '[object Array]') {
|
9412 |
+
res = res.join(joinArrays);
|
9413 |
+
if (res) res = this.extendTranslation(res, keys, options, lastKey);
|
9414 |
+
} else {
|
9415 |
+
var usedDefault = false;
|
9416 |
+
var usedKey = false;
|
9417 |
+
var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';
|
9418 |
+
var hasDefaultValue = Translator.hasDefaultValue(options);
|
9419 |
+
var defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count, options) : '';
|
9420 |
+
var defaultValue = options["defaultValue".concat(defaultValueSuffix)] || options.defaultValue;
|
9421 |
+
|
9422 |
+
if (!this.isValidLookup(res) && hasDefaultValue) {
|
9423 |
+
usedDefault = true;
|
9424 |
+
res = defaultValue;
|
9425 |
+
}
|
9426 |
+
|
9427 |
+
if (!this.isValidLookup(res)) {
|
9428 |
+
usedKey = true;
|
9429 |
+
res = key;
|
9430 |
+
}
|
9431 |
+
|
9432 |
+
var missingKeyNoValueFallbackToKey = options.missingKeyNoValueFallbackToKey || this.options.missingKeyNoValueFallbackToKey;
|
9433 |
+
var resForMissing = missingKeyNoValueFallbackToKey && usedKey ? undefined : res;
|
9434 |
+
var updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;
|
9435 |
+
|
9436 |
+
if (usedKey || usedDefault || updateMissing) {
|
9437 |
+
this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? defaultValue : res);
|
9438 |
+
|
9439 |
+
if (keySeparator) {
|
9440 |
+
var fk = this.resolve(key, _objectSpread$2(_objectSpread$2({}, options), {}, {
|
9441 |
+
keySeparator: false
|
9442 |
+
}));
|
9443 |
+
if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.');
|
9444 |
+
}
|
9445 |
+
|
9446 |
+
var lngs = [];
|
9447 |
+
var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language);
|
9448 |
+
|
9449 |
+
if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {
|
9450 |
+
for (var i = 0; i < fallbackLngs.length; i++) {
|
9451 |
+
lngs.push(fallbackLngs[i]);
|
9452 |
+
}
|
9453 |
+
} else if (this.options.saveMissingTo === 'all') {
|
9454 |
+
lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language);
|
9455 |
+
} else {
|
9456 |
+
lngs.push(options.lng || this.language);
|
9457 |
+
}
|
9458 |
+
|
9459 |
+
var send = function send(l, k, specificDefaultValue) {
|
9460 |
+
var defaultForMissing = hasDefaultValue && specificDefaultValue !== res ? specificDefaultValue : resForMissing;
|
9461 |
+
|
9462 |
+
if (_this2.options.missingKeyHandler) {
|
9463 |
+
_this2.options.missingKeyHandler(l, namespace, k, defaultForMissing, updateMissing, options);
|
9464 |
+
} else if (_this2.backendConnector && _this2.backendConnector.saveMissing) {
|
9465 |
+
_this2.backendConnector.saveMissing(l, namespace, k, defaultForMissing, updateMissing, options);
|
9466 |
+
}
|
9467 |
+
|
9468 |
+
_this2.emit('missingKey', l, namespace, k, res);
|
9469 |
+
};
|
9470 |
+
|
9471 |
+
if (this.options.saveMissing) {
|
9472 |
+
if (this.options.saveMissingPlurals && needsPluralHandling) {
|
9473 |
+
lngs.forEach(function (language) {
|
9474 |
+
_this2.pluralResolver.getSuffixes(language).forEach(function (suffix) {
|
9475 |
+
send([language], key + suffix, options["defaultValue".concat(suffix)] || defaultValue);
|
9476 |
+
});
|
9477 |
+
});
|
9478 |
+
} else {
|
9479 |
+
send(lngs, key, defaultValue);
|
9480 |
+
}
|
9481 |
+
}
|
9482 |
+
}
|
9483 |
+
|
9484 |
+
res = this.extendTranslation(res, keys, options, resolved, lastKey);
|
9485 |
+
if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = "".concat(namespace, ":").concat(key);
|
9486 |
+
if ((usedKey || usedDefault) && this.options.parseMissingKeyHandler) res = this.options.parseMissingKeyHandler(res);
|
9487 |
+
}
|
9488 |
+
|
9489 |
+
return res;
|
9490 |
+
}
|
9491 |
+
}, {
|
9492 |
+
key: "extendTranslation",
|
9493 |
+
value: function extendTranslation(res, key, options, resolved, lastKey) {
|
9494 |
+
var _this3 = this;
|
9495 |
+
|
9496 |
+
if (this.i18nFormat && this.i18nFormat.parse) {
|
9497 |
+
res = this.i18nFormat.parse(res, options, resolved.usedLng, resolved.usedNS, resolved.usedKey, {
|
9498 |
+
resolved: resolved
|
9499 |
+
});
|
9500 |
+
} else if (!options.skipInterpolation) {
|
9501 |
+
if (options.interpolation) this.interpolator.init(_objectSpread$2(_objectSpread$2({}, options), {
|
9502 |
+
interpolation: _objectSpread$2(_objectSpread$2({}, this.options.interpolation), options.interpolation)
|
9503 |
+
}));
|
9504 |
+
var skipOnVariables = typeof res === 'string' && (options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables);
|
9505 |
+
var nestBef;
|
9506 |
+
|
9507 |
+
if (skipOnVariables) {
|
9508 |
+
var nb = res.match(this.interpolator.nestingRegexp);
|
9509 |
+
nestBef = nb && nb.length;
|
9510 |
+
}
|
9511 |
+
|
9512 |
+
var data = options.replace && typeof options.replace !== 'string' ? options.replace : options;
|
9513 |
+
if (this.options.interpolation.defaultVariables) data = _objectSpread$2(_objectSpread$2({}, this.options.interpolation.defaultVariables), data);
|
9514 |
+
res = this.interpolator.interpolate(res, data, options.lng || this.language, options);
|
9515 |
+
|
9516 |
+
if (skipOnVariables) {
|
9517 |
+
var na = res.match(this.interpolator.nestingRegexp);
|
9518 |
+
var nestAft = na && na.length;
|
9519 |
+
if (nestBef < nestAft) options.nest = false;
|
9520 |
+
}
|
9521 |
+
|
9522 |
+
if (options.nest !== false) res = this.interpolator.nest(res, function () {
|
9523 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
9524 |
+
args[_key] = arguments[_key];
|
9525 |
+
}
|
9526 |
+
|
9527 |
+
if (lastKey && lastKey[0] === args[0] && !options.context) {
|
9528 |
+
_this3.logger.warn("It seems you are nesting recursively key: ".concat(args[0], " in key: ").concat(key[0]));
|
9529 |
+
|
9530 |
+
return null;
|
9531 |
+
}
|
9532 |
+
|
9533 |
+
return _this3.translate.apply(_this3, args.concat([key]));
|
9534 |
+
}, options);
|
9535 |
+
if (options.interpolation) this.interpolator.reset();
|
9536 |
+
}
|
9537 |
+
|
9538 |
+
var postProcess = options.postProcess || this.options.postProcess;
|
9539 |
+
var postProcessorNames = typeof postProcess === 'string' ? [postProcess] : postProcess;
|
9540 |
+
|
9541 |
+
if (res !== undefined && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) {
|
9542 |
+
res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? _objectSpread$2({
|
9543 |
+
i18nResolved: resolved
|
9544 |
+
}, options) : options, this);
|
9545 |
+
}
|
9546 |
+
|
9547 |
+
return res;
|
9548 |
+
}
|
9549 |
+
}, {
|
9550 |
+
key: "resolve",
|
9551 |
+
value: function resolve(keys) {
|
9552 |
+
var _this4 = this;
|
9553 |
+
|
9554 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
9555 |
+
var found;
|
9556 |
+
var usedKey;
|
9557 |
+
var exactUsedKey;
|
9558 |
+
var usedLng;
|
9559 |
+
var usedNS;
|
9560 |
+
if (typeof keys === 'string') keys = [keys];
|
9561 |
+
keys.forEach(function (k) {
|
9562 |
+
if (_this4.isValidLookup(found)) return;
|
9563 |
+
|
9564 |
+
var extracted = _this4.extractFromKey(k, options);
|
9565 |
+
|
9566 |
+
var key = extracted.key;
|
9567 |
+
usedKey = key;
|
9568 |
+
var namespaces = extracted.namespaces;
|
9569 |
+
if (_this4.options.fallbackNS) namespaces = namespaces.concat(_this4.options.fallbackNS);
|
9570 |
+
var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';
|
9571 |
+
|
9572 |
+
var needsZeroSuffixLookup = needsPluralHandling && !options.ordinal && options.count === 0 && _this4.pluralResolver.shouldUseIntlApi();
|
9573 |
+
|
9574 |
+
var needsContextHandling = options.context !== undefined && (typeof options.context === 'string' || typeof options.context === 'number') && options.context !== '';
|
9575 |
+
var codes = options.lngs ? options.lngs : _this4.languageUtils.toResolveHierarchy(options.lng || _this4.language, options.fallbackLng);
|
9576 |
+
namespaces.forEach(function (ns) {
|
9577 |
+
if (_this4.isValidLookup(found)) return;
|
9578 |
+
usedNS = ns;
|
9579 |
+
|
9580 |
+
if (!checkedLoadedFor["".concat(codes[0], "-").concat(ns)] && _this4.utils && _this4.utils.hasLoadedNamespace && !_this4.utils.hasLoadedNamespace(usedNS)) {
|
9581 |
+
checkedLoadedFor["".concat(codes[0], "-").concat(ns)] = true;
|
9582 |
+
|
9583 |
+
_this4.logger.warn("key \"".concat(usedKey, "\" for languages \"").concat(codes.join(', '), "\" won't get resolved as namespace \"").concat(usedNS, "\" was not yet loaded"), 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
|
9584 |
+
}
|
9585 |
+
|
9586 |
+
codes.forEach(function (code) {
|
9587 |
+
if (_this4.isValidLookup(found)) return;
|
9588 |
+
usedLng = code;
|
9589 |
+
var finalKeys = [key];
|
9590 |
+
|
9591 |
+
if (_this4.i18nFormat && _this4.i18nFormat.addLookupKeys) {
|
9592 |
+
_this4.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);
|
9593 |
+
} else {
|
9594 |
+
var pluralSuffix;
|
9595 |
+
if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count, options);
|
9596 |
+
var zeroSuffix = '_zero';
|
9597 |
+
|
9598 |
+
if (needsPluralHandling) {
|
9599 |
+
finalKeys.push(key + pluralSuffix);
|
9600 |
+
|
9601 |
+
if (needsZeroSuffixLookup) {
|
9602 |
+
finalKeys.push(key + zeroSuffix);
|
9603 |
+
}
|
9604 |
+
}
|
9605 |
+
|
9606 |
+
if (needsContextHandling) {
|
9607 |
+
var contextKey = "".concat(key).concat(_this4.options.contextSeparator).concat(options.context);
|
9608 |
+
finalKeys.push(contextKey);
|
9609 |
+
|
9610 |
+
if (needsPluralHandling) {
|
9611 |
+
finalKeys.push(contextKey + pluralSuffix);
|
9612 |
+
|
9613 |
+
if (needsZeroSuffixLookup) {
|
9614 |
+
finalKeys.push(contextKey + zeroSuffix);
|
9615 |
+
}
|
9616 |
+
}
|
9617 |
+
}
|
9618 |
+
}
|
9619 |
+
|
9620 |
+
var possibleKey;
|
9621 |
+
|
9622 |
+
while (possibleKey = finalKeys.pop()) {
|
9623 |
+
if (!_this4.isValidLookup(found)) {
|
9624 |
+
exactUsedKey = possibleKey;
|
9625 |
+
found = _this4.getResource(code, ns, possibleKey, options);
|
9626 |
+
}
|
9627 |
+
}
|
9628 |
+
});
|
9629 |
+
});
|
9630 |
+
});
|
9631 |
+
return {
|
9632 |
+
res: found,
|
9633 |
+
usedKey: usedKey,
|
9634 |
+
exactUsedKey: exactUsedKey,
|
9635 |
+
usedLng: usedLng,
|
9636 |
+
usedNS: usedNS
|
9637 |
+
};
|
9638 |
+
}
|
9639 |
+
}, {
|
9640 |
+
key: "isValidLookup",
|
9641 |
+
value: function isValidLookup(res) {
|
9642 |
+
return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');
|
9643 |
+
}
|
9644 |
+
}, {
|
9645 |
+
key: "getResource",
|
9646 |
+
value: function getResource(code, ns, key) {
|
9647 |
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
9648 |
+
if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options);
|
9649 |
+
return this.resourceStore.getResource(code, ns, key, options);
|
9650 |
+
}
|
9651 |
+
}], [{
|
9652 |
+
key: "hasDefaultValue",
|
9653 |
+
value: function hasDefaultValue(options) {
|
9654 |
+
var prefix = 'defaultValue';
|
9655 |
+
|
9656 |
+
for (var option in options) {
|
9657 |
+
if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && undefined !== options[option]) {
|
9658 |
+
return true;
|
9659 |
+
}
|
9660 |
+
}
|
9661 |
+
|
9662 |
+
return false;
|
9663 |
+
}
|
9664 |
+
}]);
|
9665 |
+
|
9666 |
+
return Translator;
|
9667 |
+
}(EventEmitter);
|
9668 |
+
|
9669 |
+
function capitalize(string) {
|
9670 |
+
return string.charAt(0).toUpperCase() + string.slice(1);
|
9671 |
+
}
|
9672 |
+
|
9673 |
+
var LanguageUtil = function () {
|
9674 |
+
function LanguageUtil(options) {
|
9675 |
+
_classCallCheck(this, LanguageUtil);
|
9676 |
+
|
9677 |
+
this.options = options;
|
9678 |
+
this.supportedLngs = this.options.supportedLngs || false;
|
9679 |
+
this.logger = baseLogger.create('languageUtils');
|
9680 |
+
}
|
9681 |
+
|
9682 |
+
(0,createClass/* default */.Z)(LanguageUtil, [{
|
9683 |
+
key: "getScriptPartFromCode",
|
9684 |
+
value: function getScriptPartFromCode(code) {
|
9685 |
+
if (!code || code.indexOf('-') < 0) return null;
|
9686 |
+
var p = code.split('-');
|
9687 |
+
if (p.length === 2) return null;
|
9688 |
+
p.pop();
|
9689 |
+
if (p[p.length - 1].toLowerCase() === 'x') return null;
|
9690 |
+
return this.formatLanguageCode(p.join('-'));
|
9691 |
+
}
|
9692 |
+
}, {
|
9693 |
+
key: "getLanguagePartFromCode",
|
9694 |
+
value: function getLanguagePartFromCode(code) {
|
9695 |
+
if (!code || code.indexOf('-') < 0) return code;
|
9696 |
+
var p = code.split('-');
|
9697 |
+
return this.formatLanguageCode(p[0]);
|
9698 |
+
}
|
9699 |
+
}, {
|
9700 |
+
key: "formatLanguageCode",
|
9701 |
+
value: function formatLanguageCode(code) {
|
9702 |
+
if (typeof code === 'string' && code.indexOf('-') > -1) {
|
9703 |
+
var specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab'];
|
9704 |
+
var p = code.split('-');
|
9705 |
+
|
9706 |
+
if (this.options.lowerCaseLng) {
|
9707 |
+
p = p.map(function (part) {
|
9708 |
+
return part.toLowerCase();
|
9709 |
+
});
|
9710 |
+
} else if (p.length === 2) {
|
9711 |
+
p[0] = p[0].toLowerCase();
|
9712 |
+
p[1] = p[1].toUpperCase();
|
9713 |
+
if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
|
9714 |
+
} else if (p.length === 3) {
|
9715 |
+
p[0] = p[0].toLowerCase();
|
9716 |
+
if (p[1].length === 2) p[1] = p[1].toUpperCase();
|
9717 |
+
if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase();
|
9718 |
+
if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());
|
9719 |
+
if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());
|
9720 |
+
}
|
9721 |
+
|
9722 |
+
return p.join('-');
|
9723 |
+
}
|
9724 |
+
|
9725 |
+
return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;
|
9726 |
+
}
|
9727 |
+
}, {
|
9728 |
+
key: "isSupportedCode",
|
9729 |
+
value: function isSupportedCode(code) {
|
9730 |
+
if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {
|
9731 |
+
code = this.getLanguagePartFromCode(code);
|
9732 |
+
}
|
9733 |
+
|
9734 |
+
return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;
|
9735 |
+
}
|
9736 |
+
}, {
|
9737 |
+
key: "getBestMatchFromCodes",
|
9738 |
+
value: function getBestMatchFromCodes(codes) {
|
9739 |
+
var _this = this;
|
9740 |
+
|
9741 |
+
if (!codes) return null;
|
9742 |
+
var found;
|
9743 |
+
codes.forEach(function (code) {
|
9744 |
+
if (found) return;
|
9745 |
+
|
9746 |
+
var cleanedLng = _this.formatLanguageCode(code);
|
9747 |
+
|
9748 |
+
if (!_this.options.supportedLngs || _this.isSupportedCode(cleanedLng)) found = cleanedLng;
|
9749 |
+
});
|
9750 |
+
|
9751 |
+
if (!found && this.options.supportedLngs) {
|
9752 |
+
codes.forEach(function (code) {
|
9753 |
+
if (found) return;
|
9754 |
+
|
9755 |
+
var lngOnly = _this.getLanguagePartFromCode(code);
|
9756 |
+
|
9757 |
+
if (_this.isSupportedCode(lngOnly)) return found = lngOnly;
|
9758 |
+
found = _this.options.supportedLngs.find(function (supportedLng) {
|
9759 |
+
if (supportedLng.indexOf(lngOnly) === 0) return supportedLng;
|
9760 |
+
});
|
9761 |
+
});
|
9762 |
+
}
|
9763 |
+
|
9764 |
+
if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];
|
9765 |
+
return found;
|
9766 |
+
}
|
9767 |
+
}, {
|
9768 |
+
key: "getFallbackCodes",
|
9769 |
+
value: function getFallbackCodes(fallbacks, code) {
|
9770 |
+
if (!fallbacks) return [];
|
9771 |
+
if (typeof fallbacks === 'function') fallbacks = fallbacks(code);
|
9772 |
+
if (typeof fallbacks === 'string') fallbacks = [fallbacks];
|
9773 |
+
if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks;
|
9774 |
+
if (!code) return fallbacks["default"] || [];
|
9775 |
+
var found = fallbacks[code];
|
9776 |
+
if (!found) found = fallbacks[this.getScriptPartFromCode(code)];
|
9777 |
+
if (!found) found = fallbacks[this.formatLanguageCode(code)];
|
9778 |
+
if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];
|
9779 |
+
if (!found) found = fallbacks["default"];
|
9780 |
+
return found || [];
|
9781 |
+
}
|
9782 |
+
}, {
|
9783 |
+
key: "toResolveHierarchy",
|
9784 |
+
value: function toResolveHierarchy(code, fallbackCode) {
|
9785 |
+
var _this2 = this;
|
9786 |
+
|
9787 |
+
var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code);
|
9788 |
+
var codes = [];
|
9789 |
+
|
9790 |
+
var addCode = function addCode(c) {
|
9791 |
+
if (!c) return;
|
9792 |
+
|
9793 |
+
if (_this2.isSupportedCode(c)) {
|
9794 |
+
codes.push(c);
|
9795 |
+
} else {
|
9796 |
+
_this2.logger.warn("rejecting language code not found in supportedLngs: ".concat(c));
|
9797 |
+
}
|
9798 |
+
};
|
9799 |
+
|
9800 |
+
if (typeof code === 'string' && code.indexOf('-') > -1) {
|
9801 |
+
if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));
|
9802 |
+
if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));
|
9803 |
+
if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));
|
9804 |
+
} else if (typeof code === 'string') {
|
9805 |
+
addCode(this.formatLanguageCode(code));
|
9806 |
+
}
|
9807 |
+
|
9808 |
+
fallbackCodes.forEach(function (fc) {
|
9809 |
+
if (codes.indexOf(fc) < 0) addCode(_this2.formatLanguageCode(fc));
|
9810 |
+
});
|
9811 |
+
return codes;
|
9812 |
+
}
|
9813 |
+
}]);
|
9814 |
+
|
9815 |
+
return LanguageUtil;
|
9816 |
+
}();
|
9817 |
+
|
9818 |
+
var sets = [{
|
9819 |
+
lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'pt', 'pt-BR', 'tg', 'tl', 'ti', 'tr', 'uz', 'wa'],
|
9820 |
+
nr: [1, 2],
|
9821 |
+
fc: 1
|
9822 |
+
}, {
|
9823 |
+
lngs: ['af', 'an', 'ast', 'az', 'bg', 'bn', 'ca', 'da', 'de', 'dev', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fi', 'fo', 'fur', 'fy', 'gl', 'gu', 'ha', 'hi', 'hu', 'hy', 'ia', 'it', 'kk', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt-PT', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'],
|
9824 |
+
nr: [1, 2],
|
9825 |
+
fc: 2
|
9826 |
+
}, {
|
9827 |
+
lngs: ['ay', 'bo', 'cgg', 'fa', 'ht', 'id', 'ja', 'jbo', 'ka', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],
|
9828 |
+
nr: [1],
|
9829 |
+
fc: 3
|
9830 |
+
}, {
|
9831 |
+
lngs: ['be', 'bs', 'cnr', 'dz', 'hr', 'ru', 'sr', 'uk'],
|
9832 |
+
nr: [1, 2, 5],
|
9833 |
+
fc: 4
|
9834 |
+
}, {
|
9835 |
+
lngs: ['ar'],
|
9836 |
+
nr: [0, 1, 2, 3, 11, 100],
|
9837 |
+
fc: 5
|
9838 |
+
}, {
|
9839 |
+
lngs: ['cs', 'sk'],
|
9840 |
+
nr: [1, 2, 5],
|
9841 |
+
fc: 6
|
9842 |
+
}, {
|
9843 |
+
lngs: ['csb', 'pl'],
|
9844 |
+
nr: [1, 2, 5],
|
9845 |
+
fc: 7
|
9846 |
+
}, {
|
9847 |
+
lngs: ['cy'],
|
9848 |
+
nr: [1, 2, 3, 8],
|
9849 |
+
fc: 8
|
9850 |
+
}, {
|
9851 |
+
lngs: ['fr'],
|
9852 |
+
nr: [1, 2],
|
9853 |
+
fc: 9
|
9854 |
+
}, {
|
9855 |
+
lngs: ['ga'],
|
9856 |
+
nr: [1, 2, 3, 7, 11],
|
9857 |
+
fc: 10
|
9858 |
+
}, {
|
9859 |
+
lngs: ['gd'],
|
9860 |
+
nr: [1, 2, 3, 20],
|
9861 |
+
fc: 11
|
9862 |
+
}, {
|
9863 |
+
lngs: ['is'],
|
9864 |
+
nr: [1, 2],
|
9865 |
+
fc: 12
|
9866 |
+
}, {
|
9867 |
+
lngs: ['jv'],
|
9868 |
+
nr: [0, 1],
|
9869 |
+
fc: 13
|
9870 |
+
}, {
|
9871 |
+
lngs: ['kw'],
|
9872 |
+
nr: [1, 2, 3, 4],
|
9873 |
+
fc: 14
|
9874 |
+
}, {
|
9875 |
+
lngs: ['lt'],
|
9876 |
+
nr: [1, 2, 10],
|
9877 |
+
fc: 15
|
9878 |
+
}, {
|
9879 |
+
lngs: ['lv'],
|
9880 |
+
nr: [1, 2, 0],
|
9881 |
+
fc: 16
|
9882 |
+
}, {
|
9883 |
+
lngs: ['mk'],
|
9884 |
+
nr: [1, 2],
|
9885 |
+
fc: 17
|
9886 |
+
}, {
|
9887 |
+
lngs: ['mnk'],
|
9888 |
+
nr: [0, 1, 2],
|
9889 |
+
fc: 18
|
9890 |
+
}, {
|
9891 |
+
lngs: ['mt'],
|
9892 |
+
nr: [1, 2, 11, 20],
|
9893 |
+
fc: 19
|
9894 |
+
}, {
|
9895 |
+
lngs: ['or'],
|
9896 |
+
nr: [2, 1],
|
9897 |
+
fc: 2
|
9898 |
+
}, {
|
9899 |
+
lngs: ['ro'],
|
9900 |
+
nr: [1, 2, 20],
|
9901 |
+
fc: 20
|
9902 |
+
}, {
|
9903 |
+
lngs: ['sl'],
|
9904 |
+
nr: [5, 1, 2, 3],
|
9905 |
+
fc: 21
|
9906 |
+
}, {
|
9907 |
+
lngs: ['he', 'iw'],
|
9908 |
+
nr: [1, 2, 20, 21],
|
9909 |
+
fc: 22
|
9910 |
+
}];
|
9911 |
+
var _rulesPluralsTypes = {
|
9912 |
+
1: function _(n) {
|
9913 |
+
return Number(n > 1);
|
9914 |
+
},
|
9915 |
+
2: function _(n) {
|
9916 |
+
return Number(n != 1);
|
9917 |
+
},
|
9918 |
+
3: function _(n) {
|
9919 |
+
return 0;
|
9920 |
+
},
|
9921 |
+
4: function _(n) {
|
9922 |
+
return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
|
9923 |
+
},
|
9924 |
+
5: function _(n) {
|
9925 |
+
return Number(n == 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5);
|
9926 |
+
},
|
9927 |
+
6: function _(n) {
|
9928 |
+
return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2);
|
9929 |
+
},
|
9930 |
+
7: function _(n) {
|
9931 |
+
return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
|
9932 |
+
},
|
9933 |
+
8: function _(n) {
|
9934 |
+
return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3);
|
9935 |
+
},
|
9936 |
+
9: function _(n) {
|
9937 |
+
return Number(n >= 2);
|
9938 |
+
},
|
9939 |
+
10: function _(n) {
|
9940 |
+
return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4);
|
9941 |
+
},
|
9942 |
+
11: function _(n) {
|
9943 |
+
return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3);
|
9944 |
+
},
|
9945 |
+
12: function _(n) {
|
9946 |
+
return Number(n % 10 != 1 || n % 100 == 11);
|
9947 |
+
},
|
9948 |
+
13: function _(n) {
|
9949 |
+
return Number(n !== 0);
|
9950 |
+
},
|
9951 |
+
14: function _(n) {
|
9952 |
+
return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3);
|
9953 |
+
},
|
9954 |
+
15: function _(n) {
|
9955 |
+
return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);
|
9956 |
+
},
|
9957 |
+
16: function _(n) {
|
9958 |
+
return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2);
|
9959 |
+
},
|
9960 |
+
17: function _(n) {
|
9961 |
+
return Number(n == 1 || n % 10 == 1 && n % 100 != 11 ? 0 : 1);
|
9962 |
+
},
|
9963 |
+
18: function _(n) {
|
9964 |
+
return Number(n == 0 ? 0 : n == 1 ? 1 : 2);
|
9965 |
+
},
|
9966 |
+
19: function _(n) {
|
9967 |
+
return Number(n == 1 ? 0 : n == 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3);
|
9968 |
+
},
|
9969 |
+
20: function _(n) {
|
9970 |
+
return Number(n == 1 ? 0 : n == 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2);
|
9971 |
+
},
|
9972 |
+
21: function _(n) {
|
9973 |
+
return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0);
|
9974 |
+
},
|
9975 |
+
22: function _(n) {
|
9976 |
+
return Number(n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3);
|
9977 |
+
}
|
9978 |
+
};
|
9979 |
+
var deprecatedJsonVersions = ['v1', 'v2', 'v3'];
|
9980 |
+
var suffixesOrder = {
|
9981 |
+
zero: 0,
|
9982 |
+
one: 1,
|
9983 |
+
two: 2,
|
9984 |
+
few: 3,
|
9985 |
+
many: 4,
|
9986 |
+
other: 5
|
9987 |
+
};
|
9988 |
+
|
9989 |
+
function createRules() {
|
9990 |
+
var rules = {};
|
9991 |
+
sets.forEach(function (set) {
|
9992 |
+
set.lngs.forEach(function (l) {
|
9993 |
+
rules[l] = {
|
9994 |
+
numbers: set.nr,
|
9995 |
+
plurals: _rulesPluralsTypes[set.fc]
|
9996 |
+
};
|
9997 |
+
});
|
9998 |
+
});
|
9999 |
+
return rules;
|
10000 |
+
}
|
10001 |
+
|
10002 |
+
var PluralResolver = function () {
|
10003 |
+
function PluralResolver(languageUtils) {
|
10004 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
10005 |
+
|
10006 |
+
_classCallCheck(this, PluralResolver);
|
10007 |
+
|
10008 |
+
this.languageUtils = languageUtils;
|
10009 |
+
this.options = options;
|
10010 |
+
this.logger = baseLogger.create('pluralResolver');
|
10011 |
+
|
10012 |
+
if ((!this.options.compatibilityJSON || this.options.compatibilityJSON === 'v4') && (typeof Intl === 'undefined' || !Intl.PluralRules)) {
|
10013 |
+
this.options.compatibilityJSON = 'v3';
|
10014 |
+
this.logger.error('Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.');
|
10015 |
+
}
|
10016 |
+
|
10017 |
+
this.rules = createRules();
|
10018 |
+
}
|
10019 |
+
|
10020 |
+
(0,createClass/* default */.Z)(PluralResolver, [{
|
10021 |
+
key: "addRule",
|
10022 |
+
value: function addRule(lng, obj) {
|
10023 |
+
this.rules[lng] = obj;
|
10024 |
+
}
|
10025 |
+
}, {
|
10026 |
+
key: "getRule",
|
10027 |
+
value: function getRule(code) {
|
10028 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
10029 |
+
|
10030 |
+
if (this.shouldUseIntlApi()) {
|
10031 |
+
try {
|
10032 |
+
return new Intl.PluralRules(code, {
|
10033 |
+
type: options.ordinal ? 'ordinal' : 'cardinal'
|
10034 |
+
});
|
10035 |
+
} catch (_unused) {
|
10036 |
+
return;
|
10037 |
+
}
|
10038 |
+
}
|
10039 |
+
|
10040 |
+
return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];
|
10041 |
+
}
|
10042 |
+
}, {
|
10043 |
+
key: "needsPlural",
|
10044 |
+
value: function needsPlural(code) {
|
10045 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
10046 |
+
var rule = this.getRule(code, options);
|
10047 |
+
|
10048 |
+
if (this.shouldUseIntlApi()) {
|
10049 |
+
return rule && rule.resolvedOptions().pluralCategories.length > 1;
|
10050 |
+
}
|
10051 |
+
|
10052 |
+
return rule && rule.numbers.length > 1;
|
10053 |
+
}
|
10054 |
+
}, {
|
10055 |
+
key: "getPluralFormsOfKey",
|
10056 |
+
value: function getPluralFormsOfKey(code, key) {
|
10057 |
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
10058 |
+
return this.getSuffixes(code, options).map(function (suffix) {
|
10059 |
+
return "".concat(key).concat(suffix);
|
10060 |
+
});
|
10061 |
+
}
|
10062 |
+
}, {
|
10063 |
+
key: "getSuffixes",
|
10064 |
+
value: function getSuffixes(code) {
|
10065 |
+
var _this = this;
|
10066 |
+
|
10067 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
10068 |
+
var rule = this.getRule(code, options);
|
10069 |
+
|
10070 |
+
if (!rule) {
|
10071 |
+
return [];
|
10072 |
+
}
|
10073 |
+
|
10074 |
+
if (this.shouldUseIntlApi()) {
|
10075 |
+
return rule.resolvedOptions().pluralCategories.sort(function (pluralCategory1, pluralCategory2) {
|
10076 |
+
return suffixesOrder[pluralCategory1] - suffixesOrder[pluralCategory2];
|
10077 |
+
}).map(function (pluralCategory) {
|
10078 |
+
return "".concat(_this.options.prepend).concat(pluralCategory);
|
10079 |
+
});
|
10080 |
+
}
|
10081 |
+
|
10082 |
+
return rule.numbers.map(function (number) {
|
10083 |
+
return _this.getSuffix(code, number, options);
|
10084 |
+
});
|
10085 |
+
}
|
10086 |
+
}, {
|
10087 |
+
key: "getSuffix",
|
10088 |
+
value: function getSuffix(code, count) {
|
10089 |
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
10090 |
+
var rule = this.getRule(code, options);
|
10091 |
+
|
10092 |
+
if (rule) {
|
10093 |
+
if (this.shouldUseIntlApi()) {
|
10094 |
+
return "".concat(this.options.prepend).concat(rule.select(count));
|
10095 |
+
}
|
10096 |
+
|
10097 |
+
return this.getSuffixRetroCompatible(rule, count);
|
10098 |
+
}
|
10099 |
+
|
10100 |
+
this.logger.warn("no plural rule found for: ".concat(code));
|
10101 |
+
return '';
|
10102 |
+
}
|
10103 |
+
}, {
|
10104 |
+
key: "getSuffixRetroCompatible",
|
10105 |
+
value: function getSuffixRetroCompatible(rule, count) {
|
10106 |
+
var _this2 = this;
|
10107 |
+
|
10108 |
+
var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));
|
10109 |
+
var suffix = rule.numbers[idx];
|
10110 |
+
|
10111 |
+
if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
|
10112 |
+
if (suffix === 2) {
|
10113 |
+
suffix = 'plural';
|
10114 |
+
} else if (suffix === 1) {
|
10115 |
+
suffix = '';
|
10116 |
+
}
|
10117 |
+
}
|
10118 |
+
|
10119 |
+
var returnSuffix = function returnSuffix() {
|
10120 |
+
return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString();
|
10121 |
+
};
|
10122 |
+
|
10123 |
+
if (this.options.compatibilityJSON === 'v1') {
|
10124 |
+
if (suffix === 1) return '';
|
10125 |
+
if (typeof suffix === 'number') return "_plural_".concat(suffix.toString());
|
10126 |
+
return returnSuffix();
|
10127 |
+
} else if (this.options.compatibilityJSON === 'v2') {
|
10128 |
+
return returnSuffix();
|
10129 |
+
} else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {
|
10130 |
+
return returnSuffix();
|
10131 |
+
}
|
10132 |
+
|
10133 |
+
return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();
|
10134 |
+
}
|
10135 |
+
}, {
|
10136 |
+
key: "shouldUseIntlApi",
|
10137 |
+
value: function shouldUseIntlApi() {
|
10138 |
+
return !deprecatedJsonVersions.includes(this.options.compatibilityJSON);
|
10139 |
+
}
|
10140 |
+
}]);
|
10141 |
+
|
10142 |
+
return PluralResolver;
|
10143 |
+
}();
|
10144 |
+
|
10145 |
+
function ownKeys$3(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
10146 |
+
|
10147 |
+
function _objectSpread$3(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$3(Object(source), true).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$3(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
10148 |
+
|
10149 |
+
var Interpolator = function () {
|
10150 |
+
function Interpolator() {
|
10151 |
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10152 |
+
|
10153 |
+
_classCallCheck(this, Interpolator);
|
10154 |
+
|
10155 |
+
this.logger = baseLogger.create('interpolator');
|
10156 |
+
this.options = options;
|
10157 |
+
|
10158 |
+
this.format = options.interpolation && options.interpolation.format || function (value) {
|
10159 |
+
return value;
|
10160 |
+
};
|
10161 |
+
|
10162 |
+
this.init(options);
|
10163 |
+
}
|
10164 |
+
|
10165 |
+
(0,createClass/* default */.Z)(Interpolator, [{
|
10166 |
+
key: "init",
|
10167 |
+
value: function init() {
|
10168 |
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10169 |
+
if (!options.interpolation) options.interpolation = {
|
10170 |
+
escapeValue: true
|
10171 |
+
};
|
10172 |
+
var iOpts = options.interpolation;
|
10173 |
+
this.escape = iOpts.escape !== undefined ? iOpts.escape : i18next_escape;
|
10174 |
+
this.escapeValue = iOpts.escapeValue !== undefined ? iOpts.escapeValue : true;
|
10175 |
+
this.useRawValueToEscape = iOpts.useRawValueToEscape !== undefined ? iOpts.useRawValueToEscape : false;
|
10176 |
+
this.prefix = iOpts.prefix ? regexEscape(iOpts.prefix) : iOpts.prefixEscaped || '{{';
|
10177 |
+
this.suffix = iOpts.suffix ? regexEscape(iOpts.suffix) : iOpts.suffixEscaped || '}}';
|
10178 |
+
this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ',';
|
10179 |
+
this.unescapePrefix = iOpts.unescapeSuffix ? '' : iOpts.unescapePrefix || '-';
|
10180 |
+
this.unescapeSuffix = this.unescapePrefix ? '' : iOpts.unescapeSuffix || '';
|
10181 |
+
this.nestingPrefix = iOpts.nestingPrefix ? regexEscape(iOpts.nestingPrefix) : iOpts.nestingPrefixEscaped || regexEscape('$t(');
|
10182 |
+
this.nestingSuffix = iOpts.nestingSuffix ? regexEscape(iOpts.nestingSuffix) : iOpts.nestingSuffixEscaped || regexEscape(')');
|
10183 |
+
this.nestingOptionsSeparator = iOpts.nestingOptionsSeparator ? iOpts.nestingOptionsSeparator : iOpts.nestingOptionsSeparator || ',';
|
10184 |
+
this.maxReplaces = iOpts.maxReplaces ? iOpts.maxReplaces : 1000;
|
10185 |
+
this.alwaysFormat = iOpts.alwaysFormat !== undefined ? iOpts.alwaysFormat : false;
|
10186 |
+
this.resetRegExp();
|
10187 |
+
}
|
10188 |
+
}, {
|
10189 |
+
key: "reset",
|
10190 |
+
value: function reset() {
|
10191 |
+
if (this.options) this.init(this.options);
|
10192 |
+
}
|
10193 |
+
}, {
|
10194 |
+
key: "resetRegExp",
|
10195 |
+
value: function resetRegExp() {
|
10196 |
+
var regexpStr = "".concat(this.prefix, "(.+?)").concat(this.suffix);
|
10197 |
+
this.regexp = new RegExp(regexpStr, 'g');
|
10198 |
+
var regexpUnescapeStr = "".concat(this.prefix).concat(this.unescapePrefix, "(.+?)").concat(this.unescapeSuffix).concat(this.suffix);
|
10199 |
+
this.regexpUnescape = new RegExp(regexpUnescapeStr, 'g');
|
10200 |
+
var nestingRegexpStr = "".concat(this.nestingPrefix, "(.+?)").concat(this.nestingSuffix);
|
10201 |
+
this.nestingRegexp = new RegExp(nestingRegexpStr, 'g');
|
10202 |
+
}
|
10203 |
+
}, {
|
10204 |
+
key: "interpolate",
|
10205 |
+
value: function interpolate(str, data, lng, options) {
|
10206 |
+
var _this = this;
|
10207 |
+
|
10208 |
+
var match;
|
10209 |
+
var value;
|
10210 |
+
var replaces;
|
10211 |
+
var defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};
|
10212 |
+
|
10213 |
+
function regexSafe(val) {
|
10214 |
+
return val.replace(/\$/g, '$$$$');
|
10215 |
+
}
|
10216 |
+
|
10217 |
+
var handleFormat = function handleFormat(key) {
|
10218 |
+
if (key.indexOf(_this.formatSeparator) < 0) {
|
10219 |
+
var path = getPathWithDefaults(data, defaultData, key);
|
10220 |
+
return _this.alwaysFormat ? _this.format(path, undefined, lng, _objectSpread$3(_objectSpread$3(_objectSpread$3({}, options), data), {}, {
|
10221 |
+
interpolationkey: key
|
10222 |
+
})) : path;
|
10223 |
+
}
|
10224 |
+
|
10225 |
+
var p = key.split(_this.formatSeparator);
|
10226 |
+
var k = p.shift().trim();
|
10227 |
+
var f = p.join(_this.formatSeparator).trim();
|
10228 |
+
return _this.format(getPathWithDefaults(data, defaultData, k), f, lng, _objectSpread$3(_objectSpread$3(_objectSpread$3({}, options), data), {}, {
|
10229 |
+
interpolationkey: k
|
10230 |
+
}));
|
10231 |
+
};
|
10232 |
+
|
10233 |
+
this.resetRegExp();
|
10234 |
+
var missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler;
|
10235 |
+
var skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables !== undefined ? options.interpolation.skipOnVariables : this.options.interpolation.skipOnVariables;
|
10236 |
+
var todos = [{
|
10237 |
+
regex: this.regexpUnescape,
|
10238 |
+
safeValue: function safeValue(val) {
|
10239 |
+
return regexSafe(val);
|
10240 |
+
}
|
10241 |
+
}, {
|
10242 |
+
regex: this.regexp,
|
10243 |
+
safeValue: function safeValue(val) {
|
10244 |
+
return _this.escapeValue ? regexSafe(_this.escape(val)) : regexSafe(val);
|
10245 |
+
}
|
10246 |
+
}];
|
10247 |
+
todos.forEach(function (todo) {
|
10248 |
+
replaces = 0;
|
10249 |
+
|
10250 |
+
while (match = todo.regex.exec(str)) {
|
10251 |
+
var matchedVar = match[1].trim();
|
10252 |
+
value = handleFormat(matchedVar);
|
10253 |
+
|
10254 |
+
if (value === undefined) {
|
10255 |
+
if (typeof missingInterpolationHandler === 'function') {
|
10256 |
+
var temp = missingInterpolationHandler(str, match, options);
|
10257 |
+
value = typeof temp === 'string' ? temp : '';
|
10258 |
+
} else if (options && options.hasOwnProperty(matchedVar)) {
|
10259 |
+
value = '';
|
10260 |
+
} else if (skipOnVariables) {
|
10261 |
+
value = match[0];
|
10262 |
+
continue;
|
10263 |
+
} else {
|
10264 |
+
_this.logger.warn("missed to pass in variable ".concat(matchedVar, " for interpolating ").concat(str));
|
10265 |
+
|
10266 |
+
value = '';
|
10267 |
+
}
|
10268 |
+
} else if (typeof value !== 'string' && !_this.useRawValueToEscape) {
|
10269 |
+
value = makeString(value);
|
10270 |
+
}
|
10271 |
+
|
10272 |
+
var safeValue = todo.safeValue(value);
|
10273 |
+
str = str.replace(match[0], safeValue);
|
10274 |
+
|
10275 |
+
if (skipOnVariables) {
|
10276 |
+
todo.regex.lastIndex += safeValue.length;
|
10277 |
+
todo.regex.lastIndex -= match[0].length;
|
10278 |
+
} else {
|
10279 |
+
todo.regex.lastIndex = 0;
|
10280 |
+
}
|
10281 |
+
|
10282 |
+
replaces++;
|
10283 |
+
|
10284 |
+
if (replaces >= _this.maxReplaces) {
|
10285 |
+
break;
|
10286 |
+
}
|
10287 |
+
}
|
10288 |
+
});
|
10289 |
+
return str;
|
10290 |
+
}
|
10291 |
+
}, {
|
10292 |
+
key: "nest",
|
10293 |
+
value: function nest(str, fc) {
|
10294 |
+
var _this2 = this;
|
10295 |
+
|
10296 |
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
10297 |
+
var match;
|
10298 |
+
var value;
|
10299 |
+
|
10300 |
+
var clonedOptions = _objectSpread$3({}, options);
|
10301 |
+
|
10302 |
+
clonedOptions.applyPostProcessor = false;
|
10303 |
+
delete clonedOptions.defaultValue;
|
10304 |
+
|
10305 |
+
function handleHasOptions(key, inheritedOptions) {
|
10306 |
+
var sep = this.nestingOptionsSeparator;
|
10307 |
+
if (key.indexOf(sep) < 0) return key;
|
10308 |
+
var c = key.split(new RegExp("".concat(sep, "[ ]*{")));
|
10309 |
+
var optionsString = "{".concat(c[1]);
|
10310 |
+
key = c[0];
|
10311 |
+
optionsString = this.interpolate(optionsString, clonedOptions);
|
10312 |
+
optionsString = optionsString.replace(/'/g, '"');
|
10313 |
+
|
10314 |
+
try {
|
10315 |
+
clonedOptions = JSON.parse(optionsString);
|
10316 |
+
if (inheritedOptions) clonedOptions = _objectSpread$3(_objectSpread$3({}, inheritedOptions), clonedOptions);
|
10317 |
+
} catch (e) {
|
10318 |
+
this.logger.warn("failed parsing options string in nesting for key ".concat(key), e);
|
10319 |
+
return "".concat(key).concat(sep).concat(optionsString);
|
10320 |
+
}
|
10321 |
+
|
10322 |
+
delete clonedOptions.defaultValue;
|
10323 |
+
return key;
|
10324 |
+
}
|
10325 |
+
|
10326 |
+
while (match = this.nestingRegexp.exec(str)) {
|
10327 |
+
var formatters = [];
|
10328 |
+
var doReduce = false;
|
10329 |
+
|
10330 |
+
if (match[0].indexOf(this.formatSeparator) !== -1 && !/{.*}/.test(match[1])) {
|
10331 |
+
var r = match[1].split(this.formatSeparator).map(function (elem) {
|
10332 |
+
return elem.trim();
|
10333 |
+
});
|
10334 |
+
match[1] = r.shift();
|
10335 |
+
formatters = r;
|
10336 |
+
doReduce = true;
|
10337 |
+
}
|
10338 |
+
|
10339 |
+
value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);
|
10340 |
+
if (value && match[0] === str && typeof value !== 'string') return value;
|
10341 |
+
if (typeof value !== 'string') value = makeString(value);
|
10342 |
+
|
10343 |
+
if (!value) {
|
10344 |
+
this.logger.warn("missed to resolve ".concat(match[1], " for nesting ").concat(str));
|
10345 |
+
value = '';
|
10346 |
+
}
|
10347 |
+
|
10348 |
+
if (doReduce) {
|
10349 |
+
value = formatters.reduce(function (v, f) {
|
10350 |
+
return _this2.format(v, f, options.lng, _objectSpread$3(_objectSpread$3({}, options), {}, {
|
10351 |
+
interpolationkey: match[1].trim()
|
10352 |
+
}));
|
10353 |
+
}, value.trim());
|
10354 |
+
}
|
10355 |
+
|
10356 |
+
str = str.replace(match[0], value);
|
10357 |
+
this.regexp.lastIndex = 0;
|
10358 |
+
}
|
10359 |
+
|
10360 |
+
return str;
|
10361 |
+
}
|
10362 |
+
}]);
|
10363 |
+
|
10364 |
+
return Interpolator;
|
10365 |
+
}();
|
10366 |
+
|
10367 |
+
function ownKeys$4(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
10368 |
+
|
10369 |
+
function _objectSpread$4(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$4(Object(source), true).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$4(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
10370 |
+
|
10371 |
+
function parseFormatStr(formatStr) {
|
10372 |
+
var formatName = formatStr.toLowerCase().trim();
|
10373 |
+
var formatOptions = {};
|
10374 |
+
|
10375 |
+
if (formatStr.indexOf('(') > -1) {
|
10376 |
+
var p = formatStr.split('(');
|
10377 |
+
formatName = p[0].toLowerCase().trim();
|
10378 |
+
var optStr = p[1].substring(0, p[1].length - 1);
|
10379 |
+
|
10380 |
+
if (formatName === 'currency' && optStr.indexOf(':') < 0) {
|
10381 |
+
if (!formatOptions.currency) formatOptions.currency = optStr.trim();
|
10382 |
+
} else if (formatName === 'relativetime' && optStr.indexOf(':') < 0) {
|
10383 |
+
if (!formatOptions.range) formatOptions.range = optStr.trim();
|
10384 |
+
} else {
|
10385 |
+
var opts = optStr.split(';');
|
10386 |
+
opts.forEach(function (opt) {
|
10387 |
+
if (!opt) return;
|
10388 |
+
|
10389 |
+
var _opt$split = opt.split(':'),
|
10390 |
+
_opt$split2 = _toArray(_opt$split),
|
10391 |
+
key = _opt$split2[0],
|
10392 |
+
rest = _opt$split2.slice(1);
|
10393 |
+
|
10394 |
+
var val = rest.join(':');
|
10395 |
+
if (val.trim() === 'false') formatOptions[key.trim()] = false;
|
10396 |
+
if (val.trim() === 'true') formatOptions[key.trim()] = true;
|
10397 |
+
if (!isNaN(val.trim())) formatOptions[key.trim()] = parseInt(val.trim(), 10);
|
10398 |
+
if (!formatOptions[key.trim()]) formatOptions[key.trim()] = val.trim();
|
10399 |
+
});
|
10400 |
+
}
|
10401 |
+
}
|
10402 |
+
|
10403 |
+
return {
|
10404 |
+
formatName: formatName,
|
10405 |
+
formatOptions: formatOptions
|
10406 |
+
};
|
10407 |
+
}
|
10408 |
+
|
10409 |
+
var Formatter = function () {
|
10410 |
+
function Formatter() {
|
10411 |
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10412 |
+
|
10413 |
+
_classCallCheck(this, Formatter);
|
10414 |
+
|
10415 |
+
this.logger = baseLogger.create('formatter');
|
10416 |
+
this.options = options;
|
10417 |
+
this.formats = {
|
10418 |
+
number: function number(val, lng, options) {
|
10419 |
+
return new Intl.NumberFormat(lng, options).format(val);
|
10420 |
+
},
|
10421 |
+
currency: function currency(val, lng, options) {
|
10422 |
+
return new Intl.NumberFormat(lng, _objectSpread$4(_objectSpread$4({}, options), {}, {
|
10423 |
+
style: 'currency'
|
10424 |
+
})).format(val);
|
10425 |
+
},
|
10426 |
+
datetime: function datetime(val, lng, options) {
|
10427 |
+
return new Intl.DateTimeFormat(lng, _objectSpread$4({}, options)).format(val);
|
10428 |
+
},
|
10429 |
+
relativetime: function relativetime(val, lng, options) {
|
10430 |
+
return new Intl.RelativeTimeFormat(lng, _objectSpread$4({}, options)).format(val, options.range || 'day');
|
10431 |
+
},
|
10432 |
+
list: function list(val, lng, options) {
|
10433 |
+
return new Intl.ListFormat(lng, _objectSpread$4({}, options)).format(val);
|
10434 |
+
}
|
10435 |
+
};
|
10436 |
+
this.init(options);
|
10437 |
+
}
|
10438 |
+
|
10439 |
+
(0,createClass/* default */.Z)(Formatter, [{
|
10440 |
+
key: "init",
|
10441 |
+
value: function init(services) {
|
10442 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
10443 |
+
interpolation: {}
|
10444 |
+
};
|
10445 |
+
var iOpts = options.interpolation;
|
10446 |
+
this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ',';
|
10447 |
+
}
|
10448 |
+
}, {
|
10449 |
+
key: "add",
|
10450 |
+
value: function add(name, fc) {
|
10451 |
+
this.formats[name.toLowerCase().trim()] = fc;
|
10452 |
+
}
|
10453 |
+
}, {
|
10454 |
+
key: "format",
|
10455 |
+
value: function format(value, _format, lng, options) {
|
10456 |
+
var _this = this;
|
10457 |
+
|
10458 |
+
var formats = _format.split(this.formatSeparator);
|
10459 |
+
|
10460 |
+
var result = formats.reduce(function (mem, f) {
|
10461 |
+
var _parseFormatStr = parseFormatStr(f),
|
10462 |
+
formatName = _parseFormatStr.formatName,
|
10463 |
+
formatOptions = _parseFormatStr.formatOptions;
|
10464 |
+
|
10465 |
+
if (_this.formats[formatName]) {
|
10466 |
+
var formatted = mem;
|
10467 |
+
|
10468 |
+
try {
|
10469 |
+
var valOptions = options && options.formatParams && options.formatParams[options.interpolationkey] || {};
|
10470 |
+
var l = valOptions.locale || valOptions.lng || options.locale || options.lng || lng;
|
10471 |
+
formatted = _this.formats[formatName](mem, l, _objectSpread$4(_objectSpread$4(_objectSpread$4({}, formatOptions), options), valOptions));
|
10472 |
+
} catch (error) {
|
10473 |
+
_this.logger.warn(error);
|
10474 |
+
}
|
10475 |
+
|
10476 |
+
return formatted;
|
10477 |
+
} else {
|
10478 |
+
_this.logger.warn("there was no format function for ".concat(formatName));
|
10479 |
+
}
|
10480 |
+
|
10481 |
+
return mem;
|
10482 |
+
}, value);
|
10483 |
+
return result;
|
10484 |
+
}
|
10485 |
+
}]);
|
10486 |
+
|
10487 |
+
return Formatter;
|
10488 |
+
}();
|
10489 |
+
|
10490 |
+
function ownKeys$5(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
10491 |
+
|
10492 |
+
function _objectSpread$5(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$5(Object(source), true).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$5(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
10493 |
+
|
10494 |
+
function _createSuper$2(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$2(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
10495 |
+
|
10496 |
+
function _isNativeReflectConstruct$2() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
10497 |
+
|
10498 |
+
function remove(arr, what) {
|
10499 |
+
var found = arr.indexOf(what);
|
10500 |
+
|
10501 |
+
while (found !== -1) {
|
10502 |
+
arr.splice(found, 1);
|
10503 |
+
found = arr.indexOf(what);
|
10504 |
+
}
|
10505 |
+
}
|
10506 |
+
|
10507 |
+
var Connector = function (_EventEmitter) {
|
10508 |
+
_inherits(Connector, _EventEmitter);
|
10509 |
+
|
10510 |
+
var _super = _createSuper$2(Connector);
|
10511 |
+
|
10512 |
+
function Connector(backend, store, services) {
|
10513 |
+
var _this;
|
10514 |
+
|
10515 |
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
10516 |
+
|
10517 |
+
_classCallCheck(this, Connector);
|
10518 |
+
|
10519 |
+
_this = _super.call(this);
|
10520 |
+
|
10521 |
+
if (isIE10) {
|
10522 |
+
EventEmitter.call((0,assertThisInitialized/* default */.Z)(_this));
|
10523 |
+
}
|
10524 |
+
|
10525 |
+
_this.backend = backend;
|
10526 |
+
_this.store = store;
|
10527 |
+
_this.services = services;
|
10528 |
+
_this.languageUtils = services.languageUtils;
|
10529 |
+
_this.options = options;
|
10530 |
+
_this.logger = baseLogger.create('backendConnector');
|
10531 |
+
_this.state = {};
|
10532 |
+
_this.queue = [];
|
10533 |
+
|
10534 |
+
if (_this.backend && _this.backend.init) {
|
10535 |
+
_this.backend.init(services, options.backend, options);
|
10536 |
+
}
|
10537 |
+
|
10538 |
+
return _this;
|
10539 |
+
}
|
10540 |
+
|
10541 |
+
(0,createClass/* default */.Z)(Connector, [{
|
10542 |
+
key: "queueLoad",
|
10543 |
+
value: function queueLoad(languages, namespaces, options, callback) {
|
10544 |
+
var _this2 = this;
|
10545 |
+
|
10546 |
+
var toLoad = [];
|
10547 |
+
var pending = [];
|
10548 |
+
var toLoadLanguages = [];
|
10549 |
+
var toLoadNamespaces = [];
|
10550 |
+
languages.forEach(function (lng) {
|
10551 |
+
var hasAllNamespaces = true;
|
10552 |
+
namespaces.forEach(function (ns) {
|
10553 |
+
var name = "".concat(lng, "|").concat(ns);
|
10554 |
+
|
10555 |
+
if (!options.reload && _this2.store.hasResourceBundle(lng, ns)) {
|
10556 |
+
_this2.state[name] = 2;
|
10557 |
+
} else if (_this2.state[name] < 0) ; else if (_this2.state[name] === 1) {
|
10558 |
+
if (pending.indexOf(name) < 0) pending.push(name);
|
10559 |
+
} else {
|
10560 |
+
_this2.state[name] = 1;
|
10561 |
+
hasAllNamespaces = false;
|
10562 |
+
if (pending.indexOf(name) < 0) pending.push(name);
|
10563 |
+
if (toLoad.indexOf(name) < 0) toLoad.push(name);
|
10564 |
+
if (toLoadNamespaces.indexOf(ns) < 0) toLoadNamespaces.push(ns);
|
10565 |
+
}
|
10566 |
+
});
|
10567 |
+
if (!hasAllNamespaces) toLoadLanguages.push(lng);
|
10568 |
+
});
|
10569 |
+
|
10570 |
+
if (toLoad.length || pending.length) {
|
10571 |
+
this.queue.push({
|
10572 |
+
pending: pending,
|
10573 |
+
loaded: {},
|
10574 |
+
errors: [],
|
10575 |
+
callback: callback
|
10576 |
+
});
|
10577 |
+
}
|
10578 |
+
|
10579 |
+
return {
|
10580 |
+
toLoad: toLoad,
|
10581 |
+
pending: pending,
|
10582 |
+
toLoadLanguages: toLoadLanguages,
|
10583 |
+
toLoadNamespaces: toLoadNamespaces
|
10584 |
+
};
|
10585 |
+
}
|
10586 |
+
}, {
|
10587 |
+
key: "loaded",
|
10588 |
+
value: function loaded(name, err, data) {
|
10589 |
+
var s = name.split('|');
|
10590 |
+
var lng = s[0];
|
10591 |
+
var ns = s[1];
|
10592 |
+
if (err) this.emit('failedLoading', lng, ns, err);
|
10593 |
+
|
10594 |
+
if (data) {
|
10595 |
+
this.store.addResourceBundle(lng, ns, data);
|
10596 |
+
}
|
10597 |
+
|
10598 |
+
this.state[name] = err ? -1 : 2;
|
10599 |
+
var loaded = {};
|
10600 |
+
this.queue.forEach(function (q) {
|
10601 |
+
pushPath(q.loaded, [lng], ns);
|
10602 |
+
remove(q.pending, name);
|
10603 |
+
if (err) q.errors.push(err);
|
10604 |
+
|
10605 |
+
if (q.pending.length === 0 && !q.done) {
|
10606 |
+
Object.keys(q.loaded).forEach(function (l) {
|
10607 |
+
if (!loaded[l]) loaded[l] = [];
|
10608 |
+
|
10609 |
+
if (q.loaded[l].length) {
|
10610 |
+
q.loaded[l].forEach(function (ns) {
|
10611 |
+
if (loaded[l].indexOf(ns) < 0) loaded[l].push(ns);
|
10612 |
+
});
|
10613 |
+
}
|
10614 |
+
});
|
10615 |
+
q.done = true;
|
10616 |
+
|
10617 |
+
if (q.errors.length) {
|
10618 |
+
q.callback(q.errors);
|
10619 |
+
} else {
|
10620 |
+
q.callback();
|
10621 |
+
}
|
10622 |
+
}
|
10623 |
+
});
|
10624 |
+
this.emit('loaded', loaded);
|
10625 |
+
this.queue = this.queue.filter(function (q) {
|
10626 |
+
return !q.done;
|
10627 |
+
});
|
10628 |
+
}
|
10629 |
+
}, {
|
10630 |
+
key: "read",
|
10631 |
+
value: function read(lng, ns, fcName) {
|
10632 |
+
var _this3 = this;
|
10633 |
+
|
10634 |
+
var tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;
|
10635 |
+
var wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 350;
|
10636 |
+
var callback = arguments.length > 5 ? arguments[5] : undefined;
|
10637 |
+
if (!lng.length) return callback(null, {});
|
10638 |
+
return this.backend[fcName](lng, ns, function (err, data) {
|
10639 |
+
if (err && data && tried < 5) {
|
10640 |
+
setTimeout(function () {
|
10641 |
+
_this3.read.call(_this3, lng, ns, fcName, tried + 1, wait * 2, callback);
|
10642 |
+
}, wait);
|
10643 |
+
return;
|
10644 |
+
}
|
10645 |
+
|
10646 |
+
callback(err, data);
|
10647 |
+
});
|
10648 |
+
}
|
10649 |
+
}, {
|
10650 |
+
key: "prepareLoading",
|
10651 |
+
value: function prepareLoading(languages, namespaces) {
|
10652 |
+
var _this4 = this;
|
10653 |
+
|
10654 |
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
10655 |
+
var callback = arguments.length > 3 ? arguments[3] : undefined;
|
10656 |
+
|
10657 |
+
if (!this.backend) {
|
10658 |
+
this.logger.warn('No backend was added via i18next.use. Will not load resources.');
|
10659 |
+
return callback && callback();
|
10660 |
+
}
|
10661 |
+
|
10662 |
+
if (typeof languages === 'string') languages = this.languageUtils.toResolveHierarchy(languages);
|
10663 |
+
if (typeof namespaces === 'string') namespaces = [namespaces];
|
10664 |
+
var toLoad = this.queueLoad(languages, namespaces, options, callback);
|
10665 |
+
|
10666 |
+
if (!toLoad.toLoad.length) {
|
10667 |
+
if (!toLoad.pending.length) callback();
|
10668 |
+
return null;
|
10669 |
+
}
|
10670 |
+
|
10671 |
+
toLoad.toLoad.forEach(function (name) {
|
10672 |
+
_this4.loadOne(name);
|
10673 |
+
});
|
10674 |
+
}
|
10675 |
+
}, {
|
10676 |
+
key: "load",
|
10677 |
+
value: function load(languages, namespaces, callback) {
|
10678 |
+
this.prepareLoading(languages, namespaces, {}, callback);
|
10679 |
+
}
|
10680 |
+
}, {
|
10681 |
+
key: "reload",
|
10682 |
+
value: function reload(languages, namespaces, callback) {
|
10683 |
+
this.prepareLoading(languages, namespaces, {
|
10684 |
+
reload: true
|
10685 |
+
}, callback);
|
10686 |
+
}
|
10687 |
+
}, {
|
10688 |
+
key: "loadOne",
|
10689 |
+
value: function loadOne(name) {
|
10690 |
+
var _this5 = this;
|
10691 |
+
|
10692 |
+
var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
10693 |
+
var s = name.split('|');
|
10694 |
+
var lng = s[0];
|
10695 |
+
var ns = s[1];
|
10696 |
+
this.read(lng, ns, 'read', undefined, undefined, function (err, data) {
|
10697 |
+
if (err) _this5.logger.warn("".concat(prefix, "loading namespace ").concat(ns, " for language ").concat(lng, " failed"), err);
|
10698 |
+
if (!err && data) _this5.logger.log("".concat(prefix, "loaded namespace ").concat(ns, " for language ").concat(lng), data);
|
10699 |
+
|
10700 |
+
_this5.loaded(name, err, data);
|
10701 |
+
});
|
10702 |
+
}
|
10703 |
+
}, {
|
10704 |
+
key: "saveMissing",
|
10705 |
+
value: function saveMissing(languages, namespace, key, fallbackValue, isUpdate) {
|
10706 |
+
var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};
|
10707 |
+
|
10708 |
+
if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) {
|
10709 |
+
this.logger.warn("did not save key \"".concat(key, "\" as the namespace \"").concat(namespace, "\" was not yet loaded"), 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');
|
10710 |
+
return;
|
10711 |
+
}
|
10712 |
+
|
10713 |
+
if (key === undefined || key === null || key === '') return;
|
10714 |
+
|
10715 |
+
if (this.backend && this.backend.create) {
|
10716 |
+
this.backend.create(languages, namespace, key, fallbackValue, null, _objectSpread$5(_objectSpread$5({}, options), {}, {
|
10717 |
+
isUpdate: isUpdate
|
10718 |
+
}));
|
10719 |
+
}
|
10720 |
+
|
10721 |
+
if (!languages || !languages[0]) return;
|
10722 |
+
this.store.addResource(languages[0], namespace, key, fallbackValue);
|
10723 |
+
}
|
10724 |
+
}]);
|
10725 |
+
|
10726 |
+
return Connector;
|
10727 |
+
}(EventEmitter);
|
10728 |
+
|
10729 |
+
function get() {
|
10730 |
+
return {
|
10731 |
+
debug: false,
|
10732 |
+
initImmediate: true,
|
10733 |
+
ns: ['translation'],
|
10734 |
+
defaultNS: ['translation'],
|
10735 |
+
fallbackLng: ['dev'],
|
10736 |
+
fallbackNS: false,
|
10737 |
+
supportedLngs: false,
|
10738 |
+
nonExplicitSupportedLngs: false,
|
10739 |
+
load: 'all',
|
10740 |
+
preload: false,
|
10741 |
+
simplifyPluralSuffix: true,
|
10742 |
+
keySeparator: '.',
|
10743 |
+
nsSeparator: ':',
|
10744 |
+
pluralSeparator: '_',
|
10745 |
+
contextSeparator: '_',
|
10746 |
+
partialBundledLanguages: false,
|
10747 |
+
saveMissing: false,
|
10748 |
+
updateMissing: false,
|
10749 |
+
saveMissingTo: 'fallback',
|
10750 |
+
saveMissingPlurals: true,
|
10751 |
+
missingKeyHandler: false,
|
10752 |
+
missingInterpolationHandler: false,
|
10753 |
+
postProcess: false,
|
10754 |
+
postProcessPassResolved: false,
|
10755 |
+
returnNull: true,
|
10756 |
+
returnEmptyString: true,
|
10757 |
+
returnObjects: false,
|
10758 |
+
joinArrays: false,
|
10759 |
+
returnedObjectHandler: false,
|
10760 |
+
parseMissingKeyHandler: false,
|
10761 |
+
appendNamespaceToMissingKey: false,
|
10762 |
+
appendNamespaceToCIMode: false,
|
10763 |
+
overloadTranslationOptionHandler: function handle(args) {
|
10764 |
+
var ret = {};
|
10765 |
+
if ((0,esm_typeof/* default */.Z)(args[1]) === 'object') ret = args[1];
|
10766 |
+
if (typeof args[1] === 'string') ret.defaultValue = args[1];
|
10767 |
+
if (typeof args[2] === 'string') ret.tDescription = args[2];
|
10768 |
+
|
10769 |
+
if ((0,esm_typeof/* default */.Z)(args[2]) === 'object' || (0,esm_typeof/* default */.Z)(args[3]) === 'object') {
|
10770 |
+
var options = args[3] || args[2];
|
10771 |
+
Object.keys(options).forEach(function (key) {
|
10772 |
+
ret[key] = options[key];
|
10773 |
+
});
|
10774 |
+
}
|
10775 |
+
|
10776 |
+
return ret;
|
10777 |
+
},
|
10778 |
+
interpolation: {
|
10779 |
+
escapeValue: true,
|
10780 |
+
format: function format(value, _format, lng, options) {
|
10781 |
+
return value;
|
10782 |
+
},
|
10783 |
+
prefix: '{{',
|
10784 |
+
suffix: '}}',
|
10785 |
+
formatSeparator: ',',
|
10786 |
+
unescapePrefix: '-',
|
10787 |
+
nestingPrefix: '$t(',
|
10788 |
+
nestingSuffix: ')',
|
10789 |
+
nestingOptionsSeparator: ',',
|
10790 |
+
maxReplaces: 1000,
|
10791 |
+
skipOnVariables: true
|
10792 |
+
}
|
10793 |
+
};
|
10794 |
+
}
|
10795 |
+
function transformOptions(options) {
|
10796 |
+
if (typeof options.ns === 'string') options.ns = [options.ns];
|
10797 |
+
if (typeof options.fallbackLng === 'string') options.fallbackLng = [options.fallbackLng];
|
10798 |
+
if (typeof options.fallbackNS === 'string') options.fallbackNS = [options.fallbackNS];
|
10799 |
+
|
10800 |
+
if (options.supportedLngs && options.supportedLngs.indexOf('cimode') < 0) {
|
10801 |
+
options.supportedLngs = options.supportedLngs.concat(['cimode']);
|
10802 |
+
}
|
10803 |
+
|
10804 |
+
return options;
|
10805 |
+
}
|
10806 |
+
|
10807 |
+
function ownKeys$6(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
10808 |
+
|
10809 |
+
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$6(Object(source), true).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
10810 |
+
|
10811 |
+
function _createSuper$3(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct$3(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
10812 |
+
|
10813 |
+
function _isNativeReflectConstruct$3() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
10814 |
+
|
10815 |
+
function noop() {}
|
10816 |
+
|
10817 |
+
function bindMemberFunctions(inst) {
|
10818 |
+
var mems = Object.getOwnPropertyNames(Object.getPrototypeOf(inst));
|
10819 |
+
mems.forEach(function (mem) {
|
10820 |
+
if (typeof inst[mem] === 'function') {
|
10821 |
+
inst[mem] = inst[mem].bind(inst);
|
10822 |
+
}
|
10823 |
+
});
|
10824 |
+
}
|
10825 |
+
|
10826 |
+
var I18n = function (_EventEmitter) {
|
10827 |
+
_inherits(I18n, _EventEmitter);
|
10828 |
+
|
10829 |
+
var _super = _createSuper$3(I18n);
|
10830 |
+
|
10831 |
+
function I18n() {
|
10832 |
+
var _this;
|
10833 |
+
|
10834 |
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10835 |
+
var callback = arguments.length > 1 ? arguments[1] : undefined;
|
10836 |
+
|
10837 |
+
_classCallCheck(this, I18n);
|
10838 |
+
|
10839 |
+
_this = _super.call(this);
|
10840 |
+
|
10841 |
+
if (isIE10) {
|
10842 |
+
EventEmitter.call((0,assertThisInitialized/* default */.Z)(_this));
|
10843 |
+
}
|
10844 |
+
|
10845 |
+
_this.options = transformOptions(options);
|
10846 |
+
_this.services = {};
|
10847 |
+
_this.logger = baseLogger;
|
10848 |
+
_this.modules = {
|
10849 |
+
external: []
|
10850 |
+
};
|
10851 |
+
bindMemberFunctions((0,assertThisInitialized/* default */.Z)(_this));
|
10852 |
+
|
10853 |
+
if (callback && !_this.isInitialized && !options.isClone) {
|
10854 |
+
if (!_this.options.initImmediate) {
|
10855 |
+
_this.init(options, callback);
|
10856 |
+
|
10857 |
+
return _possibleConstructorReturn(_this, (0,assertThisInitialized/* default */.Z)(_this));
|
10858 |
+
}
|
10859 |
+
|
10860 |
+
setTimeout(function () {
|
10861 |
+
_this.init(options, callback);
|
10862 |
+
}, 0);
|
10863 |
+
}
|
10864 |
+
|
10865 |
+
return _this;
|
10866 |
+
}
|
10867 |
+
|
10868 |
+
(0,createClass/* default */.Z)(I18n, [{
|
10869 |
+
key: "init",
|
10870 |
+
value: function init() {
|
10871 |
+
var _this2 = this;
|
10872 |
+
|
10873 |
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
10874 |
+
var callback = arguments.length > 1 ? arguments[1] : undefined;
|
10875 |
+
|
10876 |
+
if (typeof options === 'function') {
|
10877 |
+
callback = options;
|
10878 |
+
options = {};
|
10879 |
+
}
|
10880 |
+
|
10881 |
+
if (!options.defaultNS && options.ns) {
|
10882 |
+
if (typeof options.ns === 'string') {
|
10883 |
+
options.defaultNS = options.ns;
|
10884 |
+
} else if (options.ns.indexOf('translation') < 0) {
|
10885 |
+
options.defaultNS = options.ns[0];
|
10886 |
+
}
|
10887 |
+
}
|
10888 |
+
|
10889 |
+
var defOpts = get();
|
10890 |
+
this.options = _objectSpread$6(_objectSpread$6(_objectSpread$6({}, defOpts), this.options), transformOptions(options));
|
10891 |
+
|
10892 |
+
if (this.options.compatibilityAPI !== 'v1') {
|
10893 |
+
this.options.interpolation = _objectSpread$6(_objectSpread$6({}, defOpts.interpolation), this.options.interpolation);
|
10894 |
+
}
|
10895 |
+
|
10896 |
+
if (options.keySeparator !== undefined) {
|
10897 |
+
this.options.userDefinedKeySeparator = options.keySeparator;
|
10898 |
+
}
|
10899 |
+
|
10900 |
+
if (options.nsSeparator !== undefined) {
|
10901 |
+
this.options.userDefinedNsSeparator = options.nsSeparator;
|
10902 |
+
}
|
10903 |
+
|
10904 |
+
function createClassOnDemand(ClassOrObject) {
|
10905 |
+
if (!ClassOrObject) return null;
|
10906 |
+
if (typeof ClassOrObject === 'function') return new ClassOrObject();
|
10907 |
+
return ClassOrObject;
|
10908 |
+
}
|
10909 |
+
|
10910 |
+
if (!this.options.isClone) {
|
10911 |
+
if (this.modules.logger) {
|
10912 |
+
baseLogger.init(createClassOnDemand(this.modules.logger), this.options);
|
10913 |
+
} else {
|
10914 |
+
baseLogger.init(null, this.options);
|
10915 |
+
}
|
10916 |
+
|
10917 |
+
var formatter;
|
10918 |
+
|
10919 |
+
if (this.modules.formatter) {
|
10920 |
+
formatter = this.modules.formatter;
|
10921 |
+
} else if (typeof Intl !== 'undefined') {
|
10922 |
+
formatter = Formatter;
|
10923 |
+
}
|
10924 |
+
|
10925 |
+
var lu = new LanguageUtil(this.options);
|
10926 |
+
this.store = new ResourceStore(this.options.resources, this.options);
|
10927 |
+
var s = this.services;
|
10928 |
+
s.logger = baseLogger;
|
10929 |
+
s.resourceStore = this.store;
|
10930 |
+
s.languageUtils = lu;
|
10931 |
+
s.pluralResolver = new PluralResolver(lu, {
|
10932 |
+
prepend: this.options.pluralSeparator,
|
10933 |
+
compatibilityJSON: this.options.compatibilityJSON,
|
10934 |
+
simplifyPluralSuffix: this.options.simplifyPluralSuffix
|
10935 |
+
});
|
10936 |
+
|
10937 |
+
if (formatter && (!this.options.interpolation.format || this.options.interpolation.format === defOpts.interpolation.format)) {
|
10938 |
+
s.formatter = createClassOnDemand(formatter);
|
10939 |
+
s.formatter.init(s, this.options);
|
10940 |
+
this.options.interpolation.format = s.formatter.format.bind(s.formatter);
|
10941 |
+
}
|
10942 |
+
|
10943 |
+
s.interpolator = new Interpolator(this.options);
|
10944 |
+
s.utils = {
|
10945 |
+
hasLoadedNamespace: this.hasLoadedNamespace.bind(this)
|
10946 |
+
};
|
10947 |
+
s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);
|
10948 |
+
s.backendConnector.on('*', function (event) {
|
10949 |
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
10950 |
+
args[_key - 1] = arguments[_key];
|
10951 |
+
}
|
10952 |
+
|
10953 |
+
_this2.emit.apply(_this2, [event].concat(args));
|
10954 |
+
});
|
10955 |
+
|
10956 |
+
if (this.modules.languageDetector) {
|
10957 |
+
s.languageDetector = createClassOnDemand(this.modules.languageDetector);
|
10958 |
+
s.languageDetector.init(s, this.options.detection, this.options);
|
10959 |
+
}
|
10960 |
+
|
10961 |
+
if (this.modules.i18nFormat) {
|
10962 |
+
s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);
|
10963 |
+
if (s.i18nFormat.init) s.i18nFormat.init(this);
|
10964 |
+
}
|
10965 |
+
|
10966 |
+
this.translator = new Translator(this.services, this.options);
|
10967 |
+
this.translator.on('*', function (event) {
|
10968 |
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
10969 |
+
args[_key2 - 1] = arguments[_key2];
|
10970 |
+
}
|
10971 |
+
|
10972 |
+
_this2.emit.apply(_this2, [event].concat(args));
|
10973 |
+
});
|
10974 |
+
this.modules.external.forEach(function (m) {
|
10975 |
+
if (m.init) m.init(_this2);
|
10976 |
+
});
|
10977 |
+
}
|
10978 |
+
|
10979 |
+
this.format = this.options.interpolation.format;
|
10980 |
+
if (!callback) callback = noop;
|
10981 |
+
|
10982 |
+
if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {
|
10983 |
+
var codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
10984 |
+
if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];
|
10985 |
+
}
|
10986 |
+
|
10987 |
+
if (!this.services.languageDetector && !this.options.lng) {
|
10988 |
+
this.logger.warn('init: no languageDetector is used and no lng is defined');
|
10989 |
+
}
|
10990 |
+
|
10991 |
+
var storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];
|
10992 |
+
storeApi.forEach(function (fcName) {
|
10993 |
+
_this2[fcName] = function () {
|
10994 |
+
var _this2$store;
|
10995 |
+
|
10996 |
+
return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments);
|
10997 |
+
};
|
10998 |
+
});
|
10999 |
+
var storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];
|
11000 |
+
storeApiChained.forEach(function (fcName) {
|
11001 |
+
_this2[fcName] = function () {
|
11002 |
+
var _this2$store2;
|
11003 |
+
|
11004 |
+
(_this2$store2 = _this2.store)[fcName].apply(_this2$store2, arguments);
|
11005 |
+
|
11006 |
+
return _this2;
|
11007 |
+
};
|
11008 |
+
});
|
11009 |
+
var deferred = defer();
|
11010 |
+
|
11011 |
+
var load = function load() {
|
11012 |
+
var finish = function finish(err, t) {
|
11013 |
+
if (_this2.isInitialized && !_this2.initializedStoreOnce) _this2.logger.warn('init: i18next is already initialized. You should call init just once!');
|
11014 |
+
_this2.isInitialized = true;
|
11015 |
+
if (!_this2.options.isClone) _this2.logger.log('initialized', _this2.options);
|
11016 |
+
|
11017 |
+
_this2.emit('initialized', _this2.options);
|
11018 |
+
|
11019 |
+
deferred.resolve(t);
|
11020 |
+
callback(err, t);
|
11021 |
+
};
|
11022 |
+
|
11023 |
+
if (_this2.languages && _this2.options.compatibilityAPI !== 'v1' && !_this2.isInitialized) return finish(null, _this2.t.bind(_this2));
|
11024 |
+
|
11025 |
+
_this2.changeLanguage(_this2.options.lng, finish);
|
11026 |
+
};
|
11027 |
+
|
11028 |
+
if (this.options.resources || !this.options.initImmediate) {
|
11029 |
+
load();
|
11030 |
+
} else {
|
11031 |
+
setTimeout(load, 0);
|
11032 |
+
}
|
11033 |
+
|
11034 |
+
return deferred;
|
11035 |
+
}
|
11036 |
+
}, {
|
11037 |
+
key: "loadResources",
|
11038 |
+
value: function loadResources(language) {
|
11039 |
+
var _this3 = this;
|
11040 |
+
|
11041 |
+
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
11042 |
+
var usedCallback = callback;
|
11043 |
+
var usedLng = typeof language === 'string' ? language : this.language;
|
11044 |
+
if (typeof language === 'function') usedCallback = language;
|
11045 |
+
|
11046 |
+
if (!this.options.resources || this.options.partialBundledLanguages) {
|
11047 |
+
if (usedLng && usedLng.toLowerCase() === 'cimode') return usedCallback();
|
11048 |
+
var toLoad = [];
|
11049 |
+
|
11050 |
+
var append = function append(lng) {
|
11051 |
+
if (!lng) return;
|
11052 |
+
|
11053 |
+
var lngs = _this3.services.languageUtils.toResolveHierarchy(lng);
|
11054 |
+
|
11055 |
+
lngs.forEach(function (l) {
|
11056 |
+
if (toLoad.indexOf(l) < 0) toLoad.push(l);
|
11057 |
+
});
|
11058 |
+
};
|
11059 |
+
|
11060 |
+
if (!usedLng) {
|
11061 |
+
var fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);
|
11062 |
+
fallbacks.forEach(function (l) {
|
11063 |
+
return append(l);
|
11064 |
+
});
|
11065 |
+
} else {
|
11066 |
+
append(usedLng);
|
11067 |
+
}
|
11068 |
+
|
11069 |
+
if (this.options.preload) {
|
11070 |
+
this.options.preload.forEach(function (l) {
|
11071 |
+
return append(l);
|
11072 |
+
});
|
11073 |
+
}
|
11074 |
+
|
11075 |
+
this.services.backendConnector.load(toLoad, this.options.ns, usedCallback);
|
11076 |
+
} else {
|
11077 |
+
usedCallback(null);
|
11078 |
+
}
|
11079 |
+
}
|
11080 |
+
}, {
|
11081 |
+
key: "reloadResources",
|
11082 |
+
value: function reloadResources(lngs, ns, callback) {
|
11083 |
+
var deferred = defer();
|
11084 |
+
if (!lngs) lngs = this.languages;
|
11085 |
+
if (!ns) ns = this.options.ns;
|
11086 |
+
if (!callback) callback = noop;
|
11087 |
+
this.services.backendConnector.reload(lngs, ns, function (err) {
|
11088 |
+
deferred.resolve();
|
11089 |
+
callback(err);
|
11090 |
+
});
|
11091 |
+
return deferred;
|
11092 |
+
}
|
11093 |
+
}, {
|
11094 |
+
key: "use",
|
11095 |
+
value: function use(module) {
|
11096 |
+
if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');
|
11097 |
+
if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');
|
11098 |
+
|
11099 |
+
if (module.type === 'backend') {
|
11100 |
+
this.modules.backend = module;
|
11101 |
+
}
|
11102 |
+
|
11103 |
+
if (module.type === 'logger' || module.log && module.warn && module.error) {
|
11104 |
+
this.modules.logger = module;
|
11105 |
+
}
|
11106 |
+
|
11107 |
+
if (module.type === 'languageDetector') {
|
11108 |
+
this.modules.languageDetector = module;
|
11109 |
+
}
|
11110 |
+
|
11111 |
+
if (module.type === 'i18nFormat') {
|
11112 |
+
this.modules.i18nFormat = module;
|
11113 |
+
}
|
11114 |
+
|
11115 |
+
if (module.type === 'postProcessor') {
|
11116 |
+
postProcessor.addPostProcessor(module);
|
11117 |
+
}
|
11118 |
+
|
11119 |
+
if (module.type === 'formatter') {
|
11120 |
+
this.modules.formatter = module;
|
11121 |
+
}
|
11122 |
+
|
11123 |
+
if (module.type === '3rdParty') {
|
11124 |
+
this.modules.external.push(module);
|
11125 |
+
}
|
11126 |
+
|
11127 |
+
return this;
|
11128 |
+
}
|
11129 |
+
}, {
|
11130 |
+
key: "changeLanguage",
|
11131 |
+
value: function changeLanguage(lng, callback) {
|
11132 |
+
var _this4 = this;
|
11133 |
+
|
11134 |
+
this.isLanguageChangingTo = lng;
|
11135 |
+
var deferred = defer();
|
11136 |
+
this.emit('languageChanging', lng);
|
11137 |
+
|
11138 |
+
var setLngProps = function setLngProps(l) {
|
11139 |
+
_this4.language = l;
|
11140 |
+
_this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);
|
11141 |
+
_this4.resolvedLanguage = undefined;
|
11142 |
+
if (['cimode', 'dev'].indexOf(l) > -1) return;
|
11143 |
+
|
11144 |
+
for (var li = 0; li < _this4.languages.length; li++) {
|
11145 |
+
var lngInLngs = _this4.languages[li];
|
11146 |
+
if (['cimode', 'dev'].indexOf(lngInLngs) > -1) continue;
|
11147 |
+
|
11148 |
+
if (_this4.store.hasLanguageSomeTranslations(lngInLngs)) {
|
11149 |
+
_this4.resolvedLanguage = lngInLngs;
|
11150 |
+
break;
|
11151 |
+
}
|
11152 |
+
}
|
11153 |
+
};
|
11154 |
+
|
11155 |
+
var done = function done(err, l) {
|
11156 |
+
if (l) {
|
11157 |
+
setLngProps(l);
|
11158 |
+
|
11159 |
+
_this4.translator.changeLanguage(l);
|
11160 |
+
|
11161 |
+
_this4.isLanguageChangingTo = undefined;
|
11162 |
+
|
11163 |
+
_this4.emit('languageChanged', l);
|
11164 |
+
|
11165 |
+
_this4.logger.log('languageChanged', l);
|
11166 |
+
} else {
|
11167 |
+
_this4.isLanguageChangingTo = undefined;
|
11168 |
+
}
|
11169 |
+
|
11170 |
+
deferred.resolve(function () {
|
11171 |
+
return _this4.t.apply(_this4, arguments);
|
11172 |
+
});
|
11173 |
+
if (callback) callback(err, function () {
|
11174 |
+
return _this4.t.apply(_this4, arguments);
|
11175 |
+
});
|
11176 |
+
};
|
11177 |
+
|
11178 |
+
var setLng = function setLng(lngs) {
|
11179 |
+
if (!lng && !lngs && _this4.services.languageDetector) lngs = [];
|
11180 |
+
var l = typeof lngs === 'string' ? lngs : _this4.services.languageUtils.getBestMatchFromCodes(lngs);
|
11181 |
+
|
11182 |
+
if (l) {
|
11183 |
+
if (!_this4.language) {
|
11184 |
+
setLngProps(l);
|
11185 |
+
}
|
11186 |
+
|
11187 |
+
if (!_this4.translator.language) _this4.translator.changeLanguage(l);
|
11188 |
+
if (_this4.services.languageDetector) _this4.services.languageDetector.cacheUserLanguage(l);
|
11189 |
+
}
|
11190 |
+
|
11191 |
+
_this4.loadResources(l, function (err) {
|
11192 |
+
done(err, l);
|
11193 |
+
});
|
11194 |
+
};
|
11195 |
+
|
11196 |
+
if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {
|
11197 |
+
setLng(this.services.languageDetector.detect());
|
11198 |
+
} else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {
|
11199 |
+
this.services.languageDetector.detect(setLng);
|
11200 |
+
} else {
|
11201 |
+
setLng(lng);
|
11202 |
+
}
|
11203 |
+
|
11204 |
+
return deferred;
|
11205 |
+
}
|
11206 |
+
}, {
|
11207 |
+
key: "getFixedT",
|
11208 |
+
value: function getFixedT(lng, ns, keyPrefix) {
|
11209 |
+
var _this5 = this;
|
11210 |
+
|
11211 |
+
var fixedT = function fixedT(key, opts) {
|
11212 |
+
var options;
|
11213 |
+
|
11214 |
+
if ((0,esm_typeof/* default */.Z)(opts) !== 'object') {
|
11215 |
+
for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {
|
11216 |
+
rest[_key3 - 2] = arguments[_key3];
|
11217 |
+
}
|
11218 |
+
|
11219 |
+
options = _this5.options.overloadTranslationOptionHandler([key, opts].concat(rest));
|
11220 |
+
} else {
|
11221 |
+
options = _objectSpread$6({}, opts);
|
11222 |
+
}
|
11223 |
+
|
11224 |
+
options.lng = options.lng || fixedT.lng;
|
11225 |
+
options.lngs = options.lngs || fixedT.lngs;
|
11226 |
+
options.ns = options.ns || fixedT.ns;
|
11227 |
+
var keySeparator = _this5.options.keySeparator || '.';
|
11228 |
+
var resultKey = keyPrefix ? "".concat(keyPrefix).concat(keySeparator).concat(key) : key;
|
11229 |
+
return _this5.t(resultKey, options);
|
11230 |
+
};
|
11231 |
+
|
11232 |
+
if (typeof lng === 'string') {
|
11233 |
+
fixedT.lng = lng;
|
11234 |
+
} else {
|
11235 |
+
fixedT.lngs = lng;
|
11236 |
+
}
|
11237 |
+
|
11238 |
+
fixedT.ns = ns;
|
11239 |
+
fixedT.keyPrefix = keyPrefix;
|
11240 |
+
return fixedT;
|
11241 |
+
}
|
11242 |
+
}, {
|
11243 |
+
key: "t",
|
11244 |
+
value: function t() {
|
11245 |
+
var _this$translator;
|
11246 |
+
|
11247 |
+
return this.translator && (_this$translator = this.translator).translate.apply(_this$translator, arguments);
|
11248 |
+
}
|
11249 |
+
}, {
|
11250 |
+
key: "exists",
|
11251 |
+
value: function exists() {
|
11252 |
+
var _this$translator2;
|
11253 |
+
|
11254 |
+
return this.translator && (_this$translator2 = this.translator).exists.apply(_this$translator2, arguments);
|
11255 |
+
}
|
11256 |
+
}, {
|
11257 |
+
key: "setDefaultNamespace",
|
11258 |
+
value: function setDefaultNamespace(ns) {
|
11259 |
+
this.options.defaultNS = ns;
|
11260 |
+
}
|
11261 |
+
}, {
|
11262 |
+
key: "hasLoadedNamespace",
|
11263 |
+
value: function hasLoadedNamespace(ns) {
|
11264 |
+
var _this6 = this;
|
11265 |
+
|
11266 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
11267 |
+
|
11268 |
+
if (!this.isInitialized) {
|
11269 |
+
this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);
|
11270 |
+
return false;
|
11271 |
+
}
|
11272 |
+
|
11273 |
+
if (!this.languages || !this.languages.length) {
|
11274 |
+
this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);
|
11275 |
+
return false;
|
11276 |
+
}
|
11277 |
+
|
11278 |
+
var lng = this.resolvedLanguage || this.languages[0];
|
11279 |
+
var fallbackLng = this.options ? this.options.fallbackLng : false;
|
11280 |
+
var lastLng = this.languages[this.languages.length - 1];
|
11281 |
+
if (lng.toLowerCase() === 'cimode') return true;
|
11282 |
+
|
11283 |
+
var loadNotPending = function loadNotPending(l, n) {
|
11284 |
+
var loadState = _this6.services.backendConnector.state["".concat(l, "|").concat(n)];
|
11285 |
+
|
11286 |
+
return loadState === -1 || loadState === 2;
|
11287 |
+
};
|
11288 |
+
|
11289 |
+
if (options.precheck) {
|
11290 |
+
var preResult = options.precheck(this, loadNotPending);
|
11291 |
+
if (preResult !== undefined) return preResult;
|
11292 |
+
}
|
11293 |
+
|
11294 |
+
if (this.hasResourceBundle(lng, ns)) return true;
|
11295 |
+
if (!this.services.backendConnector.backend) return true;
|
11296 |
+
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
|
11297 |
+
return false;
|
11298 |
+
}
|
11299 |
+
}, {
|
11300 |
+
key: "loadNamespaces",
|
11301 |
+
value: function loadNamespaces(ns, callback) {
|
11302 |
+
var _this7 = this;
|
11303 |
+
|
11304 |
+
var deferred = defer();
|
11305 |
+
|
11306 |
+
if (!this.options.ns) {
|
11307 |
+
callback && callback();
|
11308 |
+
return Promise.resolve();
|
11309 |
+
}
|
11310 |
+
|
11311 |
+
if (typeof ns === 'string') ns = [ns];
|
11312 |
+
ns.forEach(function (n) {
|
11313 |
+
if (_this7.options.ns.indexOf(n) < 0) _this7.options.ns.push(n);
|
11314 |
+
});
|
11315 |
+
this.loadResources(function (err) {
|
11316 |
+
deferred.resolve();
|
11317 |
+
if (callback) callback(err);
|
11318 |
+
});
|
11319 |
+
return deferred;
|
11320 |
+
}
|
11321 |
+
}, {
|
11322 |
+
key: "loadLanguages",
|
11323 |
+
value: function loadLanguages(lngs, callback) {
|
11324 |
+
var deferred = defer();
|
11325 |
+
if (typeof lngs === 'string') lngs = [lngs];
|
11326 |
+
var preloaded = this.options.preload || [];
|
11327 |
+
var newLngs = lngs.filter(function (lng) {
|
11328 |
+
return preloaded.indexOf(lng) < 0;
|
11329 |
+
});
|
11330 |
+
|
11331 |
+
if (!newLngs.length) {
|
11332 |
+
if (callback) callback();
|
11333 |
+
return Promise.resolve();
|
11334 |
+
}
|
11335 |
+
|
11336 |
+
this.options.preload = preloaded.concat(newLngs);
|
11337 |
+
this.loadResources(function (err) {
|
11338 |
+
deferred.resolve();
|
11339 |
+
if (callback) callback(err);
|
11340 |
+
});
|
11341 |
+
return deferred;
|
11342 |
+
}
|
11343 |
+
}, {
|
11344 |
+
key: "dir",
|
11345 |
+
value: function dir(lng) {
|
11346 |
+
if (!lng) lng = this.resolvedLanguage || (this.languages && this.languages.length > 0 ? this.languages[0] : this.language);
|
11347 |
+
if (!lng) return 'rtl';
|
11348 |
+
var rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam', 'ckb'];
|
11349 |
+
return rtlLngs.indexOf(this.services.languageUtils.getLanguagePartFromCode(lng)) > -1 || lng.toLowerCase().indexOf('-arab') > 1 ? 'rtl' : 'ltr';
|
11350 |
+
}
|
11351 |
+
}, {
|
11352 |
+
key: "cloneInstance",
|
11353 |
+
value: function cloneInstance() {
|
11354 |
+
var _this8 = this;
|
11355 |
+
|
11356 |
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11357 |
+
var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
11358 |
+
|
11359 |
+
var mergedOptions = _objectSpread$6(_objectSpread$6(_objectSpread$6({}, this.options), options), {
|
11360 |
+
isClone: true
|
11361 |
+
});
|
11362 |
+
|
11363 |
+
var clone = new I18n(mergedOptions);
|
11364 |
+
var membersToCopy = ['store', 'services', 'language'];
|
11365 |
+
membersToCopy.forEach(function (m) {
|
11366 |
+
clone[m] = _this8[m];
|
11367 |
+
});
|
11368 |
+
clone.services = _objectSpread$6({}, this.services);
|
11369 |
+
clone.services.utils = {
|
11370 |
+
hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
|
11371 |
+
};
|
11372 |
+
clone.translator = new Translator(clone.services, clone.options);
|
11373 |
+
clone.translator.on('*', function (event) {
|
11374 |
+
for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {
|
11375 |
+
args[_key4 - 1] = arguments[_key4];
|
11376 |
+
}
|
11377 |
+
|
11378 |
+
clone.emit.apply(clone, [event].concat(args));
|
11379 |
+
});
|
11380 |
+
clone.init(mergedOptions, callback);
|
11381 |
+
clone.translator.options = clone.options;
|
11382 |
+
clone.translator.backendConnector.services.utils = {
|
11383 |
+
hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)
|
11384 |
+
};
|
11385 |
+
return clone;
|
11386 |
+
}
|
11387 |
+
}, {
|
11388 |
+
key: "toJSON",
|
11389 |
+
value: function toJSON() {
|
11390 |
+
return {
|
11391 |
+
options: this.options,
|
11392 |
+
store: this.store,
|
11393 |
+
language: this.language,
|
11394 |
+
languages: this.languages,
|
11395 |
+
resolvedLanguage: this.resolvedLanguage
|
11396 |
+
};
|
11397 |
+
}
|
11398 |
+
}]);
|
11399 |
+
|
11400 |
+
return I18n;
|
11401 |
+
}(EventEmitter);
|
11402 |
+
|
11403 |
+
(0,defineProperty/* default */.Z)(I18n, "createInstance", function () {
|
11404 |
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
11405 |
+
var callback = arguments.length > 1 ? arguments[1] : undefined;
|
11406 |
+
return new I18n(options, callback);
|
11407 |
+
});
|
11408 |
+
|
11409 |
+
var instance = I18n.createInstance();
|
11410 |
+
instance.createInstance = I18n.createInstance;
|
11411 |
+
|
11412 |
+
var createInstance = instance.createInstance;
|
11413 |
+
var init = instance.init;
|
11414 |
+
var loadResources = instance.loadResources;
|
11415 |
+
var reloadResources = instance.reloadResources;
|
11416 |
+
var use = instance.use;
|
11417 |
+
var changeLanguage = instance.changeLanguage;
|
11418 |
+
var getFixedT = instance.getFixedT;
|
11419 |
+
var t = instance.t;
|
11420 |
+
var exists = instance.exists;
|
11421 |
+
var setDefaultNamespace = instance.setDefaultNamespace;
|
11422 |
+
var hasLoadedNamespace = instance.hasLoadedNamespace;
|
11423 |
+
var loadNamespaces = instance.loadNamespaces;
|
11424 |
+
var loadLanguages = instance.loadLanguages;
|
11425 |
+
|
11426 |
+
/* harmony default export */ var i18next = (instance);
|
11427 |
+
|
11428 |
+
|
11429 |
+
;// CONCATENATED MODULE: ./src/js/utils/translate.js
|
11430 |
+
|
11431 |
+
function translate(key) {
|
11432 |
+
var objects = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
11433 |
+
return i18next.t(key, objects);
|
11434 |
+
}
|
11435 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/store/helpers.js
|
11436 |
+
function helpers_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
11437 |
+
|
11438 |
+
function helpers_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { helpers_ownKeys(Object(source), true).forEach(function (key) { helpers_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { helpers_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
11439 |
+
|
11440 |
+
function helpers_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
11441 |
+
|
11442 |
+
|
11443 |
+
|
11444 |
+
|
11445 |
+
|
11446 |
+
|
11447 |
+
var previousFailedRequest = {
|
11448 |
+
resolve: null,
|
11449 |
+
endpoint: null,
|
11450 |
+
data: null
|
11451 |
+
};
|
11452 |
+
/**
|
11453 |
+
* Create api request
|
11454 |
+
*maar j
|
11455 |
+
* @param {*} endpoint
|
11456 |
+
* @param {*} data
|
11457 |
+
*/
|
11458 |
+
|
11459 |
+
function apiRequest(endpoint, data) {
|
11460 |
+
var failedEarlier = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
11461 |
+
var forceReturnReject = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
11462 |
+
data.url = buttonizer_admin.api + endpoint; // Stand alone version
|
11463 |
+
|
11464 |
+
if (buttonizer_admin.is_stand_alone) {
|
11465 |
+
data.headers = {
|
11466 |
+
Authorization: "Bearer ".concat(buttonizer_admin.auth)
|
11467 |
+
};
|
11468 |
+
} // WordPress version
|
11469 |
+
else {
|
11470 |
+
data.headers = {
|
11471 |
+
"X-WP-Nonce": buttonizer_admin.nonce
|
11472 |
+
};
|
11473 |
+
} // With credentials
|
11474 |
+
|
11475 |
+
|
11476 |
+
data.withCredentials = true;
|
11477 |
+
return new Promise(function (resolve, reject) {
|
11478 |
+
axios_default()(data).then(function (data) {
|
11479 |
+
return resolve(data);
|
11480 |
+
})["catch"](function (err) {
|
11481 |
+
// User unauthenticated
|
11482 |
+
if (!failedEarlier && err.response && err.response.status === 401) {
|
11483 |
+
if (app.standAloneEvent) {
|
11484 |
+
app.standAloneEvent("unauthenticated");
|
11485 |
+
} // Not authenticated, but return a reject
|
11486 |
+
// Also, do not continue and re-use this request to resolve
|
11487 |
+
|
11488 |
+
|
11489 |
+
if (forceReturnReject) {
|
11490 |
+
reject("wait-for-auth");
|
11491 |
+
return;
|
11492 |
+
} // Populate failed request
|
11493 |
+
// Re-use this data after re-authorization
|
11494 |
+
|
11495 |
+
|
11496 |
+
previousFailedRequest = {
|
11497 |
+
resolve: resolve,
|
11498 |
+
endpoint: endpoint,
|
11499 |
+
data: data
|
11500 |
+
};
|
11501 |
+
return;
|
11502 |
+
}
|
11503 |
+
|
11504 |
+
if (app.standAloneEvent) {
|
11505 |
+
app.standAloneEvent("unauthenticated");
|
11506 |
+
}
|
11507 |
+
|
11508 |
+
reject(err);
|
11509 |
+
});
|
11510 |
+
});
|
11511 |
+
}
|
11512 |
+
function retryApiRequest() {
|
11513 |
+
// Data empty
|
11514 |
+
if (!previousFailedRequest.resolve) {
|
11515 |
+
throw new Error(previousFailedRequest);
|
11516 |
+
}
|
11517 |
+
|
11518 |
+
return new Promise(function (resolve, reject) {
|
11519 |
+
apiRequest(previousFailedRequest.endpoint, previousFailedRequest.data, false, true).then(function (data) {
|
11520 |
+
previousFailedRequest.resolve(data);
|
11521 |
+
resolve();
|
11522 |
+
})["catch"](function (e) {
|
11523 |
+
return reject(e);
|
11524 |
+
});
|
11525 |
+
});
|
11526 |
+
}
|
11527 |
+
/**
|
11528 |
+
* init store
|
11529 |
+
*/
|
11530 |
+
|
11531 |
+
function helpers_init() {
|
11532 |
+
return {
|
11533 |
+
type: actionTypes.INIT,
|
11534 |
+
payload: {
|
11535 |
+
buttons: {},
|
11536 |
+
groups: {},
|
11537 |
+
timeSchedules: {},
|
11538 |
+
pageRules: {},
|
11539 |
+
settings: {}
|
11540 |
+
}
|
11541 |
+
};
|
11542 |
+
}
|
11543 |
+
/**
|
11544 |
+
* Convert data to models
|
11545 |
+
*
|
11546 |
+
* @param result
|
11547 |
+
* @return {obj} converted data
|
11548 |
+
*/
|
11549 |
+
|
11550 |
+
function convertData(result) {
|
11551 |
+
var data = result;
|
11552 |
+
var buttons = {};
|
11553 |
+
var groups = {}; // Initializing groups
|
11554 |
+
|
11555 |
+
data.groups.map(function (group) {
|
11556 |
+
var groupObject = createRecord(group.data);
|
11557 |
+
groupObject.children = []; // Initializing buttons inside the group
|
11558 |
+
|
11559 |
+
Object.keys(group.buttons).map(function (key) {
|
11560 |
+
var button = group.buttons[key];
|
11561 |
+
var buttonObject = createRecord(button);
|
11562 |
+
buttonObject.parent = groupObject.id;
|
11563 |
+
buttons[buttonObject.id] = buttonObject;
|
11564 |
+
groupObject.children.push(buttonObject.id);
|
11565 |
+
});
|
11566 |
+
groups[groupObject.id] = groupObject;
|
11567 |
+
});
|
11568 |
+
var timeSchedules = {};
|
11569 |
+
var pageRules = {};
|
11570 |
+
|
11571 |
+
if (data.time_schedules) {
|
11572 |
+
data.time_schedules.map(function (timeSchedule) {
|
11573 |
+
timeSchedules[timeSchedule.id] = {
|
11574 |
+
id: timeSchedule.id,
|
11575 |
+
name: timeSchedule.name || translate("time_schedules.single_name"),
|
11576 |
+
weekdays: timeSchedule.weekdays || weekdays.map(function (weekday) {
|
11577 |
+
return {
|
11578 |
+
opened: true,
|
11579 |
+
open: "8:00",
|
11580 |
+
close: "17:00",
|
11581 |
+
weekday: weekday
|
11582 |
+
};
|
11583 |
+
}),
|
11584 |
+
start_date: timeSchedule.start_date || dateToFormat(new Date()),
|
11585 |
+
end_date: timeSchedule.end_date || null,
|
11586 |
+
dates: timeSchedule.dates || []
|
11587 |
+
};
|
11588 |
+
});
|
11589 |
+
} // Add page rules data with placeholders
|
11590 |
+
|
11591 |
+
|
11592 |
+
if (data.page_rules) {
|
11593 |
+
data.page_rules.map(function (pageRule) {
|
11594 |
+
pageRules[pageRule.id] = {
|
11595 |
+
id: pageRule.id,
|
11596 |
+
name: pageRule.name || "Unnamed pagerule",
|
11597 |
+
type: pageRule.type || "and",
|
11598 |
+
rules: pageRule.rules || [{
|
11599 |
+
type: "page_title",
|
11600 |
+
value: ""
|
11601 |
+
}]
|
11602 |
+
};
|
11603 |
+
});
|
11604 |
+
}
|
11605 |
+
|
11606 |
+
return {
|
11607 |
+
hasChanges: data.changes,
|
11608 |
+
buttons: buttons,
|
11609 |
+
groups: groups,
|
11610 |
+
timeSchedules: timeSchedules,
|
11611 |
+
pageRules: pageRules,
|
11612 |
+
settings: data.settings,
|
11613 |
+
premium: data.premium,
|
11614 |
+
premium_code: data.premium_code,
|
11615 |
+
version: data.version,
|
11616 |
+
wordpress: data.wordpress,
|
11617 |
+
info: data.info,
|
11618 |
+
is_opt_in: data.is_opt_in,
|
11619 |
+
latest_tour_update: data.latest_tour_update,
|
11620 |
+
identifier: data.identifier ? data.identifier : null,
|
11621 |
+
additional_permissions: data.additional_permissions,
|
11622 |
+
domain: data.domain
|
11623 |
+
};
|
11624 |
+
}
|
11625 |
+
function createRecord(data) {
|
11626 |
+
if (data && typeof data.id !== "undefined") return data;
|
11627 |
+
return helpers_objectSpread(helpers_objectSpread({}, data), {}, {
|
11628 |
+
id: GenerateUniqueId()
|
11629 |
+
});
|
11630 |
+
}
|
11631 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/store/actions/dataActions/index.js
|
11632 |
+
|
11633 |
+
|
11634 |
+
/**
|
11635 |
+
* Add model to store
|
11636 |
+
* @param {object} data
|
11637 |
+
* @param {string} model
|
11638 |
+
*/
|
11639 |
+
|
11640 |
+
function addModel(data, model) {
|
11641 |
+
return {
|
11642 |
+
type: actionTypes[model].ADD_MODEL,
|
11643 |
+
payload: data
|
11644 |
+
};
|
11645 |
+
}
|
11646 |
+
/**
|
11647 |
+
* Add relation between button and group
|
11648 |
+
* @param {string} button_id
|
11649 |
+
* @param {string} group_id
|
11650 |
+
*/
|
11651 |
+
|
11652 |
+
function dataActions_addRelation(button_id, group_id) {
|
11653 |
+
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
11654 |
+
return {
|
11655 |
+
type: buttonizer_constants_actionTypes.ADD_RELATION,
|
11656 |
+
payload: {
|
11657 |
+
button_id: button_id,
|
11658 |
+
group_id: group_id,
|
11659 |
+
index: index
|
11660 |
+
}
|
11661 |
+
};
|
11662 |
+
}
|
11663 |
+
/**
|
11664 |
+
* Change relations (for drag n drop)
|
11665 |
+
* @param {string} button_id button id to change relations
|
11666 |
+
* @param {string} new_group_id new group id
|
11667 |
+
*/
|
11668 |
+
|
11669 |
+
function dataActions_changeRelation(button_id, old_group_id, new_group_id, button_index) {
|
11670 |
+
return {
|
11671 |
+
type: buttonizer_constants_actionTypes.CHANGE_RELATION,
|
11672 |
+
payload: {
|
11673 |
+
button_id: button_id,
|
11674 |
+
old_group_id: old_group_id,
|
11675 |
+
new_group_id: new_group_id,
|
11676 |
+
button_index: button_index
|
11677 |
+
}
|
11678 |
+
};
|
11679 |
+
}
|
11680 |
+
/**
|
11681 |
+
* Remove relation between button and group
|
11682 |
+
* @param {string} button_id
|
11683 |
+
* @param {string} group_id
|
11684 |
+
*/
|
11685 |
+
|
11686 |
+
function removeRelation(button_id, group_id) {
|
11687 |
+
return {
|
11688 |
+
type: buttonizer_constants_actionTypes.REMOVE_RELATION,
|
11689 |
+
payload: {
|
11690 |
+
button_id: button_id,
|
11691 |
+
group_id: group_id
|
11692 |
+
}
|
11693 |
+
};
|
11694 |
+
}
|
11695 |
+
/**
|
11696 |
+
* Set key of model id to value specified
|
11697 |
+
*
|
11698 |
+
* @param {string} model model of object to change value on
|
11699 |
+
* @param {string} id button or group id
|
11700 |
+
* @param {string} key key of value to change
|
11701 |
+
* @param {any} value new value to set
|
11702 |
+
*/
|
11703 |
+
|
11704 |
+
var dataActions_set = function set(model, id, key, value) {
|
11705 |
+
// Check is value is an array
|
11706 |
+
if (Array.isArray(value)) {
|
11707 |
+
return {
|
11708 |
+
type: buttonizer_constants_actionTypes[model].SET_KEY_FORMAT,
|
11709 |
+
payload: {
|
11710 |
+
id: id,
|
11711 |
+
format: "normal_hover",
|
11712 |
+
key: key,
|
11713 |
+
values: value
|
11714 |
+
}
|
11715 |
+
};
|
11716 |
+
} // if not, just set it normally
|
11717 |
+
|
11718 |
+
|
11719 |
+
return {
|
11720 |
+
type: buttonizer_constants_actionTypes[model].SET_KEY_VALUE,
|
11721 |
+
payload: {
|
11722 |
+
id: id,
|
11723 |
+
key: key,
|
11724 |
+
value: value
|
11725 |
+
}
|
11726 |
+
};
|
11727 |
+
};
|
11728 |
+
var dataActions_setSetting = function setSetting(setting, value) {
|
11729 |
+
return {
|
11730 |
+
type: buttonizer_constants_actionTypes.SET_SETTING_VALUE,
|
11731 |
+
payload: {
|
11732 |
+
setting: setting,
|
11733 |
+
value: value
|
11734 |
+
}
|
11735 |
+
};
|
11736 |
+
};
|
11737 |
+
var dataActions_setMisc = function setMisc(setting, value) {
|
11738 |
+
return {
|
11739 |
+
type: buttonizer_constants_actionTypes.SET_MISC_VALUE,
|
11740 |
+
payload: {
|
11741 |
+
setting: setting,
|
11742 |
+
value: value
|
11743 |
+
}
|
11744 |
+
};
|
11745 |
+
};
|
11746 |
+
/**
|
11747 |
+
* Time Schedule Actions
|
11748 |
+
*/
|
11749 |
+
//
|
11750 |
+
|
11751 |
+
var setWeekday = function setWeekday(id, weekdayKey, key, value) {
|
11752 |
+
return {
|
11753 |
+
type: actionTypes.SET_WEEKDAY,
|
11754 |
+
payload: {
|
11755 |
+
id: id,
|
11756 |
+
weekdayKey: weekdayKey,
|
11757 |
+
key: key,
|
11758 |
+
value: value
|
11759 |
+
}
|
11760 |
+
};
|
11761 |
+
};
|
11762 |
+
var addExcludedDate = function addExcludedDate(id) {
|
11763 |
+
return {
|
11764 |
+
type: actionTypes.ADD_EXCLUDED_DATE,
|
11765 |
+
payload: {
|
11766 |
+
id: id
|
11767 |
+
}
|
11768 |
+
};
|
11769 |
+
};
|
11770 |
+
var setExcludedDate = function setExcludedDate(id, dateKey, key, value) {
|
11771 |
+
return {
|
11772 |
+
type: actionTypes.SET_EXCLUDED_DATE,
|
11773 |
+
payload: {
|
11774 |
+
id: id,
|
11775 |
+
dateKey: dateKey,
|
11776 |
+
key: key,
|
11777 |
+
value: value
|
11778 |
+
}
|
11779 |
+
};
|
11780 |
+
};
|
11781 |
+
var removeExcludedDate = function removeExcludedDate(id, dateKey) {
|
11782 |
+
return {
|
11783 |
+
type: actionTypes.REMOVE_EXCLUDED_DATE,
|
11784 |
+
payload: {
|
11785 |
+
id: id,
|
11786 |
+
dateKey: dateKey
|
11787 |
+
}
|
11788 |
+
};
|
11789 |
+
};
|
11790 |
+
/**
|
11791 |
+
* Adds record to store
|
11792 |
+
* @param {object} payload data for new record
|
11793 |
+
* @param {String} model type of model
|
11794 |
+
*/
|
11795 |
+
|
11796 |
+
function dataActions_addRecord(data, model) {
|
11797 |
+
var index = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "";
|
11798 |
+
return {
|
11799 |
+
type: buttonizer_constants_actionTypes[model].ADD_RECORD,
|
11800 |
+
payload: {
|
11801 |
+
record: createRecord(data),
|
11802 |
+
index: index
|
11803 |
+
}
|
11804 |
+
};
|
11805 |
+
}
|
11806 |
/**
|
11807 |
* Removes record to store
|
11808 |
* @param {int} model_id id of model to remove
|
11855 |
return Object.keys(state.groups).length;
|
11856 |
}
|
11857 |
;// CONCATENATED MODULE: ./node_modules/immer/dist/immer.esm.js
|
11858 |
+
function n(n){for(var t=arguments.length,r=Array(t>1?t-1:0),e=1;e<t;e++)r[e-1]=arguments[e];if(false){ var i, o; }throw Error("[Immer] minified error nr: "+n+(r.length?" "+r.map((function(n){return"'"+n+"'"})).join(","):"")+". Find the full error at: https://bit.ly/3cXEKWf")}function immer_esm_t(n){return!!n&&!!n[Q]}function r(n){return!!n&&(function(n){if(!n||"object"!=typeof n)return!1;var t=Object.getPrototypeOf(n);if(null===t)return!0;var r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===Z}(n)||Array.isArray(n)||!!n[L]||!!n.constructor[L]||s(n)||v(n))}function e(r){return immer_esm_t(r)||n(23,r),r[Q].t}function i(n,t,r){void 0===r&&(r=!1),0===o(n)?(r?Object.keys:nn)(n).forEach((function(e){r&&"symbol"==typeof e||t(e,n[e],n)})):n.forEach((function(r,e){return t(e,r,n)}))}function o(n){var t=n[Q];return t?t.i>3?t.i-4:t.i:Array.isArray(n)?1:s(n)?2:v(n)?3:0}function u(n,t){return 2===o(n)?n.has(t):Object.prototype.hasOwnProperty.call(n,t)}function a(n,t){return 2===o(n)?n.get(t):n[t]}function f(n,t,r){var e=o(n);2===e?n.set(t,r):3===e?(n.delete(t),n.add(r)):n[t]=r}function c(n,t){return n===t?0!==n||1/n==1/t:n!=n&&t!=t}function s(n){return X&&n instanceof Map}function v(n){return q&&n instanceof Set}function p(n){return n.o||n.t}function l(n){if(Array.isArray(n))return Array.prototype.slice.call(n);var t=tn(n);delete t[Q];for(var r=nn(t),e=0;e<r.length;e++){var i=r[e],o=t[i];!1===o.writable&&(o.writable=!0,o.configurable=!0),(o.get||o.set)&&(t[i]={configurable:!0,writable:!0,enumerable:o.enumerable,value:n[i]})}return Object.create(Object.getPrototypeOf(n),t)}function d(n,e){return void 0===e&&(e=!1),y(n)||immer_esm_t(n)||!r(n)?n:(o(n)>1&&(n.set=n.add=n.clear=n.delete=h),Object.freeze(n),e&&i(n,(function(n,t){return d(t,!0)}),!0),n)}function h(){n(2)}function y(n){return null==n||"object"!=typeof n||Object.isFrozen(n)}function b(t){var r=rn[t];return r||n(18,t),r}function m(n,t){rn[n]||(rn[n]=t)}function _(){return true||0,U}function j(n,t){t&&(b("Patches"),n.u=[],n.s=[],n.v=t)}function O(n){g(n),n.p.forEach(S),n.p=null}function g(n){n===U&&(U=n.l)}function w(n){return U={p:[],l:U,h:n,m:!0,_:0}}function S(n){var t=n[Q];0===t.i||1===t.i?t.j():t.O=!0}function P(t,e){e._=e.p.length;var i=e.p[0],o=void 0!==t&&t!==i;return e.h.g||b("ES5").S(e,t,o),o?(i[Q].P&&(O(e),n(4)),r(t)&&(t=M(e,t),e.l||x(e,t)),e.u&&b("Patches").M(i[Q],t,e.u,e.s)):t=M(e,i,[]),O(e),e.u&&e.v(e.u,e.s),t!==H?t:void 0}function M(n,t,r){if(y(t))return t;var e=t[Q];if(!e)return i(t,(function(i,o){return A(n,e,t,i,o,r)}),!0),t;if(e.A!==n)return t;if(!e.P)return x(n,e.t,!0),e.t;if(!e.I){e.I=!0,e.A._--;var o=4===e.i||5===e.i?e.o=l(e.k):e.o;i(3===e.i?new Set(o):o,(function(t,i){return A(n,e,o,t,i,r)})),x(n,o,!1),r&&n.u&&b("Patches").R(e,r,n.u,n.s)}return e.o}function A(e,i,o,a,c,s){if( false&&0,immer_esm_t(c)){var v=M(e,c,s&&i&&3!==i.i&&!u(i.D,a)?s.concat(a):void 0);if(f(o,a,v),!immer_esm_t(v))return;e.m=!1}if(r(c)&&!y(c)){if(!e.h.F&&e._<1)return;M(e,c),i&&i.A.l||x(e,c)}}function x(n,t,r){void 0===r&&(r=!1),n.h.F&&n.m&&d(t,r)}function z(n,t){var r=n[Q];return(r?p(r):n)[t]}function I(n,t){if(t in n)for(var r=Object.getPrototypeOf(n);r;){var e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=Object.getPrototypeOf(r)}}function k(n){n.P||(n.P=!0,n.l&&k(n.l))}function E(n){n.o||(n.o=l(n.t))}function R(n,t,r){var e=s(t)?b("MapSet").N(t,r):v(t)?b("MapSet").T(t,r):n.g?function(n,t){var r=Array.isArray(n),e={i:r?1:0,A:t?t.A:_(),P:!1,I:!1,D:{},l:t,t:n,k:null,o:null,j:null,C:!1},i=e,o=en;r&&(i=[e],o=on);var u=Proxy.revocable(i,o),a=u.revoke,f=u.proxy;return e.k=f,e.j=a,f}(t,r):b("ES5").J(t,r);return(r?r.A:_()).p.push(e),e}function D(e){return immer_esm_t(e)||n(22,e),function n(t){if(!r(t))return t;var e,u=t[Q],c=o(t);if(u){if(!u.P&&(u.i<4||!b("ES5").K(u)))return u.t;u.I=!0,e=F(t,c),u.I=!1}else e=F(t,c);return i(e,(function(t,r){u&&a(u.t,t)===r||f(e,t,n(r))})),3===c?new Set(e):e}(e)}function F(n,t){switch(t){case 2:return new Map(n);case 3:return Array.from(n)}return l(n)}function N(){function r(n,t){var r=s[n];return r?r.enumerable=t:s[n]=r={configurable:!0,enumerable:t,get:function(){var t=this[Q];return false&&0,en.get(t,n)},set:function(t){var r=this[Q]; false&&0,en.set(r,n,t)}},r}function e(n){for(var t=n.length-1;t>=0;t--){var r=n[t][Q];if(!r.P)switch(r.i){case 5:a(r)&&k(r);break;case 4:o(r)&&k(r)}}}function o(n){for(var t=n.t,r=n.k,e=nn(r),i=e.length-1;i>=0;i--){var o=e[i];if(o!==Q){var a=t[o];if(void 0===a&&!u(t,o))return!0;var f=r[o],s=f&&f[Q];if(s?s.t!==a:!c(f,a))return!0}}var v=!!t[Q];return e.length!==nn(t).length+(v?0:1)}function a(n){var t=n.k;if(t.length!==n.t.length)return!0;var r=Object.getOwnPropertyDescriptor(t,t.length-1);return!(!r||r.get)}function f(t){t.O&&n(3,JSON.stringify(p(t)))}var s={};m("ES5",{J:function(n,t){var e=Array.isArray(n),i=function(n,t){if(n){for(var e=Array(t.length),i=0;i<t.length;i++)Object.defineProperty(e,""+i,r(i,!0));return e}var o=tn(t);delete o[Q];for(var u=nn(o),a=0;a<u.length;a++){var f=u[a];o[f]=r(f,n||!!o[f].enumerable)}return Object.create(Object.getPrototypeOf(t),o)}(e,n),o={i:e?5:4,A:t?t.A:_(),P:!1,I:!1,D:{},l:t,t:n,k:i,o:null,O:!1,C:!1};return Object.defineProperty(i,Q,{value:o,writable:!0}),i},S:function(n,r,o){o?immer_esm_t(r)&&r[Q].A===n&&e(n.p):(n.u&&function n(t){if(t&&"object"==typeof t){var r=t[Q];if(r){var e=r.t,o=r.k,f=r.D,c=r.i;if(4===c)i(o,(function(t){t!==Q&&(void 0!==e[t]||u(e,t)?f[t]||n(o[t]):(f[t]=!0,k(r)))})),i(e,(function(n){void 0!==o[n]||u(o,n)||(f[n]=!1,k(r))}));else if(5===c){if(a(r)&&(k(r),f.length=!0),o.length<e.length)for(var s=o.length;s<e.length;s++)f[s]=!1;else for(var v=e.length;v<o.length;v++)f[v]=!0;for(var p=Math.min(o.length,e.length),l=0;l<p;l++)void 0===f[l]&&n(o[l])}}}}(n.p[0]),e(n.p))},K:function(n){return 4===n.i?o(n):a(n)}})}function T(){function e(n){if(!r(n))return n;if(Array.isArray(n))return n.map(e);if(s(n))return new Map(Array.from(n.entries()).map((function(n){return[n[0],e(n[1])]})));if(v(n))return new Set(Array.from(n).map(e));var t=Object.create(Object.getPrototypeOf(n));for(var i in n)t[i]=e(n[i]);return u(n,L)&&(t[L]=n[L]),t}function f(n){return immer_esm_t(n)?e(n):n}var c="add";m("Patches",{$:function(t,r){return r.forEach((function(r){for(var i=r.path,u=r.op,f=t,s=0;s<i.length-1;s++){var v=o(f),p=""+i[s];0!==v&&1!==v||"__proto__"!==p&&"constructor"!==p||n(24),"function"==typeof f&&"prototype"===p&&n(24),"object"!=typeof(f=a(f,p))&&n(15,i.join("/"))}var l=o(f),d=e(r.value),h=i[i.length-1];switch(u){case"replace":switch(l){case 2:return f.set(h,d);case 3:n(16);default:return f[h]=d}case c:switch(l){case 1:return f.splice(h,0,d);case 2:return f.set(h,d);case 3:return f.add(d);default:return f[h]=d}case"remove":switch(l){case 1:return f.splice(h,1);case 2:return f.delete(h);case 3:return f.delete(r.value);default:return delete f[h]}default:n(17,u)}})),t},R:function(n,t,r,e){switch(n.i){case 0:case 4:case 2:return function(n,t,r,e){var o=n.t,s=n.o;i(n.D,(function(n,i){var v=a(o,n),p=a(s,n),l=i?u(o,n)?"replace":c:"remove";if(v!==p||"replace"!==l){var d=t.concat(n);r.push("remove"===l?{op:l,path:d}:{op:l,path:d,value:p}),e.push(l===c?{op:"remove",path:d}:"remove"===l?{op:c,path:d,value:f(v)}:{op:"replace",path:d,value:f(v)})}}))}(n,t,r,e);case 5:case 1:return function(n,t,r,e){var i=n.t,o=n.D,u=n.o;if(u.length<i.length){var a=[u,i];i=a[0],u=a[1];var s=[e,r];r=s[0],e=s[1]}for(var v=0;v<i.length;v++)if(o[v]&&u[v]!==i[v]){var p=t.concat([v]);r.push({op:"replace",path:p,value:f(u[v])}),e.push({op:"replace",path:p,value:f(i[v])})}for(var l=i.length;l<u.length;l++){var d=t.concat([l]);r.push({op:c,path:d,value:f(u[l])})}i.length<u.length&&e.push({op:"replace",path:t.concat(["length"]),value:i.length})}(n,t,r,e);case 3:return function(n,t,r,e){var i=n.t,o=n.o,u=0;i.forEach((function(n){if(!o.has(n)){var i=t.concat([u]);r.push({op:"remove",path:i,value:n}),e.unshift({op:c,path:i,value:n})}u++})),u=0,o.forEach((function(n){if(!i.has(n)){var o=t.concat([u]);r.push({op:c,path:o,value:n}),e.unshift({op:"remove",path:o,value:n})}u++}))}(n,t,r,e)}},M:function(n,t,r,e){r.push({op:"replace",path:[],value:t===H?void 0:t}),e.push({op:"replace",path:[],value:n.t})}})}function C(){function t(n,t){function r(){this.constructor=n}a(n,t),n.prototype=(r.prototype=t.prototype,new r)}function e(n){n.o||(n.D=new Map,n.o=new Map(n.t))}function o(n){n.o||(n.o=new Set,n.t.forEach((function(t){if(r(t)){var e=R(n.A.h,t,n);n.p.set(t,e),n.o.add(e)}else n.o.add(t)})))}function u(t){t.O&&n(3,JSON.stringify(p(t)))}var a=function(n,t){return(a=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r])})(n,t)},f=function(){function n(n,t){return this[Q]={i:2,l:t,A:t?t.A:_(),P:!1,I:!1,o:void 0,D:void 0,t:n,k:this,C:!1,O:!1},this}t(n,Map);var o=n.prototype;return Object.defineProperty(o,"size",{get:function(){return p(this[Q]).size}}),o.has=function(n){return p(this[Q]).has(n)},o.set=function(n,t){var r=this[Q];return u(r),p(r).has(n)&&p(r).get(n)===t||(e(r),k(r),r.D.set(n,!0),r.o.set(n,t),r.D.set(n,!0)),this},o.delete=function(n){if(!this.has(n))return!1;var t=this[Q];return u(t),e(t),k(t),t.D.set(n,!1),t.o.delete(n),!0},o.clear=function(){var n=this[Q];u(n),p(n).size&&(e(n),k(n),n.D=new Map,i(n.t,(function(t){n.D.set(t,!1)})),n.o.clear())},o.forEach=function(n,t){var r=this;p(this[Q]).forEach((function(e,i){n.call(t,r.get(i),i,r)}))},o.get=function(n){var t=this[Q];u(t);var i=p(t).get(n);if(t.I||!r(i))return i;if(i!==t.t.get(n))return i;var o=R(t.A.h,i,t);return e(t),t.o.set(n,o),o},o.keys=function(){return p(this[Q]).keys()},o.values=function(){var n,t=this,r=this.keys();return(n={})[V]=function(){return t.values()},n.next=function(){var n=r.next();return n.done?n:{done:!1,value:t.get(n.value)}},n},o.entries=function(){var n,t=this,r=this.keys();return(n={})[V]=function(){return t.entries()},n.next=function(){var n=r.next();if(n.done)return n;var e=t.get(n.value);return{done:!1,value:[n.value,e]}},n},o[V]=function(){return this.entries()},n}(),c=function(){function n(n,t){return this[Q]={i:3,l:t,A:t?t.A:_(),P:!1,I:!1,o:void 0,t:n,k:this,p:new Map,O:!1,C:!1},this}t(n,Set);var r=n.prototype;return Object.defineProperty(r,"size",{get:function(){return p(this[Q]).size}}),r.has=function(n){var t=this[Q];return u(t),t.o?!!t.o.has(n)||!(!t.p.has(n)||!t.o.has(t.p.get(n))):t.t.has(n)},r.add=function(n){var t=this[Q];return u(t),this.has(n)||(o(t),k(t),t.o.add(n)),this},r.delete=function(n){if(!this.has(n))return!1;var t=this[Q];return u(t),o(t),k(t),t.o.delete(n)||!!t.p.has(n)&&t.o.delete(t.p.get(n))},r.clear=function(){var n=this[Q];u(n),p(n).size&&(o(n),k(n),n.o.clear())},r.values=function(){var n=this[Q];return u(n),o(n),n.o.values()},r.entries=function(){var n=this[Q];return u(n),o(n),n.o.entries()},r.keys=function(){return this.values()},r[V]=function(){return this.values()},r.forEach=function(n,t){for(var r=this.values(),e=r.next();!e.done;)n.call(t,e.value,e.value,this),e=r.next()},n}();m("MapSet",{N:function(n,t){return new f(n,t)},T:function(n,t){return new c(n,t)}})}function J(){N(),C(),T()}function K(n){return n}function $(n){return n}var G,U,W="undefined"!=typeof Symbol&&"symbol"==typeof Symbol("x"),X="undefined"!=typeof Map,q="undefined"!=typeof Set,B="undefined"!=typeof Proxy&&void 0!==Proxy.revocable&&"undefined"!=typeof Reflect,H=W?Symbol.for("immer-nothing"):((G={})["immer-nothing"]=!0,G),L=W?Symbol.for("immer-draftable"):"__$immer_draftable",Q=W?Symbol.for("immer-state"):"__$immer_state",V="undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator",Y={0:"Illegal state",1:"Immer drafts cannot have computed properties",2:"This object has been frozen and should not be mutated",3:function(n){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+n},4:"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.",5:"Immer forbids circular references",6:"The first or second argument to `produce` must be a function",7:"The third argument to `produce` must be a function or undefined",8:"First argument to `createDraft` must be a plain object, an array, or an immerable object",9:"First argument to `finishDraft` must be a draft returned by `createDraft`",10:"The given draft is already finalized",11:"Object.defineProperty() cannot be used on an Immer draft",12:"Object.setPrototypeOf() cannot be used on an Immer draft",13:"Immer only supports deleting array indices",14:"Immer only supports setting array indices and the 'length' property",15:function(n){return"Cannot apply patch, path doesn't resolve: "+n},16:'Sets cannot have "replace" patches.',17:function(n){return"Unsupported patch operation: "+n},18:function(n){return"The plugin for '"+n+"' has not been loaded into Immer. To enable the plugin, import and call `enable"+n+"()` when initializing your application."},20:"Cannot use proxies if Proxy, Proxy.revocable or Reflect are not available",21:function(n){return"produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '"+n+"'"},22:function(n){return"'current' expects a draft, got: "+n},23:function(n){return"'original' expects a draft, got: "+n},24:"Patching reserved attributes like __proto__, prototype and constructor is not allowed"},Z=""+Object.prototype.constructor,nn="undefined"!=typeof Reflect&&Reflect.ownKeys?Reflect.ownKeys:void 0!==Object.getOwnPropertySymbols?function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:Object.getOwnPropertyNames,tn=Object.getOwnPropertyDescriptors||function(n){var t={};return nn(n).forEach((function(r){t[r]=Object.getOwnPropertyDescriptor(n,r)})),t},rn={},en={get:function(n,t){if(t===Q)return n;var e=p(n);if(!u(e,t))return function(n,t,r){var e,i=I(t,r);return i?"value"in i?i.value:null===(e=i.get)||void 0===e?void 0:e.call(n.k):void 0}(n,e,t);var i=e[t];return n.I||!r(i)?i:i===z(n.t,t)?(E(n),n.o[t]=R(n.A.h,i,n)):i},has:function(n,t){return t in p(n)},ownKeys:function(n){return Reflect.ownKeys(p(n))},set:function(n,t,r){var e=I(p(n),t);if(null==e?void 0:e.set)return e.set.call(n.k,r),!0;if(!n.P){var i=z(p(n),t),o=null==i?void 0:i[Q];if(o&&o.t===r)return n.o[t]=r,n.D[t]=!1,!0;if(c(r,i)&&(void 0!==r||u(n.t,t)))return!0;E(n),k(n)}return n.o[t]===r&&"number"!=typeof r&&(void 0!==r||t in n.o)||(n.o[t]=r,n.D[t]=!0,!0)},deleteProperty:function(n,t){return void 0!==z(n.t,t)||t in n.t?(n.D[t]=!1,E(n),k(n)):delete n.D[t],n.o&&delete n.o[t],!0},getOwnPropertyDescriptor:function(n,t){var r=p(n),e=Reflect.getOwnPropertyDescriptor(r,t);return e?{writable:!0,configurable:1!==n.i||"length"!==t,enumerable:e.enumerable,value:r[t]}:e},defineProperty:function(){n(11)},getPrototypeOf:function(n){return Object.getPrototypeOf(n.t)},setPrototypeOf:function(){n(12)}},on={};i(en,(function(n,t){on[n]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}})),on.deleteProperty=function(t,r){return false&&0,en.deleteProperty.call(this,t[0],r)},on.set=function(t,r,e){return false&&0,en.set.call(this,t[0],r,e,t[0])};var un=function(){function e(t){var e=this;this.g=B,this.F=!0,this.produce=function(t,i,o){if("function"==typeof t&&"function"!=typeof i){var u=i;i=t;var a=e;return function(n){var t=this;void 0===n&&(n=u);for(var r=arguments.length,e=Array(r>1?r-1:0),o=1;o<r;o++)e[o-1]=arguments[o];return a.produce(n,(function(n){var r;return(r=i).call.apply(r,[t,n].concat(e))}))}}var f;if("function"!=typeof i&&n(6),void 0!==o&&"function"!=typeof o&&n(7),r(t)){var c=w(e),s=R(e,t,void 0),v=!0;try{f=i(s),v=!1}finally{v?O(c):g(c)}return"undefined"!=typeof Promise&&f instanceof Promise?f.then((function(n){return j(c,o),P(n,c)}),(function(n){throw O(c),n})):(j(c,o),P(f,c))}if(!t||"object"!=typeof t){if((f=i(t))===H)return;return void 0===f&&(f=t),e.F&&d(f,!0),f}n(21,t)},this.produceWithPatches=function(n,t){return"function"==typeof n?function(t){for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return e.produceWithPatches(t,(function(t){return n.apply(void 0,[t].concat(i))}))}:[e.produce(n,t,(function(n,t){r=n,i=t})),r,i];var r,i},"boolean"==typeof(null==t?void 0:t.useProxies)&&this.setUseProxies(t.useProxies),"boolean"==typeof(null==t?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze)}var i=e.prototype;return i.createDraft=function(e){r(e)||n(8),immer_esm_t(e)&&(e=D(e));var i=w(this),o=R(this,e,void 0);return o[Q].C=!0,g(i),o},i.finishDraft=function(t,r){var e=t&&t[Q]; false&&(0);var i=e.A;return j(i,r),P(void 0,i)},i.setAutoFreeze=function(n){this.F=n},i.setUseProxies=function(t){t&&!B&&n(20),this.g=t},i.applyPatches=function(n,r){var e;for(e=r.length-1;e>=0;e--){var i=r[e];if(0===i.path.length&&"replace"===i.op){n=i.value;break}}var o=b("Patches").$;return immer_esm_t(n)?o(n,r):this.produce(n,(function(n){return o(n,r.slice(e+1))}))},e}(),an=new un,fn=an.produce,cn=an.produceWithPatches.bind(an),sn=an.setAutoFreeze.bind(an),vn=an.setUseProxies.bind(an),pn=an.applyPatches.bind(an),ln=an.createDraft.bind(an),dn=an.finishDraft.bind(an);/* harmony default export */ var immer_esm = (fn);
|
11859 |
//# sourceMappingURL=immer.esm.js.map
|
11860 |
|
11861 |
;// CONCATENATED MODULE: ./src/js/dashboard/store/actions/savingHelpers.js
|
12171 |
/** Prefix for logging strings */
|
12172 |
var PREFIX = 'Sentry Logger ';
|
12173 |
/** JSDoc */
|
12174 |
+
var logger_Logger = /** @class */ (function () {
|
12175 |
/** JSDoc */
|
12176 |
function Logger() {
|
12177 |
this._enabled = false;
|
12227 |
}());
|
12228 |
// Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
|
12229 |
logger_global.__SENTRY__ = logger_global.__SENTRY__ || {};
|
12230 |
+
var logger = logger_global.__SENTRY__.logger || (logger_global.__SENTRY__.logger = new logger_Logger());
|
12231 |
|
12232 |
//# sourceMappingURL=logger.js.map
|
12233 |
// EXTERNAL MODULE: ./node_modules/@sentry/utils/esm/node.js
|
14419 |
var isEqual = __webpack_require__(18446);
|
14420 |
var isEqual_default = /*#__PURE__*/__webpack_require__.n(isEqual);
|
14421 |
;// CONCATENATED MODULE: ./src/js/dashboard/store/actions/Queue.js
|
14422 |
+
function Queue_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
14423 |
|
14424 |
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
14425 |
|
14433 |
|
14434 |
var SavingQueue = /*#__PURE__*/function () {
|
14435 |
function SavingQueue() {
|
14436 |
+
Queue_classCallCheck(this, SavingQueue);
|
14437 |
}
|
14438 |
|
14439 |
_createClass(SavingQueue, null, [{
|
15307 |
var toConsumableArray = __webpack_require__(78927);
|
15308 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js
|
15309 |
var objectWithoutPropertiesLoose = __webpack_require__(19756);
|
|
|
|
|
15310 |
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js
|
15311 |
var inheritsLoose = __webpack_require__(41788);
|
15312 |
;// CONCATENATED MODULE: ./node_modules/react-transition-group/esm/TransitionGroupContext.js
|
16266 |
name: 'MuiButtonBase'
|
16267 |
})(ButtonBase));
|
16268 |
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/utils/capitalize.js
|
16269 |
+
var utils_capitalize = __webpack_require__(93871);
|
16270 |
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/Button/Button.js
|
16271 |
|
16272 |
|
16585 |
other = (0,objectWithoutProperties/* default */.Z)(props, ["children", "classes", "className", "color", "component", "disabled", "disableElevation", "disableFocusRipple", "endIcon", "focusVisibleClassName", "fullWidth", "size", "startIcon", "type", "variant"]);
|
16586 |
|
16587 |
var startIcon = startIconProp && /*#__PURE__*/react.createElement("span", {
|
16588 |
+
className: (0,clsx_m/* default */.Z)(classes.startIcon, classes["iconSize".concat((0,utils_capitalize/* default */.Z)(size))])
|
16589 |
}, startIconProp);
|
16590 |
var endIcon = endIconProp && /*#__PURE__*/react.createElement("span", {
|
16591 |
+
className: (0,clsx_m/* default */.Z)(classes.endIcon, classes["iconSize".concat((0,utils_capitalize/* default */.Z)(size))])
|
16592 |
}, endIconProp);
|
16593 |
return /*#__PURE__*/react.createElement(ButtonBase_ButtonBase, (0,esm_extends/* default */.Z)({
|
16594 |
+
className: (0,clsx_m/* default */.Z)(classes.root, classes[variant], className, color === 'inherit' ? classes.colorInherit : color !== 'default' && classes["".concat(variant).concat((0,utils_capitalize/* default */.Z)(color))], size !== 'medium' && [classes["".concat(variant, "Size").concat((0,utils_capitalize/* default */.Z)(size))], classes["size".concat((0,utils_capitalize/* default */.Z)(size))]], disableElevation && classes.disableElevation, disabled && classes.disabled, fullWidth && classes.fullWidth),
|
16595 |
component: component,
|
16596 |
disabled: disabled,
|
16597 |
focusRipple: !disableFocusRipple,
|
22616 |
var currentX = false;
|
22617 |
var currentY = false;
|
22618 |
return /*#__PURE__*/react.createElement(tippy_react_esm, {
|
22619 |
+
content: !props.shiftClick ? props.content : (0,clsx_m/* default */.Z)(props.content, props.shiftClick && " (".concat(translate("utils.shift_click"), ")")),
|
22620 |
hideOnClick: props.hideOnClick,
|
22621 |
theme: "material" // duration={[100, 100]}
|
22622 |
,
|
22860 |
variant = _props$variant === void 0 ? 'outlined' : _props$variant,
|
22861 |
other = (0,objectWithoutProperties/* default */.Z)(props, ["children", "classes", "className", "color", "component", "disabled", "disableElevation", "disableFocusRipple", "disableRipple", "fullWidth", "orientation", "size", "variant"]);
|
22862 |
|
22863 |
+
var buttonClassName = (0,clsx_m/* default */.Z)(classes.grouped, classes["grouped".concat((0,utils_capitalize/* default */.Z)(orientation))], classes["grouped".concat((0,utils_capitalize/* default */.Z)(variant))], classes["grouped".concat((0,utils_capitalize/* default */.Z)(variant)).concat((0,utils_capitalize/* default */.Z)(orientation))], classes["grouped".concat((0,utils_capitalize/* default */.Z)(variant)).concat(color !== 'default' ? (0,utils_capitalize/* default */.Z)(color) : '')], disabled && classes.disabled);
|
22864 |
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
22865 |
role: "group",
|
22866 |
className: (0,clsx_m/* default */.Z)(classes.root, className, fullWidth && classes.fullWidth, disableElevation && classes.disableElevation, variant === 'contained' && classes.contained, orientation === 'vertical' && classes.vertical),
|
23100 |
hasChanges: state.misc.hasChanges
|
23101 |
};
|
23102 |
})(PublishButton));
|
|
|
|
|
23103 |
// EXTERNAL MODULE: ./node_modules/@material-ui/styles/esm/useTheme/useTheme.js
|
23104 |
var useTheme = __webpack_require__(159);
|
23105 |
// EXTERNAL MODULE: ./node_modules/@material-ui/styles/esm/getThemeProps/getThemeProps.js
|
23182 |
var createChainedFunction = __webpack_require__(82568);
|
23183 |
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/styles/zIndex.js
|
23184 |
var zIndex = __webpack_require__(92781);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
23185 |
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/utils/getScrollbarSize.js
|
23186 |
// A change of the browser zoom change the scrollbar size.
|
23187 |
// Credit https://github.com/twbs/bootstrap/blob/3ffe3a5d82f6f561b82ff78d82b32a7d14aed558/js/src/modal.js#L512-L519
|
23340 |
|
23341 |
var ModalManager = /*#__PURE__*/function () {
|
23342 |
function ModalManager() {
|
23343 |
+
_classCallCheck(this, ModalManager);
|
23344 |
|
23345 |
// this.modals[modalIndex] = modal
|
23346 |
this.modals = []; // this.containers[containerIndex] = {
|
23916 |
});
|
23917 |
false ? 0 : void 0;
|
23918 |
/* harmony default export */ var Modal_Modal = (Modal);
|
23919 |
+
// EXTERNAL MODULE: ./node_modules/@babel/runtime/helpers/esm/slicedToArray.js + 1 modules
|
23920 |
+
var slicedToArray = __webpack_require__(28481);
|
23921 |
;// CONCATENATED MODULE: ./node_modules/react-transition-group/esm/config.js
|
23922 |
/* harmony default export */ var config = ({
|
23923 |
disabled: false
|
24331 |
Transition.contextType = TransitionGroupContext;
|
24332 |
Transition.propTypes = false ? 0 : {}; // Name the function so it is clearer in the documentation
|
24333 |
|
24334 |
+
function Transition_noop() {}
|
24335 |
|
24336 |
Transition.defaultProps = {
|
24337 |
in: false,
|
24340 |
appear: false,
|
24341 |
enter: true,
|
24342 |
exit: true,
|
24343 |
+
onEnter: Transition_noop,
|
24344 |
+
onEntering: Transition_noop,
|
24345 |
+
onEntered: Transition_noop,
|
24346 |
+
onExit: Transition_noop,
|
24347 |
+
onExiting: Transition_noop,
|
24348 |
+
onExited: Transition_noop
|
24349 |
};
|
24350 |
Transition.UNMOUNTED = UNMOUNTED;
|
24351 |
Transition.EXITED = EXITED;
|
24868 |
onExited: onExited,
|
24869 |
role: "none presentation"
|
24870 |
}, TransitionProps), /*#__PURE__*/react.createElement("div", {
|
24871 |
+
className: (0,clsx_m/* default */.Z)(classes.container, classes["scroll".concat((0,utils_capitalize/* default */.Z)(scroll))]),
|
24872 |
onMouseUp: handleBackdropClick,
|
24873 |
onMouseDown: handleMouseDown
|
24874 |
}, /*#__PURE__*/react.createElement(PaperComponent, (0,esm_extends/* default */.Z)({
|
24877 |
"aria-describedby": ariaDescribedby,
|
24878 |
"aria-labelledby": ariaLabelledby
|
24879 |
}, PaperProps, {
|
24880 |
+
className: (0,clsx_m/* default */.Z)(classes.paper, classes["paperScroll".concat((0,utils_capitalize/* default */.Z)(scroll))], classes["paperWidth".concat((0,utils_capitalize/* default */.Z)(String(maxWidth)))], PaperProps.className, fullScreen && classes.paperFullScreen, fullWidth && classes.paperFullWidth)
|
24881 |
}), children))));
|
24882 |
});
|
24883 |
false ? 0 : void 0;
|
25060 |
|
25061 |
var Component = component || (paragraph ? 'p' : variantMapping[variant] || defaultVariantMapping[variant]) || 'span';
|
25062 |
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
25063 |
+
className: (0,clsx_m/* default */.Z)(classes.root, className, variant !== 'inherit' && classes[variant], color !== 'initial' && classes["color".concat((0,utils_capitalize/* default */.Z)(color))], noWrap && classes.noWrap, gutterBottom && classes.gutterBottom, paragraph && classes.paragraph, align !== 'inherit' && classes["align".concat((0,utils_capitalize/* default */.Z)(align))], display !== 'initial' && classes["display".concat((0,utils_capitalize/* default */.Z)(display))]),
|
25064 |
ref: ref
|
25065 |
}, other));
|
25066 |
});
|
25221 |
|
25222 |
|
25223 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25224 |
function ConfirmDialog(_ref) {
|
25225 |
var onClose = _ref.onClose,
|
25226 |
_ref$icon = _ref.icon,
|
25240 |
className = _ref.className,
|
25241 |
_ref$testId = _ref.testId,
|
25242 |
testId = _ref$testId === void 0 ? null : _ref$testId;
|
25243 |
+
var defaultButtons = [{
|
25244 |
+
value: "cancel",
|
25245 |
+
text: translate("modal.cancel")
|
25246 |
+
}, {
|
25247 |
+
value: "confirm",
|
25248 |
+
text: translate("common.confirm")
|
25249 |
+
}];
|
25250 |
|
25251 |
var handleClose = function handleClose(status) {
|
25252 |
onClose(status);
|
25403 |
other = (0,objectWithoutProperties/* default */.Z)(props, ["edge", "children", "classes", "className", "color", "disabled", "disableFocusRipple", "size"]);
|
25404 |
|
25405 |
return /*#__PURE__*/react.createElement(ButtonBase_ButtonBase, (0,esm_extends/* default */.Z)({
|
25406 |
+
className: (0,clsx_m/* default */.Z)(classes.root, className, color !== 'default' && classes["color".concat((0,utils_capitalize/* default */.Z)(color))], disabled && classes.disabled, size === "small" && classes["size".concat((0,utils_capitalize/* default */.Z)(size))], {
|
25407 |
'start': classes.edgeStart,
|
25408 |
'end': classes.edgeEnd
|
25409 |
}[edge]),
|
29622 |
other = (0,objectWithoutProperties/* default */.Z)(props, ["classes", "className", "color", "component", "fontSize"]);
|
29623 |
|
29624 |
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
29625 |
+
className: (0,clsx_m/* default */.Z)('material-icons', classes.root, className, color !== 'inherit' && classes["color".concat((0,utils_capitalize/* default */.Z)(color))], fontSize !== 'default' && classes["fontSize".concat((0,utils_capitalize/* default */.Z)(fontSize))]),
|
29626 |
"aria-hidden": true,
|
29627 |
ref: ref
|
29628 |
}, other));
|
30186 |
return /*#__PURE__*/react.createElement(Typography_Typography, null, translate("modal.remove.".concat(model, ".cannot_delete")));
|
30187 |
}
|
30188 |
|
30189 |
+
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(Typography_Typography, null, translate("modal.remove.".concat(model, ".question"))), model === "group" && /*#__PURE__*/react.createElement(Typography_Typography, null, translate("modal.remove.group.question_multiple_buttons", {
|
30190 |
+
count: buttonCount
|
30191 |
+
})), /*#__PURE__*/react.createElement(Typography_Typography, {
|
30192 |
style: {
|
30193 |
marginTop: 15
|
30194 |
}
|
30904 |
}
|
30905 |
}, [muiFormControl, startAdornment]);
|
30906 |
return /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
30907 |
+
className: (0,clsx_m/* default */.Z)(classes.root, classes["color".concat((0,utils_capitalize/* default */.Z)(fcs.color || 'primary'))], className, fcs.disabled && classes.disabled, fcs.error && classes.error, fullWidth && classes.fullWidth, fcs.focused && classes.focused, muiFormControl && classes.formControl, multiline && classes.multiline, startAdornment && classes.adornedStart, endAdornment && classes.adornedEnd, fcs.margin === 'dense' && classes.marginDense),
|
30908 |
onClick: handleClick,
|
30909 |
ref: ref
|
30910 |
}, other), startAdornment, /*#__PURE__*/react.createElement(FormControl_FormControlContext.Provider, {
|
31391 |
var labelWidth = labelWidthProp > 0 ? labelWidthProp * 0.75 + 8 : 0.01;
|
31392 |
return /*#__PURE__*/react.createElement("fieldset", (0,esm_extends/* default */.Z)({
|
31393 |
"aria-hidden": true,
|
31394 |
+
style: (0,esm_extends/* default */.Z)((0,defineProperty/* default */.Z)({}, "padding".concat((0,utils_capitalize/* default */.Z)(align)), 8), style),
|
31395 |
className: (0,clsx_m/* default */.Z)(classes.root, className),
|
31396 |
ref: ref
|
31397 |
}, other), /*#__PURE__*/react.createElement("legend", {
|
31653 |
states: ['color', 'required', 'focused', 'disabled', 'error', 'filled']
|
31654 |
});
|
31655 |
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
31656 |
+
className: (0,clsx_m/* default */.Z)(classes.root, classes["color".concat((0,utils_capitalize/* default */.Z)(fcs.color || 'primary'))], className, fcs.disabled && classes.disabled, fcs.error && classes.error, fcs.filled && classes.filled, fcs.focused && classes.focused, fcs.required && classes.required),
|
31657 |
ref: ref
|
31658 |
}, other), children, fcs.required && /*#__PURE__*/react.createElement("span", {
|
31659 |
"aria-hidden": true,
|
31988 |
return /*#__PURE__*/react.createElement(FormControl_FormControlContext.Provider, {
|
31989 |
value: childContext
|
31990 |
}, /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
31991 |
+
className: (0,clsx_m/* default */.Z)(classes.root, className, margin !== 'none' && classes["margin".concat((0,utils_capitalize/* default */.Z)(margin))], fullWidth && classes.fullWidth),
|
31992 |
ref: ref
|
31993 |
}, other), children));
|
31994 |
});
|
32088 |
})(FormHelperText));
|
32089 |
// EXTERNAL MODULE: ./node_modules/@material-ui/styles/esm/mergeClasses/mergeClasses.js
|
32090 |
var mergeClasses = __webpack_require__(65835);
|
|
|
|
|
32091 |
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/Grow/Grow.js
|
32092 |
|
32093 |
|
33474 |
className: classes.nativeInput,
|
33475 |
autoFocus: autoFocus
|
33476 |
}, other)), /*#__PURE__*/react.createElement(IconComponent, {
|
33477 |
+
className: (0,clsx_m/* default */.Z)(classes.icon, classes["icon".concat((0,utils_capitalize/* default */.Z)(variant))], open && classes.iconOpen, disabled && classes.disabled)
|
33478 |
}), /*#__PURE__*/react.createElement(Menu_Menu, (0,esm_extends/* default */.Z)({
|
33479 |
id: "menu-".concat(name || ''),
|
33480 |
anchorEl: displayNode,
|
33495 |
});
|
33496 |
false ? 0 : void 0;
|
33497 |
/* harmony default export */ var Select_SelectInput = (SelectInput);
|
33498 |
+
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/utils/createSvgIcon.js
|
33499 |
+
var createSvgIcon = __webpack_require__(63786);
|
33500 |
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/svg-icons/ArrowDropDown.js
|
33501 |
|
33502 |
|
33535 |
disabled: disabled,
|
33536 |
ref: inputRef || ref
|
33537 |
}, other)), props.multiple ? null : /*#__PURE__*/react.createElement(IconComponent, {
|
33538 |
+
className: (0,clsx_m/* default */.Z)(classes.icon, classes["icon".concat((0,utils_capitalize/* default */.Z)(variant))], disabled && classes.disabled)
|
33539 |
}));
|
33540 |
});
|
33541 |
false ? 0 : void 0;
|
33992 |
/* harmony default export */ var TextField_TextField = ((0,withStyles/* default */.Z)(TextField_styles, {
|
33993 |
name: 'MuiTextField'
|
33994 |
})(TextField));
|
33995 |
+
// EXTERNAL MODULE: ./node_modules/void-elements/index.js
|
33996 |
+
var void_elements = __webpack_require__(71739);
|
33997 |
+
var void_elements_default = /*#__PURE__*/__webpack_require__.n(void_elements);
|
33998 |
+
;// CONCATENATED MODULE: ./node_modules/html-parse-stringify/dist/html-parse-stringify.module.js
|
33999 |
+
var html_parse_stringify_module_t=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function html_parse_stringify_module_n(n){var r={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},i=n.match(/<\/?([^\s]+?)[/\s>]/);if(i&&(r.name=i[1],((void_elements_default())[i[1]]||"/"===n.charAt(n.length-2))&&(r.voidElement=!0),r.name.startsWith("!--"))){var s=n.indexOf("--\x3e");return{type:"comment",comment:-1!==s?n.slice(4,s):""}}for(var a=new RegExp(html_parse_stringify_module_t),c=null;null!==(c=a.exec(n));)if(c[0].trim())if(c[1]){var o=c[1].trim(),l=[o,""];o.indexOf("=")>-1&&(l=o.split("=")),r.attrs[l[0]]=l[1],a.lastIndex--}else c[2]&&(r.attrs[c[2]]=c[3].trim().substring(1,c[3].length-1));return r}var html_parse_stringify_module_r=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,html_parse_stringify_module_i=/^\s*$/,html_parse_stringify_module_s=Object.create(null);function html_parse_stringify_module_a(e,t){switch(t.type){case"text":return e+t.content;case"tag":return e+="<"+t.name+(t.attrs?function(e){var t=[];for(var n in e)t.push(n+'="'+e[n]+'"');return t.length?" "+t.join(" "):""}(t.attrs):"")+(t.voidElement?"/>":">"),t.voidElement?e:e+t.children.reduce(html_parse_stringify_module_a,"")+"</"+t.name+">";case"comment":return e+"\x3c!--"+t.comment+"--\x3e"}}var html_parse_stringify_module_c={parse:function(e,t){t||(t={}),t.components||(t.components=html_parse_stringify_module_s);var a,c=[],o=[],l=-1,m=!1;if(0!==e.indexOf("<")){var u=e.indexOf("<");c.push({type:"text",content:-1===u?e:e.substring(0,u)})}return e.replace(html_parse_stringify_module_r,function(r,s){if(m){if(r!=="</"+a.name+">")return;m=!1}var u,f="/"!==r.charAt(1),h=r.startsWith("\x3c!--"),p=s+r.length,d=e.charAt(p);if(h){var v=html_parse_stringify_module_n(r);return l<0?(c.push(v),c):((u=o[l]).children.push(v),c)}if(f&&(l++,"tag"===(a=html_parse_stringify_module_n(r)).type&&t.components[a.name]&&(a.type="component",m=!0),a.voidElement||m||!d||"<"===d||a.children.push({type:"text",content:e.slice(p,e.indexOf("<",p))}),0===l&&c.push(a),(u=o[l-1])&&u.children.push(a),o[l]=a),(!f||a.voidElement)&&(l>-1&&(a.voidElement||a.name===r.slice(2,-1))&&(l--,a=-1===l?c:o[l]),!m&&"<"!==d&&d)){u=-1===l?c:o[l].children;var x=e.indexOf("<",p),g=e.slice(p,-1===x?void 0:x);html_parse_stringify_module_i.test(g)&&(g=" "),(x>-1&&l+u.length>=0||" "!==g)&&u.push({type:"text",content:g})}}),c},stringify:function(e){return e.reduce(function(e,t){return e+html_parse_stringify_module_a("",t)},"")}};/* harmony default export */ var html_parse_stringify_module = (html_parse_stringify_module_c);
|
34000 |
+
//# sourceMappingURL=html-parse-stringify.module.js.map
|
34001 |
+
|
34002 |
+
;// CONCATENATED MODULE: ./node_modules/html-escaper/esm/index.js
|
34003 |
+
/**
|
34004 |
+
* Copyright (C) 2017-present by Andrea Giammarchi - @WebReflection
|
34005 |
+
*
|
34006 |
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
34007 |
+
* of this software and associated documentation files (the "Software"), to deal
|
34008 |
+
* in the Software without restriction, including without limitation the rights
|
34009 |
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
34010 |
+
* copies of the Software, and to permit persons to whom the Software is
|
34011 |
+
* furnished to do so, subject to the following conditions:
|
34012 |
+
*
|
34013 |
+
* The above copyright notice and this permission notice shall be included in
|
34014 |
+
* all copies or substantial portions of the Software.
|
34015 |
+
*
|
34016 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
34017 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
34018 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
34019 |
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
34020 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
34021 |
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
34022 |
+
* THE SOFTWARE.
|
34023 |
+
*/
|
34024 |
+
|
34025 |
+
var replace = ''.replace;
|
34026 |
+
|
34027 |
+
var ca = /[&<>'"]/g;
|
34028 |
+
var esm_es = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34);/g;
|
34029 |
+
|
34030 |
+
var esca = {
|
34031 |
+
'&': '&',
|
34032 |
+
'<': '<',
|
34033 |
+
'>': '>',
|
34034 |
+
"'": ''',
|
34035 |
+
'"': '"'
|
34036 |
+
};
|
34037 |
+
var unes = {
|
34038 |
+
'&': '&',
|
34039 |
+
'&': '&',
|
34040 |
+
'<': '<',
|
34041 |
+
'<': '<',
|
34042 |
+
'>': '>',
|
34043 |
+
'>': '>',
|
34044 |
+
''': "'",
|
34045 |
+
''': "'",
|
34046 |
+
'"': '"',
|
34047 |
+
'"': '"'
|
34048 |
+
};
|
34049 |
+
|
34050 |
+
function esm_escape(es) {
|
34051 |
+
return replace.call(es, ca, pe);
|
34052 |
+
};
|
34053 |
+
|
34054 |
+
function esm_unescape(un) {
|
34055 |
+
return replace.call(un, esm_es, cape);
|
34056 |
+
};
|
34057 |
+
|
34058 |
+
function pe(m) {
|
34059 |
+
return esca[m];
|
34060 |
+
}
|
34061 |
+
|
34062 |
+
function cape(m) {
|
34063 |
+
return unes[m];
|
34064 |
+
}
|
34065 |
+
|
34066 |
+
;// CONCATENATED MODULE: ./node_modules/react-i18next/dist/es/context.js
|
34067 |
+
|
34068 |
+
|
34069 |
+
|
34070 |
+
|
34071 |
+
function context_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
34072 |
+
|
34073 |
+
function context_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { context_ownKeys(Object(source), true).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { context_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
34074 |
+
|
34075 |
+
|
34076 |
+
var defaultOptions = {
|
34077 |
+
bindI18n: 'languageChanged',
|
34078 |
+
bindI18nStore: '',
|
34079 |
+
transEmptyNodeValue: '',
|
34080 |
+
transSupportBasicHtmlNodes: true,
|
34081 |
+
transWrapTextNodes: '',
|
34082 |
+
transKeepBasicHtmlNodesFor: ['br', 'strong', 'i', 'p'],
|
34083 |
+
useSuspense: true
|
34084 |
+
};
|
34085 |
+
var i18nInstance;
|
34086 |
+
var I18nContext = react.createContext();
|
34087 |
+
function setDefaults() {
|
34088 |
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
34089 |
+
defaultOptions = context_objectSpread(context_objectSpread({}, defaultOptions), options);
|
34090 |
+
}
|
34091 |
+
function getDefaults() {
|
34092 |
+
return defaultOptions;
|
34093 |
+
}
|
34094 |
+
var ReportNamespaces = function () {
|
34095 |
+
function ReportNamespaces() {
|
34096 |
+
_classCallCheck(this, ReportNamespaces);
|
34097 |
+
|
34098 |
+
this.usedNamespaces = {};
|
34099 |
+
}
|
34100 |
+
|
34101 |
+
(0,createClass/* default */.Z)(ReportNamespaces, [{
|
34102 |
+
key: "addUsedNamespaces",
|
34103 |
+
value: function addUsedNamespaces(namespaces) {
|
34104 |
+
var _this = this;
|
34105 |
+
|
34106 |
+
namespaces.forEach(function (ns) {
|
34107 |
+
if (!_this.usedNamespaces[ns]) _this.usedNamespaces[ns] = true;
|
34108 |
+
});
|
34109 |
+
}
|
34110 |
+
}, {
|
34111 |
+
key: "getUsedNamespaces",
|
34112 |
+
value: function getUsedNamespaces() {
|
34113 |
+
return Object.keys(this.usedNamespaces);
|
34114 |
+
}
|
34115 |
+
}]);
|
34116 |
+
|
34117 |
+
return ReportNamespaces;
|
34118 |
+
}();
|
34119 |
+
function setI18n(instance) {
|
34120 |
+
i18nInstance = instance;
|
34121 |
+
}
|
34122 |
+
function getI18n() {
|
34123 |
+
return i18nInstance;
|
34124 |
+
}
|
34125 |
+
var initReactI18next = {
|
34126 |
+
type: '3rdParty',
|
34127 |
+
init: function init(instance) {
|
34128 |
+
setDefaults(instance.options.react);
|
34129 |
+
setI18n(instance);
|
34130 |
+
}
|
34131 |
+
};
|
34132 |
+
function composeInitialProps(ForComponent) {
|
34133 |
+
return function (ctx) {
|
34134 |
+
return new Promise(function (resolve) {
|
34135 |
+
var i18nInitialProps = getInitialProps();
|
34136 |
+
|
34137 |
+
if (ForComponent.getInitialProps) {
|
34138 |
+
ForComponent.getInitialProps(ctx).then(function (componentsInitialProps) {
|
34139 |
+
resolve(context_objectSpread(context_objectSpread({}, componentsInitialProps), i18nInitialProps));
|
34140 |
+
});
|
34141 |
+
} else {
|
34142 |
+
resolve(i18nInitialProps);
|
34143 |
+
}
|
34144 |
+
});
|
34145 |
+
};
|
34146 |
+
}
|
34147 |
+
function getInitialProps() {
|
34148 |
+
var i18n = getI18n();
|
34149 |
+
var namespaces = i18n.reportNamespaces ? i18n.reportNamespaces.getUsedNamespaces() : [];
|
34150 |
+
var ret = {};
|
34151 |
+
var initialI18nStore = {};
|
34152 |
+
i18n.languages.forEach(function (l) {
|
34153 |
+
initialI18nStore[l] = {};
|
34154 |
+
namespaces.forEach(function (ns) {
|
34155 |
+
initialI18nStore[l][ns] = i18n.getResourceBundle(l, ns) || {};
|
34156 |
+
});
|
34157 |
+
});
|
34158 |
+
ret.initialI18nStore = initialI18nStore;
|
34159 |
+
ret.initialLanguage = i18n.language;
|
34160 |
+
return ret;
|
34161 |
+
}
|
34162 |
+
;// CONCATENATED MODULE: ./node_modules/react-i18next/dist/es/utils.js
|
34163 |
+
function warn() {
|
34164 |
+
if (console && console.warn) {
|
34165 |
+
var _console;
|
34166 |
+
|
34167 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
34168 |
+
args[_key] = arguments[_key];
|
34169 |
+
}
|
34170 |
+
|
34171 |
+
if (typeof args[0] === 'string') args[0] = "react-i18next:: ".concat(args[0]);
|
34172 |
+
|
34173 |
+
(_console = console).warn.apply(_console, args);
|
34174 |
+
}
|
34175 |
+
}
|
34176 |
+
var alreadyWarned = {};
|
34177 |
+
function warnOnce() {
|
34178 |
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
34179 |
+
args[_key2] = arguments[_key2];
|
34180 |
+
}
|
34181 |
+
|
34182 |
+
if (typeof args[0] === 'string' && alreadyWarned[args[0]]) return;
|
34183 |
+
if (typeof args[0] === 'string') alreadyWarned[args[0]] = new Date();
|
34184 |
+
warn.apply(void 0, args);
|
34185 |
+
}
|
34186 |
+
function utils_loadNamespaces(i18n, ns, cb) {
|
34187 |
+
i18n.loadNamespaces(ns, function () {
|
34188 |
+
if (i18n.isInitialized) {
|
34189 |
+
cb();
|
34190 |
+
} else {
|
34191 |
+
var initialized = function initialized() {
|
34192 |
+
setTimeout(function () {
|
34193 |
+
i18n.off('initialized', initialized);
|
34194 |
+
}, 0);
|
34195 |
+
cb();
|
34196 |
+
};
|
34197 |
+
|
34198 |
+
i18n.on('initialized', initialized);
|
34199 |
+
}
|
34200 |
+
});
|
34201 |
+
}
|
34202 |
+
function utils_hasLoadedNamespace(ns, i18n) {
|
34203 |
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
34204 |
+
|
34205 |
+
if (!i18n.languages || !i18n.languages.length) {
|
34206 |
+
warnOnce('i18n.languages were undefined or empty', i18n.languages);
|
34207 |
+
return true;
|
34208 |
+
}
|
34209 |
+
|
34210 |
+
var lng = i18n.languages[0];
|
34211 |
+
var fallbackLng = i18n.options ? i18n.options.fallbackLng : false;
|
34212 |
+
var lastLng = i18n.languages[i18n.languages.length - 1];
|
34213 |
+
if (lng.toLowerCase() === 'cimode') return true;
|
34214 |
+
|
34215 |
+
var loadNotPending = function loadNotPending(l, n) {
|
34216 |
+
var loadState = i18n.services.backendConnector.state["".concat(l, "|").concat(n)];
|
34217 |
+
return loadState === -1 || loadState === 2;
|
34218 |
+
};
|
34219 |
+
|
34220 |
+
if (options.bindI18n && options.bindI18n.indexOf('languageChanging') > -1 && i18n.services.backendConnector.backend && i18n.isLanguageChangingTo && !loadNotPending(i18n.isLanguageChangingTo, ns)) return false;
|
34221 |
+
if (i18n.hasResourceBundle(lng, ns)) return true;
|
34222 |
+
if (!i18n.services.backendConnector.backend) return true;
|
34223 |
+
if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;
|
34224 |
+
return false;
|
34225 |
+
}
|
34226 |
+
function getDisplayName(Component) {
|
34227 |
+
return Component.displayName || Component.name || (typeof Component === 'string' && Component.length > 0 ? Component : 'Unknown');
|
34228 |
+
}
|
34229 |
+
;// CONCATENATED MODULE: ./node_modules/react-i18next/dist/es/Trans.js
|
34230 |
+
|
34231 |
+
|
34232 |
+
|
34233 |
+
var _excluded = ["format"],
|
34234 |
+
_excluded2 = ["children", "count", "parent", "i18nKey", "tOptions", "values", "defaults", "components", "ns", "i18n", "t", "shouldUnescape"];
|
34235 |
+
|
34236 |
+
function Trans_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
34237 |
+
|
34238 |
+
function Trans_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { Trans_ownKeys(Object(source), true).forEach(function (key) { (0,defineProperty/* default */.Z)(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { Trans_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
34239 |
+
|
34240 |
+
|
34241 |
+
|
34242 |
+
|
34243 |
+
|
34244 |
+
|
34245 |
+
|
34246 |
+
function hasChildren(node, checkLength) {
|
34247 |
+
if (!node) return false;
|
34248 |
+
var base = node.props ? node.props.children : node.children;
|
34249 |
+
if (checkLength) return base.length > 0;
|
34250 |
+
return !!base;
|
34251 |
+
}
|
34252 |
+
|
34253 |
+
function Trans_getChildren(node) {
|
34254 |
+
if (!node) return [];
|
34255 |
+
return node && node.children ? node.children : node.props && node.props.children;
|
34256 |
+
}
|
34257 |
+
|
34258 |
+
function hasValidReactChildren(children) {
|
34259 |
+
if (Object.prototype.toString.call(children) !== '[object Array]') return false;
|
34260 |
+
return children.every(function (child) {
|
34261 |
+
return react.isValidElement(child);
|
34262 |
+
});
|
34263 |
+
}
|
34264 |
+
|
34265 |
+
function getAsArray(data) {
|
34266 |
+
return Array.isArray(data) ? data : [data];
|
34267 |
+
}
|
34268 |
+
|
34269 |
+
function Trans_mergeProps(source, target) {
|
34270 |
+
var newTarget = Trans_objectSpread({}, target);
|
34271 |
+
|
34272 |
+
newTarget.props = Object.assign(source.props, target.props);
|
34273 |
+
return newTarget;
|
34274 |
+
}
|
34275 |
+
|
34276 |
+
function nodesToString(children, i18nOptions) {
|
34277 |
+
if (!children) return '';
|
34278 |
+
var stringNode = '';
|
34279 |
+
var childrenArray = getAsArray(children);
|
34280 |
+
var keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];
|
34281 |
+
childrenArray.forEach(function (child, childIndex) {
|
34282 |
+
if (typeof child === 'string') {
|
34283 |
+
stringNode += "".concat(child);
|
34284 |
+
} else if (react.isValidElement(child)) {
|
34285 |
+
var childPropsCount = Object.keys(child.props).length;
|
34286 |
+
var shouldKeepChild = keepArray.indexOf(child.type) > -1;
|
34287 |
+
var childChildren = child.props.children;
|
34288 |
+
|
34289 |
+
if (!childChildren && shouldKeepChild && childPropsCount === 0) {
|
34290 |
+
stringNode += "<".concat(child.type, "/>");
|
34291 |
+
} else if (!childChildren && (!shouldKeepChild || childPropsCount !== 0)) {
|
34292 |
+
stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
|
34293 |
+
} else if (child.props.i18nIsDynamicList) {
|
34294 |
+
stringNode += "<".concat(childIndex, "></").concat(childIndex, ">");
|
34295 |
+
} else if (shouldKeepChild && childPropsCount === 1 && typeof childChildren === 'string') {
|
34296 |
+
stringNode += "<".concat(child.type, ">").concat(childChildren, "</").concat(child.type, ">");
|
34297 |
+
} else {
|
34298 |
+
var content = nodesToString(childChildren, i18nOptions);
|
34299 |
+
stringNode += "<".concat(childIndex, ">").concat(content, "</").concat(childIndex, ">");
|
34300 |
+
}
|
34301 |
+
} else if (child === null) {
|
34302 |
+
warn("Trans: the passed in value is invalid - seems you passed in a null child.");
|
34303 |
+
} else if ((0,esm_typeof/* default */.Z)(child) === 'object') {
|
34304 |
+
var format = child.format,
|
34305 |
+
clone = (0,objectWithoutProperties/* default */.Z)(child, _excluded);
|
34306 |
+
|
34307 |
+
var keys = Object.keys(clone);
|
34308 |
+
|
34309 |
+
if (keys.length === 1) {
|
34310 |
+
var value = format ? "".concat(keys[0], ", ").concat(format) : keys[0];
|
34311 |
+
stringNode += "{{".concat(value, "}}");
|
34312 |
+
} else {
|
34313 |
+
warn("react-i18next: the passed in object contained more than one variable - the object should look like {{ value, format }} where format is optional.", child);
|
34314 |
+
}
|
34315 |
+
} else {
|
34316 |
+
warn("Trans: the passed in value is invalid - seems you passed in a variable like {number} - please pass in variables for interpolation as full objects like {{number}}.", child);
|
34317 |
+
}
|
34318 |
+
});
|
34319 |
+
return stringNode;
|
34320 |
+
}
|
34321 |
+
|
34322 |
+
function renderNodes(children, targetString, i18n, i18nOptions, combinedTOpts, shouldUnescape) {
|
34323 |
+
if (targetString === '') return [];
|
34324 |
+
var keepArray = i18nOptions.transKeepBasicHtmlNodesFor || [];
|
34325 |
+
var emptyChildrenButNeedsHandling = targetString && new RegExp(keepArray.join('|')).test(targetString);
|
34326 |
+
if (!children && !emptyChildrenButNeedsHandling) return [targetString];
|
34327 |
+
var data = {};
|
34328 |
+
|
34329 |
+
function getData(childs) {
|
34330 |
+
var childrenArray = getAsArray(childs);
|
34331 |
+
childrenArray.forEach(function (child) {
|
34332 |
+
if (typeof child === 'string') return;
|
34333 |
+
if (hasChildren(child)) getData(Trans_getChildren(child));else if ((0,esm_typeof/* default */.Z)(child) === 'object' && !react.isValidElement(child)) Object.assign(data, child);
|
34334 |
+
});
|
34335 |
+
}
|
34336 |
+
|
34337 |
+
getData(children);
|
34338 |
+
var ast = html_parse_stringify_module.parse("<0>".concat(targetString, "</0>"));
|
34339 |
+
|
34340 |
+
var opts = Trans_objectSpread(Trans_objectSpread({}, data), combinedTOpts);
|
34341 |
+
|
34342 |
+
function renderInner(child, node, rootReactNode) {
|
34343 |
+
var childs = Trans_getChildren(child);
|
34344 |
+
var mappedChildren = mapAST(childs, node.children, rootReactNode);
|
34345 |
+
return hasValidReactChildren(childs) && mappedChildren.length === 0 ? childs : mappedChildren;
|
34346 |
+
}
|
34347 |
+
|
34348 |
+
function pushTranslatedJSX(child, inner, mem, i, isVoid) {
|
34349 |
+
if (child.dummy) child.children = inner;
|
34350 |
+
mem.push(react.cloneElement(child, Trans_objectSpread(Trans_objectSpread({}, child.props), {}, {
|
34351 |
+
key: i
|
34352 |
+
}), isVoid ? undefined : inner));
|
34353 |
+
}
|
34354 |
+
|
34355 |
+
function mapAST(reactNode, astNode, rootReactNode) {
|
34356 |
+
var reactNodes = getAsArray(reactNode);
|
34357 |
+
var astNodes = getAsArray(astNode);
|
34358 |
+
return astNodes.reduce(function (mem, node, i) {
|
34359 |
+
var translationContent = node.children && node.children[0] && node.children[0].content && i18n.services.interpolator.interpolate(node.children[0].content, opts, i18n.language);
|
34360 |
+
|
34361 |
+
if (node.type === 'tag') {
|
34362 |
+
var tmp = reactNodes[parseInt(node.name, 10)];
|
34363 |
+
if (!tmp && rootReactNode.length === 1 && rootReactNode[0][node.name]) tmp = rootReactNode[0][node.name];
|
34364 |
+
if (!tmp) tmp = {};
|
34365 |
+
var child = Object.keys(node.attrs).length !== 0 ? Trans_mergeProps({
|
34366 |
+
props: node.attrs
|
34367 |
+
}, tmp) : tmp;
|
34368 |
+
var isElement = react.isValidElement(child);
|
34369 |
+
var isValidTranslationWithChildren = isElement && hasChildren(node, true) && !node.voidElement;
|
34370 |
+
var isEmptyTransWithHTML = emptyChildrenButNeedsHandling && (0,esm_typeof/* default */.Z)(child) === 'object' && child.dummy && !isElement;
|
34371 |
+
var isKnownComponent = (0,esm_typeof/* default */.Z)(children) === 'object' && children !== null && Object.hasOwnProperty.call(children, node.name);
|
34372 |
+
|
34373 |
+
if (typeof child === 'string') {
|
34374 |
+
var value = i18n.services.interpolator.interpolate(child, opts, i18n.language);
|
34375 |
+
mem.push(value);
|
34376 |
+
} else if (hasChildren(child) || isValidTranslationWithChildren) {
|
34377 |
+
var inner = renderInner(child, node, rootReactNode);
|
34378 |
+
pushTranslatedJSX(child, inner, mem, i);
|
34379 |
+
} else if (isEmptyTransWithHTML) {
|
34380 |
+
var _inner = mapAST(reactNodes, node.children, rootReactNode);
|
34381 |
+
|
34382 |
+
mem.push(react.cloneElement(child, Trans_objectSpread(Trans_objectSpread({}, child.props), {}, {
|
34383 |
+
key: i
|
34384 |
+
}), _inner));
|
34385 |
+
} else if (Number.isNaN(parseFloat(node.name))) {
|
34386 |
+
if (isKnownComponent) {
|
34387 |
+
var _inner2 = renderInner(child, node, rootReactNode);
|
34388 |
+
|
34389 |
+
pushTranslatedJSX(child, _inner2, mem, i, node.voidElement);
|
34390 |
+
} else if (i18nOptions.transSupportBasicHtmlNodes && keepArray.indexOf(node.name) > -1) {
|
34391 |
+
if (node.voidElement) {
|
34392 |
+
mem.push(react.createElement(node.name, {
|
34393 |
+
key: "".concat(node.name, "-").concat(i)
|
34394 |
+
}));
|
34395 |
+
} else {
|
34396 |
+
var _inner3 = mapAST(reactNodes, node.children, rootReactNode);
|
34397 |
+
|
34398 |
+
mem.push(react.createElement(node.name, {
|
34399 |
+
key: "".concat(node.name, "-").concat(i)
|
34400 |
+
}, _inner3));
|
34401 |
+
}
|
34402 |
+
} else if (node.voidElement) {
|
34403 |
+
mem.push("<".concat(node.name, " />"));
|
34404 |
+
} else {
|
34405 |
+
var _inner4 = mapAST(reactNodes, node.children, rootReactNode);
|
34406 |
+
|
34407 |
+
mem.push("<".concat(node.name, ">").concat(_inner4, "</").concat(node.name, ">"));
|
34408 |
+
}
|
34409 |
+
} else if ((0,esm_typeof/* default */.Z)(child) === 'object' && !isElement) {
|
34410 |
+
var content = node.children[0] ? translationContent : null;
|
34411 |
+
if (content) mem.push(content);
|
34412 |
+
} else if (node.children.length === 1 && translationContent) {
|
34413 |
+
mem.push(react.cloneElement(child, Trans_objectSpread(Trans_objectSpread({}, child.props), {}, {
|
34414 |
+
key: i
|
34415 |
+
}), translationContent));
|
34416 |
+
} else {
|
34417 |
+
mem.push(react.cloneElement(child, Trans_objectSpread(Trans_objectSpread({}, child.props), {}, {
|
34418 |
+
key: i
|
34419 |
+
})));
|
34420 |
+
}
|
34421 |
+
} else if (node.type === 'text') {
|
34422 |
+
var wrapTextNodes = i18nOptions.transWrapTextNodes;
|
34423 |
+
|
34424 |
+
var _content = shouldUnescape ? esm_unescape(i18n.services.interpolator.interpolate(node.content, opts, i18n.language)) : i18n.services.interpolator.interpolate(node.content, opts, i18n.language);
|
34425 |
+
|
34426 |
+
if (wrapTextNodes) {
|
34427 |
+
mem.push(react.createElement(wrapTextNodes, {
|
34428 |
+
key: "".concat(node.name, "-").concat(i)
|
34429 |
+
}, _content));
|
34430 |
+
} else {
|
34431 |
+
mem.push(_content);
|
34432 |
+
}
|
34433 |
+
}
|
34434 |
+
|
34435 |
+
return mem;
|
34436 |
+
}, []);
|
34437 |
+
}
|
34438 |
+
|
34439 |
+
var result = mapAST([{
|
34440 |
+
dummy: true,
|
34441 |
+
children: children || []
|
34442 |
+
}], ast, getAsArray(children || []));
|
34443 |
+
return Trans_getChildren(result[0]);
|
34444 |
+
}
|
34445 |
+
|
34446 |
+
function Trans(_ref) {
|
34447 |
+
var children = _ref.children,
|
34448 |
+
count = _ref.count,
|
34449 |
+
parent = _ref.parent,
|
34450 |
+
i18nKey = _ref.i18nKey,
|
34451 |
+
_ref$tOptions = _ref.tOptions,
|
34452 |
+
tOptions = _ref$tOptions === void 0 ? {} : _ref$tOptions,
|
34453 |
+
values = _ref.values,
|
34454 |
+
defaults = _ref.defaults,
|
34455 |
+
components = _ref.components,
|
34456 |
+
ns = _ref.ns,
|
34457 |
+
i18nFromProps = _ref.i18n,
|
34458 |
+
tFromProps = _ref.t,
|
34459 |
+
shouldUnescape = _ref.shouldUnescape,
|
34460 |
+
additionalProps = (0,objectWithoutProperties/* default */.Z)(_ref, _excluded2);
|
34461 |
+
|
34462 |
+
var _ref2 = (0,react.useContext)(I18nContext) || {},
|
34463 |
+
i18nFromContext = _ref2.i18n,
|
34464 |
+
defaultNSFromContext = _ref2.defaultNS;
|
34465 |
+
|
34466 |
+
var i18n = i18nFromProps || i18nFromContext || getI18n();
|
34467 |
+
|
34468 |
+
if (!i18n) {
|
34469 |
+
warnOnce('You will need to pass in an i18next instance by using i18nextReactModule');
|
34470 |
+
return children;
|
34471 |
+
}
|
34472 |
+
|
34473 |
+
var t = tFromProps || i18n.t.bind(i18n) || function (k) {
|
34474 |
+
return k;
|
34475 |
+
};
|
34476 |
+
|
34477 |
+
var reactI18nextOptions = Trans_objectSpread(Trans_objectSpread({}, getDefaults()), i18n.options && i18n.options.react);
|
34478 |
+
|
34479 |
+
var namespaces = ns || t.ns || defaultNSFromContext || i18n.options && i18n.options.defaultNS;
|
34480 |
+
namespaces = typeof namespaces === 'string' ? [namespaces] : namespaces || ['translation'];
|
34481 |
+
var defaultValue = defaults || nodesToString(children, reactI18nextOptions) || reactI18nextOptions.transEmptyNodeValue || i18nKey;
|
34482 |
+
var hashTransKey = reactI18nextOptions.hashTransKey;
|
34483 |
+
var key = i18nKey || (hashTransKey ? hashTransKey(defaultValue) : defaultValue);
|
34484 |
+
var interpolationOverride = values ? tOptions.interpolation : {
|
34485 |
+
interpolation: Trans_objectSpread(Trans_objectSpread({}, tOptions.interpolation), {}, {
|
34486 |
+
prefix: '#$?',
|
34487 |
+
suffix: '?$#'
|
34488 |
+
})
|
34489 |
+
};
|
34490 |
+
|
34491 |
+
var combinedTOpts = Trans_objectSpread(Trans_objectSpread(Trans_objectSpread(Trans_objectSpread({}, tOptions), {}, {
|
34492 |
+
count: count
|
34493 |
+
}, values), interpolationOverride), {}, {
|
34494 |
+
defaultValue: defaultValue,
|
34495 |
+
ns: namespaces
|
34496 |
+
});
|
34497 |
+
|
34498 |
+
var translation = key ? t(key, combinedTOpts) : defaultValue;
|
34499 |
+
var content = renderNodes(components || children, translation, i18n, reactI18nextOptions, combinedTOpts, shouldUnescape);
|
34500 |
+
var useAsParent = parent !== undefined ? parent : reactI18nextOptions.defaultTransParent;
|
34501 |
+
return useAsParent ? react.createElement(useAsParent, additionalProps, content) : content;
|
34502 |
+
}
|
34503 |
;// CONCATENATED MODULE: ./src/js/dashboard/Components/KnowledgeBaseLink/KnowledgeBaseLink.js
|
34504 |
|
34505 |
|
34523 |
return /*#__PURE__*/react.createElement("a", {
|
34524 |
href: "https://community.buttonizer.pro/knowledgebase/".concat(articleId),
|
34525 |
target: "_blank",
|
34526 |
+
className: (0,clsx_m/* default */.Z)("knowledgebase-link", size)
|
34527 |
+
}, /*#__PURE__*/react.createElement(Trans, {
|
34528 |
+
i18nKey: "utils.knowledge_link",
|
34529 |
+
values: {
|
34530 |
+
setting: setting
|
34531 |
+
},
|
34532 |
+
components: {
|
34533 |
+
bold: /*#__PURE__*/react.createElement("strong", null)
|
34534 |
}
|
34535 |
+
}));
|
34536 |
}
|
34537 |
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Dialogs/FormDialog.js
|
34538 |
function FormDialog_extends() { FormDialog_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return FormDialog_extends.apply(this, arguments); }
|
34563 |
|
34564 |
|
34565 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
34566 |
function FormDialog(_ref) {
|
34567 |
var open = _ref.open,
|
34568 |
buttons = _ref.buttons,
|
34584 |
kbLink = _ref$kbLink === void 0 ? null : _ref$kbLink,
|
34585 |
props = FormDialog_objectWithoutProperties(_ref, ["open", "buttons", "onClose", "text", "title", "defaultValue", "canBeEmpty", "maxWidth", "fullWidth", "cancelIfSameAsFirstValue", "clearOnConfirm", "kbLink"]);
|
34586 |
|
34587 |
+
var defaultButtons = [{
|
34588 |
+
value: "cancel",
|
34589 |
+
text: translate("modal.cancel")
|
34590 |
+
}, {
|
34591 |
+
value: "confirm",
|
34592 |
+
text: translate("common.confirm"),
|
34593 |
+
focus: true
|
34594 |
+
}];
|
34595 |
+
|
34596 |
var _React$useState = react.useState(defaultValue === "" ? "" : defaultValue || " "),
|
34597 |
_React$useState2 = FormDialog_slicedToArray(_React$useState, 2),
|
34598 |
value = _React$useState2[0],
|
34599 |
setValue = _React$useState2[1];
|
34600 |
|
34601 |
+
if (!buttons) buttons = defaultButtons;
|
34602 |
|
34603 |
var beforeClose = function beforeClose(action) {
|
34604 |
if (action !== "cancel" && !canBeEmpty && value == "") {
|
34939 |
downloadAnchorNode.click();
|
34940 |
downloadAnchorNode.remove();
|
34941 |
}
|
34942 |
+
// EXTERNAL MODULE: ./node_modules/dlv/dist/dlv.umd.js
|
34943 |
+
var dlv_umd = __webpack_require__(26905);
|
34944 |
+
var dlv_umd_default = /*#__PURE__*/__webpack_require__.n(dlv_umd);
|
34945 |
;// CONCATENATED MODULE: ./src/js/dashboard/store/actions/exportHelpers.js
|
34946 |
|
34947 |
|
41507 |
}
|
41508 |
|
41509 |
event.preventDefault();
|
41510 |
+
var actions = phase.actions.fluidLift(point);
|
41511 |
+
setPhase({
|
41512 |
+
type: 'DRAGGING',
|
41513 |
+
actions: actions
|
41514 |
+
});
|
41515 |
+
}
|
41516 |
+
}, {
|
41517 |
+
eventName: 'mouseup',
|
41518 |
+
fn: function fn(event) {
|
41519 |
+
var phase = getPhase();
|
41520 |
+
|
41521 |
+
if (phase.type !== 'DRAGGING') {
|
41522 |
+
cancel();
|
41523 |
+
return;
|
41524 |
+
}
|
41525 |
+
|
41526 |
+
event.preventDefault();
|
41527 |
+
phase.actions.drop({
|
41528 |
+
shouldBlockNextClick: true
|
41529 |
+
});
|
41530 |
+
completed();
|
41531 |
+
}
|
41532 |
+
}, {
|
41533 |
+
eventName: 'mousedown',
|
41534 |
+
fn: function fn(event) {
|
41535 |
+
if (getPhase().type === 'DRAGGING') {
|
41536 |
+
event.preventDefault();
|
41537 |
+
}
|
41538 |
+
|
41539 |
+
cancel();
|
41540 |
+
}
|
41541 |
+
}, {
|
41542 |
+
eventName: 'keydown',
|
41543 |
+
fn: function fn(event) {
|
41544 |
+
var phase = getPhase();
|
41545 |
+
|
41546 |
+
if (phase.type === 'PENDING') {
|
41547 |
+
cancel();
|
41548 |
+
return;
|
41549 |
+
}
|
41550 |
+
|
41551 |
+
if (event.keyCode === react_beautiful_dnd_esm_escape) {
|
41552 |
+
event.preventDefault();
|
41553 |
+
cancel();
|
41554 |
+
return;
|
41555 |
+
}
|
41556 |
+
|
41557 |
+
preventStandardKeyEvents(event);
|
41558 |
+
}
|
41559 |
+
}, {
|
41560 |
+
eventName: 'resize',
|
41561 |
+
fn: cancel
|
41562 |
+
}, {
|
41563 |
+
eventName: 'scroll',
|
41564 |
+
options: {
|
41565 |
+
passive: true,
|
41566 |
+
capture: false
|
41567 |
+
},
|
41568 |
+
fn: function fn() {
|
41569 |
+
if (getPhase().type === 'PENDING') {
|
41570 |
+
cancel();
|
41571 |
+
}
|
41572 |
+
}
|
41573 |
+
}, {
|
41574 |
+
eventName: 'webkitmouseforcedown',
|
41575 |
+
fn: function fn(event) {
|
41576 |
+
var phase = getPhase();
|
41577 |
+
!(phase.type !== 'IDLE') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
41578 |
+
|
41579 |
+
if (phase.actions.shouldRespectForcePress()) {
|
41580 |
+
cancel();
|
41581 |
+
return;
|
41582 |
+
}
|
41583 |
+
|
41584 |
+
event.preventDefault();
|
41585 |
+
}
|
41586 |
+
}, {
|
41587 |
+
eventName: supportedEventName,
|
41588 |
+
fn: cancel
|
41589 |
+
}];
|
41590 |
+
}
|
41591 |
+
|
41592 |
+
function useMouseSensor(api) {
|
41593 |
+
var phaseRef = (0,react.useRef)(idle$1);
|
41594 |
+
var unbindEventsRef = (0,react.useRef)(react_beautiful_dnd_esm_noop);
|
41595 |
+
var startCaptureBinding = useMemo(function () {
|
41596 |
+
return {
|
41597 |
+
eventName: 'mousedown',
|
41598 |
+
fn: function onMouseDown(event) {
|
41599 |
+
if (event.defaultPrevented) {
|
41600 |
+
return;
|
41601 |
+
}
|
41602 |
+
|
41603 |
+
if (event.button !== primaryButton) {
|
41604 |
+
return;
|
41605 |
+
}
|
41606 |
+
|
41607 |
+
if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) {
|
41608 |
+
return;
|
41609 |
+
}
|
41610 |
+
|
41611 |
+
var draggableId = api.findClosestDraggableId(event);
|
41612 |
+
|
41613 |
+
if (!draggableId) {
|
41614 |
+
return;
|
41615 |
+
}
|
41616 |
+
|
41617 |
+
var actions = api.tryGetLock(draggableId, stop, {
|
41618 |
+
sourceEvent: event
|
41619 |
+
});
|
41620 |
+
|
41621 |
+
if (!actions) {
|
41622 |
+
return;
|
41623 |
+
}
|
41624 |
+
|
41625 |
+
event.preventDefault();
|
41626 |
+
var point = {
|
41627 |
+
x: event.clientX,
|
41628 |
+
y: event.clientY
|
41629 |
+
};
|
41630 |
+
unbindEventsRef.current();
|
41631 |
+
startPendingDrag(actions, point);
|
41632 |
+
}
|
41633 |
+
};
|
41634 |
+
}, [api]);
|
41635 |
+
var preventForcePressBinding = useMemo(function () {
|
41636 |
+
return {
|
41637 |
+
eventName: 'webkitmouseforcewillbegin',
|
41638 |
+
fn: function fn(event) {
|
41639 |
+
if (event.defaultPrevented) {
|
41640 |
+
return;
|
41641 |
+
}
|
41642 |
+
|
41643 |
+
var id = api.findClosestDraggableId(event);
|
41644 |
+
|
41645 |
+
if (!id) {
|
41646 |
+
return;
|
41647 |
+
}
|
41648 |
+
|
41649 |
+
var options = api.findOptionsForDraggable(id);
|
41650 |
+
|
41651 |
+
if (!options) {
|
41652 |
+
return;
|
41653 |
+
}
|
41654 |
+
|
41655 |
+
if (options.shouldRespectForcePress) {
|
41656 |
+
return;
|
41657 |
+
}
|
41658 |
+
|
41659 |
+
if (!api.canGetLock(id)) {
|
41660 |
+
return;
|
41661 |
+
}
|
41662 |
+
|
41663 |
+
event.preventDefault();
|
41664 |
+
}
|
41665 |
+
};
|
41666 |
+
}, [api]);
|
41667 |
+
var listenForCapture = useCallback(function listenForCapture() {
|
41668 |
+
var options = {
|
41669 |
+
passive: false,
|
41670 |
+
capture: true
|
41671 |
+
};
|
41672 |
+
unbindEventsRef.current = bindEvents(window, [preventForcePressBinding, startCaptureBinding], options);
|
41673 |
+
}, [preventForcePressBinding, startCaptureBinding]);
|
41674 |
+
var stop = useCallback(function () {
|
41675 |
+
var current = phaseRef.current;
|
41676 |
+
|
41677 |
+
if (current.type === 'IDLE') {
|
41678 |
+
return;
|
41679 |
+
}
|
41680 |
+
|
41681 |
+
phaseRef.current = idle$1;
|
41682 |
+
unbindEventsRef.current();
|
41683 |
+
listenForCapture();
|
41684 |
+
}, [listenForCapture]);
|
41685 |
+
var cancel = useCallback(function () {
|
41686 |
+
var phase = phaseRef.current;
|
41687 |
+
stop();
|
41688 |
+
|
41689 |
+
if (phase.type === 'DRAGGING') {
|
41690 |
+
phase.actions.cancel({
|
41691 |
+
shouldBlockNextClick: true
|
41692 |
+
});
|
41693 |
+
}
|
41694 |
+
|
41695 |
+
if (phase.type === 'PENDING') {
|
41696 |
+
phase.actions.abort();
|
41697 |
+
}
|
41698 |
+
}, [stop]);
|
41699 |
+
var bindCapturingEvents = useCallback(function bindCapturingEvents() {
|
41700 |
+
var options = {
|
41701 |
+
capture: true,
|
41702 |
+
passive: false
|
41703 |
+
};
|
41704 |
+
var bindings = getCaptureBindings({
|
41705 |
+
cancel: cancel,
|
41706 |
+
completed: stop,
|
41707 |
+
getPhase: function getPhase() {
|
41708 |
+
return phaseRef.current;
|
41709 |
+
},
|
41710 |
+
setPhase: function setPhase(phase) {
|
41711 |
+
phaseRef.current = phase;
|
41712 |
+
}
|
41713 |
+
});
|
41714 |
+
unbindEventsRef.current = bindEvents(window, bindings, options);
|
41715 |
+
}, [cancel, stop]);
|
41716 |
+
var startPendingDrag = useCallback(function startPendingDrag(actions, point) {
|
41717 |
+
!(phaseRef.current.type === 'IDLE') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
41718 |
+
phaseRef.current = {
|
41719 |
+
type: 'PENDING',
|
41720 |
+
point: point,
|
41721 |
+
actions: actions
|
41722 |
+
};
|
41723 |
+
bindCapturingEvents();
|
41724 |
+
}, [bindCapturingEvents]);
|
41725 |
+
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function mount() {
|
41726 |
+
listenForCapture();
|
41727 |
+
return function unmount() {
|
41728 |
+
unbindEventsRef.current();
|
41729 |
+
};
|
41730 |
+
}, [listenForCapture]);
|
41731 |
+
}
|
41732 |
+
|
41733 |
+
var _scrollJumpKeys;
|
41734 |
+
|
41735 |
+
function noop$1() {}
|
41736 |
+
|
41737 |
+
var scrollJumpKeys = (_scrollJumpKeys = {}, _scrollJumpKeys[pageDown] = true, _scrollJumpKeys[pageUp] = true, _scrollJumpKeys[home] = true, _scrollJumpKeys[react_beautiful_dnd_esm_end] = true, _scrollJumpKeys);
|
41738 |
+
|
41739 |
+
function getDraggingBindings(actions, stop) {
|
41740 |
+
function cancel() {
|
41741 |
+
stop();
|
41742 |
+
actions.cancel();
|
41743 |
+
}
|
41744 |
+
|
41745 |
+
function drop() {
|
41746 |
+
stop();
|
41747 |
+
actions.drop();
|
41748 |
+
}
|
41749 |
+
|
41750 |
+
return [{
|
41751 |
+
eventName: 'keydown',
|
41752 |
+
fn: function fn(event) {
|
41753 |
+
if (event.keyCode === react_beautiful_dnd_esm_escape) {
|
41754 |
+
event.preventDefault();
|
41755 |
+
cancel();
|
41756 |
+
return;
|
41757 |
+
}
|
41758 |
+
|
41759 |
+
if (event.keyCode === space) {
|
41760 |
+
event.preventDefault();
|
41761 |
+
drop();
|
41762 |
+
return;
|
41763 |
+
}
|
41764 |
+
|
41765 |
+
if (event.keyCode === arrowDown) {
|
41766 |
+
event.preventDefault();
|
41767 |
+
actions.moveDown();
|
41768 |
+
return;
|
41769 |
+
}
|
41770 |
+
|
41771 |
+
if (event.keyCode === arrowUp) {
|
41772 |
+
event.preventDefault();
|
41773 |
+
actions.moveUp();
|
41774 |
+
return;
|
41775 |
+
}
|
41776 |
+
|
41777 |
+
if (event.keyCode === arrowRight) {
|
41778 |
+
event.preventDefault();
|
41779 |
+
actions.moveRight();
|
41780 |
+
return;
|
41781 |
+
}
|
41782 |
+
|
41783 |
+
if (event.keyCode === arrowLeft) {
|
41784 |
+
event.preventDefault();
|
41785 |
+
actions.moveLeft();
|
41786 |
+
return;
|
41787 |
+
}
|
41788 |
+
|
41789 |
+
if (scrollJumpKeys[event.keyCode]) {
|
41790 |
+
event.preventDefault();
|
41791 |
+
return;
|
41792 |
+
}
|
41793 |
+
|
41794 |
+
preventStandardKeyEvents(event);
|
41795 |
+
}
|
41796 |
+
}, {
|
41797 |
+
eventName: 'mousedown',
|
41798 |
+
fn: cancel
|
41799 |
+
}, {
|
41800 |
+
eventName: 'mouseup',
|
41801 |
+
fn: cancel
|
41802 |
+
}, {
|
41803 |
+
eventName: 'click',
|
41804 |
+
fn: cancel
|
41805 |
+
}, {
|
41806 |
+
eventName: 'touchstart',
|
41807 |
+
fn: cancel
|
41808 |
+
}, {
|
41809 |
+
eventName: 'resize',
|
41810 |
+
fn: cancel
|
41811 |
+
}, {
|
41812 |
+
eventName: 'wheel',
|
41813 |
+
fn: cancel,
|
41814 |
+
options: {
|
41815 |
+
passive: true
|
41816 |
+
}
|
41817 |
+
}, {
|
41818 |
+
eventName: supportedEventName,
|
41819 |
+
fn: cancel
|
41820 |
+
}];
|
41821 |
+
}
|
41822 |
+
|
41823 |
+
function useKeyboardSensor(api) {
|
41824 |
+
var unbindEventsRef = (0,react.useRef)(noop$1);
|
41825 |
+
var startCaptureBinding = useMemo(function () {
|
41826 |
+
return {
|
41827 |
+
eventName: 'keydown',
|
41828 |
+
fn: function onKeyDown(event) {
|
41829 |
+
if (event.defaultPrevented) {
|
41830 |
+
return;
|
41831 |
+
}
|
41832 |
+
|
41833 |
+
if (event.keyCode !== space) {
|
41834 |
+
return;
|
41835 |
+
}
|
41836 |
+
|
41837 |
+
var draggableId = api.findClosestDraggableId(event);
|
41838 |
+
|
41839 |
+
if (!draggableId) {
|
41840 |
+
return;
|
41841 |
+
}
|
41842 |
+
|
41843 |
+
var preDrag = api.tryGetLock(draggableId, stop, {
|
41844 |
+
sourceEvent: event
|
41845 |
+
});
|
41846 |
+
|
41847 |
+
if (!preDrag) {
|
41848 |
+
return;
|
41849 |
+
}
|
41850 |
+
|
41851 |
+
event.preventDefault();
|
41852 |
+
var isCapturing = true;
|
41853 |
+
var actions = preDrag.snapLift();
|
41854 |
+
unbindEventsRef.current();
|
41855 |
+
|
41856 |
+
function stop() {
|
41857 |
+
!isCapturing ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
41858 |
+
isCapturing = false;
|
41859 |
+
unbindEventsRef.current();
|
41860 |
+
listenForCapture();
|
41861 |
+
}
|
41862 |
+
|
41863 |
+
unbindEventsRef.current = bindEvents(window, getDraggingBindings(actions, stop), {
|
41864 |
+
capture: true,
|
41865 |
+
passive: false
|
41866 |
+
});
|
41867 |
+
}
|
41868 |
+
};
|
41869 |
+
}, [api]);
|
41870 |
+
var listenForCapture = useCallback(function tryStartCapture() {
|
41871 |
+
var options = {
|
41872 |
+
passive: false,
|
41873 |
+
capture: true
|
41874 |
+
};
|
41875 |
+
unbindEventsRef.current = bindEvents(window, [startCaptureBinding], options);
|
41876 |
+
}, [startCaptureBinding]);
|
41877 |
+
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function mount() {
|
41878 |
+
listenForCapture();
|
41879 |
+
return function unmount() {
|
41880 |
+
unbindEventsRef.current();
|
41881 |
+
};
|
41882 |
+
}, [listenForCapture]);
|
41883 |
+
}
|
41884 |
+
|
41885 |
+
var idle$2 = {
|
41886 |
+
type: 'IDLE'
|
41887 |
+
};
|
41888 |
+
var timeForLongPress = 120;
|
41889 |
+
var forcePressThreshold = 0.15;
|
41890 |
+
|
41891 |
+
function getWindowBindings(_ref) {
|
41892 |
+
var cancel = _ref.cancel,
|
41893 |
+
getPhase = _ref.getPhase;
|
41894 |
+
return [{
|
41895 |
+
eventName: 'orientationchange',
|
41896 |
+
fn: cancel
|
41897 |
+
}, {
|
41898 |
+
eventName: 'resize',
|
41899 |
+
fn: cancel
|
41900 |
+
}, {
|
41901 |
+
eventName: 'contextmenu',
|
41902 |
+
fn: function fn(event) {
|
41903 |
+
event.preventDefault();
|
41904 |
+
}
|
41905 |
+
}, {
|
41906 |
+
eventName: 'keydown',
|
41907 |
+
fn: function fn(event) {
|
41908 |
+
if (getPhase().type !== 'DRAGGING') {
|
41909 |
+
cancel();
|
41910 |
+
return;
|
41911 |
+
}
|
41912 |
+
|
41913 |
+
if (event.keyCode === react_beautiful_dnd_esm_escape) {
|
41914 |
+
event.preventDefault();
|
41915 |
+
}
|
41916 |
+
|
41917 |
+
cancel();
|
41918 |
+
}
|
41919 |
+
}, {
|
41920 |
+
eventName: supportedEventName,
|
41921 |
+
fn: cancel
|
41922 |
+
}];
|
41923 |
+
}
|
41924 |
+
|
41925 |
+
function getHandleBindings(_ref2) {
|
41926 |
+
var cancel = _ref2.cancel,
|
41927 |
+
completed = _ref2.completed,
|
41928 |
+
getPhase = _ref2.getPhase;
|
41929 |
+
return [{
|
41930 |
+
eventName: 'touchmove',
|
41931 |
+
options: {
|
41932 |
+
capture: false
|
41933 |
+
},
|
41934 |
+
fn: function fn(event) {
|
41935 |
+
var phase = getPhase();
|
41936 |
+
|
41937 |
+
if (phase.type !== 'DRAGGING') {
|
41938 |
+
cancel();
|
41939 |
+
return;
|
41940 |
+
}
|
41941 |
+
|
41942 |
+
phase.hasMoved = true;
|
41943 |
+
var _event$touches$ = event.touches[0],
|
41944 |
+
clientX = _event$touches$.clientX,
|
41945 |
+
clientY = _event$touches$.clientY;
|
41946 |
+
var point = {
|
41947 |
+
x: clientX,
|
41948 |
+
y: clientY
|
41949 |
+
};
|
41950 |
+
event.preventDefault();
|
41951 |
+
phase.actions.move(point);
|
41952 |
}
|
41953 |
}, {
|
41954 |
+
eventName: 'touchend',
|
41955 |
fn: function fn(event) {
|
41956 |
var phase = getPhase();
|
41957 |
|
41967 |
completed();
|
41968 |
}
|
41969 |
}, {
|
41970 |
+
eventName: 'touchcancel',
|
41971 |
fn: function fn(event) {
|
41972 |
+
if (getPhase().type !== 'DRAGGING') {
|
41973 |
+
cancel();
|
41974 |
+
return;
|
41975 |
}
|
41976 |
|
41977 |
+
event.preventDefault();
|
41978 |
cancel();
|
41979 |
}
|
41980 |
}, {
|
41981 |
+
eventName: 'touchforcechange',
|
41982 |
fn: function fn(event) {
|
41983 |
var phase = getPhase();
|
41984 |
+
!(phase.type !== 'IDLE') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
41985 |
+
var touch = event.touches[0];
|
41986 |
|
41987 |
+
if (!touch) {
|
|
|
41988 |
return;
|
41989 |
}
|
41990 |
|
41991 |
+
var isForcePress = touch.force >= forcePressThreshold;
|
41992 |
+
|
41993 |
+
if (!isForcePress) {
|
41994 |
return;
|
41995 |
}
|
41996 |
|
41997 |
+
var shouldRespect = phase.actions.shouldRespectForcePress();
|
41998 |
+
|
41999 |
+
if (phase.type === 'PENDING') {
|
42000 |
+
if (shouldRespect) {
|
42001 |
+
cancel();
|
42002 |
+
}
|
42003 |
+
|
42004 |
+
return;
|
|
|
|
|
|
|
|
|
|
|
|
|
42005 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
42006 |
|
42007 |
+
if (shouldRespect) {
|
42008 |
+
if (phase.hasMoved) {
|
42009 |
+
event.preventDefault();
|
42010 |
+
return;
|
42011 |
+
}
|
42012 |
+
|
42013 |
cancel();
|
42014 |
return;
|
42015 |
}
|
42022 |
}];
|
42023 |
}
|
42024 |
|
42025 |
+
function useTouchSensor(api) {
|
42026 |
+
var phaseRef = (0,react.useRef)(idle$2);
|
42027 |
var unbindEventsRef = (0,react.useRef)(react_beautiful_dnd_esm_noop);
|
42028 |
+
var getPhase = useCallback(function getPhase() {
|
42029 |
+
return phaseRef.current;
|
42030 |
+
}, []);
|
42031 |
+
var setPhase = useCallback(function setPhase(phase) {
|
42032 |
+
phaseRef.current = phase;
|
42033 |
+
}, []);
|
42034 |
var startCaptureBinding = useMemo(function () {
|
42035 |
return {
|
42036 |
+
eventName: 'touchstart',
|
42037 |
+
fn: function onTouchStart(event) {
|
42038 |
if (event.defaultPrevented) {
|
42039 |
return;
|
42040 |
}
|
42041 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42042 |
var draggableId = api.findClosestDraggableId(event);
|
42043 |
|
42044 |
if (!draggableId) {
|
42053 |
return;
|
42054 |
}
|
42055 |
|
42056 |
+
var touch = event.touches[0];
|
42057 |
+
var clientX = touch.clientX,
|
42058 |
+
clientY = touch.clientY;
|
42059 |
var point = {
|
42060 |
+
x: clientX,
|
42061 |
+
y: clientY
|
42062 |
};
|
42063 |
unbindEventsRef.current();
|
42064 |
startPendingDrag(actions, point);
|
42065 |
}
|
42066 |
};
|
42067 |
}, [api]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42068 |
var listenForCapture = useCallback(function listenForCapture() {
|
42069 |
var options = {
|
42070 |
+
capture: true,
|
42071 |
+
passive: false
|
42072 |
};
|
42073 |
+
unbindEventsRef.current = bindEvents(window, [startCaptureBinding], options);
|
42074 |
+
}, [startCaptureBinding]);
|
42075 |
var stop = useCallback(function () {
|
42076 |
var current = phaseRef.current;
|
42077 |
|
42079 |
return;
|
42080 |
}
|
42081 |
|
42082 |
+
if (current.type === 'PENDING') {
|
42083 |
+
clearTimeout(current.longPressTimerId);
|
42084 |
+
}
|
42085 |
+
|
42086 |
+
setPhase(idle$2);
|
42087 |
unbindEventsRef.current();
|
42088 |
listenForCapture();
|
42089 |
+
}, [listenForCapture, setPhase]);
|
42090 |
var cancel = useCallback(function () {
|
42091 |
var phase = phaseRef.current;
|
42092 |
stop();
|
42106 |
capture: true,
|
42107 |
passive: false
|
42108 |
};
|
42109 |
+
var args = {
|
42110 |
cancel: cancel,
|
42111 |
completed: stop,
|
42112 |
+
getPhase: getPhase
|
42113 |
+
};
|
42114 |
+
var unbindTarget = bindEvents(window, getHandleBindings(args), options);
|
42115 |
+
var unbindWindow = bindEvents(window, getWindowBindings(args), options);
|
42116 |
+
|
42117 |
+
unbindEventsRef.current = function unbindAll() {
|
42118 |
+
unbindTarget();
|
42119 |
+
unbindWindow();
|
42120 |
+
};
|
42121 |
+
}, [cancel, getPhase, stop]);
|
42122 |
+
var startDragging = useCallback(function startDragging() {
|
42123 |
+
var phase = getPhase();
|
42124 |
+
!(phase.type === 'PENDING') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
42125 |
+
var actions = phase.actions.fluidLift(phase.point);
|
42126 |
+
setPhase({
|
42127 |
+
type: 'DRAGGING',
|
42128 |
+
actions: actions,
|
42129 |
+
hasMoved: false
|
42130 |
});
|
42131 |
+
}, [getPhase, setPhase]);
|
|
|
42132 |
var startPendingDrag = useCallback(function startPendingDrag(actions, point) {
|
42133 |
+
!(getPhase().type === 'IDLE') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
42134 |
+
var longPressTimerId = setTimeout(startDragging, timeForLongPress);
|
42135 |
+
setPhase({
|
42136 |
type: 'PENDING',
|
42137 |
point: point,
|
42138 |
+
actions: actions,
|
42139 |
+
longPressTimerId: longPressTimerId
|
42140 |
+
});
|
42141 |
bindCapturingEvents();
|
42142 |
+
}, [bindCapturingEvents, getPhase, setPhase, startDragging]);
|
42143 |
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function mount() {
|
42144 |
listenForCapture();
|
42145 |
return function unmount() {
|
42146 |
unbindEventsRef.current();
|
42147 |
+
var phase = getPhase();
|
42148 |
+
|
42149 |
+
if (phase.type === 'PENDING') {
|
42150 |
+
clearTimeout(phase.longPressTimerId);
|
42151 |
+
setPhase(idle$2);
|
42152 |
+
}
|
42153 |
};
|
42154 |
+
}, [getPhase, listenForCapture, setPhase]);
|
42155 |
+
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function webkitHack() {
|
42156 |
+
var unbind = bindEvents(window, [{
|
42157 |
+
eventName: 'touchmove',
|
42158 |
+
fn: function fn() {},
|
42159 |
+
options: {
|
42160 |
+
capture: false,
|
42161 |
+
passive: false
|
42162 |
+
}
|
42163 |
+
}]);
|
42164 |
+
return unbind;
|
42165 |
+
}, []);
|
42166 |
}
|
42167 |
|
42168 |
+
function useValidateSensorHooks(sensorHooks) {
|
42169 |
+
useDev(function () {
|
42170 |
+
var previousRef = usePrevious(sensorHooks);
|
42171 |
+
useDevSetupWarning(function () {
|
42172 |
+
!(previousRef.current.length === sensorHooks.length) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
42173 |
+
});
|
42174 |
+
});
|
42175 |
+
}
|
42176 |
|
42177 |
+
var interactiveTagNames = {
|
42178 |
+
input: true,
|
42179 |
+
button: true,
|
42180 |
+
textarea: true,
|
42181 |
+
select: true,
|
42182 |
+
option: true,
|
42183 |
+
optgroup: true,
|
42184 |
+
video: true,
|
42185 |
+
audio: true
|
42186 |
+
};
|
42187 |
|
42188 |
+
function isAnInteractiveElement(parent, current) {
|
42189 |
+
if (current == null) {
|
42190 |
+
return false;
|
42191 |
+
}
|
42192 |
|
42193 |
+
var hasAnInteractiveTag = Boolean(interactiveTagNames[current.tagName.toLowerCase()]);
|
42194 |
+
|
42195 |
+
if (hasAnInteractiveTag) {
|
42196 |
+
return true;
|
42197 |
}
|
42198 |
|
42199 |
+
var attribute = current.getAttribute('contenteditable');
|
42200 |
+
|
42201 |
+
if (attribute === 'true' || attribute === '') {
|
42202 |
+
return true;
|
42203 |
}
|
42204 |
|
42205 |
+
if (current === parent) {
|
42206 |
+
return false;
|
42207 |
+
}
|
42208 |
+
|
42209 |
+
return isAnInteractiveElement(parent, current.parentElement);
|
42210 |
+
}
|
42211 |
+
|
42212 |
+
function isEventInInteractiveElement(draggable, event) {
|
42213 |
+
var target = event.target;
|
42214 |
+
|
42215 |
+
if (!isHtmlElement(target)) {
|
42216 |
+
return false;
|
42217 |
+
}
|
42218 |
+
|
42219 |
+
return isAnInteractiveElement(draggable, target);
|
42220 |
+
}
|
42221 |
+
|
42222 |
+
var getBorderBoxCenterPosition = (function (el) {
|
42223 |
+
return getRect(el.getBoundingClientRect()).center;
|
42224 |
+
});
|
42225 |
+
|
42226 |
+
function react_beautiful_dnd_esm_isElement(el) {
|
42227 |
+
return el instanceof getWindowFromEl(el).Element;
|
42228 |
+
}
|
42229 |
+
|
42230 |
+
var supportedMatchesName = function () {
|
42231 |
+
var base = 'matches';
|
42232 |
+
|
42233 |
+
if (typeof document === 'undefined') {
|
42234 |
+
return base;
|
42235 |
+
}
|
42236 |
+
|
42237 |
+
var candidates = [base, 'msMatchesSelector', 'webkitMatchesSelector'];
|
42238 |
+
var value = find(candidates, function (name) {
|
42239 |
+
return name in Element.prototype;
|
42240 |
+
});
|
42241 |
+
return value || base;
|
42242 |
+
}();
|
42243 |
+
|
42244 |
+
function closestPonyfill(el, selector) {
|
42245 |
+
if (el == null) {
|
42246 |
+
return null;
|
42247 |
+
}
|
42248 |
+
|
42249 |
+
if (el[supportedMatchesName](selector)) {
|
42250 |
+
return el;
|
42251 |
+
}
|
42252 |
+
|
42253 |
+
return closestPonyfill(el.parentElement, selector);
|
42254 |
+
}
|
42255 |
+
|
42256 |
+
function closest$1(el, selector) {
|
42257 |
+
if (el.closest) {
|
42258 |
+
return el.closest(selector);
|
42259 |
+
}
|
42260 |
+
|
42261 |
+
return closestPonyfill(el, selector);
|
42262 |
+
}
|
42263 |
+
|
42264 |
+
function getSelector(contextId) {
|
42265 |
+
return "[" + dragHandle.contextId + "=\"" + contextId + "\"]";
|
42266 |
+
}
|
42267 |
+
|
42268 |
+
function findClosestDragHandleFromEvent(contextId, event) {
|
42269 |
+
var target = event.target;
|
42270 |
+
|
42271 |
+
if (!react_beautiful_dnd_esm_isElement(target)) {
|
42272 |
+
false ? 0 : void 0;
|
42273 |
+
return null;
|
42274 |
+
}
|
42275 |
+
|
42276 |
+
var selector = getSelector(contextId);
|
42277 |
+
var handle = closest$1(target, selector);
|
42278 |
+
|
42279 |
+
if (!handle) {
|
42280 |
+
return null;
|
42281 |
+
}
|
42282 |
+
|
42283 |
+
if (!isHtmlElement(handle)) {
|
42284 |
+
false ? 0 : void 0;
|
42285 |
+
return null;
|
42286 |
+
}
|
42287 |
+
|
42288 |
+
return handle;
|
42289 |
+
}
|
42290 |
+
|
42291 |
+
function tryGetClosestDraggableIdFromEvent(contextId, event) {
|
42292 |
+
var handle = findClosestDragHandleFromEvent(contextId, event);
|
42293 |
+
|
42294 |
+
if (!handle) {
|
42295 |
+
return null;
|
42296 |
+
}
|
42297 |
+
|
42298 |
+
return handle.getAttribute(dragHandle.draggableId);
|
42299 |
+
}
|
42300 |
+
|
42301 |
+
function findDraggable(contextId, draggableId) {
|
42302 |
+
var selector = "[" + draggable.contextId + "=\"" + contextId + "\"]";
|
42303 |
+
var possible = toArray(document.querySelectorAll(selector));
|
42304 |
+
var draggable$1 = find(possible, function (el) {
|
42305 |
+
return el.getAttribute(draggable.id) === draggableId;
|
42306 |
+
});
|
42307 |
+
|
42308 |
+
if (!draggable$1) {
|
42309 |
+
return null;
|
42310 |
+
}
|
42311 |
+
|
42312 |
+
if (!isHtmlElement(draggable$1)) {
|
42313 |
+
false ? 0 : void 0;
|
42314 |
+
return null;
|
42315 |
+
}
|
42316 |
+
|
42317 |
+
return draggable$1;
|
42318 |
+
}
|
42319 |
+
|
42320 |
+
function preventDefault(event) {
|
42321 |
+
event.preventDefault();
|
42322 |
+
}
|
42323 |
+
|
42324 |
+
function _isActive(_ref) {
|
42325 |
+
var expected = _ref.expected,
|
42326 |
+
phase = _ref.phase,
|
42327 |
+
isLockActive = _ref.isLockActive,
|
42328 |
+
shouldWarn = _ref.shouldWarn;
|
42329 |
+
|
42330 |
+
if (!isLockActive()) {
|
42331 |
+
if (shouldWarn) {
|
42332 |
+
false ? 0 : void 0;
|
42333 |
+
}
|
42334 |
+
|
42335 |
+
return false;
|
42336 |
+
}
|
42337 |
+
|
42338 |
+
if (expected !== phase) {
|
42339 |
+
if (shouldWarn) {
|
42340 |
+
false ? 0 : void 0;
|
42341 |
+
}
|
42342 |
+
|
42343 |
+
return false;
|
42344 |
+
}
|
42345 |
+
|
42346 |
+
return true;
|
42347 |
+
}
|
42348 |
+
|
42349 |
+
function canStart(_ref2) {
|
42350 |
+
var lockAPI = _ref2.lockAPI,
|
42351 |
+
store = _ref2.store,
|
42352 |
+
registry = _ref2.registry,
|
42353 |
+
draggableId = _ref2.draggableId;
|
42354 |
+
|
42355 |
+
if (lockAPI.isClaimed()) {
|
42356 |
+
return false;
|
42357 |
+
}
|
42358 |
+
|
42359 |
+
var entry = registry.draggable.findById(draggableId);
|
42360 |
+
|
42361 |
+
if (!entry) {
|
42362 |
+
false ? 0 : void 0;
|
42363 |
+
return false;
|
42364 |
+
}
|
42365 |
+
|
42366 |
+
if (!entry.options.isEnabled) {
|
42367 |
+
return false;
|
42368 |
+
}
|
42369 |
+
|
42370 |
+
if (!canStartDrag(store.getState(), draggableId)) {
|
42371 |
+
return false;
|
42372 |
+
}
|
42373 |
+
|
42374 |
+
return true;
|
42375 |
+
}
|
42376 |
+
|
42377 |
+
function tryStart(_ref3) {
|
42378 |
+
var lockAPI = _ref3.lockAPI,
|
42379 |
+
contextId = _ref3.contextId,
|
42380 |
+
store = _ref3.store,
|
42381 |
+
registry = _ref3.registry,
|
42382 |
+
draggableId = _ref3.draggableId,
|
42383 |
+
forceSensorStop = _ref3.forceSensorStop,
|
42384 |
+
sourceEvent = _ref3.sourceEvent;
|
42385 |
+
var shouldStart = canStart({
|
42386 |
+
lockAPI: lockAPI,
|
42387 |
+
store: store,
|
42388 |
+
registry: registry,
|
42389 |
+
draggableId: draggableId
|
42390 |
+
});
|
42391 |
+
|
42392 |
+
if (!shouldStart) {
|
42393 |
+
return null;
|
42394 |
+
}
|
42395 |
+
|
42396 |
+
var entry = registry.draggable.getById(draggableId);
|
42397 |
+
var el = findDraggable(contextId, entry.descriptor.id);
|
42398 |
+
|
42399 |
+
if (!el) {
|
42400 |
+
false ? 0 : void 0;
|
42401 |
+
return null;
|
42402 |
+
}
|
42403 |
+
|
42404 |
+
if (sourceEvent && !entry.options.canDragInteractiveElements && isEventInInteractiveElement(el, sourceEvent)) {
|
42405 |
+
return null;
|
42406 |
+
}
|
42407 |
+
|
42408 |
+
var lock = lockAPI.claim(forceSensorStop || react_beautiful_dnd_esm_noop);
|
42409 |
+
var phase = 'PRE_DRAG';
|
42410 |
+
|
42411 |
+
function getShouldRespectForcePress() {
|
42412 |
+
return entry.options.shouldRespectForcePress;
|
42413 |
+
}
|
42414 |
+
|
42415 |
+
function isLockActive() {
|
42416 |
+
return lockAPI.isActive(lock);
|
42417 |
+
}
|
42418 |
+
|
42419 |
+
function tryDispatch(expected, getAction) {
|
42420 |
+
if (_isActive({
|
42421 |
+
expected: expected,
|
42422 |
+
phase: phase,
|
42423 |
+
isLockActive: isLockActive,
|
42424 |
+
shouldWarn: true
|
42425 |
+
})) {
|
42426 |
+
store.dispatch(getAction());
|
42427 |
+
}
|
42428 |
+
}
|
42429 |
+
|
42430 |
+
var tryDispatchWhenDragging = tryDispatch.bind(null, 'DRAGGING');
|
42431 |
+
|
42432 |
+
function lift$1(args) {
|
42433 |
+
function completed() {
|
42434 |
+
lockAPI.release();
|
42435 |
+
phase = 'COMPLETED';
|
42436 |
+
}
|
42437 |
+
|
42438 |
+
if (phase !== 'PRE_DRAG') {
|
42439 |
+
completed();
|
42440 |
+
!(phase === 'PRE_DRAG') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
42441 |
+
}
|
42442 |
+
|
42443 |
+
store.dispatch(lift(args.liftActionArgs));
|
42444 |
+
phase = 'DRAGGING';
|
42445 |
+
|
42446 |
+
function finish(reason, options) {
|
42447 |
+
if (options === void 0) {
|
42448 |
+
options = {
|
42449 |
+
shouldBlockNextClick: false
|
42450 |
+
};
|
42451 |
+
}
|
42452 |
+
|
42453 |
+
args.cleanup();
|
42454 |
+
|
42455 |
+
if (options.shouldBlockNextClick) {
|
42456 |
+
var unbind = bindEvents(window, [{
|
42457 |
+
eventName: 'click',
|
42458 |
+
fn: preventDefault,
|
42459 |
+
options: {
|
42460 |
+
once: true,
|
42461 |
+
passive: false,
|
42462 |
+
capture: true
|
42463 |
+
}
|
42464 |
+
}]);
|
42465 |
+
setTimeout(unbind);
|
42466 |
}
|
42467 |
|
42468 |
+
completed();
|
42469 |
+
store.dispatch(drop({
|
42470 |
+
reason: reason
|
42471 |
+
}));
|
42472 |
+
}
|
42473 |
|
42474 |
+
return (0,esm_extends/* default */.Z)({
|
42475 |
+
isActive: function isActive() {
|
42476 |
+
return _isActive({
|
42477 |
+
expected: 'DRAGGING',
|
42478 |
+
phase: phase,
|
42479 |
+
isLockActive: isLockActive,
|
42480 |
+
shouldWarn: false
|
42481 |
+
});
|
42482 |
+
},
|
42483 |
+
shouldRespectForcePress: getShouldRespectForcePress,
|
42484 |
+
drop: function drop(options) {
|
42485 |
+
return finish('DROP', options);
|
42486 |
+
},
|
42487 |
+
cancel: function cancel(options) {
|
42488 |
+
return finish('CANCEL', options);
|
42489 |
}
|
42490 |
+
}, args.actions);
|
42491 |
+
}
|
42492 |
|
42493 |
+
function fluidLift(clientSelection) {
|
42494 |
+
var move$1 = raf_schd_esm(function (client) {
|
42495 |
+
tryDispatchWhenDragging(function () {
|
42496 |
+
return move({
|
42497 |
+
client: client
|
42498 |
+
});
|
42499 |
+
});
|
42500 |
+
});
|
42501 |
+
var api = lift$1({
|
42502 |
+
liftActionArgs: {
|
42503 |
+
id: draggableId,
|
42504 |
+
clientSelection: clientSelection,
|
42505 |
+
movementMode: 'FLUID'
|
42506 |
+
},
|
42507 |
+
cleanup: function cleanup() {
|
42508 |
+
return move$1.cancel();
|
42509 |
+
},
|
42510 |
+
actions: {
|
42511 |
+
move: move$1
|
42512 |
}
|
42513 |
+
});
|
42514 |
+
return (0,esm_extends/* default */.Z)({}, api, {
|
42515 |
+
move: move$1
|
42516 |
+
});
|
42517 |
+
}
|
42518 |
|
42519 |
+
function snapLift() {
|
42520 |
+
var actions = {
|
42521 |
+
moveUp: function moveUp$1() {
|
42522 |
+
return tryDispatchWhenDragging(moveUp);
|
42523 |
+
},
|
42524 |
+
moveRight: function moveRight$1() {
|
42525 |
+
return tryDispatchWhenDragging(moveRight);
|
42526 |
+
},
|
42527 |
+
moveDown: function moveDown$1() {
|
42528 |
+
return tryDispatchWhenDragging(moveDown);
|
42529 |
+
},
|
42530 |
+
moveLeft: function moveLeft$1() {
|
42531 |
+
return tryDispatchWhenDragging(moveLeft);
|
42532 |
}
|
42533 |
+
};
|
42534 |
+
return lift$1({
|
42535 |
+
liftActionArgs: {
|
42536 |
+
id: draggableId,
|
42537 |
+
clientSelection: getBorderBoxCenterPosition(el),
|
42538 |
+
movementMode: 'SNAP'
|
42539 |
+
},
|
42540 |
+
cleanup: react_beautiful_dnd_esm_noop,
|
42541 |
+
actions: actions
|
42542 |
+
});
|
42543 |
+
}
|
42544 |
|
42545 |
+
function abortPreDrag() {
|
42546 |
+
var shouldRelease = _isActive({
|
42547 |
+
expected: 'PRE_DRAG',
|
42548 |
+
phase: phase,
|
42549 |
+
isLockActive: isLockActive,
|
42550 |
+
shouldWarn: true
|
42551 |
+
});
|
42552 |
|
42553 |
+
if (shouldRelease) {
|
42554 |
+
lockAPI.release();
|
42555 |
+
}
|
42556 |
+
}
|
42557 |
|
42558 |
+
var preDrag = {
|
42559 |
+
isActive: function isActive() {
|
42560 |
+
return _isActive({
|
42561 |
+
expected: 'PRE_DRAG',
|
42562 |
+
phase: phase,
|
42563 |
+
isLockActive: isLockActive,
|
42564 |
+
shouldWarn: false
|
42565 |
+
});
|
42566 |
+
},
|
42567 |
+
shouldRespectForcePress: getShouldRespectForcePress,
|
42568 |
+
fluidLift: fluidLift,
|
42569 |
+
snapLift: snapLift,
|
42570 |
+
abort: abortPreDrag
|
42571 |
+
};
|
42572 |
+
return preDrag;
|
42573 |
+
}
|
42574 |
+
|
42575 |
+
var defaultSensors = [useMouseSensor, useKeyboardSensor, useTouchSensor];
|
42576 |
+
function useSensorMarshal(_ref4) {
|
42577 |
+
var contextId = _ref4.contextId,
|
42578 |
+
store = _ref4.store,
|
42579 |
+
registry = _ref4.registry,
|
42580 |
+
customSensors = _ref4.customSensors,
|
42581 |
+
enableDefaultSensors = _ref4.enableDefaultSensors;
|
42582 |
+
var useSensors = [].concat(enableDefaultSensors ? defaultSensors : [], customSensors || []);
|
42583 |
+
var lockAPI = (0,react.useState)(function () {
|
42584 |
+
return create();
|
42585 |
+
})[0];
|
42586 |
+
var tryAbandonLock = useCallback(function tryAbandonLock(previous, current) {
|
42587 |
+
if (previous.isDragging && !current.isDragging) {
|
42588 |
+
lockAPI.tryAbandon();
|
42589 |
}
|
42590 |
+
}, [lockAPI]);
|
42591 |
+
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function listenToStore() {
|
42592 |
+
var previous = store.getState();
|
42593 |
+
var unsubscribe = store.subscribe(function () {
|
42594 |
+
var current = store.getState();
|
42595 |
+
tryAbandonLock(previous, current);
|
42596 |
+
previous = current;
|
42597 |
+
});
|
42598 |
+
return unsubscribe;
|
42599 |
+
}, [lockAPI, store, tryAbandonLock]);
|
42600 |
+
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function () {
|
42601 |
+
return lockAPI.tryAbandon;
|
42602 |
+
}, [lockAPI.tryAbandon]);
|
42603 |
+
var canGetLock = useCallback(function (draggableId) {
|
42604 |
+
return canStart({
|
42605 |
+
lockAPI: lockAPI,
|
42606 |
+
registry: registry,
|
42607 |
+
store: store,
|
42608 |
+
draggableId: draggableId
|
42609 |
+
});
|
42610 |
+
}, [lockAPI, registry, store]);
|
42611 |
+
var tryGetLock = useCallback(function (draggableId, forceStop, options) {
|
42612 |
+
return tryStart({
|
42613 |
+
lockAPI: lockAPI,
|
42614 |
+
registry: registry,
|
42615 |
+
contextId: contextId,
|
42616 |
+
store: store,
|
42617 |
+
draggableId: draggableId,
|
42618 |
+
forceSensorStop: forceStop,
|
42619 |
+
sourceEvent: options && options.sourceEvent ? options.sourceEvent : null
|
42620 |
+
});
|
42621 |
+
}, [contextId, lockAPI, registry, store]);
|
42622 |
+
var findClosestDraggableId = useCallback(function (event) {
|
42623 |
+
return tryGetClosestDraggableIdFromEvent(contextId, event);
|
42624 |
+
}, [contextId]);
|
42625 |
+
var findOptionsForDraggable = useCallback(function (id) {
|
42626 |
+
var entry = registry.draggable.findById(id);
|
42627 |
+
return entry ? entry.options : null;
|
42628 |
+
}, [registry.draggable]);
|
42629 |
+
var tryReleaseLock = useCallback(function tryReleaseLock() {
|
42630 |
+
if (!lockAPI.isClaimed()) {
|
42631 |
+
return;
|
42632 |
}
|
|
|
|
|
|
|
|
|
|
|
42633 |
|
42634 |
+
lockAPI.tryAbandon();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42635 |
|
42636 |
+
if (store.getState().phase !== 'IDLE') {
|
42637 |
+
store.dispatch(flush());
|
42638 |
+
}
|
42639 |
+
}, [lockAPI, store]);
|
42640 |
+
var isLockClaimed = useCallback(lockAPI.isClaimed, [lockAPI]);
|
42641 |
+
var api = useMemo(function () {
|
42642 |
+
return {
|
42643 |
+
canGetLock: canGetLock,
|
42644 |
+
tryGetLock: tryGetLock,
|
42645 |
+
findClosestDraggableId: findClosestDraggableId,
|
42646 |
+
findOptionsForDraggable: findOptionsForDraggable,
|
42647 |
+
tryReleaseLock: tryReleaseLock,
|
42648 |
+
isLockClaimed: isLockClaimed
|
42649 |
+
};
|
42650 |
+
}, [canGetLock, tryGetLock, findClosestDraggableId, findOptionsForDraggable, tryReleaseLock, isLockClaimed]);
|
42651 |
+
useValidateSensorHooks(useSensors);
|
42652 |
|
42653 |
+
for (var i = 0; i < useSensors.length; i++) {
|
42654 |
+
useSensors[i](api);
|
42655 |
+
}
|
42656 |
+
}
|
42657 |
|
42658 |
+
var createResponders = function createResponders(props) {
|
42659 |
+
return {
|
42660 |
+
onBeforeCapture: props.onBeforeCapture,
|
42661 |
+
onBeforeDragStart: props.onBeforeDragStart,
|
42662 |
+
onDragStart: props.onDragStart,
|
42663 |
+
onDragEnd: props.onDragEnd,
|
42664 |
+
onDragUpdate: props.onDragUpdate
|
42665 |
+
};
|
42666 |
+
};
|
42667 |
|
42668 |
+
function getStore(lazyRef) {
|
42669 |
+
!lazyRef.current ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
42670 |
+
return lazyRef.current;
|
42671 |
+
}
|
42672 |
|
42673 |
+
function App(props) {
|
42674 |
+
var contextId = props.contextId,
|
42675 |
+
setCallbacks = props.setCallbacks,
|
42676 |
+
sensors = props.sensors,
|
42677 |
+
nonce = props.nonce,
|
42678 |
+
dragHandleUsageInstructions = props.dragHandleUsageInstructions;
|
42679 |
+
var lazyStoreRef = (0,react.useRef)(null);
|
42680 |
+
useStartupValidation();
|
42681 |
+
var lastPropsRef = usePrevious(props);
|
42682 |
+
var getResponders = useCallback(function () {
|
42683 |
+
return createResponders(lastPropsRef.current);
|
42684 |
+
}, [lastPropsRef]);
|
42685 |
+
var announce = useAnnouncer(contextId);
|
42686 |
+
var dragHandleUsageInstructionsId = useHiddenTextElement({
|
42687 |
+
contextId: contextId,
|
42688 |
+
text: dragHandleUsageInstructions
|
42689 |
+
});
|
42690 |
+
var styleMarshal = useStyleMarshal(contextId, nonce);
|
42691 |
+
var lazyDispatch = useCallback(function (action) {
|
42692 |
+
getStore(lazyStoreRef).dispatch(action);
|
42693 |
+
}, []);
|
42694 |
+
var marshalCallbacks = useMemo(function () {
|
42695 |
+
return bindActionCreators({
|
42696 |
+
publishWhileDragging: publishWhileDragging,
|
42697 |
+
updateDroppableScroll: updateDroppableScroll,
|
42698 |
+
updateDroppableIsEnabled: updateDroppableIsEnabled,
|
42699 |
+
updateDroppableIsCombineEnabled: updateDroppableIsCombineEnabled,
|
42700 |
+
collectionStarting: collectionStarting
|
42701 |
+
}, lazyDispatch);
|
42702 |
+
}, [lazyDispatch]);
|
42703 |
+
var registry = useRegistry();
|
42704 |
+
var dimensionMarshal = useMemo(function () {
|
42705 |
+
return createDimensionMarshal(registry, marshalCallbacks);
|
42706 |
+
}, [registry, marshalCallbacks]);
|
42707 |
+
var autoScroller = useMemo(function () {
|
42708 |
+
return createAutoScroller((0,esm_extends/* default */.Z)({
|
42709 |
+
scrollWindow: scrollWindow,
|
42710 |
+
scrollDroppable: dimensionMarshal.scrollDroppable
|
42711 |
+
}, bindActionCreators({
|
42712 |
+
move: move
|
42713 |
+
}, lazyDispatch)));
|
42714 |
+
}, [dimensionMarshal.scrollDroppable, lazyDispatch]);
|
42715 |
+
var focusMarshal = useFocusMarshal(contextId);
|
42716 |
+
var store = useMemo(function () {
|
42717 |
+
return react_beautiful_dnd_esm_createStore({
|
42718 |
+
announce: announce,
|
42719 |
+
autoScroller: autoScroller,
|
42720 |
+
dimensionMarshal: dimensionMarshal,
|
42721 |
+
focusMarshal: focusMarshal,
|
42722 |
+
getResponders: getResponders,
|
42723 |
+
styleMarshal: styleMarshal
|
42724 |
+
});
|
42725 |
+
}, [announce, autoScroller, dimensionMarshal, focusMarshal, getResponders, styleMarshal]);
|
42726 |
|
42727 |
+
if (false) {}
|
|
|
|
|
|
|
42728 |
|
42729 |
+
lazyStoreRef.current = store;
|
42730 |
+
var tryResetStore = useCallback(function () {
|
42731 |
+
var current = getStore(lazyStoreRef);
|
42732 |
+
var state = current.getState();
|
|
|
|
|
42733 |
|
42734 |
+
if (state.phase !== 'IDLE') {
|
42735 |
+
current.dispatch(flush());
|
42736 |
+
}
|
42737 |
+
}, []);
|
42738 |
+
var isDragging = useCallback(function () {
|
42739 |
+
var state = getStore(lazyStoreRef).getState();
|
42740 |
+
return state.isDragging || state.phase === 'DROP_ANIMATING';
|
42741 |
+
}, []);
|
42742 |
+
var appCallbacks = useMemo(function () {
|
42743 |
+
return {
|
42744 |
+
isDragging: isDragging,
|
42745 |
+
tryAbort: tryResetStore
|
42746 |
};
|
42747 |
+
}, [isDragging, tryResetStore]);
|
42748 |
+
setCallbacks(appCallbacks);
|
42749 |
+
var getCanLift = useCallback(function (id) {
|
42750 |
+
return canStartDrag(getStore(lazyStoreRef).getState(), id);
|
42751 |
+
}, []);
|
42752 |
+
var getIsMovementAllowed = useCallback(function () {
|
42753 |
+
return isMovementAllowed(getStore(lazyStoreRef).getState());
|
42754 |
+
}, []);
|
42755 |
+
var appContext = useMemo(function () {
|
42756 |
+
return {
|
42757 |
+
marshal: dimensionMarshal,
|
42758 |
+
focus: focusMarshal,
|
42759 |
+
contextId: contextId,
|
42760 |
+
canLift: getCanLift,
|
42761 |
+
isMovementAllowed: getIsMovementAllowed,
|
42762 |
+
dragHandleUsageInstructionsId: dragHandleUsageInstructionsId,
|
42763 |
+
registry: registry
|
42764 |
};
|
42765 |
+
}, [contextId, dimensionMarshal, dragHandleUsageInstructionsId, focusMarshal, getCanLift, getIsMovementAllowed, registry]);
|
42766 |
+
useSensorMarshal({
|
42767 |
+
contextId: contextId,
|
42768 |
+
store: store,
|
42769 |
+
registry: registry,
|
42770 |
+
customSensors: sensors,
|
42771 |
+
enableDefaultSensors: props.enableDefaultSensors !== false
|
42772 |
+
});
|
42773 |
+
(0,react.useEffect)(function () {
|
42774 |
+
return tryResetStore;
|
42775 |
+
}, [tryResetStore]);
|
42776 |
+
return react.createElement(AppContext.Provider, {
|
42777 |
+
value: appContext
|
42778 |
+
}, react.createElement(components_Provider, {
|
42779 |
+
context: StoreContext,
|
42780 |
+
store: store
|
42781 |
+
}, props.children));
|
42782 |
}
|
42783 |
|
42784 |
+
var count$1 = 0;
|
42785 |
+
function reset$1() {
|
42786 |
+
count$1 = 0;
|
42787 |
+
}
|
42788 |
+
function useInstanceCount() {
|
42789 |
+
return useMemo(function () {
|
42790 |
+
return "" + count$1++;
|
42791 |
+
}, []);
|
42792 |
+
}
|
42793 |
|
42794 |
+
function resetServerContext() {
|
42795 |
+
reset$1();
|
42796 |
+
react_beautiful_dnd_esm_reset();
|
42797 |
+
}
|
42798 |
+
function DragDropContext(props) {
|
42799 |
+
var contextId = useInstanceCount();
|
42800 |
+
var dragHandleUsageInstructions = props.dragHandleUsageInstructions || preset.dragHandleUsageInstructions;
|
42801 |
+
return react.createElement(ErrorBoundary, null, function (setCallbacks) {
|
42802 |
+
return react.createElement(App, {
|
42803 |
+
nonce: props.nonce,
|
42804 |
+
contextId: contextId,
|
42805 |
+
setCallbacks: setCallbacks,
|
42806 |
+
dragHandleUsageInstructions: dragHandleUsageInstructions,
|
42807 |
+
enableDefaultSensors: props.enableDefaultSensors,
|
42808 |
+
sensors: props.sensors,
|
42809 |
+
onBeforeCapture: props.onBeforeCapture,
|
42810 |
+
onBeforeDragStart: props.onBeforeDragStart,
|
42811 |
+
onDragStart: props.onDragStart,
|
42812 |
+
onDragUpdate: props.onDragUpdate,
|
42813 |
+
onDragEnd: props.onDragEnd
|
42814 |
+
}, props.children);
|
42815 |
+
});
|
42816 |
+
}
|
42817 |
|
42818 |
+
var isEqual$1 = function isEqual(base) {
|
42819 |
+
return function (value) {
|
42820 |
+
return base === value;
|
42821 |
+
};
|
42822 |
+
};
|
42823 |
|
42824 |
+
var isScroll = isEqual$1('scroll');
|
42825 |
+
var isAuto = isEqual$1('auto');
|
42826 |
+
var isVisible$1 = isEqual$1('visible');
|
|
|
|
|
|
|
|
|
42827 |
|
42828 |
+
var isEither = function isEither(overflow, fn) {
|
42829 |
+
return fn(overflow.overflowX) || fn(overflow.overflowY);
|
42830 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42831 |
|
42832 |
+
var isBoth = function isBoth(overflow, fn) {
|
42833 |
+
return fn(overflow.overflowX) && fn(overflow.overflowY);
|
42834 |
+
};
|
|
|
42835 |
|
42836 |
+
var isElementScrollable = function isElementScrollable(el) {
|
42837 |
+
var style = window.getComputedStyle(el);
|
42838 |
+
var overflow = {
|
42839 |
+
overflowX: style.overflowX,
|
42840 |
+
overflowY: style.overflowY
|
42841 |
+
};
|
42842 |
+
return isEither(overflow, isScroll) || isEither(overflow, isAuto);
|
42843 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42844 |
|
42845 |
+
var isBodyScrollable = function isBodyScrollable() {
|
42846 |
+
if (true) {
|
42847 |
+
return false;
|
42848 |
+
}
|
42849 |
|
42850 |
+
var body = getBodyElement();
|
42851 |
+
var html = document.documentElement;
|
42852 |
+
!html ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42853 |
|
42854 |
+
if (!isElementScrollable(body)) {
|
42855 |
+
return false;
|
42856 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
42857 |
|
42858 |
+
var htmlStyle = window.getComputedStyle(html);
|
42859 |
+
var htmlOverflow = {
|
42860 |
+
overflowX: htmlStyle.overflowX,
|
42861 |
+
overflowY: htmlStyle.overflowY
|
42862 |
+
};
|
42863 |
|
42864 |
+
if (isBoth(htmlOverflow, isVisible$1)) {
|
42865 |
+
return false;
|
42866 |
+
}
|
42867 |
|
42868 |
+
false ? 0 : void 0;
|
42869 |
+
return false;
|
42870 |
+
};
|
42871 |
|
42872 |
+
var getClosestScrollable = function getClosestScrollable(el) {
|
42873 |
+
if (el == null) {
|
42874 |
+
return null;
|
42875 |
+
}
|
42876 |
|
42877 |
+
if (el === document.body) {
|
42878 |
+
return isBodyScrollable() ? el : null;
|
42879 |
+
}
|
|
|
42880 |
|
42881 |
+
if (el === document.documentElement) {
|
42882 |
+
return null;
|
42883 |
+
}
|
42884 |
|
42885 |
+
if (!isElementScrollable(el)) {
|
42886 |
+
return getClosestScrollable(el.parentElement);
|
42887 |
+
}
|
|
|
|
|
42888 |
|
42889 |
+
return el;
|
42890 |
+
};
|
|
|
42891 |
|
42892 |
+
var checkForNestedScrollContainers = (function (scrollable) {
|
42893 |
+
if (!scrollable) {
|
42894 |
+
return;
|
42895 |
+
}
|
|
|
|
|
|
|
42896 |
|
42897 |
+
var anotherScrollParent = getClosestScrollable(scrollable.parentElement);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42898 |
|
42899 |
+
if (!anotherScrollParent) {
|
42900 |
+
return;
|
42901 |
+
}
|
42902 |
|
42903 |
+
false ? 0 : void 0;
|
42904 |
+
});
|
|
|
42905 |
|
42906 |
+
var getScroll$1 = (function (el) {
|
42907 |
+
return {
|
42908 |
+
x: el.scrollLeft,
|
42909 |
+
y: el.scrollTop
|
42910 |
+
};
|
42911 |
+
});
|
42912 |
|
42913 |
+
var getIsFixed = function getIsFixed(el) {
|
42914 |
+
if (!el) {
|
42915 |
+
return false;
|
42916 |
+
}
|
42917 |
|
42918 |
+
var style = window.getComputedStyle(el);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42919 |
|
42920 |
+
if (style.position === 'fixed') {
|
42921 |
+
return true;
|
42922 |
+
}
|
42923 |
|
42924 |
+
return getIsFixed(el.parentElement);
|
42925 |
+
};
|
|
|
42926 |
|
42927 |
+
var getEnv = (function (start) {
|
42928 |
+
var closestScrollable = getClosestScrollable(start);
|
42929 |
+
var isFixedOnPage = getIsFixed(start);
|
42930 |
+
return {
|
42931 |
+
closestScrollable: closestScrollable,
|
42932 |
+
isFixedOnPage: isFixedOnPage
|
42933 |
+
};
|
42934 |
+
});
|
42935 |
|
42936 |
+
var getDroppableDimension = (function (_ref) {
|
42937 |
+
var descriptor = _ref.descriptor,
|
42938 |
+
isEnabled = _ref.isEnabled,
|
42939 |
+
isCombineEnabled = _ref.isCombineEnabled,
|
42940 |
+
isFixedOnPage = _ref.isFixedOnPage,
|
42941 |
+
direction = _ref.direction,
|
42942 |
+
client = _ref.client,
|
42943 |
+
page = _ref.page,
|
42944 |
+
closest = _ref.closest;
|
42945 |
|
42946 |
+
var frame = function () {
|
42947 |
+
if (!closest) {
|
42948 |
+
return null;
|
42949 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42950 |
|
42951 |
+
var scrollSize = closest.scrollSize,
|
42952 |
+
frameClient = closest.client;
|
42953 |
+
var maxScroll = getMaxScroll({
|
42954 |
+
scrollHeight: scrollSize.scrollHeight,
|
42955 |
+
scrollWidth: scrollSize.scrollWidth,
|
42956 |
+
height: frameClient.paddingBox.height,
|
42957 |
+
width: frameClient.paddingBox.width
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42958 |
});
|
42959 |
+
return {
|
42960 |
+
pageMarginBox: closest.page.marginBox,
|
42961 |
+
frameClient: frameClient,
|
42962 |
+
scrollSize: scrollSize,
|
42963 |
+
shouldClipSubject: closest.shouldClipSubject,
|
42964 |
+
scroll: {
|
42965 |
+
initial: closest.scroll,
|
42966 |
+
current: closest.scroll,
|
42967 |
+
max: maxScroll,
|
42968 |
+
diff: {
|
42969 |
+
value: origin,
|
42970 |
+
displacement: origin
|
42971 |
+
}
|
42972 |
}
|
42973 |
};
|
42974 |
+
}();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42975 |
|
42976 |
+
var axis = direction === 'vertical' ? vertical : horizontal;
|
42977 |
+
var subject = getSubject({
|
42978 |
+
page: page,
|
42979 |
+
withPlaceholder: null,
|
42980 |
+
axis: axis,
|
42981 |
+
frame: frame
|
42982 |
});
|
42983 |
+
var dimension = {
|
42984 |
+
descriptor: descriptor,
|
42985 |
+
isCombineEnabled: isCombineEnabled,
|
42986 |
+
isFixedOnPage: isFixedOnPage,
|
42987 |
+
axis: axis,
|
42988 |
+
isEnabled: isEnabled,
|
42989 |
+
client: client,
|
42990 |
+
page: page,
|
42991 |
+
frame: frame,
|
42992 |
+
subject: subject
|
42993 |
+
};
|
42994 |
+
return dimension;
|
42995 |
+
});
|
42996 |
|
42997 |
+
var getClient = function getClient(targetRef, closestScrollable) {
|
42998 |
+
var base = getBox(targetRef);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
42999 |
|
43000 |
+
if (!closestScrollable) {
|
43001 |
+
return base;
|
|
|
43002 |
}
|
43003 |
|
43004 |
+
if (targetRef !== closestScrollable) {
|
43005 |
+
return base;
|
|
|
|
|
43006 |
}
|
43007 |
|
43008 |
+
var top = base.paddingBox.top - closestScrollable.scrollTop;
|
43009 |
+
var left = base.paddingBox.left - closestScrollable.scrollLeft;
|
43010 |
+
var bottom = top + closestScrollable.scrollHeight;
|
43011 |
+
var right = left + closestScrollable.scrollWidth;
|
43012 |
+
var paddingBox = {
|
43013 |
+
top: top,
|
43014 |
+
right: right,
|
43015 |
+
bottom: bottom,
|
43016 |
+
left: left
|
43017 |
+
};
|
43018 |
+
var borderBox = expand(paddingBox, base.border);
|
43019 |
+
var client = createBox({
|
43020 |
+
borderBox: borderBox,
|
43021 |
+
margin: base.margin,
|
43022 |
+
border: base.border,
|
43023 |
+
padding: base.padding
|
43024 |
+
});
|
43025 |
+
return client;
|
43026 |
+
};
|
43027 |
|
43028 |
+
var getDimension = (function (_ref) {
|
43029 |
+
var ref = _ref.ref,
|
43030 |
+
descriptor = _ref.descriptor,
|
43031 |
+
env = _ref.env,
|
43032 |
+
windowScroll = _ref.windowScroll,
|
43033 |
+
direction = _ref.direction,
|
43034 |
+
isDropDisabled = _ref.isDropDisabled,
|
43035 |
+
isCombineEnabled = _ref.isCombineEnabled,
|
43036 |
+
shouldClipSubject = _ref.shouldClipSubject;
|
43037 |
+
var closestScrollable = env.closestScrollable;
|
43038 |
+
var client = getClient(ref, closestScrollable);
|
43039 |
+
var page = withScroll(client, windowScroll);
|
43040 |
|
43041 |
+
var closest = function () {
|
43042 |
+
if (!closestScrollable) {
|
43043 |
+
return null;
|
43044 |
+
}
|
43045 |
|
43046 |
+
var frameClient = getBox(closestScrollable);
|
43047 |
+
var scrollSize = {
|
43048 |
+
scrollHeight: closestScrollable.scrollHeight,
|
43049 |
+
scrollWidth: closestScrollable.scrollWidth
|
43050 |
+
};
|
43051 |
+
return {
|
43052 |
+
client: frameClient,
|
43053 |
+
page: withScroll(frameClient, windowScroll),
|
43054 |
+
scroll: getScroll$1(closestScrollable),
|
43055 |
+
scrollSize: scrollSize,
|
43056 |
+
shouldClipSubject: shouldClipSubject
|
43057 |
+
};
|
43058 |
+
}();
|
43059 |
|
43060 |
+
var dimension = getDroppableDimension({
|
43061 |
+
descriptor: descriptor,
|
43062 |
+
isEnabled: !isDropDisabled,
|
43063 |
+
isCombineEnabled: isCombineEnabled,
|
43064 |
+
isFixedOnPage: env.isFixedOnPage,
|
43065 |
+
direction: direction,
|
43066 |
+
client: client,
|
43067 |
+
page: page,
|
43068 |
+
closest: closest
|
43069 |
+
});
|
43070 |
+
return dimension;
|
43071 |
+
});
|
43072 |
|
43073 |
+
var immediate = {
|
43074 |
+
passive: false
|
43075 |
+
};
|
43076 |
+
var delayed = {
|
43077 |
+
passive: true
|
43078 |
+
};
|
43079 |
+
var getListenerOptions = (function (options) {
|
43080 |
+
return options.shouldPublishImmediately ? immediate : delayed;
|
43081 |
+
});
|
43082 |
|
43083 |
+
function useRequiredContext(Context) {
|
43084 |
+
var result = (0,react.useContext)(Context);
|
43085 |
+
!result ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43086 |
+
return result;
|
43087 |
}
|
43088 |
|
43089 |
+
var getClosestScrollableFromDrag = function getClosestScrollableFromDrag(dragging) {
|
43090 |
+
return dragging && dragging.env.closestScrollable || null;
|
43091 |
+
};
|
43092 |
|
43093 |
+
function useDroppablePublisher(args) {
|
43094 |
+
var whileDraggingRef = (0,react.useRef)(null);
|
43095 |
+
var appContext = useRequiredContext(AppContext);
|
43096 |
+
var uniqueId = useUniqueId('droppable');
|
43097 |
+
var registry = appContext.registry,
|
43098 |
+
marshal = appContext.marshal;
|
43099 |
+
var previousRef = usePrevious(args);
|
43100 |
+
var descriptor = useMemo(function () {
|
43101 |
+
return {
|
43102 |
+
id: args.droppableId,
|
43103 |
+
type: args.type,
|
43104 |
+
mode: args.mode
|
43105 |
+
};
|
43106 |
+
}, [args.droppableId, args.mode, args.type]);
|
43107 |
+
var publishedDescriptorRef = (0,react.useRef)(descriptor);
|
43108 |
+
var memoizedUpdateScroll = useMemo(function () {
|
43109 |
+
return memoize_one_esm(function (x, y) {
|
43110 |
+
!whileDraggingRef.current ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43111 |
+
var scroll = {
|
43112 |
+
x: x,
|
43113 |
+
y: y
|
43114 |
+
};
|
43115 |
+
marshal.updateDroppableScroll(descriptor.id, scroll);
|
43116 |
+
});
|
43117 |
+
}, [descriptor.id, marshal]);
|
43118 |
+
var getClosestScroll = useCallback(function () {
|
43119 |
+
var dragging = whileDraggingRef.current;
|
43120 |
|
43121 |
+
if (!dragging || !dragging.env.closestScrollable) {
|
43122 |
+
return origin;
|
43123 |
+
}
|
43124 |
+
|
43125 |
+
return getScroll$1(dragging.env.closestScrollable);
|
43126 |
+
}, []);
|
43127 |
+
var updateScroll = useCallback(function () {
|
43128 |
+
var scroll = getClosestScroll();
|
43129 |
+
memoizedUpdateScroll(scroll.x, scroll.y);
|
43130 |
+
}, [getClosestScroll, memoizedUpdateScroll]);
|
43131 |
+
var scheduleScrollUpdate = useMemo(function () {
|
43132 |
+
return raf_schd_esm(updateScroll);
|
43133 |
+
}, [updateScroll]);
|
43134 |
+
var onClosestScroll = useCallback(function () {
|
43135 |
+
var dragging = whileDraggingRef.current;
|
43136 |
+
var closest = getClosestScrollableFromDrag(dragging);
|
43137 |
+
!(dragging && closest) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43138 |
+
var options = dragging.scrollOptions;
|
43139 |
+
|
43140 |
+
if (options.shouldPublishImmediately) {
|
43141 |
+
updateScroll();
|
43142 |
+
return;
|
43143 |
+
}
|
43144 |
+
|
43145 |
+
scheduleScrollUpdate();
|
43146 |
+
}, [scheduleScrollUpdate, updateScroll]);
|
43147 |
+
var getDimensionAndWatchScroll = useCallback(function (windowScroll, options) {
|
43148 |
+
!!whileDraggingRef.current ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43149 |
+
var previous = previousRef.current;
|
43150 |
+
var ref = previous.getDroppableRef();
|
43151 |
+
!ref ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43152 |
+
var env = getEnv(ref);
|
43153 |
+
var dragging = {
|
43154 |
+
ref: ref,
|
43155 |
+
descriptor: descriptor,
|
43156 |
+
env: env,
|
43157 |
+
scrollOptions: options
|
43158 |
+
};
|
43159 |
+
whileDraggingRef.current = dragging;
|
43160 |
+
var dimension = getDimension({
|
43161 |
+
ref: ref,
|
43162 |
+
descriptor: descriptor,
|
43163 |
+
env: env,
|
43164 |
+
windowScroll: windowScroll,
|
43165 |
+
direction: previous.direction,
|
43166 |
+
isDropDisabled: previous.isDropDisabled,
|
43167 |
+
isCombineEnabled: previous.isCombineEnabled,
|
43168 |
+
shouldClipSubject: !previous.ignoreContainerClipping
|
43169 |
+
});
|
43170 |
+
var scrollable = env.closestScrollable;
|
43171 |
|
43172 |
+
if (scrollable) {
|
43173 |
+
scrollable.setAttribute(scrollContainer.contextId, appContext.contextId);
|
43174 |
+
scrollable.addEventListener('scroll', onClosestScroll, getListenerOptions(dragging.scrollOptions));
|
43175 |
|
43176 |
+
if (false) {}
|
43177 |
+
}
|
|
|
|
|
|
|
|
|
43178 |
|
43179 |
+
return dimension;
|
43180 |
+
}, [appContext.contextId, descriptor, onClosestScroll, previousRef]);
|
43181 |
+
var getScrollWhileDragging = useCallback(function () {
|
43182 |
+
var dragging = whileDraggingRef.current;
|
43183 |
+
var closest = getClosestScrollableFromDrag(dragging);
|
43184 |
+
!(dragging && closest) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43185 |
+
return getScroll$1(closest);
|
43186 |
+
}, []);
|
43187 |
+
var dragStopped = useCallback(function () {
|
43188 |
+
var dragging = whileDraggingRef.current;
|
43189 |
+
!dragging ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43190 |
+
var closest = getClosestScrollableFromDrag(dragging);
|
43191 |
+
whileDraggingRef.current = null;
|
43192 |
|
43193 |
+
if (!closest) {
|
43194 |
+
return;
|
43195 |
+
}
|
43196 |
|
43197 |
+
scheduleScrollUpdate.cancel();
|
43198 |
+
closest.removeAttribute(scrollContainer.contextId);
|
43199 |
+
closest.removeEventListener('scroll', onClosestScroll, getListenerOptions(dragging.scrollOptions));
|
43200 |
+
}, [onClosestScroll, scheduleScrollUpdate]);
|
43201 |
+
var scroll = useCallback(function (change) {
|
43202 |
+
var dragging = whileDraggingRef.current;
|
43203 |
+
!dragging ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43204 |
+
var closest = getClosestScrollableFromDrag(dragging);
|
43205 |
+
!closest ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43206 |
+
closest.scrollTop += change.y;
|
43207 |
+
closest.scrollLeft += change.x;
|
43208 |
+
}, []);
|
43209 |
+
var callbacks = useMemo(function () {
|
43210 |
+
return {
|
43211 |
+
getDimensionAndWatchScroll: getDimensionAndWatchScroll,
|
43212 |
+
getScrollWhileDragging: getScrollWhileDragging,
|
43213 |
+
dragStopped: dragStopped,
|
43214 |
+
scroll: scroll
|
43215 |
+
};
|
43216 |
+
}, [dragStopped, getDimensionAndWatchScroll, getScrollWhileDragging, scroll]);
|
43217 |
+
var entry = useMemo(function () {
|
43218 |
+
return {
|
43219 |
+
uniqueId: uniqueId,
|
43220 |
+
descriptor: descriptor,
|
43221 |
+
callbacks: callbacks
|
43222 |
+
};
|
43223 |
+
}, [callbacks, descriptor, uniqueId]);
|
43224 |
+
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function () {
|
43225 |
+
publishedDescriptorRef.current = entry.descriptor;
|
43226 |
+
registry.droppable.register(entry);
|
43227 |
+
return function () {
|
43228 |
+
if (whileDraggingRef.current) {
|
43229 |
+
false ? 0 : void 0;
|
43230 |
+
dragStopped();
|
43231 |
+
}
|
43232 |
|
43233 |
+
registry.droppable.unregister(entry);
|
43234 |
+
};
|
43235 |
+
}, [callbacks, descriptor, dragStopped, entry, marshal, registry.droppable]);
|
43236 |
+
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function () {
|
43237 |
+
if (!whileDraggingRef.current) {
|
43238 |
+
return;
|
43239 |
+
}
|
43240 |
|
43241 |
+
marshal.updateDroppableIsEnabled(publishedDescriptorRef.current.id, !args.isDropDisabled);
|
43242 |
+
}, [args.isDropDisabled, marshal]);
|
43243 |
+
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function () {
|
43244 |
+
if (!whileDraggingRef.current) {
|
43245 |
+
return;
|
43246 |
+
}
|
43247 |
|
43248 |
+
marshal.updateDroppableIsCombineEnabled(publishedDescriptorRef.current.id, args.isCombineEnabled);
|
43249 |
+
}, [args.isCombineEnabled, marshal]);
|
43250 |
}
|
43251 |
|
43252 |
+
function noop$2() {}
|
|
|
|
|
|
|
|
|
|
|
|
|
43253 |
|
43254 |
+
var empty = {
|
43255 |
+
width: 0,
|
43256 |
+
height: 0,
|
43257 |
+
margin: react_beautiful_dnd_esm_noSpacing
|
43258 |
+
};
|
43259 |
|
43260 |
+
var getSize = function getSize(_ref) {
|
43261 |
+
var isAnimatingOpenOnMount = _ref.isAnimatingOpenOnMount,
|
43262 |
+
placeholder = _ref.placeholder,
|
43263 |
+
animate = _ref.animate;
|
43264 |
|
43265 |
+
if (isAnimatingOpenOnMount) {
|
43266 |
+
return empty;
|
|
|
43267 |
}
|
43268 |
|
43269 |
+
if (animate === 'close') {
|
43270 |
+
return empty;
|
|
|
|
|
|
|
|
|
|
|
|
|
43271 |
}
|
43272 |
|
43273 |
+
return {
|
43274 |
+
height: placeholder.client.borderBox.height,
|
43275 |
+
width: placeholder.client.borderBox.width,
|
43276 |
+
margin: placeholder.client.margin
|
43277 |
+
};
|
43278 |
+
};
|
43279 |
|
43280 |
+
var getStyle = function getStyle(_ref2) {
|
43281 |
+
var isAnimatingOpenOnMount = _ref2.isAnimatingOpenOnMount,
|
43282 |
+
placeholder = _ref2.placeholder,
|
43283 |
+
animate = _ref2.animate;
|
43284 |
+
var size = getSize({
|
43285 |
+
isAnimatingOpenOnMount: isAnimatingOpenOnMount,
|
43286 |
+
placeholder: placeholder,
|
43287 |
+
animate: animate
|
43288 |
});
|
43289 |
+
return {
|
43290 |
+
display: placeholder.display,
|
43291 |
+
boxSizing: 'border-box',
|
43292 |
+
width: size.width,
|
43293 |
+
height: size.height,
|
43294 |
+
marginTop: size.margin.top,
|
43295 |
+
marginRight: size.margin.right,
|
43296 |
+
marginBottom: size.margin.bottom,
|
43297 |
+
marginLeft: size.margin.left,
|
43298 |
+
flexShrink: '0',
|
43299 |
+
flexGrow: '0',
|
43300 |
+
pointerEvents: 'none',
|
43301 |
+
transition: animate !== 'none' ? react_beautiful_dnd_esm_transitions.placeholder : null
|
43302 |
+
};
|
43303 |
+
};
|
43304 |
|
43305 |
+
function Placeholder(props) {
|
43306 |
+
var animateOpenTimerRef = (0,react.useRef)(null);
|
43307 |
+
var tryClearAnimateOpenTimer = useCallback(function () {
|
43308 |
+
if (!animateOpenTimerRef.current) {
|
43309 |
+
return;
|
43310 |
+
}
|
43311 |
|
43312 |
+
clearTimeout(animateOpenTimerRef.current);
|
43313 |
+
animateOpenTimerRef.current = null;
|
43314 |
+
}, []);
|
43315 |
+
var animate = props.animate,
|
43316 |
+
onTransitionEnd = props.onTransitionEnd,
|
43317 |
+
onClose = props.onClose,
|
43318 |
+
contextId = props.contextId;
|
43319 |
|
43320 |
+
var _useState = (0,react.useState)(props.animate === 'open'),
|
43321 |
+
isAnimatingOpenOnMount = _useState[0],
|
43322 |
+
setIsAnimatingOpenOnMount = _useState[1];
|
43323 |
|
43324 |
+
(0,react.useEffect)(function () {
|
43325 |
+
if (!isAnimatingOpenOnMount) {
|
43326 |
+
return noop$2;
|
43327 |
+
}
|
43328 |
|
43329 |
+
if (animate !== 'open') {
|
43330 |
+
tryClearAnimateOpenTimer();
|
43331 |
+
setIsAnimatingOpenOnMount(false);
|
43332 |
+
return noop$2;
|
43333 |
+
}
|
43334 |
|
43335 |
+
if (animateOpenTimerRef.current) {
|
43336 |
+
return noop$2;
|
|
|
43337 |
}
|
43338 |
|
43339 |
+
animateOpenTimerRef.current = setTimeout(function () {
|
43340 |
+
animateOpenTimerRef.current = null;
|
43341 |
+
setIsAnimatingOpenOnMount(false);
|
43342 |
+
});
|
43343 |
+
return tryClearAnimateOpenTimer;
|
43344 |
+
}, [animate, isAnimatingOpenOnMount, tryClearAnimateOpenTimer]);
|
43345 |
+
var onSizeChangeEnd = useCallback(function (event) {
|
43346 |
+
if (event.propertyName !== 'height') {
|
43347 |
+
return;
|
43348 |
+
}
|
43349 |
|
43350 |
+
onTransitionEnd();
|
43351 |
+
|
43352 |
+
if (animate === 'close') {
|
43353 |
+
onClose();
|
43354 |
}
|
43355 |
+
}, [animate, onClose, onTransitionEnd]);
|
43356 |
+
var style = getStyle({
|
43357 |
+
isAnimatingOpenOnMount: isAnimatingOpenOnMount,
|
43358 |
+
animate: props.animate,
|
43359 |
+
placeholder: props.placeholder
|
43360 |
+
});
|
43361 |
+
return react.createElement(props.placeholder.tagName, {
|
43362 |
+
style: style,
|
43363 |
+
'data-rbd-placeholder-context-id': contextId,
|
43364 |
+
onTransitionEnd: onSizeChangeEnd,
|
43365 |
+
ref: props.innerRef
|
43366 |
+
});
|
43367 |
+
}
|
43368 |
|
43369 |
+
var Placeholder$1 = react.memo(Placeholder);
|
|
|
43370 |
|
43371 |
+
var DroppableContext = react.createContext(null);
|
43372 |
+
|
43373 |
+
function checkIsValidInnerRef(el) {
|
43374 |
+
!(el && isHtmlElement(el)) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43375 |
}
|
43376 |
|
43377 |
+
function isBoolean(value) {
|
43378 |
+
return typeof value === 'boolean';
|
43379 |
+
}
|
|
|
|
|
43380 |
|
43381 |
+
function runChecks(args, checks) {
|
43382 |
+
checks.forEach(function (check) {
|
43383 |
+
return check(args);
|
43384 |
+
});
|
43385 |
+
}
|
43386 |
|
43387 |
+
var shared = [function required(_ref) {
|
43388 |
+
var props = _ref.props;
|
43389 |
+
!props.droppableId ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43390 |
+
!(typeof props.droppableId === 'string') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43391 |
+
}, function _boolean(_ref2) {
|
43392 |
+
var props = _ref2.props;
|
43393 |
+
!isBoolean(props.isDropDisabled) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43394 |
+
!isBoolean(props.isCombineEnabled) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43395 |
+
!isBoolean(props.ignoreContainerClipping) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43396 |
+
}, function ref(_ref3) {
|
43397 |
+
var getDroppableRef = _ref3.getDroppableRef;
|
43398 |
+
checkIsValidInnerRef(getDroppableRef());
|
43399 |
+
}];
|
43400 |
+
var standard = [function placeholder(_ref4) {
|
43401 |
+
var props = _ref4.props,
|
43402 |
+
getPlaceholderRef = _ref4.getPlaceholderRef;
|
43403 |
|
43404 |
+
if (!props.placeholder) {
|
43405 |
+
return;
|
|
|
43406 |
}
|
43407 |
|
43408 |
+
var ref = getPlaceholderRef();
|
|
|
|
|
43409 |
|
43410 |
+
if (ref) {
|
43411 |
+
return;
|
43412 |
}
|
43413 |
|
43414 |
+
false ? 0 : void 0;
|
43415 |
+
}];
|
43416 |
+
var virtual = [function hasClone(_ref5) {
|
43417 |
+
var props = _ref5.props;
|
43418 |
+
!props.renderClone ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43419 |
+
}, function hasNoPlaceholder(_ref6) {
|
43420 |
+
var getPlaceholderRef = _ref6.getPlaceholderRef;
|
43421 |
+
!!getPlaceholderRef() ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43422 |
+
}];
|
43423 |
+
function useValidation(args) {
|
43424 |
+
useDevSetupWarning(function () {
|
43425 |
+
runChecks(args, shared);
|
43426 |
|
43427 |
+
if (args.props.mode === 'standard') {
|
43428 |
+
runChecks(args, standard);
|
43429 |
+
}
|
43430 |
+
|
43431 |
+
if (args.props.mode === 'virtual') {
|
43432 |
+
runChecks(args, virtual);
|
43433 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
43434 |
});
|
43435 |
+
}
|
43436 |
|
43437 |
+
var AnimateInOut = function (_React$PureComponent) {
|
43438 |
+
(0,inheritsLoose/* default */.Z)(AnimateInOut, _React$PureComponent);
|
|
|
43439 |
|
43440 |
+
function AnimateInOut() {
|
43441 |
+
var _this;
|
43442 |
|
43443 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
43444 |
+
args[_key] = arguments[_key];
|
43445 |
+
}
|
|
|
43446 |
|
43447 |
+
_this = _React$PureComponent.call.apply(_React$PureComponent, [this].concat(args)) || this;
|
43448 |
+
_this.state = {
|
43449 |
+
isVisible: Boolean(_this.props.on),
|
43450 |
+
data: _this.props.on,
|
43451 |
+
animate: _this.props.shouldAnimate && _this.props.on ? 'open' : 'none'
|
43452 |
+
};
|
43453 |
|
43454 |
+
_this.onClose = function () {
|
43455 |
+
if (_this.state.animate !== 'close') {
|
43456 |
+
return;
|
43457 |
+
}
|
43458 |
|
43459 |
+
_this.setState({
|
43460 |
+
isVisible: false
|
43461 |
+
});
|
43462 |
+
};
|
43463 |
|
43464 |
+
return _this;
|
|
|
43465 |
}
|
43466 |
|
43467 |
+
AnimateInOut.getDerivedStateFromProps = function getDerivedStateFromProps(props, state) {
|
43468 |
+
if (!props.shouldAnimate) {
|
43469 |
+
return {
|
43470 |
+
isVisible: Boolean(props.on),
|
43471 |
+
data: props.on,
|
43472 |
+
animate: 'none'
|
43473 |
+
};
|
|
|
43474 |
}
|
|
|
43475 |
|
43476 |
+
if (props.on) {
|
43477 |
+
return {
|
43478 |
+
isVisible: true,
|
43479 |
+
data: props.on,
|
43480 |
+
animate: 'open'
|
43481 |
+
};
|
43482 |
}
|
43483 |
|
43484 |
+
if (state.isVisible) {
|
43485 |
+
return {
|
43486 |
+
isVisible: true,
|
43487 |
+
data: state.data,
|
43488 |
+
animate: 'close'
|
43489 |
+
};
|
43490 |
}
|
43491 |
|
43492 |
+
return {
|
43493 |
+
isVisible: false,
|
43494 |
+
animate: 'close',
|
43495 |
+
data: null
|
43496 |
+
};
|
43497 |
+
};
|
43498 |
|
43499 |
+
var _proto = AnimateInOut.prototype;
|
|
|
|
|
|
|
|
|
|
|
43500 |
|
43501 |
+
_proto.render = function render() {
|
43502 |
+
if (!this.state.isVisible) {
|
43503 |
+
return null;
|
43504 |
+
}
|
43505 |
|
43506 |
+
var provided = {
|
43507 |
+
onClose: this.onClose,
|
43508 |
+
data: this.state.data,
|
43509 |
+
animate: this.state.animate
|
43510 |
+
};
|
43511 |
+
return this.props.children(provided);
|
43512 |
+
};
|
|
|
|
|
|
|
|
|
|
|
43513 |
|
43514 |
+
return AnimateInOut;
|
43515 |
+
}(react.PureComponent);
|
|
|
|
|
|
|
43516 |
|
43517 |
+
var zIndexOptions = {
|
43518 |
+
dragging: 5000,
|
43519 |
+
dropAnimating: 4500
|
43520 |
+
};
|
43521 |
+
|
43522 |
+
var getDraggingTransition = function getDraggingTransition(shouldAnimateDragMovement, dropping) {
|
43523 |
+
if (dropping) {
|
43524 |
+
return react_beautiful_dnd_esm_transitions.drop(dropping.duration);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43525 |
}
|
43526 |
|
43527 |
+
if (shouldAnimateDragMovement) {
|
43528 |
+
return react_beautiful_dnd_esm_transitions.snap;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43529 |
}
|
43530 |
|
43531 |
+
return react_beautiful_dnd_esm_transitions.fluid;
|
43532 |
+
};
|
43533 |
+
|
43534 |
+
var getDraggingOpacity = function getDraggingOpacity(isCombining, isDropAnimating) {
|
43535 |
+
if (!isCombining) {
|
43536 |
+
return null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43537 |
}
|
43538 |
|
43539 |
+
return isDropAnimating ? combine.opacity.drop : combine.opacity.combining;
|
43540 |
+
};
|
|
|
|
|
|
|
|
|
|
|
43541 |
|
43542 |
+
var getShouldDraggingAnimate = function getShouldDraggingAnimate(dragging) {
|
43543 |
+
if (dragging.forceShouldAnimate != null) {
|
43544 |
+
return dragging.forceShouldAnimate;
|
43545 |
}
|
43546 |
|
43547 |
+
return dragging.mode === 'SNAP';
|
43548 |
+
};
|
43549 |
+
|
43550 |
+
function getDraggingStyle(dragging) {
|
43551 |
+
var dimension = dragging.dimension;
|
43552 |
+
var box = dimension.client;
|
43553 |
+
var offset = dragging.offset,
|
43554 |
+
combineWith = dragging.combineWith,
|
43555 |
+
dropping = dragging.dropping;
|
43556 |
+
var isCombining = Boolean(combineWith);
|
43557 |
+
var shouldAnimate = getShouldDraggingAnimate(dragging);
|
43558 |
+
var isDropAnimating = Boolean(dropping);
|
43559 |
+
var transform = isDropAnimating ? transforms.drop(offset, isCombining) : transforms.moveTo(offset);
|
43560 |
+
var style = {
|
43561 |
+
position: 'fixed',
|
43562 |
+
top: box.marginBox.top,
|
43563 |
+
left: box.marginBox.left,
|
43564 |
+
boxSizing: 'border-box',
|
43565 |
+
width: box.borderBox.width,
|
43566 |
+
height: box.borderBox.height,
|
43567 |
+
transition: getDraggingTransition(shouldAnimate, dropping),
|
43568 |
+
transform: transform,
|
43569 |
+
opacity: getDraggingOpacity(isCombining, isDropAnimating),
|
43570 |
+
zIndex: isDropAnimating ? zIndexOptions.dropAnimating : zIndexOptions.dragging,
|
43571 |
+
pointerEvents: 'none'
|
43572 |
};
|
43573 |
+
return style;
|
43574 |
}
|
43575 |
|
43576 |
+
function getSecondaryStyle(secondary) {
|
43577 |
+
return {
|
43578 |
+
transform: transforms.moveTo(secondary.offset),
|
43579 |
+
transition: secondary.shouldAnimateDisplacement ? null : 'none'
|
43580 |
+
};
|
43581 |
+
}
|
43582 |
+
|
43583 |
+
function getStyle$1(mapped) {
|
43584 |
+
return mapped.type === 'DRAGGING' ? getDraggingStyle(mapped) : getSecondaryStyle(mapped);
|
43585 |
+
}
|
43586 |
+
|
43587 |
+
function getDimension$1(descriptor, el, windowScroll) {
|
43588 |
+
if (windowScroll === void 0) {
|
43589 |
+
windowScroll = origin;
|
43590 |
+
}
|
43591 |
+
|
43592 |
+
var computedStyles = window.getComputedStyle(el);
|
43593 |
+
var borderBox = el.getBoundingClientRect();
|
43594 |
+
var client = calculateBox(borderBox, computedStyles);
|
43595 |
+
var page = withScroll(client, windowScroll);
|
43596 |
+
var placeholder = {
|
43597 |
+
client: client,
|
43598 |
+
tagName: el.tagName.toLowerCase(),
|
43599 |
+
display: computedStyles.display
|
43600 |
+
};
|
43601 |
+
var displaceBy = {
|
43602 |
+
x: client.marginBox.width,
|
43603 |
+
y: client.marginBox.height
|
43604 |
+
};
|
43605 |
+
var dimension = {
|
43606 |
+
descriptor: descriptor,
|
43607 |
+
placeholder: placeholder,
|
43608 |
+
displaceBy: displaceBy,
|
43609 |
+
client: client,
|
43610 |
+
page: page
|
43611 |
+
};
|
43612 |
+
return dimension;
|
43613 |
+
}
|
43614 |
+
|
43615 |
+
function useDraggablePublisher(args) {
|
43616 |
+
var uniqueId = useUniqueId('draggable');
|
43617 |
+
var descriptor = args.descriptor,
|
43618 |
+
registry = args.registry,
|
43619 |
+
getDraggableRef = args.getDraggableRef,
|
43620 |
+
canDragInteractiveElements = args.canDragInteractiveElements,
|
43621 |
+
shouldRespectForcePress = args.shouldRespectForcePress,
|
43622 |
+
isEnabled = args.isEnabled;
|
43623 |
+
var options = useMemo(function () {
|
43624 |
+
return {
|
43625 |
+
canDragInteractiveElements: canDragInteractiveElements,
|
43626 |
+
shouldRespectForcePress: shouldRespectForcePress,
|
43627 |
+
isEnabled: isEnabled
|
43628 |
+
};
|
43629 |
+
}, [canDragInteractiveElements, isEnabled, shouldRespectForcePress]);
|
43630 |
+
var getDimension = useCallback(function (windowScroll) {
|
43631 |
+
var el = getDraggableRef();
|
43632 |
+
!el ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43633 |
+
return getDimension$1(descriptor, el, windowScroll);
|
43634 |
+
}, [descriptor, getDraggableRef]);
|
43635 |
+
var entry = useMemo(function () {
|
43636 |
+
return {
|
43637 |
+
uniqueId: uniqueId,
|
43638 |
+
descriptor: descriptor,
|
43639 |
+
options: options,
|
43640 |
+
getDimension: getDimension
|
43641 |
+
};
|
43642 |
+
}, [descriptor, getDimension, options, uniqueId]);
|
43643 |
+
var publishedRef = (0,react.useRef)(entry);
|
43644 |
+
var isFirstPublishRef = (0,react.useRef)(true);
|
43645 |
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function () {
|
43646 |
+
registry.draggable.register(publishedRef.current);
|
43647 |
+
return function () {
|
43648 |
+
return registry.draggable.unregister(publishedRef.current);
|
43649 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43650 |
}, [registry.draggable]);
|
43651 |
+
react_beautiful_dnd_esm_useIsomorphicLayoutEffect(function () {
|
43652 |
+
if (isFirstPublishRef.current) {
|
43653 |
+
isFirstPublishRef.current = false;
|
43654 |
return;
|
43655 |
}
|
43656 |
|
43657 |
+
var last = publishedRef.current;
|
43658 |
+
publishedRef.current = entry;
|
43659 |
+
registry.draggable.update(entry, last);
|
43660 |
+
}, [entry, registry.draggable]);
|
43661 |
+
}
|
43662 |
|
43663 |
+
function useValidation$1(props, contextId, getRef) {
|
43664 |
+
useDevSetupWarning(function () {
|
43665 |
+
function prefix(id) {
|
43666 |
+
return "Draggable[id: " + id + "]: ";
|
43667 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43668 |
|
43669 |
+
var id = props.draggableId;
|
43670 |
+
!id ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43671 |
+
!(typeof id === 'string') ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43672 |
+
!isInteger(props.index) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43673 |
|
43674 |
+
if (props.mapped.type === 'DRAGGING') {
|
43675 |
+
return;
|
43676 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
43677 |
|
43678 |
+
checkIsValidInnerRef(getRef());
|
|
|
|
|
|
|
43679 |
|
43680 |
+
if (props.isEnabled) {
|
43681 |
+
!findDragHandle(contextId, id) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43682 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43683 |
});
|
43684 |
+
}
|
43685 |
+
function useClonePropValidation(isClone) {
|
43686 |
+
useDev(function () {
|
43687 |
+
var initialRef = (0,react.useRef)(isClone);
|
43688 |
+
useDevSetupWarning(function () {
|
43689 |
+
!(isClone === initialRef.current) ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
43690 |
+
}, [isClone]);
|
43691 |
+
});
|
43692 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43693 |
|
43694 |
+
function preventHtml5Dnd(event) {
|
43695 |
+
event.preventDefault();
|
43696 |
+
}
|
|
|
43697 |
|
43698 |
+
function Draggable(props) {
|
43699 |
+
var ref = (0,react.useRef)(null);
|
43700 |
+
var setRef = useCallback(function (el) {
|
43701 |
+
ref.current = el;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43702 |
}, []);
|
43703 |
+
var getRef = useCallback(function () {
|
43704 |
+
return ref.current;
|
43705 |
}, []);
|
43706 |
+
|
43707 |
+
var _useRequiredContext = useRequiredContext(AppContext),
|
43708 |
+
contextId = _useRequiredContext.contextId,
|
43709 |
+
dragHandleUsageInstructionsId = _useRequiredContext.dragHandleUsageInstructionsId,
|
43710 |
+
registry = _useRequiredContext.registry;
|
43711 |
+
|
43712 |
+
var _useRequiredContext2 = useRequiredContext(DroppableContext),
|
43713 |
+
type = _useRequiredContext2.type,
|
43714 |
+
droppableId = _useRequiredContext2.droppableId;
|
43715 |
+
|
43716 |
+
var descriptor = useMemo(function () {
|
43717 |
return {
|
43718 |
+
id: props.draggableId,
|
43719 |
+
index: props.index,
|
43720 |
+
type: type,
|
43721 |
+
droppableId: droppableId
|
|
|
|
|
|
|
43722 |
};
|
43723 |
+
}, [props.draggableId, props.index, type, droppableId]);
|
43724 |
+
var children = props.children,
|
43725 |
+
draggableId = props.draggableId,
|
43726 |
+
isEnabled = props.isEnabled,
|
43727 |
+
shouldRespectForcePress = props.shouldRespectForcePress,
|
43728 |
+
canDragInteractiveElements = props.canDragInteractiveElements,
|
43729 |
+
isClone = props.isClone,
|
43730 |
+
mapped = props.mapped,
|
43731 |
+
dropAnimationFinishedAction = props.dropAnimationFinished;
|
43732 |
+
useValidation$1(props, contextId, getRef);
|
43733 |
+
useClonePropValidation(isClone);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
43734 |
|
43735 |
+
if (!isClone) {
|
43736 |
+
var forPublisher = useMemo(function () {
|
43737 |
+
return {
|
43738 |
+
descriptor: descriptor,
|
43739 |
+
registry: registry,
|
43740 |
+
getDraggableRef: getRef,
|
43741 |
+
canDragInteractiveElements: canDragInteractiveElements,
|
43742 |
+
shouldRespectForcePress: shouldRespectForcePress,
|
43743 |
+
isEnabled: isEnabled
|
43744 |
+
};
|
43745 |
+
}, [descriptor, registry, getRef, canDragInteractiveElements, shouldRespectForcePress, isEnabled]);
|
43746 |
+
useDraggablePublisher(forPublisher);
|
43747 |
+
}
|
43748 |
|
43749 |
+
var dragHandleProps = useMemo(function () {
|
43750 |
+
return isEnabled ? {
|
43751 |
+
tabIndex: 0,
|
43752 |
+
role: 'button',
|
43753 |
+
'aria-describedby': dragHandleUsageInstructionsId,
|
43754 |
+
'data-rbd-drag-handle-draggable-id': draggableId,
|
43755 |
+
'data-rbd-drag-handle-context-id': contextId,
|
43756 |
+
draggable: false,
|
43757 |
+
onDragStart: preventHtml5Dnd
|
43758 |
+
} : null;
|
43759 |
+
}, [contextId, dragHandleUsageInstructionsId, draggableId, isEnabled]);
|
43760 |
+
var onMoveEnd = useCallback(function (event) {
|
43761 |
+
if (mapped.type !== 'DRAGGING') {
|
43762 |
+
return;
|
43763 |
+
}
|
43764 |
+
|
43765 |
+
if (!mapped.dropping) {
|
43766 |
+
return;
|
43767 |
+
}
|
43768 |
+
|
43769 |
+
if (event.propertyName !== 'transform') {
|
43770 |
+
return;
|
43771 |
+
}
|
43772 |
+
|
43773 |
+
dropAnimationFinishedAction();
|
43774 |
+
}, [dropAnimationFinishedAction, mapped]);
|
43775 |
+
var provided = useMemo(function () {
|
43776 |
+
var style = getStyle$1(mapped);
|
43777 |
+
var onTransitionEnd = mapped.type === 'DRAGGING' && mapped.dropping ? onMoveEnd : null;
|
43778 |
+
var result = {
|
43779 |
+
innerRef: setRef,
|
43780 |
+
draggableProps: {
|
43781 |
+
'data-rbd-draggable-context-id': contextId,
|
43782 |
+
'data-rbd-draggable-id': draggableId,
|
43783 |
+
style: style,
|
43784 |
+
onTransitionEnd: onTransitionEnd
|
43785 |
+
},
|
43786 |
+
dragHandleProps: dragHandleProps
|
43787 |
+
};
|
43788 |
+
return result;
|
43789 |
+
}, [contextId, dragHandleProps, draggableId, mapped, onMoveEnd, setRef]);
|
43790 |
+
var rubric = useMemo(function () {
|
43791 |
+
return {
|
43792 |
+
draggableId: descriptor.id,
|
43793 |
+
type: descriptor.type,
|
43794 |
+
source: {
|
43795 |
+
index: descriptor.index,
|
43796 |
+
droppableId: descriptor.droppableId
|
43797 |
+
}
|
43798 |
+
};
|
43799 |
+
}, [descriptor.droppableId, descriptor.id, descriptor.index, descriptor.type]);
|
43800 |
+
return children(provided, mapped.snapshot, rubric);
|
43801 |
}
|
43802 |
|
43803 |
+
var isStrictEqual = (function (a, b) {
|
43804 |
+
return a === b;
|
43805 |
+
});
|
|
|
|
|
43806 |
|
43807 |
+
var whatIsDraggedOverFromResult = (function (result) {
|
43808 |
+
var combine = result.combine,
|
43809 |
+
destination = result.destination;
|
43810 |
|
43811 |
+
if (destination) {
|
43812 |
+
return destination.droppableId;
|
43813 |
+
}
|
43814 |
|
43815 |
+
if (combine) {
|
43816 |
+
return combine.droppableId;
|
43817 |
+
}
|
43818 |
+
|
43819 |
+
return null;
|
43820 |
+
});
|
43821 |
+
|
43822 |
+
var getCombineWithFromResult = function getCombineWithFromResult(result) {
|
43823 |
+
return result.combine ? result.combine.draggableId : null;
|
43824 |
};
|
43825 |
|
43826 |
+
var getCombineWithFromImpact = function getCombineWithFromImpact(impact) {
|
43827 |
+
return impact.at && impact.at.type === 'COMBINE' ? impact.at.combine.draggableId : null;
|
|
|
|
|
|
|
|
|
|
|
43828 |
};
|
43829 |
|
43830 |
+
function getDraggableSelector() {
|
43831 |
+
var memoizedOffset = memoize_one_esm(function (x, y) {
|
43832 |
+
return {
|
43833 |
+
x: x,
|
43834 |
+
y: y
|
43835 |
+
};
|
43836 |
+
});
|
43837 |
+
var getMemoizedSnapshot = memoize_one_esm(function (mode, isClone, draggingOver, combineWith, dropping) {
|
43838 |
+
return {
|
43839 |
+
isDragging: true,
|
43840 |
+
isClone: isClone,
|
43841 |
+
isDropAnimating: Boolean(dropping),
|
43842 |
+
dropAnimation: dropping,
|
43843 |
+
mode: mode,
|
43844 |
+
draggingOver: draggingOver,
|
43845 |
+
combineWith: combineWith,
|
43846 |
+
combineTargetFor: null
|
43847 |
+
};
|
43848 |
+
});
|
43849 |
+
var getMemoizedProps = memoize_one_esm(function (offset, mode, dimension, isClone, draggingOver, combineWith, forceShouldAnimate) {
|
43850 |
+
return {
|
43851 |
+
mapped: {
|
43852 |
+
type: 'DRAGGING',
|
43853 |
+
dropping: null,
|
43854 |
+
draggingOver: draggingOver,
|
43855 |
+
combineWith: combineWith,
|
43856 |
+
mode: mode,
|
43857 |
+
offset: offset,
|
43858 |
+
dimension: dimension,
|
43859 |
+
forceShouldAnimate: forceShouldAnimate,
|
43860 |
+
snapshot: getMemoizedSnapshot(mode, isClone, draggingOver, combineWith, null)
|
43861 |
+
}
|
43862 |
+
};
|
43863 |
+
});
|
43864 |
|
43865 |
+
var selector = function selector(state, ownProps) {
|
43866 |
+
if (state.isDragging) {
|
43867 |
+
if (state.critical.draggable.id !== ownProps.draggableId) {
|
43868 |
+
return null;
|
43869 |
+
}
|
43870 |
|
43871 |
+
var offset = state.current.client.offset;
|
43872 |
+
var dimension = state.dimensions.draggables[ownProps.draggableId];
|
43873 |
+
var draggingOver = whatIsDraggedOver(state.impact);
|
43874 |
+
var combineWith = getCombineWithFromImpact(state.impact);
|
43875 |
+
var forceShouldAnimate = state.forceShouldAnimate;
|
43876 |
+
return getMemoizedProps(memoizedOffset(offset.x, offset.y), state.movementMode, dimension, ownProps.isClone, draggingOver, combineWith, forceShouldAnimate);
|
43877 |
+
}
|
43878 |
|
43879 |
+
if (state.phase === 'DROP_ANIMATING') {
|
43880 |
+
var completed = state.completed;
|
|
|
|
|
|
|
43881 |
|
43882 |
+
if (completed.result.draggableId !== ownProps.draggableId) {
|
43883 |
+
return null;
|
43884 |
+
}
|
43885 |
|
43886 |
+
var isClone = ownProps.isClone;
|
43887 |
+
var _dimension = state.dimensions.draggables[ownProps.draggableId];
|
43888 |
+
var result = completed.result;
|
43889 |
+
var mode = result.mode;
|
43890 |
|
43891 |
+
var _draggingOver = whatIsDraggedOverFromResult(result);
|
|
|
|
|
|
|
43892 |
|
43893 |
+
var _combineWith = getCombineWithFromResult(result);
|
43894 |
+
|
43895 |
+
var duration = state.dropDuration;
|
43896 |
+
var dropping = {
|
43897 |
+
duration: duration,
|
43898 |
+
curve: curves.drop,
|
43899 |
+
moveTo: state.newHomeClientOffset,
|
43900 |
+
opacity: _combineWith ? combine.opacity.drop : null,
|
43901 |
+
scale: _combineWith ? combine.scale.drop : null
|
43902 |
+
};
|
43903 |
+
return {
|
43904 |
+
mapped: {
|
43905 |
+
type: 'DRAGGING',
|
43906 |
+
offset: state.newHomeClientOffset,
|
43907 |
+
dimension: _dimension,
|
43908 |
+
dropping: dropping,
|
43909 |
+
draggingOver: _draggingOver,
|
43910 |
+
combineWith: _combineWith,
|
43911 |
+
mode: mode,
|
43912 |
+
forceShouldAnimate: null,
|
43913 |
+
snapshot: getMemoizedSnapshot(mode, isClone, _draggingOver, _combineWith, dropping)
|
43914 |
+
}
|
43915 |
+
};
|
43916 |
+
}
|
43917 |
|
|
|
43918 |
return null;
|
43919 |
+
};
|
43920 |
|
43921 |
+
return selector;
|
43922 |
+
}
|
|
|
43923 |
|
43924 |
+
function getSecondarySnapshot(combineTargetFor) {
|
43925 |
+
return {
|
43926 |
+
isDragging: false,
|
43927 |
+
isDropAnimating: false,
|
43928 |
+
isClone: false,
|
43929 |
+
dropAnimation: null,
|
43930 |
+
mode: null,
|
43931 |
+
draggingOver: null,
|
43932 |
+
combineTargetFor: combineTargetFor,
|
43933 |
+
combineWith: null
|
43934 |
+
};
|
43935 |
+
}
|
43936 |
|
43937 |
+
var atRest = {
|
43938 |
+
mapped: {
|
43939 |
+
type: 'SECONDARY',
|
43940 |
+
offset: origin,
|
43941 |
+
combineTargetFor: null,
|
43942 |
+
shouldAnimateDisplacement: true,
|
43943 |
+
snapshot: getSecondarySnapshot(null)
|
43944 |
}
|
43945 |
+
};
|
43946 |
|
43947 |
+
function getSecondarySelector() {
|
43948 |
+
var memoizedOffset = memoize_one_esm(function (x, y) {
|
43949 |
+
return {
|
43950 |
+
x: x,
|
43951 |
+
y: y
|
43952 |
+
};
|
43953 |
+
});
|
43954 |
+
var getMemoizedSnapshot = memoize_one_esm(getSecondarySnapshot);
|
43955 |
+
var getMemoizedProps = memoize_one_esm(function (offset, combineTargetFor, shouldAnimateDisplacement) {
|
43956 |
+
if (combineTargetFor === void 0) {
|
43957 |
+
combineTargetFor = null;
|
43958 |
+
}
|
43959 |
|
43960 |
+
return {
|
43961 |
+
mapped: {
|
43962 |
+
type: 'SECONDARY',
|
43963 |
+
offset: offset,
|
43964 |
+
combineTargetFor: combineTargetFor,
|
43965 |
+
shouldAnimateDisplacement: shouldAnimateDisplacement,
|
43966 |
+
snapshot: getMemoizedSnapshot(combineTargetFor)
|
43967 |
+
}
|
43968 |
+
};
|
43969 |
+
});
|
43970 |
|
43971 |
+
var getFallback = function getFallback(combineTargetFor) {
|
43972 |
+
return combineTargetFor ? getMemoizedProps(origin, combineTargetFor, true) : null;
|
|
|
|
|
43973 |
};
|
|
|
43974 |
|
43975 |
+
var getProps = function getProps(ownId, draggingId, impact, afterCritical) {
|
43976 |
+
var visualDisplacement = impact.displaced.visible[ownId];
|
43977 |
+
var isAfterCriticalInVirtualList = Boolean(afterCritical.inVirtualList && afterCritical.effected[ownId]);
|
43978 |
+
var combine = tryGetCombine(impact);
|
43979 |
+
var combineTargetFor = combine && combine.draggableId === ownId ? draggingId : null;
|
43980 |
|
43981 |
+
if (!visualDisplacement) {
|
43982 |
+
if (!isAfterCriticalInVirtualList) {
|
43983 |
+
return getFallback(combineTargetFor);
|
43984 |
+
}
|
43985 |
|
43986 |
+
if (impact.displaced.invisible[ownId]) {
|
43987 |
+
return null;
|
43988 |
+
}
|
43989 |
|
43990 |
+
var change = negate(afterCritical.displacedBy.point);
|
|
|
43991 |
|
43992 |
+
var _offset = memoizedOffset(change.x, change.y);
|
43993 |
+
|
43994 |
+
return getMemoizedProps(_offset, combineTargetFor, true);
|
43995 |
+
}
|
43996 |
+
|
43997 |
+
if (isAfterCriticalInVirtualList) {
|
43998 |
+
return getFallback(combineTargetFor);
|
43999 |
+
}
|
44000 |
+
|
44001 |
+
var displaceBy = impact.displacedBy.point;
|
44002 |
+
var offset = memoizedOffset(displaceBy.x, displaceBy.y);
|
44003 |
+
return getMemoizedProps(offset, combineTargetFor, visualDisplacement.shouldAnimate);
|
44004 |
};
|
|
|
44005 |
|
44006 |
+
var selector = function selector(state, ownProps) {
|
44007 |
+
if (state.isDragging) {
|
44008 |
+
if (state.critical.draggable.id === ownProps.draggableId) {
|
44009 |
+
return null;
|
44010 |
+
}
|
|
|
|
|
|
|
|
|
44011 |
|
44012 |
+
return getProps(ownProps.draggableId, state.critical.draggable.id, state.impact, state.afterCritical);
|
|
|
|
|
44013 |
}
|
44014 |
|
44015 |
+
if (state.phase === 'DROP_ANIMATING') {
|
44016 |
+
var completed = state.completed;
|
44017 |
+
|
44018 |
+
if (completed.result.draggableId === ownProps.draggableId) {
|
44019 |
+
return null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44020 |
}
|
|
|
|
|
44021 |
|
44022 |
+
return getProps(ownProps.draggableId, completed.result.draggableId, completed.impact, completed.afterCritical);
|
44023 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44024 |
|
44025 |
+
return null;
|
44026 |
+
};
|
44027 |
|
44028 |
+
return selector;
|
44029 |
+
}
|
|
|
44030 |
|
44031 |
+
var makeMapStateToProps = function makeMapStateToProps() {
|
44032 |
+
var draggingSelector = getDraggableSelector();
|
44033 |
+
var secondarySelector = getSecondarySelector();
|
44034 |
|
44035 |
+
var selector = function selector(state, ownProps) {
|
44036 |
+
return draggingSelector(state, ownProps) || secondarySelector(state, ownProps) || atRest;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44037 |
};
|
44038 |
+
|
44039 |
+
return selector;
|
|
|
|
|
|
|
|
|
|
|
|
|
44040 |
};
|
44041 |
+
var react_beautiful_dnd_esm_mapDispatchToProps = {
|
44042 |
+
dropAnimationFinished: dropAnimationFinished
|
44043 |
+
};
|
44044 |
+
var ConnectedDraggable = connect(makeMapStateToProps, react_beautiful_dnd_esm_mapDispatchToProps, null, {
|
44045 |
+
context: StoreContext,
|
44046 |
+
pure: true,
|
44047 |
+
areStatePropsEqual: isStrictEqual
|
44048 |
+
})(Draggable);
|
44049 |
|
44050 |
+
function PrivateDraggable(props) {
|
44051 |
+
var droppableContext = useRequiredContext(DroppableContext);
|
44052 |
+
var isUsingCloneFor = droppableContext.isUsingCloneFor;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44053 |
|
44054 |
+
if (isUsingCloneFor === props.draggableId && !props.isClone) {
|
44055 |
+
return null;
|
44056 |
+
}
|
|
|
44057 |
|
44058 |
+
return react.createElement(ConnectedDraggable, props);
|
44059 |
+
}
|
44060 |
+
function PublicDraggable(props) {
|
44061 |
+
var isEnabled = typeof props.isDragDisabled === 'boolean' ? !props.isDragDisabled : true;
|
44062 |
+
var canDragInteractiveElements = Boolean(props.disableInteractiveElementBlocking);
|
44063 |
+
var shouldRespectForcePress = Boolean(props.shouldRespectForcePress);
|
44064 |
+
return react.createElement(PrivateDraggable, (0,esm_extends/* default */.Z)({}, props, {
|
44065 |
+
isClone: false,
|
44066 |
+
isEnabled: isEnabled,
|
44067 |
+
canDragInteractiveElements: canDragInteractiveElements,
|
44068 |
+
shouldRespectForcePress: shouldRespectForcePress
|
44069 |
+
}));
|
44070 |
+
}
|
44071 |
+
|
44072 |
+
function Droppable(props) {
|
44073 |
+
var appContext = (0,react.useContext)(AppContext);
|
44074 |
+
!appContext ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
44075 |
+
var contextId = appContext.contextId,
|
44076 |
+
isMovementAllowed = appContext.isMovementAllowed;
|
44077 |
+
var droppableRef = (0,react.useRef)(null);
|
44078 |
+
var placeholderRef = (0,react.useRef)(null);
|
44079 |
+
var children = props.children,
|
44080 |
+
droppableId = props.droppableId,
|
44081 |
+
type = props.type,
|
44082 |
+
mode = props.mode,
|
44083 |
+
direction = props.direction,
|
44084 |
+
ignoreContainerClipping = props.ignoreContainerClipping,
|
44085 |
+
isDropDisabled = props.isDropDisabled,
|
44086 |
+
isCombineEnabled = props.isCombineEnabled,
|
44087 |
+
snapshot = props.snapshot,
|
44088 |
+
useClone = props.useClone,
|
44089 |
+
updateViewportMaxScroll = props.updateViewportMaxScroll,
|
44090 |
+
getContainerForClone = props.getContainerForClone;
|
44091 |
+
var getDroppableRef = useCallback(function () {
|
44092 |
+
return droppableRef.current;
|
44093 |
+
}, []);
|
44094 |
+
var setDroppableRef = useCallback(function (value) {
|
44095 |
+
droppableRef.current = value;
|
44096 |
+
}, []);
|
44097 |
+
var getPlaceholderRef = useCallback(function () {
|
44098 |
+
return placeholderRef.current;
|
44099 |
+
}, []);
|
44100 |
+
var setPlaceholderRef = useCallback(function (value) {
|
44101 |
+
placeholderRef.current = value;
|
44102 |
+
}, []);
|
44103 |
+
useValidation({
|
44104 |
+
props: props,
|
44105 |
+
getDroppableRef: getDroppableRef,
|
44106 |
+
getPlaceholderRef: getPlaceholderRef
|
44107 |
+
});
|
44108 |
+
var onPlaceholderTransitionEnd = useCallback(function () {
|
44109 |
+
if (isMovementAllowed()) {
|
44110 |
+
updateViewportMaxScroll({
|
44111 |
+
maxScroll: getMaxWindowScroll()
|
44112 |
+
});
|
44113 |
+
}
|
44114 |
+
}, [isMovementAllowed, updateViewportMaxScroll]);
|
44115 |
+
useDroppablePublisher({
|
44116 |
+
droppableId: droppableId,
|
44117 |
+
type: type,
|
44118 |
+
mode: mode,
|
44119 |
+
direction: direction,
|
44120 |
+
isDropDisabled: isDropDisabled,
|
44121 |
+
isCombineEnabled: isCombineEnabled,
|
44122 |
+
ignoreContainerClipping: ignoreContainerClipping,
|
44123 |
+
getDroppableRef: getDroppableRef
|
44124 |
+
});
|
44125 |
+
var placeholder = react.createElement(AnimateInOut, {
|
44126 |
+
on: props.placeholder,
|
44127 |
+
shouldAnimate: props.shouldAnimatePlaceholder
|
44128 |
+
}, function (_ref) {
|
44129 |
+
var onClose = _ref.onClose,
|
44130 |
+
data = _ref.data,
|
44131 |
+
animate = _ref.animate;
|
44132 |
+
return react.createElement(Placeholder$1, {
|
44133 |
+
placeholder: data,
|
44134 |
+
onClose: onClose,
|
44135 |
+
innerRef: setPlaceholderRef,
|
44136 |
+
animate: animate,
|
44137 |
+
contextId: contextId,
|
44138 |
+
onTransitionEnd: onPlaceholderTransitionEnd
|
44139 |
+
});
|
44140 |
+
});
|
44141 |
+
var provided = useMemo(function () {
|
44142 |
+
return {
|
44143 |
+
innerRef: setDroppableRef,
|
44144 |
+
placeholder: placeholder,
|
44145 |
+
droppableProps: {
|
44146 |
+
'data-rbd-droppable-id': droppableId,
|
44147 |
+
'data-rbd-droppable-context-id': contextId
|
44148 |
+
}
|
44149 |
};
|
44150 |
+
}, [contextId, droppableId, placeholder, setDroppableRef]);
|
44151 |
+
var isUsingCloneFor = useClone ? useClone.dragging.draggableId : null;
|
44152 |
+
var droppableContext = useMemo(function () {
|
44153 |
return {
|
44154 |
+
droppableId: droppableId,
|
44155 |
+
type: type,
|
44156 |
+
isUsingCloneFor: isUsingCloneFor
|
|
|
|
|
44157 |
};
|
44158 |
+
}, [droppableId, isUsingCloneFor, type]);
|
44159 |
+
|
44160 |
+
function getClone() {
|
44161 |
+
if (!useClone) {
|
44162 |
+
return null;
|
44163 |
+
}
|
44164 |
+
|
44165 |
+
var dragging = useClone.dragging,
|
44166 |
+
render = useClone.render;
|
44167 |
+
var node = react.createElement(PrivateDraggable, {
|
44168 |
+
draggableId: dragging.draggableId,
|
44169 |
+
index: dragging.source.index,
|
44170 |
+
isClone: true,
|
44171 |
+
isEnabled: true,
|
44172 |
+
shouldRespectForcePress: false,
|
44173 |
+
canDragInteractiveElements: true
|
44174 |
+
}, function (draggableProvided, draggableSnapshot) {
|
44175 |
+
return render(draggableProvided, draggableSnapshot, dragging);
|
44176 |
+
});
|
44177 |
+
return react_dom.createPortal(node, getContainerForClone());
|
44178 |
+
}
|
44179 |
|
44180 |
+
return react.createElement(DroppableContext.Provider, {
|
44181 |
+
value: droppableContext
|
44182 |
+
}, children(provided, snapshot), getClone());
|
44183 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44184 |
|
44185 |
+
var isMatchingType = function isMatchingType(type, critical) {
|
44186 |
+
return type === critical.droppable.type;
|
44187 |
};
|
44188 |
+
|
44189 |
+
var getDraggable = function getDraggable(critical, dimensions) {
|
44190 |
+
return dimensions.draggables[critical.draggable.id];
|
44191 |
};
|
|
|
|
|
|
|
44192 |
|
44193 |
+
var makeMapStateToProps$1 = function makeMapStateToProps() {
|
44194 |
+
var idleWithAnimation = {
|
44195 |
+
placeholder: null,
|
44196 |
+
shouldAnimatePlaceholder: true,
|
44197 |
+
snapshot: {
|
44198 |
+
isDraggingOver: false,
|
44199 |
+
draggingOverWith: null,
|
44200 |
+
draggingFromThisWith: null,
|
44201 |
+
isUsingPlaceholder: false
|
44202 |
+
},
|
44203 |
+
useClone: null
|
44204 |
+
};
|
44205 |
|
44206 |
+
var idleWithoutAnimation = (0,esm_extends/* default */.Z)({}, idleWithAnimation, {
|
44207 |
+
shouldAnimatePlaceholder: false
|
44208 |
+
});
|
44209 |
|
44210 |
+
var getDraggableRubric = memoize_one_esm(function (descriptor) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44211 |
return {
|
44212 |
+
draggableId: descriptor.id,
|
44213 |
+
type: descriptor.type,
|
44214 |
+
source: {
|
44215 |
+
index: descriptor.index,
|
44216 |
+
droppableId: descriptor.droppableId
|
44217 |
+
}
|
44218 |
};
|
44219 |
+
});
|
44220 |
+
var getMapProps = memoize_one_esm(function (id, isEnabled, isDraggingOverForConsumer, isDraggingOverForImpact, dragging, renderClone) {
|
44221 |
+
var draggableId = dragging.descriptor.id;
|
44222 |
+
var isHome = dragging.descriptor.droppableId === id;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44223 |
|
44224 |
+
if (isHome) {
|
44225 |
+
var useClone = renderClone ? {
|
44226 |
+
render: renderClone,
|
44227 |
+
dragging: getDraggableRubric(dragging.descriptor)
|
44228 |
+
} : null;
|
44229 |
+
var _snapshot = {
|
44230 |
+
isDraggingOver: isDraggingOverForConsumer,
|
44231 |
+
draggingOverWith: isDraggingOverForConsumer ? draggableId : null,
|
44232 |
+
draggingFromThisWith: draggableId,
|
44233 |
+
isUsingPlaceholder: true
|
44234 |
+
};
|
44235 |
+
return {
|
44236 |
+
placeholder: dragging.placeholder,
|
44237 |
+
shouldAnimatePlaceholder: false,
|
44238 |
+
snapshot: _snapshot,
|
44239 |
+
useClone: useClone
|
44240 |
+
};
|
44241 |
}
|
44242 |
|
44243 |
+
if (!isEnabled) {
|
44244 |
+
return idleWithoutAnimation;
|
44245 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44246 |
|
44247 |
+
if (!isDraggingOverForImpact) {
|
44248 |
+
return idleWithAnimation;
|
|
|
44249 |
}
|
44250 |
|
44251 |
+
var snapshot = {
|
44252 |
+
isDraggingOver: isDraggingOverForConsumer,
|
44253 |
+
draggingOverWith: draggableId,
|
44254 |
+
draggingFromThisWith: null,
|
44255 |
+
isUsingPlaceholder: true
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44256 |
};
|
44257 |
+
return {
|
44258 |
+
placeholder: dragging.placeholder,
|
44259 |
+
shouldAnimatePlaceholder: true,
|
44260 |
+
snapshot: snapshot,
|
44261 |
+
useClone: null
|
44262 |
+
};
|
44263 |
+
});
|
|
|
|
|
|
|
|
|
|
|
44264 |
|
44265 |
+
var selector = function selector(state, ownProps) {
|
44266 |
+
var id = ownProps.droppableId;
|
44267 |
+
var type = ownProps.type;
|
44268 |
+
var isEnabled = !ownProps.isDropDisabled;
|
44269 |
+
var renderClone = ownProps.renderClone;
|
44270 |
|
44271 |
+
if (state.isDragging) {
|
44272 |
+
var critical = state.critical;
|
44273 |
|
44274 |
+
if (!isMatchingType(type, critical)) {
|
44275 |
+
return idleWithoutAnimation;
|
44276 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44277 |
|
44278 |
+
var dragging = getDraggable(critical, state.dimensions);
|
44279 |
+
var isDraggingOver = whatIsDraggedOver(state.impact) === id;
|
44280 |
+
return getMapProps(id, isEnabled, isDraggingOver, isDraggingOver, dragging, renderClone);
|
44281 |
}
|
44282 |
|
44283 |
+
if (state.phase === 'DROP_ANIMATING') {
|
44284 |
+
var completed = state.completed;
|
44285 |
+
|
44286 |
+
if (!isMatchingType(type, completed.critical)) {
|
44287 |
+
return idleWithoutAnimation;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44288 |
}
|
44289 |
|
44290 |
+
var _dragging = getDraggable(completed.critical, state.dimensions);
|
|
|
|
|
|
|
|
|
|
|
|
|
44291 |
|
44292 |
+
return getMapProps(id, isEnabled, whatIsDraggedOverFromResult(completed.result) === id, whatIsDraggedOver(completed.impact) === id, _dragging, renderClone);
|
|
|
|
|
|
|
|
|
44293 |
}
|
44294 |
|
44295 |
+
if (state.phase === 'IDLE' && state.completed && !state.shouldFlush) {
|
44296 |
+
var _completed = state.completed;
|
|
|
44297 |
|
44298 |
+
if (!isMatchingType(type, _completed.critical)) {
|
44299 |
+
return idleWithoutAnimation;
|
44300 |
+
}
|
44301 |
|
44302 |
+
var wasOver = whatIsDraggedOver(_completed.impact) === id;
|
44303 |
+
var wasCombining = Boolean(_completed.impact.at && _completed.impact.at.type === 'COMBINE');
|
44304 |
+
var isHome = _completed.critical.droppable.id === id;
|
|
|
|
|
44305 |
|
44306 |
+
if (wasOver) {
|
44307 |
+
return wasCombining ? idleWithAnimation : idleWithoutAnimation;
|
44308 |
+
}
|
|
|
44309 |
|
44310 |
+
if (isHome) {
|
44311 |
+
return idleWithAnimation;
|
44312 |
+
}
|
44313 |
|
44314 |
+
return idleWithoutAnimation;
|
44315 |
+
}
|
|
|
44316 |
|
44317 |
+
return idleWithoutAnimation;
|
|
|
|
|
|
|
44318 |
};
|
44319 |
+
|
44320 |
+
return selector;
|
44321 |
+
};
|
44322 |
+
var mapDispatchToProps$1 = {
|
44323 |
+
updateViewportMaxScroll: updateViewportMaxScroll
|
44324 |
};
|
44325 |
|
44326 |
+
function getBody() {
|
44327 |
+
!document.body ? false ? 0 : react_beautiful_dnd_esm_invariant(false) : void 0;
|
44328 |
+
return document.body;
|
44329 |
+
}
|
44330 |
+
|
44331 |
+
var react_beautiful_dnd_esm_defaultProps = {
|
44332 |
+
mode: 'standard',
|
44333 |
+
type: 'DEFAULT',
|
44334 |
+
direction: 'vertical',
|
44335 |
+
isDropDisabled: false,
|
44336 |
+
isCombineEnabled: false,
|
44337 |
+
ignoreContainerClipping: false,
|
44338 |
+
renderClone: null,
|
44339 |
+
getContainerForClone: getBody
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44340 |
};
|
44341 |
+
var ConnectedDroppable = connect(makeMapStateToProps$1, mapDispatchToProps$1, null, {
|
44342 |
+
context: StoreContext,
|
44343 |
+
pure: true,
|
44344 |
+
areStatePropsEqual: isStrictEqual
|
44345 |
+
})(Droppable);
|
44346 |
+
ConnectedDroppable.defaultProps = react_beautiful_dnd_esm_defaultProps;
|
44347 |
|
|
|
|
|
|
|
|
|
|
|
|
|
44348 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44349 |
|
44350 |
+
;// CONCATENATED MODULE: ./src/js/utils/cookies.js
|
44351 |
+
/**
|
44352 |
+
* Get cookie util
|
44353 |
+
*
|
44354 |
+
* @param {string} cname
|
44355 |
+
*/
|
44356 |
+
// Get cookie
|
44357 |
+
function getCookie(name) {
|
44358 |
+
var value = "; ".concat(document.cookie);
|
44359 |
+
var parts = value.split("; ".concat(name, "="));
|
44360 |
+
if (parts.length === 2) return parts.pop().split(";").shift();
|
44361 |
+
return false;
|
44362 |
+
} // Set cookie
|
44363 |
|
44364 |
+
function setCookie(cname, value) {
|
44365 |
+
document.cookie = cname + "=" + value;
|
44366 |
+
}
|
44367 |
+
;// CONCATENATED MODULE: ./src/js/utils/ImportData.js
|
44368 |
|
|
|
|
|
|
|
|
|
|
|
44369 |
|
|
|
|
|
|
|
44370 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44371 |
|
44372 |
+
function ImportData(currentGroup, foundGroup, foundButtons, index) {
|
44373 |
+
var redirect = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
44374 |
+
var dispatch = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : window.store.dispatch;
|
44375 |
+
var state = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : window.store.getState();
|
44376 |
|
44377 |
+
// Should import into a group
|
44378 |
+
if (currentGroup) {
|
44379 |
+
if (foundGroup && foundButtons) {
|
44380 |
+
// Replace Current Group
|
44381 |
+
console.log("Replace current group"); // addGroup(foundGroup);
|
44382 |
+
|
44383 |
+
replaceGroup(currentGroup.id, foundGroup, foundButtons, dispatch, state);
|
44384 |
+
}
|
44385 |
+
|
44386 |
+
if (foundButtons && !foundGroup) {
|
44387 |
+
// Add Buttons into current group
|
44388 |
+
console.log("Add Buttons into current group");
|
44389 |
+
foundButtons.map(function (button, key) {
|
44390 |
+
// Do not import
|
44391 |
+
if (Object.keys(button).length === 0) return false;
|
44392 |
+
addButton(button, currentGroup.id, index || currentGroup.children.length + key + 1, dispatch, redirect);
|
44393 |
+
});
|
44394 |
+
}
|
44395 |
+
} // Should create a new group
|
44396 |
+
else if (foundGroup && !currentGroup) {
|
44397 |
+
console.log("Should create a new group");
|
44398 |
+
importGroup(foundGroup, foundButtons, index, dispatch);
|
44399 |
+
} else if (foundButtons && !foundGroup && !currentGroup) {
|
44400 |
+
console.log("Should create a new group with imported button");
|
44401 |
+
importGroup(foundGroup, foundButtons, index, dispatch);
|
44402 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44403 |
}
|
44404 |
+
function ImportRawData(data, index, currentGroup, redirect) {
|
44405 |
+
var foundGroup, foundButtons;
|
44406 |
|
44407 |
+
try {
|
44408 |
+
var parsedResult = typeof data === "string" ? JSON.parse(data) : data; // Malformed data
|
44409 |
|
44410 |
+
if (!parsedResult.export_type || parsedResult.export_type === "group" && !parsedResult.buttons) {
|
44411 |
+
throw new Error(translate("import_export.import.warning.invalid"));
|
44412 |
+
} // Import a group
|
44413 |
|
|
|
|
|
|
|
44414 |
|
44415 |
+
if (parsedResult.export_type === "group") {
|
44416 |
+
if (parsedResult.buttons.length === 0) {
|
44417 |
+
alert(translate("import_export.import.warning.no_buttons"));
|
44418 |
+
return;
|
44419 |
+
}
|
44420 |
|
44421 |
+
foundGroup = omit_default()(parsedResult.data, import_export.propertiesToOmit);
|
44422 |
+
foundButtons = parsedResult.buttons.map(function (button) {
|
44423 |
+
return omit_default()(button, import_export.propertiesToOmit);
|
44424 |
+
});
|
44425 |
+
} // Import a button into group
|
44426 |
+
else if (parsedResult.export_type === "button") {
|
44427 |
+
foundGroup = false;
|
44428 |
+
foundButtons = [omit_default()(parsedResult, import_export.propertiesToOmit)];
|
44429 |
+
}
|
44430 |
+
|
44431 |
+
ImportData(currentGroup, foundGroup, foundButtons, index, redirect);
|
44432 |
+
} catch (e) {
|
44433 |
+
alert(translate("import_export.import.warning.malformed"));
|
44434 |
+
}
|
44435 |
}
|
44436 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/TrashButton/TrashButton.js
|
44437 |
+
function TrashButton_extends() { TrashButton_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return TrashButton_extends.apply(this, arguments); }
|
44438 |
|
44439 |
+
function TrashButton_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44440 |
|
44441 |
+
function TrashButton_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { TrashButton_ownKeys(Object(source), true).forEach(function (key) { TrashButton_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { TrashButton_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
44442 |
+
|
44443 |
+
function TrashButton_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
44444 |
+
|
44445 |
+
function TrashButton_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = TrashButton_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
44446 |
|
44447 |
+
function TrashButton_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
44448 |
|
|
|
|
|
|
|
44449 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44450 |
|
44451 |
+
function TrashButton(_ref) {
|
44452 |
+
var _ref$disabled = _ref.disabled,
|
44453 |
+
disabled = _ref$disabled === void 0 ? false : _ref$disabled,
|
44454 |
+
_onClick = _ref.onClick,
|
44455 |
+
iconProps = _ref.iconProps,
|
44456 |
+
_ref$icon = _ref.icon,
|
44457 |
+
icon = _ref$icon === void 0 ? "fas fa-undo" : _ref$icon,
|
44458 |
+
props = TrashButton_objectWithoutProperties(_ref, ["disabled", "onClick", "iconProps", "icon"]);
|
44459 |
|
44460 |
+
return /*#__PURE__*/react.createElement(IconButton_IconButton, TrashButton_extends({
|
44461 |
+
onClick: function onClick() {
|
44462 |
+
return _onClick();
|
44463 |
+
},
|
44464 |
+
disabled: disabled,
|
44465 |
+
size: "small",
|
44466 |
+
style: TrashButton_objectSpread({
|
44467 |
+
fontSize: "14px",
|
44468 |
+
marginLeft: "5px",
|
44469 |
+
height: "30px",
|
44470 |
+
width: "30px",
|
44471 |
+
alignSelf: "center"
|
44472 |
+
}, props.style),
|
44473 |
+
color: "primary"
|
44474 |
+
}, props), /*#__PURE__*/react.createElement(Icon_Icon, TrashButton_extends({
|
44475 |
+
fontSize: "inherit",
|
44476 |
+
className: icon
|
44477 |
+
}, iconProps)));
|
44478 |
}
|
44479 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/FileDragAndDrop/FileDragAndDrop.js
|
44480 |
+
function FileDragAndDrop_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { FileDragAndDrop_typeof = function _typeof(obj) { return typeof obj; }; } else { FileDragAndDrop_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return FileDragAndDrop_typeof(obj); }
|
44481 |
|
44482 |
+
function FileDragAndDrop_classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
44483 |
|
44484 |
+
function FileDragAndDrop_defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
44485 |
|
44486 |
+
function FileDragAndDrop_createClass(Constructor, protoProps, staticProps) { if (protoProps) FileDragAndDrop_defineProperties(Constructor.prototype, protoProps); if (staticProps) FileDragAndDrop_defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
|
44487 |
|
44488 |
+
function FileDragAndDrop_inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
|
|
|
|
|
|
|
|
|
44489 |
|
44490 |
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
|
|
|
|
|
44491 |
|
44492 |
+
function FileDragAndDrop_createSuper(Derived) { var hasNativeReflectConstruct = FileDragAndDrop_isNativeReflectConstruct(); return function _createSuperInternal() { var Super = FileDragAndDrop_getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = FileDragAndDrop_getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return FileDragAndDrop_possibleConstructorReturn(this, result); }; }
|
|
|
|
|
|
|
44493 |
|
44494 |
+
function FileDragAndDrop_possibleConstructorReturn(self, call) { if (call && (FileDragAndDrop_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
|
44495 |
|
44496 |
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44497 |
|
44498 |
+
function FileDragAndDrop_isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
|
|
|
|
|
|
|
|
|
|
|
44499 |
|
44500 |
+
function FileDragAndDrop_getPrototypeOf(o) { FileDragAndDrop_getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return FileDragAndDrop_getPrototypeOf(o); }
|
|
|
|
|
|
|
|
|
|
|
|
|
44501 |
|
44502 |
+
function FileDragAndDrop_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
|
|
|
|
|
|
|
44503 |
|
|
|
44504 |
|
|
|
|
|
|
|
|
|
44505 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44506 |
|
|
|
|
|
44507 |
|
44508 |
+
var FileDragAndDrop_styles = function styles(theme) {
|
44509 |
+
return {
|
44510 |
+
border: {
|
44511 |
+
border: "dashed ".concat(theme.palette.primary.main, " 3px"),
|
44512 |
+
backgroundColor: "rgba(255,255,255,.8)",
|
44513 |
+
position: "absolute",
|
44514 |
+
top: 0,
|
44515 |
+
bottom: 0,
|
44516 |
+
left: 0,
|
44517 |
+
right: 0,
|
44518 |
+
zIndex: 9999,
|
44519 |
+
display: "flex",
|
44520 |
+
alignItems: "center",
|
44521 |
+
justifyContent: "center"
|
44522 |
+
},
|
44523 |
+
text: {
|
44524 |
+
fontSize: "35px",
|
44525 |
+
color: theme.palette.primary.main
|
44526 |
+
}
|
44527 |
+
};
|
44528 |
};
|
44529 |
|
44530 |
+
var FileDragAndDrop = /*#__PURE__*/function (_Component) {
|
44531 |
+
FileDragAndDrop_inherits(FileDragAndDrop, _Component);
|
|
|
|
|
44532 |
|
44533 |
+
var _super = FileDragAndDrop_createSuper(FileDragAndDrop);
|
|
|
|
|
44534 |
|
44535 |
+
function FileDragAndDrop() {
|
44536 |
+
var _this;
|
44537 |
|
44538 |
+
FileDragAndDrop_classCallCheck(this, FileDragAndDrop);
|
|
|
|
|
|
|
44539 |
|
44540 |
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
44541 |
+
args[_key] = arguments[_key];
|
44542 |
+
}
|
44543 |
|
44544 |
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
|
|
|
|
|
44545 |
|
44546 |
+
FileDragAndDrop_defineProperty(_assertThisInitialized(_this), "state", {
|
44547 |
+
drag: false
|
44548 |
+
});
|
44549 |
|
44550 |
+
FileDragAndDrop_defineProperty(_assertThisInitialized(_this), "dropRef", /*#__PURE__*/react.createRef());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44551 |
|
44552 |
+
FileDragAndDrop_defineProperty(_assertThisInitialized(_this), "handleDrag", function (e) {
|
44553 |
+
e.preventDefault();
|
44554 |
+
e.stopPropagation();
|
44555 |
+
});
|
|
|
|
|
44556 |
|
44557 |
+
FileDragAndDrop_defineProperty(_assertThisInitialized(_this), "handleDragIn", function (e) {
|
44558 |
+
e.preventDefault();
|
44559 |
+
e.stopPropagation();
|
44560 |
+
_this.dragCounter++;
|
44561 |
|
44562 |
+
if (e.dataTransfer.items && e.dataTransfer.items.length > 0) {
|
44563 |
+
_this.setState({
|
44564 |
+
drag: true
|
44565 |
+
});
|
44566 |
+
}
|
44567 |
+
});
|
44568 |
|
44569 |
+
FileDragAndDrop_defineProperty(_assertThisInitialized(_this), "handleDragOut", function (e) {
|
44570 |
+
e.preventDefault();
|
44571 |
+
e.stopPropagation();
|
44572 |
+
_this.dragCounter--;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44573 |
|
44574 |
+
if (_this.dragCounter === 0) {
|
44575 |
+
_this.setState({
|
44576 |
+
drag: false
|
44577 |
+
});
|
44578 |
+
}
|
44579 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44580 |
|
44581 |
+
FileDragAndDrop_defineProperty(_assertThisInitialized(_this), "handleDrop", function (e) {
|
44582 |
+
e.preventDefault();
|
44583 |
+
e.stopPropagation();
|
|
|
|
|
44584 |
|
44585 |
+
_this.setState({
|
44586 |
+
drag: false
|
44587 |
+
});
|
|
|
|
|
44588 |
|
44589 |
+
if (e.dataTransfer.files && e.dataTransfer.files.length > 0) {
|
44590 |
+
_this.props.handleDrop(e.dataTransfer.files);
|
|
|
|
|
44591 |
|
44592 |
+
e.dataTransfer.clearData();
|
44593 |
+
_this.dragCounter = 0;
|
44594 |
+
}
|
44595 |
+
});
|
44596 |
|
44597 |
+
return _this;
|
44598 |
+
}
|
44599 |
|
44600 |
+
FileDragAndDrop_createClass(FileDragAndDrop, [{
|
44601 |
+
key: "componentDidMount",
|
44602 |
+
value: function componentDidMount() {
|
44603 |
+
var div = this.dropRef.current;
|
44604 |
+
div.addEventListener("dragenter", this.handleDragIn);
|
44605 |
+
div.addEventListener("dragleave", this.handleDragOut);
|
44606 |
+
div.addEventListener("dragover", this.handleDrag);
|
44607 |
+
div.addEventListener("drop", this.handleDrop);
|
44608 |
}
|
44609 |
+
}, {
|
44610 |
+
key: "componentWillUnmount",
|
44611 |
+
value: function componentWillUnmount() {
|
44612 |
+
var div = this.dropRef.current;
|
44613 |
+
div.removeEventListener("dragenter", this.handleDragIn);
|
44614 |
+
div.removeEventListener("dragleave", this.handleDragOut);
|
44615 |
+
div.removeEventListener("dragover", this.handleDrag);
|
44616 |
+
div.removeEventListener("drop", this.handleDrop);
|
44617 |
+
}
|
44618 |
+
}, {
|
44619 |
+
key: "render",
|
44620 |
+
value: function render() {
|
44621 |
+
var classes = this.props.classes;
|
44622 |
+
return /*#__PURE__*/react.createElement("div", {
|
44623 |
+
style: {
|
44624 |
+
display: "inline-block",
|
44625 |
+
position: "relative"
|
44626 |
+
},
|
44627 |
+
ref: this.dropRef
|
44628 |
+
}, this.state.drag && /*#__PURE__*/react.createElement("div", {
|
44629 |
+
className: classes.border
|
44630 |
+
}, /*#__PURE__*/react.createElement("span", {
|
44631 |
+
className: classes.text
|
44632 |
+
}, translate("import_export.import.drag_drop"))), this.props.children);
|
44633 |
+
}
|
44634 |
+
}]);
|
44635 |
|
44636 |
+
return FileDragAndDrop;
|
44637 |
+
}(react.Component);
|
|
|
44638 |
|
44639 |
+
/* harmony default export */ var FileDragAndDrop_FileDragAndDrop = ((0,withStyles/* default */.Z)(FileDragAndDrop_styles)(FileDragAndDrop));
|
44640 |
+
// EXTERNAL MODULE: ./node_modules/lodash/cloneDeep.js
|
44641 |
+
var cloneDeep = __webpack_require__(50361);
|
44642 |
+
var cloneDeep_default = /*#__PURE__*/__webpack_require__.n(cloneDeep);
|
44643 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Containers/ContainerActions/ImportButton.js
|
44644 |
+
function ImportButton_asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
|
|
|
44645 |
|
44646 |
+
function ImportButton_asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { ImportButton_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { ImportButton_asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
|
|
|
|
|
44647 |
|
44648 |
+
function ImportButton_slicedToArray(arr, i) { return ImportButton_arrayWithHoles(arr) || ImportButton_iterableToArrayLimit(arr, i) || ImportButton_unsupportedIterableToArray(arr, i) || ImportButton_nonIterableRest(); }
|
|
|
|
|
44649 |
|
44650 |
+
function ImportButton_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44651 |
|
44652 |
+
function ImportButton_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ImportButton_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ImportButton_arrayLikeToArray(o, minLen); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44653 |
|
44654 |
+
function ImportButton_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44655 |
|
44656 |
+
function ImportButton_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
44657 |
+
|
44658 |
+
function ImportButton_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
44659 |
|
|
|
|
|
|
|
44660 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44661 |
|
|
|
|
|
|
|
44662 |
|
|
|
|
|
|
|
44663 |
|
|
|
|
|
|
|
44664 |
|
|
|
|
|
|
|
44665 |
|
|
|
|
|
44666 |
|
|
|
|
|
|
|
44667 |
|
|
|
|
|
|
|
44668 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44669 |
|
|
|
|
|
|
|
|
|
|
|
44670 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44671 |
|
|
|
|
|
44672 |
|
44673 |
+
function ImportButton(_ref) {
|
44674 |
+
var _ref$isGroup = _ref.isGroup,
|
44675 |
+
isGroup = _ref$isGroup === void 0 ? true : _ref$isGroup,
|
44676 |
+
_ref$currentGroup = _ref.currentGroup,
|
44677 |
+
currentGroup = _ref$currentGroup === void 0 ? null : _ref$currentGroup,
|
44678 |
+
_ref$label = _ref.label,
|
44679 |
+
label = _ref$label === void 0 ? "Import Group" : _ref$label,
|
44680 |
+
index = _ref.index,
|
44681 |
+
_ref$kbLink = _ref.kbLink,
|
44682 |
+
kbLink = _ref$kbLink === void 0 ? null : _ref$kbLink,
|
44683 |
+
inDropdown = _ref.inDropdown,
|
44684 |
+
onClose = _ref.onClose;
|
44685 |
|
44686 |
+
var _useState = (0,react.useState)(false),
|
44687 |
+
_useState2 = ImportButton_slicedToArray(_useState, 2),
|
44688 |
+
dialogOpened = _useState2[0],
|
44689 |
+
setDialogOpened = _useState2[1];
|
44690 |
|
44691 |
+
var _useState3 = (0,react.useState)(false),
|
44692 |
+
_useState4 = ImportButton_slicedToArray(_useState3, 2),
|
44693 |
+
fileSelected = _useState4[0],
|
44694 |
+
setFileSelected = _useState4[1];
|
44695 |
|
44696 |
+
var _useState5 = (0,react.useState)(false),
|
44697 |
+
_useState6 = ImportButton_slicedToArray(_useState5, 2),
|
44698 |
+
foundButtons = _useState6[0],
|
44699 |
+
setFoundButtons = _useState6[1];
|
44700 |
|
44701 |
+
var _useState7 = (0,react.useState)(false),
|
44702 |
+
_useState8 = ImportButton_slicedToArray(_useState7, 2),
|
44703 |
+
foundGroup = _useState8[0],
|
44704 |
+
setFoundGroup = _useState8[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44705 |
|
44706 |
+
var importFileUploader = (0,react.useRef)(null);
|
|
|
44707 |
|
44708 |
+
var onFileSelect = function onFileSelect(files) {
|
44709 |
+
// Get file
|
44710 |
+
var file = files[0]; // Read the file
|
44711 |
|
44712 |
+
var readFile = new FileReader(); // After reading the file
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44713 |
|
44714 |
+
readFile.addEventListener("load", /*#__PURE__*/function () {
|
44715 |
+
var _ref2 = ImportButton_asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(fileReaderEvent) {
|
44716 |
+
var result, fileResult, group, button, migratedData;
|
44717 |
+
return regeneratorRuntime.wrap(function _callee$(_context) {
|
44718 |
+
while (1) {
|
44719 |
+
switch (_context.prev = _context.next) {
|
44720 |
+
case 0:
|
44721 |
+
result = fileReaderEvent.target.result;
|
44722 |
+
_context.prev = 1;
|
44723 |
+
fileResult = JSON.parse(result); // Malformed data
|
44724 |
|
44725 |
+
if (!(!fileResult.export_type || fileResult.export_type === "group" && !fileResult.buttons)) {
|
44726 |
+
_context.next = 5;
|
44727 |
+
break;
|
44728 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44729 |
|
44730 |
+
throw new Error(translate("import_export.import.warning.invalid"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44731 |
|
44732 |
+
case 5:
|
44733 |
+
if (!isGroup) {
|
44734 |
+
_context.next = 28;
|
44735 |
+
break;
|
44736 |
+
}
|
44737 |
|
44738 |
+
if (!(fileResult.export_type === "group")) {
|
44739 |
+
_context.next = 19;
|
44740 |
+
break;
|
44741 |
+
}
|
|
|
44742 |
|
44743 |
+
if (!(fileResult.buttons.length === 0)) {
|
44744 |
+
_context.next = 10;
|
44745 |
+
break;
|
44746 |
+
}
|
44747 |
|
44748 |
+
alert(translate("import_export.import.warning.no_buttons"));
|
44749 |
+
return _context.abrupt("return");
|
|
|
44750 |
|
44751 |
+
case 10:
|
44752 |
+
group = fileResult; // An old export file. Might need migration
|
44753 |
|
44754 |
+
if (!(!fileResult.export_migration_version || fileResult.export_migration_version !== buttonizer_admin.migration_version)) {
|
44755 |
+
_context.next = 15;
|
44756 |
+
break;
|
44757 |
+
}
|
44758 |
|
44759 |
+
_context.next = 14;
|
44760 |
+
return migrateData(fileResult);
|
44761 |
|
44762 |
+
case 14:
|
44763 |
+
group = _context.sent;
|
|
|
44764 |
|
44765 |
+
case 15:
|
44766 |
+
setFoundGroup(omit_default()(group.data, import_export.propertiesToOmit));
|
44767 |
+
setFoundButtons(group.buttons.map(function (button) {
|
44768 |
+
return omit_default()(button, import_export.propertiesToOmit);
|
44769 |
+
}));
|
44770 |
+
_context.next = 28;
|
44771 |
+
break;
|
44772 |
|
44773 |
+
case 19:
|
44774 |
+
if (!(fileResult.export_type === "button")) {
|
44775 |
+
_context.next = 28;
|
44776 |
+
break;
|
44777 |
+
}
|
44778 |
|
44779 |
+
button = fileResult; // An old export file. Might need migration
|
|
|
44780 |
|
44781 |
+
if (!(!fileResult.export_migration_version || fileResult.export_migration_version !== buttonizer_admin.migration_version)) {
|
44782 |
+
_context.next = 26;
|
44783 |
+
break;
|
44784 |
+
}
|
44785 |
|
44786 |
+
_context.next = 24;
|
44787 |
+
return migrateData({
|
44788 |
+
data: fileResult
|
44789 |
+
});
|
44790 |
|
44791 |
+
case 24:
|
44792 |
+
migratedData = _context.sent;
|
44793 |
+
button = migratedData.data;
|
44794 |
|
44795 |
+
case 26:
|
44796 |
+
setFoundGroup(false);
|
44797 |
+
setFoundButtons([omit_default()(button, import_export.propertiesToOmit)]);
|
44798 |
|
44799 |
+
case 28:
|
44800 |
+
setFileSelected(true);
|
44801 |
+
_context.next = 35;
|
44802 |
+
break;
|
44803 |
|
44804 |
+
case 31:
|
44805 |
+
_context.prev = 31;
|
44806 |
+
_context.t0 = _context["catch"](1);
|
44807 |
+
console.error(_context.t0);
|
44808 |
+
alert(translate("import_export.import.warning.malformed"));
|
44809 |
|
44810 |
+
case 35:
|
44811 |
+
case "end":
|
44812 |
+
return _context.stop();
|
44813 |
+
}
|
44814 |
+
}
|
44815 |
+
}, _callee, null, [[1, 31]]);
|
44816 |
+
}));
|
44817 |
|
44818 |
+
return function (_x) {
|
44819 |
+
return _ref2.apply(this, arguments);
|
44820 |
+
};
|
44821 |
+
}());
|
44822 |
+
readFile.readAsText(file);
|
44823 |
+
}; // Import the files
|
|
|
|
|
|
|
|
|
44824 |
|
|
|
|
|
|
|
44825 |
|
44826 |
+
var onImport = function onImport() {
|
44827 |
+
if (isGroup) {
|
44828 |
+
ImportData(currentGroup, foundGroup, foundButtons, index);
|
44829 |
+
} // Reset
|
44830 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
44831 |
|
44832 |
+
setFileSelected(null);
|
44833 |
+
setFoundButtons(false);
|
44834 |
+
setFoundGroup(false);
|
44835 |
+
setDialogOpened(false);
|
44836 |
+
};
|
44837 |
+
|
44838 |
+
return /*#__PURE__*/react.createElement(react.Fragment, null, inDropdown ? /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
44839 |
+
onClick: function onClick() {
|
44840 |
+
return setDialogOpened(true);
|
44841 |
+
},
|
44842 |
+
"data-testid": "import-into-group"
|
44843 |
+
}, /*#__PURE__*/react.createElement(ListItemIcon_ListItemIcon, null, /*#__PURE__*/react.createElement(Icon_Icon, {
|
44844 |
+
className: "fas fa-file-import"
|
44845 |
+
})), /*#__PURE__*/react.createElement(Typography_Typography, {
|
44846 |
+
variant: "inherit"
|
44847 |
+
}, label)) : /*#__PURE__*/react.createElement(Button_Button, {
|
44848 |
+
style: {
|
44849 |
+
fontSize: "14px"
|
44850 |
+
},
|
44851 |
+
onClick: function onClick() {
|
44852 |
+
return setDialogOpened(true);
|
44853 |
+
},
|
44854 |
+
color: "primary",
|
44855 |
+
variant: "text",
|
44856 |
+
size: "small",
|
44857 |
+
startIcon: /*#__PURE__*/react.createElement(Icon_Icon, {
|
44858 |
+
className: "fas fa-file-import"
|
44859 |
+
}),
|
44860 |
+
"data-testid": "import-new-group"
|
44861 |
+
}, label), /*#__PURE__*/react.createElement(Dialog_Dialog, {
|
44862 |
+
open: dialogOpened,
|
44863 |
+
onClose: function onClose() {
|
44864 |
+
return setDialogOpened(false);
|
44865 |
+
},
|
44866 |
+
maxWidth: false,
|
44867 |
+
"aria-labelledby": "import-button-dialog-title",
|
44868 |
+
"aria-describedby": "import-button-dialog-description",
|
44869 |
+
"data-testid": "dialog:import-dialog"
|
44870 |
+
}, /*#__PURE__*/react.createElement(FileDragAndDrop_FileDragAndDrop, {
|
44871 |
+
handleDrop: function handleDrop(files) {
|
44872 |
+
if (files.length === 0) return;
|
44873 |
+
onFileSelect(files);
|
44874 |
}
|
44875 |
+
}, /*#__PURE__*/react.createElement(DialogTitle_DialogTitle, {
|
44876 |
+
id: "import-button-dialog-title"
|
44877 |
+
}, "BETA: ", translate("import_export.import.title")), /*#__PURE__*/react.createElement(DialogContent_DialogContent, null, !fileSelected && /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(DialogContentText_DialogContentText, {
|
44878 |
+
id: "import-button-dialog-description",
|
44879 |
+
component: "div"
|
44880 |
+
}, currentGroup ? translate("import_export.import.into_group.text") : translate("import_export.import.new_group.text"), " ", translate("import_export.import.select_please")), /*#__PURE__*/react.createElement(Button_Button, {
|
44881 |
+
variant: "contained",
|
44882 |
+
fullWidth: true,
|
44883 |
+
startIcon: /*#__PURE__*/react.createElement(Icon_Icon, {
|
44884 |
+
className: "fas fa-file-import",
|
44885 |
+
style: {
|
44886 |
+
marginRight: 10
|
44887 |
+
}
|
44888 |
+
}),
|
44889 |
+
style: {
|
44890 |
+
padding: "10px 20px",
|
44891 |
+
marginBottom: 15
|
44892 |
+
},
|
44893 |
+
onClick: function onClick() {
|
44894 |
+
return importFileUploader.current.click();
|
44895 |
+
}
|
44896 |
+
}, translate("import_export.import.select_click")), /*#__PURE__*/react.createElement("input", {
|
44897 |
+
type: "file",
|
44898 |
+
id: "input",
|
44899 |
+
"data-testid": "import-input",
|
44900 |
+
ref: importFileUploader,
|
44901 |
+
accept: "application/JSON",
|
44902 |
+
onChange: function onChange(e) {
|
44903 |
+
if (e.target.files.length === 0) return;
|
44904 |
+
onFileSelect(e.target.files);
|
44905 |
+
},
|
44906 |
+
style: {
|
44907 |
+
overflow: "hidden",
|
44908 |
+
width: 0,
|
44909 |
+
height: 0
|
44910 |
+
}
|
44911 |
+
})), fileSelected && /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(DialogContentText_DialogContentText, {
|
44912 |
+
component: "div"
|
44913 |
+
}, currentGroup && isGroup && foundGroup ? /*#__PURE__*/react.createElement("span", {
|
44914 |
+
dangerouslySetInnerHTML: {
|
44915 |
+
__html: translate("import_export.import.warning.replace")
|
44916 |
+
}
|
44917 |
+
}) : !currentGroup && isGroup && !foundGroup && foundButtons ? "Create a new group including this button:" : translate("import_export.import.warning.preview")), foundGroup && /*#__PURE__*/react.createElement(DialogContentText_DialogContentText, {
|
44918 |
+
"data-testid": "import-found-group",
|
44919 |
+
component: "div",
|
44920 |
+
key: foundGroup.id
|
44921 |
+
}, /*#__PURE__*/react.createElement("i", null, translate("common.group"), " "), ":", " ", dlv_umd_default()(foundGroup, "name", "Unnamed"), ".", " ", /*#__PURE__*/react.createElement(PropertyList, {
|
44922 |
+
properties: foundGroup,
|
44923 |
+
type: "Group"
|
44924 |
+
}), /*#__PURE__*/react.createElement(TrashButton, {
|
44925 |
+
onClick: function onClick() {
|
44926 |
+
return setFoundGroup(false);
|
44927 |
+
},
|
44928 |
+
"data-testid": "import-delete",
|
44929 |
+
size: "medium",
|
44930 |
+
icon: "fas fa-trash"
|
44931 |
+
})), foundButtons && foundButtons.map(function (button, key) {
|
44932 |
+
return /*#__PURE__*/react.createElement(DialogContentText_DialogContentText, {
|
44933 |
+
"data-testid": "import-found-buttons",
|
44934 |
+
component: "div",
|
44935 |
+
key: key
|
44936 |
+
}, /*#__PURE__*/react.createElement("i", null, translate("common.button"), " ", key + 1, " "), ": ", dlv_umd_default()(button, "name", "Unnamed"), ".", /*#__PURE__*/react.createElement(PropertyList, {
|
44937 |
+
properties: button
|
44938 |
+
}), /*#__PURE__*/react.createElement(TrashButton, {
|
44939 |
+
disabled: foundButtons.length === 1,
|
44940 |
+
onClick: function onClick() {
|
44941 |
+
var currentButtons = cloneDeep_default()(foundButtons);
|
44942 |
+
currentButtons.splice(key, 1);
|
44943 |
+
setFoundButtons(currentButtons);
|
44944 |
+
},
|
44945 |
+
"data-testid": "import-delete",
|
44946 |
+
size: "medium",
|
44947 |
+
icon: "fas fa-trash"
|
44948 |
+
}));
|
44949 |
+
}))), /*#__PURE__*/react.createElement("div", {
|
44950 |
+
style: kbLink && {
|
44951 |
+
display: "flex",
|
44952 |
+
justifyContent: "space-between",
|
44953 |
+
alignItems: "center ",
|
44954 |
+
paddingLeft: "24px"
|
44955 |
+
}
|
44956 |
+
}, /*#__PURE__*/react.createElement(KnowledgeBaseLink, {
|
44957 |
+
articleId: kbLink,
|
44958 |
+
tiny: true,
|
44959 |
+
setting: translate("import_export.import_export")
|
44960 |
+
}), /*#__PURE__*/react.createElement(DialogActions_DialogActions, null, /*#__PURE__*/react.createElement(Button_Button, {
|
44961 |
+
onClick: function onClick() {
|
44962 |
+
return setDialogOpened(false);
|
44963 |
+
},
|
44964 |
+
color: "primary"
|
44965 |
+
}, translate("modal.cancel")), fileSelected && /*#__PURE__*/react.createElement(Button_Button, {
|
44966 |
+
onClick: function onClick() {
|
44967 |
+
return setFileSelected(null);
|
44968 |
+
},
|
44969 |
+
color: "primary"
|
44970 |
+
}, translate("import_export.import.reupload")), /*#__PURE__*/react.createElement(Button_Button, {
|
44971 |
+
onClick: function onClick() {
|
44972 |
+
onImport();
|
44973 |
+
if (onClose) onClose();
|
44974 |
+
},
|
44975 |
+
color: "primary",
|
44976 |
+
disabled: !fileSelected || !foundGroup && !foundButtons,
|
44977 |
+
"data-testid": "import-commence"
|
44978 |
+
}, translate("import_export.import.title")))))));
|
44979 |
+
}
|
44980 |
+
|
44981 |
+
function migrateData(data) {
|
44982 |
+
return new Promise(function (resolve, reject) {
|
44983 |
+
apiRequest("/import_migrate", {
|
44984 |
+
method: "POST",
|
44985 |
+
data: {
|
44986 |
+
data: data
|
44987 |
+
}
|
44988 |
+
}).then(function (_ref3) {
|
44989 |
+
var data = _ref3.data;
|
44990 |
+
|
44991 |
+
if (data.success) {
|
44992 |
+
resolve(data.results);
|
44993 |
+
}
|
44994 |
+
})["catch"](function (e) {
|
44995 |
+
reject(e);
|
44996 |
+
console.error(e);
|
44997 |
+
console.error("Buttonizer: OH NO! ERROR: '" + e.statusText + "'. That's all we know... Please check your PHP logs or contact Buttonizer support if you need help.");
|
44998 |
+
console.error("Buttonizer: Visit our community on https://community.buttonizer.pro/");
|
44999 |
});
|
45000 |
});
|
45001 |
+
}
|
45002 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/SwitchBase.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45003 |
|
|
|
|
|
|
|
|
|
45004 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45005 |
|
|
|
|
|
|
|
|
|
45006 |
|
|
|
|
|
|
|
45007 |
|
45008 |
+
|
45009 |
+
|
45010 |
+
|
45011 |
+
|
45012 |
+
|
45013 |
+
|
45014 |
+
var SwitchBase_styles = {
|
45015 |
+
root: {
|
45016 |
+
padding: 9
|
45017 |
+
},
|
45018 |
+
checked: {},
|
45019 |
+
disabled: {},
|
45020 |
+
input: {
|
45021 |
+
cursor: 'inherit',
|
45022 |
+
position: 'absolute',
|
45023 |
+
opacity: 0,
|
45024 |
+
width: '100%',
|
45025 |
+
height: '100%',
|
45026 |
+
top: 0,
|
45027 |
+
left: 0,
|
45028 |
+
margin: 0,
|
45029 |
+
padding: 0,
|
45030 |
+
zIndex: 1
|
45031 |
+
}
|
45032 |
};
|
45033 |
+
/**
|
45034 |
+
* @ignore - internal component.
|
45035 |
+
*/
|
45036 |
|
45037 |
+
var SwitchBase = /*#__PURE__*/react.forwardRef(function SwitchBase(props, ref) {
|
45038 |
+
var autoFocus = props.autoFocus,
|
45039 |
+
checkedProp = props.checked,
|
45040 |
+
checkedIcon = props.checkedIcon,
|
45041 |
+
classes = props.classes,
|
45042 |
+
className = props.className,
|
45043 |
+
defaultChecked = props.defaultChecked,
|
45044 |
+
disabledProp = props.disabled,
|
45045 |
+
icon = props.icon,
|
45046 |
+
id = props.id,
|
45047 |
+
inputProps = props.inputProps,
|
45048 |
+
inputRef = props.inputRef,
|
45049 |
+
name = props.name,
|
45050 |
+
onBlur = props.onBlur,
|
45051 |
+
onChange = props.onChange,
|
45052 |
+
onFocus = props.onFocus,
|
45053 |
+
readOnly = props.readOnly,
|
45054 |
+
required = props.required,
|
45055 |
+
tabIndex = props.tabIndex,
|
45056 |
+
type = props.type,
|
45057 |
+
value = props.value,
|
45058 |
+
other = (0,objectWithoutProperties/* default */.Z)(props, ["autoFocus", "checked", "checkedIcon", "classes", "className", "defaultChecked", "disabled", "icon", "id", "inputProps", "inputRef", "name", "onBlur", "onChange", "onFocus", "readOnly", "required", "tabIndex", "type", "value"]);
|
45059 |
|
45060 |
+
var _useControlled = (0,useControlled/* default */.Z)({
|
45061 |
+
controlled: checkedProp,
|
45062 |
+
default: Boolean(defaultChecked),
|
45063 |
+
name: 'SwitchBase',
|
45064 |
+
state: 'checked'
|
45065 |
+
}),
|
45066 |
+
_useControlled2 = (0,slicedToArray/* default */.Z)(_useControlled, 2),
|
45067 |
+
checked = _useControlled2[0],
|
45068 |
+
setCheckedState = _useControlled2[1];
|
45069 |
|
45070 |
+
var muiFormControl = useFormControl_useFormControl();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45071 |
|
45072 |
+
var handleFocus = function handleFocus(event) {
|
45073 |
+
if (onFocus) {
|
45074 |
+
onFocus(event);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45075 |
}
|
45076 |
|
45077 |
+
if (muiFormControl && muiFormControl.onFocus) {
|
45078 |
+
muiFormControl.onFocus(event);
|
45079 |
}
|
45080 |
+
};
|
45081 |
|
45082 |
+
var handleBlur = function handleBlur(event) {
|
45083 |
+
if (onBlur) {
|
45084 |
+
onBlur(event);
|
45085 |
}
|
45086 |
|
45087 |
+
if (muiFormControl && muiFormControl.onBlur) {
|
45088 |
+
muiFormControl.onBlur(event);
|
45089 |
+
}
|
45090 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45091 |
|
45092 |
+
var handleInputChange = function handleInputChange(event) {
|
45093 |
+
var newChecked = event.target.checked;
|
45094 |
+
setCheckedState(newChecked);
|
|
|
|
|
45095 |
|
45096 |
+
if (onChange) {
|
45097 |
+
// TODO v5: remove the second argument.
|
45098 |
+
onChange(event, newChecked);
|
45099 |
+
}
|
45100 |
+
};
|
45101 |
|
45102 |
+
var disabled = disabledProp;
|
|
|
|
|
45103 |
|
45104 |
+
if (muiFormControl) {
|
45105 |
+
if (typeof disabled === 'undefined') {
|
45106 |
+
disabled = muiFormControl.disabled;
|
45107 |
}
|
45108 |
+
}
|
45109 |
|
45110 |
+
var hasLabelFor = type === 'checkbox' || type === 'radio';
|
45111 |
+
return /*#__PURE__*/react.createElement(IconButton_IconButton, (0,esm_extends/* default */.Z)({
|
45112 |
+
component: "span",
|
45113 |
+
className: (0,clsx_m/* default */.Z)(classes.root, className, checked && classes.checked, disabled && classes.disabled),
|
45114 |
+
disabled: disabled,
|
45115 |
+
tabIndex: null,
|
45116 |
+
role: undefined,
|
45117 |
+
onFocus: handleFocus,
|
45118 |
+
onBlur: handleBlur,
|
45119 |
+
ref: ref
|
45120 |
+
}, other), /*#__PURE__*/react.createElement("input", (0,esm_extends/* default */.Z)({
|
45121 |
+
autoFocus: autoFocus,
|
45122 |
+
checked: checkedProp,
|
45123 |
+
defaultChecked: defaultChecked,
|
45124 |
+
className: classes.input,
|
45125 |
+
disabled: disabled,
|
45126 |
+
id: hasLabelFor && id,
|
45127 |
+
name: name,
|
45128 |
+
onChange: handleInputChange,
|
45129 |
+
readOnly: readOnly,
|
45130 |
+
ref: inputRef,
|
45131 |
+
required: required,
|
45132 |
+
tabIndex: tabIndex,
|
45133 |
+
type: type,
|
45134 |
+
value: value
|
45135 |
+
}, inputProps)), checked ? checkedIcon : icon);
|
45136 |
+
}); // NB: If changed, please update Checkbox, Switch and Radio
|
45137 |
+
// so that the API documentation is updated.
|
45138 |
|
45139 |
+
false ? 0 : void 0;
|
45140 |
+
/* harmony default export */ var internal_SwitchBase = ((0,withStyles/* default */.Z)(SwitchBase_styles, {
|
45141 |
+
name: 'PrivateSwitchBase'
|
45142 |
+
})(SwitchBase));
|
45143 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/svg-icons/CheckBoxOutlineBlank.js
|
45144 |
|
|
|
|
|
45145 |
|
45146 |
+
/**
|
45147 |
+
* @ignore - internal component.
|
45148 |
+
*/
|
45149 |
|
45150 |
+
/* harmony default export */ var CheckBoxOutlineBlank = ((0,createSvgIcon/* default */.Z)( /*#__PURE__*/react.createElement("path", {
|
45151 |
+
d: "M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"
|
45152 |
+
}), 'CheckBoxOutlineBlank'));
|
45153 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/svg-icons/CheckBox.js
|
45154 |
|
|
|
|
|
|
|
45155 |
|
45156 |
+
/**
|
45157 |
+
* @ignore - internal component.
|
45158 |
+
*/
|
45159 |
|
45160 |
+
/* harmony default export */ var CheckBox = ((0,createSvgIcon/* default */.Z)( /*#__PURE__*/react.createElement("path", {
|
45161 |
+
d: "M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"
|
45162 |
+
}), 'CheckBox'));
|
45163 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/svg-icons/IndeterminateCheckBox.js
|
45164 |
|
|
|
|
|
45165 |
|
45166 |
+
/**
|
45167 |
+
* @ignore - internal component.
|
45168 |
+
*/
|
45169 |
|
45170 |
+
/* harmony default export */ var IndeterminateCheckBox = ((0,createSvgIcon/* default */.Z)( /*#__PURE__*/react.createElement("path", {
|
45171 |
+
d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"
|
45172 |
+
}), 'IndeterminateCheckBox'));
|
45173 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/Checkbox/Checkbox.js
|
|
|
45174 |
|
|
|
|
|
|
|
|
|
45175 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45176 |
|
45177 |
|
45178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45179 |
|
|
|
|
|
|
|
|
|
45180 |
|
45181 |
|
45182 |
|
45183 |
|
|
|
|
|
|
|
|
|
45184 |
|
|
|
|
|
|
|
|
|
|
|
45185 |
|
|
|
|
|
45186 |
|
45187 |
+
var Checkbox_styles = function styles(theme) {
|
45188 |
+
return {
|
45189 |
+
/* Styles applied to the root element. */
|
45190 |
+
root: {
|
45191 |
+
color: theme.palette.text.secondary
|
45192 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45193 |
|
45194 |
+
/* Pseudo-class applied to the root element if `checked={true}`. */
|
45195 |
+
checked: {},
|
45196 |
|
45197 |
+
/* Pseudo-class applied to the root element if `disabled={true}`. */
|
45198 |
+
disabled: {},
|
|
|
45199 |
|
45200 |
+
/* Pseudo-class applied to the root element if `indeterminate={true}`. */
|
45201 |
+
indeterminate: {},
|
45202 |
|
45203 |
+
/* Styles applied to the root element if `color="primary"`. */
|
45204 |
+
colorPrimary: {
|
45205 |
+
'&$checked': {
|
45206 |
+
color: theme.palette.primary.main,
|
45207 |
+
'&:hover': {
|
45208 |
+
backgroundColor: (0,colorManipulator/* fade */.U1)(theme.palette.primary.main, theme.palette.action.hoverOpacity),
|
45209 |
+
// Reset on touch devices, it doesn't add specificity
|
45210 |
+
'@media (hover: none)': {
|
45211 |
+
backgroundColor: 'transparent'
|
45212 |
+
}
|
45213 |
+
}
|
45214 |
+
},
|
45215 |
+
'&$disabled': {
|
45216 |
+
color: theme.palette.action.disabled
|
45217 |
}
|
45218 |
+
},
|
45219 |
|
45220 |
+
/* Styles applied to the root element if `color="secondary"`. */
|
45221 |
+
colorSecondary: {
|
45222 |
+
'&$checked': {
|
45223 |
+
color: theme.palette.secondary.main,
|
45224 |
+
'&:hover': {
|
45225 |
+
backgroundColor: (0,colorManipulator/* fade */.U1)(theme.palette.secondary.main, theme.palette.action.hoverOpacity),
|
45226 |
+
// Reset on touch devices, it doesn't add specificity
|
45227 |
+
'@media (hover: none)': {
|
45228 |
+
backgroundColor: 'transparent'
|
45229 |
+
}
|
45230 |
+
}
|
45231 |
+
},
|
45232 |
+
'&$disabled': {
|
45233 |
+
color: theme.palette.action.disabled
|
45234 |
}
|
45235 |
+
}
|
45236 |
+
};
|
45237 |
+
};
|
45238 |
+
var defaultCheckedIcon = /*#__PURE__*/react.createElement(CheckBox, null);
|
45239 |
+
var defaultIcon = /*#__PURE__*/react.createElement(CheckBoxOutlineBlank, null);
|
45240 |
+
var defaultIndeterminateIcon = /*#__PURE__*/react.createElement(IndeterminateCheckBox, null);
|
45241 |
+
var Checkbox = /*#__PURE__*/react.forwardRef(function Checkbox(props, ref) {
|
45242 |
+
var _props$checkedIcon = props.checkedIcon,
|
45243 |
+
checkedIcon = _props$checkedIcon === void 0 ? defaultCheckedIcon : _props$checkedIcon,
|
45244 |
+
classes = props.classes,
|
45245 |
+
_props$color = props.color,
|
45246 |
+
color = _props$color === void 0 ? 'secondary' : _props$color,
|
45247 |
+
_props$icon = props.icon,
|
45248 |
+
iconProp = _props$icon === void 0 ? defaultIcon : _props$icon,
|
45249 |
+
_props$indeterminate = props.indeterminate,
|
45250 |
+
indeterminate = _props$indeterminate === void 0 ? false : _props$indeterminate,
|
45251 |
+
_props$indeterminateI = props.indeterminateIcon,
|
45252 |
+
indeterminateIconProp = _props$indeterminateI === void 0 ? defaultIndeterminateIcon : _props$indeterminateI,
|
45253 |
+
inputProps = props.inputProps,
|
45254 |
+
_props$size = props.size,
|
45255 |
+
size = _props$size === void 0 ? 'medium' : _props$size,
|
45256 |
+
other = (0,objectWithoutProperties/* default */.Z)(props, ["checkedIcon", "classes", "color", "icon", "indeterminate", "indeterminateIcon", "inputProps", "size"]);
|
45257 |
+
|
45258 |
+
var icon = indeterminate ? indeterminateIconProp : iconProp;
|
45259 |
+
var indeterminateIcon = indeterminate ? indeterminateIconProp : checkedIcon;
|
45260 |
+
return /*#__PURE__*/react.createElement(internal_SwitchBase, (0,esm_extends/* default */.Z)({
|
45261 |
+
type: "checkbox",
|
45262 |
+
classes: {
|
45263 |
+
root: (0,clsx_m/* default */.Z)(classes.root, classes["color".concat((0,utils_capitalize/* default */.Z)(color))], indeterminate && classes.indeterminate),
|
45264 |
+
checked: classes.checked,
|
45265 |
+
disabled: classes.disabled
|
45266 |
+
},
|
45267 |
+
color: color,
|
45268 |
+
inputProps: (0,esm_extends/* default */.Z)({
|
45269 |
+
'data-indeterminate': indeterminate
|
45270 |
+
}, inputProps),
|
45271 |
+
icon: /*#__PURE__*/react.cloneElement(icon, {
|
45272 |
+
fontSize: icon.props.fontSize === undefined && size === "small" ? size : icon.props.fontSize
|
45273 |
+
}),
|
45274 |
+
checkedIcon: /*#__PURE__*/react.cloneElement(indeterminateIcon, {
|
45275 |
+
fontSize: indeterminateIcon.props.fontSize === undefined && size === "small" ? size : indeterminateIcon.props.fontSize
|
45276 |
+
}),
|
45277 |
+
ref: ref
|
45278 |
+
}, other));
|
45279 |
+
});
|
45280 |
+
false ? 0 : void 0;
|
45281 |
+
/* harmony default export */ var Checkbox_Checkbox = ((0,withStyles/* default */.Z)(Checkbox_styles, {
|
45282 |
+
name: 'MuiCheckbox'
|
45283 |
+
})(Checkbox));
|
45284 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/svg-icons/Cancel.js
|
45285 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45286 |
|
45287 |
+
/**
|
45288 |
+
* @ignore - internal component.
|
45289 |
+
*/
|
45290 |
|
45291 |
+
/* harmony default export */ var Cancel = ((0,createSvgIcon/* default */.Z)( /*#__PURE__*/react.createElement("path", {
|
45292 |
+
d: "M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"
|
45293 |
+
}), 'Cancel'));
|
45294 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/Chip/Chip.js
|
45295 |
|
|
|
45296 |
|
|
|
45297 |
|
|
|
45298 |
|
45299 |
|
45300 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45301 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45302 |
|
|
|
45303 |
|
|
|
45304 |
|
|
|
45305 |
|
|
|
45306 |
|
45307 |
+
var Chip_styles = function styles(theme) {
|
45308 |
+
var backgroundColor = theme.palette.type === 'light' ? theme.palette.grey[300] : theme.palette.grey[700];
|
45309 |
+
var deleteIconColor = (0,colorManipulator/* fade */.U1)(theme.palette.text.primary, 0.26);
|
45310 |
+
return {
|
45311 |
+
/* Styles applied to the root element. */
|
45312 |
+
root: {
|
45313 |
+
fontFamily: theme.typography.fontFamily,
|
45314 |
+
fontSize: theme.typography.pxToRem(13),
|
45315 |
+
display: 'inline-flex',
|
45316 |
+
alignItems: 'center',
|
45317 |
+
justifyContent: 'center',
|
45318 |
+
height: 32,
|
45319 |
+
color: theme.palette.getContrastText(backgroundColor),
|
45320 |
+
backgroundColor: backgroundColor,
|
45321 |
+
borderRadius: 32 / 2,
|
45322 |
+
whiteSpace: 'nowrap',
|
45323 |
+
transition: theme.transitions.create(['background-color', 'box-shadow']),
|
45324 |
+
// label will inherit this from root, then `clickable` class overrides this for both
|
45325 |
+
cursor: 'default',
|
45326 |
+
// We disable the focus ring for mouse, touch and keyboard users.
|
45327 |
+
outline: 0,
|
45328 |
+
textDecoration: 'none',
|
45329 |
+
border: 'none',
|
45330 |
+
// Remove `button` border
|
45331 |
+
padding: 0,
|
45332 |
+
// Remove `button` padding
|
45333 |
+
verticalAlign: 'middle',
|
45334 |
+
boxSizing: 'border-box',
|
45335 |
+
'&$disabled': {
|
45336 |
+
opacity: 0.5,
|
45337 |
+
pointerEvents: 'none'
|
45338 |
+
},
|
45339 |
+
'& $avatar': {
|
45340 |
+
marginLeft: 5,
|
45341 |
+
marginRight: -6,
|
45342 |
+
width: 24,
|
45343 |
+
height: 24,
|
45344 |
+
color: theme.palette.type === 'light' ? theme.palette.grey[700] : theme.palette.grey[300],
|
45345 |
+
fontSize: theme.typography.pxToRem(12)
|
45346 |
+
},
|
45347 |
+
'& $avatarColorPrimary': {
|
45348 |
+
color: theme.palette.primary.contrastText,
|
45349 |
+
backgroundColor: theme.palette.primary.dark
|
45350 |
+
},
|
45351 |
+
'& $avatarColorSecondary': {
|
45352 |
+
color: theme.palette.secondary.contrastText,
|
45353 |
+
backgroundColor: theme.palette.secondary.dark
|
45354 |
+
},
|
45355 |
+
'& $avatarSmall': {
|
45356 |
+
marginLeft: 4,
|
45357 |
+
marginRight: -4,
|
45358 |
+
width: 18,
|
45359 |
+
height: 18,
|
45360 |
+
fontSize: theme.typography.pxToRem(10)
|
45361 |
+
}
|
45362 |
+
},
|
45363 |
|
45364 |
+
/* Styles applied to the root element if `size="small"`. */
|
45365 |
+
sizeSmall: {
|
45366 |
+
height: 24
|
45367 |
+
},
|
45368 |
|
45369 |
+
/* Styles applied to the root element if `color="primary"`. */
|
45370 |
+
colorPrimary: {
|
45371 |
+
backgroundColor: theme.palette.primary.main,
|
45372 |
+
color: theme.palette.primary.contrastText
|
45373 |
+
},
|
45374 |
|
45375 |
+
/* Styles applied to the root element if `color="secondary"`. */
|
45376 |
+
colorSecondary: {
|
45377 |
+
backgroundColor: theme.palette.secondary.main,
|
45378 |
+
color: theme.palette.secondary.contrastText
|
45379 |
+
},
|
45380 |
|
45381 |
+
/* Pseudo-class applied to the root element if `disabled={true}`. */
|
45382 |
+
disabled: {},
|
45383 |
|
45384 |
+
/* Styles applied to the root element if `onClick` is defined or `clickable={true}`. */
|
45385 |
+
clickable: {
|
45386 |
+
userSelect: 'none',
|
45387 |
+
WebkitTapHighlightColor: 'transparent',
|
45388 |
+
cursor: 'pointer',
|
45389 |
+
'&:hover, &:focus': {
|
45390 |
+
backgroundColor: (0,colorManipulator/* emphasize */._4)(backgroundColor, 0.08)
|
45391 |
+
},
|
45392 |
+
'&:active': {
|
45393 |
+
boxShadow: theme.shadows[1]
|
45394 |
+
}
|
45395 |
+
},
|
45396 |
|
45397 |
+
/* Styles applied to the root element if `onClick` and `color="primary"` is defined or `clickable={true}`. */
|
45398 |
+
clickableColorPrimary: {
|
45399 |
+
'&:hover, &:focus': {
|
45400 |
+
backgroundColor: (0,colorManipulator/* emphasize */._4)(theme.palette.primary.main, 0.08)
|
45401 |
+
}
|
45402 |
+
},
|
45403 |
|
45404 |
+
/* Styles applied to the root element if `onClick` and `color="secondary"` is defined or `clickable={true}`. */
|
45405 |
+
clickableColorSecondary: {
|
45406 |
+
'&:hover, &:focus': {
|
45407 |
+
backgroundColor: (0,colorManipulator/* emphasize */._4)(theme.palette.secondary.main, 0.08)
|
45408 |
+
}
|
45409 |
+
},
|
45410 |
|
45411 |
+
/* Styles applied to the root element if `onDelete` is defined. */
|
45412 |
+
deletable: {
|
45413 |
+
'&:focus': {
|
45414 |
+
backgroundColor: (0,colorManipulator/* emphasize */._4)(backgroundColor, 0.08)
|
45415 |
+
}
|
45416 |
+
},
|
45417 |
|
45418 |
+
/* Styles applied to the root element if `onDelete` and `color="primary"` is defined. */
|
45419 |
+
deletableColorPrimary: {
|
45420 |
+
'&:focus': {
|
45421 |
+
backgroundColor: (0,colorManipulator/* emphasize */._4)(theme.palette.primary.main, 0.2)
|
45422 |
+
}
|
45423 |
+
},
|
45424 |
|
45425 |
+
/* Styles applied to the root element if `onDelete` and `color="secondary"` is defined. */
|
45426 |
+
deletableColorSecondary: {
|
45427 |
+
'&:focus': {
|
45428 |
+
backgroundColor: (0,colorManipulator/* emphasize */._4)(theme.palette.secondary.main, 0.2)
|
45429 |
+
}
|
45430 |
+
},
|
45431 |
|
45432 |
+
/* Styles applied to the root element if `variant="outlined"`. */
|
45433 |
+
outlined: {
|
45434 |
+
backgroundColor: 'transparent',
|
45435 |
+
border: "1px solid ".concat(theme.palette.type === 'light' ? 'rgba(0, 0, 0, 0.23)' : 'rgba(255, 255, 255, 0.23)'),
|
45436 |
+
'$clickable&:hover, $clickable&:focus, $deletable&:focus': {
|
45437 |
+
backgroundColor: (0,colorManipulator/* fade */.U1)(theme.palette.text.primary, theme.palette.action.hoverOpacity)
|
45438 |
+
},
|
45439 |
+
'& $avatar': {
|
45440 |
+
marginLeft: 4
|
45441 |
+
},
|
45442 |
+
'& $avatarSmall': {
|
45443 |
+
marginLeft: 2
|
45444 |
+
},
|
45445 |
+
'& $icon': {
|
45446 |
+
marginLeft: 4
|
45447 |
+
},
|
45448 |
+
'& $iconSmall': {
|
45449 |
+
marginLeft: 2
|
45450 |
+
},
|
45451 |
+
'& $deleteIcon': {
|
45452 |
+
marginRight: 5
|
45453 |
+
},
|
45454 |
+
'& $deleteIconSmall': {
|
45455 |
+
marginRight: 3
|
45456 |
+
}
|
45457 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
45458 |
|
45459 |
+
/* Styles applied to the root element if `variant="outlined"` and `color="primary"`. */
|
45460 |
+
outlinedPrimary: {
|
45461 |
+
color: theme.palette.primary.main,
|
45462 |
+
border: "1px solid ".concat(theme.palette.primary.main),
|
45463 |
+
'$clickable&:hover, $clickable&:focus, $deletable&:focus': {
|
45464 |
+
backgroundColor: (0,colorManipulator/* fade */.U1)(theme.palette.primary.main, theme.palette.action.hoverOpacity)
|
45465 |
+
}
|
45466 |
+
},
|
45467 |
|
45468 |
+
/* Styles applied to the root element if `variant="outlined"` and `color="secondary"`. */
|
45469 |
+
outlinedSecondary: {
|
45470 |
+
color: theme.palette.secondary.main,
|
45471 |
+
border: "1px solid ".concat(theme.palette.secondary.main),
|
45472 |
+
'$clickable&:hover, $clickable&:focus, $deletable&:focus': {
|
45473 |
+
backgroundColor: (0,colorManipulator/* fade */.U1)(theme.palette.secondary.main, theme.palette.action.hoverOpacity)
|
45474 |
+
}
|
45475 |
+
},
|
45476 |
+
// TODO v5: remove
|
45477 |
|
45478 |
+
/* Styles applied to the `avatar` element. */
|
45479 |
+
avatar: {},
|
45480 |
|
45481 |
+
/* Styles applied to the `avatar` element if `size="small"`. */
|
45482 |
+
avatarSmall: {},
|
45483 |
|
45484 |
+
/* Styles applied to the `avatar` element if `color="primary"`. */
|
45485 |
+
avatarColorPrimary: {},
|
|
|
45486 |
|
45487 |
+
/* Styles applied to the `avatar` element if `color="secondary"`. */
|
45488 |
+
avatarColorSecondary: {},
|
45489 |
|
45490 |
+
/* Styles applied to the `icon` element. */
|
45491 |
+
icon: {
|
45492 |
+
color: theme.palette.type === 'light' ? theme.palette.grey[700] : theme.palette.grey[300],
|
45493 |
+
marginLeft: 5,
|
45494 |
+
marginRight: -6
|
45495 |
+
},
|
45496 |
|
45497 |
+
/* Styles applied to the `icon` element if `size="small"`. */
|
45498 |
+
iconSmall: {
|
45499 |
+
width: 18,
|
45500 |
+
height: 18,
|
45501 |
+
marginLeft: 4,
|
45502 |
+
marginRight: -4
|
45503 |
+
},
|
45504 |
|
45505 |
+
/* Styles applied to the `icon` element if `color="primary"`. */
|
45506 |
+
iconColorPrimary: {
|
45507 |
+
color: 'inherit'
|
45508 |
+
},
|
45509 |
|
45510 |
+
/* Styles applied to the `icon` element if `color="secondary"`. */
|
45511 |
+
iconColorSecondary: {
|
45512 |
+
color: 'inherit'
|
45513 |
+
},
|
45514 |
|
45515 |
+
/* Styles applied to the label `span` element. */
|
45516 |
+
label: {
|
45517 |
+
overflow: 'hidden',
|
45518 |
+
textOverflow: 'ellipsis',
|
45519 |
+
paddingLeft: 12,
|
45520 |
+
paddingRight: 12,
|
45521 |
+
whiteSpace: 'nowrap'
|
45522 |
+
},
|
45523 |
|
45524 |
+
/* Styles applied to the label `span` element if `size="small"`. */
|
45525 |
+
labelSmall: {
|
45526 |
+
paddingLeft: 8,
|
45527 |
+
paddingRight: 8
|
45528 |
+
},
|
45529 |
|
45530 |
+
/* Styles applied to the `deleteIcon` element. */
|
45531 |
+
deleteIcon: {
|
45532 |
+
WebkitTapHighlightColor: 'transparent',
|
45533 |
+
color: deleteIconColor,
|
45534 |
+
height: 22,
|
45535 |
+
width: 22,
|
45536 |
+
cursor: 'pointer',
|
45537 |
+
margin: '0 5px 0 -6px',
|
45538 |
+
'&:hover': {
|
45539 |
+
color: (0,colorManipulator/* fade */.U1)(deleteIconColor, 0.4)
|
45540 |
}
|
45541 |
+
},
|
|
|
|
|
|
|
|
|
45542 |
|
45543 |
+
/* Styles applied to the `deleteIcon` element if `size="small"`. */
|
45544 |
+
deleteIconSmall: {
|
45545 |
+
height: 16,
|
45546 |
+
width: 16,
|
45547 |
+
marginRight: 4,
|
45548 |
+
marginLeft: -4
|
45549 |
+
},
|
45550 |
|
45551 |
+
/* Styles applied to the deleteIcon element if `color="primary"` and `variant="default"`. */
|
45552 |
+
deleteIconColorPrimary: {
|
45553 |
+
color: (0,colorManipulator/* fade */.U1)(theme.palette.primary.contrastText, 0.7),
|
45554 |
+
'&:hover, &:active': {
|
45555 |
+
color: theme.palette.primary.contrastText
|
45556 |
+
}
|
45557 |
+
},
|
45558 |
|
45559 |
+
/* Styles applied to the deleteIcon element if `color="secondary"` and `variant="default"`. */
|
45560 |
+
deleteIconColorSecondary: {
|
45561 |
+
color: (0,colorManipulator/* fade */.U1)(theme.palette.secondary.contrastText, 0.7),
|
45562 |
+
'&:hover, &:active': {
|
45563 |
+
color: theme.palette.secondary.contrastText
|
45564 |
}
|
45565 |
+
},
|
45566 |
|
45567 |
+
/* Styles applied to the deleteIcon element if `color="primary"` and `variant="outlined"`. */
|
45568 |
+
deleteIconOutlinedColorPrimary: {
|
45569 |
+
color: (0,colorManipulator/* fade */.U1)(theme.palette.primary.main, 0.7),
|
45570 |
+
'&:hover, &:active': {
|
45571 |
+
color: theme.palette.primary.main
|
45572 |
+
}
|
45573 |
+
},
|
45574 |
|
45575 |
+
/* Styles applied to the deleteIcon element if `color="secondary"` and `variant="outlined"`. */
|
45576 |
+
deleteIconOutlinedColorSecondary: {
|
45577 |
+
color: (0,colorManipulator/* fade */.U1)(theme.palette.secondary.main, 0.7),
|
45578 |
+
'&:hover, &:active': {
|
45579 |
+
color: theme.palette.secondary.main
|
45580 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45581 |
}
|
45582 |
+
};
|
45583 |
+
};
|
45584 |
|
45585 |
+
function isDeleteKeyboardEvent(keyboardEvent) {
|
45586 |
+
return keyboardEvent.key === 'Backspace' || keyboardEvent.key === 'Delete';
|
45587 |
+
}
|
45588 |
+
/**
|
45589 |
+
* Chips represent complex entities in small blocks, such as a contact.
|
45590 |
+
*/
|
45591 |
|
|
|
|
|
|
|
|
|
|
|
|
|
45592 |
|
45593 |
+
var Chip = /*#__PURE__*/react.forwardRef(function Chip(props, ref) {
|
45594 |
+
var avatarProp = props.avatar,
|
45595 |
+
classes = props.classes,
|
45596 |
+
className = props.className,
|
45597 |
+
clickableProp = props.clickable,
|
45598 |
+
_props$color = props.color,
|
45599 |
+
color = _props$color === void 0 ? 'default' : _props$color,
|
45600 |
+
ComponentProp = props.component,
|
45601 |
+
deleteIconProp = props.deleteIcon,
|
45602 |
+
_props$disabled = props.disabled,
|
45603 |
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
45604 |
+
iconProp = props.icon,
|
45605 |
+
label = props.label,
|
45606 |
+
onClick = props.onClick,
|
45607 |
+
onDelete = props.onDelete,
|
45608 |
+
onKeyDown = props.onKeyDown,
|
45609 |
+
onKeyUp = props.onKeyUp,
|
45610 |
+
_props$size = props.size,
|
45611 |
+
size = _props$size === void 0 ? 'medium' : _props$size,
|
45612 |
+
_props$variant = props.variant,
|
45613 |
+
variant = _props$variant === void 0 ? 'default' : _props$variant,
|
45614 |
+
other = (0,objectWithoutProperties/* default */.Z)(props, ["avatar", "classes", "className", "clickable", "color", "component", "deleteIcon", "disabled", "icon", "label", "onClick", "onDelete", "onKeyDown", "onKeyUp", "size", "variant"]);
|
45615 |
|
45616 |
+
var chipRef = react.useRef(null);
|
45617 |
+
var handleRef = (0,useForkRef/* default */.Z)(chipRef, ref);
|
45618 |
|
45619 |
+
var handleDeleteIconClick = function handleDeleteIconClick(event) {
|
45620 |
+
// Stop the event from bubbling up to the `Chip`
|
45621 |
+
event.stopPropagation();
|
45622 |
|
45623 |
+
if (onDelete) {
|
45624 |
+
onDelete(event);
|
45625 |
+
}
|
45626 |
+
};
|
45627 |
|
45628 |
+
var handleKeyDown = function handleKeyDown(event) {
|
45629 |
+
// Ignore events from children of `Chip`.
|
45630 |
+
if (event.currentTarget === event.target && isDeleteKeyboardEvent(event)) {
|
45631 |
+
// will be handled in keyUp, otherwise some browsers
|
45632 |
+
// might init navigation
|
45633 |
+
event.preventDefault();
|
45634 |
+
}
|
45635 |
|
45636 |
+
if (onKeyDown) {
|
45637 |
+
onKeyDown(event);
|
45638 |
+
}
|
45639 |
+
};
|
45640 |
|
45641 |
+
var handleKeyUp = function handleKeyUp(event) {
|
45642 |
+
// Ignore events from children of `Chip`.
|
45643 |
+
if (event.currentTarget === event.target) {
|
45644 |
+
if (onDelete && isDeleteKeyboardEvent(event)) {
|
45645 |
+
onDelete(event);
|
45646 |
+
} else if (event.key === 'Escape' && chipRef.current) {
|
45647 |
+
chipRef.current.blur();
|
45648 |
+
}
|
45649 |
+
}
|
45650 |
|
45651 |
+
if (onKeyUp) {
|
45652 |
+
onKeyUp(event);
|
45653 |
+
}
|
45654 |
+
};
|
45655 |
|
45656 |
+
var clickable = clickableProp !== false && onClick ? true : clickableProp;
|
45657 |
+
var small = size === 'small';
|
45658 |
+
var Component = ComponentProp || (clickable ? ButtonBase_ButtonBase : 'div');
|
45659 |
+
var moreProps = Component === ButtonBase_ButtonBase ? {
|
45660 |
+
component: 'div'
|
45661 |
+
} : {};
|
45662 |
+
var deleteIcon = null;
|
45663 |
|
45664 |
+
if (onDelete) {
|
45665 |
+
var customClasses = (0,clsx_m/* default */.Z)(color !== 'default' && (variant === "default" ? classes["deleteIconColor".concat((0,utils_capitalize/* default */.Z)(color))] : classes["deleteIconOutlinedColor".concat((0,utils_capitalize/* default */.Z)(color))]), small && classes.deleteIconSmall);
|
45666 |
+
deleteIcon = deleteIconProp && /*#__PURE__*/react.isValidElement(deleteIconProp) ? /*#__PURE__*/react.cloneElement(deleteIconProp, {
|
45667 |
+
className: (0,clsx_m/* default */.Z)(deleteIconProp.props.className, classes.deleteIcon, customClasses),
|
45668 |
+
onClick: handleDeleteIconClick
|
45669 |
+
}) : /*#__PURE__*/react.createElement(Cancel, {
|
45670 |
+
className: (0,clsx_m/* default */.Z)(classes.deleteIcon, customClasses),
|
45671 |
+
onClick: handleDeleteIconClick
|
45672 |
+
});
|
45673 |
+
}
|
45674 |
|
45675 |
+
var avatar = null;
|
45676 |
|
45677 |
+
if (avatarProp && /*#__PURE__*/react.isValidElement(avatarProp)) {
|
45678 |
+
avatar = /*#__PURE__*/react.cloneElement(avatarProp, {
|
45679 |
+
className: (0,clsx_m/* default */.Z)(classes.avatar, avatarProp.props.className, small && classes.avatarSmall, color !== 'default' && classes["avatarColor".concat((0,utils_capitalize/* default */.Z)(color))])
|
45680 |
+
});
|
45681 |
+
}
|
45682 |
|
45683 |
+
var icon = null;
|
45684 |
|
45685 |
+
if (iconProp && /*#__PURE__*/react.isValidElement(iconProp)) {
|
45686 |
+
icon = /*#__PURE__*/react.cloneElement(iconProp, {
|
45687 |
+
className: (0,clsx_m/* default */.Z)(classes.icon, iconProp.props.className, small && classes.iconSmall, color !== 'default' && classes["iconColor".concat((0,utils_capitalize/* default */.Z)(color))])
|
45688 |
+
});
|
45689 |
+
}
|
45690 |
|
45691 |
+
if (false) {}
|
45692 |
|
45693 |
+
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
45694 |
+
role: clickable || onDelete ? 'button' : undefined,
|
45695 |
+
className: (0,clsx_m/* default */.Z)(classes.root, className, color !== 'default' && [classes["color".concat((0,utils_capitalize/* default */.Z)(color))], clickable && classes["clickableColor".concat((0,utils_capitalize/* default */.Z)(color))], onDelete && classes["deletableColor".concat((0,utils_capitalize/* default */.Z)(color))]], variant !== "default" && [classes.outlined, {
|
45696 |
+
'primary': classes.outlinedPrimary,
|
45697 |
+
'secondary': classes.outlinedSecondary
|
45698 |
+
}[color]], disabled && classes.disabled, small && classes.sizeSmall, clickable && classes.clickable, onDelete && classes.deletable),
|
45699 |
+
"aria-disabled": disabled ? true : undefined,
|
45700 |
+
tabIndex: clickable || onDelete ? 0 : undefined,
|
45701 |
+
onClick: onClick,
|
45702 |
+
onKeyDown: handleKeyDown,
|
45703 |
+
onKeyUp: handleKeyUp,
|
45704 |
+
ref: handleRef
|
45705 |
+
}, moreProps, other), avatar || icon, /*#__PURE__*/react.createElement("span", {
|
45706 |
+
className: (0,clsx_m/* default */.Z)(classes.label, small && classes.labelSmall)
|
45707 |
+
}, label), deleteIcon);
|
45708 |
+
});
|
45709 |
+
false ? 0 : void 0;
|
45710 |
+
/* harmony default export */ var Chip_Chip = ((0,withStyles/* default */.Z)(Chip_styles, {
|
45711 |
+
name: 'MuiChip'
|
45712 |
+
})(Chip));
|
45713 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Dialogs/TemplatesDialog/TemplateOptions.js
|
45714 |
+
function TemplateOptions_slicedToArray(arr, i) { return TemplateOptions_arrayWithHoles(arr) || TemplateOptions_iterableToArrayLimit(arr, i) || TemplateOptions_unsupportedIterableToArray(arr, i) || TemplateOptions_nonIterableRest(); }
|
45715 |
|
45716 |
+
function TemplateOptions_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
45717 |
|
45718 |
+
function TemplateOptions_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return TemplateOptions_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return TemplateOptions_arrayLikeToArray(o, minLen); }
|
45719 |
|
45720 |
+
function TemplateOptions_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
45721 |
|
45722 |
+
function TemplateOptions_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
45723 |
|
45724 |
+
function TemplateOptions_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45725 |
|
45726 |
+
function TemplateOptions_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
|
|
45727 |
|
45728 |
+
function TemplateOptions_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { TemplateOptions_ownKeys(Object(source), true).forEach(function (key) { TemplateOptions_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { TemplateOptions_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
|
|
|
|
45729 |
|
45730 |
+
function TemplateOptions_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
|
|
|
|
|
45731 |
|
|
|
|
|
|
|
|
|
45732 |
|
|
|
45733 |
|
|
|
|
|
|
|
45734 |
|
|
|
45735 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45736 |
|
|
|
|
|
|
|
|
|
45737 |
|
|
|
45738 |
|
|
|
|
|
|
|
|
|
|
|
45739 |
|
|
|
|
|
|
|
|
|
45740 |
|
|
|
|
|
|
|
|
|
45741 |
|
45742 |
+
var filteredList = function filteredList(importFilteredList, filterButtons, filterFrameDesign, filterPopularAction) {
|
45743 |
+
var filteredList = importFilteredList.filter(function (template) {
|
45744 |
+
// Filter correct buttons
|
45745 |
+
if (template.export_type !== filterButtons) {
|
45746 |
+
return false;
|
45747 |
+
} // Hide wrong menu styles
|
45748 |
|
|
|
|
|
45749 |
|
45750 |
+
if (filterButtons === "group" && filterFrameDesign.length !== 0) {
|
45751 |
+
if (!filterFrameDesign.includes(dlv_umd_default()(template, "group_type", "default"))) return false;
|
45752 |
+
} // Hide filtered button actions
|
|
|
45753 |
|
|
|
|
|
45754 |
|
45755 |
+
if (filterButtons === "button" && filterPopularAction.length !== 0) {
|
45756 |
+
if (!filterPopularAction.includes(dlv_umd_default()(template, "type", "url"))) return false;
|
45757 |
+
}
|
45758 |
|
45759 |
+
return true;
|
45760 |
+
});
|
45761 |
+
var defaultButton = {
|
45762 |
+
name: translate("utils.new_button"),
|
45763 |
+
show_mobile: true,
|
45764 |
+
show_desktop: true
|
45765 |
+
};
|
45766 |
|
45767 |
+
if (filterButtons === "group") {
|
45768 |
+
filteredList.unshift({
|
45769 |
+
data: {
|
45770 |
+
name: translate("utils.new_group"),
|
45771 |
+
show_mobile: true,
|
45772 |
+
show_desktop: true
|
45773 |
+
},
|
45774 |
+
buttons: [defaultButton],
|
45775 |
+
export_type: "group"
|
45776 |
+
});
|
45777 |
+
} else if (filterButtons === "button") {
|
45778 |
+
filteredList.unshift(TemplateOptions_objectSpread(TemplateOptions_objectSpread({}, defaultButton), {}, {
|
45779 |
+
export_type: "button"
|
45780 |
+
}));
|
45781 |
+
}
|
45782 |
|
45783 |
+
return filteredList;
|
45784 |
+
};
|
45785 |
|
45786 |
+
function TemplateOptions(_ref) {
|
45787 |
+
var index = _ref.index,
|
45788 |
+
currentGroup = _ref.currentGroup,
|
45789 |
+
onClose = _ref.onClose,
|
45790 |
+
returnedTemplates = _ref.returnedTemplates,
|
45791 |
+
filterButtons = _ref.filterButtons,
|
45792 |
+
filterFrameDesign = _ref.filterFrameDesign,
|
45793 |
+
filterPopularAction = _ref.filterPopularAction;
|
45794 |
|
45795 |
+
var _useState = (0,react.useState)([]),
|
45796 |
+
_useState2 = TemplateOptions_slicedToArray(_useState, 2),
|
45797 |
+
importFilteredList = _useState2[0],
|
45798 |
+
setImportFilteredList = _useState2[1];
|
45799 |
|
45800 |
+
var _useState3 = (0,react.useState)(true),
|
45801 |
+
_useState4 = TemplateOptions_slicedToArray(_useState3, 2),
|
45802 |
+
isLoading = _useState4[0],
|
45803 |
+
setIsLoading = _useState4[1];
|
45804 |
|
45805 |
+
var _useState5 = (0,react.useState)([]),
|
45806 |
+
_useState6 = TemplateOptions_slicedToArray(_useState5, 2),
|
45807 |
+
selected = _useState6[0],
|
45808 |
+
setSelected = _useState6[1];
|
45809 |
|
45810 |
+
var filteredTemplateList = filteredList(importFilteredList, filterButtons, filterFrameDesign, filterPopularAction);
|
|
|
|
|
|
|
45811 |
|
45812 |
+
var handleCheckboxSelect = function handleCheckboxSelect(id) {
|
45813 |
+
var selectedIndex = selected.indexOf(id);
|
45814 |
+
var newSelected = [];
|
|
|
|
|
45815 |
|
45816 |
+
if (selectedIndex === -1) {
|
45817 |
+
newSelected = newSelected.concat(selected, id);
|
45818 |
+
} else if (selectedIndex === 0) {
|
45819 |
+
newSelected = newSelected.concat(selected.slice(1));
|
45820 |
+
} else if (selectedIndex === selected.length - 1) {
|
45821 |
+
newSelected = newSelected.concat(selected.slice(0, -1));
|
45822 |
+
} else if (selectedIndex > 0) {
|
45823 |
+
newSelected = newSelected.concat(selected.slice(0, selectedIndex), selected.slice(selectedIndex + 1));
|
45824 |
+
}
|
45825 |
|
45826 |
+
setSelected(newSelected);
|
45827 |
+
};
|
|
|
|
|
|
|
|
|
45828 |
|
45829 |
+
var handleSelectImport = function handleSelectImport() {
|
45830 |
+
var actualTemplates = selected.map(function (val) {
|
45831 |
+
return filteredTemplateList[val];
|
45832 |
+
});
|
45833 |
|
45834 |
+
if (filterButtons === "button") {
|
45835 |
+
ImportData(currentGroup, null, actualTemplates, index, actualTemplates.length === 1);
|
45836 |
+
}
|
|
|
45837 |
|
45838 |
+
handleClose();
|
45839 |
+
};
|
45840 |
|
45841 |
+
var handleClose = function handleClose() {
|
45842 |
+
onClose();
|
45843 |
+
setSelected([]);
|
|
|
45844 |
};
|
45845 |
|
45846 |
+
(0,react.useEffect)(function () {
|
45847 |
+
importTemplates().then(function (result) {
|
45848 |
+
setImportFilteredList(result);
|
45849 |
+
setIsLoading(false);
|
45850 |
+
})["catch"](function (err) {
|
45851 |
+
console.error(err);
|
45852 |
+
});
|
45853 |
+
}, []);
|
45854 |
+
(0,react.useEffect)(function () {
|
45855 |
+
setSelected([]);
|
45856 |
+
}, [filterButtons, filterFrameDesign, filterPopularAction]);
|
45857 |
+
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(DialogContent_DialogContent, null, !isLoading && returnedTemplates && /*#__PURE__*/react.createElement("p", {
|
45858 |
+
className: "search-results"
|
45859 |
+
}, /*#__PURE__*/react.createElement(Trans, {
|
45860 |
+
i18nKey: "utils.templates.found",
|
45861 |
+
values: {
|
45862 |
+
resultCount: filteredTemplateList.length
|
45863 |
},
|
45864 |
+
components: {
|
45865 |
+
bold: /*#__PURE__*/react.createElement("strong", null)
|
45866 |
+
}
|
45867 |
+
})), isLoading && /*#__PURE__*/react.createElement("div", {
|
45868 |
+
className: "loading"
|
45869 |
+
}, /*#__PURE__*/react.createElement("div", {
|
45870 |
style: {
|
45871 |
+
alignSelf: "center"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45872 |
}
|
45873 |
+
}, /*#__PURE__*/react.createElement("svg", {
|
45874 |
+
width: "60",
|
45875 |
+
height: "60",
|
45876 |
+
viewBox: "0 0 38 38",
|
45877 |
+
xmlns: "http://www.w3.org/2000/svg",
|
45878 |
+
stroke: "#2f788a"
|
45879 |
+
}, /*#__PURE__*/react.createElement("g", {
|
45880 |
+
fill: "none",
|
45881 |
+
fillRule: "evenodd"
|
45882 |
+
}, /*#__PURE__*/react.createElement("g", {
|
45883 |
+
transform: "translate(1 1)",
|
45884 |
+
strokeWidth: "2"
|
45885 |
+
}, /*#__PURE__*/react.createElement("circle", {
|
45886 |
+
strokeOpacity: ".5",
|
45887 |
+
cx: "18",
|
45888 |
+
cy: "18",
|
45889 |
+
r: "18"
|
45890 |
+
}), /*#__PURE__*/react.createElement("path", {
|
45891 |
+
d: "M36 18c0-9.94-8.06-18-18-18"
|
45892 |
+
}, /*#__PURE__*/react.createElement("animateTransform", {
|
45893 |
+
attributeName: "transform",
|
45894 |
+
type: "rotate",
|
45895 |
+
from: "0 18 18",
|
45896 |
+
to: "360 18 18",
|
45897 |
+
dur: "1s",
|
45898 |
+
repeatCount: "indefinite"
|
45899 |
+
}))))), /*#__PURE__*/react.createElement("p", null, translate("loading.loading")))), !isLoading && /*#__PURE__*/react.createElement("div", {
|
45900 |
+
className: "template"
|
45901 |
+
}, filteredTemplateList.map(function (template, key) {
|
45902 |
+
return /*#__PURE__*/react.createElement("div", {
|
45903 |
+
key: key,
|
45904 |
+
className: "container",
|
45905 |
+
"data-testid": "templates:template-option"
|
45906 |
+
}, filterButtons === "button" && /*#__PURE__*/react.createElement(Checkbox_Checkbox, {
|
45907 |
+
checked: selected.includes(key),
|
45908 |
+
onChange: function onChange() {
|
45909 |
+
handleCheckboxSelect(key);
|
45910 |
+
},
|
45911 |
+
className: (0,clsx_m/* default */.Z)("checkbox", selected.length === 0 && "hidden"),
|
45912 |
+
"data-testid": "templates:template-option-checkbox"
|
45913 |
+
}), /*#__PURE__*/react.createElement("div", {
|
45914 |
+
className: "type",
|
45915 |
+
onClick: function onClick() {
|
45916 |
+
if (selected.length > 0) {
|
45917 |
+
return handleCheckboxSelect(key);
|
45918 |
+
}
|
45919 |
+
|
45920 |
+
ImportRawData(template, index, currentGroup, true);
|
45921 |
+
handleClose();
|
45922 |
}
|
45923 |
+
}, key === 0 ? /*#__PURE__*/react.createElement("div", {
|
45924 |
+
className: "default-option"
|
45925 |
+
}, /*#__PURE__*/react.createElement("i", {
|
45926 |
+
className: "fa fa-plus-circle",
|
45927 |
+
"aria-hidden": "true"
|
45928 |
+
}), /*#__PURE__*/react.createElement("span", null, translate("templates.start_scratch"))) : /*#__PURE__*/react.createElement("img", {
|
45929 |
+
src: template.template_image ? buttonizer_admin.assets + "/images/templates/".concat(template.template_image) : buttonizer_admin.assets + "/images/buttonizer-logo.png",
|
45930 |
+
alt: "Template",
|
45931 |
+
draggable: false
|
45932 |
+
}), key > 0 && filterButtons === "button" && /*#__PURE__*/react.createElement(Chip_Chip, {
|
45933 |
+
className: "category",
|
45934 |
+
size: "small",
|
45935 |
+
key: key,
|
45936 |
+
label: template.name
|
45937 |
+
}), /*#__PURE__*/react.createElement("div", {
|
45938 |
+
className: "select"
|
45939 |
+
}, selected.includes(key) ? /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("i", {
|
45940 |
+
className: "fa fa-check-circle",
|
45941 |
+
"aria-hidden": "true"
|
45942 |
+
}), translate("templates.selected")) : /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("i", {
|
45943 |
+
className: "fa fa-plus-circle",
|
45944 |
+
"aria-hidden": "true"
|
45945 |
+
}), translate("templates.select")))));
|
45946 |
+
}))), /*#__PURE__*/react.createElement(DialogActions_DialogActions, {
|
45947 |
style: {
|
45948 |
+
marginTop: "20px",
|
45949 |
+
justifyContent: "space-between"
|
|
|
|
|
|
|
45950 |
}
|
45951 |
+
}, /*#__PURE__*/react.createElement(ImportButton, {
|
45952 |
+
index: index,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45953 |
style: {
|
45954 |
+
fontSize: 13
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45955 |
},
|
45956 |
+
currentGroup: currentGroup,
|
45957 |
+
label: filterButtons === "button" ? translate("import_export.import.new_group.button") : translate("import_export.import.new_group.group"),
|
45958 |
+
kbLink: 653,
|
45959 |
+
onClose: handleClose
|
45960 |
+
}), selected.length > 0 && /*#__PURE__*/react.createElement(Button_Button, {
|
45961 |
+
className: (0,clsx_m/* default */.Z)("select-all", selected.length > 0 && "visible"),
|
45962 |
+
variant: "contained",
|
45963 |
onClick: function onClick() {
|
45964 |
+
return handleSelectImport();
|
|
|
45965 |
},
|
45966 |
color: "primary",
|
45967 |
+
size: "small",
|
45968 |
+
"data-testid": "templates:insert-selected"
|
45969 |
+
}, translate("templates.insert"))));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45970 |
}
|
45971 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Settings/ButtonAction/ButtonActionOptions.js
|
45972 |
+
function ButtonActionOptions_toConsumableArray(arr) { return ButtonActionOptions_arrayWithoutHoles(arr) || ButtonActionOptions_iterableToArray(arr) || ButtonActionOptions_unsupportedIterableToArray(arr) || ButtonActionOptions_nonIterableSpread(); }
|
|
|
45973 |
|
45974 |
+
function ButtonActionOptions_nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
45975 |
|
45976 |
+
function ButtonActionOptions_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ButtonActionOptions_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ButtonActionOptions_arrayLikeToArray(o, minLen); }
|
45977 |
|
45978 |
+
function ButtonActionOptions_iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
45979 |
|
45980 |
+
function ButtonActionOptions_arrayWithoutHoles(arr) { if (Array.isArray(arr)) return ButtonActionOptions_arrayLikeToArray(arr); }
|
45981 |
|
45982 |
+
function ButtonActionOptions_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
45983 |
|
45984 |
+
function ButtonActionOptions_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
45985 |
|
45986 |
+
function ButtonActionOptions_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ButtonActionOptions_ownKeys(Object(source), true).forEach(function (key) { ButtonActionOptions_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ButtonActionOptions_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
45987 |
|
45988 |
+
function ButtonActionOptions_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
45989 |
|
45990 |
+
var popular = [{
|
45991 |
+
value: "url",
|
45992 |
+
label: "settings.button_action.actions.url.name"
|
45993 |
+
}, {
|
45994 |
+
value: "page",
|
45995 |
+
label: "settings.button_action.actions.page.name",
|
45996 |
+
standalone: false
|
45997 |
+
}, {
|
45998 |
+
value: "phone",
|
45999 |
+
label: "settings.button_action.actions.phone_number.name"
|
46000 |
+
}, {
|
46001 |
+
value: "mail",
|
46002 |
+
label: "settings.button_action.actions.mail.name"
|
46003 |
+
}, {
|
46004 |
+
value: "whatsapp",
|
46005 |
+
label: "settings.button_action.actions.whatsapp_chat"
|
46006 |
+
}, {
|
46007 |
+
value: "backtotop",
|
46008 |
+
label: "settings.button_action.actions.back_to_top"
|
46009 |
+
}, {
|
46010 |
+
value: "gotobottom",
|
46011 |
+
label: "settings.button_action.actions.go_to_bottom"
|
46012 |
+
}, {
|
46013 |
+
value: "gobackpage",
|
46014 |
+
label: "settings.button_action.actions.go_back_one_page"
|
46015 |
+
}, {
|
46016 |
+
value: "javascript_pro",
|
46017 |
+
label: "settings.button_action.actions.javascript.name",
|
46018 |
+
isPro: true
|
46019 |
+
}, {
|
46020 |
+
value: "socialsharing",
|
46021 |
+
label: "settings.button_action.actions.social_sharing.social_sharing"
|
46022 |
+
}].filter(function (obj) {
|
46023 |
+
return window.buttonizer_admin.is_stand_alone ? typeof obj.standalone === "undefined" : true;
|
46024 |
+
}).map(function (obj) {
|
46025 |
+
return ButtonActionOptions_objectSpread(ButtonActionOptions_objectSpread({}, obj), {}, {
|
46026 |
+
group: "popular"
|
46027 |
+
});
|
46028 |
+
});
|
46029 |
+
var chat = [{
|
46030 |
+
value: "sms",
|
46031 |
+
label: "settings.button_action.actions.chat.sms"
|
46032 |
+
}, {
|
46033 |
+
value: "messenger_chat",
|
46034 |
+
label: "settings.button_action.actions.chat.messenger_chat"
|
46035 |
+
}, {
|
46036 |
+
value: "messenger",
|
46037 |
+
label: "settings.button_action.actions.chat.messenger_link"
|
46038 |
+
}, {
|
46039 |
+
value: "twitter_dm",
|
46040 |
+
label: "settings.button_action.actions.chat.twitter_dm"
|
46041 |
+
}, {
|
46042 |
+
value: "skype",
|
46043 |
+
label: "settings.button_action.actions.chat.skype"
|
46044 |
+
}, {
|
46045 |
+
value: "line",
|
46046 |
+
label: "settings.button_action.actions.chat.line"
|
46047 |
+
}, {
|
46048 |
+
value: "telegram",
|
46049 |
+
label: "settings.button_action.actions.chat.telegram"
|
46050 |
+
}, {
|
46051 |
+
value: "viber",
|
46052 |
+
label: "settings.button_action.actions.chat.viber"
|
46053 |
+
}, {
|
46054 |
+
value: "signal_group",
|
46055 |
+
label: "settings.button_action.actions.chat.signal_group"
|
46056 |
+
}].map(function (obj) {
|
46057 |
+
return ButtonActionOptions_objectSpread(ButtonActionOptions_objectSpread({}, obj), {}, {
|
46058 |
+
group: "chat"
|
46059 |
+
});
|
46060 |
+
});
|
46061 |
+
var socialMedia = [{
|
46062 |
+
value: "facebook",
|
46063 |
+
label: "settings.button_action.actions.social_media.facebook"
|
46064 |
+
}, {
|
46065 |
+
value: "twitter",
|
46066 |
+
label: "settings.button_action.actions.social_media.twitter"
|
46067 |
+
}, {
|
46068 |
+
value: "instagram",
|
46069 |
+
label: "settings.button_action.actions.social_media.instagram"
|
46070 |
+
}, {
|
46071 |
+
value: "snapchat",
|
46072 |
+
label: "settings.button_action.actions.social_media.snapchat"
|
46073 |
+
}, {
|
46074 |
+
value: "linkedin",
|
46075 |
+
label: "settings.button_action.actions.social_media.linkedin"
|
46076 |
+
}, {
|
46077 |
+
value: "vk",
|
46078 |
+
label: "settings.button_action.actions.social_media.vk"
|
46079 |
+
}, {
|
46080 |
+
value: "waze",
|
46081 |
+
label: "settings.button_action.actions.social_media.waze"
|
46082 |
+
}].map(function (obj) {
|
46083 |
+
return ButtonActionOptions_objectSpread(ButtonActionOptions_objectSpread({}, obj), {}, {
|
46084 |
+
group: "social_media"
|
46085 |
+
});
|
46086 |
+
});
|
46087 |
+
var popup = [{
|
46088 |
+
value: "poptin",
|
46089 |
+
label: "Poptin"
|
46090 |
+
}, {
|
46091 |
+
value: "elementor_popup",
|
46092 |
+
label: "Elementor Popup"
|
46093 |
+
}, {
|
46094 |
+
value: "popup_maker",
|
46095 |
+
label: "Popup Maker"
|
46096 |
+
}, {
|
46097 |
+
value: "popups",
|
46098 |
+
label: "Popups - WordPress Popup"
|
46099 |
+
}, {
|
46100 |
+
value: "wppopups",
|
46101 |
+
label: "WP Popups - WordPress Popup builder"
|
46102 |
+
}].map(function (obj) {
|
46103 |
+
return ButtonActionOptions_objectSpread(ButtonActionOptions_objectSpread({}, obj), {}, {
|
46104 |
+
group: "popup"
|
46105 |
+
});
|
46106 |
+
});
|
46107 |
+
var other = [{
|
46108 |
+
value: "clipboard",
|
46109 |
+
label: "settings.button_action.actions.clipboard"
|
46110 |
+
}, {
|
46111 |
+
value: "print",
|
46112 |
+
label: "settings.button_action.actions.print_page"
|
46113 |
+
}].map(function (obj) {
|
46114 |
+
return ButtonActionOptions_objectSpread(ButtonActionOptions_objectSpread({}, obj), {}, {
|
46115 |
+
group: "actions"
|
46116 |
+
});
|
46117 |
+
});
|
46118 |
+
/* harmony default export */ var ButtonActionOptions = ([].concat(ButtonActionOptions_toConsumableArray(popular), ButtonActionOptions_toConsumableArray(chat), ButtonActionOptions_toConsumableArray(socialMedia), ButtonActionOptions_toConsumableArray(popup), ButtonActionOptions_toConsumableArray(other)));
|
46119 |
+
;// CONCATENATED MODULE: ./node_modules/popper.js/dist/esm/popper.js
|
46120 |
+
/**!
|
46121 |
+
* @fileOverview Kickass library to create and place poppers near their reference elements.
|
46122 |
+
* @version 1.16.1-lts
|
46123 |
+
* @license
|
46124 |
+
* Copyright (c) 2016 Federico Zivolo and contributors
|
46125 |
+
*
|
46126 |
+
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
46127 |
+
* of this software and associated documentation files (the "Software"), to deal
|
46128 |
+
* in the Software without restriction, including without limitation the rights
|
46129 |
+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
46130 |
+
* copies of the Software, and to permit persons to whom the Software is
|
46131 |
+
* furnished to do so, subject to the following conditions:
|
46132 |
+
*
|
46133 |
+
* The above copyright notice and this permission notice shall be included in all
|
46134 |
+
* copies or substantial portions of the Software.
|
46135 |
+
*
|
46136 |
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
46137 |
+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
46138 |
+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
46139 |
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
46140 |
+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
46141 |
+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
46142 |
+
* SOFTWARE.
|
46143 |
*/
|
46144 |
+
var popper_isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined' && typeof navigator !== 'undefined';
|
46145 |
|
46146 |
+
var timeoutDuration = function () {
|
46147 |
+
var longerTimeoutBrowsers = ['Edge', 'Trident', 'Firefox'];
|
46148 |
+
for (var i = 0; i < longerTimeoutBrowsers.length; i += 1) {
|
46149 |
+
if (popper_isBrowser && navigator.userAgent.indexOf(longerTimeoutBrowsers[i]) >= 0) {
|
46150 |
+
return 1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46151 |
}
|
46152 |
+
}
|
46153 |
+
return 0;
|
46154 |
+
}();
|
46155 |
|
46156 |
+
function microtaskDebounce(fn) {
|
46157 |
+
var called = false;
|
46158 |
+
return function () {
|
46159 |
+
if (called) {
|
46160 |
+
return;
|
46161 |
}
|
46162 |
+
called = true;
|
46163 |
+
window.Promise.resolve().then(function () {
|
46164 |
+
called = false;
|
46165 |
+
fn();
|
46166 |
+
});
|
46167 |
};
|
46168 |
+
}
|
46169 |
|
46170 |
+
function taskDebounce(fn) {
|
46171 |
+
var scheduled = false;
|
46172 |
+
return function () {
|
46173 |
+
if (!scheduled) {
|
46174 |
+
scheduled = true;
|
46175 |
+
setTimeout(function () {
|
46176 |
+
scheduled = false;
|
46177 |
+
fn();
|
46178 |
+
}, timeoutDuration);
|
46179 |
}
|
46180 |
};
|
46181 |
+
}
|
46182 |
|
46183 |
+
var supportsMicroTasks = popper_isBrowser && window.Promise;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46184 |
|
46185 |
+
/**
|
46186 |
+
* Create a debounced version of a method, that's asynchronously deferred
|
46187 |
+
* but called in the minimum time possible.
|
46188 |
+
*
|
46189 |
+
* @method
|
46190 |
+
* @memberof Popper.Utils
|
46191 |
+
* @argument {Function} fn
|
46192 |
+
* @returns {Function}
|
46193 |
+
*/
|
46194 |
+
var popper_debounce = supportsMicroTasks ? microtaskDebounce : taskDebounce;
|
46195 |
|
46196 |
/**
|
46197 |
+
* Check if the given variable is a function
|
46198 |
+
* @method
|
46199 |
+
* @memberof Popper.Utils
|
46200 |
+
* @argument {Any} functionToCheck - variable to check
|
46201 |
+
* @returns {Boolean} answer to: is a function?
|
46202 |
*/
|
46203 |
+
function isFunction(functionToCheck) {
|
46204 |
+
var getType = {};
|
46205 |
+
return functionToCheck && getType.toString.call(functionToCheck) === '[object Function]';
|
46206 |
+
}
|
|
|
|
|
46207 |
|
46208 |
/**
|
46209 |
+
* Get CSS computed property of the given element
|
46210 |
+
* @method
|
46211 |
+
* @memberof Popper.Utils
|
46212 |
+
* @argument {Eement} element
|
46213 |
+
* @argument {String} property
|
46214 |
*/
|
46215 |
+
function getStyleComputedProperty(element, property) {
|
46216 |
+
if (element.nodeType !== 1) {
|
46217 |
+
return [];
|
46218 |
+
}
|
46219 |
+
// NOTE: 1 DOM access here
|
46220 |
+
var window = element.ownerDocument.defaultView;
|
46221 |
+
var css = window.getComputedStyle(element, null);
|
46222 |
+
return property ? css[property] : css;
|
46223 |
+
}
|
46224 |
|
46225 |
/**
|
46226 |
+
* Returns the parentNode or the host of the element
|
46227 |
+
* @method
|
46228 |
+
* @memberof Popper.Utils
|
46229 |
+
* @argument {Element} element
|
46230 |
+
* @returns {Element} parent
|
46231 |
*/
|
46232 |
+
function popper_getParentNode(element) {
|
46233 |
+
if (element.nodeName === 'HTML') {
|
46234 |
+
return element;
|
46235 |
+
}
|
46236 |
+
return element.parentNode || element.host;
|
46237 |
+
}
|
46238 |
|
46239 |
+
/**
|
46240 |
+
* Returns the scrolling parent of the given element
|
46241 |
+
* @method
|
46242 |
+
* @memberof Popper.Utils
|
46243 |
+
* @argument {Element} element
|
46244 |
+
* @returns {Element} scroll parent
|
46245 |
+
*/
|
46246 |
+
function popper_getScrollParent(element) {
|
46247 |
+
// Return body, `getScroll` will take care to get the correct `scrollTop` from it
|
46248 |
+
if (!element) {
|
46249 |
+
return document.body;
|
46250 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46251 |
|
46252 |
+
switch (element.nodeName) {
|
46253 |
+
case 'HTML':
|
46254 |
+
case 'BODY':
|
46255 |
+
return element.ownerDocument.body;
|
46256 |
+
case '#document':
|
46257 |
+
return element.body;
|
46258 |
+
}
|
46259 |
|
46260 |
+
// Firefox want us to check `-x` and `-y` variations as well
|
|
|
46261 |
|
46262 |
+
var _getStyleComputedProp = getStyleComputedProperty(element),
|
46263 |
+
overflow = _getStyleComputedProp.overflow,
|
46264 |
+
overflowX = _getStyleComputedProp.overflowX,
|
46265 |
+
overflowY = _getStyleComputedProp.overflowY;
|
46266 |
|
46267 |
+
if (/(auto|scroll|overlay)/.test(overflow + overflowY + overflowX)) {
|
46268 |
+
return element;
|
46269 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46270 |
|
46271 |
+
return popper_getScrollParent(popper_getParentNode(element));
|
46272 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46273 |
|
46274 |
+
/**
|
46275 |
+
* Returns the reference node of the reference object, or the reference object itself.
|
46276 |
+
* @method
|
46277 |
+
* @memberof Popper.Utils
|
46278 |
+
* @param {Element|Object} reference - the reference element (the popper will be relative to this)
|
46279 |
+
* @returns {Element} parent
|
46280 |
+
*/
|
46281 |
+
function getReferenceNode(reference) {
|
46282 |
+
return reference && reference.referenceNode ? reference.referenceNode : reference;
|
46283 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46284 |
|
46285 |
+
var isIE11 = popper_isBrowser && !!(window.MSInputMethodContext && document.documentMode);
|
46286 |
+
var popper_isIE10 = popper_isBrowser && /MSIE 10/.test(navigator.userAgent);
|
46287 |
|
46288 |
/**
|
46289 |
+
* Determines if the browser is Internet Explorer
|
46290 |
+
* @method
|
46291 |
+
* @memberof Popper.Utils
|
46292 |
+
* @param {Number} version to check
|
46293 |
+
* @returns {Boolean} isIE
|
46294 |
*/
|
46295 |
+
function popper_isIE(version) {
|
46296 |
+
if (version === 11) {
|
46297 |
+
return isIE11;
|
46298 |
+
}
|
46299 |
+
if (version === 10) {
|
46300 |
+
return popper_isIE10;
|
46301 |
+
}
|
46302 |
+
return isIE11 || popper_isIE10;
|
46303 |
+
}
|
46304 |
|
46305 |
+
/**
|
46306 |
+
* Returns the offset parent of the given element
|
46307 |
+
* @method
|
46308 |
+
* @memberof Popper.Utils
|
46309 |
+
* @argument {Element} element
|
46310 |
+
* @returns {Element} offset parent
|
46311 |
+
*/
|
46312 |
+
function popper_getOffsetParent(element) {
|
46313 |
+
if (!element) {
|
46314 |
+
return document.documentElement;
|
46315 |
+
}
|
46316 |
|
46317 |
+
var noOffsetParent = popper_isIE(10) ? document.body : null;
|
46318 |
|
46319 |
+
// NOTE: 1 DOM access here
|
46320 |
+
var offsetParent = element.offsetParent || null;
|
46321 |
+
// Skip hidden elements which don't have an offsetParent
|
46322 |
+
while (offsetParent === noOffsetParent && element.nextElementSibling) {
|
46323 |
+
offsetParent = (element = element.nextElementSibling).offsetParent;
|
46324 |
+
}
|
46325 |
|
46326 |
+
var nodeName = offsetParent && offsetParent.nodeName;
|
46327 |
|
46328 |
+
if (!nodeName || nodeName === 'BODY' || nodeName === 'HTML') {
|
46329 |
+
return element ? element.ownerDocument.documentElement : document.documentElement;
|
46330 |
+
}
|
46331 |
|
46332 |
+
// .offsetParent will return the closest TH, TD or TABLE in case
|
46333 |
+
// no offsetParent is present, I hate this job...
|
46334 |
+
if (['TH', 'TD', 'TABLE'].indexOf(offsetParent.nodeName) !== -1 && getStyleComputedProperty(offsetParent, 'position') === 'static') {
|
46335 |
+
return popper_getOffsetParent(offsetParent);
|
46336 |
+
}
|
46337 |
|
46338 |
+
return offsetParent;
|
46339 |
+
}
|
46340 |
|
46341 |
+
function isOffsetContainer(element) {
|
46342 |
+
var nodeName = element.nodeName;
|
46343 |
|
46344 |
+
if (nodeName === 'BODY') {
|
46345 |
+
return false;
|
46346 |
+
}
|
46347 |
+
return nodeName === 'HTML' || popper_getOffsetParent(element.firstElementChild) === element;
|
46348 |
+
}
|
46349 |
|
46350 |
+
/**
|
46351 |
+
* Finds the root node (document, shadowDOM root) of the given element
|
46352 |
+
* @method
|
46353 |
+
* @memberof Popper.Utils
|
46354 |
+
* @argument {Element} node
|
46355 |
+
* @returns {Element} root node
|
46356 |
+
*/
|
46357 |
+
function getRoot(node) {
|
46358 |
+
if (node.parentNode !== null) {
|
46359 |
+
return getRoot(node.parentNode);
|
46360 |
+
}
|
46361 |
|
46362 |
+
return node;
|
46363 |
+
}
|
46364 |
|
46365 |
+
/**
|
46366 |
+
* Finds the offset parent common to the two provided nodes
|
46367 |
+
* @method
|
46368 |
+
* @memberof Popper.Utils
|
46369 |
+
* @argument {Element} element1
|
46370 |
+
* @argument {Element} element2
|
46371 |
+
* @returns {Element} common offset parent
|
46372 |
+
*/
|
46373 |
+
function findCommonOffsetParent(element1, element2) {
|
46374 |
+
// This check is needed to avoid errors in case one of the elements isn't defined for any reason
|
46375 |
+
if (!element1 || !element1.nodeType || !element2 || !element2.nodeType) {
|
46376 |
+
return document.documentElement;
|
46377 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46378 |
|
46379 |
+
// Here we make sure to give as "start" the element that comes first in the DOM
|
46380 |
+
var order = element1.compareDocumentPosition(element2) & Node.DOCUMENT_POSITION_FOLLOWING;
|
46381 |
+
var start = order ? element1 : element2;
|
46382 |
+
var end = order ? element2 : element1;
|
46383 |
|
46384 |
+
// Get common ancestor container
|
46385 |
+
var range = document.createRange();
|
46386 |
+
range.setStart(start, 0);
|
46387 |
+
range.setEnd(end, 0);
|
46388 |
+
var commonAncestorContainer = range.commonAncestorContainer;
|
46389 |
|
46390 |
+
// Both nodes are inside #document
|
|
|
|
|
|
|
|
|
46391 |
|
46392 |
+
if (element1 !== commonAncestorContainer && element2 !== commonAncestorContainer || start.contains(end)) {
|
46393 |
+
if (isOffsetContainer(commonAncestorContainer)) {
|
46394 |
+
return commonAncestorContainer;
|
46395 |
+
}
|
46396 |
|
46397 |
+
return popper_getOffsetParent(commonAncestorContainer);
|
46398 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46399 |
|
46400 |
+
// one of the nodes is inside shadowDOM, find which one
|
46401 |
+
var element1root = getRoot(element1);
|
46402 |
+
if (element1root.host) {
|
46403 |
+
return findCommonOffsetParent(element1root.host, element2);
|
46404 |
+
} else {
|
46405 |
+
return findCommonOffsetParent(element1, getRoot(element2).host);
|
46406 |
+
}
|
46407 |
+
}
|
46408 |
|
46409 |
+
/**
|
46410 |
+
* Gets the scroll value of the given element in the given side (top and left)
|
46411 |
+
* @method
|
46412 |
+
* @memberof Popper.Utils
|
46413 |
+
* @argument {Element} element
|
46414 |
+
* @argument {String} side `top` or `left`
|
46415 |
+
* @returns {number} amount of scrolled pixels
|
46416 |
+
*/
|
46417 |
+
function popper_getScroll(element) {
|
46418 |
+
var side = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'top';
|
46419 |
|
46420 |
+
var upperSide = side === 'top' ? 'scrollTop' : 'scrollLeft';
|
46421 |
+
var nodeName = element.nodeName;
|
|
|
|
|
|
|
|
|
46422 |
|
46423 |
+
if (nodeName === 'BODY' || nodeName === 'HTML') {
|
46424 |
+
var html = element.ownerDocument.documentElement;
|
46425 |
+
var scrollingElement = element.ownerDocument.scrollingElement || html;
|
46426 |
+
return scrollingElement[upperSide];
|
46427 |
+
}
|
|
|
46428 |
|
46429 |
+
return element[upperSide];
|
46430 |
+
}
|
|
|
|
|
|
|
|
|
46431 |
|
46432 |
+
/*
|
46433 |
+
* Sum or subtract the element scroll values (left and top) from a given rect object
|
46434 |
+
* @method
|
46435 |
+
* @memberof Popper.Utils
|
46436 |
+
* @param {Object} rect - Rect object you want to change
|
46437 |
+
* @param {HTMLElement} element - The element from the function reads the scroll values
|
46438 |
+
* @param {Boolean} subtract - set to true if you want to subtract the scroll values
|
46439 |
+
* @return {Object} rect - The modifier rect object
|
46440 |
+
*/
|
46441 |
+
function includeScroll(rect, element) {
|
46442 |
+
var subtract = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46443 |
|
46444 |
+
var scrollTop = popper_getScroll(element, 'top');
|
46445 |
+
var scrollLeft = popper_getScroll(element, 'left');
|
46446 |
+
var modifier = subtract ? -1 : 1;
|
46447 |
+
rect.top += scrollTop * modifier;
|
46448 |
+
rect.bottom += scrollTop * modifier;
|
46449 |
+
rect.left += scrollLeft * modifier;
|
46450 |
+
rect.right += scrollLeft * modifier;
|
46451 |
+
return rect;
|
46452 |
+
}
|
46453 |
|
46454 |
+
/*
|
46455 |
+
* Helper to detect borders of a given element
|
46456 |
+
* @method
|
46457 |
+
* @memberof Popper.Utils
|
46458 |
+
* @param {CSSStyleDeclaration} styles
|
46459 |
+
* Result of `getStyleComputedProperty` on the given element
|
46460 |
+
* @param {String} axis - `x` or `y`
|
46461 |
+
* @return {number} borders - The borders size of the given axis
|
46462 |
+
*/
|
46463 |
|
46464 |
+
function popper_getBordersSize(styles, axis) {
|
46465 |
+
var sideA = axis === 'x' ? 'Left' : 'Top';
|
46466 |
+
var sideB = sideA === 'Left' ? 'Right' : 'Bottom';
|
46467 |
|
46468 |
+
return parseFloat(styles['border' + sideA + 'Width']) + parseFloat(styles['border' + sideB + 'Width']);
|
46469 |
+
}
|
46470 |
|
46471 |
+
function popper_getSize(axis, body, html, computedStyle) {
|
46472 |
+
return Math.max(body['offset' + axis], body['scroll' + axis], html['client' + axis], html['offset' + axis], html['scroll' + axis], popper_isIE(10) ? parseInt(html['offset' + axis]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Top' : 'Left')]) + parseInt(computedStyle['margin' + (axis === 'Height' ? 'Bottom' : 'Right')]) : 0);
|
46473 |
+
}
|
46474 |
|
46475 |
+
function getWindowSizes(document) {
|
46476 |
+
var body = document.body;
|
46477 |
+
var html = document.documentElement;
|
46478 |
+
var computedStyle = popper_isIE(10) && getComputedStyle(html);
|
46479 |
|
46480 |
+
return {
|
46481 |
+
height: popper_getSize('Height', body, html, computedStyle),
|
46482 |
+
width: popper_getSize('Width', body, html, computedStyle)
|
46483 |
+
};
|
46484 |
+
}
|
|
|
46485 |
|
46486 |
+
var classCallCheck = function (instance, Constructor) {
|
46487 |
+
if (!(instance instanceof Constructor)) {
|
46488 |
+
throw new TypeError("Cannot call a class as a function");
|
46489 |
+
}
|
46490 |
+
};
|
|
|
|
|
46491 |
|
46492 |
+
var popper_createClass = function () {
|
46493 |
+
function defineProperties(target, props) {
|
46494 |
+
for (var i = 0; i < props.length; i++) {
|
46495 |
+
var descriptor = props[i];
|
46496 |
+
descriptor.enumerable = descriptor.enumerable || false;
|
46497 |
+
descriptor.configurable = true;
|
46498 |
+
if ("value" in descriptor) descriptor.writable = true;
|
46499 |
+
Object.defineProperty(target, descriptor.key, descriptor);
|
46500 |
+
}
|
46501 |
+
}
|
46502 |
|
46503 |
+
return function (Constructor, protoProps, staticProps) {
|
46504 |
+
if (protoProps) defineProperties(Constructor.prototype, protoProps);
|
46505 |
+
if (staticProps) defineProperties(Constructor, staticProps);
|
46506 |
+
return Constructor;
|
46507 |
+
};
|
46508 |
+
}();
|
46509 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46510 |
|
|
|
|
|
|
|
|
|
|
|
46511 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46512 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46513 |
|
46514 |
+
var popper_defineProperty = function (obj, key, value) {
|
46515 |
+
if (key in obj) {
|
46516 |
+
Object.defineProperty(obj, key, {
|
46517 |
+
value: value,
|
46518 |
+
enumerable: true,
|
46519 |
+
configurable: true,
|
46520 |
+
writable: true
|
46521 |
+
});
|
46522 |
+
} else {
|
46523 |
+
obj[key] = value;
|
46524 |
+
}
|
46525 |
|
46526 |
+
return obj;
|
46527 |
+
};
|
|
|
|
|
|
|
|
|
|
|
46528 |
|
46529 |
+
var popper_extends = Object.assign || function (target) {
|
46530 |
+
for (var i = 1; i < arguments.length; i++) {
|
46531 |
+
var source = arguments[i];
|
|
|
|
|
|
|
|
|
46532 |
|
46533 |
+
for (var key in source) {
|
46534 |
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
46535 |
+
target[key] = source[key];
|
|
|
|
|
46536 |
}
|
46537 |
}
|
46538 |
+
}
|
46539 |
+
|
46540 |
+
return target;
|
46541 |
};
|
46542 |
|
|
|
|
|
|
|
46543 |
/**
|
46544 |
+
* Given element offsets, generate an output similar to getBoundingClientRect
|
46545 |
+
* @method
|
46546 |
+
* @memberof Popper.Utils
|
46547 |
+
* @argument {Object} offsets
|
46548 |
+
* @returns {Object} ClientRect like output
|
46549 |
*/
|
46550 |
+
function getClientRect(offsets) {
|
46551 |
+
return popper_extends({}, offsets, {
|
46552 |
+
right: offsets.left + offsets.width,
|
46553 |
+
bottom: offsets.top + offsets.height
|
46554 |
+
});
|
46555 |
+
}
|
46556 |
|
46557 |
+
/**
|
46558 |
+
* Get bounding client rect of given element
|
46559 |
+
* @method
|
46560 |
+
* @memberof Popper.Utils
|
46561 |
+
* @param {HTMLElement} element
|
46562 |
+
* @return {Object} client rect
|
46563 |
+
*/
|
46564 |
+
function popper_getBoundingClientRect(element) {
|
46565 |
+
var rect = {};
|
46566 |
|
46567 |
+
// IE10 10 FIX: Please, don't ask, the element isn't
|
46568 |
+
// considered in DOM in some circumstances...
|
46569 |
+
// This isn't reproducible in IE10 compatibility mode of IE11
|
46570 |
+
try {
|
46571 |
+
if (popper_isIE(10)) {
|
46572 |
+
rect = element.getBoundingClientRect();
|
46573 |
+
var scrollTop = popper_getScroll(element, 'top');
|
46574 |
+
var scrollLeft = popper_getScroll(element, 'left');
|
46575 |
+
rect.top += scrollTop;
|
46576 |
+
rect.left += scrollLeft;
|
46577 |
+
rect.bottom += scrollTop;
|
46578 |
+
rect.right += scrollLeft;
|
46579 |
+
} else {
|
46580 |
+
rect = element.getBoundingClientRect();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46581 |
}
|
46582 |
+
} catch (e) {}
|
46583 |
+
|
46584 |
+
var result = {
|
46585 |
+
left: rect.left,
|
46586 |
+
top: rect.top,
|
46587 |
+
width: rect.right - rect.left,
|
46588 |
+
height: rect.bottom - rect.top
|
46589 |
};
|
46590 |
|
46591 |
+
// subtract scrollbar size from sizes
|
46592 |
+
var sizes = element.nodeName === 'HTML' ? getWindowSizes(element.ownerDocument) : {};
|
46593 |
+
var width = sizes.width || element.clientWidth || result.width;
|
46594 |
+
var height = sizes.height || element.clientHeight || result.height;
|
|
|
|
|
|
|
46595 |
|
46596 |
+
var horizScrollbar = element.offsetWidth - width;
|
46597 |
+
var vertScrollbar = element.offsetHeight - height;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46598 |
|
46599 |
+
// if an hypothetical scrollbar is detected, we must be sure it's not a `border`
|
46600 |
+
// we make this check conditional for performance reasons
|
46601 |
+
if (horizScrollbar || vertScrollbar) {
|
46602 |
+
var styles = getStyleComputedProperty(element);
|
46603 |
+
horizScrollbar -= popper_getBordersSize(styles, 'x');
|
46604 |
+
vertScrollbar -= popper_getBordersSize(styles, 'y');
|
46605 |
|
46606 |
+
result.width -= horizScrollbar;
|
46607 |
+
result.height -= vertScrollbar;
|
|
|
|
|
46608 |
}
|
46609 |
|
46610 |
+
return getClientRect(result);
|
46611 |
+
}
|
|
|
|
|
|
|
|
|
|
|
46612 |
|
46613 |
+
function getOffsetRectRelativeToArbitraryNode(children, parent) {
|
46614 |
+
var fixedPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
46615 |
|
46616 |
+
var isIE10 = popper_isIE(10);
|
46617 |
+
var isHTML = parent.nodeName === 'HTML';
|
46618 |
+
var childrenRect = popper_getBoundingClientRect(children);
|
46619 |
+
var parentRect = popper_getBoundingClientRect(parent);
|
46620 |
+
var scrollParent = popper_getScrollParent(children);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46621 |
|
46622 |
+
var styles = getStyleComputedProperty(parent);
|
46623 |
+
var borderTopWidth = parseFloat(styles.borderTopWidth);
|
46624 |
+
var borderLeftWidth = parseFloat(styles.borderLeftWidth);
|
46625 |
|
46626 |
+
// In cases where the parent is fixed, we must ignore negative scroll in offset calc
|
46627 |
+
if (fixedPosition && isHTML) {
|
46628 |
+
parentRect.top = Math.max(parentRect.top, 0);
|
46629 |
+
parentRect.left = Math.max(parentRect.left, 0);
|
46630 |
+
}
|
46631 |
+
var offsets = getClientRect({
|
46632 |
+
top: childrenRect.top - parentRect.top - borderTopWidth,
|
46633 |
+
left: childrenRect.left - parentRect.left - borderLeftWidth,
|
46634 |
+
width: childrenRect.width,
|
46635 |
+
height: childrenRect.height
|
46636 |
+
});
|
46637 |
+
offsets.marginTop = 0;
|
46638 |
+
offsets.marginLeft = 0;
|
46639 |
|
46640 |
+
// Subtract margins of documentElement in case it's being used as parent
|
46641 |
+
// we do this only on HTML because it's the only element that behaves
|
46642 |
+
// differently when margins are applied to it. The margins are included in
|
46643 |
+
// the box of the documentElement, in the other cases not.
|
46644 |
+
if (!isIE10 && isHTML) {
|
46645 |
+
var marginTop = parseFloat(styles.marginTop);
|
46646 |
+
var marginLeft = parseFloat(styles.marginLeft);
|
46647 |
|
46648 |
+
offsets.top -= borderTopWidth - marginTop;
|
46649 |
+
offsets.bottom -= borderTopWidth - marginTop;
|
46650 |
+
offsets.left -= borderLeftWidth - marginLeft;
|
46651 |
+
offsets.right -= borderLeftWidth - marginLeft;
|
46652 |
|
46653 |
+
// Attach marginTop and marginLeft because in some circumstances we may need them
|
46654 |
+
offsets.marginTop = marginTop;
|
46655 |
+
offsets.marginLeft = marginLeft;
|
46656 |
+
}
|
46657 |
|
46658 |
+
if (isIE10 && !fixedPosition ? parent.contains(scrollParent) : parent === scrollParent && scrollParent.nodeName !== 'BODY') {
|
46659 |
+
offsets = includeScroll(offsets, parent);
|
46660 |
+
}
|
46661 |
|
46662 |
+
return offsets;
|
46663 |
+
}
|
46664 |
|
46665 |
+
function getViewportOffsetRectRelativeToArtbitraryNode(element) {
|
46666 |
+
var excludeScroll = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
46667 |
|
46668 |
+
var html = element.ownerDocument.documentElement;
|
46669 |
+
var relativeOffset = getOffsetRectRelativeToArbitraryNode(element, html);
|
46670 |
+
var width = Math.max(html.clientWidth, window.innerWidth || 0);
|
46671 |
+
var height = Math.max(html.clientHeight, window.innerHeight || 0);
|
46672 |
|
46673 |
+
var scrollTop = !excludeScroll ? popper_getScroll(html) : 0;
|
46674 |
+
var scrollLeft = !excludeScroll ? popper_getScroll(html, 'left') : 0;
|
46675 |
|
46676 |
+
var offset = {
|
46677 |
+
top: scrollTop - relativeOffset.top + relativeOffset.marginTop,
|
46678 |
+
left: scrollLeft - relativeOffset.left + relativeOffset.marginLeft,
|
46679 |
+
width: width,
|
46680 |
+
height: height
|
46681 |
+
};
|
46682 |
|
46683 |
+
return getClientRect(offset);
|
46684 |
+
}
|
46685 |
|
46686 |
+
/**
|
46687 |
+
* Check if the given element is fixed or is inside a fixed parent
|
46688 |
+
* @method
|
46689 |
+
* @memberof Popper.Utils
|
46690 |
+
* @argument {Element} element
|
46691 |
+
* @argument {Element} customContainer
|
46692 |
+
* @returns {Boolean} answer to "isFixed?"
|
46693 |
+
*/
|
46694 |
+
function isFixed(element) {
|
46695 |
+
var nodeName = element.nodeName;
|
46696 |
+
if (nodeName === 'BODY' || nodeName === 'HTML') {
|
46697 |
+
return false;
|
46698 |
+
}
|
46699 |
+
if (getStyleComputedProperty(element, 'position') === 'fixed') {
|
46700 |
+
return true;
|
46701 |
+
}
|
46702 |
+
var parentNode = popper_getParentNode(element);
|
46703 |
+
if (!parentNode) {
|
46704 |
+
return false;
|
46705 |
+
}
|
46706 |
+
return isFixed(parentNode);
|
46707 |
+
}
|
46708 |
|
46709 |
+
/**
|
46710 |
+
* Finds the first parent of an element that has a transformed property defined
|
46711 |
+
* @method
|
46712 |
+
* @memberof Popper.Utils
|
46713 |
+
* @argument {Element} element
|
46714 |
+
* @returns {Element} first transformed parent or documentElement
|
46715 |
+
*/
|
46716 |
|
46717 |
+
function getFixedPositionOffsetParent(element) {
|
46718 |
+
// This check is needed to avoid errors in case one of the elements isn't defined for any reason
|
46719 |
+
if (!element || !element.parentElement || popper_isIE()) {
|
46720 |
+
return document.documentElement;
|
46721 |
+
}
|
46722 |
+
var el = element.parentElement;
|
46723 |
+
while (el && getStyleComputedProperty(el, 'transform') === 'none') {
|
46724 |
+
el = el.parentElement;
|
46725 |
+
}
|
46726 |
+
return el || document.documentElement;
|
46727 |
+
}
|
46728 |
|
46729 |
+
/**
|
46730 |
+
* Computed the boundaries limits and return them
|
46731 |
+
* @method
|
46732 |
+
* @memberof Popper.Utils
|
46733 |
+
* @param {HTMLElement} popper
|
46734 |
+
* @param {HTMLElement} reference
|
46735 |
+
* @param {number} padding
|
46736 |
+
* @param {HTMLElement} boundariesElement - Element used to define the boundaries
|
46737 |
+
* @param {Boolean} fixedPosition - Is in fixed position mode
|
46738 |
+
* @returns {Object} Coordinates of the boundaries
|
46739 |
+
*/
|
46740 |
+
function getBoundaries(popper, reference, padding, boundariesElement) {
|
46741 |
+
var fixedPosition = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : false;
|
46742 |
|
46743 |
+
// NOTE: 1 DOM access here
|
46744 |
|
46745 |
+
var boundaries = { top: 0, left: 0 };
|
46746 |
+
var offsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
|
|
|
|
|
|
|
|
|
46747 |
|
46748 |
+
// Handle viewport case
|
46749 |
+
if (boundariesElement === 'viewport') {
|
46750 |
+
boundaries = getViewportOffsetRectRelativeToArtbitraryNode(offsetParent, fixedPosition);
|
46751 |
+
} else {
|
46752 |
+
// Handle other cases based on DOM element used as boundaries
|
46753 |
+
var boundariesNode = void 0;
|
46754 |
+
if (boundariesElement === 'scrollParent') {
|
46755 |
+
boundariesNode = popper_getScrollParent(popper_getParentNode(reference));
|
46756 |
+
if (boundariesNode.nodeName === 'BODY') {
|
46757 |
+
boundariesNode = popper.ownerDocument.documentElement;
|
46758 |
+
}
|
46759 |
+
} else if (boundariesElement === 'window') {
|
46760 |
+
boundariesNode = popper.ownerDocument.documentElement;
|
46761 |
+
} else {
|
46762 |
+
boundariesNode = boundariesElement;
|
46763 |
+
}
|
46764 |
|
46765 |
+
var offsets = getOffsetRectRelativeToArbitraryNode(boundariesNode, offsetParent, fixedPosition);
|
|
|
|
|
46766 |
|
46767 |
+
// In case of HTML, we need a different computation
|
46768 |
+
if (boundariesNode.nodeName === 'HTML' && !isFixed(offsetParent)) {
|
46769 |
+
var _getWindowSizes = getWindowSizes(popper.ownerDocument),
|
46770 |
+
height = _getWindowSizes.height,
|
46771 |
+
width = _getWindowSizes.width;
|
46772 |
|
46773 |
+
boundaries.top += offsets.top - offsets.marginTop;
|
46774 |
+
boundaries.bottom = height + offsets.top;
|
46775 |
+
boundaries.left += offsets.left - offsets.marginLeft;
|
46776 |
+
boundaries.right = width + offsets.left;
|
46777 |
+
} else {
|
46778 |
+
// for all the other DOM elements, this one is good
|
46779 |
+
boundaries = offsets;
|
46780 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46781 |
}
|
46782 |
|
46783 |
+
// Add paddings
|
46784 |
+
padding = padding || 0;
|
46785 |
+
var isPaddingNumber = typeof padding === 'number';
|
46786 |
+
boundaries.left += isPaddingNumber ? padding : padding.left || 0;
|
46787 |
+
boundaries.top += isPaddingNumber ? padding : padding.top || 0;
|
46788 |
+
boundaries.right -= isPaddingNumber ? padding : padding.right || 0;
|
46789 |
+
boundaries.bottom -= isPaddingNumber ? padding : padding.bottom || 0;
|
46790 |
|
46791 |
+
return boundaries;
|
46792 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
46793 |
|
46794 |
+
function getArea(_ref) {
|
46795 |
+
var width = _ref.width,
|
46796 |
+
height = _ref.height;
|
|
|
46797 |
|
46798 |
+
return width * height;
|
46799 |
+
}
|
|
|
|
|
46800 |
|
46801 |
+
/**
|
46802 |
+
* Utility used to transform the `auto` placement to the placement with more
|
46803 |
+
* available space.
|
46804 |
+
* @method
|
46805 |
+
* @memberof Popper.Utils
|
46806 |
+
* @argument {Object} data - The data object generated by update method
|
46807 |
+
* @argument {Object} options - Modifiers configuration and options
|
46808 |
+
* @returns {Object} The data object, properly modified
|
46809 |
+
*/
|
46810 |
+
function popper_computeAutoPlacement(placement, refRect, popper, reference, boundariesElement) {
|
46811 |
+
var padding = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : 0;
|
46812 |
|
46813 |
+
if (placement.indexOf('auto') === -1) {
|
46814 |
+
return placement;
|
46815 |
+
}
|
46816 |
|
46817 |
+
var boundaries = getBoundaries(popper, reference, padding, boundariesElement);
|
|
|
|
|
46818 |
|
46819 |
+
var rects = {
|
46820 |
+
top: {
|
46821 |
+
width: boundaries.width,
|
46822 |
+
height: refRect.top - boundaries.top
|
46823 |
+
},
|
46824 |
+
right: {
|
46825 |
+
width: boundaries.right - refRect.right,
|
46826 |
+
height: boundaries.height
|
46827 |
+
},
|
46828 |
+
bottom: {
|
46829 |
+
width: boundaries.width,
|
46830 |
+
height: boundaries.bottom - refRect.bottom
|
46831 |
+
},
|
46832 |
+
left: {
|
46833 |
+
width: refRect.left - boundaries.left,
|
46834 |
+
height: boundaries.height
|
46835 |
}
|
|
|
|
|
46836 |
};
|
46837 |
|
46838 |
+
var sortedAreas = Object.keys(rects).map(function (key) {
|
46839 |
+
return popper_extends({
|
46840 |
+
key: key
|
46841 |
+
}, rects[key], {
|
46842 |
+
area: getArea(rects[key])
|
46843 |
});
|
46844 |
+
}).sort(function (a, b) {
|
46845 |
+
return b.area - a.area;
|
46846 |
+
});
|
46847 |
|
46848 |
+
var filteredAreas = sortedAreas.filter(function (_ref2) {
|
46849 |
+
var width = _ref2.width,
|
46850 |
+
height = _ref2.height;
|
46851 |
+
return width >= popper.clientWidth && height >= popper.clientHeight;
|
46852 |
+
});
|
46853 |
|
46854 |
+
var computedPlacement = filteredAreas.length > 0 ? filteredAreas[0].key : sortedAreas[0].key;
|
|
|
46855 |
|
46856 |
+
var variation = placement.split('-')[1];
|
|
|
|
|
|
|
46857 |
|
46858 |
+
return computedPlacement + (variation ? '-' + variation : '');
|
46859 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46860 |
|
46861 |
+
/**
|
46862 |
+
* Get offsets to the reference element
|
46863 |
+
* @method
|
46864 |
+
* @memberof Popper.Utils
|
46865 |
+
* @param {Object} state
|
46866 |
+
* @param {Element} popper - the popper element
|
46867 |
+
* @param {Element} reference - the reference element (the popper will be relative to this)
|
46868 |
+
* @param {Element} fixedPosition - is in fixed position mode
|
46869 |
+
* @returns {Object} An object containing the offsets which will be applied to the popper
|
46870 |
+
*/
|
46871 |
+
function getReferenceOffsets(state, popper, reference) {
|
46872 |
+
var fixedPosition = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : null;
|
46873 |
+
|
46874 |
+
var commonOffsetParent = fixedPosition ? getFixedPositionOffsetParent(popper) : findCommonOffsetParent(popper, getReferenceNode(reference));
|
46875 |
+
return getOffsetRectRelativeToArbitraryNode(reference, commonOffsetParent, fixedPosition);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46876 |
}
|
|
|
|
|
46877 |
|
46878 |
+
/**
|
46879 |
+
* Get the outer sizes of the given element (offset size + margins)
|
46880 |
+
* @method
|
46881 |
+
* @memberof Popper.Utils
|
46882 |
+
* @argument {Element} element
|
46883 |
+
* @returns {Object} object containing width and height properties
|
46884 |
+
*/
|
46885 |
+
function getOuterSizes(element) {
|
46886 |
+
var window = element.ownerDocument.defaultView;
|
46887 |
+
var styles = window.getComputedStyle(element);
|
46888 |
+
var x = parseFloat(styles.marginTop || 0) + parseFloat(styles.marginBottom || 0);
|
46889 |
+
var y = parseFloat(styles.marginLeft || 0) + parseFloat(styles.marginRight || 0);
|
46890 |
+
var result = {
|
46891 |
+
width: element.offsetWidth + y,
|
46892 |
+
height: element.offsetHeight + x
|
46893 |
+
};
|
46894 |
+
return result;
|
46895 |
+
}
|
46896 |
|
46897 |
+
/**
|
46898 |
+
* Get the opposite placement of the given one
|
46899 |
+
* @method
|
46900 |
+
* @memberof Popper.Utils
|
46901 |
+
* @argument {String} placement
|
46902 |
+
* @returns {String} flipped placement
|
46903 |
+
*/
|
46904 |
+
function popper_getOppositePlacement(placement) {
|
46905 |
+
var hash = { left: 'right', right: 'left', bottom: 'top', top: 'bottom' };
|
46906 |
+
return placement.replace(/left|right|bottom|top/g, function (matched) {
|
46907 |
+
return hash[matched];
|
46908 |
+
});
|
46909 |
+
}
|
46910 |
|
46911 |
+
/**
|
46912 |
+
* Get offsets to the popper
|
46913 |
+
* @method
|
46914 |
+
* @memberof Popper.Utils
|
46915 |
+
* @param {Object} position - CSS position the Popper will get applied
|
46916 |
+
* @param {HTMLElement} popper - the popper element
|
46917 |
+
* @param {Object} referenceOffsets - the reference offsets (the popper will be relative to this)
|
46918 |
+
* @param {String} placement - one of the valid placement options
|
46919 |
+
* @returns {Object} popperOffsets - An object containing the offsets which will be applied to the popper
|
46920 |
+
*/
|
46921 |
+
function getPopperOffsets(popper, referenceOffsets, placement) {
|
46922 |
+
placement = placement.split('-')[0];
|
46923 |
|
46924 |
+
// Get popper node sizes
|
46925 |
+
var popperRect = getOuterSizes(popper);
|
46926 |
|
46927 |
+
// Add position, width and height to our offsets object
|
46928 |
+
var popperOffsets = {
|
46929 |
+
width: popperRect.width,
|
46930 |
+
height: popperRect.height
|
46931 |
+
};
|
46932 |
|
46933 |
+
// depending by the popper placement we have to compute its offsets slightly differently
|
46934 |
+
var isHoriz = ['right', 'left'].indexOf(placement) !== -1;
|
46935 |
+
var mainSide = isHoriz ? 'top' : 'left';
|
46936 |
+
var secondarySide = isHoriz ? 'left' : 'top';
|
46937 |
+
var measurement = isHoriz ? 'height' : 'width';
|
46938 |
+
var secondaryMeasurement = !isHoriz ? 'height' : 'width';
|
46939 |
|
46940 |
+
popperOffsets[mainSide] = referenceOffsets[mainSide] + referenceOffsets[measurement] / 2 - popperRect[measurement] / 2;
|
46941 |
+
if (placement === secondarySide) {
|
46942 |
+
popperOffsets[secondarySide] = referenceOffsets[secondarySide] - popperRect[secondaryMeasurement];
|
46943 |
+
} else {
|
46944 |
+
popperOffsets[secondarySide] = referenceOffsets[popper_getOppositePlacement(secondarySide)];
|
46945 |
+
}
|
46946 |
|
46947 |
+
return popperOffsets;
|
46948 |
+
}
|
46949 |
|
46950 |
+
/**
|
46951 |
+
* Mimics the `find` method of Array
|
46952 |
+
* @method
|
46953 |
+
* @memberof Popper.Utils
|
46954 |
+
* @argument {Array} arr
|
46955 |
+
* @argument prop
|
46956 |
+
* @argument value
|
46957 |
+
* @returns index or -1
|
46958 |
+
*/
|
46959 |
+
function popper_find(arr, check) {
|
46960 |
+
// use native find if supported
|
46961 |
+
if (Array.prototype.find) {
|
46962 |
+
return arr.find(check);
|
46963 |
+
}
|
46964 |
|
46965 |
+
// use `filter` to obtain the same behavior of `find`
|
46966 |
+
return arr.filter(check)[0];
|
46967 |
+
}
|
46968 |
+
|
46969 |
+
/**
|
46970 |
+
* Return the index of the matching object
|
46971 |
+
* @method
|
46972 |
+
* @memberof Popper.Utils
|
46973 |
+
* @argument {Array} arr
|
46974 |
+
* @argument prop
|
46975 |
+
* @argument value
|
46976 |
+
* @returns index or -1
|
46977 |
+
*/
|
46978 |
+
function popper_findIndex(arr, prop, value) {
|
46979 |
+
// use native findIndex if supported
|
46980 |
+
if (Array.prototype.findIndex) {
|
46981 |
+
return arr.findIndex(function (cur) {
|
46982 |
+
return cur[prop] === value;
|
46983 |
+
});
|
46984 |
+
}
|
46985 |
+
|
46986 |
+
// use `find` + `indexOf` if `findIndex` isn't supported
|
46987 |
+
var match = popper_find(arr, function (obj) {
|
46988 |
+
return obj[prop] === value;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
46989 |
});
|
46990 |
+
return arr.indexOf(match);
|
46991 |
+
}
|
46992 |
+
|
46993 |
+
/**
|
46994 |
+
* Loop trough the list of modifiers and run them in order,
|
46995 |
+
* each of them will then edit the data object.
|
46996 |
+
* @method
|
46997 |
+
* @memberof Popper.Utils
|
46998 |
+
* @param {dataObject} data
|
46999 |
+
* @param {Array} modifiers
|
47000 |
+
* @param {String} ends - Optional modifier name used as stopper
|
47001 |
+
* @returns {dataObject}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47002 |
*/
|
47003 |
+
function runModifiers(modifiers, data, ends) {
|
47004 |
+
var modifiersToRun = ends === undefined ? modifiers : modifiers.slice(0, popper_findIndex(modifiers, 'name', ends));
|
47005 |
|
47006 |
+
modifiersToRun.forEach(function (modifier) {
|
47007 |
+
if (modifier['function']) {
|
47008 |
+
// eslint-disable-line dot-notation
|
47009 |
+
console.warn('`modifier.function` is deprecated, use `modifier.fn`!');
|
|
|
47010 |
}
|
47011 |
+
var fn = modifier['function'] || modifier.fn; // eslint-disable-line dot-notation
|
47012 |
+
if (modifier.enabled && isFunction(fn)) {
|
47013 |
+
// Add properties to offsets to make them a complete clientRect object
|
47014 |
+
// we do this before each modifier to make sure the previous one doesn't
|
47015 |
+
// mess with these values
|
47016 |
+
data.offsets.popper = getClientRect(data.offsets.popper);
|
47017 |
+
data.offsets.reference = getClientRect(data.offsets.reference);
|
47018 |
|
47019 |
+
data = fn(data, modifier);
|
|
|
|
|
|
|
|
|
47020 |
}
|
47021 |
+
});
|
47022 |
+
|
47023 |
+
return data;
|
|
|
|
|
|
|
47024 |
}
|
47025 |
|
47026 |
+
/**
|
47027 |
+
* Updates the position of the popper, computing the new offsets and applying
|
47028 |
+
* the new style.<br />
|
47029 |
+
* Prefer `scheduleUpdate` over `update` because of performance reasons.
|
47030 |
+
* @method
|
47031 |
+
* @memberof Popper
|
47032 |
+
*/
|
47033 |
+
function popper_update() {
|
47034 |
+
// if popper is destroyed, don't perform any further update
|
47035 |
+
if (this.state.isDestroyed) {
|
47036 |
+
return;
|
47037 |
+
}
|
47038 |
+
|
47039 |
+
var data = {
|
47040 |
+
instance: this,
|
47041 |
+
styles: {},
|
47042 |
+
arrowStyles: {},
|
47043 |
+
attributes: {},
|
47044 |
+
flipped: false,
|
47045 |
+
offsets: {}
|
47046 |
};
|
|
|
47047 |
|
47048 |
+
// compute reference element offsets
|
47049 |
+
data.offsets.reference = getReferenceOffsets(this.state, this.popper, this.reference, this.options.positionFixed);
|
47050 |
|
47051 |
+
// compute auto placement, store placement inside the data object,
|
47052 |
+
// modifiers will be able to edit `placement` if needed
|
47053 |
+
// and refer to originalPlacement to know the original value
|
47054 |
+
data.placement = popper_computeAutoPlacement(this.options.placement, data.offsets.reference, this.popper, this.reference, this.options.modifiers.flip.boundariesElement, this.options.modifiers.flip.padding);
|
47055 |
+
|
47056 |
+
// store the computed placement inside `originalPlacement`
|
47057 |
+
data.originalPlacement = data.placement;
|
47058 |
+
|
47059 |
+
data.positionFixed = this.options.positionFixed;
|
47060 |
+
|
47061 |
+
// compute the popper offsets
|
47062 |
+
data.offsets.popper = getPopperOffsets(this.popper, data.offsets.reference, data.placement);
|
47063 |
+
|
47064 |
+
data.offsets.popper.position = this.options.positionFixed ? 'fixed' : 'absolute';
|
47065 |
+
|
47066 |
+
// run the modifiers
|
47067 |
+
data = runModifiers(this.modifiers, data);
|
47068 |
+
|
47069 |
+
// the first `update` will call `onCreate` callback
|
47070 |
+
// the other ones will call `onUpdate` callback
|
47071 |
+
if (!this.state.isCreated) {
|
47072 |
+
this.state.isCreated = true;
|
47073 |
+
this.options.onCreate(data);
|
47074 |
+
} else {
|
47075 |
+
this.options.onUpdate(data);
|
47076 |
+
}
|
47077 |
+
}
|
47078 |
|
47079 |
/**
|
47080 |
+
* Helper used to know if the given modifier is enabled.
|
47081 |
* @method
|
47082 |
* @memberof Popper.Utils
|
47083 |
+
* @returns {Boolean}
|
|
|
47084 |
*/
|
47085 |
+
function isModifierEnabled(modifiers, modifierName) {
|
47086 |
+
return modifiers.some(function (_ref) {
|
47087 |
+
var name = _ref.name,
|
47088 |
+
enabled = _ref.enabled;
|
47089 |
+
return enabled && name === modifierName;
|
47090 |
+
});
|
47091 |
}
|
47092 |
|
47093 |
/**
|
47094 |
+
* Get the prefixed supported property name
|
47095 |
* @method
|
47096 |
* @memberof Popper.Utils
|
47097 |
+
* @argument {String} property (camelCase)
|
47098 |
+
* @returns {String} prefixed property (camelCase or PascalCase, depending on the vendor prefix)
|
47099 |
*/
|
47100 |
+
function getSupportedPropertyName(property) {
|
47101 |
+
var prefixes = [false, 'ms', 'Webkit', 'Moz', 'O'];
|
47102 |
+
var upperProp = property.charAt(0).toUpperCase() + property.slice(1);
|
47103 |
+
|
47104 |
+
for (var i = 0; i < prefixes.length; i++) {
|
47105 |
+
var prefix = prefixes[i];
|
47106 |
+
var toCheck = prefix ? '' + prefix + upperProp : property;
|
47107 |
+
if (typeof document.body.style[toCheck] !== 'undefined') {
|
47108 |
+
return toCheck;
|
47109 |
+
}
|
47110 |
}
|
47111 |
+
return null;
|
|
|
|
|
|
|
47112 |
}
|
47113 |
|
47114 |
/**
|
47115 |
+
* Destroys the popper.
|
47116 |
* @method
|
47117 |
+
* @memberof Popper
|
47118 |
+
*/
|
47119 |
+
function destroy() {
|
47120 |
+
this.state.isDestroyed = true;
|
47121 |
+
|
47122 |
+
// touch DOM only if `applyStyle` modifier is enabled
|
47123 |
+
if (isModifierEnabled(this.modifiers, 'applyStyle')) {
|
47124 |
+
this.popper.removeAttribute('x-placement');
|
47125 |
+
this.popper.style.position = '';
|
47126 |
+
this.popper.style.top = '';
|
47127 |
+
this.popper.style.left = '';
|
47128 |
+
this.popper.style.right = '';
|
47129 |
+
this.popper.style.bottom = '';
|
47130 |
+
this.popper.style.willChange = '';
|
47131 |
+
this.popper.style[getSupportedPropertyName('transform')] = '';
|
47132 |
+
}
|
47133 |
+
|
47134 |
+
this.disableEventListeners();
|
47135 |
+
|
47136 |
+
// remove the popper if user explicitly asked for the deletion on destroy
|
47137 |
+
// do not use `remove` because IE11 doesn't support it
|
47138 |
+
if (this.options.removeOnDestroy) {
|
47139 |
+
this.popper.parentNode.removeChild(this.popper);
|
47140 |
+
}
|
47141 |
+
return this;
|
47142 |
+
}
|
47143 |
+
|
47144 |
+
/**
|
47145 |
+
* Get the window associated with the element
|
47146 |
* @argument {Element} element
|
47147 |
+
* @returns {Window}
|
47148 |
*/
|
47149 |
+
function popper_getWindow(element) {
|
47150 |
+
var ownerDocument = element.ownerDocument;
|
47151 |
+
return ownerDocument ? ownerDocument.defaultView : window;
|
47152 |
+
}
|
47153 |
+
|
47154 |
+
function attachToScrollParents(scrollParent, event, callback, scrollParents) {
|
47155 |
+
var isBody = scrollParent.nodeName === 'BODY';
|
47156 |
+
var target = isBody ? scrollParent.ownerDocument.defaultView : scrollParent;
|
47157 |
+
target.addEventListener(event, callback, { passive: true });
|
47158 |
+
|
47159 |
+
if (!isBody) {
|
47160 |
+
attachToScrollParents(popper_getScrollParent(target.parentNode), event, callback, scrollParents);
|
47161 |
}
|
47162 |
+
scrollParents.push(target);
|
47163 |
}
|
47164 |
|
47165 |
/**
|
47166 |
+
* Setup needed event listeners used to update the popper position
|
47167 |
* @method
|
47168 |
* @memberof Popper.Utils
|
47169 |
+
* @private
|
|
|
47170 |
*/
|
47171 |
+
function setupEventListeners(reference, options, state, updateBound) {
|
47172 |
+
// Resize event listener on window
|
47173 |
+
state.updateBound = updateBound;
|
47174 |
+
popper_getWindow(reference).addEventListener('resize', state.updateBound, { passive: true });
|
|
|
47175 |
|
47176 |
+
// Scroll event listener on scroll parents
|
47177 |
+
var scrollElement = popper_getScrollParent(reference);
|
47178 |
+
attachToScrollParents(scrollElement, 'scroll', state.updateBound, state.scrollParents);
|
47179 |
+
state.scrollElement = scrollElement;
|
47180 |
+
state.eventsEnabled = true;
|
47181 |
+
|
47182 |
+
return state;
|
47183 |
+
}
|
47184 |
+
|
47185 |
+
/**
|
47186 |
+
* It will add resize/scroll events and start recalculating
|
47187 |
+
* position of the popper element when they are triggered.
|
47188 |
+
* @method
|
47189 |
+
* @memberof Popper
|
47190 |
+
*/
|
47191 |
+
function enableEventListeners() {
|
47192 |
+
if (!this.state.eventsEnabled) {
|
47193 |
+
this.state = setupEventListeners(this.reference, this.options, this.state, this.scheduleUpdate);
|
47194 |
}
|
47195 |
+
}
|
47196 |
|
47197 |
+
/**
|
47198 |
+
* Remove event listeners used to update the popper position
|
47199 |
+
* @method
|
47200 |
+
* @memberof Popper.Utils
|
47201 |
+
* @private
|
47202 |
+
*/
|
47203 |
+
function removeEventListeners(reference, state) {
|
47204 |
+
// Remove resize event listener on window
|
47205 |
+
popper_getWindow(reference).removeEventListener('resize', state.updateBound);
|
47206 |
|
47207 |
+
// Remove scroll event listener on scroll parents
|
47208 |
+
state.scrollParents.forEach(function (target) {
|
47209 |
+
target.removeEventListener('scroll', state.updateBound);
|
47210 |
+
});
|
47211 |
|
47212 |
+
// Reset state
|
47213 |
+
state.updateBound = null;
|
47214 |
+
state.scrollParents = [];
|
47215 |
+
state.scrollElement = null;
|
47216 |
+
state.eventsEnabled = false;
|
47217 |
+
return state;
|
47218 |
+
}
|
47219 |
|
47220 |
+
/**
|
47221 |
+
* It will remove resize/scroll events and won't recalculate popper position
|
47222 |
+
* when they are triggered. It also won't trigger `onUpdate` callback anymore,
|
47223 |
+
* unless you call `update` method manually.
|
47224 |
+
* @method
|
47225 |
+
* @memberof Popper
|
47226 |
+
*/
|
47227 |
+
function disableEventListeners() {
|
47228 |
+
if (this.state.eventsEnabled) {
|
47229 |
+
cancelAnimationFrame(this.scheduleUpdate);
|
47230 |
+
this.state = removeEventListeners(this.reference, this.state);
|
47231 |
+
}
|
47232 |
}
|
47233 |
|
47234 |
/**
|
47235 |
+
* Tells if a given input is a number
|
47236 |
* @method
|
47237 |
* @memberof Popper.Utils
|
47238 |
+
* @param {*} input to check
|
47239 |
+
* @return {Boolean}
|
47240 |
*/
|
47241 |
+
function isNumeric(n) {
|
47242 |
+
return n !== '' && !isNaN(parseFloat(n)) && isFinite(n);
|
47243 |
}
|
47244 |
|
|
|
|
|
|
|
47245 |
/**
|
47246 |
+
* Set the style to the given popper
|
47247 |
* @method
|
47248 |
* @memberof Popper.Utils
|
47249 |
+
* @argument {Element} element - Element to apply the style to
|
47250 |
+
* @argument {Object} styles
|
47251 |
+
* Object with a list of properties and values which will be applied to the element
|
47252 |
*/
|
47253 |
+
function setStyles(element, styles) {
|
47254 |
+
Object.keys(styles).forEach(function (prop) {
|
47255 |
+
var unit = '';
|
47256 |
+
// add unit if the value is numeric and is one of the following
|
47257 |
+
if (['width', 'height', 'top', 'right', 'bottom', 'left'].indexOf(prop) !== -1 && isNumeric(styles[prop])) {
|
47258 |
+
unit = 'px';
|
47259 |
+
}
|
47260 |
+
element.style[prop] = styles[prop] + unit;
|
47261 |
+
});
|
47262 |
}
|
47263 |
|
47264 |
/**
|
47265 |
+
* Set the attributes to the given popper
|
47266 |
* @method
|
47267 |
* @memberof Popper.Utils
|
47268 |
+
* @argument {Element} element - Element to apply the attributes to
|
47269 |
+
* @argument {Object} styles
|
47270 |
+
* Object with a list of properties and values which will be applied to the element
|
47271 |
*/
|
47272 |
+
function setAttributes(element, attributes) {
|
47273 |
+
Object.keys(attributes).forEach(function (prop) {
|
47274 |
+
var value = attributes[prop];
|
47275 |
+
if (value !== false) {
|
47276 |
+
element.setAttribute(prop, attributes[prop]);
|
47277 |
+
} else {
|
47278 |
+
element.removeAttribute(prop);
|
47279 |
+
}
|
47280 |
+
});
|
47281 |
+
}
|
47282 |
|
47283 |
+
/**
|
47284 |
+
* @function
|
47285 |
+
* @memberof Modifiers
|
47286 |
+
* @argument {Object} data - The data object generated by `update` method
|
47287 |
+
* @argument {Object} data.styles - List of style properties - values to apply to popper element
|
47288 |
+
* @argument {Object} data.attributes - List of attribute properties - values to apply to popper element
|
47289 |
+
* @argument {Object} options - Modifiers configuration and options
|
47290 |
+
* @returns {Object} The same data object
|
47291 |
+
*/
|
47292 |
+
function applyStyle(data) {
|
47293 |
+
// any property present in `data.styles` will be applied to the popper,
|
47294 |
+
// in this way we can make the 3rd party modifiers add custom styles to it
|
47295 |
+
// Be aware, modifiers could override the properties defined in the previous
|
47296 |
+
// lines of this modifier!
|
47297 |
+
setStyles(data.instance.popper, data.styles);
|
47298 |
|
47299 |
+
// any property present in `data.attributes` will be applied to the popper,
|
47300 |
+
// they will be set as HTML attributes of the element
|
47301 |
+
setAttributes(data.instance.popper, data.attributes);
|
47302 |
+
|
47303 |
+
// if arrowElement is defined and arrowStyles has some properties
|
47304 |
+
if (data.arrowElement && Object.keys(data.arrowStyles).length) {
|
47305 |
+
setStyles(data.arrowElement, data.arrowStyles);
|
47306 |
}
|
47307 |
|
47308 |
+
return data;
|
47309 |
+
}
|
47310 |
|
47311 |
+
/**
|
47312 |
+
* Set the x-placement attribute before everything else because it could be used
|
47313 |
+
* to add margins to the popper margins needs to be calculated to get the
|
47314 |
+
* correct popper offsets.
|
47315 |
+
* @method
|
47316 |
+
* @memberof Popper.modifiers
|
47317 |
+
* @param {HTMLElement} reference - The reference element used to position the popper
|
47318 |
+
* @param {HTMLElement} popper - The HTML element used as popper
|
47319 |
+
* @param {Object} options - Popper.js options
|
47320 |
+
*/
|
47321 |
+
function applyStyleOnLoad(reference, popper, options, modifierOptions, state) {
|
47322 |
+
// compute reference element offsets
|
47323 |
+
var referenceOffsets = getReferenceOffsets(state, popper, reference, options.positionFixed);
|
47324 |
|
47325 |
+
// compute auto placement, store placement inside the data object,
|
47326 |
+
// modifiers will be able to edit `placement` if needed
|
47327 |
+
// and refer to originalPlacement to know the original value
|
47328 |
+
var placement = popper_computeAutoPlacement(options.placement, referenceOffsets, popper, reference, options.modifiers.flip.boundariesElement, options.modifiers.flip.padding);
|
|
|
47329 |
|
47330 |
+
popper.setAttribute('x-placement', placement);
|
|
|
47331 |
|
47332 |
+
// Apply `position` to popper before anything else because
|
47333 |
+
// without the position applied we can't guarantee correct computations
|
47334 |
+
setStyles(popper, { position: options.positionFixed ? 'fixed' : 'absolute' });
|
47335 |
|
47336 |
+
return options;
|
|
|
|
|
|
|
47337 |
}
|
47338 |
|
47339 |
/**
|
47340 |
+
* @function
|
|
|
47341 |
* @memberof Popper.Utils
|
47342 |
+
* @argument {Object} data - The data object generated by `update` method
|
47343 |
+
* @argument {Boolean} shouldRound - If the offsets should be rounded at all
|
47344 |
+
* @returns {Object} The popper's position offsets rounded
|
47345 |
+
*
|
47346 |
+
* The tale of pixel-perfect positioning. It's still not 100% perfect, but as
|
47347 |
+
* good as it can be within reason.
|
47348 |
+
* Discussion here: https://github.com/FezVrasta/popper.js/pull/715
|
47349 |
+
*
|
47350 |
+
* Low DPI screens cause a popper to be blurry if not using full pixels (Safari
|
47351 |
+
* as well on High DPI screens).
|
47352 |
+
*
|
47353 |
+
* Firefox prefers no rounding for positioning and does not have blurriness on
|
47354 |
+
* high DPI screens.
|
47355 |
+
*
|
47356 |
+
* Only horizontal placement and left/right values need to be considered.
|
47357 |
*/
|
47358 |
+
function getRoundedOffsets(data, shouldRound) {
|
47359 |
+
var _data$offsets = data.offsets,
|
47360 |
+
popper = _data$offsets.popper,
|
47361 |
+
reference = _data$offsets.reference;
|
47362 |
+
var round = Math.round,
|
47363 |
+
floor = Math.floor;
|
47364 |
|
47365 |
+
var noRound = function noRound(v) {
|
47366 |
+
return v;
|
47367 |
+
};
|
47368 |
+
|
47369 |
+
var referenceWidth = round(reference.width);
|
47370 |
+
var popperWidth = round(popper.width);
|
47371 |
+
|
47372 |
+
var isVertical = ['left', 'right'].indexOf(data.placement) !== -1;
|
47373 |
+
var isVariation = data.placement.indexOf('-') !== -1;
|
47374 |
+
var sameWidthParity = referenceWidth % 2 === popperWidth % 2;
|
47375 |
+
var bothOddWidth = referenceWidth % 2 === 1 && popperWidth % 2 === 1;
|
47376 |
+
|
47377 |
+
var horizontalToInteger = !shouldRound ? noRound : isVertical || isVariation || sameWidthParity ? round : floor;
|
47378 |
+
var verticalToInteger = !shouldRound ? noRound : round;
|
47379 |
+
|
47380 |
+
return {
|
47381 |
+
left: horizontalToInteger(bothOddWidth && !isVariation && shouldRound ? popper.left - 1 : popper.left),
|
47382 |
+
top: verticalToInteger(popper.top),
|
47383 |
+
bottom: verticalToInteger(popper.bottom),
|
47384 |
+
right: horizontalToInteger(popper.right)
|
47385 |
+
};
|
47386 |
}
|
47387 |
|
47388 |
+
var isFirefox = popper_isBrowser && /Firefox/i.test(navigator.userAgent);
|
47389 |
+
|
47390 |
/**
|
47391 |
+
* @function
|
47392 |
+
* @memberof Modifiers
|
47393 |
+
* @argument {Object} data - The data object generated by `update` method
|
47394 |
+
* @argument {Object} options - Modifiers configuration and options
|
47395 |
+
* @returns {Object} The data object, properly modified
|
|
|
47396 |
*/
|
47397 |
+
function computeStyle(data, options) {
|
47398 |
+
var x = options.x,
|
47399 |
+
y = options.y;
|
47400 |
+
var popper = data.offsets.popper;
|
47401 |
+
|
47402 |
+
// Remove this legacy support in Popper.js v2
|
47403 |
+
|
47404 |
+
var legacyGpuAccelerationOption = popper_find(data.instance.modifiers, function (modifier) {
|
47405 |
+
return modifier.name === 'applyStyle';
|
47406 |
+
}).gpuAcceleration;
|
47407 |
+
if (legacyGpuAccelerationOption !== undefined) {
|
47408 |
+
console.warn('WARNING: `gpuAcceleration` option moved to `computeStyle` modifier and will not be supported in future versions of Popper.js!');
|
47409 |
}
|
47410 |
+
var gpuAcceleration = legacyGpuAccelerationOption !== undefined ? legacyGpuAccelerationOption : options.gpuAcceleration;
|
47411 |
|
47412 |
+
var offsetParent = popper_getOffsetParent(data.instance.popper);
|
47413 |
+
var offsetParentRect = popper_getBoundingClientRect(offsetParent);
|
|
|
|
|
47414 |
|
47415 |
+
// Styles
|
47416 |
+
var styles = {
|
47417 |
+
position: popper.position
|
47418 |
+
};
|
|
|
47419 |
|
47420 |
+
var offsets = getRoundedOffsets(data, window.devicePixelRatio < 2 || !isFirefox);
|
47421 |
|
47422 |
+
var sideA = x === 'bottom' ? 'top' : 'bottom';
|
47423 |
+
var sideB = y === 'right' ? 'left' : 'right';
|
|
|
|
|
47424 |
|
47425 |
+
// if gpuAcceleration is set to `true` and transform is supported,
|
47426 |
+
// we use `translate3d` to apply the position to the popper we
|
47427 |
+
// automatically use the supported prefixed version if needed
|
47428 |
+
var prefixedProperty = getSupportedPropertyName('transform');
|
47429 |
|
47430 |
+
// now, let's make a step back and look at this code closely (wtf?)
|
47431 |
+
// If the content of the popper grows once it's been positioned, it
|
47432 |
+
// may happen that the popper gets misplaced because of the new content
|
47433 |
+
// overflowing its reference element
|
47434 |
+
// To avoid this problem, we provide two options (x and y), which allow
|
47435 |
+
// the consumer to define the offset origin.
|
47436 |
+
// If we position a popper on top of a reference element, we can set
|
47437 |
+
// `x` to `top` to make the popper grow towards its top instead of
|
47438 |
+
// its bottom.
|
47439 |
+
var left = void 0,
|
47440 |
+
top = void 0;
|
47441 |
+
if (sideA === 'bottom') {
|
47442 |
+
// when offsetParent is <html> the positioning is relative to the bottom of the screen (excluding the scrollbar)
|
47443 |
+
// and not the bottom of the html element
|
47444 |
+
if (offsetParent.nodeName === 'HTML') {
|
47445 |
+
top = -offsetParent.clientHeight + offsets.bottom;
|
47446 |
+
} else {
|
47447 |
+
top = -offsetParentRect.height + offsets.bottom;
|
47448 |
+
}
|
47449 |
} else {
|
47450 |
+
top = offsets.top;
|
47451 |
}
|
47452 |
+
if (sideB === 'right') {
|
47453 |
+
if (offsetParent.nodeName === 'HTML') {
|
47454 |
+
left = -offsetParent.clientWidth + offsets.right;
|
47455 |
+
} else {
|
47456 |
+
left = -offsetParentRect.width + offsets.right;
|
47457 |
+
}
|
47458 |
+
} else {
|
47459 |
+
left = offsets.left;
|
47460 |
+
}
|
47461 |
+
if (gpuAcceleration && prefixedProperty) {
|
47462 |
+
styles[prefixedProperty] = 'translate3d(' + left + 'px, ' + top + 'px, 0)';
|
47463 |
+
styles[sideA] = 0;
|
47464 |
+
styles[sideB] = 0;
|
47465 |
+
styles.willChange = 'transform';
|
47466 |
+
} else {
|
47467 |
+
// othwerise, we use the standard `top`, `left`, `bottom` and `right` properties
|
47468 |
+
var invertTop = sideA === 'bottom' ? -1 : 1;
|
47469 |
+
var invertLeft = sideB === 'right' ? -1 : 1;
|
47470 |
+
styles[sideA] = top * invertTop;
|
47471 |
+
styles[sideB] = left * invertLeft;
|
47472 |
+
styles.willChange = sideA + ', ' + sideB;
|
47473 |
}
|
47474 |
|
47475 |
+
// Attributes
|
47476 |
+
var attributes = {
|
47477 |
+
'x-placement': data.placement
|
47478 |
+
};
|
47479 |
|
47480 |
+
// Update `data` attributes, styles and arrowStyles
|
47481 |
+
data.attributes = popper_extends({}, attributes, data.attributes);
|
47482 |
+
data.styles = popper_extends({}, styles, data.styles);
|
47483 |
+
data.arrowStyles = popper_extends({}, data.offsets.arrow, data.arrowStyles);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47484 |
|
47485 |
+
return data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47486 |
}
|
47487 |
|
47488 |
+
/**
|
47489 |
+
* Helper used to know if the given modifier depends from another one.<br />
|
47490 |
+
* It checks if the needed modifier is listed and enabled.
|
47491 |
* @method
|
47492 |
* @memberof Popper.Utils
|
47493 |
+
* @param {Array} modifiers - list of modifiers
|
47494 |
+
* @param {String} requestingName - name of requesting modifier
|
47495 |
+
* @param {String} requestedName - name of requested modifier
|
47496 |
+
* @returns {Boolean}
|
47497 |
*/
|
47498 |
+
function isModifierRequired(modifiers, requestingName, requestedName) {
|
47499 |
+
var requesting = popper_find(modifiers, function (_ref) {
|
47500 |
+
var name = _ref.name;
|
47501 |
+
return name === requestingName;
|
47502 |
+
});
|
47503 |
|
47504 |
+
var isRequired = !!requesting && modifiers.some(function (modifier) {
|
47505 |
+
return modifier.name === requestedName && modifier.enabled && modifier.order < requesting.order;
|
47506 |
+
});
|
47507 |
|
47508 |
+
if (!isRequired) {
|
47509 |
+
var _requesting = '`' + requestingName + '`';
|
47510 |
+
var requested = '`' + requestedName + '`';
|
47511 |
+
console.warn(requested + ' modifier is required by ' + _requesting + ' modifier in order to work, be sure to include it before ' + _requesting + '!');
|
47512 |
+
}
|
47513 |
+
return isRequired;
|
47514 |
}
|
47515 |
|
47516 |
+
/**
|
47517 |
+
* @function
|
47518 |
+
* @memberof Modifiers
|
47519 |
+
* @argument {Object} data - The data object generated by update method
|
47520 |
+
* @argument {Object} options - Modifiers configuration and options
|
47521 |
+
* @returns {Object} The data object, properly modified
|
47522 |
+
*/
|
47523 |
+
function popper_arrow(data, options) {
|
47524 |
+
var _data$offsets$arrow;
|
47525 |
|
47526 |
+
// arrow depends on keepTogether in order to work
|
47527 |
+
if (!isModifierRequired(data.instance.modifiers, 'arrow', 'keepTogether')) {
|
47528 |
+
return data;
|
47529 |
+
}
|
47530 |
|
47531 |
+
var arrowElement = options.element;
|
|
|
|
|
|
|
|
|
47532 |
|
47533 |
+
// if arrowElement is a string, suppose it's a CSS selector
|
47534 |
+
if (typeof arrowElement === 'string') {
|
47535 |
+
arrowElement = data.instance.popper.querySelector(arrowElement);
|
|
|
|
|
47536 |
|
47537 |
+
// if arrowElement is not found, don't run the modifier
|
47538 |
+
if (!arrowElement) {
|
47539 |
+
return data;
|
47540 |
+
}
|
47541 |
+
} else {
|
47542 |
+
// if the arrowElement isn't a query selector we must check that the
|
47543 |
+
// provided DOM node is child of its popper node
|
47544 |
+
if (!data.instance.popper.contains(arrowElement)) {
|
47545 |
+
console.warn('WARNING: `arrow.element` must be child of its popper element!');
|
47546 |
+
return data;
|
47547 |
}
|
47548 |
}
|
47549 |
|
47550 |
+
var placement = data.placement.split('-')[0];
|
47551 |
+
var _data$offsets = data.offsets,
|
47552 |
+
popper = _data$offsets.popper,
|
47553 |
+
reference = _data$offsets.reference;
|
|
|
|
|
|
|
47554 |
|
47555 |
+
var isVertical = ['left', 'right'].indexOf(placement) !== -1;
|
47556 |
|
47557 |
+
var len = isVertical ? 'height' : 'width';
|
47558 |
+
var sideCapitalized = isVertical ? 'Top' : 'Left';
|
47559 |
+
var side = sideCapitalized.toLowerCase();
|
47560 |
+
var altSide = isVertical ? 'left' : 'top';
|
47561 |
+
var opSide = isVertical ? 'bottom' : 'right';
|
47562 |
+
var arrowElementSize = getOuterSizes(arrowElement)[len];
|
47563 |
|
47564 |
+
//
|
47565 |
+
// extends keepTogether behavior making sure the popper and its
|
47566 |
+
// reference have enough pixels in conjunction
|
47567 |
+
//
|
47568 |
|
47569 |
+
// top/left side
|
47570 |
+
if (reference[opSide] - arrowElementSize < popper[side]) {
|
47571 |
+
data.offsets.popper[side] -= popper[side] - (reference[opSide] - arrowElementSize);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47572 |
}
|
47573 |
+
// bottom/right side
|
47574 |
+
if (reference[side] + arrowElementSize > popper[opSide]) {
|
47575 |
+
data.offsets.popper[side] += reference[side] + arrowElementSize - popper[opSide];
|
47576 |
+
}
|
47577 |
+
data.offsets.popper = getClientRect(data.offsets.popper);
|
47578 |
|
47579 |
+
// compute center of the popper
|
47580 |
+
var center = reference[side] + reference[len] / 2 - arrowElementSize / 2;
|
47581 |
|
47582 |
+
// Compute the sideValue using the updated popper offsets
|
47583 |
+
// take popper margin in account because we don't have this info available
|
47584 |
+
var css = getStyleComputedProperty(data.instance.popper);
|
47585 |
+
var popperMarginSide = parseFloat(css['margin' + sideCapitalized]);
|
47586 |
+
var popperBorderSide = parseFloat(css['border' + sideCapitalized + 'Width']);
|
47587 |
+
var sideValue = center - data.offsets.popper[side] - popperMarginSide - popperBorderSide;
|
47588 |
|
47589 |
+
// prevent arrowElement from being placed not contiguously to its popper
|
47590 |
+
sideValue = Math.max(Math.min(popper[len] - arrowElementSize, sideValue), 0);
|
47591 |
+
|
47592 |
+
data.arrowElement = arrowElement;
|
47593 |
+
data.offsets.arrow = (_data$offsets$arrow = {}, popper_defineProperty(_data$offsets$arrow, side, Math.round(sideValue)), popper_defineProperty(_data$offsets$arrow, altSide, ''), _data$offsets$arrow);
|
47594 |
+
|
47595 |
+
return data;
|
47596 |
+
}
|
47597 |
+
|
47598 |
+
/**
|
47599 |
+
* Get the opposite placement variation of the given one
|
47600 |
+
* @method
|
47601 |
+
* @memberof Popper.Utils
|
47602 |
+
* @argument {String} placement variation
|
47603 |
+
* @returns {String} flipped placement variation
|
47604 |
+
*/
|
47605 |
+
function getOppositeVariation(variation) {
|
47606 |
+
if (variation === 'end') {
|
47607 |
+
return 'start';
|
47608 |
+
} else if (variation === 'start') {
|
47609 |
+
return 'end';
|
47610 |
}
|
47611 |
+
return variation;
|
47612 |
+
}
|
47613 |
|
47614 |
+
/**
|
47615 |
+
* List of accepted placements to use as values of the `placement` option.<br />
|
47616 |
+
* Valid placements are:
|
47617 |
+
* - `auto`
|
47618 |
+
* - `top`
|
47619 |
+
* - `right`
|
47620 |
+
* - `bottom`
|
47621 |
+
* - `left`
|
47622 |
+
*
|
47623 |
+
* Each placement can have a variation from this list:
|
47624 |
+
* - `-start`
|
47625 |
+
* - `-end`
|
47626 |
+
*
|
47627 |
+
* Variations are interpreted easily if you think of them as the left to right
|
47628 |
+
* written languages. Horizontally (`top` and `bottom`), `start` is left and `end`
|
47629 |
+
* is right.<br />
|
47630 |
+
* Vertically (`left` and `right`), `start` is top and `end` is bottom.
|
47631 |
+
*
|
47632 |
+
* Some valid examples are:
|
47633 |
+
* - `top-end` (on top of reference, right aligned)
|
47634 |
+
* - `right-start` (on right of reference, top aligned)
|
47635 |
+
* - `bottom` (on bottom, centered)
|
47636 |
+
* - `auto-end` (on the side with more space available, alignment depends by placement)
|
47637 |
+
*
|
47638 |
+
* @static
|
47639 |
+
* @type {Array}
|
47640 |
+
* @enum {String}
|
47641 |
+
* @readonly
|
47642 |
+
* @method placements
|
47643 |
+
* @memberof Popper
|
47644 |
+
*/
|
47645 |
+
var placements = ['auto-start', 'auto', 'auto-end', 'top-start', 'top', 'top-end', 'right-start', 'right', 'right-end', 'bottom-end', 'bottom', 'bottom-start', 'left-end', 'left', 'left-start'];
|
47646 |
+
|
47647 |
+
// Get rid of `auto` `auto-start` and `auto-end`
|
47648 |
+
var validPlacements = placements.slice(3);
|
47649 |
|
47650 |
/**
|
47651 |
+
* Given an initial placement, returns all the subsequent placements
|
47652 |
+
* clockwise (or counter-clockwise).
|
47653 |
+
*
|
47654 |
* @method
|
47655 |
* @memberof Popper.Utils
|
47656 |
+
* @argument {String} placement - A valid placement (it accepts variations)
|
47657 |
+
* @argument {Boolean} counter - Set to true to walk the placements counterclockwise
|
47658 |
+
* @returns {Array} placements including their variations
|
47659 |
*/
|
47660 |
+
function clockwise(placement) {
|
47661 |
+
var counter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
47662 |
+
|
47663 |
+
var index = validPlacements.indexOf(placement);
|
47664 |
+
var arr = validPlacements.slice(index + 1).concat(validPlacements.slice(0, index));
|
47665 |
+
return counter ? arr.reverse() : arr;
|
47666 |
}
|
47667 |
|
47668 |
+
var BEHAVIORS = {
|
47669 |
+
FLIP: 'flip',
|
47670 |
+
CLOCKWISE: 'clockwise',
|
47671 |
+
COUNTERCLOCKWISE: 'counterclockwise'
|
47672 |
+
};
|
47673 |
+
|
47674 |
/**
|
47675 |
+
* @function
|
47676 |
+
* @memberof Modifiers
|
47677 |
+
* @argument {Object} data - The data object generated by update method
|
47678 |
+
* @argument {Object} options - Modifiers configuration and options
|
47679 |
+
* @returns {Object} The data object, properly modified
|
47680 |
*/
|
47681 |
+
function popper_flip(data, options) {
|
47682 |
+
// if `inner` modifier is enabled, we can't use the `flip` modifier
|
47683 |
+
if (isModifierEnabled(data.instance.modifiers, 'inner')) {
|
47684 |
+
return data;
|
47685 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47686 |
|
47687 |
+
if (data.flipped && data.placement === data.originalPlacement) {
|
47688 |
+
// seems like flip is trying to loop, probably there's not enough space on any of the flippable sides
|
47689 |
+
return data;
|
47690 |
+
}
|
|
|
|
|
47691 |
|
47692 |
+
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, options.boundariesElement, data.positionFixed);
|
|
|
|
|
|
|
47693 |
|
47694 |
+
var placement = data.placement.split('-')[0];
|
47695 |
+
var placementOpposite = popper_getOppositePlacement(placement);
|
47696 |
+
var variation = data.placement.split('-')[1] || '';
|
47697 |
|
47698 |
+
var flipOrder = [];
|
|
|
|
|
|
|
|
|
|
|
47699 |
|
47700 |
+
switch (options.behavior) {
|
47701 |
+
case BEHAVIORS.FLIP:
|
47702 |
+
flipOrder = [placement, placementOpposite];
|
47703 |
+
break;
|
47704 |
+
case BEHAVIORS.CLOCKWISE:
|
47705 |
+
flipOrder = clockwise(placement);
|
47706 |
+
break;
|
47707 |
+
case BEHAVIORS.COUNTERCLOCKWISE:
|
47708 |
+
flipOrder = clockwise(placement, true);
|
47709 |
+
break;
|
47710 |
+
default:
|
47711 |
+
flipOrder = options.behavior;
|
47712 |
}
|
47713 |
|
47714 |
+
flipOrder.forEach(function (step, index) {
|
47715 |
+
if (placement !== step || flipOrder.length === index + 1) {
|
47716 |
+
return data;
|
47717 |
+
}
|
47718 |
|
47719 |
+
placement = data.placement.split('-')[0];
|
47720 |
+
placementOpposite = popper_getOppositePlacement(placement);
|
47721 |
|
47722 |
+
var popperOffsets = data.offsets.popper;
|
47723 |
+
var refOffsets = data.offsets.reference;
|
|
|
|
|
|
|
47724 |
|
47725 |
+
// using floor because the reference offsets may contain decimals we are not going to consider here
|
47726 |
+
var floor = Math.floor;
|
47727 |
+
var overlapsRef = placement === 'left' && floor(popperOffsets.right) > floor(refOffsets.left) || placement === 'right' && floor(popperOffsets.left) < floor(refOffsets.right) || placement === 'top' && floor(popperOffsets.bottom) > floor(refOffsets.top) || placement === 'bottom' && floor(popperOffsets.top) < floor(refOffsets.bottom);
|
47728 |
|
47729 |
+
var overflowsLeft = floor(popperOffsets.left) < floor(boundaries.left);
|
47730 |
+
var overflowsRight = floor(popperOffsets.right) > floor(boundaries.right);
|
47731 |
+
var overflowsTop = floor(popperOffsets.top) < floor(boundaries.top);
|
47732 |
+
var overflowsBottom = floor(popperOffsets.bottom) > floor(boundaries.bottom);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47733 |
|
47734 |
+
var overflowsBoundaries = placement === 'left' && overflowsLeft || placement === 'right' && overflowsRight || placement === 'top' && overflowsTop || placement === 'bottom' && overflowsBottom;
|
|
|
|
|
|
|
|
|
|
|
|
|
47735 |
|
47736 |
+
// flip the variation if required
|
47737 |
+
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
|
|
|
|
|
47738 |
|
47739 |
+
// flips variation if reference element overflows boundaries
|
47740 |
+
var flippedVariationByRef = !!options.flipVariations && (isVertical && variation === 'start' && overflowsLeft || isVertical && variation === 'end' && overflowsRight || !isVertical && variation === 'start' && overflowsTop || !isVertical && variation === 'end' && overflowsBottom);
|
|
|
|
|
47741 |
|
47742 |
+
// flips variation if popper content overflows boundaries
|
47743 |
+
var flippedVariationByContent = !!options.flipVariationsByContent && (isVertical && variation === 'start' && overflowsRight || isVertical && variation === 'end' && overflowsLeft || !isVertical && variation === 'start' && overflowsBottom || !isVertical && variation === 'end' && overflowsTop);
|
|
|
47744 |
|
47745 |
+
var flippedVariation = flippedVariationByRef || flippedVariationByContent;
|
|
|
47746 |
|
47747 |
+
if (overlapsRef || overflowsBoundaries || flippedVariation) {
|
47748 |
+
// this boolean to detect any flip loop
|
47749 |
+
data.flipped = true;
|
47750 |
|
47751 |
+
if (overlapsRef || overflowsBoundaries) {
|
47752 |
+
placement = flipOrder[index + 1];
|
47753 |
+
}
|
|
|
47754 |
|
47755 |
+
if (flippedVariation) {
|
47756 |
+
variation = getOppositeVariation(variation);
|
47757 |
+
}
|
47758 |
|
47759 |
+
data.placement = placement + (variation ? '-' + variation : '');
|
|
|
|
|
|
|
|
|
|
|
47760 |
|
47761 |
+
// this object contains `position`, we want to preserve it along with
|
47762 |
+
// any additional property we may add in the future
|
47763 |
+
data.offsets.popper = popper_extends({}, data.offsets.popper, getPopperOffsets(data.instance.popper, data.offsets.reference, data.placement));
|
47764 |
+
|
47765 |
+
data = runModifiers(data.instance.modifiers, data, 'flip');
|
47766 |
+
}
|
47767 |
+
});
|
47768 |
+
return data;
|
47769 |
}
|
47770 |
|
47771 |
/**
|
47772 |
+
* @function
|
47773 |
+
* @memberof Modifiers
|
47774 |
+
* @argument {Object} data - The data object generated by update method
|
47775 |
+
* @argument {Object} options - Modifiers configuration and options
|
47776 |
+
* @returns {Object} The data object, properly modified
|
|
|
47777 |
*/
|
47778 |
+
function keepTogether(data) {
|
47779 |
+
var _data$offsets = data.offsets,
|
47780 |
+
popper = _data$offsets.popper,
|
47781 |
+
reference = _data$offsets.reference;
|
47782 |
+
|
47783 |
+
var placement = data.placement.split('-')[0];
|
47784 |
+
var floor = Math.floor;
|
47785 |
+
var isVertical = ['top', 'bottom'].indexOf(placement) !== -1;
|
47786 |
+
var side = isVertical ? 'right' : 'bottom';
|
47787 |
+
var opSide = isVertical ? 'left' : 'top';
|
47788 |
+
var measurement = isVertical ? 'width' : 'height';
|
47789 |
+
|
47790 |
+
if (popper[side] < floor(reference[opSide])) {
|
47791 |
+
data.offsets.popper[opSide] = floor(reference[opSide]) - popper[measurement];
|
47792 |
}
|
47793 |
+
if (popper[opSide] > floor(reference[side])) {
|
47794 |
+
data.offsets.popper[opSide] = floor(reference[side]);
|
|
|
47795 |
}
|
47796 |
+
|
47797 |
+
return data;
|
47798 |
}
|
47799 |
|
47800 |
/**
|
47801 |
+
* Converts a string containing value + unit into a px value number
|
47802 |
+
* @function
|
47803 |
+
* @memberof {modifiers~offset}
|
47804 |
+
* @private
|
47805 |
+
* @argument {String} str - Value + unit string
|
47806 |
+
* @argument {String} measurement - `height` or `width`
|
47807 |
+
* @argument {Object} popperOffsets
|
47808 |
+
* @argument {Object} referenceOffsets
|
47809 |
+
* @returns {Number|String}
|
47810 |
+
* Value in pixels, or original string if no values were extracted
|
47811 |
*/
|
47812 |
+
function toValue(str, measurement, popperOffsets, referenceOffsets) {
|
47813 |
+
// separate value from unit
|
47814 |
+
var split = str.match(/((?:\-|\+)?\d*\.?\d*)(.*)/);
|
47815 |
+
var value = +split[1];
|
47816 |
+
var unit = split[2];
|
47817 |
|
47818 |
+
// If it's not a number it's an operator, I guess
|
47819 |
+
if (!value) {
|
47820 |
+
return str;
|
|
|
47821 |
}
|
47822 |
+
|
47823 |
+
if (unit.indexOf('%') === 0) {
|
47824 |
+
var element = void 0;
|
47825 |
+
switch (unit) {
|
47826 |
+
case '%p':
|
47827 |
+
element = popperOffsets;
|
47828 |
+
break;
|
47829 |
+
case '%':
|
47830 |
+
case '%r':
|
47831 |
+
default:
|
47832 |
+
element = referenceOffsets;
|
47833 |
+
}
|
47834 |
+
|
47835 |
+
var rect = getClientRect(element);
|
47836 |
+
return rect[measurement] / 100 * value;
|
47837 |
+
} else if (unit === 'vh' || unit === 'vw') {
|
47838 |
+
// if is a vh or vw, we calculate the size based on the viewport
|
47839 |
+
var size = void 0;
|
47840 |
+
if (unit === 'vh') {
|
47841 |
+
size = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
|
47842 |
+
} else {
|
47843 |
+
size = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
|
47844 |
+
}
|
47845 |
+
return size / 100 * value;
|
47846 |
+
} else {
|
47847 |
+
// if is an explicit pixel unit, we get rid of the unit and keep the value
|
47848 |
+
// if is an implicit unit, it's px, and we return just the value
|
47849 |
+
return value;
|
47850 |
}
|
|
|
47851 |
}
|
47852 |
|
47853 |
/**
|
47854 |
+
* Parse an `offset` string to extrapolate `x` and `y` numeric offsets.
|
47855 |
+
* @function
|
47856 |
+
* @memberof {modifiers~offset}
|
47857 |
+
* @private
|
47858 |
+
* @argument {String} offset
|
47859 |
+
* @argument {Object} popperOffsets
|
47860 |
+
* @argument {Object} referenceOffsets
|
47861 |
+
* @argument {String} basePlacement
|
47862 |
+
* @returns {Array} a two cells array with x and y offsets in numbers
|
47863 |
*/
|
47864 |
+
function parseOffset(offset, popperOffsets, referenceOffsets, basePlacement) {
|
47865 |
+
var offsets = [0, 0];
|
|
|
|
|
|
|
|
|
|
|
47866 |
|
47867 |
+
// Use height if placement is left or right and index is 0 otherwise use width
|
47868 |
+
// in this way the first offset will use an axis and the second one
|
47869 |
+
// will use the other one
|
47870 |
+
var useHeight = ['right', 'left'].indexOf(basePlacement) !== -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47871 |
|
47872 |
+
// Split the offset string to obtain a list of values and operands
|
47873 |
+
// The regex addresses values with the plus or minus sign in front (+10, -20, etc)
|
47874 |
+
var fragments = offset.split(/(\+|\-)/).map(function (frag) {
|
47875 |
+
return frag.trim();
|
47876 |
+
});
|
47877 |
|
47878 |
+
// Detect if the offset string contains a pair of values or a single one
|
47879 |
+
// they could be separated by comma or space
|
47880 |
+
var divider = fragments.indexOf(popper_find(fragments, function (frag) {
|
47881 |
+
return frag.search(/,|\s/) !== -1;
|
47882 |
+
}));
|
47883 |
|
47884 |
+
if (fragments[divider] && fragments[divider].indexOf(',') === -1) {
|
47885 |
+
console.warn('Offsets separated by white space(s) are deprecated, use a comma (,) instead.');
|
|
|
|
|
|
|
|
|
|
|
|
|
47886 |
}
|
47887 |
|
47888 |
+
// If divider is found, we divide the list of values and operands to divide
|
47889 |
+
// them by ofset X and Y.
|
47890 |
+
var splitRegex = /\s*,\s*|\s+/;
|
47891 |
+
var ops = divider !== -1 ? [fragments.slice(0, divider).concat([fragments[divider].split(splitRegex)[0]]), [fragments[divider].split(splitRegex)[1]].concat(fragments.slice(divider + 1))] : [fragments];
|
|
|
|
|
|
|
|
|
|
|
|
|
47892 |
|
47893 |
+
// Convert the values with units to absolute pixels to allow our computations
|
47894 |
+
ops = ops.map(function (op, index) {
|
47895 |
+
// Most of the units rely on the orientation of the popper
|
47896 |
+
var measurement = (index === 1 ? !useHeight : useHeight) ? 'height' : 'width';
|
47897 |
+
var mergeWithPrevious = false;
|
47898 |
+
return op
|
47899 |
+
// This aggregates any `+` or `-` sign that aren't considered operators
|
47900 |
+
// e.g.: 10 + +5 => [10, +, +5]
|
47901 |
+
.reduce(function (a, b) {
|
47902 |
+
if (a[a.length - 1] === '' && ['+', '-'].indexOf(b) !== -1) {
|
47903 |
+
a[a.length - 1] = b;
|
47904 |
+
mergeWithPrevious = true;
|
47905 |
+
return a;
|
47906 |
+
} else if (mergeWithPrevious) {
|
47907 |
+
a[a.length - 1] += b;
|
47908 |
+
mergeWithPrevious = false;
|
47909 |
+
return a;
|
47910 |
+
} else {
|
47911 |
+
return a.concat(b);
|
47912 |
+
}
|
47913 |
+
}, [])
|
47914 |
+
// Here we convert the string values into number values (in px)
|
47915 |
+
.map(function (str) {
|
47916 |
+
return toValue(str, measurement, popperOffsets, referenceOffsets);
|
47917 |
+
});
|
47918 |
+
});
|
47919 |
|
47920 |
+
// Loop trough the offsets arrays and execute the operations
|
47921 |
+
ops.forEach(function (op, index) {
|
47922 |
+
op.forEach(function (frag, index2) {
|
47923 |
+
if (isNumeric(frag)) {
|
47924 |
+
offsets[index] += frag * (op[index2 - 1] === '-' ? -1 : 1);
|
47925 |
+
}
|
47926 |
+
});
|
47927 |
+
});
|
47928 |
+
return offsets;
|
47929 |
}
|
47930 |
|
47931 |
/**
|
47932 |
+
* @function
|
47933 |
+
* @memberof Modifiers
|
|
|
|
|
47934 |
* @argument {Object} data - The data object generated by update method
|
47935 |
* @argument {Object} options - Modifiers configuration and options
|
47936 |
+
* @argument {Number|String} options.offset=0
|
47937 |
+
* The offset value as described in the modifier description
|
47938 |
+
* @returns {Object} The data object, properly modified
|
47939 |
+
*/
|
47940 |
+
function popper_offset(data, _ref) {
|
47941 |
+
var offset = _ref.offset;
|
47942 |
+
var placement = data.placement,
|
47943 |
+
_data$offsets = data.offsets,
|
47944 |
+
popper = _data$offsets.popper,
|
47945 |
+
reference = _data$offsets.reference;
|
47946 |
+
|
47947 |
+
var basePlacement = placement.split('-')[0];
|
47948 |
+
|
47949 |
+
var offsets = void 0;
|
47950 |
+
if (isNumeric(+offset)) {
|
47951 |
+
offsets = [+offset, 0];
|
47952 |
+
} else {
|
47953 |
+
offsets = parseOffset(offset, popper, reference, basePlacement);
|
47954 |
+
}
|
47955 |
+
|
47956 |
+
if (basePlacement === 'left') {
|
47957 |
+
popper.top += offsets[0];
|
47958 |
+
popper.left -= offsets[1];
|
47959 |
+
} else if (basePlacement === 'right') {
|
47960 |
+
popper.top += offsets[0];
|
47961 |
+
popper.left += offsets[1];
|
47962 |
+
} else if (basePlacement === 'top') {
|
47963 |
+
popper.left += offsets[0];
|
47964 |
+
popper.top -= offsets[1];
|
47965 |
+
} else if (basePlacement === 'bottom') {
|
47966 |
+
popper.left += offsets[0];
|
47967 |
+
popper.top += offsets[1];
|
47968 |
+
}
|
47969 |
+
|
47970 |
+
data.popper = popper;
|
47971 |
+
return data;
|
47972 |
+
}
|
47973 |
+
|
47974 |
+
/**
|
47975 |
+
* @function
|
47976 |
+
* @memberof Modifiers
|
47977 |
+
* @argument {Object} data - The data object generated by `update` method
|
47978 |
+
* @argument {Object} options - Modifiers configuration and options
|
47979 |
* @returns {Object} The data object, properly modified
|
47980 |
*/
|
47981 |
+
function popper_preventOverflow(data, options) {
|
47982 |
+
var boundariesElement = options.boundariesElement || popper_getOffsetParent(data.instance.popper);
|
47983 |
|
47984 |
+
// If offsetParent is the reference element, we really want to
|
47985 |
+
// go one step up and use the next offsetParent as reference to
|
47986 |
+
// avoid to make this modifier completely useless and look like broken
|
47987 |
+
if (data.instance.reference === boundariesElement) {
|
47988 |
+
boundariesElement = popper_getOffsetParent(boundariesElement);
|
47989 |
}
|
47990 |
|
47991 |
+
// NOTE: DOM access here
|
47992 |
+
// resets the popper's position so that the document size can be calculated excluding
|
47993 |
+
// the size of the popper element itself
|
47994 |
+
var transformProp = getSupportedPropertyName('transform');
|
47995 |
+
var popperStyles = data.instance.popper.style; // assignment to help minification
|
47996 |
+
var top = popperStyles.top,
|
47997 |
+
left = popperStyles.left,
|
47998 |
+
transform = popperStyles[transformProp];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
47999 |
|
48000 |
+
popperStyles.top = '';
|
48001 |
+
popperStyles.left = '';
|
48002 |
+
popperStyles[transformProp] = '';
|
48003 |
|
48004 |
+
var boundaries = getBoundaries(data.instance.popper, data.instance.reference, options.padding, boundariesElement, data.positionFixed);
|
48005 |
|
48006 |
+
// NOTE: DOM access here
|
48007 |
+
// restores the original style properties after the offsets have been computed
|
48008 |
+
popperStyles.top = top;
|
48009 |
+
popperStyles.left = left;
|
48010 |
+
popperStyles[transformProp] = transform;
|
48011 |
|
48012 |
+
options.boundaries = boundaries;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48013 |
|
48014 |
+
var order = options.priority;
|
48015 |
+
var popper = data.offsets.popper;
|
|
|
48016 |
|
48017 |
+
var check = {
|
48018 |
+
primary: function primary(placement) {
|
48019 |
+
var value = popper[placement];
|
48020 |
+
if (popper[placement] < boundaries[placement] && !options.escapeWithReference) {
|
48021 |
+
value = Math.max(popper[placement], boundaries[placement]);
|
48022 |
+
}
|
48023 |
+
return popper_defineProperty({}, placement, value);
|
48024 |
+
},
|
48025 |
+
secondary: function secondary(placement) {
|
48026 |
+
var mainSide = placement === 'right' ? 'left' : 'top';
|
48027 |
+
var value = popper[mainSide];
|
48028 |
+
if (popper[placement] > boundaries[placement] && !options.escapeWithReference) {
|
48029 |
+
value = Math.min(popper[mainSide], boundaries[placement] - (placement === 'right' ? popper.width : popper.height));
|
48030 |
+
}
|
48031 |
+
return popper_defineProperty({}, mainSide, value);
|
48032 |
+
}
|
48033 |
};
|
|
|
|
|
48034 |
|
48035 |
+
order.forEach(function (placement) {
|
48036 |
+
var side = ['left', 'top'].indexOf(placement) !== -1 ? 'primary' : 'secondary';
|
48037 |
+
popper = popper_extends({}, popper, check[side](placement));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48038 |
});
|
48039 |
+
|
48040 |
+
data.offsets.popper = popper;
|
48041 |
+
|
48042 |
+
return data;
|
48043 |
}
|
48044 |
|
48045 |
/**
|
48046 |
+
* @function
|
48047 |
+
* @memberof Modifiers
|
48048 |
+
* @argument {Object} data - The data object generated by `update` method
|
48049 |
+
* @argument {Object} options - Modifiers configuration and options
|
48050 |
+
* @returns {Object} The data object, properly modified
|
|
|
|
|
|
|
48051 |
*/
|
48052 |
+
function popper_shift(data) {
|
48053 |
+
var placement = data.placement;
|
48054 |
+
var basePlacement = placement.split('-')[0];
|
48055 |
+
var shiftvariation = placement.split('-')[1];
|
48056 |
|
48057 |
+
// if shift shiftvariation is specified, run the modifier
|
48058 |
+
if (shiftvariation) {
|
48059 |
+
var _data$offsets = data.offsets,
|
48060 |
+
reference = _data$offsets.reference,
|
48061 |
+
popper = _data$offsets.popper;
|
48062 |
|
48063 |
+
var isVertical = ['bottom', 'top'].indexOf(basePlacement) !== -1;
|
48064 |
+
var side = isVertical ? 'left' : 'top';
|
48065 |
+
var measurement = isVertical ? 'width' : 'height';
|
|
|
|
|
48066 |
|
48067 |
+
var shiftOffsets = {
|
48068 |
+
start: popper_defineProperty({}, side, reference[side]),
|
48069 |
+
end: popper_defineProperty({}, side, reference[side] + reference[measurement] - popper[measurement])
|
48070 |
+
};
|
|
|
|
|
48071 |
|
48072 |
+
data.offsets.popper = popper_extends({}, popper, shiftOffsets[shiftvariation]);
|
|
|
|
|
|
|
|
|
48073 |
}
|
48074 |
|
48075 |
+
return data;
|
48076 |
}
|
48077 |
|
48078 |
/**
|
48079 |
+
* @function
|
48080 |
+
* @memberof Modifiers
|
48081 |
+
* @argument {Object} data - The data object generated by update method
|
48082 |
+
* @argument {Object} options - Modifiers configuration and options
|
48083 |
+
* @returns {Object} The data object, properly modified
|
|
|
|
|
48084 |
*/
|
48085 |
+
function popper_hide(data) {
|
48086 |
+
if (!isModifierRequired(data.instance.modifiers, 'hide', 'preventOverflow')) {
|
48087 |
+
return data;
|
|
|
48088 |
}
|
48089 |
|
48090 |
+
var refRect = data.offsets.reference;
|
48091 |
+
var bound = popper_find(data.instance.modifiers, function (modifier) {
|
48092 |
+
return modifier.name === 'preventOverflow';
|
48093 |
+
}).boundaries;
|
48094 |
|
48095 |
+
if (refRect.bottom < bound.top || refRect.left > bound.right || refRect.top > bound.bottom || refRect.right < bound.left) {
|
48096 |
+
// Avoid unnecessary DOM access if visibility hasn't changed
|
48097 |
+
if (data.hide === true) {
|
48098 |
+
return data;
|
48099 |
+
}
|
48100 |
+
|
48101 |
+
data.hide = true;
|
48102 |
+
data.attributes['x-out-of-boundaries'] = '';
|
48103 |
+
} else {
|
48104 |
+
// Avoid unnecessary DOM access if visibility hasn't changed
|
48105 |
+
if (data.hide === false) {
|
48106 |
+
return data;
|
48107 |
+
}
|
48108 |
+
|
48109 |
+
data.hide = false;
|
48110 |
+
data.attributes['x-out-of-boundaries'] = false;
|
48111 |
}
|
48112 |
|
48113 |
+
return data;
|
|
|
|
|
|
|
|
|
48114 |
}
|
48115 |
|
48116 |
/**
|
48117 |
+
* @function
|
48118 |
+
* @memberof Modifiers
|
48119 |
+
* @argument {Object} data - The data object generated by `update` method
|
48120 |
+
* @argument {Object} options - Modifiers configuration and options
|
48121 |
+
* @returns {Object} The data object, properly modified
|
|
|
|
|
|
|
48122 |
*/
|
48123 |
+
function inner(data) {
|
48124 |
+
var placement = data.placement;
|
48125 |
+
var basePlacement = placement.split('-')[0];
|
48126 |
+
var _data$offsets = data.offsets,
|
48127 |
+
popper = _data$offsets.popper,
|
48128 |
+
reference = _data$offsets.reference;
|
48129 |
|
48130 |
+
var isHoriz = ['left', 'right'].indexOf(basePlacement) !== -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48131 |
|
48132 |
+
var subtractLength = ['top', 'left'].indexOf(basePlacement) === -1;
|
48133 |
+
|
48134 |
+
popper[isHoriz ? 'left' : 'top'] = reference[basePlacement] - (subtractLength ? popper[isHoriz ? 'width' : 'height'] : 0);
|
48135 |
+
|
48136 |
+
data.placement = popper_getOppositePlacement(placement);
|
48137 |
+
data.offsets.popper = getClientRect(popper);
|
48138 |
|
48139 |
return data;
|
48140 |
}
|
48141 |
|
48142 |
/**
|
48143 |
+
* Modifier function, each modifier can have a function of this type assigned
|
48144 |
+
* to its `fn` property.<br />
|
48145 |
+
* These functions will be called on each update, this means that you must
|
48146 |
+
* make sure they are performant enough to avoid performance bottlenecks.
|
48147 |
+
*
|
48148 |
+
* @function ModifierFn
|
48149 |
+
* @argument {dataObject} data - The data object generated by `update` method
|
48150 |
+
* @argument {Object} options - Modifiers configuration and options
|
48151 |
+
* @returns {dataObject} The data object, properly modified
|
48152 |
*/
|
|
|
|
|
|
|
|
|
|
|
48153 |
|
48154 |
+
/**
|
48155 |
+
* Modifiers are plugins used to alter the behavior of your poppers.<br />
|
48156 |
+
* Popper.js uses a set of 9 modifiers to provide all the basic functionalities
|
48157 |
+
* needed by the library.
|
48158 |
+
*
|
48159 |
+
* Usually you don't want to override the `order`, `fn` and `onLoad` props.
|
48160 |
+
* All the other properties are configurations that could be tweaked.
|
48161 |
+
* @namespace modifiers
|
48162 |
+
*/
|
48163 |
+
var modifiers = {
|
48164 |
+
/**
|
48165 |
+
* Modifier used to shift the popper on the start or end of its reference
|
48166 |
+
* element.<br />
|
48167 |
+
* It will read the variation of the `placement` property.<br />
|
48168 |
+
* It can be one either `-end` or `-start`.
|
48169 |
+
* @memberof modifiers
|
48170 |
+
* @inner
|
48171 |
+
*/
|
48172 |
+
shift: {
|
48173 |
+
/** @prop {number} order=100 - Index used to define the order of execution */
|
48174 |
+
order: 100,
|
48175 |
+
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
48176 |
+
enabled: true,
|
48177 |
+
/** @prop {ModifierFn} */
|
48178 |
+
fn: popper_shift
|
48179 |
+
},
|
48180 |
|
48181 |
+
/**
|
48182 |
+
* The `offset` modifier can shift your popper on both its axis.
|
48183 |
+
*
|
48184 |
+
* It accepts the following units:
|
48185 |
+
* - `px` or unit-less, interpreted as pixels
|
48186 |
+
* - `%` or `%r`, percentage relative to the length of the reference element
|
48187 |
+
* - `%p`, percentage relative to the length of the popper element
|
48188 |
+
* - `vw`, CSS viewport width unit
|
48189 |
+
* - `vh`, CSS viewport height unit
|
48190 |
+
*
|
48191 |
+
* For length is intended the main axis relative to the placement of the popper.<br />
|
48192 |
+
* This means that if the placement is `top` or `bottom`, the length will be the
|
48193 |
+
* `width`. In case of `left` or `right`, it will be the `height`.
|
48194 |
+
*
|
48195 |
+
* You can provide a single value (as `Number` or `String`), or a pair of values
|
48196 |
+
* as `String` divided by a comma or one (or more) white spaces.<br />
|
48197 |
+
* The latter is a deprecated method because it leads to confusion and will be
|
48198 |
+
* removed in v2.<br />
|
48199 |
+
* Additionally, it accepts additions and subtractions between different units.
|
48200 |
+
* Note that multiplications and divisions aren't supported.
|
48201 |
+
*
|
48202 |
+
* Valid examples are:
|
48203 |
+
* ```
|
48204 |
+
* 10
|
48205 |
+
* '10%'
|
48206 |
+
* '10, 10'
|
48207 |
+
* '10%, 10'
|
48208 |
+
* '10 + 10%'
|
48209 |
+
* '10 - 5vh + 3%'
|
48210 |
+
* '-10px + 5vh, 5px - 6%'
|
48211 |
+
* ```
|
48212 |
+
* > **NB**: If you desire to apply offsets to your poppers in a way that may make them overlap
|
48213 |
+
* > with their reference element, unfortunately, you will have to disable the `flip` modifier.
|
48214 |
+
* > You can read more on this at this [issue](https://github.com/FezVrasta/popper.js/issues/373).
|
48215 |
+
*
|
48216 |
+
* @memberof modifiers
|
48217 |
+
* @inner
|
48218 |
+
*/
|
48219 |
+
offset: {
|
48220 |
+
/** @prop {number} order=200 - Index used to define the order of execution */
|
48221 |
+
order: 200,
|
48222 |
+
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
48223 |
+
enabled: true,
|
48224 |
+
/** @prop {ModifierFn} */
|
48225 |
+
fn: popper_offset,
|
48226 |
+
/** @prop {Number|String} offset=0
|
48227 |
+
* The offset value as described in the modifier description
|
48228 |
+
*/
|
48229 |
+
offset: 0
|
48230 |
+
},
|
48231 |
|
48232 |
+
/**
|
48233 |
+
* Modifier used to prevent the popper from being positioned outside the boundary.
|
48234 |
+
*
|
48235 |
+
* A scenario exists where the reference itself is not within the boundaries.<br />
|
48236 |
+
* We can say it has "escaped the boundaries" — or just "escaped".<br />
|
48237 |
+
* In this case we need to decide whether the popper should either:
|
48238 |
+
*
|
48239 |
+
* - detach from the reference and remain "trapped" in the boundaries, or
|
48240 |
+
* - if it should ignore the boundary and "escape with its reference"
|
48241 |
+
*
|
48242 |
+
* When `escapeWithReference` is set to`true` and reference is completely
|
48243 |
+
* outside its boundaries, the popper will overflow (or completely leave)
|
48244 |
+
* the boundaries in order to remain attached to the edge of the reference.
|
48245 |
+
*
|
48246 |
+
* @memberof modifiers
|
48247 |
+
* @inner
|
48248 |
+
*/
|
48249 |
+
preventOverflow: {
|
48250 |
+
/** @prop {number} order=300 - Index used to define the order of execution */
|
48251 |
+
order: 300,
|
48252 |
+
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
48253 |
+
enabled: true,
|
48254 |
+
/** @prop {ModifierFn} */
|
48255 |
+
fn: popper_preventOverflow,
|
48256 |
+
/**
|
48257 |
+
* @prop {Array} [priority=['left','right','top','bottom']]
|
48258 |
+
* Popper will try to prevent overflow following these priorities by default,
|
48259 |
+
* then, it could overflow on the left and on top of the `boundariesElement`
|
48260 |
+
*/
|
48261 |
+
priority: ['left', 'right', 'top', 'bottom'],
|
48262 |
+
/**
|
48263 |
+
* @prop {number} padding=5
|
48264 |
+
* Amount of pixel used to define a minimum distance between the boundaries
|
48265 |
+
* and the popper. This makes sure the popper always has a little padding
|
48266 |
+
* between the edges of its container
|
48267 |
+
*/
|
48268 |
+
padding: 5,
|
48269 |
+
/**
|
48270 |
+
* @prop {String|HTMLElement} boundariesElement='scrollParent'
|
48271 |
+
* Boundaries used by the modifier. Can be `scrollParent`, `window`,
|
48272 |
+
* `viewport` or any DOM element.
|
48273 |
+
*/
|
48274 |
+
boundariesElement: 'scrollParent'
|
48275 |
+
},
|
48276 |
|
48277 |
+
/**
|
48278 |
+
* Modifier used to make sure the reference and its popper stay near each other
|
48279 |
+
* without leaving any gap between the two. Especially useful when the arrow is
|
48280 |
+
* enabled and you want to ensure that it points to its reference element.
|
48281 |
+
* It cares only about the first axis. You can still have poppers with margin
|
48282 |
+
* between the popper and its reference element.
|
48283 |
+
* @memberof modifiers
|
48284 |
+
* @inner
|
48285 |
+
*/
|
48286 |
+
keepTogether: {
|
48287 |
+
/** @prop {number} order=400 - Index used to define the order of execution */
|
48288 |
+
order: 400,
|
48289 |
+
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
48290 |
+
enabled: true,
|
48291 |
+
/** @prop {ModifierFn} */
|
48292 |
+
fn: keepTogether
|
48293 |
+
},
|
48294 |
|
48295 |
+
/**
|
48296 |
+
* This modifier is used to move the `arrowElement` of the popper to make
|
48297 |
+
* sure it is positioned between the reference element and its popper element.
|
48298 |
+
* It will read the outer size of the `arrowElement` node to detect how many
|
48299 |
+
* pixels of conjunction are needed.
|
48300 |
+
*
|
48301 |
+
* It has no effect if no `arrowElement` is provided.
|
48302 |
+
* @memberof modifiers
|
48303 |
+
* @inner
|
48304 |
+
*/
|
48305 |
+
arrow: {
|
48306 |
+
/** @prop {number} order=500 - Index used to define the order of execution */
|
48307 |
+
order: 500,
|
48308 |
+
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
48309 |
+
enabled: true,
|
48310 |
+
/** @prop {ModifierFn} */
|
48311 |
+
fn: popper_arrow,
|
48312 |
+
/** @prop {String|HTMLElement} element='[x-arrow]' - Selector or node used as arrow */
|
48313 |
+
element: '[x-arrow]'
|
48314 |
+
},
|
48315 |
+
|
48316 |
+
/**
|
48317 |
+
* Modifier used to flip the popper's placement when it starts to overlap its
|
48318 |
+
* reference element.
|
48319 |
+
*
|
48320 |
+
* Requires the `preventOverflow` modifier before it in order to work.
|
48321 |
+
*
|
48322 |
+
* **NOTE:** this modifier will interrupt the current update cycle and will
|
48323 |
+
* restart it if it detects the need to flip the placement.
|
48324 |
+
* @memberof modifiers
|
48325 |
+
* @inner
|
48326 |
+
*/
|
48327 |
+
flip: {
|
48328 |
+
/** @prop {number} order=600 - Index used to define the order of execution */
|
48329 |
+
order: 600,
|
48330 |
+
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
48331 |
+
enabled: true,
|
48332 |
+
/** @prop {ModifierFn} */
|
48333 |
+
fn: popper_flip,
|
48334 |
+
/**
|
48335 |
+
* @prop {String|Array} behavior='flip'
|
48336 |
+
* The behavior used to change the popper's placement. It can be one of
|
48337 |
+
* `flip`, `clockwise`, `counterclockwise` or an array with a list of valid
|
48338 |
+
* placements (with optional variations)
|
48339 |
+
*/
|
48340 |
+
behavior: 'flip',
|
48341 |
+
/**
|
48342 |
+
* @prop {number} padding=5
|
48343 |
+
* The popper will flip if it hits the edges of the `boundariesElement`
|
48344 |
+
*/
|
48345 |
+
padding: 5,
|
48346 |
+
/**
|
48347 |
+
* @prop {String|HTMLElement} boundariesElement='viewport'
|
48348 |
+
* The element which will define the boundaries of the popper position.
|
48349 |
+
* The popper will never be placed outside of the defined boundaries
|
48350 |
+
* (except if `keepTogether` is enabled)
|
48351 |
+
*/
|
48352 |
+
boundariesElement: 'viewport',
|
48353 |
+
/**
|
48354 |
+
* @prop {Boolean} flipVariations=false
|
48355 |
+
* The popper will switch placement variation between `-start` and `-end` when
|
48356 |
+
* the reference element overlaps its boundaries.
|
48357 |
+
*
|
48358 |
+
* The original placement should have a set variation.
|
48359 |
+
*/
|
48360 |
+
flipVariations: false,
|
48361 |
+
/**
|
48362 |
+
* @prop {Boolean} flipVariationsByContent=false
|
48363 |
+
* The popper will switch placement variation between `-start` and `-end` when
|
48364 |
+
* the popper element overlaps its reference boundaries.
|
48365 |
+
*
|
48366 |
+
* The original placement should have a set variation.
|
48367 |
+
*/
|
48368 |
+
flipVariationsByContent: false
|
48369 |
+
},
|
48370 |
|
48371 |
+
/**
|
48372 |
+
* Modifier used to make the popper flow toward the inner of the reference element.
|
48373 |
+
* By default, when this modifier is disabled, the popper will be placed outside
|
48374 |
+
* the reference element.
|
48375 |
+
* @memberof modifiers
|
48376 |
+
* @inner
|
48377 |
+
*/
|
48378 |
+
inner: {
|
48379 |
+
/** @prop {number} order=700 - Index used to define the order of execution */
|
48380 |
+
order: 700,
|
48381 |
+
/** @prop {Boolean} enabled=false - Whether the modifier is enabled or not */
|
48382 |
+
enabled: false,
|
48383 |
+
/** @prop {ModifierFn} */
|
48384 |
+
fn: inner
|
48385 |
+
},
|
48386 |
|
48387 |
+
/**
|
48388 |
+
* Modifier used to hide the popper when its reference element is outside of the
|
48389 |
+
* popper boundaries. It will set a `x-out-of-boundaries` attribute which can
|
48390 |
+
* be used to hide with a CSS selector the popper when its reference is
|
48391 |
+
* out of boundaries.
|
48392 |
+
*
|
48393 |
+
* Requires the `preventOverflow` modifier before it in order to work.
|
48394 |
+
* @memberof modifiers
|
48395 |
+
* @inner
|
48396 |
+
*/
|
48397 |
+
hide: {
|
48398 |
+
/** @prop {number} order=800 - Index used to define the order of execution */
|
48399 |
+
order: 800,
|
48400 |
+
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
48401 |
+
enabled: true,
|
48402 |
+
/** @prop {ModifierFn} */
|
48403 |
+
fn: popper_hide
|
48404 |
+
},
|
48405 |
|
48406 |
+
/**
|
48407 |
+
* Computes the style that will be applied to the popper element to gets
|
48408 |
+
* properly positioned.
|
48409 |
+
*
|
48410 |
+
* Note that this modifier will not touch the DOM, it just prepares the styles
|
48411 |
+
* so that `applyStyle` modifier can apply it. This separation is useful
|
48412 |
+
* in case you need to replace `applyStyle` with a custom implementation.
|
48413 |
+
*
|
48414 |
+
* This modifier has `850` as `order` value to maintain backward compatibility
|
48415 |
+
* with previous versions of Popper.js. Expect the modifiers ordering method
|
48416 |
+
* to change in future major versions of the library.
|
48417 |
+
*
|
48418 |
+
* @memberof modifiers
|
48419 |
+
* @inner
|
48420 |
+
*/
|
48421 |
+
computeStyle: {
|
48422 |
+
/** @prop {number} order=850 - Index used to define the order of execution */
|
48423 |
+
order: 850,
|
48424 |
+
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
48425 |
+
enabled: true,
|
48426 |
+
/** @prop {ModifierFn} */
|
48427 |
+
fn: computeStyle,
|
48428 |
+
/**
|
48429 |
+
* @prop {Boolean} gpuAcceleration=true
|
48430 |
+
* If true, it uses the CSS 3D transformation to position the popper.
|
48431 |
+
* Otherwise, it will use the `top` and `left` properties
|
48432 |
+
*/
|
48433 |
+
gpuAcceleration: true,
|
48434 |
+
/**
|
48435 |
+
* @prop {string} [x='bottom']
|
48436 |
+
* Where to anchor the X axis (`bottom` or `top`). AKA X offset origin.
|
48437 |
+
* Change this if your popper should grow in a direction different from `bottom`
|
48438 |
+
*/
|
48439 |
+
x: 'bottom',
|
48440 |
+
/**
|
48441 |
+
* @prop {string} [x='left']
|
48442 |
+
* Where to anchor the Y axis (`left` or `right`). AKA Y offset origin.
|
48443 |
+
* Change this if your popper should grow in a direction different from `right`
|
48444 |
+
*/
|
48445 |
+
y: 'right'
|
48446 |
+
},
|
48447 |
|
48448 |
+
/**
|
48449 |
+
* Applies the computed styles to the popper element.
|
48450 |
+
*
|
48451 |
+
* All the DOM manipulations are limited to this modifier. This is useful in case
|
48452 |
+
* you want to integrate Popper.js inside a framework or view library and you
|
48453 |
+
* want to delegate all the DOM manipulations to it.
|
48454 |
+
*
|
48455 |
+
* Note that if you disable this modifier, you must make sure the popper element
|
48456 |
+
* has its position set to `absolute` before Popper.js can do its work!
|
48457 |
+
*
|
48458 |
+
* Just disable this modifier and define your own to achieve the desired effect.
|
48459 |
+
*
|
48460 |
+
* @memberof modifiers
|
48461 |
+
* @inner
|
48462 |
+
*/
|
48463 |
+
applyStyle: {
|
48464 |
+
/** @prop {number} order=900 - Index used to define the order of execution */
|
48465 |
+
order: 900,
|
48466 |
+
/** @prop {Boolean} enabled=true - Whether the modifier is enabled or not */
|
48467 |
+
enabled: true,
|
48468 |
+
/** @prop {ModifierFn} */
|
48469 |
+
fn: applyStyle,
|
48470 |
+
/** @prop {Function} */
|
48471 |
+
onLoad: applyStyleOnLoad,
|
48472 |
+
/**
|
48473 |
+
* @deprecated since version 1.10.0, the property moved to `computeStyle` modifier
|
48474 |
+
* @prop {Boolean} gpuAcceleration=true
|
48475 |
+
* If true, it uses the CSS 3D transformation to position the popper.
|
48476 |
+
* Otherwise, it will use the `top` and `left` properties
|
48477 |
+
*/
|
48478 |
+
gpuAcceleration: undefined
|
48479 |
}
|
48480 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48481 |
|
48482 |
/**
|
48483 |
+
* The `dataObject` is an object containing all the information used by Popper.js.
|
48484 |
+
* This object is passed to modifiers and to the `onCreate` and `onUpdate` callbacks.
|
48485 |
+
* @name dataObject
|
48486 |
+
* @property {Object} data.instance The Popper.js instance
|
48487 |
+
* @property {String} data.placement Placement applied to popper
|
48488 |
+
* @property {String} data.originalPlacement Placement originally defined on init
|
48489 |
+
* @property {Boolean} data.flipped True if popper has been flipped by flip modifier
|
48490 |
+
* @property {Boolean} data.hide True if the reference element is out of boundaries, useful to know when to hide the popper
|
48491 |
+
* @property {HTMLElement} data.arrowElement Node used as arrow by arrow modifier
|
48492 |
+
* @property {Object} data.styles Any CSS property defined here will be applied to the popper. It expects the JavaScript nomenclature (eg. `marginBottom`)
|
48493 |
+
* @property {Object} data.arrowStyles Any CSS property defined here will be applied to the popper arrow. It expects the JavaScript nomenclature (eg. `marginBottom`)
|
48494 |
+
* @property {Object} data.boundaries Offsets of the popper boundaries
|
48495 |
+
* @property {Object} data.offsets The measurements of popper, reference and arrow elements
|
48496 |
+
* @property {Object} data.offsets.popper `top`, `left`, `width`, `height` values
|
48497 |
+
* @property {Object} data.offsets.reference `top`, `left`, `width`, `height` values
|
48498 |
+
* @property {Object} data.offsets.arrow] `top` and `left` offsets, only one of them will be different from 0
|
48499 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48500 |
|
48501 |
/**
|
48502 |
+
* Default options provided to Popper.js constructor.<br />
|
48503 |
+
* These can be overridden using the `options` argument of Popper.js.<br />
|
48504 |
+
* To override an option, simply pass an object with the same
|
48505 |
+
* structure of the `options` object, as the 3rd argument. For example:
|
48506 |
+
* ```
|
48507 |
+
* new Popper(ref, pop, {
|
48508 |
+
* modifiers: {
|
48509 |
+
* preventOverflow: { enabled: false }
|
48510 |
+
* }
|
48511 |
+
* })
|
48512 |
+
* ```
|
48513 |
+
* @type {Object}
|
48514 |
+
* @static
|
48515 |
* @memberof Popper
|
48516 |
*/
|
48517 |
+
var Defaults = {
|
48518 |
+
/**
|
48519 |
+
* Popper's placement.
|
48520 |
+
* @prop {Popper.placements} placement='bottom'
|
48521 |
+
*/
|
48522 |
+
placement: 'bottom',
|
48523 |
|
48524 |
+
/**
|
48525 |
+
* Set this to true if you want popper to position it self in 'fixed' mode
|
48526 |
+
* @prop {Boolean} positionFixed=false
|
48527 |
+
*/
|
48528 |
+
positionFixed: false,
|
|
|
|
|
|
|
|
|
|
|
|
|
48529 |
|
48530 |
+
/**
|
48531 |
+
* Whether events (resize, scroll) are initially enabled.
|
48532 |
+
* @prop {Boolean} eventsEnabled=true
|
48533 |
+
*/
|
48534 |
+
eventsEnabled: true,
|
48535 |
|
48536 |
+
/**
|
48537 |
+
* Set to true if you want to automatically remove the popper when
|
48538 |
+
* you call the `destroy` method.
|
48539 |
+
* @prop {Boolean} removeOnDestroy=false
|
48540 |
+
*/
|
48541 |
+
removeOnDestroy: false,
|
|
|
48542 |
|
48543 |
+
/**
|
48544 |
+
* Callback called when the popper is created.<br />
|
48545 |
+
* By default, it is set to no-op.<br />
|
48546 |
+
* Access Popper.js instance with `data.instance`.
|
48547 |
+
* @prop {onCreate}
|
48548 |
+
*/
|
48549 |
+
onCreate: function onCreate() {},
|
|
|
|
|
48550 |
|
48551 |
+
/**
|
48552 |
+
* Callback called when the popper is updated. This callback is not called
|
48553 |
+
* on the initialization/creation of the popper, but only on subsequent
|
48554 |
+
* updates.<br />
|
48555 |
+
* By default, it is set to no-op.<br />
|
48556 |
+
* Access Popper.js instance with `data.instance`.
|
48557 |
+
* @prop {onUpdate}
|
48558 |
+
*/
|
48559 |
+
onUpdate: function onUpdate() {},
|
48560 |
|
48561 |
+
/**
|
48562 |
+
* List of modifiers used to modify the offsets before they are applied to the popper.
|
48563 |
+
* They provide most of the functionalities of Popper.js.
|
48564 |
+
* @prop {modifiers}
|
48565 |
+
*/
|
48566 |
+
modifiers: modifiers
|
48567 |
+
};
|
48568 |
|
48569 |
/**
|
48570 |
+
* @callback onCreate
|
48571 |
+
* @param {dataObject} data
|
|
|
|
|
48572 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48573 |
|
48574 |
/**
|
48575 |
+
* @callback onUpdate
|
48576 |
+
* @param {dataObject} data
|
|
|
|
|
48577 |
*/
|
|
|
|
|
|
|
|
|
|
|
48578 |
|
48579 |
+
// Utils
|
48580 |
+
// Methods
|
48581 |
+
var Popper = function () {
|
48582 |
+
/**
|
48583 |
+
* Creates a new Popper.js instance.
|
48584 |
+
* @class Popper
|
48585 |
+
* @param {Element|referenceObject} reference - The reference element used to position the popper
|
48586 |
+
* @param {Element} popper - The HTML / XML element used as the popper
|
48587 |
+
* @param {Object} options - Your custom options to override the ones defined in [Defaults](#defaults)
|
48588 |
+
* @return {Object} instance - The generated Popper.js instance
|
48589 |
+
*/
|
48590 |
+
function Popper(reference, popper) {
|
48591 |
+
var _this = this;
|
48592 |
|
48593 |
+
var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
48594 |
+
classCallCheck(this, Popper);
|
|
|
|
|
48595 |
|
48596 |
+
this.scheduleUpdate = function () {
|
48597 |
+
return requestAnimationFrame(_this.update);
|
48598 |
+
};
|
|
|
|
|
|
|
|
|
48599 |
|
48600 |
+
// make update() debounced, so that it only runs at most once-per-tick
|
48601 |
+
this.update = popper_debounce(this.update.bind(this));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48602 |
|
48603 |
+
// with {} we create a new object with the options inside it
|
48604 |
+
this.options = popper_extends({}, Popper.Defaults, options);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48605 |
|
48606 |
+
// init state
|
48607 |
+
this.state = {
|
48608 |
+
isDestroyed: false,
|
48609 |
+
isCreated: false,
|
48610 |
+
scrollParents: []
|
48611 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48612 |
|
48613 |
+
// get reference and popper elements (allow jQuery wrappers)
|
48614 |
+
this.reference = reference && reference.jquery ? reference[0] : reference;
|
48615 |
+
this.popper = popper && popper.jquery ? popper[0] : popper;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48616 |
|
48617 |
+
// Deep merge modifiers options
|
48618 |
+
this.options.modifiers = {};
|
48619 |
+
Object.keys(popper_extends({}, Popper.Defaults.modifiers, options.modifiers)).forEach(function (name) {
|
48620 |
+
_this.options.modifiers[name] = popper_extends({}, Popper.Defaults.modifiers[name] || {}, options.modifiers ? options.modifiers[name] : {});
|
48621 |
+
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48622 |
|
48623 |
+
// Refactoring modifiers' list (Object => Array)
|
48624 |
+
this.modifiers = Object.keys(this.options.modifiers).map(function (name) {
|
48625 |
+
return popper_extends({
|
48626 |
+
name: name
|
48627 |
+
}, _this.options.modifiers[name]);
|
48628 |
+
})
|
48629 |
+
// sort the modifiers by order
|
48630 |
+
.sort(function (a, b) {
|
48631 |
+
return a.order - b.order;
|
48632 |
+
});
|
48633 |
|
48634 |
+
// modifiers have the ability to execute arbitrary code when Popper.js get inited
|
48635 |
+
// such code is executed in the same order of its modifier
|
48636 |
+
// they could add new properties to their options configuration
|
48637 |
+
// BE AWARE: don't add options to `options.modifiers.name` but to `modifierOptions`!
|
48638 |
+
this.modifiers.forEach(function (modifierOptions) {
|
48639 |
+
if (modifierOptions.enabled && isFunction(modifierOptions.onLoad)) {
|
48640 |
+
modifierOptions.onLoad(_this.reference, _this.popper, _this.options, modifierOptions, _this.state);
|
48641 |
+
}
|
48642 |
+
});
|
48643 |
|
48644 |
+
// fire the first update to position the popper in the right place
|
48645 |
+
this.update();
|
48646 |
|
48647 |
+
var eventsEnabled = this.options.eventsEnabled;
|
48648 |
+
if (eventsEnabled) {
|
48649 |
+
// setup event listeners, they will take care of update the position in specific situations
|
48650 |
+
this.enableEventListeners();
|
48651 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48652 |
|
48653 |
+
this.state.eventsEnabled = eventsEnabled;
|
48654 |
+
}
|
|
|
|
|
48655 |
|
48656 |
+
// We can't use class properties because they don't get listed in the
|
48657 |
+
// class prototype and break stuff like Sinon stubs
|
48658 |
|
|
|
|
|
|
|
48659 |
|
48660 |
+
popper_createClass(Popper, [{
|
48661 |
+
key: 'update',
|
48662 |
+
value: function update$$1() {
|
48663 |
+
return popper_update.call(this);
|
48664 |
+
}
|
48665 |
+
}, {
|
48666 |
+
key: 'destroy',
|
48667 |
+
value: function destroy$$1() {
|
48668 |
+
return destroy.call(this);
|
48669 |
+
}
|
48670 |
+
}, {
|
48671 |
+
key: 'enableEventListeners',
|
48672 |
+
value: function enableEventListeners$$1() {
|
48673 |
+
return enableEventListeners.call(this);
|
48674 |
+
}
|
48675 |
+
}, {
|
48676 |
+
key: 'disableEventListeners',
|
48677 |
+
value: function disableEventListeners$$1() {
|
48678 |
+
return disableEventListeners.call(this);
|
48679 |
+
}
|
48680 |
+
|
48681 |
+
/**
|
48682 |
+
* Schedules an update. It will run on the next UI update available.
|
48683 |
+
* @method scheduleUpdate
|
48684 |
+
* @memberof Popper
|
48685 |
+
*/
|
48686 |
+
|
48687 |
+
|
48688 |
+
/**
|
48689 |
+
* Collection of utilities useful when writing custom modifiers.
|
48690 |
+
* Starting from version 1.7, this method is available only if you
|
48691 |
+
* include `popper-utils.js` before `popper.js`.
|
48692 |
+
*
|
48693 |
+
* **DEPRECATION**: This way to access PopperUtils is deprecated
|
48694 |
+
* and will be removed in v2! Use the PopperUtils module directly instead.
|
48695 |
+
* Due to the high instability of the methods contained in Utils, we can't
|
48696 |
+
* guarantee them to follow semver. Use them at your own risk!
|
48697 |
+
* @static
|
48698 |
+
* @private
|
48699 |
+
* @type {Object}
|
48700 |
+
* @deprecated since version 1.8
|
48701 |
+
* @member Utils
|
48702 |
+
* @memberof Popper
|
48703 |
+
*/
|
48704 |
+
|
48705 |
+
}]);
|
48706 |
+
return Popper;
|
48707 |
+
}();
|
48708 |
|
48709 |
/**
|
48710 |
+
* The `referenceObject` is an object that provides an interface compatible with Popper.js
|
48711 |
+
* and lets you use it as replacement of a real DOM node.<br />
|
48712 |
+
* You can use this method to position a popper relatively to a set of coordinates
|
48713 |
+
* in case you don't have a DOM node to use as reference.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48714 |
*
|
48715 |
+
* ```
|
48716 |
+
* new Popper(referenceObject, popperNode);
|
48717 |
+
* ```
|
48718 |
*
|
48719 |
+
* NB: This feature isn't supported in Internet Explorer 10.
|
48720 |
+
* @name referenceObject
|
48721 |
+
* @property {Function} data.getBoundingClientRect
|
48722 |
+
* A function that returns a set of coordinates compatible with the native `getBoundingClientRect` method.
|
48723 |
+
* @property {number} data.clientWidth
|
48724 |
+
* An ES6 getter that will return the width of the virtual reference element.
|
48725 |
+
* @property {number} data.clientHeight
|
48726 |
+
* An ES6 getter that will return the height of the virtual reference element.
|
48727 |
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
48728 |
|
|
|
|
|
|
|
48729 |
|
48730 |
+
Popper.Utils = (typeof window !== 'undefined' ? window : __webpack_require__.g).PopperUtils;
|
48731 |
+
Popper.placements = placements;
|
48732 |
+
Popper.Defaults = Defaults;
|
48733 |
|
48734 |
+
/* harmony default export */ var esm_popper = (Popper);
|
48735 |
+
//# sourceMappingURL=popper.js.map
|
|
|
|
|
48736 |
|
48737 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/Popper/Popper.js
|
|
|
48738 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48739 |
|
|
|
48740 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48741 |
|
|
|
48742 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48743 |
|
|
|
|
|
48744 |
|
|
|
|
|
|
|
|
|
48745 |
|
|
|
48746 |
|
|
|
|
|
48747 |
|
|
|
|
|
|
|
|
|
48748 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48749 |
|
48750 |
+
function flipPlacement(placement, theme) {
|
48751 |
+
var direction = theme && theme.direction || 'ltr';
|
|
|
|
|
48752 |
|
48753 |
+
if (direction === 'ltr') {
|
48754 |
+
return placement;
|
48755 |
+
}
|
|
|
48756 |
|
48757 |
+
switch (placement) {
|
48758 |
+
case 'bottom-end':
|
48759 |
+
return 'bottom-start';
|
48760 |
|
48761 |
+
case 'bottom-start':
|
48762 |
+
return 'bottom-end';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48763 |
|
48764 |
+
case 'top-end':
|
48765 |
+
return 'top-start';
|
|
|
48766 |
|
48767 |
+
case 'top-start':
|
48768 |
+
return 'top-end';
|
48769 |
+
|
48770 |
+
default:
|
48771 |
+
return placement;
|
48772 |
}
|
|
|
48773 |
}
|
48774 |
|
48775 |
+
function Popper_getAnchorEl(anchorEl) {
|
48776 |
+
return typeof anchorEl === 'function' ? anchorEl() : anchorEl;
|
48777 |
+
}
|
48778 |
+
|
48779 |
+
var Popper_useEnhancedEffect = typeof window !== 'undefined' ? react.useLayoutEffect : react.useEffect;
|
48780 |
+
var defaultPopperOptions = {};
|
48781 |
/**
|
48782 |
+
* Poppers rely on the 3rd party library [Popper.js](https://popper.js.org/docs/v1/) for positioning.
|
|
|
|
|
|
|
|
|
48783 |
*/
|
|
|
|
|
48784 |
|
48785 |
+
var Popper_Popper = /*#__PURE__*/react.forwardRef(function Popper(props, ref) {
|
48786 |
+
var anchorEl = props.anchorEl,
|
48787 |
+
children = props.children,
|
48788 |
+
container = props.container,
|
48789 |
+
_props$disablePortal = props.disablePortal,
|
48790 |
+
disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal,
|
48791 |
+
_props$keepMounted = props.keepMounted,
|
48792 |
+
keepMounted = _props$keepMounted === void 0 ? false : _props$keepMounted,
|
48793 |
+
modifiers = props.modifiers,
|
48794 |
+
open = props.open,
|
48795 |
+
_props$placement = props.placement,
|
48796 |
+
initialPlacement = _props$placement === void 0 ? 'bottom' : _props$placement,
|
48797 |
+
_props$popperOptions = props.popperOptions,
|
48798 |
+
popperOptions = _props$popperOptions === void 0 ? defaultPopperOptions : _props$popperOptions,
|
48799 |
+
popperRefProp = props.popperRef,
|
48800 |
+
style = props.style,
|
48801 |
+
_props$transition = props.transition,
|
48802 |
+
transition = _props$transition === void 0 ? false : _props$transition,
|
48803 |
+
other = (0,objectWithoutProperties/* default */.Z)(props, ["anchorEl", "children", "container", "disablePortal", "keepMounted", "modifiers", "open", "placement", "popperOptions", "popperRef", "style", "transition"]);
|
48804 |
|
48805 |
+
var tooltipRef = react.useRef(null);
|
48806 |
+
var ownRef = (0,useForkRef/* default */.Z)(tooltipRef, ref);
|
48807 |
+
var popperRef = react.useRef(null);
|
48808 |
+
var handlePopperRef = (0,useForkRef/* default */.Z)(popperRef, popperRefProp);
|
48809 |
+
var handlePopperRefRef = react.useRef(handlePopperRef);
|
48810 |
+
Popper_useEnhancedEffect(function () {
|
48811 |
+
handlePopperRefRef.current = handlePopperRef;
|
48812 |
+
}, [handlePopperRef]);
|
48813 |
+
react.useImperativeHandle(popperRefProp, function () {
|
48814 |
+
return popperRef.current;
|
48815 |
+
}, []);
|
48816 |
|
48817 |
+
var _React$useState = react.useState(true),
|
48818 |
+
exited = _React$useState[0],
|
48819 |
+
setExited = _React$useState[1];
|
48820 |
|
48821 |
+
var theme = (0,useTheme/* default */.Z)();
|
48822 |
+
var rtlPlacement = flipPlacement(initialPlacement, theme);
|
48823 |
+
/**
|
48824 |
+
* placement initialized from prop but can change during lifetime if modifiers.flip.
|
48825 |
+
* modifiers.flip is essentially a flip for controlled/uncontrolled behavior
|
48826 |
+
*/
|
48827 |
+
|
48828 |
+
var _React$useState2 = react.useState(rtlPlacement),
|
48829 |
+
placement = _React$useState2[0],
|
48830 |
+
setPlacement = _React$useState2[1];
|
48831 |
+
|
48832 |
+
react.useEffect(function () {
|
48833 |
+
if (popperRef.current) {
|
48834 |
+
popperRef.current.update();
|
48835 |
}
|
48836 |
+
});
|
48837 |
+
var handleOpen = react.useCallback(function () {
|
48838 |
+
if (!tooltipRef.current || !anchorEl || !open) {
|
48839 |
+
return;
|
|
|
|
|
48840 |
}
|
|
|
48841 |
|
48842 |
+
if (popperRef.current) {
|
48843 |
+
popperRef.current.destroy();
|
48844 |
+
handlePopperRefRef.current(null);
|
48845 |
+
}
|
48846 |
|
48847 |
+
var handlePopperUpdate = function handlePopperUpdate(data) {
|
48848 |
+
setPlacement(data.placement);
|
48849 |
+
};
|
48850 |
|
48851 |
+
var resolvedAnchorEl = Popper_getAnchorEl(anchorEl);
|
|
|
|
|
|
|
|
|
|
|
48852 |
|
48853 |
+
if (false) { var box; }
|
|
|
|
|
|
|
48854 |
|
48855 |
+
var popper = new esm_popper(Popper_getAnchorEl(anchorEl), tooltipRef.current, (0,esm_extends/* default */.Z)({
|
48856 |
+
placement: rtlPlacement
|
48857 |
+
}, popperOptions, {
|
48858 |
+
modifiers: (0,esm_extends/* default */.Z)({}, disablePortal ? {} : {
|
48859 |
+
// It's using scrollParent by default, we can use the viewport when using a portal.
|
48860 |
+
preventOverflow: {
|
48861 |
+
boundariesElement: 'window'
|
48862 |
+
}
|
48863 |
+
}, modifiers, popperOptions.modifiers),
|
48864 |
+
// We could have been using a custom modifier like react-popper is doing.
|
48865 |
+
// But it seems this is the best public API for this use case.
|
48866 |
+
onCreate: (0,createChainedFunction/* default */.Z)(handlePopperUpdate, popperOptions.onCreate),
|
48867 |
+
onUpdate: (0,createChainedFunction/* default */.Z)(handlePopperUpdate, popperOptions.onUpdate)
|
48868 |
+
}));
|
48869 |
+
handlePopperRefRef.current(popper);
|
48870 |
+
}, [anchorEl, disablePortal, modifiers, open, rtlPlacement, popperOptions]);
|
48871 |
+
var handleRef = react.useCallback(function (node) {
|
48872 |
+
(0,setRef/* default */.Z)(ownRef, node);
|
48873 |
+
handleOpen();
|
48874 |
+
}, [ownRef, handleOpen]);
|
48875 |
|
48876 |
+
var handleEnter = function handleEnter() {
|
48877 |
+
setExited(false);
|
48878 |
+
};
|
48879 |
|
48880 |
+
var handleClose = function handleClose() {
|
48881 |
+
if (!popperRef.current) {
|
48882 |
+
return;
|
48883 |
+
}
|
|
|
|
|
48884 |
|
48885 |
+
popperRef.current.destroy();
|
48886 |
+
handlePopperRefRef.current(null);
|
48887 |
+
};
|
48888 |
|
48889 |
+
var handleExited = function handleExited() {
|
48890 |
+
setExited(true);
|
48891 |
+
handleClose();
|
48892 |
+
};
|
48893 |
|
48894 |
+
react.useEffect(function () {
|
48895 |
+
return function () {
|
48896 |
+
handleClose();
|
48897 |
+
};
|
48898 |
+
}, []);
|
48899 |
+
react.useEffect(function () {
|
48900 |
+
if (!open && !transition) {
|
48901 |
+
// Otherwise handleExited will call this.
|
48902 |
+
handleClose();
|
48903 |
+
}
|
48904 |
+
}, [open, transition]);
|
48905 |
|
48906 |
+
if (!keepMounted && !open && (!transition || exited)) {
|
48907 |
+
return null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48908 |
}
|
|
|
|
|
48909 |
|
48910 |
+
var childProps = {
|
48911 |
+
placement: placement
|
48912 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48913 |
|
48914 |
+
if (transition) {
|
48915 |
+
childProps.TransitionProps = {
|
48916 |
+
in: open,
|
48917 |
+
onEnter: handleEnter,
|
48918 |
+
onExited: handleExited
|
48919 |
+
};
|
48920 |
+
}
|
48921 |
|
48922 |
+
return /*#__PURE__*/react.createElement(Portal_Portal, {
|
48923 |
+
disablePortal: disablePortal,
|
48924 |
+
container: container
|
48925 |
+
}, /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
48926 |
+
ref: handleRef,
|
48927 |
+
role: "tooltip"
|
48928 |
+
}, other, {
|
48929 |
+
style: (0,esm_extends/* default */.Z)({
|
48930 |
+
// Prevents scroll issue, waiting for Popper.js to add this style once initiated.
|
48931 |
+
position: 'fixed',
|
48932 |
+
// Fix Popper.js display issue
|
48933 |
+
top: 0,
|
48934 |
+
left: 0,
|
48935 |
+
display: !open && keepMounted && !transition ? 'none' : null
|
48936 |
+
}, style)
|
48937 |
+
}), typeof children === 'function' ? children(childProps) : children));
|
48938 |
+
});
|
48939 |
+
false ? 0 : void 0;
|
48940 |
+
/* harmony default export */ var esm_Popper_Popper = (Popper_Popper);
|
48941 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/ListSubheader/ListSubheader.js
|
48942 |
|
|
|
|
|
|
|
|
|
48943 |
|
|
|
|
|
|
|
|
|
|
|
48944 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48945 |
|
|
|
|
|
|
|
|
|
48946 |
|
|
|
48947 |
|
|
|
|
|
|
|
48948 |
|
48949 |
+
var ListSubheader_styles = function styles(theme) {
|
48950 |
+
return {
|
48951 |
+
/* Styles applied to the root element. */
|
48952 |
+
root: {
|
48953 |
+
boxSizing: 'border-box',
|
48954 |
+
lineHeight: '48px',
|
48955 |
+
listStyle: 'none',
|
48956 |
+
color: theme.palette.text.secondary,
|
48957 |
+
fontFamily: theme.typography.fontFamily,
|
48958 |
+
fontWeight: theme.typography.fontWeightMedium,
|
48959 |
+
fontSize: theme.typography.pxToRem(14)
|
48960 |
+
},
|
48961 |
|
48962 |
+
/* Styles applied to the root element if `color="primary"`. */
|
48963 |
+
colorPrimary: {
|
48964 |
+
color: theme.palette.primary.main
|
48965 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48966 |
|
48967 |
+
/* Styles applied to the root element if `color="inherit"`. */
|
48968 |
+
colorInherit: {
|
48969 |
+
color: 'inherit'
|
48970 |
+
},
|
48971 |
|
48972 |
+
/* Styles applied to the inner `component` element if `disableGutters={false}`. */
|
48973 |
+
gutters: {
|
48974 |
+
paddingLeft: 16,
|
48975 |
+
paddingRight: 16
|
48976 |
+
},
|
48977 |
|
48978 |
+
/* Styles applied to the root element if `inset={true}`. */
|
48979 |
+
inset: {
|
48980 |
+
paddingLeft: 72
|
48981 |
+
},
|
48982 |
|
48983 |
+
/* Styles applied to the root element if `disableSticky={false}`. */
|
48984 |
+
sticky: {
|
48985 |
+
position: 'sticky',
|
48986 |
+
top: 0,
|
48987 |
+
zIndex: 1,
|
48988 |
+
backgroundColor: 'inherit'
|
48989 |
+
}
|
48990 |
+
};
|
48991 |
+
};
|
48992 |
+
var ListSubheader = /*#__PURE__*/react.forwardRef(function ListSubheader(props, ref) {
|
48993 |
+
var classes = props.classes,
|
48994 |
+
className = props.className,
|
48995 |
+
_props$color = props.color,
|
48996 |
+
color = _props$color === void 0 ? 'default' : _props$color,
|
48997 |
+
_props$component = props.component,
|
48998 |
+
Component = _props$component === void 0 ? 'li' : _props$component,
|
48999 |
+
_props$disableGutters = props.disableGutters,
|
49000 |
+
disableGutters = _props$disableGutters === void 0 ? false : _props$disableGutters,
|
49001 |
+
_props$disableSticky = props.disableSticky,
|
49002 |
+
disableSticky = _props$disableSticky === void 0 ? false : _props$disableSticky,
|
49003 |
+
_props$inset = props.inset,
|
49004 |
+
inset = _props$inset === void 0 ? false : _props$inset,
|
49005 |
+
other = (0,objectWithoutProperties/* default */.Z)(props, ["classes", "className", "color", "component", "disableGutters", "disableSticky", "inset"]);
|
49006 |
|
49007 |
+
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
49008 |
+
className: (0,clsx_m/* default */.Z)(classes.root, className, color !== 'default' && classes["color".concat((0,utils_capitalize/* default */.Z)(color))], inset && classes.inset, !disableSticky && classes.sticky, !disableGutters && classes.gutters),
|
49009 |
+
ref: ref
|
49010 |
+
}, other));
|
49011 |
+
});
|
49012 |
+
false ? 0 : void 0;
|
49013 |
+
/* harmony default export */ var ListSubheader_ListSubheader = ((0,withStyles/* default */.Z)(ListSubheader_styles, {
|
49014 |
+
name: 'MuiListSubheader'
|
49015 |
+
})(ListSubheader));
|
49016 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/lab/esm/internal/svg-icons/Close.js
|
49017 |
|
|
|
49018 |
|
49019 |
+
/**
|
49020 |
+
* @ignore - internal component.
|
49021 |
+
*/
|
49022 |
|
49023 |
+
/* harmony default export */ var Close = ((0,createSvgIcon/* default */.Z)( /*#__PURE__*/react.createElement("path", {
|
49024 |
+
d: "M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"
|
49025 |
+
}), 'Close'));
|
49026 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/lab/esm/internal/svg-icons/ArrowDropDown.js
|
49027 |
|
|
|
|
|
49028 |
|
49029 |
+
/**
|
49030 |
+
* @ignore - internal component.
|
49031 |
+
*/
|
49032 |
|
49033 |
+
/* harmony default export */ var svg_icons_ArrowDropDown = ((0,createSvgIcon/* default */.Z)( /*#__PURE__*/react.createElement("path", {
|
49034 |
+
d: "M7 10l5 5 5-5z"
|
49035 |
+
}), 'ArrowDropDown'));
|
49036 |
+
// EXTERNAL MODULE: ./node_modules/@material-ui/core/esm/utils/unstable_useId.js
|
49037 |
+
var unstable_useId = __webpack_require__(95001);
|
49038 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/lab/esm/useAutocomplete/useAutocomplete.js
|
49039 |
|
|
|
|
|
|
|
49040 |
|
|
|
|
|
|
|
49041 |
|
|
|
49042 |
|
49043 |
+
/* eslint-disable no-constant-condition */
|
|
|
|
|
49044 |
|
49045 |
+
// https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript
|
49046 |
+
// Give up on IE 11 support for this feature
|
49047 |
+
|
49048 |
+
function stripDiacritics(string) {
|
49049 |
+
return typeof string.normalize !== 'undefined' ? string.normalize('NFD').replace(/[\u0300-\u036f]/g, '') : string;
|
49050 |
}
|
49051 |
|
49052 |
+
function createFilterOptions() {
|
49053 |
+
var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
49054 |
+
var _config$ignoreAccents = config.ignoreAccents,
|
49055 |
+
ignoreAccents = _config$ignoreAccents === void 0 ? true : _config$ignoreAccents,
|
49056 |
+
_config$ignoreCase = config.ignoreCase,
|
49057 |
+
ignoreCase = _config$ignoreCase === void 0 ? true : _config$ignoreCase,
|
49058 |
+
limit = config.limit,
|
49059 |
+
_config$matchFrom = config.matchFrom,
|
49060 |
+
matchFrom = _config$matchFrom === void 0 ? 'any' : _config$matchFrom,
|
49061 |
+
stringify = config.stringify,
|
49062 |
+
_config$trim = config.trim,
|
49063 |
+
trim = _config$trim === void 0 ? false : _config$trim;
|
49064 |
+
return function (options, _ref) {
|
49065 |
+
var inputValue = _ref.inputValue,
|
49066 |
+
getOptionLabel = _ref.getOptionLabel;
|
49067 |
+
var input = trim ? inputValue.trim() : inputValue;
|
49068 |
|
49069 |
+
if (ignoreCase) {
|
49070 |
+
input = input.toLowerCase();
|
49071 |
+
}
|
|
|
|
|
|
|
49072 |
|
49073 |
+
if (ignoreAccents) {
|
49074 |
+
input = stripDiacritics(input);
|
49075 |
+
}
|
|
|
|
|
|
|
49076 |
|
49077 |
+
var filteredOptions = options.filter(function (option) {
|
49078 |
+
var candidate = (stringify || getOptionLabel)(option);
|
49079 |
|
49080 |
+
if (ignoreCase) {
|
49081 |
+
candidate = candidate.toLowerCase();
|
49082 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49083 |
|
49084 |
+
if (ignoreAccents) {
|
49085 |
+
candidate = stripDiacritics(candidate);
|
49086 |
+
}
|
|
|
49087 |
|
49088 |
+
return matchFrom === 'start' ? candidate.indexOf(input) === 0 : candidate.indexOf(input) > -1;
|
49089 |
+
});
|
49090 |
+
return typeof limit === 'number' ? filteredOptions.slice(0, limit) : filteredOptions;
|
49091 |
+
};
|
49092 |
+
} // To replace with .findIndex() once we stop IE 11 support.
|
|
|
|
|
|
|
|
|
|
|
|
|
49093 |
|
49094 |
+
function useAutocomplete_findIndex(array, comp) {
|
49095 |
+
for (var i = 0; i < array.length; i += 1) {
|
49096 |
+
if (comp(array[i])) {
|
49097 |
+
return i;
|
|
|
|
|
|
|
|
|
|
|
49098 |
}
|
|
|
|
|
|
|
|
|
|
|
49099 |
}
|
49100 |
+
|
49101 |
+
return -1;
|
49102 |
}
|
49103 |
|
49104 |
+
var defaultFilterOptions = createFilterOptions(); // Number of options to jump in list box when pageup and pagedown keys are used.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49105 |
|
49106 |
+
var pageSize = 5;
|
49107 |
+
function useAutocomplete(props) {
|
49108 |
+
var _props$autoComplete = props.autoComplete,
|
49109 |
+
autoComplete = _props$autoComplete === void 0 ? false : _props$autoComplete,
|
49110 |
+
_props$autoHighlight = props.autoHighlight,
|
49111 |
+
autoHighlight = _props$autoHighlight === void 0 ? false : _props$autoHighlight,
|
49112 |
+
_props$autoSelect = props.autoSelect,
|
49113 |
+
autoSelect = _props$autoSelect === void 0 ? false : _props$autoSelect,
|
49114 |
+
_props$blurOnSelect = props.blurOnSelect,
|
49115 |
+
blurOnSelect = _props$blurOnSelect === void 0 ? false : _props$blurOnSelect,
|
49116 |
+
_props$clearOnBlur = props.clearOnBlur,
|
49117 |
+
clearOnBlur = _props$clearOnBlur === void 0 ? !props.freeSolo : _props$clearOnBlur,
|
49118 |
+
_props$clearOnEscape = props.clearOnEscape,
|
49119 |
+
clearOnEscape = _props$clearOnEscape === void 0 ? false : _props$clearOnEscape,
|
49120 |
+
_props$componentName = props.componentName,
|
49121 |
+
componentName = _props$componentName === void 0 ? 'useAutocomplete' : _props$componentName,
|
49122 |
+
_props$debug = props.debug,
|
49123 |
+
debug = _props$debug === void 0 ? false : _props$debug,
|
49124 |
+
_props$defaultValue = props.defaultValue,
|
49125 |
+
defaultValue = _props$defaultValue === void 0 ? props.multiple ? [] : null : _props$defaultValue,
|
49126 |
+
_props$disableClearab = props.disableClearable,
|
49127 |
+
disableClearable = _props$disableClearab === void 0 ? false : _props$disableClearab,
|
49128 |
+
_props$disableCloseOn = props.disableCloseOnSelect,
|
49129 |
+
disableCloseOnSelect = _props$disableCloseOn === void 0 ? false : _props$disableCloseOn,
|
49130 |
+
_props$disabledItemsF = props.disabledItemsFocusable,
|
49131 |
+
disabledItemsFocusable = _props$disabledItemsF === void 0 ? false : _props$disabledItemsF,
|
49132 |
+
_props$disableListWra = props.disableListWrap,
|
49133 |
+
disableListWrap = _props$disableListWra === void 0 ? false : _props$disableListWra,
|
49134 |
+
_props$filterOptions = props.filterOptions,
|
49135 |
+
filterOptions = _props$filterOptions === void 0 ? defaultFilterOptions : _props$filterOptions,
|
49136 |
+
_props$filterSelected = props.filterSelectedOptions,
|
49137 |
+
filterSelectedOptions = _props$filterSelected === void 0 ? false : _props$filterSelected,
|
49138 |
+
_props$freeSolo = props.freeSolo,
|
49139 |
+
freeSolo = _props$freeSolo === void 0 ? false : _props$freeSolo,
|
49140 |
+
getOptionDisabled = props.getOptionDisabled,
|
49141 |
+
_props$getOptionLabel = props.getOptionLabel,
|
49142 |
+
getOptionLabelProp = _props$getOptionLabel === void 0 ? function (option) {
|
49143 |
+
return option;
|
49144 |
+
} : _props$getOptionLabel,
|
49145 |
+
_props$getOptionSelec = props.getOptionSelected,
|
49146 |
+
getOptionSelected = _props$getOptionSelec === void 0 ? function (option, value) {
|
49147 |
+
return option === value;
|
49148 |
+
} : _props$getOptionSelec,
|
49149 |
+
groupBy = props.groupBy,
|
49150 |
+
_props$handleHomeEndK = props.handleHomeEndKeys,
|
49151 |
+
handleHomeEndKeys = _props$handleHomeEndK === void 0 ? !props.freeSolo : _props$handleHomeEndK,
|
49152 |
+
idProp = props.id,
|
49153 |
+
_props$includeInputIn = props.includeInputInList,
|
49154 |
+
includeInputInList = _props$includeInputIn === void 0 ? false : _props$includeInputIn,
|
49155 |
+
inputValueProp = props.inputValue,
|
49156 |
+
_props$multiple = props.multiple,
|
49157 |
+
multiple = _props$multiple === void 0 ? false : _props$multiple,
|
49158 |
+
onChange = props.onChange,
|
49159 |
+
onClose = props.onClose,
|
49160 |
+
onHighlightChange = props.onHighlightChange,
|
49161 |
+
onInputChange = props.onInputChange,
|
49162 |
+
onOpen = props.onOpen,
|
49163 |
+
openProp = props.open,
|
49164 |
+
_props$openOnFocus = props.openOnFocus,
|
49165 |
+
openOnFocus = _props$openOnFocus === void 0 ? false : _props$openOnFocus,
|
49166 |
+
options = props.options,
|
49167 |
+
_props$selectOnFocus = props.selectOnFocus,
|
49168 |
+
selectOnFocus = _props$selectOnFocus === void 0 ? !props.freeSolo : _props$selectOnFocus,
|
49169 |
+
valueProp = props.value;
|
49170 |
+
var id = (0,unstable_useId/* default */.Z)(idProp);
|
49171 |
+
var getOptionLabel = getOptionLabelProp;
|
49172 |
|
49173 |
+
if (false) {}
|
|
|
|
|
|
|
|
|
49174 |
|
49175 |
+
var ignoreFocus = react.useRef(false);
|
49176 |
+
var firstFocus = react.useRef(true);
|
49177 |
+
var inputRef = react.useRef(null);
|
49178 |
+
var listboxRef = react.useRef(null);
|
|
|
49179 |
|
49180 |
+
var _React$useState = react.useState(null),
|
49181 |
+
anchorEl = _React$useState[0],
|
49182 |
+
setAnchorEl = _React$useState[1];
|
49183 |
|
49184 |
+
var _React$useState2 = react.useState(-1),
|
49185 |
+
focusedTag = _React$useState2[0],
|
49186 |
+
setFocusedTag = _React$useState2[1];
|
|
|
49187 |
|
49188 |
+
var defaultHighlighted = autoHighlight ? 0 : -1;
|
49189 |
+
var highlightedIndexRef = react.useRef(defaultHighlighted);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49190 |
|
49191 |
+
var _useControlled = (0,useControlled/* default */.Z)({
|
49192 |
+
controlled: valueProp,
|
49193 |
+
default: defaultValue,
|
49194 |
+
name: componentName
|
49195 |
+
}),
|
49196 |
+
_useControlled2 = (0,slicedToArray/* default */.Z)(_useControlled, 2),
|
49197 |
+
value = _useControlled2[0],
|
49198 |
+
setValue = _useControlled2[1];
|
|
|
|
|
49199 |
|
49200 |
+
var _useControlled3 = (0,useControlled/* default */.Z)({
|
49201 |
+
controlled: inputValueProp,
|
49202 |
+
default: '',
|
49203 |
+
name: componentName,
|
49204 |
+
state: 'inputValue'
|
49205 |
+
}),
|
49206 |
+
_useControlled4 = (0,slicedToArray/* default */.Z)(_useControlled3, 2),
|
49207 |
+
inputValue = _useControlled4[0],
|
49208 |
+
setInputValue = _useControlled4[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
49209 |
|
49210 |
+
var _React$useState3 = react.useState(false),
|
49211 |
+
focused = _React$useState3[0],
|
49212 |
+
setFocused = _React$useState3[1];
|
49213 |
|
49214 |
+
var resetInputValue = (0,useEventCallback/* default */.Z)(function (event, newValue) {
|
49215 |
+
var newInputValue;
|
|
|
|
|
|
|
|
|
49216 |
|
49217 |
+
if (multiple) {
|
49218 |
+
newInputValue = '';
|
49219 |
+
} else if (newValue == null) {
|
49220 |
+
newInputValue = '';
|
49221 |
+
} else {
|
49222 |
+
var optionLabel = getOptionLabel(newValue);
|
49223 |
+
newInputValue = typeof optionLabel === 'string' ? optionLabel : '';
|
49224 |
+
}
|
|
|
|
|
|
|
|
|
|
|
49225 |
|
49226 |
+
if (inputValue === newInputValue) {
|
49227 |
+
return;
|
49228 |
+
}
|
49229 |
+
|
49230 |
+
setInputValue(newInputValue);
|
49231 |
+
|
49232 |
+
if (onInputChange) {
|
49233 |
+
onInputChange(event, newInputValue, 'reset');
|
49234 |
+
}
|
49235 |
+
});
|
49236 |
+
react.useEffect(function () {
|
49237 |
+
resetInputValue(null, value);
|
49238 |
+
}, [value, resetInputValue]);
|
49239 |
|
49240 |
+
var _useControlled5 = (0,useControlled/* default */.Z)({
|
49241 |
+
controlled: openProp,
|
49242 |
+
default: false,
|
49243 |
+
name: componentName,
|
49244 |
+
state: 'open'
|
49245 |
+
}),
|
49246 |
+
_useControlled6 = (0,slicedToArray/* default */.Z)(_useControlled5, 2),
|
49247 |
+
open = _useControlled6[0],
|
49248 |
+
setOpenState = _useControlled6[1];
|
49249 |
|
49250 |
+
var inputValueIsSelectedValue = !multiple && value != null && inputValue === getOptionLabel(value);
|
49251 |
+
var popupOpen = open;
|
49252 |
+
var filteredOptions = popupOpen ? filterOptions(options.filter(function (option) {
|
49253 |
+
if (filterSelectedOptions && (multiple ? value : [value]).some(function (value2) {
|
49254 |
+
return value2 !== null && getOptionSelected(option, value2);
|
49255 |
+
})) {
|
49256 |
+
return false;
|
49257 |
+
}
|
49258 |
|
49259 |
+
return true;
|
49260 |
+
}), // we use the empty string to manipulate `filterOptions` to not filter any options
|
49261 |
+
// i.e. the filter predicate always returns true
|
49262 |
+
{
|
49263 |
+
inputValue: inputValueIsSelectedValue ? '' : inputValue,
|
49264 |
+
getOptionLabel: getOptionLabel
|
49265 |
+
}) : [];
|
|
|
49266 |
|
49267 |
+
if (false) { var missingValue; }
|
|
|
|
|
49268 |
|
49269 |
+
var focusTag = (0,useEventCallback/* default */.Z)(function (tagToFocus) {
|
49270 |
+
if (tagToFocus === -1) {
|
49271 |
+
inputRef.current.focus();
|
49272 |
+
} else {
|
49273 |
+
anchorEl.querySelector("[data-tag-index=\"".concat(tagToFocus, "\"]")).focus();
|
49274 |
+
}
|
49275 |
+
}); // Ensure the focusedTag is never inconsistent
|
49276 |
|
49277 |
+
react.useEffect(function () {
|
49278 |
+
if (multiple && focusedTag > value.length - 1) {
|
49279 |
+
setFocusedTag(-1);
|
49280 |
+
focusTag(-1);
|
49281 |
+
}
|
49282 |
+
}, [value, multiple, focusedTag, focusTag]);
|
49283 |
|
49284 |
+
function validOptionIndex(index, direction) {
|
49285 |
+
if (!listboxRef.current || index === -1) {
|
49286 |
+
return -1;
|
49287 |
+
}
|
49288 |
|
49289 |
+
var nextFocus = index;
|
|
|
49290 |
|
49291 |
+
while (true) {
|
49292 |
+
// Out of range
|
49293 |
+
if (direction === 'next' && nextFocus === filteredOptions.length || direction === 'previous' && nextFocus === -1) {
|
49294 |
+
return -1;
|
|
|
49295 |
}
|
49296 |
+
|
49297 |
+
var option = listboxRef.current.querySelector("[data-option-index=\"".concat(nextFocus, "\"]")); // Same logic as MenuList.js
|
49298 |
+
|
49299 |
+
var nextFocusDisabled = disabledItemsFocusable ? false : option && (option.disabled || option.getAttribute('aria-disabled') === 'true');
|
49300 |
+
|
49301 |
+
if (option && !option.hasAttribute('tabindex') || nextFocusDisabled) {
|
49302 |
+
// Move to the next element.
|
49303 |
+
nextFocus += direction === 'next' ? 1 : -1;
|
49304 |
+
} else {
|
49305 |
+
return nextFocus;
|
49306 |
}
|
|
|
49307 |
}
|
49308 |
+
}
|
|
|
|
|
|
|
|
|
|
|
49309 |
|
49310 |
+
var setHighlightedIndex = (0,useEventCallback/* default */.Z)(function (_ref2) {
|
49311 |
+
var event = _ref2.event,
|
49312 |
+
index = _ref2.index,
|
49313 |
+
_ref2$reason = _ref2.reason,
|
49314 |
+
reason = _ref2$reason === void 0 ? 'auto' : _ref2$reason;
|
49315 |
+
highlightedIndexRef.current = index; // does the index exist?
|
49316 |
|
49317 |
+
if (index === -1) {
|
49318 |
+
inputRef.current.removeAttribute('aria-activedescendant');
|
49319 |
+
} else {
|
49320 |
+
inputRef.current.setAttribute('aria-activedescendant', "".concat(id, "-option-").concat(index));
|
49321 |
+
}
|
49322 |
|
49323 |
+
if (onHighlightChange) {
|
49324 |
+
onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);
|
49325 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49326 |
|
49327 |
+
if (!listboxRef.current) {
|
49328 |
+
return;
|
49329 |
+
}
|
|
|
|
|
49330 |
|
49331 |
+
var prev = listboxRef.current.querySelector('[data-focus]');
|
|
|
|
|
49332 |
|
49333 |
+
if (prev) {
|
49334 |
+
prev.removeAttribute('data-focus');
|
49335 |
+
}
|
|
|
49336 |
|
49337 |
+
var listboxNode = listboxRef.current.parentElement.querySelector('[role="listbox"]'); // "No results"
|
|
|
49338 |
|
49339 |
+
if (!listboxNode) {
|
49340 |
+
return;
|
49341 |
+
}
|
49342 |
|
49343 |
+
if (index === -1) {
|
49344 |
+
listboxNode.scrollTop = 0;
|
49345 |
+
return;
|
49346 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49347 |
|
49348 |
+
var option = listboxRef.current.querySelector("[data-option-index=\"".concat(index, "\"]"));
|
|
|
|
|
|
|
49349 |
|
49350 |
+
if (!option) {
|
49351 |
+
return;
|
|
|
|
|
49352 |
}
|
49353 |
|
49354 |
+
option.setAttribute('data-focus', 'true'); // Scroll active descendant into view.
|
49355 |
+
// Logic copied from https://www.w3.org/TR/wai-aria-practices/examples/listbox/js/listbox.js
|
49356 |
+
//
|
49357 |
+
// Consider this API instead once it has a better browser support:
|
49358 |
+
// .scrollIntoView({ scrollMode: 'if-needed', block: 'nearest' });
|
49359 |
+
|
49360 |
+
if (listboxNode.scrollHeight > listboxNode.clientHeight && reason !== 'mouse') {
|
49361 |
+
var element = option;
|
49362 |
+
var scrollBottom = listboxNode.clientHeight + listboxNode.scrollTop;
|
49363 |
+
var elementBottom = element.offsetTop + element.offsetHeight;
|
49364 |
+
|
49365 |
+
if (elementBottom > scrollBottom) {
|
49366 |
+
listboxNode.scrollTop = elementBottom - listboxNode.clientHeight;
|
49367 |
+
} else if (element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0) < listboxNode.scrollTop) {
|
49368 |
+
listboxNode.scrollTop = element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0);
|
49369 |
+
}
|
49370 |
}
|
49371 |
+
});
|
49372 |
+
var changeHighlightedIndex = (0,useEventCallback/* default */.Z)(function (_ref3) {
|
49373 |
+
var event = _ref3.event,
|
49374 |
+
diff = _ref3.diff,
|
49375 |
+
_ref3$direction = _ref3.direction,
|
49376 |
+
direction = _ref3$direction === void 0 ? 'next' : _ref3$direction,
|
49377 |
+
_ref3$reason = _ref3.reason,
|
49378 |
+
reason = _ref3$reason === void 0 ? 'auto' : _ref3$reason;
|
49379 |
|
49380 |
+
if (!popupOpen) {
|
49381 |
+
return;
|
49382 |
+
}
|
49383 |
|
49384 |
+
var getNextIndex = function getNextIndex() {
|
49385 |
+
var maxIndex = filteredOptions.length - 1;
|
49386 |
|
49387 |
+
if (diff === 'reset') {
|
49388 |
+
return defaultHighlighted;
|
49389 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49390 |
|
49391 |
+
if (diff === 'start') {
|
49392 |
+
return 0;
|
49393 |
+
}
|
49394 |
|
49395 |
+
if (diff === 'end') {
|
49396 |
+
return maxIndex;
|
49397 |
+
}
|
49398 |
|
49399 |
+
var newIndex = highlightedIndexRef.current + diff;
|
49400 |
|
49401 |
+
if (newIndex < 0) {
|
49402 |
+
if (newIndex === -1 && includeInputInList) {
|
49403 |
+
return -1;
|
49404 |
+
}
|
49405 |
|
49406 |
+
if (disableListWrap && highlightedIndexRef.current !== -1 || Math.abs(diff) > 1) {
|
49407 |
+
return 0;
|
49408 |
+
}
|
49409 |
|
49410 |
+
return maxIndex;
|
49411 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49412 |
|
49413 |
+
if (newIndex > maxIndex) {
|
49414 |
+
if (newIndex === maxIndex + 1 && includeInputInList) {
|
49415 |
+
return -1;
|
49416 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49417 |
|
49418 |
+
if (disableListWrap || Math.abs(diff) > 1) {
|
49419 |
+
return maxIndex;
|
49420 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49421 |
|
49422 |
+
return 0;
|
49423 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49424 |
|
49425 |
+
return newIndex;
|
49426 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49427 |
|
49428 |
+
var nextIndex = validOptionIndex(getNextIndex(), direction);
|
49429 |
+
setHighlightedIndex({
|
49430 |
+
index: nextIndex,
|
49431 |
+
reason: reason,
|
49432 |
+
event: event
|
49433 |
+
}); // Sync the content of the input with the highlighted option.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49434 |
|
49435 |
+
if (autoComplete && diff !== 'reset') {
|
49436 |
+
if (nextIndex === -1) {
|
49437 |
+
inputRef.current.value = inputValue;
|
49438 |
+
} else {
|
49439 |
+
var option = getOptionLabel(filteredOptions[nextIndex]);
|
49440 |
+
inputRef.current.value = option; // The portion of the selected suggestion that has not been typed by the user,
|
49441 |
+
// a completion string, appears inline after the input cursor in the textbox.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49442 |
|
49443 |
+
var index = option.toLowerCase().indexOf(inputValue.toLowerCase());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49444 |
|
49445 |
+
if (index === 0 && inputValue.length > 0) {
|
49446 |
+
inputRef.current.setSelectionRange(inputValue.length, option.length);
|
49447 |
+
}
|
49448 |
+
}
|
49449 |
+
}
|
49450 |
+
});
|
49451 |
+
var syncHighlightedIndex = react.useCallback(function () {
|
49452 |
+
if (!popupOpen) {
|
49453 |
+
return;
|
49454 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49455 |
|
49456 |
+
var valueItem = multiple ? value[0] : value; // The popup is empty, reset
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49457 |
|
49458 |
+
if (filteredOptions.length === 0 || valueItem == null) {
|
49459 |
+
changeHighlightedIndex({
|
49460 |
+
diff: 'reset'
|
49461 |
+
});
|
49462 |
+
return;
|
49463 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49464 |
|
49465 |
+
if (!listboxRef.current) {
|
49466 |
+
return;
|
49467 |
+
} // Synchronize the value with the highlighted index
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49468 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49469 |
|
49470 |
+
if (!filterSelectedOptions && valueItem != null) {
|
49471 |
+
var currentOption = filteredOptions[highlightedIndexRef.current]; // Keep the current highlighted index if possible
|
|
|
|
|
|
|
49472 |
|
49473 |
+
if (multiple && currentOption && useAutocomplete_findIndex(value, function (val) {
|
49474 |
+
return getOptionSelected(currentOption, val);
|
49475 |
+
}) !== -1) {
|
49476 |
+
return;
|
49477 |
+
}
|
49478 |
|
49479 |
+
var itemIndex = useAutocomplete_findIndex(filteredOptions, function (optionItem) {
|
49480 |
+
return getOptionSelected(optionItem, valueItem);
|
49481 |
+
});
|
|
|
|
|
|
|
49482 |
|
49483 |
+
if (itemIndex === -1) {
|
49484 |
+
changeHighlightedIndex({
|
49485 |
+
diff: 'reset'
|
49486 |
+
});
|
49487 |
+
} else {
|
49488 |
+
setHighlightedIndex({
|
49489 |
+
index: itemIndex
|
49490 |
+
});
|
49491 |
+
}
|
49492 |
|
49493 |
+
return;
|
49494 |
+
} // Prevent the highlighted index to leak outside the boundaries.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49495 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49496 |
|
49497 |
+
if (highlightedIndexRef.current >= filteredOptions.length - 1) {
|
49498 |
+
setHighlightedIndex({
|
49499 |
+
index: filteredOptions.length - 1
|
49500 |
+
});
|
49501 |
+
return;
|
49502 |
+
} // Restore the focus to the previous index.
|
49503 |
|
|
|
|
|
|
|
|
|
49504 |
|
49505 |
+
setHighlightedIndex({
|
49506 |
+
index: highlightedIndexRef.current
|
49507 |
+
}); // Ignore filteredOptions (and options, getOptionSelected, getOptionLabel) not to break the scroll position
|
49508 |
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
49509 |
+
}, [// Only sync the highlighted index when the option switch between empty and not
|
49510 |
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
49511 |
+
filteredOptions.length === 0, // Don't sync the highlighted index with the value when multiple
|
49512 |
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
49513 |
+
multiple ? false : value, filterSelectedOptions, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]);
|
49514 |
+
var handleListboxRef = (0,useEventCallback/* default */.Z)(function (node) {
|
49515 |
+
(0,setRef/* default */.Z)(listboxRef, node);
|
|
|
|
|
49516 |
|
49517 |
+
if (!node) {
|
49518 |
+
return;
|
49519 |
+
}
|
49520 |
|
49521 |
+
syncHighlightedIndex();
|
49522 |
+
});
|
49523 |
+
react.useEffect(function () {
|
49524 |
+
syncHighlightedIndex();
|
49525 |
+
}, [syncHighlightedIndex]);
|
49526 |
|
49527 |
+
var handleOpen = function handleOpen(event) {
|
49528 |
+
if (open) {
|
49529 |
+
return;
|
49530 |
+
}
|
49531 |
|
49532 |
+
setOpenState(true);
|
|
|
49533 |
|
49534 |
+
if (onOpen) {
|
49535 |
+
onOpen(event);
|
49536 |
+
}
|
49537 |
+
};
|
|
|
|
|
49538 |
|
49539 |
+
var handleClose = function handleClose(event, reason) {
|
49540 |
+
if (!open) {
|
49541 |
+
return;
|
49542 |
+
}
|
49543 |
|
49544 |
+
setOpenState(false);
|
|
|
|
|
|
|
|
|
49545 |
|
49546 |
+
if (onClose) {
|
49547 |
+
onClose(event, reason);
|
49548 |
+
}
|
49549 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
49550 |
|
49551 |
+
var handleValue = function handleValue(event, newValue, reason, details) {
|
49552 |
+
if (value === newValue) {
|
49553 |
+
return;
|
49554 |
+
}
|
49555 |
+
|
49556 |
+
if (onChange) {
|
49557 |
+
onChange(event, newValue, reason, details);
|
49558 |
+
}
|
49559 |
+
|
49560 |
+
setValue(newValue);
|
49561 |
+
};
|
49562 |
+
|
49563 |
+
var isTouch = react.useRef(false);
|
49564 |
+
|
49565 |
+
var selectNewValue = function selectNewValue(event, option) {
|
49566 |
+
var reasonProp = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'select-option';
|
49567 |
+
var origin = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'options';
|
49568 |
+
var reason = reasonProp;
|
49569 |
+
var newValue = option;
|
49570 |
+
|
49571 |
+
if (multiple) {
|
49572 |
+
newValue = Array.isArray(value) ? value.slice() : [];
|
49573 |
+
|
49574 |
+
if (false) { var matches; }
|
49575 |
+
|
49576 |
+
var itemIndex = useAutocomplete_findIndex(newValue, function (valueItem) {
|
49577 |
+
return getOptionSelected(option, valueItem);
|
49578 |
+
});
|
49579 |
+
|
49580 |
+
if (itemIndex === -1) {
|
49581 |
+
newValue.push(option);
|
49582 |
+
} else if (origin !== 'freeSolo') {
|
49583 |
+
newValue.splice(itemIndex, 1);
|
49584 |
+
reason = 'remove-option';
|
49585 |
}
|
49586 |
+
}
|
49587 |
+
|
49588 |
+
resetInputValue(event, newValue);
|
49589 |
+
handleValue(event, newValue, reason, {
|
49590 |
+
option: option
|
49591 |
});
|
49592 |
|
49593 |
+
if (!disableCloseOnSelect) {
|
49594 |
+
handleClose(event, reason);
|
49595 |
+
}
|
49596 |
|
49597 |
+
if (blurOnSelect === true || blurOnSelect === 'touch' && isTouch.current || blurOnSelect === 'mouse' && !isTouch.current) {
|
49598 |
+
inputRef.current.blur();
|
|
|
|
|
49599 |
}
|
49600 |
+
};
|
49601 |
|
49602 |
+
function validTagIndex(index, direction) {
|
49603 |
+
if (index === -1) {
|
49604 |
+
return -1;
|
49605 |
+
}
|
49606 |
|
49607 |
+
var nextFocus = index;
|
|
|
49608 |
|
49609 |
+
while (true) {
|
49610 |
+
// Out of range
|
49611 |
+
if (direction === 'next' && nextFocus === value.length || direction === 'previous' && nextFocus === -1) {
|
49612 |
+
return -1;
|
49613 |
+
}
|
49614 |
|
49615 |
+
var option = anchorEl.querySelector("[data-tag-index=\"".concat(nextFocus, "\"]")); // Same logic as MenuList.js
|
49616 |
+
|
49617 |
+
if (option && (!option.hasAttribute('tabindex') || option.disabled || option.getAttribute('aria-disabled') === 'true')) {
|
49618 |
+
nextFocus += direction === 'next' ? 1 : -1;
|
49619 |
+
} else {
|
49620 |
+
return nextFocus;
|
49621 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49622 |
}
|
49623 |
+
}
|
49624 |
+
|
49625 |
+
var handleFocusTag = function handleFocusTag(event, direction) {
|
49626 |
+
if (!multiple) {
|
49627 |
+
return;
|
49628 |
}
|
49629 |
|
49630 |
+
handleClose(event, 'toggleInput');
|
49631 |
+
var nextTag = focusedTag;
|
|
|
|
|
|
|
49632 |
|
49633 |
+
if (focusedTag === -1) {
|
49634 |
+
if (inputValue === '' && direction === 'previous') {
|
49635 |
+
nextTag = value.length - 1;
|
49636 |
+
}
|
49637 |
+
} else {
|
49638 |
+
nextTag += direction === 'next' ? 1 : -1;
|
49639 |
|
49640 |
+
if (nextTag < 0) {
|
49641 |
+
nextTag = 0;
|
49642 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49643 |
|
49644 |
+
if (nextTag === value.length) {
|
49645 |
+
nextTag = -1;
|
49646 |
+
}
|
49647 |
+
}
|
49648 |
|
49649 |
+
nextTag = validTagIndex(nextTag, direction);
|
49650 |
+
setFocusedTag(nextTag);
|
49651 |
+
focusTag(nextTag);
|
49652 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49653 |
|
49654 |
+
var handleClear = function handleClear(event) {
|
49655 |
+
ignoreFocus.current = true;
|
49656 |
+
setInputValue('');
|
49657 |
+
|
49658 |
+
if (onInputChange) {
|
49659 |
+
onInputChange(event, '', 'clear');
|
49660 |
+
}
|
49661 |
+
|
49662 |
+
handleValue(event, multiple ? [] : null, 'clear');
|
49663 |
+
};
|
49664 |
+
|
49665 |
+
var handleKeyDown = function handleKeyDown(other) {
|
49666 |
+
return function (event) {
|
49667 |
+
if (focusedTag !== -1 && ['ArrowLeft', 'ArrowRight'].indexOf(event.key) === -1) {
|
49668 |
+
setFocusedTag(-1);
|
49669 |
+
focusTag(-1);
|
49670 |
+
}
|
49671 |
|
49672 |
+
switch (event.key) {
|
49673 |
+
case 'Home':
|
49674 |
+
if (popupOpen && handleHomeEndKeys) {
|
49675 |
+
// Prevent scroll of the page
|
49676 |
+
event.preventDefault();
|
49677 |
+
changeHighlightedIndex({
|
49678 |
+
diff: 'start',
|
49679 |
+
direction: 'next',
|
49680 |
+
reason: 'keyboard',
|
49681 |
+
event: event
|
49682 |
+
});
|
49683 |
+
}
|
49684 |
|
49685 |
+
break;
|
|
|
49686 |
|
49687 |
+
case 'End':
|
49688 |
+
if (popupOpen && handleHomeEndKeys) {
|
49689 |
+
// Prevent scroll of the page
|
49690 |
+
event.preventDefault();
|
49691 |
+
changeHighlightedIndex({
|
49692 |
+
diff: 'end',
|
49693 |
+
direction: 'previous',
|
49694 |
+
reason: 'keyboard',
|
49695 |
+
event: event
|
49696 |
+
});
|
49697 |
+
}
|
49698 |
|
49699 |
+
break;
|
49700 |
|
49701 |
+
case 'PageUp':
|
49702 |
+
// Prevent scroll of the page
|
49703 |
+
event.preventDefault();
|
49704 |
+
changeHighlightedIndex({
|
49705 |
+
diff: -pageSize,
|
49706 |
+
direction: 'previous',
|
49707 |
+
reason: 'keyboard',
|
49708 |
+
event: event
|
49709 |
+
});
|
49710 |
+
handleOpen(event);
|
49711 |
+
break;
|
49712 |
|
49713 |
+
case 'PageDown':
|
49714 |
+
// Prevent scroll of the page
|
49715 |
+
event.preventDefault();
|
49716 |
+
changeHighlightedIndex({
|
49717 |
+
diff: pageSize,
|
49718 |
+
direction: 'next',
|
49719 |
+
reason: 'keyboard',
|
49720 |
+
event: event
|
49721 |
+
});
|
49722 |
+
handleOpen(event);
|
49723 |
+
break;
|
49724 |
|
49725 |
+
case 'ArrowDown':
|
49726 |
+
// Prevent cursor move
|
49727 |
+
event.preventDefault();
|
49728 |
+
changeHighlightedIndex({
|
49729 |
+
diff: 1,
|
49730 |
+
direction: 'next',
|
49731 |
+
reason: 'keyboard',
|
49732 |
+
event: event
|
49733 |
+
});
|
49734 |
+
handleOpen(event);
|
49735 |
+
break;
|
49736 |
|
49737 |
+
case 'ArrowUp':
|
49738 |
+
// Prevent cursor move
|
49739 |
+
event.preventDefault();
|
49740 |
+
changeHighlightedIndex({
|
49741 |
+
diff: -1,
|
49742 |
+
direction: 'previous',
|
49743 |
+
reason: 'keyboard',
|
49744 |
+
event: event
|
49745 |
+
});
|
49746 |
+
handleOpen(event);
|
49747 |
+
break;
|
49748 |
|
49749 |
+
case 'ArrowLeft':
|
49750 |
+
handleFocusTag(event, 'previous');
|
49751 |
+
break;
|
49752 |
|
49753 |
+
case 'ArrowRight':
|
49754 |
+
handleFocusTag(event, 'next');
|
49755 |
+
break;
|
49756 |
|
49757 |
+
case 'Enter':
|
49758 |
+
// Wait until IME is settled.
|
49759 |
+
if (event.which === 229) {
|
49760 |
+
break;
|
49761 |
+
}
|
49762 |
|
49763 |
+
if (highlightedIndexRef.current !== -1 && popupOpen) {
|
49764 |
+
var option = filteredOptions[highlightedIndexRef.current];
|
49765 |
+
var disabled = getOptionDisabled ? getOptionDisabled(option) : false; // We don't want to validate the form.
|
49766 |
|
49767 |
+
event.preventDefault();
|
49768 |
|
49769 |
+
if (disabled) {
|
49770 |
+
return;
|
49771 |
+
}
|
49772 |
|
49773 |
+
selectNewValue(event, option, 'select-option'); // Move the selection to the end.
|
|
|
49774 |
|
49775 |
+
if (autoComplete) {
|
49776 |
+
inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);
|
49777 |
+
}
|
49778 |
+
} else if (freeSolo && inputValue !== '' && inputValueIsSelectedValue === false) {
|
49779 |
+
if (multiple) {
|
49780 |
+
// Allow people to add new values before they submit the form.
|
49781 |
+
event.preventDefault();
|
49782 |
+
}
|
49783 |
|
49784 |
+
selectNewValue(event, inputValue, 'create-option', 'freeSolo');
|
49785 |
+
}
|
|
|
49786 |
|
49787 |
+
break;
|
|
|
49788 |
|
49789 |
+
case 'Escape':
|
49790 |
+
if (popupOpen) {
|
49791 |
+
// Avoid Opera to exit fullscreen mode.
|
49792 |
+
event.preventDefault(); // Avoid the Modal to handle the event.
|
49793 |
|
49794 |
+
event.stopPropagation();
|
49795 |
+
handleClose(event, 'escape');
|
49796 |
+
} else if (clearOnEscape && (inputValue !== '' || multiple && value.length > 0)) {
|
49797 |
+
// Avoid Opera to exit fullscreen mode.
|
49798 |
+
event.preventDefault(); // Avoid the Modal to handle the event.
|
49799 |
|
49800 |
+
event.stopPropagation();
|
49801 |
+
handleClear(event);
|
49802 |
+
}
|
|
|
49803 |
|
49804 |
+
break;
|
|
|
|
|
49805 |
|
49806 |
+
case 'Backspace':
|
49807 |
+
if (multiple && inputValue === '' && value.length > 0) {
|
49808 |
+
var index = focusedTag === -1 ? value.length - 1 : focusedTag;
|
49809 |
+
var newValue = value.slice();
|
49810 |
+
newValue.splice(index, 1);
|
49811 |
+
handleValue(event, newValue, 'remove-option', {
|
49812 |
+
option: value[index]
|
49813 |
+
});
|
49814 |
+
}
|
49815 |
|
49816 |
+
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49817 |
|
49818 |
+
default:
|
49819 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49820 |
|
49821 |
+
if (other.onKeyDown) {
|
49822 |
+
other.onKeyDown(event);
|
49823 |
+
}
|
49824 |
+
};
|
49825 |
+
};
|
49826 |
|
49827 |
+
var handleFocus = function handleFocus(event) {
|
49828 |
+
setFocused(true);
|
|
|
|
|
|
|
|
|
49829 |
|
49830 |
+
if (openOnFocus && !ignoreFocus.current) {
|
49831 |
+
handleOpen(event);
|
49832 |
+
}
|
49833 |
+
};
|
49834 |
|
49835 |
+
var handleBlur = function handleBlur(event) {
|
49836 |
+
// Ignore the event when using the scrollbar with IE 11
|
49837 |
+
if (listboxRef.current !== null && document.activeElement === listboxRef.current.parentElement) {
|
49838 |
+
inputRef.current.focus();
|
49839 |
+
return;
|
49840 |
}
|
49841 |
+
|
49842 |
+
setFocused(false);
|
49843 |
+
firstFocus.current = true;
|
49844 |
+
ignoreFocus.current = false;
|
49845 |
+
|
49846 |
+
if (debug && inputValue !== '') {
|
49847 |
return;
|
49848 |
}
|
49849 |
|
49850 |
+
if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen) {
|
49851 |
+
selectNewValue(event, filteredOptions[highlightedIndexRef.current], 'blur');
|
49852 |
+
} else if (autoSelect && freeSolo && inputValue !== '') {
|
49853 |
+
selectNewValue(event, inputValue, 'blur', 'freeSolo');
|
49854 |
+
} else if (clearOnBlur) {
|
49855 |
+
resetInputValue(event, value);
|
49856 |
}
|
49857 |
|
49858 |
+
handleClose(event, 'blur');
|
49859 |
+
};
|
|
|
49860 |
|
49861 |
+
var handleInputChange = function handleInputChange(event) {
|
49862 |
+
var newValue = event.target.value;
|
49863 |
|
49864 |
+
if (inputValue !== newValue) {
|
49865 |
+
setInputValue(newValue);
|
49866 |
|
49867 |
+
if (onInputChange) {
|
49868 |
+
onInputChange(event, newValue, 'input');
|
49869 |
+
}
|
49870 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49871 |
|
49872 |
+
if (newValue === '') {
|
49873 |
+
if (!disableClearable && !multiple) {
|
49874 |
+
handleValue(event, null, 'clear');
|
49875 |
+
}
|
49876 |
+
} else {
|
49877 |
+
handleOpen(event);
|
49878 |
+
}
|
49879 |
};
|
49880 |
|
49881 |
+
var handleOptionMouseOver = function handleOptionMouseOver(event) {
|
49882 |
+
setHighlightedIndex({
|
49883 |
+
event: event,
|
49884 |
+
index: Number(event.currentTarget.getAttribute('data-option-index')),
|
49885 |
+
reason: 'mouse'
|
49886 |
+
});
|
49887 |
+
};
|
49888 |
|
49889 |
+
var handleOptionTouchStart = function handleOptionTouchStart() {
|
49890 |
+
isTouch.current = true;
|
49891 |
};
|
49892 |
|
49893 |
+
var handleOptionClick = function handleOptionClick(event) {
|
49894 |
+
var index = Number(event.currentTarget.getAttribute('data-option-index'));
|
49895 |
+
selectNewValue(event, filteredOptions[index], 'select-option');
|
49896 |
+
isTouch.current = false;
|
49897 |
};
|
49898 |
|
49899 |
+
var handleTagDelete = function handleTagDelete(index) {
|
49900 |
+
return function (event) {
|
49901 |
+
var newValue = value.slice();
|
49902 |
+
newValue.splice(index, 1);
|
49903 |
+
handleValue(event, newValue, 'remove-option', {
|
49904 |
+
option: value[index]
|
49905 |
+
});
|
49906 |
};
|
49907 |
+
};
|
49908 |
+
|
49909 |
+
var handlePopupIndicator = function handlePopupIndicator(event) {
|
49910 |
+
if (open) {
|
49911 |
+
handleClose(event, 'toggleInput');
|
49912 |
+
} else {
|
49913 |
+
handleOpen(event);
|
49914 |
}
|
49915 |
+
}; // Prevent input blur when interacting with the combobox
|
49916 |
|
|
|
|
|
|
|
49917 |
|
49918 |
+
var handleMouseDown = function handleMouseDown(event) {
|
49919 |
+
if (event.target.getAttribute('id') !== id) {
|
49920 |
+
event.preventDefault();
|
49921 |
+
}
|
49922 |
+
}; // Focus the input when interacting with the combobox
|
49923 |
+
|
49924 |
+
|
49925 |
+
var handleClick = function handleClick() {
|
49926 |
+
inputRef.current.focus();
|
49927 |
+
|
49928 |
+
if (selectOnFocus && firstFocus.current && inputRef.current.selectionEnd - inputRef.current.selectionStart === 0) {
|
49929 |
+
inputRef.current.select();
|
49930 |
+
}
|
49931 |
+
|
49932 |
+
firstFocus.current = false;
|
49933 |
};
|
49934 |
|
49935 |
+
var handleInputMouseDown = function handleInputMouseDown(event) {
|
49936 |
+
if (inputValue === '' || !open) {
|
49937 |
+
handlePopupIndicator(event);
|
49938 |
+
}
|
49939 |
+
};
|
49940 |
+
|
49941 |
+
var dirty = freeSolo && inputValue.length > 0;
|
49942 |
+
dirty = dirty || (multiple ? value.length > 0 : value !== null);
|
49943 |
+
var groupedOptions = filteredOptions;
|
49944 |
+
|
49945 |
+
if (groupBy) {
|
49946 |
+
// used to keep track of key and indexes in the result array
|
49947 |
+
var indexBy = new Map();
|
49948 |
+
var warn = false;
|
49949 |
+
groupedOptions = filteredOptions.reduce(function (acc, option, index) {
|
49950 |
+
var group = groupBy(option);
|
49951 |
+
|
49952 |
+
if (acc.length > 0 && acc[acc.length - 1].group === group) {
|
49953 |
+
acc[acc.length - 1].options.push(option);
|
49954 |
+
} else {
|
49955 |
+
if (false) {}
|
49956 |
+
|
49957 |
+
acc.push({
|
49958 |
+
key: index,
|
49959 |
+
index: index,
|
49960 |
+
group: group,
|
49961 |
+
options: [option]
|
49962 |
+
});
|
49963 |
+
}
|
49964 |
+
|
49965 |
+
return acc;
|
49966 |
+
}, []);
|
49967 |
}
|
49968 |
|
49969 |
+
return {
|
49970 |
+
getRootProps: function getRootProps() {
|
49971 |
+
var other = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
49972 |
+
return (0,esm_extends/* default */.Z)({
|
49973 |
+
'aria-owns': popupOpen ? "".concat(id, "-popup") : null,
|
49974 |
+
role: 'combobox',
|
49975 |
+
'aria-expanded': popupOpen
|
49976 |
+
}, other, {
|
49977 |
+
onKeyDown: handleKeyDown(other),
|
49978 |
+
onMouseDown: handleMouseDown,
|
49979 |
+
onClick: handleClick
|
49980 |
+
});
|
49981 |
+
},
|
49982 |
+
getInputLabelProps: function getInputLabelProps() {
|
49983 |
+
return {
|
49984 |
+
id: "".concat(id, "-label"),
|
49985 |
+
htmlFor: id
|
49986 |
+
};
|
49987 |
+
},
|
49988 |
+
getInputProps: function getInputProps() {
|
49989 |
+
return {
|
49990 |
+
id: id,
|
49991 |
+
value: inputValue,
|
49992 |
+
onBlur: handleBlur,
|
49993 |
+
onFocus: handleFocus,
|
49994 |
+
onChange: handleInputChange,
|
49995 |
+
onMouseDown: handleInputMouseDown,
|
49996 |
+
// if open then this is handled imperativeley so don't let react override
|
49997 |
+
// only have an opinion about this when closed
|
49998 |
+
'aria-activedescendant': popupOpen ? '' : null,
|
49999 |
+
'aria-autocomplete': autoComplete ? 'both' : 'list',
|
50000 |
+
'aria-controls': popupOpen ? "".concat(id, "-popup") : null,
|
50001 |
+
// Disable browser's suggestion that might overlap with the popup.
|
50002 |
+
// Handle autocomplete but not autofill.
|
50003 |
+
autoComplete: 'off',
|
50004 |
+
ref: inputRef,
|
50005 |
+
autoCapitalize: 'none',
|
50006 |
+
spellCheck: 'false'
|
50007 |
+
};
|
50008 |
+
},
|
50009 |
+
getClearProps: function getClearProps() {
|
50010 |
+
return {
|
50011 |
+
tabIndex: -1,
|
50012 |
+
onClick: handleClear
|
50013 |
+
};
|
50014 |
+
},
|
50015 |
+
getPopupIndicatorProps: function getPopupIndicatorProps() {
|
50016 |
+
return {
|
50017 |
+
tabIndex: -1,
|
50018 |
+
onClick: handlePopupIndicator
|
50019 |
+
};
|
50020 |
+
},
|
50021 |
+
getTagProps: function getTagProps(_ref4) {
|
50022 |
+
var index = _ref4.index;
|
50023 |
+
return {
|
50024 |
+
key: index,
|
50025 |
+
'data-tag-index': index,
|
50026 |
+
tabIndex: -1,
|
50027 |
+
onDelete: handleTagDelete(index)
|
50028 |
+
};
|
50029 |
+
},
|
50030 |
+
getListboxProps: function getListboxProps() {
|
50031 |
+
return {
|
50032 |
+
role: 'listbox',
|
50033 |
+
id: "".concat(id, "-popup"),
|
50034 |
+
'aria-labelledby': "".concat(id, "-label"),
|
50035 |
+
ref: handleListboxRef,
|
50036 |
+
onMouseDown: function onMouseDown(event) {
|
50037 |
+
// Prevent blur
|
50038 |
+
event.preventDefault();
|
50039 |
+
}
|
50040 |
+
};
|
50041 |
+
},
|
50042 |
+
getOptionProps: function getOptionProps(_ref5) {
|
50043 |
+
var index = _ref5.index,
|
50044 |
+
option = _ref5.option;
|
50045 |
+
var selected = (multiple ? value : [value]).some(function (value2) {
|
50046 |
+
return value2 != null && getOptionSelected(option, value2);
|
50047 |
+
});
|
50048 |
+
var disabled = getOptionDisabled ? getOptionDisabled(option) : false;
|
50049 |
+
return {
|
50050 |
+
key: index,
|
50051 |
+
tabIndex: -1,
|
50052 |
+
role: 'option',
|
50053 |
+
id: "".concat(id, "-option-").concat(index),
|
50054 |
+
onMouseOver: handleOptionMouseOver,
|
50055 |
+
onClick: handleOptionClick,
|
50056 |
+
onTouchStart: handleOptionTouchStart,
|
50057 |
+
'data-option-index': index,
|
50058 |
+
'aria-disabled': disabled,
|
50059 |
+
'aria-selected': selected
|
50060 |
+
};
|
50061 |
+
},
|
50062 |
+
id: id,
|
50063 |
+
inputValue: inputValue,
|
50064 |
+
value: value,
|
50065 |
+
dirty: dirty,
|
50066 |
+
popupOpen: popupOpen,
|
50067 |
+
focused: focused || focusedTag !== -1,
|
50068 |
+
anchorEl: anchorEl,
|
50069 |
+
setAnchorEl: setAnchorEl,
|
50070 |
+
focusedTag: focusedTag,
|
50071 |
+
groupedOptions: groupedOptions
|
50072 |
+
};
|
50073 |
+
}
|
50074 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/lab/esm/Autocomplete/Autocomplete.js
|
50075 |
+
|
50076 |
+
|
50077 |
|
50078 |
|
50079 |
|
50081 |
|
50082 |
|
50083 |
|
50084 |
+
|
50085 |
+
|
50086 |
+
|
50087 |
+
|
50088 |
+
|
50089 |
+
|
50090 |
+
|
50091 |
+
var Autocomplete_styles = function styles(theme) {
|
50092 |
+
var _option;
|
50093 |
+
|
50094 |
return {
|
50095 |
/* Styles applied to the root element. */
|
50096 |
root: {
|
50097 |
+
'&$focused $clearIndicatorDirty': {
|
50098 |
+
visibility: 'visible'
|
50099 |
+
},
|
|
|
|
|
|
|
|
|
|
|
50100 |
|
50101 |
+
/* Avoid double tap issue on iOS */
|
50102 |
+
'@media (pointer: fine)': {
|
50103 |
+
'&:hover $clearIndicatorDirty': {
|
50104 |
+
visibility: 'visible'
|
50105 |
+
}
|
50106 |
+
}
|
50107 |
},
|
50108 |
|
50109 |
+
/* Styles applied to the root element if `fullWidth={true}`. */
|
50110 |
+
fullWidth: {
|
50111 |
+
width: '100%'
|
50112 |
},
|
50113 |
|
50114 |
+
/* Pseudo-class applied to the root element if focused. */
|
50115 |
+
focused: {},
|
50116 |
+
|
50117 |
+
/* Styles applied to the tag elements, e.g. the chips. */
|
50118 |
+
tag: {
|
50119 |
+
margin: 3,
|
50120 |
+
maxWidth: 'calc(100% - 6px)'
|
50121 |
},
|
50122 |
|
50123 |
+
/* Styles applied to the tag elements, e.g. the chips if `size="small"`. */
|
50124 |
+
tagSizeSmall: {
|
50125 |
+
margin: 2,
|
50126 |
+
maxWidth: 'calc(100% - 4px)'
|
50127 |
},
|
50128 |
|
50129 |
+
/* Styles applied when the popup icon is rendered. */
|
50130 |
+
hasPopupIcon: {},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50131 |
|
50132 |
+
/* Styles applied when the clear icon is rendered. */
|
50133 |
+
hasClearIcon: {},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50134 |
|
50135 |
+
/* Styles applied to the Input element. */
|
50136 |
+
inputRoot: {
|
50137 |
+
flexWrap: 'wrap',
|
50138 |
+
'$hasPopupIcon &, $hasClearIcon &': {
|
50139 |
+
paddingRight: 26 + 4
|
50140 |
+
},
|
50141 |
+
'$hasPopupIcon$hasClearIcon &': {
|
50142 |
+
paddingRight: 52 + 4
|
50143 |
+
},
|
50144 |
+
'& $input': {
|
50145 |
+
width: 0,
|
50146 |
+
minWidth: 30
|
50147 |
+
},
|
50148 |
+
'&[class*="MuiInput-root"]': {
|
50149 |
+
paddingBottom: 1,
|
50150 |
+
'& $input': {
|
50151 |
+
padding: 4
|
50152 |
+
},
|
50153 |
+
'& $input:first-child': {
|
50154 |
+
padding: '6px 0'
|
50155 |
+
}
|
50156 |
+
},
|
50157 |
+
'&[class*="MuiInput-root"][class*="MuiInput-marginDense"]': {
|
50158 |
+
'& $input': {
|
50159 |
+
padding: '4px 4px 5px'
|
50160 |
+
},
|
50161 |
+
'& $input:first-child': {
|
50162 |
+
padding: '3px 0 6px'
|
50163 |
+
}
|
50164 |
+
},
|
50165 |
+
'&[class*="MuiOutlinedInput-root"]': {
|
50166 |
+
padding: 9,
|
50167 |
+
'$hasPopupIcon &, $hasClearIcon &': {
|
50168 |
+
paddingRight: 26 + 4 + 9
|
50169 |
+
},
|
50170 |
+
'$hasPopupIcon$hasClearIcon &': {
|
50171 |
+
paddingRight: 52 + 4 + 9
|
50172 |
+
},
|
50173 |
+
'& $input': {
|
50174 |
+
padding: '9.5px 4px'
|
50175 |
+
},
|
50176 |
+
'& $input:first-child': {
|
50177 |
+
paddingLeft: 6
|
50178 |
+
},
|
50179 |
+
'& $endAdornment': {
|
50180 |
+
right: 9
|
50181 |
+
}
|
50182 |
+
},
|
50183 |
+
'&[class*="MuiOutlinedInput-root"][class*="MuiOutlinedInput-marginDense"]': {
|
50184 |
+
padding: 6,
|
50185 |
+
'& $input': {
|
50186 |
+
padding: '4.5px 4px'
|
50187 |
+
}
|
50188 |
+
},
|
50189 |
+
'&[class*="MuiFilledInput-root"]': {
|
50190 |
+
paddingTop: 19,
|
50191 |
+
paddingLeft: 8,
|
50192 |
+
'$hasPopupIcon &, $hasClearIcon &': {
|
50193 |
+
paddingRight: 26 + 4 + 9
|
50194 |
+
},
|
50195 |
+
'$hasPopupIcon$hasClearIcon &': {
|
50196 |
+
paddingRight: 52 + 4 + 9
|
50197 |
+
},
|
50198 |
+
'& $input': {
|
50199 |
+
padding: '9px 4px'
|
50200 |
+
},
|
50201 |
+
'& $endAdornment': {
|
50202 |
+
right: 9
|
50203 |
+
}
|
50204 |
+
},
|
50205 |
+
'&[class*="MuiFilledInput-root"][class*="MuiFilledInput-marginDense"]': {
|
50206 |
+
paddingBottom: 1,
|
50207 |
+
'& $input': {
|
50208 |
+
padding: '4.5px 4px'
|
50209 |
+
}
|
50210 |
+
}
|
50211 |
+
},
|
50212 |
|
50213 |
+
/* Styles applied to the input element. */
|
50214 |
+
input: {
|
50215 |
+
flexGrow: 1,
|
50216 |
+
textOverflow: 'ellipsis',
|
50217 |
+
opacity: 0
|
50218 |
+
},
|
50219 |
|
50220 |
+
/* Styles applied to the input element if tag focused. */
|
50221 |
+
inputFocused: {
|
50222 |
+
opacity: 1
|
50223 |
+
},
|
50224 |
|
50225 |
+
/* Styles applied to the endAdornment element. */
|
50226 |
+
endAdornment: {
|
50227 |
+
// We use a position absolute to support wrapping tags.
|
50228 |
+
position: 'absolute',
|
50229 |
+
right: 0,
|
50230 |
+
top: 'calc(50% - 14px)' // Center vertically
|
50231 |
|
50232 |
+
},
|
|
|
|
|
50233 |
|
50234 |
+
/* Styles applied to the clear indicator. */
|
50235 |
+
clearIndicator: {
|
50236 |
+
marginRight: -2,
|
50237 |
+
padding: 4,
|
50238 |
+
visibility: 'hidden'
|
50239 |
+
},
|
50240 |
|
50241 |
+
/* Styles applied to the clear indicator if the input is dirty. */
|
50242 |
+
clearIndicatorDirty: {},
|
50243 |
|
50244 |
+
/* Styles applied to the popup indicator. */
|
50245 |
+
popupIndicator: {
|
50246 |
+
padding: 2,
|
50247 |
+
marginRight: -2
|
50248 |
+
},
|
50249 |
|
50250 |
+
/* Styles applied to the popup indicator if the popup is open. */
|
50251 |
+
popupIndicatorOpen: {
|
50252 |
+
transform: 'rotate(180deg)'
|
50253 |
+
},
|
50254 |
|
50255 |
+
/* Styles applied to the popper element. */
|
50256 |
+
popper: {
|
50257 |
+
zIndex: theme.zIndex.modal
|
50258 |
+
},
|
50259 |
|
50260 |
+
/* Styles applied to the popper element if `disablePortal={true}`. */
|
50261 |
+
popperDisablePortal: {
|
50262 |
+
position: 'absolute'
|
50263 |
+
},
|
50264 |
|
50265 |
+
/* Styles applied to the `Paper` component. */
|
50266 |
+
paper: (0,esm_extends/* default */.Z)({}, theme.typography.body1, {
|
50267 |
+
overflow: 'hidden',
|
50268 |
+
margin: '4px 0'
|
50269 |
+
}),
|
50270 |
|
50271 |
+
/* Styles applied to the `listbox` component. */
|
50272 |
+
listbox: {
|
50273 |
+
listStyle: 'none',
|
50274 |
+
margin: 0,
|
50275 |
+
padding: '8px 0',
|
50276 |
+
maxHeight: '40vh',
|
50277 |
+
overflow: 'auto'
|
50278 |
+
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50279 |
|
50280 |
+
/* Styles applied to the loading wrapper. */
|
50281 |
+
loading: {
|
50282 |
+
color: theme.palette.text.secondary,
|
50283 |
+
padding: '14px 16px'
|
50284 |
+
},
|
50285 |
|
50286 |
+
/* Styles applied to the no option wrapper. */
|
50287 |
+
noOptions: {
|
50288 |
+
color: theme.palette.text.secondary,
|
50289 |
+
padding: '14px 16px'
|
50290 |
+
},
|
50291 |
|
50292 |
+
/* Styles applied to the option elements. */
|
50293 |
+
option: (_option = {
|
50294 |
+
minHeight: 48,
|
50295 |
+
display: 'flex',
|
50296 |
+
justifyContent: 'flex-start',
|
50297 |
+
alignItems: 'center',
|
50298 |
+
cursor: 'pointer',
|
50299 |
+
paddingTop: 6,
|
50300 |
+
boxSizing: 'border-box',
|
50301 |
+
outline: '0',
|
50302 |
+
WebkitTapHighlightColor: 'transparent',
|
50303 |
+
paddingBottom: 6,
|
50304 |
+
paddingLeft: 16,
|
50305 |
+
paddingRight: 16
|
50306 |
+
}, (0,defineProperty/* default */.Z)(_option, theme.breakpoints.up('sm'), {
|
50307 |
+
minHeight: 'auto'
|
50308 |
+
}), (0,defineProperty/* default */.Z)(_option, '&[aria-selected="true"]', {
|
50309 |
+
backgroundColor: theme.palette.action.selected
|
50310 |
+
}), (0,defineProperty/* default */.Z)(_option, '&[data-focus="true"]', {
|
50311 |
+
backgroundColor: theme.palette.action.hover
|
50312 |
+
}), (0,defineProperty/* default */.Z)(_option, '&:active', {
|
50313 |
+
backgroundColor: theme.palette.action.selected
|
50314 |
+
}), (0,defineProperty/* default */.Z)(_option, '&[aria-disabled="true"]', {
|
50315 |
+
opacity: theme.palette.action.disabledOpacity,
|
50316 |
+
pointerEvents: 'none'
|
50317 |
+
}), _option),
|
50318 |
|
50319 |
+
/* Styles applied to the group's label elements. */
|
50320 |
+
groupLabel: {
|
50321 |
+
backgroundColor: theme.palette.background.paper,
|
50322 |
+
top: -8
|
50323 |
+
},
|
50324 |
|
50325 |
+
/* Styles applied to the group's ul elements. */
|
50326 |
+
groupUl: {
|
50327 |
+
padding: 0,
|
50328 |
+
'& $option': {
|
50329 |
+
paddingLeft: 24
|
50330 |
}
|
50331 |
+
}
|
|
|
|
|
|
|
50332 |
};
|
50333 |
+
};
|
50334 |
|
50335 |
+
function DisablePortal(props) {
|
50336 |
+
// eslint-disable-next-line react/prop-types
|
50337 |
+
var anchorEl = props.anchorEl,
|
50338 |
+
open = props.open,
|
50339 |
+
other = (0,objectWithoutProperties/* default */.Z)(props, ["anchorEl", "open"]);
|
|
|
50340 |
|
50341 |
+
return /*#__PURE__*/react.createElement("div", other);
|
50342 |
}
|
50343 |
|
50344 |
+
var Autocomplete_ref = /*#__PURE__*/react.createElement(Close, {
|
50345 |
+
fontSize: "small"
|
50346 |
+
});
|
50347 |
|
50348 |
+
var Autocomplete_ref2 = /*#__PURE__*/react.createElement(svg_icons_ArrowDropDown, null);
|
50349 |
+
|
50350 |
+
var Autocomplete = /*#__PURE__*/react.forwardRef(function Autocomplete(props, ref) {
|
50351 |
+
/* eslint-disable no-unused-vars */
|
50352 |
var _props$autoComplete = props.autoComplete,
|
50353 |
autoComplete = _props$autoComplete === void 0 ? false : _props$autoComplete,
|
50354 |
_props$autoHighlight = props.autoHighlight,
|
50357 |
autoSelect = _props$autoSelect === void 0 ? false : _props$autoSelect,
|
50358 |
_props$blurOnSelect = props.blurOnSelect,
|
50359 |
blurOnSelect = _props$blurOnSelect === void 0 ? false : _props$blurOnSelect,
|
50360 |
+
ChipProps = props.ChipProps,
|
50361 |
+
classes = props.classes,
|
50362 |
+
className = props.className,
|
50363 |
_props$clearOnBlur = props.clearOnBlur,
|
50364 |
clearOnBlur = _props$clearOnBlur === void 0 ? !props.freeSolo : _props$clearOnBlur,
|
50365 |
_props$clearOnEscape = props.clearOnEscape,
|
50366 |
clearOnEscape = _props$clearOnEscape === void 0 ? false : _props$clearOnEscape,
|
50367 |
+
_props$clearText = props.clearText,
|
50368 |
+
clearText = _props$clearText === void 0 ? 'Clear' : _props$clearText,
|
50369 |
+
_props$closeIcon = props.closeIcon,
|
50370 |
+
closeIcon = _props$closeIcon === void 0 ? Autocomplete_ref : _props$closeIcon,
|
50371 |
+
_props$closeText = props.closeText,
|
50372 |
+
closeText = _props$closeText === void 0 ? 'Close' : _props$closeText,
|
50373 |
_props$debug = props.debug,
|
50374 |
debug = _props$debug === void 0 ? false : _props$debug,
|
50375 |
_props$defaultValue = props.defaultValue,
|
50378 |
disableClearable = _props$disableClearab === void 0 ? false : _props$disableClearab,
|
50379 |
_props$disableCloseOn = props.disableCloseOnSelect,
|
50380 |
disableCloseOnSelect = _props$disableCloseOn === void 0 ? false : _props$disableCloseOn,
|
50381 |
+
_props$disabled = props.disabled,
|
50382 |
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
50383 |
_props$disabledItemsF = props.disabledItemsFocusable,
|
50384 |
disabledItemsFocusable = _props$disabledItemsF === void 0 ? false : _props$disabledItemsF,
|
50385 |
_props$disableListWra = props.disableListWrap,
|
50386 |
disableListWrap = _props$disableListWra === void 0 ? false : _props$disableListWra,
|
50387 |
+
_props$disablePortal = props.disablePortal,
|
50388 |
+
disablePortal = _props$disablePortal === void 0 ? false : _props$disablePortal,
|
50389 |
+
filterOptions = props.filterOptions,
|
50390 |
_props$filterSelected = props.filterSelectedOptions,
|
50391 |
filterSelectedOptions = _props$filterSelected === void 0 ? false : _props$filterSelected,
|
50392 |
+
_props$forcePopupIcon = props.forcePopupIcon,
|
50393 |
+
forcePopupIcon = _props$forcePopupIcon === void 0 ? 'auto' : _props$forcePopupIcon,
|
50394 |
_props$freeSolo = props.freeSolo,
|
50395 |
freeSolo = _props$freeSolo === void 0 ? false : _props$freeSolo,
|
50396 |
+
_props$fullWidth = props.fullWidth,
|
50397 |
+
fullWidth = _props$fullWidth === void 0 ? false : _props$fullWidth,
|
50398 |
+
_props$getLimitTagsTe = props.getLimitTagsText,
|
50399 |
+
getLimitTagsText = _props$getLimitTagsTe === void 0 ? function (more) {
|
50400 |
+
return "+".concat(more);
|
50401 |
+
} : _props$getLimitTagsTe,
|
50402 |
getOptionDisabled = props.getOptionDisabled,
|
50403 |
_props$getOptionLabel = props.getOptionLabel,
|
50404 |
+
getOptionLabel = _props$getOptionLabel === void 0 ? function (x) {
|
50405 |
+
return x;
|
50406 |
} : _props$getOptionLabel,
|
50407 |
+
getOptionSelected = props.getOptionSelected,
|
|
|
|
|
|
|
50408 |
groupBy = props.groupBy,
|
50409 |
_props$handleHomeEndK = props.handleHomeEndKeys,
|
50410 |
handleHomeEndKeys = _props$handleHomeEndK === void 0 ? !props.freeSolo : _props$handleHomeEndK,
|
50412 |
_props$includeInputIn = props.includeInputInList,
|
50413 |
includeInputInList = _props$includeInputIn === void 0 ? false : _props$includeInputIn,
|
50414 |
inputValueProp = props.inputValue,
|
50415 |
+
_props$limitTags = props.limitTags,
|
50416 |
+
limitTags = _props$limitTags === void 0 ? -1 : _props$limitTags,
|
50417 |
+
_props$ListboxCompone = props.ListboxComponent,
|
50418 |
+
ListboxComponent = _props$ListboxCompone === void 0 ? 'ul' : _props$ListboxCompone,
|
50419 |
+
ListboxProps = props.ListboxProps,
|
50420 |
+
_props$loading = props.loading,
|
50421 |
+
loading = _props$loading === void 0 ? false : _props$loading,
|
50422 |
+
_props$loadingText = props.loadingText,
|
50423 |
+
loadingText = _props$loadingText === void 0 ? 'Loading…' : _props$loadingText,
|
50424 |
_props$multiple = props.multiple,
|
50425 |
multiple = _props$multiple === void 0 ? false : _props$multiple,
|
50426 |
+
_props$noOptionsText = props.noOptionsText,
|
50427 |
+
noOptionsText = _props$noOptionsText === void 0 ? 'No options' : _props$noOptionsText,
|
50428 |
onChange = props.onChange,
|
50429 |
onClose = props.onClose,
|
50430 |
onHighlightChange = props.onHighlightChange,
|
50431 |
onInputChange = props.onInputChange,
|
50432 |
onOpen = props.onOpen,
|
50433 |
+
open = props.open,
|
50434 |
_props$openOnFocus = props.openOnFocus,
|
50435 |
openOnFocus = _props$openOnFocus === void 0 ? false : _props$openOnFocus,
|
50436 |
+
_props$openText = props.openText,
|
50437 |
+
openText = _props$openText === void 0 ? 'Open' : _props$openText,
|
50438 |
options = props.options,
|
50439 |
+
_props$PaperComponent = props.PaperComponent,
|
50440 |
+
PaperComponent = _props$PaperComponent === void 0 ? Paper_Paper : _props$PaperComponent,
|
50441 |
+
_props$PopperComponen = props.PopperComponent,
|
50442 |
+
PopperComponentProp = _props$PopperComponen === void 0 ? esm_Popper_Popper : _props$PopperComponen,
|
50443 |
+
_props$popupIcon = props.popupIcon,
|
50444 |
+
popupIcon = _props$popupIcon === void 0 ? Autocomplete_ref2 : _props$popupIcon,
|
50445 |
+
renderGroupProp = props.renderGroup,
|
50446 |
+
renderInput = props.renderInput,
|
50447 |
+
renderOptionProp = props.renderOption,
|
50448 |
+
renderTags = props.renderTags,
|
50449 |
_props$selectOnFocus = props.selectOnFocus,
|
50450 |
selectOnFocus = _props$selectOnFocus === void 0 ? !props.freeSolo : _props$selectOnFocus,
|
50451 |
+
_props$size = props.size,
|
50452 |
+
size = _props$size === void 0 ? 'medium' : _props$size,
|
50453 |
+
valueProp = props.value,
|
50454 |
+
other = (0,objectWithoutProperties/* default */.Z)(props, ["autoComplete", "autoHighlight", "autoSelect", "blurOnSelect", "ChipProps", "classes", "className", "clearOnBlur", "clearOnEscape", "clearText", "closeIcon", "closeText", "debug", "defaultValue", "disableClearable", "disableCloseOnSelect", "disabled", "disabledItemsFocusable", "disableListWrap", "disablePortal", "filterOptions", "filterSelectedOptions", "forcePopupIcon", "freeSolo", "fullWidth", "getLimitTagsText", "getOptionDisabled", "getOptionLabel", "getOptionSelected", "groupBy", "handleHomeEndKeys", "id", "includeInputInList", "inputValue", "limitTags", "ListboxComponent", "ListboxProps", "loading", "loadingText", "multiple", "noOptionsText", "onChange", "onClose", "onHighlightChange", "onInputChange", "onOpen", "open", "openOnFocus", "openText", "options", "PaperComponent", "PopperComponent", "popupIcon", "renderGroup", "renderInput", "renderOption", "renderTags", "selectOnFocus", "size", "value"]);
|
50455 |
+
/* eslint-enable no-unused-vars */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50456 |
|
|
|
|
|
50457 |
|
50458 |
+
var PopperComponent = disablePortal ? DisablePortal : PopperComponentProp;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50459 |
|
50460 |
+
var _useAutocomplete = useAutocomplete((0,esm_extends/* default */.Z)({}, props, {
|
50461 |
+
componentName: 'Autocomplete'
|
50462 |
+
})),
|
50463 |
+
getRootProps = _useAutocomplete.getRootProps,
|
50464 |
+
getInputProps = _useAutocomplete.getInputProps,
|
50465 |
+
getInputLabelProps = _useAutocomplete.getInputLabelProps,
|
50466 |
+
getPopupIndicatorProps = _useAutocomplete.getPopupIndicatorProps,
|
50467 |
+
getClearProps = _useAutocomplete.getClearProps,
|
50468 |
+
getTagProps = _useAutocomplete.getTagProps,
|
50469 |
+
getListboxProps = _useAutocomplete.getListboxProps,
|
50470 |
+
getOptionProps = _useAutocomplete.getOptionProps,
|
50471 |
+
value = _useAutocomplete.value,
|
50472 |
+
dirty = _useAutocomplete.dirty,
|
50473 |
+
id = _useAutocomplete.id,
|
50474 |
+
popupOpen = _useAutocomplete.popupOpen,
|
50475 |
+
focused = _useAutocomplete.focused,
|
50476 |
+
focusedTag = _useAutocomplete.focusedTag,
|
50477 |
+
anchorEl = _useAutocomplete.anchorEl,
|
50478 |
+
setAnchorEl = _useAutocomplete.setAnchorEl,
|
50479 |
+
inputValue = _useAutocomplete.inputValue,
|
50480 |
+
groupedOptions = _useAutocomplete.groupedOptions;
|
50481 |
|
50482 |
+
var startAdornment;
|
|
|
|
|
50483 |
|
50484 |
+
if (multiple && value.length > 0) {
|
50485 |
+
var getCustomizedTagProps = function getCustomizedTagProps(params) {
|
50486 |
+
return (0,esm_extends/* default */.Z)({
|
50487 |
+
className: (0,clsx_m/* default */.Z)(classes.tag, size === 'small' && classes.tagSizeSmall),
|
50488 |
+
disabled: disabled
|
50489 |
+
}, getTagProps(params));
|
50490 |
+
};
|
50491 |
|
50492 |
+
if (renderTags) {
|
50493 |
+
startAdornment = renderTags(value, getCustomizedTagProps);
|
|
|
|
|
50494 |
} else {
|
50495 |
+
startAdornment = value.map(function (option, index) {
|
50496 |
+
return /*#__PURE__*/react.createElement(Chip_Chip, (0,esm_extends/* default */.Z)({
|
50497 |
+
label: getOptionLabel(option),
|
50498 |
+
size: size
|
50499 |
+
}, getCustomizedTagProps({
|
50500 |
+
index: index
|
50501 |
+
}), ChipProps));
|
50502 |
+
});
|
|
|
|
|
|
|
|
|
50503 |
}
|
50504 |
+
}
|
|
|
|
|
|
|
50505 |
|
50506 |
+
if (limitTags > -1 && Array.isArray(startAdornment)) {
|
50507 |
+
var more = startAdornment.length - limitTags;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50508 |
|
50509 |
+
if (!focused && more > 0) {
|
50510 |
+
startAdornment = startAdornment.splice(0, limitTags);
|
50511 |
+
startAdornment.push( /*#__PURE__*/react.createElement("span", {
|
50512 |
+
className: classes.tag,
|
50513 |
+
key: startAdornment.length
|
50514 |
+
}, getLimitTagsText(more)));
|
|
|
50515 |
}
|
50516 |
+
}
|
50517 |
|
50518 |
+
var defaultRenderGroup = function defaultRenderGroup(params) {
|
50519 |
+
return /*#__PURE__*/react.createElement("li", {
|
50520 |
+
key: params.key
|
50521 |
+
}, /*#__PURE__*/react.createElement(ListSubheader_ListSubheader, {
|
50522 |
+
className: classes.groupLabel,
|
50523 |
+
component: "div"
|
50524 |
+
}, params.group), /*#__PURE__*/react.createElement("ul", {
|
50525 |
+
className: classes.groupUl
|
50526 |
+
}, params.children));
|
50527 |
+
};
|
50528 |
|
50529 |
+
var renderGroup = renderGroupProp || defaultRenderGroup;
|
50530 |
+
var renderOption = renderOptionProp || getOptionLabel;
|
50531 |
|
50532 |
+
var renderListOption = function renderListOption(option, index) {
|
50533 |
+
var optionProps = getOptionProps({
|
50534 |
+
option: option,
|
50535 |
+
index: index
|
50536 |
+
});
|
50537 |
+
return /*#__PURE__*/react.createElement("li", (0,esm_extends/* default */.Z)({}, optionProps, {
|
50538 |
+
className: classes.option
|
50539 |
+
}), renderOption(option, {
|
50540 |
+
selected: optionProps['aria-selected'],
|
50541 |
+
inputValue: inputValue
|
50542 |
+
}));
|
50543 |
+
};
|
50544 |
|
50545 |
+
var hasClearIcon = !disableClearable && !disabled;
|
50546 |
+
var hasPopupIcon = (!freeSolo || forcePopupIcon === true) && forcePopupIcon !== false;
|
50547 |
+
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
50548 |
+
ref: ref,
|
50549 |
+
className: (0,clsx_m/* default */.Z)(classes.root, className, focused && classes.focused, fullWidth && classes.fullWidth, hasClearIcon && classes.hasClearIcon, hasPopupIcon && classes.hasPopupIcon)
|
50550 |
+
}, getRootProps(other)), renderInput({
|
50551 |
+
id: id,
|
50552 |
+
disabled: disabled,
|
50553 |
+
fullWidth: true,
|
50554 |
+
size: size === 'small' ? 'small' : undefined,
|
50555 |
+
InputLabelProps: getInputLabelProps(),
|
50556 |
+
InputProps: {
|
50557 |
+
ref: setAnchorEl,
|
50558 |
+
className: classes.inputRoot,
|
50559 |
+
startAdornment: startAdornment,
|
50560 |
+
endAdornment: /*#__PURE__*/react.createElement("div", {
|
50561 |
+
className: classes.endAdornment
|
50562 |
+
}, hasClearIcon ? /*#__PURE__*/react.createElement(IconButton_IconButton, (0,esm_extends/* default */.Z)({}, getClearProps(), {
|
50563 |
+
"aria-label": clearText,
|
50564 |
+
title: clearText,
|
50565 |
+
className: (0,clsx_m/* default */.Z)(classes.clearIndicator, dirty && classes.clearIndicatorDirty)
|
50566 |
+
}), closeIcon) : null, hasPopupIcon ? /*#__PURE__*/react.createElement(IconButton_IconButton, (0,esm_extends/* default */.Z)({}, getPopupIndicatorProps(), {
|
50567 |
+
disabled: disabled,
|
50568 |
+
"aria-label": popupOpen ? closeText : openText,
|
50569 |
+
title: popupOpen ? closeText : openText,
|
50570 |
+
className: (0,clsx_m/* default */.Z)(classes.popupIndicator, popupOpen && classes.popupIndicatorOpen)
|
50571 |
+
}), popupIcon) : null)
|
50572 |
+
},
|
50573 |
+
inputProps: (0,esm_extends/* default */.Z)({
|
50574 |
+
className: (0,clsx_m/* default */.Z)(classes.input, focusedTag === -1 && classes.inputFocused),
|
50575 |
+
disabled: disabled
|
50576 |
+
}, getInputProps())
|
50577 |
+
})), popupOpen && anchorEl ? /*#__PURE__*/react.createElement(PopperComponent, {
|
50578 |
+
className: (0,clsx_m/* default */.Z)(classes.popper, disablePortal && classes.popperDisablePortal),
|
50579 |
+
style: {
|
50580 |
+
width: anchorEl ? anchorEl.clientWidth : null
|
50581 |
+
},
|
50582 |
+
role: "presentation",
|
50583 |
+
anchorEl: anchorEl,
|
50584 |
+
open: true
|
50585 |
+
}, /*#__PURE__*/react.createElement(PaperComponent, {
|
50586 |
+
className: classes.paper
|
50587 |
+
}, loading && groupedOptions.length === 0 ? /*#__PURE__*/react.createElement("div", {
|
50588 |
+
className: classes.loading
|
50589 |
+
}, loadingText) : null, groupedOptions.length === 0 && !freeSolo && !loading ? /*#__PURE__*/react.createElement("div", {
|
50590 |
+
className: classes.noOptions
|
50591 |
+
}, noOptionsText) : null, groupedOptions.length > 0 ? /*#__PURE__*/react.createElement(ListboxComponent, (0,esm_extends/* default */.Z)({
|
50592 |
+
className: classes.listbox
|
50593 |
+
}, getListboxProps(), ListboxProps), groupedOptions.map(function (option, index) {
|
50594 |
+
if (groupBy) {
|
50595 |
+
return renderGroup({
|
50596 |
+
key: option.key,
|
50597 |
+
group: option.group,
|
50598 |
+
children: option.options.map(function (option2, index2) {
|
50599 |
+
return renderListOption(option2, option.index + index2);
|
50600 |
+
})
|
50601 |
+
});
|
50602 |
}
|
|
|
50603 |
|
50604 |
+
return renderListOption(option, index);
|
50605 |
+
})) : null)) : null);
|
50606 |
+
});
|
50607 |
+
false ? 0 : void 0;
|
50608 |
+
/* harmony default export */ var Autocomplete_Autocomplete = ((0,withStyles/* default */.Z)(Autocomplete_styles, {
|
50609 |
+
name: 'MuiAutocomplete'
|
50610 |
+
})(Autocomplete));
|
50611 |
+
// EXTERNAL MODULE: ./node_modules/lodash/find.js
|
50612 |
+
var lodash_find = __webpack_require__(13311);
|
50613 |
+
var find_default = /*#__PURE__*/__webpack_require__.n(lodash_find);
|
50614 |
+
// EXTERNAL MODULE: ./node_modules/lodash/map.js
|
50615 |
+
var map = __webpack_require__(35161);
|
50616 |
+
var map_default = /*#__PURE__*/__webpack_require__.n(map);
|
50617 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Dialogs/TemplatesDialog/FilterTemplateOptions.js
|
50618 |
+
function FilterTemplateOptions_extends() { FilterTemplateOptions_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return FilterTemplateOptions_extends.apply(this, arguments); }
|
50619 |
|
50620 |
+
function FilterTemplateOptions_slicedToArray(arr, i) { return FilterTemplateOptions_arrayWithHoles(arr) || FilterTemplateOptions_iterableToArrayLimit(arr, i) || FilterTemplateOptions_unsupportedIterableToArray(arr, i) || FilterTemplateOptions_nonIterableRest(); }
|
50621 |
|
50622 |
+
function FilterTemplateOptions_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
|
|
|
|
|
|
|
50623 |
|
50624 |
+
function FilterTemplateOptions_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return FilterTemplateOptions_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return FilterTemplateOptions_arrayLikeToArray(o, minLen); }
|
50625 |
|
50626 |
+
function FilterTemplateOptions_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
50627 |
|
50628 |
+
function FilterTemplateOptions_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50629 |
|
50630 |
+
function FilterTemplateOptions_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
|
|
|
|
|
|
|
|
50631 |
|
|
|
|
|
|
|
|
|
|
|
50632 |
|
|
|
|
|
|
|
50633 |
|
|
|
|
|
|
|
50634 |
|
|
|
50635 |
|
|
|
|
|
|
|
50636 |
|
|
|
50637 |
|
|
|
|
|
|
|
50638 |
|
|
|
|
|
|
|
|
|
50639 |
|
50640 |
+
var FilterTemplateOptions = function FilterTemplateOptions(_ref) {
|
50641 |
+
var _ref$filterOptions = _ref.filterOptions,
|
50642 |
+
filterOptions = _ref$filterOptions === void 0 ? [] : _ref$filterOptions,
|
50643 |
+
setFilterOptions = _ref.setFilterOptions,
|
50644 |
+
filterList = _ref.filterList,
|
50645 |
+
label = _ref.label,
|
50646 |
+
setReturnedTemplates = _ref.setReturnedTemplates,
|
50647 |
+
button = _ref.button;
|
50648 |
|
50649 |
+
var _useState = (0,react.useState)([]),
|
50650 |
+
_useState2 = FilterTemplateOptions_slicedToArray(_useState, 2),
|
50651 |
+
importFilteredList = _useState2[0],
|
50652 |
+
setImportFilteredList = _useState2[1];
|
50653 |
|
50654 |
+
var _useState3 = (0,react.useState)(true),
|
50655 |
+
_useState4 = FilterTemplateOptions_slicedToArray(_useState3, 2),
|
50656 |
+
isLoading = _useState4[0],
|
50657 |
+
setIsLoading = _useState4[1];
|
|
|
50658 |
|
50659 |
+
var _useState5 = (0,react.useState)(""),
|
50660 |
+
_useState6 = FilterTemplateOptions_slicedToArray(_useState5, 2),
|
50661 |
+
currentText = _useState6[0],
|
50662 |
+
setCurrentText = _useState6[1];
|
50663 |
|
50664 |
+
(0,react.useEffect)(function () {
|
50665 |
+
importTemplates().then(function (result) {
|
50666 |
+
setImportFilteredList(result);
|
50667 |
+
setIsLoading(false);
|
50668 |
+
})["catch"](function (err) {
|
50669 |
+
console.error(err);
|
50670 |
+
});
|
50671 |
+
}, []);
|
50672 |
+
return /*#__PURE__*/react.createElement(Autocomplete_Autocomplete, {
|
50673 |
+
"data-testid": "templates:filter-dropdown",
|
50674 |
+
multiple: true,
|
50675 |
+
disableCloseOnSelect: true,
|
50676 |
+
openOnFocus: true,
|
50677 |
+
filterSelectedOptions: true,
|
50678 |
+
style: {
|
50679 |
+
marginLeft: 20,
|
50680 |
+
width: "100%"
|
50681 |
+
},
|
50682 |
+
options: isLoading ? [] : button ? filterList.filter(function (action) {
|
50683 |
+
return importFilteredList.find(function (template) {
|
50684 |
+
return action.value === template.type;
|
50685 |
+
});
|
50686 |
+
}) : filterList,
|
50687 |
+
value: filterOptions.map(function (item) {
|
50688 |
+
return find_default()(filterList, function (obj) {
|
50689 |
+
return obj.value === item;
|
50690 |
+
});
|
50691 |
+
}),
|
50692 |
+
onChange: function onChange(event, newValue) {
|
50693 |
+
setFilterOptions(map_default()(newValue, "value"));
|
50694 |
+
setCurrentText("");
|
50695 |
+
newValue.length ? setReturnedTemplates(true) : setReturnedTemplates(false);
|
50696 |
+
},
|
50697 |
+
getOptionLabel: function getOptionLabel(option) {
|
50698 |
+
return option.isPro && !app.hasPremium() ? "".concat(option.label, " (PRO)") : option.label || "";
|
50699 |
+
},
|
50700 |
+
getOptionDisabled: function getOptionDisabled(option) {
|
50701 |
+
return option.isPro && !app.hasPremium();
|
50702 |
+
},
|
50703 |
+
getOptionSelected: function getOptionSelected(option, value) {
|
50704 |
+
return option.value === value.value;
|
50705 |
+
},
|
50706 |
+
groupBy: function groupBy(option) {
|
50707 |
+
return button ? translate("settings.button_action.actions.group_".concat(option.group)) : null;
|
50708 |
+
},
|
50709 |
+
noOptionsText: translate("utils.search_not_found") + " " + currentText,
|
50710 |
+
inputValue: currentText,
|
50711 |
+
popupIcon: /*#__PURE__*/react.createElement("i", {
|
50712 |
+
className: "fas fa-caret-down",
|
50713 |
+
style: {
|
50714 |
+
fontSize: "0.8em"
|
50715 |
+
},
|
50716 |
+
"data-testid": "filter-dropdown-icon"
|
50717 |
+
}),
|
50718 |
+
renderInput: function renderInput(params) {
|
50719 |
+
return /*#__PURE__*/react.createElement(TextField_TextField, FilterTemplateOptions_extends({}, params, {
|
50720 |
+
onChange: function onChange(e) {
|
50721 |
+
setCurrentText(e.target.value);
|
50722 |
+
},
|
50723 |
+
label: label,
|
50724 |
+
variant: "outlined",
|
50725 |
+
"data-testid": "filter-dropdown-input"
|
50726 |
+
}));
|
50727 |
+
},
|
50728 |
+
renderTags: function renderTags(value, getTagProps) {
|
50729 |
+
return value.map(function (option, index) {
|
50730 |
+
return /*#__PURE__*/react.createElement(Chip_Chip, FilterTemplateOptions_extends({
|
50731 |
+
label: option.label,
|
50732 |
+
size: "small"
|
50733 |
+
}, getTagProps({
|
50734 |
+
index: index
|
50735 |
+
})));
|
50736 |
+
});
|
50737 |
+
},
|
50738 |
+
loadingText: translate("loading.loading"),
|
50739 |
+
loading: isLoading
|
50740 |
});
|
50741 |
+
};
|
50742 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Dialogs/TemplatesDialog/TemplatesDialog.js
|
50743 |
+
function TemplatesDialog_slicedToArray(arr, i) { return TemplatesDialog_arrayWithHoles(arr) || TemplatesDialog_iterableToArrayLimit(arr, i) || TemplatesDialog_unsupportedIterableToArray(arr, i) || TemplatesDialog_nonIterableRest(); }
|
|
|
|
|
|
|
|
|
50744 |
|
50745 |
+
function TemplatesDialog_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
|
|
|
50746 |
|
50747 |
+
function TemplatesDialog_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return TemplatesDialog_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return TemplatesDialog_arrayLikeToArray(o, minLen); }
|
|
|
50748 |
|
50749 |
+
function TemplatesDialog_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
|
|
|
50750 |
|
50751 |
+
function TemplatesDialog_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
|
|
|
50752 |
|
50753 |
+
function TemplatesDialog_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
|
|
50754 |
|
|
|
50755 |
|
|
|
|
|
|
|
|
|
50756 |
|
|
|
|
|
|
|
50757 |
|
|
|
|
|
50758 |
|
|
|
|
|
|
|
|
|
50759 |
|
|
|
|
|
|
|
50760 |
|
|
|
|
|
50761 |
|
|
|
|
|
50762 |
|
50763 |
+
function TemplatesDialog(_ref) {
|
50764 |
+
var open = _ref.open,
|
50765 |
+
onClose = _ref.onClose,
|
50766 |
+
_ref$showButtons = _ref.showButtons,
|
50767 |
+
showButtons = _ref$showButtons === void 0 ? false : _ref$showButtons,
|
50768 |
+
index = _ref.index,
|
50769 |
+
currentGroup = _ref.currentGroup;
|
50770 |
|
50771 |
+
var _useState = (0,react.useState)([]),
|
50772 |
+
_useState2 = TemplatesDialog_slicedToArray(_useState, 2),
|
50773 |
+
filterPopularAction = _useState2[0],
|
50774 |
+
setFilterPopularAction = _useState2[1];
|
50775 |
+
|
50776 |
+
var _useState3 = (0,react.useState)([]),
|
50777 |
+
_useState4 = TemplatesDialog_slicedToArray(_useState3, 2),
|
50778 |
+
filterFrameDesign = _useState4[0],
|
50779 |
+
setFilterFrameDesign = _useState4[1];
|
50780 |
+
|
50781 |
+
var _useState5 = (0,react.useState)(showButtons ? "button" : "group"),
|
50782 |
+
_useState6 = TemplatesDialog_slicedToArray(_useState5, 2),
|
50783 |
+
filterButtons = _useState6[0],
|
50784 |
+
setFilterButtons = _useState6[1];
|
50785 |
+
|
50786 |
+
var _useState7 = (0,react.useState)(false),
|
50787 |
+
_useState8 = TemplatesDialog_slicedToArray(_useState7, 2),
|
50788 |
+
returnedTemplates = _useState8[0],
|
50789 |
+
setReturnedTemplates = _useState8[1];
|
50790 |
+
|
50791 |
+
var handleCloseDialog = function handleCloseDialog() {
|
50792 |
+
onClose();
|
50793 |
+
setFilterButtons(showButtons ? "button" : "group");
|
50794 |
+
setReturnedTemplates(false);
|
50795 |
+
setFilterPopularAction([]);
|
50796 |
+
setFilterFrameDesign([]);
|
50797 |
+
};
|
50798 |
+
|
50799 |
+
var frameDesignList = [{
|
50800 |
+
label: "Social media",
|
50801 |
+
value: "social-media"
|
50802 |
+
}, {
|
50803 |
+
label: "Business",
|
50804 |
+
value: "business"
|
50805 |
+
}, {
|
50806 |
+
label: "Contact",
|
50807 |
+
value: "contact"
|
50808 |
+
}, {
|
50809 |
+
label: "Actions",
|
50810 |
+
value: "actions"
|
50811 |
+
}, {
|
50812 |
+
label: "Social sharing",
|
50813 |
+
value: "social-sharing"
|
50814 |
+
}];
|
50815 |
+
return /*#__PURE__*/react.createElement(Dialog_Dialog, {
|
50816 |
+
open: open,
|
50817 |
+
onClose: function onClose() {
|
50818 |
+
handleCloseDialog();
|
50819 |
+
},
|
50820 |
+
maxWidth: "md",
|
50821 |
+
fullWidth: true,
|
50822 |
+
className: "templates-dialog",
|
50823 |
+
"data-testid": "dialog:templates-dialog",
|
50824 |
+
scroll: "paper"
|
50825 |
+
}, /*#__PURE__*/react.createElement("div", {
|
50826 |
+
className: "header"
|
50827 |
+
}, /*#__PURE__*/react.createElement("div", {
|
50828 |
+
className: "titles"
|
50829 |
+
}, /*#__PURE__*/react.createElement(DialogTitle_DialogTitle, {
|
50830 |
+
className: "title"
|
50831 |
+
}, filterButtons === "button" ? translate("utils.new_button") : translate("utils.new_group")), /*#__PURE__*/react.createElement("h3", {
|
50832 |
+
className: "subtitle"
|
50833 |
+
}, translate("templates.all_templates_description"))), /*#__PURE__*/react.createElement(IconButton_IconButton, {
|
50834 |
+
onClick: function onClick() {
|
50835 |
+
handleCloseDialog();
|
50836 |
+
},
|
50837 |
+
className: "close-button",
|
50838 |
+
"data-testid": "templates-dialog:close-button"
|
50839 |
+
}, /*#__PURE__*/react.createElement(Icon_Icon, {
|
50840 |
+
fontSize: "inherit",
|
50841 |
+
className: "fas fa-times"
|
50842 |
+
}))), /*#__PURE__*/react.createElement("div", {
|
50843 |
+
className: "container-filter-buttons"
|
50844 |
+
}, /*#__PURE__*/react.createElement(DialogContent_DialogContent, {
|
50845 |
+
dividers: true,
|
50846 |
+
className: "midsection"
|
50847 |
+
}, /*#__PURE__*/react.createElement("div", {
|
50848 |
+
className: "button-group"
|
50849 |
+
}, /*#__PURE__*/react.createElement("div", {
|
50850 |
+
className: "buttons-title"
|
50851 |
+
}, translate("templates.number_of_buttons")), /*#__PURE__*/react.createElement("div", {
|
50852 |
+
className: "buttons"
|
50853 |
+
}, /*#__PURE__*/react.createElement("div", {
|
50854 |
+
className: "buttons-numbers"
|
50855 |
+
}, /*#__PURE__*/react.createElement(Button_Button, {
|
50856 |
+
onClick: function onClick() {
|
50857 |
+
setFilterButtons("button");
|
50858 |
+
setFilterPopularAction([]);
|
50859 |
+
setReturnedTemplates(false);
|
50860 |
+
},
|
50861 |
+
className: ("button", filterButtons === "button" ? "current" : null),
|
50862 |
+
variant: "outlined",
|
50863 |
+
style: {
|
50864 |
+
borderRadius: "20px",
|
50865 |
+
marginRight: "10px"
|
50866 |
+
},
|
50867 |
+
"data-testid": "templates:filter-buttons-button"
|
50868 |
+
}, "1"), /*#__PURE__*/react.createElement(Button_Button, {
|
50869 |
+
disabled: showButtons,
|
50870 |
+
onClick: function onClick() {
|
50871 |
+
setFilterButtons("group");
|
50872 |
+
setFilterFrameDesign([]);
|
50873 |
+
setReturnedTemplates(false);
|
50874 |
+
},
|
50875 |
+
className: ("button", filterButtons === "group" ? "current" : null),
|
50876 |
+
variant: "outlined",
|
50877 |
+
style: {
|
50878 |
+
borderRadius: "20px"
|
50879 |
+
},
|
50880 |
+
"data-testid": "templates:filter-buttons-group"
|
50881 |
+
}, "2 +")))), filterButtons === "group" && /*#__PURE__*/react.createElement(FilterTemplateOptions, {
|
50882 |
+
filterOptions: filterFrameDesign,
|
50883 |
+
setFilterOptions: setFilterFrameDesign,
|
50884 |
+
filterList: frameDesignList,
|
50885 |
+
label: translate("templates.framedesign.label"),
|
50886 |
+
setReturnedTemplates: setReturnedTemplates
|
50887 |
+
}), filterButtons === "button" && /*#__PURE__*/react.createElement(FilterTemplateOptions, {
|
50888 |
+
filterOptions: filterPopularAction,
|
50889 |
+
setFilterOptions: setFilterPopularAction,
|
50890 |
+
filterList: ButtonActionOptions,
|
50891 |
+
label: translate("templates.popular_actions.label"),
|
50892 |
+
setReturnedTemplates: setReturnedTemplates,
|
50893 |
+
button: true
|
50894 |
+
}))), /*#__PURE__*/react.createElement(TemplateOptions, {
|
50895 |
+
onClose: handleCloseDialog,
|
50896 |
+
index: index,
|
50897 |
+
currentGroup: currentGroup,
|
50898 |
+
returnedTemplates: returnedTemplates,
|
50899 |
+
filterButtons: filterButtons,
|
50900 |
+
filterFrameDesign: filterFrameDesign,
|
50901 |
+
filterPopularAction: filterPopularAction
|
50902 |
+
}));
|
50903 |
+
}
|
50904 |
|
50905 |
+
/* harmony default export */ var TemplatesDialog_TemplatesDialog = (TemplatesDialog);
|
50906 |
+
// EXTERNAL MODULE: ./node_modules/@seznam/compose-react-refs/composeRefs.js
|
50907 |
+
var composeRefs = __webpack_require__(99601);
|
50908 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Containers/ButtonGroupContainer/ButtonGroupContainer.js
|
50909 |
+
function ButtonGroupContainer_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = ButtonGroupContainer_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
50910 |
|
50911 |
+
function ButtonGroupContainer_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50912 |
|
50913 |
+
function ButtonGroupContainer_extends() { ButtonGroupContainer_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return ButtonGroupContainer_extends.apply(this, arguments); }
|
50914 |
|
50915 |
+
function ButtonGroupContainer_slicedToArray(arr, i) { return ButtonGroupContainer_arrayWithHoles(arr) || ButtonGroupContainer_iterableToArrayLimit(arr, i) || ButtonGroupContainer_unsupportedIterableToArray(arr, i) || ButtonGroupContainer_nonIterableRest(); }
|
|
|
|
|
|
|
|
|
|
|
50916 |
|
50917 |
+
function ButtonGroupContainer_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
|
|
|
50918 |
|
50919 |
+
function ButtonGroupContainer_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ButtonGroupContainer_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ButtonGroupContainer_arrayLikeToArray(o, minLen); }
|
50920 |
|
50921 |
+
function ButtonGroupContainer_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
|
50922 |
|
50923 |
+
function ButtonGroupContainer_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
|
|
|
|
|
|
|
50924 |
|
50925 |
+
function ButtonGroupContainer_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
|
|
50926 |
|
50927 |
+
function ButtonGroupContainer_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50928 |
|
50929 |
+
function ButtonGroupContainer_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ButtonGroupContainer_ownKeys(Object(source), true).forEach(function (key) { ButtonGroupContainer_defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ButtonGroupContainer_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
|
50930 |
|
50931 |
+
function ButtonGroupContainer_defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
50932 |
|
|
|
|
|
|
|
|
|
|
|
|
|
50933 |
|
50934 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50935 |
|
|
|
|
|
|
|
50936 |
|
|
|
|
|
|
|
|
|
|
|
50937 |
|
|
|
|
|
|
|
|
|
50938 |
|
|
|
50939 |
|
|
|
|
|
|
|
|
|
50940 |
|
|
|
|
|
|
|
|
|
50941 |
|
|
|
50942 |
|
|
|
|
|
|
|
|
|
50943 |
|
|
|
|
|
|
|
|
|
50944 |
|
|
|
|
|
|
|
50945 |
|
|
|
|
|
50946 |
|
|
|
50947 |
|
|
|
|
|
|
|
|
|
|
|
50948 |
|
|
|
|
|
50949 |
|
|
|
50950 |
|
|
|
|
|
|
|
50951 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
50952 |
|
|
|
|
|
|
|
|
|
50953 |
|
|
|
|
|
|
|
50954 |
|
|
|
|
|
|
|
|
|
50955 |
|
|
|
|
|
|
|
|
|
50956 |
|
|
|
50957 |
|
50958 |
+
function ButtonGroupContainer_getStyle(style, snapshot) {
|
50959 |
+
if (!snapshot.isDropAnimating) {
|
50960 |
+
return style;
|
50961 |
+
} // patching the existing style
|
|
|
50962 |
|
|
|
50963 |
|
50964 |
+
return ButtonGroupContainer_objectSpread(ButtonGroupContainer_objectSpread({}, style), {}, {
|
50965 |
+
opacity: "0.5"
|
50966 |
+
});
|
50967 |
+
}
|
|
|
|
|
|
|
50968 |
|
50969 |
+
function ButtonGroupContainer(_ref) {
|
50970 |
+
var groupId = _ref.groupId,
|
50971 |
+
groups = _ref.groups,
|
50972 |
+
set = _ref.set,
|
50973 |
+
provided = _ref.provided,
|
50974 |
+
currentDrop = _ref.currentDrop,
|
50975 |
+
getButtonsCount = _ref.getButtonsCount,
|
50976 |
+
getGroupCount = _ref.getGroupCount,
|
50977 |
+
removeGroup = _ref.removeGroup,
|
50978 |
+
duplicateGroup = _ref.duplicateGroup,
|
50979 |
+
isNewGroup = _ref.isNewGroup,
|
50980 |
+
openOverride = _ref.openOverride;
|
50981 |
+
var cookieOpenedState = getCookie("buttonizer_bar_state_opened") ? dlv_umd_default()(JSON.parse(getCookie("buttonizer_bar_state_opened")), groupId, false) : false;
|
50982 |
|
50983 |
+
var _useState = (0,react.useState)(cookieOpenedState),
|
50984 |
+
_useState2 = ButtonGroupContainer_slicedToArray(_useState, 2),
|
50985 |
+
opened = _useState2[0],
|
50986 |
+
setOpened = _useState2[1];
|
50987 |
|
50988 |
+
var _useState3 = (0,react.useState)(false),
|
50989 |
+
_useState4 = ButtonGroupContainer_slicedToArray(_useState3, 2),
|
50990 |
+
newButtonDialogOpened = _useState4[0],
|
50991 |
+
setNewButtonDialogOpened = _useState4[1];
|
|
|
|
|
50992 |
|
50993 |
+
var _useState5 = (0,react.useState)(groups[groupId]),
|
50994 |
+
_useState6 = ButtonGroupContainer_slicedToArray(_useState5, 2),
|
50995 |
+
group = _useState6[0],
|
50996 |
+
setGroup = _useState6[1];
|
50997 |
|
50998 |
+
var buttonGroupContainer = (0,react.useRef)(null);
|
|
|
|
|
|
|
50999 |
|
51000 |
+
var handleOpenState = function handleOpenState() {
|
51001 |
+
// Save openedState to cookie
|
51002 |
+
var currentCookie = getCookie("buttonizer_bar_state_opened") ? JSON.parse(getCookie("buttonizer_bar_state_opened")) : {};
|
51003 |
+
currentCookie[groupId] = !opened;
|
51004 |
+
setCookie("buttonizer_bar_state_opened", JSON.stringify(currentCookie));
|
51005 |
+
setOpened(!opened);
|
51006 |
};
|
51007 |
|
51008 |
+
if (typeof group === "undefined") {
|
51009 |
+
withScope(function (scope) {
|
51010 |
+
scope.setExtra({
|
51011 |
+
groups: groups,
|
51012 |
+
groupId: groupId,
|
51013 |
+
group: group
|
51014 |
+
});
|
51015 |
+
captureException(new Error("group is undefined. Send groups and groupId data"));
|
51016 |
+
});
|
51017 |
+
}
|
51018 |
|
51019 |
+
(0,react.useEffect)(function () {
|
51020 |
+
setGroup(groups[groupId]);
|
51021 |
+
}, [groups[groupId]]);
|
51022 |
+
(0,react.useEffect)(function () {
|
51023 |
+
if (isNewGroup) {
|
51024 |
+
if (buttonGroupContainer && buttonGroupContainer.current) buttonGroupContainer.current.scrollIntoView({
|
51025 |
+
behavior: "smooth"
|
51026 |
+
});
|
51027 |
}
|
51028 |
+
}, [isNewGroup]);
|
51029 |
+
(0,react.useEffect)(function () {
|
51030 |
+
// If tour is started, open the group. If set to false, fallback to cookieOpenedState
|
51031 |
+
openOverride ? setOpened(openOverride) : setOpened(cookieOpenedState);
|
51032 |
+
}, [openOverride]);
|
51033 |
|
51034 |
+
var duplicateButton = function duplicateButton() {
|
51035 |
+
/* webpack-strip-block:removed */
|
51036 |
+
return /*#__PURE__*/react.createElement(Tippy_Tippy, {
|
51037 |
+
content: translate("premium.warning_duplicate"),
|
51038 |
+
trigger: "click"
|
51039 |
+
}, /*#__PURE__*/react.createElement("span", {
|
51040 |
+
tabIndex: 0
|
51041 |
+
}, /*#__PURE__*/react.createElement(DuplicateButton, {
|
51042 |
+
name: group.name,
|
51043 |
+
disabled: true
|
51044 |
+
})));
|
51045 |
};
|
51046 |
|
51047 |
+
return /*#__PURE__*/react.createElement("div", {
|
51048 |
+
className: (0,clsx_m/* default */.Z)("button-group-container mdc-card", opened && "opened", isNewGroup && "new-group", currentDrop && !opened && currentDrop),
|
51049 |
+
ref: (0,composeRefs/* default */.Z)(provided.innerRef, buttonGroupContainer),
|
51050 |
+
style: {
|
51051 |
+
scrollMargin: 100
|
51052 |
+
}
|
51053 |
+
}, /*#__PURE__*/react.createElement("div", {
|
51054 |
+
className: "group-info"
|
51055 |
+
}, /*#__PURE__*/react.createElement(Button_Button, {
|
51056 |
+
onClick: handleOpenState,
|
51057 |
+
color: "primary",
|
51058 |
+
"data-testid": "open-group"
|
51059 |
+
}, /*#__PURE__*/react.createElement("i", {
|
51060 |
+
className: "group-arrow"
|
51061 |
+
}, /*#__PURE__*/react.createElement("i", {
|
51062 |
+
className: "fas fa-chevron-right"
|
51063 |
+
})), /*#__PURE__*/react.createElement("span", {
|
51064 |
+
className: "group-name"
|
51065 |
+
}, group.name)), /*#__PURE__*/react.createElement("div", {
|
51066 |
+
className: "group-action-spacer"
|
51067 |
+
}), /*#__PURE__*/react.createElement("div", {
|
51068 |
+
className: "group-actions"
|
51069 |
+
}, /*#__PURE__*/react.createElement(EditButton, {
|
51070 |
+
onClick: function onClick() {
|
51071 |
+
return document.location.hash = "#/group/" + group.id;
|
51072 |
+
},
|
51073 |
+
"data-testid": "edit-button-group",
|
51074 |
+
className: "group-actions edit-button"
|
51075 |
+
}), duplicateButton(), /*#__PURE__*/react.createElement(ContainerActionsDropdown, null, /*#__PURE__*/react.createElement(ContainerActions_RenameButton, {
|
51076 |
+
name: group.name,
|
51077 |
+
onChange: function onChange(val) {
|
51078 |
+
return set("groups", group.id, "name", val);
|
51079 |
+
},
|
51080 |
+
inDropdown: true
|
51081 |
+
}), /*#__PURE__*/react.createElement(ExportButton, {
|
51082 |
+
object: group,
|
51083 |
+
type: "group"
|
51084 |
+
}), /*#__PURE__*/react.createElement(ImportButton, {
|
51085 |
+
currentGroup: group,
|
51086 |
+
label: translate("import_export.import.into_group.button"),
|
51087 |
+
kbLink: 653,
|
51088 |
+
inDropdown: true
|
51089 |
+
}), /*#__PURE__*/react.createElement(ContainerActions_DeleteButton, {
|
51090 |
+
model: "group",
|
51091 |
+
"data-testid": "delete-button-group",
|
51092 |
+
buttonCount: getButtonsCount(group.id),
|
51093 |
+
deleteDisabled: getGroupCount() <= 1,
|
51094 |
+
onClose: function onClose() {
|
51095 |
+
// Remove group from cookie, other wise it will bloat the cookie
|
51096 |
+
if (getCookie("buttonizer_bar_state_opened")) {
|
51097 |
+
var currentCookie = JSON.parse(getCookie("buttonizer_bar_state_opened"));
|
51098 |
+
delete currentCookie[group.id];
|
51099 |
+
setCookie("buttonizer_bar_state_opened", JSON.stringify(currentCookie));
|
51100 |
}
|
51101 |
|
51102 |
+
removeGroup(group.id);
|
51103 |
+
},
|
51104 |
+
inDropdown: true
|
51105 |
+
})))), /*#__PURE__*/react.createElement("div", ButtonGroupContainer_extends({
|
51106 |
+
className: "buttons" + currentDrop
|
51107 |
+
}, provided.droppableProps), group.children.map(function (id, key) {
|
51108 |
+
return /*#__PURE__*/react.createElement(PublicDraggable, {
|
51109 |
+
draggableId: id,
|
51110 |
+
index: key,
|
51111 |
+
key: id
|
51112 |
+
}, function (provided, snapshot) {
|
51113 |
+
return /*#__PURE__*/react.createElement(ButtonContainer_ButtonContainer, {
|
51114 |
+
provided: provided // key={key}
|
51115 |
+
,
|
51116 |
+
groupId: group.id,
|
51117 |
+
buttonId: id,
|
51118 |
+
currentDrag: snapshot.isDragging ? " currentDrag" : "",
|
51119 |
+
styleDrop: ButtonGroupContainer_getStyle(provided.draggableProps.style, snapshot),
|
51120 |
+
openNewButtonDialog: function openNewButtonDialog(shiftKey) {
|
51121 |
+
if (shiftKey) return addButton({
|
51122 |
+
name: translate("utils.new_button")
|
51123 |
+
}, group.id, key + 1);
|
51124 |
+
setNewButtonDialogOpened(key + 1);
|
51125 |
+
}
|
51126 |
+
});
|
51127 |
+
});
|
51128 |
+
}), provided.placeholder, /*#__PURE__*/react.createElement("div", {
|
51129 |
+
style: {
|
51130 |
+
textAlign: "center"
|
51131 |
+
}
|
51132 |
+
}, /*#__PURE__*/react.createElement(TemplatesDialog_TemplatesDialog, {
|
51133 |
+
open: newButtonDialogOpened !== false,
|
51134 |
+
currentGroup: group,
|
51135 |
+
onClose: function onClose() {
|
51136 |
+
return setNewButtonDialogOpened(false);
|
51137 |
+
},
|
51138 |
+
index: newButtonDialogOpened,
|
51139 |
+
showButtons: true
|
51140 |
+
}))));
|
51141 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51142 |
|
51143 |
+
/* harmony default export */ var ButtonGroupContainer_ButtonGroupContainer = (connect(function (state) {
|
51144 |
+
return {
|
51145 |
+
getButtonsCount: function getButtonsCount(groupId) {
|
51146 |
+
return selectors_getButtonsCount(groupId, state);
|
51147 |
+
},
|
51148 |
+
getGroupCount: function getGroupCount() {
|
51149 |
+
return selectors_getGroupCount(state);
|
51150 |
+
},
|
51151 |
+
groups: state.groups,
|
51152 |
+
state: state
|
51153 |
};
|
51154 |
+
}, function (dispatch) {
|
51155 |
+
return {
|
51156 |
+
set: function set() {
|
51157 |
+
return dispatch(dataActions_set.apply(void 0, arguments));
|
51158 |
+
},
|
51159 |
+
dispatch: dispatch
|
|
|
51160 |
};
|
51161 |
+
}, function (_ref2, _ref3, props) {
|
51162 |
+
var state = _ref2.state,
|
51163 |
+
stateProps = ButtonGroupContainer_objectWithoutProperties(_ref2, ["state"]);
|
51164 |
|
51165 |
+
var dispatch = _ref3.dispatch,
|
51166 |
+
dispatchProps = ButtonGroupContainer_objectWithoutProperties(_ref3, ["dispatch"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51167 |
|
51168 |
+
return ButtonGroupContainer_objectSpread(ButtonGroupContainer_objectSpread(ButtonGroupContainer_objectSpread({
|
51169 |
+
removeGroup: function removeGroup(id) {
|
51170 |
+
return GroupActions_removeGroup(id, state, dispatch);
|
51171 |
+
},
|
51172 |
+
duplicateGroup: function duplicateGroup(id, payload) {
|
51173 |
+
return GroupActions_duplicateGroup(id, payload, state, dispatch);
|
51174 |
}
|
51175 |
+
}, dispatchProps), stateProps), props);
|
51176 |
+
})(ButtonGroupContainer));
|
51177 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/PremiumTag/PremiumTag.js
|
51178 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51179 |
|
51180 |
+
function PremiumTag() {
|
51181 |
+
return /*#__PURE__*/react.createElement("span", {
|
51182 |
+
className: "buttonizer-premium",
|
51183 |
+
"data-testid": "buttonizer-premium-tag"
|
51184 |
+
});
|
51185 |
+
}
|
51186 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Pages/Overview/Overview.js
|
51187 |
+
function Overview_slicedToArray(arr, i) { return Overview_arrayWithHoles(arr) || Overview_iterableToArrayLimit(arr, i) || Overview_unsupportedIterableToArray(arr, i) || Overview_nonIterableRest(); }
|
51188 |
|
51189 |
+
function Overview_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
|
51190 |
|
51191 |
+
function Overview_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Overview_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Overview_arrayLikeToArray(o, minLen); }
|
|
|
51192 |
|
51193 |
+
function Overview_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
|
|
|
|
|
51194 |
|
51195 |
+
function Overview_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51196 |
|
51197 |
+
function Overview_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
|
|
|
|
|
|
|
|
|
|
51198 |
|
|
|
|
|
|
|
51199 |
|
|
|
|
|
|
|
|
|
|
|
51200 |
|
51201 |
+
// import ConfirmDialog from "Components/Dialogs/ConfirmDialog";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51202 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51203 |
|
51204 |
|
|
|
|
|
|
|
|
|
|
|
51205 |
|
51206 |
|
|
|
|
|
51207 |
|
|
|
|
|
|
|
51208 |
|
|
|
|
|
51209 |
|
|
|
|
|
|
|
|
|
|
|
51210 |
|
|
|
|
|
|
|
51211 |
|
|
|
|
|
|
|
|
|
|
|
|
|
51212 |
|
|
|
|
|
|
|
|
|
51213 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51214 |
|
51215 |
+
function Overview(_ref) {
|
51216 |
+
var _ref$groups = _ref.groups,
|
51217 |
+
groups = _ref$groups === void 0 ? null : _ref$groups,
|
51218 |
+
changeRelation = _ref.changeRelation,
|
51219 |
+
_ref$testDragSensor = _ref.testDragSensor,
|
51220 |
+
testDragSensor = _ref$testDragSensor === void 0 ? function () {} : _ref$testDragSensor,
|
51221 |
+
hasPremium = _ref.hasPremium,
|
51222 |
+
addGroup = _ref.addGroup,
|
51223 |
+
isPremiumCode = _ref.isPremiumCode,
|
51224 |
+
_ref$scrollBar = _ref.scrollBar,
|
51225 |
+
scrollBar = _ref$scrollBar === void 0 ? false : _ref$scrollBar;
|
51226 |
|
51227 |
+
// Create new group
|
51228 |
+
var _useState = (0,react.useState)(false),
|
51229 |
+
_useState2 = Overview_slicedToArray(_useState, 2),
|
51230 |
+
dialogOpen = _useState2[0],
|
51231 |
+
openDialog = _useState2[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51232 |
|
51233 |
+
var _useState3 = (0,react.useState)(null),
|
51234 |
+
_useState4 = Overview_slicedToArray(_useState3, 2),
|
51235 |
+
oldGroups = _useState4[0],
|
51236 |
+
setOldGroups = _useState4[1];
|
51237 |
|
51238 |
+
var _useState5 = (0,react.useState)(null),
|
51239 |
+
_useState6 = Overview_slicedToArray(_useState5, 2),
|
51240 |
+
newGroup = _useState6[0],
|
51241 |
+
setNewGroup = _useState6[1];
|
51242 |
|
51243 |
+
var openCollapsibleGroup = useSelector(function (store) {
|
51244 |
+
return store.misc.open_collapsible_group;
|
51245 |
+
});
|
51246 |
|
51247 |
+
var _useState7 = (0,react.useState)(false),
|
51248 |
+
_useState8 = Overview_slicedToArray(_useState7, 2),
|
51249 |
+
opened = _useState8[0],
|
51250 |
+
setOpened = _useState8[1];
|
51251 |
|
51252 |
+
(0,react.useEffect)(function () {
|
51253 |
+
if (scrollBar && scrollBar.current) scrollBar.current.scrollTop = getCookie("buttonizer_bar_state_scroll") || 0;
|
51254 |
+
return function () {
|
51255 |
+
if (scrollBar && scrollBar.current) scrollBar.current.scrollTop = 0;
|
51256 |
+
};
|
51257 |
+
}, []);
|
51258 |
+
(0,react.useEffect)(function () {
|
51259 |
+
if (oldGroups !== null) {
|
51260 |
+
// Added a new group
|
51261 |
+
if (Object.keys(groups).length > Object.keys(oldGroups).length) setNewGroup(difference_default()(Object.keys(groups), Object.keys(oldGroups))); // Removed a group
|
51262 |
|
51263 |
+
if (Object.keys(groups).length < Object.keys(oldGroups).length) setNewGroup(null);
|
51264 |
+
}
|
51265 |
|
51266 |
+
setOldGroups(groups);
|
51267 |
+
}, [groups]);
|
51268 |
+
(0,react.useEffect)(function () {
|
51269 |
+
if (openCollapsibleGroup === "button_group_container") setOpened(true);
|
51270 |
+
if (openCollapsibleGroup === null) setOpened(false);
|
51271 |
+
}, [openCollapsibleGroup]); // Drag started
|
51272 |
|
51273 |
+
var onDragStart = (0,react.useCallback)(function () {
|
51274 |
+
// vibrate on touch
|
51275 |
+
if (window.navigator.vibrate) {
|
51276 |
+
window.navigator.vibrate(100);
|
51277 |
+
}
|
51278 |
+
}, []); // Drag ended
|
51279 |
|
51280 |
+
var onDragEnd = (0,react.useCallback)(function (result) {
|
51281 |
+
var destination = result.destination,
|
51282 |
+
source = result.source,
|
51283 |
+
draggableId = result.draggableId; // Didn't dragged into a group
|
51284 |
|
51285 |
+
if (!destination) {
|
51286 |
+
return;
|
51287 |
+
} // Didn't dragged into a new location
|
51288 |
|
51289 |
|
51290 |
+
if (source.droppableId === destination.droppableId && source.index === destination.index) {
|
51291 |
+
return;
|
51292 |
+
}
|
51293 |
|
51294 |
+
changeRelation(draggableId, source.droppableId, destination.droppableId, destination.index);
|
51295 |
+
}, [groups]);
|
51296 |
|
51297 |
+
var addGroupButton = function addGroupButton(index) {
|
51298 |
+
/* webpack-strip-block:removed */
|
51299 |
+
return /*#__PURE__*/react.createElement("div", {
|
51300 |
+
style: {
|
51301 |
+
textAlign: "center",
|
51302 |
+
marginTop: "20px"
|
51303 |
+
}
|
51304 |
+
}, /*#__PURE__*/react.createElement(Button_Button, {
|
51305 |
+
onClick: function onClick() {
|
51306 |
+
return app.showPremiumDialog(translate("premium.multiple_button_groups"), "Qxs1oGCVATU");
|
51307 |
+
},
|
51308 |
+
color: "primary",
|
51309 |
+
className: "Mui-buzz-premium",
|
51310 |
+
startIcon: /*#__PURE__*/react.createElement(Icon_Icon, {
|
51311 |
+
className: "fas fa-plus-circle"
|
51312 |
+
}),
|
51313 |
+
"data-testid": "new-group"
|
51314 |
+
}, translate("utils.create_group"), " ", /*#__PURE__*/react.createElement(PremiumTag, null)));
|
51315 |
+
};
|
51316 |
|
51317 |
+
var buttonGroupContainer = function buttonGroupContainer() {
|
51318 |
+
/* webpack-strip-block:removed */
|
51319 |
+
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(ConnectedDroppable, {
|
51320 |
+
droppableId: Object.keys(groups)[0]
|
51321 |
+
}, function (provided, snapshot) {
|
51322 |
+
return /*#__PURE__*/react.createElement(ButtonGroupContainer_ButtonGroupContainer, {
|
51323 |
+
groupId: Object.keys(groups)[0],
|
51324 |
+
provided: provided,
|
51325 |
+
currentDrop: snapshot.isDraggingOver ? " currentDrop" : ""
|
51326 |
+
});
|
51327 |
+
}), addGroupButton());
|
51328 |
+
};
|
51329 |
|
51330 |
+
return /*#__PURE__*/react.createElement("div", {
|
51331 |
+
className: "overview"
|
51332 |
+
}, !window.buttonizer_admin.is_stand_alone && /*#__PURE__*/react.createElement("div", {
|
51333 |
+
className: "buttonizer-logo"
|
51334 |
+
}, /*#__PURE__*/react.createElement("img", {
|
51335 |
+
src: window.buttonizer_admin.assets + "/images/logo.png"
|
51336 |
+
})), /*#__PURE__*/react.createElement(RandomTip_RandomTip, null), hasPremium && !isPremiumCode && /*#__PURE__*/react.createElement("div", {
|
51337 |
+
className: "mdc-card dashboard-warning-msg"
|
51338 |
+
}, /*#__PURE__*/react.createElement("b", null, translate("warnings.premium_license_free_version.title")), translate("warnings.premium_license_free_version.information"), " ", /*#__PURE__*/react.createElement("a", {
|
51339 |
+
href: "https://community.buttonizer.pro/knowledgebase/321",
|
51340 |
+
target: "_blank"
|
51341 |
+
}, translate("common.learn_more"), ".")), !buttonizer_admin.php_version_supported && /*#__PURE__*/react.createElement("div", {
|
51342 |
+
className: "mdc-card dashboard-warning-msg"
|
51343 |
+
}, /*#__PURE__*/react.createElement("b", null, translate("warnings.php_version_outdated.title")), translate("warnings.php_version_outdated.information", {
|
51344 |
+
version: buttonizer_admin.php_version
|
51345 |
+
}), " ", /*#__PURE__*/react.createElement("a", {
|
51346 |
+
href: "https://community.buttonizer.pro/knowledgebase/434",
|
51347 |
+
target: "_blank"
|
51348 |
+
}, translate("common.learn_more"), ".")), /*#__PURE__*/react.createElement(DragDropContext, {
|
51349 |
+
sensors: [testDragSensor],
|
51350 |
+
onDragEnd: onDragEnd,
|
51351 |
+
onDragStart: onDragStart
|
51352 |
+
}, buttonGroupContainer()));
|
51353 |
+
}
|
51354 |
|
51355 |
+
/* harmony default export */ var Overview_Overview = (connect(function (state) {
|
51356 |
return {
|
51357 |
+
groups: state.groups,
|
51358 |
+
hasPremium: state.misc._premium,
|
51359 |
+
isPremiumCode: state.misc._premiumCode
|
51360 |
+
};
|
51361 |
+
}, function (dispatch) {
|
51362 |
+
return {
|
51363 |
+
addRelation: function addRelation(args) {
|
51364 |
+
return dispatch(dataActions_addRelation(args));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51365 |
},
|
51366 |
+
addRecord: function addRecord(args) {
|
51367 |
+
return dispatch(dataActions_addRecord(args));
|
|
|
|
|
|
|
|
|
|
|
|
|
51368 |
},
|
51369 |
+
addGroup: function addGroup(payload, index) {
|
51370 |
+
return GroupActions_addGroup(payload, index, dispatch);
|
|
|
|
|
|
|
51371 |
},
|
51372 |
+
changeRelation: function changeRelation() {
|
51373 |
+
return dispatch(dataActions_changeRelation.apply(void 0, arguments));
|
51374 |
+
}
|
51375 |
+
};
|
51376 |
+
})(Overview));
|
51377 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Pages/ItemNotFound/ItemNotFound.js
|
51378 |
|
|
|
|
|
51379 |
|
|
|
|
|
51380 |
|
51381 |
+
function ItemNotFound(_ref) {
|
51382 |
+
var _ref$isButtonGroupNot = _ref.isButtonGroupNotFound,
|
51383 |
+
isButtonGroupNotFound = _ref$isButtonGroupNot === void 0 ? false : _ref$isButtonGroupNot;
|
51384 |
+
return /*#__PURE__*/react.createElement("div", {
|
51385 |
+
className: "item-not-found"
|
51386 |
+
}, /*#__PURE__*/react.createElement("div", {
|
51387 |
+
className: "buttonizer-logo"
|
51388 |
+
}, /*#__PURE__*/react.createElement("img", {
|
51389 |
+
src: window.buttonizer_admin.assets + "/images/logo.png"
|
51390 |
+
})), /*#__PURE__*/react.createElement("i", {
|
51391 |
+
className: isButtonGroupNotFound ? "fas fa-binoculars" : "far fa-dizzy"
|
51392 |
+
}), /*#__PURE__*/react.createElement("h4", null, "Sorry! We could not find this ".concat(isButtonGroupNotFound ? "button or group" : "page", "!")), /*#__PURE__*/react.createElement(Button_Button, {
|
51393 |
+
onClick: function onClick() {
|
51394 |
+
document.location.hash = "#/";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51395 |
},
|
51396 |
+
color: "primary",
|
51397 |
+
variant: "contained",
|
51398 |
+
"data-testid": "return-to-overview"
|
51399 |
+
}, "Return to overview"));
|
51400 |
+
}
|
51401 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/Tab/Tab.js
|
51402 |
|
|
|
|
|
|
|
|
|
|
|
|
|
51403 |
|
|
|
|
|
|
|
|
|
51404 |
|
|
|
|
|
|
|
|
|
|
|
|
|
51405 |
|
|
|
51406 |
|
|
|
|
|
|
|
|
|
|
|
|
|
51407 |
|
|
|
|
|
51408 |
|
|
|
|
|
|
|
|
|
|
|
51409 |
|
|
|
|
|
|
|
|
|
51410 |
|
|
|
|
|
|
|
|
|
51411 |
|
51412 |
+
var Tab_styles = function styles(theme) {
|
51413 |
+
var _extends2;
|
|
|
|
|
51414 |
|
51415 |
+
return {
|
51416 |
+
/* Styles applied to the root element. */
|
51417 |
+
root: (0,esm_extends/* default */.Z)({}, theme.typography.button, (_extends2 = {
|
51418 |
+
maxWidth: 264,
|
51419 |
+
minWidth: 72,
|
51420 |
+
position: 'relative',
|
51421 |
+
boxSizing: 'border-box',
|
51422 |
+
minHeight: 48,
|
51423 |
+
flexShrink: 0,
|
51424 |
+
padding: '6px 12px'
|
51425 |
+
}, (0,defineProperty/* default */.Z)(_extends2, theme.breakpoints.up('sm'), {
|
51426 |
+
padding: '6px 24px'
|
51427 |
+
}), (0,defineProperty/* default */.Z)(_extends2, "overflow", 'hidden'), (0,defineProperty/* default */.Z)(_extends2, "whiteSpace", 'normal'), (0,defineProperty/* default */.Z)(_extends2, "textAlign", 'center'), (0,defineProperty/* default */.Z)(_extends2, theme.breakpoints.up('sm'), {
|
51428 |
+
minWidth: 160
|
51429 |
+
}), _extends2)),
|
51430 |
|
51431 |
+
/* Styles applied to the root element if both `icon` and `label` are provided. */
|
51432 |
+
labelIcon: {
|
51433 |
+
minHeight: 72,
|
51434 |
+
paddingTop: 9,
|
51435 |
+
'& $wrapper > *:first-child': {
|
51436 |
+
marginBottom: 6
|
51437 |
+
}
|
51438 |
},
|
51439 |
|
51440 |
+
/* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor="inherit"`. */
|
51441 |
+
textColorInherit: {
|
51442 |
+
color: 'inherit',
|
51443 |
+
opacity: 0.7,
|
51444 |
+
'&$selected': {
|
51445 |
+
opacity: 1
|
51446 |
+
},
|
51447 |
+
'&$disabled': {
|
51448 |
+
opacity: 0.5
|
51449 |
+
}
|
51450 |
+
},
|
51451 |
+
|
51452 |
+
/* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor="primary"`. */
|
51453 |
+
textColorPrimary: {
|
51454 |
color: theme.palette.text.secondary,
|
51455 |
+
'&$selected': {
|
51456 |
+
color: theme.palette.primary.main
|
51457 |
+
},
|
51458 |
+
'&$disabled': {
|
51459 |
+
color: theme.palette.text.disabled
|
51460 |
+
}
|
51461 |
},
|
51462 |
|
51463 |
+
/* Styles applied to the root element if the parent [`Tabs`](/api/tabs/) has `textColor="secondary"`. */
|
51464 |
+
textColorSecondary: {
|
51465 |
color: theme.palette.text.secondary,
|
51466 |
+
'&$selected': {
|
51467 |
+
color: theme.palette.secondary.main
|
51468 |
+
},
|
51469 |
+
'&$disabled': {
|
51470 |
+
color: theme.palette.text.disabled
|
51471 |
+
}
|
51472 |
},
|
51473 |
|
51474 |
+
/* Pseudo-class applied to the root element if `selected={true}` (controlled by the Tabs component). */
|
51475 |
+
selected: {},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51476 |
|
51477 |
+
/* Pseudo-class applied to the root element if `disabled={true}` (controlled by the Tabs component). */
|
51478 |
+
disabled: {},
|
51479 |
+
|
51480 |
+
/* Styles applied to the root element if `fullWidth={true}` (controlled by the Tabs component). */
|
51481 |
+
fullWidth: {
|
51482 |
+
flexShrink: 1,
|
51483 |
+
flexGrow: 1,
|
51484 |
+
flexBasis: 0,
|
51485 |
+
maxWidth: 'none'
|
51486 |
},
|
51487 |
|
51488 |
+
/* Styles applied to the root element if `wrapped={true}`. */
|
51489 |
+
wrapped: {
|
51490 |
+
fontSize: theme.typography.pxToRem(12),
|
51491 |
+
lineHeight: 1.5
|
51492 |
+
},
|
51493 |
+
|
51494 |
+
/* Styles applied to the `icon` and `label`'s wrapper element. */
|
51495 |
+
wrapper: {
|
51496 |
+
display: 'inline-flex',
|
51497 |
+
alignItems: 'center',
|
51498 |
+
justifyContent: 'center',
|
51499 |
+
width: '100%',
|
51500 |
+
flexDirection: 'column'
|
51501 |
}
|
51502 |
};
|
51503 |
};
|
51504 |
+
var Tab = /*#__PURE__*/react.forwardRef(function Tab(props, ref) {
|
51505 |
+
var classes = props.classes,
|
51506 |
+
className = props.className,
|
51507 |
+
_props$disabled = props.disabled,
|
51508 |
+
disabled = _props$disabled === void 0 ? false : _props$disabled,
|
51509 |
+
_props$disableFocusRi = props.disableFocusRipple,
|
51510 |
+
disableFocusRipple = _props$disableFocusRi === void 0 ? false : _props$disableFocusRi,
|
51511 |
+
fullWidth = props.fullWidth,
|
51512 |
+
icon = props.icon,
|
51513 |
+
indicator = props.indicator,
|
51514 |
+
label = props.label,
|
51515 |
+
onChange = props.onChange,
|
51516 |
+
onClick = props.onClick,
|
51517 |
+
onFocus = props.onFocus,
|
51518 |
+
selected = props.selected,
|
51519 |
+
selectionFollowsFocus = props.selectionFollowsFocus,
|
51520 |
+
_props$textColor = props.textColor,
|
51521 |
+
textColor = _props$textColor === void 0 ? 'inherit' : _props$textColor,
|
51522 |
+
value = props.value,
|
51523 |
+
_props$wrapped = props.wrapped,
|
51524 |
+
wrapped = _props$wrapped === void 0 ? false : _props$wrapped,
|
51525 |
+
other = (0,objectWithoutProperties/* default */.Z)(props, ["classes", "className", "disabled", "disableFocusRipple", "fullWidth", "icon", "indicator", "label", "onChange", "onClick", "onFocus", "selected", "selectionFollowsFocus", "textColor", "value", "wrapped"]);
|
51526 |
|
51527 |
+
var handleClick = function handleClick(event) {
|
51528 |
+
if (onChange) {
|
51529 |
+
onChange(event, value);
|
51530 |
+
}
|
|
|
51531 |
|
51532 |
+
if (onClick) {
|
51533 |
+
onClick(event);
|
51534 |
+
}
|
51535 |
+
};
|
51536 |
|
51537 |
+
var handleFocus = function handleFocus(event) {
|
51538 |
+
if (selectionFollowsFocus && !selected && onChange) {
|
51539 |
+
onChange(event, value);
|
51540 |
+
}
|
51541 |
+
|
51542 |
+
if (onFocus) {
|
51543 |
+
onFocus(event);
|
51544 |
+
}
|
51545 |
+
};
|
51546 |
+
|
51547 |
+
return /*#__PURE__*/react.createElement(ButtonBase_ButtonBase, (0,esm_extends/* default */.Z)({
|
51548 |
+
focusRipple: !disableFocusRipple,
|
51549 |
+
className: (0,clsx_m/* default */.Z)(classes.root, classes["textColor".concat((0,utils_capitalize/* default */.Z)(textColor))], className, disabled && classes.disabled, selected && classes.selected, label && icon && classes.labelIcon, fullWidth && classes.fullWidth, wrapped && classes.wrapped),
|
51550 |
+
ref: ref,
|
51551 |
+
role: "tab",
|
51552 |
+
"aria-selected": selected,
|
51553 |
+
disabled: disabled,
|
51554 |
+
onClick: handleClick,
|
51555 |
+
onFocus: handleFocus,
|
51556 |
+
tabIndex: selected ? 0 : -1
|
51557 |
+
}, other), /*#__PURE__*/react.createElement("span", {
|
51558 |
+
className: classes.wrapper
|
51559 |
+
}, icon, label), indicator);
|
51560 |
});
|
51561 |
+
false ? 0 : void 0;
|
51562 |
+
/* harmony default export */ var Tab_Tab = ((0,withStyles/* default */.Z)(Tab_styles, {
|
51563 |
+
name: 'MuiTab'
|
51564 |
+
})(Tab));
|
51565 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/utils/scrollLeft.js
|
51566 |
+
// Source from https://github.com/alitaheri/normalize-scroll-left
|
51567 |
+
var cachedType;
|
51568 |
+
/**
|
51569 |
+
* Based on the jquery plugin https://github.com/othree/jquery.rtl-scroll-type
|
51570 |
+
*
|
51571 |
+
* Types of scrollLeft, assuming scrollWidth=100 and direction is rtl.
|
51572 |
+
*
|
51573 |
+
* Type | <- Most Left | Most Right -> | Initial
|
51574 |
+
* ---------------- | ------------ | ------------- | -------
|
51575 |
+
* default | 0 | 100 | 100
|
51576 |
+
* negative (spec*) | -100 | 0 | 0
|
51577 |
+
* reverse | 100 | 0 | 0
|
51578 |
+
*
|
51579 |
+
* Edge 85: default
|
51580 |
+
* Safari 14: negative
|
51581 |
+
* Chrome 85: negative
|
51582 |
+
* Firefox 81: negative
|
51583 |
+
* IE 11: reverse
|
51584 |
+
*
|
51585 |
+
* spec* https://drafts.csswg.org/cssom-view/#dom-window-scroll
|
51586 |
+
*/
|
51587 |
|
51588 |
+
function detectScrollType() {
|
51589 |
+
if (cachedType) {
|
51590 |
+
return cachedType;
|
51591 |
+
}
|
51592 |
|
51593 |
+
var dummy = document.createElement('div');
|
51594 |
+
var container = document.createElement('div');
|
51595 |
+
container.style.width = '10px';
|
51596 |
+
container.style.height = '1px';
|
51597 |
+
dummy.appendChild(container);
|
51598 |
+
dummy.dir = 'rtl';
|
51599 |
+
dummy.style.fontSize = '14px';
|
51600 |
+
dummy.style.width = '4px';
|
51601 |
+
dummy.style.height = '1px';
|
51602 |
+
dummy.style.position = 'absolute';
|
51603 |
+
dummy.style.top = '-1000px';
|
51604 |
+
dummy.style.overflow = 'scroll';
|
51605 |
+
document.body.appendChild(dummy);
|
51606 |
+
cachedType = 'reverse';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51607 |
|
51608 |
+
if (dummy.scrollLeft > 0) {
|
51609 |
+
cachedType = 'default';
|
51610 |
+
} else {
|
51611 |
+
dummy.scrollLeft = 1;
|
51612 |
|
51613 |
+
if (dummy.scrollLeft === 0) {
|
51614 |
+
cachedType = 'negative';
|
51615 |
+
}
|
51616 |
+
}
|
51617 |
|
51618 |
+
document.body.removeChild(dummy);
|
51619 |
+
return cachedType;
|
51620 |
+
} // Based on https://stackoverflow.com/a/24394376
|
51621 |
+
|
51622 |
+
function getNormalizedScrollLeft(element, direction) {
|
51623 |
+
var scrollLeft = element.scrollLeft; // Perform the calculations only when direction is rtl to avoid messing up the ltr bahavior
|
51624 |
+
|
51625 |
+
if (direction !== 'rtl') {
|
51626 |
+
return scrollLeft;
|
51627 |
+
}
|
51628 |
+
|
51629 |
+
var type = detectScrollType();
|
51630 |
+
|
51631 |
+
switch (type) {
|
51632 |
+
case 'negative':
|
51633 |
+
return element.scrollWidth - element.clientWidth + scrollLeft;
|
51634 |
+
|
51635 |
+
case 'reverse':
|
51636 |
+
return element.scrollWidth - element.clientWidth - scrollLeft;
|
51637 |
+
|
51638 |
+
default:
|
51639 |
+
return scrollLeft;
|
51640 |
+
}
|
51641 |
+
}
|
51642 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/animate.js
|
51643 |
+
function easeInOutSin(time) {
|
51644 |
+
return (1 + Math.sin(Math.PI * time - Math.PI / 2)) / 2;
|
51645 |
+
}
|
51646 |
+
|
51647 |
+
function animate(property, element, to) {
|
51648 |
+
var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
|
51649 |
+
var cb = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : function () {};
|
51650 |
+
var _options$ease = options.ease,
|
51651 |
+
ease = _options$ease === void 0 ? easeInOutSin : _options$ease,
|
51652 |
+
_options$duration = options.duration,
|
51653 |
+
duration = _options$duration === void 0 ? 300 : _options$duration;
|
51654 |
+
var start = null;
|
51655 |
+
var from = element[property];
|
51656 |
+
var cancelled = false;
|
51657 |
+
|
51658 |
+
var cancel = function cancel() {
|
51659 |
+
cancelled = true;
|
51660 |
+
};
|
51661 |
+
|
51662 |
+
var step = function step(timestamp) {
|
51663 |
+
if (cancelled) {
|
51664 |
+
cb(new Error('Animation cancelled'));
|
51665 |
+
return;
|
51666 |
+
}
|
51667 |
+
|
51668 |
+
if (start === null) {
|
51669 |
+
start = timestamp;
|
51670 |
+
}
|
51671 |
+
|
51672 |
+
var time = Math.min(1, (timestamp - start) / duration);
|
51673 |
+
element[property] = ease(time) * (to - from) + from;
|
51674 |
+
|
51675 |
+
if (time >= 1) {
|
51676 |
+
requestAnimationFrame(function () {
|
51677 |
+
cb(null);
|
51678 |
+
});
|
51679 |
+
return;
|
51680 |
+
}
|
51681 |
+
|
51682 |
+
requestAnimationFrame(step);
|
51683 |
+
};
|
51684 |
+
|
51685 |
+
if (from === to) {
|
51686 |
+
cb(new Error('Element already at target position'));
|
51687 |
+
return cancel;
|
51688 |
+
}
|
51689 |
+
|
51690 |
+
requestAnimationFrame(step);
|
51691 |
+
return cancel;
|
51692 |
+
}
|
51693 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/Tabs/ScrollbarSize.js
|
51694 |
+
|
51695 |
+
|
51696 |
+
|
51697 |
+
|
51698 |
+
|
51699 |
+
var ScrollbarSize_styles = {
|
51700 |
+
width: 99,
|
51701 |
+
height: 99,
|
51702 |
+
position: 'absolute',
|
51703 |
+
top: -9999,
|
51704 |
+
overflow: 'scroll'
|
51705 |
+
};
|
51706 |
+
/**
|
51707 |
+
* @ignore - internal component.
|
51708 |
+
* The component originates from https://github.com/STORIS/react-scrollbar-size.
|
51709 |
+
* It has been moved into the core in order to minimize the bundle size.
|
51710 |
+
*/
|
51711 |
|
51712 |
+
function ScrollbarSize(props) {
|
51713 |
+
var onChange = props.onChange,
|
51714 |
+
other = (0,objectWithoutProperties/* default */.Z)(props, ["onChange"]);
|
51715 |
|
51716 |
+
var scrollbarHeight = react.useRef();
|
51717 |
+
var nodeRef = react.useRef(null);
|
51718 |
+
|
51719 |
+
var setMeasurements = function setMeasurements() {
|
51720 |
+
scrollbarHeight.current = nodeRef.current.offsetHeight - nodeRef.current.clientHeight;
|
51721 |
+
};
|
51722 |
+
|
51723 |
+
react.useEffect(function () {
|
51724 |
+
var handleResize = (0,utils_debounce/* default */.Z)(function () {
|
51725 |
+
var prevHeight = scrollbarHeight.current;
|
51726 |
+
setMeasurements();
|
51727 |
+
|
51728 |
+
if (prevHeight !== scrollbarHeight.current) {
|
51729 |
+
onChange(scrollbarHeight.current);
|
51730 |
+
}
|
51731 |
+
});
|
51732 |
+
window.addEventListener('resize', handleResize);
|
51733 |
+
return function () {
|
51734 |
+
handleResize.clear();
|
51735 |
+
window.removeEventListener('resize', handleResize);
|
51736 |
};
|
51737 |
+
}, [onChange]);
|
51738 |
+
react.useEffect(function () {
|
51739 |
+
setMeasurements();
|
51740 |
+
onChange(scrollbarHeight.current);
|
51741 |
+
}, [onChange]);
|
51742 |
+
return /*#__PURE__*/react.createElement("div", (0,esm_extends/* default */.Z)({
|
51743 |
+
style: ScrollbarSize_styles,
|
51744 |
+
ref: nodeRef
|
51745 |
+
}, other));
|
51746 |
+
}
|
51747 |
+
false ? 0 : void 0;
|
51748 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/Tabs/TabIndicator.js
|
51749 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51750 |
|
|
|
|
|
51751 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51752 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51753 |
|
|
|
|
|
51754 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51755 |
|
51756 |
+
var TabIndicator_styles = function styles(theme) {
|
51757 |
+
return {
|
51758 |
+
root: {
|
51759 |
+
position: 'absolute',
|
51760 |
+
height: 2,
|
51761 |
+
bottom: 0,
|
51762 |
+
width: '100%',
|
51763 |
+
transition: theme.transitions.create()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51764 |
},
|
51765 |
+
colorPrimary: {
|
51766 |
+
backgroundColor: theme.palette.primary.main
|
|
|
|
|
|
|
|
|
|
|
|
|
51767 |
},
|
51768 |
+
colorSecondary: {
|
51769 |
+
backgroundColor: theme.palette.secondary.main
|
51770 |
+
},
|
51771 |
+
vertical: {
|
51772 |
+
height: '100%',
|
51773 |
+
width: 2,
|
51774 |
+
right: 0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51775 |
}
|
51776 |
+
};
|
51777 |
+
};
|
51778 |
+
/**
|
51779 |
+
* @ignore - internal component.
|
51780 |
+
*/
|
51781 |
|
51782 |
+
var TabIndicator = /*#__PURE__*/react.forwardRef(function TabIndicator(props, ref) {
|
51783 |
+
var classes = props.classes,
|
51784 |
+
className = props.className,
|
51785 |
+
color = props.color,
|
51786 |
+
orientation = props.orientation,
|
51787 |
+
other = (0,objectWithoutProperties/* default */.Z)(props, ["classes", "className", "color", "orientation"]);
|
51788 |
+
|
51789 |
+
return /*#__PURE__*/react.createElement("span", (0,esm_extends/* default */.Z)({
|
51790 |
+
className: (0,clsx_m/* default */.Z)(classes.root, classes["color".concat((0,utils_capitalize/* default */.Z)(color))], className, orientation === 'vertical' && classes.vertical),
|
51791 |
+
ref: ref
|
51792 |
+
}, other));
|
51793 |
});
|
51794 |
false ? 0 : void 0;
|
51795 |
+
/* harmony default export */ var Tabs_TabIndicator = ((0,withStyles/* default */.Z)(TabIndicator_styles, {
|
51796 |
+
name: 'PrivateTabIndicator'
|
51797 |
+
})(TabIndicator));
|
51798 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/svg-icons/KeyboardArrowLeft.js
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51799 |
|
|
|
51800 |
|
51801 |
+
/**
|
51802 |
+
* @ignore - internal component.
|
51803 |
+
*/
|
51804 |
|
51805 |
+
/* harmony default export */ var KeyboardArrowLeft = ((0,createSvgIcon/* default */.Z)( /*#__PURE__*/react.createElement("path", {
|
51806 |
+
d: "M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"
|
51807 |
+
}), 'KeyboardArrowLeft'));
|
51808 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/internal/svg-icons/KeyboardArrowRight.js
|
51809 |
|
|
|
51810 |
|
51811 |
+
/**
|
51812 |
+
* @ignore - internal component.
|
51813 |
+
*/
|
51814 |
|
51815 |
+
/* harmony default export */ var KeyboardArrowRight = ((0,createSvgIcon/* default */.Z)( /*#__PURE__*/react.createElement("path", {
|
51816 |
+
d: "M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"
|
51817 |
+
}), 'KeyboardArrowRight'));
|
51818 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/TabScrollButton/TabScrollButton.js
|
51819 |
|
51820 |
|
51821 |
|
51822 |
+
/* eslint-disable jsx-a11y/aria-role */
|
51823 |
|
51824 |
|
51825 |
|
51826 |
|
51827 |
|
51828 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51829 |
|
51830 |
+
var TabScrollButton_styles = {
|
51831 |
+
/* Styles applied to the root element. */
|
51832 |
+
root: {
|
51833 |
+
width: 40,
|
51834 |
+
flexShrink: 0,
|
51835 |
+
opacity: 0.8,
|
51836 |
+
'&$disabled': {
|
51837 |
+
opacity: 0
|
51838 |
+
}
|
51839 |
+
},
|
51840 |
|
51841 |
+
/* Styles applied to the root element if `orientation="vertical"`. */
|
51842 |
+
vertical: {
|
51843 |
+
width: '100%',
|
51844 |
+
height: 40,
|
51845 |
+
'& svg': {
|
51846 |
+
transform: 'rotate(90deg)'
|
51847 |
+
}
|
51848 |
+
},
|
51849 |
|
51850 |
+
/* Pseudo-class applied to the root element if `disabled={true}`. */
|
51851 |
+
disabled: {}
|
51852 |
+
};
|
|
|
51853 |
|
51854 |
+
var TabScrollButton_ref = /*#__PURE__*/react.createElement(KeyboardArrowLeft, {
|
51855 |
+
fontSize: "small"
|
51856 |
+
});
|
51857 |
+
|
51858 |
+
var TabScrollButton_ref2 = /*#__PURE__*/react.createElement(KeyboardArrowRight, {
|
51859 |
+
fontSize: "small"
|
51860 |
+
});
|
51861 |
+
|
51862 |
+
var TabScrollButton = /*#__PURE__*/react.forwardRef(function TabScrollButton(props, ref) {
|
51863 |
+
var classes = props.classes,
|
51864 |
+
classNameProp = props.className,
|
51865 |
+
direction = props.direction,
|
51866 |
+
orientation = props.orientation,
|
51867 |
+
disabled = props.disabled,
|
51868 |
+
other = (0,objectWithoutProperties/* default */.Z)(props, ["classes", "className", "direction", "orientation", "disabled"]);
|
51869 |
+
|
51870 |
+
return /*#__PURE__*/react.createElement(ButtonBase_ButtonBase, (0,esm_extends/* default */.Z)({
|
51871 |
+
component: "div",
|
51872 |
+
className: (0,clsx_m/* default */.Z)(classes.root, classNameProp, disabled && classes.disabled, orientation === 'vertical' && classes.vertical),
|
51873 |
+
ref: ref,
|
51874 |
+
role: null,
|
51875 |
+
tabIndex: null
|
51876 |
+
}, other), direction === 'left' ? TabScrollButton_ref : TabScrollButton_ref2);
|
51877 |
+
});
|
51878 |
+
false ? 0 : void 0;
|
51879 |
+
/* harmony default export */ var TabScrollButton_TabScrollButton = ((0,withStyles/* default */.Z)(TabScrollButton_styles, {
|
51880 |
+
name: 'MuiTabScrollButton'
|
51881 |
+
})(TabScrollButton));
|
51882 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/Tabs/Tabs.js
|
51883 |
+
|
51884 |
+
|
51885 |
+
|
51886 |
+
|
51887 |
+
|
51888 |
+
|
51889 |
+
|
51890 |
+
|
51891 |
+
|
51892 |
+
|
51893 |
+
|
51894 |
+
|
51895 |
+
|
51896 |
+
|
51897 |
+
|
51898 |
+
|
51899 |
+
|
51900 |
+
|
51901 |
+
var Tabs_styles = function styles(theme) {
|
51902 |
+
return {
|
51903 |
+
/* Styles applied to the root element. */
|
51904 |
+
root: {
|
51905 |
+
overflow: 'hidden',
|
51906 |
+
minHeight: 48,
|
51907 |
+
WebkitOverflowScrolling: 'touch',
|
51908 |
+
// Add iOS momentum scrolling.
|
51909 |
+
display: 'flex'
|
51910 |
},
|
51911 |
+
|
51912 |
+
/* Styles applied to the root element if `orientation="vertical"`. */
|
51913 |
+
vertical: {
|
51914 |
+
flexDirection: 'column'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51915 |
},
|
51916 |
+
|
51917 |
+
/* Styles applied to the flex container element. */
|
51918 |
+
flexContainer: {
|
51919 |
+
display: 'flex'
|
51920 |
},
|
51921 |
+
|
51922 |
+
/* Styles applied to the flex container element if `orientation="vertical"`. */
|
51923 |
+
flexContainerVertical: {
|
51924 |
+
flexDirection: 'column'
|
51925 |
},
|
51926 |
+
|
51927 |
+
/* Styles applied to the flex container element if `centered={true}` & `!variant="scrollable"`. */
|
51928 |
+
centered: {
|
51929 |
+
justifyContent: 'center'
|
51930 |
},
|
51931 |
+
|
51932 |
+
/* Styles applied to the tablist element. */
|
51933 |
+
scroller: {
|
51934 |
+
position: 'relative',
|
51935 |
+
display: 'inline-block',
|
51936 |
+
flex: '1 1 auto',
|
51937 |
+
whiteSpace: 'nowrap'
|
51938 |
},
|
51939 |
+
|
51940 |
+
/* Styles applied to the tablist element if `!variant="scrollable"`. */
|
51941 |
+
fixed: {
|
51942 |
+
overflowX: 'hidden',
|
51943 |
+
width: '100%'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
51944 |
},
|
51945 |
+
|
51946 |
+
/* Styles applied to the tablist element if `variant="scrollable"`. */
|
51947 |
+
scrollable: {
|
51948 |
+
overflowX: 'scroll',
|
51949 |
+
// Hide dimensionless scrollbar on MacOS
|
51950 |
+
scrollbarWidth: 'none',
|
51951 |
+
// Firefox
|
51952 |
+
'&::-webkit-scrollbar': {
|
51953 |
+
display: 'none' // Safari + Chrome
|
51954 |
+
|
51955 |
+
}
|
51956 |
},
|
51957 |
+
|
51958 |
+
/* Styles applied to the `ScrollButtonComponent` component. */
|
51959 |
+
scrollButtons: {},
|
51960 |
+
|
51961 |
+
/* Styles applied to the `ScrollButtonComponent` component if `scrollButtons="auto"` or scrollButtons="desktop"`. */
|
51962 |
+
scrollButtonsDesktop: (0,defineProperty/* default */.Z)({}, theme.breakpoints.down('xs'), {
|
51963 |
+
display: 'none'
|
51964 |
+
}),
|
51965 |
+
|
51966 |
+
/* Styles applied to the `TabIndicator` component. */
|
51967 |
+
indicator: {}
|
51968 |
+
};
|
51969 |
};
|
51970 |
+
var Tabs = /*#__PURE__*/react.forwardRef(function Tabs(props, ref) {
|
51971 |
+
var ariaLabel = props['aria-label'],
|
51972 |
+
ariaLabelledBy = props['aria-labelledby'],
|
51973 |
+
action = props.action,
|
51974 |
+
_props$centered = props.centered,
|
51975 |
+
centered = _props$centered === void 0 ? false : _props$centered,
|
51976 |
+
childrenProp = props.children,
|
51977 |
+
classes = props.classes,
|
51978 |
+
className = props.className,
|
51979 |
+
_props$component = props.component,
|
51980 |
+
Component = _props$component === void 0 ? 'div' : _props$component,
|
51981 |
+
_props$indicatorColor = props.indicatorColor,
|
51982 |
+
indicatorColor = _props$indicatorColor === void 0 ? 'secondary' : _props$indicatorColor,
|
51983 |
+
onChange = props.onChange,
|
51984 |
+
_props$orientation = props.orientation,
|
51985 |
+
orientation = _props$orientation === void 0 ? 'horizontal' : _props$orientation,
|
51986 |
+
_props$ScrollButtonCo = props.ScrollButtonComponent,
|
51987 |
+
ScrollButtonComponent = _props$ScrollButtonCo === void 0 ? TabScrollButton_TabScrollButton : _props$ScrollButtonCo,
|
51988 |
+
_props$scrollButtons = props.scrollButtons,
|
51989 |
+
scrollButtons = _props$scrollButtons === void 0 ? 'auto' : _props$scrollButtons,
|
51990 |
+
selectionFollowsFocus = props.selectionFollowsFocus,
|
51991 |
+
_props$TabIndicatorPr = props.TabIndicatorProps,
|
51992 |
+
TabIndicatorProps = _props$TabIndicatorPr === void 0 ? {} : _props$TabIndicatorPr,
|
51993 |
+
TabScrollButtonProps = props.TabScrollButtonProps,
|
51994 |
+
_props$textColor = props.textColor,
|
51995 |
+
textColor = _props$textColor === void 0 ? 'inherit' : _props$textColor,
|
51996 |
+
value = props.value,
|
51997 |
+
_props$variant = props.variant,
|
51998 |
+
variant = _props$variant === void 0 ? 'standard' : _props$variant,
|
51999 |
+
other = (0,objectWithoutProperties/* default */.Z)(props, ["aria-label", "aria-labelledby", "action", "centered", "children", "classes", "className", "component", "indicatorColor", "onChange", "orientation", "ScrollButtonComponent", "scrollButtons", "selectionFollowsFocus", "TabIndicatorProps", "TabScrollButtonProps", "textColor", "value", "variant"]);
|
52000 |
+
|
52001 |
+
var theme = useTheme_useTheme();
|
52002 |
+
var scrollable = variant === 'scrollable';
|
52003 |
+
var isRtl = theme.direction === 'rtl';
|
52004 |
+
var vertical = orientation === 'vertical';
|
52005 |
+
var scrollStart = vertical ? 'scrollTop' : 'scrollLeft';
|
52006 |
+
var start = vertical ? 'top' : 'left';
|
52007 |
+
var end = vertical ? 'bottom' : 'right';
|
52008 |
+
var clientSize = vertical ? 'clientHeight' : 'clientWidth';
|
52009 |
+
var size = vertical ? 'height' : 'width';
|
52010 |
+
|
52011 |
+
if (false) {}
|
52012 |
+
|
52013 |
+
var _React$useState = react.useState(false),
|
52014 |
+
mounted = _React$useState[0],
|
52015 |
+
setMounted = _React$useState[1];
|
52016 |
+
|
52017 |
+
var _React$useState2 = react.useState({}),
|
52018 |
+
indicatorStyle = _React$useState2[0],
|
52019 |
+
setIndicatorStyle = _React$useState2[1];
|
52020 |
+
|
52021 |
+
var _React$useState3 = react.useState({
|
52022 |
+
start: false,
|
52023 |
+
end: false
|
52024 |
+
}),
|
52025 |
+
displayScroll = _React$useState3[0],
|
52026 |
+
setDisplayScroll = _React$useState3[1];
|
52027 |
+
|
52028 |
+
var _React$useState4 = react.useState({
|
52029 |
+
overflow: 'hidden',
|
52030 |
+
marginBottom: null
|
52031 |
+
}),
|
52032 |
+
scrollerStyle = _React$useState4[0],
|
52033 |
+
setScrollerStyle = _React$useState4[1];
|
52034 |
+
|
52035 |
+
var valueToIndex = new Map();
|
52036 |
+
var tabsRef = react.useRef(null);
|
52037 |
+
var tabListRef = react.useRef(null);
|
52038 |
+
|
52039 |
+
var getTabsMeta = function getTabsMeta() {
|
52040 |
+
var tabsNode = tabsRef.current;
|
52041 |
+
var tabsMeta;
|
52042 |
+
|
52043 |
+
if (tabsNode) {
|
52044 |
+
var rect = tabsNode.getBoundingClientRect(); // create a new object with ClientRect class props + scrollLeft
|
52045 |
+
|
52046 |
+
tabsMeta = {
|
52047 |
+
clientWidth: tabsNode.clientWidth,
|
52048 |
+
scrollLeft: tabsNode.scrollLeft,
|
52049 |
+
scrollTop: tabsNode.scrollTop,
|
52050 |
+
scrollLeftNormalized: getNormalizedScrollLeft(tabsNode, theme.direction),
|
52051 |
+
scrollWidth: tabsNode.scrollWidth,
|
52052 |
+
top: rect.top,
|
52053 |
+
bottom: rect.bottom,
|
52054 |
+
left: rect.left,
|
52055 |
+
right: rect.right
|
52056 |
+
};
|
52057 |
+
}
|
52058 |
|
52059 |
+
var tabMeta;
|
52060 |
|
52061 |
+
if (tabsNode && value !== false) {
|
52062 |
+
var _children = tabListRef.current.children;
|
52063 |
|
52064 |
+
if (_children.length > 0) {
|
52065 |
+
var tab = _children[valueToIndex.get(value)];
|
52066 |
|
52067 |
+
if (false) {}
|
52068 |
|
52069 |
+
tabMeta = tab ? tab.getBoundingClientRect() : null;
|
52070 |
+
}
|
52071 |
+
}
|
52072 |
|
52073 |
+
return {
|
52074 |
+
tabsMeta: tabsMeta,
|
52075 |
+
tabMeta: tabMeta
|
52076 |
+
};
|
52077 |
+
};
|
52078 |
|
52079 |
+
var updateIndicatorState = (0,useEventCallback/* default */.Z)(function () {
|
52080 |
+
var _newIndicatorStyle;
|
52081 |
|
52082 |
+
var _getTabsMeta = getTabsMeta(),
|
52083 |
+
tabsMeta = _getTabsMeta.tabsMeta,
|
52084 |
+
tabMeta = _getTabsMeta.tabMeta;
|
52085 |
|
52086 |
+
var startValue = 0;
|
52087 |
|
52088 |
+
if (tabMeta && tabsMeta) {
|
52089 |
+
if (vertical) {
|
52090 |
+
startValue = tabMeta.top - tabsMeta.top + tabsMeta.scrollTop;
|
52091 |
+
} else {
|
52092 |
+
var correction = isRtl ? tabsMeta.scrollLeftNormalized + tabsMeta.clientWidth - tabsMeta.scrollWidth : tabsMeta.scrollLeft;
|
52093 |
+
startValue = tabMeta.left - tabsMeta.left + correction;
|
52094 |
+
}
|
52095 |
+
}
|
52096 |
|
52097 |
+
var newIndicatorStyle = (_newIndicatorStyle = {}, (0,defineProperty/* default */.Z)(_newIndicatorStyle, start, startValue), (0,defineProperty/* default */.Z)(_newIndicatorStyle, size, tabMeta ? tabMeta[size] : 0), _newIndicatorStyle);
|
52098 |
|
52099 |
+
if (isNaN(indicatorStyle[start]) || isNaN(indicatorStyle[size])) {
|
52100 |
+
setIndicatorStyle(newIndicatorStyle);
|
52101 |
+
} else {
|
52102 |
+
var dStart = Math.abs(indicatorStyle[start] - newIndicatorStyle[start]);
|
52103 |
+
var dSize = Math.abs(indicatorStyle[size] - newIndicatorStyle[size]);
|
52104 |
|
52105 |
+
if (dStart >= 1 || dSize >= 1) {
|
52106 |
+
setIndicatorStyle(newIndicatorStyle);
|
52107 |
+
}
|
52108 |
+
}
|
52109 |
+
});
|
52110 |
|
52111 |
+
var scroll = function scroll(scrollValue) {
|
52112 |
+
animate(scrollStart, tabsRef.current, scrollValue);
|
52113 |
+
};
|
|
|
|
|
|
|
|
|
52114 |
|
52115 |
+
var moveTabsScroll = function moveTabsScroll(delta) {
|
52116 |
+
var scrollValue = tabsRef.current[scrollStart];
|
|
|
|
|
52117 |
|
52118 |
+
if (vertical) {
|
52119 |
+
scrollValue += delta;
|
52120 |
+
} else {
|
52121 |
+
scrollValue += delta * (isRtl ? -1 : 1); // Fix for Edge
|
52122 |
|
52123 |
+
scrollValue *= isRtl && detectScrollType() === 'reverse' ? -1 : 1;
|
52124 |
+
}
|
|
|
|
|
52125 |
|
52126 |
+
scroll(scrollValue);
|
52127 |
+
};
|
|
|
|
|
52128 |
|
52129 |
+
var handleStartScrollClick = function handleStartScrollClick() {
|
52130 |
+
moveTabsScroll(-tabsRef.current[clientSize]);
|
|
|
|
|
|
|
|
|
52131 |
};
|
52132 |
|
52133 |
+
var handleEndScrollClick = function handleEndScrollClick() {
|
52134 |
+
moveTabsScroll(tabsRef.current[clientSize]);
|
52135 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52136 |
|
52137 |
+
var handleScrollbarSizeChange = react.useCallback(function (scrollbarHeight) {
|
52138 |
+
setScrollerStyle({
|
52139 |
+
overflow: null,
|
52140 |
+
marginBottom: -scrollbarHeight
|
52141 |
+
});
|
52142 |
+
}, []);
|
52143 |
|
52144 |
+
var getConditionalElements = function getConditionalElements() {
|
52145 |
+
var conditionalElements = {};
|
52146 |
+
conditionalElements.scrollbarSizeListener = scrollable ? /*#__PURE__*/react.createElement(ScrollbarSize, {
|
52147 |
+
className: classes.scrollable,
|
52148 |
+
onChange: handleScrollbarSizeChange
|
52149 |
+
}) : null;
|
52150 |
+
var scrollButtonsActive = displayScroll.start || displayScroll.end;
|
52151 |
+
var showScrollButtons = scrollable && (scrollButtons === 'auto' && scrollButtonsActive || scrollButtons === 'desktop' || scrollButtons === 'on');
|
52152 |
+
conditionalElements.scrollButtonStart = showScrollButtons ? /*#__PURE__*/react.createElement(ScrollButtonComponent, (0,esm_extends/* default */.Z)({
|
52153 |
+
orientation: orientation,
|
52154 |
+
direction: isRtl ? 'right' : 'left',
|
52155 |
+
onClick: handleStartScrollClick,
|
52156 |
+
disabled: !displayScroll.start,
|
52157 |
+
className: (0,clsx_m/* default */.Z)(classes.scrollButtons, scrollButtons !== 'on' && classes.scrollButtonsDesktop)
|
52158 |
+
}, TabScrollButtonProps)) : null;
|
52159 |
+
conditionalElements.scrollButtonEnd = showScrollButtons ? /*#__PURE__*/react.createElement(ScrollButtonComponent, (0,esm_extends/* default */.Z)({
|
52160 |
+
orientation: orientation,
|
52161 |
+
direction: isRtl ? 'left' : 'right',
|
52162 |
+
onClick: handleEndScrollClick,
|
52163 |
+
disabled: !displayScroll.end,
|
52164 |
+
className: (0,clsx_m/* default */.Z)(classes.scrollButtons, scrollButtons !== 'on' && classes.scrollButtonsDesktop)
|
52165 |
+
}, TabScrollButtonProps)) : null;
|
52166 |
+
return conditionalElements;
|
52167 |
+
};
|
52168 |
|
52169 |
+
var scrollSelectedIntoView = (0,useEventCallback/* default */.Z)(function () {
|
52170 |
+
var _getTabsMeta2 = getTabsMeta(),
|
52171 |
+
tabsMeta = _getTabsMeta2.tabsMeta,
|
52172 |
+
tabMeta = _getTabsMeta2.tabMeta;
|
52173 |
|
52174 |
+
if (!tabMeta || !tabsMeta) {
|
52175 |
+
return;
|
52176 |
+
}
|
52177 |
|
52178 |
+
if (tabMeta[start] < tabsMeta[start]) {
|
52179 |
+
// left side of button is out of view
|
52180 |
+
var nextScrollStart = tabsMeta[scrollStart] + (tabMeta[start] - tabsMeta[start]);
|
52181 |
+
scroll(nextScrollStart);
|
52182 |
+
} else if (tabMeta[end] > tabsMeta[end]) {
|
52183 |
+
// right side of button is out of view
|
52184 |
+
var _nextScrollStart = tabsMeta[scrollStart] + (tabMeta[end] - tabsMeta[end]);
|
52185 |
|
52186 |
+
scroll(_nextScrollStart);
|
52187 |
+
}
|
52188 |
+
});
|
52189 |
+
var updateScrollButtonState = (0,useEventCallback/* default */.Z)(function () {
|
52190 |
+
if (scrollable && scrollButtons !== 'off') {
|
52191 |
+
var _tabsRef$current = tabsRef.current,
|
52192 |
+
scrollTop = _tabsRef$current.scrollTop,
|
52193 |
+
scrollHeight = _tabsRef$current.scrollHeight,
|
52194 |
+
clientHeight = _tabsRef$current.clientHeight,
|
52195 |
+
scrollWidth = _tabsRef$current.scrollWidth,
|
52196 |
+
clientWidth = _tabsRef$current.clientWidth;
|
52197 |
+
var showStartScroll;
|
52198 |
+
var showEndScroll;
|
52199 |
|
52200 |
+
if (vertical) {
|
52201 |
+
showStartScroll = scrollTop > 1;
|
52202 |
+
showEndScroll = scrollTop < scrollHeight - clientHeight - 1;
|
52203 |
+
} else {
|
52204 |
+
var scrollLeft = getNormalizedScrollLeft(tabsRef.current, theme.direction); // use 1 for the potential rounding error with browser zooms.
|
52205 |
|
52206 |
+
showStartScroll = isRtl ? scrollLeft < scrollWidth - clientWidth - 1 : scrollLeft > 1;
|
52207 |
+
showEndScroll = !isRtl ? scrollLeft < scrollWidth - clientWidth - 1 : scrollLeft > 1;
|
52208 |
+
}
|
52209 |
|
52210 |
+
if (showStartScroll !== displayScroll.start || showEndScroll !== displayScroll.end) {
|
52211 |
+
setDisplayScroll({
|
52212 |
+
start: showStartScroll,
|
52213 |
+
end: showEndScroll
|
52214 |
+
});
|
52215 |
+
}
|
52216 |
+
}
|
52217 |
+
});
|
52218 |
+
react.useEffect(function () {
|
52219 |
+
var handleResize = (0,utils_debounce/* default */.Z)(function () {
|
52220 |
+
updateIndicatorState();
|
52221 |
+
updateScrollButtonState();
|
52222 |
+
});
|
52223 |
+
var win = (0,ownerWindow/* default */.Z)(tabsRef.current);
|
52224 |
+
win.addEventListener('resize', handleResize);
|
52225 |
+
return function () {
|
52226 |
+
handleResize.clear();
|
52227 |
+
win.removeEventListener('resize', handleResize);
|
52228 |
+
};
|
52229 |
+
}, [updateIndicatorState, updateScrollButtonState]);
|
52230 |
+
var handleTabsScroll = react.useCallback((0,utils_debounce/* default */.Z)(function () {
|
52231 |
+
updateScrollButtonState();
|
52232 |
+
}));
|
52233 |
+
react.useEffect(function () {
|
52234 |
+
return function () {
|
52235 |
+
handleTabsScroll.clear();
|
52236 |
+
};
|
52237 |
+
}, [handleTabsScroll]);
|
52238 |
+
react.useEffect(function () {
|
52239 |
+
setMounted(true);
|
52240 |
+
}, []);
|
52241 |
+
react.useEffect(function () {
|
52242 |
+
updateIndicatorState();
|
52243 |
+
updateScrollButtonState();
|
52244 |
+
});
|
52245 |
+
react.useEffect(function () {
|
52246 |
+
scrollSelectedIntoView();
|
52247 |
+
}, [scrollSelectedIntoView, indicatorStyle]);
|
52248 |
+
react.useImperativeHandle(action, function () {
|
52249 |
+
return {
|
52250 |
+
updateIndicator: updateIndicatorState,
|
52251 |
+
updateScrollButtons: updateScrollButtonState
|
52252 |
+
};
|
52253 |
+
}, [updateIndicatorState, updateScrollButtonState]);
|
52254 |
+
var indicator = /*#__PURE__*/react.createElement(Tabs_TabIndicator, (0,esm_extends/* default */.Z)({
|
52255 |
+
className: classes.indicator,
|
52256 |
+
orientation: orientation,
|
52257 |
+
color: indicatorColor
|
52258 |
+
}, TabIndicatorProps, {
|
52259 |
+
style: (0,esm_extends/* default */.Z)({}, indicatorStyle, TabIndicatorProps.style)
|
52260 |
+
}));
|
52261 |
+
var childIndex = 0;
|
52262 |
+
var children = react.Children.map(childrenProp, function (child) {
|
52263 |
+
if (! /*#__PURE__*/react.isValidElement(child)) {
|
52264 |
+
return null;
|
52265 |
+
}
|
52266 |
|
52267 |
+
if (false) {}
|
52268 |
|
52269 |
+
var childValue = child.props.value === undefined ? childIndex : child.props.value;
|
52270 |
+
valueToIndex.set(childValue, childIndex);
|
52271 |
+
var selected = childValue === value;
|
52272 |
+
childIndex += 1;
|
52273 |
+
return /*#__PURE__*/react.cloneElement(child, {
|
52274 |
+
fullWidth: variant === 'fullWidth',
|
52275 |
+
indicator: selected && !mounted && indicator,
|
52276 |
+
selected: selected,
|
52277 |
+
selectionFollowsFocus: selectionFollowsFocus,
|
52278 |
+
onChange: onChange,
|
52279 |
+
textColor: textColor,
|
52280 |
+
value: childValue
|
52281 |
+
});
|
52282 |
+
});
|
52283 |
|
52284 |
+
var handleKeyDown = function handleKeyDown(event) {
|
52285 |
+
var target = event.target; // Keyboard navigation assumes that [role="tab"] are siblings
|
52286 |
+
// though we might warn in the future about nested, interactive elements
|
52287 |
+
// as a a11y violation
|
52288 |
|
52289 |
+
var role = target.getAttribute('role');
|
52290 |
+
|
52291 |
+
if (role !== 'tab') {
|
52292 |
+
return;
|
52293 |
+
}
|
52294 |
|
52295 |
+
var newFocusTarget = null;
|
52296 |
+
var previousItemKey = orientation !== "vertical" ? 'ArrowLeft' : 'ArrowUp';
|
52297 |
+
var nextItemKey = orientation !== "vertical" ? 'ArrowRight' : 'ArrowDown';
|
52298 |
|
52299 |
+
if (orientation !== "vertical" && theme.direction === 'rtl') {
|
52300 |
+
// swap previousItemKey with nextItemKey
|
52301 |
+
previousItemKey = 'ArrowRight';
|
52302 |
+
nextItemKey = 'ArrowLeft';
|
52303 |
+
}
|
52304 |
|
52305 |
+
switch (event.key) {
|
52306 |
+
case previousItemKey:
|
52307 |
+
newFocusTarget = target.previousElementSibling || tabListRef.current.lastChild;
|
52308 |
+
break;
|
52309 |
|
52310 |
+
case nextItemKey:
|
52311 |
+
newFocusTarget = target.nextElementSibling || tabListRef.current.firstChild;
|
52312 |
+
break;
|
52313 |
|
52314 |
+
case 'Home':
|
52315 |
+
newFocusTarget = tabListRef.current.firstChild;
|
52316 |
+
break;
|
52317 |
|
52318 |
+
case 'End':
|
52319 |
+
newFocusTarget = tabListRef.current.lastChild;
|
52320 |
+
break;
|
52321 |
|
52322 |
+
default:
|
52323 |
+
break;
|
52324 |
+
}
|
52325 |
|
52326 |
+
if (newFocusTarget !== null) {
|
52327 |
+
newFocusTarget.focus();
|
52328 |
+
event.preventDefault();
|
52329 |
+
}
|
52330 |
+
};
|
52331 |
|
52332 |
+
var conditionalElements = getConditionalElements();
|
52333 |
+
return /*#__PURE__*/react.createElement(Component, (0,esm_extends/* default */.Z)({
|
52334 |
+
className: (0,clsx_m/* default */.Z)(classes.root, className, vertical && classes.vertical),
|
52335 |
+
ref: ref
|
52336 |
+
}, other), conditionalElements.scrollButtonStart, conditionalElements.scrollbarSizeListener, /*#__PURE__*/react.createElement("div", {
|
52337 |
+
className: (0,clsx_m/* default */.Z)(classes.scroller, scrollable ? classes.scrollable : classes.fixed),
|
52338 |
+
style: scrollerStyle,
|
52339 |
+
ref: tabsRef,
|
52340 |
+
onScroll: handleTabsScroll
|
52341 |
+
}, /*#__PURE__*/react.createElement("div", {
|
52342 |
+
"aria-label": ariaLabel,
|
52343 |
+
"aria-labelledby": ariaLabelledBy,
|
52344 |
+
className: (0,clsx_m/* default */.Z)(classes.flexContainer, vertical && classes.flexContainerVertical, centered && !scrollable && classes.centered),
|
52345 |
+
onKeyDown: handleKeyDown,
|
52346 |
+
ref: tabListRef,
|
52347 |
+
role: "tablist"
|
52348 |
+
}, children), mounted && indicator), conditionalElements.scrollButtonEnd);
|
52349 |
+
});
|
52350 |
+
false ? 0 : void 0;
|
52351 |
+
/* harmony default export */ var Tabs_Tabs = ((0,withStyles/* default */.Z)(Tabs_styles, {
|
52352 |
+
name: 'MuiTabs'
|
52353 |
+
})(Tabs));
|
52354 |
+
// EXTERNAL MODULE: ./node_modules/@material-ui/styles/esm/makeStyles/makeStyles.js + 4 modules
|
52355 |
+
var makeStyles = __webpack_require__(73914);
|
52356 |
+
;// CONCATENATED MODULE: ./node_modules/@material-ui/core/esm/styles/makeStyles.js
|
52357 |
|
52358 |
|
52359 |
|
52360 |
|
52361 |
+
function makeStyles_makeStyles(stylesOrCreator) {
|
52362 |
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
52363 |
+
return (0,makeStyles/* default */.Z)(stylesOrCreator, (0,esm_extends/* default */.Z)({
|
52364 |
+
defaultTheme: defaultTheme/* default */.Z
|
52365 |
+
}, options));
|
52366 |
+
}
|
52367 |
|
52368 |
+
/* harmony default export */ var styles_makeStyles = (makeStyles_makeStyles);
|
52369 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Containers/ContainerSettings/BreadcrumbSelect/BreadcrumbSelect.js
|
52370 |
+
function BreadcrumbSelect_slicedToArray(arr, i) { return BreadcrumbSelect_arrayWithHoles(arr) || BreadcrumbSelect_iterableToArrayLimit(arr, i) || BreadcrumbSelect_unsupportedIterableToArray(arr, i) || BreadcrumbSelect_nonIterableRest(); }
|
52371 |
|
52372 |
+
function BreadcrumbSelect_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
52373 |
|
52374 |
+
function BreadcrumbSelect_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return BreadcrumbSelect_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return BreadcrumbSelect_arrayLikeToArray(o, minLen); }
|
52375 |
|
52376 |
+
function BreadcrumbSelect_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
52377 |
|
52378 |
+
function BreadcrumbSelect_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
52379 |
|
52380 |
+
function BreadcrumbSelect_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
52381 |
|
52382 |
|
52383 |
|
52384 |
|
52385 |
|
52386 |
|
|
|
|
|
|
|
|
|
52387 |
|
52388 |
|
52389 |
+
var useStyles = styles_makeStyles(function () {
|
52390 |
+
return {
|
52391 |
+
selected: {
|
52392 |
+
color: "#ed8219",
|
52393 |
+
backgroundColor: "#fae1ca !important",
|
52394 |
+
cursor: "default",
|
52395 |
+
pointerEvents: "none"
|
52396 |
+
}
|
52397 |
+
};
|
52398 |
+
});
|
52399 |
|
52400 |
+
function BreadcrumbSelect(_ref) {
|
52401 |
+
var button = _ref.button,
|
52402 |
+
group = _ref.group,
|
52403 |
groups = _ref.groups,
|
52404 |
+
history = _ref.history,
|
52405 |
+
getChildrenIndex = _ref.getChildrenIndex;
|
52406 |
+
var page = "";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52407 |
|
52408 |
+
if (["style", "general", "advanced"].indexOf(history.location.pathname.substr(history.location.pathname.lastIndexOf("/") + 1)) > -1) {
|
52409 |
+
page = "/".concat(history.location.pathname.substr(history.location.pathname.lastIndexOf("/") + 1));
|
52410 |
+
}
|
|
|
52411 |
|
52412 |
+
var _React$useState = react.useState(null),
|
52413 |
+
_React$useState2 = BreadcrumbSelect_slicedToArray(_React$useState, 2),
|
52414 |
+
anchorEl = _React$useState2[0],
|
52415 |
+
setAnchorEl = _React$useState2[1];
|
52416 |
|
52417 |
+
var classes = useStyles();
|
|
|
|
|
|
|
52418 |
|
52419 |
+
var handleClick = function handleClick(event) {
|
52420 |
+
setAnchorEl(event.currentTarget);
|
|
|
|
|
|
|
52421 |
};
|
52422 |
|
52423 |
+
var handleClose = function handleClose() {
|
52424 |
+
setAnchorEl(null);
|
52425 |
+
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52426 |
|
52427 |
+
var handleRedirect = function handleRedirect(objectId) {
|
52428 |
+
setAnchorEl(null); // If button is defined and not group
|
52429 |
+
|
52430 |
+
if (button) {
|
52431 |
+
history.push("/group/".concat(button.parent, "/button/").concat(objectId).concat(page));
|
52432 |
+
} // If group is defined and not button
|
52433 |
+
else if (group) {
|
52434 |
+
history.push("/group/".concat(objectId).concat(page));
|
52435 |
+
}
|
|
|
|
|
52436 |
};
|
52437 |
|
52438 |
+
var open = Boolean(anchorEl);
|
52439 |
+
var id = open ? "simple-popover" : undefined; // Return Element
|
52440 |
+
|
52441 |
+
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(Button_Button, {
|
52442 |
+
className: "breadcrumb-button",
|
52443 |
+
"aria-describedby": id,
|
52444 |
+
color: "secondary",
|
52445 |
+
variant: "contained",
|
52446 |
+
onClick: handleClick,
|
52447 |
+
"data-testid": "breadcrumb:button"
|
52448 |
+
}, /*#__PURE__*/react.createElement("span", {
|
52449 |
+
className: "breadcrumb-text",
|
52450 |
+
"data-testid": "breadcrumb:name"
|
52451 |
+
}, button ? button.name : group.name), /*#__PURE__*/react.createElement("i", {
|
52452 |
+
className: "fas fa-chevron-down"
|
52453 |
+
})), /*#__PURE__*/react.createElement(Popover_Popover, {
|
52454 |
+
id: id,
|
52455 |
+
className: "button-select-menu",
|
52456 |
+
open: open,
|
52457 |
+
anchorEl: anchorEl,
|
52458 |
+
onClose: handleClose,
|
52459 |
+
anchorOrigin: {
|
52460 |
+
vertical: "bottom",
|
52461 |
+
horizontal: "center"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52462 |
},
|
52463 |
+
transformOrigin: {
|
52464 |
+
vertical: "top",
|
52465 |
+
horizontal: "center"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52466 |
},
|
52467 |
+
"data-testid": "breadcrumb:popup"
|
52468 |
+
}, button ? Object.values(getChildrenIndex(groups[button.parent].children)).map(function (buttonData, key) {
|
52469 |
+
return /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
52470 |
+
key: key,
|
52471 |
+
className: "breadcrumb-select-options",
|
52472 |
+
onClick: function onClick() {
|
52473 |
+
return handleRedirect(buttonData.id);
|
52474 |
+
},
|
52475 |
+
"data-testid": "breadcrumbitem:".concat(dlv_umd_default()(buttonData, "name", "test-id")),
|
52476 |
+
classes: {
|
52477 |
+
selected: classes.selected
|
52478 |
+
},
|
52479 |
+
selected: button.id === buttonData.id
|
52480 |
+
}, buttonData.name);
|
52481 |
+
}) : Object.entries(groups).map(function (groupData, key) {
|
52482 |
+
return /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
52483 |
+
className: "breadcrumb-select-options",
|
52484 |
+
key: key,
|
52485 |
+
onClick: function onClick() {
|
52486 |
+
return handleRedirect(groupData[1].id);
|
52487 |
+
},
|
52488 |
+
classes: {
|
52489 |
+
selected: classes.selected
|
52490 |
+
},
|
52491 |
+
"data-testid": "breadcrumbitem:".concat(dlv_umd_default()(groupData[1], "name", "test-id")),
|
52492 |
+
selected: button ? button.parent === groupData[1].id : group.id === groupData[1].id
|
52493 |
+
}, groupData[1].name);
|
52494 |
+
})));
|
52495 |
}
|
52496 |
|
52497 |
+
var BreadcrumbSelectWithRouter = withRouter(BreadcrumbSelect);
|
52498 |
+
/* harmony default export */ var BreadcrumbSelect_BreadcrumbSelect = (connect(function (state) {
|
52499 |
return {
|
|
|
|
|
|
|
|
|
|
|
|
|
52500 |
groups: state.groups,
|
52501 |
+
getChildrenIndex: function getChildrenIndex(groupId) {
|
52502 |
+
return selectors_getChildrenIndex(groupId, state);
|
52503 |
+
}
|
|
|
|
|
|
|
|
|
|
|
52504 |
};
|
52505 |
+
})(BreadcrumbSelectWithRouter));
|
52506 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Containers/ButtonContainer/ButtonHeader/ButtonHeader.js
|
52507 |
+
function ButtonHeader_extends() { ButtonHeader_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return ButtonHeader_extends.apply(this, arguments); }
|
52508 |
|
|
|
|
|
52509 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52510 |
|
52511 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52512 |
|
|
|
52513 |
|
|
|
52514 |
|
|
|
52515 |
|
|
|
52516 |
|
|
|
52517 |
|
52518 |
+
function ButtonHeader(_ref) {
|
52519 |
+
var group = _ref.group,
|
52520 |
+
button = _ref.button,
|
52521 |
+
history = _ref.history,
|
52522 |
+
_ref$tab = _ref.tab,
|
52523 |
+
tab = _ref$tab === void 0 ? 0 : _ref$tab;
|
52524 |
|
52525 |
+
var LinkTab = function LinkTab(props) {
|
52526 |
+
var url = "/group/".concat(group.id, "/button/").concat(button.id, "/").concat(props.page);
|
52527 |
+
return /*#__PURE__*/react.createElement(Tab_Tab, ButtonHeader_extends({
|
52528 |
+
component: "a",
|
52529 |
+
href: "#".concat(url),
|
52530 |
+
onClick: function onClick() {
|
52531 |
+
if (history.location.pathname !== url) {
|
52532 |
+
history.push(url);
|
52533 |
+
}
|
52534 |
+
},
|
52535 |
+
"data-testid": "buttongroupheader:button:".concat(props.page)
|
52536 |
+
}, props));
|
52537 |
+
};
|
52538 |
|
52539 |
+
return /*#__PURE__*/react.createElement("div", {
|
52540 |
+
className: "bar-header"
|
52541 |
+
}, /*#__PURE__*/react.createElement("div", {
|
52542 |
+
className: "breadcrumb"
|
52543 |
+
}, /*#__PURE__*/react.createElement(Tippy_Tippy, {
|
52544 |
+
content: translate("bar.breadcrumb.tippy_home"),
|
52545 |
+
arrow: false
|
52546 |
+
}, /*#__PURE__*/react.createElement(Button_Button, {
|
52547 |
+
onClick: function onClick() {
|
52548 |
+
history.push("/");
|
52549 |
+
},
|
52550 |
+
color: "primary",
|
52551 |
+
className: "home-button"
|
52552 |
+
}, /*#__PURE__*/react.createElement("span", {
|
52553 |
+
className: "breadcrumb-text"
|
52554 |
+
}, translate("bar.breadcrumb.home")), /*#__PURE__*/react.createElement("i", {
|
52555 |
+
className: "fas fa-chevron-right"
|
52556 |
+
}))), /*#__PURE__*/react.createElement(Tippy_Tippy, {
|
52557 |
+
content: translate("bar.breadcrumb.tippy_group"),
|
52558 |
+
arrow: false
|
52559 |
+
}, /*#__PURE__*/react.createElement(Button_Button, {
|
52560 |
+
onClick: function onClick() {
|
52561 |
+
history.push("/group/".concat(group.id));
|
52562 |
+
},
|
52563 |
+
color: "primary"
|
52564 |
+
}, /*#__PURE__*/react.createElement("span", {
|
52565 |
+
className: "breadcrumb-text"
|
52566 |
+
}, group.name), /*#__PURE__*/react.createElement("i", {
|
52567 |
+
className: "fas fa-chevron-right"
|
52568 |
+
}))), /*#__PURE__*/react.createElement(BreadcrumbSelect_BreadcrumbSelect, {
|
52569 |
+
button: button
|
52570 |
+
})), /*#__PURE__*/react.createElement(RandomTip_RandomTip, null), /*#__PURE__*/react.createElement("div", {
|
52571 |
+
className: "back-to-group"
|
52572 |
+
}, /*#__PURE__*/react.createElement("a", {
|
52573 |
+
href: "#/group/" + group.id
|
52574 |
+
}, /*#__PURE__*/react.createElement("i", {
|
52575 |
+
className: "fas fa-chevron-down"
|
52576 |
+
}), translate("bar.edit_group_settings"))), /*#__PURE__*/react.createElement("div", {
|
52577 |
+
className: "mdc-card top-header"
|
52578 |
+
}, /*#__PURE__*/react.createElement(Tabs_Tabs, {
|
52579 |
+
value: tab,
|
52580 |
+
variant: "fullWidth",
|
52581 |
+
indicatorColor: "secondary",
|
52582 |
+
textColor: "secondary",
|
52583 |
+
className: "tab-bordered"
|
52584 |
+
}, /*#__PURE__*/react.createElement(LinkTab, {
|
52585 |
+
label: translate("settings.setting_categories.general"),
|
52586 |
+
id: 0,
|
52587 |
+
page: "general",
|
52588 |
+
"data-testid": "general-tab",
|
52589 |
+
icon: /*#__PURE__*/react.createElement("i", {
|
52590 |
+
className: "fas fa-wrench"
|
52591 |
+
})
|
52592 |
+
}), /*#__PURE__*/react.createElement(LinkTab, {
|
52593 |
+
label: translate("utils.style"),
|
52594 |
+
id: 1,
|
52595 |
+
page: "style",
|
52596 |
+
"data-testid": "style-tab",
|
52597 |
+
icon: /*#__PURE__*/react.createElement("i", {
|
52598 |
+
className: "fas fa-paint-brush"
|
52599 |
+
})
|
52600 |
+
}), /*#__PURE__*/react.createElement(LinkTab, {
|
52601 |
+
label: translate("utils.advanced"),
|
52602 |
+
id: 2,
|
52603 |
+
page: "advanced",
|
52604 |
+
"data-testid": "advanced-tab",
|
52605 |
+
icon: /*#__PURE__*/react.createElement("i", {
|
52606 |
+
className: "fas fa-sliders-h"
|
52607 |
+
})
|
52608 |
+
}))));
|
52609 |
+
}
|
52610 |
|
52611 |
+
/* harmony default export */ var ButtonHeader_ButtonHeader = (withRouter(ButtonHeader));
|
52612 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/CollapsibleGroup/CollapsibleGroup.js
|
52613 |
+
function CollapsibleGroup_extends() { CollapsibleGroup_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return CollapsibleGroup_extends.apply(this, arguments); }
|
52614 |
|
52615 |
+
function CollapsibleGroup_slicedToArray(arr, i) { return CollapsibleGroup_arrayWithHoles(arr) || CollapsibleGroup_iterableToArrayLimit(arr, i) || CollapsibleGroup_unsupportedIterableToArray(arr, i) || CollapsibleGroup_nonIterableRest(); }
|
52616 |
|
52617 |
+
function CollapsibleGroup_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
52618 |
|
52619 |
+
function CollapsibleGroup_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return CollapsibleGroup_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return CollapsibleGroup_arrayLikeToArray(o, minLen); }
|
52620 |
|
52621 |
+
function CollapsibleGroup_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
52622 |
|
52623 |
+
function CollapsibleGroup_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
52624 |
|
52625 |
+
function CollapsibleGroup_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
52626 |
|
52627 |
+
function CollapsibleGroup_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = CollapsibleGroup_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
52628 |
|
52629 |
+
function CollapsibleGroup_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
52630 |
|
52631 |
|
52632 |
|
52633 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52634 |
|
52635 |
+
function CollapsibleGroup(_ref) {
|
52636 |
+
var _ref$opened = _ref.opened,
|
52637 |
+
opened = _ref$opened === void 0 ? false : _ref$opened,
|
52638 |
+
_ref$title = _ref.title,
|
52639 |
+
title = _ref$title === void 0 ? "" : _ref$title,
|
52640 |
+
_ref$bodySpacing = _ref.bodySpacing,
|
52641 |
+
bodySpacing = _ref$bodySpacing === void 0 ? true : _ref$bodySpacing,
|
52642 |
+
_ref$className = _ref.className,
|
52643 |
+
className = _ref$className === void 0 ? null : _ref$className,
|
52644 |
+
children = _ref.children,
|
52645 |
+
onSetIsOpened = _ref.onSetIsOpened,
|
52646 |
+
groupProps = CollapsibleGroup_objectWithoutProperties(_ref, ["opened", "title", "bodySpacing", "className", "children", "onSetIsOpened"]);
|
52647 |
|
52648 |
+
if (children == null) return null;
|
|
|
|
|
|
|
52649 |
|
52650 |
+
var _useState = (0,react.useState)(opened),
|
52651 |
+
_useState2 = CollapsibleGroup_slicedToArray(_useState, 2),
|
52652 |
+
isOpened = _useState2[0],
|
52653 |
+
setIsOpened = _useState2[1];
|
52654 |
|
52655 |
(0,react.useEffect)(function () {
|
52656 |
+
setIsOpened(opened);
|
52657 |
+
}, [opened]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52658 |
|
52659 |
+
var handleClick = function handleClick() {
|
52660 |
+
var newIsOpened = !isOpened;
|
52661 |
+
onSetIsOpened && onSetIsOpened(newIsOpened);
|
52662 |
+
setIsOpened(newIsOpened);
|
52663 |
+
};
|
52664 |
|
52665 |
+
return /*#__PURE__*/react.createElement("div", {
|
52666 |
+
className: (0,clsx_m/* default */.Z)("collapsible-group mdc-card", isOpened && "collapsible-opened", className)
|
52667 |
+
}, /*#__PURE__*/react.createElement(Button_Button, CollapsibleGroup_extends({
|
52668 |
+
onClick: handleClick,
|
52669 |
+
color: "primary"
|
52670 |
+
}, groupProps), title, " ", /*#__PURE__*/react.createElement("i", {
|
52671 |
+
className: "fas fa-chevron-down"
|
52672 |
+
})), isOpened && /*#__PURE__*/react.createElement("div", {
|
52673 |
+
className: (0,clsx_m/* default */.Z)(bodySpacing && "collapsible-body")
|
52674 |
+
}, children));
|
52675 |
+
}
|
52676 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/SettingsContainer/SettingsContainer.js
|
52677 |
+
function SettingsContainer_extends() { SettingsContainer_extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return SettingsContainer_extends.apply(this, arguments); }
|
52678 |
|
52679 |
+
function SettingsContainer_objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = SettingsContainer_objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
|
|
|
|
|
52680 |
|
52681 |
+
function SettingsContainer_objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
|
|
|
52682 |
|
52683 |
|
|
|
|
|
|
|
52684 |
|
|
|
|
|
52685 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52686 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52687 |
|
52688 |
+
function SettingsContainer(_ref) {
|
52689 |
+
var _ref$className = _ref.className,
|
52690 |
+
className = _ref$className === void 0 ? null : _ref$className,
|
52691 |
+
_ref$title = _ref.title,
|
52692 |
+
title = _ref$title === void 0 ? null : _ref$title,
|
52693 |
+
_ref$children = _ref.children,
|
52694 |
+
children = _ref$children === void 0 ? null : _ref$children,
|
52695 |
+
_ref$fullWidth = _ref.fullWidth,
|
52696 |
+
fullWidth = _ref$fullWidth === void 0 ? true : _ref$fullWidth,
|
52697 |
+
_ref$tooltip = _ref.tooltip,
|
52698 |
+
tooltip = _ref$tooltip === void 0 ? null : _ref$tooltip,
|
52699 |
+
props = SettingsContainer_objectWithoutProperties(_ref, ["className", "title", "children", "fullWidth", "tooltip"]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52700 |
|
52701 |
+
return /*#__PURE__*/react.createElement("div", SettingsContainer_extends({
|
52702 |
+
className: (0,clsx_m/* default */.Z)("settings-container", fullWidth && "container-full-width", className)
|
52703 |
+
}, props), title ? /*#__PURE__*/react.createElement("span", {
|
52704 |
+
className: "settings-title"
|
52705 |
+
}, title, tooltip == null ? null : /*#__PURE__*/react.createElement(Tippy_Tippy, {
|
52706 |
+
content: tooltip,
|
52707 |
+
ignorePreference: true,
|
52708 |
+
disabled: tooltip == null
|
52709 |
+
}, /*#__PURE__*/react.createElement(Icon_Icon, {
|
52710 |
+
color: "primary",
|
52711 |
+
fontSize: "small",
|
52712 |
+
className: "fas fa-info-circle"
|
52713 |
+
}))) : /*#__PURE__*/react.createElement(react.Fragment, null), /*#__PURE__*/react.createElement("div", {
|
52714 |
+
className: "settings-content"
|
52715 |
+
}, children));
|
52716 |
+
}
|
52717 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Settings/Visibility/Visibility.js
|
52718 |
+
function Visibility_slicedToArray(arr, i) { return Visibility_arrayWithHoles(arr) || Visibility_iterableToArrayLimit(arr, i) || Visibility_unsupportedIterableToArray(arr, i) || Visibility_nonIterableRest(); }
|
|
|
|
|
|
|
|
|
|
|
52719 |
|
52720 |
+
function Visibility_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
52721 |
|
52722 |
+
function Visibility_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Visibility_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Visibility_arrayLikeToArray(o, minLen); }
|
52723 |
|
52724 |
+
function Visibility_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52725 |
|
52726 |
+
function Visibility_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
52727 |
|
52728 |
+
function Visibility_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
52729 |
|
52730 |
|
52731 |
|
52733 |
|
52734 |
|
52735 |
|
52736 |
+
function Visibility(_ref) {
|
52737 |
+
var _ref$mobile = _ref.mobile,
|
52738 |
+
mobile = _ref$mobile === void 0 ? false : _ref$mobile,
|
52739 |
+
_ref$desktop = _ref.desktop,
|
52740 |
+
desktop = _ref$desktop === void 0 ? false : _ref$desktop,
|
52741 |
+
onChange = _ref.onChange;
|
52742 |
|
52743 |
+
var _useState = (0,react.useState)(mobile),
|
52744 |
+
_useState2 = Visibility_slicedToArray(_useState, 2),
|
52745 |
+
mobileSelected = _useState2[0],
|
52746 |
+
setMobileSelected = _useState2[1];
|
52747 |
|
52748 |
+
var _useState3 = (0,react.useState)(desktop),
|
52749 |
+
_useState4 = Visibility_slicedToArray(_useState3, 2),
|
52750 |
+
desktopSelected = _useState4[0],
|
52751 |
+
setDesktopSelected = _useState4[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52752 |
|
52753 |
+
(0,react.useEffect)(function () {
|
52754 |
+
setMobileSelected(mobile);
|
52755 |
+
setDesktopSelected(desktop);
|
52756 |
+
}, [mobile, desktop]);
|
52757 |
+
return /*#__PURE__*/react.createElement(SettingsContainer, {
|
52758 |
+
title: translate("settings.show_mobile_desktop.title"),
|
52759 |
+
fullWidth: false,
|
52760 |
+
className: "desktop-mobile-visibility"
|
52761 |
+
}, /*#__PURE__*/react.createElement(Tippy_Tippy, {
|
52762 |
+
content: translate("settings.show_mobile_desktop.mobile")
|
52763 |
+
}, /*#__PURE__*/react.createElement(Button_Button, {
|
52764 |
+
className: "buttonMobile",
|
52765 |
+
onClick: function onClick() {
|
52766 |
+
var update = !mobileSelected;
|
52767 |
+
setMobileSelected(update);
|
52768 |
+
onChange("show_mobile", update);
|
52769 |
},
|
52770 |
+
variant: mobileSelected ? "contained" : "outlined",
|
52771 |
+
color: "primary",
|
52772 |
+
"data-testid": "setting:mobile-visibility"
|
52773 |
+
}, /*#__PURE__*/react.createElement("i", {
|
52774 |
+
className: "fas fa-mobile-alt"
|
52775 |
+
}))), /*#__PURE__*/react.createElement(Tippy_Tippy, {
|
52776 |
+
content: translate("settings.show_mobile_desktop.desktop")
|
52777 |
+
}, /*#__PURE__*/react.createElement(Button_Button, {
|
52778 |
+
onClick: function onClick() {
|
52779 |
+
var update = !desktopSelected;
|
52780 |
+
setDesktopSelected(update);
|
52781 |
+
onChange("show_desktop", update);
|
52782 |
},
|
52783 |
+
variant: desktopSelected ? "contained" : "outlined",
|
52784 |
+
color: "primary",
|
52785 |
+
"data-testid": "setting:desktop-visibility"
|
52786 |
+
}, /*#__PURE__*/react.createElement("i", {
|
52787 |
+
className: "fas fa-desktop"
|
52788 |
+
}))));
|
52789 |
+
}
|
52790 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Settings/Label/Label.js
|
52791 |
+
function Label_slicedToArray(arr, i) { return Label_arrayWithHoles(arr) || Label_iterableToArrayLimit(arr, i) || Label_unsupportedIterableToArray(arr, i) || Label_nonIterableRest(); }
|
52792 |
|
52793 |
+
function Label_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52794 |
|
52795 |
+
function Label_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Label_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Label_arrayLikeToArray(o, minLen); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52796 |
|
52797 |
+
function Label_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
|
52798 |
|
52799 |
+
function Label_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
|
52800 |
|
52801 |
+
function Label_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
|
|
|
|
|
|
|
|
|
|
52802 |
|
|
|
|
|
|
|
|
|
|
|
52803 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52804 |
|
|
|
|
|
|
|
|
|
52805 |
|
52806 |
+
function Label(_ref) {
|
52807 |
+
var value = _ref.value,
|
52808 |
+
_onChange = _ref.onChange,
|
52809 |
+
_ref$placeholder = _ref.placeholder,
|
52810 |
+
placeholder = _ref$placeholder === void 0 ? "" : _ref$placeholder;
|
52811 |
|
52812 |
+
var _useState = (0,react.useState)(value),
|
52813 |
+
_useState2 = Label_slicedToArray(_useState, 2),
|
52814 |
+
label = _useState2[0],
|
52815 |
+
setLabel = _useState2[1];
|
52816 |
|
52817 |
+
var _useState3 = (0,react.useState)(true),
|
52818 |
+
_useState4 = Label_slicedToArray(_useState3, 2),
|
52819 |
+
usePlaceholder = _useState4[0],
|
52820 |
+
setUsePlaceholder = _useState4[1];
|
52821 |
|
52822 |
+
var _useState5 = (0,react.useState)(placeholder),
|
52823 |
+
_useState6 = Label_slicedToArray(_useState5, 2),
|
52824 |
+
labelPlaceholder = _useState6[0],
|
52825 |
+
setPlaceholder = _useState6[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52826 |
|
52827 |
+
(0,react.useEffect)(function () {
|
52828 |
+
setLabel(value);
|
52829 |
+
}, [value]);
|
52830 |
+
(0,react.useEffect)(function () {
|
52831 |
+
setPlaceholder(placeholder);
|
52832 |
+
setUsePlaceholder(true);
|
52833 |
+
}, [placeholder]);
|
52834 |
+
return /*#__PURE__*/react.createElement(TextField_TextField, {
|
52835 |
+
variant: "outlined",
|
52836 |
+
label: translate("settings.label.placeholder"),
|
52837 |
+
onChange: function onChange(obj) {
|
52838 |
+
setUsePlaceholder(false);
|
52839 |
+
setLabel(obj.target.value);
|
52840 |
|
52841 |
+
_onChange(obj.target.value);
|
52842 |
+
},
|
52843 |
+
value: label ? label : usePlaceholder ? labelPlaceholder : label,
|
52844 |
+
fullWidth: true,
|
52845 |
+
inputProps: {
|
52846 |
+
"data-testid": "setting:label"
|
52847 |
+
},
|
52848 |
+
className: "general-label-text"
|
52849 |
+
});
|
52850 |
+
}
|
52851 |
+
// EXTERNAL MODULE: ./node_modules/validator/lib/isEmail.js
|
52852 |
+
var isEmail = __webpack_require__(83868);
|
52853 |
+
var isEmail_default = /*#__PURE__*/__webpack_require__.n(isEmail);
|
52854 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Settings/ButtonAction/ButtonActionValue/Mail/Mail.js
|
52855 |
+
function Mail_slicedToArray(arr, i) { return Mail_arrayWithHoles(arr) || Mail_iterableToArrayLimit(arr, i) || Mail_unsupportedIterableToArray(arr, i) || Mail_nonIterableRest(); }
|
52856 |
|
52857 |
+
function Mail_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
|
|
|
|
|
52858 |
|
52859 |
+
function Mail_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return Mail_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return Mail_arrayLikeToArray(o, minLen); }
|
|
|
|
|
|
|
52860 |
|
52861 |
+
function Mail_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
|
|
|
52862 |
|
52863 |
+
function Mail_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
|
52864 |
|
52865 |
+
function Mail_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
|
|
52866 |
|
|
|
52867 |
|
|
|
|
|
|
|
52868 |
|
|
|
|
|
52869 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52870 |
|
52871 |
+
function Mail(_ref) {
|
52872 |
+
var _ref$value = _ref.value,
|
52873 |
+
value = _ref$value === void 0 ? "" : _ref$value,
|
52874 |
+
_ref$subject = _ref.subject,
|
52875 |
+
subject = _ref$subject === void 0 ? "" : _ref$subject,
|
52876 |
+
_ref$body = _ref.body,
|
52877 |
+
body = _ref$body === void 0 ? "" : _ref$body,
|
52878 |
+
_ref$cc = _ref.cc,
|
52879 |
+
cc = _ref$cc === void 0 ? "" : _ref$cc,
|
52880 |
+
_ref$bcc = _ref.bcc,
|
52881 |
+
bcc = _ref$bcc === void 0 ? "" : _ref$bcc,
|
52882 |
+
_onChange = _ref.onChange;
|
52883 |
|
52884 |
+
var _useState = (0,react.useState)(cc !== ""),
|
52885 |
+
_useState2 = Mail_slicedToArray(_useState, 2),
|
52886 |
+
showCC = _useState2[0],
|
52887 |
+
setShowCC = _useState2[1];
|
52888 |
|
52889 |
+
var _useState3 = (0,react.useState)(bcc !== ""),
|
52890 |
+
_useState4 = Mail_slicedToArray(_useState3, 2),
|
52891 |
+
showBCC = _useState4[0],
|
52892 |
+
setShowBCC = _useState4[1];
|
52893 |
+
|
52894 |
+
var isInvalid = value !== "" ? !isEmail_default()(value) : false;
|
52895 |
+
return /*#__PURE__*/react.createElement("div", {
|
52896 |
+
className: "button-action-value"
|
52897 |
+
}, /*#__PURE__*/react.createElement(TextField_TextField, {
|
52898 |
+
variant: "outlined",
|
52899 |
+
fullWidth: true,
|
52900 |
+
value: value,
|
52901 |
+
inputProps: {
|
52902 |
+
"data-testid": "action:field"
|
52903 |
+
},
|
52904 |
+
label: translate("settings.button_action.placeholders.mail.recipient"),
|
52905 |
+
helperText: isInvalid ? translate("settings.button_action.actions.mail.invalid") : null,
|
52906 |
+
error: isInvalid,
|
52907 |
+
onChange: function onChange(obj) {
|
52908 |
+
_onChange(obj.target.value);
|
52909 |
+
}
|
52910 |
+
}), /*#__PURE__*/react.createElement(TextField_TextField, {
|
52911 |
+
variant: "outlined",
|
52912 |
+
fullWidth: true,
|
52913 |
+
value: subject,
|
52914 |
+
label: translate("settings.button_action.placeholders.mail.subject"),
|
52915 |
+
onChange: function onChange(obj) {
|
52916 |
+
_onChange(obj.target.value, "text_subject");
|
52917 |
+
},
|
52918 |
+
inputProps: {
|
52919 |
+
"data-testid": "action:field"
|
52920 |
+
}
|
52921 |
+
}), showCC ? /*#__PURE__*/react.createElement(TextField_TextField, {
|
52922 |
+
variant: "outlined",
|
52923 |
+
fullWidth: true,
|
52924 |
+
value: cc,
|
52925 |
+
label: translate("settings.button_action.placeholders.mail.cc"),
|
52926 |
+
onChange: function onChange(obj) {
|
52927 |
+
_onChange(obj.target.value, "text_cc");
|
52928 |
+
}
|
52929 |
+
}) : /*#__PURE__*/react.createElement(Button_Button, {
|
52930 |
+
color: "primary",
|
52931 |
+
size: "small",
|
52932 |
+
style: {
|
52933 |
+
textTransform: "capitalize",
|
52934 |
+
marginBottom: "15px"
|
52935 |
+
},
|
52936 |
+
startIcon: "+",
|
52937 |
+
onClick: function onClick() {
|
52938 |
+
return setShowCC(true);
|
52939 |
+
}
|
52940 |
+
}, "Cc"), showBCC ? /*#__PURE__*/react.createElement(TextField_TextField, {
|
52941 |
+
variant: "outlined",
|
52942 |
+
fullWidth: true,
|
52943 |
+
value: bcc,
|
52944 |
+
label: translate("settings.button_action.placeholders.mail.bcc"),
|
52945 |
+
onChange: function onChange(obj) {
|
52946 |
+
_onChange(obj.target.value, "text_bcc");
|
52947 |
+
}
|
52948 |
+
}) : /*#__PURE__*/react.createElement(Button_Button, {
|
52949 |
+
color: "primary",
|
52950 |
+
size: "small",
|
52951 |
+
style: {
|
52952 |
+
textTransform: "capitalize",
|
52953 |
+
marginBottom: "15px"
|
52954 |
+
},
|
52955 |
+
onClick: function onClick() {
|
52956 |
+
return setShowBCC(true);
|
52957 |
+
},
|
52958 |
+
startIcon: "+"
|
52959 |
+
}, "Bcc"), /*#__PURE__*/react.createElement(TextField_TextField, {
|
52960 |
+
variant: "outlined",
|
52961 |
+
fullWidth: true,
|
52962 |
+
multiline: true,
|
52963 |
+
rows: 4,
|
52964 |
+
inputProps: {
|
52965 |
+
"data-testid": "action:field"
|
52966 |
+
},
|
52967 |
+
value: body,
|
52968 |
+
label: translate("settings.button_action.placeholders.mail.body"),
|
52969 |
+
onChange: function onChange(obj) {
|
52970 |
+
_onChange(obj.target.value, "text_body");
|
52971 |
}
|
52972 |
+
}));
|
52973 |
+
}
|
52974 |
+
// EXTERNAL MODULE: ./node_modules/validator/lib/isMobilePhone.js
|
52975 |
+
var isMobilePhone = __webpack_require__(28355);
|
52976 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Settings/ButtonAction/ButtonActionValue/WhatsApp/WhatsApp.js
|
52977 |
|
52978 |
+
|
52979 |
+
|
52980 |
+
|
52981 |
+
|
52982 |
+
function WhatsApp(_ref) {
|
52983 |
+
var _ref$value = _ref.value,
|
52984 |
+
value = _ref$value === void 0 ? "" : _ref$value,
|
52985 |
+
_ref$body = _ref.body,
|
52986 |
+
body = _ref$body === void 0 ? "" : _ref$body,
|
52987 |
+
_onChange = _ref.onChange;
|
52988 |
+
var isValidPhoneNumber = value !== "" ? (0,isMobilePhone/* default */.ZP)(value, "any", {}) : true;
|
52989 |
+
return /*#__PURE__*/react.createElement("div", {
|
52990 |
+
className: "button-action-subject"
|
52991 |
+
}, /*#__PURE__*/react.createElement(TextField_TextField, {
|
52992 |
+
variant: "outlined",
|
52993 |
+
fullWidth: true,
|
52994 |
+
value: value,
|
52995 |
+
helperText: !isValidPhoneNumber ? translate("settings.button_action.actions.phone_number.invalid") : null,
|
52996 |
+
error: !isValidPhoneNumber,
|
52997 |
+
label: translate("settings.button_action.actions.phone_number.number"),
|
52998 |
+
inputProps: {
|
52999 |
+
"data-testid": "action:field"
|
53000 |
+
},
|
53001 |
+
onChange: function onChange(obj) {
|
53002 |
+
_onChange(obj.target.value);
|
53003 |
+
}
|
53004 |
+
}), /*#__PURE__*/react.createElement(TextField_TextField, {
|
53005 |
+
variant: "outlined",
|
53006 |
+
fullWidth: true,
|
53007 |
+
multiline: true,
|
53008 |
+
rows: 4,
|
53009 |
+
value: body,
|
53010 |
+
label: translate("settings.button_action.placeholders.message"),
|
53011 |
+
inputProps: {
|
53012 |
+
"data-testid": "action:field"
|
53013 |
+
},
|
53014 |
+
onChange: function onChange(obj) {
|
53015 |
+
_onChange(obj.target.value, "text_body");
|
53016 |
}
|
53017 |
+
}), /*#__PURE__*/react.createElement("p", null, /*#__PURE__*/react.createElement(Trans, {
|
53018 |
+
i18nKey: "settings.button_action.actions.whatsapp_info",
|
53019 |
+
components: {
|
53020 |
+
a: /*#__PURE__*/react.createElement("a", {
|
53021 |
+
href: "https://faq.whatsapp.com/en/android/26000030/",
|
53022 |
+
target: "_blank"
|
53023 |
+
})
|
|
|
|
|
53024 |
}
|
53025 |
+
})));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53026 |
}
|
53027 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Settings/ButtonAction/ButtonActionValue/SocialSharing/SocialSharing.js
|
53028 |
+
function SocialSharing_slicedToArray(arr, i) { return SocialSharing_arrayWithHoles(arr) || SocialSharing_iterableToArrayLimit(arr, i) || SocialSharing_unsupportedIterableToArray(arr, i) || SocialSharing_nonIterableRest(); }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53029 |
|
53030 |
+
function SocialSharing_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
|
|
|
53031 |
|
53032 |
+
function SocialSharing_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return SocialSharing_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return SocialSharing_arrayLikeToArray(o, minLen); }
|
|
|
53033 |
|
53034 |
+
function SocialSharing_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
|
|
|
53035 |
|
53036 |
+
function SocialSharing_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
|
|
|
|
|
53037 |
|
53038 |
+
function SocialSharing_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53039 |
|
53040 |
|
53041 |
|
53043 |
|
53044 |
|
53045 |
|
53046 |
+
var SocialSharing_useStyles = styles_makeStyles(function (theme) {
|
53047 |
return {
|
53048 |
+
item: {
|
53049 |
+
padding: "6px 31px"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53050 |
},
|
53051 |
+
group: {
|
53052 |
+
fontWeight: theme.typography.fontWeightMedium,
|
53053 |
+
opacity: 1,
|
53054 |
+
cursor: "default",
|
53055 |
+
pointerEvents: "none",
|
53056 |
+
userSelect: "none",
|
53057 |
+
fontSize: "17px"
|
53058 |
}
|
53059 |
};
|
53060 |
+
});
|
53061 |
+
function SocialSharing(_ref) {
|
53062 |
+
var _ref$value = _ref.value,
|
53063 |
+
value = _ref$value === void 0 ? "" : _ref$value,
|
53064 |
+
_ref$body = _ref.body,
|
53065 |
+
body = _ref$body === void 0 ? "" : _ref$body,
|
53066 |
+
_onChange = _ref.onChange;
|
53067 |
+
var values = ["facebook", "twitter", "whatsapp", "linkedin", "pinterest", "mail", "sms", "reddit", "tumblr", "weibo", "vk", "ok", "xing", "blogger", "flipboard", "line"];
|
53068 |
+
var valuesWithBody = ["twitter", "whatsapp", "mail", "sms", "vk", "blogger", "tumblr", "weibo"];
|
53069 |
+
var parameters = {
|
53070 |
+
"Site URL": "[site-url]",
|
53071 |
+
"Site Title": "[site-title]"
|
53072 |
+
};
|
53073 |
+
var inputLabel = (0,react.useRef)(null);
|
53074 |
+
var bodyInputRef = (0,react.useRef)(null);
|
53075 |
|
53076 |
+
var _useState = (0,react.useState)([]),
|
53077 |
+
_useState2 = SocialSharing_slicedToArray(_useState, 2),
|
53078 |
+
selection = _useState2[0],
|
53079 |
+
setSelection = _useState2[1]; // make sure parameters are inserted at selection
|
|
|
|
|
53080 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53081 |
|
53082 |
+
var changeSelection = function changeSelection() {
|
53083 |
+
return setSelection([bodyInputRef.current.selectionStart, bodyInputRef.current.selectionEnd]);
|
53084 |
+
}; // we want the parameter to insert at the end if there is no focus
|
53085 |
|
|
|
|
|
|
|
53086 |
|
53087 |
+
var removeSelection = function removeSelection(event) {
|
53088 |
+
return !dlv_umd_default()(event, "relatedTarget.className", "").includes("MuiChip") && setSelection([body.length, body.length]);
|
53089 |
+
};
|
|
|
53090 |
|
53091 |
+
var insertParameter = function insertParameter(parameter) {
|
53092 |
+
// insert text
|
53093 |
+
var newString = body.split("");
|
53094 |
+
newString.splice(selection[0], selection[1] - selection[0], parameter);
|
53095 |
|
53096 |
+
_onChange(newString.join(""), "text_body"); // Timeout, otherwise it doesn't work.
|
53097 |
+
// select at the end of inserted parameter string
|
|
|
53098 |
|
|
|
|
|
|
|
|
|
53099 |
|
53100 |
+
setTimeout(function () {
|
53101 |
+
return bodyInputRef.current.setSelectionRange(selection[0] + parameter.length, selection[0] + parameter.length);
|
53102 |
+
}, 100);
|
53103 |
+
};
|
53104 |
|
53105 |
+
var classes = SocialSharing_useStyles();
|
53106 |
|
53107 |
+
var _useState3 = (0,react.useState)(0),
|
53108 |
+
_useState4 = SocialSharing_slicedToArray(_useState3, 2),
|
53109 |
+
labelWidth = _useState4[0],
|
53110 |
+
setLabelWidth = _useState4[1];
|
53111 |
|
53112 |
+
if (!values.includes(value)) {
|
53113 |
+
_onChange("facebook");
|
53114 |
+
}
|
53115 |
|
53116 |
+
(0,react.useEffect)(function () {
|
53117 |
+
setLabelWidth(inputLabel.current.offsetWidth);
|
53118 |
+
}, []);
|
53119 |
+
return /*#__PURE__*/react.createElement(FormControl_FormControl, {
|
53120 |
+
variant: "outlined",
|
53121 |
+
fullWidth: true,
|
53122 |
+
className: "button-action-value"
|
53123 |
+
}, /*#__PURE__*/react.createElement(InputLabel_InputLabel, {
|
53124 |
+
ref: inputLabel
|
53125 |
+
}, translate("settings.button_action.title")), /*#__PURE__*/react.createElement(Select_Select, {
|
53126 |
+
labelId: "button-action-value",
|
53127 |
+
value: value,
|
53128 |
+
onChange: function onChange(e) {
|
53129 |
+
_onChange(e.target.value);
|
53130 |
+
},
|
53131 |
+
labelWidth: labelWidth,
|
53132 |
+
MenuProps: {
|
53133 |
+
anchorOrigin: {
|
53134 |
+
vertical: "bottom",
|
53135 |
+
horizontal: "center"
|
53136 |
+
},
|
53137 |
+
transformOrigin: {
|
53138 |
+
vertical: "top",
|
53139 |
+
horizontal: "center"
|
53140 |
+
},
|
53141 |
+
getContentAnchorEl: null
|
53142 |
+
},
|
53143 |
+
style: {
|
53144 |
+
marginBottom: "15px"
|
53145 |
+
},
|
53146 |
+
inputProps: {
|
53147 |
+
"data-testid": "action:select"
|
53148 |
+
}
|
53149 |
+
}, /*#__PURE__*/react.createElement(ListSubheader_ListSubheader, {
|
53150 |
+
disableSticky: true,
|
53151 |
+
value: null,
|
53152 |
+
className: classes.group
|
53153 |
+
}, translate("settings.button_action.actions.social_sharing.popular") + ":"), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53154 |
+
value: "facebook",
|
53155 |
+
className: classes.item
|
53156 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53157 |
+
platform: "Facebook"
|
53158 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53159 |
+
value: "twitter",
|
53160 |
+
className: classes.item
|
53161 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53162 |
+
platform: "Twitter"
|
53163 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53164 |
+
value: "whatsapp",
|
53165 |
+
className: classes.item
|
53166 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53167 |
+
platform: "Whatsapp"
|
53168 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53169 |
+
value: "linkedin",
|
53170 |
+
className: classes.item
|
53171 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53172 |
+
platform: "LinkedIn"
|
53173 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53174 |
+
value: "pinterest",
|
53175 |
+
className: classes.item
|
53176 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53177 |
+
platform: "Pinterest"
|
53178 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53179 |
+
value: "mail",
|
53180 |
+
className: classes.item
|
53181 |
+
}, translate("settings.button_action.actions.share_page_via", {
|
53182 |
+
platform: "email"
|
53183 |
+
})), /*#__PURE__*/react.createElement(ListSubheader_ListSubheader, {
|
53184 |
+
disableSticky: true,
|
53185 |
+
value: null,
|
53186 |
+
className: classes.group
|
53187 |
+
}, translate("settings.button_action.actions.social_sharing.other") + ":"), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53188 |
+
value: "sms",
|
53189 |
+
className: classes.item
|
53190 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53191 |
+
platform: "SMS"
|
53192 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53193 |
+
value: "reddit",
|
53194 |
+
className: classes.item
|
53195 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53196 |
+
platform: "Reddit"
|
53197 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53198 |
+
value: "tumblr",
|
53199 |
+
className: classes.item
|
53200 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53201 |
+
platform: "Tumblr"
|
53202 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53203 |
+
value: "weibo",
|
53204 |
+
className: classes.item
|
53205 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53206 |
+
platform: "Weibo"
|
53207 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53208 |
+
value: "vk",
|
53209 |
+
className: classes.item
|
53210 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53211 |
+
platform: "VK"
|
53212 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53213 |
+
value: "ok",
|
53214 |
+
className: classes.item
|
53215 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53216 |
+
platform: "OK.ru (Odnoklassniki)"
|
53217 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53218 |
+
value: "xing",
|
53219 |
+
className: classes.item
|
53220 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53221 |
+
platform: "Xing"
|
53222 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53223 |
+
value: "blogger",
|
53224 |
+
className: classes.item
|
53225 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53226 |
+
platform: "Blogger"
|
53227 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53228 |
+
value: "flipboard",
|
53229 |
+
className: classes.item
|
53230 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53231 |
+
platform: "Flipboard"
|
53232 |
+
})), /*#__PURE__*/react.createElement(MenuItem_MenuItem, {
|
53233 |
+
value: "line",
|
53234 |
+
className: classes.item
|
53235 |
+
}, translate("settings.button_action.actions.share_page_on", {
|
53236 |
+
platform: "Line"
|
53237 |
+
}))), valuesWithBody.includes(value) ? /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement(TextField_TextField, {
|
53238 |
+
variant: "outlined",
|
53239 |
+
fullWidth: true,
|
53240 |
+
multiline: true,
|
53241 |
+
rows: 2,
|
53242 |
+
onSelect: changeSelection,
|
53243 |
+
onBlur: removeSelection,
|
53244 |
+
inputRef: bodyInputRef,
|
53245 |
+
label: translate("settings.button_action.placeholders.mail.body"),
|
53246 |
+
value: body,
|
53247 |
+
inputProps: {
|
53248 |
+
"data-testid": "action:field"
|
53249 |
+
},
|
53250 |
+
onChange: function onChange(obj) {
|
53251 |
+
_onChange(obj.target.value, "text_body");
|
53252 |
+
}
|
53253 |
+
}), /*#__PURE__*/react.createElement("div", null, "Insert parameter:", Object.entries(parameters).map(function (_ref2, index) {
|
53254 |
+
var _ref3 = SocialSharing_slicedToArray(_ref2, 2),
|
53255 |
+
name = _ref3[0],
|
53256 |
+
value = _ref3[1];
|
53257 |
|
53258 |
+
return /*#__PURE__*/react.createElement(Chip_Chip, {
|
53259 |
+
onClick: function onClick() {
|
53260 |
+
return insertParameter(value);
|
53261 |
+
},
|
53262 |
+
size: "small",
|
53263 |
+
variant: "outlined",
|
53264 |
+
key: index,
|
53265 |
+
label: name,
|
53266 |
+
style: {
|
53267 |
+
marginLeft: "5px"
|
53268 |
+
}
|
53269 |
+
});
|
53270 |
+
})), /*#__PURE__*/react.createElement("br", null), "Body will look as follows: ", /*#__PURE__*/react.createElement("br", null), /*#__PURE__*/react.createElement(Typography_Typography, {
|
53271 |
+
variant: "caption"
|
53272 |
+
}, body.replace(/\[site-url\]/g, document.location).replace(/\[site-title\]/g, document.title))) : null);
|
53273 |
+
}
|
53274 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Settings/ButtonAction/ButtonActionValue/Sms/Sms.js
|
53275 |
|
53276 |
|
53277 |
|
53278 |
|
53279 |
+
function Sms(_ref) {
|
53280 |
+
var _ref$value = _ref.value,
|
53281 |
+
value = _ref$value === void 0 ? "" : _ref$value,
|
53282 |
+
_ref$body = _ref.body,
|
53283 |
+
body = _ref$body === void 0 ? "" : _ref$body,
|
53284 |
+
_onChange = _ref.onChange;
|
53285 |
+
var isValidPhoneNumber = value !== "" ? (0,isMobilePhone/* default */.ZP)(value, "any", {}) : true;
|
53286 |
+
return /*#__PURE__*/react.createElement("div", {
|
53287 |
+
className: "button-action-value"
|
53288 |
+
}, /*#__PURE__*/react.createElement(TextField_TextField, {
|
53289 |
+
variant: "outlined",
|
53290 |
+
fullWidth: true,
|
53291 |
+
value: value,
|
53292 |
+
label: translate("settings.button_action.actions.phone_number.number"),
|
53293 |
+
helperText: !isValidPhoneNumber ? translate("settings.button_action.actions.phone_number.invalid") : null,
|
53294 |
+
error: !isValidPhoneNumber,
|
53295 |
+
onChange: function onChange(obj) {
|
53296 |
+
_onChange(obj.target.value);
|
53297 |
+
},
|
53298 |
+
inputProps: {
|
53299 |
+
"data-testid": "action:field"
|
53300 |
}
|
53301 |
+
}), /*#__PURE__*/react.createElement(TextField_TextField, {
|
53302 |
+
variant: "outlined",
|
53303 |
+
fullWidth: true,
|
53304 |
+
multiline: true,
|
53305 |
+
rows: 4,
|
53306 |
+
inputProps: {
|
53307 |
+
"data-testid": "action:field"
|
53308 |
+
},
|
53309 |
+
value: body,
|
53310 |
+
label: "SMS" + " " + translate("settings.button_action.placeholders.mail.body"),
|
53311 |
+
onChange: function onChange(obj) {
|
53312 |
+
_onChange(obj.target.value, "text_body");
|
53313 |
}
|
53314 |
+
}), /*#__PURE__*/react.createElement("p", {
|
53315 |
+
dangerouslySetInnerHTML: {
|
53316 |
+
__html: translate("settings.button_action.actions.sms")
|
53317 |
+
}
|
53318 |
+
}));
|
53319 |
+
}
|
53320 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Settings/ButtonAction/ButtonActionValue/TwitterDm/TwitterDm.js
|
53321 |
|
|
|
|
|
|
|
53322 |
|
|
|
|
|
|
|
53323 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53324 |
|
53325 |
+
function TwitterDm(_ref) {
|
53326 |
+
var _ref$value = _ref.value,
|
53327 |
+
value = _ref$value === void 0 ? "" : _ref$value,
|
53328 |
+
_ref$body = _ref.body,
|
53329 |
+
body = _ref$body === void 0 ? "" : _ref$body,
|
53330 |
+
_onChange = _ref.onChange;
|
53331 |
+
var check = /^\d+$/;
|
53332 |
+
return /*#__PURE__*/react.createElement("div", {
|
53333 |
+
className: "button-action-value"
|
53334 |
+
}, /*#__PURE__*/react.createElement(TextField_TextField, {
|
53335 |
+
variant: "outlined",
|
53336 |
+
fullWidth: true,
|
53337 |
+
value: value,
|
53338 |
+
label: "Account ID",
|
53339 |
+
helperText: !check.test(value) && value !== "" ? "Invalid account ID." : null,
|
53340 |
+
error: !check.test(value) && value !== "",
|
53341 |
+
onChange: function onChange(obj) {
|
53342 |
+
_onChange(obj.target.value.replace(/[^0-9]/gm, ""));
|
53343 |
+
},
|
53344 |
+
inputProps: {
|
53345 |
+
"data-testid": "action:field"
|
53346 |
+
}
|
53347 |
+
}), /*#__PURE__*/react.createElement(TextField_TextField, {
|
53348 |
+
variant: "outlined",
|
53349 |
+
fullWidth: true,
|
53350 |
+
inputProps: {
|
53351 |
+
"data-testid": "action:field"
|
53352 |
+
},
|
53353 |
+
multiline: true,
|
53354 |
+
rows: 4,
|
53355 |
+
value: body,
|
53356 |
+
label: translate("settings.button_action.placeholders.message"),
|
53357 |
+
onChange: function onChange(obj) {
|
53358 |
+
_onChange(obj.target.value, "text_body");
|
53359 |
+
}
|
53360 |
+
}), /*#__PURE__*/react.createElement("p", null, /*#__PURE__*/react.createElement(Trans, {
|
53361 |
+
i18nKey: "settings.button_action.actions.twitter_info",
|
53362 |
+
components: {
|
53363 |
+
findAccountLink: /*#__PURE__*/react.createElement("a", {
|
53364 |
+
href: "https://tweeterid.com/",
|
53365 |
+
target: "_blank"
|
53366 |
+
}),
|
53367 |
+
allowDirectMessagesLink: /*#__PURE__*/react.createElement("a", {
|
53368 |
+
href: "https://help.twitter.com/nl/using-twitter/direct-messages#receive",
|
53369 |
+
target: "_blank"
|
53370 |
+
})
|
53371 |
+
}
|
53372 |
+
})));
|
53373 |
+
}
|
53374 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Settings/ButtonAction/ButtonActionValue/ElementorPopup/ElementorPopup.js
|
53375 |
|
53376 |
|
53377 |
|
53379 |
|
53380 |
|
53381 |
|
53382 |
+
function ElementorPopup(_ref) {
|
53383 |
+
var _ref$value = _ref.value,
|
53384 |
+
value = _ref$value === void 0 ? "" : _ref$value,
|
53385 |
+
onChange = _ref.onChange;
|
53386 |
+
(0,react.useEffect)(function () {
|
53387 |
+
if (value.substring(0, 9) !== "elementor") {
|
53388 |
+
// Don't change old one
|
53389 |
+
if (value.substring(value.length - 1) === "E") return;
|
53390 |
+
if (value.substring(value.length - 3) !== "Ev2") onChange("elementor" + uniqueCharset() + "Ev2");
|
53391 |
+
}
|
53392 |
+
}, []);
|
53393 |
+
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("p", {
|
53394 |
+
dangerouslySetInnerHTML: {
|
53395 |
+
__html: translate("settings.popups.elementor_guide")
|
53396 |
+
}
|
53397 |
+
}), /*#__PURE__*/react.createElement("pre", {
|
53398 |
+
style: {
|
53399 |
+
display: "flex"
|
53400 |
+
}
|
53401 |
+
}, /*#__PURE__*/react.createElement("code", {
|
53402 |
+
style: {
|
53403 |
+
fontSize: "11px",
|
53404 |
+
padding: "5.5px"
|
53405 |
+
}
|
53406 |
+
}, "a[", value.substring(value.length - 3) === "Ev2" ? "buttonizer-popup" : "href", "=\"#", value, "\"]"), /*#__PURE__*/react.createElement(Tippy_Tippy, {
|
53407 |
+
content: translate("settings.popups.generate")
|
53408 |
+
}, /*#__PURE__*/react.createElement(IconButton_IconButton, {
|
53409 |
+
onClick: function onClick() {
|
53410 |
+
onChange("elementor" + uniqueCharset() + "Ev2");
|
53411 |
+
},
|
53412 |
+
variant: "contained",
|
53413 |
+
color: "primary",
|
53414 |
+
style: {
|
53415 |
+
padding: "5px"
|
53416 |
+
}
|
53417 |
+
}, /*#__PURE__*/react.createElement("i", {
|
53418 |
+
className: "fas fa-redo-alt",
|
53419 |
+
style: {
|
53420 |
+
fontSize: "14px"
|
53421 |
+
}
|
53422 |
+
})))), /*#__PURE__*/react.createElement(KnowledgeBaseLink, {
|
53423 |
+
articleId: 76,
|
53424 |
+
setting: "Elementor Popup"
|
53425 |
+
}));
|
53426 |
+
}
|
53427 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Settings/ButtonAction/ButtonActionValue/PopupMaker/PopupMaker.js
|
53428 |
|
53429 |
|
53430 |
|
53432 |
|
53433 |
|
53434 |
|
53435 |
+
function PopupMaker(_ref) {
|
53436 |
+
var _ref$value = _ref.value,
|
53437 |
+
value = _ref$value === void 0 ? "" : _ref$value,
|
53438 |
+
onChange = _ref.onChange;
|
53439 |
+
(0,react.useEffect)(function () {
|
53440 |
+
if (value.substring(0, 10) !== "popupMaker") {
|
53441 |
+
// Don't change old one
|
53442 |
+
if (value.substring(value.length - 1) === "P") return;
|
53443 |
+
if (value.substring(value.length - 3) !== "Pv2") onChange("popupMaker" + uniqueCharset() + "Pv2");
|
53444 |
+
}
|
53445 |
+
}, []);
|
53446 |
+
return /*#__PURE__*/react.createElement(react.Fragment, null, /*#__PURE__*/react.createElement("p", {
|
53447 |
+
dangerouslySetInnerHTML: {
|
53448 |
+
__html: translate("settings.popups.popup_maker_guide")
|
53449 |
+
}
|
53450 |
+
}), /*#__PURE__*/react.createElement("pre", {
|
53451 |
+
style: {
|
53452 |
+
display: "flex"
|
53453 |
+
}
|
53454 |
+
}, /*#__PURE__*/react.createElement("code", {
|
53455 |
+
style: {
|
53456 |
+
fontSize: "11px",
|
53457 |
+
padding: "5.5px"
|
53458 |
+
}
|
53459 |
+
}, "a[", value.substring(value.length - 3) === "Pv2" ? "buttonizer-popup" : "href", "=\"#", value, "\"]"), /*#__PURE__*/react.createElement(Tippy_Tippy, {
|
53460 |
+
content: translate("settings.popups.generate")
|
53461 |
+
}, /*#__PURE__*/react.createElement(IconButton_IconButton, {
|
53462 |
+
onClick: function onClick() {
|
53463 |
+
onChange("popupMaker" + uniqueCharset() + "Pv2");
|
53464 |
+
},
|
53465 |
+
variant: "contained",
|
53466 |
+
color: "primary",
|
53467 |
+
style: {
|
53468 |
+
padding: "5px"
|
53469 |
+
}
|
53470 |
+
}, /*#__PURE__*/react.createElement("i", {
|
53471 |
+
className: "fas fa-redo-alt",
|
53472 |
+
style: {
|
53473 |
+
fontSize: "14px"
|
53474 |
+
}
|
53475 |
+
})))), /*#__PURE__*/react.createElement(KnowledgeBaseLink, {
|
53476 |
+
articleId: 77,
|
53477 |
+
setting: "Popup Maker"
|
53478 |
+
}));
|
53479 |
+
}
|
53480 |
+
;// CONCATENATED MODULE: ./src/js/dashboard/Components/Settings/ButtonAction/ButtonActionValue/ButtonActionNewTab/ButtonActionNewTab.js
|
53481 |
+
function ButtonActionNewTab_slicedToArray(arr, i) { return ButtonActionNewTab_arrayWithHoles(arr) || ButtonActionNewTab_iterableToArrayLimit(arr, i) || ButtonActionNewTab_unsupportedIterableToArray(arr, i) || ButtonActionNewTab_nonIterableRest(); }
|
53482 |
|
53483 |
+
function ButtonActionNewTab_nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
53484 |
|
53485 |
+
function ButtonActionNewTab_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return ButtonActionNewTab_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return ButtonActionNewTab_arrayLikeToArray(o, minLen); }
|
53486 |
|
53487 |
+
function ButtonActionNewTab_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
53488 |
|
53489 |
+
function ButtonActionNewTab_iterableToArrayLimit(arr, i) { var _i = arr && (typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]); if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
53490 |
|
53491 |
+
function ButtonActionNewTab_arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
|
|
|
|
53492 |
|
|
|
|
|
|
|
|
|
53493 |
|
|
|
|
|
|
|
|
|
53494 |
|
|
|
|
|
|
|
|
|
53495 |
|
|
|
|
|
|
|
|
|
|
|
|