<%= render AlertComponent.new %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 3d60db42b3..a78b04f3d4 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -26,10 +26,10 @@
- <%= stylesheet_pack_tag "front", "data-turbolinks-track": "reload" %>
- <%= stylesheet_pack_tag "turbolinks-app", 'data-turbolinks-track': 'reload' if turbolinks_app? %>
+ <%= stylesheet_link_tag "front", "data-turbolinks-track": "reload" %>
+ <%= stylesheet_link_tag "turbolinks-app", 'data-turbolinks-track': 'reload' if turbolinks_app? %>
<%= yield :stylesheets %>
- <%= javascript_pack_tag "application", defer: false %>
+ <%= javascript_importmap_tags %>
<%= yield :javascripts %>
<%= action_cable_meta_tag %>
<%= csrf_meta_tag %>
diff --git a/app/views/layouts/simple.html.erb b/app/views/layouts/simple.html.erb
index f7ce0e7484..45b2141a3a 100644
--- a/app/views/layouts/simple.html.erb
+++ b/app/views/layouts/simple.html.erb
@@ -7,8 +7,8 @@
<%= content_for?(:title) ? yield(:title) : Setting.app_name %>
- <%= stylesheet_pack_tag "front" %>
- <%= javascript_pack_tag "application", defer: false %>
+ <%= stylesheet_link_tag "front" %>
+ <%= javascript_importmap_tags %>
<%= csrf_meta_tag %>
<%= raw Setting.custom_head_html %>
diff --git a/bin/dev b/bin/dev
index 5f91c20545..ad72c7d53c 100755
--- a/bin/dev
+++ b/bin/dev
@@ -1,2 +1,16 @@
-#!/usr/bin/env ruby
-exec "./bin/rails", "server", *ARGV
+#!/usr/bin/env sh
+
+if ! gem list foreman -i --silent; then
+ echo "Installing foreman..."
+ gem install foreman
+fi
+
+# Default to port 3000 if not specified
+export PORT="${PORT:-3000}"
+
+# Let the debug gem allow remote connections,
+# but avoid loading until `debugger` is called
+export RUBY_DEBUG_OPEN="true"
+export RUBY_DEBUG_LAZY="true"
+
+exec foreman start -f Procfile.dev "$@"
diff --git a/bin/importmap b/bin/importmap
new file mode 100755
index 0000000000..36502ab16c
--- /dev/null
+++ b/bin/importmap
@@ -0,0 +1,4 @@
+#!/usr/bin/env ruby
+
+require_relative "../config/application"
+require "importmap/commands"
diff --git a/bin/shakapacker b/bin/shakapacker
deleted file mode 100755
index 13a008dcfe..0000000000
--- a/bin/shakapacker
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env ruby
-
-ENV["RAILS_ENV"] ||= "development"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
-
-require "bundler/setup"
-require "shakapacker"
-require "shakapacker/webpack_runner"
-
-APP_ROOT = File.expand_path("..", __dir__)
-Dir.chdir(APP_ROOT) do
- Shakapacker::WebpackRunner.run(ARGV)
-end
diff --git a/bin/shakapacker-dev-server b/bin/shakapacker-dev-server
deleted file mode 100755
index 5ae8897989..0000000000
--- a/bin/shakapacker-dev-server
+++ /dev/null
@@ -1,13 +0,0 @@
-#!/usr/bin/env ruby
-
-ENV["RAILS_ENV"] ||= "development"
-ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile", __FILE__)
-
-require "bundler/setup"
-require "shakapacker"
-require "shakapacker/dev_server_runner"
-
-APP_ROOT = File.expand_path("..", __dir__)
-Dir.chdir(APP_ROOT) do
- Shakapacker::DevServerRunner.run(ARGV)
-end
diff --git a/config/importmap.rb b/config/importmap.rb
new file mode 100644
index 0000000000..56bac7cdb8
--- /dev/null
+++ b/config/importmap.rb
@@ -0,0 +1,11 @@
+# Pin npm packages by running ./bin/importmap
+pin "application"
+pin_all_from "vendor/javascript"
+pin "jquery.caret" # @0.3.1
+pin "jquery" # @3.7.1
+pin "dropzone" # @5.7.6
+pin "underscore" # @1.7.0
+pin "bootstrap-select" # @1.14.0
+pin "bootstrap" # @5.3.3
+pin "@popperjs/core", to: "@popperjs--core.js" # @2.11.8
+pin "turbolinks-prefetch" # @1.0.4
diff --git a/config/shakapacker.yml b/config/shakapacker.yml
deleted file mode 100644
index 62f833bceb..0000000000
--- a/config/shakapacker.yml
+++ /dev/null
@@ -1,84 +0,0 @@
-# Note: You must restart bin/shakapacker-dev-server for changes to take effect
-
-default: &default
- source_path: app/javascript
- source_entry_path: /
- # If nested_entries is true, then we'll pick up subdirectories within the source_entry_path.
- # You cannot set this option to true if you set source_entry_path to '/'
- nested_entries: false
- public_root_path: public
- public_output_path: packs
- cache_path: tmp/shakapacker
- shakapacker_compile_output: true
-
- # Location for manifest.json, defaults to {public_output_path}/manifest.json if unset
- # manifest_path: public/packs/manifest.json
-
- # Additional paths webpack should look up modules
- # ['app/assets', 'engine/foo/app/assets']
- additional_paths: ["lib/assets/javascripts"]
-
- # Reload manifest.json on all requests so we reload latest compiled packs
- cache_manifest: false
-
- # Select loader to use, available options are 'babel' (default), 'swc' or 'esbuild'
- shakapacker_loader: 'babel'
-
- # Set to true to enable check for matching versions of shakapacker gem and NPM package - will raise an error if there is a mismatch or wildcard versioning is used
- ensure_consistent_versioning: false
-
-development:
- <<: *default
- compile: true
-
- # Reference: https://webpack.js.org/configuration/dev-server/
- dev_server:
- server: 'http'
- host: localhost
- port: 3035
- # Hot Module Replacement updates modules while the application is running without a full reload
- hmr: false
- # If HMR is on, CSS will by inlined by delivering it as part of the script payload via style-loader. Be sure
- # that you add style-loader to your project dependencies.
- #
- # If you want to instead deliver CSS via
with the mini-extract-css-plugin, set inline_css to false.
- # In that case, style-loader is not needed as a dependency.
- #
- # mini-extract-css-plugin is a required dependency in both cases.
- inline_css: true
- # Defaults to the inverse of hmr. Uncomment to manually set this.
- # live_reload: true
- client:
- # Should we show a full-screen overlay in the browser when there are compiler errors or warnings?
- overlay: true
- # May also be a string
- # webSocketURL:
- # hostname: "0.0.0.0"
- # pathname: "/ws"
- # port: 8080
- # Should we use gzip compression?
- compress: true
- # Note that apps that do not check the host are vulnerable to DNS rebinding attacks
- allowed_hosts: "all"
- pretty: true
- headers:
- "Access-Control-Allow-Origin": "*"
- static:
- watch:
- ignored: "**/node_modules/**"
-
-test:
- <<: *default
- compile: true
-
- # Compile test packs to a separate directory
- public_output_path: packs-test
-
-production:
- <<: *default
-
- # Production depends on precompilation of packs prior to booting for performance.
- compile: false
-
- # Cache manifest.json for performance
- cache_manifest: true
diff --git a/tailwind.config.js b/config/tailwind.config.js
similarity index 100%
rename from tailwind.config.js
rename to config/tailwind.config.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
deleted file mode 100644
index 16f88451ec..0000000000
--- a/config/webpack/environment.js
+++ /dev/null
@@ -1,29 +0,0 @@
-const { environment } = require("shakapacker");
-const erb = require("./loaders/erb");
-const webpack = require("webpack");
-
-const extendConfig = {
- devtool: false,
- plugins: [
- new webpack.ProvidePlugin({
- $: "jquery",
- jQuery: "jquery",
- }),
- ],
- optimization: {
- splitChunks: {
- cacheGroups: {
- vendors: {
- test: /node_modules|lib\/assets|vendor/,
- name: "vendors",
- enforce: true,
- chunks: "all",
- },
- },
- },
- },
-};
-
-environment.config.merge(extendConfig);
-environment.loaders.prepend("erb", erb);
-module.exports = environment;
diff --git a/config/webpack/loaders/erb.js b/config/webpack/loaders/erb.js
deleted file mode 100644
index a4049f1323..0000000000
--- a/config/webpack/loaders/erb.js
+++ /dev/null
@@ -1,11 +0,0 @@
-module.exports = {
- test: /\.erb$/,
- enforce: 'pre',
- exclude: /node_modules/,
- use: [{
- loader: 'rails-erb-loader',
- options: {
- runner: (/^win/.test(process.platform) ? 'ruby ' : '') + 'bin/rails runner'
- }
- }]
-}
diff --git a/config/webpack/webpack.config.js b/config/webpack/webpack.config.js
deleted file mode 100644
index 55a884f47d..0000000000
--- a/config/webpack/webpack.config.js
+++ /dev/null
@@ -1,19 +0,0 @@
-const { generateWebpackConfig } = require('shakapacker');
-const { merge } = require('webpack-merge');
-const webpack = require("webpack");
-const webpackConfig = generateWebpackConfig();
-
-// See the shakacode/shakapacker README and docs directory for advice on customizing your webpackConfig.
-const customConfig = {
- plugins: [
- new webpack.ProvidePlugin({
- $: "jquery",
- jQuery: "jquery",
- }),
- ],
- resolve: {
- extensions: [".js", ".ts", ".tsx", ".js.erb", ".css", ".scss"],
- },
-}
-
-module.exports = merge(webpackConfig, customConfig)
diff --git a/lib/assets/javascripts/underscore.js b/lib/assets/javascripts/underscore.js
deleted file mode 100644
index 38de2bc99b..0000000000
--- a/lib/assets/javascripts/underscore.js
+++ /dev/null
@@ -1,5 +0,0 @@
-// Underscore.js 1.7.0
-// http://underscorejs.org
-// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
-// Underscore may be freely distributed under the MIT license.
-(function(){var n=this,t=n._,r=Array.prototype,e=Object.prototype,u=Function.prototype,i=r.push,a=r.slice,o=r.concat,l=e.toString,c=e.hasOwnProperty,f=Array.isArray,s=Object.keys,p=u.bind,h=function(n){return n instanceof h?n:this instanceof h?void(this._wrapped=n):new h(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=h),exports._=h):n._=h,h.VERSION="1.7.0";var g=function(n,t,r){if(t===void 0)return n;switch(null==r?3:r){case 1:return function(r){return n.call(t,r)};case 2:return function(r,e){return n.call(t,r,e)};case 3:return function(r,e,u){return n.call(t,r,e,u)};case 4:return function(r,e,u,i){return n.call(t,r,e,u,i)}}return function(){return n.apply(t,arguments)}};h.iteratee=function(n,t,r){return null==n?h.identity:h.isFunction(n)?g(n,t,r):h.isObject(n)?h.matches(n):h.property(n)},h.each=h.forEach=function(n,t,r){if(null==n)return n;t=g(t,r);var e,u=n.length;if(u===+u)for(e=0;u>e;e++)t(n[e],e,n);else{var i=h.keys(n);for(e=0,u=i.length;u>e;e++)t(n[i[e]],i[e],n)}return n},h.map=h.collect=function(n,t,r){if(null==n)return[];t=h.iteratee(t,r);for(var e,u=n.length!==+n.length&&h.keys(n),i=(u||n).length,a=Array(i),o=0;i>o;o++)e=u?u[o]:o,a[o]=t(n[e],e,n);return a};var v="Reduce of empty array with no initial value";h.reduce=h.foldl=h.inject=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length,o=0;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[o++]:o++]}for(;a>o;o++)u=i?i[o]:o,r=t(r,n[u],u,n);return r},h.reduceRight=h.foldr=function(n,t,r,e){null==n&&(n=[]),t=g(t,e,4);var u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;if(arguments.length<3){if(!a)throw new TypeError(v);r=n[i?i[--a]:--a]}for(;a--;)u=i?i[a]:a,r=t(r,n[u],u,n);return r},h.find=h.detect=function(n,t,r){var e;return t=h.iteratee(t,r),h.some(n,function(n,r,u){return t(n,r,u)?(e=n,!0):void 0}),e},h.filter=h.select=function(n,t,r){var e=[];return null==n?e:(t=h.iteratee(t,r),h.each(n,function(n,r,u){t(n,r,u)&&e.push(n)}),e)},h.reject=function(n,t,r){return h.filter(n,h.negate(h.iteratee(t)),r)},h.every=h.all=function(n,t,r){if(null==n)return!0;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,!t(n[u],u,n))return!1;return!0},h.some=h.any=function(n,t,r){if(null==n)return!1;t=h.iteratee(t,r);var e,u,i=n.length!==+n.length&&h.keys(n),a=(i||n).length;for(e=0;a>e;e++)if(u=i?i[e]:e,t(n[u],u,n))return!0;return!1},h.contains=h.include=function(n,t){return null==n?!1:(n.length!==+n.length&&(n=h.values(n)),h.indexOf(n,t)>=0)},h.invoke=function(n,t){var r=a.call(arguments,2),e=h.isFunction(t);return h.map(n,function(n){return(e?t:n[t]).apply(n,r)})},h.pluck=function(n,t){return h.map(n,h.property(t))},h.where=function(n,t){return h.filter(n,h.matches(t))},h.findWhere=function(n,t){return h.find(n,h.matches(t))},h.max=function(n,t,r){var e,u,i=-1/0,a=-1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],e>i&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(u>a||u===-1/0&&i===-1/0)&&(i=n,a=u)});return i},h.min=function(n,t,r){var e,u,i=1/0,a=1/0;if(null==t&&null!=n){n=n.length===+n.length?n:h.values(n);for(var o=0,l=n.length;l>o;o++)e=n[o],i>e&&(i=e)}else t=h.iteratee(t,r),h.each(n,function(n,r,e){u=t(n,r,e),(a>u||1/0===u&&1/0===i)&&(i=n,a=u)});return i},h.shuffle=function(n){for(var t,r=n&&n.length===+n.length?n:h.values(n),e=r.length,u=Array(e),i=0;e>i;i++)t=h.random(0,i),t!==i&&(u[i]=u[t]),u[t]=r[i];return u},h.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=h.values(n)),n[h.random(n.length-1)]):h.shuffle(n).slice(0,Math.max(0,t))},h.sortBy=function(n,t,r){return t=h.iteratee(t,r),h.pluck(h.map(n,function(n,r,e){return{value:n,index:r,criteria:t(n,r,e)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var m=function(n){return function(t,r,e){var u={};return r=h.iteratee(r,e),h.each(t,function(e,i){var a=r(e,i,t);n(u,e,a)}),u}};h.groupBy=m(function(n,t,r){h.has(n,r)?n[r].push(t):n[r]=[t]}),h.indexBy=m(function(n,t,r){n[r]=t}),h.countBy=m(function(n,t,r){h.has(n,r)?n[r]++:n[r]=1}),h.sortedIndex=function(n,t,r,e){r=h.iteratee(r,e,1);for(var u=r(t),i=0,a=n.length;a>i;){var o=i+a>>>1;r(n[o])
t?[]:a.call(n,0,t)},h.initial=function(n,t,r){return a.call(n,0,Math.max(0,n.length-(null==t||r?1:t)))},h.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:a.call(n,Math.max(n.length-t,0))},h.rest=h.tail=h.drop=function(n,t,r){return a.call(n,null==t||r?1:t)},h.compact=function(n){return h.filter(n,h.identity)};var y=function(n,t,r,e){if(t&&h.every(n,h.isArray))return o.apply(e,n);for(var u=0,a=n.length;a>u;u++){var l=n[u];h.isArray(l)||h.isArguments(l)?t?i.apply(e,l):y(l,t,r,e):r||e.push(l)}return e};h.flatten=function(n,t){return y(n,t,!1,[])},h.without=function(n){return h.difference(n,a.call(arguments,1))},h.uniq=h.unique=function(n,t,r,e){if(null==n)return[];h.isBoolean(t)||(e=r,r=t,t=!1),null!=r&&(r=h.iteratee(r,e));for(var u=[],i=[],a=0,o=n.length;o>a;a++){var l=n[a];if(t)a&&i===l||u.push(l),i=l;else if(r){var c=r(l,a,n);h.indexOf(i,c)<0&&(i.push(c),u.push(l))}else h.indexOf(u,l)<0&&u.push(l)}return u},h.union=function(){return h.uniq(y(arguments,!0,!0,[]))},h.intersection=function(n){if(null==n)return[];for(var t=[],r=arguments.length,e=0,u=n.length;u>e;e++){var i=n[e];if(!h.contains(t,i)){for(var a=1;r>a&&h.contains(arguments[a],i);a++);a===r&&t.push(i)}}return t},h.difference=function(n){var t=y(a.call(arguments,1),!0,!0,[]);return h.filter(n,function(n){return!h.contains(t,n)})},h.zip=function(n){if(null==n)return[];for(var t=h.max(arguments,"length").length,r=Array(t),e=0;t>e;e++)r[e]=h.pluck(arguments,e);return r},h.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},h.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=h.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}for(;u>e;e++)if(n[e]===t)return e;return-1},h.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=n.length;for("number"==typeof r&&(e=0>r?e+r+1:Math.min(e,r+1));--e>=0;)if(n[e]===t)return e;return-1},h.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=r||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=Array(e),i=0;e>i;i++,n+=r)u[i]=n;return u};var d=function(){};h.bind=function(n,t){var r,e;if(p&&n.bind===p)return p.apply(n,a.call(arguments,1));if(!h.isFunction(n))throw new TypeError("Bind must be called on a function");return r=a.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(a.call(arguments)));d.prototype=n.prototype;var u=new d;d.prototype=null;var i=n.apply(u,r.concat(a.call(arguments)));return h.isObject(i)?i:u}},h.partial=function(n){var t=a.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===h&&(e[u]=arguments[r++]);for(;r=e)throw new Error("bindAll must be passed function names");for(t=1;e>t;t++)r=arguments[t],n[r]=h.bind(n[r],n);return n},h.memoize=function(n,t){var r=function(e){var u=r.cache,i=t?t.apply(this,arguments):e;return h.has(u,i)||(u[i]=n.apply(this,arguments)),u[i]};return r.cache={},r},h.delay=function(n,t){var r=a.call(arguments,2);return setTimeout(function(){return n.apply(null,r)},t)},h.defer=function(n){return h.delay.apply(h,[n,1].concat(a.call(arguments,1)))},h.throttle=function(n,t,r){var e,u,i,a=null,o=0;r||(r={});var l=function(){o=r.leading===!1?0:h.now(),a=null,i=n.apply(e,u),a||(e=u=null)};return function(){var c=h.now();o||r.leading!==!1||(o=c);var f=t-(c-o);return e=this,u=arguments,0>=f||f>t?(clearTimeout(a),a=null,o=c,i=n.apply(e,u),a||(e=u=null)):a||r.trailing===!1||(a=setTimeout(l,f)),i}},h.debounce=function(n,t,r){var e,u,i,a,o,l=function(){var c=h.now()-a;t>c&&c>0?e=setTimeout(l,t-c):(e=null,r||(o=n.apply(i,u),e||(i=u=null)))};return function(){i=this,u=arguments,a=h.now();var c=r&&!e;return e||(e=setTimeout(l,t)),c&&(o=n.apply(i,u),i=u=null),o}},h.wrap=function(n,t){return h.partial(t,n)},h.negate=function(n){return function(){return!n.apply(this,arguments)}},h.compose=function(){var n=arguments,t=n.length-1;return function(){for(var r=t,e=n[t].apply(this,arguments);r--;)e=n[r].call(this,e);return e}},h.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},h.before=function(n,t){var r;return function(){return--n>0?r=t.apply(this,arguments):t=null,r}},h.once=h.partial(h.before,2),h.keys=function(n){if(!h.isObject(n))return[];if(s)return s(n);var t=[];for(var r in n)h.has(n,r)&&t.push(r);return t},h.values=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},h.pairs=function(n){for(var t=h.keys(n),r=t.length,e=Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},h.invert=function(n){for(var t={},r=h.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},h.functions=h.methods=function(n){var t=[];for(var r in n)h.isFunction(n[r])&&t.push(r);return t.sort()},h.extend=function(n){if(!h.isObject(n))return n;for(var t,r,e=1,u=arguments.length;u>e;e++){t=arguments[e];for(r in t)c.call(t,r)&&(n[r]=t[r])}return n},h.pick=function(n,t,r){var e,u={};if(null==n)return u;if(h.isFunction(t)){t=g(t,r);for(e in n){var i=n[e];t(i,e,n)&&(u[e]=i)}}else{var l=o.apply([],a.call(arguments,1));n=new Object(n);for(var c=0,f=l.length;f>c;c++)e=l[c],e in n&&(u[e]=n[e])}return u},h.omit=function(n,t,r){if(h.isFunction(t))t=h.negate(t);else{var e=h.map(o.apply([],a.call(arguments,1)),String);t=function(n,t){return!h.contains(e,t)}}return h.pick(n,t,r)},h.defaults=function(n){if(!h.isObject(n))return n;for(var t=1,r=arguments.length;r>t;t++){var e=arguments[t];for(var u in e)n[u]===void 0&&(n[u]=e[u])}return n},h.clone=function(n){return h.isObject(n)?h.isArray(n)?n.slice():h.extend({},n):n},h.tap=function(n,t){return t(n),n};var b=function(n,t,r,e){if(n===t)return 0!==n||1/n===1/t;if(null==n||null==t)return n===t;n instanceof h&&(n=n._wrapped),t instanceof h&&(t=t._wrapped);var u=l.call(n);if(u!==l.call(t))return!1;switch(u){case"[object RegExp]":case"[object String]":return""+n==""+t;case"[object Number]":return+n!==+n?+t!==+t:0===+n?1/+n===1/t:+n===+t;case"[object Date]":case"[object Boolean]":return+n===+t}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]===n)return e[i]===t;var a=n.constructor,o=t.constructor;if(a!==o&&"constructor"in n&&"constructor"in t&&!(h.isFunction(a)&&a instanceof a&&h.isFunction(o)&&o instanceof o))return!1;r.push(n),e.push(t);var c,f;if("[object Array]"===u){if(c=n.length,f=c===t.length)for(;c--&&(f=b(n[c],t[c],r,e)););}else{var s,p=h.keys(n);if(c=p.length,f=h.keys(t).length===c)for(;c--&&(s=p[c],f=h.has(t,s)&&b(n[s],t[s],r,e)););}return r.pop(),e.pop(),f};h.isEqual=function(n,t){return b(n,t,[],[])},h.isEmpty=function(n){if(null==n)return!0;if(h.isArray(n)||h.isString(n)||h.isArguments(n))return 0===n.length;for(var t in n)if(h.has(n,t))return!1;return!0},h.isElement=function(n){return!(!n||1!==n.nodeType)},h.isArray=f||function(n){return"[object Array]"===l.call(n)},h.isObject=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},h.each(["Arguments","Function","String","Number","Date","RegExp"],function(n){h["is"+n]=function(t){return l.call(t)==="[object "+n+"]"}}),h.isArguments(arguments)||(h.isArguments=function(n){return h.has(n,"callee")}),"function"!=typeof/./&&(h.isFunction=function(n){return"function"==typeof n||!1}),h.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},h.isNaN=function(n){return h.isNumber(n)&&n!==+n},h.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"===l.call(n)},h.isNull=function(n){return null===n},h.isUndefined=function(n){return n===void 0},h.has=function(n,t){return null!=n&&c.call(n,t)},h.noConflict=function(){return n._=t,this},h.identity=function(n){return n},h.constant=function(n){return function(){return n}},h.noop=function(){},h.property=function(n){return function(t){return t[n]}},h.matches=function(n){var t=h.pairs(n),r=t.length;return function(n){if(null==n)return!r;n=new Object(n);for(var e=0;r>e;e++){var u=t[e],i=u[0];if(u[1]!==n[i]||!(i in n))return!1}return!0}},h.times=function(n,t,r){var e=Array(Math.max(0,n));t=g(t,r,1);for(var u=0;n>u;u++)e[u]=t(u);return e},h.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},h.now=Date.now||function(){return(new Date).getTime()};var _={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},w=h.invert(_),j=function(n){var t=function(t){return n[t]},r="(?:"+h.keys(n).join("|")+")",e=RegExp(r),u=RegExp(r,"g");return function(n){return n=null==n?"":""+n,e.test(n)?n.replace(u,t):n}};h.escape=j(_),h.unescape=j(w),h.result=function(n,t){if(null==n)return void 0;var r=n[t];return h.isFunction(r)?n[t]():r};var x=0;h.uniqueId=function(n){var t=++x+"";return n?n+t:t},h.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var A=/(.)^/,k={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},O=/\\|'|\r|\n|\u2028|\u2029/g,F=function(n){return"\\"+k[n]};h.template=function(n,t,r){!t&&r&&(t=r),t=h.defaults({},t,h.templateSettings);var e=RegExp([(t.escape||A).source,(t.interpolate||A).source,(t.evaluate||A).source].join("|")+"|$","g"),u=0,i="__p+='";n.replace(e,function(t,r,e,a,o){return i+=n.slice(u,o).replace(O,F),u=o+t.length,r?i+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'":e?i+="'+\n((__t=("+e+"))==null?'':__t)+\n'":a&&(i+="';\n"+a+"\n__p+='"),t}),i+="';\n",t.variable||(i="with(obj||{}){\n"+i+"}\n"),i="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+i+"return __p;\n";try{var a=new Function(t.variable||"obj","_",i)}catch(o){throw o.source=i,o}var l=function(n){return a.call(this,n,h)},c=t.variable||"obj";return l.source="function("+c+"){\n"+i+"}",l},h.chain=function(n){var t=h(n);return t._chain=!0,t};var E=function(n){return this._chain?h(n).chain():n};h.mixin=function(n){h.each(h.functions(n),function(t){var r=h[t]=n[t];h.prototype[t]=function(){var n=[this._wrapped];return i.apply(n,arguments),E.call(this,r.apply(h,n))}})},h.mixin(h),h.each(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=r[n];h.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!==n&&"splice"!==n||0!==r.length||delete r[0],E.call(this,r)}}),h.each(["concat","join","slice"],function(n){var t=r[n];h.prototype[n]=function(){return E.call(this,t.apply(this._wrapped,arguments))}}),h.prototype.value=function(){return this._wrapped},"function"==typeof define&&define.amd&&define("underscore",[],function(){return h})}).call(this);
diff --git a/package.json b/package.json
deleted file mode 100644
index c43c7147c5..0000000000
--- a/package.json
+++ /dev/null
@@ -1,71 +0,0 @@
-{
- "name": "homeland",
- "private": true,
- "scripts": {
- "start": "./bin/shakapacker-dev-server"
- },
- "dependencies": {
- "@babel/core": "7.18.2",
- "@babel/plugin-transform-runtime": "7.18.2",
- "@babel/preset-env": "7.18.2",
- "@babel/preset-typescript": "7.17.12",
- "@babel/runtime": "7.18.3",
- "@fortawesome/fontawesome-free": "^6.2.0",
- "@popperjs/core": "^2.11.8",
- "@prettier/plugin-ruby": "^2",
- "@rails/actioncable": "~7.1.1",
- "@rails/ujs": "~7.1.1",
- "autoprefixer": "~10.4.17",
- "babel-loader": "8.2.5",
- "backbone": "~1.4",
- "bootstrap": "~5.3.3",
- "bootstrap-select": "^1.14.0-beta2",
- "compression-webpack-plugin": "9",
- "css-loader": "^6.5.1",
- "css-minimizer-webpack-plugin": "^3.3.1",
- "deep-assign": "^3.0.0",
- "dropzone": "~5.7",
- "i18next": "^21.6.11",
- "jquery": "~1.12",
- "jquery.caret": "~0.3.1",
- "mini-css-extract-plugin": "^2.4.5",
- "popper.js": "~1.16",
- "postcss": "^8.4.31",
- "postcss-flexbugs-fixes": "^5.0.2",
- "postcss-import": "^14.0.2",
- "postcss-loader": "^6.2.1",
- "postcss-preset-env": "^7.1.0",
- "prettier": "^2",
- "prettier-plugin-erb": "^0",
- "rails-erb-loader": "^5.5.2",
- "sass": "1.52.1",
- "sass-loader": "^12.4.0",
- "shakapacker": "=7.2.3",
- "style-loader": "^3.3.1",
- "tailwindcss": "^3.3.2",
- "terser-webpack-plugin": "5",
- "turbolinks": "~5.2",
- "turbolinks-prefetch": "~1.0",
- "typescript": "4.7.2",
- "underscore": "~1.13.3",
- "webpack": "^5.72.0",
- "webpack-assets-manifest": "5",
- "webpack-cli": "^4.8.0",
- "webpack-merge": "5"
- },
- "babel": {
- "presets": [
- "./node_modules/shakapacker/package/babel/preset.js"
- ]
- },
- "devDependencies": {
- "prettier-plugin-sort-json": "^0.0.2",
- "webpack-dev-server": "4.9.0"
- },
- "resolutions": {
- "@types/retry": "~0.12.5",
- "autoprefixer": "~10.4.17",
- "mdn-data": "~2.0.30",
- "merge-descriptors": "~1.0.3"
- }
-}
diff --git a/postcss.config.js b/postcss.config.js
deleted file mode 100644
index bf276a7cb0..0000000000
--- a/postcss.config.js
+++ /dev/null
@@ -1,18 +0,0 @@
-module.exports = {
- plugins: {
- tailwindcss: {
-
- },
- autoprefixer: {},
- 'postcss-import': {},
- 'postcss-flexbugs-fixes':{
-
- },
- 'postcss-preset-env': {
- autoprefixer: {
- flexbox: "no-2009",
- },
- stage: 3
- }
- },
-};
diff --git a/vendor/javascript/.keep b/vendor/javascript/.keep
new file mode 100644
index 0000000000..e69de29bb2
diff --git a/vendor/javascript/@popperjs--core.js b/vendor/javascript/@popperjs--core.js
new file mode 100644
index 0000000000..4dc259b205
--- /dev/null
+++ b/vendor/javascript/@popperjs--core.js
@@ -0,0 +1,3 @@
+// @popperjs/core@2.11.8 downloaded from https://ga.jspm.io/npm:@popperjs/core@2.11.8/lib/index.js
+
+export{afterMain,afterRead,afterWrite,auto,basePlacements,beforeMain,beforeRead,beforeWrite,bottom,clippingParents,end,left,main,modifierPhases,placements,popper,read,reference,right,start,top,variationPlacements,viewport,write}from"./enums.js";import"./modifiers/index.js";export{c as createPopperBase,p as popperGenerator}from"../_/a0ba12d2.js";export{createPopper}from"./popper.js";export{createPopper as createPopperLite}from"./popper-lite.js";export{default as detectOverflow}from"./utils/detectOverflow.js";export{default as applyStyles}from"./modifiers/applyStyles.js";export{default as arrow}from"./modifiers/arrow.js";export{default as computeStyles}from"./modifiers/computeStyles.js";export{default as eventListeners}from"./modifiers/eventListeners.js";export{default as flip}from"./modifiers/flip.js";export{default as hide}from"./modifiers/hide.js";export{default as offset}from"./modifiers/offset.js";export{default as popperOffsets}from"./modifiers/popperOffsets.js";export{default as preventOverflow}from"./modifiers/preventOverflow.js";import"./dom-utils/getCompositeRect.js";import"../_/7a91f8b9.js";import"./dom-utils/instanceOf.js";import"./dom-utils/getWindow.js";import"../_/7742d4ca.js";import"../_/b8df2d1e.js";import"./dom-utils/getNodeScroll.js";import"./dom-utils/getWindowScroll.js";import"./dom-utils/getHTMLElementScroll.js";import"./dom-utils/getNodeName.js";import"./dom-utils/getWindowScrollBarX.js";import"./dom-utils/getDocumentElement.js";import"./dom-utils/isScrollParent.js";import"./dom-utils/getComputedStyle.js";import"./dom-utils/getLayoutRect.js";import"./dom-utils/listScrollParents.js";import"./dom-utils/getScrollParent.js";import"./dom-utils/getParentNode.js";import"./dom-utils/getOffsetParent.js";import"../_/084d303b.js";import"./dom-utils/getViewportRect.js";import"./dom-utils/getDocumentRect.js";import"../_/a9ca29ce.js";import"../_/bb24ce41.js";import"../_/2d19854a.js";import"../_/c7d11060.js";import"./utils/getMainAxisFromPlacement.js";import"../_/1ba79728.js";import"../_/6a201025.js";import"./utils/getOppositePlacement.js";import"./utils/getOppositeVariationPlacement.js";import"./utils/computeAutoPlacement.js";
diff --git a/lib/assets/javascripts/backbone.js b/vendor/javascript/backbone.js
similarity index 100%
rename from lib/assets/javascripts/backbone.js
rename to vendor/javascript/backbone.js
diff --git a/vendor/javascript/bootstrap-select.js b/vendor/javascript/bootstrap-select.js
new file mode 100644
index 0000000000..44b7431dd7
--- /dev/null
+++ b/vendor/javascript/bootstrap-select.js
@@ -0,0 +1,20 @@
+// bootstrap-select@1.14.0 downloaded from https://ga.jspm.io/npm:bootstrap-select@1.14.0-beta3/dist/js/bootstrap-select.js
+
+import*as e from"jquery";var t="default"in e?e.default:e;var i="undefined"!==typeof globalThis?globalThis:"undefined"!==typeof self?self:global;var s={};(function(e,i){void 0===e&&void 0!==window&&(e=window);s?s=i(t):i(e.jQuery)})(s,(function(e){(function(e){var t=["sanitize","whiteList","sanitizeFn"];var s=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"];var n=/^aria-[\w-]*$/i;var o={"*":["class","dir","id","lang","role","tabindex","style",n],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]};var l=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi;var r=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;var a=["title","placeholder"];function allowedAttribute(t,i){var n=t.nodeName.toLowerCase();if(-1!==e.inArray(n,i))return-1===e.inArray(n,s)||Boolean(t.nodeValue.match(l)||t.nodeValue.match(r));var o=e(i).filter((function(e,t){return t instanceof RegExp}));for(var a=0,c=o.length;a1?arguments[1]:void 0;var a=r?Number(r):0;a!=a&&(a=0);var c=Math.min(Math.max(a,0),n);if(l+c>n)return false;var d=-1;while(++d1){for(var s=0;s]+>/g,""));s&&(a=normalizeToBase(a));a=a.toUpperCase();o="function"===typeof i?i(a,t):"contains"===i?a.indexOf(t)>=0:a.startsWith(t);if(o)break}}return o}function toInteger(e){return parseInt(e,10)||0}var v={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"};var g=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g;var b="\\u0300-\\u036f",w="\\ufe20-\\ufe2f",k="\\u20d0-\\u20ff",I="\\u1ab0-\\u1aff",y="\\u1dc0-\\u1dff",x=b+w+k+I+y;var E="["+x+"]";var S=RegExp(E,"g");function deburrLetter(e){return v[e]}function normalizeToBase(e){e=e.toString();return e&&e.replace(g,deburrLetter).replace(S,"")}var $={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};var createEscaper=function(e){var escaper=function(t){return e[t]};var t="(?:"+Object.keys(e).join("|")+")";var i=RegExp(t);var s=RegExp(t,"g");return function(e){e=null==e?"":""+e;return i.test(e)?e.replace(s,escaper):e}};var O=createEscaper($);var C={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"};var A={ESCAPE:27,ENTER:13,SPACE:32,TAB:9,ARROW_UP:38,ARROW_DOWN:40};var T=window.Dropdown||bootstrap.Dropdown;function getVersion(){var t;try{t=e.fn.dropdown.Constructor.VERSION}catch(e){t=T.VERSION}return t}var z={success:false,major:"3"};try{z.full=(getVersion()||"").split(" ")[0].split(".");z.major=z.full[0];z.success=true}catch(e){}var D=0;var N=".bs.select";var L={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"};var H={MENU:"."+L.MENU,DATA_TOGGLE:'data-toggle="dropdown"'};var P={div:document.createElement("div"),span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" "),fragment:document.createDocumentFragment(),option:document.createElement("option")};P.selectedOption=P.option.cloneNode(false);P.selectedOption.setAttribute("selected",true);P.noResults=P.li.cloneNode(false);P.noResults.className="no-results";P.a.setAttribute("role","option");P.a.className="dropdown-item";P.subtext.className="text-muted";P.text=P.span.cloneNode(false);P.text.className="text";P.checkMark=P.span.cloneNode(false);var W=new RegExp(A.ARROW_UP+"|"+A.ARROW_DOWN);var R=new RegExp("^"+A.TAB+"$|"+A.ESCAPE);var M={li:function(e,t,i){var s=P.li.cloneNode(false);e&&(1===e.nodeType||11===e.nodeType?s.appendChild(e):s.innerHTML=e);"undefined"!==typeof t&&""!==t&&(s.className=t);"undefined"!==typeof i&&null!==i&&s.classList.add("optgroup-"+i);return s},a:function(e,t,i){var s=P.a.cloneNode(true);e&&(11===e.nodeType?s.appendChild(e):s.insertAdjacentHTML("beforeend",e));"undefined"!==typeof t&&""!==t&&s.classList.add.apply(s.classList,t.split(/\s+/));i&&s.setAttribute("style",i);return s},text:function(e,t){var s,n,o=P.text.cloneNode(false);if(e.content)o.innerHTML=e.content;else{o.textContent=e.text;if(e.icon){var l=P.whitespace.cloneNode(false);n=(true===t?P.i:P.span).cloneNode(false);n.className=(this||i).options.iconBase+" "+e.icon;P.fragment.appendChild(n);P.fragment.appendChild(l)}if(e.subtext){s=P.subtext.cloneNode(false);s.textContent=e.subtext;o.appendChild(s)}}if(true===t)while(o.childNodes.length>0)P.fragment.appendChild(o.childNodes[0]);else P.fragment.appendChild(o);return P.fragment},label:function(e){var t,s,n=P.text.cloneNode(false);n.innerHTML=e.display;if(e.icon){var o=P.whitespace.cloneNode(false);s=P.span.cloneNode(false);s.className=(this||i).options.iconBase+" "+e.icon;P.fragment.appendChild(s);P.fragment.appendChild(o)}if(e.subtext){t=P.subtext.cloneNode(false);t.textContent=e.subtext;n.appendChild(t)}P.fragment.appendChild(n);return P.fragment}};var B={fromOption:function(e,t){var i;switch(t){case"divider":i="true"===e.getAttribute("data-divider");break;case"text":i=e.textContent;break;case"label":i=e.label;break;case"style":i=e.style.cssText;break;case"title":i=e.title;break;default:i=e.getAttribute("data-"+toKebabCase(t));break}return i},fromDataSource:function(e,t){var i;switch(t){case"text":case"label":i=e.text||e.value||"";break;default:i=e[t];break}return i}};function showNoResults(e,t){if(!e.length){P.noResults.innerHTML=(this||i).options.noneResultsText.replace("{0}",'"'+O(t)+'"');(this||i).$menuInner[0].firstChild.appendChild(P.noResults)}}function filterHidden(e){return!(e.hidden||(this||i).options.hideDisabled&&e.disabled)}var Selectpicker=function(t,s){var n=this||i;if(!u.useDefault){e.valHooks.select.set=u._set;u.useDefault=true}(this||i).$element=e(t);(this||i).$newElement=null;(this||i).$button=null;(this||i).$menu=null;(this||i).options=s;(this||i).selectpicker={main:{data:[],optionQueue:P.fragment.cloneNode(false),hasMore:false},search:{data:[],hasMore:false},current:{},view:{},optionValuesDataMap:{},isSearching:false,keydown:{keyHistory:"",resetKeyHistory:{start:function(){return setTimeout((function(){n.selectpicker.keydown.keyHistory=""}),800)}}}};(this||i).sizeInfo={};var o=(this||i).options.windowPadding;"number"===typeof o&&((this||i).options.windowPadding=[o,o,o,o]);(this||i).val=Selectpicker.prototype.val;(this||i).render=Selectpicker.prototype.render;(this||i).refresh=Selectpicker.prototype.refresh;(this||i).setStyle=Selectpicker.prototype.setStyle;(this||i).selectAll=Selectpicker.prototype.selectAll;(this||i).deselectAll=Selectpicker.prototype.deselectAll;(this||i).destroy=Selectpicker.prototype.destroy;(this||i).remove=Selectpicker.prototype.remove;(this||i).show=Selectpicker.prototype.show;(this||i).hide=Selectpicker.prototype.hide;this.init()};Selectpicker.VERSION="1.14.0-beta3";Selectpicker.DEFAULTS={noneSelectedText:"Nothing selected",noneResultsText:"No results matched {0}",countSelectedText:function(e,t){return 1==e?"{0} item selected":"{0} items selected"},maxOptionsText:function(e,t){return[1==e?"Limit reached ({n} item max)":"Limit reached ({n} items max)",1==t?"Group limit reached ({n} item max)":"Group limit reached ({n} items max)"]},selectAllText:"Select All",deselectAllText:"Deselect All",source:{pageSize:40},chunkSize:40,doneButton:false,doneButtonText:"Close",multipleSeparator:", ",styleBase:"btn",style:L.BUTTONCLASS,size:"auto",title:null,placeholder:null,allowClear:false,selectedTextFormat:"values",width:false,container:false,hideDisabled:false,showSubtext:false,showIcon:true,showContent:true,dropupAuto:true,header:false,liveSearch:false,liveSearchPlaceholder:null,liveSearchNormalize:false,liveSearchStyle:"contains",actionsBox:false,iconBase:L.ICONBASE,tickIcon:L.TICKICON,showTick:false,template:{caret:''},maxOptions:false,mobile:false,selectOnTab:true,dropdownAlignRight:false,windowPadding:0,virtualScroll:600,display:false,sanitize:true,sanitizeFn:null,whiteList:o};Selectpicker.prototype={constructor:Selectpicker,init:function(){var t=this||i,s=(this||i).$element.attr("id"),n=(this||i).$element[0],o=n.form;D++;(this||i).selectId="bs-select-"+D;n.classList.add("bs-select-hidden");(this||i).multiple=(this||i).$element.prop("multiple");(this||i).autofocus=(this||i).$element.prop("autofocus");n.classList.contains("show-tick")&&((this||i).options.showTick=true);(this||i).$newElement=this.createDropdown();(this||i).$element.after((this||i).$newElement).prependTo((this||i).$newElement);if(o&&null===n.form){o.id||(o.id="form-"+(this||i).selectId);n.setAttribute("form",o.id)}(this||i).$button=(this||i).$newElement.children("button");(this||i).options.allowClear&&((this||i).$clearButton=(this||i).$button.children(".bs-select-clear-selected"));(this||i).$menu=(this||i).$newElement.children(H.MENU);(this||i).$menuInner=(this||i).$menu.children(".inner");(this||i).$searchbox=(this||i).$menu.find("input");n.classList.remove("bs-select-hidden");this.fetchData((function(){t.render(true);t.buildList();requestAnimationFrame((function(){t.$element.trigger("loaded"+N)}))}));true===(this||i).options.dropdownAlignRight&&(this||i).$menu[0].classList.add(L.MENURIGHT);"undefined"!==typeof s&&(this||i).$button.attr("data-id",s);this.checkDisabled();this.clickListener();z.major>4&&((this||i).dropdown=new T((this||i).$button[0]));if((this||i).options.liveSearch){this.liveSearchListener();(this||i).focusedParent=(this||i).$searchbox[0]}else(this||i).focusedParent=(this||i).$menuInner[0];this.setStyle();this.setWidth();(this||i).options.container?this.selectPosition():(this||i).$element.on("hide"+N,(function(){if(t.isVirtual()){var e=t.$menuInner[0],i=e.firstChild.cloneNode(false);e.replaceChild(i,e.firstChild);e.scrollTop=0}}));(this||i).$menu.data("this",this||i);(this||i).$newElement.data("this",this||i);(this||i).options.mobile&&this.mobile();(this||i).$newElement.on({"hide.bs.dropdown":function(e){t.$element.trigger("hide"+N,e)},"hidden.bs.dropdown":function(e){t.$element.trigger("hidden"+N,e)},"show.bs.dropdown":function(e){t.$element.trigger("show"+N,e)},"shown.bs.dropdown":function(e){t.$element.trigger("shown"+N,e)}});n.hasAttribute("required")&&(this||i).$element.on("invalid"+N,(function(){t.$button[0].classList.add("bs-invalid");t.$element.on("shown"+N+".invalid",(function(){t.$element.val(t.$element.val()).off("shown"+N+".invalid")})).on("rendered"+N,(function(){(this||i).validity.valid&&t.$button[0].classList.remove("bs-invalid");t.$element.off("rendered"+N)}));t.$button.on("blur"+N,(function(){t.$element.trigger("focus").trigger("blur");t.$button.off("blur"+N)}))}));o&&e(o).on("reset"+N,(function(){requestAnimationFrame((function(){t.render()}))}))},createDropdown:function(){var t=(this||i).multiple||(this||i).options.showTick?" show-tick":"",s=(this||i).multiple?' aria-multiselectable="true"':"",n="",o=(this||i).autofocus?" autofocus":"";z.major<4&&(this||i).$element.parent().hasClass("input-group")&&(n=" input-group-btn");var l,r="",a="",c="",d="",h="";(this||i).options.header&&(r='");(this||i).options.liveSearch&&(a='');(this||i).multiple&&(this||i).options.actionsBox&&(c=' ");(this||i).multiple&&(this||i).options.doneButton&&(d='");(this||i).options.allowClear&&(h='×');l='";return e(l)},setPositionData:function(){(this||i).selectpicker.view.canHighlight=[];(this||i).selectpicker.view.size=0;(this||i).selectpicker.view.firstHighlightIndex=false;for(var e=0;e<(this||i).selectpicker.current.data.length;e++){var t=(this||i).selectpicker.current.data[e],s=true;if("divider"===t.type){s=false;t.height=(this||i).sizeInfo.dividerHeight}else if("optgroup-label"===t.type){s=false;t.height=(this||i).sizeInfo.dropdownHeaderHeight}else t.height=(this||i).sizeInfo.liHeight;t.disabled&&(s=false);(this||i).selectpicker.view.canHighlight.push(s);if(s){(this||i).selectpicker.view.size++;t.posinset=(this||i).selectpicker.view.size;false===(this||i).selectpicker.view.firstHighlightIndex&&((this||i).selectpicker.view.firstHighlightIndex=e)}t.position=(0===e?0:(this||i).selectpicker.current.data[e-1].position)+t.height}},isVirtual:function(){return false!==(this||i).options.virtualScroll&&(this||i).selectpicker.main.data.length>=(this||i).options.virtualScroll||true===(this||i).options.virtualScroll},createView:function(t,s,n){var o=this||i,l=0;(this||i).selectpicker.isSearching=t;(this||i).selectpicker.current=t?(this||i).selectpicker.search:(this||i).selectpicker.main;this.setPositionData();if(s)if(n)l=(this||i).$menuInner[0].scrollTop;else if(!o.multiple){var r=o.$element[0],a=(r.options[r.selectedIndex]||{}).liIndex;if("number"===typeof a&&false!==o.options.size){var c=o.selectpicker.main.data[a],d=c&&c.position;d&&(l=d-(o.sizeInfo.menuInnerHeight+o.sizeInfo.liHeight)/2)}}scroll(l,true);(this||i).$menuInner.off("scroll.createView").on("scroll.createView",(function(e,t){o.noScroll||scroll((this||i).scrollTop,t);o.noScroll=false}));function scroll(e,i){var s,n,l,r,a,c,d,h,p=o.selectpicker.current.data.length,u=[],f=true,m=o.isVirtual();o.selectpicker.view.scrollTop=e;s=o.options.chunkSize;n=Math.ceil(p/s)||1;for(var v=0;vp-1?0:o.selectpicker.current.data[p-1].position-o.selectpicker.current.data[o.selectpicker.view.position1-1].position;k.firstChild.style.marginTop=b+"px";k.firstChild.style.marginBottom=w+"px"}else{k.firstChild.style.marginTop=0;k.firstChild.style.marginBottom=0}k.firstChild.appendChild(I);if(true===m&&o.sizeInfo.hasScrollBar){var A=k.firstChild.offsetWidth;if(i&&Ao.sizeInfo.selectWidth)k.firstChild.style.minWidth=o.sizeInfo.menuInnerInnerWidth+"px";else if(A>o.sizeInfo.menuInnerInnerWidth){o.$menu[0].style.minWidth=0;var T=k.firstChild.offsetWidth;if(T>o.sizeInfo.menuInnerInnerWidth){o.sizeInfo.menuInnerInnerWidth=T;k.firstChild.style.minWidth=o.sizeInfo.menuInnerInnerWidth+"px"}o.$menu[0].style.minWidth=""}}}if((!t&&o.options.source.data||t&&o.options.source.search)&&o.selectpicker.current.hasMore&&a===n-1&&e>0){var z=Math.floor(a*o.options.chunkSize/o.options.source.pageSize)+2;o.fetchData((function(){o.render();o.buildList(p,t);o.setPositionData();scroll(e)}),t?"search":"data",z,t?o.selectpicker.search.previousValue:void 0)}}o.prevActiveElement=o.activeElement;if(o.options.liveSearch){if(t&&i){var D,N=0;o.selectpicker.view.canHighlight[N]||(N=1+o.selectpicker.view.canHighlight.slice(1).indexOf(true));D=o.selectpicker.view.visibleElements[N];o.defocusItem(o.selectpicker.view.currentActive);o.activeElement=(o.selectpicker.current.data[N]||{}).element;o.focusItem(D)}}else o.$menuInner.trigger("focus")}e(window).off("resize"+N+"."+(this||i).selectId+".createView").on("resize"+N+"."+(this||i).selectId+".createView",(function(){var e=o.$newElement.hasClass(L.SHOW);e&&scroll(o.$menuInner[0].scrollTop)}))},focusItem:function(e,t,s){if(e){t=t||(this||i).selectpicker.current.data[(this||i).selectpicker.current.elements.indexOf((this||i).activeElement)];var n=e.firstChild;if(n){n.setAttribute("aria-setsize",(this||i).selectpicker.view.size);n.setAttribute("aria-posinset",t.posinset);if(true!==s){(this||i).focusedParent.setAttribute("aria-activedescendant",n.id);e.classList.add("active");n.classList.add("active")}}}},defocusItem:function(e){if(e){e.classList.remove("active");e.firstChild&&e.firstChild.classList.remove("active")}},setPlaceholder:function(){var e=this||i,t=false;if(((this||i).options.placeholder||(this||i).options.allowClear)&&!(this||i).multiple){(this||i).selectpicker.view.titleOption||((this||i).selectpicker.view.titleOption=document.createElement("option"));t=true;var s=(this||i).$element[0],n=false,o=!(this||i).selectpicker.view.titleOption.parentNode,l=s.selectedIndex,r=s.options[l],a=s.querySelector("select > *:not(:disabled)"),c=a?a.index:0,d=window.performance&&window.performance.getEntriesByType("navigation"),h=d&&d.length?"back_forward"!==d[0].type:2!==window.performance.navigation.type;if(o){(this||i).selectpicker.view.titleOption.className="bs-title-option";(this||i).selectpicker.view.titleOption.value="";n=!r||l===c&&false===r.defaultSelected&&void 0===(this||i).$element.data("selected")}(o||0!==(this||i).selectpicker.view.titleOption.index)&&s.insertBefore((this||i).selectpicker.view.titleOption,s.firstChild);n&&h?s.selectedIndex=0:"complete"!==document.readyState&&window.addEventListener("pageshow",(function(){e.selectpicker.view.displayedValue!==s.value&&e.render()}))}return t},fetchData:function(e,t,s,n){s=s||1;t=t||"data";var o,l=this||i,r=(this||i).options.source[t];if(r){(this||i).options.virtualScroll=true;if("function"===typeof r)r.call(this||i,(function(i,s,n){var r=l.selectpicker["search"===t?"search":"main"];r.hasMore=s;r.totalItems=n;o=l.buildData(i,t);e.call(l,o);l.$element.trigger("fetched"+N)}),s,n);else if(Array.isArray(r)){o=l.buildData(r,t);e.call(l,o)}}else{o=this.buildData(false,t);e.call(l,o)}},buildData:function(t,s){var n=this||i;var o=false===t?B.fromOption:B.fromDataSource;var l=':not([hidden]):not([data-hidden="true"]):not([style*="display: none"])',r=[],a=(this||i).selectpicker.main.data?(this||i).selectpicker.main.data.length:0,c=0,d=this.setPlaceholder()&&!t?1:0;"search"===s&&(a=(this||i).selectpicker.search.data.length);(this||i).options.hideDisabled&&(l+=":not(:disabled)");var h=t?t.filter(filterHidden,this||i):(this||i).$element[0].querySelectorAll("select > *"+l);function addDivider(e){var t=r[r.length-1];if(!t||"divider"!==t.type||!t.optID&&!e.optID){e=e||{};e.type="divider";r.push(e)}}function addOption(i,s){s=s||{};s.divider=o(i,"divider");if(true===s.divider)addDivider({optID:s.optID});else{var l=r.length+a,c=o(i,"style"),d=c?O(c):"",h=(i.className||"")+(s.optgroupClass||"");s.optID&&(h="opt "+h);s.optionClass=h.trim();s.inlineStyle=d;s.text=o(i,"text");s.title=o(i,"title");s.content=o(i,"content");s.tokens=o(i,"tokens");s.subtext=o(i,"subtext");s.icon=o(i,"icon");s.display=s.content||s.text;s.value=void 0===i.value?i.text:i.value;s.type="option";s.index=l;s.option=i.option?i.option:i;s.option.liIndex=l;s.selected=!!i.selected;s.disabled=s.disabled||!!i.disabled;false!==t&&(n.selectpicker.optionValuesDataMap[s.value]?s=e.extend(n.selectpicker.optionValuesDataMap[s.value],s):n.selectpicker.optionValuesDataMap[s.value]=s);r.push(s)}}function addOptgroup(e,s){var n=s[e],a=!(e-1l){l=n;s.selectpicker.view.widestOption=e[e.length-1]}}var r=e||0;for(var a=n.length,c=r;c li")},render:function(e){var t,s,n=this||i,o=(this||i).$element[0],l=this.setPlaceholder()&&0===o.selectedIndex,r=getSelectedOptions.call(this||i),a=r.length,c=getSelectValues.call(this||i,r),d=(this||i).$button[0],h=d.querySelector(".filter-option-inner-inner"),p=document.createTextNode((this||i).options.multipleSeparator),u=P.fragment.cloneNode(false),f=false;function createSelected(e){e.selected?n.createOption(e,true):e.children&&e.children.length&&e.children.map(createSelected)}if((this||i).options.source.data&&e){r.map(createSelected);o.appendChild((this||i).selectpicker.main.optionQueue);l&&(l=0===o.selectedIndex)}d.classList.toggle("bs-placeholder",n.multiple?!a:!c&&0!==c);n.multiple||1!==r.length||(n.selectpicker.view.displayedValue=c);if("static"===(this||i).options.selectedTextFormat)u=M.text.call(this||i,{text:(this||i).options.placeholder},true);else{t=(this||i).multiple&&-1!==(this||i).options.selectedTextFormat.indexOf("count")&&a>0;if(t){s=(this||i).options.selectedTextFormat.split(">");t=s.length>1&&a>s[1]||1===s.length&&a>=2}if(false===t){if(!l){for(var m=0;m0&&u.appendChild(p.cloneNode(false));if(v.title)g.text=v.title;else if(v.content&&n.options.showContent){g.content=v.content.toString();f=true}else{n.options.showIcon&&(g.icon=v.icon);n.options.showSubtext&&!n.multiple&&v.subtext&&(g.subtext=" "+v.subtext);g.text=v.text.trim()}u.appendChild(M.text.call(this||i,g,true))}}a>49&&u.appendChild(document.createTextNode("..."))}}else{var b=':not([hidden]):not([data-hidden="true"]):not([data-divider="true"]):not([style*="display: none"])';(this||i).options.hideDisabled&&(b+=":not(:disabled)");var w=(this||i).$element[0].querySelectorAll("select > option"+b+", optgroup"+b+" option"+b).length,k="function"===typeof(this||i).options.countSelectedText?(this||i).options.countSelectedText(a,w):(this||i).options.countSelectedText;u=M.text.call(this||i,{text:k.replace("{0}",a.toString()).replace("{1}",w.toString())},true)}}u.childNodes.length||(u=M.text.call(this||i,{text:(this||i).options.placeholder?(this||i).options.placeholder:(this||i).options.noneSelectedText},true));d.title=u.textContent.replace(/<[^>]*>?/g,"").trim();(this||i).options.sanitize&&f&&sanitizeHtml([u],n.options.whiteList,n.options.sanitizeFn);h.innerHTML="";h.appendChild(u);if(z.major<4&&(this||i).$newElement[0].classList.contains("bs3-has-addon")){var I=d.querySelector(".filter-expand"),y=h.cloneNode(true);y.className="filter-expand";I?d.replaceChild(y,I):d.appendChild(y)}(this||i).$element.trigger("rendered"+N)},
+/**
+ * @param [style]
+ * @param [status]
+ */
+setStyle:function(e,t){var s,n=(this||i).$button[0],o=(this||i).$newElement[0],l=(this||i).options.style.trim();(this||i).$element.attr("class")&&(this||i).$newElement.addClass((this||i).$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,""));if(z.major<4){o.classList.add("bs3");o.parentNode.classList&&o.parentNode.classList.contains("input-group")&&(o.previousElementSibling||o.nextElementSibling)&&(o.previousElementSibling||o.nextElementSibling).classList.contains("input-group-addon")&&o.classList.add("bs3-has-addon")}s=e?e.trim():l;if("add"==t)s&&n.classList.add.apply(n.classList,s.split(" "));else if("remove"==t)s&&n.classList.remove.apply(n.classList,s.split(" "));else{l&&n.classList.remove.apply(n.classList,l.split(" "));s&&n.classList.add.apply(n.classList,s.split(" "))}},liHeight:function(t){if(t||false!==(this||i).options.size&&!Object.keys((this||i).sizeInfo).length){var s,n=P.div.cloneNode(false),o=P.div.cloneNode(false),l=P.div.cloneNode(false),r=document.createElement("ul"),a=P.li.cloneNode(false),c=P.li.cloneNode(false),d=P.a.cloneNode(false),h=P.span.cloneNode(false),p=(this||i).options.header&&(this||i).$menu.find("."+L.POPOVERHEADER).length>0?(this||i).$menu.find("."+L.POPOVERHEADER)[0].cloneNode(true):null,u=(this||i).options.liveSearch?P.div.cloneNode(false):null,f=(this||i).options.actionsBox&&(this||i).multiple&&(this||i).$menu.find(".bs-actionsbox").length>0?(this||i).$menu.find(".bs-actionsbox")[0].cloneNode(true):null,m=(this||i).options.doneButton&&(this||i).multiple&&(this||i).$menu.find(".bs-donebutton").length>0?(this||i).$menu.find(".bs-donebutton")[0].cloneNode(true):null,v=(this||i).$element[0].options[0];(this||i).sizeInfo.selectWidth=(this||i).$newElement[0].offsetWidth;h.className="text";d.className="dropdown-item "+(v?v.className:"");n.className=(this||i).$menu[0].parentNode.className+" "+L.SHOW;n.style.width=0;"auto"===(this||i).options.width&&(o.style.minWidth=0);o.className=L.MENU+" "+L.SHOW;l.className="inner "+L.SHOW;r.className=L.MENU+" inner "+(z.major>="4"?L.SHOW:"");a.className=L.DIVIDER;c.className="dropdown-header";h.appendChild(document.createTextNode(""));if((this||i).selectpicker.current.data.length)for(var g=0;g<(this||i).selectpicker.current.data.length;g++){var b=(this||i).selectpicker.current.data[g];if("option"===b.type&&"none"!==e(b.element.firstChild).css("display")){s=b.element;break}}else{s=P.li.cloneNode(false);d.appendChild(h);s.appendChild(d)}c.appendChild(h.cloneNode(true));(this||i).selectpicker.view.widestOption&&r.appendChild((this||i).selectpicker.view.widestOption.cloneNode(true));r.appendChild(s);r.appendChild(a);r.appendChild(c);p&&o.appendChild(p);if(u){var w=document.createElement("input");u.className="bs-searchbox";w.className="form-control";u.appendChild(w);o.appendChild(u)}f&&o.appendChild(f);l.appendChild(r);o.appendChild(l);m&&o.appendChild(m);n.appendChild(o);document.body.appendChild(n);var k,I=s.offsetHeight,y=c?c.offsetHeight:0,x=p?p.offsetHeight:0,E=u?u.offsetHeight:0,S=f?f.offsetHeight:0,$=m?m.offsetHeight:0,O=e(a).outerHeight(true),C=window.getComputedStyle(o),A=o.offsetWidth,T={vert:toInteger(C.paddingTop)+toInteger(C.paddingBottom)+toInteger(C.borderTopWidth)+toInteger(C.borderBottomWidth),horiz:toInteger(C.paddingLeft)+toInteger(C.paddingRight)+toInteger(C.borderLeftWidth)+toInteger(C.borderRightWidth)},D={vert:T.vert+toInteger(C.marginTop)+toInteger(C.marginBottom)+2,horiz:T.horiz+toInteger(C.marginLeft)+toInteger(C.marginRight)+2};l.style.overflowY="scroll";k=o.offsetWidth-A;document.body.removeChild(n);(this||i).sizeInfo.liHeight=I;(this||i).sizeInfo.dropdownHeaderHeight=y;(this||i).sizeInfo.headerHeight=x;(this||i).sizeInfo.searchHeight=E;(this||i).sizeInfo.actionsHeight=S;(this||i).sizeInfo.doneButtonHeight=$;(this||i).sizeInfo.dividerHeight=O;(this||i).sizeInfo.menuPadding=T;(this||i).sizeInfo.menuExtras=D;(this||i).sizeInfo.menuWidth=A;(this||i).sizeInfo.menuInnerInnerWidth=A-T.horiz;(this||i).sizeInfo.totalMenuWidth=(this||i).sizeInfo.menuWidth;(this||i).sizeInfo.scrollBarWidth=k;(this||i).sizeInfo.selectHeight=(this||i).$newElement[0].offsetHeight;this.setPositionData()}},getSelectPosition:function(){var t,s=this||i,n=e(window),o=s.$newElement.offset(),l=e(s.options.container);if(s.options.container&&l.length&&!l.is("body")){t=l.offset();t.top+=parseInt(l.css("borderTopWidth"));t.left+=parseInt(l.css("borderLeftWidth"))}else t={top:0,left:0};var r=s.options.windowPadding;(this||i).sizeInfo.selectOffsetTop=o.top-t.top-n.scrollTop();(this||i).sizeInfo.selectOffsetBot=n.height()-(this||i).sizeInfo.selectOffsetTop-(this||i).sizeInfo.selectHeight-t.top-r[2];(this||i).sizeInfo.selectOffsetLeft=o.left-t.left-n.scrollLeft();(this||i).sizeInfo.selectOffsetRight=n.width()-(this||i).sizeInfo.selectOffsetLeft-(this||i).sizeInfo.selectWidth-t.left-r[1];(this||i).sizeInfo.selectOffsetTop-=r[0];(this||i).sizeInfo.selectOffsetLeft-=r[3]},setMenuSize:function(e){this.getSelectPosition();var t,s,n,o,l,r,a,c,d=(this||i).sizeInfo.selectWidth,h=(this||i).sizeInfo.liHeight,p=(this||i).sizeInfo.headerHeight,u=(this||i).sizeInfo.searchHeight,f=(this||i).sizeInfo.actionsHeight,m=(this||i).sizeInfo.doneButtonHeight,v=(this||i).sizeInfo.dividerHeight,g=(this||i).sizeInfo.menuPadding,b=0;if((this||i).options.dropupAuto){a=h*(this||i).selectpicker.current.data.length+g.vert;c=(this||i).sizeInfo.selectOffsetTop-(this||i).sizeInfo.selectOffsetBot>(this||i).sizeInfo.menuExtras.vert&&a+(this||i).sizeInfo.menuExtras.vert+50>(this||i).sizeInfo.selectOffsetBot;true===(this||i).selectpicker.isSearching&&(c=(this||i).selectpicker.dropup);(this||i).$newElement.toggleClass(L.DROPUP,c);(this||i).selectpicker.dropup=c}if("auto"===(this||i).options.size){o=(this||i).selectpicker.current.data.length>3?3*(this||i).sizeInfo.liHeight+(this||i).sizeInfo.menuExtras.vert-2:0;s=(this||i).sizeInfo.selectOffsetBot-(this||i).sizeInfo.menuExtras.vert;n=o+p+u+f+m;r=Math.max(o-g.vert,0);(this||i).$newElement.hasClass(L.DROPUP)&&(s=(this||i).sizeInfo.selectOffsetTop-(this||i).sizeInfo.menuExtras.vert);l=s;t=s-p-u-f-m-g.vert}else if((this||i).options.size&&"auto"!=(this||i).options.size&&(this||i).selectpicker.current.elements.length>(this||i).options.size){for(var w=0;w<(this||i).options.size;w++)"divider"===(this||i).selectpicker.current.data[w].type&&b++;s=h*(this||i).options.size+b*v+g.vert;t=s-g.vert;l=s+p+u+f+m;n=r=""}(this||i).$menu.css({"max-height":l+"px",overflow:"hidden","min-height":n+"px"});(this||i).$menuInner.css({"max-height":t+"px",overflow:"hidden auto","min-height":r+"px"});(this||i).sizeInfo.menuInnerHeight=Math.max(t,1);if((this||i).selectpicker.current.data.length&&(this||i).selectpicker.current.data[(this||i).selectpicker.current.data.length-1].position>(this||i).sizeInfo.menuInnerHeight){(this||i).sizeInfo.hasScrollBar=true;(this||i).sizeInfo.totalMenuWidth=(this||i).sizeInfo.menuWidth+(this||i).sizeInfo.scrollBarWidth}"auto"===(this||i).options.dropdownAlignRight&&(this||i).$menu.toggleClass(L.MENURIGHT,(this||i).sizeInfo.selectOffsetLeft>(this||i).sizeInfo.selectOffsetRight&&(this||i).sizeInfo.selectOffsetRight<(this||i).sizeInfo.totalMenuWidth-d);(this||i).dropdown&&(this||i).dropdown._popper&&(this||i).dropdown._popper.update()},setSize:function(t){this.liHeight(t);(this||i).options.header&&(this||i).$menu.css("padding-top",0);if(false!==(this||i).options.size){var s=this||i,n=e(window);this.setMenuSize();(this||i).options.liveSearch&&(this||i).$searchbox.off("input.setMenuSize propertychange.setMenuSize").on("input.setMenuSize propertychange.setMenuSize",(function(){return s.setMenuSize()}));"auto"===(this||i).options.size?n.off("resize"+N+"."+(this||i).selectId+".setMenuSize scroll"+N+"."+(this||i).selectId+".setMenuSize").on("resize"+N+"."+(this||i).selectId+".setMenuSize scroll"+N+"."+(this||i).selectId+".setMenuSize",(function(){return s.setMenuSize()})):(this||i).options.size&&"auto"!=(this||i).options.size&&(this||i).selectpicker.current.elements.length>(this||i).options.size&&n.off("resize"+N+"."+(this||i).selectId+".setMenuSize scroll"+N+"."+(this||i).selectId+".setMenuSize")}this.createView(false,true,t)},setWidth:function(){var e=this||i;if("auto"===(this||i).options.width)requestAnimationFrame((function(){e.$menu.css("min-width","0");e.$element.on("loaded"+N,(function(){e.liHeight();e.setMenuSize();var t=e.$newElement.clone().appendTo("body"),i=t.css("width","auto").children("button").outerWidth();t.remove();e.sizeInfo.selectWidth=Math.max(e.sizeInfo.totalMenuWidth,i);e.$newElement.css("width",e.sizeInfo.selectWidth+"px")}))}));else if("fit"===(this||i).options.width){(this||i).$menu.css("min-width","");(this||i).$newElement.css("width","").addClass("fit-width")}else if((this||i).options.width){(this||i).$menu.css("min-width","");(this||i).$newElement.css("width",(this||i).options.width)}else{(this||i).$menu.css("min-width","");(this||i).$newElement.css("width","")}(this||i).$newElement.hasClass("fit-width")&&"fit"!==(this||i).options.width&&(this||i).$newElement[0].classList.remove("fit-width")},selectPosition:function(){(this||i).$bsContainer=e('');var t,s,n,o=this||i,l=e((this||i).options.container),getPlacement=function(i){var r={},a=o.options.display||!!e.fn.dropdown.Constructor.Default&&e.fn.dropdown.Constructor.Default.display;o.$bsContainer.addClass(i.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(L.DROPUP,i.hasClass(L.DROPUP));t=i.offset();if(l.is("body"))s={top:0,left:0};else{s=l.offset();s.top+=parseInt(l.css("borderTopWidth"))-l.scrollTop();s.left+=parseInt(l.css("borderLeftWidth"))-l.scrollLeft()}n=i.hasClass(L.DROPUP)?0:i[0].offsetHeight;if(z.major<4||"static"===a){r.top=t.top-s.top+n;r.left=t.left-s.left}r.width=i[0].offsetWidth;o.$bsContainer.css(r)};(this||i).$button.on("click.bs.dropdown.data-api",(function(){if(!o.isDisabled()){getPlacement(o.$newElement);o.$bsContainer.appendTo(o.options.container).toggleClass(L.SHOW,!o.$button.hasClass(L.SHOW)).append(o.$menu)}}));e(window).off("resize"+N+"."+(this||i).selectId+" scroll"+N+"."+(this||i).selectId).on("resize"+N+"."+(this||i).selectId+" scroll"+N+"."+(this||i).selectId,(function(){var e=o.$newElement.hasClass(L.SHOW);e&&getPlacement(o.$newElement)}));(this||i).$element.on("hide"+N,(function(){o.$menu.data("height",o.$menu.height());o.$bsContainer.detach()}))},createOption:function(e,t){var s=e.option?e.option:e;if(s&&1!==s.nodeType){var n=(t?P.selectedOption:P.option).cloneNode(true);void 0!==s.value&&(n.value=s.value);n.textContent=s.text;n.selected=true;void 0!==s.liIndex?n.liIndex=s.liIndex:t||(n.liIndex=e.index);e.option=n;(this||i).selectpicker.main.optionQueue.appendChild(n)}},setOptionStatus:function(e){var t=this||i;t.noScroll=false;if(t.selectpicker.view.visibleElements&&t.selectpicker.view.visibleElements.length){for(var s=0;s="4"&&t.classList.toggle(L.DISABLED,i);if(i){t.setAttribute("aria-disabled",i);t.setAttribute("tabindex",-1)}else{t.removeAttribute("aria-disabled");t.setAttribute("tabindex",0)}}}},isDisabled:function(){return(this||i).$element[0].disabled},checkDisabled:function(){if(this.isDisabled()){(this||i).$newElement[0].classList.add(L.DISABLED);(this||i).$button.addClass(L.DISABLED).attr("aria-disabled",true)}else if((this||i).$button[0].classList.contains(L.DISABLED)){(this||i).$newElement[0].classList.remove(L.DISABLED);(this||i).$button.removeClass(L.DISABLED).attr("aria-disabled",false)}},clickListener:function(){var t=this||i,s=e(document);s.data("spaceSelect",false);(this||i).$button.on("keyup",(function(e){if(/(32)/.test(e.keyCode.toString(10))&&s.data("spaceSelect")){e.preventDefault();s.data("spaceSelect",false)}}));(this||i).$newElement.on("show.bs.dropdown",(function(){if(!t.dropdown&&"4"===z.major){t.dropdown=t.$button.data("bs.dropdown");t.dropdown._menu=t.$menu[0]}}));function clearSelection(e){if(t.multiple)t.deselectAll();else{var i=t.$element[0],s=i.value,n=i.selectedIndex,o=i.options[n],l=!!o&&t.selectpicker.main.data[o.liIndex];l&&t.setSelected(l,false);i.selectedIndex=0;f=[n,false,s];t.$element.triggerNative("change")}if(t.$newElement.hasClass(L.SHOW)){t.options.liveSearch&&t.$searchbox.trigger("focus");t.createView(false)}}(this||i).$button.on("click.bs.dropdown.data-api",(function(e){if(t.options.allowClear){var i=e.target,s=t.$clearButton[0];/MSIE|Trident/.test(window.navigator.userAgent)&&(i=document.elementFromPoint(e.clientX,e.clientY));if(i===s||i.parentElement===s){e.stopImmediatePropagation();clearSelection(e)}}t.$newElement.hasClass(L.SHOW)||t.setSize()}));function setFocus(){t.options.liveSearch?t.$searchbox.trigger("focus"):t.$menuInner.trigger("focus")}function checkPopperExists(){t.dropdown&&t.dropdown._popper&&t.dropdown._popper.state?setFocus():requestAnimationFrame(checkPopperExists)}(this||i).$element.on("shown"+N,(function(){t.$menuInner[0].scrollTop!==t.selectpicker.view.scrollTop&&(t.$menuInner[0].scrollTop=t.selectpicker.view.scrollTop);z.major>3?requestAnimationFrame(checkPopperExists):setFocus()}));(this||i).$menuInner.on("mouseenter","li a",(function(e){var s=(this||i).parentElement,n=t.isVirtual()?t.selectpicker.view.position0:0,o=Array.prototype.indexOf.call(s.parentElement.children,s),l=t.selectpicker.current.data[o+n];t.focusItem(s,l,true)}));(this||i).$menuInner.on("click","li a",(function(s,n){var o=e(this||i),l=t.$element[0],r=t.isVirtual()?t.selectpicker.view.position0:0,a=t.selectpicker.current.data[o.parent().index()+r],c=a.element,d=getSelectValues.call(t),h=l.selectedIndex,p=l.options[h],u=!!p&&t.selectpicker.main.data[p.liIndex],m=true;t.multiple&&1!==t.options.maxOptions&&s.stopPropagation();s.preventDefault();if(!t.isDisabled()&&!o.parent().hasClass(L.DISABLED)){var v=a.option,g=e(v),b=v.selected,w=t.selectpicker.current.data.find((function(e){return e.optID===a.optID&&"optgroup-label"===e.type})),k=w?w.optgroup:void 0,I=k instanceof Element?B.fromOption:B.fromDataSource,y=k&&k.children,x=parseInt(t.options.maxOptions),E=k&&parseInt(I(k,"maxOptions"))||false;c===t.activeElement&&(n=true);if(!n){t.prevActiveElement=t.activeElement;t.activeElement=void 0}if(t.multiple&&1!==x){t.setSelected(a,!b);t.focusedParent.focus();if(false!==x||false!==E){var S=x');
+/** @deprecated */if(z[2]){D=D.replace("{var}",z[2][x>1?0:1]);H=H.replace("{var}",z[2][E>1?0:1])}t.$menu.append(P);if(x&&S){P.append(e("
"));m=false;t.$element.trigger("maxReachedGrp"+N)}setTimeout((function(){t.setSelected(a,false)}),10);P[0].classList.add("fadeOut");setTimeout((function(){P.remove()}),1050)}}}else{u&&t.setSelected(u,false);t.setSelected(a,true)}t.options.source.data&&t.$element[0].appendChild(t.selectpicker.main.optionQueue);!t.multiple||t.multiple&&1===t.options.maxOptions?t.$button.trigger("focus"):t.options.liveSearch&&t.$searchbox.trigger("focus");if(m&&(t.multiple||h!==l.selectedIndex)){f=[v.index,g.prop("selected"),d];t.$element.triggerNative("change")}}}));(this||i).$menu.on("click","li."+L.DISABLED+" a, ."+L.POPOVERHEADER+", ."+L.POPOVERHEADER+" :not(.close)",(function(s){if(s.currentTarget==(this||i)){s.preventDefault();s.stopPropagation();t.options.liveSearch&&!e(s.target).hasClass("close")?t.$searchbox.trigger("focus"):t.$button.trigger("focus")}}));(this||i).$menuInner.on("click",".divider, .dropdown-header",(function(e){e.preventDefault();e.stopPropagation();t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus")}));(this||i).$menu.on("click","."+L.POPOVERHEADER+" .close",(function(){t.$button.trigger("click")}));(this||i).$searchbox.on("click",(function(e){e.stopPropagation()}));(this||i).$menu.on("click",".actions-btn",(function(s){t.options.liveSearch?t.$searchbox.trigger("focus"):t.$button.trigger("focus");s.preventDefault();s.stopPropagation();e(this||i).hasClass("bs-select-all")?t.selectAll():t.deselectAll()}));(this||i).$button.on("focus"+N,(function(e){var i=t.$element[0].getAttribute("tabindex");if(void 0!==i&&e.originalEvent&&e.originalEvent.isTrusted){this.setAttribute("tabindex",i);t.$element[0].setAttribute("tabindex",-1);t.selectpicker.view.tabindex=i}})).on("blur"+N,(function(e){if(void 0!==t.selectpicker.view.tabindex&&e.originalEvent&&e.originalEvent.isTrusted){t.$element[0].setAttribute("tabindex",t.selectpicker.view.tabindex);this.setAttribute("tabindex",-1);t.selectpicker.view.tabindex=void 0}}));(this||i).$element.on("change"+N,(function(){t.render();t.$element.trigger("changed"+N,f);f=null})).on("focus"+N,(function(){t.options.mobile||t.$button[0].focus()}))},liveSearchListener:function(){var e=this||i;(this||i).$button.on("click.bs.dropdown.data-api",(function(){if(!!e.$searchbox.val()){e.$searchbox.val("");e.selectpicker.search.previousValue=void 0}}));(this||i).$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",(function(e){e.stopPropagation()}));(this||i).$searchbox.on("input propertychange",(function(){var t=e.$searchbox[0].value;e.selectpicker.search.elements=[];e.selectpicker.search.data=[];if(t){e.selectpicker.search.previousValue=t;if(e.options.source.search)e.fetchData((function(i){e.render();e.buildList(void 0,true);e.noScroll=true;e.$menuInner.scrollTop(0);e.createView(true);showNoResults.call(e,i,t)}),"search",0,t);else{var i=[],s=t.toUpperCase(),n={},o=[],l=e._searchStyle(),r=e.options.liveSearchNormalize;r&&(s=normalizeToBase(s));for(var a=0;a