formstrap 0.1.3 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +38 -1
- data/app/assets/javascripts/formstrap/controllers/file_preview_controller.js +5 -5
- data/app/assets/javascripts/formstrap/controllers/media_controller.js +4 -2
- data/app/assets/javascripts/formstrap/controllers/media_modal_controller.js +38 -2
- data/app/assets/javascripts/formstrap/controllers/popup_controller.js +75 -0
- data/app/assets/javascripts/formstrap/controllers/repeater_controller.js +4 -4
- data/app/assets/javascripts/formstrap/index.js +2 -0
- data/app/assets/javascripts/formstrap.js +1790 -129
- data/app/assets/stylesheets/formstrap/{forms/autocomplete.scss → autocomplete.scss} +1 -1
- data/app/assets/stylesheets/formstrap/{forms/file.scss → file.scss} +10 -10
- data/app/assets/stylesheets/formstrap/general.scss +8 -1
- data/app/assets/stylesheets/formstrap/media/_modal.scss +9 -0
- data/app/assets/stylesheets/formstrap/{forms/media.scss → media/_validation.scss} +2 -2
- data/app/assets/stylesheets/formstrap/media.scss +2 -1
- data/app/assets/stylesheets/formstrap/{forms/repeater.scss → repeater.scss} +8 -8
- data/app/assets/stylesheets/formstrap/shared/popup.scss +17 -0
- data/app/assets/stylesheets/formstrap/shared/thumbnail.scss +23 -0
- data/app/assets/stylesheets/formstrap/shared.scss +2 -0
- data/app/assets/stylesheets/formstrap/utilities/dropzone.scss +2 -2
- data/app/assets/stylesheets/formstrap/utilities.scss +0 -1
- data/app/assets/stylesheets/formstrap.css +155 -143
- data/app/assets/stylesheets/formstrap.scss +5 -1
- data/app/controllers/formstrap/media_controller.rb +6 -12
- data/app/helpers/application_helper.rb +20 -0
- data/app/models/concerns/formstrap/attachment.rb +16 -0
- data/app/models/concerns/formstrap/blob.rb +56 -0
- data/app/models/formstrap/file_view.rb +3 -3
- data/app/models/formstrap/media_view.rb +12 -1
- data/app/models/formstrap/thumbnail_view.rb +108 -0
- data/app/views/formstrap/_autocomplete.html.erb +1 -1
- data/app/views/formstrap/_file.html.erb +8 -8
- data/app/views/formstrap/_media.html.erb +5 -4
- data/app/views/formstrap/_repeater.html.erb +3 -3
- data/app/views/formstrap/media/_item.html.erb +10 -7
- data/app/views/formstrap/media/_modal.html.erb +35 -8
- data/app/views/formstrap/media/_thumbnail.html.erb +12 -8
- data/app/views/formstrap/media/_validation.html.erb +1 -1
- data/app/views/formstrap/media/create.turbo_stream.erb +3 -1
- data/app/views/formstrap/media/index.html.erb +1 -1
- data/app/views/formstrap/repeater/_row.html.erb +4 -4
- data/app/views/formstrap/shared/_popup.html.erb +1 -1
- data/app/views/formstrap/shared/_thumbnail.html.erb +5 -3
- data/config/locales/formstrap/forms/en.yml +0 -14
- data/config/locales/formstrap/forms/nl.yml +1 -15
- data/config/locales/formstrap/media/en.yml +2 -10
- data/config/locales/formstrap/media/nl.yml +2 -10
- data/config/routes.rb +0 -2
- data/lib/formstrap/version.rb +1 -1
- metadata +16 -29
- data/app/assets/stylesheets/formstrap/forms.scss +0 -12
- data/app/assets/stylesheets/formstrap/media/index.scss +0 -9
- data/app/assets/stylesheets/formstrap/utilities/buttons.scss +0 -27
- data/app/models/formstrap/blocks_view.rb +0 -43
- data/app/views/formstrap/_blocks.html.erb +0 -45
- data/app/views/formstrap/_to_ary.html.erb +0 -0
- data/app/views/formstrap/blocks/_modal.html.erb +0 -20
- data/app/views/formstrap/fields/_base.html.erb +0 -25
- data/app/views/formstrap/fields/_file.html.erb +0 -17
- data/app/views/formstrap/fields/_files.html.erb +0 -17
- data/app/views/formstrap/fields/_group.html.erb +0 -52
- data/app/views/formstrap/fields/_list.html.erb +0 -31
- data/app/views/formstrap/fields/_text.html.erb +0 -17
- data/app/views/formstrap/media/_media_item_modal.html.erb +0 -77
- data/app/views/formstrap/media/show.html.erb +0 -9
- data/app/views/formstrap/media/update.turbo_stream.erb +0 -3
- data/config/locales/activerecord/en.yml +0 -12
- data/config/locales/activerecord/nl.yml +0 -13
- data/config/locales/defaults/en.yml +0 -215
- data/config/locales/defaults/nl.yml +0 -213
- data/config/locales/devise/en.yml +0 -65
- data/config/locales/devise/nl.yml +0 -85
- /data/app/assets/stylesheets/formstrap/{forms/search.scss → search.scss} +0 -0
@@ -86,10 +86,10 @@ var require_tom_select_complete = __commonJS({
|
|
86
86
|
loaded: {}
|
87
87
|
};
|
88
88
|
}
|
89
|
-
static define(name,
|
89
|
+
static define(name, fn2) {
|
90
90
|
Interface.plugins[name] = {
|
91
91
|
"name": name,
|
92
|
-
"fn":
|
92
|
+
"fn": fn2
|
93
93
|
};
|
94
94
|
}
|
95
95
|
initializePlugins(plugins2) {
|
@@ -192,8 +192,8 @@ var require_tom_select_complete = __commonJS({
|
|
192
192
|
if (input.length === 1)
|
193
193
|
return [[input]];
|
194
194
|
let result = [];
|
195
|
-
const
|
196
|
-
const suba = allSubstrings(
|
195
|
+
const start2 = input.substring(1);
|
196
|
+
const suba = allSubstrings(start2);
|
197
197
|
suba.forEach(function(subresult) {
|
198
198
|
let tmp = subresult.slice(0);
|
199
199
|
tmp[0] = input.charAt(0) + tmp[0];
|
@@ -1047,7 +1047,7 @@ var require_tom_select_complete = __commonJS({
|
|
1047
1047
|
const escape_html = (str) => {
|
1048
1048
|
return (str + "").replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
1049
1049
|
};
|
1050
|
-
const loadDebounce = (
|
1050
|
+
const loadDebounce = (fn2, delay) => {
|
1051
1051
|
var timeout;
|
1052
1052
|
return function(value, callback) {
|
1053
1053
|
var self2 = this;
|
@@ -1058,11 +1058,11 @@ var require_tom_select_complete = __commonJS({
|
|
1058
1058
|
timeout = setTimeout(function() {
|
1059
1059
|
timeout = null;
|
1060
1060
|
self2.loadedSearches[value] = true;
|
1061
|
-
|
1061
|
+
fn2.call(self2, value, callback);
|
1062
1062
|
}, delay);
|
1063
1063
|
};
|
1064
1064
|
};
|
1065
|
-
const debounce_events = (self2, types,
|
1065
|
+
const debounce_events = (self2, types, fn2) => {
|
1066
1066
|
var type;
|
1067
1067
|
var trigger = self2.trigger;
|
1068
1068
|
var event_args = {};
|
@@ -1074,7 +1074,7 @@ var require_tom_select_complete = __commonJS({
|
|
1074
1074
|
return trigger.apply(self2, arguments);
|
1075
1075
|
}
|
1076
1076
|
};
|
1077
|
-
|
1077
|
+
fn2.apply(self2, []);
|
1078
1078
|
self2.trigger = trigger;
|
1079
1079
|
for (type of types) {
|
1080
1080
|
if (type in event_args) {
|
@@ -1579,7 +1579,7 @@ var require_tom_select_complete = __commonJS({
|
|
1579
1579
|
self2.settings.render = Object.assign({}, templates, self2.settings.render);
|
1580
1580
|
}
|
1581
1581
|
setupCallbacks() {
|
1582
|
-
var key,
|
1582
|
+
var key, fn2;
|
1583
1583
|
var callbacks = {
|
1584
1584
|
"initialize": "onInitialize",
|
1585
1585
|
"change": "onChange",
|
@@ -1601,9 +1601,9 @@ var require_tom_select_complete = __commonJS({
|
|
1601
1601
|
"blur": "onBlur"
|
1602
1602
|
};
|
1603
1603
|
for (key in callbacks) {
|
1604
|
-
|
1605
|
-
if (
|
1606
|
-
this.on(key,
|
1604
|
+
fn2 = this.settings[callbacks[key]];
|
1605
|
+
if (fn2)
|
1606
|
+
this.on(key, fn2);
|
1607
1607
|
}
|
1608
1608
|
}
|
1609
1609
|
sync(get_settings = true) {
|
@@ -1650,8 +1650,8 @@ var require_tom_select_complete = __commonJS({
|
|
1650
1650
|
}
|
1651
1651
|
var splitInput = pastedText.trim().split(self2.settings.splitOn);
|
1652
1652
|
iterate$1(splitInput, (piece) => {
|
1653
|
-
const
|
1654
|
-
if (
|
1653
|
+
const hash3 = hash_key(piece);
|
1654
|
+
if (hash3) {
|
1655
1655
|
if (this.options[piece]) {
|
1656
1656
|
self2.addItem(piece);
|
1657
1657
|
} else {
|
@@ -1921,7 +1921,7 @@ var require_tom_select_complete = __commonJS({
|
|
1921
1921
|
setActiveItem(item, e) {
|
1922
1922
|
var self2 = this;
|
1923
1923
|
var eventName;
|
1924
|
-
var i, begin,
|
1924
|
+
var i, begin, end2, swap;
|
1925
1925
|
var last;
|
1926
1926
|
if (self2.settings.mode === "single")
|
1927
1927
|
return;
|
@@ -1936,13 +1936,13 @@ var require_tom_select_complete = __commonJS({
|
|
1936
1936
|
if (eventName === "click" && isKeyDown("shiftKey", e) && self2.activeItems.length) {
|
1937
1937
|
last = self2.getLastActive();
|
1938
1938
|
begin = Array.prototype.indexOf.call(self2.control.children, last);
|
1939
|
-
|
1940
|
-
if (begin >
|
1939
|
+
end2 = Array.prototype.indexOf.call(self2.control.children, item);
|
1940
|
+
if (begin > end2) {
|
1941
1941
|
swap = begin;
|
1942
|
-
begin =
|
1943
|
-
|
1942
|
+
begin = end2;
|
1943
|
+
end2 = swap;
|
1944
1944
|
}
|
1945
|
-
for (i = begin; i <=
|
1945
|
+
for (i = begin; i <= end2; i++) {
|
1946
1946
|
item = self2.control.children[i];
|
1947
1947
|
if (self2.activeItems.indexOf(item) === -1) {
|
1948
1948
|
self2.setActiveItemClass(item);
|
@@ -2749,12 +2749,12 @@ var require_tom_select_complete = __commonJS({
|
|
2749
2749
|
}
|
2750
2750
|
var context = this.control;
|
2751
2751
|
var rect = context.getBoundingClientRect();
|
2752
|
-
var
|
2753
|
-
var
|
2752
|
+
var top2 = context.offsetHeight + rect.top + window.scrollY;
|
2753
|
+
var left2 = rect.left + window.scrollX;
|
2754
2754
|
applyCSS(this.dropdown, {
|
2755
2755
|
width: rect.width + "px",
|
2756
|
-
top:
|
2757
|
-
left:
|
2756
|
+
top: top2 + "px",
|
2757
|
+
left: left2 + "px"
|
2758
2758
|
});
|
2759
2759
|
}
|
2760
2760
|
clear(silent) {
|
@@ -3552,8 +3552,8 @@ var EventListener = class {
|
|
3552
3552
|
return this.unorderedBindings.size > 0;
|
3553
3553
|
}
|
3554
3554
|
get bindings() {
|
3555
|
-
return Array.from(this.unorderedBindings).sort((
|
3556
|
-
const leftIndex =
|
3555
|
+
return Array.from(this.unorderedBindings).sort((left2, right2) => {
|
3556
|
+
const leftIndex = left2.index, rightIndex = right2.index;
|
3557
3557
|
return leftIndex < rightIndex ? -1 : leftIndex > rightIndex ? 1 : 0;
|
3558
3558
|
});
|
3559
3559
|
}
|
@@ -4358,12 +4358,12 @@ var TokenListObserver = class {
|
|
4358
4358
|
function parseTokenString(tokenString, element, attributeName) {
|
4359
4359
|
return tokenString.trim().split(/\s+/).filter((content) => content.length).map((content, index2) => ({ element, attributeName, content, index: index2 }));
|
4360
4360
|
}
|
4361
|
-
function zip(
|
4362
|
-
const length = Math.max(
|
4363
|
-
return Array.from({ length }, (_, index2) => [
|
4361
|
+
function zip(left2, right2) {
|
4362
|
+
const length = Math.max(left2.length, right2.length);
|
4363
|
+
return Array.from({ length }, (_, index2) => [left2[index2], right2[index2]]);
|
4364
4364
|
}
|
4365
|
-
function tokensAreEqual(
|
4366
|
-
return
|
4365
|
+
function tokensAreEqual(left2, right2) {
|
4366
|
+
return left2 && right2 && left2.index == right2.index && left2.content == right2.content;
|
4367
4367
|
}
|
4368
4368
|
var ValueListObserver = class {
|
4369
4369
|
constructor(element, attributeName, delegate) {
|
@@ -5598,13 +5598,13 @@ function ValuePropertiesBlessing(constructor) {
|
|
5598
5598
|
}
|
5599
5599
|
function propertiesForValueDefinitionPair(valueDefinitionPair, controller) {
|
5600
5600
|
const definition = parseValueDefinitionPair(valueDefinitionPair, controller);
|
5601
|
-
const { key, name, reader:
|
5601
|
+
const { key, name, reader: read2, writer: write2 } = definition;
|
5602
5602
|
return {
|
5603
5603
|
[name]: {
|
5604
5604
|
get() {
|
5605
5605
|
const value = this.data.get(key);
|
5606
5606
|
if (value !== null) {
|
5607
|
-
return
|
5607
|
+
return read2(value);
|
5608
5608
|
} else {
|
5609
5609
|
return definition.defaultValue;
|
5610
5610
|
}
|
@@ -5613,7 +5613,7 @@ function propertiesForValueDefinitionPair(valueDefinitionPair, controller) {
|
|
5613
5613
|
if (value === void 0) {
|
5614
5614
|
this.data.delete(key);
|
5615
5615
|
} else {
|
5616
|
-
this.data.set(key,
|
5616
|
+
this.data.set(key, write2(value));
|
5617
5617
|
}
|
5618
5618
|
}
|
5619
5619
|
},
|
@@ -6243,7 +6243,7 @@ var file_preview_controller_default = class extends Controller {
|
|
6243
6243
|
return (bytes / Math.pow(1024, i)).toFixed(2) * 1 + " " + ["B", "kB", "MB", "GB", "TB"][i];
|
6244
6244
|
}
|
6245
6245
|
updateThumbnailRemoveButton(thumbnail, fileName) {
|
6246
|
-
const removeButton = thumbnail.querySelector(".
|
6246
|
+
const removeButton = thumbnail.querySelector(".formstrap-file-thumbnail-remove");
|
6247
6247
|
if (removeButton) {
|
6248
6248
|
removeButton.dataset.filePreviewNameParam = fileName;
|
6249
6249
|
}
|
@@ -6252,14 +6252,14 @@ var file_preview_controller_default = class extends Controller {
|
|
6252
6252
|
thumbnail.title = title;
|
6253
6253
|
}
|
6254
6254
|
updateThumbnailBackground(thumbnail, url) {
|
6255
|
-
const thumbnailBackground = thumbnail.querySelector(".
|
6255
|
+
const thumbnailBackground = thumbnail.querySelector(".formstrap-thumbnail-bg");
|
6256
6256
|
thumbnailBackground.style.backgroundImage = `url('${url}')`;
|
6257
6257
|
}
|
6258
6258
|
removeThumbnailIcon(thumbnail) {
|
6259
|
-
thumbnail.querySelector(".
|
6259
|
+
thumbnail.querySelector(".formstrap-thumbnail-bg").innerHTML = "";
|
6260
6260
|
}
|
6261
6261
|
updateThumbnailIcon(thumbnail, icon) {
|
6262
|
-
thumbnail.querySelector(".
|
6262
|
+
thumbnail.querySelector(".formstrap-thumbnail-bg").innerHTML = icon;
|
6263
6263
|
}
|
6264
6264
|
iconForMimeType(mimeType) {
|
6265
6265
|
const typeMap = {
|
@@ -6277,7 +6277,7 @@ var file_preview_controller_default = class extends Controller {
|
|
6277
6277
|
};
|
6278
6278
|
const iconName = Object.keys(typeMap).find((key) => typeMap[key].includes(mimeType));
|
6279
6279
|
const fullIconName = ["bi", "file", "earmark", iconName].filter((e) => typeof e === "string" && e !== "").join("-");
|
6280
|
-
return `<i class="bi ${fullIconName}
|
6280
|
+
return `<i class="bi ${fullIconName} formstrap-thumbnail-icon"></i>`;
|
6281
6281
|
}
|
6282
6282
|
isImage(file) {
|
6283
6283
|
return file.type.match(/^image/) !== null;
|
@@ -6471,14 +6471,14 @@ var pad = function(number, length) {
|
|
6471
6471
|
var int = function(bool) {
|
6472
6472
|
return bool === true ? 1 : 0;
|
6473
6473
|
};
|
6474
|
-
function debounce(
|
6474
|
+
function debounce(fn2, wait) {
|
6475
6475
|
var t;
|
6476
6476
|
return function() {
|
6477
6477
|
var _this = this;
|
6478
6478
|
var args = arguments;
|
6479
6479
|
clearTimeout(t);
|
6480
6480
|
t = setTimeout(function() {
|
6481
|
-
return
|
6481
|
+
return fn2.apply(_this, args);
|
6482
6482
|
}, wait);
|
6483
6483
|
};
|
6484
6484
|
}
|
@@ -6738,21 +6738,21 @@ var createDateParser = function(_a) {
|
|
6738
6738
|
else if (typeof date !== "string" && date.toFixed !== void 0)
|
6739
6739
|
parsedDate = new Date(date);
|
6740
6740
|
else if (typeof date === "string") {
|
6741
|
-
var
|
6741
|
+
var format2 = givenFormat || (config || defaults).dateFormat;
|
6742
6742
|
var datestr = String(date).trim();
|
6743
6743
|
if (datestr === "today") {
|
6744
6744
|
parsedDate = new Date();
|
6745
6745
|
timeless = true;
|
6746
6746
|
} else if (config && config.parseDate) {
|
6747
|
-
parsedDate = config.parseDate(date,
|
6747
|
+
parsedDate = config.parseDate(date, format2);
|
6748
6748
|
} else if (/Z$/.test(datestr) || /GMT$/.test(datestr)) {
|
6749
6749
|
parsedDate = new Date(date);
|
6750
6750
|
} else {
|
6751
6751
|
var matched = void 0, ops = [];
|
6752
|
-
for (var i = 0, matchIndex = 0, regexStr = ""; i <
|
6753
|
-
var token =
|
6752
|
+
for (var i = 0, matchIndex = 0, regexStr = ""; i < format2.length; i++) {
|
6753
|
+
var token = format2[i];
|
6754
6754
|
var isBackSlash = token === "\\";
|
6755
|
-
var escaped =
|
6755
|
+
var escaped = format2[i - 1] === "\\" || isBackSlash;
|
6756
6756
|
if (tokenRegex[token] && !escaped) {
|
6757
6757
|
regexStr += tokenRegex[token];
|
6758
6758
|
var match = new RegExp(regexStr).exec(date);
|
@@ -6767,8 +6767,8 @@ var createDateParser = function(_a) {
|
|
6767
6767
|
}
|
6768
6768
|
parsedDate = !config || !config.noCalendar ? new Date(new Date().getFullYear(), 0, 1, 0, 0, 0, 0) : new Date(new Date().setHours(0, 0, 0, 0));
|
6769
6769
|
ops.forEach(function(_a2) {
|
6770
|
-
var
|
6771
|
-
return parsedDate =
|
6770
|
+
var fn2 = _a2.fn, val = _a2.val;
|
6771
|
+
return parsedDate = fn2(parsedDate, val, locale) || parsedDate;
|
6772
6772
|
});
|
6773
6773
|
parsedDate = matched ? parsedDate : void 0;
|
6774
6774
|
}
|
@@ -6951,8 +6951,8 @@ function FlatpickrInstance(element, instanceConfig) {
|
|
6951
6951
|
var _a;
|
6952
6952
|
return ((_a = self2.calendarContainer) === null || _a === void 0 ? void 0 : _a.getRootNode()).activeElement || document.activeElement;
|
6953
6953
|
}
|
6954
|
-
function bindToInstance(
|
6955
|
-
return
|
6954
|
+
function bindToInstance(fn2) {
|
6955
|
+
return fn2.bind(self2);
|
6956
6956
|
}
|
6957
6957
|
function setCalendarWidth() {
|
6958
6958
|
var config = self2.config;
|
@@ -7309,16 +7309,16 @@ function FlatpickrInstance(element, instanceConfig) {
|
|
7309
7309
|
focusOnDay(getFirstAvailableDay(loopDelta), 0);
|
7310
7310
|
return void 0;
|
7311
7311
|
}
|
7312
|
-
function focusOnDay(current,
|
7312
|
+
function focusOnDay(current, offset2) {
|
7313
7313
|
var activeElement = getClosestActiveElement();
|
7314
7314
|
var dayFocused = isInView(activeElement || document.body);
|
7315
|
-
var startElem = current !== void 0 ? current : dayFocused ? activeElement : self2.selectedDateElem !== void 0 && isInView(self2.selectedDateElem) ? self2.selectedDateElem : self2.todayDateElem !== void 0 && isInView(self2.todayDateElem) ? self2.todayDateElem : getFirstAvailableDay(
|
7315
|
+
var startElem = current !== void 0 ? current : dayFocused ? activeElement : self2.selectedDateElem !== void 0 && isInView(self2.selectedDateElem) ? self2.selectedDateElem : self2.todayDateElem !== void 0 && isInView(self2.todayDateElem) ? self2.todayDateElem : getFirstAvailableDay(offset2 > 0 ? 1 : -1);
|
7316
7316
|
if (startElem === void 0) {
|
7317
7317
|
self2._input.focus();
|
7318
7318
|
} else if (!dayFocused) {
|
7319
7319
|
focusOnDayElem(startElem);
|
7320
7320
|
} else {
|
7321
|
-
getNextAvailableDay(startElem,
|
7321
|
+
getNextAvailableDay(startElem, offset2);
|
7322
7322
|
}
|
7323
7323
|
}
|
7324
7324
|
function buildMonthDays(year, month) {
|
@@ -8128,37 +8128,37 @@ function FlatpickrInstance(element, instanceConfig) {
|
|
8128
8128
|
var calendarHeight = Array.prototype.reduce.call(self2.calendarContainer.children, function(acc, child) {
|
8129
8129
|
return acc + child.offsetHeight;
|
8130
8130
|
}, 0), calendarWidth = self2.calendarContainer.offsetWidth, configPos = self2.config.position.split(" "), configPosVertical = configPos[0], configPosHorizontal = configPos.length > 1 ? configPos[1] : null, inputBounds = positionElement.getBoundingClientRect(), distanceFromBottom = window.innerHeight - inputBounds.bottom, showOnTop = configPosVertical === "above" || configPosVertical !== "below" && distanceFromBottom < calendarHeight && inputBounds.top > calendarHeight;
|
8131
|
-
var
|
8131
|
+
var top2 = window.pageYOffset + inputBounds.top + (!showOnTop ? positionElement.offsetHeight + 2 : -calendarHeight - 2);
|
8132
8132
|
toggleClass(self2.calendarContainer, "arrowTop", !showOnTop);
|
8133
8133
|
toggleClass(self2.calendarContainer, "arrowBottom", showOnTop);
|
8134
8134
|
if (self2.config.inline)
|
8135
8135
|
return;
|
8136
|
-
var
|
8136
|
+
var left2 = window.pageXOffset + inputBounds.left;
|
8137
8137
|
var isCenter = false;
|
8138
8138
|
var isRight = false;
|
8139
8139
|
if (configPosHorizontal === "center") {
|
8140
|
-
|
8140
|
+
left2 -= (calendarWidth - inputBounds.width) / 2;
|
8141
8141
|
isCenter = true;
|
8142
8142
|
} else if (configPosHorizontal === "right") {
|
8143
|
-
|
8143
|
+
left2 -= calendarWidth - inputBounds.width;
|
8144
8144
|
isRight = true;
|
8145
8145
|
}
|
8146
8146
|
toggleClass(self2.calendarContainer, "arrowLeft", !isCenter && !isRight);
|
8147
8147
|
toggleClass(self2.calendarContainer, "arrowCenter", isCenter);
|
8148
8148
|
toggleClass(self2.calendarContainer, "arrowRight", isRight);
|
8149
|
-
var
|
8150
|
-
var rightMost =
|
8151
|
-
var centerMost =
|
8149
|
+
var right2 = window.document.body.offsetWidth - (window.pageXOffset + inputBounds.right);
|
8150
|
+
var rightMost = left2 + calendarWidth > window.document.body.offsetWidth;
|
8151
|
+
var centerMost = right2 + calendarWidth > window.document.body.offsetWidth;
|
8152
8152
|
toggleClass(self2.calendarContainer, "rightMost", rightMost);
|
8153
8153
|
if (self2.config.static)
|
8154
8154
|
return;
|
8155
|
-
self2.calendarContainer.style.top =
|
8155
|
+
self2.calendarContainer.style.top = top2 + "px";
|
8156
8156
|
if (!rightMost) {
|
8157
|
-
self2.calendarContainer.style.left =
|
8157
|
+
self2.calendarContainer.style.left = left2 + "px";
|
8158
8158
|
self2.calendarContainer.style.right = "auto";
|
8159
8159
|
} else if (!centerMost) {
|
8160
8160
|
self2.calendarContainer.style.left = "auto";
|
8161
|
-
self2.calendarContainer.style.right =
|
8161
|
+
self2.calendarContainer.style.right = right2 + "px";
|
8162
8162
|
} else {
|
8163
8163
|
var doc = getDocumentStyleSheet();
|
8164
8164
|
if (doc === void 0)
|
@@ -8313,28 +8313,28 @@ function FlatpickrInstance(element, instanceConfig) {
|
|
8313
8313
|
self2.redraw();
|
8314
8314
|
updateValue(true);
|
8315
8315
|
}
|
8316
|
-
function setSelectedDate(inputDate,
|
8316
|
+
function setSelectedDate(inputDate, format2) {
|
8317
8317
|
var dates = [];
|
8318
8318
|
if (inputDate instanceof Array)
|
8319
8319
|
dates = inputDate.map(function(d) {
|
8320
|
-
return self2.parseDate(d,
|
8320
|
+
return self2.parseDate(d, format2);
|
8321
8321
|
});
|
8322
8322
|
else if (inputDate instanceof Date || typeof inputDate === "number")
|
8323
|
-
dates = [self2.parseDate(inputDate,
|
8323
|
+
dates = [self2.parseDate(inputDate, format2)];
|
8324
8324
|
else if (typeof inputDate === "string") {
|
8325
8325
|
switch (self2.config.mode) {
|
8326
8326
|
case "single":
|
8327
8327
|
case "time":
|
8328
|
-
dates = [self2.parseDate(inputDate,
|
8328
|
+
dates = [self2.parseDate(inputDate, format2)];
|
8329
8329
|
break;
|
8330
8330
|
case "multiple":
|
8331
8331
|
dates = inputDate.split(self2.config.conjunction).map(function(date) {
|
8332
|
-
return self2.parseDate(date,
|
8332
|
+
return self2.parseDate(date, format2);
|
8333
8333
|
});
|
8334
8334
|
break;
|
8335
8335
|
case "range":
|
8336
8336
|
dates = inputDate.split(self2.l10n.rangeSeparator).map(function(date) {
|
8337
|
-
return self2.parseDate(date,
|
8337
|
+
return self2.parseDate(date, format2);
|
8338
8338
|
});
|
8339
8339
|
break;
|
8340
8340
|
default:
|
@@ -8350,16 +8350,16 @@ function FlatpickrInstance(element, instanceConfig) {
|
|
8350
8350
|
return a.getTime() - b.getTime();
|
8351
8351
|
});
|
8352
8352
|
}
|
8353
|
-
function setDate(date, triggerChange2,
|
8353
|
+
function setDate(date, triggerChange2, format2) {
|
8354
8354
|
if (triggerChange2 === void 0) {
|
8355
8355
|
triggerChange2 = false;
|
8356
8356
|
}
|
8357
|
-
if (
|
8358
|
-
|
8357
|
+
if (format2 === void 0) {
|
8358
|
+
format2 = self2.config.dateFormat;
|
8359
8359
|
}
|
8360
8360
|
if (date !== 0 && !date || date instanceof Array && date.length === 0)
|
8361
8361
|
return self2.clear(triggerChange2);
|
8362
|
-
setSelectedDate(date,
|
8362
|
+
setSelectedDate(date, format2);
|
8363
8363
|
self2.latestSelectedDateObj = self2.selectedDates[self2.selectedDates.length - 1];
|
8364
8364
|
self2.redraw();
|
8365
8365
|
jumpToDate(void 0, triggerChange2);
|
@@ -8517,9 +8517,9 @@ function FlatpickrInstance(element, instanceConfig) {
|
|
8517
8517
|
self2._hideNextMonthArrow = self2.config.maxDate !== void 0 && (self2.currentYear === self2.config.maxDate.getFullYear() ? self2.currentMonth + 1 > self2.config.maxDate.getMonth() : self2.currentYear > self2.config.maxDate.getFullYear());
|
8518
8518
|
}
|
8519
8519
|
function getDateStr(specificFormat) {
|
8520
|
-
var
|
8520
|
+
var format2 = specificFormat || (self2.config.altInput ? self2.config.altFormat : self2.config.dateFormat);
|
8521
8521
|
return self2.selectedDates.map(function(dObj) {
|
8522
|
-
return self2.formatDate(dObj,
|
8522
|
+
return self2.formatDate(dObj, format2);
|
8523
8523
|
}).filter(function(d, i, arr) {
|
8524
8524
|
return self2.config.mode !== "range" || self2.config.enableTime || arr.indexOf(d) === i;
|
8525
8525
|
}).join(self2.config.mode !== "range" ? self2.config.conjunction : self2.l10n.rangeSeparator);
|
@@ -8558,16 +8558,16 @@ function FlatpickrInstance(element, instanceConfig) {
|
|
8558
8558
|
if (self2.amPM !== void 0 && eventTarget === self2.amPM) {
|
8559
8559
|
self2.amPM.textContent = self2.l10n.amPM[int(self2.amPM.textContent === self2.l10n.amPM[0])];
|
8560
8560
|
}
|
8561
|
-
var
|
8561
|
+
var min2 = parseFloat(input.getAttribute("min")), max2 = parseFloat(input.getAttribute("max")), step = parseFloat(input.getAttribute("step")), curValue = parseInt(input.value, 10), delta = e.delta || (isKeyDown ? e.which === 38 ? 1 : -1 : 0);
|
8562
8562
|
var newValue = curValue + step * delta;
|
8563
8563
|
if (typeof input.value !== "undefined" && input.value.length === 2) {
|
8564
8564
|
var isHourElem = input === self2.hourElement, isMinuteElem = input === self2.minuteElement;
|
8565
|
-
if (newValue <
|
8566
|
-
newValue =
|
8565
|
+
if (newValue < min2) {
|
8566
|
+
newValue = max2 + newValue + int(!isHourElem) + (int(isHourElem) && int(!self2.amPM));
|
8567
8567
|
if (isMinuteElem)
|
8568
8568
|
incrementNumInput(void 0, -1, self2.hourElement);
|
8569
|
-
} else if (newValue >
|
8570
|
-
newValue = input === self2.hourElement ? newValue -
|
8569
|
+
} else if (newValue > max2) {
|
8570
|
+
newValue = input === self2.hourElement ? newValue - max2 - int(!self2.amPM) : min2;
|
8571
8571
|
if (isMinuteElem)
|
8572
8572
|
incrementNumInput(void 0, 1, self2.hourElement);
|
8573
8573
|
}
|
@@ -8891,11 +8891,11 @@ var captureMode = {
|
|
8891
8891
|
capture: false,
|
8892
8892
|
passive: false
|
8893
8893
|
};
|
8894
|
-
function on(el, event,
|
8895
|
-
el.addEventListener(event,
|
8894
|
+
function on(el, event, fn2) {
|
8895
|
+
el.addEventListener(event, fn2, !IE11OrLess && captureMode);
|
8896
8896
|
}
|
8897
|
-
function off(el, event,
|
8898
|
-
el.removeEventListener(event,
|
8897
|
+
function off(el, event, fn2) {
|
8898
|
+
el.removeEventListener(event, fn2, !IE11OrLess && captureMode);
|
8899
8899
|
}
|
8900
8900
|
function matches(el, selector) {
|
8901
8901
|
if (!selector)
|
@@ -8999,20 +8999,20 @@ function getWindowScrollingElement() {
|
|
8999
8999
|
function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoScale, container) {
|
9000
9000
|
if (!el.getBoundingClientRect && el !== window)
|
9001
9001
|
return;
|
9002
|
-
var elRect,
|
9002
|
+
var elRect, top2, left2, bottom2, right2, height, width;
|
9003
9003
|
if (el !== window && el.parentNode && el !== getWindowScrollingElement()) {
|
9004
9004
|
elRect = el.getBoundingClientRect();
|
9005
|
-
|
9006
|
-
|
9007
|
-
|
9008
|
-
|
9005
|
+
top2 = elRect.top;
|
9006
|
+
left2 = elRect.left;
|
9007
|
+
bottom2 = elRect.bottom;
|
9008
|
+
right2 = elRect.right;
|
9009
9009
|
height = elRect.height;
|
9010
9010
|
width = elRect.width;
|
9011
9011
|
} else {
|
9012
|
-
|
9013
|
-
|
9014
|
-
|
9015
|
-
|
9012
|
+
top2 = 0;
|
9013
|
+
left2 = 0;
|
9014
|
+
bottom2 = window.innerHeight;
|
9015
|
+
right2 = window.innerWidth;
|
9016
9016
|
height = window.innerHeight;
|
9017
9017
|
width = window.innerWidth;
|
9018
9018
|
}
|
@@ -9022,10 +9022,10 @@ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoS
|
|
9022
9022
|
do {
|
9023
9023
|
if (container && container.getBoundingClientRect && (css(container, "transform") !== "none" || relativeToNonStaticParent && css(container, "position") !== "static")) {
|
9024
9024
|
var containerRect = container.getBoundingClientRect();
|
9025
|
-
|
9026
|
-
|
9027
|
-
|
9028
|
-
|
9025
|
+
top2 -= containerRect.top + parseInt(css(container, "border-top-width"));
|
9026
|
+
left2 -= containerRect.left + parseInt(css(container, "border-left-width"));
|
9027
|
+
bottom2 = top2 + elRect.height;
|
9028
|
+
right2 = left2 + elRect.width;
|
9029
9029
|
break;
|
9030
9030
|
}
|
9031
9031
|
} while (container = container.parentNode);
|
@@ -9034,19 +9034,19 @@ function getRect(el, relativeToContainingBlock, relativeToNonStaticParent, undoS
|
|
9034
9034
|
if (undoScale && el !== window) {
|
9035
9035
|
var elMatrix = matrix(container || el), scaleX = elMatrix && elMatrix.a, scaleY = elMatrix && elMatrix.d;
|
9036
9036
|
if (elMatrix) {
|
9037
|
-
|
9038
|
-
|
9037
|
+
top2 /= scaleY;
|
9038
|
+
left2 /= scaleX;
|
9039
9039
|
width /= scaleX;
|
9040
9040
|
height /= scaleY;
|
9041
|
-
|
9042
|
-
|
9041
|
+
bottom2 = top2 + height;
|
9042
|
+
right2 = left2 + width;
|
9043
9043
|
}
|
9044
9044
|
}
|
9045
9045
|
return {
|
9046
|
-
top,
|
9047
|
-
left,
|
9048
|
-
bottom,
|
9049
|
-
right,
|
9046
|
+
top: top2,
|
9047
|
+
left: left2,
|
9048
|
+
bottom: bottom2,
|
9049
|
+
right: right2,
|
9050
9050
|
width,
|
9051
9051
|
height
|
9052
9052
|
};
|
@@ -9681,9 +9681,9 @@ function Sortable(el, options) {
|
|
9681
9681
|
!(name in options) && (options[name] = defaults3[name]);
|
9682
9682
|
}
|
9683
9683
|
_prepareGroup(options);
|
9684
|
-
for (var
|
9685
|
-
if (
|
9686
|
-
this[
|
9684
|
+
for (var fn2 in this) {
|
9685
|
+
if (fn2.charAt(0) === "_" && typeof this[fn2] === "function") {
|
9686
|
+
this[fn2] = this[fn2].bind(this);
|
9687
9687
|
}
|
9688
9688
|
}
|
9689
9689
|
this.nativeDraggable = options.forceFallback ? false : supportDraggable;
|
@@ -10461,16 +10461,16 @@ Sortable.prototype = {
|
|
10461
10461
|
}
|
10462
10462
|
},
|
10463
10463
|
toArray: function toArray() {
|
10464
|
-
var
|
10464
|
+
var order2 = [], el, children = this.el.children, i = 0, n = children.length, options = this.options;
|
10465
10465
|
for (; i < n; i++) {
|
10466
10466
|
el = children[i];
|
10467
10467
|
if (closest(el, options.draggable, this.el, false)) {
|
10468
|
-
|
10468
|
+
order2.push(el.getAttribute(options.dataIdAttr) || _generateId(el));
|
10469
10469
|
}
|
10470
10470
|
}
|
10471
|
-
return
|
10471
|
+
return order2;
|
10472
10472
|
},
|
10473
|
-
sort: function sort(
|
10473
|
+
sort: function sort(order2, useAnimation) {
|
10474
10474
|
var items = {}, rootEl2 = this.el;
|
10475
10475
|
this.toArray().forEach(function(id, i) {
|
10476
10476
|
var el = rootEl2.children[i];
|
@@ -10479,7 +10479,7 @@ Sortable.prototype = {
|
|
10479
10479
|
}
|
10480
10480
|
}, this);
|
10481
10481
|
useAnimation && this.captureAnimationState();
|
10482
|
-
|
10482
|
+
order2.forEach(function(id) {
|
10483
10483
|
if (items[id]) {
|
10484
10484
|
rootEl2.removeChild(items[id]);
|
10485
10485
|
rootEl2.appendChild(items[id]);
|
@@ -10663,8 +10663,8 @@ function _saveInputCheckedState(root) {
|
|
10663
10663
|
el.checked && savedInputChecked.push(el);
|
10664
10664
|
}
|
10665
10665
|
}
|
10666
|
-
function _nextTick(
|
10667
|
-
return setTimeout(
|
10666
|
+
function _nextTick(fn2) {
|
10667
|
+
return setTimeout(fn2, 0);
|
10668
10668
|
}
|
10669
10669
|
function _cancelNextTick(id) {
|
10670
10670
|
return clearTimeout(id);
|
@@ -10734,9 +10734,9 @@ function AutoScrollPlugin() {
|
|
10734
10734
|
scrollSpeed: 10,
|
10735
10735
|
bubbleScroll: true
|
10736
10736
|
};
|
10737
|
-
for (var
|
10738
|
-
if (
|
10739
|
-
this[
|
10737
|
+
for (var fn2 in this) {
|
10738
|
+
if (fn2.charAt(0) === "_" && typeof this[fn2] === "function") {
|
10739
|
+
this[fn2] = this[fn2].bind(this);
|
10740
10740
|
}
|
10741
10741
|
}
|
10742
10742
|
}
|
@@ -10840,7 +10840,7 @@ var autoScroll = throttle(function(evt, options, rootEl2, isFallback) {
|
|
10840
10840
|
var layersOut = 0;
|
10841
10841
|
var currentParent = scrollEl;
|
10842
10842
|
do {
|
10843
|
-
var el = currentParent, rect = getRect(el),
|
10843
|
+
var el = currentParent, rect = getRect(el), top2 = rect.top, bottom2 = rect.bottom, left2 = rect.left, right2 = rect.right, width = rect.width, height = rect.height, canScrollX = void 0, canScrollY = void 0, scrollWidth = el.scrollWidth, scrollHeight = el.scrollHeight, elCSS = css(el), scrollPosX = el.scrollLeft, scrollPosY = el.scrollTop;
|
10844
10844
|
if (el === winScroller) {
|
10845
10845
|
canScrollX = width < scrollWidth && (elCSS.overflowX === "auto" || elCSS.overflowX === "scroll" || elCSS.overflowX === "visible");
|
10846
10846
|
canScrollY = height < scrollHeight && (elCSS.overflowY === "auto" || elCSS.overflowY === "scroll" || elCSS.overflowY === "visible");
|
@@ -10848,8 +10848,8 @@ var autoScroll = throttle(function(evt, options, rootEl2, isFallback) {
|
|
10848
10848
|
canScrollX = width < scrollWidth && (elCSS.overflowX === "auto" || elCSS.overflowX === "scroll");
|
10849
10849
|
canScrollY = height < scrollHeight && (elCSS.overflowY === "auto" || elCSS.overflowY === "scroll");
|
10850
10850
|
}
|
10851
|
-
var vx = canScrollX && (Math.abs(
|
10852
|
-
var vy = canScrollY && (Math.abs(
|
10851
|
+
var vx = canScrollX && (Math.abs(right2 - x) <= sens && scrollPosX + width < scrollWidth) - (Math.abs(left2 - x) <= sens && !!scrollPosX);
|
10852
|
+
var vy = canScrollY && (Math.abs(bottom2 - y) <= sens && scrollPosY + height < scrollHeight) - (Math.abs(top2 - y) <= sens && !!scrollPosY);
|
10853
10853
|
if (!autoScrolls[layersOut]) {
|
10854
10854
|
for (var i = 0; i <= layersOut; i++) {
|
10855
10855
|
if (!autoScrolls[i]) {
|
@@ -11087,8 +11087,10 @@ var media_controller_default = class extends Controller {
|
|
11087
11087
|
newItem.querySelector('input[name*="[blob_id]"]').value = item.blobId;
|
11088
11088
|
newItem.querySelector('input[name*="[_destroy]"]').value = false;
|
11089
11089
|
const editButton = newItem.querySelector('[data-media-target="editButton"]');
|
11090
|
-
|
11091
|
-
|
11090
|
+
if (editButton) {
|
11091
|
+
editButton.setAttribute("href", editButton.getAttribute("href").replace(":id", item.blobId));
|
11092
|
+
}
|
11093
|
+
const oldThumbnail = newItem.querySelector(".formstrap-thumbnail");
|
11092
11094
|
const newThumbnail = item.thumbnail.cloneNode(true);
|
11093
11095
|
oldThumbnail.parentNode.replaceChild(newThumbnail, oldThumbnail);
|
11094
11096
|
}
|
@@ -11139,7 +11141,7 @@ var media_controller_default = class extends Controller {
|
|
11139
11141
|
// app/assets/javascripts/formstrap/controllers/media_modal_controller.js
|
11140
11142
|
var media_modal_controller_default = class extends Controller {
|
11141
11143
|
static get targets() {
|
11142
|
-
return ["idCheckbox", "item", "form", "selectButton", "placeholder", "count"];
|
11144
|
+
return ["idCheckbox", "item", "form", "selectButton", "placeholder", "count", "search", "searchId"];
|
11143
11145
|
}
|
11144
11146
|
static get values() {
|
11145
11147
|
return { ids: Array };
|
@@ -11153,6 +11155,7 @@ var media_modal_controller_default = class extends Controller {
|
|
11153
11155
|
}
|
11154
11156
|
submitForm() {
|
11155
11157
|
this.hidePlaceholder();
|
11158
|
+
this.search("");
|
11156
11159
|
this.triggerFormSubmission();
|
11157
11160
|
}
|
11158
11161
|
inputChange(event) {
|
@@ -11162,6 +11165,11 @@ var media_modal_controller_default = class extends Controller {
|
|
11162
11165
|
hidePlaceholder() {
|
11163
11166
|
this.placeholderTarget.classList.add("d-none");
|
11164
11167
|
}
|
11168
|
+
search(string) {
|
11169
|
+
const search = this.searchTarget.querySelector("input[name='search']");
|
11170
|
+
search.value = string;
|
11171
|
+
this.searchTarget.requestSubmit();
|
11172
|
+
}
|
11165
11173
|
handleIdsUpdate(element) {
|
11166
11174
|
if (element.checked) {
|
11167
11175
|
const arr = this.idsValue;
|
@@ -11172,6 +11180,7 @@ var media_modal_controller_default = class extends Controller {
|
|
11172
11180
|
return element.value !== value;
|
11173
11181
|
});
|
11174
11182
|
}
|
11183
|
+
this.handleSearchdIdsUpdate();
|
11175
11184
|
}
|
11176
11185
|
itemTargetConnected(element) {
|
11177
11186
|
this.updateItem(element.querySelector("input"));
|
@@ -11217,7 +11226,7 @@ var media_modal_controller_default = class extends Controller {
|
|
11217
11226
|
const element = this.element.querySelector(blobId);
|
11218
11227
|
return {
|
11219
11228
|
blobId: id,
|
11220
|
-
thumbnail: element ? element.querySelector(".
|
11229
|
+
thumbnail: element ? element.querySelector(".formstrap-thumbnail") : ""
|
11221
11230
|
};
|
11222
11231
|
}
|
11223
11232
|
selectedItems() {
|
@@ -11255,6 +11264,1657 @@ var media_modal_controller_default = class extends Controller {
|
|
11255
11264
|
updateCount() {
|
11256
11265
|
this.countTarget.innerHTML = this.selectedItemsCount();
|
11257
11266
|
}
|
11267
|
+
handleSearchdIdsUpdate() {
|
11268
|
+
this.deleteSearchIdInputs();
|
11269
|
+
this.createSearchIdInputs();
|
11270
|
+
}
|
11271
|
+
deleteSearchIdInputs() {
|
11272
|
+
for (const searchId of this.searchIdTargets) {
|
11273
|
+
searchId.remove();
|
11274
|
+
}
|
11275
|
+
}
|
11276
|
+
createSearchIdInputs() {
|
11277
|
+
for (const id of this.idsValue) {
|
11278
|
+
this.createSearchIdInput(id);
|
11279
|
+
}
|
11280
|
+
}
|
11281
|
+
createSearchIdInput(value) {
|
11282
|
+
const input = document.createElement("input");
|
11283
|
+
input.type = "hidden";
|
11284
|
+
input.name = "ids[]";
|
11285
|
+
input.setAttribute("data-media-modal-target", "searchId");
|
11286
|
+
input.value = value;
|
11287
|
+
this.searchTarget.appendChild(input);
|
11288
|
+
}
|
11289
|
+
};
|
11290
|
+
|
11291
|
+
// node_modules/@popperjs/core/lib/enums.js
|
11292
|
+
var top = "top";
|
11293
|
+
var bottom = "bottom";
|
11294
|
+
var right = "right";
|
11295
|
+
var left = "left";
|
11296
|
+
var auto = "auto";
|
11297
|
+
var basePlacements = [top, bottom, right, left];
|
11298
|
+
var start = "start";
|
11299
|
+
var end = "end";
|
11300
|
+
var clippingParents = "clippingParents";
|
11301
|
+
var viewport = "viewport";
|
11302
|
+
var popper = "popper";
|
11303
|
+
var reference = "reference";
|
11304
|
+
var variationPlacements = /* @__PURE__ */ basePlacements.reduce(function(acc, placement) {
|
11305
|
+
return acc.concat([placement + "-" + start, placement + "-" + end]);
|
11306
|
+
}, []);
|
11307
|
+
var placements = /* @__PURE__ */ [].concat(basePlacements, [auto]).reduce(function(acc, placement) {
|
11308
|
+
return acc.concat([placement, placement + "-" + start, placement + "-" + end]);
|
11309
|
+
}, []);
|
11310
|
+
var beforeRead = "beforeRead";
|
11311
|
+
var read = "read";
|
11312
|
+
var afterRead = "afterRead";
|
11313
|
+
var beforeMain = "beforeMain";
|
11314
|
+
var main = "main";
|
11315
|
+
var afterMain = "afterMain";
|
11316
|
+
var beforeWrite = "beforeWrite";
|
11317
|
+
var write = "write";
|
11318
|
+
var afterWrite = "afterWrite";
|
11319
|
+
var modifierPhases = [beforeRead, read, afterRead, beforeMain, main, afterMain, beforeWrite, write, afterWrite];
|
11320
|
+
|
11321
|
+
// node_modules/@popperjs/core/lib/dom-utils/getNodeName.js
|
11322
|
+
function getNodeName(element) {
|
11323
|
+
return element ? (element.nodeName || "").toLowerCase() : null;
|
11324
|
+
}
|
11325
|
+
|
11326
|
+
// node_modules/@popperjs/core/lib/dom-utils/getWindow.js
|
11327
|
+
function getWindow(node) {
|
11328
|
+
if (node == null) {
|
11329
|
+
return window;
|
11330
|
+
}
|
11331
|
+
if (node.toString() !== "[object Window]") {
|
11332
|
+
var ownerDocument = node.ownerDocument;
|
11333
|
+
return ownerDocument ? ownerDocument.defaultView || window : window;
|
11334
|
+
}
|
11335
|
+
return node;
|
11336
|
+
}
|
11337
|
+
|
11338
|
+
// node_modules/@popperjs/core/lib/dom-utils/instanceOf.js
|
11339
|
+
function isElement(node) {
|
11340
|
+
var OwnElement = getWindow(node).Element;
|
11341
|
+
return node instanceof OwnElement || node instanceof Element;
|
11342
|
+
}
|
11343
|
+
function isHTMLElement(node) {
|
11344
|
+
var OwnElement = getWindow(node).HTMLElement;
|
11345
|
+
return node instanceof OwnElement || node instanceof HTMLElement;
|
11346
|
+
}
|
11347
|
+
function isShadowRoot(node) {
|
11348
|
+
if (typeof ShadowRoot === "undefined") {
|
11349
|
+
return false;
|
11350
|
+
}
|
11351
|
+
var OwnElement = getWindow(node).ShadowRoot;
|
11352
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
11353
|
+
}
|
11354
|
+
|
11355
|
+
// node_modules/@popperjs/core/lib/modifiers/applyStyles.js
|
11356
|
+
function applyStyles(_ref) {
|
11357
|
+
var state = _ref.state;
|
11358
|
+
Object.keys(state.elements).forEach(function(name) {
|
11359
|
+
var style = state.styles[name] || {};
|
11360
|
+
var attributes = state.attributes[name] || {};
|
11361
|
+
var element = state.elements[name];
|
11362
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
11363
|
+
return;
|
11364
|
+
}
|
11365
|
+
Object.assign(element.style, style);
|
11366
|
+
Object.keys(attributes).forEach(function(name2) {
|
11367
|
+
var value = attributes[name2];
|
11368
|
+
if (value === false) {
|
11369
|
+
element.removeAttribute(name2);
|
11370
|
+
} else {
|
11371
|
+
element.setAttribute(name2, value === true ? "" : value);
|
11372
|
+
}
|
11373
|
+
});
|
11374
|
+
});
|
11375
|
+
}
|
11376
|
+
function effect(_ref2) {
|
11377
|
+
var state = _ref2.state;
|
11378
|
+
var initialStyles = {
|
11379
|
+
popper: {
|
11380
|
+
position: state.options.strategy,
|
11381
|
+
left: "0",
|
11382
|
+
top: "0",
|
11383
|
+
margin: "0"
|
11384
|
+
},
|
11385
|
+
arrow: {
|
11386
|
+
position: "absolute"
|
11387
|
+
},
|
11388
|
+
reference: {}
|
11389
|
+
};
|
11390
|
+
Object.assign(state.elements.popper.style, initialStyles.popper);
|
11391
|
+
state.styles = initialStyles;
|
11392
|
+
if (state.elements.arrow) {
|
11393
|
+
Object.assign(state.elements.arrow.style, initialStyles.arrow);
|
11394
|
+
}
|
11395
|
+
return function() {
|
11396
|
+
Object.keys(state.elements).forEach(function(name) {
|
11397
|
+
var element = state.elements[name];
|
11398
|
+
var attributes = state.attributes[name] || {};
|
11399
|
+
var styleProperties = Object.keys(state.styles.hasOwnProperty(name) ? state.styles[name] : initialStyles[name]);
|
11400
|
+
var style = styleProperties.reduce(function(style2, property) {
|
11401
|
+
style2[property] = "";
|
11402
|
+
return style2;
|
11403
|
+
}, {});
|
11404
|
+
if (!isHTMLElement(element) || !getNodeName(element)) {
|
11405
|
+
return;
|
11406
|
+
}
|
11407
|
+
Object.assign(element.style, style);
|
11408
|
+
Object.keys(attributes).forEach(function(attribute) {
|
11409
|
+
element.removeAttribute(attribute);
|
11410
|
+
});
|
11411
|
+
});
|
11412
|
+
};
|
11413
|
+
}
|
11414
|
+
var applyStyles_default = {
|
11415
|
+
name: "applyStyles",
|
11416
|
+
enabled: true,
|
11417
|
+
phase: "write",
|
11418
|
+
fn: applyStyles,
|
11419
|
+
effect,
|
11420
|
+
requires: ["computeStyles"]
|
11421
|
+
};
|
11422
|
+
|
11423
|
+
// node_modules/@popperjs/core/lib/utils/getBasePlacement.js
|
11424
|
+
function getBasePlacement(placement) {
|
11425
|
+
return placement.split("-")[0];
|
11426
|
+
}
|
11427
|
+
|
11428
|
+
// node_modules/@popperjs/core/lib/utils/math.js
|
11429
|
+
var max = Math.max;
|
11430
|
+
var min = Math.min;
|
11431
|
+
var round = Math.round;
|
11432
|
+
|
11433
|
+
// node_modules/@popperjs/core/lib/utils/userAgent.js
|
11434
|
+
function getUAString() {
|
11435
|
+
var uaData = navigator.userAgentData;
|
11436
|
+
if (uaData != null && uaData.brands) {
|
11437
|
+
return uaData.brands.map(function(item) {
|
11438
|
+
return item.brand + "/" + item.version;
|
11439
|
+
}).join(" ");
|
11440
|
+
}
|
11441
|
+
return navigator.userAgent;
|
11442
|
+
}
|
11443
|
+
|
11444
|
+
// node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js
|
11445
|
+
function isLayoutViewport() {
|
11446
|
+
return !/^((?!chrome|android).)*safari/i.test(getUAString());
|
11447
|
+
}
|
11448
|
+
|
11449
|
+
// node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js
|
11450
|
+
function getBoundingClientRect(element, includeScale, isFixedStrategy) {
|
11451
|
+
if (includeScale === void 0) {
|
11452
|
+
includeScale = false;
|
11453
|
+
}
|
11454
|
+
if (isFixedStrategy === void 0) {
|
11455
|
+
isFixedStrategy = false;
|
11456
|
+
}
|
11457
|
+
var clientRect = element.getBoundingClientRect();
|
11458
|
+
var scaleX = 1;
|
11459
|
+
var scaleY = 1;
|
11460
|
+
if (includeScale && isHTMLElement(element)) {
|
11461
|
+
scaleX = element.offsetWidth > 0 ? round(clientRect.width) / element.offsetWidth || 1 : 1;
|
11462
|
+
scaleY = element.offsetHeight > 0 ? round(clientRect.height) / element.offsetHeight || 1 : 1;
|
11463
|
+
}
|
11464
|
+
var _ref = isElement(element) ? getWindow(element) : window, visualViewport = _ref.visualViewport;
|
11465
|
+
var addVisualOffsets = !isLayoutViewport() && isFixedStrategy;
|
11466
|
+
var x = (clientRect.left + (addVisualOffsets && visualViewport ? visualViewport.offsetLeft : 0)) / scaleX;
|
11467
|
+
var y = (clientRect.top + (addVisualOffsets && visualViewport ? visualViewport.offsetTop : 0)) / scaleY;
|
11468
|
+
var width = clientRect.width / scaleX;
|
11469
|
+
var height = clientRect.height / scaleY;
|
11470
|
+
return {
|
11471
|
+
width,
|
11472
|
+
height,
|
11473
|
+
top: y,
|
11474
|
+
right: x + width,
|
11475
|
+
bottom: y + height,
|
11476
|
+
left: x,
|
11477
|
+
x,
|
11478
|
+
y
|
11479
|
+
};
|
11480
|
+
}
|
11481
|
+
|
11482
|
+
// node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js
|
11483
|
+
function getLayoutRect(element) {
|
11484
|
+
var clientRect = getBoundingClientRect(element);
|
11485
|
+
var width = element.offsetWidth;
|
11486
|
+
var height = element.offsetHeight;
|
11487
|
+
if (Math.abs(clientRect.width - width) <= 1) {
|
11488
|
+
width = clientRect.width;
|
11489
|
+
}
|
11490
|
+
if (Math.abs(clientRect.height - height) <= 1) {
|
11491
|
+
height = clientRect.height;
|
11492
|
+
}
|
11493
|
+
return {
|
11494
|
+
x: element.offsetLeft,
|
11495
|
+
y: element.offsetTop,
|
11496
|
+
width,
|
11497
|
+
height
|
11498
|
+
};
|
11499
|
+
}
|
11500
|
+
|
11501
|
+
// node_modules/@popperjs/core/lib/dom-utils/contains.js
|
11502
|
+
function contains(parent, child) {
|
11503
|
+
var rootNode = child.getRootNode && child.getRootNode();
|
11504
|
+
if (parent.contains(child)) {
|
11505
|
+
return true;
|
11506
|
+
} else if (rootNode && isShadowRoot(rootNode)) {
|
11507
|
+
var next = child;
|
11508
|
+
do {
|
11509
|
+
if (next && parent.isSameNode(next)) {
|
11510
|
+
return true;
|
11511
|
+
}
|
11512
|
+
next = next.parentNode || next.host;
|
11513
|
+
} while (next);
|
11514
|
+
}
|
11515
|
+
return false;
|
11516
|
+
}
|
11517
|
+
|
11518
|
+
// node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js
|
11519
|
+
function getComputedStyle(element) {
|
11520
|
+
return getWindow(element).getComputedStyle(element);
|
11521
|
+
}
|
11522
|
+
|
11523
|
+
// node_modules/@popperjs/core/lib/dom-utils/isTableElement.js
|
11524
|
+
function isTableElement(element) {
|
11525
|
+
return ["table", "td", "th"].indexOf(getNodeName(element)) >= 0;
|
11526
|
+
}
|
11527
|
+
|
11528
|
+
// node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js
|
11529
|
+
function getDocumentElement(element) {
|
11530
|
+
return ((isElement(element) ? element.ownerDocument : element.document) || window.document).documentElement;
|
11531
|
+
}
|
11532
|
+
|
11533
|
+
// node_modules/@popperjs/core/lib/dom-utils/getParentNode.js
|
11534
|
+
function getParentNode(element) {
|
11535
|
+
if (getNodeName(element) === "html") {
|
11536
|
+
return element;
|
11537
|
+
}
|
11538
|
+
return element.assignedSlot || element.parentNode || (isShadowRoot(element) ? element.host : null) || getDocumentElement(element);
|
11539
|
+
}
|
11540
|
+
|
11541
|
+
// node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js
|
11542
|
+
function getTrueOffsetParent(element) {
|
11543
|
+
if (!isHTMLElement(element) || getComputedStyle(element).position === "fixed") {
|
11544
|
+
return null;
|
11545
|
+
}
|
11546
|
+
return element.offsetParent;
|
11547
|
+
}
|
11548
|
+
function getContainingBlock(element) {
|
11549
|
+
var isFirefox = /firefox/i.test(getUAString());
|
11550
|
+
var isIE = /Trident/i.test(getUAString());
|
11551
|
+
if (isIE && isHTMLElement(element)) {
|
11552
|
+
var elementCss = getComputedStyle(element);
|
11553
|
+
if (elementCss.position === "fixed") {
|
11554
|
+
return null;
|
11555
|
+
}
|
11556
|
+
}
|
11557
|
+
var currentNode = getParentNode(element);
|
11558
|
+
if (isShadowRoot(currentNode)) {
|
11559
|
+
currentNode = currentNode.host;
|
11560
|
+
}
|
11561
|
+
while (isHTMLElement(currentNode) && ["html", "body"].indexOf(getNodeName(currentNode)) < 0) {
|
11562
|
+
var css2 = getComputedStyle(currentNode);
|
11563
|
+
if (css2.transform !== "none" || css2.perspective !== "none" || css2.contain === "paint" || ["transform", "perspective"].indexOf(css2.willChange) !== -1 || isFirefox && css2.willChange === "filter" || isFirefox && css2.filter && css2.filter !== "none") {
|
11564
|
+
return currentNode;
|
11565
|
+
} else {
|
11566
|
+
currentNode = currentNode.parentNode;
|
11567
|
+
}
|
11568
|
+
}
|
11569
|
+
return null;
|
11570
|
+
}
|
11571
|
+
function getOffsetParent(element) {
|
11572
|
+
var window2 = getWindow(element);
|
11573
|
+
var offsetParent = getTrueOffsetParent(element);
|
11574
|
+
while (offsetParent && isTableElement(offsetParent) && getComputedStyle(offsetParent).position === "static") {
|
11575
|
+
offsetParent = getTrueOffsetParent(offsetParent);
|
11576
|
+
}
|
11577
|
+
if (offsetParent && (getNodeName(offsetParent) === "html" || getNodeName(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static")) {
|
11578
|
+
return window2;
|
11579
|
+
}
|
11580
|
+
return offsetParent || getContainingBlock(element) || window2;
|
11581
|
+
}
|
11582
|
+
|
11583
|
+
// node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js
|
11584
|
+
function getMainAxisFromPlacement(placement) {
|
11585
|
+
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
|
11586
|
+
}
|
11587
|
+
|
11588
|
+
// node_modules/@popperjs/core/lib/utils/within.js
|
11589
|
+
function within(min2, value, max2) {
|
11590
|
+
return max(min2, min(value, max2));
|
11591
|
+
}
|
11592
|
+
function withinMaxClamp(min2, value, max2) {
|
11593
|
+
var v = within(min2, value, max2);
|
11594
|
+
return v > max2 ? max2 : v;
|
11595
|
+
}
|
11596
|
+
|
11597
|
+
// node_modules/@popperjs/core/lib/utils/getFreshSideObject.js
|
11598
|
+
function getFreshSideObject() {
|
11599
|
+
return {
|
11600
|
+
top: 0,
|
11601
|
+
right: 0,
|
11602
|
+
bottom: 0,
|
11603
|
+
left: 0
|
11604
|
+
};
|
11605
|
+
}
|
11606
|
+
|
11607
|
+
// node_modules/@popperjs/core/lib/utils/mergePaddingObject.js
|
11608
|
+
function mergePaddingObject(paddingObject) {
|
11609
|
+
return Object.assign({}, getFreshSideObject(), paddingObject);
|
11610
|
+
}
|
11611
|
+
|
11612
|
+
// node_modules/@popperjs/core/lib/utils/expandToHashMap.js
|
11613
|
+
function expandToHashMap(value, keys) {
|
11614
|
+
return keys.reduce(function(hashMap, key) {
|
11615
|
+
hashMap[key] = value;
|
11616
|
+
return hashMap;
|
11617
|
+
}, {});
|
11618
|
+
}
|
11619
|
+
|
11620
|
+
// node_modules/@popperjs/core/lib/modifiers/arrow.js
|
11621
|
+
var toPaddingObject = function toPaddingObject2(padding, state) {
|
11622
|
+
padding = typeof padding === "function" ? padding(Object.assign({}, state.rects, {
|
11623
|
+
placement: state.placement
|
11624
|
+
})) : padding;
|
11625
|
+
return mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
11626
|
+
};
|
11627
|
+
function arrow(_ref) {
|
11628
|
+
var _state$modifiersData$;
|
11629
|
+
var state = _ref.state, name = _ref.name, options = _ref.options;
|
11630
|
+
var arrowElement = state.elements.arrow;
|
11631
|
+
var popperOffsets2 = state.modifiersData.popperOffsets;
|
11632
|
+
var basePlacement = getBasePlacement(state.placement);
|
11633
|
+
var axis = getMainAxisFromPlacement(basePlacement);
|
11634
|
+
var isVertical = [left, right].indexOf(basePlacement) >= 0;
|
11635
|
+
var len = isVertical ? "height" : "width";
|
11636
|
+
if (!arrowElement || !popperOffsets2) {
|
11637
|
+
return;
|
11638
|
+
}
|
11639
|
+
var paddingObject = toPaddingObject(options.padding, state);
|
11640
|
+
var arrowRect = getLayoutRect(arrowElement);
|
11641
|
+
var minProp = axis === "y" ? top : left;
|
11642
|
+
var maxProp = axis === "y" ? bottom : right;
|
11643
|
+
var endDiff = state.rects.reference[len] + state.rects.reference[axis] - popperOffsets2[axis] - state.rects.popper[len];
|
11644
|
+
var startDiff = popperOffsets2[axis] - state.rects.reference[axis];
|
11645
|
+
var arrowOffsetParent = getOffsetParent(arrowElement);
|
11646
|
+
var clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
11647
|
+
var centerToReference = endDiff / 2 - startDiff / 2;
|
11648
|
+
var min2 = paddingObject[minProp];
|
11649
|
+
var max2 = clientSize - arrowRect[len] - paddingObject[maxProp];
|
11650
|
+
var center = clientSize / 2 - arrowRect[len] / 2 + centerToReference;
|
11651
|
+
var offset2 = within(min2, center, max2);
|
11652
|
+
var axisProp = axis;
|
11653
|
+
state.modifiersData[name] = (_state$modifiersData$ = {}, _state$modifiersData$[axisProp] = offset2, _state$modifiersData$.centerOffset = offset2 - center, _state$modifiersData$);
|
11654
|
+
}
|
11655
|
+
function effect2(_ref2) {
|
11656
|
+
var state = _ref2.state, options = _ref2.options;
|
11657
|
+
var _options$element = options.element, arrowElement = _options$element === void 0 ? "[data-popper-arrow]" : _options$element;
|
11658
|
+
if (arrowElement == null) {
|
11659
|
+
return;
|
11660
|
+
}
|
11661
|
+
if (typeof arrowElement === "string") {
|
11662
|
+
arrowElement = state.elements.popper.querySelector(arrowElement);
|
11663
|
+
if (!arrowElement) {
|
11664
|
+
return;
|
11665
|
+
}
|
11666
|
+
}
|
11667
|
+
if (true) {
|
11668
|
+
if (!isHTMLElement(arrowElement)) {
|
11669
|
+
console.error(['Popper: "arrow" element must be an HTMLElement (not an SVGElement).', "To use an SVG arrow, wrap it in an HTMLElement that will be used as", "the arrow."].join(" "));
|
11670
|
+
}
|
11671
|
+
}
|
11672
|
+
if (!contains(state.elements.popper, arrowElement)) {
|
11673
|
+
if (true) {
|
11674
|
+
console.error(['Popper: "arrow" modifier\'s `element` must be a child of the popper', "element."].join(" "));
|
11675
|
+
}
|
11676
|
+
return;
|
11677
|
+
}
|
11678
|
+
state.elements.arrow = arrowElement;
|
11679
|
+
}
|
11680
|
+
var arrow_default = {
|
11681
|
+
name: "arrow",
|
11682
|
+
enabled: true,
|
11683
|
+
phase: "main",
|
11684
|
+
fn: arrow,
|
11685
|
+
effect: effect2,
|
11686
|
+
requires: ["popperOffsets"],
|
11687
|
+
requiresIfExists: ["preventOverflow"]
|
11688
|
+
};
|
11689
|
+
|
11690
|
+
// node_modules/@popperjs/core/lib/utils/getVariation.js
|
11691
|
+
function getVariation(placement) {
|
11692
|
+
return placement.split("-")[1];
|
11693
|
+
}
|
11694
|
+
|
11695
|
+
// node_modules/@popperjs/core/lib/modifiers/computeStyles.js
|
11696
|
+
var unsetSides = {
|
11697
|
+
top: "auto",
|
11698
|
+
right: "auto",
|
11699
|
+
bottom: "auto",
|
11700
|
+
left: "auto"
|
11701
|
+
};
|
11702
|
+
function roundOffsetsByDPR(_ref) {
|
11703
|
+
var x = _ref.x, y = _ref.y;
|
11704
|
+
var win = window;
|
11705
|
+
var dpr = win.devicePixelRatio || 1;
|
11706
|
+
return {
|
11707
|
+
x: round(x * dpr) / dpr || 0,
|
11708
|
+
y: round(y * dpr) / dpr || 0
|
11709
|
+
};
|
11710
|
+
}
|
11711
|
+
function mapToStyles(_ref2) {
|
11712
|
+
var _Object$assign2;
|
11713
|
+
var popper2 = _ref2.popper, popperRect = _ref2.popperRect, placement = _ref2.placement, variation = _ref2.variation, offsets = _ref2.offsets, position = _ref2.position, gpuAcceleration = _ref2.gpuAcceleration, adaptive = _ref2.adaptive, roundOffsets = _ref2.roundOffsets, isFixed = _ref2.isFixed;
|
11714
|
+
var _offsets$x = offsets.x, x = _offsets$x === void 0 ? 0 : _offsets$x, _offsets$y = offsets.y, y = _offsets$y === void 0 ? 0 : _offsets$y;
|
11715
|
+
var _ref3 = typeof roundOffsets === "function" ? roundOffsets({
|
11716
|
+
x,
|
11717
|
+
y
|
11718
|
+
}) : {
|
11719
|
+
x,
|
11720
|
+
y
|
11721
|
+
};
|
11722
|
+
x = _ref3.x;
|
11723
|
+
y = _ref3.y;
|
11724
|
+
var hasX = offsets.hasOwnProperty("x");
|
11725
|
+
var hasY = offsets.hasOwnProperty("y");
|
11726
|
+
var sideX = left;
|
11727
|
+
var sideY = top;
|
11728
|
+
var win = window;
|
11729
|
+
if (adaptive) {
|
11730
|
+
var offsetParent = getOffsetParent(popper2);
|
11731
|
+
var heightProp = "clientHeight";
|
11732
|
+
var widthProp = "clientWidth";
|
11733
|
+
if (offsetParent === getWindow(popper2)) {
|
11734
|
+
offsetParent = getDocumentElement(popper2);
|
11735
|
+
if (getComputedStyle(offsetParent).position !== "static" && position === "absolute") {
|
11736
|
+
heightProp = "scrollHeight";
|
11737
|
+
widthProp = "scrollWidth";
|
11738
|
+
}
|
11739
|
+
}
|
11740
|
+
offsetParent = offsetParent;
|
11741
|
+
if (placement === top || (placement === left || placement === right) && variation === end) {
|
11742
|
+
sideY = bottom;
|
11743
|
+
var offsetY = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.height : offsetParent[heightProp];
|
11744
|
+
y -= offsetY - popperRect.height;
|
11745
|
+
y *= gpuAcceleration ? 1 : -1;
|
11746
|
+
}
|
11747
|
+
if (placement === left || (placement === top || placement === bottom) && variation === end) {
|
11748
|
+
sideX = right;
|
11749
|
+
var offsetX = isFixed && offsetParent === win && win.visualViewport ? win.visualViewport.width : offsetParent[widthProp];
|
11750
|
+
x -= offsetX - popperRect.width;
|
11751
|
+
x *= gpuAcceleration ? 1 : -1;
|
11752
|
+
}
|
11753
|
+
}
|
11754
|
+
var commonStyles = Object.assign({
|
11755
|
+
position
|
11756
|
+
}, adaptive && unsetSides);
|
11757
|
+
var _ref4 = roundOffsets === true ? roundOffsetsByDPR({
|
11758
|
+
x,
|
11759
|
+
y
|
11760
|
+
}) : {
|
11761
|
+
x,
|
11762
|
+
y
|
11763
|
+
};
|
11764
|
+
x = _ref4.x;
|
11765
|
+
y = _ref4.y;
|
11766
|
+
if (gpuAcceleration) {
|
11767
|
+
var _Object$assign;
|
11768
|
+
return Object.assign({}, commonStyles, (_Object$assign = {}, _Object$assign[sideY] = hasY ? "0" : "", _Object$assign[sideX] = hasX ? "0" : "", _Object$assign.transform = (win.devicePixelRatio || 1) <= 1 ? "translate(" + x + "px, " + y + "px)" : "translate3d(" + x + "px, " + y + "px, 0)", _Object$assign));
|
11769
|
+
}
|
11770
|
+
return Object.assign({}, commonStyles, (_Object$assign2 = {}, _Object$assign2[sideY] = hasY ? y + "px" : "", _Object$assign2[sideX] = hasX ? x + "px" : "", _Object$assign2.transform = "", _Object$assign2));
|
11771
|
+
}
|
11772
|
+
function computeStyles(_ref5) {
|
11773
|
+
var state = _ref5.state, options = _ref5.options;
|
11774
|
+
var _options$gpuAccelerat = options.gpuAcceleration, gpuAcceleration = _options$gpuAccelerat === void 0 ? true : _options$gpuAccelerat, _options$adaptive = options.adaptive, adaptive = _options$adaptive === void 0 ? true : _options$adaptive, _options$roundOffsets = options.roundOffsets, roundOffsets = _options$roundOffsets === void 0 ? true : _options$roundOffsets;
|
11775
|
+
if (true) {
|
11776
|
+
var transitionProperty = getComputedStyle(state.elements.popper).transitionProperty || "";
|
11777
|
+
if (adaptive && ["transform", "top", "right", "bottom", "left"].some(function(property) {
|
11778
|
+
return transitionProperty.indexOf(property) >= 0;
|
11779
|
+
})) {
|
11780
|
+
console.warn(["Popper: Detected CSS transitions on at least one of the following", 'CSS properties: "transform", "top", "right", "bottom", "left".', "\n\n", 'Disable the "computeStyles" modifier\'s `adaptive` option to allow', "for smooth transitions, or remove these properties from the CSS", "transition declaration on the popper element if only transitioning", "opacity or background-color for example.", "\n\n", "We recommend using the popper element as a wrapper around an inner", "element that can have any CSS property transitioned for animations."].join(" "));
|
11781
|
+
}
|
11782
|
+
}
|
11783
|
+
var commonStyles = {
|
11784
|
+
placement: getBasePlacement(state.placement),
|
11785
|
+
variation: getVariation(state.placement),
|
11786
|
+
popper: state.elements.popper,
|
11787
|
+
popperRect: state.rects.popper,
|
11788
|
+
gpuAcceleration,
|
11789
|
+
isFixed: state.options.strategy === "fixed"
|
11790
|
+
};
|
11791
|
+
if (state.modifiersData.popperOffsets != null) {
|
11792
|
+
state.styles.popper = Object.assign({}, state.styles.popper, mapToStyles(Object.assign({}, commonStyles, {
|
11793
|
+
offsets: state.modifiersData.popperOffsets,
|
11794
|
+
position: state.options.strategy,
|
11795
|
+
adaptive,
|
11796
|
+
roundOffsets
|
11797
|
+
})));
|
11798
|
+
}
|
11799
|
+
if (state.modifiersData.arrow != null) {
|
11800
|
+
state.styles.arrow = Object.assign({}, state.styles.arrow, mapToStyles(Object.assign({}, commonStyles, {
|
11801
|
+
offsets: state.modifiersData.arrow,
|
11802
|
+
position: "absolute",
|
11803
|
+
adaptive: false,
|
11804
|
+
roundOffsets
|
11805
|
+
})));
|
11806
|
+
}
|
11807
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
11808
|
+
"data-popper-placement": state.placement
|
11809
|
+
});
|
11810
|
+
}
|
11811
|
+
var computeStyles_default = {
|
11812
|
+
name: "computeStyles",
|
11813
|
+
enabled: true,
|
11814
|
+
phase: "beforeWrite",
|
11815
|
+
fn: computeStyles,
|
11816
|
+
data: {}
|
11817
|
+
};
|
11818
|
+
|
11819
|
+
// node_modules/@popperjs/core/lib/modifiers/eventListeners.js
|
11820
|
+
var passive = {
|
11821
|
+
passive: true
|
11822
|
+
};
|
11823
|
+
function effect3(_ref) {
|
11824
|
+
var state = _ref.state, instance = _ref.instance, options = _ref.options;
|
11825
|
+
var _options$scroll = options.scroll, scroll = _options$scroll === void 0 ? true : _options$scroll, _options$resize = options.resize, resize = _options$resize === void 0 ? true : _options$resize;
|
11826
|
+
var window2 = getWindow(state.elements.popper);
|
11827
|
+
var scrollParents = [].concat(state.scrollParents.reference, state.scrollParents.popper);
|
11828
|
+
if (scroll) {
|
11829
|
+
scrollParents.forEach(function(scrollParent) {
|
11830
|
+
scrollParent.addEventListener("scroll", instance.update, passive);
|
11831
|
+
});
|
11832
|
+
}
|
11833
|
+
if (resize) {
|
11834
|
+
window2.addEventListener("resize", instance.update, passive);
|
11835
|
+
}
|
11836
|
+
return function() {
|
11837
|
+
if (scroll) {
|
11838
|
+
scrollParents.forEach(function(scrollParent) {
|
11839
|
+
scrollParent.removeEventListener("scroll", instance.update, passive);
|
11840
|
+
});
|
11841
|
+
}
|
11842
|
+
if (resize) {
|
11843
|
+
window2.removeEventListener("resize", instance.update, passive);
|
11844
|
+
}
|
11845
|
+
};
|
11846
|
+
}
|
11847
|
+
var eventListeners_default = {
|
11848
|
+
name: "eventListeners",
|
11849
|
+
enabled: true,
|
11850
|
+
phase: "write",
|
11851
|
+
fn: function fn() {
|
11852
|
+
},
|
11853
|
+
effect: effect3,
|
11854
|
+
data: {}
|
11855
|
+
};
|
11856
|
+
|
11857
|
+
// node_modules/@popperjs/core/lib/utils/getOppositePlacement.js
|
11858
|
+
var hash = {
|
11859
|
+
left: "right",
|
11860
|
+
right: "left",
|
11861
|
+
bottom: "top",
|
11862
|
+
top: "bottom"
|
11863
|
+
};
|
11864
|
+
function getOppositePlacement(placement) {
|
11865
|
+
return placement.replace(/left|right|bottom|top/g, function(matched) {
|
11866
|
+
return hash[matched];
|
11867
|
+
});
|
11868
|
+
}
|
11869
|
+
|
11870
|
+
// node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js
|
11871
|
+
var hash2 = {
|
11872
|
+
start: "end",
|
11873
|
+
end: "start"
|
11874
|
+
};
|
11875
|
+
function getOppositeVariationPlacement(placement) {
|
11876
|
+
return placement.replace(/start|end/g, function(matched) {
|
11877
|
+
return hash2[matched];
|
11878
|
+
});
|
11879
|
+
}
|
11880
|
+
|
11881
|
+
// node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js
|
11882
|
+
function getWindowScroll(node) {
|
11883
|
+
var win = getWindow(node);
|
11884
|
+
var scrollLeft = win.pageXOffset;
|
11885
|
+
var scrollTop = win.pageYOffset;
|
11886
|
+
return {
|
11887
|
+
scrollLeft,
|
11888
|
+
scrollTop
|
11889
|
+
};
|
11890
|
+
}
|
11891
|
+
|
11892
|
+
// node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js
|
11893
|
+
function getWindowScrollBarX(element) {
|
11894
|
+
return getBoundingClientRect(getDocumentElement(element)).left + getWindowScroll(element).scrollLeft;
|
11895
|
+
}
|
11896
|
+
|
11897
|
+
// node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js
|
11898
|
+
function getViewportRect(element, strategy) {
|
11899
|
+
var win = getWindow(element);
|
11900
|
+
var html = getDocumentElement(element);
|
11901
|
+
var visualViewport = win.visualViewport;
|
11902
|
+
var width = html.clientWidth;
|
11903
|
+
var height = html.clientHeight;
|
11904
|
+
var x = 0;
|
11905
|
+
var y = 0;
|
11906
|
+
if (visualViewport) {
|
11907
|
+
width = visualViewport.width;
|
11908
|
+
height = visualViewport.height;
|
11909
|
+
var layoutViewport = isLayoutViewport();
|
11910
|
+
if (layoutViewport || !layoutViewport && strategy === "fixed") {
|
11911
|
+
x = visualViewport.offsetLeft;
|
11912
|
+
y = visualViewport.offsetTop;
|
11913
|
+
}
|
11914
|
+
}
|
11915
|
+
return {
|
11916
|
+
width,
|
11917
|
+
height,
|
11918
|
+
x: x + getWindowScrollBarX(element),
|
11919
|
+
y
|
11920
|
+
};
|
11921
|
+
}
|
11922
|
+
|
11923
|
+
// node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js
|
11924
|
+
function getDocumentRect(element) {
|
11925
|
+
var _element$ownerDocumen;
|
11926
|
+
var html = getDocumentElement(element);
|
11927
|
+
var winScroll = getWindowScroll(element);
|
11928
|
+
var body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
11929
|
+
var width = max(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
11930
|
+
var height = max(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
11931
|
+
var x = -winScroll.scrollLeft + getWindowScrollBarX(element);
|
11932
|
+
var y = -winScroll.scrollTop;
|
11933
|
+
if (getComputedStyle(body || html).direction === "rtl") {
|
11934
|
+
x += max(html.clientWidth, body ? body.clientWidth : 0) - width;
|
11935
|
+
}
|
11936
|
+
return {
|
11937
|
+
width,
|
11938
|
+
height,
|
11939
|
+
x,
|
11940
|
+
y
|
11941
|
+
};
|
11942
|
+
}
|
11943
|
+
|
11944
|
+
// node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js
|
11945
|
+
function isScrollParent(element) {
|
11946
|
+
var _getComputedStyle = getComputedStyle(element), overflow = _getComputedStyle.overflow, overflowX = _getComputedStyle.overflowX, overflowY = _getComputedStyle.overflowY;
|
11947
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
11948
|
+
}
|
11949
|
+
|
11950
|
+
// node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js
|
11951
|
+
function getScrollParent(node) {
|
11952
|
+
if (["html", "body", "#document"].indexOf(getNodeName(node)) >= 0) {
|
11953
|
+
return node.ownerDocument.body;
|
11954
|
+
}
|
11955
|
+
if (isHTMLElement(node) && isScrollParent(node)) {
|
11956
|
+
return node;
|
11957
|
+
}
|
11958
|
+
return getScrollParent(getParentNode(node));
|
11959
|
+
}
|
11960
|
+
|
11961
|
+
// node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js
|
11962
|
+
function listScrollParents(element, list) {
|
11963
|
+
var _element$ownerDocumen;
|
11964
|
+
if (list === void 0) {
|
11965
|
+
list = [];
|
11966
|
+
}
|
11967
|
+
var scrollParent = getScrollParent(element);
|
11968
|
+
var isBody = scrollParent === ((_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body);
|
11969
|
+
var win = getWindow(scrollParent);
|
11970
|
+
var target = isBody ? [win].concat(win.visualViewport || [], isScrollParent(scrollParent) ? scrollParent : []) : scrollParent;
|
11971
|
+
var updatedList = list.concat(target);
|
11972
|
+
return isBody ? updatedList : updatedList.concat(listScrollParents(getParentNode(target)));
|
11973
|
+
}
|
11974
|
+
|
11975
|
+
// node_modules/@popperjs/core/lib/utils/rectToClientRect.js
|
11976
|
+
function rectToClientRect(rect) {
|
11977
|
+
return Object.assign({}, rect, {
|
11978
|
+
left: rect.x,
|
11979
|
+
top: rect.y,
|
11980
|
+
right: rect.x + rect.width,
|
11981
|
+
bottom: rect.y + rect.height
|
11982
|
+
});
|
11983
|
+
}
|
11984
|
+
|
11985
|
+
// node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js
|
11986
|
+
function getInnerBoundingClientRect(element, strategy) {
|
11987
|
+
var rect = getBoundingClientRect(element, false, strategy === "fixed");
|
11988
|
+
rect.top = rect.top + element.clientTop;
|
11989
|
+
rect.left = rect.left + element.clientLeft;
|
11990
|
+
rect.bottom = rect.top + element.clientHeight;
|
11991
|
+
rect.right = rect.left + element.clientWidth;
|
11992
|
+
rect.width = element.clientWidth;
|
11993
|
+
rect.height = element.clientHeight;
|
11994
|
+
rect.x = rect.left;
|
11995
|
+
rect.y = rect.top;
|
11996
|
+
return rect;
|
11997
|
+
}
|
11998
|
+
function getClientRectFromMixedType(element, clippingParent, strategy) {
|
11999
|
+
return clippingParent === viewport ? rectToClientRect(getViewportRect(element, strategy)) : isElement(clippingParent) ? getInnerBoundingClientRect(clippingParent, strategy) : rectToClientRect(getDocumentRect(getDocumentElement(element)));
|
12000
|
+
}
|
12001
|
+
function getClippingParents(element) {
|
12002
|
+
var clippingParents2 = listScrollParents(getParentNode(element));
|
12003
|
+
var canEscapeClipping = ["absolute", "fixed"].indexOf(getComputedStyle(element).position) >= 0;
|
12004
|
+
var clipperElement = canEscapeClipping && isHTMLElement(element) ? getOffsetParent(element) : element;
|
12005
|
+
if (!isElement(clipperElement)) {
|
12006
|
+
return [];
|
12007
|
+
}
|
12008
|
+
return clippingParents2.filter(function(clippingParent) {
|
12009
|
+
return isElement(clippingParent) && contains(clippingParent, clipperElement) && getNodeName(clippingParent) !== "body";
|
12010
|
+
});
|
12011
|
+
}
|
12012
|
+
function getClippingRect(element, boundary, rootBoundary, strategy) {
|
12013
|
+
var mainClippingParents = boundary === "clippingParents" ? getClippingParents(element) : [].concat(boundary);
|
12014
|
+
var clippingParents2 = [].concat(mainClippingParents, [rootBoundary]);
|
12015
|
+
var firstClippingParent = clippingParents2[0];
|
12016
|
+
var clippingRect = clippingParents2.reduce(function(accRect, clippingParent) {
|
12017
|
+
var rect = getClientRectFromMixedType(element, clippingParent, strategy);
|
12018
|
+
accRect.top = max(rect.top, accRect.top);
|
12019
|
+
accRect.right = min(rect.right, accRect.right);
|
12020
|
+
accRect.bottom = min(rect.bottom, accRect.bottom);
|
12021
|
+
accRect.left = max(rect.left, accRect.left);
|
12022
|
+
return accRect;
|
12023
|
+
}, getClientRectFromMixedType(element, firstClippingParent, strategy));
|
12024
|
+
clippingRect.width = clippingRect.right - clippingRect.left;
|
12025
|
+
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
12026
|
+
clippingRect.x = clippingRect.left;
|
12027
|
+
clippingRect.y = clippingRect.top;
|
12028
|
+
return clippingRect;
|
12029
|
+
}
|
12030
|
+
|
12031
|
+
// node_modules/@popperjs/core/lib/utils/computeOffsets.js
|
12032
|
+
function computeOffsets(_ref) {
|
12033
|
+
var reference2 = _ref.reference, element = _ref.element, placement = _ref.placement;
|
12034
|
+
var basePlacement = placement ? getBasePlacement(placement) : null;
|
12035
|
+
var variation = placement ? getVariation(placement) : null;
|
12036
|
+
var commonX = reference2.x + reference2.width / 2 - element.width / 2;
|
12037
|
+
var commonY = reference2.y + reference2.height / 2 - element.height / 2;
|
12038
|
+
var offsets;
|
12039
|
+
switch (basePlacement) {
|
12040
|
+
case top:
|
12041
|
+
offsets = {
|
12042
|
+
x: commonX,
|
12043
|
+
y: reference2.y - element.height
|
12044
|
+
};
|
12045
|
+
break;
|
12046
|
+
case bottom:
|
12047
|
+
offsets = {
|
12048
|
+
x: commonX,
|
12049
|
+
y: reference2.y + reference2.height
|
12050
|
+
};
|
12051
|
+
break;
|
12052
|
+
case right:
|
12053
|
+
offsets = {
|
12054
|
+
x: reference2.x + reference2.width,
|
12055
|
+
y: commonY
|
12056
|
+
};
|
12057
|
+
break;
|
12058
|
+
case left:
|
12059
|
+
offsets = {
|
12060
|
+
x: reference2.x - element.width,
|
12061
|
+
y: commonY
|
12062
|
+
};
|
12063
|
+
break;
|
12064
|
+
default:
|
12065
|
+
offsets = {
|
12066
|
+
x: reference2.x,
|
12067
|
+
y: reference2.y
|
12068
|
+
};
|
12069
|
+
}
|
12070
|
+
var mainAxis = basePlacement ? getMainAxisFromPlacement(basePlacement) : null;
|
12071
|
+
if (mainAxis != null) {
|
12072
|
+
var len = mainAxis === "y" ? "height" : "width";
|
12073
|
+
switch (variation) {
|
12074
|
+
case start:
|
12075
|
+
offsets[mainAxis] = offsets[mainAxis] - (reference2[len] / 2 - element[len] / 2);
|
12076
|
+
break;
|
12077
|
+
case end:
|
12078
|
+
offsets[mainAxis] = offsets[mainAxis] + (reference2[len] / 2 - element[len] / 2);
|
12079
|
+
break;
|
12080
|
+
default:
|
12081
|
+
}
|
12082
|
+
}
|
12083
|
+
return offsets;
|
12084
|
+
}
|
12085
|
+
|
12086
|
+
// node_modules/@popperjs/core/lib/utils/detectOverflow.js
|
12087
|
+
function detectOverflow(state, options) {
|
12088
|
+
if (options === void 0) {
|
12089
|
+
options = {};
|
12090
|
+
}
|
12091
|
+
var _options = options, _options$placement = _options.placement, placement = _options$placement === void 0 ? state.placement : _options$placement, _options$strategy = _options.strategy, strategy = _options$strategy === void 0 ? state.strategy : _options$strategy, _options$boundary = _options.boundary, boundary = _options$boundary === void 0 ? clippingParents : _options$boundary, _options$rootBoundary = _options.rootBoundary, rootBoundary = _options$rootBoundary === void 0 ? viewport : _options$rootBoundary, _options$elementConte = _options.elementContext, elementContext = _options$elementConte === void 0 ? popper : _options$elementConte, _options$altBoundary = _options.altBoundary, altBoundary = _options$altBoundary === void 0 ? false : _options$altBoundary, _options$padding = _options.padding, padding = _options$padding === void 0 ? 0 : _options$padding;
|
12092
|
+
var paddingObject = mergePaddingObject(typeof padding !== "number" ? padding : expandToHashMap(padding, basePlacements));
|
12093
|
+
var altContext = elementContext === popper ? reference : popper;
|
12094
|
+
var popperRect = state.rects.popper;
|
12095
|
+
var element = state.elements[altBoundary ? altContext : elementContext];
|
12096
|
+
var clippingClientRect = getClippingRect(isElement(element) ? element : element.contextElement || getDocumentElement(state.elements.popper), boundary, rootBoundary, strategy);
|
12097
|
+
var referenceClientRect = getBoundingClientRect(state.elements.reference);
|
12098
|
+
var popperOffsets2 = computeOffsets({
|
12099
|
+
reference: referenceClientRect,
|
12100
|
+
element: popperRect,
|
12101
|
+
strategy: "absolute",
|
12102
|
+
placement
|
12103
|
+
});
|
12104
|
+
var popperClientRect = rectToClientRect(Object.assign({}, popperRect, popperOffsets2));
|
12105
|
+
var elementClientRect = elementContext === popper ? popperClientRect : referenceClientRect;
|
12106
|
+
var overflowOffsets = {
|
12107
|
+
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
12108
|
+
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
12109
|
+
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
12110
|
+
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
12111
|
+
};
|
12112
|
+
var offsetData = state.modifiersData.offset;
|
12113
|
+
if (elementContext === popper && offsetData) {
|
12114
|
+
var offset2 = offsetData[placement];
|
12115
|
+
Object.keys(overflowOffsets).forEach(function(key) {
|
12116
|
+
var multiply = [right, bottom].indexOf(key) >= 0 ? 1 : -1;
|
12117
|
+
var axis = [top, bottom].indexOf(key) >= 0 ? "y" : "x";
|
12118
|
+
overflowOffsets[key] += offset2[axis] * multiply;
|
12119
|
+
});
|
12120
|
+
}
|
12121
|
+
return overflowOffsets;
|
12122
|
+
}
|
12123
|
+
|
12124
|
+
// node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js
|
12125
|
+
function computeAutoPlacement(state, options) {
|
12126
|
+
if (options === void 0) {
|
12127
|
+
options = {};
|
12128
|
+
}
|
12129
|
+
var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
|
12130
|
+
var variation = getVariation(placement);
|
12131
|
+
var placements2 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
|
12132
|
+
return getVariation(placement2) === variation;
|
12133
|
+
}) : basePlacements;
|
12134
|
+
var allowedPlacements = placements2.filter(function(placement2) {
|
12135
|
+
return allowedAutoPlacements.indexOf(placement2) >= 0;
|
12136
|
+
});
|
12137
|
+
if (allowedPlacements.length === 0) {
|
12138
|
+
allowedPlacements = placements2;
|
12139
|
+
if (true) {
|
12140
|
+
console.error(["Popper: The `allowedAutoPlacements` option did not allow any", "placements. Ensure the `placement` option matches the variation", "of the allowed placements.", 'For example, "auto" cannot be used to allow "bottom-start".', 'Use "auto-start" instead.'].join(" "));
|
12141
|
+
}
|
12142
|
+
}
|
12143
|
+
var overflows = allowedPlacements.reduce(function(acc, placement2) {
|
12144
|
+
acc[placement2] = detectOverflow(state, {
|
12145
|
+
placement: placement2,
|
12146
|
+
boundary,
|
12147
|
+
rootBoundary,
|
12148
|
+
padding
|
12149
|
+
})[getBasePlacement(placement2)];
|
12150
|
+
return acc;
|
12151
|
+
}, {});
|
12152
|
+
return Object.keys(overflows).sort(function(a, b) {
|
12153
|
+
return overflows[a] - overflows[b];
|
12154
|
+
});
|
12155
|
+
}
|
12156
|
+
|
12157
|
+
// node_modules/@popperjs/core/lib/modifiers/flip.js
|
12158
|
+
function getExpandedFallbackPlacements(placement) {
|
12159
|
+
if (getBasePlacement(placement) === auto) {
|
12160
|
+
return [];
|
12161
|
+
}
|
12162
|
+
var oppositePlacement = getOppositePlacement(placement);
|
12163
|
+
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
12164
|
+
}
|
12165
|
+
function flip(_ref) {
|
12166
|
+
var state = _ref.state, options = _ref.options, name = _ref.name;
|
12167
|
+
if (state.modifiersData[name]._skip) {
|
12168
|
+
return;
|
12169
|
+
}
|
12170
|
+
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? true : _options$altAxis, specifiedFallbackPlacements = options.fallbackPlacements, padding = options.padding, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, _options$flipVariatio = options.flipVariations, flipVariations = _options$flipVariatio === void 0 ? true : _options$flipVariatio, allowedAutoPlacements = options.allowedAutoPlacements;
|
12171
|
+
var preferredPlacement = state.options.placement;
|
12172
|
+
var basePlacement = getBasePlacement(preferredPlacement);
|
12173
|
+
var isBasePlacement = basePlacement === preferredPlacement;
|
12174
|
+
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
12175
|
+
var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
|
12176
|
+
return acc.concat(getBasePlacement(placement2) === auto ? computeAutoPlacement(state, {
|
12177
|
+
placement: placement2,
|
12178
|
+
boundary,
|
12179
|
+
rootBoundary,
|
12180
|
+
padding,
|
12181
|
+
flipVariations,
|
12182
|
+
allowedAutoPlacements
|
12183
|
+
}) : placement2);
|
12184
|
+
}, []);
|
12185
|
+
var referenceRect = state.rects.reference;
|
12186
|
+
var popperRect = state.rects.popper;
|
12187
|
+
var checksMap = /* @__PURE__ */ new Map();
|
12188
|
+
var makeFallbackChecks = true;
|
12189
|
+
var firstFittingPlacement = placements2[0];
|
12190
|
+
for (var i = 0; i < placements2.length; i++) {
|
12191
|
+
var placement = placements2[i];
|
12192
|
+
var _basePlacement = getBasePlacement(placement);
|
12193
|
+
var isStartVariation = getVariation(placement) === start;
|
12194
|
+
var isVertical = [top, bottom].indexOf(_basePlacement) >= 0;
|
12195
|
+
var len = isVertical ? "width" : "height";
|
12196
|
+
var overflow = detectOverflow(state, {
|
12197
|
+
placement,
|
12198
|
+
boundary,
|
12199
|
+
rootBoundary,
|
12200
|
+
altBoundary,
|
12201
|
+
padding
|
12202
|
+
});
|
12203
|
+
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
12204
|
+
if (referenceRect[len] > popperRect[len]) {
|
12205
|
+
mainVariationSide = getOppositePlacement(mainVariationSide);
|
12206
|
+
}
|
12207
|
+
var altVariationSide = getOppositePlacement(mainVariationSide);
|
12208
|
+
var checks = [];
|
12209
|
+
if (checkMainAxis) {
|
12210
|
+
checks.push(overflow[_basePlacement] <= 0);
|
12211
|
+
}
|
12212
|
+
if (checkAltAxis) {
|
12213
|
+
checks.push(overflow[mainVariationSide] <= 0, overflow[altVariationSide] <= 0);
|
12214
|
+
}
|
12215
|
+
if (checks.every(function(check) {
|
12216
|
+
return check;
|
12217
|
+
})) {
|
12218
|
+
firstFittingPlacement = placement;
|
12219
|
+
makeFallbackChecks = false;
|
12220
|
+
break;
|
12221
|
+
}
|
12222
|
+
checksMap.set(placement, checks);
|
12223
|
+
}
|
12224
|
+
if (makeFallbackChecks) {
|
12225
|
+
var numberOfChecks = flipVariations ? 3 : 1;
|
12226
|
+
var _loop = function _loop2(_i2) {
|
12227
|
+
var fittingPlacement = placements2.find(function(placement2) {
|
12228
|
+
var checks2 = checksMap.get(placement2);
|
12229
|
+
if (checks2) {
|
12230
|
+
return checks2.slice(0, _i2).every(function(check) {
|
12231
|
+
return check;
|
12232
|
+
});
|
12233
|
+
}
|
12234
|
+
});
|
12235
|
+
if (fittingPlacement) {
|
12236
|
+
firstFittingPlacement = fittingPlacement;
|
12237
|
+
return "break";
|
12238
|
+
}
|
12239
|
+
};
|
12240
|
+
for (var _i = numberOfChecks; _i > 0; _i--) {
|
12241
|
+
var _ret = _loop(_i);
|
12242
|
+
if (_ret === "break")
|
12243
|
+
break;
|
12244
|
+
}
|
12245
|
+
}
|
12246
|
+
if (state.placement !== firstFittingPlacement) {
|
12247
|
+
state.modifiersData[name]._skip = true;
|
12248
|
+
state.placement = firstFittingPlacement;
|
12249
|
+
state.reset = true;
|
12250
|
+
}
|
12251
|
+
}
|
12252
|
+
var flip_default = {
|
12253
|
+
name: "flip",
|
12254
|
+
enabled: true,
|
12255
|
+
phase: "main",
|
12256
|
+
fn: flip,
|
12257
|
+
requiresIfExists: ["offset"],
|
12258
|
+
data: {
|
12259
|
+
_skip: false
|
12260
|
+
}
|
12261
|
+
};
|
12262
|
+
|
12263
|
+
// node_modules/@popperjs/core/lib/modifiers/hide.js
|
12264
|
+
function getSideOffsets(overflow, rect, preventedOffsets) {
|
12265
|
+
if (preventedOffsets === void 0) {
|
12266
|
+
preventedOffsets = {
|
12267
|
+
x: 0,
|
12268
|
+
y: 0
|
12269
|
+
};
|
12270
|
+
}
|
12271
|
+
return {
|
12272
|
+
top: overflow.top - rect.height - preventedOffsets.y,
|
12273
|
+
right: overflow.right - rect.width + preventedOffsets.x,
|
12274
|
+
bottom: overflow.bottom - rect.height + preventedOffsets.y,
|
12275
|
+
left: overflow.left - rect.width - preventedOffsets.x
|
12276
|
+
};
|
12277
|
+
}
|
12278
|
+
function isAnySideFullyClipped(overflow) {
|
12279
|
+
return [top, right, bottom, left].some(function(side) {
|
12280
|
+
return overflow[side] >= 0;
|
12281
|
+
});
|
12282
|
+
}
|
12283
|
+
function hide(_ref) {
|
12284
|
+
var state = _ref.state, name = _ref.name;
|
12285
|
+
var referenceRect = state.rects.reference;
|
12286
|
+
var popperRect = state.rects.popper;
|
12287
|
+
var preventedOffsets = state.modifiersData.preventOverflow;
|
12288
|
+
var referenceOverflow = detectOverflow(state, {
|
12289
|
+
elementContext: "reference"
|
12290
|
+
});
|
12291
|
+
var popperAltOverflow = detectOverflow(state, {
|
12292
|
+
altBoundary: true
|
12293
|
+
});
|
12294
|
+
var referenceClippingOffsets = getSideOffsets(referenceOverflow, referenceRect);
|
12295
|
+
var popperEscapeOffsets = getSideOffsets(popperAltOverflow, popperRect, preventedOffsets);
|
12296
|
+
var isReferenceHidden = isAnySideFullyClipped(referenceClippingOffsets);
|
12297
|
+
var hasPopperEscaped = isAnySideFullyClipped(popperEscapeOffsets);
|
12298
|
+
state.modifiersData[name] = {
|
12299
|
+
referenceClippingOffsets,
|
12300
|
+
popperEscapeOffsets,
|
12301
|
+
isReferenceHidden,
|
12302
|
+
hasPopperEscaped
|
12303
|
+
};
|
12304
|
+
state.attributes.popper = Object.assign({}, state.attributes.popper, {
|
12305
|
+
"data-popper-reference-hidden": isReferenceHidden,
|
12306
|
+
"data-popper-escaped": hasPopperEscaped
|
12307
|
+
});
|
12308
|
+
}
|
12309
|
+
var hide_default = {
|
12310
|
+
name: "hide",
|
12311
|
+
enabled: true,
|
12312
|
+
phase: "main",
|
12313
|
+
requiresIfExists: ["preventOverflow"],
|
12314
|
+
fn: hide
|
12315
|
+
};
|
12316
|
+
|
12317
|
+
// node_modules/@popperjs/core/lib/modifiers/offset.js
|
12318
|
+
function distanceAndSkiddingToXY(placement, rects, offset2) {
|
12319
|
+
var basePlacement = getBasePlacement(placement);
|
12320
|
+
var invertDistance = [left, top].indexOf(basePlacement) >= 0 ? -1 : 1;
|
12321
|
+
var _ref = typeof offset2 === "function" ? offset2(Object.assign({}, rects, {
|
12322
|
+
placement
|
12323
|
+
})) : offset2, skidding = _ref[0], distance = _ref[1];
|
12324
|
+
skidding = skidding || 0;
|
12325
|
+
distance = (distance || 0) * invertDistance;
|
12326
|
+
return [left, right].indexOf(basePlacement) >= 0 ? {
|
12327
|
+
x: distance,
|
12328
|
+
y: skidding
|
12329
|
+
} : {
|
12330
|
+
x: skidding,
|
12331
|
+
y: distance
|
12332
|
+
};
|
12333
|
+
}
|
12334
|
+
function offset(_ref2) {
|
12335
|
+
var state = _ref2.state, options = _ref2.options, name = _ref2.name;
|
12336
|
+
var _options$offset = options.offset, offset2 = _options$offset === void 0 ? [0, 0] : _options$offset;
|
12337
|
+
var data = placements.reduce(function(acc, placement) {
|
12338
|
+
acc[placement] = distanceAndSkiddingToXY(placement, state.rects, offset2);
|
12339
|
+
return acc;
|
12340
|
+
}, {});
|
12341
|
+
var _data$state$placement = data[state.placement], x = _data$state$placement.x, y = _data$state$placement.y;
|
12342
|
+
if (state.modifiersData.popperOffsets != null) {
|
12343
|
+
state.modifiersData.popperOffsets.x += x;
|
12344
|
+
state.modifiersData.popperOffsets.y += y;
|
12345
|
+
}
|
12346
|
+
state.modifiersData[name] = data;
|
12347
|
+
}
|
12348
|
+
var offset_default = {
|
12349
|
+
name: "offset",
|
12350
|
+
enabled: true,
|
12351
|
+
phase: "main",
|
12352
|
+
requires: ["popperOffsets"],
|
12353
|
+
fn: offset
|
12354
|
+
};
|
12355
|
+
|
12356
|
+
// node_modules/@popperjs/core/lib/modifiers/popperOffsets.js
|
12357
|
+
function popperOffsets(_ref) {
|
12358
|
+
var state = _ref.state, name = _ref.name;
|
12359
|
+
state.modifiersData[name] = computeOffsets({
|
12360
|
+
reference: state.rects.reference,
|
12361
|
+
element: state.rects.popper,
|
12362
|
+
strategy: "absolute",
|
12363
|
+
placement: state.placement
|
12364
|
+
});
|
12365
|
+
}
|
12366
|
+
var popperOffsets_default = {
|
12367
|
+
name: "popperOffsets",
|
12368
|
+
enabled: true,
|
12369
|
+
phase: "read",
|
12370
|
+
fn: popperOffsets,
|
12371
|
+
data: {}
|
12372
|
+
};
|
12373
|
+
|
12374
|
+
// node_modules/@popperjs/core/lib/utils/getAltAxis.js
|
12375
|
+
function getAltAxis(axis) {
|
12376
|
+
return axis === "x" ? "y" : "x";
|
12377
|
+
}
|
12378
|
+
|
12379
|
+
// node_modules/@popperjs/core/lib/modifiers/preventOverflow.js
|
12380
|
+
function preventOverflow(_ref) {
|
12381
|
+
var state = _ref.state, options = _ref.options, name = _ref.name;
|
12382
|
+
var _options$mainAxis = options.mainAxis, checkMainAxis = _options$mainAxis === void 0 ? true : _options$mainAxis, _options$altAxis = options.altAxis, checkAltAxis = _options$altAxis === void 0 ? false : _options$altAxis, boundary = options.boundary, rootBoundary = options.rootBoundary, altBoundary = options.altBoundary, padding = options.padding, _options$tether = options.tether, tether = _options$tether === void 0 ? true : _options$tether, _options$tetherOffset = options.tetherOffset, tetherOffset = _options$tetherOffset === void 0 ? 0 : _options$tetherOffset;
|
12383
|
+
var overflow = detectOverflow(state, {
|
12384
|
+
boundary,
|
12385
|
+
rootBoundary,
|
12386
|
+
padding,
|
12387
|
+
altBoundary
|
12388
|
+
});
|
12389
|
+
var basePlacement = getBasePlacement(state.placement);
|
12390
|
+
var variation = getVariation(state.placement);
|
12391
|
+
var isBasePlacement = !variation;
|
12392
|
+
var mainAxis = getMainAxisFromPlacement(basePlacement);
|
12393
|
+
var altAxis = getAltAxis(mainAxis);
|
12394
|
+
var popperOffsets2 = state.modifiersData.popperOffsets;
|
12395
|
+
var referenceRect = state.rects.reference;
|
12396
|
+
var popperRect = state.rects.popper;
|
12397
|
+
var tetherOffsetValue = typeof tetherOffset === "function" ? tetherOffset(Object.assign({}, state.rects, {
|
12398
|
+
placement: state.placement
|
12399
|
+
})) : tetherOffset;
|
12400
|
+
var normalizedTetherOffsetValue = typeof tetherOffsetValue === "number" ? {
|
12401
|
+
mainAxis: tetherOffsetValue,
|
12402
|
+
altAxis: tetherOffsetValue
|
12403
|
+
} : Object.assign({
|
12404
|
+
mainAxis: 0,
|
12405
|
+
altAxis: 0
|
12406
|
+
}, tetherOffsetValue);
|
12407
|
+
var offsetModifierState = state.modifiersData.offset ? state.modifiersData.offset[state.placement] : null;
|
12408
|
+
var data = {
|
12409
|
+
x: 0,
|
12410
|
+
y: 0
|
12411
|
+
};
|
12412
|
+
if (!popperOffsets2) {
|
12413
|
+
return;
|
12414
|
+
}
|
12415
|
+
if (checkMainAxis) {
|
12416
|
+
var _offsetModifierState$;
|
12417
|
+
var mainSide = mainAxis === "y" ? top : left;
|
12418
|
+
var altSide = mainAxis === "y" ? bottom : right;
|
12419
|
+
var len = mainAxis === "y" ? "height" : "width";
|
12420
|
+
var offset2 = popperOffsets2[mainAxis];
|
12421
|
+
var min2 = offset2 + overflow[mainSide];
|
12422
|
+
var max2 = offset2 - overflow[altSide];
|
12423
|
+
var additive = tether ? -popperRect[len] / 2 : 0;
|
12424
|
+
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
12425
|
+
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
12426
|
+
var arrowElement = state.elements.arrow;
|
12427
|
+
var arrowRect = tether && arrowElement ? getLayoutRect(arrowElement) : {
|
12428
|
+
width: 0,
|
12429
|
+
height: 0
|
12430
|
+
};
|
12431
|
+
var arrowPaddingObject = state.modifiersData["arrow#persistent"] ? state.modifiersData["arrow#persistent"].padding : getFreshSideObject();
|
12432
|
+
var arrowPaddingMin = arrowPaddingObject[mainSide];
|
12433
|
+
var arrowPaddingMax = arrowPaddingObject[altSide];
|
12434
|
+
var arrowLen = within(0, referenceRect[len], arrowRect[len]);
|
12435
|
+
var minOffset = isBasePlacement ? referenceRect[len] / 2 - additive - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis : minLen - arrowLen - arrowPaddingMin - normalizedTetherOffsetValue.mainAxis;
|
12436
|
+
var maxOffset = isBasePlacement ? -referenceRect[len] / 2 + additive + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis : maxLen + arrowLen + arrowPaddingMax + normalizedTetherOffsetValue.mainAxis;
|
12437
|
+
var arrowOffsetParent = state.elements.arrow && getOffsetParent(state.elements.arrow);
|
12438
|
+
var clientOffset = arrowOffsetParent ? mainAxis === "y" ? arrowOffsetParent.clientTop || 0 : arrowOffsetParent.clientLeft || 0 : 0;
|
12439
|
+
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
12440
|
+
var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
|
12441
|
+
var tetherMax = offset2 + maxOffset - offsetModifierValue;
|
12442
|
+
var preventedOffset = within(tether ? min(min2, tetherMin) : min2, offset2, tether ? max(max2, tetherMax) : max2);
|
12443
|
+
popperOffsets2[mainAxis] = preventedOffset;
|
12444
|
+
data[mainAxis] = preventedOffset - offset2;
|
12445
|
+
}
|
12446
|
+
if (checkAltAxis) {
|
12447
|
+
var _offsetModifierState$2;
|
12448
|
+
var _mainSide = mainAxis === "x" ? top : left;
|
12449
|
+
var _altSide = mainAxis === "x" ? bottom : right;
|
12450
|
+
var _offset = popperOffsets2[altAxis];
|
12451
|
+
var _len = altAxis === "y" ? "height" : "width";
|
12452
|
+
var _min = _offset + overflow[_mainSide];
|
12453
|
+
var _max = _offset - overflow[_altSide];
|
12454
|
+
var isOriginSide = [top, left].indexOf(basePlacement) !== -1;
|
12455
|
+
var _offsetModifierValue = (_offsetModifierState$2 = offsetModifierState == null ? void 0 : offsetModifierState[altAxis]) != null ? _offsetModifierState$2 : 0;
|
12456
|
+
var _tetherMin = isOriginSide ? _min : _offset - referenceRect[_len] - popperRect[_len] - _offsetModifierValue + normalizedTetherOffsetValue.altAxis;
|
12457
|
+
var _tetherMax = isOriginSide ? _offset + referenceRect[_len] + popperRect[_len] - _offsetModifierValue - normalizedTetherOffsetValue.altAxis : _max;
|
12458
|
+
var _preventedOffset = tether && isOriginSide ? withinMaxClamp(_tetherMin, _offset, _tetherMax) : within(tether ? _tetherMin : _min, _offset, tether ? _tetherMax : _max);
|
12459
|
+
popperOffsets2[altAxis] = _preventedOffset;
|
12460
|
+
data[altAxis] = _preventedOffset - _offset;
|
12461
|
+
}
|
12462
|
+
state.modifiersData[name] = data;
|
12463
|
+
}
|
12464
|
+
var preventOverflow_default = {
|
12465
|
+
name: "preventOverflow",
|
12466
|
+
enabled: true,
|
12467
|
+
phase: "main",
|
12468
|
+
fn: preventOverflow,
|
12469
|
+
requiresIfExists: ["offset"]
|
12470
|
+
};
|
12471
|
+
|
12472
|
+
// node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js
|
12473
|
+
function getHTMLElementScroll(element) {
|
12474
|
+
return {
|
12475
|
+
scrollLeft: element.scrollLeft,
|
12476
|
+
scrollTop: element.scrollTop
|
12477
|
+
};
|
12478
|
+
}
|
12479
|
+
|
12480
|
+
// node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js
|
12481
|
+
function getNodeScroll(node) {
|
12482
|
+
if (node === getWindow(node) || !isHTMLElement(node)) {
|
12483
|
+
return getWindowScroll(node);
|
12484
|
+
} else {
|
12485
|
+
return getHTMLElementScroll(node);
|
12486
|
+
}
|
12487
|
+
}
|
12488
|
+
|
12489
|
+
// node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js
|
12490
|
+
function isElementScaled(element) {
|
12491
|
+
var rect = element.getBoundingClientRect();
|
12492
|
+
var scaleX = round(rect.width) / element.offsetWidth || 1;
|
12493
|
+
var scaleY = round(rect.height) / element.offsetHeight || 1;
|
12494
|
+
return scaleX !== 1 || scaleY !== 1;
|
12495
|
+
}
|
12496
|
+
function getCompositeRect(elementOrVirtualElement, offsetParent, isFixed) {
|
12497
|
+
if (isFixed === void 0) {
|
12498
|
+
isFixed = false;
|
12499
|
+
}
|
12500
|
+
var isOffsetParentAnElement = isHTMLElement(offsetParent);
|
12501
|
+
var offsetParentIsScaled = isHTMLElement(offsetParent) && isElementScaled(offsetParent);
|
12502
|
+
var documentElement = getDocumentElement(offsetParent);
|
12503
|
+
var rect = getBoundingClientRect(elementOrVirtualElement, offsetParentIsScaled, isFixed);
|
12504
|
+
var scroll = {
|
12505
|
+
scrollLeft: 0,
|
12506
|
+
scrollTop: 0
|
12507
|
+
};
|
12508
|
+
var offsets = {
|
12509
|
+
x: 0,
|
12510
|
+
y: 0
|
12511
|
+
};
|
12512
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {
|
12513
|
+
if (getNodeName(offsetParent) !== "body" || isScrollParent(documentElement)) {
|
12514
|
+
scroll = getNodeScroll(offsetParent);
|
12515
|
+
}
|
12516
|
+
if (isHTMLElement(offsetParent)) {
|
12517
|
+
offsets = getBoundingClientRect(offsetParent, true);
|
12518
|
+
offsets.x += offsetParent.clientLeft;
|
12519
|
+
offsets.y += offsetParent.clientTop;
|
12520
|
+
} else if (documentElement) {
|
12521
|
+
offsets.x = getWindowScrollBarX(documentElement);
|
12522
|
+
}
|
12523
|
+
}
|
12524
|
+
return {
|
12525
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
12526
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
12527
|
+
width: rect.width,
|
12528
|
+
height: rect.height
|
12529
|
+
};
|
12530
|
+
}
|
12531
|
+
|
12532
|
+
// node_modules/@popperjs/core/lib/utils/orderModifiers.js
|
12533
|
+
function order(modifiers) {
|
12534
|
+
var map = /* @__PURE__ */ new Map();
|
12535
|
+
var visited = /* @__PURE__ */ new Set();
|
12536
|
+
var result = [];
|
12537
|
+
modifiers.forEach(function(modifier) {
|
12538
|
+
map.set(modifier.name, modifier);
|
12539
|
+
});
|
12540
|
+
function sort2(modifier) {
|
12541
|
+
visited.add(modifier.name);
|
12542
|
+
var requires = [].concat(modifier.requires || [], modifier.requiresIfExists || []);
|
12543
|
+
requires.forEach(function(dep) {
|
12544
|
+
if (!visited.has(dep)) {
|
12545
|
+
var depModifier = map.get(dep);
|
12546
|
+
if (depModifier) {
|
12547
|
+
sort2(depModifier);
|
12548
|
+
}
|
12549
|
+
}
|
12550
|
+
});
|
12551
|
+
result.push(modifier);
|
12552
|
+
}
|
12553
|
+
modifiers.forEach(function(modifier) {
|
12554
|
+
if (!visited.has(modifier.name)) {
|
12555
|
+
sort2(modifier);
|
12556
|
+
}
|
12557
|
+
});
|
12558
|
+
return result;
|
12559
|
+
}
|
12560
|
+
function orderModifiers(modifiers) {
|
12561
|
+
var orderedModifiers = order(modifiers);
|
12562
|
+
return modifierPhases.reduce(function(acc, phase) {
|
12563
|
+
return acc.concat(orderedModifiers.filter(function(modifier) {
|
12564
|
+
return modifier.phase === phase;
|
12565
|
+
}));
|
12566
|
+
}, []);
|
12567
|
+
}
|
12568
|
+
|
12569
|
+
// node_modules/@popperjs/core/lib/utils/debounce.js
|
12570
|
+
function debounce2(fn2) {
|
12571
|
+
var pending;
|
12572
|
+
return function() {
|
12573
|
+
if (!pending) {
|
12574
|
+
pending = new Promise(function(resolve) {
|
12575
|
+
Promise.resolve().then(function() {
|
12576
|
+
pending = void 0;
|
12577
|
+
resolve(fn2());
|
12578
|
+
});
|
12579
|
+
});
|
12580
|
+
}
|
12581
|
+
return pending;
|
12582
|
+
};
|
12583
|
+
}
|
12584
|
+
|
12585
|
+
// node_modules/@popperjs/core/lib/utils/format.js
|
12586
|
+
function format(str) {
|
12587
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
12588
|
+
args[_key - 1] = arguments[_key];
|
12589
|
+
}
|
12590
|
+
return [].concat(args).reduce(function(p, c) {
|
12591
|
+
return p.replace(/%s/, c);
|
12592
|
+
}, str);
|
12593
|
+
}
|
12594
|
+
|
12595
|
+
// node_modules/@popperjs/core/lib/utils/validateModifiers.js
|
12596
|
+
var INVALID_MODIFIER_ERROR = 'Popper: modifier "%s" provided an invalid %s property, expected %s but got %s';
|
12597
|
+
var MISSING_DEPENDENCY_ERROR = 'Popper: modifier "%s" requires "%s", but "%s" modifier is not available';
|
12598
|
+
var VALID_PROPERTIES = ["name", "enabled", "phase", "fn", "effect", "requires", "options"];
|
12599
|
+
function validateModifiers(modifiers) {
|
12600
|
+
modifiers.forEach(function(modifier) {
|
12601
|
+
[].concat(Object.keys(modifier), VALID_PROPERTIES).filter(function(value, index2, self2) {
|
12602
|
+
return self2.indexOf(value) === index2;
|
12603
|
+
}).forEach(function(key) {
|
12604
|
+
switch (key) {
|
12605
|
+
case "name":
|
12606
|
+
if (typeof modifier.name !== "string") {
|
12607
|
+
console.error(format(INVALID_MODIFIER_ERROR, String(modifier.name), '"name"', '"string"', '"' + String(modifier.name) + '"'));
|
12608
|
+
}
|
12609
|
+
break;
|
12610
|
+
case "enabled":
|
12611
|
+
if (typeof modifier.enabled !== "boolean") {
|
12612
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"enabled"', '"boolean"', '"' + String(modifier.enabled) + '"'));
|
12613
|
+
}
|
12614
|
+
break;
|
12615
|
+
case "phase":
|
12616
|
+
if (modifierPhases.indexOf(modifier.phase) < 0) {
|
12617
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"phase"', "either " + modifierPhases.join(", "), '"' + String(modifier.phase) + '"'));
|
12618
|
+
}
|
12619
|
+
break;
|
12620
|
+
case "fn":
|
12621
|
+
if (typeof modifier.fn !== "function") {
|
12622
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"fn"', '"function"', '"' + String(modifier.fn) + '"'));
|
12623
|
+
}
|
12624
|
+
break;
|
12625
|
+
case "effect":
|
12626
|
+
if (modifier.effect != null && typeof modifier.effect !== "function") {
|
12627
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"effect"', '"function"', '"' + String(modifier.fn) + '"'));
|
12628
|
+
}
|
12629
|
+
break;
|
12630
|
+
case "requires":
|
12631
|
+
if (modifier.requires != null && !Array.isArray(modifier.requires)) {
|
12632
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requires"', '"array"', '"' + String(modifier.requires) + '"'));
|
12633
|
+
}
|
12634
|
+
break;
|
12635
|
+
case "requiresIfExists":
|
12636
|
+
if (!Array.isArray(modifier.requiresIfExists)) {
|
12637
|
+
console.error(format(INVALID_MODIFIER_ERROR, modifier.name, '"requiresIfExists"', '"array"', '"' + String(modifier.requiresIfExists) + '"'));
|
12638
|
+
}
|
12639
|
+
break;
|
12640
|
+
case "options":
|
12641
|
+
case "data":
|
12642
|
+
break;
|
12643
|
+
default:
|
12644
|
+
console.error('PopperJS: an invalid property has been provided to the "' + modifier.name + '" modifier, valid properties are ' + VALID_PROPERTIES.map(function(s) {
|
12645
|
+
return '"' + s + '"';
|
12646
|
+
}).join(", ") + '; but "' + key + '" was provided.');
|
12647
|
+
}
|
12648
|
+
modifier.requires && modifier.requires.forEach(function(requirement) {
|
12649
|
+
if (modifiers.find(function(mod) {
|
12650
|
+
return mod.name === requirement;
|
12651
|
+
}) == null) {
|
12652
|
+
console.error(format(MISSING_DEPENDENCY_ERROR, String(modifier.name), requirement, requirement));
|
12653
|
+
}
|
12654
|
+
});
|
12655
|
+
});
|
12656
|
+
});
|
12657
|
+
}
|
12658
|
+
|
12659
|
+
// node_modules/@popperjs/core/lib/utils/uniqueBy.js
|
12660
|
+
function uniqueBy(arr, fn2) {
|
12661
|
+
var identifiers = /* @__PURE__ */ new Set();
|
12662
|
+
return arr.filter(function(item) {
|
12663
|
+
var identifier = fn2(item);
|
12664
|
+
if (!identifiers.has(identifier)) {
|
12665
|
+
identifiers.add(identifier);
|
12666
|
+
return true;
|
12667
|
+
}
|
12668
|
+
});
|
12669
|
+
}
|
12670
|
+
|
12671
|
+
// node_modules/@popperjs/core/lib/utils/mergeByName.js
|
12672
|
+
function mergeByName(modifiers) {
|
12673
|
+
var merged = modifiers.reduce(function(merged2, current) {
|
12674
|
+
var existing = merged2[current.name];
|
12675
|
+
merged2[current.name] = existing ? Object.assign({}, existing, current, {
|
12676
|
+
options: Object.assign({}, existing.options, current.options),
|
12677
|
+
data: Object.assign({}, existing.data, current.data)
|
12678
|
+
}) : current;
|
12679
|
+
return merged2;
|
12680
|
+
}, {});
|
12681
|
+
return Object.keys(merged).map(function(key) {
|
12682
|
+
return merged[key];
|
12683
|
+
});
|
12684
|
+
}
|
12685
|
+
|
12686
|
+
// node_modules/@popperjs/core/lib/createPopper.js
|
12687
|
+
var INVALID_ELEMENT_ERROR = "Popper: Invalid reference or popper argument provided. They must be either a DOM element or virtual element.";
|
12688
|
+
var INFINITE_LOOP_ERROR = "Popper: An infinite loop in the modifiers cycle has been detected! The cycle has been interrupted to prevent a browser crash.";
|
12689
|
+
var DEFAULT_OPTIONS = {
|
12690
|
+
placement: "bottom",
|
12691
|
+
modifiers: [],
|
12692
|
+
strategy: "absolute"
|
12693
|
+
};
|
12694
|
+
function areValidElements() {
|
12695
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
12696
|
+
args[_key] = arguments[_key];
|
12697
|
+
}
|
12698
|
+
return !args.some(function(element) {
|
12699
|
+
return !(element && typeof element.getBoundingClientRect === "function");
|
12700
|
+
});
|
12701
|
+
}
|
12702
|
+
function popperGenerator(generatorOptions) {
|
12703
|
+
if (generatorOptions === void 0) {
|
12704
|
+
generatorOptions = {};
|
12705
|
+
}
|
12706
|
+
var _generatorOptions = generatorOptions, _generatorOptions$def = _generatorOptions.defaultModifiers, defaultModifiers2 = _generatorOptions$def === void 0 ? [] : _generatorOptions$def, _generatorOptions$def2 = _generatorOptions.defaultOptions, defaultOptions = _generatorOptions$def2 === void 0 ? DEFAULT_OPTIONS : _generatorOptions$def2;
|
12707
|
+
return function createPopper2(reference2, popper2, options) {
|
12708
|
+
if (options === void 0) {
|
12709
|
+
options = defaultOptions;
|
12710
|
+
}
|
12711
|
+
var state = {
|
12712
|
+
placement: "bottom",
|
12713
|
+
orderedModifiers: [],
|
12714
|
+
options: Object.assign({}, DEFAULT_OPTIONS, defaultOptions),
|
12715
|
+
modifiersData: {},
|
12716
|
+
elements: {
|
12717
|
+
reference: reference2,
|
12718
|
+
popper: popper2
|
12719
|
+
},
|
12720
|
+
attributes: {},
|
12721
|
+
styles: {}
|
12722
|
+
};
|
12723
|
+
var effectCleanupFns = [];
|
12724
|
+
var isDestroyed = false;
|
12725
|
+
var instance = {
|
12726
|
+
state,
|
12727
|
+
setOptions: function setOptions(setOptionsAction) {
|
12728
|
+
var options2 = typeof setOptionsAction === "function" ? setOptionsAction(state.options) : setOptionsAction;
|
12729
|
+
cleanupModifierEffects();
|
12730
|
+
state.options = Object.assign({}, defaultOptions, state.options, options2);
|
12731
|
+
state.scrollParents = {
|
12732
|
+
reference: isElement(reference2) ? listScrollParents(reference2) : reference2.contextElement ? listScrollParents(reference2.contextElement) : [],
|
12733
|
+
popper: listScrollParents(popper2)
|
12734
|
+
};
|
12735
|
+
var orderedModifiers = orderModifiers(mergeByName([].concat(defaultModifiers2, state.options.modifiers)));
|
12736
|
+
state.orderedModifiers = orderedModifiers.filter(function(m) {
|
12737
|
+
return m.enabled;
|
12738
|
+
});
|
12739
|
+
if (true) {
|
12740
|
+
var modifiers = uniqueBy([].concat(orderedModifiers, state.options.modifiers), function(_ref) {
|
12741
|
+
var name = _ref.name;
|
12742
|
+
return name;
|
12743
|
+
});
|
12744
|
+
validateModifiers(modifiers);
|
12745
|
+
if (getBasePlacement(state.options.placement) === auto) {
|
12746
|
+
var flipModifier = state.orderedModifiers.find(function(_ref2) {
|
12747
|
+
var name = _ref2.name;
|
12748
|
+
return name === "flip";
|
12749
|
+
});
|
12750
|
+
if (!flipModifier) {
|
12751
|
+
console.error(['Popper: "auto" placements require the "flip" modifier be', "present and enabled to work."].join(" "));
|
12752
|
+
}
|
12753
|
+
}
|
12754
|
+
var _getComputedStyle = getComputedStyle(popper2), marginTop = _getComputedStyle.marginTop, marginRight = _getComputedStyle.marginRight, marginBottom = _getComputedStyle.marginBottom, marginLeft = _getComputedStyle.marginLeft;
|
12755
|
+
if ([marginTop, marginRight, marginBottom, marginLeft].some(function(margin) {
|
12756
|
+
return parseFloat(margin);
|
12757
|
+
})) {
|
12758
|
+
console.warn(['Popper: CSS "margin" styles cannot be used to apply padding', "between the popper and its reference element or boundary.", "To replicate margin, use the `offset` modifier, as well as", "the `padding` option in the `preventOverflow` and `flip`", "modifiers."].join(" "));
|
12759
|
+
}
|
12760
|
+
}
|
12761
|
+
runModifierEffects();
|
12762
|
+
return instance.update();
|
12763
|
+
},
|
12764
|
+
forceUpdate: function forceUpdate() {
|
12765
|
+
if (isDestroyed) {
|
12766
|
+
return;
|
12767
|
+
}
|
12768
|
+
var _state$elements = state.elements, reference3 = _state$elements.reference, popper3 = _state$elements.popper;
|
12769
|
+
if (!areValidElements(reference3, popper3)) {
|
12770
|
+
if (true) {
|
12771
|
+
console.error(INVALID_ELEMENT_ERROR);
|
12772
|
+
}
|
12773
|
+
return;
|
12774
|
+
}
|
12775
|
+
state.rects = {
|
12776
|
+
reference: getCompositeRect(reference3, getOffsetParent(popper3), state.options.strategy === "fixed"),
|
12777
|
+
popper: getLayoutRect(popper3)
|
12778
|
+
};
|
12779
|
+
state.reset = false;
|
12780
|
+
state.placement = state.options.placement;
|
12781
|
+
state.orderedModifiers.forEach(function(modifier) {
|
12782
|
+
return state.modifiersData[modifier.name] = Object.assign({}, modifier.data);
|
12783
|
+
});
|
12784
|
+
var __debug_loops__ = 0;
|
12785
|
+
for (var index2 = 0; index2 < state.orderedModifiers.length; index2++) {
|
12786
|
+
if (true) {
|
12787
|
+
__debug_loops__ += 1;
|
12788
|
+
if (__debug_loops__ > 100) {
|
12789
|
+
console.error(INFINITE_LOOP_ERROR);
|
12790
|
+
break;
|
12791
|
+
}
|
12792
|
+
}
|
12793
|
+
if (state.reset === true) {
|
12794
|
+
state.reset = false;
|
12795
|
+
index2 = -1;
|
12796
|
+
continue;
|
12797
|
+
}
|
12798
|
+
var _state$orderedModifie = state.orderedModifiers[index2], fn2 = _state$orderedModifie.fn, _state$orderedModifie2 = _state$orderedModifie.options, _options = _state$orderedModifie2 === void 0 ? {} : _state$orderedModifie2, name = _state$orderedModifie.name;
|
12799
|
+
if (typeof fn2 === "function") {
|
12800
|
+
state = fn2({
|
12801
|
+
state,
|
12802
|
+
options: _options,
|
12803
|
+
name,
|
12804
|
+
instance
|
12805
|
+
}) || state;
|
12806
|
+
}
|
12807
|
+
}
|
12808
|
+
},
|
12809
|
+
update: debounce2(function() {
|
12810
|
+
return new Promise(function(resolve) {
|
12811
|
+
instance.forceUpdate();
|
12812
|
+
resolve(state);
|
12813
|
+
});
|
12814
|
+
}),
|
12815
|
+
destroy: function destroy2() {
|
12816
|
+
cleanupModifierEffects();
|
12817
|
+
isDestroyed = true;
|
12818
|
+
}
|
12819
|
+
};
|
12820
|
+
if (!areValidElements(reference2, popper2)) {
|
12821
|
+
if (true) {
|
12822
|
+
console.error(INVALID_ELEMENT_ERROR);
|
12823
|
+
}
|
12824
|
+
return instance;
|
12825
|
+
}
|
12826
|
+
instance.setOptions(options).then(function(state2) {
|
12827
|
+
if (!isDestroyed && options.onFirstUpdate) {
|
12828
|
+
options.onFirstUpdate(state2);
|
12829
|
+
}
|
12830
|
+
});
|
12831
|
+
function runModifierEffects() {
|
12832
|
+
state.orderedModifiers.forEach(function(_ref3) {
|
12833
|
+
var name = _ref3.name, _ref3$options = _ref3.options, options2 = _ref3$options === void 0 ? {} : _ref3$options, effect4 = _ref3.effect;
|
12834
|
+
if (typeof effect4 === "function") {
|
12835
|
+
var cleanupFn = effect4({
|
12836
|
+
state,
|
12837
|
+
name,
|
12838
|
+
instance,
|
12839
|
+
options: options2
|
12840
|
+
});
|
12841
|
+
var noopFn = function noopFn2() {
|
12842
|
+
};
|
12843
|
+
effectCleanupFns.push(cleanupFn || noopFn);
|
12844
|
+
}
|
12845
|
+
});
|
12846
|
+
}
|
12847
|
+
function cleanupModifierEffects() {
|
12848
|
+
effectCleanupFns.forEach(function(fn2) {
|
12849
|
+
return fn2();
|
12850
|
+
});
|
12851
|
+
effectCleanupFns = [];
|
12852
|
+
}
|
12853
|
+
return instance;
|
12854
|
+
};
|
12855
|
+
}
|
12856
|
+
|
12857
|
+
// node_modules/@popperjs/core/lib/popper.js
|
12858
|
+
var defaultModifiers = [eventListeners_default, popperOffsets_default, computeStyles_default, applyStyles_default, offset_default, flip_default, preventOverflow_default, arrow_default, hide_default];
|
12859
|
+
var createPopper = /* @__PURE__ */ popperGenerator({
|
12860
|
+
defaultModifiers
|
12861
|
+
});
|
12862
|
+
|
12863
|
+
// app/assets/javascripts/formstrap/controllers/popup_controller.js
|
12864
|
+
var popup_controller_default = class extends Controller {
|
12865
|
+
static get targets() {
|
12866
|
+
return ["popup", "button"];
|
12867
|
+
}
|
12868
|
+
static get values() {
|
12869
|
+
return { id: String };
|
12870
|
+
}
|
12871
|
+
connect() {
|
12872
|
+
document.addEventListener("click", (event) => {
|
12873
|
+
this.handleOutsideClick(event);
|
12874
|
+
});
|
12875
|
+
}
|
12876
|
+
handleOutsideClick(event) {
|
12877
|
+
const itemRemoved = !document.body.contains(event.target);
|
12878
|
+
if (itemRemoved)
|
12879
|
+
return;
|
12880
|
+
const inPopup = event.target.closest('[data-popup-target="popup"]') !== null;
|
12881
|
+
const inButton = event.target.closest('[data-popup-target="button"]') !== null;
|
12882
|
+
const openPopup = document.querySelector('[data-popup-target="popup"]:not(.closed)');
|
12883
|
+
if (!inButton && !inPopup && openPopup) {
|
12884
|
+
this.closePopup(openPopup);
|
12885
|
+
}
|
12886
|
+
}
|
12887
|
+
open(event) {
|
12888
|
+
const button = event.target.closest('[data-popup-target="button"]');
|
12889
|
+
const popup = this.popupById(button.dataset.popupId);
|
12890
|
+
const passThru = button.dataset.popupPassThru;
|
12891
|
+
createPopper(button, popup);
|
12892
|
+
this.openPopup(popup);
|
12893
|
+
if (passThru) {
|
12894
|
+
const passThruElement = popup.querySelector(passThru);
|
12895
|
+
passThruElement.click();
|
12896
|
+
if (passThruElement instanceof HTMLInputElement) {
|
12897
|
+
passThruElement.focus();
|
12898
|
+
passThruElement.select();
|
12899
|
+
}
|
12900
|
+
}
|
12901
|
+
}
|
12902
|
+
close(event) {
|
12903
|
+
const button = event.target.closest('[data-popup-target="button"]');
|
12904
|
+
const popup = this.popupById(button.dataset.popupId);
|
12905
|
+
this.closePopup(popup);
|
12906
|
+
}
|
12907
|
+
popupById(id) {
|
12908
|
+
return this.popupTargets.find((popup) => {
|
12909
|
+
return popup.dataset.popupId === id;
|
12910
|
+
});
|
12911
|
+
}
|
12912
|
+
openPopup(popup) {
|
12913
|
+
popup.classList.remove("closed");
|
12914
|
+
}
|
12915
|
+
closePopup(popup) {
|
12916
|
+
popup.classList.add("closed");
|
12917
|
+
}
|
11258
12918
|
};
|
11259
12919
|
|
11260
12920
|
// app/assets/javascripts/formstrap/controllers/redactorx_controller.js
|
@@ -11301,8 +12961,8 @@ var repeater_controller_default = class extends Controller {
|
|
11301
12961
|
sortable_esm_default.create(this.listTarget, {
|
11302
12962
|
animation: 150,
|
11303
12963
|
ghostClass: "list-group-item-dark",
|
11304
|
-
draggable: ".repeater-row",
|
11305
|
-
handle: ".repeater-row-handle",
|
12964
|
+
draggable: ".formstrap-repeater-row",
|
12965
|
+
handle: ".formstrap-repeater-row-handle",
|
11306
12966
|
onEnd: () => {
|
11307
12967
|
this.resetIndices();
|
11308
12968
|
this.resetPositions();
|
@@ -11311,7 +12971,7 @@ var repeater_controller_default = class extends Controller {
|
|
11311
12971
|
this.toggleEmpty();
|
11312
12972
|
}
|
11313
12973
|
resetButtonIndices(event) {
|
11314
|
-
const row = event.target.closest(".repeater-row");
|
12974
|
+
const row = event.target.closest(".formstrap-repeater-row");
|
11315
12975
|
const index2 = this.containsRow(row) ? row.dataset.rowIndex : "";
|
11316
12976
|
this.updatePopupButtonIndices(index2);
|
11317
12977
|
}
|
@@ -11344,7 +13004,7 @@ var repeater_controller_default = class extends Controller {
|
|
11344
13004
|
}
|
11345
13005
|
removeRow(event) {
|
11346
13006
|
event.preventDefault();
|
11347
|
-
const row = event.target.closest(".repeater-row");
|
13007
|
+
const row = event.target.closest(".formstrap-repeater-row");
|
11348
13008
|
if (row.dataset.newRecord === "true") {
|
11349
13009
|
row.remove();
|
11350
13010
|
} else {
|
@@ -11497,6 +13157,7 @@ var Formstrap = class {
|
|
11497
13157
|
Stimulus.register("infinite-scroller", infinite_scroller_controller_default);
|
11498
13158
|
Stimulus.register("media", media_controller_default);
|
11499
13159
|
Stimulus.register("media-modal", media_modal_controller_default);
|
13160
|
+
Stimulus.register("popup", popup_controller_default);
|
11500
13161
|
Stimulus.register("redactorx", redactorx_controller_default);
|
11501
13162
|
Stimulus.register("repeater", repeater_controller_default);
|
11502
13163
|
Stimulus.register("select", select_controller_default);
|