From bfa3f9d0c93b29d87aff8ed443c1b0647282b99e Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Tue, 23 Apr 2024 16:28:40 -0700 Subject: [PATCH 01/10] Update the wildcard sort logic in gulpfile. --- gulpfile.js | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 58cc3b085c3..e4fdf761e12 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -118,12 +118,23 @@ function resolveAssetGroupPaths(assetGroup, assetManifestPath) { return path.resolve(path.join(assetGroup.basePath, inputPath)).replace(/\\/g, '/'); }); - // For wildcard input paths also sortthem to ensure file concatenation is consistent. - if (inputPaths.some(path => path.includes('*'))) { - inputPaths = glob.sync(inputPaths, {}).sort(); - } + var finalSorted = []; + + // The inputPaths can contain either a physical path to a file or a path with a wildcard. + // It's crucial to maintain the order of each file based on its position in the assets.json file. + // When a path contains a wildcard, we need to convert the wildcard to physical paths + // and sort them independently of the previous paths to ensure consistent concatenation. + inputPaths.forEach(path => { + if (path.includes('*')) { + glob.sync(path, {}).sort().forEach(p => { + finalSorted.push(p); + }); + } else { + finalSorted.push(path); + } + }); - assetGroup.inputPaths = inputPaths; + assetGroup.inputPaths = finalSorted; assetGroup.watchPaths = []; if (!!assetGroup.watch) { @@ -263,7 +274,6 @@ function buildJsPipeline(assetGroup, doConcat, doRebuild) { target: "es5", }; - console.log(assetGroup.inputPaths); return gulp.src(assetGroup.inputPaths) .pipe(gulpif(!doRebuild, gulpif(doConcat, From dc0ce3221ba13f2084be32bab0a662ab2d99449d Mon Sep 17 00:00:00 2001 From: Mike Alhayek Date: Tue, 23 Apr 2024 16:29:00 -0700 Subject: [PATCH 02/10] Rebuild Assets --- .../wwwroot/Scripts/admin-menu-icon-picker.js | 1 - .../wwwroot/Scripts/admin-menu.js | 2 - .../wwwroot/Scripts/diff.js | 1 - .../wwwroot/Scripts/flows.edit.js | 4 +- .../wwwroot/Scripts/flows.edit.min.js | 2 +- .../wwwroot/Scripts/media.js | 6487 ++++++++--------- .../wwwroot/Scripts/media.min.js | 2 +- .../OrchardCore.Menu/wwwroot/Scripts/menu.js | 2 - .../wwwroot/Scripts/bootstrap.bundle.js | 166 +- .../wwwroot/Scripts/bootstrap.bundle.min.js | 4 +- .../wwwroot/Scripts/bootstrap.js | 165 +- .../wwwroot/Scripts/bootstrap.min.js | 4 +- .../wwwroot/Scripts/codemirror/codemirror.js | 3 - .../wwwroot/Scripts/jquery.js | 1 - .../wwwroot/Scripts/jquery.slim.js | 1 - .../wwwroot/Scripts/popper.js | 1 - .../wwwroot/Scripts/trumbowyg-plugins.js | 8 - .../wwwroot/Scripts/trumbowyg.js | 1 - .../wwwroot/Scripts/setup.js | 168 +- .../wwwroot/Scripts/setup.min.js | 4 +- .../wwwroot/Scripts/menu.js | 2 - .../TheAdmin/wwwroot/css/TheAdmin.css | 3 +- .../TheAdmin/wwwroot/js/TheAdmin.js | 8 +- .../TheAdmin/wwwroot/js/TheAdmin.min.js | 2 +- 24 files changed, 3442 insertions(+), 3600 deletions(-) diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.js b/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.js index e7f8509841c..ed0c7d9e37b 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.js +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu-icon-picker.js @@ -5395,7 +5395,6 @@ var iconPickerVue = new Vue({ search: '' // just to leave empty the placeholder because it is not localized } }); - $('#inline-picker').on('iconpickerSelected', function (e) { var selected = e.iconpickerInstance.options.fullClassFormatter(e.iconpickerValue); if (self.targetInputField) { diff --git a/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu.js b/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu.js index 5f9827b789e..41b5053dc54 100644 --- a/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu.js +++ b/src/OrchardCore.Modules/OrchardCore.AdminMenu/wwwroot/Scripts/admin-menu.js @@ -429,7 +429,6 @@ this._sort_current = this.domPosition.prev ? $(this.domPosition.prev).next().index() : 0; $.ui.sortable.prototype._mouseStop.apply(this, arguments); //asybnchronous execution, @see _clear for the relocate event. }, - // mjs - this function is slightly modified // to make it easier to hover over a collapsed element and have it expand _intersectsWithSides: function _intersectsWithSides(item) { @@ -497,7 +496,6 @@ if (data.nestedSortableItem) { delete data.nestedSortableItem; // Remove the nestedSortableItem object from the data } - if (id) { currentItem = { "id": id[2] diff --git a/src/OrchardCore.Modules/OrchardCore.AuditTrail/wwwroot/Scripts/diff.js b/src/OrchardCore.Modules/OrchardCore.AuditTrail/wwwroot/Scripts/diff.js index 32296fd1389..2192a68a599 100644 --- a/src/OrchardCore.Modules/OrchardCore.AuditTrail/wwwroot/Scripts/diff.js +++ b/src/OrchardCore.Modules/OrchardCore.AuditTrail/wwwroot/Scripts/diff.js @@ -676,7 +676,6 @@ OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // hunk can't fit on the text. Return undefined }; } - function applyPatch(source, uniDiff) { var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; if (typeof uniDiff === 'string') { diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.js b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.js index bcc3b377423..35c673bbacb 100644 --- a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.js +++ b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.js @@ -7,8 +7,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); } function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } diff --git a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.min.js b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.min.js index 00bbad70a56..657c113a219 100644 --- a/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Flows/wwwroot/Scripts/flows.edit.min.js @@ -1 +1 @@ -function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0){var r=$(this).find("input:first-child").val(),n=t.attr("class").split(" ");$.each(n,(function(e,r){0===r.indexOf("col-md-")&&t.removeClass(r)}));var i=Math.round(r/100*12);t.addClass("col-md-"+i),$(this).closest(".dropdown-menu").prev("button").text(r+"%")}else if("undefined"!==e[0].id&&e[0].id.indexOf("Alignment")>0){var a=$(this).find("svg")[0].outerHTML;$(this).closest(".dropdown-menu").prev("button").html(a)}$(this).parent().find(".dropdown-item").removeClass("active"),$(this).toggleClass("active"),$(document).trigger("contentpreview:render")})),$(document).on("click",".widget-editor-btn-toggle",(function(){$(this).closest(".widget-editor").toggleClass("collapsed")})),$(document).on("keyup",".widget-editor-body .form-group input.content-caption-text",(function(){var t=$(this).closest(".widget-editor").find(".widget-editor-header:first .widget-editor-header-text"),e=t.data("content-type-display-text"),r=$(this).val()+" "+e;t.text(r)}))})); +function _typeof(t){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_typeof(t)}function ownKeys(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread(t){for(var e=1;et.length)&&(e=t.length);for(var r=0,n=new Array(e);r0){var r=$(this).find("input:first-child").val(),n=t.attr("class").split(" ");$.each(n,(function(e,r){0===r.indexOf("col-md-")&&t.removeClass(r)}));var i=Math.round(r/100*12);t.addClass("col-md-"+i),$(this).closest(".dropdown-menu").prev("button").text(r+"%")}else if("undefined"!==e[0].id&&e[0].id.indexOf("Alignment")>0){var a=$(this).find("svg")[0].outerHTML;$(this).closest(".dropdown-menu").prev("button").html(a)}$(this).parent().find(".dropdown-item").removeClass("active"),$(this).toggleClass("active"),$(document).trigger("contentpreview:render")})),$(document).on("click",".widget-editor-btn-toggle",(function(){$(this).closest(".widget-editor").toggleClass("collapsed")})),$(document).on("keyup",".widget-editor-body .form-group input.content-caption-text",(function(){var t=$(this).closest(".widget-editor").find(".widget-editor-header:first .widget-editor-header-text"),e=t.data("content-type-display-text"),r=$(this).val()+" "+e;t.text(r)}))})); diff --git a/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.js b/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.js index bddbc52d838..581caaa7332 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.js +++ b/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.js @@ -4,3421 +4,3416 @@ */ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -var initialized; -var mediaApp; -var bus = new Vue(); -function initializeMediaApplication(displayMediaApplication, mediaApplicationUrl, pathBase) { - if (initialized) { - return; +/* + * jQuery File Upload Plugin + * https://github.com/blueimp/jQuery-File-Upload + * + * Copyright 2010, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * https://opensource.org/licenses/MIT + */ + +/* global define, require */ +/* eslint-disable new-cap */ + +(function (factory) { + 'use strict'; + + if (typeof define === 'function' && define.amd) { + // Register as an anonymous AMD module: + define(['jquery', 'jquery-ui/ui/widget'], factory); + } else if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object') { + // Node/CommonJS: + factory(require('jquery'), require('./vendor/jquery.ui.widget')); + } else { + // Browser globals: + factory(window.jQuery); } - initialized = true; - if (!mediaApplicationUrl) { - console.error('mediaApplicationUrl variable is not defined'); +})(function ($) { + 'use strict'; + + // Detect file input support, based on + // https://viljamis.com/2012/file-upload-support-on-mobile/ + $.support.fileInput = !(new RegExp( + // Handle devices which give false positives for the feature detection: + '(Android (1\\.[0156]|2\\.[01]))' + '|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)' + '|(w(eb)?OSBrowser)|(webOS)' + '|(Kindle/(1\\.0|2\\.[05]|3\\.0))').test(window.navigator.userAgent) || + // Feature detection for all other devices: + $('').prop('disabled')); + + // The FileReader API is not actually used, but works as feature detection, + // as some Safari versions (5?) support XHR file uploads via the FormData API, + // but not non-multipart XHR file uploads. + // window.XMLHttpRequestUpload is not available on IE10, so we check for + // window.ProgressEvent instead to detect XHR2 file upload capability: + $.support.xhrFileUpload = !!(window.ProgressEvent && window.FileReader); + $.support.xhrFormDataFileUpload = !!window.FormData; + + // Detect support for Blob slicing (required for chunked uploads): + $.support.blobSlice = window.Blob && (Blob.prototype.slice || Blob.prototype.webkitSlice || Blob.prototype.mozSlice); + + /** + * Helper function to create drag handlers for dragover/dragenter/dragleave + * + * @param {string} type Event type + * @returns {Function} Drag handler + */ + function getDragHandler(type) { + var isDragOver = type === 'dragover'; + return function (e) { + e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer; + var dataTransfer = e.dataTransfer; + if (dataTransfer && $.inArray('Files', dataTransfer.types) !== -1 && this._trigger(type, $.Event(type, { + delegatedEvent: e + })) !== false) { + e.preventDefault(); + if (isDragOver) { + dataTransfer.dropEffect = 'copy'; + } + } + }; } - $.ajax({ - url: mediaApplicationUrl, - method: 'GET', - success: function success(content) { - $('.ta-content').append(content); - $(document).trigger('mediaapplication:ready'); - var _root = { - name: $('#t-mediaLibrary').text(), - path: '', - folder: '', - isDirectory: true - }; - mediaApp = new Vue({ - el: '#mediaApp', - data: { - selectedFolder: {}, - mediaItems: [], - selectedMedias: [], - errors: [], - dragDropThumbnail: new Image(), - smallThumbs: false, - gridView: false, - mediaFilter: '', - sortBy: '', - sortAsc: true, - itemsInPage: [] - }, - created: function created() { - var self = this; - self.dragDropThumbnail.src = (pathBase || '') + '/OrchardCore.Media/Images/drag-thumbnail.png'; - bus.$on('folderSelected', function (folder) { - self.selectedFolder = folder; - }); - bus.$on('folderDeleted', function () { - self.selectRoot(); - }); - bus.$on('folderAdded', function (folder) { - self.selectedFolder = folder; - folder.selected = true; - }); - bus.$on('mediaListMoved', function (errorInfo) { - self.loadFolder(self.selectedFolder); - if (errorInfo) { - self.errors.push(errorInfo); - } - }); - bus.$on('mediaRenamed', function (newName, newPath, oldPath, newUrl) { - var media = self.mediaItems.filter(function (item) { - return item.mediaPath === oldPath; - })[0]; - media.mediaPath = newPath; - media.name = newName; - media.url = newUrl; - }); - bus.$on('createFolderRequested', function (media) { - self.createFolder(); - }); - bus.$on('deleteFolderRequested', function (media) { - self.deleteFolder(); - }); - // common handlers for actions in both grid and table view. - bus.$on('sortChangeRequested', function (newSort) { - self.changeSort(newSort); - }); - bus.$on('mediaToggleRequested', function (media) { - self.toggleSelectionOfMedia(media); + // The fileupload widget listens for change events on file input fields defined + // via fileInput setting and paste or drop events of the given dropZone. + // In addition to the default jQuery Widget methods, the fileupload widget + // exposes the "add" and "send" methods, to add or directly send files using + // the fileupload API. + // By default, files added via file input selection, paste, drag & drop or + // "add" method are uploaded immediately, but it is possible to override + // the "add" callback option to queue file uploads. + $.widget('blueimp.fileupload', { + options: { + // The drop target element(s), by the default the complete document. + // Set to null to disable drag & drop support: + dropZone: $(document), + // The paste target element(s), by the default undefined. + // Set to a DOM node or jQuery object to enable file pasting: + pasteZone: undefined, + // The file input field(s), that are listened to for change events. + // If undefined, it is set to the file input fields inside + // of the widget element on plugin initialization. + // Set to null to disable the change listener. + fileInput: undefined, + // By default, the file input field is replaced with a clone after + // each input field change event. This is required for iframe transport + // queues and allows change events to be fired for the same file + // selection, but can be disabled by setting the following option to false: + replaceFileInput: true, + // The parameter name for the file form data (the request argument name). + // If undefined or empty, the name property of the file input field is + // used, or "files[]" if the file input name property is also empty, + // can be a string or an array of strings: + paramName: undefined, + // By default, each file of a selection is uploaded using an individual + // request for XHR type uploads. Set to false to upload file + // selections in one request each: + singleFileUploads: true, + // To limit the number of files uploaded with one XHR request, + // set the following option to an integer greater than 0: + limitMultiFileUploads: undefined, + // The following option limits the number of files uploaded with one + // XHR request to keep the request size under or equal to the defined + // limit in bytes: + limitMultiFileUploadSize: undefined, + // Multipart file uploads add a number of bytes to each uploaded file, + // therefore the following option adds an overhead for each file used + // in the limitMultiFileUploadSize configuration: + limitMultiFileUploadSizeOverhead: 512, + // Set the following option to true to issue all file upload requests + // in a sequential order: + sequentialUploads: false, + // To limit the number of concurrent uploads, + // set the following option to an integer greater than 0: + limitConcurrentUploads: undefined, + // Set the following option to true to force iframe transport uploads: + forceIframeTransport: false, + // Set the following option to the location of a redirect url on the + // origin server, for cross-domain iframe transport uploads: + redirect: undefined, + // The parameter name for the redirect url, sent as part of the form + // data and set to 'redirect' if this option is empty: + redirectParamName: undefined, + // Set the following option to the location of a postMessage window, + // to enable postMessage transport uploads: + postMessage: undefined, + // By default, XHR file uploads are sent as multipart/form-data. + // The iframe transport is always using multipart/form-data. + // Set to false to enable non-multipart XHR uploads: + multipart: true, + // To upload large files in smaller chunks, set the following option + // to a preferred maximum chunk size. If set to 0, null or undefined, + // or the browser does not support the required Blob API, files will + // be uploaded as a whole. + maxChunkSize: undefined, + // When a non-multipart upload or a chunked multipart upload has been + // aborted, this option can be used to resume the upload by setting + // it to the size of the already uploaded bytes. This option is most + // useful when modifying the options object inside of the "add" or + // "send" callbacks, as the options are cloned for each file upload. + uploadedBytes: undefined, + // By default, failed (abort or error) file uploads are removed from the + // global progress calculation. Set the following option to false to + // prevent recalculating the global progress data: + recalculateProgress: true, + // Interval in milliseconds to calculate and trigger progress events: + progressInterval: 100, + // Interval in milliseconds to calculate progress bitrate: + bitrateInterval: 500, + // By default, uploads are started automatically when adding files: + autoUpload: true, + // By default, duplicate file names are expected to be handled on + // the server-side. If this is not possible (e.g. when uploading + // files directly to Amazon S3), the following option can be set to + // an empty object or an object mapping existing filenames, e.g.: + // { "image.jpg": true, "image (1).jpg": true } + // If it is set, all files will be uploaded with unique filenames, + // adding increasing number suffixes if necessary, e.g.: + // "image (2).jpg" + uniqueFilenames: undefined, + // Error and info messages: + messages: { + uploadedBytes: 'Uploaded bytes exceed file size' + }, + // Translation function, gets the message key to be translated + // and an object with context specific data as arguments: + i18n: function i18n(message, context) { + // eslint-disable-next-line no-param-reassign + message = this.messages[message] || message.toString(); + if (context) { + $.each(context, function (key, value) { + // eslint-disable-next-line no-param-reassign + message = message.replace('{' + key + '}', value); }); - bus.$on('renameMediaRequested', function (media) { - self.renameMedia(media); - }); - bus.$on('deleteMediaRequested', function (media) { - self.deleteMediaItem(media); - }); - bus.$on('mediaDragStartRequested', function (media, e) { - self.handleDragStart(media, e); + } + return message; + }, + // Additional form data to be sent along with the file uploads can be set + // using this option, which accepts an array of objects with name and + // value properties, a function returning such an array, a FormData + // object (for XHR file uploads), or a simple object. + // The form of the first fileInput is given as parameter to the function: + formData: function formData(form) { + return form.serializeArray(); + }, + // The add callback is invoked as soon as files are added to the fileupload + // widget (via file input selection, drag & drop, paste or add API call). + // If the singleFileUploads option is enabled, this callback will be + // called once for each file in the selection for XHR file uploads, else + // once for each file selection. + // + // The upload starts when the submit method is invoked on the data parameter. + // The data object contains a files property holding the added files + // and allows you to override plugin options as well as define ajax settings. + // + // Listeners for this callback can also be bound the following way: + // .on('fileuploadadd', func); + // + // data.submit() returns a Promise object and allows to attach additional + // handlers using jQuery's Deferred callbacks: + // data.submit().done(func).fail(func).always(func); + add: function add(e, data) { + if (e.isDefaultPrevented()) { + return false; + } + if (data.autoUpload || data.autoUpload !== false && $(this).fileupload('option', 'autoUpload')) { + data.process().done(function () { + data.submit(); }); + } + }, + // Other callbacks: - // handler for pager events - bus.$on('pagerEvent', function (itemsInPage) { - self.itemsInPage = itemsInPage; - self.selectedMedias = []; + // Callback for the submit event of each file upload: + // submit: function (e, data) {}, // .on('fileuploadsubmit', func); + + // Callback for the start of each file upload request: + // send: function (e, data) {}, // .on('fileuploadsend', func); + + // Callback for successful uploads: + // done: function (e, data) {}, // .on('fileuploaddone', func); + + // Callback for failed (abort or error) uploads: + // fail: function (e, data) {}, // .on('fileuploadfail', func); + + // Callback for completed (success, abort or error) requests: + // always: function (e, data) {}, // .on('fileuploadalways', func); + + // Callback for upload progress events: + // progress: function (e, data) {}, // .on('fileuploadprogress', func); + + // Callback for global upload progress events: + // progressall: function (e, data) {}, // .on('fileuploadprogressall', func); + + // Callback for uploads start, equivalent to the global ajaxStart event: + // start: function (e) {}, // .on('fileuploadstart', func); + + // Callback for uploads stop, equivalent to the global ajaxStop event: + // stop: function (e) {}, // .on('fileuploadstop', func); + + // Callback for change events of the fileInput(s): + // change: function (e, data) {}, // .on('fileuploadchange', func); + + // Callback for paste events to the pasteZone(s): + // paste: function (e, data) {}, // .on('fileuploadpaste', func); + + // Callback for drop events of the dropZone(s): + // drop: function (e, data) {}, // .on('fileuploaddrop', func); + + // Callback for dragover events of the dropZone(s): + // dragover: function (e) {}, // .on('fileuploaddragover', func); + + // Callback before the start of each chunk upload request (before form data initialization): + // chunkbeforesend: function (e, data) {}, // .on('fileuploadchunkbeforesend', func); + + // Callback for the start of each chunk upload request: + // chunksend: function (e, data) {}, // .on('fileuploadchunksend', func); + + // Callback for successful chunk uploads: + // chunkdone: function (e, data) {}, // .on('fileuploadchunkdone', func); + + // Callback for failed (abort or error) chunk uploads: + // chunkfail: function (e, data) {}, // .on('fileuploadchunkfail', func); + + // Callback for completed (success, abort or error) chunk upload requests: + // chunkalways: function (e, data) {}, // .on('fileuploadchunkalways', func); + + // The plugin options are used as settings object for the ajax calls. + // The following are jQuery ajax settings required for the file uploads: + processData: false, + contentType: false, + cache: false, + timeout: 0 + }, + // jQuery versions before 1.8 require promise.pipe if the return value is + // used, as promise.then in older versions has a different behavior, see: + // https://blog.jquery.com/2012/08/09/jquery-1-8-released/ + // https://bugs.jquery.com/ticket/11010 + // https://github.com/blueimp/jQuery-File-Upload/pull/3435 + _promisePipe: function () { + var parts = $.fn.jquery.split('.'); + return Number(parts[0]) > 1 || Number(parts[1]) > 7 ? 'then' : 'pipe'; + }(), + // A list of options that require reinitializing event listeners and/or + // special initialization code: + _specialOptions: ['fileInput', 'dropZone', 'pasteZone', 'multipart', 'forceIframeTransport'], + _blobSlice: $.support.blobSlice && function () { + var slice = this.slice || this.webkitSlice || this.mozSlice; + return slice.apply(this, arguments); + }, + _BitrateTimer: function _BitrateTimer() { + this.timestamp = Date.now ? Date.now() : new Date().getTime(); + this.loaded = 0; + this.bitrate = 0; + this.getBitrate = function (now, loaded, interval) { + var timeDiff = now - this.timestamp; + if (!this.bitrate || !interval || timeDiff > interval) { + this.bitrate = (loaded - this.loaded) * (1000 / timeDiff) * 8; + this.loaded = loaded; + this.timestamp = now; + } + return this.bitrate; + }; + }, + _isXHRUpload: function _isXHRUpload(options) { + return !options.forceIframeTransport && (!options.multipart && $.support.xhrFileUpload || $.support.xhrFormDataFileUpload); + }, + _getFormData: function _getFormData(options) { + var formData; + if ($.type(options.formData) === 'function') { + return options.formData(options.form); + } + if ($.isArray(options.formData)) { + return options.formData; + } + if ($.type(options.formData) === 'object') { + formData = []; + $.each(options.formData, function (name, value) { + formData.push({ + name: name, + value: value }); - if (!localStorage.getItem('mediaApplicationPrefs')) { - self.selectedFolder = _root; - return; + }); + return formData; + } + return []; + }, + _getTotal: function _getTotal(files) { + var total = 0; + $.each(files, function (index, file) { + total += file.size || 1; + }); + return total; + }, + _initProgressObject: function _initProgressObject(obj) { + var progress = { + loaded: 0, + total: 0, + bitrate: 0 + }; + if (obj._progress) { + $.extend(obj._progress, progress); + } else { + obj._progress = progress; + } + }, + _initResponseObject: function _initResponseObject(obj) { + var prop; + if (obj._response) { + for (prop in obj._response) { + if (Object.prototype.hasOwnProperty.call(obj._response, prop)) { + delete obj._response[prop]; } - self.currentPrefs = JSON.parse(localStorage.getItem('mediaApplicationPrefs')); - }, - computed: { - isHome: function isHome() { - return this.selectedFolder == _root; - }, - parents: function parents() { - var p = []; - parentFolder = this.selectedFolder; - while (parentFolder && parentFolder.path != '') { - p.unshift(parentFolder); - parentFolder = parentFolder.parent; - } - return p; - }, - root: function root() { - return _root; - }, - filteredMediaItems: function filteredMediaItems() { - var self = this; - self.selectedMedias = []; - var filtered = self.mediaItems.filter(function (item) { - return item.name.toLowerCase().indexOf(self.mediaFilter.toLowerCase()) > -1; - }); - switch (self.sortBy) { - case 'size': - filtered.sort(function (a, b) { - return self.sortAsc ? a.size - b.size : b.size - a.size; - }); - break; - case 'mime': - filtered.sort(function (a, b) { - return self.sortAsc ? a.mime.toLowerCase().localeCompare(b.mime.toLowerCase()) : b.mime.toLowerCase().localeCompare(a.mime.toLowerCase()); - }); - break; - case 'lastModify': - filtered.sort(function (a, b) { - return self.sortAsc ? a.lastModify - b.lastModify : b.lastModify - a.lastModify; - }); - break; - default: - filtered.sort(function (a, b) { - return self.sortAsc ? a.name.toLowerCase().localeCompare(b.name.toLowerCase()) : b.name.toLowerCase().localeCompare(a.name.toLowerCase()); - }); - } - return filtered; - }, - hiddenCount: function hiddenCount() { - var result = 0; - result = this.mediaItems.length - this.filteredMediaItems.length; - return result; - }, - thumbSize: function thumbSize() { - return this.smallThumbs ? 100 : 240; - }, - currentPrefs: { - get: function get() { - return { - smallThumbs: this.smallThumbs, - selectedFolder: this.selectedFolder, - gridView: this.gridView - }; - }, - set: function set(newPrefs) { - if (!newPrefs) { - return; - } - this.smallThumbs = newPrefs.smallThumbs; - this.selectedFolder = newPrefs.selectedFolder; - this.gridView = newPrefs.gridView; - } - } - }, - watch: { - currentPrefs: function currentPrefs(newPrefs) { - localStorage.setItem('mediaApplicationPrefs', JSON.stringify(newPrefs)); - }, - selectedFolder: function selectedFolder(newFolder) { - this.mediaFilter = ''; - this.selectedFolder = newFolder; - this.loadFolder(newFolder); - } - }, - mounted: function mounted() { - this.$refs.rootFolder.toggle(); - }, - methods: { - uploadUrl: function uploadUrl() { - if (!this.selectedFolder) { - return null; - } - var urlValue = $('#uploadFiles').val(); - return urlValue + (urlValue.indexOf('?') == -1 ? '?' : '&') + "path=" + encodeURIComponent(this.selectedFolder.path); - }, - selectRoot: function selectRoot() { - this.selectedFolder = this.root; - }, - loadFolder: function loadFolder(folder) { - this.errors = []; - this.selectedMedias = []; - var self = this; - var mediaUrl = $('#getMediaItemsUrl').val(); - console.log(folder.path); - $.ajax({ - url: mediaUrl + (mediaUrl.indexOf('?') == -1 ? '?' : '&') + "path=" + encodeURIComponent(folder.path), - method: 'GET', - success: function success(data) { - data.forEach(function (item) { - item.open = false; - }); - self.mediaItems = data; - self.selectedMedias = []; - self.sortBy = ''; - self.sortAsc = true; - }, - error: function error(_error) { - console.log('error loading folder:' + folder.path); - self.selectRoot(); - } + } + } else { + obj._response = {}; + } + }, + _onProgress: function _onProgress(e, data) { + if (e.lengthComputable) { + var now = Date.now ? Date.now() : new Date().getTime(), + loaded; + if (data._time && data.progressInterval && now - data._time < data.progressInterval && e.loaded !== e.total) { + return; + } + data._time = now; + loaded = Math.floor(e.loaded / e.total * (data.chunkSize || data._progress.total)) + (data.uploadedBytes || 0); + // Add the difference from the previously loaded state + // to the global loaded counter: + this._progress.loaded += loaded - data._progress.loaded; + this._progress.bitrate = this._bitrateTimer.getBitrate(now, this._progress.loaded, data.bitrateInterval); + data._progress.loaded = data.loaded = loaded; + data._progress.bitrate = data.bitrate = data._bitrateTimer.getBitrate(now, loaded, data.bitrateInterval); + // Trigger a custom progress event with a total data property set + // to the file size(s) of the current upload and a loaded data + // property calculated accordingly: + this._trigger('progress', $.Event('progress', { + delegatedEvent: e + }), data); + // Trigger a global progress event for all current file uploads, + // including ajax calls queued for sequential file uploads: + this._trigger('progressall', $.Event('progressall', { + delegatedEvent: e + }), this._progress); + } + }, + _initProgressListener: function _initProgressListener(options) { + var that = this, + xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr(); + // Access to the native XHR object is required to add event listeners + // for the upload progress event: + if (xhr.upload) { + $(xhr.upload).on('progress', function (e) { + var oe = e.originalEvent; + // Make sure the progress event properties get copied over: + e.lengthComputable = oe.lengthComputable; + e.loaded = oe.loaded; + e.total = oe.total; + that._onProgress(e, options); + }); + options.xhr = function () { + return xhr; + }; + } + }, + _deinitProgressListener: function _deinitProgressListener(options) { + var xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr(); + if (xhr.upload) { + $(xhr.upload).off('progress'); + } + }, + _isInstanceOf: function _isInstanceOf(type, obj) { + // Cross-frame instanceof check + return Object.prototype.toString.call(obj) === '[object ' + type + ']'; + }, + _getUniqueFilename: function _getUniqueFilename(name, map) { + // eslint-disable-next-line no-param-reassign + name = String(name); + if (map[name]) { + // eslint-disable-next-line no-param-reassign + name = name.replace(/(?: \(([\d]+)\))?(\.[^.]+)?$/, function (_, p1, p2) { + var index = p1 ? Number(p1) + 1 : 1; + var ext = p2 || ''; + return ' (' + index + ')' + ext; + }); + return this._getUniqueFilename(name, map); + } + map[name] = true; + return name; + }, + _initXHRData: function _initXHRData(options) { + var that = this, + formData, + file = options.files[0], + // Ignore non-multipart setting if not supported: + multipart = options.multipart || !$.support.xhrFileUpload, + paramName = $.type(options.paramName) === 'array' ? options.paramName[0] : options.paramName; + options.headers = $.extend({}, options.headers); + if (options.contentRange) { + options.headers['Content-Range'] = options.contentRange; + } + if (!multipart || options.blob || !this._isInstanceOf('File', file)) { + options.headers['Content-Disposition'] = 'attachment; filename="' + encodeURI(file.uploadName || file.name) + '"'; + } + if (!multipart) { + options.contentType = file.type || 'application/octet-stream'; + options.data = options.blob || file; + } else if ($.support.xhrFormDataFileUpload) { + if (options.postMessage) { + // window.postMessage does not allow sending FormData + // objects, so we just add the File/Blob objects to + // the formData array and let the postMessage window + // create the FormData object out of this array: + formData = this._getFormData(options); + if (options.blob) { + formData.push({ + name: paramName, + value: options.blob }); - }, - selectAll: function selectAll() { - this.selectedMedias = []; - for (var i = 0; i < this.filteredMediaItems.length; i++) { - this.selectedMedias.push(this.filteredMediaItems[i]); - } - }, - unSelectAll: function unSelectAll() { - this.selectedMedias = []; - }, - invertSelection: function invertSelection() { - var temp = []; - for (var i = 0; i < this.filteredMediaItems.length; i++) { - if (this.isMediaSelected(this.filteredMediaItems[i]) == false) { - temp.push(this.filteredMediaItems[i]); - } - } - this.selectedMedias = temp; - }, - toggleSelectionOfMedia: function toggleSelectionOfMedia(media) { - if (this.isMediaSelected(media) == true) { - this.selectedMedias.splice(this.selectedMedias.indexOf(media), 1); - } else { - this.selectedMedias.push(media); - } - }, - isMediaSelected: function isMediaSelected(media) { - var result = this.selectedMedias.some(function (element, index, array) { - return element.url.toLowerCase() === media.url.toLowerCase(); + } else { + $.each(options.files, function (index, file) { + formData.push({ + name: $.type(options.paramName) === 'array' && options.paramName[index] || paramName, + value: file + }); }); - return result; - }, - deleteFolder: function deleteFolder() { - var folder = this.selectedFolder; - var self = this; - // The root folder can't be deleted - if (folder == this.root.model) { - return; - } - confirmDialog(_objectSpread(_objectSpread({}, $("#deleteFolder").data()), {}, { - callback: function callback(resp) { - if (resp) { - $.ajax({ - url: $('#deleteFolderUrl').val() + "?path=" + encodeURIComponent(folder.path), - method: 'POST', - data: { - __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val() - }, - success: function success(data) { - bus.$emit('deleteFolder', folder); - }, - error: function error(_error2) { - console.error(_error2.responseText); - } - }); + } + } else { + if (that._isInstanceOf('FormData', options.formData)) { + formData = options.formData; + } else { + formData = new FormData(); + $.each(this._getFormData(options), function (index, field) { + formData.append(field.name, field.value); + }); + } + if (options.blob) { + formData.append(paramName, options.blob, file.uploadName || file.name); + } else { + $.each(options.files, function (index, file) { + // This check allows the tests to run with + // dummy objects: + if (that._isInstanceOf('File', file) || that._isInstanceOf('Blob', file)) { + var fileName = file.uploadName || file.name; + if (options.uniqueFilenames) { + fileName = that._getUniqueFilename(fileName, options.uniqueFilenames); } + formData.append($.type(options.paramName) === 'array' && options.paramName[index] || paramName, file, fileName); } - })); - }, - createFolder: function createFolder() { - $('#createFolderModal-errors').empty(); - var modal = bootstrap.Modal.getOrCreateInstance($('#createFolderModal')); - modal.show(); - $('#createFolderModal .modal-body input').val('').focus(); - }, - renameMedia: function renameMedia(media) { - $('#renameMediaModal-errors').empty(); - var modal = bootstrap.Modal.getOrCreateInstance($('#renameMediaModal')); - modal.show(); - $('#old-item-name').val(media.name); - $('#renameMediaModal .modal-body input').val(media.name).focus(); - }, - selectAndDeleteMedia: function selectAndDeleteMedia(media) { - this.deleteMedia(); - }, - deleteMediaList: function deleteMediaList() { - var mediaList = this.selectedMedias; - var self = this; - if (mediaList.length < 1) { - return; - } - confirmDialog(_objectSpread(_objectSpread({}, $("#deleteMedia").data()), {}, { - callback: function callback(resp) { - if (resp) { - var paths = []; - for (var i = 0; i < mediaList.length; i++) { - paths.push(mediaList[i].mediaPath); - } - $.ajax({ - url: $('#deleteMediaListUrl').val(), - method: 'POST', - data: { - __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val(), - paths: paths - }, - success: function success(data) { - for (var i = 0; i < self.selectedMedias.length; i++) { - var index = self.mediaItems && self.mediaItems.indexOf(self.selectedMedias[i]); - if (index > -1) { - self.mediaItems.splice(index, 1); - bus.$emit('mediaDeleted', self.selectedMedias[i]); - } - } - self.selectedMedias = []; - }, - error: function error(_error3) { - console.error(_error3.responseText); - } - }); - } - } - })); - }, - deleteMediaItem: function deleteMediaItem(media) { - var self = this; - if (!media) { - return; - } - confirmDialog(_objectSpread(_objectSpread({}, $("#deleteMedia").data()), {}, { - callback: function callback(resp) { - if (resp) { - $.ajax({ - url: $('#deleteMediaUrl').val() + "?path=" + encodeURIComponent(media.mediaPath), - method: 'POST', - data: { - __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val() - }, - success: function success(data) { - var index = self.mediaItems && self.mediaItems.indexOf(media); - if (index > -1) { - self.mediaItems.splice(index, 1); - bus.$emit('mediaDeleted', media); - } - //self.selectedMedia = null; - }, - - error: function error(_error4) { - console.error(_error4.responseText); - } - }); - } - } - })); - }, - handleDragStart: function handleDragStart(media, e) { - // first part of move media to folder: - // prepare the data that will be handled by the folder component on drop event - var mediaNames = []; - this.selectedMedias.forEach(function (item) { - mediaNames.push(item.name); }); - - // in case the user drags an unselected item, we select it first - if (this.isMediaSelected(media) == false) { - mediaNames.push(media.name); - this.selectedMedias.push(media); - } - e.dataTransfer.setData('mediaNames', JSON.stringify(mediaNames)); - e.dataTransfer.setData('sourceFolder', this.selectedFolder.path); - e.dataTransfer.setDragImage(this.dragDropThumbnail, 10, 10); - e.dataTransfer.effectAllowed = 'move'; - }, - handleScrollWhileDrag: function handleScrollWhileDrag(e) { - if (e.clientY < 150) { - window.scrollBy(0, -10); - } - if (e.clientY > window.innerHeight - 100) { - window.scrollBy(0, 10); - } - }, - changeSort: function changeSort(newSort) { - if (this.sortBy == newSort) { - this.sortAsc = !this.sortAsc; - } else { - this.sortAsc = true; - this.sortBy = newSort; - } } } - }); - $('#create-folder-name').keypress(function (e) { - var key = e.which; - if (key == 13) { - // the enter key code - $('#modalFooterOk').click(); - return false; + options.data = formData; + } + // Blob reference is not needed anymore, free memory: + options.blob = null; + }, + _initIframeSettings: function _initIframeSettings(options) { + var targetHost = $('').prop('href', options.url).prop('host'); + // Setting the dataType to iframe enables the iframe transport: + options.dataType = 'iframe ' + (options.dataType || ''); + // The iframe transport accepts a serialized array as form data: + options.formData = this._getFormData(options); + // Add redirect url to form data on cross-domain uploads: + if (options.redirect && targetHost && targetHost !== location.host) { + options.formData.push({ + name: options.redirectParamName || 'redirect', + value: options.redirect + }); + } + }, + _initDataSettings: function _initDataSettings(options) { + if (this._isXHRUpload(options)) { + if (!this._chunkedUpload(options, true)) { + if (!options.data) { + this._initXHRData(options); + } + this._initProgressListener(options); } - }); - $('#modalFooterOk').on('click', function (e) { - var name = $('#create-folder-name').val(); - if (name === "") { - return; + if (options.postMessage) { + // Setting the dataType to postmessage enables the + // postMessage transport: + options.dataType = 'postmessage ' + (options.dataType || ''); } - $.ajax({ - url: $('#createFolderUrl').val() + "?path=" + encodeURIComponent(mediaApp.selectedFolder.path) + "&name=" + encodeURIComponent(name), - method: 'POST', - data: { - __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val() - }, - success: function success(data) { - bus.$emit('addFolder', mediaApp.selectedFolder, data); - var modal = bootstrap.Modal.getOrCreateInstance($('#createFolderModal')); - modal.hide(); - }, - error: function error(_error5) { - $('#createFolderModal-errors').empty(); - var errorMessage = JSON.parse(_error5.responseText).value; - $('').text(errorMessage).appendTo($('#createFolderModal-errors')); + } else { + this._initIframeSettings(options); + } + }, + _getParamName: function _getParamName(options) { + var fileInput = $(options.fileInput), + paramName = options.paramName; + if (!paramName) { + paramName = []; + fileInput.each(function () { + var input = $(this), + name = input.prop('name') || 'files[]', + i = (input.prop('files') || [1]).length; + while (i) { + paramName.push(name); + i -= 1; } }); - }); - $('#renameMediaModalFooterOk').on('click', function (e) { - var newName = $('#new-item-name').val(); - var oldName = $('#old-item-name').val(); - if (newName === "") { - return; - } - var currentFolder = mediaApp.selectedFolder.path + "/"; - if (currentFolder === "/") { - currentFolder = ""; + if (!paramName.length) { + paramName = [fileInput.prop('name') || 'files[]']; } - var newPath = currentFolder + newName; - var oldPath = currentFolder + oldName; - if (newPath.toLowerCase() === oldPath.toLowerCase()) { - var modal = bootstrap.Modal.getOrCreateInstance($('#renameMediaModal')); - modal.hide(); - return; + } else if (!$.isArray(paramName)) { + paramName = [paramName]; + } + return paramName; + }, + _initFormSettings: function _initFormSettings(options) { + // Retrieve missing options from the input field and the + // associated form, if available: + if (!options.form || !options.form.length) { + options.form = $(options.fileInput.prop('form')); + // If the given file input doesn't have an associated form, + // use the default widget file input's form: + if (!options.form.length) { + options.form = $(this.options.fileInput.prop('form')); } - $.ajax({ - url: $('#renameMediaUrl').val() + "?oldPath=" + encodeURIComponent(oldPath) + "&newPath=" + encodeURIComponent(newPath), - method: 'POST', - data: { - __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val() - }, - success: function success(data) { - var modal = bootstrap.Modal.getOrCreateInstance($('#renameMediaModal')); - modal.hide(); - bus.$emit('mediaRenamed', newName, newPath, oldPath, data.newUrl); - }, - error: function error(_error6) { - $('#renameMediaModal-errors').empty(); - var errorMessage = JSON.parse(_error6.responseText).value; - $('').text(errorMessage).appendTo($('#renameMediaModal-errors')); - } - }); - }); - if (displayMediaApplication) { - document.getElementById('mediaApp').style.display = ""; } - $(document).trigger('mediaApp:ready'); + options.paramName = this._getParamName(options); + if (!options.url) { + options.url = options.form.prop('action') || location.href; + } + // The HTTP request method must be "POST" or "PUT": + options.type = (options.type || $.type(options.form.prop('method')) === 'string' && options.form.prop('method') || '').toUpperCase(); + if (options.type !== 'POST' && options.type !== 'PUT' && options.type !== 'PATCH') { + options.type = 'POST'; + } + if (!options.formAcceptCharset) { + options.formAcceptCharset = options.form.attr('accept-charset'); + } }, - error: function error(_error7) { - console.error(_error7.responseText); - } - }); -} -$(document).on('mediaApp:ready', function () { - var chunkedFileUploadId = randomUUID(); - $('#fileupload').fileupload({ - dropZone: $('#mediaApp'), - limitConcurrentUploads: 20, - dataType: 'json', - url: $('#uploadFiles').val(), - maxChunkSize: Number($('#maxUploadChunkSize').val() || 0), - formData: function formData() { - var antiForgeryToken = $("input[name=__RequestVerificationToken]").val(); - return [{ - name: 'path', - value: mediaApp.selectedFolder.path - }, { - name: '__RequestVerificationToken', - value: antiForgeryToken - }, { - name: '__chunkedFileUploadId', - value: chunkedFileUploadId - }]; - }, - done: function done(e, data) { - $.each(data.result.files, function (index, file) { - if (!file.error) { - mediaApp.mediaItems.push(file); - } - }); - } - }).on('fileuploadchunkbeforesend', function (e, options) { - var file = options.files[0]; - // Here we replace the blob with a File object to ensure the file name and others are preserved for the backend. - options.blob = new File([options.blob], file.name, { - type: file.type, - lastModified: file.lastModified - }); - }); -}); -$(document).bind('dragover', function (e) { - var dt = e.originalEvent.dataTransfer; - if (dt.types && (dt.types.indexOf ? dt.types.indexOf('Files') != -1 : dt.types.contains('Files'))) { - var dropZone = $('#customdropzone'), - timeout = window.dropZoneTimeout; - if (timeout) { - clearTimeout(timeout); - } else { - dropZone.addClass('in'); - } - var hoveredDropZone = $(e.target).closest(dropZone); - window.dropZoneTimeout = setTimeout(function () { - window.dropZoneTimeout = null; - dropZone.removeClass('in'); - }, 100); - } -}); -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } -function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } -function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } -// component -Vue.component('folder', { - template: "\n
  • \n \n
      \n \n \n
    \n
  • \n "), - props: { - model: Object, - selectedInMediaApp: Object, - level: Number - }, - data: function data() { - return { - open: false, - children: null, - // not initialized state (for lazy-loading) - parent: null, - isHovered: false, - padding: 0 - }; - }, - computed: { - empty: function empty() { - return !this.children || this.children.length == 0; - }, - isSelected: function isSelected() { - return this.selectedInMediaApp.name == this.model.name && this.selectedInMediaApp.path == this.model.path; + _getAJAXSettings: function _getAJAXSettings(data) { + var options = $.extend({}, this.options, data); + this._initFormSettings(options); + this._initDataSettings(options); + return options; }, - isRoot: function isRoot() { - return this.model.path === ''; - } - }, - mounted: function mounted() { - if (this.isRoot == false && this.isAncestorOfSelectedFolder()) { - this.toggle(); - } - this.padding = this.level < 3 ? 16 : 16 + this.level * 8; - }, - created: function created() { - var self = this; - bus.$on('deleteFolder', function (folder) { - if (self.children) { - var index = self.children && self.children.indexOf(folder); - if (index > -1) { - self.children.splice(index, 1); - bus.$emit('folderDeleted'); - } - } - }); - bus.$on('addFolder', function (target, folder) { - if (self.model == target) { - if (self.children !== null) { - self.children.push(folder); - } - folder.parent = self.model; - bus.$emit('folderAdded', folder); + // jQuery 1.6 doesn't provide .state(), + // while jQuery 1.8+ removed .isRejected() and .isResolved(): + _getDeferredState: function _getDeferredState(deferred) { + if (deferred.state) { + return deferred.state(); } - }); - }, - methods: { - isAncestorOfSelectedFolder: function isAncestorOfSelectedFolder() { - parentFolder = mediaApp.selectedFolder; - while (parentFolder) { - if (parentFolder.path == this.model.path) { - return true; - } - parentFolder = parentFolder.parent; + if (deferred.isResolved()) { + return 'resolved'; } - return false; - }, - toggle: function toggle() { - this.open = !this.open; - if (this.open && !this.children) { - this.loadChildren(); + if (deferred.isRejected()) { + return 'rejected'; } + return 'pending'; }, - select: function select() { - bus.$emit('folderSelected', this.model); - this.loadChildren(); - }, - createFolder: function createFolder() { - bus.$emit('createFolderRequested'); - }, - deleteFolder: function deleteFolder() { - bus.$emit('deleteFolderRequested'); + // Maps jqXHR callbacks to the equivalent + // methods of the given Promise object: + _enhancePromise: function _enhancePromise(promise) { + promise.success = promise.done; + promise.error = promise.fail; + promise.complete = promise.always; + return promise; }, - loadChildren: function loadChildren() { - var self = this; - if (this.open == false) { - this.open = true; + // Creates and returns a Promise object enhanced with + // the jqXHR methods abort, success, error and complete: + _getXHRPromise: function _getXHRPromise(resolveOrReject, context, args) { + var dfd = $.Deferred(), + promise = dfd.promise(); + // eslint-disable-next-line no-param-reassign + context = context || this.options.context || promise; + if (resolveOrReject === true) { + dfd.resolveWith(context, args); + } else if (resolveOrReject === false) { + dfd.rejectWith(context, args); } - $.ajax({ - url: $('#getFoldersUrl').val() + "?path=" + encodeURIComponent(self.model.path), - method: 'GET', - success: function success(data) { - self.children = data; - self.children.forEach(function (c) { - c.parent = self.model; - }); - }, - error: function error(_error) { - emtpy = false; - console.error(_error.responseText); - } - }); + promise.abort = dfd.promise; + return this._enhancePromise(promise); }, - handleDragOver: function handleDragOver(e) { - this.isHovered = true; + // Adds convenience methods to the data callback argument: + _addConvenienceMethods: function _addConvenienceMethods(e, data) { + var that = this, + getPromise = function getPromise(args) { + return $.Deferred().resolveWith(that, args).promise(); + }; + data.process = function (resolveFunc, rejectFunc) { + if (resolveFunc || rejectFunc) { + data._processQueue = this._processQueue = (this._processQueue || getPromise([this]))[that._promisePipe](function () { + if (data.errorThrown) { + return $.Deferred().rejectWith(that, [data]).promise(); + } + return getPromise(arguments); + })[that._promisePipe](resolveFunc, rejectFunc); + } + return this._processQueue || getPromise([this]); + }; + data.submit = function () { + if (this.state() !== 'pending') { + data.jqXHR = this.jqXHR = that._trigger('submit', $.Event('submit', { + delegatedEvent: e + }), this) !== false && that._onSend(e, this); + } + return this.jqXHR || that._getXHRPromise(); + }; + data.abort = function () { + if (this.jqXHR) { + return this.jqXHR.abort(); + } + this.errorThrown = 'abort'; + that._trigger('fail', null, this); + return that._getXHRPromise(false); + }; + data.state = function () { + if (this.jqXHR) { + return that._getDeferredState(this.jqXHR); + } + if (this._processQueue) { + return that._getDeferredState(this._processQueue); + } + }; + data.processing = function () { + return !this.jqXHR && this._processQueue && that._getDeferredState(this._processQueue) === 'pending'; + }; + data.progress = function () { + return this._progress; + }; + data.response = function () { + return this._response; + }; }, - handleDragLeave: function handleDragLeave(e) { - this.isHovered = false; + // Parses the Range header from the server response + // and returns the uploaded bytes: + _getUploadedBytes: function _getUploadedBytes(jqXHR) { + var range = jqXHR.getResponseHeader('Range'), + parts = range && range.split('-'), + upperBytesPos = parts && parts.length > 1 && parseInt(parts[1], 10); + return upperBytesPos && upperBytesPos + 1; }, - moveMediaToFolder: function moveMediaToFolder(folder, e) { - var self = this; - self.isHovered = false; - var mediaNames = JSON.parse(e.dataTransfer.getData('mediaNames')); - if (mediaNames.length < 1) { - return; - } - var sourceFolder = e.dataTransfer.getData('sourceFolder'); - var targetFolder = folder.path; - if (sourceFolder === '') { - sourceFolder = 'root'; - } - if (targetFolder === '') { - targetFolder = 'root'; - } - if (sourceFolder === targetFolder) { - alert($('#sameFolderMessage').val()); - return; + // Uploads a file in multiple, sequential requests + // by splitting the file up in multiple blob chunks. + // If the second parameter is true, only tests if the file + // should be uploaded in chunks, but does not invoke any + // upload requests: + _chunkedUpload: function _chunkedUpload(options, testOnly) { + options.uploadedBytes = options.uploadedBytes || 0; + var that = this, + file = options.files[0], + fs = file.size, + ub = options.uploadedBytes, + mcs = options.maxChunkSize || fs, + slice = this._blobSlice, + dfd = $.Deferred(), + promise = dfd.promise(), + jqXHR, + _upload; + if (!(this._isXHRUpload(options) && slice && (ub || ($.type(mcs) === 'function' ? mcs(options) : mcs) < fs)) || options.data) { + return false; } - confirmDialog(_objectSpread(_objectSpread({}, $("#moveMedia").data()), {}, { - callback: function callback(resp) { - if (resp) { - $.ajax({ - url: $('#moveMediaListUrl').val(), - method: 'POST', - data: { - __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val(), - mediaNames: mediaNames, - sourceFolder: sourceFolder, - targetFolder: targetFolder - }, - success: function success() { - bus.$emit('mediaListMoved'); // MediaApp will listen to this, and then it will reload page so the moved medias won't be there anymore - }, - - error: function error(_error2) { - console.error(_error2.responseText); - bus.$emit('mediaListMoved', _error2.responseText); - } - }); + if (testOnly) { + return true; + } + if (ub >= fs) { + file.error = options.i18n('uploadedBytes'); + return this._getXHRPromise(false, options.context, [null, 'error', file.error]); + } + // The chunk upload method: + _upload = function upload() { + // Clone the options object for each chunk upload: + var o = $.extend({}, options), + currentLoaded = o._progress.loaded; + o.blob = slice.call(file, ub, ub + ($.type(mcs) === 'function' ? mcs(o) : mcs), file.type); + // Store the current chunk size, as the blob itself + // will be dereferenced after data processing: + o.chunkSize = o.blob.size; + // Expose the chunk bytes position range: + o.contentRange = 'bytes ' + ub + '-' + (ub + o.chunkSize - 1) + '/' + fs; + // Trigger chunkbeforesend to allow form data to be updated for this chunk + that._trigger('chunkbeforesend', null, o); + // Process the upload data (the blob and potential form data): + that._initXHRData(o); + // Add progress listeners for this chunk upload: + that._initProgressListener(o); + jqXHR = (that._trigger('chunksend', null, o) !== false && $.ajax(o) || that._getXHRPromise(false, o.context)).done(function (result, textStatus, jqXHR) { + ub = that._getUploadedBytes(jqXHR) || ub + o.chunkSize; + // Create a progress event if no final progress event + // with loaded equaling total has been triggered + // for this chunk: + if (currentLoaded + o.chunkSize - o._progress.loaded) { + that._onProgress($.Event('progress', { + lengthComputable: true, + loaded: ub - o.uploadedBytes, + total: ub - o.uploadedBytes + }), o); } - } - })); - } - } -}); -// https://github.com/spatie/font-awesome-filetypes - -var faIcons = { - image: 'fa-regular fa-image', - pdf: 'fa-regular fa-file-pdf', - word: 'fa-regular fa-file-word', - powerpoint: 'fa-regular fa-file-powerpoint', - excel: 'fa-regular fa-file-excel', - csv: 'fa-regular fa-file', - audio: 'fa-regular fa-file-audio', - video: 'fa-regular fa-file-video', - archive: 'fa-regular fa-file-zipper', - code: 'fa-regular fa-file-code', - text: 'fa-regular fa-file-lines', - file: 'fa-regular fa-file' -}; -var faThumbnails = { - gif: faIcons.image, - jpeg: faIcons.image, - jpg: faIcons.image, - png: faIcons.image, - pdf: faIcons.pdf, - doc: faIcons.word, - docx: faIcons.word, - ppt: faIcons.powerpoint, - pptx: faIcons.powerpoint, - xls: faIcons.excel, - xlsx: faIcons.excel, - csv: faIcons.csv, - aac: faIcons.audio, - mp3: faIcons.audio, - ogg: faIcons.audio, - avi: faIcons.video, - flv: faIcons.video, - mkv: faIcons.video, - mp4: faIcons.video, - webm: faIcons.video, - gz: faIcons.archive, - zip: faIcons.archive, - css: faIcons.code, - html: faIcons.code, - js: faIcons.code, - txt: faIcons.text -}; -function getClassNameForExtension(extension) { - return faThumbnails[extension.toLowerCase()] || faIcons.file; -} -function getExtensionForFilename(filename) { - return filename.slice((filename.lastIndexOf('.') - 1 >>> 0) + 2); -} -function getClassNameForFilename(filename) { - return getClassNameForExtension(getExtensionForFilename(filename)); -} -// component -Vue.component('media-items-grid', { - template: "\n
      \n
    1. \n
      \n \n \n
      \n
      \n \n \n \n {{ media.name }}\n
      \n
    2. \n
    \n ", - data: function data() { - return { - T: {} - }; - }, - props: { - filteredMediaItems: Array, - selectedMedias: Array, - thumbSize: Number - }, - created: function created() { - var self = this; - // retrieving localized strings from view - self.T.editButton = $('#t-edit-button').val(); - self.T.deleteButton = $('#t-delete-button').val(); - }, - methods: { - isMediaSelected: function isMediaSelected(media) { - var result = this.selectedMedias.some(function (element, index, array) { - return element.url.toLowerCase() === media.url.toLowerCase(); - }); - return result; - }, - buildMediaUrl: function buildMediaUrl(url, thumbSize) { - return url + (url.indexOf('?') == -1 ? '?' : '&') + 'width=' + thumbSize + '&height=' + thumbSize; + options.uploadedBytes = o.uploadedBytes = ub; + o.result = result; + o.textStatus = textStatus; + o.jqXHR = jqXHR; + that._trigger('chunkdone', null, o); + that._trigger('chunkalways', null, o); + if (ub < fs) { + // File upload not yet complete, + // continue with the next chunk: + _upload(); + } else { + dfd.resolveWith(o.context, [result, textStatus, jqXHR]); + } + }).fail(function (jqXHR, textStatus, errorThrown) { + o.jqXHR = jqXHR; + o.textStatus = textStatus; + o.errorThrown = errorThrown; + that._trigger('chunkfail', null, o); + that._trigger('chunkalways', null, o); + dfd.rejectWith(o.context, [jqXHR, textStatus, errorThrown]); + }).always(function () { + that._deinitProgressListener(o); + }); + }; + this._enhancePromise(promise); + promise.abort = function () { + return jqXHR.abort(); + }; + _upload(); + return promise; }, - toggleSelectionOfMedia: function toggleSelectionOfMedia(media) { - bus.$emit('mediaToggleRequested', media); + _beforeSend: function _beforeSend(e, data) { + if (this._active === 0) { + // the start callback is triggered when an upload starts + // and no other uploads are currently running, + // equivalent to the global ajaxStart event: + this._trigger('start'); + // Set timer for global bitrate progress calculation: + this._bitrateTimer = new this._BitrateTimer(); + // Reset the global progress values: + this._progress.loaded = this._progress.total = 0; + this._progress.bitrate = 0; + } + // Make sure the container objects for the .response() and + // .progress() methods on the data object are available + // and reset to their initial state: + this._initResponseObject(data); + this._initProgressObject(data); + data._progress.loaded = data.loaded = data.uploadedBytes || 0; + data._progress.total = data.total = this._getTotal(data.files) || 1; + data._progress.bitrate = data.bitrate = 0; + this._active += 1; + // Initialize the global progress values: + this._progress.loaded += data.loaded; + this._progress.total += data.total; }, - renameMedia: function renameMedia(media) { - bus.$emit('renameMediaRequested', media); + _onDone: function _onDone(result, textStatus, jqXHR, options) { + var total = options._progress.total, + response = options._response; + if (options._progress.loaded < total) { + // Create a progress event if no final progress event + // with loaded equaling total has been triggered: + this._onProgress($.Event('progress', { + lengthComputable: true, + loaded: total, + total: total + }), options); + } + response.result = options.result = result; + response.textStatus = options.textStatus = textStatus; + response.jqXHR = options.jqXHR = jqXHR; + this._trigger('done', null, options); }, - deleteMedia: function deleteMedia(media) { - bus.$emit('deleteMediaRequested', media); + _onFail: function _onFail(jqXHR, textStatus, errorThrown, options) { + var response = options._response; + if (options.recalculateProgress) { + // Remove the failed (error or abort) file upload from + // the global progress calculation: + this._progress.loaded -= options._progress.loaded; + this._progress.total -= options._progress.total; + } + response.jqXHR = options.jqXHR = jqXHR; + response.textStatus = options.textStatus = textStatus; + response.errorThrown = options.errorThrown = errorThrown; + this._trigger('fail', null, options); }, - dragStart: function dragStart(media, e) { - bus.$emit('mediaDragStartRequested', media, e); + _onAlways: function _onAlways(jqXHRorResult, textStatus, jqXHRorError, options) { + // jqXHRorResult, textStatus and jqXHRorError are added to the + // options object via done and fail callbacks + this._trigger('always', null, options); }, - getfontAwesomeClassNameForFileName: function getfontAwesomeClassNameForFilename(filename, thumbsize) { - return getClassNameForFilename(filename) + ' ' + thumbsize; - } - } -}); -// component -Vue.component('media-items-table', { - template: "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {{ T.imageHeader }}\n {{ T.nameHeader }}\n \n \n {{ T.lastModifyHeader }} \n \n \n \n {{ T.sizeHeader }}\n \n \n \n \n {{ T.typeHeader }}\n \n \n
    \n
    \n \n \n
    \n
    \n \n \n
    {{ printDateTime(media.lastModify) }}
    \n
    \n
    {{ isNaN(media.size)? 0 : Math.round(media.size / 1024) }} KB
    \n
    \n
    {{ media.mime }}
    \n
    \n ", - data: function data() { - return { - T: {} - }; - }, - props: { - sortBy: String, - sortAsc: Boolean, - filteredMediaItems: Array, - selectedMedias: Array, - thumbSize: Number - }, - created: function created() { - var self = this; - self.T.imageHeader = $('#t-image-header').val(); - self.T.nameHeader = $('#t-name-header').val(); - self.T.lastModifyHeader = $('#t-lastModify-header').val(); - self.T.sizeHeader = $('#t-size-header').val(); - self.T.typeHeader = $('#t-type-header').val(); - self.T.editButton = $('#t-edit-button').val(); - self.T.deleteButton = $('#t-delete-button').val(); - self.T.viewButton = $('#t-view-button').val(); - }, - methods: { - isMediaSelected: function isMediaSelected(media) { - var result = this.selectedMedias.some(function (element, index, array) { - return element.url.toLowerCase() === media.url.toLowerCase(); + _onSend: function _onSend(e, data) { + if (!data.submit) { + this._addConvenienceMethods(e, data); + } + var that = this, + jqXHR, + aborted, + slot, + pipe, + options = that._getAJAXSettings(data), + send = function send() { + that._sending += 1; + // Set timer for bitrate progress calculation: + options._bitrateTimer = new that._BitrateTimer(); + jqXHR = jqXHR || ((aborted || that._trigger('send', $.Event('send', { + delegatedEvent: e + }), options) === false) && that._getXHRPromise(false, options.context, aborted) || that._chunkedUpload(options) || $.ajax(options)).done(function (result, textStatus, jqXHR) { + that._onDone(result, textStatus, jqXHR, options); + }).fail(function (jqXHR, textStatus, errorThrown) { + that._onFail(jqXHR, textStatus, errorThrown, options); + }).always(function (jqXHRorResult, textStatus, jqXHRorError) { + that._deinitProgressListener(options); + that._onAlways(jqXHRorResult, textStatus, jqXHRorError, options); + that._sending -= 1; + that._active -= 1; + if (options.limitConcurrentUploads && options.limitConcurrentUploads > that._sending) { + // Start the next queued upload, + // that has not been aborted: + var nextSlot = that._slots.shift(); + while (nextSlot) { + if (that._getDeferredState(nextSlot) === 'pending') { + nextSlot.resolve(); + break; + } + nextSlot = that._slots.shift(); + } + } + if (that._active === 0) { + // The stop callback is triggered when all uploads have + // been completed, equivalent to the global ajaxStop event: + that._trigger('stop'); + } + }); + return jqXHR; + }; + this._beforeSend(e, options); + if (this.options.sequentialUploads || this.options.limitConcurrentUploads && this.options.limitConcurrentUploads <= this._sending) { + if (this.options.limitConcurrentUploads > 1) { + slot = $.Deferred(); + this._slots.push(slot); + pipe = slot[that._promisePipe](send); + } else { + this._sequence = this._sequence[that._promisePipe](send, send); + pipe = this._sequence; + } + // Return the piped Promise object, enhanced with an abort method, + // which is delegated to the jqXHR object of the current upload, + // and jqXHR callbacks mapped to the equivalent Promise methods: + pipe.abort = function () { + aborted = [undefined, 'abort', 'abort']; + if (!jqXHR) { + if (slot) { + slot.rejectWith(options.context, aborted); + } + return send(); + } + return jqXHR.abort(); + }; + return this._enhancePromise(pipe); + } + return send(); + }, + _onAdd: function _onAdd(e, data) { + var that = this, + result = true, + options = $.extend({}, this.options, data), + files = data.files, + filesLength = files.length, + limit = options.limitMultiFileUploads, + limitSize = options.limitMultiFileUploadSize, + overhead = options.limitMultiFileUploadSizeOverhead, + batchSize = 0, + paramName = this._getParamName(options), + paramNameSet, + paramNameSlice, + fileSet, + i, + j = 0; + if (!filesLength) { + return false; + } + if (limitSize && files[0].size === undefined) { + limitSize = undefined; + } + if (!(options.singleFileUploads || limit || limitSize) || !this._isXHRUpload(options)) { + fileSet = [files]; + paramNameSet = [paramName]; + } else if (!(options.singleFileUploads || limitSize) && limit) { + fileSet = []; + paramNameSet = []; + for (i = 0; i < filesLength; i += limit) { + fileSet.push(files.slice(i, i + limit)); + paramNameSlice = paramName.slice(i, i + limit); + if (!paramNameSlice.length) { + paramNameSlice = paramName; + } + paramNameSet.push(paramNameSlice); + } + } else if (!options.singleFileUploads && limitSize) { + fileSet = []; + paramNameSet = []; + for (i = 0; i < filesLength; i = i + 1) { + batchSize += files[i].size + overhead; + if (i + 1 === filesLength || batchSize + files[i + 1].size + overhead > limitSize || limit && i + 1 - j >= limit) { + fileSet.push(files.slice(j, i + 1)); + paramNameSlice = paramName.slice(j, i + 1); + if (!paramNameSlice.length) { + paramNameSlice = paramName; + } + paramNameSet.push(paramNameSlice); + j = i + 1; + batchSize = 0; + } + } + } else { + paramNameSet = paramName; + } + data.originalFiles = files; + $.each(fileSet || files, function (index, element) { + var newData = $.extend({}, data); + newData.files = fileSet ? element : [element]; + newData.paramName = paramNameSet[index]; + that._initResponseObject(newData); + that._initProgressObject(newData); + that._addConvenienceMethods(e, newData); + result = that._trigger('add', $.Event('add', { + delegatedEvent: e + }), newData); + return result; }); return result; }, - buildMediaUrl: function buildMediaUrl(url, thumbSize) { - return url + (url.indexOf('?') == -1 ? '?' : '&') + 'width=' + thumbSize + '&height=' + thumbSize; - }, - changeSort: function changeSort(newSort) { - bus.$emit('sortChangeRequested', newSort); - }, - toggleSelectionOfMedia: function toggleSelectionOfMedia(media) { - bus.$emit('mediaToggleRequested', media); - }, - renameMedia: function renameMedia(media) { - bus.$emit('renameMediaRequested', media); - }, - deleteMedia: function deleteMedia(media) { - bus.$emit('deleteMediaRequested', media); - }, - dragStart: function dragStart(media, e) { - bus.$emit('mediaDragStartRequested', media, e); - }, - printDateTime: function printDateTime(datemillis) { - var d = new Date(datemillis); - return d.toLocaleString(); + _replaceFileInput: function _replaceFileInput(data) { + var input = data.fileInput, + inputClone = input.clone(true), + restoreFocus = input.is(document.activeElement); + // Add a reference for the new cloned file input to the data argument: + data.fileInputClone = inputClone; + $('
    ').append(inputClone)[0].reset(); + // Detaching allows to insert the fileInput on another form + // without losing the file input value: + input.after(inputClone).detach(); + // If the fileInput had focus before it was detached, + // restore focus to the inputClone. + if (restoreFocus) { + inputClone.trigger('focus'); + } + // Avoid memory leaks with the detached file input: + $.cleanData(input.off('remove')); + // Replace the original file input element in the fileInput + // elements set with the clone, which has been copied including + // event handlers: + this.options.fileInput = this.options.fileInput.map(function (i, el) { + if (el === input[0]) { + return inputClone[0]; + } + return el; + }); + // If the widget has been initialized on the file input itself, + // override this.element with the file input clone: + if (input[0] === this.element[0]) { + this.element = inputClone; + } }, - getfontAwesomeClassNameForFileName: function getfontAwesomeClassNameForFilename(filename, thumbsize) { - return getClassNameForFilename(filename) + ' ' + thumbsize; - } - } -}); -// This component receives a list of all the items, unpaged. -// As the user interacts with the pager, it raises events with the items in the current page. -// It's the parent's responsibility to listen for these events and display the received items -// component -Vue.component('pager', { - template: "\n
    \n \n \n
    \n ", - props: { - sourceItems: Array - }, - data: function data() { - return { - pageSize: 10, - pageSizeOptions: [10, 30, 50, 100], - current: 0, - T: {} - }; - }, - created: function created() { - var self = this; - - // retrieving localized strings from view - self.T.pagerFirstButton = $('#t-pager-first-button').val(); - self.T.pagerPreviousButton = $('#t-pager-previous-button').val(); - self.T.pagerNextButton = $('#t-pager-next-button').val(); - self.T.pagerLastButton = $('#t-pager-last-button').val(); - self.T.pagerPageSizeLabel = $('#t-pager-page-size-label').val(); - self.T.pagerPageLabel = $('#t-pager-page-label').val(); - self.T.pagerTotalLabel = $('#t-pager-total-label').val(); - }, - methods: { - next: function next() { - this.current = this.current + 1; - }, - previous: function previous() { - this.current = this.current - 1; + _handleFileTreeEntry: function _handleFileTreeEntry(entry, path) { + var that = this, + dfd = $.Deferred(), + entries = [], + dirReader, + errorHandler = function errorHandler(e) { + if (e && !e.entry) { + e.entry = entry; + } + // Since $.when returns immediately if one + // Deferred is rejected, we use resolve instead. + // This allows valid files and invalid items + // to be returned together in one set: + dfd.resolve([e]); + }, + successHandler = function successHandler(entries) { + that._handleFileTreeEntries(entries, path + entry.name + '/').done(function (files) { + dfd.resolve(files); + }).fail(errorHandler); + }, + readEntries = function readEntries() { + dirReader.readEntries(function (results) { + if (!results.length) { + successHandler(entries); + } else { + entries = entries.concat(results); + readEntries(); + } + }, errorHandler); + }; + // eslint-disable-next-line no-param-reassign + path = path || ''; + if (entry.isFile) { + if (entry._file) { + // Workaround for Chrome bug #149735 + entry._file.relativePath = path; + dfd.resolve(entry._file); + } else { + entry.file(function (file) { + file.relativePath = path; + dfd.resolve(file); + }, errorHandler); + } + } else if (entry.isDirectory) { + dirReader = entry.createReader(); + readEntries(); + } else { + // Return an empty list for file system items + // other than files or directories: + dfd.resolve([]); + } + return dfd.promise(); }, - goFirst: function goFirst() { - this.current = 0; + _handleFileTreeEntries: function _handleFileTreeEntries(entries, path) { + var that = this; + return $.when.apply($, $.map(entries, function (entry) { + return that._handleFileTreeEntry(entry, path); + }))[this._promisePipe](function () { + return Array.prototype.concat.apply([], arguments); + }); }, - goLast: function goLast() { - this.current = this.totalPages - 1; + _getDroppedFiles: function _getDroppedFiles(dataTransfer) { + // eslint-disable-next-line no-param-reassign + dataTransfer = dataTransfer || {}; + var items = dataTransfer.items; + if (items && items.length && (items[0].webkitGetAsEntry || items[0].getAsEntry)) { + return this._handleFileTreeEntries($.map(items, function (item) { + var entry; + if (item.webkitGetAsEntry) { + entry = item.webkitGetAsEntry(); + if (entry) { + // Workaround for Chrome bug #149735: + entry._file = item.getAsFile(); + } + return entry; + } + return item.getAsEntry(); + })); + } + return $.Deferred().resolve($.makeArray(dataTransfer.files)).promise(); }, - goTo: function goTo(targetPage) { - this.current = targetPage; - } - }, - computed: { - total: function total() { - return this.sourceItems ? this.sourceItems.length : 0; + _getSingleFileInputFiles: function _getSingleFileInputFiles(fileInput) { + // eslint-disable-next-line no-param-reassign + fileInput = $(fileInput); + var entries = fileInput.prop('entries'), + files, + value; + if (entries && entries.length) { + return this._handleFileTreeEntries(entries); + } + files = $.makeArray(fileInput.prop('files')); + if (!files.length) { + value = fileInput.prop('value'); + if (!value) { + return $.Deferred().resolve([]).promise(); + } + // If the files property is not available, the browser does not + // support the File API and we add a pseudo File object with + // the input value as name with path information removed: + files = [{ + name: value.replace(/^.*\\/, '') + }]; + } else if (files[0].name === undefined && files[0].fileName) { + // File normalization for Safari 4 and Firefox 3: + $.each(files, function (index, file) { + file.name = file.fileName; + file.size = file.fileSize; + }); + } + return $.Deferred().resolve(files).promise(); }, - totalPages: function totalPages() { - var pages = Math.ceil(this.total / this.pageSize); - return pages > 0 ? pages : 1; + _getFileInputFiles: function _getFileInputFiles(fileInput) { + if (!(fileInput instanceof $) || fileInput.length === 1) { + return this._getSingleFileInputFiles(fileInput); + } + return $.when.apply($, $.map(fileInput, this._getSingleFileInputFiles))[this._promisePipe](function () { + return Array.prototype.concat.apply([], arguments); + }); }, - isLastPage: function isLastPage() { - return this.current + 1 >= this.totalPages; + _onChange: function _onChange(e) { + var that = this, + data = { + fileInput: $(e.target), + form: $(e.target.form) + }; + this._getFileInputFiles(data.fileInput).always(function (files) { + data.files = files; + if (that.options.replaceFileInput) { + that._replaceFileInput(data); + } + if (that._trigger('change', $.Event('change', { + delegatedEvent: e + }), data) !== false) { + that._onAdd(e, data); + } + }); }, - isFirstPage: function isFirstPage() { - return this.current === 0; + _onPaste: function _onPaste(e) { + var items = e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.items, + data = { + files: [] + }; + if (items && items.length) { + $.each(items, function (index, item) { + var file = item.getAsFile && item.getAsFile(); + if (file) { + data.files.push(file); + } + }); + if (this._trigger('paste', $.Event('paste', { + delegatedEvent: e + }), data) !== false) { + this._onAdd(e, data); + } + } }, - canDoNext: function canDoNext() { - return !this.isLastPage; + _onDrop: function _onDrop(e) { + e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer; + var that = this, + dataTransfer = e.dataTransfer, + data = {}; + if (dataTransfer && dataTransfer.files && dataTransfer.files.length) { + e.preventDefault(); + this._getDroppedFiles(dataTransfer).always(function (files) { + data.files = files; + if (that._trigger('drop', $.Event('drop', { + delegatedEvent: e + }), data) !== false) { + that._onAdd(e, data); + } + }); + } }, - canDoPrev: function canDoPrev() { - return !this.isFirstPage; + _onDragOver: getDragHandler('dragover'), + _onDragEnter: getDragHandler('dragenter'), + _onDragLeave: getDragHandler('dragleave'), + _initEventHandlers: function _initEventHandlers() { + if (this._isXHRUpload(this.options)) { + this._on(this.options.dropZone, { + dragover: this._onDragOver, + drop: this._onDrop, + // event.preventDefault() on dragenter is required for IE10+: + dragenter: this._onDragEnter, + // dragleave is not required, but added for completeness: + dragleave: this._onDragLeave + }); + this._on(this.options.pasteZone, { + paste: this._onPaste + }); + } + if ($.support.fileInput) { + this._on(this.options.fileInput, { + change: this._onChange + }); + } }, - canDoFirst: function canDoFirst() { - return !this.isFirstPage; + _destroyEventHandlers: function _destroyEventHandlers() { + this._off(this.options.dropZone, 'dragenter dragleave dragover drop'); + this._off(this.options.pasteZone, 'paste'); + this._off(this.options.fileInput, 'change'); }, - canDoLast: function canDoLast() { - return !this.isLastPage; + _destroy: function _destroy() { + this._destroyEventHandlers(); }, - // this computed is only to have a central place where we detect changes and leverage Vue JS reactivity to raise our event. - // That event will be handled by the parent media app to display the items in the page. - // this logic will not run if the computed property is not used in the template. We use a dummy "data-computed-trigger" attribute for that. - itemsInCurrentPage: function itemsInCurrentPage() { - var start = this.pageSize * this.current; - var end = start + this.pageSize; - var result = this.sourceItems.slice(start, end); - bus.$emit('pagerEvent', result); - return result; + _setOption: function _setOption(key, value) { + var reinit = $.inArray(key, this._specialOptions) !== -1; + if (reinit) { + this._destroyEventHandlers(); + } + this._super(key, value); + if (reinit) { + this._initSpecialOptions(); + this._initEventHandlers(); + } }, - pageLinks: function pageLinks() { - var links = []; - links.push(this.current + 1); - - // Add 2 items before current - var beforeCurrent = this.current > 0 ? this.current : -1; - links.unshift(beforeCurrent); - var beforeBeforeCurrent = this.current > 1 ? this.current - 1 : -1; - links.unshift(beforeBeforeCurrent); - - // Add 2 items after current - var afterCurrent = this.totalPages - this.current > 1 ? this.current + 2 : -1; - links.push(afterCurrent); - var afterAfterCurrent = this.totalPages - this.current > 2 ? this.current + 3 : -1; - links.push(afterAfterCurrent); - return links; - } - }, - watch: { - sourceItems: function sourceItems() { - this.current = 0; // resetting current page after receiving a new list of unpaged items + _initSpecialOptions: function _initSpecialOptions() { + var options = this.options; + if (options.fileInput === undefined) { + options.fileInput = this.element.is('input[type="file"]') ? this.element : this.element.find('input[type="file"]'); + } else if (!(options.fileInput instanceof $)) { + options.fileInput = $(options.fileInput); + } + if (!(options.dropZone instanceof $)) { + options.dropZone = $(options.dropZone); + } + if (!(options.pasteZone instanceof $)) { + options.pasteZone = $(options.pasteZone); + } }, - - pageSize: function pageSize() { - this.current = 0; - } - } -}); -// component -Vue.component('sortIndicator', { - template: "\n
    \n \n \n
    \n ", - props: { - colname: String, - selectedcolname: String, - asc: Boolean - }, - computed: { - isActive: function isActive() { - return this.colname.toLowerCase() == this.selectedcolname.toLowerCase(); - } - } -}); -function initializeAttachedMediaField(el, idOfUploadButton, uploadAction, mediaItemUrl, allowMultiple, allowMediaText, allowAnchors, tempUploadFolder, maxUploadChunkSize) { - var target = $(document.getElementById($(el).data('for'))); - var initialPaths = target.data("init"); - var mediaFieldEditor = $(el); - var idprefix = mediaFieldEditor.attr("id"); - var mediaFieldApp; - mediaFieldApps.push(mediaFieldApp = new Vue({ - el: mediaFieldEditor.get(0), - data: { - mediaItems: [], - selectedMedia: null, - smallThumbs: false, - idPrefix: idprefix, - initialized: false, - allowMediaText: allowMediaText, - backupMediaText: '', - allowAnchors: allowAnchors, - backupAnchor: null, - mediaTextmodal: null, - anchoringModal: null + _getRegExp: function _getRegExp(str) { + var parts = str.split('/'), + modifiers = parts.pop(); + parts.shift(); + return new RegExp(parts.join('/'), modifiers); }, - created: function created() { - var self = this; - self.currentPrefs = JSON.parse(localStorage.getItem('mediaFieldPrefs')); + _isRegExpOption: function _isRegExpOption(key, value) { + return key !== 'url' && $.type(value) === 'string' && /^\/.*\/[igm]{0,3}$/.test(value); }, - computed: { - paths: { - get: function get() { - var mediaPaths = []; - if (!this.initialized) { - return JSON.stringify(initialPaths); + _initDataAttributes: function _initDataAttributes() { + var that = this, + options = this.options, + data = this.element.data(); + // Initialize options set via HTML5 data-attributes: + $.each(this.element[0].attributes, function (index, attr) { + var key = attr.name.toLowerCase(), + value; + if (/^data-/.test(key)) { + // Convert hyphen-ated key to camelCase: + key = key.slice(5).replace(/-[a-z]/g, function (str) { + return str.charAt(1).toUpperCase(); + }); + value = data[key]; + if (that._isRegExpOption(key, value)) { + value = that._getRegExp(value); } - this.mediaItems.forEach(function (x) { - if (x.mediaPath === 'not-found') { + options[key] = value; + } + }); + }, + _create: function _create() { + this._initDataAttributes(); + this._initSpecialOptions(); + this._slots = []; + this._sequence = this._getXHRPromise(true); + this._sending = this._active = 0; + this._initProgressObject(this); + this._initEventHandlers(); + }, + // This method is exposed to the widget API and allows to query + // the number of active uploads: + active: function active() { + return this._active; + }, + // This method is exposed to the widget API and allows to query + // the widget upload progress. + // It returns an object with loaded, total and bitrate properties + // for the running uploads: + progress: function progress() { + return this._progress; + }, + // This method is exposed to the widget API and allows adding files + // using the fileupload API. The data parameter accepts an object which + // must have a files property and can contain additional options: + // .fileupload('add', {files: filesList}); + add: function add(data) { + var that = this; + if (!data || this.options.disabled) { + return; + } + if (data.fileInput && !data.files) { + this._getFileInputFiles(data.fileInput).always(function (files) { + data.files = files; + that._onAdd(null, data); + }); + } else { + data.files = $.makeArray(data.files); + this._onAdd(null, data); + } + }, + // This method is exposed to the widget API and allows sending files + // using the fileupload API. The data parameter accepts an object which + // must have a files or fileInput property and can contain additional options: + // .fileupload('send', {files: filesList}); + // The method returns a Promise object for the file upload call. + send: function send(data) { + if (data && !this.options.disabled) { + if (data.fileInput && !data.files) { + var that = this, + dfd = $.Deferred(), + promise = dfd.promise(), + jqXHR, + aborted; + promise.abort = function () { + aborted = true; + if (jqXHR) { + return jqXHR.abort(); + } + dfd.reject(null, 'abort', 'abort'); + return promise; + }; + this._getFileInputFiles(data.fileInput).always(function (files) { + if (aborted) { return; } - mediaPaths.push({ - path: x.mediaPath, - isRemoved: x.isRemoved, - isNew: x.isNew, - mediaText: x.mediaText, - anchor: x.anchor, - attachedFileName: x.attachedFileName - }); - }); - return JSON.stringify(mediaPaths); - }, - set: function set(values) { - var self = this; - var mediaPaths = values || []; - var signal = $.Deferred(); - var items = []; - var length = 0; - mediaPaths.forEach(function (x, i) { - items.push({ - name: ' ' + x.path, - mime: '', - mediaPath: '', - anchor: x.anchor, - attachedFileName: x.attachedFileName - }); // don't remove the space. Something different is needed or it wont react when the real name arrives. - promise = $.when(signal).done(function () { - $.ajax({ - url: mediaItemUrl + "?path=" + encodeURIComponent(x.path), - method: 'GET', - success: function success(data) { - data.vuekey = data.name + i.toString(); // Because a unique key is required by Vue on v-for - data.mediaText = x.mediaText; // This value is not returned from the ajax call. - data.anchor = x.anchor; // This value is not returned from the ajax call. - data.attachedFileName = x.attachedFileName; // This value is not returned from the ajax call. - items.splice(i, 1, data); - if (items.length === ++length) { - items.forEach(function (x) { - self.mediaItems.push(x); - }); - self.initialized = true; - } - }, - error: function error(_error) { - console.log(JSON.stringify(_error)); - items.splice(i, 1, { - name: x.path, - mime: '', - mediaPath: 'not-found', - mediaText: '', - anchor: { - x: 0.5, - y: 0.5 - }, - attachedFileName: x.attachedFileName - }); - if (items.length === ++length) { - items.forEach(function (x) { - self.mediaItems.push(x); - }); - self.initialized = true; - } - } - }); + if (!files.length) { + dfd.reject(); + return; + } + data.files = files; + jqXHR = that._onSend(null, data); + jqXHR.then(function (result, textStatus, jqXHR) { + dfd.resolve(result, textStatus, jqXHR); + }, function (jqXHR, textStatus, errorThrown) { + dfd.reject(jqXHR, textStatus, errorThrown); }); }); - signal.resolve(); + return this._enhancePromise(promise); } - }, - fileSize: function fileSize() { - return Math.round(this.selectedMedia.size / 1024); - }, - canAddMedia: function canAddMedia() { - var nonRemovedMediaItems = []; - for (var i = 0; i < this.mediaItems.length; i++) { - if (!this.mediaItems[i].isRemoved) { - nonRemovedMediaItems.push(this.mediaItems[i]); - } - } - return nonRemovedMediaItems.length === 0 || nonRemovedMediaItems.length > 0 && allowMultiple; - }, - thumbSize: function thumbSize() { - return this.smallThumbs ? 120 : 240; - }, - currentPrefs: { - get: function get() { - return { - smallThumbs: this.smallThumbs - }; - }, - set: function set(newPrefs) { - if (!newPrefs) { - return; - } - this.smallThumbs = newPrefs.smallThumbs; + data.files = $.makeArray(data.files); + if (data.files.length) { + return this._onSend(null, data); } } - }, - mounted: function mounted() { - var self = this; - self.paths = initialPaths; - self.$on('selectAndDeleteMediaRequested', function (media) { - self.selectAndDeleteMedia(media); - }); - self.$on('selectMediaRequested', function (media) { - self.selectMedia(media); - }); - var selector = '#' + idOfUploadButton; - var editorId = mediaFieldEditor.attr('id'); - var chunkedFileUploadId = randomUUID(); - $(selector).fileupload({ - limitConcurrentUploads: 20, - dropZone: $('#' + editorId), - dataType: 'json', - url: uploadAction, - maxChunkSize: maxUploadChunkSize, - add: function add(e, data) { - var count = data.files.length; - var i; - for (i = 0; i < count; i++) { - data.files[i].uploadName = self.getUniqueId() + data.files[i].name; - data.files[i].attachedFileName = data.files[i].name; + return this._getXHRPromise(false, data && data.context); + } + }); +}); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +/* + * jQuery Iframe Transport Plugin + * https://github.com/blueimp/jQuery-File-Upload + * + * Copyright 2011, Sebastian Tschan + * https://blueimp.net + * + * Licensed under the MIT license: + * https://opensource.org/licenses/MIT + */ + +/* global define, require */ + +(function (factory) { + 'use strict'; + + if (typeof define === 'function' && define.amd) { + // Register as an anonymous AMD module: + define(['jquery'], factory); + } else if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object') { + // Node/CommonJS: + factory(require('jquery')); + } else { + // Browser globals: + factory(window.jQuery); + } +})(function ($) { + 'use strict'; + + // Helper variable to create unique names for the transport iframes: + var counter = 0, + jsonAPI = $, + jsonParse = 'parseJSON'; + if ('JSON' in window && 'parse' in JSON) { + jsonAPI = JSON; + jsonParse = 'parse'; + } + + // The iframe transport accepts four additional options: + // options.fileInput: a jQuery collection of file input fields + // options.paramName: the parameter name for the file form data, + // overrides the name property of the file input field(s), + // can be a string or an array of strings. + // options.formData: an array of objects with name and value properties, + // equivalent to the return data of .serializeArray(), e.g.: + // [{name: 'a', value: 1}, {name: 'b', value: 2}] + // options.initialIframeSrc: the URL of the initial iframe src, + // by default set to "javascript:false;" + $.ajaxTransport('iframe', function (options) { + if (options.async) { + // javascript:false as initial iframe src + // prevents warning popups on HTTPS in IE6: + // eslint-disable-next-line no-script-url + var initialIframeSrc = options.initialIframeSrc || 'javascript:false;', + form, + iframe, + addParamChar; + return { + send: function send(_, completeCallback) { + form = $('
    '); + form.attr('accept-charset', options.formAcceptCharset); + addParamChar = /\?/.test(options.url) ? '&' : '?'; + // XDomainRequest only supports GET and POST: + if (options.type === 'DELETE') { + options.url = options.url + addParamChar + '_method=DELETE'; + options.type = 'POST'; + } else if (options.type === 'PUT') { + options.url = options.url + addParamChar + '_method=PUT'; + options.type = 'POST'; + } else if (options.type === 'PATCH') { + options.url = options.url + addParamChar + '_method=PATCH'; + options.type = 'POST'; } - data.submit(); - }, - formData: function formData() { - var antiForgeryToken = $("input[name=__RequestVerificationToken]").val(); - return [{ - name: 'path', - value: tempUploadFolder - }, { - name: '__RequestVerificationToken', - value: antiForgeryToken - }, { - name: '__chunkedFileUploadId', - value: chunkedFileUploadId - }]; - }, - done: function done(e, data) { - var newMediaItems = []; - var errormsg = ""; - if (data.result.files.length > 0) { - for (var i = 0; i < data.result.files.length; i++) { - data.result.files[i].isNew = true; - //if error is defined probably the file type is not allowed - if (data.result.files[i].error === undefined || data.result.files[i].error === null) { - data.result.files[i].attachedFileName = data.files[i].attachedFileName; - newMediaItems.push(data.result.files[i]); - } else errormsg += data.result.files[i].error + "\n"; + // IE versions below IE8 cannot set the name property of + // elements that have already been added to the DOM, + // so we set the name along with the iframe HTML markup: + counter += 1; + iframe = $('').on('load', function () { + var fileInputClones, + paramNames = $.isArray(options.paramName) ? options.paramName : [options.paramName]; + iframe.off('load').on('load', function () { + var response; + // Wrap in a try/catch block to catch exceptions thrown + // when trying to access cross-domain iframe contents: + try { + response = iframe.contents(); + // Google Chrome and Firefox do not throw an + // exception when calling iframe.contents() on + // cross-domain requests, so we unify the response: + if (!response.length || !response[0].firstChild) { + throw new Error(); + } + } catch (e) { + response = undefined; + } + // The complete callback returns the + // iframe content document as response object: + completeCallback(200, 'success', { + iframe: response + }); + // Fix for IE endless progress bar activity bug + // (happens on form submits to iframe targets): + $('').appendTo(form); + window.setTimeout(function () { + // Removing the form in a setTimeout call + // allows Chrome's developer tools to display + // the response result + form.remove(); + }, 0); + }); + form.prop('target', iframe.prop('name')).prop('action', options.url).prop('method', options.type); + if (options.formData) { + $.each(options.formData, function (index, field) { + $('').prop('name', field.name).val(field.value).appendTo(form); + }); } + if (options.fileInput && options.fileInput.length && options.type === 'POST') { + fileInputClones = options.fileInput.clone(); + // Insert a clone for each file input field: + options.fileInput.after(function (index) { + return fileInputClones[index]; + }); + if (options.paramName) { + options.fileInput.each(function (index) { + $(this).prop('name', paramNames[index] || options.paramName); + }); + } + // Appending the file input fields to the hidden form + // removes them from their original location: + form.append(options.fileInput).prop('enctype', 'multipart/form-data') + // enctype must be set as encoding for IE: + .prop('encoding', 'multipart/form-data'); + // Remove the HTML5 form attribute from the input(s): + options.fileInput.removeAttr('form'); + } + window.setTimeout(function () { + // Submitting the form in a setTimeout call fixes an issue with + // Safari 13 not triggering the iframe load event after resetting + // the load event handler, see also: + // https://github.com/blueimp/jQuery-File-Upload/issues/3633 + form.submit(); + // Insert the file input fields at their original location + // by replacing the clones with the originals: + if (fileInputClones && fileInputClones.length) { + options.fileInput.each(function (index, input) { + var clone = $(fileInputClones[index]); + // Restore the original name and form properties: + $(input).prop('name', clone.prop('name')).attr('form', clone.attr('form')); + clone.replaceWith(input); + }); + } + }, 0); + }); + form.append(iframe).appendTo(document.body); + }, + abort: function abort() { + if (iframe) { + // javascript:false as iframe src aborts the request + // and prevents warning popups on HTTPS in IE6. + iframe.off('load').prop('src', initialIframeSrc); } - if (errormsg !== "") { - alert(errormsg); - return; - } - console.log(newMediaItems); - if (newMediaItems.length > 1 && allowMultiple === false) { - alert($('#onlyOneItemMessage').val()); - mediaFieldApp.mediaItems.push(newMediaItems[0]); - mediaFieldApp.initialized = true; - } else { - mediaFieldApp.mediaItems = mediaFieldApp.mediaItems.concat(newMediaItems); - mediaFieldApp.initialized = true; + if (form) { + form.remove(); } - }, - error: function error(jqXHR, textStatus, errorThrown) { - console.log('Error on upload.'); - console.log(jqXHR); - console.log(textStatus); - console.log(errorThrown); } - }).on('fileuploadchunkbeforesend', function (e, options) { - var file = options.files[0]; - // Here we replace the blob with a File object to ensure the file name and others are preserved for the backend. - options.blob = new File([options.blob], file.name, { - type: file.type, - lastModified: file.lastModified - }); - }); - }, - methods: { - selectMedia: function selectMedia(media) { - this.selectedMedia = media; - }, - getUniqueId: function getUniqueId() { - return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { - var r = Math.random() * 16 | 0, - v = c === 'x' ? r : r & 0x3 | 0x8; - return v.toString(16); - }); - }, - removeSelected: function removeSelected(event) { - var removed = {}; - if (this.selectedMedia) { - var index = this.mediaItems && this.mediaItems.indexOf(this.selectedMedia); - if (index > -1) { - removed = this.mediaItems[index]; - removed.isRemoved = true; - //this.mediaItems.splice([index], 1, removed); - this.mediaItems.splice(index, 1); - } - } else { - // The remove button can also remove a unique media item - if (this.mediaItems.length === 1) { - removed = this.mediaItems[index]; - removed.isRemoved = true; - //this.mediaItems.splice(0, 1, removed); - this.mediaItems.splice(0, 1); - } - } - this.selectedMedia = null; - }, - showMediaTextModal: function showMediaTextModal(event) { - this.mediaTextModal = new bootstrap.Modal(this.$refs.mediaTextModal); - this.mediaTextModal.show(); - this.backupMediaText = this.selectedMedia.mediaText; - }, - cancelMediaTextModal: function cancelMediaTextModal(event) { - this.mediaTextModal.hide(); - this.selectedMedia.mediaText = this.backupMediaText; - }, - showAnchorModal: function showAnchorModal(event) { - this.anchoringModal = new bootstrap.Modal(this.$refs.anchoringModal); - this.anchoringModal.show(); - // Cause a refresh to recalc heights. - this.selectedMedia.anchor = { - x: this.selectedMedia.anchor.x, - y: this.selectedMedia.anchor.y - }; - this.backupAnchor = this.selectedMedia.anchor; - }, - cancelAnchoringModal: function cancelAnchoringModal(event) { - this.anchoringModal.hide(); - this.selectedMedia.anchor = this.backupAnchor; - }, - resetAnchor: function resetAnchor(event) { - this.selectedMedia.anchor = { - x: 0.5, - y: 0.5 - }; - }, - onAnchorDrop: function onAnchorDrop(event) { - var image = this.$refs.anchorImage; - this.selectedMedia.anchor = { - x: event.offsetX / image.clientWidth, - y: event.offsetY / image.clientHeight - }; - }, - anchorLeft: function anchorLeft() { - if (this.$refs.anchorImage && this.$refs.modalBody && this.selectedMedia) { - // When image is shrunk compare against the modal body. - var offset = (this.$refs.modalBody.clientWidth - this.$refs.anchorImage.clientWidth) / 2; - var position = this.selectedMedia.anchor.x * this.$refs.anchorImage.clientWidth + offset; - if (position < 17) { - // Adjust so the target doesn't show outside image. - position = 17; - } else { - position = position - 8; // Adjust to hit the mouse pointer. - } - - return position + 'px'; - } else { - return '0'; - } - }, - anchorTop: function anchorTop() { - if (this.$refs.anchorImage && this.selectedMedia) { - var position = this.selectedMedia.anchor.y * this.$refs.anchorImage.clientHeight; - if (position < 15) { - // Adjustment so the target doesn't show outside image. - position = 15; - } else { - position = position + 5; // Adjust to hit the mouse pointer. - } + }; + } + }); - return position + 'px'; - } else { - return '0'; - } + // The iframe transport returns the iframe content document as response. + // The following adds converters from iframe to text, json, html, xml + // and script. + // Please note that the Content-Type for JSON responses has to be text/plain + // or text/html, if the browser doesn't include application/json in the + // Accept header, else IE will show a download dialog. + // The Content-Type for XML responses on the other hand has to be always + // application/xml or text/xml, so IE properly parses the XML response. + // See also + // https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation + $.ajaxSetup({ + converters: { + 'iframe text': function iframeText(iframe) { + return iframe && $(iframe[0].body).text(); }, - setAnchor: function setAnchor(event) { - var image = this.$refs.anchorImage; - this.selectedMedia.anchor = { - x: event.offsetX / image.clientWidth, - y: event.offsetY / image.clientHeight - }; + 'iframe json': function iframeJson(iframe) { + return iframe && jsonAPI[jsonParse]($(iframe[0].body).text()); }, - addMediaFiles: function addMediaFiles(files) { - if (files.length > 1 && allowMultiple === false) { - alert($('#onlyOneItemMessage').val()); - mediaFieldApp.mediaItems.push(files[0]); - mediaFieldApp.initialized = true; - } else { - mediaFieldApp.mediaItems = mediaFieldApp.mediaItems.concat(files); - mediaFieldApp.initialized = true; - } + 'iframe html': function iframeHtml(iframe) { + return iframe && $(iframe[0].body).html(); }, - selectAndDeleteMedia: function selectAndDeleteMedia(media) { - var self = this; - self.selectedMedia = media; - // setTimeout because sometimes - // removeSelected was called even before the media was set. - setTimeout(function () { - self.removeSelected(); - }, 100); - } - }, - watch: { - mediaItems: { - deep: true, - handler: function handler() { - // Trigger preview rendering - setTimeout(function () { - $(document).trigger('contentpreview:render'); - }, 100); - } + 'iframe xml': function iframeXml(iframe) { + var xmlDoc = iframe && iframe[0]; + return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc : $.parseXML(xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml || $(xmlDoc.body).html()); }, - currentPrefs: function currentPrefs(newPrefs) { - localStorage.setItem('mediaFieldPrefs', JSON.stringify(newPrefs)); + 'iframe script': function iframeScript(iframe) { + return iframe && $.globalEval($(iframe[0].body).text()); } } - })); -} -// component -// different media field editors share this component to present the thumbs. -Vue.component('mediaFieldThumbsContainer', { - template: '\ -
    \ -
    \ -
    \ - {{T.noImages}}\ -
    \ -
    \ - \ -
  • \ -
    \ -
    \ - \ - \ -
    \ -
    \ - \ - \ - {{ media.isNew ? media.name.substr(36) : media.name }}\ -
    \ -
    \ -
    \ -
    \ - \ - {{ T.mediaNotFound }}\ - {{ T.discardWarning }}\ -
    \ -
    \ - \ - {{ media.name }}\ -
    \ -
    \ -
  • \ -
    \ -
    \ - ', - data: function data() { - return { - T: {} - }; - }, - props: { - mediaItems: Array, - selectedMedia: Object, - thumbSize: Number, - idPrefix: String - }, - created: function created() { - var self = this; - - // retrieving localized strings from view - self.T.mediaNotFound = $('#t-media-not-found').val(); - self.T.discardWarning = $('#t-discard-warning').val(); - self.T.noImages = $('#t-no-images').val(); - }, - methods: { - selectAndDeleteMedia: function selectAndDeleteMedia(media) { - this.$parent.$emit('selectAndDeleteMediaRequested', media); - }, - selectMedia: function selectMedia(media) { - this.$parent.$emit('selectMediaRequested', media); - }, - buildMediaUrl: function buildMediaUrl(url, thumbSize) { - return url + (url.indexOf('?') == -1 ? '?' : '&') + 'width=' + thumbSize + '&height=' + thumbSize; - }, - getfontAwesomeClassNameForFileName: function getfontAwesomeClassNameForFilename(filename, thumbsize) { - return getClassNameForFilename(filename) + ' ' + thumbsize; - } - } + }); }); -function initializeMediaField(el, modalBodyElement, mediaItemUrl, allowMultiple, allowMediaText, allowAnchors) { - //BagPart create a script section without other DOM elements - if (el === null) return; - var target = $(document.getElementById($(el).data('for'))); - var initialPaths = target.data("init"); - var mediaFieldEditor = $(el); - var idprefix = mediaFieldEditor.attr("id"); - var mediaFieldApp; - - //when hide modal detach media app to avoid issue on BagPart - modalBodyElement.addEventListener('hidden.bs.modal', function (event) { - $("#mediaApp").appendTo('body'); - $("#mediaApp").hide(); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +function randomUUID() { + if ((typeof crypto === "undefined" ? "undefined" : _typeof(crypto)) === 'object' && typeof crypto.randomUUID === 'function') { + return crypto.randomUUID(); + } + return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function (c) { + return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16); }); - mediaFieldApps.push(mediaFieldApp = new Vue({ - el: mediaFieldEditor.get(0), - data: { - mediaItems: [], - selectedMedia: null, - smallThumbs: false, - idPrefix: idprefix, - initialized: false, - allowMediaText: allowMediaText, - backupMediaText: '', - allowAnchors: allowAnchors, - backupAnchor: null, - mediaTextModal: null, - anchoringModal: null - }, - created: function created() { - var self = this; - self.currentPrefs = JSON.parse(localStorage.getItem('mediaFieldPrefs')); - }, - computed: { - paths: { - get: function get() { - var mediaPaths = []; - if (!this.initialized) { - return JSON.stringify(initialPaths); - } - this.mediaItems.forEach(function (x) { - if (x.mediaPath === 'not-found') { - return; - } - mediaPaths.push({ - path: x.mediaPath, - mediaText: x.mediaText, - anchor: x.anchor - }); - }); - return JSON.stringify(mediaPaths); +} +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } +var initialized; +var mediaApp; +var bus = new Vue(); +function initializeMediaApplication(displayMediaApplication, mediaApplicationUrl, pathBase) { + if (initialized) { + return; + } + initialized = true; + if (!mediaApplicationUrl) { + console.error('mediaApplicationUrl variable is not defined'); + } + $.ajax({ + url: mediaApplicationUrl, + method: 'GET', + success: function success(content) { + $('.ta-content').append(content); + $(document).trigger('mediaapplication:ready'); + var _root = { + name: $('#t-mediaLibrary').text(), + path: '', + folder: '', + isDirectory: true + }; + mediaApp = new Vue({ + el: '#mediaApp', + data: { + selectedFolder: {}, + mediaItems: [], + selectedMedias: [], + errors: [], + dragDropThumbnail: new Image(), + smallThumbs: false, + gridView: false, + mediaFilter: '', + sortBy: '', + sortAsc: true, + itemsInPage: [] }, - set: function set(values) { + created: function created() { var self = this; - var mediaPaths = values || []; - var signal = $.Deferred(); - var items = []; - var length = 0; - mediaPaths.forEach(function (x, i) { - items.push({ - name: ' ' + x.path, - mime: '', - mediaPath: '' - }); // don't remove the space. Something different is needed or it wont react when the real name arrives. - promise = $.when(signal).done(function () { - $.ajax({ - url: mediaItemUrl + "?path=" + encodeURIComponent(x.path), - method: 'GET', - success: function success(data) { - data.vuekey = data.name + i.toString(); - data.mediaText = x.mediaText; // This value is not returned from the ajax call. - data.anchor = x.anchor; // This value is not returned from the ajax call. - items.splice(i, 1, data); - if (items.length === ++length) { - items.forEach(function (y) { - self.mediaItems.push(y); - }); - self.initialized = true; - } - }, - error: function error(_error) { - console.log(_error); - items.splice(i, 1, { - name: x.path, - mime: '', - mediaPath: 'not-found', - mediaText: '', - anchor: { - x: 0, - y: 0 - } - }); - if (items.length === ++length) { - items.forEach(function (x) { - self.mediaItems.push(x); - }); - self.initialized = true; - } - } - }); - }); + self.dragDropThumbnail.src = (pathBase || '') + '/OrchardCore.Media/Images/drag-thumbnail.png'; + bus.$on('folderSelected', function (folder) { + self.selectedFolder = folder; + }); + bus.$on('folderDeleted', function () { + self.selectRoot(); + }); + bus.$on('folderAdded', function (folder) { + self.selectedFolder = folder; + folder.selected = true; + }); + bus.$on('mediaListMoved', function (errorInfo) { + self.loadFolder(self.selectedFolder); + if (errorInfo) { + self.errors.push(errorInfo); + } + }); + bus.$on('mediaRenamed', function (newName, newPath, oldPath, newUrl) { + var media = self.mediaItems.filter(function (item) { + return item.mediaPath === oldPath; + })[0]; + media.mediaPath = newPath; + media.name = newName; + media.url = newUrl; + }); + bus.$on('createFolderRequested', function (media) { + self.createFolder(); + }); + bus.$on('deleteFolderRequested', function (media) { + self.deleteFolder(); }); - signal.resolve(); - } - }, - fileSize: function fileSize() { - return Math.round(this.selectedMedia.size / 1024); - }, - canAddMedia: function canAddMedia() { - return this.mediaItems.length === 0 || this.mediaItems.length > 0 && allowMultiple; - }, - thumbSize: function thumbSize() { - return this.smallThumbs ? 120 : 240; - }, - currentPrefs: { - get: function get() { - return { - smallThumbs: this.smallThumbs - }; - }, - set: function set(newPrefs) { - if (!newPrefs) { - return; - } - this.smallThumbs = newPrefs.smallThumbs; - } - } - }, - mounted: function mounted() { - var self = this; - self.paths = initialPaths; - self.$on('selectAndDeleteMediaRequested', function (media) { - self.selectAndDeleteMedia(media); - }); - self.$on('selectMediaRequested', function (media) { - self.selectMedia(media); - }); - self.$on('filesUploaded', function (files) { - self.addMediaFiles(files); - }); - }, - methods: { - selectMedia: function selectMedia(media) { - this.selectedMedia = media; - }, - showModal: function showModal(event) { - var self = this; - if (self.canAddMedia) { - $("#mediaApp").appendTo($(modalBodyElement).find('.modal-body')); - $("#mediaApp").show(); - var modal = new bootstrap.Modal(modalBodyElement); - modal.show(); - $(modalBodyElement).find('.mediaFieldSelectButton').off('click').on('click', function (v) { - self.addMediaFiles(mediaApp.selectedMedias); - // we don't want the included medias to be still selected the next time we open the modal. - mediaApp.selectedMedias = []; - modal.hide(); - return true; + // common handlers for actions in both grid and table view. + bus.$on('sortChangeRequested', function (newSort) { + self.changeSort(newSort); }); - } - }, - showMediaTextModal: function showMediaTextModal(event) { - this.mediaTextModal = new bootstrap.Modal(this.$refs.mediaTextModal); - this.mediaTextModal.show(); - this.backupMediaText = this.selectedMedia.mediaText; - }, - cancelMediaTextModal: function cancelMediaTextModal(event) { - this.mediaTextModal.hide(); - this.selectedMedia.mediaText = this.backupMediaText; - }, - showAnchorModal: function showAnchorModal(event) { - this.anchoringModal = new bootstrap.Modal(this.$refs.anchoringModal); - this.anchoringModal.show(); - // Cause a refresh to recalc heights. - this.selectedMedia.anchor = { - x: this.selectedMedia.anchor.x, - y: this.selectedMedia.anchor.y - }; - this.backupAnchor = this.selectedMedia.anchor; - }, - cancelAnchoringModal: function cancelAnchoringModal(event) { - this.anchoringModal.hide(); - this.selectedMedia.anchor = this.backupAnchor; - }, - resetAnchor: function resetAnchor(event) { - this.selectedMedia.anchor = { - x: 0.5, - y: 0.5 - }; - }, - onAnchorDrop: function onAnchorDrop(event) { - var image = this.$refs.anchorImage; - this.selectedMedia.anchor = { - x: event.offsetX / image.clientWidth, - y: event.offsetY / image.clientHeight - }; - }, - anchorLeft: function anchorLeft() { - if (this.$refs.anchorImage && this.$refs.modalBody && this.selectedMedia) { - // When image is shrunk compare against the modal body. - var offset = (this.$refs.modalBody.clientWidth - this.$refs.anchorImage.clientWidth) / 2; - var position = this.selectedMedia.anchor.x * this.$refs.anchorImage.clientWidth + offset; - var anchorIcon = Math.round(this.$refs.modalBody.querySelector('.icon-media-anchor').clientWidth); - if (Number.isInteger(anchorIcon)) { - position = position - anchorIcon / 2; - } - return position + 'px'; - } else { - return '0'; - } - }, - anchorTop: function anchorTop() { - if (this.$refs.anchorImage && this.selectedMedia) { - var position = this.selectedMedia.anchor.y * this.$refs.anchorImage.clientHeight; - return position + 'px'; - } else { - return '0'; - } - }, - setAnchor: function setAnchor(event) { - var image = this.$refs.anchorImage; - this.selectedMedia.anchor = { - x: event.offsetX / image.clientWidth, - y: event.offsetY / image.clientHeight - }; - }, - addMediaFiles: function addMediaFiles(files) { - if (files.length > 1 && allowMultiple === false) { - alert($('#onlyOneItemMessage').val()); - mediaFieldApp.mediaItems.push(files[0]); - mediaFieldApp.initialized = true; - } else { - mediaFieldApp.mediaItems = mediaFieldApp.mediaItems.concat(files); - mediaFieldApp.initialized = true; - } - }, - removeSelected: function removeSelected(event) { - if (this.selectedMedia) { - var index = this.mediaItems && this.mediaItems.indexOf(this.selectedMedia); - if (index > -1) { - this.mediaItems.splice(index, 1); - } - } else { - // The remove button can also remove a unique media item - if (this.mediaItems.length === 1) { - this.mediaItems.splice(0, 1); - } - } - this.selectedMedia = null; - }, - selectAndDeleteMedia: function selectAndDeleteMedia(media) { - var self = this; - self.selectedMedia = media; - // setTimeout because sometimes removeSelected was called even before the media was set. - setTimeout(function () { - self.removeSelected(); - }, 100); - } - }, - watch: { - mediaItems: { - deep: true, - handler: function handler() { - // Trigger preview rendering - setTimeout(function () { - $(document).trigger('contentpreview:render'); - }, 100); - } - }, - currentPrefs: function currentPrefs(newPrefs) { - localStorage.setItem('mediaFieldPrefs', JSON.stringify(newPrefs)); - } - } - })); -} -// different media field editors will add themselves to this array -var mediaFieldApps = []; -// component -Vue.component('upload', { - template: '\ -
    \ - \ -

    {{ model.name }}

    \ -
    \ - \ - Error: {{ model.errorMessage }} \ -
    \ -
    \ - ', - props: { - model: Object, - uploadInputId: String - }, - mounted: function mounted() { - var _self$uploadInputId; - var self = this; - var uploadInput = document.getElementById((_self$uploadInputId = self.uploadInputId) !== null && _self$uploadInputId !== void 0 ? _self$uploadInputId : 'fileupload'); - $(uploadInput).bind('fileuploadprogress', function (e, data) { - if (data.files[0].name !== self.model.name) { - return; - } - self.model.percentage = parseInt(data.loaded / data.total * 100, 10); - }); - $(uploadInput).bind('fileuploaddone', function (e, data) { - if (data.files[0].name !== self.model.name) { - return; - } - if (data.result.files[0].error) { - self.handleFailure(data.files[0].name, data.result.files[0].error); - } else { - bus.$emit('removalRequest', self.model); - } - }); - $(uploadInput).bind('fileuploadfail', function (e, data) { - if (data.files[0].name !== self.model.name) { - return; - } - self.handleFailure(data.files[0].name, $('#t-error').val()); - }); - }, - methods: { - handleFailure: function handleFailure(fileName, message) { - if (fileName !== this.model.name) { - return; - } - this.model.errorMessage = message; - bus.$emit('ErrorOnUpload', this.model); - }, - dismissWarning: function dismissWarning() { - bus.$emit('removalRequest', this.model); - } - } -}); -// component -Vue.component('uploadList', { - template: '\ -
    \ -
    \ - {{ T.uploads }} \ - (Pending: {{ pendingCount }}) \ - ( {{ T.errors }}: {{ errorCount }} / {{ T.clearErrors }} ) \ -
    \ -
    \ - \ -
    \ -
    \ - \ -
    \ -
    \ -
    \ -
    \ -
    \ - \ -
    \ -
    \ -
    \ - ', - data: function data() { - return { - files: [], - T: {}, - expanded: false, - pendingCount: 0, - errorCount: 0 - }; - }, - props: { - uploadInputId: String - }, - created: function created() { - var self = this; - // retrieving localized strings from view - self.T.uploads = $('#t-uploads').val(); - self.T.errors = $('#t-errors').val(); - self.T.clearErrors = $('#t-clear-errors').val(); - }, - computed: { - fileCount: function fileCount() { - return this.files.length; - } - }, - mounted: function mounted() { - var _self$uploadInputId; - var self = this; - var uploadInput = document.getElementById((_self$uploadInputId = self.uploadInputId) !== null && _self$uploadInputId !== void 0 ? _self$uploadInputId : 'fileupload'); - $(uploadInput).bind('fileuploadadd', function (e, data) { - if (!data.files) { - return; - } - data.files.forEach(function (newFile) { - var alreadyInList = self.files.some(function (f) { - return f.name == newFile.name; - }); - if (!alreadyInList) { - self.files.push({ - name: newFile.name, - percentage: 0, - errorMessage: '' - }); - } else { - console.error('A file with the same name is already on the queue:' + newFile.name); - } - }); - }); - bus.$on('removalRequest', function (fileUpload) { - self.files.forEach(function (item, index, array) { - if (item.name == fileUpload.name) { - array.splice(index, 1); - } - }); - }); - bus.$on('ErrorOnUpload', function (fileUpload) { - self.updateCount(); - }); - }, - methods: { - updateCount: function updateCount() { - this.errorCount = this.files.filter(function (item) { - return item.errorMessage != ''; - }).length; - this.pendingCount = this.files.length - this.errorCount; - if (this.files.length < 1) { - this.expanded = false; - } - }, - clearErrors: function clearErrors() { - this.files = this.files.filter(function (item) { - return item.errorMessage == ''; - }); - } - }, - watch: { - files: function files() { - this.updateCount(); - } - } -}); -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -function randomUUID() { - if ((typeof crypto === "undefined" ? "undefined" : _typeof(crypto)) === 'object' && typeof crypto.randomUUID === 'function') { - return crypto.randomUUID(); - } - return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, function (c) { - return (c ^ crypto.getRandomValues(new Uint8Array(1))[0] & 15 >> c / 4).toString(16); - }); -} -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -/* - * jQuery File Upload Plugin - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2010, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - */ - -/* global define, require */ -/* eslint-disable new-cap */ - -(function (factory) { - 'use strict'; - - if (typeof define === 'function' && define.amd) { - // Register as an anonymous AMD module: - define(['jquery', 'jquery-ui/ui/widget'], factory); - } else if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object') { - // Node/CommonJS: - factory(require('jquery'), require('./vendor/jquery.ui.widget')); - } else { - // Browser globals: - factory(window.jQuery); - } -})(function ($) { - 'use strict'; - - // Detect file input support, based on - // https://viljamis.com/2012/file-upload-support-on-mobile/ - $.support.fileInput = !(new RegExp( - // Handle devices which give false positives for the feature detection: - '(Android (1\\.[0156]|2\\.[01]))' + '|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)' + '|(w(eb)?OSBrowser)|(webOS)' + '|(Kindle/(1\\.0|2\\.[05]|3\\.0))').test(window.navigator.userAgent) || - // Feature detection for all other devices: - $('').prop('disabled')); - - // The FileReader API is not actually used, but works as feature detection, - // as some Safari versions (5?) support XHR file uploads via the FormData API, - // but not non-multipart XHR file uploads. - // window.XMLHttpRequestUpload is not available on IE10, so we check for - // window.ProgressEvent instead to detect XHR2 file upload capability: - $.support.xhrFileUpload = !!(window.ProgressEvent && window.FileReader); - $.support.xhrFormDataFileUpload = !!window.FormData; - - // Detect support for Blob slicing (required for chunked uploads): - $.support.blobSlice = window.Blob && (Blob.prototype.slice || Blob.prototype.webkitSlice || Blob.prototype.mozSlice); - - /** - * Helper function to create drag handlers for dragover/dragenter/dragleave - * - * @param {string} type Event type - * @returns {Function} Drag handler - */ - function getDragHandler(type) { - var isDragOver = type === 'dragover'; - return function (e) { - e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer; - var dataTransfer = e.dataTransfer; - if (dataTransfer && $.inArray('Files', dataTransfer.types) !== -1 && this._trigger(type, $.Event(type, { - delegatedEvent: e - })) !== false) { - e.preventDefault(); - if (isDragOver) { - dataTransfer.dropEffect = 'copy'; - } - } - }; - } - - // The fileupload widget listens for change events on file input fields defined - // via fileInput setting and paste or drop events of the given dropZone. - // In addition to the default jQuery Widget methods, the fileupload widget - // exposes the "add" and "send" methods, to add or directly send files using - // the fileupload API. - // By default, files added via file input selection, paste, drag & drop or - // "add" method are uploaded immediately, but it is possible to override - // the "add" callback option to queue file uploads. - $.widget('blueimp.fileupload', { - options: { - // The drop target element(s), by the default the complete document. - // Set to null to disable drag & drop support: - dropZone: $(document), - // The paste target element(s), by the default undefined. - // Set to a DOM node or jQuery object to enable file pasting: - pasteZone: undefined, - // The file input field(s), that are listened to for change events. - // If undefined, it is set to the file input fields inside - // of the widget element on plugin initialization. - // Set to null to disable the change listener. - fileInput: undefined, - // By default, the file input field is replaced with a clone after - // each input field change event. This is required for iframe transport - // queues and allows change events to be fired for the same file - // selection, but can be disabled by setting the following option to false: - replaceFileInput: true, - // The parameter name for the file form data (the request argument name). - // If undefined or empty, the name property of the file input field is - // used, or "files[]" if the file input name property is also empty, - // can be a string or an array of strings: - paramName: undefined, - // By default, each file of a selection is uploaded using an individual - // request for XHR type uploads. Set to false to upload file - // selections in one request each: - singleFileUploads: true, - // To limit the number of files uploaded with one XHR request, - // set the following option to an integer greater than 0: - limitMultiFileUploads: undefined, - // The following option limits the number of files uploaded with one - // XHR request to keep the request size under or equal to the defined - // limit in bytes: - limitMultiFileUploadSize: undefined, - // Multipart file uploads add a number of bytes to each uploaded file, - // therefore the following option adds an overhead for each file used - // in the limitMultiFileUploadSize configuration: - limitMultiFileUploadSizeOverhead: 512, - // Set the following option to true to issue all file upload requests - // in a sequential order: - sequentialUploads: false, - // To limit the number of concurrent uploads, - // set the following option to an integer greater than 0: - limitConcurrentUploads: undefined, - // Set the following option to true to force iframe transport uploads: - forceIframeTransport: false, - // Set the following option to the location of a redirect url on the - // origin server, for cross-domain iframe transport uploads: - redirect: undefined, - // The parameter name for the redirect url, sent as part of the form - // data and set to 'redirect' if this option is empty: - redirectParamName: undefined, - // Set the following option to the location of a postMessage window, - // to enable postMessage transport uploads: - postMessage: undefined, - // By default, XHR file uploads are sent as multipart/form-data. - // The iframe transport is always using multipart/form-data. - // Set to false to enable non-multipart XHR uploads: - multipart: true, - // To upload large files in smaller chunks, set the following option - // to a preferred maximum chunk size. If set to 0, null or undefined, - // or the browser does not support the required Blob API, files will - // be uploaded as a whole. - maxChunkSize: undefined, - // When a non-multipart upload or a chunked multipart upload has been - // aborted, this option can be used to resume the upload by setting - // it to the size of the already uploaded bytes. This option is most - // useful when modifying the options object inside of the "add" or - // "send" callbacks, as the options are cloned for each file upload. - uploadedBytes: undefined, - // By default, failed (abort or error) file uploads are removed from the - // global progress calculation. Set the following option to false to - // prevent recalculating the global progress data: - recalculateProgress: true, - // Interval in milliseconds to calculate and trigger progress events: - progressInterval: 100, - // Interval in milliseconds to calculate progress bitrate: - bitrateInterval: 500, - // By default, uploads are started automatically when adding files: - autoUpload: true, - // By default, duplicate file names are expected to be handled on - // the server-side. If this is not possible (e.g. when uploading - // files directly to Amazon S3), the following option can be set to - // an empty object or an object mapping existing filenames, e.g.: - // { "image.jpg": true, "image (1).jpg": true } - // If it is set, all files will be uploaded with unique filenames, - // adding increasing number suffixes if necessary, e.g.: - // "image (2).jpg" - uniqueFilenames: undefined, - // Error and info messages: - messages: { - uploadedBytes: 'Uploaded bytes exceed file size' - }, - // Translation function, gets the message key to be translated - // and an object with context specific data as arguments: - i18n: function i18n(message, context) { - // eslint-disable-next-line no-param-reassign - message = this.messages[message] || message.toString(); - if (context) { - $.each(context, function (key, value) { - // eslint-disable-next-line no-param-reassign - message = message.replace('{' + key + '}', value); - }); - } - return message; - }, - // Additional form data to be sent along with the file uploads can be set - // using this option, which accepts an array of objects with name and - // value properties, a function returning such an array, a FormData - // object (for XHR file uploads), or a simple object. - // The form of the first fileInput is given as parameter to the function: - formData: function formData(form) { - return form.serializeArray(); - }, - // The add callback is invoked as soon as files are added to the fileupload - // widget (via file input selection, drag & drop, paste or add API call). - // If the singleFileUploads option is enabled, this callback will be - // called once for each file in the selection for XHR file uploads, else - // once for each file selection. - // - // The upload starts when the submit method is invoked on the data parameter. - // The data object contains a files property holding the added files - // and allows you to override plugin options as well as define ajax settings. - // - // Listeners for this callback can also be bound the following way: - // .on('fileuploadadd', func); - // - // data.submit() returns a Promise object and allows to attach additional - // handlers using jQuery's Deferred callbacks: - // data.submit().done(func).fail(func).always(func); - add: function add(e, data) { - if (e.isDefaultPrevented()) { - return false; - } - if (data.autoUpload || data.autoUpload !== false && $(this).fileupload('option', 'autoUpload')) { - data.process().done(function () { - data.submit(); + bus.$on('mediaToggleRequested', function (media) { + self.toggleSelectionOfMedia(media); }); - } - }, - // Other callbacks: - - // Callback for the submit event of each file upload: - // submit: function (e, data) {}, // .on('fileuploadsubmit', func); - - // Callback for the start of each file upload request: - // send: function (e, data) {}, // .on('fileuploadsend', func); - - // Callback for successful uploads: - // done: function (e, data) {}, // .on('fileuploaddone', func); - - // Callback for failed (abort or error) uploads: - // fail: function (e, data) {}, // .on('fileuploadfail', func); - - // Callback for completed (success, abort or error) requests: - // always: function (e, data) {}, // .on('fileuploadalways', func); - - // Callback for upload progress events: - // progress: function (e, data) {}, // .on('fileuploadprogress', func); - - // Callback for global upload progress events: - // progressall: function (e, data) {}, // .on('fileuploadprogressall', func); - - // Callback for uploads start, equivalent to the global ajaxStart event: - // start: function (e) {}, // .on('fileuploadstart', func); - - // Callback for uploads stop, equivalent to the global ajaxStop event: - // stop: function (e) {}, // .on('fileuploadstop', func); - - // Callback for change events of the fileInput(s): - // change: function (e, data) {}, // .on('fileuploadchange', func); - - // Callback for paste events to the pasteZone(s): - // paste: function (e, data) {}, // .on('fileuploadpaste', func); - - // Callback for drop events of the dropZone(s): - // drop: function (e, data) {}, // .on('fileuploaddrop', func); - - // Callback for dragover events of the dropZone(s): - // dragover: function (e) {}, // .on('fileuploaddragover', func); - - // Callback before the start of each chunk upload request (before form data initialization): - // chunkbeforesend: function (e, data) {}, // .on('fileuploadchunkbeforesend', func); - - // Callback for the start of each chunk upload request: - // chunksend: function (e, data) {}, // .on('fileuploadchunksend', func); - - // Callback for successful chunk uploads: - // chunkdone: function (e, data) {}, // .on('fileuploadchunkdone', func); - - // Callback for failed (abort or error) chunk uploads: - // chunkfail: function (e, data) {}, // .on('fileuploadchunkfail', func); - - // Callback for completed (success, abort or error) chunk upload requests: - // chunkalways: function (e, data) {}, // .on('fileuploadchunkalways', func); - - // The plugin options are used as settings object for the ajax calls. - // The following are jQuery ajax settings required for the file uploads: - processData: false, - contentType: false, - cache: false, - timeout: 0 - }, - // jQuery versions before 1.8 require promise.pipe if the return value is - // used, as promise.then in older versions has a different behavior, see: - // https://blog.jquery.com/2012/08/09/jquery-1-8-released/ - // https://bugs.jquery.com/ticket/11010 - // https://github.com/blueimp/jQuery-File-Upload/pull/3435 - _promisePipe: function () { - var parts = $.fn.jquery.split('.'); - return Number(parts[0]) > 1 || Number(parts[1]) > 7 ? 'then' : 'pipe'; - }(), - // A list of options that require reinitializing event listeners and/or - // special initialization code: - _specialOptions: ['fileInput', 'dropZone', 'pasteZone', 'multipart', 'forceIframeTransport'], - _blobSlice: $.support.blobSlice && function () { - var slice = this.slice || this.webkitSlice || this.mozSlice; - return slice.apply(this, arguments); - }, - _BitrateTimer: function _BitrateTimer() { - this.timestamp = Date.now ? Date.now() : new Date().getTime(); - this.loaded = 0; - this.bitrate = 0; - this.getBitrate = function (now, loaded, interval) { - var timeDiff = now - this.timestamp; - if (!this.bitrate || !interval || timeDiff > interval) { - this.bitrate = (loaded - this.loaded) * (1000 / timeDiff) * 8; - this.loaded = loaded; - this.timestamp = now; - } - return this.bitrate; - }; - }, - _isXHRUpload: function _isXHRUpload(options) { - return !options.forceIframeTransport && (!options.multipart && $.support.xhrFileUpload || $.support.xhrFormDataFileUpload); - }, - _getFormData: function _getFormData(options) { - var formData; - if ($.type(options.formData) === 'function') { - return options.formData(options.form); - } - if ($.isArray(options.formData)) { - return options.formData; - } - if ($.type(options.formData) === 'object') { - formData = []; - $.each(options.formData, function (name, value) { - formData.push({ - name: name, - value: value + bus.$on('renameMediaRequested', function (media) { + self.renameMedia(media); }); - }); - return formData; - } - return []; - }, - _getTotal: function _getTotal(files) { - var total = 0; - $.each(files, function (index, file) { - total += file.size || 1; - }); - return total; - }, - _initProgressObject: function _initProgressObject(obj) { - var progress = { - loaded: 0, - total: 0, - bitrate: 0 - }; - if (obj._progress) { - $.extend(obj._progress, progress); - } else { - obj._progress = progress; - } - }, - _initResponseObject: function _initResponseObject(obj) { - var prop; - if (obj._response) { - for (prop in obj._response) { - if (Object.prototype.hasOwnProperty.call(obj._response, prop)) { - delete obj._response[prop]; + bus.$on('deleteMediaRequested', function (media) { + self.deleteMediaItem(media); + }); + bus.$on('mediaDragStartRequested', function (media, e) { + self.handleDragStart(media, e); + }); + + // handler for pager events + bus.$on('pagerEvent', function (itemsInPage) { + self.itemsInPage = itemsInPage; + self.selectedMedias = []; + }); + if (!localStorage.getItem('mediaApplicationPrefs')) { + self.selectedFolder = _root; + return; } - } - } else { - obj._response = {}; - } - }, - _onProgress: function _onProgress(e, data) { - if (e.lengthComputable) { - var now = Date.now ? Date.now() : new Date().getTime(), - loaded; - if (data._time && data.progressInterval && now - data._time < data.progressInterval && e.loaded !== e.total) { - return; - } - data._time = now; - loaded = Math.floor(e.loaded / e.total * (data.chunkSize || data._progress.total)) + (data.uploadedBytes || 0); - // Add the difference from the previously loaded state - // to the global loaded counter: - this._progress.loaded += loaded - data._progress.loaded; - this._progress.bitrate = this._bitrateTimer.getBitrate(now, this._progress.loaded, data.bitrateInterval); - data._progress.loaded = data.loaded = loaded; - data._progress.bitrate = data.bitrate = data._bitrateTimer.getBitrate(now, loaded, data.bitrateInterval); - // Trigger a custom progress event with a total data property set - // to the file size(s) of the current upload and a loaded data - // property calculated accordingly: - this._trigger('progress', $.Event('progress', { - delegatedEvent: e - }), data); - // Trigger a global progress event for all current file uploads, - // including ajax calls queued for sequential file uploads: - this._trigger('progressall', $.Event('progressall', { - delegatedEvent: e - }), this._progress); - } - }, - _initProgressListener: function _initProgressListener(options) { - var that = this, - xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr(); - // Access to the native XHR object is required to add event listeners - // for the upload progress event: - if (xhr.upload) { - $(xhr.upload).on('progress', function (e) { - var oe = e.originalEvent; - // Make sure the progress event properties get copied over: - e.lengthComputable = oe.lengthComputable; - e.loaded = oe.loaded; - e.total = oe.total; - that._onProgress(e, options); - }); - options.xhr = function () { - return xhr; - }; - } - }, - _deinitProgressListener: function _deinitProgressListener(options) { - var xhr = options.xhr ? options.xhr() : $.ajaxSettings.xhr(); - if (xhr.upload) { - $(xhr.upload).off('progress'); - } - }, - _isInstanceOf: function _isInstanceOf(type, obj) { - // Cross-frame instanceof check - return Object.prototype.toString.call(obj) === '[object ' + type + ']'; - }, - _getUniqueFilename: function _getUniqueFilename(name, map) { - // eslint-disable-next-line no-param-reassign - name = String(name); - if (map[name]) { - // eslint-disable-next-line no-param-reassign - name = name.replace(/(?: \(([\d]+)\))?(\.[^.]+)?$/, function (_, p1, p2) { - var index = p1 ? Number(p1) + 1 : 1; - var ext = p2 || ''; - return ' (' + index + ')' + ext; - }); - return this._getUniqueFilename(name, map); - } - map[name] = true; - return name; - }, - _initXHRData: function _initXHRData(options) { - var that = this, - formData, - file = options.files[0], - // Ignore non-multipart setting if not supported: - multipart = options.multipart || !$.support.xhrFileUpload, - paramName = $.type(options.paramName) === 'array' ? options.paramName[0] : options.paramName; - options.headers = $.extend({}, options.headers); - if (options.contentRange) { - options.headers['Content-Range'] = options.contentRange; - } - if (!multipart || options.blob || !this._isInstanceOf('File', file)) { - options.headers['Content-Disposition'] = 'attachment; filename="' + encodeURI(file.uploadName || file.name) + '"'; - } - if (!multipart) { - options.contentType = file.type || 'application/octet-stream'; - options.data = options.blob || file; - } else if ($.support.xhrFormDataFileUpload) { - if (options.postMessage) { - // window.postMessage does not allow sending FormData - // objects, so we just add the File/Blob objects to - // the formData array and let the postMessage window - // create the FormData object out of this array: - formData = this._getFormData(options); - if (options.blob) { - formData.push({ - name: paramName, - value: options.blob + self.currentPrefs = JSON.parse(localStorage.getItem('mediaApplicationPrefs')); + }, + computed: { + isHome: function isHome() { + return this.selectedFolder == _root; + }, + parents: function parents() { + var p = []; + parentFolder = this.selectedFolder; + while (parentFolder && parentFolder.path != '') { + p.unshift(parentFolder); + parentFolder = parentFolder.parent; + } + return p; + }, + root: function root() { + return _root; + }, + filteredMediaItems: function filteredMediaItems() { + var self = this; + self.selectedMedias = []; + var filtered = self.mediaItems.filter(function (item) { + return item.name.toLowerCase().indexOf(self.mediaFilter.toLowerCase()) > -1; }); - } else { - $.each(options.files, function (index, file) { - formData.push({ - name: $.type(options.paramName) === 'array' && options.paramName[index] || paramName, - value: file - }); + switch (self.sortBy) { + case 'size': + filtered.sort(function (a, b) { + return self.sortAsc ? a.size - b.size : b.size - a.size; + }); + break; + case 'mime': + filtered.sort(function (a, b) { + return self.sortAsc ? a.mime.toLowerCase().localeCompare(b.mime.toLowerCase()) : b.mime.toLowerCase().localeCompare(a.mime.toLowerCase()); + }); + break; + case 'lastModify': + filtered.sort(function (a, b) { + return self.sortAsc ? a.lastModify - b.lastModify : b.lastModify - a.lastModify; + }); + break; + default: + filtered.sort(function (a, b) { + return self.sortAsc ? a.name.toLowerCase().localeCompare(b.name.toLowerCase()) : b.name.toLowerCase().localeCompare(a.name.toLowerCase()); + }); + } + return filtered; + }, + hiddenCount: function hiddenCount() { + var result = 0; + result = this.mediaItems.length - this.filteredMediaItems.length; + return result; + }, + thumbSize: function thumbSize() { + return this.smallThumbs ? 100 : 240; + }, + currentPrefs: { + get: function get() { + return { + smallThumbs: this.smallThumbs, + selectedFolder: this.selectedFolder, + gridView: this.gridView + }; + }, + set: function set(newPrefs) { + if (!newPrefs) { + return; + } + this.smallThumbs = newPrefs.smallThumbs; + this.selectedFolder = newPrefs.selectedFolder; + this.gridView = newPrefs.gridView; + } + } + }, + watch: { + currentPrefs: function currentPrefs(newPrefs) { + localStorage.setItem('mediaApplicationPrefs', JSON.stringify(newPrefs)); + }, + selectedFolder: function selectedFolder(newFolder) { + this.mediaFilter = ''; + this.selectedFolder = newFolder; + this.loadFolder(newFolder); + } + }, + mounted: function mounted() { + this.$refs.rootFolder.toggle(); + }, + methods: { + uploadUrl: function uploadUrl() { + if (!this.selectedFolder) { + return null; + } + var urlValue = $('#uploadFiles').val(); + return urlValue + (urlValue.indexOf('?') == -1 ? '?' : '&') + "path=" + encodeURIComponent(this.selectedFolder.path); + }, + selectRoot: function selectRoot() { + this.selectedFolder = this.root; + }, + loadFolder: function loadFolder(folder) { + this.errors = []; + this.selectedMedias = []; + var self = this; + var mediaUrl = $('#getMediaItemsUrl').val(); + console.log(folder.path); + $.ajax({ + url: mediaUrl + (mediaUrl.indexOf('?') == -1 ? '?' : '&') + "path=" + encodeURIComponent(folder.path), + method: 'GET', + success: function success(data) { + data.forEach(function (item) { + item.open = false; + }); + self.mediaItems = data; + self.selectedMedias = []; + self.sortBy = ''; + self.sortAsc = true; + }, + error: function error(_error) { + console.log('error loading folder:' + folder.path); + self.selectRoot(); + } }); - } - } else { - if (that._isInstanceOf('FormData', options.formData)) { - formData = options.formData; - } else { - formData = new FormData(); - $.each(this._getFormData(options), function (index, field) { - formData.append(field.name, field.value); + }, + selectAll: function selectAll() { + this.selectedMedias = []; + for (var i = 0; i < this.filteredMediaItems.length; i++) { + this.selectedMedias.push(this.filteredMediaItems[i]); + } + }, + unSelectAll: function unSelectAll() { + this.selectedMedias = []; + }, + invertSelection: function invertSelection() { + var temp = []; + for (var i = 0; i < this.filteredMediaItems.length; i++) { + if (this.isMediaSelected(this.filteredMediaItems[i]) == false) { + temp.push(this.filteredMediaItems[i]); + } + } + this.selectedMedias = temp; + }, + toggleSelectionOfMedia: function toggleSelectionOfMedia(media) { + if (this.isMediaSelected(media) == true) { + this.selectedMedias.splice(this.selectedMedias.indexOf(media), 1); + } else { + this.selectedMedias.push(media); + } + }, + isMediaSelected: function isMediaSelected(media) { + var result = this.selectedMedias.some(function (element, index, array) { + return element.url.toLowerCase() === media.url.toLowerCase(); }); - } - if (options.blob) { - formData.append(paramName, options.blob, file.uploadName || file.name); - } else { - $.each(options.files, function (index, file) { - // This check allows the tests to run with - // dummy objects: - if (that._isInstanceOf('File', file) || that._isInstanceOf('Blob', file)) { - var fileName = file.uploadName || file.name; - if (options.uniqueFilenames) { - fileName = that._getUniqueFilename(fileName, options.uniqueFilenames); + return result; + }, + deleteFolder: function deleteFolder() { + var folder = this.selectedFolder; + var self = this; + // The root folder can't be deleted + if (folder == this.root.model) { + return; + } + confirmDialog(_objectSpread(_objectSpread({}, $("#deleteFolder").data()), {}, { + callback: function callback(resp) { + if (resp) { + $.ajax({ + url: $('#deleteFolderUrl').val() + "?path=" + encodeURIComponent(folder.path), + method: 'POST', + data: { + __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val() + }, + success: function success(data) { + bus.$emit('deleteFolder', folder); + }, + error: function error(_error2) { + console.error(_error2.responseText); + } + }); + } + } + })); + }, + createFolder: function createFolder() { + $('#createFolderModal-errors').empty(); + var modal = bootstrap.Modal.getOrCreateInstance($('#createFolderModal')); + modal.show(); + $('#createFolderModal .modal-body input').val('').focus(); + }, + renameMedia: function renameMedia(media) { + $('#renameMediaModal-errors').empty(); + var modal = bootstrap.Modal.getOrCreateInstance($('#renameMediaModal')); + modal.show(); + $('#old-item-name').val(media.name); + $('#renameMediaModal .modal-body input').val(media.name).focus(); + }, + selectAndDeleteMedia: function selectAndDeleteMedia(media) { + this.deleteMedia(); + }, + deleteMediaList: function deleteMediaList() { + var mediaList = this.selectedMedias; + var self = this; + if (mediaList.length < 1) { + return; + } + confirmDialog(_objectSpread(_objectSpread({}, $("#deleteMedia").data()), {}, { + callback: function callback(resp) { + if (resp) { + var paths = []; + for (var i = 0; i < mediaList.length; i++) { + paths.push(mediaList[i].mediaPath); + } + $.ajax({ + url: $('#deleteMediaListUrl').val(), + method: 'POST', + data: { + __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val(), + paths: paths + }, + success: function success(data) { + for (var i = 0; i < self.selectedMedias.length; i++) { + var index = self.mediaItems && self.mediaItems.indexOf(self.selectedMedias[i]); + if (index > -1) { + self.mediaItems.splice(index, 1); + bus.$emit('mediaDeleted', self.selectedMedias[i]); + } + } + self.selectedMedias = []; + }, + error: function error(_error3) { + console.error(_error3.responseText); + } + }); + } + } + })); + }, + deleteMediaItem: function deleteMediaItem(media) { + var self = this; + if (!media) { + return; + } + confirmDialog(_objectSpread(_objectSpread({}, $("#deleteMedia").data()), {}, { + callback: function callback(resp) { + if (resp) { + $.ajax({ + url: $('#deleteMediaUrl').val() + "?path=" + encodeURIComponent(media.mediaPath), + method: 'POST', + data: { + __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val() + }, + success: function success(data) { + var index = self.mediaItems && self.mediaItems.indexOf(media); + if (index > -1) { + self.mediaItems.splice(index, 1); + bus.$emit('mediaDeleted', media); + } + //self.selectedMedia = null; + }, + error: function error(_error4) { + console.error(_error4.responseText); + } + }); } - formData.append($.type(options.paramName) === 'array' && options.paramName[index] || paramName, file, fileName); } + })); + }, + handleDragStart: function handleDragStart(media, e) { + // first part of move media to folder: + // prepare the data that will be handled by the folder component on drop event + var mediaNames = []; + this.selectedMedias.forEach(function (item) { + mediaNames.push(item.name); }); + + // in case the user drags an unselected item, we select it first + if (this.isMediaSelected(media) == false) { + mediaNames.push(media.name); + this.selectedMedias.push(media); + } + e.dataTransfer.setData('mediaNames', JSON.stringify(mediaNames)); + e.dataTransfer.setData('sourceFolder', this.selectedFolder.path); + e.dataTransfer.setDragImage(this.dragDropThumbnail, 10, 10); + e.dataTransfer.effectAllowed = 'move'; + }, + handleScrollWhileDrag: function handleScrollWhileDrag(e) { + if (e.clientY < 150) { + window.scrollBy(0, -10); + } + if (e.clientY > window.innerHeight - 100) { + window.scrollBy(0, 10); + } + }, + changeSort: function changeSort(newSort) { + if (this.sortBy == newSort) { + this.sortAsc = !this.sortAsc; + } else { + this.sortAsc = true; + this.sortBy = newSort; + } } } - options.data = formData; - } - // Blob reference is not needed anymore, free memory: - options.blob = null; - }, - _initIframeSettings: function _initIframeSettings(options) { - var targetHost = $('').prop('href', options.url).prop('host'); - // Setting the dataType to iframe enables the iframe transport: - options.dataType = 'iframe ' + (options.dataType || ''); - // The iframe transport accepts a serialized array as form data: - options.formData = this._getFormData(options); - // Add redirect url to form data on cross-domain uploads: - if (options.redirect && targetHost && targetHost !== location.host) { - options.formData.push({ - name: options.redirectParamName || 'redirect', - value: options.redirect - }); - } - }, - _initDataSettings: function _initDataSettings(options) { - if (this._isXHRUpload(options)) { - if (!this._chunkedUpload(options, true)) { - if (!options.data) { - this._initXHRData(options); + }); + $('#create-folder-name').keypress(function (e) { + var key = e.which; + if (key == 13) { + // the enter key code + $('#modalFooterOk').click(); + return false; + } + }); + $('#modalFooterOk').on('click', function (e) { + var name = $('#create-folder-name').val(); + if (name === "") { + return; + } + $.ajax({ + url: $('#createFolderUrl').val() + "?path=" + encodeURIComponent(mediaApp.selectedFolder.path) + "&name=" + encodeURIComponent(name), + method: 'POST', + data: { + __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val() + }, + success: function success(data) { + bus.$emit('addFolder', mediaApp.selectedFolder, data); + var modal = bootstrap.Modal.getOrCreateInstance($('#createFolderModal')); + modal.hide(); + }, + error: function error(_error5) { + $('#createFolderModal-errors').empty(); + var errorMessage = JSON.parse(_error5.responseText).value; + $('').text(errorMessage).appendTo($('#createFolderModal-errors')); } - this._initProgressListener(options); + }); + }); + $('#renameMediaModalFooterOk').on('click', function (e) { + var newName = $('#new-item-name').val(); + var oldName = $('#old-item-name').val(); + if (newName === "") { + return; } - if (options.postMessage) { - // Setting the dataType to postmessage enables the - // postMessage transport: - options.dataType = 'postmessage ' + (options.dataType || ''); + var currentFolder = mediaApp.selectedFolder.path + "/"; + if (currentFolder === "/") { + currentFolder = ""; } - } else { - this._initIframeSettings(options); - } - }, - _getParamName: function _getParamName(options) { - var fileInput = $(options.fileInput), - paramName = options.paramName; - if (!paramName) { - paramName = []; - fileInput.each(function () { - var input = $(this), - name = input.prop('name') || 'files[]', - i = (input.prop('files') || [1]).length; - while (i) { - paramName.push(name); - i -= 1; + var newPath = currentFolder + newName; + var oldPath = currentFolder + oldName; + if (newPath.toLowerCase() === oldPath.toLowerCase()) { + var modal = bootstrap.Modal.getOrCreateInstance($('#renameMediaModal')); + modal.hide(); + return; + } + $.ajax({ + url: $('#renameMediaUrl').val() + "?oldPath=" + encodeURIComponent(oldPath) + "&newPath=" + encodeURIComponent(newPath), + method: 'POST', + data: { + __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val() + }, + success: function success(data) { + var modal = bootstrap.Modal.getOrCreateInstance($('#renameMediaModal')); + modal.hide(); + bus.$emit('mediaRenamed', newName, newPath, oldPath, data.newUrl); + }, + error: function error(_error6) { + $('#renameMediaModal-errors').empty(); + var errorMessage = JSON.parse(_error6.responseText).value; + $('').text(errorMessage).appendTo($('#renameMediaModal-errors')); } }); - if (!paramName.length) { - paramName = [fileInput.prop('name') || 'files[]']; - } - } else if (!$.isArray(paramName)) { - paramName = [paramName]; - } - return paramName; - }, - _initFormSettings: function _initFormSettings(options) { - // Retrieve missing options from the input field and the - // associated form, if available: - if (!options.form || !options.form.length) { - options.form = $(options.fileInput.prop('form')); - // If the given file input doesn't have an associated form, - // use the default widget file input's form: - if (!options.form.length) { - options.form = $(this.options.fileInput.prop('form')); - } - } - options.paramName = this._getParamName(options); - if (!options.url) { - options.url = options.form.prop('action') || location.href; - } - // The HTTP request method must be "POST" or "PUT": - options.type = (options.type || $.type(options.form.prop('method')) === 'string' && options.form.prop('method') || '').toUpperCase(); - if (options.type !== 'POST' && options.type !== 'PUT' && options.type !== 'PATCH') { - options.type = 'POST'; - } - if (!options.formAcceptCharset) { - options.formAcceptCharset = options.form.attr('accept-charset'); - } - }, - _getAJAXSettings: function _getAJAXSettings(data) { - var options = $.extend({}, this.options, data); - this._initFormSettings(options); - this._initDataSettings(options); - return options; - }, - // jQuery 1.6 doesn't provide .state(), - // while jQuery 1.8+ removed .isRejected() and .isResolved(): - _getDeferredState: function _getDeferredState(deferred) { - if (deferred.state) { - return deferred.state(); - } - if (deferred.isResolved()) { - return 'resolved'; - } - if (deferred.isRejected()) { - return 'rejected'; + }); + if (displayMediaApplication) { + document.getElementById('mediaApp').style.display = ""; } - return 'pending'; - }, - // Maps jqXHR callbacks to the equivalent - // methods of the given Promise object: - _enhancePromise: function _enhancePromise(promise) { - promise.success = promise.done; - promise.error = promise.fail; - promise.complete = promise.always; - return promise; + $(document).trigger('mediaApp:ready'); }, - // Creates and returns a Promise object enhanced with - // the jqXHR methods abort, success, error and complete: - _getXHRPromise: function _getXHRPromise(resolveOrReject, context, args) { - var dfd = $.Deferred(), - promise = dfd.promise(); - // eslint-disable-next-line no-param-reassign - context = context || this.options.context || promise; - if (resolveOrReject === true) { - dfd.resolveWith(context, args); - } else if (resolveOrReject === false) { - dfd.rejectWith(context, args); - } - promise.abort = dfd.promise; - return this._enhancePromise(promise); + error: function error(_error7) { + console.error(_error7.responseText); + } + }); +} +$(document).on('mediaApp:ready', function () { + var chunkedFileUploadId = randomUUID(); + $('#fileupload').fileupload({ + dropZone: $('#mediaApp'), + limitConcurrentUploads: 20, + dataType: 'json', + url: $('#uploadFiles').val(), + maxChunkSize: Number($('#maxUploadChunkSize').val() || 0), + formData: function formData() { + var antiForgeryToken = $("input[name=__RequestVerificationToken]").val(); + return [{ + name: 'path', + value: mediaApp.selectedFolder.path + }, { + name: '__RequestVerificationToken', + value: antiForgeryToken + }, { + name: '__chunkedFileUploadId', + value: chunkedFileUploadId + }]; }, - // Adds convenience methods to the data callback argument: - _addConvenienceMethods: function _addConvenienceMethods(e, data) { - var that = this, - getPromise = function getPromise(args) { - return $.Deferred().resolveWith(that, args).promise(); - }; - data.process = function (resolveFunc, rejectFunc) { - if (resolveFunc || rejectFunc) { - data._processQueue = this._processQueue = (this._processQueue || getPromise([this]))[that._promisePipe](function () { - if (data.errorThrown) { - return $.Deferred().rejectWith(that, [data]).promise(); - } - return getPromise(arguments); - })[that._promisePipe](resolveFunc, rejectFunc); - } - return this._processQueue || getPromise([this]); - }; - data.submit = function () { - if (this.state() !== 'pending') { - data.jqXHR = this.jqXHR = that._trigger('submit', $.Event('submit', { - delegatedEvent: e - }), this) !== false && that._onSend(e, this); - } - return this.jqXHR || that._getXHRPromise(); - }; - data.abort = function () { - if (this.jqXHR) { - return this.jqXHR.abort(); - } - this.errorThrown = 'abort'; - that._trigger('fail', null, this); - return that._getXHRPromise(false); - }; - data.state = function () { - if (this.jqXHR) { - return that._getDeferredState(this.jqXHR); - } - if (this._processQueue) { - return that._getDeferredState(this._processQueue); + done: function done(e, data) { + $.each(data.result.files, function (index, file) { + if (!file.error) { + mediaApp.mediaItems.push(file); } - }; - data.processing = function () { - return !this.jqXHR && this._processQueue && that._getDeferredState(this._processQueue) === 'pending'; - }; - data.progress = function () { - return this._progress; - }; - data.response = function () { - return this._response; - }; + }); + } + }).on('fileuploadchunkbeforesend', function (e, options) { + var file = options.files[0]; + // Here we replace the blob with a File object to ensure the file name and others are preserved for the backend. + options.blob = new File([options.blob], file.name, { + type: file.type, + lastModified: file.lastModified + }); + }); +}); +$(document).bind('dragover', function (e) { + var dt = e.originalEvent.dataTransfer; + if (dt.types && (dt.types.indexOf ? dt.types.indexOf('Files') != -1 : dt.types.contains('Files'))) { + var dropZone = $('#customdropzone'), + timeout = window.dropZoneTimeout; + if (timeout) { + clearTimeout(timeout); + } else { + dropZone.addClass('in'); + } + var hoveredDropZone = $(e.target).closest(dropZone); + window.dropZoneTimeout = setTimeout(function () { + window.dropZoneTimeout = null; + dropZone.removeClass('in'); + }, 100); + } +}); +function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } +function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } +function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } +function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } +// component +Vue.component('folder', { + template: "\n
  • \n \n
      \n \n \n
    \n
  • \n "), + props: { + model: Object, + selectedInMediaApp: Object, + level: Number + }, + data: function data() { + return { + open: false, + children: null, + // not initialized state (for lazy-loading) + parent: null, + isHovered: false, + padding: 0 + }; + }, + computed: { + empty: function empty() { + return !this.children || this.children.length == 0; }, - // Parses the Range header from the server response - // and returns the uploaded bytes: - _getUploadedBytes: function _getUploadedBytes(jqXHR) { - var range = jqXHR.getResponseHeader('Range'), - parts = range && range.split('-'), - upperBytesPos = parts && parts.length > 1 && parseInt(parts[1], 10); - return upperBytesPos && upperBytesPos + 1; + isSelected: function isSelected() { + return this.selectedInMediaApp.name == this.model.name && this.selectedInMediaApp.path == this.model.path; }, - // Uploads a file in multiple, sequential requests - // by splitting the file up in multiple blob chunks. - // If the second parameter is true, only tests if the file - // should be uploaded in chunks, but does not invoke any - // upload requests: - _chunkedUpload: function _chunkedUpload(options, testOnly) { - options.uploadedBytes = options.uploadedBytes || 0; - var that = this, - file = options.files[0], - fs = file.size, - ub = options.uploadedBytes, - mcs = options.maxChunkSize || fs, - slice = this._blobSlice, - dfd = $.Deferred(), - promise = dfd.promise(), - jqXHR, - _upload; - if (!(this._isXHRUpload(options) && slice && (ub || ($.type(mcs) === 'function' ? mcs(options) : mcs) < fs)) || options.data) { - return false; + isRoot: function isRoot() { + return this.model.path === ''; + } + }, + mounted: function mounted() { + if (this.isRoot == false && this.isAncestorOfSelectedFolder()) { + this.toggle(); + } + this.padding = this.level < 3 ? 16 : 16 + this.level * 8; + }, + created: function created() { + var self = this; + bus.$on('deleteFolder', function (folder) { + if (self.children) { + var index = self.children && self.children.indexOf(folder); + if (index > -1) { + self.children.splice(index, 1); + bus.$emit('folderDeleted'); + } } - if (testOnly) { - return true; + }); + bus.$on('addFolder', function (target, folder) { + if (self.model == target) { + if (self.children !== null) { + self.children.push(folder); + } + folder.parent = self.model; + bus.$emit('folderAdded', folder); } - if (ub >= fs) { - file.error = options.i18n('uploadedBytes'); - return this._getXHRPromise(false, options.context, [null, 'error', file.error]); + }); + }, + methods: { + isAncestorOfSelectedFolder: function isAncestorOfSelectedFolder() { + parentFolder = mediaApp.selectedFolder; + while (parentFolder) { + if (parentFolder.path == this.model.path) { + return true; + } + parentFolder = parentFolder.parent; } - // The chunk upload method: - _upload = function upload() { - // Clone the options object for each chunk upload: - var o = $.extend({}, options), - currentLoaded = o._progress.loaded; - o.blob = slice.call(file, ub, ub + ($.type(mcs) === 'function' ? mcs(o) : mcs), file.type); - // Store the current chunk size, as the blob itself - // will be dereferenced after data processing: - o.chunkSize = o.blob.size; - // Expose the chunk bytes position range: - o.contentRange = 'bytes ' + ub + '-' + (ub + o.chunkSize - 1) + '/' + fs; - // Trigger chunkbeforesend to allow form data to be updated for this chunk - that._trigger('chunkbeforesend', null, o); - // Process the upload data (the blob and potential form data): - that._initXHRData(o); - // Add progress listeners for this chunk upload: - that._initProgressListener(o); - jqXHR = (that._trigger('chunksend', null, o) !== false && $.ajax(o) || that._getXHRPromise(false, o.context)).done(function (result, textStatus, jqXHR) { - ub = that._getUploadedBytes(jqXHR) || ub + o.chunkSize; - // Create a progress event if no final progress event - // with loaded equaling total has been triggered - // for this chunk: - if (currentLoaded + o.chunkSize - o._progress.loaded) { - that._onProgress($.Event('progress', { - lengthComputable: true, - loaded: ub - o.uploadedBytes, - total: ub - o.uploadedBytes - }), o); - } - options.uploadedBytes = o.uploadedBytes = ub; - o.result = result; - o.textStatus = textStatus; - o.jqXHR = jqXHR; - that._trigger('chunkdone', null, o); - that._trigger('chunkalways', null, o); - if (ub < fs) { - // File upload not yet complete, - // continue with the next chunk: - _upload(); - } else { - dfd.resolveWith(o.context, [result, textStatus, jqXHR]); - } - }).fail(function (jqXHR, textStatus, errorThrown) { - o.jqXHR = jqXHR; - o.textStatus = textStatus; - o.errorThrown = errorThrown; - that._trigger('chunkfail', null, o); - that._trigger('chunkalways', null, o); - dfd.rejectWith(o.context, [jqXHR, textStatus, errorThrown]); - }).always(function () { - that._deinitProgressListener(o); - }); - }; - this._enhancePromise(promise); - promise.abort = function () { - return jqXHR.abort(); - }; - _upload(); - return promise; + return false; }, - _beforeSend: function _beforeSend(e, data) { - if (this._active === 0) { - // the start callback is triggered when an upload starts - // and no other uploads are currently running, - // equivalent to the global ajaxStart event: - this._trigger('start'); - // Set timer for global bitrate progress calculation: - this._bitrateTimer = new this._BitrateTimer(); - // Reset the global progress values: - this._progress.loaded = this._progress.total = 0; - this._progress.bitrate = 0; + toggle: function toggle() { + this.open = !this.open; + if (this.open && !this.children) { + this.loadChildren(); } - // Make sure the container objects for the .response() and - // .progress() methods on the data object are available - // and reset to their initial state: - this._initResponseObject(data); - this._initProgressObject(data); - data._progress.loaded = data.loaded = data.uploadedBytes || 0; - data._progress.total = data.total = this._getTotal(data.files) || 1; - data._progress.bitrate = data.bitrate = 0; - this._active += 1; - // Initialize the global progress values: - this._progress.loaded += data.loaded; - this._progress.total += data.total; }, - _onDone: function _onDone(result, textStatus, jqXHR, options) { - var total = options._progress.total, - response = options._response; - if (options._progress.loaded < total) { - // Create a progress event if no final progress event - // with loaded equaling total has been triggered: - this._onProgress($.Event('progress', { - lengthComputable: true, - loaded: total, - total: total - }), options); - } - response.result = options.result = result; - response.textStatus = options.textStatus = textStatus; - response.jqXHR = options.jqXHR = jqXHR; - this._trigger('done', null, options); + select: function select() { + bus.$emit('folderSelected', this.model); + this.loadChildren(); }, - _onFail: function _onFail(jqXHR, textStatus, errorThrown, options) { - var response = options._response; - if (options.recalculateProgress) { - // Remove the failed (error or abort) file upload from - // the global progress calculation: - this._progress.loaded -= options._progress.loaded; - this._progress.total -= options._progress.total; - } - response.jqXHR = options.jqXHR = jqXHR; - response.textStatus = options.textStatus = textStatus; - response.errorThrown = options.errorThrown = errorThrown; - this._trigger('fail', null, options); + createFolder: function createFolder() { + bus.$emit('createFolderRequested'); }, - _onAlways: function _onAlways(jqXHRorResult, textStatus, jqXHRorError, options) { - // jqXHRorResult, textStatus and jqXHRorError are added to the - // options object via done and fail callbacks - this._trigger('always', null, options); + deleteFolder: function deleteFolder() { + bus.$emit('deleteFolderRequested'); }, - _onSend: function _onSend(e, data) { - if (!data.submit) { - this._addConvenienceMethods(e, data); + loadChildren: function loadChildren() { + var self = this; + if (this.open == false) { + this.open = true; } - var that = this, - jqXHR, - aborted, - slot, - pipe, - options = that._getAJAXSettings(data), - send = function send() { - that._sending += 1; - // Set timer for bitrate progress calculation: - options._bitrateTimer = new that._BitrateTimer(); - jqXHR = jqXHR || ((aborted || that._trigger('send', $.Event('send', { - delegatedEvent: e - }), options) === false) && that._getXHRPromise(false, options.context, aborted) || that._chunkedUpload(options) || $.ajax(options)).done(function (result, textStatus, jqXHR) { - that._onDone(result, textStatus, jqXHR, options); - }).fail(function (jqXHR, textStatus, errorThrown) { - that._onFail(jqXHR, textStatus, errorThrown, options); - }).always(function (jqXHRorResult, textStatus, jqXHRorError) { - that._deinitProgressListener(options); - that._onAlways(jqXHRorResult, textStatus, jqXHRorError, options); - that._sending -= 1; - that._active -= 1; - if (options.limitConcurrentUploads && options.limitConcurrentUploads > that._sending) { - // Start the next queued upload, - // that has not been aborted: - var nextSlot = that._slots.shift(); - while (nextSlot) { - if (that._getDeferredState(nextSlot) === 'pending') { - nextSlot.resolve(); - break; - } - nextSlot = that._slots.shift(); - } - } - if (that._active === 0) { - // The stop callback is triggered when all uploads have - // been completed, equivalent to the global ajaxStop event: - that._trigger('stop'); - } + $.ajax({ + url: $('#getFoldersUrl').val() + "?path=" + encodeURIComponent(self.model.path), + method: 'GET', + success: function success(data) { + self.children = data; + self.children.forEach(function (c) { + c.parent = self.model; }); - return jqXHR; - }; - this._beforeSend(e, options); - if (this.options.sequentialUploads || this.options.limitConcurrentUploads && this.options.limitConcurrentUploads <= this._sending) { - if (this.options.limitConcurrentUploads > 1) { - slot = $.Deferred(); - this._slots.push(slot); - pipe = slot[that._promisePipe](send); - } else { - this._sequence = this._sequence[that._promisePipe](send, send); - pipe = this._sequence; + }, + error: function error(_error) { + emtpy = false; + console.error(_error.responseText); } - // Return the piped Promise object, enhanced with an abort method, - // which is delegated to the jqXHR object of the current upload, - // and jqXHR callbacks mapped to the equivalent Promise methods: - pipe.abort = function () { - aborted = [undefined, 'abort', 'abort']; - if (!jqXHR) { - if (slot) { - slot.rejectWith(options.context, aborted); - } - return send(); - } - return jqXHR.abort(); - }; - return this._enhancePromise(pipe); - } - return send(); + }); }, - _onAdd: function _onAdd(e, data) { - var that = this, - result = true, - options = $.extend({}, this.options, data), - files = data.files, - filesLength = files.length, - limit = options.limitMultiFileUploads, - limitSize = options.limitMultiFileUploadSize, - overhead = options.limitMultiFileUploadSizeOverhead, - batchSize = 0, - paramName = this._getParamName(options), - paramNameSet, - paramNameSlice, - fileSet, - i, - j = 0; - if (!filesLength) { - return false; + handleDragOver: function handleDragOver(e) { + this.isHovered = true; + }, + handleDragLeave: function handleDragLeave(e) { + this.isHovered = false; + }, + moveMediaToFolder: function moveMediaToFolder(folder, e) { + var self = this; + self.isHovered = false; + var mediaNames = JSON.parse(e.dataTransfer.getData('mediaNames')); + if (mediaNames.length < 1) { + return; } - if (limitSize && files[0].size === undefined) { - limitSize = undefined; + var sourceFolder = e.dataTransfer.getData('sourceFolder'); + var targetFolder = folder.path; + if (sourceFolder === '') { + sourceFolder = 'root'; } - if (!(options.singleFileUploads || limit || limitSize) || !this._isXHRUpload(options)) { - fileSet = [files]; - paramNameSet = [paramName]; - } else if (!(options.singleFileUploads || limitSize) && limit) { - fileSet = []; - paramNameSet = []; - for (i = 0; i < filesLength; i += limit) { - fileSet.push(files.slice(i, i + limit)); - paramNameSlice = paramName.slice(i, i + limit); - if (!paramNameSlice.length) { - paramNameSlice = paramName; - } - paramNameSet.push(paramNameSlice); - } - } else if (!options.singleFileUploads && limitSize) { - fileSet = []; - paramNameSet = []; - for (i = 0; i < filesLength; i = i + 1) { - batchSize += files[i].size + overhead; - if (i + 1 === filesLength || batchSize + files[i + 1].size + overhead > limitSize || limit && i + 1 - j >= limit) { - fileSet.push(files.slice(j, i + 1)); - paramNameSlice = paramName.slice(j, i + 1); - if (!paramNameSlice.length) { - paramNameSlice = paramName; - } - paramNameSet.push(paramNameSlice); - j = i + 1; - batchSize = 0; + if (targetFolder === '') { + targetFolder = 'root'; + } + if (sourceFolder === targetFolder) { + alert($('#sameFolderMessage').val()); + return; + } + confirmDialog(_objectSpread(_objectSpread({}, $("#moveMedia").data()), {}, { + callback: function callback(resp) { + if (resp) { + $.ajax({ + url: $('#moveMediaListUrl').val(), + method: 'POST', + data: { + __RequestVerificationToken: $("input[name='__RequestVerificationToken']").val(), + mediaNames: mediaNames, + sourceFolder: sourceFolder, + targetFolder: targetFolder + }, + success: function success() { + bus.$emit('mediaListMoved'); // MediaApp will listen to this, and then it will reload page so the moved medias won't be there anymore + }, + error: function error(_error2) { + console.error(_error2.responseText); + bus.$emit('mediaListMoved', _error2.responseText); + } + }); } } - } else { - paramNameSet = paramName; - } - data.originalFiles = files; - $.each(fileSet || files, function (index, element) { - var newData = $.extend({}, data); - newData.files = fileSet ? element : [element]; - newData.paramName = paramNameSet[index]; - that._initResponseObject(newData); - that._initProgressObject(newData); - that._addConvenienceMethods(e, newData); - result = that._trigger('add', $.Event('add', { - delegatedEvent: e - }), newData); - return result; + })); + } + } +}); +// https://github.com/spatie/font-awesome-filetypes + +var faIcons = { + image: 'fa-regular fa-image', + pdf: 'fa-regular fa-file-pdf', + word: 'fa-regular fa-file-word', + powerpoint: 'fa-regular fa-file-powerpoint', + excel: 'fa-regular fa-file-excel', + csv: 'fa-regular fa-file', + audio: 'fa-regular fa-file-audio', + video: 'fa-regular fa-file-video', + archive: 'fa-regular fa-file-zipper', + code: 'fa-regular fa-file-code', + text: 'fa-regular fa-file-lines', + file: 'fa-regular fa-file' +}; +var faThumbnails = { + gif: faIcons.image, + jpeg: faIcons.image, + jpg: faIcons.image, + png: faIcons.image, + pdf: faIcons.pdf, + doc: faIcons.word, + docx: faIcons.word, + ppt: faIcons.powerpoint, + pptx: faIcons.powerpoint, + xls: faIcons.excel, + xlsx: faIcons.excel, + csv: faIcons.csv, + aac: faIcons.audio, + mp3: faIcons.audio, + ogg: faIcons.audio, + avi: faIcons.video, + flv: faIcons.video, + mkv: faIcons.video, + mp4: faIcons.video, + webm: faIcons.video, + gz: faIcons.archive, + zip: faIcons.archive, + css: faIcons.code, + html: faIcons.code, + js: faIcons.code, + txt: faIcons.text +}; +function getClassNameForExtension(extension) { + return faThumbnails[extension.toLowerCase()] || faIcons.file; +} +function getExtensionForFilename(filename) { + return filename.slice((filename.lastIndexOf('.') - 1 >>> 0) + 2); +} +function getClassNameForFilename(filename) { + return getClassNameForExtension(getExtensionForFilename(filename)); +} +// component +Vue.component('media-items-grid', { + template: "\n
      \n
    1. \n
      \n \n \n
      \n
      \n \n \n \n {{ media.name }}\n
      \n
    2. \n
    \n ", + data: function data() { + return { + T: {} + }; + }, + props: { + filteredMediaItems: Array, + selectedMedias: Array, + thumbSize: Number + }, + created: function created() { + var self = this; + // retrieving localized strings from view + self.T.editButton = $('#t-edit-button').val(); + self.T.deleteButton = $('#t-delete-button').val(); + }, + methods: { + isMediaSelected: function isMediaSelected(media) { + var result = this.selectedMedias.some(function (element, index, array) { + return element.url.toLowerCase() === media.url.toLowerCase(); + }); + return result; + }, + buildMediaUrl: function buildMediaUrl(url, thumbSize) { + return url + (url.indexOf('?') == -1 ? '?' : '&') + 'width=' + thumbSize + '&height=' + thumbSize; + }, + toggleSelectionOfMedia: function toggleSelectionOfMedia(media) { + bus.$emit('mediaToggleRequested', media); + }, + renameMedia: function renameMedia(media) { + bus.$emit('renameMediaRequested', media); + }, + deleteMedia: function deleteMedia(media) { + bus.$emit('deleteMediaRequested', media); + }, + dragStart: function dragStart(media, e) { + bus.$emit('mediaDragStartRequested', media, e); + }, + getfontAwesomeClassNameForFileName: function getfontAwesomeClassNameForFilename(filename, thumbsize) { + return getClassNameForFilename(filename) + ' ' + thumbsize; + } + } +}); +// component +Vue.component('media-items-table', { + template: "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {{ T.imageHeader }}\n {{ T.nameHeader }}\n \n \n {{ T.lastModifyHeader }} \n \n \n \n {{ T.sizeHeader }}\n \n \n \n \n {{ T.typeHeader }}\n \n \n
    \n
    \n \n \n
    \n
    \n \n \n
    {{ printDateTime(media.lastModify) }}
    \n
    \n
    {{ isNaN(media.size)? 0 : Math.round(media.size / 1024) }} KB
    \n
    \n
    {{ media.mime }}
    \n
    \n ", + data: function data() { + return { + T: {} + }; + }, + props: { + sortBy: String, + sortAsc: Boolean, + filteredMediaItems: Array, + selectedMedias: Array, + thumbSize: Number + }, + created: function created() { + var self = this; + self.T.imageHeader = $('#t-image-header').val(); + self.T.nameHeader = $('#t-name-header').val(); + self.T.lastModifyHeader = $('#t-lastModify-header').val(); + self.T.sizeHeader = $('#t-size-header').val(); + self.T.typeHeader = $('#t-type-header').val(); + self.T.editButton = $('#t-edit-button').val(); + self.T.deleteButton = $('#t-delete-button').val(); + self.T.viewButton = $('#t-view-button').val(); + }, + methods: { + isMediaSelected: function isMediaSelected(media) { + var result = this.selectedMedias.some(function (element, index, array) { + return element.url.toLowerCase() === media.url.toLowerCase(); }); return result; }, - _replaceFileInput: function _replaceFileInput(data) { - var input = data.fileInput, - inputClone = input.clone(true), - restoreFocus = input.is(document.activeElement); - // Add a reference for the new cloned file input to the data argument: - data.fileInputClone = inputClone; - $('
    ').append(inputClone)[0].reset(); - // Detaching allows to insert the fileInput on another form - // without losing the file input value: - input.after(inputClone).detach(); - // If the fileInput had focus before it was detached, - // restore focus to the inputClone. - if (restoreFocus) { - inputClone.trigger('focus'); - } - // Avoid memory leaks with the detached file input: - $.cleanData(input.off('remove')); - // Replace the original file input element in the fileInput - // elements set with the clone, which has been copied including - // event handlers: - this.options.fileInput = this.options.fileInput.map(function (i, el) { - if (el === input[0]) { - return inputClone[0]; - } - return el; - }); - // If the widget has been initialized on the file input itself, - // override this.element with the file input clone: - if (input[0] === this.element[0]) { - this.element = inputClone; - } + buildMediaUrl: function buildMediaUrl(url, thumbSize) { + return url + (url.indexOf('?') == -1 ? '?' : '&') + 'width=' + thumbSize + '&height=' + thumbSize; }, - _handleFileTreeEntry: function _handleFileTreeEntry(entry, path) { - var that = this, - dfd = $.Deferred(), - entries = [], - dirReader, - errorHandler = function errorHandler(e) { - if (e && !e.entry) { - e.entry = entry; - } - // Since $.when returns immediately if one - // Deferred is rejected, we use resolve instead. - // This allows valid files and invalid items - // to be returned together in one set: - dfd.resolve([e]); - }, - successHandler = function successHandler(entries) { - that._handleFileTreeEntries(entries, path + entry.name + '/').done(function (files) { - dfd.resolve(files); - }).fail(errorHandler); - }, - readEntries = function readEntries() { - dirReader.readEntries(function (results) { - if (!results.length) { - successHandler(entries); - } else { - entries = entries.concat(results); - readEntries(); - } - }, errorHandler); - }; - // eslint-disable-next-line no-param-reassign - path = path || ''; - if (entry.isFile) { - if (entry._file) { - // Workaround for Chrome bug #149735 - entry._file.relativePath = path; - dfd.resolve(entry._file); - } else { - entry.file(function (file) { - file.relativePath = path; - dfd.resolve(file); - }, errorHandler); - } - } else if (entry.isDirectory) { - dirReader = entry.createReader(); - readEntries(); - } else { - // Return an empty list for file system items - // other than files or directories: - dfd.resolve([]); - } - return dfd.promise(); + changeSort: function changeSort(newSort) { + bus.$emit('sortChangeRequested', newSort); }, - _handleFileTreeEntries: function _handleFileTreeEntries(entries, path) { - var that = this; - return $.when.apply($, $.map(entries, function (entry) { - return that._handleFileTreeEntry(entry, path); - }))[this._promisePipe](function () { - return Array.prototype.concat.apply([], arguments); - }); + toggleSelectionOfMedia: function toggleSelectionOfMedia(media) { + bus.$emit('mediaToggleRequested', media); }, - _getDroppedFiles: function _getDroppedFiles(dataTransfer) { - // eslint-disable-next-line no-param-reassign - dataTransfer = dataTransfer || {}; - var items = dataTransfer.items; - if (items && items.length && (items[0].webkitGetAsEntry || items[0].getAsEntry)) { - return this._handleFileTreeEntries($.map(items, function (item) { - var entry; - if (item.webkitGetAsEntry) { - entry = item.webkitGetAsEntry(); - if (entry) { - // Workaround for Chrome bug #149735: - entry._file = item.getAsFile(); - } - return entry; - } - return item.getAsEntry(); - })); - } - return $.Deferred().resolve($.makeArray(dataTransfer.files)).promise(); + renameMedia: function renameMedia(media) { + bus.$emit('renameMediaRequested', media); }, - _getSingleFileInputFiles: function _getSingleFileInputFiles(fileInput) { - // eslint-disable-next-line no-param-reassign - fileInput = $(fileInput); - var entries = fileInput.prop('entries'), - files, - value; - if (entries && entries.length) { - return this._handleFileTreeEntries(entries); - } - files = $.makeArray(fileInput.prop('files')); - if (!files.length) { - value = fileInput.prop('value'); - if (!value) { - return $.Deferred().resolve([]).promise(); - } - // If the files property is not available, the browser does not - // support the File API and we add a pseudo File object with - // the input value as name with path information removed: - files = [{ - name: value.replace(/^.*\\/, '') - }]; - } else if (files[0].name === undefined && files[0].fileName) { - // File normalization for Safari 4 and Firefox 3: - $.each(files, function (index, file) { - file.name = file.fileName; - file.size = file.fileSize; - }); - } - return $.Deferred().resolve(files).promise(); + deleteMedia: function deleteMedia(media) { + bus.$emit('deleteMediaRequested', media); }, - _getFileInputFiles: function _getFileInputFiles(fileInput) { - if (!(fileInput instanceof $) || fileInput.length === 1) { - return this._getSingleFileInputFiles(fileInput); - } - return $.when.apply($, $.map(fileInput, this._getSingleFileInputFiles))[this._promisePipe](function () { - return Array.prototype.concat.apply([], arguments); - }); + dragStart: function dragStart(media, e) { + bus.$emit('mediaDragStartRequested', media, e); }, - _onChange: function _onChange(e) { - var that = this, - data = { - fileInput: $(e.target), - form: $(e.target.form) - }; - this._getFileInputFiles(data.fileInput).always(function (files) { - data.files = files; - if (that.options.replaceFileInput) { - that._replaceFileInput(data); - } - if (that._trigger('change', $.Event('change', { - delegatedEvent: e - }), data) !== false) { - that._onAdd(e, data); - } - }); + printDateTime: function printDateTime(datemillis) { + var d = new Date(datemillis); + return d.toLocaleString(); + }, + getfontAwesomeClassNameForFileName: function getfontAwesomeClassNameForFilename(filename, thumbsize) { + return getClassNameForFilename(filename) + ' ' + thumbsize; + } + } +}); +// This component receives a list of all the items, unpaged. +// As the user interacts with the pager, it raises events with the items in the current page. +// It's the parent's responsibility to listen for these events and display the received items +// component +Vue.component('pager', { + template: "\n
    \n \n \n
    \n ", + props: { + sourceItems: Array + }, + data: function data() { + return { + pageSize: 10, + pageSizeOptions: [10, 30, 50, 100], + current: 0, + T: {} + }; + }, + created: function created() { + var self = this; + + // retrieving localized strings from view + self.T.pagerFirstButton = $('#t-pager-first-button').val(); + self.T.pagerPreviousButton = $('#t-pager-previous-button').val(); + self.T.pagerNextButton = $('#t-pager-next-button').val(); + self.T.pagerLastButton = $('#t-pager-last-button').val(); + self.T.pagerPageSizeLabel = $('#t-pager-page-size-label').val(); + self.T.pagerPageLabel = $('#t-pager-page-label').val(); + self.T.pagerTotalLabel = $('#t-pager-total-label').val(); + }, + methods: { + next: function next() { + this.current = this.current + 1; + }, + previous: function previous() { + this.current = this.current - 1; + }, + goFirst: function goFirst() { + this.current = 0; + }, + goLast: function goLast() { + this.current = this.totalPages - 1; + }, + goTo: function goTo(targetPage) { + this.current = targetPage; + } + }, + computed: { + total: function total() { + return this.sourceItems ? this.sourceItems.length : 0; + }, + totalPages: function totalPages() { + var pages = Math.ceil(this.total / this.pageSize); + return pages > 0 ? pages : 1; + }, + isLastPage: function isLastPage() { + return this.current + 1 >= this.totalPages; }, - _onPaste: function _onPaste(e) { - var items = e.originalEvent && e.originalEvent.clipboardData && e.originalEvent.clipboardData.items, - data = { - files: [] - }; - if (items && items.length) { - $.each(items, function (index, item) { - var file = item.getAsFile && item.getAsFile(); - if (file) { - data.files.push(file); - } - }); - if (this._trigger('paste', $.Event('paste', { - delegatedEvent: e - }), data) !== false) { - this._onAdd(e, data); - } - } + isFirstPage: function isFirstPage() { + return this.current === 0; }, - _onDrop: function _onDrop(e) { - e.dataTransfer = e.originalEvent && e.originalEvent.dataTransfer; - var that = this, - dataTransfer = e.dataTransfer, - data = {}; - if (dataTransfer && dataTransfer.files && dataTransfer.files.length) { - e.preventDefault(); - this._getDroppedFiles(dataTransfer).always(function (files) { - data.files = files; - if (that._trigger('drop', $.Event('drop', { - delegatedEvent: e - }), data) !== false) { - that._onAdd(e, data); - } - }); - } + canDoNext: function canDoNext() { + return !this.isLastPage; }, - _onDragOver: getDragHandler('dragover'), - _onDragEnter: getDragHandler('dragenter'), - _onDragLeave: getDragHandler('dragleave'), - _initEventHandlers: function _initEventHandlers() { - if (this._isXHRUpload(this.options)) { - this._on(this.options.dropZone, { - dragover: this._onDragOver, - drop: this._onDrop, - // event.preventDefault() on dragenter is required for IE10+: - dragenter: this._onDragEnter, - // dragleave is not required, but added for completeness: - dragleave: this._onDragLeave - }); - this._on(this.options.pasteZone, { - paste: this._onPaste - }); - } - if ($.support.fileInput) { - this._on(this.options.fileInput, { - change: this._onChange - }); - } + canDoPrev: function canDoPrev() { + return !this.isFirstPage; }, - _destroyEventHandlers: function _destroyEventHandlers() { - this._off(this.options.dropZone, 'dragenter dragleave dragover drop'); - this._off(this.options.pasteZone, 'paste'); - this._off(this.options.fileInput, 'change'); + canDoFirst: function canDoFirst() { + return !this.isFirstPage; }, - _destroy: function _destroy() { - this._destroyEventHandlers(); + canDoLast: function canDoLast() { + return !this.isLastPage; }, - _setOption: function _setOption(key, value) { - var reinit = $.inArray(key, this._specialOptions) !== -1; - if (reinit) { - this._destroyEventHandlers(); - } - this._super(key, value); - if (reinit) { - this._initSpecialOptions(); - this._initEventHandlers(); - } + // this computed is only to have a central place where we detect changes and leverage Vue JS reactivity to raise our event. + // That event will be handled by the parent media app to display the items in the page. + // this logic will not run if the computed property is not used in the template. We use a dummy "data-computed-trigger" attribute for that. + itemsInCurrentPage: function itemsInCurrentPage() { + var start = this.pageSize * this.current; + var end = start + this.pageSize; + var result = this.sourceItems.slice(start, end); + bus.$emit('pagerEvent', result); + return result; }, - _initSpecialOptions: function _initSpecialOptions() { - var options = this.options; - if (options.fileInput === undefined) { - options.fileInput = this.element.is('input[type="file"]') ? this.element : this.element.find('input[type="file"]'); - } else if (!(options.fileInput instanceof $)) { - options.fileInput = $(options.fileInput); - } - if (!(options.dropZone instanceof $)) { - options.dropZone = $(options.dropZone); - } - if (!(options.pasteZone instanceof $)) { - options.pasteZone = $(options.pasteZone); + pageLinks: function pageLinks() { + var links = []; + links.push(this.current + 1); + + // Add 2 items before current + var beforeCurrent = this.current > 0 ? this.current : -1; + links.unshift(beforeCurrent); + var beforeBeforeCurrent = this.current > 1 ? this.current - 1 : -1; + links.unshift(beforeBeforeCurrent); + + // Add 2 items after current + var afterCurrent = this.totalPages - this.current > 1 ? this.current + 2 : -1; + links.push(afterCurrent); + var afterAfterCurrent = this.totalPages - this.current > 2 ? this.current + 3 : -1; + links.push(afterAfterCurrent); + return links; + } + }, + watch: { + sourceItems: function sourceItems() { + this.current = 0; // resetting current page after receiving a new list of unpaged items + }, + pageSize: function pageSize() { + this.current = 0; + } + } +}); +// component +Vue.component('sortIndicator', { + template: "\n
    \n \n \n
    \n ", + props: { + colname: String, + selectedcolname: String, + asc: Boolean + }, + computed: { + isActive: function isActive() { + return this.colname.toLowerCase() == this.selectedcolname.toLowerCase(); + } + } +}); +function initializeAttachedMediaField(el, idOfUploadButton, uploadAction, mediaItemUrl, allowMultiple, allowMediaText, allowAnchors, tempUploadFolder, maxUploadChunkSize) { + var target = $(document.getElementById($(el).data('for'))); + var initialPaths = target.data("init"); + var mediaFieldEditor = $(el); + var idprefix = mediaFieldEditor.attr("id"); + var mediaFieldApp; + mediaFieldApps.push(mediaFieldApp = new Vue({ + el: mediaFieldEditor.get(0), + data: { + mediaItems: [], + selectedMedia: null, + smallThumbs: false, + idPrefix: idprefix, + initialized: false, + allowMediaText: allowMediaText, + backupMediaText: '', + allowAnchors: allowAnchors, + backupAnchor: null, + mediaTextmodal: null, + anchoringModal: null + }, + created: function created() { + var self = this; + self.currentPrefs = JSON.parse(localStorage.getItem('mediaFieldPrefs')); + }, + computed: { + paths: { + get: function get() { + var mediaPaths = []; + if (!this.initialized) { + return JSON.stringify(initialPaths); + } + this.mediaItems.forEach(function (x) { + if (x.mediaPath === 'not-found') { + return; + } + mediaPaths.push({ + path: x.mediaPath, + isRemoved: x.isRemoved, + isNew: x.isNew, + mediaText: x.mediaText, + anchor: x.anchor, + attachedFileName: x.attachedFileName + }); + }); + return JSON.stringify(mediaPaths); + }, + set: function set(values) { + var self = this; + var mediaPaths = values || []; + var signal = $.Deferred(); + var items = []; + var length = 0; + mediaPaths.forEach(function (x, i) { + items.push({ + name: ' ' + x.path, + mime: '', + mediaPath: '', + anchor: x.anchor, + attachedFileName: x.attachedFileName + }); // don't remove the space. Something different is needed or it wont react when the real name arrives. + promise = $.when(signal).done(function () { + $.ajax({ + url: mediaItemUrl + "?path=" + encodeURIComponent(x.path), + method: 'GET', + success: function success(data) { + data.vuekey = data.name + i.toString(); // Because a unique key is required by Vue on v-for + data.mediaText = x.mediaText; // This value is not returned from the ajax call. + data.anchor = x.anchor; // This value is not returned from the ajax call. + data.attachedFileName = x.attachedFileName; // This value is not returned from the ajax call. + items.splice(i, 1, data); + if (items.length === ++length) { + items.forEach(function (x) { + self.mediaItems.push(x); + }); + self.initialized = true; + } + }, + error: function error(_error) { + console.log(JSON.stringify(_error)); + items.splice(i, 1, { + name: x.path, + mime: '', + mediaPath: 'not-found', + mediaText: '', + anchor: { + x: 0.5, + y: 0.5 + }, + attachedFileName: x.attachedFileName + }); + if (items.length === ++length) { + items.forEach(function (x) { + self.mediaItems.push(x); + }); + self.initialized = true; + } + } + }); + }); + }); + signal.resolve(); + } + }, + fileSize: function fileSize() { + return Math.round(this.selectedMedia.size / 1024); + }, + canAddMedia: function canAddMedia() { + var nonRemovedMediaItems = []; + for (var i = 0; i < this.mediaItems.length; i++) { + if (!this.mediaItems[i].isRemoved) { + nonRemovedMediaItems.push(this.mediaItems[i]); + } + } + return nonRemovedMediaItems.length === 0 || nonRemovedMediaItems.length > 0 && allowMultiple; + }, + thumbSize: function thumbSize() { + return this.smallThumbs ? 120 : 240; + }, + currentPrefs: { + get: function get() { + return { + smallThumbs: this.smallThumbs + }; + }, + set: function set(newPrefs) { + if (!newPrefs) { + return; + } + this.smallThumbs = newPrefs.smallThumbs; + } } }, - _getRegExp: function _getRegExp(str) { - var parts = str.split('/'), - modifiers = parts.pop(); - parts.shift(); - return new RegExp(parts.join('/'), modifiers); - }, - _isRegExpOption: function _isRegExpOption(key, value) { - return key !== 'url' && $.type(value) === 'string' && /^\/.*\/[igm]{0,3}$/.test(value); - }, - _initDataAttributes: function _initDataAttributes() { - var that = this, - options = this.options, - data = this.element.data(); - // Initialize options set via HTML5 data-attributes: - $.each(this.element[0].attributes, function (index, attr) { - var key = attr.name.toLowerCase(), - value; - if (/^data-/.test(key)) { - // Convert hyphen-ated key to camelCase: - key = key.slice(5).replace(/-[a-z]/g, function (str) { - return str.charAt(1).toUpperCase(); - }); - value = data[key]; - if (that._isRegExpOption(key, value)) { - value = that._getRegExp(value); + mounted: function mounted() { + var self = this; + self.paths = initialPaths; + self.$on('selectAndDeleteMediaRequested', function (media) { + self.selectAndDeleteMedia(media); + }); + self.$on('selectMediaRequested', function (media) { + self.selectMedia(media); + }); + var selector = '#' + idOfUploadButton; + var editorId = mediaFieldEditor.attr('id'); + var chunkedFileUploadId = randomUUID(); + $(selector).fileupload({ + limitConcurrentUploads: 20, + dropZone: $('#' + editorId), + dataType: 'json', + url: uploadAction, + maxChunkSize: maxUploadChunkSize, + add: function add(e, data) { + var count = data.files.length; + var i; + for (i = 0; i < count; i++) { + data.files[i].uploadName = self.getUniqueId() + data.files[i].name; + data.files[i].attachedFileName = data.files[i].name; } - options[key] = value; + data.submit(); + }, + formData: function formData() { + var antiForgeryToken = $("input[name=__RequestVerificationToken]").val(); + return [{ + name: 'path', + value: tempUploadFolder + }, { + name: '__RequestVerificationToken', + value: antiForgeryToken + }, { + name: '__chunkedFileUploadId', + value: chunkedFileUploadId + }]; + }, + done: function done(e, data) { + var newMediaItems = []; + var errormsg = ""; + if (data.result.files.length > 0) { + for (var i = 0; i < data.result.files.length; i++) { + data.result.files[i].isNew = true; + //if error is defined probably the file type is not allowed + if (data.result.files[i].error === undefined || data.result.files[i].error === null) { + data.result.files[i].attachedFileName = data.files[i].attachedFileName; + newMediaItems.push(data.result.files[i]); + } else errormsg += data.result.files[i].error + "\n"; + } + } + if (errormsg !== "") { + alert(errormsg); + return; + } + console.log(newMediaItems); + if (newMediaItems.length > 1 && allowMultiple === false) { + alert($('#onlyOneItemMessage').val()); + mediaFieldApp.mediaItems.push(newMediaItems[0]); + mediaFieldApp.initialized = true; + } else { + mediaFieldApp.mediaItems = mediaFieldApp.mediaItems.concat(newMediaItems); + mediaFieldApp.initialized = true; + } + }, + error: function error(jqXHR, textStatus, errorThrown) { + console.log('Error on upload.'); + console.log(jqXHR); + console.log(textStatus); + console.log(errorThrown); } + }).on('fileuploadchunkbeforesend', function (e, options) { + var file = options.files[0]; + // Here we replace the blob with a File object to ensure the file name and others are preserved for the backend. + options.blob = new File([options.blob], file.name, { + type: file.type, + lastModified: file.lastModified + }); }); }, - _create: function _create() { - this._initDataAttributes(); - this._initSpecialOptions(); - this._slots = []; - this._sequence = this._getXHRPromise(true); - this._sending = this._active = 0; - this._initProgressObject(this); - this._initEventHandlers(); - }, - // This method is exposed to the widget API and allows to query - // the number of active uploads: - active: function active() { - return this._active; - }, - // This method is exposed to the widget API and allows to query - // the widget upload progress. - // It returns an object with loaded, total and bitrate properties - // for the running uploads: - progress: function progress() { - return this._progress; - }, - // This method is exposed to the widget API and allows adding files - // using the fileupload API. The data parameter accepts an object which - // must have a files property and can contain additional options: - // .fileupload('add', {files: filesList}); - add: function add(data) { - var that = this; - if (!data || this.options.disabled) { - return; - } - if (data.fileInput && !data.files) { - this._getFileInputFiles(data.fileInput).always(function (files) { - data.files = files; - that._onAdd(null, data); + methods: { + selectMedia: function selectMedia(media) { + this.selectedMedia = media; + }, + getUniqueId: function getUniqueId() { + return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) { + var r = Math.random() * 16 | 0, + v = c === 'x' ? r : r & 0x3 | 0x8; + return v.toString(16); }); - } else { - data.files = $.makeArray(data.files); - this._onAdd(null, data); + }, + removeSelected: function removeSelected(event) { + var removed = {}; + if (this.selectedMedia) { + var index = this.mediaItems && this.mediaItems.indexOf(this.selectedMedia); + if (index > -1) { + removed = this.mediaItems[index]; + removed.isRemoved = true; + //this.mediaItems.splice([index], 1, removed); + this.mediaItems.splice(index, 1); + } + } else { + // The remove button can also remove a unique media item + if (this.mediaItems.length === 1) { + removed = this.mediaItems[index]; + removed.isRemoved = true; + //this.mediaItems.splice(0, 1, removed); + this.mediaItems.splice(0, 1); + } + } + this.selectedMedia = null; + }, + showMediaTextModal: function showMediaTextModal(event) { + this.mediaTextModal = new bootstrap.Modal(this.$refs.mediaTextModal); + this.mediaTextModal.show(); + this.backupMediaText = this.selectedMedia.mediaText; + }, + cancelMediaTextModal: function cancelMediaTextModal(event) { + this.mediaTextModal.hide(); + this.selectedMedia.mediaText = this.backupMediaText; + }, + showAnchorModal: function showAnchorModal(event) { + this.anchoringModal = new bootstrap.Modal(this.$refs.anchoringModal); + this.anchoringModal.show(); + // Cause a refresh to recalc heights. + this.selectedMedia.anchor = { + x: this.selectedMedia.anchor.x, + y: this.selectedMedia.anchor.y + }; + this.backupAnchor = this.selectedMedia.anchor; + }, + cancelAnchoringModal: function cancelAnchoringModal(event) { + this.anchoringModal.hide(); + this.selectedMedia.anchor = this.backupAnchor; + }, + resetAnchor: function resetAnchor(event) { + this.selectedMedia.anchor = { + x: 0.5, + y: 0.5 + }; + }, + onAnchorDrop: function onAnchorDrop(event) { + var image = this.$refs.anchorImage; + this.selectedMedia.anchor = { + x: event.offsetX / image.clientWidth, + y: event.offsetY / image.clientHeight + }; + }, + anchorLeft: function anchorLeft() { + if (this.$refs.anchorImage && this.$refs.modalBody && this.selectedMedia) { + // When image is shrunk compare against the modal body. + var offset = (this.$refs.modalBody.clientWidth - this.$refs.anchorImage.clientWidth) / 2; + var position = this.selectedMedia.anchor.x * this.$refs.anchorImage.clientWidth + offset; + if (position < 17) { + // Adjust so the target doesn't show outside image. + position = 17; + } else { + position = position - 8; // Adjust to hit the mouse pointer. + } + return position + 'px'; + } else { + return '0'; + } + }, + anchorTop: function anchorTop() { + if (this.$refs.anchorImage && this.selectedMedia) { + var position = this.selectedMedia.anchor.y * this.$refs.anchorImage.clientHeight; + if (position < 15) { + // Adjustment so the target doesn't show outside image. + position = 15; + } else { + position = position + 5; // Adjust to hit the mouse pointer. + } + return position + 'px'; + } else { + return '0'; + } + }, + setAnchor: function setAnchor(event) { + var image = this.$refs.anchorImage; + this.selectedMedia.anchor = { + x: event.offsetX / image.clientWidth, + y: event.offsetY / image.clientHeight + }; + }, + addMediaFiles: function addMediaFiles(files) { + if (files.length > 1 && allowMultiple === false) { + alert($('#onlyOneItemMessage').val()); + mediaFieldApp.mediaItems.push(files[0]); + mediaFieldApp.initialized = true; + } else { + mediaFieldApp.mediaItems = mediaFieldApp.mediaItems.concat(files); + mediaFieldApp.initialized = true; + } + }, + selectAndDeleteMedia: function selectAndDeleteMedia(media) { + var self = this; + self.selectedMedia = media; + // setTimeout because sometimes + // removeSelected was called even before the media was set. + setTimeout(function () { + self.removeSelected(); + }, 100); } }, - // This method is exposed to the widget API and allows sending files - // using the fileupload API. The data parameter accepts an object which - // must have a files or fileInput property and can contain additional options: - // .fileupload('send', {files: filesList}); - // The method returns a Promise object for the file upload call. - send: function send(data) { - if (data && !this.options.disabled) { - if (data.fileInput && !data.files) { - var that = this, - dfd = $.Deferred(), - promise = dfd.promise(), - jqXHR, - aborted; - promise.abort = function () { - aborted = true; - if (jqXHR) { - return jqXHR.abort(); - } - dfd.reject(null, 'abort', 'abort'); - return promise; - }; - this._getFileInputFiles(data.fileInput).always(function (files) { - if (aborted) { - return; - } - if (!files.length) { - dfd.reject(); - return; - } - data.files = files; - jqXHR = that._onSend(null, data); - jqXHR.then(function (result, textStatus, jqXHR) { - dfd.resolve(result, textStatus, jqXHR); - }, function (jqXHR, textStatus, errorThrown) { - dfd.reject(jqXHR, textStatus, errorThrown); - }); - }); - return this._enhancePromise(promise); - } - data.files = $.makeArray(data.files); - if (data.files.length) { - return this._onSend(null, data); + watch: { + mediaItems: { + deep: true, + handler: function handler() { + // Trigger preview rendering + setTimeout(function () { + $(document).trigger('contentpreview:render'); + }, 100); } + }, + currentPrefs: function currentPrefs(newPrefs) { + localStorage.setItem('mediaFieldPrefs', JSON.stringify(newPrefs)); } - return this._getXHRPromise(false, data && data.context); } - }); -}); -function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } -/* - * jQuery Iframe Transport Plugin - * https://github.com/blueimp/jQuery-File-Upload - * - * Copyright 2011, Sebastian Tschan - * https://blueimp.net - * - * Licensed under the MIT license: - * https://opensource.org/licenses/MIT - */ - -/* global define, require */ - -(function (factory) { - 'use strict'; - - if (typeof define === 'function' && define.amd) { - // Register as an anonymous AMD module: - define(['jquery'], factory); - } else if ((typeof exports === "undefined" ? "undefined" : _typeof(exports)) === 'object') { - // Node/CommonJS: - factory(require('jquery')); - } else { - // Browser globals: - factory(window.jQuery); - } -})(function ($) { - 'use strict'; + })); +} +// component +// different media field editors share this component to present the thumbs. +Vue.component('mediaFieldThumbsContainer', { + template: '\ +
    \ +
    \ +
    \ + {{T.noImages}}\ +
    \ +
    \ + \ +
  • \ +
    \ +
    \ + \ + \ +
    \ +
    \ + \ + \ + {{ media.isNew ? media.name.substr(36) : media.name }}\ +
    \ +
    \ +
    \ +
    \ + \ + {{ T.mediaNotFound }}\ + {{ T.discardWarning }}\ +
    \ +
    \ + \ + {{ media.name }}\ +
    \ +
    \ +
  • \ +
    \ +
    \ + ', + data: function data() { + return { + T: {} + }; + }, + props: { + mediaItems: Array, + selectedMedia: Object, + thumbSize: Number, + idPrefix: String + }, + created: function created() { + var self = this; - // Helper variable to create unique names for the transport iframes: - var counter = 0, - jsonAPI = $, - jsonParse = 'parseJSON'; - if ('JSON' in window && 'parse' in JSON) { - jsonAPI = JSON; - jsonParse = 'parse'; + // retrieving localized strings from view + self.T.mediaNotFound = $('#t-media-not-found').val(); + self.T.discardWarning = $('#t-discard-warning').val(); + self.T.noImages = $('#t-no-images').val(); + }, + methods: { + selectAndDeleteMedia: function selectAndDeleteMedia(media) { + this.$parent.$emit('selectAndDeleteMediaRequested', media); + }, + selectMedia: function selectMedia(media) { + this.$parent.$emit('selectMediaRequested', media); + }, + buildMediaUrl: function buildMediaUrl(url, thumbSize) { + return url + (url.indexOf('?') == -1 ? '?' : '&') + 'width=' + thumbSize + '&height=' + thumbSize; + }, + getfontAwesomeClassNameForFileName: function getfontAwesomeClassNameForFilename(filename, thumbsize) { + return getClassNameForFilename(filename) + ' ' + thumbsize; + } } +}); +function initializeMediaField(el, modalBodyElement, mediaItemUrl, allowMultiple, allowMediaText, allowAnchors) { + //BagPart create a script section without other DOM elements + if (el === null) return; + var target = $(document.getElementById($(el).data('for'))); + var initialPaths = target.data("init"); + var mediaFieldEditor = $(el); + var idprefix = mediaFieldEditor.attr("id"); + var mediaFieldApp; - // The iframe transport accepts four additional options: - // options.fileInput: a jQuery collection of file input fields - // options.paramName: the parameter name for the file form data, - // overrides the name property of the file input field(s), - // can be a string or an array of strings. - // options.formData: an array of objects with name and value properties, - // equivalent to the return data of .serializeArray(), e.g.: - // [{name: 'a', value: 1}, {name: 'b', value: 2}] - // options.initialIframeSrc: the URL of the initial iframe src, - // by default set to "javascript:false;" - $.ajaxTransport('iframe', function (options) { - if (options.async) { - // javascript:false as initial iframe src - // prevents warning popups on HTTPS in IE6: - // eslint-disable-next-line no-script-url - var initialIframeSrc = options.initialIframeSrc || 'javascript:false;', - form, - iframe, - addParamChar; - return { - send: function send(_, completeCallback) { - form = $('
    '); - form.attr('accept-charset', options.formAcceptCharset); - addParamChar = /\?/.test(options.url) ? '&' : '?'; - // XDomainRequest only supports GET and POST: - if (options.type === 'DELETE') { - options.url = options.url + addParamChar + '_method=DELETE'; - options.type = 'POST'; - } else if (options.type === 'PUT') { - options.url = options.url + addParamChar + '_method=PUT'; - options.type = 'POST'; - } else if (options.type === 'PATCH') { - options.url = options.url + addParamChar + '_method=PATCH'; - options.type = 'POST'; + //when hide modal detach media app to avoid issue on BagPart + modalBodyElement.addEventListener('hidden.bs.modal', function (event) { + $("#mediaApp").appendTo('body'); + $("#mediaApp").hide(); + }); + mediaFieldApps.push(mediaFieldApp = new Vue({ + el: mediaFieldEditor.get(0), + data: { + mediaItems: [], + selectedMedia: null, + smallThumbs: false, + idPrefix: idprefix, + initialized: false, + allowMediaText: allowMediaText, + backupMediaText: '', + allowAnchors: allowAnchors, + backupAnchor: null, + mediaTextModal: null, + anchoringModal: null + }, + created: function created() { + var self = this; + self.currentPrefs = JSON.parse(localStorage.getItem('mediaFieldPrefs')); + }, + computed: { + paths: { + get: function get() { + var mediaPaths = []; + if (!this.initialized) { + return JSON.stringify(initialPaths); } - // IE versions below IE8 cannot set the name property of - // elements that have already been added to the DOM, - // so we set the name along with the iframe HTML markup: - counter += 1; - iframe = $('').on('load', function () { - var fileInputClones, - paramNames = $.isArray(options.paramName) ? options.paramName : [options.paramName]; - iframe.off('load').on('load', function () { - var response; - // Wrap in a try/catch block to catch exceptions thrown - // when trying to access cross-domain iframe contents: - try { - response = iframe.contents(); - // Google Chrome and Firefox do not throw an - // exception when calling iframe.contents() on - // cross-domain requests, so we unify the response: - if (!response.length || !response[0].firstChild) { - throw new Error(); + this.mediaItems.forEach(function (x) { + if (x.mediaPath === 'not-found') { + return; + } + mediaPaths.push({ + path: x.mediaPath, + mediaText: x.mediaText, + anchor: x.anchor + }); + }); + return JSON.stringify(mediaPaths); + }, + set: function set(values) { + var self = this; + var mediaPaths = values || []; + var signal = $.Deferred(); + var items = []; + var length = 0; + mediaPaths.forEach(function (x, i) { + items.push({ + name: ' ' + x.path, + mime: '', + mediaPath: '' + }); // don't remove the space. Something different is needed or it wont react when the real name arrives. + promise = $.when(signal).done(function () { + $.ajax({ + url: mediaItemUrl + "?path=" + encodeURIComponent(x.path), + method: 'GET', + success: function success(data) { + data.vuekey = data.name + i.toString(); + data.mediaText = x.mediaText; // This value is not returned from the ajax call. + data.anchor = x.anchor; // This value is not returned from the ajax call. + items.splice(i, 1, data); + if (items.length === ++length) { + items.forEach(function (y) { + self.mediaItems.push(y); + }); + self.initialized = true; + } + }, + error: function error(_error) { + console.log(_error); + items.splice(i, 1, { + name: x.path, + mime: '', + mediaPath: 'not-found', + mediaText: '', + anchor: { + x: 0, + y: 0 + } + }); + if (items.length === ++length) { + items.forEach(function (x) { + self.mediaItems.push(x); + }); + self.initialized = true; + } } - } catch (e) { - response = undefined; - } - // The complete callback returns the - // iframe content document as response object: - completeCallback(200, 'success', { - iframe: response }); - // Fix for IE endless progress bar activity bug - // (happens on form submits to iframe targets): - $('').appendTo(form); - window.setTimeout(function () { - // Removing the form in a setTimeout call - // allows Chrome's developer tools to display - // the response result - form.remove(); - }, 0); }); - form.prop('target', iframe.prop('name')).prop('action', options.url).prop('method', options.type); - if (options.formData) { - $.each(options.formData, function (index, field) { - $('').prop('name', field.name).val(field.value).appendTo(form); - }); - } - if (options.fileInput && options.fileInput.length && options.type === 'POST') { - fileInputClones = options.fileInput.clone(); - // Insert a clone for each file input field: - options.fileInput.after(function (index) { - return fileInputClones[index]; - }); - if (options.paramName) { - options.fileInput.each(function (index) { - $(this).prop('name', paramNames[index] || options.paramName); - }); - } - // Appending the file input fields to the hidden form - // removes them from their original location: - form.append(options.fileInput).prop('enctype', 'multipart/form-data') - // enctype must be set as encoding for IE: - .prop('encoding', 'multipart/form-data'); - // Remove the HTML5 form attribute from the input(s): - options.fileInput.removeAttr('form'); - } - window.setTimeout(function () { - // Submitting the form in a setTimeout call fixes an issue with - // Safari 13 not triggering the iframe load event after resetting - // the load event handler, see also: - // https://github.com/blueimp/jQuery-File-Upload/issues/3633 - form.submit(); - // Insert the file input fields at their original location - // by replacing the clones with the originals: - if (fileInputClones && fileInputClones.length) { - options.fileInput.each(function (index, input) { - var clone = $(fileInputClones[index]); - // Restore the original name and form properties: - $(input).prop('name', clone.prop('name')).attr('form', clone.attr('form')); - clone.replaceWith(input); - }); - } - }, 0); }); - form.append(iframe).appendTo(document.body); + signal.resolve(); + } + }, + fileSize: function fileSize() { + return Math.round(this.selectedMedia.size / 1024); + }, + canAddMedia: function canAddMedia() { + return this.mediaItems.length === 0 || this.mediaItems.length > 0 && allowMultiple; + }, + thumbSize: function thumbSize() { + return this.smallThumbs ? 120 : 240; + }, + currentPrefs: { + get: function get() { + return { + smallThumbs: this.smallThumbs + }; }, - abort: function abort() { - if (iframe) { - // javascript:false as iframe src aborts the request - // and prevents warning popups on HTTPS in IE6. - iframe.off('load').prop('src', initialIframeSrc); + set: function set(newPrefs) { + if (!newPrefs) { + return; } - if (form) { - form.remove(); + this.smallThumbs = newPrefs.smallThumbs; + } + } + }, + mounted: function mounted() { + var self = this; + self.paths = initialPaths; + self.$on('selectAndDeleteMediaRequested', function (media) { + self.selectAndDeleteMedia(media); + }); + self.$on('selectMediaRequested', function (media) { + self.selectMedia(media); + }); + self.$on('filesUploaded', function (files) { + self.addMediaFiles(files); + }); + }, + methods: { + selectMedia: function selectMedia(media) { + this.selectedMedia = media; + }, + showModal: function showModal(event) { + var self = this; + if (self.canAddMedia) { + $("#mediaApp").appendTo($(modalBodyElement).find('.modal-body')); + $("#mediaApp").show(); + var modal = new bootstrap.Modal(modalBodyElement); + modal.show(); + $(modalBodyElement).find('.mediaFieldSelectButton').off('click').on('click', function (v) { + self.addMediaFiles(mediaApp.selectedMedias); + + // we don't want the included medias to be still selected the next time we open the modal. + mediaApp.selectedMedias = []; + modal.hide(); + return true; + }); + } + }, + showMediaTextModal: function showMediaTextModal(event) { + this.mediaTextModal = new bootstrap.Modal(this.$refs.mediaTextModal); + this.mediaTextModal.show(); + this.backupMediaText = this.selectedMedia.mediaText; + }, + cancelMediaTextModal: function cancelMediaTextModal(event) { + this.mediaTextModal.hide(); + this.selectedMedia.mediaText = this.backupMediaText; + }, + showAnchorModal: function showAnchorModal(event) { + this.anchoringModal = new bootstrap.Modal(this.$refs.anchoringModal); + this.anchoringModal.show(); + // Cause a refresh to recalc heights. + this.selectedMedia.anchor = { + x: this.selectedMedia.anchor.x, + y: this.selectedMedia.anchor.y + }; + this.backupAnchor = this.selectedMedia.anchor; + }, + cancelAnchoringModal: function cancelAnchoringModal(event) { + this.anchoringModal.hide(); + this.selectedMedia.anchor = this.backupAnchor; + }, + resetAnchor: function resetAnchor(event) { + this.selectedMedia.anchor = { + x: 0.5, + y: 0.5 + }; + }, + onAnchorDrop: function onAnchorDrop(event) { + var image = this.$refs.anchorImage; + this.selectedMedia.anchor = { + x: event.offsetX / image.clientWidth, + y: event.offsetY / image.clientHeight + }; + }, + anchorLeft: function anchorLeft() { + if (this.$refs.anchorImage && this.$refs.modalBody && this.selectedMedia) { + // When image is shrunk compare against the modal body. + var offset = (this.$refs.modalBody.clientWidth - this.$refs.anchorImage.clientWidth) / 2; + var position = this.selectedMedia.anchor.x * this.$refs.anchorImage.clientWidth + offset; + var anchorIcon = Math.round(this.$refs.modalBody.querySelector('.icon-media-anchor').clientWidth); + if (Number.isInteger(anchorIcon)) { + position = position - anchorIcon / 2; } + return position + 'px'; + } else { + return '0'; } - }; - } - }); - - // The iframe transport returns the iframe content document as response. - // The following adds converters from iframe to text, json, html, xml - // and script. - // Please note that the Content-Type for JSON responses has to be text/plain - // or text/html, if the browser doesn't include application/json in the - // Accept header, else IE will show a download dialog. - // The Content-Type for XML responses on the other hand has to be always - // application/xml or text/xml, so IE properly parses the XML response. - // See also - // https://github.com/blueimp/jQuery-File-Upload/wiki/Setup#content-type-negotiation - $.ajaxSetup({ - converters: { - 'iframe text': function iframeText(iframe) { - return iframe && $(iframe[0].body).text(); }, - 'iframe json': function iframeJson(iframe) { - return iframe && jsonAPI[jsonParse]($(iframe[0].body).text()); + anchorTop: function anchorTop() { + if (this.$refs.anchorImage && this.selectedMedia) { + var position = this.selectedMedia.anchor.y * this.$refs.anchorImage.clientHeight; + return position + 'px'; + } else { + return '0'; + } }, - 'iframe html': function iframeHtml(iframe) { - return iframe && $(iframe[0].body).html(); + setAnchor: function setAnchor(event) { + var image = this.$refs.anchorImage; + this.selectedMedia.anchor = { + x: event.offsetX / image.clientWidth, + y: event.offsetY / image.clientHeight + }; }, - 'iframe xml': function iframeXml(iframe) { - var xmlDoc = iframe && iframe[0]; - return xmlDoc && $.isXMLDoc(xmlDoc) ? xmlDoc : $.parseXML(xmlDoc.XMLDocument && xmlDoc.XMLDocument.xml || $(xmlDoc.body).html()); + addMediaFiles: function addMediaFiles(files) { + if (files.length > 1 && allowMultiple === false) { + alert($('#onlyOneItemMessage').val()); + mediaFieldApp.mediaItems.push(files[0]); + mediaFieldApp.initialized = true; + } else { + mediaFieldApp.mediaItems = mediaFieldApp.mediaItems.concat(files); + mediaFieldApp.initialized = true; + } }, - 'iframe script': function iframeScript(iframe) { - return iframe && $.globalEval($(iframe[0].body).text()); + removeSelected: function removeSelected(event) { + if (this.selectedMedia) { + var index = this.mediaItems && this.mediaItems.indexOf(this.selectedMedia); + if (index > -1) { + this.mediaItems.splice(index, 1); + } + } else { + // The remove button can also remove a unique media item + if (this.mediaItems.length === 1) { + this.mediaItems.splice(0, 1); + } + } + this.selectedMedia = null; + }, + selectAndDeleteMedia: function selectAndDeleteMedia(media) { + var self = this; + self.selectedMedia = media; + // setTimeout because sometimes removeSelected was called even before the media was set. + setTimeout(function () { + self.removeSelected(); + }, 100); + } + }, + watch: { + mediaItems: { + deep: true, + handler: function handler() { + // Trigger preview rendering + setTimeout(function () { + $(document).trigger('contentpreview:render'); + }, 100); + } + }, + currentPrefs: function currentPrefs(newPrefs) { + localStorage.setItem('mediaFieldPrefs', JSON.stringify(newPrefs)); } } - }); + })); +} +// different media field editors will add themselves to this array +var mediaFieldApps = []; +// component +Vue.component('upload', { + template: '\ +
    \ + \ +

    {{ model.name }}

    \ +
    \ + \ + Error: {{ model.errorMessage }} \ +
    \ +
    \ + ', + props: { + model: Object, + uploadInputId: String + }, + mounted: function mounted() { + var _self$uploadInputId; + var self = this; + var uploadInput = document.getElementById((_self$uploadInputId = self.uploadInputId) !== null && _self$uploadInputId !== void 0 ? _self$uploadInputId : 'fileupload'); + $(uploadInput).bind('fileuploadprogress', function (e, data) { + if (data.files[0].name !== self.model.name) { + return; + } + self.model.percentage = parseInt(data.loaded / data.total * 100, 10); + }); + $(uploadInput).bind('fileuploaddone', function (e, data) { + if (data.files[0].name !== self.model.name) { + return; + } + if (data.result.files[0].error) { + self.handleFailure(data.files[0].name, data.result.files[0].error); + } else { + bus.$emit('removalRequest', self.model); + } + }); + $(uploadInput).bind('fileuploadfail', function (e, data) { + if (data.files[0].name !== self.model.name) { + return; + } + self.handleFailure(data.files[0].name, $('#t-error').val()); + }); + }, + methods: { + handleFailure: function handleFailure(fileName, message) { + if (fileName !== this.model.name) { + return; + } + this.model.errorMessage = message; + bus.$emit('ErrorOnUpload', this.model); + }, + dismissWarning: function dismissWarning() { + bus.$emit('removalRequest', this.model); + } + } +}); +// component +Vue.component('uploadList', { + template: '\ +
    \ +
    \ + {{ T.uploads }} \ + (Pending: {{ pendingCount }}) \ + ( {{ T.errors }}: {{ errorCount }} / {{ T.clearErrors }} ) \ +
    \ +
    \ + \ +
    \ +
    \ + \ +
    \ +
    \ +
    \ +
    \ +
    \ + \ +
    \ +
    \ +
    \ + ', + data: function data() { + return { + files: [], + T: {}, + expanded: false, + pendingCount: 0, + errorCount: 0 + }; + }, + props: { + uploadInputId: String + }, + created: function created() { + var self = this; + // retrieving localized strings from view + self.T.uploads = $('#t-uploads').val(); + self.T.errors = $('#t-errors').val(); + self.T.clearErrors = $('#t-clear-errors').val(); + }, + computed: { + fileCount: function fileCount() { + return this.files.length; + } + }, + mounted: function mounted() { + var _self$uploadInputId; + var self = this; + var uploadInput = document.getElementById((_self$uploadInputId = self.uploadInputId) !== null && _self$uploadInputId !== void 0 ? _self$uploadInputId : 'fileupload'); + $(uploadInput).bind('fileuploadadd', function (e, data) { + if (!data.files) { + return; + } + data.files.forEach(function (newFile) { + var alreadyInList = self.files.some(function (f) { + return f.name == newFile.name; + }); + if (!alreadyInList) { + self.files.push({ + name: newFile.name, + percentage: 0, + errorMessage: '' + }); + } else { + console.error('A file with the same name is already on the queue:' + newFile.name); + } + }); + }); + bus.$on('removalRequest', function (fileUpload) { + self.files.forEach(function (item, index, array) { + if (item.name == fileUpload.name) { + array.splice(index, 1); + } + }); + }); + bus.$on('ErrorOnUpload', function (fileUpload) { + self.updateCount(); + }); + }, + methods: { + updateCount: function updateCount() { + this.errorCount = this.files.filter(function (item) { + return item.errorMessage != ''; + }).length; + this.pendingCount = this.files.length - this.errorCount; + if (this.files.length < 1) { + this.expanded = false; + } + }, + clearErrors: function clearErrors() { + this.files = this.files.filter(function (item) { + return item.errorMessage == ''; + }); + } + }, + watch: { + files: function files() { + this.updateCount(); + } + } }); \ No newline at end of file diff --git a/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.min.js b/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.min.js index df24f4fcf2a..927c5494d87 100644 --- a/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Media/wwwroot/Scripts/media.min.js @@ -1 +1 @@ -function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function ownKeys(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _objectSpread(e){for(var t=1;t-1}));switch(e.sortBy){case"size":t.sort((function(t,i){return e.sortAsc?t.size-i.size:i.size-t.size}));break;case"mime":t.sort((function(t,i){return e.sortAsc?t.mime.toLowerCase().localeCompare(i.mime.toLowerCase()):i.mime.toLowerCase().localeCompare(t.mime.toLowerCase())}));break;case"lastModify":t.sort((function(t,i){return e.sortAsc?t.lastModify-i.lastModify:i.lastModify-t.lastModify}));break;default:t.sort((function(t,i){return e.sortAsc?t.name.toLowerCase().localeCompare(i.name.toLowerCase()):i.name.toLowerCase().localeCompare(t.name.toLowerCase())}))}return t},hiddenCount:function(){return this.mediaItems.length-this.filteredMediaItems.length},thumbSize:function(){return this.smallThumbs?100:240},currentPrefs:{get:function(){return{smallThumbs:this.smallThumbs,selectedFolder:this.selectedFolder,gridView:this.gridView}},set:function(e){e&&(this.smallThumbs=e.smallThumbs,this.selectedFolder=e.selectedFolder,this.gridView=e.gridView)}}},watch:{currentPrefs:function(e){localStorage.setItem("mediaApplicationPrefs",JSON.stringify(e))},selectedFolder:function(e){this.mediaFilter="",this.selectedFolder=e,this.loadFolder(e)}},mounted:function(){this.$refs.rootFolder.toggle()},methods:{uploadUrl:function(){if(!this.selectedFolder)return null;var e=$("#uploadFiles").val();return e+(-1==e.indexOf("?")?"?":"&")+"path="+encodeURIComponent(this.selectedFolder.path)},selectRoot:function(){this.selectedFolder=this.root},loadFolder:function(e){this.errors=[],this.selectedMedias=[];var t=this,i=$("#getMediaItemsUrl").val();console.log(e.path),$.ajax({url:i+(-1==i.indexOf("?")?"?":"&")+"path="+encodeURIComponent(e.path),method:"GET",success:function(e){e.forEach((function(e){e.open=!1})),t.mediaItems=e,t.selectedMedias=[],t.sortBy="",t.sortAsc=!0},error:function(i){console.log("error loading folder:"+e.path),t.selectRoot()}})},selectAll:function(){this.selectedMedias=[];for(var e=0;e-1&&(t.mediaItems.splice(n,1),bus.$emit("mediaDeleted",t.selectedMedias[i]))}t.selectedMedias=[]},error:function(e){console.error(e.responseText)}})}}}))},deleteMediaItem:function(e){var t=this;e&&confirmDialog(_objectSpread(_objectSpread({},$("#deleteMedia").data()),{},{callback:function(i){i&&$.ajax({url:$("#deleteMediaUrl").val()+"?path="+encodeURIComponent(e.mediaPath),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(i){var n=t.mediaItems&&t.mediaItems.indexOf(e);n>-1&&(t.mediaItems.splice(n,1),bus.$emit("mediaDeleted",e))},error:function(e){console.error(e.responseText)}})}}))},handleDragStart:function(e,t){var i=[];this.selectedMedias.forEach((function(e){i.push(e.name)})),0==this.isMediaSelected(e)&&(i.push(e.name),this.selectedMedias.push(e)),t.dataTransfer.setData("mediaNames",JSON.stringify(i)),t.dataTransfer.setData("sourceFolder",this.selectedFolder.path),t.dataTransfer.setDragImage(this.dragDropThumbnail,10,10),t.dataTransfer.effectAllowed="move"},handleScrollWhileDrag:function(e){e.clientY<150&&window.scrollBy(0,-10),e.clientY>window.innerHeight-100&&window.scrollBy(0,10)},changeSort:function(e){this.sortBy==e?this.sortAsc=!this.sortAsc:(this.sortAsc=!0,this.sortBy=e)}}}),$("#create-folder-name").keypress((function(e){if(13==e.which)return $("#modalFooterOk").click(),!1})),$("#modalFooterOk").on("click",(function(e){var t=$("#create-folder-name").val();""!==t&&$.ajax({url:$("#createFolderUrl").val()+"?path="+encodeURIComponent(mediaApp.selectedFolder.path)+"&name="+encodeURIComponent(t),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(e){bus.$emit("addFolder",mediaApp.selectedFolder,e),bootstrap.Modal.getOrCreateInstance($("#createFolderModal")).hide()},error:function(e){$("#createFolderModal-errors").empty();var t=JSON.parse(e.responseText).value;$('').text(t).appendTo($("#createFolderModal-errors"))}})})),$("#renameMediaModalFooterOk").on("click",(function(e){var t=$("#new-item-name").val(),i=$("#old-item-name").val();if(""!==t){var n=mediaApp.selectedFolder.path+"/";"/"===n&&(n="");var a=n+t,o=n+i;if(a.toLowerCase()!==o.toLowerCase())$.ajax({url:$("#renameMediaUrl").val()+"?oldPath="+encodeURIComponent(o)+"&newPath="+encodeURIComponent(a),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(e){bootstrap.Modal.getOrCreateInstance($("#renameMediaModal")).hide(),bus.$emit("mediaRenamed",t,a,o,e.newUrl)},error:function(e){$("#renameMediaModal-errors").empty();var t=JSON.parse(e.responseText).value;$('').text(t).appendTo($("#renameMediaModal-errors"))}});else bootstrap.Modal.getOrCreateInstance($("#renameMediaModal")).hide()}})),e&&(document.getElementById("mediaApp").style.display=""),$(document).trigger("mediaApp:ready")},error:function(e){console.error(e.responseText)}}))}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function ownKeys(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _objectSpread(e){for(var t=1;t\n \n
      \n \n \n
    \n \n '),props:{model:Object,selectedInMediaApp:Object,level:Number},data:function(){return{open:!1,children:null,parent:null,isHovered:!1,padding:0}},computed:{empty:function(){return!this.children||0==this.children.length},isSelected:function(){return this.selectedInMediaApp.name==this.model.name&&this.selectedInMediaApp.path==this.model.path},isRoot:function(){return""===this.model.path}},mounted:function(){0==this.isRoot&&this.isAncestorOfSelectedFolder()&&this.toggle(),this.padding=this.level<3?16:16+8*this.level},created:function(){var e=this;bus.$on("deleteFolder",(function(t){if(e.children){var i=e.children&&e.children.indexOf(t);i>-1&&(e.children.splice(i,1),bus.$emit("folderDeleted"))}})),bus.$on("addFolder",(function(t,i){e.model==t&&(null!==e.children&&e.children.push(i),i.parent=e.model,bus.$emit("folderAdded",i))}))},methods:{isAncestorOfSelectedFolder:function(){for(parentFolder=mediaApp.selectedFolder;parentFolder;){if(parentFolder.path==this.model.path)return!0;parentFolder=parentFolder.parent}return!1},toggle:function(){this.open=!this.open,this.open&&!this.children&&this.loadChildren()},select:function(){bus.$emit("folderSelected",this.model),this.loadChildren()},createFolder:function(){bus.$emit("createFolderRequested")},deleteFolder:function(){bus.$emit("deleteFolderRequested")},loadChildren:function(){var e=this;0==this.open&&(this.open=!0),$.ajax({url:$("#getFoldersUrl").val()+"?path="+encodeURIComponent(e.model.path),method:"GET",success:function(t){e.children=t,e.children.forEach((function(t){t.parent=e.model}))},error:function(e){emtpy=!1,console.error(e.responseText)}})},handleDragOver:function(e){this.isHovered=!0},handleDragLeave:function(e){this.isHovered=!1},moveMediaToFolder:function(e,t){this.isHovered=!1;var i=JSON.parse(t.dataTransfer.getData("mediaNames"));if(!(i.length<1)){var n=t.dataTransfer.getData("sourceFolder"),a=e.path;""===n&&(n="root"),""===a&&(a="root"),n!==a?confirmDialog(_objectSpread(_objectSpread({},$("#moveMedia").data()),{},{callback:function(e){e&&$.ajax({url:$("#moveMediaListUrl").val(),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val(),mediaNames:i,sourceFolder:n,targetFolder:a},success:function(){bus.$emit("mediaListMoved")},error:function(e){console.error(e.responseText),bus.$emit("mediaListMoved",e.responseText)}})}})):alert($("#sameFolderMessage").val())}}}});var faIcons={image:"fa-regular fa-image",pdf:"fa-regular fa-file-pdf",word:"fa-regular fa-file-word",powerpoint:"fa-regular fa-file-powerpoint",excel:"fa-regular fa-file-excel",csv:"fa-regular fa-file",audio:"fa-regular fa-file-audio",video:"fa-regular fa-file-video",archive:"fa-regular fa-file-zipper",code:"fa-regular fa-file-code",text:"fa-regular fa-file-lines",file:"fa-regular fa-file"},faThumbnails={gif:faIcons.image,jpeg:faIcons.image,jpg:faIcons.image,png:faIcons.image,pdf:faIcons.pdf,doc:faIcons.word,docx:faIcons.word,ppt:faIcons.powerpoint,pptx:faIcons.powerpoint,xls:faIcons.excel,xlsx:faIcons.excel,csv:faIcons.csv,aac:faIcons.audio,mp3:faIcons.audio,ogg:faIcons.audio,avi:faIcons.video,flv:faIcons.video,mkv:faIcons.video,mp4:faIcons.video,webm:faIcons.video,gz:faIcons.archive,zip:faIcons.archive,css:faIcons.code,html:faIcons.code,js:faIcons.code,txt:faIcons.text};function getClassNameForExtension(e){return faThumbnails[e.toLowerCase()]||faIcons.file}function getExtensionForFilename(e){return e.slice(2+(e.lastIndexOf(".")-1>>>0))}function getClassNameForFilename(e){return getClassNameForExtension(getExtensionForFilename(e))}function initializeAttachedMediaField(e,t,i,n,a,o,r,s,l){var d,c=$(document.getElementById($(e).data("for"))).data("init"),u=$(e),m=u.attr("id");mediaFieldApps.push(d=new Vue({el:u.get(0),data:{mediaItems:[],selectedMedia:null,smallThumbs:!1,idPrefix:m,initialized:!1,allowMediaText:o,backupMediaText:"",allowAnchors:r,backupAnchor:null,mediaTextmodal:null,anchoringModal:null},created:function(){this.currentPrefs=JSON.parse(localStorage.getItem("mediaFieldPrefs"))},computed:{paths:{get:function(){var e=[];return this.initialized?(this.mediaItems.forEach((function(t){"not-found"!==t.mediaPath&&e.push({path:t.mediaPath,isRemoved:t.isRemoved,isNew:t.isNew,mediaText:t.mediaText,anchor:t.anchor,attachedFileName:t.attachedFileName})})),JSON.stringify(e)):JSON.stringify(c)},set:function(e){var t=this,i=e||[],a=$.Deferred(),o=[],r=0;i.forEach((function(e,i){o.push({name:" "+e.path,mime:"",mediaPath:"",anchor:e.anchor,attachedFileName:e.attachedFileName}),promise=$.when(a).done((function(){$.ajax({url:n+"?path="+encodeURIComponent(e.path),method:"GET",success:function(n){n.vuekey=n.name+i.toString(),n.mediaText=e.mediaText,n.anchor=e.anchor,n.attachedFileName=e.attachedFileName,o.splice(i,1,n),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)},error:function(n){console.log(JSON.stringify(n)),o.splice(i,1,{name:e.path,mime:"",mediaPath:"not-found",mediaText:"",anchor:{x:.5,y:.5},attachedFileName:e.attachedFileName}),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)}})}))})),a.resolve()}},fileSize:function(){return Math.round(this.selectedMedia.size/1024)},canAddMedia:function(){for(var e=[],t=0;t0&&a},thumbSize:function(){return this.smallThumbs?120:240},currentPrefs:{get:function(){return{smallThumbs:this.smallThumbs}},set:function(e){e&&(this.smallThumbs=e.smallThumbs)}}},mounted:function(){var e=this;e.paths=c,e.$on("selectAndDeleteMediaRequested",(function(t){e.selectAndDeleteMedia(t)})),e.$on("selectMediaRequested",(function(t){e.selectMedia(t)}));var n="#"+t,o=u.attr("id"),r=randomUUID();$(n).fileupload({limitConcurrentUploads:20,dropZone:$("#"+o),dataType:"json",url:i,maxChunkSize:l,add:function(t,i){var n,a=i.files.length;for(n=0;n0)for(var o=0;o1&&!1===a?(alert($("#onlyOneItemMessage").val()),d.mediaItems.push(i[0]),d.initialized=!0):(d.mediaItems=d.mediaItems.concat(i),d.initialized=!0)):alert(n)},error:function(e,t,i){console.log("Error on upload."),console.log(e),console.log(t),console.log(i)}}).on("fileuploadchunkbeforesend",(function(e,t){var i=t.files[0];t.blob=new File([t.blob],i.name,{type:i.type,lastModified:i.lastModified})}))},methods:{selectMedia:function(e){this.selectedMedia=e},getUniqueId:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},removeSelected:function(e){if(this.selectedMedia){var t=this.mediaItems&&this.mediaItems.indexOf(this.selectedMedia);t>-1&&(this.mediaItems[t].isRemoved=!0,this.mediaItems.splice(t,1))}else 1===this.mediaItems.length&&(this.mediaItems[t].isRemoved=!0,this.mediaItems.splice(0,1));this.selectedMedia=null},showMediaTextModal:function(e){this.mediaTextModal=new bootstrap.Modal(this.$refs.mediaTextModal),this.mediaTextModal.show(),this.backupMediaText=this.selectedMedia.mediaText},cancelMediaTextModal:function(e){this.mediaTextModal.hide(),this.selectedMedia.mediaText=this.backupMediaText},showAnchorModal:function(e){this.anchoringModal=new bootstrap.Modal(this.$refs.anchoringModal),this.anchoringModal.show(),this.selectedMedia.anchor={x:this.selectedMedia.anchor.x,y:this.selectedMedia.anchor.y},this.backupAnchor=this.selectedMedia.anchor},cancelAnchoringModal:function(e){this.anchoringModal.hide(),this.selectedMedia.anchor=this.backupAnchor},resetAnchor:function(e){this.selectedMedia.anchor={x:.5,y:.5}},onAnchorDrop:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},anchorLeft:function(){if(this.$refs.anchorImage&&this.$refs.modalBody&&this.selectedMedia){var e=(this.$refs.modalBody.clientWidth-this.$refs.anchorImage.clientWidth)/2,t=this.selectedMedia.anchor.x*this.$refs.anchorImage.clientWidth+e;return t<17?t=17:t-=8,t+"px"}return"0"},anchorTop:function(){if(this.$refs.anchorImage&&this.selectedMedia){var e=this.selectedMedia.anchor.y*this.$refs.anchorImage.clientHeight;return e<15?e=15:e+=5,e+"px"}return"0"},setAnchor:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},addMediaFiles:function(e){e.length>1&&!1===a?(alert($("#onlyOneItemMessage").val()),d.mediaItems.push(e[0]),d.initialized=!0):(d.mediaItems=d.mediaItems.concat(e),d.initialized=!0)},selectAndDeleteMedia:function(e){var t=this;t.selectedMedia=e,setTimeout((function(){t.removeSelected()}),100)}},watch:{mediaItems:{deep:!0,handler:function(){setTimeout((function(){$(document).trigger("contentpreview:render")}),100)}},currentPrefs:function(e){localStorage.setItem("mediaFieldPrefs",JSON.stringify(e))}}}))}function initializeMediaField(e,t,i,n,a,o){if(null!==e){var r,s=$(document.getElementById($(e).data("for"))).data("init"),l=$(e),d=l.attr("id");t.addEventListener("hidden.bs.modal",(function(e){$("#mediaApp").appendTo("body"),$("#mediaApp").hide()})),mediaFieldApps.push(r=new Vue({el:l.get(0),data:{mediaItems:[],selectedMedia:null,smallThumbs:!1,idPrefix:d,initialized:!1,allowMediaText:a,backupMediaText:"",allowAnchors:o,backupAnchor:null,mediaTextModal:null,anchoringModal:null},created:function(){this.currentPrefs=JSON.parse(localStorage.getItem("mediaFieldPrefs"))},computed:{paths:{get:function(){var e=[];return this.initialized?(this.mediaItems.forEach((function(t){"not-found"!==t.mediaPath&&e.push({path:t.mediaPath,mediaText:t.mediaText,anchor:t.anchor})})),JSON.stringify(e)):JSON.stringify(s)},set:function(e){var t=this,n=e||[],a=$.Deferred(),o=[],r=0;n.forEach((function(e,n){o.push({name:" "+e.path,mime:"",mediaPath:""}),promise=$.when(a).done((function(){$.ajax({url:i+"?path="+encodeURIComponent(e.path),method:"GET",success:function(i){i.vuekey=i.name+n.toString(),i.mediaText=e.mediaText,i.anchor=e.anchor,o.splice(n,1,i),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)},error:function(i){console.log(i),o.splice(n,1,{name:e.path,mime:"",mediaPath:"not-found",mediaText:"",anchor:{x:0,y:0}}),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)}})}))})),a.resolve()}},fileSize:function(){return Math.round(this.selectedMedia.size/1024)},canAddMedia:function(){return 0===this.mediaItems.length||this.mediaItems.length>0&&n},thumbSize:function(){return this.smallThumbs?120:240},currentPrefs:{get:function(){return{smallThumbs:this.smallThumbs}},set:function(e){e&&(this.smallThumbs=e.smallThumbs)}}},mounted:function(){var e=this;e.paths=s,e.$on("selectAndDeleteMediaRequested",(function(t){e.selectAndDeleteMedia(t)})),e.$on("selectMediaRequested",(function(t){e.selectMedia(t)})),e.$on("filesUploaded",(function(t){e.addMediaFiles(t)}))},methods:{selectMedia:function(e){this.selectedMedia=e},showModal:function(e){var i=this;if(i.canAddMedia){$("#mediaApp").appendTo($(t).find(".modal-body")),$("#mediaApp").show();var n=new bootstrap.Modal(t);n.show(),$(t).find(".mediaFieldSelectButton").off("click").on("click",(function(e){return i.addMediaFiles(mediaApp.selectedMedias),mediaApp.selectedMedias=[],n.hide(),!0}))}},showMediaTextModal:function(e){this.mediaTextModal=new bootstrap.Modal(this.$refs.mediaTextModal),this.mediaTextModal.show(),this.backupMediaText=this.selectedMedia.mediaText},cancelMediaTextModal:function(e){this.mediaTextModal.hide(),this.selectedMedia.mediaText=this.backupMediaText},showAnchorModal:function(e){this.anchoringModal=new bootstrap.Modal(this.$refs.anchoringModal),this.anchoringModal.show(),this.selectedMedia.anchor={x:this.selectedMedia.anchor.x,y:this.selectedMedia.anchor.y},this.backupAnchor=this.selectedMedia.anchor},cancelAnchoringModal:function(e){this.anchoringModal.hide(),this.selectedMedia.anchor=this.backupAnchor},resetAnchor:function(e){this.selectedMedia.anchor={x:.5,y:.5}},onAnchorDrop:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},anchorLeft:function(){if(this.$refs.anchorImage&&this.$refs.modalBody&&this.selectedMedia){var e=(this.$refs.modalBody.clientWidth-this.$refs.anchorImage.clientWidth)/2,t=this.selectedMedia.anchor.x*this.$refs.anchorImage.clientWidth+e,i=Math.round(this.$refs.modalBody.querySelector(".icon-media-anchor").clientWidth);return Number.isInteger(i)&&(t-=i/2),t+"px"}return"0"},anchorTop:function(){return this.$refs.anchorImage&&this.selectedMedia?this.selectedMedia.anchor.y*this.$refs.anchorImage.clientHeight+"px":"0"},setAnchor:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},addMediaFiles:function(e){e.length>1&&!1===n?(alert($("#onlyOneItemMessage").val()),r.mediaItems.push(e[0]),r.initialized=!0):(r.mediaItems=r.mediaItems.concat(e),r.initialized=!0)},removeSelected:function(e){if(this.selectedMedia){var t=this.mediaItems&&this.mediaItems.indexOf(this.selectedMedia);t>-1&&this.mediaItems.splice(t,1)}else 1===this.mediaItems.length&&this.mediaItems.splice(0,1);this.selectedMedia=null},selectAndDeleteMedia:function(e){var t=this;t.selectedMedia=e,setTimeout((function(){t.removeSelected()}),100)}},watch:{mediaItems:{deep:!0,handler:function(){setTimeout((function(){$(document).trigger("contentpreview:render")}),100)}},currentPrefs:function(e){localStorage.setItem("mediaFieldPrefs",JSON.stringify(e))}}}))}}Vue.component("media-items-grid",{template:'\n
      \n
    1. \n
      \n \n \n
      \n
      \n \n \n \n {{ media.name }}\n
      \n
    2. \n
    \n ',data:function(){return{T:{}}},props:{filteredMediaItems:Array,selectedMedias:Array,thumbSize:Number},created:function(){this.T.editButton=$("#t-edit-button").val(),this.T.deleteButton=$("#t-delete-button").val()},methods:{isMediaSelected:function(e){return this.selectedMedias.some((function(t,i,n){return t.url.toLowerCase()===e.url.toLowerCase()}))},buildMediaUrl:function(e,t){return e+(-1==e.indexOf("?")?"?":"&")+"width="+t+"&height="+t},toggleSelectionOfMedia:function(e){bus.$emit("mediaToggleRequested",e)},renameMedia:function(e){bus.$emit("renameMediaRequested",e)},deleteMedia:function(e){bus.$emit("deleteMediaRequested",e)},dragStart:function(e,t){bus.$emit("mediaDragStartRequested",e,t)},getfontAwesomeClassNameForFileName:function(e,t){return getClassNameForFilename(e)+" "+t}}}),Vue.component("media-items-table",{template:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {{ T.imageHeader }}\n {{ T.nameHeader }}\n \n \n {{ T.lastModifyHeader }} \n \n \n \n {{ T.sizeHeader }}\n \n \n \n \n {{ T.typeHeader }}\n \n \n
    \n
    \n \n \n
    \n
    \n \n \n
    {{ printDateTime(media.lastModify) }}
    \n
    \n
    {{ isNaN(media.size)? 0 : Math.round(media.size / 1024) }} KB
    \n
    \n
    {{ media.mime }}
    \n
    \n ',data:function(){return{T:{}}},props:{sortBy:String,sortAsc:Boolean,filteredMediaItems:Array,selectedMedias:Array,thumbSize:Number},created:function(){var e=this;e.T.imageHeader=$("#t-image-header").val(),e.T.nameHeader=$("#t-name-header").val(),e.T.lastModifyHeader=$("#t-lastModify-header").val(),e.T.sizeHeader=$("#t-size-header").val(),e.T.typeHeader=$("#t-type-header").val(),e.T.editButton=$("#t-edit-button").val(),e.T.deleteButton=$("#t-delete-button").val(),e.T.viewButton=$("#t-view-button").val()},methods:{isMediaSelected:function(e){return this.selectedMedias.some((function(t,i,n){return t.url.toLowerCase()===e.url.toLowerCase()}))},buildMediaUrl:function(e,t){return e+(-1==e.indexOf("?")?"?":"&")+"width="+t+"&height="+t},changeSort:function(e){bus.$emit("sortChangeRequested",e)},toggleSelectionOfMedia:function(e){bus.$emit("mediaToggleRequested",e)},renameMedia:function(e){bus.$emit("renameMediaRequested",e)},deleteMedia:function(e){bus.$emit("deleteMediaRequested",e)},dragStart:function(e,t){bus.$emit("mediaDragStartRequested",e,t)},printDateTime:function(e){return new Date(e).toLocaleString()},getfontAwesomeClassNameForFileName:function(e,t){return getClassNameForFilename(e)+" "+t}}}),Vue.component("pager",{template:'\n
    \n \n \n
    \n ',props:{sourceItems:Array},data:function(){return{pageSize:10,pageSizeOptions:[10,30,50,100],current:0,T:{}}},created:function(){var e=this;e.T.pagerFirstButton=$("#t-pager-first-button").val(),e.T.pagerPreviousButton=$("#t-pager-previous-button").val(),e.T.pagerNextButton=$("#t-pager-next-button").val(),e.T.pagerLastButton=$("#t-pager-last-button").val(),e.T.pagerPageSizeLabel=$("#t-pager-page-size-label").val(),e.T.pagerPageLabel=$("#t-pager-page-label").val(),e.T.pagerTotalLabel=$("#t-pager-total-label").val()},methods:{next:function(){this.current=this.current+1},previous:function(){this.current=this.current-1},goFirst:function(){this.current=0},goLast:function(){this.current=this.totalPages-1},goTo:function(e){this.current=e}},computed:{total:function(){return this.sourceItems?this.sourceItems.length:0},totalPages:function(){var e=Math.ceil(this.total/this.pageSize);return e>0?e:1},isLastPage:function(){return this.current+1>=this.totalPages},isFirstPage:function(){return 0===this.current},canDoNext:function(){return!this.isLastPage},canDoPrev:function(){return!this.isFirstPage},canDoFirst:function(){return!this.isFirstPage},canDoLast:function(){return!this.isLastPage},itemsInCurrentPage:function(){var e=this.pageSize*this.current,t=e+this.pageSize,i=this.sourceItems.slice(e,t);return bus.$emit("pagerEvent",i),i},pageLinks:function(){var e=[];e.push(this.current+1);var t=this.current>0?this.current:-1;e.unshift(t);var i=this.current>1?this.current-1:-1;e.unshift(i);var n=this.totalPages-this.current>1?this.current+2:-1;e.push(n);var a=this.totalPages-this.current>2?this.current+3:-1;return e.push(a),e}},watch:{sourceItems:function(){this.current=0},pageSize:function(){this.current=0}}}),Vue.component("sortIndicator",{template:'\n
    \n \n \n
    \n ',props:{colname:String,selectedcolname:String,asc:Boolean},computed:{isActive:function(){return this.colname.toLowerCase()==this.selectedcolname.toLowerCase()}}}),Vue.component("mediaFieldThumbsContainer",{template:'
    {{T.noImages}}
  • {{ media.isNew ? media.name.substr(36) : media.name }}
    {{ T.mediaNotFound }} {{ T.discardWarning }}
    {{ media.name }}
  • ',data:function(){return{T:{}}},props:{mediaItems:Array,selectedMedia:Object,thumbSize:Number,idPrefix:String},created:function(){var e=this;e.T.mediaNotFound=$("#t-media-not-found").val(),e.T.discardWarning=$("#t-discard-warning").val(),e.T.noImages=$("#t-no-images").val()},methods:{selectAndDeleteMedia:function(e){this.$parent.$emit("selectAndDeleteMediaRequested",e)},selectMedia:function(e){this.$parent.$emit("selectMediaRequested",e)},buildMediaUrl:function(e,t){return e+(-1==e.indexOf("?")?"?":"&")+"width="+t+"&height="+t},getfontAwesomeClassNameForFileName:function(e,t){return getClassNameForFilename(e)+" "+t}}});var mediaFieldApps=[];function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function randomUUID(){return"object"===("undefined"==typeof crypto?"undefined":_typeof(crypto))&&"function"==typeof crypto.randomUUID?crypto.randomUUID():([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)}))}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}Vue.component("upload",{template:'

    {{ model.name }}

    Error: {{ model.errorMessage }}
    ',props:{model:Object,uploadInputId:String},mounted:function(){var e,t=this,i=document.getElementById(null!==(e=t.uploadInputId)&&void 0!==e?e:"fileupload");$(i).bind("fileuploadprogress",(function(e,i){i.files[0].name===t.model.name&&(t.model.percentage=parseInt(i.loaded/i.total*100,10))})),$(i).bind("fileuploaddone",(function(e,i){i.files[0].name===t.model.name&&(i.result.files[0].error?t.handleFailure(i.files[0].name,i.result.files[0].error):bus.$emit("removalRequest",t.model))})),$(i).bind("fileuploadfail",(function(e,i){i.files[0].name===t.model.name&&t.handleFailure(i.files[0].name,$("#t-error").val())}))},methods:{handleFailure:function(e,t){e===this.model.name&&(this.model.errorMessage=t,bus.$emit("ErrorOnUpload",this.model))},dismissWarning:function(){bus.$emit("removalRequest",this.model)}}}),Vue.component("uploadList",{template:'
    {{ T.uploads }} (Pending: {{ pendingCount }}) ( {{ T.errors }}: {{ errorCount }} / {{ T.clearErrors }} )
    ',data:function(){return{files:[],T:{},expanded:!1,pendingCount:0,errorCount:0}},props:{uploadInputId:String},created:function(){var e=this;e.T.uploads=$("#t-uploads").val(),e.T.errors=$("#t-errors").val(),e.T.clearErrors=$("#t-clear-errors").val()},computed:{fileCount:function(){return this.files.length}},mounted:function(){var e,t=this,i=document.getElementById(null!==(e=t.uploadInputId)&&void 0!==e?e:"fileupload");$(i).bind("fileuploadadd",(function(e,i){i.files&&i.files.forEach((function(e){t.files.some((function(t){return t.name==e.name}))?console.error("A file with the same name is already on the queue:"+e.name):t.files.push({name:e.name,percentage:0,errorMessage:""})}))})),bus.$on("removalRequest",(function(e){t.files.forEach((function(t,i,n){t.name==e.name&&n.splice(i,1)}))})),bus.$on("ErrorOnUpload",(function(e){t.updateCount()}))},methods:{updateCount:function(){this.errorCount=this.files.filter((function(e){return""!=e.errorMessage})).length,this.pendingCount=this.files.length-this.errorCount,this.files.length<1&&(this.expanded=!1)},clearErrors:function(){this.files=this.files.filter((function(e){return""==e.errorMessage}))}},watch:{files:function(){this.updateCount()}}}),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery","jquery-ui/ui/widget"],e):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?e(require("jquery"),require("./vendor/jquery.ui.widget")):e(window.jQuery)}((function(e){"use strict";function t(t){var i="dragover"===t;return function(n){n.dataTransfer=n.originalEvent&&n.originalEvent.dataTransfer;var a=n.dataTransfer;a&&-1!==e.inArray("Files",a.types)&&!1!==this._trigger(t,e.Event(t,{delegatedEvent:n}))&&(n.preventDefault(),i&&(a.dropEffect="copy"))}}var i;e.support.fileInput=!(new RegExp("(Android (1\\.[0156]|2\\.[01]))|(Windows Phone (OS 7|8\\.0))|(XBLWP)|(ZuneWP)|(WPDesktop)|(w(eb)?OSBrowser)|(webOS)|(Kindle/(1\\.0|2\\.[05]|3\\.0))").test(window.navigator.userAgent)||e('').prop("disabled")),e.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),e.support.xhrFormDataFileUpload=!!window.FormData,e.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),e.widget("blueimp.fileupload",{options:{dropZone:e(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,uniqueFilenames:void 0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,i){return t=this.messages[t]||t.toString(),i&&e.each(i,(function(e,i){t=t.replace("{"+e+"}",i)})),t},formData:function(e){return e.serializeArray()},add:function(t,i){if(t.isDefaultPrevented())return!1;(i.autoUpload||!1!==i.autoUpload&&e(this).fileupload("option","autoUpload"))&&i.process().done((function(){i.submit()}))},processData:!1,contentType:!1,cache:!1,timeout:0},_promisePipe:(i=e.fn.jquery.split("."),Number(i[0])>1||Number(i[1])>7?"then":"pipe"),_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:e.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,i){var n=e-this.timestamp;return(!this.bitrate||!i||n>i)&&(this.bitrate=(t-this.loaded)*(1e3/n)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var i;return"function"===e.type(t.formData)?t.formData(t.form):e.isArray(t.formData)?t.formData:"object"===e.type(t.formData)?(i=[],e.each(t.formData,(function(e,t){i.push({name:e,value:t})})),i):[]},_getTotal:function(t){var i=0;return e.each(t,(function(e,t){i+=t.size||1})),i},_initProgressObject:function(t){var i={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,i):t._progress=i},_initResponseObject:function(e){var t;if(e._response)for(t in e._response)Object.prototype.hasOwnProperty.call(e._response,t)&&delete e._response[t];else e._response={}},_onProgress:function(t,i){if(t.lengthComputable){var n,a=Date.now?Date.now():(new Date).getTime();if(i._time&&i.progressInterval&&a-i._time").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&i&&i!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e)},_getParamName:function(t){var i=e(t.fileInput),n=t.paramName;return n?e.isArray(n)||(n=[n]):(n=[],i.each((function(){for(var t=e(this),i=t.prop("name")||"files[]",a=(t.prop("files")||[1]).length;a;)n.push(i),a-=1})),n.length||(n=[i.prop("name")||"files[]"])),n},_initFormSettings:function(t){t.form&&t.form.length||(t.form=e(t.fileInput.prop("form")),t.form.length||(t.form=e(this.options.fileInput.prop("form")))),t.paramName=this._getParamName(t),t.url||(t.url=t.form.prop("action")||location.href),t.type=(t.type||"string"===e.type(t.form.prop("method"))&&t.form.prop("method")||"").toUpperCase(),"POST"!==t.type&&"PUT"!==t.type&&"PATCH"!==t.type&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var i=e.extend({},this.options,t);return this._initFormSettings(i),this._initDataSettings(i),i},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:function(e){return e.success=e.done,e.error=e.fail,e.complete=e.always,e},_getXHRPromise:function(t,i,n){var a=e.Deferred(),o=a.promise();return i=i||this.options.context||o,!0===t?a.resolveWith(i,n):!1===t&&a.rejectWith(i,n),o.abort=a.promise,this._enhancePromise(o)},_addConvenienceMethods:function(t,i){var n=this,a=function(t){return e.Deferred().resolveWith(n,t).promise()};i.process=function(t,o){return(t||o)&&(i._processQueue=this._processQueue=(this._processQueue||a([this]))[n._promisePipe]((function(){return i.errorThrown?e.Deferred().rejectWith(n,[i]).promise():a(arguments)}))[n._promisePipe](t,o)),this._processQueue||a([this])},i.submit=function(){return"pending"!==this.state()&&(i.jqXHR=this.jqXHR=!1!==n._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)&&n._onSend(t,this)),this.jqXHR||n._getXHRPromise()},i.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",n._trigger("fail",null,this),n._getXHRPromise(!1))},i.state=function(){return this.jqXHR?n._getDeferredState(this.jqXHR):this._processQueue?n._getDeferredState(this._processQueue):void 0},i.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===n._getDeferredState(this._processQueue)},i.progress=function(){return this._progress},i.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),i=t&&t.split("-"),n=i&&i.length>1&&parseInt(i[1],10);return n&&n+1},_chunkedUpload:function(t,i){t.uploadedBytes=t.uploadedBytes||0;var n,a,o=this,r=t.files[0],s=r.size,l=t.uploadedBytes,d=t.maxChunkSize||s,c=this._blobSlice,u=e.Deferred(),m=u.promise();return!(!(this._isXHRUpload(t)&&c&&(l||("function"===e.type(d)?d(t):d)=s?(r.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",r.error])):(a=function(){var i=e.extend({},t),m=i._progress.loaded;i.blob=c.call(r,l,l+("function"===e.type(d)?d(i):d),r.type),i.chunkSize=i.blob.size,i.contentRange="bytes "+l+"-"+(l+i.chunkSize-1)+"/"+s,o._trigger("chunkbeforesend",null,i),o._initXHRData(i),o._initProgressListener(i),n=(!1!==o._trigger("chunksend",null,i)&&e.ajax(i)||o._getXHRPromise(!1,i.context)).done((function(n,r,d){l=o._getUploadedBytes(d)||l+i.chunkSize,m+i.chunkSize-i._progress.loaded&&o._onProgress(e.Event("progress",{lengthComputable:!0,loaded:l-i.uploadedBytes,total:l-i.uploadedBytes}),i),t.uploadedBytes=i.uploadedBytes=l,i.result=n,i.textStatus=r,i.jqXHR=d,o._trigger("chunkdone",null,i),o._trigger("chunkalways",null,i),ls._sending)for(var n=s._slots.shift();n;){if("pending"===s._getDeferredState(n)){n.resolve();break}n=s._slots.shift()}0===s._active&&s._trigger("stop")}))};return this._beforeSend(t,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(o=e.Deferred(),this._slots.push(o),r=o[s._promisePipe](d)):(this._sequence=this._sequence[s._promisePipe](d,d),r=this._sequence),r.abort=function(){return a=[void 0,"abort","abort"],n?n.abort():(o&&o.rejectWith(l.context,a),d())},this._enhancePromise(r)):d()},_onAdd:function(t,i){var n,a,o,r,s=this,l=!0,d=e.extend({},this.options,i),c=i.files,u=c.length,m=d.limitMultiFileUploads,p=d.limitMultiFileUploadSize,f=d.limitMultiFileUploadSizeOverhead,h=0,g=this._getParamName(d),v=0;if(!u)return!1;if(p&&void 0===c[0].size&&(p=void 0),(d.singleFileUploads||m||p)&&this._isXHRUpload(d))if(d.singleFileUploads||p||!m)if(!d.singleFileUploads&&p)for(o=[],n=[],r=0;rp||m&&r+1-v>=m)&&(o.push(c.slice(v,r+1)),(a=g.slice(v,r+1)).length||(a=g),n.push(a),v=r+1,h=0);else n=g;else for(o=[],n=[],r=0;r").append(n)[0].reset(),i.after(n).detach(),a&&n.trigger("focus"),e.cleanData(i.off("remove")),this.options.fileInput=this.options.fileInput.map((function(e,t){return t===i[0]?n[0]:t})),i[0]===this.element[0]&&(this.element=n)},_handleFileTreeEntry:function(t,i){var n,a=this,o=e.Deferred(),r=[],s=function(e){e&&!e.entry&&(e.entry=t),o.resolve([e])};return i=i||"",t.isFile?t._file?(t._file.relativePath=i,o.resolve(t._file)):t.file((function(e){e.relativePath=i,o.resolve(e)}),s):t.isDirectory?(n=t.createReader(),function e(){n.readEntries((function(n){n.length?(r=r.concat(n),e()):function(e){a._handleFileTreeEntries(e,i+t.name+"/").done((function(e){o.resolve(e)})).fail(s)}(r)}),s)}()):o.resolve([]),o.promise()},_handleFileTreeEntries:function(t,i){var n=this;return e.when.apply(e,e.map(t,(function(e){return n._handleFileTreeEntry(e,i)})))[this._promisePipe]((function(){return Array.prototype.concat.apply([],arguments)}))},_getDroppedFiles:function(t){var i=(t=t||{}).items;return i&&i.length&&(i[0].webkitGetAsEntry||i[0].getAsEntry)?this._handleFileTreeEntries(e.map(i,(function(e){var t;return e.webkitGetAsEntry?((t=e.webkitGetAsEntry())&&(t._file=e.getAsFile()),t):e.getAsEntry()}))):e.Deferred().resolve(e.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){var i,n,a=(t=e(t)).prop("entries");if(a&&a.length)return this._handleFileTreeEntries(a);if((i=e.makeArray(t.prop("files"))).length)void 0===i[0].name&&i[0].fileName&&e.each(i,(function(e,t){t.name=t.fileName,t.size=t.fileSize}));else{if(!(n=t.prop("value")))return e.Deferred().resolve([]).promise();i=[{name:n.replace(/^.*\\/,"")}]}return e.Deferred().resolve(i).promise()},_getFileInputFiles:function(t){return t instanceof e&&1!==t.length?e.when.apply(e,e.map(t,this._getSingleFileInputFiles))[this._promisePipe]((function(){return Array.prototype.concat.apply([],arguments)})):this._getSingleFileInputFiles(t)},_onChange:function(t){var i=this,n={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(n.fileInput).always((function(a){n.files=a,i.options.replaceFileInput&&i._replaceFileInput(n),!1!==i._trigger("change",e.Event("change",{delegatedEvent:t}),n)&&i._onAdd(t,n)}))},_onPaste:function(t){var i=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,n={files:[]};i&&i.length&&(e.each(i,(function(e,t){var i=t.getAsFile&&t.getAsFile();i&&n.files.push(i)})),!1!==this._trigger("paste",e.Event("paste",{delegatedEvent:t}),n)&&this._onAdd(t,n))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var i=this,n=t.dataTransfer,a={};n&&n.files&&n.files.length&&(t.preventDefault(),this._getDroppedFiles(n).always((function(n){a.files=n,!1!==i._trigger("drop",e.Event("drop",{delegatedEvent:t}),a)&&i._onAdd(t,a)})))},_onDragOver:t("dragover"),_onDragEnter:t("dragenter"),_onDragLeave:t("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),e.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_destroy:function(){this._destroyEventHandlers()},_setOption:function(t,i){var n=-1!==e.inArray(t,this._specialOptions);n&&this._destroyEventHandlers(),this._super(t,i),n&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;void 0===t.fileInput?t.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):t.fileInput instanceof e||(t.fileInput=e(t.fileInput)),t.dropZone instanceof e||(t.dropZone=e(t.dropZone)),t.pasteZone instanceof e||(t.pasteZone=e(t.pasteZone))},_getRegExp:function(e){var t=e.split("/"),i=t.pop();return t.shift(),new RegExp(t.join("/"),i)},_isRegExpOption:function(t,i){return"url"!==t&&"string"===e.type(i)&&/^\/.*\/[igm]{0,3}$/.test(i)},_initDataAttributes:function(){var t=this,i=this.options,n=this.element.data();e.each(this.element[0].attributes,(function(e,a){var o,r=a.name.toLowerCase();/^data-/.test(r)&&(r=r.slice(5).replace(/-[a-z]/g,(function(e){return e.charAt(1).toUpperCase()})),o=n[r],t._isRegExpOption(r,o)&&(o=t._getRegExp(o)),i[r]=o)}))},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(t){var i=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always((function(e){t.files=e,i._onAdd(null,t)})):(t.files=e.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var i,n,a=this,o=e.Deferred(),r=o.promise();return r.abort=function(){return n=!0,i?i.abort():(o.reject(null,"abort","abort"),r)},this._getFileInputFiles(t.fileInput).always((function(e){n||(e.length?(t.files=e,(i=a._onSend(null,t)).then((function(e,t,i){o.resolve(e,t,i)}),(function(e,t,i){o.reject(e,t,i)}))):o.reject())})),this._enhancePromise(r)}if(t.files=e.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?e(require("jquery")):e(window.jQuery)}((function(e){"use strict";var t=0,i=e,n="parseJSON";"JSON"in window&&"parse"in JSON&&(i=JSON,n="parse"),e.ajaxTransport("iframe",(function(i){if(i.async){var n,a,o,r=i.initialIframeSrc||"javascript:false;";return{send:function(s,l){(n=e('
    ')).attr("accept-charset",i.formAcceptCharset),o=/\?/.test(i.url)?"&":"?","DELETE"===i.type?(i.url=i.url+o+"_method=DELETE",i.type="POST"):"PUT"===i.type?(i.url=i.url+o+"_method=PUT",i.type="POST"):"PATCH"===i.type&&(i.url=i.url+o+"_method=PATCH",i.type="POST"),a=e('').on("load",(function(){var t,o=e.isArray(i.paramName)?i.paramName:[i.paramName];a.off("load").on("load",(function(){var t;try{if(!(t=a.contents()).length||!t[0].firstChild)throw new Error}catch(e){t=void 0}l(200,"success",{iframe:t}),e('').appendTo(n),window.setTimeout((function(){n.remove()}),0)})),n.prop("target",a.prop("name")).prop("action",i.url).prop("method",i.type),i.formData&&e.each(i.formData,(function(t,i){e('').prop("name",i.name).val(i.value).appendTo(n)})),i.fileInput&&i.fileInput.length&&"POST"===i.type&&(t=i.fileInput.clone(),i.fileInput.after((function(e){return t[e]})),i.paramName&&i.fileInput.each((function(t){e(this).prop("name",o[t]||i.paramName)})),n.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),i.fileInput.removeAttr("form")),window.setTimeout((function(){n.submit(),t&&t.length&&i.fileInput.each((function(i,n){var a=e(t[i]);e(n).prop("name",a.prop("name")).attr("form",a.attr("form")),a.replaceWith(n)}))}),0)})),n.append(a).appendTo(document.body)},abort:function(){a&&a.off("load").prop("src",r),n&&n.remove()}}}})),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&i[n](e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe xml":function(t){var i=t&&t[0];return i&&e.isXMLDoc(i)?i:e.parseXML(i.XMLDocument&&i.XMLDocument.xml||e(i.body).html())},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})})); +function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function randomUUID(){return"object"===("undefined"==typeof crypto?"undefined":_typeof(crypto))&&"function"==typeof crypto.randomUUID?crypto.randomUUID():([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,(function(e){return(e^crypto.getRandomValues(new Uint8Array(1))[0]&15>>e/4).toString(16)}))}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function ownKeys(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _objectSpread(e){for(var t=1;t').prop("disabled")),e.support.xhrFileUpload=!(!window.ProgressEvent||!window.FileReader),e.support.xhrFormDataFileUpload=!!window.FormData,e.support.blobSlice=window.Blob&&(Blob.prototype.slice||Blob.prototype.webkitSlice||Blob.prototype.mozSlice),e.widget("blueimp.fileupload",{options:{dropZone:e(document),pasteZone:void 0,fileInput:void 0,replaceFileInput:!0,paramName:void 0,singleFileUploads:!0,limitMultiFileUploads:void 0,limitMultiFileUploadSize:void 0,limitMultiFileUploadSizeOverhead:512,sequentialUploads:!1,limitConcurrentUploads:void 0,forceIframeTransport:!1,redirect:void 0,redirectParamName:void 0,postMessage:void 0,multipart:!0,maxChunkSize:void 0,uploadedBytes:void 0,recalculateProgress:!0,progressInterval:100,bitrateInterval:500,autoUpload:!0,uniqueFilenames:void 0,messages:{uploadedBytes:"Uploaded bytes exceed file size"},i18n:function(t,i){return t=this.messages[t]||t.toString(),i&&e.each(i,(function(e,i){t=t.replace("{"+e+"}",i)})),t},formData:function(e){return e.serializeArray()},add:function(t,i){if(t.isDefaultPrevented())return!1;(i.autoUpload||!1!==i.autoUpload&&e(this).fileupload("option","autoUpload"))&&i.process().done((function(){i.submit()}))},processData:!1,contentType:!1,cache:!1,timeout:0},_promisePipe:(i=e.fn.jquery.split("."),Number(i[0])>1||Number(i[1])>7?"then":"pipe"),_specialOptions:["fileInput","dropZone","pasteZone","multipart","forceIframeTransport"],_blobSlice:e.support.blobSlice&&function(){return(this.slice||this.webkitSlice||this.mozSlice).apply(this,arguments)},_BitrateTimer:function(){this.timestamp=Date.now?Date.now():(new Date).getTime(),this.loaded=0,this.bitrate=0,this.getBitrate=function(e,t,i){var n=e-this.timestamp;return(!this.bitrate||!i||n>i)&&(this.bitrate=(t-this.loaded)*(1e3/n)*8,this.loaded=t,this.timestamp=e),this.bitrate}},_isXHRUpload:function(t){return!t.forceIframeTransport&&(!t.multipart&&e.support.xhrFileUpload||e.support.xhrFormDataFileUpload)},_getFormData:function(t){var i;return"function"===e.type(t.formData)?t.formData(t.form):e.isArray(t.formData)?t.formData:"object"===e.type(t.formData)?(i=[],e.each(t.formData,(function(e,t){i.push({name:e,value:t})})),i):[]},_getTotal:function(t){var i=0;return e.each(t,(function(e,t){i+=t.size||1})),i},_initProgressObject:function(t){var i={loaded:0,total:0,bitrate:0};t._progress?e.extend(t._progress,i):t._progress=i},_initResponseObject:function(e){var t;if(e._response)for(t in e._response)Object.prototype.hasOwnProperty.call(e._response,t)&&delete e._response[t];else e._response={}},_onProgress:function(t,i){if(t.lengthComputable){var n,a=Date.now?Date.now():(new Date).getTime();if(i._time&&i.progressInterval&&a-i._time").prop("href",t.url).prop("host");t.dataType="iframe "+(t.dataType||""),t.formData=this._getFormData(t),t.redirect&&i&&i!==location.host&&t.formData.push({name:t.redirectParamName||"redirect",value:t.redirect})},_initDataSettings:function(e){this._isXHRUpload(e)?(this._chunkedUpload(e,!0)||(e.data||this._initXHRData(e),this._initProgressListener(e)),e.postMessage&&(e.dataType="postmessage "+(e.dataType||""))):this._initIframeSettings(e)},_getParamName:function(t){var i=e(t.fileInput),n=t.paramName;return n?e.isArray(n)||(n=[n]):(n=[],i.each((function(){for(var t=e(this),i=t.prop("name")||"files[]",a=(t.prop("files")||[1]).length;a;)n.push(i),a-=1})),n.length||(n=[i.prop("name")||"files[]"])),n},_initFormSettings:function(t){t.form&&t.form.length||(t.form=e(t.fileInput.prop("form")),t.form.length||(t.form=e(this.options.fileInput.prop("form")))),t.paramName=this._getParamName(t),t.url||(t.url=t.form.prop("action")||location.href),t.type=(t.type||"string"===e.type(t.form.prop("method"))&&t.form.prop("method")||"").toUpperCase(),"POST"!==t.type&&"PUT"!==t.type&&"PATCH"!==t.type&&(t.type="POST"),t.formAcceptCharset||(t.formAcceptCharset=t.form.attr("accept-charset"))},_getAJAXSettings:function(t){var i=e.extend({},this.options,t);return this._initFormSettings(i),this._initDataSettings(i),i},_getDeferredState:function(e){return e.state?e.state():e.isResolved()?"resolved":e.isRejected()?"rejected":"pending"},_enhancePromise:function(e){return e.success=e.done,e.error=e.fail,e.complete=e.always,e},_getXHRPromise:function(t,i,n){var a=e.Deferred(),o=a.promise();return i=i||this.options.context||o,!0===t?a.resolveWith(i,n):!1===t&&a.rejectWith(i,n),o.abort=a.promise,this._enhancePromise(o)},_addConvenienceMethods:function(t,i){var n=this,a=function(t){return e.Deferred().resolveWith(n,t).promise()};i.process=function(t,o){return(t||o)&&(i._processQueue=this._processQueue=(this._processQueue||a([this]))[n._promisePipe]((function(){return i.errorThrown?e.Deferred().rejectWith(n,[i]).promise():a(arguments)}))[n._promisePipe](t,o)),this._processQueue||a([this])},i.submit=function(){return"pending"!==this.state()&&(i.jqXHR=this.jqXHR=!1!==n._trigger("submit",e.Event("submit",{delegatedEvent:t}),this)&&n._onSend(t,this)),this.jqXHR||n._getXHRPromise()},i.abort=function(){return this.jqXHR?this.jqXHR.abort():(this.errorThrown="abort",n._trigger("fail",null,this),n._getXHRPromise(!1))},i.state=function(){return this.jqXHR?n._getDeferredState(this.jqXHR):this._processQueue?n._getDeferredState(this._processQueue):void 0},i.processing=function(){return!this.jqXHR&&this._processQueue&&"pending"===n._getDeferredState(this._processQueue)},i.progress=function(){return this._progress},i.response=function(){return this._response}},_getUploadedBytes:function(e){var t=e.getResponseHeader("Range"),i=t&&t.split("-"),n=i&&i.length>1&&parseInt(i[1],10);return n&&n+1},_chunkedUpload:function(t,i){t.uploadedBytes=t.uploadedBytes||0;var n,a,o=this,r=t.files[0],s=r.size,l=t.uploadedBytes,d=t.maxChunkSize||s,c=this._blobSlice,u=e.Deferred(),m=u.promise();return!(!(this._isXHRUpload(t)&&c&&(l||("function"===e.type(d)?d(t):d)=s?(r.error=t.i18n("uploadedBytes"),this._getXHRPromise(!1,t.context,[null,"error",r.error])):(a=function(){var i=e.extend({},t),m=i._progress.loaded;i.blob=c.call(r,l,l+("function"===e.type(d)?d(i):d),r.type),i.chunkSize=i.blob.size,i.contentRange="bytes "+l+"-"+(l+i.chunkSize-1)+"/"+s,o._trigger("chunkbeforesend",null,i),o._initXHRData(i),o._initProgressListener(i),n=(!1!==o._trigger("chunksend",null,i)&&e.ajax(i)||o._getXHRPromise(!1,i.context)).done((function(n,r,d){l=o._getUploadedBytes(d)||l+i.chunkSize,m+i.chunkSize-i._progress.loaded&&o._onProgress(e.Event("progress",{lengthComputable:!0,loaded:l-i.uploadedBytes,total:l-i.uploadedBytes}),i),t.uploadedBytes=i.uploadedBytes=l,i.result=n,i.textStatus=r,i.jqXHR=d,o._trigger("chunkdone",null,i),o._trigger("chunkalways",null,i),ls._sending)for(var n=s._slots.shift();n;){if("pending"===s._getDeferredState(n)){n.resolve();break}n=s._slots.shift()}0===s._active&&s._trigger("stop")}))};return this._beforeSend(t,l),this.options.sequentialUploads||this.options.limitConcurrentUploads&&this.options.limitConcurrentUploads<=this._sending?(this.options.limitConcurrentUploads>1?(o=e.Deferred(),this._slots.push(o),r=o[s._promisePipe](d)):(this._sequence=this._sequence[s._promisePipe](d,d),r=this._sequence),r.abort=function(){return a=[void 0,"abort","abort"],n?n.abort():(o&&o.rejectWith(l.context,a),d())},this._enhancePromise(r)):d()},_onAdd:function(t,i){var n,a,o,r,s=this,l=!0,d=e.extend({},this.options,i),c=i.files,u=c.length,m=d.limitMultiFileUploads,p=d.limitMultiFileUploadSize,f=d.limitMultiFileUploadSizeOverhead,h=0,g=this._getParamName(d),v=0;if(!u)return!1;if(p&&void 0===c[0].size&&(p=void 0),(d.singleFileUploads||m||p)&&this._isXHRUpload(d))if(d.singleFileUploads||p||!m)if(!d.singleFileUploads&&p)for(o=[],n=[],r=0;rp||m&&r+1-v>=m)&&(o.push(c.slice(v,r+1)),(a=g.slice(v,r+1)).length||(a=g),n.push(a),v=r+1,h=0);else n=g;else for(o=[],n=[],r=0;r").append(n)[0].reset(),i.after(n).detach(),a&&n.trigger("focus"),e.cleanData(i.off("remove")),this.options.fileInput=this.options.fileInput.map((function(e,t){return t===i[0]?n[0]:t})),i[0]===this.element[0]&&(this.element=n)},_handleFileTreeEntry:function(t,i){var n,a=this,o=e.Deferred(),r=[],s=function(e){e&&!e.entry&&(e.entry=t),o.resolve([e])};return i=i||"",t.isFile?t._file?(t._file.relativePath=i,o.resolve(t._file)):t.file((function(e){e.relativePath=i,o.resolve(e)}),s):t.isDirectory?(n=t.createReader(),function e(){n.readEntries((function(n){n.length?(r=r.concat(n),e()):function(e){a._handleFileTreeEntries(e,i+t.name+"/").done((function(e){o.resolve(e)})).fail(s)}(r)}),s)}()):o.resolve([]),o.promise()},_handleFileTreeEntries:function(t,i){var n=this;return e.when.apply(e,e.map(t,(function(e){return n._handleFileTreeEntry(e,i)})))[this._promisePipe]((function(){return Array.prototype.concat.apply([],arguments)}))},_getDroppedFiles:function(t){var i=(t=t||{}).items;return i&&i.length&&(i[0].webkitGetAsEntry||i[0].getAsEntry)?this._handleFileTreeEntries(e.map(i,(function(e){var t;return e.webkitGetAsEntry?((t=e.webkitGetAsEntry())&&(t._file=e.getAsFile()),t):e.getAsEntry()}))):e.Deferred().resolve(e.makeArray(t.files)).promise()},_getSingleFileInputFiles:function(t){var i,n,a=(t=e(t)).prop("entries");if(a&&a.length)return this._handleFileTreeEntries(a);if((i=e.makeArray(t.prop("files"))).length)void 0===i[0].name&&i[0].fileName&&e.each(i,(function(e,t){t.name=t.fileName,t.size=t.fileSize}));else{if(!(n=t.prop("value")))return e.Deferred().resolve([]).promise();i=[{name:n.replace(/^.*\\/,"")}]}return e.Deferred().resolve(i).promise()},_getFileInputFiles:function(t){return t instanceof e&&1!==t.length?e.when.apply(e,e.map(t,this._getSingleFileInputFiles))[this._promisePipe]((function(){return Array.prototype.concat.apply([],arguments)})):this._getSingleFileInputFiles(t)},_onChange:function(t){var i=this,n={fileInput:e(t.target),form:e(t.target.form)};this._getFileInputFiles(n.fileInput).always((function(a){n.files=a,i.options.replaceFileInput&&i._replaceFileInput(n),!1!==i._trigger("change",e.Event("change",{delegatedEvent:t}),n)&&i._onAdd(t,n)}))},_onPaste:function(t){var i=t.originalEvent&&t.originalEvent.clipboardData&&t.originalEvent.clipboardData.items,n={files:[]};i&&i.length&&(e.each(i,(function(e,t){var i=t.getAsFile&&t.getAsFile();i&&n.files.push(i)})),!1!==this._trigger("paste",e.Event("paste",{delegatedEvent:t}),n)&&this._onAdd(t,n))},_onDrop:function(t){t.dataTransfer=t.originalEvent&&t.originalEvent.dataTransfer;var i=this,n=t.dataTransfer,a={};n&&n.files&&n.files.length&&(t.preventDefault(),this._getDroppedFiles(n).always((function(n){a.files=n,!1!==i._trigger("drop",e.Event("drop",{delegatedEvent:t}),a)&&i._onAdd(t,a)})))},_onDragOver:t("dragover"),_onDragEnter:t("dragenter"),_onDragLeave:t("dragleave"),_initEventHandlers:function(){this._isXHRUpload(this.options)&&(this._on(this.options.dropZone,{dragover:this._onDragOver,drop:this._onDrop,dragenter:this._onDragEnter,dragleave:this._onDragLeave}),this._on(this.options.pasteZone,{paste:this._onPaste})),e.support.fileInput&&this._on(this.options.fileInput,{change:this._onChange})},_destroyEventHandlers:function(){this._off(this.options.dropZone,"dragenter dragleave dragover drop"),this._off(this.options.pasteZone,"paste"),this._off(this.options.fileInput,"change")},_destroy:function(){this._destroyEventHandlers()},_setOption:function(t,i){var n=-1!==e.inArray(t,this._specialOptions);n&&this._destroyEventHandlers(),this._super(t,i),n&&(this._initSpecialOptions(),this._initEventHandlers())},_initSpecialOptions:function(){var t=this.options;void 0===t.fileInput?t.fileInput=this.element.is('input[type="file"]')?this.element:this.element.find('input[type="file"]'):t.fileInput instanceof e||(t.fileInput=e(t.fileInput)),t.dropZone instanceof e||(t.dropZone=e(t.dropZone)),t.pasteZone instanceof e||(t.pasteZone=e(t.pasteZone))},_getRegExp:function(e){var t=e.split("/"),i=t.pop();return t.shift(),new RegExp(t.join("/"),i)},_isRegExpOption:function(t,i){return"url"!==t&&"string"===e.type(i)&&/^\/.*\/[igm]{0,3}$/.test(i)},_initDataAttributes:function(){var t=this,i=this.options,n=this.element.data();e.each(this.element[0].attributes,(function(e,a){var o,r=a.name.toLowerCase();/^data-/.test(r)&&(r=r.slice(5).replace(/-[a-z]/g,(function(e){return e.charAt(1).toUpperCase()})),o=n[r],t._isRegExpOption(r,o)&&(o=t._getRegExp(o)),i[r]=o)}))},_create:function(){this._initDataAttributes(),this._initSpecialOptions(),this._slots=[],this._sequence=this._getXHRPromise(!0),this._sending=this._active=0,this._initProgressObject(this),this._initEventHandlers()},active:function(){return this._active},progress:function(){return this._progress},add:function(t){var i=this;t&&!this.options.disabled&&(t.fileInput&&!t.files?this._getFileInputFiles(t.fileInput).always((function(e){t.files=e,i._onAdd(null,t)})):(t.files=e.makeArray(t.files),this._onAdd(null,t)))},send:function(t){if(t&&!this.options.disabled){if(t.fileInput&&!t.files){var i,n,a=this,o=e.Deferred(),r=o.promise();return r.abort=function(){return n=!0,i?i.abort():(o.reject(null,"abort","abort"),r)},this._getFileInputFiles(t.fileInput).always((function(e){n||(e.length?(t.files=e,(i=a._onSend(null,t)).then((function(e,t,i){o.resolve(e,t,i)}),(function(e,t,i){o.reject(e,t,i)}))):o.reject())})),this._enhancePromise(r)}if(t.files=e.makeArray(t.files),t.files.length)return this._onSend(null,t)}return this._getXHRPromise(!1,t&&t.context)}})})),function(e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))?e(require("jquery")):e(window.jQuery)}((function(e){"use strict";var t=0,i=e,n="parseJSON";"JSON"in window&&"parse"in JSON&&(i=JSON,n="parse"),e.ajaxTransport("iframe",(function(i){if(i.async){var n,a,o,r=i.initialIframeSrc||"javascript:false;";return{send:function(s,l){(n=e('
    ')).attr("accept-charset",i.formAcceptCharset),o=/\?/.test(i.url)?"&":"?","DELETE"===i.type?(i.url=i.url+o+"_method=DELETE",i.type="POST"):"PUT"===i.type?(i.url=i.url+o+"_method=PUT",i.type="POST"):"PATCH"===i.type&&(i.url=i.url+o+"_method=PATCH",i.type="POST"),a=e('').on("load",(function(){var t,o=e.isArray(i.paramName)?i.paramName:[i.paramName];a.off("load").on("load",(function(){var t;try{if(!(t=a.contents()).length||!t[0].firstChild)throw new Error}catch(e){t=void 0}l(200,"success",{iframe:t}),e('').appendTo(n),window.setTimeout((function(){n.remove()}),0)})),n.prop("target",a.prop("name")).prop("action",i.url).prop("method",i.type),i.formData&&e.each(i.formData,(function(t,i){e('').prop("name",i.name).val(i.value).appendTo(n)})),i.fileInput&&i.fileInput.length&&"POST"===i.type&&(t=i.fileInput.clone(),i.fileInput.after((function(e){return t[e]})),i.paramName&&i.fileInput.each((function(t){e(this).prop("name",o[t]||i.paramName)})),n.append(i.fileInput).prop("enctype","multipart/form-data").prop("encoding","multipart/form-data"),i.fileInput.removeAttr("form")),window.setTimeout((function(){n.submit(),t&&t.length&&i.fileInput.each((function(i,n){var a=e(t[i]);e(n).prop("name",a.prop("name")).attr("form",a.attr("form")),a.replaceWith(n)}))}),0)})),n.append(a).appendTo(document.body)},abort:function(){a&&a.off("load").prop("src",r),n&&n.remove()}}}})),e.ajaxSetup({converters:{"iframe text":function(t){return t&&e(t[0].body).text()},"iframe json":function(t){return t&&i[n](e(t[0].body).text())},"iframe html":function(t){return t&&e(t[0].body).html()},"iframe xml":function(t){var i=t&&t[0];return i&&e.isXMLDoc(i)?i:e.parseXML(i.XMLDocument&&i.XMLDocument.xml||e(i.body).html())},"iframe script":function(t){return t&&e.globalEval(e(t[0].body).text())}}})}));var bus=new Vue;function initializeMediaApplication(e,t,i){initialized||(initialized=!0,t||console.error("mediaApplicationUrl variable is not defined"),$.ajax({url:t,method:"GET",success:function(t){$(".ta-content").append(t),$(document).trigger("mediaapplication:ready");var n={name:$("#t-mediaLibrary").text(),path:"",folder:"",isDirectory:!0};mediaApp=new Vue({el:"#mediaApp",data:{selectedFolder:{},mediaItems:[],selectedMedias:[],errors:[],dragDropThumbnail:new Image,smallThumbs:!1,gridView:!1,mediaFilter:"",sortBy:"",sortAsc:!0,itemsInPage:[]},created:function(){var e=this;e.dragDropThumbnail.src=(i||"")+"/OrchardCore.Media/Images/drag-thumbnail.png",bus.$on("folderSelected",(function(t){e.selectedFolder=t})),bus.$on("folderDeleted",(function(){e.selectRoot()})),bus.$on("folderAdded",(function(t){e.selectedFolder=t,t.selected=!0})),bus.$on("mediaListMoved",(function(t){e.loadFolder(e.selectedFolder),t&&e.errors.push(t)})),bus.$on("mediaRenamed",(function(t,i,n,a){var o=e.mediaItems.filter((function(e){return e.mediaPath===n}))[0];o.mediaPath=i,o.name=t,o.url=a})),bus.$on("createFolderRequested",(function(t){e.createFolder()})),bus.$on("deleteFolderRequested",(function(t){e.deleteFolder()})),bus.$on("sortChangeRequested",(function(t){e.changeSort(t)})),bus.$on("mediaToggleRequested",(function(t){e.toggleSelectionOfMedia(t)})),bus.$on("renameMediaRequested",(function(t){e.renameMedia(t)})),bus.$on("deleteMediaRequested",(function(t){e.deleteMediaItem(t)})),bus.$on("mediaDragStartRequested",(function(t,i){e.handleDragStart(t,i)})),bus.$on("pagerEvent",(function(t){e.itemsInPage=t,e.selectedMedias=[]})),localStorage.getItem("mediaApplicationPrefs")?e.currentPrefs=JSON.parse(localStorage.getItem("mediaApplicationPrefs")):e.selectedFolder=n},computed:{isHome:function(){return this.selectedFolder==n},parents:function(){var e=[];for(parentFolder=this.selectedFolder;parentFolder&&""!=parentFolder.path;)e.unshift(parentFolder),parentFolder=parentFolder.parent;return e},root:function(){return n},filteredMediaItems:function(){var e=this;e.selectedMedias=[];var t=e.mediaItems.filter((function(t){return t.name.toLowerCase().indexOf(e.mediaFilter.toLowerCase())>-1}));switch(e.sortBy){case"size":t.sort((function(t,i){return e.sortAsc?t.size-i.size:i.size-t.size}));break;case"mime":t.sort((function(t,i){return e.sortAsc?t.mime.toLowerCase().localeCompare(i.mime.toLowerCase()):i.mime.toLowerCase().localeCompare(t.mime.toLowerCase())}));break;case"lastModify":t.sort((function(t,i){return e.sortAsc?t.lastModify-i.lastModify:i.lastModify-t.lastModify}));break;default:t.sort((function(t,i){return e.sortAsc?t.name.toLowerCase().localeCompare(i.name.toLowerCase()):i.name.toLowerCase().localeCompare(t.name.toLowerCase())}))}return t},hiddenCount:function(){return this.mediaItems.length-this.filteredMediaItems.length},thumbSize:function(){return this.smallThumbs?100:240},currentPrefs:{get:function(){return{smallThumbs:this.smallThumbs,selectedFolder:this.selectedFolder,gridView:this.gridView}},set:function(e){e&&(this.smallThumbs=e.smallThumbs,this.selectedFolder=e.selectedFolder,this.gridView=e.gridView)}}},watch:{currentPrefs:function(e){localStorage.setItem("mediaApplicationPrefs",JSON.stringify(e))},selectedFolder:function(e){this.mediaFilter="",this.selectedFolder=e,this.loadFolder(e)}},mounted:function(){this.$refs.rootFolder.toggle()},methods:{uploadUrl:function(){if(!this.selectedFolder)return null;var e=$("#uploadFiles").val();return e+(-1==e.indexOf("?")?"?":"&")+"path="+encodeURIComponent(this.selectedFolder.path)},selectRoot:function(){this.selectedFolder=this.root},loadFolder:function(e){this.errors=[],this.selectedMedias=[];var t=this,i=$("#getMediaItemsUrl").val();console.log(e.path),$.ajax({url:i+(-1==i.indexOf("?")?"?":"&")+"path="+encodeURIComponent(e.path),method:"GET",success:function(e){e.forEach((function(e){e.open=!1})),t.mediaItems=e,t.selectedMedias=[],t.sortBy="",t.sortAsc=!0},error:function(i){console.log("error loading folder:"+e.path),t.selectRoot()}})},selectAll:function(){this.selectedMedias=[];for(var e=0;e-1&&(t.mediaItems.splice(n,1),bus.$emit("mediaDeleted",t.selectedMedias[i]))}t.selectedMedias=[]},error:function(e){console.error(e.responseText)}})}}}))},deleteMediaItem:function(e){var t=this;e&&confirmDialog(_objectSpread(_objectSpread({},$("#deleteMedia").data()),{},{callback:function(i){i&&$.ajax({url:$("#deleteMediaUrl").val()+"?path="+encodeURIComponent(e.mediaPath),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(i){var n=t.mediaItems&&t.mediaItems.indexOf(e);n>-1&&(t.mediaItems.splice(n,1),bus.$emit("mediaDeleted",e))},error:function(e){console.error(e.responseText)}})}}))},handleDragStart:function(e,t){var i=[];this.selectedMedias.forEach((function(e){i.push(e.name)})),0==this.isMediaSelected(e)&&(i.push(e.name),this.selectedMedias.push(e)),t.dataTransfer.setData("mediaNames",JSON.stringify(i)),t.dataTransfer.setData("sourceFolder",this.selectedFolder.path),t.dataTransfer.setDragImage(this.dragDropThumbnail,10,10),t.dataTransfer.effectAllowed="move"},handleScrollWhileDrag:function(e){e.clientY<150&&window.scrollBy(0,-10),e.clientY>window.innerHeight-100&&window.scrollBy(0,10)},changeSort:function(e){this.sortBy==e?this.sortAsc=!this.sortAsc:(this.sortAsc=!0,this.sortBy=e)}}}),$("#create-folder-name").keypress((function(e){if(13==e.which)return $("#modalFooterOk").click(),!1})),$("#modalFooterOk").on("click",(function(e){var t=$("#create-folder-name").val();""!==t&&$.ajax({url:$("#createFolderUrl").val()+"?path="+encodeURIComponent(mediaApp.selectedFolder.path)+"&name="+encodeURIComponent(t),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(e){bus.$emit("addFolder",mediaApp.selectedFolder,e),bootstrap.Modal.getOrCreateInstance($("#createFolderModal")).hide()},error:function(e){$("#createFolderModal-errors").empty();var t=JSON.parse(e.responseText).value;$('').text(t).appendTo($("#createFolderModal-errors"))}})})),$("#renameMediaModalFooterOk").on("click",(function(e){var t=$("#new-item-name").val(),i=$("#old-item-name").val();if(""!==t){var n=mediaApp.selectedFolder.path+"/";"/"===n&&(n="");var a=n+t,o=n+i;if(a.toLowerCase()!==o.toLowerCase())$.ajax({url:$("#renameMediaUrl").val()+"?oldPath="+encodeURIComponent(o)+"&newPath="+encodeURIComponent(a),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val()},success:function(e){bootstrap.Modal.getOrCreateInstance($("#renameMediaModal")).hide(),bus.$emit("mediaRenamed",t,a,o,e.newUrl)},error:function(e){$("#renameMediaModal-errors").empty();var t=JSON.parse(e.responseText).value;$('').text(t).appendTo($("#renameMediaModal-errors"))}});else bootstrap.Modal.getOrCreateInstance($("#renameMediaModal")).hide()}})),e&&(document.getElementById("mediaApp").style.display=""),$(document).trigger("mediaApp:ready")},error:function(e){console.error(e.responseText)}}))}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function ownKeys(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function _objectSpread(e){for(var t=1;t\n \n
      \n \n \n
    \n \n '),props:{model:Object,selectedInMediaApp:Object,level:Number},data:function(){return{open:!1,children:null,parent:null,isHovered:!1,padding:0}},computed:{empty:function(){return!this.children||0==this.children.length},isSelected:function(){return this.selectedInMediaApp.name==this.model.name&&this.selectedInMediaApp.path==this.model.path},isRoot:function(){return""===this.model.path}},mounted:function(){0==this.isRoot&&this.isAncestorOfSelectedFolder()&&this.toggle(),this.padding=this.level<3?16:16+8*this.level},created:function(){var e=this;bus.$on("deleteFolder",(function(t){if(e.children){var i=e.children&&e.children.indexOf(t);i>-1&&(e.children.splice(i,1),bus.$emit("folderDeleted"))}})),bus.$on("addFolder",(function(t,i){e.model==t&&(null!==e.children&&e.children.push(i),i.parent=e.model,bus.$emit("folderAdded",i))}))},methods:{isAncestorOfSelectedFolder:function(){for(parentFolder=mediaApp.selectedFolder;parentFolder;){if(parentFolder.path==this.model.path)return!0;parentFolder=parentFolder.parent}return!1},toggle:function(){this.open=!this.open,this.open&&!this.children&&this.loadChildren()},select:function(){bus.$emit("folderSelected",this.model),this.loadChildren()},createFolder:function(){bus.$emit("createFolderRequested")},deleteFolder:function(){bus.$emit("deleteFolderRequested")},loadChildren:function(){var e=this;0==this.open&&(this.open=!0),$.ajax({url:$("#getFoldersUrl").val()+"?path="+encodeURIComponent(e.model.path),method:"GET",success:function(t){e.children=t,e.children.forEach((function(t){t.parent=e.model}))},error:function(e){emtpy=!1,console.error(e.responseText)}})},handleDragOver:function(e){this.isHovered=!0},handleDragLeave:function(e){this.isHovered=!1},moveMediaToFolder:function(e,t){this.isHovered=!1;var i=JSON.parse(t.dataTransfer.getData("mediaNames"));if(!(i.length<1)){var n=t.dataTransfer.getData("sourceFolder"),a=e.path;""===n&&(n="root"),""===a&&(a="root"),n!==a?confirmDialog(_objectSpread(_objectSpread({},$("#moveMedia").data()),{},{callback:function(e){e&&$.ajax({url:$("#moveMediaListUrl").val(),method:"POST",data:{__RequestVerificationToken:$("input[name='__RequestVerificationToken']").val(),mediaNames:i,sourceFolder:n,targetFolder:a},success:function(){bus.$emit("mediaListMoved")},error:function(e){console.error(e.responseText),bus.$emit("mediaListMoved",e.responseText)}})}})):alert($("#sameFolderMessage").val())}}}});var faIcons={image:"fa-regular fa-image",pdf:"fa-regular fa-file-pdf",word:"fa-regular fa-file-word",powerpoint:"fa-regular fa-file-powerpoint",excel:"fa-regular fa-file-excel",csv:"fa-regular fa-file",audio:"fa-regular fa-file-audio",video:"fa-regular fa-file-video",archive:"fa-regular fa-file-zipper",code:"fa-regular fa-file-code",text:"fa-regular fa-file-lines",file:"fa-regular fa-file"},faThumbnails={gif:faIcons.image,jpeg:faIcons.image,jpg:faIcons.image,png:faIcons.image,pdf:faIcons.pdf,doc:faIcons.word,docx:faIcons.word,ppt:faIcons.powerpoint,pptx:faIcons.powerpoint,xls:faIcons.excel,xlsx:faIcons.excel,csv:faIcons.csv,aac:faIcons.audio,mp3:faIcons.audio,ogg:faIcons.audio,avi:faIcons.video,flv:faIcons.video,mkv:faIcons.video,mp4:faIcons.video,webm:faIcons.video,gz:faIcons.archive,zip:faIcons.archive,css:faIcons.code,html:faIcons.code,js:faIcons.code,txt:faIcons.text};function getClassNameForExtension(e){return faThumbnails[e.toLowerCase()]||faIcons.file}function getExtensionForFilename(e){return e.slice(2+(e.lastIndexOf(".")-1>>>0))}function getClassNameForFilename(e){return getClassNameForExtension(getExtensionForFilename(e))}function initializeAttachedMediaField(e,t,i,n,a,o,r,s,l){var d,c=$(document.getElementById($(e).data("for"))).data("init"),u=$(e),m=u.attr("id");mediaFieldApps.push(d=new Vue({el:u.get(0),data:{mediaItems:[],selectedMedia:null,smallThumbs:!1,idPrefix:m,initialized:!1,allowMediaText:o,backupMediaText:"",allowAnchors:r,backupAnchor:null,mediaTextmodal:null,anchoringModal:null},created:function(){this.currentPrefs=JSON.parse(localStorage.getItem("mediaFieldPrefs"))},computed:{paths:{get:function(){var e=[];return this.initialized?(this.mediaItems.forEach((function(t){"not-found"!==t.mediaPath&&e.push({path:t.mediaPath,isRemoved:t.isRemoved,isNew:t.isNew,mediaText:t.mediaText,anchor:t.anchor,attachedFileName:t.attachedFileName})})),JSON.stringify(e)):JSON.stringify(c)},set:function(e){var t=this,i=e||[],a=$.Deferred(),o=[],r=0;i.forEach((function(e,i){o.push({name:" "+e.path,mime:"",mediaPath:"",anchor:e.anchor,attachedFileName:e.attachedFileName}),promise=$.when(a).done((function(){$.ajax({url:n+"?path="+encodeURIComponent(e.path),method:"GET",success:function(n){n.vuekey=n.name+i.toString(),n.mediaText=e.mediaText,n.anchor=e.anchor,n.attachedFileName=e.attachedFileName,o.splice(i,1,n),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)},error:function(n){console.log(JSON.stringify(n)),o.splice(i,1,{name:e.path,mime:"",mediaPath:"not-found",mediaText:"",anchor:{x:.5,y:.5},attachedFileName:e.attachedFileName}),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)}})}))})),a.resolve()}},fileSize:function(){return Math.round(this.selectedMedia.size/1024)},canAddMedia:function(){for(var e=[],t=0;t0&&a},thumbSize:function(){return this.smallThumbs?120:240},currentPrefs:{get:function(){return{smallThumbs:this.smallThumbs}},set:function(e){e&&(this.smallThumbs=e.smallThumbs)}}},mounted:function(){var e=this;e.paths=c,e.$on("selectAndDeleteMediaRequested",(function(t){e.selectAndDeleteMedia(t)})),e.$on("selectMediaRequested",(function(t){e.selectMedia(t)}));var n="#"+t,o=u.attr("id"),r=randomUUID();$(n).fileupload({limitConcurrentUploads:20,dropZone:$("#"+o),dataType:"json",url:i,maxChunkSize:l,add:function(t,i){var n,a=i.files.length;for(n=0;n0)for(var o=0;o1&&!1===a?(alert($("#onlyOneItemMessage").val()),d.mediaItems.push(i[0]),d.initialized=!0):(d.mediaItems=d.mediaItems.concat(i),d.initialized=!0)):alert(n)},error:function(e,t,i){console.log("Error on upload."),console.log(e),console.log(t),console.log(i)}}).on("fileuploadchunkbeforesend",(function(e,t){var i=t.files[0];t.blob=new File([t.blob],i.name,{type:i.type,lastModified:i.lastModified})}))},methods:{selectMedia:function(e){this.selectedMedia=e},getUniqueId:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))},removeSelected:function(e){if(this.selectedMedia){var t=this.mediaItems&&this.mediaItems.indexOf(this.selectedMedia);t>-1&&(this.mediaItems[t].isRemoved=!0,this.mediaItems.splice(t,1))}else 1===this.mediaItems.length&&(this.mediaItems[t].isRemoved=!0,this.mediaItems.splice(0,1));this.selectedMedia=null},showMediaTextModal:function(e){this.mediaTextModal=new bootstrap.Modal(this.$refs.mediaTextModal),this.mediaTextModal.show(),this.backupMediaText=this.selectedMedia.mediaText},cancelMediaTextModal:function(e){this.mediaTextModal.hide(),this.selectedMedia.mediaText=this.backupMediaText},showAnchorModal:function(e){this.anchoringModal=new bootstrap.Modal(this.$refs.anchoringModal),this.anchoringModal.show(),this.selectedMedia.anchor={x:this.selectedMedia.anchor.x,y:this.selectedMedia.anchor.y},this.backupAnchor=this.selectedMedia.anchor},cancelAnchoringModal:function(e){this.anchoringModal.hide(),this.selectedMedia.anchor=this.backupAnchor},resetAnchor:function(e){this.selectedMedia.anchor={x:.5,y:.5}},onAnchorDrop:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},anchorLeft:function(){if(this.$refs.anchorImage&&this.$refs.modalBody&&this.selectedMedia){var e=(this.$refs.modalBody.clientWidth-this.$refs.anchorImage.clientWidth)/2,t=this.selectedMedia.anchor.x*this.$refs.anchorImage.clientWidth+e;return t<17?t=17:t-=8,t+"px"}return"0"},anchorTop:function(){if(this.$refs.anchorImage&&this.selectedMedia){var e=this.selectedMedia.anchor.y*this.$refs.anchorImage.clientHeight;return e<15?e=15:e+=5,e+"px"}return"0"},setAnchor:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},addMediaFiles:function(e){e.length>1&&!1===a?(alert($("#onlyOneItemMessage").val()),d.mediaItems.push(e[0]),d.initialized=!0):(d.mediaItems=d.mediaItems.concat(e),d.initialized=!0)},selectAndDeleteMedia:function(e){var t=this;t.selectedMedia=e,setTimeout((function(){t.removeSelected()}),100)}},watch:{mediaItems:{deep:!0,handler:function(){setTimeout((function(){$(document).trigger("contentpreview:render")}),100)}},currentPrefs:function(e){localStorage.setItem("mediaFieldPrefs",JSON.stringify(e))}}}))}function initializeMediaField(e,t,i,n,a,o){if(null!==e){var r,s=$(document.getElementById($(e).data("for"))).data("init"),l=$(e),d=l.attr("id");t.addEventListener("hidden.bs.modal",(function(e){$("#mediaApp").appendTo("body"),$("#mediaApp").hide()})),mediaFieldApps.push(r=new Vue({el:l.get(0),data:{mediaItems:[],selectedMedia:null,smallThumbs:!1,idPrefix:d,initialized:!1,allowMediaText:a,backupMediaText:"",allowAnchors:o,backupAnchor:null,mediaTextModal:null,anchoringModal:null},created:function(){this.currentPrefs=JSON.parse(localStorage.getItem("mediaFieldPrefs"))},computed:{paths:{get:function(){var e=[];return this.initialized?(this.mediaItems.forEach((function(t){"not-found"!==t.mediaPath&&e.push({path:t.mediaPath,mediaText:t.mediaText,anchor:t.anchor})})),JSON.stringify(e)):JSON.stringify(s)},set:function(e){var t=this,n=e||[],a=$.Deferred(),o=[],r=0;n.forEach((function(e,n){o.push({name:" "+e.path,mime:"",mediaPath:""}),promise=$.when(a).done((function(){$.ajax({url:i+"?path="+encodeURIComponent(e.path),method:"GET",success:function(i){i.vuekey=i.name+n.toString(),i.mediaText=e.mediaText,i.anchor=e.anchor,o.splice(n,1,i),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)},error:function(i){console.log(i),o.splice(n,1,{name:e.path,mime:"",mediaPath:"not-found",mediaText:"",anchor:{x:0,y:0}}),o.length===++r&&(o.forEach((function(e){t.mediaItems.push(e)})),t.initialized=!0)}})}))})),a.resolve()}},fileSize:function(){return Math.round(this.selectedMedia.size/1024)},canAddMedia:function(){return 0===this.mediaItems.length||this.mediaItems.length>0&&n},thumbSize:function(){return this.smallThumbs?120:240},currentPrefs:{get:function(){return{smallThumbs:this.smallThumbs}},set:function(e){e&&(this.smallThumbs=e.smallThumbs)}}},mounted:function(){var e=this;e.paths=s,e.$on("selectAndDeleteMediaRequested",(function(t){e.selectAndDeleteMedia(t)})),e.$on("selectMediaRequested",(function(t){e.selectMedia(t)})),e.$on("filesUploaded",(function(t){e.addMediaFiles(t)}))},methods:{selectMedia:function(e){this.selectedMedia=e},showModal:function(e){var i=this;if(i.canAddMedia){$("#mediaApp").appendTo($(t).find(".modal-body")),$("#mediaApp").show();var n=new bootstrap.Modal(t);n.show(),$(t).find(".mediaFieldSelectButton").off("click").on("click",(function(e){return i.addMediaFiles(mediaApp.selectedMedias),mediaApp.selectedMedias=[],n.hide(),!0}))}},showMediaTextModal:function(e){this.mediaTextModal=new bootstrap.Modal(this.$refs.mediaTextModal),this.mediaTextModal.show(),this.backupMediaText=this.selectedMedia.mediaText},cancelMediaTextModal:function(e){this.mediaTextModal.hide(),this.selectedMedia.mediaText=this.backupMediaText},showAnchorModal:function(e){this.anchoringModal=new bootstrap.Modal(this.$refs.anchoringModal),this.anchoringModal.show(),this.selectedMedia.anchor={x:this.selectedMedia.anchor.x,y:this.selectedMedia.anchor.y},this.backupAnchor=this.selectedMedia.anchor},cancelAnchoringModal:function(e){this.anchoringModal.hide(),this.selectedMedia.anchor=this.backupAnchor},resetAnchor:function(e){this.selectedMedia.anchor={x:.5,y:.5}},onAnchorDrop:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},anchorLeft:function(){if(this.$refs.anchorImage&&this.$refs.modalBody&&this.selectedMedia){var e=(this.$refs.modalBody.clientWidth-this.$refs.anchorImage.clientWidth)/2,t=this.selectedMedia.anchor.x*this.$refs.anchorImage.clientWidth+e,i=Math.round(this.$refs.modalBody.querySelector(".icon-media-anchor").clientWidth);return Number.isInteger(i)&&(t-=i/2),t+"px"}return"0"},anchorTop:function(){return this.$refs.anchorImage&&this.selectedMedia?this.selectedMedia.anchor.y*this.$refs.anchorImage.clientHeight+"px":"0"},setAnchor:function(e){var t=this.$refs.anchorImage;this.selectedMedia.anchor={x:e.offsetX/t.clientWidth,y:e.offsetY/t.clientHeight}},addMediaFiles:function(e){e.length>1&&!1===n?(alert($("#onlyOneItemMessage").val()),r.mediaItems.push(e[0]),r.initialized=!0):(r.mediaItems=r.mediaItems.concat(e),r.initialized=!0)},removeSelected:function(e){if(this.selectedMedia){var t=this.mediaItems&&this.mediaItems.indexOf(this.selectedMedia);t>-1&&this.mediaItems.splice(t,1)}else 1===this.mediaItems.length&&this.mediaItems.splice(0,1);this.selectedMedia=null},selectAndDeleteMedia:function(e){var t=this;t.selectedMedia=e,setTimeout((function(){t.removeSelected()}),100)}},watch:{mediaItems:{deep:!0,handler:function(){setTimeout((function(){$(document).trigger("contentpreview:render")}),100)}},currentPrefs:function(e){localStorage.setItem("mediaFieldPrefs",JSON.stringify(e))}}}))}}Vue.component("media-items-grid",{template:'\n
      \n
    1. \n
      \n \n \n
      \n
      \n \n \n \n {{ media.name }}\n
      \n
    2. \n
    \n ',data:function(){return{T:{}}},props:{filteredMediaItems:Array,selectedMedias:Array,thumbSize:Number},created:function(){this.T.editButton=$("#t-edit-button").val(),this.T.deleteButton=$("#t-delete-button").val()},methods:{isMediaSelected:function(e){return this.selectedMedias.some((function(t,i,n){return t.url.toLowerCase()===e.url.toLowerCase()}))},buildMediaUrl:function(e,t){return e+(-1==e.indexOf("?")?"?":"&")+"width="+t+"&height="+t},toggleSelectionOfMedia:function(e){bus.$emit("mediaToggleRequested",e)},renameMedia:function(e){bus.$emit("renameMediaRequested",e)},deleteMedia:function(e){bus.$emit("deleteMediaRequested",e)},dragStart:function(e,t){bus.$emit("mediaDragStartRequested",e,t)},getfontAwesomeClassNameForFileName:function(e,t){return getClassNameForFilename(e)+" "+t}}}),Vue.component("media-items-table",{template:'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    {{ T.imageHeader }}\n {{ T.nameHeader }}\n \n \n {{ T.lastModifyHeader }} \n \n \n \n {{ T.sizeHeader }}\n \n \n \n \n {{ T.typeHeader }}\n \n \n
    \n
    \n \n \n
    \n
    \n \n \n
    {{ printDateTime(media.lastModify) }}
    \n
    \n
    {{ isNaN(media.size)? 0 : Math.round(media.size / 1024) }} KB
    \n
    \n
    {{ media.mime }}
    \n
    \n ',data:function(){return{T:{}}},props:{sortBy:String,sortAsc:Boolean,filteredMediaItems:Array,selectedMedias:Array,thumbSize:Number},created:function(){var e=this;e.T.imageHeader=$("#t-image-header").val(),e.T.nameHeader=$("#t-name-header").val(),e.T.lastModifyHeader=$("#t-lastModify-header").val(),e.T.sizeHeader=$("#t-size-header").val(),e.T.typeHeader=$("#t-type-header").val(),e.T.editButton=$("#t-edit-button").val(),e.T.deleteButton=$("#t-delete-button").val(),e.T.viewButton=$("#t-view-button").val()},methods:{isMediaSelected:function(e){return this.selectedMedias.some((function(t,i,n){return t.url.toLowerCase()===e.url.toLowerCase()}))},buildMediaUrl:function(e,t){return e+(-1==e.indexOf("?")?"?":"&")+"width="+t+"&height="+t},changeSort:function(e){bus.$emit("sortChangeRequested",e)},toggleSelectionOfMedia:function(e){bus.$emit("mediaToggleRequested",e)},renameMedia:function(e){bus.$emit("renameMediaRequested",e)},deleteMedia:function(e){bus.$emit("deleteMediaRequested",e)},dragStart:function(e,t){bus.$emit("mediaDragStartRequested",e,t)},printDateTime:function(e){return new Date(e).toLocaleString()},getfontAwesomeClassNameForFileName:function(e,t){return getClassNameForFilename(e)+" "+t}}}),Vue.component("pager",{template:'\n
    \n \n \n
    \n ',props:{sourceItems:Array},data:function(){return{pageSize:10,pageSizeOptions:[10,30,50,100],current:0,T:{}}},created:function(){var e=this;e.T.pagerFirstButton=$("#t-pager-first-button").val(),e.T.pagerPreviousButton=$("#t-pager-previous-button").val(),e.T.pagerNextButton=$("#t-pager-next-button").val(),e.T.pagerLastButton=$("#t-pager-last-button").val(),e.T.pagerPageSizeLabel=$("#t-pager-page-size-label").val(),e.T.pagerPageLabel=$("#t-pager-page-label").val(),e.T.pagerTotalLabel=$("#t-pager-total-label").val()},methods:{next:function(){this.current=this.current+1},previous:function(){this.current=this.current-1},goFirst:function(){this.current=0},goLast:function(){this.current=this.totalPages-1},goTo:function(e){this.current=e}},computed:{total:function(){return this.sourceItems?this.sourceItems.length:0},totalPages:function(){var e=Math.ceil(this.total/this.pageSize);return e>0?e:1},isLastPage:function(){return this.current+1>=this.totalPages},isFirstPage:function(){return 0===this.current},canDoNext:function(){return!this.isLastPage},canDoPrev:function(){return!this.isFirstPage},canDoFirst:function(){return!this.isFirstPage},canDoLast:function(){return!this.isLastPage},itemsInCurrentPage:function(){var e=this.pageSize*this.current,t=e+this.pageSize,i=this.sourceItems.slice(e,t);return bus.$emit("pagerEvent",i),i},pageLinks:function(){var e=[];e.push(this.current+1);var t=this.current>0?this.current:-1;e.unshift(t);var i=this.current>1?this.current-1:-1;e.unshift(i);var n=this.totalPages-this.current>1?this.current+2:-1;e.push(n);var a=this.totalPages-this.current>2?this.current+3:-1;return e.push(a),e}},watch:{sourceItems:function(){this.current=0},pageSize:function(){this.current=0}}}),Vue.component("sortIndicator",{template:'\n
    \n \n \n
    \n ',props:{colname:String,selectedcolname:String,asc:Boolean},computed:{isActive:function(){return this.colname.toLowerCase()==this.selectedcolname.toLowerCase()}}}),Vue.component("mediaFieldThumbsContainer",{template:'
    {{T.noImages}}
  • {{ media.isNew ? media.name.substr(36) : media.name }}
    {{ T.mediaNotFound }} {{ T.discardWarning }}
    {{ media.name }}
  • ',data:function(){return{T:{}}},props:{mediaItems:Array,selectedMedia:Object,thumbSize:Number,idPrefix:String},created:function(){var e=this;e.T.mediaNotFound=$("#t-media-not-found").val(),e.T.discardWarning=$("#t-discard-warning").val(),e.T.noImages=$("#t-no-images").val()},methods:{selectAndDeleteMedia:function(e){this.$parent.$emit("selectAndDeleteMediaRequested",e)},selectMedia:function(e){this.$parent.$emit("selectMediaRequested",e)},buildMediaUrl:function(e,t){return e+(-1==e.indexOf("?")?"?":"&")+"width="+t+"&height="+t},getfontAwesomeClassNameForFileName:function(e,t){return getClassNameForFilename(e)+" "+t}}});var mediaFieldApps=[];Vue.component("upload",{template:'

    {{ model.name }}

    Error: {{ model.errorMessage }}
    ',props:{model:Object,uploadInputId:String},mounted:function(){var e,t=this,i=document.getElementById(null!==(e=t.uploadInputId)&&void 0!==e?e:"fileupload");$(i).bind("fileuploadprogress",(function(e,i){i.files[0].name===t.model.name&&(t.model.percentage=parseInt(i.loaded/i.total*100,10))})),$(i).bind("fileuploaddone",(function(e,i){i.files[0].name===t.model.name&&(i.result.files[0].error?t.handleFailure(i.files[0].name,i.result.files[0].error):bus.$emit("removalRequest",t.model))})),$(i).bind("fileuploadfail",(function(e,i){i.files[0].name===t.model.name&&t.handleFailure(i.files[0].name,$("#t-error").val())}))},methods:{handleFailure:function(e,t){e===this.model.name&&(this.model.errorMessage=t,bus.$emit("ErrorOnUpload",this.model))},dismissWarning:function(){bus.$emit("removalRequest",this.model)}}}),Vue.component("uploadList",{template:'
    {{ T.uploads }} (Pending: {{ pendingCount }}) ( {{ T.errors }}: {{ errorCount }} / {{ T.clearErrors }} )
    ',data:function(){return{files:[],T:{},expanded:!1,pendingCount:0,errorCount:0}},props:{uploadInputId:String},created:function(){var e=this;e.T.uploads=$("#t-uploads").val(),e.T.errors=$("#t-errors").val(),e.T.clearErrors=$("#t-clear-errors").val()},computed:{fileCount:function(){return this.files.length}},mounted:function(){var e,t=this,i=document.getElementById(null!==(e=t.uploadInputId)&&void 0!==e?e:"fileupload");$(i).bind("fileuploadadd",(function(e,i){i.files&&i.files.forEach((function(e){t.files.some((function(t){return t.name==e.name}))?console.error("A file with the same name is already on the queue:"+e.name):t.files.push({name:e.name,percentage:0,errorMessage:""})}))})),bus.$on("removalRequest",(function(e){t.files.forEach((function(t,i,n){t.name==e.name&&n.splice(i,1)}))})),bus.$on("ErrorOnUpload",(function(e){t.updateCount()}))},methods:{updateCount:function(){this.errorCount=this.files.filter((function(e){return""!=e.errorMessage})).length,this.pendingCount=this.files.length-this.errorCount,this.files.length<1&&(this.expanded=!1)},clearErrors:function(){this.files=this.files.filter((function(e){return""==e.errorMessage}))}},watch:{files:function(){this.updateCount()}}}); diff --git a/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.js b/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.js index 5f9827b789e..41b5053dc54 100644 --- a/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.js +++ b/src/OrchardCore.Modules/OrchardCore.Menu/wwwroot/Scripts/menu.js @@ -429,7 +429,6 @@ this._sort_current = this.domPosition.prev ? $(this.domPosition.prev).next().index() : 0; $.ui.sortable.prototype._mouseStop.apply(this, arguments); //asybnchronous execution, @see _clear for the relocate event. }, - // mjs - this function is slightly modified // to make it easier to hover over a collapsed element and have it expand _intersectsWithSides: function _intersectsWithSides(item) { @@ -497,7 +496,6 @@ if (data.nestedSortableItem) { delete data.nestedSortableItem; // Remove the nestedSortableItem object from the data } - if (id) { currentItem = { "id": id[2] diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.bundle.js b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.bundle.js index 42738433bad..da3f4a04de9 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.bundle.js +++ b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.bundle.js @@ -5,21 +5,21 @@ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } +function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } } function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); } function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } } @@ -52,7 +52,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == /** * Constants */ - var _KEY_TO_DIRECTION; var elementMap = new Map(); var Data = { set: function set(element, key, instance) { @@ -244,7 +243,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == var reflow = function reflow(element) { element.offsetHeight; // eslint-disable-line no-unused-expressions }; - var getjQuery = function getjQuery() { if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) { return window.jQuery; @@ -680,7 +678,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == function Config() { _classCallCheck(this, Config); } - _createClass(Config, [{ + return _createClass(Config, [{ key: "_getConfig", value: function _getConfig(config) { config = this._mergeConfigObj(config); @@ -733,7 +731,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == throw new Error('You have to implement the static method "NAME", for each component!'); } }]); - return Config; }(); /** * -------------------------------------------------------------------------- @@ -750,24 +747,23 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var BaseComponent = /*#__PURE__*/function (_Config) { - _inherits(BaseComponent, _Config); - var _super = _createSuper(BaseComponent); function BaseComponent(element, config) { var _this; _classCallCheck(this, BaseComponent); - _this = _super.call(this); + _this = _callSuper(this, BaseComponent); element = getElement(element); if (!element) { return _possibleConstructorReturn(_this); } _this._element = element; _this._config = _this._getConfig(config); - Data.set(_this._element, _this.constructor.DATA_KEY, _assertThisInitialized(_this)); + Data.set(_this._element, _this.constructor.DATA_KEY, _this); return _this; } // Public - _createClass(BaseComponent, [{ + _inherits(BaseComponent, _Config); + return _createClass(BaseComponent, [{ key: "dispose", value: function dispose() { Data.remove(this._element, this.constructor.DATA_KEY); @@ -833,7 +829,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return "".concat(name).concat(this.EVENT_KEY); } }]); - return BaseComponent; }(Config); /** * -------------------------------------------------------------------------- @@ -984,13 +979,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Alert = /*#__PURE__*/function (_BaseComponent) { - _inherits(Alert, _BaseComponent); - var _super2 = _createSuper(Alert); function Alert() { _classCallCheck(this, Alert); - return _super2.apply(this, arguments); + return _callSuper(this, Alert, arguments); } - _createClass(Alert, [{ + _inherits(Alert, _BaseComponent); + return _createClass(Alert, [{ key: "close", value: // Public @@ -1039,7 +1033,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Alert; }(BaseComponent); /** * Data API implementation @@ -1075,13 +1068,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Button = /*#__PURE__*/function (_BaseComponent2) { - _inherits(Button, _BaseComponent2); - var _super3 = _createSuper(Button); function Button() { _classCallCheck(this, Button); - return _super3.apply(this, arguments); + return _callSuper(this, Button, arguments); } - _createClass(Button, [{ + _inherits(Button, _BaseComponent2); + return _createClass(Button, [{ key: "toggle", value: // Public @@ -1109,7 +1101,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Button; }(BaseComponent); /** * Data API implementation @@ -1164,12 +1155,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Swipe = /*#__PURE__*/function (_Config2) { - _inherits(Swipe, _Config2); - var _super4 = _createSuper(Swipe); function Swipe(element, config) { var _this3; _classCallCheck(this, Swipe); - _this3 = _super4.call(this); + _this3 = _callSuper(this, Swipe); _this3._element = element; if (!element || !Swipe.isSupported()) { return _possibleConstructorReturn(_this3); @@ -1182,7 +1171,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Swipe, [{ + _inherits(Swipe, _Config2); + return _createClass(Swipe, [{ key: "dispose", value: // Public @@ -1282,7 +1272,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; } }]); - return Swipe; }(Config); /** * -------------------------------------------------------------------------- @@ -1327,7 +1316,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == var SELECTOR_INDICATORS = '.carousel-indicators'; var SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; var SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; - var KEY_TO_DIRECTION = (_KEY_TO_DIRECTION = {}, _defineProperty(_KEY_TO_DIRECTION, ARROW_LEFT_KEY$1, DIRECTION_RIGHT), _defineProperty(_KEY_TO_DIRECTION, ARROW_RIGHT_KEY$1, DIRECTION_LEFT), _KEY_TO_DIRECTION); + var KEY_TO_DIRECTION = _defineProperty(_defineProperty({}, ARROW_LEFT_KEY$1, DIRECTION_RIGHT), ARROW_RIGHT_KEY$1, DIRECTION_LEFT); var Default$b = { interval: 5000, keyboard: true, @@ -1350,12 +1339,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Carousel = /*#__PURE__*/function (_BaseComponent3) { - _inherits(Carousel, _BaseComponent3); - var _super5 = _createSuper(Carousel); function Carousel(element, config) { var _this5; _classCallCheck(this, Carousel); - _this5 = _super5.call(this, element, config); + _this5 = _callSuper(this, Carousel, [element, config]); _this5._interval = null; _this5._activeElement = null; _this5._isSliding = false; @@ -1370,7 +1357,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Carousel, [{ + _inherits(Carousel, _BaseComponent3); + return _createClass(Carousel, [{ key: "next", value: // Public @@ -1704,7 +1692,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Carousel; }(BaseComponent); /** * Data API implementation @@ -1795,12 +1782,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Collapse = /*#__PURE__*/function (_BaseComponent4) { - _inherits(Collapse, _BaseComponent4); - var _super6 = _createSuper(Collapse); function Collapse(element, config) { var _this12; _classCallCheck(this, Collapse); - _this12 = _super6.call(this, element, config); + _this12 = _callSuper(this, Collapse, [element, config]); _this12._isTransitioning = false; _this12._triggerArray = []; var toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4); @@ -1833,7 +1818,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Collapse, [{ + _inherits(Collapse, _BaseComponent4); + return _createClass(Collapse, [{ key: "toggle", value: // Public @@ -2048,7 +2034,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Collapse; }(BaseComponent); /** * Data API implementation @@ -2336,7 +2321,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == getDocumentElement(element) // fallback ); } - function getTrueOffsetParent(element) { if (!isHTMLElement(element) || // https://github.com/popperjs/popper-core/issues/837 @@ -3768,12 +3752,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Dropdown = /*#__PURE__*/function (_BaseComponent5) { - _inherits(Dropdown, _BaseComponent5); - var _super7 = _createSuper(Dropdown); function Dropdown(element, config) { var _this15; _classCallCheck(this, Dropdown); - _this15 = _super7.call(this, element, config); + _this15 = _callSuper(this, Dropdown, [element, config]); _this15._popper = null; _this15._parent = _this15._element.parentNode; // dropdown wrapper // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ @@ -3783,7 +3765,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Dropdown, [{ + _inherits(Dropdown, _BaseComponent5); + return _createClass(Dropdown, [{ key: "toggle", value: // Public @@ -4120,7 +4103,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } } }]); - return Dropdown; }(BaseComponent); /** * Data API implementation @@ -4163,7 +4145,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == // if false, we use the backdrop helper without adding any element to the dom rootElement: 'body' // give the choice to place backdrop under different elements }; - var DefaultType$8 = { className: 'string', clickCallback: '(function|null)', @@ -4176,12 +4157,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Backdrop = /*#__PURE__*/function (_Config3) { - _inherits(Backdrop, _Config3); - var _super8 = _createSuper(Backdrop); function Backdrop(config) { var _this17; _classCallCheck(this, Backdrop); - _this17 = _super8.call(this); + _this17 = _callSuper(this, Backdrop); _this17._config = _this17._getConfig(config); _this17._isAppended = false; _this17._element = null; @@ -4189,7 +4168,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Backdrop, [{ + _inherits(Backdrop, _Config3); + return _createClass(Backdrop, [{ key: "show", value: // Public @@ -4289,7 +4269,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return NAME$9; } }]); - return Backdrop; }(Config); /** * -------------------------------------------------------------------------- @@ -4312,7 +4291,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == autofocus: true, trapElement: null // The element to trap focus inside of }; - var DefaultType$7 = { autofocus: 'boolean', trapElement: 'element' @@ -4322,12 +4300,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var FocusTrap = /*#__PURE__*/function (_Config4) { - _inherits(FocusTrap, _Config4); - var _super9 = _createSuper(FocusTrap); function FocusTrap(config) { var _this20; _classCallCheck(this, FocusTrap); - _this20 = _super9.call(this); + _this20 = _callSuper(this, FocusTrap); _this20._config = _this20._getConfig(config); _this20._isActive = false; _this20._lastTabNavDirection = null; @@ -4335,7 +4311,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(FocusTrap, [{ + _inherits(FocusTrap, _Config4); + return _createClass(FocusTrap, [{ key: "activate", value: // Public @@ -4407,7 +4384,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return NAME$8; } }]); - return FocusTrap; }(Config); /** * -------------------------------------------------------------------------- @@ -4433,7 +4409,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Public - _createClass(ScrollBarHelper, [{ + return _createClass(ScrollBarHelper, [{ key: "getWidth", value: function getWidth() { // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes @@ -4537,7 +4513,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } } }]); - return ScrollBarHelper; }(); /** * -------------------------------------------------------------------------- @@ -4586,12 +4561,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Modal = /*#__PURE__*/function (_BaseComponent6) { - _inherits(Modal, _BaseComponent6); - var _super10 = _createSuper(Modal); function Modal(element, config) { var _this23; _classCallCheck(this, Modal); - _this23 = _super10.call(this, element, config); + _this23 = _callSuper(this, Modal, [element, config]); _this23._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, _this23._element); _this23._backdrop = _this23._initializeBackDrop(); _this23._focustrap = _this23._initializeFocusTrap(); @@ -4603,7 +4576,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Modal, [{ + _inherits(Modal, _BaseComponent6); + return _createClass(Modal, [{ key: "toggle", value: // Public @@ -4852,7 +4826,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Modal; }(BaseComponent); /** * Data API implementation @@ -4937,12 +4910,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Offcanvas = /*#__PURE__*/function (_BaseComponent7) { - _inherits(Offcanvas, _BaseComponent7); - var _super11 = _createSuper(Offcanvas); function Offcanvas(element, config) { var _this31; _classCallCheck(this, Offcanvas); - _this31 = _super11.call(this, element, config); + _this31 = _callSuper(this, Offcanvas, [element, config]); _this31._isShown = false; _this31._backdrop = _this31._initializeBackDrop(); _this31._focustrap = _this31._initializeFocusTrap(); @@ -4951,7 +4922,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Offcanvas, [{ + _inherits(Offcanvas, _BaseComponent7); + return _createClass(Offcanvas, [{ key: "toggle", value: // Public @@ -5103,7 +5075,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Offcanvas; }(BaseComponent); /** * Data API implementation @@ -5330,18 +5301,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var TemplateFactory = /*#__PURE__*/function (_Config5) { - _inherits(TemplateFactory, _Config5); - var _super12 = _createSuper(TemplateFactory); function TemplateFactory(config) { var _this37; _classCallCheck(this, TemplateFactory); - _this37 = _super12.call(this); + _this37 = _callSuper(this, TemplateFactory); _this37._config = _this37._getConfig(config); return _this37; } // Getters - _createClass(TemplateFactory, [{ + _inherits(TemplateFactory, _Config5); + return _createClass(TemplateFactory, [{ key: "getContent", value: // Public @@ -5461,7 +5431,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return NAME$5; } }]); - return TemplateFactory; }(Config); /** * -------------------------------------------------------------------------- @@ -5544,15 +5513,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Tooltip = /*#__PURE__*/function (_BaseComponent8) { - _inherits(Tooltip, _BaseComponent8); - var _super13 = _createSuper(Tooltip); function Tooltip(element, config) { var _this39; _classCallCheck(this, Tooltip); if (typeof Popper === 'undefined') { throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); } - _this39 = _super13.call(this, element, config); + _this39 = _callSuper(this, Tooltip, [element, config]); // Private _this39._isEnabled = true; @@ -5573,7 +5540,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Tooltip, [{ + _inherits(Tooltip, _BaseComponent8); + return _createClass(Tooltip, [{ key: "enable", value: // Public @@ -6072,7 +6040,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Tooltip; }(BaseComponent); /** * jQuery @@ -6108,13 +6075,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Popover = /*#__PURE__*/function (_Tooltip) { - _inherits(Popover, _Tooltip); - var _super14 = _createSuper(Popover); function Popover() { _classCallCheck(this, Popover); - return _super14.apply(this, arguments); + return _callSuper(this, Popover, arguments); } - _createClass(Popover, [{ + _inherits(Popover, _Tooltip); + return _createClass(Popover, [{ key: "_isWithContent", value: // Overrides @@ -6126,8 +6092,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }, { key: "_getContentForTemplate", value: function _getContentForTemplate() { - var _ref17; - return _ref17 = {}, _defineProperty(_ref17, SELECTOR_TITLE, this._getTitle()), _defineProperty(_ref17, SELECTOR_CONTENT, this._getContent()), _ref17; + return _defineProperty(_defineProperty({}, SELECTOR_TITLE, this._getTitle()), SELECTOR_CONTENT, this._getContent()); } }, { key: "_getContent", @@ -6168,7 +6133,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Popover; }(Tooltip); /** * jQuery @@ -6225,12 +6189,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var ScrollSpy = /*#__PURE__*/function (_BaseComponent9) { - _inherits(ScrollSpy, _BaseComponent9); - var _super15 = _createSuper(ScrollSpy); function ScrollSpy(element, config) { var _this47; _classCallCheck(this, ScrollSpy); - _this47 = _super15.call(this, element, config); + _this47 = _callSuper(this, ScrollSpy, [element, config]); // this._element is the observablesContainer and config.target the menu links wrapper _this47._targetLinks = new Map(); @@ -6247,7 +6209,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(ScrollSpy, [{ + _inherits(ScrollSpy, _BaseComponent9); + return _createClass(ScrollSpy, [{ key: "refresh", value: // Public @@ -6512,7 +6475,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return ScrollSpy; }(BaseComponent); /** * Data API implementation @@ -6583,12 +6545,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Tab = /*#__PURE__*/function (_BaseComponent10) { - _inherits(Tab, _BaseComponent10); - var _super16 = _createSuper(Tab); function Tab(element) { var _this51; _classCallCheck(this, Tab); - _this51 = _super16.call(this, element); + _this51 = _callSuper(this, Tab, [element]); _this51._parent = _this51._element.closest(SELECTOR_TAB_PANEL); if (!_this51._parent) { return _possibleConstructorReturn(_this51); @@ -6605,7 +6565,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Tab, [{ + _inherits(Tab, _BaseComponent10); + return _createClass(Tab, [{ key: "show", value: // Public @@ -6832,7 +6793,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Tab; }(BaseComponent); /** * Data API implementation @@ -6911,12 +6871,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Toast = /*#__PURE__*/function (_BaseComponent11) { - _inherits(Toast, _BaseComponent11); - var _super17 = _createSuper(Toast); function Toast(element, config) { var _this55; _classCallCheck(this, Toast); - _this55 = _super17.call(this, element, config); + _this55 = _callSuper(this, Toast, [element, config]); _this55._timeout = null; _this55._hasMouseInteraction = false; _this55._hasKeyboardInteraction = false; @@ -6925,7 +6883,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Toast, [{ + _inherits(Toast, _BaseComponent11); + return _createClass(Toast, [{ key: "show", value: // Public @@ -7079,7 +7038,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Toast; }(BaseComponent); /** * Data API implementation diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.bundle.min.js b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.bundle.min.js index f88a1516027..1ba7dec6841 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.bundle.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.bundle.min.js @@ -1,6 +1,6 @@ -function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=_superPropBase(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},_get.apply(this,arguments)}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var n,i=_getPrototypeOf(e);if(t){var r=_getPrototypeOf(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _objectSpread(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0?document.querySelector(a(e)):null},u=function(e){if(!l(e)||0===e.getClientRects().length)return!1;var t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){var i=e.closest("summary");if(i&&i.parentNode!==n)return!1;if(null===i)return!1}return t},f=function(e){return!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")))},d=function e(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var n=t.getRootNode();return n instanceof ShadowRoot?n:null}return t instanceof ShadowRoot?t:t.parentNode?e(t.parentNode):null},h=function(){},p=function(e){e.offsetHeight},_=function(){return window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null},v=[],g=function(){return"rtl"===document.documentElement.dir},m=function(e){var t;t=function(){var t=_();if(t){var n=e.NAME,i=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=function(){return t.fn[n]=i,e.jQueryInterface}}},"loading"===document.readyState?(v.length||document.addEventListener("DOMContentLoaded",(function(){for(var e=0,t=v;e1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return"function"==typeof e?e.apply(void 0,_toConsumableArray(t)):n},b=function(e,t){if(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]){var n=function(e){if(!e)return 0;var t=window.getComputedStyle(e),n=t.transitionDuration,i=t.transitionDelay,r=Number.parseFloat(n),o=Number.parseFloat(i);return r||o?(n=n.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(n)+Number.parseFloat(i))):0}(t)+5,i=!1;t.addEventListener(o,(function n(r){r.target===t&&(i=!0,t.removeEventListener(o,n),y(e))})),setTimeout((function(){i||s(t)}),n)}else y(e)},k=function(e,t,n,i){var r=e.length,o=e.indexOf(t);return-1===o?!n&&i?e[r-1]:e[0]:(o+=n?1:-1,i&&(o=(o+r)%r),e[Math.max(0,Math.min(o,r-1))])},w=/[^.]*(?=\..*)\.|.*/,C=/\..*/,O=/::\d+$/,A={},E=1,T={mouseenter:"mouseover",mouseleave:"mouseout"},S=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function x(e,t){return t&&"".concat(t,"::").concat(E++)||e.uidEvent||E++}function I(e){var t=x(e);return e.uidEvent=t,A[t]=A[t]||{},A[t]}function P(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Object.values(e).find((function(e){return e.callable===t&&e.delegationSelector===n}))}function L(e,t,n){var i="string"==typeof t,r=i?n:t||n,o=M(e);return S.has(o)||(o=e),[i,r,o]}function j(e,t,n,i,r){if("string"==typeof t&&e){var o=_slicedToArray(L(t,n,i),3),a=o[0],s=o[1],l=o[2];if(t in T){s=function(e){return function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)}}(s)}var c=I(e),u=c[l]||(c[l]={}),f=P(u,s,a?n:null);if(f)f.oneOff=f.oneOff&&r;else{var d=x(s,t.replace(w,"")),h=a?function(e,t,n){return function i(r){for(var o=e.querySelectorAll(t),a=r.target;a&&a!==this;a=a.parentNode){var s,l=_createForOfIteratorHelper(o);try{for(l.s();!(s=l.n()).done;)if(s.value===a)return H(r,{delegateTarget:a}),i.oneOff&&F.off(e,r.type,t,n),n.apply(a,[r])}catch(e){l.e(e)}finally{l.f()}}}}(e,n,s):function(e,t){return function n(i){return H(i,{delegateTarget:e}),n.oneOff&&F.off(e,i.type,t),t.apply(e,[i])}}(e,s);h.delegationSelector=a?n:null,h.callable=s,h.oneOff=r,h.uidEvent=d,u[d]=h,e.addEventListener(l,h,a)}}}function D(e,t,n,i,r){var o=P(t[n],i,r);o&&(e.removeEventListener(n,o,Boolean(r)),delete t[n][o.uidEvent])}function N(e,t,n,i){for(var r=t[n]||{},o=0,a=Object.entries(r);o1&&void 0!==arguments[1]?arguments[1]:{},n=function(){var t=_slicedToArray(r[i],2),n=t[0],o=t[1];try{e[n]=o}catch(t){Object.defineProperty(e,n,{configurable:!0,get:function(){return o}})}},i=0,r=Object.entries(t);i1&&void 0!==arguments[1]?arguments[1]:this.constructor.DefaultType,i=0,r=Object.entries(n);i2&&void 0!==arguments[2])||arguments[2])}},{key:"_getConfig",value:function(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}}],[{key:"getInstance",value:function(e){return i(c(e),this.DATA_KEY)}},{key:"getOrCreateInstance",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getInstance(e)||new this(e,"object"===_typeof(t)?t:null)}},{key:"VERSION",get:function(){return"5.3.3"}},{key:"DATA_KEY",get:function(){return"bs.".concat(this.NAME)}},{key:"EVENT_KEY",get:function(){return".".concat(this.DATA_KEY)}},{key:"eventName",value:function(e){return"".concat(e).concat(this.EVENT_KEY)}}]),o}(K),U=function(e){var t=e.getAttribute("data-bs-target");if(!t||"#"===t){var n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n="#".concat(n.split("#")[1])),t=n&&"#"!==n?n.trim():null}return t?t.split(",").map((function(e){return a(e)})).join(","):null},X={find:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return(t=[]).concat.apply(t,_toConsumableArray(Element.prototype.querySelectorAll.call(n,e)))},findOne:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return Element.prototype.querySelector.call(t,e)},children:function(e,t){var n;return(n=[]).concat.apply(n,_toConsumableArray(e.children)).filter((function(e){return e.matches(t)}))},parents:function(e,t){for(var n=[],i=e.parentNode.closest(t);i;)n.push(i),i=i.parentNode.closest(t);return n},prev:function(e,t){for(var n=e.previousElementSibling;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next:function(e,t){for(var n=e.nextElementSibling;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren:function(e){var t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((function(e){return"".concat(e,':not([tabindex^="-"])')})).join(",");return this.find(t,e).filter((function(e){return!f(e)&&u(e)}))},getSelectorFromElement:function(e){var t=U(e);return t&&X.findOne(t)?t:null},getElementFromSelector:function(e){var t=U(e);return t?X.findOne(t):null},getMultipleElementsFromSelector:function(e){var t=U(e);return t?X.find(t):[]}},Y=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hide",n="click.dismiss".concat(e.EVENT_KEY),i=e.NAME;F.on(document,n,'[data-bs-dismiss="'.concat(i,'"]'),(function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),!f(this)){var r=X.getElementFromSelector(this)||this.closest(".".concat(i));e.getOrCreateInstance(r)[t]()}}))},$=".".concat("bs.alert"),G="close".concat($),J="closed".concat($),Z=function(e){_inherits(n,e);var t=_createSuper(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"close",value:function(){var e=this;if(!F.trigger(this._element,G).defaultPrevented){this._element.classList.remove("show");var t=this._element.classList.contains("fade");this._queueCallback((function(){return e._destroyElement()}),this._element,t)}}},{key:"_destroyElement",value:function(){this._element.remove(),F.trigger(this._element,J),this.dispose()}}],[{key:"NAME",get:function(){return"alert"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}}))}}]),n}(Q);Y(Z,"close"),m(Z);var ee=".".concat("bs.button"),te='[data-bs-toggle="button"]',ne="click".concat(ee).concat(".data-api"),ie=function(e){_inherits(n,e);var t=_createSuper(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"toggle",value:function(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}}],[{key:"NAME",get:function(){return"button"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this);"toggle"===e&&t[e]()}))}}]),n}(Q);F.on(document,ne,te,(function(e){e.preventDefault();var t=e.target.closest(te);ie.getOrCreateInstance(t).toggle()})),m(ie);var re=".bs.swipe",oe="touchstart".concat(re),ae="touchmove".concat(re),se="touchend".concat(re),le="pointerdown".concat(re),ce="pointerup".concat(re),ue={endCallback:null,leftCallback:null,rightCallback:null},fe={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"},de=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck(this,n),(r=t.call(this))._element=e,e&&n.isSupported()?(r._config=r._getConfig(i),r._deltaX=0,r._supportPointerEvents=Boolean(window.PointerEvent),r._initEvents(),r):_possibleConstructorReturn(r)}return _createClass(n,[{key:"dispose",value:function(){F.off(this._element,re)}},{key:"_start",value:function(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}},{key:"_end",value:function(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),y(this._config.endCallback)}},{key:"_move",value:function(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}},{key:"_handleSwipe",value:function(){var e=Math.abs(this._deltaX);if(!(e<=40)){var t=e/this._deltaX;this._deltaX=0,t&&y(t>0?this._config.rightCallback:this._config.leftCallback)}}},{key:"_initEvents",value:function(){var e=this;this._supportPointerEvents?(F.on(this._element,le,(function(t){return e._start(t)})),F.on(this._element,ce,(function(t){return e._end(t)})),this._element.classList.add("pointer-event")):(F.on(this._element,oe,(function(t){return e._start(t)})),F.on(this._element,ae,(function(t){return e._move(t)})),F.on(this._element,se,(function(t){return e._end(t)})))}},{key:"_eventIsPointerPenTouch",value:function(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}}],[{key:"Default",get:function(){return ue}},{key:"DefaultType",get:function(){return fe}},{key:"NAME",get:function(){return"swipe"}},{key:"isSupported",value:function(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}]),n}(K),he=".".concat("bs.carousel"),pe=".data-api",_e="next",ve="prev",ge="left",me="right",ye="slide".concat(he),be="slid".concat(he),ke="keydown".concat(he),we="mouseenter".concat(he),Ce="mouseleave".concat(he),Oe="dragstart".concat(he),Ae="load".concat(he).concat(pe),Ee="click".concat(he).concat(pe),Te="carousel",Se="active",xe=".active",Ie=".carousel-item",Pe=xe+Ie,Le=(_defineProperty(e={},"ArrowLeft",me),_defineProperty(e,"ArrowRight",ge),e),je={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},De={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"},Ne=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck(this,n),(r=t.call(this,e,i))._interval=null,r._activeElement=null,r._isSliding=!1,r.touchTimeout=null,r._swipeHelper=null,r._indicatorsElement=X.findOne(".carousel-indicators",r._element),r._addEventListeners(),r._config.ride===Te&&r.cycle(),r}return _createClass(n,[{key:"next",value:function(){this._slide(_e)}},{key:"nextWhenVisible",value:function(){!document.hidden&&u(this._element)&&this.next()}},{key:"prev",value:function(){this._slide(ve)}},{key:"pause",value:function(){this._isSliding&&s(this._element),this._clearInterval()}},{key:"cycle",value:function(){var e=this;this._clearInterval(),this._updateInterval(),this._interval=setInterval((function(){return e.nextWhenVisible()}),this._config.interval)}},{key:"_maybeEnableCycle",value:function(){var e=this;this._config.ride&&(this._isSliding?F.one(this._element,be,(function(){return e.cycle()})):this.cycle())}},{key:"to",value:function(e){var t=this,n=this._getItems();if(!(e>n.length-1||e<0))if(this._isSliding)F.one(this._element,be,(function(){return t.to(e)}));else{var i=this._getItemIndex(this._getActive());if(i!==e){var r=e>i?_e:ve;this._slide(r,n[e])}}}},{key:"dispose",value:function(){this._swipeHelper&&this._swipeHelper.dispose(),_get(_getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"_configAfterMerge",value:function(e){return e.defaultInterval=e.interval,e}},{key:"_addEventListeners",value:function(){var e=this;this._config.keyboard&&F.on(this._element,ke,(function(t){return e._keydown(t)})),"hover"===this._config.pause&&(F.on(this._element,we,(function(){return e.pause()})),F.on(this._element,Ce,(function(){return e._maybeEnableCycle()}))),this._config.touch&&de.isSupported()&&this._addTouchEventListeners()}},{key:"_addTouchEventListeners",value:function(){var e,t=this,n=_createForOfIteratorHelper(X.find(".carousel-item img",this._element));try{for(n.s();!(e=n.n()).done;){var i=e.value;F.on(i,Oe,(function(e){return e.preventDefault()}))}}catch(e){n.e(e)}finally{n.f()}var r={leftCallback:function(){return t._slide(t._directionToOrder(ge))},rightCallback:function(){return t._slide(t._directionToOrder(me))},endCallback:function(){"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(){return t._maybeEnableCycle()}),500+t._config.interval))}};this._swipeHelper=new de(this._element,r)}},{key:"_keydown",value:function(e){if(!/input|textarea/i.test(e.target.tagName)){var t=Le[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}}},{key:"_getItemIndex",value:function(e){return this._getItems().indexOf(e)}},{key:"_setActiveIndicatorElement",value:function(e){if(this._indicatorsElement){var t=X.findOne(xe,this._indicatorsElement);t.classList.remove(Se),t.removeAttribute("aria-current");var n=X.findOne('[data-bs-slide-to="'.concat(e,'"]'),this._indicatorsElement);n&&(n.classList.add(Se),n.setAttribute("aria-current","true"))}}},{key:"_updateInterval",value:function(){var e=this._activeElement||this._getActive();if(e){var t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}}},{key:"_slide",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!this._isSliding){var i=this._getActive(),r=e===_e,o=n||k(this._getItems(),i,r,this._config.wrap);if(o!==i){var a=this._getItemIndex(o),s=function(n){return F.trigger(t._element,n,{relatedTarget:o,direction:t._orderToDirection(e),from:t._getItemIndex(i),to:a})};if(!s(ye).defaultPrevented&&i&&o){var l=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(a),this._activeElement=o;var c=r?"carousel-item-start":"carousel-item-end",u=r?"carousel-item-next":"carousel-item-prev";o.classList.add(u),p(o),i.classList.add(c),o.classList.add(c);this._queueCallback((function(){o.classList.remove(c,u),o.classList.add(Se),i.classList.remove(Se,u,c),t._isSliding=!1,s(be)}),i,this._isAnimated()),l&&this.cycle()}}}}},{key:"_isAnimated",value:function(){return this._element.classList.contains("slide")}},{key:"_getActive",value:function(){return X.findOne(Pe,this._element)}},{key:"_getItems",value:function(){return X.find(Ie,this._element)}},{key:"_clearInterval",value:function(){this._interval&&(clearInterval(this._interval),this._interval=null)}},{key:"_directionToOrder",value:function(e){return g()?e===ge?ve:_e:e===ge?_e:ve}},{key:"_orderToDirection",value:function(e){return g()?e===ve?ge:me:e===ve?me:ge}}],[{key:"Default",get:function(){return je}},{key:"DefaultType",get:function(){return De}},{key:"NAME",get:function(){return"carousel"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}else t.to(e)}))}}]),n}(Q);F.on(document,Ee,"[data-bs-slide], [data-bs-slide-to]",(function(e){var t=X.getElementFromSelector(this);if(t&&t.classList.contains(Te)){e.preventDefault();var n=Ne.getOrCreateInstance(t),i=this.getAttribute("data-bs-slide-to");if(i)return n.to(i),void n._maybeEnableCycle();if("next"===V(this,"slide"))return n.next(),void n._maybeEnableCycle();n.prev(),n._maybeEnableCycle()}})),F.on(window,Ae,(function(){var e,t=_createForOfIteratorHelper(X.find('[data-bs-ride="carousel"]'));try{for(t.s();!(e=t.n()).done;){var n=e.value;Ne.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),m(Ne);var Me=".".concat("bs.collapse"),Fe="show".concat(Me),He="shown".concat(Me),Re="hide".concat(Me),We="hidden".concat(Me),Be="click".concat(Me).concat(".data-api"),ze="show",qe="collapse",Ve="collapsing",Ke=":scope .".concat(qe," .").concat(qe),Qe='[data-bs-toggle="collapse"]',Ue={parent:null,toggle:!0},Xe={parent:"(null|element)",toggle:"boolean"},Ye=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;_classCallCheck(this,n),(r=t.call(this,e,i))._isTransitioning=!1,r._triggerArray=[];var o,a=_createForOfIteratorHelper(X.find(Qe));try{for(a.s();!(o=a.n()).done;){var s=o.value,l=X.getSelectorFromElement(s),c=X.find(l).filter((function(e){return e===r._element}));null!==l&&c.length&&r._triggerArray.push(s)}}catch(e){a.e(e)}finally{a.f()}return r._initializeChildren(),r._config.parent||r._addAriaAndCollapsedClass(r._triggerArray,r._isShown()),r._config.toggle&&r.toggle(),r}return _createClass(n,[{key:"toggle",value:function(){this._isShown()?this.hide():this.show()}},{key:"show",value:function(){var e=this;if(!this._isTransitioning&&!this._isShown()){var t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((function(t){return t!==e._element})).map((function(e){return n.getOrCreateInstance(e,{toggle:!1})}))),!t.length||!t[0]._isTransitioning)if(!F.trigger(this._element,Fe).defaultPrevented){var i,r=_createForOfIteratorHelper(t);try{for(r.s();!(i=r.n()).done;){i.value.hide()}}catch(e){r.e(e)}finally{r.f()}var o=this._getDimension();this._element.classList.remove(qe),this._element.classList.add(Ve),this._element.style[o]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;var a=o[0].toUpperCase()+o.slice(1),s="scroll".concat(a);this._queueCallback((function(){e._isTransitioning=!1,e._element.classList.remove(Ve),e._element.classList.add(qe,ze),e._element.style[o]="",F.trigger(e._element,He)}),this._element,!0),this._element.style[o]="".concat(this._element[s],"px")}}}},{key:"hide",value:function(){var e=this;if(!this._isTransitioning&&this._isShown()&&!F.trigger(this._element,Re).defaultPrevented){var t=this._getDimension();this._element.style[t]="".concat(this._element.getBoundingClientRect()[t],"px"),p(this._element),this._element.classList.add(Ve),this._element.classList.remove(qe,ze);var n,i=_createForOfIteratorHelper(this._triggerArray);try{for(i.s();!(n=i.n()).done;){var r=n.value,o=X.getElementFromSelector(r);o&&!this._isShown(o)&&this._addAriaAndCollapsedClass([r],!1)}}catch(e){i.e(e)}finally{i.f()}this._isTransitioning=!0;this._element.style[t]="",this._queueCallback((function(){e._isTransitioning=!1,e._element.classList.remove(Ve),e._element.classList.add(qe),F.trigger(e._element,We)}),this._element,!0)}}},{key:"_isShown",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._element).classList.contains(ze)}},{key:"_configAfterMerge",value:function(e){return e.toggle=Boolean(e.toggle),e.parent=c(e.parent),e}},{key:"_getDimension",value:function(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}},{key:"_initializeChildren",value:function(){if(this._config.parent){var e,t=_createForOfIteratorHelper(this._getFirstLevelChildren(Qe));try{for(t.s();!(e=t.n()).done;){var n=e.value,i=X.getElementFromSelector(n);i&&this._addAriaAndCollapsedClass([n],this._isShown(i))}}catch(e){t.e(e)}finally{t.f()}}}},{key:"_getFirstLevelChildren",value:function(e){var t=X.find(Ke,this._config.parent);return X.find(e,this._config.parent).filter((function(e){return!t.includes(e)}))}},{key:"_addAriaAndCollapsedClass",value:function(e,t){if(e.length){var n,i=_createForOfIteratorHelper(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;r.classList.toggle("collapsed",!t),r.setAttribute("aria-expanded",t)}}catch(e){i.e(e)}finally{i.f()}}}}],[{key:"Default",get:function(){return Ue}},{key:"DefaultType",get:function(){return Xe}},{key:"NAME",get:function(){return"collapse"}},{key:"jQueryInterface",value:function(e){var t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each((function(){var i=n.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===i[e])throw new TypeError('No method named "'.concat(e,'"'));i[e]()}}))}}]),n}(Q);F.on(document,Be,Qe,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();var t,n=_createForOfIteratorHelper(X.getMultipleElementsFromSelector(this));try{for(n.s();!(t=n.n()).done;){var i=t.value;Ye.getOrCreateInstance(i,{toggle:!1}).toggle()}}catch(e){n.e(e)}finally{n.f()}})),m(Ye);var $e="top",Ge="bottom",Je="right",Ze="left",et="auto",tt=[$e,Ge,Je,Ze],nt="start",it="end",rt="clippingParents",ot="viewport",at="popper",st="reference",lt=tt.reduce((function(e,t){return e.concat([t+"-"+nt,t+"-"+it])}),[]),ct=[].concat(tt,[et]).reduce((function(e,t){return e.concat([t,t+"-"+nt,t+"-"+it])}),[]),ut="beforeRead",ft="read",dt="afterRead",ht="beforeMain",pt="main",_t="afterMain",vt="beforeWrite",gt="write",mt="afterWrite",yt=[ut,ft,dt,ht,pt,_t,vt,gt,mt];function bt(e){return e?(e.nodeName||"").toLowerCase():null}function kt(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function wt(e){return e instanceof kt(e).Element||e instanceof Element}function Ct(e){return e instanceof kt(e).HTMLElement||e instanceof HTMLElement}function Ot(e){return"undefined"!=typeof ShadowRoot&&(e instanceof kt(e).ShadowRoot||e instanceof ShadowRoot)}var At={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},r=t.elements[e];Ct(r)&&bt(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(e){var t=i[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],r=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});Ct(i)&&bt(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]};function Et(e){return e.split("-")[0]}var Tt=Math.max,St=Math.min,xt=Math.round;function It(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function Pt(){return!/^((?!chrome|android).)*safari/i.test(It())}function Lt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var i=e.getBoundingClientRect(),r=1,o=1;t&&Ct(e)&&(r=e.offsetWidth>0&&xt(i.width)/e.offsetWidth||1,o=e.offsetHeight>0&&xt(i.height)/e.offsetHeight||1);var a=(wt(e)?kt(e):window).visualViewport,s=!Pt()&&n,l=(i.left+(s&&a?a.offsetLeft:0))/r,c=(i.top+(s&&a?a.offsetTop:0))/o,u=i.width/r,f=i.height/o;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l,x:l,y:c}}function jt(e){var t=Lt(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function Dt(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ot(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Nt(e){return kt(e).getComputedStyle(e)}function Mt(e){return["table","td","th"].indexOf(bt(e))>=0}function Ft(e){return((wt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ht(e){return"html"===bt(e)?e:e.assignedSlot||e.parentNode||(Ot(e)?e.host:null)||Ft(e)}function Rt(e){return Ct(e)&&"fixed"!==Nt(e).position?e.offsetParent:null}function Wt(e){for(var t=kt(e),n=Rt(e);n&&Mt(n)&&"static"===Nt(n).position;)n=Rt(n);return n&&("html"===bt(n)||"body"===bt(n)&&"static"===Nt(n).position)?t:n||function(e){var t=/firefox/i.test(It());if(/Trident/i.test(It())&&Ct(e)&&"fixed"===Nt(e).position)return null;var n=Ht(e);for(Ot(n)&&(n=n.host);Ct(n)&&["html","body"].indexOf(bt(n))<0;){var i=Nt(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}function Bt(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function zt(e,t,n){return Tt(e,St(t,n))}function qt(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function Vt(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var Kt={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,r=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=Et(n.placement),l=Bt(s),c=[Ze,Je].indexOf(s)>=0?"height":"width";if(o&&a){var u=function(e,t){return qt("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:Vt(e,tt))}(r.padding,n),f=jt(o),d="y"===l?$e:Ze,h="y"===l?Ge:Je,p=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],_=a[l]-n.rects.reference[l],v=Wt(o),g=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,m=p/2-_/2,y=u[d],b=g-f[c]-u[h],k=g/2-f[c]/2+m,w=zt(y,k,b),C=l;n.modifiersData[i]=((t={})[C]=w,t.centerOffset=w-k,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&Dt(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Qt(e){return e.split("-")[1]}var Ut={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Xt(e){var t,n=e.popper,i=e.popperRect,r=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,f=e.isFixed,d=a.x,h=void 0===d?0:d,p=a.y,_=void 0===p?0:p,v="function"==typeof u?u({x:h,y:_}):{x:h,y:_};h=v.x,_=v.y;var g=a.hasOwnProperty("x"),m=a.hasOwnProperty("y"),y=Ze,b=$e,k=window;if(c){var w=Wt(n),C="clientHeight",O="clientWidth";if(w===kt(n)&&"static"!==Nt(w=Ft(n)).position&&"absolute"===s&&(C="scrollHeight",O="scrollWidth"),r===$e||(r===Ze||r===Je)&&o===it)b=Ge,_-=(f&&w===k&&k.visualViewport?k.visualViewport.height:w[C])-i.height,_*=l?1:-1;if(r===Ze||(r===$e||r===Ge)&&o===it)y=Je,h-=(f&&w===k&&k.visualViewport?k.visualViewport.width:w[O])-i.width,h*=l?1:-1}var A,E=Object.assign({position:s},c&&Ut),T=!0===u?function(e,t){var n=e.x,i=e.y,r=t.devicePixelRatio||1;return{x:xt(n*r)/r||0,y:xt(i*r)/r||0}}({x:h,y:_},kt(n)):{x:h,y:_};return h=T.x,_=T.y,l?Object.assign({},E,((A={})[b]=m?"0":"",A[y]=g?"0":"",A.transform=(k.devicePixelRatio||1)<=1?"translate("+h+"px, "+_+"px)":"translate3d("+h+"px, "+_+"px, 0)",A)):Object.assign({},E,((t={})[b]=m?_+"px":"",t[y]=g?h+"px":"",t.transform="",t))}var Yt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:Et(t.placement),variation:Qt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Xt(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Xt(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},$t={passive:!0};var Gt={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,o=void 0===r||r,a=i.resize,s=void 0===a||a,l=kt(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",n.update,$t)})),s&&l.addEventListener("resize",n.update,$t),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",n.update,$t)})),s&&l.removeEventListener("resize",n.update,$t)}},data:{}},Jt={left:"right",right:"left",bottom:"top",top:"bottom"};function Zt(e){return e.replace(/left|right|bottom|top/g,(function(e){return Jt[e]}))}var en={start:"end",end:"start"};function tn(e){return e.replace(/start|end/g,(function(e){return en[e]}))}function nn(e){var t=kt(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function rn(e){return Lt(Ft(e)).left+nn(e).scrollLeft}function on(e){var t=Nt(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function an(e){return["html","body","#document"].indexOf(bt(e))>=0?e.ownerDocument.body:Ct(e)&&on(e)?e:an(Ht(e))}function sn(e,t){var n;void 0===t&&(t=[]);var i=an(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),o=kt(i),a=r?[o].concat(o.visualViewport||[],on(i)?i:[]):i,s=t.concat(a);return r?s:s.concat(sn(Ht(a)))}function ln(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function cn(e,t,n){return t===ot?ln(function(e,t){var n=kt(e),i=Ft(e),r=n.visualViewport,o=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){o=r.width,a=r.height;var c=Pt();(c||!c&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:o,height:a,x:s+rn(e),y:l}}(e,n)):wt(t)?function(e,t){var n=Lt(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):ln(function(e){var t,n=Ft(e),i=nn(e),r=null==(t=e.ownerDocument)?void 0:t.body,o=Tt(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Tt(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+rn(e),l=-i.scrollTop;return"rtl"===Nt(r||n).direction&&(s+=Tt(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(Ft(e)))}function un(e,t,n,i){var r="clippingParents"===t?function(e){var t=sn(Ht(e)),n=["absolute","fixed"].indexOf(Nt(e).position)>=0&&Ct(e)?Wt(e):e;return wt(n)?t.filter((function(e){return wt(e)&&Dt(e,n)&&"body"!==bt(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),a=o[0],s=o.reduce((function(t,n){var r=cn(e,n,i);return t.top=Tt(r.top,t.top),t.right=St(r.right,t.right),t.bottom=St(r.bottom,t.bottom),t.left=Tt(r.left,t.left),t}),cn(e,a,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function fn(e){var t,n=e.reference,i=e.element,r=e.placement,o=r?Et(r):null,a=r?Qt(r):null,s=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(o){case $e:t={x:s,y:n.y-i.height};break;case Ge:t={x:s,y:n.y+n.height};break;case Je:t={x:n.x+n.width,y:l};break;case Ze:t={x:n.x-i.width,y:l};break;default:t={x:n.x,y:n.y}}var c=o?Bt(o):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case nt:t[c]=t[c]-(n[u]/2-i[u]/2);break;case it:t[c]=t[c]+(n[u]/2-i[u]/2)}}return t}function dn(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=void 0===i?e.placement:i,o=n.strategy,a=void 0===o?e.strategy:o,s=n.boundary,l=void 0===s?rt:s,c=n.rootBoundary,u=void 0===c?ot:c,f=n.elementContext,d=void 0===f?at:f,h=n.altBoundary,p=void 0!==h&&h,_=n.padding,v=void 0===_?0:_,g=qt("number"!=typeof v?v:Vt(v,tt)),m=d===at?st:at,y=e.rects.popper,b=e.elements[p?m:d],k=un(wt(b)?b:b.contextElement||Ft(e.elements.popper),l,u,a),w=Lt(e.elements.reference),C=fn({reference:w,element:y,strategy:"absolute",placement:r}),O=ln(Object.assign({},y,C)),A=d===at?O:w,E={top:k.top-A.top+g.top,bottom:A.bottom-k.bottom+g.bottom,left:k.left-A.left+g.left,right:A.right-k.right+g.right},T=e.modifiersData.offset;if(d===at&&T){var S=T[r];Object.keys(E).forEach((function(e){var t=[Je,Ge].indexOf(e)>=0?1:-1,n=[$e,Ge].indexOf(e)>=0?"y":"x";E[e]+=S[n]*t}))}return E}function hn(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?ct:l,u=Qt(i),f=u?s?lt:lt.filter((function(e){return Qt(e)===u})):tt,d=f.filter((function(e){return c.indexOf(e)>=0}));0===d.length&&(d=f);var h=d.reduce((function(t,n){return t[n]=dn(e,{placement:n,boundary:r,rootBoundary:o,padding:a})[Et(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var pn={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=void 0===h||h,_=n.allowedAutoPlacements,v=t.options.placement,g=Et(v),m=l||(g===v||!p?[Zt(v)]:function(e){if(Et(e)===et)return[];var t=Zt(e);return[tn(e),t,tn(t)]}(v)),y=[v].concat(m).reduce((function(e,n){return e.concat(Et(n)===et?hn(t,{placement:n,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:_}):n)}),[]),b=t.rects.reference,k=t.rects.popper,w=new Map,C=!0,O=y[0],A=0;A=0,I=x?"width":"height",P=dn(t,{placement:E,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),L=x?S?Je:Ze:S?Ge:$e;b[I]>k[I]&&(L=Zt(L));var j=Zt(L),D=[];if(o&&D.push(P[T]<=0),s&&D.push(P[L]<=0,P[j]<=0),D.every((function(e){return e}))){O=E,C=!1;break}w.set(E,D)}if(C)for(var N=function(e){var t=y.find((function(t){var n=w.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return O=t,"break"},M=p?3:1;M>0;M--){if("break"===N(M))break}t.placement!==O&&(t.modifiersData[i]._skip=!0,t.placement=O,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function _n(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function vn(e){return[$e,Je,Ge,Ze].some((function(t){return e[t]>=0}))}var gn={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,a=dn(t,{elementContext:"reference"}),s=dn(t,{altBoundary:!0}),l=_n(a,i),c=_n(s,r,o),u=vn(l),f=vn(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}};var mn={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.offset,o=void 0===r?[0,0]:r,a=ct.reduce((function(e,n){return e[n]=function(e,t,n){var i=Et(e),r=[Ze,$e].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[Ze,Je].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=a}};var yn={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=fn({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var bn={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=void 0===d||d,p=n.tetherOffset,_=void 0===p?0:p,v=dn(t,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),g=Et(t.placement),m=Qt(t.placement),y=!m,b=Bt(g),k="x"===b?"y":"x",w=t.modifiersData.popperOffsets,C=t.rects.reference,O=t.rects.popper,A="function"==typeof _?_(Object.assign({},t.rects,{placement:t.placement})):_,E="number"==typeof A?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(w){if(o){var x,I="y"===b?$e:Ze,P="y"===b?Ge:Je,L="y"===b?"height":"width",j=w[b],D=j+v[I],N=j-v[P],M=h?-O[L]/2:0,F=m===nt?C[L]:O[L],H=m===nt?-O[L]:-C[L],R=t.elements.arrow,W=h&&R?jt(R):{width:0,height:0},B=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=B[I],q=B[P],V=zt(0,C[L],W[L]),K=y?C[L]/2-M-V-z-E.mainAxis:F-V-z-E.mainAxis,Q=y?-C[L]/2+M+V+q+E.mainAxis:H+V+q+E.mainAxis,U=t.elements.arrow&&Wt(t.elements.arrow),X=U?"y"===b?U.clientTop||0:U.clientLeft||0:0,Y=null!=(x=null==T?void 0:T[b])?x:0,$=j+Q-Y,G=zt(h?St(D,j+K-Y-X):D,j,h?Tt(N,$):N);w[b]=G,S[b]=G-j}if(s){var J,Z="x"===b?$e:Ze,ee="x"===b?Ge:Je,te=w[k],ne="y"===k?"height":"width",ie=te+v[Z],re=te-v[ee],oe=-1!==[$e,Ze].indexOf(g),ae=null!=(J=null==T?void 0:T[k])?J:0,se=oe?ie:te-C[ne]-O[ne]-ae+E.altAxis,le=oe?te+C[ne]+O[ne]-ae-E.altAxis:re,ce=h&&oe?function(e,t,n){var i=zt(e,t,n);return i>n?n:i}(se,te,le):zt(h?se:ie,te,h?le:re);w[k]=ce,S[k]=ce-te}t.modifiersData[i]=S}},requiresIfExists:["offset"]};function kn(e,t,n){void 0===n&&(n=!1);var i,r,o=Ct(t),a=Ct(t)&&function(e){var t=e.getBoundingClientRect(),n=xt(t.width)/e.offsetWidth||1,i=xt(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),s=Ft(t),l=Lt(e,a,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==bt(t)||on(s))&&(c=(i=t)!==kt(i)&&Ct(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:nn(i)),Ct(t)?((u=Lt(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=rn(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function wn(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}var Cn={placement:"bottom",modifiers:[],strategy:"absolute"};function On(){for(var e=arguments.length,t=new Array(e),n=0;n0}},{key:"_disableOverFlow",value:function(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}},{key:"_setElementAttributes",value:function(e,t,n){var i=this,r=this.getWidth();this._applyManipulationCallback(e,(function(e){if(!(e!==i._element&&window.innerWidth>e.clientWidth+r)){i._saveInitialAttribute(e,t);var o=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,"".concat(n(Number.parseFloat(o)),"px"))}}))}},{key:"_saveInitialAttribute",value:function(e,t){var n=e.style.getPropertyValue(t);n&&B(e,t,n)}},{key:"_resetElementAttributes",value:function(e,t){this._applyManipulationCallback(e,(function(e){var n=V(e,t);null!==n?(z(e,t),e.style.setProperty(t,n)):e.style.removeProperty(t)}))}},{key:"_applyManipulationCallback",value:function(e,t){if(l(e))t(e);else{var n,i=_createForOfIteratorHelper(X.find(e,this._element));try{for(i.s();!(n=i.n()).done;){t(n.value)}}catch(e){i.e(e)}finally{i.f()}}}}]),e}(),yi=".".concat("bs.modal"),bi="hide".concat(yi),ki="hidePrevented".concat(yi),wi="hidden".concat(yi),Ci="show".concat(yi),Oi="shown".concat(yi),Ai="resize".concat(yi),Ei="click.dismiss".concat(yi),Ti="mousedown.dismiss".concat(yi),Si="keydown.dismiss".concat(yi),xi="click".concat(yi).concat(".data-api"),Ii="modal-open",Pi="show",Li="modal-static",ji={backdrop:!0,focus:!0,keyboard:!0},Di={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"},Ni=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck(this,n),(r=t.call(this,e,i))._dialog=X.findOne(".modal-dialog",r._element),r._backdrop=r._initializeBackDrop(),r._focustrap=r._initializeFocusTrap(),r._isShown=!1,r._isTransitioning=!1,r._scrollBar=new mi,r._addEventListeners(),r}return _createClass(n,[{key:"toggle",value:function(e){return this._isShown?this.hide():this.show(e)}},{key:"show",value:function(e){var t=this;this._isShown||this._isTransitioning||(F.trigger(this._element,Ci,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Ii),this._adjustDialog(),this._backdrop.show((function(){return t._showElement(e)}))))}},{key:"hide",value:function(){var e=this;this._isShown&&!this._isTransitioning&&(F.trigger(this._element,bi).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Pi),this._queueCallback((function(){return e._hideModal()}),this._element,this._isAnimated())))}},{key:"dispose",value:function(){F.off(window,yi),F.off(this._dialog,yi),this._backdrop.dispose(),this._focustrap.deactivate(),_get(_getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"handleUpdate",value:function(){this._adjustDialog()}},{key:"_initializeBackDrop",value:function(){return new ai({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}},{key:"_initializeFocusTrap",value:function(){return new hi({trapElement:this._element})}},{key:"_showElement",value:function(e){var t=this;document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;var n=X.findOne(".modal-body",this._dialog);n&&(n.scrollTop=0),p(this._element),this._element.classList.add(Pi);this._queueCallback((function(){t._config.focus&&t._focustrap.activate(),t._isTransitioning=!1,F.trigger(t._element,Oi,{relatedTarget:e})}),this._dialog,this._isAnimated())}},{key:"_addEventListeners",value:function(){var e=this;F.on(this._element,Si,(function(t){"Escape"===t.key&&(e._config.keyboard?e.hide():e._triggerBackdropTransition())})),F.on(window,Ai,(function(){e._isShown&&!e._isTransitioning&&e._adjustDialog()})),F.on(this._element,Ti,(function(t){F.one(e._element,Ei,(function(n){e._element===t.target&&e._element===n.target&&("static"!==e._config.backdrop?e._config.backdrop&&e.hide():e._triggerBackdropTransition())}))}))}},{key:"_hideModal",value:function(){var e=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((function(){document.body.classList.remove(Ii),e._resetAdjustments(),e._scrollBar.reset(),F.trigger(e._element,wi)}))}},{key:"_isAnimated",value:function(){return this._element.classList.contains("fade")}},{key:"_triggerBackdropTransition",value:function(){var e=this;if(!F.trigger(this._element,ki).defaultPrevented){var t=this._element.scrollHeight>document.documentElement.clientHeight,n=this._element.style.overflowY;"hidden"===n||this._element.classList.contains(Li)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(Li),this._queueCallback((function(){e._element.classList.remove(Li),e._queueCallback((function(){e._element.style.overflowY=n}),e._dialog)}),this._dialog),this._element.focus())}}},{key:"_adjustDialog",value:function(){var e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){var i=g()?"paddingLeft":"paddingRight";this._element.style[i]="".concat(t,"px")}if(!n&&e){var r=g()?"paddingRight":"paddingLeft";this._element.style[r]="".concat(t,"px")}}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}}],[{key:"Default",get:function(){return ji}},{key:"DefaultType",get:function(){return Di}},{key:"NAME",get:function(){return"modal"}},{key:"jQueryInterface",value:function(e,t){return this.each((function(){var i=n.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===i[e])throw new TypeError('No method named "'.concat(e,'"'));i[e](t)}}))}}]),n}(Q);F.on(document,xi,'[data-bs-toggle="modal"]',(function(e){var t=this,n=X.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),F.one(n,Ci,(function(e){e.defaultPrevented||F.one(n,wi,(function(){u(t)&&t.focus()}))}));var i=X.findOne(".modal.show");i&&Ni.getInstance(i).hide(),Ni.getOrCreateInstance(n).toggle(this)})),Y(Ni),m(Ni);var Mi=".".concat("bs.offcanvas"),Fi=".data-api",Hi="load".concat(Mi).concat(Fi),Ri="show",Wi="showing",Bi="hiding",zi=".offcanvas.show",qi="show".concat(Mi),Vi="shown".concat(Mi),Ki="hide".concat(Mi),Qi="hidePrevented".concat(Mi),Ui="hidden".concat(Mi),Xi="resize".concat(Mi),Yi="click".concat(Mi).concat(Fi),$i="keydown.dismiss".concat(Mi),Gi={backdrop:!0,keyboard:!0,scroll:!1},Ji={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"},Zi=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck(this,n),(r=t.call(this,e,i))._isShown=!1,r._backdrop=r._initializeBackDrop(),r._focustrap=r._initializeFocusTrap(),r._addEventListeners(),r}return _createClass(n,[{key:"toggle",value:function(e){return this._isShown?this.hide():this.show(e)}},{key:"show",value:function(e){var t=this;if(!this._isShown&&!F.trigger(this._element,qi,{relatedTarget:e}).defaultPrevented){this._isShown=!0,this._backdrop.show(),this._config.scroll||(new mi).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Wi);this._queueCallback((function(){t._config.scroll&&!t._config.backdrop||t._focustrap.activate(),t._element.classList.add(Ri),t._element.classList.remove(Wi),F.trigger(t._element,Vi,{relatedTarget:e})}),this._element,!0)}}},{key:"hide",value:function(){var e=this;if(this._isShown&&!F.trigger(this._element,Ki).defaultPrevented){this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Bi),this._backdrop.hide();this._queueCallback((function(){e._element.classList.remove(Ri,Bi),e._element.removeAttribute("aria-modal"),e._element.removeAttribute("role"),e._config.scroll||(new mi).reset(),F.trigger(e._element,Ui)}),this._element,!0)}}},{key:"dispose",value:function(){this._backdrop.dispose(),this._focustrap.deactivate(),_get(_getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"_initializeBackDrop",value:function(){var e=this,t=Boolean(this._config.backdrop);return new ai({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?function(){"static"!==e._config.backdrop?e.hide():F.trigger(e._element,Qi)}:null})}},{key:"_initializeFocusTrap",value:function(){return new hi({trapElement:this._element})}},{key:"_addEventListeners",value:function(){var e=this;F.on(this._element,$i,(function(t){"Escape"===t.key&&(e._config.keyboard?e.hide():F.trigger(e._element,Qi))}))}}],[{key:"Default",get:function(){return Gi}},{key:"DefaultType",get:function(){return Ji}},{key:"NAME",get:function(){return"offcanvas"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}}))}}]),n}(Q);F.on(document,Yi,'[data-bs-toggle="offcanvas"]',(function(e){var t=this,n=X.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),!f(this)){F.one(n,Ui,(function(){u(t)&&t.focus()}));var i=X.findOne(zi);i&&i!==n&&Zi.getInstance(i).hide(),Zi.getOrCreateInstance(n).toggle(this)}})),F.on(window,Hi,(function(){var e,t=_createForOfIteratorHelper(X.find(zi));try{for(t.s();!(e=t.n()).done;){var n=e.value;Zi.getOrCreateInstance(n).show()}}catch(e){t.e(e)}finally{t.f()}})),F.on(window,Xi,(function(){var e,t=_createForOfIteratorHelper(X.find("[aria-modal][class*=show][class*=offcanvas-]"));try{for(t.s();!(e=t.n()).done;){var n=e.value;"fixed"!==getComputedStyle(n).position&&Zi.getOrCreateInstance(n).hide()}}catch(e){t.e(e)}finally{t.f()}})),Y(Zi),m(Zi);var er={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},tr=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),nr=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,ir=function(e,t){var n=e.nodeName.toLowerCase();return t.includes(n)?!tr.has(n)||Boolean(nr.test(e.nodeValue)):t.filter((function(e){return e instanceof RegExp})).some((function(e){return e.test(n)}))};var rr={allowList:er,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
    "},or={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},ar={entry:"(string|element|function|null)",selector:"(string|element)"},sr=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var i;return _classCallCheck(this,n),(i=t.call(this))._config=i._getConfig(e),i}return _createClass(n,[{key:"getContent",value:function(){var e=this;return Object.values(this._config.content).map((function(t){return e._resolvePossibleFunction(t)})).filter(Boolean)}},{key:"hasContent",value:function(){return this.getContent().length>0}},{key:"changeContent",value:function(e){return this._checkContent(e),this._config.content=_objectSpread(_objectSpread({},this._config.content),e),this}},{key:"toHtml",value:function(){var e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(var t=0,n=Object.entries(this._config.content);t
    ',title:"",trigger:"hover focus"},gr={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"},mr=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;if(_classCallCheck(this,n),void 0===xn)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");return(r=t.call(this,e,i))._isEnabled=!0,r._timeout=0,r._isHovered=null,r._activeTrigger={},r._popper=null,r._templateFactory=null,r._newContent=null,r.tip=null,r._setListeners(),r._config.selector||r._fixTitle(),r}return _createClass(n,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}},{key:"dispose",value:function(){clearTimeout(this._timeout),F.off(this._element.closest(fr),dr,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),_get(_getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"show",value:function(){var e=this;if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(this._isWithContent()&&this._isEnabled){var t=F.trigger(this._element,this.constructor.eventName("show")),n=(d(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(!t.defaultPrevented&&n){this._disposePopper();var i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));var r=this._config.container;if(this._element.ownerDocument.documentElement.contains(this.tip)||(r.append(i),F.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(ur),"ontouchstart"in document.documentElement){var o,a,s=_createForOfIteratorHelper((o=[]).concat.apply(o,_toConsumableArray(document.body.children)));try{for(s.s();!(a=s.n()).done;){var l=a.value;F.on(l,"mouseover",h)}}catch(e){s.e(e)}finally{s.f()}}this._queueCallback((function(){F.trigger(e._element,e.constructor.eventName("shown")),!1===e._isHovered&&e._leave(),e._isHovered=!1}),this.tip,this._isAnimated())}}}},{key:"hide",value:function(){var e=this;if(this._isShown()&&!F.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(ur),"ontouchstart"in document.documentElement){var t,n,i=_createForOfIteratorHelper((t=[]).concat.apply(t,_toConsumableArray(document.body.children)));try{for(i.s();!(n=i.n()).done;){var r=n.value;F.off(r,"mouseover",h)}}catch(e){i.e(e)}finally{i.f()}}this._activeTrigger.click=!1,this._activeTrigger[pr]=!1,this._activeTrigger[hr]=!1,this._isHovered=null;this._queueCallback((function(){e._isWithActiveTrigger()||(e._isHovered||e._disposePopper(),e._element.removeAttribute("aria-describedby"),F.trigger(e._element,e.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}}},{key:"update",value:function(){this._popper&&this._popper.update()}},{key:"_isWithContent",value:function(){return Boolean(this._getTitle())}},{key:"_getTipElement",value:function(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}},{key:"_createTipElement",value:function(e){var t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(cr,ur),t.classList.add("bs-".concat(this.constructor.NAME,"-auto"));var n=function(e){do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e}(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(cr),t}},{key:"setContent",value:function(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}},{key:"_getTemplateFactory",value:function(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new sr(_objectSpread(_objectSpread({},this._config),{},{content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)})),this._templateFactory}},{key:"_getContentForTemplate",value:function(){return _defineProperty({},".tooltip-inner",this._getTitle())}},{key:"_getTitle",value:function(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}},{key:"_initializeOnDelegatedTarget",value:function(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}},{key:"_isAnimated",value:function(){return this._config.animation||this.tip&&this.tip.classList.contains(cr)}},{key:"_isShown",value:function(){return this.tip&&this.tip.classList.contains(ur)}},{key:"_createPopper",value:function(e){var t=y(this._config.placement,[this,e,this._element]),n=_r[t.toUpperCase()];return Sn(this._element,e,this._getPopperConfig(n))}},{key:"_getOffset",value:function(){var e=this,t=this._config.offset;return"string"==typeof t?t.split(",").map((function(e){return Number.parseInt(e,10)})):"function"==typeof t?function(n){return t(n,e._element)}:t}},{key:"_resolvePossibleFunction",value:function(e){return y(e,[this._element])}},{key:"_getPopperConfig",value:function(e){var t=this,n={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:".".concat(this.constructor.NAME,"-arrow")}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:function(e){t._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return _objectSpread(_objectSpread({},n),y(this._config.popperConfig,[n]))}},{key:"_setListeners",value:function(){var e,t=this,n=_createForOfIteratorHelper(this._config.trigger.split(" "));try{for(n.s();!(e=n.n()).done;){var i=e.value;if("click"===i)F.on(this._element,this.constructor.eventName("click"),this._config.selector,(function(e){t._initializeOnDelegatedTarget(e).toggle()}));else if("manual"!==i){var r=i===hr?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),o=i===hr?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");F.on(this._element,r,this._config.selector,(function(e){var n=t._initializeOnDelegatedTarget(e);n._activeTrigger["focusin"===e.type?pr:hr]=!0,n._enter()})),F.on(this._element,o,this._config.selector,(function(e){var n=t._initializeOnDelegatedTarget(e);n._activeTrigger["focusout"===e.type?pr:hr]=n._element.contains(e.relatedTarget),n._leave()}))}}}catch(e){n.e(e)}finally{n.f()}this._hideModalHandler=function(){t._element&&t.hide()},F.on(this._element.closest(fr),dr,this._hideModalHandler)}},{key:"_fixTitle",value:function(){var e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}},{key:"_enter",value:function(){var e=this;this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((function(){e._isHovered&&e.show()}),this._config.delay.show))}},{key:"_leave",value:function(){var e=this;this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((function(){e._isHovered||e.hide()}),this._config.delay.hide))}},{key:"_setTimeout",value:function(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}},{key:"_isWithActiveTrigger",value:function(){return Object.values(this._activeTrigger).includes(!0)}},{key:"_getConfig",value:function(e){for(var t=q(this._element),n=0,i=Object.keys(t);n

    ',trigger:"click"}),br=_objectSpread(_objectSpread({},mr.DefaultType),{},{content:"(null|string|element|function)"}),kr=function(e){_inherits(n,e);var t=_createSuper(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"_isWithContent",value:function(){return this._getTitle()||this._getContent()}},{key:"_getContentForTemplate",value:function(){var e;return _defineProperty(e={},".popover-header",this._getTitle()),_defineProperty(e,".popover-body",this._getContent()),e}},{key:"_getContent",value:function(){return this._resolvePossibleFunction(this._config.content)}}],[{key:"Default",get:function(){return yr}},{key:"DefaultType",get:function(){return br}},{key:"NAME",get:function(){return"popover"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}))}}]),n}(mr);m(kr);var wr=".".concat("bs.scrollspy"),Cr="activate".concat(wr),Or="click".concat(wr),Ar="load".concat(wr).concat(".data-api"),Er="active",Tr="[href]",Sr=".nav-link",xr="".concat(Sr,", ").concat(".nav-item"," > ").concat(Sr,", ").concat(".list-group-item"),Ir={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Pr={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"},Lr=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck(this,n),(r=t.call(this,e,i))._targetLinks=new Map,r._observableSections=new Map,r._rootElement="visible"===getComputedStyle(r._element).overflowY?null:r._element,r._activeTarget=null,r._observer=null,r._previousScrollData={visibleEntryTop:0,parentScrollTop:0},r.refresh(),r}return _createClass(n,[{key:"refresh",value:function(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();var e,t=_createForOfIteratorHelper(this._observableSections.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;this._observer.observe(n)}}catch(e){t.e(e)}finally{t.f()}}},{key:"dispose",value:function(){this._observer.disconnect(),_get(_getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"_configAfterMerge",value:function(e){return e.target=c(e.target)||document.body,e.rootMargin=e.offset?"".concat(e.offset,"px 0px -30%"):e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map((function(e){return Number.parseFloat(e)}))),e}},{key:"_maybeEnableSmoothScroll",value:function(){var e=this;this._config.smoothScroll&&(F.off(this._config.target,Or),F.on(this._config.target,Or,Tr,(function(t){var n=e._observableSections.get(t.target.hash);if(n){t.preventDefault();var i=e._rootElement||window,r=n.offsetTop-e._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:r,behavior:"smooth"});i.scrollTop=r}})))}},{key:"_getNewObserver",value:function(){var e=this,t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((function(t){return e._observerCallback(t)}),t)}},{key:"_observerCallback",value:function(e){var t=this,n=function(e){return t._targetLinks.get("#".concat(e.target.id))},i=function(e){t._previousScrollData.visibleEntryTop=e.target.offsetTop,t._process(n(e))},r=(this._rootElement||document.documentElement).scrollTop,o=r>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=r;var a,s=_createForOfIteratorHelper(e);try{for(s.s();!(a=s.n()).done;){var l=a.value;if(l.isIntersecting){var c=l.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&c){if(i(l),!r)return}else o||c||i(l)}else this._activeTarget=null,this._clearActiveClass(n(l))}}catch(e){s.e(e)}finally{s.f()}}},{key:"_initializeTargetsAndObservables",value:function(){this._targetLinks=new Map,this._observableSections=new Map;var e,t=_createForOfIteratorHelper(X.find(Tr,this._config.target));try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.hash&&!f(n)){var i=X.findOne(decodeURI(n.hash),this._element);u(i)&&(this._targetLinks.set(decodeURI(n.hash),n),this._observableSections.set(n.hash,i))}}}catch(e){t.e(e)}finally{t.f()}}},{key:"_process",value:function(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Er),this._activateParents(e),F.trigger(this._element,Cr,{relatedTarget:e}))}},{key:"_activateParents",value:function(e){if(e.classList.contains("dropdown-item"))X.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(Er);else{var t,n=_createForOfIteratorHelper(X.parents(e,".nav, .list-group"));try{for(n.s();!(t=n.n()).done;){var i,r=t.value,o=_createForOfIteratorHelper(X.prev(r,xr));try{for(o.s();!(i=o.n()).done;){i.value.classList.add(Er)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}}}},{key:"_clearActiveClass",value:function(e){e.classList.remove(Er);var t,n=_createForOfIteratorHelper(X.find("".concat(Tr,".").concat(Er),e));try{for(n.s();!(t=n.n()).done;){t.value.classList.remove(Er)}}catch(e){n.e(e)}finally{n.f()}}}],[{key:"Default",get:function(){return Ir}},{key:"DefaultType",get:function(){return Pr}},{key:"NAME",get:function(){return"scrollspy"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}))}}]),n}(Q);F.on(window,Ar,(function(){var e,t=_createForOfIteratorHelper(X.find('[data-bs-spy="scroll"]'));try{for(t.s();!(e=t.n()).done;){var n=e.value;Lr.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),m(Lr);var jr=".".concat("bs.tab"),Dr="hide".concat(jr),Nr="hidden".concat(jr),Mr="show".concat(jr),Fr="shown".concat(jr),Hr="click".concat(jr),Rr="keydown".concat(jr),Wr="load".concat(jr),Br="ArrowLeft",zr="ArrowRight",qr="ArrowUp",Vr="ArrowDown",Kr="Home",Qr="End",Ur="active",Xr="fade",Yr="show",$r=".dropdown-toggle",Gr=":not(".concat($r,")"),Jr=".nav-link".concat(Gr,", .list-group-item").concat(Gr,', [role="tab"]').concat(Gr),Zr='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',eo="".concat(Jr,", ").concat(Zr),to=".".concat(Ur,'[data-bs-toggle="tab"], .').concat(Ur,'[data-bs-toggle="pill"], .').concat(Ur,'[data-bs-toggle="list"]'),no=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var i;return _classCallCheck(this,n),(i=t.call(this,e))._parent=i._element.closest('.list-group, .nav, [role="tablist"]'),i._parent?(i._setInitialAttributes(i._parent,i._getChildren()),F.on(i._element,Rr,(function(e){return i._keydown(e)})),i):_possibleConstructorReturn(i)}return _createClass(n,[{key:"show",value:function(){var e=this._element;if(!this._elemIsActive(e)){var t=this._getActiveElem(),n=t?F.trigger(t,Dr,{relatedTarget:e}):null;F.trigger(e,Mr,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}}},{key:"_activate",value:function(e,t){var n=this;if(e){e.classList.add(Ur),this._activate(X.getElementFromSelector(e));this._queueCallback((function(){"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),n._toggleDropDown(e,!0),F.trigger(e,Fr,{relatedTarget:t})):e.classList.add(Yr)}),e,e.classList.contains(Xr))}}},{key:"_deactivate",value:function(e,t){var n=this;if(e){e.classList.remove(Ur),e.blur(),this._deactivate(X.getElementFromSelector(e));this._queueCallback((function(){"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),n._toggleDropDown(e,!1),F.trigger(e,Nr,{relatedTarget:t})):e.classList.remove(Yr)}),e,e.classList.contains(Xr))}}},{key:"_keydown",value:function(e){if([Br,zr,qr,Vr,Kr,Qr].includes(e.key)){e.stopPropagation(),e.preventDefault();var t,i=this._getChildren().filter((function(e){return!f(e)}));if([Kr,Qr].includes(e.key))t=i[e.key===Kr?0:i.length-1];else{var r=[zr,Vr].includes(e.key);t=k(i,e.target,r,!0)}t&&(t.focus({preventScroll:!0}),n.getOrCreateInstance(t).show())}}},{key:"_getChildren",value:function(){return X.find(eo,this._parent)}},{key:"_getActiveElem",value:function(){var e=this;return this._getChildren().find((function(t){return e._elemIsActive(t)}))||null}},{key:"_setInitialAttributes",value:function(e,t){this._setAttributeIfNotExists(e,"role","tablist");var n,i=_createForOfIteratorHelper(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;this._setInitialAttributesOnChild(r)}}catch(e){i.e(e)}finally{i.f()}}},{key:"_setInitialAttributesOnChild",value:function(e){e=this._getInnerElement(e);var t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}},{key:"_setInitialAttributesOnTargetPanel",value:function(e){var t=X.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby","".concat(e.id)))}},{key:"_toggleDropDown",value:function(e,t){var n=this._getOuterElement(e);if(n.classList.contains("dropdown")){var i=function(e,i){var r=X.findOne(e,n);r&&r.classList.toggle(i,t)};i($r,Ur),i(".dropdown-menu",Yr),n.setAttribute("aria-expanded",t)}}},{key:"_setAttributeIfNotExists",value:function(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}},{key:"_elemIsActive",value:function(e){return e.classList.contains(Ur)}},{key:"_getInnerElement",value:function(e){return e.matches(eo)?e:X.findOne(eo,e)}},{key:"_getOuterElement",value:function(e){return e.closest(".nav-item, .list-group-item")||e}}],[{key:"NAME",get:function(){return"tab"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}))}}]),n}(Q);F.on(document,Hr,Zr,(function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),f(this)||no.getOrCreateInstance(this).show()})),F.on(window,Wr,(function(){var e,t=_createForOfIteratorHelper(X.find(to));try{for(t.s();!(e=t.n()).done;){var n=e.value;no.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),m(no);var io=".".concat("bs.toast"),ro="mouseover".concat(io),oo="mouseout".concat(io),ao="focusin".concat(io),so="focusout".concat(io),lo="hide".concat(io),co="hidden".concat(io),uo="show".concat(io),fo="shown".concat(io),ho="hide",po="show",_o="showing",vo={animation:"boolean",autohide:"boolean",delay:"number"},go={animation:!0,autohide:!0,delay:5e3},mo=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck(this,n),(r=t.call(this,e,i))._timeout=null,r._hasMouseInteraction=!1,r._hasKeyboardInteraction=!1,r._setListeners(),r}return _createClass(n,[{key:"show",value:function(){var e=this;if(!F.trigger(this._element,uo).defaultPrevented){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(ho),p(this._element),this._element.classList.add(po,_o),this._queueCallback((function(){e._element.classList.remove(_o),F.trigger(e._element,fo),e._maybeScheduleHide()}),this._element,this._config.animation)}}},{key:"hide",value:function(){var e=this;if(this.isShown()&&!F.trigger(this._element,lo).defaultPrevented){this._element.classList.add(_o),this._queueCallback((function(){e._element.classList.add(ho),e._element.classList.remove(_o,po),F.trigger(e._element,co)}),this._element,this._config.animation)}}},{key:"dispose",value:function(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(po),_get(_getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"isShown",value:function(){return this._element.classList.contains(po)}},{key:"_maybeScheduleHide",value:function(){var e=this;this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((function(){e.hide()}),this._config.delay)))}},{key:"_onInteraction",value:function(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)this._clearTimeout();else{var n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}}},{key:"_setListeners",value:function(){var e=this;F.on(this._element,ro,(function(t){return e._onInteraction(t,!0)})),F.on(this._element,oo,(function(t){return e._onInteraction(t,!1)})),F.on(this._element,ao,(function(t){return e._onInteraction(t,!0)})),F.on(this._element,so,(function(t){return e._onInteraction(t,!1)}))}},{key:"_clearTimeout",value:function(){clearTimeout(this._timeout),this._timeout=null}}],[{key:"Default",get:function(){return go}},{key:"DefaultType",get:function(){return vo}},{key:"NAME",get:function(){return"toast"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}}))}}]),n}(Q);return Y(mo),m(mo),{Alert:Z,Button:ie,Carousel:Ne,Collapse:Ye,Dropdown:ei,Modal:Ni,Offcanvas:Zi,Popover:kr,ScrollSpy:Lr,Tab:no,Toast:mo,Tooltip:mr}})); + */}!function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self).bootstrap=t()}(this,(function(){"use strict";var e=new Map,t=function(t,n,i){e.has(t)||e.set(t,new Map);var r=e.get(t);r.has(n)||0===r.size?r.set(n,i):console.error("Bootstrap doesn't allow more than one instance per element. Bound instance: ".concat(Array.from(r.keys())[0],"."))},n=function(t,n){return e.has(t)&&e.get(t).get(n)||null},i=function(t,n){if(e.has(t)){var i=e.get(t);i.delete(n),0===i.size&&e.delete(t)}},r="transitionend",o=function(e){return e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(function(e,t){return"#".concat(CSS.escape(t))}))),e},a=function(e){e.dispatchEvent(new Event(r))},s=function(e){return!(!e||"object"!==_typeof(e))&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType)},l=function(e){return s(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(o(e)):null},c=function(e){if(!s(e)||0===e.getClientRects().length)return!1;var t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){var i=e.closest("summary");if(i&&i.parentNode!==n)return!1;if(null===i)return!1}return t},u=function(e){return!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")))},f=function e(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var n=t.getRootNode();return n instanceof ShadowRoot?n:null}return t instanceof ShadowRoot?t:t.parentNode?e(t.parentNode):null},d=function(){},h=function(e){e.offsetHeight},p=function(){return window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null},_=[],v=function(){return"rtl"===document.documentElement.dir},g=function(e){var t;t=function(){var t=p();if(t){var n=e.NAME,i=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=function(){return t.fn[n]=i,e.jQueryInterface}}},"loading"===document.readyState?(_.length||document.addEventListener("DOMContentLoaded",(function(){for(var e=0,t=_;e1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return"function"==typeof e?e.apply(void 0,_toConsumableArray(t)):n},y=function(e,t){if(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]){var n=function(e){if(!e)return 0;var t=window.getComputedStyle(e),n=t.transitionDuration,i=t.transitionDelay,r=Number.parseFloat(n),o=Number.parseFloat(i);return r||o?(n=n.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(n)+Number.parseFloat(i))):0}(t)+5,i=!1;t.addEventListener(r,(function n(o){o.target===t&&(i=!0,t.removeEventListener(r,n),m(e))})),setTimeout((function(){i||a(t)}),n)}else m(e)},b=function(e,t,n,i){var r=e.length,o=e.indexOf(t);return-1===o?!n&&i?e[r-1]:e[0]:(o+=n?1:-1,i&&(o=(o+r)%r),e[Math.max(0,Math.min(o,r-1))])},k=/[^.]*(?=\..*)\.|.*/,w=/\..*/,C=/::\d+$/,O={},A=1,E={mouseenter:"mouseover",mouseleave:"mouseout"},T=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function S(e,t){return t&&"".concat(t,"::").concat(A++)||e.uidEvent||A++}function x(e){var t=S(e);return e.uidEvent=t,O[t]=O[t]||{},O[t]}function I(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Object.values(e).find((function(e){return e.callable===t&&e.delegationSelector===n}))}function P(e,t,n){var i="string"==typeof t,r=i?n:t||n,o=N(e);return T.has(o)||(o=e),[i,r,o]}function L(e,t,n,i,r){if("string"==typeof t&&e){var o=_slicedToArray(P(t,n,i),3),a=o[0],s=o[1],l=o[2];if(t in E){s=function(e){return function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)}}(s)}var c=x(e),u=c[l]||(c[l]={}),f=I(u,s,a?n:null);if(f)f.oneOff=f.oneOff&&r;else{var d=S(s,t.replace(k,"")),h=a?function(e,t,n){return function i(r){for(var o=e.querySelectorAll(t),a=r.target;a&&a!==this;a=a.parentNode){var s,l=_createForOfIteratorHelper(o);try{for(l.s();!(s=l.n()).done;)if(s.value===a)return F(r,{delegateTarget:a}),i.oneOff&&M.off(e,r.type,t,n),n.apply(a,[r])}catch(e){l.e(e)}finally{l.f()}}}}(e,n,s):function(e,t){return function n(i){return F(i,{delegateTarget:e}),n.oneOff&&M.off(e,i.type,t),t.apply(e,[i])}}(e,s);h.delegationSelector=a?n:null,h.callable=s,h.oneOff=r,h.uidEvent=d,u[d]=h,e.addEventListener(l,h,a)}}}function j(e,t,n,i,r){var o=I(t[n],i,r);o&&(e.removeEventListener(n,o,Boolean(r)),delete t[n][o.uidEvent])}function D(e,t,n,i){for(var r=t[n]||{},o=0,a=Object.entries(r);o1&&void 0!==arguments[1]?arguments[1]:{},n=function(){var t=_slicedToArray(r[i],2),n=t[0],o=t[1];try{e[n]=o}catch(t){Object.defineProperty(e,n,{configurable:!0,get:function(){return o}})}},i=0,r=Object.entries(t);i1&&void 0!==arguments[1]?arguments[1]:this.constructor.DefaultType,i=0,r=Object.entries(n);i2&&void 0!==arguments[2])||arguments[2])}},{key:"_getConfig",value:function(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}}],[{key:"getInstance",value:function(e){return n(l(e),this.DATA_KEY)}},{key:"getOrCreateInstance",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getInstance(e)||new this(e,"object"===_typeof(t)?t:null)}},{key:"VERSION",get:function(){return"5.3.3"}},{key:"DATA_KEY",get:function(){return"bs.".concat(this.NAME)}},{key:"EVENT_KEY",get:function(){return".".concat(this.DATA_KEY)}},{key:"eventName",value:function(e){return"".concat(e).concat(this.EVENT_KEY)}}])}(V),Q=function(e){var t=e.getAttribute("data-bs-target");if(!t||"#"===t){var n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n="#".concat(n.split("#")[1])),t=n&&"#"!==n?n.trim():null}return t?t.split(",").map((function(e){return o(e)})).join(","):null},U={find:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return(t=[]).concat.apply(t,_toConsumableArray(Element.prototype.querySelectorAll.call(n,e)))},findOne:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return Element.prototype.querySelector.call(t,e)},children:function(e,t){var n;return(n=[]).concat.apply(n,_toConsumableArray(e.children)).filter((function(e){return e.matches(t)}))},parents:function(e,t){for(var n=[],i=e.parentNode.closest(t);i;)n.push(i),i=i.parentNode.closest(t);return n},prev:function(e,t){for(var n=e.previousElementSibling;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next:function(e,t){for(var n=e.nextElementSibling;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren:function(e){var t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((function(e){return"".concat(e,':not([tabindex^="-"])')})).join(",");return this.find(t,e).filter((function(e){return!u(e)&&c(e)}))},getSelectorFromElement:function(e){var t=Q(e);return t&&U.findOne(t)?t:null},getElementFromSelector:function(e){var t=Q(e);return t?U.findOne(t):null},getMultipleElementsFromSelector:function(e){var t=Q(e);return t?U.find(t):[]}},X=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hide",n="click.dismiss".concat(e.EVENT_KEY),i=e.NAME;M.on(document,n,'[data-bs-dismiss="'.concat(i,'"]'),(function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),!u(this)){var r=U.getElementFromSelector(this)||this.closest(".".concat(i));e.getOrCreateInstance(r)[t]()}}))},Y=".".concat("bs.alert"),$="close".concat(Y),G="closed".concat(Y),J=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"close",value:function(){var e=this;if(!M.trigger(this._element,$).defaultPrevented){this._element.classList.remove("show");var t=this._element.classList.contains("fade");this._queueCallback((function(){return e._destroyElement()}),this._element,t)}}},{key:"_destroyElement",value:function(){this._element.remove(),M.trigger(this._element,G),this.dispose()}}],[{key:"NAME",get:function(){return"alert"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this);if("string"==typeof e){if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));n[e](this)}}))}}])}(K);X(J,"close"),g(J);var Z=".".concat("bs.button"),ee='[data-bs-toggle="button"]',te="click".concat(Z).concat(".data-api"),ne=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"toggle",value:function(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}}],[{key:"NAME",get:function(){return"button"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this);"toggle"===e&&n[e]()}))}}])}(K);M.on(document,te,ee,(function(e){e.preventDefault();var t=e.target.closest(ee);ne.getOrCreateInstance(t).toggle()})),g(ne);var ie=".bs.swipe",re="touchstart".concat(ie),oe="touchmove".concat(ie),ae="touchend".concat(ie),se="pointerdown".concat(ie),le="pointerup".concat(ie),ce={endCallback:null,leftCallback:null,rightCallback:null},ue={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"},fe=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t))._element=e,e&&t.isSupported()?(i._config=i._getConfig(n),i._deltaX=0,i._supportPointerEvents=Boolean(window.PointerEvent),i._initEvents(),i):_possibleConstructorReturn(i)}return _inherits(t,e),_createClass(t,[{key:"dispose",value:function(){M.off(this._element,ie)}},{key:"_start",value:function(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}},{key:"_end",value:function(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),m(this._config.endCallback)}},{key:"_move",value:function(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}},{key:"_handleSwipe",value:function(){var e=Math.abs(this._deltaX);if(!(e<=40)){var t=e/this._deltaX;this._deltaX=0,t&&m(t>0?this._config.rightCallback:this._config.leftCallback)}}},{key:"_initEvents",value:function(){var e=this;this._supportPointerEvents?(M.on(this._element,se,(function(t){return e._start(t)})),M.on(this._element,le,(function(t){return e._end(t)})),this._element.classList.add("pointer-event")):(M.on(this._element,re,(function(t){return e._start(t)})),M.on(this._element,oe,(function(t){return e._move(t)})),M.on(this._element,ae,(function(t){return e._end(t)})))}},{key:"_eventIsPointerPenTouch",value:function(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}}],[{key:"Default",get:function(){return ce}},{key:"DefaultType",get:function(){return ue}},{key:"NAME",get:function(){return"swipe"}},{key:"isSupported",value:function(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}])}(V),de=".".concat("bs.carousel"),he=".data-api",pe="next",_e="prev",ve="left",ge="right",me="slide".concat(de),ye="slid".concat(de),be="keydown".concat(de),ke="mouseenter".concat(de),we="mouseleave".concat(de),Ce="dragstart".concat(de),Oe="load".concat(de).concat(he),Ae="click".concat(de).concat(he),Ee="carousel",Te="active",Se=".active",xe=".carousel-item",Ie=Se+xe,Pe=_defineProperty(_defineProperty({},"ArrowLeft",ge),"ArrowRight",ve),Le={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},je={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"},De=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._interval=null,i._activeElement=null,i._isSliding=!1,i.touchTimeout=null,i._swipeHelper=null,i._indicatorsElement=U.findOne(".carousel-indicators",i._element),i._addEventListeners(),i._config.ride===Ee&&i.cycle(),i}return _inherits(t,e),_createClass(t,[{key:"next",value:function(){this._slide(pe)}},{key:"nextWhenVisible",value:function(){!document.hidden&&c(this._element)&&this.next()}},{key:"prev",value:function(){this._slide(_e)}},{key:"pause",value:function(){this._isSliding&&a(this._element),this._clearInterval()}},{key:"cycle",value:function(){var e=this;this._clearInterval(),this._updateInterval(),this._interval=setInterval((function(){return e.nextWhenVisible()}),this._config.interval)}},{key:"_maybeEnableCycle",value:function(){var e=this;this._config.ride&&(this._isSliding?M.one(this._element,ye,(function(){return e.cycle()})):this.cycle())}},{key:"to",value:function(e){var t=this,n=this._getItems();if(!(e>n.length-1||e<0))if(this._isSliding)M.one(this._element,ye,(function(){return t.to(e)}));else{var i=this._getItemIndex(this._getActive());if(i!==e){var r=e>i?pe:_e;this._slide(r,n[e])}}}},{key:"dispose",value:function(){this._swipeHelper&&this._swipeHelper.dispose(),_get(_getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"_configAfterMerge",value:function(e){return e.defaultInterval=e.interval,e}},{key:"_addEventListeners",value:function(){var e=this;this._config.keyboard&&M.on(this._element,be,(function(t){return e._keydown(t)})),"hover"===this._config.pause&&(M.on(this._element,ke,(function(){return e.pause()})),M.on(this._element,we,(function(){return e._maybeEnableCycle()}))),this._config.touch&&fe.isSupported()&&this._addTouchEventListeners()}},{key:"_addTouchEventListeners",value:function(){var e,t=this,n=_createForOfIteratorHelper(U.find(".carousel-item img",this._element));try{for(n.s();!(e=n.n()).done;){var i=e.value;M.on(i,Ce,(function(e){return e.preventDefault()}))}}catch(e){n.e(e)}finally{n.f()}var r={leftCallback:function(){return t._slide(t._directionToOrder(ve))},rightCallback:function(){return t._slide(t._directionToOrder(ge))},endCallback:function(){"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(){return t._maybeEnableCycle()}),500+t._config.interval))}};this._swipeHelper=new fe(this._element,r)}},{key:"_keydown",value:function(e){if(!/input|textarea/i.test(e.target.tagName)){var t=Pe[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}}},{key:"_getItemIndex",value:function(e){return this._getItems().indexOf(e)}},{key:"_setActiveIndicatorElement",value:function(e){if(this._indicatorsElement){var t=U.findOne(Se,this._indicatorsElement);t.classList.remove(Te),t.removeAttribute("aria-current");var n=U.findOne('[data-bs-slide-to="'.concat(e,'"]'),this._indicatorsElement);n&&(n.classList.add(Te),n.setAttribute("aria-current","true"))}}},{key:"_updateInterval",value:function(){var e=this._activeElement||this._getActive();if(e){var t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}}},{key:"_slide",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!this._isSliding){var i=this._getActive(),r=e===pe,o=n||b(this._getItems(),i,r,this._config.wrap);if(o!==i){var a=this._getItemIndex(o),s=function(n){return M.trigger(t._element,n,{relatedTarget:o,direction:t._orderToDirection(e),from:t._getItemIndex(i),to:a})};if(!s(me).defaultPrevented&&i&&o){var l=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(a),this._activeElement=o;var c=r?"carousel-item-start":"carousel-item-end",u=r?"carousel-item-next":"carousel-item-prev";o.classList.add(u),h(o),i.classList.add(c),o.classList.add(c);this._queueCallback((function(){o.classList.remove(c,u),o.classList.add(Te),i.classList.remove(Te,u,c),t._isSliding=!1,s(ye)}),i,this._isAnimated()),l&&this.cycle()}}}}},{key:"_isAnimated",value:function(){return this._element.classList.contains("slide")}},{key:"_getActive",value:function(){return U.findOne(Ie,this._element)}},{key:"_getItems",value:function(){return U.find(xe,this._element)}},{key:"_clearInterval",value:function(){this._interval&&(clearInterval(this._interval),this._interval=null)}},{key:"_directionToOrder",value:function(e){return v()?e===ve?_e:pe:e===ve?pe:_e}},{key:"_orderToDirection",value:function(e){return v()?e===_e?ve:ge:e===_e?ge:ve}}],[{key:"Default",get:function(){return Le}},{key:"DefaultType",get:function(){return je}},{key:"NAME",get:function(){return"carousel"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}else n.to(e)}))}}])}(K);M.on(document,Ae,"[data-bs-slide], [data-bs-slide-to]",(function(e){var t=U.getElementFromSelector(this);if(t&&t.classList.contains(Ee)){e.preventDefault();var n=De.getOrCreateInstance(t),i=this.getAttribute("data-bs-slide-to");if(i)return n.to(i),void n._maybeEnableCycle();if("next"===q(this,"slide"))return n.next(),void n._maybeEnableCycle();n.prev(),n._maybeEnableCycle()}})),M.on(window,Oe,(function(){var e,t=_createForOfIteratorHelper(U.find('[data-bs-ride="carousel"]'));try{for(t.s();!(e=t.n()).done;){var n=e.value;De.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),g(De);var Ne=".".concat("bs.collapse"),Me="show".concat(Ne),Fe="shown".concat(Ne),He="hide".concat(Ne),Re="hidden".concat(Ne),We="click".concat(Ne).concat(".data-api"),Be="show",ze="collapse",qe="collapsing",Ve=":scope .".concat(ze," .").concat(ze),Ke='[data-bs-toggle="collapse"]',Qe={parent:null,toggle:!0},Ue={parent:"(null|element)",toggle:"boolean"},Xe=function(e){function t(e,n){var i;_classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._isTransitioning=!1,i._triggerArray=[];var r,o=_createForOfIteratorHelper(U.find(Ke));try{for(o.s();!(r=o.n()).done;){var a=r.value,s=U.getSelectorFromElement(a),l=U.find(s).filter((function(e){return e===i._element}));null!==s&&l.length&&i._triggerArray.push(a)}}catch(e){o.e(e)}finally{o.f()}return i._initializeChildren(),i._config.parent||i._addAriaAndCollapsedClass(i._triggerArray,i._isShown()),i._config.toggle&&i.toggle(),i}return _inherits(t,e),_createClass(t,[{key:"toggle",value:function(){this._isShown()?this.hide():this.show()}},{key:"show",value:function(){var e=this;if(!this._isTransitioning&&!this._isShown()){var n=[];if(this._config.parent&&(n=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((function(t){return t!==e._element})).map((function(e){return t.getOrCreateInstance(e,{toggle:!1})}))),!n.length||!n[0]._isTransitioning)if(!M.trigger(this._element,Me).defaultPrevented){var i,r=_createForOfIteratorHelper(n);try{for(r.s();!(i=r.n()).done;){i.value.hide()}}catch(e){r.e(e)}finally{r.f()}var o=this._getDimension();this._element.classList.remove(ze),this._element.classList.add(qe),this._element.style[o]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;var a=o[0].toUpperCase()+o.slice(1),s="scroll".concat(a);this._queueCallback((function(){e._isTransitioning=!1,e._element.classList.remove(qe),e._element.classList.add(ze,Be),e._element.style[o]="",M.trigger(e._element,Fe)}),this._element,!0),this._element.style[o]="".concat(this._element[s],"px")}}}},{key:"hide",value:function(){var e=this;if(!this._isTransitioning&&this._isShown()&&!M.trigger(this._element,He).defaultPrevented){var t=this._getDimension();this._element.style[t]="".concat(this._element.getBoundingClientRect()[t],"px"),h(this._element),this._element.classList.add(qe),this._element.classList.remove(ze,Be);var n,i=_createForOfIteratorHelper(this._triggerArray);try{for(i.s();!(n=i.n()).done;){var r=n.value,o=U.getElementFromSelector(r);o&&!this._isShown(o)&&this._addAriaAndCollapsedClass([r],!1)}}catch(e){i.e(e)}finally{i.f()}this._isTransitioning=!0;this._element.style[t]="",this._queueCallback((function(){e._isTransitioning=!1,e._element.classList.remove(qe),e._element.classList.add(ze),M.trigger(e._element,Re)}),this._element,!0)}}},{key:"_isShown",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._element).classList.contains(Be)}},{key:"_configAfterMerge",value:function(e){return e.toggle=Boolean(e.toggle),e.parent=l(e.parent),e}},{key:"_getDimension",value:function(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}},{key:"_initializeChildren",value:function(){if(this._config.parent){var e,t=_createForOfIteratorHelper(this._getFirstLevelChildren(Ke));try{for(t.s();!(e=t.n()).done;){var n=e.value,i=U.getElementFromSelector(n);i&&this._addAriaAndCollapsedClass([n],this._isShown(i))}}catch(e){t.e(e)}finally{t.f()}}}},{key:"_getFirstLevelChildren",value:function(e){var t=U.find(Ve,this._config.parent);return U.find(e,this._config.parent).filter((function(e){return!t.includes(e)}))}},{key:"_addAriaAndCollapsedClass",value:function(e,t){if(e.length){var n,i=_createForOfIteratorHelper(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;r.classList.toggle("collapsed",!t),r.setAttribute("aria-expanded",t)}}catch(e){i.e(e)}finally{i.f()}}}}],[{key:"Default",get:function(){return Qe}},{key:"DefaultType",get:function(){return Ue}},{key:"NAME",get:function(){return"collapse"}},{key:"jQueryInterface",value:function(e){var n={};return"string"==typeof e&&/show|hide/.test(e)&&(n.toggle=!1),this.each((function(){var i=t.getOrCreateInstance(this,n);if("string"==typeof e){if(void 0===i[e])throw new TypeError('No method named "'.concat(e,'"'));i[e]()}}))}}])}(K);M.on(document,We,Ke,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();var t,n=_createForOfIteratorHelper(U.getMultipleElementsFromSelector(this));try{for(n.s();!(t=n.n()).done;){var i=t.value;Xe.getOrCreateInstance(i,{toggle:!1}).toggle()}}catch(e){n.e(e)}finally{n.f()}})),g(Xe);var Ye="top",$e="bottom",Ge="right",Je="left",Ze="auto",et=[Ye,$e,Ge,Je],tt="start",nt="end",it="clippingParents",rt="viewport",ot="popper",at="reference",st=et.reduce((function(e,t){return e.concat([t+"-"+tt,t+"-"+nt])}),[]),lt=[].concat(et,[Ze]).reduce((function(e,t){return e.concat([t,t+"-"+tt,t+"-"+nt])}),[]),ct="beforeRead",ut="read",ft="afterRead",dt="beforeMain",ht="main",pt="afterMain",_t="beforeWrite",vt="write",gt="afterWrite",mt=[ct,ut,ft,dt,ht,pt,_t,vt,gt];function yt(e){return e?(e.nodeName||"").toLowerCase():null}function bt(e){if(null==e)return window;if("[object Window]"!==e.toString()){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function kt(e){return e instanceof bt(e).Element||e instanceof Element}function wt(e){return e instanceof bt(e).HTMLElement||e instanceof HTMLElement}function Ct(e){return"undefined"!=typeof ShadowRoot&&(e instanceof bt(e).ShadowRoot||e instanceof ShadowRoot)}var Ot={name:"applyStyles",enabled:!0,phase:"write",fn:function(e){var t=e.state;Object.keys(t.elements).forEach((function(e){var n=t.styles[e]||{},i=t.attributes[e]||{},r=t.elements[e];wt(r)&&yt(r)&&(Object.assign(r.style,n),Object.keys(i).forEach((function(e){var t=i[e];!1===t?r.removeAttribute(e):r.setAttribute(e,!0===t?"":t)})))}))},effect:function(e){var t=e.state,n={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,n.popper),t.styles=n,t.elements.arrow&&Object.assign(t.elements.arrow.style,n.arrow),function(){Object.keys(t.elements).forEach((function(e){var i=t.elements[e],r=t.attributes[e]||{},o=Object.keys(t.styles.hasOwnProperty(e)?t.styles[e]:n[e]).reduce((function(e,t){return e[t]="",e}),{});wt(i)&&yt(i)&&(Object.assign(i.style,o),Object.keys(r).forEach((function(e){i.removeAttribute(e)})))}))}},requires:["computeStyles"]};function At(e){return e.split("-")[0]}var Et=Math.max,Tt=Math.min,St=Math.round;function xt(){var e=navigator.userAgentData;return null!=e&&e.brands&&Array.isArray(e.brands)?e.brands.map((function(e){return e.brand+"/"+e.version})).join(" "):navigator.userAgent}function It(){return!/^((?!chrome|android).)*safari/i.test(xt())}function Pt(e,t,n){void 0===t&&(t=!1),void 0===n&&(n=!1);var i=e.getBoundingClientRect(),r=1,o=1;t&&wt(e)&&(r=e.offsetWidth>0&&St(i.width)/e.offsetWidth||1,o=e.offsetHeight>0&&St(i.height)/e.offsetHeight||1);var a=(kt(e)?bt(e):window).visualViewport,s=!It()&&n,l=(i.left+(s&&a?a.offsetLeft:0))/r,c=(i.top+(s&&a?a.offsetTop:0))/o,u=i.width/r,f=i.height/o;return{width:u,height:f,top:c,right:l+u,bottom:c+f,left:l,x:l,y:c}}function Lt(e){var t=Pt(e),n=e.offsetWidth,i=e.offsetHeight;return Math.abs(t.width-n)<=1&&(n=t.width),Math.abs(t.height-i)<=1&&(i=t.height),{x:e.offsetLeft,y:e.offsetTop,width:n,height:i}}function jt(e,t){var n=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(n&&Ct(n)){var i=t;do{if(i&&e.isSameNode(i))return!0;i=i.parentNode||i.host}while(i)}return!1}function Dt(e){return bt(e).getComputedStyle(e)}function Nt(e){return["table","td","th"].indexOf(yt(e))>=0}function Mt(e){return((kt(e)?e.ownerDocument:e.document)||window.document).documentElement}function Ft(e){return"html"===yt(e)?e:e.assignedSlot||e.parentNode||(Ct(e)?e.host:null)||Mt(e)}function Ht(e){return wt(e)&&"fixed"!==Dt(e).position?e.offsetParent:null}function Rt(e){for(var t=bt(e),n=Ht(e);n&&Nt(n)&&"static"===Dt(n).position;)n=Ht(n);return n&&("html"===yt(n)||"body"===yt(n)&&"static"===Dt(n).position)?t:n||function(e){var t=/firefox/i.test(xt());if(/Trident/i.test(xt())&&wt(e)&&"fixed"===Dt(e).position)return null;var n=Ft(e);for(Ct(n)&&(n=n.host);wt(n)&&["html","body"].indexOf(yt(n))<0;){var i=Dt(n);if("none"!==i.transform||"none"!==i.perspective||"paint"===i.contain||-1!==["transform","perspective"].indexOf(i.willChange)||t&&"filter"===i.willChange||t&&i.filter&&"none"!==i.filter)return n;n=n.parentNode}return null}(e)||t}function Wt(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Bt(e,t,n){return Et(e,Tt(t,n))}function zt(e){return Object.assign({},{top:0,right:0,bottom:0,left:0},e)}function qt(e,t){return t.reduce((function(t,n){return t[n]=e,t}),{})}var Vt={name:"arrow",enabled:!0,phase:"main",fn:function(e){var t,n=e.state,i=e.name,r=e.options,o=n.elements.arrow,a=n.modifiersData.popperOffsets,s=At(n.placement),l=Wt(s),c=[Je,Ge].indexOf(s)>=0?"height":"width";if(o&&a){var u=function(e,t){return zt("number"!=typeof(e="function"==typeof e?e(Object.assign({},t.rects,{placement:t.placement})):e)?e:qt(e,et))}(r.padding,n),f=Lt(o),d="y"===l?Ye:Je,h="y"===l?$e:Ge,p=n.rects.reference[c]+n.rects.reference[l]-a[l]-n.rects.popper[c],_=a[l]-n.rects.reference[l],v=Rt(o),g=v?"y"===l?v.clientHeight||0:v.clientWidth||0:0,m=p/2-_/2,y=u[d],b=g-f[c]-u[h],k=g/2-f[c]/2+m,w=Bt(y,k,b),C=l;n.modifiersData[i]=((t={})[C]=w,t.centerOffset=w-k,t)}},effect:function(e){var t=e.state,n=e.options.element,i=void 0===n?"[data-popper-arrow]":n;null!=i&&("string"!=typeof i||(i=t.elements.popper.querySelector(i)))&&jt(t.elements.popper,i)&&(t.elements.arrow=i)},requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Kt(e){return e.split("-")[1]}var Qt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Ut(e){var t,n=e.popper,i=e.popperRect,r=e.placement,o=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,c=e.adaptive,u=e.roundOffsets,f=e.isFixed,d=a.x,h=void 0===d?0:d,p=a.y,_=void 0===p?0:p,v="function"==typeof u?u({x:h,y:_}):{x:h,y:_};h=v.x,_=v.y;var g=a.hasOwnProperty("x"),m=a.hasOwnProperty("y"),y=Je,b=Ye,k=window;if(c){var w=Rt(n),C="clientHeight",O="clientWidth";if(w===bt(n)&&"static"!==Dt(w=Mt(n)).position&&"absolute"===s&&(C="scrollHeight",O="scrollWidth"),r===Ye||(r===Je||r===Ge)&&o===nt)b=$e,_-=(f&&w===k&&k.visualViewport?k.visualViewport.height:w[C])-i.height,_*=l?1:-1;if(r===Je||(r===Ye||r===$e)&&o===nt)y=Ge,h-=(f&&w===k&&k.visualViewport?k.visualViewport.width:w[O])-i.width,h*=l?1:-1}var A,E=Object.assign({position:s},c&&Qt),T=!0===u?function(e,t){var n=e.x,i=e.y,r=t.devicePixelRatio||1;return{x:St(n*r)/r||0,y:St(i*r)/r||0}}({x:h,y:_},bt(n)):{x:h,y:_};return h=T.x,_=T.y,l?Object.assign({},E,((A={})[b]=m?"0":"",A[y]=g?"0":"",A.transform=(k.devicePixelRatio||1)<=1?"translate("+h+"px, "+_+"px)":"translate3d("+h+"px, "+_+"px, 0)",A)):Object.assign({},E,((t={})[b]=m?_+"px":"",t[y]=g?h+"px":"",t.transform="",t))}var Xt={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:function(e){var t=e.state,n=e.options,i=n.gpuAcceleration,r=void 0===i||i,o=n.adaptive,a=void 0===o||o,s=n.roundOffsets,l=void 0===s||s,c={placement:At(t.placement),variation:Kt(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:r,isFixed:"fixed"===t.options.strategy};null!=t.modifiersData.popperOffsets&&(t.styles.popper=Object.assign({},t.styles.popper,Ut(Object.assign({},c,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),null!=t.modifiersData.arrow&&(t.styles.arrow=Object.assign({},t.styles.arrow,Ut(Object.assign({},c,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})},data:{}},Yt={passive:!0};var $t={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:function(e){var t=e.state,n=e.instance,i=e.options,r=i.scroll,o=void 0===r||r,a=i.resize,s=void 0===a||a,l=bt(t.elements.popper),c=[].concat(t.scrollParents.reference,t.scrollParents.popper);return o&&c.forEach((function(e){e.addEventListener("scroll",n.update,Yt)})),s&&l.addEventListener("resize",n.update,Yt),function(){o&&c.forEach((function(e){e.removeEventListener("scroll",n.update,Yt)})),s&&l.removeEventListener("resize",n.update,Yt)}},data:{}},Gt={left:"right",right:"left",bottom:"top",top:"bottom"};function Jt(e){return e.replace(/left|right|bottom|top/g,(function(e){return Gt[e]}))}var Zt={start:"end",end:"start"};function en(e){return e.replace(/start|end/g,(function(e){return Zt[e]}))}function tn(e){var t=bt(e);return{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function nn(e){return Pt(Mt(e)).left+tn(e).scrollLeft}function rn(e){var t=Dt(e),n=t.overflow,i=t.overflowX,r=t.overflowY;return/auto|scroll|overlay|hidden/.test(n+r+i)}function on(e){return["html","body","#document"].indexOf(yt(e))>=0?e.ownerDocument.body:wt(e)&&rn(e)?e:on(Ft(e))}function an(e,t){var n;void 0===t&&(t=[]);var i=on(e),r=i===(null==(n=e.ownerDocument)?void 0:n.body),o=bt(i),a=r?[o].concat(o.visualViewport||[],rn(i)?i:[]):i,s=t.concat(a);return r?s:s.concat(an(Ft(a)))}function sn(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function ln(e,t,n){return t===rt?sn(function(e,t){var n=bt(e),i=Mt(e),r=n.visualViewport,o=i.clientWidth,a=i.clientHeight,s=0,l=0;if(r){o=r.width,a=r.height;var c=It();(c||!c&&"fixed"===t)&&(s=r.offsetLeft,l=r.offsetTop)}return{width:o,height:a,x:s+nn(e),y:l}}(e,n)):kt(t)?function(e,t){var n=Pt(e,!1,"fixed"===t);return n.top=n.top+e.clientTop,n.left=n.left+e.clientLeft,n.bottom=n.top+e.clientHeight,n.right=n.left+e.clientWidth,n.width=e.clientWidth,n.height=e.clientHeight,n.x=n.left,n.y=n.top,n}(t,n):sn(function(e){var t,n=Mt(e),i=tn(e),r=null==(t=e.ownerDocument)?void 0:t.body,o=Et(n.scrollWidth,n.clientWidth,r?r.scrollWidth:0,r?r.clientWidth:0),a=Et(n.scrollHeight,n.clientHeight,r?r.scrollHeight:0,r?r.clientHeight:0),s=-i.scrollLeft+nn(e),l=-i.scrollTop;return"rtl"===Dt(r||n).direction&&(s+=Et(n.clientWidth,r?r.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(Mt(e)))}function cn(e,t,n,i){var r="clippingParents"===t?function(e){var t=an(Ft(e)),n=["absolute","fixed"].indexOf(Dt(e).position)>=0&&wt(e)?Rt(e):e;return kt(n)?t.filter((function(e){return kt(e)&&jt(e,n)&&"body"!==yt(e)})):[]}(e):[].concat(t),o=[].concat(r,[n]),a=o[0],s=o.reduce((function(t,n){var r=ln(e,n,i);return t.top=Et(r.top,t.top),t.right=Tt(r.right,t.right),t.bottom=Tt(r.bottom,t.bottom),t.left=Et(r.left,t.left),t}),ln(e,a,i));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function un(e){var t,n=e.reference,i=e.element,r=e.placement,o=r?At(r):null,a=r?Kt(r):null,s=n.x+n.width/2-i.width/2,l=n.y+n.height/2-i.height/2;switch(o){case Ye:t={x:s,y:n.y-i.height};break;case $e:t={x:s,y:n.y+n.height};break;case Ge:t={x:n.x+n.width,y:l};break;case Je:t={x:n.x-i.width,y:l};break;default:t={x:n.x,y:n.y}}var c=o?Wt(o):null;if(null!=c){var u="y"===c?"height":"width";switch(a){case tt:t[c]=t[c]-(n[u]/2-i[u]/2);break;case nt:t[c]=t[c]+(n[u]/2-i[u]/2)}}return t}function fn(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=void 0===i?e.placement:i,o=n.strategy,a=void 0===o?e.strategy:o,s=n.boundary,l=void 0===s?it:s,c=n.rootBoundary,u=void 0===c?rt:c,f=n.elementContext,d=void 0===f?ot:f,h=n.altBoundary,p=void 0!==h&&h,_=n.padding,v=void 0===_?0:_,g=zt("number"!=typeof v?v:qt(v,et)),m=d===ot?at:ot,y=e.rects.popper,b=e.elements[p?m:d],k=cn(kt(b)?b:b.contextElement||Mt(e.elements.popper),l,u,a),w=Pt(e.elements.reference),C=un({reference:w,element:y,strategy:"absolute",placement:r}),O=sn(Object.assign({},y,C)),A=d===ot?O:w,E={top:k.top-A.top+g.top,bottom:A.bottom-k.bottom+g.bottom,left:k.left-A.left+g.left,right:A.right-k.right+g.right},T=e.modifiersData.offset;if(d===ot&&T){var S=T[r];Object.keys(E).forEach((function(e){var t=[Ge,$e].indexOf(e)>=0?1:-1,n=[Ye,$e].indexOf(e)>=0?"y":"x";E[e]+=S[n]*t}))}return E}function dn(e,t){void 0===t&&(t={});var n=t,i=n.placement,r=n.boundary,o=n.rootBoundary,a=n.padding,s=n.flipVariations,l=n.allowedAutoPlacements,c=void 0===l?lt:l,u=Kt(i),f=u?s?st:st.filter((function(e){return Kt(e)===u})):et,d=f.filter((function(e){return c.indexOf(e)>=0}));0===d.length&&(d=f);var h=d.reduce((function(t,n){return t[n]=fn(e,{placement:n,boundary:r,rootBoundary:o,padding:a})[At(n)],t}),{});return Object.keys(h).sort((function(e,t){return h[e]-h[t]}))}var hn={name:"flip",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name;if(!t.modifiersData[i]._skip){for(var r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0===a||a,l=n.fallbackPlacements,c=n.padding,u=n.boundary,f=n.rootBoundary,d=n.altBoundary,h=n.flipVariations,p=void 0===h||h,_=n.allowedAutoPlacements,v=t.options.placement,g=At(v),m=l||(g===v||!p?[Jt(v)]:function(e){if(At(e)===Ze)return[];var t=Jt(e);return[en(e),t,en(t)]}(v)),y=[v].concat(m).reduce((function(e,n){return e.concat(At(n)===Ze?dn(t,{placement:n,boundary:u,rootBoundary:f,padding:c,flipVariations:p,allowedAutoPlacements:_}):n)}),[]),b=t.rects.reference,k=t.rects.popper,w=new Map,C=!0,O=y[0],A=0;A=0,I=x?"width":"height",P=fn(t,{placement:E,boundary:u,rootBoundary:f,altBoundary:d,padding:c}),L=x?S?Ge:Je:S?$e:Ye;b[I]>k[I]&&(L=Jt(L));var j=Jt(L),D=[];if(o&&D.push(P[T]<=0),s&&D.push(P[L]<=0,P[j]<=0),D.every((function(e){return e}))){O=E,C=!1;break}w.set(E,D)}if(C)for(var N=function(e){var t=y.find((function(t){var n=w.get(t);if(n)return n.slice(0,e).every((function(e){return e}))}));if(t)return O=t,"break"},M=p?3:1;M>0;M--){if("break"===N(M))break}t.placement!==O&&(t.modifiersData[i]._skip=!0,t.placement=O,t.reset=!0)}},requiresIfExists:["offset"],data:{_skip:!1}};function pn(e,t,n){return void 0===n&&(n={x:0,y:0}),{top:e.top-t.height-n.y,right:e.right-t.width+n.x,bottom:e.bottom-t.height+n.y,left:e.left-t.width-n.x}}function _n(e){return[Ye,Ge,$e,Je].some((function(t){return e[t]>=0}))}var vn={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:function(e){var t=e.state,n=e.name,i=t.rects.reference,r=t.rects.popper,o=t.modifiersData.preventOverflow,a=fn(t,{elementContext:"reference"}),s=fn(t,{altBoundary:!0}),l=pn(a,i),c=pn(s,r,o),u=_n(l),f=_n(c);t.modifiersData[n]={referenceClippingOffsets:l,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:f},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":f})}};var gn={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.offset,o=void 0===r?[0,0]:r,a=lt.reduce((function(e,n){return e[n]=function(e,t,n){var i=At(e),r=[Je,Ye].indexOf(i)>=0?-1:1,o="function"==typeof n?n(Object.assign({},t,{placement:e})):n,a=o[0],s=o[1];return a=a||0,s=(s||0)*r,[Je,Ge].indexOf(i)>=0?{x:s,y:a}:{x:a,y:s}}(n,t.rects,o),e}),{}),s=a[t.placement],l=s.x,c=s.y;null!=t.modifiersData.popperOffsets&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=c),t.modifiersData[i]=a}};var mn={name:"popperOffsets",enabled:!0,phase:"read",fn:function(e){var t=e.state,n=e.name;t.modifiersData[n]=un({reference:t.rects.reference,element:t.rects.popper,strategy:"absolute",placement:t.placement})},data:{}};var yn={name:"preventOverflow",enabled:!0,phase:"main",fn:function(e){var t=e.state,n=e.options,i=e.name,r=n.mainAxis,o=void 0===r||r,a=n.altAxis,s=void 0!==a&&a,l=n.boundary,c=n.rootBoundary,u=n.altBoundary,f=n.padding,d=n.tether,h=void 0===d||d,p=n.tetherOffset,_=void 0===p?0:p,v=fn(t,{boundary:l,rootBoundary:c,padding:f,altBoundary:u}),g=At(t.placement),m=Kt(t.placement),y=!m,b=Wt(g),k="x"===b?"y":"x",w=t.modifiersData.popperOffsets,C=t.rects.reference,O=t.rects.popper,A="function"==typeof _?_(Object.assign({},t.rects,{placement:t.placement})):_,E="number"==typeof A?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),T=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,S={x:0,y:0};if(w){if(o){var x,I="y"===b?Ye:Je,P="y"===b?$e:Ge,L="y"===b?"height":"width",j=w[b],D=j+v[I],N=j-v[P],M=h?-O[L]/2:0,F=m===tt?C[L]:O[L],H=m===tt?-O[L]:-C[L],R=t.elements.arrow,W=h&&R?Lt(R):{width:0,height:0},B=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:{top:0,right:0,bottom:0,left:0},z=B[I],q=B[P],V=Bt(0,C[L],W[L]),K=y?C[L]/2-M-V-z-E.mainAxis:F-V-z-E.mainAxis,Q=y?-C[L]/2+M+V+q+E.mainAxis:H+V+q+E.mainAxis,U=t.elements.arrow&&Rt(t.elements.arrow),X=U?"y"===b?U.clientTop||0:U.clientLeft||0:0,Y=null!=(x=null==T?void 0:T[b])?x:0,$=j+Q-Y,G=Bt(h?Tt(D,j+K-Y-X):D,j,h?Et(N,$):N);w[b]=G,S[b]=G-j}if(s){var J,Z="x"===b?Ye:Je,ee="x"===b?$e:Ge,te=w[k],ne="y"===k?"height":"width",ie=te+v[Z],re=te-v[ee],oe=-1!==[Ye,Je].indexOf(g),ae=null!=(J=null==T?void 0:T[k])?J:0,se=oe?ie:te-C[ne]-O[ne]-ae+E.altAxis,le=oe?te+C[ne]+O[ne]-ae-E.altAxis:re,ce=h&&oe?function(e,t,n){var i=Bt(e,t,n);return i>n?n:i}(se,te,le):Bt(h?se:ie,te,h?le:re);w[k]=ce,S[k]=ce-te}t.modifiersData[i]=S}},requiresIfExists:["offset"]};function bn(e,t,n){void 0===n&&(n=!1);var i,r,o=wt(t),a=wt(t)&&function(e){var t=e.getBoundingClientRect(),n=St(t.width)/e.offsetWidth||1,i=St(t.height)/e.offsetHeight||1;return 1!==n||1!==i}(t),s=Mt(t),l=Pt(e,a,n),c={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(o||!o&&!n)&&(("body"!==yt(t)||rn(s))&&(c=(i=t)!==bt(i)&&wt(i)?{scrollLeft:(r=i).scrollLeft,scrollTop:r.scrollTop}:tn(i)),wt(t)?((u=Pt(t,!0)).x+=t.clientLeft,u.y+=t.clientTop):s&&(u.x=nn(s))),{x:l.left+c.scrollLeft-u.x,y:l.top+c.scrollTop-u.y,width:l.width,height:l.height}}function kn(e){var t=new Map,n=new Set,i=[];function r(e){n.add(e.name),[].concat(e.requires||[],e.requiresIfExists||[]).forEach((function(e){if(!n.has(e)){var i=t.get(e);i&&r(i)}})),i.push(e)}return e.forEach((function(e){t.set(e.name,e)})),e.forEach((function(e){n.has(e.name)||r(e)})),i}var wn={placement:"bottom",modifiers:[],strategy:"absolute"};function Cn(){for(var e=arguments.length,t=new Array(e),n=0;n0}},{key:"_disableOverFlow",value:function(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}},{key:"_setElementAttributes",value:function(e,t,n){var i=this,r=this.getWidth();this._applyManipulationCallback(e,(function(e){if(!(e!==i._element&&window.innerWidth>e.clientWidth+r)){i._saveInitialAttribute(e,t);var o=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,"".concat(n(Number.parseFloat(o)),"px"))}}))}},{key:"_saveInitialAttribute",value:function(e,t){var n=e.style.getPropertyValue(t);n&&W(e,t,n)}},{key:"_resetElementAttributes",value:function(e,t){this._applyManipulationCallback(e,(function(e){var n=q(e,t);null!==n?(B(e,t),e.style.setProperty(t,n)):e.style.removeProperty(t)}))}},{key:"_applyManipulationCallback",value:function(e,t){if(s(e))t(e);else{var n,i=_createForOfIteratorHelper(U.find(e,this._element));try{for(i.s();!(n=i.n()).done;){t(n.value)}}catch(e){i.e(e)}finally{i.f()}}}}])}(),mi=".".concat("bs.modal"),yi="hide".concat(mi),bi="hidePrevented".concat(mi),ki="hidden".concat(mi),wi="show".concat(mi),Ci="shown".concat(mi),Oi="resize".concat(mi),Ai="click.dismiss".concat(mi),Ei="mousedown.dismiss".concat(mi),Ti="keydown.dismiss".concat(mi),Si="click".concat(mi).concat(".data-api"),xi="modal-open",Ii="show",Pi="modal-static",Li={backdrop:!0,focus:!0,keyboard:!0},ji={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"},Di=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._dialog=U.findOne(".modal-dialog",i._element),i._backdrop=i._initializeBackDrop(),i._focustrap=i._initializeFocusTrap(),i._isShown=!1,i._isTransitioning=!1,i._scrollBar=new gi,i._addEventListeners(),i}return _inherits(t,e),_createClass(t,[{key:"toggle",value:function(e){return this._isShown?this.hide():this.show(e)}},{key:"show",value:function(e){var t=this;this._isShown||this._isTransitioning||(M.trigger(this._element,wi,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(xi),this._adjustDialog(),this._backdrop.show((function(){return t._showElement(e)}))))}},{key:"hide",value:function(){var e=this;this._isShown&&!this._isTransitioning&&(M.trigger(this._element,yi).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Ii),this._queueCallback((function(){return e._hideModal()}),this._element,this._isAnimated())))}},{key:"dispose",value:function(){M.off(window,mi),M.off(this._dialog,mi),this._backdrop.dispose(),this._focustrap.deactivate(),_get(_getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"handleUpdate",value:function(){this._adjustDialog()}},{key:"_initializeBackDrop",value:function(){return new oi({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}},{key:"_initializeFocusTrap",value:function(){return new di({trapElement:this._element})}},{key:"_showElement",value:function(e){var t=this;document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;var n=U.findOne(".modal-body",this._dialog);n&&(n.scrollTop=0),h(this._element),this._element.classList.add(Ii);this._queueCallback((function(){t._config.focus&&t._focustrap.activate(),t._isTransitioning=!1,M.trigger(t._element,Ci,{relatedTarget:e})}),this._dialog,this._isAnimated())}},{key:"_addEventListeners",value:function(){var e=this;M.on(this._element,Ti,(function(t){"Escape"===t.key&&(e._config.keyboard?e.hide():e._triggerBackdropTransition())})),M.on(window,Oi,(function(){e._isShown&&!e._isTransitioning&&e._adjustDialog()})),M.on(this._element,Ei,(function(t){M.one(e._element,Ai,(function(n){e._element===t.target&&e._element===n.target&&("static"!==e._config.backdrop?e._config.backdrop&&e.hide():e._triggerBackdropTransition())}))}))}},{key:"_hideModal",value:function(){var e=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((function(){document.body.classList.remove(xi),e._resetAdjustments(),e._scrollBar.reset(),M.trigger(e._element,ki)}))}},{key:"_isAnimated",value:function(){return this._element.classList.contains("fade")}},{key:"_triggerBackdropTransition",value:function(){var e=this;if(!M.trigger(this._element,bi).defaultPrevented){var t=this._element.scrollHeight>document.documentElement.clientHeight,n=this._element.style.overflowY;"hidden"===n||this._element.classList.contains(Pi)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(Pi),this._queueCallback((function(){e._element.classList.remove(Pi),e._queueCallback((function(){e._element.style.overflowY=n}),e._dialog)}),this._dialog),this._element.focus())}}},{key:"_adjustDialog",value:function(){var e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){var i=v()?"paddingLeft":"paddingRight";this._element.style[i]="".concat(t,"px")}if(!n&&e){var r=v()?"paddingRight":"paddingLeft";this._element.style[r]="".concat(t,"px")}}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}}],[{key:"Default",get:function(){return Li}},{key:"DefaultType",get:function(){return ji}},{key:"NAME",get:function(){return"modal"}},{key:"jQueryInterface",value:function(e,n){return this.each((function(){var i=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===i[e])throw new TypeError('No method named "'.concat(e,'"'));i[e](n)}}))}}])}(K);M.on(document,Si,'[data-bs-toggle="modal"]',(function(e){var t=this,n=U.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),M.one(n,wi,(function(e){e.defaultPrevented||M.one(n,ki,(function(){c(t)&&t.focus()}))}));var i=U.findOne(".modal.show");i&&Di.getInstance(i).hide(),Di.getOrCreateInstance(n).toggle(this)})),X(Di),g(Di);var Ni=".".concat("bs.offcanvas"),Mi=".data-api",Fi="load".concat(Ni).concat(Mi),Hi="show",Ri="showing",Wi="hiding",Bi=".offcanvas.show",zi="show".concat(Ni),qi="shown".concat(Ni),Vi="hide".concat(Ni),Ki="hidePrevented".concat(Ni),Qi="hidden".concat(Ni),Ui="resize".concat(Ni),Xi="click".concat(Ni).concat(Mi),Yi="keydown.dismiss".concat(Ni),$i={backdrop:!0,keyboard:!0,scroll:!1},Gi={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"},Ji=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._isShown=!1,i._backdrop=i._initializeBackDrop(),i._focustrap=i._initializeFocusTrap(),i._addEventListeners(),i}return _inherits(t,e),_createClass(t,[{key:"toggle",value:function(e){return this._isShown?this.hide():this.show(e)}},{key:"show",value:function(e){var t=this;if(!this._isShown&&!M.trigger(this._element,zi,{relatedTarget:e}).defaultPrevented){this._isShown=!0,this._backdrop.show(),this._config.scroll||(new gi).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(Ri);this._queueCallback((function(){t._config.scroll&&!t._config.backdrop||t._focustrap.activate(),t._element.classList.add(Hi),t._element.classList.remove(Ri),M.trigger(t._element,qi,{relatedTarget:e})}),this._element,!0)}}},{key:"hide",value:function(){var e=this;if(this._isShown&&!M.trigger(this._element,Vi).defaultPrevented){this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(Wi),this._backdrop.hide();this._queueCallback((function(){e._element.classList.remove(Hi,Wi),e._element.removeAttribute("aria-modal"),e._element.removeAttribute("role"),e._config.scroll||(new gi).reset(),M.trigger(e._element,Qi)}),this._element,!0)}}},{key:"dispose",value:function(){this._backdrop.dispose(),this._focustrap.deactivate(),_get(_getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"_initializeBackDrop",value:function(){var e=this,t=Boolean(this._config.backdrop);return new oi({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?function(){"static"!==e._config.backdrop?e.hide():M.trigger(e._element,Ki)}:null})}},{key:"_initializeFocusTrap",value:function(){return new di({trapElement:this._element})}},{key:"_addEventListeners",value:function(){var e=this;M.on(this._element,Yi,(function(t){"Escape"===t.key&&(e._config.keyboard?e.hide():M.trigger(e._element,Ki))}))}}],[{key:"Default",get:function(){return $i}},{key:"DefaultType",get:function(){return Gi}},{key:"NAME",get:function(){return"offcanvas"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));n[e](this)}}))}}])}(K);M.on(document,Xi,'[data-bs-toggle="offcanvas"]',(function(e){var t=this,n=U.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),!u(this)){M.one(n,Qi,(function(){c(t)&&t.focus()}));var i=U.findOne(Bi);i&&i!==n&&Ji.getInstance(i).hide(),Ji.getOrCreateInstance(n).toggle(this)}})),M.on(window,Fi,(function(){var e,t=_createForOfIteratorHelper(U.find(Bi));try{for(t.s();!(e=t.n()).done;){var n=e.value;Ji.getOrCreateInstance(n).show()}}catch(e){t.e(e)}finally{t.f()}})),M.on(window,Ui,(function(){var e,t=_createForOfIteratorHelper(U.find("[aria-modal][class*=show][class*=offcanvas-]"));try{for(t.s();!(e=t.n()).done;){var n=e.value;"fixed"!==getComputedStyle(n).position&&Ji.getOrCreateInstance(n).hide()}}catch(e){t.e(e)}finally{t.f()}})),X(Ji),g(Ji);var Zi={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},er=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),tr=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,nr=function(e,t){var n=e.nodeName.toLowerCase();return t.includes(n)?!er.has(n)||Boolean(tr.test(e.nodeValue)):t.filter((function(e){return e instanceof RegExp})).some((function(e){return e.test(n)}))};var ir={allowList:Zi,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
    "},rr={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},or={entry:"(string|element|function|null)",selector:"(string|element)"},ar=function(e){function t(e){var n;return _classCallCheck(this,t),(n=_callSuper(this,t))._config=n._getConfig(e),n}return _inherits(t,e),_createClass(t,[{key:"getContent",value:function(){var e=this;return Object.values(this._config.content).map((function(t){return e._resolvePossibleFunction(t)})).filter(Boolean)}},{key:"hasContent",value:function(){return this.getContent().length>0}},{key:"changeContent",value:function(e){return this._checkContent(e),this._config.content=_objectSpread(_objectSpread({},this._config.content),e),this}},{key:"toHtml",value:function(){var e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(var t=0,n=Object.entries(this._config.content);t
    ',title:"",trigger:"hover focus"},vr={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"},gr=function(e){function t(e,n){var i;if(_classCallCheck(this,t),void 0===Sn)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");return(i=_callSuper(this,t,[e,n]))._isEnabled=!0,i._timeout=0,i._isHovered=null,i._activeTrigger={},i._popper=null,i._templateFactory=null,i._newContent=null,i.tip=null,i._setListeners(),i._config.selector||i._fixTitle(),i}return _inherits(t,e),_createClass(t,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}},{key:"dispose",value:function(){clearTimeout(this._timeout),M.off(this._element.closest(ur),fr,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),_get(_getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"show",value:function(){var e=this;if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(this._isWithContent()&&this._isEnabled){var t=M.trigger(this._element,this.constructor.eventName("show")),n=(f(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(!t.defaultPrevented&&n){this._disposePopper();var i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));var r=this._config.container;if(this._element.ownerDocument.documentElement.contains(this.tip)||(r.append(i),M.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(cr),"ontouchstart"in document.documentElement){var o,a,s=_createForOfIteratorHelper((o=[]).concat.apply(o,_toConsumableArray(document.body.children)));try{for(s.s();!(a=s.n()).done;){var l=a.value;M.on(l,"mouseover",d)}}catch(e){s.e(e)}finally{s.f()}}this._queueCallback((function(){M.trigger(e._element,e.constructor.eventName("shown")),!1===e._isHovered&&e._leave(),e._isHovered=!1}),this.tip,this._isAnimated())}}}},{key:"hide",value:function(){var e=this;if(this._isShown()&&!M.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(cr),"ontouchstart"in document.documentElement){var t,n,i=_createForOfIteratorHelper((t=[]).concat.apply(t,_toConsumableArray(document.body.children)));try{for(i.s();!(n=i.n()).done;){var r=n.value;M.off(r,"mouseover",d)}}catch(e){i.e(e)}finally{i.f()}}this._activeTrigger.click=!1,this._activeTrigger[hr]=!1,this._activeTrigger[dr]=!1,this._isHovered=null;this._queueCallback((function(){e._isWithActiveTrigger()||(e._isHovered||e._disposePopper(),e._element.removeAttribute("aria-describedby"),M.trigger(e._element,e.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}}},{key:"update",value:function(){this._popper&&this._popper.update()}},{key:"_isWithContent",value:function(){return Boolean(this._getTitle())}},{key:"_getTipElement",value:function(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}},{key:"_createTipElement",value:function(e){var t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(lr,cr),t.classList.add("bs-".concat(this.constructor.NAME,"-auto"));var n=function(e){do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e}(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(lr),t}},{key:"setContent",value:function(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}},{key:"_getTemplateFactory",value:function(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new ar(_objectSpread(_objectSpread({},this._config),{},{content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)})),this._templateFactory}},{key:"_getContentForTemplate",value:function(){return _defineProperty({},".tooltip-inner",this._getTitle())}},{key:"_getTitle",value:function(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}},{key:"_initializeOnDelegatedTarget",value:function(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}},{key:"_isAnimated",value:function(){return this._config.animation||this.tip&&this.tip.classList.contains(lr)}},{key:"_isShown",value:function(){return this.tip&&this.tip.classList.contains(cr)}},{key:"_createPopper",value:function(e){var t=m(this._config.placement,[this,e,this._element]),n=pr[t.toUpperCase()];return Tn(this._element,e,this._getPopperConfig(n))}},{key:"_getOffset",value:function(){var e=this,t=this._config.offset;return"string"==typeof t?t.split(",").map((function(e){return Number.parseInt(e,10)})):"function"==typeof t?function(n){return t(n,e._element)}:t}},{key:"_resolvePossibleFunction",value:function(e){return m(e,[this._element])}},{key:"_getPopperConfig",value:function(e){var t=this,n={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:".".concat(this.constructor.NAME,"-arrow")}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:function(e){t._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return _objectSpread(_objectSpread({},n),m(this._config.popperConfig,[n]))}},{key:"_setListeners",value:function(){var e,t=this,n=_createForOfIteratorHelper(this._config.trigger.split(" "));try{for(n.s();!(e=n.n()).done;){var i=e.value;if("click"===i)M.on(this._element,this.constructor.eventName("click"),this._config.selector,(function(e){t._initializeOnDelegatedTarget(e).toggle()}));else if("manual"!==i){var r=i===dr?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),o=i===dr?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");M.on(this._element,r,this._config.selector,(function(e){var n=t._initializeOnDelegatedTarget(e);n._activeTrigger["focusin"===e.type?hr:dr]=!0,n._enter()})),M.on(this._element,o,this._config.selector,(function(e){var n=t._initializeOnDelegatedTarget(e);n._activeTrigger["focusout"===e.type?hr:dr]=n._element.contains(e.relatedTarget),n._leave()}))}}}catch(e){n.e(e)}finally{n.f()}this._hideModalHandler=function(){t._element&&t.hide()},M.on(this._element.closest(ur),fr,this._hideModalHandler)}},{key:"_fixTitle",value:function(){var e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}},{key:"_enter",value:function(){var e=this;this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((function(){e._isHovered&&e.show()}),this._config.delay.show))}},{key:"_leave",value:function(){var e=this;this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((function(){e._isHovered||e.hide()}),this._config.delay.hide))}},{key:"_setTimeout",value:function(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}},{key:"_isWithActiveTrigger",value:function(){return Object.values(this._activeTrigger).includes(!0)}},{key:"_getConfig",value:function(e){for(var t=z(this._element),n=0,i=Object.keys(t);n

    ',trigger:"click"}),yr=_objectSpread(_objectSpread({},gr.DefaultType),{},{content:"(null|string|element|function)"}),br=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"_isWithContent",value:function(){return this._getTitle()||this._getContent()}},{key:"_getContentForTemplate",value:function(){return _defineProperty(_defineProperty({},".popover-header",this._getTitle()),".popover-body",this._getContent())}},{key:"_getContent",value:function(){return this._resolvePossibleFunction(this._config.content)}}],[{key:"Default",get:function(){return mr}},{key:"DefaultType",get:function(){return yr}},{key:"NAME",get:function(){return"popover"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}))}}])}(gr);g(br);var kr=".".concat("bs.scrollspy"),wr="activate".concat(kr),Cr="click".concat(kr),Or="load".concat(kr).concat(".data-api"),Ar="active",Er="[href]",Tr=".nav-link",Sr="".concat(Tr,", ").concat(".nav-item"," > ").concat(Tr,", ").concat(".list-group-item"),xr={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},Ir={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"},Pr=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._targetLinks=new Map,i._observableSections=new Map,i._rootElement="visible"===getComputedStyle(i._element).overflowY?null:i._element,i._activeTarget=null,i._observer=null,i._previousScrollData={visibleEntryTop:0,parentScrollTop:0},i.refresh(),i}return _inherits(t,e),_createClass(t,[{key:"refresh",value:function(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();var e,t=_createForOfIteratorHelper(this._observableSections.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;this._observer.observe(n)}}catch(e){t.e(e)}finally{t.f()}}},{key:"dispose",value:function(){this._observer.disconnect(),_get(_getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"_configAfterMerge",value:function(e){return e.target=l(e.target)||document.body,e.rootMargin=e.offset?"".concat(e.offset,"px 0px -30%"):e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map((function(e){return Number.parseFloat(e)}))),e}},{key:"_maybeEnableSmoothScroll",value:function(){var e=this;this._config.smoothScroll&&(M.off(this._config.target,Cr),M.on(this._config.target,Cr,Er,(function(t){var n=e._observableSections.get(t.target.hash);if(n){t.preventDefault();var i=e._rootElement||window,r=n.offsetTop-e._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:r,behavior:"smooth"});i.scrollTop=r}})))}},{key:"_getNewObserver",value:function(){var e=this,t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((function(t){return e._observerCallback(t)}),t)}},{key:"_observerCallback",value:function(e){var t=this,n=function(e){return t._targetLinks.get("#".concat(e.target.id))},i=function(e){t._previousScrollData.visibleEntryTop=e.target.offsetTop,t._process(n(e))},r=(this._rootElement||document.documentElement).scrollTop,o=r>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=r;var a,s=_createForOfIteratorHelper(e);try{for(s.s();!(a=s.n()).done;){var l=a.value;if(l.isIntersecting){var c=l.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&c){if(i(l),!r)return}else o||c||i(l)}else this._activeTarget=null,this._clearActiveClass(n(l))}}catch(e){s.e(e)}finally{s.f()}}},{key:"_initializeTargetsAndObservables",value:function(){this._targetLinks=new Map,this._observableSections=new Map;var e,t=_createForOfIteratorHelper(U.find(Er,this._config.target));try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.hash&&!u(n)){var i=U.findOne(decodeURI(n.hash),this._element);c(i)&&(this._targetLinks.set(decodeURI(n.hash),n),this._observableSections.set(n.hash,i))}}}catch(e){t.e(e)}finally{t.f()}}},{key:"_process",value:function(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Ar),this._activateParents(e),M.trigger(this._element,wr,{relatedTarget:e}))}},{key:"_activateParents",value:function(e){if(e.classList.contains("dropdown-item"))U.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(Ar);else{var t,n=_createForOfIteratorHelper(U.parents(e,".nav, .list-group"));try{for(n.s();!(t=n.n()).done;){var i,r=t.value,o=_createForOfIteratorHelper(U.prev(r,Sr));try{for(o.s();!(i=o.n()).done;){i.value.classList.add(Ar)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}}}},{key:"_clearActiveClass",value:function(e){e.classList.remove(Ar);var t,n=_createForOfIteratorHelper(U.find("".concat(Er,".").concat(Ar),e));try{for(n.s();!(t=n.n()).done;){t.value.classList.remove(Ar)}}catch(e){n.e(e)}finally{n.f()}}}],[{key:"Default",get:function(){return xr}},{key:"DefaultType",get:function(){return Ir}},{key:"NAME",get:function(){return"scrollspy"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}))}}])}(K);M.on(window,Or,(function(){var e,t=_createForOfIteratorHelper(U.find('[data-bs-spy="scroll"]'));try{for(t.s();!(e=t.n()).done;){var n=e.value;Pr.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),g(Pr);var Lr=".".concat("bs.tab"),jr="hide".concat(Lr),Dr="hidden".concat(Lr),Nr="show".concat(Lr),Mr="shown".concat(Lr),Fr="click".concat(Lr),Hr="keydown".concat(Lr),Rr="load".concat(Lr),Wr="ArrowLeft",Br="ArrowRight",zr="ArrowUp",qr="ArrowDown",Vr="Home",Kr="End",Qr="active",Ur="fade",Xr="show",Yr=".dropdown-toggle",$r=":not(".concat(Yr,")"),Gr=".nav-link".concat($r,", .list-group-item").concat($r,', [role="tab"]').concat($r),Jr='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Zr="".concat(Gr,", ").concat(Jr),eo=".".concat(Qr,'[data-bs-toggle="tab"], .').concat(Qr,'[data-bs-toggle="pill"], .').concat(Qr,'[data-bs-toggle="list"]'),to=function(e){function t(e){var n;return _classCallCheck(this,t),(n=_callSuper(this,t,[e]))._parent=n._element.closest('.list-group, .nav, [role="tablist"]'),n._parent?(n._setInitialAttributes(n._parent,n._getChildren()),M.on(n._element,Hr,(function(e){return n._keydown(e)})),n):_possibleConstructorReturn(n)}return _inherits(t,e),_createClass(t,[{key:"show",value:function(){var e=this._element;if(!this._elemIsActive(e)){var t=this._getActiveElem(),n=t?M.trigger(t,jr,{relatedTarget:e}):null;M.trigger(e,Nr,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}}},{key:"_activate",value:function(e,t){var n=this;if(e){e.classList.add(Qr),this._activate(U.getElementFromSelector(e));this._queueCallback((function(){"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),n._toggleDropDown(e,!0),M.trigger(e,Mr,{relatedTarget:t})):e.classList.add(Xr)}),e,e.classList.contains(Ur))}}},{key:"_deactivate",value:function(e,t){var n=this;if(e){e.classList.remove(Qr),e.blur(),this._deactivate(U.getElementFromSelector(e));this._queueCallback((function(){"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),n._toggleDropDown(e,!1),M.trigger(e,Dr,{relatedTarget:t})):e.classList.remove(Xr)}),e,e.classList.contains(Ur))}}},{key:"_keydown",value:function(e){if([Wr,Br,zr,qr,Vr,Kr].includes(e.key)){e.stopPropagation(),e.preventDefault();var n,i=this._getChildren().filter((function(e){return!u(e)}));if([Vr,Kr].includes(e.key))n=i[e.key===Vr?0:i.length-1];else{var r=[Br,qr].includes(e.key);n=b(i,e.target,r,!0)}n&&(n.focus({preventScroll:!0}),t.getOrCreateInstance(n).show())}}},{key:"_getChildren",value:function(){return U.find(Zr,this._parent)}},{key:"_getActiveElem",value:function(){var e=this;return this._getChildren().find((function(t){return e._elemIsActive(t)}))||null}},{key:"_setInitialAttributes",value:function(e,t){this._setAttributeIfNotExists(e,"role","tablist");var n,i=_createForOfIteratorHelper(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;this._setInitialAttributesOnChild(r)}}catch(e){i.e(e)}finally{i.f()}}},{key:"_setInitialAttributesOnChild",value:function(e){e=this._getInnerElement(e);var t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}},{key:"_setInitialAttributesOnTargetPanel",value:function(e){var t=U.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby","".concat(e.id)))}},{key:"_toggleDropDown",value:function(e,t){var n=this._getOuterElement(e);if(n.classList.contains("dropdown")){var i=function(e,i){var r=U.findOne(e,n);r&&r.classList.toggle(i,t)};i(Yr,Qr),i(".dropdown-menu",Xr),n.setAttribute("aria-expanded",t)}}},{key:"_setAttributeIfNotExists",value:function(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}},{key:"_elemIsActive",value:function(e){return e.classList.contains(Qr)}},{key:"_getInnerElement",value:function(e){return e.matches(Zr)?e:U.findOne(Zr,e)}},{key:"_getOuterElement",value:function(e){return e.closest(".nav-item, .list-group-item")||e}}],[{key:"NAME",get:function(){return"tab"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this);if("string"==typeof e){if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}))}}])}(K);M.on(document,Fr,Jr,(function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),u(this)||to.getOrCreateInstance(this).show()})),M.on(window,Rr,(function(){var e,t=_createForOfIteratorHelper(U.find(eo));try{for(t.s();!(e=t.n()).done;){var n=e.value;to.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),g(to);var no=".".concat("bs.toast"),io="mouseover".concat(no),ro="mouseout".concat(no),oo="focusin".concat(no),ao="focusout".concat(no),so="hide".concat(no),lo="hidden".concat(no),co="show".concat(no),uo="shown".concat(no),fo="hide",ho="show",po="showing",_o={animation:"boolean",autohide:"boolean",delay:"number"},vo={animation:!0,autohide:!0,delay:5e3},go=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._timeout=null,i._hasMouseInteraction=!1,i._hasKeyboardInteraction=!1,i._setListeners(),i}return _inherits(t,e),_createClass(t,[{key:"show",value:function(){var e=this;if(!M.trigger(this._element,co).defaultPrevented){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(fo),h(this._element),this._element.classList.add(ho,po),this._queueCallback((function(){e._element.classList.remove(po),M.trigger(e._element,uo),e._maybeScheduleHide()}),this._element,this._config.animation)}}},{key:"hide",value:function(){var e=this;if(this.isShown()&&!M.trigger(this._element,so).defaultPrevented){this._element.classList.add(po),this._queueCallback((function(){e._element.classList.add(fo),e._element.classList.remove(po,ho),M.trigger(e._element,lo)}),this._element,this._config.animation)}}},{key:"dispose",value:function(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(ho),_get(_getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"isShown",value:function(){return this._element.classList.contains(ho)}},{key:"_maybeScheduleHide",value:function(){var e=this;this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((function(){e.hide()}),this._config.delay)))}},{key:"_onInteraction",value:function(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)this._clearTimeout();else{var n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}}},{key:"_setListeners",value:function(){var e=this;M.on(this._element,io,(function(t){return e._onInteraction(t,!0)})),M.on(this._element,ro,(function(t){return e._onInteraction(t,!1)})),M.on(this._element,oo,(function(t){return e._onInteraction(t,!0)})),M.on(this._element,ao,(function(t){return e._onInteraction(t,!1)}))}},{key:"_clearTimeout",value:function(){clearTimeout(this._timeout),this._timeout=null}}],[{key:"Default",get:function(){return vo}},{key:"DefaultType",get:function(){return _o}},{key:"NAME",get:function(){return"toast"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e](this)}}))}}])}(K);return X(go),g(go),{Alert:J,Button:ne,Carousel:De,Collapse:Xe,Dropdown:Zn,Modal:Di,Offcanvas:Ji,Popover:br,ScrollSpy:Pr,Tab:to,Toast:go,Tooltip:gr}})); diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.js b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.js index c209d82bd47..cb4ef071f15 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.js +++ b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.js @@ -5,13 +5,13 @@ function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } +function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -29,8 +29,8 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } /*! * Bootstrap v5.3.3 (https://getbootstrap.com/) @@ -42,7 +42,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == })(this, function (Popper) { 'use strict'; - var _KEY_TO_DIRECTION; function _interopNamespaceDefault(e) { var n = Object.create(null, _defineProperty({}, Symbol.toStringTag, { value: 'Module' @@ -270,7 +269,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == var reflow = function reflow(element) { element.offsetHeight; // eslint-disable-line no-unused-expressions }; - var getjQuery = function getjQuery() { if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) { return window.jQuery; @@ -706,7 +704,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == function Config() { _classCallCheck(this, Config); } - _createClass(Config, [{ + return _createClass(Config, [{ key: "_getConfig", value: function _getConfig(config) { config = this._mergeConfigObj(config); @@ -759,7 +757,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == throw new Error('You have to implement the static method "NAME", for each component!'); } }]); - return Config; }(); /** * -------------------------------------------------------------------------- @@ -776,24 +773,23 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var BaseComponent = /*#__PURE__*/function (_Config) { - _inherits(BaseComponent, _Config); - var _super = _createSuper(BaseComponent); function BaseComponent(element, config) { var _this; _classCallCheck(this, BaseComponent); - _this = _super.call(this); + _this = _callSuper(this, BaseComponent); element = getElement(element); if (!element) { return _possibleConstructorReturn(_this); } _this._element = element; _this._config = _this._getConfig(config); - Data.set(_this._element, _this.constructor.DATA_KEY, _assertThisInitialized(_this)); + Data.set(_this._element, _this.constructor.DATA_KEY, _this); return _this; } // Public - _createClass(BaseComponent, [{ + _inherits(BaseComponent, _Config); + return _createClass(BaseComponent, [{ key: "dispose", value: function dispose() { Data.remove(this._element, this.constructor.DATA_KEY); @@ -859,7 +855,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return "".concat(name).concat(this.EVENT_KEY); } }]); - return BaseComponent; }(Config); /** * -------------------------------------------------------------------------- @@ -1010,13 +1005,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Alert = /*#__PURE__*/function (_BaseComponent) { - _inherits(Alert, _BaseComponent); - var _super2 = _createSuper(Alert); function Alert() { _classCallCheck(this, Alert); - return _super2.apply(this, arguments); + return _callSuper(this, Alert, arguments); } - _createClass(Alert, [{ + _inherits(Alert, _BaseComponent); + return _createClass(Alert, [{ key: "close", value: // Public @@ -1065,7 +1059,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Alert; }(BaseComponent); /** * Data API implementation @@ -1101,13 +1094,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Button = /*#__PURE__*/function (_BaseComponent2) { - _inherits(Button, _BaseComponent2); - var _super3 = _createSuper(Button); function Button() { _classCallCheck(this, Button); - return _super3.apply(this, arguments); + return _callSuper(this, Button, arguments); } - _createClass(Button, [{ + _inherits(Button, _BaseComponent2); + return _createClass(Button, [{ key: "toggle", value: // Public @@ -1135,7 +1127,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Button; }(BaseComponent); /** * Data API implementation @@ -1190,12 +1181,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Swipe = /*#__PURE__*/function (_Config2) { - _inherits(Swipe, _Config2); - var _super4 = _createSuper(Swipe); function Swipe(element, config) { var _this3; _classCallCheck(this, Swipe); - _this3 = _super4.call(this); + _this3 = _callSuper(this, Swipe); _this3._element = element; if (!element || !Swipe.isSupported()) { return _possibleConstructorReturn(_this3); @@ -1208,7 +1197,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Swipe, [{ + _inherits(Swipe, _Config2); + return _createClass(Swipe, [{ key: "dispose", value: // Public @@ -1308,7 +1298,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; } }]); - return Swipe; }(Config); /** * -------------------------------------------------------------------------- @@ -1353,7 +1342,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == var SELECTOR_INDICATORS = '.carousel-indicators'; var SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; var SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; - var KEY_TO_DIRECTION = (_KEY_TO_DIRECTION = {}, _defineProperty(_KEY_TO_DIRECTION, ARROW_LEFT_KEY$1, DIRECTION_RIGHT), _defineProperty(_KEY_TO_DIRECTION, ARROW_RIGHT_KEY$1, DIRECTION_LEFT), _KEY_TO_DIRECTION); + var KEY_TO_DIRECTION = _defineProperty(_defineProperty({}, ARROW_LEFT_KEY$1, DIRECTION_RIGHT), ARROW_RIGHT_KEY$1, DIRECTION_LEFT); var Default$b = { interval: 5000, keyboard: true, @@ -1376,12 +1365,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Carousel = /*#__PURE__*/function (_BaseComponent3) { - _inherits(Carousel, _BaseComponent3); - var _super5 = _createSuper(Carousel); function Carousel(element, config) { var _this5; _classCallCheck(this, Carousel); - _this5 = _super5.call(this, element, config); + _this5 = _callSuper(this, Carousel, [element, config]); _this5._interval = null; _this5._activeElement = null; _this5._isSliding = false; @@ -1396,7 +1383,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Carousel, [{ + _inherits(Carousel, _BaseComponent3); + return _createClass(Carousel, [{ key: "next", value: // Public @@ -1730,7 +1718,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Carousel; }(BaseComponent); /** * Data API implementation @@ -1821,12 +1808,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Collapse = /*#__PURE__*/function (_BaseComponent4) { - _inherits(Collapse, _BaseComponent4); - var _super6 = _createSuper(Collapse); function Collapse(element, config) { var _this12; _classCallCheck(this, Collapse); - _this12 = _super6.call(this, element, config); + _this12 = _callSuper(this, Collapse, [element, config]); _this12._isTransitioning = false; _this12._triggerArray = []; var toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4); @@ -1859,7 +1844,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Collapse, [{ + _inherits(Collapse, _BaseComponent4); + return _createClass(Collapse, [{ key: "toggle", value: // Public @@ -2074,7 +2060,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Collapse; }(BaseComponent); /** * Data API implementation @@ -2175,12 +2160,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Dropdown = /*#__PURE__*/function (_BaseComponent5) { - _inherits(Dropdown, _BaseComponent5); - var _super7 = _createSuper(Dropdown); function Dropdown(element, config) { var _this15; _classCallCheck(this, Dropdown); - _this15 = _super7.call(this, element, config); + _this15 = _callSuper(this, Dropdown, [element, config]); _this15._popper = null; _this15._parent = _this15._element.parentNode; // dropdown wrapper // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ @@ -2190,7 +2173,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Dropdown, [{ + _inherits(Dropdown, _BaseComponent5); + return _createClass(Dropdown, [{ key: "toggle", value: // Public @@ -2527,7 +2511,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } } }]); - return Dropdown; }(BaseComponent); /** * Data API implementation @@ -2570,7 +2553,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == // if false, we use the backdrop helper without adding any element to the dom rootElement: 'body' // give the choice to place backdrop under different elements }; - var DefaultType$8 = { className: 'string', clickCallback: '(function|null)', @@ -2583,12 +2565,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Backdrop = /*#__PURE__*/function (_Config3) { - _inherits(Backdrop, _Config3); - var _super8 = _createSuper(Backdrop); function Backdrop(config) { var _this17; _classCallCheck(this, Backdrop); - _this17 = _super8.call(this); + _this17 = _callSuper(this, Backdrop); _this17._config = _this17._getConfig(config); _this17._isAppended = false; _this17._element = null; @@ -2596,7 +2576,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Backdrop, [{ + _inherits(Backdrop, _Config3); + return _createClass(Backdrop, [{ key: "show", value: // Public @@ -2696,7 +2677,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return NAME$9; } }]); - return Backdrop; }(Config); /** * -------------------------------------------------------------------------- @@ -2719,7 +2699,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == autofocus: true, trapElement: null // The element to trap focus inside of }; - var DefaultType$7 = { autofocus: 'boolean', trapElement: 'element' @@ -2729,12 +2708,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var FocusTrap = /*#__PURE__*/function (_Config4) { - _inherits(FocusTrap, _Config4); - var _super9 = _createSuper(FocusTrap); function FocusTrap(config) { var _this20; _classCallCheck(this, FocusTrap); - _this20 = _super9.call(this); + _this20 = _callSuper(this, FocusTrap); _this20._config = _this20._getConfig(config); _this20._isActive = false; _this20._lastTabNavDirection = null; @@ -2742,7 +2719,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(FocusTrap, [{ + _inherits(FocusTrap, _Config4); + return _createClass(FocusTrap, [{ key: "activate", value: // Public @@ -2814,7 +2792,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return NAME$8; } }]); - return FocusTrap; }(Config); /** * -------------------------------------------------------------------------- @@ -2840,7 +2817,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Public - _createClass(ScrollBarHelper, [{ + return _createClass(ScrollBarHelper, [{ key: "getWidth", value: function getWidth() { // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes @@ -2944,7 +2921,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } } }]); - return ScrollBarHelper; }(); /** * -------------------------------------------------------------------------- @@ -2993,12 +2969,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Modal = /*#__PURE__*/function (_BaseComponent6) { - _inherits(Modal, _BaseComponent6); - var _super10 = _createSuper(Modal); function Modal(element, config) { var _this23; _classCallCheck(this, Modal); - _this23 = _super10.call(this, element, config); + _this23 = _callSuper(this, Modal, [element, config]); _this23._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, _this23._element); _this23._backdrop = _this23._initializeBackDrop(); _this23._focustrap = _this23._initializeFocusTrap(); @@ -3010,7 +2984,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Modal, [{ + _inherits(Modal, _BaseComponent6); + return _createClass(Modal, [{ key: "toggle", value: // Public @@ -3259,7 +3234,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Modal; }(BaseComponent); /** * Data API implementation @@ -3344,12 +3318,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Offcanvas = /*#__PURE__*/function (_BaseComponent7) { - _inherits(Offcanvas, _BaseComponent7); - var _super11 = _createSuper(Offcanvas); function Offcanvas(element, config) { var _this31; _classCallCheck(this, Offcanvas); - _this31 = _super11.call(this, element, config); + _this31 = _callSuper(this, Offcanvas, [element, config]); _this31._isShown = false; _this31._backdrop = _this31._initializeBackDrop(); _this31._focustrap = _this31._initializeFocusTrap(); @@ -3358,7 +3330,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Offcanvas, [{ + _inherits(Offcanvas, _BaseComponent7); + return _createClass(Offcanvas, [{ key: "toggle", value: // Public @@ -3510,7 +3483,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Offcanvas; }(BaseComponent); /** * Data API implementation @@ -3737,18 +3709,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var TemplateFactory = /*#__PURE__*/function (_Config5) { - _inherits(TemplateFactory, _Config5); - var _super12 = _createSuper(TemplateFactory); function TemplateFactory(config) { var _this37; _classCallCheck(this, TemplateFactory); - _this37 = _super12.call(this); + _this37 = _callSuper(this, TemplateFactory); _this37._config = _this37._getConfig(config); return _this37; } // Getters - _createClass(TemplateFactory, [{ + _inherits(TemplateFactory, _Config5); + return _createClass(TemplateFactory, [{ key: "getContent", value: // Public @@ -3868,7 +3839,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return NAME$5; } }]); - return TemplateFactory; }(Config); /** * -------------------------------------------------------------------------- @@ -3951,15 +3921,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Tooltip = /*#__PURE__*/function (_BaseComponent8) { - _inherits(Tooltip, _BaseComponent8); - var _super13 = _createSuper(Tooltip); function Tooltip(element, config) { var _this39; _classCallCheck(this, Tooltip); if (typeof Popper__namespace === 'undefined') { throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); } - _this39 = _super13.call(this, element, config); + _this39 = _callSuper(this, Tooltip, [element, config]); // Private _this39._isEnabled = true; @@ -3980,7 +3948,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Tooltip, [{ + _inherits(Tooltip, _BaseComponent8); + return _createClass(Tooltip, [{ key: "enable", value: // Public @@ -4479,7 +4448,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Tooltip; }(BaseComponent); /** * jQuery @@ -4515,13 +4483,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Popover = /*#__PURE__*/function (_Tooltip) { - _inherits(Popover, _Tooltip); - var _super14 = _createSuper(Popover); function Popover() { _classCallCheck(this, Popover); - return _super14.apply(this, arguments); + return _callSuper(this, Popover, arguments); } - _createClass(Popover, [{ + _inherits(Popover, _Tooltip); + return _createClass(Popover, [{ key: "_isWithContent", value: // Overrides @@ -4533,8 +4500,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }, { key: "_getContentForTemplate", value: function _getContentForTemplate() { - var _ref12; - return _ref12 = {}, _defineProperty(_ref12, SELECTOR_TITLE, this._getTitle()), _defineProperty(_ref12, SELECTOR_CONTENT, this._getContent()), _ref12; + return _defineProperty(_defineProperty({}, SELECTOR_TITLE, this._getTitle()), SELECTOR_CONTENT, this._getContent()); } }, { key: "_getContent", @@ -4575,7 +4541,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Popover; }(Tooltip); /** * jQuery @@ -4632,12 +4597,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var ScrollSpy = /*#__PURE__*/function (_BaseComponent9) { - _inherits(ScrollSpy, _BaseComponent9); - var _super15 = _createSuper(ScrollSpy); function ScrollSpy(element, config) { var _this47; _classCallCheck(this, ScrollSpy); - _this47 = _super15.call(this, element, config); + _this47 = _callSuper(this, ScrollSpy, [element, config]); // this._element is the observablesContainer and config.target the menu links wrapper _this47._targetLinks = new Map(); @@ -4654,7 +4617,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(ScrollSpy, [{ + _inherits(ScrollSpy, _BaseComponent9); + return _createClass(ScrollSpy, [{ key: "refresh", value: // Public @@ -4919,7 +4883,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return ScrollSpy; }(BaseComponent); /** * Data API implementation @@ -4990,12 +4953,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Tab = /*#__PURE__*/function (_BaseComponent10) { - _inherits(Tab, _BaseComponent10); - var _super16 = _createSuper(Tab); function Tab(element) { var _this51; _classCallCheck(this, Tab); - _this51 = _super16.call(this, element); + _this51 = _callSuper(this, Tab, [element]); _this51._parent = _this51._element.closest(SELECTOR_TAB_PANEL); if (!_this51._parent) { return _possibleConstructorReturn(_this51); @@ -5012,7 +4973,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Tab, [{ + _inherits(Tab, _BaseComponent10); + return _createClass(Tab, [{ key: "show", value: // Public @@ -5239,7 +5201,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Tab; }(BaseComponent); /** * Data API implementation @@ -5318,12 +5279,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Toast = /*#__PURE__*/function (_BaseComponent11) { - _inherits(Toast, _BaseComponent11); - var _super17 = _createSuper(Toast); function Toast(element, config) { var _this55; _classCallCheck(this, Toast); - _this55 = _super17.call(this, element, config); + _this55 = _callSuper(this, Toast, [element, config]); _this55._timeout = null; _this55._hasMouseInteraction = false; _this55._hasKeyboardInteraction = false; @@ -5332,7 +5291,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Toast, [{ + _inherits(Toast, _BaseComponent11); + return _createClass(Toast, [{ key: "show", value: // Public @@ -5486,7 +5446,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Toast; }(BaseComponent); /** * Data API implementation diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.min.js b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.min.js index 3b04ea16fdf..c721be5b5e5 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/bootstrap.min.js @@ -1,6 +1,6 @@ -function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var i=_superPropBase(e,t);if(i){var r=Object.getOwnPropertyDescriptor(i,t);return r.get?r.get.call(arguments.length<3?e:n):r.value}},_get.apply(this,arguments)}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var n,i=_getPrototypeOf(e);if(t){var r=_getPrototypeOf(this).constructor;n=Reflect.construct(i,arguments,r)}else n=i.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function _objectSpread(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n0?document.querySelector(c(e)):null},d=function(e){if(!f(e)||0===e.getClientRects().length)return!1;var t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){var i=e.closest("summary");if(i&&i.parentNode!==n)return!1;if(null===i)return!1}return t},_=function(e){return!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")))},p=function e(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var n=t.getRootNode();return n instanceof ShadowRoot?n:null}return t instanceof ShadowRoot?t:t.parentNode?e(t.parentNode):null},v=function(){},g=function(e){e.offsetHeight},m=function(){return window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null},y=[],b=function(){return"rtl"===document.documentElement.dir},k=function(e){var t;t=function(){var t=m();if(t){var n=e.NAME,i=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=function(){return t.fn[n]=i,e.jQueryInterface}}},"loading"===document.readyState?(y.length||document.addEventListener("DOMContentLoaded",(function(){for(var e=0,t=y;e1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return"function"==typeof e?e.apply(void 0,_toConsumableArray(t)):n},C=function(e,t){if(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]){var n=function(e){if(!e)return 0;var t=window.getComputedStyle(e),n=t.transitionDuration,i=t.transitionDelay,r=Number.parseFloat(n),o=Number.parseFloat(i);return r||o?(n=n.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(n)+Number.parseFloat(i))):0}(t)+5,i=!1;t.addEventListener(l,(function n(r){r.target===t&&(i=!0,t.removeEventListener(l,n),w(e))})),setTimeout((function(){i||u(t)}),n)}else w(e)},A=function(e,t,n,i){var r=e.length,o=e.indexOf(t);return-1===o?!n&&i?e[r-1]:e[0]:(o+=n?1:-1,i&&(o=(o+r)%r),e[Math.max(0,Math.min(o,r-1))])},T=/[^.]*(?=\..*)\.|.*/,E=/\..*/,O=/::\d+$/,S={},I=1,P={mouseenter:"mouseover",mouseleave:"mouseout"},L=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function j(e,t){return t&&"".concat(t,"::").concat(I++)||e.uidEvent||I++}function N(e){var t=j(e);return e.uidEvent=t,S[t]=S[t]||{},S[t]}function D(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Object.values(e).find((function(e){return e.callable===t&&e.delegationSelector===n}))}function F(e,t,n){var i="string"==typeof t,r=i?n:t||n,o=z(e);return L.has(o)||(o=e),[i,r,o]}function M(e,t,n,i,r){if("string"==typeof t&&e){var o=_slicedToArray(F(t,n,i),3),a=o[0],s=o[1],l=o[2];if(t in P){s=function(e){return function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)}}(s)}var c=N(e),u=c[l]||(c[l]={}),f=D(u,s,a?n:null);if(f)f.oneOff=f.oneOff&&r;else{var h=j(s,t.replace(T,"")),d=a?function(e,t,n){return function i(r){for(var o=e.querySelectorAll(t),a=r.target;a&&a!==this;a=a.parentNode){var s,l=_createForOfIteratorHelper(o);try{for(l.s();!(s=l.n()).done;)if(s.value===a)return B(r,{delegateTarget:a}),i.oneOff&&R.off(e,r.type,t,n),n.apply(a,[r])}catch(e){l.e(e)}finally{l.f()}}}}(e,n,s):function(e,t){return function n(i){return B(i,{delegateTarget:e}),n.oneOff&&R.off(e,i.type,t),t.apply(e,[i])}}(e,s);d.delegationSelector=a?n:null,d.callable=s,d.oneOff=r,d.uidEvent=h,u[h]=d,e.addEventListener(l,d,a)}}}function x(e,t,n,i,r){var o=D(t[n],i,r);o&&(e.removeEventListener(n,o,Boolean(r)),delete t[n][o.uidEvent])}function H(e,t,n,i){for(var r=t[n]||{},o=0,a=Object.entries(r);o1&&void 0!==arguments[1]?arguments[1]:{},n=function(){var t=_slicedToArray(r[i],2),n=t[0],o=t[1];try{e[n]=o}catch(t){Object.defineProperty(e,n,{configurable:!0,get:function(){return o}})}},i=0,r=Object.entries(t);i1&&void 0!==arguments[1]?arguments[1]:this.constructor.DefaultType,i=0,r=Object.entries(n);i2&&void 0!==arguments[2])||arguments[2])}},{key:"_getConfig",value:function(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}}],[{key:"getInstance",value:function(e){return a(h(e),this.DATA_KEY)}},{key:"getOrCreateInstance",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getInstance(e)||new this(e,"object"===_typeof(t)?t:null)}},{key:"VERSION",get:function(){return"5.3.3"}},{key:"DATA_KEY",get:function(){return"bs.".concat(this.NAME)}},{key:"EVENT_KEY",get:function(){return".".concat(this.DATA_KEY)}},{key:"eventName",value:function(e){return"".concat(e).concat(this.EVENT_KEY)}}]),n}(Y),$=function(e){var t=e.getAttribute("data-bs-target");if(!t||"#"===t){var n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n="#".concat(n.split("#")[1])),t=n&&"#"!==n?n.trim():null}return t?t.split(",").map((function(e){return c(e)})).join(","):null},G={find:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return(t=[]).concat.apply(t,_toConsumableArray(Element.prototype.querySelectorAll.call(n,e)))},findOne:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return Element.prototype.querySelector.call(t,e)},children:function(e,t){var n;return(n=[]).concat.apply(n,_toConsumableArray(e.children)).filter((function(e){return e.matches(t)}))},parents:function(e,t){for(var n=[],i=e.parentNode.closest(t);i;)n.push(i),i=i.parentNode.closest(t);return n},prev:function(e,t){for(var n=e.previousElementSibling;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next:function(e,t){for(var n=e.nextElementSibling;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren:function(e){var t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((function(e){return"".concat(e,':not([tabindex^="-"])')})).join(",");return this.find(t,e).filter((function(e){return!_(e)&&d(e)}))},getSelectorFromElement:function(e){var t=$(e);return t&&G.findOne(t)?t:null},getElementFromSelector:function(e){var t=$(e);return t?G.findOne(t):null},getMultipleElementsFromSelector:function(e){var t=$(e);return t?G.find(t):[]}},J=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hide",n="click.dismiss".concat(e.EVENT_KEY),i=e.NAME;R.on(document,n,'[data-bs-dismiss="'.concat(i,'"]'),(function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),!_(this)){var r=G.getElementFromSelector(this)||this.closest(".".concat(i));e.getOrCreateInstance(r)[t]()}}))},Z=".".concat("bs.alert"),ee="close".concat(Z),te="closed".concat(Z),ne=function(e){_inherits(n,e);var t=_createSuper(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"close",value:function(){var e=this;if(!R.trigger(this._element,ee).defaultPrevented){this._element.classList.remove("show");var t=this._element.classList.contains("fade");this._queueCallback((function(){return e._destroyElement()}),this._element,t)}}},{key:"_destroyElement",value:function(){this._element.remove(),R.trigger(this._element,te),this.dispose()}}],[{key:"NAME",get:function(){return"alert"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}}))}}]),n}(U);J(ne,"close"),k(ne);var ie=".".concat("bs.button"),re='[data-bs-toggle="button"]',oe="click".concat(ie).concat(".data-api"),ae=function(e){_inherits(n,e);var t=_createSuper(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"toggle",value:function(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}}],[{key:"NAME",get:function(){return"button"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this);"toggle"===e&&t[e]()}))}}]),n}(U);R.on(document,oe,re,(function(e){e.preventDefault();var t=e.target.closest(re);ae.getOrCreateInstance(t).toggle()})),k(ae);var se=".bs.swipe",le="touchstart".concat(se),ce="touchmove".concat(se),ue="touchend".concat(se),fe="pointerdown".concat(se),he="pointerup".concat(se),de={endCallback:null,leftCallback:null,rightCallback:null},_e={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"},pe=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck(this,n),(r=t.call(this))._element=e,e&&n.isSupported()?(r._config=r._getConfig(i),r._deltaX=0,r._supportPointerEvents=Boolean(window.PointerEvent),r._initEvents(),r):_possibleConstructorReturn(r)}return _createClass(n,[{key:"dispose",value:function(){R.off(this._element,se)}},{key:"_start",value:function(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}},{key:"_end",value:function(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),w(this._config.endCallback)}},{key:"_move",value:function(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}},{key:"_handleSwipe",value:function(){var e=Math.abs(this._deltaX);if(!(e<=40)){var t=e/this._deltaX;this._deltaX=0,t&&w(t>0?this._config.rightCallback:this._config.leftCallback)}}},{key:"_initEvents",value:function(){var e=this;this._supportPointerEvents?(R.on(this._element,fe,(function(t){return e._start(t)})),R.on(this._element,he,(function(t){return e._end(t)})),this._element.classList.add("pointer-event")):(R.on(this._element,le,(function(t){return e._start(t)})),R.on(this._element,ce,(function(t){return e._move(t)})),R.on(this._element,ue,(function(t){return e._end(t)})))}},{key:"_eventIsPointerPenTouch",value:function(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}}],[{key:"Default",get:function(){return de}},{key:"DefaultType",get:function(){return _e}},{key:"NAME",get:function(){return"swipe"}},{key:"isSupported",value:function(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}]),n}(Y),ve=".".concat("bs.carousel"),ge=".data-api",me="next",ye="prev",be="left",ke="right",we="slide".concat(ve),Ce="slid".concat(ve),Ae="keydown".concat(ve),Te="mouseenter".concat(ve),Ee="mouseleave".concat(ve),Oe="dragstart".concat(ve),Se="load".concat(ve).concat(ge),Ie="click".concat(ve).concat(ge),Pe="carousel",Le="active",je=".active",Ne=".carousel-item",De=je+Ne,Fe=(_defineProperty(t={},"ArrowLeft",ke),_defineProperty(t,"ArrowRight",be),t),Me={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},xe={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"},He=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck(this,n),(r=t.call(this,e,i))._interval=null,r._activeElement=null,r._isSliding=!1,r.touchTimeout=null,r._swipeHelper=null,r._indicatorsElement=G.findOne(".carousel-indicators",r._element),r._addEventListeners(),r._config.ride===Pe&&r.cycle(),r}return _createClass(n,[{key:"next",value:function(){this._slide(me)}},{key:"nextWhenVisible",value:function(){!document.hidden&&d(this._element)&&this.next()}},{key:"prev",value:function(){this._slide(ye)}},{key:"pause",value:function(){this._isSliding&&u(this._element),this._clearInterval()}},{key:"cycle",value:function(){var e=this;this._clearInterval(),this._updateInterval(),this._interval=setInterval((function(){return e.nextWhenVisible()}),this._config.interval)}},{key:"_maybeEnableCycle",value:function(){var e=this;this._config.ride&&(this._isSliding?R.one(this._element,Ce,(function(){return e.cycle()})):this.cycle())}},{key:"to",value:function(e){var t=this,n=this._getItems();if(!(e>n.length-1||e<0))if(this._isSliding)R.one(this._element,Ce,(function(){return t.to(e)}));else{var i=this._getItemIndex(this._getActive());if(i!==e){var r=e>i?me:ye;this._slide(r,n[e])}}}},{key:"dispose",value:function(){this._swipeHelper&&this._swipeHelper.dispose(),_get(_getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"_configAfterMerge",value:function(e){return e.defaultInterval=e.interval,e}},{key:"_addEventListeners",value:function(){var e=this;this._config.keyboard&&R.on(this._element,Ae,(function(t){return e._keydown(t)})),"hover"===this._config.pause&&(R.on(this._element,Te,(function(){return e.pause()})),R.on(this._element,Ee,(function(){return e._maybeEnableCycle()}))),this._config.touch&&pe.isSupported()&&this._addTouchEventListeners()}},{key:"_addTouchEventListeners",value:function(){var e,t=this,n=_createForOfIteratorHelper(G.find(".carousel-item img",this._element));try{for(n.s();!(e=n.n()).done;){var i=e.value;R.on(i,Oe,(function(e){return e.preventDefault()}))}}catch(e){n.e(e)}finally{n.f()}var r={leftCallback:function(){return t._slide(t._directionToOrder(be))},rightCallback:function(){return t._slide(t._directionToOrder(ke))},endCallback:function(){"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(){return t._maybeEnableCycle()}),500+t._config.interval))}};this._swipeHelper=new pe(this._element,r)}},{key:"_keydown",value:function(e){if(!/input|textarea/i.test(e.target.tagName)){var t=Fe[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}}},{key:"_getItemIndex",value:function(e){return this._getItems().indexOf(e)}},{key:"_setActiveIndicatorElement",value:function(e){if(this._indicatorsElement){var t=G.findOne(je,this._indicatorsElement);t.classList.remove(Le),t.removeAttribute("aria-current");var n=G.findOne('[data-bs-slide-to="'.concat(e,'"]'),this._indicatorsElement);n&&(n.classList.add(Le),n.setAttribute("aria-current","true"))}}},{key:"_updateInterval",value:function(){var e=this._activeElement||this._getActive();if(e){var t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}}},{key:"_slide",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!this._isSliding){var i=this._getActive(),r=e===me,o=n||A(this._getItems(),i,r,this._config.wrap);if(o!==i){var a=this._getItemIndex(o),s=function(n){return R.trigger(t._element,n,{relatedTarget:o,direction:t._orderToDirection(e),from:t._getItemIndex(i),to:a})};if(!s(we).defaultPrevented&&i&&o){var l=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(a),this._activeElement=o;var c=r?"carousel-item-start":"carousel-item-end",u=r?"carousel-item-next":"carousel-item-prev";o.classList.add(u),g(o),i.classList.add(c),o.classList.add(c);this._queueCallback((function(){o.classList.remove(c,u),o.classList.add(Le),i.classList.remove(Le,u,c),t._isSliding=!1,s(Ce)}),i,this._isAnimated()),l&&this.cycle()}}}}},{key:"_isAnimated",value:function(){return this._element.classList.contains("slide")}},{key:"_getActive",value:function(){return G.findOne(De,this._element)}},{key:"_getItems",value:function(){return G.find(Ne,this._element)}},{key:"_clearInterval",value:function(){this._interval&&(clearInterval(this._interval),this._interval=null)}},{key:"_directionToOrder",value:function(e){return b()?e===be?ye:me:e===be?me:ye}},{key:"_orderToDirection",value:function(e){return b()?e===ye?be:ke:e===ye?ke:be}}],[{key:"Default",get:function(){return Me}},{key:"DefaultType",get:function(){return xe}},{key:"NAME",get:function(){return"carousel"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}else t.to(e)}))}}]),n}(U);R.on(document,Ie,"[data-bs-slide], [data-bs-slide-to]",(function(e){var t=G.getElementFromSelector(this);if(t&&t.classList.contains(Pe)){e.preventDefault();var n=He.getOrCreateInstance(t),i=this.getAttribute("data-bs-slide-to");if(i)return n.to(i),void n._maybeEnableCycle();if("next"===X(this,"slide"))return n.next(),void n._maybeEnableCycle();n.prev(),n._maybeEnableCycle()}})),R.on(window,Se,(function(){var e,t=_createForOfIteratorHelper(G.find('[data-bs-ride="carousel"]'));try{for(t.s();!(e=t.n()).done;){var n=e.value;He.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),k(He);var ze=".".concat("bs.collapse"),Re="show".concat(ze),Be="shown".concat(ze),We="hide".concat(ze),qe="hidden".concat(ze),Ke="click".concat(ze).concat(".data-api"),Ve="show",Qe="collapse",Xe="collapsing",Ye=":scope .".concat(Qe," .").concat(Qe),Ue='[data-bs-toggle="collapse"]',$e={parent:null,toggle:!0},Ge={parent:"(null|element)",toggle:"boolean"},Je=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;_classCallCheck(this,n),(r=t.call(this,e,i))._isTransitioning=!1,r._triggerArray=[];var o,a=_createForOfIteratorHelper(G.find(Ue));try{for(a.s();!(o=a.n()).done;){var s=o.value,l=G.getSelectorFromElement(s),c=G.find(l).filter((function(e){return e===r._element}));null!==l&&c.length&&r._triggerArray.push(s)}}catch(e){a.e(e)}finally{a.f()}return r._initializeChildren(),r._config.parent||r._addAriaAndCollapsedClass(r._triggerArray,r._isShown()),r._config.toggle&&r.toggle(),r}return _createClass(n,[{key:"toggle",value:function(){this._isShown()?this.hide():this.show()}},{key:"show",value:function(){var e=this;if(!this._isTransitioning&&!this._isShown()){var t=[];if(this._config.parent&&(t=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((function(t){return t!==e._element})).map((function(e){return n.getOrCreateInstance(e,{toggle:!1})}))),!t.length||!t[0]._isTransitioning)if(!R.trigger(this._element,Re).defaultPrevented){var i,r=_createForOfIteratorHelper(t);try{for(r.s();!(i=r.n()).done;){i.value.hide()}}catch(e){r.e(e)}finally{r.f()}var o=this._getDimension();this._element.classList.remove(Qe),this._element.classList.add(Xe),this._element.style[o]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;var a=o[0].toUpperCase()+o.slice(1),s="scroll".concat(a);this._queueCallback((function(){e._isTransitioning=!1,e._element.classList.remove(Xe),e._element.classList.add(Qe,Ve),e._element.style[o]="",R.trigger(e._element,Be)}),this._element,!0),this._element.style[o]="".concat(this._element[s],"px")}}}},{key:"hide",value:function(){var e=this;if(!this._isTransitioning&&this._isShown()&&!R.trigger(this._element,We).defaultPrevented){var t=this._getDimension();this._element.style[t]="".concat(this._element.getBoundingClientRect()[t],"px"),g(this._element),this._element.classList.add(Xe),this._element.classList.remove(Qe,Ve);var n,i=_createForOfIteratorHelper(this._triggerArray);try{for(i.s();!(n=i.n()).done;){var r=n.value,o=G.getElementFromSelector(r);o&&!this._isShown(o)&&this._addAriaAndCollapsedClass([r],!1)}}catch(e){i.e(e)}finally{i.f()}this._isTransitioning=!0;this._element.style[t]="",this._queueCallback((function(){e._isTransitioning=!1,e._element.classList.remove(Xe),e._element.classList.add(Qe),R.trigger(e._element,qe)}),this._element,!0)}}},{key:"_isShown",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._element).classList.contains(Ve)}},{key:"_configAfterMerge",value:function(e){return e.toggle=Boolean(e.toggle),e.parent=h(e.parent),e}},{key:"_getDimension",value:function(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}},{key:"_initializeChildren",value:function(){if(this._config.parent){var e,t=_createForOfIteratorHelper(this._getFirstLevelChildren(Ue));try{for(t.s();!(e=t.n()).done;){var n=e.value,i=G.getElementFromSelector(n);i&&this._addAriaAndCollapsedClass([n],this._isShown(i))}}catch(e){t.e(e)}finally{t.f()}}}},{key:"_getFirstLevelChildren",value:function(e){var t=G.find(Ye,this._config.parent);return G.find(e,this._config.parent).filter((function(e){return!t.includes(e)}))}},{key:"_addAriaAndCollapsedClass",value:function(e,t){if(e.length){var n,i=_createForOfIteratorHelper(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;r.classList.toggle("collapsed",!t),r.setAttribute("aria-expanded",t)}}catch(e){i.e(e)}finally{i.f()}}}}],[{key:"Default",get:function(){return $e}},{key:"DefaultType",get:function(){return Ge}},{key:"NAME",get:function(){return"collapse"}},{key:"jQueryInterface",value:function(e){var t={};return"string"==typeof e&&/show|hide/.test(e)&&(t.toggle=!1),this.each((function(){var i=n.getOrCreateInstance(this,t);if("string"==typeof e){if(void 0===i[e])throw new TypeError('No method named "'.concat(e,'"'));i[e]()}}))}}]),n}(U);R.on(document,Ke,Ue,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();var t,n=_createForOfIteratorHelper(G.getMultipleElementsFromSelector(this));try{for(n.s();!(t=n.n()).done;){var i=t.value;Je.getOrCreateInstance(i,{toggle:!1}).toggle()}}catch(e){n.e(e)}finally{n.f()}})),k(Je);var Ze="dropdown",et=".".concat("bs.dropdown"),tt=".data-api",nt="ArrowUp",it="ArrowDown",rt="hide".concat(et),ot="hidden".concat(et),at="show".concat(et),st="shown".concat(et),lt="click".concat(et).concat(tt),ct="keydown".concat(et).concat(tt),ut="keyup".concat(et).concat(tt),ft="show",ht='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',dt="".concat(ht,".").concat(ft),_t=".dropdown-menu",pt=b()?"top-end":"top-start",vt=b()?"top-start":"top-end",gt=b()?"bottom-end":"bottom-start",mt=b()?"bottom-start":"bottom-end",yt=b()?"left-start":"right-start",bt=b()?"right-start":"left-start",kt={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},wt={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"},Ct=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck(this,n),(r=t.call(this,e,i))._popper=null,r._parent=r._element.parentNode,r._menu=G.next(r._element,_t)[0]||G.prev(r._element,_t)[0]||G.findOne(_t,r._parent),r._inNavbar=r._detectNavbar(),r}return _createClass(n,[{key:"toggle",value:function(){return this._isShown()?this.hide():this.show()}},{key:"show",value:function(){if(!_(this._element)&&!this._isShown()){var e={relatedTarget:this._element};if(!R.trigger(this._element,at,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav")){var t,n,i=_createForOfIteratorHelper((t=[]).concat.apply(t,_toConsumableArray(document.body.children)));try{for(i.s();!(n=i.n()).done;){var r=n.value;R.on(r,"mouseover",v)}}catch(e){i.e(e)}finally{i.f()}}this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(ft),this._element.classList.add(ft),R.trigger(this._element,st,e)}}}},{key:"hide",value:function(){if(!_(this._element)&&this._isShown()){var e={relatedTarget:this._element};this._completeHide(e)}}},{key:"dispose",value:function(){this._popper&&this._popper.destroy(),_get(_getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"update",value:function(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}},{key:"_completeHide",value:function(e){if(!R.trigger(this._element,rt,e).defaultPrevented){if("ontouchstart"in document.documentElement){var t,n,i=_createForOfIteratorHelper((t=[]).concat.apply(t,_toConsumableArray(document.body.children)));try{for(i.s();!(n=i.n()).done;){var r=n.value;R.off(r,"mouseover",v)}}catch(e){i.e(e)}finally{i.f()}}this._popper&&this._popper.destroy(),this._menu.classList.remove(ft),this._element.classList.remove(ft),this._element.setAttribute("aria-expanded","false"),V(this._menu,"popper"),R.trigger(this._element,ot,e)}}},{key:"_getConfig",value:function(e){if("object"===_typeof((e=_get(_getPrototypeOf(n.prototype),"_getConfig",this).call(this,e)).reference)&&!f(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError("".concat(Ze.toUpperCase(),': Option "reference" provided type "object" without a required "getBoundingClientRect" method.'));return e}},{key:"_createPopper",value:function(){if(void 0===i)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");var e=this._element;"parent"===this._config.reference?e=this._parent:f(this._config.reference)?e=h(this._config.reference):"object"===_typeof(this._config.reference)&&(e=this._config.reference);var t=this._getPopperConfig();this._popper=i.createPopper(e,this._menu,t)}},{key:"_isShown",value:function(){return this._menu.classList.contains(ft)}},{key:"_getPlacement",value:function(){var e=this._parent;if(e.classList.contains("dropend"))return yt;if(e.classList.contains("dropstart"))return bt;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";var t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?vt:pt:t?mt:gt}},{key:"_detectNavbar",value:function(){return null!==this._element.closest(".navbar")}},{key:"_getOffset",value:function(){var e=this,t=this._config.offset;return"string"==typeof t?t.split(",").map((function(e){return Number.parseInt(e,10)})):"function"==typeof t?function(n){return t(n,e._element)}:t}},{key:"_getPopperConfig",value:function(){var e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(K(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),_objectSpread(_objectSpread({},e),w(this._config.popperConfig,[e]))}},{key:"_selectMenuItem",value:function(e){var t=e.key,n=e.target,i=G.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((function(e){return d(e)}));i.length&&A(i,n,t===it,!i.includes(n)).focus()}}],[{key:"Default",get:function(){return kt}},{key:"DefaultType",get:function(){return wt}},{key:"NAME",get:function(){return Ze}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}))}},{key:"clearMenus",value:function(e){if(2!==e.button&&("keyup"!==e.type||"Tab"===e.key)){var t,i=_createForOfIteratorHelper(G.find(dt));try{for(i.s();!(t=i.n()).done;){var r=t.value,o=n.getInstance(r);if(o&&!1!==o._config.autoClose){var a=e.composedPath(),s=a.includes(o._menu);if(!(a.includes(o._element)||"inside"===o._config.autoClose&&!s||"outside"===o._config.autoClose&&s||o._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))){var l={relatedTarget:o._element};"click"===e.type&&(l.clickEvent=e),o._completeHide(l)}}}}catch(e){i.e(e)}finally{i.f()}}}},{key:"dataApiKeydownHandler",value:function(e){var t=/input|textarea/i.test(e.target.tagName),i="Escape"===e.key,r=[nt,it].includes(e.key);if((r||i)&&(!t||i)){e.preventDefault();var o=this.matches(ht)?this:G.prev(this,ht)[0]||G.next(this,ht)[0]||G.findOne(ht,e.delegateTarget.parentNode),a=n.getOrCreateInstance(o);if(r)return e.stopPropagation(),a.show(),void a._selectMenuItem(e);a._isShown()&&(e.stopPropagation(),a.hide(),o.focus())}}}]),n}(U);R.on(document,ct,ht,Ct.dataApiKeydownHandler),R.on(document,ct,_t,Ct.dataApiKeydownHandler),R.on(document,lt,Ct.clearMenus),R.on(document,ut,Ct.clearMenus),R.on(document,lt,ht,(function(e){e.preventDefault(),Ct.getOrCreateInstance(this).toggle()})),k(Ct);var At="backdrop",Tt="show",Et="mousedown.bs.".concat(At),Ot={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},St={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"},It=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var i;return _classCallCheck(this,n),(i=t.call(this))._config=i._getConfig(e),i._isAppended=!1,i._element=null,i}return _createClass(n,[{key:"show",value:function(e){if(this._config.isVisible){this._append();var t=this._getElement();this._config.isAnimated&&g(t),t.classList.add(Tt),this._emulateAnimation((function(){w(e)}))}else w(e)}},{key:"hide",value:function(e){var t=this;this._config.isVisible?(this._getElement().classList.remove(Tt),this._emulateAnimation((function(){t.dispose(),w(e)}))):w(e)}},{key:"dispose",value:function(){this._isAppended&&(R.off(this._element,Et),this._element.remove(),this._isAppended=!1)}},{key:"_getElement",value:function(){if(!this._element){var e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}},{key:"_configAfterMerge",value:function(e){return e.rootElement=h(e.rootElement),e}},{key:"_append",value:function(){var e=this;if(!this._isAppended){var t=this._getElement();this._config.rootElement.append(t),R.on(t,Et,(function(){w(e._config.clickCallback)})),this._isAppended=!0}}},{key:"_emulateAnimation",value:function(e){C(e,this._getElement(),this._config.isAnimated)}}],[{key:"Default",get:function(){return Ot}},{key:"DefaultType",get:function(){return St}},{key:"NAME",get:function(){return At}}]),n}(Y),Pt=".".concat("bs.focustrap"),Lt="focusin".concat(Pt),jt="keydown.tab".concat(Pt),Nt="backward",Dt={autofocus:!0,trapElement:null},Ft={autofocus:"boolean",trapElement:"element"},Mt=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var i;return _classCallCheck(this,n),(i=t.call(this))._config=i._getConfig(e),i._isActive=!1,i._lastTabNavDirection=null,i}return _createClass(n,[{key:"activate",value:function(){var e=this;this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),R.off(document,Pt),R.on(document,Lt,(function(t){return e._handleFocusin(t)})),R.on(document,jt,(function(t){return e._handleKeydown(t)})),this._isActive=!0)}},{key:"deactivate",value:function(){this._isActive&&(this._isActive=!1,R.off(document,Pt))}},{key:"_handleFocusin",value:function(e){var t=this._config.trapElement;if(e.target!==document&&e.target!==t&&!t.contains(e.target)){var n=G.focusableChildren(t);0===n.length?t.focus():this._lastTabNavDirection===Nt?n[n.length-1].focus():n[0].focus()}}},{key:"_handleKeydown",value:function(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?Nt:"forward")}}],[{key:"Default",get:function(){return Dt}},{key:"DefaultType",get:function(){return Ft}},{key:"NAME",get:function(){return"focustrap"}}]),n}(Y),xt=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Ht=".sticky-top",zt="padding-right",Rt="margin-right",Bt=function(){function e(){_classCallCheck(this,e),this._element=document.body}return _createClass(e,[{key:"getWidth",value:function(){var e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}},{key:"hide",value:function(){var e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,zt,(function(t){return t+e})),this._setElementAttributes(xt,zt,(function(t){return t+e})),this._setElementAttributes(Ht,Rt,(function(t){return t-e}))}},{key:"reset",value:function(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,zt),this._resetElementAttributes(xt,zt),this._resetElementAttributes(Ht,Rt)}},{key:"isOverflowing",value:function(){return this.getWidth()>0}},{key:"_disableOverFlow",value:function(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}},{key:"_setElementAttributes",value:function(e,t,n){var i=this,r=this.getWidth();this._applyManipulationCallback(e,(function(e){if(!(e!==i._element&&window.innerWidth>e.clientWidth+r)){i._saveInitialAttribute(e,t);var o=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,"".concat(n(Number.parseFloat(o)),"px"))}}))}},{key:"_saveInitialAttribute",value:function(e,t){var n=e.style.getPropertyValue(t);n&&K(e,t,n)}},{key:"_resetElementAttributes",value:function(e,t){this._applyManipulationCallback(e,(function(e){var n=X(e,t);null!==n?(V(e,t),e.style.setProperty(t,n)):e.style.removeProperty(t)}))}},{key:"_applyManipulationCallback",value:function(e,t){if(f(e))t(e);else{var n,i=_createForOfIteratorHelper(G.find(e,this._element));try{for(i.s();!(n=i.n()).done;){t(n.value)}}catch(e){i.e(e)}finally{i.f()}}}}]),e}(),Wt=".".concat("bs.modal"),qt="hide".concat(Wt),Kt="hidePrevented".concat(Wt),Vt="hidden".concat(Wt),Qt="show".concat(Wt),Xt="shown".concat(Wt),Yt="resize".concat(Wt),Ut="click.dismiss".concat(Wt),$t="mousedown.dismiss".concat(Wt),Gt="keydown.dismiss".concat(Wt),Jt="click".concat(Wt).concat(".data-api"),Zt="modal-open",en="show",tn="modal-static",nn={backdrop:!0,focus:!0,keyboard:!0},rn={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"},on=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck(this,n),(r=t.call(this,e,i))._dialog=G.findOne(".modal-dialog",r._element),r._backdrop=r._initializeBackDrop(),r._focustrap=r._initializeFocusTrap(),r._isShown=!1,r._isTransitioning=!1,r._scrollBar=new Bt,r._addEventListeners(),r}return _createClass(n,[{key:"toggle",value:function(e){return this._isShown?this.hide():this.show(e)}},{key:"show",value:function(e){var t=this;this._isShown||this._isTransitioning||(R.trigger(this._element,Qt,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Zt),this._adjustDialog(),this._backdrop.show((function(){return t._showElement(e)}))))}},{key:"hide",value:function(){var e=this;this._isShown&&!this._isTransitioning&&(R.trigger(this._element,qt).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(en),this._queueCallback((function(){return e._hideModal()}),this._element,this._isAnimated())))}},{key:"dispose",value:function(){R.off(window,Wt),R.off(this._dialog,Wt),this._backdrop.dispose(),this._focustrap.deactivate(),_get(_getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"handleUpdate",value:function(){this._adjustDialog()}},{key:"_initializeBackDrop",value:function(){return new It({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}},{key:"_initializeFocusTrap",value:function(){return new Mt({trapElement:this._element})}},{key:"_showElement",value:function(e){var t=this;document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;var n=G.findOne(".modal-body",this._dialog);n&&(n.scrollTop=0),g(this._element),this._element.classList.add(en);this._queueCallback((function(){t._config.focus&&t._focustrap.activate(),t._isTransitioning=!1,R.trigger(t._element,Xt,{relatedTarget:e})}),this._dialog,this._isAnimated())}},{key:"_addEventListeners",value:function(){var e=this;R.on(this._element,Gt,(function(t){"Escape"===t.key&&(e._config.keyboard?e.hide():e._triggerBackdropTransition())})),R.on(window,Yt,(function(){e._isShown&&!e._isTransitioning&&e._adjustDialog()})),R.on(this._element,$t,(function(t){R.one(e._element,Ut,(function(n){e._element===t.target&&e._element===n.target&&("static"!==e._config.backdrop?e._config.backdrop&&e.hide():e._triggerBackdropTransition())}))}))}},{key:"_hideModal",value:function(){var e=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((function(){document.body.classList.remove(Zt),e._resetAdjustments(),e._scrollBar.reset(),R.trigger(e._element,Vt)}))}},{key:"_isAnimated",value:function(){return this._element.classList.contains("fade")}},{key:"_triggerBackdropTransition",value:function(){var e=this;if(!R.trigger(this._element,Kt).defaultPrevented){var t=this._element.scrollHeight>document.documentElement.clientHeight,n=this._element.style.overflowY;"hidden"===n||this._element.classList.contains(tn)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(tn),this._queueCallback((function(){e._element.classList.remove(tn),e._queueCallback((function(){e._element.style.overflowY=n}),e._dialog)}),this._dialog),this._element.focus())}}},{key:"_adjustDialog",value:function(){var e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){var i=b()?"paddingLeft":"paddingRight";this._element.style[i]="".concat(t,"px")}if(!n&&e){var r=b()?"paddingRight":"paddingLeft";this._element.style[r]="".concat(t,"px")}}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}}],[{key:"Default",get:function(){return nn}},{key:"DefaultType",get:function(){return rn}},{key:"NAME",get:function(){return"modal"}},{key:"jQueryInterface",value:function(e,t){return this.each((function(){var i=n.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===i[e])throw new TypeError('No method named "'.concat(e,'"'));i[e](t)}}))}}]),n}(U);R.on(document,Jt,'[data-bs-toggle="modal"]',(function(e){var t=this,n=G.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),R.one(n,Qt,(function(e){e.defaultPrevented||R.one(n,Vt,(function(){d(t)&&t.focus()}))}));var i=G.findOne(".modal.show");i&&on.getInstance(i).hide(),on.getOrCreateInstance(n).toggle(this)})),J(on),k(on);var an=".".concat("bs.offcanvas"),sn=".data-api",ln="load".concat(an).concat(sn),cn="show",un="showing",fn="hiding",hn=".offcanvas.show",dn="show".concat(an),_n="shown".concat(an),pn="hide".concat(an),vn="hidePrevented".concat(an),gn="hidden".concat(an),mn="resize".concat(an),yn="click".concat(an).concat(sn),bn="keydown.dismiss".concat(an),kn={backdrop:!0,keyboard:!0,scroll:!1},wn={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"},Cn=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck(this,n),(r=t.call(this,e,i))._isShown=!1,r._backdrop=r._initializeBackDrop(),r._focustrap=r._initializeFocusTrap(),r._addEventListeners(),r}return _createClass(n,[{key:"toggle",value:function(e){return this._isShown?this.hide():this.show(e)}},{key:"show",value:function(e){var t=this;if(!this._isShown&&!R.trigger(this._element,dn,{relatedTarget:e}).defaultPrevented){this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Bt).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(un);this._queueCallback((function(){t._config.scroll&&!t._config.backdrop||t._focustrap.activate(),t._element.classList.add(cn),t._element.classList.remove(un),R.trigger(t._element,_n,{relatedTarget:e})}),this._element,!0)}}},{key:"hide",value:function(){var e=this;if(this._isShown&&!R.trigger(this._element,pn).defaultPrevented){this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(fn),this._backdrop.hide();this._queueCallback((function(){e._element.classList.remove(cn,fn),e._element.removeAttribute("aria-modal"),e._element.removeAttribute("role"),e._config.scroll||(new Bt).reset(),R.trigger(e._element,gn)}),this._element,!0)}}},{key:"dispose",value:function(){this._backdrop.dispose(),this._focustrap.deactivate(),_get(_getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"_initializeBackDrop",value:function(){var e=this,t=Boolean(this._config.backdrop);return new It({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?function(){"static"!==e._config.backdrop?e.hide():R.trigger(e._element,vn)}:null})}},{key:"_initializeFocusTrap",value:function(){return new Mt({trapElement:this._element})}},{key:"_addEventListeners",value:function(){var e=this;R.on(this._element,bn,(function(t){"Escape"===t.key&&(e._config.keyboard?e.hide():R.trigger(e._element,vn))}))}}],[{key:"Default",get:function(){return kn}},{key:"DefaultType",get:function(){return wn}},{key:"NAME",get:function(){return"offcanvas"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}}))}}]),n}(U);R.on(document,yn,'[data-bs-toggle="offcanvas"]',(function(e){var t=this,n=G.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),!_(this)){R.one(n,gn,(function(){d(t)&&t.focus()}));var i=G.findOne(hn);i&&i!==n&&Cn.getInstance(i).hide(),Cn.getOrCreateInstance(n).toggle(this)}})),R.on(window,ln,(function(){var e,t=_createForOfIteratorHelper(G.find(hn));try{for(t.s();!(e=t.n()).done;){var n=e.value;Cn.getOrCreateInstance(n).show()}}catch(e){t.e(e)}finally{t.f()}})),R.on(window,mn,(function(){var e,t=_createForOfIteratorHelper(G.find("[aria-modal][class*=show][class*=offcanvas-]"));try{for(t.s();!(e=t.n()).done;){var n=e.value;"fixed"!==getComputedStyle(n).position&&Cn.getOrCreateInstance(n).hide()}}catch(e){t.e(e)}finally{t.f()}})),J(Cn),k(Cn);var An={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},Tn=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),En=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,On=function(e,t){var n=e.nodeName.toLowerCase();return t.includes(n)?!Tn.has(n)||Boolean(En.test(e.nodeValue)):t.filter((function(e){return e instanceof RegExp})).some((function(e){return e.test(n)}))};var Sn={allowList:An,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
    "},In={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},Pn={entry:"(string|element|function|null)",selector:"(string|element)"},Ln=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var i;return _classCallCheck(this,n),(i=t.call(this))._config=i._getConfig(e),i}return _createClass(n,[{key:"getContent",value:function(){var e=this;return Object.values(this._config.content).map((function(t){return e._resolvePossibleFunction(t)})).filter(Boolean)}},{key:"hasContent",value:function(){return this.getContent().length>0}},{key:"changeContent",value:function(e){return this._checkContent(e),this._config.content=_objectSpread(_objectSpread({},this._config.content),e),this}},{key:"toHtml",value:function(){var e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(var t=0,n=Object.entries(this._config.content);t
    ',title:"",trigger:"hover focus"},Bn={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"},Wn=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,r){var o;if(_classCallCheck(this,n),void 0===i)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");return(o=t.call(this,e,r))._isEnabled=!0,o._timeout=0,o._isHovered=null,o._activeTrigger={},o._popper=null,o._templateFactory=null,o._newContent=null,o.tip=null,o._setListeners(),o._config.selector||o._fixTitle(),o}return _createClass(n,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}},{key:"dispose",value:function(){clearTimeout(this._timeout),R.off(this._element.closest(Fn),Mn,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),_get(_getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"show",value:function(){var e=this;if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(this._isWithContent()&&this._isEnabled){var t=R.trigger(this._element,this.constructor.eventName("show")),n=(p(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(!t.defaultPrevented&&n){this._disposePopper();var i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));var r=this._config.container;if(this._element.ownerDocument.documentElement.contains(this.tip)||(r.append(i),R.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(Dn),"ontouchstart"in document.documentElement){var o,a,s=_createForOfIteratorHelper((o=[]).concat.apply(o,_toConsumableArray(document.body.children)));try{for(s.s();!(a=s.n()).done;){var l=a.value;R.on(l,"mouseover",v)}}catch(e){s.e(e)}finally{s.f()}}this._queueCallback((function(){R.trigger(e._element,e.constructor.eventName("shown")),!1===e._isHovered&&e._leave(),e._isHovered=!1}),this.tip,this._isAnimated())}}}},{key:"hide",value:function(){var e=this;if(this._isShown()&&!R.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(Dn),"ontouchstart"in document.documentElement){var t,n,i=_createForOfIteratorHelper((t=[]).concat.apply(t,_toConsumableArray(document.body.children)));try{for(i.s();!(n=i.n()).done;){var r=n.value;R.off(r,"mouseover",v)}}catch(e){i.e(e)}finally{i.f()}}this._activeTrigger.click=!1,this._activeTrigger[Hn]=!1,this._activeTrigger[xn]=!1,this._isHovered=null;this._queueCallback((function(){e._isWithActiveTrigger()||(e._isHovered||e._disposePopper(),e._element.removeAttribute("aria-describedby"),R.trigger(e._element,e.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}}},{key:"update",value:function(){this._popper&&this._popper.update()}},{key:"_isWithContent",value:function(){return Boolean(this._getTitle())}},{key:"_getTipElement",value:function(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}},{key:"_createTipElement",value:function(e){var t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(Nn,Dn),t.classList.add("bs-".concat(this.constructor.NAME,"-auto"));var n=function(e){do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e}(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(Nn),t}},{key:"setContent",value:function(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}},{key:"_getTemplateFactory",value:function(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new Ln(_objectSpread(_objectSpread({},this._config),{},{content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)})),this._templateFactory}},{key:"_getContentForTemplate",value:function(){return _defineProperty({},".tooltip-inner",this._getTitle())}},{key:"_getTitle",value:function(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}},{key:"_initializeOnDelegatedTarget",value:function(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}},{key:"_isAnimated",value:function(){return this._config.animation||this.tip&&this.tip.classList.contains(Nn)}},{key:"_isShown",value:function(){return this.tip&&this.tip.classList.contains(Dn)}},{key:"_createPopper",value:function(e){var t=w(this._config.placement,[this,e,this._element]),n=zn[t.toUpperCase()];return i.createPopper(this._element,e,this._getPopperConfig(n))}},{key:"_getOffset",value:function(){var e=this,t=this._config.offset;return"string"==typeof t?t.split(",").map((function(e){return Number.parseInt(e,10)})):"function"==typeof t?function(n){return t(n,e._element)}:t}},{key:"_resolvePossibleFunction",value:function(e){return w(e,[this._element])}},{key:"_getPopperConfig",value:function(e){var t=this,n={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:".".concat(this.constructor.NAME,"-arrow")}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:function(e){t._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return _objectSpread(_objectSpread({},n),w(this._config.popperConfig,[n]))}},{key:"_setListeners",value:function(){var e,t=this,n=_createForOfIteratorHelper(this._config.trigger.split(" "));try{for(n.s();!(e=n.n()).done;){var i=e.value;if("click"===i)R.on(this._element,this.constructor.eventName("click"),this._config.selector,(function(e){t._initializeOnDelegatedTarget(e).toggle()}));else if("manual"!==i){var r=i===xn?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),o=i===xn?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");R.on(this._element,r,this._config.selector,(function(e){var n=t._initializeOnDelegatedTarget(e);n._activeTrigger["focusin"===e.type?Hn:xn]=!0,n._enter()})),R.on(this._element,o,this._config.selector,(function(e){var n=t._initializeOnDelegatedTarget(e);n._activeTrigger["focusout"===e.type?Hn:xn]=n._element.contains(e.relatedTarget),n._leave()}))}}}catch(e){n.e(e)}finally{n.f()}this._hideModalHandler=function(){t._element&&t.hide()},R.on(this._element.closest(Fn),Mn,this._hideModalHandler)}},{key:"_fixTitle",value:function(){var e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}},{key:"_enter",value:function(){var e=this;this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((function(){e._isHovered&&e.show()}),this._config.delay.show))}},{key:"_leave",value:function(){var e=this;this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((function(){e._isHovered||e.hide()}),this._config.delay.hide))}},{key:"_setTimeout",value:function(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}},{key:"_isWithActiveTrigger",value:function(){return Object.values(this._activeTrigger).includes(!0)}},{key:"_getConfig",value:function(e){for(var t=Q(this._element),n=0,i=Object.keys(t);n

    ',trigger:"click"}),Kn=_objectSpread(_objectSpread({},Wn.DefaultType),{},{content:"(null|string|element|function)"}),Vn=function(e){_inherits(n,e);var t=_createSuper(n);function n(){return _classCallCheck(this,n),t.apply(this,arguments)}return _createClass(n,[{key:"_isWithContent",value:function(){return this._getTitle()||this._getContent()}},{key:"_getContentForTemplate",value:function(){var e;return _defineProperty(e={},".popover-header",this._getTitle()),_defineProperty(e,".popover-body",this._getContent()),e}},{key:"_getContent",value:function(){return this._resolvePossibleFunction(this._config.content)}}],[{key:"Default",get:function(){return qn}},{key:"DefaultType",get:function(){return Kn}},{key:"NAME",get:function(){return"popover"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}))}}]),n}(Wn);k(Vn);var Qn=".".concat("bs.scrollspy"),Xn="activate".concat(Qn),Yn="click".concat(Qn),Un="load".concat(Qn).concat(".data-api"),$n="active",Gn="[href]",Jn=".nav-link",Zn="".concat(Jn,", ").concat(".nav-item"," > ").concat(Jn,", ").concat(".list-group-item"),ei={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},ti={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"},ni=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck(this,n),(r=t.call(this,e,i))._targetLinks=new Map,r._observableSections=new Map,r._rootElement="visible"===getComputedStyle(r._element).overflowY?null:r._element,r._activeTarget=null,r._observer=null,r._previousScrollData={visibleEntryTop:0,parentScrollTop:0},r.refresh(),r}return _createClass(n,[{key:"refresh",value:function(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();var e,t=_createForOfIteratorHelper(this._observableSections.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;this._observer.observe(n)}}catch(e){t.e(e)}finally{t.f()}}},{key:"dispose",value:function(){this._observer.disconnect(),_get(_getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"_configAfterMerge",value:function(e){return e.target=h(e.target)||document.body,e.rootMargin=e.offset?"".concat(e.offset,"px 0px -30%"):e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map((function(e){return Number.parseFloat(e)}))),e}},{key:"_maybeEnableSmoothScroll",value:function(){var e=this;this._config.smoothScroll&&(R.off(this._config.target,Yn),R.on(this._config.target,Yn,Gn,(function(t){var n=e._observableSections.get(t.target.hash);if(n){t.preventDefault();var i=e._rootElement||window,r=n.offsetTop-e._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:r,behavior:"smooth"});i.scrollTop=r}})))}},{key:"_getNewObserver",value:function(){var e=this,t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((function(t){return e._observerCallback(t)}),t)}},{key:"_observerCallback",value:function(e){var t=this,n=function(e){return t._targetLinks.get("#".concat(e.target.id))},i=function(e){t._previousScrollData.visibleEntryTop=e.target.offsetTop,t._process(n(e))},r=(this._rootElement||document.documentElement).scrollTop,o=r>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=r;var a,s=_createForOfIteratorHelper(e);try{for(s.s();!(a=s.n()).done;){var l=a.value;if(l.isIntersecting){var c=l.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&c){if(i(l),!r)return}else o||c||i(l)}else this._activeTarget=null,this._clearActiveClass(n(l))}}catch(e){s.e(e)}finally{s.f()}}},{key:"_initializeTargetsAndObservables",value:function(){this._targetLinks=new Map,this._observableSections=new Map;var e,t=_createForOfIteratorHelper(G.find(Gn,this._config.target));try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.hash&&!_(n)){var i=G.findOne(decodeURI(n.hash),this._element);d(i)&&(this._targetLinks.set(decodeURI(n.hash),n),this._observableSections.set(n.hash,i))}}}catch(e){t.e(e)}finally{t.f()}}},{key:"_process",value:function(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add($n),this._activateParents(e),R.trigger(this._element,Xn,{relatedTarget:e}))}},{key:"_activateParents",value:function(e){if(e.classList.contains("dropdown-item"))G.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add($n);else{var t,n=_createForOfIteratorHelper(G.parents(e,".nav, .list-group"));try{for(n.s();!(t=n.n()).done;){var i,r=t.value,o=_createForOfIteratorHelper(G.prev(r,Zn));try{for(o.s();!(i=o.n()).done;){i.value.classList.add($n)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}}}},{key:"_clearActiveClass",value:function(e){e.classList.remove($n);var t,n=_createForOfIteratorHelper(G.find("".concat(Gn,".").concat($n),e));try{for(n.s();!(t=n.n()).done;){t.value.classList.remove($n)}}catch(e){n.e(e)}finally{n.f()}}}],[{key:"Default",get:function(){return ei}},{key:"DefaultType",get:function(){return ti}},{key:"NAME",get:function(){return"scrollspy"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}))}}]),n}(U);R.on(window,Un,(function(){var e,t=_createForOfIteratorHelper(G.find('[data-bs-spy="scroll"]'));try{for(t.s();!(e=t.n()).done;){var n=e.value;ni.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),k(ni);var ii=".".concat("bs.tab"),ri="hide".concat(ii),oi="hidden".concat(ii),ai="show".concat(ii),si="shown".concat(ii),li="click".concat(ii),ci="keydown".concat(ii),ui="load".concat(ii),fi="ArrowLeft",hi="ArrowRight",di="ArrowUp",_i="ArrowDown",pi="Home",vi="End",gi="active",mi="fade",yi="show",bi=".dropdown-toggle",ki=":not(".concat(bi,")"),wi=".nav-link".concat(ki,", .list-group-item").concat(ki,', [role="tab"]').concat(ki),Ci='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Ai="".concat(wi,", ").concat(Ci),Ti=".".concat(gi,'[data-bs-toggle="tab"], .').concat(gi,'[data-bs-toggle="pill"], .').concat(gi,'[data-bs-toggle="list"]'),Ei=function(e){_inherits(n,e);var t=_createSuper(n);function n(e){var i;return _classCallCheck(this,n),(i=t.call(this,e))._parent=i._element.closest('.list-group, .nav, [role="tablist"]'),i._parent?(i._setInitialAttributes(i._parent,i._getChildren()),R.on(i._element,ci,(function(e){return i._keydown(e)})),i):_possibleConstructorReturn(i)}return _createClass(n,[{key:"show",value:function(){var e=this._element;if(!this._elemIsActive(e)){var t=this._getActiveElem(),n=t?R.trigger(t,ri,{relatedTarget:e}):null;R.trigger(e,ai,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}}},{key:"_activate",value:function(e,t){var n=this;if(e){e.classList.add(gi),this._activate(G.getElementFromSelector(e));this._queueCallback((function(){"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),n._toggleDropDown(e,!0),R.trigger(e,si,{relatedTarget:t})):e.classList.add(yi)}),e,e.classList.contains(mi))}}},{key:"_deactivate",value:function(e,t){var n=this;if(e){e.classList.remove(gi),e.blur(),this._deactivate(G.getElementFromSelector(e));this._queueCallback((function(){"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),n._toggleDropDown(e,!1),R.trigger(e,oi,{relatedTarget:t})):e.classList.remove(yi)}),e,e.classList.contains(mi))}}},{key:"_keydown",value:function(e){if([fi,hi,di,_i,pi,vi].includes(e.key)){e.stopPropagation(),e.preventDefault();var t,i=this._getChildren().filter((function(e){return!_(e)}));if([pi,vi].includes(e.key))t=i[e.key===pi?0:i.length-1];else{var r=[hi,_i].includes(e.key);t=A(i,e.target,r,!0)}t&&(t.focus({preventScroll:!0}),n.getOrCreateInstance(t).show())}}},{key:"_getChildren",value:function(){return G.find(Ai,this._parent)}},{key:"_getActiveElem",value:function(){var e=this;return this._getChildren().find((function(t){return e._elemIsActive(t)}))||null}},{key:"_setInitialAttributes",value:function(e,t){this._setAttributeIfNotExists(e,"role","tablist");var n,i=_createForOfIteratorHelper(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;this._setInitialAttributesOnChild(r)}}catch(e){i.e(e)}finally{i.f()}}},{key:"_setInitialAttributesOnChild",value:function(e){e=this._getInnerElement(e);var t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}},{key:"_setInitialAttributesOnTargetPanel",value:function(e){var t=G.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby","".concat(e.id)))}},{key:"_toggleDropDown",value:function(e,t){var n=this._getOuterElement(e);if(n.classList.contains("dropdown")){var i=function(e,i){var r=G.findOne(e,n);r&&r.classList.toggle(i,t)};i(bi,gi),i(".dropdown-menu",yi),n.setAttribute("aria-expanded",t)}}},{key:"_setAttributeIfNotExists",value:function(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}},{key:"_elemIsActive",value:function(e){return e.classList.contains(gi)}},{key:"_getInnerElement",value:function(e){return e.matches(Ai)?e:G.findOne(Ai,e)}},{key:"_getOuterElement",value:function(e){return e.closest(".nav-item, .list-group-item")||e}}],[{key:"NAME",get:function(){return"tab"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this);if("string"==typeof e){if(void 0===t[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));t[e]()}}))}}]),n}(U);R.on(document,li,Ci,(function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),_(this)||Ei.getOrCreateInstance(this).show()})),R.on(window,ui,(function(){var e,t=_createForOfIteratorHelper(G.find(Ti));try{for(t.s();!(e=t.n()).done;){var n=e.value;Ei.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),k(Ei);var Oi=".".concat("bs.toast"),Si="mouseover".concat(Oi),Ii="mouseout".concat(Oi),Pi="focusin".concat(Oi),Li="focusout".concat(Oi),ji="hide".concat(Oi),Ni="hidden".concat(Oi),Di="show".concat(Oi),Fi="shown".concat(Oi),Mi="hide",xi="show",Hi="showing",zi={animation:"boolean",autohide:"boolean",delay:"number"},Ri={animation:!0,autohide:!0,delay:5e3},Bi=function(e){_inherits(n,e);var t=_createSuper(n);function n(e,i){var r;return _classCallCheck(this,n),(r=t.call(this,e,i))._timeout=null,r._hasMouseInteraction=!1,r._hasKeyboardInteraction=!1,r._setListeners(),r}return _createClass(n,[{key:"show",value:function(){var e=this;if(!R.trigger(this._element,Di).defaultPrevented){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(Mi),g(this._element),this._element.classList.add(xi,Hi),this._queueCallback((function(){e._element.classList.remove(Hi),R.trigger(e._element,Fi),e._maybeScheduleHide()}),this._element,this._config.animation)}}},{key:"hide",value:function(){var e=this;if(this.isShown()&&!R.trigger(this._element,ji).defaultPrevented){this._element.classList.add(Hi),this._queueCallback((function(){e._element.classList.add(Mi),e._element.classList.remove(Hi,xi),R.trigger(e._element,Ni)}),this._element,this._config.animation)}}},{key:"dispose",value:function(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(xi),_get(_getPrototypeOf(n.prototype),"dispose",this).call(this)}},{key:"isShown",value:function(){return this._element.classList.contains(xi)}},{key:"_maybeScheduleHide",value:function(){var e=this;this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((function(){e.hide()}),this._config.delay)))}},{key:"_onInteraction",value:function(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)this._clearTimeout();else{var n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}}},{key:"_setListeners",value:function(){var e=this;R.on(this._element,Si,(function(t){return e._onInteraction(t,!0)})),R.on(this._element,Ii,(function(t){return e._onInteraction(t,!1)})),R.on(this._element,Pi,(function(t){return e._onInteraction(t,!0)})),R.on(this._element,Li,(function(t){return e._onInteraction(t,!1)}))}},{key:"_clearTimeout",value:function(){clearTimeout(this._timeout),this._timeout=null}}],[{key:"Default",get:function(){return Ri}},{key:"DefaultType",get:function(){return zi}},{key:"NAME",get:function(){return"toast"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var t=n.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===t[e])throw new TypeError('No method named "'.concat(e,'"'));t[e](this)}}))}}]),n}(U);return J(Bi),k(Bi),{Alert:ne,Button:ae,Carousel:He,Collapse:Je,Dropdown:Ct,Modal:on,Offcanvas:Cn,Popover:Vn,ScrollSpy:ni,Tab:Ei,Toast:Bi,Tooltip:Wn}})); + */}!function(e,t){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=t(require("@popperjs/core")):"function"==typeof define&&define.amd?define(["@popperjs/core"],t):(e="undefined"!=typeof globalThis?globalThis:e||self).bootstrap=t(e.Popper)}(this,(function(e){"use strict";function t(e){var t=Object.create(null,_defineProperty({},Symbol.toStringTag,{value:"Module"}));if(e){var n=function(n){if("default"!==n){var i=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,i.get?i:{enumerable:!0,get:function(){return e[n]}})}};for(var i in e)n(i)}return t.default=e,Object.freeze(t)}var n=t(e),i=new Map,r=function(e,t,n){i.has(e)||i.set(e,new Map);var r=i.get(e);r.has(t)||0===r.size?r.set(t,n):console.error("Bootstrap doesn't allow more than one instance per element. Bound instance: ".concat(Array.from(r.keys())[0],"."))},o=function(e,t){return i.has(e)&&i.get(e).get(t)||null},a=function(e,t){if(i.has(e)){var n=i.get(e);n.delete(t),0===n.size&&i.delete(e)}},s="transitionend",l=function(e){return e&&window.CSS&&window.CSS.escape&&(e=e.replace(/#([^\s"#']+)/g,(function(e,t){return"#".concat(CSS.escape(t))}))),e},c=function(e){e.dispatchEvent(new Event(s))},u=function(e){return!(!e||"object"!==_typeof(e))&&(void 0!==e.jquery&&(e=e[0]),void 0!==e.nodeType)},f=function(e){return u(e)?e.jquery?e[0]:e:"string"==typeof e&&e.length>0?document.querySelector(l(e)):null},h=function(e){if(!u(e)||0===e.getClientRects().length)return!1;var t="visible"===getComputedStyle(e).getPropertyValue("visibility"),n=e.closest("details:not([open])");if(!n)return t;if(n!==e){var i=e.closest("summary");if(i&&i.parentNode!==n)return!1;if(null===i)return!1}return t},d=function(e){return!e||e.nodeType!==Node.ELEMENT_NODE||(!!e.classList.contains("disabled")||(void 0!==e.disabled?e.disabled:e.hasAttribute("disabled")&&"false"!==e.getAttribute("disabled")))},_=function e(t){if(!document.documentElement.attachShadow)return null;if("function"==typeof t.getRootNode){var n=t.getRootNode();return n instanceof ShadowRoot?n:null}return t instanceof ShadowRoot?t:t.parentNode?e(t.parentNode):null},p=function(){},g=function(e){e.offsetHeight},v=function(){return window.jQuery&&!document.body.hasAttribute("data-bs-no-jquery")?window.jQuery:null},m=[],y=function(){return"rtl"===document.documentElement.dir},b=function(e){var t;t=function(){var t=v();if(t){var n=e.NAME,i=t.fn[n];t.fn[n]=e.jQueryInterface,t.fn[n].Constructor=e,t.fn[n].noConflict=function(){return t.fn[n]=i,e.jQueryInterface}}},"loading"===document.readyState?(m.length||document.addEventListener("DOMContentLoaded",(function(){for(var e=0,t=m;e1&&void 0!==arguments[1]?arguments[1]:[],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;return"function"==typeof e?e.apply(void 0,_toConsumableArray(t)):n},w=function(e,t){if(!(arguments.length>2&&void 0!==arguments[2])||arguments[2]){var n=function(e){if(!e)return 0;var t=window.getComputedStyle(e),n=t.transitionDuration,i=t.transitionDelay,r=Number.parseFloat(n),o=Number.parseFloat(i);return r||o?(n=n.split(",")[0],i=i.split(",")[0],1e3*(Number.parseFloat(n)+Number.parseFloat(i))):0}(t)+5,i=!1;t.addEventListener(s,(function n(r){r.target===t&&(i=!0,t.removeEventListener(s,n),k(e))})),setTimeout((function(){i||c(t)}),n)}else k(e)},C=function(e,t,n,i){var r=e.length,o=e.indexOf(t);return-1===o?!n&&i?e[r-1]:e[0]:(o+=n?1:-1,i&&(o=(o+r)%r),e[Math.max(0,Math.min(o,r-1))])},A=/[^.]*(?=\..*)\.|.*/,T=/\..*/,E=/::\d+$/,O={},S=1,I={mouseenter:"mouseover",mouseleave:"mouseout"},P=new Set(["click","dblclick","mouseup","mousedown","contextmenu","mousewheel","DOMMouseScroll","mouseover","mouseout","mousemove","selectstart","selectend","keydown","keypress","keyup","orientationchange","touchstart","touchmove","touchend","touchcancel","pointerdown","pointermove","pointerup","pointerleave","pointercancel","gesturestart","gesturechange","gestureend","focus","blur","change","reset","select","submit","focusin","focusout","load","unload","beforeunload","resize","move","DOMContentLoaded","readystatechange","error","abort","scroll"]);function L(e,t){return t&&"".concat(t,"::").concat(S++)||e.uidEvent||S++}function j(e){var t=L(e);return e.uidEvent=t,O[t]=O[t]||{},O[t]}function N(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return Object.values(e).find((function(e){return e.callable===t&&e.delegationSelector===n}))}function D(e,t,n){var i="string"==typeof t,r=i?n:t||n,o=x(e);return P.has(o)||(o=e),[i,r,o]}function F(e,t,n,i,r){if("string"==typeof t&&e){var o=_slicedToArray(D(t,n,i),3),a=o[0],s=o[1],l=o[2];if(t in I){s=function(e){return function(t){if(!t.relatedTarget||t.relatedTarget!==t.delegateTarget&&!t.delegateTarget.contains(t.relatedTarget))return e.call(this,t)}}(s)}var c=j(e),u=c[l]||(c[l]={}),f=N(u,s,a?n:null);if(f)f.oneOff=f.oneOff&&r;else{var h=L(s,t.replace(A,"")),d=a?function(e,t,n){return function i(r){for(var o=e.querySelectorAll(t),a=r.target;a&&a!==this;a=a.parentNode){var s,l=_createForOfIteratorHelper(o);try{for(l.s();!(s=l.n()).done;)if(s.value===a)return R(r,{delegateTarget:a}),i.oneOff&&z.off(e,r.type,t,n),n.apply(a,[r])}catch(e){l.e(e)}finally{l.f()}}}}(e,n,s):function(e,t){return function n(i){return R(i,{delegateTarget:e}),n.oneOff&&z.off(e,i.type,t),t.apply(e,[i])}}(e,s);d.delegationSelector=a?n:null,d.callable=s,d.oneOff=r,d.uidEvent=h,u[h]=d,e.addEventListener(l,d,a)}}}function M(e,t,n,i,r){var o=N(t[n],i,r);o&&(e.removeEventListener(n,o,Boolean(r)),delete t[n][o.uidEvent])}function H(e,t,n,i){for(var r=t[n]||{},o=0,a=Object.entries(r);o1&&void 0!==arguments[1]?arguments[1]:{},n=function(){var t=_slicedToArray(r[i],2),n=t[0],o=t[1];try{e[n]=o}catch(t){Object.defineProperty(e,n,{configurable:!0,get:function(){return o}})}},i=0,r=Object.entries(t);i1&&void 0!==arguments[1]?arguments[1]:this.constructor.DefaultType,i=0,r=Object.entries(n);i2&&void 0!==arguments[2])||arguments[2])}},{key:"_getConfig",value:function(e){return e=this._mergeConfigObj(e,this._element),e=this._configAfterMerge(e),this._typeCheckConfig(e),e}}],[{key:"getInstance",value:function(e){return o(f(e),this.DATA_KEY)}},{key:"getOrCreateInstance",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return this.getInstance(e)||new this(e,"object"===_typeof(t)?t:null)}},{key:"VERSION",get:function(){return"5.3.3"}},{key:"DATA_KEY",get:function(){return"bs.".concat(this.NAME)}},{key:"EVENT_KEY",get:function(){return".".concat(this.DATA_KEY)}},{key:"eventName",value:function(e){return"".concat(e).concat(this.EVENT_KEY)}}])}(X),U=function(e){var t=e.getAttribute("data-bs-target");if(!t||"#"===t){var n=e.getAttribute("href");if(!n||!n.includes("#")&&!n.startsWith("."))return null;n.includes("#")&&!n.startsWith("#")&&(n="#".concat(n.split("#")[1])),t=n&&"#"!==n?n.trim():null}return t?t.split(",").map((function(e){return l(e)})).join(","):null},$={find:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return(t=[]).concat.apply(t,_toConsumableArray(Element.prototype.querySelectorAll.call(n,e)))},findOne:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.documentElement;return Element.prototype.querySelector.call(t,e)},children:function(e,t){var n;return(n=[]).concat.apply(n,_toConsumableArray(e.children)).filter((function(e){return e.matches(t)}))},parents:function(e,t){for(var n=[],i=e.parentNode.closest(t);i;)n.push(i),i=i.parentNode.closest(t);return n},prev:function(e,t){for(var n=e.previousElementSibling;n;){if(n.matches(t))return[n];n=n.previousElementSibling}return[]},next:function(e,t){for(var n=e.nextElementSibling;n;){if(n.matches(t))return[n];n=n.nextElementSibling}return[]},focusableChildren:function(e){var t=["a","button","input","textarea","select","details","[tabindex]",'[contenteditable="true"]'].map((function(e){return"".concat(e,':not([tabindex^="-"])')})).join(",");return this.find(t,e).filter((function(e){return!d(e)&&h(e)}))},getSelectorFromElement:function(e){var t=U(e);return t&&$.findOne(t)?t:null},getElementFromSelector:function(e){var t=U(e);return t?$.findOne(t):null},getMultipleElementsFromSelector:function(e){var t=U(e);return t?$.find(t):[]}},G=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"hide",n="click.dismiss".concat(e.EVENT_KEY),i=e.NAME;z.on(document,n,'[data-bs-dismiss="'.concat(i,'"]'),(function(n){if(["A","AREA"].includes(this.tagName)&&n.preventDefault(),!d(this)){var r=$.getElementFromSelector(this)||this.closest(".".concat(i));e.getOrCreateInstance(r)[t]()}}))},J=".".concat("bs.alert"),Z="close".concat(J),ee="closed".concat(J),te=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"close",value:function(){var e=this;if(!z.trigger(this._element,Z).defaultPrevented){this._element.classList.remove("show");var t=this._element.classList.contains("fade");this._queueCallback((function(){return e._destroyElement()}),this._element,t)}}},{key:"_destroyElement",value:function(){this._element.remove(),z.trigger(this._element,ee),this.dispose()}}],[{key:"NAME",get:function(){return"alert"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this);if("string"==typeof e){if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));n[e](this)}}))}}])}(Y);G(te,"close"),b(te);var ne=".".concat("bs.button"),ie='[data-bs-toggle="button"]',re="click".concat(ne).concat(".data-api"),oe=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"toggle",value:function(){this._element.setAttribute("aria-pressed",this._element.classList.toggle("active"))}}],[{key:"NAME",get:function(){return"button"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this);"toggle"===e&&n[e]()}))}}])}(Y);z.on(document,re,ie,(function(e){e.preventDefault();var t=e.target.closest(ie);oe.getOrCreateInstance(t).toggle()})),b(oe);var ae=".bs.swipe",se="touchstart".concat(ae),le="touchmove".concat(ae),ce="touchend".concat(ae),ue="pointerdown".concat(ae),fe="pointerup".concat(ae),he={endCallback:null,leftCallback:null,rightCallback:null},de={endCallback:"(function|null)",leftCallback:"(function|null)",rightCallback:"(function|null)"},_e=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t))._element=e,e&&t.isSupported()?(i._config=i._getConfig(n),i._deltaX=0,i._supportPointerEvents=Boolean(window.PointerEvent),i._initEvents(),i):_possibleConstructorReturn(i)}return _inherits(t,e),_createClass(t,[{key:"dispose",value:function(){z.off(this._element,ae)}},{key:"_start",value:function(e){this._supportPointerEvents?this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX):this._deltaX=e.touches[0].clientX}},{key:"_end",value:function(e){this._eventIsPointerPenTouch(e)&&(this._deltaX=e.clientX-this._deltaX),this._handleSwipe(),k(this._config.endCallback)}},{key:"_move",value:function(e){this._deltaX=e.touches&&e.touches.length>1?0:e.touches[0].clientX-this._deltaX}},{key:"_handleSwipe",value:function(){var e=Math.abs(this._deltaX);if(!(e<=40)){var t=e/this._deltaX;this._deltaX=0,t&&k(t>0?this._config.rightCallback:this._config.leftCallback)}}},{key:"_initEvents",value:function(){var e=this;this._supportPointerEvents?(z.on(this._element,ue,(function(t){return e._start(t)})),z.on(this._element,fe,(function(t){return e._end(t)})),this._element.classList.add("pointer-event")):(z.on(this._element,se,(function(t){return e._start(t)})),z.on(this._element,le,(function(t){return e._move(t)})),z.on(this._element,ce,(function(t){return e._end(t)})))}},{key:"_eventIsPointerPenTouch",value:function(e){return this._supportPointerEvents&&("pen"===e.pointerType||"touch"===e.pointerType)}}],[{key:"Default",get:function(){return he}},{key:"DefaultType",get:function(){return de}},{key:"NAME",get:function(){return"swipe"}},{key:"isSupported",value:function(){return"ontouchstart"in document.documentElement||navigator.maxTouchPoints>0}}])}(X),pe=".".concat("bs.carousel"),ge=".data-api",ve="next",me="prev",ye="left",be="right",ke="slide".concat(pe),we="slid".concat(pe),Ce="keydown".concat(pe),Ae="mouseenter".concat(pe),Te="mouseleave".concat(pe),Ee="dragstart".concat(pe),Oe="load".concat(pe).concat(ge),Se="click".concat(pe).concat(ge),Ie="carousel",Pe="active",Le=".active",je=".carousel-item",Ne=Le+je,De=_defineProperty(_defineProperty({},"ArrowLeft",be),"ArrowRight",ye),Fe={interval:5e3,keyboard:!0,pause:"hover",ride:!1,touch:!0,wrap:!0},Me={interval:"(number|boolean)",keyboard:"boolean",pause:"(string|boolean)",ride:"(boolean|string)",touch:"boolean",wrap:"boolean"},He=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._interval=null,i._activeElement=null,i._isSliding=!1,i.touchTimeout=null,i._swipeHelper=null,i._indicatorsElement=$.findOne(".carousel-indicators",i._element),i._addEventListeners(),i._config.ride===Ie&&i.cycle(),i}return _inherits(t,e),_createClass(t,[{key:"next",value:function(){this._slide(ve)}},{key:"nextWhenVisible",value:function(){!document.hidden&&h(this._element)&&this.next()}},{key:"prev",value:function(){this._slide(me)}},{key:"pause",value:function(){this._isSliding&&c(this._element),this._clearInterval()}},{key:"cycle",value:function(){var e=this;this._clearInterval(),this._updateInterval(),this._interval=setInterval((function(){return e.nextWhenVisible()}),this._config.interval)}},{key:"_maybeEnableCycle",value:function(){var e=this;this._config.ride&&(this._isSliding?z.one(this._element,we,(function(){return e.cycle()})):this.cycle())}},{key:"to",value:function(e){var t=this,n=this._getItems();if(!(e>n.length-1||e<0))if(this._isSliding)z.one(this._element,we,(function(){return t.to(e)}));else{var i=this._getItemIndex(this._getActive());if(i!==e){var r=e>i?ve:me;this._slide(r,n[e])}}}},{key:"dispose",value:function(){this._swipeHelper&&this._swipeHelper.dispose(),_get(_getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"_configAfterMerge",value:function(e){return e.defaultInterval=e.interval,e}},{key:"_addEventListeners",value:function(){var e=this;this._config.keyboard&&z.on(this._element,Ce,(function(t){return e._keydown(t)})),"hover"===this._config.pause&&(z.on(this._element,Ae,(function(){return e.pause()})),z.on(this._element,Te,(function(){return e._maybeEnableCycle()}))),this._config.touch&&_e.isSupported()&&this._addTouchEventListeners()}},{key:"_addTouchEventListeners",value:function(){var e,t=this,n=_createForOfIteratorHelper($.find(".carousel-item img",this._element));try{for(n.s();!(e=n.n()).done;){var i=e.value;z.on(i,Ee,(function(e){return e.preventDefault()}))}}catch(e){n.e(e)}finally{n.f()}var r={leftCallback:function(){return t._slide(t._directionToOrder(ye))},rightCallback:function(){return t._slide(t._directionToOrder(be))},endCallback:function(){"hover"===t._config.pause&&(t.pause(),t.touchTimeout&&clearTimeout(t.touchTimeout),t.touchTimeout=setTimeout((function(){return t._maybeEnableCycle()}),500+t._config.interval))}};this._swipeHelper=new _e(this._element,r)}},{key:"_keydown",value:function(e){if(!/input|textarea/i.test(e.target.tagName)){var t=De[e.key];t&&(e.preventDefault(),this._slide(this._directionToOrder(t)))}}},{key:"_getItemIndex",value:function(e){return this._getItems().indexOf(e)}},{key:"_setActiveIndicatorElement",value:function(e){if(this._indicatorsElement){var t=$.findOne(Le,this._indicatorsElement);t.classList.remove(Pe),t.removeAttribute("aria-current");var n=$.findOne('[data-bs-slide-to="'.concat(e,'"]'),this._indicatorsElement);n&&(n.classList.add(Pe),n.setAttribute("aria-current","true"))}}},{key:"_updateInterval",value:function(){var e=this._activeElement||this._getActive();if(e){var t=Number.parseInt(e.getAttribute("data-bs-interval"),10);this._config.interval=t||this._config.defaultInterval}}},{key:"_slide",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!this._isSliding){var i=this._getActive(),r=e===ve,o=n||C(this._getItems(),i,r,this._config.wrap);if(o!==i){var a=this._getItemIndex(o),s=function(n){return z.trigger(t._element,n,{relatedTarget:o,direction:t._orderToDirection(e),from:t._getItemIndex(i),to:a})};if(!s(ke).defaultPrevented&&i&&o){var l=Boolean(this._interval);this.pause(),this._isSliding=!0,this._setActiveIndicatorElement(a),this._activeElement=o;var c=r?"carousel-item-start":"carousel-item-end",u=r?"carousel-item-next":"carousel-item-prev";o.classList.add(u),g(o),i.classList.add(c),o.classList.add(c);this._queueCallback((function(){o.classList.remove(c,u),o.classList.add(Pe),i.classList.remove(Pe,u,c),t._isSliding=!1,s(we)}),i,this._isAnimated()),l&&this.cycle()}}}}},{key:"_isAnimated",value:function(){return this._element.classList.contains("slide")}},{key:"_getActive",value:function(){return $.findOne(Ne,this._element)}},{key:"_getItems",value:function(){return $.find(je,this._element)}},{key:"_clearInterval",value:function(){this._interval&&(clearInterval(this._interval),this._interval=null)}},{key:"_directionToOrder",value:function(e){return y()?e===ye?me:ve:e===ye?ve:me}},{key:"_orderToDirection",value:function(e){return y()?e===me?ye:be:e===me?be:ye}}],[{key:"Default",get:function(){return Fe}},{key:"DefaultType",get:function(){return Me}},{key:"NAME",get:function(){return"carousel"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("number"!=typeof e){if("string"==typeof e){if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}else n.to(e)}))}}])}(Y);z.on(document,Se,"[data-bs-slide], [data-bs-slide-to]",(function(e){var t=$.getElementFromSelector(this);if(t&&t.classList.contains(Ie)){e.preventDefault();var n=He.getOrCreateInstance(t),i=this.getAttribute("data-bs-slide-to");if(i)return n.to(i),void n._maybeEnableCycle();if("next"===Q(this,"slide"))return n.next(),void n._maybeEnableCycle();n.prev(),n._maybeEnableCycle()}})),z.on(window,Oe,(function(){var e,t=_createForOfIteratorHelper($.find('[data-bs-ride="carousel"]'));try{for(t.s();!(e=t.n()).done;){var n=e.value;He.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),b(He);var xe=".".concat("bs.collapse"),ze="show".concat(xe),Re="shown".concat(xe),Be="hide".concat(xe),We="hidden".concat(xe),qe="click".concat(xe).concat(".data-api"),Ke="show",Ve="collapse",Qe="collapsing",Xe=":scope .".concat(Ve," .").concat(Ve),Ye='[data-bs-toggle="collapse"]',Ue={parent:null,toggle:!0},$e={parent:"(null|element)",toggle:"boolean"},Ge=function(e){function t(e,n){var i;_classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._isTransitioning=!1,i._triggerArray=[];var r,o=_createForOfIteratorHelper($.find(Ye));try{for(o.s();!(r=o.n()).done;){var a=r.value,s=$.getSelectorFromElement(a),l=$.find(s).filter((function(e){return e===i._element}));null!==s&&l.length&&i._triggerArray.push(a)}}catch(e){o.e(e)}finally{o.f()}return i._initializeChildren(),i._config.parent||i._addAriaAndCollapsedClass(i._triggerArray,i._isShown()),i._config.toggle&&i.toggle(),i}return _inherits(t,e),_createClass(t,[{key:"toggle",value:function(){this._isShown()?this.hide():this.show()}},{key:"show",value:function(){var e=this;if(!this._isTransitioning&&!this._isShown()){var n=[];if(this._config.parent&&(n=this._getFirstLevelChildren(".collapse.show, .collapse.collapsing").filter((function(t){return t!==e._element})).map((function(e){return t.getOrCreateInstance(e,{toggle:!1})}))),!n.length||!n[0]._isTransitioning)if(!z.trigger(this._element,ze).defaultPrevented){var i,r=_createForOfIteratorHelper(n);try{for(r.s();!(i=r.n()).done;){i.value.hide()}}catch(e){r.e(e)}finally{r.f()}var o=this._getDimension();this._element.classList.remove(Ve),this._element.classList.add(Qe),this._element.style[o]=0,this._addAriaAndCollapsedClass(this._triggerArray,!0),this._isTransitioning=!0;var a=o[0].toUpperCase()+o.slice(1),s="scroll".concat(a);this._queueCallback((function(){e._isTransitioning=!1,e._element.classList.remove(Qe),e._element.classList.add(Ve,Ke),e._element.style[o]="",z.trigger(e._element,Re)}),this._element,!0),this._element.style[o]="".concat(this._element[s],"px")}}}},{key:"hide",value:function(){var e=this;if(!this._isTransitioning&&this._isShown()&&!z.trigger(this._element,Be).defaultPrevented){var t=this._getDimension();this._element.style[t]="".concat(this._element.getBoundingClientRect()[t],"px"),g(this._element),this._element.classList.add(Qe),this._element.classList.remove(Ve,Ke);var n,i=_createForOfIteratorHelper(this._triggerArray);try{for(i.s();!(n=i.n()).done;){var r=n.value,o=$.getElementFromSelector(r);o&&!this._isShown(o)&&this._addAriaAndCollapsedClass([r],!1)}}catch(e){i.e(e)}finally{i.f()}this._isTransitioning=!0;this._element.style[t]="",this._queueCallback((function(){e._isTransitioning=!1,e._element.classList.remove(Qe),e._element.classList.add(Ve),z.trigger(e._element,We)}),this._element,!0)}}},{key:"_isShown",value:function(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._element).classList.contains(Ke)}},{key:"_configAfterMerge",value:function(e){return e.toggle=Boolean(e.toggle),e.parent=f(e.parent),e}},{key:"_getDimension",value:function(){return this._element.classList.contains("collapse-horizontal")?"width":"height"}},{key:"_initializeChildren",value:function(){if(this._config.parent){var e,t=_createForOfIteratorHelper(this._getFirstLevelChildren(Ye));try{for(t.s();!(e=t.n()).done;){var n=e.value,i=$.getElementFromSelector(n);i&&this._addAriaAndCollapsedClass([n],this._isShown(i))}}catch(e){t.e(e)}finally{t.f()}}}},{key:"_getFirstLevelChildren",value:function(e){var t=$.find(Xe,this._config.parent);return $.find(e,this._config.parent).filter((function(e){return!t.includes(e)}))}},{key:"_addAriaAndCollapsedClass",value:function(e,t){if(e.length){var n,i=_createForOfIteratorHelper(e);try{for(i.s();!(n=i.n()).done;){var r=n.value;r.classList.toggle("collapsed",!t),r.setAttribute("aria-expanded",t)}}catch(e){i.e(e)}finally{i.f()}}}}],[{key:"Default",get:function(){return Ue}},{key:"DefaultType",get:function(){return $e}},{key:"NAME",get:function(){return"collapse"}},{key:"jQueryInterface",value:function(e){var n={};return"string"==typeof e&&/show|hide/.test(e)&&(n.toggle=!1),this.each((function(){var i=t.getOrCreateInstance(this,n);if("string"==typeof e){if(void 0===i[e])throw new TypeError('No method named "'.concat(e,'"'));i[e]()}}))}}])}(Y);z.on(document,qe,Ye,(function(e){("A"===e.target.tagName||e.delegateTarget&&"A"===e.delegateTarget.tagName)&&e.preventDefault();var t,n=_createForOfIteratorHelper($.getMultipleElementsFromSelector(this));try{for(n.s();!(t=n.n()).done;){var i=t.value;Ge.getOrCreateInstance(i,{toggle:!1}).toggle()}}catch(e){n.e(e)}finally{n.f()}})),b(Ge);var Je="dropdown",Ze=".".concat("bs.dropdown"),et=".data-api",tt="ArrowUp",nt="ArrowDown",it="hide".concat(Ze),rt="hidden".concat(Ze),ot="show".concat(Ze),at="shown".concat(Ze),st="click".concat(Ze).concat(et),lt="keydown".concat(Ze).concat(et),ct="keyup".concat(Ze).concat(et),ut="show",ft='[data-bs-toggle="dropdown"]:not(.disabled):not(:disabled)',ht="".concat(ft,".").concat(ut),dt=".dropdown-menu",_t=y()?"top-end":"top-start",pt=y()?"top-start":"top-end",gt=y()?"bottom-end":"bottom-start",vt=y()?"bottom-start":"bottom-end",mt=y()?"left-start":"right-start",yt=y()?"right-start":"left-start",bt={autoClose:!0,boundary:"clippingParents",display:"dynamic",offset:[0,2],popperConfig:null,reference:"toggle"},kt={autoClose:"(boolean|string)",boundary:"(string|element)",display:"string",offset:"(array|string|function)",popperConfig:"(null|object|function)",reference:"(string|element|object)"},wt=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._popper=null,i._parent=i._element.parentNode,i._menu=$.next(i._element,dt)[0]||$.prev(i._element,dt)[0]||$.findOne(dt,i._parent),i._inNavbar=i._detectNavbar(),i}return _inherits(t,e),_createClass(t,[{key:"toggle",value:function(){return this._isShown()?this.hide():this.show()}},{key:"show",value:function(){if(!d(this._element)&&!this._isShown()){var e={relatedTarget:this._element};if(!z.trigger(this._element,ot,e).defaultPrevented){if(this._createPopper(),"ontouchstart"in document.documentElement&&!this._parent.closest(".navbar-nav")){var t,n,i=_createForOfIteratorHelper((t=[]).concat.apply(t,_toConsumableArray(document.body.children)));try{for(i.s();!(n=i.n()).done;){var r=n.value;z.on(r,"mouseover",p)}}catch(e){i.e(e)}finally{i.f()}}this._element.focus(),this._element.setAttribute("aria-expanded",!0),this._menu.classList.add(ut),this._element.classList.add(ut),z.trigger(this._element,at,e)}}}},{key:"hide",value:function(){if(!d(this._element)&&this._isShown()){var e={relatedTarget:this._element};this._completeHide(e)}}},{key:"dispose",value:function(){this._popper&&this._popper.destroy(),_get(_getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"update",value:function(){this._inNavbar=this._detectNavbar(),this._popper&&this._popper.update()}},{key:"_completeHide",value:function(e){if(!z.trigger(this._element,it,e).defaultPrevented){if("ontouchstart"in document.documentElement){var t,n,i=_createForOfIteratorHelper((t=[]).concat.apply(t,_toConsumableArray(document.body.children)));try{for(i.s();!(n=i.n()).done;){var r=n.value;z.off(r,"mouseover",p)}}catch(e){i.e(e)}finally{i.f()}}this._popper&&this._popper.destroy(),this._menu.classList.remove(ut),this._element.classList.remove(ut),this._element.setAttribute("aria-expanded","false"),K(this._menu,"popper"),z.trigger(this._element,rt,e)}}},{key:"_getConfig",value:function(e){if("object"===_typeof((e=_get(_getPrototypeOf(t.prototype),"_getConfig",this).call(this,e)).reference)&&!u(e.reference)&&"function"!=typeof e.reference.getBoundingClientRect)throw new TypeError("".concat(Je.toUpperCase(),': Option "reference" provided type "object" without a required "getBoundingClientRect" method.'));return e}},{key:"_createPopper",value:function(){if(void 0===n)throw new TypeError("Bootstrap's dropdowns require Popper (https://popper.js.org)");var e=this._element;"parent"===this._config.reference?e=this._parent:u(this._config.reference)?e=f(this._config.reference):"object"===_typeof(this._config.reference)&&(e=this._config.reference);var t=this._getPopperConfig();this._popper=n.createPopper(e,this._menu,t)}},{key:"_isShown",value:function(){return this._menu.classList.contains(ut)}},{key:"_getPlacement",value:function(){var e=this._parent;if(e.classList.contains("dropend"))return mt;if(e.classList.contains("dropstart"))return yt;if(e.classList.contains("dropup-center"))return"top";if(e.classList.contains("dropdown-center"))return"bottom";var t="end"===getComputedStyle(this._menu).getPropertyValue("--bs-position").trim();return e.classList.contains("dropup")?t?pt:_t:t?vt:gt}},{key:"_detectNavbar",value:function(){return null!==this._element.closest(".navbar")}},{key:"_getOffset",value:function(){var e=this,t=this._config.offset;return"string"==typeof t?t.split(",").map((function(e){return Number.parseInt(e,10)})):"function"==typeof t?function(n){return t(n,e._element)}:t}},{key:"_getPopperConfig",value:function(){var e={placement:this._getPlacement(),modifiers:[{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"offset",options:{offset:this._getOffset()}}]};return(this._inNavbar||"static"===this._config.display)&&(q(this._menu,"popper","static"),e.modifiers=[{name:"applyStyles",enabled:!1}]),_objectSpread(_objectSpread({},e),k(this._config.popperConfig,[e]))}},{key:"_selectMenuItem",value:function(e){var t=e.key,n=e.target,i=$.find(".dropdown-menu .dropdown-item:not(.disabled):not(:disabled)",this._menu).filter((function(e){return h(e)}));i.length&&C(i,n,t===nt,!i.includes(n)).focus()}}],[{key:"Default",get:function(){return bt}},{key:"DefaultType",get:function(){return kt}},{key:"NAME",get:function(){return Je}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}))}},{key:"clearMenus",value:function(e){if(2!==e.button&&("keyup"!==e.type||"Tab"===e.key)){var n,i=_createForOfIteratorHelper($.find(ht));try{for(i.s();!(n=i.n()).done;){var r=n.value,o=t.getInstance(r);if(o&&!1!==o._config.autoClose){var a=e.composedPath(),s=a.includes(o._menu);if(!(a.includes(o._element)||"inside"===o._config.autoClose&&!s||"outside"===o._config.autoClose&&s||o._menu.contains(e.target)&&("keyup"===e.type&&"Tab"===e.key||/input|select|option|textarea|form/i.test(e.target.tagName)))){var l={relatedTarget:o._element};"click"===e.type&&(l.clickEvent=e),o._completeHide(l)}}}}catch(e){i.e(e)}finally{i.f()}}}},{key:"dataApiKeydownHandler",value:function(e){var n=/input|textarea/i.test(e.target.tagName),i="Escape"===e.key,r=[tt,nt].includes(e.key);if((r||i)&&(!n||i)){e.preventDefault();var o=this.matches(ft)?this:$.prev(this,ft)[0]||$.next(this,ft)[0]||$.findOne(ft,e.delegateTarget.parentNode),a=t.getOrCreateInstance(o);if(r)return e.stopPropagation(),a.show(),void a._selectMenuItem(e);a._isShown()&&(e.stopPropagation(),a.hide(),o.focus())}}}])}(Y);z.on(document,lt,ft,wt.dataApiKeydownHandler),z.on(document,lt,dt,wt.dataApiKeydownHandler),z.on(document,st,wt.clearMenus),z.on(document,ct,wt.clearMenus),z.on(document,st,ft,(function(e){e.preventDefault(),wt.getOrCreateInstance(this).toggle()})),b(wt);var Ct="backdrop",At="show",Tt="mousedown.bs.".concat(Ct),Et={className:"modal-backdrop",clickCallback:null,isAnimated:!1,isVisible:!0,rootElement:"body"},Ot={className:"string",clickCallback:"(function|null)",isAnimated:"boolean",isVisible:"boolean",rootElement:"(element|string)"},St=function(e){function t(e){var n;return _classCallCheck(this,t),(n=_callSuper(this,t))._config=n._getConfig(e),n._isAppended=!1,n._element=null,n}return _inherits(t,e),_createClass(t,[{key:"show",value:function(e){if(this._config.isVisible){this._append();var t=this._getElement();this._config.isAnimated&&g(t),t.classList.add(At),this._emulateAnimation((function(){k(e)}))}else k(e)}},{key:"hide",value:function(e){var t=this;this._config.isVisible?(this._getElement().classList.remove(At),this._emulateAnimation((function(){t.dispose(),k(e)}))):k(e)}},{key:"dispose",value:function(){this._isAppended&&(z.off(this._element,Tt),this._element.remove(),this._isAppended=!1)}},{key:"_getElement",value:function(){if(!this._element){var e=document.createElement("div");e.className=this._config.className,this._config.isAnimated&&e.classList.add("fade"),this._element=e}return this._element}},{key:"_configAfterMerge",value:function(e){return e.rootElement=f(e.rootElement),e}},{key:"_append",value:function(){var e=this;if(!this._isAppended){var t=this._getElement();this._config.rootElement.append(t),z.on(t,Tt,(function(){k(e._config.clickCallback)})),this._isAppended=!0}}},{key:"_emulateAnimation",value:function(e){w(e,this._getElement(),this._config.isAnimated)}}],[{key:"Default",get:function(){return Et}},{key:"DefaultType",get:function(){return Ot}},{key:"NAME",get:function(){return Ct}}])}(X),It=".".concat("bs.focustrap"),Pt="focusin".concat(It),Lt="keydown.tab".concat(It),jt="backward",Nt={autofocus:!0,trapElement:null},Dt={autofocus:"boolean",trapElement:"element"},Ft=function(e){function t(e){var n;return _classCallCheck(this,t),(n=_callSuper(this,t))._config=n._getConfig(e),n._isActive=!1,n._lastTabNavDirection=null,n}return _inherits(t,e),_createClass(t,[{key:"activate",value:function(){var e=this;this._isActive||(this._config.autofocus&&this._config.trapElement.focus(),z.off(document,It),z.on(document,Pt,(function(t){return e._handleFocusin(t)})),z.on(document,Lt,(function(t){return e._handleKeydown(t)})),this._isActive=!0)}},{key:"deactivate",value:function(){this._isActive&&(this._isActive=!1,z.off(document,It))}},{key:"_handleFocusin",value:function(e){var t=this._config.trapElement;if(e.target!==document&&e.target!==t&&!t.contains(e.target)){var n=$.focusableChildren(t);0===n.length?t.focus():this._lastTabNavDirection===jt?n[n.length-1].focus():n[0].focus()}}},{key:"_handleKeydown",value:function(e){"Tab"===e.key&&(this._lastTabNavDirection=e.shiftKey?jt:"forward")}}],[{key:"Default",get:function(){return Nt}},{key:"DefaultType",get:function(){return Dt}},{key:"NAME",get:function(){return"focustrap"}}])}(X),Mt=".fixed-top, .fixed-bottom, .is-fixed, .sticky-top",Ht=".sticky-top",xt="padding-right",zt="margin-right",Rt=function(){return _createClass((function e(){_classCallCheck(this,e),this._element=document.body}),[{key:"getWidth",value:function(){var e=document.documentElement.clientWidth;return Math.abs(window.innerWidth-e)}},{key:"hide",value:function(){var e=this.getWidth();this._disableOverFlow(),this._setElementAttributes(this._element,xt,(function(t){return t+e})),this._setElementAttributes(Mt,xt,(function(t){return t+e})),this._setElementAttributes(Ht,zt,(function(t){return t-e}))}},{key:"reset",value:function(){this._resetElementAttributes(this._element,"overflow"),this._resetElementAttributes(this._element,xt),this._resetElementAttributes(Mt,xt),this._resetElementAttributes(Ht,zt)}},{key:"isOverflowing",value:function(){return this.getWidth()>0}},{key:"_disableOverFlow",value:function(){this._saveInitialAttribute(this._element,"overflow"),this._element.style.overflow="hidden"}},{key:"_setElementAttributes",value:function(e,t,n){var i=this,r=this.getWidth();this._applyManipulationCallback(e,(function(e){if(!(e!==i._element&&window.innerWidth>e.clientWidth+r)){i._saveInitialAttribute(e,t);var o=window.getComputedStyle(e).getPropertyValue(t);e.style.setProperty(t,"".concat(n(Number.parseFloat(o)),"px"))}}))}},{key:"_saveInitialAttribute",value:function(e,t){var n=e.style.getPropertyValue(t);n&&q(e,t,n)}},{key:"_resetElementAttributes",value:function(e,t){this._applyManipulationCallback(e,(function(e){var n=Q(e,t);null!==n?(K(e,t),e.style.setProperty(t,n)):e.style.removeProperty(t)}))}},{key:"_applyManipulationCallback",value:function(e,t){if(u(e))t(e);else{var n,i=_createForOfIteratorHelper($.find(e,this._element));try{for(i.s();!(n=i.n()).done;){t(n.value)}}catch(e){i.e(e)}finally{i.f()}}}}])}(),Bt=".".concat("bs.modal"),Wt="hide".concat(Bt),qt="hidePrevented".concat(Bt),Kt="hidden".concat(Bt),Vt="show".concat(Bt),Qt="shown".concat(Bt),Xt="resize".concat(Bt),Yt="click.dismiss".concat(Bt),Ut="mousedown.dismiss".concat(Bt),$t="keydown.dismiss".concat(Bt),Gt="click".concat(Bt).concat(".data-api"),Jt="modal-open",Zt="show",en="modal-static",tn={backdrop:!0,focus:!0,keyboard:!0},nn={backdrop:"(boolean|string)",focus:"boolean",keyboard:"boolean"},rn=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._dialog=$.findOne(".modal-dialog",i._element),i._backdrop=i._initializeBackDrop(),i._focustrap=i._initializeFocusTrap(),i._isShown=!1,i._isTransitioning=!1,i._scrollBar=new Rt,i._addEventListeners(),i}return _inherits(t,e),_createClass(t,[{key:"toggle",value:function(e){return this._isShown?this.hide():this.show(e)}},{key:"show",value:function(e){var t=this;this._isShown||this._isTransitioning||(z.trigger(this._element,Vt,{relatedTarget:e}).defaultPrevented||(this._isShown=!0,this._isTransitioning=!0,this._scrollBar.hide(),document.body.classList.add(Jt),this._adjustDialog(),this._backdrop.show((function(){return t._showElement(e)}))))}},{key:"hide",value:function(){var e=this;this._isShown&&!this._isTransitioning&&(z.trigger(this._element,Wt).defaultPrevented||(this._isShown=!1,this._isTransitioning=!0,this._focustrap.deactivate(),this._element.classList.remove(Zt),this._queueCallback((function(){return e._hideModal()}),this._element,this._isAnimated())))}},{key:"dispose",value:function(){z.off(window,Bt),z.off(this._dialog,Bt),this._backdrop.dispose(),this._focustrap.deactivate(),_get(_getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"handleUpdate",value:function(){this._adjustDialog()}},{key:"_initializeBackDrop",value:function(){return new St({isVisible:Boolean(this._config.backdrop),isAnimated:this._isAnimated()})}},{key:"_initializeFocusTrap",value:function(){return new Ft({trapElement:this._element})}},{key:"_showElement",value:function(e){var t=this;document.body.contains(this._element)||document.body.append(this._element),this._element.style.display="block",this._element.removeAttribute("aria-hidden"),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.scrollTop=0;var n=$.findOne(".modal-body",this._dialog);n&&(n.scrollTop=0),g(this._element),this._element.classList.add(Zt);this._queueCallback((function(){t._config.focus&&t._focustrap.activate(),t._isTransitioning=!1,z.trigger(t._element,Qt,{relatedTarget:e})}),this._dialog,this._isAnimated())}},{key:"_addEventListeners",value:function(){var e=this;z.on(this._element,$t,(function(t){"Escape"===t.key&&(e._config.keyboard?e.hide():e._triggerBackdropTransition())})),z.on(window,Xt,(function(){e._isShown&&!e._isTransitioning&&e._adjustDialog()})),z.on(this._element,Ut,(function(t){z.one(e._element,Yt,(function(n){e._element===t.target&&e._element===n.target&&("static"!==e._config.backdrop?e._config.backdrop&&e.hide():e._triggerBackdropTransition())}))}))}},{key:"_hideModal",value:function(){var e=this;this._element.style.display="none",this._element.setAttribute("aria-hidden",!0),this._element.removeAttribute("aria-modal"),this._element.removeAttribute("role"),this._isTransitioning=!1,this._backdrop.hide((function(){document.body.classList.remove(Jt),e._resetAdjustments(),e._scrollBar.reset(),z.trigger(e._element,Kt)}))}},{key:"_isAnimated",value:function(){return this._element.classList.contains("fade")}},{key:"_triggerBackdropTransition",value:function(){var e=this;if(!z.trigger(this._element,qt).defaultPrevented){var t=this._element.scrollHeight>document.documentElement.clientHeight,n=this._element.style.overflowY;"hidden"===n||this._element.classList.contains(en)||(t||(this._element.style.overflowY="hidden"),this._element.classList.add(en),this._queueCallback((function(){e._element.classList.remove(en),e._queueCallback((function(){e._element.style.overflowY=n}),e._dialog)}),this._dialog),this._element.focus())}}},{key:"_adjustDialog",value:function(){var e=this._element.scrollHeight>document.documentElement.clientHeight,t=this._scrollBar.getWidth(),n=t>0;if(n&&!e){var i=y()?"paddingLeft":"paddingRight";this._element.style[i]="".concat(t,"px")}if(!n&&e){var r=y()?"paddingRight":"paddingLeft";this._element.style[r]="".concat(t,"px")}}},{key:"_resetAdjustments",value:function(){this._element.style.paddingLeft="",this._element.style.paddingRight=""}}],[{key:"Default",get:function(){return tn}},{key:"DefaultType",get:function(){return nn}},{key:"NAME",get:function(){return"modal"}},{key:"jQueryInterface",value:function(e,n){return this.each((function(){var i=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===i[e])throw new TypeError('No method named "'.concat(e,'"'));i[e](n)}}))}}])}(Y);z.on(document,Gt,'[data-bs-toggle="modal"]',(function(e){var t=this,n=$.getElementFromSelector(this);["A","AREA"].includes(this.tagName)&&e.preventDefault(),z.one(n,Vt,(function(e){e.defaultPrevented||z.one(n,Kt,(function(){h(t)&&t.focus()}))}));var i=$.findOne(".modal.show");i&&rn.getInstance(i).hide(),rn.getOrCreateInstance(n).toggle(this)})),G(rn),b(rn);var on=".".concat("bs.offcanvas"),an=".data-api",sn="load".concat(on).concat(an),ln="show",cn="showing",un="hiding",fn=".offcanvas.show",hn="show".concat(on),dn="shown".concat(on),_n="hide".concat(on),pn="hidePrevented".concat(on),gn="hidden".concat(on),vn="resize".concat(on),mn="click".concat(on).concat(an),yn="keydown.dismiss".concat(on),bn={backdrop:!0,keyboard:!0,scroll:!1},kn={backdrop:"(boolean|string)",keyboard:"boolean",scroll:"boolean"},wn=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._isShown=!1,i._backdrop=i._initializeBackDrop(),i._focustrap=i._initializeFocusTrap(),i._addEventListeners(),i}return _inherits(t,e),_createClass(t,[{key:"toggle",value:function(e){return this._isShown?this.hide():this.show(e)}},{key:"show",value:function(e){var t=this;if(!this._isShown&&!z.trigger(this._element,hn,{relatedTarget:e}).defaultPrevented){this._isShown=!0,this._backdrop.show(),this._config.scroll||(new Rt).hide(),this._element.setAttribute("aria-modal",!0),this._element.setAttribute("role","dialog"),this._element.classList.add(cn);this._queueCallback((function(){t._config.scroll&&!t._config.backdrop||t._focustrap.activate(),t._element.classList.add(ln),t._element.classList.remove(cn),z.trigger(t._element,dn,{relatedTarget:e})}),this._element,!0)}}},{key:"hide",value:function(){var e=this;if(this._isShown&&!z.trigger(this._element,_n).defaultPrevented){this._focustrap.deactivate(),this._element.blur(),this._isShown=!1,this._element.classList.add(un),this._backdrop.hide();this._queueCallback((function(){e._element.classList.remove(ln,un),e._element.removeAttribute("aria-modal"),e._element.removeAttribute("role"),e._config.scroll||(new Rt).reset(),z.trigger(e._element,gn)}),this._element,!0)}}},{key:"dispose",value:function(){this._backdrop.dispose(),this._focustrap.deactivate(),_get(_getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"_initializeBackDrop",value:function(){var e=this,t=Boolean(this._config.backdrop);return new St({className:"offcanvas-backdrop",isVisible:t,isAnimated:!0,rootElement:this._element.parentNode,clickCallback:t?function(){"static"!==e._config.backdrop?e.hide():z.trigger(e._element,pn)}:null})}},{key:"_initializeFocusTrap",value:function(){return new Ft({trapElement:this._element})}},{key:"_addEventListeners",value:function(){var e=this;z.on(this._element,yn,(function(t){"Escape"===t.key&&(e._config.keyboard?e.hide():z.trigger(e._element,pn))}))}}],[{key:"Default",get:function(){return bn}},{key:"DefaultType",get:function(){return kn}},{key:"NAME",get:function(){return"offcanvas"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));n[e](this)}}))}}])}(Y);z.on(document,mn,'[data-bs-toggle="offcanvas"]',(function(e){var t=this,n=$.getElementFromSelector(this);if(["A","AREA"].includes(this.tagName)&&e.preventDefault(),!d(this)){z.one(n,gn,(function(){h(t)&&t.focus()}));var i=$.findOne(fn);i&&i!==n&&wn.getInstance(i).hide(),wn.getOrCreateInstance(n).toggle(this)}})),z.on(window,sn,(function(){var e,t=_createForOfIteratorHelper($.find(fn));try{for(t.s();!(e=t.n()).done;){var n=e.value;wn.getOrCreateInstance(n).show()}}catch(e){t.e(e)}finally{t.f()}})),z.on(window,vn,(function(){var e,t=_createForOfIteratorHelper($.find("[aria-modal][class*=show][class*=offcanvas-]"));try{for(t.s();!(e=t.n()).done;){var n=e.value;"fixed"!==getComputedStyle(n).position&&wn.getOrCreateInstance(n).hide()}}catch(e){t.e(e)}finally{t.f()}})),G(wn),b(wn);var Cn={"*":["class","dir","id","lang","role",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],dd:[],div:[],dl:[],dt:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","srcset","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},An=new Set(["background","cite","href","itemtype","longdesc","poster","src","xlink:href"]),Tn=/^(?!javascript:)(?:[a-z0-9+.-]+:|[^&:/?#]*(?:[/?#]|$))/i,En=function(e,t){var n=e.nodeName.toLowerCase();return t.includes(n)?!An.has(n)||Boolean(Tn.test(e.nodeValue)):t.filter((function(e){return e instanceof RegExp})).some((function(e){return e.test(n)}))};var On={allowList:Cn,content:{},extraClass:"",html:!1,sanitize:!0,sanitizeFn:null,template:"
    "},Sn={allowList:"object",content:"object",extraClass:"(string|function)",html:"boolean",sanitize:"boolean",sanitizeFn:"(null|function)",template:"string"},In={entry:"(string|element|function|null)",selector:"(string|element)"},Pn=function(e){function t(e){var n;return _classCallCheck(this,t),(n=_callSuper(this,t))._config=n._getConfig(e),n}return _inherits(t,e),_createClass(t,[{key:"getContent",value:function(){var e=this;return Object.values(this._config.content).map((function(t){return e._resolvePossibleFunction(t)})).filter(Boolean)}},{key:"hasContent",value:function(){return this.getContent().length>0}},{key:"changeContent",value:function(e){return this._checkContent(e),this._config.content=_objectSpread(_objectSpread({},this._config.content),e),this}},{key:"toHtml",value:function(){var e=document.createElement("div");e.innerHTML=this._maybeSanitize(this._config.template);for(var t=0,n=Object.entries(this._config.content);t
    ',title:"",trigger:"hover focus"},Rn={allowList:"object",animation:"boolean",boundary:"(string|element)",container:"(string|element|boolean)",customClass:"(string|function)",delay:"(number|object)",fallbackPlacements:"array",html:"boolean",offset:"(array|string|function)",placement:"(string|function)",popperConfig:"(null|object|function)",sanitize:"boolean",sanitizeFn:"(null|function)",selector:"(string|boolean)",template:"string",title:"(string|element|function)",trigger:"string"},Bn=function(e){function t(e,i){var r;if(_classCallCheck(this,t),void 0===n)throw new TypeError("Bootstrap's tooltips require Popper (https://popper.js.org)");return(r=_callSuper(this,t,[e,i]))._isEnabled=!0,r._timeout=0,r._isHovered=null,r._activeTrigger={},r._popper=null,r._templateFactory=null,r._newContent=null,r.tip=null,r._setListeners(),r._config.selector||r._fixTitle(),r}return _inherits(t,e),_createClass(t,[{key:"enable",value:function(){this._isEnabled=!0}},{key:"disable",value:function(){this._isEnabled=!1}},{key:"toggleEnabled",value:function(){this._isEnabled=!this._isEnabled}},{key:"toggle",value:function(){this._isEnabled&&(this._activeTrigger.click=!this._activeTrigger.click,this._isShown()?this._leave():this._enter())}},{key:"dispose",value:function(){clearTimeout(this._timeout),z.off(this._element.closest(Dn),Fn,this._hideModalHandler),this._element.getAttribute("data-bs-original-title")&&this._element.setAttribute("title",this._element.getAttribute("data-bs-original-title")),this._disposePopper(),_get(_getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"show",value:function(){var e=this;if("none"===this._element.style.display)throw new Error("Please use show on visible elements");if(this._isWithContent()&&this._isEnabled){var t=z.trigger(this._element,this.constructor.eventName("show")),n=(_(this._element)||this._element.ownerDocument.documentElement).contains(this._element);if(!t.defaultPrevented&&n){this._disposePopper();var i=this._getTipElement();this._element.setAttribute("aria-describedby",i.getAttribute("id"));var r=this._config.container;if(this._element.ownerDocument.documentElement.contains(this.tip)||(r.append(i),z.trigger(this._element,this.constructor.eventName("inserted"))),this._popper=this._createPopper(i),i.classList.add(Nn),"ontouchstart"in document.documentElement){var o,a,s=_createForOfIteratorHelper((o=[]).concat.apply(o,_toConsumableArray(document.body.children)));try{for(s.s();!(a=s.n()).done;){var l=a.value;z.on(l,"mouseover",p)}}catch(e){s.e(e)}finally{s.f()}}this._queueCallback((function(){z.trigger(e._element,e.constructor.eventName("shown")),!1===e._isHovered&&e._leave(),e._isHovered=!1}),this.tip,this._isAnimated())}}}},{key:"hide",value:function(){var e=this;if(this._isShown()&&!z.trigger(this._element,this.constructor.eventName("hide")).defaultPrevented){if(this._getTipElement().classList.remove(Nn),"ontouchstart"in document.documentElement){var t,n,i=_createForOfIteratorHelper((t=[]).concat.apply(t,_toConsumableArray(document.body.children)));try{for(i.s();!(n=i.n()).done;){var r=n.value;z.off(r,"mouseover",p)}}catch(e){i.e(e)}finally{i.f()}}this._activeTrigger.click=!1,this._activeTrigger[Hn]=!1,this._activeTrigger[Mn]=!1,this._isHovered=null;this._queueCallback((function(){e._isWithActiveTrigger()||(e._isHovered||e._disposePopper(),e._element.removeAttribute("aria-describedby"),z.trigger(e._element,e.constructor.eventName("hidden")))}),this.tip,this._isAnimated())}}},{key:"update",value:function(){this._popper&&this._popper.update()}},{key:"_isWithContent",value:function(){return Boolean(this._getTitle())}},{key:"_getTipElement",value:function(){return this.tip||(this.tip=this._createTipElement(this._newContent||this._getContentForTemplate())),this.tip}},{key:"_createTipElement",value:function(e){var t=this._getTemplateFactory(e).toHtml();if(!t)return null;t.classList.remove(jn,Nn),t.classList.add("bs-".concat(this.constructor.NAME,"-auto"));var n=function(e){do{e+=Math.floor(1e6*Math.random())}while(document.getElementById(e));return e}(this.constructor.NAME).toString();return t.setAttribute("id",n),this._isAnimated()&&t.classList.add(jn),t}},{key:"setContent",value:function(e){this._newContent=e,this._isShown()&&(this._disposePopper(),this.show())}},{key:"_getTemplateFactory",value:function(e){return this._templateFactory?this._templateFactory.changeContent(e):this._templateFactory=new Pn(_objectSpread(_objectSpread({},this._config),{},{content:e,extraClass:this._resolvePossibleFunction(this._config.customClass)})),this._templateFactory}},{key:"_getContentForTemplate",value:function(){return _defineProperty({},".tooltip-inner",this._getTitle())}},{key:"_getTitle",value:function(){return this._resolvePossibleFunction(this._config.title)||this._element.getAttribute("data-bs-original-title")}},{key:"_initializeOnDelegatedTarget",value:function(e){return this.constructor.getOrCreateInstance(e.delegateTarget,this._getDelegateConfig())}},{key:"_isAnimated",value:function(){return this._config.animation||this.tip&&this.tip.classList.contains(jn)}},{key:"_isShown",value:function(){return this.tip&&this.tip.classList.contains(Nn)}},{key:"_createPopper",value:function(e){var t=k(this._config.placement,[this,e,this._element]),i=xn[t.toUpperCase()];return n.createPopper(this._element,e,this._getPopperConfig(i))}},{key:"_getOffset",value:function(){var e=this,t=this._config.offset;return"string"==typeof t?t.split(",").map((function(e){return Number.parseInt(e,10)})):"function"==typeof t?function(n){return t(n,e._element)}:t}},{key:"_resolvePossibleFunction",value:function(e){return k(e,[this._element])}},{key:"_getPopperConfig",value:function(e){var t=this,n={placement:e,modifiers:[{name:"flip",options:{fallbackPlacements:this._config.fallbackPlacements}},{name:"offset",options:{offset:this._getOffset()}},{name:"preventOverflow",options:{boundary:this._config.boundary}},{name:"arrow",options:{element:".".concat(this.constructor.NAME,"-arrow")}},{name:"preSetPlacement",enabled:!0,phase:"beforeMain",fn:function(e){t._getTipElement().setAttribute("data-popper-placement",e.state.placement)}}]};return _objectSpread(_objectSpread({},n),k(this._config.popperConfig,[n]))}},{key:"_setListeners",value:function(){var e,t=this,n=_createForOfIteratorHelper(this._config.trigger.split(" "));try{for(n.s();!(e=n.n()).done;){var i=e.value;if("click"===i)z.on(this._element,this.constructor.eventName("click"),this._config.selector,(function(e){t._initializeOnDelegatedTarget(e).toggle()}));else if("manual"!==i){var r=i===Mn?this.constructor.eventName("mouseenter"):this.constructor.eventName("focusin"),o=i===Mn?this.constructor.eventName("mouseleave"):this.constructor.eventName("focusout");z.on(this._element,r,this._config.selector,(function(e){var n=t._initializeOnDelegatedTarget(e);n._activeTrigger["focusin"===e.type?Hn:Mn]=!0,n._enter()})),z.on(this._element,o,this._config.selector,(function(e){var n=t._initializeOnDelegatedTarget(e);n._activeTrigger["focusout"===e.type?Hn:Mn]=n._element.contains(e.relatedTarget),n._leave()}))}}}catch(e){n.e(e)}finally{n.f()}this._hideModalHandler=function(){t._element&&t.hide()},z.on(this._element.closest(Dn),Fn,this._hideModalHandler)}},{key:"_fixTitle",value:function(){var e=this._element.getAttribute("title");e&&(this._element.getAttribute("aria-label")||this._element.textContent.trim()||this._element.setAttribute("aria-label",e),this._element.setAttribute("data-bs-original-title",e),this._element.removeAttribute("title"))}},{key:"_enter",value:function(){var e=this;this._isShown()||this._isHovered?this._isHovered=!0:(this._isHovered=!0,this._setTimeout((function(){e._isHovered&&e.show()}),this._config.delay.show))}},{key:"_leave",value:function(){var e=this;this._isWithActiveTrigger()||(this._isHovered=!1,this._setTimeout((function(){e._isHovered||e.hide()}),this._config.delay.hide))}},{key:"_setTimeout",value:function(e,t){clearTimeout(this._timeout),this._timeout=setTimeout(e,t)}},{key:"_isWithActiveTrigger",value:function(){return Object.values(this._activeTrigger).includes(!0)}},{key:"_getConfig",value:function(e){for(var t=V(this._element),n=0,i=Object.keys(t);n

    ',trigger:"click"}),qn=_objectSpread(_objectSpread({},Bn.DefaultType),{},{content:"(null|string|element|function)"}),Kn=function(e){function t(){return _classCallCheck(this,t),_callSuper(this,t,arguments)}return _inherits(t,e),_createClass(t,[{key:"_isWithContent",value:function(){return this._getTitle()||this._getContent()}},{key:"_getContentForTemplate",value:function(){return _defineProperty(_defineProperty({},".popover-header",this._getTitle()),".popover-body",this._getContent())}},{key:"_getContent",value:function(){return this._resolvePossibleFunction(this._config.content)}}],[{key:"Default",get:function(){return Wn}},{key:"DefaultType",get:function(){return qn}},{key:"NAME",get:function(){return"popover"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}))}}])}(Bn);b(Kn);var Vn=".".concat("bs.scrollspy"),Qn="activate".concat(Vn),Xn="click".concat(Vn),Yn="load".concat(Vn).concat(".data-api"),Un="active",$n="[href]",Gn=".nav-link",Jn="".concat(Gn,", ").concat(".nav-item"," > ").concat(Gn,", ").concat(".list-group-item"),Zn={offset:null,rootMargin:"0px 0px -25%",smoothScroll:!1,target:null,threshold:[.1,.5,1]},ei={offset:"(number|null)",rootMargin:"string",smoothScroll:"boolean",target:"element",threshold:"array"},ti=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._targetLinks=new Map,i._observableSections=new Map,i._rootElement="visible"===getComputedStyle(i._element).overflowY?null:i._element,i._activeTarget=null,i._observer=null,i._previousScrollData={visibleEntryTop:0,parentScrollTop:0},i.refresh(),i}return _inherits(t,e),_createClass(t,[{key:"refresh",value:function(){this._initializeTargetsAndObservables(),this._maybeEnableSmoothScroll(),this._observer?this._observer.disconnect():this._observer=this._getNewObserver();var e,t=_createForOfIteratorHelper(this._observableSections.values());try{for(t.s();!(e=t.n()).done;){var n=e.value;this._observer.observe(n)}}catch(e){t.e(e)}finally{t.f()}}},{key:"dispose",value:function(){this._observer.disconnect(),_get(_getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"_configAfterMerge",value:function(e){return e.target=f(e.target)||document.body,e.rootMargin=e.offset?"".concat(e.offset,"px 0px -30%"):e.rootMargin,"string"==typeof e.threshold&&(e.threshold=e.threshold.split(",").map((function(e){return Number.parseFloat(e)}))),e}},{key:"_maybeEnableSmoothScroll",value:function(){var e=this;this._config.smoothScroll&&(z.off(this._config.target,Xn),z.on(this._config.target,Xn,$n,(function(t){var n=e._observableSections.get(t.target.hash);if(n){t.preventDefault();var i=e._rootElement||window,r=n.offsetTop-e._element.offsetTop;if(i.scrollTo)return void i.scrollTo({top:r,behavior:"smooth"});i.scrollTop=r}})))}},{key:"_getNewObserver",value:function(){var e=this,t={root:this._rootElement,threshold:this._config.threshold,rootMargin:this._config.rootMargin};return new IntersectionObserver((function(t){return e._observerCallback(t)}),t)}},{key:"_observerCallback",value:function(e){var t=this,n=function(e){return t._targetLinks.get("#".concat(e.target.id))},i=function(e){t._previousScrollData.visibleEntryTop=e.target.offsetTop,t._process(n(e))},r=(this._rootElement||document.documentElement).scrollTop,o=r>=this._previousScrollData.parentScrollTop;this._previousScrollData.parentScrollTop=r;var a,s=_createForOfIteratorHelper(e);try{for(s.s();!(a=s.n()).done;){var l=a.value;if(l.isIntersecting){var c=l.target.offsetTop>=this._previousScrollData.visibleEntryTop;if(o&&c){if(i(l),!r)return}else o||c||i(l)}else this._activeTarget=null,this._clearActiveClass(n(l))}}catch(e){s.e(e)}finally{s.f()}}},{key:"_initializeTargetsAndObservables",value:function(){this._targetLinks=new Map,this._observableSections=new Map;var e,t=_createForOfIteratorHelper($.find($n,this._config.target));try{for(t.s();!(e=t.n()).done;){var n=e.value;if(n.hash&&!d(n)){var i=$.findOne(decodeURI(n.hash),this._element);h(i)&&(this._targetLinks.set(decodeURI(n.hash),n),this._observableSections.set(n.hash,i))}}}catch(e){t.e(e)}finally{t.f()}}},{key:"_process",value:function(e){this._activeTarget!==e&&(this._clearActiveClass(this._config.target),this._activeTarget=e,e.classList.add(Un),this._activateParents(e),z.trigger(this._element,Qn,{relatedTarget:e}))}},{key:"_activateParents",value:function(e){if(e.classList.contains("dropdown-item"))$.findOne(".dropdown-toggle",e.closest(".dropdown")).classList.add(Un);else{var t,n=_createForOfIteratorHelper($.parents(e,".nav, .list-group"));try{for(n.s();!(t=n.n()).done;){var i,r=t.value,o=_createForOfIteratorHelper($.prev(r,Jn));try{for(o.s();!(i=o.n()).done;){i.value.classList.add(Un)}}catch(e){o.e(e)}finally{o.f()}}}catch(e){n.e(e)}finally{n.f()}}}},{key:"_clearActiveClass",value:function(e){e.classList.remove(Un);var t,n=_createForOfIteratorHelper($.find("".concat($n,".").concat(Un),e));try{for(n.s();!(t=n.n()).done;){t.value.classList.remove(Un)}}catch(e){n.e(e)}finally{n.f()}}}],[{key:"Default",get:function(){return Zn}},{key:"DefaultType",get:function(){return ei}},{key:"NAME",get:function(){return"scrollspy"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}))}}])}(Y);z.on(window,Yn,(function(){var e,t=_createForOfIteratorHelper($.find('[data-bs-spy="scroll"]'));try{for(t.s();!(e=t.n()).done;){var n=e.value;ti.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),b(ti);var ni=".".concat("bs.tab"),ii="hide".concat(ni),ri="hidden".concat(ni),oi="show".concat(ni),ai="shown".concat(ni),si="click".concat(ni),li="keydown".concat(ni),ci="load".concat(ni),ui="ArrowLeft",fi="ArrowRight",hi="ArrowUp",di="ArrowDown",_i="Home",pi="End",gi="active",vi="fade",mi="show",yi=".dropdown-toggle",bi=":not(".concat(yi,")"),ki=".nav-link".concat(bi,", .list-group-item").concat(bi,', [role="tab"]').concat(bi),wi='[data-bs-toggle="tab"], [data-bs-toggle="pill"], [data-bs-toggle="list"]',Ci="".concat(ki,", ").concat(wi),Ai=".".concat(gi,'[data-bs-toggle="tab"], .').concat(gi,'[data-bs-toggle="pill"], .').concat(gi,'[data-bs-toggle="list"]'),Ti=function(e){function t(e){var n;return _classCallCheck(this,t),(n=_callSuper(this,t,[e]))._parent=n._element.closest('.list-group, .nav, [role="tablist"]'),n._parent?(n._setInitialAttributes(n._parent,n._getChildren()),z.on(n._element,li,(function(e){return n._keydown(e)})),n):_possibleConstructorReturn(n)}return _inherits(t,e),_createClass(t,[{key:"show",value:function(){var e=this._element;if(!this._elemIsActive(e)){var t=this._getActiveElem(),n=t?z.trigger(t,ii,{relatedTarget:e}):null;z.trigger(e,oi,{relatedTarget:t}).defaultPrevented||n&&n.defaultPrevented||(this._deactivate(t,e),this._activate(e,t))}}},{key:"_activate",value:function(e,t){var n=this;if(e){e.classList.add(gi),this._activate($.getElementFromSelector(e));this._queueCallback((function(){"tab"===e.getAttribute("role")?(e.removeAttribute("tabindex"),e.setAttribute("aria-selected",!0),n._toggleDropDown(e,!0),z.trigger(e,ai,{relatedTarget:t})):e.classList.add(mi)}),e,e.classList.contains(vi))}}},{key:"_deactivate",value:function(e,t){var n=this;if(e){e.classList.remove(gi),e.blur(),this._deactivate($.getElementFromSelector(e));this._queueCallback((function(){"tab"===e.getAttribute("role")?(e.setAttribute("aria-selected",!1),e.setAttribute("tabindex","-1"),n._toggleDropDown(e,!1),z.trigger(e,ri,{relatedTarget:t})):e.classList.remove(mi)}),e,e.classList.contains(vi))}}},{key:"_keydown",value:function(e){if([ui,fi,hi,di,_i,pi].includes(e.key)){e.stopPropagation(),e.preventDefault();var n,i=this._getChildren().filter((function(e){return!d(e)}));if([_i,pi].includes(e.key))n=i[e.key===_i?0:i.length-1];else{var r=[fi,di].includes(e.key);n=C(i,e.target,r,!0)}n&&(n.focus({preventScroll:!0}),t.getOrCreateInstance(n).show())}}},{key:"_getChildren",value:function(){return $.find(Ci,this._parent)}},{key:"_getActiveElem",value:function(){var e=this;return this._getChildren().find((function(t){return e._elemIsActive(t)}))||null}},{key:"_setInitialAttributes",value:function(e,t){this._setAttributeIfNotExists(e,"role","tablist");var n,i=_createForOfIteratorHelper(t);try{for(i.s();!(n=i.n()).done;){var r=n.value;this._setInitialAttributesOnChild(r)}}catch(e){i.e(e)}finally{i.f()}}},{key:"_setInitialAttributesOnChild",value:function(e){e=this._getInnerElement(e);var t=this._elemIsActive(e),n=this._getOuterElement(e);e.setAttribute("aria-selected",t),n!==e&&this._setAttributeIfNotExists(n,"role","presentation"),t||e.setAttribute("tabindex","-1"),this._setAttributeIfNotExists(e,"role","tab"),this._setInitialAttributesOnTargetPanel(e)}},{key:"_setInitialAttributesOnTargetPanel",value:function(e){var t=$.getElementFromSelector(e);t&&(this._setAttributeIfNotExists(t,"role","tabpanel"),e.id&&this._setAttributeIfNotExists(t,"aria-labelledby","".concat(e.id)))}},{key:"_toggleDropDown",value:function(e,t){var n=this._getOuterElement(e);if(n.classList.contains("dropdown")){var i=function(e,i){var r=$.findOne(e,n);r&&r.classList.toggle(i,t)};i(yi,gi),i(".dropdown-menu",mi),n.setAttribute("aria-expanded",t)}}},{key:"_setAttributeIfNotExists",value:function(e,t,n){e.hasAttribute(t)||e.setAttribute(t,n)}},{key:"_elemIsActive",value:function(e){return e.classList.contains(gi)}},{key:"_getInnerElement",value:function(e){return e.matches(Ci)?e:$.findOne(Ci,e)}},{key:"_getOuterElement",value:function(e){return e.closest(".nav-item, .list-group-item")||e}}],[{key:"NAME",get:function(){return"tab"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this);if("string"==typeof e){if(void 0===n[e]||e.startsWith("_")||"constructor"===e)throw new TypeError('No method named "'.concat(e,'"'));n[e]()}}))}}])}(Y);z.on(document,si,wi,(function(e){["A","AREA"].includes(this.tagName)&&e.preventDefault(),d(this)||Ti.getOrCreateInstance(this).show()})),z.on(window,ci,(function(){var e,t=_createForOfIteratorHelper($.find(Ai));try{for(t.s();!(e=t.n()).done;){var n=e.value;Ti.getOrCreateInstance(n)}}catch(e){t.e(e)}finally{t.f()}})),b(Ti);var Ei=".".concat("bs.toast"),Oi="mouseover".concat(Ei),Si="mouseout".concat(Ei),Ii="focusin".concat(Ei),Pi="focusout".concat(Ei),Li="hide".concat(Ei),ji="hidden".concat(Ei),Ni="show".concat(Ei),Di="shown".concat(Ei),Fi="hide",Mi="show",Hi="showing",xi={animation:"boolean",autohide:"boolean",delay:"number"},zi={animation:!0,autohide:!0,delay:5e3},Ri=function(e){function t(e,n){var i;return _classCallCheck(this,t),(i=_callSuper(this,t,[e,n]))._timeout=null,i._hasMouseInteraction=!1,i._hasKeyboardInteraction=!1,i._setListeners(),i}return _inherits(t,e),_createClass(t,[{key:"show",value:function(){var e=this;if(!z.trigger(this._element,Ni).defaultPrevented){this._clearTimeout(),this._config.animation&&this._element.classList.add("fade");this._element.classList.remove(Fi),g(this._element),this._element.classList.add(Mi,Hi),this._queueCallback((function(){e._element.classList.remove(Hi),z.trigger(e._element,Di),e._maybeScheduleHide()}),this._element,this._config.animation)}}},{key:"hide",value:function(){var e=this;if(this.isShown()&&!z.trigger(this._element,Li).defaultPrevented){this._element.classList.add(Hi),this._queueCallback((function(){e._element.classList.add(Fi),e._element.classList.remove(Hi,Mi),z.trigger(e._element,ji)}),this._element,this._config.animation)}}},{key:"dispose",value:function(){this._clearTimeout(),this.isShown()&&this._element.classList.remove(Mi),_get(_getPrototypeOf(t.prototype),"dispose",this).call(this)}},{key:"isShown",value:function(){return this._element.classList.contains(Mi)}},{key:"_maybeScheduleHide",value:function(){var e=this;this._config.autohide&&(this._hasMouseInteraction||this._hasKeyboardInteraction||(this._timeout=setTimeout((function(){e.hide()}),this._config.delay)))}},{key:"_onInteraction",value:function(e,t){switch(e.type){case"mouseover":case"mouseout":this._hasMouseInteraction=t;break;case"focusin":case"focusout":this._hasKeyboardInteraction=t}if(t)this._clearTimeout();else{var n=e.relatedTarget;this._element===n||this._element.contains(n)||this._maybeScheduleHide()}}},{key:"_setListeners",value:function(){var e=this;z.on(this._element,Oi,(function(t){return e._onInteraction(t,!0)})),z.on(this._element,Si,(function(t){return e._onInteraction(t,!1)})),z.on(this._element,Ii,(function(t){return e._onInteraction(t,!0)})),z.on(this._element,Pi,(function(t){return e._onInteraction(t,!1)}))}},{key:"_clearTimeout",value:function(){clearTimeout(this._timeout),this._timeout=null}}],[{key:"Default",get:function(){return zi}},{key:"DefaultType",get:function(){return xi}},{key:"NAME",get:function(){return"toast"}},{key:"jQueryInterface",value:function(e){return this.each((function(){var n=t.getOrCreateInstance(this,e);if("string"==typeof e){if(void 0===n[e])throw new TypeError('No method named "'.concat(e,'"'));n[e](this)}}))}}])}(Y);return G(Ri),b(Ri),{Alert:te,Button:oe,Carousel:He,Collapse:Ge,Dropdown:wt,Modal:rn,Offcanvas:wn,Popover:Kn,ScrollSpy:ti,Tab:Ti,Toast:Ri,Tooltip:Bn}})); diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/codemirror/codemirror.js b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/codemirror/codemirror.js index f31347ceb33..6afd3d16b00 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/codemirror/codemirror.js +++ b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/codemirror/codemirror.js @@ -4258,7 +4258,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }, 20); } // Issue #1730 } - cm.display.input.receivedFocus(); } restartBlink(cm); @@ -4862,7 +4861,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == // Unique ID markArrays: null // Used by addMarkedSpan }; - pushOperation(cm.curOp); } @@ -12176,7 +12174,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } catch (e) {} // IE8 will throw if the textarea is display: none or not in DOM } }; - TextareaInput.prototype.blur = function () { this.textarea.blur(); }; diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/jquery.js b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/jquery.js index f3c66be58dd..415a997ee5b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/jquery.js +++ b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/jquery.js @@ -2282,7 +2282,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == /* eslint-enable */ })(); - var dir = function dir(elem, _dir, until) { var matched = [], truncate = until !== undefined; diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/jquery.slim.js b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/jquery.slim.js index bb37ffb48ec..9f378e668a4 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/jquery.slim.js +++ b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/jquery.slim.js @@ -2282,7 +2282,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == /* eslint-enable */ })(); - var dir = function dir(elem, _dir, until) { var matched = [], truncate = until !== undefined; diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/popper.js b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/popper.js index 39232962b49..38843846dd8 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/popper.js +++ b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/popper.js @@ -223,7 +223,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == getDocumentElement(element) // fallback ); } - function getScrollParent(node) { if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { // $FlowFixMe[incompatible-return]: assume body is always available diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/trumbowyg-plugins.js b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/trumbowyg-plugins.js index b02111a9c19..3f63c3298a2 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/trumbowyg-plugins.js +++ b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/trumbowyg-plugins.js @@ -511,7 +511,6 @@ if (rgb == null) { return 'transparent'; // No match, return transparent as unkown color } - return hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); } } @@ -1308,7 +1307,6 @@ // jshint camelcase:true } }); - var giphyLogo = ''; // jshint ignore:line var CANCEL_EVENT = 'tbwcancel'; @@ -1795,7 +1793,6 @@ } // jshint camelcase:true }, - plugins: { insertAudio: { init: function init(trumbowyg) { @@ -2254,7 +2251,6 @@ } // jshint camelcase:true }, - plugins: { mention: { init: function init(trumbowyg) { @@ -2395,7 +2391,6 @@ } // jshint camelcase:true }, - plugins: { noembed: { init: function init(trumbowyg) { @@ -3147,7 +3142,6 @@ if (rgb == null) { return 'transparent'; // No match, return transparent as unkown color } - return hex(rgb[1]) + hex(rgb[2]) + hex(rgb[3]); } } @@ -3360,7 +3354,6 @@ tableDestroy: 'Borrar tabla' } // jshint camelcase:true }, - plugins: { table: { // jshint maxstatements:false @@ -4640,7 +4633,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == // Error callback: function () {} imageWidthModalEdit: false // Add ability to edit image width }; - function getDeep(object, propertyParts) { var mainProperty = propertyParts.shift(), otherProperties = propertyParts; diff --git a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/trumbowyg.js b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/trumbowyg.js index ddc07bb452b..cd13566bf1e 100644 --- a/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/trumbowyg.js +++ b/src/OrchardCore.Modules/OrchardCore.Resources/wwwroot/Scripts/trumbowyg.js @@ -1284,7 +1284,6 @@ Object.defineProperty(jQuery.trumbowyg, 'defaultOptions', { if (cmd === 'strikethrough' && t.o.semantic) { t.semanticTag('strike', t.o.semanticKeepAttributes, true); // browsers cannot undo e.g. as they expect } - try { t.doc.execCommand('styleWithCSS', false, forceCss || false); } catch (c) {} diff --git a/src/OrchardCore.Modules/OrchardCore.Setup/wwwroot/Scripts/setup.js b/src/OrchardCore.Modules/OrchardCore.Setup/wwwroot/Scripts/setup.js index 38dbc47e72b..86349d3b506 100644 --- a/src/OrchardCore.Modules/OrchardCore.Setup/wwwroot/Scripts/setup.js +++ b/src/OrchardCore.Modules/OrchardCore.Setup/wwwroot/Scripts/setup.js @@ -2282,7 +2282,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == /* eslint-enable */ })(); - var dir = function dir(elem, _dir, until) { var matched = [], truncate = until !== undefined; @@ -9224,7 +9223,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == getDocumentElement(element) // fallback ); } - function getScrollParent(node) { if (['html', 'body', '#document'].indexOf(getNodeName(node)) >= 0) { // $FlowFixMe[incompatible-return]: assume body is always available @@ -10608,13 +10606,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); function _get() { if (typeof Reflect !== "undefined" && Reflect.get) { _get = Reflect.get.bind(); } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); } function _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; } -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } -function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } -function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } +function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); } function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } else if (call !== void 0) { throw new TypeError("Derived constructors may only return object or undefined"); } return _assertThisInitialized(self); } function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } -function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } +function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } +function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); } +function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; } function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } @@ -10632,8 +10630,8 @@ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symb function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); } function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; } function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; } -function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); } -function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } +function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; } +function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); } /*! * Bootstrap v5.3.3 (https://getbootstrap.com/) @@ -10645,7 +10643,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == })(this, function (Popper) { 'use strict'; - var _KEY_TO_DIRECTION; function _interopNamespaceDefault(e) { var n = Object.create(null, _defineProperty({}, Symbol.toStringTag, { value: 'Module' @@ -10873,7 +10870,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == var reflow = function reflow(element) { element.offsetHeight; // eslint-disable-line no-unused-expressions }; - var getjQuery = function getjQuery() { if (window.jQuery && !document.body.hasAttribute('data-bs-no-jquery')) { return window.jQuery; @@ -11309,7 +11305,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == function Config() { _classCallCheck(this, Config); } - _createClass(Config, [{ + return _createClass(Config, [{ key: "_getConfig", value: function _getConfig(config) { config = this._mergeConfigObj(config); @@ -11362,7 +11358,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == throw new Error('You have to implement the static method "NAME", for each component!'); } }]); - return Config; }(); /** * -------------------------------------------------------------------------- @@ -11379,24 +11374,23 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var BaseComponent = /*#__PURE__*/function (_Config) { - _inherits(BaseComponent, _Config); - var _super = _createSuper(BaseComponent); function BaseComponent(element, config) { var _this; _classCallCheck(this, BaseComponent); - _this = _super.call(this); + _this = _callSuper(this, BaseComponent); element = getElement(element); if (!element) { return _possibleConstructorReturn(_this); } _this._element = element; _this._config = _this._getConfig(config); - Data.set(_this._element, _this.constructor.DATA_KEY, _assertThisInitialized(_this)); + Data.set(_this._element, _this.constructor.DATA_KEY, _this); return _this; } // Public - _createClass(BaseComponent, [{ + _inherits(BaseComponent, _Config); + return _createClass(BaseComponent, [{ key: "dispose", value: function dispose() { Data.remove(this._element, this.constructor.DATA_KEY); @@ -11462,7 +11456,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return "".concat(name).concat(this.EVENT_KEY); } }]); - return BaseComponent; }(Config); /** * -------------------------------------------------------------------------- @@ -11613,13 +11606,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Alert = /*#__PURE__*/function (_BaseComponent) { - _inherits(Alert, _BaseComponent); - var _super2 = _createSuper(Alert); function Alert() { _classCallCheck(this, Alert); - return _super2.apply(this, arguments); + return _callSuper(this, Alert, arguments); } - _createClass(Alert, [{ + _inherits(Alert, _BaseComponent); + return _createClass(Alert, [{ key: "close", value: // Public @@ -11668,7 +11660,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Alert; }(BaseComponent); /** * Data API implementation @@ -11704,13 +11695,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Button = /*#__PURE__*/function (_BaseComponent2) { - _inherits(Button, _BaseComponent2); - var _super3 = _createSuper(Button); function Button() { _classCallCheck(this, Button); - return _super3.apply(this, arguments); + return _callSuper(this, Button, arguments); } - _createClass(Button, [{ + _inherits(Button, _BaseComponent2); + return _createClass(Button, [{ key: "toggle", value: // Public @@ -11738,7 +11728,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Button; }(BaseComponent); /** * Data API implementation @@ -11793,12 +11782,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Swipe = /*#__PURE__*/function (_Config2) { - _inherits(Swipe, _Config2); - var _super4 = _createSuper(Swipe); function Swipe(element, config) { var _this3; _classCallCheck(this, Swipe); - _this3 = _super4.call(this); + _this3 = _callSuper(this, Swipe); _this3._element = element; if (!element || !Swipe.isSupported()) { return _possibleConstructorReturn(_this3); @@ -11811,7 +11798,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Swipe, [{ + _inherits(Swipe, _Config2); + return _createClass(Swipe, [{ key: "dispose", value: // Public @@ -11911,7 +11899,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return 'ontouchstart' in document.documentElement || navigator.maxTouchPoints > 0; } }]); - return Swipe; }(Config); /** * -------------------------------------------------------------------------- @@ -11956,7 +11943,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == var SELECTOR_INDICATORS = '.carousel-indicators'; var SELECTOR_DATA_SLIDE = '[data-bs-slide], [data-bs-slide-to]'; var SELECTOR_DATA_RIDE = '[data-bs-ride="carousel"]'; - var KEY_TO_DIRECTION = (_KEY_TO_DIRECTION = {}, _defineProperty(_KEY_TO_DIRECTION, ARROW_LEFT_KEY$1, DIRECTION_RIGHT), _defineProperty(_KEY_TO_DIRECTION, ARROW_RIGHT_KEY$1, DIRECTION_LEFT), _KEY_TO_DIRECTION); + var KEY_TO_DIRECTION = _defineProperty(_defineProperty({}, ARROW_LEFT_KEY$1, DIRECTION_RIGHT), ARROW_RIGHT_KEY$1, DIRECTION_LEFT); var Default$b = { interval: 5000, keyboard: true, @@ -11979,12 +11966,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Carousel = /*#__PURE__*/function (_BaseComponent3) { - _inherits(Carousel, _BaseComponent3); - var _super5 = _createSuper(Carousel); function Carousel(element, config) { var _this5; _classCallCheck(this, Carousel); - _this5 = _super5.call(this, element, config); + _this5 = _callSuper(this, Carousel, [element, config]); _this5._interval = null; _this5._activeElement = null; _this5._isSliding = false; @@ -11999,7 +11984,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Carousel, [{ + _inherits(Carousel, _BaseComponent3); + return _createClass(Carousel, [{ key: "next", value: // Public @@ -12333,7 +12319,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Carousel; }(BaseComponent); /** * Data API implementation @@ -12424,12 +12409,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Collapse = /*#__PURE__*/function (_BaseComponent4) { - _inherits(Collapse, _BaseComponent4); - var _super6 = _createSuper(Collapse); function Collapse(element, config) { var _this12; _classCallCheck(this, Collapse); - _this12 = _super6.call(this, element, config); + _this12 = _callSuper(this, Collapse, [element, config]); _this12._isTransitioning = false; _this12._triggerArray = []; var toggleList = SelectorEngine.find(SELECTOR_DATA_TOGGLE$4); @@ -12462,7 +12445,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Collapse, [{ + _inherits(Collapse, _BaseComponent4); + return _createClass(Collapse, [{ key: "toggle", value: // Public @@ -12677,7 +12661,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Collapse; }(BaseComponent); /** * Data API implementation @@ -12778,12 +12761,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Dropdown = /*#__PURE__*/function (_BaseComponent5) { - _inherits(Dropdown, _BaseComponent5); - var _super7 = _createSuper(Dropdown); function Dropdown(element, config) { var _this15; _classCallCheck(this, Dropdown); - _this15 = _super7.call(this, element, config); + _this15 = _callSuper(this, Dropdown, [element, config]); _this15._popper = null; _this15._parent = _this15._element.parentNode; // dropdown wrapper // TODO: v6 revert #37011 & change markup https://getbootstrap.com/docs/5.3/forms/input-group/ @@ -12793,7 +12774,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Dropdown, [{ + _inherits(Dropdown, _BaseComponent5); + return _createClass(Dropdown, [{ key: "toggle", value: // Public @@ -13130,7 +13112,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } } }]); - return Dropdown; }(BaseComponent); /** * Data API implementation @@ -13173,7 +13154,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == // if false, we use the backdrop helper without adding any element to the dom rootElement: 'body' // give the choice to place backdrop under different elements }; - var DefaultType$8 = { className: 'string', clickCallback: '(function|null)', @@ -13186,12 +13166,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Backdrop = /*#__PURE__*/function (_Config3) { - _inherits(Backdrop, _Config3); - var _super8 = _createSuper(Backdrop); function Backdrop(config) { var _this17; _classCallCheck(this, Backdrop); - _this17 = _super8.call(this); + _this17 = _callSuper(this, Backdrop); _this17._config = _this17._getConfig(config); _this17._isAppended = false; _this17._element = null; @@ -13199,7 +13177,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Backdrop, [{ + _inherits(Backdrop, _Config3); + return _createClass(Backdrop, [{ key: "show", value: // Public @@ -13299,7 +13278,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return NAME$9; } }]); - return Backdrop; }(Config); /** * -------------------------------------------------------------------------- @@ -13322,7 +13300,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == autofocus: true, trapElement: null // The element to trap focus inside of }; - var DefaultType$7 = { autofocus: 'boolean', trapElement: 'element' @@ -13332,12 +13309,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var FocusTrap = /*#__PURE__*/function (_Config4) { - _inherits(FocusTrap, _Config4); - var _super9 = _createSuper(FocusTrap); function FocusTrap(config) { var _this20; _classCallCheck(this, FocusTrap); - _this20 = _super9.call(this); + _this20 = _callSuper(this, FocusTrap); _this20._config = _this20._getConfig(config); _this20._isActive = false; _this20._lastTabNavDirection = null; @@ -13345,7 +13320,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(FocusTrap, [{ + _inherits(FocusTrap, _Config4); + return _createClass(FocusTrap, [{ key: "activate", value: // Public @@ -13417,7 +13393,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return NAME$8; } }]); - return FocusTrap; }(Config); /** * -------------------------------------------------------------------------- @@ -13443,7 +13418,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Public - _createClass(ScrollBarHelper, [{ + return _createClass(ScrollBarHelper, [{ key: "getWidth", value: function getWidth() { // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes @@ -13547,7 +13522,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } } }]); - return ScrollBarHelper; }(); /** * -------------------------------------------------------------------------- @@ -13596,12 +13570,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Modal = /*#__PURE__*/function (_BaseComponent6) { - _inherits(Modal, _BaseComponent6); - var _super10 = _createSuper(Modal); function Modal(element, config) { var _this23; _classCallCheck(this, Modal); - _this23 = _super10.call(this, element, config); + _this23 = _callSuper(this, Modal, [element, config]); _this23._dialog = SelectorEngine.findOne(SELECTOR_DIALOG, _this23._element); _this23._backdrop = _this23._initializeBackDrop(); _this23._focustrap = _this23._initializeFocusTrap(); @@ -13613,7 +13585,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Modal, [{ + _inherits(Modal, _BaseComponent6); + return _createClass(Modal, [{ key: "toggle", value: // Public @@ -13862,7 +13835,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Modal; }(BaseComponent); /** * Data API implementation @@ -13947,12 +13919,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Offcanvas = /*#__PURE__*/function (_BaseComponent7) { - _inherits(Offcanvas, _BaseComponent7); - var _super11 = _createSuper(Offcanvas); function Offcanvas(element, config) { var _this31; _classCallCheck(this, Offcanvas); - _this31 = _super11.call(this, element, config); + _this31 = _callSuper(this, Offcanvas, [element, config]); _this31._isShown = false; _this31._backdrop = _this31._initializeBackDrop(); _this31._focustrap = _this31._initializeFocusTrap(); @@ -13961,7 +13931,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Offcanvas, [{ + _inherits(Offcanvas, _BaseComponent7); + return _createClass(Offcanvas, [{ key: "toggle", value: // Public @@ -14113,7 +14084,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Offcanvas; }(BaseComponent); /** * Data API implementation @@ -14340,18 +14310,17 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var TemplateFactory = /*#__PURE__*/function (_Config5) { - _inherits(TemplateFactory, _Config5); - var _super12 = _createSuper(TemplateFactory); function TemplateFactory(config) { var _this37; _classCallCheck(this, TemplateFactory); - _this37 = _super12.call(this); + _this37 = _callSuper(this, TemplateFactory); _this37._config = _this37._getConfig(config); return _this37; } // Getters - _createClass(TemplateFactory, [{ + _inherits(TemplateFactory, _Config5); + return _createClass(TemplateFactory, [{ key: "getContent", value: // Public @@ -14471,7 +14440,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == return NAME$5; } }]); - return TemplateFactory; }(Config); /** * -------------------------------------------------------------------------- @@ -14554,15 +14522,13 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Tooltip = /*#__PURE__*/function (_BaseComponent8) { - _inherits(Tooltip, _BaseComponent8); - var _super13 = _createSuper(Tooltip); function Tooltip(element, config) { var _this39; _classCallCheck(this, Tooltip); if (typeof Popper__namespace === 'undefined') { throw new TypeError('Bootstrap\'s tooltips require Popper (https://popper.js.org)'); } - _this39 = _super13.call(this, element, config); + _this39 = _callSuper(this, Tooltip, [element, config]); // Private _this39._isEnabled = true; @@ -14583,7 +14549,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Tooltip, [{ + _inherits(Tooltip, _BaseComponent8); + return _createClass(Tooltip, [{ key: "enable", value: // Public @@ -15082,7 +15049,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Tooltip; }(BaseComponent); /** * jQuery @@ -15118,13 +15084,12 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Popover = /*#__PURE__*/function (_Tooltip) { - _inherits(Popover, _Tooltip); - var _super14 = _createSuper(Popover); function Popover() { _classCallCheck(this, Popover); - return _super14.apply(this, arguments); + return _callSuper(this, Popover, arguments); } - _createClass(Popover, [{ + _inherits(Popover, _Tooltip); + return _createClass(Popover, [{ key: "_isWithContent", value: // Overrides @@ -15136,8 +15101,7 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }, { key: "_getContentForTemplate", value: function _getContentForTemplate() { - var _ref12; - return _ref12 = {}, _defineProperty(_ref12, SELECTOR_TITLE, this._getTitle()), _defineProperty(_ref12, SELECTOR_CONTENT, this._getContent()), _ref12; + return _defineProperty(_defineProperty({}, SELECTOR_TITLE, this._getTitle()), SELECTOR_CONTENT, this._getContent()); } }, { key: "_getContent", @@ -15178,7 +15142,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Popover; }(Tooltip); /** * jQuery @@ -15235,12 +15198,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var ScrollSpy = /*#__PURE__*/function (_BaseComponent9) { - _inherits(ScrollSpy, _BaseComponent9); - var _super15 = _createSuper(ScrollSpy); function ScrollSpy(element, config) { var _this47; _classCallCheck(this, ScrollSpy); - _this47 = _super15.call(this, element, config); + _this47 = _callSuper(this, ScrollSpy, [element, config]); // this._element is the observablesContainer and config.target the menu links wrapper _this47._targetLinks = new Map(); @@ -15257,7 +15218,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(ScrollSpy, [{ + _inherits(ScrollSpy, _BaseComponent9); + return _createClass(ScrollSpy, [{ key: "refresh", value: // Public @@ -15522,7 +15484,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return ScrollSpy; }(BaseComponent); /** * Data API implementation @@ -15593,12 +15554,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Tab = /*#__PURE__*/function (_BaseComponent10) { - _inherits(Tab, _BaseComponent10); - var _super16 = _createSuper(Tab); function Tab(element) { var _this51; _classCallCheck(this, Tab); - _this51 = _super16.call(this, element); + _this51 = _callSuper(this, Tab, [element]); _this51._parent = _this51._element.closest(SELECTOR_TAB_PANEL); if (!_this51._parent) { return _possibleConstructorReturn(_this51); @@ -15615,7 +15574,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Tab, [{ + _inherits(Tab, _BaseComponent10); + return _createClass(Tab, [{ key: "show", value: // Public @@ -15842,7 +15802,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Tab; }(BaseComponent); /** * Data API implementation @@ -15921,12 +15880,10 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == * Class definition */ var Toast = /*#__PURE__*/function (_BaseComponent11) { - _inherits(Toast, _BaseComponent11); - var _super17 = _createSuper(Toast); function Toast(element, config) { var _this55; _classCallCheck(this, Toast); - _this55 = _super17.call(this, element, config); + _this55 = _callSuper(this, Toast, [element, config]); _this55._timeout = null; _this55._hasMouseInteraction = false; _this55._hasKeyboardInteraction = false; @@ -15935,7 +15892,8 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == } // Getters - _createClass(Toast, [{ + _inherits(Toast, _BaseComponent11); + return _createClass(Toast, [{ key: "show", value: // Public @@ -16089,7 +16047,6 @@ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == }); } }]); - return Toast; }(BaseComponent); /** * Data API implementation @@ -16213,7 +16170,6 @@ function togglePasswordVisibility(passwordCtl, togglePasswordCtl) { if (value == 0) { return ''; // grayed } - return "bg-danger"; } function checkStrength(value) { diff --git a/src/OrchardCore.Modules/OrchardCore.Setup/wwwroot/Scripts/setup.min.js b/src/OrchardCore.Modules/OrchardCore.Setup/wwwroot/Scripts/setup.min.js index f5a2096ec99..fb33b41f816 100644 --- a/src/OrchardCore.Modules/OrchardCore.Setup/wwwroot/Scripts/setup.min.js +++ b/src/OrchardCore.Modules/OrchardCore.Setup/wwwroot/Scripts/setup.min.js @@ -8,9 +8,9 @@ function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof S * https://jquery.org/license * * Date: 2023-08-28T13:37Z - */}function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}function _get(){return _get="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,n){var r=_superPropBase(e,t);if(r){var i=Object.getOwnPropertyDescriptor(r,t);return i.get?i.get.call(arguments.length<3?e:n):i.value}},_get.apply(this,arguments)}function _superPropBase(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_getPrototypeOf(e)););return e}function _inherits(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_setPrototypeOf(e,t)}function _setPrototypeOf(e,t){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},_setPrototypeOf(e,t)}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var n,r=_getPrototypeOf(e);if(t){var i=_getPrototypeOf(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return _possibleConstructorReturn(this,n)}}function _possibleConstructorReturn(e,t){if(t&&("object"===_typeof(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _assertThisInitialized(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function _getPrototypeOf(e){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},_getPrototypeOf(e)}function ownKeys(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function _objectSpread(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _nonIterableSpread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?_arrayLikeToArray(e,t):void 0}}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&t-1 in e)}function C(e,t){return e.nodeName&&e.nodeName.toLowerCase()===t.toLowerCase()}x.fn=x.prototype={jquery:b,constructor:x,length:0,toArray:function(){return i.call(this)},get:function(e){return null==e?i.call(this):e<0?this[e+this.length]:this[e]},pushStack:function(e){var t=x.merge(this.constructor(),e);return t.prevObject=this,t},each:function(e){return x.each(this,e)},map:function(e){return this.pushStack(x.map(this,(function(t,n){return e.call(t,n,t)})))},slice:function(){return this.pushStack(i.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},even:function(){return this.pushStack(x.grep(this,(function(e,t){return(t+1)%2})))},odd:function(){return this.pushStack(x.grep(this,(function(e,t){return t%2})))},eq:function(e){var t=this.length,n=+e+(e<0?t:0);return this.pushStack(n>=0&&n+~]|"+S+")"+S+"*"),W=new RegExp(S+"|>"),B=new RegExp(M),$=new RegExp("^"+I+"$"),z={ID:new RegExp("^#("+I+")"),CLASS:new RegExp("^\\.("+I+")"),TAG:new RegExp("^("+I+"|[*])"),ATTR:new RegExp("^"+H),PSEUDO:new RegExp("^"+M),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+S+"*(even|odd|(([+-]|)(\\d*)n|)"+S+"*(?:([+-]|)"+S+"*(\\d+)|))"+S+"*\\)|)","i"),bool:new RegExp("^(?:"+N+")$","i"),needsContext:new RegExp("^"+S+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+S+"*((?:-\\d)?\\d*)"+S+"*\\)|)(?=[^-]|$)","i")},V=/^(?:input|select|textarea|button)$/i,U=/^h\d$/i,X=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Y=new RegExp("\\\\[\\da-fA-F]{1,6}"+S+"?|\\\\([^\\r\\n\\f])","g"),Q=function(e,t){var n="0x"+e.slice(1)-65536;return t||(n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,1023&n|56320))},G=function(){le()},J=de((function(e){return!0===e.disabled&&C(e,"fieldset")}),{dir:"parentNode",next:"legend"});try{v.apply(n=i.call(L.childNodes),L.childNodes),n[L.childNodes.length].nodeType}catch(e){v={apply:function(e,t){P.apply(e,i.call(t))},call:function(e){P.apply(e,i.call(arguments,1))}}}function Z(e,t,n,r){var i,o,a,s,l,u,f,g=t&&t.ownerDocument,y=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==y&&9!==y&&11!==y)return n;if(!r&&(le(t),t=t||c,d)){if(11!==y&&(l=X.exec(e)))if(i=l[1]){if(9===y){if(!(a=t.getElementById(i)))return n;if(a.id===i)return v.call(n,a),n}else if(g&&(a=g.getElementById(i))&&Z.contains(t,a)&&a.id===i)return v.call(n,a),n}else{if(l[2])return v.apply(n,t.getElementsByTagName(e)),n;if((i=l[3])&&t.getElementsByClassName)return v.apply(n,t.getElementsByClassName(i)),n}if(!(j[e+" "]||h&&h.test(e))){if(f=e,g=t,1===y&&(W.test(e)||R.test(e))){for((g=K.test(e)&&se(t.parentNode)||t)==t&&p.scope||((s=t.getAttribute("id"))?s=x.escapeSelector(s):t.setAttribute("id",s=m)),o=(u=ue(e)).length;o--;)u[o]=(s?"#"+s:":scope")+" "+fe(u[o]);f=u.join(",")}try{return v.apply(n,g.querySelectorAll(f)),n}catch(t){j(e,!0)}finally{s===m&&t.removeAttribute("id")}}}return ye(e.replace(O,"$1"),t,n,r)}function ee(){var e=[];return function t(n,i){return e.push(n+" ")>r.cacheLength&&delete t[e.shift()],t[n+" "]=i}}function te(e){return e[m]=!0,e}function ne(e){var t=c.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function re(e){return function(t){return C(t,"input")&&t.type===e}}function ie(e){return function(t){return(C(t,"input")||C(t,"button"))&&t.type===e}}function oe(e){return function(t){return"form"in t?t.parentNode&&!1===t.disabled?"label"in t?"label"in t.parentNode?t.parentNode.disabled===e:t.disabled===e:t.isDisabled===e||t.isDisabled!==!e&&J(t)===e:t.disabled===e:"label"in t&&t.disabled===e}}function ae(e){return te((function(t){return t=+t,te((function(n,r){for(var i,o=e([],n.length,t),a=o.length;a--;)n[i=o[a]]&&(n[i]=!(r[i]=n[i]))}))}))}function se(e){return e&&void 0!==e.getElementsByTagName&&e}function le(e){var t,n=e?e.ownerDocument||e:L;return n!=c&&9===n.nodeType&&n.documentElement?(f=(c=n).documentElement,d=!x.isXMLDoc(c),g=f.matches||f.webkitMatchesSelector||f.msMatchesSelector,f.msMatchesSelector&&L!=c&&(t=c.defaultView)&&t.top!==t&&t.addEventListener("unload",G),p.getById=ne((function(e){return f.appendChild(e).id=x.expando,!c.getElementsByName||!c.getElementsByName(x.expando).length})),p.disconnectedMatch=ne((function(e){return g.call(e,"*")})),p.scope=ne((function(){return c.querySelectorAll(":scope")})),p.cssHas=ne((function(){try{return c.querySelector(":has(*,:jqfake)"),!1}catch(e){return!0}})),p.getById?(r.filter.ID=function(e){var t=e.replace(Y,Q);return function(e){return e.getAttribute("id")===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n=t.getElementById(e);return n?[n]:[]}}):(r.filter.ID=function(e){var t=e.replace(Y,Q);return function(e){var n=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return n&&n.value===t}},r.find.ID=function(e,t){if(void 0!==t.getElementById&&d){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),r.find.TAG=function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):t.querySelectorAll(e)},r.find.CLASS=function(e,t){if(void 0!==t.getElementsByClassName&&d)return t.getElementsByClassName(e)},h=[],ne((function(e){var t;f.appendChild(e).innerHTML="",e.querySelectorAll("[selected]").length||h.push("\\["+S+"*(?:value|"+N+")"),e.querySelectorAll("[id~="+m+"-]").length||h.push("~="),e.querySelectorAll("a#"+m+"+*").length||h.push(".#.+[+~]"),e.querySelectorAll(":checked").length||h.push(":checked"),(t=c.createElement("input")).setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),f.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&h.push(":enabled",":disabled"),(t=c.createElement("input")).setAttribute("name",""),e.appendChild(t),e.querySelectorAll("[name='']").length||h.push("\\["+S+"*name"+S+"*="+S+"*(?:''|\"\")")})),p.cssHas||h.push(":has"),h=h.length&&new RegExp(h.join("|")),D=function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)==(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!p.sortDetached&&t.compareDocumentPosition(e)===n?e===c||e.ownerDocument==L&&Z.contains(L,e)?-1:t===c||t.ownerDocument==L&&Z.contains(L,t)?1:a?s.call(a,e)-s.call(a,t):0:4&n?-1:1)},c):c}for(t in Z.matches=function(e,t){return Z(e,null,null,t)},Z.matchesSelector=function(e,t){if(le(e),d&&!j[t+" "]&&(!h||!h.test(t)))try{var n=g.call(e,t);if(n||p.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){j(t,!0)}return Z(t,c,null,[e]).length>0},Z.contains=function(e,t){return(e.ownerDocument||e)!=c&&le(e),x.contains(e,t)},Z.attr=function(e,t){(e.ownerDocument||e)!=c&&le(e);var n=r.attrHandle[t.toLowerCase()],i=n&&u.call(r.attrHandle,t.toLowerCase())?n(e,t,!d):void 0;return void 0!==i?i:e.getAttribute(t)},Z.error=function(e){throw new Error("Syntax error, unrecognized expression: "+e)},x.uniqueSort=function(e){var t,n=[],r=0,o=0;if(l=!p.sortStable,a=!p.sortStable&&i.call(e,0),A.call(e,D),l){for(;t=e[o++];)t===e[o]&&(r=n.push(o));for(;r--;)E.call(e,n[r],1)}return a=null,e},x.fn.uniqueSort=function(){return this.pushStack(x.uniqueSort(i.apply(this)))},r=x.expr={cacheLength:50,createPseudo:te,match:z,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Y,Q),e[3]=(e[3]||e[4]||e[5]||"").replace(Y,Q),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||Z.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&Z.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return z.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&B.test(n)&&(t=ue(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Y,Q).toLowerCase();return"*"===e?function(){return!0}:function(e){return C(e,t)}},CLASS:function(e){var t=b[e+" "];return t||(t=new RegExp("(^|"+S+")"+e+"("+S+"|$)"))&&b(e,(function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")}))},ATTR:function(e,t,n){return function(r){var i=Z.attr(r,e);return null==i?"!="===t:!t||(i+="","="===t?i===n:"!="===t?i!==n:"^="===t?n&&0===i.indexOf(n):"*="===t?n&&i.indexOf(n)>-1:"$="===t?n&&i.slice(-n.length)===n:"~="===t?(" "+i.replace(F," ")+" ").indexOf(n)>-1:"|="===t&&(i===n||i.slice(0,n.length+1)===n+"-"))}},CHILD:function(e,t,n,r,i){var o="nth"!==e.slice(0,3),a="last"!==e.slice(-4),s="of-type"===t;return 1===r&&0===i?function(e){return!!e.parentNode}:function(t,n,l){var c,u,f,d,p,h=o!==a?"nextSibling":"previousSibling",g=t.parentNode,v=s&&t.nodeName.toLowerCase(),_=!l&&!s,b=!1;if(g){if(o){for(;h;){for(f=t;f=f[h];)if(s?C(f,v):1===f.nodeType)return!1;p=h="only"===e&&!p&&"nextSibling"}return!0}if(p=[a?g.firstChild:g.lastChild],a&&_){for(b=(d=(c=(u=g[m]||(g[m]={}))[e]||[])[0]===y&&c[1])&&c[2],f=d&&g.childNodes[d];f=++d&&f&&f[h]||(b=d=0)||p.pop();)if(1===f.nodeType&&++b&&f===t){u[e]=[y,d,b];break}}else if(_&&(b=d=(c=(u=t[m]||(t[m]={}))[e]||[])[0]===y&&c[1]),!1===b)for(;(f=++d&&f&&f[h]||(b=d=0)||p.pop())&&(!(s?C(f,v):1===f.nodeType)||!++b||(_&&((u=f[m]||(f[m]={}))[e]=[y,b]),f!==t)););return(b-=i)===r||b%r==0&&b/r>=0}}},PSEUDO:function(e,t){var n,i=r.pseudos[e]||r.setFilters[e.toLowerCase()]||Z.error("unsupported pseudo: "+e);return i[m]?i(t):i.length>1?(n=[e,e,"",t],r.setFilters.hasOwnProperty(e.toLowerCase())?te((function(e,n){for(var r,o=i(e,t),a=o.length;a--;)e[r=s.call(e,o[a])]=!(n[r]=o[a])})):function(e){return i(e,0,n)}):i}},pseudos:{not:te((function(e){var t=[],n=[],r=me(e.replace(O,"$1"));return r[m]?te((function(e,t,n,i){for(var o,a=r(e,null,i,[]),s=e.length;s--;)(o=a[s])&&(e[s]=!(t[s]=o))})):function(e,i,o){return t[0]=e,r(t,null,o,n),t[0]=null,!n.pop()}})),has:te((function(e){return function(t){return Z(e,t).length>0}})),contains:te((function(e){return e=e.replace(Y,Q),function(t){return(t.textContent||x.text(t)).indexOf(e)>-1}})),lang:te((function(e){return $.test(e||"")||Z.error("unsupported lang: "+e),e=e.replace(Y,Q).toLowerCase(),function(t){var n;do{if(n=d?t.lang:t.getAttribute("xml:lang")||t.getAttribute("lang"))return(n=n.toLowerCase())===e||0===n.indexOf(e+"-")}while((t=t.parentNode)&&1===t.nodeType);return!1}})),target:function(t){var n=e.location&&e.location.hash;return n&&n.slice(1)===t.id},root:function(e){return e===f},focus:function(e){return e===function(){try{return c.activeElement}catch(e){}}()&&c.hasFocus()&&!!(e.type||e.href||~e.tabIndex)},enabled:oe(!1),disabled:oe(!0),checked:function(e){return C(e,"input")&&!!e.checked||C(e,"option")&&!!e.selected},selected:function(e){return e.parentNode&&e.parentNode.selectedIndex,!0===e.selected},empty:function(e){for(e=e.firstChild;e;e=e.nextSibling)if(e.nodeType<6)return!1;return!0},parent:function(e){return!r.pseudos.empty(e)},header:function(e){return U.test(e.nodeName)},input:function(e){return V.test(e.nodeName)},button:function(e){return C(e,"input")&&"button"===e.type||C(e,"button")},text:function(e){var t;return C(e,"input")&&"text"===e.type&&(null==(t=e.getAttribute("type"))||"text"===t.toLowerCase())},first:ae((function(){return[0]})),last:ae((function(e,t){return[t-1]})),eq:ae((function(e,t,n){return[n<0?n+t:n]})),even:ae((function(e,t){for(var n=0;nt?t:n;--r>=0;)e.push(r);return e})),gt:ae((function(e,t,n){for(var r=n<0?n+t:n;++r1?function(t,n,r){for(var i=e.length;i--;)if(!e[i](t,n,r))return!1;return!0}:e[0]}function he(e,t,n,r,i){for(var o,a=[],s=0,l=e.length,c=null!=t;s-1&&(o[u]=!(a[u]=d))}}else p=he(p===a?p.splice(m,p.length):p),i?i(null,a,p,c):v.apply(a,p)}))}function ve(e){for(var t,n,i,a=e.length,l=r.relative[e[0].type],c=l||r.relative[" "],u=l?1:0,f=de((function(e){return e===t}),c,!0),d=de((function(e){return s.call(t,e)>-1}),c,!0),p=[function(e,n,r){var i=!l&&(r||n!=o)||((t=n).nodeType?f(e,n,r):d(e,n,r));return t=null,i}];u1&&pe(p),u>1&&fe(e.slice(0,u-1).concat({value:" "===e[u-2].type?"*":""})).replace(O,"$1"),n,u0,i=e.length>0,a=function(a,s,l,u,f){var p,h,g,m=0,_="0",b=a&&[],w=[],k=o,C=a||i&&r.find.TAG("*",f),A=y+=null==k?1:Math.random()||.1,E=C.length;for(f&&(o=s==c||s||f);_!==E&&null!=(p=C[_]);_++){if(i&&p){for(h=0,s||p.ownerDocument==c||(le(p),l=!d);g=e[h++];)if(g(p,s||c,l)){v.call(u,p);break}f&&(y=A)}n&&((p=!g&&p)&&m--,a&&b.push(p))}if(m+=_,n&&_!==m){for(h=0;g=t[h++];)g(b,w,s,l);if(a){if(m>0)for(;_--;)b[_]||w[_]||(w[_]=T.call(u));w=he(w)}v.apply(u,w),f&&!a&&w.length>0&&m+t.length>1&&x.uniqueSort(u)}return f&&(y=A,o=k),b};return n?te(a):a}(a,i)),s.selector=e}return s}function ye(e,t,n,i){var o,a,s,l,c,u="function"==typeof e&&e,f=!i&&ue(e=u.selector||e);if(n=n||[],1===f.length){if((a=f[0]=f[0].slice(0)).length>2&&"ID"===(s=a[0]).type&&9===t.nodeType&&d&&r.relative[a[1].type]){if(!(t=(r.find.ID(s.matches[0].replace(Y,Q),t)||[])[0]))return n;u&&(t=t.parentNode),e=e.slice(a.shift().value.length)}for(o=z.needsContext.test(e)?0:a.length;o--&&(s=a[o],!r.relative[l=s.type]);)if((c=r.find[l])&&(i=c(s.matches[0].replace(Y,Q),K.test(a[0].type)&&se(t.parentNode)||t))){if(a.splice(o,1),!(e=i.length&&fe(a)))return v.apply(n,i),n;break}}return(u||me(e,f))(i,t,!d,n,!t||K.test(e)&&se(t.parentNode)||t),n}ce.prototype=r.filters=r.pseudos,r.setFilters=new ce,p.sortStable=m.split("").sort(D).join("")===m,le(),p.sortDetached=ne((function(e){return 1&e.compareDocumentPosition(c.createElement("fieldset"))})),x.find=Z,x.expr[":"]=x.expr.pseudos,x.unique=x.uniqueSort,Z.compile=me,Z.select=ye,Z.setDocument=le,Z.tokenize=ue,Z.escape=x.escapeSelector,Z.getText=x.text,Z.isXML=x.isXMLDoc,Z.selectors=x.expr,Z.support=x.support,Z.uniqueSort=x.uniqueSort}();var N=function(e,t,n){for(var r=[],i=void 0!==n;(e=e[t])&&9!==e.nodeType;)if(1===e.nodeType){if(i&&x(e).is(n))break;r.push(e)}return r},I=function(e,t){for(var n=[];e;e=e.nextSibling)1===e.nodeType&&e!==t&&n.push(e);return n},H=x.expr.match.needsContext,M=/^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function F(e,t,n){return h(t)?x.grep(e,(function(e,r){return!!t.call(e,r,e)!==n})):t.nodeType?x.grep(e,(function(e){return e===t!==n})):"string"!=typeof t?x.grep(e,(function(e){return s.call(t,e)>-1!==n})):x.filter(t,e,n)}x.filter=function(e,t,n){var r=t[0];return n&&(e=":not("+e+")"),1===t.length&&1===r.nodeType?x.find.matchesSelector(r,e)?[r]:[]:x.find.matches(e,x.grep(t,(function(e){return 1===e.nodeType})))},x.fn.extend({find:function(e){var t,n,r=this.length,i=this;if("string"!=typeof e)return this.pushStack(x(e).filter((function(){for(t=0;t1?x.uniqueSort(n):n},filter:function(e){return this.pushStack(F(this,e||[],!1))},not:function(e){return this.pushStack(F(this,e||[],!0))},is:function(e){return!!F(this,"string"==typeof e&&H.test(e)?x(e):e||[],!1).length}});var q,R=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/;(x.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||q,"string"==typeof e){if(!(r="<"===e[0]&&">"===e[e.length-1]&&e.length>=3?[null,e,null]:R.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof x?t[0]:t,x.merge(this,x.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:v,!0)),M.test(r[1])&&x.isPlainObject(t))for(r in t)h(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=v.getElementById(r[2]))&&(this[0]=i,this.length=1),this}return e.nodeType?(this[0]=e,this.length=1,this):h(e)?void 0!==n.ready?n.ready(e):e(x):x.makeArray(e,this)}).prototype=x.fn,q=x(v);var W=/^(?:parents|prev(?:Until|All))/,B={children:!0,contents:!0,next:!0,prev:!0};function $(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}x.fn.extend({has:function(e){var t=x(e,this),n=t.length;return this.filter((function(){for(var e=0;e-1:1===n.nodeType&&x.find.matchesSelector(n,e))){o.push(n);break}return this.pushStack(o.length>1?x.uniqueSort(o):o)},index:function(e){return e?"string"==typeof e?s.call(x(e),this[0]):s.call(this,e.jquery?e[0]:e):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(e,t){return this.pushStack(x.uniqueSort(x.merge(this.get(),x(e,t))))},addBack:function(e){return this.add(null==e?this.prevObject:this.prevObject.filter(e))}}),x.each({parent:function(e){var t=e.parentNode;return t&&11!==t.nodeType?t:null},parents:function(e){return N(e,"parentNode")},parentsUntil:function(e,t,n){return N(e,"parentNode",n)},next:function(e){return $(e,"nextSibling")},prev:function(e){return $(e,"previousSibling")},nextAll:function(e){return N(e,"nextSibling")},prevAll:function(e){return N(e,"previousSibling")},nextUntil:function(e,t,n){return N(e,"nextSibling",n)},prevUntil:function(e,t,n){return N(e,"previousSibling",n)},siblings:function(e){return I((e.parentNode||{}).firstChild,e)},children:function(e){return I(e.firstChild)},contents:function(e){return null!=e.contentDocument&&r(e.contentDocument)?e.contentDocument:(C(e,"template")&&(e=e.content||e),x.merge([],e.childNodes))}},(function(e,t){x.fn[e]=function(n,r){var i=x.map(this,t,n);return"Until"!==e.slice(-5)&&(r=n),r&&"string"==typeof r&&(i=x.filter(r,i)),this.length>1&&(B[e]||x.uniqueSort(i),W.test(e)&&i.reverse()),this.pushStack(i)}}));var z=/[^\x20\t\r\n\f]+/g;function V(e){return e}function U(e){throw e}function X(e,t,n,r){var i;try{e&&h(i=e.promise)?i.call(e).done(t).fail(n):e&&h(i=e.then)?i.call(e,t,n):t.apply(void 0,[e].slice(r))}catch(e){n.apply(void 0,[e])}}x.Callbacks=function(e){e="string"==typeof e?function(e){var t={};return x.each(e.match(z)||[],(function(e,n){t[n]=!0})),t}(e):x.extend({},e);var t,n,r,i,o=[],a=[],s=-1,l=function(){for(i=i||e.once,r=t=!0;a.length;s=-1)for(n=a.shift();++s-1;)o.splice(n,1),n<=s&&s--})),this},has:function(e){return e?x.inArray(e,o)>-1:o.length>0},empty:function(){return o&&(o=[]),this},disable:function(){return i=a=[],o=n="",this},disabled:function(){return!o},lock:function(){return i=a=[],n||t||(o=n=""),this},locked:function(){return!!i},fireWith:function(e,n){return i||(n=[e,(n=n||[]).slice?n.slice():n],a.push(n),t||l()),this},fire:function(){return c.fireWith(this,arguments),this},fired:function(){return!!r}};return c},x.extend({Deferred:function(t){var n=[["notify","progress",x.Callbacks("memory"),x.Callbacks("memory"),2],["resolve","done",x.Callbacks("once memory"),x.Callbacks("once memory"),0,"resolved"],["reject","fail",x.Callbacks("once memory"),x.Callbacks("once memory"),1,"rejected"]],r="pending",i={state:function(){return r},always:function(){return o.done(arguments).fail(arguments),this},catch:function(e){return i.then(null,e)},pipe:function(){var e=arguments;return x.Deferred((function(t){x.each(n,(function(n,r){var i=h(e[r[4]])&&e[r[4]];o[r[1]]((function(){var e=i&&i.apply(this,arguments);e&&h(e.promise)?e.promise().progress(t.notify).done(t.resolve).fail(t.reject):t[r[0]+"With"](this,i?[e]:arguments)}))})),e=null})).promise()},then:function(t,r,i){var o=0;function a(t,n,r,i){return function(){var s=this,l=arguments,c=function(){var e,c;if(!(t=o&&(r!==U&&(s=void 0,l=[e]),n.rejectWith(s,l))}};t?u():(x.Deferred.getErrorHook?u.error=x.Deferred.getErrorHook():x.Deferred.getStackHook&&(u.error=x.Deferred.getStackHook()),e.setTimeout(u))}}return x.Deferred((function(e){n[0][3].add(a(0,e,h(i)?i:V,e.notifyWith)),n[1][3].add(a(0,e,h(t)?t:V)),n[2][3].add(a(0,e,h(r)?r:U))})).promise()},promise:function(e){return null!=e?x.extend(e,i):i}},o={};return x.each(n,(function(e,t){var a=t[2],s=t[5];i[t[1]]=a.add,s&&a.add((function(){r=s}),n[3-e][2].disable,n[3-e][3].disable,n[0][2].lock,n[0][3].lock),a.add(t[3].fire),o[t[0]]=function(){return o[t[0]+"With"](this===o?void 0:this,arguments),this},o[t[0]+"With"]=a.fireWith})),i.promise(o),t&&t.call(o,o),o},when:function(e){var t=arguments.length,n=t,r=Array(n),o=i.call(arguments),a=x.Deferred(),s=function(e){return function(n){r[e]=this,o[e]=arguments.length>1?i.call(arguments):n,--t||a.resolveWith(r,o)}};if(t<=1&&(X(e,a.done(s(n)).resolve,a.reject,!t),"pending"===a.state()||h(o[n]&&o[n].then)))return a.then();for(;n--;)X(o[n],s(n),a.reject);return a.promise()}});var K=/^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/;x.Deferred.exceptionHook=function(t,n){e.console&&e.console.warn&&t&&K.test(t.name)&&e.console.warn("jQuery.Deferred exception: "+t.message,t.stack,n)},x.readyException=function(t){e.setTimeout((function(){throw t}))};var Y=x.Deferred();function Q(){v.removeEventListener("DOMContentLoaded",Q),e.removeEventListener("load",Q),x.ready()}x.fn.ready=function(e){return Y.then(e).catch((function(e){x.readyException(e)})),this},x.extend({isReady:!1,readyWait:1,ready:function(e){(!0===e?--x.readyWait:x.isReady)||(x.isReady=!0,!0!==e&&--x.readyWait>0||Y.resolveWith(v,[x]))}}),x.ready.then=Y.then,"complete"===v.readyState||"loading"!==v.readyState&&!v.documentElement.doScroll?e.setTimeout(x.ready):(v.addEventListener("DOMContentLoaded",Q),e.addEventListener("load",Q));var G=function e(t,n,r,i,o,a,s){var l=0,c=t.length,u=null==r;if("object"===_(r))for(l in o=!0,r)e(t,n,l,r[l],!0,a,s);else if(void 0!==i&&(o=!0,h(i)||(s=!0),u&&(s?(n.call(t,i),n=null):(u=n,n=function(e,t,n){return u.call(x(e),n)})),n))for(;l1,null,!0)},removeData:function(e){return this.each((function(){oe.remove(this,e)}))}}),x.extend({queue:function(e,t,n){var r;if(e)return t=(t||"fx")+"queue",r=ie.get(e,t),n&&(!r||Array.isArray(n)?r=ie.access(e,t,x.makeArray(n)):r.push(n)),r||[]},dequeue:function(e,t){t=t||"fx";var n=x.queue(e,t),r=n.length,i=n.shift(),o=x._queueHooks(e,t);"inprogress"===i&&(i=n.shift(),r--),i&&("fx"===t&&n.unshift("inprogress"),delete o.stop,i.call(e,(function(){x.dequeue(e,t)}),o)),!r&&o&&o.empty.fire()},_queueHooks:function(e,t){var n=t+"queueHooks";return ie.get(e,n)||ie.access(e,n,{empty:x.Callbacks("once memory").add((function(){ie.remove(e,[t+"queue",n])}))})}}),x.fn.extend({queue:function(e,t){var n=2;return"string"!=typeof e&&(t=e,e="fx",n--),arguments.length\x20\t\r\n\f]*)/i,Ce=/^$|^module$|\/(?:java|ecma)script/i;be=v.createDocumentFragment().appendChild(v.createElement("div")),(we=v.createElement("input")).setAttribute("type","radio"),we.setAttribute("checked","checked"),we.setAttribute("name","t"),be.appendChild(we),p.checkClone=be.cloneNode(!0).cloneNode(!0).lastChild.checked,be.innerHTML="",p.noCloneChecked=!!be.cloneNode(!0).lastChild.defaultValue,be.innerHTML="",p.option=!!be.lastChild;var Te={thead:[1,"","
    "],col:[2,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],_default:[0,"",""]};function Ae(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&C(e,t)?x.merge([e],n):n}function Ee(e,t){for(var n=0,r=e.length;n",""]);var Se=/<|&#?\w+;/;function Oe(e,t,n,r,i){for(var o,a,s,l,c,u,f=t.createDocumentFragment(),d=[],p=0,h=e.length;p-1)i&&i.push(o);else if(c=pe(o),a=Ae(f.appendChild(o),"script"),c&&Ee(a),n)for(u=0;o=a[u++];)Ce.test(o.type||"")&&n.push(o);return f}var je=/^([^.]*)(?:\.(.+)|)/;function De(){return!0}function Le(){return!1}function Pe(e,t,n,r,i,o){var a,s;if("object"===_typeof(t)){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Pe(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Le;else if(!i)return e;return 1===o&&(a=i,i=function(e){return x().off(e),a.apply(this,arguments)},i.guid=a.guid||(a.guid=x.guid++)),e.each((function(){x.event.add(this,t,i,r,n)}))}function Ne(e,t,n){n?(ie.set(e,t,!1),x.event.add(e,t,{namespace:!1,handler:function(e){var n,r=ie.get(this,t);if(1&e.isTrigger&&this[t]){if(r)(x.event.special[t]||{}).delegateType&&e.stopPropagation();else if(r=i.call(arguments),ie.set(this,t,r),this[t](),n=ie.get(this,t),ie.set(this,t,!1),r!==n)return e.stopImmediatePropagation(),e.preventDefault(),n}else r&&(ie.set(this,t,x.event.trigger(r[0],r.slice(1),this)),e.stopPropagation(),e.isImmediatePropagationStopped=De)}})):void 0===ie.get(e,t)&&x.event.add(e,t,De)}x.event={global:{},add:function(e,t,n,r,i){var o,a,s,l,c,u,f,d,p,h,g,v=ie.get(e);if(ne(e))for(n.handler&&(n=(o=n).handler,i=o.selector),i&&x.find.matchesSelector(de,i),n.guid||(n.guid=x.guid++),(l=v.events)||(l=v.events=Object.create(null)),(a=v.handle)||(a=v.handle=function(t){return void 0!==x&&x.event.triggered!==t.type?x.event.dispatch.apply(e,arguments):void 0}),c=(t=(t||"").match(z)||[""]).length;c--;)p=g=(s=je.exec(t[c])||[])[1],h=(s[2]||"").split(".").sort(),p&&(f=x.event.special[p]||{},p=(i?f.delegateType:f.bindType)||p,f=x.event.special[p]||{},u=x.extend({type:p,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&x.expr.match.needsContext.test(i),namespace:h.join(".")},o),(d=l[p])||((d=l[p]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(e,r,h,a)||e.addEventListener&&e.addEventListener(p,a)),f.add&&(f.add.call(e,u),u.handler.guid||(u.handler.guid=n.guid)),i?d.splice(d.delegateCount++,0,u):d.push(u),x.event.global[p]=!0)},remove:function(e,t,n,r,i){var o,a,s,l,c,u,f,d,p,h,g,v=ie.hasData(e)&&ie.get(e);if(v&&(l=v.events)){for(c=(t=(t||"").match(z)||[""]).length;c--;)if(p=g=(s=je.exec(t[c])||[])[1],h=(s[2]||"").split(".").sort(),p){for(f=x.event.special[p]||{},d=l[p=(r?f.delegateType:f.bindType)||p]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=d.length;o--;)u=d[o],!i&&g!==u.origType||n&&n.guid!==u.guid||s&&!s.test(u.namespace)||r&&r!==u.selector&&("**"!==r||!u.selector)||(d.splice(o,1),u.selector&&d.delegateCount--,f.remove&&f.remove.call(e,u));a&&!d.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||x.removeEvent(e,p,v.handle),delete l[p])}else for(p in l)x.event.remove(e,p+t[c],n,r,!0);x.isEmptyObject(l)&&ie.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=new Array(arguments.length),l=x.event.fix(e),c=(ie.get(this,"events")||Object.create(null))[l.type]||[],u=x.event.special[l.type]||{};for(s[0]=l,t=1;t=1))for(;c!==this;c=c.parentNode||this)if(1===c.nodeType&&("click"!==e.type||!0!==c.disabled)){for(o=[],a={},n=0;n-1:x.find(i,this,null,[c]).length),a[i]&&o.push(r);o.length&&s.push({elem:c,handlers:o})}return c=this,l\s*$/g;function Fe(e,t){return C(e,"table")&&C(11!==t.nodeType?t:t.firstChild,"tr")&&x(e).children("tbody")[0]||e}function qe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Re(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function We(e,t){var n,r,i,o,a,s;if(1===t.nodeType){if(ie.hasData(e)&&(s=ie.get(e).events))for(i in ie.remove(t,"handle events"),s)for(n=0,r=s[i].length;n1&&"string"==typeof v&&!p.checkClone&&He.test(v))return e.each((function(i){var o=e.eq(i);m&&(t[0]=v.call(this,i,o.html())),$e(o,t,n,r)}));if(d&&(a=(i=Oe(t,e[0].ownerDocument,!1,e,r)).firstChild,1===i.childNodes.length&&(i=a),a||r)){for(l=(s=x.map(Ae(i,"script"),qe)).length;f0&&Ee(a,!l&&Ae(e,"script")),s},cleanData:function(e){for(var t,n,r,i=x.event.special,o=0;void 0!==(n=e[o]);o++)if(ne(n)){if(t=n[ie.expando]){if(t.events)for(r in t.events)i[r]?x.event.remove(n,r):x.removeEvent(n,r,t.handle);n[ie.expando]=void 0}n[oe.expando]&&(n[oe.expando]=void 0)}}}),x.fn.extend({detach:function(e){return ze(this,e,!0)},remove:function(e){return ze(this,e)},text:function(e){return G(this,(function(e){return void 0===e?x.text(this):this.empty().each((function(){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||(this.textContent=e)}))}),null,e,arguments.length)},append:function(){return $e(this,arguments,(function(e){1!==this.nodeType&&11!==this.nodeType&&9!==this.nodeType||Fe(this,e).appendChild(e)}))},prepend:function(){return $e(this,arguments,(function(e){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var t=Fe(this,e);t.insertBefore(e,t.firstChild)}}))},before:function(){return $e(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this)}))},after:function(){return $e(this,arguments,(function(e){this.parentNode&&this.parentNode.insertBefore(e,this.nextSibling)}))},empty:function(){for(var e,t=0;null!=(e=this[t]);t++)1===e.nodeType&&(x.cleanData(Ae(e,!1)),e.textContent="");return this},clone:function(e,t){return e=null!=e&&e,t=null==t?e:t,this.map((function(){return x.clone(this,e,t)}))},html:function(e){return G(this,(function(e){var t=this[0]||{},n=0,r=this.length;if(void 0===e&&1===t.nodeType)return t.innerHTML;if("string"==typeof e&&!Ie.test(e)&&!Te[(ke.exec(e)||["",""])[1].toLowerCase()]){e=x.htmlPrefilter(e);try{for(;n=0&&(l+=Math.max(0,Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-o-l-s-.5))||0),l+c}function st(e,t,n){var r=Xe(e),i=(!p.boxSizingReliable()||n)&&"border-box"===x.css(e,"boxSizing",!1,r),o=i,a=Qe(e,t,r),s="offset"+t[0].toUpperCase()+t.slice(1);if(Ve.test(a)){if(!n)return a;a="auto"}return(!p.boxSizingReliable()&&i||!p.reliableTrDimensions()&&C(e,"tr")||"auto"===a||!parseFloat(a)&&"inline"===x.css(e,"display",!1,r))&&e.getClientRects().length&&(i="border-box"===x.css(e,"boxSizing",!1,r),(o=s in e)&&(a=e[s])),(a=parseFloat(a)||0)+at(e,t,n||(i?"border":"content"),o,r,a)+"px"}function lt(e,t,n,r,i){return new lt.prototype.init(e,t,n,r,i)}x.extend({cssHooks:{opacity:{get:function(e,t){if(t){var n=Qe(e,"opacity");return""===n?"1":n}}}},cssNumber:{animationIterationCount:!0,aspectRatio:!0,borderImageSlice:!0,columnCount:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,scale:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeMiterlimit:!0,strokeOpacity:!0},cssProps:{},style:function(e,t,n,r){if(e&&3!==e.nodeType&&8!==e.nodeType&&e.style){var i,o,a,s=te(t),l=Ue.test(t),c=e.style;if(l||(t=tt(s)),a=x.cssHooks[t]||x.cssHooks[s],void 0===n)return a&&"get"in a&&void 0!==(i=a.get(e,!1,r))?i:c[t];"string"===(o=_typeof(n))&&(i=ue.exec(n))&&i[1]&&(n=ve(e,t,i),o="number"),null!=n&&n==n&&("number"!==o||l||(n+=i&&i[3]||(x.cssNumber[s]?"":"px")),p.clearCloneStyle||""!==n||0!==t.indexOf("background")||(c[t]="inherit"),a&&"set"in a&&void 0===(n=a.set(e,n,r))||(l?c.setProperty(t,n):c[t]=n))}},css:function(e,t,n,r){var i,o,a,s=te(t);return Ue.test(t)||(t=tt(s)),(a=x.cssHooks[t]||x.cssHooks[s])&&"get"in a&&(i=a.get(e,!0,n)),void 0===i&&(i=Qe(e,t,r)),"normal"===i&&t in it&&(i=it[t]),""===n||n?(o=parseFloat(i),!0===n||isFinite(o)?o||0:i):i}}),x.each(["height","width"],(function(e,t){x.cssHooks[t]={get:function(e,n,r){if(n)return!nt.test(x.css(e,"display"))||e.getClientRects().length&&e.getBoundingClientRect().width?st(e,t,r):Ke(e,rt,(function(){return st(e,t,r)}))},set:function(e,n,r){var i,o=Xe(e),a=!p.scrollboxSize()&&"absolute"===o.position,s=(a||r)&&"border-box"===x.css(e,"boxSizing",!1,o),l=r?at(e,t,r,s,o):0;return s&&a&&(l-=Math.ceil(e["offset"+t[0].toUpperCase()+t.slice(1)]-parseFloat(o[t])-at(e,t,"border",!1,o)-.5)),l&&(i=ue.exec(n))&&"px"!==(i[3]||"px")&&(e.style[t]=n,n=x.css(e,t)),ot(0,n,l)}}})),x.cssHooks.marginLeft=Ge(p.reliableMarginLeft,(function(e,t){if(t)return(parseFloat(Qe(e,"marginLeft"))||e.getBoundingClientRect().left-Ke(e,{marginLeft:0},(function(){return e.getBoundingClientRect().left})))+"px"})),x.each({margin:"",padding:"",border:"Width"},(function(e,t){x.cssHooks[e+t]={expand:function(n){for(var r=0,i={},o="string"==typeof n?n.split(" "):[n];r<4;r++)i[e+fe[r]+t]=o[r]||o[r-2]||o[0];return i}},"margin"!==e&&(x.cssHooks[e+t].set=ot)})),x.fn.extend({css:function(e,t){return G(this,(function(e,t,n){var r,i,o={},a=0;if(Array.isArray(t)){for(r=Xe(e),i=t.length;a1)}}),x.Tween=lt,lt.prototype={constructor:lt,init:function(e,t,n,r,i,o){this.elem=e,this.prop=n,this.easing=i||x.easing._default,this.options=t,this.start=this.now=this.cur(),this.end=r,this.unit=o||(x.cssNumber[n]?"":"px")},cur:function(){var e=lt.propHooks[this.prop];return e&&e.get?e.get(this):lt.propHooks._default.get(this)},run:function(e){var t,n=lt.propHooks[this.prop];return this.options.duration?this.pos=t=x.easing[this.easing](e,this.options.duration*e,0,1,this.options.duration):this.pos=t=e,this.now=(this.end-this.start)*t+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),n&&n.set?n.set(this):lt.propHooks._default.set(this),this}},lt.prototype.init.prototype=lt.prototype,lt.propHooks={_default:{get:function(e){var t;return 1!==e.elem.nodeType||null!=e.elem[e.prop]&&null==e.elem.style[e.prop]?e.elem[e.prop]:(t=x.css(e.elem,e.prop,""))&&"auto"!==t?t:0},set:function(e){x.fx.step[e.prop]?x.fx.step[e.prop](e):1!==e.elem.nodeType||!x.cssHooks[e.prop]&&null==e.elem.style[tt(e.prop)]?e.elem[e.prop]=e.now:x.style(e.elem,e.prop,e.now+e.unit)}}},lt.propHooks.scrollTop=lt.propHooks.scrollLeft={set:function(e){e.elem.nodeType&&e.elem.parentNode&&(e.elem[e.prop]=e.now)}},x.easing={linear:function(e){return e},swing:function(e){return.5-Math.cos(e*Math.PI)/2},_default:"swing"},x.fx=lt.prototype.init,x.fx.step={};var ct,ut,ft=/^(?:toggle|show|hide)$/,dt=/queueHooks$/;function pt(){ut&&(!1===v.hidden&&e.requestAnimationFrame?e.requestAnimationFrame(pt):e.setTimeout(pt,x.fx.interval),x.fx.tick())}function ht(){return e.setTimeout((function(){ct=void 0})),ct=Date.now()}function gt(e,t){var n,r=0,i={height:e};for(t=t?1:0;r<4;r+=2-t)i["margin"+(n=fe[r])]=i["padding"+n]=e;return t&&(i.opacity=i.width=e),i}function vt(e,t,n){for(var r,i=(mt.tweeners[t]||[]).concat(mt.tweeners["*"]),o=0,a=i.length;o1)},removeAttr:function(e){return this.each((function(){x.removeAttr(this,e)}))}}),x.extend({attr:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return void 0===e.getAttribute?x.prop(e,t,n):(1===o&&x.isXMLDoc(e)||(i=x.attrHooks[t.toLowerCase()]||(x.expr.match.bool.test(t)?yt:void 0)),void 0!==n?null===n?void x.removeAttr(e,t):i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:(e.setAttribute(t,n+""),n):i&&"get"in i&&null!==(r=i.get(e,t))?r:null==(r=x.find.attr(e,t))?void 0:r)},attrHooks:{type:{set:function(e,t){if(!p.radioValue&&"radio"===t&&C(e,"input")){var n=e.value;return e.setAttribute("type",t),n&&(e.value=n),t}}}},removeAttr:function(e,t){var n,r=0,i=t&&t.match(z);if(i&&1===e.nodeType)for(;n=i[r++];)e.removeAttribute(n)}}),yt={set:function(e,t,n){return!1===t?x.removeAttr(e,n):e.setAttribute(n,n),n}},x.each(x.expr.match.bool.source.match(/\w+/g),(function(e,t){var n=_t[t]||x.find.attr;_t[t]=function(e,t,r){var i,o,a=t.toLowerCase();return r||(o=_t[a],_t[a]=i,i=null!=n(e,t,r)?a:null,_t[a]=o),i}}));var bt=/^(?:input|select|textarea|button)$/i,wt=/^(?:a|area)$/i;function xt(e){return(e.match(z)||[]).join(" ")}function kt(e){return e.getAttribute&&e.getAttribute("class")||""}function Ct(e){return Array.isArray(e)?e:"string"==typeof e&&e.match(z)||[]}x.fn.extend({prop:function(e,t){return G(this,x.prop,e,t,arguments.length>1)},removeProp:function(e){return this.each((function(){delete this[x.propFix[e]||e]}))}}),x.extend({prop:function(e,t,n){var r,i,o=e.nodeType;if(3!==o&&8!==o&&2!==o)return 1===o&&x.isXMLDoc(e)||(t=x.propFix[t]||t,i=x.propHooks[t]),void 0!==n?i&&"set"in i&&void 0!==(r=i.set(e,n,t))?r:e[t]=n:i&&"get"in i&&null!==(r=i.get(e,t))?r:e[t]},propHooks:{tabIndex:{get:function(e){var t=x.find.attr(e,"tabindex");return t?parseInt(t,10):bt.test(e.nodeName)||wt.test(e.nodeName)&&e.href?0:-1}}},propFix:{for:"htmlFor",class:"className"}}),p.optSelected||(x.propHooks.selected={get:function(e){var t=e.parentNode;return t&&t.parentNode&&t.parentNode.selectedIndex,null},set:function(e){var t=e.parentNode;t&&(t.selectedIndex,t.parentNode&&t.parentNode.selectedIndex)}}),x.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],(function(){x.propFix[this.toLowerCase()]=this})),x.fn.extend({addClass:function(e){var t,n,r,i,o,a;return h(e)?this.each((function(t){x(this).addClass(e.call(this,t,kt(this)))})):(t=Ct(e)).length?this.each((function(){if(r=kt(this),n=1===this.nodeType&&" "+xt(r)+" "){for(o=0;o-1;)n=n.replace(" "+i+" "," ");a=xt(n),r!==a&&this.setAttribute("class",a)}})):this:this.attr("class","")},toggleClass:function(e,t){var n,r,i,o,a=_typeof(e),s="string"===a||Array.isArray(e);return h(e)?this.each((function(n){x(this).toggleClass(e.call(this,n,kt(this),t),t)})):"boolean"==typeof t&&s?t?this.addClass(e):this.removeClass(e):(n=Ct(e),this.each((function(){if(s)for(o=x(this),i=0;i-1)return!0;return!1}});var Tt=/\r/g;x.fn.extend({val:function(e){var t,n,r,i=this[0];return arguments.length?(r=h(e),this.each((function(n){var i;1===this.nodeType&&(null==(i=r?e.call(this,n,x(this).val()):e)?i="":"number"==typeof i?i+="":Array.isArray(i)&&(i=x.map(i,(function(e){return null==e?"":e+""}))),(t=x.valHooks[this.type]||x.valHooks[this.nodeName.toLowerCase()])&&"set"in t&&void 0!==t.set(this,i,"value")||(this.value=i))}))):i?(t=x.valHooks[i.type]||x.valHooks[i.nodeName.toLowerCase()])&&"get"in t&&void 0!==(n=t.get(i,"value"))?n:"string"==typeof(n=i.value)?n.replace(Tt,""):null==n?"":n:void 0}}),x.extend({valHooks:{option:{get:function(e){var t=x.find.attr(e,"value");return null!=t?t:xt(x.text(e))}},select:{get:function(e){var t,n,r,i=e.options,o=e.selectedIndex,a="select-one"===e.type,s=a?null:[],l=a?o+1:i.length;for(r=o<0?l:a?o:0;r-1)&&(n=!0);return n||(e.selectedIndex=-1),o}}}}),x.each(["radio","checkbox"],(function(){x.valHooks[this]={set:function(e,t){if(Array.isArray(t))return e.checked=x.inArray(x(e).val(),t)>-1}},p.checkOn||(x.valHooks[this].get=function(e){return null===e.getAttribute("value")?"on":e.value})}));var At=e.location,Et={guid:Date.now()},St=/\?/;x.parseXML=function(t){var n,r;if(!t||"string"!=typeof t)return null;try{n=(new e.DOMParser).parseFromString(t,"text/xml")}catch(e){}return r=n&&n.getElementsByTagName("parsererror")[0],n&&!r||x.error("Invalid XML: "+(r?x.map(r.childNodes,(function(e){return e.textContent})).join("\n"):t)),n};var Ot=/^(?:focusinfocus|focusoutblur)$/,jt=function(e){e.stopPropagation()};x.extend(x.event,{trigger:function(t,n,r,i){var o,a,s,l,c,f,d,p,m=[r||v],y=u.call(t,"type")?t.type:t,_=u.call(t,"namespace")?t.namespace.split("."):[];if(a=p=s=r=r||v,3!==r.nodeType&&8!==r.nodeType&&!Ot.test(y+x.event.triggered)&&(y.indexOf(".")>-1&&(_=y.split("."),y=_.shift(),_.sort()),c=y.indexOf(":")<0&&"on"+y,(t=t[x.expando]?t:new x.Event(y,"object"===_typeof(t)&&t)).isTrigger=i?2:3,t.namespace=_.join("."),t.rnamespace=t.namespace?new RegExp("(^|\\.)"+_.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,t.result=void 0,t.target||(t.target=r),n=null==n?[t]:x.makeArray(n,[t]),d=x.event.special[y]||{},i||!d.trigger||!1!==d.trigger.apply(r,n))){if(!i&&!d.noBubble&&!g(r)){for(l=d.delegateType||y,Ot.test(l+y)||(a=a.parentNode);a;a=a.parentNode)m.push(a),s=a;s===(r.ownerDocument||v)&&m.push(s.defaultView||s.parentWindow||e)}for(o=0;(a=m[o++])&&!t.isPropagationStopped();)p=a,t.type=o>1?l:d.bindType||y,(f=(ie.get(a,"events")||Object.create(null))[t.type]&&ie.get(a,"handle"))&&f.apply(a,n),(f=c&&a[c])&&f.apply&&ne(a)&&(t.result=f.apply(a,n),!1===t.result&&t.preventDefault());return t.type=y,i||t.isDefaultPrevented()||d._default&&!1!==d._default.apply(m.pop(),n)||!ne(r)||c&&h(r[y])&&!g(r)&&((s=r[c])&&(r[c]=null),x.event.triggered=y,t.isPropagationStopped()&&p.addEventListener(y,jt),r[y](),t.isPropagationStopped()&&p.removeEventListener(y,jt),x.event.triggered=void 0,s&&(r[c]=s)),t.result}},simulate:function(e,t,n){var r=x.extend(new x.Event,n,{type:e,isSimulated:!0});x.event.trigger(r,null,t)}}),x.fn.extend({trigger:function(e,t){return this.each((function(){x.event.trigger(e,t,this)}))},triggerHandler:function(e,t){var n=this[0];if(n)return x.event.trigger(e,t,n,!0)}});var Dt=/\[\]$/,Lt=/\r?\n/g,Pt=/^(?:submit|button|image|reset|file)$/i,Nt=/^(?:input|select|textarea|keygen)/i;function It(e,t,n,r){var i;if(Array.isArray(t))x.each(t,(function(t,i){n||Dt.test(e)?r(e,i):It(e+"["+("object"===_typeof(i)&&null!=i?t:"")+"]",i,n,r)}));else if(n||"object"!==_(t))r(e,t);else for(i in t)It(e+"["+i+"]",t[i],n,r)}x.param=function(e,t){var n,r=[],i=function(e,t){var n=h(t)?t():t;r[r.length]=encodeURIComponent(e)+"="+encodeURIComponent(null==n?"":n)};if(null==e)return"";if(Array.isArray(e)||e.jquery&&!x.isPlainObject(e))x.each(e,(function(){i(this.name,this.value)}));else for(n in e)It(n,e[n],t,i);return r.join("&")},x.fn.extend({serialize:function(){return x.param(this.serializeArray())},serializeArray:function(){return this.map((function(){var e=x.prop(this,"elements");return e?x.makeArray(e):this})).filter((function(){var e=this.type;return this.name&&!x(this).is(":disabled")&&Nt.test(this.nodeName)&&!Pt.test(e)&&(this.checked||!xe.test(e))})).map((function(e,t){var n=x(this).val();return null==n?null:Array.isArray(n)?x.map(n,(function(e){return{name:t.name,value:e.replace(Lt,"\r\n")}})):{name:t.name,value:n.replace(Lt,"\r\n")}})).get()}});var Ht=/%20/g,Mt=/#.*$/,Ft=/([?&])_=[^&]*/,qt=/^(.*?):[ \t]*([^\r\n]*)$/gm,Rt=/^(?:GET|HEAD)$/,Wt=/^\/\//,Bt={},$t={},zt="*/".concat("*"),Vt=v.createElement("a");function Ut(e){return function(t,n){"string"!=typeof t&&(n=t,t="*");var r,i=0,o=t.toLowerCase().match(z)||[];if(h(n))for(;r=o[i++];)"+"===r[0]?(r=r.slice(1)||"*",(e[r]=e[r]||[]).unshift(n)):(e[r]=e[r]||[]).push(n)}}function Xt(e,t,n,r){var i={},o=e===$t;function a(s){var l;return i[s]=!0,x.each(e[s]||[],(function(e,s){var c=s(t,n,r);return"string"!=typeof c||o||i[c]?o?!(l=c):void 0:(t.dataTypes.unshift(c),a(c),!1)})),l}return a(t.dataTypes[0])||!i["*"]&&a("*")}function Kt(e,t){var n,r,i=x.ajaxSettings.flatOptions||{};for(n in t)void 0!==t[n]&&((i[n]?e:r||(r={}))[n]=t[n]);return r&&x.extend(!0,e,r),e}Vt.href=At.href,x.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:At.href,type:"GET",isLocal:/^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(At.protocol),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":zt,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/\bxml\b/,html:/\bhtml/,json:/\bjson\b/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":JSON.parse,"text xml":x.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(e,t){return t?Kt(Kt(e,x.ajaxSettings),t):Kt(x.ajaxSettings,e)},ajaxPrefilter:Ut(Bt),ajaxTransport:Ut($t),ajax:function(t,n){"object"===_typeof(t)&&(n=t,t=void 0),n=n||{};var r,i,o,a,s,l,c,u,f,d,p=x.ajaxSetup({},n),h=p.context||p,g=p.context&&(h.nodeType||h.jquery)?x(h):x.event,m=x.Deferred(),y=x.Callbacks("once memory"),_=p.statusCode||{},b={},w={},k="canceled",C={readyState:0,getResponseHeader:function(e){var t;if(c){if(!a)for(a={};t=qt.exec(o);)a[t[1].toLowerCase()+" "]=(a[t[1].toLowerCase()+" "]||[]).concat(t[2]);t=a[e.toLowerCase()+" "]}return null==t?null:t.join(", ")},getAllResponseHeaders:function(){return c?o:null},setRequestHeader:function(e,t){return null==c&&(e=w[e.toLowerCase()]=w[e.toLowerCase()]||e,b[e]=t),this},overrideMimeType:function(e){return null==c&&(p.mimeType=e),this},statusCode:function(e){var t;if(e)if(c)C.always(e[C.status]);else for(t in e)_[t]=[_[t],e[t]];return this},abort:function(e){var t=e||k;return r&&r.abort(t),T(0,t),this}};if(m.promise(C),p.url=((t||p.url||At.href)+"").replace(Wt,At.protocol+"//"),p.type=n.method||n.type||p.method||p.type,p.dataTypes=(p.dataType||"*").toLowerCase().match(z)||[""],null==p.crossDomain){l=v.createElement("a");try{l.href=p.url,l.href=l.href,p.crossDomain=Vt.protocol+"//"+Vt.host!=l.protocol+"//"+l.host}catch(e){p.crossDomain=!0}}if(p.data&&p.processData&&"string"!=typeof p.data&&(p.data=x.param(p.data,p.traditional)),Xt(Bt,p,n,C),c)return C;for(f in(u=x.event&&p.global)&&0==x.active++&&x.event.trigger("ajaxStart"),p.type=p.type.toUpperCase(),p.hasContent=!Rt.test(p.type),i=p.url.replace(Mt,""),p.hasContent?p.data&&p.processData&&0===(p.contentType||"").indexOf("application/x-www-form-urlencoded")&&(p.data=p.data.replace(Ht,"+")):(d=p.url.slice(i.length),p.data&&(p.processData||"string"==typeof p.data)&&(i+=(St.test(i)?"&":"?")+p.data,delete p.data),!1===p.cache&&(i=i.replace(Ft,"$1"),d=(St.test(i)?"&":"?")+"_="+Et.guid+++d),p.url=i+d),p.ifModified&&(x.lastModified[i]&&C.setRequestHeader("If-Modified-Since",x.lastModified[i]),x.etag[i]&&C.setRequestHeader("If-None-Match",x.etag[i])),(p.data&&p.hasContent&&!1!==p.contentType||n.contentType)&&C.setRequestHeader("Content-Type",p.contentType),C.setRequestHeader("Accept",p.dataTypes[0]&&p.accepts[p.dataTypes[0]]?p.accepts[p.dataTypes[0]]+("*"!==p.dataTypes[0]?", "+zt+"; q=0.01":""):p.accepts["*"]),p.headers)C.setRequestHeader(f,p.headers[f]);if(p.beforeSend&&(!1===p.beforeSend.call(h,C,p)||c))return C.abort();if(k="abort",y.add(p.complete),C.done(p.success),C.fail(p.error),r=Xt($t,p,n,C)){if(C.readyState=1,u&&g.trigger("ajaxSend",[C,p]),c)return C;p.async&&p.timeout>0&&(s=e.setTimeout((function(){C.abort("timeout")}),p.timeout));try{c=!1,r.send(b,T)}catch(e){if(c)throw e;T(-1,e)}}else T(-1,"No Transport");function T(t,n,a,l){var f,d,v,b,w,k=n;c||(c=!0,s&&e.clearTimeout(s),r=void 0,o=l||"",C.readyState=t>0?4:0,f=t>=200&&t<300||304===t,a&&(b=function(e,t,n){for(var r,i,o,a,s=e.contents,l=e.dataTypes;"*"===l[0];)l.shift(),void 0===r&&(r=e.mimeType||t.getResponseHeader("Content-Type"));if(r)for(i in s)if(s[i]&&s[i].test(r)){l.unshift(i);break}if(l[0]in n)o=l[0];else{for(i in n){if(!l[0]||e.converters[i+" "+l[0]]){o=i;break}a||(a=i)}o=o||a}if(o)return o!==l[0]&&l.unshift(o),n[o]}(p,C,a)),!f&&x.inArray("script",p.dataTypes)>-1&&x.inArray("json",p.dataTypes)<0&&(p.converters["text script"]=function(){}),b=function(e,t,n,r){var i,o,a,s,l,c={},u=e.dataTypes.slice();if(u[1])for(a in e.converters)c[a.toLowerCase()]=e.converters[a];for(o=u.shift();o;)if(e.responseFields[o]&&(n[e.responseFields[o]]=t),!l&&r&&e.dataFilter&&(t=e.dataFilter(t,e.dataType)),l=o,o=u.shift())if("*"===o)o=l;else if("*"!==l&&l!==o){if(!(a=c[l+" "+o]||c["* "+o]))for(i in c)if((s=i.split(" "))[1]===o&&(a=c[l+" "+s[0]]||c["* "+s[0]])){!0===a?a=c[i]:!0!==c[i]&&(o=s[0],u.unshift(s[1]));break}if(!0!==a)if(a&&e.throws)t=a(t);else try{t=a(t)}catch(e){return{state:"parsererror",error:a?e:"No conversion from "+l+" to "+o}}}return{state:"success",data:t}}(p,b,C,f),f?(p.ifModified&&((w=C.getResponseHeader("Last-Modified"))&&(x.lastModified[i]=w),(w=C.getResponseHeader("etag"))&&(x.etag[i]=w)),204===t||"HEAD"===p.type?k="nocontent":304===t?k="notmodified":(k=b.state,d=b.data,f=!(v=b.error))):(v=k,!t&&k||(k="error",t<0&&(t=0))),C.status=t,C.statusText=(n||k)+"",f?m.resolveWith(h,[d,k,C]):m.rejectWith(h,[C,k,v]),C.statusCode(_),_=void 0,u&&g.trigger(f?"ajaxSuccess":"ajaxError",[C,p,f?d:v]),y.fireWith(h,[C,k]),u&&(g.trigger("ajaxComplete",[C,p]),--x.active||x.event.trigger("ajaxStop")))}return C},getJSON:function(e,t,n){return x.get(e,t,n,"json")},getScript:function(e,t){return x.get(e,void 0,t,"script")}}),x.each(["get","post"],(function(e,t){x[t]=function(e,n,r,i){return h(n)&&(i=i||r,r=n,n=void 0),x.ajax(x.extend({url:e,type:t,dataType:i,data:n,success:r},x.isPlainObject(e)&&e))}})),x.ajaxPrefilter((function(e){var t;for(t in e.headers)"content-type"===t.toLowerCase()&&(e.contentType=e.headers[t]||"")})),x._evalUrl=function(e,t,n){return x.ajax({url:e,type:"GET",dataType:"script",cache:!0,async:!1,global:!1,converters:{"text script":function(){}},dataFilter:function(e){x.globalEval(e,t,n)}})},x.fn.extend({wrapAll:function(e){var t;return this[0]&&(h(e)&&(e=e.call(this[0])),t=x(e,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&t.insertBefore(this[0]),t.map((function(){for(var e=this;e.firstElementChild;)e=e.firstElementChild;return e})).append(this)),this},wrapInner:function(e){return h(e)?this.each((function(t){x(this).wrapInner(e.call(this,t))})):this.each((function(){var t=x(this),n=t.contents();n.length?n.wrapAll(e):t.append(e)}))},wrap:function(e){var t=h(e);return this.each((function(n){x(this).wrapAll(t?e.call(this,n):e)}))},unwrap:function(e){return this.parent(e).not("body").each((function(){x(this).replaceWith(this.childNodes)})),this}}),x.expr.pseudos.hidden=function(e){return!x.expr.pseudos.visible(e)},x.expr.pseudos.visible=function(e){return!!(e.offsetWidth||e.offsetHeight||e.getClientRects().length)},x.ajaxSettings.xhr=function(){try{return new e.XMLHttpRequest}catch(e){}};var Yt={0:200,1223:204},Qt=x.ajaxSettings.xhr();p.cors=!!Qt&&"withCredentials"in Qt,p.ajax=Qt=!!Qt,x.ajaxTransport((function(t){var n,r;if(p.cors||Qt&&!t.crossDomain)return{send:function(i,o){var a,s=t.xhr();if(s.open(t.type,t.url,t.async,t.username,t.password),t.xhrFields)for(a in t.xhrFields)s[a]=t.xhrFields[a];for(a in t.mimeType&&s.overrideMimeType&&s.overrideMimeType(t.mimeType),t.crossDomain||i["X-Requested-With"]||(i["X-Requested-With"]="XMLHttpRequest"),i)s.setRequestHeader(a,i[a]);n=function(e){return function(){n&&(n=r=s.onload=s.onerror=s.onabort=s.ontimeout=s.onreadystatechange=null,"abort"===e?s.abort():"error"===e?"number"!=typeof s.status?o(0,"error"):o(s.status,s.statusText):o(Yt[s.status]||s.status,s.statusText,"text"!==(s.responseType||"text")||"string"!=typeof s.responseText?{binary:s.response}:{text:s.responseText},s.getAllResponseHeaders()))}},s.onload=n(),r=s.onerror=s.ontimeout=n("error"),void 0!==s.onabort?s.onabort=r:s.onreadystatechange=function(){4===s.readyState&&e.setTimeout((function(){n&&r()}))},n=n("abort");try{s.send(t.hasContent&&t.data||null)}catch(e){if(n)throw e}},abort:function(){n&&n()}}})),x.ajaxPrefilter((function(e){e.crossDomain&&(e.contents.script=!1)})),x.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/\b(?:java|ecma)script\b/},converters:{"text script":function(e){return x.globalEval(e),e}}}),x.ajaxPrefilter("script",(function(e){void 0===e.cache&&(e.cache=!1),e.crossDomain&&(e.type="GET")})),x.ajaxTransport("script",(function(e){var t,n;if(e.crossDomain||e.scriptAttrs)return{send:function(r,i){t=x("