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,CACtBhH,GAAI,KACJC,OAAQ,uCACRC,QAAS,2DAIX4L,EAAQ9E,UAAU,KAAM,CACtBhH,GAAI,KACJC,OAAQ,mBACRC,QAAS,kBAIX4L,EAAQ9E,UAAU,KAAM,CACtBhH,GAAI,KACJC,OAAQ,gBACRC,QAAS,WAIX4L,EAAQ9E,UAAU,KAAM,CACtBhH,GAAI,KACJC,OAAQ,QACRC,QAAS,UAIX4L,EAAQ9E,UAAU,KAAM,CACtBhH,GAAI,KACJC,OAAQ,SACRC,QAAS,OAIX4L,EAAQ9E,UAAU,KAAM,CACtBhH,GAAI,OACJC,OAAQ,SACRC,QAAS,eAIX4L,EAAQ9E,UAAU,KAAM,CACtBhH,GAAI,qBACJC,OAAQ,0DACRC,QAAS,4DAIX4L,EAAQ9E,UAAU,KAAM,CACtBhH,GAAI,2BACJC,OAAQ,uCACRC,QAAS,yCAIX4L,EAAQ9E,UAAU,KAAM,CACtBhH,GAAI,QACJC,OAAQ,aACRC,QAAS,WAIX4L,EAAQ9E,UAAU,KAAM,CACtBhH,GAAI,KACJC,OAAQ,6CACRC,QAAS,qDAIX4L,EAAQ9E,UAAU,KAAM,CACtBhH,GAAI,KACJC,OAAQ,mBACRC,QAAS,qBAIX4L,EAAQ9E,UAAU,QAAS,CACzBhH,GAAI,KACJC,OAAQ,eACRC,QAAS,iBAIX4L,EAAQ9E,UAAU,QAAS,CACzBhH,GAAI,KACJC,OAAQ,eACRC,QAAS,gBAGb,GAhT+B,8BAM/B,CATA","sources":["webpack://camp/./node_modules/bootbox/bootbox.js","webpack://camp/./node_modules/bootbox/dist/bootbox.all.js"],"sourcesContent":["/*! @preserve\r\n * bootbox.js\r\n * version: 6.0.0\r\n * author: Nick Payne \r\n * license: MIT\r\n * http://bootboxjs.com/\r\n */\r\n(function (root, factory) {\r\n 'use strict';\r\n if (typeof define === 'function' && define.amd) {\r\n // AMD\r\n define(['jquery'], factory);\r\n } else if (typeof exports === 'object') {\r\n // Node, CommonJS-like\r\n module.exports = factory(require('jquery'));\r\n } else {\r\n // Browser globals (root is window)\r\n root.bootbox = factory(root.jQuery);\r\n }\r\n}(this, function init($, undefined) {\r\n 'use strict';\r\n\r\n let exports = {};\r\n\r\n let VERSION = '6.0.0';\r\n exports.VERSION = VERSION;\r\n\r\n let locales = {\r\n 'en' : {\r\n OK : 'OK',\r\n CANCEL : 'Cancel',\r\n CONFIRM : 'OK'\r\n }\r\n };\r\n\r\n let templates = {\r\n dialog: '
',\r\n header: '
',\r\n footer: '
',\r\n closeButton: '',\r\n form: '
',\r\n button: '',\r\n option: '',\r\n promptMessage: '
',\r\n inputs: {\r\n text: '',\r\n textarea: '',\r\n email: '',\r\n select: '',\r\n checkbox: '
',\r\n radio: '
',\r\n date: '',\r\n time: '',\r\n number: '',\r\n password: '',\r\n range: ''\r\n }\r\n };\r\n\r\n\r\n let defaults = {\r\n // Default language used when generating buttons for alert, confirm, and prompt dialogs\r\n locale: 'en',\r\n // Show backdrop or not. Default to static so user has to interact with dialog\r\n backdrop: 'static',\r\n // Animate the modal in/out\r\n animate: true,\r\n // Additional class string applied to the top level dialog\r\n className: null,\r\n // Whether or not to include a close button\r\n closeButton: true,\r\n // Show the dialog immediately by default\r\n show: true,\r\n // Dialog container\r\n container: 'body',\r\n // Default value (used by the prompt helper)\r\n value: '',\r\n // Default input type (used by the prompt helper)\r\n inputType: 'text',\r\n // Custom error message to report if prompt fails validation\r\n errorMessage: null,\r\n // Switch button order from cancel/confirm (default) to confirm/cancel\r\n swapButtonOrder: false,\r\n // Center modal vertically in page\r\n centerVertical: false,\r\n // Append \"multiple\" property to the select when using the \"prompt\" helper\r\n multiple: false,\r\n // Automatically scroll modal content when height exceeds viewport height\r\n scrollable: false,\r\n // Whether or not to destroy the modal on hide\r\n reusable: false,\r\n // The element which triggered the dialog\r\n relatedTarget: null,\r\n // The size of the modal to generate\r\n size: null,\r\n // A unique indentifier for this modal\r\n id: null\r\n };\r\n\r\n\r\n // PUBLIC FUNCTIONS\r\n // *************************************************************************************************************\r\n\r\n /**\r\n * Return all currently registered locales, or a specific locale if \"name\" is defined\r\n * @param {string} [name]\r\n * @returns {(Object|Object[])} An array of the available locale objects, or a single locale object if {name} is not null\r\n */\r\n exports.locales = function (name) {\r\n return name ? locales[name] : locales;\r\n };\r\n\r\n\r\n /**\r\n * Register localized strings for the OK, CONFIRM, and CANCEL buttons\r\n * @param {string} name - The key used to identify the new locale in the locales array\r\n * @param {Object} values - An object containing the localized string for each of the OK, CANCEL, and CONFIRM properties of a locale\r\n * @returns The updated bootbox object\r\n */\r\n exports.addLocale = function (name, values) {\r\n $.each(['OK', 'CANCEL', 'CONFIRM'], function (_, v) {\r\n if (!values[v]) {\r\n throw new Error('Please supply a translation for \"' + v + '\"');\r\n }\r\n });\r\n\r\n locales[name] = {\r\n OK: values.OK,\r\n CANCEL: values.CANCEL,\r\n CONFIRM: values.CONFIRM\r\n };\r\n\r\n return exports;\r\n };\r\n\r\n \r\n /**\r\n * Remove a previously-registered locale\r\n * @param {string} name - The key identifying the locale to remove\r\n * @returns The updated bootbox object\r\n */\r\n exports.removeLocale = function (name) {\r\n if (name !== 'en') {\r\n delete locales[name];\r\n }\r\n else {\r\n throw new Error('\"en\" is used as the default and fallback locale and cannot be removed.');\r\n }\r\n\r\n return exports;\r\n };\r\n\r\n\r\n /**\r\n * Set the default locale\r\n * @param {string} name - The key identifying the locale to set as the default locale for all future bootbox calls \r\n * @returns The updated bootbox object\r\n */\r\n exports.setLocale = function (name) {\r\n return exports.setDefaults('locale', name);\r\n };\r\n\r\n\r\n /**\r\n * Override default value(s) of Bootbox.\r\n * @returns The updated bootbox object\r\n */\r\n exports.setDefaults = function () {\r\n let values = {};\r\n\r\n if (arguments.length === 2) {\r\n // Allow passing of single key/value...\r\n values[arguments[0]] = arguments[1];\r\n } else {\r\n // ... and as an object too\r\n values = arguments[0];\r\n }\r\n\r\n $.extend(defaults, values);\r\n\r\n return exports;\r\n };\r\n\r\n\r\n /**\r\n * Hides all currently active Bootbox modals\r\n * @returns The current bootbox object\r\n */\r\n exports.hideAll = function () {\r\n $('.bootbox').modal('hide');\r\n\r\n return exports;\r\n };\r\n\r\n \r\n /**\r\n * Allows the base init() function to be overridden\r\n * @param {function} _$ - A function to be called when the bootbox instance is created\r\n * @returns The current bootbox object\r\n */\r\n exports.init = function (_$) {\r\n return init(_$ || $);\r\n };\r\n\r\n\r\n // CORE HELPER FUNCTIONS\r\n // *************************************************************************************************************\r\n\r\n /**\r\n * The core dialog helper function, which can be used to create any custom Bootstrap modal. \r\n * @param {Object} options - An object used to configure the various properties which define a Bootbox dialog\r\n * @returns A jQuery object upon which Bootstrap's modal function has been called\r\n */\r\n exports.dialog = function (options) {\r\n if ($.fn.modal === undefined) {\r\n throw new Error(\r\n '\"$.fn.modal\" is not defined; please double check you have included the Bootstrap JavaScript library. See https://getbootstrap.com/docs/5.1/getting-started/introduction/ for more details.'\r\n );\r\n }\r\n\r\n options = sanitize(options);\r\n\r\n if ($.fn.modal.Constructor.VERSION) {\r\n options.fullBootstrapVersion = $.fn.modal.Constructor.VERSION;\r\n let i = options.fullBootstrapVersion.indexOf('.');\r\n options.bootstrap = options.fullBootstrapVersion.substring(0, i);\r\n }\r\n else {\r\n // Assuming version 2.3.2, as that was the last \"supported\" 2.x version\r\n options.bootstrap = '2';\r\n options.fullBootstrapVersion = '2.3.2';\r\n console.warn('Bootbox will *mostly* work with Bootstrap 2, but we do not officially support it. Please upgrade, if possible.');\r\n }\r\n\r\n let dialog = $(templates.dialog);\r\n let innerDialog = dialog.find('.modal-dialog');\r\n let body = dialog.find('.modal-body');\r\n let header = $(templates.header);\r\n let footer = $(templates.footer);\r\n let buttons = options.buttons;\r\n\r\n let callbacks = {\r\n onEscape: options.onEscape\r\n };\r\n\r\n body.find('.bootbox-body').html(options.message);\r\n\r\n // Only attempt to create buttons if at least one has been defined in the options object\r\n if (getKeyLength(options.buttons) > 0) {\r\n each(buttons, function (key, b) {\r\n let button = $(templates.button);\r\n button.data('bb-handler', key);\r\n button.addClass(b.className);\r\n\r\n switch (key) {\r\n case 'ok':\r\n case 'confirm':\r\n button.addClass('bootbox-accept');\r\n break;\r\n\r\n case 'cancel':\r\n button.addClass('bootbox-cancel');\r\n break;\r\n }\r\n\r\n button.html(b.label);\r\n\r\n if (b.id) {\r\n button.attr({ 'id': b.id });\r\n }\r\n\r\n if (b.disabled === true) {\r\n button.prop({ disabled: true });\r\n }\r\n\r\n footer.append(button);\r\n\r\n callbacks[key] = b.callback;\r\n });\r\n\r\n body.after(footer);\r\n }\r\n\r\n if (options.animate === true) {\r\n dialog.addClass('fade');\r\n }\r\n\r\n if (options.className) {\r\n dialog.addClass(options.className);\r\n }\r\n\r\n if (options.id) {\r\n dialog.attr({ 'id': options.id });\r\n }\r\n\r\n if (options.size) {\r\n // Requires Bootstrap 3.1.0 or higher\r\n if (options.fullBootstrapVersion.substring(0, 3) < '3.1') {\r\n console.warn('\"size\" requires Bootstrap 3.1.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.');\r\n }\r\n\r\n switch (options.size) {\r\n case 'small':\r\n case 'sm':\r\n innerDialog.addClass('modal-sm');\r\n break;\r\n\r\n case 'large':\r\n case 'lg':\r\n innerDialog.addClass('modal-lg');\r\n break;\r\n\r\n case 'extra-large':\r\n case 'xl':\r\n innerDialog.addClass('modal-xl');\r\n\r\n // Requires Bootstrap 4.2.0 or higher\r\n if (options.fullBootstrapVersion.substring(0, 3) < '4.2') {\r\n console.warn('Using size \"xl\"/\"extra-large\" requires Bootstrap 4.2.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.');\r\n }\r\n break;\r\n }\r\n }\r\n\r\n if (options.scrollable) {\r\n innerDialog.addClass('modal-dialog-scrollable');\r\n\r\n // Requires Bootstrap 4.3.0 or higher\r\n if (options.fullBootstrapVersion.substring(0, 3) < '4.3') {\r\n console.warn('Using \"scrollable\" requires Bootstrap 4.3.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.');\r\n }\r\n }\r\n\r\n if(options.title || options.closeButton) {\r\n if (options.title) {\r\n header.find('.modal-title').html(options.title);\r\n }\r\n else {\r\n header.addClass('border-0');\r\n }\r\n\r\n if (options.closeButton) {\r\n let closeButton = $(templates.closeButton); \r\n if (options.bootstrap < 5) {\r\n closeButton.html('×');\r\n }\r\n\r\n /* Note: the close button for Bootstrap 5+ does not contain content */\r\n if(options.bootstrap < 4) {\r\n /* Bootstrap 3 and under */\r\n header.prepend(closeButton);\r\n }\r\n else {\r\n header.append(closeButton);\r\n }\r\n }\r\n\r\n body.before(header);\r\n }\r\n\r\n if (options.centerVertical) {\r\n innerDialog.addClass('modal-dialog-centered');\r\n\r\n // Requires Bootstrap 4.0.0-beta.3 or higher\r\n if (options.fullBootstrapVersion < '4.0.0') {\r\n console.warn('\"centerVertical\" requires Bootstrap 4.0.0-beta.3 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.');\r\n }\r\n }\r\n\r\n // Bootstrap event listeners; these handle extra setup & teardown required after the underlying modal has performed certain actions.\r\n\r\n if(!options.reusable) {\r\n // make sure we unbind any listeners once the dialog has definitively been dismissed\r\n dialog.one('hide.bs.modal', { dialog: dialog }, unbindModal);\r\n dialog.one('hidden.bs.modal', { dialog: dialog }, destroyModal);\r\n }\r\n\r\n if (options.onHide) {\r\n if ($.isFunction(options.onHide)) {\r\n dialog.on('hide.bs.modal', options.onHide);\r\n }\r\n else {\r\n throw new Error('Argument supplied to \"onHide\" must be a function');\r\n }\r\n }\r\n\r\n if (options.onHidden) {\r\n if ($.isFunction(options.onHidden)) {\r\n dialog.on('hidden.bs.modal', options.onHidden);\r\n }\r\n else {\r\n throw new Error('Argument supplied to \"onHidden\" must be a function');\r\n }\r\n }\r\n\r\n if (options.onShow) {\r\n if ($.isFunction(options.onShow)) {\r\n dialog.on('show.bs.modal', options.onShow);\r\n }\r\n else {\r\n throw new Error('Argument supplied to \"onShow\" must be a function');\r\n }\r\n }\r\n\r\n dialog.one('shown.bs.modal', { dialog: dialog }, focusPrimaryButton);\r\n\r\n if (options.onShown) {\r\n if ($.isFunction(options.onShown)) {\r\n dialog.on('shown.bs.modal', options.onShown);\r\n }\r\n else {\r\n throw new Error('Argument supplied to \"onShown\" must be a function');\r\n }\r\n }\r\n\r\n // Bootbox event listeners; used to decouple some behaviours from their respective triggers\r\n\r\n if (options.backdrop === true) {\r\n let startedOnBody = false;\r\n\r\n // Prevents the event from propagating to the backdrop, when something inside the dialog is clicked\r\n dialog.on('mousedown', '.modal-content', function(e) {\r\n e.stopPropagation();\r\n\r\n startedOnBody = true;\r\n });\r\n\r\n // A boolean true/false according to the Bootstrap docs should show a dialog the user can dismiss by clicking on the background.\r\n // We always only ever pass static/false to the actual $.modal function because with \"true\" we can't trap this event (the .modal-backdrop swallows it).\r\n // However, we still want to sort-of respect true and invoke the escape mechanism instead\r\n dialog.on('click.dismiss.bs.modal', function (e) {\r\n if (startedOnBody || e.target !== e.currentTarget) {\r\n return;\r\n }\r\n\r\n dialog.trigger('escape.close.bb');\r\n });\r\n }\r\n\r\n dialog.on('escape.close.bb', function (e) {\r\n // The if() statement looks redundant but it isn't; without it, if we *didn't* have an onEscape handler then processCallback would automatically dismiss the dialog\r\n if (callbacks.onEscape) {\r\n processCallback(e, dialog, callbacks.onEscape);\r\n }\r\n });\r\n\r\n dialog.on('click', '.modal-footer button:not(.disabled)', function (e) {\r\n let callbackKey = $(this).data('bb-handler');\r\n\r\n if (callbackKey !== undefined) {\r\n // Only process callbacks for buttons we recognize:\r\n processCallback(e, dialog, callbacks[callbackKey]);\r\n }\r\n });\r\n\r\n dialog.on('click', '.bootbox-close-button', function (e) {\r\n // onEscape might be falsy, but that's fine; the fact is if the user has managed to click the close button we have to close the dialog, callback or not\r\n processCallback(e, dialog, callbacks.onEscape);\r\n });\r\n\r\n dialog.on('keyup', function (e) {\r\n if (e.which === 27) {\r\n dialog.trigger('escape.close.bb');\r\n }\r\n });\r\n\r\n /*\r\n The remainder of this method simply deals with adding our dialog element to the DOM, augmenting it with \r\n Bootstrap's modal functionality and then giving the resulting object back to our caller\r\n */\r\n\r\n $(options.container).append(dialog);\r\n\r\n dialog.modal({\r\n backdrop: options.backdrop,\r\n keyboard: false,\r\n show: false\r\n });\r\n\r\n if (options.show) {\r\n dialog.modal('show', options.relatedTarget);\r\n }\r\n\r\n return dialog;\r\n };\r\n\r\n\r\n /**\r\n * Helper function to simulate the native alert() behavior. **NOTE**: This is non-blocking, so any code that must happen after the alert is dismissed should be placed within the callback function for this alert.\r\n * @returns A jQuery object upon which Bootstrap's modal function has been called\r\n */\r\n exports.alert = function () {\r\n let options;\r\n\r\n options = mergeDialogOptions('alert', ['ok'], ['message', 'callback'], arguments);\r\n\r\n // @TODO: can this move inside exports.dialog when we're iterating over each button and checking its button.callback value instead?\r\n if (options.callback && !$.isFunction(options.callback)) {\r\n throw new Error('alert requires the \"callback\" property to be a function when provided');\r\n }\r\n\r\n // Override the ok and escape callback to make sure they just invoke the single user-supplied one (if provided)\r\n options.buttons.ok.callback = options.onEscape = function () {\r\n if ($.isFunction(options.callback)) {\r\n return options.callback.call(this);\r\n }\r\n\r\n return true;\r\n };\r\n\r\n return exports.dialog(options);\r\n };\r\n\r\n\r\n /**\r\n * Helper function to simulate the native confirm() behavior. **NOTE**: This is non-blocking, so any code that must happen after the confirm is dismissed should be placed within the callback function for this confirm.\r\n * @returns A jQuery object upon which Bootstrap's modal function has been called\r\n */\r\n exports.confirm = function () {\r\n let options;\r\n\r\n options = mergeDialogOptions('confirm', ['cancel', 'confirm'], ['message', 'callback'], arguments);\r\n\r\n // confirm specific validation; they don't make sense without a callback so make sure it's present\r\n if (!$.isFunction(options.callback)) {\r\n throw new Error('confirm requires a callback');\r\n }\r\n\r\n // Overrides; undo anything the user tried to set they shouldn't have\r\n options.buttons.cancel.callback = options.onEscape = function () {\r\n return options.callback.call(this, false);\r\n };\r\n\r\n options.buttons.confirm.callback = function () {\r\n return options.callback.call(this, true);\r\n };\r\n\r\n return exports.dialog(options);\r\n };\r\n\r\n\r\n /**\r\n * Helper function to simulate the native prompt() behavior. **NOTE**: This is non-blocking, so any code that must happen after the prompt is dismissed should be placed within the callback function for this prompt.\r\n * @returns A jQuery object upon which Bootstrap's modal function has been called\r\n */\r\n exports.prompt = function () {\r\n let options;\r\n let promptDialog;\r\n let form;\r\n let input;\r\n let shouldShow;\r\n let inputOptions;\r\n\r\n // We have to create our form first, otherwise its value is undefined when gearing up our options.\r\n // @TODO this could be solved by allowing message to be a function instead...\r\n form = $(templates.form);\r\n\r\n // prompt defaults are more complex than others in that users can override more defaults\r\n options = mergeDialogOptions('prompt', ['cancel', 'confirm'], ['title', 'callback'], arguments);\r\n\r\n if (!options.value) {\r\n options.value = defaults.value;\r\n }\r\n\r\n if (!options.inputType) {\r\n options.inputType = defaults.inputType;\r\n }\r\n\r\n // Capture the user's 'show' value; we always set this to false before spawning the dialog to give us a chance to attach some handlers to it, but we need to make sure we respect a preference not to show it\r\n shouldShow = (options.show === undefined) ? defaults.show : options.show;\r\n\r\n // This is required prior to calling the dialog builder below - we need to add an event handler just before the prompt is shown\r\n options.show = false;\r\n\r\n // Handles the 'cancel' action\r\n options.buttons.cancel.callback = options.onEscape = function () {\r\n return options.callback.call(this, null);\r\n };\r\n\r\n // Prompt submitted - extract the prompt value. This requires a bit of work, given the different input types available.\r\n options.buttons.confirm.callback = function () {\r\n let value;\r\n\r\n if (options.inputType === 'checkbox') {\r\n value = input.find('input:checked').map(function () {\r\n return $(this).val();\r\n }).get();\r\n } else if (options.inputType === 'radio') {\r\n value = input.find('input:checked').val();\r\n }\r\n else {\r\n let el = input[0];\r\n \r\n // Clear any previous custom error message\r\n if(options.errorMessage) {\r\n el.setCustomValidity('');\r\n }\r\n\r\n if (el.checkValidity && !el.checkValidity()) {\r\n // If a custom error message was provided, add it now\r\n if(options.errorMessage){\r\n el.setCustomValidity(options.errorMessage);\r\n }\r\n \r\n if(el.reportValidity) { \r\n el.reportValidity();\r\n }\r\n\r\n // prevents button callback from being called\r\n return false;\r\n } else {\r\n if (options.inputType === 'select' && options.multiple === true) {\r\n value = input.find('option:selected').map(function () {\r\n return $(this).val();\r\n }).get();\r\n }\r\n else {\r\n value = input.val();\r\n }\r\n }\r\n }\r\n\r\n return options.callback.call(this, value);\r\n };\r\n\r\n // prompt-specific validation\r\n if (!options.title) {\r\n throw new Error('prompt requires a title');\r\n }\r\n\r\n if (!$.isFunction(options.callback)) {\r\n throw new Error('prompt requires a callback');\r\n }\r\n\r\n if (!templates.inputs[options.inputType]) {\r\n throw new Error('Invalid prompt type');\r\n }\r\n\r\n // Create the input based on the supplied type\r\n input = $(templates.inputs[options.inputType]);\r\n\r\n switch (options.inputType) {\r\n case 'text':\r\n case 'textarea':\r\n case 'email':\r\n case 'password':\r\n input.val(options.value);\r\n\r\n if (options.placeholder) {\r\n input.attr('placeholder', options.placeholder);\r\n }\r\n\r\n if (options.pattern) {\r\n input.attr('pattern', options.pattern);\r\n }\r\n\r\n if (options.maxlength) {\r\n input.attr('maxlength', options.maxlength);\r\n }\r\n\r\n if (options.required) {\r\n input.prop({ 'required': true });\r\n }\r\n\r\n if (options.rows && !isNaN(parseInt(options.rows))) {\r\n if (options.inputType === 'textarea') {\r\n input.attr({ 'rows': options.rows });\r\n }\r\n }\r\n break;\r\n\r\n case 'date':\r\n case 'time':\r\n case 'number':\r\n case 'range':\r\n input.val(options.value);\r\n\r\n if (options.placeholder) {\r\n input.attr('placeholder', options.placeholder);\r\n }\r\n\r\n if (options.pattern) {\r\n input.attr('pattern', options.pattern);\r\n }\r\n else {\r\n if(options.inputType === 'date') {\r\n // Add the ISO-8601 short date format as a fallback for browsers without native type=\"date\" support\r\n input.attr('pattern', '\\d{4}-\\d{2}-\\d{2}');\r\n }\r\n else if(options.inputType === 'time') {\r\n // Add an HH:MM pattern as a fallback for browsers without native type=\"time\" support\r\n input.attr('pattern', '\\d{2}:\\d{2}');\r\n }\r\n }\r\n\r\n if (options.required) {\r\n input.prop({ 'required': true });\r\n }\r\n\r\n // These input types have extra attributes which affect their input validation.\r\n // Warning: For most browsers, date inputs are buggy in their implementation of 'step', so this attribute will have no effect. Therefore, we don't set the attribute for date inputs.\r\n // @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date#Setting_maximum_and_minimum_dates\r\n if (options.inputType !== 'date') {\r\n if (options.step) {\r\n if (options.step === 'any' || (!isNaN(options.step) && parseFloat(options.step) > 0)) {\r\n input.attr('step', options.step);\r\n }\r\n else {\r\n throw new Error('\"step\" must be a valid positive number or the value \"any\". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step for more information.');\r\n }\r\n }\r\n }\r\n\r\n if (minAndMaxAreValid(options.inputType, options.min, options.max)) {\r\n if (options.min !== undefined) {\r\n input.attr('min', options.min);\r\n }\r\n if (options.max !== undefined) {\r\n input.attr('max', options.max);\r\n }\r\n }\r\n break;\r\n\r\n case 'select':\r\n let groups = {};\r\n inputOptions = options.inputOptions || [];\r\n\r\n if (!$.isArray(inputOptions)) {\r\n throw new Error('Please pass an array of input options');\r\n }\r\n\r\n if (!inputOptions.length) {\r\n throw new Error('prompt with \"inputType\" set to \"select\" requires at least one option');\r\n }\r\n\r\n if (options.required) {\r\n input.prop({ 'required': true });\r\n }\r\n\r\n if (options.multiple) {\r\n input.prop({ 'multiple': true });\r\n }\r\n\r\n each(inputOptions, function (_, option) {\r\n // Assume the element to attach to is the input...\r\n let elem = input;\r\n\r\n if (option.value === undefined || option.text === undefined) {\r\n throw new Error('each option needs a \"value\" property and a \"text\" property');\r\n }\r\n\r\n // ... but override that element if this option sits in a group\r\n\r\n if (option.group) {\r\n // Initialise group if necessary\r\n if (!groups[option.group]) {\r\n groups[option.group] = $('').attr('label', option.group);\r\n }\r\n\r\n elem = groups[option.group];\r\n }\r\n\r\n let o = $(templates.option);\r\n o.attr('value', option.value).text(option.text);\r\n elem.append(o);\r\n });\r\n\r\n each(groups, function (_, group) {\r\n input.append(group);\r\n });\r\n\r\n // Safe to set a select's value as per a normal input\r\n input.val(options.value);\r\n if (options.bootstrap < 5) {\r\n input.removeClass('form-select').addClass('form-control');\r\n }\r\n break;\r\n\r\n case 'checkbox':\r\n let checkboxValues = $.isArray(options.value) ? options.value : [options.value];\r\n inputOptions = options.inputOptions || [];\r\n\r\n if (!inputOptions.length) {\r\n throw new Error('prompt with \"inputType\" set to \"checkbox\" requires at least one option');\r\n }\r\n\r\n // Checkboxes have to nest within a containing element, so they break the rules a bit and we end up re-assigning our 'input' element to this container instead\r\n input = $('
');\r\n\r\n each(inputOptions, function (_, option) {\r\n if (option.value === undefined || option.text === undefined) {\r\n throw new Error('each option needs a \"value\" property and a \"text\" property');\r\n }\r\n\r\n let checkbox = $(templates.inputs[options.inputType]);\r\n\r\n checkbox.find('input').attr('value', option.value);\r\n checkbox.find('label').append('\\n' + option.text);\r\n\r\n // We've ensured values is an array, so we can always iterate over it\r\n each(checkboxValues, function (_, value) {\r\n if (value === option.value) {\r\n checkbox.find('input').prop('checked', true);\r\n }\r\n });\r\n\r\n input.append(checkbox);\r\n });\r\n break;\r\n\r\n case 'radio':\r\n // Make sure that value is not an array (only a single radio can ever be checked)\r\n if (options.value !== undefined && $.isArray(options.value)) {\r\n throw new Error('prompt with \"inputType\" set to \"radio\" requires a single, non-array value for \"value\"');\r\n }\r\n\r\n inputOptions = options.inputOptions || [];\r\n\r\n if (!inputOptions.length) {\r\n throw new Error('prompt with \"inputType\" set to \"radio\" requires at least one option');\r\n }\r\n\r\n // Radiobuttons have to nest within a containing element, so they break the rules a bit and we end up re-assigning our 'input' element to this container instead\r\n input = $('
');\r\n\r\n // Radiobuttons should always have an initial checked input checked in a \"group\".\r\n // If value is undefined or doesn't match an input option, select the first radiobutton\r\n let checkFirstRadio = true;\r\n\r\n each(inputOptions, function (_, option) {\r\n if (option.value === undefined || option.text === undefined) {\r\n throw new Error('each option needs a \"value\" property and a \"text\" property');\r\n }\r\n\r\n let radio = $(templates.inputs[options.inputType]);\r\n\r\n radio.find('input').attr('value', option.value);\r\n radio.find('label').append('\\n' + option.text);\r\n\r\n if (options.value !== undefined) {\r\n if (option.value === options.value) {\r\n radio.find('input').prop('checked', true);\r\n checkFirstRadio = false;\r\n }\r\n }\r\n\r\n input.append(radio);\r\n });\r\n\r\n if (checkFirstRadio) {\r\n input.find('input[type=\"radio\"]').first().prop('checked', true);\r\n }\r\n break;\r\n }\r\n\r\n // Now place it in our form\r\n form.append(input);\r\n\r\n form.on('submit', function (e) {\r\n e.preventDefault();\r\n // Fix for SammyJS (or similar JS routing library) hijacking the form post.\r\n e.stopPropagation();\r\n\r\n // @TODO can we actually click *the* button object instead?\r\n // e.g. buttons.confirm.click() or similar\r\n promptDialog.find('.bootbox-accept').trigger('click');\r\n });\r\n\r\n if ($.trim(options.message) !== '') {\r\n // Add the form to whatever content the user may have added.\r\n let message = $(templates.promptMessage).html(options.message);\r\n form.prepend(message);\r\n options.message = form;\r\n }\r\n else {\r\n options.message = form;\r\n }\r\n\r\n // Generate the dialog\r\n promptDialog = exports.dialog(options);\r\n\r\n // Clear the existing handler focusing the submit button...\r\n promptDialog.off('shown.bs.modal', focusPrimaryButton);\r\n\r\n // ...and replace it with one focusing our input, if possible\r\n promptDialog.on('shown.bs.modal', function () {\r\n // Need the closure here since input isn'tcan object otherwise\r\n input.focus();\r\n });\r\n\r\n if (shouldShow === true) {\r\n promptDialog.modal('show');\r\n }\r\n\r\n return promptDialog;\r\n };\r\n\r\n\r\n // INTERNAL FUNCTIONS\r\n // *************************************************************************************************************\r\n\r\n // Map a flexible set of arguments into a single returned object.\r\n // If args.length is already one just return it, otherwise use the properties argument to map the unnamed args to object properties.\r\n // So in the latter case:\r\n //\r\n // mapArguments([\"foo\", $.noop], [\"message\", \"callback\"])\r\n // \r\n // results in\r\n //\r\n // { message: \"foo\", callback: $.noop }\r\n //\r\n function mapArguments(args, properties) {\r\n let argsLength = args.length;\r\n let options = {};\r\n\r\n if (argsLength < 1 || argsLength > 2) {\r\n throw new Error('Invalid argument length');\r\n }\r\n\r\n if (argsLength === 2 || typeof args[0] === 'string') {\r\n options[properties[0]] = args[0];\r\n options[properties[1]] = args[1];\r\n } else {\r\n options = args[0];\r\n }\r\n\r\n return options;\r\n }\r\n\r\n\r\n // Merge a set of default dialog options with user supplied arguments\r\n function mergeArguments(defaults, args, properties) {\r\n return $.extend(\r\n // Deep merge\r\n true,\r\n // Ensure the target is an empty, unreferenced object\r\n {},\r\n // The base options object for this type of dialog (often just buttons)\r\n defaults,\r\n // 'args' could be an object or array; if it's an array properties will map it to a proper options object\r\n mapArguments(args, properties)\r\n );\r\n }\r\n\r\n\r\n // This entry-level method makes heavy use of composition to take a simple range of inputs and return valid options suitable for passing to bootbox.dialog\r\n function mergeDialogOptions(className, labels, properties, args) {\r\n let locale;\r\n if (args && args[0]) {\r\n locale = args[0].locale || defaults.locale;\r\n let swapButtons = args[0].swapButtonOrder || defaults.swapButtonOrder;\r\n\r\n if (swapButtons) {\r\n labels = labels.reverse();\r\n }\r\n }\r\n\r\n // Build up a base set of dialog properties\r\n let baseOptions = {\r\n className: 'bootbox-' + className,\r\n buttons: createLabels(labels, locale)\r\n };\r\n\r\n // Ensure the buttons properties generated, *after* merging with user args are still valid against the supplied labels\r\n return validateButtons(\r\n // Merge the generated base properties with user supplied arguments\r\n mergeArguments(\r\n baseOptions,\r\n args,\r\n // If args.length > 1, properties specify how each arg maps to an object key\r\n properties\r\n ),\r\n labels\r\n );\r\n }\r\n\r\n\r\n // Checks each button object to see if key is valid. \r\n // This function will only be called by the alert, confirm, and prompt helpers. \r\n function validateButtons(options, buttons) {\r\n let allowedButtons = {};\r\n each(buttons, function (key, value) {\r\n allowedButtons[value] = true;\r\n });\r\n\r\n each(options.buttons, function (key) {\r\n if (allowedButtons[key] === undefined) {\r\n throw new Error('button key \"' + key + '\" is not allowed (options are ' + buttons.join(' ') + ')');\r\n }\r\n });\r\n\r\n return options;\r\n }\r\n\r\n\r\n // From a given list of arguments, return a suitable object of button labels.\r\n // All this does is normalise the given labels and translate them where possible.\r\n // e.g. \"ok\", \"confirm\" -> { ok: \"OK\", cancel: \"Annuleren\" }\r\n function createLabels(labels, locale) {\r\n let buttons = {};\r\n\r\n for (let i = 0, j = labels.length; i < j; i++) {\r\n let argument = labels[i];\r\n let key = argument.toLowerCase();\r\n let value = argument.toUpperCase();\r\n\r\n buttons[key] = {\r\n label: getText(value, locale)\r\n };\r\n }\r\n\r\n return buttons;\r\n }\r\n\r\n\r\n // Get localized text from a locale. Defaults to 'en' locale if no locale provided or a non-registered locale is requested\r\n function getText(key, locale) {\r\n let labels = locales[locale];\r\n\r\n return labels ? labels[key] : locales.en[key];\r\n }\r\n\r\n\r\n // Filter and tidy up any user supplied parameters to this dialog.\r\n // Also looks for any shorthands used and ensures that the options which are returned are all normalized properly\r\n function sanitize(options) {\r\n let buttons;\r\n let total;\r\n\r\n if (typeof options !== 'object') {\r\n throw new Error('Please supply an object of options');\r\n }\r\n\r\n if (!options.message) {\r\n throw new Error('\"message\" option must not be null or an empty string.');\r\n }\r\n\r\n // Make sure any supplied options take precedence over defaults\r\n options = $.extend({}, defaults, options);\r\n\r\n // Make sure backdrop is either true, false, or 'static'\r\n if (!options.backdrop) {\r\n options.backdrop = (options.backdrop === false || options.backdrop === 0) ? false : 'static';\r\n } else {\r\n options.backdrop = typeof options.backdrop === 'string' && options.backdrop.toLowerCase() === 'static' ? 'static' : true;\r\n } \r\n\r\n // No buttons is still a valid dialog but it's cleaner to always have a buttons object to iterate over, even if it's empty\r\n if (!options.buttons) {\r\n options.buttons = {};\r\n }\r\n \r\n buttons = options.buttons;\r\n\r\n total = getKeyLength(buttons);\r\n\r\n each(buttons, function (key, button, index) {\r\n if ($.isFunction(button)) {\r\n // Short form, assume value is our callback. Since button isn't an object it isn't a reference either so re-assign it\r\n button = buttons[key] = {\r\n callback: button\r\n };\r\n }\r\n\r\n // Before any further checks, make sure button is the correct type\r\n if ($.type(button) !== 'object') {\r\n throw new Error('button with key \"' + key + '\" must be an object');\r\n }\r\n\r\n if (!button.label) {\r\n // The lack of an explicit label means we'll assume the key is good enough\r\n button.label = key;\r\n }\r\n\r\n if (!button.className) {\r\n let isPrimary = false;\r\n if (options.swapButtonOrder) {\r\n isPrimary = index === 0;\r\n }\r\n else {\r\n isPrimary = index === total - 1;\r\n }\r\n\r\n if (total <= 2 && isPrimary) {\r\n // always add a primary to the main option in a one or two-button dialog\r\n button.className = 'btn-primary';\r\n } \r\n else {\r\n // adding both classes allows us to target both BS3 and BS4+ without needing to check the version\r\n button.className = 'btn-secondary btn-default';\r\n }\r\n }\r\n });\r\n\r\n return options;\r\n }\r\n\r\n\r\n // Returns a count of the properties defined on the object\r\n function getKeyLength(obj) {\r\n return Object.keys(obj).length;\r\n }\r\n\r\n\r\n // Tiny wrapper function around jQuery.each; just adds index as the third parameter\r\n function each(collection, iterator) {\r\n let index = 0;\r\n $.each(collection, function (key, value) {\r\n iterator(key, value, index++);\r\n });\r\n }\r\n\r\n\r\n function focusPrimaryButton(e) {\r\n e.data.dialog.find('.bootbox-accept').first().trigger('focus');\r\n }\r\n\r\n\r\n function destroyModal(e) {\r\n // Ensure we don't accidentally intercept hidden events triggered by children of the current dialog. \r\n // We shouldn't need to handle this anymore, now that Bootstrap namespaces its events, but still worth doing.\r\n if (e.target === e.data.dialog[0]) {\r\n e.data.dialog.remove();\r\n }\r\n }\r\n\r\n\r\n function unbindModal(e) {\r\n if (e.target === e.data.dialog[0]) {\r\n e.data.dialog.off('escape.close.bb');\r\n e.data.dialog.off('click');\r\n }\r\n }\r\n\r\n\r\n // Handle the invoked dialog callback\r\n function processCallback(e, dialog, callback) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n\r\n // By default we assume a callback will get rid of the dialog, although it is given the opportunity to override this\r\n\r\n // If the callback can be invoked and it *explicitly returns false*, then we'll set a flag to keep the dialog active...\r\n let preserveDialog = $.isFunction(callback) && callback.call(dialog, e) === false;\r\n\r\n // ... otherwise we'll bin it\r\n if (!preserveDialog) {\r\n dialog.modal('hide');\r\n }\r\n }\r\n\r\n // Validate `min` and `max` values based on the current `inputType` value\r\n function minAndMaxAreValid(type, min, max) {\r\n let result = false;\r\n let minValid = true;\r\n let maxValid = true;\r\n\r\n if (type === 'date') {\r\n if (min !== undefined && !(minValid = dateIsValid(min))) {\r\n console.warn('Browsers which natively support the \"date\" input type expect date values to be of the form \"YYYY-MM-DD\" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your min value may not be enforced by this browser.');\r\n }\r\n else if (max !== undefined && !(maxValid = dateIsValid(max))) {\r\n console.warn('Browsers which natively support the \"date\" input type expect date values to be of the form \"YYYY-MM-DD\" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your max value may not be enforced by this browser.');\r\n }\r\n }\r\n else if (type === 'time') {\r\n if (min !== undefined && !(minValid = timeIsValid(min))) {\r\n throw new Error('\"min\" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.');\r\n }\r\n else if (max !== undefined && !(maxValid = timeIsValid(max))) {\r\n throw new Error('\"max\" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.');\r\n }\r\n }\r\n else {\r\n if (min !== undefined && isNaN(min)) {\r\n minValid = false;\r\n throw new Error('\"min\" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min for more information.');\r\n }\r\n\r\n if (max !== undefined && isNaN(max)) {\r\n maxValid = false;\r\n throw new Error('\"max\" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.');\r\n }\r\n }\r\n\r\n if (minValid && maxValid) {\r\n if (max <= min) {\r\n throw new Error('\"max\" must be greater than \"min\". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.');\r\n }\r\n else {\r\n result = true;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n function timeIsValid(value) {\r\n return /([01][0-9]|2[0-3]):[0-5][0-9]?:[0-5][0-9]/.test(value);\r\n }\r\n\r\n function dateIsValid(value) {\r\n return /(\\d{4})-(\\d{2})-(\\d{2})/.test(value);\r\n }\r\n\r\n // The Bootbox object\r\n return exports;\r\n}));\r\n","/*! @preserve\r\n * bootbox.js\r\n * version: 6.0.0\r\n * author: Nick Payne \r\n * license: MIT\r\n * http://bootboxjs.com/\r\n */\r\n(function(root, factory) {\r\n 'use strict';\r\n if (typeof define === 'function' && define.amd) {\r\n // AMD\r\n define(['jquery'], factory);\r\n } else if (typeof exports === 'object') {\r\n // Node, CommonJS-like\r\n module.exports = factory(require('jquery'));\r\n } else {\r\n // Browser globals (root is window)\r\n root.bootbox = factory(root.jQuery);\r\n }\r\n}(this, function init($, undefined) {\r\n 'use strict';\r\n\r\n let exports = {};\r\n\r\n let VERSION = '6.0.0';\r\n exports.VERSION = VERSION;\r\n\r\n let locales = {\r\n 'en': {\r\n OK: 'OK',\r\n CANCEL: 'Cancel',\r\n CONFIRM: 'OK'\r\n }\r\n };\r\n\r\n let templates = {\r\n dialog: '
',\r\n header: '
',\r\n footer: '
',\r\n closeButton: '',\r\n form: '
',\r\n button: '',\r\n option: '',\r\n promptMessage: '
',\r\n inputs: {\r\n text: '',\r\n textarea: '',\r\n email: '',\r\n select: '',\r\n checkbox: '
',\r\n radio: '
',\r\n date: '',\r\n time: '',\r\n number: '',\r\n password: '',\r\n range: ''\r\n }\r\n };\r\n\r\n\r\n let defaults = {\r\n // Default language used when generating buttons for alert, confirm, and prompt dialogs\r\n locale: 'en',\r\n // Show backdrop or not. Default to static so user has to interact with dialog\r\n backdrop: 'static',\r\n // Animate the modal in/out\r\n animate: true,\r\n // Additional class string applied to the top level dialog\r\n className: null,\r\n // Whether or not to include a close button\r\n closeButton: true,\r\n // Show the dialog immediately by default\r\n show: true,\r\n // Dialog container\r\n container: 'body',\r\n // Default value (used by the prompt helper)\r\n value: '',\r\n // Default input type (used by the prompt helper)\r\n inputType: 'text',\r\n // Custom error message to report if prompt fails validation\r\n errorMessage: null,\r\n // Switch button order from cancel/confirm (default) to confirm/cancel\r\n swapButtonOrder: false,\r\n // Center modal vertically in page\r\n centerVertical: false,\r\n // Append \"multiple\" property to the select when using the \"prompt\" helper\r\n multiple: false,\r\n // Automatically scroll modal content when height exceeds viewport height\r\n scrollable: false,\r\n // Whether or not to destroy the modal on hide\r\n reusable: false,\r\n // The element which triggered the dialog\r\n relatedTarget: null,\r\n // The size of the modal to generate\r\n size: null,\r\n // A unique indentifier for this modal\r\n id: null\r\n };\r\n\r\n\r\n // PUBLIC FUNCTIONS\r\n // *************************************************************************************************************\r\n\r\n /**\r\n * Return all currently registered locales, or a specific locale if \"name\" is defined\r\n * @param {string} [name]\r\n * @returns {(Object|Object[])} An array of the available locale objects, or a single locale object if {name} is not null\r\n */\r\n exports.locales = function(name) {\r\n return name ? locales[name] : locales;\r\n };\r\n\r\n\r\n /**\r\n * Register localized strings for the OK, CONFIRM, and CANCEL buttons\r\n * @param {string} name - The key used to identify the new locale in the locales array\r\n * @param {Object} values - An object containing the localized string for each of the OK, CANCEL, and CONFIRM properties of a locale\r\n * @returns The updated bootbox object\r\n */\r\n exports.addLocale = function(name, values) {\r\n $.each(['OK', 'CANCEL', 'CONFIRM'], function(_, v) {\r\n if (!values[v]) {\r\n throw new Error('Please supply a translation for \"' + v + '\"');\r\n }\r\n });\r\n\r\n locales[name] = {\r\n OK: values.OK,\r\n CANCEL: values.CANCEL,\r\n CONFIRM: values.CONFIRM\r\n };\r\n\r\n return exports;\r\n };\r\n\r\n\r\n /**\r\n * Remove a previously-registered locale\r\n * @param {string} name - The key identifying the locale to remove\r\n * @returns The updated bootbox object\r\n */\r\n exports.removeLocale = function(name) {\r\n if (name !== 'en') {\r\n delete locales[name];\r\n } else {\r\n throw new Error('\"en\" is used as the default and fallback locale and cannot be removed.');\r\n }\r\n\r\n return exports;\r\n };\r\n\r\n\r\n /**\r\n * Set the default locale\r\n * @param {string} name - The key identifying the locale to set as the default locale for all future bootbox calls \r\n * @returns The updated bootbox object\r\n */\r\n exports.setLocale = function(name) {\r\n return exports.setDefaults('locale', name);\r\n };\r\n\r\n\r\n /**\r\n * Override default value(s) of Bootbox.\r\n * @returns The updated bootbox object\r\n */\r\n exports.setDefaults = function() {\r\n let values = {};\r\n\r\n if (arguments.length === 2) {\r\n // Allow passing of single key/value...\r\n values[arguments[0]] = arguments[1];\r\n } else {\r\n // ... and as an object too\r\n values = arguments[0];\r\n }\r\n\r\n $.extend(defaults, values);\r\n\r\n return exports;\r\n };\r\n\r\n\r\n /**\r\n * Hides all currently active Bootbox modals\r\n * @returns The current bootbox object\r\n */\r\n exports.hideAll = function() {\r\n $('.bootbox').modal('hide');\r\n\r\n return exports;\r\n };\r\n\r\n\r\n /**\r\n * Allows the base init() function to be overridden\r\n * @param {function} _$ - A function to be called when the bootbox instance is created\r\n * @returns The current bootbox object\r\n */\r\n exports.init = function(_$) {\r\n return init(_$ || $);\r\n };\r\n\r\n\r\n // CORE HELPER FUNCTIONS\r\n // *************************************************************************************************************\r\n\r\n /**\r\n * The core dialog helper function, which can be used to create any custom Bootstrap modal. \r\n * @param {Object} options - An object used to configure the various properties which define a Bootbox dialog\r\n * @returns A jQuery object upon which Bootstrap's modal function has been called\r\n */\r\n exports.dialog = function(options) {\r\n if ($.fn.modal === undefined) {\r\n throw new Error(\r\n '\"$.fn.modal\" is not defined; please double check you have included the Bootstrap JavaScript library. See https://getbootstrap.com/docs/5.1/getting-started/introduction/ for more details.'\r\n );\r\n }\r\n\r\n options = sanitize(options);\r\n\r\n if ($.fn.modal.Constructor.VERSION) {\r\n options.fullBootstrapVersion = $.fn.modal.Constructor.VERSION;\r\n let i = options.fullBootstrapVersion.indexOf('.');\r\n options.bootstrap = options.fullBootstrapVersion.substring(0, i);\r\n } else {\r\n // Assuming version 2.3.2, as that was the last \"supported\" 2.x version\r\n options.bootstrap = '2';\r\n options.fullBootstrapVersion = '2.3.2';\r\n console.warn('Bootbox will *mostly* work with Bootstrap 2, but we do not officially support it. Please upgrade, if possible.');\r\n }\r\n\r\n let dialog = $(templates.dialog);\r\n let innerDialog = dialog.find('.modal-dialog');\r\n let body = dialog.find('.modal-body');\r\n let header = $(templates.header);\r\n let footer = $(templates.footer);\r\n let buttons = options.buttons;\r\n\r\n let callbacks = {\r\n onEscape: options.onEscape\r\n };\r\n\r\n body.find('.bootbox-body').html(options.message);\r\n\r\n // Only attempt to create buttons if at least one has been defined in the options object\r\n if (getKeyLength(options.buttons) > 0) {\r\n each(buttons, function(key, b) {\r\n let button = $(templates.button);\r\n button.data('bb-handler', key);\r\n button.addClass(b.className);\r\n\r\n switch (key) {\r\n case 'ok':\r\n case 'confirm':\r\n button.addClass('bootbox-accept');\r\n break;\r\n\r\n case 'cancel':\r\n button.addClass('bootbox-cancel');\r\n break;\r\n }\r\n\r\n button.html(b.label);\r\n\r\n if (b.id) {\r\n button.attr({\r\n 'id': b.id\r\n });\r\n }\r\n\r\n if (b.disabled === true) {\r\n button.prop({\r\n disabled: true\r\n });\r\n }\r\n\r\n footer.append(button);\r\n\r\n callbacks[key] = b.callback;\r\n });\r\n\r\n body.after(footer);\r\n }\r\n\r\n if (options.animate === true) {\r\n dialog.addClass('fade');\r\n }\r\n\r\n if (options.className) {\r\n dialog.addClass(options.className);\r\n }\r\n\r\n if (options.id) {\r\n dialog.attr({\r\n 'id': options.id\r\n });\r\n }\r\n\r\n if (options.size) {\r\n // Requires Bootstrap 3.1.0 or higher\r\n if (options.fullBootstrapVersion.substring(0, 3) < '3.1') {\r\n console.warn('\"size\" requires Bootstrap 3.1.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.');\r\n }\r\n\r\n switch (options.size) {\r\n case 'small':\r\n case 'sm':\r\n innerDialog.addClass('modal-sm');\r\n break;\r\n\r\n case 'large':\r\n case 'lg':\r\n innerDialog.addClass('modal-lg');\r\n break;\r\n\r\n case 'extra-large':\r\n case 'xl':\r\n innerDialog.addClass('modal-xl');\r\n\r\n // Requires Bootstrap 4.2.0 or higher\r\n if (options.fullBootstrapVersion.substring(0, 3) < '4.2') {\r\n console.warn('Using size \"xl\"/\"extra-large\" requires Bootstrap 4.2.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.');\r\n }\r\n break;\r\n }\r\n }\r\n\r\n if (options.scrollable) {\r\n innerDialog.addClass('modal-dialog-scrollable');\r\n\r\n // Requires Bootstrap 4.3.0 or higher\r\n if (options.fullBootstrapVersion.substring(0, 3) < '4.3') {\r\n console.warn('Using \"scrollable\" requires Bootstrap 4.3.0 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.');\r\n }\r\n }\r\n\r\n if (options.title || options.closeButton) {\r\n if (options.title) {\r\n header.find('.modal-title').html(options.title);\r\n } else {\r\n header.addClass('border-0');\r\n }\r\n\r\n if (options.closeButton) {\r\n let closeButton = $(templates.closeButton);\r\n if (options.bootstrap < 5) {\r\n closeButton.html('×');\r\n }\r\n\r\n /* Note: the close button for Bootstrap 5+ does not contain content */\r\n if (options.bootstrap < 4) {\r\n /* Bootstrap 3 and under */\r\n header.prepend(closeButton);\r\n } else {\r\n header.append(closeButton);\r\n }\r\n }\r\n\r\n body.before(header);\r\n }\r\n\r\n if (options.centerVertical) {\r\n innerDialog.addClass('modal-dialog-centered');\r\n\r\n // Requires Bootstrap 4.0.0-beta.3 or higher\r\n if (options.fullBootstrapVersion < '4.0.0') {\r\n console.warn('\"centerVertical\" requires Bootstrap 4.0.0-beta.3 or higher. You appear to be using ' + options.fullBootstrapVersion + '. Please upgrade to use this option.');\r\n }\r\n }\r\n\r\n // Bootstrap event listeners; these handle extra setup & teardown required after the underlying modal has performed certain actions.\r\n\r\n if (!options.reusable) {\r\n // make sure we unbind any listeners once the dialog has definitively been dismissed\r\n dialog.one('hide.bs.modal', {\r\n dialog: dialog\r\n }, unbindModal);\r\n dialog.one('hidden.bs.modal', {\r\n dialog: dialog\r\n }, destroyModal);\r\n }\r\n\r\n if (options.onHide) {\r\n if ($.isFunction(options.onHide)) {\r\n dialog.on('hide.bs.modal', options.onHide);\r\n } else {\r\n throw new Error('Argument supplied to \"onHide\" must be a function');\r\n }\r\n }\r\n\r\n if (options.onHidden) {\r\n if ($.isFunction(options.onHidden)) {\r\n dialog.on('hidden.bs.modal', options.onHidden);\r\n } else {\r\n throw new Error('Argument supplied to \"onHidden\" must be a function');\r\n }\r\n }\r\n\r\n if (options.onShow) {\r\n if ($.isFunction(options.onShow)) {\r\n dialog.on('show.bs.modal', options.onShow);\r\n } else {\r\n throw new Error('Argument supplied to \"onShow\" must be a function');\r\n }\r\n }\r\n\r\n dialog.one('shown.bs.modal', {\r\n dialog: dialog\r\n }, focusPrimaryButton);\r\n\r\n if (options.onShown) {\r\n if ($.isFunction(options.onShown)) {\r\n dialog.on('shown.bs.modal', options.onShown);\r\n } else {\r\n throw new Error('Argument supplied to \"onShown\" must be a function');\r\n }\r\n }\r\n\r\n // Bootbox event listeners; used to decouple some behaviours from their respective triggers\r\n\r\n if (options.backdrop === true) {\r\n let startedOnBody = false;\r\n\r\n // Prevents the event from propagating to the backdrop, when something inside the dialog is clicked\r\n dialog.on('mousedown', '.modal-content', function(e) {\r\n e.stopPropagation();\r\n\r\n startedOnBody = true;\r\n });\r\n\r\n // A boolean true/false according to the Bootstrap docs should show a dialog the user can dismiss by clicking on the background.\r\n // We always only ever pass static/false to the actual $.modal function because with \"true\" we can't trap this event (the .modal-backdrop swallows it).\r\n // However, we still want to sort-of respect true and invoke the escape mechanism instead\r\n dialog.on('click.dismiss.bs.modal', function(e) {\r\n if (startedOnBody || e.target !== e.currentTarget) {\r\n return;\r\n }\r\n\r\n dialog.trigger('escape.close.bb');\r\n });\r\n }\r\n\r\n dialog.on('escape.close.bb', function(e) {\r\n // The if() statement looks redundant but it isn't; without it, if we *didn't* have an onEscape handler then processCallback would automatically dismiss the dialog\r\n if (callbacks.onEscape) {\r\n processCallback(e, dialog, callbacks.onEscape);\r\n }\r\n });\r\n\r\n dialog.on('click', '.modal-footer button:not(.disabled)', function(e) {\r\n let callbackKey = $(this).data('bb-handler');\r\n\r\n if (callbackKey !== undefined) {\r\n // Only process callbacks for buttons we recognize:\r\n processCallback(e, dialog, callbacks[callbackKey]);\r\n }\r\n });\r\n\r\n dialog.on('click', '.bootbox-close-button', function(e) {\r\n // onEscape might be falsy, but that's fine; the fact is if the user has managed to click the close button we have to close the dialog, callback or not\r\n processCallback(e, dialog, callbacks.onEscape);\r\n });\r\n\r\n dialog.on('keyup', function(e) {\r\n if (e.which === 27) {\r\n dialog.trigger('escape.close.bb');\r\n }\r\n });\r\n\r\n /*\r\n The remainder of this method simply deals with adding our dialog element to the DOM, augmenting it with \r\n Bootstrap's modal functionality and then giving the resulting object back to our caller\r\n */\r\n\r\n $(options.container).append(dialog);\r\n\r\n dialog.modal({\r\n backdrop: options.backdrop,\r\n keyboard: false,\r\n show: false\r\n });\r\n\r\n if (options.show) {\r\n dialog.modal('show', options.relatedTarget);\r\n }\r\n\r\n return dialog;\r\n };\r\n\r\n\r\n /**\r\n * Helper function to simulate the native alert() behavior. **NOTE**: This is non-blocking, so any code that must happen after the alert is dismissed should be placed within the callback function for this alert.\r\n * @returns A jQuery object upon which Bootstrap's modal function has been called\r\n */\r\n exports.alert = function() {\r\n let options;\r\n\r\n options = mergeDialogOptions('alert', ['ok'], ['message', 'callback'], arguments);\r\n\r\n // @TODO: can this move inside exports.dialog when we're iterating over each button and checking its button.callback value instead?\r\n if (options.callback && !$.isFunction(options.callback)) {\r\n throw new Error('alert requires the \"callback\" property to be a function when provided');\r\n }\r\n\r\n // Override the ok and escape callback to make sure they just invoke the single user-supplied one (if provided)\r\n options.buttons.ok.callback = options.onEscape = function() {\r\n if ($.isFunction(options.callback)) {\r\n return options.callback.call(this);\r\n }\r\n\r\n return true;\r\n };\r\n\r\n return exports.dialog(options);\r\n };\r\n\r\n\r\n /**\r\n * Helper function to simulate the native confirm() behavior. **NOTE**: This is non-blocking, so any code that must happen after the confirm is dismissed should be placed within the callback function for this confirm.\r\n * @returns A jQuery object upon which Bootstrap's modal function has been called\r\n */\r\n exports.confirm = function() {\r\n let options;\r\n\r\n options = mergeDialogOptions('confirm', ['cancel', 'confirm'], ['message', 'callback'], arguments);\r\n\r\n // confirm specific validation; they don't make sense without a callback so make sure it's present\r\n if (!$.isFunction(options.callback)) {\r\n throw new Error('confirm requires a callback');\r\n }\r\n\r\n // Overrides; undo anything the user tried to set they shouldn't have\r\n options.buttons.cancel.callback = options.onEscape = function() {\r\n return options.callback.call(this, false);\r\n };\r\n\r\n options.buttons.confirm.callback = function() {\r\n return options.callback.call(this, true);\r\n };\r\n\r\n return exports.dialog(options);\r\n };\r\n\r\n\r\n /**\r\n * Helper function to simulate the native prompt() behavior. **NOTE**: This is non-blocking, so any code that must happen after the prompt is dismissed should be placed within the callback function for this prompt.\r\n * @returns A jQuery object upon which Bootstrap's modal function has been called\r\n */\r\n exports.prompt = function() {\r\n let options;\r\n let promptDialog;\r\n let form;\r\n let input;\r\n let shouldShow;\r\n let inputOptions;\r\n\r\n // We have to create our form first, otherwise its value is undefined when gearing up our options.\r\n // @TODO this could be solved by allowing message to be a function instead...\r\n form = $(templates.form);\r\n\r\n // prompt defaults are more complex than others in that users can override more defaults\r\n options = mergeDialogOptions('prompt', ['cancel', 'confirm'], ['title', 'callback'], arguments);\r\n\r\n if (!options.value) {\r\n options.value = defaults.value;\r\n }\r\n\r\n if (!options.inputType) {\r\n options.inputType = defaults.inputType;\r\n }\r\n\r\n // Capture the user's 'show' value; we always set this to false before spawning the dialog to give us a chance to attach some handlers to it, but we need to make sure we respect a preference not to show it\r\n shouldShow = (options.show === undefined) ? defaults.show : options.show;\r\n\r\n // This is required prior to calling the dialog builder below - we need to add an event handler just before the prompt is shown\r\n options.show = false;\r\n\r\n // Handles the 'cancel' action\r\n options.buttons.cancel.callback = options.onEscape = function() {\r\n return options.callback.call(this, null);\r\n };\r\n\r\n // Prompt submitted - extract the prompt value. This requires a bit of work, given the different input types available.\r\n options.buttons.confirm.callback = function() {\r\n let value;\r\n\r\n if (options.inputType === 'checkbox') {\r\n value = input.find('input:checked').map(function() {\r\n return $(this).val();\r\n }).get();\r\n } else if (options.inputType === 'radio') {\r\n value = input.find('input:checked').val();\r\n } else {\r\n let el = input[0];\r\n\r\n // Clear any previous custom error message\r\n if (options.errorMessage) {\r\n el.setCustomValidity('');\r\n }\r\n\r\n if (el.checkValidity && !el.checkValidity()) {\r\n // If a custom error message was provided, add it now\r\n if (options.errorMessage) {\r\n el.setCustomValidity(options.errorMessage);\r\n }\r\n\r\n if (el.reportValidity) {\r\n el.reportValidity();\r\n }\r\n\r\n // prevents button callback from being called\r\n return false;\r\n } else {\r\n if (options.inputType === 'select' && options.multiple === true) {\r\n value = input.find('option:selected').map(function() {\r\n return $(this).val();\r\n }).get();\r\n } else {\r\n value = input.val();\r\n }\r\n }\r\n }\r\n\r\n return options.callback.call(this, value);\r\n };\r\n\r\n // prompt-specific validation\r\n if (!options.title) {\r\n throw new Error('prompt requires a title');\r\n }\r\n\r\n if (!$.isFunction(options.callback)) {\r\n throw new Error('prompt requires a callback');\r\n }\r\n\r\n if (!templates.inputs[options.inputType]) {\r\n throw new Error('Invalid prompt type');\r\n }\r\n\r\n // Create the input based on the supplied type\r\n input = $(templates.inputs[options.inputType]);\r\n\r\n switch (options.inputType) {\r\n case 'text':\r\n case 'textarea':\r\n case 'email':\r\n case 'password':\r\n input.val(options.value);\r\n\r\n if (options.placeholder) {\r\n input.attr('placeholder', options.placeholder);\r\n }\r\n\r\n if (options.pattern) {\r\n input.attr('pattern', options.pattern);\r\n }\r\n\r\n if (options.maxlength) {\r\n input.attr('maxlength', options.maxlength);\r\n }\r\n\r\n if (options.required) {\r\n input.prop({\r\n 'required': true\r\n });\r\n }\r\n\r\n if (options.rows && !isNaN(parseInt(options.rows))) {\r\n if (options.inputType === 'textarea') {\r\n input.attr({\r\n 'rows': options.rows\r\n });\r\n }\r\n }\r\n break;\r\n\r\n case 'date':\r\n case 'time':\r\n case 'number':\r\n case 'range':\r\n input.val(options.value);\r\n\r\n if (options.placeholder) {\r\n input.attr('placeholder', options.placeholder);\r\n }\r\n\r\n if (options.pattern) {\r\n input.attr('pattern', options.pattern);\r\n } else {\r\n if (options.inputType === 'date') {\r\n // Add the ISO-8601 short date format as a fallback for browsers without native type=\"date\" support\r\n input.attr('pattern', '\\d{4}-\\d{2}-\\d{2}');\r\n } else if (options.inputType === 'time') {\r\n // Add an HH:MM pattern as a fallback for browsers without native type=\"time\" support\r\n input.attr('pattern', '\\d{2}:\\d{2}');\r\n }\r\n }\r\n\r\n if (options.required) {\r\n input.prop({\r\n 'required': true\r\n });\r\n }\r\n\r\n // These input types have extra attributes which affect their input validation.\r\n // Warning: For most browsers, date inputs are buggy in their implementation of 'step', so this attribute will have no effect. Therefore, we don't set the attribute for date inputs.\r\n // @see https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/date#Setting_maximum_and_minimum_dates\r\n if (options.inputType !== 'date') {\r\n if (options.step) {\r\n if (options.step === 'any' || (!isNaN(options.step) && parseFloat(options.step) > 0)) {\r\n input.attr('step', options.step);\r\n } else {\r\n throw new Error('\"step\" must be a valid positive number or the value \"any\". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-step for more information.');\r\n }\r\n }\r\n }\r\n\r\n if (minAndMaxAreValid(options.inputType, options.min, options.max)) {\r\n if (options.min !== undefined) {\r\n input.attr('min', options.min);\r\n }\r\n if (options.max !== undefined) {\r\n input.attr('max', options.max);\r\n }\r\n }\r\n break;\r\n\r\n case 'select':\r\n let groups = {};\r\n inputOptions = options.inputOptions || [];\r\n\r\n if (!$.isArray(inputOptions)) {\r\n throw new Error('Please pass an array of input options');\r\n }\r\n\r\n if (!inputOptions.length) {\r\n throw new Error('prompt with \"inputType\" set to \"select\" requires at least one option');\r\n }\r\n\r\n if (options.required) {\r\n input.prop({\r\n 'required': true\r\n });\r\n }\r\n\r\n if (options.multiple) {\r\n input.prop({\r\n 'multiple': true\r\n });\r\n }\r\n\r\n each(inputOptions, function(_, option) {\r\n // Assume the element to attach to is the input...\r\n let elem = input;\r\n\r\n if (option.value === undefined || option.text === undefined) {\r\n throw new Error('each option needs a \"value\" property and a \"text\" property');\r\n }\r\n\r\n // ... but override that element if this option sits in a group\r\n\r\n if (option.group) {\r\n // Initialise group if necessary\r\n if (!groups[option.group]) {\r\n groups[option.group] = $('').attr('label', option.group);\r\n }\r\n\r\n elem = groups[option.group];\r\n }\r\n\r\n let o = $(templates.option);\r\n o.attr('value', option.value).text(option.text);\r\n elem.append(o);\r\n });\r\n\r\n each(groups, function(_, group) {\r\n input.append(group);\r\n });\r\n\r\n // Safe to set a select's value as per a normal input\r\n input.val(options.value);\r\n if (options.bootstrap < 5) {\r\n input.removeClass('form-select').addClass('form-control');\r\n }\r\n break;\r\n\r\n case 'checkbox':\r\n let checkboxValues = $.isArray(options.value) ? options.value : [options.value];\r\n inputOptions = options.inputOptions || [];\r\n\r\n if (!inputOptions.length) {\r\n throw new Error('prompt with \"inputType\" set to \"checkbox\" requires at least one option');\r\n }\r\n\r\n // Checkboxes have to nest within a containing element, so they break the rules a bit and we end up re-assigning our 'input' element to this container instead\r\n input = $('
');\r\n\r\n each(inputOptions, function(_, option) {\r\n if (option.value === undefined || option.text === undefined) {\r\n throw new Error('each option needs a \"value\" property and a \"text\" property');\r\n }\r\n\r\n let checkbox = $(templates.inputs[options.inputType]);\r\n\r\n checkbox.find('input').attr('value', option.value);\r\n checkbox.find('label').append('\\n' + option.text);\r\n\r\n // We've ensured values is an array, so we can always iterate over it\r\n each(checkboxValues, function(_, value) {\r\n if (value === option.value) {\r\n checkbox.find('input').prop('checked', true);\r\n }\r\n });\r\n\r\n input.append(checkbox);\r\n });\r\n break;\r\n\r\n case 'radio':\r\n // Make sure that value is not an array (only a single radio can ever be checked)\r\n if (options.value !== undefined && $.isArray(options.value)) {\r\n throw new Error('prompt with \"inputType\" set to \"radio\" requires a single, non-array value for \"value\"');\r\n }\r\n\r\n inputOptions = options.inputOptions || [];\r\n\r\n if (!inputOptions.length) {\r\n throw new Error('prompt with \"inputType\" set to \"radio\" requires at least one option');\r\n }\r\n\r\n // Radiobuttons have to nest within a containing element, so they break the rules a bit and we end up re-assigning our 'input' element to this container instead\r\n input = $('
');\r\n\r\n // Radiobuttons should always have an initial checked input checked in a \"group\".\r\n // If value is undefined or doesn't match an input option, select the first radiobutton\r\n let checkFirstRadio = true;\r\n\r\n each(inputOptions, function(_, option) {\r\n if (option.value === undefined || option.text === undefined) {\r\n throw new Error('each option needs a \"value\" property and a \"text\" property');\r\n }\r\n\r\n let radio = $(templates.inputs[options.inputType]);\r\n\r\n radio.find('input').attr('value', option.value);\r\n radio.find('label').append('\\n' + option.text);\r\n\r\n if (options.value !== undefined) {\r\n if (option.value === options.value) {\r\n radio.find('input').prop('checked', true);\r\n checkFirstRadio = false;\r\n }\r\n }\r\n\r\n input.append(radio);\r\n });\r\n\r\n if (checkFirstRadio) {\r\n input.find('input[type=\"radio\"]').first().prop('checked', true);\r\n }\r\n break;\r\n }\r\n\r\n // Now place it in our form\r\n form.append(input);\r\n\r\n form.on('submit', function(e) {\r\n e.preventDefault();\r\n // Fix for SammyJS (or similar JS routing library) hijacking the form post.\r\n e.stopPropagation();\r\n\r\n // @TODO can we actually click *the* button object instead?\r\n // e.g. buttons.confirm.click() or similar\r\n promptDialog.find('.bootbox-accept').trigger('click');\r\n });\r\n\r\n if ($.trim(options.message) !== '') {\r\n // Add the form to whatever content the user may have added.\r\n let message = $(templates.promptMessage).html(options.message);\r\n form.prepend(message);\r\n options.message = form;\r\n } else {\r\n options.message = form;\r\n }\r\n\r\n // Generate the dialog\r\n promptDialog = exports.dialog(options);\r\n\r\n // Clear the existing handler focusing the submit button...\r\n promptDialog.off('shown.bs.modal', focusPrimaryButton);\r\n\r\n // ...and replace it with one focusing our input, if possible\r\n promptDialog.on('shown.bs.modal', function() {\r\n // Need the closure here since input isn'tcan object otherwise\r\n input.focus();\r\n });\r\n\r\n if (shouldShow === true) {\r\n promptDialog.modal('show');\r\n }\r\n\r\n return promptDialog;\r\n };\r\n\r\n\r\n // INTERNAL FUNCTIONS\r\n // *************************************************************************************************************\r\n\r\n // Map a flexible set of arguments into a single returned object.\r\n // If args.length is already one just return it, otherwise use the properties argument to map the unnamed args to object properties.\r\n // So in the latter case:\r\n //\r\n // mapArguments([\"foo\", $.noop], [\"message\", \"callback\"])\r\n // \r\n // results in\r\n //\r\n // { message: \"foo\", callback: $.noop }\r\n //\r\n function mapArguments(args, properties) {\r\n let argsLength = args.length;\r\n let options = {};\r\n\r\n if (argsLength < 1 || argsLength > 2) {\r\n throw new Error('Invalid argument length');\r\n }\r\n\r\n if (argsLength === 2 || typeof args[0] === 'string') {\r\n options[properties[0]] = args[0];\r\n options[properties[1]] = args[1];\r\n } else {\r\n options = args[0];\r\n }\r\n\r\n return options;\r\n }\r\n\r\n\r\n // Merge a set of default dialog options with user supplied arguments\r\n function mergeArguments(defaults, args, properties) {\r\n return $.extend(\r\n // Deep merge\r\n true,\r\n // Ensure the target is an empty, unreferenced object\r\n {},\r\n // The base options object for this type of dialog (often just buttons)\r\n defaults,\r\n // 'args' could be an object or array; if it's an array properties will map it to a proper options object\r\n mapArguments(args, properties)\r\n );\r\n }\r\n\r\n\r\n // This entry-level method makes heavy use of composition to take a simple range of inputs and return valid options suitable for passing to bootbox.dialog\r\n function mergeDialogOptions(className, labels, properties, args) {\r\n let locale;\r\n if (args && args[0]) {\r\n locale = args[0].locale || defaults.locale;\r\n let swapButtons = args[0].swapButtonOrder || defaults.swapButtonOrder;\r\n\r\n if (swapButtons) {\r\n labels = labels.reverse();\r\n }\r\n }\r\n\r\n // Build up a base set of dialog properties\r\n let baseOptions = {\r\n className: 'bootbox-' + className,\r\n buttons: createLabels(labels, locale)\r\n };\r\n\r\n // Ensure the buttons properties generated, *after* merging with user args are still valid against the supplied labels\r\n return validateButtons(\r\n // Merge the generated base properties with user supplied arguments\r\n mergeArguments(\r\n baseOptions,\r\n args,\r\n // If args.length > 1, properties specify how each arg maps to an object key\r\n properties\r\n ),\r\n labels\r\n );\r\n }\r\n\r\n\r\n // Checks each button object to see if key is valid. \r\n // This function will only be called by the alert, confirm, and prompt helpers. \r\n function validateButtons(options, buttons) {\r\n let allowedButtons = {};\r\n each(buttons, function(key, value) {\r\n allowedButtons[value] = true;\r\n });\r\n\r\n each(options.buttons, function(key) {\r\n if (allowedButtons[key] === undefined) {\r\n throw new Error('button key \"' + key + '\" is not allowed (options are ' + buttons.join(' ') + ')');\r\n }\r\n });\r\n\r\n return options;\r\n }\r\n\r\n\r\n // From a given list of arguments, return a suitable object of button labels.\r\n // All this does is normalise the given labels and translate them where possible.\r\n // e.g. \"ok\", \"confirm\" -> { ok: \"OK\", cancel: \"Annuleren\" }\r\n function createLabels(labels, locale) {\r\n let buttons = {};\r\n\r\n for (let i = 0, j = labels.length; i < j; i++) {\r\n let argument = labels[i];\r\n let key = argument.toLowerCase();\r\n let value = argument.toUpperCase();\r\n\r\n buttons[key] = {\r\n label: getText(value, locale)\r\n };\r\n }\r\n\r\n return buttons;\r\n }\r\n\r\n\r\n // Get localized text from a locale. Defaults to 'en' locale if no locale provided or a non-registered locale is requested\r\n function getText(key, locale) {\r\n let labels = locales[locale];\r\n\r\n return labels ? labels[key] : locales.en[key];\r\n }\r\n\r\n\r\n // Filter and tidy up any user supplied parameters to this dialog.\r\n // Also looks for any shorthands used and ensures that the options which are returned are all normalized properly\r\n function sanitize(options) {\r\n let buttons;\r\n let total;\r\n\r\n if (typeof options !== 'object') {\r\n throw new Error('Please supply an object of options');\r\n }\r\n\r\n if (!options.message) {\r\n throw new Error('\"message\" option must not be null or an empty string.');\r\n }\r\n\r\n // Make sure any supplied options take precedence over defaults\r\n options = $.extend({}, defaults, options);\r\n\r\n // Make sure backdrop is either true, false, or 'static'\r\n if (!options.backdrop) {\r\n options.backdrop = (options.backdrop === false || options.backdrop === 0) ? false : 'static';\r\n } else {\r\n options.backdrop = typeof options.backdrop === 'string' && options.backdrop.toLowerCase() === 'static' ? 'static' : true;\r\n }\r\n\r\n // No buttons is still a valid dialog but it's cleaner to always have a buttons object to iterate over, even if it's empty\r\n if (!options.buttons) {\r\n options.buttons = {};\r\n }\r\n\r\n buttons = options.buttons;\r\n\r\n total = getKeyLength(buttons);\r\n\r\n each(buttons, function(key, button, index) {\r\n if ($.isFunction(button)) {\r\n // Short form, assume value is our callback. Since button isn't an object it isn't a reference either so re-assign it\r\n button = buttons[key] = {\r\n callback: button\r\n };\r\n }\r\n\r\n // Before any further checks, make sure button is the correct type\r\n if ($.type(button) !== 'object') {\r\n throw new Error('button with key \"' + key + '\" must be an object');\r\n }\r\n\r\n if (!button.label) {\r\n // The lack of an explicit label means we'll assume the key is good enough\r\n button.label = key;\r\n }\r\n\r\n if (!button.className) {\r\n let isPrimary = false;\r\n if (options.swapButtonOrder) {\r\n isPrimary = index === 0;\r\n } else {\r\n isPrimary = index === total - 1;\r\n }\r\n\r\n if (total <= 2 && isPrimary) {\r\n // always add a primary to the main option in a one or two-button dialog\r\n button.className = 'btn-primary';\r\n } else {\r\n // adding both classes allows us to target both BS3 and BS4+ without needing to check the version\r\n button.className = 'btn-secondary btn-default';\r\n }\r\n }\r\n });\r\n\r\n return options;\r\n }\r\n\r\n\r\n // Returns a count of the properties defined on the object\r\n function getKeyLength(obj) {\r\n return Object.keys(obj).length;\r\n }\r\n\r\n\r\n // Tiny wrapper function around jQuery.each; just adds index as the third parameter\r\n function each(collection, iterator) {\r\n let index = 0;\r\n $.each(collection, function(key, value) {\r\n iterator(key, value, index++);\r\n });\r\n }\r\n\r\n\r\n function focusPrimaryButton(e) {\r\n e.data.dialog.find('.bootbox-accept').first().trigger('focus');\r\n }\r\n\r\n\r\n function destroyModal(e) {\r\n // Ensure we don't accidentally intercept hidden events triggered by children of the current dialog. \r\n // We shouldn't need to handle this anymore, now that Bootstrap namespaces its events, but still worth doing.\r\n if (e.target === e.data.dialog[0]) {\r\n e.data.dialog.remove();\r\n }\r\n }\r\n\r\n\r\n function unbindModal(e) {\r\n if (e.target === e.data.dialog[0]) {\r\n e.data.dialog.off('escape.close.bb');\r\n e.data.dialog.off('click');\r\n }\r\n }\r\n\r\n\r\n // Handle the invoked dialog callback\r\n function processCallback(e, dialog, callback) {\r\n e.stopPropagation();\r\n e.preventDefault();\r\n\r\n // By default we assume a callback will get rid of the dialog, although it is given the opportunity to override this\r\n\r\n // If the callback can be invoked and it *explicitly returns false*, then we'll set a flag to keep the dialog active...\r\n let preserveDialog = $.isFunction(callback) && callback.call(dialog, e) === false;\r\n\r\n // ... otherwise we'll bin it\r\n if (!preserveDialog) {\r\n dialog.modal('hide');\r\n }\r\n }\r\n\r\n // Validate `min` and `max` values based on the current `inputType` value\r\n function minAndMaxAreValid(type, min, max) {\r\n let result = false;\r\n let minValid = true;\r\n let maxValid = true;\r\n\r\n if (type === 'date') {\r\n if (min !== undefined && !(minValid = dateIsValid(min))) {\r\n console.warn('Browsers which natively support the \"date\" input type expect date values to be of the form \"YYYY-MM-DD\" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your min value may not be enforced by this browser.');\r\n } else if (max !== undefined && !(maxValid = dateIsValid(max))) {\r\n console.warn('Browsers which natively support the \"date\" input type expect date values to be of the form \"YYYY-MM-DD\" (see ISO-8601 https://www.iso.org/iso-8601-date-and-time-format.html). Bootbox does not enforce this rule, but your max value may not be enforced by this browser.');\r\n }\r\n } else if (type === 'time') {\r\n if (min !== undefined && !(minValid = timeIsValid(min))) {\r\n throw new Error('\"min\" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.');\r\n } else if (max !== undefined && !(maxValid = timeIsValid(max))) {\r\n throw new Error('\"max\" is not a valid time. See https://www.w3.org/TR/2012/WD-html-markup-20120315/datatypes.html#form.data.time for more information.');\r\n }\r\n } else {\r\n if (min !== undefined && isNaN(min)) {\r\n minValid = false;\r\n throw new Error('\"min\" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-min for more information.');\r\n }\r\n\r\n if (max !== undefined && isNaN(max)) {\r\n maxValid = false;\r\n throw new Error('\"max\" must be a valid number. See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.');\r\n }\r\n }\r\n\r\n if (minValid && maxValid) {\r\n if (max <= min) {\r\n throw new Error('\"max\" must be greater than \"min\". See https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-max for more information.');\r\n } else {\r\n result = true;\r\n }\r\n }\r\n\r\n return result;\r\n }\r\n\r\n function timeIsValid(value) {\r\n return /([01][0-9]|2[0-3]):[0-5][0-9]?:[0-5][0-9]/.test(value);\r\n }\r\n\r\n function dateIsValid(value) {\r\n return /(\\d{4})-(\\d{2})-(\\d{2})/.test(value);\r\n }\r\n\r\n // The Bootbox object\r\n return exports;\r\n}));\r\n\r\n/*! @preserve\r\n * bootbox.locales.js\r\n * version: 6.0.0\r\n * author: Nick Payne \r\n * license: MIT\r\n * http://bootboxjs.com/\r\n */\r\n(function(global, factory) {\r\n 'use strict';\r\n if (typeof define === 'function' && define.amd) {\r\n define(['bootbox'], factory);\r\n } else if (typeof module === 'object' && module.exports) {\r\n factory(require('./bootbox'));\r\n } else {\r\n factory(global.bootbox);\r\n }\r\n}(this, function(bootbox) {\r\n 'use strict';\r\n\r\n // locale : Arabic\r\n // author : Emad Omar\r\n bootbox.addLocale('ar', {\r\n OK: 'موافق',\r\n CANCEL: 'الغاء',\r\n CONFIRM: 'تأكيد'\r\n });\r\n // locale : Azerbaijani\r\n // author : Valentin Belousov\r\n bootbox.addLocale('az', {\r\n OK: 'OK',\r\n CANCEL: 'İmtina et',\r\n CONFIRM: 'Təsdiq et'\r\n });\r\n // locale : Bulgarian\r\n // author : mraiur\r\n bootbox.addLocale('bg-BG', {\r\n OK: 'Ок',\r\n CANCEL: 'Отказ',\r\n CONFIRM: 'Потвърждавам'\r\n });\r\n // locale : Czech\r\n // author : Lukáš Fryč\r\n bootbox.addLocale('cs', {\r\n OK: 'OK',\r\n CANCEL: 'Zrušit',\r\n CONFIRM: 'Potvrdit'\r\n });\r\n // locale : Danish\r\n // author : Frederik Alkærsig\r\n bootbox.addLocale('da', {\r\n OK: 'OK',\r\n CANCEL: 'Annuller',\r\n CONFIRM: 'Accepter'\r\n });\r\n // locale : German\r\n // author : Nick Payne\r\n bootbox.addLocale('de', {\r\n OK: 'OK',\r\n CANCEL: 'Abbrechen',\r\n CONFIRM: 'Akzeptieren'\r\n });\r\n // locale : Greek\r\n // author : Tolis Emmanouilidis\r\n bootbox.addLocale('el', {\r\n OK: 'Εντάξει',\r\n CANCEL: 'Ακύρωση',\r\n CONFIRM: 'Επιβεβαίωση'\r\n });\r\n // locale : English\r\n // author : Nick Payne\r\n bootbox.addLocale('en', {\r\n OK: 'OK',\r\n CANCEL: 'Cancel',\r\n CONFIRM: 'OK'\r\n });\r\n // locale : Spanish\r\n // author : Ian Leckey\r\n bootbox.addLocale('es', {\r\n OK: 'OK',\r\n CANCEL: 'Cancelar',\r\n CONFIRM: 'Aceptar'\r\n });\r\n // locale : Estonian\r\n // author : Pavel Krõlov\r\n bootbox.addLocale('et', {\r\n OK: 'OK',\r\n CANCEL: 'Katkesta',\r\n CONFIRM: 'OK'\r\n });\r\n // locale : Basque\r\n // author : Iker Ibarguren\r\n bootbox.addLocale('eu', {\r\n OK: 'OK',\r\n CANCEL: 'Ezeztatu',\r\n CONFIRM: 'Onartu'\r\n });\r\n // locale : Persian\r\n // author : Touhid Arastu\r\n bootbox.addLocale('fa', {\r\n OK: 'قبول',\r\n CANCEL: 'لغو',\r\n CONFIRM: 'تایید'\r\n });\r\n // locale : Finnish\r\n // author : Nick Payne\r\n bootbox.addLocale('fi', {\r\n OK: 'OK',\r\n CANCEL: 'Peruuta',\r\n CONFIRM: 'OK'\r\n });\r\n // locale : French\r\n // author : Nick Payne, Sebastien Andary\r\n bootbox.addLocale('fr', {\r\n OK: 'OK',\r\n CANCEL: 'Annuler',\r\n CONFIRM: 'Confirmer'\r\n });\r\n // locale : Hebrew\r\n // author : Chen Alon\r\n bootbox.addLocale('he', {\r\n OK: 'אישור',\r\n CANCEL: 'ביטול',\r\n CONFIRM: 'אישור'\r\n });\r\n // locale : Croatian\r\n // author : Mario Bašić\r\n bootbox.addLocale('hr', {\r\n OK: 'OK',\r\n CANCEL: 'Odustani',\r\n CONFIRM: 'Potvrdi'\r\n });\r\n // locale : Hungarian\r\n // author : Márk Sági-Kazár\r\n bootbox.addLocale('hu', {\r\n OK: 'OK',\r\n CANCEL: 'Mégsem',\r\n CONFIRM: 'Megerősít'\r\n });\r\n // locale : Indonesian\r\n // author : Budi Irawan\r\n bootbox.addLocale('id', {\r\n OK: 'OK',\r\n CANCEL: 'Batal',\r\n CONFIRM: 'OK'\r\n });\r\n // locale : Italian\r\n // author : Mauro\r\n bootbox.addLocale('it', {\r\n OK: 'OK',\r\n CANCEL: 'Annulla',\r\n CONFIRM: 'Conferma'\r\n });\r\n // locale : Japanese\r\n // author : ms183\r\n bootbox.addLocale('ja', {\r\n OK: 'OK',\r\n CANCEL: 'キャンセル',\r\n CONFIRM: '確認'\r\n });\r\n // locale : Georgian\r\n // author : Avtandil Kikabidze aka LONGMAN (@akalongman)\r\n bootbox.addLocale('ka', {\r\n OK: 'OK',\r\n CANCEL: 'გაუქმება',\r\n CONFIRM: 'დადასტურება'\r\n });\r\n // locale : Korean\r\n // author : rigning\r\n bootbox.addLocale('ko', {\r\n OK: 'OK',\r\n CANCEL: '취소',\r\n CONFIRM: '확인'\r\n });\r\n // locale : Lithuanian\r\n // author : Tomas\r\n bootbox.addLocale('lt', {\r\n OK: 'Gerai',\r\n CANCEL: 'Atšaukti',\r\n CONFIRM: 'Patvirtinti'\r\n });\r\n // locale : Latvian\r\n // author : Dmitry Bogatykh, Lauris BH\r\n bootbox.addLocale('lv', {\r\n OK: 'Labi',\r\n CANCEL: 'Atcelt',\r\n CONFIRM: 'Apstiprināt'\r\n });\r\n // locale : Dutch\r\n // author : Bas ter Vrugt\r\n bootbox.addLocale('nl', {\r\n OK: 'OK',\r\n CANCEL: 'Annuleren',\r\n CONFIRM: 'Accepteren'\r\n });\r\n // locale : Norwegian\r\n // author : Nils Magnus Englund\r\n bootbox.addLocale('no', {\r\n OK: 'OK',\r\n CANCEL: 'Avbryt',\r\n CONFIRM: 'OK'\r\n });\r\n // locale : Polish\r\n // author : Szczepan Cieślik\r\n bootbox.addLocale('pl', {\r\n OK: 'OK',\r\n CANCEL: 'Anuluj',\r\n CONFIRM: 'Potwierdź'\r\n });\r\n // locale : Portuguese (Brasil)\r\n // author : Nick Payne\r\n bootbox.addLocale('pt-BR', {\r\n OK: 'OK',\r\n CANCEL: 'Cancelar',\r\n CONFIRM: 'Sim'\r\n });\r\n // locale : Portuguese\r\n // author : Cláudio Medina\r\n bootbox.addLocale('pt', {\r\n OK: 'OK',\r\n CANCEL: 'Cancelar',\r\n CONFIRM: 'Confirmar'\r\n });\r\n // locale : Russian\r\n // author : ionian-wind\r\n bootbox.addLocale('ru', {\r\n OK: 'OK',\r\n CANCEL: 'Отмена',\r\n CONFIRM: 'Применить'\r\n });\r\n // locale : Slovak\r\n // author : Stano Paška\r\n bootbox.addLocale('sk', {\r\n OK: 'OK',\r\n CANCEL: 'Zrušiť',\r\n CONFIRM: 'Potvrdiť'\r\n });\r\n // locale : Slovenian\r\n // author : @metalcamp\r\n bootbox.addLocale('sl', {\r\n OK: 'OK',\r\n CANCEL: 'Prekliči',\r\n CONFIRM: 'Potrdi'\r\n });\r\n // locale : Albanian\r\n // author : Knut Hühne\r\n bootbox.addLocale('sq', {\r\n OK: 'OK',\r\n CANCEL: 'Anulo',\r\n CONFIRM: 'Prano'\r\n });\r\n // locale : Swedish\r\n // author : Mattias Reichel\r\n bootbox.addLocale('sv', {\r\n OK: 'OK',\r\n CANCEL: 'Avbryt',\r\n CONFIRM: 'OK'\r\n });\r\n // locale : Swahili\r\n // author : Timothy Anyona\r\n bootbox.addLocale('sw', {\r\n OK: 'Sawa',\r\n CANCEL: 'Ghairi',\r\n CONFIRM: 'Thibitisha'\r\n });\r\n // locale : Tamil\r\n // author : Kolappan Nathan\r\n bootbox.addLocale('ta', {\r\n OK: 'சரி',\r\n CANCEL: 'ரத்து செய்',\r\n CONFIRM: 'உறுதி செய்'\r\n });\r\n // locale : Thai\r\n // author : Ishmael๛\r\n bootbox.addLocale('th', {\r\n OK: 'ตกลง',\r\n CANCEL: 'ยกเลิก',\r\n CONFIRM: 'ยืนยัน'\r\n });\r\n // locale : Turkish\r\n // author : Enes Karaca\r\n bootbox.addLocale('tr', {\r\n OK: 'Tamam',\r\n CANCEL: 'İptal',\r\n CONFIRM: 'Onayla'\r\n });\r\n // locale : Ukrainian\r\n // author : OlehBoiko\r\n bootbox.addLocale('uk', {\r\n OK: 'OK',\r\n CANCEL: 'Відміна',\r\n CONFIRM: 'Прийняти'\r\n });\r\n // locale : Vietnamese\r\n // author : Anh Tu Nguyen\r\n bootbox.addLocale('vi', {\r\n OK: 'OK',\r\n CANCEL: 'Hủy bỏ',\r\n CONFIRM: 'Xác nhận'\r\n });\r\n // locale : Chinese (China / People's Republic of China)\r\n // author : Nick Payne\r\n bootbox.addLocale('zh-CN', {\r\n OK: 'OK',\r\n CANCEL: '取消',\r\n CONFIRM: '确认'\r\n });\r\n // locale : Chinese (Taiwan / Republic of China)\r\n // author : Nick Payne\r\n bootbox.addLocale('zh-TW', {\r\n OK: 'OK',\r\n CANCEL: '取消',\r\n CONFIRM: '確認'\r\n });\r\n\r\n}));\r\n"],"names":["root","factory","init","$","undefined","exports","VERSION","locales","OK","CANCEL","CONFIRM","templates","dialog","header","footer","closeButton","form","button","option","promptMessage","inputs","text","textarea","email","select","checkbox","radio","date","time","number","password","range","defaults","locale","backdrop","animate","className","show","container","value","inputType","errorMessage","swapButtonOrder","centerVertical","multiple","scrollable","reusable","relatedTarget","size","id","mapArguments","args","properties","argsLength","length","options","Error","mergeArguments","extend","mergeDialogOptions","labels","reverse","validateButtons","buttons","createLabels","allowedButtons","each","key","join","i","j","argument","toLowerCase","toUpperCase","label","getText","en","sanitize","total","message","getKeyLength","index","isFunction","callback","type","isPrimary","obj","Object","keys","collection","iterator","focusPrimaryButton","e","data","find","first","trigger","destroyModal","target","remove","unbindModal","off","processCallback","stopPropagation","preventDefault","call","modal","minAndMaxAreValid","min","max","result","minValid","maxValid","dateIsValid","console","warn","timeIsValid","isNaN","test","name","addLocale","values","_","v","removeLocale","setLocale","setDefaults","arguments","hideAll","_$","fn","Constructor","fullBootstrapVersion","indexOf","bootstrap","substring","innerDialog","body","callbacks","onEscape","html","b","addClass","attr","disabled","prop","append","after","title","prepend","before","one","onHide","on","onHidden","onShow","onShown","startedOnBody","currentTarget","callbackKey","this","which","keyboard","alert","ok","confirm","cancel","prompt","promptDialog","input","shouldShow","inputOptions","map","val","get","el","setCustomValidity","checkValidity","reportValidity","placeholder","pattern","maxlength","required","rows","parseInt","step","parseFloat","groups","isArray","elem","group","o","removeClass","checkboxValues","checkFirstRadio","trim","focus","global","bootbox"],"sourceRoot":""}