diff --git a/README.md b/README.md
index fe5068c..ef15898 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,97 @@
-# fsms
-Effect for any WordPress search input that morphs into a fullscreen overlay.
+# Full Screen Morphing Search
+Contributors: lebcit
+Tags: search, full screen search, morphing search, search overlay, jQuery UI autocomplete
+Requires at least: 4.6
+Tested up to: 4.9.8
+Requires PHP: 5.6
+Stable tag: 2.0
+License: GPLv2 or later
+License URI: https://www.gnu.org/licenses/gpl-2.0.html
+
+Responsive Full Screen Morphing Search Page Overlay With Predictive Autocomplete !
+
+## Description
+
+### Full Screen Morphing Search
+
+Effect for any WordPress search input that morphs into a fullscreen overlay.
+Enlarge the search input and show 5 most recent posts, 5 most used categories and tags with counter.
+Once the input is clicked, the whole search element expands to a fullscreen overlay.
+The fullscreen overlay has a bigger search input.
+
+There are no settings for this plugin. Simply activate it, click on any search input and see the magic happens !
+**PLEASE, MAKE SURE TO HAVE AT LEAST ONE POST WITH ONE CATEGORY AND ONE TAG BEFORE ACTIVATING**
+
+**As of version 2.0**, head over the Customizer, look for **FSMS Plugin**, design it as you want !
+
+Don't forget to take a look at the FAQ Section.
+If you have some issues **don't hesitate**, head over to the Support Section !
+You can also visit my site LebCit.Tk to see the plugin in action and leave your comments.
+If you use this plugin, please consider leaving a Review to give me a push forward ;)
+
+## Credits
+
+This plugin is created by Manoela Ilic .
+If you want to learn more about this plugin, visit the Simple Morphing Search original post.
+> A Picture is worth a thousand words
+
+I think that a demo is even better !
+See how Full Screen Morphing Search works.
+
+The jQuery UI autocompletition implemented in this plugin is based on Dominykas Gelucevičius post :
+How to create a jQuery autocomplete drop down in WordPress
+
+The main plugin icon is made by Pixel Buddha from www.flaticon.com and is licensed by CC 3.0 BY
+The article icon is made by Freepik from www.flaticon.com and is licensed by CC 3.0 BY
+The category icon is made by Freepik from www.flaticon.com and is licensed by CC 3.0 BY
+The tag icon is made by Freepik from www.flaticon.com and is licensed by CC 3.0 BY
+
+## Installation
+
+### How to install the plugin and get it working.
+
+1. Install Full Screen Morphing Search plugin through the WordPress plugins screen directly.
+2. Make sure to have at least one post with one category and one tag before activating.
+3. Activate the plugin through the 'Plugins' screen in WordPress.
+4. Navigate to your site and click on any search input and see the magic happens !
+5. In the Customizer, look for **FSMS Plugin**, design it as you want !
+
+## Frequently Asked Questions
+
+### Recent posts thumbnails are not round !
+
+You will have to use a thumbnail regenerator.
+I recommend Regenerate Thumbnails .
+
+### The overlay is not covering the whole page !
+If your theme has some boxed style(s), like Twenty Sixteen or Twenty Twelve,
+the overlay will only cover the inside box (the site content) !
+
+### Autocomplete predicts only posts and pages !
+Yes, just for now !
+I'll be adding some more cool functions with time.
+
+## Screenshots
+
+1. As you can see, their is a search form a close button and three columns.
+The first column shows the most 5 recent posts.
+The second column shows the top 5 used categories and how many posts each category has.
+The third column shows the top 5 used tags and how many posts each tag has.
+
+## Changelog
+
+### 2.0 =
+* Plugin rewritten from ground up.
+
+### 1.2.1 =
+* Tested up to version 4.9.4 of WordPress.
+
+### 1.2 =
+* Added Predictive Autocomplete For Pages.
+* Added Press Escape Key To Close Search Overlay.
+
+### 1.1 =
+* Added Predictive Autocomplete For Posts.
+
+### 1.0 =
+* Initial release.
\ No newline at end of file
diff --git a/assets/css/full-screen-morphing-search.css b/assets/css/full-screen-morphing-search.css
new file mode 100644
index 0000000..3233dca
--- /dev/null
+++ b/assets/css/full-screen-morphing-search.css
@@ -0,0 +1,385 @@
+/**
+* Morphing Search Page Styles
+*/
+
+/* 1- hide the main div (
) containing the Morphing Search Page */
+
+.morphsearch {
+ visibility: hidden;
+ width: 100%;
+ height: 100%;
+ background: #f1f1f1;
+ position: absolute;
+ z-index: 9;
+ top: 0;
+ right: 0;
+ -webkit-transform-origin: 100% 0;
+ transform-origin: 100% 0;
+ -webkit-transition-property: min-height, width, top, right;
+ transition-property: min-height, width, top, right;
+ -webkit-transition-duration: 0.5s;
+ transition-duration: 0.5s;
+ -webkit-transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
+ transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
+}
+
+/* 2- Showing the Morphing Search Page once the .open class is added to the main div */
+
+.morphsearch.open {
+ visibility: visible;
+ opacity: 1;
+ width: 100%;
+ min-height: 100%;
+ top: 0px;
+ right: 0px;
+}
+
+/* Morphing Search Page Search Form */
+
+.morphsearch-form {
+ width: 100%;
+ height: 40px;
+ margin: 0 auto;
+ position: relative;
+ -webkit-transition-property: width, height, -webkit-transform;
+ transition-property: width, height, transform;
+ -webkit-transition-duration: 0.5s;
+ transition-duration: 0.5s;
+ -webkit-transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
+ transition-timing-function: cubic-bezier(0.7, 0, 0.3, 1);
+}
+
+.morphsearch.open .morphsearch-form {
+ width: 80%;
+ height: 160px;
+ -webkit-transform: translate3d(0, 3em, 0);
+ transform: translate3d(0, 3em, 0);
+}
+
+/* Morphing Search Page Search Input */
+
+.morphsearch-input {
+ width: 100%;
+ height: 100%;
+ padding: 0 10% 0 10px !important;
+ font-weight: 700;
+ border: none !important;
+ background: transparent !important;
+ font-size: 0.8em;
+ color: #ec5a62 !important;
+ -webkit-transition: font-size 0.5s cubic-bezier(0.7, 0, 0.3, 1);
+ transition: font-size 0.5s cubic-bezier(0.7, 0, 0.3, 1);
+}
+
+.morphsearch-input::-ms-clear {
+ /* remove cross in IE */
+ display: none;
+}
+
+.morphsearch.open .morphsearch-input {
+ font-size: 7em;
+}
+
+/* Morphing Search Page Search Placeholder */
+
+.morphsearch-input::-webkit-input-placeholder {
+ color: #c2c2c2;
+}
+
+.morphsearch-input:-moz-placeholder {
+ color: #c2c2c2;
+}
+
+.morphsearch-input::-moz-placeholder {
+ color: #c2c2c2;
+}
+
+.morphsearch-input:-ms-input-placeholder {
+ color: #c2c2c2;
+}
+
+/* hide placeholder when active in Chrome */
+
+.gn-search:focus::-webkit-input-placeholder {
+ color: transparent;
+}
+
+input[type="search"] {
+ /* reset normalize */
+ -webkit-box-sizing: border-box;
+ box-sizing: border-box;
+}
+
+/* Morphing Search Page Submit Button */
+
+.morphsearch-input:focus, .morphsearch-submit:focus {
+ outline: none;
+ background: transparent;
+ border: none;
+}
+
+.morphsearch-submit {
+ display: grid;
+ position: absolute;
+ width: 80px;
+ height: 80px;
+ padding: 0;
+ text-indent: 100px;
+ overflow: hidden;
+ right: 0;
+ top: 50%;
+ background: transparent;
+ background-size: 100%;
+ border: none;
+ pointer-events: none;
+ transform-origin: 50% 50%;
+ opacity: 0;
+ -webkit-transform: translate3d(-30px, -50%, 0) scale3d(0, 0, 1);
+ transform: translate3d(-30px, -50%, 0) scale3d(0, 0, 1);
+ box-shadow: none;
+}
+
+.morphsearch.open .morphsearch-submit {
+ pointer-events: auto;
+ opacity: 1;
+ -webkit-transform: translate3d(-30px, -50%, 0) scale3d(1, 1, 1);
+ transform: translate3d(-30px, -50%, 0) scale3d(1, 1, 1);
+ -webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
+ transition: opacity 0.3s, transform 0.3s;
+ -webkit-transition-delay: 0.5s;
+ transition-delay: 0.5s;
+}
+
+.morphsearch-submit:hover {
+ background-color: transparent;
+ box-shadow: none;
+}
+
+/* 3- Hidding the Morphing Search Page once the .close class is added to the main div */
+
+.morphsearch-close {
+ width: 36px;
+ height: 36px;
+ position: absolute;
+ right: 1em;
+ top: 1em;
+ overflow: hidden;
+ text-indent: 100%;
+ cursor: pointer;
+ pointer-events: none;
+ opacity: 0;
+ -webkit-transform: scale3d(0, 0, 1);
+ transform: scale3d(0, 0, 1);
+}
+
+.morphsearch.open .morphsearch-close {
+ opacity: 1;
+ pointer-events: auto;
+ -webkit-transform: scale3d(1, 1, 1);
+ transform: scale3d(1, 1, 1);
+ -webkit-transition: opacity 0.3s, -webkit-transform 0.3s;
+ transition: opacity 0.3s, transform 0.3s;
+ -webkit-transition-delay: 0.5s;
+ transition-delay: 0.5s;
+}
+
+.morphsearch-close::before, .morphsearch-close::after {
+ content: '';
+ position: absolute;
+ width: 2px;
+ height: 100%;
+ top: 0;
+ left: 50%;
+ border-radius: 3px;
+ opacity: 0.5;
+ background: #000;
+}
+
+.morphsearch-close:hover.morphsearch-close::before, .morphsearch-close:hover.morphsearch-close::after {
+ opacity: 1;
+}
+
+.morphsearch-close::before {
+ -webkit-transform: rotate(45deg);
+ transform: rotate(45deg);
+}
+
+.morphsearch-close::after {
+ -webkit-transform: rotate(-45deg);
+ transform: rotate(-45deg);
+}
+
+.morphsearch-content {
+ color: #333;
+ margin-top: 4.5em;
+ width: 100%;
+ height: 0;
+ overflow: hidden;
+ padding: 0 10.5%;
+ background: #f1f1f1;
+ position: absolute;
+ pointer-events: none;
+ opacity: 0;
+}
+
+/* Morphing Search Page Content */
+
+.morphsearch.open .morphsearch-content {
+ opacity: 1;
+ height: auto;
+ overflow: visible;
+ /* this breaks the transition of the children in FF: https://bugzilla.mozilla.org/show_bug.cgi?id=625289 */
+ pointer-events: auto;
+ -webkit-transition: opacity 0.3s 0.5s;
+ transition: opacity 0.3s 0.5s;
+}
+
+.dummy-column {
+ width: 30%;
+ padding: 0 0 6em;
+ float: left;
+ opacity: 0;
+ -webkit-transform: translate3d(0, 100px, 0);
+ transform: translateY(100px);
+ -webkit-transition: -webkit-transform 0.5s, opacity 0.5s;
+ transition: transform 0.5s, opacity 0.5s;
+}
+
+.morphsearch.open .dummy-column:first-child {
+ -webkit-transition-delay: 0.4s;
+ transition-delay: 0.4s;
+}
+
+.morphsearch.open .dummy-column:nth-child(2) {
+ -webkit-transition-delay: 0.45s;
+ transition-delay: 0.45s;
+}
+
+.morphsearch.open .dummy-column:nth-child(3) {
+ -webkit-transition-delay: 0.5s;
+ transition-delay: 0.5s;
+}
+
+.morphsearch.open .dummy-column {
+ opacity: 1;
+ -webkit-transform: translate3d(0, 0, 0);
+ transform: translate3d(0, 0, 0);
+}
+
+.dummy-column:nth-child(2) {
+ margin: 0 5%;
+}
+
+.dummy-column h2 {
+ font-size: 1em;
+ letter-spacing: 1px;
+ text-transform: uppercase;
+ font-weight: 800;
+ color: #c2c2c2;
+ padding: 0.5em 0;
+}
+
+.round {
+ border-radius: 50%;
+}
+
+.dummy-media-object {
+ padding: 0.75em;
+ display: block;
+ margin: 0.3em 0;
+ cursor: pointer;
+ border-radius: 5px;
+ background: rgba(118, 117, 128, 0.05);
+}
+
+.dummy-media-object:hover, .dummy-media-object:focus {
+ background: rgba(118, 117, 128, 0.1);
+}
+
+.dummy-media-object img {
+ display: inline-block;
+ width: 50px;
+ margin: 0 10px 0 0;
+ vertical-align: middle;
+}
+
+.dummy-media-object h3 {
+ vertical-align: middle;
+ font-size: 0.85em;
+ display: inline-block;
+ font-weight: 700;
+ margin: 0 0 0 0;
+ width: calc(100% - 70px);
+ color: rgba(145, 145, 145, 0.7);
+}
+
+.dummy-media-object h3 a {
+ color: rgba(145, 145, 145, 0.7);
+}
+
+.dummy-media-object:hover h3 a {
+ color: rgba(236, 90, 98, 1);
+}
+
+/* Morphing Search Page Media Queries */
+
+@media screen and (max-width: 53.125em) {
+ .morphsearch-input {
+ padding: 0 25% 0 10px;
+ }
+ .morphsearch.open .morphsearch-input {
+ font-size: 2em;
+ }
+ .dummy-column {
+ float: none;
+ width: auto;
+ padding: 0 0 2em;
+ }
+ .dummy-column:nth-child(2) {
+ margin: 0;
+ }
+ .morphsearch.open .morphsearch-submit {
+ -webkit-transform: translate3d(0, -50%, 0) scale3d(0.5, 0.5, 1);
+ transform: translate3d(0, -50%, 0) scale3d(0.5, 0.5, 1);
+ }
+}
+
+@media screen and (max-width: 80em) {
+ .morphsearch-close {
+ top: 3em;
+ }
+}
+
+@media screen and (min-width: 38.75em) {
+ body {
+ position: relative;
+ }
+ .morphsearch.open {
+ height: 100%;
+ }
+}
+
+@media screen and (min-height: 71.5625em) {
+ .morphsearch.open {
+ height: 100% !important;
+ }
+}
+
+/* Autocomplete dropdown box styles */
+
+.ui-autocomplete {
+ width: 80% !important;
+ overflow-wrap: break-word;
+ box-shadow: 2px 2px 3px #888888;
+ background: #FFF;
+ z-index: 10;
+}
+
+.ui-menu-item {
+ list-style-type: none;
+ padding: 10px;
+}
+
+.ui-menu-item:hover {
+ background: #F1F1F1;
+}
\ No newline at end of file
diff --git a/assets/img/article.png b/assets/img/article.png
new file mode 100644
index 0000000..0769b03
Binary files /dev/null and b/assets/img/article.png differ
diff --git a/assets/img/category.png b/assets/img/category.png
new file mode 100644
index 0000000..d040ba8
Binary files /dev/null and b/assets/img/category.png differ
diff --git a/assets/img/magnifier.svg b/assets/img/magnifier.svg
new file mode 100644
index 0000000..d478157
--- /dev/null
+++ b/assets/img/magnifier.svg
@@ -0,0 +1,7 @@
+
+
+
+
+
+
diff --git a/assets/img/tag.png b/assets/img/tag.png
new file mode 100644
index 0000000..d799636
Binary files /dev/null and b/assets/img/tag.png differ
diff --git a/assets/js/full-screen-morphing-search.js b/assets/js/full-screen-morphing-search.js
new file mode 100644
index 0000000..ac7cac5
--- /dev/null
+++ b/assets/js/full-screen-morphing-search.js
@@ -0,0 +1,34 @@
+// When the document is ready...
+jQuery(document).ready(function ($) {
+
+ // Display the Full Screen search when The user focuses on a search field
+ $('form[role=search] input').on('focus', function (event) {
+ // Prevent the default action
+ event.preventDefault();
+
+ // Display the Morphing Search Page
+ $('.morphsearch').addClass('open');
+
+ // Focus on the Morphing Search Input Field
+ $('.morphsearch input.morphsearch-input').focus();
+ });
+
+ // Hide the Morphing Search Page when the user clicks the close span
+ $('.morphsearch span.morphsearch-close').on('click', function (event) {
+ // Prevent the default event
+ event.preventDefault();
+
+ // Hide the Morphing Search Page
+ $('.morphsearch').removeClass('open');
+ });
+
+ // Hide the Morphing Search Page when the user press on the Escape key
+ $('.morphsearch').on('keydown', function (event) {
+ if (event.keyCode === 27) {
+ $('.morphsearch').removeClass('open');
+ }
+ });
+
+ // Reset Morphing Search Input Value to Search...
+ $('input.search-field').val('');
+});
\ No newline at end of file
diff --git a/assets/kirki/LICENSE b/assets/kirki/LICENSE
new file mode 100644
index 0000000..a13701d
--- /dev/null
+++ b/assets/kirki/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2017 Aristeides Stathopoulos
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/assets/kirki/assets/css/kirki-styles.css b/assets/kirki/assets/css/kirki-styles.css
new file mode 100644
index 0000000..e69de29
diff --git a/assets/kirki/assets/images/1c.png b/assets/kirki/assets/images/1c.png
new file mode 100644
index 0000000..dfc2520
Binary files /dev/null and b/assets/kirki/assets/images/1c.png differ
diff --git a/assets/kirki/assets/images/2cl.png b/assets/kirki/assets/images/2cl.png
new file mode 100644
index 0000000..69da9e6
Binary files /dev/null and b/assets/kirki/assets/images/2cl.png differ
diff --git a/assets/kirki/assets/images/2cr.png b/assets/kirki/assets/images/2cr.png
new file mode 100644
index 0000000..02da48f
Binary files /dev/null and b/assets/kirki/assets/images/2cr.png differ
diff --git a/assets/kirki/assets/images/3cl.png b/assets/kirki/assets/images/3cl.png
new file mode 100644
index 0000000..5950688
Binary files /dev/null and b/assets/kirki/assets/images/3cl.png differ
diff --git a/assets/kirki/assets/images/3cm.png b/assets/kirki/assets/images/3cm.png
new file mode 100644
index 0000000..97e0b09
Binary files /dev/null and b/assets/kirki/assets/images/3cm.png differ
diff --git a/assets/kirki/assets/images/3cr.png b/assets/kirki/assets/images/3cr.png
new file mode 100644
index 0000000..498c0ac
Binary files /dev/null and b/assets/kirki/assets/images/3cr.png differ
diff --git a/assets/kirki/assets/images/jquery.fs.stepper-arrows.png b/assets/kirki/assets/images/jquery.fs.stepper-arrows.png
new file mode 100644
index 0000000..3da69ca
Binary files /dev/null and b/assets/kirki/assets/images/jquery.fs.stepper-arrows.png differ
diff --git a/assets/kirki/assets/images/kirki-bottom.png b/assets/kirki/assets/images/kirki-bottom.png
new file mode 100644
index 0000000..c0a9aca
Binary files /dev/null and b/assets/kirki/assets/images/kirki-bottom.png differ
diff --git a/assets/kirki/assets/images/kirki-bottom.svg b/assets/kirki/assets/images/kirki-bottom.svg
new file mode 100644
index 0000000..94dbd6a
--- /dev/null
+++ b/assets/kirki/assets/images/kirki-bottom.svg
@@ -0,0 +1,91 @@
+
+
image/svg+xml toolkit
+KIRKI
+
\ No newline at end of file
diff --git a/assets/kirki/assets/images/kirki-logo.svg b/assets/kirki/assets/images/kirki-logo.svg
new file mode 100644
index 0000000..70af324
--- /dev/null
+++ b/assets/kirki/assets/images/kirki-logo.svg
@@ -0,0 +1,48 @@
+
+
image/svg+xml
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/fontawesome/fontawesome.json b/assets/kirki/assets/vendor/fontawesome/fontawesome.json
new file mode 100644
index 0000000..5986779
--- /dev/null
+++ b/assets/kirki/assets/vendor/fontawesome/fontawesome.json
@@ -0,0 +1,8315 @@
+{
+ "icons": [
+ {
+ "name": "Glass",
+ "id": "glass",
+ "unicode": "f000",
+ "created": 1,
+ "filter": [
+ "martini",
+ "drink",
+ "bar",
+ "alcohol",
+ "liquor"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Music",
+ "id": "music",
+ "unicode": "f001",
+ "created": 1,
+ "filter": [
+ "note",
+ "sound"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Search",
+ "id": "search",
+ "unicode": "f002",
+ "created": 1,
+ "filter": [
+ "magnify",
+ "zoom",
+ "enlarge",
+ "bigger"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Envelope Outlined",
+ "id": "envelope-o",
+ "unicode": "f003",
+ "created": 1,
+ "filter": [
+ "email",
+ "e-mail",
+ "letter",
+ "support",
+ "mail",
+ "message",
+ "notification"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Heart",
+ "id": "heart",
+ "unicode": "f004",
+ "created": 1,
+ "filter": [
+ "love",
+ "like",
+ "favorite"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Medical Icons"
+ ]
+ },
+ {
+ "name": "Star",
+ "id": "star",
+ "unicode": "f005",
+ "created": 1,
+ "filter": [
+ "award",
+ "achievement",
+ "night",
+ "rating",
+ "score",
+ "favorite"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Star Outlined",
+ "id": "star-o",
+ "unicode": "f006",
+ "created": 1,
+ "filter": [
+ "award",
+ "achievement",
+ "night",
+ "rating",
+ "score",
+ "favorite"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "User",
+ "id": "user",
+ "unicode": "f007",
+ "created": 1,
+ "filter": [
+ "person",
+ "man",
+ "head",
+ "profile"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Film",
+ "id": "film",
+ "unicode": "f008",
+ "created": 1,
+ "filter": [
+ "movie"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "th-large",
+ "id": "th-large",
+ "unicode": "f009",
+ "created": 1,
+ "filter": [
+ "blocks",
+ "squares",
+ "boxes",
+ "grid"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "th",
+ "id": "th",
+ "unicode": "f00a",
+ "created": 1,
+ "filter": [
+ "blocks",
+ "squares",
+ "boxes",
+ "grid"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "th-list",
+ "id": "th-list",
+ "unicode": "f00b",
+ "created": 1,
+ "filter": [
+ "ul",
+ "ol",
+ "checklist",
+ "finished",
+ "completed",
+ "done",
+ "todo"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Check",
+ "id": "check",
+ "unicode": "f00c",
+ "created": 1,
+ "filter": [
+ "checkmark",
+ "done",
+ "todo",
+ "agree",
+ "accept",
+ "confirm",
+ "tick",
+ "ok"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Times",
+ "id": "times",
+ "unicode": "f00d",
+ "created": 1,
+ "aliases": [
+ "remove",
+ "close"
+ ],
+ "filter": [
+ "close",
+ "exit",
+ "x",
+ "cross"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Search Plus",
+ "id": "search-plus",
+ "unicode": "f00e",
+ "created": 1,
+ "filter": [
+ "magnify",
+ "zoom",
+ "enlarge",
+ "bigger"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Search Minus",
+ "id": "search-minus",
+ "unicode": "f010",
+ "created": 1,
+ "filter": [
+ "magnify",
+ "minify",
+ "zoom",
+ "smaller"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Power Off",
+ "id": "power-off",
+ "unicode": "f011",
+ "created": 1,
+ "filter": [
+ "on"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "signal",
+ "id": "signal",
+ "unicode": "f012",
+ "created": 1,
+ "filter": [
+ "graph",
+ "bars"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "cog",
+ "id": "cog",
+ "unicode": "f013",
+ "created": 1,
+ "filter": [
+ "settings"
+ ],
+ "aliases": [
+ "gear"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Spinner Icons"
+ ]
+ },
+ {
+ "name": "Trash Outlined",
+ "id": "trash-o",
+ "unicode": "f014",
+ "created": 1,
+ "filter": [
+ "garbage",
+ "delete",
+ "remove",
+ "trash",
+ "hide"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "home",
+ "id": "home",
+ "unicode": "f015",
+ "created": 1,
+ "filter": [
+ "main",
+ "house"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "File Outlined",
+ "id": "file-o",
+ "unicode": "f016",
+ "created": 1,
+ "filter": [
+ "new",
+ "page",
+ "pdf",
+ "document"
+ ],
+ "categories": [
+ "Text Editor Icons",
+ "File Type Icons"
+ ]
+ },
+ {
+ "name": "Clock Outlined",
+ "id": "clock-o",
+ "unicode": "f017",
+ "created": 1,
+ "filter": [
+ "watch",
+ "timer",
+ "late",
+ "timestamp"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "road",
+ "id": "road",
+ "unicode": "f018",
+ "created": 1,
+ "filter": [
+ "street"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Download",
+ "id": "download",
+ "unicode": "f019",
+ "created": 1,
+ "filter": [
+ "import"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Arrow Circle Outlined Down",
+ "id": "arrow-circle-o-down",
+ "unicode": "f01a",
+ "created": 1,
+ "filter": [
+ "download"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Arrow Circle Outlined Up",
+ "id": "arrow-circle-o-up",
+ "unicode": "f01b",
+ "created": 1,
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "inbox",
+ "id": "inbox",
+ "unicode": "f01c",
+ "created": 1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Play Circle Outlined",
+ "id": "play-circle-o",
+ "unicode": "f01d",
+ "created": 1,
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "Repeat",
+ "id": "repeat",
+ "unicode": "f01e",
+ "created": 1,
+ "filter": [
+ "redo",
+ "forward"
+ ],
+ "aliases": [
+ "rotate-right"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "refresh",
+ "id": "refresh",
+ "unicode": "f021",
+ "created": 1,
+ "filter": [
+ "reload",
+ "sync"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Spinner Icons"
+ ]
+ },
+ {
+ "name": "list-alt",
+ "id": "list-alt",
+ "unicode": "f022",
+ "created": 1,
+ "filter": [
+ "ul",
+ "ol",
+ "checklist",
+ "finished",
+ "completed",
+ "done",
+ "todo"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "lock",
+ "id": "lock",
+ "unicode": "f023",
+ "created": 1,
+ "filter": [
+ "protect",
+ "admin",
+ "security"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "flag",
+ "id": "flag",
+ "unicode": "f024",
+ "created": 1,
+ "filter": [
+ "report",
+ "notification",
+ "notify"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "headphones",
+ "id": "headphones",
+ "unicode": "f025",
+ "created": 1,
+ "filter": [
+ "sound",
+ "listen",
+ "music",
+ "audio"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "volume-off",
+ "id": "volume-off",
+ "unicode": "f026",
+ "created": 1,
+ "filter": [
+ "audio",
+ "mute",
+ "sound",
+ "music"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "volume-down",
+ "id": "volume-down",
+ "unicode": "f027",
+ "created": 1,
+ "filter": [
+ "audio",
+ "lower",
+ "quieter",
+ "sound",
+ "music"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "volume-up",
+ "id": "volume-up",
+ "unicode": "f028",
+ "created": 1,
+ "filter": [
+ "audio",
+ "higher",
+ "louder",
+ "sound",
+ "music"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "qrcode",
+ "id": "qrcode",
+ "unicode": "f029",
+ "created": 1,
+ "filter": [
+ "scan"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "barcode",
+ "id": "barcode",
+ "unicode": "f02a",
+ "created": 1,
+ "filter": [
+ "scan"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "tag",
+ "id": "tag",
+ "unicode": "f02b",
+ "created": 1,
+ "filter": [
+ "label"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "tags",
+ "id": "tags",
+ "unicode": "f02c",
+ "created": 1,
+ "filter": [
+ "labels"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "book",
+ "id": "book",
+ "unicode": "f02d",
+ "created": 1,
+ "filter": [
+ "read",
+ "documentation"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "bookmark",
+ "id": "bookmark",
+ "unicode": "f02e",
+ "created": 1,
+ "filter": [
+ "save"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "print",
+ "id": "print",
+ "unicode": "f02f",
+ "created": 1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "camera",
+ "id": "camera",
+ "unicode": "f030",
+ "created": 1,
+ "filter": [
+ "photo",
+ "picture",
+ "record"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "font",
+ "id": "font",
+ "unicode": "f031",
+ "created": 1,
+ "filter": [
+ "text"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "bold",
+ "id": "bold",
+ "unicode": "f032",
+ "created": 1,
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "italic",
+ "id": "italic",
+ "unicode": "f033",
+ "created": 1,
+ "filter": [
+ "italics"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "text-height",
+ "id": "text-height",
+ "unicode": "f034",
+ "created": 1,
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "text-width",
+ "id": "text-width",
+ "unicode": "f035",
+ "created": 1,
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "align-left",
+ "id": "align-left",
+ "unicode": "f036",
+ "created": 1,
+ "filter": [
+ "text"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "align-center",
+ "id": "align-center",
+ "unicode": "f037",
+ "created": 1,
+ "filter": [
+ "middle",
+ "text"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "align-right",
+ "id": "align-right",
+ "unicode": "f038",
+ "created": 1,
+ "filter": [
+ "text"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "align-justify",
+ "id": "align-justify",
+ "unicode": "f039",
+ "created": 1,
+ "filter": [
+ "text"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "list",
+ "id": "list",
+ "unicode": "f03a",
+ "created": 1,
+ "filter": [
+ "ul",
+ "ol",
+ "checklist",
+ "finished",
+ "completed",
+ "done",
+ "todo"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Outdent",
+ "id": "outdent",
+ "unicode": "f03b",
+ "created": 1,
+ "aliases": [
+ "dedent"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Indent",
+ "id": "indent",
+ "unicode": "f03c",
+ "created": 1,
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Video Camera",
+ "id": "video-camera",
+ "unicode": "f03d",
+ "created": 1,
+ "filter": [
+ "film",
+ "movie",
+ "record"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Picture Outlined",
+ "id": "picture-o",
+ "unicode": "f03e",
+ "created": 1,
+ "aliases": [
+ "photo",
+ "image"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "pencil",
+ "id": "pencil",
+ "unicode": "f040",
+ "created": 1,
+ "filter": [
+ "write",
+ "edit",
+ "update"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "map-marker",
+ "id": "map-marker",
+ "unicode": "f041",
+ "created": 1,
+ "filter": [
+ "map",
+ "pin",
+ "location",
+ "coordinates",
+ "localize",
+ "address",
+ "travel",
+ "where",
+ "place"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "adjust",
+ "id": "adjust",
+ "unicode": "f042",
+ "created": 1,
+ "filter": [
+ "contrast"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "tint",
+ "id": "tint",
+ "unicode": "f043",
+ "created": 1,
+ "filter": [
+ "raindrop",
+ "waterdrop",
+ "drop",
+ "droplet"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Pencil Square Outlined",
+ "id": "pencil-square-o",
+ "unicode": "f044",
+ "created": 1,
+ "filter": [
+ "write",
+ "edit",
+ "update"
+ ],
+ "aliases": [
+ "edit"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Share Square Outlined",
+ "id": "share-square-o",
+ "unicode": "f045",
+ "created": 1,
+ "filter": [
+ "social",
+ "send",
+ "arrow"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Check Square Outlined",
+ "id": "check-square-o",
+ "unicode": "f046",
+ "created": 1,
+ "filter": [
+ "todo",
+ "done",
+ "agree",
+ "accept",
+ "confirm",
+ "ok"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Form Control Icons"
+ ]
+ },
+ {
+ "name": "Arrows",
+ "id": "arrows",
+ "unicode": "f047",
+ "created": 1,
+ "filter": [
+ "move",
+ "reorder",
+ "resize"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "step-backward",
+ "id": "step-backward",
+ "unicode": "f048",
+ "created": 1,
+ "filter": [
+ "rewind",
+ "previous",
+ "beginning",
+ "start",
+ "first"
+ ],
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "fast-backward",
+ "id": "fast-backward",
+ "unicode": "f049",
+ "created": 1,
+ "filter": [
+ "rewind",
+ "previous",
+ "beginning",
+ "start",
+ "first"
+ ],
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "backward",
+ "id": "backward",
+ "unicode": "f04a",
+ "created": 1,
+ "filter": [
+ "rewind",
+ "previous"
+ ],
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "play",
+ "id": "play",
+ "unicode": "f04b",
+ "created": 1,
+ "filter": [
+ "start",
+ "playing",
+ "music",
+ "sound"
+ ],
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "pause",
+ "id": "pause",
+ "unicode": "f04c",
+ "created": 1,
+ "filter": [
+ "wait"
+ ],
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "stop",
+ "id": "stop",
+ "unicode": "f04d",
+ "created": 1,
+ "filter": [
+ "block",
+ "box",
+ "square"
+ ],
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "forward",
+ "id": "forward",
+ "unicode": "f04e",
+ "created": 1,
+ "filter": [
+ "forward",
+ "next"
+ ],
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "fast-forward",
+ "id": "fast-forward",
+ "unicode": "f050",
+ "created": 1,
+ "filter": [
+ "next",
+ "end",
+ "last"
+ ],
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "step-forward",
+ "id": "step-forward",
+ "unicode": "f051",
+ "created": 1,
+ "filter": [
+ "next",
+ "end",
+ "last"
+ ],
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "eject",
+ "id": "eject",
+ "unicode": "f052",
+ "created": 1,
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "chevron-left",
+ "id": "chevron-left",
+ "unicode": "f053",
+ "created": 1,
+ "filter": [
+ "bracket",
+ "previous",
+ "back"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "chevron-right",
+ "id": "chevron-right",
+ "unicode": "f054",
+ "created": 1,
+ "filter": [
+ "bracket",
+ "next",
+ "forward"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Plus Circle",
+ "id": "plus-circle",
+ "unicode": "f055",
+ "created": 1,
+ "filter": [
+ "add",
+ "new",
+ "create",
+ "expand"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Minus Circle",
+ "id": "minus-circle",
+ "unicode": "f056",
+ "created": 1,
+ "filter": [
+ "delete",
+ "remove",
+ "trash",
+ "hide"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Times Circle",
+ "id": "times-circle",
+ "unicode": "f057",
+ "created": 1,
+ "filter": [
+ "close",
+ "exit",
+ "x"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Check Circle",
+ "id": "check-circle",
+ "unicode": "f058",
+ "created": 1,
+ "filter": [
+ "todo",
+ "done",
+ "agree",
+ "accept",
+ "confirm",
+ "ok"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Question Circle",
+ "id": "question-circle",
+ "unicode": "f059",
+ "filter": [
+ "help",
+ "information",
+ "unknown",
+ "support"
+ ],
+ "created": 1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Info Circle",
+ "id": "info-circle",
+ "unicode": "f05a",
+ "created": 1,
+ "filter": [
+ "help",
+ "information",
+ "more",
+ "details"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Crosshairs",
+ "id": "crosshairs",
+ "unicode": "f05b",
+ "created": 1,
+ "filter": [
+ "picker"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Times Circle Outlined",
+ "id": "times-circle-o",
+ "unicode": "f05c",
+ "created": 1,
+ "filter": [
+ "close",
+ "exit",
+ "x"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Check Circle Outlined",
+ "id": "check-circle-o",
+ "unicode": "f05d",
+ "created": 1,
+ "filter": [
+ "todo",
+ "done",
+ "agree",
+ "accept",
+ "confirm",
+ "ok"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "ban",
+ "id": "ban",
+ "unicode": "f05e",
+ "created": 1,
+ "filter": [
+ "delete",
+ "remove",
+ "trash",
+ "hide",
+ "block",
+ "stop",
+ "abort",
+ "cancel"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "arrow-left",
+ "id": "arrow-left",
+ "unicode": "f060",
+ "created": 1,
+ "filter": [
+ "previous",
+ "back"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "arrow-right",
+ "id": "arrow-right",
+ "unicode": "f061",
+ "created": 1,
+ "filter": [
+ "next",
+ "forward"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "arrow-up",
+ "id": "arrow-up",
+ "unicode": "f062",
+ "created": 1,
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "arrow-down",
+ "id": "arrow-down",
+ "unicode": "f063",
+ "created": 1,
+ "filter": [
+ "download"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Share",
+ "id": "share",
+ "unicode": "f064",
+ "created": 1,
+ "aliases": [
+ "mail-forward"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Expand",
+ "id": "expand",
+ "unicode": "f065",
+ "created": 1,
+ "filter": [
+ "enlarge",
+ "bigger",
+ "resize"
+ ],
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "Compress",
+ "id": "compress",
+ "unicode": "f066",
+ "created": 1,
+ "filter": [
+ "collapse",
+ "combine",
+ "contract",
+ "merge",
+ "smaller"
+ ],
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "plus",
+ "id": "plus",
+ "unicode": "f067",
+ "created": 1,
+ "filter": [
+ "add",
+ "new",
+ "create",
+ "expand"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "minus",
+ "id": "minus",
+ "unicode": "f068",
+ "created": 1,
+ "filter": [
+ "hide",
+ "minify",
+ "delete",
+ "remove",
+ "trash",
+ "hide",
+ "collapse"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "asterisk",
+ "id": "asterisk",
+ "unicode": "f069",
+ "created": 1,
+ "filter": [
+ "details"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Exclamation Circle",
+ "id": "exclamation-circle",
+ "unicode": "f06a",
+ "created": 1,
+ "filter": [
+ "warning",
+ "error",
+ "problem",
+ "notification",
+ "alert"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "gift",
+ "id": "gift",
+ "unicode": "f06b",
+ "created": 1,
+ "filter": [
+ "present"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "leaf",
+ "id": "leaf",
+ "unicode": "f06c",
+ "created": 1,
+ "filter": [
+ "eco",
+ "nature",
+ "plant"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "fire",
+ "id": "fire",
+ "unicode": "f06d",
+ "created": 1,
+ "filter": [
+ "flame",
+ "hot",
+ "popular"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Eye",
+ "id": "eye",
+ "unicode": "f06e",
+ "created": 1,
+ "filter": [
+ "show",
+ "visible",
+ "views"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Eye Slash",
+ "id": "eye-slash",
+ "unicode": "f070",
+ "created": 1,
+ "filter": [
+ "toggle",
+ "show",
+ "hide",
+ "visible",
+ "visiblity",
+ "views"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Exclamation Triangle",
+ "id": "exclamation-triangle",
+ "unicode": "f071",
+ "created": 1,
+ "filter": [
+ "warning",
+ "error",
+ "problem",
+ "notification",
+ "alert"
+ ],
+ "aliases": [
+ "warning"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "plane",
+ "id": "plane",
+ "unicode": "f072",
+ "created": 1,
+ "filter": [
+ "travel",
+ "trip",
+ "location",
+ "destination",
+ "airplane",
+ "fly",
+ "mode"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "calendar",
+ "id": "calendar",
+ "unicode": "f073",
+ "created": 1,
+ "filter": [
+ "date",
+ "time",
+ "when",
+ "event"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "random",
+ "id": "random",
+ "unicode": "f074",
+ "created": 1,
+ "filter": [
+ "sort",
+ "shuffle"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "comment",
+ "id": "comment",
+ "unicode": "f075",
+ "created": 1,
+ "filter": [
+ "speech",
+ "notification",
+ "note",
+ "chat",
+ "bubble",
+ "feedback",
+ "message",
+ "texting",
+ "sms",
+ "conversation"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "magnet",
+ "id": "magnet",
+ "unicode": "f076",
+ "created": 1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "chevron-up",
+ "id": "chevron-up",
+ "unicode": "f077",
+ "created": 1,
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "chevron-down",
+ "id": "chevron-down",
+ "unicode": "f078",
+ "created": 1,
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "retweet",
+ "id": "retweet",
+ "unicode": "f079",
+ "created": 1,
+ "filter": [
+ "refresh",
+ "reload",
+ "share"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "shopping-cart",
+ "id": "shopping-cart",
+ "unicode": "f07a",
+ "created": 1,
+ "filter": [
+ "checkout",
+ "buy",
+ "purchase",
+ "payment"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Folder",
+ "id": "folder",
+ "unicode": "f07b",
+ "created": 1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Folder Open",
+ "id": "folder-open",
+ "unicode": "f07c",
+ "created": 1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Arrows Vertical",
+ "id": "arrows-v",
+ "unicode": "f07d",
+ "created": 1,
+ "filter": [
+ "resize"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Arrows Horizontal",
+ "id": "arrows-h",
+ "unicode": "f07e",
+ "created": 1,
+ "filter": [
+ "resize"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Bar Chart",
+ "id": "bar-chart",
+ "unicode": "f080",
+ "created": 1,
+ "aliases": [
+ "bar-chart-o"
+ ],
+ "filter": [
+ "graph",
+ "analytics"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Chart Icons"
+ ]
+ },
+ {
+ "name": "Twitter Square",
+ "id": "twitter-square",
+ "unicode": "f081",
+ "created": 1,
+ "filter": [
+ "tweet",
+ "social network"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Facebook Square",
+ "id": "facebook-square",
+ "unicode": "f082",
+ "created": 1,
+ "filter": [
+ "social network"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "camera-retro",
+ "id": "camera-retro",
+ "unicode": "f083",
+ "created": 1,
+ "filter": [
+ "photo",
+ "picture",
+ "record"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "key",
+ "id": "key",
+ "unicode": "f084",
+ "created": 1,
+ "filter": [
+ "unlock",
+ "password"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "cogs",
+ "id": "cogs",
+ "unicode": "f085",
+ "created": 1,
+ "aliases": [
+ "gears"
+ ],
+ "filter": [
+ "settings"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "comments",
+ "id": "comments",
+ "unicode": "f086",
+ "created": 1,
+ "filter": [
+ "speech",
+ "notification",
+ "note",
+ "chat",
+ "bubble",
+ "feedback",
+ "message",
+ "texting",
+ "sms",
+ "conversation"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Thumbs Up Outlined",
+ "id": "thumbs-o-up",
+ "unicode": "f087",
+ "created": 1,
+ "filter": [
+ "like",
+ "approve",
+ "favorite",
+ "agree",
+ "hand"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "Thumbs Down Outlined",
+ "id": "thumbs-o-down",
+ "unicode": "f088",
+ "created": 1,
+ "filter": [
+ "dislike",
+ "disapprove",
+ "disagree",
+ "hand"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "star-half",
+ "id": "star-half",
+ "unicode": "f089",
+ "created": 1,
+ "filter": [
+ "award",
+ "achievement",
+ "rating",
+ "score"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Heart Outlined",
+ "id": "heart-o",
+ "unicode": "f08a",
+ "created": 1,
+ "filter": [
+ "love",
+ "like",
+ "favorite"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Medical Icons"
+ ]
+ },
+ {
+ "name": "Sign Out",
+ "id": "sign-out",
+ "unicode": "f08b",
+ "created": 1,
+ "filter": [
+ "log out",
+ "logout",
+ "leave",
+ "exit",
+ "arrow"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "LinkedIn Square",
+ "id": "linkedin-square",
+ "unicode": "f08c",
+ "created": 1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Thumb Tack",
+ "id": "thumb-tack",
+ "unicode": "f08d",
+ "created": 1,
+ "filter": [
+ "marker",
+ "pin",
+ "location",
+ "coordinates"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "External Link",
+ "id": "external-link",
+ "unicode": "f08e",
+ "created": 1,
+ "filter": [
+ "open",
+ "new"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Sign In",
+ "id": "sign-in",
+ "unicode": "f090",
+ "created": 1,
+ "filter": [
+ "enter",
+ "join",
+ "log in",
+ "login",
+ "sign up",
+ "sign in",
+ "signin",
+ "signup",
+ "arrow"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "trophy",
+ "id": "trophy",
+ "unicode": "f091",
+ "created": 1,
+ "filter": [
+ "award",
+ "achievement",
+ "cup",
+ "winner",
+ "game"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "GitHub Square",
+ "id": "github-square",
+ "unicode": "f092",
+ "created": 1,
+ "url": "github.com/logos",
+ "filter": [
+ "octocat"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Upload",
+ "id": "upload",
+ "unicode": "f093",
+ "created": 1,
+ "filter": [
+ "import"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Lemon Outlined",
+ "id": "lemon-o",
+ "unicode": "f094",
+ "created": 1,
+ "filter": [
+ "food"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Phone",
+ "id": "phone",
+ "unicode": "f095",
+ "created": 2,
+ "filter": [
+ "call",
+ "voice",
+ "number",
+ "support",
+ "earphone",
+ "telephone"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Square Outlined",
+ "id": "square-o",
+ "unicode": "f096",
+ "created": 2,
+ "filter": [
+ "block",
+ "square",
+ "box"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Form Control Icons"
+ ]
+ },
+ {
+ "name": "Bookmark Outlined",
+ "id": "bookmark-o",
+ "unicode": "f097",
+ "created": 2,
+ "filter": [
+ "save"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Phone Square",
+ "id": "phone-square",
+ "unicode": "f098",
+ "created": 2,
+ "filter": [
+ "call",
+ "voice",
+ "number",
+ "support",
+ "telephone"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Twitter",
+ "id": "twitter",
+ "unicode": "f099",
+ "created": 2,
+ "filter": [
+ "tweet",
+ "social network"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Facebook",
+ "id": "facebook",
+ "unicode": "f09a",
+ "created": 2,
+ "aliases": [
+ "facebook-f"
+ ],
+ "filter": [
+ "social network"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "GitHub",
+ "id": "github",
+ "unicode": "f09b",
+ "created": 2,
+ "url": "github.com/logos",
+ "filter": [
+ "octocat"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "unlock",
+ "id": "unlock",
+ "unicode": "f09c",
+ "created": 2,
+ "filter": [
+ "protect",
+ "admin",
+ "password",
+ "lock"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "credit-card",
+ "id": "credit-card",
+ "unicode": "f09d",
+ "created": 2,
+ "filter": [
+ "money",
+ "buy",
+ "debit",
+ "checkout",
+ "purchase",
+ "payment"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Payment Icons"
+ ]
+ },
+ {
+ "name": "rss",
+ "id": "rss",
+ "unicode": "f09e",
+ "created": 2,
+ "filter": [
+ "blog"
+ ],
+ "aliases": [
+ "feed"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "HDD",
+ "id": "hdd-o",
+ "unicode": "f0a0",
+ "created": 2,
+ "filter": [
+ "harddrive",
+ "hard drive",
+ "storage",
+ "save"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "bullhorn",
+ "id": "bullhorn",
+ "unicode": "f0a1",
+ "created": 2,
+ "filter": [
+ "announcement",
+ "share",
+ "broadcast",
+ "louder",
+ "megaphone"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "bell",
+ "id": "bell",
+ "unicode": "f0f3",
+ "created": 2,
+ "filter": [
+ "alert",
+ "reminder",
+ "notification"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "certificate",
+ "id": "certificate",
+ "unicode": "f0a3",
+ "created": 2,
+ "filter": [
+ "badge",
+ "star"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Hand Outlined Right",
+ "id": "hand-o-right",
+ "unicode": "f0a4",
+ "created": 2,
+ "filter": [
+ "point",
+ "right",
+ "next",
+ "forward",
+ "finger"
+ ],
+ "categories": [
+ "Directional Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "Hand Outlined Left",
+ "id": "hand-o-left",
+ "unicode": "f0a5",
+ "created": 2,
+ "filter": [
+ "point",
+ "left",
+ "previous",
+ "back",
+ "finger"
+ ],
+ "categories": [
+ "Directional Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "Hand Outlined Up",
+ "id": "hand-o-up",
+ "unicode": "f0a6",
+ "created": 2,
+ "filter": [
+ "point",
+ "finger"
+ ],
+ "categories": [
+ "Directional Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "Hand Outlined Down",
+ "id": "hand-o-down",
+ "unicode": "f0a7",
+ "created": 2,
+ "filter": [
+ "point",
+ "finger"
+ ],
+ "categories": [
+ "Directional Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "Arrow Circle Left",
+ "id": "arrow-circle-left",
+ "unicode": "f0a8",
+ "created": 2,
+ "filter": [
+ "previous",
+ "back"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Arrow Circle Right",
+ "id": "arrow-circle-right",
+ "unicode": "f0a9",
+ "created": 2,
+ "filter": [
+ "next",
+ "forward"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Arrow Circle Up",
+ "id": "arrow-circle-up",
+ "unicode": "f0aa",
+ "created": 2,
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Arrow Circle Down",
+ "id": "arrow-circle-down",
+ "unicode": "f0ab",
+ "created": 2,
+ "filter": [
+ "download"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Globe",
+ "id": "globe",
+ "unicode": "f0ac",
+ "created": 2,
+ "filter": [
+ "world",
+ "planet",
+ "map",
+ "place",
+ "travel",
+ "earth",
+ "global",
+ "translate",
+ "all",
+ "language",
+ "localize",
+ "location",
+ "coordinates",
+ "country"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Wrench",
+ "id": "wrench",
+ "unicode": "f0ad",
+ "created": 2,
+ "filter": [
+ "settings",
+ "fix",
+ "update",
+ "spanner"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Tasks",
+ "id": "tasks",
+ "unicode": "f0ae",
+ "created": 2,
+ "filter": [
+ "progress",
+ "loading",
+ "downloading",
+ "downloads",
+ "settings"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Filter",
+ "id": "filter",
+ "unicode": "f0b0",
+ "created": 2,
+ "filter": [
+ "funnel",
+ "options"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Briefcase",
+ "id": "briefcase",
+ "unicode": "f0b1",
+ "created": 2,
+ "filter": [
+ "work",
+ "business",
+ "office",
+ "luggage",
+ "bag"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Arrows Alt",
+ "id": "arrows-alt",
+ "unicode": "f0b2",
+ "created": 2,
+ "filter": [
+ "expand",
+ "enlarge",
+ "fullscreen",
+ "bigger",
+ "move",
+ "reorder",
+ "resize",
+ "arrow"
+ ],
+ "categories": [
+ "Video Player Icons",
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Users",
+ "id": "users",
+ "unicode": "f0c0",
+ "created": 2,
+ "filter": [
+ "people",
+ "profiles",
+ "persons"
+ ],
+ "aliases": [
+ "group"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Link",
+ "id": "link",
+ "unicode": "f0c1",
+ "created": 2,
+ "filter": [
+ "chain"
+ ],
+ "aliases": [
+ "chain"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Cloud",
+ "id": "cloud",
+ "filter": [
+ "save"
+ ],
+ "unicode": "f0c2",
+ "created": 2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Flask",
+ "id": "flask",
+ "unicode": "f0c3",
+ "created": 2,
+ "filter": [
+ "science",
+ "beaker",
+ "experimental",
+ "labs"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Scissors",
+ "id": "scissors",
+ "unicode": "f0c4",
+ "created": 2,
+ "aliases": [
+ "cut"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Files Outlined",
+ "id": "files-o",
+ "unicode": "f0c5",
+ "created": 2,
+ "filter": [
+ "duplicate",
+ "clone",
+ "copy"
+ ],
+ "aliases": [
+ "copy"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Paperclip",
+ "id": "paperclip",
+ "unicode": "f0c6",
+ "created": 2,
+ "filter": [
+ "attachment"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Floppy Outlined",
+ "id": "floppy-o",
+ "unicode": "f0c7",
+ "created": 2,
+ "aliases": [
+ "save"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Square",
+ "id": "square",
+ "unicode": "f0c8",
+ "created": 2,
+ "filter": [
+ "block",
+ "box"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Form Control Icons"
+ ]
+ },
+ {
+ "name": "Bars",
+ "id": "bars",
+ "unicode": "f0c9",
+ "created": 2,
+ "aliases": [
+ "navicon",
+ "reorder"
+ ],
+ "filter": [
+ "menu",
+ "drag",
+ "reorder",
+ "settings",
+ "list",
+ "ul",
+ "ol",
+ "checklist",
+ "todo",
+ "list",
+ "hamburger"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "list-ul",
+ "id": "list-ul",
+ "unicode": "f0ca",
+ "created": 2,
+ "filter": [
+ "ul",
+ "ol",
+ "checklist",
+ "todo",
+ "list"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "list-ol",
+ "id": "list-ol",
+ "unicode": "f0cb",
+ "created": 2,
+ "filter": [
+ "ul",
+ "ol",
+ "checklist",
+ "list",
+ "todo",
+ "list",
+ "numbers"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Strikethrough",
+ "id": "strikethrough",
+ "unicode": "f0cc",
+ "created": 2,
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Underline",
+ "id": "underline",
+ "unicode": "f0cd",
+ "created": 2,
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "table",
+ "id": "table",
+ "unicode": "f0ce",
+ "created": 2,
+ "filter": [
+ "data",
+ "excel",
+ "spreadsheet"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "magic",
+ "id": "magic",
+ "unicode": "f0d0",
+ "created": 2,
+ "filter": [
+ "wizard",
+ "automatic",
+ "autocomplete"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "truck",
+ "id": "truck",
+ "unicode": "f0d1",
+ "created": 2,
+ "filter": [
+ "shipping"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "Pinterest",
+ "id": "pinterest",
+ "unicode": "f0d2",
+ "created": 2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Pinterest Square",
+ "id": "pinterest-square",
+ "unicode": "f0d3",
+ "created": 2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Google Plus Square",
+ "id": "google-plus-square",
+ "unicode": "f0d4",
+ "created": 2,
+ "filter": [
+ "social network"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Google Plus",
+ "id": "google-plus",
+ "unicode": "f0d5",
+ "created": 2,
+ "filter": [
+ "social network"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Money",
+ "id": "money",
+ "unicode": "f0d6",
+ "created": 2,
+ "filter": [
+ "cash",
+ "money",
+ "buy",
+ "checkout",
+ "purchase",
+ "payment"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Currency Icons"
+ ]
+ },
+ {
+ "name": "Caret Down",
+ "id": "caret-down",
+ "unicode": "f0d7",
+ "created": 2,
+ "filter": [
+ "more",
+ "dropdown",
+ "menu",
+ "triangle down",
+ "arrow"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Caret Up",
+ "id": "caret-up",
+ "unicode": "f0d8",
+ "created": 2,
+ "filter": [
+ "triangle up",
+ "arrow"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Caret Left",
+ "id": "caret-left",
+ "unicode": "f0d9",
+ "created": 2,
+ "filter": [
+ "previous",
+ "back",
+ "triangle left",
+ "arrow"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Caret Right",
+ "id": "caret-right",
+ "unicode": "f0da",
+ "created": 2,
+ "filter": [
+ "next",
+ "forward",
+ "triangle right",
+ "arrow"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Columns",
+ "id": "columns",
+ "unicode": "f0db",
+ "created": 2,
+ "filter": [
+ "split",
+ "panes"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Sort",
+ "id": "sort",
+ "unicode": "f0dc",
+ "created": 2,
+ "filter": [
+ "order"
+ ],
+ "aliases": [
+ "unsorted"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Sort Descending",
+ "id": "sort-desc",
+ "unicode": "f0dd",
+ "created": 2,
+ "filter": [
+ "dropdown",
+ "more",
+ "menu",
+ "arrow"
+ ],
+ "aliases": [
+ "sort-down"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Sort Ascending",
+ "id": "sort-asc",
+ "unicode": "f0de",
+ "created": 2,
+ "aliases": [
+ "sort-up"
+ ],
+ "filter": [
+ "arrow"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Envelope",
+ "id": "envelope",
+ "unicode": "f0e0",
+ "created": 2,
+ "filter": [
+ "email",
+ "e-mail",
+ "letter",
+ "support",
+ "mail",
+ "message",
+ "notification"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "LinkedIn",
+ "id": "linkedin",
+ "unicode": "f0e1",
+ "created": 2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Undo",
+ "id": "undo",
+ "unicode": "f0e2",
+ "created": 2,
+ "filter": [
+ "back"
+ ],
+ "aliases": [
+ "rotate-left"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Gavel",
+ "id": "gavel",
+ "unicode": "f0e3",
+ "created": 2,
+ "filter": [
+ "judge",
+ "lawyer",
+ "opinion"
+ ],
+ "aliases": [
+ "legal"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Tachometer",
+ "id": "tachometer",
+ "unicode": "f0e4",
+ "created": 2,
+ "filter": [
+ "speedometer",
+ "fast"
+ ],
+ "aliases": [
+ "dashboard"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "comment-o",
+ "id": "comment-o",
+ "unicode": "f0e5",
+ "created": 2,
+ "filter": [
+ "speech",
+ "notification",
+ "note",
+ "chat",
+ "bubble",
+ "feedback",
+ "message",
+ "texting",
+ "sms",
+ "conversation"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "comments-o",
+ "id": "comments-o",
+ "unicode": "f0e6",
+ "created": 2,
+ "filter": [
+ "speech",
+ "notification",
+ "note",
+ "chat",
+ "bubble",
+ "feedback",
+ "message",
+ "texting",
+ "sms",
+ "conversation"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Lightning Bolt",
+ "id": "bolt",
+ "unicode": "f0e7",
+ "created": 2,
+ "filter": [
+ "lightning",
+ "weather"
+ ],
+ "aliases": [
+ "flash"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Sitemap",
+ "id": "sitemap",
+ "unicode": "f0e8",
+ "created": 2,
+ "filter": [
+ "directory",
+ "hierarchy",
+ "organization"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Umbrella",
+ "id": "umbrella",
+ "unicode": "f0e9",
+ "created": 2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Clipboard",
+ "id": "clipboard",
+ "unicode": "f0ea",
+ "created": 2,
+ "filter": [
+ "copy"
+ ],
+ "aliases": [
+ "paste"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Lightbulb Outlined",
+ "id": "lightbulb-o",
+ "unicode": "f0eb",
+ "created": 3,
+ "filter": [
+ "idea",
+ "inspiration"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Exchange",
+ "id": "exchange",
+ "unicode": "f0ec",
+ "created": 3,
+ "filter": [
+ "transfer",
+ "arrows",
+ "arrow"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Cloud Download",
+ "id": "cloud-download",
+ "unicode": "f0ed",
+ "created": 3,
+ "filter": [
+ "import"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Cloud Upload",
+ "id": "cloud-upload",
+ "unicode": "f0ee",
+ "created": 3,
+ "filter": [
+ "import"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "user-md",
+ "id": "user-md",
+ "unicode": "f0f0",
+ "created": 2,
+ "filter": [
+ "doctor",
+ "profile",
+ "medical",
+ "nurse"
+ ],
+ "categories": [
+ "Medical Icons"
+ ]
+ },
+ {
+ "name": "Stethoscope",
+ "id": "stethoscope",
+ "unicode": "f0f1",
+ "created": 3,
+ "categories": [
+ "Medical Icons"
+ ]
+ },
+ {
+ "name": "Suitcase",
+ "id": "suitcase",
+ "unicode": "f0f2",
+ "created": 3,
+ "filter": [
+ "trip",
+ "luggage",
+ "travel",
+ "move",
+ "baggage"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Bell Outlined",
+ "id": "bell-o",
+ "unicode": "f0a2",
+ "created": 3,
+ "filter": [
+ "alert",
+ "reminder",
+ "notification"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Coffee",
+ "id": "coffee",
+ "unicode": "f0f4",
+ "created": 3,
+ "filter": [
+ "morning",
+ "mug",
+ "breakfast",
+ "tea",
+ "drink",
+ "cafe"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Cutlery",
+ "id": "cutlery",
+ "unicode": "f0f5",
+ "created": 3,
+ "filter": [
+ "food",
+ "restaurant",
+ "spoon",
+ "knife",
+ "dinner",
+ "eat"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "File Text Outlined",
+ "id": "file-text-o",
+ "unicode": "f0f6",
+ "created": 3,
+ "filter": [
+ "new",
+ "page",
+ "pdf",
+ "document"
+ ],
+ "categories": [
+ "Text Editor Icons",
+ "File Type Icons"
+ ]
+ },
+ {
+ "name": "Building Outlined",
+ "id": "building-o",
+ "unicode": "f0f7",
+ "created": 3,
+ "filter": [
+ "work",
+ "business",
+ "apartment",
+ "office",
+ "company"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "hospital Outlined",
+ "id": "hospital-o",
+ "unicode": "f0f8",
+ "created": 3,
+ "filter": [
+ "building"
+ ],
+ "categories": [
+ "Medical Icons"
+ ]
+ },
+ {
+ "name": "ambulance",
+ "id": "ambulance",
+ "unicode": "f0f9",
+ "created": 3,
+ "filter": [
+ "vehicle",
+ "support",
+ "help"
+ ],
+ "categories": [
+ "Medical Icons",
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "medkit",
+ "id": "medkit",
+ "unicode": "f0fa",
+ "created": 3,
+ "filter": [
+ "first aid",
+ "firstaid",
+ "help",
+ "support",
+ "health"
+ ],
+ "categories": [
+ "Medical Icons"
+ ]
+ },
+ {
+ "name": "fighter-jet",
+ "id": "fighter-jet",
+ "unicode": "f0fb",
+ "created": 3,
+ "filter": [
+ "fly",
+ "plane",
+ "airplane",
+ "quick",
+ "fast",
+ "travel"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "beer",
+ "id": "beer",
+ "unicode": "f0fc",
+ "created": 3,
+ "filter": [
+ "alcohol",
+ "stein",
+ "drink",
+ "mug",
+ "bar",
+ "liquor"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "H Square",
+ "id": "h-square",
+ "unicode": "f0fd",
+ "created": 3,
+ "filter": [
+ "hospital",
+ "hotel"
+ ],
+ "categories": [
+ "Medical Icons"
+ ]
+ },
+ {
+ "name": "Plus Square",
+ "id": "plus-square",
+ "unicode": "f0fe",
+ "created": 3,
+ "filter": [
+ "add",
+ "new",
+ "create",
+ "expand"
+ ],
+ "categories": [
+ "Medical Icons",
+ "Web Application Icons",
+ "Form Control Icons"
+ ]
+ },
+ {
+ "name": "Angle Double Left",
+ "id": "angle-double-left",
+ "unicode": "f100",
+ "created": 3,
+ "filter": [
+ "laquo",
+ "quote",
+ "previous",
+ "back",
+ "arrows"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Angle Double Right",
+ "id": "angle-double-right",
+ "unicode": "f101",
+ "created": 3,
+ "filter": [
+ "raquo",
+ "quote",
+ "next",
+ "forward",
+ "arrows"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Angle Double Up",
+ "id": "angle-double-up",
+ "unicode": "f102",
+ "created": 3,
+ "filter": [
+ "arrows"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Angle Double Down",
+ "id": "angle-double-down",
+ "unicode": "f103",
+ "created": 3,
+ "filter": [
+ "arrows"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "angle-left",
+ "id": "angle-left",
+ "unicode": "f104",
+ "created": 3,
+ "filter": [
+ "previous",
+ "back",
+ "arrow"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "angle-right",
+ "id": "angle-right",
+ "unicode": "f105",
+ "created": 3,
+ "filter": [
+ "next",
+ "forward",
+ "arrow"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "angle-up",
+ "id": "angle-up",
+ "unicode": "f106",
+ "created": 3,
+ "filter": [
+ "arrow"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "angle-down",
+ "id": "angle-down",
+ "unicode": "f107",
+ "created": 3,
+ "filter": [
+ "arrow"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Desktop",
+ "id": "desktop",
+ "unicode": "f108",
+ "created": 3,
+ "filter": [
+ "monitor",
+ "screen",
+ "desktop",
+ "computer",
+ "demo",
+ "device"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Laptop",
+ "id": "laptop",
+ "unicode": "f109",
+ "created": 3,
+ "filter": [
+ "demo",
+ "computer",
+ "device"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "tablet",
+ "id": "tablet",
+ "unicode": "f10a",
+ "created": 3,
+ "filter": [
+ "ipad",
+ "device"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Mobile Phone",
+ "id": "mobile",
+ "unicode": "f10b",
+ "created": 3,
+ "filter": [
+ "cell phone",
+ "cellphone",
+ "text",
+ "call",
+ "iphone",
+ "number",
+ "telephone"
+ ],
+ "aliases": [
+ "mobile-phone"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Circle Outlined",
+ "id": "circle-o",
+ "unicode": "f10c",
+ "created": 3,
+ "categories": [
+ "Web Application Icons",
+ "Form Control Icons"
+ ]
+ },
+ {
+ "name": "quote-left",
+ "id": "quote-left",
+ "unicode": "f10d",
+ "created": 3,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "quote-right",
+ "id": "quote-right",
+ "unicode": "f10e",
+ "created": 3,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Spinner",
+ "id": "spinner",
+ "unicode": "f110",
+ "created": 3,
+ "filter": [
+ "loading",
+ "progress"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Spinner Icons"
+ ]
+ },
+ {
+ "name": "Circle",
+ "id": "circle",
+ "unicode": "f111",
+ "created": 3,
+ "filter": [
+ "dot",
+ "notification"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Form Control Icons"
+ ]
+ },
+ {
+ "name": "Reply",
+ "id": "reply",
+ "unicode": "f112",
+ "created": 3,
+ "aliases": [
+ "mail-reply"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "GitHub Alt",
+ "id": "github-alt",
+ "unicode": "f113",
+ "created": 3,
+ "url": "github.com/logos",
+ "filter": [
+ "octocat"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Folder Outlined",
+ "id": "folder-o",
+ "unicode": "f114",
+ "created": 3,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Folder Open Outlined",
+ "id": "folder-open-o",
+ "unicode": "f115",
+ "created": 3,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Smile Outlined",
+ "id": "smile-o",
+ "unicode": "f118",
+ "created": 3.1,
+ "filter": [
+ "face",
+ "emoticon",
+ "happy",
+ "approve",
+ "satisfied",
+ "rating"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Frown Outlined",
+ "id": "frown-o",
+ "unicode": "f119",
+ "created": 3.1,
+ "filter": [
+ "face",
+ "emoticon",
+ "sad",
+ "disapprove",
+ "rating"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Meh Outlined",
+ "id": "meh-o",
+ "unicode": "f11a",
+ "created": 3.1,
+ "filter": [
+ "face",
+ "emoticon",
+ "rating",
+ "neutral"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Gamepad",
+ "id": "gamepad",
+ "unicode": "f11b",
+ "created": 3.1,
+ "filter": [
+ "controller"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Keyboard Outlined",
+ "id": "keyboard-o",
+ "unicode": "f11c",
+ "created": 3.1,
+ "filter": [
+ "type",
+ "input"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Flag Outlined",
+ "id": "flag-o",
+ "unicode": "f11d",
+ "created": 3.1,
+ "filter": [
+ "report",
+ "notification"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "flag-checkered",
+ "id": "flag-checkered",
+ "unicode": "f11e",
+ "created": 3.1,
+ "filter": [
+ "report",
+ "notification",
+ "notify"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Terminal",
+ "id": "terminal",
+ "unicode": "f120",
+ "created": 3.1,
+ "filter": [
+ "command",
+ "prompt",
+ "code"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Code",
+ "id": "code",
+ "unicode": "f121",
+ "created": 3.1,
+ "filter": [
+ "html",
+ "brackets"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "reply-all",
+ "id": "reply-all",
+ "unicode": "f122",
+ "created": 3.1,
+ "aliases": [
+ "mail-reply-all"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Star Half Outlined",
+ "id": "star-half-o",
+ "unicode": "f123",
+ "created": 3.1,
+ "filter": [
+ "award",
+ "achievement",
+ "rating",
+ "score"
+ ],
+ "aliases": [
+ "star-half-empty",
+ "star-half-full"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "location-arrow",
+ "id": "location-arrow",
+ "unicode": "f124",
+ "created": 3.1,
+ "filter": [
+ "map",
+ "coordinates",
+ "location",
+ "address",
+ "place",
+ "where"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "crop",
+ "id": "crop",
+ "unicode": "f125",
+ "created": 3.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "code-fork",
+ "id": "code-fork",
+ "unicode": "f126",
+ "created": 3.1,
+ "filter": [
+ "git",
+ "fork",
+ "vcs",
+ "svn",
+ "github",
+ "rebase",
+ "version",
+ "merge"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Chain Broken",
+ "id": "chain-broken",
+ "unicode": "f127",
+ "created": 3.1,
+ "filter": [
+ "remove"
+ ],
+ "aliases": [
+ "unlink"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Question",
+ "id": "question",
+ "unicode": "f128",
+ "created": 3.1,
+ "filter": [
+ "help",
+ "information",
+ "unknown",
+ "support"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Info",
+ "id": "info",
+ "unicode": "f129",
+ "created": 3.1,
+ "filter": [
+ "help",
+ "information",
+ "more",
+ "details"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "exclamation",
+ "id": "exclamation",
+ "unicode": "f12a",
+ "created": 3.1,
+ "filter": [
+ "warning",
+ "error",
+ "problem",
+ "notification",
+ "notify",
+ "alert"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "superscript",
+ "id": "superscript",
+ "unicode": "f12b",
+ "created": 3.1,
+ "filter": [
+ "exponential"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "subscript",
+ "id": "subscript",
+ "unicode": "f12c",
+ "created": 3.1,
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "eraser",
+ "id": "eraser",
+ "unicode": "f12d",
+ "created": 3.1,
+ "filter": [
+ "remove",
+ "delete"
+ ],
+ "categories": [
+ "Text Editor Icons",
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Puzzle Piece",
+ "id": "puzzle-piece",
+ "unicode": "f12e",
+ "created": 3.1,
+ "filter": [
+ "addon",
+ "add-on",
+ "section"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "microphone",
+ "id": "microphone",
+ "unicode": "f130",
+ "created": 3.1,
+ "filter": [
+ "record",
+ "voice",
+ "sound"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Microphone Slash",
+ "id": "microphone-slash",
+ "unicode": "f131",
+ "created": 3.1,
+ "filter": [
+ "record",
+ "voice",
+ "sound",
+ "mute"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "shield",
+ "id": "shield",
+ "unicode": "f132",
+ "created": 3.1,
+ "filter": [
+ "award",
+ "achievement",
+ "security",
+ "winner"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "calendar-o",
+ "id": "calendar-o",
+ "unicode": "f133",
+ "created": 3.1,
+ "filter": [
+ "date",
+ "time",
+ "when",
+ "event"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "fire-extinguisher",
+ "id": "fire-extinguisher",
+ "unicode": "f134",
+ "created": 3.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "rocket",
+ "id": "rocket",
+ "unicode": "f135",
+ "created": 3.1,
+ "filter": [
+ "app"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "MaxCDN",
+ "id": "maxcdn",
+ "unicode": "f136",
+ "created": 3.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Chevron Circle Left",
+ "id": "chevron-circle-left",
+ "unicode": "f137",
+ "created": 3.1,
+ "filter": [
+ "previous",
+ "back",
+ "arrow"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Chevron Circle Right",
+ "id": "chevron-circle-right",
+ "unicode": "f138",
+ "created": 3.1,
+ "filter": [
+ "next",
+ "forward",
+ "arrow"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Chevron Circle Up",
+ "id": "chevron-circle-up",
+ "unicode": "f139",
+ "created": 3.1,
+ "filter": [
+ "arrow"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Chevron Circle Down",
+ "id": "chevron-circle-down",
+ "unicode": "f13a",
+ "created": 3.1,
+ "filter": [
+ "more",
+ "dropdown",
+ "menu",
+ "arrow"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "HTML 5 Logo",
+ "id": "html5",
+ "unicode": "f13b",
+ "created": 3.1,
+ "code": [
+ "code",
+ "html5"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "CSS 3 Logo",
+ "id": "css3",
+ "unicode": "f13c",
+ "created": 3.1,
+ "filter": [
+ "code"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Anchor",
+ "id": "anchor",
+ "unicode": "f13d",
+ "created": 3.1,
+ "filter": [
+ "link"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Unlock Alt",
+ "id": "unlock-alt",
+ "unicode": "f13e",
+ "created": 3.1,
+ "filter": [
+ "protect",
+ "admin",
+ "password",
+ "lock"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Bullseye",
+ "id": "bullseye",
+ "unicode": "f140",
+ "created": 3.1,
+ "filter": [
+ "target"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Ellipsis Horizontal",
+ "id": "ellipsis-h",
+ "unicode": "f141",
+ "created": 3.1,
+ "filter": [
+ "dots"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Ellipsis Vertical",
+ "id": "ellipsis-v",
+ "unicode": "f142",
+ "created": 3.1,
+ "filter": [
+ "dots"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "RSS Square",
+ "id": "rss-square",
+ "unicode": "f143",
+ "created": 3.1,
+ "filter": [
+ "feed",
+ "blog"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Play Circle",
+ "id": "play-circle",
+ "unicode": "f144",
+ "created": 3.1,
+ "filter": [
+ "start",
+ "playing"
+ ],
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "Ticket",
+ "id": "ticket",
+ "unicode": "f145",
+ "created": 3.1,
+ "filter": [
+ "movie",
+ "pass",
+ "support"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Minus Square",
+ "id": "minus-square",
+ "unicode": "f146",
+ "created": 3.1,
+ "filter": [
+ "hide",
+ "minify",
+ "delete",
+ "remove",
+ "trash",
+ "hide",
+ "collapse"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Form Control Icons"
+ ]
+ },
+ {
+ "name": "Minus Square Outlined",
+ "id": "minus-square-o",
+ "unicode": "f147",
+ "created": 3.1,
+ "filter": [
+ "hide",
+ "minify",
+ "delete",
+ "remove",
+ "trash",
+ "hide",
+ "collapse"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Form Control Icons"
+ ]
+ },
+ {
+ "name": "Level Up",
+ "id": "level-up",
+ "unicode": "f148",
+ "created": 3.1,
+ "filter": [
+ "arrow"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Level Down",
+ "id": "level-down",
+ "unicode": "f149",
+ "created": 3.1,
+ "filter": [
+ "arrow"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Check Square",
+ "id": "check-square",
+ "unicode": "f14a",
+ "created": 3.1,
+ "filter": [
+ "checkmark",
+ "done",
+ "todo",
+ "agree",
+ "accept",
+ "confirm",
+ "ok"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Form Control Icons"
+ ]
+ },
+ {
+ "name": "Pencil Square",
+ "id": "pencil-square",
+ "unicode": "f14b",
+ "created": 3.1,
+ "filter": [
+ "write",
+ "edit",
+ "update"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "External Link Square",
+ "id": "external-link-square",
+ "unicode": "f14c",
+ "created": 3.1,
+ "filter": [
+ "open",
+ "new"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Share Square",
+ "id": "share-square",
+ "unicode": "f14d",
+ "created": 3.1,
+ "filter": [
+ "social",
+ "send"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Compass",
+ "id": "compass",
+ "unicode": "f14e",
+ "created": 3.2,
+ "filter": [
+ "safari",
+ "directory",
+ "menu",
+ "location"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Caret Square Outlined Down",
+ "id": "caret-square-o-down",
+ "unicode": "f150",
+ "created": 3.2,
+ "aliases": [
+ "toggle-down"
+ ],
+ "filter": [
+ "more",
+ "dropdown",
+ "menu"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Caret Square Outlined Up",
+ "id": "caret-square-o-up",
+ "unicode": "f151",
+ "created": 3.2,
+ "aliases": [
+ "toggle-up"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Caret Square Outlined Right",
+ "id": "caret-square-o-right",
+ "unicode": "f152",
+ "created": 3.2,
+ "filter": [
+ "next",
+ "forward"
+ ],
+ "aliases": [
+ "toggle-right"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Euro (EUR)",
+ "id": "eur",
+ "unicode": "f153",
+ "created": 3.2,
+ "aliases": [
+ "euro"
+ ],
+ "categories": [
+ "Currency Icons"
+ ]
+ },
+ {
+ "name": "GBP",
+ "id": "gbp",
+ "unicode": "f154",
+ "created": 3.2,
+ "categories": [
+ "Currency Icons"
+ ]
+ },
+ {
+ "name": "US Dollar",
+ "id": "usd",
+ "unicode": "f155",
+ "created": 3.2,
+ "aliases": [
+ "dollar"
+ ],
+ "categories": [
+ "Currency Icons"
+ ]
+ },
+ {
+ "name": "Indian Rupee (INR)",
+ "id": "inr",
+ "unicode": "f156",
+ "created": 3.2,
+ "aliases": [
+ "rupee"
+ ],
+ "categories": [
+ "Currency Icons"
+ ]
+ },
+ {
+ "name": "Japanese Yen (JPY)",
+ "id": "jpy",
+ "unicode": "f157",
+ "created": 3.2,
+ "aliases": [
+ "cny",
+ "rmb",
+ "yen"
+ ],
+ "categories": [
+ "Currency Icons"
+ ]
+ },
+ {
+ "name": "Russian Ruble (RUB)",
+ "id": "rub",
+ "unicode": "f158",
+ "created": 4,
+ "aliases": [
+ "ruble",
+ "rouble"
+ ],
+ "categories": [
+ "Currency Icons"
+ ]
+ },
+ {
+ "name": "Korean Won (KRW)",
+ "id": "krw",
+ "unicode": "f159",
+ "created": 3.2,
+ "aliases": [
+ "won"
+ ],
+ "categories": [
+ "Currency Icons"
+ ]
+ },
+ {
+ "name": "Bitcoin (BTC)",
+ "id": "btc",
+ "unicode": "f15a",
+ "created": 3.2,
+ "aliases": [
+ "bitcoin"
+ ],
+ "categories": [
+ "Currency Icons",
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "File",
+ "id": "file",
+ "unicode": "f15b",
+ "created": 3.2,
+ "filter": [
+ "new",
+ "page",
+ "pdf",
+ "document"
+ ],
+ "categories": [
+ "Text Editor Icons",
+ "File Type Icons"
+ ]
+ },
+ {
+ "name": "File Text",
+ "id": "file-text",
+ "unicode": "f15c",
+ "created": 3.2,
+ "filter": [
+ "new",
+ "page",
+ "pdf",
+ "document"
+ ],
+ "categories": [
+ "Text Editor Icons",
+ "File Type Icons"
+ ]
+ },
+ {
+ "name": "Sort Alpha Ascending",
+ "id": "sort-alpha-asc",
+ "unicode": "f15d",
+ "created": 3.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Sort Alpha Descending",
+ "id": "sort-alpha-desc",
+ "unicode": "f15e",
+ "created": 3.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Sort Amount Ascending",
+ "id": "sort-amount-asc",
+ "unicode": "f160",
+ "created": 3.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Sort Amount Descending",
+ "id": "sort-amount-desc",
+ "unicode": "f161",
+ "created": 3.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Sort Numeric Ascending",
+ "id": "sort-numeric-asc",
+ "unicode": "f162",
+ "created": 3.2,
+ "filter": [
+ "numbers"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Sort Numeric Descending",
+ "id": "sort-numeric-desc",
+ "unicode": "f163",
+ "created": 3.2,
+ "filter": [
+ "numbers"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "thumbs-up",
+ "id": "thumbs-up",
+ "unicode": "f164",
+ "created": 3.2,
+ "filter": [
+ "like",
+ "favorite",
+ "approve",
+ "agree",
+ "hand"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "thumbs-down",
+ "id": "thumbs-down",
+ "unicode": "f165",
+ "created": 3.2,
+ "filter": [
+ "dislike",
+ "disapprove",
+ "disagree",
+ "hand"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "YouTube Square",
+ "id": "youtube-square",
+ "unicode": "f166",
+ "created": 3.2,
+ "filter": [
+ "video",
+ "film"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "YouTube",
+ "id": "youtube",
+ "unicode": "f167",
+ "created": 3.2,
+ "filter": [
+ "video",
+ "film"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Xing",
+ "id": "xing",
+ "unicode": "f168",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Xing Square",
+ "id": "xing-square",
+ "unicode": "f169",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "YouTube Play",
+ "id": "youtube-play",
+ "unicode": "f16a",
+ "created": 3.2,
+ "filter": [
+ "start",
+ "playing"
+ ],
+ "categories": [
+ "Brand Icons",
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "Dropbox",
+ "id": "dropbox",
+ "unicode": "f16b",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Stack Overflow",
+ "id": "stack-overflow",
+ "unicode": "f16c",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Instagram",
+ "id": "instagram",
+ "unicode": "f16d",
+ "created": 4.6,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Flickr",
+ "id": "flickr",
+ "unicode": "f16e",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "App.net",
+ "id": "adn",
+ "unicode": "f170",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Bitbucket",
+ "id": "bitbucket",
+ "unicode": "f171",
+ "created": 3.2,
+ "filter": [
+ "git"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Bitbucket Square",
+ "id": "bitbucket-square",
+ "unicode": "f172",
+ "created": 3.2,
+ "filter": [
+ "git"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Tumblr",
+ "id": "tumblr",
+ "unicode": "f173",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Tumblr Square",
+ "id": "tumblr-square",
+ "unicode": "f174",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Long Arrow Down",
+ "id": "long-arrow-down",
+ "unicode": "f175",
+ "created": 3.2,
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Long Arrow Up",
+ "id": "long-arrow-up",
+ "unicode": "f176",
+ "created": 3.2,
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Long Arrow Left",
+ "id": "long-arrow-left",
+ "unicode": "f177",
+ "created": 3.2,
+ "filter": [
+ "previous",
+ "back"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Long Arrow Right",
+ "id": "long-arrow-right",
+ "unicode": "f178",
+ "created": 3.2,
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Apple",
+ "id": "apple",
+ "unicode": "f179",
+ "created": 3.2,
+ "filter": [
+ "osx",
+ "food"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Windows",
+ "id": "windows",
+ "unicode": "f17a",
+ "created": 3.2,
+ "filter": [
+ "microsoft"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Android",
+ "id": "android",
+ "unicode": "f17b",
+ "created": 3.2,
+ "filter": [
+ "robot"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Linux",
+ "id": "linux",
+ "unicode": "f17c",
+ "created": 3.2,
+ "filter": [
+ "tux"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Dribbble",
+ "id": "dribbble",
+ "unicode": "f17d",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Skype",
+ "id": "skype",
+ "unicode": "f17e",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Foursquare",
+ "id": "foursquare",
+ "unicode": "f180",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Trello",
+ "id": "trello",
+ "unicode": "f181",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Female",
+ "id": "female",
+ "unicode": "f182",
+ "created": 3.2,
+ "filter": [
+ "woman",
+ "user",
+ "person",
+ "profile"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Male",
+ "id": "male",
+ "unicode": "f183",
+ "created": 3.2,
+ "filter": [
+ "man",
+ "user",
+ "person",
+ "profile"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Gratipay (Gittip)",
+ "id": "gratipay",
+ "unicode": "f184",
+ "created": 3.2,
+ "aliases": [
+ "gittip"
+ ],
+ "filter": [
+ "heart",
+ "like",
+ "favorite",
+ "love"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Sun Outlined",
+ "id": "sun-o",
+ "unicode": "f185",
+ "created": 3.2,
+ "filter": [
+ "weather",
+ "contrast",
+ "lighter",
+ "brighten",
+ "day"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Moon Outlined",
+ "id": "moon-o",
+ "unicode": "f186",
+ "created": 3.2,
+ "filter": [
+ "night",
+ "darker",
+ "contrast"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Archive",
+ "id": "archive",
+ "unicode": "f187",
+ "created": 3.2,
+ "filter": [
+ "box",
+ "storage"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Bug",
+ "id": "bug",
+ "unicode": "f188",
+ "created": 3.2,
+ "filter": [
+ "report",
+ "insect"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "VK",
+ "id": "vk",
+ "unicode": "f189",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Weibo",
+ "id": "weibo",
+ "unicode": "f18a",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Renren",
+ "id": "renren",
+ "unicode": "f18b",
+ "created": 3.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Pagelines",
+ "id": "pagelines",
+ "unicode": "f18c",
+ "created": 4,
+ "filter": [
+ "leaf",
+ "leaves",
+ "tree",
+ "plant",
+ "eco",
+ "nature"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Stack Exchange",
+ "id": "stack-exchange",
+ "unicode": "f18d",
+ "created": 4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Arrow Circle Outlined Right",
+ "id": "arrow-circle-o-right",
+ "unicode": "f18e",
+ "created": 4,
+ "filter": [
+ "next",
+ "forward"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Arrow Circle Outlined Left",
+ "id": "arrow-circle-o-left",
+ "unicode": "f190",
+ "created": 4,
+ "filter": [
+ "previous",
+ "back"
+ ],
+ "categories": [
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Caret Square Outlined Left",
+ "id": "caret-square-o-left",
+ "unicode": "f191",
+ "created": 4,
+ "filter": [
+ "previous",
+ "back"
+ ],
+ "aliases": [
+ "toggle-left"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Directional Icons"
+ ]
+ },
+ {
+ "name": "Dot Circle Outlined",
+ "id": "dot-circle-o",
+ "unicode": "f192",
+ "created": 4,
+ "filter": [
+ "target",
+ "bullseye",
+ "notification"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Form Control Icons"
+ ]
+ },
+ {
+ "name": "Wheelchair",
+ "id": "wheelchair",
+ "unicode": "f193",
+ "created": 4,
+ "filter": [
+ "handicap",
+ "person"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Medical Icons",
+ "Transportation Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Vimeo Square",
+ "id": "vimeo-square",
+ "unicode": "f194",
+ "created": 4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Turkish Lira (TRY)",
+ "id": "try",
+ "unicode": "f195",
+ "created": 4,
+ "aliases": [
+ "turkish-lira"
+ ],
+ "categories": [
+ "Currency Icons"
+ ]
+ },
+ {
+ "name": "Plus Square Outlined",
+ "id": "plus-square-o",
+ "unicode": "f196",
+ "created": 4,
+ "filter": [
+ "add",
+ "new",
+ "create",
+ "expand"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Form Control Icons"
+ ]
+ },
+ {
+ "name": "Space Shuttle",
+ "id": "space-shuttle",
+ "unicode": "f197",
+ "created": 4.1,
+ "filter": null,
+ "categories": [
+ "Web Application Icons",
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "Slack Logo",
+ "id": "slack",
+ "unicode": "f198",
+ "created": 4.1,
+ "filter": [
+ "hashtag",
+ "anchor",
+ "hash"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Envelope Square",
+ "id": "envelope-square",
+ "unicode": "f199",
+ "created": 4.1,
+ "filter": [
+ "email",
+ "e-mail",
+ "letter",
+ "support",
+ "mail",
+ "message",
+ "notification"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "WordPress Logo",
+ "id": "wordpress",
+ "unicode": "f19a",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "OpenID",
+ "id": "openid",
+ "unicode": "f19b",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "University",
+ "id": "university",
+ "unicode": "f19c",
+ "created": 4.1,
+ "aliases": [
+ "institution",
+ "bank"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Graduation Cap",
+ "id": "graduation-cap",
+ "unicode": "f19d",
+ "created": 4.1,
+ "aliases": [
+ "mortar-board"
+ ],
+ "filter": [
+ "learning",
+ "school",
+ "student"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Yahoo Logo",
+ "id": "yahoo",
+ "unicode": "f19e",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Google Logo",
+ "id": "google",
+ "unicode": "f1a0",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "reddit Logo",
+ "id": "reddit",
+ "unicode": "f1a1",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "reddit Square",
+ "id": "reddit-square",
+ "unicode": "f1a2",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "StumbleUpon Circle",
+ "id": "stumbleupon-circle",
+ "unicode": "f1a3",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "StumbleUpon Logo",
+ "id": "stumbleupon",
+ "unicode": "f1a4",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Delicious Logo",
+ "id": "delicious",
+ "unicode": "f1a5",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Digg Logo",
+ "id": "digg",
+ "unicode": "f1a6",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Pied Piper PP Logo (Old)",
+ "id": "pied-piper-pp",
+ "unicode": "f1a7",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Pied Piper Alternate Logo",
+ "id": "pied-piper-alt",
+ "unicode": "f1a8",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Drupal Logo",
+ "id": "drupal",
+ "unicode": "f1a9",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Joomla Logo",
+ "id": "joomla",
+ "unicode": "f1aa",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Language",
+ "id": "language",
+ "unicode": "f1ab",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Fax",
+ "id": "fax",
+ "unicode": "f1ac",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Building",
+ "id": "building",
+ "unicode": "f1ad",
+ "created": 4.1,
+ "filter": [
+ "work",
+ "business",
+ "apartment",
+ "office",
+ "company"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Child",
+ "id": "child",
+ "unicode": "f1ae",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Paw",
+ "id": "paw",
+ "unicode": "f1b0",
+ "created": 4.1,
+ "filter": [
+ "pet"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "spoon",
+ "id": "spoon",
+ "unicode": "f1b1",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Cube",
+ "id": "cube",
+ "unicode": "f1b2",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Cubes",
+ "id": "cubes",
+ "unicode": "f1b3",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Behance",
+ "id": "behance",
+ "unicode": "f1b4",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Behance Square",
+ "id": "behance-square",
+ "unicode": "f1b5",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Steam",
+ "id": "steam",
+ "unicode": "f1b6",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Steam Square",
+ "id": "steam-square",
+ "unicode": "f1b7",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Recycle",
+ "id": "recycle",
+ "unicode": "f1b8",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Car",
+ "id": "car",
+ "unicode": "f1b9",
+ "created": 4.1,
+ "aliases": [
+ "automobile"
+ ],
+ "filter": [
+ "vehicle"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "Taxi",
+ "id": "taxi",
+ "unicode": "f1ba",
+ "created": 4.1,
+ "aliases": [
+ "cab"
+ ],
+ "filter": [
+ "vehicle"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "Tree",
+ "id": "tree",
+ "unicode": "f1bb",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Spotify",
+ "id": "spotify",
+ "unicode": "f1bc",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "deviantART",
+ "id": "deviantart",
+ "unicode": "f1bd",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "SoundCloud",
+ "id": "soundcloud",
+ "unicode": "f1be",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Database",
+ "id": "database",
+ "unicode": "f1c0",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "PDF File Outlined",
+ "id": "file-pdf-o",
+ "unicode": "f1c1",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons",
+ "File Type Icons"
+ ]
+ },
+ {
+ "name": "Word File Outlined",
+ "id": "file-word-o",
+ "unicode": "f1c2",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons",
+ "File Type Icons"
+ ]
+ },
+ {
+ "name": "Excel File Outlined",
+ "id": "file-excel-o",
+ "unicode": "f1c3",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons",
+ "File Type Icons"
+ ]
+ },
+ {
+ "name": "Powerpoint File Outlined",
+ "id": "file-powerpoint-o",
+ "unicode": "f1c4",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons",
+ "File Type Icons"
+ ]
+ },
+ {
+ "name": "Image File Outlined",
+ "id": "file-image-o",
+ "unicode": "f1c5",
+ "created": 4.1,
+ "aliases": [
+ "file-photo-o",
+ "file-picture-o"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "File Type Icons"
+ ]
+ },
+ {
+ "name": "Archive File Outlined",
+ "id": "file-archive-o",
+ "unicode": "f1c6",
+ "created": 4.1,
+ "aliases": [
+ "file-zip-o"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "File Type Icons"
+ ]
+ },
+ {
+ "name": "Audio File Outlined",
+ "id": "file-audio-o",
+ "unicode": "f1c7",
+ "created": 4.1,
+ "aliases": [
+ "file-sound-o"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "File Type Icons"
+ ]
+ },
+ {
+ "name": "Video File Outlined",
+ "id": "file-video-o",
+ "unicode": "f1c8",
+ "created": 4.1,
+ "aliases": [
+ "file-movie-o"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "File Type Icons"
+ ]
+ },
+ {
+ "name": "Code File Outlined",
+ "id": "file-code-o",
+ "unicode": "f1c9",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons",
+ "File Type Icons"
+ ]
+ },
+ {
+ "name": "Vine",
+ "id": "vine",
+ "unicode": "f1ca",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Codepen",
+ "id": "codepen",
+ "unicode": "f1cb",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "jsFiddle",
+ "id": "jsfiddle",
+ "unicode": "f1cc",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Life Ring",
+ "id": "life-ring",
+ "unicode": "f1cd",
+ "created": 4.1,
+ "aliases": [
+ {
+ "life-bouy": "Deprecated - remove in 5.0.0"
+ },
+ "life-buoy",
+ "life-saver",
+ "support"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Circle Outlined Notched",
+ "id": "circle-o-notch",
+ "unicode": "f1ce",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons",
+ "Spinner Icons"
+ ]
+ },
+ {
+ "name": "Rebel Alliance",
+ "id": "rebel",
+ "unicode": "f1d0",
+ "created": 4.1,
+ "aliases": [
+ "ra",
+ "resistance"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Galactic Empire",
+ "id": "empire",
+ "unicode": "f1d1",
+ "created": 4.1,
+ "aliases": [
+ "ge"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Git Square",
+ "id": "git-square",
+ "unicode": "f1d2",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Git",
+ "id": "git",
+ "unicode": "f1d3",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Hacker News",
+ "id": "hacker-news",
+ "unicode": "f1d4",
+ "created": 4.1,
+ "aliases": [
+ "y-combinator-square",
+ "yc-square"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Tencent Weibo",
+ "id": "tencent-weibo",
+ "unicode": "f1d5",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "QQ",
+ "id": "qq",
+ "unicode": "f1d6",
+ "created": 4.1,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Weixin (WeChat)",
+ "id": "weixin",
+ "unicode": "f1d7",
+ "created": 4.1,
+ "aliases": [
+ "wechat"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Paper Plane",
+ "id": "paper-plane",
+ "unicode": "f1d8",
+ "created": 4.1,
+ "aliases": [
+ "send"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Paper Plane Outlined",
+ "id": "paper-plane-o",
+ "unicode": "f1d9",
+ "created": 4.1,
+ "aliases": [
+ "send-o"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "History",
+ "id": "history",
+ "unicode": "f1da",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Circle Outlined Thin",
+ "id": "circle-thin",
+ "unicode": "f1db",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "header",
+ "id": "header",
+ "unicode": "f1dc",
+ "created": 4.1,
+ "filter": [
+ "heading"
+ ],
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "paragraph",
+ "id": "paragraph",
+ "unicode": "f1dd",
+ "created": 4.1,
+ "categories": [
+ "Text Editor Icons"
+ ]
+ },
+ {
+ "name": "Sliders",
+ "id": "sliders",
+ "unicode": "f1de",
+ "created": 4.1,
+ "filter": [
+ "settings"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Share Alt",
+ "id": "share-alt",
+ "unicode": "f1e0",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons",
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Share Alt Square",
+ "id": "share-alt-square",
+ "unicode": "f1e1",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons",
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Bomb",
+ "id": "bomb",
+ "unicode": "f1e2",
+ "created": 4.1,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Futbol Outlined",
+ "id": "futbol-o",
+ "unicode": "f1e3",
+ "created": 4.2,
+ "aliases": [
+ "soccer-ball-o"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "TTY",
+ "id": "tty",
+ "unicode": "f1e4",
+ "created": 4.2,
+ "categories": [
+ "Web Application Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Binoculars",
+ "id": "binoculars",
+ "unicode": "f1e5",
+ "created": 4.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Plug",
+ "id": "plug",
+ "unicode": "f1e6",
+ "created": 4.2,
+ "filter": [
+ "power",
+ "connect"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Slideshare",
+ "id": "slideshare",
+ "unicode": "f1e7",
+ "created": 4.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Twitch",
+ "id": "twitch",
+ "unicode": "f1e8",
+ "created": 4.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Yelp",
+ "id": "yelp",
+ "unicode": "f1e9",
+ "created": 4.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Newspaper Outlined",
+ "id": "newspaper-o",
+ "unicode": "f1ea",
+ "created": 4.2,
+ "filter": [
+ "press"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "WiFi",
+ "id": "wifi",
+ "unicode": "f1eb",
+ "created": 4.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Calculator",
+ "id": "calculator",
+ "unicode": "f1ec",
+ "created": 4.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Paypal",
+ "id": "paypal",
+ "unicode": "f1ed",
+ "created": 4.2,
+ "categories": [
+ "Brand Icons",
+ "Payment Icons"
+ ]
+ },
+ {
+ "name": "Google Wallet",
+ "id": "google-wallet",
+ "unicode": "f1ee",
+ "created": 4.2,
+ "categories": [
+ "Brand Icons",
+ "Payment Icons"
+ ]
+ },
+ {
+ "name": "Visa Credit Card",
+ "id": "cc-visa",
+ "unicode": "f1f0",
+ "created": 4.2,
+ "categories": [
+ "Brand Icons",
+ "Payment Icons"
+ ]
+ },
+ {
+ "name": "MasterCard Credit Card",
+ "id": "cc-mastercard",
+ "unicode": "f1f1",
+ "created": 4.2,
+ "categories": [
+ "Brand Icons",
+ "Payment Icons"
+ ]
+ },
+ {
+ "name": "Discover Credit Card",
+ "id": "cc-discover",
+ "unicode": "f1f2",
+ "created": 4.2,
+ "categories": [
+ "Brand Icons",
+ "Payment Icons"
+ ]
+ },
+ {
+ "name": "American Express Credit Card",
+ "id": "cc-amex",
+ "unicode": "f1f3",
+ "created": 4.2,
+ "filter": [
+ "amex"
+ ],
+ "categories": [
+ "Brand Icons",
+ "Payment Icons"
+ ]
+ },
+ {
+ "name": "Paypal Credit Card",
+ "id": "cc-paypal",
+ "unicode": "f1f4",
+ "created": 4.2,
+ "categories": [
+ "Brand Icons",
+ "Payment Icons"
+ ]
+ },
+ {
+ "name": "Stripe Credit Card",
+ "id": "cc-stripe",
+ "unicode": "f1f5",
+ "created": 4.2,
+ "categories": [
+ "Brand Icons",
+ "Payment Icons"
+ ]
+ },
+ {
+ "name": "Bell Slash",
+ "id": "bell-slash",
+ "unicode": "f1f6",
+ "created": 4.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Bell Slash Outlined",
+ "id": "bell-slash-o",
+ "unicode": "f1f7",
+ "created": 4.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Trash",
+ "id": "trash",
+ "unicode": "f1f8",
+ "created": 4.2,
+ "filter": [
+ "garbage",
+ "delete",
+ "remove",
+ "hide"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Copyright",
+ "id": "copyright",
+ "unicode": "f1f9",
+ "created": 4.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "At",
+ "id": "at",
+ "unicode": "f1fa",
+ "created": 4.2,
+ "filter": [
+ "email",
+ "e-mail"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Eyedropper",
+ "id": "eyedropper",
+ "unicode": "f1fb",
+ "created": 4.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Paint Brush",
+ "id": "paint-brush",
+ "unicode": "f1fc",
+ "created": 4.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Birthday Cake",
+ "id": "birthday-cake",
+ "unicode": "f1fd",
+ "created": 4.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Area Chart",
+ "id": "area-chart",
+ "unicode": "f1fe",
+ "created": 4.2,
+ "filter": [
+ "graph",
+ "analytics"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Chart Icons"
+ ]
+ },
+ {
+ "name": "Pie Chart",
+ "id": "pie-chart",
+ "unicode": "f200",
+ "created": 4.2,
+ "filter": [
+ "graph",
+ "analytics"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Chart Icons"
+ ]
+ },
+ {
+ "name": "Line Chart",
+ "id": "line-chart",
+ "unicode": "f201",
+ "created": 4.2,
+ "filter": [
+ "graph",
+ "analytics"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Chart Icons"
+ ]
+ },
+ {
+ "name": "last.fm",
+ "id": "lastfm",
+ "unicode": "f202",
+ "created": 4.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "last.fm Square",
+ "id": "lastfm-square",
+ "unicode": "f203",
+ "created": 4.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Toggle Off",
+ "id": "toggle-off",
+ "unicode": "f204",
+ "created": 4.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Toggle On",
+ "id": "toggle-on",
+ "unicode": "f205",
+ "created": 4.2,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Bicycle",
+ "id": "bicycle",
+ "unicode": "f206",
+ "created": 4.2,
+ "filter": [
+ "vehicle",
+ "bike"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "Bus",
+ "id": "bus",
+ "unicode": "f207",
+ "created": 4.2,
+ "filter": [
+ "vehicle"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "ioxhost",
+ "id": "ioxhost",
+ "unicode": "f208",
+ "created": 4.2,
+ "url": "ioxhost.co.uk",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "AngelList",
+ "id": "angellist",
+ "unicode": "f209",
+ "created": 4.2,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Closed Captions",
+ "id": "cc",
+ "unicode": "f20a",
+ "created": 4.2,
+ "categories": [
+ "Web Application Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Shekel (ILS)",
+ "id": "ils",
+ "unicode": "f20b",
+ "created": 4.2,
+ "aliases": [
+ "shekel",
+ "sheqel"
+ ],
+ "categories": [
+ "Currency Icons"
+ ]
+ },
+ {
+ "name": "meanpath",
+ "id": "meanpath",
+ "unicode": "f20c",
+ "created": 4.2,
+ "url": "meanpath.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "BuySellAds",
+ "id": "buysellads",
+ "unicode": "f20d",
+ "created": 4.3,
+ "url": "buysellads.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Connect Develop",
+ "id": "connectdevelop",
+ "unicode": "f20e",
+ "created": 4.3,
+ "url": "connectdevelop.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "DashCube",
+ "id": "dashcube",
+ "unicode": "f210",
+ "created": 4.3,
+ "url": "dashcube.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Forumbee",
+ "id": "forumbee",
+ "unicode": "f211",
+ "created": 4.3,
+ "url": "forumbee.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Leanpub",
+ "id": "leanpub",
+ "unicode": "f212",
+ "created": 4.3,
+ "url": "leanpub.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Sellsy",
+ "id": "sellsy",
+ "unicode": "f213",
+ "created": 4.3,
+ "url": "sellsy.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Shirts in Bulk",
+ "id": "shirtsinbulk",
+ "unicode": "f214",
+ "created": 4.3,
+ "url": "shirtsinbulk.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "SimplyBuilt",
+ "id": "simplybuilt",
+ "unicode": "f215",
+ "created": 4.3,
+ "url": "simplybuilt.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "skyatlas",
+ "id": "skyatlas",
+ "unicode": "f216",
+ "created": 4.3,
+ "url": "skyatlas.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Add to Shopping Cart",
+ "id": "cart-plus",
+ "unicode": "f217",
+ "created": 4.3,
+ "filter": [
+ "add",
+ "shopping"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Shopping Cart Arrow Down",
+ "id": "cart-arrow-down",
+ "unicode": "f218",
+ "created": 4.3,
+ "filter": [
+ "shopping"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Diamond",
+ "id": "diamond",
+ "unicode": "f219",
+ "created": 4.3,
+ "filter": [
+ "gem",
+ "gemstone"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Ship",
+ "id": "ship",
+ "unicode": "f21a",
+ "created": 4.3,
+ "filter": [
+ "boat",
+ "sea"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "User Secret",
+ "id": "user-secret",
+ "unicode": "f21b",
+ "created": 4.3,
+ "filter": [
+ "whisper",
+ "spy",
+ "incognito",
+ "privacy"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Motorcycle",
+ "id": "motorcycle",
+ "unicode": "f21c",
+ "created": 4.3,
+ "filter": [
+ "vehicle",
+ "bike"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "Street View",
+ "id": "street-view",
+ "unicode": "f21d",
+ "created": 4.3,
+ "filter": [
+ "map"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Heartbeat",
+ "id": "heartbeat",
+ "unicode": "f21e",
+ "created": 4.3,
+ "filter": [
+ "ekg"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Medical Icons"
+ ]
+ },
+ {
+ "name": "Venus",
+ "id": "venus",
+ "unicode": "f221",
+ "created": 4.3,
+ "filter": [
+ "female"
+ ],
+ "categories": [
+ "Gender Icons"
+ ]
+ },
+ {
+ "name": "Mars",
+ "id": "mars",
+ "unicode": "f222",
+ "created": 4.3,
+ "filter": [
+ "male"
+ ],
+ "categories": [
+ "Gender Icons"
+ ]
+ },
+ {
+ "name": "Mercury",
+ "id": "mercury",
+ "unicode": "f223",
+ "created": 4.3,
+ "filter": [
+ "transgender"
+ ],
+ "categories": [
+ "Gender Icons"
+ ]
+ },
+ {
+ "name": "Transgender",
+ "id": "transgender",
+ "unicode": "f224",
+ "created": 4.3,
+ "aliases": [
+ "intersex"
+ ],
+ "categories": [
+ "Gender Icons"
+ ]
+ },
+ {
+ "name": "Transgender Alt",
+ "id": "transgender-alt",
+ "unicode": "f225",
+ "created": 4.3,
+ "categories": [
+ "Gender Icons"
+ ]
+ },
+ {
+ "name": "Venus Double",
+ "id": "venus-double",
+ "unicode": "f226",
+ "created": 4.3,
+ "categories": [
+ "Gender Icons"
+ ]
+ },
+ {
+ "name": "Mars Double",
+ "id": "mars-double",
+ "unicode": "f227",
+ "created": 4.3,
+ "categories": [
+ "Gender Icons"
+ ]
+ },
+ {
+ "name": "Venus Mars",
+ "id": "venus-mars",
+ "unicode": "f228",
+ "created": 4.3,
+ "categories": [
+ "Gender Icons"
+ ]
+ },
+ {
+ "name": "Mars Stroke",
+ "id": "mars-stroke",
+ "unicode": "f229",
+ "created": 4.3,
+ "categories": [
+ "Gender Icons"
+ ]
+ },
+ {
+ "name": "Mars Stroke Vertical",
+ "id": "mars-stroke-v",
+ "unicode": "f22a",
+ "created": 4.3,
+ "categories": [
+ "Gender Icons"
+ ]
+ },
+ {
+ "name": "Mars Stroke Horizontal",
+ "id": "mars-stroke-h",
+ "unicode": "f22b",
+ "created": 4.3,
+ "categories": [
+ "Gender Icons"
+ ]
+ },
+ {
+ "name": "Neuter",
+ "id": "neuter",
+ "unicode": "f22c",
+ "created": 4.3,
+ "categories": [
+ "Gender Icons"
+ ]
+ },
+ {
+ "name": "Genderless",
+ "id": "genderless",
+ "unicode": "f22d",
+ "created": 4.4,
+ "categories": [
+ "Gender Icons"
+ ]
+ },
+ {
+ "name": "Facebook Official",
+ "id": "facebook-official",
+ "unicode": "f230",
+ "created": 4.3,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Pinterest P",
+ "id": "pinterest-p",
+ "unicode": "f231",
+ "created": 4.3,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "What's App",
+ "id": "whatsapp",
+ "unicode": "f232",
+ "created": 4.3,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Server",
+ "id": "server",
+ "unicode": "f233",
+ "created": 4.3,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Add User",
+ "id": "user-plus",
+ "unicode": "f234",
+ "created": 4.3,
+ "filter": [
+ "sign up",
+ "signup"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Remove User",
+ "id": "user-times",
+ "unicode": "f235",
+ "created": 4.3,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Bed",
+ "id": "bed",
+ "unicode": "f236",
+ "created": 4.3,
+ "filter": [
+ "travel"
+ ],
+ "aliases": [
+ "hotel"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Viacoin",
+ "id": "viacoin",
+ "unicode": "f237",
+ "created": 4.3,
+ "url": "viacoin.org",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Train",
+ "id": "train",
+ "unicode": "f238",
+ "created": 4.3,
+ "categories": [
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "Subway",
+ "id": "subway",
+ "unicode": "f239",
+ "created": 4.3,
+ "categories": [
+ "Transportation Icons"
+ ]
+ },
+ {
+ "name": "Medium",
+ "id": "medium",
+ "unicode": "f23a",
+ "created": 4.3,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Y Combinator",
+ "id": "y-combinator",
+ "unicode": "f23b",
+ "created": 4.4,
+ "aliases": [
+ "yc"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Optin Monster",
+ "id": "optin-monster",
+ "unicode": "f23c",
+ "created": 4.4,
+ "url": "optinmonster.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "OpenCart",
+ "id": "opencart",
+ "unicode": "f23d",
+ "created": 4.4,
+ "url": "opencart.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "ExpeditedSSL",
+ "id": "expeditedssl",
+ "unicode": "f23e",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Battery Full",
+ "id": "battery-full",
+ "unicode": "f240",
+ "created": 4.4,
+ "aliases": [
+ "battery-4",
+ "battery"
+ ],
+ "filter": [
+ "power"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Battery 3/4 Full",
+ "id": "battery-three-quarters",
+ "unicode": "f241",
+ "created": 4.4,
+ "aliases": [
+ "battery-3"
+ ],
+ "filter": [
+ "power"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Battery 1/2 Full",
+ "id": "battery-half",
+ "unicode": "f242",
+ "created": 4.4,
+ "aliases": [
+ "battery-2"
+ ],
+ "filter": [
+ "power"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Battery 1/4 Full",
+ "id": "battery-quarter",
+ "unicode": "f243",
+ "created": 4.4,
+ "aliases": [
+ "battery-1"
+ ],
+ "filter": [
+ "power"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Battery Empty",
+ "id": "battery-empty",
+ "unicode": "f244",
+ "created": 4.4,
+ "aliases": [
+ "battery-0"
+ ],
+ "filter": [
+ "power"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Mouse Pointer",
+ "id": "mouse-pointer",
+ "unicode": "f245",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "I Beam Cursor",
+ "id": "i-cursor",
+ "unicode": "f246",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Object Group",
+ "id": "object-group",
+ "unicode": "f247",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Object Ungroup",
+ "id": "object-ungroup",
+ "unicode": "f248",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Sticky Note",
+ "id": "sticky-note",
+ "unicode": "f249",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Sticky Note Outlined",
+ "id": "sticky-note-o",
+ "unicode": "f24a",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "JCB Credit Card",
+ "id": "cc-jcb",
+ "unicode": "f24b",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons",
+ "Payment Icons"
+ ]
+ },
+ {
+ "name": "Diner's Club Credit Card",
+ "id": "cc-diners-club",
+ "unicode": "f24c",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons",
+ "Payment Icons"
+ ]
+ },
+ {
+ "name": "Clone",
+ "id": "clone",
+ "unicode": "f24d",
+ "created": 4.4,
+ "filter": [
+ "copy"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Balance Scale",
+ "id": "balance-scale",
+ "unicode": "f24e",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Hourglass Outlined",
+ "id": "hourglass-o",
+ "unicode": "f250",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Hourglass Start",
+ "id": "hourglass-start",
+ "unicode": "f251",
+ "created": 4.4,
+ "aliases": [
+ "hourglass-1"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Hourglass Half",
+ "id": "hourglass-half",
+ "unicode": "f252",
+ "created": 4.4,
+ "aliases": [
+ "hourglass-2"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Hourglass End",
+ "id": "hourglass-end",
+ "unicode": "f253",
+ "created": 4.4,
+ "aliases": [
+ "hourglass-3"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Hourglass",
+ "id": "hourglass",
+ "unicode": "f254",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Rock (Hand)",
+ "id": "hand-rock-o",
+ "unicode": "f255",
+ "created": 4.4,
+ "aliases": [
+ "hand-grab-o"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "Paper (Hand)",
+ "id": "hand-paper-o",
+ "unicode": "f256",
+ "created": 4.4,
+ "aliases": [
+ "hand-stop-o"
+ ],
+ "filter": [
+ "stop"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "Scissors (Hand)",
+ "id": "hand-scissors-o",
+ "unicode": "f257",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "Lizard (Hand)",
+ "id": "hand-lizard-o",
+ "unicode": "f258",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "Spock (Hand)",
+ "id": "hand-spock-o",
+ "unicode": "f259",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "Hand Pointer",
+ "id": "hand-pointer-o",
+ "unicode": "f25a",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "Hand Peace",
+ "id": "hand-peace-o",
+ "unicode": "f25b",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons",
+ "Hand Icons"
+ ]
+ },
+ {
+ "name": "Trademark",
+ "id": "trademark",
+ "unicode": "f25c",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Registered Trademark",
+ "id": "registered",
+ "unicode": "f25d",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Creative Commons",
+ "id": "creative-commons",
+ "unicode": "f25e",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "GG Currency",
+ "id": "gg",
+ "unicode": "f260",
+ "created": 4.4,
+ "categories": [
+ "Currency Icons",
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "GG Currency Circle",
+ "id": "gg-circle",
+ "unicode": "f261",
+ "created": 4.4,
+ "categories": [
+ "Currency Icons",
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "TripAdvisor",
+ "id": "tripadvisor",
+ "unicode": "f262",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Odnoklassniki",
+ "id": "odnoklassniki",
+ "unicode": "f263",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Odnoklassniki Square",
+ "id": "odnoklassniki-square",
+ "unicode": "f264",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Get Pocket",
+ "id": "get-pocket",
+ "unicode": "f265",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Wikipedia W",
+ "id": "wikipedia-w",
+ "unicode": "f266",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Safari",
+ "id": "safari",
+ "unicode": "f267",
+ "created": 4.4,
+ "filter": [
+ "browser"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Chrome",
+ "id": "chrome",
+ "unicode": "f268",
+ "created": 4.4,
+ "filter": [
+ "browser"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Firefox",
+ "id": "firefox",
+ "unicode": "f269",
+ "created": 4.4,
+ "filter": [
+ "browser"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Opera",
+ "id": "opera",
+ "unicode": "f26a",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Internet-explorer",
+ "id": "internet-explorer",
+ "unicode": "f26b",
+ "created": 4.4,
+ "filter": [
+ "browser",
+ "ie"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Television",
+ "id": "television",
+ "unicode": "f26c",
+ "created": 4.4,
+ "aliases": [
+ "tv"
+ ],
+ "filter": [
+ "display",
+ "computer",
+ "monitor"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Contao",
+ "id": "contao",
+ "unicode": "f26d",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "500px",
+ "id": "500px",
+ "unicode": "f26e",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Amazon",
+ "id": "amazon",
+ "unicode": "f270",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Calendar Plus Outlined",
+ "id": "calendar-plus-o",
+ "unicode": "f271",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Calendar Minus Outlined",
+ "id": "calendar-minus-o",
+ "unicode": "f272",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Calendar Times Outlined",
+ "id": "calendar-times-o",
+ "unicode": "f273",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Calendar Check Outlined",
+ "id": "calendar-check-o",
+ "unicode": "f274",
+ "created": 4.4,
+ "filter": [
+ "ok"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Industry",
+ "id": "industry",
+ "unicode": "f275",
+ "created": 4.4,
+ "filter": [
+ "factory"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Map Pin",
+ "id": "map-pin",
+ "unicode": "f276",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Map Signs",
+ "id": "map-signs",
+ "unicode": "f277",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Map Outlined",
+ "id": "map-o",
+ "unicode": "f278",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Map",
+ "id": "map",
+ "unicode": "f279",
+ "created": 4.4,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Commenting",
+ "id": "commenting",
+ "unicode": "f27a",
+ "created": 4.4,
+ "filter": [
+ "speech",
+ "notification",
+ "note",
+ "chat",
+ "bubble",
+ "feedback",
+ "message",
+ "texting",
+ "sms",
+ "conversation"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Commenting Outlined",
+ "id": "commenting-o",
+ "unicode": "f27b",
+ "created": 4.4,
+ "filter": [
+ "speech",
+ "notification",
+ "note",
+ "chat",
+ "bubble",
+ "feedback",
+ "message",
+ "texting",
+ "sms",
+ "conversation"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Houzz",
+ "id": "houzz",
+ "unicode": "f27c",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Vimeo",
+ "id": "vimeo",
+ "unicode": "f27d",
+ "created": 4.4,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Font Awesome Black Tie",
+ "id": "black-tie",
+ "unicode": "f27e",
+ "created": 4.4,
+ "url": "blacktie.io",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Fonticons",
+ "id": "fonticons",
+ "unicode": "f280",
+ "created": 4.4,
+ "url": "fonticons.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "reddit Alien",
+ "id": "reddit-alien",
+ "unicode": "f281",
+ "created": 4.5,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Edge Browser",
+ "id": "edge",
+ "unicode": "f282",
+ "created": 4.5,
+ "filter": [
+ "browser",
+ "ie"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Credit Card",
+ "id": "credit-card-alt",
+ "unicode": "f283",
+ "created": 4.5,
+ "filter": [
+ "money",
+ "buy",
+ "debit",
+ "checkout",
+ "purchase",
+ "payment",
+ "credit card"
+ ],
+ "categories": [
+ "Payment Icons",
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Codie Pie",
+ "id": "codiepie",
+ "unicode": "f284",
+ "created": 4.5,
+ "url": "codiepie.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "MODX",
+ "id": "modx",
+ "unicode": "f285",
+ "created": 4.5,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Fort Awesome",
+ "id": "fort-awesome",
+ "unicode": "f286",
+ "created": 4.5,
+ "url": "fortawesome.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "USB",
+ "id": "usb",
+ "unicode": "f287",
+ "created": 4.5,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Product Hunt",
+ "id": "product-hunt",
+ "unicode": "f288",
+ "created": 4.5,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Mixcloud",
+ "id": "mixcloud",
+ "unicode": "f289",
+ "created": 4.5,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Scribd",
+ "id": "scribd",
+ "unicode": "f28a",
+ "created": 4.5,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Pause Circle",
+ "id": "pause-circle",
+ "unicode": "f28b",
+ "created": 4.5,
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "Pause Circle Outlined",
+ "id": "pause-circle-o",
+ "unicode": "f28c",
+ "created": 4.5,
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "Stop Circle",
+ "id": "stop-circle",
+ "unicode": "f28d",
+ "created": 4.5,
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "Stop Circle Outlined",
+ "id": "stop-circle-o",
+ "unicode": "f28e",
+ "created": 4.5,
+ "categories": [
+ "Video Player Icons"
+ ]
+ },
+ {
+ "name": "Shopping Bag",
+ "id": "shopping-bag",
+ "unicode": "f290",
+ "created": 4.5,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Shopping Basket",
+ "id": "shopping-basket",
+ "unicode": "f291",
+ "created": 4.5,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Hashtag",
+ "id": "hashtag",
+ "unicode": "f292",
+ "created": 4.5,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Bluetooth",
+ "id": "bluetooth",
+ "unicode": "f293",
+ "created": 4.5,
+ "categories": [
+ "Web Application Icons",
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Bluetooth",
+ "id": "bluetooth-b",
+ "unicode": "f294",
+ "created": 4.5,
+ "categories": [
+ "Web Application Icons",
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Percent",
+ "id": "percent",
+ "unicode": "f295",
+ "created": 4.5,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "GitLab",
+ "id": "gitlab",
+ "unicode": "f296",
+ "created": 4.6,
+ "url": "gitlab.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "WPBeginner",
+ "id": "wpbeginner",
+ "unicode": "f297",
+ "created": 4.6,
+ "url": "wpbeginner.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "WPForms",
+ "id": "wpforms",
+ "unicode": "f298",
+ "created": 4.6,
+ "url": "wpforms.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Envira Gallery",
+ "id": "envira",
+ "unicode": "f299",
+ "created": 4.6,
+ "url": "enviragallery.com",
+ "filter": [
+ "leaf"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Universal Access",
+ "id": "universal-access",
+ "unicode": "f29a",
+ "created": 4.6,
+ "categories": [
+ "Web Application Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Wheelchair Alt",
+ "id": "wheelchair-alt",
+ "unicode": "f29b",
+ "created": 4.6,
+ "filter": [
+ "handicap",
+ "person"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Medical Icons",
+ "Transportation Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Question Circle Outlined",
+ "id": "question-circle-o",
+ "unicode": "f29c",
+ "created": 4.6,
+ "categories": [
+ "Web Application Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Blind",
+ "id": "blind",
+ "unicode": "f29d",
+ "created": 4.6,
+ "categories": [
+ "Web Application Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Audio Description",
+ "id": "audio-description",
+ "unicode": "f29e",
+ "created": 4.6,
+ "categories": [
+ "Web Application Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Volume Control Phone",
+ "id": "volume-control-phone",
+ "unicode": "f2a0",
+ "created": 4.6,
+ "filter": [
+ "telephone"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Braille",
+ "id": "braille",
+ "unicode": "f2a1",
+ "created": 4.6,
+ "categories": [
+ "Web Application Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Assistive Listening Systems",
+ "id": "assistive-listening-systems",
+ "unicode": "f2a2",
+ "created": 4.6,
+ "categories": [
+ "Web Application Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "American Sign Language Interpreting",
+ "id": "american-sign-language-interpreting",
+ "unicode": "f2a3",
+ "created": 4.6,
+ "aliases": [
+ "asl-interpreting"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Deaf",
+ "id": "deaf",
+ "unicode": "f2a4",
+ "created": 4.6,
+ "aliases": [
+ "deafness",
+ "hard-of-hearing"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Glide",
+ "id": "glide",
+ "unicode": "f2a5",
+ "created": 4.6,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Glide G",
+ "id": "glide-g",
+ "unicode": "f2a6",
+ "created": 4.6,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Sign Language",
+ "id": "sign-language",
+ "unicode": "f2a7",
+ "created": 4.6,
+ "aliases": [
+ "signing"
+ ],
+ "categories": [
+ "Web Application Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Low Vision",
+ "id": "low-vision",
+ "unicode": "f2a8",
+ "created": 4.6,
+ "categories": [
+ "Web Application Icons",
+ "Accessibility Icons"
+ ]
+ },
+ {
+ "name": "Viadeo",
+ "id": "viadeo",
+ "unicode": "f2a9",
+ "created": 4.6,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Viadeo Square",
+ "id": "viadeo-square",
+ "unicode": "f2aa",
+ "created": 4.6,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Snapchat",
+ "id": "snapchat",
+ "unicode": "f2ab",
+ "created": 4.6,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Snapchat Ghost",
+ "id": "snapchat-ghost",
+ "unicode": "f2ac",
+ "created": 4.6,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Snapchat Square",
+ "id": "snapchat-square",
+ "unicode": "f2ad",
+ "created": 4.6,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Pied Piper Logo",
+ "id": "pied-piper",
+ "unicode": "f2ae",
+ "created": 4.6,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "First Order",
+ "id": "first-order",
+ "unicode": "f2b0",
+ "created": 4.6,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Yoast",
+ "id": "yoast",
+ "unicode": "f2b1",
+ "created": 4.6,
+ "url": "yoast.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "ThemeIsle",
+ "id": "themeisle",
+ "unicode": "f2b2",
+ "created": 4.6,
+ "url": "themeisle.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Google Plus Official",
+ "id": "google-plus-official",
+ "unicode": "f2b3",
+ "created": 4.6,
+ "aliases": [
+ "google-plus-circle"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Font Awesome",
+ "id": "font-awesome",
+ "unicode": "f2b4",
+ "created": 4.6,
+ "aliases": [
+ "fa"
+ ],
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Handshake Outlined",
+ "id": "handshake-o",
+ "unicode": "f2b5",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Envelope Open",
+ "id": "envelope-open",
+ "unicode": "f2b6",
+ "created": 4.7,
+ "filter": [
+ "email",
+ "e-mail",
+ "letter",
+ "support",
+ "mail",
+ "message",
+ "notification"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Envelope Open Outlined",
+ "id": "envelope-open-o",
+ "unicode": "f2b7",
+ "created": 4.7,
+ "filter": [
+ "email",
+ "e-mail",
+ "letter",
+ "support",
+ "mail",
+ "message",
+ "notification"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Linode",
+ "id": "linode",
+ "unicode": "f2b8",
+ "created": 4.7,
+ "url": "linode.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Address Book",
+ "id": "address-book",
+ "unicode": "f2b9",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Address Book Outlined",
+ "id": "address-book-o",
+ "unicode": "f2ba",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Address Card",
+ "id": "address-card",
+ "unicode": "f2bb",
+ "created": 4.7,
+ "aliases": [
+ "vcard"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Address Card Outlined",
+ "id": "address-card-o",
+ "unicode": "f2bc",
+ "created": 4.7,
+ "aliases": [
+ "vcard-o"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "User Circle",
+ "id": "user-circle",
+ "unicode": "f2bd",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "User Circle Outlined",
+ "id": "user-circle-o",
+ "unicode": "f2be",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "User Outlined",
+ "id": "user-o",
+ "unicode": "f2c0",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Identification Badge",
+ "id": "id-badge",
+ "unicode": "f2c1",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Identification Card",
+ "id": "id-card",
+ "unicode": "f2c2",
+ "created": 4.7,
+ "aliases": [
+ "drivers-license"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Identification Card Outlined",
+ "id": "id-card-o",
+ "unicode": "f2c3",
+ "created": 4.7,
+ "aliases": [
+ "drivers-license-o"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Quora",
+ "id": "quora",
+ "unicode": "f2c4",
+ "created": 4.7,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Free Code Camp",
+ "id": "free-code-camp",
+ "unicode": "f2c5",
+ "created": 4.7,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Telegram",
+ "id": "telegram",
+ "unicode": "f2c6",
+ "created": 4.7,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Thermometer Full",
+ "id": "thermometer-full",
+ "unicode": "f2c7",
+ "created": 4.7,
+ "aliases": [
+ "thermometer-4",
+ "thermometer"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Thermometer 3/4 Full",
+ "id": "thermometer-three-quarters",
+ "unicode": "f2c8",
+ "created": 4.7,
+ "aliases": [
+ "thermometer-3"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Thermometer 1/2 Full",
+ "id": "thermometer-half",
+ "unicode": "f2c9",
+ "created": 4.7,
+ "aliases": [
+ "thermometer-2"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Thermometer 1/4 Full",
+ "id": "thermometer-quarter",
+ "unicode": "f2ca",
+ "created": 4.7,
+ "aliases": [
+ "thermometer-1"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Thermometer Empty",
+ "id": "thermometer-empty",
+ "unicode": "f2cb",
+ "created": 4.7,
+ "aliases": [
+ "thermometer-0"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Shower",
+ "id": "shower",
+ "unicode": "f2cc",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Bath",
+ "id": "bath",
+ "unicode": "f2cd",
+ "created": 4.7,
+ "aliases": [
+ "bathtub",
+ "s15"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Podcast",
+ "id": "podcast",
+ "unicode": "f2ce",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Window Maximize",
+ "id": "window-maximize",
+ "unicode": "f2d0",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Window Minimize",
+ "id": "window-minimize",
+ "unicode": "f2d1",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Window Restore",
+ "id": "window-restore",
+ "unicode": "f2d2",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Window Close",
+ "id": "window-close",
+ "unicode": "f2d3",
+ "created": 4.7,
+ "aliases": [
+ "times-rectangle"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Window Close Outline",
+ "id": "window-close-o",
+ "unicode": "f2d4",
+ "created": 4.7,
+ "aliases": [
+ "times-rectangle-o"
+ ],
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Bandcamp",
+ "id": "bandcamp",
+ "unicode": "f2d5",
+ "created": 4.7,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Grav",
+ "id": "grav",
+ "unicode": "f2d6",
+ "created": 4.7,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Etsy",
+ "id": "etsy",
+ "unicode": "f2d7",
+ "created": 4.7,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "IMDB",
+ "id": "imdb",
+ "unicode": "f2d8",
+ "created": 4.7,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Ravelry",
+ "id": "ravelry",
+ "unicode": "f2d9",
+ "created": 4.7,
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Eercast",
+ "id": "eercast",
+ "unicode": "f2da",
+ "created": 4.7,
+ "url": "eercast.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Microchip",
+ "id": "microchip",
+ "unicode": "f2db",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Snowflake Outlined",
+ "id": "snowflake-o",
+ "unicode": "f2dc",
+ "created": 4.7,
+ "categories": [
+ "Web Application Icons"
+ ]
+ },
+ {
+ "name": "Superpowers",
+ "id": "superpowers",
+ "unicode": "f2dd",
+ "created": 4.7,
+ "url": "superpowers.io",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "WPExplorer",
+ "id": "wpexplorer",
+ "unicode": "f2de",
+ "created": 4.7,
+ "url": "wpexplorer.com",
+ "categories": [
+ "Brand Icons"
+ ]
+ },
+ {
+ "name": "Meetup",
+ "id": "meetup",
+ "unicode": "f2e0",
+ "created": 4.7,
+ "categories": [
+ "Brand Icons"
+ ]
+ }
+ ]
+}
diff --git a/assets/kirki/assets/vendor/selectWoo/css/select2.css b/assets/kirki/assets/vendor/selectWoo/css/select2.css
new file mode 100644
index 0000000..6b4d251
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/css/select2.css
@@ -0,0 +1,484 @@
+.select2-container {
+ box-sizing: border-box;
+ display: inline-block;
+ margin: 0;
+ position: relative;
+ vertical-align: middle; }
+ .select2-container .select2-selection--single {
+ box-sizing: border-box;
+ cursor: pointer;
+ display: block;
+ height: 28px;
+ user-select: none;
+ -webkit-user-select: none; }
+ .select2-container .select2-selection--single .select2-selection__rendered {
+ display: block;
+ padding-left: 8px;
+ padding-right: 20px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap; }
+ .select2-container .select2-selection--single .select2-selection__clear {
+ position: relative; }
+ .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
+ padding-right: 8px;
+ padding-left: 20px; }
+ .select2-container .select2-selection--multiple {
+ box-sizing: border-box;
+ cursor: pointer;
+ display: block;
+ min-height: 32px;
+ user-select: none;
+ -webkit-user-select: none; }
+ .select2-container .select2-selection--multiple .select2-selection__rendered {
+ display: inline-block;
+ overflow: hidden;
+ padding-left: 8px;
+ text-overflow: ellipsis;
+ white-space: nowrap; }
+ .select2-container .select2-search--inline {
+ float: left; }
+ .select2-container .select2-search--inline .select2-search__field {
+ box-sizing: border-box;
+ border: none;
+ font-size: 100%;
+ margin-top: 5px;
+ padding: 0; }
+ .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
+ -webkit-appearance: none; }
+
+.select2-dropdown {
+ background-color: white;
+ border: 1px solid #aaa;
+ border-radius: 4px;
+ box-sizing: border-box;
+ display: block;
+ position: absolute;
+ left: -100000px;
+ width: 100%;
+ z-index: 1051; }
+
+.select2-results {
+ display: block; }
+
+.select2-results__options {
+ list-style: none;
+ margin: 0;
+ padding: 0; }
+
+.select2-results__option {
+ padding: 6px;
+ user-select: none;
+ -webkit-user-select: none; }
+ .select2-results__option[data-selected] {
+ cursor: pointer; }
+
+.select2-container--open .select2-dropdown {
+ left: 0; }
+
+.select2-container--open .select2-dropdown--above {
+ border-bottom: none;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0; }
+
+.select2-container--open .select2-dropdown--below {
+ border-top: none;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0; }
+
+.select2-search--dropdown {
+ display: block;
+ padding: 4px; }
+ .select2-search--dropdown .select2-search__field {
+ padding: 4px;
+ width: 100%;
+ box-sizing: border-box; }
+ .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
+ -webkit-appearance: none; }
+ .select2-search--dropdown.select2-search--hide {
+ display: none; }
+
+.select2-close-mask {
+ border: 0;
+ margin: 0;
+ padding: 0;
+ display: block;
+ position: fixed;
+ left: 0;
+ top: 0;
+ min-height: 100%;
+ min-width: 100%;
+ height: auto;
+ width: auto;
+ opacity: 0;
+ z-index: 99;
+ background-color: #fff;
+ filter: alpha(opacity=0); }
+
+.select2-hidden-accessible {
+ border: 0 !important;
+ clip: rect(0 0 0 0) !important;
+ height: 1px !important;
+ margin: -1px !important;
+ overflow: hidden !important;
+ padding: 0 !important;
+ position: absolute !important;
+ width: 1px !important; }
+
+.select2-container--default .select2-selection--single {
+ background-color: #fff;
+ border: 1px solid #aaa;
+ border-radius: 4px; }
+ .select2-container--default .select2-selection--single .select2-selection__rendered {
+ color: #444;
+ line-height: 28px; }
+ .select2-container--default .select2-selection--single .select2-selection__clear {
+ cursor: pointer;
+ float: right;
+ font-weight: bold; }
+ .select2-container--default .select2-selection--single .select2-selection__placeholder {
+ color: #999; }
+ .select2-container--default .select2-selection--single .select2-selection__arrow {
+ height: 26px;
+ position: absolute;
+ top: 1px;
+ right: 1px;
+ width: 20px; }
+ .select2-container--default .select2-selection--single .select2-selection__arrow b {
+ border-color: #888 transparent transparent transparent;
+ border-style: solid;
+ border-width: 5px 4px 0 4px;
+ height: 0;
+ left: 50%;
+ margin-left: -4px;
+ margin-top: -2px;
+ position: absolute;
+ top: 50%;
+ width: 0; }
+
+.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
+ float: left; }
+
+.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
+ left: 1px;
+ right: auto; }
+
+.select2-container--default.select2-container--disabled .select2-selection--single {
+ background-color: #eee;
+ cursor: default; }
+ .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
+ display: none; }
+
+.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
+ border-color: transparent transparent #888 transparent;
+ border-width: 0 4px 5px 4px; }
+
+.select2-container--default .select2-selection--multiple {
+ background-color: white;
+ border: 1px solid #aaa;
+ border-radius: 4px;
+ cursor: text; }
+ .select2-container--default .select2-selection--multiple .select2-selection__rendered {
+ box-sizing: border-box;
+ list-style: none;
+ margin: 0;
+ padding: 0 5px;
+ width: 100%; }
+ .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
+ list-style: none; }
+ .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
+ color: #999;
+ margin-top: 5px;
+ float: left; }
+ .select2-container--default .select2-selection--multiple .select2-selection__clear {
+ cursor: pointer;
+ float: right;
+ font-weight: bold;
+ margin-top: 5px;
+ margin-right: 10px; }
+ .select2-container--default .select2-selection--multiple .select2-selection__choice {
+ background-color: #e4e4e4;
+ border: 1px solid #aaa;
+ border-radius: 4px;
+ cursor: default;
+ float: left;
+ margin-right: 5px;
+ margin-top: 5px;
+ padding: 0 5px; }
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
+ color: #999;
+ cursor: pointer;
+ display: inline-block;
+ font-weight: bold;
+ margin-right: 2px; }
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
+ color: #333; }
+
+.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
+ float: right; }
+
+.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
+ margin-left: 5px;
+ margin-right: auto; }
+
+.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
+ margin-left: 2px;
+ margin-right: auto; }
+
+.select2-container--default.select2-container--focus .select2-selection--multiple {
+ border: solid black 1px;
+ outline: 0; }
+
+.select2-container--default.select2-container--disabled .select2-selection--multiple {
+ background-color: #eee;
+ cursor: default; }
+
+.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
+ display: none; }
+
+.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
+ border-top-left-radius: 0;
+ border-top-right-radius: 0; }
+
+.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0; }
+
+.select2-container--default .select2-search--dropdown .select2-search__field {
+ border: 1px solid #aaa; }
+
+.select2-container--default .select2-search--inline .select2-search__field {
+ background: transparent;
+ border: none;
+ outline: 0;
+ box-shadow: none;
+ -webkit-appearance: textfield; }
+
+.select2-container--default .select2-results > .select2-results__options {
+ max-height: 200px;
+ overflow-y: auto; }
+
+.select2-container--default .select2-results__option[role=group] {
+ padding: 0; }
+
+.select2-container--default .select2-results__option[aria-disabled=true] {
+ color: #999; }
+
+.select2-container--default .select2-results__option[data-selected=true] {
+ background-color: #ddd; }
+
+.select2-container--default .select2-results__option .select2-results__option {
+ padding-left: 1em; }
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__group {
+ padding-left: 0; }
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option {
+ margin-left: -1em;
+ padding-left: 2em; }
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
+ margin-left: -2em;
+ padding-left: 3em; }
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
+ margin-left: -3em;
+ padding-left: 4em; }
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
+ margin-left: -4em;
+ padding-left: 5em; }
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
+ margin-left: -5em;
+ padding-left: 6em; }
+
+.select2-container--default .select2-results__option--highlighted[data-selected] {
+ background-color: #5897fb;
+ color: white; }
+
+.select2-container--default .select2-results__group {
+ cursor: default;
+ display: block;
+ padding: 6px; }
+
+.select2-container--classic .select2-selection--single {
+ background-color: #f7f7f7;
+ border: 1px solid #aaa;
+ border-radius: 4px;
+ outline: 0;
+ background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
+ background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
+ background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
+ .select2-container--classic .select2-selection--single:focus {
+ border: 1px solid #5897fb; }
+ .select2-container--classic .select2-selection--single .select2-selection__rendered {
+ color: #444;
+ line-height: 28px; }
+ .select2-container--classic .select2-selection--single .select2-selection__clear {
+ cursor: pointer;
+ float: right;
+ font-weight: bold;
+ margin-right: 10px; }
+ .select2-container--classic .select2-selection--single .select2-selection__placeholder {
+ color: #999; }
+ .select2-container--classic .select2-selection--single .select2-selection__arrow {
+ background-color: #ddd;
+ border: none;
+ border-left: 1px solid #aaa;
+ border-top-right-radius: 4px;
+ border-bottom-right-radius: 4px;
+ height: 26px;
+ position: absolute;
+ top: 1px;
+ right: 1px;
+ width: 20px;
+ background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
+ background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
+ background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
+ .select2-container--classic .select2-selection--single .select2-selection__arrow b {
+ border-color: #888 transparent transparent transparent;
+ border-style: solid;
+ border-width: 5px 4px 0 4px;
+ height: 0;
+ left: 50%;
+ margin-left: -4px;
+ margin-top: -2px;
+ position: absolute;
+ top: 50%;
+ width: 0; }
+
+.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
+ float: left; }
+
+.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
+ border: none;
+ border-right: 1px solid #aaa;
+ border-radius: 0;
+ border-top-left-radius: 4px;
+ border-bottom-left-radius: 4px;
+ left: 1px;
+ right: auto; }
+
+.select2-container--classic.select2-container--open .select2-selection--single {
+ border: 1px solid #5897fb; }
+ .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
+ background: transparent;
+ border: none; }
+ .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
+ border-color: transparent transparent #888 transparent;
+ border-width: 0 4px 5px 4px; }
+
+.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
+ border-top: none;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+ background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
+ background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
+ background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
+
+.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
+ border-bottom: none;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+ background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
+ background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
+ background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
+
+.select2-container--classic .select2-selection--multiple {
+ background-color: white;
+ border: 1px solid #aaa;
+ border-radius: 4px;
+ cursor: text;
+ outline: 0; }
+ .select2-container--classic .select2-selection--multiple:focus {
+ border: 1px solid #5897fb; }
+ .select2-container--classic .select2-selection--multiple .select2-selection__rendered {
+ list-style: none;
+ margin: 0;
+ padding: 0 5px; }
+ .select2-container--classic .select2-selection--multiple .select2-selection__clear {
+ display: none; }
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice {
+ background-color: #e4e4e4;
+ border: 1px solid #aaa;
+ border-radius: 4px;
+ cursor: default;
+ float: left;
+ margin-right: 5px;
+ margin-top: 5px;
+ padding: 0 5px; }
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
+ color: #888;
+ cursor: pointer;
+ display: inline-block;
+ font-weight: bold;
+ margin-right: 2px; }
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
+ color: #555; }
+
+.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
+ float: right; }
+
+.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
+ margin-left: 5px;
+ margin-right: auto; }
+
+.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
+ margin-left: 2px;
+ margin-right: auto; }
+
+.select2-container--classic.select2-container--open .select2-selection--multiple {
+ border: 1px solid #5897fb; }
+
+.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
+ border-top: none;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0; }
+
+.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
+ border-bottom: none;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0; }
+
+.select2-container--classic .select2-search--dropdown .select2-search__field {
+ border: 1px solid #aaa;
+ outline: 0; }
+
+.select2-container--classic .select2-search--inline .select2-search__field {
+ outline: 0;
+ box-shadow: none; }
+
+.select2-container--classic .select2-dropdown {
+ background-color: white;
+ border: 1px solid transparent; }
+
+.select2-container--classic .select2-dropdown--above {
+ border-bottom: none; }
+
+.select2-container--classic .select2-dropdown--below {
+ border-top: none; }
+
+.select2-container--classic .select2-results > .select2-results__options {
+ max-height: 200px;
+ overflow-y: auto; }
+
+.select2-container--classic .select2-results__option[role=group] {
+ padding: 0; }
+
+.select2-container--classic .select2-results__option[aria-disabled=true] {
+ color: grey; }
+
+.select2-container--classic .select2-results__option--highlighted[data-selected] {
+ background-color: #3875d7;
+ color: white; }
+
+.select2-container--classic .select2-results__group {
+ cursor: default;
+ display: block;
+ padding: 6px; }
+
+.select2-container--classic.select2-container--open .select2-dropdown {
+ border-color: #5897fb; }
diff --git a/assets/kirki/assets/vendor/selectWoo/css/select2.min.css b/assets/kirki/assets/vendor/selectWoo/css/select2.min.css
new file mode 100644
index 0000000..59fa33d
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/css/select2.min.css
@@ -0,0 +1 @@
+.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[data-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[data-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[data-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[data-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
diff --git a/assets/kirki/assets/vendor/selectWoo/css/selectWoo.css b/assets/kirki/assets/vendor/selectWoo/css/selectWoo.css
new file mode 100644
index 0000000..6b4d251
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/css/selectWoo.css
@@ -0,0 +1,484 @@
+.select2-container {
+ box-sizing: border-box;
+ display: inline-block;
+ margin: 0;
+ position: relative;
+ vertical-align: middle; }
+ .select2-container .select2-selection--single {
+ box-sizing: border-box;
+ cursor: pointer;
+ display: block;
+ height: 28px;
+ user-select: none;
+ -webkit-user-select: none; }
+ .select2-container .select2-selection--single .select2-selection__rendered {
+ display: block;
+ padding-left: 8px;
+ padding-right: 20px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap; }
+ .select2-container .select2-selection--single .select2-selection__clear {
+ position: relative; }
+ .select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered {
+ padding-right: 8px;
+ padding-left: 20px; }
+ .select2-container .select2-selection--multiple {
+ box-sizing: border-box;
+ cursor: pointer;
+ display: block;
+ min-height: 32px;
+ user-select: none;
+ -webkit-user-select: none; }
+ .select2-container .select2-selection--multiple .select2-selection__rendered {
+ display: inline-block;
+ overflow: hidden;
+ padding-left: 8px;
+ text-overflow: ellipsis;
+ white-space: nowrap; }
+ .select2-container .select2-search--inline {
+ float: left; }
+ .select2-container .select2-search--inline .select2-search__field {
+ box-sizing: border-box;
+ border: none;
+ font-size: 100%;
+ margin-top: 5px;
+ padding: 0; }
+ .select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button {
+ -webkit-appearance: none; }
+
+.select2-dropdown {
+ background-color: white;
+ border: 1px solid #aaa;
+ border-radius: 4px;
+ box-sizing: border-box;
+ display: block;
+ position: absolute;
+ left: -100000px;
+ width: 100%;
+ z-index: 1051; }
+
+.select2-results {
+ display: block; }
+
+.select2-results__options {
+ list-style: none;
+ margin: 0;
+ padding: 0; }
+
+.select2-results__option {
+ padding: 6px;
+ user-select: none;
+ -webkit-user-select: none; }
+ .select2-results__option[data-selected] {
+ cursor: pointer; }
+
+.select2-container--open .select2-dropdown {
+ left: 0; }
+
+.select2-container--open .select2-dropdown--above {
+ border-bottom: none;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0; }
+
+.select2-container--open .select2-dropdown--below {
+ border-top: none;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0; }
+
+.select2-search--dropdown {
+ display: block;
+ padding: 4px; }
+ .select2-search--dropdown .select2-search__field {
+ padding: 4px;
+ width: 100%;
+ box-sizing: border-box; }
+ .select2-search--dropdown .select2-search__field::-webkit-search-cancel-button {
+ -webkit-appearance: none; }
+ .select2-search--dropdown.select2-search--hide {
+ display: none; }
+
+.select2-close-mask {
+ border: 0;
+ margin: 0;
+ padding: 0;
+ display: block;
+ position: fixed;
+ left: 0;
+ top: 0;
+ min-height: 100%;
+ min-width: 100%;
+ height: auto;
+ width: auto;
+ opacity: 0;
+ z-index: 99;
+ background-color: #fff;
+ filter: alpha(opacity=0); }
+
+.select2-hidden-accessible {
+ border: 0 !important;
+ clip: rect(0 0 0 0) !important;
+ height: 1px !important;
+ margin: -1px !important;
+ overflow: hidden !important;
+ padding: 0 !important;
+ position: absolute !important;
+ width: 1px !important; }
+
+.select2-container--default .select2-selection--single {
+ background-color: #fff;
+ border: 1px solid #aaa;
+ border-radius: 4px; }
+ .select2-container--default .select2-selection--single .select2-selection__rendered {
+ color: #444;
+ line-height: 28px; }
+ .select2-container--default .select2-selection--single .select2-selection__clear {
+ cursor: pointer;
+ float: right;
+ font-weight: bold; }
+ .select2-container--default .select2-selection--single .select2-selection__placeholder {
+ color: #999; }
+ .select2-container--default .select2-selection--single .select2-selection__arrow {
+ height: 26px;
+ position: absolute;
+ top: 1px;
+ right: 1px;
+ width: 20px; }
+ .select2-container--default .select2-selection--single .select2-selection__arrow b {
+ border-color: #888 transparent transparent transparent;
+ border-style: solid;
+ border-width: 5px 4px 0 4px;
+ height: 0;
+ left: 50%;
+ margin-left: -4px;
+ margin-top: -2px;
+ position: absolute;
+ top: 50%;
+ width: 0; }
+
+.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear {
+ float: left; }
+
+.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow {
+ left: 1px;
+ right: auto; }
+
+.select2-container--default.select2-container--disabled .select2-selection--single {
+ background-color: #eee;
+ cursor: default; }
+ .select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear {
+ display: none; }
+
+.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b {
+ border-color: transparent transparent #888 transparent;
+ border-width: 0 4px 5px 4px; }
+
+.select2-container--default .select2-selection--multiple {
+ background-color: white;
+ border: 1px solid #aaa;
+ border-radius: 4px;
+ cursor: text; }
+ .select2-container--default .select2-selection--multiple .select2-selection__rendered {
+ box-sizing: border-box;
+ list-style: none;
+ margin: 0;
+ padding: 0 5px;
+ width: 100%; }
+ .select2-container--default .select2-selection--multiple .select2-selection__rendered li {
+ list-style: none; }
+ .select2-container--default .select2-selection--multiple .select2-selection__placeholder {
+ color: #999;
+ margin-top: 5px;
+ float: left; }
+ .select2-container--default .select2-selection--multiple .select2-selection__clear {
+ cursor: pointer;
+ float: right;
+ font-weight: bold;
+ margin-top: 5px;
+ margin-right: 10px; }
+ .select2-container--default .select2-selection--multiple .select2-selection__choice {
+ background-color: #e4e4e4;
+ border: 1px solid #aaa;
+ border-radius: 4px;
+ cursor: default;
+ float: left;
+ margin-right: 5px;
+ margin-top: 5px;
+ padding: 0 5px; }
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
+ color: #999;
+ cursor: pointer;
+ display: inline-block;
+ font-weight: bold;
+ margin-right: 2px; }
+ .select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
+ color: #333; }
+
+.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder, .select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline {
+ float: right; }
+
+.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
+ margin-left: 5px;
+ margin-right: auto; }
+
+.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
+ margin-left: 2px;
+ margin-right: auto; }
+
+.select2-container--default.select2-container--focus .select2-selection--multiple {
+ border: solid black 1px;
+ outline: 0; }
+
+.select2-container--default.select2-container--disabled .select2-selection--multiple {
+ background-color: #eee;
+ cursor: default; }
+
+.select2-container--default.select2-container--disabled .select2-selection__choice__remove {
+ display: none; }
+
+.select2-container--default.select2-container--open.select2-container--above .select2-selection--single, .select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple {
+ border-top-left-radius: 0;
+ border-top-right-radius: 0; }
+
+.select2-container--default.select2-container--open.select2-container--below .select2-selection--single, .select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple {
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0; }
+
+.select2-container--default .select2-search--dropdown .select2-search__field {
+ border: 1px solid #aaa; }
+
+.select2-container--default .select2-search--inline .select2-search__field {
+ background: transparent;
+ border: none;
+ outline: 0;
+ box-shadow: none;
+ -webkit-appearance: textfield; }
+
+.select2-container--default .select2-results > .select2-results__options {
+ max-height: 200px;
+ overflow-y: auto; }
+
+.select2-container--default .select2-results__option[role=group] {
+ padding: 0; }
+
+.select2-container--default .select2-results__option[aria-disabled=true] {
+ color: #999; }
+
+.select2-container--default .select2-results__option[data-selected=true] {
+ background-color: #ddd; }
+
+.select2-container--default .select2-results__option .select2-results__option {
+ padding-left: 1em; }
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__group {
+ padding-left: 0; }
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option {
+ margin-left: -1em;
+ padding-left: 2em; }
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
+ margin-left: -2em;
+ padding-left: 3em; }
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
+ margin-left: -3em;
+ padding-left: 4em; }
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
+ margin-left: -4em;
+ padding-left: 5em; }
+ .select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option {
+ margin-left: -5em;
+ padding-left: 6em; }
+
+.select2-container--default .select2-results__option--highlighted[data-selected] {
+ background-color: #5897fb;
+ color: white; }
+
+.select2-container--default .select2-results__group {
+ cursor: default;
+ display: block;
+ padding: 6px; }
+
+.select2-container--classic .select2-selection--single {
+ background-color: #f7f7f7;
+ border: 1px solid #aaa;
+ border-radius: 4px;
+ outline: 0;
+ background-image: -webkit-linear-gradient(top, white 50%, #eeeeee 100%);
+ background-image: -o-linear-gradient(top, white 50%, #eeeeee 100%);
+ background-image: linear-gradient(to bottom, white 50%, #eeeeee 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
+ .select2-container--classic .select2-selection--single:focus {
+ border: 1px solid #5897fb; }
+ .select2-container--classic .select2-selection--single .select2-selection__rendered {
+ color: #444;
+ line-height: 28px; }
+ .select2-container--classic .select2-selection--single .select2-selection__clear {
+ cursor: pointer;
+ float: right;
+ font-weight: bold;
+ margin-right: 10px; }
+ .select2-container--classic .select2-selection--single .select2-selection__placeholder {
+ color: #999; }
+ .select2-container--classic .select2-selection--single .select2-selection__arrow {
+ background-color: #ddd;
+ border: none;
+ border-left: 1px solid #aaa;
+ border-top-right-radius: 4px;
+ border-bottom-right-radius: 4px;
+ height: 26px;
+ position: absolute;
+ top: 1px;
+ right: 1px;
+ width: 20px;
+ background-image: -webkit-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
+ background-image: -o-linear-gradient(top, #eeeeee 50%, #cccccc 100%);
+ background-image: linear-gradient(to bottom, #eeeeee 50%, #cccccc 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0); }
+ .select2-container--classic .select2-selection--single .select2-selection__arrow b {
+ border-color: #888 transparent transparent transparent;
+ border-style: solid;
+ border-width: 5px 4px 0 4px;
+ height: 0;
+ left: 50%;
+ margin-left: -4px;
+ margin-top: -2px;
+ position: absolute;
+ top: 50%;
+ width: 0; }
+
+.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear {
+ float: left; }
+
+.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow {
+ border: none;
+ border-right: 1px solid #aaa;
+ border-radius: 0;
+ border-top-left-radius: 4px;
+ border-bottom-left-radius: 4px;
+ left: 1px;
+ right: auto; }
+
+.select2-container--classic.select2-container--open .select2-selection--single {
+ border: 1px solid #5897fb; }
+ .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow {
+ background: transparent;
+ border: none; }
+ .select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b {
+ border-color: transparent transparent #888 transparent;
+ border-width: 0 4px 5px 4px; }
+
+.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single {
+ border-top: none;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0;
+ background-image: -webkit-linear-gradient(top, white 0%, #eeeeee 50%);
+ background-image: -o-linear-gradient(top, white 0%, #eeeeee 50%);
+ background-image: linear-gradient(to bottom, white 0%, #eeeeee 50%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0); }
+
+.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single {
+ border-bottom: none;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0;
+ background-image: -webkit-linear-gradient(top, #eeeeee 50%, white 100%);
+ background-image: -o-linear-gradient(top, #eeeeee 50%, white 100%);
+ background-image: linear-gradient(to bottom, #eeeeee 50%, white 100%);
+ background-repeat: repeat-x;
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0); }
+
+.select2-container--classic .select2-selection--multiple {
+ background-color: white;
+ border: 1px solid #aaa;
+ border-radius: 4px;
+ cursor: text;
+ outline: 0; }
+ .select2-container--classic .select2-selection--multiple:focus {
+ border: 1px solid #5897fb; }
+ .select2-container--classic .select2-selection--multiple .select2-selection__rendered {
+ list-style: none;
+ margin: 0;
+ padding: 0 5px; }
+ .select2-container--classic .select2-selection--multiple .select2-selection__clear {
+ display: none; }
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice {
+ background-color: #e4e4e4;
+ border: 1px solid #aaa;
+ border-radius: 4px;
+ cursor: default;
+ float: left;
+ margin-right: 5px;
+ margin-top: 5px;
+ padding: 0 5px; }
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove {
+ color: #888;
+ cursor: pointer;
+ display: inline-block;
+ font-weight: bold;
+ margin-right: 2px; }
+ .select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover {
+ color: #555; }
+
+.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
+ float: right; }
+
+.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice {
+ margin-left: 5px;
+ margin-right: auto; }
+
+.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove {
+ margin-left: 2px;
+ margin-right: auto; }
+
+.select2-container--classic.select2-container--open .select2-selection--multiple {
+ border: 1px solid #5897fb; }
+
+.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple {
+ border-top: none;
+ border-top-left-radius: 0;
+ border-top-right-radius: 0; }
+
+.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple {
+ border-bottom: none;
+ border-bottom-left-radius: 0;
+ border-bottom-right-radius: 0; }
+
+.select2-container--classic .select2-search--dropdown .select2-search__field {
+ border: 1px solid #aaa;
+ outline: 0; }
+
+.select2-container--classic .select2-search--inline .select2-search__field {
+ outline: 0;
+ box-shadow: none; }
+
+.select2-container--classic .select2-dropdown {
+ background-color: white;
+ border: 1px solid transparent; }
+
+.select2-container--classic .select2-dropdown--above {
+ border-bottom: none; }
+
+.select2-container--classic .select2-dropdown--below {
+ border-top: none; }
+
+.select2-container--classic .select2-results > .select2-results__options {
+ max-height: 200px;
+ overflow-y: auto; }
+
+.select2-container--classic .select2-results__option[role=group] {
+ padding: 0; }
+
+.select2-container--classic .select2-results__option[aria-disabled=true] {
+ color: grey; }
+
+.select2-container--classic .select2-results__option--highlighted[data-selected] {
+ background-color: #3875d7;
+ color: white; }
+
+.select2-container--classic .select2-results__group {
+ cursor: default;
+ display: block;
+ padding: 6px; }
+
+.select2-container--classic.select2-container--open .select2-dropdown {
+ border-color: #5897fb; }
diff --git a/assets/kirki/assets/vendor/selectWoo/css/selectWoo.min.css b/assets/kirki/assets/vendor/selectWoo/css/selectWoo.min.css
new file mode 100644
index 0000000..59fa33d
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/css/selectWoo.min.css
@@ -0,0 +1 @@
+.select2-container{box-sizing:border-box;display:inline-block;margin:0;position:relative;vertical-align:middle}.select2-container .select2-selection--single{box-sizing:border-box;cursor:pointer;display:block;height:28px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--single .select2-selection__rendered{display:block;padding-left:8px;padding-right:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-selection--single .select2-selection__clear{position:relative}.select2-container[dir="rtl"] .select2-selection--single .select2-selection__rendered{padding-right:8px;padding-left:20px}.select2-container .select2-selection--multiple{box-sizing:border-box;cursor:pointer;display:block;min-height:32px;user-select:none;-webkit-user-select:none}.select2-container .select2-selection--multiple .select2-selection__rendered{display:inline-block;overflow:hidden;padding-left:8px;text-overflow:ellipsis;white-space:nowrap}.select2-container .select2-search--inline{float:left}.select2-container .select2-search--inline .select2-search__field{box-sizing:border-box;border:none;font-size:100%;margin-top:5px;padding:0}.select2-container .select2-search--inline .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-dropdown{background-color:white;border:1px solid #aaa;border-radius:4px;box-sizing:border-box;display:block;position:absolute;left:-100000px;width:100%;z-index:1051}.select2-results{display:block}.select2-results__options{list-style:none;margin:0;padding:0}.select2-results__option{padding:6px;user-select:none;-webkit-user-select:none}.select2-results__option[data-selected]{cursor:pointer}.select2-container--open .select2-dropdown{left:0}.select2-container--open .select2-dropdown--above{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--open .select2-dropdown--below{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-search--dropdown{display:block;padding:4px}.select2-search--dropdown .select2-search__field{padding:4px;width:100%;box-sizing:border-box}.select2-search--dropdown .select2-search__field::-webkit-search-cancel-button{-webkit-appearance:none}.select2-search--dropdown.select2-search--hide{display:none}.select2-close-mask{border:0;margin:0;padding:0;display:block;position:fixed;left:0;top:0;min-height:100%;min-width:100%;height:auto;width:auto;opacity:0;z-index:99;background-color:#fff;filter:alpha(opacity=0)}.select2-hidden-accessible{border:0 !important;clip:rect(0 0 0 0) !important;height:1px !important;margin:-1px !important;overflow:hidden !important;padding:0 !important;position:absolute !important;width:1px !important}.select2-container--default .select2-selection--single{background-color:#fff;border:1px solid #aaa;border-radius:4px}.select2-container--default .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--default .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold}.select2-container--default .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--default .select2-selection--single .select2-selection__arrow{height:26px;position:absolute;top:1px;right:1px;width:20px}.select2-container--default .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--default[dir="rtl"] .select2-selection--single .select2-selection__arrow{left:1px;right:auto}.select2-container--default.select2-container--disabled .select2-selection--single{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection--single .select2-selection__clear{display:none}.select2-container--default.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--default .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text}.select2-container--default .select2-selection--multiple .select2-selection__rendered{box-sizing:border-box;list-style:none;margin:0;padding:0 5px;width:100%}.select2-container--default .select2-selection--multiple .select2-selection__rendered li{list-style:none}.select2-container--default .select2-selection--multiple .select2-selection__placeholder{color:#999;margin-top:5px;float:left}.select2-container--default .select2-selection--multiple .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-top:5px;margin-right:10px}.select2-container--default .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove{color:#999;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover{color:#333}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__placeholder,.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-search--inline{float:right}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--default[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--default.select2-container--focus .select2-selection--multiple{border:solid black 1px;outline:0}.select2-container--default.select2-container--disabled .select2-selection--multiple{background-color:#eee;cursor:default}.select2-container--default.select2-container--disabled .select2-selection__choice__remove{display:none}.select2-container--default.select2-container--open.select2-container--above .select2-selection--single,.select2-container--default.select2-container--open.select2-container--above .select2-selection--multiple{border-top-left-radius:0;border-top-right-radius:0}.select2-container--default.select2-container--open.select2-container--below .select2-selection--single,.select2-container--default.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--default .select2-search--dropdown .select2-search__field{border:1px solid #aaa}.select2-container--default .select2-search--inline .select2-search__field{background:transparent;border:none;outline:0;box-shadow:none;-webkit-appearance:textfield}.select2-container--default .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--default .select2-results__option[role=group]{padding:0}.select2-container--default .select2-results__option[aria-disabled=true]{color:#999}.select2-container--default .select2-results__option[data-selected=true]{background-color:#ddd}.select2-container--default .select2-results__option .select2-results__option{padding-left:1em}.select2-container--default .select2-results__option .select2-results__option .select2-results__group{padding-left:0}.select2-container--default .select2-results__option .select2-results__option .select2-results__option{margin-left:-1em;padding-left:2em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-2em;padding-left:3em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-3em;padding-left:4em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-4em;padding-left:5em}.select2-container--default .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option .select2-results__option{margin-left:-5em;padding-left:6em}.select2-container--default .select2-results__option--highlighted[data-selected]{background-color:#5897fb;color:white}.select2-container--default .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic .select2-selection--single{background-color:#f7f7f7;border:1px solid #aaa;border-radius:4px;outline:0;background-image:-webkit-linear-gradient(top, #fff 50%, #eee 100%);background-image:-o-linear-gradient(top, #fff 50%, #eee 100%);background-image:linear-gradient(to bottom, #fff 50%, #eee 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic .select2-selection--single:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--single .select2-selection__rendered{color:#444;line-height:28px}.select2-container--classic .select2-selection--single .select2-selection__clear{cursor:pointer;float:right;font-weight:bold;margin-right:10px}.select2-container--classic .select2-selection--single .select2-selection__placeholder{color:#999}.select2-container--classic .select2-selection--single .select2-selection__arrow{background-color:#ddd;border:none;border-left:1px solid #aaa;border-top-right-radius:4px;border-bottom-right-radius:4px;height:26px;position:absolute;top:1px;right:1px;width:20px;background-image:-webkit-linear-gradient(top, #eee 50%, #ccc 100%);background-image:-o-linear-gradient(top, #eee 50%, #ccc 100%);background-image:linear-gradient(to bottom, #eee 50%, #ccc 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFCCCCCC', GradientType=0)}.select2-container--classic .select2-selection--single .select2-selection__arrow b{border-color:#888 transparent transparent transparent;border-style:solid;border-width:5px 4px 0 4px;height:0;left:50%;margin-left:-4px;margin-top:-2px;position:absolute;top:50%;width:0}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__clear{float:left}.select2-container--classic[dir="rtl"] .select2-selection--single .select2-selection__arrow{border:none;border-right:1px solid #aaa;border-radius:0;border-top-left-radius:4px;border-bottom-left-radius:4px;left:1px;right:auto}.select2-container--classic.select2-container--open .select2-selection--single{border:1px solid #5897fb}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow{background:transparent;border:none}.select2-container--classic.select2-container--open .select2-selection--single .select2-selection__arrow b{border-color:transparent transparent #888 transparent;border-width:0 4px 5px 4px}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--single{border-top:none;border-top-left-radius:0;border-top-right-radius:0;background-image:-webkit-linear-gradient(top, #fff 0%, #eee 50%);background-image:-o-linear-gradient(top, #fff 0%, #eee 50%);background-image:linear-gradient(to bottom, #fff 0%, #eee 50%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFFFF', endColorstr='#FFEEEEEE', GradientType=0)}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--single{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0;background-image:-webkit-linear-gradient(top, #eee 50%, #fff 100%);background-image:-o-linear-gradient(top, #eee 50%, #fff 100%);background-image:linear-gradient(to bottom, #eee 50%, #fff 100%);background-repeat:repeat-x;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFEEEEEE', endColorstr='#FFFFFFFF', GradientType=0)}.select2-container--classic .select2-selection--multiple{background-color:white;border:1px solid #aaa;border-radius:4px;cursor:text;outline:0}.select2-container--classic .select2-selection--multiple:focus{border:1px solid #5897fb}.select2-container--classic .select2-selection--multiple .select2-selection__rendered{list-style:none;margin:0;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__clear{display:none}.select2-container--classic .select2-selection--multiple .select2-selection__choice{background-color:#e4e4e4;border:1px solid #aaa;border-radius:4px;cursor:default;float:left;margin-right:5px;margin-top:5px;padding:0 5px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove{color:#888;cursor:pointer;display:inline-block;font-weight:bold;margin-right:2px}.select2-container--classic .select2-selection--multiple .select2-selection__choice__remove:hover{color:#555}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{float:right}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice{margin-left:5px;margin-right:auto}.select2-container--classic[dir="rtl"] .select2-selection--multiple .select2-selection__choice__remove{margin-left:2px;margin-right:auto}.select2-container--classic.select2-container--open .select2-selection--multiple{border:1px solid #5897fb}.select2-container--classic.select2-container--open.select2-container--above .select2-selection--multiple{border-top:none;border-top-left-radius:0;border-top-right-radius:0}.select2-container--classic.select2-container--open.select2-container--below .select2-selection--multiple{border-bottom:none;border-bottom-left-radius:0;border-bottom-right-radius:0}.select2-container--classic .select2-search--dropdown .select2-search__field{border:1px solid #aaa;outline:0}.select2-container--classic .select2-search--inline .select2-search__field{outline:0;box-shadow:none}.select2-container--classic .select2-dropdown{background-color:#fff;border:1px solid transparent}.select2-container--classic .select2-dropdown--above{border-bottom:none}.select2-container--classic .select2-dropdown--below{border-top:none}.select2-container--classic .select2-results>.select2-results__options{max-height:200px;overflow-y:auto}.select2-container--classic .select2-results__option[role=group]{padding:0}.select2-container--classic .select2-results__option[aria-disabled=true]{color:grey}.select2-container--classic .select2-results__option--highlighted[data-selected]{background-color:#3875d7;color:#fff}.select2-container--classic .select2-results__group{cursor:default;display:block;padding:6px}.select2-container--classic.select2-container--open .select2-dropdown{border-color:#5897fb}
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/ar.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/ar.js
new file mode 100644
index 0000000..f9d1965
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/ar.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ar",[],function(){return{errorLoading:function(){return"لا يمكن تحميل النتائج"},inputTooLong:function(e){var t=e.input.length-e.maximum;return"الرجاء حذف "+t+" عناصر"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"الرجاء إضافة "+t+" عناصر"},loadingMore:function(){return"جاري تحميل نتائج إضافية..."},maximumSelected:function(e){return"تستطيع إختيار "+e.maximum+" بنود فقط"},noResults:function(){return"لم يتم العثور على أي نتائج"},searching:function(){return"جاري البحث…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/az.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/az.js
new file mode 100644
index 0000000..ffd640f
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/az.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/az",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum;return t+" simvol silin"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t+" simvol daxil edin"},loadingMore:function(){return"Daha çox nəticə yüklənir…"},maximumSelected:function(e){return"Sadəcə "+e.maximum+" element seçə bilərsiniz"},noResults:function(){return"Nəticə tapılmadı"},searching:function(){return"Axtarılır…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/bg.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/bg.js
new file mode 100644
index 0000000..c170d3c
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/bg.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/bg",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Моля въведете с "+t+" по-малко символ";return t>1&&(n+="a"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Моля въведете още "+t+" символ";return t>1&&(n+="a"),n},loadingMore:function(){return"Зареждат се още…"},maximumSelected:function(e){var t="Можете да направите до "+e.maximum+" ";return e.maximum>1?t+="избора":t+="избор",t},noResults:function(){return"Няма намерени съвпадения"},searching:function(){return"Търсене…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/ca.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/ca.js
new file mode 100644
index 0000000..274099d
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/ca.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ca",[],function(){return{errorLoading:function(){return"La càrrega ha fallat"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Si us plau, elimina "+t+" car";return t==1?n+="àcter":n+="àcters",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Si us plau, introdueix "+t+" car";return t==1?n+="àcter":n+="àcters",n},loadingMore:function(){return"Carregant més resultats…"},maximumSelected:function(e){var t="Només es pot seleccionar "+e.maximum+" element";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No s'han trobat resultats"},searching:function(){return"Cercant…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/cs.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/cs.js
new file mode 100644
index 0000000..d50faa2
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/cs.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/cs",[],function(){function e(e,t){switch(e){case 2:return t?"dva":"dvě";case 3:return"tři";case 4:return"čtyři"}return""}return{errorLoading:function(){return"Výsledky nemohly být načteny."},inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím zadejte o jeden znak méně":n<=4?"Prosím zadejte o "+e(n,!0)+" znaky méně":"Prosím zadejte o "+n+" znaků méně"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím zadejte ještě jeden znak":n<=4?"Prosím zadejte ještě další "+e(n,!0)+" znaky":"Prosím zadejte ještě dalších "+n+" znaků"},loadingMore:function(){return"Načítají se další výsledky…"},maximumSelected:function(t){var n=t.maximum;return n==1?"Můžete zvolit jen jednu položku":n<=4?"Můžete zvolit maximálně "+e(n,!1)+" položky":"Můžete zvolit maximálně "+n+" položek"},noResults:function(){return"Nenalezeny žádné položky"},searching:function(){return"Vyhledávání…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/da.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/da.js
new file mode 100644
index 0000000..a59bd1f
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/da.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/da",[],function(){return{errorLoading:function(){return"Resultaterne kunne ikke indlæses."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Angiv venligst "+t+" tegn mindre"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Angiv venligst "+t+" tegn mere"},loadingMore:function(){return"Indlæser flere resultater…"},maximumSelected:function(e){var t="Du kan kun vælge "+e.maximum+" emne";return e.maximum!=1&&(t+="r"),t},noResults:function(){return"Ingen resultater fundet"},searching:function(){return"Søger…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/de.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/de.js
new file mode 100644
index 0000000..13c2509
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/de.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/de",[],function(){return{errorLoading:function(){return"Die Ergebnisse konnten nicht geladen werden."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Bitte "+t+" Zeichen weniger eingeben"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Bitte "+t+" Zeichen mehr eingeben"},loadingMore:function(){return"Lade mehr Ergebnisse…"},maximumSelected:function(e){var t="Sie können nur "+e.maximum+" Eintr";return e.maximum===1?t+="ag":t+="äge",t+=" auswählen",t},noResults:function(){return"Keine Übereinstimmungen gefunden"},searching:function(){return"Suche…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/el.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/el.js
new file mode 100644
index 0000000..7277ced
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/el.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/el",[],function(){return{errorLoading:function(){return"Τα αποτελέσματα δεν μπόρεσαν να φορτώσουν."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Παρακαλώ διαγράψτε "+t+" χαρακτήρ";return t==1&&(n+="α"),t!=1&&(n+="ες"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Παρακαλώ συμπληρώστε "+t+" ή περισσότερους χαρακτήρες";return n},loadingMore:function(){return"Φόρτωση περισσότερων αποτελεσμάτων…"},maximumSelected:function(e){var t="Μπορείτε να επιλέξετε μόνο "+e.maximum+" επιλογ";return e.maximum==1&&(t+="ή"),e.maximum!=1&&(t+="ές"),t},noResults:function(){return"Δεν βρέθηκαν αποτελέσματα"},searching:function(){return"Αναζήτηση…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/en.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/en.js
new file mode 100644
index 0000000..6465853
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/en.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Please delete "+t+" character";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Please enter "+t+" or more characters";return n},loadingMore:function(){return"Loading more results…"},maximumSelected:function(e){var t="You can only select "+e.maximum+" item";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/es.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/es.js
new file mode 100644
index 0000000..3fb592b
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/es.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/es",[],function(){return{errorLoading:function(){return"La carga falló"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor, elimine "+t+" car";return t==1?n+="ácter":n+="acteres",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Por favor, introduzca "+t+" car";return t==1?n+="ácter":n+="acteres",n},loadingMore:function(){return"Cargando más resultados…"},maximumSelected:function(e){var t="Sólo puede seleccionar "+e.maximum+" elemento";return e.maximum!=1&&(t+="s"),t},noResults:function(){return"No se encontraron resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/et.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/et.js
new file mode 100644
index 0000000..d9a6f09
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/et.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/et",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" vähem",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Sisesta "+t+" täht";return t!=1&&(n+="e"),n+=" rohkem",n},loadingMore:function(){return"Laen tulemusi…"},maximumSelected:function(e){var t="Saad vaid "+e.maximum+" tulemus";return e.maximum==1?t+="e":t+="t",t+=" valida",t},noResults:function(){return"Tulemused puuduvad"},searching:function(){return"Otsin…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/eu.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/eu.js
new file mode 100644
index 0000000..7fb958d
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/eu.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/eu",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gutxiago",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Idatzi ";return t==1?n+="karaktere bat":n+=t+" karaktere",n+=" gehiago",n},loadingMore:function(){return"Emaitza gehiago kargatzen…"},maximumSelected:function(e){return e.maximum===1?"Elementu bakarra hauta dezakezu":e.maximum+" elementu hauta ditzakezu soilik"},noResults:function(){return"Ez da bat datorrenik aurkitu"},searching:function(){return"Bilatzen…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/fa.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/fa.js
new file mode 100644
index 0000000..fdc16c6
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/fa.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fa",[],function(){return{errorLoading:function(){return"امکان بارگذاری نتایج وجود ندارد."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="لطفاً "+t+" کاراکتر را حذف نمایید";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="لطفاً تعداد "+t+" کاراکتر یا بیشتر وارد نمایید";return n},loadingMore:function(){return"در حال بارگذاری نتایج بیشتر..."},maximumSelected:function(e){var t="شما تنها میتوانید "+e.maximum+" آیتم را انتخاب نمایید";return t},noResults:function(){return"هیچ نتیجهای یافت نشد"},searching:function(){return"در حال جستجو..."}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/fi.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/fi.js
new file mode 100644
index 0000000..b406c66
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/fi.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fi",[],function(){return{errorLoading:function(){return"Tuloksia ei saatu ladattua."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Ole hyvä ja anna "+t+" merkkiä vähemmän"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Ole hyvä ja anna "+t+" merkkiä lisää"},loadingMore:function(){return"Ladataan lisää tuloksia…"},maximumSelected:function(e){return"Voit valita ainoastaan "+e.maximum+" kpl"},noResults:function(){return"Ei tuloksia"},searching:function(){return"Haetaan…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/fr.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/fr.js
new file mode 100644
index 0000000..524acb8
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/fr.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/fr",[],function(){return{errorLoading:function(){return"Les résultats ne peuvent pas être chargés."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Supprimez "+t+" caractère";return t!==1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Saisissez "+t+" caractère";return t!==1&&(n+="s"),n},loadingMore:function(){return"Chargement de résultats supplémentaires…"},maximumSelected:function(e){var t="Vous pouvez seulement sélectionner "+e.maximum+" élément";return e.maximum!==1&&(t+="s"),t},noResults:function(){return"Aucun résultat trouvé"},searching:function(){return"Recherche en cours…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/gl.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/gl.js
new file mode 100644
index 0000000..2799266
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/gl.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/gl",[],function(){return{errorLoading:function(){return"Non foi posíbel cargar os resultados."},inputTooLong:function(e){var t=e.input.length-e.maximum;return t===1?"Elimine un carácter":"Elimine "+t+" caracteres"},inputTooShort:function(e){var t=e.minimum-e.input.length;return t===1?"Engada un carácter":"Engada "+t+" caracteres"},loadingMore:function(){return"Cargando máis resultados…"},maximumSelected:function(e){return e.maximum===1?"Só pode seleccionar un elemento":"Só pode seleccionar "+e.maximum+" elementos"},noResults:function(){return"Non se atoparon resultados"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/he.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/he.js
new file mode 100644
index 0000000..7e0ed14
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/he.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/he",[],function(){return{errorLoading:function(){return"שגיאה בטעינת התוצאות"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="נא למחוק ";return t===1?n+="תו אחד":n+=t+" תווים",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="נא להכניס ";return t===1?n+="תו אחד":n+=t+" תווים",n+=" או יותר",n},loadingMore:function(){return"טוען תוצאות נוספות…"},maximumSelected:function(e){var t="באפשרותך לבחור עד ";return e.maximum===1?t+="פריט אחד":t+=e.maximum+" פריטים",t},noResults:function(){return"לא נמצאו תוצאות"},searching:function(){return"מחפש…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/hi.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/hi.js
new file mode 100644
index 0000000..8a8ebaf
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/hi.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hi",[],function(){return{errorLoading:function(){return"परिणामों को लोड नहीं किया जा सका।"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" अक्षर को हटा दें";return t>1&&(n=t+" अक्षरों को हटा दें "),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="कृपया "+t+" या अधिक अक्षर दर्ज करें";return n},loadingMore:function(){return"अधिक परिणाम लोड हो रहे है..."},maximumSelected:function(e){var t="आप केवल "+e.maximum+" आइटम का चयन कर सकते हैं";return t},noResults:function(){return"कोई परिणाम नहीं मिला"},searching:function(){return"खोज रहा है..."}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/hr.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/hr.js
new file mode 100644
index 0000000..8999b9c
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/hr.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hr",[],function(){function e(e){var t=" "+e+" znak";return e%10<5&&e%10>0&&(e%100<5||e%100>19)?e%10>1&&(t+="a"):t+="ova",t}return{errorLoading:function(){return"Preuzimanje nije uspjelo."},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Unesite "+e(n)},inputTooShort:function(t){var n=t.minimum-t.input.length;return"Unesite još "+e(n)},loadingMore:function(){return"Učitavanje rezultata…"},maximumSelected:function(e){return"Maksimalan broj odabranih stavki je "+e.maximum},noResults:function(){return"Nema rezultata"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/hu.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/hu.js
new file mode 100644
index 0000000..6871068
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/hu.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hu",[],function(){return{errorLoading:function(){return"Az eredmények betöltése nem sikerült."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Túl hosszú. "+t+" karakterrel több, mint kellene."},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Túl rövid. Még "+t+" karakter hiányzik."},loadingMore:function(){return"Töltés…"},maximumSelected:function(e){return"Csak "+e.maximum+" elemet lehet kiválasztani."},noResults:function(){return"Nincs találat."},searching:function(){return"Keresés…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/hy.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/hy.js
new file mode 100644
index 0000000..17cb0e7
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/hy.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/hy",[],function(){return{errorLoading:function(){return"Արդյունքները հնարավոր չէ բեռնել։"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Խնդրում ենք հեռացնել "+t+" նշան";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Խնդրում ենք մուտքագրել "+t+" կամ ավել նշաններ";return n},loadingMore:function(){return"Բեռնվում են նոր արդյունքներ․․․"},maximumSelected:function(e){var t="Դուք կարող եք ընտրել առավելագույնը "+e.maximum+" կետ";return t},noResults:function(){return"Արդյունքներ չեն գտնվել"},searching:function(){return"Որոնում․․․"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/id.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/id.js
new file mode 100644
index 0000000..876edb4
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/id.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/id",[],function(){return{errorLoading:function(){return"Data tidak boleh diambil."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Hapuskan "+t+" huruf"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Masukkan "+t+" huruf lagi"},loadingMore:function(){return"Mengambil data…"},maximumSelected:function(e){return"Anda hanya dapat memilih "+e.maximum+" pilihan"},noResults:function(){return"Tidak ada data yang sesuai"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/is.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/is.js
new file mode 100644
index 0000000..49bceb3
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/is.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/is",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vinsamlegast styttið texta um "+t+" staf";return t<=1?n:n+"i"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vinsamlegast skrifið "+t+" staf";return t>1&&(n+="i"),n+=" í viðbót",n},loadingMore:function(){return"Sæki fleiri niðurstöður…"},maximumSelected:function(e){return"Þú getur aðeins valið "+e.maximum+" atriði"},noResults:function(){return"Ekkert fannst"},searching:function(){return"Leita…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/it.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/it.js
new file mode 100644
index 0000000..37ab22d
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/it.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/it",[],function(){return{errorLoading:function(){return"I risultati non possono essere caricati."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Per favore cancella "+t+" caratter";return t!==1?n+="i":n+="e",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Per favore inserisci "+t+" o più caratteri";return n},loadingMore:function(){return"Caricando più risultati…"},maximumSelected:function(e){var t="Puoi selezionare solo "+e.maximum+" element";return e.maximum!==1?t+="i":t+="o",t},noResults:function(){return"Nessun risultato trovato"},searching:function(){return"Sto cercando…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/ja.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/ja.js
new file mode 100644
index 0000000..281e8a0
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/ja.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ja",[],function(){return{errorLoading:function(){return"結果が読み込まれませんでした"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" 文字を削除してください";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="少なくとも "+t+" 文字を入力してください";return n},loadingMore:function(){return"読み込み中…"},maximumSelected:function(e){var t=e.maximum+" 件しか選択できません";return t},noResults:function(){return"対象が見つかりません"},searching:function(){return"検索しています…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/km.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/km.js
new file mode 100644
index 0000000..0ace96e
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/km.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/km",[],function(){return{errorLoading:function(){return"មិនអាចទាញយកទិន្នន័យ"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="សូមលុបចេញ "+t+" អក្សរ";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="សូមបញ្ចូល"+t+" អក្សរ រឺ ច្រើនជាងនេះ";return n},loadingMore:function(){return"កំពុងទាញយកទិន្នន័យបន្ថែម..."},maximumSelected:function(e){var t="អ្នកអាចជ្រើសរើសបានតែ "+e.maximum+" ជម្រើសប៉ុណ្ណោះ";return t},noResults:function(){return"មិនមានលទ្ធផល"},searching:function(){return"កំពុងស្វែងរក..."}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/ko.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/ko.js
new file mode 100644
index 0000000..a8c39fb
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/ko.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ko",[],function(){return{errorLoading:function(){return"결과를 불러올 수 없습니다."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="너무 깁니다. "+t+" 글자 지워주세요.";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="너무 짧습니다. "+t+" 글자 더 입력해주세요.";return n},loadingMore:function(){return"불러오는 중…"},maximumSelected:function(e){var t="최대 "+e.maximum+"개까지만 선택 가능합니다.";return t},noResults:function(){return"결과가 없습니다."},searching:function(){return"검색 중…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/lt.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/lt.js
new file mode 100644
index 0000000..15f1478
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/lt.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lt",[],function(){function e(e,t,n,r){return e%10===1&&(e%100<11||e%100>19)?t:e%10>=2&&e%10<=9&&(e%100<11||e%100>19)?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Pašalinkite "+n+" simbol";return r+=e(n,"į","ius","ių"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Įrašykite dar "+n+" simbol";return r+=e(n,"į","ius","ių"),r},loadingMore:function(){return"Kraunama daugiau rezultatų…"},maximumSelected:function(t){var n="Jūs galite pasirinkti tik "+t.maximum+" element";return n+=e(t.maximum,"ą","us","ų"),n},noResults:function(){return"Atitikmenų nerasta"},searching:function(){return"Ieškoma…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/lv.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/lv.js
new file mode 100644
index 0000000..c55a484
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/lv.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/lv",[],function(){function e(e,t,n,r){return e===11?t:e%10===1?n:r}return{inputTooLong:function(t){var n=t.input.length-t.maximum,r="Lūdzu ievadiet par "+n;return r+=" simbol"+e(n,"iem","u","iem"),r+" mazāk"},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Lūdzu ievadiet vēl "+n;return r+=" simbol"+e(n,"us","u","us"),r},loadingMore:function(){return"Datu ielāde…"},maximumSelected:function(t){var n="Jūs varat izvēlēties ne vairāk kā "+t.maximum;return n+=" element"+e(t.maximum,"us","u","us"),n},noResults:function(){return"Sakritību nav"},searching:function(){return"Meklēšana…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/mk.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/mk.js
new file mode 100644
index 0000000..4884354
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/mk.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/mk",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Ве молиме внесете "+e.maximum+" помалку карактер";return e.maximum!==1&&(n+="и"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Ве молиме внесете уште "+e.maximum+" карактер";return e.maximum!==1&&(n+="и"),n},loadingMore:function(){return"Вчитување резултати…"},maximumSelected:function(e){var t="Можете да изберете само "+e.maximum+" ставк";return e.maximum===1?t+="а":t+="и",t},noResults:function(){return"Нема пронајдено совпаѓања"},searching:function(){return"Пребарување…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/ms.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/ms.js
new file mode 100644
index 0000000..6711f72
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/ms.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ms",[],function(){return{errorLoading:function(){return"Keputusan tidak berjaya dimuatkan."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Sila hapuskan "+t+" aksara"},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Sila masukkan "+t+" atau lebih aksara"},loadingMore:function(){return"Sedang memuatkan keputusan…"},maximumSelected:function(e){return"Anda hanya boleh memilih "+e.maximum+" pilihan"},noResults:function(){return"Tiada padanan yang ditemui"},searching:function(){return"Mencari…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/nb.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/nb.js
new file mode 100644
index 0000000..2001a3b
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/nb.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nb",[],function(){return{errorLoading:function(){return"Kunne ikke hente resultater."},inputTooLong:function(e){var t=e.input.length-e.maximum;return"Vennligst fjern "+t+" tegn"},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vennligst skriv inn ";return t>1?n+=" flere tegn":n+=" tegn til",n},loadingMore:function(){return"Laster flere resultater…"},maximumSelected:function(e){return"Du kan velge maks "+e.maximum+" elementer"},noResults:function(){return"Ingen treff"},searching:function(){return"Søker…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/nl.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/nl.js
new file mode 100644
index 0000000..0c20ad2
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/nl.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/nl",[],function(){return{errorLoading:function(){return"De resultaten konden niet worden geladen."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Gelieve "+t+" karakters te verwijderen";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Gelieve "+t+" of meer karakters in te voeren";return n},loadingMore:function(){return"Meer resultaten laden…"},maximumSelected:function(e){var t=e.maximum==1?"kan":"kunnen",n="Er "+t+" maar "+e.maximum+" item";return e.maximum!=1&&(n+="s"),n+=" worden geselecteerd",n},noResults:function(){return"Geen resultaten gevonden…"},searching:function(){return"Zoeken…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/pl.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/pl.js
new file mode 100644
index 0000000..157c4b3
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/pl.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pl",[],function(){var e=["znak","znaki","znaków"],t=["element","elementy","elementów"],n=function(t,n){if(t===1)return n[0];if(t>1&&t<=4)return n[1];if(t>=5)return n[2]};return{errorLoading:function(){return"Nie można załadować wyników."},inputTooLong:function(t){var r=t.input.length-t.maximum;return"Usuń "+r+" "+n(r,e)},inputTooShort:function(t){var r=t.minimum-t.input.length;return"Podaj przynajmniej "+r+" "+n(r,e)},loadingMore:function(){return"Trwa ładowanie…"},maximumSelected:function(e){return"Możesz zaznaczyć tylko "+e.maximum+" "+n(e.maximum,t)},noResults:function(){return"Brak wyników"},searching:function(){return"Trwa wyszukiwanie…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/pt-BR.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/pt-BR.js
new file mode 100644
index 0000000..1d066d6
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/pt-BR.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt-BR",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Apague "+t+" caracter";return t!=1&&(n+="es"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Digite "+t+" ou mais caracteres";return n},loadingMore:function(){return"Carregando mais resultados…"},maximumSelected:function(e){var t="Você só pode selecionar "+e.maximum+" ite";return e.maximum==1?t+="m":t+="ns",t},noResults:function(){return"Nenhum resultado encontrado"},searching:function(){return"Buscando…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/pt.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/pt.js
new file mode 100644
index 0000000..e200ea4
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/pt.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/pt",[],function(){return{errorLoading:function(){return"Os resultados não puderam ser carregados."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Por favor apague "+t+" ";return n+=t!=1?"caracteres":"caractere",n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Introduza "+t+" ou mais caracteres";return n},loadingMore:function(){return"A carregar mais resultados…"},maximumSelected:function(e){var t="Apenas pode seleccionar "+e.maximum+" ";return t+=e.maximum!=1?"itens":"item",t},noResults:function(){return"Sem resultados"},searching:function(){return"A procurar…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/ro.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/ro.js
new file mode 100644
index 0000000..d066a2b
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/ro.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ro",[],function(){return{errorLoading:function(){return"Rezultatele nu au putut fi incărcate."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vă rugăm să ștergeți"+t+" caracter";return t!==1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vă rugăm să introduceți "+t+"sau mai multe caractere";return n},loadingMore:function(){return"Se încarcă mai multe rezultate…"},maximumSelected:function(e){var t="Aveți voie să selectați cel mult "+e.maximum;return t+=" element",e.maximum!==1&&(t+="e"),t},noResults:function(){return"Nu au fost găsite rezultate"},searching:function(){return"Căutare…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/ru.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/ru.js
new file mode 100644
index 0000000..7ef8036
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/ru.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/ru",[],function(){function e(e,t,n,r){return e%10<5&&e%10>0&&e%100<5||e%100>20?e%10>1?n:t:r}return{errorLoading:function(){return"Невозможно загрузить результаты"},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Пожалуйста, введите на "+n+" символ";return r+=e(n,"","a","ов"),r+=" меньше",r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Пожалуйста, введите еще хотя бы "+n+" символ";return r+=e(n,"","a","ов"),r},loadingMore:function(){return"Загрузка данных…"},maximumSelected:function(t){var n="Вы можете выбрать не более "+t.maximum+" элемент";return n+=e(t.maximum,"","a","ов"),n},noResults:function(){return"Совпадений не найдено"},searching:function(){return"Поиск…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/sk.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/sk.js
new file mode 100644
index 0000000..574d862
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/sk.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sk",[],function(){var e={2:function(e){return e?"dva":"dve"},3:function(){return"tri"},4:function(){return"štyri"}};return{inputTooLong:function(t){var n=t.input.length-t.maximum;return n==1?"Prosím, zadajte o jeden znak menej":n>=2&&n<=4?"Prosím, zadajte o "+e[n](!0)+" znaky menej":"Prosím, zadajte o "+n+" znakov menej"},inputTooShort:function(t){var n=t.minimum-t.input.length;return n==1?"Prosím, zadajte ešte jeden znak":n<=4?"Prosím, zadajte ešte ďalšie "+e[n](!0)+" znaky":"Prosím, zadajte ešte ďalších "+n+" znakov"},loadingMore:function(){return"Loading more results…"},maximumSelected:function(t){return t.maximum==1?"Môžete zvoliť len jednu položku":t.maximum>=2&&t.maximum<=4?"Môžete zvoliť najviac "+e[t.maximum](!1)+" položky":"Môžete zvoliť najviac "+t.maximum+" položiek"},noResults:function(){return"Nenašli sa žiadne položky"},searching:function(){return"Vyhľadávanie…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/sl.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/sl.js
new file mode 100644
index 0000000..44e5d06
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/sl.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sl",[],function(){return{errorLoading:function(){return"Zadetkov iskanja ni bilo mogoče naložiti."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Prosim zbrišite "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Prosim vpišite še "+t+" znak";return t==2?n+="a":t!=1&&(n+="e"),n},loadingMore:function(){return"Nalagam več zadetkov…"},maximumSelected:function(e){var t="Označite lahko največ "+e.maximum+" predmet";return e.maximum==2?t+="a":e.maximum!=1&&(t+="e"),t},noResults:function(){return"Ni zadetkov."},searching:function(){return"Iščem…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/sr-Cyrl.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/sr-Cyrl.js
new file mode 100644
index 0000000..9d01257
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/sr-Cyrl.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr-Cyrl",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Преузимање није успело."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Обришите "+n+" симбол";return r+=e(n,"","а","а"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Укуцајте бар још "+n+" симбол";return r+=e(n,"","а","а"),r},loadingMore:function(){return"Преузимање још резултата…"},maximumSelected:function(t){var n="Можете изабрати само "+t.maximum+" ставк";return n+=e(t.maximum,"у","е","и"),n},noResults:function(){return"Ништа није пронађено"},searching:function(){return"Претрага…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/sr.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/sr.js
new file mode 100644
index 0000000..e635fd3
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/sr.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sr",[],function(){function e(e,t,n,r){return e%10==1&&e%100!=11?t:e%10>=2&&e%10<=4&&(e%100<12||e%100>14)?n:r}return{errorLoading:function(){return"Preuzimanje nije uspelo."},inputTooLong:function(t){var n=t.input.length-t.maximum,r="Obrišite "+n+" simbol";return r+=e(n,"","a","a"),r},inputTooShort:function(t){var n=t.minimum-t.input.length,r="Ukucajte bar još "+n+" simbol";return r+=e(n,"","a","a"),r},loadingMore:function(){return"Preuzimanje još rezultata…"},maximumSelected:function(t){var n="Možete izabrati samo "+t.maximum+" stavk";return n+=e(t.maximum,"u","e","i"),n},noResults:function(){return"Ništa nije pronađeno"},searching:function(){return"Pretraga…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/sv.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/sv.js
new file mode 100644
index 0000000..fe220e3
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/sv.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/sv",[],function(){return{errorLoading:function(){return"Resultat kunde inte laddas."},inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vänligen sudda ut "+t+" tecken";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vänligen skriv in "+t+" eller fler tecken";return n},loadingMore:function(){return"Laddar fler resultat…"},maximumSelected:function(e){var t="Du kan max välja "+e.maximum+" element";return t},noResults:function(){return"Inga träffar"},searching:function(){return"Söker…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/th.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/th.js
new file mode 100644
index 0000000..6ac7d92
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/th.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/th",[],function(){return{errorLoading:function(){return"ไม่สามารถค้นข้อมูลได้"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="โปรดลบออก "+t+" ตัวอักษร";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="โปรดพิมพ์เพิ่มอีก "+t+" ตัวอักษร";return n},loadingMore:function(){return"กำลังค้นข้อมูลเพิ่ม…"},maximumSelected:function(e){var t="คุณสามารถเลือกได้ไม่เกิน "+e.maximum+" รายการ";return t},noResults:function(){return"ไม่พบข้อมูล"},searching:function(){return"กำลังค้นข้อมูล…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/tr.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/tr.js
new file mode 100644
index 0000000..5836299
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/tr.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/tr",[],function(){return{errorLoading:function(){return"Sonuç yüklenemedi"},inputTooLong:function(e){var t=e.input.length-e.maximum,n=t+" karakter daha girmelisiniz";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="En az "+t+" karakter daha girmelisiniz";return n},loadingMore:function(){return"Daha fazla…"},maximumSelected:function(e){var t="Sadece "+e.maximum+" seçim yapabilirsiniz";return t},noResults:function(){return"Sonuç bulunamadı"},searching:function(){return"Aranıyor…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/uk.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/uk.js
new file mode 100644
index 0000000..44c603f
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/uk.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/uk",[],function(){function e(e,t,n,r){return e%100>10&&e%100<15?r:e%10===1?t:e%10>1&&e%10<5?n:r}return{errorLoading:function(){return"Неможливо завантажити результати"},inputTooLong:function(t){var n=t.input.length-t.maximum;return"Будь ласка, видаліть "+n+" "+e(t.maximum,"літеру","літери","літер")},inputTooShort:function(e){var t=e.minimum-e.input.length;return"Будь ласка, введіть "+t+" або більше літер"},loadingMore:function(){return"Завантаження інших результатів…"},maximumSelected:function(t){return"Ви можете вибрати лише "+t.maximum+" "+e(t.maximum,"пункт","пункти","пунктів")},noResults:function(){return"Нічого не знайдено"},searching:function(){return"Пошук…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/vi.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/vi.js
new file mode 100644
index 0000000..1a22705
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/vi.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/vi",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="Vui lòng nhập ít hơn "+t+" ký tự";return t!=1&&(n+="s"),n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="Vui lòng nhập nhiều hơn "+t+' ký tự"';return n},loadingMore:function(){return"Đang lấy thêm kết quả…"},maximumSelected:function(e){var t="Chỉ có thể chọn được "+e.maximum+" lựa chọn";return t},noResults:function(){return"Không tìm thấy kết quả"},searching:function(){return"Đang tìm…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/zh-CN.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/zh-CN.js
new file mode 100644
index 0000000..20b5b9b
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/zh-CN.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(e){var t=e.input.length-e.maximum,n="请删除"+t+"个字符";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="请再输入至少"+t+"个字符";return n},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(e){var t="最多只能选择"+e.maximum+"个项目";return t},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/i18n/zh-TW.js b/assets/kirki/assets/vendor/selectWoo/js/i18n/zh-TW.js
new file mode 100644
index 0000000..dfb0a2f
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/i18n/zh-TW.js
@@ -0,0 +1,3 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */
+
+(function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var e=jQuery.fn.select2.amd;return e.define("select2/i18n/zh-TW",[],function(){return{inputTooLong:function(e){var t=e.input.length-e.maximum,n="請刪掉"+t+"個字元";return n},inputTooShort:function(e){var t=e.minimum-e.input.length,n="請再輸入"+t+"個字元";return n},loadingMore:function(){return"載入中…"},maximumSelected:function(e){var t="你只能選擇最多"+e.maximum+"項";return t},noResults:function(){return"沒有找到相符的項目"},searching:function(){return"搜尋中…"}}}),{define:e.define,require:e.require}})();
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/select2.full.js b/assets/kirki/assets/vendor/selectWoo/js/select2.full.js
new file mode 100644
index 0000000..d973690
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/select2.full.js
@@ -0,0 +1,6553 @@
+/*!
+ * SelectWoo 1.0.1
+ * https://github.com/woocommerce/selectWoo
+ *
+ * Released under the MIT license
+ * https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md
+ */
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && module.exports) {
+ // Node/CommonJS
+ module.exports = function (root, jQuery) {
+ if (jQuery === undefined) {
+ // require('jQuery') returns a factory that requires window to
+ // build a jQuery instance, we normalize how we use modules
+ // that require this pattern but the window provided is a noop
+ // if it's defined (how jquery works)
+ if (typeof window !== 'undefined') {
+ jQuery = require('jquery');
+ }
+ else {
+ jQuery = require('jquery')(root);
+ }
+ }
+ factory(jQuery);
+ return jQuery;
+ };
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+} (function (jQuery) {
+ // This is needed so we can catch the AMD loader configuration and use it
+ // The inner file should be wrapped (by `banner.start.js`) in a function that
+ // returns the AMD loader references.
+ var S2 =(function () {
+ // Restore the Select2 AMD loader so it can be used
+ // Needed mostly in the language files, where the loader is not inserted
+ if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
+ var S2 = jQuery.fn.select2.amd;
+ }
+var S2;(function () { if (!S2 || !S2.requirejs) {
+if (!S2) { S2 = {}; } else { require = S2; }
+/**
+ * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
+ * Released under MIT license, http://github.com/requirejs/almond/LICENSE
+ */
+//Going sloppy to avoid 'use strict' string cost, but strict practices should
+//be followed.
+/*global setTimeout: false */
+
+var requirejs, require, define;
+(function (undef) {
+ var main, req, makeMap, handlers,
+ defined = {},
+ waiting = {},
+ config = {},
+ defining = {},
+ hasOwn = Object.prototype.hasOwnProperty,
+ aps = [].slice,
+ jsSuffixRegExp = /\.js$/;
+
+ function hasProp(obj, prop) {
+ return hasOwn.call(obj, prop);
+ }
+
+ /**
+ * Given a relative module name, like ./something, normalize it to
+ * a real name that can be mapped to a path.
+ * @param {String} name the relative name
+ * @param {String} baseName a real name that the name arg is relative
+ * to.
+ * @returns {String} normalized name
+ */
+ function normalize(name, baseName) {
+ var nameParts, nameSegment, mapValue, foundMap, lastIndex,
+ foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
+ baseParts = baseName && baseName.split("/"),
+ map = config.map,
+ starMap = (map && map['*']) || {};
+
+ //Adjust any relative paths.
+ if (name) {
+ name = name.split('/');
+ lastIndex = name.length - 1;
+
+ // If wanting node ID compatibility, strip .js from end
+ // of IDs. Have to do this here, and not in nameToUrl
+ // because node allows either .js or non .js to map
+ // to same file.
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
+ }
+
+ // Starts with a '.' so need the baseName
+ if (name[0].charAt(0) === '.' && baseParts) {
+ //Convert baseName to array, and lop off the last part,
+ //so that . matches that 'directory' and not name of the baseName's
+ //module. For instance, baseName of 'one/two/three', maps to
+ //'one/two/three.js', but we want the directory, 'one/two' for
+ //this normalization.
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
+ name = normalizedBaseParts.concat(name);
+ }
+
+ //start trimDots
+ for (i = 0; i < name.length; i++) {
+ part = name[i];
+ if (part === '.') {
+ name.splice(i, 1);
+ i -= 1;
+ } else if (part === '..') {
+ // If at the start, or previous value is still ..,
+ // keep them so that when converted to a path it may
+ // still work when converted to a path, even though
+ // as an ID it is less than ideal. In larger point
+ // releases, may be better to just kick out an error.
+ if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
+ continue;
+ } else if (i > 0) {
+ name.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ }
+ //end trimDots
+
+ name = name.join('/');
+ }
+
+ //Apply map config if available.
+ if ((baseParts || starMap) && map) {
+ nameParts = name.split('/');
+
+ for (i = nameParts.length; i > 0; i -= 1) {
+ nameSegment = nameParts.slice(0, i).join("/");
+
+ if (baseParts) {
+ //Find the longest baseName segment match in the config.
+ //So, do joins on the biggest to smallest lengths of baseParts.
+ for (j = baseParts.length; j > 0; j -= 1) {
+ mapValue = map[baseParts.slice(0, j).join('/')];
+
+ //baseName segment has config, find if it has one for
+ //this name.
+ if (mapValue) {
+ mapValue = mapValue[nameSegment];
+ if (mapValue) {
+ //Match, update name to the new value.
+ foundMap = mapValue;
+ foundI = i;
+ break;
+ }
+ }
+ }
+ }
+
+ if (foundMap) {
+ break;
+ }
+
+ //Check for a star map match, but just hold on to it,
+ //if there is a shorter segment match later in a matching
+ //config, then favor over this star map.
+ if (!foundStarMap && starMap && starMap[nameSegment]) {
+ foundStarMap = starMap[nameSegment];
+ starI = i;
+ }
+ }
+
+ if (!foundMap && foundStarMap) {
+ foundMap = foundStarMap;
+ foundI = starI;
+ }
+
+ if (foundMap) {
+ nameParts.splice(0, foundI, foundMap);
+ name = nameParts.join('/');
+ }
+ }
+
+ return name;
+ }
+
+ function makeRequire(relName, forceSync) {
+ return function () {
+ //A version of a require function that passes a moduleName
+ //value for items that may need to
+ //look up paths relative to the moduleName
+ var args = aps.call(arguments, 0);
+
+ //If first arg is not require('string'), and there is only
+ //one arg, it is the array form without a callback. Insert
+ //a null so that the following concat is correct.
+ if (typeof args[0] !== 'string' && args.length === 1) {
+ args.push(null);
+ }
+ return req.apply(undef, args.concat([relName, forceSync]));
+ };
+ }
+
+ function makeNormalize(relName) {
+ return function (name) {
+ return normalize(name, relName);
+ };
+ }
+
+ function makeLoad(depName) {
+ return function (value) {
+ defined[depName] = value;
+ };
+ }
+
+ function callDep(name) {
+ if (hasProp(waiting, name)) {
+ var args = waiting[name];
+ delete waiting[name];
+ defining[name] = true;
+ main.apply(undef, args);
+ }
+
+ if (!hasProp(defined, name) && !hasProp(defining, name)) {
+ throw new Error('No ' + name);
+ }
+ return defined[name];
+ }
+
+ //Turns a plugin!resource to [plugin, resource]
+ //with the plugin being undefined if the name
+ //did not have a plugin prefix.
+ function splitPrefix(name) {
+ var prefix,
+ index = name ? name.indexOf('!') : -1;
+ if (index > -1) {
+ prefix = name.substring(0, index);
+ name = name.substring(index + 1, name.length);
+ }
+ return [prefix, name];
+ }
+
+ //Creates a parts array for a relName where first part is plugin ID,
+ //second part is resource ID. Assumes relName has already been normalized.
+ function makeRelParts(relName) {
+ return relName ? splitPrefix(relName) : [];
+ }
+
+ /**
+ * Makes a name map, normalizing the name, and using a plugin
+ * for normalization if necessary. Grabs a ref to plugin
+ * too, as an optimization.
+ */
+ makeMap = function (name, relParts) {
+ var plugin,
+ parts = splitPrefix(name),
+ prefix = parts[0],
+ relResourceName = relParts[1];
+
+ name = parts[1];
+
+ if (prefix) {
+ prefix = normalize(prefix, relResourceName);
+ plugin = callDep(prefix);
+ }
+
+ //Normalize according
+ if (prefix) {
+ if (plugin && plugin.normalize) {
+ name = plugin.normalize(name, makeNormalize(relResourceName));
+ } else {
+ name = normalize(name, relResourceName);
+ }
+ } else {
+ name = normalize(name, relResourceName);
+ parts = splitPrefix(name);
+ prefix = parts[0];
+ name = parts[1];
+ if (prefix) {
+ plugin = callDep(prefix);
+ }
+ }
+
+ //Using ridiculous property names for space reasons
+ return {
+ f: prefix ? prefix + '!' + name : name, //fullName
+ n: name,
+ pr: prefix,
+ p: plugin
+ };
+ };
+
+ function makeConfig(name) {
+ return function () {
+ return (config && config.config && config.config[name]) || {};
+ };
+ }
+
+ handlers = {
+ require: function (name) {
+ return makeRequire(name);
+ },
+ exports: function (name) {
+ var e = defined[name];
+ if (typeof e !== 'undefined') {
+ return e;
+ } else {
+ return (defined[name] = {});
+ }
+ },
+ module: function (name) {
+ return {
+ id: name,
+ uri: '',
+ exports: defined[name],
+ config: makeConfig(name)
+ };
+ }
+ };
+
+ main = function (name, deps, callback, relName) {
+ var cjsModule, depName, ret, map, i, relParts,
+ args = [],
+ callbackType = typeof callback,
+ usingExports;
+
+ //Use name if no relName
+ relName = relName || name;
+ relParts = makeRelParts(relName);
+
+ //Call the callback to define the module, if necessary.
+ if (callbackType === 'undefined' || callbackType === 'function') {
+ //Pull out the defined dependencies and pass the ordered
+ //values to the callback.
+ //Default to [require, exports, module] if no deps
+ deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
+ for (i = 0; i < deps.length; i += 1) {
+ map = makeMap(deps[i], relParts);
+ depName = map.f;
+
+ //Fast path CommonJS standard dependencies.
+ if (depName === "require") {
+ args[i] = handlers.require(name);
+ } else if (depName === "exports") {
+ //CommonJS module spec 1.1
+ args[i] = handlers.exports(name);
+ usingExports = true;
+ } else if (depName === "module") {
+ //CommonJS module spec 1.1
+ cjsModule = args[i] = handlers.module(name);
+ } else if (hasProp(defined, depName) ||
+ hasProp(waiting, depName) ||
+ hasProp(defining, depName)) {
+ args[i] = callDep(depName);
+ } else if (map.p) {
+ map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
+ args[i] = defined[depName];
+ } else {
+ throw new Error(name + ' missing ' + depName);
+ }
+ }
+
+ ret = callback ? callback.apply(defined[name], args) : undefined;
+
+ if (name) {
+ //If setting exports via "module" is in play,
+ //favor that over return value and exports. After that,
+ //favor a non-undefined return value over exports use.
+ if (cjsModule && cjsModule.exports !== undef &&
+ cjsModule.exports !== defined[name]) {
+ defined[name] = cjsModule.exports;
+ } else if (ret !== undef || !usingExports) {
+ //Use the return value from the function.
+ defined[name] = ret;
+ }
+ }
+ } else if (name) {
+ //May just be an object definition for the module. Only
+ //worry about defining if have a module name.
+ defined[name] = callback;
+ }
+ };
+
+ requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
+ if (typeof deps === "string") {
+ if (handlers[deps]) {
+ //callback in this case is really relName
+ return handlers[deps](callback);
+ }
+ //Just return the module wanted. In this scenario, the
+ //deps arg is the module name, and second arg (if passed)
+ //is just the relName.
+ //Normalize module name, if it contains . or ..
+ return callDep(makeMap(deps, makeRelParts(callback)).f);
+ } else if (!deps.splice) {
+ //deps is a config object, not an array.
+ config = deps;
+ if (config.deps) {
+ req(config.deps, config.callback);
+ }
+ if (!callback) {
+ return;
+ }
+
+ if (callback.splice) {
+ //callback is an array, which means it is a dependency list.
+ //Adjust args if there are dependencies
+ deps = callback;
+ callback = relName;
+ relName = null;
+ } else {
+ deps = undef;
+ }
+ }
+
+ //Support require(['a'])
+ callback = callback || function () {};
+
+ //If relName is a function, it is an errback handler,
+ //so remove it.
+ if (typeof relName === 'function') {
+ relName = forceSync;
+ forceSync = alt;
+ }
+
+ //Simulate async callback;
+ if (forceSync) {
+ main(undef, deps, callback, relName);
+ } else {
+ //Using a non-zero value because of concern for what old browsers
+ //do, and latest browsers "upgrade" to 4 if lower value is used:
+ //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
+ //If want a value immediately, use require('id') instead -- something
+ //that works in almond on the global level, but not guaranteed and
+ //unlikely to work in other AMD implementations.
+ setTimeout(function () {
+ main(undef, deps, callback, relName);
+ }, 4);
+ }
+
+ return req;
+ };
+
+ /**
+ * Just drops the config on the floor, but returns req in case
+ * the config return value is used.
+ */
+ req.config = function (cfg) {
+ return req(cfg);
+ };
+
+ /**
+ * Expose module registry for debugging and tooling
+ */
+ requirejs._defined = defined;
+
+ define = function (name, deps, callback) {
+ if (typeof name !== 'string') {
+ throw new Error('See almond README: incorrect module build, no module name');
+ }
+
+ //This module may not have dependencies
+ if (!deps.splice) {
+ //deps is not an array, so probably means
+ //an object literal or factory function for
+ //the value. Adjust args.
+ callback = deps;
+ deps = [];
+ }
+
+ if (!hasProp(defined, name) && !hasProp(waiting, name)) {
+ waiting[name] = [name, deps, callback];
+ }
+ };
+
+ define.amd = {
+ jQuery: true
+ };
+}());
+
+S2.requirejs = requirejs;S2.require = require;S2.define = define;
+}
+}());
+S2.define("almond", function(){});
+
+/* global jQuery:false, $:false */
+S2.define('jquery',[],function () {
+ var _$ = jQuery || $;
+
+ if (_$ == null && console && console.error) {
+ console.error(
+ 'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
+ 'found. Make sure that you are including jQuery before Select2 on your ' +
+ 'web page.'
+ );
+ }
+
+ return _$;
+});
+
+S2.define('select2/utils',[
+ 'jquery'
+], function ($) {
+ var Utils = {};
+
+ Utils.Extend = function (ChildClass, SuperClass) {
+ var __hasProp = {}.hasOwnProperty;
+
+ function BaseConstructor () {
+ this.constructor = ChildClass;
+ }
+
+ for (var key in SuperClass) {
+ if (__hasProp.call(SuperClass, key)) {
+ ChildClass[key] = SuperClass[key];
+ }
+ }
+
+ BaseConstructor.prototype = SuperClass.prototype;
+ ChildClass.prototype = new BaseConstructor();
+ ChildClass.__super__ = SuperClass.prototype;
+
+ return ChildClass;
+ };
+
+ function getMethods (theClass) {
+ var proto = theClass.prototype;
+
+ var methods = [];
+
+ for (var methodName in proto) {
+ var m = proto[methodName];
+
+ if (typeof m !== 'function') {
+ continue;
+ }
+
+ if (methodName === 'constructor') {
+ continue;
+ }
+
+ methods.push(methodName);
+ }
+
+ return methods;
+ }
+
+ Utils.Decorate = function (SuperClass, DecoratorClass) {
+ var decoratedMethods = getMethods(DecoratorClass);
+ var superMethods = getMethods(SuperClass);
+
+ function DecoratedClass () {
+ var unshift = Array.prototype.unshift;
+
+ var argCount = DecoratorClass.prototype.constructor.length;
+
+ var calledConstructor = SuperClass.prototype.constructor;
+
+ if (argCount > 0) {
+ unshift.call(arguments, SuperClass.prototype.constructor);
+
+ calledConstructor = DecoratorClass.prototype.constructor;
+ }
+
+ calledConstructor.apply(this, arguments);
+ }
+
+ DecoratorClass.displayName = SuperClass.displayName;
+
+ function ctr () {
+ this.constructor = DecoratedClass;
+ }
+
+ DecoratedClass.prototype = new ctr();
+
+ for (var m = 0; m < superMethods.length; m++) {
+ var superMethod = superMethods[m];
+
+ DecoratedClass.prototype[superMethod] =
+ SuperClass.prototype[superMethod];
+ }
+
+ var calledMethod = function (methodName) {
+ // Stub out the original method if it's not decorating an actual method
+ var originalMethod = function () {};
+
+ if (methodName in DecoratedClass.prototype) {
+ originalMethod = DecoratedClass.prototype[methodName];
+ }
+
+ var decoratedMethod = DecoratorClass.prototype[methodName];
+
+ return function () {
+ var unshift = Array.prototype.unshift;
+
+ unshift.call(arguments, originalMethod);
+
+ return decoratedMethod.apply(this, arguments);
+ };
+ };
+
+ for (var d = 0; d < decoratedMethods.length; d++) {
+ var decoratedMethod = decoratedMethods[d];
+
+ DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
+ }
+
+ return DecoratedClass;
+ };
+
+ var Observable = function () {
+ this.listeners = {};
+ };
+
+ Observable.prototype.on = function (event, callback) {
+ this.listeners = this.listeners || {};
+
+ if (event in this.listeners) {
+ this.listeners[event].push(callback);
+ } else {
+ this.listeners[event] = [callback];
+ }
+ };
+
+ Observable.prototype.trigger = function (event) {
+ var slice = Array.prototype.slice;
+ var params = slice.call(arguments, 1);
+
+ this.listeners = this.listeners || {};
+
+ // Params should always come in as an array
+ if (params == null) {
+ params = [];
+ }
+
+ // If there are no arguments to the event, use a temporary object
+ if (params.length === 0) {
+ params.push({});
+ }
+
+ // Set the `_type` of the first object to the event
+ params[0]._type = event;
+
+ if (event in this.listeners) {
+ this.invoke(this.listeners[event], slice.call(arguments, 1));
+ }
+
+ if ('*' in this.listeners) {
+ this.invoke(this.listeners['*'], arguments);
+ }
+ };
+
+ Observable.prototype.invoke = function (listeners, params) {
+ for (var i = 0, len = listeners.length; i < len; i++) {
+ listeners[i].apply(this, params);
+ }
+ };
+
+ Utils.Observable = Observable;
+
+ Utils.generateChars = function (length) {
+ var chars = '';
+
+ for (var i = 0; i < length; i++) {
+ var randomChar = Math.floor(Math.random() * 36);
+ chars += randomChar.toString(36);
+ }
+
+ return chars;
+ };
+
+ Utils.bind = function (func, context) {
+ return function () {
+ func.apply(context, arguments);
+ };
+ };
+
+ Utils._convertData = function (data) {
+ for (var originalKey in data) {
+ var keys = originalKey.split('-');
+
+ var dataLevel = data;
+
+ if (keys.length === 1) {
+ continue;
+ }
+
+ for (var k = 0; k < keys.length; k++) {
+ var key = keys[k];
+
+ // Lowercase the first letter
+ // By default, dash-separated becomes camelCase
+ key = key.substring(0, 1).toLowerCase() + key.substring(1);
+
+ if (!(key in dataLevel)) {
+ dataLevel[key] = {};
+ }
+
+ if (k == keys.length - 1) {
+ dataLevel[key] = data[originalKey];
+ }
+
+ dataLevel = dataLevel[key];
+ }
+
+ delete data[originalKey];
+ }
+
+ return data;
+ };
+
+ Utils.hasScroll = function (index, el) {
+ // Adapted from the function created by @ShadowScripter
+ // and adapted by @BillBarry on the Stack Exchange Code Review website.
+ // The original code can be found at
+ // http://codereview.stackexchange.com/q/13338
+ // and was designed to be used with the Sizzle selector engine.
+
+ var $el = $(el);
+ var overflowX = el.style.overflowX;
+ var overflowY = el.style.overflowY;
+
+ //Check both x and y declarations
+ if (overflowX === overflowY &&
+ (overflowY === 'hidden' || overflowY === 'visible')) {
+ return false;
+ }
+
+ if (overflowX === 'scroll' || overflowY === 'scroll') {
+ return true;
+ }
+
+ return ($el.innerHeight() < el.scrollHeight ||
+ $el.innerWidth() < el.scrollWidth);
+ };
+
+ Utils.escapeMarkup = function (markup) {
+ var replaceMap = {
+ '\\': '\',
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ '\'': ''',
+ '/': '/'
+ };
+
+ // Do not try to escape the markup if it's not a string
+ if (typeof markup !== 'string') {
+ return markup;
+ }
+
+ return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
+ return replaceMap[match];
+ });
+ };
+
+ // Append an array of jQuery nodes to a given element.
+ Utils.appendMany = function ($element, $nodes) {
+ // jQuery 1.7.x does not support $.fn.append() with an array
+ // Fall back to a jQuery object collection using $.fn.add()
+ if ($.fn.jquery.substr(0, 3) === '1.7') {
+ var $jqNodes = $();
+
+ $.map($nodes, function (node) {
+ $jqNodes = $jqNodes.add(node);
+ });
+
+ $nodes = $jqNodes;
+ }
+
+ $element.append($nodes);
+ };
+
+ // Determine whether the browser is on a touchscreen device.
+ Utils.isTouchscreen = function() {
+ if ('undefined' === typeof Utils._isTouchscreenCache) {
+ Utils._isTouchscreenCache = 'ontouchstart' in document.documentElement;
+ }
+ return Utils._isTouchscreenCache;
+ }
+
+ return Utils;
+});
+
+S2.define('select2/results',[
+ 'jquery',
+ './utils'
+], function ($, Utils) {
+ function Results ($element, options, dataAdapter) {
+ this.$element = $element;
+ this.data = dataAdapter;
+ this.options = options;
+
+ Results.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(Results, Utils.Observable);
+
+ Results.prototype.render = function () {
+ var $results = $(
+ '
'
+ );
+
+ if (this.options.get('multiple')) {
+ $results.attr('aria-multiselectable', 'true');
+ }
+
+ this.$results = $results;
+
+ return $results;
+ };
+
+ Results.prototype.clear = function () {
+ this.$results.empty();
+ };
+
+ Results.prototype.displayMessage = function (params) {
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ this.clear();
+ this.hideLoading();
+
+ var $message = $(
+ '
'
+ );
+
+ var message = this.options.get('translations').get(params.message);
+
+ $message.append(
+ escapeMarkup(
+ message(params.args)
+ )
+ );
+
+ $message[0].className += ' select2-results__message';
+
+ this.$results.append($message);
+ };
+
+ Results.prototype.hideMessages = function () {
+ this.$results.find('.select2-results__message').remove();
+ };
+
+ Results.prototype.append = function (data) {
+ this.hideLoading();
+
+ var $options = [];
+
+ if (data.results == null || data.results.length === 0) {
+ if (this.$results.children().length === 0) {
+ this.trigger('results:message', {
+ message: 'noResults'
+ });
+ }
+
+ return;
+ }
+
+ data.results = this.sort(data.results);
+
+ for (var d = 0; d < data.results.length; d++) {
+ var item = data.results[d];
+
+ var $option = this.option(item);
+
+ $options.push($option);
+ }
+
+ this.$results.append($options);
+ };
+
+ Results.prototype.position = function ($results, $dropdown) {
+ var $resultsContainer = $dropdown.find('.select2-results');
+ $resultsContainer.append($results);
+ };
+
+ Results.prototype.sort = function (data) {
+ var sorter = this.options.get('sorter');
+
+ return sorter(data);
+ };
+
+ Results.prototype.highlightFirstItem = function () {
+ var $options = this.$results
+ .find('.select2-results__option[data-selected]');
+
+ var $selected = $options.filter('[data-selected=true]');
+
+ // Check if there are any selected options
+ if ($selected.length > 0) {
+ // If there are selected options, highlight the first
+ $selected.first().trigger('mouseenter');
+ } else {
+ // If there are no selected options, highlight the first option
+ // in the dropdown
+ $options.first().trigger('mouseenter');
+ }
+
+ this.ensureHighlightVisible();
+ };
+
+ Results.prototype.setClasses = function () {
+ var self = this;
+
+ this.data.current(function (selected) {
+ var selectedIds = $.map(selected, function (s) {
+ return s.id.toString();
+ });
+
+ var $options = self.$results
+ .find('.select2-results__option[data-selected]');
+
+ $options.each(function () {
+ var $option = $(this);
+
+ var item = $.data(this, 'data');
+
+ // id needs to be converted to a string when comparing
+ var id = '' + item.id;
+
+ if ((item.element != null && item.element.selected) ||
+ (item.element == null && $.inArray(id, selectedIds) > -1)) {
+ $option.attr('data-selected', 'true');
+ } else {
+ $option.attr('data-selected', 'false');
+ }
+ });
+
+ });
+ };
+
+ Results.prototype.showLoading = function (params) {
+ this.hideLoading();
+
+ var loadingMore = this.options.get('translations').get('searching');
+
+ var loading = {
+ disabled: true,
+ loading: true,
+ text: loadingMore(params)
+ };
+ var $loading = this.option(loading);
+ $loading.className += ' loading-results';
+
+ this.$results.prepend($loading);
+ };
+
+ Results.prototype.hideLoading = function () {
+ this.$results.find('.loading-results').remove();
+ };
+
+ Results.prototype.option = function (data) {
+ var option = document.createElement('li');
+ option.className = 'select2-results__option';
+
+ var attrs = {
+ 'role': 'option',
+ 'data-selected': 'false',
+ 'tabindex': -1
+ };
+
+ if (data.disabled) {
+ delete attrs['data-selected'];
+ attrs['aria-disabled'] = 'true';
+ }
+
+ if (data.id == null) {
+ delete attrs['data-selected'];
+ }
+
+ if (data._resultId != null) {
+ option.id = data._resultId;
+ }
+
+ if (data.title) {
+ option.title = data.title;
+ }
+
+ if (data.children) {
+ attrs['aria-label'] = data.text;
+ delete attrs['data-selected'];
+ }
+
+ for (var attr in attrs) {
+ var val = attrs[attr];
+
+ option.setAttribute(attr, val);
+ }
+
+ if (data.children) {
+ var $option = $(option);
+
+ var label = document.createElement('strong');
+ label.className = 'select2-results__group';
+
+ var $label = $(label);
+ this.template(data, label);
+ $label.attr('role', 'presentation');
+
+ var $children = [];
+
+ for (var c = 0; c < data.children.length; c++) {
+ var child = data.children[c];
+
+ var $child = this.option(child);
+
+ $children.push($child);
+ }
+
+ var $childrenContainer = $('
', {
+ 'class': 'select2-results__options select2-results__options--nested',
+ 'role': 'listbox'
+ });
+ $childrenContainer.append($children);
+ $option.attr('role', 'list');
+
+ $option.append(label);
+ $option.append($childrenContainer);
+ } else {
+ this.template(data, option);
+ }
+
+ $.data(option, 'data', data);
+
+ return option;
+ };
+
+ Results.prototype.bind = function (container, $container) {
+ var self = this;
+
+ var id = container.id + '-results';
+
+ this.$results.attr('id', id);
+
+ container.on('results:all', function (params) {
+ self.clear();
+ self.append(params.data);
+
+ if (container.isOpen()) {
+ self.setClasses();
+ self.highlightFirstItem();
+ }
+ });
+
+ container.on('results:append', function (params) {
+ self.append(params.data);
+
+ if (container.isOpen()) {
+ self.setClasses();
+ }
+ });
+
+ container.on('query', function (params) {
+ self.hideMessages();
+ self.showLoading(params);
+ });
+
+ container.on('select', function () {
+ if (!container.isOpen()) {
+ return;
+ }
+
+ self.setClasses();
+ self.highlightFirstItem();
+ });
+
+ container.on('unselect', function () {
+ if (!container.isOpen()) {
+ return;
+ }
+
+ self.setClasses();
+ self.highlightFirstItem();
+ });
+
+ container.on('open', function () {
+ // When the dropdown is open, aria-expended="true"
+ self.$results.attr('aria-expanded', 'true');
+ self.$results.attr('aria-hidden', 'false');
+
+ self.setClasses();
+ self.ensureHighlightVisible();
+ });
+
+ container.on('close', function () {
+ // When the dropdown is closed, aria-expended="false"
+ self.$results.attr('aria-expanded', 'false');
+ self.$results.attr('aria-hidden', 'true');
+ self.$results.removeAttr('aria-activedescendant');
+ });
+
+ container.on('results:toggle', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ if ($highlighted.length === 0) {
+ return;
+ }
+
+ $highlighted.trigger('mouseup');
+ });
+
+ container.on('results:select', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ if ($highlighted.length === 0) {
+ return;
+ }
+
+ var data = $highlighted.data('data');
+
+ if ($highlighted.attr('data-selected') == 'true') {
+ self.trigger('close', {});
+ } else {
+ self.trigger('select', {
+ data: data
+ });
+ }
+ });
+
+ container.on('results:previous', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ var $options = self.$results.find('[data-selected]');
+
+ var currentIndex = $options.index($highlighted);
+
+ // If we are already at te top, don't move further
+ if (currentIndex === 0) {
+ return;
+ }
+
+ var nextIndex = currentIndex - 1;
+
+ // If none are highlighted, highlight the first
+ if ($highlighted.length === 0) {
+ nextIndex = 0;
+ }
+
+ var $next = $options.eq(nextIndex);
+
+ $next.trigger('mouseenter');
+
+ var currentOffset = self.$results.offset().top;
+ var nextTop = $next.offset().top;
+ var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
+
+ if (nextIndex === 0) {
+ self.$results.scrollTop(0);
+ } else if (nextTop - currentOffset < 0) {
+ self.$results.scrollTop(nextOffset);
+ }
+ });
+
+ container.on('results:next', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ var $options = self.$results.find('[data-selected]');
+
+ var currentIndex = $options.index($highlighted);
+
+ var nextIndex = currentIndex + 1;
+
+ // If we are at the last option, stay there
+ if (nextIndex >= $options.length) {
+ return;
+ }
+
+ var $next = $options.eq(nextIndex);
+
+ $next.trigger('mouseenter');
+
+ var currentOffset = self.$results.offset().top +
+ self.$results.outerHeight(false);
+ var nextBottom = $next.offset().top + $next.outerHeight(false);
+ var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
+
+ if (nextIndex === 0) {
+ self.$results.scrollTop(0);
+ } else if (nextBottom > currentOffset) {
+ self.$results.scrollTop(nextOffset);
+ }
+ });
+
+ container.on('results:focus', function (params) {
+ params.element.addClass('select2-results__option--highlighted').attr('aria-selected', 'true');
+ self.$results.attr('aria-activedescendant', params.element.attr('id'));
+ });
+
+ container.on('results:message', function (params) {
+ self.displayMessage(params);
+ });
+
+ if ($.fn.mousewheel) {
+ this.$results.on('mousewheel', function (e) {
+ var top = self.$results.scrollTop();
+
+ var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
+
+ var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
+ var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
+
+ if (isAtTop) {
+ self.$results.scrollTop(0);
+
+ e.preventDefault();
+ e.stopPropagation();
+ } else if (isAtBottom) {
+ self.$results.scrollTop(
+ self.$results.get(0).scrollHeight - self.$results.height()
+ );
+
+ e.preventDefault();
+ e.stopPropagation();
+ }
+ });
+ }
+
+ this.$results.on('mouseup', '.select2-results__option[data-selected]',
+ function (evt) {
+ var $this = $(this);
+
+ var data = $this.data('data');
+
+ if ($this.attr('data-selected') === 'true') {
+ if (self.options.get('multiple')) {
+ self.trigger('unselect', {
+ originalEvent: evt,
+ data: data
+ });
+ } else {
+ self.trigger('close', {});
+ }
+
+ return;
+ }
+
+ self.trigger('select', {
+ originalEvent: evt,
+ data: data
+ });
+ });
+
+ this.$results.on('mouseenter', '.select2-results__option[data-selected]',
+ function (evt) {
+ var data = $(this).data('data');
+
+ self.getHighlightedResults()
+ .removeClass('select2-results__option--highlighted')
+ .attr('aria-selected', 'false');
+
+ self.trigger('results:focus', {
+ data: data,
+ element: $(this)
+ });
+ });
+ };
+
+ Results.prototype.getHighlightedResults = function () {
+ var $highlighted = this.$results
+ .find('.select2-results__option--highlighted');
+
+ return $highlighted;
+ };
+
+ Results.prototype.destroy = function () {
+ this.$results.remove();
+ };
+
+ Results.prototype.ensureHighlightVisible = function () {
+ var $highlighted = this.getHighlightedResults();
+
+ if ($highlighted.length === 0) {
+ return;
+ }
+
+ var $options = this.$results.find('[data-selected]');
+
+ var currentIndex = $options.index($highlighted);
+
+ var currentOffset = this.$results.offset().top;
+ var nextTop = $highlighted.offset().top;
+ var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
+
+ var offsetDelta = nextTop - currentOffset;
+ nextOffset -= $highlighted.outerHeight(false) * 2;
+
+ if (currentIndex <= 2) {
+ this.$results.scrollTop(0);
+ } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
+ this.$results.scrollTop(nextOffset);
+ }
+ };
+
+ Results.prototype.template = function (result, container) {
+ var template = this.options.get('templateResult');
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ var content = template(result, container);
+
+ if (content == null) {
+ container.style.display = 'none';
+ } else if (typeof content === 'string') {
+ container.innerHTML = escapeMarkup(content);
+ } else {
+ $(container).append(content);
+ }
+ };
+
+ return Results;
+});
+
+S2.define('select2/keys',[
+
+], function () {
+ var KEYS = {
+ BACKSPACE: 8,
+ TAB: 9,
+ ENTER: 13,
+ SHIFT: 16,
+ CTRL: 17,
+ ALT: 18,
+ ESC: 27,
+ SPACE: 32,
+ PAGE_UP: 33,
+ PAGE_DOWN: 34,
+ END: 35,
+ HOME: 36,
+ LEFT: 37,
+ UP: 38,
+ RIGHT: 39,
+ DOWN: 40,
+ DELETE: 46
+ };
+
+ return KEYS;
+});
+
+S2.define('select2/selection/base',[
+ 'jquery',
+ '../utils',
+ '../keys'
+], function ($, Utils, KEYS) {
+ function BaseSelection ($element, options) {
+ this.$element = $element;
+ this.options = options;
+
+ BaseSelection.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(BaseSelection, Utils.Observable);
+
+ BaseSelection.prototype.render = function () {
+ var $selection = $(
+ '
' +
+ ' '
+ );
+
+ this._tabindex = 0;
+
+ if (this.$element.data('old-tabindex') != null) {
+ this._tabindex = this.$element.data('old-tabindex');
+ } else if (this.$element.attr('tabindex') != null) {
+ this._tabindex = this.$element.attr('tabindex');
+ }
+
+ $selection.attr('title', this.$element.attr('title'));
+ $selection.attr('tabindex', this._tabindex);
+
+ this.$selection = $selection;
+
+ return $selection;
+ };
+
+ BaseSelection.prototype.bind = function (container, $container) {
+ var self = this;
+
+ var id = container.id + '-container';
+ var resultsId = container.id + '-results';
+ var searchHidden = this.options.get('minimumResultsForSearch') === Infinity;
+
+ this.container = container;
+
+ this.$selection.on('focus', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this.$selection.on('blur', function (evt) {
+ self._handleBlur(evt);
+ });
+
+ this.$selection.on('keydown', function (evt) {
+ self.trigger('keypress', evt);
+
+ if (evt.which === KEYS.SPACE) {
+ evt.preventDefault();
+ }
+ });
+
+ container.on('results:focus', function (params) {
+ self.$selection.attr('aria-activedescendant', params.data._resultId);
+ });
+
+ container.on('selection:update', function (params) {
+ self.update(params.data);
+ });
+
+ container.on('open', function () {
+ // When the dropdown is open, aria-expanded="true"
+ self.$selection.attr('aria-expanded', 'true');
+ self.$selection.attr('aria-owns', resultsId);
+
+ self._attachCloseHandler(container);
+ });
+
+ container.on('close', function () {
+ // When the dropdown is closed, aria-expanded="false"
+ self.$selection.attr('aria-expanded', 'false');
+ self.$selection.removeAttr('aria-activedescendant');
+ self.$selection.removeAttr('aria-owns');
+
+ // This needs to be delayed as the active element is the body when the
+ // key is pressed.
+ window.setTimeout(function () {
+ self.$selection.focus();
+ }, 1);
+
+ self._detachCloseHandler(container);
+ });
+
+ container.on('enable', function () {
+ self.$selection.attr('tabindex', self._tabindex);
+ });
+
+ container.on('disable', function () {
+ self.$selection.attr('tabindex', '-1');
+ });
+ };
+
+ BaseSelection.prototype._handleBlur = function (evt) {
+ var self = this;
+
+ // This needs to be delayed as the active element is the body when the tab
+ // key is pressed, possibly along with others.
+ window.setTimeout(function () {
+ // Don't trigger `blur` if the focus is still in the selection
+ if (
+ (document.activeElement == self.$selection[0]) ||
+ ($.contains(self.$selection[0], document.activeElement))
+ ) {
+ return;
+ }
+
+ self.trigger('blur', evt);
+ }, 1);
+ };
+
+ BaseSelection.prototype._attachCloseHandler = function (container) {
+ var self = this;
+
+ $(document.body).on('mousedown.select2.' + container.id, function (e) {
+ var $target = $(e.target);
+
+ var $select = $target.closest('.select2');
+
+ var $all = $('.select2.select2-container--open');
+
+ $all.each(function () {
+ var $this = $(this);
+
+ if (this == $select[0]) {
+ return;
+ }
+
+ var $element = $this.data('element');
+
+ $element.select2('close');
+ });
+ });
+ };
+
+ BaseSelection.prototype._detachCloseHandler = function (container) {
+ $(document.body).off('mousedown.select2.' + container.id);
+ };
+
+ BaseSelection.prototype.position = function ($selection, $container) {
+ var $selectionContainer = $container.find('.selection');
+ $selectionContainer.append($selection);
+ };
+
+ BaseSelection.prototype.destroy = function () {
+ this._detachCloseHandler(this.container);
+ };
+
+ BaseSelection.prototype.update = function (data) {
+ throw new Error('The `update` method must be defined in child classes.');
+ };
+
+ return BaseSelection;
+});
+
+S2.define('select2/selection/single',[
+ 'jquery',
+ './base',
+ '../utils',
+ '../keys'
+], function ($, BaseSelection, Utils, KEYS) {
+ function SingleSelection () {
+ SingleSelection.__super__.constructor.apply(this, arguments);
+ }
+
+ Utils.Extend(SingleSelection, BaseSelection);
+
+ SingleSelection.prototype.render = function () {
+ var $selection = SingleSelection.__super__.render.call(this);
+
+ $selection.addClass('select2-selection--single');
+
+ $selection.html(
+ '
' +
+ '
' +
+ ' ' +
+ ' '
+ );
+
+ return $selection;
+ };
+
+ SingleSelection.prototype.bind = function (container, $container) {
+ var self = this;
+
+ SingleSelection.__super__.bind.apply(this, arguments);
+
+ var id = container.id + '-container';
+
+ this.$selection.find('.select2-selection__rendered')
+ .attr('id', id)
+ .attr('role', 'textbox')
+ .attr('aria-readonly', 'true');
+ this.$selection.attr('aria-labelledby', id);
+
+ // This makes single non-search selects work in screen readers. If it causes problems elsewhere, remove.
+ this.$selection.attr('role', 'combobox');
+
+ this.$selection.on('mousedown', function (evt) {
+ // Only respond to left clicks
+ if (evt.which !== 1) {
+ return;
+ }
+
+ self.trigger('toggle', {
+ originalEvent: evt
+ });
+ });
+
+ this.$selection.on('focus', function (evt) {
+ // User focuses on the container
+ });
+
+ this.$selection.on('keydown', function (evt) {
+ // If user starts typing an alphanumeric key on the keyboard, open if not opened.
+ if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
+ container.open();
+ }
+ });
+
+ this.$selection.on('blur', function (evt) {
+ // User exits the container
+ });
+
+ container.on('focus', function (evt) {
+ if (!container.isOpen()) {
+ self.$selection.focus();
+ }
+ });
+
+ container.on('selection:update', function (params) {
+ self.update(params.data);
+ });
+ };
+
+ SingleSelection.prototype.clear = function () {
+ this.$selection.find('.select2-selection__rendered').empty();
+ };
+
+ SingleSelection.prototype.display = function (data, container) {
+ var template = this.options.get('templateSelection');
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ return escapeMarkup(template(data, container));
+ };
+
+ SingleSelection.prototype.selectionContainer = function () {
+ return $('
');
+ };
+
+ SingleSelection.prototype.update = function (data) {
+ if (data.length === 0) {
+ this.clear();
+ return;
+ }
+
+ var selection = data[0];
+
+ var $rendered = this.$selection.find('.select2-selection__rendered');
+ var formatted = this.display(selection, $rendered);
+
+ $rendered.empty().append(formatted);
+ $rendered.prop('title', selection.title || selection.text);
+ };
+
+ return SingleSelection;
+});
+
+S2.define('select2/selection/multiple',[
+ 'jquery',
+ './base',
+ '../utils'
+], function ($, BaseSelection, Utils) {
+ function MultipleSelection ($element, options) {
+ MultipleSelection.__super__.constructor.apply(this, arguments);
+ }
+
+ Utils.Extend(MultipleSelection, BaseSelection);
+
+ MultipleSelection.prototype.render = function () {
+ var $selection = MultipleSelection.__super__.render.call(this);
+
+ $selection.addClass('select2-selection--multiple');
+
+ $selection.html(
+ '
'
+ );
+
+ return $selection;
+ };
+
+ MultipleSelection.prototype.bind = function (container, $container) {
+ var self = this;
+
+ MultipleSelection.__super__.bind.apply(this, arguments);
+
+ this.$selection.on('click', function (evt) {
+ self.trigger('toggle', {
+ originalEvent: evt
+ });
+ });
+
+ this.$selection.on(
+ 'click',
+ '.select2-selection__choice__remove',
+ function (evt) {
+ // Ignore the event if it is disabled
+ if (self.options.get('disabled')) {
+ return;
+ }
+
+ var $remove = $(this);
+ var $selection = $remove.parent();
+
+ var data = $selection.data('data');
+
+ self.trigger('unselect', {
+ originalEvent: evt,
+ data: data
+ });
+ }
+ );
+ };
+
+ MultipleSelection.prototype.clear = function () {
+ this.$selection.find('.select2-selection__rendered').empty();
+ };
+
+ MultipleSelection.prototype.display = function (data, container) {
+ var template = this.options.get('templateSelection');
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ return escapeMarkup(template(data, container));
+ };
+
+ MultipleSelection.prototype.selectionContainer = function () {
+ var $container = $(
+ '
' +
+ '' +
+ '×' +
+ ' ' +
+ ' '
+ );
+
+ return $container;
+ };
+
+ MultipleSelection.prototype.update = function (data) {
+ var self = this;
+ this.clear();
+
+ if (data.length === 0) {
+ return;
+ }
+
+ var $selections = [];
+
+ for (var d = 0; d < data.length; d++) {
+ var selection = data[d];
+
+ var $selection = this.selectionContainer();
+ var formatted = this.display(selection, $selection).trim();
+
+ $selection.append(formatted);
+ $selection.prop('title', selection.title || selection.text);
+
+ $selection.data('data', selection);
+
+ $selections.push($selection);
+ }
+
+ var $rendered = this.$selection.find('.select2-selection__rendered');
+
+ Utils.appendMany($rendered, $selections);
+
+ // Return cursor to search field after updating.
+ // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
+ if ('undefined' !== typeof this.$search) {
+ setTimeout(function(){
+ self.$search.focus();
+ }, 1);
+ }
+ };
+
+ return MultipleSelection;
+});
+
+S2.define('select2/selection/placeholder',[
+ '../utils'
+], function (Utils) {
+ function Placeholder (decorated, $element, options) {
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
+
+ decorated.call(this, $element, options);
+ }
+
+ Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
+ if (typeof placeholder === 'string') {
+ placeholder = {
+ id: '',
+ text: placeholder
+ };
+ }
+
+ return placeholder;
+ };
+
+ Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
+ var $placeholder = this.selectionContainer();
+
+ $placeholder.html(this.display(placeholder));
+ $placeholder.addClass('select2-selection__placeholder')
+ .removeClass('select2-selection__choice');
+
+ return $placeholder;
+ };
+
+ Placeholder.prototype.update = function (decorated, data) {
+ var singlePlaceholder = (
+ data.length == 1 && data[0].id != this.placeholder.id
+ );
+ var multipleSelections = data.length > 1;
+
+ if (multipleSelections || singlePlaceholder) {
+ return decorated.call(this, data);
+ }
+
+ this.clear();
+
+ var $placeholder = this.createPlaceholder(this.placeholder);
+
+ this.$selection.find('.select2-selection__rendered').append($placeholder);
+ };
+
+ return Placeholder;
+});
+
+S2.define('select2/selection/allowClear',[
+ 'jquery',
+ '../keys'
+], function ($, KEYS) {
+ function AllowClear () { }
+
+ AllowClear.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ if (this.placeholder == null) {
+ if (this.options.get('debug') && window.console && console.error) {
+ console.error(
+ 'Select2: The `allowClear` option should be used in combination ' +
+ 'with the `placeholder` option.'
+ );
+ }
+ }
+
+ this.$selection.on('mousedown', '.select2-selection__clear',
+ function (evt) {
+ self._handleClear(evt);
+ });
+
+ container.on('keypress', function (evt) {
+ self._handleKeyboardClear(evt, container);
+ });
+ };
+
+ AllowClear.prototype._handleClear = function (_, evt) {
+ // Ignore the event if it is disabled
+ if (this.options.get('disabled')) {
+ return;
+ }
+
+ var $clear = this.$selection.find('.select2-selection__clear');
+
+ // Ignore the event if nothing has been selected
+ if ($clear.length === 0) {
+ return;
+ }
+
+ evt.stopPropagation();
+
+ var data = $clear.data('data');
+
+ for (var d = 0; d < data.length; d++) {
+ var unselectData = {
+ data: data[d]
+ };
+
+ // Trigger the `unselect` event, so people can prevent it from being
+ // cleared.
+ this.trigger('unselect', unselectData);
+
+ // If the event was prevented, don't clear it out.
+ if (unselectData.prevented) {
+ return;
+ }
+ }
+
+ this.$element.val(this.placeholder.id).trigger('change');
+
+ this.trigger('toggle', {});
+ };
+
+ AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
+ if (container.isOpen()) {
+ return;
+ }
+
+ if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
+ this._handleClear(evt);
+ }
+ };
+
+ AllowClear.prototype.update = function (decorated, data) {
+ decorated.call(this, data);
+
+ if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
+ data.length === 0) {
+ return;
+ }
+
+ var $remove = $(
+ '
' +
+ '×' +
+ ' '
+ );
+ $remove.data('data', data);
+
+ this.$selection.find('.select2-selection__rendered').prepend($remove);
+ };
+
+ return AllowClear;
+});
+
+S2.define('select2/selection/search',[
+ 'jquery',
+ '../utils',
+ '../keys'
+], function ($, Utils, KEYS) {
+ function Search (decorated, $element, options) {
+ decorated.call(this, $element, options);
+ }
+
+ Search.prototype.render = function (decorated) {
+ var $search = $(
+ '
' +
+ ' ' +
+ ' '
+ );
+
+ this.$searchContainer = $search;
+ this.$search = $search.find('input');
+
+ var $rendered = decorated.call(this);
+
+ this._transferTabIndex();
+
+ return $rendered;
+ };
+
+ Search.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+ var resultsId = container.id + '-results';
+
+ decorated.call(this, container, $container);
+
+ container.on('open', function () {
+ self.$search.attr('aria-owns', resultsId);
+ self.$search.trigger('focus');
+ });
+
+ container.on('close', function () {
+ self.$search.val('');
+ self.$search.removeAttr('aria-activedescendant');
+ self.$search.removeAttr('aria-owns');
+ self.$search.trigger('focus');
+ });
+
+ container.on('enable', function () {
+ self.$search.prop('disabled', false);
+
+ self._transferTabIndex();
+ });
+
+ container.on('disable', function () {
+ self.$search.prop('disabled', true);
+ });
+
+ container.on('focus', function (evt) {
+ self.$search.trigger('focus');
+ });
+
+ container.on('results:focus', function (params) {
+ self.$search.attr('aria-activedescendant', params.data._resultId);
+ });
+
+ this.$selection.on('focusin', '.select2-search--inline', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this.$selection.on('focusout', '.select2-search--inline', function (evt) {
+ self._handleBlur(evt);
+ });
+
+ this.$selection.on('keydown', '.select2-search--inline', function (evt) {
+ evt.stopPropagation();
+
+ self.trigger('keypress', evt);
+
+ self._keyUpPrevented = evt.isDefaultPrevented();
+
+ var key = evt.which;
+
+ if (key === KEYS.BACKSPACE && self.$search.val() === '') {
+ var $previousChoice = self.$searchContainer
+ .prev('.select2-selection__choice');
+
+ if ($previousChoice.length > 0) {
+ var item = $previousChoice.data('data');
+
+ self.searchRemoveChoice(item);
+
+ evt.preventDefault();
+ }
+ }
+ });
+
+ // Try to detect the IE version should the `documentMode` property that
+ // is stored on the document. This is only implemented in IE and is
+ // slightly cleaner than doing a user agent check.
+ // This property is not available in Edge, but Edge also doesn't have
+ // this bug.
+ var msie = document.documentMode;
+ var disableInputEvents = msie && msie <= 11;
+
+ // Workaround for browsers which do not support the `input` event
+ // This will prevent double-triggering of events for browsers which support
+ // both the `keyup` and `input` events.
+ this.$selection.on(
+ 'input.searchcheck',
+ '.select2-search--inline',
+ function (evt) {
+ // IE will trigger the `input` event when a placeholder is used on a
+ // search box. To get around this issue, we are forced to ignore all
+ // `input` events in IE and keep using `keyup`.
+ if (disableInputEvents) {
+ self.$selection.off('input.search input.searchcheck');
+ return;
+ }
+
+ // Unbind the duplicated `keyup` event
+ self.$selection.off('keyup.search');
+ }
+ );
+
+ this.$selection.on(
+ 'keyup.search input.search',
+ '.select2-search--inline',
+ function (evt) {
+ // IE will trigger the `input` event when a placeholder is used on a
+ // search box. To get around this issue, we are forced to ignore all
+ // `input` events in IE and keep using `keyup`.
+ if (disableInputEvents && evt.type === 'input') {
+ self.$selection.off('input.search input.searchcheck');
+ return;
+ }
+
+ var key = evt.which;
+
+ // We can freely ignore events from modifier keys
+ if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
+ return;
+ }
+
+ // Tabbing will be handled during the `keydown` phase
+ if (key == KEYS.TAB) {
+ return;
+ }
+
+ self.handleSearch(evt);
+ }
+ );
+ };
+
+ /**
+ * This method will transfer the tabindex attribute from the rendered
+ * selection to the search box. This allows for the search box to be used as
+ * the primary focus instead of the selection container.
+ *
+ * @private
+ */
+ Search.prototype._transferTabIndex = function (decorated) {
+ this.$search.attr('tabindex', this.$selection.attr('tabindex'));
+ this.$selection.attr('tabindex', '-1');
+ };
+
+ Search.prototype.createPlaceholder = function (decorated, placeholder) {
+ this.$search.attr('placeholder', placeholder.text);
+ };
+
+ Search.prototype.update = function (decorated, data) {
+ var searchHadFocus = this.$search[0] == document.activeElement;
+
+ this.$search.attr('placeholder', '');
+
+ decorated.call(this, data);
+
+ this.$selection.find('.select2-selection__rendered')
+ .append(this.$searchContainer);
+
+ this.resizeSearch();
+ if (searchHadFocus) {
+ this.$search.focus();
+ }
+ };
+
+ Search.prototype.handleSearch = function () {
+ this.resizeSearch();
+
+ if (!this._keyUpPrevented) {
+ var input = this.$search.val();
+
+ this.trigger('query', {
+ term: input
+ });
+ }
+
+ this._keyUpPrevented = false;
+ };
+
+ Search.prototype.searchRemoveChoice = function (decorated, item) {
+ this.trigger('unselect', {
+ data: item
+ });
+
+ this.$search.val(item.text);
+ this.handleSearch();
+ };
+
+ Search.prototype.resizeSearch = function () {
+ this.$search.css('width', '25px');
+
+ var width = '';
+
+ if (this.$search.attr('placeholder') !== '') {
+ width = this.$selection.find('.select2-selection__rendered').innerWidth();
+ } else {
+ var minimumWidth = this.$search.val().length + 1;
+
+ width = (minimumWidth * 0.75) + 'em';
+ }
+
+ this.$search.css('width', width);
+ };
+
+ return Search;
+});
+
+S2.define('select2/selection/eventRelay',[
+ 'jquery'
+], function ($) {
+ function EventRelay () { }
+
+ EventRelay.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+ var relayEvents = [
+ 'open', 'opening',
+ 'close', 'closing',
+ 'select', 'selecting',
+ 'unselect', 'unselecting'
+ ];
+
+ var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
+
+ decorated.call(this, container, $container);
+
+ container.on('*', function (name, params) {
+ // Ignore events that should not be relayed
+ if ($.inArray(name, relayEvents) === -1) {
+ return;
+ }
+
+ // The parameters should always be an object
+ params = params || {};
+
+ // Generate the jQuery event for the Select2 event
+ var evt = $.Event('select2:' + name, {
+ params: params
+ });
+
+ self.$element.trigger(evt);
+
+ // Only handle preventable events if it was one
+ if ($.inArray(name, preventableEvents) === -1) {
+ return;
+ }
+
+ params.prevented = evt.isDefaultPrevented();
+ });
+ };
+
+ return EventRelay;
+});
+
+S2.define('select2/translation',[
+ 'jquery',
+ 'require'
+], function ($, require) {
+ function Translation (dict) {
+ this.dict = dict || {};
+ }
+
+ Translation.prototype.all = function () {
+ return this.dict;
+ };
+
+ Translation.prototype.get = function (key) {
+ return this.dict[key];
+ };
+
+ Translation.prototype.extend = function (translation) {
+ this.dict = $.extend({}, translation.all(), this.dict);
+ };
+
+ // Static functions
+
+ Translation._cache = {};
+
+ Translation.loadPath = function (path) {
+ if (!(path in Translation._cache)) {
+ var translations = require(path);
+
+ Translation._cache[path] = translations;
+ }
+
+ return new Translation(Translation._cache[path]);
+ };
+
+ return Translation;
+});
+
+S2.define('select2/diacritics',[
+
+], function () {
+ var diacritics = {
+ '\u24B6': 'A',
+ '\uFF21': 'A',
+ '\u00C0': 'A',
+ '\u00C1': 'A',
+ '\u00C2': 'A',
+ '\u1EA6': 'A',
+ '\u1EA4': 'A',
+ '\u1EAA': 'A',
+ '\u1EA8': 'A',
+ '\u00C3': 'A',
+ '\u0100': 'A',
+ '\u0102': 'A',
+ '\u1EB0': 'A',
+ '\u1EAE': 'A',
+ '\u1EB4': 'A',
+ '\u1EB2': 'A',
+ '\u0226': 'A',
+ '\u01E0': 'A',
+ '\u00C4': 'A',
+ '\u01DE': 'A',
+ '\u1EA2': 'A',
+ '\u00C5': 'A',
+ '\u01FA': 'A',
+ '\u01CD': 'A',
+ '\u0200': 'A',
+ '\u0202': 'A',
+ '\u1EA0': 'A',
+ '\u1EAC': 'A',
+ '\u1EB6': 'A',
+ '\u1E00': 'A',
+ '\u0104': 'A',
+ '\u023A': 'A',
+ '\u2C6F': 'A',
+ '\uA732': 'AA',
+ '\u00C6': 'AE',
+ '\u01FC': 'AE',
+ '\u01E2': 'AE',
+ '\uA734': 'AO',
+ '\uA736': 'AU',
+ '\uA738': 'AV',
+ '\uA73A': 'AV',
+ '\uA73C': 'AY',
+ '\u24B7': 'B',
+ '\uFF22': 'B',
+ '\u1E02': 'B',
+ '\u1E04': 'B',
+ '\u1E06': 'B',
+ '\u0243': 'B',
+ '\u0182': 'B',
+ '\u0181': 'B',
+ '\u24B8': 'C',
+ '\uFF23': 'C',
+ '\u0106': 'C',
+ '\u0108': 'C',
+ '\u010A': 'C',
+ '\u010C': 'C',
+ '\u00C7': 'C',
+ '\u1E08': 'C',
+ '\u0187': 'C',
+ '\u023B': 'C',
+ '\uA73E': 'C',
+ '\u24B9': 'D',
+ '\uFF24': 'D',
+ '\u1E0A': 'D',
+ '\u010E': 'D',
+ '\u1E0C': 'D',
+ '\u1E10': 'D',
+ '\u1E12': 'D',
+ '\u1E0E': 'D',
+ '\u0110': 'D',
+ '\u018B': 'D',
+ '\u018A': 'D',
+ '\u0189': 'D',
+ '\uA779': 'D',
+ '\u01F1': 'DZ',
+ '\u01C4': 'DZ',
+ '\u01F2': 'Dz',
+ '\u01C5': 'Dz',
+ '\u24BA': 'E',
+ '\uFF25': 'E',
+ '\u00C8': 'E',
+ '\u00C9': 'E',
+ '\u00CA': 'E',
+ '\u1EC0': 'E',
+ '\u1EBE': 'E',
+ '\u1EC4': 'E',
+ '\u1EC2': 'E',
+ '\u1EBC': 'E',
+ '\u0112': 'E',
+ '\u1E14': 'E',
+ '\u1E16': 'E',
+ '\u0114': 'E',
+ '\u0116': 'E',
+ '\u00CB': 'E',
+ '\u1EBA': 'E',
+ '\u011A': 'E',
+ '\u0204': 'E',
+ '\u0206': 'E',
+ '\u1EB8': 'E',
+ '\u1EC6': 'E',
+ '\u0228': 'E',
+ '\u1E1C': 'E',
+ '\u0118': 'E',
+ '\u1E18': 'E',
+ '\u1E1A': 'E',
+ '\u0190': 'E',
+ '\u018E': 'E',
+ '\u24BB': 'F',
+ '\uFF26': 'F',
+ '\u1E1E': 'F',
+ '\u0191': 'F',
+ '\uA77B': 'F',
+ '\u24BC': 'G',
+ '\uFF27': 'G',
+ '\u01F4': 'G',
+ '\u011C': 'G',
+ '\u1E20': 'G',
+ '\u011E': 'G',
+ '\u0120': 'G',
+ '\u01E6': 'G',
+ '\u0122': 'G',
+ '\u01E4': 'G',
+ '\u0193': 'G',
+ '\uA7A0': 'G',
+ '\uA77D': 'G',
+ '\uA77E': 'G',
+ '\u24BD': 'H',
+ '\uFF28': 'H',
+ '\u0124': 'H',
+ '\u1E22': 'H',
+ '\u1E26': 'H',
+ '\u021E': 'H',
+ '\u1E24': 'H',
+ '\u1E28': 'H',
+ '\u1E2A': 'H',
+ '\u0126': 'H',
+ '\u2C67': 'H',
+ '\u2C75': 'H',
+ '\uA78D': 'H',
+ '\u24BE': 'I',
+ '\uFF29': 'I',
+ '\u00CC': 'I',
+ '\u00CD': 'I',
+ '\u00CE': 'I',
+ '\u0128': 'I',
+ '\u012A': 'I',
+ '\u012C': 'I',
+ '\u0130': 'I',
+ '\u00CF': 'I',
+ '\u1E2E': 'I',
+ '\u1EC8': 'I',
+ '\u01CF': 'I',
+ '\u0208': 'I',
+ '\u020A': 'I',
+ '\u1ECA': 'I',
+ '\u012E': 'I',
+ '\u1E2C': 'I',
+ '\u0197': 'I',
+ '\u24BF': 'J',
+ '\uFF2A': 'J',
+ '\u0134': 'J',
+ '\u0248': 'J',
+ '\u24C0': 'K',
+ '\uFF2B': 'K',
+ '\u1E30': 'K',
+ '\u01E8': 'K',
+ '\u1E32': 'K',
+ '\u0136': 'K',
+ '\u1E34': 'K',
+ '\u0198': 'K',
+ '\u2C69': 'K',
+ '\uA740': 'K',
+ '\uA742': 'K',
+ '\uA744': 'K',
+ '\uA7A2': 'K',
+ '\u24C1': 'L',
+ '\uFF2C': 'L',
+ '\u013F': 'L',
+ '\u0139': 'L',
+ '\u013D': 'L',
+ '\u1E36': 'L',
+ '\u1E38': 'L',
+ '\u013B': 'L',
+ '\u1E3C': 'L',
+ '\u1E3A': 'L',
+ '\u0141': 'L',
+ '\u023D': 'L',
+ '\u2C62': 'L',
+ '\u2C60': 'L',
+ '\uA748': 'L',
+ '\uA746': 'L',
+ '\uA780': 'L',
+ '\u01C7': 'LJ',
+ '\u01C8': 'Lj',
+ '\u24C2': 'M',
+ '\uFF2D': 'M',
+ '\u1E3E': 'M',
+ '\u1E40': 'M',
+ '\u1E42': 'M',
+ '\u2C6E': 'M',
+ '\u019C': 'M',
+ '\u24C3': 'N',
+ '\uFF2E': 'N',
+ '\u01F8': 'N',
+ '\u0143': 'N',
+ '\u00D1': 'N',
+ '\u1E44': 'N',
+ '\u0147': 'N',
+ '\u1E46': 'N',
+ '\u0145': 'N',
+ '\u1E4A': 'N',
+ '\u1E48': 'N',
+ '\u0220': 'N',
+ '\u019D': 'N',
+ '\uA790': 'N',
+ '\uA7A4': 'N',
+ '\u01CA': 'NJ',
+ '\u01CB': 'Nj',
+ '\u24C4': 'O',
+ '\uFF2F': 'O',
+ '\u00D2': 'O',
+ '\u00D3': 'O',
+ '\u00D4': 'O',
+ '\u1ED2': 'O',
+ '\u1ED0': 'O',
+ '\u1ED6': 'O',
+ '\u1ED4': 'O',
+ '\u00D5': 'O',
+ '\u1E4C': 'O',
+ '\u022C': 'O',
+ '\u1E4E': 'O',
+ '\u014C': 'O',
+ '\u1E50': 'O',
+ '\u1E52': 'O',
+ '\u014E': 'O',
+ '\u022E': 'O',
+ '\u0230': 'O',
+ '\u00D6': 'O',
+ '\u022A': 'O',
+ '\u1ECE': 'O',
+ '\u0150': 'O',
+ '\u01D1': 'O',
+ '\u020C': 'O',
+ '\u020E': 'O',
+ '\u01A0': 'O',
+ '\u1EDC': 'O',
+ '\u1EDA': 'O',
+ '\u1EE0': 'O',
+ '\u1EDE': 'O',
+ '\u1EE2': 'O',
+ '\u1ECC': 'O',
+ '\u1ED8': 'O',
+ '\u01EA': 'O',
+ '\u01EC': 'O',
+ '\u00D8': 'O',
+ '\u01FE': 'O',
+ '\u0186': 'O',
+ '\u019F': 'O',
+ '\uA74A': 'O',
+ '\uA74C': 'O',
+ '\u01A2': 'OI',
+ '\uA74E': 'OO',
+ '\u0222': 'OU',
+ '\u24C5': 'P',
+ '\uFF30': 'P',
+ '\u1E54': 'P',
+ '\u1E56': 'P',
+ '\u01A4': 'P',
+ '\u2C63': 'P',
+ '\uA750': 'P',
+ '\uA752': 'P',
+ '\uA754': 'P',
+ '\u24C6': 'Q',
+ '\uFF31': 'Q',
+ '\uA756': 'Q',
+ '\uA758': 'Q',
+ '\u024A': 'Q',
+ '\u24C7': 'R',
+ '\uFF32': 'R',
+ '\u0154': 'R',
+ '\u1E58': 'R',
+ '\u0158': 'R',
+ '\u0210': 'R',
+ '\u0212': 'R',
+ '\u1E5A': 'R',
+ '\u1E5C': 'R',
+ '\u0156': 'R',
+ '\u1E5E': 'R',
+ '\u024C': 'R',
+ '\u2C64': 'R',
+ '\uA75A': 'R',
+ '\uA7A6': 'R',
+ '\uA782': 'R',
+ '\u24C8': 'S',
+ '\uFF33': 'S',
+ '\u1E9E': 'S',
+ '\u015A': 'S',
+ '\u1E64': 'S',
+ '\u015C': 'S',
+ '\u1E60': 'S',
+ '\u0160': 'S',
+ '\u1E66': 'S',
+ '\u1E62': 'S',
+ '\u1E68': 'S',
+ '\u0218': 'S',
+ '\u015E': 'S',
+ '\u2C7E': 'S',
+ '\uA7A8': 'S',
+ '\uA784': 'S',
+ '\u24C9': 'T',
+ '\uFF34': 'T',
+ '\u1E6A': 'T',
+ '\u0164': 'T',
+ '\u1E6C': 'T',
+ '\u021A': 'T',
+ '\u0162': 'T',
+ '\u1E70': 'T',
+ '\u1E6E': 'T',
+ '\u0166': 'T',
+ '\u01AC': 'T',
+ '\u01AE': 'T',
+ '\u023E': 'T',
+ '\uA786': 'T',
+ '\uA728': 'TZ',
+ '\u24CA': 'U',
+ '\uFF35': 'U',
+ '\u00D9': 'U',
+ '\u00DA': 'U',
+ '\u00DB': 'U',
+ '\u0168': 'U',
+ '\u1E78': 'U',
+ '\u016A': 'U',
+ '\u1E7A': 'U',
+ '\u016C': 'U',
+ '\u00DC': 'U',
+ '\u01DB': 'U',
+ '\u01D7': 'U',
+ '\u01D5': 'U',
+ '\u01D9': 'U',
+ '\u1EE6': 'U',
+ '\u016E': 'U',
+ '\u0170': 'U',
+ '\u01D3': 'U',
+ '\u0214': 'U',
+ '\u0216': 'U',
+ '\u01AF': 'U',
+ '\u1EEA': 'U',
+ '\u1EE8': 'U',
+ '\u1EEE': 'U',
+ '\u1EEC': 'U',
+ '\u1EF0': 'U',
+ '\u1EE4': 'U',
+ '\u1E72': 'U',
+ '\u0172': 'U',
+ '\u1E76': 'U',
+ '\u1E74': 'U',
+ '\u0244': 'U',
+ '\u24CB': 'V',
+ '\uFF36': 'V',
+ '\u1E7C': 'V',
+ '\u1E7E': 'V',
+ '\u01B2': 'V',
+ '\uA75E': 'V',
+ '\u0245': 'V',
+ '\uA760': 'VY',
+ '\u24CC': 'W',
+ '\uFF37': 'W',
+ '\u1E80': 'W',
+ '\u1E82': 'W',
+ '\u0174': 'W',
+ '\u1E86': 'W',
+ '\u1E84': 'W',
+ '\u1E88': 'W',
+ '\u2C72': 'W',
+ '\u24CD': 'X',
+ '\uFF38': 'X',
+ '\u1E8A': 'X',
+ '\u1E8C': 'X',
+ '\u24CE': 'Y',
+ '\uFF39': 'Y',
+ '\u1EF2': 'Y',
+ '\u00DD': 'Y',
+ '\u0176': 'Y',
+ '\u1EF8': 'Y',
+ '\u0232': 'Y',
+ '\u1E8E': 'Y',
+ '\u0178': 'Y',
+ '\u1EF6': 'Y',
+ '\u1EF4': 'Y',
+ '\u01B3': 'Y',
+ '\u024E': 'Y',
+ '\u1EFE': 'Y',
+ '\u24CF': 'Z',
+ '\uFF3A': 'Z',
+ '\u0179': 'Z',
+ '\u1E90': 'Z',
+ '\u017B': 'Z',
+ '\u017D': 'Z',
+ '\u1E92': 'Z',
+ '\u1E94': 'Z',
+ '\u01B5': 'Z',
+ '\u0224': 'Z',
+ '\u2C7F': 'Z',
+ '\u2C6B': 'Z',
+ '\uA762': 'Z',
+ '\u24D0': 'a',
+ '\uFF41': 'a',
+ '\u1E9A': 'a',
+ '\u00E0': 'a',
+ '\u00E1': 'a',
+ '\u00E2': 'a',
+ '\u1EA7': 'a',
+ '\u1EA5': 'a',
+ '\u1EAB': 'a',
+ '\u1EA9': 'a',
+ '\u00E3': 'a',
+ '\u0101': 'a',
+ '\u0103': 'a',
+ '\u1EB1': 'a',
+ '\u1EAF': 'a',
+ '\u1EB5': 'a',
+ '\u1EB3': 'a',
+ '\u0227': 'a',
+ '\u01E1': 'a',
+ '\u00E4': 'a',
+ '\u01DF': 'a',
+ '\u1EA3': 'a',
+ '\u00E5': 'a',
+ '\u01FB': 'a',
+ '\u01CE': 'a',
+ '\u0201': 'a',
+ '\u0203': 'a',
+ '\u1EA1': 'a',
+ '\u1EAD': 'a',
+ '\u1EB7': 'a',
+ '\u1E01': 'a',
+ '\u0105': 'a',
+ '\u2C65': 'a',
+ '\u0250': 'a',
+ '\uA733': 'aa',
+ '\u00E6': 'ae',
+ '\u01FD': 'ae',
+ '\u01E3': 'ae',
+ '\uA735': 'ao',
+ '\uA737': 'au',
+ '\uA739': 'av',
+ '\uA73B': 'av',
+ '\uA73D': 'ay',
+ '\u24D1': 'b',
+ '\uFF42': 'b',
+ '\u1E03': 'b',
+ '\u1E05': 'b',
+ '\u1E07': 'b',
+ '\u0180': 'b',
+ '\u0183': 'b',
+ '\u0253': 'b',
+ '\u24D2': 'c',
+ '\uFF43': 'c',
+ '\u0107': 'c',
+ '\u0109': 'c',
+ '\u010B': 'c',
+ '\u010D': 'c',
+ '\u00E7': 'c',
+ '\u1E09': 'c',
+ '\u0188': 'c',
+ '\u023C': 'c',
+ '\uA73F': 'c',
+ '\u2184': 'c',
+ '\u24D3': 'd',
+ '\uFF44': 'd',
+ '\u1E0B': 'd',
+ '\u010F': 'd',
+ '\u1E0D': 'd',
+ '\u1E11': 'd',
+ '\u1E13': 'd',
+ '\u1E0F': 'd',
+ '\u0111': 'd',
+ '\u018C': 'd',
+ '\u0256': 'd',
+ '\u0257': 'd',
+ '\uA77A': 'd',
+ '\u01F3': 'dz',
+ '\u01C6': 'dz',
+ '\u24D4': 'e',
+ '\uFF45': 'e',
+ '\u00E8': 'e',
+ '\u00E9': 'e',
+ '\u00EA': 'e',
+ '\u1EC1': 'e',
+ '\u1EBF': 'e',
+ '\u1EC5': 'e',
+ '\u1EC3': 'e',
+ '\u1EBD': 'e',
+ '\u0113': 'e',
+ '\u1E15': 'e',
+ '\u1E17': 'e',
+ '\u0115': 'e',
+ '\u0117': 'e',
+ '\u00EB': 'e',
+ '\u1EBB': 'e',
+ '\u011B': 'e',
+ '\u0205': 'e',
+ '\u0207': 'e',
+ '\u1EB9': 'e',
+ '\u1EC7': 'e',
+ '\u0229': 'e',
+ '\u1E1D': 'e',
+ '\u0119': 'e',
+ '\u1E19': 'e',
+ '\u1E1B': 'e',
+ '\u0247': 'e',
+ '\u025B': 'e',
+ '\u01DD': 'e',
+ '\u24D5': 'f',
+ '\uFF46': 'f',
+ '\u1E1F': 'f',
+ '\u0192': 'f',
+ '\uA77C': 'f',
+ '\u24D6': 'g',
+ '\uFF47': 'g',
+ '\u01F5': 'g',
+ '\u011D': 'g',
+ '\u1E21': 'g',
+ '\u011F': 'g',
+ '\u0121': 'g',
+ '\u01E7': 'g',
+ '\u0123': 'g',
+ '\u01E5': 'g',
+ '\u0260': 'g',
+ '\uA7A1': 'g',
+ '\u1D79': 'g',
+ '\uA77F': 'g',
+ '\u24D7': 'h',
+ '\uFF48': 'h',
+ '\u0125': 'h',
+ '\u1E23': 'h',
+ '\u1E27': 'h',
+ '\u021F': 'h',
+ '\u1E25': 'h',
+ '\u1E29': 'h',
+ '\u1E2B': 'h',
+ '\u1E96': 'h',
+ '\u0127': 'h',
+ '\u2C68': 'h',
+ '\u2C76': 'h',
+ '\u0265': 'h',
+ '\u0195': 'hv',
+ '\u24D8': 'i',
+ '\uFF49': 'i',
+ '\u00EC': 'i',
+ '\u00ED': 'i',
+ '\u00EE': 'i',
+ '\u0129': 'i',
+ '\u012B': 'i',
+ '\u012D': 'i',
+ '\u00EF': 'i',
+ '\u1E2F': 'i',
+ '\u1EC9': 'i',
+ '\u01D0': 'i',
+ '\u0209': 'i',
+ '\u020B': 'i',
+ '\u1ECB': 'i',
+ '\u012F': 'i',
+ '\u1E2D': 'i',
+ '\u0268': 'i',
+ '\u0131': 'i',
+ '\u24D9': 'j',
+ '\uFF4A': 'j',
+ '\u0135': 'j',
+ '\u01F0': 'j',
+ '\u0249': 'j',
+ '\u24DA': 'k',
+ '\uFF4B': 'k',
+ '\u1E31': 'k',
+ '\u01E9': 'k',
+ '\u1E33': 'k',
+ '\u0137': 'k',
+ '\u1E35': 'k',
+ '\u0199': 'k',
+ '\u2C6A': 'k',
+ '\uA741': 'k',
+ '\uA743': 'k',
+ '\uA745': 'k',
+ '\uA7A3': 'k',
+ '\u24DB': 'l',
+ '\uFF4C': 'l',
+ '\u0140': 'l',
+ '\u013A': 'l',
+ '\u013E': 'l',
+ '\u1E37': 'l',
+ '\u1E39': 'l',
+ '\u013C': 'l',
+ '\u1E3D': 'l',
+ '\u1E3B': 'l',
+ '\u017F': 'l',
+ '\u0142': 'l',
+ '\u019A': 'l',
+ '\u026B': 'l',
+ '\u2C61': 'l',
+ '\uA749': 'l',
+ '\uA781': 'l',
+ '\uA747': 'l',
+ '\u01C9': 'lj',
+ '\u24DC': 'm',
+ '\uFF4D': 'm',
+ '\u1E3F': 'm',
+ '\u1E41': 'm',
+ '\u1E43': 'm',
+ '\u0271': 'm',
+ '\u026F': 'm',
+ '\u24DD': 'n',
+ '\uFF4E': 'n',
+ '\u01F9': 'n',
+ '\u0144': 'n',
+ '\u00F1': 'n',
+ '\u1E45': 'n',
+ '\u0148': 'n',
+ '\u1E47': 'n',
+ '\u0146': 'n',
+ '\u1E4B': 'n',
+ '\u1E49': 'n',
+ '\u019E': 'n',
+ '\u0272': 'n',
+ '\u0149': 'n',
+ '\uA791': 'n',
+ '\uA7A5': 'n',
+ '\u01CC': 'nj',
+ '\u24DE': 'o',
+ '\uFF4F': 'o',
+ '\u00F2': 'o',
+ '\u00F3': 'o',
+ '\u00F4': 'o',
+ '\u1ED3': 'o',
+ '\u1ED1': 'o',
+ '\u1ED7': 'o',
+ '\u1ED5': 'o',
+ '\u00F5': 'o',
+ '\u1E4D': 'o',
+ '\u022D': 'o',
+ '\u1E4F': 'o',
+ '\u014D': 'o',
+ '\u1E51': 'o',
+ '\u1E53': 'o',
+ '\u014F': 'o',
+ '\u022F': 'o',
+ '\u0231': 'o',
+ '\u00F6': 'o',
+ '\u022B': 'o',
+ '\u1ECF': 'o',
+ '\u0151': 'o',
+ '\u01D2': 'o',
+ '\u020D': 'o',
+ '\u020F': 'o',
+ '\u01A1': 'o',
+ '\u1EDD': 'o',
+ '\u1EDB': 'o',
+ '\u1EE1': 'o',
+ '\u1EDF': 'o',
+ '\u1EE3': 'o',
+ '\u1ECD': 'o',
+ '\u1ED9': 'o',
+ '\u01EB': 'o',
+ '\u01ED': 'o',
+ '\u00F8': 'o',
+ '\u01FF': 'o',
+ '\u0254': 'o',
+ '\uA74B': 'o',
+ '\uA74D': 'o',
+ '\u0275': 'o',
+ '\u01A3': 'oi',
+ '\u0223': 'ou',
+ '\uA74F': 'oo',
+ '\u24DF': 'p',
+ '\uFF50': 'p',
+ '\u1E55': 'p',
+ '\u1E57': 'p',
+ '\u01A5': 'p',
+ '\u1D7D': 'p',
+ '\uA751': 'p',
+ '\uA753': 'p',
+ '\uA755': 'p',
+ '\u24E0': 'q',
+ '\uFF51': 'q',
+ '\u024B': 'q',
+ '\uA757': 'q',
+ '\uA759': 'q',
+ '\u24E1': 'r',
+ '\uFF52': 'r',
+ '\u0155': 'r',
+ '\u1E59': 'r',
+ '\u0159': 'r',
+ '\u0211': 'r',
+ '\u0213': 'r',
+ '\u1E5B': 'r',
+ '\u1E5D': 'r',
+ '\u0157': 'r',
+ '\u1E5F': 'r',
+ '\u024D': 'r',
+ '\u027D': 'r',
+ '\uA75B': 'r',
+ '\uA7A7': 'r',
+ '\uA783': 'r',
+ '\u24E2': 's',
+ '\uFF53': 's',
+ '\u00DF': 's',
+ '\u015B': 's',
+ '\u1E65': 's',
+ '\u015D': 's',
+ '\u1E61': 's',
+ '\u0161': 's',
+ '\u1E67': 's',
+ '\u1E63': 's',
+ '\u1E69': 's',
+ '\u0219': 's',
+ '\u015F': 's',
+ '\u023F': 's',
+ '\uA7A9': 's',
+ '\uA785': 's',
+ '\u1E9B': 's',
+ '\u24E3': 't',
+ '\uFF54': 't',
+ '\u1E6B': 't',
+ '\u1E97': 't',
+ '\u0165': 't',
+ '\u1E6D': 't',
+ '\u021B': 't',
+ '\u0163': 't',
+ '\u1E71': 't',
+ '\u1E6F': 't',
+ '\u0167': 't',
+ '\u01AD': 't',
+ '\u0288': 't',
+ '\u2C66': 't',
+ '\uA787': 't',
+ '\uA729': 'tz',
+ '\u24E4': 'u',
+ '\uFF55': 'u',
+ '\u00F9': 'u',
+ '\u00FA': 'u',
+ '\u00FB': 'u',
+ '\u0169': 'u',
+ '\u1E79': 'u',
+ '\u016B': 'u',
+ '\u1E7B': 'u',
+ '\u016D': 'u',
+ '\u00FC': 'u',
+ '\u01DC': 'u',
+ '\u01D8': 'u',
+ '\u01D6': 'u',
+ '\u01DA': 'u',
+ '\u1EE7': 'u',
+ '\u016F': 'u',
+ '\u0171': 'u',
+ '\u01D4': 'u',
+ '\u0215': 'u',
+ '\u0217': 'u',
+ '\u01B0': 'u',
+ '\u1EEB': 'u',
+ '\u1EE9': 'u',
+ '\u1EEF': 'u',
+ '\u1EED': 'u',
+ '\u1EF1': 'u',
+ '\u1EE5': 'u',
+ '\u1E73': 'u',
+ '\u0173': 'u',
+ '\u1E77': 'u',
+ '\u1E75': 'u',
+ '\u0289': 'u',
+ '\u24E5': 'v',
+ '\uFF56': 'v',
+ '\u1E7D': 'v',
+ '\u1E7F': 'v',
+ '\u028B': 'v',
+ '\uA75F': 'v',
+ '\u028C': 'v',
+ '\uA761': 'vy',
+ '\u24E6': 'w',
+ '\uFF57': 'w',
+ '\u1E81': 'w',
+ '\u1E83': 'w',
+ '\u0175': 'w',
+ '\u1E87': 'w',
+ '\u1E85': 'w',
+ '\u1E98': 'w',
+ '\u1E89': 'w',
+ '\u2C73': 'w',
+ '\u24E7': 'x',
+ '\uFF58': 'x',
+ '\u1E8B': 'x',
+ '\u1E8D': 'x',
+ '\u24E8': 'y',
+ '\uFF59': 'y',
+ '\u1EF3': 'y',
+ '\u00FD': 'y',
+ '\u0177': 'y',
+ '\u1EF9': 'y',
+ '\u0233': 'y',
+ '\u1E8F': 'y',
+ '\u00FF': 'y',
+ '\u1EF7': 'y',
+ '\u1E99': 'y',
+ '\u1EF5': 'y',
+ '\u01B4': 'y',
+ '\u024F': 'y',
+ '\u1EFF': 'y',
+ '\u24E9': 'z',
+ '\uFF5A': 'z',
+ '\u017A': 'z',
+ '\u1E91': 'z',
+ '\u017C': 'z',
+ '\u017E': 'z',
+ '\u1E93': 'z',
+ '\u1E95': 'z',
+ '\u01B6': 'z',
+ '\u0225': 'z',
+ '\u0240': 'z',
+ '\u2C6C': 'z',
+ '\uA763': 'z',
+ '\u0386': '\u0391',
+ '\u0388': '\u0395',
+ '\u0389': '\u0397',
+ '\u038A': '\u0399',
+ '\u03AA': '\u0399',
+ '\u038C': '\u039F',
+ '\u038E': '\u03A5',
+ '\u03AB': '\u03A5',
+ '\u038F': '\u03A9',
+ '\u03AC': '\u03B1',
+ '\u03AD': '\u03B5',
+ '\u03AE': '\u03B7',
+ '\u03AF': '\u03B9',
+ '\u03CA': '\u03B9',
+ '\u0390': '\u03B9',
+ '\u03CC': '\u03BF',
+ '\u03CD': '\u03C5',
+ '\u03CB': '\u03C5',
+ '\u03B0': '\u03C5',
+ '\u03C9': '\u03C9',
+ '\u03C2': '\u03C3'
+ };
+
+ return diacritics;
+});
+
+S2.define('select2/data/base',[
+ '../utils'
+], function (Utils) {
+ function BaseAdapter ($element, options) {
+ BaseAdapter.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(BaseAdapter, Utils.Observable);
+
+ BaseAdapter.prototype.current = function (callback) {
+ throw new Error('The `current` method must be defined in child classes.');
+ };
+
+ BaseAdapter.prototype.query = function (params, callback) {
+ throw new Error('The `query` method must be defined in child classes.');
+ };
+
+ BaseAdapter.prototype.bind = function (container, $container) {
+ // Can be implemented in subclasses
+ };
+
+ BaseAdapter.prototype.destroy = function () {
+ // Can be implemented in subclasses
+ };
+
+ BaseAdapter.prototype.generateResultId = function (container, data) {
+ var id = '';
+
+ if (container != null) {
+ id += container.id
+ } else {
+ id += Utils.generateChars(4);
+ }
+
+ id += '-result-';
+ id += Utils.generateChars(4);
+
+ if (data.id != null) {
+ id += '-' + data.id.toString();
+ } else {
+ id += '-' + Utils.generateChars(4);
+ }
+ return id;
+ };
+
+ return BaseAdapter;
+});
+
+S2.define('select2/data/select',[
+ './base',
+ '../utils',
+ 'jquery'
+], function (BaseAdapter, Utils, $) {
+ function SelectAdapter ($element, options) {
+ this.$element = $element;
+ this.options = options;
+
+ SelectAdapter.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(SelectAdapter, BaseAdapter);
+
+ SelectAdapter.prototype.current = function (callback) {
+ var data = [];
+ var self = this;
+
+ this.$element.find(':selected').each(function () {
+ var $option = $(this);
+
+ var option = self.item($option);
+
+ data.push(option);
+ });
+
+ callback(data);
+ };
+
+ SelectAdapter.prototype.select = function (data) {
+ var self = this;
+
+ data.selected = true;
+
+ // If data.element is a DOM node, use it instead
+ if ($(data.element).is('option')) {
+ data.element.selected = true;
+
+ this.$element.trigger('change');
+
+ return;
+ }
+
+ if (this.$element.prop('multiple')) {
+ this.current(function (currentData) {
+ var val = [];
+
+ data = [data];
+ data.push.apply(data, currentData);
+
+ for (var d = 0; d < data.length; d++) {
+ var id = data[d].id;
+
+ if ($.inArray(id, val) === -1) {
+ val.push(id);
+ }
+ }
+
+ self.$element.val(val);
+ self.$element.trigger('change');
+ });
+ } else {
+ var val = data.id;
+
+ this.$element.val(val);
+ this.$element.trigger('change');
+ }
+ };
+
+ SelectAdapter.prototype.unselect = function (data) {
+ var self = this;
+
+ if (!this.$element.prop('multiple')) {
+ return;
+ }
+
+ data.selected = false;
+
+ if ($(data.element).is('option')) {
+ data.element.selected = false;
+
+ this.$element.trigger('change');
+
+ return;
+ }
+
+ this.current(function (currentData) {
+ var val = [];
+
+ for (var d = 0; d < currentData.length; d++) {
+ var id = currentData[d].id;
+
+ if (id !== data.id && $.inArray(id, val) === -1) {
+ val.push(id);
+ }
+ }
+
+ self.$element.val(val);
+
+ self.$element.trigger('change');
+ });
+ };
+
+ SelectAdapter.prototype.bind = function (container, $container) {
+ var self = this;
+
+ this.container = container;
+
+ container.on('select', function (params) {
+ self.select(params.data);
+ });
+
+ container.on('unselect', function (params) {
+ self.unselect(params.data);
+ });
+ };
+
+ SelectAdapter.prototype.destroy = function () {
+ // Remove anything added to child elements
+ this.$element.find('*').each(function () {
+ // Remove any custom data set by Select2
+ $.removeData(this, 'data');
+ });
+ };
+
+ SelectAdapter.prototype.query = function (params, callback) {
+ var data = [];
+ var self = this;
+
+ var $options = this.$element.children();
+
+ $options.each(function () {
+ var $option = $(this);
+
+ if (!$option.is('option') && !$option.is('optgroup')) {
+ return;
+ }
+
+ var option = self.item($option);
+
+ var matches = self.matches(params, option);
+
+ if (matches !== null) {
+ data.push(matches);
+ }
+ });
+
+ callback({
+ results: data
+ });
+ };
+
+ SelectAdapter.prototype.addOptions = function ($options) {
+ Utils.appendMany(this.$element, $options);
+ };
+
+ SelectAdapter.prototype.option = function (data) {
+ var option;
+
+ if (data.children) {
+ option = document.createElement('optgroup');
+ option.label = data.text;
+ } else {
+ option = document.createElement('option');
+
+ if (option.textContent !== undefined) {
+ option.textContent = data.text;
+ } else {
+ option.innerText = data.text;
+ }
+ }
+
+ if (data.id !== undefined) {
+ option.value = data.id;
+ }
+
+ if (data.disabled) {
+ option.disabled = true;
+ }
+
+ if (data.selected) {
+ option.selected = true;
+ }
+
+ if (data.title) {
+ option.title = data.title;
+ }
+
+ var $option = $(option);
+
+ var normalizedData = this._normalizeItem(data);
+ normalizedData.element = option;
+
+ // Override the option's data with the combined data
+ $.data(option, 'data', normalizedData);
+
+ return $option;
+ };
+
+ SelectAdapter.prototype.item = function ($option) {
+ var data = {};
+
+ data = $.data($option[0], 'data');
+
+ if (data != null) {
+ return data;
+ }
+
+ if ($option.is('option')) {
+ data = {
+ id: $option.val(),
+ text: $option.text(),
+ disabled: $option.prop('disabled'),
+ selected: $option.prop('selected'),
+ title: $option.prop('title')
+ };
+ } else if ($option.is('optgroup')) {
+ data = {
+ text: $option.prop('label'),
+ children: [],
+ title: $option.prop('title')
+ };
+
+ var $children = $option.children('option');
+ var children = [];
+
+ for (var c = 0; c < $children.length; c++) {
+ var $child = $($children[c]);
+
+ var child = this.item($child);
+
+ children.push(child);
+ }
+
+ data.children = children;
+ }
+
+ data = this._normalizeItem(data);
+ data.element = $option[0];
+
+ $.data($option[0], 'data', data);
+
+ return data;
+ };
+
+ SelectAdapter.prototype._normalizeItem = function (item) {
+ if (!$.isPlainObject(item)) {
+ item = {
+ id: item,
+ text: item
+ };
+ }
+
+ item = $.extend({}, {
+ text: ''
+ }, item);
+
+ var defaults = {
+ selected: false,
+ disabled: false
+ };
+
+ if (item.id != null) {
+ item.id = item.id.toString();
+ }
+
+ if (item.text != null) {
+ item.text = item.text.toString();
+ }
+
+ if (item._resultId == null && item.id) {
+ item._resultId = this.generateResultId(this.container, item);
+ }
+
+ return $.extend({}, defaults, item);
+ };
+
+ SelectAdapter.prototype.matches = function (params, data) {
+ var matcher = this.options.get('matcher');
+
+ return matcher(params, data);
+ };
+
+ return SelectAdapter;
+});
+
+S2.define('select2/data/array',[
+ './select',
+ '../utils',
+ 'jquery'
+], function (SelectAdapter, Utils, $) {
+ function ArrayAdapter ($element, options) {
+ var data = options.get('data') || [];
+
+ ArrayAdapter.__super__.constructor.call(this, $element, options);
+
+ this.addOptions(this.convertToOptions(data));
+ }
+
+ Utils.Extend(ArrayAdapter, SelectAdapter);
+
+ ArrayAdapter.prototype.select = function (data) {
+ var $option = this.$element.find('option').filter(function (i, elm) {
+ return elm.value == data.id.toString();
+ });
+
+ if ($option.length === 0) {
+ $option = this.option(data);
+
+ this.addOptions($option);
+ }
+
+ ArrayAdapter.__super__.select.call(this, data);
+ };
+
+ ArrayAdapter.prototype.convertToOptions = function (data) {
+ var self = this;
+
+ var $existing = this.$element.find('option');
+ var existingIds = $existing.map(function () {
+ return self.item($(this)).id;
+ }).get();
+
+ var $options = [];
+
+ // Filter out all items except for the one passed in the argument
+ function onlyItem (item) {
+ return function () {
+ return $(this).val() == item.id;
+ };
+ }
+
+ for (var d = 0; d < data.length; d++) {
+ var item = this._normalizeItem(data[d]);
+
+ // Skip items which were pre-loaded, only merge the data
+ if ($.inArray(item.id, existingIds) >= 0) {
+ var $existingOption = $existing.filter(onlyItem(item));
+
+ var existingData = this.item($existingOption);
+ var newData = $.extend(true, {}, item, existingData);
+
+ var $newOption = this.option(newData);
+
+ $existingOption.replaceWith($newOption);
+
+ continue;
+ }
+
+ var $option = this.option(item);
+
+ if (item.children) {
+ var $children = this.convertToOptions(item.children);
+
+ Utils.appendMany($option, $children);
+ }
+
+ $options.push($option);
+ }
+
+ return $options;
+ };
+
+ return ArrayAdapter;
+});
+
+S2.define('select2/data/ajax',[
+ './array',
+ '../utils',
+ 'jquery'
+], function (ArrayAdapter, Utils, $) {
+ function AjaxAdapter ($element, options) {
+ this.ajaxOptions = this._applyDefaults(options.get('ajax'));
+
+ if (this.ajaxOptions.processResults != null) {
+ this.processResults = this.ajaxOptions.processResults;
+ }
+
+ AjaxAdapter.__super__.constructor.call(this, $element, options);
+ }
+
+ Utils.Extend(AjaxAdapter, ArrayAdapter);
+
+ AjaxAdapter.prototype._applyDefaults = function (options) {
+ var defaults = {
+ data: function (params) {
+ return $.extend({}, params, {
+ q: params.term
+ });
+ },
+ transport: function (params, success, failure) {
+ var $request = $.ajax(params);
+
+ $request.then(success);
+ $request.fail(failure);
+
+ return $request;
+ }
+ };
+
+ return $.extend({}, defaults, options, true);
+ };
+
+ AjaxAdapter.prototype.processResults = function (results) {
+ return results;
+ };
+
+ AjaxAdapter.prototype.query = function (params, callback) {
+ var matches = [];
+ var self = this;
+
+ if (this._request != null) {
+ // JSONP requests cannot always be aborted
+ if ($.isFunction(this._request.abort)) {
+ this._request.abort();
+ }
+
+ this._request = null;
+ }
+
+ var options = $.extend({
+ type: 'GET'
+ }, this.ajaxOptions);
+
+ if (typeof options.url === 'function') {
+ options.url = options.url.call(this.$element, params);
+ }
+
+ if (typeof options.data === 'function') {
+ options.data = options.data.call(this.$element, params);
+ }
+
+ function request () {
+ var $request = options.transport(options, function (data) {
+ var results = self.processResults(data, params);
+
+ if (self.options.get('debug') && window.console && console.error) {
+ // Check to make sure that the response included a `results` key.
+ if (!results || !results.results || !$.isArray(results.results)) {
+ console.error(
+ 'Select2: The AJAX results did not return an array in the ' +
+ '`results` key of the response.'
+ );
+ }
+ }
+
+ callback(results);
+ self.container.focusOnActiveElement();
+ }, function () {
+ // Attempt to detect if a request was aborted
+ // Only works if the transport exposes a status property
+ if ($request.status && $request.status === '0') {
+ return;
+ }
+
+ self.trigger('results:message', {
+ message: 'errorLoading'
+ });
+ });
+
+ self._request = $request;
+ }
+
+ if (this.ajaxOptions.delay && params.term != null) {
+ if (this._queryTimeout) {
+ window.clearTimeout(this._queryTimeout);
+ }
+
+ this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
+ } else {
+ request();
+ }
+ };
+
+ return AjaxAdapter;
+});
+
+S2.define('select2/data/tags',[
+ 'jquery'
+], function ($) {
+ function Tags (decorated, $element, options) {
+ var tags = options.get('tags');
+
+ var createTag = options.get('createTag');
+
+ if (createTag !== undefined) {
+ this.createTag = createTag;
+ }
+
+ var insertTag = options.get('insertTag');
+
+ if (insertTag !== undefined) {
+ this.insertTag = insertTag;
+ }
+
+ decorated.call(this, $element, options);
+
+ if ($.isArray(tags)) {
+ for (var t = 0; t < tags.length; t++) {
+ var tag = tags[t];
+ var item = this._normalizeItem(tag);
+
+ var $option = this.option(item);
+
+ this.$element.append($option);
+ }
+ }
+ }
+
+ Tags.prototype.query = function (decorated, params, callback) {
+ var self = this;
+
+ this._removeOldTags();
+
+ if (params.term == null || params.page != null) {
+ decorated.call(this, params, callback);
+ return;
+ }
+
+ function wrapper (obj, child) {
+ var data = obj.results;
+
+ for (var i = 0; i < data.length; i++) {
+ var option = data[i];
+
+ var checkChildren = (
+ option.children != null &&
+ !wrapper({
+ results: option.children
+ }, true)
+ );
+
+ var optionText = (option.text || '').toUpperCase();
+ var paramsTerm = (params.term || '').toUpperCase();
+
+ var checkText = optionText === paramsTerm;
+
+ if (checkText || checkChildren) {
+ if (child) {
+ return false;
+ }
+
+ obj.data = data;
+ callback(obj);
+
+ return;
+ }
+ }
+
+ if (child) {
+ return true;
+ }
+
+ var tag = self.createTag(params);
+
+ if (tag != null) {
+ var $option = self.option(tag);
+ $option.attr('data-select2-tag', true);
+
+ self.addOptions([$option]);
+
+ self.insertTag(data, tag);
+ }
+
+ obj.results = data;
+
+ callback(obj);
+ }
+
+ decorated.call(this, params, wrapper);
+ };
+
+ Tags.prototype.createTag = function (decorated, params) {
+ var term = $.trim(params.term);
+
+ if (term === '') {
+ return null;
+ }
+
+ return {
+ id: term,
+ text: term
+ };
+ };
+
+ Tags.prototype.insertTag = function (_, data, tag) {
+ data.unshift(tag);
+ };
+
+ Tags.prototype._removeOldTags = function (_) {
+ var tag = this._lastTag;
+
+ var $options = this.$element.find('option[data-select2-tag]');
+
+ $options.each(function () {
+ if (this.selected) {
+ return;
+ }
+
+ $(this).remove();
+ });
+ };
+
+ return Tags;
+});
+
+S2.define('select2/data/tokenizer',[
+ 'jquery'
+], function ($) {
+ function Tokenizer (decorated, $element, options) {
+ var tokenizer = options.get('tokenizer');
+
+ if (tokenizer !== undefined) {
+ this.tokenizer = tokenizer;
+ }
+
+ decorated.call(this, $element, options);
+ }
+
+ Tokenizer.prototype.bind = function (decorated, container, $container) {
+ decorated.call(this, container, $container);
+
+ this.$search = container.dropdown.$search || container.selection.$search ||
+ $container.find('.select2-search__field');
+ };
+
+ Tokenizer.prototype.query = function (decorated, params, callback) {
+ var self = this;
+
+ function createAndSelect (data) {
+ // Normalize the data object so we can use it for checks
+ var item = self._normalizeItem(data);
+
+ // Check if the data object already exists as a tag
+ // Select it if it doesn't
+ var $existingOptions = self.$element.find('option').filter(function () {
+ return $(this).val() === item.id;
+ });
+
+ // If an existing option wasn't found for it, create the option
+ if (!$existingOptions.length) {
+ var $option = self.option(item);
+ $option.attr('data-select2-tag', true);
+
+ self._removeOldTags();
+ self.addOptions([$option]);
+ }
+
+ // Select the item, now that we know there is an option for it
+ select(item);
+ }
+
+ function select (data) {
+ self.trigger('select', {
+ data: data
+ });
+ }
+
+ params.term = params.term || '';
+
+ var tokenData = this.tokenizer(params, this.options, createAndSelect);
+
+ if (tokenData.term !== params.term) {
+ // Replace the search term if we have the search box
+ if (this.$search.length) {
+ this.$search.val(tokenData.term);
+ this.$search.focus();
+ }
+
+ params.term = tokenData.term;
+ }
+
+ decorated.call(this, params, callback);
+ };
+
+ Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
+ var separators = options.get('tokenSeparators') || [];
+ var term = params.term;
+ var i = 0;
+
+ var createTag = this.createTag || function (params) {
+ return {
+ id: params.term,
+ text: params.term
+ };
+ };
+
+ while (i < term.length) {
+ var termChar = term[i];
+
+ if ($.inArray(termChar, separators) === -1) {
+ i++;
+
+ continue;
+ }
+
+ var part = term.substr(0, i);
+ var partParams = $.extend({}, params, {
+ term: part
+ });
+
+ var data = createTag(partParams);
+
+ if (data == null) {
+ i++;
+ continue;
+ }
+
+ callback(data);
+
+ // Reset the term to not include the tokenized portion
+ term = term.substr(i + 1) || '';
+ i = 0;
+ }
+
+ return {
+ term: term
+ };
+ };
+
+ return Tokenizer;
+});
+
+S2.define('select2/data/minimumInputLength',[
+
+], function () {
+ function MinimumInputLength (decorated, $e, options) {
+ this.minimumInputLength = options.get('minimumInputLength');
+
+ decorated.call(this, $e, options);
+ }
+
+ MinimumInputLength.prototype.query = function (decorated, params, callback) {
+ params.term = params.term || '';
+
+ if (params.term.length < this.minimumInputLength) {
+ this.trigger('results:message', {
+ message: 'inputTooShort',
+ args: {
+ minimum: this.minimumInputLength,
+ input: params.term,
+ params: params
+ }
+ });
+
+ return;
+ }
+
+ decorated.call(this, params, callback);
+ };
+
+ return MinimumInputLength;
+});
+
+S2.define('select2/data/maximumInputLength',[
+
+], function () {
+ function MaximumInputLength (decorated, $e, options) {
+ this.maximumInputLength = options.get('maximumInputLength');
+
+ decorated.call(this, $e, options);
+ }
+
+ MaximumInputLength.prototype.query = function (decorated, params, callback) {
+ params.term = params.term || '';
+
+ if (this.maximumInputLength > 0 &&
+ params.term.length > this.maximumInputLength) {
+ this.trigger('results:message', {
+ message: 'inputTooLong',
+ args: {
+ maximum: this.maximumInputLength,
+ input: params.term,
+ params: params
+ }
+ });
+
+ return;
+ }
+
+ decorated.call(this, params, callback);
+ };
+
+ return MaximumInputLength;
+});
+
+S2.define('select2/data/maximumSelectionLength',[
+
+], function (){
+ function MaximumSelectionLength (decorated, $e, options) {
+ this.maximumSelectionLength = options.get('maximumSelectionLength');
+
+ decorated.call(this, $e, options);
+ }
+
+ MaximumSelectionLength.prototype.query =
+ function (decorated, params, callback) {
+ var self = this;
+
+ this.current(function (currentData) {
+ var count = currentData != null ? currentData.length : 0;
+ if (self.maximumSelectionLength > 0 &&
+ count >= self.maximumSelectionLength) {
+ self.trigger('results:message', {
+ message: 'maximumSelected',
+ args: {
+ maximum: self.maximumSelectionLength
+ }
+ });
+ return;
+ }
+ decorated.call(self, params, callback);
+ });
+ };
+
+ return MaximumSelectionLength;
+});
+
+S2.define('select2/dropdown',[
+ 'jquery',
+ './utils'
+], function ($, Utils) {
+ function Dropdown ($element, options) {
+ this.$element = $element;
+ this.options = options;
+
+ Dropdown.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(Dropdown, Utils.Observable);
+
+ Dropdown.prototype.render = function () {
+ var $dropdown = $(
+ '
' +
+ ' ' +
+ ' '
+ );
+
+ $dropdown.attr('dir', this.options.get('dir'));
+
+ this.$dropdown = $dropdown;
+
+ return $dropdown;
+ };
+
+ Dropdown.prototype.bind = function () {
+ // Should be implemented in subclasses
+ };
+
+ Dropdown.prototype.position = function ($dropdown, $container) {
+ // Should be implmented in subclasses
+ };
+
+ Dropdown.prototype.destroy = function () {
+ // Remove the dropdown from the DOM
+ this.$dropdown.remove();
+ };
+
+ return Dropdown;
+});
+
+S2.define('select2/dropdown/search',[
+ 'jquery',
+ '../utils'
+], function ($, Utils) {
+ function Search () { }
+
+ Search.prototype.render = function (decorated) {
+ var $rendered = decorated.call(this);
+
+ var $search = $(
+ '
' +
+ ' ' +
+ ' '
+ );
+
+ this.$searchContainer = $search;
+ this.$search = $search.find('input');
+
+ $rendered.prepend($search);
+
+ return $rendered;
+ };
+
+ Search.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+ var resultsId = container.id + '-results';
+
+ decorated.call(this, container, $container);
+
+ this.$search.on('keydown', function (evt) {
+ self.trigger('keypress', evt);
+
+ self._keyUpPrevented = evt.isDefaultPrevented();
+ });
+
+ // Workaround for browsers which do not support the `input` event
+ // This will prevent double-triggering of events for browsers which support
+ // both the `keyup` and `input` events.
+ this.$search.on('input', function (evt) {
+ // Unbind the duplicated `keyup` event
+ $(this).off('keyup');
+ });
+
+ this.$search.on('keyup input', function (evt) {
+ self.handleSearch(evt);
+ });
+
+ container.on('open', function () {
+ self.$search.attr('tabindex', 0);
+ self.$search.attr('aria-owns', resultsId);
+ self.$search.focus();
+
+ window.setTimeout(function () {
+ self.$search.focus();
+ }, 0);
+ });
+
+ container.on('close', function () {
+ self.$search.attr('tabindex', -1);
+ self.$search.removeAttr('aria-activedescendant');
+ self.$search.removeAttr('aria-owns');
+ self.$search.val('');
+ });
+
+ container.on('focus', function () {
+ if (container.isOpen()) {
+ self.$search.focus();
+ }
+ });
+
+ container.on('results:all', function (params) {
+ if (params.query.term == null || params.query.term === '') {
+ var showSearch = self.showSearch(params);
+
+ if (showSearch) {
+ self.$searchContainer.removeClass('select2-search--hide');
+ } else {
+ self.$searchContainer.addClass('select2-search--hide');
+ }
+ }
+ });
+
+ container.on('results:focus', function (params) {
+ self.$search.attr('aria-activedescendant', params.data._resultId);
+ });
+ };
+
+ Search.prototype.handleSearch = function (evt) {
+ if (!this._keyUpPrevented) {
+ var input = this.$search.val();
+
+ this.trigger('query', {
+ term: input
+ });
+ }
+
+ this._keyUpPrevented = false;
+ };
+
+ Search.prototype.showSearch = function (_, params) {
+ return true;
+ };
+
+ return Search;
+});
+
+S2.define('select2/dropdown/hidePlaceholder',[
+
+], function () {
+ function HidePlaceholder (decorated, $element, options, dataAdapter) {
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
+
+ decorated.call(this, $element, options, dataAdapter);
+ }
+
+ HidePlaceholder.prototype.append = function (decorated, data) {
+ data.results = this.removePlaceholder(data.results);
+
+ decorated.call(this, data);
+ };
+
+ HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
+ if (typeof placeholder === 'string') {
+ placeholder = {
+ id: '',
+ text: placeholder
+ };
+ }
+
+ return placeholder;
+ };
+
+ HidePlaceholder.prototype.removePlaceholder = function (_, data) {
+ var modifiedData = data.slice(0);
+
+ for (var d = data.length - 1; d >= 0; d--) {
+ var item = data[d];
+
+ if (this.placeholder.id === item.id) {
+ modifiedData.splice(d, 1);
+ }
+ }
+
+ return modifiedData;
+ };
+
+ return HidePlaceholder;
+});
+
+S2.define('select2/dropdown/infiniteScroll',[
+ 'jquery'
+], function ($) {
+ function InfiniteScroll (decorated, $element, options, dataAdapter) {
+ this.lastParams = {};
+
+ decorated.call(this, $element, options, dataAdapter);
+
+ this.$loadingMore = this.createLoadingMore();
+ this.loading = false;
+ }
+
+ InfiniteScroll.prototype.append = function (decorated, data) {
+ this.$loadingMore.remove();
+ this.loading = false;
+
+ decorated.call(this, data);
+
+ if (this.showLoadingMore(data)) {
+ this.$results.append(this.$loadingMore);
+ }
+ };
+
+ InfiniteScroll.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('query', function (params) {
+ self.lastParams = params;
+ self.loading = true;
+ });
+
+ container.on('query:append', function (params) {
+ self.lastParams = params;
+ self.loading = true;
+ });
+
+ this.$results.on('scroll', function () {
+ var isLoadMoreVisible = $.contains(
+ document.documentElement,
+ self.$loadingMore[0]
+ );
+
+ if (self.loading || !isLoadMoreVisible) {
+ return;
+ }
+
+ var currentOffset = self.$results.offset().top +
+ self.$results.outerHeight(false);
+ var loadingMoreOffset = self.$loadingMore.offset().top +
+ self.$loadingMore.outerHeight(false);
+
+ if (currentOffset + 50 >= loadingMoreOffset) {
+ self.loadMore();
+ }
+ });
+ };
+
+ InfiniteScroll.prototype.loadMore = function () {
+ this.loading = true;
+
+ var params = $.extend({}, {page: 1}, this.lastParams);
+
+ params.page++;
+
+ this.trigger('query:append', params);
+ };
+
+ InfiniteScroll.prototype.showLoadingMore = function (_, data) {
+ return data.pagination && data.pagination.more;
+ };
+
+ InfiniteScroll.prototype.createLoadingMore = function () {
+ var $option = $(
+ '
'
+ );
+
+ var message = this.options.get('translations').get('loadingMore');
+
+ $option.html(message(this.lastParams));
+
+ return $option;
+ };
+
+ return InfiniteScroll;
+});
+
+S2.define('select2/dropdown/attachBody',[
+ 'jquery',
+ '../utils'
+], function ($, Utils) {
+ function AttachBody (decorated, $element, options) {
+ this.$dropdownParent = options.get('dropdownParent') || $(document.body);
+
+ decorated.call(this, $element, options);
+ }
+
+ AttachBody.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ var setupResultsEvents = false;
+
+ decorated.call(this, container, $container);
+
+ container.on('open', function () {
+ self._showDropdown();
+ self._attachPositioningHandler(container);
+
+ if (!setupResultsEvents) {
+ setupResultsEvents = true;
+
+ container.on('results:all', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ container.on('results:append', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+ }
+ });
+
+ container.on('close', function () {
+ self._hideDropdown();
+ self._detachPositioningHandler(container);
+ });
+
+ this.$dropdownContainer.on('mousedown', function (evt) {
+ evt.stopPropagation();
+ });
+ };
+
+ AttachBody.prototype.destroy = function (decorated) {
+ decorated.call(this);
+
+ this.$dropdownContainer.remove();
+ };
+
+ AttachBody.prototype.position = function (decorated, $dropdown, $container) {
+ // Clone all of the container classes
+ $dropdown.attr('class', $container.attr('class'));
+
+ $dropdown.removeClass('select2');
+ $dropdown.addClass('select2-container--open');
+
+ $dropdown.css({
+ position: 'absolute',
+ top: -999999
+ });
+
+ this.$container = $container;
+ };
+
+ AttachBody.prototype.render = function (decorated) {
+ var $container = $('
');
+
+ var $dropdown = decorated.call(this);
+ $container.append($dropdown);
+
+ this.$dropdownContainer = $container;
+
+ return $container;
+ };
+
+ AttachBody.prototype._hideDropdown = function (decorated) {
+ this.$dropdownContainer.detach();
+ };
+
+ AttachBody.prototype._attachPositioningHandler =
+ function (decorated, container) {
+ var self = this;
+
+ var scrollEvent = 'scroll.select2.' + container.id;
+ var resizeEvent = 'resize.select2.' + container.id;
+ var orientationEvent = 'orientationchange.select2.' + container.id;
+
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
+ $watchers.each(function () {
+ $(this).data('select2-scroll-position', {
+ x: $(this).scrollLeft(),
+ y: $(this).scrollTop()
+ });
+ });
+
+ $watchers.on(scrollEvent, function (ev) {
+ var position = $(this).data('select2-scroll-position');
+ $(this).scrollTop(position.y);
+ });
+
+ $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
+ function (e) {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+ };
+
+ AttachBody.prototype._detachPositioningHandler =
+ function (decorated, container) {
+ var scrollEvent = 'scroll.select2.' + container.id;
+ var resizeEvent = 'resize.select2.' + container.id;
+ var orientationEvent = 'orientationchange.select2.' + container.id;
+
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
+ $watchers.off(scrollEvent);
+
+ $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
+ };
+
+ AttachBody.prototype._positionDropdown = function () {
+ var $window = $(window);
+
+ var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
+ var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
+
+ var newDirection = null;
+
+ var offset = this.$container.offset();
+
+ offset.bottom = offset.top + this.$container.outerHeight(false);
+
+ var container = {
+ height: this.$container.outerHeight(false)
+ };
+
+ container.top = offset.top;
+ container.bottom = offset.top + container.height;
+
+ var dropdown = {
+ height: this.$dropdown.outerHeight(false)
+ };
+
+ var viewport = {
+ top: $window.scrollTop(),
+ bottom: $window.scrollTop() + $window.height()
+ };
+
+ var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
+ var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
+
+ var css = {
+ left: offset.left,
+ top: container.bottom
+ };
+
+ // Determine what the parent element is to use for calciulating the offset
+ var $offsetParent = this.$dropdownParent;
+
+ // For statically positoned elements, we need to get the element
+ // that is determining the offset
+ if ($offsetParent.css('position') === 'static') {
+ $offsetParent = $offsetParent.offsetParent();
+ }
+
+ var parentOffset = $offsetParent.offset();
+
+ css.top -= parentOffset.top;
+ css.left -= parentOffset.left;
+
+ if (!isCurrentlyAbove && !isCurrentlyBelow) {
+ newDirection = 'below';
+ }
+
+ if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
+ newDirection = 'above';
+ } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
+ newDirection = 'below';
+ }
+
+ if (newDirection == 'above' ||
+ (isCurrentlyAbove && newDirection !== 'below')) {
+ css.top = container.top - parentOffset.top - dropdown.height;
+ }
+
+ if (newDirection != null) {
+ this.$dropdown
+ .removeClass('select2-dropdown--below select2-dropdown--above')
+ .addClass('select2-dropdown--' + newDirection);
+ this.$container
+ .removeClass('select2-container--below select2-container--above')
+ .addClass('select2-container--' + newDirection);
+ }
+
+ this.$dropdownContainer.css(css);
+ };
+
+ AttachBody.prototype._resizeDropdown = function () {
+ var css = {
+ width: this.$container.outerWidth(false) + 'px'
+ };
+
+ if (this.options.get('dropdownAutoWidth')) {
+ css.minWidth = css.width;
+ css.position = 'relative';
+ css.width = 'auto';
+ }
+
+ this.$dropdown.css(css);
+ };
+
+ AttachBody.prototype._showDropdown = function (decorated) {
+ this.$dropdownContainer.appendTo(this.$dropdownParent);
+
+ this._positionDropdown();
+ this._resizeDropdown();
+ };
+
+ return AttachBody;
+});
+
+S2.define('select2/dropdown/minimumResultsForSearch',[
+
+], function () {
+ function countResults (data) {
+ var count = 0;
+
+ for (var d = 0; d < data.length; d++) {
+ var item = data[d];
+
+ if (item.children) {
+ count += countResults(item.children);
+ } else {
+ count++;
+ }
+ }
+
+ return count;
+ }
+
+ function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
+ this.minimumResultsForSearch = options.get('minimumResultsForSearch');
+
+ if (this.minimumResultsForSearch < 0) {
+ this.minimumResultsForSearch = Infinity;
+ }
+
+ decorated.call(this, $element, options, dataAdapter);
+ }
+
+ MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
+ if (countResults(params.data.results) < this.minimumResultsForSearch) {
+ return false;
+ }
+
+ return decorated.call(this, params);
+ };
+
+ return MinimumResultsForSearch;
+});
+
+S2.define('select2/dropdown/selectOnClose',[
+
+], function () {
+ function SelectOnClose () { }
+
+ SelectOnClose.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('close', function (params) {
+ self._handleSelectOnClose(params);
+ });
+ };
+
+ SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
+ if (params && params.originalSelect2Event != null) {
+ var event = params.originalSelect2Event;
+
+ // Don't select an item if the close event was triggered from a select or
+ // unselect event
+ if (event._type === 'select' || event._type === 'unselect') {
+ return;
+ }
+ }
+
+ var $highlightedResults = this.getHighlightedResults();
+
+ // Only select highlighted results
+ if ($highlightedResults.length < 1) {
+ return;
+ }
+
+ var data = $highlightedResults.data('data');
+
+ // Don't re-select already selected resulte
+ if (
+ (data.element != null && data.element.selected) ||
+ (data.element == null && data.selected)
+ ) {
+ return;
+ }
+
+ this.trigger('select', {
+ data: data
+ });
+ };
+
+ return SelectOnClose;
+});
+
+S2.define('select2/dropdown/closeOnSelect',[
+
+], function () {
+ function CloseOnSelect () { }
+
+ CloseOnSelect.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('select', function (evt) {
+ self._selectTriggered(evt);
+ });
+
+ container.on('unselect', function (evt) {
+ self._selectTriggered(evt);
+ });
+ };
+
+ CloseOnSelect.prototype._selectTriggered = function (_, evt) {
+ var originalEvent = evt.originalEvent;
+
+ // Don't close if the control key is being held
+ if (originalEvent && originalEvent.ctrlKey) {
+ return;
+ }
+
+ this.trigger('close', {
+ originalEvent: originalEvent,
+ originalSelect2Event: evt
+ });
+ };
+
+ return CloseOnSelect;
+});
+
+S2.define('select2/i18n/en',[],function () {
+ // English
+ return {
+ errorLoading: function () {
+ return 'The results could not be loaded.';
+ },
+ inputTooLong: function (args) {
+ var overChars = args.input.length - args.maximum;
+
+ var message = 'Please delete ' + overChars + ' character';
+
+ if (overChars != 1) {
+ message += 's';
+ }
+
+ return message;
+ },
+ inputTooShort: function (args) {
+ var remainingChars = args.minimum - args.input.length;
+
+ var message = 'Please enter ' + remainingChars + ' or more characters';
+
+ return message;
+ },
+ loadingMore: function () {
+ return 'Loading more results…';
+ },
+ maximumSelected: function (args) {
+ var message = 'You can only select ' + args.maximum + ' item';
+
+ if (args.maximum != 1) {
+ message += 's';
+ }
+
+ return message;
+ },
+ noResults: function () {
+ return 'No results found';
+ },
+ searching: function () {
+ return 'Searching…';
+ }
+ };
+});
+
+S2.define('select2/defaults',[
+ 'jquery',
+ 'require',
+
+ './results',
+
+ './selection/single',
+ './selection/multiple',
+ './selection/placeholder',
+ './selection/allowClear',
+ './selection/search',
+ './selection/eventRelay',
+
+ './utils',
+ './translation',
+ './diacritics',
+
+ './data/select',
+ './data/array',
+ './data/ajax',
+ './data/tags',
+ './data/tokenizer',
+ './data/minimumInputLength',
+ './data/maximumInputLength',
+ './data/maximumSelectionLength',
+
+ './dropdown',
+ './dropdown/search',
+ './dropdown/hidePlaceholder',
+ './dropdown/infiniteScroll',
+ './dropdown/attachBody',
+ './dropdown/minimumResultsForSearch',
+ './dropdown/selectOnClose',
+ './dropdown/closeOnSelect',
+
+ './i18n/en'
+], function ($, require,
+
+ ResultsList,
+
+ SingleSelection, MultipleSelection, Placeholder, AllowClear,
+ SelectionSearch, EventRelay,
+
+ Utils, Translation, DIACRITICS,
+
+ SelectData, ArrayData, AjaxData, Tags, Tokenizer,
+ MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
+
+ Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
+ AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
+
+ EnglishTranslation) {
+ function Defaults () {
+ this.reset();
+ }
+
+ Defaults.prototype.apply = function (options) {
+ options = $.extend(true, {}, this.defaults, options);
+
+ if (options.dataAdapter == null) {
+ if (options.ajax != null) {
+ options.dataAdapter = AjaxData;
+ } else if (options.data != null) {
+ options.dataAdapter = ArrayData;
+ } else {
+ options.dataAdapter = SelectData;
+ }
+
+ if (options.minimumInputLength > 0) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ MinimumInputLength
+ );
+ }
+
+ if (options.maximumInputLength > 0) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ MaximumInputLength
+ );
+ }
+
+ if (options.maximumSelectionLength > 0) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ MaximumSelectionLength
+ );
+ }
+
+ if (options.tags) {
+ options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
+ }
+
+ if (options.tokenSeparators != null || options.tokenizer != null) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ Tokenizer
+ );
+ }
+
+ if (options.query != null) {
+ var Query = require(options.amdBase + 'compat/query');
+
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ Query
+ );
+ }
+
+ if (options.initSelection != null) {
+ var InitSelection = require(options.amdBase + 'compat/initSelection');
+
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ InitSelection
+ );
+ }
+ }
+
+ if (options.resultsAdapter == null) {
+ options.resultsAdapter = ResultsList;
+
+ if (options.ajax != null) {
+ options.resultsAdapter = Utils.Decorate(
+ options.resultsAdapter,
+ InfiniteScroll
+ );
+ }
+
+ if (options.placeholder != null) {
+ options.resultsAdapter = Utils.Decorate(
+ options.resultsAdapter,
+ HidePlaceholder
+ );
+ }
+
+ if (options.selectOnClose) {
+ options.resultsAdapter = Utils.Decorate(
+ options.resultsAdapter,
+ SelectOnClose
+ );
+ }
+ }
+
+ if (options.dropdownAdapter == null) {
+ if (options.multiple) {
+ options.dropdownAdapter = Dropdown;
+ } else {
+ var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
+
+ options.dropdownAdapter = SearchableDropdown;
+ }
+
+ if (options.minimumResultsForSearch !== 0) {
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ MinimumResultsForSearch
+ );
+ }
+
+ if (options.closeOnSelect) {
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ CloseOnSelect
+ );
+ }
+
+ if (
+ options.dropdownCssClass != null ||
+ options.dropdownCss != null ||
+ options.adaptDropdownCssClass != null
+ ) {
+ var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
+
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ DropdownCSS
+ );
+ }
+
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ AttachBody
+ );
+ }
+
+ if (options.selectionAdapter == null) {
+ if (options.multiple) {
+ options.selectionAdapter = MultipleSelection;
+ } else {
+ options.selectionAdapter = SingleSelection;
+ }
+
+ // Add the placeholder mixin if a placeholder was specified
+ if (options.placeholder != null) {
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ Placeholder
+ );
+ }
+
+ if (options.allowClear) {
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ AllowClear
+ );
+ }
+
+ if (options.multiple) {
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ SelectionSearch
+ );
+ }
+
+ if (
+ options.containerCssClass != null ||
+ options.containerCss != null ||
+ options.adaptContainerCssClass != null
+ ) {
+ var ContainerCSS = require(options.amdBase + 'compat/containerCss');
+
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ ContainerCSS
+ );
+ }
+
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ EventRelay
+ );
+ }
+
+ if (typeof options.language === 'string') {
+ // Check if the language is specified with a region
+ if (options.language.indexOf('-') > 0) {
+ // Extract the region information if it is included
+ var languageParts = options.language.split('-');
+ var baseLanguage = languageParts[0];
+
+ options.language = [options.language, baseLanguage];
+ } else {
+ options.language = [options.language];
+ }
+ }
+
+ if ($.isArray(options.language)) {
+ var languages = new Translation();
+ options.language.push('en');
+
+ var languageNames = options.language;
+
+ for (var l = 0; l < languageNames.length; l++) {
+ var name = languageNames[l];
+ var language = {};
+
+ try {
+ // Try to load it with the original name
+ language = Translation.loadPath(name);
+ } catch (e) {
+ try {
+ // If we couldn't load it, check if it wasn't the full path
+ name = this.defaults.amdLanguageBase + name;
+ language = Translation.loadPath(name);
+ } catch (ex) {
+ // The translation could not be loaded at all. Sometimes this is
+ // because of a configuration problem, other times this can be
+ // because of how Select2 helps load all possible translation files.
+ if (options.debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The language file for "' + name + '" could not be ' +
+ 'automatically loaded. A fallback will be used instead.'
+ );
+ }
+
+ continue;
+ }
+ }
+
+ languages.extend(language);
+ }
+
+ options.translations = languages;
+ } else {
+ var baseTranslation = Translation.loadPath(
+ this.defaults.amdLanguageBase + 'en'
+ );
+ var customTranslation = new Translation(options.language);
+
+ customTranslation.extend(baseTranslation);
+
+ options.translations = customTranslation;
+ }
+
+ return options;
+ };
+
+ Defaults.prototype.reset = function () {
+ function stripDiacritics (text) {
+ // Used 'uni range + named function' from http://jsperf.com/diacritics/18
+ function match(a) {
+ return DIACRITICS[a] || a;
+ }
+
+ return text.replace(/[^\u0000-\u007E]/g, match);
+ }
+
+ function matcher (params, data) {
+ // Always return the object if there is nothing to compare
+ if ($.trim(params.term) === '') {
+ return data;
+ }
+
+ // Do a recursive check for options with children
+ if (data.children && data.children.length > 0) {
+ // Clone the data object if there are children
+ // This is required as we modify the object to remove any non-matches
+ var match = $.extend(true, {}, data);
+
+ // Check each child of the option
+ for (var c = data.children.length - 1; c >= 0; c--) {
+ var child = data.children[c];
+
+ var matches = matcher(params, child);
+
+ // If there wasn't a match, remove the object in the array
+ if (matches == null) {
+ match.children.splice(c, 1);
+ }
+ }
+
+ // If any children matched, return the new object
+ if (match.children.length > 0) {
+ return match;
+ }
+
+ // If there were no matching children, check just the plain object
+ return matcher(params, match);
+ }
+
+ var original = stripDiacritics(data.text).toUpperCase();
+ var term = stripDiacritics(params.term).toUpperCase();
+
+ // Check if the text contains the term
+ if (original.indexOf(term) > -1) {
+ return data;
+ }
+
+ // If it doesn't contain the term, don't return anything
+ return null;
+ }
+
+ this.defaults = {
+ amdBase: './',
+ amdLanguageBase: './i18n/',
+ closeOnSelect: true,
+ debug: false,
+ dropdownAutoWidth: false,
+ escapeMarkup: Utils.escapeMarkup,
+ language: EnglishTranslation,
+ matcher: matcher,
+ minimumInputLength: 0,
+ maximumInputLength: 0,
+ maximumSelectionLength: 0,
+ minimumResultsForSearch: 0,
+ selectOnClose: false,
+ sorter: function (data) {
+ return data;
+ },
+ templateResult: function (result) {
+ return result.text;
+ },
+ templateSelection: function (selection) {
+ return selection.text;
+ },
+ theme: 'default',
+ width: 'resolve'
+ };
+ };
+
+ Defaults.prototype.set = function (key, value) {
+ var camelKey = $.camelCase(key);
+
+ var data = {};
+ data[camelKey] = value;
+
+ var convertedData = Utils._convertData(data);
+
+ $.extend(this.defaults, convertedData);
+ };
+
+ var defaults = new Defaults();
+
+ return defaults;
+});
+
+S2.define('select2/options',[
+ 'require',
+ 'jquery',
+ './defaults',
+ './utils'
+], function (require, $, Defaults, Utils) {
+ function Options (options, $element) {
+ this.options = options;
+
+ if ($element != null) {
+ this.fromElement($element);
+ }
+
+ this.options = Defaults.apply(this.options);
+
+ if ($element && $element.is('input')) {
+ var InputCompat = require(this.get('amdBase') + 'compat/inputData');
+
+ this.options.dataAdapter = Utils.Decorate(
+ this.options.dataAdapter,
+ InputCompat
+ );
+ }
+ }
+
+ Options.prototype.fromElement = function ($e) {
+ var excludedData = ['select2'];
+
+ if (this.options.multiple == null) {
+ this.options.multiple = $e.prop('multiple');
+ }
+
+ if (this.options.disabled == null) {
+ this.options.disabled = $e.prop('disabled');
+ }
+
+ if (this.options.language == null) {
+ if ($e.prop('lang')) {
+ this.options.language = $e.prop('lang').toLowerCase();
+ } else if ($e.closest('[lang]').prop('lang')) {
+ this.options.language = $e.closest('[lang]').prop('lang');
+ }
+ }
+
+ if (this.options.dir == null) {
+ if ($e.prop('dir')) {
+ this.options.dir = $e.prop('dir');
+ } else if ($e.closest('[dir]').prop('dir')) {
+ this.options.dir = $e.closest('[dir]').prop('dir');
+ } else {
+ this.options.dir = 'ltr';
+ }
+ }
+
+ $e.prop('disabled', this.options.disabled);
+ $e.prop('multiple', this.options.multiple);
+
+ if ($e.data('select2Tags')) {
+ if (this.options.debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `data-select2-tags` attribute has been changed to ' +
+ 'use the `data-data` and `data-tags="true"` attributes and will be ' +
+ 'removed in future versions of Select2.'
+ );
+ }
+
+ $e.data('data', $e.data('select2Tags'));
+ $e.data('tags', true);
+ }
+
+ if ($e.data('ajaxUrl')) {
+ if (this.options.debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `data-ajax-url` attribute has been changed to ' +
+ '`data-ajax--url` and support for the old attribute will be removed' +
+ ' in future versions of Select2.'
+ );
+ }
+
+ $e.attr('ajax--url', $e.data('ajaxUrl'));
+ $e.data('ajax--url', $e.data('ajaxUrl'));
+ }
+
+ var dataset = {};
+
+ // Prefer the element's `dataset` attribute if it exists
+ // jQuery 1.x does not correctly handle data attributes with multiple dashes
+ if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
+ dataset = $.extend(true, {}, $e[0].dataset, $e.data());
+ } else {
+ dataset = $e.data();
+ }
+
+ var data = $.extend(true, {}, dataset);
+
+ data = Utils._convertData(data);
+
+ for (var key in data) {
+ if ($.inArray(key, excludedData) > -1) {
+ continue;
+ }
+
+ if ($.isPlainObject(this.options[key])) {
+ $.extend(this.options[key], data[key]);
+ } else {
+ this.options[key] = data[key];
+ }
+ }
+
+ return this;
+ };
+
+ Options.prototype.get = function (key) {
+ return this.options[key];
+ };
+
+ Options.prototype.set = function (key, val) {
+ this.options[key] = val;
+ };
+
+ return Options;
+});
+
+S2.define('select2/core',[
+ 'jquery',
+ './options',
+ './utils',
+ './keys'
+], function ($, Options, Utils, KEYS) {
+ var Select2 = function ($element, options) {
+ if ($element.data('select2') != null) {
+ $element.data('select2').destroy();
+ }
+
+ this.$element = $element;
+
+ this.id = this._generateId($element);
+
+ options = options || {};
+
+ this.options = new Options(options, $element);
+
+ Select2.__super__.constructor.call(this);
+
+ // Set up the tabindex
+
+ var tabindex = $element.attr('tabindex') || 0;
+ $element.data('old-tabindex', tabindex);
+ $element.attr('tabindex', '-1');
+
+ // Set up containers and adapters
+
+ var DataAdapter = this.options.get('dataAdapter');
+ this.dataAdapter = new DataAdapter($element, this.options);
+
+ var $container = this.render();
+
+ this._placeContainer($container);
+
+ var SelectionAdapter = this.options.get('selectionAdapter');
+ this.selection = new SelectionAdapter($element, this.options);
+ this.$selection = this.selection.render();
+
+ this.selection.position(this.$selection, $container);
+
+ var DropdownAdapter = this.options.get('dropdownAdapter');
+ this.dropdown = new DropdownAdapter($element, this.options);
+ this.$dropdown = this.dropdown.render();
+
+ this.dropdown.position(this.$dropdown, $container);
+
+ var ResultsAdapter = this.options.get('resultsAdapter');
+ this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
+ this.$results = this.results.render();
+
+ this.results.position(this.$results, this.$dropdown);
+
+ // Bind events
+
+ var self = this;
+
+ // Bind the container to all of the adapters
+ this._bindAdapters();
+
+ // Register any DOM event handlers
+ this._registerDomEvents();
+
+ // Register any internal event handlers
+ this._registerDataEvents();
+ this._registerSelectionEvents();
+ this._registerDropdownEvents();
+ this._registerResultsEvents();
+ this._registerEvents();
+
+ // Set the initial state
+ this.dataAdapter.current(function (initialData) {
+ self.trigger('selection:update', {
+ data: initialData
+ });
+ });
+
+ // Hide the original select
+ $element.addClass('select2-hidden-accessible');
+ $element.attr('aria-hidden', 'true');
+
+ // Synchronize any monitored attributes
+ this._syncAttributes();
+
+ $element.data('select2', this);
+ };
+
+ Utils.Extend(Select2, Utils.Observable);
+
+ Select2.prototype._generateId = function ($element) {
+ var id = '';
+
+ if ($element.attr('id') != null) {
+ id = $element.attr('id');
+ } else if ($element.attr('name') != null) {
+ id = $element.attr('name') + '-' + Utils.generateChars(2);
+ } else {
+ id = Utils.generateChars(4);
+ }
+
+ id = id.replace(/(:|\.|\[|\]|,)/g, '');
+ id = 'select2-' + id;
+
+ return id;
+ };
+
+ Select2.prototype._placeContainer = function ($container) {
+ $container.insertAfter(this.$element);
+
+ var width = this._resolveWidth(this.$element, this.options.get('width'));
+
+ if (width != null) {
+ $container.css('width', width);
+ }
+ };
+
+ Select2.prototype._resolveWidth = function ($element, method) {
+ var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
+
+ if (method == 'resolve') {
+ var styleWidth = this._resolveWidth($element, 'style');
+
+ if (styleWidth != null) {
+ return styleWidth;
+ }
+
+ return this._resolveWidth($element, 'element');
+ }
+
+ if (method == 'element') {
+ var elementWidth = $element.outerWidth(false);
+
+ if (elementWidth <= 0) {
+ return 'auto';
+ }
+
+ return elementWidth + 'px';
+ }
+
+ if (method == 'style') {
+ var style = $element.attr('style');
+
+ if (typeof(style) !== 'string') {
+ return null;
+ }
+
+ var attrs = style.split(';');
+
+ for (var i = 0, l = attrs.length; i < l; i = i + 1) {
+ var attr = attrs[i].replace(/\s/g, '');
+ var matches = attr.match(WIDTH);
+
+ if (matches !== null && matches.length >= 1) {
+ return matches[1];
+ }
+ }
+
+ return null;
+ }
+
+ return method;
+ };
+
+ Select2.prototype._bindAdapters = function () {
+ this.dataAdapter.bind(this, this.$container);
+ this.selection.bind(this, this.$container);
+
+ this.dropdown.bind(this, this.$container);
+ this.results.bind(this, this.$container);
+ };
+
+ Select2.prototype._registerDomEvents = function () {
+ var self = this;
+
+ this.$element.on('change.select2', function () {
+ self.dataAdapter.current(function (data) {
+ self.trigger('selection:update', {
+ data: data
+ });
+ });
+ });
+
+ this.$element.on('focus.select2', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this._syncA = Utils.bind(this._syncAttributes, this);
+ this._syncS = Utils.bind(this._syncSubtree, this);
+
+ if (this.$element[0].attachEvent) {
+ this.$element[0].attachEvent('onpropertychange', this._syncA);
+ }
+
+ var observer = window.MutationObserver ||
+ window.WebKitMutationObserver ||
+ window.MozMutationObserver
+ ;
+
+ if (observer != null) {
+ this._observer = new observer(function (mutations) {
+ $.each(mutations, self._syncA);
+ $.each(mutations, self._syncS);
+ });
+ this._observer.observe(this.$element[0], {
+ attributes: true,
+ childList: true,
+ subtree: false
+ });
+ } else if (this.$element[0].addEventListener) {
+ this.$element[0].addEventListener(
+ 'DOMAttrModified',
+ self._syncA,
+ false
+ );
+ this.$element[0].addEventListener(
+ 'DOMNodeInserted',
+ self._syncS,
+ false
+ );
+ this.$element[0].addEventListener(
+ 'DOMNodeRemoved',
+ self._syncS,
+ false
+ );
+ }
+ };
+
+ Select2.prototype._registerDataEvents = function () {
+ var self = this;
+
+ this.dataAdapter.on('*', function (name, params) {
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerSelectionEvents = function () {
+ var self = this;
+ var nonRelayEvents = ['toggle', 'focus'];
+
+ this.selection.on('toggle', function () {
+ self.toggleDropdown();
+ });
+
+ this.selection.on('focus', function (params) {
+ self.focus(params);
+ });
+
+ this.selection.on('*', function (name, params) {
+ if ($.inArray(name, nonRelayEvents) !== -1) {
+ return;
+ }
+
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerDropdownEvents = function () {
+ var self = this;
+
+ this.dropdown.on('*', function (name, params) {
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerResultsEvents = function () {
+ var self = this;
+
+ this.results.on('*', function (name, params) {
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerEvents = function () {
+ var self = this;
+
+ this.on('open', function () {
+ self.$container.addClass('select2-container--open');
+ });
+
+ this.on('close', function () {
+ self.$container.removeClass('select2-container--open');
+ });
+
+ this.on('enable', function () {
+ self.$container.removeClass('select2-container--disabled');
+ });
+
+ this.on('disable', function () {
+ self.$container.addClass('select2-container--disabled');
+ });
+
+ this.on('blur', function () {
+ self.$container.removeClass('select2-container--focus');
+ });
+
+ this.on('query', function (params) {
+ if (!self.isOpen()) {
+ self.trigger('open', {});
+ }
+
+ this.dataAdapter.query(params, function (data) {
+ self.trigger('results:all', {
+ data: data,
+ query: params
+ });
+ });
+ });
+
+ this.on('query:append', function (params) {
+ this.dataAdapter.query(params, function (data) {
+ self.trigger('results:append', {
+ data: data,
+ query: params
+ });
+ });
+ });
+
+ this.on('open', function(){
+ // Focus on the active element when opening dropdown.
+ // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
+ setTimeout(function(){
+ self.focusOnActiveElement();
+ }, 1);
+ });
+
+ $(document).on('keydown', function (evt) {
+ var key = evt.which;
+ if (self.isOpen()) {
+ if (key === KEYS.ESC || key === KEYS.TAB ||
+ (key === KEYS.UP && evt.altKey)) {
+ self.close();
+
+ evt.preventDefault();
+ } else if (key === KEYS.ENTER) {
+ self.trigger('results:select', {});
+
+ evt.preventDefault();
+ } else if ((key === KEYS.SPACE && evt.ctrlKey)) {
+ self.trigger('results:toggle', {});
+
+ evt.preventDefault();
+ } else if (key === KEYS.UP) {
+ self.trigger('results:previous', {});
+
+ evt.preventDefault();
+ } else if (key === KEYS.DOWN) {
+ self.trigger('results:next', {});
+
+ evt.preventDefault();
+ }
+
+ // Move the focus to the selected element on keyboard navigation.
+ // Required for screen readers to work properly.
+ if (key === KEYS.DOWN || key === KEYS.UP) {
+ self.focusOnActiveElement();
+ } else {
+ // Focus on the search if user starts typing.
+ var $searchField = self.$dropdown.find('.select2-search__field');
+ if (! $searchField.length) {
+ $searchField = self.$container.find('.select2-search__field');
+ }
+ $searchField.focus();
+ // Focus back to active selection when finished typing.
+ // Small delay so typed character can be read by screen reader.
+ setTimeout(function(){
+ self.focusOnActiveElement();
+ }, 1000);
+ }
+
+ } else if (self.hasFocus()) {
+ if (key === KEYS.ENTER || key === KEYS.SPACE ||
+ (key === KEYS.DOWN && evt.altKey)) {
+ self.open();
+ evt.preventDefault();
+ }
+ }
+ });
+ };
+
+ Select2.prototype.focusOnActiveElement = function () {
+ // Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards.
+ if (! Utils.isTouchscreen()) {
+ this.$results.find('li.select2-results__option--highlighted').focus();
+ }
+ };
+
+ Select2.prototype._syncAttributes = function () {
+ this.options.set('disabled', this.$element.prop('disabled'));
+
+ if (this.options.get('disabled')) {
+ if (this.isOpen()) {
+ this.close();
+ }
+
+ this.trigger('disable', {});
+ } else {
+ this.trigger('enable', {});
+ }
+ };
+
+ Select2.prototype._syncSubtree = function (evt, mutations) {
+ var changed = false;
+ var self = this;
+
+ // Ignore any mutation events raised for elements that aren't options or
+ // optgroups. This handles the case when the select element is destroyed
+ if (
+ evt && evt.target && (
+ evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
+ )
+ ) {
+ return;
+ }
+
+ if (!mutations) {
+ // If mutation events aren't supported, then we can only assume that the
+ // change affected the selections
+ changed = true;
+ } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
+ for (var n = 0; n < mutations.addedNodes.length; n++) {
+ var node = mutations.addedNodes[n];
+
+ if (node.selected) {
+ changed = true;
+ }
+ }
+ } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
+ changed = true;
+ }
+
+ // Only re-pull the data if we think there is a change
+ if (changed) {
+ this.dataAdapter.current(function (currentData) {
+ self.trigger('selection:update', {
+ data: currentData
+ });
+ });
+ }
+ };
+
+ /**
+ * Override the trigger method to automatically trigger pre-events when
+ * there are events that can be prevented.
+ */
+ Select2.prototype.trigger = function (name, args) {
+ var actualTrigger = Select2.__super__.trigger;
+ var preTriggerMap = {
+ 'open': 'opening',
+ 'close': 'closing',
+ 'select': 'selecting',
+ 'unselect': 'unselecting'
+ };
+
+ if (args === undefined) {
+ args = {};
+ }
+
+ if (name in preTriggerMap) {
+ var preTriggerName = preTriggerMap[name];
+ var preTriggerArgs = {
+ prevented: false,
+ name: name,
+ args: args
+ };
+
+ actualTrigger.call(this, preTriggerName, preTriggerArgs);
+
+ if (preTriggerArgs.prevented) {
+ args.prevented = true;
+
+ return;
+ }
+ }
+
+ actualTrigger.call(this, name, args);
+ };
+
+ Select2.prototype.toggleDropdown = function () {
+ if (this.options.get('disabled')) {
+ return;
+ }
+
+ if (this.isOpen()) {
+ this.close();
+ } else {
+ this.open();
+ }
+ };
+
+ Select2.prototype.open = function () {
+ if (this.isOpen()) {
+ return;
+ }
+
+ this.trigger('query', {});
+ };
+
+ Select2.prototype.close = function () {
+ if (!this.isOpen()) {
+ return;
+ }
+
+ this.trigger('close', {});
+ };
+
+ Select2.prototype.isOpen = function () {
+ return this.$container.hasClass('select2-container--open');
+ };
+
+ Select2.prototype.hasFocus = function () {
+ return this.$container.hasClass('select2-container--focus');
+ };
+
+ Select2.prototype.focus = function (data) {
+ // No need to re-trigger focus events if we are already focused
+ if (this.hasFocus()) {
+ return;
+ }
+
+ this.$container.addClass('select2-container--focus');
+ this.trigger('focus', {});
+ };
+
+ Select2.prototype.enable = function (args) {
+ if (this.options.get('debug') && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `select2("enable")` method has been deprecated and will' +
+ ' be removed in later Select2 versions. Use $element.prop("disabled")' +
+ ' instead.'
+ );
+ }
+
+ if (args == null || args.length === 0) {
+ args = [true];
+ }
+
+ var disabled = !args[0];
+
+ this.$element.prop('disabled', disabled);
+ };
+
+ Select2.prototype.data = function () {
+ if (this.options.get('debug') &&
+ arguments.length > 0 && window.console && console.warn) {
+ console.warn(
+ 'Select2: Data can no longer be set using `select2("data")`. You ' +
+ 'should consider setting the value instead using `$element.val()`.'
+ );
+ }
+
+ var data = [];
+
+ this.dataAdapter.current(function (currentData) {
+ data = currentData;
+ });
+
+ return data;
+ };
+
+ Select2.prototype.val = function (args) {
+ if (this.options.get('debug') && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `select2("val")` method has been deprecated and will be' +
+ ' removed in later Select2 versions. Use $element.val() instead.'
+ );
+ }
+
+ if (args == null || args.length === 0) {
+ return this.$element.val();
+ }
+
+ var newVal = args[0];
+
+ if ($.isArray(newVal)) {
+ newVal = $.map(newVal, function (obj) {
+ return obj.toString();
+ });
+ }
+
+ this.$element.val(newVal).trigger('change');
+ };
+
+ Select2.prototype.destroy = function () {
+ this.$container.remove();
+
+ if (this.$element[0].detachEvent) {
+ this.$element[0].detachEvent('onpropertychange', this._syncA);
+ }
+
+ if (this._observer != null) {
+ this._observer.disconnect();
+ this._observer = null;
+ } else if (this.$element[0].removeEventListener) {
+ this.$element[0]
+ .removeEventListener('DOMAttrModified', this._syncA, false);
+ this.$element[0]
+ .removeEventListener('DOMNodeInserted', this._syncS, false);
+ this.$element[0]
+ .removeEventListener('DOMNodeRemoved', this._syncS, false);
+ }
+
+ this._syncA = null;
+ this._syncS = null;
+
+ this.$element.off('.select2');
+ this.$element.attr('tabindex', this.$element.data('old-tabindex'));
+
+ this.$element.removeClass('select2-hidden-accessible');
+ this.$element.attr('aria-hidden', 'false');
+ this.$element.removeData('select2');
+
+ this.dataAdapter.destroy();
+ this.selection.destroy();
+ this.dropdown.destroy();
+ this.results.destroy();
+
+ this.dataAdapter = null;
+ this.selection = null;
+ this.dropdown = null;
+ this.results = null;
+ };
+
+ Select2.prototype.render = function () {
+ var $container = $(
+ '
' +
+ ' ' +
+ ' ' +
+ ' '
+ );
+
+ $container.attr('dir', this.options.get('dir'));
+
+ this.$container = $container;
+
+ this.$container.addClass('select2-container--' + this.options.get('theme'));
+
+ $container.data('element', this.$element);
+
+ return $container;
+ };
+
+ return Select2;
+});
+
+S2.define('select2/compat/utils',[
+ 'jquery'
+], function ($) {
+ function syncCssClasses ($dest, $src, adapter) {
+ var classes, replacements = [], adapted;
+
+ classes = $.trim($dest.attr('class'));
+
+ if (classes) {
+ classes = '' + classes; // for IE which returns object
+
+ $(classes.split(/\s+/)).each(function () {
+ // Save all Select2 classes
+ if (this.indexOf('select2-') === 0) {
+ replacements.push(this);
+ }
+ });
+ }
+
+ classes = $.trim($src.attr('class'));
+
+ if (classes) {
+ classes = '' + classes; // for IE which returns object
+
+ $(classes.split(/\s+/)).each(function () {
+ // Only adapt non-Select2 classes
+ if (this.indexOf('select2-') !== 0) {
+ adapted = adapter(this);
+
+ if (adapted != null) {
+ replacements.push(adapted);
+ }
+ }
+ });
+ }
+
+ $dest.attr('class', replacements.join(' '));
+ }
+
+ return {
+ syncCssClasses: syncCssClasses
+ };
+});
+
+S2.define('select2/compat/containerCss',[
+ 'jquery',
+ './utils'
+], function ($, CompatUtils) {
+ // No-op CSS adapter that discards all classes by default
+ function _containerAdapter (clazz) {
+ return null;
+ }
+
+ function ContainerCSS () { }
+
+ ContainerCSS.prototype.render = function (decorated) {
+ var $container = decorated.call(this);
+
+ var containerCssClass = this.options.get('containerCssClass') || '';
+
+ if ($.isFunction(containerCssClass)) {
+ containerCssClass = containerCssClass(this.$element);
+ }
+
+ var containerCssAdapter = this.options.get('adaptContainerCssClass');
+ containerCssAdapter = containerCssAdapter || _containerAdapter;
+
+ if (containerCssClass.indexOf(':all:') !== -1) {
+ containerCssClass = containerCssClass.replace(':all:', '');
+
+ var _cssAdapter = containerCssAdapter;
+
+ containerCssAdapter = function (clazz) {
+ var adapted = _cssAdapter(clazz);
+
+ if (adapted != null) {
+ // Append the old one along with the adapted one
+ return adapted + ' ' + clazz;
+ }
+
+ return clazz;
+ };
+ }
+
+ var containerCss = this.options.get('containerCss') || {};
+
+ if ($.isFunction(containerCss)) {
+ containerCss = containerCss(this.$element);
+ }
+
+ CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter);
+
+ $container.css(containerCss);
+ $container.addClass(containerCssClass);
+
+ return $container;
+ };
+
+ return ContainerCSS;
+});
+
+S2.define('select2/compat/dropdownCss',[
+ 'jquery',
+ './utils'
+], function ($, CompatUtils) {
+ // No-op CSS adapter that discards all classes by default
+ function _dropdownAdapter (clazz) {
+ return null;
+ }
+
+ function DropdownCSS () { }
+
+ DropdownCSS.prototype.render = function (decorated) {
+ var $dropdown = decorated.call(this);
+
+ var dropdownCssClass = this.options.get('dropdownCssClass') || '';
+
+ if ($.isFunction(dropdownCssClass)) {
+ dropdownCssClass = dropdownCssClass(this.$element);
+ }
+
+ var dropdownCssAdapter = this.options.get('adaptDropdownCssClass');
+ dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter;
+
+ if (dropdownCssClass.indexOf(':all:') !== -1) {
+ dropdownCssClass = dropdownCssClass.replace(':all:', '');
+
+ var _cssAdapter = dropdownCssAdapter;
+
+ dropdownCssAdapter = function (clazz) {
+ var adapted = _cssAdapter(clazz);
+
+ if (adapted != null) {
+ // Append the old one along with the adapted one
+ return adapted + ' ' + clazz;
+ }
+
+ return clazz;
+ };
+ }
+
+ var dropdownCss = this.options.get('dropdownCss') || {};
+
+ if ($.isFunction(dropdownCss)) {
+ dropdownCss = dropdownCss(this.$element);
+ }
+
+ CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter);
+
+ $dropdown.css(dropdownCss);
+ $dropdown.addClass(dropdownCssClass);
+
+ return $dropdown;
+ };
+
+ return DropdownCSS;
+});
+
+S2.define('select2/compat/initSelection',[
+ 'jquery'
+], function ($) {
+ function InitSelection (decorated, $element, options) {
+ if (options.get('debug') && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `initSelection` option has been deprecated in favor' +
+ ' of a custom data adapter that overrides the `current` method. ' +
+ 'This method is now called multiple times instead of a single ' +
+ 'time when the instance is initialized. Support will be removed ' +
+ 'for the `initSelection` option in future versions of Select2'
+ );
+ }
+
+ this.initSelection = options.get('initSelection');
+ this._isInitialized = false;
+
+ decorated.call(this, $element, options);
+ }
+
+ InitSelection.prototype.current = function (decorated, callback) {
+ var self = this;
+
+ if (this._isInitialized) {
+ decorated.call(this, callback);
+
+ return;
+ }
+
+ this.initSelection.call(null, this.$element, function (data) {
+ self._isInitialized = true;
+
+ if (!$.isArray(data)) {
+ data = [data];
+ }
+
+ callback(data);
+ });
+ };
+
+ return InitSelection;
+});
+
+S2.define('select2/compat/inputData',[
+ 'jquery'
+], function ($) {
+ function InputData (decorated, $element, options) {
+ this._currentData = [];
+ this._valueSeparator = options.get('valueSeparator') || ',';
+
+ if ($element.prop('type') === 'hidden') {
+ if (options.get('debug') && console && console.warn) {
+ console.warn(
+ 'Select2: Using a hidden input with Select2 is no longer ' +
+ 'supported and may stop working in the future. It is recommended ' +
+ 'to use a `
` element instead.'
+ );
+ }
+ }
+
+ decorated.call(this, $element, options);
+ }
+
+ InputData.prototype.current = function (_, callback) {
+ function getSelected (data, selectedIds) {
+ var selected = [];
+
+ if (data.selected || $.inArray(data.id, selectedIds) !== -1) {
+ data.selected = true;
+ selected.push(data);
+ } else {
+ data.selected = false;
+ }
+
+ if (data.children) {
+ selected.push.apply(selected, getSelected(data.children, selectedIds));
+ }
+
+ return selected;
+ }
+
+ var selected = [];
+
+ for (var d = 0; d < this._currentData.length; d++) {
+ var data = this._currentData[d];
+
+ selected.push.apply(
+ selected,
+ getSelected(
+ data,
+ this.$element.val().split(
+ this._valueSeparator
+ )
+ )
+ );
+ }
+
+ callback(selected);
+ };
+
+ InputData.prototype.select = function (_, data) {
+ if (!this.options.get('multiple')) {
+ this.current(function (allData) {
+ $.map(allData, function (data) {
+ data.selected = false;
+ });
+ });
+
+ this.$element.val(data.id);
+ this.$element.trigger('change');
+ } else {
+ var value = this.$element.val();
+ value += this._valueSeparator + data.id;
+
+ this.$element.val(value);
+ this.$element.trigger('change');
+ }
+ };
+
+ InputData.prototype.unselect = function (_, data) {
+ var self = this;
+
+ data.selected = false;
+
+ this.current(function (allData) {
+ var values = [];
+
+ for (var d = 0; d < allData.length; d++) {
+ var item = allData[d];
+
+ if (data.id == item.id) {
+ continue;
+ }
+
+ values.push(item.id);
+ }
+
+ self.$element.val(values.join(self._valueSeparator));
+ self.$element.trigger('change');
+ });
+ };
+
+ InputData.prototype.query = function (_, params, callback) {
+ var results = [];
+
+ for (var d = 0; d < this._currentData.length; d++) {
+ var data = this._currentData[d];
+
+ var matches = this.matches(params, data);
+
+ if (matches !== null) {
+ results.push(matches);
+ }
+ }
+
+ callback({
+ results: results
+ });
+ };
+
+ InputData.prototype.addOptions = function (_, $options) {
+ var options = $.map($options, function ($option) {
+ return $.data($option[0], 'data');
+ });
+
+ this._currentData.push.apply(this._currentData, options);
+ };
+
+ return InputData;
+});
+
+S2.define('select2/compat/matcher',[
+ 'jquery'
+], function ($) {
+ function oldMatcher (matcher) {
+ function wrappedMatcher (params, data) {
+ var match = $.extend(true, {}, data);
+
+ if (params.term == null || $.trim(params.term) === '') {
+ return match;
+ }
+
+ if (data.children) {
+ for (var c = data.children.length - 1; c >= 0; c--) {
+ var child = data.children[c];
+
+ // Check if the child object matches
+ // The old matcher returned a boolean true or false
+ var doesMatch = matcher(params.term, child.text, child);
+
+ // If the child didn't match, pop it off
+ if (!doesMatch) {
+ match.children.splice(c, 1);
+ }
+ }
+
+ if (match.children.length > 0) {
+ return match;
+ }
+ }
+
+ if (matcher(params.term, data.text, data)) {
+ return match;
+ }
+
+ return null;
+ }
+
+ return wrappedMatcher;
+ }
+
+ return oldMatcher;
+});
+
+S2.define('select2/compat/query',[
+
+], function () {
+ function Query (decorated, $element, options) {
+ if (options.get('debug') && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `query` option has been deprecated in favor of a ' +
+ 'custom data adapter that overrides the `query` method. Support ' +
+ 'will be removed for the `query` option in future versions of ' +
+ 'Select2.'
+ );
+ }
+
+ decorated.call(this, $element, options);
+ }
+
+ Query.prototype.query = function (_, params, callback) {
+ params.callback = callback;
+
+ var query = this.options.get('query');
+
+ query.call(null, params);
+ };
+
+ return Query;
+});
+
+S2.define('select2/dropdown/attachContainer',[
+
+], function () {
+ function AttachContainer (decorated, $element, options) {
+ decorated.call(this, $element, options);
+ }
+
+ AttachContainer.prototype.position =
+ function (decorated, $dropdown, $container) {
+ var $dropdownContainer = $container.find('.dropdown-wrapper');
+ $dropdownContainer.append($dropdown);
+
+ $dropdown.addClass('select2-dropdown--below');
+ $container.addClass('select2-container--below');
+ };
+
+ return AttachContainer;
+});
+
+S2.define('select2/dropdown/stopPropagation',[
+
+], function () {
+ function StopPropagation () { }
+
+ StopPropagation.prototype.bind = function (decorated, container, $container) {
+ decorated.call(this, container, $container);
+
+ var stoppedEvents = [
+ 'blur',
+ 'change',
+ 'click',
+ 'dblclick',
+ 'focus',
+ 'focusin',
+ 'focusout',
+ 'input',
+ 'keydown',
+ 'keyup',
+ 'keypress',
+ 'mousedown',
+ 'mouseenter',
+ 'mouseleave',
+ 'mousemove',
+ 'mouseover',
+ 'mouseup',
+ 'search',
+ 'touchend',
+ 'touchstart'
+ ];
+
+ this.$dropdown.on(stoppedEvents.join(' '), function (evt) {
+ evt.stopPropagation();
+ });
+ };
+
+ return StopPropagation;
+});
+
+S2.define('select2/selection/stopPropagation',[
+
+], function () {
+ function StopPropagation () { }
+
+ StopPropagation.prototype.bind = function (decorated, container, $container) {
+ decorated.call(this, container, $container);
+
+ var stoppedEvents = [
+ 'blur',
+ 'change',
+ 'click',
+ 'dblclick',
+ 'focus',
+ 'focusin',
+ 'focusout',
+ 'input',
+ 'keydown',
+ 'keyup',
+ 'keypress',
+ 'mousedown',
+ 'mouseenter',
+ 'mouseleave',
+ 'mousemove',
+ 'mouseover',
+ 'mouseup',
+ 'search',
+ 'touchend',
+ 'touchstart'
+ ];
+
+ this.$selection.on(stoppedEvents.join(' '), function (evt) {
+ evt.stopPropagation();
+ });
+ };
+
+ return StopPropagation;
+});
+
+/*!
+ * jQuery Mousewheel 3.1.13
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ */
+
+(function (factory) {
+ if ( typeof S2.define === 'function' && S2.define.amd ) {
+ // AMD. Register as an anonymous module.
+ S2.define('jquery-mousewheel',['jquery'], factory);
+ } else if (typeof exports === 'object') {
+ // Node/CommonJS style for Browserify
+ module.exports = factory;
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+}(function ($) {
+
+ var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
+ toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
+ ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
+ slice = Array.prototype.slice,
+ nullLowestDeltaTimeout, lowestDelta;
+
+ if ( $.event.fixHooks ) {
+ for ( var i = toFix.length; i; ) {
+ $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
+ }
+ }
+
+ var special = $.event.special.mousewheel = {
+ version: '3.1.12',
+
+ setup: function() {
+ if ( this.addEventListener ) {
+ for ( var i = toBind.length; i; ) {
+ this.addEventListener( toBind[--i], handler, false );
+ }
+ } else {
+ this.onmousewheel = handler;
+ }
+ // Store the line height and page height for this particular element
+ $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
+ $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
+ },
+
+ teardown: function() {
+ if ( this.removeEventListener ) {
+ for ( var i = toBind.length; i; ) {
+ this.removeEventListener( toBind[--i], handler, false );
+ }
+ } else {
+ this.onmousewheel = null;
+ }
+ // Clean up the data we added to the element
+ $.removeData(this, 'mousewheel-line-height');
+ $.removeData(this, 'mousewheel-page-height');
+ },
+
+ getLineHeight: function(elem) {
+ var $elem = $(elem),
+ $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
+ if (!$parent.length) {
+ $parent = $('body');
+ }
+ return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
+ },
+
+ getPageHeight: function(elem) {
+ return $(elem).height();
+ },
+
+ settings: {
+ adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
+ normalizeOffset: true // calls getBoundingClientRect for each event
+ }
+ };
+
+ $.fn.extend({
+ mousewheel: function(fn) {
+ return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
+ },
+
+ unmousewheel: function(fn) {
+ return this.unbind('mousewheel', fn);
+ }
+ });
+
+
+ function handler(event) {
+ var orgEvent = event || window.event,
+ args = slice.call(arguments, 1),
+ delta = 0,
+ deltaX = 0,
+ deltaY = 0,
+ absDelta = 0,
+ offsetX = 0,
+ offsetY = 0;
+ event = $.event.fix(orgEvent);
+ event.type = 'mousewheel';
+
+ // Old school scrollwheel delta
+ if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
+ if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
+ if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
+ if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
+
+ // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
+ if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
+ deltaX = deltaY * -1;
+ deltaY = 0;
+ }
+
+ // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
+ delta = deltaY === 0 ? deltaX : deltaY;
+
+ // New school wheel delta (wheel event)
+ if ( 'deltaY' in orgEvent ) {
+ deltaY = orgEvent.deltaY * -1;
+ delta = deltaY;
+ }
+ if ( 'deltaX' in orgEvent ) {
+ deltaX = orgEvent.deltaX;
+ if ( deltaY === 0 ) { delta = deltaX * -1; }
+ }
+
+ // No change actually happened, no reason to go any further
+ if ( deltaY === 0 && deltaX === 0 ) { return; }
+
+ // Need to convert lines and pages to pixels if we aren't already in pixels
+ // There are three delta modes:
+ // * deltaMode 0 is by pixels, nothing to do
+ // * deltaMode 1 is by lines
+ // * deltaMode 2 is by pages
+ if ( orgEvent.deltaMode === 1 ) {
+ var lineHeight = $.data(this, 'mousewheel-line-height');
+ delta *= lineHeight;
+ deltaY *= lineHeight;
+ deltaX *= lineHeight;
+ } else if ( orgEvent.deltaMode === 2 ) {
+ var pageHeight = $.data(this, 'mousewheel-page-height');
+ delta *= pageHeight;
+ deltaY *= pageHeight;
+ deltaX *= pageHeight;
+ }
+
+ // Store lowest absolute delta to normalize the delta values
+ absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
+
+ if ( !lowestDelta || absDelta < lowestDelta ) {
+ lowestDelta = absDelta;
+
+ // Adjust older deltas if necessary
+ if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
+ lowestDelta /= 40;
+ }
+ }
+
+ // Adjust older deltas if necessary
+ if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
+ // Divide all the things by 40!
+ delta /= 40;
+ deltaX /= 40;
+ deltaY /= 40;
+ }
+
+ // Get a whole, normalized value for the deltas
+ delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
+ deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
+ deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
+
+ // Normalise offsetX and offsetY properties
+ if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
+ var boundingRect = this.getBoundingClientRect();
+ offsetX = event.clientX - boundingRect.left;
+ offsetY = event.clientY - boundingRect.top;
+ }
+
+ // Add information to the event object
+ event.deltaX = deltaX;
+ event.deltaY = deltaY;
+ event.deltaFactor = lowestDelta;
+ event.offsetX = offsetX;
+ event.offsetY = offsetY;
+ // Go ahead and set deltaMode to 0 since we converted to pixels
+ // Although this is a little odd since we overwrite the deltaX/Y
+ // properties with normalized deltas.
+ event.deltaMode = 0;
+
+ // Add event and delta to the front of the arguments
+ args.unshift(event, delta, deltaX, deltaY);
+
+ // Clearout lowestDelta after sometime to better
+ // handle multiple device types that give different
+ // a different lowestDelta
+ // Ex: trackpad = 3 and mouse wheel = 120
+ if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
+ nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
+
+ return ($.event.dispatch || $.event.handle).apply(this, args);
+ }
+
+ function nullLowestDelta() {
+ lowestDelta = null;
+ }
+
+ function shouldAdjustOldDeltas(orgEvent, absDelta) {
+ // If this is an older event and the delta is divisable by 120,
+ // then we are assuming that the browser is treating this as an
+ // older mouse wheel event and that we should divide the deltas
+ // by 40 to try and get a more usable deltaFactor.
+ // Side note, this actually impacts the reported scroll distance
+ // in older browsers and can cause scrolling to be slower than native.
+ // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
+ return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
+ }
+
+}));
+
+S2.define('jquery.select2',[
+ 'jquery',
+ 'jquery-mousewheel',
+
+ './select2/core',
+ './select2/defaults'
+], function ($, _, Select2, Defaults) {
+ if ($.fn.selectWoo == null) {
+ // All methods that should return the element
+ var thisMethods = ['open', 'close', 'destroy'];
+
+ $.fn.selectWoo = function (options) {
+ options = options || {};
+
+ if (typeof options === 'object') {
+ this.each(function () {
+ var instanceOptions = $.extend(true, {}, options);
+
+ var instance = new Select2($(this), instanceOptions);
+ });
+
+ return this;
+ } else if (typeof options === 'string') {
+ var ret;
+ var args = Array.prototype.slice.call(arguments, 1);
+
+ this.each(function () {
+ var instance = $(this).data('select2');
+
+ if (instance == null && window.console && console.error) {
+ console.error(
+ 'The select2(\'' + options + '\') method was called on an ' +
+ 'element that is not using Select2.'
+ );
+ }
+
+ ret = instance[options].apply(instance, args);
+ });
+
+ // Check if we should be returning `this`
+ if ($.inArray(options, thisMethods) > -1) {
+ return this;
+ }
+
+ return ret;
+ } else {
+ throw new Error('Invalid arguments for Select2: ' + options);
+ }
+ };
+ }
+
+ if ($.fn.select2 != null && $.fn.select2.defaults != null) {
+ $.fn.selectWoo.defaults = $.fn.select2.defaults;
+ }
+
+ if ($.fn.selectWoo.defaults == null) {
+ $.fn.selectWoo.defaults = Defaults;
+ }
+
+ // Also register selectWoo under select2 if select2 is not already present.
+ $.fn.select2 = $.fn.select2 || $.fn.selectWoo;
+
+ return Select2;
+});
+
+ // Return the AMD loader configuration so it can be used outside of this file
+ return {
+ define: S2.define,
+ require: S2.require
+ };
+}());
+
+ // Autoload the jQuery bindings
+ // We know that all of the modules exist above this, so we're safe
+ var select2 = S2.require('jquery.select2');
+
+ // Hold the AMD module references on the jQuery function that was just loaded
+ // This allows Select2 to use the internal loader outside of this file, such
+ // as in the language files.
+ jQuery.fn.select2.amd = S2;
+ jQuery.fn.selectWoo.amd = S2;
+
+ // Return the Select2 instance for anyone who is importing it.
+ return select2;
+}));
diff --git a/assets/kirki/assets/vendor/selectWoo/js/select2.full.min.js b/assets/kirki/assets/vendor/selectWoo/js/select2.full.min.js
new file mode 100644
index 0000000..9c7c386
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/select2.full.min.js
@@ -0,0 +1 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(' '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a(' ');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(' '),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a(" ")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html(''),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('× ')},d.prototype.update=function(a){var b=this;if(this.clear(),0!==a.length){for(var d=[],e=0;e1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('× ');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a(' ');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a(' ');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a(' '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(" "),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen())if(c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault()),c===d.DOWN||c===d.UP)b.focusOnActiveElement();else{var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3)}else b.hasFocus()&&(c===d.ENTER||c===d.SPACE||c===d.DOWN&&a.altKey)&&(b.open(),a.preventDefault())})},e.prototype.focusOnActiveElement=function(){c.isTouchscreen()||this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(f=d(this))&&g.push(f)})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;if(this._isInitialized)return void b.call(this,c);this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `` element instead."),a.call(this,b,c)}return b.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f=0;f--){var g=d.children[f];b(c.term,g.text,g)||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c,this.options.get("query").call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){c.find(".dropdown-wrapper").append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery-mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||n=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120==0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c});
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/select2.js b/assets/kirki/assets/vendor/selectWoo/js/select2.js
new file mode 100644
index 0000000..22a7207
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/select2.js
@@ -0,0 +1,5842 @@
+/*!
+ * SelectWoo 1.0.1
+ * https://github.com/woocommerce/selectWoo
+ *
+ * Released under the MIT license
+ * https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md
+ */
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && module.exports) {
+ // Node/CommonJS
+ module.exports = function (root, jQuery) {
+ if (jQuery === undefined) {
+ // require('jQuery') returns a factory that requires window to
+ // build a jQuery instance, we normalize how we use modules
+ // that require this pattern but the window provided is a noop
+ // if it's defined (how jquery works)
+ if (typeof window !== 'undefined') {
+ jQuery = require('jquery');
+ }
+ else {
+ jQuery = require('jquery')(root);
+ }
+ }
+ factory(jQuery);
+ return jQuery;
+ };
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+} (function (jQuery) {
+ // This is needed so we can catch the AMD loader configuration and use it
+ // The inner file should be wrapped (by `banner.start.js`) in a function that
+ // returns the AMD loader references.
+ var S2 =(function () {
+ // Restore the Select2 AMD loader so it can be used
+ // Needed mostly in the language files, where the loader is not inserted
+ if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
+ var S2 = jQuery.fn.select2.amd;
+ }
+var S2;(function () { if (!S2 || !S2.requirejs) {
+if (!S2) { S2 = {}; } else { require = S2; }
+/**
+ * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
+ * Released under MIT license, http://github.com/requirejs/almond/LICENSE
+ */
+//Going sloppy to avoid 'use strict' string cost, but strict practices should
+//be followed.
+/*global setTimeout: false */
+
+var requirejs, require, define;
+(function (undef) {
+ var main, req, makeMap, handlers,
+ defined = {},
+ waiting = {},
+ config = {},
+ defining = {},
+ hasOwn = Object.prototype.hasOwnProperty,
+ aps = [].slice,
+ jsSuffixRegExp = /\.js$/;
+
+ function hasProp(obj, prop) {
+ return hasOwn.call(obj, prop);
+ }
+
+ /**
+ * Given a relative module name, like ./something, normalize it to
+ * a real name that can be mapped to a path.
+ * @param {String} name the relative name
+ * @param {String} baseName a real name that the name arg is relative
+ * to.
+ * @returns {String} normalized name
+ */
+ function normalize(name, baseName) {
+ var nameParts, nameSegment, mapValue, foundMap, lastIndex,
+ foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
+ baseParts = baseName && baseName.split("/"),
+ map = config.map,
+ starMap = (map && map['*']) || {};
+
+ //Adjust any relative paths.
+ if (name) {
+ name = name.split('/');
+ lastIndex = name.length - 1;
+
+ // If wanting node ID compatibility, strip .js from end
+ // of IDs. Have to do this here, and not in nameToUrl
+ // because node allows either .js or non .js to map
+ // to same file.
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
+ }
+
+ // Starts with a '.' so need the baseName
+ if (name[0].charAt(0) === '.' && baseParts) {
+ //Convert baseName to array, and lop off the last part,
+ //so that . matches that 'directory' and not name of the baseName's
+ //module. For instance, baseName of 'one/two/three', maps to
+ //'one/two/three.js', but we want the directory, 'one/two' for
+ //this normalization.
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
+ name = normalizedBaseParts.concat(name);
+ }
+
+ //start trimDots
+ for (i = 0; i < name.length; i++) {
+ part = name[i];
+ if (part === '.') {
+ name.splice(i, 1);
+ i -= 1;
+ } else if (part === '..') {
+ // If at the start, or previous value is still ..,
+ // keep them so that when converted to a path it may
+ // still work when converted to a path, even though
+ // as an ID it is less than ideal. In larger point
+ // releases, may be better to just kick out an error.
+ if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
+ continue;
+ } else if (i > 0) {
+ name.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ }
+ //end trimDots
+
+ name = name.join('/');
+ }
+
+ //Apply map config if available.
+ if ((baseParts || starMap) && map) {
+ nameParts = name.split('/');
+
+ for (i = nameParts.length; i > 0; i -= 1) {
+ nameSegment = nameParts.slice(0, i).join("/");
+
+ if (baseParts) {
+ //Find the longest baseName segment match in the config.
+ //So, do joins on the biggest to smallest lengths of baseParts.
+ for (j = baseParts.length; j > 0; j -= 1) {
+ mapValue = map[baseParts.slice(0, j).join('/')];
+
+ //baseName segment has config, find if it has one for
+ //this name.
+ if (mapValue) {
+ mapValue = mapValue[nameSegment];
+ if (mapValue) {
+ //Match, update name to the new value.
+ foundMap = mapValue;
+ foundI = i;
+ break;
+ }
+ }
+ }
+ }
+
+ if (foundMap) {
+ break;
+ }
+
+ //Check for a star map match, but just hold on to it,
+ //if there is a shorter segment match later in a matching
+ //config, then favor over this star map.
+ if (!foundStarMap && starMap && starMap[nameSegment]) {
+ foundStarMap = starMap[nameSegment];
+ starI = i;
+ }
+ }
+
+ if (!foundMap && foundStarMap) {
+ foundMap = foundStarMap;
+ foundI = starI;
+ }
+
+ if (foundMap) {
+ nameParts.splice(0, foundI, foundMap);
+ name = nameParts.join('/');
+ }
+ }
+
+ return name;
+ }
+
+ function makeRequire(relName, forceSync) {
+ return function () {
+ //A version of a require function that passes a moduleName
+ //value for items that may need to
+ //look up paths relative to the moduleName
+ var args = aps.call(arguments, 0);
+
+ //If first arg is not require('string'), and there is only
+ //one arg, it is the array form without a callback. Insert
+ //a null so that the following concat is correct.
+ if (typeof args[0] !== 'string' && args.length === 1) {
+ args.push(null);
+ }
+ return req.apply(undef, args.concat([relName, forceSync]));
+ };
+ }
+
+ function makeNormalize(relName) {
+ return function (name) {
+ return normalize(name, relName);
+ };
+ }
+
+ function makeLoad(depName) {
+ return function (value) {
+ defined[depName] = value;
+ };
+ }
+
+ function callDep(name) {
+ if (hasProp(waiting, name)) {
+ var args = waiting[name];
+ delete waiting[name];
+ defining[name] = true;
+ main.apply(undef, args);
+ }
+
+ if (!hasProp(defined, name) && !hasProp(defining, name)) {
+ throw new Error('No ' + name);
+ }
+ return defined[name];
+ }
+
+ //Turns a plugin!resource to [plugin, resource]
+ //with the plugin being undefined if the name
+ //did not have a plugin prefix.
+ function splitPrefix(name) {
+ var prefix,
+ index = name ? name.indexOf('!') : -1;
+ if (index > -1) {
+ prefix = name.substring(0, index);
+ name = name.substring(index + 1, name.length);
+ }
+ return [prefix, name];
+ }
+
+ //Creates a parts array for a relName where first part is plugin ID,
+ //second part is resource ID. Assumes relName has already been normalized.
+ function makeRelParts(relName) {
+ return relName ? splitPrefix(relName) : [];
+ }
+
+ /**
+ * Makes a name map, normalizing the name, and using a plugin
+ * for normalization if necessary. Grabs a ref to plugin
+ * too, as an optimization.
+ */
+ makeMap = function (name, relParts) {
+ var plugin,
+ parts = splitPrefix(name),
+ prefix = parts[0],
+ relResourceName = relParts[1];
+
+ name = parts[1];
+
+ if (prefix) {
+ prefix = normalize(prefix, relResourceName);
+ plugin = callDep(prefix);
+ }
+
+ //Normalize according
+ if (prefix) {
+ if (plugin && plugin.normalize) {
+ name = plugin.normalize(name, makeNormalize(relResourceName));
+ } else {
+ name = normalize(name, relResourceName);
+ }
+ } else {
+ name = normalize(name, relResourceName);
+ parts = splitPrefix(name);
+ prefix = parts[0];
+ name = parts[1];
+ if (prefix) {
+ plugin = callDep(prefix);
+ }
+ }
+
+ //Using ridiculous property names for space reasons
+ return {
+ f: prefix ? prefix + '!' + name : name, //fullName
+ n: name,
+ pr: prefix,
+ p: plugin
+ };
+ };
+
+ function makeConfig(name) {
+ return function () {
+ return (config && config.config && config.config[name]) || {};
+ };
+ }
+
+ handlers = {
+ require: function (name) {
+ return makeRequire(name);
+ },
+ exports: function (name) {
+ var e = defined[name];
+ if (typeof e !== 'undefined') {
+ return e;
+ } else {
+ return (defined[name] = {});
+ }
+ },
+ module: function (name) {
+ return {
+ id: name,
+ uri: '',
+ exports: defined[name],
+ config: makeConfig(name)
+ };
+ }
+ };
+
+ main = function (name, deps, callback, relName) {
+ var cjsModule, depName, ret, map, i, relParts,
+ args = [],
+ callbackType = typeof callback,
+ usingExports;
+
+ //Use name if no relName
+ relName = relName || name;
+ relParts = makeRelParts(relName);
+
+ //Call the callback to define the module, if necessary.
+ if (callbackType === 'undefined' || callbackType === 'function') {
+ //Pull out the defined dependencies and pass the ordered
+ //values to the callback.
+ //Default to [require, exports, module] if no deps
+ deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
+ for (i = 0; i < deps.length; i += 1) {
+ map = makeMap(deps[i], relParts);
+ depName = map.f;
+
+ //Fast path CommonJS standard dependencies.
+ if (depName === "require") {
+ args[i] = handlers.require(name);
+ } else if (depName === "exports") {
+ //CommonJS module spec 1.1
+ args[i] = handlers.exports(name);
+ usingExports = true;
+ } else if (depName === "module") {
+ //CommonJS module spec 1.1
+ cjsModule = args[i] = handlers.module(name);
+ } else if (hasProp(defined, depName) ||
+ hasProp(waiting, depName) ||
+ hasProp(defining, depName)) {
+ args[i] = callDep(depName);
+ } else if (map.p) {
+ map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
+ args[i] = defined[depName];
+ } else {
+ throw new Error(name + ' missing ' + depName);
+ }
+ }
+
+ ret = callback ? callback.apply(defined[name], args) : undefined;
+
+ if (name) {
+ //If setting exports via "module" is in play,
+ //favor that over return value and exports. After that,
+ //favor a non-undefined return value over exports use.
+ if (cjsModule && cjsModule.exports !== undef &&
+ cjsModule.exports !== defined[name]) {
+ defined[name] = cjsModule.exports;
+ } else if (ret !== undef || !usingExports) {
+ //Use the return value from the function.
+ defined[name] = ret;
+ }
+ }
+ } else if (name) {
+ //May just be an object definition for the module. Only
+ //worry about defining if have a module name.
+ defined[name] = callback;
+ }
+ };
+
+ requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
+ if (typeof deps === "string") {
+ if (handlers[deps]) {
+ //callback in this case is really relName
+ return handlers[deps](callback);
+ }
+ //Just return the module wanted. In this scenario, the
+ //deps arg is the module name, and second arg (if passed)
+ //is just the relName.
+ //Normalize module name, if it contains . or ..
+ return callDep(makeMap(deps, makeRelParts(callback)).f);
+ } else if (!deps.splice) {
+ //deps is a config object, not an array.
+ config = deps;
+ if (config.deps) {
+ req(config.deps, config.callback);
+ }
+ if (!callback) {
+ return;
+ }
+
+ if (callback.splice) {
+ //callback is an array, which means it is a dependency list.
+ //Adjust args if there are dependencies
+ deps = callback;
+ callback = relName;
+ relName = null;
+ } else {
+ deps = undef;
+ }
+ }
+
+ //Support require(['a'])
+ callback = callback || function () {};
+
+ //If relName is a function, it is an errback handler,
+ //so remove it.
+ if (typeof relName === 'function') {
+ relName = forceSync;
+ forceSync = alt;
+ }
+
+ //Simulate async callback;
+ if (forceSync) {
+ main(undef, deps, callback, relName);
+ } else {
+ //Using a non-zero value because of concern for what old browsers
+ //do, and latest browsers "upgrade" to 4 if lower value is used:
+ //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
+ //If want a value immediately, use require('id') instead -- something
+ //that works in almond on the global level, but not guaranteed and
+ //unlikely to work in other AMD implementations.
+ setTimeout(function () {
+ main(undef, deps, callback, relName);
+ }, 4);
+ }
+
+ return req;
+ };
+
+ /**
+ * Just drops the config on the floor, but returns req in case
+ * the config return value is used.
+ */
+ req.config = function (cfg) {
+ return req(cfg);
+ };
+
+ /**
+ * Expose module registry for debugging and tooling
+ */
+ requirejs._defined = defined;
+
+ define = function (name, deps, callback) {
+ if (typeof name !== 'string') {
+ throw new Error('See almond README: incorrect module build, no module name');
+ }
+
+ //This module may not have dependencies
+ if (!deps.splice) {
+ //deps is not an array, so probably means
+ //an object literal or factory function for
+ //the value. Adjust args.
+ callback = deps;
+ deps = [];
+ }
+
+ if (!hasProp(defined, name) && !hasProp(waiting, name)) {
+ waiting[name] = [name, deps, callback];
+ }
+ };
+
+ define.amd = {
+ jQuery: true
+ };
+}());
+
+S2.requirejs = requirejs;S2.require = require;S2.define = define;
+}
+}());
+S2.define("almond", function(){});
+
+/* global jQuery:false, $:false */
+S2.define('jquery',[],function () {
+ var _$ = jQuery || $;
+
+ if (_$ == null && console && console.error) {
+ console.error(
+ 'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
+ 'found. Make sure that you are including jQuery before Select2 on your ' +
+ 'web page.'
+ );
+ }
+
+ return _$;
+});
+
+S2.define('select2/utils',[
+ 'jquery'
+], function ($) {
+ var Utils = {};
+
+ Utils.Extend = function (ChildClass, SuperClass) {
+ var __hasProp = {}.hasOwnProperty;
+
+ function BaseConstructor () {
+ this.constructor = ChildClass;
+ }
+
+ for (var key in SuperClass) {
+ if (__hasProp.call(SuperClass, key)) {
+ ChildClass[key] = SuperClass[key];
+ }
+ }
+
+ BaseConstructor.prototype = SuperClass.prototype;
+ ChildClass.prototype = new BaseConstructor();
+ ChildClass.__super__ = SuperClass.prototype;
+
+ return ChildClass;
+ };
+
+ function getMethods (theClass) {
+ var proto = theClass.prototype;
+
+ var methods = [];
+
+ for (var methodName in proto) {
+ var m = proto[methodName];
+
+ if (typeof m !== 'function') {
+ continue;
+ }
+
+ if (methodName === 'constructor') {
+ continue;
+ }
+
+ methods.push(methodName);
+ }
+
+ return methods;
+ }
+
+ Utils.Decorate = function (SuperClass, DecoratorClass) {
+ var decoratedMethods = getMethods(DecoratorClass);
+ var superMethods = getMethods(SuperClass);
+
+ function DecoratedClass () {
+ var unshift = Array.prototype.unshift;
+
+ var argCount = DecoratorClass.prototype.constructor.length;
+
+ var calledConstructor = SuperClass.prototype.constructor;
+
+ if (argCount > 0) {
+ unshift.call(arguments, SuperClass.prototype.constructor);
+
+ calledConstructor = DecoratorClass.prototype.constructor;
+ }
+
+ calledConstructor.apply(this, arguments);
+ }
+
+ DecoratorClass.displayName = SuperClass.displayName;
+
+ function ctr () {
+ this.constructor = DecoratedClass;
+ }
+
+ DecoratedClass.prototype = new ctr();
+
+ for (var m = 0; m < superMethods.length; m++) {
+ var superMethod = superMethods[m];
+
+ DecoratedClass.prototype[superMethod] =
+ SuperClass.prototype[superMethod];
+ }
+
+ var calledMethod = function (methodName) {
+ // Stub out the original method if it's not decorating an actual method
+ var originalMethod = function () {};
+
+ if (methodName in DecoratedClass.prototype) {
+ originalMethod = DecoratedClass.prototype[methodName];
+ }
+
+ var decoratedMethod = DecoratorClass.prototype[methodName];
+
+ return function () {
+ var unshift = Array.prototype.unshift;
+
+ unshift.call(arguments, originalMethod);
+
+ return decoratedMethod.apply(this, arguments);
+ };
+ };
+
+ for (var d = 0; d < decoratedMethods.length; d++) {
+ var decoratedMethod = decoratedMethods[d];
+
+ DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
+ }
+
+ return DecoratedClass;
+ };
+
+ var Observable = function () {
+ this.listeners = {};
+ };
+
+ Observable.prototype.on = function (event, callback) {
+ this.listeners = this.listeners || {};
+
+ if (event in this.listeners) {
+ this.listeners[event].push(callback);
+ } else {
+ this.listeners[event] = [callback];
+ }
+ };
+
+ Observable.prototype.trigger = function (event) {
+ var slice = Array.prototype.slice;
+ var params = slice.call(arguments, 1);
+
+ this.listeners = this.listeners || {};
+
+ // Params should always come in as an array
+ if (params == null) {
+ params = [];
+ }
+
+ // If there are no arguments to the event, use a temporary object
+ if (params.length === 0) {
+ params.push({});
+ }
+
+ // Set the `_type` of the first object to the event
+ params[0]._type = event;
+
+ if (event in this.listeners) {
+ this.invoke(this.listeners[event], slice.call(arguments, 1));
+ }
+
+ if ('*' in this.listeners) {
+ this.invoke(this.listeners['*'], arguments);
+ }
+ };
+
+ Observable.prototype.invoke = function (listeners, params) {
+ for (var i = 0, len = listeners.length; i < len; i++) {
+ listeners[i].apply(this, params);
+ }
+ };
+
+ Utils.Observable = Observable;
+
+ Utils.generateChars = function (length) {
+ var chars = '';
+
+ for (var i = 0; i < length; i++) {
+ var randomChar = Math.floor(Math.random() * 36);
+ chars += randomChar.toString(36);
+ }
+
+ return chars;
+ };
+
+ Utils.bind = function (func, context) {
+ return function () {
+ func.apply(context, arguments);
+ };
+ };
+
+ Utils._convertData = function (data) {
+ for (var originalKey in data) {
+ var keys = originalKey.split('-');
+
+ var dataLevel = data;
+
+ if (keys.length === 1) {
+ continue;
+ }
+
+ for (var k = 0; k < keys.length; k++) {
+ var key = keys[k];
+
+ // Lowercase the first letter
+ // By default, dash-separated becomes camelCase
+ key = key.substring(0, 1).toLowerCase() + key.substring(1);
+
+ if (!(key in dataLevel)) {
+ dataLevel[key] = {};
+ }
+
+ if (k == keys.length - 1) {
+ dataLevel[key] = data[originalKey];
+ }
+
+ dataLevel = dataLevel[key];
+ }
+
+ delete data[originalKey];
+ }
+
+ return data;
+ };
+
+ Utils.hasScroll = function (index, el) {
+ // Adapted from the function created by @ShadowScripter
+ // and adapted by @BillBarry on the Stack Exchange Code Review website.
+ // The original code can be found at
+ // http://codereview.stackexchange.com/q/13338
+ // and was designed to be used with the Sizzle selector engine.
+
+ var $el = $(el);
+ var overflowX = el.style.overflowX;
+ var overflowY = el.style.overflowY;
+
+ //Check both x and y declarations
+ if (overflowX === overflowY &&
+ (overflowY === 'hidden' || overflowY === 'visible')) {
+ return false;
+ }
+
+ if (overflowX === 'scroll' || overflowY === 'scroll') {
+ return true;
+ }
+
+ return ($el.innerHeight() < el.scrollHeight ||
+ $el.innerWidth() < el.scrollWidth);
+ };
+
+ Utils.escapeMarkup = function (markup) {
+ var replaceMap = {
+ '\\': '\',
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ '\'': ''',
+ '/': '/'
+ };
+
+ // Do not try to escape the markup if it's not a string
+ if (typeof markup !== 'string') {
+ return markup;
+ }
+
+ return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
+ return replaceMap[match];
+ });
+ };
+
+ // Append an array of jQuery nodes to a given element.
+ Utils.appendMany = function ($element, $nodes) {
+ // jQuery 1.7.x does not support $.fn.append() with an array
+ // Fall back to a jQuery object collection using $.fn.add()
+ if ($.fn.jquery.substr(0, 3) === '1.7') {
+ var $jqNodes = $();
+
+ $.map($nodes, function (node) {
+ $jqNodes = $jqNodes.add(node);
+ });
+
+ $nodes = $jqNodes;
+ }
+
+ $element.append($nodes);
+ };
+
+ // Determine whether the browser is on a touchscreen device.
+ Utils.isTouchscreen = function() {
+ if ('undefined' === typeof Utils._isTouchscreenCache) {
+ Utils._isTouchscreenCache = 'ontouchstart' in document.documentElement;
+ }
+ return Utils._isTouchscreenCache;
+ }
+
+ return Utils;
+});
+
+S2.define('select2/results',[
+ 'jquery',
+ './utils'
+], function ($, Utils) {
+ function Results ($element, options, dataAdapter) {
+ this.$element = $element;
+ this.data = dataAdapter;
+ this.options = options;
+
+ Results.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(Results, Utils.Observable);
+
+ Results.prototype.render = function () {
+ var $results = $(
+ ''
+ );
+
+ if (this.options.get('multiple')) {
+ $results.attr('aria-multiselectable', 'true');
+ }
+
+ this.$results = $results;
+
+ return $results;
+ };
+
+ Results.prototype.clear = function () {
+ this.$results.empty();
+ };
+
+ Results.prototype.displayMessage = function (params) {
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ this.clear();
+ this.hideLoading();
+
+ var $message = $(
+ ' '
+ );
+
+ var message = this.options.get('translations').get(params.message);
+
+ $message.append(
+ escapeMarkup(
+ message(params.args)
+ )
+ );
+
+ $message[0].className += ' select2-results__message';
+
+ this.$results.append($message);
+ };
+
+ Results.prototype.hideMessages = function () {
+ this.$results.find('.select2-results__message').remove();
+ };
+
+ Results.prototype.append = function (data) {
+ this.hideLoading();
+
+ var $options = [];
+
+ if (data.results == null || data.results.length === 0) {
+ if (this.$results.children().length === 0) {
+ this.trigger('results:message', {
+ message: 'noResults'
+ });
+ }
+
+ return;
+ }
+
+ data.results = this.sort(data.results);
+
+ for (var d = 0; d < data.results.length; d++) {
+ var item = data.results[d];
+
+ var $option = this.option(item);
+
+ $options.push($option);
+ }
+
+ this.$results.append($options);
+ };
+
+ Results.prototype.position = function ($results, $dropdown) {
+ var $resultsContainer = $dropdown.find('.select2-results');
+ $resultsContainer.append($results);
+ };
+
+ Results.prototype.sort = function (data) {
+ var sorter = this.options.get('sorter');
+
+ return sorter(data);
+ };
+
+ Results.prototype.highlightFirstItem = function () {
+ var $options = this.$results
+ .find('.select2-results__option[data-selected]');
+
+ var $selected = $options.filter('[data-selected=true]');
+
+ // Check if there are any selected options
+ if ($selected.length > 0) {
+ // If there are selected options, highlight the first
+ $selected.first().trigger('mouseenter');
+ } else {
+ // If there are no selected options, highlight the first option
+ // in the dropdown
+ $options.first().trigger('mouseenter');
+ }
+
+ this.ensureHighlightVisible();
+ };
+
+ Results.prototype.setClasses = function () {
+ var self = this;
+
+ this.data.current(function (selected) {
+ var selectedIds = $.map(selected, function (s) {
+ return s.id.toString();
+ });
+
+ var $options = self.$results
+ .find('.select2-results__option[data-selected]');
+
+ $options.each(function () {
+ var $option = $(this);
+
+ var item = $.data(this, 'data');
+
+ // id needs to be converted to a string when comparing
+ var id = '' + item.id;
+
+ if ((item.element != null && item.element.selected) ||
+ (item.element == null && $.inArray(id, selectedIds) > -1)) {
+ $option.attr('data-selected', 'true');
+ } else {
+ $option.attr('data-selected', 'false');
+ }
+ });
+
+ });
+ };
+
+ Results.prototype.showLoading = function (params) {
+ this.hideLoading();
+
+ var loadingMore = this.options.get('translations').get('searching');
+
+ var loading = {
+ disabled: true,
+ loading: true,
+ text: loadingMore(params)
+ };
+ var $loading = this.option(loading);
+ $loading.className += ' loading-results';
+
+ this.$results.prepend($loading);
+ };
+
+ Results.prototype.hideLoading = function () {
+ this.$results.find('.loading-results').remove();
+ };
+
+ Results.prototype.option = function (data) {
+ var option = document.createElement('li');
+ option.className = 'select2-results__option';
+
+ var attrs = {
+ 'role': 'option',
+ 'data-selected': 'false',
+ 'tabindex': -1
+ };
+
+ if (data.disabled) {
+ delete attrs['data-selected'];
+ attrs['aria-disabled'] = 'true';
+ }
+
+ if (data.id == null) {
+ delete attrs['data-selected'];
+ }
+
+ if (data._resultId != null) {
+ option.id = data._resultId;
+ }
+
+ if (data.title) {
+ option.title = data.title;
+ }
+
+ if (data.children) {
+ attrs['aria-label'] = data.text;
+ delete attrs['data-selected'];
+ }
+
+ for (var attr in attrs) {
+ var val = attrs[attr];
+
+ option.setAttribute(attr, val);
+ }
+
+ if (data.children) {
+ var $option = $(option);
+
+ var label = document.createElement('strong');
+ label.className = 'select2-results__group';
+
+ var $label = $(label);
+ this.template(data, label);
+ $label.attr('role', 'presentation');
+
+ var $children = [];
+
+ for (var c = 0; c < data.children.length; c++) {
+ var child = data.children[c];
+
+ var $child = this.option(child);
+
+ $children.push($child);
+ }
+
+ var $childrenContainer = $('', {
+ 'class': 'select2-results__options select2-results__options--nested',
+ 'role': 'listbox'
+ });
+ $childrenContainer.append($children);
+ $option.attr('role', 'list');
+
+ $option.append(label);
+ $option.append($childrenContainer);
+ } else {
+ this.template(data, option);
+ }
+
+ $.data(option, 'data', data);
+
+ return option;
+ };
+
+ Results.prototype.bind = function (container, $container) {
+ var self = this;
+
+ var id = container.id + '-results';
+
+ this.$results.attr('id', id);
+
+ container.on('results:all', function (params) {
+ self.clear();
+ self.append(params.data);
+
+ if (container.isOpen()) {
+ self.setClasses();
+ self.highlightFirstItem();
+ }
+ });
+
+ container.on('results:append', function (params) {
+ self.append(params.data);
+
+ if (container.isOpen()) {
+ self.setClasses();
+ }
+ });
+
+ container.on('query', function (params) {
+ self.hideMessages();
+ self.showLoading(params);
+ });
+
+ container.on('select', function () {
+ if (!container.isOpen()) {
+ return;
+ }
+
+ self.setClasses();
+ self.highlightFirstItem();
+ });
+
+ container.on('unselect', function () {
+ if (!container.isOpen()) {
+ return;
+ }
+
+ self.setClasses();
+ self.highlightFirstItem();
+ });
+
+ container.on('open', function () {
+ // When the dropdown is open, aria-expended="true"
+ self.$results.attr('aria-expanded', 'true');
+ self.$results.attr('aria-hidden', 'false');
+
+ self.setClasses();
+ self.ensureHighlightVisible();
+ });
+
+ container.on('close', function () {
+ // When the dropdown is closed, aria-expended="false"
+ self.$results.attr('aria-expanded', 'false');
+ self.$results.attr('aria-hidden', 'true');
+ self.$results.removeAttr('aria-activedescendant');
+ });
+
+ container.on('results:toggle', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ if ($highlighted.length === 0) {
+ return;
+ }
+
+ $highlighted.trigger('mouseup');
+ });
+
+ container.on('results:select', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ if ($highlighted.length === 0) {
+ return;
+ }
+
+ var data = $highlighted.data('data');
+
+ if ($highlighted.attr('data-selected') == 'true') {
+ self.trigger('close', {});
+ } else {
+ self.trigger('select', {
+ data: data
+ });
+ }
+ });
+
+ container.on('results:previous', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ var $options = self.$results.find('[data-selected]');
+
+ var currentIndex = $options.index($highlighted);
+
+ // If we are already at te top, don't move further
+ if (currentIndex === 0) {
+ return;
+ }
+
+ var nextIndex = currentIndex - 1;
+
+ // If none are highlighted, highlight the first
+ if ($highlighted.length === 0) {
+ nextIndex = 0;
+ }
+
+ var $next = $options.eq(nextIndex);
+
+ $next.trigger('mouseenter');
+
+ var currentOffset = self.$results.offset().top;
+ var nextTop = $next.offset().top;
+ var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
+
+ if (nextIndex === 0) {
+ self.$results.scrollTop(0);
+ } else if (nextTop - currentOffset < 0) {
+ self.$results.scrollTop(nextOffset);
+ }
+ });
+
+ container.on('results:next', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ var $options = self.$results.find('[data-selected]');
+
+ var currentIndex = $options.index($highlighted);
+
+ var nextIndex = currentIndex + 1;
+
+ // If we are at the last option, stay there
+ if (nextIndex >= $options.length) {
+ return;
+ }
+
+ var $next = $options.eq(nextIndex);
+
+ $next.trigger('mouseenter');
+
+ var currentOffset = self.$results.offset().top +
+ self.$results.outerHeight(false);
+ var nextBottom = $next.offset().top + $next.outerHeight(false);
+ var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
+
+ if (nextIndex === 0) {
+ self.$results.scrollTop(0);
+ } else if (nextBottom > currentOffset) {
+ self.$results.scrollTop(nextOffset);
+ }
+ });
+
+ container.on('results:focus', function (params) {
+ params.element.addClass('select2-results__option--highlighted').attr('aria-selected', 'true');
+ self.$results.attr('aria-activedescendant', params.element.attr('id'));
+ });
+
+ container.on('results:message', function (params) {
+ self.displayMessage(params);
+ });
+
+ if ($.fn.mousewheel) {
+ this.$results.on('mousewheel', function (e) {
+ var top = self.$results.scrollTop();
+
+ var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
+
+ var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
+ var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
+
+ if (isAtTop) {
+ self.$results.scrollTop(0);
+
+ e.preventDefault();
+ e.stopPropagation();
+ } else if (isAtBottom) {
+ self.$results.scrollTop(
+ self.$results.get(0).scrollHeight - self.$results.height()
+ );
+
+ e.preventDefault();
+ e.stopPropagation();
+ }
+ });
+ }
+
+ this.$results.on('mouseup', '.select2-results__option[data-selected]',
+ function (evt) {
+ var $this = $(this);
+
+ var data = $this.data('data');
+
+ if ($this.attr('data-selected') === 'true') {
+ if (self.options.get('multiple')) {
+ self.trigger('unselect', {
+ originalEvent: evt,
+ data: data
+ });
+ } else {
+ self.trigger('close', {});
+ }
+
+ return;
+ }
+
+ self.trigger('select', {
+ originalEvent: evt,
+ data: data
+ });
+ });
+
+ this.$results.on('mouseenter', '.select2-results__option[data-selected]',
+ function (evt) {
+ var data = $(this).data('data');
+
+ self.getHighlightedResults()
+ .removeClass('select2-results__option--highlighted')
+ .attr('aria-selected', 'false');
+
+ self.trigger('results:focus', {
+ data: data,
+ element: $(this)
+ });
+ });
+ };
+
+ Results.prototype.getHighlightedResults = function () {
+ var $highlighted = this.$results
+ .find('.select2-results__option--highlighted');
+
+ return $highlighted;
+ };
+
+ Results.prototype.destroy = function () {
+ this.$results.remove();
+ };
+
+ Results.prototype.ensureHighlightVisible = function () {
+ var $highlighted = this.getHighlightedResults();
+
+ if ($highlighted.length === 0) {
+ return;
+ }
+
+ var $options = this.$results.find('[data-selected]');
+
+ var currentIndex = $options.index($highlighted);
+
+ var currentOffset = this.$results.offset().top;
+ var nextTop = $highlighted.offset().top;
+ var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
+
+ var offsetDelta = nextTop - currentOffset;
+ nextOffset -= $highlighted.outerHeight(false) * 2;
+
+ if (currentIndex <= 2) {
+ this.$results.scrollTop(0);
+ } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
+ this.$results.scrollTop(nextOffset);
+ }
+ };
+
+ Results.prototype.template = function (result, container) {
+ var template = this.options.get('templateResult');
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ var content = template(result, container);
+
+ if (content == null) {
+ container.style.display = 'none';
+ } else if (typeof content === 'string') {
+ container.innerHTML = escapeMarkup(content);
+ } else {
+ $(container).append(content);
+ }
+ };
+
+ return Results;
+});
+
+S2.define('select2/keys',[
+
+], function () {
+ var KEYS = {
+ BACKSPACE: 8,
+ TAB: 9,
+ ENTER: 13,
+ SHIFT: 16,
+ CTRL: 17,
+ ALT: 18,
+ ESC: 27,
+ SPACE: 32,
+ PAGE_UP: 33,
+ PAGE_DOWN: 34,
+ END: 35,
+ HOME: 36,
+ LEFT: 37,
+ UP: 38,
+ RIGHT: 39,
+ DOWN: 40,
+ DELETE: 46
+ };
+
+ return KEYS;
+});
+
+S2.define('select2/selection/base',[
+ 'jquery',
+ '../utils',
+ '../keys'
+], function ($, Utils, KEYS) {
+ function BaseSelection ($element, options) {
+ this.$element = $element;
+ this.options = options;
+
+ BaseSelection.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(BaseSelection, Utils.Observable);
+
+ BaseSelection.prototype.render = function () {
+ var $selection = $(
+ '' +
+ ' '
+ );
+
+ this._tabindex = 0;
+
+ if (this.$element.data('old-tabindex') != null) {
+ this._tabindex = this.$element.data('old-tabindex');
+ } else if (this.$element.attr('tabindex') != null) {
+ this._tabindex = this.$element.attr('tabindex');
+ }
+
+ $selection.attr('title', this.$element.attr('title'));
+ $selection.attr('tabindex', this._tabindex);
+
+ this.$selection = $selection;
+
+ return $selection;
+ };
+
+ BaseSelection.prototype.bind = function (container, $container) {
+ var self = this;
+
+ var id = container.id + '-container';
+ var resultsId = container.id + '-results';
+ var searchHidden = this.options.get('minimumResultsForSearch') === Infinity;
+
+ this.container = container;
+
+ this.$selection.on('focus', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this.$selection.on('blur', function (evt) {
+ self._handleBlur(evt);
+ });
+
+ this.$selection.on('keydown', function (evt) {
+ self.trigger('keypress', evt);
+
+ if (evt.which === KEYS.SPACE) {
+ evt.preventDefault();
+ }
+ });
+
+ container.on('results:focus', function (params) {
+ self.$selection.attr('aria-activedescendant', params.data._resultId);
+ });
+
+ container.on('selection:update', function (params) {
+ self.update(params.data);
+ });
+
+ container.on('open', function () {
+ // When the dropdown is open, aria-expanded="true"
+ self.$selection.attr('aria-expanded', 'true');
+ self.$selection.attr('aria-owns', resultsId);
+
+ self._attachCloseHandler(container);
+ });
+
+ container.on('close', function () {
+ // When the dropdown is closed, aria-expanded="false"
+ self.$selection.attr('aria-expanded', 'false');
+ self.$selection.removeAttr('aria-activedescendant');
+ self.$selection.removeAttr('aria-owns');
+
+ // This needs to be delayed as the active element is the body when the
+ // key is pressed.
+ window.setTimeout(function () {
+ self.$selection.focus();
+ }, 1);
+
+ self._detachCloseHandler(container);
+ });
+
+ container.on('enable', function () {
+ self.$selection.attr('tabindex', self._tabindex);
+ });
+
+ container.on('disable', function () {
+ self.$selection.attr('tabindex', '-1');
+ });
+ };
+
+ BaseSelection.prototype._handleBlur = function (evt) {
+ var self = this;
+
+ // This needs to be delayed as the active element is the body when the tab
+ // key is pressed, possibly along with others.
+ window.setTimeout(function () {
+ // Don't trigger `blur` if the focus is still in the selection
+ if (
+ (document.activeElement == self.$selection[0]) ||
+ ($.contains(self.$selection[0], document.activeElement))
+ ) {
+ return;
+ }
+
+ self.trigger('blur', evt);
+ }, 1);
+ };
+
+ BaseSelection.prototype._attachCloseHandler = function (container) {
+ var self = this;
+
+ $(document.body).on('mousedown.select2.' + container.id, function (e) {
+ var $target = $(e.target);
+
+ var $select = $target.closest('.select2');
+
+ var $all = $('.select2.select2-container--open');
+
+ $all.each(function () {
+ var $this = $(this);
+
+ if (this == $select[0]) {
+ return;
+ }
+
+ var $element = $this.data('element');
+
+ $element.select2('close');
+ });
+ });
+ };
+
+ BaseSelection.prototype._detachCloseHandler = function (container) {
+ $(document.body).off('mousedown.select2.' + container.id);
+ };
+
+ BaseSelection.prototype.position = function ($selection, $container) {
+ var $selectionContainer = $container.find('.selection');
+ $selectionContainer.append($selection);
+ };
+
+ BaseSelection.prototype.destroy = function () {
+ this._detachCloseHandler(this.container);
+ };
+
+ BaseSelection.prototype.update = function (data) {
+ throw new Error('The `update` method must be defined in child classes.');
+ };
+
+ return BaseSelection;
+});
+
+S2.define('select2/selection/single',[
+ 'jquery',
+ './base',
+ '../utils',
+ '../keys'
+], function ($, BaseSelection, Utils, KEYS) {
+ function SingleSelection () {
+ SingleSelection.__super__.constructor.apply(this, arguments);
+ }
+
+ Utils.Extend(SingleSelection, BaseSelection);
+
+ SingleSelection.prototype.render = function () {
+ var $selection = SingleSelection.__super__.render.call(this);
+
+ $selection.addClass('select2-selection--single');
+
+ $selection.html(
+ ' ' +
+ '' +
+ ' ' +
+ ' '
+ );
+
+ return $selection;
+ };
+
+ SingleSelection.prototype.bind = function (container, $container) {
+ var self = this;
+
+ SingleSelection.__super__.bind.apply(this, arguments);
+
+ var id = container.id + '-container';
+
+ this.$selection.find('.select2-selection__rendered')
+ .attr('id', id)
+ .attr('role', 'textbox')
+ .attr('aria-readonly', 'true');
+ this.$selection.attr('aria-labelledby', id);
+
+ // This makes single non-search selects work in screen readers. If it causes problems elsewhere, remove.
+ this.$selection.attr('role', 'combobox');
+
+ this.$selection.on('mousedown', function (evt) {
+ // Only respond to left clicks
+ if (evt.which !== 1) {
+ return;
+ }
+
+ self.trigger('toggle', {
+ originalEvent: evt
+ });
+ });
+
+ this.$selection.on('focus', function (evt) {
+ // User focuses on the container
+ });
+
+ this.$selection.on('keydown', function (evt) {
+ // If user starts typing an alphanumeric key on the keyboard, open if not opened.
+ if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
+ container.open();
+ }
+ });
+
+ this.$selection.on('blur', function (evt) {
+ // User exits the container
+ });
+
+ container.on('focus', function (evt) {
+ if (!container.isOpen()) {
+ self.$selection.focus();
+ }
+ });
+
+ container.on('selection:update', function (params) {
+ self.update(params.data);
+ });
+ };
+
+ SingleSelection.prototype.clear = function () {
+ this.$selection.find('.select2-selection__rendered').empty();
+ };
+
+ SingleSelection.prototype.display = function (data, container) {
+ var template = this.options.get('templateSelection');
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ return escapeMarkup(template(data, container));
+ };
+
+ SingleSelection.prototype.selectionContainer = function () {
+ return $(' ');
+ };
+
+ SingleSelection.prototype.update = function (data) {
+ if (data.length === 0) {
+ this.clear();
+ return;
+ }
+
+ var selection = data[0];
+
+ var $rendered = this.$selection.find('.select2-selection__rendered');
+ var formatted = this.display(selection, $rendered);
+
+ $rendered.empty().append(formatted);
+ $rendered.prop('title', selection.title || selection.text);
+ };
+
+ return SingleSelection;
+});
+
+S2.define('select2/selection/multiple',[
+ 'jquery',
+ './base',
+ '../utils'
+], function ($, BaseSelection, Utils) {
+ function MultipleSelection ($element, options) {
+ MultipleSelection.__super__.constructor.apply(this, arguments);
+ }
+
+ Utils.Extend(MultipleSelection, BaseSelection);
+
+ MultipleSelection.prototype.render = function () {
+ var $selection = MultipleSelection.__super__.render.call(this);
+
+ $selection.addClass('select2-selection--multiple');
+
+ $selection.html(
+ ''
+ );
+
+ return $selection;
+ };
+
+ MultipleSelection.prototype.bind = function (container, $container) {
+ var self = this;
+
+ MultipleSelection.__super__.bind.apply(this, arguments);
+
+ this.$selection.on('click', function (evt) {
+ self.trigger('toggle', {
+ originalEvent: evt
+ });
+ });
+
+ this.$selection.on(
+ 'click',
+ '.select2-selection__choice__remove',
+ function (evt) {
+ // Ignore the event if it is disabled
+ if (self.options.get('disabled')) {
+ return;
+ }
+
+ var $remove = $(this);
+ var $selection = $remove.parent();
+
+ var data = $selection.data('data');
+
+ self.trigger('unselect', {
+ originalEvent: evt,
+ data: data
+ });
+ }
+ );
+ };
+
+ MultipleSelection.prototype.clear = function () {
+ this.$selection.find('.select2-selection__rendered').empty();
+ };
+
+ MultipleSelection.prototype.display = function (data, container) {
+ var template = this.options.get('templateSelection');
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ return escapeMarkup(template(data, container));
+ };
+
+ MultipleSelection.prototype.selectionContainer = function () {
+ var $container = $(
+ '' +
+ '' +
+ '×' +
+ ' ' +
+ ' '
+ );
+
+ return $container;
+ };
+
+ MultipleSelection.prototype.update = function (data) {
+ var self = this;
+ this.clear();
+
+ if (data.length === 0) {
+ return;
+ }
+
+ var $selections = [];
+
+ for (var d = 0; d < data.length; d++) {
+ var selection = data[d];
+
+ var $selection = this.selectionContainer();
+ var formatted = this.display(selection, $selection).trim();
+
+ $selection.append(formatted);
+ $selection.prop('title', selection.title || selection.text);
+
+ $selection.data('data', selection);
+
+ $selections.push($selection);
+ }
+
+ var $rendered = this.$selection.find('.select2-selection__rendered');
+
+ Utils.appendMany($rendered, $selections);
+
+ // Return cursor to search field after updating.
+ // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
+ if ('undefined' !== typeof this.$search) {
+ setTimeout(function(){
+ self.$search.focus();
+ }, 1);
+ }
+ };
+
+ return MultipleSelection;
+});
+
+S2.define('select2/selection/placeholder',[
+ '../utils'
+], function (Utils) {
+ function Placeholder (decorated, $element, options) {
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
+
+ decorated.call(this, $element, options);
+ }
+
+ Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
+ if (typeof placeholder === 'string') {
+ placeholder = {
+ id: '',
+ text: placeholder
+ };
+ }
+
+ return placeholder;
+ };
+
+ Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
+ var $placeholder = this.selectionContainer();
+
+ $placeholder.html(this.display(placeholder));
+ $placeholder.addClass('select2-selection__placeholder')
+ .removeClass('select2-selection__choice');
+
+ return $placeholder;
+ };
+
+ Placeholder.prototype.update = function (decorated, data) {
+ var singlePlaceholder = (
+ data.length == 1 && data[0].id != this.placeholder.id
+ );
+ var multipleSelections = data.length > 1;
+
+ if (multipleSelections || singlePlaceholder) {
+ return decorated.call(this, data);
+ }
+
+ this.clear();
+
+ var $placeholder = this.createPlaceholder(this.placeholder);
+
+ this.$selection.find('.select2-selection__rendered').append($placeholder);
+ };
+
+ return Placeholder;
+});
+
+S2.define('select2/selection/allowClear',[
+ 'jquery',
+ '../keys'
+], function ($, KEYS) {
+ function AllowClear () { }
+
+ AllowClear.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ if (this.placeholder == null) {
+ if (this.options.get('debug') && window.console && console.error) {
+ console.error(
+ 'Select2: The `allowClear` option should be used in combination ' +
+ 'with the `placeholder` option.'
+ );
+ }
+ }
+
+ this.$selection.on('mousedown', '.select2-selection__clear',
+ function (evt) {
+ self._handleClear(evt);
+ });
+
+ container.on('keypress', function (evt) {
+ self._handleKeyboardClear(evt, container);
+ });
+ };
+
+ AllowClear.prototype._handleClear = function (_, evt) {
+ // Ignore the event if it is disabled
+ if (this.options.get('disabled')) {
+ return;
+ }
+
+ var $clear = this.$selection.find('.select2-selection__clear');
+
+ // Ignore the event if nothing has been selected
+ if ($clear.length === 0) {
+ return;
+ }
+
+ evt.stopPropagation();
+
+ var data = $clear.data('data');
+
+ for (var d = 0; d < data.length; d++) {
+ var unselectData = {
+ data: data[d]
+ };
+
+ // Trigger the `unselect` event, so people can prevent it from being
+ // cleared.
+ this.trigger('unselect', unselectData);
+
+ // If the event was prevented, don't clear it out.
+ if (unselectData.prevented) {
+ return;
+ }
+ }
+
+ this.$element.val(this.placeholder.id).trigger('change');
+
+ this.trigger('toggle', {});
+ };
+
+ AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
+ if (container.isOpen()) {
+ return;
+ }
+
+ if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
+ this._handleClear(evt);
+ }
+ };
+
+ AllowClear.prototype.update = function (decorated, data) {
+ decorated.call(this, data);
+
+ if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
+ data.length === 0) {
+ return;
+ }
+
+ var $remove = $(
+ '' +
+ '×' +
+ ' '
+ );
+ $remove.data('data', data);
+
+ this.$selection.find('.select2-selection__rendered').prepend($remove);
+ };
+
+ return AllowClear;
+});
+
+S2.define('select2/selection/search',[
+ 'jquery',
+ '../utils',
+ '../keys'
+], function ($, Utils, KEYS) {
+ function Search (decorated, $element, options) {
+ decorated.call(this, $element, options);
+ }
+
+ Search.prototype.render = function (decorated) {
+ var $search = $(
+ '' +
+ ' ' +
+ ' '
+ );
+
+ this.$searchContainer = $search;
+ this.$search = $search.find('input');
+
+ var $rendered = decorated.call(this);
+
+ this._transferTabIndex();
+
+ return $rendered;
+ };
+
+ Search.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+ var resultsId = container.id + '-results';
+
+ decorated.call(this, container, $container);
+
+ container.on('open', function () {
+ self.$search.attr('aria-owns', resultsId);
+ self.$search.trigger('focus');
+ });
+
+ container.on('close', function () {
+ self.$search.val('');
+ self.$search.removeAttr('aria-activedescendant');
+ self.$search.removeAttr('aria-owns');
+ self.$search.trigger('focus');
+ });
+
+ container.on('enable', function () {
+ self.$search.prop('disabled', false);
+
+ self._transferTabIndex();
+ });
+
+ container.on('disable', function () {
+ self.$search.prop('disabled', true);
+ });
+
+ container.on('focus', function (evt) {
+ self.$search.trigger('focus');
+ });
+
+ container.on('results:focus', function (params) {
+ self.$search.attr('aria-activedescendant', params.data._resultId);
+ });
+
+ this.$selection.on('focusin', '.select2-search--inline', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this.$selection.on('focusout', '.select2-search--inline', function (evt) {
+ self._handleBlur(evt);
+ });
+
+ this.$selection.on('keydown', '.select2-search--inline', function (evt) {
+ evt.stopPropagation();
+
+ self.trigger('keypress', evt);
+
+ self._keyUpPrevented = evt.isDefaultPrevented();
+
+ var key = evt.which;
+
+ if (key === KEYS.BACKSPACE && self.$search.val() === '') {
+ var $previousChoice = self.$searchContainer
+ .prev('.select2-selection__choice');
+
+ if ($previousChoice.length > 0) {
+ var item = $previousChoice.data('data');
+
+ self.searchRemoveChoice(item);
+
+ evt.preventDefault();
+ }
+ }
+ });
+
+ // Try to detect the IE version should the `documentMode` property that
+ // is stored on the document. This is only implemented in IE and is
+ // slightly cleaner than doing a user agent check.
+ // This property is not available in Edge, but Edge also doesn't have
+ // this bug.
+ var msie = document.documentMode;
+ var disableInputEvents = msie && msie <= 11;
+
+ // Workaround for browsers which do not support the `input` event
+ // This will prevent double-triggering of events for browsers which support
+ // both the `keyup` and `input` events.
+ this.$selection.on(
+ 'input.searchcheck',
+ '.select2-search--inline',
+ function (evt) {
+ // IE will trigger the `input` event when a placeholder is used on a
+ // search box. To get around this issue, we are forced to ignore all
+ // `input` events in IE and keep using `keyup`.
+ if (disableInputEvents) {
+ self.$selection.off('input.search input.searchcheck');
+ return;
+ }
+
+ // Unbind the duplicated `keyup` event
+ self.$selection.off('keyup.search');
+ }
+ );
+
+ this.$selection.on(
+ 'keyup.search input.search',
+ '.select2-search--inline',
+ function (evt) {
+ // IE will trigger the `input` event when a placeholder is used on a
+ // search box. To get around this issue, we are forced to ignore all
+ // `input` events in IE and keep using `keyup`.
+ if (disableInputEvents && evt.type === 'input') {
+ self.$selection.off('input.search input.searchcheck');
+ return;
+ }
+
+ var key = evt.which;
+
+ // We can freely ignore events from modifier keys
+ if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
+ return;
+ }
+
+ // Tabbing will be handled during the `keydown` phase
+ if (key == KEYS.TAB) {
+ return;
+ }
+
+ self.handleSearch(evt);
+ }
+ );
+ };
+
+ /**
+ * This method will transfer the tabindex attribute from the rendered
+ * selection to the search box. This allows for the search box to be used as
+ * the primary focus instead of the selection container.
+ *
+ * @private
+ */
+ Search.prototype._transferTabIndex = function (decorated) {
+ this.$search.attr('tabindex', this.$selection.attr('tabindex'));
+ this.$selection.attr('tabindex', '-1');
+ };
+
+ Search.prototype.createPlaceholder = function (decorated, placeholder) {
+ this.$search.attr('placeholder', placeholder.text);
+ };
+
+ Search.prototype.update = function (decorated, data) {
+ var searchHadFocus = this.$search[0] == document.activeElement;
+
+ this.$search.attr('placeholder', '');
+
+ decorated.call(this, data);
+
+ this.$selection.find('.select2-selection__rendered')
+ .append(this.$searchContainer);
+
+ this.resizeSearch();
+ if (searchHadFocus) {
+ this.$search.focus();
+ }
+ };
+
+ Search.prototype.handleSearch = function () {
+ this.resizeSearch();
+
+ if (!this._keyUpPrevented) {
+ var input = this.$search.val();
+
+ this.trigger('query', {
+ term: input
+ });
+ }
+
+ this._keyUpPrevented = false;
+ };
+
+ Search.prototype.searchRemoveChoice = function (decorated, item) {
+ this.trigger('unselect', {
+ data: item
+ });
+
+ this.$search.val(item.text);
+ this.handleSearch();
+ };
+
+ Search.prototype.resizeSearch = function () {
+ this.$search.css('width', '25px');
+
+ var width = '';
+
+ if (this.$search.attr('placeholder') !== '') {
+ width = this.$selection.find('.select2-selection__rendered').innerWidth();
+ } else {
+ var minimumWidth = this.$search.val().length + 1;
+
+ width = (minimumWidth * 0.75) + 'em';
+ }
+
+ this.$search.css('width', width);
+ };
+
+ return Search;
+});
+
+S2.define('select2/selection/eventRelay',[
+ 'jquery'
+], function ($) {
+ function EventRelay () { }
+
+ EventRelay.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+ var relayEvents = [
+ 'open', 'opening',
+ 'close', 'closing',
+ 'select', 'selecting',
+ 'unselect', 'unselecting'
+ ];
+
+ var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
+
+ decorated.call(this, container, $container);
+
+ container.on('*', function (name, params) {
+ // Ignore events that should not be relayed
+ if ($.inArray(name, relayEvents) === -1) {
+ return;
+ }
+
+ // The parameters should always be an object
+ params = params || {};
+
+ // Generate the jQuery event for the Select2 event
+ var evt = $.Event('select2:' + name, {
+ params: params
+ });
+
+ self.$element.trigger(evt);
+
+ // Only handle preventable events if it was one
+ if ($.inArray(name, preventableEvents) === -1) {
+ return;
+ }
+
+ params.prevented = evt.isDefaultPrevented();
+ });
+ };
+
+ return EventRelay;
+});
+
+S2.define('select2/translation',[
+ 'jquery',
+ 'require'
+], function ($, require) {
+ function Translation (dict) {
+ this.dict = dict || {};
+ }
+
+ Translation.prototype.all = function () {
+ return this.dict;
+ };
+
+ Translation.prototype.get = function (key) {
+ return this.dict[key];
+ };
+
+ Translation.prototype.extend = function (translation) {
+ this.dict = $.extend({}, translation.all(), this.dict);
+ };
+
+ // Static functions
+
+ Translation._cache = {};
+
+ Translation.loadPath = function (path) {
+ if (!(path in Translation._cache)) {
+ var translations = require(path);
+
+ Translation._cache[path] = translations;
+ }
+
+ return new Translation(Translation._cache[path]);
+ };
+
+ return Translation;
+});
+
+S2.define('select2/diacritics',[
+
+], function () {
+ var diacritics = {
+ '\u24B6': 'A',
+ '\uFF21': 'A',
+ '\u00C0': 'A',
+ '\u00C1': 'A',
+ '\u00C2': 'A',
+ '\u1EA6': 'A',
+ '\u1EA4': 'A',
+ '\u1EAA': 'A',
+ '\u1EA8': 'A',
+ '\u00C3': 'A',
+ '\u0100': 'A',
+ '\u0102': 'A',
+ '\u1EB0': 'A',
+ '\u1EAE': 'A',
+ '\u1EB4': 'A',
+ '\u1EB2': 'A',
+ '\u0226': 'A',
+ '\u01E0': 'A',
+ '\u00C4': 'A',
+ '\u01DE': 'A',
+ '\u1EA2': 'A',
+ '\u00C5': 'A',
+ '\u01FA': 'A',
+ '\u01CD': 'A',
+ '\u0200': 'A',
+ '\u0202': 'A',
+ '\u1EA0': 'A',
+ '\u1EAC': 'A',
+ '\u1EB6': 'A',
+ '\u1E00': 'A',
+ '\u0104': 'A',
+ '\u023A': 'A',
+ '\u2C6F': 'A',
+ '\uA732': 'AA',
+ '\u00C6': 'AE',
+ '\u01FC': 'AE',
+ '\u01E2': 'AE',
+ '\uA734': 'AO',
+ '\uA736': 'AU',
+ '\uA738': 'AV',
+ '\uA73A': 'AV',
+ '\uA73C': 'AY',
+ '\u24B7': 'B',
+ '\uFF22': 'B',
+ '\u1E02': 'B',
+ '\u1E04': 'B',
+ '\u1E06': 'B',
+ '\u0243': 'B',
+ '\u0182': 'B',
+ '\u0181': 'B',
+ '\u24B8': 'C',
+ '\uFF23': 'C',
+ '\u0106': 'C',
+ '\u0108': 'C',
+ '\u010A': 'C',
+ '\u010C': 'C',
+ '\u00C7': 'C',
+ '\u1E08': 'C',
+ '\u0187': 'C',
+ '\u023B': 'C',
+ '\uA73E': 'C',
+ '\u24B9': 'D',
+ '\uFF24': 'D',
+ '\u1E0A': 'D',
+ '\u010E': 'D',
+ '\u1E0C': 'D',
+ '\u1E10': 'D',
+ '\u1E12': 'D',
+ '\u1E0E': 'D',
+ '\u0110': 'D',
+ '\u018B': 'D',
+ '\u018A': 'D',
+ '\u0189': 'D',
+ '\uA779': 'D',
+ '\u01F1': 'DZ',
+ '\u01C4': 'DZ',
+ '\u01F2': 'Dz',
+ '\u01C5': 'Dz',
+ '\u24BA': 'E',
+ '\uFF25': 'E',
+ '\u00C8': 'E',
+ '\u00C9': 'E',
+ '\u00CA': 'E',
+ '\u1EC0': 'E',
+ '\u1EBE': 'E',
+ '\u1EC4': 'E',
+ '\u1EC2': 'E',
+ '\u1EBC': 'E',
+ '\u0112': 'E',
+ '\u1E14': 'E',
+ '\u1E16': 'E',
+ '\u0114': 'E',
+ '\u0116': 'E',
+ '\u00CB': 'E',
+ '\u1EBA': 'E',
+ '\u011A': 'E',
+ '\u0204': 'E',
+ '\u0206': 'E',
+ '\u1EB8': 'E',
+ '\u1EC6': 'E',
+ '\u0228': 'E',
+ '\u1E1C': 'E',
+ '\u0118': 'E',
+ '\u1E18': 'E',
+ '\u1E1A': 'E',
+ '\u0190': 'E',
+ '\u018E': 'E',
+ '\u24BB': 'F',
+ '\uFF26': 'F',
+ '\u1E1E': 'F',
+ '\u0191': 'F',
+ '\uA77B': 'F',
+ '\u24BC': 'G',
+ '\uFF27': 'G',
+ '\u01F4': 'G',
+ '\u011C': 'G',
+ '\u1E20': 'G',
+ '\u011E': 'G',
+ '\u0120': 'G',
+ '\u01E6': 'G',
+ '\u0122': 'G',
+ '\u01E4': 'G',
+ '\u0193': 'G',
+ '\uA7A0': 'G',
+ '\uA77D': 'G',
+ '\uA77E': 'G',
+ '\u24BD': 'H',
+ '\uFF28': 'H',
+ '\u0124': 'H',
+ '\u1E22': 'H',
+ '\u1E26': 'H',
+ '\u021E': 'H',
+ '\u1E24': 'H',
+ '\u1E28': 'H',
+ '\u1E2A': 'H',
+ '\u0126': 'H',
+ '\u2C67': 'H',
+ '\u2C75': 'H',
+ '\uA78D': 'H',
+ '\u24BE': 'I',
+ '\uFF29': 'I',
+ '\u00CC': 'I',
+ '\u00CD': 'I',
+ '\u00CE': 'I',
+ '\u0128': 'I',
+ '\u012A': 'I',
+ '\u012C': 'I',
+ '\u0130': 'I',
+ '\u00CF': 'I',
+ '\u1E2E': 'I',
+ '\u1EC8': 'I',
+ '\u01CF': 'I',
+ '\u0208': 'I',
+ '\u020A': 'I',
+ '\u1ECA': 'I',
+ '\u012E': 'I',
+ '\u1E2C': 'I',
+ '\u0197': 'I',
+ '\u24BF': 'J',
+ '\uFF2A': 'J',
+ '\u0134': 'J',
+ '\u0248': 'J',
+ '\u24C0': 'K',
+ '\uFF2B': 'K',
+ '\u1E30': 'K',
+ '\u01E8': 'K',
+ '\u1E32': 'K',
+ '\u0136': 'K',
+ '\u1E34': 'K',
+ '\u0198': 'K',
+ '\u2C69': 'K',
+ '\uA740': 'K',
+ '\uA742': 'K',
+ '\uA744': 'K',
+ '\uA7A2': 'K',
+ '\u24C1': 'L',
+ '\uFF2C': 'L',
+ '\u013F': 'L',
+ '\u0139': 'L',
+ '\u013D': 'L',
+ '\u1E36': 'L',
+ '\u1E38': 'L',
+ '\u013B': 'L',
+ '\u1E3C': 'L',
+ '\u1E3A': 'L',
+ '\u0141': 'L',
+ '\u023D': 'L',
+ '\u2C62': 'L',
+ '\u2C60': 'L',
+ '\uA748': 'L',
+ '\uA746': 'L',
+ '\uA780': 'L',
+ '\u01C7': 'LJ',
+ '\u01C8': 'Lj',
+ '\u24C2': 'M',
+ '\uFF2D': 'M',
+ '\u1E3E': 'M',
+ '\u1E40': 'M',
+ '\u1E42': 'M',
+ '\u2C6E': 'M',
+ '\u019C': 'M',
+ '\u24C3': 'N',
+ '\uFF2E': 'N',
+ '\u01F8': 'N',
+ '\u0143': 'N',
+ '\u00D1': 'N',
+ '\u1E44': 'N',
+ '\u0147': 'N',
+ '\u1E46': 'N',
+ '\u0145': 'N',
+ '\u1E4A': 'N',
+ '\u1E48': 'N',
+ '\u0220': 'N',
+ '\u019D': 'N',
+ '\uA790': 'N',
+ '\uA7A4': 'N',
+ '\u01CA': 'NJ',
+ '\u01CB': 'Nj',
+ '\u24C4': 'O',
+ '\uFF2F': 'O',
+ '\u00D2': 'O',
+ '\u00D3': 'O',
+ '\u00D4': 'O',
+ '\u1ED2': 'O',
+ '\u1ED0': 'O',
+ '\u1ED6': 'O',
+ '\u1ED4': 'O',
+ '\u00D5': 'O',
+ '\u1E4C': 'O',
+ '\u022C': 'O',
+ '\u1E4E': 'O',
+ '\u014C': 'O',
+ '\u1E50': 'O',
+ '\u1E52': 'O',
+ '\u014E': 'O',
+ '\u022E': 'O',
+ '\u0230': 'O',
+ '\u00D6': 'O',
+ '\u022A': 'O',
+ '\u1ECE': 'O',
+ '\u0150': 'O',
+ '\u01D1': 'O',
+ '\u020C': 'O',
+ '\u020E': 'O',
+ '\u01A0': 'O',
+ '\u1EDC': 'O',
+ '\u1EDA': 'O',
+ '\u1EE0': 'O',
+ '\u1EDE': 'O',
+ '\u1EE2': 'O',
+ '\u1ECC': 'O',
+ '\u1ED8': 'O',
+ '\u01EA': 'O',
+ '\u01EC': 'O',
+ '\u00D8': 'O',
+ '\u01FE': 'O',
+ '\u0186': 'O',
+ '\u019F': 'O',
+ '\uA74A': 'O',
+ '\uA74C': 'O',
+ '\u01A2': 'OI',
+ '\uA74E': 'OO',
+ '\u0222': 'OU',
+ '\u24C5': 'P',
+ '\uFF30': 'P',
+ '\u1E54': 'P',
+ '\u1E56': 'P',
+ '\u01A4': 'P',
+ '\u2C63': 'P',
+ '\uA750': 'P',
+ '\uA752': 'P',
+ '\uA754': 'P',
+ '\u24C6': 'Q',
+ '\uFF31': 'Q',
+ '\uA756': 'Q',
+ '\uA758': 'Q',
+ '\u024A': 'Q',
+ '\u24C7': 'R',
+ '\uFF32': 'R',
+ '\u0154': 'R',
+ '\u1E58': 'R',
+ '\u0158': 'R',
+ '\u0210': 'R',
+ '\u0212': 'R',
+ '\u1E5A': 'R',
+ '\u1E5C': 'R',
+ '\u0156': 'R',
+ '\u1E5E': 'R',
+ '\u024C': 'R',
+ '\u2C64': 'R',
+ '\uA75A': 'R',
+ '\uA7A6': 'R',
+ '\uA782': 'R',
+ '\u24C8': 'S',
+ '\uFF33': 'S',
+ '\u1E9E': 'S',
+ '\u015A': 'S',
+ '\u1E64': 'S',
+ '\u015C': 'S',
+ '\u1E60': 'S',
+ '\u0160': 'S',
+ '\u1E66': 'S',
+ '\u1E62': 'S',
+ '\u1E68': 'S',
+ '\u0218': 'S',
+ '\u015E': 'S',
+ '\u2C7E': 'S',
+ '\uA7A8': 'S',
+ '\uA784': 'S',
+ '\u24C9': 'T',
+ '\uFF34': 'T',
+ '\u1E6A': 'T',
+ '\u0164': 'T',
+ '\u1E6C': 'T',
+ '\u021A': 'T',
+ '\u0162': 'T',
+ '\u1E70': 'T',
+ '\u1E6E': 'T',
+ '\u0166': 'T',
+ '\u01AC': 'T',
+ '\u01AE': 'T',
+ '\u023E': 'T',
+ '\uA786': 'T',
+ '\uA728': 'TZ',
+ '\u24CA': 'U',
+ '\uFF35': 'U',
+ '\u00D9': 'U',
+ '\u00DA': 'U',
+ '\u00DB': 'U',
+ '\u0168': 'U',
+ '\u1E78': 'U',
+ '\u016A': 'U',
+ '\u1E7A': 'U',
+ '\u016C': 'U',
+ '\u00DC': 'U',
+ '\u01DB': 'U',
+ '\u01D7': 'U',
+ '\u01D5': 'U',
+ '\u01D9': 'U',
+ '\u1EE6': 'U',
+ '\u016E': 'U',
+ '\u0170': 'U',
+ '\u01D3': 'U',
+ '\u0214': 'U',
+ '\u0216': 'U',
+ '\u01AF': 'U',
+ '\u1EEA': 'U',
+ '\u1EE8': 'U',
+ '\u1EEE': 'U',
+ '\u1EEC': 'U',
+ '\u1EF0': 'U',
+ '\u1EE4': 'U',
+ '\u1E72': 'U',
+ '\u0172': 'U',
+ '\u1E76': 'U',
+ '\u1E74': 'U',
+ '\u0244': 'U',
+ '\u24CB': 'V',
+ '\uFF36': 'V',
+ '\u1E7C': 'V',
+ '\u1E7E': 'V',
+ '\u01B2': 'V',
+ '\uA75E': 'V',
+ '\u0245': 'V',
+ '\uA760': 'VY',
+ '\u24CC': 'W',
+ '\uFF37': 'W',
+ '\u1E80': 'W',
+ '\u1E82': 'W',
+ '\u0174': 'W',
+ '\u1E86': 'W',
+ '\u1E84': 'W',
+ '\u1E88': 'W',
+ '\u2C72': 'W',
+ '\u24CD': 'X',
+ '\uFF38': 'X',
+ '\u1E8A': 'X',
+ '\u1E8C': 'X',
+ '\u24CE': 'Y',
+ '\uFF39': 'Y',
+ '\u1EF2': 'Y',
+ '\u00DD': 'Y',
+ '\u0176': 'Y',
+ '\u1EF8': 'Y',
+ '\u0232': 'Y',
+ '\u1E8E': 'Y',
+ '\u0178': 'Y',
+ '\u1EF6': 'Y',
+ '\u1EF4': 'Y',
+ '\u01B3': 'Y',
+ '\u024E': 'Y',
+ '\u1EFE': 'Y',
+ '\u24CF': 'Z',
+ '\uFF3A': 'Z',
+ '\u0179': 'Z',
+ '\u1E90': 'Z',
+ '\u017B': 'Z',
+ '\u017D': 'Z',
+ '\u1E92': 'Z',
+ '\u1E94': 'Z',
+ '\u01B5': 'Z',
+ '\u0224': 'Z',
+ '\u2C7F': 'Z',
+ '\u2C6B': 'Z',
+ '\uA762': 'Z',
+ '\u24D0': 'a',
+ '\uFF41': 'a',
+ '\u1E9A': 'a',
+ '\u00E0': 'a',
+ '\u00E1': 'a',
+ '\u00E2': 'a',
+ '\u1EA7': 'a',
+ '\u1EA5': 'a',
+ '\u1EAB': 'a',
+ '\u1EA9': 'a',
+ '\u00E3': 'a',
+ '\u0101': 'a',
+ '\u0103': 'a',
+ '\u1EB1': 'a',
+ '\u1EAF': 'a',
+ '\u1EB5': 'a',
+ '\u1EB3': 'a',
+ '\u0227': 'a',
+ '\u01E1': 'a',
+ '\u00E4': 'a',
+ '\u01DF': 'a',
+ '\u1EA3': 'a',
+ '\u00E5': 'a',
+ '\u01FB': 'a',
+ '\u01CE': 'a',
+ '\u0201': 'a',
+ '\u0203': 'a',
+ '\u1EA1': 'a',
+ '\u1EAD': 'a',
+ '\u1EB7': 'a',
+ '\u1E01': 'a',
+ '\u0105': 'a',
+ '\u2C65': 'a',
+ '\u0250': 'a',
+ '\uA733': 'aa',
+ '\u00E6': 'ae',
+ '\u01FD': 'ae',
+ '\u01E3': 'ae',
+ '\uA735': 'ao',
+ '\uA737': 'au',
+ '\uA739': 'av',
+ '\uA73B': 'av',
+ '\uA73D': 'ay',
+ '\u24D1': 'b',
+ '\uFF42': 'b',
+ '\u1E03': 'b',
+ '\u1E05': 'b',
+ '\u1E07': 'b',
+ '\u0180': 'b',
+ '\u0183': 'b',
+ '\u0253': 'b',
+ '\u24D2': 'c',
+ '\uFF43': 'c',
+ '\u0107': 'c',
+ '\u0109': 'c',
+ '\u010B': 'c',
+ '\u010D': 'c',
+ '\u00E7': 'c',
+ '\u1E09': 'c',
+ '\u0188': 'c',
+ '\u023C': 'c',
+ '\uA73F': 'c',
+ '\u2184': 'c',
+ '\u24D3': 'd',
+ '\uFF44': 'd',
+ '\u1E0B': 'd',
+ '\u010F': 'd',
+ '\u1E0D': 'd',
+ '\u1E11': 'd',
+ '\u1E13': 'd',
+ '\u1E0F': 'd',
+ '\u0111': 'd',
+ '\u018C': 'd',
+ '\u0256': 'd',
+ '\u0257': 'd',
+ '\uA77A': 'd',
+ '\u01F3': 'dz',
+ '\u01C6': 'dz',
+ '\u24D4': 'e',
+ '\uFF45': 'e',
+ '\u00E8': 'e',
+ '\u00E9': 'e',
+ '\u00EA': 'e',
+ '\u1EC1': 'e',
+ '\u1EBF': 'e',
+ '\u1EC5': 'e',
+ '\u1EC3': 'e',
+ '\u1EBD': 'e',
+ '\u0113': 'e',
+ '\u1E15': 'e',
+ '\u1E17': 'e',
+ '\u0115': 'e',
+ '\u0117': 'e',
+ '\u00EB': 'e',
+ '\u1EBB': 'e',
+ '\u011B': 'e',
+ '\u0205': 'e',
+ '\u0207': 'e',
+ '\u1EB9': 'e',
+ '\u1EC7': 'e',
+ '\u0229': 'e',
+ '\u1E1D': 'e',
+ '\u0119': 'e',
+ '\u1E19': 'e',
+ '\u1E1B': 'e',
+ '\u0247': 'e',
+ '\u025B': 'e',
+ '\u01DD': 'e',
+ '\u24D5': 'f',
+ '\uFF46': 'f',
+ '\u1E1F': 'f',
+ '\u0192': 'f',
+ '\uA77C': 'f',
+ '\u24D6': 'g',
+ '\uFF47': 'g',
+ '\u01F5': 'g',
+ '\u011D': 'g',
+ '\u1E21': 'g',
+ '\u011F': 'g',
+ '\u0121': 'g',
+ '\u01E7': 'g',
+ '\u0123': 'g',
+ '\u01E5': 'g',
+ '\u0260': 'g',
+ '\uA7A1': 'g',
+ '\u1D79': 'g',
+ '\uA77F': 'g',
+ '\u24D7': 'h',
+ '\uFF48': 'h',
+ '\u0125': 'h',
+ '\u1E23': 'h',
+ '\u1E27': 'h',
+ '\u021F': 'h',
+ '\u1E25': 'h',
+ '\u1E29': 'h',
+ '\u1E2B': 'h',
+ '\u1E96': 'h',
+ '\u0127': 'h',
+ '\u2C68': 'h',
+ '\u2C76': 'h',
+ '\u0265': 'h',
+ '\u0195': 'hv',
+ '\u24D8': 'i',
+ '\uFF49': 'i',
+ '\u00EC': 'i',
+ '\u00ED': 'i',
+ '\u00EE': 'i',
+ '\u0129': 'i',
+ '\u012B': 'i',
+ '\u012D': 'i',
+ '\u00EF': 'i',
+ '\u1E2F': 'i',
+ '\u1EC9': 'i',
+ '\u01D0': 'i',
+ '\u0209': 'i',
+ '\u020B': 'i',
+ '\u1ECB': 'i',
+ '\u012F': 'i',
+ '\u1E2D': 'i',
+ '\u0268': 'i',
+ '\u0131': 'i',
+ '\u24D9': 'j',
+ '\uFF4A': 'j',
+ '\u0135': 'j',
+ '\u01F0': 'j',
+ '\u0249': 'j',
+ '\u24DA': 'k',
+ '\uFF4B': 'k',
+ '\u1E31': 'k',
+ '\u01E9': 'k',
+ '\u1E33': 'k',
+ '\u0137': 'k',
+ '\u1E35': 'k',
+ '\u0199': 'k',
+ '\u2C6A': 'k',
+ '\uA741': 'k',
+ '\uA743': 'k',
+ '\uA745': 'k',
+ '\uA7A3': 'k',
+ '\u24DB': 'l',
+ '\uFF4C': 'l',
+ '\u0140': 'l',
+ '\u013A': 'l',
+ '\u013E': 'l',
+ '\u1E37': 'l',
+ '\u1E39': 'l',
+ '\u013C': 'l',
+ '\u1E3D': 'l',
+ '\u1E3B': 'l',
+ '\u017F': 'l',
+ '\u0142': 'l',
+ '\u019A': 'l',
+ '\u026B': 'l',
+ '\u2C61': 'l',
+ '\uA749': 'l',
+ '\uA781': 'l',
+ '\uA747': 'l',
+ '\u01C9': 'lj',
+ '\u24DC': 'm',
+ '\uFF4D': 'm',
+ '\u1E3F': 'm',
+ '\u1E41': 'm',
+ '\u1E43': 'm',
+ '\u0271': 'm',
+ '\u026F': 'm',
+ '\u24DD': 'n',
+ '\uFF4E': 'n',
+ '\u01F9': 'n',
+ '\u0144': 'n',
+ '\u00F1': 'n',
+ '\u1E45': 'n',
+ '\u0148': 'n',
+ '\u1E47': 'n',
+ '\u0146': 'n',
+ '\u1E4B': 'n',
+ '\u1E49': 'n',
+ '\u019E': 'n',
+ '\u0272': 'n',
+ '\u0149': 'n',
+ '\uA791': 'n',
+ '\uA7A5': 'n',
+ '\u01CC': 'nj',
+ '\u24DE': 'o',
+ '\uFF4F': 'o',
+ '\u00F2': 'o',
+ '\u00F3': 'o',
+ '\u00F4': 'o',
+ '\u1ED3': 'o',
+ '\u1ED1': 'o',
+ '\u1ED7': 'o',
+ '\u1ED5': 'o',
+ '\u00F5': 'o',
+ '\u1E4D': 'o',
+ '\u022D': 'o',
+ '\u1E4F': 'o',
+ '\u014D': 'o',
+ '\u1E51': 'o',
+ '\u1E53': 'o',
+ '\u014F': 'o',
+ '\u022F': 'o',
+ '\u0231': 'o',
+ '\u00F6': 'o',
+ '\u022B': 'o',
+ '\u1ECF': 'o',
+ '\u0151': 'o',
+ '\u01D2': 'o',
+ '\u020D': 'o',
+ '\u020F': 'o',
+ '\u01A1': 'o',
+ '\u1EDD': 'o',
+ '\u1EDB': 'o',
+ '\u1EE1': 'o',
+ '\u1EDF': 'o',
+ '\u1EE3': 'o',
+ '\u1ECD': 'o',
+ '\u1ED9': 'o',
+ '\u01EB': 'o',
+ '\u01ED': 'o',
+ '\u00F8': 'o',
+ '\u01FF': 'o',
+ '\u0254': 'o',
+ '\uA74B': 'o',
+ '\uA74D': 'o',
+ '\u0275': 'o',
+ '\u01A3': 'oi',
+ '\u0223': 'ou',
+ '\uA74F': 'oo',
+ '\u24DF': 'p',
+ '\uFF50': 'p',
+ '\u1E55': 'p',
+ '\u1E57': 'p',
+ '\u01A5': 'p',
+ '\u1D7D': 'p',
+ '\uA751': 'p',
+ '\uA753': 'p',
+ '\uA755': 'p',
+ '\u24E0': 'q',
+ '\uFF51': 'q',
+ '\u024B': 'q',
+ '\uA757': 'q',
+ '\uA759': 'q',
+ '\u24E1': 'r',
+ '\uFF52': 'r',
+ '\u0155': 'r',
+ '\u1E59': 'r',
+ '\u0159': 'r',
+ '\u0211': 'r',
+ '\u0213': 'r',
+ '\u1E5B': 'r',
+ '\u1E5D': 'r',
+ '\u0157': 'r',
+ '\u1E5F': 'r',
+ '\u024D': 'r',
+ '\u027D': 'r',
+ '\uA75B': 'r',
+ '\uA7A7': 'r',
+ '\uA783': 'r',
+ '\u24E2': 's',
+ '\uFF53': 's',
+ '\u00DF': 's',
+ '\u015B': 's',
+ '\u1E65': 's',
+ '\u015D': 's',
+ '\u1E61': 's',
+ '\u0161': 's',
+ '\u1E67': 's',
+ '\u1E63': 's',
+ '\u1E69': 's',
+ '\u0219': 's',
+ '\u015F': 's',
+ '\u023F': 's',
+ '\uA7A9': 's',
+ '\uA785': 's',
+ '\u1E9B': 's',
+ '\u24E3': 't',
+ '\uFF54': 't',
+ '\u1E6B': 't',
+ '\u1E97': 't',
+ '\u0165': 't',
+ '\u1E6D': 't',
+ '\u021B': 't',
+ '\u0163': 't',
+ '\u1E71': 't',
+ '\u1E6F': 't',
+ '\u0167': 't',
+ '\u01AD': 't',
+ '\u0288': 't',
+ '\u2C66': 't',
+ '\uA787': 't',
+ '\uA729': 'tz',
+ '\u24E4': 'u',
+ '\uFF55': 'u',
+ '\u00F9': 'u',
+ '\u00FA': 'u',
+ '\u00FB': 'u',
+ '\u0169': 'u',
+ '\u1E79': 'u',
+ '\u016B': 'u',
+ '\u1E7B': 'u',
+ '\u016D': 'u',
+ '\u00FC': 'u',
+ '\u01DC': 'u',
+ '\u01D8': 'u',
+ '\u01D6': 'u',
+ '\u01DA': 'u',
+ '\u1EE7': 'u',
+ '\u016F': 'u',
+ '\u0171': 'u',
+ '\u01D4': 'u',
+ '\u0215': 'u',
+ '\u0217': 'u',
+ '\u01B0': 'u',
+ '\u1EEB': 'u',
+ '\u1EE9': 'u',
+ '\u1EEF': 'u',
+ '\u1EED': 'u',
+ '\u1EF1': 'u',
+ '\u1EE5': 'u',
+ '\u1E73': 'u',
+ '\u0173': 'u',
+ '\u1E77': 'u',
+ '\u1E75': 'u',
+ '\u0289': 'u',
+ '\u24E5': 'v',
+ '\uFF56': 'v',
+ '\u1E7D': 'v',
+ '\u1E7F': 'v',
+ '\u028B': 'v',
+ '\uA75F': 'v',
+ '\u028C': 'v',
+ '\uA761': 'vy',
+ '\u24E6': 'w',
+ '\uFF57': 'w',
+ '\u1E81': 'w',
+ '\u1E83': 'w',
+ '\u0175': 'w',
+ '\u1E87': 'w',
+ '\u1E85': 'w',
+ '\u1E98': 'w',
+ '\u1E89': 'w',
+ '\u2C73': 'w',
+ '\u24E7': 'x',
+ '\uFF58': 'x',
+ '\u1E8B': 'x',
+ '\u1E8D': 'x',
+ '\u24E8': 'y',
+ '\uFF59': 'y',
+ '\u1EF3': 'y',
+ '\u00FD': 'y',
+ '\u0177': 'y',
+ '\u1EF9': 'y',
+ '\u0233': 'y',
+ '\u1E8F': 'y',
+ '\u00FF': 'y',
+ '\u1EF7': 'y',
+ '\u1E99': 'y',
+ '\u1EF5': 'y',
+ '\u01B4': 'y',
+ '\u024F': 'y',
+ '\u1EFF': 'y',
+ '\u24E9': 'z',
+ '\uFF5A': 'z',
+ '\u017A': 'z',
+ '\u1E91': 'z',
+ '\u017C': 'z',
+ '\u017E': 'z',
+ '\u1E93': 'z',
+ '\u1E95': 'z',
+ '\u01B6': 'z',
+ '\u0225': 'z',
+ '\u0240': 'z',
+ '\u2C6C': 'z',
+ '\uA763': 'z',
+ '\u0386': '\u0391',
+ '\u0388': '\u0395',
+ '\u0389': '\u0397',
+ '\u038A': '\u0399',
+ '\u03AA': '\u0399',
+ '\u038C': '\u039F',
+ '\u038E': '\u03A5',
+ '\u03AB': '\u03A5',
+ '\u038F': '\u03A9',
+ '\u03AC': '\u03B1',
+ '\u03AD': '\u03B5',
+ '\u03AE': '\u03B7',
+ '\u03AF': '\u03B9',
+ '\u03CA': '\u03B9',
+ '\u0390': '\u03B9',
+ '\u03CC': '\u03BF',
+ '\u03CD': '\u03C5',
+ '\u03CB': '\u03C5',
+ '\u03B0': '\u03C5',
+ '\u03C9': '\u03C9',
+ '\u03C2': '\u03C3'
+ };
+
+ return diacritics;
+});
+
+S2.define('select2/data/base',[
+ '../utils'
+], function (Utils) {
+ function BaseAdapter ($element, options) {
+ BaseAdapter.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(BaseAdapter, Utils.Observable);
+
+ BaseAdapter.prototype.current = function (callback) {
+ throw new Error('The `current` method must be defined in child classes.');
+ };
+
+ BaseAdapter.prototype.query = function (params, callback) {
+ throw new Error('The `query` method must be defined in child classes.');
+ };
+
+ BaseAdapter.prototype.bind = function (container, $container) {
+ // Can be implemented in subclasses
+ };
+
+ BaseAdapter.prototype.destroy = function () {
+ // Can be implemented in subclasses
+ };
+
+ BaseAdapter.prototype.generateResultId = function (container, data) {
+ var id = '';
+
+ if (container != null) {
+ id += container.id
+ } else {
+ id += Utils.generateChars(4);
+ }
+
+ id += '-result-';
+ id += Utils.generateChars(4);
+
+ if (data.id != null) {
+ id += '-' + data.id.toString();
+ } else {
+ id += '-' + Utils.generateChars(4);
+ }
+ return id;
+ };
+
+ return BaseAdapter;
+});
+
+S2.define('select2/data/select',[
+ './base',
+ '../utils',
+ 'jquery'
+], function (BaseAdapter, Utils, $) {
+ function SelectAdapter ($element, options) {
+ this.$element = $element;
+ this.options = options;
+
+ SelectAdapter.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(SelectAdapter, BaseAdapter);
+
+ SelectAdapter.prototype.current = function (callback) {
+ var data = [];
+ var self = this;
+
+ this.$element.find(':selected').each(function () {
+ var $option = $(this);
+
+ var option = self.item($option);
+
+ data.push(option);
+ });
+
+ callback(data);
+ };
+
+ SelectAdapter.prototype.select = function (data) {
+ var self = this;
+
+ data.selected = true;
+
+ // If data.element is a DOM node, use it instead
+ if ($(data.element).is('option')) {
+ data.element.selected = true;
+
+ this.$element.trigger('change');
+
+ return;
+ }
+
+ if (this.$element.prop('multiple')) {
+ this.current(function (currentData) {
+ var val = [];
+
+ data = [data];
+ data.push.apply(data, currentData);
+
+ for (var d = 0; d < data.length; d++) {
+ var id = data[d].id;
+
+ if ($.inArray(id, val) === -1) {
+ val.push(id);
+ }
+ }
+
+ self.$element.val(val);
+ self.$element.trigger('change');
+ });
+ } else {
+ var val = data.id;
+
+ this.$element.val(val);
+ this.$element.trigger('change');
+ }
+ };
+
+ SelectAdapter.prototype.unselect = function (data) {
+ var self = this;
+
+ if (!this.$element.prop('multiple')) {
+ return;
+ }
+
+ data.selected = false;
+
+ if ($(data.element).is('option')) {
+ data.element.selected = false;
+
+ this.$element.trigger('change');
+
+ return;
+ }
+
+ this.current(function (currentData) {
+ var val = [];
+
+ for (var d = 0; d < currentData.length; d++) {
+ var id = currentData[d].id;
+
+ if (id !== data.id && $.inArray(id, val) === -1) {
+ val.push(id);
+ }
+ }
+
+ self.$element.val(val);
+
+ self.$element.trigger('change');
+ });
+ };
+
+ SelectAdapter.prototype.bind = function (container, $container) {
+ var self = this;
+
+ this.container = container;
+
+ container.on('select', function (params) {
+ self.select(params.data);
+ });
+
+ container.on('unselect', function (params) {
+ self.unselect(params.data);
+ });
+ };
+
+ SelectAdapter.prototype.destroy = function () {
+ // Remove anything added to child elements
+ this.$element.find('*').each(function () {
+ // Remove any custom data set by Select2
+ $.removeData(this, 'data');
+ });
+ };
+
+ SelectAdapter.prototype.query = function (params, callback) {
+ var data = [];
+ var self = this;
+
+ var $options = this.$element.children();
+
+ $options.each(function () {
+ var $option = $(this);
+
+ if (!$option.is('option') && !$option.is('optgroup')) {
+ return;
+ }
+
+ var option = self.item($option);
+
+ var matches = self.matches(params, option);
+
+ if (matches !== null) {
+ data.push(matches);
+ }
+ });
+
+ callback({
+ results: data
+ });
+ };
+
+ SelectAdapter.prototype.addOptions = function ($options) {
+ Utils.appendMany(this.$element, $options);
+ };
+
+ SelectAdapter.prototype.option = function (data) {
+ var option;
+
+ if (data.children) {
+ option = document.createElement('optgroup');
+ option.label = data.text;
+ } else {
+ option = document.createElement('option');
+
+ if (option.textContent !== undefined) {
+ option.textContent = data.text;
+ } else {
+ option.innerText = data.text;
+ }
+ }
+
+ if (data.id !== undefined) {
+ option.value = data.id;
+ }
+
+ if (data.disabled) {
+ option.disabled = true;
+ }
+
+ if (data.selected) {
+ option.selected = true;
+ }
+
+ if (data.title) {
+ option.title = data.title;
+ }
+
+ var $option = $(option);
+
+ var normalizedData = this._normalizeItem(data);
+ normalizedData.element = option;
+
+ // Override the option's data with the combined data
+ $.data(option, 'data', normalizedData);
+
+ return $option;
+ };
+
+ SelectAdapter.prototype.item = function ($option) {
+ var data = {};
+
+ data = $.data($option[0], 'data');
+
+ if (data != null) {
+ return data;
+ }
+
+ if ($option.is('option')) {
+ data = {
+ id: $option.val(),
+ text: $option.text(),
+ disabled: $option.prop('disabled'),
+ selected: $option.prop('selected'),
+ title: $option.prop('title')
+ };
+ } else if ($option.is('optgroup')) {
+ data = {
+ text: $option.prop('label'),
+ children: [],
+ title: $option.prop('title')
+ };
+
+ var $children = $option.children('option');
+ var children = [];
+
+ for (var c = 0; c < $children.length; c++) {
+ var $child = $($children[c]);
+
+ var child = this.item($child);
+
+ children.push(child);
+ }
+
+ data.children = children;
+ }
+
+ data = this._normalizeItem(data);
+ data.element = $option[0];
+
+ $.data($option[0], 'data', data);
+
+ return data;
+ };
+
+ SelectAdapter.prototype._normalizeItem = function (item) {
+ if (!$.isPlainObject(item)) {
+ item = {
+ id: item,
+ text: item
+ };
+ }
+
+ item = $.extend({}, {
+ text: ''
+ }, item);
+
+ var defaults = {
+ selected: false,
+ disabled: false
+ };
+
+ if (item.id != null) {
+ item.id = item.id.toString();
+ }
+
+ if (item.text != null) {
+ item.text = item.text.toString();
+ }
+
+ if (item._resultId == null && item.id) {
+ item._resultId = this.generateResultId(this.container, item);
+ }
+
+ return $.extend({}, defaults, item);
+ };
+
+ SelectAdapter.prototype.matches = function (params, data) {
+ var matcher = this.options.get('matcher');
+
+ return matcher(params, data);
+ };
+
+ return SelectAdapter;
+});
+
+S2.define('select2/data/array',[
+ './select',
+ '../utils',
+ 'jquery'
+], function (SelectAdapter, Utils, $) {
+ function ArrayAdapter ($element, options) {
+ var data = options.get('data') || [];
+
+ ArrayAdapter.__super__.constructor.call(this, $element, options);
+
+ this.addOptions(this.convertToOptions(data));
+ }
+
+ Utils.Extend(ArrayAdapter, SelectAdapter);
+
+ ArrayAdapter.prototype.select = function (data) {
+ var $option = this.$element.find('option').filter(function (i, elm) {
+ return elm.value == data.id.toString();
+ });
+
+ if ($option.length === 0) {
+ $option = this.option(data);
+
+ this.addOptions($option);
+ }
+
+ ArrayAdapter.__super__.select.call(this, data);
+ };
+
+ ArrayAdapter.prototype.convertToOptions = function (data) {
+ var self = this;
+
+ var $existing = this.$element.find('option');
+ var existingIds = $existing.map(function () {
+ return self.item($(this)).id;
+ }).get();
+
+ var $options = [];
+
+ // Filter out all items except for the one passed in the argument
+ function onlyItem (item) {
+ return function () {
+ return $(this).val() == item.id;
+ };
+ }
+
+ for (var d = 0; d < data.length; d++) {
+ var item = this._normalizeItem(data[d]);
+
+ // Skip items which were pre-loaded, only merge the data
+ if ($.inArray(item.id, existingIds) >= 0) {
+ var $existingOption = $existing.filter(onlyItem(item));
+
+ var existingData = this.item($existingOption);
+ var newData = $.extend(true, {}, item, existingData);
+
+ var $newOption = this.option(newData);
+
+ $existingOption.replaceWith($newOption);
+
+ continue;
+ }
+
+ var $option = this.option(item);
+
+ if (item.children) {
+ var $children = this.convertToOptions(item.children);
+
+ Utils.appendMany($option, $children);
+ }
+
+ $options.push($option);
+ }
+
+ return $options;
+ };
+
+ return ArrayAdapter;
+});
+
+S2.define('select2/data/ajax',[
+ './array',
+ '../utils',
+ 'jquery'
+], function (ArrayAdapter, Utils, $) {
+ function AjaxAdapter ($element, options) {
+ this.ajaxOptions = this._applyDefaults(options.get('ajax'));
+
+ if (this.ajaxOptions.processResults != null) {
+ this.processResults = this.ajaxOptions.processResults;
+ }
+
+ AjaxAdapter.__super__.constructor.call(this, $element, options);
+ }
+
+ Utils.Extend(AjaxAdapter, ArrayAdapter);
+
+ AjaxAdapter.prototype._applyDefaults = function (options) {
+ var defaults = {
+ data: function (params) {
+ return $.extend({}, params, {
+ q: params.term
+ });
+ },
+ transport: function (params, success, failure) {
+ var $request = $.ajax(params);
+
+ $request.then(success);
+ $request.fail(failure);
+
+ return $request;
+ }
+ };
+
+ return $.extend({}, defaults, options, true);
+ };
+
+ AjaxAdapter.prototype.processResults = function (results) {
+ return results;
+ };
+
+ AjaxAdapter.prototype.query = function (params, callback) {
+ var matches = [];
+ var self = this;
+
+ if (this._request != null) {
+ // JSONP requests cannot always be aborted
+ if ($.isFunction(this._request.abort)) {
+ this._request.abort();
+ }
+
+ this._request = null;
+ }
+
+ var options = $.extend({
+ type: 'GET'
+ }, this.ajaxOptions);
+
+ if (typeof options.url === 'function') {
+ options.url = options.url.call(this.$element, params);
+ }
+
+ if (typeof options.data === 'function') {
+ options.data = options.data.call(this.$element, params);
+ }
+
+ function request () {
+ var $request = options.transport(options, function (data) {
+ var results = self.processResults(data, params);
+
+ if (self.options.get('debug') && window.console && console.error) {
+ // Check to make sure that the response included a `results` key.
+ if (!results || !results.results || !$.isArray(results.results)) {
+ console.error(
+ 'Select2: The AJAX results did not return an array in the ' +
+ '`results` key of the response.'
+ );
+ }
+ }
+
+ callback(results);
+ self.container.focusOnActiveElement();
+ }, function () {
+ // Attempt to detect if a request was aborted
+ // Only works if the transport exposes a status property
+ if ($request.status && $request.status === '0') {
+ return;
+ }
+
+ self.trigger('results:message', {
+ message: 'errorLoading'
+ });
+ });
+
+ self._request = $request;
+ }
+
+ if (this.ajaxOptions.delay && params.term != null) {
+ if (this._queryTimeout) {
+ window.clearTimeout(this._queryTimeout);
+ }
+
+ this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
+ } else {
+ request();
+ }
+ };
+
+ return AjaxAdapter;
+});
+
+S2.define('select2/data/tags',[
+ 'jquery'
+], function ($) {
+ function Tags (decorated, $element, options) {
+ var tags = options.get('tags');
+
+ var createTag = options.get('createTag');
+
+ if (createTag !== undefined) {
+ this.createTag = createTag;
+ }
+
+ var insertTag = options.get('insertTag');
+
+ if (insertTag !== undefined) {
+ this.insertTag = insertTag;
+ }
+
+ decorated.call(this, $element, options);
+
+ if ($.isArray(tags)) {
+ for (var t = 0; t < tags.length; t++) {
+ var tag = tags[t];
+ var item = this._normalizeItem(tag);
+
+ var $option = this.option(item);
+
+ this.$element.append($option);
+ }
+ }
+ }
+
+ Tags.prototype.query = function (decorated, params, callback) {
+ var self = this;
+
+ this._removeOldTags();
+
+ if (params.term == null || params.page != null) {
+ decorated.call(this, params, callback);
+ return;
+ }
+
+ function wrapper (obj, child) {
+ var data = obj.results;
+
+ for (var i = 0; i < data.length; i++) {
+ var option = data[i];
+
+ var checkChildren = (
+ option.children != null &&
+ !wrapper({
+ results: option.children
+ }, true)
+ );
+
+ var optionText = (option.text || '').toUpperCase();
+ var paramsTerm = (params.term || '').toUpperCase();
+
+ var checkText = optionText === paramsTerm;
+
+ if (checkText || checkChildren) {
+ if (child) {
+ return false;
+ }
+
+ obj.data = data;
+ callback(obj);
+
+ return;
+ }
+ }
+
+ if (child) {
+ return true;
+ }
+
+ var tag = self.createTag(params);
+
+ if (tag != null) {
+ var $option = self.option(tag);
+ $option.attr('data-select2-tag', true);
+
+ self.addOptions([$option]);
+
+ self.insertTag(data, tag);
+ }
+
+ obj.results = data;
+
+ callback(obj);
+ }
+
+ decorated.call(this, params, wrapper);
+ };
+
+ Tags.prototype.createTag = function (decorated, params) {
+ var term = $.trim(params.term);
+
+ if (term === '') {
+ return null;
+ }
+
+ return {
+ id: term,
+ text: term
+ };
+ };
+
+ Tags.prototype.insertTag = function (_, data, tag) {
+ data.unshift(tag);
+ };
+
+ Tags.prototype._removeOldTags = function (_) {
+ var tag = this._lastTag;
+
+ var $options = this.$element.find('option[data-select2-tag]');
+
+ $options.each(function () {
+ if (this.selected) {
+ return;
+ }
+
+ $(this).remove();
+ });
+ };
+
+ return Tags;
+});
+
+S2.define('select2/data/tokenizer',[
+ 'jquery'
+], function ($) {
+ function Tokenizer (decorated, $element, options) {
+ var tokenizer = options.get('tokenizer');
+
+ if (tokenizer !== undefined) {
+ this.tokenizer = tokenizer;
+ }
+
+ decorated.call(this, $element, options);
+ }
+
+ Tokenizer.prototype.bind = function (decorated, container, $container) {
+ decorated.call(this, container, $container);
+
+ this.$search = container.dropdown.$search || container.selection.$search ||
+ $container.find('.select2-search__field');
+ };
+
+ Tokenizer.prototype.query = function (decorated, params, callback) {
+ var self = this;
+
+ function createAndSelect (data) {
+ // Normalize the data object so we can use it for checks
+ var item = self._normalizeItem(data);
+
+ // Check if the data object already exists as a tag
+ // Select it if it doesn't
+ var $existingOptions = self.$element.find('option').filter(function () {
+ return $(this).val() === item.id;
+ });
+
+ // If an existing option wasn't found for it, create the option
+ if (!$existingOptions.length) {
+ var $option = self.option(item);
+ $option.attr('data-select2-tag', true);
+
+ self._removeOldTags();
+ self.addOptions([$option]);
+ }
+
+ // Select the item, now that we know there is an option for it
+ select(item);
+ }
+
+ function select (data) {
+ self.trigger('select', {
+ data: data
+ });
+ }
+
+ params.term = params.term || '';
+
+ var tokenData = this.tokenizer(params, this.options, createAndSelect);
+
+ if (tokenData.term !== params.term) {
+ // Replace the search term if we have the search box
+ if (this.$search.length) {
+ this.$search.val(tokenData.term);
+ this.$search.focus();
+ }
+
+ params.term = tokenData.term;
+ }
+
+ decorated.call(this, params, callback);
+ };
+
+ Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
+ var separators = options.get('tokenSeparators') || [];
+ var term = params.term;
+ var i = 0;
+
+ var createTag = this.createTag || function (params) {
+ return {
+ id: params.term,
+ text: params.term
+ };
+ };
+
+ while (i < term.length) {
+ var termChar = term[i];
+
+ if ($.inArray(termChar, separators) === -1) {
+ i++;
+
+ continue;
+ }
+
+ var part = term.substr(0, i);
+ var partParams = $.extend({}, params, {
+ term: part
+ });
+
+ var data = createTag(partParams);
+
+ if (data == null) {
+ i++;
+ continue;
+ }
+
+ callback(data);
+
+ // Reset the term to not include the tokenized portion
+ term = term.substr(i + 1) || '';
+ i = 0;
+ }
+
+ return {
+ term: term
+ };
+ };
+
+ return Tokenizer;
+});
+
+S2.define('select2/data/minimumInputLength',[
+
+], function () {
+ function MinimumInputLength (decorated, $e, options) {
+ this.minimumInputLength = options.get('minimumInputLength');
+
+ decorated.call(this, $e, options);
+ }
+
+ MinimumInputLength.prototype.query = function (decorated, params, callback) {
+ params.term = params.term || '';
+
+ if (params.term.length < this.minimumInputLength) {
+ this.trigger('results:message', {
+ message: 'inputTooShort',
+ args: {
+ minimum: this.minimumInputLength,
+ input: params.term,
+ params: params
+ }
+ });
+
+ return;
+ }
+
+ decorated.call(this, params, callback);
+ };
+
+ return MinimumInputLength;
+});
+
+S2.define('select2/data/maximumInputLength',[
+
+], function () {
+ function MaximumInputLength (decorated, $e, options) {
+ this.maximumInputLength = options.get('maximumInputLength');
+
+ decorated.call(this, $e, options);
+ }
+
+ MaximumInputLength.prototype.query = function (decorated, params, callback) {
+ params.term = params.term || '';
+
+ if (this.maximumInputLength > 0 &&
+ params.term.length > this.maximumInputLength) {
+ this.trigger('results:message', {
+ message: 'inputTooLong',
+ args: {
+ maximum: this.maximumInputLength,
+ input: params.term,
+ params: params
+ }
+ });
+
+ return;
+ }
+
+ decorated.call(this, params, callback);
+ };
+
+ return MaximumInputLength;
+});
+
+S2.define('select2/data/maximumSelectionLength',[
+
+], function (){
+ function MaximumSelectionLength (decorated, $e, options) {
+ this.maximumSelectionLength = options.get('maximumSelectionLength');
+
+ decorated.call(this, $e, options);
+ }
+
+ MaximumSelectionLength.prototype.query =
+ function (decorated, params, callback) {
+ var self = this;
+
+ this.current(function (currentData) {
+ var count = currentData != null ? currentData.length : 0;
+ if (self.maximumSelectionLength > 0 &&
+ count >= self.maximumSelectionLength) {
+ self.trigger('results:message', {
+ message: 'maximumSelected',
+ args: {
+ maximum: self.maximumSelectionLength
+ }
+ });
+ return;
+ }
+ decorated.call(self, params, callback);
+ });
+ };
+
+ return MaximumSelectionLength;
+});
+
+S2.define('select2/dropdown',[
+ 'jquery',
+ './utils'
+], function ($, Utils) {
+ function Dropdown ($element, options) {
+ this.$element = $element;
+ this.options = options;
+
+ Dropdown.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(Dropdown, Utils.Observable);
+
+ Dropdown.prototype.render = function () {
+ var $dropdown = $(
+ '' +
+ ' ' +
+ ' '
+ );
+
+ $dropdown.attr('dir', this.options.get('dir'));
+
+ this.$dropdown = $dropdown;
+
+ return $dropdown;
+ };
+
+ Dropdown.prototype.bind = function () {
+ // Should be implemented in subclasses
+ };
+
+ Dropdown.prototype.position = function ($dropdown, $container) {
+ // Should be implmented in subclasses
+ };
+
+ Dropdown.prototype.destroy = function () {
+ // Remove the dropdown from the DOM
+ this.$dropdown.remove();
+ };
+
+ return Dropdown;
+});
+
+S2.define('select2/dropdown/search',[
+ 'jquery',
+ '../utils'
+], function ($, Utils) {
+ function Search () { }
+
+ Search.prototype.render = function (decorated) {
+ var $rendered = decorated.call(this);
+
+ var $search = $(
+ '' +
+ ' ' +
+ ' '
+ );
+
+ this.$searchContainer = $search;
+ this.$search = $search.find('input');
+
+ $rendered.prepend($search);
+
+ return $rendered;
+ };
+
+ Search.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+ var resultsId = container.id + '-results';
+
+ decorated.call(this, container, $container);
+
+ this.$search.on('keydown', function (evt) {
+ self.trigger('keypress', evt);
+
+ self._keyUpPrevented = evt.isDefaultPrevented();
+ });
+
+ // Workaround for browsers which do not support the `input` event
+ // This will prevent double-triggering of events for browsers which support
+ // both the `keyup` and `input` events.
+ this.$search.on('input', function (evt) {
+ // Unbind the duplicated `keyup` event
+ $(this).off('keyup');
+ });
+
+ this.$search.on('keyup input', function (evt) {
+ self.handleSearch(evt);
+ });
+
+ container.on('open', function () {
+ self.$search.attr('tabindex', 0);
+ self.$search.attr('aria-owns', resultsId);
+ self.$search.focus();
+
+ window.setTimeout(function () {
+ self.$search.focus();
+ }, 0);
+ });
+
+ container.on('close', function () {
+ self.$search.attr('tabindex', -1);
+ self.$search.removeAttr('aria-activedescendant');
+ self.$search.removeAttr('aria-owns');
+ self.$search.val('');
+ });
+
+ container.on('focus', function () {
+ if (container.isOpen()) {
+ self.$search.focus();
+ }
+ });
+
+ container.on('results:all', function (params) {
+ if (params.query.term == null || params.query.term === '') {
+ var showSearch = self.showSearch(params);
+
+ if (showSearch) {
+ self.$searchContainer.removeClass('select2-search--hide');
+ } else {
+ self.$searchContainer.addClass('select2-search--hide');
+ }
+ }
+ });
+
+ container.on('results:focus', function (params) {
+ self.$search.attr('aria-activedescendant', params.data._resultId);
+ });
+ };
+
+ Search.prototype.handleSearch = function (evt) {
+ if (!this._keyUpPrevented) {
+ var input = this.$search.val();
+
+ this.trigger('query', {
+ term: input
+ });
+ }
+
+ this._keyUpPrevented = false;
+ };
+
+ Search.prototype.showSearch = function (_, params) {
+ return true;
+ };
+
+ return Search;
+});
+
+S2.define('select2/dropdown/hidePlaceholder',[
+
+], function () {
+ function HidePlaceholder (decorated, $element, options, dataAdapter) {
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
+
+ decorated.call(this, $element, options, dataAdapter);
+ }
+
+ HidePlaceholder.prototype.append = function (decorated, data) {
+ data.results = this.removePlaceholder(data.results);
+
+ decorated.call(this, data);
+ };
+
+ HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
+ if (typeof placeholder === 'string') {
+ placeholder = {
+ id: '',
+ text: placeholder
+ };
+ }
+
+ return placeholder;
+ };
+
+ HidePlaceholder.prototype.removePlaceholder = function (_, data) {
+ var modifiedData = data.slice(0);
+
+ for (var d = data.length - 1; d >= 0; d--) {
+ var item = data[d];
+
+ if (this.placeholder.id === item.id) {
+ modifiedData.splice(d, 1);
+ }
+ }
+
+ return modifiedData;
+ };
+
+ return HidePlaceholder;
+});
+
+S2.define('select2/dropdown/infiniteScroll',[
+ 'jquery'
+], function ($) {
+ function InfiniteScroll (decorated, $element, options, dataAdapter) {
+ this.lastParams = {};
+
+ decorated.call(this, $element, options, dataAdapter);
+
+ this.$loadingMore = this.createLoadingMore();
+ this.loading = false;
+ }
+
+ InfiniteScroll.prototype.append = function (decorated, data) {
+ this.$loadingMore.remove();
+ this.loading = false;
+
+ decorated.call(this, data);
+
+ if (this.showLoadingMore(data)) {
+ this.$results.append(this.$loadingMore);
+ }
+ };
+
+ InfiniteScroll.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('query', function (params) {
+ self.lastParams = params;
+ self.loading = true;
+ });
+
+ container.on('query:append', function (params) {
+ self.lastParams = params;
+ self.loading = true;
+ });
+
+ this.$results.on('scroll', function () {
+ var isLoadMoreVisible = $.contains(
+ document.documentElement,
+ self.$loadingMore[0]
+ );
+
+ if (self.loading || !isLoadMoreVisible) {
+ return;
+ }
+
+ var currentOffset = self.$results.offset().top +
+ self.$results.outerHeight(false);
+ var loadingMoreOffset = self.$loadingMore.offset().top +
+ self.$loadingMore.outerHeight(false);
+
+ if (currentOffset + 50 >= loadingMoreOffset) {
+ self.loadMore();
+ }
+ });
+ };
+
+ InfiniteScroll.prototype.loadMore = function () {
+ this.loading = true;
+
+ var params = $.extend({}, {page: 1}, this.lastParams);
+
+ params.page++;
+
+ this.trigger('query:append', params);
+ };
+
+ InfiniteScroll.prototype.showLoadingMore = function (_, data) {
+ return data.pagination && data.pagination.more;
+ };
+
+ InfiniteScroll.prototype.createLoadingMore = function () {
+ var $option = $(
+ ' '
+ );
+
+ var message = this.options.get('translations').get('loadingMore');
+
+ $option.html(message(this.lastParams));
+
+ return $option;
+ };
+
+ return InfiniteScroll;
+});
+
+S2.define('select2/dropdown/attachBody',[
+ 'jquery',
+ '../utils'
+], function ($, Utils) {
+ function AttachBody (decorated, $element, options) {
+ this.$dropdownParent = options.get('dropdownParent') || $(document.body);
+
+ decorated.call(this, $element, options);
+ }
+
+ AttachBody.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ var setupResultsEvents = false;
+
+ decorated.call(this, container, $container);
+
+ container.on('open', function () {
+ self._showDropdown();
+ self._attachPositioningHandler(container);
+
+ if (!setupResultsEvents) {
+ setupResultsEvents = true;
+
+ container.on('results:all', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ container.on('results:append', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+ }
+ });
+
+ container.on('close', function () {
+ self._hideDropdown();
+ self._detachPositioningHandler(container);
+ });
+
+ this.$dropdownContainer.on('mousedown', function (evt) {
+ evt.stopPropagation();
+ });
+ };
+
+ AttachBody.prototype.destroy = function (decorated) {
+ decorated.call(this);
+
+ this.$dropdownContainer.remove();
+ };
+
+ AttachBody.prototype.position = function (decorated, $dropdown, $container) {
+ // Clone all of the container classes
+ $dropdown.attr('class', $container.attr('class'));
+
+ $dropdown.removeClass('select2');
+ $dropdown.addClass('select2-container--open');
+
+ $dropdown.css({
+ position: 'absolute',
+ top: -999999
+ });
+
+ this.$container = $container;
+ };
+
+ AttachBody.prototype.render = function (decorated) {
+ var $container = $(' ');
+
+ var $dropdown = decorated.call(this);
+ $container.append($dropdown);
+
+ this.$dropdownContainer = $container;
+
+ return $container;
+ };
+
+ AttachBody.prototype._hideDropdown = function (decorated) {
+ this.$dropdownContainer.detach();
+ };
+
+ AttachBody.prototype._attachPositioningHandler =
+ function (decorated, container) {
+ var self = this;
+
+ var scrollEvent = 'scroll.select2.' + container.id;
+ var resizeEvent = 'resize.select2.' + container.id;
+ var orientationEvent = 'orientationchange.select2.' + container.id;
+
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
+ $watchers.each(function () {
+ $(this).data('select2-scroll-position', {
+ x: $(this).scrollLeft(),
+ y: $(this).scrollTop()
+ });
+ });
+
+ $watchers.on(scrollEvent, function (ev) {
+ var position = $(this).data('select2-scroll-position');
+ $(this).scrollTop(position.y);
+ });
+
+ $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
+ function (e) {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+ };
+
+ AttachBody.prototype._detachPositioningHandler =
+ function (decorated, container) {
+ var scrollEvent = 'scroll.select2.' + container.id;
+ var resizeEvent = 'resize.select2.' + container.id;
+ var orientationEvent = 'orientationchange.select2.' + container.id;
+
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
+ $watchers.off(scrollEvent);
+
+ $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
+ };
+
+ AttachBody.prototype._positionDropdown = function () {
+ var $window = $(window);
+
+ var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
+ var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
+
+ var newDirection = null;
+
+ var offset = this.$container.offset();
+
+ offset.bottom = offset.top + this.$container.outerHeight(false);
+
+ var container = {
+ height: this.$container.outerHeight(false)
+ };
+
+ container.top = offset.top;
+ container.bottom = offset.top + container.height;
+
+ var dropdown = {
+ height: this.$dropdown.outerHeight(false)
+ };
+
+ var viewport = {
+ top: $window.scrollTop(),
+ bottom: $window.scrollTop() + $window.height()
+ };
+
+ var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
+ var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
+
+ var css = {
+ left: offset.left,
+ top: container.bottom
+ };
+
+ // Determine what the parent element is to use for calciulating the offset
+ var $offsetParent = this.$dropdownParent;
+
+ // For statically positoned elements, we need to get the element
+ // that is determining the offset
+ if ($offsetParent.css('position') === 'static') {
+ $offsetParent = $offsetParent.offsetParent();
+ }
+
+ var parentOffset = $offsetParent.offset();
+
+ css.top -= parentOffset.top;
+ css.left -= parentOffset.left;
+
+ if (!isCurrentlyAbove && !isCurrentlyBelow) {
+ newDirection = 'below';
+ }
+
+ if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
+ newDirection = 'above';
+ } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
+ newDirection = 'below';
+ }
+
+ if (newDirection == 'above' ||
+ (isCurrentlyAbove && newDirection !== 'below')) {
+ css.top = container.top - parentOffset.top - dropdown.height;
+ }
+
+ if (newDirection != null) {
+ this.$dropdown
+ .removeClass('select2-dropdown--below select2-dropdown--above')
+ .addClass('select2-dropdown--' + newDirection);
+ this.$container
+ .removeClass('select2-container--below select2-container--above')
+ .addClass('select2-container--' + newDirection);
+ }
+
+ this.$dropdownContainer.css(css);
+ };
+
+ AttachBody.prototype._resizeDropdown = function () {
+ var css = {
+ width: this.$container.outerWidth(false) + 'px'
+ };
+
+ if (this.options.get('dropdownAutoWidth')) {
+ css.minWidth = css.width;
+ css.position = 'relative';
+ css.width = 'auto';
+ }
+
+ this.$dropdown.css(css);
+ };
+
+ AttachBody.prototype._showDropdown = function (decorated) {
+ this.$dropdownContainer.appendTo(this.$dropdownParent);
+
+ this._positionDropdown();
+ this._resizeDropdown();
+ };
+
+ return AttachBody;
+});
+
+S2.define('select2/dropdown/minimumResultsForSearch',[
+
+], function () {
+ function countResults (data) {
+ var count = 0;
+
+ for (var d = 0; d < data.length; d++) {
+ var item = data[d];
+
+ if (item.children) {
+ count += countResults(item.children);
+ } else {
+ count++;
+ }
+ }
+
+ return count;
+ }
+
+ function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
+ this.minimumResultsForSearch = options.get('minimumResultsForSearch');
+
+ if (this.minimumResultsForSearch < 0) {
+ this.minimumResultsForSearch = Infinity;
+ }
+
+ decorated.call(this, $element, options, dataAdapter);
+ }
+
+ MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
+ if (countResults(params.data.results) < this.minimumResultsForSearch) {
+ return false;
+ }
+
+ return decorated.call(this, params);
+ };
+
+ return MinimumResultsForSearch;
+});
+
+S2.define('select2/dropdown/selectOnClose',[
+
+], function () {
+ function SelectOnClose () { }
+
+ SelectOnClose.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('close', function (params) {
+ self._handleSelectOnClose(params);
+ });
+ };
+
+ SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
+ if (params && params.originalSelect2Event != null) {
+ var event = params.originalSelect2Event;
+
+ // Don't select an item if the close event was triggered from a select or
+ // unselect event
+ if (event._type === 'select' || event._type === 'unselect') {
+ return;
+ }
+ }
+
+ var $highlightedResults = this.getHighlightedResults();
+
+ // Only select highlighted results
+ if ($highlightedResults.length < 1) {
+ return;
+ }
+
+ var data = $highlightedResults.data('data');
+
+ // Don't re-select already selected resulte
+ if (
+ (data.element != null && data.element.selected) ||
+ (data.element == null && data.selected)
+ ) {
+ return;
+ }
+
+ this.trigger('select', {
+ data: data
+ });
+ };
+
+ return SelectOnClose;
+});
+
+S2.define('select2/dropdown/closeOnSelect',[
+
+], function () {
+ function CloseOnSelect () { }
+
+ CloseOnSelect.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('select', function (evt) {
+ self._selectTriggered(evt);
+ });
+
+ container.on('unselect', function (evt) {
+ self._selectTriggered(evt);
+ });
+ };
+
+ CloseOnSelect.prototype._selectTriggered = function (_, evt) {
+ var originalEvent = evt.originalEvent;
+
+ // Don't close if the control key is being held
+ if (originalEvent && originalEvent.ctrlKey) {
+ return;
+ }
+
+ this.trigger('close', {
+ originalEvent: originalEvent,
+ originalSelect2Event: evt
+ });
+ };
+
+ return CloseOnSelect;
+});
+
+S2.define('select2/i18n/en',[],function () {
+ // English
+ return {
+ errorLoading: function () {
+ return 'The results could not be loaded.';
+ },
+ inputTooLong: function (args) {
+ var overChars = args.input.length - args.maximum;
+
+ var message = 'Please delete ' + overChars + ' character';
+
+ if (overChars != 1) {
+ message += 's';
+ }
+
+ return message;
+ },
+ inputTooShort: function (args) {
+ var remainingChars = args.minimum - args.input.length;
+
+ var message = 'Please enter ' + remainingChars + ' or more characters';
+
+ return message;
+ },
+ loadingMore: function () {
+ return 'Loading more results…';
+ },
+ maximumSelected: function (args) {
+ var message = 'You can only select ' + args.maximum + ' item';
+
+ if (args.maximum != 1) {
+ message += 's';
+ }
+
+ return message;
+ },
+ noResults: function () {
+ return 'No results found';
+ },
+ searching: function () {
+ return 'Searching…';
+ }
+ };
+});
+
+S2.define('select2/defaults',[
+ 'jquery',
+ 'require',
+
+ './results',
+
+ './selection/single',
+ './selection/multiple',
+ './selection/placeholder',
+ './selection/allowClear',
+ './selection/search',
+ './selection/eventRelay',
+
+ './utils',
+ './translation',
+ './diacritics',
+
+ './data/select',
+ './data/array',
+ './data/ajax',
+ './data/tags',
+ './data/tokenizer',
+ './data/minimumInputLength',
+ './data/maximumInputLength',
+ './data/maximumSelectionLength',
+
+ './dropdown',
+ './dropdown/search',
+ './dropdown/hidePlaceholder',
+ './dropdown/infiniteScroll',
+ './dropdown/attachBody',
+ './dropdown/minimumResultsForSearch',
+ './dropdown/selectOnClose',
+ './dropdown/closeOnSelect',
+
+ './i18n/en'
+], function ($, require,
+
+ ResultsList,
+
+ SingleSelection, MultipleSelection, Placeholder, AllowClear,
+ SelectionSearch, EventRelay,
+
+ Utils, Translation, DIACRITICS,
+
+ SelectData, ArrayData, AjaxData, Tags, Tokenizer,
+ MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
+
+ Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
+ AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
+
+ EnglishTranslation) {
+ function Defaults () {
+ this.reset();
+ }
+
+ Defaults.prototype.apply = function (options) {
+ options = $.extend(true, {}, this.defaults, options);
+
+ if (options.dataAdapter == null) {
+ if (options.ajax != null) {
+ options.dataAdapter = AjaxData;
+ } else if (options.data != null) {
+ options.dataAdapter = ArrayData;
+ } else {
+ options.dataAdapter = SelectData;
+ }
+
+ if (options.minimumInputLength > 0) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ MinimumInputLength
+ );
+ }
+
+ if (options.maximumInputLength > 0) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ MaximumInputLength
+ );
+ }
+
+ if (options.maximumSelectionLength > 0) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ MaximumSelectionLength
+ );
+ }
+
+ if (options.tags) {
+ options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
+ }
+
+ if (options.tokenSeparators != null || options.tokenizer != null) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ Tokenizer
+ );
+ }
+
+ if (options.query != null) {
+ var Query = require(options.amdBase + 'compat/query');
+
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ Query
+ );
+ }
+
+ if (options.initSelection != null) {
+ var InitSelection = require(options.amdBase + 'compat/initSelection');
+
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ InitSelection
+ );
+ }
+ }
+
+ if (options.resultsAdapter == null) {
+ options.resultsAdapter = ResultsList;
+
+ if (options.ajax != null) {
+ options.resultsAdapter = Utils.Decorate(
+ options.resultsAdapter,
+ InfiniteScroll
+ );
+ }
+
+ if (options.placeholder != null) {
+ options.resultsAdapter = Utils.Decorate(
+ options.resultsAdapter,
+ HidePlaceholder
+ );
+ }
+
+ if (options.selectOnClose) {
+ options.resultsAdapter = Utils.Decorate(
+ options.resultsAdapter,
+ SelectOnClose
+ );
+ }
+ }
+
+ if (options.dropdownAdapter == null) {
+ if (options.multiple) {
+ options.dropdownAdapter = Dropdown;
+ } else {
+ var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
+
+ options.dropdownAdapter = SearchableDropdown;
+ }
+
+ if (options.minimumResultsForSearch !== 0) {
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ MinimumResultsForSearch
+ );
+ }
+
+ if (options.closeOnSelect) {
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ CloseOnSelect
+ );
+ }
+
+ if (
+ options.dropdownCssClass != null ||
+ options.dropdownCss != null ||
+ options.adaptDropdownCssClass != null
+ ) {
+ var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
+
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ DropdownCSS
+ );
+ }
+
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ AttachBody
+ );
+ }
+
+ if (options.selectionAdapter == null) {
+ if (options.multiple) {
+ options.selectionAdapter = MultipleSelection;
+ } else {
+ options.selectionAdapter = SingleSelection;
+ }
+
+ // Add the placeholder mixin if a placeholder was specified
+ if (options.placeholder != null) {
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ Placeholder
+ );
+ }
+
+ if (options.allowClear) {
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ AllowClear
+ );
+ }
+
+ if (options.multiple) {
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ SelectionSearch
+ );
+ }
+
+ if (
+ options.containerCssClass != null ||
+ options.containerCss != null ||
+ options.adaptContainerCssClass != null
+ ) {
+ var ContainerCSS = require(options.amdBase + 'compat/containerCss');
+
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ ContainerCSS
+ );
+ }
+
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ EventRelay
+ );
+ }
+
+ if (typeof options.language === 'string') {
+ // Check if the language is specified with a region
+ if (options.language.indexOf('-') > 0) {
+ // Extract the region information if it is included
+ var languageParts = options.language.split('-');
+ var baseLanguage = languageParts[0];
+
+ options.language = [options.language, baseLanguage];
+ } else {
+ options.language = [options.language];
+ }
+ }
+
+ if ($.isArray(options.language)) {
+ var languages = new Translation();
+ options.language.push('en');
+
+ var languageNames = options.language;
+
+ for (var l = 0; l < languageNames.length; l++) {
+ var name = languageNames[l];
+ var language = {};
+
+ try {
+ // Try to load it with the original name
+ language = Translation.loadPath(name);
+ } catch (e) {
+ try {
+ // If we couldn't load it, check if it wasn't the full path
+ name = this.defaults.amdLanguageBase + name;
+ language = Translation.loadPath(name);
+ } catch (ex) {
+ // The translation could not be loaded at all. Sometimes this is
+ // because of a configuration problem, other times this can be
+ // because of how Select2 helps load all possible translation files.
+ if (options.debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The language file for "' + name + '" could not be ' +
+ 'automatically loaded. A fallback will be used instead.'
+ );
+ }
+
+ continue;
+ }
+ }
+
+ languages.extend(language);
+ }
+
+ options.translations = languages;
+ } else {
+ var baseTranslation = Translation.loadPath(
+ this.defaults.amdLanguageBase + 'en'
+ );
+ var customTranslation = new Translation(options.language);
+
+ customTranslation.extend(baseTranslation);
+
+ options.translations = customTranslation;
+ }
+
+ return options;
+ };
+
+ Defaults.prototype.reset = function () {
+ function stripDiacritics (text) {
+ // Used 'uni range + named function' from http://jsperf.com/diacritics/18
+ function match(a) {
+ return DIACRITICS[a] || a;
+ }
+
+ return text.replace(/[^\u0000-\u007E]/g, match);
+ }
+
+ function matcher (params, data) {
+ // Always return the object if there is nothing to compare
+ if ($.trim(params.term) === '') {
+ return data;
+ }
+
+ // Do a recursive check for options with children
+ if (data.children && data.children.length > 0) {
+ // Clone the data object if there are children
+ // This is required as we modify the object to remove any non-matches
+ var match = $.extend(true, {}, data);
+
+ // Check each child of the option
+ for (var c = data.children.length - 1; c >= 0; c--) {
+ var child = data.children[c];
+
+ var matches = matcher(params, child);
+
+ // If there wasn't a match, remove the object in the array
+ if (matches == null) {
+ match.children.splice(c, 1);
+ }
+ }
+
+ // If any children matched, return the new object
+ if (match.children.length > 0) {
+ return match;
+ }
+
+ // If there were no matching children, check just the plain object
+ return matcher(params, match);
+ }
+
+ var original = stripDiacritics(data.text).toUpperCase();
+ var term = stripDiacritics(params.term).toUpperCase();
+
+ // Check if the text contains the term
+ if (original.indexOf(term) > -1) {
+ return data;
+ }
+
+ // If it doesn't contain the term, don't return anything
+ return null;
+ }
+
+ this.defaults = {
+ amdBase: './',
+ amdLanguageBase: './i18n/',
+ closeOnSelect: true,
+ debug: false,
+ dropdownAutoWidth: false,
+ escapeMarkup: Utils.escapeMarkup,
+ language: EnglishTranslation,
+ matcher: matcher,
+ minimumInputLength: 0,
+ maximumInputLength: 0,
+ maximumSelectionLength: 0,
+ minimumResultsForSearch: 0,
+ selectOnClose: false,
+ sorter: function (data) {
+ return data;
+ },
+ templateResult: function (result) {
+ return result.text;
+ },
+ templateSelection: function (selection) {
+ return selection.text;
+ },
+ theme: 'default',
+ width: 'resolve'
+ };
+ };
+
+ Defaults.prototype.set = function (key, value) {
+ var camelKey = $.camelCase(key);
+
+ var data = {};
+ data[camelKey] = value;
+
+ var convertedData = Utils._convertData(data);
+
+ $.extend(this.defaults, convertedData);
+ };
+
+ var defaults = new Defaults();
+
+ return defaults;
+});
+
+S2.define('select2/options',[
+ 'require',
+ 'jquery',
+ './defaults',
+ './utils'
+], function (require, $, Defaults, Utils) {
+ function Options (options, $element) {
+ this.options = options;
+
+ if ($element != null) {
+ this.fromElement($element);
+ }
+
+ this.options = Defaults.apply(this.options);
+
+ if ($element && $element.is('input')) {
+ var InputCompat = require(this.get('amdBase') + 'compat/inputData');
+
+ this.options.dataAdapter = Utils.Decorate(
+ this.options.dataAdapter,
+ InputCompat
+ );
+ }
+ }
+
+ Options.prototype.fromElement = function ($e) {
+ var excludedData = ['select2'];
+
+ if (this.options.multiple == null) {
+ this.options.multiple = $e.prop('multiple');
+ }
+
+ if (this.options.disabled == null) {
+ this.options.disabled = $e.prop('disabled');
+ }
+
+ if (this.options.language == null) {
+ if ($e.prop('lang')) {
+ this.options.language = $e.prop('lang').toLowerCase();
+ } else if ($e.closest('[lang]').prop('lang')) {
+ this.options.language = $e.closest('[lang]').prop('lang');
+ }
+ }
+
+ if (this.options.dir == null) {
+ if ($e.prop('dir')) {
+ this.options.dir = $e.prop('dir');
+ } else if ($e.closest('[dir]').prop('dir')) {
+ this.options.dir = $e.closest('[dir]').prop('dir');
+ } else {
+ this.options.dir = 'ltr';
+ }
+ }
+
+ $e.prop('disabled', this.options.disabled);
+ $e.prop('multiple', this.options.multiple);
+
+ if ($e.data('select2Tags')) {
+ if (this.options.debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `data-select2-tags` attribute has been changed to ' +
+ 'use the `data-data` and `data-tags="true"` attributes and will be ' +
+ 'removed in future versions of Select2.'
+ );
+ }
+
+ $e.data('data', $e.data('select2Tags'));
+ $e.data('tags', true);
+ }
+
+ if ($e.data('ajaxUrl')) {
+ if (this.options.debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `data-ajax-url` attribute has been changed to ' +
+ '`data-ajax--url` and support for the old attribute will be removed' +
+ ' in future versions of Select2.'
+ );
+ }
+
+ $e.attr('ajax--url', $e.data('ajaxUrl'));
+ $e.data('ajax--url', $e.data('ajaxUrl'));
+ }
+
+ var dataset = {};
+
+ // Prefer the element's `dataset` attribute if it exists
+ // jQuery 1.x does not correctly handle data attributes with multiple dashes
+ if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
+ dataset = $.extend(true, {}, $e[0].dataset, $e.data());
+ } else {
+ dataset = $e.data();
+ }
+
+ var data = $.extend(true, {}, dataset);
+
+ data = Utils._convertData(data);
+
+ for (var key in data) {
+ if ($.inArray(key, excludedData) > -1) {
+ continue;
+ }
+
+ if ($.isPlainObject(this.options[key])) {
+ $.extend(this.options[key], data[key]);
+ } else {
+ this.options[key] = data[key];
+ }
+ }
+
+ return this;
+ };
+
+ Options.prototype.get = function (key) {
+ return this.options[key];
+ };
+
+ Options.prototype.set = function (key, val) {
+ this.options[key] = val;
+ };
+
+ return Options;
+});
+
+S2.define('select2/core',[
+ 'jquery',
+ './options',
+ './utils',
+ './keys'
+], function ($, Options, Utils, KEYS) {
+ var Select2 = function ($element, options) {
+ if ($element.data('select2') != null) {
+ $element.data('select2').destroy();
+ }
+
+ this.$element = $element;
+
+ this.id = this._generateId($element);
+
+ options = options || {};
+
+ this.options = new Options(options, $element);
+
+ Select2.__super__.constructor.call(this);
+
+ // Set up the tabindex
+
+ var tabindex = $element.attr('tabindex') || 0;
+ $element.data('old-tabindex', tabindex);
+ $element.attr('tabindex', '-1');
+
+ // Set up containers and adapters
+
+ var DataAdapter = this.options.get('dataAdapter');
+ this.dataAdapter = new DataAdapter($element, this.options);
+
+ var $container = this.render();
+
+ this._placeContainer($container);
+
+ var SelectionAdapter = this.options.get('selectionAdapter');
+ this.selection = new SelectionAdapter($element, this.options);
+ this.$selection = this.selection.render();
+
+ this.selection.position(this.$selection, $container);
+
+ var DropdownAdapter = this.options.get('dropdownAdapter');
+ this.dropdown = new DropdownAdapter($element, this.options);
+ this.$dropdown = this.dropdown.render();
+
+ this.dropdown.position(this.$dropdown, $container);
+
+ var ResultsAdapter = this.options.get('resultsAdapter');
+ this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
+ this.$results = this.results.render();
+
+ this.results.position(this.$results, this.$dropdown);
+
+ // Bind events
+
+ var self = this;
+
+ // Bind the container to all of the adapters
+ this._bindAdapters();
+
+ // Register any DOM event handlers
+ this._registerDomEvents();
+
+ // Register any internal event handlers
+ this._registerDataEvents();
+ this._registerSelectionEvents();
+ this._registerDropdownEvents();
+ this._registerResultsEvents();
+ this._registerEvents();
+
+ // Set the initial state
+ this.dataAdapter.current(function (initialData) {
+ self.trigger('selection:update', {
+ data: initialData
+ });
+ });
+
+ // Hide the original select
+ $element.addClass('select2-hidden-accessible');
+ $element.attr('aria-hidden', 'true');
+
+ // Synchronize any monitored attributes
+ this._syncAttributes();
+
+ $element.data('select2', this);
+ };
+
+ Utils.Extend(Select2, Utils.Observable);
+
+ Select2.prototype._generateId = function ($element) {
+ var id = '';
+
+ if ($element.attr('id') != null) {
+ id = $element.attr('id');
+ } else if ($element.attr('name') != null) {
+ id = $element.attr('name') + '-' + Utils.generateChars(2);
+ } else {
+ id = Utils.generateChars(4);
+ }
+
+ id = id.replace(/(:|\.|\[|\]|,)/g, '');
+ id = 'select2-' + id;
+
+ return id;
+ };
+
+ Select2.prototype._placeContainer = function ($container) {
+ $container.insertAfter(this.$element);
+
+ var width = this._resolveWidth(this.$element, this.options.get('width'));
+
+ if (width != null) {
+ $container.css('width', width);
+ }
+ };
+
+ Select2.prototype._resolveWidth = function ($element, method) {
+ var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
+
+ if (method == 'resolve') {
+ var styleWidth = this._resolveWidth($element, 'style');
+
+ if (styleWidth != null) {
+ return styleWidth;
+ }
+
+ return this._resolveWidth($element, 'element');
+ }
+
+ if (method == 'element') {
+ var elementWidth = $element.outerWidth(false);
+
+ if (elementWidth <= 0) {
+ return 'auto';
+ }
+
+ return elementWidth + 'px';
+ }
+
+ if (method == 'style') {
+ var style = $element.attr('style');
+
+ if (typeof(style) !== 'string') {
+ return null;
+ }
+
+ var attrs = style.split(';');
+
+ for (var i = 0, l = attrs.length; i < l; i = i + 1) {
+ var attr = attrs[i].replace(/\s/g, '');
+ var matches = attr.match(WIDTH);
+
+ if (matches !== null && matches.length >= 1) {
+ return matches[1];
+ }
+ }
+
+ return null;
+ }
+
+ return method;
+ };
+
+ Select2.prototype._bindAdapters = function () {
+ this.dataAdapter.bind(this, this.$container);
+ this.selection.bind(this, this.$container);
+
+ this.dropdown.bind(this, this.$container);
+ this.results.bind(this, this.$container);
+ };
+
+ Select2.prototype._registerDomEvents = function () {
+ var self = this;
+
+ this.$element.on('change.select2', function () {
+ self.dataAdapter.current(function (data) {
+ self.trigger('selection:update', {
+ data: data
+ });
+ });
+ });
+
+ this.$element.on('focus.select2', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this._syncA = Utils.bind(this._syncAttributes, this);
+ this._syncS = Utils.bind(this._syncSubtree, this);
+
+ if (this.$element[0].attachEvent) {
+ this.$element[0].attachEvent('onpropertychange', this._syncA);
+ }
+
+ var observer = window.MutationObserver ||
+ window.WebKitMutationObserver ||
+ window.MozMutationObserver
+ ;
+
+ if (observer != null) {
+ this._observer = new observer(function (mutations) {
+ $.each(mutations, self._syncA);
+ $.each(mutations, self._syncS);
+ });
+ this._observer.observe(this.$element[0], {
+ attributes: true,
+ childList: true,
+ subtree: false
+ });
+ } else if (this.$element[0].addEventListener) {
+ this.$element[0].addEventListener(
+ 'DOMAttrModified',
+ self._syncA,
+ false
+ );
+ this.$element[0].addEventListener(
+ 'DOMNodeInserted',
+ self._syncS,
+ false
+ );
+ this.$element[0].addEventListener(
+ 'DOMNodeRemoved',
+ self._syncS,
+ false
+ );
+ }
+ };
+
+ Select2.prototype._registerDataEvents = function () {
+ var self = this;
+
+ this.dataAdapter.on('*', function (name, params) {
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerSelectionEvents = function () {
+ var self = this;
+ var nonRelayEvents = ['toggle', 'focus'];
+
+ this.selection.on('toggle', function () {
+ self.toggleDropdown();
+ });
+
+ this.selection.on('focus', function (params) {
+ self.focus(params);
+ });
+
+ this.selection.on('*', function (name, params) {
+ if ($.inArray(name, nonRelayEvents) !== -1) {
+ return;
+ }
+
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerDropdownEvents = function () {
+ var self = this;
+
+ this.dropdown.on('*', function (name, params) {
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerResultsEvents = function () {
+ var self = this;
+
+ this.results.on('*', function (name, params) {
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerEvents = function () {
+ var self = this;
+
+ this.on('open', function () {
+ self.$container.addClass('select2-container--open');
+ });
+
+ this.on('close', function () {
+ self.$container.removeClass('select2-container--open');
+ });
+
+ this.on('enable', function () {
+ self.$container.removeClass('select2-container--disabled');
+ });
+
+ this.on('disable', function () {
+ self.$container.addClass('select2-container--disabled');
+ });
+
+ this.on('blur', function () {
+ self.$container.removeClass('select2-container--focus');
+ });
+
+ this.on('query', function (params) {
+ if (!self.isOpen()) {
+ self.trigger('open', {});
+ }
+
+ this.dataAdapter.query(params, function (data) {
+ self.trigger('results:all', {
+ data: data,
+ query: params
+ });
+ });
+ });
+
+ this.on('query:append', function (params) {
+ this.dataAdapter.query(params, function (data) {
+ self.trigger('results:append', {
+ data: data,
+ query: params
+ });
+ });
+ });
+
+ this.on('open', function(){
+ // Focus on the active element when opening dropdown.
+ // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
+ setTimeout(function(){
+ self.focusOnActiveElement();
+ }, 1);
+ });
+
+ $(document).on('keydown', function (evt) {
+ var key = evt.which;
+ if (self.isOpen()) {
+ if (key === KEYS.ESC || key === KEYS.TAB ||
+ (key === KEYS.UP && evt.altKey)) {
+ self.close();
+
+ evt.preventDefault();
+ } else if (key === KEYS.ENTER) {
+ self.trigger('results:select', {});
+
+ evt.preventDefault();
+ } else if ((key === KEYS.SPACE && evt.ctrlKey)) {
+ self.trigger('results:toggle', {});
+
+ evt.preventDefault();
+ } else if (key === KEYS.UP) {
+ self.trigger('results:previous', {});
+
+ evt.preventDefault();
+ } else if (key === KEYS.DOWN) {
+ self.trigger('results:next', {});
+
+ evt.preventDefault();
+ }
+
+ // Move the focus to the selected element on keyboard navigation.
+ // Required for screen readers to work properly.
+ if (key === KEYS.DOWN || key === KEYS.UP) {
+ self.focusOnActiveElement();
+ } else {
+ // Focus on the search if user starts typing.
+ var $searchField = self.$dropdown.find('.select2-search__field');
+ if (! $searchField.length) {
+ $searchField = self.$container.find('.select2-search__field');
+ }
+ $searchField.focus();
+ // Focus back to active selection when finished typing.
+ // Small delay so typed character can be read by screen reader.
+ setTimeout(function(){
+ self.focusOnActiveElement();
+ }, 1000);
+ }
+
+ } else if (self.hasFocus()) {
+ if (key === KEYS.ENTER || key === KEYS.SPACE ||
+ (key === KEYS.DOWN && evt.altKey)) {
+ self.open();
+ evt.preventDefault();
+ }
+ }
+ });
+ };
+
+ Select2.prototype.focusOnActiveElement = function () {
+ // Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards.
+ if (! Utils.isTouchscreen()) {
+ this.$results.find('li.select2-results__option--highlighted').focus();
+ }
+ };
+
+ Select2.prototype._syncAttributes = function () {
+ this.options.set('disabled', this.$element.prop('disabled'));
+
+ if (this.options.get('disabled')) {
+ if (this.isOpen()) {
+ this.close();
+ }
+
+ this.trigger('disable', {});
+ } else {
+ this.trigger('enable', {});
+ }
+ };
+
+ Select2.prototype._syncSubtree = function (evt, mutations) {
+ var changed = false;
+ var self = this;
+
+ // Ignore any mutation events raised for elements that aren't options or
+ // optgroups. This handles the case when the select element is destroyed
+ if (
+ evt && evt.target && (
+ evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
+ )
+ ) {
+ return;
+ }
+
+ if (!mutations) {
+ // If mutation events aren't supported, then we can only assume that the
+ // change affected the selections
+ changed = true;
+ } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
+ for (var n = 0; n < mutations.addedNodes.length; n++) {
+ var node = mutations.addedNodes[n];
+
+ if (node.selected) {
+ changed = true;
+ }
+ }
+ } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
+ changed = true;
+ }
+
+ // Only re-pull the data if we think there is a change
+ if (changed) {
+ this.dataAdapter.current(function (currentData) {
+ self.trigger('selection:update', {
+ data: currentData
+ });
+ });
+ }
+ };
+
+ /**
+ * Override the trigger method to automatically trigger pre-events when
+ * there are events that can be prevented.
+ */
+ Select2.prototype.trigger = function (name, args) {
+ var actualTrigger = Select2.__super__.trigger;
+ var preTriggerMap = {
+ 'open': 'opening',
+ 'close': 'closing',
+ 'select': 'selecting',
+ 'unselect': 'unselecting'
+ };
+
+ if (args === undefined) {
+ args = {};
+ }
+
+ if (name in preTriggerMap) {
+ var preTriggerName = preTriggerMap[name];
+ var preTriggerArgs = {
+ prevented: false,
+ name: name,
+ args: args
+ };
+
+ actualTrigger.call(this, preTriggerName, preTriggerArgs);
+
+ if (preTriggerArgs.prevented) {
+ args.prevented = true;
+
+ return;
+ }
+ }
+
+ actualTrigger.call(this, name, args);
+ };
+
+ Select2.prototype.toggleDropdown = function () {
+ if (this.options.get('disabled')) {
+ return;
+ }
+
+ if (this.isOpen()) {
+ this.close();
+ } else {
+ this.open();
+ }
+ };
+
+ Select2.prototype.open = function () {
+ if (this.isOpen()) {
+ return;
+ }
+
+ this.trigger('query', {});
+ };
+
+ Select2.prototype.close = function () {
+ if (!this.isOpen()) {
+ return;
+ }
+
+ this.trigger('close', {});
+ };
+
+ Select2.prototype.isOpen = function () {
+ return this.$container.hasClass('select2-container--open');
+ };
+
+ Select2.prototype.hasFocus = function () {
+ return this.$container.hasClass('select2-container--focus');
+ };
+
+ Select2.prototype.focus = function (data) {
+ // No need to re-trigger focus events if we are already focused
+ if (this.hasFocus()) {
+ return;
+ }
+
+ this.$container.addClass('select2-container--focus');
+ this.trigger('focus', {});
+ };
+
+ Select2.prototype.enable = function (args) {
+ if (this.options.get('debug') && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `select2("enable")` method has been deprecated and will' +
+ ' be removed in later Select2 versions. Use $element.prop("disabled")' +
+ ' instead.'
+ );
+ }
+
+ if (args == null || args.length === 0) {
+ args = [true];
+ }
+
+ var disabled = !args[0];
+
+ this.$element.prop('disabled', disabled);
+ };
+
+ Select2.prototype.data = function () {
+ if (this.options.get('debug') &&
+ arguments.length > 0 && window.console && console.warn) {
+ console.warn(
+ 'Select2: Data can no longer be set using `select2("data")`. You ' +
+ 'should consider setting the value instead using `$element.val()`.'
+ );
+ }
+
+ var data = [];
+
+ this.dataAdapter.current(function (currentData) {
+ data = currentData;
+ });
+
+ return data;
+ };
+
+ Select2.prototype.val = function (args) {
+ if (this.options.get('debug') && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `select2("val")` method has been deprecated and will be' +
+ ' removed in later Select2 versions. Use $element.val() instead.'
+ );
+ }
+
+ if (args == null || args.length === 0) {
+ return this.$element.val();
+ }
+
+ var newVal = args[0];
+
+ if ($.isArray(newVal)) {
+ newVal = $.map(newVal, function (obj) {
+ return obj.toString();
+ });
+ }
+
+ this.$element.val(newVal).trigger('change');
+ };
+
+ Select2.prototype.destroy = function () {
+ this.$container.remove();
+
+ if (this.$element[0].detachEvent) {
+ this.$element[0].detachEvent('onpropertychange', this._syncA);
+ }
+
+ if (this._observer != null) {
+ this._observer.disconnect();
+ this._observer = null;
+ } else if (this.$element[0].removeEventListener) {
+ this.$element[0]
+ .removeEventListener('DOMAttrModified', this._syncA, false);
+ this.$element[0]
+ .removeEventListener('DOMNodeInserted', this._syncS, false);
+ this.$element[0]
+ .removeEventListener('DOMNodeRemoved', this._syncS, false);
+ }
+
+ this._syncA = null;
+ this._syncS = null;
+
+ this.$element.off('.select2');
+ this.$element.attr('tabindex', this.$element.data('old-tabindex'));
+
+ this.$element.removeClass('select2-hidden-accessible');
+ this.$element.attr('aria-hidden', 'false');
+ this.$element.removeData('select2');
+
+ this.dataAdapter.destroy();
+ this.selection.destroy();
+ this.dropdown.destroy();
+ this.results.destroy();
+
+ this.dataAdapter = null;
+ this.selection = null;
+ this.dropdown = null;
+ this.results = null;
+ };
+
+ Select2.prototype.render = function () {
+ var $container = $(
+ '' +
+ ' ' +
+ ' ' +
+ ' '
+ );
+
+ $container.attr('dir', this.options.get('dir'));
+
+ this.$container = $container;
+
+ this.$container.addClass('select2-container--' + this.options.get('theme'));
+
+ $container.data('element', this.$element);
+
+ return $container;
+ };
+
+ return Select2;
+});
+
+S2.define('jquery-mousewheel',[
+ 'jquery'
+], function ($) {
+ // Used to shim jQuery.mousewheel for non-full builds.
+ return $;
+});
+
+S2.define('jquery.select2',[
+ 'jquery',
+ 'jquery-mousewheel',
+
+ './select2/core',
+ './select2/defaults'
+], function ($, _, Select2, Defaults) {
+ if ($.fn.selectWoo == null) {
+ // All methods that should return the element
+ var thisMethods = ['open', 'close', 'destroy'];
+
+ $.fn.selectWoo = function (options) {
+ options = options || {};
+
+ if (typeof options === 'object') {
+ this.each(function () {
+ var instanceOptions = $.extend(true, {}, options);
+
+ var instance = new Select2($(this), instanceOptions);
+ });
+
+ return this;
+ } else if (typeof options === 'string') {
+ var ret;
+ var args = Array.prototype.slice.call(arguments, 1);
+
+ this.each(function () {
+ var instance = $(this).data('select2');
+
+ if (instance == null && window.console && console.error) {
+ console.error(
+ 'The select2(\'' + options + '\') method was called on an ' +
+ 'element that is not using Select2.'
+ );
+ }
+
+ ret = instance[options].apply(instance, args);
+ });
+
+ // Check if we should be returning `this`
+ if ($.inArray(options, thisMethods) > -1) {
+ return this;
+ }
+
+ return ret;
+ } else {
+ throw new Error('Invalid arguments for Select2: ' + options);
+ }
+ };
+ }
+
+ if ($.fn.select2 != null && $.fn.select2.defaults != null) {
+ $.fn.selectWoo.defaults = $.fn.select2.defaults;
+ }
+
+ if ($.fn.selectWoo.defaults == null) {
+ $.fn.selectWoo.defaults = Defaults;
+ }
+
+ // Also register selectWoo under select2 if select2 is not already present.
+ $.fn.select2 = $.fn.select2 || $.fn.selectWoo;
+
+ return Select2;
+});
+
+ // Return the AMD loader configuration so it can be used outside of this file
+ return {
+ define: S2.define,
+ require: S2.require
+ };
+}());
+
+ // Autoload the jQuery bindings
+ // We know that all of the modules exist above this, so we're safe
+ var select2 = S2.require('jquery.select2');
+
+ // Hold the AMD module references on the jQuery function that was just loaded
+ // This allows Select2 to use the internal loader outside of this file, such
+ // as in the language files.
+ jQuery.fn.select2.amd = S2;
+ jQuery.fn.selectWoo.amd = S2;
+
+ // Return the Select2 instance for anyone who is importing it.
+ return select2;
+}));
diff --git a/assets/kirki/assets/vendor/selectWoo/js/select2.min.js b/assets/kirki/assets/vendor/selectWoo/js/select2.min.js
new file mode 100644
index 0000000..bf9600c
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/select2.min.js
@@ -0,0 +1 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(' '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a(' ');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(' '),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a(" ")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html(''),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('× ')},d.prototype.update=function(a){var b=this;if(this.clear(),0!==a.length){for(var d=[],e=0;e1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('× ');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a(' ');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a(' ');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a(' '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(" "),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen())if(c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault()),c===d.DOWN||c===d.UP)b.focusOnActiveElement();else{var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3)}else b.hasFocus()&&(c===d.ENTER||c===d.SPACE||c===d.DOWN&&a.altKey)&&(b.open(),a.preventDefault())})},e.prototype.focusOnActiveElement=function(){c.isTouchscreen()||this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c});
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/selectWoo.full.js b/assets/kirki/assets/vendor/selectWoo/js/selectWoo.full.js
new file mode 100644
index 0000000..d973690
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/selectWoo.full.js
@@ -0,0 +1,6553 @@
+/*!
+ * SelectWoo 1.0.1
+ * https://github.com/woocommerce/selectWoo
+ *
+ * Released under the MIT license
+ * https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md
+ */
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && module.exports) {
+ // Node/CommonJS
+ module.exports = function (root, jQuery) {
+ if (jQuery === undefined) {
+ // require('jQuery') returns a factory that requires window to
+ // build a jQuery instance, we normalize how we use modules
+ // that require this pattern but the window provided is a noop
+ // if it's defined (how jquery works)
+ if (typeof window !== 'undefined') {
+ jQuery = require('jquery');
+ }
+ else {
+ jQuery = require('jquery')(root);
+ }
+ }
+ factory(jQuery);
+ return jQuery;
+ };
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+} (function (jQuery) {
+ // This is needed so we can catch the AMD loader configuration and use it
+ // The inner file should be wrapped (by `banner.start.js`) in a function that
+ // returns the AMD loader references.
+ var S2 =(function () {
+ // Restore the Select2 AMD loader so it can be used
+ // Needed mostly in the language files, where the loader is not inserted
+ if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
+ var S2 = jQuery.fn.select2.amd;
+ }
+var S2;(function () { if (!S2 || !S2.requirejs) {
+if (!S2) { S2 = {}; } else { require = S2; }
+/**
+ * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
+ * Released under MIT license, http://github.com/requirejs/almond/LICENSE
+ */
+//Going sloppy to avoid 'use strict' string cost, but strict practices should
+//be followed.
+/*global setTimeout: false */
+
+var requirejs, require, define;
+(function (undef) {
+ var main, req, makeMap, handlers,
+ defined = {},
+ waiting = {},
+ config = {},
+ defining = {},
+ hasOwn = Object.prototype.hasOwnProperty,
+ aps = [].slice,
+ jsSuffixRegExp = /\.js$/;
+
+ function hasProp(obj, prop) {
+ return hasOwn.call(obj, prop);
+ }
+
+ /**
+ * Given a relative module name, like ./something, normalize it to
+ * a real name that can be mapped to a path.
+ * @param {String} name the relative name
+ * @param {String} baseName a real name that the name arg is relative
+ * to.
+ * @returns {String} normalized name
+ */
+ function normalize(name, baseName) {
+ var nameParts, nameSegment, mapValue, foundMap, lastIndex,
+ foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
+ baseParts = baseName && baseName.split("/"),
+ map = config.map,
+ starMap = (map && map['*']) || {};
+
+ //Adjust any relative paths.
+ if (name) {
+ name = name.split('/');
+ lastIndex = name.length - 1;
+
+ // If wanting node ID compatibility, strip .js from end
+ // of IDs. Have to do this here, and not in nameToUrl
+ // because node allows either .js or non .js to map
+ // to same file.
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
+ }
+
+ // Starts with a '.' so need the baseName
+ if (name[0].charAt(0) === '.' && baseParts) {
+ //Convert baseName to array, and lop off the last part,
+ //so that . matches that 'directory' and not name of the baseName's
+ //module. For instance, baseName of 'one/two/three', maps to
+ //'one/two/three.js', but we want the directory, 'one/two' for
+ //this normalization.
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
+ name = normalizedBaseParts.concat(name);
+ }
+
+ //start trimDots
+ for (i = 0; i < name.length; i++) {
+ part = name[i];
+ if (part === '.') {
+ name.splice(i, 1);
+ i -= 1;
+ } else if (part === '..') {
+ // If at the start, or previous value is still ..,
+ // keep them so that when converted to a path it may
+ // still work when converted to a path, even though
+ // as an ID it is less than ideal. In larger point
+ // releases, may be better to just kick out an error.
+ if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
+ continue;
+ } else if (i > 0) {
+ name.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ }
+ //end trimDots
+
+ name = name.join('/');
+ }
+
+ //Apply map config if available.
+ if ((baseParts || starMap) && map) {
+ nameParts = name.split('/');
+
+ for (i = nameParts.length; i > 0; i -= 1) {
+ nameSegment = nameParts.slice(0, i).join("/");
+
+ if (baseParts) {
+ //Find the longest baseName segment match in the config.
+ //So, do joins on the biggest to smallest lengths of baseParts.
+ for (j = baseParts.length; j > 0; j -= 1) {
+ mapValue = map[baseParts.slice(0, j).join('/')];
+
+ //baseName segment has config, find if it has one for
+ //this name.
+ if (mapValue) {
+ mapValue = mapValue[nameSegment];
+ if (mapValue) {
+ //Match, update name to the new value.
+ foundMap = mapValue;
+ foundI = i;
+ break;
+ }
+ }
+ }
+ }
+
+ if (foundMap) {
+ break;
+ }
+
+ //Check for a star map match, but just hold on to it,
+ //if there is a shorter segment match later in a matching
+ //config, then favor over this star map.
+ if (!foundStarMap && starMap && starMap[nameSegment]) {
+ foundStarMap = starMap[nameSegment];
+ starI = i;
+ }
+ }
+
+ if (!foundMap && foundStarMap) {
+ foundMap = foundStarMap;
+ foundI = starI;
+ }
+
+ if (foundMap) {
+ nameParts.splice(0, foundI, foundMap);
+ name = nameParts.join('/');
+ }
+ }
+
+ return name;
+ }
+
+ function makeRequire(relName, forceSync) {
+ return function () {
+ //A version of a require function that passes a moduleName
+ //value for items that may need to
+ //look up paths relative to the moduleName
+ var args = aps.call(arguments, 0);
+
+ //If first arg is not require('string'), and there is only
+ //one arg, it is the array form without a callback. Insert
+ //a null so that the following concat is correct.
+ if (typeof args[0] !== 'string' && args.length === 1) {
+ args.push(null);
+ }
+ return req.apply(undef, args.concat([relName, forceSync]));
+ };
+ }
+
+ function makeNormalize(relName) {
+ return function (name) {
+ return normalize(name, relName);
+ };
+ }
+
+ function makeLoad(depName) {
+ return function (value) {
+ defined[depName] = value;
+ };
+ }
+
+ function callDep(name) {
+ if (hasProp(waiting, name)) {
+ var args = waiting[name];
+ delete waiting[name];
+ defining[name] = true;
+ main.apply(undef, args);
+ }
+
+ if (!hasProp(defined, name) && !hasProp(defining, name)) {
+ throw new Error('No ' + name);
+ }
+ return defined[name];
+ }
+
+ //Turns a plugin!resource to [plugin, resource]
+ //with the plugin being undefined if the name
+ //did not have a plugin prefix.
+ function splitPrefix(name) {
+ var prefix,
+ index = name ? name.indexOf('!') : -1;
+ if (index > -1) {
+ prefix = name.substring(0, index);
+ name = name.substring(index + 1, name.length);
+ }
+ return [prefix, name];
+ }
+
+ //Creates a parts array for a relName where first part is plugin ID,
+ //second part is resource ID. Assumes relName has already been normalized.
+ function makeRelParts(relName) {
+ return relName ? splitPrefix(relName) : [];
+ }
+
+ /**
+ * Makes a name map, normalizing the name, and using a plugin
+ * for normalization if necessary. Grabs a ref to plugin
+ * too, as an optimization.
+ */
+ makeMap = function (name, relParts) {
+ var plugin,
+ parts = splitPrefix(name),
+ prefix = parts[0],
+ relResourceName = relParts[1];
+
+ name = parts[1];
+
+ if (prefix) {
+ prefix = normalize(prefix, relResourceName);
+ plugin = callDep(prefix);
+ }
+
+ //Normalize according
+ if (prefix) {
+ if (plugin && plugin.normalize) {
+ name = plugin.normalize(name, makeNormalize(relResourceName));
+ } else {
+ name = normalize(name, relResourceName);
+ }
+ } else {
+ name = normalize(name, relResourceName);
+ parts = splitPrefix(name);
+ prefix = parts[0];
+ name = parts[1];
+ if (prefix) {
+ plugin = callDep(prefix);
+ }
+ }
+
+ //Using ridiculous property names for space reasons
+ return {
+ f: prefix ? prefix + '!' + name : name, //fullName
+ n: name,
+ pr: prefix,
+ p: plugin
+ };
+ };
+
+ function makeConfig(name) {
+ return function () {
+ return (config && config.config && config.config[name]) || {};
+ };
+ }
+
+ handlers = {
+ require: function (name) {
+ return makeRequire(name);
+ },
+ exports: function (name) {
+ var e = defined[name];
+ if (typeof e !== 'undefined') {
+ return e;
+ } else {
+ return (defined[name] = {});
+ }
+ },
+ module: function (name) {
+ return {
+ id: name,
+ uri: '',
+ exports: defined[name],
+ config: makeConfig(name)
+ };
+ }
+ };
+
+ main = function (name, deps, callback, relName) {
+ var cjsModule, depName, ret, map, i, relParts,
+ args = [],
+ callbackType = typeof callback,
+ usingExports;
+
+ //Use name if no relName
+ relName = relName || name;
+ relParts = makeRelParts(relName);
+
+ //Call the callback to define the module, if necessary.
+ if (callbackType === 'undefined' || callbackType === 'function') {
+ //Pull out the defined dependencies and pass the ordered
+ //values to the callback.
+ //Default to [require, exports, module] if no deps
+ deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
+ for (i = 0; i < deps.length; i += 1) {
+ map = makeMap(deps[i], relParts);
+ depName = map.f;
+
+ //Fast path CommonJS standard dependencies.
+ if (depName === "require") {
+ args[i] = handlers.require(name);
+ } else if (depName === "exports") {
+ //CommonJS module spec 1.1
+ args[i] = handlers.exports(name);
+ usingExports = true;
+ } else if (depName === "module") {
+ //CommonJS module spec 1.1
+ cjsModule = args[i] = handlers.module(name);
+ } else if (hasProp(defined, depName) ||
+ hasProp(waiting, depName) ||
+ hasProp(defining, depName)) {
+ args[i] = callDep(depName);
+ } else if (map.p) {
+ map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
+ args[i] = defined[depName];
+ } else {
+ throw new Error(name + ' missing ' + depName);
+ }
+ }
+
+ ret = callback ? callback.apply(defined[name], args) : undefined;
+
+ if (name) {
+ //If setting exports via "module" is in play,
+ //favor that over return value and exports. After that,
+ //favor a non-undefined return value over exports use.
+ if (cjsModule && cjsModule.exports !== undef &&
+ cjsModule.exports !== defined[name]) {
+ defined[name] = cjsModule.exports;
+ } else if (ret !== undef || !usingExports) {
+ //Use the return value from the function.
+ defined[name] = ret;
+ }
+ }
+ } else if (name) {
+ //May just be an object definition for the module. Only
+ //worry about defining if have a module name.
+ defined[name] = callback;
+ }
+ };
+
+ requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
+ if (typeof deps === "string") {
+ if (handlers[deps]) {
+ //callback in this case is really relName
+ return handlers[deps](callback);
+ }
+ //Just return the module wanted. In this scenario, the
+ //deps arg is the module name, and second arg (if passed)
+ //is just the relName.
+ //Normalize module name, if it contains . or ..
+ return callDep(makeMap(deps, makeRelParts(callback)).f);
+ } else if (!deps.splice) {
+ //deps is a config object, not an array.
+ config = deps;
+ if (config.deps) {
+ req(config.deps, config.callback);
+ }
+ if (!callback) {
+ return;
+ }
+
+ if (callback.splice) {
+ //callback is an array, which means it is a dependency list.
+ //Adjust args if there are dependencies
+ deps = callback;
+ callback = relName;
+ relName = null;
+ } else {
+ deps = undef;
+ }
+ }
+
+ //Support require(['a'])
+ callback = callback || function () {};
+
+ //If relName is a function, it is an errback handler,
+ //so remove it.
+ if (typeof relName === 'function') {
+ relName = forceSync;
+ forceSync = alt;
+ }
+
+ //Simulate async callback;
+ if (forceSync) {
+ main(undef, deps, callback, relName);
+ } else {
+ //Using a non-zero value because of concern for what old browsers
+ //do, and latest browsers "upgrade" to 4 if lower value is used:
+ //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
+ //If want a value immediately, use require('id') instead -- something
+ //that works in almond on the global level, but not guaranteed and
+ //unlikely to work in other AMD implementations.
+ setTimeout(function () {
+ main(undef, deps, callback, relName);
+ }, 4);
+ }
+
+ return req;
+ };
+
+ /**
+ * Just drops the config on the floor, but returns req in case
+ * the config return value is used.
+ */
+ req.config = function (cfg) {
+ return req(cfg);
+ };
+
+ /**
+ * Expose module registry for debugging and tooling
+ */
+ requirejs._defined = defined;
+
+ define = function (name, deps, callback) {
+ if (typeof name !== 'string') {
+ throw new Error('See almond README: incorrect module build, no module name');
+ }
+
+ //This module may not have dependencies
+ if (!deps.splice) {
+ //deps is not an array, so probably means
+ //an object literal or factory function for
+ //the value. Adjust args.
+ callback = deps;
+ deps = [];
+ }
+
+ if (!hasProp(defined, name) && !hasProp(waiting, name)) {
+ waiting[name] = [name, deps, callback];
+ }
+ };
+
+ define.amd = {
+ jQuery: true
+ };
+}());
+
+S2.requirejs = requirejs;S2.require = require;S2.define = define;
+}
+}());
+S2.define("almond", function(){});
+
+/* global jQuery:false, $:false */
+S2.define('jquery',[],function () {
+ var _$ = jQuery || $;
+
+ if (_$ == null && console && console.error) {
+ console.error(
+ 'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
+ 'found. Make sure that you are including jQuery before Select2 on your ' +
+ 'web page.'
+ );
+ }
+
+ return _$;
+});
+
+S2.define('select2/utils',[
+ 'jquery'
+], function ($) {
+ var Utils = {};
+
+ Utils.Extend = function (ChildClass, SuperClass) {
+ var __hasProp = {}.hasOwnProperty;
+
+ function BaseConstructor () {
+ this.constructor = ChildClass;
+ }
+
+ for (var key in SuperClass) {
+ if (__hasProp.call(SuperClass, key)) {
+ ChildClass[key] = SuperClass[key];
+ }
+ }
+
+ BaseConstructor.prototype = SuperClass.prototype;
+ ChildClass.prototype = new BaseConstructor();
+ ChildClass.__super__ = SuperClass.prototype;
+
+ return ChildClass;
+ };
+
+ function getMethods (theClass) {
+ var proto = theClass.prototype;
+
+ var methods = [];
+
+ for (var methodName in proto) {
+ var m = proto[methodName];
+
+ if (typeof m !== 'function') {
+ continue;
+ }
+
+ if (methodName === 'constructor') {
+ continue;
+ }
+
+ methods.push(methodName);
+ }
+
+ return methods;
+ }
+
+ Utils.Decorate = function (SuperClass, DecoratorClass) {
+ var decoratedMethods = getMethods(DecoratorClass);
+ var superMethods = getMethods(SuperClass);
+
+ function DecoratedClass () {
+ var unshift = Array.prototype.unshift;
+
+ var argCount = DecoratorClass.prototype.constructor.length;
+
+ var calledConstructor = SuperClass.prototype.constructor;
+
+ if (argCount > 0) {
+ unshift.call(arguments, SuperClass.prototype.constructor);
+
+ calledConstructor = DecoratorClass.prototype.constructor;
+ }
+
+ calledConstructor.apply(this, arguments);
+ }
+
+ DecoratorClass.displayName = SuperClass.displayName;
+
+ function ctr () {
+ this.constructor = DecoratedClass;
+ }
+
+ DecoratedClass.prototype = new ctr();
+
+ for (var m = 0; m < superMethods.length; m++) {
+ var superMethod = superMethods[m];
+
+ DecoratedClass.prototype[superMethod] =
+ SuperClass.prototype[superMethod];
+ }
+
+ var calledMethod = function (methodName) {
+ // Stub out the original method if it's not decorating an actual method
+ var originalMethod = function () {};
+
+ if (methodName in DecoratedClass.prototype) {
+ originalMethod = DecoratedClass.prototype[methodName];
+ }
+
+ var decoratedMethod = DecoratorClass.prototype[methodName];
+
+ return function () {
+ var unshift = Array.prototype.unshift;
+
+ unshift.call(arguments, originalMethod);
+
+ return decoratedMethod.apply(this, arguments);
+ };
+ };
+
+ for (var d = 0; d < decoratedMethods.length; d++) {
+ var decoratedMethod = decoratedMethods[d];
+
+ DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
+ }
+
+ return DecoratedClass;
+ };
+
+ var Observable = function () {
+ this.listeners = {};
+ };
+
+ Observable.prototype.on = function (event, callback) {
+ this.listeners = this.listeners || {};
+
+ if (event in this.listeners) {
+ this.listeners[event].push(callback);
+ } else {
+ this.listeners[event] = [callback];
+ }
+ };
+
+ Observable.prototype.trigger = function (event) {
+ var slice = Array.prototype.slice;
+ var params = slice.call(arguments, 1);
+
+ this.listeners = this.listeners || {};
+
+ // Params should always come in as an array
+ if (params == null) {
+ params = [];
+ }
+
+ // If there are no arguments to the event, use a temporary object
+ if (params.length === 0) {
+ params.push({});
+ }
+
+ // Set the `_type` of the first object to the event
+ params[0]._type = event;
+
+ if (event in this.listeners) {
+ this.invoke(this.listeners[event], slice.call(arguments, 1));
+ }
+
+ if ('*' in this.listeners) {
+ this.invoke(this.listeners['*'], arguments);
+ }
+ };
+
+ Observable.prototype.invoke = function (listeners, params) {
+ for (var i = 0, len = listeners.length; i < len; i++) {
+ listeners[i].apply(this, params);
+ }
+ };
+
+ Utils.Observable = Observable;
+
+ Utils.generateChars = function (length) {
+ var chars = '';
+
+ for (var i = 0; i < length; i++) {
+ var randomChar = Math.floor(Math.random() * 36);
+ chars += randomChar.toString(36);
+ }
+
+ return chars;
+ };
+
+ Utils.bind = function (func, context) {
+ return function () {
+ func.apply(context, arguments);
+ };
+ };
+
+ Utils._convertData = function (data) {
+ for (var originalKey in data) {
+ var keys = originalKey.split('-');
+
+ var dataLevel = data;
+
+ if (keys.length === 1) {
+ continue;
+ }
+
+ for (var k = 0; k < keys.length; k++) {
+ var key = keys[k];
+
+ // Lowercase the first letter
+ // By default, dash-separated becomes camelCase
+ key = key.substring(0, 1).toLowerCase() + key.substring(1);
+
+ if (!(key in dataLevel)) {
+ dataLevel[key] = {};
+ }
+
+ if (k == keys.length - 1) {
+ dataLevel[key] = data[originalKey];
+ }
+
+ dataLevel = dataLevel[key];
+ }
+
+ delete data[originalKey];
+ }
+
+ return data;
+ };
+
+ Utils.hasScroll = function (index, el) {
+ // Adapted from the function created by @ShadowScripter
+ // and adapted by @BillBarry on the Stack Exchange Code Review website.
+ // The original code can be found at
+ // http://codereview.stackexchange.com/q/13338
+ // and was designed to be used with the Sizzle selector engine.
+
+ var $el = $(el);
+ var overflowX = el.style.overflowX;
+ var overflowY = el.style.overflowY;
+
+ //Check both x and y declarations
+ if (overflowX === overflowY &&
+ (overflowY === 'hidden' || overflowY === 'visible')) {
+ return false;
+ }
+
+ if (overflowX === 'scroll' || overflowY === 'scroll') {
+ return true;
+ }
+
+ return ($el.innerHeight() < el.scrollHeight ||
+ $el.innerWidth() < el.scrollWidth);
+ };
+
+ Utils.escapeMarkup = function (markup) {
+ var replaceMap = {
+ '\\': '\',
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ '\'': ''',
+ '/': '/'
+ };
+
+ // Do not try to escape the markup if it's not a string
+ if (typeof markup !== 'string') {
+ return markup;
+ }
+
+ return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
+ return replaceMap[match];
+ });
+ };
+
+ // Append an array of jQuery nodes to a given element.
+ Utils.appendMany = function ($element, $nodes) {
+ // jQuery 1.7.x does not support $.fn.append() with an array
+ // Fall back to a jQuery object collection using $.fn.add()
+ if ($.fn.jquery.substr(0, 3) === '1.7') {
+ var $jqNodes = $();
+
+ $.map($nodes, function (node) {
+ $jqNodes = $jqNodes.add(node);
+ });
+
+ $nodes = $jqNodes;
+ }
+
+ $element.append($nodes);
+ };
+
+ // Determine whether the browser is on a touchscreen device.
+ Utils.isTouchscreen = function() {
+ if ('undefined' === typeof Utils._isTouchscreenCache) {
+ Utils._isTouchscreenCache = 'ontouchstart' in document.documentElement;
+ }
+ return Utils._isTouchscreenCache;
+ }
+
+ return Utils;
+});
+
+S2.define('select2/results',[
+ 'jquery',
+ './utils'
+], function ($, Utils) {
+ function Results ($element, options, dataAdapter) {
+ this.$element = $element;
+ this.data = dataAdapter;
+ this.options = options;
+
+ Results.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(Results, Utils.Observable);
+
+ Results.prototype.render = function () {
+ var $results = $(
+ ''
+ );
+
+ if (this.options.get('multiple')) {
+ $results.attr('aria-multiselectable', 'true');
+ }
+
+ this.$results = $results;
+
+ return $results;
+ };
+
+ Results.prototype.clear = function () {
+ this.$results.empty();
+ };
+
+ Results.prototype.displayMessage = function (params) {
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ this.clear();
+ this.hideLoading();
+
+ var $message = $(
+ ' '
+ );
+
+ var message = this.options.get('translations').get(params.message);
+
+ $message.append(
+ escapeMarkup(
+ message(params.args)
+ )
+ );
+
+ $message[0].className += ' select2-results__message';
+
+ this.$results.append($message);
+ };
+
+ Results.prototype.hideMessages = function () {
+ this.$results.find('.select2-results__message').remove();
+ };
+
+ Results.prototype.append = function (data) {
+ this.hideLoading();
+
+ var $options = [];
+
+ if (data.results == null || data.results.length === 0) {
+ if (this.$results.children().length === 0) {
+ this.trigger('results:message', {
+ message: 'noResults'
+ });
+ }
+
+ return;
+ }
+
+ data.results = this.sort(data.results);
+
+ for (var d = 0; d < data.results.length; d++) {
+ var item = data.results[d];
+
+ var $option = this.option(item);
+
+ $options.push($option);
+ }
+
+ this.$results.append($options);
+ };
+
+ Results.prototype.position = function ($results, $dropdown) {
+ var $resultsContainer = $dropdown.find('.select2-results');
+ $resultsContainer.append($results);
+ };
+
+ Results.prototype.sort = function (data) {
+ var sorter = this.options.get('sorter');
+
+ return sorter(data);
+ };
+
+ Results.prototype.highlightFirstItem = function () {
+ var $options = this.$results
+ .find('.select2-results__option[data-selected]');
+
+ var $selected = $options.filter('[data-selected=true]');
+
+ // Check if there are any selected options
+ if ($selected.length > 0) {
+ // If there are selected options, highlight the first
+ $selected.first().trigger('mouseenter');
+ } else {
+ // If there are no selected options, highlight the first option
+ // in the dropdown
+ $options.first().trigger('mouseenter');
+ }
+
+ this.ensureHighlightVisible();
+ };
+
+ Results.prototype.setClasses = function () {
+ var self = this;
+
+ this.data.current(function (selected) {
+ var selectedIds = $.map(selected, function (s) {
+ return s.id.toString();
+ });
+
+ var $options = self.$results
+ .find('.select2-results__option[data-selected]');
+
+ $options.each(function () {
+ var $option = $(this);
+
+ var item = $.data(this, 'data');
+
+ // id needs to be converted to a string when comparing
+ var id = '' + item.id;
+
+ if ((item.element != null && item.element.selected) ||
+ (item.element == null && $.inArray(id, selectedIds) > -1)) {
+ $option.attr('data-selected', 'true');
+ } else {
+ $option.attr('data-selected', 'false');
+ }
+ });
+
+ });
+ };
+
+ Results.prototype.showLoading = function (params) {
+ this.hideLoading();
+
+ var loadingMore = this.options.get('translations').get('searching');
+
+ var loading = {
+ disabled: true,
+ loading: true,
+ text: loadingMore(params)
+ };
+ var $loading = this.option(loading);
+ $loading.className += ' loading-results';
+
+ this.$results.prepend($loading);
+ };
+
+ Results.prototype.hideLoading = function () {
+ this.$results.find('.loading-results').remove();
+ };
+
+ Results.prototype.option = function (data) {
+ var option = document.createElement('li');
+ option.className = 'select2-results__option';
+
+ var attrs = {
+ 'role': 'option',
+ 'data-selected': 'false',
+ 'tabindex': -1
+ };
+
+ if (data.disabled) {
+ delete attrs['data-selected'];
+ attrs['aria-disabled'] = 'true';
+ }
+
+ if (data.id == null) {
+ delete attrs['data-selected'];
+ }
+
+ if (data._resultId != null) {
+ option.id = data._resultId;
+ }
+
+ if (data.title) {
+ option.title = data.title;
+ }
+
+ if (data.children) {
+ attrs['aria-label'] = data.text;
+ delete attrs['data-selected'];
+ }
+
+ for (var attr in attrs) {
+ var val = attrs[attr];
+
+ option.setAttribute(attr, val);
+ }
+
+ if (data.children) {
+ var $option = $(option);
+
+ var label = document.createElement('strong');
+ label.className = 'select2-results__group';
+
+ var $label = $(label);
+ this.template(data, label);
+ $label.attr('role', 'presentation');
+
+ var $children = [];
+
+ for (var c = 0; c < data.children.length; c++) {
+ var child = data.children[c];
+
+ var $child = this.option(child);
+
+ $children.push($child);
+ }
+
+ var $childrenContainer = $('', {
+ 'class': 'select2-results__options select2-results__options--nested',
+ 'role': 'listbox'
+ });
+ $childrenContainer.append($children);
+ $option.attr('role', 'list');
+
+ $option.append(label);
+ $option.append($childrenContainer);
+ } else {
+ this.template(data, option);
+ }
+
+ $.data(option, 'data', data);
+
+ return option;
+ };
+
+ Results.prototype.bind = function (container, $container) {
+ var self = this;
+
+ var id = container.id + '-results';
+
+ this.$results.attr('id', id);
+
+ container.on('results:all', function (params) {
+ self.clear();
+ self.append(params.data);
+
+ if (container.isOpen()) {
+ self.setClasses();
+ self.highlightFirstItem();
+ }
+ });
+
+ container.on('results:append', function (params) {
+ self.append(params.data);
+
+ if (container.isOpen()) {
+ self.setClasses();
+ }
+ });
+
+ container.on('query', function (params) {
+ self.hideMessages();
+ self.showLoading(params);
+ });
+
+ container.on('select', function () {
+ if (!container.isOpen()) {
+ return;
+ }
+
+ self.setClasses();
+ self.highlightFirstItem();
+ });
+
+ container.on('unselect', function () {
+ if (!container.isOpen()) {
+ return;
+ }
+
+ self.setClasses();
+ self.highlightFirstItem();
+ });
+
+ container.on('open', function () {
+ // When the dropdown is open, aria-expended="true"
+ self.$results.attr('aria-expanded', 'true');
+ self.$results.attr('aria-hidden', 'false');
+
+ self.setClasses();
+ self.ensureHighlightVisible();
+ });
+
+ container.on('close', function () {
+ // When the dropdown is closed, aria-expended="false"
+ self.$results.attr('aria-expanded', 'false');
+ self.$results.attr('aria-hidden', 'true');
+ self.$results.removeAttr('aria-activedescendant');
+ });
+
+ container.on('results:toggle', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ if ($highlighted.length === 0) {
+ return;
+ }
+
+ $highlighted.trigger('mouseup');
+ });
+
+ container.on('results:select', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ if ($highlighted.length === 0) {
+ return;
+ }
+
+ var data = $highlighted.data('data');
+
+ if ($highlighted.attr('data-selected') == 'true') {
+ self.trigger('close', {});
+ } else {
+ self.trigger('select', {
+ data: data
+ });
+ }
+ });
+
+ container.on('results:previous', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ var $options = self.$results.find('[data-selected]');
+
+ var currentIndex = $options.index($highlighted);
+
+ // If we are already at te top, don't move further
+ if (currentIndex === 0) {
+ return;
+ }
+
+ var nextIndex = currentIndex - 1;
+
+ // If none are highlighted, highlight the first
+ if ($highlighted.length === 0) {
+ nextIndex = 0;
+ }
+
+ var $next = $options.eq(nextIndex);
+
+ $next.trigger('mouseenter');
+
+ var currentOffset = self.$results.offset().top;
+ var nextTop = $next.offset().top;
+ var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
+
+ if (nextIndex === 0) {
+ self.$results.scrollTop(0);
+ } else if (nextTop - currentOffset < 0) {
+ self.$results.scrollTop(nextOffset);
+ }
+ });
+
+ container.on('results:next', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ var $options = self.$results.find('[data-selected]');
+
+ var currentIndex = $options.index($highlighted);
+
+ var nextIndex = currentIndex + 1;
+
+ // If we are at the last option, stay there
+ if (nextIndex >= $options.length) {
+ return;
+ }
+
+ var $next = $options.eq(nextIndex);
+
+ $next.trigger('mouseenter');
+
+ var currentOffset = self.$results.offset().top +
+ self.$results.outerHeight(false);
+ var nextBottom = $next.offset().top + $next.outerHeight(false);
+ var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
+
+ if (nextIndex === 0) {
+ self.$results.scrollTop(0);
+ } else if (nextBottom > currentOffset) {
+ self.$results.scrollTop(nextOffset);
+ }
+ });
+
+ container.on('results:focus', function (params) {
+ params.element.addClass('select2-results__option--highlighted').attr('aria-selected', 'true');
+ self.$results.attr('aria-activedescendant', params.element.attr('id'));
+ });
+
+ container.on('results:message', function (params) {
+ self.displayMessage(params);
+ });
+
+ if ($.fn.mousewheel) {
+ this.$results.on('mousewheel', function (e) {
+ var top = self.$results.scrollTop();
+
+ var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
+
+ var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
+ var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
+
+ if (isAtTop) {
+ self.$results.scrollTop(0);
+
+ e.preventDefault();
+ e.stopPropagation();
+ } else if (isAtBottom) {
+ self.$results.scrollTop(
+ self.$results.get(0).scrollHeight - self.$results.height()
+ );
+
+ e.preventDefault();
+ e.stopPropagation();
+ }
+ });
+ }
+
+ this.$results.on('mouseup', '.select2-results__option[data-selected]',
+ function (evt) {
+ var $this = $(this);
+
+ var data = $this.data('data');
+
+ if ($this.attr('data-selected') === 'true') {
+ if (self.options.get('multiple')) {
+ self.trigger('unselect', {
+ originalEvent: evt,
+ data: data
+ });
+ } else {
+ self.trigger('close', {});
+ }
+
+ return;
+ }
+
+ self.trigger('select', {
+ originalEvent: evt,
+ data: data
+ });
+ });
+
+ this.$results.on('mouseenter', '.select2-results__option[data-selected]',
+ function (evt) {
+ var data = $(this).data('data');
+
+ self.getHighlightedResults()
+ .removeClass('select2-results__option--highlighted')
+ .attr('aria-selected', 'false');
+
+ self.trigger('results:focus', {
+ data: data,
+ element: $(this)
+ });
+ });
+ };
+
+ Results.prototype.getHighlightedResults = function () {
+ var $highlighted = this.$results
+ .find('.select2-results__option--highlighted');
+
+ return $highlighted;
+ };
+
+ Results.prototype.destroy = function () {
+ this.$results.remove();
+ };
+
+ Results.prototype.ensureHighlightVisible = function () {
+ var $highlighted = this.getHighlightedResults();
+
+ if ($highlighted.length === 0) {
+ return;
+ }
+
+ var $options = this.$results.find('[data-selected]');
+
+ var currentIndex = $options.index($highlighted);
+
+ var currentOffset = this.$results.offset().top;
+ var nextTop = $highlighted.offset().top;
+ var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
+
+ var offsetDelta = nextTop - currentOffset;
+ nextOffset -= $highlighted.outerHeight(false) * 2;
+
+ if (currentIndex <= 2) {
+ this.$results.scrollTop(0);
+ } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
+ this.$results.scrollTop(nextOffset);
+ }
+ };
+
+ Results.prototype.template = function (result, container) {
+ var template = this.options.get('templateResult');
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ var content = template(result, container);
+
+ if (content == null) {
+ container.style.display = 'none';
+ } else if (typeof content === 'string') {
+ container.innerHTML = escapeMarkup(content);
+ } else {
+ $(container).append(content);
+ }
+ };
+
+ return Results;
+});
+
+S2.define('select2/keys',[
+
+], function () {
+ var KEYS = {
+ BACKSPACE: 8,
+ TAB: 9,
+ ENTER: 13,
+ SHIFT: 16,
+ CTRL: 17,
+ ALT: 18,
+ ESC: 27,
+ SPACE: 32,
+ PAGE_UP: 33,
+ PAGE_DOWN: 34,
+ END: 35,
+ HOME: 36,
+ LEFT: 37,
+ UP: 38,
+ RIGHT: 39,
+ DOWN: 40,
+ DELETE: 46
+ };
+
+ return KEYS;
+});
+
+S2.define('select2/selection/base',[
+ 'jquery',
+ '../utils',
+ '../keys'
+], function ($, Utils, KEYS) {
+ function BaseSelection ($element, options) {
+ this.$element = $element;
+ this.options = options;
+
+ BaseSelection.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(BaseSelection, Utils.Observable);
+
+ BaseSelection.prototype.render = function () {
+ var $selection = $(
+ '' +
+ ' '
+ );
+
+ this._tabindex = 0;
+
+ if (this.$element.data('old-tabindex') != null) {
+ this._tabindex = this.$element.data('old-tabindex');
+ } else if (this.$element.attr('tabindex') != null) {
+ this._tabindex = this.$element.attr('tabindex');
+ }
+
+ $selection.attr('title', this.$element.attr('title'));
+ $selection.attr('tabindex', this._tabindex);
+
+ this.$selection = $selection;
+
+ return $selection;
+ };
+
+ BaseSelection.prototype.bind = function (container, $container) {
+ var self = this;
+
+ var id = container.id + '-container';
+ var resultsId = container.id + '-results';
+ var searchHidden = this.options.get('minimumResultsForSearch') === Infinity;
+
+ this.container = container;
+
+ this.$selection.on('focus', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this.$selection.on('blur', function (evt) {
+ self._handleBlur(evt);
+ });
+
+ this.$selection.on('keydown', function (evt) {
+ self.trigger('keypress', evt);
+
+ if (evt.which === KEYS.SPACE) {
+ evt.preventDefault();
+ }
+ });
+
+ container.on('results:focus', function (params) {
+ self.$selection.attr('aria-activedescendant', params.data._resultId);
+ });
+
+ container.on('selection:update', function (params) {
+ self.update(params.data);
+ });
+
+ container.on('open', function () {
+ // When the dropdown is open, aria-expanded="true"
+ self.$selection.attr('aria-expanded', 'true');
+ self.$selection.attr('aria-owns', resultsId);
+
+ self._attachCloseHandler(container);
+ });
+
+ container.on('close', function () {
+ // When the dropdown is closed, aria-expanded="false"
+ self.$selection.attr('aria-expanded', 'false');
+ self.$selection.removeAttr('aria-activedescendant');
+ self.$selection.removeAttr('aria-owns');
+
+ // This needs to be delayed as the active element is the body when the
+ // key is pressed.
+ window.setTimeout(function () {
+ self.$selection.focus();
+ }, 1);
+
+ self._detachCloseHandler(container);
+ });
+
+ container.on('enable', function () {
+ self.$selection.attr('tabindex', self._tabindex);
+ });
+
+ container.on('disable', function () {
+ self.$selection.attr('tabindex', '-1');
+ });
+ };
+
+ BaseSelection.prototype._handleBlur = function (evt) {
+ var self = this;
+
+ // This needs to be delayed as the active element is the body when the tab
+ // key is pressed, possibly along with others.
+ window.setTimeout(function () {
+ // Don't trigger `blur` if the focus is still in the selection
+ if (
+ (document.activeElement == self.$selection[0]) ||
+ ($.contains(self.$selection[0], document.activeElement))
+ ) {
+ return;
+ }
+
+ self.trigger('blur', evt);
+ }, 1);
+ };
+
+ BaseSelection.prototype._attachCloseHandler = function (container) {
+ var self = this;
+
+ $(document.body).on('mousedown.select2.' + container.id, function (e) {
+ var $target = $(e.target);
+
+ var $select = $target.closest('.select2');
+
+ var $all = $('.select2.select2-container--open');
+
+ $all.each(function () {
+ var $this = $(this);
+
+ if (this == $select[0]) {
+ return;
+ }
+
+ var $element = $this.data('element');
+
+ $element.select2('close');
+ });
+ });
+ };
+
+ BaseSelection.prototype._detachCloseHandler = function (container) {
+ $(document.body).off('mousedown.select2.' + container.id);
+ };
+
+ BaseSelection.prototype.position = function ($selection, $container) {
+ var $selectionContainer = $container.find('.selection');
+ $selectionContainer.append($selection);
+ };
+
+ BaseSelection.prototype.destroy = function () {
+ this._detachCloseHandler(this.container);
+ };
+
+ BaseSelection.prototype.update = function (data) {
+ throw new Error('The `update` method must be defined in child classes.');
+ };
+
+ return BaseSelection;
+});
+
+S2.define('select2/selection/single',[
+ 'jquery',
+ './base',
+ '../utils',
+ '../keys'
+], function ($, BaseSelection, Utils, KEYS) {
+ function SingleSelection () {
+ SingleSelection.__super__.constructor.apply(this, arguments);
+ }
+
+ Utils.Extend(SingleSelection, BaseSelection);
+
+ SingleSelection.prototype.render = function () {
+ var $selection = SingleSelection.__super__.render.call(this);
+
+ $selection.addClass('select2-selection--single');
+
+ $selection.html(
+ ' ' +
+ '' +
+ ' ' +
+ ' '
+ );
+
+ return $selection;
+ };
+
+ SingleSelection.prototype.bind = function (container, $container) {
+ var self = this;
+
+ SingleSelection.__super__.bind.apply(this, arguments);
+
+ var id = container.id + '-container';
+
+ this.$selection.find('.select2-selection__rendered')
+ .attr('id', id)
+ .attr('role', 'textbox')
+ .attr('aria-readonly', 'true');
+ this.$selection.attr('aria-labelledby', id);
+
+ // This makes single non-search selects work in screen readers. If it causes problems elsewhere, remove.
+ this.$selection.attr('role', 'combobox');
+
+ this.$selection.on('mousedown', function (evt) {
+ // Only respond to left clicks
+ if (evt.which !== 1) {
+ return;
+ }
+
+ self.trigger('toggle', {
+ originalEvent: evt
+ });
+ });
+
+ this.$selection.on('focus', function (evt) {
+ // User focuses on the container
+ });
+
+ this.$selection.on('keydown', function (evt) {
+ // If user starts typing an alphanumeric key on the keyboard, open if not opened.
+ if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
+ container.open();
+ }
+ });
+
+ this.$selection.on('blur', function (evt) {
+ // User exits the container
+ });
+
+ container.on('focus', function (evt) {
+ if (!container.isOpen()) {
+ self.$selection.focus();
+ }
+ });
+
+ container.on('selection:update', function (params) {
+ self.update(params.data);
+ });
+ };
+
+ SingleSelection.prototype.clear = function () {
+ this.$selection.find('.select2-selection__rendered').empty();
+ };
+
+ SingleSelection.prototype.display = function (data, container) {
+ var template = this.options.get('templateSelection');
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ return escapeMarkup(template(data, container));
+ };
+
+ SingleSelection.prototype.selectionContainer = function () {
+ return $(' ');
+ };
+
+ SingleSelection.prototype.update = function (data) {
+ if (data.length === 0) {
+ this.clear();
+ return;
+ }
+
+ var selection = data[0];
+
+ var $rendered = this.$selection.find('.select2-selection__rendered');
+ var formatted = this.display(selection, $rendered);
+
+ $rendered.empty().append(formatted);
+ $rendered.prop('title', selection.title || selection.text);
+ };
+
+ return SingleSelection;
+});
+
+S2.define('select2/selection/multiple',[
+ 'jquery',
+ './base',
+ '../utils'
+], function ($, BaseSelection, Utils) {
+ function MultipleSelection ($element, options) {
+ MultipleSelection.__super__.constructor.apply(this, arguments);
+ }
+
+ Utils.Extend(MultipleSelection, BaseSelection);
+
+ MultipleSelection.prototype.render = function () {
+ var $selection = MultipleSelection.__super__.render.call(this);
+
+ $selection.addClass('select2-selection--multiple');
+
+ $selection.html(
+ ''
+ );
+
+ return $selection;
+ };
+
+ MultipleSelection.prototype.bind = function (container, $container) {
+ var self = this;
+
+ MultipleSelection.__super__.bind.apply(this, arguments);
+
+ this.$selection.on('click', function (evt) {
+ self.trigger('toggle', {
+ originalEvent: evt
+ });
+ });
+
+ this.$selection.on(
+ 'click',
+ '.select2-selection__choice__remove',
+ function (evt) {
+ // Ignore the event if it is disabled
+ if (self.options.get('disabled')) {
+ return;
+ }
+
+ var $remove = $(this);
+ var $selection = $remove.parent();
+
+ var data = $selection.data('data');
+
+ self.trigger('unselect', {
+ originalEvent: evt,
+ data: data
+ });
+ }
+ );
+ };
+
+ MultipleSelection.prototype.clear = function () {
+ this.$selection.find('.select2-selection__rendered').empty();
+ };
+
+ MultipleSelection.prototype.display = function (data, container) {
+ var template = this.options.get('templateSelection');
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ return escapeMarkup(template(data, container));
+ };
+
+ MultipleSelection.prototype.selectionContainer = function () {
+ var $container = $(
+ '' +
+ '' +
+ '×' +
+ ' ' +
+ ' '
+ );
+
+ return $container;
+ };
+
+ MultipleSelection.prototype.update = function (data) {
+ var self = this;
+ this.clear();
+
+ if (data.length === 0) {
+ return;
+ }
+
+ var $selections = [];
+
+ for (var d = 0; d < data.length; d++) {
+ var selection = data[d];
+
+ var $selection = this.selectionContainer();
+ var formatted = this.display(selection, $selection).trim();
+
+ $selection.append(formatted);
+ $selection.prop('title', selection.title || selection.text);
+
+ $selection.data('data', selection);
+
+ $selections.push($selection);
+ }
+
+ var $rendered = this.$selection.find('.select2-selection__rendered');
+
+ Utils.appendMany($rendered, $selections);
+
+ // Return cursor to search field after updating.
+ // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
+ if ('undefined' !== typeof this.$search) {
+ setTimeout(function(){
+ self.$search.focus();
+ }, 1);
+ }
+ };
+
+ return MultipleSelection;
+});
+
+S2.define('select2/selection/placeholder',[
+ '../utils'
+], function (Utils) {
+ function Placeholder (decorated, $element, options) {
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
+
+ decorated.call(this, $element, options);
+ }
+
+ Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
+ if (typeof placeholder === 'string') {
+ placeholder = {
+ id: '',
+ text: placeholder
+ };
+ }
+
+ return placeholder;
+ };
+
+ Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
+ var $placeholder = this.selectionContainer();
+
+ $placeholder.html(this.display(placeholder));
+ $placeholder.addClass('select2-selection__placeholder')
+ .removeClass('select2-selection__choice');
+
+ return $placeholder;
+ };
+
+ Placeholder.prototype.update = function (decorated, data) {
+ var singlePlaceholder = (
+ data.length == 1 && data[0].id != this.placeholder.id
+ );
+ var multipleSelections = data.length > 1;
+
+ if (multipleSelections || singlePlaceholder) {
+ return decorated.call(this, data);
+ }
+
+ this.clear();
+
+ var $placeholder = this.createPlaceholder(this.placeholder);
+
+ this.$selection.find('.select2-selection__rendered').append($placeholder);
+ };
+
+ return Placeholder;
+});
+
+S2.define('select2/selection/allowClear',[
+ 'jquery',
+ '../keys'
+], function ($, KEYS) {
+ function AllowClear () { }
+
+ AllowClear.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ if (this.placeholder == null) {
+ if (this.options.get('debug') && window.console && console.error) {
+ console.error(
+ 'Select2: The `allowClear` option should be used in combination ' +
+ 'with the `placeholder` option.'
+ );
+ }
+ }
+
+ this.$selection.on('mousedown', '.select2-selection__clear',
+ function (evt) {
+ self._handleClear(evt);
+ });
+
+ container.on('keypress', function (evt) {
+ self._handleKeyboardClear(evt, container);
+ });
+ };
+
+ AllowClear.prototype._handleClear = function (_, evt) {
+ // Ignore the event if it is disabled
+ if (this.options.get('disabled')) {
+ return;
+ }
+
+ var $clear = this.$selection.find('.select2-selection__clear');
+
+ // Ignore the event if nothing has been selected
+ if ($clear.length === 0) {
+ return;
+ }
+
+ evt.stopPropagation();
+
+ var data = $clear.data('data');
+
+ for (var d = 0; d < data.length; d++) {
+ var unselectData = {
+ data: data[d]
+ };
+
+ // Trigger the `unselect` event, so people can prevent it from being
+ // cleared.
+ this.trigger('unselect', unselectData);
+
+ // If the event was prevented, don't clear it out.
+ if (unselectData.prevented) {
+ return;
+ }
+ }
+
+ this.$element.val(this.placeholder.id).trigger('change');
+
+ this.trigger('toggle', {});
+ };
+
+ AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
+ if (container.isOpen()) {
+ return;
+ }
+
+ if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
+ this._handleClear(evt);
+ }
+ };
+
+ AllowClear.prototype.update = function (decorated, data) {
+ decorated.call(this, data);
+
+ if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
+ data.length === 0) {
+ return;
+ }
+
+ var $remove = $(
+ '' +
+ '×' +
+ ' '
+ );
+ $remove.data('data', data);
+
+ this.$selection.find('.select2-selection__rendered').prepend($remove);
+ };
+
+ return AllowClear;
+});
+
+S2.define('select2/selection/search',[
+ 'jquery',
+ '../utils',
+ '../keys'
+], function ($, Utils, KEYS) {
+ function Search (decorated, $element, options) {
+ decorated.call(this, $element, options);
+ }
+
+ Search.prototype.render = function (decorated) {
+ var $search = $(
+ '' +
+ ' ' +
+ ' '
+ );
+
+ this.$searchContainer = $search;
+ this.$search = $search.find('input');
+
+ var $rendered = decorated.call(this);
+
+ this._transferTabIndex();
+
+ return $rendered;
+ };
+
+ Search.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+ var resultsId = container.id + '-results';
+
+ decorated.call(this, container, $container);
+
+ container.on('open', function () {
+ self.$search.attr('aria-owns', resultsId);
+ self.$search.trigger('focus');
+ });
+
+ container.on('close', function () {
+ self.$search.val('');
+ self.$search.removeAttr('aria-activedescendant');
+ self.$search.removeAttr('aria-owns');
+ self.$search.trigger('focus');
+ });
+
+ container.on('enable', function () {
+ self.$search.prop('disabled', false);
+
+ self._transferTabIndex();
+ });
+
+ container.on('disable', function () {
+ self.$search.prop('disabled', true);
+ });
+
+ container.on('focus', function (evt) {
+ self.$search.trigger('focus');
+ });
+
+ container.on('results:focus', function (params) {
+ self.$search.attr('aria-activedescendant', params.data._resultId);
+ });
+
+ this.$selection.on('focusin', '.select2-search--inline', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this.$selection.on('focusout', '.select2-search--inline', function (evt) {
+ self._handleBlur(evt);
+ });
+
+ this.$selection.on('keydown', '.select2-search--inline', function (evt) {
+ evt.stopPropagation();
+
+ self.trigger('keypress', evt);
+
+ self._keyUpPrevented = evt.isDefaultPrevented();
+
+ var key = evt.which;
+
+ if (key === KEYS.BACKSPACE && self.$search.val() === '') {
+ var $previousChoice = self.$searchContainer
+ .prev('.select2-selection__choice');
+
+ if ($previousChoice.length > 0) {
+ var item = $previousChoice.data('data');
+
+ self.searchRemoveChoice(item);
+
+ evt.preventDefault();
+ }
+ }
+ });
+
+ // Try to detect the IE version should the `documentMode` property that
+ // is stored on the document. This is only implemented in IE and is
+ // slightly cleaner than doing a user agent check.
+ // This property is not available in Edge, but Edge also doesn't have
+ // this bug.
+ var msie = document.documentMode;
+ var disableInputEvents = msie && msie <= 11;
+
+ // Workaround for browsers which do not support the `input` event
+ // This will prevent double-triggering of events for browsers which support
+ // both the `keyup` and `input` events.
+ this.$selection.on(
+ 'input.searchcheck',
+ '.select2-search--inline',
+ function (evt) {
+ // IE will trigger the `input` event when a placeholder is used on a
+ // search box. To get around this issue, we are forced to ignore all
+ // `input` events in IE and keep using `keyup`.
+ if (disableInputEvents) {
+ self.$selection.off('input.search input.searchcheck');
+ return;
+ }
+
+ // Unbind the duplicated `keyup` event
+ self.$selection.off('keyup.search');
+ }
+ );
+
+ this.$selection.on(
+ 'keyup.search input.search',
+ '.select2-search--inline',
+ function (evt) {
+ // IE will trigger the `input` event when a placeholder is used on a
+ // search box. To get around this issue, we are forced to ignore all
+ // `input` events in IE and keep using `keyup`.
+ if (disableInputEvents && evt.type === 'input') {
+ self.$selection.off('input.search input.searchcheck');
+ return;
+ }
+
+ var key = evt.which;
+
+ // We can freely ignore events from modifier keys
+ if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
+ return;
+ }
+
+ // Tabbing will be handled during the `keydown` phase
+ if (key == KEYS.TAB) {
+ return;
+ }
+
+ self.handleSearch(evt);
+ }
+ );
+ };
+
+ /**
+ * This method will transfer the tabindex attribute from the rendered
+ * selection to the search box. This allows for the search box to be used as
+ * the primary focus instead of the selection container.
+ *
+ * @private
+ */
+ Search.prototype._transferTabIndex = function (decorated) {
+ this.$search.attr('tabindex', this.$selection.attr('tabindex'));
+ this.$selection.attr('tabindex', '-1');
+ };
+
+ Search.prototype.createPlaceholder = function (decorated, placeholder) {
+ this.$search.attr('placeholder', placeholder.text);
+ };
+
+ Search.prototype.update = function (decorated, data) {
+ var searchHadFocus = this.$search[0] == document.activeElement;
+
+ this.$search.attr('placeholder', '');
+
+ decorated.call(this, data);
+
+ this.$selection.find('.select2-selection__rendered')
+ .append(this.$searchContainer);
+
+ this.resizeSearch();
+ if (searchHadFocus) {
+ this.$search.focus();
+ }
+ };
+
+ Search.prototype.handleSearch = function () {
+ this.resizeSearch();
+
+ if (!this._keyUpPrevented) {
+ var input = this.$search.val();
+
+ this.trigger('query', {
+ term: input
+ });
+ }
+
+ this._keyUpPrevented = false;
+ };
+
+ Search.prototype.searchRemoveChoice = function (decorated, item) {
+ this.trigger('unselect', {
+ data: item
+ });
+
+ this.$search.val(item.text);
+ this.handleSearch();
+ };
+
+ Search.prototype.resizeSearch = function () {
+ this.$search.css('width', '25px');
+
+ var width = '';
+
+ if (this.$search.attr('placeholder') !== '') {
+ width = this.$selection.find('.select2-selection__rendered').innerWidth();
+ } else {
+ var minimumWidth = this.$search.val().length + 1;
+
+ width = (minimumWidth * 0.75) + 'em';
+ }
+
+ this.$search.css('width', width);
+ };
+
+ return Search;
+});
+
+S2.define('select2/selection/eventRelay',[
+ 'jquery'
+], function ($) {
+ function EventRelay () { }
+
+ EventRelay.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+ var relayEvents = [
+ 'open', 'opening',
+ 'close', 'closing',
+ 'select', 'selecting',
+ 'unselect', 'unselecting'
+ ];
+
+ var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
+
+ decorated.call(this, container, $container);
+
+ container.on('*', function (name, params) {
+ // Ignore events that should not be relayed
+ if ($.inArray(name, relayEvents) === -1) {
+ return;
+ }
+
+ // The parameters should always be an object
+ params = params || {};
+
+ // Generate the jQuery event for the Select2 event
+ var evt = $.Event('select2:' + name, {
+ params: params
+ });
+
+ self.$element.trigger(evt);
+
+ // Only handle preventable events if it was one
+ if ($.inArray(name, preventableEvents) === -1) {
+ return;
+ }
+
+ params.prevented = evt.isDefaultPrevented();
+ });
+ };
+
+ return EventRelay;
+});
+
+S2.define('select2/translation',[
+ 'jquery',
+ 'require'
+], function ($, require) {
+ function Translation (dict) {
+ this.dict = dict || {};
+ }
+
+ Translation.prototype.all = function () {
+ return this.dict;
+ };
+
+ Translation.prototype.get = function (key) {
+ return this.dict[key];
+ };
+
+ Translation.prototype.extend = function (translation) {
+ this.dict = $.extend({}, translation.all(), this.dict);
+ };
+
+ // Static functions
+
+ Translation._cache = {};
+
+ Translation.loadPath = function (path) {
+ if (!(path in Translation._cache)) {
+ var translations = require(path);
+
+ Translation._cache[path] = translations;
+ }
+
+ return new Translation(Translation._cache[path]);
+ };
+
+ return Translation;
+});
+
+S2.define('select2/diacritics',[
+
+], function () {
+ var diacritics = {
+ '\u24B6': 'A',
+ '\uFF21': 'A',
+ '\u00C0': 'A',
+ '\u00C1': 'A',
+ '\u00C2': 'A',
+ '\u1EA6': 'A',
+ '\u1EA4': 'A',
+ '\u1EAA': 'A',
+ '\u1EA8': 'A',
+ '\u00C3': 'A',
+ '\u0100': 'A',
+ '\u0102': 'A',
+ '\u1EB0': 'A',
+ '\u1EAE': 'A',
+ '\u1EB4': 'A',
+ '\u1EB2': 'A',
+ '\u0226': 'A',
+ '\u01E0': 'A',
+ '\u00C4': 'A',
+ '\u01DE': 'A',
+ '\u1EA2': 'A',
+ '\u00C5': 'A',
+ '\u01FA': 'A',
+ '\u01CD': 'A',
+ '\u0200': 'A',
+ '\u0202': 'A',
+ '\u1EA0': 'A',
+ '\u1EAC': 'A',
+ '\u1EB6': 'A',
+ '\u1E00': 'A',
+ '\u0104': 'A',
+ '\u023A': 'A',
+ '\u2C6F': 'A',
+ '\uA732': 'AA',
+ '\u00C6': 'AE',
+ '\u01FC': 'AE',
+ '\u01E2': 'AE',
+ '\uA734': 'AO',
+ '\uA736': 'AU',
+ '\uA738': 'AV',
+ '\uA73A': 'AV',
+ '\uA73C': 'AY',
+ '\u24B7': 'B',
+ '\uFF22': 'B',
+ '\u1E02': 'B',
+ '\u1E04': 'B',
+ '\u1E06': 'B',
+ '\u0243': 'B',
+ '\u0182': 'B',
+ '\u0181': 'B',
+ '\u24B8': 'C',
+ '\uFF23': 'C',
+ '\u0106': 'C',
+ '\u0108': 'C',
+ '\u010A': 'C',
+ '\u010C': 'C',
+ '\u00C7': 'C',
+ '\u1E08': 'C',
+ '\u0187': 'C',
+ '\u023B': 'C',
+ '\uA73E': 'C',
+ '\u24B9': 'D',
+ '\uFF24': 'D',
+ '\u1E0A': 'D',
+ '\u010E': 'D',
+ '\u1E0C': 'D',
+ '\u1E10': 'D',
+ '\u1E12': 'D',
+ '\u1E0E': 'D',
+ '\u0110': 'D',
+ '\u018B': 'D',
+ '\u018A': 'D',
+ '\u0189': 'D',
+ '\uA779': 'D',
+ '\u01F1': 'DZ',
+ '\u01C4': 'DZ',
+ '\u01F2': 'Dz',
+ '\u01C5': 'Dz',
+ '\u24BA': 'E',
+ '\uFF25': 'E',
+ '\u00C8': 'E',
+ '\u00C9': 'E',
+ '\u00CA': 'E',
+ '\u1EC0': 'E',
+ '\u1EBE': 'E',
+ '\u1EC4': 'E',
+ '\u1EC2': 'E',
+ '\u1EBC': 'E',
+ '\u0112': 'E',
+ '\u1E14': 'E',
+ '\u1E16': 'E',
+ '\u0114': 'E',
+ '\u0116': 'E',
+ '\u00CB': 'E',
+ '\u1EBA': 'E',
+ '\u011A': 'E',
+ '\u0204': 'E',
+ '\u0206': 'E',
+ '\u1EB8': 'E',
+ '\u1EC6': 'E',
+ '\u0228': 'E',
+ '\u1E1C': 'E',
+ '\u0118': 'E',
+ '\u1E18': 'E',
+ '\u1E1A': 'E',
+ '\u0190': 'E',
+ '\u018E': 'E',
+ '\u24BB': 'F',
+ '\uFF26': 'F',
+ '\u1E1E': 'F',
+ '\u0191': 'F',
+ '\uA77B': 'F',
+ '\u24BC': 'G',
+ '\uFF27': 'G',
+ '\u01F4': 'G',
+ '\u011C': 'G',
+ '\u1E20': 'G',
+ '\u011E': 'G',
+ '\u0120': 'G',
+ '\u01E6': 'G',
+ '\u0122': 'G',
+ '\u01E4': 'G',
+ '\u0193': 'G',
+ '\uA7A0': 'G',
+ '\uA77D': 'G',
+ '\uA77E': 'G',
+ '\u24BD': 'H',
+ '\uFF28': 'H',
+ '\u0124': 'H',
+ '\u1E22': 'H',
+ '\u1E26': 'H',
+ '\u021E': 'H',
+ '\u1E24': 'H',
+ '\u1E28': 'H',
+ '\u1E2A': 'H',
+ '\u0126': 'H',
+ '\u2C67': 'H',
+ '\u2C75': 'H',
+ '\uA78D': 'H',
+ '\u24BE': 'I',
+ '\uFF29': 'I',
+ '\u00CC': 'I',
+ '\u00CD': 'I',
+ '\u00CE': 'I',
+ '\u0128': 'I',
+ '\u012A': 'I',
+ '\u012C': 'I',
+ '\u0130': 'I',
+ '\u00CF': 'I',
+ '\u1E2E': 'I',
+ '\u1EC8': 'I',
+ '\u01CF': 'I',
+ '\u0208': 'I',
+ '\u020A': 'I',
+ '\u1ECA': 'I',
+ '\u012E': 'I',
+ '\u1E2C': 'I',
+ '\u0197': 'I',
+ '\u24BF': 'J',
+ '\uFF2A': 'J',
+ '\u0134': 'J',
+ '\u0248': 'J',
+ '\u24C0': 'K',
+ '\uFF2B': 'K',
+ '\u1E30': 'K',
+ '\u01E8': 'K',
+ '\u1E32': 'K',
+ '\u0136': 'K',
+ '\u1E34': 'K',
+ '\u0198': 'K',
+ '\u2C69': 'K',
+ '\uA740': 'K',
+ '\uA742': 'K',
+ '\uA744': 'K',
+ '\uA7A2': 'K',
+ '\u24C1': 'L',
+ '\uFF2C': 'L',
+ '\u013F': 'L',
+ '\u0139': 'L',
+ '\u013D': 'L',
+ '\u1E36': 'L',
+ '\u1E38': 'L',
+ '\u013B': 'L',
+ '\u1E3C': 'L',
+ '\u1E3A': 'L',
+ '\u0141': 'L',
+ '\u023D': 'L',
+ '\u2C62': 'L',
+ '\u2C60': 'L',
+ '\uA748': 'L',
+ '\uA746': 'L',
+ '\uA780': 'L',
+ '\u01C7': 'LJ',
+ '\u01C8': 'Lj',
+ '\u24C2': 'M',
+ '\uFF2D': 'M',
+ '\u1E3E': 'M',
+ '\u1E40': 'M',
+ '\u1E42': 'M',
+ '\u2C6E': 'M',
+ '\u019C': 'M',
+ '\u24C3': 'N',
+ '\uFF2E': 'N',
+ '\u01F8': 'N',
+ '\u0143': 'N',
+ '\u00D1': 'N',
+ '\u1E44': 'N',
+ '\u0147': 'N',
+ '\u1E46': 'N',
+ '\u0145': 'N',
+ '\u1E4A': 'N',
+ '\u1E48': 'N',
+ '\u0220': 'N',
+ '\u019D': 'N',
+ '\uA790': 'N',
+ '\uA7A4': 'N',
+ '\u01CA': 'NJ',
+ '\u01CB': 'Nj',
+ '\u24C4': 'O',
+ '\uFF2F': 'O',
+ '\u00D2': 'O',
+ '\u00D3': 'O',
+ '\u00D4': 'O',
+ '\u1ED2': 'O',
+ '\u1ED0': 'O',
+ '\u1ED6': 'O',
+ '\u1ED4': 'O',
+ '\u00D5': 'O',
+ '\u1E4C': 'O',
+ '\u022C': 'O',
+ '\u1E4E': 'O',
+ '\u014C': 'O',
+ '\u1E50': 'O',
+ '\u1E52': 'O',
+ '\u014E': 'O',
+ '\u022E': 'O',
+ '\u0230': 'O',
+ '\u00D6': 'O',
+ '\u022A': 'O',
+ '\u1ECE': 'O',
+ '\u0150': 'O',
+ '\u01D1': 'O',
+ '\u020C': 'O',
+ '\u020E': 'O',
+ '\u01A0': 'O',
+ '\u1EDC': 'O',
+ '\u1EDA': 'O',
+ '\u1EE0': 'O',
+ '\u1EDE': 'O',
+ '\u1EE2': 'O',
+ '\u1ECC': 'O',
+ '\u1ED8': 'O',
+ '\u01EA': 'O',
+ '\u01EC': 'O',
+ '\u00D8': 'O',
+ '\u01FE': 'O',
+ '\u0186': 'O',
+ '\u019F': 'O',
+ '\uA74A': 'O',
+ '\uA74C': 'O',
+ '\u01A2': 'OI',
+ '\uA74E': 'OO',
+ '\u0222': 'OU',
+ '\u24C5': 'P',
+ '\uFF30': 'P',
+ '\u1E54': 'P',
+ '\u1E56': 'P',
+ '\u01A4': 'P',
+ '\u2C63': 'P',
+ '\uA750': 'P',
+ '\uA752': 'P',
+ '\uA754': 'P',
+ '\u24C6': 'Q',
+ '\uFF31': 'Q',
+ '\uA756': 'Q',
+ '\uA758': 'Q',
+ '\u024A': 'Q',
+ '\u24C7': 'R',
+ '\uFF32': 'R',
+ '\u0154': 'R',
+ '\u1E58': 'R',
+ '\u0158': 'R',
+ '\u0210': 'R',
+ '\u0212': 'R',
+ '\u1E5A': 'R',
+ '\u1E5C': 'R',
+ '\u0156': 'R',
+ '\u1E5E': 'R',
+ '\u024C': 'R',
+ '\u2C64': 'R',
+ '\uA75A': 'R',
+ '\uA7A6': 'R',
+ '\uA782': 'R',
+ '\u24C8': 'S',
+ '\uFF33': 'S',
+ '\u1E9E': 'S',
+ '\u015A': 'S',
+ '\u1E64': 'S',
+ '\u015C': 'S',
+ '\u1E60': 'S',
+ '\u0160': 'S',
+ '\u1E66': 'S',
+ '\u1E62': 'S',
+ '\u1E68': 'S',
+ '\u0218': 'S',
+ '\u015E': 'S',
+ '\u2C7E': 'S',
+ '\uA7A8': 'S',
+ '\uA784': 'S',
+ '\u24C9': 'T',
+ '\uFF34': 'T',
+ '\u1E6A': 'T',
+ '\u0164': 'T',
+ '\u1E6C': 'T',
+ '\u021A': 'T',
+ '\u0162': 'T',
+ '\u1E70': 'T',
+ '\u1E6E': 'T',
+ '\u0166': 'T',
+ '\u01AC': 'T',
+ '\u01AE': 'T',
+ '\u023E': 'T',
+ '\uA786': 'T',
+ '\uA728': 'TZ',
+ '\u24CA': 'U',
+ '\uFF35': 'U',
+ '\u00D9': 'U',
+ '\u00DA': 'U',
+ '\u00DB': 'U',
+ '\u0168': 'U',
+ '\u1E78': 'U',
+ '\u016A': 'U',
+ '\u1E7A': 'U',
+ '\u016C': 'U',
+ '\u00DC': 'U',
+ '\u01DB': 'U',
+ '\u01D7': 'U',
+ '\u01D5': 'U',
+ '\u01D9': 'U',
+ '\u1EE6': 'U',
+ '\u016E': 'U',
+ '\u0170': 'U',
+ '\u01D3': 'U',
+ '\u0214': 'U',
+ '\u0216': 'U',
+ '\u01AF': 'U',
+ '\u1EEA': 'U',
+ '\u1EE8': 'U',
+ '\u1EEE': 'U',
+ '\u1EEC': 'U',
+ '\u1EF0': 'U',
+ '\u1EE4': 'U',
+ '\u1E72': 'U',
+ '\u0172': 'U',
+ '\u1E76': 'U',
+ '\u1E74': 'U',
+ '\u0244': 'U',
+ '\u24CB': 'V',
+ '\uFF36': 'V',
+ '\u1E7C': 'V',
+ '\u1E7E': 'V',
+ '\u01B2': 'V',
+ '\uA75E': 'V',
+ '\u0245': 'V',
+ '\uA760': 'VY',
+ '\u24CC': 'W',
+ '\uFF37': 'W',
+ '\u1E80': 'W',
+ '\u1E82': 'W',
+ '\u0174': 'W',
+ '\u1E86': 'W',
+ '\u1E84': 'W',
+ '\u1E88': 'W',
+ '\u2C72': 'W',
+ '\u24CD': 'X',
+ '\uFF38': 'X',
+ '\u1E8A': 'X',
+ '\u1E8C': 'X',
+ '\u24CE': 'Y',
+ '\uFF39': 'Y',
+ '\u1EF2': 'Y',
+ '\u00DD': 'Y',
+ '\u0176': 'Y',
+ '\u1EF8': 'Y',
+ '\u0232': 'Y',
+ '\u1E8E': 'Y',
+ '\u0178': 'Y',
+ '\u1EF6': 'Y',
+ '\u1EF4': 'Y',
+ '\u01B3': 'Y',
+ '\u024E': 'Y',
+ '\u1EFE': 'Y',
+ '\u24CF': 'Z',
+ '\uFF3A': 'Z',
+ '\u0179': 'Z',
+ '\u1E90': 'Z',
+ '\u017B': 'Z',
+ '\u017D': 'Z',
+ '\u1E92': 'Z',
+ '\u1E94': 'Z',
+ '\u01B5': 'Z',
+ '\u0224': 'Z',
+ '\u2C7F': 'Z',
+ '\u2C6B': 'Z',
+ '\uA762': 'Z',
+ '\u24D0': 'a',
+ '\uFF41': 'a',
+ '\u1E9A': 'a',
+ '\u00E0': 'a',
+ '\u00E1': 'a',
+ '\u00E2': 'a',
+ '\u1EA7': 'a',
+ '\u1EA5': 'a',
+ '\u1EAB': 'a',
+ '\u1EA9': 'a',
+ '\u00E3': 'a',
+ '\u0101': 'a',
+ '\u0103': 'a',
+ '\u1EB1': 'a',
+ '\u1EAF': 'a',
+ '\u1EB5': 'a',
+ '\u1EB3': 'a',
+ '\u0227': 'a',
+ '\u01E1': 'a',
+ '\u00E4': 'a',
+ '\u01DF': 'a',
+ '\u1EA3': 'a',
+ '\u00E5': 'a',
+ '\u01FB': 'a',
+ '\u01CE': 'a',
+ '\u0201': 'a',
+ '\u0203': 'a',
+ '\u1EA1': 'a',
+ '\u1EAD': 'a',
+ '\u1EB7': 'a',
+ '\u1E01': 'a',
+ '\u0105': 'a',
+ '\u2C65': 'a',
+ '\u0250': 'a',
+ '\uA733': 'aa',
+ '\u00E6': 'ae',
+ '\u01FD': 'ae',
+ '\u01E3': 'ae',
+ '\uA735': 'ao',
+ '\uA737': 'au',
+ '\uA739': 'av',
+ '\uA73B': 'av',
+ '\uA73D': 'ay',
+ '\u24D1': 'b',
+ '\uFF42': 'b',
+ '\u1E03': 'b',
+ '\u1E05': 'b',
+ '\u1E07': 'b',
+ '\u0180': 'b',
+ '\u0183': 'b',
+ '\u0253': 'b',
+ '\u24D2': 'c',
+ '\uFF43': 'c',
+ '\u0107': 'c',
+ '\u0109': 'c',
+ '\u010B': 'c',
+ '\u010D': 'c',
+ '\u00E7': 'c',
+ '\u1E09': 'c',
+ '\u0188': 'c',
+ '\u023C': 'c',
+ '\uA73F': 'c',
+ '\u2184': 'c',
+ '\u24D3': 'd',
+ '\uFF44': 'd',
+ '\u1E0B': 'd',
+ '\u010F': 'd',
+ '\u1E0D': 'd',
+ '\u1E11': 'd',
+ '\u1E13': 'd',
+ '\u1E0F': 'd',
+ '\u0111': 'd',
+ '\u018C': 'd',
+ '\u0256': 'd',
+ '\u0257': 'd',
+ '\uA77A': 'd',
+ '\u01F3': 'dz',
+ '\u01C6': 'dz',
+ '\u24D4': 'e',
+ '\uFF45': 'e',
+ '\u00E8': 'e',
+ '\u00E9': 'e',
+ '\u00EA': 'e',
+ '\u1EC1': 'e',
+ '\u1EBF': 'e',
+ '\u1EC5': 'e',
+ '\u1EC3': 'e',
+ '\u1EBD': 'e',
+ '\u0113': 'e',
+ '\u1E15': 'e',
+ '\u1E17': 'e',
+ '\u0115': 'e',
+ '\u0117': 'e',
+ '\u00EB': 'e',
+ '\u1EBB': 'e',
+ '\u011B': 'e',
+ '\u0205': 'e',
+ '\u0207': 'e',
+ '\u1EB9': 'e',
+ '\u1EC7': 'e',
+ '\u0229': 'e',
+ '\u1E1D': 'e',
+ '\u0119': 'e',
+ '\u1E19': 'e',
+ '\u1E1B': 'e',
+ '\u0247': 'e',
+ '\u025B': 'e',
+ '\u01DD': 'e',
+ '\u24D5': 'f',
+ '\uFF46': 'f',
+ '\u1E1F': 'f',
+ '\u0192': 'f',
+ '\uA77C': 'f',
+ '\u24D6': 'g',
+ '\uFF47': 'g',
+ '\u01F5': 'g',
+ '\u011D': 'g',
+ '\u1E21': 'g',
+ '\u011F': 'g',
+ '\u0121': 'g',
+ '\u01E7': 'g',
+ '\u0123': 'g',
+ '\u01E5': 'g',
+ '\u0260': 'g',
+ '\uA7A1': 'g',
+ '\u1D79': 'g',
+ '\uA77F': 'g',
+ '\u24D7': 'h',
+ '\uFF48': 'h',
+ '\u0125': 'h',
+ '\u1E23': 'h',
+ '\u1E27': 'h',
+ '\u021F': 'h',
+ '\u1E25': 'h',
+ '\u1E29': 'h',
+ '\u1E2B': 'h',
+ '\u1E96': 'h',
+ '\u0127': 'h',
+ '\u2C68': 'h',
+ '\u2C76': 'h',
+ '\u0265': 'h',
+ '\u0195': 'hv',
+ '\u24D8': 'i',
+ '\uFF49': 'i',
+ '\u00EC': 'i',
+ '\u00ED': 'i',
+ '\u00EE': 'i',
+ '\u0129': 'i',
+ '\u012B': 'i',
+ '\u012D': 'i',
+ '\u00EF': 'i',
+ '\u1E2F': 'i',
+ '\u1EC9': 'i',
+ '\u01D0': 'i',
+ '\u0209': 'i',
+ '\u020B': 'i',
+ '\u1ECB': 'i',
+ '\u012F': 'i',
+ '\u1E2D': 'i',
+ '\u0268': 'i',
+ '\u0131': 'i',
+ '\u24D9': 'j',
+ '\uFF4A': 'j',
+ '\u0135': 'j',
+ '\u01F0': 'j',
+ '\u0249': 'j',
+ '\u24DA': 'k',
+ '\uFF4B': 'k',
+ '\u1E31': 'k',
+ '\u01E9': 'k',
+ '\u1E33': 'k',
+ '\u0137': 'k',
+ '\u1E35': 'k',
+ '\u0199': 'k',
+ '\u2C6A': 'k',
+ '\uA741': 'k',
+ '\uA743': 'k',
+ '\uA745': 'k',
+ '\uA7A3': 'k',
+ '\u24DB': 'l',
+ '\uFF4C': 'l',
+ '\u0140': 'l',
+ '\u013A': 'l',
+ '\u013E': 'l',
+ '\u1E37': 'l',
+ '\u1E39': 'l',
+ '\u013C': 'l',
+ '\u1E3D': 'l',
+ '\u1E3B': 'l',
+ '\u017F': 'l',
+ '\u0142': 'l',
+ '\u019A': 'l',
+ '\u026B': 'l',
+ '\u2C61': 'l',
+ '\uA749': 'l',
+ '\uA781': 'l',
+ '\uA747': 'l',
+ '\u01C9': 'lj',
+ '\u24DC': 'm',
+ '\uFF4D': 'm',
+ '\u1E3F': 'm',
+ '\u1E41': 'm',
+ '\u1E43': 'm',
+ '\u0271': 'm',
+ '\u026F': 'm',
+ '\u24DD': 'n',
+ '\uFF4E': 'n',
+ '\u01F9': 'n',
+ '\u0144': 'n',
+ '\u00F1': 'n',
+ '\u1E45': 'n',
+ '\u0148': 'n',
+ '\u1E47': 'n',
+ '\u0146': 'n',
+ '\u1E4B': 'n',
+ '\u1E49': 'n',
+ '\u019E': 'n',
+ '\u0272': 'n',
+ '\u0149': 'n',
+ '\uA791': 'n',
+ '\uA7A5': 'n',
+ '\u01CC': 'nj',
+ '\u24DE': 'o',
+ '\uFF4F': 'o',
+ '\u00F2': 'o',
+ '\u00F3': 'o',
+ '\u00F4': 'o',
+ '\u1ED3': 'o',
+ '\u1ED1': 'o',
+ '\u1ED7': 'o',
+ '\u1ED5': 'o',
+ '\u00F5': 'o',
+ '\u1E4D': 'o',
+ '\u022D': 'o',
+ '\u1E4F': 'o',
+ '\u014D': 'o',
+ '\u1E51': 'o',
+ '\u1E53': 'o',
+ '\u014F': 'o',
+ '\u022F': 'o',
+ '\u0231': 'o',
+ '\u00F6': 'o',
+ '\u022B': 'o',
+ '\u1ECF': 'o',
+ '\u0151': 'o',
+ '\u01D2': 'o',
+ '\u020D': 'o',
+ '\u020F': 'o',
+ '\u01A1': 'o',
+ '\u1EDD': 'o',
+ '\u1EDB': 'o',
+ '\u1EE1': 'o',
+ '\u1EDF': 'o',
+ '\u1EE3': 'o',
+ '\u1ECD': 'o',
+ '\u1ED9': 'o',
+ '\u01EB': 'o',
+ '\u01ED': 'o',
+ '\u00F8': 'o',
+ '\u01FF': 'o',
+ '\u0254': 'o',
+ '\uA74B': 'o',
+ '\uA74D': 'o',
+ '\u0275': 'o',
+ '\u01A3': 'oi',
+ '\u0223': 'ou',
+ '\uA74F': 'oo',
+ '\u24DF': 'p',
+ '\uFF50': 'p',
+ '\u1E55': 'p',
+ '\u1E57': 'p',
+ '\u01A5': 'p',
+ '\u1D7D': 'p',
+ '\uA751': 'p',
+ '\uA753': 'p',
+ '\uA755': 'p',
+ '\u24E0': 'q',
+ '\uFF51': 'q',
+ '\u024B': 'q',
+ '\uA757': 'q',
+ '\uA759': 'q',
+ '\u24E1': 'r',
+ '\uFF52': 'r',
+ '\u0155': 'r',
+ '\u1E59': 'r',
+ '\u0159': 'r',
+ '\u0211': 'r',
+ '\u0213': 'r',
+ '\u1E5B': 'r',
+ '\u1E5D': 'r',
+ '\u0157': 'r',
+ '\u1E5F': 'r',
+ '\u024D': 'r',
+ '\u027D': 'r',
+ '\uA75B': 'r',
+ '\uA7A7': 'r',
+ '\uA783': 'r',
+ '\u24E2': 's',
+ '\uFF53': 's',
+ '\u00DF': 's',
+ '\u015B': 's',
+ '\u1E65': 's',
+ '\u015D': 's',
+ '\u1E61': 's',
+ '\u0161': 's',
+ '\u1E67': 's',
+ '\u1E63': 's',
+ '\u1E69': 's',
+ '\u0219': 's',
+ '\u015F': 's',
+ '\u023F': 's',
+ '\uA7A9': 's',
+ '\uA785': 's',
+ '\u1E9B': 's',
+ '\u24E3': 't',
+ '\uFF54': 't',
+ '\u1E6B': 't',
+ '\u1E97': 't',
+ '\u0165': 't',
+ '\u1E6D': 't',
+ '\u021B': 't',
+ '\u0163': 't',
+ '\u1E71': 't',
+ '\u1E6F': 't',
+ '\u0167': 't',
+ '\u01AD': 't',
+ '\u0288': 't',
+ '\u2C66': 't',
+ '\uA787': 't',
+ '\uA729': 'tz',
+ '\u24E4': 'u',
+ '\uFF55': 'u',
+ '\u00F9': 'u',
+ '\u00FA': 'u',
+ '\u00FB': 'u',
+ '\u0169': 'u',
+ '\u1E79': 'u',
+ '\u016B': 'u',
+ '\u1E7B': 'u',
+ '\u016D': 'u',
+ '\u00FC': 'u',
+ '\u01DC': 'u',
+ '\u01D8': 'u',
+ '\u01D6': 'u',
+ '\u01DA': 'u',
+ '\u1EE7': 'u',
+ '\u016F': 'u',
+ '\u0171': 'u',
+ '\u01D4': 'u',
+ '\u0215': 'u',
+ '\u0217': 'u',
+ '\u01B0': 'u',
+ '\u1EEB': 'u',
+ '\u1EE9': 'u',
+ '\u1EEF': 'u',
+ '\u1EED': 'u',
+ '\u1EF1': 'u',
+ '\u1EE5': 'u',
+ '\u1E73': 'u',
+ '\u0173': 'u',
+ '\u1E77': 'u',
+ '\u1E75': 'u',
+ '\u0289': 'u',
+ '\u24E5': 'v',
+ '\uFF56': 'v',
+ '\u1E7D': 'v',
+ '\u1E7F': 'v',
+ '\u028B': 'v',
+ '\uA75F': 'v',
+ '\u028C': 'v',
+ '\uA761': 'vy',
+ '\u24E6': 'w',
+ '\uFF57': 'w',
+ '\u1E81': 'w',
+ '\u1E83': 'w',
+ '\u0175': 'w',
+ '\u1E87': 'w',
+ '\u1E85': 'w',
+ '\u1E98': 'w',
+ '\u1E89': 'w',
+ '\u2C73': 'w',
+ '\u24E7': 'x',
+ '\uFF58': 'x',
+ '\u1E8B': 'x',
+ '\u1E8D': 'x',
+ '\u24E8': 'y',
+ '\uFF59': 'y',
+ '\u1EF3': 'y',
+ '\u00FD': 'y',
+ '\u0177': 'y',
+ '\u1EF9': 'y',
+ '\u0233': 'y',
+ '\u1E8F': 'y',
+ '\u00FF': 'y',
+ '\u1EF7': 'y',
+ '\u1E99': 'y',
+ '\u1EF5': 'y',
+ '\u01B4': 'y',
+ '\u024F': 'y',
+ '\u1EFF': 'y',
+ '\u24E9': 'z',
+ '\uFF5A': 'z',
+ '\u017A': 'z',
+ '\u1E91': 'z',
+ '\u017C': 'z',
+ '\u017E': 'z',
+ '\u1E93': 'z',
+ '\u1E95': 'z',
+ '\u01B6': 'z',
+ '\u0225': 'z',
+ '\u0240': 'z',
+ '\u2C6C': 'z',
+ '\uA763': 'z',
+ '\u0386': '\u0391',
+ '\u0388': '\u0395',
+ '\u0389': '\u0397',
+ '\u038A': '\u0399',
+ '\u03AA': '\u0399',
+ '\u038C': '\u039F',
+ '\u038E': '\u03A5',
+ '\u03AB': '\u03A5',
+ '\u038F': '\u03A9',
+ '\u03AC': '\u03B1',
+ '\u03AD': '\u03B5',
+ '\u03AE': '\u03B7',
+ '\u03AF': '\u03B9',
+ '\u03CA': '\u03B9',
+ '\u0390': '\u03B9',
+ '\u03CC': '\u03BF',
+ '\u03CD': '\u03C5',
+ '\u03CB': '\u03C5',
+ '\u03B0': '\u03C5',
+ '\u03C9': '\u03C9',
+ '\u03C2': '\u03C3'
+ };
+
+ return diacritics;
+});
+
+S2.define('select2/data/base',[
+ '../utils'
+], function (Utils) {
+ function BaseAdapter ($element, options) {
+ BaseAdapter.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(BaseAdapter, Utils.Observable);
+
+ BaseAdapter.prototype.current = function (callback) {
+ throw new Error('The `current` method must be defined in child classes.');
+ };
+
+ BaseAdapter.prototype.query = function (params, callback) {
+ throw new Error('The `query` method must be defined in child classes.');
+ };
+
+ BaseAdapter.prototype.bind = function (container, $container) {
+ // Can be implemented in subclasses
+ };
+
+ BaseAdapter.prototype.destroy = function () {
+ // Can be implemented in subclasses
+ };
+
+ BaseAdapter.prototype.generateResultId = function (container, data) {
+ var id = '';
+
+ if (container != null) {
+ id += container.id
+ } else {
+ id += Utils.generateChars(4);
+ }
+
+ id += '-result-';
+ id += Utils.generateChars(4);
+
+ if (data.id != null) {
+ id += '-' + data.id.toString();
+ } else {
+ id += '-' + Utils.generateChars(4);
+ }
+ return id;
+ };
+
+ return BaseAdapter;
+});
+
+S2.define('select2/data/select',[
+ './base',
+ '../utils',
+ 'jquery'
+], function (BaseAdapter, Utils, $) {
+ function SelectAdapter ($element, options) {
+ this.$element = $element;
+ this.options = options;
+
+ SelectAdapter.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(SelectAdapter, BaseAdapter);
+
+ SelectAdapter.prototype.current = function (callback) {
+ var data = [];
+ var self = this;
+
+ this.$element.find(':selected').each(function () {
+ var $option = $(this);
+
+ var option = self.item($option);
+
+ data.push(option);
+ });
+
+ callback(data);
+ };
+
+ SelectAdapter.prototype.select = function (data) {
+ var self = this;
+
+ data.selected = true;
+
+ // If data.element is a DOM node, use it instead
+ if ($(data.element).is('option')) {
+ data.element.selected = true;
+
+ this.$element.trigger('change');
+
+ return;
+ }
+
+ if (this.$element.prop('multiple')) {
+ this.current(function (currentData) {
+ var val = [];
+
+ data = [data];
+ data.push.apply(data, currentData);
+
+ for (var d = 0; d < data.length; d++) {
+ var id = data[d].id;
+
+ if ($.inArray(id, val) === -1) {
+ val.push(id);
+ }
+ }
+
+ self.$element.val(val);
+ self.$element.trigger('change');
+ });
+ } else {
+ var val = data.id;
+
+ this.$element.val(val);
+ this.$element.trigger('change');
+ }
+ };
+
+ SelectAdapter.prototype.unselect = function (data) {
+ var self = this;
+
+ if (!this.$element.prop('multiple')) {
+ return;
+ }
+
+ data.selected = false;
+
+ if ($(data.element).is('option')) {
+ data.element.selected = false;
+
+ this.$element.trigger('change');
+
+ return;
+ }
+
+ this.current(function (currentData) {
+ var val = [];
+
+ for (var d = 0; d < currentData.length; d++) {
+ var id = currentData[d].id;
+
+ if (id !== data.id && $.inArray(id, val) === -1) {
+ val.push(id);
+ }
+ }
+
+ self.$element.val(val);
+
+ self.$element.trigger('change');
+ });
+ };
+
+ SelectAdapter.prototype.bind = function (container, $container) {
+ var self = this;
+
+ this.container = container;
+
+ container.on('select', function (params) {
+ self.select(params.data);
+ });
+
+ container.on('unselect', function (params) {
+ self.unselect(params.data);
+ });
+ };
+
+ SelectAdapter.prototype.destroy = function () {
+ // Remove anything added to child elements
+ this.$element.find('*').each(function () {
+ // Remove any custom data set by Select2
+ $.removeData(this, 'data');
+ });
+ };
+
+ SelectAdapter.prototype.query = function (params, callback) {
+ var data = [];
+ var self = this;
+
+ var $options = this.$element.children();
+
+ $options.each(function () {
+ var $option = $(this);
+
+ if (!$option.is('option') && !$option.is('optgroup')) {
+ return;
+ }
+
+ var option = self.item($option);
+
+ var matches = self.matches(params, option);
+
+ if (matches !== null) {
+ data.push(matches);
+ }
+ });
+
+ callback({
+ results: data
+ });
+ };
+
+ SelectAdapter.prototype.addOptions = function ($options) {
+ Utils.appendMany(this.$element, $options);
+ };
+
+ SelectAdapter.prototype.option = function (data) {
+ var option;
+
+ if (data.children) {
+ option = document.createElement('optgroup');
+ option.label = data.text;
+ } else {
+ option = document.createElement('option');
+
+ if (option.textContent !== undefined) {
+ option.textContent = data.text;
+ } else {
+ option.innerText = data.text;
+ }
+ }
+
+ if (data.id !== undefined) {
+ option.value = data.id;
+ }
+
+ if (data.disabled) {
+ option.disabled = true;
+ }
+
+ if (data.selected) {
+ option.selected = true;
+ }
+
+ if (data.title) {
+ option.title = data.title;
+ }
+
+ var $option = $(option);
+
+ var normalizedData = this._normalizeItem(data);
+ normalizedData.element = option;
+
+ // Override the option's data with the combined data
+ $.data(option, 'data', normalizedData);
+
+ return $option;
+ };
+
+ SelectAdapter.prototype.item = function ($option) {
+ var data = {};
+
+ data = $.data($option[0], 'data');
+
+ if (data != null) {
+ return data;
+ }
+
+ if ($option.is('option')) {
+ data = {
+ id: $option.val(),
+ text: $option.text(),
+ disabled: $option.prop('disabled'),
+ selected: $option.prop('selected'),
+ title: $option.prop('title')
+ };
+ } else if ($option.is('optgroup')) {
+ data = {
+ text: $option.prop('label'),
+ children: [],
+ title: $option.prop('title')
+ };
+
+ var $children = $option.children('option');
+ var children = [];
+
+ for (var c = 0; c < $children.length; c++) {
+ var $child = $($children[c]);
+
+ var child = this.item($child);
+
+ children.push(child);
+ }
+
+ data.children = children;
+ }
+
+ data = this._normalizeItem(data);
+ data.element = $option[0];
+
+ $.data($option[0], 'data', data);
+
+ return data;
+ };
+
+ SelectAdapter.prototype._normalizeItem = function (item) {
+ if (!$.isPlainObject(item)) {
+ item = {
+ id: item,
+ text: item
+ };
+ }
+
+ item = $.extend({}, {
+ text: ''
+ }, item);
+
+ var defaults = {
+ selected: false,
+ disabled: false
+ };
+
+ if (item.id != null) {
+ item.id = item.id.toString();
+ }
+
+ if (item.text != null) {
+ item.text = item.text.toString();
+ }
+
+ if (item._resultId == null && item.id) {
+ item._resultId = this.generateResultId(this.container, item);
+ }
+
+ return $.extend({}, defaults, item);
+ };
+
+ SelectAdapter.prototype.matches = function (params, data) {
+ var matcher = this.options.get('matcher');
+
+ return matcher(params, data);
+ };
+
+ return SelectAdapter;
+});
+
+S2.define('select2/data/array',[
+ './select',
+ '../utils',
+ 'jquery'
+], function (SelectAdapter, Utils, $) {
+ function ArrayAdapter ($element, options) {
+ var data = options.get('data') || [];
+
+ ArrayAdapter.__super__.constructor.call(this, $element, options);
+
+ this.addOptions(this.convertToOptions(data));
+ }
+
+ Utils.Extend(ArrayAdapter, SelectAdapter);
+
+ ArrayAdapter.prototype.select = function (data) {
+ var $option = this.$element.find('option').filter(function (i, elm) {
+ return elm.value == data.id.toString();
+ });
+
+ if ($option.length === 0) {
+ $option = this.option(data);
+
+ this.addOptions($option);
+ }
+
+ ArrayAdapter.__super__.select.call(this, data);
+ };
+
+ ArrayAdapter.prototype.convertToOptions = function (data) {
+ var self = this;
+
+ var $existing = this.$element.find('option');
+ var existingIds = $existing.map(function () {
+ return self.item($(this)).id;
+ }).get();
+
+ var $options = [];
+
+ // Filter out all items except for the one passed in the argument
+ function onlyItem (item) {
+ return function () {
+ return $(this).val() == item.id;
+ };
+ }
+
+ for (var d = 0; d < data.length; d++) {
+ var item = this._normalizeItem(data[d]);
+
+ // Skip items which were pre-loaded, only merge the data
+ if ($.inArray(item.id, existingIds) >= 0) {
+ var $existingOption = $existing.filter(onlyItem(item));
+
+ var existingData = this.item($existingOption);
+ var newData = $.extend(true, {}, item, existingData);
+
+ var $newOption = this.option(newData);
+
+ $existingOption.replaceWith($newOption);
+
+ continue;
+ }
+
+ var $option = this.option(item);
+
+ if (item.children) {
+ var $children = this.convertToOptions(item.children);
+
+ Utils.appendMany($option, $children);
+ }
+
+ $options.push($option);
+ }
+
+ return $options;
+ };
+
+ return ArrayAdapter;
+});
+
+S2.define('select2/data/ajax',[
+ './array',
+ '../utils',
+ 'jquery'
+], function (ArrayAdapter, Utils, $) {
+ function AjaxAdapter ($element, options) {
+ this.ajaxOptions = this._applyDefaults(options.get('ajax'));
+
+ if (this.ajaxOptions.processResults != null) {
+ this.processResults = this.ajaxOptions.processResults;
+ }
+
+ AjaxAdapter.__super__.constructor.call(this, $element, options);
+ }
+
+ Utils.Extend(AjaxAdapter, ArrayAdapter);
+
+ AjaxAdapter.prototype._applyDefaults = function (options) {
+ var defaults = {
+ data: function (params) {
+ return $.extend({}, params, {
+ q: params.term
+ });
+ },
+ transport: function (params, success, failure) {
+ var $request = $.ajax(params);
+
+ $request.then(success);
+ $request.fail(failure);
+
+ return $request;
+ }
+ };
+
+ return $.extend({}, defaults, options, true);
+ };
+
+ AjaxAdapter.prototype.processResults = function (results) {
+ return results;
+ };
+
+ AjaxAdapter.prototype.query = function (params, callback) {
+ var matches = [];
+ var self = this;
+
+ if (this._request != null) {
+ // JSONP requests cannot always be aborted
+ if ($.isFunction(this._request.abort)) {
+ this._request.abort();
+ }
+
+ this._request = null;
+ }
+
+ var options = $.extend({
+ type: 'GET'
+ }, this.ajaxOptions);
+
+ if (typeof options.url === 'function') {
+ options.url = options.url.call(this.$element, params);
+ }
+
+ if (typeof options.data === 'function') {
+ options.data = options.data.call(this.$element, params);
+ }
+
+ function request () {
+ var $request = options.transport(options, function (data) {
+ var results = self.processResults(data, params);
+
+ if (self.options.get('debug') && window.console && console.error) {
+ // Check to make sure that the response included a `results` key.
+ if (!results || !results.results || !$.isArray(results.results)) {
+ console.error(
+ 'Select2: The AJAX results did not return an array in the ' +
+ '`results` key of the response.'
+ );
+ }
+ }
+
+ callback(results);
+ self.container.focusOnActiveElement();
+ }, function () {
+ // Attempt to detect if a request was aborted
+ // Only works if the transport exposes a status property
+ if ($request.status && $request.status === '0') {
+ return;
+ }
+
+ self.trigger('results:message', {
+ message: 'errorLoading'
+ });
+ });
+
+ self._request = $request;
+ }
+
+ if (this.ajaxOptions.delay && params.term != null) {
+ if (this._queryTimeout) {
+ window.clearTimeout(this._queryTimeout);
+ }
+
+ this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
+ } else {
+ request();
+ }
+ };
+
+ return AjaxAdapter;
+});
+
+S2.define('select2/data/tags',[
+ 'jquery'
+], function ($) {
+ function Tags (decorated, $element, options) {
+ var tags = options.get('tags');
+
+ var createTag = options.get('createTag');
+
+ if (createTag !== undefined) {
+ this.createTag = createTag;
+ }
+
+ var insertTag = options.get('insertTag');
+
+ if (insertTag !== undefined) {
+ this.insertTag = insertTag;
+ }
+
+ decorated.call(this, $element, options);
+
+ if ($.isArray(tags)) {
+ for (var t = 0; t < tags.length; t++) {
+ var tag = tags[t];
+ var item = this._normalizeItem(tag);
+
+ var $option = this.option(item);
+
+ this.$element.append($option);
+ }
+ }
+ }
+
+ Tags.prototype.query = function (decorated, params, callback) {
+ var self = this;
+
+ this._removeOldTags();
+
+ if (params.term == null || params.page != null) {
+ decorated.call(this, params, callback);
+ return;
+ }
+
+ function wrapper (obj, child) {
+ var data = obj.results;
+
+ for (var i = 0; i < data.length; i++) {
+ var option = data[i];
+
+ var checkChildren = (
+ option.children != null &&
+ !wrapper({
+ results: option.children
+ }, true)
+ );
+
+ var optionText = (option.text || '').toUpperCase();
+ var paramsTerm = (params.term || '').toUpperCase();
+
+ var checkText = optionText === paramsTerm;
+
+ if (checkText || checkChildren) {
+ if (child) {
+ return false;
+ }
+
+ obj.data = data;
+ callback(obj);
+
+ return;
+ }
+ }
+
+ if (child) {
+ return true;
+ }
+
+ var tag = self.createTag(params);
+
+ if (tag != null) {
+ var $option = self.option(tag);
+ $option.attr('data-select2-tag', true);
+
+ self.addOptions([$option]);
+
+ self.insertTag(data, tag);
+ }
+
+ obj.results = data;
+
+ callback(obj);
+ }
+
+ decorated.call(this, params, wrapper);
+ };
+
+ Tags.prototype.createTag = function (decorated, params) {
+ var term = $.trim(params.term);
+
+ if (term === '') {
+ return null;
+ }
+
+ return {
+ id: term,
+ text: term
+ };
+ };
+
+ Tags.prototype.insertTag = function (_, data, tag) {
+ data.unshift(tag);
+ };
+
+ Tags.prototype._removeOldTags = function (_) {
+ var tag = this._lastTag;
+
+ var $options = this.$element.find('option[data-select2-tag]');
+
+ $options.each(function () {
+ if (this.selected) {
+ return;
+ }
+
+ $(this).remove();
+ });
+ };
+
+ return Tags;
+});
+
+S2.define('select2/data/tokenizer',[
+ 'jquery'
+], function ($) {
+ function Tokenizer (decorated, $element, options) {
+ var tokenizer = options.get('tokenizer');
+
+ if (tokenizer !== undefined) {
+ this.tokenizer = tokenizer;
+ }
+
+ decorated.call(this, $element, options);
+ }
+
+ Tokenizer.prototype.bind = function (decorated, container, $container) {
+ decorated.call(this, container, $container);
+
+ this.$search = container.dropdown.$search || container.selection.$search ||
+ $container.find('.select2-search__field');
+ };
+
+ Tokenizer.prototype.query = function (decorated, params, callback) {
+ var self = this;
+
+ function createAndSelect (data) {
+ // Normalize the data object so we can use it for checks
+ var item = self._normalizeItem(data);
+
+ // Check if the data object already exists as a tag
+ // Select it if it doesn't
+ var $existingOptions = self.$element.find('option').filter(function () {
+ return $(this).val() === item.id;
+ });
+
+ // If an existing option wasn't found for it, create the option
+ if (!$existingOptions.length) {
+ var $option = self.option(item);
+ $option.attr('data-select2-tag', true);
+
+ self._removeOldTags();
+ self.addOptions([$option]);
+ }
+
+ // Select the item, now that we know there is an option for it
+ select(item);
+ }
+
+ function select (data) {
+ self.trigger('select', {
+ data: data
+ });
+ }
+
+ params.term = params.term || '';
+
+ var tokenData = this.tokenizer(params, this.options, createAndSelect);
+
+ if (tokenData.term !== params.term) {
+ // Replace the search term if we have the search box
+ if (this.$search.length) {
+ this.$search.val(tokenData.term);
+ this.$search.focus();
+ }
+
+ params.term = tokenData.term;
+ }
+
+ decorated.call(this, params, callback);
+ };
+
+ Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
+ var separators = options.get('tokenSeparators') || [];
+ var term = params.term;
+ var i = 0;
+
+ var createTag = this.createTag || function (params) {
+ return {
+ id: params.term,
+ text: params.term
+ };
+ };
+
+ while (i < term.length) {
+ var termChar = term[i];
+
+ if ($.inArray(termChar, separators) === -1) {
+ i++;
+
+ continue;
+ }
+
+ var part = term.substr(0, i);
+ var partParams = $.extend({}, params, {
+ term: part
+ });
+
+ var data = createTag(partParams);
+
+ if (data == null) {
+ i++;
+ continue;
+ }
+
+ callback(data);
+
+ // Reset the term to not include the tokenized portion
+ term = term.substr(i + 1) || '';
+ i = 0;
+ }
+
+ return {
+ term: term
+ };
+ };
+
+ return Tokenizer;
+});
+
+S2.define('select2/data/minimumInputLength',[
+
+], function () {
+ function MinimumInputLength (decorated, $e, options) {
+ this.minimumInputLength = options.get('minimumInputLength');
+
+ decorated.call(this, $e, options);
+ }
+
+ MinimumInputLength.prototype.query = function (decorated, params, callback) {
+ params.term = params.term || '';
+
+ if (params.term.length < this.minimumInputLength) {
+ this.trigger('results:message', {
+ message: 'inputTooShort',
+ args: {
+ minimum: this.minimumInputLength,
+ input: params.term,
+ params: params
+ }
+ });
+
+ return;
+ }
+
+ decorated.call(this, params, callback);
+ };
+
+ return MinimumInputLength;
+});
+
+S2.define('select2/data/maximumInputLength',[
+
+], function () {
+ function MaximumInputLength (decorated, $e, options) {
+ this.maximumInputLength = options.get('maximumInputLength');
+
+ decorated.call(this, $e, options);
+ }
+
+ MaximumInputLength.prototype.query = function (decorated, params, callback) {
+ params.term = params.term || '';
+
+ if (this.maximumInputLength > 0 &&
+ params.term.length > this.maximumInputLength) {
+ this.trigger('results:message', {
+ message: 'inputTooLong',
+ args: {
+ maximum: this.maximumInputLength,
+ input: params.term,
+ params: params
+ }
+ });
+
+ return;
+ }
+
+ decorated.call(this, params, callback);
+ };
+
+ return MaximumInputLength;
+});
+
+S2.define('select2/data/maximumSelectionLength',[
+
+], function (){
+ function MaximumSelectionLength (decorated, $e, options) {
+ this.maximumSelectionLength = options.get('maximumSelectionLength');
+
+ decorated.call(this, $e, options);
+ }
+
+ MaximumSelectionLength.prototype.query =
+ function (decorated, params, callback) {
+ var self = this;
+
+ this.current(function (currentData) {
+ var count = currentData != null ? currentData.length : 0;
+ if (self.maximumSelectionLength > 0 &&
+ count >= self.maximumSelectionLength) {
+ self.trigger('results:message', {
+ message: 'maximumSelected',
+ args: {
+ maximum: self.maximumSelectionLength
+ }
+ });
+ return;
+ }
+ decorated.call(self, params, callback);
+ });
+ };
+
+ return MaximumSelectionLength;
+});
+
+S2.define('select2/dropdown',[
+ 'jquery',
+ './utils'
+], function ($, Utils) {
+ function Dropdown ($element, options) {
+ this.$element = $element;
+ this.options = options;
+
+ Dropdown.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(Dropdown, Utils.Observable);
+
+ Dropdown.prototype.render = function () {
+ var $dropdown = $(
+ '' +
+ ' ' +
+ ' '
+ );
+
+ $dropdown.attr('dir', this.options.get('dir'));
+
+ this.$dropdown = $dropdown;
+
+ return $dropdown;
+ };
+
+ Dropdown.prototype.bind = function () {
+ // Should be implemented in subclasses
+ };
+
+ Dropdown.prototype.position = function ($dropdown, $container) {
+ // Should be implmented in subclasses
+ };
+
+ Dropdown.prototype.destroy = function () {
+ // Remove the dropdown from the DOM
+ this.$dropdown.remove();
+ };
+
+ return Dropdown;
+});
+
+S2.define('select2/dropdown/search',[
+ 'jquery',
+ '../utils'
+], function ($, Utils) {
+ function Search () { }
+
+ Search.prototype.render = function (decorated) {
+ var $rendered = decorated.call(this);
+
+ var $search = $(
+ '' +
+ ' ' +
+ ' '
+ );
+
+ this.$searchContainer = $search;
+ this.$search = $search.find('input');
+
+ $rendered.prepend($search);
+
+ return $rendered;
+ };
+
+ Search.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+ var resultsId = container.id + '-results';
+
+ decorated.call(this, container, $container);
+
+ this.$search.on('keydown', function (evt) {
+ self.trigger('keypress', evt);
+
+ self._keyUpPrevented = evt.isDefaultPrevented();
+ });
+
+ // Workaround for browsers which do not support the `input` event
+ // This will prevent double-triggering of events for browsers which support
+ // both the `keyup` and `input` events.
+ this.$search.on('input', function (evt) {
+ // Unbind the duplicated `keyup` event
+ $(this).off('keyup');
+ });
+
+ this.$search.on('keyup input', function (evt) {
+ self.handleSearch(evt);
+ });
+
+ container.on('open', function () {
+ self.$search.attr('tabindex', 0);
+ self.$search.attr('aria-owns', resultsId);
+ self.$search.focus();
+
+ window.setTimeout(function () {
+ self.$search.focus();
+ }, 0);
+ });
+
+ container.on('close', function () {
+ self.$search.attr('tabindex', -1);
+ self.$search.removeAttr('aria-activedescendant');
+ self.$search.removeAttr('aria-owns');
+ self.$search.val('');
+ });
+
+ container.on('focus', function () {
+ if (container.isOpen()) {
+ self.$search.focus();
+ }
+ });
+
+ container.on('results:all', function (params) {
+ if (params.query.term == null || params.query.term === '') {
+ var showSearch = self.showSearch(params);
+
+ if (showSearch) {
+ self.$searchContainer.removeClass('select2-search--hide');
+ } else {
+ self.$searchContainer.addClass('select2-search--hide');
+ }
+ }
+ });
+
+ container.on('results:focus', function (params) {
+ self.$search.attr('aria-activedescendant', params.data._resultId);
+ });
+ };
+
+ Search.prototype.handleSearch = function (evt) {
+ if (!this._keyUpPrevented) {
+ var input = this.$search.val();
+
+ this.trigger('query', {
+ term: input
+ });
+ }
+
+ this._keyUpPrevented = false;
+ };
+
+ Search.prototype.showSearch = function (_, params) {
+ return true;
+ };
+
+ return Search;
+});
+
+S2.define('select2/dropdown/hidePlaceholder',[
+
+], function () {
+ function HidePlaceholder (decorated, $element, options, dataAdapter) {
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
+
+ decorated.call(this, $element, options, dataAdapter);
+ }
+
+ HidePlaceholder.prototype.append = function (decorated, data) {
+ data.results = this.removePlaceholder(data.results);
+
+ decorated.call(this, data);
+ };
+
+ HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
+ if (typeof placeholder === 'string') {
+ placeholder = {
+ id: '',
+ text: placeholder
+ };
+ }
+
+ return placeholder;
+ };
+
+ HidePlaceholder.prototype.removePlaceholder = function (_, data) {
+ var modifiedData = data.slice(0);
+
+ for (var d = data.length - 1; d >= 0; d--) {
+ var item = data[d];
+
+ if (this.placeholder.id === item.id) {
+ modifiedData.splice(d, 1);
+ }
+ }
+
+ return modifiedData;
+ };
+
+ return HidePlaceholder;
+});
+
+S2.define('select2/dropdown/infiniteScroll',[
+ 'jquery'
+], function ($) {
+ function InfiniteScroll (decorated, $element, options, dataAdapter) {
+ this.lastParams = {};
+
+ decorated.call(this, $element, options, dataAdapter);
+
+ this.$loadingMore = this.createLoadingMore();
+ this.loading = false;
+ }
+
+ InfiniteScroll.prototype.append = function (decorated, data) {
+ this.$loadingMore.remove();
+ this.loading = false;
+
+ decorated.call(this, data);
+
+ if (this.showLoadingMore(data)) {
+ this.$results.append(this.$loadingMore);
+ }
+ };
+
+ InfiniteScroll.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('query', function (params) {
+ self.lastParams = params;
+ self.loading = true;
+ });
+
+ container.on('query:append', function (params) {
+ self.lastParams = params;
+ self.loading = true;
+ });
+
+ this.$results.on('scroll', function () {
+ var isLoadMoreVisible = $.contains(
+ document.documentElement,
+ self.$loadingMore[0]
+ );
+
+ if (self.loading || !isLoadMoreVisible) {
+ return;
+ }
+
+ var currentOffset = self.$results.offset().top +
+ self.$results.outerHeight(false);
+ var loadingMoreOffset = self.$loadingMore.offset().top +
+ self.$loadingMore.outerHeight(false);
+
+ if (currentOffset + 50 >= loadingMoreOffset) {
+ self.loadMore();
+ }
+ });
+ };
+
+ InfiniteScroll.prototype.loadMore = function () {
+ this.loading = true;
+
+ var params = $.extend({}, {page: 1}, this.lastParams);
+
+ params.page++;
+
+ this.trigger('query:append', params);
+ };
+
+ InfiniteScroll.prototype.showLoadingMore = function (_, data) {
+ return data.pagination && data.pagination.more;
+ };
+
+ InfiniteScroll.prototype.createLoadingMore = function () {
+ var $option = $(
+ ' '
+ );
+
+ var message = this.options.get('translations').get('loadingMore');
+
+ $option.html(message(this.lastParams));
+
+ return $option;
+ };
+
+ return InfiniteScroll;
+});
+
+S2.define('select2/dropdown/attachBody',[
+ 'jquery',
+ '../utils'
+], function ($, Utils) {
+ function AttachBody (decorated, $element, options) {
+ this.$dropdownParent = options.get('dropdownParent') || $(document.body);
+
+ decorated.call(this, $element, options);
+ }
+
+ AttachBody.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ var setupResultsEvents = false;
+
+ decorated.call(this, container, $container);
+
+ container.on('open', function () {
+ self._showDropdown();
+ self._attachPositioningHandler(container);
+
+ if (!setupResultsEvents) {
+ setupResultsEvents = true;
+
+ container.on('results:all', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ container.on('results:append', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+ }
+ });
+
+ container.on('close', function () {
+ self._hideDropdown();
+ self._detachPositioningHandler(container);
+ });
+
+ this.$dropdownContainer.on('mousedown', function (evt) {
+ evt.stopPropagation();
+ });
+ };
+
+ AttachBody.prototype.destroy = function (decorated) {
+ decorated.call(this);
+
+ this.$dropdownContainer.remove();
+ };
+
+ AttachBody.prototype.position = function (decorated, $dropdown, $container) {
+ // Clone all of the container classes
+ $dropdown.attr('class', $container.attr('class'));
+
+ $dropdown.removeClass('select2');
+ $dropdown.addClass('select2-container--open');
+
+ $dropdown.css({
+ position: 'absolute',
+ top: -999999
+ });
+
+ this.$container = $container;
+ };
+
+ AttachBody.prototype.render = function (decorated) {
+ var $container = $(' ');
+
+ var $dropdown = decorated.call(this);
+ $container.append($dropdown);
+
+ this.$dropdownContainer = $container;
+
+ return $container;
+ };
+
+ AttachBody.prototype._hideDropdown = function (decorated) {
+ this.$dropdownContainer.detach();
+ };
+
+ AttachBody.prototype._attachPositioningHandler =
+ function (decorated, container) {
+ var self = this;
+
+ var scrollEvent = 'scroll.select2.' + container.id;
+ var resizeEvent = 'resize.select2.' + container.id;
+ var orientationEvent = 'orientationchange.select2.' + container.id;
+
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
+ $watchers.each(function () {
+ $(this).data('select2-scroll-position', {
+ x: $(this).scrollLeft(),
+ y: $(this).scrollTop()
+ });
+ });
+
+ $watchers.on(scrollEvent, function (ev) {
+ var position = $(this).data('select2-scroll-position');
+ $(this).scrollTop(position.y);
+ });
+
+ $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
+ function (e) {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+ };
+
+ AttachBody.prototype._detachPositioningHandler =
+ function (decorated, container) {
+ var scrollEvent = 'scroll.select2.' + container.id;
+ var resizeEvent = 'resize.select2.' + container.id;
+ var orientationEvent = 'orientationchange.select2.' + container.id;
+
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
+ $watchers.off(scrollEvent);
+
+ $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
+ };
+
+ AttachBody.prototype._positionDropdown = function () {
+ var $window = $(window);
+
+ var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
+ var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
+
+ var newDirection = null;
+
+ var offset = this.$container.offset();
+
+ offset.bottom = offset.top + this.$container.outerHeight(false);
+
+ var container = {
+ height: this.$container.outerHeight(false)
+ };
+
+ container.top = offset.top;
+ container.bottom = offset.top + container.height;
+
+ var dropdown = {
+ height: this.$dropdown.outerHeight(false)
+ };
+
+ var viewport = {
+ top: $window.scrollTop(),
+ bottom: $window.scrollTop() + $window.height()
+ };
+
+ var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
+ var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
+
+ var css = {
+ left: offset.left,
+ top: container.bottom
+ };
+
+ // Determine what the parent element is to use for calciulating the offset
+ var $offsetParent = this.$dropdownParent;
+
+ // For statically positoned elements, we need to get the element
+ // that is determining the offset
+ if ($offsetParent.css('position') === 'static') {
+ $offsetParent = $offsetParent.offsetParent();
+ }
+
+ var parentOffset = $offsetParent.offset();
+
+ css.top -= parentOffset.top;
+ css.left -= parentOffset.left;
+
+ if (!isCurrentlyAbove && !isCurrentlyBelow) {
+ newDirection = 'below';
+ }
+
+ if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
+ newDirection = 'above';
+ } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
+ newDirection = 'below';
+ }
+
+ if (newDirection == 'above' ||
+ (isCurrentlyAbove && newDirection !== 'below')) {
+ css.top = container.top - parentOffset.top - dropdown.height;
+ }
+
+ if (newDirection != null) {
+ this.$dropdown
+ .removeClass('select2-dropdown--below select2-dropdown--above')
+ .addClass('select2-dropdown--' + newDirection);
+ this.$container
+ .removeClass('select2-container--below select2-container--above')
+ .addClass('select2-container--' + newDirection);
+ }
+
+ this.$dropdownContainer.css(css);
+ };
+
+ AttachBody.prototype._resizeDropdown = function () {
+ var css = {
+ width: this.$container.outerWidth(false) + 'px'
+ };
+
+ if (this.options.get('dropdownAutoWidth')) {
+ css.minWidth = css.width;
+ css.position = 'relative';
+ css.width = 'auto';
+ }
+
+ this.$dropdown.css(css);
+ };
+
+ AttachBody.prototype._showDropdown = function (decorated) {
+ this.$dropdownContainer.appendTo(this.$dropdownParent);
+
+ this._positionDropdown();
+ this._resizeDropdown();
+ };
+
+ return AttachBody;
+});
+
+S2.define('select2/dropdown/minimumResultsForSearch',[
+
+], function () {
+ function countResults (data) {
+ var count = 0;
+
+ for (var d = 0; d < data.length; d++) {
+ var item = data[d];
+
+ if (item.children) {
+ count += countResults(item.children);
+ } else {
+ count++;
+ }
+ }
+
+ return count;
+ }
+
+ function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
+ this.minimumResultsForSearch = options.get('minimumResultsForSearch');
+
+ if (this.minimumResultsForSearch < 0) {
+ this.minimumResultsForSearch = Infinity;
+ }
+
+ decorated.call(this, $element, options, dataAdapter);
+ }
+
+ MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
+ if (countResults(params.data.results) < this.minimumResultsForSearch) {
+ return false;
+ }
+
+ return decorated.call(this, params);
+ };
+
+ return MinimumResultsForSearch;
+});
+
+S2.define('select2/dropdown/selectOnClose',[
+
+], function () {
+ function SelectOnClose () { }
+
+ SelectOnClose.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('close', function (params) {
+ self._handleSelectOnClose(params);
+ });
+ };
+
+ SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
+ if (params && params.originalSelect2Event != null) {
+ var event = params.originalSelect2Event;
+
+ // Don't select an item if the close event was triggered from a select or
+ // unselect event
+ if (event._type === 'select' || event._type === 'unselect') {
+ return;
+ }
+ }
+
+ var $highlightedResults = this.getHighlightedResults();
+
+ // Only select highlighted results
+ if ($highlightedResults.length < 1) {
+ return;
+ }
+
+ var data = $highlightedResults.data('data');
+
+ // Don't re-select already selected resulte
+ if (
+ (data.element != null && data.element.selected) ||
+ (data.element == null && data.selected)
+ ) {
+ return;
+ }
+
+ this.trigger('select', {
+ data: data
+ });
+ };
+
+ return SelectOnClose;
+});
+
+S2.define('select2/dropdown/closeOnSelect',[
+
+], function () {
+ function CloseOnSelect () { }
+
+ CloseOnSelect.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('select', function (evt) {
+ self._selectTriggered(evt);
+ });
+
+ container.on('unselect', function (evt) {
+ self._selectTriggered(evt);
+ });
+ };
+
+ CloseOnSelect.prototype._selectTriggered = function (_, evt) {
+ var originalEvent = evt.originalEvent;
+
+ // Don't close if the control key is being held
+ if (originalEvent && originalEvent.ctrlKey) {
+ return;
+ }
+
+ this.trigger('close', {
+ originalEvent: originalEvent,
+ originalSelect2Event: evt
+ });
+ };
+
+ return CloseOnSelect;
+});
+
+S2.define('select2/i18n/en',[],function () {
+ // English
+ return {
+ errorLoading: function () {
+ return 'The results could not be loaded.';
+ },
+ inputTooLong: function (args) {
+ var overChars = args.input.length - args.maximum;
+
+ var message = 'Please delete ' + overChars + ' character';
+
+ if (overChars != 1) {
+ message += 's';
+ }
+
+ return message;
+ },
+ inputTooShort: function (args) {
+ var remainingChars = args.minimum - args.input.length;
+
+ var message = 'Please enter ' + remainingChars + ' or more characters';
+
+ return message;
+ },
+ loadingMore: function () {
+ return 'Loading more results…';
+ },
+ maximumSelected: function (args) {
+ var message = 'You can only select ' + args.maximum + ' item';
+
+ if (args.maximum != 1) {
+ message += 's';
+ }
+
+ return message;
+ },
+ noResults: function () {
+ return 'No results found';
+ },
+ searching: function () {
+ return 'Searching…';
+ }
+ };
+});
+
+S2.define('select2/defaults',[
+ 'jquery',
+ 'require',
+
+ './results',
+
+ './selection/single',
+ './selection/multiple',
+ './selection/placeholder',
+ './selection/allowClear',
+ './selection/search',
+ './selection/eventRelay',
+
+ './utils',
+ './translation',
+ './diacritics',
+
+ './data/select',
+ './data/array',
+ './data/ajax',
+ './data/tags',
+ './data/tokenizer',
+ './data/minimumInputLength',
+ './data/maximumInputLength',
+ './data/maximumSelectionLength',
+
+ './dropdown',
+ './dropdown/search',
+ './dropdown/hidePlaceholder',
+ './dropdown/infiniteScroll',
+ './dropdown/attachBody',
+ './dropdown/minimumResultsForSearch',
+ './dropdown/selectOnClose',
+ './dropdown/closeOnSelect',
+
+ './i18n/en'
+], function ($, require,
+
+ ResultsList,
+
+ SingleSelection, MultipleSelection, Placeholder, AllowClear,
+ SelectionSearch, EventRelay,
+
+ Utils, Translation, DIACRITICS,
+
+ SelectData, ArrayData, AjaxData, Tags, Tokenizer,
+ MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
+
+ Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
+ AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
+
+ EnglishTranslation) {
+ function Defaults () {
+ this.reset();
+ }
+
+ Defaults.prototype.apply = function (options) {
+ options = $.extend(true, {}, this.defaults, options);
+
+ if (options.dataAdapter == null) {
+ if (options.ajax != null) {
+ options.dataAdapter = AjaxData;
+ } else if (options.data != null) {
+ options.dataAdapter = ArrayData;
+ } else {
+ options.dataAdapter = SelectData;
+ }
+
+ if (options.minimumInputLength > 0) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ MinimumInputLength
+ );
+ }
+
+ if (options.maximumInputLength > 0) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ MaximumInputLength
+ );
+ }
+
+ if (options.maximumSelectionLength > 0) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ MaximumSelectionLength
+ );
+ }
+
+ if (options.tags) {
+ options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
+ }
+
+ if (options.tokenSeparators != null || options.tokenizer != null) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ Tokenizer
+ );
+ }
+
+ if (options.query != null) {
+ var Query = require(options.amdBase + 'compat/query');
+
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ Query
+ );
+ }
+
+ if (options.initSelection != null) {
+ var InitSelection = require(options.amdBase + 'compat/initSelection');
+
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ InitSelection
+ );
+ }
+ }
+
+ if (options.resultsAdapter == null) {
+ options.resultsAdapter = ResultsList;
+
+ if (options.ajax != null) {
+ options.resultsAdapter = Utils.Decorate(
+ options.resultsAdapter,
+ InfiniteScroll
+ );
+ }
+
+ if (options.placeholder != null) {
+ options.resultsAdapter = Utils.Decorate(
+ options.resultsAdapter,
+ HidePlaceholder
+ );
+ }
+
+ if (options.selectOnClose) {
+ options.resultsAdapter = Utils.Decorate(
+ options.resultsAdapter,
+ SelectOnClose
+ );
+ }
+ }
+
+ if (options.dropdownAdapter == null) {
+ if (options.multiple) {
+ options.dropdownAdapter = Dropdown;
+ } else {
+ var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
+
+ options.dropdownAdapter = SearchableDropdown;
+ }
+
+ if (options.minimumResultsForSearch !== 0) {
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ MinimumResultsForSearch
+ );
+ }
+
+ if (options.closeOnSelect) {
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ CloseOnSelect
+ );
+ }
+
+ if (
+ options.dropdownCssClass != null ||
+ options.dropdownCss != null ||
+ options.adaptDropdownCssClass != null
+ ) {
+ var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
+
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ DropdownCSS
+ );
+ }
+
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ AttachBody
+ );
+ }
+
+ if (options.selectionAdapter == null) {
+ if (options.multiple) {
+ options.selectionAdapter = MultipleSelection;
+ } else {
+ options.selectionAdapter = SingleSelection;
+ }
+
+ // Add the placeholder mixin if a placeholder was specified
+ if (options.placeholder != null) {
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ Placeholder
+ );
+ }
+
+ if (options.allowClear) {
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ AllowClear
+ );
+ }
+
+ if (options.multiple) {
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ SelectionSearch
+ );
+ }
+
+ if (
+ options.containerCssClass != null ||
+ options.containerCss != null ||
+ options.adaptContainerCssClass != null
+ ) {
+ var ContainerCSS = require(options.amdBase + 'compat/containerCss');
+
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ ContainerCSS
+ );
+ }
+
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ EventRelay
+ );
+ }
+
+ if (typeof options.language === 'string') {
+ // Check if the language is specified with a region
+ if (options.language.indexOf('-') > 0) {
+ // Extract the region information if it is included
+ var languageParts = options.language.split('-');
+ var baseLanguage = languageParts[0];
+
+ options.language = [options.language, baseLanguage];
+ } else {
+ options.language = [options.language];
+ }
+ }
+
+ if ($.isArray(options.language)) {
+ var languages = new Translation();
+ options.language.push('en');
+
+ var languageNames = options.language;
+
+ for (var l = 0; l < languageNames.length; l++) {
+ var name = languageNames[l];
+ var language = {};
+
+ try {
+ // Try to load it with the original name
+ language = Translation.loadPath(name);
+ } catch (e) {
+ try {
+ // If we couldn't load it, check if it wasn't the full path
+ name = this.defaults.amdLanguageBase + name;
+ language = Translation.loadPath(name);
+ } catch (ex) {
+ // The translation could not be loaded at all. Sometimes this is
+ // because of a configuration problem, other times this can be
+ // because of how Select2 helps load all possible translation files.
+ if (options.debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The language file for "' + name + '" could not be ' +
+ 'automatically loaded. A fallback will be used instead.'
+ );
+ }
+
+ continue;
+ }
+ }
+
+ languages.extend(language);
+ }
+
+ options.translations = languages;
+ } else {
+ var baseTranslation = Translation.loadPath(
+ this.defaults.amdLanguageBase + 'en'
+ );
+ var customTranslation = new Translation(options.language);
+
+ customTranslation.extend(baseTranslation);
+
+ options.translations = customTranslation;
+ }
+
+ return options;
+ };
+
+ Defaults.prototype.reset = function () {
+ function stripDiacritics (text) {
+ // Used 'uni range + named function' from http://jsperf.com/diacritics/18
+ function match(a) {
+ return DIACRITICS[a] || a;
+ }
+
+ return text.replace(/[^\u0000-\u007E]/g, match);
+ }
+
+ function matcher (params, data) {
+ // Always return the object if there is nothing to compare
+ if ($.trim(params.term) === '') {
+ return data;
+ }
+
+ // Do a recursive check for options with children
+ if (data.children && data.children.length > 0) {
+ // Clone the data object if there are children
+ // This is required as we modify the object to remove any non-matches
+ var match = $.extend(true, {}, data);
+
+ // Check each child of the option
+ for (var c = data.children.length - 1; c >= 0; c--) {
+ var child = data.children[c];
+
+ var matches = matcher(params, child);
+
+ // If there wasn't a match, remove the object in the array
+ if (matches == null) {
+ match.children.splice(c, 1);
+ }
+ }
+
+ // If any children matched, return the new object
+ if (match.children.length > 0) {
+ return match;
+ }
+
+ // If there were no matching children, check just the plain object
+ return matcher(params, match);
+ }
+
+ var original = stripDiacritics(data.text).toUpperCase();
+ var term = stripDiacritics(params.term).toUpperCase();
+
+ // Check if the text contains the term
+ if (original.indexOf(term) > -1) {
+ return data;
+ }
+
+ // If it doesn't contain the term, don't return anything
+ return null;
+ }
+
+ this.defaults = {
+ amdBase: './',
+ amdLanguageBase: './i18n/',
+ closeOnSelect: true,
+ debug: false,
+ dropdownAutoWidth: false,
+ escapeMarkup: Utils.escapeMarkup,
+ language: EnglishTranslation,
+ matcher: matcher,
+ minimumInputLength: 0,
+ maximumInputLength: 0,
+ maximumSelectionLength: 0,
+ minimumResultsForSearch: 0,
+ selectOnClose: false,
+ sorter: function (data) {
+ return data;
+ },
+ templateResult: function (result) {
+ return result.text;
+ },
+ templateSelection: function (selection) {
+ return selection.text;
+ },
+ theme: 'default',
+ width: 'resolve'
+ };
+ };
+
+ Defaults.prototype.set = function (key, value) {
+ var camelKey = $.camelCase(key);
+
+ var data = {};
+ data[camelKey] = value;
+
+ var convertedData = Utils._convertData(data);
+
+ $.extend(this.defaults, convertedData);
+ };
+
+ var defaults = new Defaults();
+
+ return defaults;
+});
+
+S2.define('select2/options',[
+ 'require',
+ 'jquery',
+ './defaults',
+ './utils'
+], function (require, $, Defaults, Utils) {
+ function Options (options, $element) {
+ this.options = options;
+
+ if ($element != null) {
+ this.fromElement($element);
+ }
+
+ this.options = Defaults.apply(this.options);
+
+ if ($element && $element.is('input')) {
+ var InputCompat = require(this.get('amdBase') + 'compat/inputData');
+
+ this.options.dataAdapter = Utils.Decorate(
+ this.options.dataAdapter,
+ InputCompat
+ );
+ }
+ }
+
+ Options.prototype.fromElement = function ($e) {
+ var excludedData = ['select2'];
+
+ if (this.options.multiple == null) {
+ this.options.multiple = $e.prop('multiple');
+ }
+
+ if (this.options.disabled == null) {
+ this.options.disabled = $e.prop('disabled');
+ }
+
+ if (this.options.language == null) {
+ if ($e.prop('lang')) {
+ this.options.language = $e.prop('lang').toLowerCase();
+ } else if ($e.closest('[lang]').prop('lang')) {
+ this.options.language = $e.closest('[lang]').prop('lang');
+ }
+ }
+
+ if (this.options.dir == null) {
+ if ($e.prop('dir')) {
+ this.options.dir = $e.prop('dir');
+ } else if ($e.closest('[dir]').prop('dir')) {
+ this.options.dir = $e.closest('[dir]').prop('dir');
+ } else {
+ this.options.dir = 'ltr';
+ }
+ }
+
+ $e.prop('disabled', this.options.disabled);
+ $e.prop('multiple', this.options.multiple);
+
+ if ($e.data('select2Tags')) {
+ if (this.options.debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `data-select2-tags` attribute has been changed to ' +
+ 'use the `data-data` and `data-tags="true"` attributes and will be ' +
+ 'removed in future versions of Select2.'
+ );
+ }
+
+ $e.data('data', $e.data('select2Tags'));
+ $e.data('tags', true);
+ }
+
+ if ($e.data('ajaxUrl')) {
+ if (this.options.debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `data-ajax-url` attribute has been changed to ' +
+ '`data-ajax--url` and support for the old attribute will be removed' +
+ ' in future versions of Select2.'
+ );
+ }
+
+ $e.attr('ajax--url', $e.data('ajaxUrl'));
+ $e.data('ajax--url', $e.data('ajaxUrl'));
+ }
+
+ var dataset = {};
+
+ // Prefer the element's `dataset` attribute if it exists
+ // jQuery 1.x does not correctly handle data attributes with multiple dashes
+ if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
+ dataset = $.extend(true, {}, $e[0].dataset, $e.data());
+ } else {
+ dataset = $e.data();
+ }
+
+ var data = $.extend(true, {}, dataset);
+
+ data = Utils._convertData(data);
+
+ for (var key in data) {
+ if ($.inArray(key, excludedData) > -1) {
+ continue;
+ }
+
+ if ($.isPlainObject(this.options[key])) {
+ $.extend(this.options[key], data[key]);
+ } else {
+ this.options[key] = data[key];
+ }
+ }
+
+ return this;
+ };
+
+ Options.prototype.get = function (key) {
+ return this.options[key];
+ };
+
+ Options.prototype.set = function (key, val) {
+ this.options[key] = val;
+ };
+
+ return Options;
+});
+
+S2.define('select2/core',[
+ 'jquery',
+ './options',
+ './utils',
+ './keys'
+], function ($, Options, Utils, KEYS) {
+ var Select2 = function ($element, options) {
+ if ($element.data('select2') != null) {
+ $element.data('select2').destroy();
+ }
+
+ this.$element = $element;
+
+ this.id = this._generateId($element);
+
+ options = options || {};
+
+ this.options = new Options(options, $element);
+
+ Select2.__super__.constructor.call(this);
+
+ // Set up the tabindex
+
+ var tabindex = $element.attr('tabindex') || 0;
+ $element.data('old-tabindex', tabindex);
+ $element.attr('tabindex', '-1');
+
+ // Set up containers and adapters
+
+ var DataAdapter = this.options.get('dataAdapter');
+ this.dataAdapter = new DataAdapter($element, this.options);
+
+ var $container = this.render();
+
+ this._placeContainer($container);
+
+ var SelectionAdapter = this.options.get('selectionAdapter');
+ this.selection = new SelectionAdapter($element, this.options);
+ this.$selection = this.selection.render();
+
+ this.selection.position(this.$selection, $container);
+
+ var DropdownAdapter = this.options.get('dropdownAdapter');
+ this.dropdown = new DropdownAdapter($element, this.options);
+ this.$dropdown = this.dropdown.render();
+
+ this.dropdown.position(this.$dropdown, $container);
+
+ var ResultsAdapter = this.options.get('resultsAdapter');
+ this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
+ this.$results = this.results.render();
+
+ this.results.position(this.$results, this.$dropdown);
+
+ // Bind events
+
+ var self = this;
+
+ // Bind the container to all of the adapters
+ this._bindAdapters();
+
+ // Register any DOM event handlers
+ this._registerDomEvents();
+
+ // Register any internal event handlers
+ this._registerDataEvents();
+ this._registerSelectionEvents();
+ this._registerDropdownEvents();
+ this._registerResultsEvents();
+ this._registerEvents();
+
+ // Set the initial state
+ this.dataAdapter.current(function (initialData) {
+ self.trigger('selection:update', {
+ data: initialData
+ });
+ });
+
+ // Hide the original select
+ $element.addClass('select2-hidden-accessible');
+ $element.attr('aria-hidden', 'true');
+
+ // Synchronize any monitored attributes
+ this._syncAttributes();
+
+ $element.data('select2', this);
+ };
+
+ Utils.Extend(Select2, Utils.Observable);
+
+ Select2.prototype._generateId = function ($element) {
+ var id = '';
+
+ if ($element.attr('id') != null) {
+ id = $element.attr('id');
+ } else if ($element.attr('name') != null) {
+ id = $element.attr('name') + '-' + Utils.generateChars(2);
+ } else {
+ id = Utils.generateChars(4);
+ }
+
+ id = id.replace(/(:|\.|\[|\]|,)/g, '');
+ id = 'select2-' + id;
+
+ return id;
+ };
+
+ Select2.prototype._placeContainer = function ($container) {
+ $container.insertAfter(this.$element);
+
+ var width = this._resolveWidth(this.$element, this.options.get('width'));
+
+ if (width != null) {
+ $container.css('width', width);
+ }
+ };
+
+ Select2.prototype._resolveWidth = function ($element, method) {
+ var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
+
+ if (method == 'resolve') {
+ var styleWidth = this._resolveWidth($element, 'style');
+
+ if (styleWidth != null) {
+ return styleWidth;
+ }
+
+ return this._resolveWidth($element, 'element');
+ }
+
+ if (method == 'element') {
+ var elementWidth = $element.outerWidth(false);
+
+ if (elementWidth <= 0) {
+ return 'auto';
+ }
+
+ return elementWidth + 'px';
+ }
+
+ if (method == 'style') {
+ var style = $element.attr('style');
+
+ if (typeof(style) !== 'string') {
+ return null;
+ }
+
+ var attrs = style.split(';');
+
+ for (var i = 0, l = attrs.length; i < l; i = i + 1) {
+ var attr = attrs[i].replace(/\s/g, '');
+ var matches = attr.match(WIDTH);
+
+ if (matches !== null && matches.length >= 1) {
+ return matches[1];
+ }
+ }
+
+ return null;
+ }
+
+ return method;
+ };
+
+ Select2.prototype._bindAdapters = function () {
+ this.dataAdapter.bind(this, this.$container);
+ this.selection.bind(this, this.$container);
+
+ this.dropdown.bind(this, this.$container);
+ this.results.bind(this, this.$container);
+ };
+
+ Select2.prototype._registerDomEvents = function () {
+ var self = this;
+
+ this.$element.on('change.select2', function () {
+ self.dataAdapter.current(function (data) {
+ self.trigger('selection:update', {
+ data: data
+ });
+ });
+ });
+
+ this.$element.on('focus.select2', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this._syncA = Utils.bind(this._syncAttributes, this);
+ this._syncS = Utils.bind(this._syncSubtree, this);
+
+ if (this.$element[0].attachEvent) {
+ this.$element[0].attachEvent('onpropertychange', this._syncA);
+ }
+
+ var observer = window.MutationObserver ||
+ window.WebKitMutationObserver ||
+ window.MozMutationObserver
+ ;
+
+ if (observer != null) {
+ this._observer = new observer(function (mutations) {
+ $.each(mutations, self._syncA);
+ $.each(mutations, self._syncS);
+ });
+ this._observer.observe(this.$element[0], {
+ attributes: true,
+ childList: true,
+ subtree: false
+ });
+ } else if (this.$element[0].addEventListener) {
+ this.$element[0].addEventListener(
+ 'DOMAttrModified',
+ self._syncA,
+ false
+ );
+ this.$element[0].addEventListener(
+ 'DOMNodeInserted',
+ self._syncS,
+ false
+ );
+ this.$element[0].addEventListener(
+ 'DOMNodeRemoved',
+ self._syncS,
+ false
+ );
+ }
+ };
+
+ Select2.prototype._registerDataEvents = function () {
+ var self = this;
+
+ this.dataAdapter.on('*', function (name, params) {
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerSelectionEvents = function () {
+ var self = this;
+ var nonRelayEvents = ['toggle', 'focus'];
+
+ this.selection.on('toggle', function () {
+ self.toggleDropdown();
+ });
+
+ this.selection.on('focus', function (params) {
+ self.focus(params);
+ });
+
+ this.selection.on('*', function (name, params) {
+ if ($.inArray(name, nonRelayEvents) !== -1) {
+ return;
+ }
+
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerDropdownEvents = function () {
+ var self = this;
+
+ this.dropdown.on('*', function (name, params) {
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerResultsEvents = function () {
+ var self = this;
+
+ this.results.on('*', function (name, params) {
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerEvents = function () {
+ var self = this;
+
+ this.on('open', function () {
+ self.$container.addClass('select2-container--open');
+ });
+
+ this.on('close', function () {
+ self.$container.removeClass('select2-container--open');
+ });
+
+ this.on('enable', function () {
+ self.$container.removeClass('select2-container--disabled');
+ });
+
+ this.on('disable', function () {
+ self.$container.addClass('select2-container--disabled');
+ });
+
+ this.on('blur', function () {
+ self.$container.removeClass('select2-container--focus');
+ });
+
+ this.on('query', function (params) {
+ if (!self.isOpen()) {
+ self.trigger('open', {});
+ }
+
+ this.dataAdapter.query(params, function (data) {
+ self.trigger('results:all', {
+ data: data,
+ query: params
+ });
+ });
+ });
+
+ this.on('query:append', function (params) {
+ this.dataAdapter.query(params, function (data) {
+ self.trigger('results:append', {
+ data: data,
+ query: params
+ });
+ });
+ });
+
+ this.on('open', function(){
+ // Focus on the active element when opening dropdown.
+ // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
+ setTimeout(function(){
+ self.focusOnActiveElement();
+ }, 1);
+ });
+
+ $(document).on('keydown', function (evt) {
+ var key = evt.which;
+ if (self.isOpen()) {
+ if (key === KEYS.ESC || key === KEYS.TAB ||
+ (key === KEYS.UP && evt.altKey)) {
+ self.close();
+
+ evt.preventDefault();
+ } else if (key === KEYS.ENTER) {
+ self.trigger('results:select', {});
+
+ evt.preventDefault();
+ } else if ((key === KEYS.SPACE && evt.ctrlKey)) {
+ self.trigger('results:toggle', {});
+
+ evt.preventDefault();
+ } else if (key === KEYS.UP) {
+ self.trigger('results:previous', {});
+
+ evt.preventDefault();
+ } else if (key === KEYS.DOWN) {
+ self.trigger('results:next', {});
+
+ evt.preventDefault();
+ }
+
+ // Move the focus to the selected element on keyboard navigation.
+ // Required for screen readers to work properly.
+ if (key === KEYS.DOWN || key === KEYS.UP) {
+ self.focusOnActiveElement();
+ } else {
+ // Focus on the search if user starts typing.
+ var $searchField = self.$dropdown.find('.select2-search__field');
+ if (! $searchField.length) {
+ $searchField = self.$container.find('.select2-search__field');
+ }
+ $searchField.focus();
+ // Focus back to active selection when finished typing.
+ // Small delay so typed character can be read by screen reader.
+ setTimeout(function(){
+ self.focusOnActiveElement();
+ }, 1000);
+ }
+
+ } else if (self.hasFocus()) {
+ if (key === KEYS.ENTER || key === KEYS.SPACE ||
+ (key === KEYS.DOWN && evt.altKey)) {
+ self.open();
+ evt.preventDefault();
+ }
+ }
+ });
+ };
+
+ Select2.prototype.focusOnActiveElement = function () {
+ // Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards.
+ if (! Utils.isTouchscreen()) {
+ this.$results.find('li.select2-results__option--highlighted').focus();
+ }
+ };
+
+ Select2.prototype._syncAttributes = function () {
+ this.options.set('disabled', this.$element.prop('disabled'));
+
+ if (this.options.get('disabled')) {
+ if (this.isOpen()) {
+ this.close();
+ }
+
+ this.trigger('disable', {});
+ } else {
+ this.trigger('enable', {});
+ }
+ };
+
+ Select2.prototype._syncSubtree = function (evt, mutations) {
+ var changed = false;
+ var self = this;
+
+ // Ignore any mutation events raised for elements that aren't options or
+ // optgroups. This handles the case when the select element is destroyed
+ if (
+ evt && evt.target && (
+ evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
+ )
+ ) {
+ return;
+ }
+
+ if (!mutations) {
+ // If mutation events aren't supported, then we can only assume that the
+ // change affected the selections
+ changed = true;
+ } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
+ for (var n = 0; n < mutations.addedNodes.length; n++) {
+ var node = mutations.addedNodes[n];
+
+ if (node.selected) {
+ changed = true;
+ }
+ }
+ } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
+ changed = true;
+ }
+
+ // Only re-pull the data if we think there is a change
+ if (changed) {
+ this.dataAdapter.current(function (currentData) {
+ self.trigger('selection:update', {
+ data: currentData
+ });
+ });
+ }
+ };
+
+ /**
+ * Override the trigger method to automatically trigger pre-events when
+ * there are events that can be prevented.
+ */
+ Select2.prototype.trigger = function (name, args) {
+ var actualTrigger = Select2.__super__.trigger;
+ var preTriggerMap = {
+ 'open': 'opening',
+ 'close': 'closing',
+ 'select': 'selecting',
+ 'unselect': 'unselecting'
+ };
+
+ if (args === undefined) {
+ args = {};
+ }
+
+ if (name in preTriggerMap) {
+ var preTriggerName = preTriggerMap[name];
+ var preTriggerArgs = {
+ prevented: false,
+ name: name,
+ args: args
+ };
+
+ actualTrigger.call(this, preTriggerName, preTriggerArgs);
+
+ if (preTriggerArgs.prevented) {
+ args.prevented = true;
+
+ return;
+ }
+ }
+
+ actualTrigger.call(this, name, args);
+ };
+
+ Select2.prototype.toggleDropdown = function () {
+ if (this.options.get('disabled')) {
+ return;
+ }
+
+ if (this.isOpen()) {
+ this.close();
+ } else {
+ this.open();
+ }
+ };
+
+ Select2.prototype.open = function () {
+ if (this.isOpen()) {
+ return;
+ }
+
+ this.trigger('query', {});
+ };
+
+ Select2.prototype.close = function () {
+ if (!this.isOpen()) {
+ return;
+ }
+
+ this.trigger('close', {});
+ };
+
+ Select2.prototype.isOpen = function () {
+ return this.$container.hasClass('select2-container--open');
+ };
+
+ Select2.prototype.hasFocus = function () {
+ return this.$container.hasClass('select2-container--focus');
+ };
+
+ Select2.prototype.focus = function (data) {
+ // No need to re-trigger focus events if we are already focused
+ if (this.hasFocus()) {
+ return;
+ }
+
+ this.$container.addClass('select2-container--focus');
+ this.trigger('focus', {});
+ };
+
+ Select2.prototype.enable = function (args) {
+ if (this.options.get('debug') && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `select2("enable")` method has been deprecated and will' +
+ ' be removed in later Select2 versions. Use $element.prop("disabled")' +
+ ' instead.'
+ );
+ }
+
+ if (args == null || args.length === 0) {
+ args = [true];
+ }
+
+ var disabled = !args[0];
+
+ this.$element.prop('disabled', disabled);
+ };
+
+ Select2.prototype.data = function () {
+ if (this.options.get('debug') &&
+ arguments.length > 0 && window.console && console.warn) {
+ console.warn(
+ 'Select2: Data can no longer be set using `select2("data")`. You ' +
+ 'should consider setting the value instead using `$element.val()`.'
+ );
+ }
+
+ var data = [];
+
+ this.dataAdapter.current(function (currentData) {
+ data = currentData;
+ });
+
+ return data;
+ };
+
+ Select2.prototype.val = function (args) {
+ if (this.options.get('debug') && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `select2("val")` method has been deprecated and will be' +
+ ' removed in later Select2 versions. Use $element.val() instead.'
+ );
+ }
+
+ if (args == null || args.length === 0) {
+ return this.$element.val();
+ }
+
+ var newVal = args[0];
+
+ if ($.isArray(newVal)) {
+ newVal = $.map(newVal, function (obj) {
+ return obj.toString();
+ });
+ }
+
+ this.$element.val(newVal).trigger('change');
+ };
+
+ Select2.prototype.destroy = function () {
+ this.$container.remove();
+
+ if (this.$element[0].detachEvent) {
+ this.$element[0].detachEvent('onpropertychange', this._syncA);
+ }
+
+ if (this._observer != null) {
+ this._observer.disconnect();
+ this._observer = null;
+ } else if (this.$element[0].removeEventListener) {
+ this.$element[0]
+ .removeEventListener('DOMAttrModified', this._syncA, false);
+ this.$element[0]
+ .removeEventListener('DOMNodeInserted', this._syncS, false);
+ this.$element[0]
+ .removeEventListener('DOMNodeRemoved', this._syncS, false);
+ }
+
+ this._syncA = null;
+ this._syncS = null;
+
+ this.$element.off('.select2');
+ this.$element.attr('tabindex', this.$element.data('old-tabindex'));
+
+ this.$element.removeClass('select2-hidden-accessible');
+ this.$element.attr('aria-hidden', 'false');
+ this.$element.removeData('select2');
+
+ this.dataAdapter.destroy();
+ this.selection.destroy();
+ this.dropdown.destroy();
+ this.results.destroy();
+
+ this.dataAdapter = null;
+ this.selection = null;
+ this.dropdown = null;
+ this.results = null;
+ };
+
+ Select2.prototype.render = function () {
+ var $container = $(
+ '' +
+ ' ' +
+ ' ' +
+ ' '
+ );
+
+ $container.attr('dir', this.options.get('dir'));
+
+ this.$container = $container;
+
+ this.$container.addClass('select2-container--' + this.options.get('theme'));
+
+ $container.data('element', this.$element);
+
+ return $container;
+ };
+
+ return Select2;
+});
+
+S2.define('select2/compat/utils',[
+ 'jquery'
+], function ($) {
+ function syncCssClasses ($dest, $src, adapter) {
+ var classes, replacements = [], adapted;
+
+ classes = $.trim($dest.attr('class'));
+
+ if (classes) {
+ classes = '' + classes; // for IE which returns object
+
+ $(classes.split(/\s+/)).each(function () {
+ // Save all Select2 classes
+ if (this.indexOf('select2-') === 0) {
+ replacements.push(this);
+ }
+ });
+ }
+
+ classes = $.trim($src.attr('class'));
+
+ if (classes) {
+ classes = '' + classes; // for IE which returns object
+
+ $(classes.split(/\s+/)).each(function () {
+ // Only adapt non-Select2 classes
+ if (this.indexOf('select2-') !== 0) {
+ adapted = adapter(this);
+
+ if (adapted != null) {
+ replacements.push(adapted);
+ }
+ }
+ });
+ }
+
+ $dest.attr('class', replacements.join(' '));
+ }
+
+ return {
+ syncCssClasses: syncCssClasses
+ };
+});
+
+S2.define('select2/compat/containerCss',[
+ 'jquery',
+ './utils'
+], function ($, CompatUtils) {
+ // No-op CSS adapter that discards all classes by default
+ function _containerAdapter (clazz) {
+ return null;
+ }
+
+ function ContainerCSS () { }
+
+ ContainerCSS.prototype.render = function (decorated) {
+ var $container = decorated.call(this);
+
+ var containerCssClass = this.options.get('containerCssClass') || '';
+
+ if ($.isFunction(containerCssClass)) {
+ containerCssClass = containerCssClass(this.$element);
+ }
+
+ var containerCssAdapter = this.options.get('adaptContainerCssClass');
+ containerCssAdapter = containerCssAdapter || _containerAdapter;
+
+ if (containerCssClass.indexOf(':all:') !== -1) {
+ containerCssClass = containerCssClass.replace(':all:', '');
+
+ var _cssAdapter = containerCssAdapter;
+
+ containerCssAdapter = function (clazz) {
+ var adapted = _cssAdapter(clazz);
+
+ if (adapted != null) {
+ // Append the old one along with the adapted one
+ return adapted + ' ' + clazz;
+ }
+
+ return clazz;
+ };
+ }
+
+ var containerCss = this.options.get('containerCss') || {};
+
+ if ($.isFunction(containerCss)) {
+ containerCss = containerCss(this.$element);
+ }
+
+ CompatUtils.syncCssClasses($container, this.$element, containerCssAdapter);
+
+ $container.css(containerCss);
+ $container.addClass(containerCssClass);
+
+ return $container;
+ };
+
+ return ContainerCSS;
+});
+
+S2.define('select2/compat/dropdownCss',[
+ 'jquery',
+ './utils'
+], function ($, CompatUtils) {
+ // No-op CSS adapter that discards all classes by default
+ function _dropdownAdapter (clazz) {
+ return null;
+ }
+
+ function DropdownCSS () { }
+
+ DropdownCSS.prototype.render = function (decorated) {
+ var $dropdown = decorated.call(this);
+
+ var dropdownCssClass = this.options.get('dropdownCssClass') || '';
+
+ if ($.isFunction(dropdownCssClass)) {
+ dropdownCssClass = dropdownCssClass(this.$element);
+ }
+
+ var dropdownCssAdapter = this.options.get('adaptDropdownCssClass');
+ dropdownCssAdapter = dropdownCssAdapter || _dropdownAdapter;
+
+ if (dropdownCssClass.indexOf(':all:') !== -1) {
+ dropdownCssClass = dropdownCssClass.replace(':all:', '');
+
+ var _cssAdapter = dropdownCssAdapter;
+
+ dropdownCssAdapter = function (clazz) {
+ var adapted = _cssAdapter(clazz);
+
+ if (adapted != null) {
+ // Append the old one along with the adapted one
+ return adapted + ' ' + clazz;
+ }
+
+ return clazz;
+ };
+ }
+
+ var dropdownCss = this.options.get('dropdownCss') || {};
+
+ if ($.isFunction(dropdownCss)) {
+ dropdownCss = dropdownCss(this.$element);
+ }
+
+ CompatUtils.syncCssClasses($dropdown, this.$element, dropdownCssAdapter);
+
+ $dropdown.css(dropdownCss);
+ $dropdown.addClass(dropdownCssClass);
+
+ return $dropdown;
+ };
+
+ return DropdownCSS;
+});
+
+S2.define('select2/compat/initSelection',[
+ 'jquery'
+], function ($) {
+ function InitSelection (decorated, $element, options) {
+ if (options.get('debug') && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `initSelection` option has been deprecated in favor' +
+ ' of a custom data adapter that overrides the `current` method. ' +
+ 'This method is now called multiple times instead of a single ' +
+ 'time when the instance is initialized. Support will be removed ' +
+ 'for the `initSelection` option in future versions of Select2'
+ );
+ }
+
+ this.initSelection = options.get('initSelection');
+ this._isInitialized = false;
+
+ decorated.call(this, $element, options);
+ }
+
+ InitSelection.prototype.current = function (decorated, callback) {
+ var self = this;
+
+ if (this._isInitialized) {
+ decorated.call(this, callback);
+
+ return;
+ }
+
+ this.initSelection.call(null, this.$element, function (data) {
+ self._isInitialized = true;
+
+ if (!$.isArray(data)) {
+ data = [data];
+ }
+
+ callback(data);
+ });
+ };
+
+ return InitSelection;
+});
+
+S2.define('select2/compat/inputData',[
+ 'jquery'
+], function ($) {
+ function InputData (decorated, $element, options) {
+ this._currentData = [];
+ this._valueSeparator = options.get('valueSeparator') || ',';
+
+ if ($element.prop('type') === 'hidden') {
+ if (options.get('debug') && console && console.warn) {
+ console.warn(
+ 'Select2: Using a hidden input with Select2 is no longer ' +
+ 'supported and may stop working in the future. It is recommended ' +
+ 'to use a `` element instead.'
+ );
+ }
+ }
+
+ decorated.call(this, $element, options);
+ }
+
+ InputData.prototype.current = function (_, callback) {
+ function getSelected (data, selectedIds) {
+ var selected = [];
+
+ if (data.selected || $.inArray(data.id, selectedIds) !== -1) {
+ data.selected = true;
+ selected.push(data);
+ } else {
+ data.selected = false;
+ }
+
+ if (data.children) {
+ selected.push.apply(selected, getSelected(data.children, selectedIds));
+ }
+
+ return selected;
+ }
+
+ var selected = [];
+
+ for (var d = 0; d < this._currentData.length; d++) {
+ var data = this._currentData[d];
+
+ selected.push.apply(
+ selected,
+ getSelected(
+ data,
+ this.$element.val().split(
+ this._valueSeparator
+ )
+ )
+ );
+ }
+
+ callback(selected);
+ };
+
+ InputData.prototype.select = function (_, data) {
+ if (!this.options.get('multiple')) {
+ this.current(function (allData) {
+ $.map(allData, function (data) {
+ data.selected = false;
+ });
+ });
+
+ this.$element.val(data.id);
+ this.$element.trigger('change');
+ } else {
+ var value = this.$element.val();
+ value += this._valueSeparator + data.id;
+
+ this.$element.val(value);
+ this.$element.trigger('change');
+ }
+ };
+
+ InputData.prototype.unselect = function (_, data) {
+ var self = this;
+
+ data.selected = false;
+
+ this.current(function (allData) {
+ var values = [];
+
+ for (var d = 0; d < allData.length; d++) {
+ var item = allData[d];
+
+ if (data.id == item.id) {
+ continue;
+ }
+
+ values.push(item.id);
+ }
+
+ self.$element.val(values.join(self._valueSeparator));
+ self.$element.trigger('change');
+ });
+ };
+
+ InputData.prototype.query = function (_, params, callback) {
+ var results = [];
+
+ for (var d = 0; d < this._currentData.length; d++) {
+ var data = this._currentData[d];
+
+ var matches = this.matches(params, data);
+
+ if (matches !== null) {
+ results.push(matches);
+ }
+ }
+
+ callback({
+ results: results
+ });
+ };
+
+ InputData.prototype.addOptions = function (_, $options) {
+ var options = $.map($options, function ($option) {
+ return $.data($option[0], 'data');
+ });
+
+ this._currentData.push.apply(this._currentData, options);
+ };
+
+ return InputData;
+});
+
+S2.define('select2/compat/matcher',[
+ 'jquery'
+], function ($) {
+ function oldMatcher (matcher) {
+ function wrappedMatcher (params, data) {
+ var match = $.extend(true, {}, data);
+
+ if (params.term == null || $.trim(params.term) === '') {
+ return match;
+ }
+
+ if (data.children) {
+ for (var c = data.children.length - 1; c >= 0; c--) {
+ var child = data.children[c];
+
+ // Check if the child object matches
+ // The old matcher returned a boolean true or false
+ var doesMatch = matcher(params.term, child.text, child);
+
+ // If the child didn't match, pop it off
+ if (!doesMatch) {
+ match.children.splice(c, 1);
+ }
+ }
+
+ if (match.children.length > 0) {
+ return match;
+ }
+ }
+
+ if (matcher(params.term, data.text, data)) {
+ return match;
+ }
+
+ return null;
+ }
+
+ return wrappedMatcher;
+ }
+
+ return oldMatcher;
+});
+
+S2.define('select2/compat/query',[
+
+], function () {
+ function Query (decorated, $element, options) {
+ if (options.get('debug') && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `query` option has been deprecated in favor of a ' +
+ 'custom data adapter that overrides the `query` method. Support ' +
+ 'will be removed for the `query` option in future versions of ' +
+ 'Select2.'
+ );
+ }
+
+ decorated.call(this, $element, options);
+ }
+
+ Query.prototype.query = function (_, params, callback) {
+ params.callback = callback;
+
+ var query = this.options.get('query');
+
+ query.call(null, params);
+ };
+
+ return Query;
+});
+
+S2.define('select2/dropdown/attachContainer',[
+
+], function () {
+ function AttachContainer (decorated, $element, options) {
+ decorated.call(this, $element, options);
+ }
+
+ AttachContainer.prototype.position =
+ function (decorated, $dropdown, $container) {
+ var $dropdownContainer = $container.find('.dropdown-wrapper');
+ $dropdownContainer.append($dropdown);
+
+ $dropdown.addClass('select2-dropdown--below');
+ $container.addClass('select2-container--below');
+ };
+
+ return AttachContainer;
+});
+
+S2.define('select2/dropdown/stopPropagation',[
+
+], function () {
+ function StopPropagation () { }
+
+ StopPropagation.prototype.bind = function (decorated, container, $container) {
+ decorated.call(this, container, $container);
+
+ var stoppedEvents = [
+ 'blur',
+ 'change',
+ 'click',
+ 'dblclick',
+ 'focus',
+ 'focusin',
+ 'focusout',
+ 'input',
+ 'keydown',
+ 'keyup',
+ 'keypress',
+ 'mousedown',
+ 'mouseenter',
+ 'mouseleave',
+ 'mousemove',
+ 'mouseover',
+ 'mouseup',
+ 'search',
+ 'touchend',
+ 'touchstart'
+ ];
+
+ this.$dropdown.on(stoppedEvents.join(' '), function (evt) {
+ evt.stopPropagation();
+ });
+ };
+
+ return StopPropagation;
+});
+
+S2.define('select2/selection/stopPropagation',[
+
+], function () {
+ function StopPropagation () { }
+
+ StopPropagation.prototype.bind = function (decorated, container, $container) {
+ decorated.call(this, container, $container);
+
+ var stoppedEvents = [
+ 'blur',
+ 'change',
+ 'click',
+ 'dblclick',
+ 'focus',
+ 'focusin',
+ 'focusout',
+ 'input',
+ 'keydown',
+ 'keyup',
+ 'keypress',
+ 'mousedown',
+ 'mouseenter',
+ 'mouseleave',
+ 'mousemove',
+ 'mouseover',
+ 'mouseup',
+ 'search',
+ 'touchend',
+ 'touchstart'
+ ];
+
+ this.$selection.on(stoppedEvents.join(' '), function (evt) {
+ evt.stopPropagation();
+ });
+ };
+
+ return StopPropagation;
+});
+
+/*!
+ * jQuery Mousewheel 3.1.13
+ *
+ * Copyright jQuery Foundation and other contributors
+ * Released under the MIT license
+ * http://jquery.org/license
+ */
+
+(function (factory) {
+ if ( typeof S2.define === 'function' && S2.define.amd ) {
+ // AMD. Register as an anonymous module.
+ S2.define('jquery-mousewheel',['jquery'], factory);
+ } else if (typeof exports === 'object') {
+ // Node/CommonJS style for Browserify
+ module.exports = factory;
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+}(function ($) {
+
+ var toFix = ['wheel', 'mousewheel', 'DOMMouseScroll', 'MozMousePixelScroll'],
+ toBind = ( 'onwheel' in document || document.documentMode >= 9 ) ?
+ ['wheel'] : ['mousewheel', 'DomMouseScroll', 'MozMousePixelScroll'],
+ slice = Array.prototype.slice,
+ nullLowestDeltaTimeout, lowestDelta;
+
+ if ( $.event.fixHooks ) {
+ for ( var i = toFix.length; i; ) {
+ $.event.fixHooks[ toFix[--i] ] = $.event.mouseHooks;
+ }
+ }
+
+ var special = $.event.special.mousewheel = {
+ version: '3.1.12',
+
+ setup: function() {
+ if ( this.addEventListener ) {
+ for ( var i = toBind.length; i; ) {
+ this.addEventListener( toBind[--i], handler, false );
+ }
+ } else {
+ this.onmousewheel = handler;
+ }
+ // Store the line height and page height for this particular element
+ $.data(this, 'mousewheel-line-height', special.getLineHeight(this));
+ $.data(this, 'mousewheel-page-height', special.getPageHeight(this));
+ },
+
+ teardown: function() {
+ if ( this.removeEventListener ) {
+ for ( var i = toBind.length; i; ) {
+ this.removeEventListener( toBind[--i], handler, false );
+ }
+ } else {
+ this.onmousewheel = null;
+ }
+ // Clean up the data we added to the element
+ $.removeData(this, 'mousewheel-line-height');
+ $.removeData(this, 'mousewheel-page-height');
+ },
+
+ getLineHeight: function(elem) {
+ var $elem = $(elem),
+ $parent = $elem['offsetParent' in $.fn ? 'offsetParent' : 'parent']();
+ if (!$parent.length) {
+ $parent = $('body');
+ }
+ return parseInt($parent.css('fontSize'), 10) || parseInt($elem.css('fontSize'), 10) || 16;
+ },
+
+ getPageHeight: function(elem) {
+ return $(elem).height();
+ },
+
+ settings: {
+ adjustOldDeltas: true, // see shouldAdjustOldDeltas() below
+ normalizeOffset: true // calls getBoundingClientRect for each event
+ }
+ };
+
+ $.fn.extend({
+ mousewheel: function(fn) {
+ return fn ? this.bind('mousewheel', fn) : this.trigger('mousewheel');
+ },
+
+ unmousewheel: function(fn) {
+ return this.unbind('mousewheel', fn);
+ }
+ });
+
+
+ function handler(event) {
+ var orgEvent = event || window.event,
+ args = slice.call(arguments, 1),
+ delta = 0,
+ deltaX = 0,
+ deltaY = 0,
+ absDelta = 0,
+ offsetX = 0,
+ offsetY = 0;
+ event = $.event.fix(orgEvent);
+ event.type = 'mousewheel';
+
+ // Old school scrollwheel delta
+ if ( 'detail' in orgEvent ) { deltaY = orgEvent.detail * -1; }
+ if ( 'wheelDelta' in orgEvent ) { deltaY = orgEvent.wheelDelta; }
+ if ( 'wheelDeltaY' in orgEvent ) { deltaY = orgEvent.wheelDeltaY; }
+ if ( 'wheelDeltaX' in orgEvent ) { deltaX = orgEvent.wheelDeltaX * -1; }
+
+ // Firefox < 17 horizontal scrolling related to DOMMouseScroll event
+ if ( 'axis' in orgEvent && orgEvent.axis === orgEvent.HORIZONTAL_AXIS ) {
+ deltaX = deltaY * -1;
+ deltaY = 0;
+ }
+
+ // Set delta to be deltaY or deltaX if deltaY is 0 for backwards compatabilitiy
+ delta = deltaY === 0 ? deltaX : deltaY;
+
+ // New school wheel delta (wheel event)
+ if ( 'deltaY' in orgEvent ) {
+ deltaY = orgEvent.deltaY * -1;
+ delta = deltaY;
+ }
+ if ( 'deltaX' in orgEvent ) {
+ deltaX = orgEvent.deltaX;
+ if ( deltaY === 0 ) { delta = deltaX * -1; }
+ }
+
+ // No change actually happened, no reason to go any further
+ if ( deltaY === 0 && deltaX === 0 ) { return; }
+
+ // Need to convert lines and pages to pixels if we aren't already in pixels
+ // There are three delta modes:
+ // * deltaMode 0 is by pixels, nothing to do
+ // * deltaMode 1 is by lines
+ // * deltaMode 2 is by pages
+ if ( orgEvent.deltaMode === 1 ) {
+ var lineHeight = $.data(this, 'mousewheel-line-height');
+ delta *= lineHeight;
+ deltaY *= lineHeight;
+ deltaX *= lineHeight;
+ } else if ( orgEvent.deltaMode === 2 ) {
+ var pageHeight = $.data(this, 'mousewheel-page-height');
+ delta *= pageHeight;
+ deltaY *= pageHeight;
+ deltaX *= pageHeight;
+ }
+
+ // Store lowest absolute delta to normalize the delta values
+ absDelta = Math.max( Math.abs(deltaY), Math.abs(deltaX) );
+
+ if ( !lowestDelta || absDelta < lowestDelta ) {
+ lowestDelta = absDelta;
+
+ // Adjust older deltas if necessary
+ if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
+ lowestDelta /= 40;
+ }
+ }
+
+ // Adjust older deltas if necessary
+ if ( shouldAdjustOldDeltas(orgEvent, absDelta) ) {
+ // Divide all the things by 40!
+ delta /= 40;
+ deltaX /= 40;
+ deltaY /= 40;
+ }
+
+ // Get a whole, normalized value for the deltas
+ delta = Math[ delta >= 1 ? 'floor' : 'ceil' ](delta / lowestDelta);
+ deltaX = Math[ deltaX >= 1 ? 'floor' : 'ceil' ](deltaX / lowestDelta);
+ deltaY = Math[ deltaY >= 1 ? 'floor' : 'ceil' ](deltaY / lowestDelta);
+
+ // Normalise offsetX and offsetY properties
+ if ( special.settings.normalizeOffset && this.getBoundingClientRect ) {
+ var boundingRect = this.getBoundingClientRect();
+ offsetX = event.clientX - boundingRect.left;
+ offsetY = event.clientY - boundingRect.top;
+ }
+
+ // Add information to the event object
+ event.deltaX = deltaX;
+ event.deltaY = deltaY;
+ event.deltaFactor = lowestDelta;
+ event.offsetX = offsetX;
+ event.offsetY = offsetY;
+ // Go ahead and set deltaMode to 0 since we converted to pixels
+ // Although this is a little odd since we overwrite the deltaX/Y
+ // properties with normalized deltas.
+ event.deltaMode = 0;
+
+ // Add event and delta to the front of the arguments
+ args.unshift(event, delta, deltaX, deltaY);
+
+ // Clearout lowestDelta after sometime to better
+ // handle multiple device types that give different
+ // a different lowestDelta
+ // Ex: trackpad = 3 and mouse wheel = 120
+ if (nullLowestDeltaTimeout) { clearTimeout(nullLowestDeltaTimeout); }
+ nullLowestDeltaTimeout = setTimeout(nullLowestDelta, 200);
+
+ return ($.event.dispatch || $.event.handle).apply(this, args);
+ }
+
+ function nullLowestDelta() {
+ lowestDelta = null;
+ }
+
+ function shouldAdjustOldDeltas(orgEvent, absDelta) {
+ // If this is an older event and the delta is divisable by 120,
+ // then we are assuming that the browser is treating this as an
+ // older mouse wheel event and that we should divide the deltas
+ // by 40 to try and get a more usable deltaFactor.
+ // Side note, this actually impacts the reported scroll distance
+ // in older browsers and can cause scrolling to be slower than native.
+ // Turn this off by setting $.event.special.mousewheel.settings.adjustOldDeltas to false.
+ return special.settings.adjustOldDeltas && orgEvent.type === 'mousewheel' && absDelta % 120 === 0;
+ }
+
+}));
+
+S2.define('jquery.select2',[
+ 'jquery',
+ 'jquery-mousewheel',
+
+ './select2/core',
+ './select2/defaults'
+], function ($, _, Select2, Defaults) {
+ if ($.fn.selectWoo == null) {
+ // All methods that should return the element
+ var thisMethods = ['open', 'close', 'destroy'];
+
+ $.fn.selectWoo = function (options) {
+ options = options || {};
+
+ if (typeof options === 'object') {
+ this.each(function () {
+ var instanceOptions = $.extend(true, {}, options);
+
+ var instance = new Select2($(this), instanceOptions);
+ });
+
+ return this;
+ } else if (typeof options === 'string') {
+ var ret;
+ var args = Array.prototype.slice.call(arguments, 1);
+
+ this.each(function () {
+ var instance = $(this).data('select2');
+
+ if (instance == null && window.console && console.error) {
+ console.error(
+ 'The select2(\'' + options + '\') method was called on an ' +
+ 'element that is not using Select2.'
+ );
+ }
+
+ ret = instance[options].apply(instance, args);
+ });
+
+ // Check if we should be returning `this`
+ if ($.inArray(options, thisMethods) > -1) {
+ return this;
+ }
+
+ return ret;
+ } else {
+ throw new Error('Invalid arguments for Select2: ' + options);
+ }
+ };
+ }
+
+ if ($.fn.select2 != null && $.fn.select2.defaults != null) {
+ $.fn.selectWoo.defaults = $.fn.select2.defaults;
+ }
+
+ if ($.fn.selectWoo.defaults == null) {
+ $.fn.selectWoo.defaults = Defaults;
+ }
+
+ // Also register selectWoo under select2 if select2 is not already present.
+ $.fn.select2 = $.fn.select2 || $.fn.selectWoo;
+
+ return Select2;
+});
+
+ // Return the AMD loader configuration so it can be used outside of this file
+ return {
+ define: S2.define,
+ require: S2.require
+ };
+}());
+
+ // Autoload the jQuery bindings
+ // We know that all of the modules exist above this, so we're safe
+ var select2 = S2.require('jquery.select2');
+
+ // Hold the AMD module references on the jQuery function that was just loaded
+ // This allows Select2 to use the internal loader outside of this file, such
+ // as in the language files.
+ jQuery.fn.select2.amd = S2;
+ jQuery.fn.selectWoo.amd = S2;
+
+ // Return the Select2 instance for anyone who is importing it.
+ return select2;
+}));
diff --git a/assets/kirki/assets/vendor/selectWoo/js/selectWoo.full.min.js b/assets/kirki/assets/vendor/selectWoo/js/selectWoo.full.min.js
new file mode 100644
index 0000000..9c7c386
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/selectWoo.full.min.js
@@ -0,0 +1 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(' '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a(' ');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(' '),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a(" ")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html(''),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('× ')},d.prototype.update=function(a){var b=this;if(this.clear(),0!==a.length){for(var d=[],e=0;e1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('× ');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a(' ');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a(' ');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a(' '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(" "),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen())if(c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault()),c===d.DOWN||c===d.UP)b.focusOnActiveElement();else{var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3)}else b.hasFocus()&&(c===d.ENTER||c===d.SPACE||c===d.DOWN&&a.altKey)&&(b.open(),a.preventDefault())})},e.prototype.focusOnActiveElement=function(){c.isTouchscreen()||this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("select2/compat/utils",["jquery"],function(a){function b(b,c,d){var e,f,g=[];e=a.trim(b.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0===this.indexOf("select2-")&&g.push(this)})),e=a.trim(c.attr("class")),e&&(e=""+e,a(e.split(/\s+/)).each(function(){0!==this.indexOf("select2-")&&null!=(f=d(this))&&g.push(f)})),b.attr("class",g.join(" "))}return{syncCssClasses:b}}),b.define("select2/compat/containerCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("containerCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptContainerCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("containerCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/dropdownCss",["jquery","./utils"],function(a,b){function c(a){return null}function d(){}return d.prototype.render=function(d){var e=d.call(this),f=this.options.get("dropdownCssClass")||"";a.isFunction(f)&&(f=f(this.$element));var g=this.options.get("adaptDropdownCssClass");if(g=g||c,-1!==f.indexOf(":all:")){f=f.replace(":all:","");var h=g;g=function(a){var b=h(a);return null!=b?b+" "+a:a}}var i=this.options.get("dropdownCss")||{};return a.isFunction(i)&&(i=i(this.$element)),b.syncCssClasses(e,this.$element,g),e.css(i),e.addClass(f),e},d}),b.define("select2/compat/initSelection",["jquery"],function(a){function b(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `initSelection` option has been deprecated in favor of a custom data adapter that overrides the `current` method. This method is now called multiple times instead of a single time when the instance is initialized. Support will be removed for the `initSelection` option in future versions of Select2"),this.initSelection=c.get("initSelection"),this._isInitialized=!1,a.call(this,b,c)}return b.prototype.current=function(b,c){var d=this;if(this._isInitialized)return void b.call(this,c);this.initSelection.call(null,this.$element,function(b){d._isInitialized=!0,a.isArray(b)||(b=[b]),c(b)})},b}),b.define("select2/compat/inputData",["jquery"],function(a){function b(a,b,c){this._currentData=[],this._valueSeparator=c.get("valueSeparator")||",","hidden"===b.prop("type")&&c.get("debug")&&console&&console.warn&&console.warn("Select2: Using a hidden input with Select2 is no longer supported and may stop working in the future. It is recommended to use a `` element instead."),a.call(this,b,c)}return b.prototype.current=function(b,c){function d(b,c){var e=[];return b.selected||-1!==a.inArray(b.id,c)?(b.selected=!0,e.push(b)):b.selected=!1,b.children&&e.push.apply(e,d(b.children,c)),e}for(var e=[],f=0;f=0;f--){var g=d.children[f];b(c.term,g.text,g)||e.children.splice(f,1)}if(e.children.length>0)return e}return b(c.term,d.text,d)?e:null}return c}return b}),b.define("select2/compat/query",[],function(){function a(a,b,c){c.get("debug")&&window.console&&console.warn&&console.warn("Select2: The `query` option has been deprecated in favor of a custom data adapter that overrides the `query` method. Support will be removed for the `query` option in future versions of Select2."),a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.callback=c,this.options.get("query").call(null,b)},a}),b.define("select2/dropdown/attachContainer",[],function(){function a(a,b,c){a.call(this,b,c)}return a.prototype.position=function(a,b,c){c.find(".dropdown-wrapper").append(b),b.addClass("select2-dropdown--below"),c.addClass("select2-container--below")},a}),b.define("select2/dropdown/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(d.join(" "),function(a){a.stopPropagation()})},a}),b.define("select2/selection/stopPropagation",[],function(){function a(){}return a.prototype.bind=function(a,b,c){a.call(this,b,c);var d=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(d.join(" "),function(a){a.stopPropagation()})},a}),function(c){"function"==typeof b.define&&b.define.amd?b.define("jquery-mousewheel",["jquery"],c):"object"==typeof exports?module.exports=c:c(a)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||n=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120==0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c});
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/js/selectWoo.js b/assets/kirki/assets/vendor/selectWoo/js/selectWoo.js
new file mode 100644
index 0000000..22a7207
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/selectWoo.js
@@ -0,0 +1,5842 @@
+/*!
+ * SelectWoo 1.0.1
+ * https://github.com/woocommerce/selectWoo
+ *
+ * Released under the MIT license
+ * https://github.com/woocommerce/selectWoo/blob/master/LICENSE.md
+ */
+(function (factory) {
+ if (typeof define === 'function' && define.amd) {
+ // AMD. Register as an anonymous module.
+ define(['jquery'], factory);
+ } else if (typeof module === 'object' && module.exports) {
+ // Node/CommonJS
+ module.exports = function (root, jQuery) {
+ if (jQuery === undefined) {
+ // require('jQuery') returns a factory that requires window to
+ // build a jQuery instance, we normalize how we use modules
+ // that require this pattern but the window provided is a noop
+ // if it's defined (how jquery works)
+ if (typeof window !== 'undefined') {
+ jQuery = require('jquery');
+ }
+ else {
+ jQuery = require('jquery')(root);
+ }
+ }
+ factory(jQuery);
+ return jQuery;
+ };
+ } else {
+ // Browser globals
+ factory(jQuery);
+ }
+} (function (jQuery) {
+ // This is needed so we can catch the AMD loader configuration and use it
+ // The inner file should be wrapped (by `banner.start.js`) in a function that
+ // returns the AMD loader references.
+ var S2 =(function () {
+ // Restore the Select2 AMD loader so it can be used
+ // Needed mostly in the language files, where the loader is not inserted
+ if (jQuery && jQuery.fn && jQuery.fn.select2 && jQuery.fn.select2.amd) {
+ var S2 = jQuery.fn.select2.amd;
+ }
+var S2;(function () { if (!S2 || !S2.requirejs) {
+if (!S2) { S2 = {}; } else { require = S2; }
+/**
+ * @license almond 0.3.3 Copyright jQuery Foundation and other contributors.
+ * Released under MIT license, http://github.com/requirejs/almond/LICENSE
+ */
+//Going sloppy to avoid 'use strict' string cost, but strict practices should
+//be followed.
+/*global setTimeout: false */
+
+var requirejs, require, define;
+(function (undef) {
+ var main, req, makeMap, handlers,
+ defined = {},
+ waiting = {},
+ config = {},
+ defining = {},
+ hasOwn = Object.prototype.hasOwnProperty,
+ aps = [].slice,
+ jsSuffixRegExp = /\.js$/;
+
+ function hasProp(obj, prop) {
+ return hasOwn.call(obj, prop);
+ }
+
+ /**
+ * Given a relative module name, like ./something, normalize it to
+ * a real name that can be mapped to a path.
+ * @param {String} name the relative name
+ * @param {String} baseName a real name that the name arg is relative
+ * to.
+ * @returns {String} normalized name
+ */
+ function normalize(name, baseName) {
+ var nameParts, nameSegment, mapValue, foundMap, lastIndex,
+ foundI, foundStarMap, starI, i, j, part, normalizedBaseParts,
+ baseParts = baseName && baseName.split("/"),
+ map = config.map,
+ starMap = (map && map['*']) || {};
+
+ //Adjust any relative paths.
+ if (name) {
+ name = name.split('/');
+ lastIndex = name.length - 1;
+
+ // If wanting node ID compatibility, strip .js from end
+ // of IDs. Have to do this here, and not in nameToUrl
+ // because node allows either .js or non .js to map
+ // to same file.
+ if (config.nodeIdCompat && jsSuffixRegExp.test(name[lastIndex])) {
+ name[lastIndex] = name[lastIndex].replace(jsSuffixRegExp, '');
+ }
+
+ // Starts with a '.' so need the baseName
+ if (name[0].charAt(0) === '.' && baseParts) {
+ //Convert baseName to array, and lop off the last part,
+ //so that . matches that 'directory' and not name of the baseName's
+ //module. For instance, baseName of 'one/two/three', maps to
+ //'one/two/three.js', but we want the directory, 'one/two' for
+ //this normalization.
+ normalizedBaseParts = baseParts.slice(0, baseParts.length - 1);
+ name = normalizedBaseParts.concat(name);
+ }
+
+ //start trimDots
+ for (i = 0; i < name.length; i++) {
+ part = name[i];
+ if (part === '.') {
+ name.splice(i, 1);
+ i -= 1;
+ } else if (part === '..') {
+ // If at the start, or previous value is still ..,
+ // keep them so that when converted to a path it may
+ // still work when converted to a path, even though
+ // as an ID it is less than ideal. In larger point
+ // releases, may be better to just kick out an error.
+ if (i === 0 || (i === 1 && name[2] === '..') || name[i - 1] === '..') {
+ continue;
+ } else if (i > 0) {
+ name.splice(i - 1, 2);
+ i -= 2;
+ }
+ }
+ }
+ //end trimDots
+
+ name = name.join('/');
+ }
+
+ //Apply map config if available.
+ if ((baseParts || starMap) && map) {
+ nameParts = name.split('/');
+
+ for (i = nameParts.length; i > 0; i -= 1) {
+ nameSegment = nameParts.slice(0, i).join("/");
+
+ if (baseParts) {
+ //Find the longest baseName segment match in the config.
+ //So, do joins on the biggest to smallest lengths of baseParts.
+ for (j = baseParts.length; j > 0; j -= 1) {
+ mapValue = map[baseParts.slice(0, j).join('/')];
+
+ //baseName segment has config, find if it has one for
+ //this name.
+ if (mapValue) {
+ mapValue = mapValue[nameSegment];
+ if (mapValue) {
+ //Match, update name to the new value.
+ foundMap = mapValue;
+ foundI = i;
+ break;
+ }
+ }
+ }
+ }
+
+ if (foundMap) {
+ break;
+ }
+
+ //Check for a star map match, but just hold on to it,
+ //if there is a shorter segment match later in a matching
+ //config, then favor over this star map.
+ if (!foundStarMap && starMap && starMap[nameSegment]) {
+ foundStarMap = starMap[nameSegment];
+ starI = i;
+ }
+ }
+
+ if (!foundMap && foundStarMap) {
+ foundMap = foundStarMap;
+ foundI = starI;
+ }
+
+ if (foundMap) {
+ nameParts.splice(0, foundI, foundMap);
+ name = nameParts.join('/');
+ }
+ }
+
+ return name;
+ }
+
+ function makeRequire(relName, forceSync) {
+ return function () {
+ //A version of a require function that passes a moduleName
+ //value for items that may need to
+ //look up paths relative to the moduleName
+ var args = aps.call(arguments, 0);
+
+ //If first arg is not require('string'), and there is only
+ //one arg, it is the array form without a callback. Insert
+ //a null so that the following concat is correct.
+ if (typeof args[0] !== 'string' && args.length === 1) {
+ args.push(null);
+ }
+ return req.apply(undef, args.concat([relName, forceSync]));
+ };
+ }
+
+ function makeNormalize(relName) {
+ return function (name) {
+ return normalize(name, relName);
+ };
+ }
+
+ function makeLoad(depName) {
+ return function (value) {
+ defined[depName] = value;
+ };
+ }
+
+ function callDep(name) {
+ if (hasProp(waiting, name)) {
+ var args = waiting[name];
+ delete waiting[name];
+ defining[name] = true;
+ main.apply(undef, args);
+ }
+
+ if (!hasProp(defined, name) && !hasProp(defining, name)) {
+ throw new Error('No ' + name);
+ }
+ return defined[name];
+ }
+
+ //Turns a plugin!resource to [plugin, resource]
+ //with the plugin being undefined if the name
+ //did not have a plugin prefix.
+ function splitPrefix(name) {
+ var prefix,
+ index = name ? name.indexOf('!') : -1;
+ if (index > -1) {
+ prefix = name.substring(0, index);
+ name = name.substring(index + 1, name.length);
+ }
+ return [prefix, name];
+ }
+
+ //Creates a parts array for a relName where first part is plugin ID,
+ //second part is resource ID. Assumes relName has already been normalized.
+ function makeRelParts(relName) {
+ return relName ? splitPrefix(relName) : [];
+ }
+
+ /**
+ * Makes a name map, normalizing the name, and using a plugin
+ * for normalization if necessary. Grabs a ref to plugin
+ * too, as an optimization.
+ */
+ makeMap = function (name, relParts) {
+ var plugin,
+ parts = splitPrefix(name),
+ prefix = parts[0],
+ relResourceName = relParts[1];
+
+ name = parts[1];
+
+ if (prefix) {
+ prefix = normalize(prefix, relResourceName);
+ plugin = callDep(prefix);
+ }
+
+ //Normalize according
+ if (prefix) {
+ if (plugin && plugin.normalize) {
+ name = plugin.normalize(name, makeNormalize(relResourceName));
+ } else {
+ name = normalize(name, relResourceName);
+ }
+ } else {
+ name = normalize(name, relResourceName);
+ parts = splitPrefix(name);
+ prefix = parts[0];
+ name = parts[1];
+ if (prefix) {
+ plugin = callDep(prefix);
+ }
+ }
+
+ //Using ridiculous property names for space reasons
+ return {
+ f: prefix ? prefix + '!' + name : name, //fullName
+ n: name,
+ pr: prefix,
+ p: plugin
+ };
+ };
+
+ function makeConfig(name) {
+ return function () {
+ return (config && config.config && config.config[name]) || {};
+ };
+ }
+
+ handlers = {
+ require: function (name) {
+ return makeRequire(name);
+ },
+ exports: function (name) {
+ var e = defined[name];
+ if (typeof e !== 'undefined') {
+ return e;
+ } else {
+ return (defined[name] = {});
+ }
+ },
+ module: function (name) {
+ return {
+ id: name,
+ uri: '',
+ exports: defined[name],
+ config: makeConfig(name)
+ };
+ }
+ };
+
+ main = function (name, deps, callback, relName) {
+ var cjsModule, depName, ret, map, i, relParts,
+ args = [],
+ callbackType = typeof callback,
+ usingExports;
+
+ //Use name if no relName
+ relName = relName || name;
+ relParts = makeRelParts(relName);
+
+ //Call the callback to define the module, if necessary.
+ if (callbackType === 'undefined' || callbackType === 'function') {
+ //Pull out the defined dependencies and pass the ordered
+ //values to the callback.
+ //Default to [require, exports, module] if no deps
+ deps = !deps.length && callback.length ? ['require', 'exports', 'module'] : deps;
+ for (i = 0; i < deps.length; i += 1) {
+ map = makeMap(deps[i], relParts);
+ depName = map.f;
+
+ //Fast path CommonJS standard dependencies.
+ if (depName === "require") {
+ args[i] = handlers.require(name);
+ } else if (depName === "exports") {
+ //CommonJS module spec 1.1
+ args[i] = handlers.exports(name);
+ usingExports = true;
+ } else if (depName === "module") {
+ //CommonJS module spec 1.1
+ cjsModule = args[i] = handlers.module(name);
+ } else if (hasProp(defined, depName) ||
+ hasProp(waiting, depName) ||
+ hasProp(defining, depName)) {
+ args[i] = callDep(depName);
+ } else if (map.p) {
+ map.p.load(map.n, makeRequire(relName, true), makeLoad(depName), {});
+ args[i] = defined[depName];
+ } else {
+ throw new Error(name + ' missing ' + depName);
+ }
+ }
+
+ ret = callback ? callback.apply(defined[name], args) : undefined;
+
+ if (name) {
+ //If setting exports via "module" is in play,
+ //favor that over return value and exports. After that,
+ //favor a non-undefined return value over exports use.
+ if (cjsModule && cjsModule.exports !== undef &&
+ cjsModule.exports !== defined[name]) {
+ defined[name] = cjsModule.exports;
+ } else if (ret !== undef || !usingExports) {
+ //Use the return value from the function.
+ defined[name] = ret;
+ }
+ }
+ } else if (name) {
+ //May just be an object definition for the module. Only
+ //worry about defining if have a module name.
+ defined[name] = callback;
+ }
+ };
+
+ requirejs = require = req = function (deps, callback, relName, forceSync, alt) {
+ if (typeof deps === "string") {
+ if (handlers[deps]) {
+ //callback in this case is really relName
+ return handlers[deps](callback);
+ }
+ //Just return the module wanted. In this scenario, the
+ //deps arg is the module name, and second arg (if passed)
+ //is just the relName.
+ //Normalize module name, if it contains . or ..
+ return callDep(makeMap(deps, makeRelParts(callback)).f);
+ } else if (!deps.splice) {
+ //deps is a config object, not an array.
+ config = deps;
+ if (config.deps) {
+ req(config.deps, config.callback);
+ }
+ if (!callback) {
+ return;
+ }
+
+ if (callback.splice) {
+ //callback is an array, which means it is a dependency list.
+ //Adjust args if there are dependencies
+ deps = callback;
+ callback = relName;
+ relName = null;
+ } else {
+ deps = undef;
+ }
+ }
+
+ //Support require(['a'])
+ callback = callback || function () {};
+
+ //If relName is a function, it is an errback handler,
+ //so remove it.
+ if (typeof relName === 'function') {
+ relName = forceSync;
+ forceSync = alt;
+ }
+
+ //Simulate async callback;
+ if (forceSync) {
+ main(undef, deps, callback, relName);
+ } else {
+ //Using a non-zero value because of concern for what old browsers
+ //do, and latest browsers "upgrade" to 4 if lower value is used:
+ //http://www.whatwg.org/specs/web-apps/current-work/multipage/timers.html#dom-windowtimers-settimeout:
+ //If want a value immediately, use require('id') instead -- something
+ //that works in almond on the global level, but not guaranteed and
+ //unlikely to work in other AMD implementations.
+ setTimeout(function () {
+ main(undef, deps, callback, relName);
+ }, 4);
+ }
+
+ return req;
+ };
+
+ /**
+ * Just drops the config on the floor, but returns req in case
+ * the config return value is used.
+ */
+ req.config = function (cfg) {
+ return req(cfg);
+ };
+
+ /**
+ * Expose module registry for debugging and tooling
+ */
+ requirejs._defined = defined;
+
+ define = function (name, deps, callback) {
+ if (typeof name !== 'string') {
+ throw new Error('See almond README: incorrect module build, no module name');
+ }
+
+ //This module may not have dependencies
+ if (!deps.splice) {
+ //deps is not an array, so probably means
+ //an object literal or factory function for
+ //the value. Adjust args.
+ callback = deps;
+ deps = [];
+ }
+
+ if (!hasProp(defined, name) && !hasProp(waiting, name)) {
+ waiting[name] = [name, deps, callback];
+ }
+ };
+
+ define.amd = {
+ jQuery: true
+ };
+}());
+
+S2.requirejs = requirejs;S2.require = require;S2.define = define;
+}
+}());
+S2.define("almond", function(){});
+
+/* global jQuery:false, $:false */
+S2.define('jquery',[],function () {
+ var _$ = jQuery || $;
+
+ if (_$ == null && console && console.error) {
+ console.error(
+ 'Select2: An instance of jQuery or a jQuery-compatible library was not ' +
+ 'found. Make sure that you are including jQuery before Select2 on your ' +
+ 'web page.'
+ );
+ }
+
+ return _$;
+});
+
+S2.define('select2/utils',[
+ 'jquery'
+], function ($) {
+ var Utils = {};
+
+ Utils.Extend = function (ChildClass, SuperClass) {
+ var __hasProp = {}.hasOwnProperty;
+
+ function BaseConstructor () {
+ this.constructor = ChildClass;
+ }
+
+ for (var key in SuperClass) {
+ if (__hasProp.call(SuperClass, key)) {
+ ChildClass[key] = SuperClass[key];
+ }
+ }
+
+ BaseConstructor.prototype = SuperClass.prototype;
+ ChildClass.prototype = new BaseConstructor();
+ ChildClass.__super__ = SuperClass.prototype;
+
+ return ChildClass;
+ };
+
+ function getMethods (theClass) {
+ var proto = theClass.prototype;
+
+ var methods = [];
+
+ for (var methodName in proto) {
+ var m = proto[methodName];
+
+ if (typeof m !== 'function') {
+ continue;
+ }
+
+ if (methodName === 'constructor') {
+ continue;
+ }
+
+ methods.push(methodName);
+ }
+
+ return methods;
+ }
+
+ Utils.Decorate = function (SuperClass, DecoratorClass) {
+ var decoratedMethods = getMethods(DecoratorClass);
+ var superMethods = getMethods(SuperClass);
+
+ function DecoratedClass () {
+ var unshift = Array.prototype.unshift;
+
+ var argCount = DecoratorClass.prototype.constructor.length;
+
+ var calledConstructor = SuperClass.prototype.constructor;
+
+ if (argCount > 0) {
+ unshift.call(arguments, SuperClass.prototype.constructor);
+
+ calledConstructor = DecoratorClass.prototype.constructor;
+ }
+
+ calledConstructor.apply(this, arguments);
+ }
+
+ DecoratorClass.displayName = SuperClass.displayName;
+
+ function ctr () {
+ this.constructor = DecoratedClass;
+ }
+
+ DecoratedClass.prototype = new ctr();
+
+ for (var m = 0; m < superMethods.length; m++) {
+ var superMethod = superMethods[m];
+
+ DecoratedClass.prototype[superMethod] =
+ SuperClass.prototype[superMethod];
+ }
+
+ var calledMethod = function (methodName) {
+ // Stub out the original method if it's not decorating an actual method
+ var originalMethod = function () {};
+
+ if (methodName in DecoratedClass.prototype) {
+ originalMethod = DecoratedClass.prototype[methodName];
+ }
+
+ var decoratedMethod = DecoratorClass.prototype[methodName];
+
+ return function () {
+ var unshift = Array.prototype.unshift;
+
+ unshift.call(arguments, originalMethod);
+
+ return decoratedMethod.apply(this, arguments);
+ };
+ };
+
+ for (var d = 0; d < decoratedMethods.length; d++) {
+ var decoratedMethod = decoratedMethods[d];
+
+ DecoratedClass.prototype[decoratedMethod] = calledMethod(decoratedMethod);
+ }
+
+ return DecoratedClass;
+ };
+
+ var Observable = function () {
+ this.listeners = {};
+ };
+
+ Observable.prototype.on = function (event, callback) {
+ this.listeners = this.listeners || {};
+
+ if (event in this.listeners) {
+ this.listeners[event].push(callback);
+ } else {
+ this.listeners[event] = [callback];
+ }
+ };
+
+ Observable.prototype.trigger = function (event) {
+ var slice = Array.prototype.slice;
+ var params = slice.call(arguments, 1);
+
+ this.listeners = this.listeners || {};
+
+ // Params should always come in as an array
+ if (params == null) {
+ params = [];
+ }
+
+ // If there are no arguments to the event, use a temporary object
+ if (params.length === 0) {
+ params.push({});
+ }
+
+ // Set the `_type` of the first object to the event
+ params[0]._type = event;
+
+ if (event in this.listeners) {
+ this.invoke(this.listeners[event], slice.call(arguments, 1));
+ }
+
+ if ('*' in this.listeners) {
+ this.invoke(this.listeners['*'], arguments);
+ }
+ };
+
+ Observable.prototype.invoke = function (listeners, params) {
+ for (var i = 0, len = listeners.length; i < len; i++) {
+ listeners[i].apply(this, params);
+ }
+ };
+
+ Utils.Observable = Observable;
+
+ Utils.generateChars = function (length) {
+ var chars = '';
+
+ for (var i = 0; i < length; i++) {
+ var randomChar = Math.floor(Math.random() * 36);
+ chars += randomChar.toString(36);
+ }
+
+ return chars;
+ };
+
+ Utils.bind = function (func, context) {
+ return function () {
+ func.apply(context, arguments);
+ };
+ };
+
+ Utils._convertData = function (data) {
+ for (var originalKey in data) {
+ var keys = originalKey.split('-');
+
+ var dataLevel = data;
+
+ if (keys.length === 1) {
+ continue;
+ }
+
+ for (var k = 0; k < keys.length; k++) {
+ var key = keys[k];
+
+ // Lowercase the first letter
+ // By default, dash-separated becomes camelCase
+ key = key.substring(0, 1).toLowerCase() + key.substring(1);
+
+ if (!(key in dataLevel)) {
+ dataLevel[key] = {};
+ }
+
+ if (k == keys.length - 1) {
+ dataLevel[key] = data[originalKey];
+ }
+
+ dataLevel = dataLevel[key];
+ }
+
+ delete data[originalKey];
+ }
+
+ return data;
+ };
+
+ Utils.hasScroll = function (index, el) {
+ // Adapted from the function created by @ShadowScripter
+ // and adapted by @BillBarry on the Stack Exchange Code Review website.
+ // The original code can be found at
+ // http://codereview.stackexchange.com/q/13338
+ // and was designed to be used with the Sizzle selector engine.
+
+ var $el = $(el);
+ var overflowX = el.style.overflowX;
+ var overflowY = el.style.overflowY;
+
+ //Check both x and y declarations
+ if (overflowX === overflowY &&
+ (overflowY === 'hidden' || overflowY === 'visible')) {
+ return false;
+ }
+
+ if (overflowX === 'scroll' || overflowY === 'scroll') {
+ return true;
+ }
+
+ return ($el.innerHeight() < el.scrollHeight ||
+ $el.innerWidth() < el.scrollWidth);
+ };
+
+ Utils.escapeMarkup = function (markup) {
+ var replaceMap = {
+ '\\': '\',
+ '&': '&',
+ '<': '<',
+ '>': '>',
+ '"': '"',
+ '\'': ''',
+ '/': '/'
+ };
+
+ // Do not try to escape the markup if it's not a string
+ if (typeof markup !== 'string') {
+ return markup;
+ }
+
+ return String(markup).replace(/[&<>"'\/\\]/g, function (match) {
+ return replaceMap[match];
+ });
+ };
+
+ // Append an array of jQuery nodes to a given element.
+ Utils.appendMany = function ($element, $nodes) {
+ // jQuery 1.7.x does not support $.fn.append() with an array
+ // Fall back to a jQuery object collection using $.fn.add()
+ if ($.fn.jquery.substr(0, 3) === '1.7') {
+ var $jqNodes = $();
+
+ $.map($nodes, function (node) {
+ $jqNodes = $jqNodes.add(node);
+ });
+
+ $nodes = $jqNodes;
+ }
+
+ $element.append($nodes);
+ };
+
+ // Determine whether the browser is on a touchscreen device.
+ Utils.isTouchscreen = function() {
+ if ('undefined' === typeof Utils._isTouchscreenCache) {
+ Utils._isTouchscreenCache = 'ontouchstart' in document.documentElement;
+ }
+ return Utils._isTouchscreenCache;
+ }
+
+ return Utils;
+});
+
+S2.define('select2/results',[
+ 'jquery',
+ './utils'
+], function ($, Utils) {
+ function Results ($element, options, dataAdapter) {
+ this.$element = $element;
+ this.data = dataAdapter;
+ this.options = options;
+
+ Results.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(Results, Utils.Observable);
+
+ Results.prototype.render = function () {
+ var $results = $(
+ ''
+ );
+
+ if (this.options.get('multiple')) {
+ $results.attr('aria-multiselectable', 'true');
+ }
+
+ this.$results = $results;
+
+ return $results;
+ };
+
+ Results.prototype.clear = function () {
+ this.$results.empty();
+ };
+
+ Results.prototype.displayMessage = function (params) {
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ this.clear();
+ this.hideLoading();
+
+ var $message = $(
+ ' '
+ );
+
+ var message = this.options.get('translations').get(params.message);
+
+ $message.append(
+ escapeMarkup(
+ message(params.args)
+ )
+ );
+
+ $message[0].className += ' select2-results__message';
+
+ this.$results.append($message);
+ };
+
+ Results.prototype.hideMessages = function () {
+ this.$results.find('.select2-results__message').remove();
+ };
+
+ Results.prototype.append = function (data) {
+ this.hideLoading();
+
+ var $options = [];
+
+ if (data.results == null || data.results.length === 0) {
+ if (this.$results.children().length === 0) {
+ this.trigger('results:message', {
+ message: 'noResults'
+ });
+ }
+
+ return;
+ }
+
+ data.results = this.sort(data.results);
+
+ for (var d = 0; d < data.results.length; d++) {
+ var item = data.results[d];
+
+ var $option = this.option(item);
+
+ $options.push($option);
+ }
+
+ this.$results.append($options);
+ };
+
+ Results.prototype.position = function ($results, $dropdown) {
+ var $resultsContainer = $dropdown.find('.select2-results');
+ $resultsContainer.append($results);
+ };
+
+ Results.prototype.sort = function (data) {
+ var sorter = this.options.get('sorter');
+
+ return sorter(data);
+ };
+
+ Results.prototype.highlightFirstItem = function () {
+ var $options = this.$results
+ .find('.select2-results__option[data-selected]');
+
+ var $selected = $options.filter('[data-selected=true]');
+
+ // Check if there are any selected options
+ if ($selected.length > 0) {
+ // If there are selected options, highlight the first
+ $selected.first().trigger('mouseenter');
+ } else {
+ // If there are no selected options, highlight the first option
+ // in the dropdown
+ $options.first().trigger('mouseenter');
+ }
+
+ this.ensureHighlightVisible();
+ };
+
+ Results.prototype.setClasses = function () {
+ var self = this;
+
+ this.data.current(function (selected) {
+ var selectedIds = $.map(selected, function (s) {
+ return s.id.toString();
+ });
+
+ var $options = self.$results
+ .find('.select2-results__option[data-selected]');
+
+ $options.each(function () {
+ var $option = $(this);
+
+ var item = $.data(this, 'data');
+
+ // id needs to be converted to a string when comparing
+ var id = '' + item.id;
+
+ if ((item.element != null && item.element.selected) ||
+ (item.element == null && $.inArray(id, selectedIds) > -1)) {
+ $option.attr('data-selected', 'true');
+ } else {
+ $option.attr('data-selected', 'false');
+ }
+ });
+
+ });
+ };
+
+ Results.prototype.showLoading = function (params) {
+ this.hideLoading();
+
+ var loadingMore = this.options.get('translations').get('searching');
+
+ var loading = {
+ disabled: true,
+ loading: true,
+ text: loadingMore(params)
+ };
+ var $loading = this.option(loading);
+ $loading.className += ' loading-results';
+
+ this.$results.prepend($loading);
+ };
+
+ Results.prototype.hideLoading = function () {
+ this.$results.find('.loading-results').remove();
+ };
+
+ Results.prototype.option = function (data) {
+ var option = document.createElement('li');
+ option.className = 'select2-results__option';
+
+ var attrs = {
+ 'role': 'option',
+ 'data-selected': 'false',
+ 'tabindex': -1
+ };
+
+ if (data.disabled) {
+ delete attrs['data-selected'];
+ attrs['aria-disabled'] = 'true';
+ }
+
+ if (data.id == null) {
+ delete attrs['data-selected'];
+ }
+
+ if (data._resultId != null) {
+ option.id = data._resultId;
+ }
+
+ if (data.title) {
+ option.title = data.title;
+ }
+
+ if (data.children) {
+ attrs['aria-label'] = data.text;
+ delete attrs['data-selected'];
+ }
+
+ for (var attr in attrs) {
+ var val = attrs[attr];
+
+ option.setAttribute(attr, val);
+ }
+
+ if (data.children) {
+ var $option = $(option);
+
+ var label = document.createElement('strong');
+ label.className = 'select2-results__group';
+
+ var $label = $(label);
+ this.template(data, label);
+ $label.attr('role', 'presentation');
+
+ var $children = [];
+
+ for (var c = 0; c < data.children.length; c++) {
+ var child = data.children[c];
+
+ var $child = this.option(child);
+
+ $children.push($child);
+ }
+
+ var $childrenContainer = $('', {
+ 'class': 'select2-results__options select2-results__options--nested',
+ 'role': 'listbox'
+ });
+ $childrenContainer.append($children);
+ $option.attr('role', 'list');
+
+ $option.append(label);
+ $option.append($childrenContainer);
+ } else {
+ this.template(data, option);
+ }
+
+ $.data(option, 'data', data);
+
+ return option;
+ };
+
+ Results.prototype.bind = function (container, $container) {
+ var self = this;
+
+ var id = container.id + '-results';
+
+ this.$results.attr('id', id);
+
+ container.on('results:all', function (params) {
+ self.clear();
+ self.append(params.data);
+
+ if (container.isOpen()) {
+ self.setClasses();
+ self.highlightFirstItem();
+ }
+ });
+
+ container.on('results:append', function (params) {
+ self.append(params.data);
+
+ if (container.isOpen()) {
+ self.setClasses();
+ }
+ });
+
+ container.on('query', function (params) {
+ self.hideMessages();
+ self.showLoading(params);
+ });
+
+ container.on('select', function () {
+ if (!container.isOpen()) {
+ return;
+ }
+
+ self.setClasses();
+ self.highlightFirstItem();
+ });
+
+ container.on('unselect', function () {
+ if (!container.isOpen()) {
+ return;
+ }
+
+ self.setClasses();
+ self.highlightFirstItem();
+ });
+
+ container.on('open', function () {
+ // When the dropdown is open, aria-expended="true"
+ self.$results.attr('aria-expanded', 'true');
+ self.$results.attr('aria-hidden', 'false');
+
+ self.setClasses();
+ self.ensureHighlightVisible();
+ });
+
+ container.on('close', function () {
+ // When the dropdown is closed, aria-expended="false"
+ self.$results.attr('aria-expanded', 'false');
+ self.$results.attr('aria-hidden', 'true');
+ self.$results.removeAttr('aria-activedescendant');
+ });
+
+ container.on('results:toggle', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ if ($highlighted.length === 0) {
+ return;
+ }
+
+ $highlighted.trigger('mouseup');
+ });
+
+ container.on('results:select', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ if ($highlighted.length === 0) {
+ return;
+ }
+
+ var data = $highlighted.data('data');
+
+ if ($highlighted.attr('data-selected') == 'true') {
+ self.trigger('close', {});
+ } else {
+ self.trigger('select', {
+ data: data
+ });
+ }
+ });
+
+ container.on('results:previous', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ var $options = self.$results.find('[data-selected]');
+
+ var currentIndex = $options.index($highlighted);
+
+ // If we are already at te top, don't move further
+ if (currentIndex === 0) {
+ return;
+ }
+
+ var nextIndex = currentIndex - 1;
+
+ // If none are highlighted, highlight the first
+ if ($highlighted.length === 0) {
+ nextIndex = 0;
+ }
+
+ var $next = $options.eq(nextIndex);
+
+ $next.trigger('mouseenter');
+
+ var currentOffset = self.$results.offset().top;
+ var nextTop = $next.offset().top;
+ var nextOffset = self.$results.scrollTop() + (nextTop - currentOffset);
+
+ if (nextIndex === 0) {
+ self.$results.scrollTop(0);
+ } else if (nextTop - currentOffset < 0) {
+ self.$results.scrollTop(nextOffset);
+ }
+ });
+
+ container.on('results:next', function () {
+ var $highlighted = self.getHighlightedResults();
+
+ var $options = self.$results.find('[data-selected]');
+
+ var currentIndex = $options.index($highlighted);
+
+ var nextIndex = currentIndex + 1;
+
+ // If we are at the last option, stay there
+ if (nextIndex >= $options.length) {
+ return;
+ }
+
+ var $next = $options.eq(nextIndex);
+
+ $next.trigger('mouseenter');
+
+ var currentOffset = self.$results.offset().top +
+ self.$results.outerHeight(false);
+ var nextBottom = $next.offset().top + $next.outerHeight(false);
+ var nextOffset = self.$results.scrollTop() + nextBottom - currentOffset;
+
+ if (nextIndex === 0) {
+ self.$results.scrollTop(0);
+ } else if (nextBottom > currentOffset) {
+ self.$results.scrollTop(nextOffset);
+ }
+ });
+
+ container.on('results:focus', function (params) {
+ params.element.addClass('select2-results__option--highlighted').attr('aria-selected', 'true');
+ self.$results.attr('aria-activedescendant', params.element.attr('id'));
+ });
+
+ container.on('results:message', function (params) {
+ self.displayMessage(params);
+ });
+
+ if ($.fn.mousewheel) {
+ this.$results.on('mousewheel', function (e) {
+ var top = self.$results.scrollTop();
+
+ var bottom = self.$results.get(0).scrollHeight - top + e.deltaY;
+
+ var isAtTop = e.deltaY > 0 && top - e.deltaY <= 0;
+ var isAtBottom = e.deltaY < 0 && bottom <= self.$results.height();
+
+ if (isAtTop) {
+ self.$results.scrollTop(0);
+
+ e.preventDefault();
+ e.stopPropagation();
+ } else if (isAtBottom) {
+ self.$results.scrollTop(
+ self.$results.get(0).scrollHeight - self.$results.height()
+ );
+
+ e.preventDefault();
+ e.stopPropagation();
+ }
+ });
+ }
+
+ this.$results.on('mouseup', '.select2-results__option[data-selected]',
+ function (evt) {
+ var $this = $(this);
+
+ var data = $this.data('data');
+
+ if ($this.attr('data-selected') === 'true') {
+ if (self.options.get('multiple')) {
+ self.trigger('unselect', {
+ originalEvent: evt,
+ data: data
+ });
+ } else {
+ self.trigger('close', {});
+ }
+
+ return;
+ }
+
+ self.trigger('select', {
+ originalEvent: evt,
+ data: data
+ });
+ });
+
+ this.$results.on('mouseenter', '.select2-results__option[data-selected]',
+ function (evt) {
+ var data = $(this).data('data');
+
+ self.getHighlightedResults()
+ .removeClass('select2-results__option--highlighted')
+ .attr('aria-selected', 'false');
+
+ self.trigger('results:focus', {
+ data: data,
+ element: $(this)
+ });
+ });
+ };
+
+ Results.prototype.getHighlightedResults = function () {
+ var $highlighted = this.$results
+ .find('.select2-results__option--highlighted');
+
+ return $highlighted;
+ };
+
+ Results.prototype.destroy = function () {
+ this.$results.remove();
+ };
+
+ Results.prototype.ensureHighlightVisible = function () {
+ var $highlighted = this.getHighlightedResults();
+
+ if ($highlighted.length === 0) {
+ return;
+ }
+
+ var $options = this.$results.find('[data-selected]');
+
+ var currentIndex = $options.index($highlighted);
+
+ var currentOffset = this.$results.offset().top;
+ var nextTop = $highlighted.offset().top;
+ var nextOffset = this.$results.scrollTop() + (nextTop - currentOffset);
+
+ var offsetDelta = nextTop - currentOffset;
+ nextOffset -= $highlighted.outerHeight(false) * 2;
+
+ if (currentIndex <= 2) {
+ this.$results.scrollTop(0);
+ } else if (offsetDelta > this.$results.outerHeight() || offsetDelta < 0) {
+ this.$results.scrollTop(nextOffset);
+ }
+ };
+
+ Results.prototype.template = function (result, container) {
+ var template = this.options.get('templateResult');
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ var content = template(result, container);
+
+ if (content == null) {
+ container.style.display = 'none';
+ } else if (typeof content === 'string') {
+ container.innerHTML = escapeMarkup(content);
+ } else {
+ $(container).append(content);
+ }
+ };
+
+ return Results;
+});
+
+S2.define('select2/keys',[
+
+], function () {
+ var KEYS = {
+ BACKSPACE: 8,
+ TAB: 9,
+ ENTER: 13,
+ SHIFT: 16,
+ CTRL: 17,
+ ALT: 18,
+ ESC: 27,
+ SPACE: 32,
+ PAGE_UP: 33,
+ PAGE_DOWN: 34,
+ END: 35,
+ HOME: 36,
+ LEFT: 37,
+ UP: 38,
+ RIGHT: 39,
+ DOWN: 40,
+ DELETE: 46
+ };
+
+ return KEYS;
+});
+
+S2.define('select2/selection/base',[
+ 'jquery',
+ '../utils',
+ '../keys'
+], function ($, Utils, KEYS) {
+ function BaseSelection ($element, options) {
+ this.$element = $element;
+ this.options = options;
+
+ BaseSelection.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(BaseSelection, Utils.Observable);
+
+ BaseSelection.prototype.render = function () {
+ var $selection = $(
+ '' +
+ ' '
+ );
+
+ this._tabindex = 0;
+
+ if (this.$element.data('old-tabindex') != null) {
+ this._tabindex = this.$element.data('old-tabindex');
+ } else if (this.$element.attr('tabindex') != null) {
+ this._tabindex = this.$element.attr('tabindex');
+ }
+
+ $selection.attr('title', this.$element.attr('title'));
+ $selection.attr('tabindex', this._tabindex);
+
+ this.$selection = $selection;
+
+ return $selection;
+ };
+
+ BaseSelection.prototype.bind = function (container, $container) {
+ var self = this;
+
+ var id = container.id + '-container';
+ var resultsId = container.id + '-results';
+ var searchHidden = this.options.get('minimumResultsForSearch') === Infinity;
+
+ this.container = container;
+
+ this.$selection.on('focus', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this.$selection.on('blur', function (evt) {
+ self._handleBlur(evt);
+ });
+
+ this.$selection.on('keydown', function (evt) {
+ self.trigger('keypress', evt);
+
+ if (evt.which === KEYS.SPACE) {
+ evt.preventDefault();
+ }
+ });
+
+ container.on('results:focus', function (params) {
+ self.$selection.attr('aria-activedescendant', params.data._resultId);
+ });
+
+ container.on('selection:update', function (params) {
+ self.update(params.data);
+ });
+
+ container.on('open', function () {
+ // When the dropdown is open, aria-expanded="true"
+ self.$selection.attr('aria-expanded', 'true');
+ self.$selection.attr('aria-owns', resultsId);
+
+ self._attachCloseHandler(container);
+ });
+
+ container.on('close', function () {
+ // When the dropdown is closed, aria-expanded="false"
+ self.$selection.attr('aria-expanded', 'false');
+ self.$selection.removeAttr('aria-activedescendant');
+ self.$selection.removeAttr('aria-owns');
+
+ // This needs to be delayed as the active element is the body when the
+ // key is pressed.
+ window.setTimeout(function () {
+ self.$selection.focus();
+ }, 1);
+
+ self._detachCloseHandler(container);
+ });
+
+ container.on('enable', function () {
+ self.$selection.attr('tabindex', self._tabindex);
+ });
+
+ container.on('disable', function () {
+ self.$selection.attr('tabindex', '-1');
+ });
+ };
+
+ BaseSelection.prototype._handleBlur = function (evt) {
+ var self = this;
+
+ // This needs to be delayed as the active element is the body when the tab
+ // key is pressed, possibly along with others.
+ window.setTimeout(function () {
+ // Don't trigger `blur` if the focus is still in the selection
+ if (
+ (document.activeElement == self.$selection[0]) ||
+ ($.contains(self.$selection[0], document.activeElement))
+ ) {
+ return;
+ }
+
+ self.trigger('blur', evt);
+ }, 1);
+ };
+
+ BaseSelection.prototype._attachCloseHandler = function (container) {
+ var self = this;
+
+ $(document.body).on('mousedown.select2.' + container.id, function (e) {
+ var $target = $(e.target);
+
+ var $select = $target.closest('.select2');
+
+ var $all = $('.select2.select2-container--open');
+
+ $all.each(function () {
+ var $this = $(this);
+
+ if (this == $select[0]) {
+ return;
+ }
+
+ var $element = $this.data('element');
+
+ $element.select2('close');
+ });
+ });
+ };
+
+ BaseSelection.prototype._detachCloseHandler = function (container) {
+ $(document.body).off('mousedown.select2.' + container.id);
+ };
+
+ BaseSelection.prototype.position = function ($selection, $container) {
+ var $selectionContainer = $container.find('.selection');
+ $selectionContainer.append($selection);
+ };
+
+ BaseSelection.prototype.destroy = function () {
+ this._detachCloseHandler(this.container);
+ };
+
+ BaseSelection.prototype.update = function (data) {
+ throw new Error('The `update` method must be defined in child classes.');
+ };
+
+ return BaseSelection;
+});
+
+S2.define('select2/selection/single',[
+ 'jquery',
+ './base',
+ '../utils',
+ '../keys'
+], function ($, BaseSelection, Utils, KEYS) {
+ function SingleSelection () {
+ SingleSelection.__super__.constructor.apply(this, arguments);
+ }
+
+ Utils.Extend(SingleSelection, BaseSelection);
+
+ SingleSelection.prototype.render = function () {
+ var $selection = SingleSelection.__super__.render.call(this);
+
+ $selection.addClass('select2-selection--single');
+
+ $selection.html(
+ ' ' +
+ '' +
+ ' ' +
+ ' '
+ );
+
+ return $selection;
+ };
+
+ SingleSelection.prototype.bind = function (container, $container) {
+ var self = this;
+
+ SingleSelection.__super__.bind.apply(this, arguments);
+
+ var id = container.id + '-container';
+
+ this.$selection.find('.select2-selection__rendered')
+ .attr('id', id)
+ .attr('role', 'textbox')
+ .attr('aria-readonly', 'true');
+ this.$selection.attr('aria-labelledby', id);
+
+ // This makes single non-search selects work in screen readers. If it causes problems elsewhere, remove.
+ this.$selection.attr('role', 'combobox');
+
+ this.$selection.on('mousedown', function (evt) {
+ // Only respond to left clicks
+ if (evt.which !== 1) {
+ return;
+ }
+
+ self.trigger('toggle', {
+ originalEvent: evt
+ });
+ });
+
+ this.$selection.on('focus', function (evt) {
+ // User focuses on the container
+ });
+
+ this.$selection.on('keydown', function (evt) {
+ // If user starts typing an alphanumeric key on the keyboard, open if not opened.
+ if (!container.isOpen() && evt.which >= 48 && evt.which <= 90) {
+ container.open();
+ }
+ });
+
+ this.$selection.on('blur', function (evt) {
+ // User exits the container
+ });
+
+ container.on('focus', function (evt) {
+ if (!container.isOpen()) {
+ self.$selection.focus();
+ }
+ });
+
+ container.on('selection:update', function (params) {
+ self.update(params.data);
+ });
+ };
+
+ SingleSelection.prototype.clear = function () {
+ this.$selection.find('.select2-selection__rendered').empty();
+ };
+
+ SingleSelection.prototype.display = function (data, container) {
+ var template = this.options.get('templateSelection');
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ return escapeMarkup(template(data, container));
+ };
+
+ SingleSelection.prototype.selectionContainer = function () {
+ return $(' ');
+ };
+
+ SingleSelection.prototype.update = function (data) {
+ if (data.length === 0) {
+ this.clear();
+ return;
+ }
+
+ var selection = data[0];
+
+ var $rendered = this.$selection.find('.select2-selection__rendered');
+ var formatted = this.display(selection, $rendered);
+
+ $rendered.empty().append(formatted);
+ $rendered.prop('title', selection.title || selection.text);
+ };
+
+ return SingleSelection;
+});
+
+S2.define('select2/selection/multiple',[
+ 'jquery',
+ './base',
+ '../utils'
+], function ($, BaseSelection, Utils) {
+ function MultipleSelection ($element, options) {
+ MultipleSelection.__super__.constructor.apply(this, arguments);
+ }
+
+ Utils.Extend(MultipleSelection, BaseSelection);
+
+ MultipleSelection.prototype.render = function () {
+ var $selection = MultipleSelection.__super__.render.call(this);
+
+ $selection.addClass('select2-selection--multiple');
+
+ $selection.html(
+ ''
+ );
+
+ return $selection;
+ };
+
+ MultipleSelection.prototype.bind = function (container, $container) {
+ var self = this;
+
+ MultipleSelection.__super__.bind.apply(this, arguments);
+
+ this.$selection.on('click', function (evt) {
+ self.trigger('toggle', {
+ originalEvent: evt
+ });
+ });
+
+ this.$selection.on(
+ 'click',
+ '.select2-selection__choice__remove',
+ function (evt) {
+ // Ignore the event if it is disabled
+ if (self.options.get('disabled')) {
+ return;
+ }
+
+ var $remove = $(this);
+ var $selection = $remove.parent();
+
+ var data = $selection.data('data');
+
+ self.trigger('unselect', {
+ originalEvent: evt,
+ data: data
+ });
+ }
+ );
+ };
+
+ MultipleSelection.prototype.clear = function () {
+ this.$selection.find('.select2-selection__rendered').empty();
+ };
+
+ MultipleSelection.prototype.display = function (data, container) {
+ var template = this.options.get('templateSelection');
+ var escapeMarkup = this.options.get('escapeMarkup');
+
+ return escapeMarkup(template(data, container));
+ };
+
+ MultipleSelection.prototype.selectionContainer = function () {
+ var $container = $(
+ '' +
+ '' +
+ '×' +
+ ' ' +
+ ' '
+ );
+
+ return $container;
+ };
+
+ MultipleSelection.prototype.update = function (data) {
+ var self = this;
+ this.clear();
+
+ if (data.length === 0) {
+ return;
+ }
+
+ var $selections = [];
+
+ for (var d = 0; d < data.length; d++) {
+ var selection = data[d];
+
+ var $selection = this.selectionContainer();
+ var formatted = this.display(selection, $selection).trim();
+
+ $selection.append(formatted);
+ $selection.prop('title', selection.title || selection.text);
+
+ $selection.data('data', selection);
+
+ $selections.push($selection);
+ }
+
+ var $rendered = this.$selection.find('.select2-selection__rendered');
+
+ Utils.appendMany($rendered, $selections);
+
+ // Return cursor to search field after updating.
+ // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
+ if ('undefined' !== typeof this.$search) {
+ setTimeout(function(){
+ self.$search.focus();
+ }, 1);
+ }
+ };
+
+ return MultipleSelection;
+});
+
+S2.define('select2/selection/placeholder',[
+ '../utils'
+], function (Utils) {
+ function Placeholder (decorated, $element, options) {
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
+
+ decorated.call(this, $element, options);
+ }
+
+ Placeholder.prototype.normalizePlaceholder = function (_, placeholder) {
+ if (typeof placeholder === 'string') {
+ placeholder = {
+ id: '',
+ text: placeholder
+ };
+ }
+
+ return placeholder;
+ };
+
+ Placeholder.prototype.createPlaceholder = function (decorated, placeholder) {
+ var $placeholder = this.selectionContainer();
+
+ $placeholder.html(this.display(placeholder));
+ $placeholder.addClass('select2-selection__placeholder')
+ .removeClass('select2-selection__choice');
+
+ return $placeholder;
+ };
+
+ Placeholder.prototype.update = function (decorated, data) {
+ var singlePlaceholder = (
+ data.length == 1 && data[0].id != this.placeholder.id
+ );
+ var multipleSelections = data.length > 1;
+
+ if (multipleSelections || singlePlaceholder) {
+ return decorated.call(this, data);
+ }
+
+ this.clear();
+
+ var $placeholder = this.createPlaceholder(this.placeholder);
+
+ this.$selection.find('.select2-selection__rendered').append($placeholder);
+ };
+
+ return Placeholder;
+});
+
+S2.define('select2/selection/allowClear',[
+ 'jquery',
+ '../keys'
+], function ($, KEYS) {
+ function AllowClear () { }
+
+ AllowClear.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ if (this.placeholder == null) {
+ if (this.options.get('debug') && window.console && console.error) {
+ console.error(
+ 'Select2: The `allowClear` option should be used in combination ' +
+ 'with the `placeholder` option.'
+ );
+ }
+ }
+
+ this.$selection.on('mousedown', '.select2-selection__clear',
+ function (evt) {
+ self._handleClear(evt);
+ });
+
+ container.on('keypress', function (evt) {
+ self._handleKeyboardClear(evt, container);
+ });
+ };
+
+ AllowClear.prototype._handleClear = function (_, evt) {
+ // Ignore the event if it is disabled
+ if (this.options.get('disabled')) {
+ return;
+ }
+
+ var $clear = this.$selection.find('.select2-selection__clear');
+
+ // Ignore the event if nothing has been selected
+ if ($clear.length === 0) {
+ return;
+ }
+
+ evt.stopPropagation();
+
+ var data = $clear.data('data');
+
+ for (var d = 0; d < data.length; d++) {
+ var unselectData = {
+ data: data[d]
+ };
+
+ // Trigger the `unselect` event, so people can prevent it from being
+ // cleared.
+ this.trigger('unselect', unselectData);
+
+ // If the event was prevented, don't clear it out.
+ if (unselectData.prevented) {
+ return;
+ }
+ }
+
+ this.$element.val(this.placeholder.id).trigger('change');
+
+ this.trigger('toggle', {});
+ };
+
+ AllowClear.prototype._handleKeyboardClear = function (_, evt, container) {
+ if (container.isOpen()) {
+ return;
+ }
+
+ if (evt.which == KEYS.DELETE || evt.which == KEYS.BACKSPACE) {
+ this._handleClear(evt);
+ }
+ };
+
+ AllowClear.prototype.update = function (decorated, data) {
+ decorated.call(this, data);
+
+ if (this.$selection.find('.select2-selection__placeholder').length > 0 ||
+ data.length === 0) {
+ return;
+ }
+
+ var $remove = $(
+ '' +
+ '×' +
+ ' '
+ );
+ $remove.data('data', data);
+
+ this.$selection.find('.select2-selection__rendered').prepend($remove);
+ };
+
+ return AllowClear;
+});
+
+S2.define('select2/selection/search',[
+ 'jquery',
+ '../utils',
+ '../keys'
+], function ($, Utils, KEYS) {
+ function Search (decorated, $element, options) {
+ decorated.call(this, $element, options);
+ }
+
+ Search.prototype.render = function (decorated) {
+ var $search = $(
+ '' +
+ ' ' +
+ ' '
+ );
+
+ this.$searchContainer = $search;
+ this.$search = $search.find('input');
+
+ var $rendered = decorated.call(this);
+
+ this._transferTabIndex();
+
+ return $rendered;
+ };
+
+ Search.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+ var resultsId = container.id + '-results';
+
+ decorated.call(this, container, $container);
+
+ container.on('open', function () {
+ self.$search.attr('aria-owns', resultsId);
+ self.$search.trigger('focus');
+ });
+
+ container.on('close', function () {
+ self.$search.val('');
+ self.$search.removeAttr('aria-activedescendant');
+ self.$search.removeAttr('aria-owns');
+ self.$search.trigger('focus');
+ });
+
+ container.on('enable', function () {
+ self.$search.prop('disabled', false);
+
+ self._transferTabIndex();
+ });
+
+ container.on('disable', function () {
+ self.$search.prop('disabled', true);
+ });
+
+ container.on('focus', function (evt) {
+ self.$search.trigger('focus');
+ });
+
+ container.on('results:focus', function (params) {
+ self.$search.attr('aria-activedescendant', params.data._resultId);
+ });
+
+ this.$selection.on('focusin', '.select2-search--inline', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this.$selection.on('focusout', '.select2-search--inline', function (evt) {
+ self._handleBlur(evt);
+ });
+
+ this.$selection.on('keydown', '.select2-search--inline', function (evt) {
+ evt.stopPropagation();
+
+ self.trigger('keypress', evt);
+
+ self._keyUpPrevented = evt.isDefaultPrevented();
+
+ var key = evt.which;
+
+ if (key === KEYS.BACKSPACE && self.$search.val() === '') {
+ var $previousChoice = self.$searchContainer
+ .prev('.select2-selection__choice');
+
+ if ($previousChoice.length > 0) {
+ var item = $previousChoice.data('data');
+
+ self.searchRemoveChoice(item);
+
+ evt.preventDefault();
+ }
+ }
+ });
+
+ // Try to detect the IE version should the `documentMode` property that
+ // is stored on the document. This is only implemented in IE and is
+ // slightly cleaner than doing a user agent check.
+ // This property is not available in Edge, but Edge also doesn't have
+ // this bug.
+ var msie = document.documentMode;
+ var disableInputEvents = msie && msie <= 11;
+
+ // Workaround for browsers which do not support the `input` event
+ // This will prevent double-triggering of events for browsers which support
+ // both the `keyup` and `input` events.
+ this.$selection.on(
+ 'input.searchcheck',
+ '.select2-search--inline',
+ function (evt) {
+ // IE will trigger the `input` event when a placeholder is used on a
+ // search box. To get around this issue, we are forced to ignore all
+ // `input` events in IE and keep using `keyup`.
+ if (disableInputEvents) {
+ self.$selection.off('input.search input.searchcheck');
+ return;
+ }
+
+ // Unbind the duplicated `keyup` event
+ self.$selection.off('keyup.search');
+ }
+ );
+
+ this.$selection.on(
+ 'keyup.search input.search',
+ '.select2-search--inline',
+ function (evt) {
+ // IE will trigger the `input` event when a placeholder is used on a
+ // search box. To get around this issue, we are forced to ignore all
+ // `input` events in IE and keep using `keyup`.
+ if (disableInputEvents && evt.type === 'input') {
+ self.$selection.off('input.search input.searchcheck');
+ return;
+ }
+
+ var key = evt.which;
+
+ // We can freely ignore events from modifier keys
+ if (key == KEYS.SHIFT || key == KEYS.CTRL || key == KEYS.ALT) {
+ return;
+ }
+
+ // Tabbing will be handled during the `keydown` phase
+ if (key == KEYS.TAB) {
+ return;
+ }
+
+ self.handleSearch(evt);
+ }
+ );
+ };
+
+ /**
+ * This method will transfer the tabindex attribute from the rendered
+ * selection to the search box. This allows for the search box to be used as
+ * the primary focus instead of the selection container.
+ *
+ * @private
+ */
+ Search.prototype._transferTabIndex = function (decorated) {
+ this.$search.attr('tabindex', this.$selection.attr('tabindex'));
+ this.$selection.attr('tabindex', '-1');
+ };
+
+ Search.prototype.createPlaceholder = function (decorated, placeholder) {
+ this.$search.attr('placeholder', placeholder.text);
+ };
+
+ Search.prototype.update = function (decorated, data) {
+ var searchHadFocus = this.$search[0] == document.activeElement;
+
+ this.$search.attr('placeholder', '');
+
+ decorated.call(this, data);
+
+ this.$selection.find('.select2-selection__rendered')
+ .append(this.$searchContainer);
+
+ this.resizeSearch();
+ if (searchHadFocus) {
+ this.$search.focus();
+ }
+ };
+
+ Search.prototype.handleSearch = function () {
+ this.resizeSearch();
+
+ if (!this._keyUpPrevented) {
+ var input = this.$search.val();
+
+ this.trigger('query', {
+ term: input
+ });
+ }
+
+ this._keyUpPrevented = false;
+ };
+
+ Search.prototype.searchRemoveChoice = function (decorated, item) {
+ this.trigger('unselect', {
+ data: item
+ });
+
+ this.$search.val(item.text);
+ this.handleSearch();
+ };
+
+ Search.prototype.resizeSearch = function () {
+ this.$search.css('width', '25px');
+
+ var width = '';
+
+ if (this.$search.attr('placeholder') !== '') {
+ width = this.$selection.find('.select2-selection__rendered').innerWidth();
+ } else {
+ var minimumWidth = this.$search.val().length + 1;
+
+ width = (minimumWidth * 0.75) + 'em';
+ }
+
+ this.$search.css('width', width);
+ };
+
+ return Search;
+});
+
+S2.define('select2/selection/eventRelay',[
+ 'jquery'
+], function ($) {
+ function EventRelay () { }
+
+ EventRelay.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+ var relayEvents = [
+ 'open', 'opening',
+ 'close', 'closing',
+ 'select', 'selecting',
+ 'unselect', 'unselecting'
+ ];
+
+ var preventableEvents = ['opening', 'closing', 'selecting', 'unselecting'];
+
+ decorated.call(this, container, $container);
+
+ container.on('*', function (name, params) {
+ // Ignore events that should not be relayed
+ if ($.inArray(name, relayEvents) === -1) {
+ return;
+ }
+
+ // The parameters should always be an object
+ params = params || {};
+
+ // Generate the jQuery event for the Select2 event
+ var evt = $.Event('select2:' + name, {
+ params: params
+ });
+
+ self.$element.trigger(evt);
+
+ // Only handle preventable events if it was one
+ if ($.inArray(name, preventableEvents) === -1) {
+ return;
+ }
+
+ params.prevented = evt.isDefaultPrevented();
+ });
+ };
+
+ return EventRelay;
+});
+
+S2.define('select2/translation',[
+ 'jquery',
+ 'require'
+], function ($, require) {
+ function Translation (dict) {
+ this.dict = dict || {};
+ }
+
+ Translation.prototype.all = function () {
+ return this.dict;
+ };
+
+ Translation.prototype.get = function (key) {
+ return this.dict[key];
+ };
+
+ Translation.prototype.extend = function (translation) {
+ this.dict = $.extend({}, translation.all(), this.dict);
+ };
+
+ // Static functions
+
+ Translation._cache = {};
+
+ Translation.loadPath = function (path) {
+ if (!(path in Translation._cache)) {
+ var translations = require(path);
+
+ Translation._cache[path] = translations;
+ }
+
+ return new Translation(Translation._cache[path]);
+ };
+
+ return Translation;
+});
+
+S2.define('select2/diacritics',[
+
+], function () {
+ var diacritics = {
+ '\u24B6': 'A',
+ '\uFF21': 'A',
+ '\u00C0': 'A',
+ '\u00C1': 'A',
+ '\u00C2': 'A',
+ '\u1EA6': 'A',
+ '\u1EA4': 'A',
+ '\u1EAA': 'A',
+ '\u1EA8': 'A',
+ '\u00C3': 'A',
+ '\u0100': 'A',
+ '\u0102': 'A',
+ '\u1EB0': 'A',
+ '\u1EAE': 'A',
+ '\u1EB4': 'A',
+ '\u1EB2': 'A',
+ '\u0226': 'A',
+ '\u01E0': 'A',
+ '\u00C4': 'A',
+ '\u01DE': 'A',
+ '\u1EA2': 'A',
+ '\u00C5': 'A',
+ '\u01FA': 'A',
+ '\u01CD': 'A',
+ '\u0200': 'A',
+ '\u0202': 'A',
+ '\u1EA0': 'A',
+ '\u1EAC': 'A',
+ '\u1EB6': 'A',
+ '\u1E00': 'A',
+ '\u0104': 'A',
+ '\u023A': 'A',
+ '\u2C6F': 'A',
+ '\uA732': 'AA',
+ '\u00C6': 'AE',
+ '\u01FC': 'AE',
+ '\u01E2': 'AE',
+ '\uA734': 'AO',
+ '\uA736': 'AU',
+ '\uA738': 'AV',
+ '\uA73A': 'AV',
+ '\uA73C': 'AY',
+ '\u24B7': 'B',
+ '\uFF22': 'B',
+ '\u1E02': 'B',
+ '\u1E04': 'B',
+ '\u1E06': 'B',
+ '\u0243': 'B',
+ '\u0182': 'B',
+ '\u0181': 'B',
+ '\u24B8': 'C',
+ '\uFF23': 'C',
+ '\u0106': 'C',
+ '\u0108': 'C',
+ '\u010A': 'C',
+ '\u010C': 'C',
+ '\u00C7': 'C',
+ '\u1E08': 'C',
+ '\u0187': 'C',
+ '\u023B': 'C',
+ '\uA73E': 'C',
+ '\u24B9': 'D',
+ '\uFF24': 'D',
+ '\u1E0A': 'D',
+ '\u010E': 'D',
+ '\u1E0C': 'D',
+ '\u1E10': 'D',
+ '\u1E12': 'D',
+ '\u1E0E': 'D',
+ '\u0110': 'D',
+ '\u018B': 'D',
+ '\u018A': 'D',
+ '\u0189': 'D',
+ '\uA779': 'D',
+ '\u01F1': 'DZ',
+ '\u01C4': 'DZ',
+ '\u01F2': 'Dz',
+ '\u01C5': 'Dz',
+ '\u24BA': 'E',
+ '\uFF25': 'E',
+ '\u00C8': 'E',
+ '\u00C9': 'E',
+ '\u00CA': 'E',
+ '\u1EC0': 'E',
+ '\u1EBE': 'E',
+ '\u1EC4': 'E',
+ '\u1EC2': 'E',
+ '\u1EBC': 'E',
+ '\u0112': 'E',
+ '\u1E14': 'E',
+ '\u1E16': 'E',
+ '\u0114': 'E',
+ '\u0116': 'E',
+ '\u00CB': 'E',
+ '\u1EBA': 'E',
+ '\u011A': 'E',
+ '\u0204': 'E',
+ '\u0206': 'E',
+ '\u1EB8': 'E',
+ '\u1EC6': 'E',
+ '\u0228': 'E',
+ '\u1E1C': 'E',
+ '\u0118': 'E',
+ '\u1E18': 'E',
+ '\u1E1A': 'E',
+ '\u0190': 'E',
+ '\u018E': 'E',
+ '\u24BB': 'F',
+ '\uFF26': 'F',
+ '\u1E1E': 'F',
+ '\u0191': 'F',
+ '\uA77B': 'F',
+ '\u24BC': 'G',
+ '\uFF27': 'G',
+ '\u01F4': 'G',
+ '\u011C': 'G',
+ '\u1E20': 'G',
+ '\u011E': 'G',
+ '\u0120': 'G',
+ '\u01E6': 'G',
+ '\u0122': 'G',
+ '\u01E4': 'G',
+ '\u0193': 'G',
+ '\uA7A0': 'G',
+ '\uA77D': 'G',
+ '\uA77E': 'G',
+ '\u24BD': 'H',
+ '\uFF28': 'H',
+ '\u0124': 'H',
+ '\u1E22': 'H',
+ '\u1E26': 'H',
+ '\u021E': 'H',
+ '\u1E24': 'H',
+ '\u1E28': 'H',
+ '\u1E2A': 'H',
+ '\u0126': 'H',
+ '\u2C67': 'H',
+ '\u2C75': 'H',
+ '\uA78D': 'H',
+ '\u24BE': 'I',
+ '\uFF29': 'I',
+ '\u00CC': 'I',
+ '\u00CD': 'I',
+ '\u00CE': 'I',
+ '\u0128': 'I',
+ '\u012A': 'I',
+ '\u012C': 'I',
+ '\u0130': 'I',
+ '\u00CF': 'I',
+ '\u1E2E': 'I',
+ '\u1EC8': 'I',
+ '\u01CF': 'I',
+ '\u0208': 'I',
+ '\u020A': 'I',
+ '\u1ECA': 'I',
+ '\u012E': 'I',
+ '\u1E2C': 'I',
+ '\u0197': 'I',
+ '\u24BF': 'J',
+ '\uFF2A': 'J',
+ '\u0134': 'J',
+ '\u0248': 'J',
+ '\u24C0': 'K',
+ '\uFF2B': 'K',
+ '\u1E30': 'K',
+ '\u01E8': 'K',
+ '\u1E32': 'K',
+ '\u0136': 'K',
+ '\u1E34': 'K',
+ '\u0198': 'K',
+ '\u2C69': 'K',
+ '\uA740': 'K',
+ '\uA742': 'K',
+ '\uA744': 'K',
+ '\uA7A2': 'K',
+ '\u24C1': 'L',
+ '\uFF2C': 'L',
+ '\u013F': 'L',
+ '\u0139': 'L',
+ '\u013D': 'L',
+ '\u1E36': 'L',
+ '\u1E38': 'L',
+ '\u013B': 'L',
+ '\u1E3C': 'L',
+ '\u1E3A': 'L',
+ '\u0141': 'L',
+ '\u023D': 'L',
+ '\u2C62': 'L',
+ '\u2C60': 'L',
+ '\uA748': 'L',
+ '\uA746': 'L',
+ '\uA780': 'L',
+ '\u01C7': 'LJ',
+ '\u01C8': 'Lj',
+ '\u24C2': 'M',
+ '\uFF2D': 'M',
+ '\u1E3E': 'M',
+ '\u1E40': 'M',
+ '\u1E42': 'M',
+ '\u2C6E': 'M',
+ '\u019C': 'M',
+ '\u24C3': 'N',
+ '\uFF2E': 'N',
+ '\u01F8': 'N',
+ '\u0143': 'N',
+ '\u00D1': 'N',
+ '\u1E44': 'N',
+ '\u0147': 'N',
+ '\u1E46': 'N',
+ '\u0145': 'N',
+ '\u1E4A': 'N',
+ '\u1E48': 'N',
+ '\u0220': 'N',
+ '\u019D': 'N',
+ '\uA790': 'N',
+ '\uA7A4': 'N',
+ '\u01CA': 'NJ',
+ '\u01CB': 'Nj',
+ '\u24C4': 'O',
+ '\uFF2F': 'O',
+ '\u00D2': 'O',
+ '\u00D3': 'O',
+ '\u00D4': 'O',
+ '\u1ED2': 'O',
+ '\u1ED0': 'O',
+ '\u1ED6': 'O',
+ '\u1ED4': 'O',
+ '\u00D5': 'O',
+ '\u1E4C': 'O',
+ '\u022C': 'O',
+ '\u1E4E': 'O',
+ '\u014C': 'O',
+ '\u1E50': 'O',
+ '\u1E52': 'O',
+ '\u014E': 'O',
+ '\u022E': 'O',
+ '\u0230': 'O',
+ '\u00D6': 'O',
+ '\u022A': 'O',
+ '\u1ECE': 'O',
+ '\u0150': 'O',
+ '\u01D1': 'O',
+ '\u020C': 'O',
+ '\u020E': 'O',
+ '\u01A0': 'O',
+ '\u1EDC': 'O',
+ '\u1EDA': 'O',
+ '\u1EE0': 'O',
+ '\u1EDE': 'O',
+ '\u1EE2': 'O',
+ '\u1ECC': 'O',
+ '\u1ED8': 'O',
+ '\u01EA': 'O',
+ '\u01EC': 'O',
+ '\u00D8': 'O',
+ '\u01FE': 'O',
+ '\u0186': 'O',
+ '\u019F': 'O',
+ '\uA74A': 'O',
+ '\uA74C': 'O',
+ '\u01A2': 'OI',
+ '\uA74E': 'OO',
+ '\u0222': 'OU',
+ '\u24C5': 'P',
+ '\uFF30': 'P',
+ '\u1E54': 'P',
+ '\u1E56': 'P',
+ '\u01A4': 'P',
+ '\u2C63': 'P',
+ '\uA750': 'P',
+ '\uA752': 'P',
+ '\uA754': 'P',
+ '\u24C6': 'Q',
+ '\uFF31': 'Q',
+ '\uA756': 'Q',
+ '\uA758': 'Q',
+ '\u024A': 'Q',
+ '\u24C7': 'R',
+ '\uFF32': 'R',
+ '\u0154': 'R',
+ '\u1E58': 'R',
+ '\u0158': 'R',
+ '\u0210': 'R',
+ '\u0212': 'R',
+ '\u1E5A': 'R',
+ '\u1E5C': 'R',
+ '\u0156': 'R',
+ '\u1E5E': 'R',
+ '\u024C': 'R',
+ '\u2C64': 'R',
+ '\uA75A': 'R',
+ '\uA7A6': 'R',
+ '\uA782': 'R',
+ '\u24C8': 'S',
+ '\uFF33': 'S',
+ '\u1E9E': 'S',
+ '\u015A': 'S',
+ '\u1E64': 'S',
+ '\u015C': 'S',
+ '\u1E60': 'S',
+ '\u0160': 'S',
+ '\u1E66': 'S',
+ '\u1E62': 'S',
+ '\u1E68': 'S',
+ '\u0218': 'S',
+ '\u015E': 'S',
+ '\u2C7E': 'S',
+ '\uA7A8': 'S',
+ '\uA784': 'S',
+ '\u24C9': 'T',
+ '\uFF34': 'T',
+ '\u1E6A': 'T',
+ '\u0164': 'T',
+ '\u1E6C': 'T',
+ '\u021A': 'T',
+ '\u0162': 'T',
+ '\u1E70': 'T',
+ '\u1E6E': 'T',
+ '\u0166': 'T',
+ '\u01AC': 'T',
+ '\u01AE': 'T',
+ '\u023E': 'T',
+ '\uA786': 'T',
+ '\uA728': 'TZ',
+ '\u24CA': 'U',
+ '\uFF35': 'U',
+ '\u00D9': 'U',
+ '\u00DA': 'U',
+ '\u00DB': 'U',
+ '\u0168': 'U',
+ '\u1E78': 'U',
+ '\u016A': 'U',
+ '\u1E7A': 'U',
+ '\u016C': 'U',
+ '\u00DC': 'U',
+ '\u01DB': 'U',
+ '\u01D7': 'U',
+ '\u01D5': 'U',
+ '\u01D9': 'U',
+ '\u1EE6': 'U',
+ '\u016E': 'U',
+ '\u0170': 'U',
+ '\u01D3': 'U',
+ '\u0214': 'U',
+ '\u0216': 'U',
+ '\u01AF': 'U',
+ '\u1EEA': 'U',
+ '\u1EE8': 'U',
+ '\u1EEE': 'U',
+ '\u1EEC': 'U',
+ '\u1EF0': 'U',
+ '\u1EE4': 'U',
+ '\u1E72': 'U',
+ '\u0172': 'U',
+ '\u1E76': 'U',
+ '\u1E74': 'U',
+ '\u0244': 'U',
+ '\u24CB': 'V',
+ '\uFF36': 'V',
+ '\u1E7C': 'V',
+ '\u1E7E': 'V',
+ '\u01B2': 'V',
+ '\uA75E': 'V',
+ '\u0245': 'V',
+ '\uA760': 'VY',
+ '\u24CC': 'W',
+ '\uFF37': 'W',
+ '\u1E80': 'W',
+ '\u1E82': 'W',
+ '\u0174': 'W',
+ '\u1E86': 'W',
+ '\u1E84': 'W',
+ '\u1E88': 'W',
+ '\u2C72': 'W',
+ '\u24CD': 'X',
+ '\uFF38': 'X',
+ '\u1E8A': 'X',
+ '\u1E8C': 'X',
+ '\u24CE': 'Y',
+ '\uFF39': 'Y',
+ '\u1EF2': 'Y',
+ '\u00DD': 'Y',
+ '\u0176': 'Y',
+ '\u1EF8': 'Y',
+ '\u0232': 'Y',
+ '\u1E8E': 'Y',
+ '\u0178': 'Y',
+ '\u1EF6': 'Y',
+ '\u1EF4': 'Y',
+ '\u01B3': 'Y',
+ '\u024E': 'Y',
+ '\u1EFE': 'Y',
+ '\u24CF': 'Z',
+ '\uFF3A': 'Z',
+ '\u0179': 'Z',
+ '\u1E90': 'Z',
+ '\u017B': 'Z',
+ '\u017D': 'Z',
+ '\u1E92': 'Z',
+ '\u1E94': 'Z',
+ '\u01B5': 'Z',
+ '\u0224': 'Z',
+ '\u2C7F': 'Z',
+ '\u2C6B': 'Z',
+ '\uA762': 'Z',
+ '\u24D0': 'a',
+ '\uFF41': 'a',
+ '\u1E9A': 'a',
+ '\u00E0': 'a',
+ '\u00E1': 'a',
+ '\u00E2': 'a',
+ '\u1EA7': 'a',
+ '\u1EA5': 'a',
+ '\u1EAB': 'a',
+ '\u1EA9': 'a',
+ '\u00E3': 'a',
+ '\u0101': 'a',
+ '\u0103': 'a',
+ '\u1EB1': 'a',
+ '\u1EAF': 'a',
+ '\u1EB5': 'a',
+ '\u1EB3': 'a',
+ '\u0227': 'a',
+ '\u01E1': 'a',
+ '\u00E4': 'a',
+ '\u01DF': 'a',
+ '\u1EA3': 'a',
+ '\u00E5': 'a',
+ '\u01FB': 'a',
+ '\u01CE': 'a',
+ '\u0201': 'a',
+ '\u0203': 'a',
+ '\u1EA1': 'a',
+ '\u1EAD': 'a',
+ '\u1EB7': 'a',
+ '\u1E01': 'a',
+ '\u0105': 'a',
+ '\u2C65': 'a',
+ '\u0250': 'a',
+ '\uA733': 'aa',
+ '\u00E6': 'ae',
+ '\u01FD': 'ae',
+ '\u01E3': 'ae',
+ '\uA735': 'ao',
+ '\uA737': 'au',
+ '\uA739': 'av',
+ '\uA73B': 'av',
+ '\uA73D': 'ay',
+ '\u24D1': 'b',
+ '\uFF42': 'b',
+ '\u1E03': 'b',
+ '\u1E05': 'b',
+ '\u1E07': 'b',
+ '\u0180': 'b',
+ '\u0183': 'b',
+ '\u0253': 'b',
+ '\u24D2': 'c',
+ '\uFF43': 'c',
+ '\u0107': 'c',
+ '\u0109': 'c',
+ '\u010B': 'c',
+ '\u010D': 'c',
+ '\u00E7': 'c',
+ '\u1E09': 'c',
+ '\u0188': 'c',
+ '\u023C': 'c',
+ '\uA73F': 'c',
+ '\u2184': 'c',
+ '\u24D3': 'd',
+ '\uFF44': 'd',
+ '\u1E0B': 'd',
+ '\u010F': 'd',
+ '\u1E0D': 'd',
+ '\u1E11': 'd',
+ '\u1E13': 'd',
+ '\u1E0F': 'd',
+ '\u0111': 'd',
+ '\u018C': 'd',
+ '\u0256': 'd',
+ '\u0257': 'd',
+ '\uA77A': 'd',
+ '\u01F3': 'dz',
+ '\u01C6': 'dz',
+ '\u24D4': 'e',
+ '\uFF45': 'e',
+ '\u00E8': 'e',
+ '\u00E9': 'e',
+ '\u00EA': 'e',
+ '\u1EC1': 'e',
+ '\u1EBF': 'e',
+ '\u1EC5': 'e',
+ '\u1EC3': 'e',
+ '\u1EBD': 'e',
+ '\u0113': 'e',
+ '\u1E15': 'e',
+ '\u1E17': 'e',
+ '\u0115': 'e',
+ '\u0117': 'e',
+ '\u00EB': 'e',
+ '\u1EBB': 'e',
+ '\u011B': 'e',
+ '\u0205': 'e',
+ '\u0207': 'e',
+ '\u1EB9': 'e',
+ '\u1EC7': 'e',
+ '\u0229': 'e',
+ '\u1E1D': 'e',
+ '\u0119': 'e',
+ '\u1E19': 'e',
+ '\u1E1B': 'e',
+ '\u0247': 'e',
+ '\u025B': 'e',
+ '\u01DD': 'e',
+ '\u24D5': 'f',
+ '\uFF46': 'f',
+ '\u1E1F': 'f',
+ '\u0192': 'f',
+ '\uA77C': 'f',
+ '\u24D6': 'g',
+ '\uFF47': 'g',
+ '\u01F5': 'g',
+ '\u011D': 'g',
+ '\u1E21': 'g',
+ '\u011F': 'g',
+ '\u0121': 'g',
+ '\u01E7': 'g',
+ '\u0123': 'g',
+ '\u01E5': 'g',
+ '\u0260': 'g',
+ '\uA7A1': 'g',
+ '\u1D79': 'g',
+ '\uA77F': 'g',
+ '\u24D7': 'h',
+ '\uFF48': 'h',
+ '\u0125': 'h',
+ '\u1E23': 'h',
+ '\u1E27': 'h',
+ '\u021F': 'h',
+ '\u1E25': 'h',
+ '\u1E29': 'h',
+ '\u1E2B': 'h',
+ '\u1E96': 'h',
+ '\u0127': 'h',
+ '\u2C68': 'h',
+ '\u2C76': 'h',
+ '\u0265': 'h',
+ '\u0195': 'hv',
+ '\u24D8': 'i',
+ '\uFF49': 'i',
+ '\u00EC': 'i',
+ '\u00ED': 'i',
+ '\u00EE': 'i',
+ '\u0129': 'i',
+ '\u012B': 'i',
+ '\u012D': 'i',
+ '\u00EF': 'i',
+ '\u1E2F': 'i',
+ '\u1EC9': 'i',
+ '\u01D0': 'i',
+ '\u0209': 'i',
+ '\u020B': 'i',
+ '\u1ECB': 'i',
+ '\u012F': 'i',
+ '\u1E2D': 'i',
+ '\u0268': 'i',
+ '\u0131': 'i',
+ '\u24D9': 'j',
+ '\uFF4A': 'j',
+ '\u0135': 'j',
+ '\u01F0': 'j',
+ '\u0249': 'j',
+ '\u24DA': 'k',
+ '\uFF4B': 'k',
+ '\u1E31': 'k',
+ '\u01E9': 'k',
+ '\u1E33': 'k',
+ '\u0137': 'k',
+ '\u1E35': 'k',
+ '\u0199': 'k',
+ '\u2C6A': 'k',
+ '\uA741': 'k',
+ '\uA743': 'k',
+ '\uA745': 'k',
+ '\uA7A3': 'k',
+ '\u24DB': 'l',
+ '\uFF4C': 'l',
+ '\u0140': 'l',
+ '\u013A': 'l',
+ '\u013E': 'l',
+ '\u1E37': 'l',
+ '\u1E39': 'l',
+ '\u013C': 'l',
+ '\u1E3D': 'l',
+ '\u1E3B': 'l',
+ '\u017F': 'l',
+ '\u0142': 'l',
+ '\u019A': 'l',
+ '\u026B': 'l',
+ '\u2C61': 'l',
+ '\uA749': 'l',
+ '\uA781': 'l',
+ '\uA747': 'l',
+ '\u01C9': 'lj',
+ '\u24DC': 'm',
+ '\uFF4D': 'm',
+ '\u1E3F': 'm',
+ '\u1E41': 'm',
+ '\u1E43': 'm',
+ '\u0271': 'm',
+ '\u026F': 'm',
+ '\u24DD': 'n',
+ '\uFF4E': 'n',
+ '\u01F9': 'n',
+ '\u0144': 'n',
+ '\u00F1': 'n',
+ '\u1E45': 'n',
+ '\u0148': 'n',
+ '\u1E47': 'n',
+ '\u0146': 'n',
+ '\u1E4B': 'n',
+ '\u1E49': 'n',
+ '\u019E': 'n',
+ '\u0272': 'n',
+ '\u0149': 'n',
+ '\uA791': 'n',
+ '\uA7A5': 'n',
+ '\u01CC': 'nj',
+ '\u24DE': 'o',
+ '\uFF4F': 'o',
+ '\u00F2': 'o',
+ '\u00F3': 'o',
+ '\u00F4': 'o',
+ '\u1ED3': 'o',
+ '\u1ED1': 'o',
+ '\u1ED7': 'o',
+ '\u1ED5': 'o',
+ '\u00F5': 'o',
+ '\u1E4D': 'o',
+ '\u022D': 'o',
+ '\u1E4F': 'o',
+ '\u014D': 'o',
+ '\u1E51': 'o',
+ '\u1E53': 'o',
+ '\u014F': 'o',
+ '\u022F': 'o',
+ '\u0231': 'o',
+ '\u00F6': 'o',
+ '\u022B': 'o',
+ '\u1ECF': 'o',
+ '\u0151': 'o',
+ '\u01D2': 'o',
+ '\u020D': 'o',
+ '\u020F': 'o',
+ '\u01A1': 'o',
+ '\u1EDD': 'o',
+ '\u1EDB': 'o',
+ '\u1EE1': 'o',
+ '\u1EDF': 'o',
+ '\u1EE3': 'o',
+ '\u1ECD': 'o',
+ '\u1ED9': 'o',
+ '\u01EB': 'o',
+ '\u01ED': 'o',
+ '\u00F8': 'o',
+ '\u01FF': 'o',
+ '\u0254': 'o',
+ '\uA74B': 'o',
+ '\uA74D': 'o',
+ '\u0275': 'o',
+ '\u01A3': 'oi',
+ '\u0223': 'ou',
+ '\uA74F': 'oo',
+ '\u24DF': 'p',
+ '\uFF50': 'p',
+ '\u1E55': 'p',
+ '\u1E57': 'p',
+ '\u01A5': 'p',
+ '\u1D7D': 'p',
+ '\uA751': 'p',
+ '\uA753': 'p',
+ '\uA755': 'p',
+ '\u24E0': 'q',
+ '\uFF51': 'q',
+ '\u024B': 'q',
+ '\uA757': 'q',
+ '\uA759': 'q',
+ '\u24E1': 'r',
+ '\uFF52': 'r',
+ '\u0155': 'r',
+ '\u1E59': 'r',
+ '\u0159': 'r',
+ '\u0211': 'r',
+ '\u0213': 'r',
+ '\u1E5B': 'r',
+ '\u1E5D': 'r',
+ '\u0157': 'r',
+ '\u1E5F': 'r',
+ '\u024D': 'r',
+ '\u027D': 'r',
+ '\uA75B': 'r',
+ '\uA7A7': 'r',
+ '\uA783': 'r',
+ '\u24E2': 's',
+ '\uFF53': 's',
+ '\u00DF': 's',
+ '\u015B': 's',
+ '\u1E65': 's',
+ '\u015D': 's',
+ '\u1E61': 's',
+ '\u0161': 's',
+ '\u1E67': 's',
+ '\u1E63': 's',
+ '\u1E69': 's',
+ '\u0219': 's',
+ '\u015F': 's',
+ '\u023F': 's',
+ '\uA7A9': 's',
+ '\uA785': 's',
+ '\u1E9B': 's',
+ '\u24E3': 't',
+ '\uFF54': 't',
+ '\u1E6B': 't',
+ '\u1E97': 't',
+ '\u0165': 't',
+ '\u1E6D': 't',
+ '\u021B': 't',
+ '\u0163': 't',
+ '\u1E71': 't',
+ '\u1E6F': 't',
+ '\u0167': 't',
+ '\u01AD': 't',
+ '\u0288': 't',
+ '\u2C66': 't',
+ '\uA787': 't',
+ '\uA729': 'tz',
+ '\u24E4': 'u',
+ '\uFF55': 'u',
+ '\u00F9': 'u',
+ '\u00FA': 'u',
+ '\u00FB': 'u',
+ '\u0169': 'u',
+ '\u1E79': 'u',
+ '\u016B': 'u',
+ '\u1E7B': 'u',
+ '\u016D': 'u',
+ '\u00FC': 'u',
+ '\u01DC': 'u',
+ '\u01D8': 'u',
+ '\u01D6': 'u',
+ '\u01DA': 'u',
+ '\u1EE7': 'u',
+ '\u016F': 'u',
+ '\u0171': 'u',
+ '\u01D4': 'u',
+ '\u0215': 'u',
+ '\u0217': 'u',
+ '\u01B0': 'u',
+ '\u1EEB': 'u',
+ '\u1EE9': 'u',
+ '\u1EEF': 'u',
+ '\u1EED': 'u',
+ '\u1EF1': 'u',
+ '\u1EE5': 'u',
+ '\u1E73': 'u',
+ '\u0173': 'u',
+ '\u1E77': 'u',
+ '\u1E75': 'u',
+ '\u0289': 'u',
+ '\u24E5': 'v',
+ '\uFF56': 'v',
+ '\u1E7D': 'v',
+ '\u1E7F': 'v',
+ '\u028B': 'v',
+ '\uA75F': 'v',
+ '\u028C': 'v',
+ '\uA761': 'vy',
+ '\u24E6': 'w',
+ '\uFF57': 'w',
+ '\u1E81': 'w',
+ '\u1E83': 'w',
+ '\u0175': 'w',
+ '\u1E87': 'w',
+ '\u1E85': 'w',
+ '\u1E98': 'w',
+ '\u1E89': 'w',
+ '\u2C73': 'w',
+ '\u24E7': 'x',
+ '\uFF58': 'x',
+ '\u1E8B': 'x',
+ '\u1E8D': 'x',
+ '\u24E8': 'y',
+ '\uFF59': 'y',
+ '\u1EF3': 'y',
+ '\u00FD': 'y',
+ '\u0177': 'y',
+ '\u1EF9': 'y',
+ '\u0233': 'y',
+ '\u1E8F': 'y',
+ '\u00FF': 'y',
+ '\u1EF7': 'y',
+ '\u1E99': 'y',
+ '\u1EF5': 'y',
+ '\u01B4': 'y',
+ '\u024F': 'y',
+ '\u1EFF': 'y',
+ '\u24E9': 'z',
+ '\uFF5A': 'z',
+ '\u017A': 'z',
+ '\u1E91': 'z',
+ '\u017C': 'z',
+ '\u017E': 'z',
+ '\u1E93': 'z',
+ '\u1E95': 'z',
+ '\u01B6': 'z',
+ '\u0225': 'z',
+ '\u0240': 'z',
+ '\u2C6C': 'z',
+ '\uA763': 'z',
+ '\u0386': '\u0391',
+ '\u0388': '\u0395',
+ '\u0389': '\u0397',
+ '\u038A': '\u0399',
+ '\u03AA': '\u0399',
+ '\u038C': '\u039F',
+ '\u038E': '\u03A5',
+ '\u03AB': '\u03A5',
+ '\u038F': '\u03A9',
+ '\u03AC': '\u03B1',
+ '\u03AD': '\u03B5',
+ '\u03AE': '\u03B7',
+ '\u03AF': '\u03B9',
+ '\u03CA': '\u03B9',
+ '\u0390': '\u03B9',
+ '\u03CC': '\u03BF',
+ '\u03CD': '\u03C5',
+ '\u03CB': '\u03C5',
+ '\u03B0': '\u03C5',
+ '\u03C9': '\u03C9',
+ '\u03C2': '\u03C3'
+ };
+
+ return diacritics;
+});
+
+S2.define('select2/data/base',[
+ '../utils'
+], function (Utils) {
+ function BaseAdapter ($element, options) {
+ BaseAdapter.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(BaseAdapter, Utils.Observable);
+
+ BaseAdapter.prototype.current = function (callback) {
+ throw new Error('The `current` method must be defined in child classes.');
+ };
+
+ BaseAdapter.prototype.query = function (params, callback) {
+ throw new Error('The `query` method must be defined in child classes.');
+ };
+
+ BaseAdapter.prototype.bind = function (container, $container) {
+ // Can be implemented in subclasses
+ };
+
+ BaseAdapter.prototype.destroy = function () {
+ // Can be implemented in subclasses
+ };
+
+ BaseAdapter.prototype.generateResultId = function (container, data) {
+ var id = '';
+
+ if (container != null) {
+ id += container.id
+ } else {
+ id += Utils.generateChars(4);
+ }
+
+ id += '-result-';
+ id += Utils.generateChars(4);
+
+ if (data.id != null) {
+ id += '-' + data.id.toString();
+ } else {
+ id += '-' + Utils.generateChars(4);
+ }
+ return id;
+ };
+
+ return BaseAdapter;
+});
+
+S2.define('select2/data/select',[
+ './base',
+ '../utils',
+ 'jquery'
+], function (BaseAdapter, Utils, $) {
+ function SelectAdapter ($element, options) {
+ this.$element = $element;
+ this.options = options;
+
+ SelectAdapter.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(SelectAdapter, BaseAdapter);
+
+ SelectAdapter.prototype.current = function (callback) {
+ var data = [];
+ var self = this;
+
+ this.$element.find(':selected').each(function () {
+ var $option = $(this);
+
+ var option = self.item($option);
+
+ data.push(option);
+ });
+
+ callback(data);
+ };
+
+ SelectAdapter.prototype.select = function (data) {
+ var self = this;
+
+ data.selected = true;
+
+ // If data.element is a DOM node, use it instead
+ if ($(data.element).is('option')) {
+ data.element.selected = true;
+
+ this.$element.trigger('change');
+
+ return;
+ }
+
+ if (this.$element.prop('multiple')) {
+ this.current(function (currentData) {
+ var val = [];
+
+ data = [data];
+ data.push.apply(data, currentData);
+
+ for (var d = 0; d < data.length; d++) {
+ var id = data[d].id;
+
+ if ($.inArray(id, val) === -1) {
+ val.push(id);
+ }
+ }
+
+ self.$element.val(val);
+ self.$element.trigger('change');
+ });
+ } else {
+ var val = data.id;
+
+ this.$element.val(val);
+ this.$element.trigger('change');
+ }
+ };
+
+ SelectAdapter.prototype.unselect = function (data) {
+ var self = this;
+
+ if (!this.$element.prop('multiple')) {
+ return;
+ }
+
+ data.selected = false;
+
+ if ($(data.element).is('option')) {
+ data.element.selected = false;
+
+ this.$element.trigger('change');
+
+ return;
+ }
+
+ this.current(function (currentData) {
+ var val = [];
+
+ for (var d = 0; d < currentData.length; d++) {
+ var id = currentData[d].id;
+
+ if (id !== data.id && $.inArray(id, val) === -1) {
+ val.push(id);
+ }
+ }
+
+ self.$element.val(val);
+
+ self.$element.trigger('change');
+ });
+ };
+
+ SelectAdapter.prototype.bind = function (container, $container) {
+ var self = this;
+
+ this.container = container;
+
+ container.on('select', function (params) {
+ self.select(params.data);
+ });
+
+ container.on('unselect', function (params) {
+ self.unselect(params.data);
+ });
+ };
+
+ SelectAdapter.prototype.destroy = function () {
+ // Remove anything added to child elements
+ this.$element.find('*').each(function () {
+ // Remove any custom data set by Select2
+ $.removeData(this, 'data');
+ });
+ };
+
+ SelectAdapter.prototype.query = function (params, callback) {
+ var data = [];
+ var self = this;
+
+ var $options = this.$element.children();
+
+ $options.each(function () {
+ var $option = $(this);
+
+ if (!$option.is('option') && !$option.is('optgroup')) {
+ return;
+ }
+
+ var option = self.item($option);
+
+ var matches = self.matches(params, option);
+
+ if (matches !== null) {
+ data.push(matches);
+ }
+ });
+
+ callback({
+ results: data
+ });
+ };
+
+ SelectAdapter.prototype.addOptions = function ($options) {
+ Utils.appendMany(this.$element, $options);
+ };
+
+ SelectAdapter.prototype.option = function (data) {
+ var option;
+
+ if (data.children) {
+ option = document.createElement('optgroup');
+ option.label = data.text;
+ } else {
+ option = document.createElement('option');
+
+ if (option.textContent !== undefined) {
+ option.textContent = data.text;
+ } else {
+ option.innerText = data.text;
+ }
+ }
+
+ if (data.id !== undefined) {
+ option.value = data.id;
+ }
+
+ if (data.disabled) {
+ option.disabled = true;
+ }
+
+ if (data.selected) {
+ option.selected = true;
+ }
+
+ if (data.title) {
+ option.title = data.title;
+ }
+
+ var $option = $(option);
+
+ var normalizedData = this._normalizeItem(data);
+ normalizedData.element = option;
+
+ // Override the option's data with the combined data
+ $.data(option, 'data', normalizedData);
+
+ return $option;
+ };
+
+ SelectAdapter.prototype.item = function ($option) {
+ var data = {};
+
+ data = $.data($option[0], 'data');
+
+ if (data != null) {
+ return data;
+ }
+
+ if ($option.is('option')) {
+ data = {
+ id: $option.val(),
+ text: $option.text(),
+ disabled: $option.prop('disabled'),
+ selected: $option.prop('selected'),
+ title: $option.prop('title')
+ };
+ } else if ($option.is('optgroup')) {
+ data = {
+ text: $option.prop('label'),
+ children: [],
+ title: $option.prop('title')
+ };
+
+ var $children = $option.children('option');
+ var children = [];
+
+ for (var c = 0; c < $children.length; c++) {
+ var $child = $($children[c]);
+
+ var child = this.item($child);
+
+ children.push(child);
+ }
+
+ data.children = children;
+ }
+
+ data = this._normalizeItem(data);
+ data.element = $option[0];
+
+ $.data($option[0], 'data', data);
+
+ return data;
+ };
+
+ SelectAdapter.prototype._normalizeItem = function (item) {
+ if (!$.isPlainObject(item)) {
+ item = {
+ id: item,
+ text: item
+ };
+ }
+
+ item = $.extend({}, {
+ text: ''
+ }, item);
+
+ var defaults = {
+ selected: false,
+ disabled: false
+ };
+
+ if (item.id != null) {
+ item.id = item.id.toString();
+ }
+
+ if (item.text != null) {
+ item.text = item.text.toString();
+ }
+
+ if (item._resultId == null && item.id) {
+ item._resultId = this.generateResultId(this.container, item);
+ }
+
+ return $.extend({}, defaults, item);
+ };
+
+ SelectAdapter.prototype.matches = function (params, data) {
+ var matcher = this.options.get('matcher');
+
+ return matcher(params, data);
+ };
+
+ return SelectAdapter;
+});
+
+S2.define('select2/data/array',[
+ './select',
+ '../utils',
+ 'jquery'
+], function (SelectAdapter, Utils, $) {
+ function ArrayAdapter ($element, options) {
+ var data = options.get('data') || [];
+
+ ArrayAdapter.__super__.constructor.call(this, $element, options);
+
+ this.addOptions(this.convertToOptions(data));
+ }
+
+ Utils.Extend(ArrayAdapter, SelectAdapter);
+
+ ArrayAdapter.prototype.select = function (data) {
+ var $option = this.$element.find('option').filter(function (i, elm) {
+ return elm.value == data.id.toString();
+ });
+
+ if ($option.length === 0) {
+ $option = this.option(data);
+
+ this.addOptions($option);
+ }
+
+ ArrayAdapter.__super__.select.call(this, data);
+ };
+
+ ArrayAdapter.prototype.convertToOptions = function (data) {
+ var self = this;
+
+ var $existing = this.$element.find('option');
+ var existingIds = $existing.map(function () {
+ return self.item($(this)).id;
+ }).get();
+
+ var $options = [];
+
+ // Filter out all items except for the one passed in the argument
+ function onlyItem (item) {
+ return function () {
+ return $(this).val() == item.id;
+ };
+ }
+
+ for (var d = 0; d < data.length; d++) {
+ var item = this._normalizeItem(data[d]);
+
+ // Skip items which were pre-loaded, only merge the data
+ if ($.inArray(item.id, existingIds) >= 0) {
+ var $existingOption = $existing.filter(onlyItem(item));
+
+ var existingData = this.item($existingOption);
+ var newData = $.extend(true, {}, item, existingData);
+
+ var $newOption = this.option(newData);
+
+ $existingOption.replaceWith($newOption);
+
+ continue;
+ }
+
+ var $option = this.option(item);
+
+ if (item.children) {
+ var $children = this.convertToOptions(item.children);
+
+ Utils.appendMany($option, $children);
+ }
+
+ $options.push($option);
+ }
+
+ return $options;
+ };
+
+ return ArrayAdapter;
+});
+
+S2.define('select2/data/ajax',[
+ './array',
+ '../utils',
+ 'jquery'
+], function (ArrayAdapter, Utils, $) {
+ function AjaxAdapter ($element, options) {
+ this.ajaxOptions = this._applyDefaults(options.get('ajax'));
+
+ if (this.ajaxOptions.processResults != null) {
+ this.processResults = this.ajaxOptions.processResults;
+ }
+
+ AjaxAdapter.__super__.constructor.call(this, $element, options);
+ }
+
+ Utils.Extend(AjaxAdapter, ArrayAdapter);
+
+ AjaxAdapter.prototype._applyDefaults = function (options) {
+ var defaults = {
+ data: function (params) {
+ return $.extend({}, params, {
+ q: params.term
+ });
+ },
+ transport: function (params, success, failure) {
+ var $request = $.ajax(params);
+
+ $request.then(success);
+ $request.fail(failure);
+
+ return $request;
+ }
+ };
+
+ return $.extend({}, defaults, options, true);
+ };
+
+ AjaxAdapter.prototype.processResults = function (results) {
+ return results;
+ };
+
+ AjaxAdapter.prototype.query = function (params, callback) {
+ var matches = [];
+ var self = this;
+
+ if (this._request != null) {
+ // JSONP requests cannot always be aborted
+ if ($.isFunction(this._request.abort)) {
+ this._request.abort();
+ }
+
+ this._request = null;
+ }
+
+ var options = $.extend({
+ type: 'GET'
+ }, this.ajaxOptions);
+
+ if (typeof options.url === 'function') {
+ options.url = options.url.call(this.$element, params);
+ }
+
+ if (typeof options.data === 'function') {
+ options.data = options.data.call(this.$element, params);
+ }
+
+ function request () {
+ var $request = options.transport(options, function (data) {
+ var results = self.processResults(data, params);
+
+ if (self.options.get('debug') && window.console && console.error) {
+ // Check to make sure that the response included a `results` key.
+ if (!results || !results.results || !$.isArray(results.results)) {
+ console.error(
+ 'Select2: The AJAX results did not return an array in the ' +
+ '`results` key of the response.'
+ );
+ }
+ }
+
+ callback(results);
+ self.container.focusOnActiveElement();
+ }, function () {
+ // Attempt to detect if a request was aborted
+ // Only works if the transport exposes a status property
+ if ($request.status && $request.status === '0') {
+ return;
+ }
+
+ self.trigger('results:message', {
+ message: 'errorLoading'
+ });
+ });
+
+ self._request = $request;
+ }
+
+ if (this.ajaxOptions.delay && params.term != null) {
+ if (this._queryTimeout) {
+ window.clearTimeout(this._queryTimeout);
+ }
+
+ this._queryTimeout = window.setTimeout(request, this.ajaxOptions.delay);
+ } else {
+ request();
+ }
+ };
+
+ return AjaxAdapter;
+});
+
+S2.define('select2/data/tags',[
+ 'jquery'
+], function ($) {
+ function Tags (decorated, $element, options) {
+ var tags = options.get('tags');
+
+ var createTag = options.get('createTag');
+
+ if (createTag !== undefined) {
+ this.createTag = createTag;
+ }
+
+ var insertTag = options.get('insertTag');
+
+ if (insertTag !== undefined) {
+ this.insertTag = insertTag;
+ }
+
+ decorated.call(this, $element, options);
+
+ if ($.isArray(tags)) {
+ for (var t = 0; t < tags.length; t++) {
+ var tag = tags[t];
+ var item = this._normalizeItem(tag);
+
+ var $option = this.option(item);
+
+ this.$element.append($option);
+ }
+ }
+ }
+
+ Tags.prototype.query = function (decorated, params, callback) {
+ var self = this;
+
+ this._removeOldTags();
+
+ if (params.term == null || params.page != null) {
+ decorated.call(this, params, callback);
+ return;
+ }
+
+ function wrapper (obj, child) {
+ var data = obj.results;
+
+ for (var i = 0; i < data.length; i++) {
+ var option = data[i];
+
+ var checkChildren = (
+ option.children != null &&
+ !wrapper({
+ results: option.children
+ }, true)
+ );
+
+ var optionText = (option.text || '').toUpperCase();
+ var paramsTerm = (params.term || '').toUpperCase();
+
+ var checkText = optionText === paramsTerm;
+
+ if (checkText || checkChildren) {
+ if (child) {
+ return false;
+ }
+
+ obj.data = data;
+ callback(obj);
+
+ return;
+ }
+ }
+
+ if (child) {
+ return true;
+ }
+
+ var tag = self.createTag(params);
+
+ if (tag != null) {
+ var $option = self.option(tag);
+ $option.attr('data-select2-tag', true);
+
+ self.addOptions([$option]);
+
+ self.insertTag(data, tag);
+ }
+
+ obj.results = data;
+
+ callback(obj);
+ }
+
+ decorated.call(this, params, wrapper);
+ };
+
+ Tags.prototype.createTag = function (decorated, params) {
+ var term = $.trim(params.term);
+
+ if (term === '') {
+ return null;
+ }
+
+ return {
+ id: term,
+ text: term
+ };
+ };
+
+ Tags.prototype.insertTag = function (_, data, tag) {
+ data.unshift(tag);
+ };
+
+ Tags.prototype._removeOldTags = function (_) {
+ var tag = this._lastTag;
+
+ var $options = this.$element.find('option[data-select2-tag]');
+
+ $options.each(function () {
+ if (this.selected) {
+ return;
+ }
+
+ $(this).remove();
+ });
+ };
+
+ return Tags;
+});
+
+S2.define('select2/data/tokenizer',[
+ 'jquery'
+], function ($) {
+ function Tokenizer (decorated, $element, options) {
+ var tokenizer = options.get('tokenizer');
+
+ if (tokenizer !== undefined) {
+ this.tokenizer = tokenizer;
+ }
+
+ decorated.call(this, $element, options);
+ }
+
+ Tokenizer.prototype.bind = function (decorated, container, $container) {
+ decorated.call(this, container, $container);
+
+ this.$search = container.dropdown.$search || container.selection.$search ||
+ $container.find('.select2-search__field');
+ };
+
+ Tokenizer.prototype.query = function (decorated, params, callback) {
+ var self = this;
+
+ function createAndSelect (data) {
+ // Normalize the data object so we can use it for checks
+ var item = self._normalizeItem(data);
+
+ // Check if the data object already exists as a tag
+ // Select it if it doesn't
+ var $existingOptions = self.$element.find('option').filter(function () {
+ return $(this).val() === item.id;
+ });
+
+ // If an existing option wasn't found for it, create the option
+ if (!$existingOptions.length) {
+ var $option = self.option(item);
+ $option.attr('data-select2-tag', true);
+
+ self._removeOldTags();
+ self.addOptions([$option]);
+ }
+
+ // Select the item, now that we know there is an option for it
+ select(item);
+ }
+
+ function select (data) {
+ self.trigger('select', {
+ data: data
+ });
+ }
+
+ params.term = params.term || '';
+
+ var tokenData = this.tokenizer(params, this.options, createAndSelect);
+
+ if (tokenData.term !== params.term) {
+ // Replace the search term if we have the search box
+ if (this.$search.length) {
+ this.$search.val(tokenData.term);
+ this.$search.focus();
+ }
+
+ params.term = tokenData.term;
+ }
+
+ decorated.call(this, params, callback);
+ };
+
+ Tokenizer.prototype.tokenizer = function (_, params, options, callback) {
+ var separators = options.get('tokenSeparators') || [];
+ var term = params.term;
+ var i = 0;
+
+ var createTag = this.createTag || function (params) {
+ return {
+ id: params.term,
+ text: params.term
+ };
+ };
+
+ while (i < term.length) {
+ var termChar = term[i];
+
+ if ($.inArray(termChar, separators) === -1) {
+ i++;
+
+ continue;
+ }
+
+ var part = term.substr(0, i);
+ var partParams = $.extend({}, params, {
+ term: part
+ });
+
+ var data = createTag(partParams);
+
+ if (data == null) {
+ i++;
+ continue;
+ }
+
+ callback(data);
+
+ // Reset the term to not include the tokenized portion
+ term = term.substr(i + 1) || '';
+ i = 0;
+ }
+
+ return {
+ term: term
+ };
+ };
+
+ return Tokenizer;
+});
+
+S2.define('select2/data/minimumInputLength',[
+
+], function () {
+ function MinimumInputLength (decorated, $e, options) {
+ this.minimumInputLength = options.get('minimumInputLength');
+
+ decorated.call(this, $e, options);
+ }
+
+ MinimumInputLength.prototype.query = function (decorated, params, callback) {
+ params.term = params.term || '';
+
+ if (params.term.length < this.minimumInputLength) {
+ this.trigger('results:message', {
+ message: 'inputTooShort',
+ args: {
+ minimum: this.minimumInputLength,
+ input: params.term,
+ params: params
+ }
+ });
+
+ return;
+ }
+
+ decorated.call(this, params, callback);
+ };
+
+ return MinimumInputLength;
+});
+
+S2.define('select2/data/maximumInputLength',[
+
+], function () {
+ function MaximumInputLength (decorated, $e, options) {
+ this.maximumInputLength = options.get('maximumInputLength');
+
+ decorated.call(this, $e, options);
+ }
+
+ MaximumInputLength.prototype.query = function (decorated, params, callback) {
+ params.term = params.term || '';
+
+ if (this.maximumInputLength > 0 &&
+ params.term.length > this.maximumInputLength) {
+ this.trigger('results:message', {
+ message: 'inputTooLong',
+ args: {
+ maximum: this.maximumInputLength,
+ input: params.term,
+ params: params
+ }
+ });
+
+ return;
+ }
+
+ decorated.call(this, params, callback);
+ };
+
+ return MaximumInputLength;
+});
+
+S2.define('select2/data/maximumSelectionLength',[
+
+], function (){
+ function MaximumSelectionLength (decorated, $e, options) {
+ this.maximumSelectionLength = options.get('maximumSelectionLength');
+
+ decorated.call(this, $e, options);
+ }
+
+ MaximumSelectionLength.prototype.query =
+ function (decorated, params, callback) {
+ var self = this;
+
+ this.current(function (currentData) {
+ var count = currentData != null ? currentData.length : 0;
+ if (self.maximumSelectionLength > 0 &&
+ count >= self.maximumSelectionLength) {
+ self.trigger('results:message', {
+ message: 'maximumSelected',
+ args: {
+ maximum: self.maximumSelectionLength
+ }
+ });
+ return;
+ }
+ decorated.call(self, params, callback);
+ });
+ };
+
+ return MaximumSelectionLength;
+});
+
+S2.define('select2/dropdown',[
+ 'jquery',
+ './utils'
+], function ($, Utils) {
+ function Dropdown ($element, options) {
+ this.$element = $element;
+ this.options = options;
+
+ Dropdown.__super__.constructor.call(this);
+ }
+
+ Utils.Extend(Dropdown, Utils.Observable);
+
+ Dropdown.prototype.render = function () {
+ var $dropdown = $(
+ '' +
+ ' ' +
+ ' '
+ );
+
+ $dropdown.attr('dir', this.options.get('dir'));
+
+ this.$dropdown = $dropdown;
+
+ return $dropdown;
+ };
+
+ Dropdown.prototype.bind = function () {
+ // Should be implemented in subclasses
+ };
+
+ Dropdown.prototype.position = function ($dropdown, $container) {
+ // Should be implmented in subclasses
+ };
+
+ Dropdown.prototype.destroy = function () {
+ // Remove the dropdown from the DOM
+ this.$dropdown.remove();
+ };
+
+ return Dropdown;
+});
+
+S2.define('select2/dropdown/search',[
+ 'jquery',
+ '../utils'
+], function ($, Utils) {
+ function Search () { }
+
+ Search.prototype.render = function (decorated) {
+ var $rendered = decorated.call(this);
+
+ var $search = $(
+ '' +
+ ' ' +
+ ' '
+ );
+
+ this.$searchContainer = $search;
+ this.$search = $search.find('input');
+
+ $rendered.prepend($search);
+
+ return $rendered;
+ };
+
+ Search.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+ var resultsId = container.id + '-results';
+
+ decorated.call(this, container, $container);
+
+ this.$search.on('keydown', function (evt) {
+ self.trigger('keypress', evt);
+
+ self._keyUpPrevented = evt.isDefaultPrevented();
+ });
+
+ // Workaround for browsers which do not support the `input` event
+ // This will prevent double-triggering of events for browsers which support
+ // both the `keyup` and `input` events.
+ this.$search.on('input', function (evt) {
+ // Unbind the duplicated `keyup` event
+ $(this).off('keyup');
+ });
+
+ this.$search.on('keyup input', function (evt) {
+ self.handleSearch(evt);
+ });
+
+ container.on('open', function () {
+ self.$search.attr('tabindex', 0);
+ self.$search.attr('aria-owns', resultsId);
+ self.$search.focus();
+
+ window.setTimeout(function () {
+ self.$search.focus();
+ }, 0);
+ });
+
+ container.on('close', function () {
+ self.$search.attr('tabindex', -1);
+ self.$search.removeAttr('aria-activedescendant');
+ self.$search.removeAttr('aria-owns');
+ self.$search.val('');
+ });
+
+ container.on('focus', function () {
+ if (container.isOpen()) {
+ self.$search.focus();
+ }
+ });
+
+ container.on('results:all', function (params) {
+ if (params.query.term == null || params.query.term === '') {
+ var showSearch = self.showSearch(params);
+
+ if (showSearch) {
+ self.$searchContainer.removeClass('select2-search--hide');
+ } else {
+ self.$searchContainer.addClass('select2-search--hide');
+ }
+ }
+ });
+
+ container.on('results:focus', function (params) {
+ self.$search.attr('aria-activedescendant', params.data._resultId);
+ });
+ };
+
+ Search.prototype.handleSearch = function (evt) {
+ if (!this._keyUpPrevented) {
+ var input = this.$search.val();
+
+ this.trigger('query', {
+ term: input
+ });
+ }
+
+ this._keyUpPrevented = false;
+ };
+
+ Search.prototype.showSearch = function (_, params) {
+ return true;
+ };
+
+ return Search;
+});
+
+S2.define('select2/dropdown/hidePlaceholder',[
+
+], function () {
+ function HidePlaceholder (decorated, $element, options, dataAdapter) {
+ this.placeholder = this.normalizePlaceholder(options.get('placeholder'));
+
+ decorated.call(this, $element, options, dataAdapter);
+ }
+
+ HidePlaceholder.prototype.append = function (decorated, data) {
+ data.results = this.removePlaceholder(data.results);
+
+ decorated.call(this, data);
+ };
+
+ HidePlaceholder.prototype.normalizePlaceholder = function (_, placeholder) {
+ if (typeof placeholder === 'string') {
+ placeholder = {
+ id: '',
+ text: placeholder
+ };
+ }
+
+ return placeholder;
+ };
+
+ HidePlaceholder.prototype.removePlaceholder = function (_, data) {
+ var modifiedData = data.slice(0);
+
+ for (var d = data.length - 1; d >= 0; d--) {
+ var item = data[d];
+
+ if (this.placeholder.id === item.id) {
+ modifiedData.splice(d, 1);
+ }
+ }
+
+ return modifiedData;
+ };
+
+ return HidePlaceholder;
+});
+
+S2.define('select2/dropdown/infiniteScroll',[
+ 'jquery'
+], function ($) {
+ function InfiniteScroll (decorated, $element, options, dataAdapter) {
+ this.lastParams = {};
+
+ decorated.call(this, $element, options, dataAdapter);
+
+ this.$loadingMore = this.createLoadingMore();
+ this.loading = false;
+ }
+
+ InfiniteScroll.prototype.append = function (decorated, data) {
+ this.$loadingMore.remove();
+ this.loading = false;
+
+ decorated.call(this, data);
+
+ if (this.showLoadingMore(data)) {
+ this.$results.append(this.$loadingMore);
+ }
+ };
+
+ InfiniteScroll.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('query', function (params) {
+ self.lastParams = params;
+ self.loading = true;
+ });
+
+ container.on('query:append', function (params) {
+ self.lastParams = params;
+ self.loading = true;
+ });
+
+ this.$results.on('scroll', function () {
+ var isLoadMoreVisible = $.contains(
+ document.documentElement,
+ self.$loadingMore[0]
+ );
+
+ if (self.loading || !isLoadMoreVisible) {
+ return;
+ }
+
+ var currentOffset = self.$results.offset().top +
+ self.$results.outerHeight(false);
+ var loadingMoreOffset = self.$loadingMore.offset().top +
+ self.$loadingMore.outerHeight(false);
+
+ if (currentOffset + 50 >= loadingMoreOffset) {
+ self.loadMore();
+ }
+ });
+ };
+
+ InfiniteScroll.prototype.loadMore = function () {
+ this.loading = true;
+
+ var params = $.extend({}, {page: 1}, this.lastParams);
+
+ params.page++;
+
+ this.trigger('query:append', params);
+ };
+
+ InfiniteScroll.prototype.showLoadingMore = function (_, data) {
+ return data.pagination && data.pagination.more;
+ };
+
+ InfiniteScroll.prototype.createLoadingMore = function () {
+ var $option = $(
+ ' '
+ );
+
+ var message = this.options.get('translations').get('loadingMore');
+
+ $option.html(message(this.lastParams));
+
+ return $option;
+ };
+
+ return InfiniteScroll;
+});
+
+S2.define('select2/dropdown/attachBody',[
+ 'jquery',
+ '../utils'
+], function ($, Utils) {
+ function AttachBody (decorated, $element, options) {
+ this.$dropdownParent = options.get('dropdownParent') || $(document.body);
+
+ decorated.call(this, $element, options);
+ }
+
+ AttachBody.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ var setupResultsEvents = false;
+
+ decorated.call(this, container, $container);
+
+ container.on('open', function () {
+ self._showDropdown();
+ self._attachPositioningHandler(container);
+
+ if (!setupResultsEvents) {
+ setupResultsEvents = true;
+
+ container.on('results:all', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+
+ container.on('results:append', function () {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+ }
+ });
+
+ container.on('close', function () {
+ self._hideDropdown();
+ self._detachPositioningHandler(container);
+ });
+
+ this.$dropdownContainer.on('mousedown', function (evt) {
+ evt.stopPropagation();
+ });
+ };
+
+ AttachBody.prototype.destroy = function (decorated) {
+ decorated.call(this);
+
+ this.$dropdownContainer.remove();
+ };
+
+ AttachBody.prototype.position = function (decorated, $dropdown, $container) {
+ // Clone all of the container classes
+ $dropdown.attr('class', $container.attr('class'));
+
+ $dropdown.removeClass('select2');
+ $dropdown.addClass('select2-container--open');
+
+ $dropdown.css({
+ position: 'absolute',
+ top: -999999
+ });
+
+ this.$container = $container;
+ };
+
+ AttachBody.prototype.render = function (decorated) {
+ var $container = $(' ');
+
+ var $dropdown = decorated.call(this);
+ $container.append($dropdown);
+
+ this.$dropdownContainer = $container;
+
+ return $container;
+ };
+
+ AttachBody.prototype._hideDropdown = function (decorated) {
+ this.$dropdownContainer.detach();
+ };
+
+ AttachBody.prototype._attachPositioningHandler =
+ function (decorated, container) {
+ var self = this;
+
+ var scrollEvent = 'scroll.select2.' + container.id;
+ var resizeEvent = 'resize.select2.' + container.id;
+ var orientationEvent = 'orientationchange.select2.' + container.id;
+
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
+ $watchers.each(function () {
+ $(this).data('select2-scroll-position', {
+ x: $(this).scrollLeft(),
+ y: $(this).scrollTop()
+ });
+ });
+
+ $watchers.on(scrollEvent, function (ev) {
+ var position = $(this).data('select2-scroll-position');
+ $(this).scrollTop(position.y);
+ });
+
+ $(window).on(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent,
+ function (e) {
+ self._positionDropdown();
+ self._resizeDropdown();
+ });
+ };
+
+ AttachBody.prototype._detachPositioningHandler =
+ function (decorated, container) {
+ var scrollEvent = 'scroll.select2.' + container.id;
+ var resizeEvent = 'resize.select2.' + container.id;
+ var orientationEvent = 'orientationchange.select2.' + container.id;
+
+ var $watchers = this.$container.parents().filter(Utils.hasScroll);
+ $watchers.off(scrollEvent);
+
+ $(window).off(scrollEvent + ' ' + resizeEvent + ' ' + orientationEvent);
+ };
+
+ AttachBody.prototype._positionDropdown = function () {
+ var $window = $(window);
+
+ var isCurrentlyAbove = this.$dropdown.hasClass('select2-dropdown--above');
+ var isCurrentlyBelow = this.$dropdown.hasClass('select2-dropdown--below');
+
+ var newDirection = null;
+
+ var offset = this.$container.offset();
+
+ offset.bottom = offset.top + this.$container.outerHeight(false);
+
+ var container = {
+ height: this.$container.outerHeight(false)
+ };
+
+ container.top = offset.top;
+ container.bottom = offset.top + container.height;
+
+ var dropdown = {
+ height: this.$dropdown.outerHeight(false)
+ };
+
+ var viewport = {
+ top: $window.scrollTop(),
+ bottom: $window.scrollTop() + $window.height()
+ };
+
+ var enoughRoomAbove = viewport.top < (offset.top - dropdown.height);
+ var enoughRoomBelow = viewport.bottom > (offset.bottom + dropdown.height);
+
+ var css = {
+ left: offset.left,
+ top: container.bottom
+ };
+
+ // Determine what the parent element is to use for calciulating the offset
+ var $offsetParent = this.$dropdownParent;
+
+ // For statically positoned elements, we need to get the element
+ // that is determining the offset
+ if ($offsetParent.css('position') === 'static') {
+ $offsetParent = $offsetParent.offsetParent();
+ }
+
+ var parentOffset = $offsetParent.offset();
+
+ css.top -= parentOffset.top;
+ css.left -= parentOffset.left;
+
+ if (!isCurrentlyAbove && !isCurrentlyBelow) {
+ newDirection = 'below';
+ }
+
+ if (!enoughRoomBelow && enoughRoomAbove && !isCurrentlyAbove) {
+ newDirection = 'above';
+ } else if (!enoughRoomAbove && enoughRoomBelow && isCurrentlyAbove) {
+ newDirection = 'below';
+ }
+
+ if (newDirection == 'above' ||
+ (isCurrentlyAbove && newDirection !== 'below')) {
+ css.top = container.top - parentOffset.top - dropdown.height;
+ }
+
+ if (newDirection != null) {
+ this.$dropdown
+ .removeClass('select2-dropdown--below select2-dropdown--above')
+ .addClass('select2-dropdown--' + newDirection);
+ this.$container
+ .removeClass('select2-container--below select2-container--above')
+ .addClass('select2-container--' + newDirection);
+ }
+
+ this.$dropdownContainer.css(css);
+ };
+
+ AttachBody.prototype._resizeDropdown = function () {
+ var css = {
+ width: this.$container.outerWidth(false) + 'px'
+ };
+
+ if (this.options.get('dropdownAutoWidth')) {
+ css.minWidth = css.width;
+ css.position = 'relative';
+ css.width = 'auto';
+ }
+
+ this.$dropdown.css(css);
+ };
+
+ AttachBody.prototype._showDropdown = function (decorated) {
+ this.$dropdownContainer.appendTo(this.$dropdownParent);
+
+ this._positionDropdown();
+ this._resizeDropdown();
+ };
+
+ return AttachBody;
+});
+
+S2.define('select2/dropdown/minimumResultsForSearch',[
+
+], function () {
+ function countResults (data) {
+ var count = 0;
+
+ for (var d = 0; d < data.length; d++) {
+ var item = data[d];
+
+ if (item.children) {
+ count += countResults(item.children);
+ } else {
+ count++;
+ }
+ }
+
+ return count;
+ }
+
+ function MinimumResultsForSearch (decorated, $element, options, dataAdapter) {
+ this.minimumResultsForSearch = options.get('minimumResultsForSearch');
+
+ if (this.minimumResultsForSearch < 0) {
+ this.minimumResultsForSearch = Infinity;
+ }
+
+ decorated.call(this, $element, options, dataAdapter);
+ }
+
+ MinimumResultsForSearch.prototype.showSearch = function (decorated, params) {
+ if (countResults(params.data.results) < this.minimumResultsForSearch) {
+ return false;
+ }
+
+ return decorated.call(this, params);
+ };
+
+ return MinimumResultsForSearch;
+});
+
+S2.define('select2/dropdown/selectOnClose',[
+
+], function () {
+ function SelectOnClose () { }
+
+ SelectOnClose.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('close', function (params) {
+ self._handleSelectOnClose(params);
+ });
+ };
+
+ SelectOnClose.prototype._handleSelectOnClose = function (_, params) {
+ if (params && params.originalSelect2Event != null) {
+ var event = params.originalSelect2Event;
+
+ // Don't select an item if the close event was triggered from a select or
+ // unselect event
+ if (event._type === 'select' || event._type === 'unselect') {
+ return;
+ }
+ }
+
+ var $highlightedResults = this.getHighlightedResults();
+
+ // Only select highlighted results
+ if ($highlightedResults.length < 1) {
+ return;
+ }
+
+ var data = $highlightedResults.data('data');
+
+ // Don't re-select already selected resulte
+ if (
+ (data.element != null && data.element.selected) ||
+ (data.element == null && data.selected)
+ ) {
+ return;
+ }
+
+ this.trigger('select', {
+ data: data
+ });
+ };
+
+ return SelectOnClose;
+});
+
+S2.define('select2/dropdown/closeOnSelect',[
+
+], function () {
+ function CloseOnSelect () { }
+
+ CloseOnSelect.prototype.bind = function (decorated, container, $container) {
+ var self = this;
+
+ decorated.call(this, container, $container);
+
+ container.on('select', function (evt) {
+ self._selectTriggered(evt);
+ });
+
+ container.on('unselect', function (evt) {
+ self._selectTriggered(evt);
+ });
+ };
+
+ CloseOnSelect.prototype._selectTriggered = function (_, evt) {
+ var originalEvent = evt.originalEvent;
+
+ // Don't close if the control key is being held
+ if (originalEvent && originalEvent.ctrlKey) {
+ return;
+ }
+
+ this.trigger('close', {
+ originalEvent: originalEvent,
+ originalSelect2Event: evt
+ });
+ };
+
+ return CloseOnSelect;
+});
+
+S2.define('select2/i18n/en',[],function () {
+ // English
+ return {
+ errorLoading: function () {
+ return 'The results could not be loaded.';
+ },
+ inputTooLong: function (args) {
+ var overChars = args.input.length - args.maximum;
+
+ var message = 'Please delete ' + overChars + ' character';
+
+ if (overChars != 1) {
+ message += 's';
+ }
+
+ return message;
+ },
+ inputTooShort: function (args) {
+ var remainingChars = args.minimum - args.input.length;
+
+ var message = 'Please enter ' + remainingChars + ' or more characters';
+
+ return message;
+ },
+ loadingMore: function () {
+ return 'Loading more results…';
+ },
+ maximumSelected: function (args) {
+ var message = 'You can only select ' + args.maximum + ' item';
+
+ if (args.maximum != 1) {
+ message += 's';
+ }
+
+ return message;
+ },
+ noResults: function () {
+ return 'No results found';
+ },
+ searching: function () {
+ return 'Searching…';
+ }
+ };
+});
+
+S2.define('select2/defaults',[
+ 'jquery',
+ 'require',
+
+ './results',
+
+ './selection/single',
+ './selection/multiple',
+ './selection/placeholder',
+ './selection/allowClear',
+ './selection/search',
+ './selection/eventRelay',
+
+ './utils',
+ './translation',
+ './diacritics',
+
+ './data/select',
+ './data/array',
+ './data/ajax',
+ './data/tags',
+ './data/tokenizer',
+ './data/minimumInputLength',
+ './data/maximumInputLength',
+ './data/maximumSelectionLength',
+
+ './dropdown',
+ './dropdown/search',
+ './dropdown/hidePlaceholder',
+ './dropdown/infiniteScroll',
+ './dropdown/attachBody',
+ './dropdown/minimumResultsForSearch',
+ './dropdown/selectOnClose',
+ './dropdown/closeOnSelect',
+
+ './i18n/en'
+], function ($, require,
+
+ ResultsList,
+
+ SingleSelection, MultipleSelection, Placeholder, AllowClear,
+ SelectionSearch, EventRelay,
+
+ Utils, Translation, DIACRITICS,
+
+ SelectData, ArrayData, AjaxData, Tags, Tokenizer,
+ MinimumInputLength, MaximumInputLength, MaximumSelectionLength,
+
+ Dropdown, DropdownSearch, HidePlaceholder, InfiniteScroll,
+ AttachBody, MinimumResultsForSearch, SelectOnClose, CloseOnSelect,
+
+ EnglishTranslation) {
+ function Defaults () {
+ this.reset();
+ }
+
+ Defaults.prototype.apply = function (options) {
+ options = $.extend(true, {}, this.defaults, options);
+
+ if (options.dataAdapter == null) {
+ if (options.ajax != null) {
+ options.dataAdapter = AjaxData;
+ } else if (options.data != null) {
+ options.dataAdapter = ArrayData;
+ } else {
+ options.dataAdapter = SelectData;
+ }
+
+ if (options.minimumInputLength > 0) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ MinimumInputLength
+ );
+ }
+
+ if (options.maximumInputLength > 0) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ MaximumInputLength
+ );
+ }
+
+ if (options.maximumSelectionLength > 0) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ MaximumSelectionLength
+ );
+ }
+
+ if (options.tags) {
+ options.dataAdapter = Utils.Decorate(options.dataAdapter, Tags);
+ }
+
+ if (options.tokenSeparators != null || options.tokenizer != null) {
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ Tokenizer
+ );
+ }
+
+ if (options.query != null) {
+ var Query = require(options.amdBase + 'compat/query');
+
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ Query
+ );
+ }
+
+ if (options.initSelection != null) {
+ var InitSelection = require(options.amdBase + 'compat/initSelection');
+
+ options.dataAdapter = Utils.Decorate(
+ options.dataAdapter,
+ InitSelection
+ );
+ }
+ }
+
+ if (options.resultsAdapter == null) {
+ options.resultsAdapter = ResultsList;
+
+ if (options.ajax != null) {
+ options.resultsAdapter = Utils.Decorate(
+ options.resultsAdapter,
+ InfiniteScroll
+ );
+ }
+
+ if (options.placeholder != null) {
+ options.resultsAdapter = Utils.Decorate(
+ options.resultsAdapter,
+ HidePlaceholder
+ );
+ }
+
+ if (options.selectOnClose) {
+ options.resultsAdapter = Utils.Decorate(
+ options.resultsAdapter,
+ SelectOnClose
+ );
+ }
+ }
+
+ if (options.dropdownAdapter == null) {
+ if (options.multiple) {
+ options.dropdownAdapter = Dropdown;
+ } else {
+ var SearchableDropdown = Utils.Decorate(Dropdown, DropdownSearch);
+
+ options.dropdownAdapter = SearchableDropdown;
+ }
+
+ if (options.minimumResultsForSearch !== 0) {
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ MinimumResultsForSearch
+ );
+ }
+
+ if (options.closeOnSelect) {
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ CloseOnSelect
+ );
+ }
+
+ if (
+ options.dropdownCssClass != null ||
+ options.dropdownCss != null ||
+ options.adaptDropdownCssClass != null
+ ) {
+ var DropdownCSS = require(options.amdBase + 'compat/dropdownCss');
+
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ DropdownCSS
+ );
+ }
+
+ options.dropdownAdapter = Utils.Decorate(
+ options.dropdownAdapter,
+ AttachBody
+ );
+ }
+
+ if (options.selectionAdapter == null) {
+ if (options.multiple) {
+ options.selectionAdapter = MultipleSelection;
+ } else {
+ options.selectionAdapter = SingleSelection;
+ }
+
+ // Add the placeholder mixin if a placeholder was specified
+ if (options.placeholder != null) {
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ Placeholder
+ );
+ }
+
+ if (options.allowClear) {
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ AllowClear
+ );
+ }
+
+ if (options.multiple) {
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ SelectionSearch
+ );
+ }
+
+ if (
+ options.containerCssClass != null ||
+ options.containerCss != null ||
+ options.adaptContainerCssClass != null
+ ) {
+ var ContainerCSS = require(options.amdBase + 'compat/containerCss');
+
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ ContainerCSS
+ );
+ }
+
+ options.selectionAdapter = Utils.Decorate(
+ options.selectionAdapter,
+ EventRelay
+ );
+ }
+
+ if (typeof options.language === 'string') {
+ // Check if the language is specified with a region
+ if (options.language.indexOf('-') > 0) {
+ // Extract the region information if it is included
+ var languageParts = options.language.split('-');
+ var baseLanguage = languageParts[0];
+
+ options.language = [options.language, baseLanguage];
+ } else {
+ options.language = [options.language];
+ }
+ }
+
+ if ($.isArray(options.language)) {
+ var languages = new Translation();
+ options.language.push('en');
+
+ var languageNames = options.language;
+
+ for (var l = 0; l < languageNames.length; l++) {
+ var name = languageNames[l];
+ var language = {};
+
+ try {
+ // Try to load it with the original name
+ language = Translation.loadPath(name);
+ } catch (e) {
+ try {
+ // If we couldn't load it, check if it wasn't the full path
+ name = this.defaults.amdLanguageBase + name;
+ language = Translation.loadPath(name);
+ } catch (ex) {
+ // The translation could not be loaded at all. Sometimes this is
+ // because of a configuration problem, other times this can be
+ // because of how Select2 helps load all possible translation files.
+ if (options.debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The language file for "' + name + '" could not be ' +
+ 'automatically loaded. A fallback will be used instead.'
+ );
+ }
+
+ continue;
+ }
+ }
+
+ languages.extend(language);
+ }
+
+ options.translations = languages;
+ } else {
+ var baseTranslation = Translation.loadPath(
+ this.defaults.amdLanguageBase + 'en'
+ );
+ var customTranslation = new Translation(options.language);
+
+ customTranslation.extend(baseTranslation);
+
+ options.translations = customTranslation;
+ }
+
+ return options;
+ };
+
+ Defaults.prototype.reset = function () {
+ function stripDiacritics (text) {
+ // Used 'uni range + named function' from http://jsperf.com/diacritics/18
+ function match(a) {
+ return DIACRITICS[a] || a;
+ }
+
+ return text.replace(/[^\u0000-\u007E]/g, match);
+ }
+
+ function matcher (params, data) {
+ // Always return the object if there is nothing to compare
+ if ($.trim(params.term) === '') {
+ return data;
+ }
+
+ // Do a recursive check for options with children
+ if (data.children && data.children.length > 0) {
+ // Clone the data object if there are children
+ // This is required as we modify the object to remove any non-matches
+ var match = $.extend(true, {}, data);
+
+ // Check each child of the option
+ for (var c = data.children.length - 1; c >= 0; c--) {
+ var child = data.children[c];
+
+ var matches = matcher(params, child);
+
+ // If there wasn't a match, remove the object in the array
+ if (matches == null) {
+ match.children.splice(c, 1);
+ }
+ }
+
+ // If any children matched, return the new object
+ if (match.children.length > 0) {
+ return match;
+ }
+
+ // If there were no matching children, check just the plain object
+ return matcher(params, match);
+ }
+
+ var original = stripDiacritics(data.text).toUpperCase();
+ var term = stripDiacritics(params.term).toUpperCase();
+
+ // Check if the text contains the term
+ if (original.indexOf(term) > -1) {
+ return data;
+ }
+
+ // If it doesn't contain the term, don't return anything
+ return null;
+ }
+
+ this.defaults = {
+ amdBase: './',
+ amdLanguageBase: './i18n/',
+ closeOnSelect: true,
+ debug: false,
+ dropdownAutoWidth: false,
+ escapeMarkup: Utils.escapeMarkup,
+ language: EnglishTranslation,
+ matcher: matcher,
+ minimumInputLength: 0,
+ maximumInputLength: 0,
+ maximumSelectionLength: 0,
+ minimumResultsForSearch: 0,
+ selectOnClose: false,
+ sorter: function (data) {
+ return data;
+ },
+ templateResult: function (result) {
+ return result.text;
+ },
+ templateSelection: function (selection) {
+ return selection.text;
+ },
+ theme: 'default',
+ width: 'resolve'
+ };
+ };
+
+ Defaults.prototype.set = function (key, value) {
+ var camelKey = $.camelCase(key);
+
+ var data = {};
+ data[camelKey] = value;
+
+ var convertedData = Utils._convertData(data);
+
+ $.extend(this.defaults, convertedData);
+ };
+
+ var defaults = new Defaults();
+
+ return defaults;
+});
+
+S2.define('select2/options',[
+ 'require',
+ 'jquery',
+ './defaults',
+ './utils'
+], function (require, $, Defaults, Utils) {
+ function Options (options, $element) {
+ this.options = options;
+
+ if ($element != null) {
+ this.fromElement($element);
+ }
+
+ this.options = Defaults.apply(this.options);
+
+ if ($element && $element.is('input')) {
+ var InputCompat = require(this.get('amdBase') + 'compat/inputData');
+
+ this.options.dataAdapter = Utils.Decorate(
+ this.options.dataAdapter,
+ InputCompat
+ );
+ }
+ }
+
+ Options.prototype.fromElement = function ($e) {
+ var excludedData = ['select2'];
+
+ if (this.options.multiple == null) {
+ this.options.multiple = $e.prop('multiple');
+ }
+
+ if (this.options.disabled == null) {
+ this.options.disabled = $e.prop('disabled');
+ }
+
+ if (this.options.language == null) {
+ if ($e.prop('lang')) {
+ this.options.language = $e.prop('lang').toLowerCase();
+ } else if ($e.closest('[lang]').prop('lang')) {
+ this.options.language = $e.closest('[lang]').prop('lang');
+ }
+ }
+
+ if (this.options.dir == null) {
+ if ($e.prop('dir')) {
+ this.options.dir = $e.prop('dir');
+ } else if ($e.closest('[dir]').prop('dir')) {
+ this.options.dir = $e.closest('[dir]').prop('dir');
+ } else {
+ this.options.dir = 'ltr';
+ }
+ }
+
+ $e.prop('disabled', this.options.disabled);
+ $e.prop('multiple', this.options.multiple);
+
+ if ($e.data('select2Tags')) {
+ if (this.options.debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `data-select2-tags` attribute has been changed to ' +
+ 'use the `data-data` and `data-tags="true"` attributes and will be ' +
+ 'removed in future versions of Select2.'
+ );
+ }
+
+ $e.data('data', $e.data('select2Tags'));
+ $e.data('tags', true);
+ }
+
+ if ($e.data('ajaxUrl')) {
+ if (this.options.debug && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `data-ajax-url` attribute has been changed to ' +
+ '`data-ajax--url` and support for the old attribute will be removed' +
+ ' in future versions of Select2.'
+ );
+ }
+
+ $e.attr('ajax--url', $e.data('ajaxUrl'));
+ $e.data('ajax--url', $e.data('ajaxUrl'));
+ }
+
+ var dataset = {};
+
+ // Prefer the element's `dataset` attribute if it exists
+ // jQuery 1.x does not correctly handle data attributes with multiple dashes
+ if ($.fn.jquery && $.fn.jquery.substr(0, 2) == '1.' && $e[0].dataset) {
+ dataset = $.extend(true, {}, $e[0].dataset, $e.data());
+ } else {
+ dataset = $e.data();
+ }
+
+ var data = $.extend(true, {}, dataset);
+
+ data = Utils._convertData(data);
+
+ for (var key in data) {
+ if ($.inArray(key, excludedData) > -1) {
+ continue;
+ }
+
+ if ($.isPlainObject(this.options[key])) {
+ $.extend(this.options[key], data[key]);
+ } else {
+ this.options[key] = data[key];
+ }
+ }
+
+ return this;
+ };
+
+ Options.prototype.get = function (key) {
+ return this.options[key];
+ };
+
+ Options.prototype.set = function (key, val) {
+ this.options[key] = val;
+ };
+
+ return Options;
+});
+
+S2.define('select2/core',[
+ 'jquery',
+ './options',
+ './utils',
+ './keys'
+], function ($, Options, Utils, KEYS) {
+ var Select2 = function ($element, options) {
+ if ($element.data('select2') != null) {
+ $element.data('select2').destroy();
+ }
+
+ this.$element = $element;
+
+ this.id = this._generateId($element);
+
+ options = options || {};
+
+ this.options = new Options(options, $element);
+
+ Select2.__super__.constructor.call(this);
+
+ // Set up the tabindex
+
+ var tabindex = $element.attr('tabindex') || 0;
+ $element.data('old-tabindex', tabindex);
+ $element.attr('tabindex', '-1');
+
+ // Set up containers and adapters
+
+ var DataAdapter = this.options.get('dataAdapter');
+ this.dataAdapter = new DataAdapter($element, this.options);
+
+ var $container = this.render();
+
+ this._placeContainer($container);
+
+ var SelectionAdapter = this.options.get('selectionAdapter');
+ this.selection = new SelectionAdapter($element, this.options);
+ this.$selection = this.selection.render();
+
+ this.selection.position(this.$selection, $container);
+
+ var DropdownAdapter = this.options.get('dropdownAdapter');
+ this.dropdown = new DropdownAdapter($element, this.options);
+ this.$dropdown = this.dropdown.render();
+
+ this.dropdown.position(this.$dropdown, $container);
+
+ var ResultsAdapter = this.options.get('resultsAdapter');
+ this.results = new ResultsAdapter($element, this.options, this.dataAdapter);
+ this.$results = this.results.render();
+
+ this.results.position(this.$results, this.$dropdown);
+
+ // Bind events
+
+ var self = this;
+
+ // Bind the container to all of the adapters
+ this._bindAdapters();
+
+ // Register any DOM event handlers
+ this._registerDomEvents();
+
+ // Register any internal event handlers
+ this._registerDataEvents();
+ this._registerSelectionEvents();
+ this._registerDropdownEvents();
+ this._registerResultsEvents();
+ this._registerEvents();
+
+ // Set the initial state
+ this.dataAdapter.current(function (initialData) {
+ self.trigger('selection:update', {
+ data: initialData
+ });
+ });
+
+ // Hide the original select
+ $element.addClass('select2-hidden-accessible');
+ $element.attr('aria-hidden', 'true');
+
+ // Synchronize any monitored attributes
+ this._syncAttributes();
+
+ $element.data('select2', this);
+ };
+
+ Utils.Extend(Select2, Utils.Observable);
+
+ Select2.prototype._generateId = function ($element) {
+ var id = '';
+
+ if ($element.attr('id') != null) {
+ id = $element.attr('id');
+ } else if ($element.attr('name') != null) {
+ id = $element.attr('name') + '-' + Utils.generateChars(2);
+ } else {
+ id = Utils.generateChars(4);
+ }
+
+ id = id.replace(/(:|\.|\[|\]|,)/g, '');
+ id = 'select2-' + id;
+
+ return id;
+ };
+
+ Select2.prototype._placeContainer = function ($container) {
+ $container.insertAfter(this.$element);
+
+ var width = this._resolveWidth(this.$element, this.options.get('width'));
+
+ if (width != null) {
+ $container.css('width', width);
+ }
+ };
+
+ Select2.prototype._resolveWidth = function ($element, method) {
+ var WIDTH = /^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;
+
+ if (method == 'resolve') {
+ var styleWidth = this._resolveWidth($element, 'style');
+
+ if (styleWidth != null) {
+ return styleWidth;
+ }
+
+ return this._resolveWidth($element, 'element');
+ }
+
+ if (method == 'element') {
+ var elementWidth = $element.outerWidth(false);
+
+ if (elementWidth <= 0) {
+ return 'auto';
+ }
+
+ return elementWidth + 'px';
+ }
+
+ if (method == 'style') {
+ var style = $element.attr('style');
+
+ if (typeof(style) !== 'string') {
+ return null;
+ }
+
+ var attrs = style.split(';');
+
+ for (var i = 0, l = attrs.length; i < l; i = i + 1) {
+ var attr = attrs[i].replace(/\s/g, '');
+ var matches = attr.match(WIDTH);
+
+ if (matches !== null && matches.length >= 1) {
+ return matches[1];
+ }
+ }
+
+ return null;
+ }
+
+ return method;
+ };
+
+ Select2.prototype._bindAdapters = function () {
+ this.dataAdapter.bind(this, this.$container);
+ this.selection.bind(this, this.$container);
+
+ this.dropdown.bind(this, this.$container);
+ this.results.bind(this, this.$container);
+ };
+
+ Select2.prototype._registerDomEvents = function () {
+ var self = this;
+
+ this.$element.on('change.select2', function () {
+ self.dataAdapter.current(function (data) {
+ self.trigger('selection:update', {
+ data: data
+ });
+ });
+ });
+
+ this.$element.on('focus.select2', function (evt) {
+ self.trigger('focus', evt);
+ });
+
+ this._syncA = Utils.bind(this._syncAttributes, this);
+ this._syncS = Utils.bind(this._syncSubtree, this);
+
+ if (this.$element[0].attachEvent) {
+ this.$element[0].attachEvent('onpropertychange', this._syncA);
+ }
+
+ var observer = window.MutationObserver ||
+ window.WebKitMutationObserver ||
+ window.MozMutationObserver
+ ;
+
+ if (observer != null) {
+ this._observer = new observer(function (mutations) {
+ $.each(mutations, self._syncA);
+ $.each(mutations, self._syncS);
+ });
+ this._observer.observe(this.$element[0], {
+ attributes: true,
+ childList: true,
+ subtree: false
+ });
+ } else if (this.$element[0].addEventListener) {
+ this.$element[0].addEventListener(
+ 'DOMAttrModified',
+ self._syncA,
+ false
+ );
+ this.$element[0].addEventListener(
+ 'DOMNodeInserted',
+ self._syncS,
+ false
+ );
+ this.$element[0].addEventListener(
+ 'DOMNodeRemoved',
+ self._syncS,
+ false
+ );
+ }
+ };
+
+ Select2.prototype._registerDataEvents = function () {
+ var self = this;
+
+ this.dataAdapter.on('*', function (name, params) {
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerSelectionEvents = function () {
+ var self = this;
+ var nonRelayEvents = ['toggle', 'focus'];
+
+ this.selection.on('toggle', function () {
+ self.toggleDropdown();
+ });
+
+ this.selection.on('focus', function (params) {
+ self.focus(params);
+ });
+
+ this.selection.on('*', function (name, params) {
+ if ($.inArray(name, nonRelayEvents) !== -1) {
+ return;
+ }
+
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerDropdownEvents = function () {
+ var self = this;
+
+ this.dropdown.on('*', function (name, params) {
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerResultsEvents = function () {
+ var self = this;
+
+ this.results.on('*', function (name, params) {
+ self.trigger(name, params);
+ });
+ };
+
+ Select2.prototype._registerEvents = function () {
+ var self = this;
+
+ this.on('open', function () {
+ self.$container.addClass('select2-container--open');
+ });
+
+ this.on('close', function () {
+ self.$container.removeClass('select2-container--open');
+ });
+
+ this.on('enable', function () {
+ self.$container.removeClass('select2-container--disabled');
+ });
+
+ this.on('disable', function () {
+ self.$container.addClass('select2-container--disabled');
+ });
+
+ this.on('blur', function () {
+ self.$container.removeClass('select2-container--focus');
+ });
+
+ this.on('query', function (params) {
+ if (!self.isOpen()) {
+ self.trigger('open', {});
+ }
+
+ this.dataAdapter.query(params, function (data) {
+ self.trigger('results:all', {
+ data: data,
+ query: params
+ });
+ });
+ });
+
+ this.on('query:append', function (params) {
+ this.dataAdapter.query(params, function (data) {
+ self.trigger('results:append', {
+ data: data,
+ query: params
+ });
+ });
+ });
+
+ this.on('open', function(){
+ // Focus on the active element when opening dropdown.
+ // Needs 1 ms delay because of other 1 ms setTimeouts when rendering.
+ setTimeout(function(){
+ self.focusOnActiveElement();
+ }, 1);
+ });
+
+ $(document).on('keydown', function (evt) {
+ var key = evt.which;
+ if (self.isOpen()) {
+ if (key === KEYS.ESC || key === KEYS.TAB ||
+ (key === KEYS.UP && evt.altKey)) {
+ self.close();
+
+ evt.preventDefault();
+ } else if (key === KEYS.ENTER) {
+ self.trigger('results:select', {});
+
+ evt.preventDefault();
+ } else if ((key === KEYS.SPACE && evt.ctrlKey)) {
+ self.trigger('results:toggle', {});
+
+ evt.preventDefault();
+ } else if (key === KEYS.UP) {
+ self.trigger('results:previous', {});
+
+ evt.preventDefault();
+ } else if (key === KEYS.DOWN) {
+ self.trigger('results:next', {});
+
+ evt.preventDefault();
+ }
+
+ // Move the focus to the selected element on keyboard navigation.
+ // Required for screen readers to work properly.
+ if (key === KEYS.DOWN || key === KEYS.UP) {
+ self.focusOnActiveElement();
+ } else {
+ // Focus on the search if user starts typing.
+ var $searchField = self.$dropdown.find('.select2-search__field');
+ if (! $searchField.length) {
+ $searchField = self.$container.find('.select2-search__field');
+ }
+ $searchField.focus();
+ // Focus back to active selection when finished typing.
+ // Small delay so typed character can be read by screen reader.
+ setTimeout(function(){
+ self.focusOnActiveElement();
+ }, 1000);
+ }
+
+ } else if (self.hasFocus()) {
+ if (key === KEYS.ENTER || key === KEYS.SPACE ||
+ (key === KEYS.DOWN && evt.altKey)) {
+ self.open();
+ evt.preventDefault();
+ }
+ }
+ });
+ };
+
+ Select2.prototype.focusOnActiveElement = function () {
+ // Don't mess with the focus on touchscreens because it causes havoc with on-screen keyboards.
+ if (! Utils.isTouchscreen()) {
+ this.$results.find('li.select2-results__option--highlighted').focus();
+ }
+ };
+
+ Select2.prototype._syncAttributes = function () {
+ this.options.set('disabled', this.$element.prop('disabled'));
+
+ if (this.options.get('disabled')) {
+ if (this.isOpen()) {
+ this.close();
+ }
+
+ this.trigger('disable', {});
+ } else {
+ this.trigger('enable', {});
+ }
+ };
+
+ Select2.prototype._syncSubtree = function (evt, mutations) {
+ var changed = false;
+ var self = this;
+
+ // Ignore any mutation events raised for elements that aren't options or
+ // optgroups. This handles the case when the select element is destroyed
+ if (
+ evt && evt.target && (
+ evt.target.nodeName !== 'OPTION' && evt.target.nodeName !== 'OPTGROUP'
+ )
+ ) {
+ return;
+ }
+
+ if (!mutations) {
+ // If mutation events aren't supported, then we can only assume that the
+ // change affected the selections
+ changed = true;
+ } else if (mutations.addedNodes && mutations.addedNodes.length > 0) {
+ for (var n = 0; n < mutations.addedNodes.length; n++) {
+ var node = mutations.addedNodes[n];
+
+ if (node.selected) {
+ changed = true;
+ }
+ }
+ } else if (mutations.removedNodes && mutations.removedNodes.length > 0) {
+ changed = true;
+ }
+
+ // Only re-pull the data if we think there is a change
+ if (changed) {
+ this.dataAdapter.current(function (currentData) {
+ self.trigger('selection:update', {
+ data: currentData
+ });
+ });
+ }
+ };
+
+ /**
+ * Override the trigger method to automatically trigger pre-events when
+ * there are events that can be prevented.
+ */
+ Select2.prototype.trigger = function (name, args) {
+ var actualTrigger = Select2.__super__.trigger;
+ var preTriggerMap = {
+ 'open': 'opening',
+ 'close': 'closing',
+ 'select': 'selecting',
+ 'unselect': 'unselecting'
+ };
+
+ if (args === undefined) {
+ args = {};
+ }
+
+ if (name in preTriggerMap) {
+ var preTriggerName = preTriggerMap[name];
+ var preTriggerArgs = {
+ prevented: false,
+ name: name,
+ args: args
+ };
+
+ actualTrigger.call(this, preTriggerName, preTriggerArgs);
+
+ if (preTriggerArgs.prevented) {
+ args.prevented = true;
+
+ return;
+ }
+ }
+
+ actualTrigger.call(this, name, args);
+ };
+
+ Select2.prototype.toggleDropdown = function () {
+ if (this.options.get('disabled')) {
+ return;
+ }
+
+ if (this.isOpen()) {
+ this.close();
+ } else {
+ this.open();
+ }
+ };
+
+ Select2.prototype.open = function () {
+ if (this.isOpen()) {
+ return;
+ }
+
+ this.trigger('query', {});
+ };
+
+ Select2.prototype.close = function () {
+ if (!this.isOpen()) {
+ return;
+ }
+
+ this.trigger('close', {});
+ };
+
+ Select2.prototype.isOpen = function () {
+ return this.$container.hasClass('select2-container--open');
+ };
+
+ Select2.prototype.hasFocus = function () {
+ return this.$container.hasClass('select2-container--focus');
+ };
+
+ Select2.prototype.focus = function (data) {
+ // No need to re-trigger focus events if we are already focused
+ if (this.hasFocus()) {
+ return;
+ }
+
+ this.$container.addClass('select2-container--focus');
+ this.trigger('focus', {});
+ };
+
+ Select2.prototype.enable = function (args) {
+ if (this.options.get('debug') && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `select2("enable")` method has been deprecated and will' +
+ ' be removed in later Select2 versions. Use $element.prop("disabled")' +
+ ' instead.'
+ );
+ }
+
+ if (args == null || args.length === 0) {
+ args = [true];
+ }
+
+ var disabled = !args[0];
+
+ this.$element.prop('disabled', disabled);
+ };
+
+ Select2.prototype.data = function () {
+ if (this.options.get('debug') &&
+ arguments.length > 0 && window.console && console.warn) {
+ console.warn(
+ 'Select2: Data can no longer be set using `select2("data")`. You ' +
+ 'should consider setting the value instead using `$element.val()`.'
+ );
+ }
+
+ var data = [];
+
+ this.dataAdapter.current(function (currentData) {
+ data = currentData;
+ });
+
+ return data;
+ };
+
+ Select2.prototype.val = function (args) {
+ if (this.options.get('debug') && window.console && console.warn) {
+ console.warn(
+ 'Select2: The `select2("val")` method has been deprecated and will be' +
+ ' removed in later Select2 versions. Use $element.val() instead.'
+ );
+ }
+
+ if (args == null || args.length === 0) {
+ return this.$element.val();
+ }
+
+ var newVal = args[0];
+
+ if ($.isArray(newVal)) {
+ newVal = $.map(newVal, function (obj) {
+ return obj.toString();
+ });
+ }
+
+ this.$element.val(newVal).trigger('change');
+ };
+
+ Select2.prototype.destroy = function () {
+ this.$container.remove();
+
+ if (this.$element[0].detachEvent) {
+ this.$element[0].detachEvent('onpropertychange', this._syncA);
+ }
+
+ if (this._observer != null) {
+ this._observer.disconnect();
+ this._observer = null;
+ } else if (this.$element[0].removeEventListener) {
+ this.$element[0]
+ .removeEventListener('DOMAttrModified', this._syncA, false);
+ this.$element[0]
+ .removeEventListener('DOMNodeInserted', this._syncS, false);
+ this.$element[0]
+ .removeEventListener('DOMNodeRemoved', this._syncS, false);
+ }
+
+ this._syncA = null;
+ this._syncS = null;
+
+ this.$element.off('.select2');
+ this.$element.attr('tabindex', this.$element.data('old-tabindex'));
+
+ this.$element.removeClass('select2-hidden-accessible');
+ this.$element.attr('aria-hidden', 'false');
+ this.$element.removeData('select2');
+
+ this.dataAdapter.destroy();
+ this.selection.destroy();
+ this.dropdown.destroy();
+ this.results.destroy();
+
+ this.dataAdapter = null;
+ this.selection = null;
+ this.dropdown = null;
+ this.results = null;
+ };
+
+ Select2.prototype.render = function () {
+ var $container = $(
+ '' +
+ ' ' +
+ ' ' +
+ ' '
+ );
+
+ $container.attr('dir', this.options.get('dir'));
+
+ this.$container = $container;
+
+ this.$container.addClass('select2-container--' + this.options.get('theme'));
+
+ $container.data('element', this.$element);
+
+ return $container;
+ };
+
+ return Select2;
+});
+
+S2.define('jquery-mousewheel',[
+ 'jquery'
+], function ($) {
+ // Used to shim jQuery.mousewheel for non-full builds.
+ return $;
+});
+
+S2.define('jquery.select2',[
+ 'jquery',
+ 'jquery-mousewheel',
+
+ './select2/core',
+ './select2/defaults'
+], function ($, _, Select2, Defaults) {
+ if ($.fn.selectWoo == null) {
+ // All methods that should return the element
+ var thisMethods = ['open', 'close', 'destroy'];
+
+ $.fn.selectWoo = function (options) {
+ options = options || {};
+
+ if (typeof options === 'object') {
+ this.each(function () {
+ var instanceOptions = $.extend(true, {}, options);
+
+ var instance = new Select2($(this), instanceOptions);
+ });
+
+ return this;
+ } else if (typeof options === 'string') {
+ var ret;
+ var args = Array.prototype.slice.call(arguments, 1);
+
+ this.each(function () {
+ var instance = $(this).data('select2');
+
+ if (instance == null && window.console && console.error) {
+ console.error(
+ 'The select2(\'' + options + '\') method was called on an ' +
+ 'element that is not using Select2.'
+ );
+ }
+
+ ret = instance[options].apply(instance, args);
+ });
+
+ // Check if we should be returning `this`
+ if ($.inArray(options, thisMethods) > -1) {
+ return this;
+ }
+
+ return ret;
+ } else {
+ throw new Error('Invalid arguments for Select2: ' + options);
+ }
+ };
+ }
+
+ if ($.fn.select2 != null && $.fn.select2.defaults != null) {
+ $.fn.selectWoo.defaults = $.fn.select2.defaults;
+ }
+
+ if ($.fn.selectWoo.defaults == null) {
+ $.fn.selectWoo.defaults = Defaults;
+ }
+
+ // Also register selectWoo under select2 if select2 is not already present.
+ $.fn.select2 = $.fn.select2 || $.fn.selectWoo;
+
+ return Select2;
+});
+
+ // Return the AMD loader configuration so it can be used outside of this file
+ return {
+ define: S2.define,
+ require: S2.require
+ };
+}());
+
+ // Autoload the jQuery bindings
+ // We know that all of the modules exist above this, so we're safe
+ var select2 = S2.require('jquery.select2');
+
+ // Hold the AMD module references on the jQuery function that was just loaded
+ // This allows Select2 to use the internal loader outside of this file, such
+ // as in the language files.
+ jQuery.fn.select2.amd = S2;
+ jQuery.fn.selectWoo.amd = S2;
+
+ // Return the Select2 instance for anyone who is importing it.
+ return select2;
+}));
diff --git a/assets/kirki/assets/vendor/selectWoo/js/selectWoo.min.js b/assets/kirki/assets/vendor/selectWoo/js/selectWoo.min.js
new file mode 100644
index 0000000..bf9600c
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/js/selectWoo.min.js
@@ -0,0 +1 @@
+/*! Select2 1.0.1 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(b,c){return void 0===c&&(c="undefined"!=typeof window?require("jquery"):require("jquery")(b)),a(c),c}:a(jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return v.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n,o=b&&b.split("/"),p=t.map,q=p&&p["*"]||{};if(a){for(a=a.split("/"),g=a.length-1,t.nodeIdCompat&&x.test(a[g])&&(a[g]=a[g].replace(x,"")),"."===a[0].charAt(0)&&o&&(n=o.slice(0,o.length-1),a=n.concat(a)),k=0;k0&&(a.splice(k-1,2),k-=2)}a=a.join("/")}if((o||q)&&p){for(c=a.split("/"),k=c.length;k>0;k-=1){if(d=c.slice(0,k).join("/"),o)for(l=o.length;l>0;l-=1)if((e=p[o.slice(0,l).join("/")])&&(e=e[d])){f=e,h=k;break}if(f)break;!i&&q&&q[d]&&(i=q[d],j=k)}!f&&i&&(f=i,h=j),f&&(c.splice(0,h,f),a=c.join("/"))}return a}function g(a,c){return function(){var d=w.call(arguments,0);return"string"!=typeof d[0]&&1===d.length&&d.push(null),o.apply(b,d.concat([a,c]))}}function h(a){return function(b){return f(b,a)}}function i(a){return function(b){r[a]=b}}function j(a){if(e(s,a)){var c=s[a];delete s[a],u[a]=!0,n.apply(b,c)}if(!e(r,a)&&!e(u,a))throw new Error("No "+a);return r[a]}function k(a){var b,c=a?a.indexOf("!"):-1;return c>-1&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function l(a){return a?k(a):[]}function m(a){return function(){return t&&t.config&&t.config[a]||{}}}var n,o,p,q,r={},s={},t={},u={},v=Object.prototype.hasOwnProperty,w=[].slice,x=/\.js$/;p=function(a,b){var c,d=k(a),e=d[0],g=b[1];return a=d[1],e&&(e=f(e,g),c=j(e)),e?a=c&&c.normalize?c.normalize(a,h(g)):f(a,g):(a=f(a,g),d=k(a),e=d[0],a=d[1],e&&(c=j(e))),{f:e?e+"!"+a:a,n:a,pr:e,p:c}},q={require:function(a){return g(a)},exports:function(a){var b=r[a];return void 0!==b?b:r[a]={}},module:function(a){return{id:a,uri:"",exports:r[a],config:m(a)}}},n=function(a,c,d,f){var h,k,m,n,o,t,v,w=[],x=typeof d;if(f=f||a,t=l(f),"undefined"===x||"function"===x){for(c=!c.length&&d.length?["require","exports","module"]:c,o=0;o0&&(b.call(arguments,a.prototype.constructor),e=c.prototype.constructor),e.apply(this,arguments)}function e(){this.constructor=d}var f=b(c),g=b(a);c.displayName=a.displayName,d.prototype=new e;for(var h=0;h":">",'"':""","'":"'","/":"/"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})},c.appendMany=function(b,c){if("1.7"===a.fn.jquery.substr(0,3)){var d=a();a.map(c,function(a){d=d.add(a)}),c=d}b.append(c)},c.isTouchscreen=function(){return void 0===c._isTouchscreenCache&&(c._isTouchscreenCache="ontouchstart"in document.documentElement),c._isTouchscreenCache},c}),b.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,d){this.$element=a,this.data=d,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b,b},c.prototype.clear=function(){this.$results.empty()},c.prototype.displayMessage=function(b){var c=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var d=a(' '),e=this.options.get("translations").get(b.message);d.append(c(e(b.args))),d[0].className+=" select2-results__message",this.$results.append(d)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null==a.results||0===a.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));a.results=this.sort(a.results);for(var c=0;c0?b.first().trigger("mouseenter"):a.first().trigger("mouseenter"),this.ensureHighlightVisible()},c.prototype.setClasses=function(){var b=this;this.data.current(function(c){var d=a.map(c,function(a){return a.id.toString()});b.$results.find(".select2-results__option[data-selected]").each(function(){var b=a(this),c=a.data(this,"data"),e=""+c.id;null!=c.element&&c.element.selected||null==c.element&&a.inArray(e,d)>-1?b.attr("data-selected","true"):b.attr("data-selected","false")})})},c.prototype.showLoading=function(a){this.hideLoading();var b=this.options.get("translations").get("searching"),c={disabled:!0,loading:!0,text:b(a)},d=this.option(c);d.className+=" loading-results",this.$results.prepend(d)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(b){var c=document.createElement("li");c.className="select2-results__option";var d={role:"option","data-selected":"false",tabindex:-1};b.disabled&&(delete d["data-selected"],d["aria-disabled"]="true"),null==b.id&&delete d["data-selected"],null!=b._resultId&&(c.id=b._resultId),b.title&&(c.title=b.title),b.children&&(d["aria-label"]=b.text,delete d["data-selected"]);for(var e in d){var f=d[e];c.setAttribute(e,f)}if(b.children){var g=a(c),h=document.createElement("strong");h.className="select2-results__group";var i=a(h);this.template(b,h),i.attr("role","presentation");for(var j=[],k=0;k",{class:"select2-results__options select2-results__options--nested",role:"listbox"});n.append(j),g.attr("role","list"),g.append(h),g.append(n)}else this.template(b,c);return a.data(c,"data",b),c},c.prototype.bind=function(b,c){var d=this,e=b.id+"-results";this.$results.attr("id",e),b.on("results:all",function(a){d.clear(),d.append(a.data),b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("results:append",function(a){d.append(a.data),b.isOpen()&&d.setClasses()}),b.on("query",function(a){d.hideMessages(),d.showLoading(a)}),b.on("select",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("unselect",function(){b.isOpen()&&(d.setClasses(),d.highlightFirstItem())}),b.on("open",function(){d.$results.attr("aria-expanded","true"),d.$results.attr("aria-hidden","false"),d.setClasses(),d.ensureHighlightVisible()}),b.on("close",function(){d.$results.attr("aria-expanded","false"),d.$results.attr("aria-hidden","true"),d.$results.removeAttr("aria-activedescendant")}),b.on("results:toggle",function(){var a=d.getHighlightedResults();0!==a.length&&a.trigger("mouseup")}),b.on("results:select",function(){var a=d.getHighlightedResults();if(0!==a.length){var b=a.data("data");"true"==a.attr("data-selected")?d.trigger("close",{}):d.trigger("select",{data:b})}}),b.on("results:previous",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a);if(0!==c){var e=c-1;0===a.length&&(e=0);var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top,h=f.offset().top,i=d.$results.scrollTop()+(h-g);0===e?d.$results.scrollTop(0):h-g<0&&d.$results.scrollTop(i)}}),b.on("results:next",function(){var a=d.getHighlightedResults(),b=d.$results.find("[data-selected]"),c=b.index(a),e=c+1;if(!(e>=b.length)){var f=b.eq(e);f.trigger("mouseenter");var g=d.$results.offset().top+d.$results.outerHeight(!1),h=f.offset().top+f.outerHeight(!1),i=d.$results.scrollTop()+h-g;0===e?d.$results.scrollTop(0):h>g&&d.$results.scrollTop(i)}}),b.on("results:focus",function(a){a.element.addClass("select2-results__option--highlighted").attr("aria-selected","true"),d.$results.attr("aria-activedescendant",a.element.attr("id"))}),b.on("results:message",function(a){d.displayMessage(a)}),a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=d.$results.scrollTop(),c=d.$results.get(0).scrollHeight-b+a.deltaY,e=a.deltaY>0&&b-a.deltaY<=0,f=a.deltaY<0&&c<=d.$results.height();e?(d.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):f&&(d.$results.scrollTop(d.$results.get(0).scrollHeight-d.$results.height()),a.preventDefault(),a.stopPropagation())}),this.$results.on("mouseup",".select2-results__option[data-selected]",function(b){var c=a(this),e=c.data("data");if("true"===c.attr("data-selected"))return void(d.options.get("multiple")?d.trigger("unselect",{originalEvent:b,data:e}):d.trigger("close",{}));d.trigger("select",{originalEvent:b,data:e})}),this.$results.on("mouseenter",".select2-results__option[data-selected]",function(b){var c=a(this).data("data");d.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false"),d.trigger("results:focus",{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a=this.getHighlightedResults();if(0!==a.length){var b=this.$results.find("[data-selected]"),c=b.index(a),d=this.$results.offset().top,e=a.offset().top,f=this.$results.scrollTop()+(e-d),g=e-d;f-=2*a.outerHeight(!1),c<=2?this.$results.scrollTop(0):(g>this.$results.outerHeight()||g<0)&&this.$results.scrollTop(f)}},c.prototype.template=function(b,c){var d=this.options.get("templateResult"),e=this.options.get("escapeMarkup"),f=d(b,c);null==f?c.style.display="none":"string"==typeof f?c.innerHTML=e(f):a(c).append(f)},c}),b.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),b.define("select2/selection/base",["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var b=a(' ');return this._tabindex=0,null!=this.$element.data("old-tabindex")?this._tabindex=this.$element.data("old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),b.attr("title",this.$element.attr("title")),b.attr("tabindex",this._tabindex),this.$selection=b,b},d.prototype.bind=function(a,b){var d=this,e=(a.id,a.id+"-results");this.options.get("minimumResultsForSearch");this.container=a,this.$selection.on("focus",function(a){d.trigger("focus",a)}),this.$selection.on("blur",function(a){d._handleBlur(a)}),this.$selection.on("keydown",function(a){d.trigger("keypress",a),a.which===c.SPACE&&a.preventDefault()}),a.on("results:focus",function(a){d.$selection.attr("aria-activedescendant",a.data._resultId)}),a.on("selection:update",function(a){d.update(a.data)}),a.on("open",function(){d.$selection.attr("aria-expanded","true"),d.$selection.attr("aria-owns",e),d._attachCloseHandler(a)}),a.on("close",function(){d.$selection.attr("aria-expanded","false"),d.$selection.removeAttr("aria-activedescendant"),d.$selection.removeAttr("aria-owns"),window.setTimeout(function(){d.$selection.focus()},1),d._detachCloseHandler(a)}),a.on("enable",function(){d.$selection.attr("tabindex",d._tabindex)}),a.on("disable",function(){d.$selection.attr("tabindex","-1")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(b){a(document.body).on("mousedown.select2."+b.id,function(b){var c=a(b.target),d=c.closest(".select2");a(".select2.select2-container--open").each(function(){var b=a(this);this!=d[0]&&b.data("element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw new Error("The `update` method must be defined in child classes.")},d}),b.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function e(){e.__super__.constructor.apply(this,arguments)}return c.Extend(e,b),e.prototype.render=function(){var a=e.__super__.render.call(this);return a.addClass("select2-selection--single"),a.html(' '),a},e.prototype.bind=function(a,b){var c=this;e.__super__.bind.apply(this,arguments);var d=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",d).attr("role","textbox").attr("aria-readonly","true"),this.$selection.attr("aria-labelledby",d),this.$selection.attr("role","combobox"),this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})}),this.$selection.on("focus",function(a){}),this.$selection.on("keydown",function(b){!a.isOpen()&&b.which>=48&&b.which<=90&&a.open()}),this.$selection.on("blur",function(a){}),a.on("focus",function(b){a.isOpen()||c.$selection.focus()}),a.on("selection:update",function(a){c.update(a.data)})},e.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},e.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},e.prototype.selectionContainer=function(){return a(" ")},e.prototype.update=function(a){if(0===a.length)return void this.clear();var b=a[0],c=this.$selection.find(".select2-selection__rendered"),d=this.display(b,c);c.empty().append(d),c.prop("title",b.title||b.text)},e}),b.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a.addClass("select2-selection--multiple"),a.html(''),a},d.prototype.bind=function(b,c){var e=this;d.__super__.bind.apply(this,arguments),this.$selection.on("click",function(a){e.trigger("toggle",{originalEvent:a})}),this.$selection.on("click",".select2-selection__choice__remove",function(b){if(!e.options.get("disabled")){var c=a(this),d=c.parent(),f=d.data("data");e.trigger("unselect",{originalEvent:b,data:f})}})},d.prototype.clear=function(){this.$selection.find(".select2-selection__rendered").empty()},d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('× ')},d.prototype.update=function(a){var b=this;if(this.clear(),0!==a.length){for(var d=[],e=0;e1||c)return a.call(this,b);this.clear();var d=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(d)},b}),b.define("select2/selection/allowClear",["jquery","../keys"],function(a,b){function c(){}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c),null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option."),this.$selection.on("mousedown",".select2-selection__clear",function(a){d._handleClear(a)}),b.on("keypress",function(a){d._handleKeyboardClear(a,b)})},c.prototype._handleClear=function(a,b){if(!this.options.get("disabled")){var c=this.$selection.find(".select2-selection__clear");if(0!==c.length){b.stopPropagation();for(var d=c.data("data"),e=0;e0||0===c.length)){var d=a('× ');d.data("data",c),this.$selection.find(".select2-selection__rendered").prepend(d)}},c}),b.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=a(' ');this.$searchContainer=c,this.$search=c.find("input");var d=b.call(this);return this._transferTabIndex(),d},d.prototype.bind=function(a,b,d){var e=this,f=b.id+"-results";a.call(this,b,d),b.on("open",function(){e.$search.attr("aria-owns",f),e.$search.trigger("focus")}),b.on("close",function(){e.$search.val(""),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.trigger("focus")}),b.on("enable",function(){e.$search.prop("disabled",!1),e._transferTabIndex()}),b.on("disable",function(){e.$search.prop("disabled",!0)}),b.on("focus",function(a){e.$search.trigger("focus")}),b.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)}),this.$selection.on("focusin",".select2-search--inline",function(a){e.trigger("focus",a)}),this.$selection.on("focusout",".select2-search--inline",function(a){e._handleBlur(a)}),this.$selection.on("keydown",".select2-search--inline",function(a){if(a.stopPropagation(),e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented(),a.which===c.BACKSPACE&&""===e.$search.val()){var b=e.$searchContainer.prev(".select2-selection__choice");if(b.length>0){var d=b.data("data");e.searchRemoveChoice(d),a.preventDefault()}}});var g=document.documentMode,h=g&&g<=11;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){if(h)return void e.$selection.off("input.search input.searchcheck");e.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){if(h&&"input"===a.type)return void e.$selection.off("input.search input.searchcheck");var b=a.which;b!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&e.handleSearch(a)})},d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),a.call(this,b),this.$selection.find(".select2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),c&&this.$search.focus()},d.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var a=this.$search.val();this.trigger("query",{term:a})}this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b}),this.$search.val(b.text),this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="";if(""!==this.$search.attr("placeholder"))a=this.$selection.find(".select2-selection__rendered").innerWidth();else{a=.75*(this.$search.val().length+1)+"em"}this.$search.css("width",a)},d}),b.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,d){var e=this,f=["open","opening","close","closing","select","selecting","unselect","unselecting"],g=["opening","closing","selecting","unselecting"];b.call(this,c,d),c.on("*",function(b,c){if(-1!==a.inArray(b,f)){c=c||{};var d=a.Event("select2:"+b,{params:c});e.$element.trigger(d),-1!==a.inArray(b,g)&&(c.prevented=d.isDefaultPrevented())}})},b}),b.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){if(!(a in c._cache)){var d=b(a);c._cache[a]=d}return new c(c._cache[a])},c}),b.define("select2/diacritics",[],function(){return{"Ⓐ":"A","A":"A","À":"A","Á":"A","Â":"A","Ầ":"A","Ấ":"A","Ẫ":"A","Ẩ":"A","Ã":"A","Ā":"A","Ă":"A","Ằ":"A","Ắ":"A","Ẵ":"A","Ẳ":"A","Ȧ":"A","Ǡ":"A","Ä":"A","Ǟ":"A","Ả":"A","Å":"A","Ǻ":"A","Ǎ":"A","Ȁ":"A","Ȃ":"A","Ạ":"A","Ậ":"A","Ặ":"A","Ḁ":"A","Ą":"A","Ⱥ":"A","Ɐ":"A","Ꜳ":"AA","Æ":"AE","Ǽ":"AE","Ǣ":"AE","Ꜵ":"AO","Ꜷ":"AU","Ꜹ":"AV","Ꜻ":"AV","Ꜽ":"AY","Ⓑ":"B","B":"B","Ḃ":"B","Ḅ":"B","Ḇ":"B","Ƀ":"B","Ƃ":"B","Ɓ":"B","Ⓒ":"C","C":"C","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","Ç":"C","Ḉ":"C","Ƈ":"C","Ȼ":"C","Ꜿ":"C","Ⓓ":"D","D":"D","Ḋ":"D","Ď":"D","Ḍ":"D","Ḑ":"D","Ḓ":"D","Ḏ":"D","Đ":"D","Ƌ":"D","Ɗ":"D","Ɖ":"D","Ꝺ":"D","DZ":"DZ","DŽ":"DZ","Dz":"Dz","Dž":"Dz","Ⓔ":"E","E":"E","È":"E","É":"E","Ê":"E","Ề":"E","Ế":"E","Ễ":"E","Ể":"E","Ẽ":"E","Ē":"E","Ḕ":"E","Ḗ":"E","Ĕ":"E","Ė":"E","Ë":"E","Ẻ":"E","Ě":"E","Ȅ":"E","Ȇ":"E","Ẹ":"E","Ệ":"E","Ȩ":"E","Ḝ":"E","Ę":"E","Ḙ":"E","Ḛ":"E","Ɛ":"E","Ǝ":"E","Ⓕ":"F","F":"F","Ḟ":"F","Ƒ":"F","Ꝼ":"F","Ⓖ":"G","G":"G","Ǵ":"G","Ĝ":"G","Ḡ":"G","Ğ":"G","Ġ":"G","Ǧ":"G","Ģ":"G","Ǥ":"G","Ɠ":"G","Ꞡ":"G","Ᵹ":"G","Ꝿ":"G","Ⓗ":"H","H":"H","Ĥ":"H","Ḣ":"H","Ḧ":"H","Ȟ":"H","Ḥ":"H","Ḩ":"H","Ḫ":"H","Ħ":"H","Ⱨ":"H","Ⱶ":"H","Ɥ":"H","Ⓘ":"I","I":"I","Ì":"I","Í":"I","Î":"I","Ĩ":"I","Ī":"I","Ĭ":"I","İ":"I","Ï":"I","Ḯ":"I","Ỉ":"I","Ǐ":"I","Ȉ":"I","Ȋ":"I","Ị":"I","Į":"I","Ḭ":"I","Ɨ":"I","Ⓙ":"J","J":"J","Ĵ":"J","Ɉ":"J","Ⓚ":"K","K":"K","Ḱ":"K","Ǩ":"K","Ḳ":"K","Ķ":"K","Ḵ":"K","Ƙ":"K","Ⱪ":"K","Ꝁ":"K","Ꝃ":"K","Ꝅ":"K","Ꞣ":"K","Ⓛ":"L","L":"L","Ŀ":"L","Ĺ":"L","Ľ":"L","Ḷ":"L","Ḹ":"L","Ļ":"L","Ḽ":"L","Ḻ":"L","Ł":"L","Ƚ":"L","Ɫ":"L","Ⱡ":"L","Ꝉ":"L","Ꝇ":"L","Ꞁ":"L","LJ":"LJ","Lj":"Lj","Ⓜ":"M","M":"M","Ḿ":"M","Ṁ":"M","Ṃ":"M","Ɱ":"M","Ɯ":"M","Ⓝ":"N","N":"N","Ǹ":"N","Ń":"N","Ñ":"N","Ṅ":"N","Ň":"N","Ṇ":"N","Ņ":"N","Ṋ":"N","Ṉ":"N","Ƞ":"N","Ɲ":"N","Ꞑ":"N","Ꞥ":"N","NJ":"NJ","Nj":"Nj","Ⓞ":"O","O":"O","Ò":"O","Ó":"O","Ô":"O","Ồ":"O","Ố":"O","Ỗ":"O","Ổ":"O","Õ":"O","Ṍ":"O","Ȭ":"O","Ṏ":"O","Ō":"O","Ṑ":"O","Ṓ":"O","Ŏ":"O","Ȯ":"O","Ȱ":"O","Ö":"O","Ȫ":"O","Ỏ":"O","Ő":"O","Ǒ":"O","Ȍ":"O","Ȏ":"O","Ơ":"O","Ờ":"O","Ớ":"O","Ỡ":"O","Ở":"O","Ợ":"O","Ọ":"O","Ộ":"O","Ǫ":"O","Ǭ":"O","Ø":"O","Ǿ":"O","Ɔ":"O","Ɵ":"O","Ꝋ":"O","Ꝍ":"O","Ƣ":"OI","Ꝏ":"OO","Ȣ":"OU","Ⓟ":"P","P":"P","Ṕ":"P","Ṗ":"P","Ƥ":"P","Ᵽ":"P","Ꝑ":"P","Ꝓ":"P","Ꝕ":"P","Ⓠ":"Q","Q":"Q","Ꝗ":"Q","Ꝙ":"Q","Ɋ":"Q","Ⓡ":"R","R":"R","Ŕ":"R","Ṙ":"R","Ř":"R","Ȑ":"R","Ȓ":"R","Ṛ":"R","Ṝ":"R","Ŗ":"R","Ṟ":"R","Ɍ":"R","Ɽ":"R","Ꝛ":"R","Ꞧ":"R","Ꞃ":"R","Ⓢ":"S","S":"S","ẞ":"S","Ś":"S","Ṥ":"S","Ŝ":"S","Ṡ":"S","Š":"S","Ṧ":"S","Ṣ":"S","Ṩ":"S","Ș":"S","Ş":"S","Ȿ":"S","Ꞩ":"S","Ꞅ":"S","Ⓣ":"T","T":"T","Ṫ":"T","Ť":"T","Ṭ":"T","Ț":"T","Ţ":"T","Ṱ":"T","Ṯ":"T","Ŧ":"T","Ƭ":"T","Ʈ":"T","Ⱦ":"T","Ꞇ":"T","Ꜩ":"TZ","Ⓤ":"U","U":"U","Ù":"U","Ú":"U","Û":"U","Ũ":"U","Ṹ":"U","Ū":"U","Ṻ":"U","Ŭ":"U","Ü":"U","Ǜ":"U","Ǘ":"U","Ǖ":"U","Ǚ":"U","Ủ":"U","Ů":"U","Ű":"U","Ǔ":"U","Ȕ":"U","Ȗ":"U","Ư":"U","Ừ":"U","Ứ":"U","Ữ":"U","Ử":"U","Ự":"U","Ụ":"U","Ṳ":"U","Ų":"U","Ṷ":"U","Ṵ":"U","Ʉ":"U","Ⓥ":"V","V":"V","Ṽ":"V","Ṿ":"V","Ʋ":"V","Ꝟ":"V","Ʌ":"V","Ꝡ":"VY","Ⓦ":"W","W":"W","Ẁ":"W","Ẃ":"W","Ŵ":"W","Ẇ":"W","Ẅ":"W","Ẉ":"W","Ⱳ":"W","Ⓧ":"X","X":"X","Ẋ":"X","Ẍ":"X","Ⓨ":"Y","Y":"Y","Ỳ":"Y","Ý":"Y","Ŷ":"Y","Ỹ":"Y","Ȳ":"Y","Ẏ":"Y","Ÿ":"Y","Ỷ":"Y","Ỵ":"Y","Ƴ":"Y","Ɏ":"Y","Ỿ":"Y","Ⓩ":"Z","Z":"Z","Ź":"Z","Ẑ":"Z","Ż":"Z","Ž":"Z","Ẓ":"Z","Ẕ":"Z","Ƶ":"Z","Ȥ":"Z","Ɀ":"Z","Ⱬ":"Z","Ꝣ":"Z","ⓐ":"a","a":"a","ẚ":"a","à":"a","á":"a","â":"a","ầ":"a","ấ":"a","ẫ":"a","ẩ":"a","ã":"a","ā":"a","ă":"a","ằ":"a","ắ":"a","ẵ":"a","ẳ":"a","ȧ":"a","ǡ":"a","ä":"a","ǟ":"a","ả":"a","å":"a","ǻ":"a","ǎ":"a","ȁ":"a","ȃ":"a","ạ":"a","ậ":"a","ặ":"a","ḁ":"a","ą":"a","ⱥ":"a","ɐ":"a","ꜳ":"aa","æ":"ae","ǽ":"ae","ǣ":"ae","ꜵ":"ao","ꜷ":"au","ꜹ":"av","ꜻ":"av","ꜽ":"ay","ⓑ":"b","b":"b","ḃ":"b","ḅ":"b","ḇ":"b","ƀ":"b","ƃ":"b","ɓ":"b","ⓒ":"c","c":"c","ć":"c","ĉ":"c","ċ":"c","č":"c","ç":"c","ḉ":"c","ƈ":"c","ȼ":"c","ꜿ":"c","ↄ":"c","ⓓ":"d","d":"d","ḋ":"d","ď":"d","ḍ":"d","ḑ":"d","ḓ":"d","ḏ":"d","đ":"d","ƌ":"d","ɖ":"d","ɗ":"d","ꝺ":"d","dz":"dz","dž":"dz","ⓔ":"e","e":"e","è":"e","é":"e","ê":"e","ề":"e","ế":"e","ễ":"e","ể":"e","ẽ":"e","ē":"e","ḕ":"e","ḗ":"e","ĕ":"e","ė":"e","ë":"e","ẻ":"e","ě":"e","ȅ":"e","ȇ":"e","ẹ":"e","ệ":"e","ȩ":"e","ḝ":"e","ę":"e","ḙ":"e","ḛ":"e","ɇ":"e","ɛ":"e","ǝ":"e","ⓕ":"f","f":"f","ḟ":"f","ƒ":"f","ꝼ":"f","ⓖ":"g","g":"g","ǵ":"g","ĝ":"g","ḡ":"g","ğ":"g","ġ":"g","ǧ":"g","ģ":"g","ǥ":"g","ɠ":"g","ꞡ":"g","ᵹ":"g","ꝿ":"g","ⓗ":"h","h":"h","ĥ":"h","ḣ":"h","ḧ":"h","ȟ":"h","ḥ":"h","ḩ":"h","ḫ":"h","ẖ":"h","ħ":"h","ⱨ":"h","ⱶ":"h","ɥ":"h","ƕ":"hv","ⓘ":"i","i":"i","ì":"i","í":"i","î":"i","ĩ":"i","ī":"i","ĭ":"i","ï":"i","ḯ":"i","ỉ":"i","ǐ":"i","ȉ":"i","ȋ":"i","ị":"i","į":"i","ḭ":"i","ɨ":"i","ı":"i","ⓙ":"j","j":"j","ĵ":"j","ǰ":"j","ɉ":"j","ⓚ":"k","k":"k","ḱ":"k","ǩ":"k","ḳ":"k","ķ":"k","ḵ":"k","ƙ":"k","ⱪ":"k","ꝁ":"k","ꝃ":"k","ꝅ":"k","ꞣ":"k","ⓛ":"l","l":"l","ŀ":"l","ĺ":"l","ľ":"l","ḷ":"l","ḹ":"l","ļ":"l","ḽ":"l","ḻ":"l","ſ":"l","ł":"l","ƚ":"l","ɫ":"l","ⱡ":"l","ꝉ":"l","ꞁ":"l","ꝇ":"l","lj":"lj","ⓜ":"m","m":"m","ḿ":"m","ṁ":"m","ṃ":"m","ɱ":"m","ɯ":"m","ⓝ":"n","n":"n","ǹ":"n","ń":"n","ñ":"n","ṅ":"n","ň":"n","ṇ":"n","ņ":"n","ṋ":"n","ṉ":"n","ƞ":"n","ɲ":"n","ʼn":"n","ꞑ":"n","ꞥ":"n","nj":"nj","ⓞ":"o","o":"o","ò":"o","ó":"o","ô":"o","ồ":"o","ố":"o","ỗ":"o","ổ":"o","õ":"o","ṍ":"o","ȭ":"o","ṏ":"o","ō":"o","ṑ":"o","ṓ":"o","ŏ":"o","ȯ":"o","ȱ":"o","ö":"o","ȫ":"o","ỏ":"o","ő":"o","ǒ":"o","ȍ":"o","ȏ":"o","ơ":"o","ờ":"o","ớ":"o","ỡ":"o","ở":"o","ợ":"o","ọ":"o","ộ":"o","ǫ":"o","ǭ":"o","ø":"o","ǿ":"o","ɔ":"o","ꝋ":"o","ꝍ":"o","ɵ":"o","ƣ":"oi","ȣ":"ou","ꝏ":"oo","ⓟ":"p","p":"p","ṕ":"p","ṗ":"p","ƥ":"p","ᵽ":"p","ꝑ":"p","ꝓ":"p","ꝕ":"p","ⓠ":"q","q":"q","ɋ":"q","ꝗ":"q","ꝙ":"q","ⓡ":"r","r":"r","ŕ":"r","ṙ":"r","ř":"r","ȑ":"r","ȓ":"r","ṛ":"r","ṝ":"r","ŗ":"r","ṟ":"r","ɍ":"r","ɽ":"r","ꝛ":"r","ꞧ":"r","ꞃ":"r","ⓢ":"s","s":"s","ß":"s","ś":"s","ṥ":"s","ŝ":"s","ṡ":"s","š":"s","ṧ":"s","ṣ":"s","ṩ":"s","ș":"s","ş":"s","ȿ":"s","ꞩ":"s","ꞅ":"s","ẛ":"s","ⓣ":"t","t":"t","ṫ":"t","ẗ":"t","ť":"t","ṭ":"t","ț":"t","ţ":"t","ṱ":"t","ṯ":"t","ŧ":"t","ƭ":"t","ʈ":"t","ⱦ":"t","ꞇ":"t","ꜩ":"tz","ⓤ":"u","u":"u","ù":"u","ú":"u","û":"u","ũ":"u","ṹ":"u","ū":"u","ṻ":"u","ŭ":"u","ü":"u","ǜ":"u","ǘ":"u","ǖ":"u","ǚ":"u","ủ":"u","ů":"u","ű":"u","ǔ":"u","ȕ":"u","ȗ":"u","ư":"u","ừ":"u","ứ":"u","ữ":"u","ử":"u","ự":"u","ụ":"u","ṳ":"u","ų":"u","ṷ":"u","ṵ":"u","ʉ":"u","ⓥ":"v","v":"v","ṽ":"v","ṿ":"v","ʋ":"v","ꝟ":"v","ʌ":"v","ꝡ":"vy","ⓦ":"w","w":"w","ẁ":"w","ẃ":"w","ŵ":"w","ẇ":"w","ẅ":"w","ẘ":"w","ẉ":"w","ⱳ":"w","ⓧ":"x","x":"x","ẋ":"x","ẍ":"x","ⓨ":"y","y":"y","ỳ":"y","ý":"y","ŷ":"y","ỹ":"y","ȳ":"y","ẏ":"y","ÿ":"y","ỷ":"y","ẙ":"y","ỵ":"y","ƴ":"y","ɏ":"y","ỿ":"y","ⓩ":"z","z":"z","ź":"z","ẑ":"z","ż":"z","ž":"z","ẓ":"z","ẕ":"z","ƶ":"z","ȥ":"z","ɀ":"z","ⱬ":"z","ꝣ":"z","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"}}),b.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw new Error("The `current` method must be defined in child classes.")},b.prototype.query=function(a,b){throw new Error("The `query` method must be defined in child classes.")},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){var d="";return d+=null!=b?b.id:a.generateChars(4),d+="-result-",d+=a.generateChars(4),null!=c.id?d+="-"+c.id.toString():d+="-"+a.generateChars(4),d},b}),b.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a,this.options=b,d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=[],d=this;this.$element.find(":selected").each(function(){var a=c(this),e=d.item(a);b.push(e)}),a(b)},d.prototype.select=function(a){var b=this;if(a.selected=!0,c(a.element).is("option"))return a.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(d){var e=[];a=[a],a.push.apply(a,d);for(var f=0;f=0){var k=f.filter(d(j)),l=this.item(k),m=c.extend(!0,{},j,l),n=this.option(m);k.replaceWith(n)}else{var o=this.option(j);if(j.children){var p=this.convertToOptions(j.children);b.appendMany(o,p)}h.push(o)}}return h},d}),b.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){var b={data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,b,d){var e=c.ajax(a);return e.then(b),e.fail(d),e}};return c.extend({},b,a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var d=f.transport(f,function(d){var f=e.processResults(d,a);e.options.get("debug")&&window.console&&console.error&&(f&&f.results&&c.isArray(f.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),b(f),e.container.focusOnActiveElement()},function(){d.status&&"0"===d.status||e.trigger("results:message",{message:"errorLoading"})});e._request=d}var e=this;null!=this._request&&(c.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var f=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof f.url&&(f.url=f.url.call(this.$element,a)),"function"==typeof f.data&&(f.data=f.data.call(this.$element,a)),this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),b.define("select2/data/tags",["jquery"],function(a){function b(b,c,d){var e=d.get("tags"),f=d.get("createTag");void 0!==f&&(this.createTag=f);var g=d.get("insertTag");if(void 0!==g&&(this.insertTag=g),b.call(this,c,d),a.isArray(e))for(var h=0;h0&&b.term.length>this.maximumInputLength)return void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}});a.call(this,b,c)},a}),b.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength"),a.call(this,b,c)}return a.prototype.query=function(a,b,c){var d=this;this.current(function(e){var f=null!=e?e.length:0;if(d.maximumSelectionLength>0&&f>=d.maximumSelectionLength)return void d.trigger("results:message",{message:"maximumSelected",args:{maximum:d.maximumSelectionLength}});a.call(d,b,c)})},a}),b.define("select2/dropdown",["jquery","./utils"],function(a,b){function c(a,b){this.$element=a,this.options=b,c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$dropdown=b,b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),b.define("select2/dropdown/search",["jquery","../utils"],function(a,b){function c(){}return c.prototype.render=function(b){var c=b.call(this),d=a(' ');return this.$searchContainer=d,this.$search=d.find("input"),c.prepend(d),c},c.prototype.bind=function(b,c,d){var e=this,f=c.id+"-results";b.call(this,c,d),this.$search.on("keydown",function(a){e.trigger("keypress",a),e._keyUpPrevented=a.isDefaultPrevented()}),this.$search.on("input",function(b){a(this).off("keyup")}),this.$search.on("keyup input",function(a){e.handleSearch(a)}),c.on("open",function(){e.$search.attr("tabindex",0),e.$search.attr("aria-owns",f),e.$search.focus(),window.setTimeout(function(){e.$search.focus()},0)}),c.on("close",function(){e.$search.attr("tabindex",-1),e.$search.removeAttr("aria-activedescendant"),e.$search.removeAttr("aria-owns"),e.$search.val("")}),c.on("focus",function(){c.isOpen()&&e.$search.focus()}),c.on("results:all",function(a){if(null==a.query.term||""===a.query.term){e.showSearch(a)?e.$searchContainer.removeClass("select2-search--hide"):e.$searchContainer.addClass("select2-search--hide")}}),c.on("results:focus",function(a){e.$search.attr("aria-activedescendant",a.data._resultId)})},c.prototype.handleSearch=function(a){if(!this._keyUpPrevented){var b=this.$search.val();this.trigger("query",{term:b})}this._keyUpPrevented=!1},c.prototype.showSearch=function(a,b){return!0},c}),b.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder")),a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=this.removePlaceholder(b.results),a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b&&(b={id:"",text:b}),b},a.prototype.removePlaceholder=function(a,b){for(var c=b.slice(0),d=b.length-1;d>=0;d--){var e=b[d];this.placeholder.id===e.id&&c.splice(d,1)}return c},a}),b.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={},a.call(this,b,c,d),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return b.prototype.append=function(a,b){this.$loadingMore.remove(),this.loading=!1,a.call(this,b),this.showLoadingMore(b)&&this.$results.append(this.$loadingMore)},b.prototype.bind=function(b,c,d){var e=this;b.call(this,c,d),c.on("query",function(a){e.lastParams=a,e.loading=!0}),c.on("query:append",function(a){e.lastParams=a,e.loading=!0}),this.$results.on("scroll",function(){var b=a.contains(document.documentElement,e.$loadingMore[0]);if(!e.loading&&b){e.$results.offset().top+e.$results.outerHeight(!1)+50>=e.$loadingMore.offset().top+e.$loadingMore.outerHeight(!1)&&e.loadMore()}})},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++,this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a(' '),c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),b.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=d.get("dropdownParent")||a(document.body),b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this,e=!1;a.call(this,b,c),b.on("open",function(){d._showDropdown(),d._attachPositioningHandler(b),e||(e=!0,b.on("results:all",function(){d._positionDropdown(),d._resizeDropdown()}),b.on("results:append",function(){d._positionDropdown(),d._resizeDropdown()}))}),b.on("close",function(){d._hideDropdown(),d._detachPositioningHandler(b)}),this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this),this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class")),b.removeClass("select2"),b.addClass("select2-container--open"),b.css({position:"absolute",top:-999999}),this.$container=c},c.prototype.render=function(b){var c=a(" "),d=b.call(this);return c.append(d),this.$dropdownContainer=c,c},c.prototype._hideDropdown=function(a){this.$dropdownContainer.detach()},c.prototype._attachPositioningHandler=function(c,d){var e=this,f="scroll.select2."+d.id,g="resize.select2."+d.id,h="orientationchange.select2."+d.id,i=this.$container.parents().filter(b.hasScroll);i.each(function(){a(this).data("select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})}),i.on(f,function(b){var c=a(this).data("select2-scroll-position");a(this).scrollTop(c.y)}),a(window).on(f+" "+g+" "+h,function(a){e._positionDropdown(),e._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){var e="scroll.select2."+d.id,f="resize.select2."+d.id,g="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(e),a(window).off(e+" "+f+" "+g)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown.hasClass("select2-dropdown--above"),d=this.$dropdown.hasClass("select2-dropdown--below"),e=null,f=this.$container.offset();f.bottom=f.top+this.$container.outerHeight(!1);var g={height:this.$container.outerHeight(!1)};g.top=f.top,g.bottom=f.top+g.height;var h={height:this.$dropdown.outerHeight(!1)},i={top:b.scrollTop(),bottom:b.scrollTop()+b.height()},j=i.topf.bottom+h.height,l={left:f.left,top:g.bottom},m=this.$dropdownParent;"static"===m.css("position")&&(m=m.offsetParent());var n=m.offset();l.top-=n.top,l.left-=n.left,c||d||(e="below"),k||!j||c?!j&&k&&c&&(e="below"):e="above",("above"==e||c&&"below"!==e)&&(l.top=g.top-n.top-h.height),null!=e&&(this.$dropdown.removeClass("select2-dropdown--below select2-dropdown--above").addClass("select2-dropdown--"+e),this.$container.removeClass("select2-container--below select2-container--above").addClass("select2-container--"+e)),this.$dropdownContainer.css(l)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",a.width="auto"),this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},c}),b.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(b){for(var c=0,d=0;d0&&(l.dataAdapter=j.Decorate(l.dataAdapter,r)),l.maximumInputLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,s)),l.maximumSelectionLength>0&&(l.dataAdapter=j.Decorate(l.dataAdapter,t)),l.tags&&(l.dataAdapter=j.Decorate(l.dataAdapter,p)),null==l.tokenSeparators&&null==l.tokenizer||(l.dataAdapter=j.Decorate(l.dataAdapter,q)),null!=l.query){var C=b(l.amdBase+"compat/query");l.dataAdapter=j.Decorate(l.dataAdapter,C)}if(null!=l.initSelection){var D=b(l.amdBase+"compat/initSelection");l.dataAdapter=j.Decorate(l.dataAdapter,D)}}if(null==l.resultsAdapter&&(l.resultsAdapter=c,null!=l.ajax&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,x)),null!=l.placeholder&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,w)),l.selectOnClose&&(l.resultsAdapter=j.Decorate(l.resultsAdapter,A))),null==l.dropdownAdapter){if(l.multiple)l.dropdownAdapter=u;else{var E=j.Decorate(u,v);l.dropdownAdapter=E}if(0!==l.minimumResultsForSearch&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,z)),l.closeOnSelect&&(l.dropdownAdapter=j.Decorate(l.dropdownAdapter,B)),null!=l.dropdownCssClass||null!=l.dropdownCss||null!=l.adaptDropdownCssClass){var F=b(l.amdBase+"compat/dropdownCss");l.dropdownAdapter=j.Decorate(l.dropdownAdapter,F)}l.dropdownAdapter=j.Decorate(l.dropdownAdapter,y)}if(null==l.selectionAdapter){if(l.multiple?l.selectionAdapter=e:l.selectionAdapter=d,null!=l.placeholder&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,f)),l.allowClear&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,g)),l.multiple&&(l.selectionAdapter=j.Decorate(l.selectionAdapter,h)),null!=l.containerCssClass||null!=l.containerCss||null!=l.adaptContainerCssClass){var G=b(l.amdBase+"compat/containerCss");l.selectionAdapter=j.Decorate(l.selectionAdapter,G)}l.selectionAdapter=j.Decorate(l.selectionAdapter,i)}if("string"==typeof l.language)if(l.language.indexOf("-")>0){var H=l.language.split("-"),I=H[0];l.language=[l.language,I]}else l.language=[l.language];if(a.isArray(l.language)){var J=new k;l.language.push("en");for(var K=l.language,L=0;L0){for(var f=a.extend(!0,{},e),g=e.children.length-1;g>=0;g--){null==c(d,e.children[g])&&f.children.splice(g,1)}return f.children.length>0?f:c(d,f)}var h=b(e.text).toUpperCase(),i=b(d.term).toUpperCase();return h.indexOf(i)>-1?e:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:j.escapeMarkup,language:C,matcher:c,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},D.prototype.set=function(b,c){var d=a.camelCase(b),e={};e[d]=c;var f=j._convertData(e);a.extend(this.defaults,f)},new D}),b.define("select2/options",["require","jquery","./defaults","./utils"],function(a,b,c,d){function e(b,e){if(this.options=b,null!=e&&this.fromElement(e),this.options=c.apply(this.options),e&&e.is("input")){var f=a(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=d.Decorate(this.options.dataAdapter,f)}}return e.prototype.fromElement=function(a){var c=["select2"];null==this.options.multiple&&(this.options.multiple=a.prop("multiple")),null==this.options.disabled&&(this.options.disabled=a.prop("disabled")),null==this.options.language&&(a.prop("lang")?this.options.language=a.prop("lang").toLowerCase():a.closest("[lang]").prop("lang")&&(this.options.language=a.closest("[lang]").prop("lang"))),null==this.options.dir&&(a.prop("dir")?this.options.dir=a.prop("dir"):a.closest("[dir]").prop("dir")?this.options.dir=a.closest("[dir]").prop("dir"):this.options.dir="ltr"),a.prop("disabled",this.options.disabled),a.prop("multiple",this.options.multiple),a.data("select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),a.data("data",a.data("select2Tags")),a.data("tags",!0)),a.data("ajaxUrl")&&(this.options.debug&&window.console&&console.warn&&console.warn("Select2: The `data-ajax-url` attribute has been changed to `data-ajax--url` and support for the old attribute will be removed in future versions of Select2."),a.attr("ajax--url",a.data("ajaxUrl")),a.data("ajax--url",a.data("ajaxUrl")));var e={};e=b.fn.jquery&&"1."==b.fn.jquery.substr(0,2)&&a[0].dataset?b.extend(!0,{},a[0].dataset,a.data()):a.data();var f=b.extend(!0,{},e);f=d._convertData(f);for(var g in f)b.inArray(g,c)>-1||(b.isPlainObject(this.options[g])?b.extend(this.options[g],f[g]):this.options[g]=f[g]);return this},e.prototype.get=function(a){return this.options[a]},e.prototype.set=function(a,b){this.options[a]=b},e}),b.define("select2/core",["jquery","./options","./utils","./keys"],function(a,b,c,d){var e=function(a,c){null!=a.data("select2")&&a.data("select2").destroy(),this.$element=a,this.id=this._generateId(a),c=c||{},this.options=new b(c,a),e.__super__.constructor.call(this);var d=a.attr("tabindex")||0;a.data("old-tabindex",d),a.attr("tabindex","-1");var f=this.options.get("dataAdapter");this.dataAdapter=new f(a,this.options);var g=this.render();this._placeContainer(g);var h=this.options.get("selectionAdapter");this.selection=new h(a,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,g);var i=this.options.get("dropdownAdapter");this.dropdown=new i(a,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,g);var j=this.options.get("resultsAdapter");this.results=new j(a,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var k=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(a){k.trigger("selection:update",{data:a})}),a.addClass("select2-hidden-accessible"),a.attr("aria-hidden","true"),this._syncAttributes(),a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){var b="";return b=null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+"-"+c.generateChars(2):c.generateChars(4),b=b.replace(/(:|\.|\[|\]|,)/g,""),b="select2-"+b},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b){var d=this._resolveWidth(a,"style");return null!=d?d:this._resolveWidth(a,"element")}if("element"==b){var e=a.outerWidth(!1);return e<=0?"auto":e+"px"}if("style"==b){var f=a.attr("style");if("string"!=typeof f)return null;for(var g=f.split(";"),h=0,i=g.length;h=1)return k[1]}return null}return b},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container),this.selection.bind(this,this.$container),this.dropdown.bind(this,this.$container),this.results.bind(this,this.$container)},e.prototype._registerDomEvents=function(){var b=this;this.$element.on("change.select2",function(){b.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})}),this.$element.on("focus.select2",function(a){b.trigger("focus",a)}),this._syncA=c.bind(this._syncAttributes,this),this._syncS=c.bind(this._syncSubtree,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._syncA);var d=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=d?(this._observer=new d(function(c){a.each(c,b._syncA),a.each(c,b._syncS)}),this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})):this.$element[0].addEventListener&&(this.$element[0].addEventListener("DOMAttrModified",b._syncA,!1),this.$element[0].addEventListener("DOMNodeInserted",b._syncS,!1),this.$element[0].addEventListener("DOMNodeRemoved",b._syncS,!1))},e.prototype._registerDataEvents=function(){var a=this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var b=this,c=["toggle","focus"];this.selection.on("toggle",function(){b.toggleDropdown()}),this.selection.on("focus",function(a){b.focus(a)}),this.selection.on("*",function(d,e){-1===a.inArray(d,c)&&b.trigger(d,e)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var b=this;this.on("open",function(){b.$container.addClass("select2-container--open")}),this.on("close",function(){b.$container.removeClass("select2-container--open")}),this.on("enable",function(){b.$container.removeClass("select2-container--disabled")}),this.on("disable",function(){b.$container.addClass("select2-container--disabled")}),this.on("blur",function(){b.$container.removeClass("select2-container--focus")}),this.on("query",function(a){b.isOpen()||b.trigger("open",{}),this.dataAdapter.query(a,function(c){b.trigger("results:all",{data:c,query:a})})}),this.on("query:append",function(a){this.dataAdapter.query(a,function(c){b.trigger("results:append",{data:c,query:a})})}),this.on("open",function(){setTimeout(function(){b.focusOnActiveElement()},1)}),a(document).on("keydown",function(a){var c=a.which;if(b.isOpen())if(c===d.ESC||c===d.TAB||c===d.UP&&a.altKey?(b.close(),a.preventDefault()):c===d.ENTER?(b.trigger("results:select",{}),a.preventDefault()):c===d.SPACE&&a.ctrlKey?(b.trigger("results:toggle",{}),a.preventDefault()):c===d.UP?(b.trigger("results:previous",{}),a.preventDefault()):c===d.DOWN&&(b.trigger("results:next",{}),a.preventDefault()),c===d.DOWN||c===d.UP)b.focusOnActiveElement();else{var e=b.$dropdown.find(".select2-search__field");e.length||(e=b.$container.find(".select2-search__field")),e.focus(),setTimeout(function(){b.focusOnActiveElement()},1e3)}else b.hasFocus()&&(c===d.ENTER||c===d.SPACE||c===d.DOWN&&a.altKey)&&(b.open(),a.preventDefault())})},e.prototype.focusOnActiveElement=function(){c.isTouchscreen()||this.$results.find("li.select2-results__option--highlighted").focus()},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled")),this.options.get("disabled")?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._syncSubtree=function(a,b){var c=!1,d=this;if(!a||!a.target||"OPTION"===a.target.nodeName||"OPTGROUP"===a.target.nodeName){if(b)if(b.addedNodes&&b.addedNodes.length>0)for(var e=0;e0&&(c=!0);else c=!0;c&&this.dataAdapter.current(function(a){d.trigger("selection:update",{data:a})})}},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===b&&(b={}),a in d){var f=d[a],g={prevented:!1,name:a,args:b};if(c.call(this,f,g),g.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.trigger("query",{})},e.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},e.prototype.isOpen=function(){return this.$container.hasClass("select2-container--open")},e.prototype.hasFocus=function(){return this.$container.hasClass("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container.addClass("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=a&&0!==a.length||(a=[!0]);var b=!a[0];this.$element.prop("disabled",b)},e.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=b}),a},e.prototype.val=function(b){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==b||0===b.length)return this.$element.val();var c=b[0];a.isArray(c)&&(c=a.map(c,function(a){return a.toString()})),this.$element.val(c).trigger("change")},e.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._syncA),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&(this.$element[0].removeEventListener("DOMAttrModified",this._syncA,!1),this.$element[0].removeEventListener("DOMNodeInserted",this._syncS,!1),this.$element[0].removeEventListener("DOMNodeRemoved",this._syncS,!1)),this._syncA=null,this._syncS=null,this.$element.off(".select2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("select2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("select2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},e.prototype.render=function(){var b=a(' ');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container.addClass("select2-container--"+this.options.get("theme")),b.data("element",this.$element),b},e}),b.define("jquery-mousewheel",["jquery"],function(a){return a}),b.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core","./select2/defaults"],function(a,b,c,d){if(null==a.fn.selectWoo){var e=["open","close","destroy"];a.fn.selectWoo=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"==typeof b){var d,f=Array.prototype.slice.call(arguments,1);return this.each(function(){var c=a(this).data("select2");null==c&&window.console&&console.error&&console.error("The select2('"+b+"') method was called on an element that is not using Select2."),d=c[b].apply(c,f)}),a.inArray(b,e)>-1?this:d}throw new Error("Invalid arguments for Select2: "+b)}}return null!=a.fn.select2&&null!=a.fn.select2.defaults&&(a.fn.selectWoo.defaults=a.fn.select2.defaults),null==a.fn.selectWoo.defaults&&(a.fn.selectWoo.defaults=d),a.fn.select2=a.fn.select2||a.fn.selectWoo,c}),{define:b.define,require:b.require}}(),c=b.require("jquery.select2");return a.fn.select2.amd=b,a.fn.selectWoo.amd=b,c});
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/kirki.css b/assets/kirki/assets/vendor/selectWoo/kirki.css
new file mode 100644
index 0000000..273c216
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/kirki.css
@@ -0,0 +1,36 @@
+.select2-dropdown {
+ border-color: rgba(0, 0, 0, 0.1);
+ border-radius: 0;
+}
+
+.select2-container {
+ min-width: 100px;
+ width: 100% !important;
+}
+.select2-container--open .select2-dropdown--above,
+.select2-container--open .select2-dropdown--below {
+ z-index: 9999999;
+ min-width: 100px;
+}
+.select2-container--default .select2-search--dropdown .select2-search__field {
+ border-color: rgba(0, 0, 0, 0.1);
+}
+.select2-container--default .select2-selection--multiple, .select2-container--default .select2-selection--single {
+ border-color: rgba(0, 0, 0, 0.1);
+ border-radius: 0;
+}
+.select2-container--default .select2-selection--multiple .select2-selection__choice {
+ background-color: rgba(255, 255, 255, 0);
+ background-color: transparent;
+ border: none;
+ border-radius: 0;
+}
+
+.wp-customizer .select2-container {
+ z-index: 8 !important;
+}
+.wp-customizer .select2-container.select2-container--open {
+ z-index: 999999 !important;
+}
+
+/*# sourceMappingURL=kirki.css.map */
diff --git a/assets/kirki/assets/vendor/selectWoo/kirki.css.map b/assets/kirki/assets/vendor/selectWoo/kirki.css.map
new file mode 100644
index 0000000..738c86a
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/kirki.css.map
@@ -0,0 +1 @@
+{"version":3,"sourceRoot":"","sources":["kirki.scss"],"names":[],"mappings":"AAAA;EACE;EACA;;;AAGF;EACE;EACA;;AAGE;AAAA;EAEE;EACA;;AAMA;EACE;;AAKF;EAEE;EACA;;AAIA;EACE;EACA;EACA;EACA;;;AAOV;EACE;;AAGE;EAEE","file":"kirki.css"}
\ No newline at end of file
diff --git a/assets/kirki/assets/vendor/selectWoo/kirki.scss b/assets/kirki/assets/vendor/selectWoo/kirki.scss
new file mode 100644
index 0000000..39ee9ae
--- /dev/null
+++ b/assets/kirki/assets/vendor/selectWoo/kirki.scss
@@ -0,0 +1,53 @@
+.select2-dropdown {
+ border-color: rgba(0,0,0,.1);
+ border-radius: 0;
+}
+
+.select2-container {
+ min-width: 100px;
+ width: 100% !important;
+
+ &--open {
+ .select2-dropdown--above,
+ .select2-dropdown--below {
+ z-index: 9999999;
+ min-width: 100px;
+ }
+ }
+
+ &--default {
+ .select2-search--dropdown {
+ .select2-search__field {
+ border-color: rgba(0,0,0,.1);
+ }
+ }
+
+ .select2-selection {
+ &--multiple,
+ &--single {
+ border-color: rgba(0,0,0,.1);
+ border-radius: 0;
+ }
+
+ &--multiple {
+ .select2-selection__choice {
+ background-color: rgba(255,255,255,0);
+ background-color: transparent;
+ border: none;
+ border-radius: 0;
+ }
+ }
+ }
+ }
+}
+
+.wp-customizer .select2-container {
+ z-index: 8 !important;
+
+ &.select2-container {
+ &--open {
+ // @See https://github.com/aristath/kirki/issues/1418
+ z-index: 999999 !important;
+ }
+ }
+}
diff --git a/assets/kirki/assets/vendor/wp-color-picker-alpha/wp-color-picker-alpha.js b/assets/kirki/assets/vendor/wp-color-picker-alpha/wp-color-picker-alpha.js
new file mode 100644
index 0000000..7764f5b
--- /dev/null
+++ b/assets/kirki/assets/vendor/wp-color-picker-alpha/wp-color-picker-alpha.js
@@ -0,0 +1,477 @@
+/**!
+ * wp-color-picker-alpha
+ *
+ * Overwrite Automattic Iris for enabled Alpha Channel in wpColorPicker
+ * Only run in input and is defined data alpha in true
+ *
+ * Version: 2.0
+ * https://github.com/kallookoo/wp-color-picker-alpha
+ * Licensed under the GPLv2 license.
+ */
+( function( $ ) {
+ // Variable for some backgrounds ( grid )
+ var image = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAAHnlligAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAHJJREFUeNpi+P///4EDBxiAGMgCCCAGFB5AADGCRBgYDh48CCRZIJS9vT2QBAggFBkmBiSAogxFBiCAoHogAKIKAlBUYTELAiAmEtABEECk20G6BOmuIl0CIMBQ/IEMkO0myiSSraaaBhZcbkUOs0HuBwDplz5uFJ3Z4gAAAABJRU5ErkJggg==',
+ // Html stuff for wpColorPicker copy of the original color-picker.js
+ _before = ' ',
+ _after = '
',
+ _wrap = '
',
+ _button = ' ',
+ _wrappingLabel = ' ',
+ _wrappingLabelText = ' ';
+
+ /**
+ * Overwrite Color
+ * for enable support rbga
+ */
+ Color.fn.toString = function() {
+ if ( this._alpha < 1 )
+ return this.toCSS( 'rgba', this._alpha ).replace( /\s+/g, '' );
+
+ var hex = parseInt( this._color, 10 ).toString( 16 );
+
+ if ( this.error )
+ return '';
+
+ if ( hex.length < 6 )
+ hex = ( '00000' + hex ).substr( -6 );
+
+ return '#' + hex;
+ };
+
+ /**
+ * Overwrite wpColorPicker
+ */
+ $.widget( 'wp.wpColorPicker', $.wp.wpColorPicker, {
+ /**
+ * @summary Creates the color picker.
+ *
+ * Creates the color picker, sets default values, css classes and wraps it all in HTML.
+ *
+ * @since 3.5.0
+ *
+ * @access private
+ *
+ * @returns {void}
+ */
+ _create: function() {
+ // Return early if Iris support is missing.
+ if ( ! $.support.iris ) {
+ return;
+ }
+
+ var self = this,
+ el = self.element;
+
+ // Override default options with options bound to the element.
+ $.extend( self.options, el.data() );
+
+ // Create a color picker which only allows adjustments to the hue.
+ if ( self.options.type === 'hue' ) {
+ return self._createHueOnly();
+ }
+
+ // Bind the close event.
+ self.close = $.proxy( self.close, self );
+
+ self.initialValue = el.val();
+
+ // Add a CSS class to the input field.
+ el.addClass( 'wp-color-picker' );
+
+ /*
+ * Check if there's already a wrapping label, e.g. in the Customizer.
+ * If there's no label, add a default one to match the Customizer template.
+ */
+ if ( ! el.parent( 'label' ).length ) {
+ // Wrap the input field in the default label.
+ el.wrap( _wrappingLabel );
+ // Insert the default label text.
+ self.wrappingLabelText = $( _wrappingLabelText )
+ .insertBefore( el )
+ .text( wpColorPickerL10n.defaultLabel );
+ }
+
+ /*
+ * At this point, either it's the standalone version or the Customizer
+ * one, we have a wrapping label to use as hook in the DOM, let's store it.
+ */
+ self.wrappingLabel = el.parent();
+
+ // Wrap the label in the main wrapper.
+ self.wrappingLabel.wrap( _wrap );
+ // Store a reference to the main wrapper.
+ self.wrap = self.wrappingLabel.parent();
+ // Set up the toggle button and insert it before the wrapping label.
+ self.toggler = $( _before )
+ .insertBefore( self.wrappingLabel )
+ .css( { backgroundColor: self.initialValue } );
+ // Set the toggle button span element text.
+ if ( el.data( 'label' ) ) {
+ self.toggler.find( '.wp-color-result-text' ).text( el.data( 'label' ) );
+ } else {
+ self.toggler.find( '.wp-color-result-text' ).text( wpColorPickerL10n.pick );
+ }
+ // Set up the Iris container and insert it after the wrapping label.
+ self.pickerContainer = $( _after ).insertAfter( self.wrappingLabel );
+ // Store a reference to the Clear/Default button.
+ self.button = $( _button );
+
+ // Set up the Clear/Default button.
+ if ( self.options.defaultColor ) {
+ self.button
+ .addClass( 'wp-picker-default' )
+ .val( wpColorPickerL10n.defaultString )
+ .attr( 'aria-label', wpColorPickerL10n.defaultAriaLabel );
+ } else {
+ self.button
+ .addClass( 'wp-picker-clear' )
+ .val( wpColorPickerL10n.clear )
+ .attr( 'aria-label', wpColorPickerL10n.clearAriaLabel );
+ }
+
+ // Wrap the wrapping label in its wrapper and append the Clear/Default button.
+ self.wrappingLabel
+ .wrap( ' ' )
+ .after( self.button );
+
+ /*
+ * The input wrapper now contains the label+input+Clear/Default button.
+ * Store a reference to the input wrapper: we'll use this to toggle
+ * the controls visibility.
+ */
+ self.inputWrapper = el.closest( '.wp-picker-input-wrap' );
+
+ /*
+ * CSS for support < 4.9
+ */
+ self.toggler.css({
+ 'height': '24px',
+ 'margin': '0 6px 6px 0',
+ 'padding': '0 0 0 30px',
+ 'font-size': '11px'
+ });
+
+ self.toggler.find( '.wp-color-result-text' ).css({
+ 'background': '#f7f7f7',
+ 'border-radius': '0 2px 2px 0',
+ 'border-left': '1px solid #ccc',
+ 'color': '#555',
+ 'display': 'block',
+ 'line-height': '22px',
+ 'padding': '0 6px',
+ 'text-align': 'center'
+ });
+
+ el.iris( {
+ target: self.pickerContainer,
+ hide: self.options.hide,
+ width: self.options.width,
+ mode: self.options.mode,
+ palettes: self.options.palettes,
+ /**
+ * @summary Handles the onChange event if one has been defined in the options.
+ *
+ * Handles the onChange event if one has been defined in the options and additionally
+ * sets the background color for the toggler element.
+ *
+ * @since 3.5.0
+ *
+ * @param {Event} event The event that's being called.
+ * @param {HTMLElement} ui The HTMLElement containing the color picker.
+ *
+ * @returns {void}
+ */
+ change: function( event, ui ) {
+ if ( self.options.alpha ) {
+ self.toggler.css( {
+ 'background-image': 'url(' + image + ')',
+ 'position': 'relative'
+ } );
+ if ( self.toggler.find( 'span.color-alpha' ).length == 0 ) {
+ self.toggler.append( ' ' );
+ }
+ self.toggler.find( 'span.color-alpha' ).css( {
+ 'width': '30px',
+ 'height': '24px',
+ 'position': 'absolute',
+ 'top': 0,
+ 'left': 0,
+ 'border-top-left-radius': '2px',
+ 'border-bottom-left-radius': '2px',
+ 'background': ui.color.toString()
+ } );
+ } else {
+ self.toggler.css( { backgroundColor: ui.color.toString() } );
+ }
+
+ if ( $.isFunction( self.options.change ) ) {
+ self.options.change.call( this, event, ui );
+ }
+ }
+ } );
+
+ el.val( self.initialValue );
+ self._addListeners();
+
+ // Force the color picker to always be closed on initial load.
+ if ( ! self.options.hide ) {
+ self.toggler.click();
+ }
+ },
+ /**
+ * @summary Binds event listeners to the color picker.
+ *
+ * @since 3.5.0
+ *
+ * @access private
+ *
+ * @returns {void}
+ */
+ _addListeners: function() {
+ var self = this;
+
+ /**
+ * @summary Prevent any clicks inside this widget from leaking to the top and closing it.
+ *
+ * @since 3.5.0
+ *
+ * @param {Event} event The event that's being called.
+ *
+ * @returs {void}
+ */
+ self.wrap.on( 'click.wpcolorpicker', function( event ) {
+ event.stopPropagation();
+ });
+
+ /**
+ * @summary Open or close the color picker depending on the class.
+ *
+ * @since 3.5
+ */
+ self.toggler.click( function() {
+ if ( self.toggler.hasClass( 'wp-picker-open' ) ) {
+ self.close();
+ } else {
+ self.open();
+ }
+ });
+
+ /**
+ * @summary Checks if value is empty when changing the color in the color picker.
+ *
+ * Checks if value is empty when changing the color in the color picker.
+ * If so, the background color is cleared.
+ *
+ * @since 3.5.0
+ *
+ * @param {Event} event The event that's being called.
+ *
+ * @returns {void}
+ */
+ self.element.on( 'change', function( event ) {
+ // Empty or Error = clear
+ if ( $( this ).val() === '' || self.element.hasClass( 'iris-error' ) ) {
+ if ( self.options.alpha ) {
+ self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
+ } else {
+ self.toggler.css( 'backgroundColor', '' );
+ }
+
+ // Fire clear callback if we have one
+ if ( $.isFunction( self.options.clear ) )
+ self.options.clear.call( this, event );
+ }
+ } );
+
+ /**
+ * @summary Enables the user to clear or revert the color in the color picker.
+ *
+ * Enables the user to either clear the color in the color picker or revert back to the default color.
+ *
+ * @since 3.5.0
+ *
+ * @param {Event} event The event that's being called.
+ *
+ * @returns {void}
+ */
+ self.button.on( 'click', function( event ) {
+ if ( $( this ).hasClass( 'wp-picker-clear' ) ) {
+ self.element.val( '' );
+ if ( self.options.alpha ) {
+ self.toggler.find( 'span.color-alpha' ).css( 'backgroundColor', '' );
+ } else {
+ self.toggler.css( 'backgroundColor', '' );
+ }
+
+ if ( $.isFunction( self.options.clear ) )
+ self.options.clear.call( this, event );
+
+ } else if ( $( this ).hasClass( 'wp-picker-default' ) ) {
+ self.element.val( self.options.defaultColor ).change();
+ }
+ });
+ }
+ });
+
+ /**
+ * Overwrite iris
+ */
+ $.widget( 'a8c.iris', $.a8c.iris, {
+ _create: function() {
+ this._super();
+
+ // Global option for check is mode rbga is enabled
+ this.options.alpha = this.element.data( 'alpha' ) || false;
+
+ // Is not input disabled
+ if ( ! this.element.is( ':input' ) )
+ this.options.alpha = false;
+
+ if ( typeof this.options.alpha !== 'undefined' && this.options.alpha ) {
+ var self = this,
+ el = self.element,
+ _html = '',
+ aContainer = $( _html ).appendTo( self.picker.find( '.iris-picker-inner' ) ),
+ aSlider = aContainer.find( '.iris-slider-offset-alpha' ),
+ controls = {
+ aContainer: aContainer,
+ aSlider: aSlider
+ };
+
+ if ( typeof el.data( 'custom-width' ) !== 'undefined' ) {
+ self.options.customWidth = parseInt( el.data( 'custom-width' ) ) || 0;
+ } else {
+ self.options.customWidth = 100;
+ }
+
+ // Set default width for input reset
+ self.options.defaultWidth = el.width();
+
+ // Update width for input
+ if ( self._color._alpha < 1 || self._color.toString().indexOf( 'rgb' ) != -1 )
+ el.width( parseInt( self.options.defaultWidth + self.options.customWidth ) );
+
+ // Push new controls
+ $.each( controls, function( k, v ) {
+ self.controls[k] = v;
+ } );
+
+ // Change size strip and add margin for sliders
+ self.controls.square.css( { 'margin-right': '0' } );
+ var emptyWidth = ( self.picker.width() - self.controls.square.width() - 20 ),
+ stripsMargin = ( emptyWidth / 6 ),
+ stripsWidth = ( ( emptyWidth / 2 ) - stripsMargin );
+
+ $.each( [ 'aContainer', 'strip' ], function( k, v ) {
+ self.controls[v].width( stripsWidth ).css( { 'margin-left': stripsMargin + 'px' } );
+ } );
+
+ // Add new slider
+ self._initControls();
+
+ // For updated widget
+ self._change();
+ }
+ },
+ _initControls: function() {
+ this._super();
+
+ if ( this.options.alpha ) {
+ var self = this,
+ controls = self.controls;
+
+ controls.aSlider.slider({
+ orientation: 'vertical',
+ min: 0,
+ max: 100,
+ step: 1,
+ value: parseInt( self._color._alpha * 100 ),
+ slide: function( event, ui ) {
+ // Update alpha value
+ self._color._alpha = parseFloat( ui.value / 100 );
+ self._change.apply( self, arguments );
+ }
+ });
+ }
+ },
+ _change: function() {
+ this._super();
+
+ var self = this,
+ el = self.element;
+
+ if ( this.options.alpha ) {
+ var controls = self.controls,
+ alpha = parseInt( self._color._alpha * 100 ),
+ color = self._color.toRgb(),
+ gradient = [
+ 'rgb(' + color.r + ',' + color.g + ',' + color.b + ') 0%',
+ 'rgba(' + color.r + ',' + color.g + ',' + color.b + ', 0) 100%'
+ ],
+ defaultWidth = self.options.defaultWidth,
+ customWidth = self.options.customWidth,
+ target = self.picker.closest( '.wp-picker-container' ).find( '.wp-color-result' );
+
+ // Generate background slider alpha, only for CSS3 old browser fuck!! :)
+ controls.aContainer.css( { 'background': 'linear-gradient(to bottom, ' + gradient.join( ', ' ) + '), url(' + image + ')' } );
+
+ if ( target.hasClass( 'wp-picker-open' ) ) {
+ // Update alpha value
+ controls.aSlider.slider( 'value', alpha );
+
+ /**
+ * Disabled change opacity in default slider Saturation ( only is alpha enabled )
+ * and change input width for view all value
+ */
+ if ( self._color._alpha < 1 ) {
+ controls.strip.attr( 'style', controls.strip.attr( 'style' ).replace( /rgba\(([0-9]+,)(\s+)?([0-9]+,)(\s+)?([0-9]+)(,(\s+)?[0-9\.]+)\)/g, 'rgb($1$3$5)' ) );
+ el.width( parseInt( defaultWidth + customWidth ) );
+ } else {
+ el.width( defaultWidth );
+ }
+ }
+ }
+
+ var reset = el.data( 'reset-alpha' ) || false;
+
+ if ( reset ) {
+ self.picker.find( '.iris-palette-container' ).on( 'click.palette', '.iris-palette', function() {
+ self._color._alpha = 1;
+ self.active = 'external';
+ self._change();
+ } );
+ }
+ },
+ _addInputListeners: function( input ) {
+ var self = this,
+ debounceTimeout = 100,
+ callback = function( event ) {
+ var color = new Color( input.val() ),
+ val = input.val();
+
+ input.removeClass( 'iris-error' );
+ // We gave a bad color
+ if ( color.error ) {
+ // Don't error on an empty input
+ if ( val !== '' )
+ input.addClass( 'iris-error' );
+ } else {
+ if ( color.toString() !== self._color.toString() ) {
+ // Let's not do this on keyup for hex shortcodes
+ if ( ! ( event.type === 'keyup' && val.match( /^[0-9a-fA-F]{3}$/ ) ) )
+ self._setOption( 'color', color.toString() );
+ }
+ }
+ };
+
+ input.on( 'change', callback ).on( 'keyup', self._debounce( callback, debounceTimeout ) );
+
+ // If we initialized hidden, show on first focus. The rest is up to you.
+ if ( self.options.hide ) {
+ input.on( 'focus', function() {
+ self.show();
+ } );
+ }
+ }
+ } );
+}( jQuery ) );
diff --git a/assets/kirki/class-kirki-autoload.php b/assets/kirki/class-kirki-autoload.php
new file mode 100644
index 0000000..db306b9
--- /dev/null
+++ b/assets/kirki/class-kirki-autoload.php
@@ -0,0 +1,121 @@
+cached_paths[ $class_name ] ) && file_exists( $this->cached_paths[ $class_name ] ) ) {
+ include_once $this->cached_paths[ $class_name ];
+ return;
+ }
+
+ $paths = $this->get_paths( $class_name );
+
+ foreach ( $paths as $path ) {
+ $path = wp_normalize_path( $path );
+ if ( file_exists( $path ) ) {
+ $this->cached_paths[ $class_name ] = $path;
+ include_once $path;
+ return;
+ }
+ }
+ }
+
+ /**
+ * Get an array of possible paths for the file.
+ *
+ * @access protected
+ * @since 3.0.10
+ * @param string $class_name The name of the class we're trying to load.
+ * @return array
+ */
+ protected function get_paths( $class_name ) {
+
+ $paths = array();
+ // Build the filename.
+ $filename = 'class-' . strtolower( str_replace( '_', '-', $class_name ) ) . '.php';
+
+ // Break class-name is parts.
+ $name_parts = explode( '_', str_replace( 'Kirki_', '', $class_name ) );
+
+ // Handle modules loading.
+ if ( isset( $name_parts[0] ) && 'Modules' === $name_parts[0] ) {
+ $path = dirname( __FILE__ ) . '/modules/';
+ $path .= strtolower( str_replace( '_', '-', str_replace( 'Kirki_Modules_', '', $class_name ) ) ) . '/';
+ $paths[] = $path . $filename;
+ }
+
+ if ( isset( $name_parts[0] ) ) {
+
+ // Handle controls loading.
+ if ( 'Control' === $name_parts[0] || 'Settings' === $name_parts[0] ) {
+ $path = dirname( __FILE__ ) . '/controls/php/';
+ $paths[] = $path . $filename;
+ }
+ }
+
+ $paths[] = dirname( __FILE__ ) . '/core/' . $filename;
+ $paths[] = dirname( __FILE__ ) . '/lib/' . $filename;
+
+ $substr = str_replace( 'Kirki_', '', $class_name );
+ $exploded = explode( '_', $substr );
+ $levels = count( $exploded );
+
+ $previous_path = '';
+ for ( $i = 0; $i < $levels; $i++ ) {
+ $paths[] = dirname( __FILE__ ) . '/' . $previous_path . strtolower( $exploded[ $i ] ) . '/' . $filename;
+ $previous_path .= strtolower( $exploded[ $i ] ) . '/';
+ }
+ return $paths;
+ }
+}
diff --git a/assets/kirki/controls/class-kirki-controls.php b/assets/kirki/controls/class-kirki-controls.php
new file mode 100644
index 0000000..4590512
--- /dev/null
+++ b/assets/kirki/controls/class-kirki-controls.php
@@ -0,0 +1,73 @@
+views_path ) {
+ $this->views_path = wp_normalize_path( dirname( KIRKI_PLUGIN_FILE ) . '/controls/views/' );
+ }
+ add_action( 'customize_controls_print_footer_scripts', array( $this, 'underscore_templates' ) );
+ }
+
+ /**
+ * Adds underscore.js templates to the footer.
+ *
+ * @access public
+ * @since 3.0.17
+ */
+ public function underscore_templates() {
+ foreach ( $this->templates as $template ) {
+ if ( file_exists( $this->views_path . $template . '.php' ) ) {
+ echo '';
+ }
+ }
+ }
+}
diff --git a/assets/kirki/controls/css/styles.css b/assets/kirki/controls/css/styles.css
new file mode 100644
index 0000000..822ef61
--- /dev/null
+++ b/assets/kirki/controls/css/styles.css
@@ -0,0 +1,826 @@
+@charset "UTF-8";
+.customize-control-kirki-background {
+ position: relative;
+}
+.customize-control-kirki-background .background-attachment h4,
+.customize-control-kirki-background .background-color h4,
+.customize-control-kirki-background .background-position h4,
+.customize-control-kirki-background .background-repeat h4,
+.customize-control-kirki-background .background-size h4 {
+ margin-bottom: 5px;
+}
+.customize-control-kirki-background .background-attachment .buttonset,
+.customize-control-kirki-background .background-size .buttonset {
+ display: flex;
+ flex-wrap: wrap;
+}
+.customize-control-kirki-background .background-attachment .buttonset .switch-label,
+.customize-control-kirki-background .background-size .buttonset .switch-label {
+ background: rgba(0, 0, 0, 0.05);
+ border: 1px solid rgba(0, 0, 0, 0.1);
+ color: #555;
+ padding: 0.5em 1em;
+ margin: 0;
+ text-align: center;
+ flex-grow: 1;
+}
+.customize-control-kirki-background .background-attachment .buttonset .switch-input:checked + .switch-label,
+.customize-control-kirki-background .background-size .buttonset .switch-input:checked + .switch-label {
+ background-color: #3498DB;
+ color: #fff;
+}
+
+.customize-control-kirki-code textarea {
+ width: 100%;
+ min-height: 200px;
+}
+
+.customize-control-kirki-color-palette {
+ position: relative;
+}
+.customize-control-kirki-color-palette label {
+ position: relative;
+ display: inline-block;
+ padding: 0;
+ margin: 0;
+}
+.customize-control-kirki-color-palette .colors-wrapper {
+ max-height: 300px;
+ overflow-y: auto;
+ padding: 10px;
+ display: flex;
+ flex-wrap: wrap;
+}
+.customize-control-kirki-color-palette .colors-wrapper .color-palette-color {
+ color: transparent;
+ display: block;
+ width: 100%;
+ height: 100%;
+ overflow: hidden;
+ border: 1px solid rgba(0, 0, 0, 0.2);
+}
+.customize-control-kirki-color-palette .colors-wrapper.round label {
+ padding: 3px;
+}
+.customize-control-kirki-color-palette .colors-wrapper.round .color-palette-color {
+ border-radius: 50%;
+}
+.customize-control-kirki-color-palette .colors-wrapper.box-shadow .color-palette-color {
+ box-shadow: inset 3px 3px 13px 2px rgba(0, 0, 0, 0.22);
+}
+.customize-control-kirki-color-palette .colors-wrapper input:checked + label .color-palette-color {
+ border: 0;
+ width: 150%;
+ height: 150%;
+ position: relative;
+ left: -25%;
+ top: -25%;
+ z-index: 1;
+}
+.customize-control-kirki-color-palette .colors-wrapper.with-margin label {
+ margin: 3px;
+}
+.customize-control-kirki-color-palette .colors-wrapper input {
+ display: none;
+}
+.customize-control-kirki-color-palette .colors-wrapper input:checked + label .color-palette-color {
+ box-shadow: 1px 1px 10px 1px #333333;
+ border: 1px solid rgba(0, 0, 0, 0.3);
+}
+
+.customize-control-kirki-color input[data-type=hue] + .iris-strip-horiz .iris-slider {
+ background-image: -webkit-linear-gradient(left, red, #ff7f00, yellow, #80ff00, lime, #00ff80, aqua, #007fff, blue, #7f00ff, fuchsia, #ff0080, red) !important;
+}
+.customize-control-kirki-color .iris-picker .iris-square-handle {
+ z-index: 8;
+}
+
+.customize-control-kirki-dashicons {
+ position: relative;
+}
+.customize-control-kirki-dashicons label {
+ position: relative;
+ display: inline-block;
+}
+.customize-control-kirki-dashicons .icons-wrapper {
+ max-height: 300px;
+ overflow-y: scroll;
+}
+.customize-control-kirki-dashicons .icons-wrapper h4 {
+ font-weight: 300;
+ margin: 0.7em 0;
+}
+.customize-control-kirki-dashicons .icons-wrapper .dashicons {
+ padding: 3px;
+ font-size: 25px;
+ width: 25px;
+ height: 25px;
+ border: 1px solid transparent;
+}
+.customize-control-kirki-dashicons .icons-wrapper input {
+ display: none;
+}
+.customize-control-kirki-dashicons .icons-wrapper input:checked + label .dashicons {
+ border: 1px solid #3498DB;
+ color: #000;
+}
+
+.wp-customizer div.ui-datepicker {
+ z-index: 500001 !important;
+ width: 255px;
+ background: #fff;
+ border: 1px solid #dedede;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-header {
+ padding: 10px;
+ background: #e5e5e5;
+ border-bottom: 1px solid #fff;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next,
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev {
+ display: block;
+ position: absolute;
+ width: 1em;
+ overflow: hidden;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:after, .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:before,
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:after,
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:before {
+ font-family: dashicons;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:after:hover, .wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:before:hover,
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:after:hover,
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:before:hover {
+ cursor: pointer;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next .ui-icon,
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev .ui-icon {
+ display: none;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev {
+ left: 10px;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-prev:before {
+ content: "";
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next {
+ right: 10px;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-next:after {
+ content: "";
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-header .ui-datepicker-title {
+ text-align: center;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-calendar {
+ border-collapse: collapse;
+ width: 100%;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-calendar thead {
+ background: #e5e5e5;
+ padding: 5px;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td {
+ text-align: center;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td a {
+ display: block;
+ padding: 5px;
+ color: #333;
+ text-decoration: none;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td a.ui-state-active, .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td a:hover {
+ color: #fff;
+ background-color: #0073aa;
+}
+.wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td.ui-state-disabled a, .wp-customizer div.ui-datepicker .ui-datepicker-calendar tr td.ui-state-disabled .ui-state-default a {
+ color: #999;
+}
+
+.customize-control-kirki-dimensions {
+ position: relative;
+}
+.customize-control-kirki-dimensions .wrapper {
+ border: 1px solid rgba(0, 0, 0, 0.1);
+ padding: 10px;
+}
+.customize-control-kirki-dimensions .wrapper .control {
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+}
+.customize-control-kirki-dimensions .wrapper .control > div {
+ width: 48%;
+}
+.customize-control-kirki-dimensions .wrapper .control > div h5 {
+ margin: 10px 0 7px;
+}
+.customize-control-kirki-dimensions .wrapper .control > div .inner {
+ display: flex;
+}
+
+.customize-control-kirki-editor textarea {
+ width: 100%;
+}
+
+.customize-control-kirki-generic input {
+ width: 100%;
+}
+.customize-control-kirki-generic textarea {
+ width: 100%;
+ border: 1px solid rgba(0, 0, 0, 0.1);
+ -webkit-box-shadow: none;
+ box-shadow: none;
+}
+
+.customize-control-kirki-multicolor .multicolor-single-color-wrapper {
+ display: flex;
+ justify-content: space-between;
+}
+.customize-control-kirki-multicolor .multicolor-single-label {
+ order: 2;
+}
+.customize-control-kirki-multicolor .wp-picker-container {
+ width: 100%;
+}
+.customize-control-kirki-multicolor .wp-picker-container > .wp-color-result {
+ width: 100%;
+}
+.customize-control-kirki-multicolor .wp-picker-container.wp-picker-active + .multicolor-single-label {
+ display: none;
+}
+
+.customize-control-kirki-number .customize-control-content {
+ display: flex;
+ align-items: stretch;
+}
+.customize-control-kirki-number .customize-control-content input {
+ width: 100%;
+ -moz-appearance: textfield;
+}
+.customize-control-kirki-number .customize-control-content input::-webkit-inner-spin-button, .customize-control-kirki-number .customize-control-content input::-webkit-outer-spin-button {
+ -webkit-appearance: none;
+ margin: 0;
+}
+.customize-control-kirki-number .customize-control-content .quantity {
+ min-width: 2rem;
+ max-width: 2rem;
+ text-align: center;
+ line-height: 24px;
+}
+.customize-control-kirki-palette {
+ position: relative;
+}
+.customize-control-kirki-palette input[type=radio] {
+ display: none;
+}
+.customize-control-kirki-palette input[type=radio]:checked + label {
+ border: 3px solid rgba(0, 0, 0, 0.4);
+}
+.customize-control-kirki-palette label {
+ background: none;
+ padding: 0;
+ border-top: 3px solid transparent;
+ border-bottom: 3px solid transparent;
+ margin-bottom: 5px;
+ display: flex;
+}
+.customize-control-kirki-palette label span {
+ padding: 10px 0;
+ flex-grow: 1;
+ font-size: 0;
+ line-height: 10px;
+ color: rgba(0, 0, 0, 0);
+ -webkit-transition: all 200ms ease-in-out;
+ -moz-transition: all 200ms ease-in-out;
+ -ms-transition: all 200ms ease-in-out;
+ -o-transition: all 200ms ease-in-out;
+ transition: all 200ms ease-in-out;
+ border-top: 1px solid rgba(0, 0, 0, 0.1);
+ border-bottom: 1px solid rgba(0, 0, 0, 0.1);
+}
+.customize-control-kirki-palette label span:first-child {
+ border-left: 1px solid rgba(0, 0, 0, 0.1);
+}
+.customize-control-kirki-palette label span:last-child {
+ border-right: 1px solid rgba(0, 0, 0, 0.1);
+}
+.customize-control-kirki-palette label span:hover {
+ padding: 10px;
+ flex-grow: 3;
+ min-width: 60px;
+ font-size: 10px;
+ line-height: 10px;
+ color: #000;
+}
+
+.customize-control-kirki-radio-buttonset .buttonset {
+ display: flex;
+ flex-wrap: wrap;
+}
+.customize-control-kirki-radio-buttonset .buttonset .switch-label {
+ background: rgba(0, 0, 0, 0.1);
+ border: 1px rgba(0, 0, 0, 0.1);
+ color: #555d66;
+ margin: 0;
+ text-align: center;
+ padding: 0.5em 1em;
+ flex-grow: 1;
+}
+.customize-control-kirki-radio-buttonset .buttonset .switch-input:checked + .switch-label {
+ background-color: #00a0d2;
+ color: rgba(255, 255, 255, 0.8);
+}
+
+.customize-control-kirki-radio-image > .image {
+ display: flex;
+ flex-wrap: wrap;
+}
+.customize-control-kirki-radio-image label {
+ position: relative;
+ display: inline-block;
+}
+.customize-control-kirki-radio-image label .image-label {
+ display: none;
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;
+ background: rgba(255, 255, 255, 0.7);
+ font-weight: bold;
+}
+.customize-control-kirki-radio-image label .image-label .inner {
+ width: 100%;
+ height: 100%;
+ text-align: center;
+ padding: 0.5em;
+ vertical-align: middle;
+}
+.customize-control-kirki-radio-image label:hover .image-label {
+ display: block;
+}
+.customize-control-kirki-radio-image input {
+ display: none;
+}
+.customize-control-kirki-radio-image input img {
+ border: 1px solid transparent;
+}
+.customize-control-kirki-radio-image input:checked + label img {
+ -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
+ box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
+ border: 1px solid #3498DB;
+}
+.customize-control-kirki-radio-image input + label .image-clickable {
+ position: absolute;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ width: 100%;
+ height: 100%;
+}
+
+.customize-control-kirki-radio {
+ position: relative;
+}
+.customize-control-kirki-radio input[type=radio] {
+ width: 18px;
+ height: 18px;
+}
+.customize-control-kirki-radio input[type=radio]:checked:before {
+ width: 10px;
+ height: 10px;
+ margin: 3px;
+}
+.customize-control-kirki-radio label {
+ display: list-item;
+ margin-bottom: 7px;
+}
+.customize-control-kirki-radio label .option-description {
+ display: block;
+ color: rgba(0, 0, 0, 0.35);
+ font-size: 0.9em;
+ padding-left: 25px;
+}
+
+.customize-control-repeater {
+ position: relative;
+}
+.customize-control-repeater .repeater-fields .repeater-row {
+ border: 1px solid #e5e5e5;
+ margin-top: 0.5rem;
+ background: #eee;
+ position: relative;
+}
+.customize-control-repeater .repeater-fields .repeater-row.minimized {
+ border: 1px solid #dfdfdf;
+ padding: 0;
+}
+.customize-control-repeater .repeater-fields .repeater-row.minimized:hover {
+ border: 1px solid #e5e5e5;
+}
+.customize-control-repeater .repeater-fields .repeater-row.minimized .repeater-row-content {
+ display: none;
+}
+.customize-control-repeater .repeater-fields .repeater-row label {
+ margin-bottom: 12px;
+ clear: both;
+}
+.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field- {
+ display: none;
+}
+.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input {
+ display: none;
+}
+.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input img {
+ border: 1px solid transparent;
+}
+.customize-control-repeater .repeater-fields .repeater-row .repeater-field.repeater-field-radio-image input:checked + label img {
+ -webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
+ box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.25);
+ border: 1px solid #3498DB;
+}
+.customize-control-repeater .repeater-fields .repeater-row .repeater-field:last-child {
+ border-bottom: none;
+ padding-bottom: 0;
+}
+.customize-control-repeater button.repeater-add {
+ margin-top: 1rem;
+}
+.customize-control-repeater .repeater-row-content {
+ padding: 10px 15px;
+ background: #fff;
+}
+.customize-control-repeater .repeater-field {
+ margin-bottom: 12px;
+ width: 100%;
+ clear: both;
+ padding-bottom: 12px;
+ border-bottom: 1px dotted #CCC;
+}
+.customize-control-repeater .repeater-field .customize-control-title {
+ font-size: 13px;
+ line-height: initial;
+}
+.customize-control-repeater .repeater-field .customize-control-description {
+ font-size: 13px;
+ line-height: initial;
+}
+.customize-control-repeater .repeater-field.repeater-field-hidden {
+ margin: 0;
+ padding: 0;
+ border: 0;
+}
+.customize-control-repeater .repeater-field-select select {
+ margin-left: 0;
+}
+.customize-control-repeater .repeater-field-checkbox label {
+ line-height: 28px;
+}
+.customize-control-repeater .repeater-field-checkbox input {
+ line-height: 28px;
+ margin-right: 5px;
+}
+.customize-control-repeater .repeater-field-textarea textarea {
+ width: 100%;
+ resize: vertical;
+}
+.customize-control-repeater .repeater-row-header {
+ background: white;
+ border-bottom: 1px solid #dfdfdf;
+ position: relative;
+ padding: 10px 15px;
+ height: auto;
+ min-height: 20px;
+ line-height: 30px;
+ overflow: hidden;
+ word-wrap: break-word;
+}
+.customize-control-repeater .repeater-row-header:hover {
+ cursor: move;
+}
+.customize-control-repeater .repeater-row-header .dashicons {
+ font-size: 18px;
+ position: absolute;
+ right: 12px;
+ top: 2px;
+ color: #a0a5aa;
+}
+.customize-control-repeater .repeater-row-label {
+ font-size: 13px;
+ font-weight: 600;
+ line-height: 20px;
+ display: block;
+ width: 90%;
+ overflow: hidden;
+ height: 18px;
+}
+.customize-control-repeater .repeater-row-remove {
+ color: #a00;
+}
+.customize-control-repeater .repeater-row-remove:hover {
+ color: #f00;
+}
+.customize-control-repeater .repeater-minimize {
+ line-height: 36px;
+}
+.customize-control-repeater .remove-button,
+.customize-control-repeater .upload-button {
+ width: 48%;
+}
+
+.kirki-image-attachment {
+ margin: 0;
+ text-align: center;
+ margin-bottom: 10px;
+}
+.kirki-image-attachment img {
+ display: inline-block;
+}
+
+.kirki-file-attachment {
+ margin: 0;
+ text-align: center;
+ margin-bottom: 10px;
+}
+.kirki-file-attachment .file {
+ display: block;
+ padding: 10px 5px;
+ border: 1px dotted #c3c3c3;
+ background: #f9f9f9;
+}
+
+.limit {
+ padding: 3px;
+ border-radius: 3px;
+}
+.limit.highlight {
+ background: #D32F2F;
+ color: #fff;
+}
+
+.customize-control-kirki-slider .wrapper {
+ display: flex;
+ align-items: center;
+ padding: 15px 0 7px;
+ position: relative;
+}
+.customize-control-kirki-slider .wrapper .slider-reset {
+ position: absolute;
+ top: 0;
+ right: 0;
+ font-size: 12px;
+ transition: 0.3s ease-in-out;
+ color: rgba(0, 0, 0, 0.3);
+}
+.customize-control-kirki-slider .wrapper .slider-reset:hover {
+ transform: scale(1.3);
+ color: #DC3232;
+}
+.customize-control-kirki-slider .wrapper input[type=range] {
+ display: block;
+ -webkit-appearance: none;
+ background-color: #bdc3c7;
+ width: 100%;
+ height: 5px;
+ border-radius: 5px;
+ margin: 0 auto;
+ outline: 0;
+}
+.customize-control-kirki-slider .wrapper input[type=range]::-webkit-slider-thumb {
+ -webkit-appearance: none;
+ background-color: #0085ba;
+ width: 17px;
+ height: 17px;
+ border-radius: 50%;
+ border: 1px solid #006799;
+ cursor: pointer;
+ transition: 0.3s ease-in-out;
+}
+ .customize-control-kirki-slider .wrapper input[type=range]::-webkit-slider-thumb:hover {
+ background-color: #006799;
+ border: 2px solid #0085ba;
+}
+.customize-control-kirki-slider .wrapper input[type=range]::-webkit-slider-thumb:active {
+ transform: scale(1.2);
+}
+.customize-control-kirki-slider .wrapper input[type=text] {
+ font-size: 13px;
+ background: transparent;
+ border: none;
+ box-shadow: none;
+ text-align: right;
+ padding: 0;
+ width: 40px;
+}
+.customize-control-kirki-slider .wrapper .value {
+ display: flex;
+ align-items: baseline;
+}
+
+.customize-control-kirki-sortable ul.ui-sortable li {
+ padding: 5px 10px;
+ border: 1px solid #333;
+ background: #fff;
+}
+.customize-control-kirki-sortable ul.ui-sortable li .dashicons.dashicons-menu {
+ float: right;
+}
+.customize-control-kirki-sortable ul.ui-sortable li .dashicons.visibility {
+ margin-right: 10px;
+}
+.customize-control-kirki-sortable ul.ui-sortable li.invisible {
+ color: #aaa;
+ border: 1px dashed #aaa;
+}
+.customize-control-kirki-sortable ul.ui-sortable li.invisible .dashicons.visibility {
+ color: #aaa;
+}
+
+.customize-control-kirki-switch {
+ position: relative;
+}
+.customize-control-kirki-switch .switch-off,
+.customize-control-kirki-switch .switch-on {
+ opacity: 1;
+ padding: 8px;
+ font-size: 14px;
+ line-height: 18px;
+}
+.customize-control-kirki-switch .switch-on {
+ color: #fff;
+ opacity: 0;
+}
+.customize-control-kirki-switch .switch-off {
+ color: #777;
+}
+.customize-control-kirki-switch .switch {
+ border: none;
+ margin-bottom: 1.5rem;
+ outline: 0;
+ padding: 0;
+ user-select: none;
+ border-radius: 3rem;
+}
+.customize-control-kirki-switch label {
+ background: #b4b9be;
+ float: left;
+ cursor: pointer;
+ display: flex;
+ justify-content: space-between;
+ margin-bottom: 1rem;
+ position: relative;
+ transition: left 0.15s ease-out;
+ border-radius: 3rem;
+}
+.customize-control-kirki-switch label:after {
+ background: #FFFFFF;
+ content: "";
+ display: block;
+ position: absolute;
+ left: 5px;
+ top: 5px;
+ width: calc(.85rem + 10px);
+ height: calc(.85rem + 10px);
+ transition: all 0.25s ease-in-out;
+ border-radius: 3rem;
+}
+.customize-control-kirki-switch input + label {
+ margin-left: 0;
+ margin-right: 0;
+}
+.customize-control-kirki-switch input:checked + label {
+ background: #0073aa;
+}
+.customize-control-kirki-switch input:checked + label:after {
+ left: auto;
+ right: 5px;
+ background: #ffffff;
+}
+.customize-control-kirki-switch input:checked + label .switch-on {
+ opacity: 1;
+}
+.customize-control-kirki-switch input:checked + label .switch-off {
+ opacity: 0;
+}
+
+.customize-control-kirki-toggle {
+ position: relative;
+}
+.customize-control-kirki-toggle label {
+ display: flex;
+ flex-wrap: wrap;
+}
+.customize-control-kirki-toggle label .customize-control-title {
+ width: calc(100% - 55px);
+}
+.customize-control-kirki-toggle label .description {
+ order: 99;
+}
+.customize-control-kirki-toggle .switch {
+ border: 1px solid #b4b9be;
+ display: inline-block;
+ width: 35px;
+ height: 12px;
+ border-radius: 8px;
+ background: #b4b9be;
+ vertical-align: middle;
+ position: relative;
+ top: 4px;
+ cursor: pointer;
+ user-select: none;
+ transition: background 350ms ease;
+}
+.customize-control-kirki-toggle .switch:after, .customize-control-kirki-toggle .switch:before {
+ content: "";
+ display: block;
+ width: 20px;
+ height: 20px;
+ border-radius: 50%;
+ position: absolute;
+ top: 50%;
+ left: -3px;
+ transition: all 350ms cubic-bezier(0, 0.95, 0.38, 0.98), background 150ms ease;
+}
+.customize-control-kirki-toggle .switch:before {
+ background: rgba(0, 0, 0, 0.2);
+ transform: translate3d(0, -50%, 0) scale(0);
+}
+.customize-control-kirki-toggle .switch:after {
+ background: #999;
+ border: 1px solid rgba(0, 0, 0, 0.1);
+ transform: translate3d(0, -50%, 0);
+}
+.customize-control-kirki-toggle .switch:active:before {
+ transform: translate3d(0, -50%, 0) scale(3);
+}
+.customize-control-kirki-toggle input:checked + .switch:before {
+ background: rgba(0, 115, 170, 0.075);
+ transform: translate3d(100%, -50%, 0) scale(1);
+}
+.customize-control-kirki-toggle input:checked + .switch:after {
+ background: #0073aa;
+ transform: translate3d(100%, -50%, 0);
+}
+.customize-control-kirki-toggle input:checked + .switch:active:before {
+ background: rgba(0, 115, 170, 0.075);
+ transform: translate3d(100%, -50%, 0) scale(3);
+}
+
+.customize-control-kirki-typography {
+ position: relative;
+}
+.customize-control-kirki-typography .wrapper {
+ padding: 10px;
+ display: flex;
+ flex-wrap: wrap;
+ justify-content: space-between;
+ border: 1px solid rgba(0, 0, 0, 0.1);
+}
+.customize-control-kirki-typography .wrapper h5 {
+ margin: 0.67em 0 0;
+}
+.customize-control-kirki-typography .wrapper .color,
+.customize-control-kirki-typography .wrapper .font-backup,
+.customize-control-kirki-typography .wrapper .font-family,
+.customize-control-kirki-typography .wrapper .font-size,
+.customize-control-kirki-typography .wrapper .letter-spacing,
+.customize-control-kirki-typography .wrapper .line-height,
+.customize-control-kirki-typography .wrapper .margin-bottom,
+.customize-control-kirki-typography .wrapper .margin-top,
+.customize-control-kirki-typography .wrapper .text-align,
+.customize-control-kirki-typography .wrapper .text-transform,
+.customize-control-kirki-typography .wrapper .variant {
+ width: 100%;
+ float: none;
+ clear: both;
+}
+.customize-control-kirki-typography .wrapper .font-size,
+.customize-control-kirki-typography .wrapper .letter-spacing,
+.customize-control-kirki-typography .wrapper .line-height,
+.customize-control-kirki-typography .wrapper .margin-bottom,
+.customize-control-kirki-typography .wrapper .margin-top,
+.customize-control-kirki-typography .wrapper .text-transform {
+ width: 48%;
+}
+.customize-control-kirki-typography .wrapper .text-align .text-align-choices {
+ display: flex;
+}
+.customize-control-kirki-typography .wrapper .text-align .text-align-choices label {
+ width: 100%;
+ padding: 5px;
+ text-align: center;
+ border: 1px solid rgba(255, 255, 255, 0);
+}
+.customize-control-kirki-typography .wrapper .text-align .text-align-choices input {
+ display: none;
+}
+.customize-control-kirki-typography .wrapper .text-align .text-align-choices input:checked + label {
+ border-color: #0085ba;
+}
+.customize-control-kirki-typography .wrapper .color {
+ width: auto;
+}
+
+/*# sourceMappingURL=styles.css.map */
diff --git a/assets/kirki/controls/js/script.js b/assets/kirki/controls/js/script.js
new file mode 100644
index 0000000..7a609eb
--- /dev/null
+++ b/assets/kirki/controls/js/script.js
@@ -0,0 +1,3628 @@
+/* jshint -W079 */
+/* jshint unused:false */
+if ( _.isUndefined( window.kirkiSetSettingValue ) ) {
+ var kirkiSetSettingValue = { // eslint-disable-line vars-on-top
+
+ /**
+ * Set the value of the control.
+ *
+ * @since 3.0.0
+ * @param string setting The setting-ID.
+ * @param mixed value The value.
+ */
+ set: function( setting, value ) {
+
+ /**
+ * Get the control of the sub-setting.
+ * This will be used to get properties we need from that control,
+ * and determine if we need to do any further work based on those.
+ */
+ var $this = this,
+ subControl = wp.customize.settings.controls[ setting ],
+ valueJSON;
+
+ // If the control doesn't exist then return.
+ if ( _.isUndefined( subControl ) ) {
+ return true;
+ }
+
+ // First set the value in the wp object. The control type doesn't matter here.
+ $this.setValue( setting, value );
+
+ // Process visually changing the value based on the control type.
+ switch ( subControl.type ) {
+
+ case 'kirki-background':
+ if ( ! _.isUndefined( value['background-color'] ) ) {
+ $this.setColorPicker( $this.findElement( setting, '.kirki-color-control' ), value['background-color'] );
+ }
+ $this.findElement( setting, '.placeholder, .thumbnail' ).removeClass().addClass( 'placeholder' ).html( 'No file selected' );
+ _.each( [ 'background-repeat', 'background-position' ], function( subVal ) {
+ if ( ! _.isUndefined( value[ subVal ] ) ) {
+ $this.setSelectWoo( $this.findElement( setting, '.' + subVal + ' select' ), value[ subVal ] );
+ }
+ } );
+ _.each( [ 'background-size', 'background-attachment' ], function( subVal ) {
+ jQuery( $this.findElement( setting, '.' + subVal + ' input[value="' + value + '"]' ) ).prop( 'checked', true );
+ } );
+ valueJSON = JSON.stringify( value ).replace( /'/g, ''' );
+ jQuery( $this.findElement( setting, '.background-hidden-value' ).attr( 'value', valueJSON ) ).trigger( 'change' );
+ break;
+
+ case 'kirki-code':
+ jQuery( $this.findElement( setting, '.CodeMirror' ) )[0].CodeMirror.setValue( value );
+ break;
+
+ case 'checkbox':
+ case 'kirki-switch':
+ case 'kirki-toggle':
+ value = ( 1 === value || '1' === value || true === value ) ? true : false;
+ jQuery( $this.findElement( setting, 'input' ) ).prop( 'checked', value );
+ wp.customize.instance( setting ).set( value );
+ break;
+
+ case 'kirki-select':
+ case 'kirki-fontawesome':
+ $this.setSelectWoo( $this.findElement( setting, 'select' ), value );
+ break;
+
+ case 'kirki-slider':
+ jQuery( $this.findElement( setting, 'input' ) ).prop( 'value', value );
+ jQuery( $this.findElement( setting, '.kirki_range_value .value' ) ).html( value );
+ break;
+
+ case 'kirki-generic':
+ if ( _.isUndefined( subControl.choices ) || _.isUndefined( subControl.choices.element ) ) {
+ subControl.choices.element = 'input';
+ }
+ jQuery( $this.findElement( setting, subControl.choices.element ) ).prop( 'value', value );
+ break;
+
+ case 'kirki-color':
+ $this.setColorPicker( $this.findElement( setting, '.kirki-color-control' ), value );
+ break;
+
+ case 'kirki-multicheck':
+ $this.findElement( setting, 'input' ).each( function() {
+ jQuery( this ).prop( 'checked', false );
+ } );
+ _.each( value, function( subValue, i ) {
+ jQuery( $this.findElement( setting, 'input[value="' + value[ i ] + '"]' ) ).prop( 'checked', true );
+ } );
+ break;
+
+ case 'kirki-multicolor':
+ _.each( value, function( subVal, index ) {
+ $this.setColorPicker( $this.findElement( setting, '.multicolor-index-' + index ), subVal );
+ } );
+ break;
+
+ case 'kirki-radio-buttonset':
+ case 'kirki-radio-image':
+ case 'kirki-radio':
+ case 'kirki-dashicons':
+ case 'kirki-color-palette':
+ case 'kirki-palette':
+ jQuery( $this.findElement( setting, 'input[value="' + value + '"]' ) ).prop( 'checked', true );
+ break;
+
+ case 'kirki-typography':
+ _.each( [ 'font-family', 'variant' ], function( subVal ) {
+ if ( ! _.isUndefined( value[ subVal ] ) ) {
+ $this.setSelectWoo( $this.findElement( setting, '.' + subVal + ' select' ), value[ subVal ] );
+ }
+ } );
+ _.each( [ 'font-size', 'line-height', 'letter-spacing', 'word-spacing' ], function( subVal ) {
+ if ( ! _.isUndefined( value[ subVal ] ) ) {
+ jQuery( $this.findElement( setting, '.' + subVal + ' input' ) ).prop( 'value', value[ subVal ] );
+ }
+ } );
+
+ if ( ! _.isUndefined( value.color ) ) {
+ $this.setColorPicker( $this.findElement( setting, '.kirki-color-control' ), value.color );
+ }
+ valueJSON = JSON.stringify( value ).replace( /'/g, ''' );
+ jQuery( $this.findElement( setting, '.typography-hidden-value' ).attr( 'value', valueJSON ) ).trigger( 'change' );
+ break;
+
+ case 'kirki-dimensions':
+ _.each( value, function( subValue, id ) {
+ jQuery( $this.findElement( setting, '.' + id + ' input' ) ).prop( 'value', subValue );
+ } );
+ break;
+
+ case 'kirki-repeater':
+
+ // Not yet implemented.
+ break;
+
+ case 'kirki-custom':
+
+ // Do nothing.
+ break;
+ default:
+ jQuery( $this.findElement( setting, 'input' ) ).prop( 'value', value );
+ }
+ },
+
+ /**
+ * Set the value for colorpickers.
+ * CAUTION: This only sets the value visually, it does not change it in th wp object.
+ *
+ * @since 3.0.0
+ * @param object selector jQuery object for this element.
+ * @param string value The value we want to set.
+ */
+ setColorPicker: function( selector, value ) {
+ selector.attr( 'data-default-color', value ).data( 'default-color', value ).wpColorPicker( 'color', value );
+ },
+
+ /**
+ * Sets the value in a selectWoo element.
+ * CAUTION: This only sets the value visually, it does not change it in th wp object.
+ *
+ * @since 3.0.0
+ * @param string selector The CSS identifier for this selectWoo.
+ * @param string value The value we want to set.
+ */
+ setSelectWoo: function( selector, value ) {
+ jQuery( selector ).selectWoo().val( value ).trigger( 'change' );
+ },
+
+ /**
+ * Sets the value in textarea elements.
+ * CAUTION: This only sets the value visually, it does not change it in th wp object.
+ *
+ * @since 3.0.0
+ * @param string selector The CSS identifier for this textarea.
+ * @param string value The value we want to set.
+ */
+ setTextarea: function( selector, value ) {
+ jQuery( selector ).prop( 'value', value );
+ },
+
+ /**
+ * Finds an element inside this control.
+ *
+ * @since 3.0.0
+ * @param string setting The setting ID.
+ * @param string element The CSS identifier.
+ */
+ findElement: function( setting, element ) {
+ return wp.customize.control( setting ).container.find( element );
+ },
+
+ /**
+ * Updates the value in the wp.customize object.
+ *
+ * @since 3.0.0
+ * @param string setting The setting-ID.
+ * @param mixed value The value.
+ */
+ setValue: function( setting, value, timeout ) {
+ timeout = ( _.isUndefined( timeout ) ) ? 100 : parseInt( timeout, 10 );
+ wp.customize.instance( setting ).set( {} );
+ setTimeout( function() {
+ wp.customize.instance( setting ).set( value );
+ }, timeout );
+ }
+ };
+}
+var kirki = {
+
+ initialized: false,
+
+ /**
+ * Initialize the object.
+ *
+ * @since 3.0.17
+ * @returns {null}
+ */
+ initialize: function() {
+ var self = this;
+
+ // We only need to initialize once.
+ if ( self.initialized ) {
+ return;
+ }
+
+ setTimeout( function() {
+ kirki.util.webfonts.standard.initialize();
+ kirki.util.webfonts.google.initialize();
+ }, 150 );
+
+ // Mark as initialized.
+ self.initialized = true;
+ }
+};
+
+// Initialize the kirki object.
+kirki.initialize();
+var kirki = kirki || {};
+kirki = jQuery.extend( kirki, {
+
+ /**
+ * An object containing definitions for controls.
+ *
+ * @since 3.0.16
+ */
+ control: {
+
+ /**
+ * The radio control.
+ *
+ * @since 3.0.17
+ */
+ 'kirki-radio': {
+
+ /**
+ * Init the control.
+ *
+ * @since 3.0.17
+ * @param {Object} control - The customizer control object.
+ * @returns {null}
+ */
+ init: function( control ) {
+ var self = this;
+
+ // Render the template.
+ self.template( control );
+
+ // Init the control.
+ kirki.input.radio.init( control );
+
+ },
+
+ /**
+ * Render the template.
+ *
+ * @since 3.0.17
+ * @param {Object} control - The customizer control object.
+ * @param {Object} control.params - The control parameters.
+ * @param {string} control.params.label - The control label.
+ * @param {string} control.params.description - The control description.
+ * @param {string} control.params.inputAttrs - extra input arguments.
+ * @param {string} control.params.default - The default value.
+ * @param {Object} control.params.choices - Any extra choices we may need.
+ * @param {string} control.id - The setting.
+ * @returns {null}
+ */
+ template: function( control ) {
+ var template = wp.template( 'kirki-input-radio' );
+ control.container.html( template( {
+ label: control.params.label,
+ description: control.params.description,
+ 'data-id': control.id,
+ inputAttrs: control.params.inputAttrs,
+ 'default': control.params.default,
+ value: kirki.setting.get( control.id ),
+ choices: control.params.choices
+ } ) );
+ }
+ },
+
+ /**
+ * The color control.
+ *
+ * @since 3.0.16
+ */
+ 'kirki-color': {
+
+ /**
+ * Init the control.
+ *
+ * @since 3.0.16
+ * @param {Object} control - The customizer control object.
+ * @returns {null}
+ */
+ init: function( control ) {
+ var self = this;
+
+ // Render the template.
+ self.template( control );
+
+ // Init the control.
+ kirki.input.color.init( control );
+
+ },
+
+ /**
+ * Render the template.
+ *
+ * @since 3.0.16
+ * @param {Object} control - The customizer control object.
+ * @param {Object} control.params - The control parameters.
+ * @param {string} control.params.label - The control label.
+ * @param {string} control.params.description - The control description.
+ * @param {string} control.params.mode - The colorpicker mode. Can be 'full' or 'hue'.
+ * @param {bool|array} control.params.palette - false if we don't want a palette,
+ * true to use the default palette,
+ * array of custom hex colors if we want a custom palette.
+ * @param {string} control.params.inputAttrs - extra input arguments.
+ * @param {string} control.params.default - The default value.
+ * @param {Object} control.params.choices - Any extra choices we may need.
+ * @param {boolean} control.params.choices.alpha - should we add an alpha channel?
+ * @param {string} control.id - The setting.
+ * @returns {null}
+ */
+ template: function( control ) {
+ var template = wp.template( 'kirki-input-color' );
+ control.container.html( template( {
+ label: control.params.label,
+ description: control.params.description,
+ 'data-id': control.id,
+ mode: control.params.mode,
+ inputAttrs: control.params.inputAttrs,
+ 'data-palette': control.params.palette,
+ 'data-default-color': control.params.default,
+ 'data-alpha': control.params.choices.alpha,
+ value: kirki.setting.get( control.id )
+ } ) );
+ }
+ },
+
+ /**
+ * The generic control.
+ *
+ * @since 3.0.16
+ */
+ 'kirki-generic': {
+
+ /**
+ * Init the control.
+ *
+ * @since 3.0.17
+ * @param {Object} control - The customizer control object.
+ * @param {Object} control.params - Control parameters.
+ * @param {Object} control.params.choices - Define the specifics for this input.
+ * @param {string} control.params.choices.element - The HTML element we want to use ('input', 'div', 'span' etc).
+ * @returns {null}
+ */
+ init: function( control ) {
+ var self = this;
+
+ // Render the template.
+ self.template( control );
+
+ // Init the control.
+ if ( ! _.isUndefined( control.params ) && ! _.isUndefined( control.params.choices ) && ! _.isUndefined( control.params.choices.element ) && 'textarea' === control.params.choices.element ) {
+ kirki.input.textarea.init( control );
+ return;
+ }
+ kirki.input.genericInput.init( control );
+ },
+
+ /**
+ * Render the template.
+ *
+ * @since 3.0.17
+ * @param {Object} control - The customizer control object.
+ * @param {Object} control.params - The control parameters.
+ * @param {string} control.params.label - The control label.
+ * @param {string} control.params.description - The control description.
+ * @param {string} control.params.inputAttrs - extra input arguments.
+ * @param {string} control.params.default - The default value.
+ * @param {Object} control.params.choices - Any extra choices we may need.
+ * @param {boolean} control.params.choices.alpha - should we add an alpha channel?
+ * @param {string} control.id - The setting.
+ * @returns {null}
+ */
+ template: function( control ) {
+ var args = {
+ label: control.params.label,
+ description: control.params.description,
+ 'data-id': control.id,
+ inputAttrs: control.params.inputAttrs,
+ choices: control.params.choices,
+ value: kirki.setting.get( control.id )
+ },
+ template;
+
+ if ( ! _.isUndefined( control.params ) && ! _.isUndefined( control.params.choices ) && ! _.isUndefined( control.params.choices.element ) && 'textarea' === control.params.choices.element ) {
+ template = wp.template( 'kirki-input-textarea' );
+ control.container.html( template( args ) );
+ return;
+ }
+ template = wp.template( 'kirki-input-generic' );
+ control.container.html( template( args ) );
+ }
+ },
+
+ /**
+ * The number control.
+ *
+ * @since 3.0.26
+ */
+ 'kirki-number': {
+
+ /**
+ * Init the control.
+ *
+ * @since 3.0.26
+ * @param {Object} control - The customizer control object.
+ * @returns {null}
+ */
+ init: function( control ) {
+ var self = this;
+
+ // Render the template.
+ self.template( control );
+
+ // Init the control.
+ kirki.input.number.init( control );
+ },
+
+ /**
+ * Render the template.
+ *
+ * @since 3.0.27
+ * @param {Object} control - The customizer control object.
+ * @param {Object} control.params - The control parameters.
+ * @param {string} control.params.label - The control label.
+ * @param {string} control.params.description - The control description.
+ * @param {string} control.params.inputAttrs - extra input arguments.
+ * @param {string} control.params.default - The default value.
+ * @param {Object} control.params.choices - Any extra choices we may need.
+ * @param {string} control.id - The setting.
+ * @returns {null}
+ */
+ template: function( control ) {
+ var template = wp.template( 'kirki-input-number' );
+
+ control.container.html(
+ template( args = {
+ label: control.params.label,
+ description: control.params.description,
+ 'data-id': control.id,
+ inputAttrs: control.params.inputAttrs,
+ choices: control.params.choices,
+ value: kirki.setting.get( control.id )
+ } )
+ );
+ }
+ },
+
+ /**
+ * The image control.
+ *
+ * @since 3.0.34
+ */
+ 'kirki-image': {
+
+ /**
+ * Init the control.
+ *
+ * @since 3.0.34
+ * @param {Object} control - The customizer control object.
+ * @returns {null}
+ */
+ init: function( control ) {
+ var self = this;
+
+ // Render the template.
+ self.template( control );
+
+ // Init the control.
+ kirki.input.image.init( control );
+ },
+
+ /**
+ * Render the template.
+ *
+ * @since 3.0.34
+ * @param {Object} control - The customizer control object.
+ * @param {Object} control.params - The control parameters.
+ * @param {string} control.params.label - The control label.
+ * @param {string} control.params.description - The control description.
+ * @param {string} control.params.inputAttrs - extra input arguments.
+ * @param {string} control.params.default - The default value.
+ * @param {Object} control.params.choices - Any extra choices we may need.
+ * @param {string} control.id - The setting.
+ * @returns {null}
+ */
+ template: function( control ) {
+ var template = wp.template( 'kirki-input-image' );
+
+ control.container.html(
+ template( args = {
+ label: control.params.label,
+ description: control.params.description,
+ 'data-id': control.id,
+ inputAttrs: control.params.inputAttrs,
+ choices: control.params.choices,
+ value: kirki.setting.get( control.id )
+ } )
+ );
+ }
+ },
+
+ 'kirki-select': {
+
+ /**
+ * Init the control.
+ *
+ * @since 3.0.17
+ * @param {Object} control - The customizer control object.
+ * @returns {null}
+ */
+ init: function( control ) {
+ var self = this;
+
+ // Render the template.
+ self.template( control );
+
+ // Init the control.
+ kirki.input.select.init( control );
+ },
+
+ /**
+ * Render the template.
+ *
+ * @since 3.0.17
+ * @param {Object} control - The customizer control object.
+ * @param {Object} control.params - The control parameters.
+ * @param {string} control.params.label - The control label.
+ * @param {string} control.params.description - The control description.
+ * @param {string} control.params.inputAttrs - extra input arguments.
+ * @param {Object} control.params.default - The default value.
+ * @param {Object} control.params.choices - The choices for the select dropdown.
+ * @param {string} control.id - The setting.
+ * @returns {null}
+ */
+ template: function( control ) {
+ var template = wp.template( 'kirki-input-select' );
+
+ control.container.html( template( {
+ label: control.params.label,
+ description: control.params.description,
+ 'data-id': control.id,
+ inputAttrs: control.params.inputAttrs,
+ choices: control.params.choices,
+ value: kirki.setting.get( control.id ),
+ multiple: control.params.multiple || 1,
+ placeholder: control.params.placeholder
+ } ) );
+ }
+ }
+ }
+} );
+/* global kirkiL10n */
+var kirki = kirki || {};
+kirki = jQuery.extend( kirki, {
+
+ /**
+ * An object containing definitions for input fields.
+ *
+ * @since 3.0.16
+ */
+ input: {
+
+ /**
+ * Radio input fields.
+ *
+ * @since 3.0.17
+ */
+ radio: {
+
+ /**
+ * Init the control.
+ *
+ * @since 3.0.17
+ * @param {Object} control - The control object.
+ * @param {Object} control.id - The setting.
+ * @returns {null}
+ */
+ init: function( control ) {
+ var input = jQuery( 'input[data-id="' + control.id + '"]' );
+
+ // Save the value
+ input.on( 'change keyup paste click', function() {
+ kirki.setting.set( control.id, jQuery( this ).val() );
+ } );
+ }
+ },
+
+ /**
+ * Color input fields.
+ *
+ * @since 3.0.16
+ */
+ color: {
+
+ /**
+ * Init the control.
+ *
+ * @since 3.0.16
+ * @param {Object} control - The control object.
+ * @param {Object} control.id - The setting.
+ * @param {Object} control.choices - Additional options for the colorpickers.
+ * @param {Object} control.params - Control parameters.
+ * @param {Object} control.params.choices - alias for control.choices.
+
+ * @returns {null}
+ */
+ init: function( control ) {
+ var picker = jQuery( '.kirki-color-control[data-id="' + control.id + '"]' ),
+ clear;
+
+ control.choices = control.choices || {};
+ if ( _.isEmpty( control.choices ) && control.params.choices ) {
+ control.choices = control.params.choices;
+ }
+
+ // If we have defined any extra choices, make sure they are passed-on to Iris.
+ if ( ! _.isEmpty( control.choices ) ) {
+ picker.wpColorPicker( control.choices );
+ }
+
+ // Tweaks to make the "clear" buttons work.
+ setTimeout( function() {
+ clear = jQuery( '.kirki-input-container[data-id="' + control.id + '"] .wp-picker-clear' );
+ if ( clear.length ) {
+ clear.click( function() {
+ kirki.setting.set( control.id, '' );
+ } );
+ }
+ }, 200 );
+
+ // Saves our settings to the WP API
+ picker.wpColorPicker( {
+ change: function() {
+
+ // Small hack: the picker needs a small delay
+ setTimeout( function() {
+ kirki.setting.set( control.id, picker.val() );
+ }, 20 );
+ }
+ } );
+ }
+ },
+
+ /**
+ * Generic input fields.
+ *
+ * @since 3.0.17
+ */
+ genericInput: {
+
+ /**
+ * Init the control.
+ *
+ * @since 3.0.17
+ * @param {Object} control - The control object.
+ * @param {Object} control.id - The setting.
+ * @returns {null}
+ */
+ init: function( control ) {
+ var input = jQuery( 'input[data-id="' + control.id + '"]' );
+
+ // Save the value
+ input.on( 'change keyup paste click', function() {
+ kirki.setting.set( control.id, jQuery( this ).val() );
+ } );
+ }
+ },
+
+ /**
+ * Generic input fields.
+ *
+ * @since 3.0.17
+ */
+ textarea: {
+
+ /**
+ * Init the control.
+ *
+ * @since 3.0.17
+ * @param {Object} control - The control object.
+ * @param {Object} control.id - The setting.
+ * @returns {null}
+ */
+ init: function( control ) {
+ var textarea = jQuery( 'textarea[data-id="' + control.id + '"]' );
+
+ // Save the value
+ textarea.on( 'change keyup paste click', function() {
+ kirki.setting.set( control.id, jQuery( this ).val() );
+ } );
+ }
+ },
+
+ select: {
+
+ /**
+ * Init the control.
+ *
+ * @since 3.0.17
+ * @param {Object} control - The control object.
+ * @param {Object} control.id - The setting.
+ * @returns {null}
+ */
+ init: function( control ) {
+ var element = jQuery( 'select[data-id="' + control.id + '"]' ),
+ multiple = parseInt( element.data( 'multiple' ), 10 ),
+ selectValue,
+ selectWooOptions = {
+ escapeMarkup: function( markup ) {
+ return markup;
+ }
+ };
+ if ( control.params.placeholder ) {
+ selectWooOptions.placeholder = control.params.placeholder;
+ selectWooOptions.allowClear = true;
+ }
+
+ if ( 1 < multiple ) {
+ selectWooOptions.maximumSelectionLength = multiple;
+ }
+ jQuery( element ).selectWoo( selectWooOptions ).on( 'change', function() {
+ selectValue = jQuery( this ).val();
+ selectValue = ( null === selectValue && 1 < multiple ) ? [] : selectValue;
+ kirki.setting.set( control.id, selectValue );
+ } );
+ }
+ },
+
+ /**
+ * Number fields.
+ *
+ * @since 3.0.26
+ */
+ number: {
+
+ /**
+ * Init the control.
+ *
+ * @since 3.0.17
+ * @param {Object} control - The control object.
+ * @param {Object} control.id - The setting.
+ * @returns {null}
+ */
+ init: function( control ) {
+
+ var element = jQuery( 'input[data-id="' + control.id + '"]' ),
+ value = control.setting._value,
+ up,
+ down;
+
+ // Make sure we use default values if none are define for some arguments.
+ control.params.choices = _.defaults( control.params.choices, {
+ min: 0,
+ max: 100,
+ step: 1
+ } );
+
+ // Make sure we have a valid value.
+ if ( isNaN( value ) || '' === value ) {
+ value = ( 0 > control.params.choices.min && 0 < control.params.choices.max ) ? 0 : control.params.choices.min;
+ }
+ value = parseFloat( value );
+
+ // If step is 'any', set to 0.001.
+ control.params.choices.step = ( 'any' === control.params.choices.step ) ? 0.001 : control.params.choices.step;
+
+ // Make sure choices are properly formtted as numbers.
+ control.params.choices.min = parseFloat( control.params.choices.min );
+ control.params.choices.max = parseFloat( control.params.choices.max );
+ control.params.choices.step = parseFloat( control.params.choices.step );
+
+ up = jQuery( '.kirki-input-container[data-id="' + control.id + '"] .plus' );
+ down = jQuery( '.kirki-input-container[data-id="' + control.id + '"] .minus' );
+
+ up.click( function() {
+ var oldVal = parseFloat( element.val() ),
+ newVal;
+
+ newVal = ( oldVal >= control.params.choices.max ) ? oldVal : oldVal + control.params.choices.step;
+
+ element.val( newVal );
+ element.trigger( 'change' );
+ } );
+
+ down.click( function() {
+ var oldVal = parseFloat( element.val() ),
+ newVal;
+
+ newVal = ( oldVal <= control.params.choices.min ) ? oldVal : oldVal - control.params.choices.step;
+
+ element.val( newVal );
+ element.trigger( 'change' );
+ } );
+
+ element.on( 'change keyup paste click', function() {
+ kirki.setting.set( control.id, jQuery( this ).val() );
+ } );
+ }
+
+ },
+
+ /**
+ * Image fields.
+ *
+ * @since 3.0.34
+ */
+ image: {
+
+ /**
+ * Init the control.
+ *
+ * @since 3.0.34
+ * @param {Object} control - The control object.
+ * @returns {null}
+ */
+ init: function( control ) {
+ var value = kirki.setting.get( control.id ),
+ saveAs = ( ! _.isUndefined( control.params.choices ) && ! _.isUndefined( control.params.choices.save_as ) ) ? control.params.choices.save_as : 'url',
+ preview = control.container.find( '.placeholder, .thumbnail' ),
+ previewImage = ( 'array' === saveAs ) ? value.url : value,
+ removeButton = control.container.find( '.image-upload-remove-button' ),
+ defaultButton = control.container.find( '.image-default-button' );
+
+ // Make sure value is properly formatted.
+ value = ( 'array' === saveAs && _.isString( value ) ) ? { url: value } : value;
+
+ control.container.find( '.kirki-controls-loading-spinner' ).hide();
+
+ // Tweaks for save_as = id.
+ if ( ( 'id' === saveAs || 'ID' === saveAs ) && '' !== value ) {
+ wp.media.attachment( value ).fetch().then( function() {
+ setTimeout( function() {
+ var url = wp.media.attachment( value ).get( 'url' );
+ preview.removeClass().addClass( 'thumbnail thumbnail-image' ).html( ' ' );
+ }, 700 );
+ } );
+ }
+
+ // If value is not empty, hide the "default" button.
+ if ( ( 'url' === saveAs && '' !== value ) || ( 'array' === saveAs && ! _.isUndefined( value.url ) && '' !== value.url ) ) {
+ control.container.find( 'image-default-button' ).hide();
+ }
+
+ // If value is empty, hide the "remove" button.
+ if ( ( 'url' === saveAs && '' === value ) || ( 'array' === saveAs && ( _.isUndefined( value.url ) || '' === value.url ) ) ) {
+ removeButton.hide();
+ }
+
+ // If value is default, hide the default button.
+ if ( value === control.params.default ) {
+ control.container.find( 'image-default-button' ).hide();
+ }
+
+ if ( '' !== previewImage ) {
+ preview.removeClass().addClass( 'thumbnail thumbnail-image' ).html( ' ' );
+ }
+
+ control.container.on( 'click', '.image-upload-button', function( e ) {
+ var image = wp.media( { multiple: false } ).open().on( 'select', function() {
+
+ // This will return the selected image from the Media Uploader, the result is an object.
+ var uploadedImage = image.state().get( 'selection' ).first(),
+ jsonImg = uploadedImage.toJSON(),
+ previewImage = jsonImg.url;
+
+ if ( ! _.isUndefined( jsonImg.sizes ) ) {
+ previewImg = jsonImg.sizes.full.url;
+ if ( ! _.isUndefined( jsonImg.sizes.medium ) ) {
+ previewImage = jsonImg.sizes.medium.url;
+ } else if ( ! _.isUndefined( jsonImg.sizes.thumbnail ) ) {
+ previewImage = jsonImg.sizes.thumbnail.url;
+ }
+ }
+
+ if ( 'array' === saveAs ) {
+ kirki.setting.set( control.id, {
+ id: jsonImg.id,
+ url: jsonImg.sizes.full.url,
+ width: jsonImg.width,
+ height: jsonImg.height
+ } );
+ } else if ( 'id' === saveAs ) {
+ kirki.setting.set( control.id, jsonImg.id );
+ } else {
+ kirki.setting.set( control.id, ( ( ! _.isUndefined( jsonImg.sizes ) ) ? jsonImg.sizes.full.url : jsonImg.url ) );
+ }
+
+ if ( preview.length ) {
+ preview.removeClass().addClass( 'thumbnail thumbnail-image' ).html( ' ' );
+ }
+ if ( removeButton.length ) {
+ removeButton.show();
+ defaultButton.hide();
+ }
+ } );
+
+ e.preventDefault();
+ } );
+
+ control.container.on( 'click', '.image-upload-remove-button', function( e ) {
+
+ var preview,
+ removeButton,
+ defaultButton;
+
+ e.preventDefault();
+
+ kirki.setting.set( control.id, '' );
+
+ preview = control.container.find( '.placeholder, .thumbnail' );
+ removeButton = control.container.find( '.image-upload-remove-button' );
+ defaultButton = control.container.find( '.image-default-button' );
+
+ if ( preview.length ) {
+ preview.removeClass().addClass( 'placeholder' ).html( kirkiL10n.noFileSelected );
+ }
+ if ( removeButton.length ) {
+ removeButton.hide();
+ if ( jQuery( defaultButton ).hasClass( 'button' ) ) {
+ defaultButton.show();
+ }
+ }
+ } );
+
+ control.container.on( 'click', '.image-default-button', function( e ) {
+
+ var preview,
+ removeButton,
+ defaultButton;
+
+ e.preventDefault();
+
+ kirki.setting.set( control.id, control.params.default );
+
+ preview = control.container.find( '.placeholder, .thumbnail' );
+ removeButton = control.container.find( '.image-upload-remove-button' );
+ defaultButton = control.container.find( '.image-default-button' );
+
+ if ( preview.length ) {
+ preview.removeClass().addClass( 'thumbnail thumbnail-image' ).html( ' ' );
+ }
+ if ( removeButton.length ) {
+ removeButton.show();
+ defaultButton.hide();
+ }
+ } );
+ }
+ }
+ }
+} );
+var kirki = kirki || {};
+kirki = jQuery.extend( kirki, {
+
+ /**
+ * An object containing definitions for settings.
+ *
+ * @since 3.0.16
+ */
+ setting: {
+
+ /**
+ * Gets the value of a setting.
+ *
+ * This is a helper function that allows us to get the value of
+ * control[key1][key2] for example, when the setting used in the
+ * customizer API is "control".
+ *
+ * @since 3.0.16
+ * @param {string} setting - The setting for which we're getting the value.
+ * @returns {mixed} Depends on the value.
+ */
+ get: function( setting ) {
+ var parts = setting.split( '[' ),
+ foundSetting = '',
+ foundInStep = 0,
+ currentVal = '';
+
+ _.each( parts, function( part, i ) {
+ part = part.replace( ']', '' );
+
+ if ( 0 === i ) {
+ foundSetting = part;
+ } else {
+ foundSetting += '[' + part + ']';
+ }
+
+ if ( ! _.isUndefined( wp.customize.instance( foundSetting ) ) ) {
+ currentVal = wp.customize.instance( foundSetting ).get();
+ foundInStep = i;
+ }
+
+ if ( foundInStep < i ) {
+ if ( _.isObject( currentVal ) && ! _.isUndefined( currentVal[ part ] ) ) {
+ currentVal = currentVal[ part ];
+ }
+ }
+ } );
+
+ return currentVal;
+ },
+
+ /**
+ * Sets the value of a setting.
+ *
+ * This function is a bit complicated because there any many scenarios to consider.
+ * Example: We want to save the value for my_setting[something][3][something-else].
+ * The control's setting is my_setting[something].
+ * So we need to find that first, then figure out the remaining parts,
+ * merge the values recursively to avoid destroying my_setting[something][2]
+ * and also take into account any defined "key" arguments which take this even deeper.
+ *
+ * @since 3.0.16
+ * @param {object|string} element - The DOM element whose value has changed,
+ * or an ID.
+ * @param {mixed} value - Depends on the control-type.
+ * @param {string} key - If we only want to save an item in an object
+ * we can define the key here.
+ * @returns {null}
+ */
+ set: function( element, value, key ) {
+ var setting,
+ parts,
+ currentNode = '',
+ foundNode = '',
+ subSettingObj = {},
+ currentVal,
+ subSetting,
+ subSettingParts;
+
+ // Get the setting from the element.
+ setting = element;
+ if ( _.isObject( element ) ) {
+ if ( jQuery( element ).attr( 'data-id' ) ) {
+ setting = element.attr( 'data-id' );
+ } else {
+ setting = element.parents( '[data-id]' ).attr( 'data-id' );
+ }
+ }
+
+ if ( 'undefined' !== typeof wp.customize.control( setting ) ) {
+ wp.customize.control( setting ).setting.set( value );
+ return;
+ }
+
+ parts = setting.split( '[' );
+
+ // Find the setting we're using in the control using the customizer API.
+ _.each( parts, function( part, i ) {
+ part = part.replace( ']', '' );
+
+ // The current part of the setting.
+ currentNode = ( 0 === i ) ? part : '[' + part + ']';
+
+ // When we find the node, get the value from it.
+ // In case of an object we'll need to merge with current values.
+ if ( ! _.isUndefined( wp.customize.instance( currentNode ) ) ) {
+ foundNode = currentNode;
+ currentVal = wp.customize.instance( foundNode ).get();
+ }
+ } );
+
+ // Get the remaining part of the setting that was unused.
+ subSetting = setting.replace( foundNode, '' );
+
+ // If subSetting is not empty, then we're dealing with an object
+ // and we need to dig deeper and recursively merge the values.
+ if ( '' !== subSetting ) {
+ if ( ! _.isObject( currentVal ) ) {
+ currentVal = {};
+ }
+ if ( '[' === subSetting.charAt( 0 ) ) {
+ subSetting = subSetting.replace( '[', '' );
+ }
+ subSettingParts = subSetting.split( '[' );
+ _.each( subSettingParts, function( subSettingPart, i ) {
+ subSettingParts[ i ] = subSettingPart.replace( ']', '' );
+ } );
+
+ // If using a key, we need to go 1 level deeper.
+ if ( key ) {
+ subSettingParts.push( key );
+ }
+
+ // Converting to a JSON string and then parsing that to an object
+ // may seem a bit hacky and crude but it's efficient and works.
+ subSettingObj = '{"' + subSettingParts.join( '":{"' ) + '":"' + value + '"' + '}'.repeat( subSettingParts.length );
+ subSettingObj = JSON.parse( subSettingObj );
+
+ // Recursively merge with current value.
+ jQuery.extend( true, currentVal, subSettingObj );
+ value = currentVal;
+
+ } else {
+ if ( key ) {
+ currentVal = ( ! _.isObject( currentVal ) ) ? {} : currentVal;
+ currentVal[ key ] = value;
+ value = currentVal;
+ }
+ }
+ wp.customize.control( foundNode ).setting.set( value );
+ }
+ }
+} );
+/* global ajaxurl */
+var kirki = kirki || {};
+kirki = jQuery.extend( kirki, {
+
+ /**
+ * A collection of utility methods.
+ *
+ * @since 3.0.17
+ */
+ util: {
+
+ /**
+ * A collection of utility methods for webfonts.
+ *
+ * @since 3.0.17
+ */
+ webfonts: {
+
+ /**
+ * Google-fonts related methods.
+ *
+ * @since 3.0.17
+ */
+ google: {
+
+ /**
+ * An object containing all Google fonts.
+ *
+ * to set this call this.setFonts();
+ *
+ * @since 3.0.17
+ */
+ fonts: {},
+
+ /**
+ * Init for google-fonts.
+ *
+ * @since 3.0.17
+ * @returns {null}
+ */
+ initialize: function() {
+ var self = this;
+
+ self.setFonts();
+ },
+
+ /**
+ * Set fonts in this.fonts
+ *
+ * @since 3.0.17
+ * @returns {null}
+ */
+ setFonts: function() {
+ var self = this;
+
+ // No need to run if we already have the fonts.
+ if ( ! _.isEmpty( self.fonts ) ) {
+ return;
+ }
+
+ // Make an AJAX call to set the fonts object (alpha).
+ jQuery.post( ajaxurl, { 'action': 'kirki_fonts_google_all_get' }, function( response ) {
+
+ // Get fonts from the JSON array.
+ self.fonts = JSON.parse( response );
+ } );
+ },
+
+ /**
+ * Gets all properties of a font-family.
+ *
+ * @since 3.0.17
+ * @param {string} family - The font-family we're interested in.
+ * @returns {Object}
+ */
+ getFont: function( family ) {
+ var self = this,
+ fonts = self.getFonts();
+
+ if ( 'undefined' === typeof fonts[ family ] ) {
+ return false;
+ }
+ return fonts[ family ];
+ },
+
+ /**
+ * Gets all properties of a font-family.
+ *
+ * @since 3.0.17
+ * @param {string} order - How to order the fonts (alpha|popularity|trending).
+ * @param {int} number - How many to get. 0 for all.
+ * @returns {Object}
+ */
+ getFonts: function( order, category, number ) {
+ var self = this,
+ ordered = {},
+ categorized = {},
+ plucked = {};
+
+ // Make sure order is correct.
+ order = order || 'alpha';
+ order = ( 'alpha' !== order && 'popularity' !== order && 'trending' !== order ) ? 'alpha' : order;
+
+ // Make sure number is correct.
+ number = number || 0;
+ number = parseInt( number, 10 );
+
+ // Order fonts by the 'order' argument.
+ if ( 'alpha' === order ) {
+ ordered = jQuery.extend( {}, self.fonts.items );
+ } else {
+ _.each( self.fonts.order[ order ], function( family ) {
+ ordered[ family ] = self.fonts.items[ family ];
+ } );
+ }
+
+ // If we have a category defined get only the fonts in that category.
+ if ( '' === category || ! category ) {
+ categorized = ordered;
+ } else {
+ _.each( ordered, function( font, family ) {
+ if ( category === font.category ) {
+ categorized[ family ] = font;
+ }
+ } );
+ }
+
+ // If we only want a number of font-families get the 1st items from the results.
+ if ( 0 < number ) {
+ _.each( _.first( _.keys( categorized ), number ), function( family ) {
+ plucked[ family ] = categorized[ family ];
+ } );
+ return plucked;
+ }
+
+ return categorized;
+ },
+
+ /**
+ * Gets the variants for a font-family.
+ *
+ * @since 3.0.17
+ * @param {string} family - The font-family we're interested in.
+ * @returns {Array}
+ */
+ getVariants: function( family ) {
+ var self = this,
+ font = self.getFont( family );
+
+ // Early exit if font was not found.
+ if ( ! font ) {
+ return false;
+ }
+
+ // Early exit if font doesn't have variants.
+ if ( _.isUndefined( font.variants ) ) {
+ return false;
+ }
+
+ // Return the variants.
+ return font.variants;
+ }
+ },
+
+ /**
+ * Standard fonts related methods.
+ *
+ * @since 3.0.17
+ */
+ standard: {
+
+ /**
+ * An object containing all Standard fonts.
+ *
+ * to set this call this.setFonts();
+ *
+ * @since 3.0.17
+ */
+ fonts: {},
+
+ /**
+ * Init for google-fonts.
+ *
+ * @since 3.0.17
+ * @returns {null}
+ */
+ initialize: function() {
+ var self = this;
+
+ self.setFonts();
+ },
+
+ /**
+ * Set fonts in this.fonts
+ *
+ * @since 3.0.17
+ * @returns {null}
+ */
+ setFonts: function() {
+ var self = this;
+
+ // No need to run if we already have the fonts.
+ if ( ! _.isEmpty( self.fonts ) ) {
+ return;
+ }
+
+ // Make an AJAX call to set the fonts object.
+ jQuery.post( ajaxurl, { 'action': 'kirki_fonts_standard_all_get' }, function( response ) {
+
+ // Get fonts from the JSON array.
+ self.fonts = JSON.parse( response );
+ } );
+ },
+
+ /**
+ * Gets the variants for a font-family.
+ *
+ * @since 3.0.17
+ * @returns {Array}
+ */
+ getVariants: function() {
+ return [ 'regular', 'italic', '700', '700italic' ];
+ }
+ },
+
+ /**
+ * Figure out what this font-family is (google/standard)
+ *
+ * @since 3.0.20
+ * @param {string} family - The font-family.
+ * @returns {string|false} - Returns string if found (google|standard)
+ * and false in case the font-family is an arbitrary value
+ * not found anywhere in our font definitions.
+ */
+ getFontType: function( family ) {
+ var self = this;
+
+ // Check for standard fonts first.
+ if (
+ 'undefined' !== typeof self.standard.fonts[ family ] || (
+ 'undefined' !== typeof self.standard.fonts.stack &&
+ 'undefined' !== typeof self.standard.fonts.stack[ family ]
+ )
+ ) {
+ return 'standard';
+ }
+
+ // Check in googlefonts.
+ if ( 'undefined' !== typeof self.google.fonts.items[ family ] ) {
+ return 'google';
+ }
+ return false;
+ }
+ },
+
+ validate: {
+ cssValue: function( value ) {
+
+ var validUnits = [ 'fr', 'rem', 'em', 'ex', '%', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ch', 'vh', 'vw', 'vmin', 'vmax' ],
+ numericValue,
+ unit;
+
+ // Early exit if value is undefined.
+ if ( 'undefined' === typeof value ) {
+ return true;
+ }
+
+ // Whitelist values.
+ if ( 0 === value || '0' === value || 'auto' === value || 'inherit' === value || 'initial' === value ) {
+ return true;
+ }
+
+ // Skip checking if calc().
+ if ( 0 <= value.indexOf( 'calc(' ) && 0 <= value.indexOf( ')' ) ) {
+ return true;
+ }
+
+ // Get the numeric value.
+ numericValue = parseFloat( value );
+
+ // Get the unit
+ unit = value.replace( numericValue, '' );
+
+ // Allow unitless.
+ if ( ! value ) {
+ return;
+ }
+
+ // Check the validity of the numeric value and units.
+ return ( ! isNaN( numericValue ) && -1 < jQuery.inArray( unit, validUnits ) );
+ }
+ },
+
+ /**
+ * Parses HTML Entities.
+ *
+ * @since 3.0.34
+ * @param {string} str - The string we want to parse.
+ * @returns {string}
+ */
+ parseHtmlEntities: function( str ) {
+ var parser = new DOMParser,
+ dom = parser.parseFromString(
+ '' + str, 'text/html'
+ );
+
+ return dom.body.textContent;
+ }
+ }
+} );
+/* global kirki */
+/**
+ * The majority of the code in this file
+ * is derived from the wp-customize-posts plugin
+ * and the work of @westonruter to whom I am very grateful.
+ *
+ * @see https://github.com/xwp/wp-customize-posts
+ */
+
+( function() {
+ 'use strict';
+
+ /**
+ * A dynamic color-alpha control.
+ *
+ * @class
+ * @augments wp.customize.Control
+ * @augments wp.customize.Class
+ */
+ wp.customize.kirkiDynamicControl = wp.customize.Control.extend( {
+
+ initialize: function( id, options ) {
+ var control = this,
+ args = options || {};
+
+ args.params = args.params || {};
+ if ( ! args.params.type ) {
+ args.params.type = 'kirki-generic';
+ }
+ if ( ! args.params.content ) {
+ args.params.content = jQuery( ' ' );
+ args.params.content.attr( 'id', 'customize-control-' + id.replace( /]/g, '' ).replace( /\[/g, '-' ) );
+ args.params.content.attr( 'class', 'customize-control customize-control-' + args.params.type );
+ }
+
+ control.propertyElements = [];
+ wp.customize.Control.prototype.initialize.call( control, id, args );
+ },
+
+ /**
+ * Add bidirectional data binding links between inputs and the setting(s).
+ *
+ * This is copied from wp.customize.Control.prototype.initialize(). It
+ * should be changed in Core to be applied once the control is embedded.
+ *
+ * @private
+ * @returns {null}
+ */
+ _setUpSettingRootLinks: function() {
+ var control = this,
+ nodes = control.container.find( '[data-customize-setting-link]' );
+
+ nodes.each( function() {
+ var node = jQuery( this );
+
+ wp.customize( node.data( 'customizeSettingLink' ), function( setting ) {
+ var element = new wp.customize.Element( node );
+ control.elements.push( element );
+ element.sync( setting );
+ element.set( setting() );
+ } );
+ } );
+ },
+
+ /**
+ * Add bidirectional data binding links between inputs and the setting properties.
+ *
+ * @private
+ * @returns {null}
+ */
+ _setUpSettingPropertyLinks: function() {
+ var control = this,
+ nodes;
+
+ if ( ! control.setting ) {
+ return;
+ }
+
+ nodes = control.container.find( '[data-customize-setting-property-link]' );
+
+ nodes.each( function() {
+ var node = jQuery( this ),
+ element,
+ propertyName = node.data( 'customizeSettingPropertyLink' );
+
+ element = new wp.customize.Element( node );
+ control.propertyElements.push( element );
+ element.set( control.setting()[ propertyName ] );
+
+ element.bind( function( newPropertyValue ) {
+ var newSetting = control.setting();
+ if ( newPropertyValue === newSetting[ propertyName ] ) {
+ return;
+ }
+ newSetting = _.clone( newSetting );
+ newSetting[ propertyName ] = newPropertyValue;
+ control.setting.set( newSetting );
+ } );
+ control.setting.bind( function( newValue ) {
+ if ( newValue[ propertyName ] !== element.get() ) {
+ element.set( newValue[ propertyName ] );
+ }
+ } );
+ } );
+ },
+
+ /**
+ * @inheritdoc
+ */
+ ready: function() {
+ var control = this;
+
+ control._setUpSettingRootLinks();
+ control._setUpSettingPropertyLinks();
+
+ wp.customize.Control.prototype.ready.call( control );
+
+ control.deferred.embedded.done( function() {
+ control.initKirkiControl( control );
+ } );
+ },
+
+ /**
+ * Embed the control in the document.
+ *
+ * Override the embed() method to do nothing,
+ * so that the control isn't embedded on load,
+ * unless the containing section is already expanded.
+ *
+ * @returns {null}
+ */
+ embed: function() {
+ var control = this,
+ sectionId = control.section();
+
+ if ( ! sectionId ) {
+ return;
+ }
+
+ wp.customize.section( sectionId, function( section ) {
+ if ( 'kirki-expanded' === section.params.type || section.expanded() || wp.customize.settings.autofocus.control === control.id ) {
+ control.actuallyEmbed();
+ } else {
+ section.expanded.bind( function( expanded ) {
+ if ( expanded ) {
+ control.actuallyEmbed();
+ }
+ } );
+ }
+ } );
+ },
+
+ /**
+ * Deferred embedding of control when actually
+ *
+ * This function is called in Section.onChangeExpanded() so the control
+ * will only get embedded when the Section is first expanded.
+ *
+ * @returns {null}
+ */
+ actuallyEmbed: function() {
+ var control = this;
+ if ( 'resolved' === control.deferred.embedded.state() ) {
+ return;
+ }
+ control.renderContent();
+ control.deferred.embedded.resolve(); // This triggers control.ready().
+ },
+
+ /**
+ * This is not working with autofocus.
+ *
+ * @param {object} [args] Args.
+ * @returns {null}
+ */
+ focus: function( args ) {
+ var control = this;
+ control.actuallyEmbed();
+ wp.customize.Control.prototype.focus.call( control, args );
+ },
+
+ /**
+ * Additional actions that run on ready.
+ *
+ * @param {object} [args] Args.
+ * @returns {null}
+ */
+ initKirkiControl: function( control ) {
+ if ( 'undefined' !== typeof kirki.control[ control.params.type ] ) {
+ kirki.control[ control.params.type ].init( control );
+ return;
+ }
+
+ // Save the value
+ this.container.on( 'change keyup paste click', 'input', function() {
+ control.setting.set( jQuery( this ).val() );
+ } );
+ }
+ } );
+}() );
+_.each( kirki.control, function( obj, type ) {
+ wp.customize.controlConstructor[ type ] = wp.customize.kirkiDynamicControl.extend( {} );
+} );
+/* global kirkiControlLoader */
+wp.customize.controlConstructor['kirki-background'] = wp.customize.Control.extend( {
+
+ // When we're finished loading continue processing
+ ready: function() {
+
+ 'use strict';
+
+ var control = this;
+
+ // Init the control.
+ if ( ! _.isUndefined( window.kirkiControlLoader ) && _.isFunction( kirkiControlLoader ) ) {
+ kirkiControlLoader( control );
+ } else {
+ control.initKirkiControl();
+ }
+ },
+
+ initKirkiControl: function() {
+
+ var control = this,
+ value = control.setting._value,
+ picker = control.container.find( '.kirki-color-control' );
+
+ // Hide unnecessary controls if the value doesn't have an image.
+ if ( _.isUndefined( value['background-image'] ) || '' === value['background-image'] ) {
+ control.container.find( '.background-wrapper > .background-repeat' ).hide();
+ control.container.find( '.background-wrapper > .background-position' ).hide();
+ control.container.find( '.background-wrapper > .background-size' ).hide();
+ control.container.find( '.background-wrapper > .background-attachment' ).hide();
+ }
+
+ // Color.
+ picker.wpColorPicker( {
+ change: function() {
+ setTimeout( function() {
+ control.saveValue( 'background-color', picker.val() );
+ }, 100 );
+ }
+ } );
+
+ // Background-Repeat.
+ control.container.on( 'change', '.background-repeat select', function() {
+ control.saveValue( 'background-repeat', jQuery( this ).val() );
+ } );
+
+ // Background-Size.
+ control.container.on( 'change click', '.background-size input', function() {
+ control.saveValue( 'background-size', jQuery( this ).val() );
+ } );
+
+ // Background-Position.
+ control.container.on( 'change', '.background-position select', function() {
+ control.saveValue( 'background-position', jQuery( this ).val() );
+ } );
+
+ // Background-Attachment.
+ control.container.on( 'change click', '.background-attachment input', function() {
+ control.saveValue( 'background-attachment', jQuery( this ).val() );
+ } );
+
+ // Background-Image.
+ control.container.on( 'click', '.background-image-upload-button', function( e ) {
+ var image = wp.media( { multiple: false } ).open().on( 'select', function() {
+
+ // This will return the selected image from the Media Uploader, the result is an object.
+ var uploadedImage = image.state().get( 'selection' ).first(),
+ previewImage = uploadedImage.toJSON().sizes.full.url,
+ imageUrl,
+ imageID,
+ imageWidth,
+ imageHeight,
+ preview,
+ removeButton;
+
+ if ( ! _.isUndefined( uploadedImage.toJSON().sizes.medium ) ) {
+ previewImage = uploadedImage.toJSON().sizes.medium.url;
+ } else if ( ! _.isUndefined( uploadedImage.toJSON().sizes.thumbnail ) ) {
+ previewImage = uploadedImage.toJSON().sizes.thumbnail.url;
+ }
+
+ imageUrl = uploadedImage.toJSON().sizes.full.url;
+ imageID = uploadedImage.toJSON().id;
+ imageWidth = uploadedImage.toJSON().width;
+ imageHeight = uploadedImage.toJSON().height;
+
+ // Show extra controls if the value has an image.
+ if ( '' !== imageUrl ) {
+ control.container.find( '.background-wrapper > .background-repeat, .background-wrapper > .background-position, .background-wrapper > .background-size, .background-wrapper > .background-attachment' ).show();
+ }
+
+ control.saveValue( 'background-image', imageUrl );
+ preview = control.container.find( '.placeholder, .thumbnail' );
+ removeButton = control.container.find( '.background-image-upload-remove-button' );
+
+ if ( preview.length ) {
+ preview.removeClass().addClass( 'thumbnail thumbnail-image' ).html( ' ' );
+ }
+ if ( removeButton.length ) {
+ removeButton.show();
+ }
+ } );
+
+ e.preventDefault();
+ } );
+
+ control.container.on( 'click', '.background-image-upload-remove-button', function( e ) {
+
+ var preview,
+ removeButton;
+
+ e.preventDefault();
+
+ control.saveValue( 'background-image', '' );
+
+ preview = control.container.find( '.placeholder, .thumbnail' );
+ removeButton = control.container.find( '.background-image-upload-remove-button' );
+
+ // Hide unnecessary controls.
+ control.container.find( '.background-wrapper > .background-repeat' ).hide();
+ control.container.find( '.background-wrapper > .background-position' ).hide();
+ control.container.find( '.background-wrapper > .background-size' ).hide();
+ control.container.find( '.background-wrapper > .background-attachment' ).hide();
+
+ if ( preview.length ) {
+ preview.removeClass().addClass( 'placeholder' ).html( 'No file selected' );
+ }
+ if ( removeButton.length ) {
+ removeButton.hide();
+ }
+ } );
+ },
+
+ /**
+ * Saves the value.
+ */
+ saveValue: function( property, value ) {
+
+ var control = this,
+ input = jQuery( '#customize-control-' + control.id.replace( '[', '-' ).replace( ']', '' ) + ' .background-hidden-value' ),
+ val = control.setting._value;
+
+ val[ property ] = value;
+
+ jQuery( input ).attr( 'value', JSON.stringify( val ) ).trigger( 'change' );
+ control.setting.set( val );
+ }
+} );
+wp.customize.controlConstructor['kirki-color-palette'] = wp.customize.kirkiDynamicControl.extend( {} );
+wp.customize.controlConstructor['kirki-dashicons'] = wp.customize.kirkiDynamicControl.extend( {} );
+wp.customize.controlConstructor['kirki-date'] = wp.customize.kirkiDynamicControl.extend( {
+
+ initKirkiControl: function() {
+ var control = this,
+ selector = control.selector + ' input.datepicker';
+
+ // Init the datepicker
+ jQuery( selector ).datepicker( {
+ dateFormat: 'yy-mm-dd'
+ } );
+
+ control.container.find( '.kirki-controls-loading-spinner' ).hide();
+
+ // Save the changes
+ this.container.on( 'change keyup paste', 'input.datepicker', function() {
+ control.setting.set( jQuery( this ).val() );
+ } );
+ }
+} );
+/* global dimensionkirkiL10n */
+wp.customize.controlConstructor['kirki-dimension'] = wp.customize.kirkiDynamicControl.extend( {
+
+ initKirkiControl: function() {
+
+ var control = this,
+ value;
+
+ // Notifications.
+ control.kirkiNotifications();
+
+ // Save the value
+ this.container.on( 'change keyup paste', 'input', function() {
+
+ value = jQuery( this ).val();
+ control.setting.set( value );
+ } );
+ },
+
+ /**
+ * Handles notifications.
+ */
+ kirkiNotifications: function() {
+
+ var control = this,
+ acceptUnitless = ( 'undefined' !== typeof control.params.choices && 'undefined' !== typeof control.params.choices.accept_unitless && true === control.params.choices.accept_unitless );
+
+ wp.customize( control.id, function( setting ) {
+ setting.bind( function( value ) {
+ var code = 'long_title';
+
+ if ( false === kirki.util.validate.cssValue( value ) && ( ! acceptUnitless || isNaN( value ) ) ) {
+ setting.notifications.add( code, new wp.customize.Notification(
+ code,
+ {
+ type: 'warning',
+ message: dimensionkirkiL10n['invalid-value']
+ }
+ ) );
+ } else {
+ setting.notifications.remove( code );
+ }
+ } );
+ } );
+ }
+} );
+/* global dimensionskirkiL10n */
+wp.customize.controlConstructor['kirki-dimensions'] = wp.customize.kirkiDynamicControl.extend( {
+
+ initKirkiControl: function() {
+
+ var control = this,
+ subControls = control.params.choices.controls,
+ value = {},
+ subsArray = [],
+ i;
+
+ _.each( subControls, function( v, i ) {
+ if ( true === v ) {
+ subsArray.push( i );
+ }
+ } );
+
+ for ( i = 0; i < subsArray.length; i++ ) {
+ value[ subsArray[ i ] ] = control.setting._value[ subsArray[ i ] ];
+ control.updateDimensionsValue( subsArray[ i ], value );
+ }
+ },
+
+ /**
+ * Updates the value.
+ */
+ updateDimensionsValue: function( context, value ) {
+
+ var control = this;
+
+ control.container.on( 'change keyup paste', '.' + context + ' input', function() {
+ value[ context ] = jQuery( this ).val();
+
+ // Notifications.
+ control.kirkiNotifications();
+
+ // Save the value
+ control.saveValue( value );
+ } );
+ },
+
+ /**
+ * Saves the value.
+ */
+ saveValue: function( value ) {
+
+ var control = this,
+ newValue = {};
+
+ _.each( value, function( newSubValue, i ) {
+ newValue[ i ] = newSubValue;
+ } );
+
+ control.setting.set( newValue );
+ },
+
+ /**
+ * Handles notifications.
+ */
+ kirkiNotifications: function() {
+
+ var control = this;
+
+ wp.customize( control.id, function( setting ) {
+ setting.bind( function( value ) {
+ var code = 'long_title',
+ subs = {},
+ message;
+
+ setting.notifications.remove( code );
+
+ _.each( value, function( val, direction ) {
+ if ( false === kirki.util.validate.cssValue( val ) ) {
+ subs[ direction ] = val;
+ } else {
+ delete subs[ direction ];
+ }
+ } );
+
+ if ( ! _.isEmpty( subs ) ) {
+ message = dimensionskirkiL10n['invalid-value'] + ' (' + _.values( subs ).toString() + ') ';
+ setting.notifications.add( code, new wp.customize.Notification( code, {
+ type: 'warning',
+ message: message
+ } ) );
+ return;
+ }
+ setting.notifications.remove( code );
+ } );
+ } );
+ }
+} );
+/* global tinyMCE */
+wp.customize.controlConstructor['kirki-editor'] = wp.customize.kirkiDynamicControl.extend( {
+
+ initKirkiControl: function() {
+
+ var control = this,
+ element = control.container.find( 'textarea' ),
+ id = 'kirki-editor-' + control.id.replace( '[', '' ).replace( ']', '' ),
+ editor;
+
+ wp.editor.initialize( id, {
+ tinymce: {
+ wpautop: true
+ },
+ quicktags: true,
+ mediaButtons: true
+ } );
+
+ editor = tinyMCE.get( id );
+
+ if ( editor ) {
+ editor.onChange.add( function( ed ) {
+ var content;
+
+ ed.save();
+ content = editor.getContent();
+ element.val( content ).trigger( 'change' );
+ wp.customize.instance( control.id ).set( content );
+ } );
+ }
+ }
+} );
+/* global fontAwesomeJSON */
+wp.customize.controlConstructor['kirki-fontawesome'] = wp.customize.kirkiDynamicControl.extend( {
+
+ initKirkiControl: function() {
+
+ var control = this,
+ element = this.container.find( 'select' ),
+ icons = jQuery.parseJSON( fontAwesomeJSON ),
+ selectValue,
+ selectWooOptions = {
+ data: [],
+ escapeMarkup: function( markup ) {
+ return markup;
+ },
+ templateResult: function( val ) {
+ return ' ' + ' ' + val.text;
+ },
+ templateSelection: function( val ) {
+ return ' ' + ' ' + val.text;
+ }
+ },
+ select;
+
+ _.each( icons.icons, function( icon ) {
+ selectWooOptions.data.push( {
+ id: icon.id,
+ text: icon.name
+ } );
+ } );
+
+ select = jQuery( element ).selectWoo( selectWooOptions );
+
+ select.on( 'change', function() {
+ selectValue = jQuery( this ).val();
+ control.setting.set( selectValue );
+ } );
+ select.val( control.setting._value ).trigger( 'change' );
+ }
+} );
+wp.customize.controlConstructor['kirki-multicheck'] = wp.customize.kirkiDynamicControl.extend( {
+
+ initKirkiControl: function() {
+
+ var control = this;
+
+ // Save the value
+ control.container.on( 'change', 'input', function() {
+ var value = [],
+ i = 0;
+
+ // Build the value as an object using the sub-values from individual checkboxes.
+ jQuery.each( control.params.choices, function( key ) {
+ if ( control.container.find( 'input[value="' + key + '"]' ).is( ':checked' ) ) {
+ control.container.find( 'input[value="' + key + '"]' ).parent().addClass( 'checked' );
+ value[ i ] = key;
+ i++;
+ } else {
+ control.container.find( 'input[value="' + key + '"]' ).parent().removeClass( 'checked' );
+ }
+ } );
+
+ // Update the value in the customizer.
+ control.setting.set( value );
+ } );
+ }
+} );
+/* global kirkiControlLoader */
+wp.customize.controlConstructor['kirki-multicolor'] = wp.customize.Control.extend( {
+
+ // When we're finished loading continue processing
+ ready: function() {
+
+ 'use strict';
+
+ var control = this;
+
+ // Init the control.
+ if ( ! _.isUndefined( window.kirkiControlLoader ) && _.isFunction( kirkiControlLoader ) ) {
+ kirkiControlLoader( control );
+ } else {
+ control.initKirkiControl();
+ }
+ },
+
+ initKirkiControl: function() {
+
+ 'use strict';
+
+ var control = this,
+ colors = control.params.choices,
+ keys = Object.keys( colors ),
+ value = this.params.value,
+ i = 0;
+
+ // Proxy function that handles changing the individual colors
+ function kirkiMulticolorChangeHandler( control, value, subSetting ) {
+
+ var picker = control.container.find( '.multicolor-index-' + subSetting ),
+ args = {
+ change: function() {
+
+ // Color controls require a small delay.
+ setTimeout( function() {
+
+ // Set the value.
+ control.saveValue( subSetting, picker.val() );
+
+ // Trigger the change.
+ control.container.find( '.multicolor-index-' + subSetting ).trigger( 'change' );
+ }, 100 );
+ }
+ };
+
+ if ( _.isObject( colors.irisArgs ) ) {
+ _.each( colors.irisArgs, function( irisValue, irisKey ) {
+ args[ irisKey ] = irisValue;
+ } );
+ }
+
+ // Did we change the value?
+ picker.wpColorPicker( args );
+ }
+
+ // Colors loop
+ while ( i < Object.keys( colors ).length ) {
+ kirkiMulticolorChangeHandler( this, value, keys[ i ] );
+ i++;
+ }
+ },
+
+ /**
+ * Saves the value.
+ */
+ saveValue: function( property, value ) {
+
+ var control = this,
+ input = control.container.find( '.multicolor-hidden-value' ),
+ val = control.setting._value;
+
+ val[ property ] = value;
+
+ jQuery( input ).attr( 'value', JSON.stringify( val ) ).trigger( 'change' );
+ control.setting.set( val );
+ }
+} );
+wp.customize.controlConstructor['kirki-palette'] = wp.customize.kirkiDynamicControl.extend( {} );
+wp.customize.controlConstructor['kirki-radio-buttonset'] = wp.customize.kirkiDynamicControl.extend( {} );
+wp.customize.controlConstructor['kirki-radio-image'] = wp.customize.kirkiDynamicControl.extend( {} );
+/* global kirkiControlLoader */
+var RepeaterRow = function( rowIndex, container, label, control ) {
+
+ 'use strict';
+
+ var self = this;
+ this.rowIndex = rowIndex;
+ this.container = container;
+ this.label = label;
+ this.header = this.container.find( '.repeater-row-header' );
+
+ this.header.on( 'click', function() {
+ self.toggleMinimize();
+ } );
+
+ this.container.on( 'click', '.repeater-row-remove', function() {
+ self.remove();
+ } );
+
+ this.header.on( 'mousedown', function() {
+ self.container.trigger( 'row:start-dragging' );
+ } );
+
+ this.container.on( 'keyup change', 'input, select, textarea', function( e ) {
+ self.container.trigger( 'row:update', [ self.rowIndex, jQuery( e.target ).data( 'field' ), e.target ] );
+ } );
+
+ this.setRowIndex = function( rowIndex ) {
+ this.rowIndex = rowIndex;
+ this.container.attr( 'data-row', rowIndex );
+ this.container.data( 'row', rowIndex );
+ this.updateLabel();
+ };
+
+ this.toggleMinimize = function() {
+
+ // Store the previous state.
+ this.container.toggleClass( 'minimized' );
+ this.header.find( '.dashicons' ).toggleClass( 'dashicons-arrow-up' ).toggleClass( 'dashicons-arrow-down' );
+ };
+
+ this.remove = function() {
+ this.container.slideUp( 300, function() {
+ jQuery( this ).detach();
+ } );
+ this.container.trigger( 'row:remove', [ this.rowIndex ] );
+ };
+
+ this.updateLabel = function() {
+ var rowLabelField,
+ rowLabel,
+ rowLabelSelector;
+
+ if ( 'field' === this.label.type ) {
+ rowLabelField = this.container.find( '.repeater-field [data-field="' + this.label.field + '"]' );
+ if ( _.isFunction( rowLabelField.val ) ) {
+ rowLabel = rowLabelField.val();
+ if ( '' !== rowLabel ) {
+ if ( ! _.isUndefined( control.params.fields[ this.label.field ] ) ) {
+ if ( ! _.isUndefined( control.params.fields[ this.label.field ].type ) ) {
+ if ( 'select' === control.params.fields[ this.label.field ].type ) {
+ if ( ! _.isUndefined( control.params.fields[ this.label.field ].choices ) && ! _.isUndefined( control.params.fields[ this.label.field ].choices[ rowLabelField.val() ] ) ) {
+ rowLabel = control.params.fields[ this.label.field ].choices[ rowLabelField.val() ];
+ }
+ } else if ( 'radio' === control.params.fields[ this.label.field ].type || 'radio-image' === control.params.fields[ this.label.field ].type ) {
+ rowLabelSelector = control.selector + ' [data-row="' + this.rowIndex + '"] .repeater-field [data-field="' + this.label.field + '"]:checked';
+ rowLabel = jQuery( rowLabelSelector ).val();
+ }
+ }
+ }
+ this.header.find( '.repeater-row-label' ).text( rowLabel );
+ return;
+ }
+ }
+ }
+ this.header.find( '.repeater-row-label' ).text( this.label.value + ' ' + ( this.rowIndex + 1 ) );
+ };
+ this.updateLabel();
+};
+
+wp.customize.controlConstructor.repeater = wp.customize.Control.extend( {
+
+ // When we're finished loading continue processing
+ ready: function() {
+
+ 'use strict';
+
+ var control = this;
+
+ // Init the control.
+ if ( ! _.isUndefined( window.kirkiControlLoader ) && _.isFunction( kirkiControlLoader ) ) {
+ kirkiControlLoader( control );
+ } else {
+ control.initKirkiControl();
+ }
+ },
+
+ initKirkiControl: function() {
+
+ 'use strict';
+
+ var control = this,
+ limit,
+ theNewRow;
+
+ // The current value set in Control Class (set in Kirki_Customize_Repeater_Control::to_json() function)
+ var settingValue = this.params.value;
+
+ control.container.find( '.kirki-controls-loading-spinner' ).hide();
+
+ // The hidden field that keeps the data saved (though we never update it)
+ this.settingField = this.container.find( '[data-customize-setting-link]' ).first();
+
+ // Set the field value for the first time, we'll fill it up later
+ this.setValue( [], false );
+
+ // The DIV that holds all the rows
+ this.repeaterFieldsContainer = this.container.find( '.repeater-fields' ).first();
+
+ // Set number of rows to 0
+ this.currentIndex = 0;
+
+ // Save the rows objects
+ this.rows = [];
+
+ // Default limit choice
+ limit = false;
+ if ( ! _.isUndefined( this.params.choices.limit ) ) {
+ limit = ( 0 >= this.params.choices.limit ) ? false : parseInt( this.params.choices.limit, 10 );
+ }
+
+ this.container.on( 'click', 'button.repeater-add', function( e ) {
+ e.preventDefault();
+ if ( ! limit || control.currentIndex < limit ) {
+ theNewRow = control.addRow();
+ theNewRow.toggleMinimize();
+ control.initColorPicker();
+ control.initSelect( theNewRow );
+ } else {
+ jQuery( control.selector + ' .limit' ).addClass( 'highlight' );
+ }
+ } );
+
+ this.container.on( 'click', '.repeater-row-remove', function() {
+ control.currentIndex--;
+ if ( ! limit || control.currentIndex < limit ) {
+ jQuery( control.selector + ' .limit' ).removeClass( 'highlight' );
+ }
+ } );
+
+ this.container.on( 'click keypress', '.repeater-field-image .upload-button,.repeater-field-cropped_image .upload-button,.repeater-field-upload .upload-button', function( e ) {
+ e.preventDefault();
+ control.$thisButton = jQuery( this );
+ control.openFrame( e );
+ } );
+
+ this.container.on( 'click keypress', '.repeater-field-image .remove-button,.repeater-field-cropped_image .remove-button', function( e ) {
+ e.preventDefault();
+ control.$thisButton = jQuery( this );
+ control.removeImage( e );
+ } );
+
+ this.container.on( 'click keypress', '.repeater-field-upload .remove-button', function( e ) {
+ e.preventDefault();
+ control.$thisButton = jQuery( this );
+ control.removeFile( e );
+ } );
+
+ /**
+ * Function that loads the Mustache template
+ */
+ this.repeaterTemplate = _.memoize( function() {
+ var compiled,
+
+ /*
+ * Underscore's default ERB-style templates are incompatible with PHP
+ * when asp_tags is enabled, so WordPress uses Mustache-inspired templating syntax.
+ *
+ * @see trac ticket #22344.
+ */
+ options = {
+ evaluate: /<#([\s\S]+?)#>/g,
+ interpolate: /\{\{\{([\s\S]+?)\}\}\}/g,
+ escape: /\{\{([^\}]+?)\}\}(?!\})/g,
+ variable: 'data'
+ };
+
+ return function( data ) {
+ compiled = _.template( control.container.find( '.customize-control-repeater-content' ).first().html(), null, options );
+ return compiled( data );
+ };
+ } );
+
+ // When we load the control, the fields have not been filled up
+ // This is the first time that we create all the rows
+ if ( settingValue.length ) {
+ _.each( settingValue, function( subValue ) {
+ theNewRow = control.addRow( subValue );
+ control.initColorPicker();
+ control.initSelect( theNewRow, subValue );
+ } );
+ }
+
+ // Once we have displayed the rows, we cleanup the values
+ this.setValue( settingValue, true, true );
+
+ this.repeaterFieldsContainer.sortable( {
+ handle: '.repeater-row-header',
+ update: function() {
+ control.sort();
+ }
+ } );
+
+ },
+
+ /**
+ * Open the media modal.
+ */
+ openFrame: function( event ) {
+
+ 'use strict';
+
+ if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+
+ if ( this.$thisButton.closest( '.repeater-field' ).hasClass( 'repeater-field-cropped_image' ) ) {
+ this.initCropperFrame();
+ } else {
+ this.initFrame();
+ }
+
+ this.frame.open();
+ },
+
+ initFrame: function() {
+
+ 'use strict';
+
+ var libMediaType = this.getMimeType();
+
+ this.frame = wp.media( {
+ states: [
+ new wp.media.controller.Library( {
+ library: wp.media.query( { type: libMediaType } ),
+ multiple: false,
+ date: false
+ } )
+ ]
+ } );
+
+ // When a file is selected, run a callback.
+ this.frame.on( 'select', this.onSelect, this );
+ },
+
+ /**
+ * Create a media modal select frame, and store it so the instance can be reused when needed.
+ * This is mostly a copy/paste of Core api.CroppedImageControl in /wp-admin/js/customize-control.js
+ */
+ initCropperFrame: function() {
+
+ 'use strict';
+
+ // We get the field id from which this was called
+ var currentFieldId = this.$thisButton.siblings( 'input.hidden-field' ).attr( 'data-field' ),
+ attrs = [ 'width', 'height', 'flex_width', 'flex_height' ], // A list of attributes to look for
+ libMediaType = this.getMimeType();
+
+ // Make sure we got it
+ if ( _.isString( currentFieldId ) && '' !== currentFieldId ) {
+
+ // Make fields is defined and only do the hack for cropped_image
+ if ( _.isObject( this.params.fields[ currentFieldId ] ) && 'cropped_image' === this.params.fields[ currentFieldId ].type ) {
+
+ //Iterate over the list of attributes
+ attrs.forEach( function( el ) {
+
+ // If the attribute exists in the field
+ if ( ! _.isUndefined( this.params.fields[ currentFieldId ][ el ] ) ) {
+
+ // Set the attribute in the main object
+ this.params[ el ] = this.params.fields[ currentFieldId ][ el ];
+ }
+ }.bind( this ) );
+ }
+ }
+
+ this.frame = wp.media( {
+ button: {
+ text: 'Select and Crop',
+ close: false
+ },
+ states: [
+ new wp.media.controller.Library( {
+ library: wp.media.query( { type: libMediaType } ),
+ multiple: false,
+ date: false,
+ suggestedWidth: this.params.width,
+ suggestedHeight: this.params.height
+ } ),
+ new wp.media.controller.CustomizeImageCropper( {
+ imgSelectOptions: this.calculateImageSelectOptions,
+ control: this
+ } )
+ ]
+ } );
+
+ this.frame.on( 'select', this.onSelectForCrop, this );
+ this.frame.on( 'cropped', this.onCropped, this );
+ this.frame.on( 'skippedcrop', this.onSkippedCrop, this );
+
+ },
+
+ onSelect: function() {
+
+ 'use strict';
+
+ var attachment = this.frame.state().get( 'selection' ).first().toJSON();
+
+ if ( this.$thisButton.closest( '.repeater-field' ).hasClass( 'repeater-field-upload' ) ) {
+ this.setFileInRepeaterField( attachment );
+ } else {
+ this.setImageInRepeaterField( attachment );
+ }
+ },
+
+ /**
+ * After an image is selected in the media modal, switch to the cropper
+ * state if the image isn't the right size.
+ */
+
+ onSelectForCrop: function() {
+
+ 'use strict';
+
+ var attachment = this.frame.state().get( 'selection' ).first().toJSON();
+
+ if ( this.params.width === attachment.width && this.params.height === attachment.height && ! this.params.flex_width && ! this.params.flex_height ) {
+ this.setImageInRepeaterField( attachment );
+ } else {
+ this.frame.setState( 'cropper' );
+ }
+ },
+
+ /**
+ * After the image has been cropped, apply the cropped image data to the setting.
+ *
+ * @param {object} croppedImage Cropped attachment data.
+ */
+ onCropped: function( croppedImage ) {
+
+ 'use strict';
+
+ this.setImageInRepeaterField( croppedImage );
+
+ },
+
+ /**
+ * Returns a set of options, computed from the attached image data and
+ * control-specific data, to be fed to the imgAreaSelect plugin in
+ * wp.media.view.Cropper.
+ *
+ * @param {wp.media.model.Attachment} attachment
+ * @param {wp.media.controller.Cropper} controller
+ * @returns {Object} Options
+ */
+ calculateImageSelectOptions: function( attachment, controller ) {
+
+ 'use strict';
+
+ var control = controller.get( 'control' ),
+ flexWidth = !! parseInt( control.params.flex_width, 10 ),
+ flexHeight = !! parseInt( control.params.flex_height, 10 ),
+ realWidth = attachment.get( 'width' ),
+ realHeight = attachment.get( 'height' ),
+ xInit = parseInt( control.params.width, 10 ),
+ yInit = parseInt( control.params.height, 10 ),
+ ratio = xInit / yInit,
+ xImg = realWidth,
+ yImg = realHeight,
+ x1,
+ y1,
+ imgSelectOptions;
+
+ controller.set( 'canSkipCrop', ! control.mustBeCropped( flexWidth, flexHeight, xInit, yInit, realWidth, realHeight ) );
+
+ if ( xImg / yImg > ratio ) {
+ yInit = yImg;
+ xInit = yInit * ratio;
+ } else {
+ xInit = xImg;
+ yInit = xInit / ratio;
+ }
+
+ x1 = ( xImg - xInit ) / 2;
+ y1 = ( yImg - yInit ) / 2;
+
+ imgSelectOptions = {
+ handles: true,
+ keys: true,
+ instance: true,
+ persistent: true,
+ imageWidth: realWidth,
+ imageHeight: realHeight,
+ x1: x1,
+ y1: y1,
+ x2: xInit + x1,
+ y2: yInit + y1
+ };
+
+ if ( false === flexHeight && false === flexWidth ) {
+ imgSelectOptions.aspectRatio = xInit + ':' + yInit;
+ }
+ if ( false === flexHeight ) {
+ imgSelectOptions.maxHeight = yInit;
+ }
+ if ( false === flexWidth ) {
+ imgSelectOptions.maxWidth = xInit;
+ }
+
+ return imgSelectOptions;
+ },
+
+ /**
+ * Return whether the image must be cropped, based on required dimensions.
+ *
+ * @param {bool} flexW
+ * @param {bool} flexH
+ * @param {int} dstW
+ * @param {int} dstH
+ * @param {int} imgW
+ * @param {int} imgH
+ * @return {bool}
+ */
+ mustBeCropped: function( flexW, flexH, dstW, dstH, imgW, imgH ) {
+
+ 'use strict';
+
+ if ( ( true === flexW && true === flexH ) || ( true === flexW && dstH === imgH ) || ( true === flexH && dstW === imgW ) || ( dstW === imgW && dstH === imgH ) || ( imgW <= dstW ) ) {
+ return false;
+ }
+
+ return true;
+ },
+
+ /**
+ * If cropping was skipped, apply the image data directly to the setting.
+ */
+ onSkippedCrop: function() {
+
+ 'use strict';
+
+ var attachment = this.frame.state().get( 'selection' ).first().toJSON();
+ this.setImageInRepeaterField( attachment );
+
+ },
+
+ /**
+ * Updates the setting and re-renders the control UI.
+ *
+ * @param {object} attachment
+ */
+ setImageInRepeaterField: function( attachment ) {
+
+ 'use strict';
+
+ var $targetDiv = this.$thisButton.closest( '.repeater-field-image,.repeater-field-cropped_image' );
+
+ $targetDiv.find( '.kirki-image-attachment' ).html( ' ' ).hide().slideDown( 'slow' );
+
+ $targetDiv.find( '.hidden-field' ).val( attachment.id );
+ this.$thisButton.text( this.$thisButton.data( 'alt-label' ) );
+ $targetDiv.find( '.remove-button' ).show();
+
+ //This will activate the save button
+ $targetDiv.find( 'input, textarea, select' ).trigger( 'change' );
+ this.frame.close();
+
+ },
+
+ /**
+ * Updates the setting and re-renders the control UI.
+ *
+ * @param {object} attachment
+ */
+ setFileInRepeaterField: function( attachment ) {
+
+ 'use strict';
+
+ var $targetDiv = this.$thisButton.closest( '.repeater-field-upload' );
+
+ $targetDiv.find( '.kirki-file-attachment' ).html( ' ' + attachment.filename + ' ' ).hide().slideDown( 'slow' );
+
+ $targetDiv.find( '.hidden-field' ).val( attachment.id );
+ this.$thisButton.text( this.$thisButton.data( 'alt-label' ) );
+ $targetDiv.find( '.upload-button' ).show();
+ $targetDiv.find( '.remove-button' ).show();
+
+ //This will activate the save button
+ $targetDiv.find( 'input, textarea, select' ).trigger( 'change' );
+ this.frame.close();
+
+ },
+
+ getMimeType: function() {
+
+ 'use strict';
+
+ // We get the field id from which this was called
+ var currentFieldId = this.$thisButton.siblings( 'input.hidden-field' ).attr( 'data-field' );
+
+ // Make sure we got it
+ if ( _.isString( currentFieldId ) && '' !== currentFieldId ) {
+
+ // Make fields is defined and only do the hack for cropped_image
+ if ( _.isObject( this.params.fields[ currentFieldId ] ) && 'upload' === this.params.fields[ currentFieldId ].type ) {
+
+ // If the attribute exists in the field
+ if ( ! _.isUndefined( this.params.fields[ currentFieldId ].mime_type ) ) {
+
+ // Set the attribute in the main object
+ return this.params.fields[ currentFieldId ].mime_type;
+ }
+ }
+ }
+ return 'image';
+
+ },
+
+ removeImage: function( event ) {
+
+ 'use strict';
+
+ var $targetDiv,
+ $uploadButton;
+
+ if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+
+ $targetDiv = this.$thisButton.closest( '.repeater-field-image,.repeater-field-cropped_image,.repeater-field-upload' );
+ $uploadButton = $targetDiv.find( '.upload-button' );
+
+ $targetDiv.find( '.kirki-image-attachment' ).slideUp( 'fast', function() {
+ jQuery( this ).show().html( jQuery( this ).data( 'placeholder' ) );
+ } );
+ $targetDiv.find( '.hidden-field' ).val( '' );
+ $uploadButton.text( $uploadButton.data( 'label' ) );
+ this.$thisButton.hide();
+
+ $targetDiv.find( 'input, textarea, select' ).trigger( 'change' );
+
+ },
+
+ removeFile: function( event ) {
+
+ 'use strict';
+
+ var $targetDiv,
+ $uploadButton;
+
+ if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+
+ $targetDiv = this.$thisButton.closest( '.repeater-field-upload' );
+ $uploadButton = $targetDiv.find( '.upload-button' );
+
+ $targetDiv.find( '.kirki-file-attachment' ).slideUp( 'fast', function() {
+ jQuery( this ).show().html( jQuery( this ).data( 'placeholder' ) );
+ } );
+ $targetDiv.find( '.hidden-field' ).val( '' );
+ $uploadButton.text( $uploadButton.data( 'label' ) );
+ this.$thisButton.hide();
+
+ $targetDiv.find( 'input, textarea, select' ).trigger( 'change' );
+
+ },
+
+ /**
+ * Get the current value of the setting
+ *
+ * @return Object
+ */
+ getValue: function() {
+
+ 'use strict';
+
+ // The setting is saved in JSON
+ return JSON.parse( decodeURI( this.setting.get() ) );
+
+ },
+
+ /**
+ * Set a new value for the setting
+ *
+ * @param newValue Object
+ * @param refresh If we want to refresh the previewer or not
+ */
+ setValue: function( newValue, refresh, filtering ) {
+
+ 'use strict';
+
+ // We need to filter the values after the first load to remove data requrired for diplay but that we don't want to save in DB
+ var filteredValue = newValue,
+ filter = [];
+
+ if ( filtering ) {
+ jQuery.each( this.params.fields, function( index, value ) {
+ if ( 'image' === value.type || 'cropped_image' === value.type || 'upload' === value.type ) {
+ filter.push( index );
+ }
+ } );
+ jQuery.each( newValue, function( index, value ) {
+ jQuery.each( filter, function( ind, field ) {
+ if ( ! _.isUndefined( value[ field ] ) && ! _.isUndefined( value[ field ].id ) ) {
+ filteredValue[index][ field ] = value[ field ].id;
+ }
+ } );
+ } );
+ }
+
+ this.setting.set( encodeURI( JSON.stringify( filteredValue ) ) );
+
+ if ( refresh ) {
+
+ // Trigger the change event on the hidden field so
+ // previewer refresh the website on Customizer
+ this.settingField.trigger( 'change' );
+ }
+ },
+
+ /**
+ * Add a new row to repeater settings based on the structure.
+ *
+ * @param data (Optional) Object of field => value pairs (undefined if you want to get the default values)
+ */
+ addRow: function( data ) {
+
+ 'use strict';
+
+ var control = this,
+ template = control.repeaterTemplate(), // The template for the new row (defined on Kirki_Customize_Repeater_Control::render_content() ).
+ settingValue = this.getValue(), // Get the current setting value.
+ newRowSetting = {}, // Saves the new setting data.
+ templateData, // Data to pass to the template
+ newRow,
+ i;
+
+ if ( template ) {
+
+ // The control structure is going to define the new fields
+ // We need to clone control.params.fields. Assigning it
+ // ould result in a reference assignment.
+ templateData = jQuery.extend( true, {}, control.params.fields );
+
+ // But if we have passed data, we'll use the data values instead
+ if ( data ) {
+ for ( i in data ) {
+ if ( data.hasOwnProperty( i ) && templateData.hasOwnProperty( i ) ) {
+ templateData[ i ].default = data[ i ];
+ }
+ }
+ }
+
+ templateData.index = this.currentIndex;
+
+ // Append the template content
+ template = template( templateData );
+
+ // Create a new row object and append the element
+ newRow = new RepeaterRow(
+ control.currentIndex,
+ jQuery( template ).appendTo( control.repeaterFieldsContainer ),
+ control.params.row_label,
+ control
+ );
+
+ newRow.container.on( 'row:remove', function( e, rowIndex ) {
+ control.deleteRow( rowIndex );
+ } );
+
+ newRow.container.on( 'row:update', function( e, rowIndex, fieldName, element ) {
+ control.updateField.call( control, e, rowIndex, fieldName, element );
+ newRow.updateLabel();
+ } );
+
+ // Add the row to rows collection
+ this.rows[ this.currentIndex ] = newRow;
+
+ for ( i in templateData ) {
+ if ( templateData.hasOwnProperty( i ) ) {
+ newRowSetting[ i ] = templateData[ i ].default;
+ }
+ }
+
+ settingValue[ this.currentIndex ] = newRowSetting;
+ this.setValue( settingValue, true );
+
+ this.currentIndex++;
+
+ return newRow;
+ }
+ },
+
+ sort: function() {
+
+ 'use strict';
+
+ var control = this,
+ $rows = this.repeaterFieldsContainer.find( '.repeater-row' ),
+ newOrder = [],
+ settings = control.getValue(),
+ newRows = [],
+ newSettings = [];
+
+ $rows.each( function( i, element ) {
+ newOrder.push( jQuery( element ).data( 'row' ) );
+ } );
+
+ jQuery.each( newOrder, function( newPosition, oldPosition ) {
+ newRows[ newPosition ] = control.rows[ oldPosition ];
+ newRows[ newPosition ].setRowIndex( newPosition );
+
+ newSettings[ newPosition ] = settings[ oldPosition ];
+ } );
+
+ control.rows = newRows;
+ control.setValue( newSettings );
+
+ },
+
+ /**
+ * Delete a row in the repeater setting
+ *
+ * @param index Position of the row in the complete Setting Array
+ */
+ deleteRow: function( index ) {
+
+ 'use strict';
+
+ var currentSettings = this.getValue(),
+ row,
+ i,
+ prop;
+
+ if ( currentSettings[ index ] ) {
+
+ // Find the row
+ row = this.rows[ index ];
+ if ( row ) {
+
+ // Remove the row settings
+ delete currentSettings[ index ];
+
+ // Remove the row from the rows collection
+ delete this.rows[ index ];
+
+ // Update the new setting values
+ this.setValue( currentSettings, true );
+
+ }
+
+ }
+
+ // Remap the row numbers
+ i = 1;
+ for ( prop in this.rows ) {
+ if ( this.rows.hasOwnProperty( prop ) && this.rows[ prop ] ) {
+ this.rows[ prop ].updateLabel();
+ i++;
+ }
+ }
+ },
+
+ /**
+ * Update a single field inside a row.
+ * Triggered when a field has changed
+ *
+ * @param e Event Object
+ */
+ updateField: function( e, rowIndex, fieldId, element ) {
+
+ 'use strict';
+
+ var type,
+ row,
+ currentSettings;
+
+ if ( ! this.rows[ rowIndex ] ) {
+ return;
+ }
+
+ if ( ! this.params.fields[ fieldId ] ) {
+ return;
+ }
+
+ type = this.params.fields[ fieldId].type;
+ row = this.rows[ rowIndex ];
+ currentSettings = this.getValue();
+
+ element = jQuery( element );
+
+ if ( _.isUndefined( currentSettings[ row.rowIndex ][ fieldId ] ) ) {
+ return;
+ }
+
+ if ( 'checkbox' === type ) {
+ currentSettings[ row.rowIndex ][ fieldId ] = element.is( ':checked' );
+ } else {
+
+ // Update the settings
+ currentSettings[ row.rowIndex ][ fieldId ] = element.val();
+ }
+ this.setValue( currentSettings, true );
+ },
+
+ /**
+ * Init the color picker on color fields
+ * Called after AddRow
+ *
+ */
+ initColorPicker: function() {
+
+ 'use strict';
+
+ var control = this,
+ colorPicker = control.container.find( '.color-picker-hex' ),
+ options = {},
+ fieldId = colorPicker.data( 'field' );
+
+ // We check if the color palette parameter is defined.
+ if ( ! _.isUndefined( fieldId ) && ! _.isUndefined( control.params.fields[ fieldId ] ) && ! _.isUndefined( control.params.fields[ fieldId ].palettes ) && _.isObject( control.params.fields[ fieldId ].palettes ) ) {
+ options.palettes = control.params.fields[ fieldId ].palettes;
+ }
+
+ // When the color picker value is changed we update the value of the field
+ options.change = function( event, ui ) {
+
+ var currentPicker = jQuery( event.target ),
+ row = currentPicker.closest( '.repeater-row' ),
+ rowIndex = row.data( 'row' ),
+ currentSettings = control.getValue();
+
+ currentSettings[ rowIndex ][ currentPicker.data( 'field' ) ] = ui.color.toString();
+ control.setValue( currentSettings, true );
+
+ };
+
+ // Init the color picker
+ if ( 0 !== colorPicker.length ) {
+ colorPicker.wpColorPicker( options );
+ }
+ },
+
+ /**
+ * Init the dropdown-pages field with selectWoo
+ * Called after AddRow
+ *
+ * @param {object} theNewRow the row that was added to the repeater
+ * @param {object} data the data for the row if we're initializing a pre-existing row
+ *
+ */
+ initSelect: function( theNewRow, data ) {
+
+ 'use strict';
+
+ var control = this,
+ dropdown = theNewRow.container.find( '.repeater-field select' ),
+ $select,
+ dataField,
+ multiple,
+ selectWooOptions = {};
+
+ if ( 0 === dropdown.length ) {
+ return;
+ }
+
+ dataField = dropdown.data( 'field' );
+ multiple = jQuery( dropdown ).data( 'multiple' );
+ if ( 'undefed' !== multiple && jQuery.isNumeric( multiple ) ) {
+ multiple = parseInt( multiple, 10 );
+ if ( 1 < multiple ) {
+ selectWooOptions.maximumSelectionLength = multiple;
+ }
+ }
+
+ data = data || {};
+ data[ dataField ] = data[ dataField ] || '';
+
+ $select = jQuery( dropdown ).selectWoo( selectWooOptions ).val( data[ dataField ] || jQuery( dropdown ).val() );
+
+ this.container.on( 'change', '.repeater-field select', function( event ) {
+
+ var currentDropdown = jQuery( event.target ),
+ row = currentDropdown.closest( '.repeater-row' ),
+ rowIndex = row.data( 'row' ),
+ currentSettings = control.getValue();
+
+ currentSettings[ rowIndex ][ currentDropdown.data( 'field' ) ] = jQuery( this ).val();
+ control.setValue( currentSettings );
+ } );
+ }
+} );
+wp.customize.controlConstructor['kirki-slider'] = wp.customize.kirkiDynamicControl.extend( {
+
+ initKirkiControl: function() {
+ var control = this,
+ changeAction = ( 'postMessage' === control.setting.transport ) ? 'mousemove change' : 'change',
+ rangeInput = control.container.find( 'input[type="range"]' ),
+ textInput = control.container.find( 'input[type="text"]' ),
+ value = control.setting._value;
+
+ // Set the initial value in the text input.
+ textInput.attr( 'value', value );
+
+ // If the range input value changes copy the value to the text input.
+ rangeInput.on( 'mousemove change', function() {
+ textInput.attr( 'value', rangeInput.val() );
+ } );
+
+ // Save the value when the range input value changes.
+ // This is separate from the above because of the postMessage differences.
+ // If the control refreshes the preview pane,
+ // we don't want a refresh for every change
+ // but 1 final refresh when the value is changed.
+ rangeInput.on( changeAction, function() {
+ control.setting.set( rangeInput.val() );
+ } );
+
+ // If the text input value changes,
+ // copy the value to the range input
+ // and then save.
+ textInput.on( 'input paste change', function() {
+ rangeInput.attr( 'value', textInput.val() );
+ control.setting.set( textInput.val() );
+ } );
+
+ // If the reset button is clicked,
+ // set slider and text input values to default
+ // and hen save.
+ control.container.find( '.slider-reset' ).on( 'click', function() {
+ textInput.attr( 'value', control.params.default );
+ rangeInput.attr( 'value', control.params.default );
+ control.setting.set( textInput.val() );
+ } );
+ }
+} );
+/* global kirkiControlLoader */
+wp.customize.controlConstructor['kirki-sortable'] = wp.customize.Control.extend( {
+
+ // When we're finished loading continue processing
+ ready: function() {
+
+ 'use strict';
+
+ var control = this;
+
+ // Init the control.
+ if ( ! _.isUndefined( window.kirkiControlLoader ) && _.isFunction( kirkiControlLoader ) ) {
+ kirkiControlLoader( control );
+ } else {
+ control.initKirkiControl();
+ }
+ },
+
+ initKirkiControl: function() {
+
+ 'use strict';
+
+ var control = this;
+
+ control.container.find( '.kirki-controls-loading-spinner' ).hide();
+
+ // Set the sortable container.
+ control.sortableContainer = control.container.find( 'ul.sortable' ).first();
+
+ // Init sortable.
+ control.sortableContainer.sortable( {
+
+ // Update value when we stop sorting.
+ stop: function() {
+ control.updateValue();
+ }
+ } ).disableSelection().find( 'li' ).each( function() {
+
+ // Enable/disable options when we click on the eye of Thundera.
+ jQuery( this ).find( 'i.visibility' ).click( function() {
+ jQuery( this ).toggleClass( 'dashicons-visibility-faint' ).parents( 'li:eq(0)' ).toggleClass( 'invisible' );
+ } );
+ } ).click( function() {
+
+ // Update value on click.
+ control.updateValue();
+ } );
+ },
+
+ /**
+ * Updates the sorting list
+ */
+ updateValue: function() {
+
+ 'use strict';
+
+ var control = this,
+ newValue = [];
+
+ this.sortableContainer.find( 'li' ).each( function() {
+ if ( ! jQuery( this ).is( '.invisible' ) ) {
+ newValue.push( jQuery( this ).data( 'value' ) );
+ }
+ } );
+ control.setting.set( newValue );
+ }
+} );
+wp.customize.controlConstructor['kirki-switch'] = wp.customize.kirkiDynamicControl.extend( {
+
+ initKirkiControl: function() {
+
+ 'use strict';
+
+ var control = this,
+ checkboxValue = control.setting._value;
+
+ // Save the value
+ this.container.on( 'change', 'input', function() {
+ checkboxValue = ( jQuery( this ).is( ':checked' ) ) ? true : false;
+ control.setting.set( checkboxValue );
+ } );
+ }
+} );
+wp.customize.controlConstructor['kirki-toggle'] = wp.customize.kirkiDynamicControl.extend( {
+
+ initKirkiControl: function() {
+
+ var control = this,
+ checkboxValue = control.setting._value;
+
+ // Save the value
+ this.container.on( 'change', 'input', function() {
+ checkboxValue = ( jQuery( this ).is( ':checked' ) ) ? true : false;
+ control.setting.set( checkboxValue );
+ } );
+ }
+} );
+/* global kirkiL10n, kirki */
+wp.customize.controlConstructor['kirki-typography'] = wp.customize.kirkiDynamicControl.extend( {
+
+ initKirkiControl: function() {
+
+ 'use strict';
+
+ var control = this,
+ value = control.setting._value,
+ picker;
+
+ control.renderFontSelector();
+ control.renderBackupFontSelector();
+ control.renderVariantSelector();
+ control.localFontsCheckbox();
+
+ // Font-size.
+ if ( 'undefined' !== typeof control.params.default['font-size'] ) {
+ this.container.on( 'change keyup paste', '.font-size input', function() {
+ control.saveValue( 'font-size', jQuery( this ).val() );
+ } );
+ }
+
+ // Line-height.
+ if ( 'undefined' !== typeof control.params.default['line-height'] ) {
+ this.container.on( 'change keyup paste', '.line-height input', function() {
+ control.saveValue( 'line-height', jQuery( this ).val() );
+ } );
+ }
+
+ // Margin-top.
+ if ( 'undefined' !== typeof control.params.default['margin-top'] ) {
+ this.container.on( 'change keyup paste', '.margin-top input', function() {
+ control.saveValue( 'margin-top', jQuery( this ).val() );
+ } );
+ }
+
+ // Margin-bottom.
+ if ( 'undefined' !== typeof control.params.default['margin-bottom'] ) {
+ this.container.on( 'change keyup paste', '.margin-bottom input', function() {
+ control.saveValue( 'margin-bottom', jQuery( this ).val() );
+ } );
+ }
+
+ // Letter-spacing.
+ if ( 'undefined' !== typeof control.params.default['letter-spacing'] ) {
+ value['letter-spacing'] = ( jQuery.isNumeric( value['letter-spacing'] ) ) ? value['letter-spacing'] + 'px' : value['letter-spacing'];
+ this.container.on( 'change keyup paste', '.letter-spacing input', function() {
+ value['letter-spacing'] = ( jQuery.isNumeric( jQuery( this ).val() ) ) ? jQuery( this ).val() + 'px' : jQuery( this ).val();
+ control.saveValue( 'letter-spacing', value['letter-spacing'] );
+ } );
+ }
+
+ // Word-spacing.
+ if ( 'undefined' !== typeof control.params.default['word-spacing'] ) {
+ this.container.on( 'change keyup paste', '.word-spacing input', function() {
+ control.saveValue( 'word-spacing', jQuery( this ).val() );
+ } );
+ }
+
+ // Text-align.
+ if ( 'undefined' !== typeof control.params.default['text-align'] ) {
+ this.container.on( 'change', '.text-align input', function() {
+ control.saveValue( 'text-align', jQuery( this ).val() );
+ } );
+ }
+
+ // Text-transform.
+ if ( 'undefined' !== typeof control.params.default['text-transform'] ) {
+ jQuery( control.selector + ' .text-transform select' ).selectWoo().on( 'change', function() {
+ control.saveValue( 'text-transform', jQuery( this ).val() );
+ } );
+ }
+
+ // Text-decoration.
+ if ( 'undefined' !== typeof control.params.default['text-decoration'] ) {
+ jQuery( control.selector + ' .text-decoration select' ).selectWoo().on( 'change', function() {
+ control.saveValue( 'text-decoration', jQuery( this ).val() );
+ } );
+ }
+
+ // Color.
+ if ( 'undefined' !== typeof control.params.default.color ) {
+ picker = this.container.find( '.kirki-color-control' );
+ picker.wpColorPicker( {
+ change: function() {
+ setTimeout( function() {
+ control.saveValue( 'color', picker.val() );
+ }, 100 );
+ }
+ } );
+ }
+ },
+
+ /**
+ * Adds the font-families to the font-family dropdown
+ * and instantiates selectWoo.
+ */
+ renderFontSelector: function() {
+
+ var control = this,
+ selector = control.selector + ' .font-family select',
+ data = [],
+ standardFonts = [],
+ googleFonts = [],
+ value = control.setting._value,
+ fonts = control.getFonts(),
+ fontSelect,
+ controlFontFamilies;
+
+ // Format standard fonts as an array.
+ if ( ! _.isUndefined( fonts.standard ) ) {
+ _.each( fonts.standard, function( font ) {
+ standardFonts.push( {
+ id: font.family.replace( /"/g, ''' ),
+ text: font.label
+ } );
+ } );
+ }
+
+ // Format google fonts as an array.
+ if ( ! _.isUndefined( fonts.google ) ) {
+ _.each( fonts.google, function( font ) {
+ googleFonts.push( {
+ id: font.family,
+ text: font.family
+ } );
+ } );
+ }
+
+ // Do we have custom fonts?
+ controlFontFamilies = {};
+ if ( ! _.isUndefined( control.params ) && ! _.isUndefined( control.params.choices ) && ! _.isUndefined( control.params.choices.fonts ) && ! _.isUndefined( control.params.choices.fonts.families ) ) {
+ controlFontFamilies = control.params.choices.fonts.families;
+ }
+
+ // Combine forces and build the final data.
+ data = jQuery.extend( {}, controlFontFamilies, {
+ default: {
+ text: kirkiL10n.defaultCSSValues,
+ children: [
+ { id: '', text: kirkiL10n.defaultBrowserFamily },
+ { id: 'initial', text: 'initial' },
+ { id: 'inherit', text: 'inherit' }
+ ]
+ },
+ standard: {
+ text: kirkiL10n.standardFonts,
+ children: standardFonts
+ },
+ google: {
+ text: kirkiL10n.googleFonts,
+ children: googleFonts
+ }
+ } );
+
+ if ( kirkiL10n.isScriptDebug ) {
+ console.info( 'Kirki Debug: Font families for control "' + control.id + '":' );
+ console.info( data );
+ }
+
+ data = _.values( data );
+
+ // Instantiate selectWoo with the data.
+ fontSelect = jQuery( selector ).selectWoo( {
+ data: data
+ } );
+
+ // Set the initial value.
+ if ( value['font-family'] || '' === value['font-family'] ) {
+ value['font-family'] = kirki.util.parseHtmlEntities( value['font-family'].replace( /'/g, '"' ) );
+ fontSelect.val( value['font-family'] ).trigger( 'change' );
+ }
+
+ // When the value changes
+ fontSelect.on( 'change', function() {
+
+ // Set the value.
+ control.saveValue( 'font-family', jQuery( this ).val() );
+
+ // Re-init the font-backup selector.
+ control.renderBackupFontSelector();
+
+ // Re-init variants selector.
+ control.renderVariantSelector();
+ } );
+ },
+
+ /**
+ * Adds the font-families to the font-family dropdown
+ * and instantiates selectWoo.
+ */
+ renderBackupFontSelector: function() {
+
+ var control = this,
+ selector = control.selector + ' .font-backup select',
+ standardFonts = [],
+ value = control.setting._value,
+ fontFamily = value['font-family'],
+ fonts = control.getFonts(),
+ fontSelect;
+
+ if ( _.isUndefined( value['font-backup'] ) || null === value['font-backup'] ) {
+ value['font-backup'] = '';
+ }
+
+ // Hide if we're not on a google-font.
+ if ( 'inherit' === fontFamily || 'initial' === fontFamily || 'google' !== kirki.util.webfonts.getFontType( fontFamily ) ) {
+ jQuery( control.selector + ' .font-backup' ).hide();
+ return;
+ }
+ jQuery( control.selector + ' .font-backup' ).show();
+
+ // Format standard fonts as an array.
+ if ( ! _.isUndefined( fonts.standard ) ) {
+ _.each( fonts.standard, function( font ) {
+ standardFonts.push( {
+ id: font.family.replace( /"/g, ''' ),
+ text: font.label
+ } );
+ } );
+ }
+
+ // Instantiate selectWoo with the data.
+ fontSelect = jQuery( selector ).selectWoo( {
+ data: standardFonts
+ } );
+
+ // Set the initial value.
+ if ( 'undefined' !== typeof value['font-backup'] ) {
+ fontSelect.val( value['font-backup'].replace( /'/g, '"' ) ).trigger( 'change' );
+ }
+
+ // When the value changes
+ fontSelect.on( 'change', function() {
+
+ // Set the value.
+ control.saveValue( 'font-backup', jQuery( this ).val() );
+ } );
+ },
+
+ /**
+ * Renders the variants selector using selectWoo
+ * Displays font-variants for the currently selected font-family.
+ */
+ renderVariantSelector: function() {
+
+ var control = this,
+ value = control.setting._value,
+ fontFamily = value['font-family'],
+ selector = control.selector + ' .variant select',
+ data = [],
+ isValid = false,
+ fontType = kirki.util.webfonts.getFontType( fontFamily ),
+ variants = [ '', 'regular', 'italic', '700', '700italic' ],
+ fontWeight,
+ variantSelector,
+ fontStyle;
+
+ if ( 'google' === fontType ) {
+ variants = kirki.util.webfonts.google.getVariants( fontFamily );
+ }
+
+ // Check if we've got custom variants defined for this font.
+ if ( ! _.isUndefined( control.params ) && ! _.isUndefined( control.params.choices ) && ! _.isUndefined( control.params.choices.fonts ) && ! _.isUndefined( control.params.choices.fonts.variants ) ) {
+
+ // Check if we have variants for this font-family.
+ if ( ! _.isUndefined( control.params.choices.fonts.variants[ fontFamily ] ) ) {
+ variants = control.params.choices.fonts.variants[ fontFamily ];
+ }
+ }
+ if ( kirkiL10n.isScriptDebug ) {
+ console.info( 'Kirki Debug: Font variants for font-family "' + fontFamily + '":' );
+ console.info( variants );
+ }
+
+ if ( 'inherit' === fontFamily || 'initial' === fontFamily || '' === fontFamily ) {
+ value.variant = 'inherit';
+ variants = [ '' ];
+ jQuery( control.selector + ' .variant' ).hide();
+ }
+
+ if ( 1 >= variants.length ) {
+ jQuery( control.selector + ' .variant' ).hide();
+
+ value.variant = variants[0];
+
+ control.saveValue( 'variant', value.variant );
+
+ if ( '' === value.variant || ! value.variant ) {
+ fontWeight = '';
+ fontStyle = '';
+ } else {
+ fontWeight = ( ! _.isString( value.variant ) ) ? '400' : value.variant.match( /\d/g );
+ fontWeight = ( ! _.isObject( fontWeight ) ) ? '400' : fontWeight.join( '' );
+ fontStyle = ( -1 !== value.variant.indexOf( 'italic' ) ) ? 'italic' : 'normal';
+ }
+
+ control.saveValue( 'font-weight', fontWeight );
+ control.saveValue( 'font-style', fontStyle );
+
+ return;
+ }
+
+ jQuery( control.selector + ' .font-backup' ).show();
+
+ jQuery( control.selector + ' .variant' ).show();
+ _.each( variants, function( variant ) {
+ if ( value.variant === variant ) {
+ isValid = true;
+ }
+ data.push( {
+ id: variant,
+ text: variant
+ } );
+ } );
+ if ( ! isValid ) {
+ value.variant = 'regular';
+ }
+
+ if ( jQuery( selector ).hasClass( 'select2-hidden-accessible' ) ) {
+ jQuery( selector ).selectWoo( 'destroy' );
+ jQuery( selector ).empty();
+ }
+
+ // Instantiate selectWoo with the data.
+ variantSelector = jQuery( selector ).selectWoo( {
+ data: data
+ } );
+ variantSelector.val( value.variant ).trigger( 'change' );
+ variantSelector.on( 'change', function() {
+ control.saveValue( 'variant', jQuery( this ).val() );
+ if ( 'string' !== typeof value.variant ) {
+ value.variant = variants[0];
+ }
+
+ fontWeight = ( ! _.isString( value.variant ) ) ? '400' : value.variant.match( /\d/g );
+ fontWeight = ( ! _.isObject( fontWeight ) ) ? '400' : fontWeight.join( '' );
+ fontStyle = ( -1 !== value.variant.indexOf( 'italic' ) ) ? 'italic' : 'normal';
+
+ control.saveValue( 'font-weight', fontWeight );
+ control.saveValue( 'font-style', fontStyle );
+ } );
+ },
+
+ /**
+ * Get fonts.
+ */
+ getFonts: function() {
+ var control = this,
+ initialGoogleFonts = kirki.util.webfonts.google.getFonts(),
+ googleFonts = {},
+ googleFontsSort = 'alpha',
+ googleFontsNumber = 0,
+ standardFonts = {};
+
+ // Get google fonts.
+ if ( ! _.isEmpty( control.params.choices.fonts.google ) ) {
+ if ( 'alpha' === control.params.choices.fonts.google[0] || 'popularity' === control.params.choices.fonts.google[0] || 'trending' === control.params.choices.fonts.google[0] ) {
+ googleFontsSort = control.params.choices.fonts.google[0];
+ if ( ! isNaN( control.params.choices.fonts.google[1] ) ) {
+ googleFontsNumber = parseInt( control.params.choices.fonts.google[1], 10 );
+ }
+ googleFonts = kirki.util.webfonts.google.getFonts( googleFontsSort, '', googleFontsNumber );
+
+ } else {
+ _.each( control.params.choices.fonts.google, function( fontName ) {
+ if ( 'undefined' !== typeof initialGoogleFonts[ fontName ] && ! _.isEmpty( initialGoogleFonts[ fontName ] ) ) {
+ googleFonts[ fontName ] = initialGoogleFonts[ fontName ];
+ }
+ } );
+ }
+ } else {
+ googleFonts = kirki.util.webfonts.google.getFonts( googleFontsSort, '', googleFontsNumber );
+ }
+
+ // Get standard fonts.
+ if ( ! _.isEmpty( control.params.choices.fonts.standard ) ) {
+ _.each( control.params.choices.fonts.standard, function( fontName ) {
+ if ( 'undefined' !== typeof kirki.util.webfonts.standard.fonts[ fontName ] && ! _.isEmpty( kirki.util.webfonts.standard.fonts[ fontName ] ) ) {
+ standardFonts[ fontName ] = {};
+ if ( 'undefined' !== kirki.util.webfonts.standard.fonts[ fontName ].stack && ! _.isEmpty( kirki.util.webfonts.standard.fonts[ fontName ].stack ) ) {
+ standardFonts[ fontName ].family = kirki.util.webfonts.standard.fonts[ fontName ].stack;
+ } else {
+ standardFonts[ fontName ].family = googleFonts[ fontName ];
+ }
+ if ( 'undefined' !== kirki.util.webfonts.standard.fonts[ fontName ].label && ! _.isEmpty( kirki.util.webfonts.standard.fonts[ fontName ].label ) ) {
+ standardFonts[ fontName ].label = kirki.util.webfonts.standard.fonts[ fontName ].label;
+ } else if ( ! _.isEmpty( standardFonts[ fontName ] ) ) {
+ standardFonts[ fontName ].label = standardFonts[ fontName ];
+ }
+ } else {
+ standardFonts[ fontName ] = {
+ family: fontName,
+ label: fontName
+ };
+ }
+ } );
+ } else {
+ _.each( kirki.util.webfonts.standard.fonts, function( font, id ) {
+ standardFonts[ id ] = {
+ family: font.stack,
+ label: font.label
+ };
+ } );
+ }
+ return {
+ google: googleFonts,
+ standard: standardFonts
+ };
+ },
+
+ localFontsCheckbox: function() {
+ var control = this,
+ checkboxContainer = control.container.find( '.kirki-host-font-locally' ),
+ checkbox = control.container.find( '.kirki-host-font-locally input' ),
+ checked = jQuery( checkbox ).is( ':checked' );
+
+ if ( control.setting._value && control.setting._value.downloadFont ) {
+ jQuery( checkbox ).attr( 'checked', 'checked' );
+ }
+
+ jQuery( checkbox ).on( 'change', function() {
+ checked = jQuery( checkbox ).is( ':checked' );
+ control.saveValue( 'downloadFont', checked );
+ } );
+ },
+
+ /**
+ * Saves the value.
+ */
+ saveValue: function( property, value ) {
+
+ var control = this,
+ input = control.container.find( '.typography-hidden-value' ),
+ val = control.setting._value;
+
+ val[ property ] = value;
+
+ jQuery( input ).attr( 'value', JSON.stringify( val ) ).trigger( 'change' );
+ control.setting.set( val );
+ }
+} );
diff --git a/assets/kirki/controls/js/script.min.js b/assets/kirki/controls/js/script.min.js
new file mode 100644
index 0000000..72a1bf8
--- /dev/null
+++ b/assets/kirki/controls/js/script.min.js
@@ -0,0 +1 @@
+if(_.isUndefined(window.kirkiSetSettingValue))var kirkiSetSettingValue={set:function(i,n){var e,a=this,t=wp.customize.settings.controls[i];if(_.isUndefined(t))return!0;switch(a.setValue(i,n),t.type){case"kirki-background":_.isUndefined(n["background-color"])||a.setColorPicker(a.findElement(i,".kirki-color-control"),n["background-color"]),a.findElement(i,".placeholder, .thumbnail").removeClass().addClass("placeholder").html("No file selected"),_.each(["background-repeat","background-position"],function(e){_.isUndefined(n[e])||a.setSelectWoo(a.findElement(i,"."+e+" select"),n[e])}),_.each(["background-size","background-attachment"],function(e){jQuery(a.findElement(i,"."+e+' input[value="'+n+'"]')).prop("checked",!0)}),e=JSON.stringify(n).replace(/'/g,"'"),jQuery(a.findElement(i,".background-hidden-value").attr("value",e)).trigger("change");break;case"kirki-code":jQuery(a.findElement(i,".CodeMirror"))[0].CodeMirror.setValue(n);break;case"checkbox":case"kirki-switch":case"kirki-toggle":n=1===n||"1"===n||!0===n,jQuery(a.findElement(i,"input")).prop("checked",n),wp.customize.instance(i).set(n);break;case"kirki-select":case"kirki-fontawesome":a.setSelectWoo(a.findElement(i,"select"),n);break;case"kirki-slider":jQuery(a.findElement(i,"input")).prop("value",n),jQuery(a.findElement(i,".kirki_range_value .value")).html(n);break;case"kirki-generic":(_.isUndefined(t.choices)||_.isUndefined(t.choices.element))&&(t.choices.element="input"),jQuery(a.findElement(i,t.choices.element)).prop("value",n);break;case"kirki-color":a.setColorPicker(a.findElement(i,".kirki-color-control"),n);break;case"kirki-multicheck":a.findElement(i,"input").each(function(){jQuery(this).prop("checked",!1)}),_.each(n,function(e,t){jQuery(a.findElement(i,'input[value="'+n[t]+'"]')).prop("checked",!0)});break;case"kirki-multicolor":_.each(n,function(e,t){a.setColorPicker(a.findElement(i,".multicolor-index-"+t),e)});break;case"kirki-radio-buttonset":case"kirki-radio-image":case"kirki-radio":case"kirki-dashicons":case"kirki-color-palette":case"kirki-palette":jQuery(a.findElement(i,'input[value="'+n+'"]')).prop("checked",!0);break;case"kirki-typography":_.each(["font-family","variant"],function(e){_.isUndefined(n[e])||a.setSelectWoo(a.findElement(i,"."+e+" select"),n[e])}),_.each(["font-size","line-height","letter-spacing","word-spacing"],function(e){_.isUndefined(n[e])||jQuery(a.findElement(i,"."+e+" input")).prop("value",n[e])}),_.isUndefined(n.color)||a.setColorPicker(a.findElement(i,".kirki-color-control"),n.color),e=JSON.stringify(n).replace(/'/g,"'"),jQuery(a.findElement(i,".typography-hidden-value").attr("value",e)).trigger("change");break;case"kirki-dimensions":_.each(n,function(e,t){jQuery(a.findElement(i,"."+t+" input")).prop("value",e)});break;case"kirki-repeater":case"kirki-custom":break;default:jQuery(a.findElement(i,"input")).prop("value",n)}},setColorPicker:function(e,t){e.attr("data-default-color",t).data("default-color",t).wpColorPicker("color",t)},setSelectWoo:function(e,t){jQuery(e).selectWoo().val(t).trigger("change")},setTextarea:function(e,t){jQuery(e).prop("value",t)},findElement:function(e,t){return wp.customize.control(e).container.find(t)},setValue:function(e,t,i){i=_.isUndefined(i)?100:parseInt(i,10),wp.customize.instance(e).set({}),setTimeout(function(){wp.customize.instance(e).set(t)},i)}};(kirki={initialized:!1,initialize:function(){this.initialized||(setTimeout(function(){kirki.util.webfonts.standard.initialize(),kirki.util.webfonts.google.initialize()},150),this.initialized=!0)}}).initialize();var kirki=kirki||{};kirki=(kirki=jQuery.extend(kirki,{control:{"kirki-radio":{init:function(e){this.template(e),kirki.input.radio.init(e)},template:function(e){var t=wp.template("kirki-input-radio");e.container.html(t({label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,default:e.params.default,value:kirki.setting.get(e.id),choices:e.params.choices}))}},"kirki-color":{init:function(e){this.template(e),kirki.input.color.init(e)},template:function(e){var t=wp.template("kirki-input-color");e.container.html(t({label:e.params.label,description:e.params.description,"data-id":e.id,mode:e.params.mode,inputAttrs:e.params.inputAttrs,"data-palette":e.params.palette,"data-default-color":e.params.default,"data-alpha":e.params.choices.alpha,value:kirki.setting.get(e.id)}))}},"kirki-generic":{init:function(e){this.template(e),_.isUndefined(e.params)||_.isUndefined(e.params.choices)||_.isUndefined(e.params.choices.element)||"textarea"!==e.params.choices.element?kirki.input.genericInput.init(e):kirki.input.textarea.init(e)},template:function(e){var t,i={label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id)};if(!_.isUndefined(e.params)&&!_.isUndefined(e.params.choices)&&!_.isUndefined(e.params.choices.element)&&"textarea"===e.params.choices.element)return t=wp.template("kirki-input-textarea"),void e.container.html(t(i));t=wp.template("kirki-input-generic"),e.container.html(t(i))}},"kirki-number":{init:function(e){this.template(e),kirki.input.number.init(e)},template:function(e){var t=wp.template("kirki-input-number");e.container.html(t(args={label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id)}))}},"kirki-image":{init:function(e){this.template(e),kirki.input.image.init(e)},template:function(e){var t=wp.template("kirki-input-image");e.container.html(t(args={label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id)}))}},"kirki-select":{init:function(e){this.template(e),kirki.input.select.init(e)},template:function(e){var t=wp.template("kirki-input-select");e.container.html(t({label:e.params.label,description:e.params.description,"data-id":e.id,inputAttrs:e.params.inputAttrs,choices:e.params.choices,value:kirki.setting.get(e.id),multiple:e.params.multiple||1,placeholder:e.params.placeholder}))}}}}))||{},kirki=(kirki=jQuery.extend(kirki,{input:{radio:{init:function(e){jQuery('input[data-id="'+e.id+'"]').on("change keyup paste click",function(){kirki.setting.set(e.id,jQuery(this).val())})}},color:{init:function(e){var t,i=jQuery('.kirki-color-control[data-id="'+e.id+'"]');e.choices=e.choices||{},_.isEmpty(e.choices)&&e.params.choices&&(e.choices=e.params.choices),_.isEmpty(e.choices)||i.wpColorPicker(e.choices),setTimeout(function(){(t=jQuery('.kirki-input-container[data-id="'+e.id+'"] .wp-picker-clear')).length&&t.click(function(){kirki.setting.set(e.id,"")})},200),i.wpColorPicker({change:function(){setTimeout(function(){kirki.setting.set(e.id,i.val())},20)}})}},genericInput:{init:function(e){jQuery('input[data-id="'+e.id+'"]').on("change keyup paste click",function(){kirki.setting.set(e.id,jQuery(this).val())})}},textarea:{init:function(e){jQuery('textarea[data-id="'+e.id+'"]').on("change keyup paste click",function(){kirki.setting.set(e.id,jQuery(this).val())})}},select:{init:function(e){var t,i=jQuery('select[data-id="'+e.id+'"]'),n=parseInt(i.data("multiple"),10),a={escapeMarkup:function(e){return e}};e.params.placeholder&&(a.placeholder=e.params.placeholder,a.allowClear=!0),1=i.params.choices.max?t:t+i.params.choices.step,n.val(e),n.trigger("change")}),t.click(function(){var e,t=parseFloat(n.val());e=t<=i.params.choices.min?t:t-i.params.choices.step,n.val(e),n.trigger("change")}),n.on("change keyup paste click",function(){kirki.setting.set(i.id,jQuery(this).val())})}},image:{init:function(a){var t=kirki.setting.get(a.id),n=_.isUndefined(a.params.choices)||_.isUndefined(a.params.choices.save_as)?"url":a.params.choices.save_as,r=a.container.find(".placeholder, .thumbnail"),e="array"===n?t.url:t,o=a.container.find(".image-upload-remove-button"),s=a.container.find(".image-default-button");t="array"===n&&_.isString(t)?{url:t}:t,a.container.find(".kirki-controls-loading-spinner").hide(),"id"!==n&&"ID"!==n||""===t||wp.media.attachment(t).fetch().then(function(){setTimeout(function(){var e=wp.media.attachment(t).get("url");r.removeClass().addClass("thumbnail thumbnail-image").html(' ')},700)}),("url"===n&&""!==t||"array"===n&&!_.isUndefined(t.url)&&""!==t.url)&&a.container.find("image-default-button").hide(),("url"===n&&""===t||"array"===n&&(_.isUndefined(t.url)||""===t.url))&&o.hide(),t===a.params.default&&a.container.find("image-default-button").hide(),""!==e&&r.removeClass().addClass("thumbnail thumbnail-image").html(' '),a.container.on("click",".image-upload-button",function(e){var i=wp.media({multiple:!1}).open().on("select",function(){var e=i.state().get("selection").first().toJSON(),t=e.url;_.isUndefined(e.sizes)||(previewImg=e.sizes.full.url,_.isUndefined(e.sizes.medium)?_.isUndefined(e.sizes.thumbnail)||(t=e.sizes.thumbnail.url):t=e.sizes.medium.url),"array"===n?kirki.setting.set(a.id,{id:e.id,url:e.sizes.full.url,width:e.width,height:e.height}):"id"===n?kirki.setting.set(a.id,e.id):kirki.setting.set(a.id,_.isUndefined(e.sizes)?e.url:e.sizes.full.url),r.length&&r.removeClass().addClass("thumbnail thumbnail-image").html(' '),o.length&&(o.show(),s.hide())});e.preventDefault()}),a.container.on("click",".image-upload-remove-button",function(e){var t,i,n;e.preventDefault(),kirki.setting.set(a.id,""),t=a.container.find(".placeholder, .thumbnail"),i=a.container.find(".image-upload-remove-button"),n=a.container.find(".image-default-button"),t.length&&t.removeClass().addClass("placeholder").html(kirkiL10n.noFileSelected),i.length&&(i.hide(),jQuery(n).hasClass("button")&&n.show())}),a.container.on("click",".image-default-button",function(e){var t,i,n;e.preventDefault(),kirki.setting.set(a.id,a.params.default),t=a.container.find(".placeholder, .thumbnail"),i=a.container.find(".image-upload-remove-button"),n=a.container.find(".image-default-button"),t.length&&t.removeClass().addClass("thumbnail thumbnail-image").html(' '),i.length&&(i.show(),n.hide())})}}}}))||{},kirki=(kirki=jQuery.extend(kirki,{setting:{get:function(e){var t=e.split("["),i="",n=0,a="";return _.each(t,function(e,t){e=e.replace("]",""),0===t?i=e:i+="["+e+"]",_.isUndefined(wp.customize.instance(i))||(a=wp.customize.instance(i).get(),n=t),n"+e,"text/html").body.textContent}}}),function(){"use strict";wp.customize.kirkiDynamicControl=wp.customize.Control.extend({initialize:function(e,t){var i=t||{};i.params=i.params||{},i.params.type||(i.params.type="kirki-generic"),i.params.content||(i.params.content=jQuery(" "),i.params.content.attr("id","customize-control-"+e.replace(/]/g,"").replace(/\[/g,"-")),i.params.content.attr("class","customize-control customize-control-"+i.params.type)),this.propertyElements=[],wp.customize.Control.prototype.initialize.call(this,e,i)},_setUpSettingRootLinks:function(){var n=this;n.container.find("[data-customize-setting-link]").each(function(){var i=jQuery(this);wp.customize(i.data("customizeSettingLink"),function(e){var t=new wp.customize.Element(i);n.elements.push(t),t.sync(e),t.set(e())})})},_setUpSettingPropertyLinks:function(){var n=this;n.setting&&n.container.find("[data-customize-setting-property-link]").each(function(){var t,e=jQuery(this),i=e.data("customizeSettingPropertyLink");t=new wp.customize.Element(e),n.propertyElements.push(t),t.set(n.setting()[i]),t.bind(function(e){var t=n.setting();e!==t[i]&&((t=_.clone(t))[i]=e,n.setting.set(t))}),n.setting.bind(function(e){e[i]!==t.get()&&t.set(e[i])})})},ready:function(){var e=this;e._setUpSettingRootLinks(),e._setUpSettingPropertyLinks(),wp.customize.Control.prototype.ready.call(e),e.deferred.embedded.done(function(){e.initKirkiControl(e)})},embed:function(){var t=this,e=t.section();e&&wp.customize.section(e,function(e){"kirki-expanded"===e.params.type||e.expanded()||wp.customize.settings.autofocus.control===t.id?t.actuallyEmbed():e.expanded.bind(function(e){e&&t.actuallyEmbed()})})},actuallyEmbed:function(){"resolved"!==this.deferred.embedded.state()&&(this.renderContent(),this.deferred.embedded.resolve())},focus:function(e){this.actuallyEmbed(),wp.customize.Control.prototype.focus.call(this,e)},initKirkiControl:function(e){void 0===kirki.control[e.params.type]?this.container.on("change keyup paste click","input",function(){e.setting.set(jQuery(this).val())}):kirki.control[e.params.type].init(e)}})}(),_.each(kirki.control,function(e,t){wp.customize.controlConstructor[t]=wp.customize.kirkiDynamicControl.extend({})}),wp.customize.controlConstructor["kirki-background"]=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){var o=this,e=o.setting._value,t=o.container.find(".kirki-color-control");(_.isUndefined(e["background-image"])||""===e["background-image"])&&(o.container.find(".background-wrapper > .background-repeat").hide(),o.container.find(".background-wrapper > .background-position").hide(),o.container.find(".background-wrapper > .background-size").hide(),o.container.find(".background-wrapper > .background-attachment").hide()),t.wpColorPicker({change:function(){setTimeout(function(){o.saveValue("background-color",t.val())},100)}}),o.container.on("change",".background-repeat select",function(){o.saveValue("background-repeat",jQuery(this).val())}),o.container.on("change click",".background-size input",function(){o.saveValue("background-size",jQuery(this).val())}),o.container.on("change",".background-position select",function(){o.saveValue("background-position",jQuery(this).val())}),o.container.on("change click",".background-attachment input",function(){o.saveValue("background-attachment",jQuery(this).val())}),o.container.on("click",".background-image-upload-button",function(e){var r=wp.media({multiple:!1}).open().on("select",function(){var e,t,i,n=r.state().get("selection").first(),a=n.toJSON().sizes.full.url;_.isUndefined(n.toJSON().sizes.medium)?_.isUndefined(n.toJSON().sizes.thumbnail)||(a=n.toJSON().sizes.thumbnail.url):a=n.toJSON().sizes.medium.url,e=n.toJSON().sizes.full.url,n.toJSON().id,n.toJSON().width,n.toJSON().height,""!==e&&o.container.find(".background-wrapper > .background-repeat, .background-wrapper > .background-position, .background-wrapper > .background-size, .background-wrapper > .background-attachment").show(),o.saveValue("background-image",e),t=o.container.find(".placeholder, .thumbnail"),i=o.container.find(".background-image-upload-remove-button"),t.length&&t.removeClass().addClass("thumbnail thumbnail-image").html(' '),i.length&&i.show()});e.preventDefault()}),o.container.on("click",".background-image-upload-remove-button",function(e){var t,i;e.preventDefault(),o.saveValue("background-image",""),t=o.container.find(".placeholder, .thumbnail"),i=o.container.find(".background-image-upload-remove-button"),o.container.find(".background-wrapper > .background-repeat").hide(),o.container.find(".background-wrapper > .background-position").hide(),o.container.find(".background-wrapper > .background-size").hide(),o.container.find(".background-wrapper > .background-attachment").hide(),t.length&&t.removeClass().addClass("placeholder").html("No file selected"),i.length&&i.hide()})},saveValue:function(e,t){var i=jQuery("#customize-control-"+this.id.replace("[","-").replace("]","")+" .background-hidden-value"),n=this.setting._value;n[e]=t,jQuery(i).attr("value",JSON.stringify(n)).trigger("change"),this.setting.set(n)}}),wp.customize.controlConstructor["kirki-color-palette"]=wp.customize.kirkiDynamicControl.extend({}),wp.customize.controlConstructor["kirki-dashicons"]=wp.customize.kirkiDynamicControl.extend({}),wp.customize.controlConstructor["kirki-date"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e=this,t=e.selector+" input.datepicker";jQuery(t).datepicker({dateFormat:"yy-mm-dd"}),e.container.find(".kirki-controls-loading-spinner").hide(),this.container.on("change keyup paste","input.datepicker",function(){e.setting.set(jQuery(this).val())})}}),wp.customize.controlConstructor["kirki-dimension"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e,t=this;t.kirkiNotifications(),this.container.on("change keyup paste","input",function(){e=jQuery(this).val(),t.setting.set(e)})},kirkiNotifications:function(){var n=void 0!==this.params.choices&&void 0!==this.params.choices.accept_unitless&&!0===this.params.choices.accept_unitless;wp.customize(this.id,function(i){i.bind(function(e){var t="long_title";!1!==kirki.util.validate.cssValue(e)||n&&!isNaN(e)?i.notifications.remove(t):i.notifications.add(t,new wp.customize.Notification(t,{type:"warning",message:dimensionkirkiL10n["invalid-value"]}))})})}}),wp.customize.controlConstructor["kirki-dimensions"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e,t=this.params.choices.controls,i={},n=[];for(_.each(t,function(e,t){!0===e&&n.push(t)}),e=0;e '+e.text},templateSelection:function(e){return' '+e.text}};_.each(a.icons,function(e){r.data.push({id:e.id,text:e.name})}),(t=jQuery(n).selectWoo(r)).on("change",function(){e=jQuery(this).val(),i.setting.set(e)}),t.val(i.setting._value).trigger("change")}}),wp.customize.controlConstructor["kirki-multicheck"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var n=this;n.container.on("change","input",function(){var t=[],i=0;jQuery.each(n.params.choices,function(e){n.container.find('input[value="'+e+'"]').is(":checked")?(n.container.find('input[value="'+e+'"]').parent().addClass("checked"),t[i]=e,i++):n.container.find('input[value="'+e+'"]').parent().removeClass("checked")}),n.setting.set(t)})}}),wp.customize.controlConstructor["kirki-multicolor"]=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){"use strict";var r=this.params.choices,e=Object.keys(r),t=(this.params.value,0);function i(e,t,i){var n=e.container.find(".multicolor-index-"+i),a={change:function(){setTimeout(function(){e.saveValue(i,n.val()),e.container.find(".multicolor-index-"+i).trigger("change")},100)}};_.isObject(r.irisArgs)&&_.each(r.irisArgs,function(e,t){a[t]=e}),n.wpColorPicker(a)}for(;t/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"};return function(e){return _.template(n.container.find(".customize-control-repeater-content").first().html(),null,t)(e)}}),e.length&&_.each(e,function(e){i=n.addRow(e),n.initColorPicker(),n.initSelect(i,e)}),this.setValue(e,!0,!0),this.repeaterFieldsContainer.sortable({handle:".repeater-row-header",update:function(){n.sort()}})},openFrame:function(e){"use strict";wp.customize.utils.isKeydownButNotEnterEvent(e)||(this.$thisButton.closest(".repeater-field").hasClass("repeater-field-cropped_image")?this.initCropperFrame():this.initFrame(),this.frame.open())},initFrame:function(){"use strict";var e=this.getMimeType();this.frame=wp.media({states:[new wp.media.controller.Library({library:wp.media.query({type:e}),multiple:!1,date:!1})]}),this.frame.on("select",this.onSelect,this)},initCropperFrame:function(){"use strict";var t=this.$thisButton.siblings("input.hidden-field").attr("data-field"),e=this.getMimeType();_.isString(t)&&""!==t&&_.isObject(this.params.fields[t])&&"cropped_image"===this.params.fields[t].type&&["width","height","flex_width","flex_height"].forEach(function(e){_.isUndefined(this.params.fields[t][e])||(this.params[e]=this.params.fields[t][e])}.bind(this)),this.frame=wp.media({button:{text:"Select and Crop",close:!1},states:[new wp.media.controller.Library({library:wp.media.query({type:e}),multiple:!1,date:!1,suggestedWidth:this.params.width,suggestedHeight:this.params.height}),new wp.media.controller.CustomizeImageCropper({imgSelectOptions:this.calculateImageSelectOptions,control:this})]}),this.frame.on("select",this.onSelectForCrop,this),this.frame.on("cropped",this.onCropped,this),this.frame.on("skippedcrop",this.onSkippedCrop,this)},onSelect:function(){"use strict";var e=this.frame.state().get("selection").first().toJSON();this.$thisButton.closest(".repeater-field").hasClass("repeater-field-upload")?this.setFileInRepeaterField(e):this.setImageInRepeaterField(e)},onSelectForCrop:function(){"use strict";var e=this.frame.state().get("selection").first().toJSON();this.params.width!==e.width||this.params.height!==e.height||this.params.flex_width||this.params.flex_height?this.frame.setState("cropper"):this.setImageInRepeaterField(e)},onCropped:function(e){"use strict";this.setImageInRepeaterField(e)},calculateImageSelectOptions:function(e,t){"use strict";var i,n,a,r=t.get("control"),o=!!parseInt(r.params.flex_width,10),s=!!parseInt(r.params.flex_height,10),c=e.get("width"),l=e.get("height"),u=parseInt(r.params.width,10),d=parseInt(r.params.height,10),p=u/d,h=c,f=l;return t.set("canSkipCrop",!r.mustBeCropped(o,s,u,d,c,l)),p').hide().slideDown("slow"),t.find(".hidden-field").val(e.id),this.$thisButton.text(this.$thisButton.data("alt-label")),t.find(".remove-button").show(),t.find("input, textarea, select").trigger("change"),this.frame.close()},setFileInRepeaterField:function(e){"use strict";var t=this.$thisButton.closest(".repeater-field-upload");t.find(".kirki-file-attachment").html(' '+e.filename+" ").hide().slideDown("slow"),t.find(".hidden-field").val(e.id),this.$thisButton.text(this.$thisButton.data("alt-label")),t.find(".upload-button").show(),t.find(".remove-button").show(),t.find("input, textarea, select").trigger("change"),this.frame.close()},getMimeType:function(){"use strict";var e=this.$thisButton.siblings("input.hidden-field").attr("data-field");return _.isString(e)&&""!==e&&_.isObject(this.params.fields[e])&&"upload"===this.params.fields[e].type&&!_.isUndefined(this.params.fields[e].mime_type)?this.params.fields[e].mime_type:"image"},removeImage:function(e){"use strict";var t,i;wp.customize.utils.isKeydownButNotEnterEvent(e)||(i=(t=this.$thisButton.closest(".repeater-field-image,.repeater-field-cropped_image,.repeater-field-upload")).find(".upload-button"),t.find(".kirki-image-attachment").slideUp("fast",function(){jQuery(this).show().html(jQuery(this).data("placeholder"))}),t.find(".hidden-field").val(""),i.text(i.data("label")),this.$thisButton.hide(),t.find("input, textarea, select").trigger("change"))},removeFile:function(e){"use strict";var t,i;wp.customize.utils.isKeydownButNotEnterEvent(e)||(i=(t=this.$thisButton.closest(".repeater-field-upload")).find(".upload-button"),t.find(".kirki-file-attachment").slideUp("fast",function(){jQuery(this).show().html(jQuery(this).data("placeholder"))}),t.find(".hidden-field").val(""),i.text(i.data("label")),this.$thisButton.hide(),t.find("input, textarea, select").trigger("change"))},getValue:function(){"use strict";return JSON.parse(decodeURI(this.setting.get()))},setValue:function(e,t,i){"use strict";var a=e,r=[];i&&(jQuery.each(this.params.fields,function(e,t){"image"!==t.type&&"cropped_image"!==t.type&&"upload"!==t.type||r.push(e)}),jQuery.each(e,function(i,n){jQuery.each(r,function(e,t){_.isUndefined(n[t])||_.isUndefined(n[t].id)||(a[i][t]=n[t].id)})})),this.setting.set(encodeURI(JSON.stringify(a))),t&&this.settingField.trigger("change")},addRow:function(e){"use strict";var t,a,i,r=this,n=r.repeaterTemplate(),o=this.getValue(),s={};if(n){if(t=jQuery.extend(!0,{},r.params.fields),e)for(i in e)e.hasOwnProperty(i)&&t.hasOwnProperty(i)&&(t[i].default=e[i]);for(i in t.index=this.currentIndex,n=n(t),(a=new RepeaterRow(r.currentIndex,jQuery(n).appendTo(r.repeaterFieldsContainer),r.params.row_label,r)).container.on("row:remove",function(e,t){r.deleteRow(t)}),a.container.on("row:update",function(e,t,i,n){r.updateField.call(r,e,t,i,n),a.updateLabel()}),this.rows[this.currentIndex]=a,t)t.hasOwnProperty(i)&&(s[i]=t[i].default);return o[this.currentIndex]=s,this.setValue(o,!0),this.currentIndex++,a}},sort:function(){"use strict";var i=this,e=this.repeaterFieldsContainer.find(".repeater-row"),n=[],a=i.getValue(),r=[],o=[];e.each(function(e,t){n.push(jQuery(t).data("row"))}),jQuery.each(n,function(e,t){r[e]=i.rows[t],r[e].setRowIndex(e),o[e]=a[t]}),i.rows=r,i.setValue(o)},deleteRow:function(e){"use strict";var t,i=this.getValue();for(t in i[e]&&this.rows[e]&&(delete i[e],delete this.rows[e],this.setValue(i,!0)),1,this.rows)this.rows.hasOwnProperty(t)&&this.rows[t]&&(this.rows[t].updateLabel(),0)},updateField:function(e,t,i,n){"use strict";var a,r,o;this.rows[t]&&this.params.fields[i]&&(a=this.params.fields[i].type,r=this.rows[t],o=this.getValue(),n=jQuery(n),_.isUndefined(o[r.rowIndex][i])||(o[r.rowIndex][i]="checkbox"===a?n.is(":checked"):n.val(),this.setValue(o,!0)))},initColorPicker:function(){"use strict";var r=this,e=r.container.find(".color-picker-hex"),t={},i=e.data("field");_.isUndefined(i)||_.isUndefined(r.params.fields[i])||_.isUndefined(r.params.fields[i].palettes)||!_.isObject(r.params.fields[i].palettes)||(t.palettes=r.params.fields[i].palettes),t.change=function(e,t){var i=jQuery(e.target),n=i.closest(".repeater-row").data("row"),a=r.getValue();a[n][i.data("field")]=t.color.toString(),r.setValue(a,!0)},0!==e.length&&e.wpColorPicker(t)},initSelect:function(e,t){"use strict";var i,n,a=this,r=e.container.find(".repeater-field select"),o={};0!==r.length&&(i=r.data("field"),"undefed"!==(n=jQuery(r).data("multiple"))&&jQuery.isNumeric(n)&&1<(n=parseInt(n,10))&&(o.maximumSelectionLength=n),(t=t||{})[i]=t[i]||"",jQuery(r).selectWoo(o).val(t[i]||jQuery(r).val()),this.container.on("change",".repeater-field select",function(e){var t=jQuery(e.target),i=t.closest(".repeater-row").data("row"),n=a.getValue();n[i][t.data("field")]=jQuery(this).val(),a.setValue(n)}))}}),wp.customize.controlConstructor["kirki-slider"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e=this,t="postMessage"===e.setting.transport?"mousemove change":"change",i=e.container.find('input[type="range"]'),n=e.container.find('input[type="text"]'),a=e.setting._value;n.attr("value",a),i.on("mousemove change",function(){n.attr("value",i.val())}),i.on(t,function(){e.setting.set(i.val())}),n.on("input paste change",function(){i.attr("value",n.val()),e.setting.set(n.val())}),e.container.find(".slider-reset").on("click",function(){n.attr("value",e.params.default),i.attr("value",e.params.default),e.setting.set(n.val())})}}),wp.customize.controlConstructor["kirki-sortable"]=wp.customize.Control.extend({ready:function(){"use strict";!_.isUndefined(window.kirkiControlLoader)&&_.isFunction(kirkiControlLoader)?kirkiControlLoader(this):this.initKirkiControl()},initKirkiControl:function(){"use strict";var e=this;e.container.find(".kirki-controls-loading-spinner").hide(),e.sortableContainer=e.container.find("ul.sortable").first(),e.sortableContainer.sortable({stop:function(){e.updateValue()}}).disableSelection().find("li").each(function(){jQuery(this).find("i.visibility").click(function(){jQuery(this).toggleClass("dashicons-visibility-faint").parents("li:eq(0)").toggleClass("invisible")})}).click(function(){e.updateValue()})},updateValue:function(){"use strict";var e=[];this.sortableContainer.find("li").each(function(){jQuery(this).is(".invisible")||e.push(jQuery(this).data("value"))}),this.setting.set(e)}}),wp.customize.controlConstructor["kirki-switch"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){"use strict";var e=this,t=e.setting._value;this.container.on("change","input",function(){t=!!jQuery(this).is(":checked"),e.setting.set(t)})}}),wp.customize.controlConstructor["kirki-toggle"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){var e=this,t=e.setting._value;this.container.on("change","input",function(){t=!!jQuery(this).is(":checked"),e.setting.set(t)})}}),wp.customize.controlConstructor["kirki-typography"]=wp.customize.kirkiDynamicControl.extend({initKirkiControl:function(){"use strict";var e,t=this,i=t.setting._value;t.renderFontSelector(),t.renderBackupFontSelector(),t.renderVariantSelector(),t.localFontsCheckbox(),void 0!==t.params.default["font-size"]&&this.container.on("change keyup paste",".font-size input",function(){t.saveValue("font-size",jQuery(this).val())}),void 0!==t.params.default["line-height"]&&this.container.on("change keyup paste",".line-height input",function(){t.saveValue("line-height",jQuery(this).val())}),void 0!==t.params.default["margin-top"]&&this.container.on("change keyup paste",".margin-top input",function(){t.saveValue("margin-top",jQuery(this).val())}),void 0!==t.params.default["margin-bottom"]&&this.container.on("change keyup paste",".margin-bottom input",function(){t.saveValue("margin-bottom",jQuery(this).val())}),void 0!==t.params.default["letter-spacing"]&&(i["letter-spacing"]=jQuery.isNumeric(i["letter-spacing"])?i["letter-spacing"]+"px":i["letter-spacing"],this.container.on("change keyup paste",".letter-spacing input",function(){i["letter-spacing"]=jQuery.isNumeric(jQuery(this).val())?jQuery(this).val()+"px":jQuery(this).val(),t.saveValue("letter-spacing",i["letter-spacing"])})),void 0!==t.params.default["word-spacing"]&&this.container.on("change keyup paste",".word-spacing input",function(){t.saveValue("word-spacing",jQuery(this).val())}),void 0!==t.params.default["text-align"]&&this.container.on("change",".text-align input",function(){t.saveValue("text-align",jQuery(this).val())}),void 0!==t.params.default["text-transform"]&&jQuery(t.selector+" .text-transform select").selectWoo().on("change",function(){t.saveValue("text-transform",jQuery(this).val())}),void 0!==t.params.default["text-decoration"]&&jQuery(t.selector+" .text-decoration select").selectWoo().on("change",function(){t.saveValue("text-decoration",jQuery(this).val())}),void 0!==t.params.default.color&&(e=this.container.find(".kirki-color-control")).wpColorPicker({change:function(){setTimeout(function(){t.saveValue("color",e.val())},100)}})},renderFontSelector:function(){var e,t,i=this,n=i.selector+" .font-family select",a=[],r=[],o=[],s=i.setting._value,c=i.getFonts();_.isUndefined(c.standard)||_.each(c.standard,function(e){r.push({id:e.family.replace(/"/g,"'"),text:e.label})}),_.isUndefined(c.google)||_.each(c.google,function(e){o.push({id:e.family,text:e.family})}),t={},_.isUndefined(i.params)||_.isUndefined(i.params.choices)||_.isUndefined(i.params.choices.fonts)||_.isUndefined(i.params.choices.fonts.families)||(t=i.params.choices.fonts.families),a=jQuery.extend({},t,{default:{text:kirkiL10n.defaultCSSValues,children:[{id:"",text:kirkiL10n.defaultBrowserFamily},{id:"initial",text:"initial"},{id:"inherit",text:"inherit"}]},standard:{text:kirkiL10n.standardFonts,children:r},google:{text:kirkiL10n.googleFonts,children:o}}),kirkiL10n.isScriptDebug&&(console.info('Kirki Debug: Font families for control "'+i.id+'":'),console.info(a)),a=_.values(a),e=jQuery(n).selectWoo({data:a}),(s["font-family"]||""===s["font-family"])&&(s["font-family"]=kirki.util.parseHtmlEntities(s["font-family"].replace(/'/g,'"')),e.val(s["font-family"]).trigger("change")),e.on("change",function(){i.saveValue("font-family",jQuery(this).val()),i.renderBackupFontSelector(),i.renderVariantSelector()})},renderBackupFontSelector:function(){var e,t=this,i=t.selector+" .font-backup select",n=[],a=t.setting._value,r=a["font-family"],o=t.getFonts();(_.isUndefined(a["font-backup"])||null===a["font-backup"])&&(a["font-backup"]=""),"inherit"!==r&&"initial"!==r&&"google"===kirki.util.webfonts.getFontType(r)?(jQuery(t.selector+" .font-backup").show(),_.isUndefined(o.standard)||_.each(o.standard,function(e){n.push({id:e.family.replace(/"/g,"'"),text:e.label})}),e=jQuery(i).selectWoo({data:n}),void 0!==a["font-backup"]&&e.val(a["font-backup"].replace(/'/g,'"')).trigger("change"),e.on("change",function(){t.saveValue("font-backup",jQuery(this).val())})):jQuery(t.selector+" .font-backup").hide()},renderVariantSelector:function(){var e,t,i,n=this,a=n.setting._value,r=a["font-family"],o=n.selector+" .variant select",s=[],c=!1,l=kirki.util.webfonts.getFontType(r),u=["","regular","italic","700","700italic"];if("google"===l&&(u=kirki.util.webfonts.google.getVariants(r)),_.isUndefined(n.params)||_.isUndefined(n.params.choices)||_.isUndefined(n.params.choices.fonts)||_.isUndefined(n.params.choices.fonts.variants)||_.isUndefined(n.params.choices.fonts.variants[r])||(u=n.params.choices.fonts.variants[r]),kirkiL10n.isScriptDebug&&(console.info('Kirki Debug: Font variants for font-family "'+r+'":'),console.info(u)),"inherit"!==r&&"initial"!==r&&""!==r||(a.variant="inherit",u=[""],jQuery(n.selector+" .variant").hide()),u.length<=1)return jQuery(n.selector+" .variant").hide(),a.variant=u[0],n.saveValue("variant",a.variant),i=""!==a.variant&&a.variant?(e=_.isString(a.variant)?a.variant.match(/\d/g):"400",e=_.isObject(e)?e.join(""):"400",-1!==a.variant.indexOf("italic")?"italic":"normal"):e="",n.saveValue("font-weight",e),void n.saveValue("font-style",i);jQuery(n.selector+" .font-backup").show(),jQuery(n.selector+" .variant").show(),_.each(u,function(e){a.variant===e&&(c=!0),s.push({id:e,text:e})}),c||(a.variant="regular"),jQuery(o).hasClass("select2-hidden-accessible")&&(jQuery(o).selectWoo("destroy"),jQuery(o).empty()),(t=jQuery(o).selectWoo({data:s})).val(a.variant).trigger("change"),t.on("change",function(){n.saveValue("variant",jQuery(this).val()),"string"!=typeof a.variant&&(a.variant=u[0]),e=_.isString(a.variant)?a.variant.match(/\d/g):"400",e=_.isObject(e)?e.join(""):"400",i=-1!==a.variant.indexOf("italic")?"italic":"normal",n.saveValue("font-weight",e),n.saveValue("font-style",i)})},getFonts:function(){var e=this,t=kirki.util.webfonts.google.getFonts(),i={},n="alpha",a=0,r={};return _.isEmpty(e.params.choices.fonts.google)?i=kirki.util.webfonts.google.getFonts(n,"",a):"alpha"===e.params.choices.fonts.google[0]||"popularity"===e.params.choices.fonts.google[0]||"trending"===e.params.choices.fonts.google[0]?(n=e.params.choices.fonts.google[0],isNaN(e.params.choices.fonts.google[1])||(a=parseInt(e.params.choices.fonts.google[1],10)),i=kirki.util.webfonts.google.getFonts(n,"",a)):_.each(e.params.choices.fonts.google,function(e){void 0===t[e]||_.isEmpty(t[e])||(i[e]=t[e])}),_.isEmpty(e.params.choices.fonts.standard)?_.each(kirki.util.webfonts.standard.fonts,function(e,t){r[t]={family:e.stack,label:e.label}}):_.each(e.params.choices.fonts.standard,function(e){void 0===kirki.util.webfonts.standard.fonts[e]||_.isEmpty(kirki.util.webfonts.standard.fonts[e])?r[e]={family:e,label:e}:(r[e]={},"undefined"===kirki.util.webfonts.standard.fonts[e].stack||_.isEmpty(kirki.util.webfonts.standard.fonts[e].stack)?r[e].family=i[e]:r[e].family=kirki.util.webfonts.standard.fonts[e].stack,"undefined"===kirki.util.webfonts.standard.fonts[e].label||_.isEmpty(kirki.util.webfonts.standard.fonts[e].label)?_.isEmpty(r[e])||(r[e].label=r[e]):r[e].label=kirki.util.webfonts.standard.fonts[e].label)}),{google:i,standard:r}},localFontsCheckbox:function(){var e=this,t=(e.container.find(".kirki-host-font-locally"),e.container.find(".kirki-host-font-locally input")),i=jQuery(t).is(":checked");e.setting._value&&e.setting._value.downloadFont&&jQuery(t).attr("checked","checked"),jQuery(t).on("change",function(){i=jQuery(t).is(":checked"),e.saveValue("downloadFont",i)})},saveValue:function(e,t){var i=this.container.find(".typography-hidden-value"),n=this.setting._value;n[e]=t,jQuery(i).attr("value",JSON.stringify(n)).trigger("change"),this.setting.set(n)}});
\ No newline at end of file
diff --git a/assets/kirki/controls/php/class-kirki-control-background.php b/assets/kirki/controls/php/class-kirki-control-background.php
new file mode 100644
index 0000000..cb4f946
--- /dev/null
+++ b/assets/kirki/controls/php/class-kirki-control-background.php
@@ -0,0 +1,126 @@
+
+
+ {{{ data.label }}}
+ <# if ( data.description ) { #>{{{ data.description }}} <# } #>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ selected <# } #>>
+ selected <# } #>>
+ selected <# } #>>
+ selected <# } #>>
+
+
+
+
+
+
+
+ selected <# } #>>
+ selected <# } #>>
+ selected <# } #>>
+ selected <# } #>>
+ selected <# } #>>
+ selected <# } #>>
+ selected <# } #>>
+ selected <# } #>>
+ selected <# } #>>
+
+
+
+
+
+
+
+
+
+ ( defined( 'SCRIPT_DEBUG' ) && true === SCRIPT_DEBUG ),
+ 'noFileSelected' => esc_attr__( 'No File Selected', 'kirki' ),
+ 'remove' => esc_attr__( 'Remove', 'kirki' ),
+ 'default' => esc_attr__( 'Default', 'kirki' ),
+ 'selectFile' => esc_attr__( 'Select File', 'kirki' ),
+ 'standardFonts' => esc_attr__( 'Standard Fonts', 'kirki' ),
+ 'googleFonts' => esc_attr__( 'Google Fonts', 'kirki' ),
+ 'defaultCSSValues' => esc_attr__( 'CSS Defaults', 'kirki' ),
+ 'defaultBrowserFamily' => esc_attr__( 'Default Browser Font-Family', 'kirki' ),
+ )
+ );
+
+ $suffix = str_replace( '.min', '', $suffix );
+ // Enqueue the style.
+ wp_enqueue_style(
+ 'kirki-styles',
+ "{$kirki_url}controls/css/styles{$suffix}.css",
+ array(),
+ KIRKI_VERSION
+ );
+ }
+
+ /**
+ * Refresh the parameters passed to the JavaScript via JSON.
+ *
+ * @see WP_Customize_Control::to_json()
+ */
+ public function to_json() {
+ // Get the basics from the parent class.
+ parent::to_json();
+ // Default value.
+ $this->json['default'] = $this->setting->default;
+ if ( isset( $this->default ) ) {
+ $this->json['default'] = $this->default;
+ }
+ // Required.
+ $this->json['required'] = $this->required;
+ // Output.
+ $this->json['output'] = $this->output;
+ // Value.
+ $this->json['value'] = $this->value();
+ // Choices.
+ $this->json['choices'] = $this->choices;
+ // The link.
+ $this->json['link'] = $this->get_link();
+ // The ID.
+ $this->json['id'] = $this->id;
+ // Translation strings.
+ $this->json['l10n'] = $this->l10n();
+ // The ajaxurl in case we need it.
+ $this->json['ajaxurl'] = admin_url( 'admin-ajax.php' );
+ // Input attributes.
+ $this->json['inputAttrs'] = '';
+ foreach ( $this->input_attrs as $attr => $value ) {
+ $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
+ }
+ // The kirki-config.
+ $this->json['kirkiConfig'] = $this->kirki_config;
+ // The option-type.
+ $this->json['kirkiOptionType'] = $this->option_type;
+ // The option-name.
+ $this->json['kirkiOptionName'] = $this->option_name;
+ // The preset.
+ $this->json['preset'] = $this->preset;
+ // The CSS-Variables.
+ $this->json['css-var'] = $this->css_vars;
+ }
+
+ /**
+ * Render the control's content.
+ *
+ * Allows the content to be overridden without having to rewrite the wrapper in `$this::render()`.
+ *
+ * Supports basic input types `text`, `checkbox`, `textarea`, `radio`, `select` and `dropdown-pages`.
+ * Additional input types such as `email`, `url`, `number`, `hidden` and `date` are supported implicitly.
+ *
+ * Control content can alternately be rendered in JS. See WP_Customize_Control::print_template().
+ *
+ * @since 3.4.0
+ */
+ protected function render_content() {}
+
+ /**
+ * An Underscore (JS) template for this control's content (but not its container).
+ *
+ * Class variables for this control class are available in the `data` JS object;
+ * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
+ *
+ * @see WP_Customize_Control::print_template()
+ *
+ * @access protected
+ */
+ protected function content_template() {}
+
+ /**
+ * Returns an array of translation strings.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @return array
+ */
+ protected function l10n() {
+ return array();
+ }
+}
diff --git a/assets/kirki/controls/php/class-kirki-control-checkbox.php b/assets/kirki/controls/php/class-kirki-control-checkbox.php
new file mode 100644
index 0000000..e66ff45
--- /dev/null
+++ b/assets/kirki/controls/php/class-kirki-control-checkbox.php
@@ -0,0 +1,56 @@
+render_content.
+ *
+ * @since 3.0.26
+ */
+ protected function render_content() {
+ $input_id = '_customize-input-' . $this->id;
+ $description_id = '_customize-description-' . $this->id;
+ ?>
+
+ description ) ) ? ' aria-describedby="' . esc_attr( $description_id ) . '" ' : ''; ?>
+ type="checkbox"
+ value="value() ); ?>"
+ link(); ?>
+ value() ); ?>
+ />
+ label ); ?>
+ description ) ) : ?>
+ description ); ?>
+
+
+
+
+ json['choices']['colors'] ) || empty( $this->json['choices']['colors'] ) ) {
+ $this->json['choices']['colors'] = Kirki_Helper::get_material_design_colors( 'primary' );
+ }
+ if ( ! isset( $this->json['choices']['size'] ) || empty( $this->json['choices']['size'] ) ) {
+ $this->json['choices']['size'] = 20;
+ }
+ }
+
+ /**
+ * An Underscore (JS) template for this control's content (but not its container).
+ *
+ * Class variables for this control class are available in the `data` JS object;
+ * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
+ *
+ * @see WP_Customize_Control::print_template()
+ *
+ * @access protected
+ */
+ protected function content_template() {
+ ?>
+ <# if ( ! data.choices ) { return; } #>
+
+ {{{ data.label }}}
+
+ <# if ( data.description ) { #>
+
{{{ data.description }}}
+ <# } #>
+
+ <# for ( key in data.choices['colors'] ) { #>
+ checked<# } #>>
+
+ {{ data.choices['colors'][ key ] }}
+
+
+ <# } #>
+
+ json['palette'] = $this->palette;
+ $this->json['choices']['alpha'] = ( isset( $this->choices['alpha'] ) && $this->choices['alpha'] ) ? 'true' : 'false';
+ $this->json['mode'] = $this->mode;
+ }
+}
diff --git a/assets/kirki/controls/php/class-kirki-control-cropped-image.php b/assets/kirki/controls/php/class-kirki-control-cropped-image.php
new file mode 100644
index 0000000..29603be
--- /dev/null
+++ b/assets/kirki/controls/php/class-kirki-control-cropped-image.php
@@ -0,0 +1,37 @@
+json['required'] = $this->required;
+ }
+}
diff --git a/assets/kirki/controls/php/class-kirki-control-custom.php b/assets/kirki/controls/php/class-kirki-control-custom.php
new file mode 100644
index 0000000..8df0104
--- /dev/null
+++ b/assets/kirki/controls/php/class-kirki-control-custom.php
@@ -0,0 +1,62 @@
+
+
+ <# if ( data.label ) { #>{{{ data.label }}} <# } #>
+ <# if ( data.description ) { #>{{{ data.description }}} <# } #>
+
+ {{{ data.value }}}
+
+ json['icons'] = Kirki_Helper::get_dashicons();
+ }
+
+ /**
+ * An Underscore (JS) template for this control's content (but not its container).
+ *
+ * Class variables for this control class are available in the `data` JS object;
+ * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
+ *
+ * @see WP_Customize_Control::print_template()
+ *
+ * @access protected
+ */
+ protected function content_template() {
+ ?>
+ <# if ( data.label ) { #>
{{{ data.label }}} <# } #>
+ <# if ( data.description ) { #>
{{{ data.description }}} <# } #>
+
+ <# if ( ! _.isUndefined( data.choices ) && 1 < _.size( data.choices ) ) { #>
+ <# for ( key in data.choices ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ <# } else { #>
+
Admin Menu
+ <# for ( key in data.icons['admin-menu'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ Welcome Screen
+ <# for ( key in data.icons['welcome-screen'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ Post Formats
+ <# for ( key in data.icons['post-formats'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ Media
+ <# for ( key in data.icons['media'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ Image Editing
+ <# for ( key in data.icons['image-editing'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ TinyMCE
+ <# for ( key in data.icons['tinymce'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ Posts
+ <# for ( key in data.icons['posts'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ Sorting
+ <# for ( key in data.icons['sorting'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ Social
+ <# for ( key in data.icons['social'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ WordPress
+ <# for ( key in data.icons['wordpress_org'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ Products
+ <# for ( key in data.icons['products'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ Taxonomies
+ <# for ( key in data.icons['taxonomies'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ Widgets
+ <# for ( key in data.icons['widgets'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ Notifications
+ <# for ( key in data.icons['notifications'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ Misc
+ <# for ( key in data.icons['misc'] ) { #>
+ checked="checked"<# } #>>
+
+
+ <# } #>
+ <# } #>
+
+
+
+ <# if ( data.label ) { #>{{{ data.label }}} <# } #>
+ <# if ( data.description ) { #>{{{ data.description }}} <# } #>
+
+
+
+
+ esc_attr__( 'Invalid Value', 'kirki' ),
+ )
+ );
+ }
+
+ /**
+ * An Underscore (JS) template for this control's content (but not its container).
+ *
+ * Class variables for this control class are available in the `data` JS object;
+ * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
+ *
+ * @see WP_Customize_Control::print_template()
+ *
+ * @access protected
+ */
+ protected function content_template() {
+ ?>
+
+ <# if ( data.label ) { #>{{{ data.label }}} <# } #>
+ <# if ( data.description ) { #>{{{ data.description }}} <# } #>
+
+ <# var val = ( data.value && _.isString( data.value ) ) ? data.value.replace( '%%', '%' ) : ''; #>
+
+
+
+ choices ) ) {
+ foreach ( $this->choices as $choice => $value ) {
+ if ( 'labels' !== $choice && true === $value ) {
+ $this->json['choices'][ $choice ] = true;
+ }
+ }
+ }
+ if ( is_array( $this->json['default'] ) ) {
+ foreach ( $this->json['default'] as $key => $value ) {
+ if ( isset( $this->json['choices'][ $key ] ) && ! isset( $this->json['value'][ $key ] ) ) {
+ $this->json['value'][ $key ] = $value;
+ }
+ }
+ }
+ }
+
+ /**
+ * Enqueue control related scripts/styles.
+ *
+ * @access public
+ */
+ public function enqueue() {
+
+ wp_enqueue_style( 'kirki-styles', trailingslashit( Kirki::$url ) . 'controls/css/styles.css', array(), KIRKI_VERSION );
+ wp_localize_script( 'kirki-script', 'dimensionskirkiL10n', $this->l10n() );
+ }
+
+ /**
+ * An Underscore (JS) template for this control's content (but not its container).
+ *
+ * Class variables for this control class are available in the `data` JS object;
+ * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
+ *
+ * @see WP_Customize_Control::print_template()
+ *
+ * @access protected
+ */
+ protected function content_template() {
+ ?>
+
+ <# if ( data.label ) { #>{{{ data.label }}} <# } #>
+ <# if ( data.description ) { #>{{{ data.description }}} <# } #>
+
+
+ <# for ( choiceKey in data.default ) { #>
+
+
+ <# if ( ! _.isUndefined( data.choices.labels ) && ! _.isUndefined( data.choices.labels[ choiceKey ] ) ) { #>
+ {{ data.choices.labels[ choiceKey ] }}
+ <# } else if ( ! _.isUndefined( data.l10n[ choiceKey ] ) ) { #>
+ {{ data.l10n[ choiceKey ] }}
+ <# } else { #>
+ {{ choiceKey }}
+ <# } #>
+
+
+ <# var val = ( ! _.isUndefined( data.value ) && ! _.isUndefined( data.value[ choiceKey ] ) ) ? data.value[ choiceKey ].toString().replace( '%%', '%' ) : ''; #>
+
+
+
+ <# } #>
+
+
+
+ esc_attr__( 'Left Top', 'kirki' ),
+ 'left-center' => esc_attr__( 'Left Center', 'kirki' ),
+ 'left-bottom' => esc_attr__( 'Left Bottom', 'kirki' ),
+ 'right-top' => esc_attr__( 'Right Top', 'kirki' ),
+ 'right-center' => esc_attr__( 'Right Center', 'kirki' ),
+ 'right-bottom' => esc_attr__( 'Right Bottom', 'kirki' ),
+ 'center-top' => esc_attr__( 'Center Top', 'kirki' ),
+ 'center-center' => esc_attr__( 'Center Center', 'kirki' ),
+ 'center-bottom' => esc_attr__( 'Center Bottom', 'kirki' ),
+ 'font-size' => esc_attr__( 'Font Size', 'kirki' ),
+ 'font-weight' => esc_attr__( 'Font Weight', 'kirki' ),
+ 'line-height' => esc_attr__( 'Line Height', 'kirki' ),
+ 'font-style' => esc_attr__( 'Font Style', 'kirki' ),
+ 'letter-spacing' => esc_attr__( 'Letter Spacing', 'kirki' ),
+ 'word-spacing' => esc_attr__( 'Word Spacing', 'kirki' ),
+ 'top' => esc_attr__( 'Top', 'kirki' ),
+ 'bottom' => esc_attr__( 'Bottom', 'kirki' ),
+ 'left' => esc_attr__( 'Left', 'kirki' ),
+ 'right' => esc_attr__( 'Right', 'kirki' ),
+ 'center' => esc_attr__( 'Center', 'kirki' ),
+ 'size' => esc_attr__( 'Size', 'kirki' ),
+ 'spacing' => esc_attr__( 'Spacing', 'kirki' ),
+ 'width' => esc_attr__( 'Width', 'kirki' ),
+ 'height' => esc_attr__( 'Height', 'kirki' ),
+ 'invalid-value' => esc_attr__( 'Invalid Value', 'kirki' ),
+ );
+ }
+}
diff --git a/assets/kirki/controls/php/class-kirki-control-editor.php b/assets/kirki/controls/php/class-kirki-control-editor.php
new file mode 100644
index 0000000..a947692
--- /dev/null
+++ b/assets/kirki/controls/php/class-kirki-control-editor.php
@@ -0,0 +1,55 @@
+
+
+ <# if ( data.label ) { #>{{{ data.label }}} <# } #>
+ <# if ( data.description ) { #>{{{ data.description }}} <# } #>
+
+
+
+
+ <# if ( data.label ) { #>{{{ data.label }}} <# } #>
+ <# if ( data.description ) { #>{{{ data.description }}} <# } #>
+
+
+
+ <# if ( ! data.choices ) { return; } #>
+
+ <# if ( data.label ) { #>
{{{ data.label }}} <# } #>
+ <# if ( data.description ) { #>
{{{ data.description }}} <# } #>
+
+
+ json['alpha'] = (bool) $this->alpha;
+ }
+
+ /**
+ * An Underscore (JS) template for this control's content (but not its container).
+ *
+ * Class variables for this control class are available in the `data` JS object;
+ * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
+ *
+ * @see WP_Customize_Control::print_template()
+ *
+ * @access protected
+ */
+ protected function content_template() {
+ ?>
+
+ {{{ data.label }}}
+
+ <# if ( data.description ) { #>
+
{{{ data.description }}}
+ <# } #>
+
+ <# for ( key in data.choices ) { #>
+ <# if ( 'irisArgs' !== key ) { #>
+
+
+
+ <# } #>
+ <# } #>
+
+
+
+ <# if ( ! data.choices ) { return; } #>
+
+ {{{ data.label }}}
+
+ <# if ( data.description ) { #>
+
{{{ data.description }}}
+ <# } #>
+
+ <# for ( key in data.choices ) { #>
+ checked<# } #>>
+
+ <# for ( color in data.choices[ key ] ) { #>
+ {{ data.choices[ key ][ color ] }}
+ <# } #>
+
+
+ <# } #>
+
+
+ <# if ( data.label ) { #>
{{{ data.label }}} <# } #>
+ <# if ( data.description ) { #>
{{{ data.description }}} <# } #>
+
+ <# for ( key in data.choices ) { #>
+ checked="checked" <# } #>>
+ {{{ data.choices[ key ] }}}
+
+ <# } #>
+
+ input_attrs as $attr => $value ) {
+ if ( 'style' !== $attr ) {
+ $this->json['inputAttrs'] .= $attr . '="' . esc_attr( $value ) . '" ';
+ continue;
+ }
+ $this->json['labelStyle'] = 'style="' . esc_attr( $value ) . '" ';
+ }
+
+ }
+
+ /**
+ * An Underscore (JS) template for this control's content (but not its container).
+ *
+ * Class variables for this control class are available in the `data` JS object;
+ * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
+ *
+ * @see WP_Customize_Control::print_template()
+ *
+ * @access protected
+ */
+ protected function content_template() {
+ ?>
+
+ <# if ( data.label ) { #>{{{ data.label }}} <# } #>
+ <# if ( data.description ) { #>{{{ data.description }}} <# } #>
+
+
+ row_label = array(
+ 'type' => 'text',
+ 'value' => esc_attr__( 'row', 'kirki' ),
+ 'field' => false,
+ );
+
+ // Validate row-labels.
+ $this->row_label( $args );
+
+ if ( empty( $this->button_label ) ) {
+ /* translators: %s represents the label of the row. */
+ $this->button_label = sprintf( esc_attr__( 'Add new %s', 'kirki' ), $this->row_label['value'] );
+ }
+
+ if ( empty( $args['fields'] ) || ! is_array( $args['fields'] ) ) {
+ $args['fields'] = array();
+ }
+
+ // An array to store keys of fields that need to be filtered.
+ $media_fields_to_filter = array();
+
+ foreach ( $args['fields'] as $key => $value ) {
+ if ( ! isset( $value['default'] ) ) {
+ $args['fields'][ $key ]['default'] = '';
+ }
+ if ( ! isset( $value['label'] ) ) {
+ $args['fields'][ $key ]['label'] = '';
+ }
+ $args['fields'][ $key ]['id'] = $key;
+
+ // We check if the filed is an uploaded media ( image , file, video, etc.. ).
+ if ( isset( $value['type'] ) ) {
+ switch ( $value['type'] ) {
+ case 'image':
+ case 'cropped_image':
+ case 'upload':
+ // We add it to the list of fields that need some extra filtering/processing.
+ $media_fields_to_filter[ $key ] = true;
+ break;
+
+ case 'dropdown-pages':
+ // If the field is a dropdown-pages field then add it to args.
+ $dropdown = wp_dropdown_pages(
+ array(
+ 'name' => '',
+ 'echo' => 0,
+ 'show_option_none' => esc_attr__( 'Select a Page', 'kirki' ),
+ 'option_none_value' => '0',
+ 'selected' => '',
+ )
+ );
+ // Hackily add in the data link parameter.
+ $dropdown = str_replace( '
get_link(), $dropdown ); // phpcs:ignore Generic.Formatting.MultipleStatementAlignment.NotSameWarning
+ $args['fields'][ $key ]['dropdown'] = $dropdown;
+ break;
+ }
+ }
+ }
+
+ $this->fields = $args['fields'];
+
+ // Now we are going to filter the fields.
+ // First we create a copy of the value that would be used otherwise.
+ $this->filtered_value = $this->value();
+
+ if ( is_array( $this->filtered_value ) && ! empty( $this->filtered_value ) ) {
+
+ // We iterate over the list of fields.
+ foreach ( $this->filtered_value as &$filtered_value_field ) {
+
+ if ( is_array( $filtered_value_field ) && ! empty( $filtered_value_field ) ) {
+
+ // We iterate over the list of properties for this field.
+ foreach ( $filtered_value_field as $key => &$value ) {
+
+ // We check if this field was marked as requiring extra filtering (in this case image, cropped_images, upload).
+ if ( array_key_exists( $key, $media_fields_to_filter ) ) {
+
+ // What follows was made this way to preserve backward compatibility.
+ // The repeater control use to store the URL for images instead of the attachment ID.
+ // We check if the value look like an ID (otherwise it's probably a URL so don't filter it).
+ if ( is_numeric( $value ) ) {
+
+ // "sanitize" the value.
+ $attachment_id = (int) $value;
+
+ // Try to get the attachment_url.
+ $url = wp_get_attachment_url( $attachment_id );
+
+ $filename = basename( get_attached_file( $attachment_id ) );
+
+ // If we got a URL.
+ if ( $url ) {
+
+ // 'id' is needed for form hidden value, URL is needed to display the image.
+ $value = array(
+ 'id' => $attachment_id,
+ 'url' => $url,
+ 'filename' => $filename,
+ );
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ /**
+ * Refresh the parameters passed to the JavaScript via JSON.
+ *
+ * @access public
+ */
+ public function to_json() {
+ parent::to_json();
+
+ $fields = $this->fields;
+
+ $this->json['fields'] = $fields;
+ $this->json['row_label'] = $this->row_label;
+
+ // If filtered_value has been set and is not empty we use it instead of the actual value.
+ if ( is_array( $this->filtered_value ) && ! empty( $this->filtered_value ) ) {
+ $this->json['value'] = $this->filtered_value;
+ }
+ $this->json['value'] = apply_filters( "kirki_controls_repeater_value_{$this->id}", $this->json['value'] );
+ }
+
+ /**
+ * Render the control's content.
+ * Allows the content to be overriden without having to rewrite the wrapper in $this->render().
+ *
+ * @access protected
+ */
+ protected function render_content() {
+ ?>
+
+ label ) ) : ?>
+ label ); ?>
+
+ description ) ) : ?>
+ description ); ?>
+
+ get_link() ); ?> />
+
+
+
+
+ choices['limit'] ) ) : ?>
+
+ choices['limit'] ) ); ?>
+
+ button_label ); ?>
+
+ repeater_js_template();
+
+ }
+
+ /**
+ * An Underscore (JS) template for this control's content (but not its container).
+ * Class variables for this control class are available in the `data` JS object.
+ *
+ * @access public
+ */
+ public function repeater_js_template() {
+ ?>
+
+ row_label['type'] = $args['row_label']['type'];
+ }
+
+ // Validating row label type.
+ if ( isset( $args['row_label']['value'] ) && ! empty( $args['row_label']['value'] ) ) {
+ $this->row_label['value'] = esc_attr( $args['row_label']['value'] );
+ }
+
+ // Validating row label field.
+ if ( isset( $args['row_label']['field'] ) && ! empty( $args['row_label']['field'] ) && isset( $args['fields'][ esc_attr( $args['row_label']['field'] ) ] ) ) {
+ $this->row_label['field'] = esc_attr( $args['row_label']['field'] );
+ } else {
+ // If from field is not set correctly, making sure standard is set as the type.
+ $this->row_label['type'] = 'text';
+ }
+ }
+ }
+}
diff --git a/assets/kirki/controls/php/class-kirki-control-select.php b/assets/kirki/controls/php/class-kirki-control-select.php
new file mode 100644
index 0000000..4dd6518
--- /dev/null
+++ b/assets/kirki/controls/php/class-kirki-control-select.php
@@ -0,0 +1,59 @@
+json['multiple'] = $this->multiple;
+ $this->json['placeholder'] = $this->placeholder;
+ }
+}
diff --git a/assets/kirki/controls/php/class-kirki-control-slider.php b/assets/kirki/controls/php/class-kirki-control-slider.php
new file mode 100644
index 0000000..0df385a
--- /dev/null
+++ b/assets/kirki/controls/php/class-kirki-control-slider.php
@@ -0,0 +1,76 @@
+json['choices'] = wp_parse_args(
+ $this->json['choices'], array(
+ 'min' => '0',
+ 'max' => '100',
+ 'step' => '1',
+ 'suffix' => '',
+ )
+ );
+ }
+
+ /**
+ * An Underscore (JS) template for this control's content (but not its container).
+ *
+ * Class variables for this control class are available in the `data` JS object;
+ * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
+ *
+ * @see WP_Customize_Control::print_template()
+ *
+ * @access protected
+ */
+ protected function content_template() {
+ ?>
+
+ <# if ( data.label ) { #>{{{ data.label }}} <# } #>
+ <# if ( data.description ) { #>{{{ data.description }}} <# } #>
+
+
+
+
+
+ {{ data.choices['suffix'] }}
+
+
+
+
+
+
+ {{{ data.label }}}
+
+ <# if ( data.description ) { #>
+ {{{ data.description }}}
+ <# } #>
+
+
+ <# _.each( data.value, function( choiceID ) { #>
+
+
+
+ {{{ data.choices[ choiceID ] }}}
+
+ <# }); #>
+ <# _.each( data.choices, function( choiceLabel, choiceID ) { #>
+ <# if ( -1 === data.value.indexOf( choiceID ) ) { #>
+
+
+
+ {{{ data.choices[ choiceID ] }}}
+
+ <# } #>
+ <# }); #>
+
+
+
+
+
+
+ {{{ data.label }}}
+
+ <# if ( data.description ) { #>
+ {{{ data.description }}}
+ <# } #>
+ checked<# } #> />
+
+
+ <# data.choices.on = data.choices.on || '' #>
+ {{ data.choices.on }}
+
+
+ <# data.choices.off = data.choices.off || '' #>
+ {{ data.choices.off }}
+
+
+
+
+
+
+ {{{ data.label }}}
+
+ <# if ( data.description ) { #>
+ {{{ data.description }}}
+ <# } #>
+ checked<# } #> hidden />
+
+
+ json['value'] ) ) {
+ foreach ( array_keys( $this->json['value'] ) as $key ) {
+ if ( ! in_array( $key, array( 'variant', 'font-weight', 'font-style' ), true ) && ! isset( $this->json['default'][ $key ] ) ) {
+ unset( $this->json['value'][ $key ] );
+ }
+ // Fix for https://wordpress.org/support/topic/white-font-after-updateing-to-3-0-16.
+ if ( ! isset( $this->json['default'][ $key ] ) ) {
+ unset( $this->json['value'][ $key ] );
+ }
+ // Fix for https://github.com/aristath/kirki/issues/1405.
+ if ( isset( $this->json['default'][ $key ] ) && false === $this->json['default'][ $key ] ) {
+ unset( $this->json['value'][ $key ] );
+ }
+ }
+ }
+
+ $this->json['show_variants'] = ( true === Kirki_Fonts_Google::$force_load_all_variants ) ? false : true;
+ }
+
+ /**
+ * An Underscore (JS) template for this control's content (but not its container).
+ *
+ * Class variables for this control class are available in the `data` JS object;
+ * export custom variables by overriding {@see WP_Customize_Control::to_json()}.
+ *
+ * @see WP_Customize_Control::print_template()
+ *
+ * @access protected
+ */
+ protected function content_template() {
+ ?>
+
+ <# if ( data.label ) { #>{{{ data.label }}} <# } #>
+ <# if ( data.description ) { #>{{{ data.description }}} <# } #>
+
+
+
+
+ <# if ( ! _.isUndefined( data.default['font-family'] ) ) { #>
+ <# data.value['font-family'] = data.value['font-family'] || data['default']['font-family']; #>
+ <# if ( data.choices['fonts'] ) { data.fonts = data.choices['fonts']; } #>
+
+
+
+
+ <# if ( ! _.isUndefined( data.choices['font-backup'] ) && true === data.choices['font-backup'] ) { #>
+
+
+
+
+ <# } #>
+ <# if ( true === data.show_variants || false !== data.default.variant ) { #>
+
+
+
+
+ <# } #>
+
+
+
+
+
+
+ <# } #>
+
+ <# if ( ! _.isUndefined( data.default['font-size'] ) ) { #>
+ <# data.value['font-size'] = data.value['font-size'] || data['default']['font-size']; #>
+
+
+
+
+ <# } #>
+
+ <# if ( ! _.isUndefined( data.default['line-height'] ) ) { #>
+ <# data.value['line-height'] = data.value['line-height'] || data['default']['line-height']; #>
+
+
+
+
+ <# } #>
+
+ <# if ( ! _.isUndefined( data.default['letter-spacing'] ) ) { #>
+ <# data.value['letter-spacing'] = data.value['letter-spacing'] || data['default']['letter-spacing']; #>
+
+
+
+
+ <# } #>
+
+ <# if ( ! _.isUndefined( data.default['word-spacing'] ) ) { #>
+ <# data.value['word-spacing'] = data.value['word-spacing'] || data['default']['word-spacing']; #>
+
+
+
+
+ <# } #>
+
+ <# if ( ! _.isUndefined( data.default['text-align'] ) ) { #>
+ <# data.value['text-align'] = data.value['text-align'] || data['default']['text-align']; #>
+
+ <# } #>
+
+ <# if ( ! _.isUndefined( data.default['text-transform'] ) ) { #>
+ <# data.value['text-transform'] = data.value['text-transform'] || data['default']['text-transform']; #>
+
+
+
+ selected<# } #>>
+ selected<# } #>>
+ selected<# } #>>
+ selected<# } #>>
+ selected<# } #>>
+ selected<# } #>>
+ selected<# } #>>
+
+
+ <# } #>
+
+ <# if ( ! _.isUndefined( data.default['text-decoration'] ) ) { #>
+ <# data.value['text-decoration'] = data.value['text-decoration'] || data['default']['text-decoration']; #>
+
+
+
+ selected<# } #>>
+ selected<# } #>>
+ selected<# } #>>
+ selected<# } #>>
+ selected<# } #>>
+ selected<# } #>>
+ selected<# } #>>
+
+
+ <# } #>
+
+ <# if ( ! _.isUndefined( data.default['margin-top'] ) ) { #>
+ <# data.value['margin-top'] = data.value['margin-top'] || data['default']['margin-top']; #>
+
+
+
+
+ <# } #>
+
+ <# if ( ! _.isUndefined( data.default['margin-bottom'] ) ) { #>
+ <# data.value['margin-bottom'] = data.value['margin-bottom'] || data['default']['margin-bottom']; #>
+
+
+
+
+ <# } #>
+
+ <# if ( ! _.isUndefined( data.default['color'] ) && false !== data.default['color'] ) { #>
+ <# data.value['color'] = data.value['color'] || data['default']['color']; #>
+
+
+
+
+ <# } #>
+
+
+
+ $variant,
+ 'label' => isset( $all_variants[ $variant ] ) ? $all_variants[ $variant ] : $variant,
+ );
+ } elseif ( is_array( $variant ) && isset( $variant['id'] ) && isset( $variant['label'] ) ) {
+ $final_variants[] = $variant;
+ }
+ }
+ return $final_variants;
+ }
+}
diff --git a/assets/kirki/controls/php/class-kirki-control-upload.php b/assets/kirki/controls/php/class-kirki-control-upload.php
new file mode 100644
index 0000000..365bf69
--- /dev/null
+++ b/assets/kirki/controls/php/class-kirki-control-upload.php
@@ -0,0 +1,37 @@
+json['required'] = $this->required;
+ }
+}
diff --git a/assets/kirki/controls/php/class-kirki-settings-repeater-setting.php b/assets/kirki/controls/php/class-kirki-settings-repeater-setting.php
new file mode 100644
index 0000000..91941e4
--- /dev/null
+++ b/assets/kirki/controls/php/class-kirki-settings-repeater-setting.php
@@ -0,0 +1,84 @@
+id}", array( $this, 'sanitize_repeater_setting' ), 10, 1 );
+ }
+
+ /**
+ * Fetch the value of the setting.
+ *
+ * @access public
+ * @return mixed The value.
+ */
+ public function value() {
+ $value = parent::value();
+ if ( ! is_array( $value ) ) {
+ $value = array();
+ }
+
+ return $value;
+ }
+
+ /**
+ * Convert the JSON encoded setting coming from Customizer to an Array.
+ *
+ * @access public
+ * @param string $value URL Encoded JSON Value.
+ * @return array
+ */
+ public function sanitize_repeater_setting( $value ) {
+
+ if ( ! is_array( $value ) ) {
+ $value = json_decode( urldecode( $value ) );
+ }
+ $sanitized = ( empty( $value ) || ! is_array( $value ) ) ? array() : $value;
+
+ // Make sure that every row is an array, not an object.
+ foreach ( $sanitized as $key => $_value ) {
+ $sanitized[ $key ] = (array) $_value;
+ if ( empty( $_value ) ) {
+ unset( $sanitized[ $key ] );
+ }
+ }
+
+ // Reindex array.
+ if ( is_array( $sanitized ) ) {
+ $sanitized = array_values( $sanitized );
+ }
+
+ return $sanitized;
+
+ }
+}
diff --git a/assets/kirki/controls/views/code.php b/assets/kirki/controls/views/code.php
new file mode 100644
index 0000000..cb51c1e
--- /dev/null
+++ b/assets/kirki/controls/views/code.php
@@ -0,0 +1,36 @@
+
+<#
+data = _.defaults( data, {
+ id: '',
+ label: '',
+ description: '',
+ input_attrs: {}
+});
+<# var elementIdPrefix = 'el' + String( Math.random() ); #>
+
diff --git a/assets/kirki/controls/views/color.php b/assets/kirki/controls/views/color.php
new file mode 100644
index 0000000..75dec2f
--- /dev/null
+++ b/assets/kirki/controls/views/color.php
@@ -0,0 +1,47 @@
+
+<#
+data = _.defaults( data, {
+ label: '',
+ description: '',
+ mode: 'full',
+ inputAttrs: '',
+ 'data-palette': data['data-palette'] ? data['data-palette'] : true,
+ 'data-default-color': data['data-default-color'] ? data['data-default-color'] : '',
+ 'data-alpha': data['data-alpha'] ? data['data-alpha'] : false,
+ value: '',
+ 'data-id': ''
+} );
+#>
+
+
+
+ <# if ( data.label ) { #>
+ {{{ data.label }}}
+ <# } #>
+ <# if ( data.description ) { #>
+ {{{ data.description }}}
+ <# } #>
+
+
+
diff --git a/assets/kirki/controls/views/generic.php b/assets/kirki/controls/views/generic.php
new file mode 100644
index 0000000..38a224d
--- /dev/null
+++ b/assets/kirki/controls/views/generic.php
@@ -0,0 +1,43 @@
+
+<#
+element = ( data.choices.element ) ? data.choices.element : 'input';
+data = _.defaults( data, {
+ label: '',
+ description: '',
+ inputAttrs: '',
+ value: '',
+ 'data-id': '',
+ choices: {}
+} );
+#>
+
diff --git a/assets/kirki/controls/views/image.php b/assets/kirki/controls/views/image.php
new file mode 100644
index 0000000..3416ea0
--- /dev/null
+++ b/assets/kirki/controls/views/image.php
@@ -0,0 +1,67 @@
+
+<#
+data = _.defaults( data, {
+ id: '',
+ label: '',
+ description: '',
+ input_attrs: {},
+ choices: {}
+});
+
+var saveAs = 'url';
+if ( ! _.isUndefined( data.choices.save_as ) ) {
+ saveAs = data.choices.save_as;
+}
+
+url = data.value;
+if ( _.isObject( data.value ) && ! _.isUndefined( data.value.url ) ) {
+ url = data.value.url;
+}
+
+data.choices.labels = _.isObject( data.choices.labels ) ? data.choices.labels : {};
+data.choices.labels = _.defaults( data.choices.labels, {
+ select: '',
+ change: '',
+ 'default': '',
+ remove: '',
+ placeholder: '',
+ frame_title: '',
+ frame_button: '',
+} );
+#>
+
+
+
+ {{{ data.label }}}
+
+ <# if ( data.description ) { #>
+ {{{ data.description }}}
+ <# } #>
+
+
diff --git a/assets/kirki/controls/views/number.php b/assets/kirki/controls/views/number.php
new file mode 100644
index 0000000..bb238ef
--- /dev/null
+++ b/assets/kirki/controls/views/number.php
@@ -0,0 +1,37 @@
+
+<#
+data = _.defaults( data, {
+ label: '',
+ description: '',
+ inputAttrs: '',
+ value: '',
+ 'data-id': ''
+} );
+#>
+
+
diff --git a/assets/kirki/controls/views/radio.php b/assets/kirki/controls/views/radio.php
new file mode 100644
index 0000000..59c9699
--- /dev/null
+++ b/assets/kirki/controls/views/radio.php
@@ -0,0 +1,48 @@
+
+<# data = _.defaults( data, {
+ choices: {},
+ label: '',
+ description: '',
+ inputAttrs: '',
+ value: '',
+ 'data-id': '',
+ 'default': ''
+} );
+#>
+
+
+ <# if ( data.label ) { #>
+ {{{ data.label }}}
+ <# } #>
+ <# if ( data.description ) { #>
+ {{{ data.description }}}
+ <# } #>
+ <# _.each( data.choices, function( val, key ) { #>
+
+ checked<# } #>
+ />
+ <# if ( _.isArray( val ) ) { #>
+ {{{ val[0] }}}{{{ val[1] }}}
+ <# } else { #>
+ {{ val }}
+ <# } #>
+
+ <# } ); #>
+
diff --git a/assets/kirki/controls/views/select.php b/assets/kirki/controls/views/select.php
new file mode 100644
index 0000000..96269e7
--- /dev/null
+++ b/assets/kirki/controls/views/select.php
@@ -0,0 +1,72 @@
+
+<#
+data = _.defaults( data, {
+ label: '',
+ description: '',
+ inputAttrs: '',
+ 'data-id': '',
+ choices: {},
+ multiple: 1,
+ value: ( 1 < data.multiple ) ? [] : '',
+ placeholder: false
+} );
+
+if ( 1 < data.multiple && data.value && _.isString( data.value ) ) {
+ data.value = [ data.value ];
+}
+#>
+
+
+ <# if ( data.label ) { #>
+ {{{ data.label }}}
+ <# } #>
+ <# if ( data.description ) { #>
+ {{{ data.description }}}
+ <# } #>
+
+ data-multiple="{{ data.multiple }}" multiple="multiple"
+ <# } #>
+ >
+ <# if ( data.placeholder ) { #>
+ selected<# } #>>
+ <# } #>
+ <# _.each( data.choices, function( optionLabel, optionKey ) { #>
+ <#
+ selected = ( data.value === optionKey );
+ if ( 1 < data.multiple && data.value ) {
+ selected = _.contains( data.value, optionKey );
+ }
+ if ( _.isObject( optionLabel ) ) {
+ #>
+
+ <# _.each( optionLabel[1], function( optgroupOptionLabel, optgroupOptionKey ) { #>
+ <#
+ selected = ( data.value === optgroupOptionKey );
+ if ( 1 < data.multiple && data.value ) {
+ selected = _.contains( data.value, optgroupOptionKey );
+ }
+ #>
+ selected<# } #>>{{{ optgroupOptionLabel }}}
+ <# } ); #>
+
+ <# } else { #>
+ selected<# } #>>{{{ optionLabel }}}
+ <# } #>
+ <# } ); #>
+
+
+
diff --git a/assets/kirki/controls/views/textarea.php b/assets/kirki/controls/views/textarea.php
new file mode 100644
index 0000000..30f19db
--- /dev/null
+++ b/assets/kirki/controls/views/textarea.php
@@ -0,0 +1,41 @@
+
+<#
+data = _.defaults( data, {
+ label: '',
+ description: '',
+ inputAttrs: '',
+ value: '',
+ 'data-id': '',
+ choices: {}
+} );
+#>
+
diff --git a/assets/kirki/core/class-kirki-config.php b/assets/kirki/core/class-kirki-config.php
new file mode 100644
index 0000000..3740aee
--- /dev/null
+++ b/assets/kirki/core/class-kirki-config.php
@@ -0,0 +1,179 @@
+ $value ) {
+ // Is this property whitelisted?
+ if ( property_exists( $this, $key ) ) {
+ $args[ $key ] = $value;
+ }
+ }
+ $this->id = $config_id;
+
+ $this->config_final = wp_parse_args(
+ array(
+ 'id' => $config_id,
+ ),
+ $args
+ );
+ }
+
+ /**
+ * Use this method to get an instance of your config.
+ * Each config has its own instance of this object.
+ *
+ * @static
+ * @access public
+ * @param string $id Config ID.
+ * @param array $args {
+ * Optional. Arguments to override config defaults.
+ *
+ * @type string $capability @see https://codex.wordpress.org/Roles_and_Capabilities
+ * @type string $option_type theme_mod or option.
+ * @type string $option_name If we want to used serialized options,
+ * this is where we'll be adding the option name.
+ * All fields using this config will be items in that array.
+ * @type array $compiler Not yet fully implemented
+ * @type bool $disable_output If set to true, no CSS will be generated
+ * from fields using this configuration.
+ * }
+ *
+ * @return Kirki_Config
+ */
+ public static function get_instance( $id = 'global', $args = array() ) {
+ $id = trim( esc_attr( $id ) );
+ $id = ( '' === $id ) ? 'global' : $id;
+
+ $id_md5 = md5( $id );
+ if ( ! isset( self::$instances[ $id_md5 ] ) ) {
+ self::$instances[ $id_md5 ] = new self( $id, $args );
+ }
+ return self::$instances[ $id_md5 ];
+
+ }
+
+ /**
+ * Get the IDs of all current configs.
+ *
+ * @static
+ * @access public
+ * @since 3.0.22
+ * @return array
+ */
+ public static function get_config_ids() {
+ $configs = array();
+ foreach ( self::$instances as $instance ) {
+ $configs[] = $instance->id;
+ }
+ return array_unique( $configs );
+ }
+
+ /**
+ * Returns the $config_final property
+ *
+ * @access public
+ * @return array
+ */
+ public function get_config() {
+
+ return $this->config_final;
+ }
+}
diff --git a/assets/kirki/core/class-kirki-control.php b/assets/kirki/core/class-kirki-control.php
new file mode 100644
index 0000000..0c70a2b
--- /dev/null
+++ b/assets/kirki/core/class-kirki-control.php
@@ -0,0 +1,116 @@
+wp_customize = $wp_customize;
+
+ // Set the control types.
+ $this->set_control_types();
+ // Add the control.
+ $this->add_control( $args );
+
+ }
+
+ /**
+ * Get the class name of the class needed to create tis control.
+ *
+ * @access private
+ * @param array $args The field definition as sanitized in Kirki_Field.
+ *
+ * @return string the name of the class that will be used to create this control.
+ */
+ final private function get_control_class_name( $args ) {
+
+ // Set a default class name.
+ $class_name = 'WP_Customize_Control';
+ // Get the classname from the array of control classnames.
+ if ( array_key_exists( $args['type'], self::$control_types ) ) {
+ $class_name = self::$control_types[ $args['type'] ];
+ }
+ return $class_name;
+
+ }
+
+ /**
+ * Adds the control.
+ *
+ * @access protected
+ * @param array $args The field definition as sanitized in Kirki_Field.
+ */
+ final protected function add_control( $args ) {
+
+ // Get the name of the class we're going to use.
+ $class_name = $this->get_control_class_name( $args );
+ // Add the control.
+ $this->wp_customize->add_control( new $class_name( $this->wp_customize, $args['settings'], $args ) );
+
+ }
+
+ /**
+ * Sets the $control_types property.
+ * Makes sure the kirki_control_types filter is applied
+ * and that the defined classes actually exist.
+ * If a defined class does not exist, it is removed.
+ *
+ * @access private
+ */
+ final private function set_control_types() {
+
+ // Early exit if this has already run.
+ if ( ! empty( self::$control_types ) ) {
+ return;
+ }
+
+ self::$control_types = apply_filters( 'kirki_control_types', array() );
+
+ // Make sure the defined classes actually exist.
+ foreach ( self::$control_types as $key => $classname ) {
+
+ if ( ! class_exists( $classname ) ) {
+ unset( self::$control_types[ $key ] );
+ }
+ }
+ }
+}
diff --git a/assets/kirki/core/class-kirki-field.php b/assets/kirki/core/class-kirki-field.php
new file mode 100644
index 0000000..894b510
--- /dev/null
+++ b/assets/kirki/core/class-kirki-field.php
@@ -0,0 +1,729 @@
+ 'auto'
+ * and have already set an array for the 'output' argument.
+ *
+ * @see https://kirki.org/docs/arguments/js_vars
+ * @access protected
+ * @var array
+ */
+ protected $js_vars = array();
+
+ /**
+ * If you want to use a CSS compiler, then use this to set the variable names.
+ *
+ * @see https://kirki.org/docs/arguments/variables
+ * @access protected
+ * @var array
+ */
+ protected $variables = array();
+
+ /**
+ * Text that will be used in a tooltip to provide extra info for this field.
+ *
+ * @access protected
+ * @var string
+ */
+ protected $tooltip = '';
+
+ /**
+ * A custom callback to determine if the field should be visible or not.
+ *
+ * @access protected
+ * @var string|array
+ */
+ protected $active_callback = '__return_true';
+
+ /**
+ * A custom sanitize callback that will be used to properly save the values.
+ *
+ * @access protected
+ * @var string|array
+ */
+ protected $sanitize_callback = '';
+
+ /**
+ * Use 'refresh', 'postMessage' or 'auto'.
+ * 'auto' will automatically geberate any 'js_vars' from the 'output' argument.
+ *
+ * @access protected
+ * @var string
+ */
+ protected $transport = 'refresh';
+
+ /**
+ * Define dependencies to show/hide this field based on the values of other fields.
+ *
+ * @access protected
+ * @var array
+ */
+ protected $required = array();
+
+ /**
+ * Partial Refreshes array.
+ *
+ * @access protected
+ * @var array
+ */
+ protected $partial_refresh = array();
+
+ /**
+ * The class constructor.
+ * Parses and sanitizes all field arguments.
+ * Then it adds the field to Kirki::$fields.
+ *
+ * @access public
+ * @param string $config_id The ID of the config we want to use.
+ * Defaults to "global".
+ * Configs are handled by the Kirki_Config class.
+ * @param array $args The arguments of the field.
+ */
+ public function __construct( $config_id = 'global', $args = array() ) {
+
+ if ( isset( $args['setting'] ) && ! empty( $args['setting'] ) && ( ! isset( $args['settings'] ) || empty( $args['settings'] ) ) ) {
+ /* translators: %s represents the field ID where the error occurs. */
+ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Typo found in field %s - setting instead of settings.', 'kirki' ), esc_attr( $args['settings'] ) ), '3.0.10' );
+ $args['settings'] = $args['setting'];
+ unset( $args['setting'] );
+ }
+
+ // In case the user only provides 1 argument,
+ // assume that the provided argument is $args and set $config_id = 'global'.
+ if ( is_array( $config_id ) && empty( $args ) ) {
+ /* translators: %1$s represents the field ID where the error occurs. %2$s is the URL in the documentation site. */
+ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Config not defined for field %1$s - See %2$s for details on how to properly add fields.', 'kirki' ), esc_attr( $args['settings'] ), 'https://aristath.github.io/kirki/docs/getting-started/fields.html' ), '3.0.10' );
+ $args = $config_id;
+ $config_id = 'global';
+ }
+
+ $args['kirki_config'] = $config_id;
+
+ $this->kirki_config = trim( esc_attr( $config_id ) );
+ if ( '' === $config_id ) {
+ /* translators: %1$s represents the field ID where the error occurs. %2$s is the URL in the documentation site. */
+ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Config not defined for field %1$s - See %2$s for details on how to properly add fields.', 'kirki' ), esc_attr( $args['settings'] ), 'https://aristath.github.io/kirki/docs/getting-started/fields.html' ), '3.0.10' );
+ $this->kirki_config = 'global';
+ }
+
+ // Get defaults from the class.
+ $defaults = get_class_vars( __CLASS__ );
+
+ // Get the config arguments, and merge them with the defaults.
+ $config_defaults = ( isset( Kirki::$config['global'] ) ) ? Kirki::$config['global'] : array();
+ if ( 'global' !== $this->kirki_config && isset( Kirki::$config[ $this->kirki_config ] ) ) {
+ $config_defaults = Kirki::$config[ $this->kirki_config ];
+ }
+ $config_defaults = ( is_array( $config_defaults ) ) ? $config_defaults : array();
+ foreach ( $config_defaults as $key => $value ) {
+ if ( isset( $defaults[ $key ] ) && ! empty( $value ) && $value !== $defaults[ $key ] ) {
+ $defaults[ $key ] = $value;
+ }
+ }
+
+ // Merge our args with the defaults.
+ $args = wp_parse_args( $args, $defaults );
+
+ // Set the class properties using the parsed args.
+ foreach ( $args as $key => $value ) {
+ $this->$key = $value;
+ }
+
+ $this->args = $args;
+
+ $this->set_field();
+ }
+
+ /**
+ * Processes the field arguments
+ *
+ * @access protected
+ */
+ protected function set_field() {
+
+ $properties = get_class_vars( __CLASS__ );
+
+ // Some things must run before the others.
+ $this->set_option_name();
+ $this->set_option_type();
+ $this->set_settings();
+
+ // Sanitize the properties, skipping the ones that have already run above.
+ foreach ( $properties as $property => $value ) {
+ if ( in_array( $property, array( 'option_name', 'option_type', 'settings' ), true ) ) {
+ continue;
+ }
+ if ( method_exists( $this, 'set_' . $property ) ) {
+ $method_name = 'set_' . $property;
+ $this->$method_name();
+ }
+ }
+
+ // Get all arguments with their values.
+ $args = get_object_vars( $this );
+ foreach ( array_keys( $args ) as $key ) {
+ $args[ $key ] = $this->$key;
+ }
+
+ // Add the field to the static $fields variable properly indexed.
+ Kirki::$fields[ $this->settings ] = $args;
+
+ }
+
+ /**
+ * Escape $kirki_config.
+ *
+ * @access protected
+ */
+ protected function set_kirki_config() {
+
+ $this->kirki_config = esc_attr( $this->kirki_config );
+ }
+
+ /**
+ * Escape $option_name.
+ *
+ * @access protected
+ */
+ protected function set_option_name() {
+
+ $this->option_name = esc_attr( $this->option_name );
+ }
+
+ /**
+ * Escape the $section.
+ *
+ * @access protected
+ */
+ protected function set_section() {
+
+ $this->section = sanitize_key( $this->section );
+ }
+
+ /**
+ * Escape the $section.
+ *
+ * @access protected
+ */
+ protected function set_input_attrs() {
+
+ if ( ! is_array( $this->input_attrs ) ) {
+ $this->input_attrs = array();
+ }
+ }
+
+ /**
+ * Checks the capability chosen is valid.
+ * If not, then falls back to 'edit_theme_options'
+ *
+ * @access protected
+ */
+ protected function set_capability() {
+
+ // Early exit if we're using 'edit_theme_options'.
+ if ( 'edit_theme_options' === $this->capability ) {
+ return;
+ }
+ // Escape & trim the capability.
+ $this->capability = trim( esc_attr( $this->capability ) );
+ }
+
+ /**
+ * Make sure we're using the correct option_type
+ *
+ * @access protected
+ */
+ protected function set_option_type() {
+
+ // Take care of common typos.
+ if ( 'options' === $this->option_type ) {
+ $this->option_type = 'option';
+ }
+ // Take care of common typos.
+ if ( 'theme_mods' === $this->option_type ) {
+ /* translators: %1$s represents the field ID where the error occurs. */
+ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Typo found in field %s - "theme_mods" vs "theme_mod"', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' );
+ $this->option_type = 'theme_mod';
+ }
+ }
+
+ /**
+ * Modifications for partial refreshes.
+ *
+ * @access protected
+ */
+ protected function set_partial_refresh() {
+
+ if ( ! is_array( $this->partial_refresh ) ) {
+ $this->partial_refresh = array();
+ }
+ foreach ( $this->partial_refresh as $id => $args ) {
+ if ( ! is_array( $args ) || ! isset( $args['selector'] ) || ! isset( $args['render_callback'] ) || ! is_callable( $args['render_callback'] ) ) {
+ /* translators: %1$s represents the field ID where the error occurs. */
+ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"partial_refresh" invalid entry in field %s', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' );
+ unset( $this->partial_refresh[ $id ] );
+ continue;
+ }
+ }
+ if ( ! empty( $this->partial_refresh ) ) {
+ $this->transport = 'postMessage';
+ }
+ }
+
+ /**
+ * Sets the settings.
+ * If we're using serialized options it makes sure that settings are properly formatted.
+ * We'll also be escaping all setting names here for consistency.
+ *
+ * @access protected
+ */
+ protected function set_settings() {
+
+ // If settings is not an array, temporarily convert it to an array.
+ // This is just to allow us to process everything the same way and avoid code duplication.
+ // if settings is not an array then it will not be set as an array in the end.
+ if ( ! is_array( $this->settings ) ) {
+ $this->settings = array(
+ 'kirki_placeholder_setting' => $this->settings,
+ );
+ }
+ $settings = array();
+ foreach ( $this->settings as $setting_key => $setting_value ) {
+ $settings[ $setting_key ] = $setting_value;
+ // If we're using serialized options then we need to spice this up.
+ if ( 'option' === $this->option_type && '' !== $this->option_name && ( false === strpos( $setting_key, '[' ) ) ) {
+ $settings[ $setting_key ] = "{$this->option_name}[{$setting_value}]";
+ }
+ }
+ $this->settings = $settings;
+ if ( isset( $this->settings['kirki_placeholder_setting'] ) ) {
+ $this->settings = $this->settings['kirki_placeholder_setting'];
+ }
+ }
+
+ /**
+ * Sets the active_callback
+ * If we're using the $required argument,
+ * Then this is where the switch is made to our evaluation method.
+ *
+ * @access protected
+ */
+ protected function set_active_callback() {
+
+ if ( is_array( $this->active_callback ) ) {
+ if ( ! is_callable( $this->active_callback ) ) {
+
+ // Bugfix for https://github.com/aristath/kirki/issues/1961.
+ foreach ( $this->active_callback as $key => $val ) {
+ if ( is_callable( $val ) ) {
+ unset( $this->active_callback[ $key ] );
+ }
+ }
+ if ( isset( $this->active_callback[0] ) ) {
+ $this->required = $this->active_callback;
+ }
+ }
+ }
+
+ if ( ! empty( $this->required ) ) {
+ $this->active_callback = '__return_true';
+ return;
+ }
+ // No need to proceed any further if we're using the default value.
+ if ( '__return_true' === $this->active_callback ) {
+ return;
+ }
+ // Make sure the function is callable, otherwise fallback to __return_true.
+ if ( ! is_callable( $this->active_callback ) ) {
+ $this->active_callback = '__return_true';
+ }
+ }
+
+ /**
+ * Sets the control type.
+ *
+ * @access protected
+ */
+ protected function set_type() {
+
+ // Escape the control type (it doesn't hurt to be sure).
+ $this->type = esc_attr( $this->type );
+ }
+
+ /**
+ * Sets the $id.
+ * Setting the ID should happen after the 'settings' sanitization.
+ * This way we can also properly handle cases where the option_type is set to 'option'
+ * and we're using an array instead of individual options.
+ *
+ * @access protected
+ */
+ protected function set_id() {
+
+ $this->id = sanitize_key( str_replace( '[', '-', str_replace( ']', '', $this->settings ) ) );
+ }
+
+ /**
+ * Sets the $choices.
+ *
+ * @access protected
+ */
+ protected function set_choices() {
+
+ if ( ! is_array( $this->choices ) ) {
+ $this->choices = array();
+ }
+ }
+
+ /**
+ * Escapes the $disable_output.
+ *
+ * @access protected
+ */
+ protected function set_disable_output() {
+
+ $this->disable_output = (bool) $this->disable_output;
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_output() {
+
+ if ( empty( $this->output ) ) {
+ return;
+ }
+ if ( ! is_array( $this->output ) ) {
+ /* translators: The field ID where the error occurs. */
+ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' );
+ $this->output = array(
+ array(
+ 'element' => $this->output,
+ ),
+ );
+ }
+ // Convert to array of arrays if needed.
+ if ( isset( $this->output['element'] ) ) {
+ /* translators: The field ID where the error occurs. */
+ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( '"output" invalid format in field %s. The "output" argument should be defined as an array of arrays.', 'kirki' ), esc_attr( $this->settings ) ), '3.0.10' );
+ $this->output = array( $this->output );
+ }
+ foreach ( $this->output as $key => $output ) {
+ if ( empty( $output ) || ! isset( $output['element'] ) ) {
+ unset( $this->output[ $key ] );
+ continue;
+ }
+ if ( ! isset( $output['sanitize_callback'] ) && isset( $output['callback'] ) ) {
+ $this->output[ $key ]['sanitize_callback'] = $output['callback'];
+ }
+ // Convert element arrays to strings.
+ if ( isset( $output['element'] ) && is_array( $output['element'] ) ) {
+ $this->output[ $key ]['element'] = array_unique( $this->output[ $key ]['element'] );
+ sort( $this->output[ $key ]['element'] );
+
+ // Trim each element in the array.
+ foreach ( $this->output[ $key ]['element'] as $index => $element ) {
+ $this->output[ $key ]['element'][ $index ] = trim( $element );
+ }
+ $this->output[ $key ]['element'] = implode( ',', $this->output[ $key ]['element'] );
+ }
+
+ // Fix for https://github.com/aristath/kirki/issues/1659#issuecomment-346229751.
+ $this->output[ $key ]['element'] = str_replace( array( "\t", "\n", "\r", "\0", "\x0B" ), ' ', $this->output[ $key ]['element'] );
+ $this->output[ $key ]['element'] = trim( preg_replace( '/\s+/', ' ', $this->output[ $key ]['element'] ) );
+ }
+ }
+
+ /**
+ * Sets the $js_vars
+ *
+ * @access protected
+ */
+ protected function set_js_vars() {
+
+ if ( ! is_array( $this->js_vars ) ) {
+ $this->js_vars = array();
+ }
+
+ // Check if transport is set to auto.
+ // If not, then skip the auto-calculations and exit early.
+ if ( 'auto' !== $this->transport ) {
+ return;
+ }
+
+ // Set transport to refresh initially.
+ // Serves as a fallback in case we failt to auto-calculate js_vars.
+ $this->transport = 'refresh';
+
+ $js_vars = array();
+
+ // Try to auto-generate js_vars.
+ // First we need to check if js_vars are empty, and that output is not empty.
+ if ( empty( $this->js_vars ) && ! empty( $this->output ) ) {
+
+ // Start going through each item in the $output array.
+ foreach ( $this->output as $output ) {
+ $output['function'] = ( isset( $output['function'] ) ) ? $output['function'] : 'style';
+
+ // If 'element' or 'property' are not defined, skip this.
+ if ( ! isset( $output['element'] ) || ! isset( $output['property'] ) ) {
+ continue;
+ }
+ if ( is_array( $output['element'] ) ) {
+ $output['element'] = implode( ',', $output['element'] );
+ }
+
+ // If there's a sanitize_callback defined skip this, unless we also have a js_callback defined.
+ if ( isset( $output['sanitize_callback'] ) && ! empty( $output['sanitize_callback'] ) && ! isset( $output['js_callback'] ) ) {
+ continue;
+ }
+
+ // If we got this far, it's safe to add this.
+ $js_vars[] = $output;
+ }
+
+ // Did we manage to get all the items from 'output'?
+ // If not, then we're missing something so don't add this.
+ if ( count( $js_vars ) !== count( $this->output ) ) {
+ return;
+ }
+ $this->js_vars = $js_vars;
+ $this->transport = 'postMessage';
+
+ }
+ }
+
+ /**
+ * Sets the $variables
+ *
+ * @access protected
+ */
+ protected function set_variables() {
+
+ if ( ! is_array( $this->variables ) ) {
+ $variable = ( is_string( $this->variables ) && ! empty( $this->variables ) ) ? $this->variables : false;
+ $this->variables = array();
+ if ( $variable && empty( $this->variables ) ) {
+ $this->variables[0]['name'] = $variable;
+ }
+ }
+ }
+
+ /**
+ * Sets the $transport
+ *
+ * @access protected
+ */
+ protected function set_transport() {
+
+ if ( 'postmessage' === trim( strtolower( $this->transport ) ) ) {
+ $this->transport = 'postMessage';
+ }
+ }
+
+ /**
+ * Sets the $required
+ *
+ * @access protected
+ */
+ protected function set_required() {
+
+ if ( ! is_array( $this->required ) ) {
+ $this->required = array();
+ }
+ }
+
+ /**
+ * Sets the $priority
+ *
+ * @access protected
+ */
+ protected function set_priority() {
+
+ $this->priority = absint( $this->priority );
+ }
+
+ /**
+ * Sets the $css_vars
+ *
+ * @access protected
+ */
+ protected function set_css_vars() {
+ if ( is_string( $this->css_vars ) ) {
+ $this->css_vars = array( $this->css_vars );
+ }
+ if ( isset( $this->css_vars[0] ) && is_string( $this->css_vars[0] ) ) {
+ $this->css_vars = array( $this->css_vars );
+ }
+ foreach ( $this->css_vars as $key => $val ) {
+ if ( ! isset( $val[1] ) ) {
+ $this->css_vars[ $key ][1] = '$';
+ }
+ }
+ }
+}
diff --git a/assets/kirki/core/class-kirki-helper.php b/assets/kirki/core/class-kirki-helper.php
new file mode 100644
index 0000000..3b39e1e
--- /dev/null
+++ b/assets/kirki/core/class-kirki-helper.php
@@ -0,0 +1,460 @@
+ $value ) {
+ // Create new key in $array, if it is empty or not an array.
+ if ( ! isset( $array[ $key ] ) || ( isset( $array[ $key ] ) && ! is_array( $array[ $key ] ) ) ) {
+ $array[ $key ] = array();
+ }
+
+ // Overwrite the value in the base array.
+ if ( is_array( $value ) ) {
+ $value = self::recurse( $array[ $key ], $value );
+ }
+ $array[ $key ] = $value;
+ }
+ return $array;
+ }
+
+ /**
+ * Initialize the WP_Filesystem
+ *
+ * @static
+ * @access public
+ * @return object WP_Filesystem
+ */
+ public static function init_filesystem() {
+ $credentials = array();
+
+ if ( ! defined( 'FS_METHOD' ) ) {
+ define( 'FS_METHOD', 'direct' );
+ }
+
+ $method = defined( 'FS_METHOD' ) ? FS_METHOD : false;
+
+ if ( 'ftpext' === $method ) {
+ // If defined, set it to that, Else, set to NULL.
+ $credentials['hostname'] = defined( 'FTP_HOST' ) ? preg_replace( '|\w+://|', '', FTP_HOST ) : null;
+ $credentials['username'] = defined( 'FTP_USER' ) ? FTP_USER : null;
+ $credentials['password'] = defined( 'FTP_PASS' ) ? FTP_PASS : null;
+
+ // Set FTP port.
+ if ( strpos( $credentials['hostname'], ':' ) && null !== $credentials['hostname'] ) {
+ list( $credentials['hostname'], $credentials['port'] ) = explode( ':', $credentials['hostname'], 2 );
+ if ( ! is_numeric( $credentials['port'] ) ) {
+ unset( $credentials['port'] );
+ }
+ } else {
+ unset( $credentials['port'] );
+ }
+
+ // Set connection type.
+ if ( ( defined( 'FTP_SSL' ) && FTP_SSL ) && 'ftpext' === $method ) {
+ $credentials['connection_type'] = 'ftps';
+ } elseif ( ! array_filter( $credentials ) ) {
+ $credentials['connection_type'] = null;
+ } else {
+ $credentials['connection_type'] = 'ftp';
+ }
+ }
+
+ // The WordPress filesystem.
+ global $wp_filesystem;
+
+ if ( empty( $wp_filesystem ) ) {
+ require_once wp_normalize_path( ABSPATH . '/wp-admin/includes/file.php' );
+ WP_Filesystem( $credentials );
+ }
+
+ return $wp_filesystem;
+ }
+
+ /**
+ * Returns the attachment object
+ *
+ * @static
+ * @access public
+ * @see https://pippinsplugins.com/retrieve-attachment-id-from-image-url/
+ * @param string $url URL to the image.
+ * @return int|string Numeric ID of the attachement.
+ */
+ public static function get_image_id( $url ) {
+ global $wpdb;
+ if ( empty( $url ) ) {
+ return 0;
+ }
+
+ $attachment = wp_cache_get( 'kirki_image_id_' . md5( $url ), null );
+ if ( false === $attachment ) {
+ $attachment = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE guid = %s;", $url ) ); // phpcs:ignore WordPress.DB.DirectDatabaseQuery.DirectQuery
+ wp_cache_add( 'kirki_image_id_' . md5( $url ), $attachment, null );
+ }
+
+ if ( ! empty( $attachment ) ) {
+ return $attachment[0];
+ }
+ return 0;
+ }
+
+ /**
+ * Returns an array of the attachment's properties.
+ *
+ * @param string $url URL to the image.
+ * @return array
+ */
+ public static function get_image_from_url( $url ) {
+
+ $image_id = self::get_image_id( $url );
+ $image = wp_get_attachment_image_src( $image_id, 'full' );
+
+ return array(
+ 'url' => $image[0],
+ 'width' => $image[1],
+ 'height' => $image[2],
+ 'thumbnail' => $image[3],
+ );
+
+ }
+
+ /**
+ * Get an array of posts.
+ *
+ * @static
+ * @access public
+ * @param array $args Define arguments for the get_posts function.
+ * @return array
+ */
+ public static function get_posts( $args ) {
+
+ if ( is_string( $args ) ) {
+ $args = add_query_arg(
+ array(
+ 'suppress_filters' => false,
+ )
+ );
+ } elseif ( is_array( $args ) && ! isset( $args['suppress_filters'] ) ) {
+ $args['suppress_filters'] = false;
+ }
+
+ // Get the posts.
+ // TODO: WordPress.VIP.RestrictedFunctions.get_posts_get_posts.
+ $posts = get_posts( $args );
+
+ // Properly format the array.
+ $items = array();
+ foreach ( $posts as $post ) {
+ $items[ $post->ID ] = $post->post_title;
+ }
+ wp_reset_postdata();
+
+ return $items;
+
+ }
+
+ /**
+ * Get an array of publicly-querable taxonomies.
+ *
+ * @static
+ * @access public
+ * @return array
+ */
+ public static function get_taxonomies() {
+
+ $items = array();
+
+ // Get the taxonomies.
+ $taxonomies = get_taxonomies(
+ array(
+ 'public' => true,
+ )
+ );
+
+ // Build the array.
+ foreach ( $taxonomies as $taxonomy ) {
+ $id = $taxonomy;
+ $taxonomy = get_taxonomy( $taxonomy );
+ $items[ $id ] = $taxonomy->labels->name;
+ }
+
+ return $items;
+
+ }
+
+ /**
+ * Get an array of publicly-querable post-types.
+ *
+ * @static
+ * @access public
+ * @return array
+ */
+ public static function get_post_types() {
+
+ $items = array();
+
+ // Get the post types.
+ $post_types = get_post_types(
+ array(
+ 'public' => true,
+ ), 'objects'
+ );
+
+ // Build the array.
+ foreach ( $post_types as $post_type ) {
+ $items[ $post_type->name ] = $post_type->labels->name;
+ }
+
+ return $items;
+
+ }
+
+ /**
+ * Get an array of terms from a taxonomy
+ *
+ * @static
+ * @access public
+ * @param string|array $taxonomies See https://developer.wordpress.org/reference/functions/get_terms/ for details.
+ * @return array
+ */
+ public static function get_terms( $taxonomies ) {
+
+ $items = array();
+
+ // Get the post types.
+ $terms = get_terms( $taxonomies );
+
+ // Build the array.
+ foreach ( $terms as $term ) {
+ $items[ $term->term_id ] = $term->name;
+ }
+
+ return $items;
+
+ }
+
+ /**
+ * Gets an array of material-design colors.
+ *
+ * @static
+ * @access public
+ * @param string $context Allows us to get subsets of the palette.
+ * @return array
+ */
+ public static function get_material_design_colors( $context = 'primary' ) {
+
+ $colors = array(
+ 'primary' => array( '#FFFFFF', '#000000', '#F44336', '#E91E63', '#9C27B0', '#673AB7', '#3F51B5', '#2196F3', '#03A9F4', '#00BCD4', '#009688', '#4CAF50', '#8BC34A', '#CDDC39', '#FFEB3B', '#FFC107', '#FF9800', '#FF5722', '#795548', '#9E9E9E', '#607D8B' ),
+ 'red' => array( '#FFEBEE', '#FFCDD2', '#EF9A9A', '#E57373', '#EF5350', '#F44336', '#E53935', '#D32F2F', '#C62828', '#B71C1C', '#FF8A80', '#FF5252', '#FF1744', '#D50000' ),
+ 'pink' => array( '#FCE4EC', '#F8BBD0', '#F48FB1', '#F06292', '#EC407A', '#E91E63', '#D81B60', '#C2185B', '#AD1457', '#880E4F', '#FF80AB', '#FF4081', '#F50057', '#C51162' ),
+ 'purple' => array( '#F3E5F5', '#E1BEE7', '#CE93D8', '#BA68C8', '#AB47BC', '#9C27B0', '#8E24AA', '#7B1FA2', '#6A1B9A', '#4A148C', '#EA80FC', '#E040FB', '#D500F9', '#AA00FF' ),
+ 'deep-purple' => array( '#EDE7F6', '#D1C4E9', '#B39DDB', '#9575CD', '#7E57C2', '#673AB7', '#5E35B1', '#512DA8', '#4527A0', '#311B92', '#B388FF', '#7C4DFF', '#651FFF', '#6200EA' ),
+ 'indigo' => array( '#E8EAF6', '#C5CAE9', '#9FA8DA', '#7986CB', '#5C6BC0', '#3F51B5', '#3949AB', '#303F9F', '#283593', '#1A237E', '#8C9EFF', '#536DFE', '#3D5AFE', '#304FFE' ),
+ 'blue' => array( '#E3F2FD', '#BBDEFB', '#90CAF9', '#64B5F6', '#42A5F5', '#2196F3', '#1E88E5', '#1976D2', '#1565C0', '#0D47A1', '#82B1FF', '#448AFF', '#2979FF', '#2962FF' ),
+ 'light-blue' => array( '#E1F5FE', '#B3E5FC', '#81D4fA', '#4fC3F7', '#29B6FC', '#03A9F4', '#039BE5', '#0288D1', '#0277BD', '#01579B', '#80D8FF', '#40C4FF', '#00B0FF', '#0091EA' ),
+ 'cyan' => array( '#E0F7FA', '#B2EBF2', '#80DEEA', '#4DD0E1', '#26C6DA', '#00BCD4', '#00ACC1', '#0097A7', '#00838F', '#006064', '#84FFFF', '#18FFFF', '#00E5FF', '#00B8D4' ),
+ 'teal' => array( '#E0F2F1', '#B2DFDB', '#80CBC4', '#4DB6AC', '#26A69A', '#009688', '#00897B', '#00796B', '#00695C', '#004D40', '#A7FFEB', '#64FFDA', '#1DE9B6', '#00BFA5' ),
+ 'green' => array( '#E8F5E9', '#C8E6C9', '#A5D6A7', '#81C784', '#66BB6A', '#4CAF50', '#43A047', '#388E3C', '#2E7D32', '#1B5E20', '#B9F6CA', '#69F0AE', '#00E676', '#00C853' ),
+ 'light-green' => array( '#F1F8E9', '#DCEDC8', '#C5E1A5', '#AED581', '#9CCC65', '#8BC34A', '#7CB342', '#689F38', '#558B2F', '#33691E', '#CCFF90', '#B2FF59', '#76FF03', '#64DD17' ),
+ 'lime' => array( '#F9FBE7', '#F0F4C3', '#E6EE9C', '#DCE775', '#D4E157', '#CDDC39', '#C0CA33', '#A4B42B', '#9E9D24', '#827717', '#F4FF81', '#EEFF41', '#C6FF00', '#AEEA00' ),
+ 'yellow' => array( '#FFFDE7', '#FFF9C4', '#FFF590', '#FFF176', '#FFEE58', '#FFEB3B', '#FDD835', '#FBC02D', '#F9A825', '#F57F17', '#FFFF82', '#FFFF00', '#FFEA00', '#FFD600' ),
+ 'amber' => array( '#FFF8E1', '#FFECB3', '#FFE082', '#FFD54F', '#FFCA28', '#FFC107', '#FFB300', '#FFA000', '#FF8F00', '#FF6F00', '#FFE57F', '#FFD740', '#FFC400', '#FFAB00' ),
+ 'orange' => array( '#FFF3E0', '#FFE0B2', '#FFCC80', '#FFB74D', '#FFA726', '#FF9800', '#FB8C00', '#F57C00', '#EF6C00', '#E65100', '#FFD180', '#FFAB40', '#FF9100', '#FF6D00' ),
+ 'deep-orange' => array( '#FBE9A7', '#FFCCBC', '#FFAB91', '#FF8A65', '#FF7043', '#FF5722', '#F4511E', '#E64A19', '#D84315', '#BF360C', '#FF9E80', '#FF6E40', '#FF3D00', '#DD2600' ),
+ 'brown' => array( '#EFEBE9', '#D7CCC8', '#BCAAA4', '#A1887F', '#8D6E63', '#795548', '#6D4C41', '#5D4037', '#4E342E', '#3E2723' ),
+ 'grey' => array( '#FAFAFA', '#F5F5F5', '#EEEEEE', '#E0E0E0', '#BDBDBD', '#9E9E9E', '#757575', '#616161', '#424242', '#212121', '#000000', '#ffffff' ),
+ 'blue-grey' => array( '#ECEFF1', '#CFD8DC', '#B0BBC5', '#90A4AE', '#78909C', '#607D8B', '#546E7A', '#455A64', '#37474F', '#263238' ),
+ );
+
+ switch ( $context ) {
+
+ case '50':
+ case '100':
+ case '200':
+ case '300':
+ case '400':
+ case '500':
+ case '600':
+ case '700':
+ case '800':
+ case '900':
+ case 'A100':
+ case 'A200':
+ case 'A400':
+ case 'A700':
+ $key = absint( $context ) / 100;
+ if ( 'A100' === $context ) {
+ $key = 10;
+ unset( $colors['grey'] );
+ } elseif ( 'A200' === $context ) {
+ $key = 11;
+ unset( $colors['grey'] );
+ } elseif ( 'A400' === $context ) {
+ $key = 12;
+ unset( $colors['grey'] );
+ } elseif ( 'A700' === $context ) {
+ $key = 13;
+ unset( $colors['grey'] );
+ }
+ unset( $colors['primary'] );
+ $position_colors = array();
+ foreach ( $colors as $color_family ) {
+ if ( isset( $color_family[ $key ] ) ) {
+ $position_colors[] = $color_family[ $key ];
+ }
+ }
+ return $position_colors;
+ case 'all':
+ unset( $colors['primary'] );
+ $all_colors = array();
+ foreach ( $colors as $color_family ) {
+ foreach ( $color_family as $color ) {
+ $all_colors[] = $color;
+ }
+ }
+ return $all_colors;
+ case 'primary':
+ return $colors['primary'];
+ default:
+ if ( isset( $colors[ $context ] ) ) {
+ return $colors[ $context ];
+ }
+ return $colors['primary'];
+ }
+ }
+
+ /**
+ * Get an array of all available dashicons.
+ *
+ * @static
+ * @access public
+ * @return array
+ */
+ public static function get_dashicons() {
+
+ return array(
+ 'admin-menu' => array( 'menu', 'admin-site', 'dashboard', 'admin-post', 'admin-media', 'admin-links', 'admin-page', 'admin-comments', 'admin-appearance', 'admin-plugins', 'admin-users', 'admin-tools', 'admin-settings', 'admin-network', 'admin-home', 'admin-generic', 'admin-collapse', 'filter', 'admin-customizer', 'admin-multisite' ),
+ 'welcome-screen' => array( 'welcome-write-blog', 'welcome-add-page', 'welcome-view-site', 'welcome-widgets-menus', 'welcome-comments', 'welcome-learn-more' ),
+ 'post-formats' => array( 'format-aside', 'format-image', 'format-gallery', 'format-video', 'format-status', 'format-quote', 'format-chat', 'format-audio', 'camera', 'images-alt', 'images-alt2', 'video-alt', 'video-alt2', 'video-alt3' ),
+ 'media' => array( 'media-archive', 'media-audio', 'media-code', 'media-default', 'media-document', 'media-interactive', 'media-spreadsheet', 'media-text', 'media-video', 'playlist-audio', 'playlist-video', 'controls-play', 'controls-pause', 'controls-forward', 'controls-skipforward', 'controls-back', 'controls-skipback', 'controls-repeat', 'controls-volumeon', 'controls-volumeoff' ),
+ 'image-editing' => array( 'image-crop', 'image-rotate', 'image-rotate-left', 'image-rotate-right', 'image-flip-vertical', 'image-flip-horizontal', 'image-filter', 'undo', 'redo' ),
+ 'tinymce' => array( 'editor-bold', 'editor-italic', 'editor-ul', 'editor-ol', 'editor-quote', 'editor-alignleft', 'editor-aligncenter', 'editor-alignright', 'editor-insertmore', 'editor-spellcheck', 'editor-expand', 'editor-contract', 'editor-kitchensink', 'editor-underline', 'editor-justify', 'editor-textcolor', 'editor-paste-word', 'editor-paste-text', 'editor-removeformatting', 'editor-video', 'editor-customchar', 'editor-outdent', 'editor-indent', 'editor-help', 'editor-strikethrough', 'editor-unlink', 'editor-rtl', 'editor-break', 'editor-code', 'editor-paragraph', 'editor-table' ),
+ 'posts' => array( 'align-left', 'align-right', 'align-center', 'align-none', 'lock', 'unlock', 'calendar', 'calendar-alt', 'visibility', 'hidden', 'post-status', 'edit', 'trash', 'sticky' ),
+ 'sorting' => array( 'external', 'arrow-up', 'arrow-down', 'arrow-right', 'arrow-left', 'arrow-up-alt', 'arrow-down-alt', 'arrow-right-alt', 'arrow-left-alt', 'arrow-up-alt2', 'arrow-down-alt2', 'arrow-right-alt2', 'arrow-left-alt2', 'sort', 'leftright', 'randomize', 'list-view', 'exerpt-view', 'grid-view' ),
+ 'social' => array( 'share', 'share-alt', 'share-alt2', 'twitter', 'rss', 'email', 'email-alt', 'facebook', 'facebook-alt', 'googleplus', 'networking' ),
+ 'wordpress_org' => array( 'hammer', 'art', 'migrate', 'performance', 'universal-access', 'universal-access-alt', 'tickets', 'nametag', 'clipboard', 'heart', 'megaphone', 'schedule' ),
+ 'products' => array( 'wordpress', 'wordpress-alt', 'pressthis', 'update', 'screenoptions', 'info', 'cart', 'feedback', 'cloud', 'translation' ),
+ 'taxonomies' => array( 'tag', 'category' ),
+ 'widgets' => array( 'archive', 'tagcloud', 'text' ),
+ 'notifications' => array( 'yes', 'no', 'no-alt', 'plus', 'plus-alt', 'minus', 'dismiss', 'marker', 'star-filled', 'star-half', 'star-empty', 'flag', 'warning' ),
+ 'misc' => array( 'location', 'location-alt', 'vault', 'shield', 'shield-alt', 'sos', 'search', 'slides', 'analytics', 'chart-pie', 'chart-bar', 'chart-line', 'chart-area', 'groups', 'businessman', 'id', 'id-alt', 'products', 'awards', 'forms', 'testimonial', 'portfolio', 'book', 'book-alt', 'download', 'upload', 'backup', 'clock', 'lightbulb', 'microphone', 'desktop', 'tablet', 'smartphone', 'phone', 'index-card', 'carrot', 'building', 'store', 'album', 'palmtree', 'tickets-alt', 'money', 'smiley', 'thumbs-up', 'thumbs-down', 'layout' ),
+ );
+
+ }
+
+ /**
+ * Compares the 2 values given the condition
+ *
+ * @param mixed $value1 The 1st value in the comparison.
+ * @param mixed $value2 The 2nd value in the comparison.
+ * @param string $operator The operator we'll use for the comparison.
+ * @return boolean whether The comparison has succeded (true) or failed (false).
+ */
+ public static function compare_values( $value1, $value2, $operator ) {
+ if ( '===' === $operator ) {
+ return $value1 === $value2;
+ }
+ if ( '!==' === $operator ) {
+ return $value1 !== $value2;
+ }
+ if ( ( '!=' === $operator || 'not equal' === $operator ) ) {
+ return $value1 != $value2; // WPCS: loose comparison ok.
+ }
+ if ( ( '>=' === $operator || 'greater or equal' === $operator || 'equal or greater' === $operator ) ) {
+ return $value2 >= $value1;
+ }
+ if ( ( '<=' === $operator || 'smaller or equal' === $operator || 'equal or smaller' === $operator ) ) {
+ return $value2 <= $value1;
+ }
+ if ( ( '>' === $operator || 'greater' === $operator ) ) {
+ return $value2 > $value1;
+ }
+ if ( ( '<' === $operator || 'smaller' === $operator ) ) {
+ return $value2 < $value1;
+ }
+ if ( 'contains' === $operator || 'in' === $operator ) {
+ if ( is_array( $value1 ) && is_array( $value2 ) ) {
+ foreach ( $value2 as $val ) {
+ if ( in_array( $val, $value1 ) ) { // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
+ return true;
+ }
+ }
+ return false;
+ }
+ if ( is_array( $value1 ) && ! is_array( $value2 ) ) {
+ return in_array( $value2, $value1 ); // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
+ }
+ if ( is_array( $value2 ) && ! is_array( $value1 ) ) {
+ return in_array( $value1, $value2 ); // phpcs:ignore WordPress.PHP.StrictInArray.MissingTrueStrict
+ }
+ return ( false !== strrpos( $value1, $value2 ) || false !== strpos( $value2, $value1 ) );
+ }
+ return $value1 == $value2; // WPCS: loose comparison ok.
+ }
+}
diff --git a/assets/kirki/core/class-kirki-init.php b/assets/kirki/core/class-kirki-init.php
new file mode 100644
index 0000000..5387eea
--- /dev/null
+++ b/assets/kirki/core/class-kirki-init.php
@@ -0,0 +1,325 @@
+control_types = array(
+ 'checkbox' => 'Kirki_Control_Checkbox',
+ 'kirki-background' => 'Kirki_Control_Background',
+ 'code_editor' => 'Kirki_Control_Code',
+ 'kirki-color' => 'Kirki_Control_Color',
+ 'kirki-color-palette' => 'Kirki_Control_Color_Palette',
+ 'kirki-custom' => 'Kirki_Control_Custom',
+ 'kirki-date' => 'Kirki_Control_Date',
+ 'kirki-dashicons' => 'Kirki_Control_Dashicons',
+ 'kirki-dimension' => 'Kirki_Control_Dimension',
+ 'kirki-dimensions' => 'Kirki_Control_Dimensions',
+ 'kirki-editor' => 'Kirki_Control_Editor',
+ 'kirki-fontawesome' => 'Kirki_Control_FontAwesome',
+ 'kirki-image' => 'Kirki_Control_Image',
+ 'kirki-multicolor' => 'Kirki_Control_Multicolor',
+ 'kirki-multicheck' => 'Kirki_Control_MultiCheck',
+ 'kirki-number' => 'Kirki_Control_Number',
+ 'kirki-palette' => 'Kirki_Control_Palette',
+ 'kirki-radio' => 'Kirki_Control_Radio',
+ 'kirki-radio-buttonset' => 'Kirki_Control_Radio_ButtonSet',
+ 'kirki-radio-image' => 'Kirki_Control_Radio_Image',
+ 'repeater' => 'Kirki_Control_Repeater',
+ 'kirki-select' => 'Kirki_Control_Select',
+ 'kirki-slider' => 'Kirki_Control_Slider',
+ 'kirki-sortable' => 'Kirki_Control_Sortable',
+ 'kirki-spacing' => 'Kirki_Control_Dimensions',
+ 'kirki-switch' => 'Kirki_Control_Switch',
+ 'kirki-generic' => 'Kirki_Control_Generic',
+ 'kirki-toggle' => 'Kirki_Control_Toggle',
+ 'kirki-typography' => 'Kirki_Control_Typography',
+ 'image' => 'Kirki_Control_Image',
+ 'cropped_image' => 'Kirki_Control_Cropped_Image',
+ 'upload' => 'Kirki_Control_Upload',
+ );
+ return array_merge( $this->control_types, $control_types );
+
+ }
+
+ /**
+ * Helper function that adds the fields, sections and panels to the customizer.
+ */
+ public function add_to_customizer() {
+ $this->fields_from_filters();
+ add_action( 'customize_register', array( $this, 'register_control_types' ) );
+ add_action( 'customize_register', array( $this, 'add_panels' ), 97 );
+ add_action( 'customize_register', array( $this, 'add_sections' ), 98 );
+ add_action( 'customize_register', array( $this, 'add_fields' ), 99 );
+ }
+
+ /**
+ * Register control types
+ */
+ public function register_control_types() {
+ global $wp_customize;
+
+ $section_types = apply_filters( 'kirki_section_types', array() );
+ foreach ( $section_types as $section_type ) {
+ $wp_customize->register_section_type( $section_type );
+ }
+
+ $this->control_types = $this->default_control_types();
+ if ( ! class_exists( 'WP_Customize_Code_Editor_Control' ) ) {
+ unset( $this->control_types['code_editor'] );
+ }
+ foreach ( $this->control_types as $key => $classname ) {
+ if ( ! class_exists( $classname ) ) {
+ unset( $this->control_types[ $key ] );
+ }
+ }
+
+ $skip_control_types = apply_filters(
+ 'kirki_control_types_exclude', array(
+ 'Kirki_Control_Repeater',
+ 'WP_Customize_Control',
+ )
+ );
+
+ foreach ( $this->control_types as $control_type ) {
+ if ( ! in_array( $control_type, $skip_control_types, true ) && class_exists( $control_type ) ) {
+ $wp_customize->register_control_type( $control_type );
+ }
+ }
+ }
+
+ /**
+ * Register our panels to the WordPress Customizer.
+ *
+ * @access public
+ */
+ public function add_panels() {
+ if ( ! empty( Kirki::$panels ) ) {
+ foreach ( Kirki::$panels as $panel_args ) {
+ // Extra checks for nested panels.
+ if ( isset( $panel_args['panel'] ) ) {
+ if ( isset( Kirki::$panels[ $panel_args['panel'] ] ) ) {
+ // Set the type to nested.
+ $panel_args['type'] = 'kirki-nested';
+ }
+ }
+
+ new Kirki_Panel( $panel_args );
+ }
+ }
+ }
+
+ /**
+ * Register our sections to the WordPress Customizer.
+ *
+ * @var object The WordPress Customizer object
+ */
+ public function add_sections() {
+ if ( ! empty( Kirki::$sections ) ) {
+ foreach ( Kirki::$sections as $section_args ) {
+ // Extra checks for nested sections.
+ if ( isset( $section_args['section'] ) ) {
+ if ( isset( Kirki::$sections[ $section_args['section'] ] ) ) {
+ // Set the type to nested.
+ $section_args['type'] = 'kirki-nested';
+ // We need to check if the parent section is nested inside a panel.
+ $parent_section = Kirki::$sections[ $section_args['section'] ];
+ if ( isset( $parent_section['panel'] ) ) {
+ $section_args['panel'] = $parent_section['panel'];
+ }
+ }
+ }
+ new Kirki_Section( $section_args );
+ }
+ }
+ }
+
+ /**
+ * Create the settings and controls from the $fields array and register them.
+ *
+ * @var object The WordPress Customizer object.
+ */
+ public function add_fields() {
+
+ global $wp_customize;
+ foreach ( Kirki::$fields as $args ) {
+
+ // Create the settings.
+ new Kirki_Settings( $args );
+
+ // Check if we're on the customizer.
+ // If we are, then we will create the controls, add the scripts needed for the customizer
+ // and any other tweaks that this field may require.
+ if ( $wp_customize ) {
+
+ // Create the control.
+ new Kirki_Control( $args );
+
+ }
+ }
+ }
+
+ /**
+ * Process fields added using the 'kirki_fields' and 'kirki_controls' filter.
+ * These filters are no longer used, this is simply for backwards-compatibility.
+ *
+ * @access private
+ * @since 2.0.0
+ */
+ private function fields_from_filters() {
+
+ $fields = apply_filters( 'kirki_controls', array() );
+ $fields = apply_filters( 'kirki_fields', $fields );
+
+ if ( ! empty( $fields ) ) {
+ foreach ( $fields as $field ) {
+ Kirki::add_field( 'global', $field );
+ }
+ }
+ }
+
+ /**
+ * Alias for the is_plugin static method in the Kirki_Util class.
+ * This is here for backwards-compatibility purposes.
+ *
+ * @static
+ * @access public
+ * @since 3.0.0
+ * @return bool
+ */
+ public static function is_plugin() {
+ // Return result using the Kirki_Util class.
+ return Kirki_Util::is_plugin();
+ }
+
+ /**
+ * Alias for the get_variables static method in the Kirki_Util class.
+ * This is here for backwards-compatibility purposes.
+ *
+ * @static
+ * @access public
+ * @since 2.0.0
+ * @return array Formatted as array( 'variable-name' => value ).
+ */
+ public static function get_variables() {
+ // Log error for developers.
+ _doing_it_wrong( __METHOD__, esc_attr__( 'We detected you\'re using Kirki_Init::get_variables(). Please use Kirki_Util::get_variables() instead.', 'kirki' ), '3.0.10' );
+ // Return result using the Kirki_Util class.
+ return Kirki_Util::get_variables();
+ }
+
+ /**
+ * Remove panels.
+ *
+ * @since 3.0.17
+ * @param object $wp_customize The customizer object.
+ * @return void
+ */
+ public function remove_panels( $wp_customize ) {
+ foreach ( Kirki::$panels_to_remove as $panel ) {
+ $wp_customize->remove_panel( $panel );
+ }
+ }
+
+ /**
+ * Remove sections.
+ *
+ * @since 3.0.17
+ * @param object $wp_customize The customizer object.
+ * @return void
+ */
+ public function remove_sections( $wp_customize ) {
+ foreach ( Kirki::$sections_to_remove as $section ) {
+ $wp_customize->remove_section( $section );
+ }
+ }
+
+ /**
+ * Remove controls.
+ *
+ * @since 3.0.17
+ * @param object $wp_customize The customizer object.
+ * @return void
+ */
+ public function remove_controls( $wp_customize ) {
+ foreach ( Kirki::$controls_to_remove as $control ) {
+ $wp_customize->remove_control( $control );
+ }
+ }
+}
diff --git a/assets/kirki/core/class-kirki-l10n.php b/assets/kirki/core/class-kirki-l10n.php
new file mode 100644
index 0000000..d2ca609
--- /dev/null
+++ b/assets/kirki/core/class-kirki-l10n.php
@@ -0,0 +1,155 @@
+get_path() ) {
+ load_textdomain( $this->textdomain, $this->get_path() );
+ }
+ load_plugin_textdomain( $this->textdomain, false, Kirki::$path . '/languages' );
+
+ }
+
+ /**
+ * Gets the path to a translation file.
+ *
+ * @access protected
+ * @return string Absolute path to the translation file.
+ */
+ protected function get_path() {
+ $path_found = false;
+ $found_path = null;
+ foreach ( $this->get_paths() as $path ) {
+ if ( $path_found ) {
+ continue;
+ }
+ $path = wp_normalize_path( $path );
+ if ( file_exists( $path ) ) {
+ $path_found = true;
+ $found_path = $path;
+ }
+ }
+
+ return $found_path;
+
+ }
+
+ /**
+ * Returns an array of paths where translation files may be located.
+ *
+ * @access protected
+ * @return array
+ */
+ protected function get_paths() {
+
+ return array(
+ WP_LANG_DIR . '/' . $this->textdomain . '-' . get_locale() . '.mo',
+ Kirki::$path . '/languages/' . $this->textdomain . '-' . get_locale() . '.mo',
+ );
+
+ }
+
+ /**
+ * Allows overriding the "kirki" textdomain from a theme.
+ *
+ * @since 3.0.12
+ * @access public
+ * @param bool $override Whether to override the .mo file loading. Default false.
+ * @param string $domain Text domain. Unique identifier for retrieving translated strings.
+ * @param string $mofile Path to the MO file.
+ * @return bool
+ */
+ public function override_load_textdomain( $override, $domain, $mofile ) {
+
+ global $l10n;
+ if ( isset( $l10n[ $this->get_theme_textdomain() ] ) ) {
+ $l10n['kirki'] = $l10n[ $this->get_theme_textdomain() ]; // phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
+ }
+
+ // Check if the domain is "kirki".
+ if ( 'kirki' === $domain ) {
+ return true;
+ }
+ return $override;
+
+ }
+
+ /**
+ * Get the theme's textdomain.
+ *
+ * @since 3.0.12
+ * @access private
+ * @return string
+ */
+ private function get_theme_textdomain() {
+
+ if ( '' === $this->theme_textdomain ) {
+
+ // Get the textdomain.
+ $theme = wp_get_theme();
+ $this->theme_textdomain = $theme->get( 'TextDomain' );
+
+ // If no texdomain was found, use the template folder name.
+ if ( ! $this->theme_textdomain ) {
+ $this->theme_textdomain = get_template();
+ }
+ }
+ return $this->theme_textdomain;
+
+ }
+}
diff --git a/assets/kirki/core/class-kirki-modules.php b/assets/kirki/core/class-kirki-modules.php
new file mode 100644
index 0000000..c7d89a4
--- /dev/null
+++ b/assets/kirki/core/class-kirki-modules.php
@@ -0,0 +1,156 @@
+default_modules();
+ $this->init();
+
+ }
+
+ /**
+ * Set the default modules and apply the 'kirki_modules' filter.
+ *
+ * @access private
+ * @since 3.0.0
+ */
+ private function default_modules() {
+
+ self::$modules = apply_filters(
+ 'kirki_modules', array(
+ 'css' => 'Kirki_Modules_CSS',
+ 'css-vars' => 'Kirki_Modules_CSS_Vars',
+ 'customizer-styling' => 'Kirki_Modules_Customizer_Styling',
+ 'icons' => 'Kirki_Modules_Icons',
+ 'loading' => 'Kirki_Modules_Loading',
+ 'tooltips' => 'Kirki_Modules_Tooltips',
+ 'branding' => 'Kirki_Modules_Customizer_Branding',
+ 'postMessage' => 'Kirki_Modules_PostMessage',
+ 'selective-refresh' => 'Kirki_Modules_Selective_Refresh',
+ 'field-dependencies' => 'Kirki_Modules_Field_Dependencies',
+ 'custom-sections' => 'Kirki_Modules_Custom_Sections',
+ 'webfonts' => 'Kirki_Modules_Webfonts',
+ 'webfont-loader' => 'Kirki_Modules_Webfont_Loader',
+ 'preset' => 'Kirki_Modules_Preset',
+ )
+ );
+
+ }
+
+ /**
+ * Instantiates the modules.
+ *
+ * @access private
+ * @since 3.0.0
+ */
+ private function init() {
+
+ foreach ( self::$modules as $key => $module_class ) {
+ if ( class_exists( $module_class ) ) {
+ // Use this syntax instead of $module_class::get_instance()
+ // for PHP 5.2 compatibility.
+ self::$active_modules[ $key ] = call_user_func( array( $module_class, 'get_instance' ) );
+ }
+ }
+ }
+
+ /**
+ * Add a module.
+ *
+ * @static
+ * @access public
+ * @param string $module The classname of the module to add.
+ * @since 3.0.0
+ */
+ public static function add_module( $module ) {
+
+ if ( ! in_array( $module, self::$modules, true ) ) {
+ self::$modules[] = $module;
+ }
+
+ }
+
+ /**
+ * Remove a module.
+ *
+ * @static
+ * @access public
+ * @param string $module The classname of the module to add.
+ * @since 3.0.0
+ */
+ public static function remove_module( $module ) {
+
+ $key = array_search( $module, self::$modules, true );
+ if ( false !== $key ) {
+ unset( self::$modules[ $key ] );
+ }
+ }
+
+ /**
+ * Get the modules array.
+ *
+ * @static
+ * @access public
+ * @since 3.0.0
+ * @return array
+ */
+ public static function get_modules() {
+
+ return self::$modules;
+
+ }
+
+ /**
+ * Get the array of active modules (objects).
+ *
+ * @static
+ * @access public
+ * @since 3.0.0
+ * @return array
+ */
+ public static function get_active_modules() {
+
+ return self::$active_modules;
+
+ }
+}
diff --git a/assets/kirki/core/class-kirki-panel.php b/assets/kirki/core/class-kirki-panel.php
new file mode 100644
index 0000000..aff4b51
--- /dev/null
+++ b/assets/kirki/core/class-kirki-panel.php
@@ -0,0 +1,57 @@
+ 'WP_Customize_Panel',
+ );
+
+ /**
+ * The class constructor.
+ *
+ * @access public
+ * @param array $args The panel arguments.
+ */
+ public function __construct( $args ) {
+
+ $this->panel_types = apply_filters( 'kirki_panel_types', $this->panel_types );
+ $this->add_panel( $args );
+
+ }
+
+ /**
+ * Add the panel using the Customizer API.
+ *
+ * @param array $args The panel arguments.
+ */
+ public function add_panel( $args ) {
+ global $wp_customize;
+
+ if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->panel_types ) ) {
+ $args['type'] = 'default';
+ }
+ $panel_classname = $this->panel_types[ $args['type'] ];
+
+ $wp_customize->add_panel( new $panel_classname( $wp_customize, sanitize_key( $args['id'] ), $args ) );
+
+ }
+}
diff --git a/assets/kirki/core/class-kirki-sanitize-values.php b/assets/kirki/core/class-kirki-sanitize-values.php
new file mode 100644
index 0000000..48efce9
--- /dev/null
+++ b/assets/kirki/core/class-kirki-sanitize-values.php
@@ -0,0 +1,198 @@
+sanitize( $value );
+ }
+
+ /**
+ * Sanitize number options.
+ *
+ * @static
+ * @access public
+ * @since 0.5
+ * @param int|float|double|string $value The value to be sanitized.
+ * @return integer|double|string
+ */
+ public static function number( $value ) {
+ return ( is_numeric( $value ) ) ? $value : intval( $value );
+ }
+
+ /**
+ * Drop-down Pages sanitization callback.
+ *
+ * - Sanitization: dropdown-pages
+ * - Control: dropdown-pages
+ *
+ * Sanitization callback for 'dropdown-pages' type controls. This callback sanitizes `$page_id`
+ * as an absolute integer, and then validates that $input is the ID of a published page.
+ *
+ * @see absint() https://developer.wordpress.org/reference/functions/absint/
+ * @see get_post_status() https://developer.wordpress.org/reference/functions/get_post_status/
+ *
+ * @param int $page_id Page ID.
+ * @param WP_Customize_Setting $setting Setting instance.
+ * @return int|string Page ID if the page is published; otherwise, the setting default.
+ */
+ public static function dropdown_pages( $page_id, $setting ) {
+ // Ensure $input is an absolute integer.
+ $page_id = absint( $page_id );
+
+ // If $page_id is an ID of a published page, return it; otherwise, return the default.
+ return ( 'publish' === get_post_status( $page_id ) ? $page_id : $setting->default );
+ }
+
+ /**
+ * Sanitizes css dimensions.
+ *
+ * @static
+ * @access public
+ * @since 2.2.0
+ * @param string $value The value to be sanitized.
+ * @return string
+ */
+ public static function css_dimension( $value ) {
+
+ // Trim it.
+ $value = trim( $value );
+
+ // If the value is round, then return 50%.
+ if ( 'round' === $value ) {
+ $value = '50%';
+ }
+
+ // If the value is empty, return empty.
+ if ( '' === $value ) {
+ return '';
+ }
+
+ // If auto, inherit or initial, return the value.
+ if ( 'auto' === $value || 'initial' === $value || 'inherit' === $value || 'normal' === $value ) {
+ return $value;
+ }
+
+ // Return empty if there are no numbers in the value.
+ if ( ! preg_match( '#[0-9]#', $value ) ) {
+ return '';
+ }
+
+ // If we're using calc() then return the value.
+ if ( false !== strpos( $value, 'calc(' ) ) {
+ return $value;
+ }
+
+ // The raw value without the units.
+ $raw_value = self::filter_number( $value );
+ $unit_used = '';
+
+ // An array of all valid CSS units. Their order was carefully chosen for this evaluation, don't mix it up!!!
+ $units = array( 'fr', 'rem', 'em', 'ex', '%', 'px', 'cm', 'mm', 'in', 'pt', 'pc', 'ch', 'vh', 'vw', 'vmin', 'vmax' );
+ foreach ( $units as $unit ) {
+ if ( false !== strpos( $value, $unit ) ) {
+ $unit_used = $unit;
+ }
+ }
+
+ // Hack for rem values.
+ if ( 'em' === $unit_used && false !== strpos( $value, 'rem' ) ) {
+ $unit_used = 'rem';
+ }
+
+ return $raw_value . $unit_used;
+ }
+
+ /**
+ * Filters numeric values.
+ *
+ * @static
+ * @access public
+ * @param string $value The value to be sanitized.
+ * @return int|float
+ */
+ public static function filter_number( $value ) {
+ return filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
+ }
+
+ /**
+ * Sanitize RGBA colors
+ *
+ * @static
+ * @since 0.8.5
+ * @param string $value The value to be sanitized.
+ * @return string
+ */
+ public static function rgba( $value ) {
+ $color = ariColor::newColor( $value );
+ return $color->toCSS( 'rgba' );
+ }
+
+ /**
+ * Sanitize colors.
+ *
+ * @static
+ * @since 0.8.5
+ * @param string $value The value to be sanitized.
+ * @return string
+ */
+ public static function color( $value ) {
+ // If the value is empty, then return empty.
+ if ( '' === $value ) {
+ return '';
+ }
+ // If transparent, then return 'transparent'.
+ if ( is_string( $value ) && 'transparent' === trim( $value ) ) {
+ return 'transparent';
+ }
+ // Instantiate the object.
+ $color = ariColor::newColor( $value );
+ // Return a CSS value, using the auto-detected mode.
+ return $color->toCSS( $color->mode );
+ }
+
+ /**
+ * DOES NOT SANITIZE ANYTHING.
+ *
+ * @static
+ * @since 0.5
+ * @param int|string|array $value The value to be sanitized.
+ * @return int|string|array
+ */
+ public static function unfiltered( $value ) {
+ return $value;
+ }
+}
diff --git a/assets/kirki/core/class-kirki-section.php b/assets/kirki/core/class-kirki-section.php
new file mode 100644
index 0000000..d0766da
--- /dev/null
+++ b/assets/kirki/core/class-kirki-section.php
@@ -0,0 +1,64 @@
+section_types = apply_filters( 'kirki_section_types', $this->section_types );
+ $this->add_section( $args );
+
+ }
+
+ /**
+ * Adds the section using the WordPress Customizer API.
+ *
+ * @access public
+ * @param array $args The section parameters.
+ */
+ public function add_section( $args ) {
+
+ global $wp_customize;
+
+ // The default class to be used when creating a section.
+ $section_classname = 'WP_Customize_Section';
+
+ if ( isset( $args['type'] ) && array_key_exists( $args['type'], $this->section_types ) ) {
+ $section_classname = $this->section_types[ $args['type'] ];
+ }
+ if ( isset( $args['type'] ) && 'kirki-outer' === $args['type'] ) {
+ $args['type'] = 'outer';
+ $section_classname = 'WP_Customize_Section';
+ }
+
+ // Add the section.
+ $wp_customize->add_section( new $section_classname( $wp_customize, sanitize_key( $args['id'] ), $args ) );
+
+ }
+}
diff --git a/assets/kirki/core/class-kirki-sections.php b/assets/kirki/core/class-kirki-sections.php
new file mode 100644
index 0000000..8251be8
--- /dev/null
+++ b/assets/kirki/core/class-kirki-sections.php
@@ -0,0 +1,48 @@
+' . esc_attr( $css ) . '';
+ }
+ }
+}
diff --git a/assets/kirki/core/class-kirki-setting-site-option.php b/assets/kirki/core/class-kirki-setting-site-option.php
new file mode 100644
index 0000000..343a3a7
--- /dev/null
+++ b/assets/kirki/core/class-kirki-setting-site-option.php
@@ -0,0 +1,73 @@
+id_data['base'], $default );
+ }
+
+ /**
+ * Set the root value for a setting, especially for multidimensional ones.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @param mixed $value Value to set as root of multidimensional setting.
+ * @return bool Whether the multidimensional root was updated successfully.
+ */
+ protected function set_root_value( $value ) {
+ return update_site_option( $this->id_data['base'], $value );
+ }
+
+ /**
+ * Save the value of the setting, using the related API.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @param mixed $value The value to update.
+ * @return bool The result of saving the value.
+ */
+ protected function update( $value ) {
+ return $this->set_root_value( $value );
+ }
+
+ /**
+ * Fetch the value of the setting.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @return mixed The value.
+ */
+ public function value() {
+ return $this->get_root_value( $this->default );
+ }
+}
diff --git a/assets/kirki/core/class-kirki-setting-user-meta.php b/assets/kirki/core/class-kirki-setting-user-meta.php
new file mode 100644
index 0000000..063c8ba
--- /dev/null
+++ b/assets/kirki/core/class-kirki-setting-user-meta.php
@@ -0,0 +1,93 @@
+id_data['base'];
+
+ // Get all user-meta.
+ // We'll use this to check if the value is set or not,
+ // in order to figure out if we need to return the default value.
+ $user_meta = get_user_meta( get_current_user_id() );
+
+ // Get the single meta.
+ $single_meta = get_user_meta( get_current_user_id(), $id_base, true );
+
+ if ( isset( $user_meta[ $id_base ] ) ) {
+ return $single_meta;
+ }
+ return $default;
+ }
+
+ /**
+ * Set the root value for a setting, especially for multidimensional ones.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @param mixed $value Value to set as root of multidimensional setting.
+ * @return bool Whether the multidimensional root was updated successfully.
+ */
+ protected function set_root_value( $value ) {
+ $id_base = $this->id_data['base'];
+
+ // First delete the current user-meta.
+ // We're doing this to avoid duplicate entries.
+ delete_user_meta( get_current_user_id(), $id_base );
+
+ // Update the user-meta.
+ return update_user_meta( get_current_user_id(), $id_base, $value );
+ }
+
+ /**
+ * Save the value of the setting, using the related API.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @param mixed $value The value to update.
+ * @return bool The result of saving the value.
+ */
+ protected function update( $value ) {
+ return $this->set_root_value( $value );
+ }
+
+ /**
+ * Fetch the value of the setting.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @return mixed The value.
+ */
+ public function value() {
+ return $this->get_root_value( $this->default );
+ }
+}
diff --git a/assets/kirki/core/class-kirki-settings.php b/assets/kirki/core/class-kirki-settings.php
new file mode 100644
index 0000000..32426f6
--- /dev/null
+++ b/assets/kirki/core/class-kirki-settings.php
@@ -0,0 +1,150 @@
+wp_customize = $wp_customize;
+
+ // Set the setting_types.
+ $this->set_setting_types();
+ // Add the settings.
+ $this->add_settings( $args );
+
+ }
+
+ /**
+ * Adds the settings for this field.
+ * If settings are defined as an array, then it goes through them
+ * and calls the add_setting method.
+ * If not an array, then it just calls add_setting
+ *
+ * @access private
+ * @param array $args The field definition as sanitized in Kirki_Field.
+ */
+ final private function add_settings( $args = array() ) {
+
+ // Get the classname we'll be using to create our setting(s).
+ $classname = false;
+ if ( isset( $args['option_type'] ) && array_key_exists( $args['option_type'], $this->setting_types ) ) {
+ $classname = $this->setting_types[ $args['option_type'] ];
+ }
+ if ( ! isset( $args['type'] ) || ! array_key_exists( $args['type'], $this->setting_types ) ) {
+ $args['type'] = 'default';
+ }
+ $classname = ! $classname ? $this->setting_types[ $args['type'] ] : $classname;
+
+ // If settings are defined as an array, then we need to go through them
+ // and call add_setting for each one of them separately.
+ if ( isset( $args['settings'] ) && is_array( $args['settings'] ) ) {
+
+ // Make sure defaults have been defined.
+ if ( ! isset( $args['default'] ) || ! is_array( $args['default'] ) ) {
+ $args['default'] = array();
+ }
+ foreach ( $args['settings'] as $key => $value ) {
+ $default = ( isset( $defaults[ $key ] ) ) ? $defaults[ $key ] : '';
+ $this->add_setting( $classname, $value, $default, $args['option_type'], $args['capability'], $args['transport'], $args['sanitize_callback'] );
+ }
+ }
+ $this->add_setting( $classname, $args['settings'], $args['default'], $args['option_type'], $args['capability'], $args['transport'], $args['sanitize_callback'] );
+ }
+
+ /**
+ * This is where we're finally adding the setting to the Customizer.
+ *
+ * @access private
+ * @param string $classname The name of the class that will be used to create this setting.
+ * We're getting this from $this->setting_types.
+ * @param string $setting The setting-name.
+ * If settings is an array, then this method is called per-setting.
+ * @param string|array $default Default value for this setting.
+ * @param string $type The data type we're using. Valid options: theme_mod|option.
+ * @param string $capability @see https://codex.wordpress.org/Roles_and_Capabilities.
+ * @param string $transport Use refresh|postMessage.
+ * @param string|array $sanitize_callback A callable sanitization function or method.
+ */
+ final private function add_setting( $classname, $setting, $default, $type, $capability, $transport, $sanitize_callback ) {
+
+ $this->wp_customize->add_setting(
+ new $classname(
+ $this->wp_customize, $setting, array(
+ 'default' => $default,
+ 'type' => $type,
+ 'capability' => $capability,
+ 'transport' => $transport,
+ 'sanitize_callback' => $sanitize_callback,
+ )
+ )
+ );
+
+ }
+
+ /**
+ * Sets the $this->setting_types property.
+ * Makes sure the kirki_setting_types filter is applied
+ * and that the defined classes actually exist.
+ * If a defined class does not exist, it is removed.
+ */
+ final private function set_setting_types() {
+
+ // Apply the kirki_setting_types filter.
+ $this->setting_types = apply_filters(
+ 'kirki_setting_types', array(
+ 'default' => 'WP_Customize_Setting',
+ 'repeater' => 'Kirki_Settings_Repeater_Setting',
+ 'user_meta' => 'Kirki_Setting_User_Meta',
+ 'site_option' => 'Kirki_Setting_Site_Option',
+ )
+ );
+
+ // Make sure the defined classes actually exist.
+ foreach ( $this->setting_types as $key => $classname ) {
+
+ if ( ! class_exists( $classname ) ) {
+ unset( $this->setting_types[ $key ] );
+ }
+ }
+ }
+}
diff --git a/assets/kirki/core/class-kirki-toolkit.php b/assets/kirki/core/class-kirki-toolkit.php
new file mode 100644
index 0000000..3a45fa6
--- /dev/null
+++ b/assets/kirki/core/class-kirki-toolkit.php
@@ -0,0 +1,45 @@
+ $args ) {
+ if ( ! $is_plugin && isset( $args['Name'] ) && ( 'Kirki' === $args['Name'] || 'Kirki Toolkit' === $args['Name'] ) ) {
+ $is_plugin = true;
+ $_plugin = $plugin;
+ }
+ }
+
+ // No need to proceed any further if Kirki wasn't found in the list of plugins.
+ if ( ! $is_plugin ) {
+ return false;
+ }
+
+ // Make sure the is_plugins_loaded function is loaded.
+ include_once ABSPATH . 'wp-admin/includes/plugin.php';
+
+ // Extra logic in case the plugin is installed but not activated.
+ if ( $_plugin && is_plugin_inactive( $_plugin ) ) {
+ return false;
+ }
+ return $is_plugin;
+ }
+
+ /**
+ * Build the variables.
+ *
+ * @static
+ * @access public
+ * @since 3.0.9
+ * @return array Formatted as array( 'variable-name' => value ).
+ */
+ public static function get_variables() {
+
+ $variables = array();
+
+ // Loop through all fields.
+ foreach ( Kirki::$fields as $field ) {
+
+ // Check if we have variables for this field.
+ if ( isset( $field['variables'] ) && $field['variables'] && ! empty( $field['variables'] ) ) {
+
+ // Loop through the array of variables.
+ foreach ( $field['variables'] as $field_variable ) {
+
+ // Is the variable ['name'] defined? If yes, then we can proceed.
+ if ( isset( $field_variable['name'] ) ) {
+
+ // Sanitize the variable name.
+ $variable_name = esc_attr( $field_variable['name'] );
+
+ // Do we have a callback function defined? If not then set $variable_callback to false.
+ $variable_callback = ( isset( $field_variable['callback'] ) && is_callable( $field_variable['callback'] ) ) ? $field_variable['callback'] : false;
+
+ // If we have a variable_callback defined then get the value of the option
+ // and run it through the callback function.
+ // If no callback is defined (false) then just get the value.
+ $variables[ $variable_name ] = Kirki_Values::get_value( $field['settings'] );
+ if ( $variable_callback ) {
+ $variables[ $variable_name ] = call_user_func( $field_variable['callback'], Kirki_Values::get_value( $field['settings'] ) );
+ }
+ }
+ }
+ }
+ }
+
+ // Pass the variables through a filter ('kirki_variable') and return the array of variables.
+ return apply_filters( 'kirki_variable', $variables );
+
+ }
+
+ /**
+ * HTTP Request injection.
+ *
+ * @access public
+ * @since 3.0.0
+ * @param array $request The request params.
+ * @param string $url The request URL.
+ * @return array
+ */
+ public function http_request( $request = array(), $url = '' ) {
+ // Early exit if installed as a plugin or not a request to wordpress.org,
+ // or finally if we don't have everything we need.
+ if (
+ self::is_plugin() ||
+ false === strpos( $url, 'wordpress.org' ) || (
+ ! isset( $request['body'] ) ||
+ ! isset( $request['body']['plugins'] ) ||
+ ! isset( $request['body']['translations'] ) ||
+ ! isset( $request['body']['locale'] ) ||
+ ! isset( $request['body']['all'] )
+ )
+ ) {
+ return $request;
+ }
+
+ $plugins = json_decode( $request['body']['plugins'], true );
+ if ( ! isset( $plugins['plugins'] ) ) {
+ return $request;
+ }
+ $exists = false;
+ foreach ( $plugins['plugins'] as $plugin ) {
+ if ( isset( $plugin['Name'] ) && 'Kirki Toolkit' === $plugin['Name'] ) {
+ $exists = true;
+ }
+ }
+ // Inject data.
+ if ( ! $exists && defined( 'KIRKI_PLUGIN_FILE' ) ) {
+ $plugins['plugins']['kirki/kirki.php'] = get_plugin_data( KIRKI_PLUGIN_FILE );
+ }
+ $request['body']['plugins'] = wp_json_encode( $plugins );
+ return $request;
+ }
+
+ /**
+ * Returns the $wp_version.
+ *
+ * @static
+ * @access public
+ * @since 3.0.12
+ * @param string $context Use 'minor' or 'major'.
+ * @return int|string Returns integer when getting the 'major' version.
+ * Returns string when getting the 'minor' version.
+ */
+ public static function get_wp_version( $context = 'minor' ) {
+ global $wp_version;
+
+ // We only need the major version.
+ if ( 'major' === $context ) {
+ $version_parts = explode( '.', $wp_version );
+ return $version_parts[0];
+ }
+
+ return $wp_version;
+ }
+
+ /**
+ * Returns the $wp_version, only numeric value.
+ *
+ * @static
+ * @access public
+ * @since 3.0.12
+ * @param string $context Use 'minor' or 'major'.
+ * @param bool $only_numeric Whether we wwant to return numeric value or include beta/alpha etc.
+ * @return int|float Returns integer when getting the 'major' version.
+ * Returns float when getting the 'minor' version.
+ */
+ public static function get_wp_version_numeric( $context = 'minor', $only_numeric = true ) {
+ global $wp_version;
+
+ // We only need the major version.
+ if ( 'major' === $context ) {
+ $version_parts = explode( '.', $wp_version );
+ return absint( $version_parts[0] );
+ }
+
+ // If we got this far, we want the full monty.
+ // Get the numeric part of the version without any beta, alpha etc parts.
+ if ( false !== strpos( $wp_version, '-' ) ) {
+ // We're on a dev version.
+ $version_parts = explode( '-', $wp_version );
+ return floatval( $version_parts[0] );
+ }
+ return floatval( $wp_version );
+ }
+}
diff --git a/assets/kirki/core/class-kirki-values.php b/assets/kirki/core/class-kirki-values.php
new file mode 100644
index 0000000..7e2f381
--- /dev/null
+++ b/assets/kirki/core/class-kirki-values.php
@@ -0,0 +1,156 @@
+get_config();
+ self::$config[ $config_args['id'] ] = $config_args;
+ }
+
+ /**
+ * Create a new panel.
+ *
+ * @static
+ * @access public
+ * @param string $id The ID for this panel.
+ * @param array $args The panel arguments.
+ */
+ public static function add_panel( $id = '', $args = array() ) {
+
+ $args['id'] = esc_attr( $id );
+ $args['description'] = ( isset( $args['description'] ) ) ? $args['description'] : '';
+ $args['priority'] = ( isset( $args['priority'] ) ) ? absint( $args['priority'] ) : 10;
+ $args['type'] = ( isset( $args['type'] ) ) ? $args['type'] : 'default';
+ $args['type'] = 'kirki-' . $args['type'];
+
+ self::$panels[ $args['id'] ] = $args;
+ }
+
+ /**
+ * Remove a panel.
+ *
+ * @static
+ * @access public
+ * @since 3.0.17
+ * @param string $id The ID for this panel.
+ */
+ public static function remove_panel( $id = '' ) {
+ if ( ! in_array( $id, self::$panels_to_remove, true ) ) {
+ self::$panels_to_remove[] = $id;
+ }
+ }
+
+ /**
+ * Create a new section.
+ *
+ * @static
+ * @access public
+ * @param string $id The ID for this section.
+ * @param array $args The section arguments.
+ */
+ public static function add_section( $id, $args ) {
+
+ $args['id'] = esc_attr( $id );
+ $args['panel'] = ( isset( $args['panel'] ) ) ? esc_attr( $args['panel'] ) : '';
+ $args['description'] = ( isset( $args['description'] ) ) ? $args['description'] : '';
+ $args['priority'] = ( isset( $args['priority'] ) ) ? absint( $args['priority'] ) : 10;
+ $args['type'] = ( isset( $args['type'] ) ) ? $args['type'] : 'default';
+ $args['type'] = 'kirki-' . $args['type'];
+
+ self::$sections[ $args['id'] ] = $args;
+ }
+
+ /**
+ * Remove a section.
+ *
+ * @static
+ * @access public
+ * @since 3.0.17
+ * @param string $id The ID for this panel.
+ */
+ public static function remove_section( $id = '' ) {
+ if ( ! in_array( $id, self::$sections_to_remove, true ) ) {
+ self::$sections_to_remove[] = $id;
+ }
+ }
+
+ /**
+ * Create a new field.
+ *
+ * @static
+ * @access public
+ * @param string $config_id The configuration ID for this field.
+ * @param array $args The field arguments.
+ */
+ public static function add_field( $config_id, $args ) {
+
+ if ( doing_action( 'customize_register' ) ) {
+ _doing_it_wrong( __METHOD__, esc_attr__( 'Kirki fields should not be added on customize_register. Please add them directly, or on init.', 'kirki' ), '3.0.10' );
+ }
+
+ // Early exit if 'type' is not defined.
+ if ( ! isset( $args['type'] ) ) {
+ return;
+ }
+
+ // If the field is font-awesome, enqueue the icons on the frontend.
+ if ( class_exists( 'Kirki_Modules_CSS' ) && ( 'fontawesome' === $args['type'] || 'kirki-fontawesome' === $args['type'] ) ) {
+ Kirki_Modules_CSS::add_fontawesome_script();
+ }
+
+ $str = str_replace( array( '-', '_' ), ' ', $args['type'] );
+ $classname = 'Kirki_Field_' . str_replace( ' ', '_', ucwords( $str ) );
+ if ( class_exists( $classname ) ) {
+ new $classname( $config_id, $args );
+ return;
+ }
+ if ( false !== strpos( $classname, 'Kirki_Field_Kirki_' ) ) {
+ $classname = str_replace( 'Kirki_Field_Kirki_', 'Kirki_Field_', $classname );
+ if ( class_exists( $classname ) ) {
+ new $classname( $config_id, $args );
+ return;
+ }
+ }
+
+ new Kirki_Field( $config_id, $args );
+
+ }
+
+ /**
+ * Remove a control.
+ *
+ * @static
+ * @access public
+ * @since 3.0.17
+ * @param string $id The field ID.
+ */
+ public static function remove_control( $id ) {
+ if ( ! in_array( $id, self::$controls_to_remove, true ) ) {
+ self::$controls_to_remove[] = $id;
+ }
+ }
+
+ /**
+ * Gets a parameter for a config-id.
+ *
+ * @static
+ * @access public
+ * @since 3.0.10
+ * @param string $id The config-ID.
+ * @param string $param The parameter we want.
+ * @return string
+ */
+ public static function get_config_param( $id, $param ) {
+
+ if ( ! isset( self::$config[ $id ] ) || ! isset( self::$config[ $id ][ $param ] ) ) {
+ return '';
+ }
+ return self::$config[ $id ][ $param ];
+ }
+}
diff --git a/assets/kirki/core/dynamic-css.php b/assets/kirki/core/dynamic-css.php
new file mode 100644
index 0000000..6e6f254
--- /dev/null
+++ b/assets/kirki/core/dynamic-css.php
@@ -0,0 +1,39 @@
+ $args ) {
+ if ( true === $args['disable_output'] ) {
+ continue;
+ }
+
+ $styles = Kirki_Modules_CSS::loop_controls( $config_id );
+ $styles = apply_filters( "kirki_{$config_id}_dynamic_css", $styles );
+
+ // Some people put weird stuff in their CSS, KSES tends to be greedy.
+ $styles = str_replace( '<=', '<=', $styles );
+
+ $styles = wp_kses_post( $styles );
+
+ // Why both KSES and strip_tags? Because we just added some '>'.
+ // kses replaces lone '>' with >.
+ // @codingStandardsIgnoreLine WordPress.WP.AlternativeFunctions.strip_tags_strip_tags WordPress.Security.EscapeOutput.OutputNotEscaped
+ echo strip_tags( str_replace( '>', '>', $styles ) );
+}
diff --git a/assets/kirki/deprecated/classes.php b/assets/kirki/deprecated/classes.php
new file mode 100644
index 0000000..abfd7a7
--- /dev/null
+++ b/assets/kirki/deprecated/classes.php
@@ -0,0 +1,20 @@
+= 0 ) {
+ require_once wp_normalize_path( dirname( __FILE__ ) . '/filters.php' );
+}
diff --git a/assets/kirki/deprecated/filters.php b/assets/kirki/deprecated/filters.php
new file mode 100644
index 0000000..44dadf4
--- /dev/null
+++ b/assets/kirki/deprecated/filters.php
@@ -0,0 +1,116 @@
+toCSS( \'hex\' )' );
+ return Kirki_Color::sanitize_hex( $color );
+ }
+}
+
+if ( ! function_exists( 'kirki_get_rgb' ) ) {
+ function kirki_get_rgb( $hex, $implode = false ) {
+ _deprecated_function( __FUNCTION__, '1.0.0', 'ariColor::newColor( $color )->toCSS( \'rgb\' )' );
+ return Kirki_Color::get_rgb( $hex, $implode );
+ }
+}
+
+if ( ! function_exists( 'kirki_get_rgba' ) ) {
+ function kirki_get_rgba( $hex = '#fff', $opacity = 100 ) {
+ _deprecated_function( __FUNCTION__, '1.0.0', 'ariColor::newColor( $color )->toCSS( \'rgba\' )' );
+ return Kirki_Color::get_rgba( $hex, $opacity );
+ }
+}
+
+if ( ! function_exists( 'kirki_get_brightness' ) ) {
+ function kirki_get_brightness( $hex ) {
+ _deprecated_function( __FUNCTION__, '1.0.0', 'ariColor::newColor( $color )->lightness' );
+ return Kirki_Color::get_brightness( $hex );
+ }
+}
+
+if ( ! function_exists( 'Kirki' ) ) {
+ function Kirki() {
+ return kirki();
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-background.php b/assets/kirki/field/class-kirki-field-background.php
new file mode 100644
index 0000000..1fdb504
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-background.php
@@ -0,0 +1,122 @@
+type = 'kirki-background';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = array( $this, 'sanitize' );
+
+ }
+
+ /**
+ * Sanitizes typography controls
+ *
+ * @since 2.2.0
+ * @param array $value The value.
+ * @return array
+ */
+ public function sanitize( $value ) {
+
+ if ( ! is_array( $value ) ) {
+ return array();
+ }
+ return array(
+ 'background-color' => ( isset( $value['background-color'] ) ) ? esc_attr( $value['background-color'] ) : '',
+ 'background-image' => ( isset( $value['background-image'] ) ) ? esc_url_raw( $value['background-image'] ) : '',
+ 'background-repeat' => ( isset( $value['background-repeat'] ) ) ? esc_attr( $value['background-repeat'] ) : '',
+ 'background-position' => ( isset( $value['background-position'] ) ) ? esc_attr( $value['background-position'] ) : '',
+ 'background-size' => ( isset( $value['background-size'] ) ) ? esc_attr( $value['background-size'] ) : '',
+ 'background-attachment' => ( isset( $value['background-attachment'] ) ) ? esc_attr( $value['background-attachment'] ) : '',
+ );
+ }
+
+ /**
+ * Sets the $js_vars
+ *
+ * @access protected
+ */
+ protected function set_js_vars() {
+
+ // Typecast to array.
+ $this->js_vars = (array) $this->js_vars;
+
+ // Check if transport is set to auto.
+ // If not, then skip the auto-calculations and exit early.
+ if ( 'auto' !== $this->transport ) {
+ return;
+ }
+
+ // Set transport to refresh initially.
+ // Serves as a fallback in case we failt to auto-calculate js_vars.
+ $this->transport = 'refresh';
+
+ $js_vars = array();
+
+ // Try to auto-generate js_vars.
+ // First we need to check if js_vars are empty, and that output is not empty.
+ if ( empty( $this->js_vars ) && ! empty( $this->output ) ) {
+
+ // Start going through each item in the $output array.
+ foreach ( $this->output as $output ) {
+
+ // If 'element' is not defined, skip this.
+ if ( ! isset( $output['element'] ) ) {
+ continue;
+ }
+ if ( is_array( $output['element'] ) ) {
+ $output['element'] = implode( ',', $output['element'] );
+ }
+
+ // If there's a sanitize_callback defined, skip this.
+ if ( isset( $output['sanitize_callback'] ) && ! empty( $output['sanitize_callback'] ) ) {
+ continue;
+ }
+
+ // If we got this far, it's safe to add this.
+ $js_vars[] = $output;
+ }
+
+ // Did we manage to get all the items from 'output'?
+ // If not, then we're missing something so don't add this.
+ if ( count( $js_vars ) !== count( $this->output ) ) {
+ return;
+ }
+ $this->js_vars = $js_vars;
+ $this->transport = 'postMessage';
+
+ }
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-checkbox.php b/assets/kirki/field/class-kirki-field-checkbox.php
new file mode 100644
index 0000000..9aec6c9
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-checkbox.php
@@ -0,0 +1,68 @@
+type = 'checkbox';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback.
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ if ( ! $this->sanitize_callback ) {
+ $this->sanitize_callback = array( $this, 'sanitize' );
+ }
+
+ }
+
+ /**
+ * Sanitizes checkbox values.
+ *
+ * @access public
+ * @param boolean|integer|string|null $value The checkbox value.
+ * @return bool
+ */
+ public function sanitize( $value = null ) {
+
+ if ( '0' === $value || 'false' === $value ) {
+ return false;
+ }
+
+ return (bool) $value;
+
+ }
+
+ /**
+ * Sets the default value.
+ *
+ * @access protected
+ */
+ protected function set_default() {
+
+ $this->default = (bool) ( 1 === $this->default || '1' === $this->default || true === $this->default || 'true' === $this->default || 'on' === $this->default );
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-code.php b/assets/kirki/field/class-kirki-field-code.php
new file mode 100644
index 0000000..8940728
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-code.php
@@ -0,0 +1,119 @@
+ 'kirki-code editor-keyboard-trap-help-1 editor-keyboard-trap-help-2 editor-keyboard-trap-help-3 editor-keyboard-trap-help-4',
+ );
+
+ /**
+ * Sets the control type.
+ *
+ * @access protected
+ */
+ protected function set_type() {
+ $this->type = 'code_editor';
+ }
+
+ /**
+ * Sets the $choices
+ *
+ * @access protected
+ */
+ protected function set_choices() {
+ if ( ! isset( $this->choices['language'] ) ) {
+ return;
+ }
+ $language = $this->choices['language'];
+ switch ( $language ) {
+ case 'json':
+ case 'xml':
+ $language = 'application/' . $language;
+ break;
+ case 'http':
+ $language = 'message/' . $language;
+ break;
+ case 'js':
+ case 'javascript':
+ $language = 'text/javascript';
+ break;
+ case 'txt':
+ $language = 'text/plain';
+ break;
+ case 'css':
+ case 'jsx':
+ case 'html':
+ $language = 'text/' . $language;
+ break;
+ default:
+ $language = ( 'js' === $language ) ? 'javascript' : $language;
+ $language = ( 'htm' === $language ) ? 'html' : $language;
+ $language = ( 'yml' === $language ) ? 'yaml' : $language;
+ $language = 'text/x-' . $language;
+ break;
+ }
+ if ( ! isset( $this->editor_settings['codemirror'] ) ) {
+ $this->editor_settings['codemirror'] = array();
+ }
+ if ( ! isset( $this->editor_settings['codemirror']['mode'] ) ) {
+ $this->editor_settings['codemirror']['mode'] = $language;
+ }
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ // Code fields must NOT be filtered. Their values usually contain CSS/JS.
+ // It is the responsibility of the theme/plugin that registers this field
+ // to properly apply any necessary filtering.
+ $this->sanitize_callback = array( 'Kirki_Sanitize_Values', 'unfiltered' );
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-color-alpha.php b/assets/kirki/field/class-kirki-field-color-alpha.php
new file mode 100644
index 0000000..1883014
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-color-alpha.php
@@ -0,0 +1,30 @@
+choices ) ) {
+ $this->choices = array();
+ }
+ $this->choices['alpha'] = true;
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-color-palette.php b/assets/kirki/field/class-kirki-field-color-palette.php
new file mode 100644
index 0000000..4f11998
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-color-palette.php
@@ -0,0 +1,27 @@
+type = 'kirki-color-palette';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-color.php b/assets/kirki/field/class-kirki-field-color.php
new file mode 100644
index 0000000..9d6f2f8
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-color.php
@@ -0,0 +1,89 @@
+type = 'kirki-color';
+
+ }
+
+ /**
+ * Sets the $choices
+ *
+ * @access protected
+ */
+ protected function set_choices() {
+
+ if ( ! is_array( $this->choices ) ) {
+ $this->choices = array();
+ }
+ if ( true === $this->alpha ) {
+ _doing_it_wrong( 'Kirki::add_field', esc_attr__( 'Do not use "alpha" as an argument in color controls. Use "choices[alpha]" instead.', 'kirki' ), '3.0.10' );
+ $this->choices['alpha'] = true;
+ }
+ if ( ! isset( $this->choices['alpha'] ) || true !== $this->choices['alpha'] ) {
+ $this->choices['alpha'] = true;
+ if ( property_exists( $this, 'default' ) && ! empty( $this->default ) && false === strpos( 'rgba', $this->default ) ) {
+ $this->choices['alpha'] = false;
+ }
+ }
+
+ if ( ( ! isset( $this->choices['mode'] ) ) || ( 'hex' !== $this->choices['mode'] || 'hue' !== $this->choices['mode'] ) ) {
+ $this->choices['mode'] = 'hex';
+ }
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ if ( 'hue' === $this->mode ) {
+ $this->sanitize_callback = 'absint';
+ return;
+ }
+ $this->sanitize_callback = array( 'Kirki_Sanitize_Values', 'color' );
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-custom.php b/assets/kirki/field/class-kirki-field-custom.php
new file mode 100644
index 0000000..3b02890
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-custom.php
@@ -0,0 +1,45 @@
+type = 'kirki-custom';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ // Custom fields don't actually save any value.
+ // just use __return_true.
+ $this->sanitize_callback = '__return_true';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-dashicons.php b/assets/kirki/field/class-kirki-field-dashicons.php
new file mode 100644
index 0000000..6fb1eff
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-dashicons.php
@@ -0,0 +1,42 @@
+type = 'kirki-dashicons';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = 'esc_attr';
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-date.php b/assets/kirki/field/class-kirki-field-date.php
new file mode 100644
index 0000000..6a8066b
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-date.php
@@ -0,0 +1,43 @@
+type = 'kirki-date';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = 'esc_textarea';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-dimension.php b/assets/kirki/field/class-kirki-field-dimension.php
new file mode 100644
index 0000000..ec2bae3
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-dimension.php
@@ -0,0 +1,38 @@
+type = 'kirki-dimension';
+
+ }
+
+ /**
+ * Sanitizes the value.
+ *
+ * @access public
+ * @param string $value The value.
+ * @return string
+ */
+ public function sanitize( $value ) {
+ return sanitize_text_field( $value );
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-dimensions.php b/assets/kirki/field/class-kirki-field-dimensions.php
new file mode 100644
index 0000000..2e42664
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-dimensions.php
@@ -0,0 +1,76 @@
+type = 'kirki-dimensions';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback.
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = array( $this, 'sanitize' );
+
+ }
+
+ /**
+ * Sanitizes the value.
+ *
+ * @access public
+ * @param array $value The value.
+ * @return array
+ */
+ public function sanitize( $value ) {
+
+ // Sanitize each sub-value separately.
+ foreach ( $value as $key => $sub_value ) {
+ $value[ $key ] = sanitize_text_field( $sub_value );
+ }
+ return $value;
+
+ }
+
+ /**
+ * Set the choices.
+ * Adds a pseudo-element "controls" that helps with the JS API.
+ *
+ * @access protected
+ */
+ protected function set_choices() {
+
+ $this->choices['controls'] = array();
+ if ( is_array( $this->default ) ) {
+ foreach ( $this->default as $key => $value ) {
+ $this->choices['controls'][ $key ] = true;
+ }
+ }
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-editor.php b/assets/kirki/field/class-kirki-field-editor.php
new file mode 100644
index 0000000..41cb49f
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-editor.php
@@ -0,0 +1,54 @@
+= 0 ) {
+ $this->type = 'kirki-editor';
+ return;
+ }
+ // Fallback for older WordPress versions.
+ $this->type = 'kirki-generic';
+ if ( ! is_array( $this->choices ) ) {
+ $this->choices = array();
+ }
+ $this->choices['element'] = 'textarea';
+ $this->choices['rows'] = '5';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = 'wp_kses_post';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-fontawesome.php b/assets/kirki/field/class-kirki-field-fontawesome.php
new file mode 100644
index 0000000..506d420
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-fontawesome.php
@@ -0,0 +1,43 @@
+type = 'kirki-fontawesome';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = 'esc_attr';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-generic.php b/assets/kirki/field/class-kirki-field-generic.php
new file mode 100644
index 0000000..8e7d85d
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-generic.php
@@ -0,0 +1,15 @@
+type = 'kirki-image';
+
+ }
+
+ /**
+ * Sets the button labels.
+ *
+ * @access protected
+ * @since 3.0.23
+ * @return void
+ */
+ protected function set_button_labels() {
+ $this->button_labels = wp_parse_args(
+ $this->button_labels,
+ array(
+ 'select' => esc_attr__( 'Select image', 'kirki' ),
+ 'change' => esc_attr__( 'Change image', 'kirki' ),
+ 'default' => esc_attr__( 'Default', 'kirki' ),
+ 'remove' => esc_attr__( 'Remove', 'kirki' ),
+ 'placeholder' => esc_attr__( 'No image selected', 'kirki' ),
+ 'frame_title' => esc_attr__( 'Select image', 'kirki' ),
+ 'frame_button' => esc_attr__( 'Choose image', 'kirki' ),
+ )
+ );
+ }
+
+ /**
+ * Set the choices.
+ * Adds a pseudo-element "controls" that helps with the JS API.
+ *
+ * @access protected
+ */
+ protected function set_choices() {
+
+ if ( ! is_array( $this->choices ) ) {
+ $this->choices = (array) $this->choices;
+ }
+ if ( ! isset( $this->choices['save_as'] ) ) {
+ $this->choices['save_as'] = 'url';
+ }
+ if ( ! isset( $this->choices['labels'] ) ) {
+ $this->choices['labels'] = array();
+ }
+ $this->set_button_labels();
+ $this->choices['labels'] = wp_parse_args( $this->choices['labels'], $this->button_labels );
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = array( $this, 'sanitize' );
+
+ }
+
+ /**
+ * The sanitize method that will be used as a falback
+ *
+ * @param string|array $value The control's value.
+ */
+ public function sanitize( $value ) {
+
+ if ( isset( $this->choices['save_as'] ) && 'array' === $this->choices['save_as'] ) {
+ return array(
+ 'id' => ( isset( $value['id'] ) && '' !== $value['id'] ) ? (int) $value['id'] : '',
+ 'url' => ( isset( $value['url'] ) && '' !== $value['url'] ) ? esc_url_raw( $value['url'] ) : '',
+ 'width' => ( isset( $value['width'] ) && '' !== $value['width'] ) ? (int) $value['width'] : '',
+ 'height' => ( isset( $value['height'] ) && '' !== $value['height'] ) ? (int) $value['height'] : '',
+ );
+ }
+ if ( isset( $this->choices['save_as'] ) && 'id' === $this->choices['save_as'] ) {
+ return absint( $value );
+ }
+ if ( is_string( $value ) ) {
+ return esc_url_raw( $value );
+ }
+ return $value;
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-kirki-generic.php b/assets/kirki/field/class-kirki-field-kirki-generic.php
new file mode 100644
index 0000000..87c44de
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-kirki-generic.php
@@ -0,0 +1,60 @@
+type = 'kirki-generic';
+
+ }
+
+
+ /**
+ * Sets the $choices
+ *
+ * @access protected
+ */
+ protected function set_choices() {
+
+ if ( ! is_array( $this->choices ) ) {
+ $this->choices = array();
+ }
+ if ( ! isset( $this->choices['element'] ) ) {
+ $this->choices['element'] = 'input';
+ }
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = 'wp_kses_post';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-link.php b/assets/kirki/field/class-kirki-field-link.php
new file mode 100644
index 0000000..65c807e
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-link.php
@@ -0,0 +1,15 @@
+type = 'kirki-multicheck';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = array( $this, 'sanitize' );
+
+ }
+
+ /**
+ * The sanitize method that will be used as a falback
+ *
+ * @param string|array $value The control's value.
+ */
+ public function sanitize( $value ) {
+
+ $value = ( ! is_array( $value ) ) ? explode( ',', $value ) : $value;
+ return ( ! empty( $value ) ) ? array_map( 'sanitize_text_field', $value ) : array();
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-multicolor.php b/assets/kirki/field/class-kirki-field-multicolor.php
new file mode 100644
index 0000000..cb2df8f
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-multicolor.php
@@ -0,0 +1,69 @@
+type = 'kirki-multicolor';
+
+ }
+
+ /**
+ * Sets the $choices
+ *
+ * @access protected
+ */
+ protected function set_choices() {
+
+ // Make sure choices are defined as an array.
+ if ( ! is_array( $this->choices ) ) {
+ $this->choices = array();
+ }
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = array( $this, 'sanitize' );
+
+ }
+
+ /**
+ * The method that will be used as a `sanitize_callback`.
+ *
+ * @param array $value The value to be sanitized.
+ * @return array The value.
+ */
+ public function sanitize( $value ) {
+
+ return $value;
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-number.php b/assets/kirki/field/class-kirki-field-number.php
new file mode 100644
index 0000000..5f357ec
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-number.php
@@ -0,0 +1,85 @@
+type = 'kirki-number';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ $this->sanitize_callback = array( $this, 'sanitize' );
+
+ }
+
+ /**
+ * Sets the $choices
+ *
+ * @access protected
+ */
+ protected function set_choices() {
+
+ $this->choices = wp_parse_args(
+ $this->choices,
+ array(
+ 'min' => -999999999,
+ 'max' => 999999999,
+ 'step' => 1,
+ )
+ );
+ // Make sure min, max & step are all numeric.
+ $this->choices['min'] = filter_var( $this->choices['min'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
+ $this->choices['max'] = filter_var( $this->choices['max'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
+ $this->choices['step'] = filter_var( $this->choices['step'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
+ }
+
+ /**
+ * Sanitizes numeric values.
+ *
+ * @access public
+ * @param integer|string $value The checkbox value.
+ * @return bool
+ */
+ public function sanitize( $value = 0 ) {
+
+ $this->set_choices();
+
+ $value = filter_var( $value, FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
+
+ // Minimum & maximum value limits.
+ if ( $value < $this->choices['min'] || $value > $this->choices['max'] ) {
+ return max( min( $value, $this->choices['max'] ), $this->choices['min'] );
+ }
+
+ // Only multiple of steps.
+ $steps = ( $value - $this->choices['min'] ) / $this->choices['step'];
+ if ( ! is_int( $steps ) ) {
+ $value = $this->choices['min'] + ( round( $steps ) * $this->choices['step'] );
+ }
+ return $value;
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-palette.php b/assets/kirki/field/class-kirki-field-palette.php
new file mode 100644
index 0000000..474480b
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-palette.php
@@ -0,0 +1,27 @@
+type = 'kirki-palette';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-preset.php b/assets/kirki/field/class-kirki-field-preset.php
new file mode 100644
index 0000000..9e649da
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-preset.php
@@ -0,0 +1,44 @@
+type = 'kirki-select';
+
+ }
+
+ /**
+ * Set the preset.
+ *
+ * @access protected
+ * @since 3.0.28
+ */
+ protected function set_preset() {
+
+ // Set preset from the choices.
+ $this->preset = $this->choices;
+
+ // We're using a flat select.
+ foreach ( $this->choices as $key => $args ) {
+ $this->choices[ $key ] = $args['label'];
+ }
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-radio-buttonset.php b/assets/kirki/field/class-kirki-field-radio-buttonset.php
new file mode 100644
index 0000000..566ab18
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-radio-buttonset.php
@@ -0,0 +1,27 @@
+type = 'kirki-radio-buttonset';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-radio-image.php b/assets/kirki/field/class-kirki-field-radio-image.php
new file mode 100644
index 0000000..5bf40f5
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-radio-image.php
@@ -0,0 +1,27 @@
+type = 'kirki-radio-image';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-radio.php b/assets/kirki/field/class-kirki-field-radio.php
new file mode 100644
index 0000000..2f415ea
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-radio.php
@@ -0,0 +1,58 @@
+type = 'kirki-radio';
+ // Tweaks for backwards-compatibility:
+ // Prior to version 0.8 radio-buttonset & radio-image were part of the radio control.
+ if ( in_array( $this->mode, array( 'buttonset', 'image' ), true ) ) {
+ /* translators: %1$s represents the field ID where the error occurs. %2%s is buttonset/image. */
+ _doing_it_wrong( __METHOD__, sprintf( esc_attr__( 'Error in field %1$s. The "mode" argument has been deprecated since Kirki v0.8. Use the "radio-%2$s" type instead.', 'kirki' ), esc_attr( $this->settings ), esc_attr( $this->mode ) ), '3.0.10' );
+ $this->type = 'radio-' . $this->mode;
+ }
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = 'esc_attr';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-repeater.php b/assets/kirki/field/class-kirki-field-repeater.php
new file mode 100644
index 0000000..057e4ef
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-repeater.php
@@ -0,0 +1,175 @@
+type = 'repeater';
+
+ }
+
+ /**
+ * Sets the $transport
+ *
+ * @access protected
+ */
+ protected function set_transport() {
+
+ // Force using refresh mode.
+ // Currently the repeater control does not support postMessage.
+ $this->transport = 'refresh';
+
+ }
+
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = array( $this, 'sanitize' );
+
+ }
+
+ /**
+ * The sanitize method that will be used as a falback
+ *
+ * @param string|array $value The control's value.
+ */
+ public function sanitize( $value ) {
+
+ // is the value formatted as a string?
+ if ( is_string( $value ) ) {
+ $value = rawurldecode( $value );
+ $value = json_decode( $value, true );
+ }
+
+ // Nothing to sanitize if we don't have fields.
+ if ( empty( $this->fields ) ) {
+ return $value;
+ }
+
+ foreach ( $value as $row_id => $row_value ) {
+
+ // Make sure the row is formatted as an array.
+ if ( ! is_array( $row_value ) ) {
+ $value[ $row_id ] = array();
+ continue;
+ }
+ // Start parsing sub-fields in rows.
+ foreach ( $row_value as $subfield_id => $subfield_value ) {
+ // Make sure this is a valid subfield.
+ // If it's not, then unset it.
+ if ( ! isset( $this->fields[ $subfield_id ] ) ) {
+ unset( $value[ $row_id ][ $subfield_id ] );
+ }
+ // Get the subfield-type.
+ if ( ! isset( $this->fields[ $subfield_id ]['type'] ) ) {
+ continue;
+ }
+ $subfield_type = $this->fields[ $subfield_id ]['type'];
+
+ // Allow using a sanitize-callback on a per-field basis.
+ if ( isset( $this->fields[ $subfield_id ]['sanitize_callback'] ) ) {
+
+ $subfield_value = call_user_func( $this->fields[ $subfield_id ]['sanitize_callback'], $subfield_value );
+
+ } else {
+
+ switch ( $subfield_type ) {
+ case 'image':
+ case 'cropped_image':
+ case 'upload':
+ if ( ! is_numeric( $subfield_value ) && is_string( $subfield_value ) ) {
+ $subfield_value = esc_url_raw( $subfield_value );
+ }
+ break;
+ case 'dropdown-pages':
+ $subfield_value = (int) $subfield_value;
+ break;
+ case 'color':
+ // Instantiate the object.
+ $color_obj = ariColor::newColor( $subfield_value );
+ $$subfield_value = $color_obj->toCSS( $color_obj->mode );
+ break;
+ case 'text':
+ $subfield_value = sanitize_text_field( $subfield_value );
+ break;
+ case 'url':
+ case 'link':
+ $subfield_value = esc_url_raw( $subfield_value );
+ break;
+ case 'email':
+ $subfield_value = filter_var( $subfield_value, FILTER_SANITIZE_EMAIL );
+ break;
+ case 'tel':
+ $subfield_value = esc_attr( $subfield_value );
+ break;
+ case 'checkbox':
+ $subfield_value = (bool) $subfield_value;
+ break;
+ case 'select':
+ if ( isset( $this->fields[ $subfield_id ]['multiple'] ) ) {
+ if ( true === $this->fields[ $subfield_id ]['multiple'] ) {
+ $multiple = 2;
+ }
+ $multiple = (int) $this->fields[ $subfield_id ]['multiple'];
+ if ( 1 < $multiple ) {
+ $subfield_value = (array) $subfield_value;
+ foreach ( $subfield_value as $sub_subfield_key => $sub_subfield_value ) {
+ $subfield_value[ $sub_subfield_key ] = esc_attr( $sub_subfield_value );
+ }
+ } else {
+ $subfield_value = esc_attr( $subfield_value );
+ }
+ }
+ break;
+ case 'radio':
+ case 'radio-image':
+ $subfield_value = esc_attr( $subfield_value );
+ break;
+ case 'textarea':
+ $subfield_value = html_entity_decode( wp_kses_post( $subfield_value ) );
+
+ }
+ }
+ $value[ $row_id ][ $subfield_id ] = $subfield_value;
+ }
+ }
+
+ return $value;
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-select.php b/assets/kirki/field/class-kirki-field-select.php
new file mode 100644
index 0000000..829a25b
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-select.php
@@ -0,0 +1,118 @@
+ 1, then the maximum number of selectable options
+ * is the number defined here.
+ *
+ * @access protected
+ * @var integer
+ */
+ protected $multiple = 1;
+
+ /**
+ * Placeholder text.
+ *
+ * @access protected
+ * @since 3.0.21
+ * @var string|false
+ */
+ protected $placeholder = false;
+
+ /**
+ * Sets the control type.
+ *
+ * @access protected
+ */
+ protected function set_type() {
+
+ $this->type = 'kirki-select';
+
+ }
+
+ /**
+ * Sets the $multiple
+ *
+ * @access protected
+ */
+ protected function set_multiple() {
+ $this->multiple = absint( $this->multiple );
+ }
+
+ /**
+ * The placeholder text.
+ *
+ * @access protected
+ * @since 3.0.21
+ */
+ protected function set_placeholder() {
+ $this->placeholder = esc_attr( $this->placeholder );
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = array( $this, 'sanitize' );
+
+ }
+
+ /**
+ * Sanitizes select control values.
+ *
+ * @since 2.2.8
+ * @access public
+ * @param array $value The value.
+ * @return string|array
+ */
+ public function sanitize( $value ) {
+
+ if ( is_array( $value ) ) {
+ foreach ( $value as $key => $subvalue ) {
+ if ( '' !== $subvalue || isset( $this->choices[''] ) ) {
+ $key = sanitize_key( $key );
+ $value[ $key ] = esc_attr( $subvalue );
+ }
+ }
+ return $value;
+ }
+ return esc_attr( $value );
+
+ }
+
+ /**
+ * Sets the default value.
+ *
+ * @access protected
+ * @since 3.0.0
+ */
+ protected function set_default() {
+
+ if ( 1 < $this->multiple && ! is_array( $this->default ) ) {
+ $this->default = array( $this->default );
+ }
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-select2-multiple.php b/assets/kirki/field/class-kirki-field-select2-multiple.php
new file mode 100644
index 0000000..5a719be
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-select2-multiple.php
@@ -0,0 +1,29 @@
+multiple = 999;
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-select2.php b/assets/kirki/field/class-kirki-field-select2.php
new file mode 100644
index 0000000..989d600
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-select2.php
@@ -0,0 +1,17 @@
+type = 'kirki-slider';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-sortable.php b/assets/kirki/field/class-kirki-field-sortable.php
new file mode 100644
index 0000000..9441a76
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-sortable.php
@@ -0,0 +1,62 @@
+type = 'kirki-sortable';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback.
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ $this->sanitize_callback = array( $this, 'sanitize' );
+
+ }
+
+ /**
+ * Sanitizes sortable values.
+ *
+ * @access public
+ * @param array $value The checkbox value.
+ * @return array
+ */
+ public function sanitize( $value = array() ) {
+
+ if ( is_string( $value ) || is_numeric( $value ) ) {
+ return array(
+ esc_attr( $value ),
+ );
+ }
+ $sanitized_value = array();
+ foreach ( $value as $sub_value ) {
+ if ( isset( $this->choices[ $sub_value ] ) ) {
+ $sanitized_value[] = esc_attr( $sub_value );
+ }
+ }
+ return $sanitized_value;
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-spacing.php b/assets/kirki/field/class-kirki-field-spacing.php
new file mode 100644
index 0000000..1478847
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-spacing.php
@@ -0,0 +1,43 @@
+ array(
+ 'top' => ( isset( $this->default['top'] ) ),
+ 'bottom' => ( isset( $this->default['top'] ) ),
+ 'left' => ( isset( $this->default['top'] ) ),
+ 'right' => ( isset( $this->default['top'] ) ),
+ ),
+ 'labels' => array(
+ 'top' => esc_attr__( 'Top', 'kirki' ),
+ 'bottom' => esc_attr__( 'Bottom', 'kirki' ),
+ 'left' => esc_attr__( 'Left', 'kirki' ),
+ 'right' => esc_attr__( 'Right', 'kirki' ),
+ ),
+ );
+
+ $this->choices = wp_parse_args( $this->choices, $default_args );
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-switch.php b/assets/kirki/field/class-kirki-field-switch.php
new file mode 100644
index 0000000..7642cba
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-switch.php
@@ -0,0 +1,48 @@
+type = 'kirki-switch';
+
+ }
+
+ /**
+ * Sets the control choices.
+ *
+ * @access protected
+ */
+ protected function set_choices() {
+
+ if ( ! is_array( $this->choices ) ) {
+ $this->choices = array();
+ }
+
+ $this->choices = wp_parse_args(
+ $this->choices,
+ array(
+ 'on' => esc_attr__( 'On', 'kirki' ),
+ 'off' => esc_attr__( 'Off', 'kirki' ),
+ 'round' => false,
+ )
+ );
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-text.php b/assets/kirki/field/class-kirki-field-text.php
new file mode 100644
index 0000000..ce5740a
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-text.php
@@ -0,0 +1,47 @@
+choices ) ) {
+ $this->choices = array();
+ }
+ $this->choices['element'] = 'input';
+ $this->choices['type'] = 'text';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = 'esc_textarea';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-textarea.php b/assets/kirki/field/class-kirki-field-textarea.php
new file mode 100644
index 0000000..52868a9
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-textarea.php
@@ -0,0 +1,29 @@
+choices = array(
+ 'element' => 'textarea',
+ 'rows' => 5,
+ );
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-toggle.php b/assets/kirki/field/class-kirki-field-toggle.php
new file mode 100644
index 0000000..7d1a4c8
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-toggle.php
@@ -0,0 +1,27 @@
+type = 'kirki-toggle';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-typography.php b/assets/kirki/field/class-kirki-field-typography.php
new file mode 100644
index 0000000..ad692b6
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-typography.php
@@ -0,0 +1,222 @@
+type = 'kirki-typography';
+
+ }
+
+ /**
+ * The class constructor.
+ * Parses and sanitizes all field arguments.
+ * Then it adds the field to Kirki::$fields.
+ *
+ * @access public
+ * @param string $config_id The ID of the config we want to use.
+ * Defaults to "global".
+ * Configs are handled by the Kirki_Config class.
+ * @param array $args The arguments of the field.
+ */
+ public function __construct( $config_id = 'global', $args = array() ) {
+ parent::__construct( $config_id, $args );
+ $this->set_default();
+ }
+
+ /**
+ * Sets the default value.
+ *
+ * @access protected
+ */
+ protected function set_default() {
+
+ // Accomodate the use of font-weight and convert to variant.
+ if ( isset( $this->default['font-weight'] ) ) {
+ $this->default['variant'] = ( 'regular' === $this->default['font-weight'] ) ? 400 : (string) intval( $this->default['font-weight'] );
+ }
+
+ // Make sure letter-spacing has units.
+ if ( isset( $this->default['letter-spacing'] ) && is_numeric( $this->default['letter-spacing'] ) && $this->default['letter-spacing'] ) {
+ $this->default['letter-spacing'] .= 'px';
+ }
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = array( __CLASS__, 'sanitize' );
+
+ }
+
+ /**
+ * Sets the $js_vars
+ *
+ * @access protected
+ */
+ protected function set_js_vars() {
+
+ if ( ! is_array( $this->js_vars ) ) {
+ $this->js_vars = array();
+ }
+
+ // Check if transport is set to auto.
+ // If not, then skip the auto-calculations and exit early.
+ if ( 'auto' !== $this->transport ) {
+ return;
+ }
+
+ // Set transport to refresh initially.
+ // Serves as a fallback in case we failt to auto-calculate js_vars.
+ $this->transport = 'refresh';
+
+ $js_vars = array();
+
+ // Try to auto-generate js_vars.
+ // First we need to check if js_vars are empty, and that output is not empty.
+ if ( ! empty( $this->output ) ) {
+
+ // Start going through each item in the $output array.
+ foreach ( $this->output as $output ) {
+
+ // If 'element' or 'property' are not defined, skip this.
+ if ( ! isset( $output['element'] ) ) {
+ continue;
+ }
+ if ( is_array( $output['element'] ) ) {
+ $output['element'] = implode( ',', $output['element'] );
+ }
+
+ // If we got this far, it's safe to add this.
+ $js_vars[] = $output;
+ }
+
+ // Did we manage to get all the items from 'output'?
+ // If not, then we're missing something so don't add this.
+ if ( count( $js_vars ) !== count( $this->output ) ) {
+ return;
+ }
+ $this->js_vars = $js_vars;
+ $this->transport = 'postMessage';
+
+ }
+
+ }
+
+ /**
+ * Sanitizes typography controls
+ *
+ * @static
+ * @since 2.2.0
+ * @param array $value The value.
+ * @return array
+ */
+ public static function sanitize( $value ) {
+
+ if ( ! is_array( $value ) ) {
+ return array();
+ }
+
+ foreach ( $value as $key => $val ) {
+ switch ( $key ) {
+ case 'font-family':
+ $value['font-family'] = esc_attr( $val );
+ break;
+ case 'font-weight':
+ if ( isset( $value['variant'] ) ) {
+ break;
+ }
+ $value['variant'] = $val;
+ if ( isset( $value['font-style'] ) && 'italic' === $value['font-style'] ) {
+ $value['variant'] = ( '400' !== $val || 400 !== $val ) ? $value['variant'] . 'italic' : 'italic';
+ }
+ break;
+ case 'variant':
+ // Use 'regular' instead of 400 for font-variant.
+ $value['variant'] = ( 400 === $val || '400' === $val ) ? 'regular' : $val;
+ // Get font-weight from variant.
+ $value['font-weight'] = filter_var( $value['variant'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION );
+ $value['font-weight'] = ( 'regular' === $value['variant'] || 'italic' === $value['variant'] ) ? 400 : absint( $value['font-weight'] );
+ // Get font-style from variant.
+ if ( ! isset( $value['font-style'] ) ) {
+ $value['font-style'] = ( false === strpos( $value['variant'], 'italic' ) ) ? 'normal' : 'italic';
+ }
+ break;
+ case 'font-size':
+ case 'letter-spacing':
+ case 'word-spacing':
+ case 'line-height':
+ $value[ $key ] = '' === trim( $value[ $key ] ) ? '' : sanitize_text_field( $val );
+ break;
+ case 'text-align':
+ if ( ! in_array( $val, array( '', 'inherit', 'left', 'center', 'right', 'justify' ), true ) ) {
+ $value['text-align'] = '';
+ }
+ break;
+ case 'text-transform':
+ if ( ! in_array( $val, array( '', 'none', 'capitalize', 'uppercase', 'lowercase', 'initial', 'inherit' ), true ) ) {
+ $value['text-transform'] = '';
+ }
+ break;
+ case 'text-decoration':
+ if ( ! in_array( $val, array( '', 'none', 'underline', 'overline', 'line-through', 'initial', 'inherit' ), true ) ) {
+ $value['text-transform'] = '';
+ }
+ break;
+ case 'color':
+ $value['color'] = '' === $value['color'] ? '' : ariColor::newColor( $val )->toCSS( 'hex' );
+ break;
+ }
+ }
+
+ return $value;
+ }
+
+ /**
+ * Sets the $choices
+ *
+ * @access protected
+ * @since 3.0.0
+ */
+ protected function set_choices() {
+
+ if ( ! is_array( $this->choices ) ) {
+ $this->choices = array();
+ }
+ $this->choices = wp_parse_args(
+ $this->choices, array(
+ 'variant' => array(),
+ 'fonts' => array(
+ 'standard' => array(),
+ 'google' => array(),
+ ),
+ )
+ );
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-upload.php b/assets/kirki/field/class-kirki-field-upload.php
new file mode 100644
index 0000000..8723086
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-upload.php
@@ -0,0 +1,43 @@
+type = 'upload';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = 'esc_url_raw';
+
+ }
+}
diff --git a/assets/kirki/field/class-kirki-field-url.php b/assets/kirki/field/class-kirki-field-url.php
new file mode 100644
index 0000000..889bbc2
--- /dev/null
+++ b/assets/kirki/field/class-kirki-field-url.php
@@ -0,0 +1,47 @@
+choices ) ) {
+ $this->choices = array();
+ }
+ $this->choices['element'] = 'input';
+ $this->choices['type'] = 'text';
+
+ }
+
+ /**
+ * Sets the $sanitize_callback
+ *
+ * @access protected
+ */
+ protected function set_sanitize_callback() {
+
+ // If a custom sanitize_callback has been defined,
+ // then we don't need to proceed any further.
+ if ( ! empty( $this->sanitize_callback ) ) {
+ return;
+ }
+ $this->sanitize_callback = 'esc_url_raw';
+
+ }
+}
diff --git a/assets/kirki/kirki.php b/assets/kirki/kirki.php
new file mode 100644
index 0000000..909d4d2
--- /dev/null
+++ b/assets/kirki/kirki.php
@@ -0,0 +1,106 @@
+modules = new Kirki_Modules();
+
+Kirki::$url = plugins_url( '', __FILE__ );
+
+// Instantiate classes.
+new Kirki();
+new Kirki_L10n();
+
+// Include deprecated functions & methods.
+require_once wp_normalize_path( dirname( __FILE__ ) . '/deprecated/deprecated.php' );
+
+// Include the ariColor library.
+require_once wp_normalize_path( dirname( __FILE__ ) . '/lib/class-aricolor.php' );
+
+// Add an empty config for global fields.
+Kirki::add_config( '' );
+
+$custom_config_path = dirname( __FILE__ ) . '/custom-config.php';
+$custom_config_path = wp_normalize_path( $custom_config_path );
+if ( file_exists( $custom_config_path ) ) {
+ require_once $custom_config_path;
+}
+
+// Add upgrade notifications.
+require_once wp_normalize_path( dirname( __FILE__ ) . '/upgrade-notifications.php' );
+
+/**
+ * To enable tests, add this line to your wp-config.php file (or anywhere alse):
+ * define( 'KIRKI_TEST', true );
+ *
+ * Please note that the example.php file is not included in the wordpress.org distribution
+ * and will only be included in dev versions of the plugin in the github repository.
+ */
+if ( defined( 'KIRKI_TEST' ) && true === KIRKI_TEST && file_exists( dirname( __FILE__ ) . '/example.php' ) ) {
+ include_once dirname( __FILE__ ) . '/example.php';
+}
diff --git a/assets/kirki/lib/class-aricolor.php b/assets/kirki/lib/class-aricolor.php
new file mode 100644
index 0000000..714fa57
--- /dev/null
+++ b/assets/kirki/lib/class-aricolor.php
@@ -0,0 +1,982 @@
+color = $color;
+
+ if ( is_array( $color ) && isset( $color['fallback'] ) ) {
+ $this->fallback = $color['fallback'];
+ $this->fallback_obj = self::newColor( $this->fallback );
+ }
+
+ if ( ! method_exists( $this, 'from_' . $mode ) ) {
+ $mode = $this->get_mode( $color );
+ }
+
+ $this->mode = $mode;
+
+ if ( ! $mode ) {
+ return;
+ }
+
+ $this->mode = $mode;
+ $method = 'from_' . $mode;
+ // Call the from_{$color_mode} method.
+ $this->$method();
+ }
+
+ /**
+ * Gets an instance for this color.
+ * We use a separate instance per color
+ * because there's no need to create a completely new instance each time we call this class.
+ * Instead using instances helps us improve performance & footprint.
+ *
+ * @static
+ * @access public
+ * @since 1.0.0
+ * @param string|array $color The color.
+ * @param string $mode Mode to be used.
+ * @return ariColor (object)
+ */
+ public static function newColor( $color, $mode = 'auto' ) {
+
+ // Get an md5 for this color.
+ $color_md5 = ( is_array( $color ) ) ? md5( wp_json_encode( $color ) . $mode ) : md5( $color . $mode );
+ // Set the instance if it does not already exist.
+ if ( ! isset( self::$instances[ $color_md5 ] ) ) {
+ self::$instances[ $color_md5 ] = new self( $color, $mode );
+ }
+ return self::$instances[ $color_md5 ];
+ }
+
+ /**
+ * Alias of the newColor method.
+ *
+ * @static
+ * @access public
+ * @since 1.1
+ * @param string|array $color The color.
+ * @param string $mode Mode to be used.
+ * @return ariColor (object)
+ */
+ public static function new_color( $color, $mode = 'auto' ) {
+ return self::newColor( $color, $mode );
+ }
+
+ /**
+ * Allows us to get a new instance by modifying a property of the existing one.
+ *
+ * @access public
+ * @since 1.0.0
+ * @param string $property Can be one of the following:
+ * red,
+ * green,
+ * blue,
+ * alpha,
+ * hue,
+ * saturation,
+ * lightness,
+ * brightness.
+ * @param int|float|string $value The new value.
+ * @return ariColor|null
+ */
+ public function getNew( $property = '', $value = '' ) {
+
+ if ( in_array( $property, array( 'red', 'green', 'blue', 'alpha' ), true ) ) {
+ // Check if we're changing any of the rgba values.
+ $value = max( 0, min( 255, $value ) );
+ if ( 'red' === $property ) {
+ return self::new_color( 'rgba(' . $value . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')', 'rgba' );
+ } elseif ( 'green' === $property ) {
+ return self::new_color( 'rgba(' . $this->red . ',' . $value . ',' . $this->blue . ',' . $this->alpha . ')', 'rgba' );
+ } elseif ( 'blue' === $property ) {
+ return self::new_color( 'rgba(' . $this->red . ',' . $this->green . ',' . $value . ',' . $this->alpha . ')', 'rgba' );
+ } elseif ( 'alpha' === $property ) {
+ return self::new_color( 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $value . ')', 'rgba' );
+ }
+ } elseif ( in_array( $property, array( 'hue', 'saturation', 'lightness' ), true ) ) {
+ // Check if we're changing any of the hsl values.
+ $value = ( 'hue' === $property ) ? max( 0, min( 360, $value ) ) : max( 0, min( 100, $value ) );
+
+ if ( 'hue' === $property ) {
+ return self::new_color( 'hsla(' . $value . ',' . $this->saturation . '%,' . $this->lightness . '%,' . $this->alpha . ')', 'hsla' );
+ } elseif ( 'saturation' === $property ) {
+ return self::new_color( 'hsla(' . $this->hue . ',' . $value . '%,' . $this->lightness . '%,' . $this->alpha . ')', 'hsla' );
+ } elseif ( 'lightness' === $property ) {
+ return self::new_color( 'hsla(' . $this->hue . ',' . $this->saturation . '%,' . $value . '%,' . $this->alpha . ')', 'hsla' );
+ }
+ } elseif ( 'brightness' === $property ) {
+ // Check if we're changing the brightness.
+ if ( $value < $this->brightness['total'] ) {
+ $red = max( 0, min( 255, $this->red - ( $this->brightness['total'] - $value ) ) );
+ $green = max( 0, min( 255, $this->green - ( $this->brightness['total'] - $value ) ) );
+ $blue = max( 0, min( 255, $this->blue - ( $this->brightness['total'] - $value ) ) );
+ } elseif ( $value > $this->brightness['total'] ) {
+ $red = max( 0, min( 255, $this->red + ( $value - $this->brightness['total'] ) ) );
+ $green = max( 0, min( 255, $this->green + ( $value - $this->brightness['total'] ) ) );
+ $blue = max( 0, min( 255, $this->blue + ( $value - $this->brightness['total'] ) ) );
+ } else {
+ // If it's not smaller and it's not greater, then it's equal.
+ return $this;
+ }
+ return self::new_color( 'rgba(' . $red . ',' . $green . ',' . $blue . ',' . $this->alpha . ')', 'rgba' );
+ }
+ return null;
+ }
+
+ /**
+ * Allias for the getNew method.
+ *
+ * @access public
+ * @since 1.1.0
+ * @param string $property Can be one of the following:
+ * red,
+ * green,
+ * blue,
+ * alpha,
+ * hue,
+ * saturation,
+ * lightness,
+ * brightness.
+ * @param int|float|string $value The new value.
+ * @return ariColor|null
+ */
+ public function get_new( $property = '', $value = '' ) {
+ return $this->getNew( $property, $value );
+ }
+
+ /**
+ * Figure out what mode we're using.
+ *
+ * @access public
+ * @since 1.0.0
+ * @param string|array $color The color we're querying.
+ * @return string
+ */
+ public function get_mode( $color ) {
+
+ // Check if value is an array.
+ if ( is_array( $color ) ) {
+ // Does the array have an 'rgba' key?
+ if ( isset( $color['rgba'] ) ) {
+ $this->color = $color['rgba'];
+ return 'rgba';
+ } elseif ( isset( $color['color'] ) ) {
+ // Does the array have a 'color' key?
+ $this->color = $color['color'];
+ if ( is_string( $color['color'] ) && false !== strpos( $color['color'], 'rgba' ) ) {
+ return 'rgba';
+ }
+ return 'hex';
+ }
+ // Is this a simple array with 4 items?
+ if ( 4 === count( $color ) && isset( $color[0] ) && isset( $color[1] ) && isset( $color[2] ) && isset( $color[3] ) ) {
+ $this->color = 'rgba(' . intval( $color[0] ) . ',' . intval( $color[1] ) . ',' . intval( $color[2] ) . ',' . intval( $color[3] ) . ')';
+ return 'rgba';
+ } elseif ( 3 === count( $color ) && isset( $color[0] ) && isset( $color[1] ) && isset( $color[2] ) ) {
+ // Is this a simple array with 3 items?
+ $this->color = 'rgba(' . intval( $color[0] ) . ',' . intval( $color[1] ) . ',' . intval( $color[2] ) . ',1)';
+ return 'rgba';
+ }
+
+ // Check for other keys in the array and get values from there.
+ $finders_keepers = array(
+ 'r' => 'red',
+ 'g' => 'green',
+ 'b' => 'blue',
+ 'a' => 'alpha',
+ 'red' => 'red',
+ 'green' => 'green',
+ 'blue' => 'blue',
+ 'alpha' => 'alpha',
+ 'opacity' => 'alpha',
+ );
+ $found = false;
+ foreach ( $finders_keepers as $finder => $keeper ) {
+ if ( isset( $color[ $finder ] ) ) {
+ $found = true;
+ $this->$keeper = $color[ $finder ];
+ }
+ }
+
+ // We failed, use fallback.
+ if ( ! $found ) {
+ $this->from_fallback();
+ return $this->mode;
+ }
+
+ // We did not fail, so use rgba values recovered above.
+ $this->color = 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')';
+ return 'rgba';
+ }
+
+ // If a string and 3 or 6 characters long, add # since it's a hex.
+ if ( 3 === strlen( $this->color ) || 6 === strlen( $this->color ) && false === strpos( $this->color, '#' ) ) {
+ $this->color = '#' . $this->color;
+ $color = $this->color;
+ }
+
+ // If we got this far, it's not an array.
+ // Check for key identifiers in the value.
+ $finders_keepers = array(
+ '#' => 'hex',
+ 'rgba' => 'rgba',
+ 'rgb' => 'rgb',
+ 'hsla' => 'hsla',
+ 'hsl' => 'hsl',
+ );
+ foreach ( $finders_keepers as $finder => $keeper ) {
+ if ( false !== strrpos( $color, $finder ) ) {
+
+ // Make sure hex colors have 6 digits and not more.
+ if ( '#' === $finder && 7 < strlen( $color ) ) {
+ $this->color = substr( $color, 0, 7 );
+ }
+
+ return $keeper;
+ }
+ }
+ // Perhaps we're using a word like "orange"?
+ $wordcolors = $this->get_word_colors();
+ if ( is_string( $color ) && array_key_exists( $color, $wordcolors ) ) {
+ $this->color = '#' . $wordcolors[ $color ];
+ return 'hex';
+ }
+ // Fallback to hex.
+
+ $this->color = $this->fallback;
+ return 'hex';
+ }
+
+ /**
+ * Starts with a HEX color and calculates all other properties.
+ *
+ * @access protected
+ * @since 1.0.0
+ * @return null
+ */
+ protected function from_hex() {
+
+ if ( ! function_exists( 'sanitize_hex_color' ) ) {
+ require_once wp_normalize_path( ABSPATH . WPINC . '/class-wp-customize-manager.php' );
+ }
+ // Is this perhaps a word-color?
+ $word_colors = $this->get_word_colors();
+ if ( array_key_exists( $this->color, $word_colors ) ) {
+ $this->color = '#' . $word_colors[ $this->color ];
+ }
+ // Sanitize color.
+ $this->hex = sanitize_hex_color( maybe_hash_hex_color( $this->color ) );
+ $hex = ltrim( $this->hex, '#' );
+
+ // Fallback if needed.
+ if ( ! $hex || 3 > strlen( $hex ) ) {
+ $this->from_fallback();
+ return;
+ }
+ // Make sure we have 6 digits for the below calculations.
+ if ( 3 === strlen( $hex ) ) {
+ $hex = ltrim( $this->hex, '#' );
+ $hex = substr( $hex, 0, 1 ) . substr( $hex, 0, 1 ) . substr( $hex, 1, 1 ) . substr( $hex, 1, 1 ) . substr( $hex, 2, 1 ) . substr( $hex, 2, 1 );
+ }
+
+ // Set red, green, blue.
+ $this->red = hexdec( substr( $hex, 0, 2 ) );
+ $this->green = hexdec( substr( $hex, 2, 2 ) );
+ $this->blue = hexdec( substr( $hex, 4, 2 ) );
+ $this->alpha = 1;
+ // Set other color properties.
+ $this->set_brightness();
+ $this->set_hsl();
+ $this->set_luminance();
+
+ }
+
+ /**
+ * Starts with an RGB color and calculates all other properties.
+ *
+ * @access protected
+ * @since 1.0.0
+ * @return null
+ */
+ protected function from_rgb() {
+ $value = explode( ',', str_replace( array( ' ', 'rgb', '(', ')' ), '', $this->color ) );
+ // Set red, green, blue.
+ $this->red = ( isset( $value[0] ) ) ? intval( $value[0] ) : 255;
+ $this->green = ( isset( $value[1] ) ) ? intval( $value[1] ) : 255;
+ $this->blue = ( isset( $value[2] ) ) ? intval( $value[2] ) : 255;
+ $this->alpha = 1;
+ // Set the hex.
+ $this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue );
+ // Set other color properties.
+ $this->set_brightness();
+ $this->set_hsl();
+ $this->set_luminance();
+ }
+
+ /**
+ * Starts with an RGBA color and calculates all other properties.
+ *
+ * @access protected
+ * @since 1.0.0
+ * @return null
+ */
+ protected function from_rgba() {
+ // Set r, g, b, a properties.
+ $value = explode( ',', str_replace( array( ' ', 'rgba', '(', ')' ), '', $this->color ) );
+ $this->red = ( isset( $value[0] ) ) ? intval( $value[0] ) : 255;
+ $this->green = ( isset( $value[1] ) ) ? intval( $value[1] ) : 255;
+ $this->blue = ( isset( $value[2] ) ) ? intval( $value[2] ) : 255;
+ $this->alpha = ( isset( $value[3] ) ) ? filter_var( $value[3], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION ) : 1;
+ // Limit values in the range of 0 - 255.
+ $this->red = max( 0, min( 255, $this->red ) );
+ $this->green = max( 0, min( 255, $this->green ) );
+ $this->blue = max( 0, min( 255, $this->blue ) );
+ // Limit values 0 - 1.
+ $this->alpha = max( 0, min( 1, $this->alpha ) );
+ // Set hex.
+ $this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue );
+ // Set other color properties.
+ $this->set_brightness();
+ $this->set_hsl();
+ $this->set_luminance();
+ }
+
+ /**
+ * Starts with an HSL color and calculates all other properties.
+ *
+ * @access protected
+ * @since 1.0.0
+ * @return null
+ */
+ protected function from_hsl() {
+ $value = explode( ',', str_replace( array( ' ', 'hsl', '(', ')', '%' ), '', $this->color ) );
+ $this->hue = $value[0];
+ $this->saturation = $value[1];
+ $this->lightness = $value[2];
+ $this->from_hsl_array();
+ }
+
+ /**
+ * Starts with an HSLA color and calculates all other properties.
+ *
+ * @access protected
+ * @since 1.0.0
+ * @return null
+ */
+ protected function from_hsla() {
+ $value = explode( ',', str_replace( array( ' ', 'hsla', '(', ')', '%' ), '', $this->color ) );
+ $this->hue = $value[0];
+ $this->saturation = $value[1];
+ $this->lightness = $value[2];
+ $this->alpha = $value[3];
+ $this->from_hsl_array();
+ }
+
+ /**
+ * Generates the HEX value of a color given values for $red, $green, $blue.
+ *
+ * @access protected
+ * @since 1.0.0
+ * @param int|string $red The red value of this color.
+ * @param int|string $green The green value of this color.
+ * @param int|string $blue The blue value of this color.
+ * @return string
+ */
+ protected function rgb_to_hex( $red, $green, $blue ) {
+ // Get hex values properly formatted.
+ $hex_red = $this->dexhex_double_digit( $red );
+ $hex_green = $this->dexhex_double_digit( $green );
+ $hex_blue = $this->dexhex_double_digit( $blue );
+ return '#' . $hex_red . $hex_green . $hex_blue;
+ }
+
+ /**
+ * Convert a decimal value to hex and make sure it's 2 characters.
+ *
+ * @access protected
+ * @since 1.0.0
+ * @param int|string $value The value to convert.
+ * @return string
+ */
+ protected function dexhex_double_digit( $value ) {
+ $value = dechex( $value );
+ if ( 1 === strlen( $value ) ) {
+ $value = '0' . $value;
+ }
+ return $value;
+ }
+
+ /**
+ * Calculates the red, green, blue values of an HSL color.
+ *
+ * @access protected
+ * @since 1.0.0
+ * @see https://gist.github.com/brandonheyer/5254516
+ */
+ protected function from_hsl_array() {
+ $h = $this->hue / 360;
+ $s = $this->saturation / 100;
+ $l = $this->lightness / 100;
+
+ $r = $l;
+ $g = $l;
+ $b = $l;
+ $v = ( $l <= 0.5 ) ? ( $l * ( 1.0 + $s ) ) : ( $l + $s - $l * $s );
+ if ( $v > 0 ) {
+ $m = $l + $l - $v;
+ $sv = ( $v - $m ) / $v;
+ $h *= 6.0;
+ $sextant = floor( $h );
+ $fract = $h - $sextant;
+ $vsf = $v * $sv * $fract;
+ $mid1 = $m + $vsf;
+ $mid2 = $v - $vsf;
+ switch ( $sextant ) {
+ case 0:
+ $r = $v;
+ $g = $mid1;
+ $b = $m;
+ break;
+ case 1:
+ $r = $mid2;
+ $g = $v;
+ $b = $m;
+ break;
+ case 2:
+ $r = $m;
+ $g = $v;
+ $b = $mid1;
+ break;
+ case 3:
+ $r = $m;
+ $g = $mid2;
+ $b = $v;
+ break;
+ case 4:
+ $r = $mid1;
+ $g = $m;
+ $b = $v;
+ break;
+ case 5:
+ $r = $v;
+ $g = $m;
+ $b = $mid2;
+ break;
+ }
+ }
+ $this->red = round( $r * 255, 0 );
+ $this->green = round( $g * 255, 0 );
+ $this->blue = round( $b * 255, 0 );
+
+ $this->hex = $this->rgb_to_hex( $this->red, $this->green, $this->blue );
+ $this->set_luminance();
+ }
+
+ /**
+ * Returns a CSS-formatted value for colors.
+ *
+ * @access public
+ * @since 1.0.0
+ * @param string $mode The mode we're using.
+ * @return string
+ */
+ public function toCSS( $mode = 'hex' ) {
+
+ $value = '';
+
+ switch ( $mode ) {
+ case 'hex':
+ $value = strtolower( $this->hex );
+ break;
+ case 'rgba':
+ $value = 'rgba(' . $this->red . ',' . $this->green . ',' . $this->blue . ',' . $this->alpha . ')';
+ break;
+ case 'rgb':
+ $value = 'rgb(' . $this->red . ',' . $this->green . ',' . $this->blue . ')';
+ break;
+ case 'hsl':
+ $value = 'hsl(' . $this->hue . ',' . round( $this->saturation ) . '%,' . round( $this->lightness ) . '%)';
+ break;
+ case 'hsla':
+ $value = 'hsla(' . $this->hue . ',' . round( $this->saturation ) . '%,' . round( $this->lightness ) . '%,' . $this->alpha . ')';
+ break;
+ }
+ return $value;
+ }
+
+ /**
+ * Alias for the toCSS method.
+ *
+ * @access public
+ * @since 1.1
+ * @param string $mode The mode we're using.
+ * @return string
+ */
+ public function to_css( $mode = 'hex' ) {
+ return $this->toCSS( $mode );
+ }
+
+ /**
+ * Sets the HSL values of a color based on the values of red, green, blue.
+ *
+ * @access public
+ * @since 1.0.0
+ */
+ protected function set_hsl() {
+ $red = $this->red / 255;
+ $green = $this->green / 255;
+ $blue = $this->blue / 255;
+
+ $max = max( $red, $green, $blue );
+ $min = min( $red, $green, $blue );
+
+ $lightness = ( $max + $min ) / 2;
+ $difference = $max - $min;
+
+ if ( ! $difference ) {
+ $hue = $saturation = 0; // Achromatic.
+ } else {
+ $saturation = $difference / ( 1 - abs( 2 * $lightness - 1 ) );
+ switch ( $max ) {
+ case $red:
+ $hue = 60 * fmod( ( ( $green - $blue ) / $difference ), 6 );
+ if ( $blue > $green ) {
+ $hue += 360;
+ }
+ break;
+ case $green:
+ $hue = 60 * ( ( $blue - $red ) / $difference + 2 );
+ break;
+ case $blue:
+ $hue = 60 * ( ( $red - $green ) / $difference + 4 );
+ break;
+ }
+ }
+
+ $this->hue = round( $hue );
+ $this->saturation = round( $saturation * 100 );
+ $this->lightness = round( $lightness * 100 );
+ }
+
+ /**
+ * Sets the brightness of a color based on the values of red, green, blue.
+ *
+ * @access protected
+ * @since 1.0.0
+ */
+ protected function set_brightness() {
+ $this->brightness = array(
+ 'red' => round( $this->red * .299 ),
+ 'green' => round( $this->green * .587 ),
+ 'blue' => round( $this->blue * .114 ),
+ 'total' => intval( ( $this->red * .299 ) + ( $this->green * .587 ) + ( $this->blue * .114 ) ),
+ );
+ }
+
+ /**
+ * Sets the luminance of a color (range:0-255) based on the values of red, green, blue.
+ *
+ * @access protected
+ * @since 1.0.0
+ */
+ protected function set_luminance() {
+ $lum = ( 0.2126 * $this->red ) + ( 0.7152 * $this->green ) + ( 0.0722 * $this->blue );
+ $this->luminance = round( $lum );
+ }
+
+ /**
+ * Gets an array of all the wordcolors.
+ *
+ * @access protected
+ * @since 1.0.0
+ * @return array
+ */
+ protected function get_word_colors() {
+ return array(
+ 'aliceblue' => 'F0F8FF',
+ 'antiquewhite' => 'FAEBD7',
+ 'aqua' => '00FFFF',
+ 'aquamarine' => '7FFFD4',
+ 'azure' => 'F0FFFF',
+ 'beige' => 'F5F5DC',
+ 'bisque' => 'FFE4C4',
+ 'black' => '000000',
+ 'blanchedalmond' => 'FFEBCD',
+ 'blue' => '0000FF',
+ 'blueviolet' => '8A2BE2',
+ 'brown' => 'A52A2A',
+ 'burlywood' => 'DEB887',
+ 'cadetblue' => '5F9EA0',
+ 'chartreuse' => '7FFF00',
+ 'chocolate' => 'D2691E',
+ 'coral' => 'FF7F50',
+ 'cornflowerblue' => '6495ED',
+ 'cornsilk' => 'FFF8DC',
+ 'crimson' => 'DC143C',
+ 'cyan' => '00FFFF',
+ 'darkblue' => '00008B',
+ 'darkcyan' => '008B8B',
+ 'darkgoldenrod' => 'B8860B',
+ 'darkgray' => 'A9A9A9',
+ 'darkgreen' => '006400',
+ 'darkgrey' => 'A9A9A9',
+ 'darkkhaki' => 'BDB76B',
+ 'darkmagenta' => '8B008B',
+ 'darkolivegreen' => '556B2F',
+ 'darkorange' => 'FF8C00',
+ 'darkorchid' => '9932CC',
+ 'darkred' => '8B0000',
+ 'darksalmon' => 'E9967A',
+ 'darkseagreen' => '8FBC8F',
+ 'darkslateblue' => '483D8B',
+ 'darkslategray' => '2F4F4F',
+ 'darkslategrey' => '2F4F4F',
+ 'darkturquoise' => '00CED1',
+ 'darkviolet' => '9400D3',
+ 'deeppink' => 'FF1493',
+ 'deepskyblue' => '00BFFF',
+ 'dimgray' => '696969',
+ 'dimgrey' => '696969',
+ 'dodgerblue' => '1E90FF',
+ 'firebrick' => 'B22222',
+ 'floralwhite' => 'FFFAF0',
+ 'forestgreen' => '228B22',
+ 'fuchsia' => 'FF00FF',
+ 'gainsboro' => 'DCDCDC',
+ 'ghostwhite' => 'F8F8FF',
+ 'gold' => 'FFD700',
+ 'goldenrod' => 'DAA520',
+ 'gray' => '808080',
+ 'green' => '008000',
+ 'greenyellow' => 'ADFF2F',
+ 'grey' => '808080',
+ 'honeydew' => 'F0FFF0',
+ 'hotpink' => 'FF69B4',
+ 'indianred' => 'CD5C5C',
+ 'indigo' => '4B0082',
+ 'ivory' => 'FFFFF0',
+ 'khaki' => 'F0E68C',
+ 'lavender' => 'E6E6FA',
+ 'lavenderblush' => 'FFF0F5',
+ 'lawngreen' => '7CFC00',
+ 'lemonchiffon' => 'FFFACD',
+ 'lightblue' => 'ADD8E6',
+ 'lightcoral' => 'F08080',
+ 'lightcyan' => 'E0FFFF',
+ 'lightgoldenrodyellow' => 'FAFAD2',
+ 'lightgray' => 'D3D3D3',
+ 'lightgreen' => '90EE90',
+ 'lightgrey' => 'D3D3D3',
+ 'lightpink' => 'FFB6C1',
+ 'lightsalmon' => 'FFA07A',
+ 'lightseagreen' => '20B2AA',
+ 'lightskyblue' => '87CEFA',
+ 'lightslategray' => '778899',
+ 'lightslategrey' => '778899',
+ 'lightsteelblue' => 'B0C4DE',
+ 'lightyellow' => 'FFFFE0',
+ 'lime' => '00FF00',
+ 'limegreen' => '32CD32',
+ 'linen' => 'FAF0E6',
+ 'magenta' => 'FF00FF',
+ 'maroon' => '800000',
+ 'mediumaquamarine' => '66CDAA',
+ 'mediumblue' => '0000CD',
+ 'mediumorchid' => 'BA55D3',
+ 'mediumpurple' => '9370D0',
+ 'mediumseagreen' => '3CB371',
+ 'mediumslateblue' => '7B68EE',
+ 'mediumspringgreen' => '00FA9A',
+ 'mediumturquoise' => '48D1CC',
+ 'mediumvioletred' => 'C71585',
+ 'midnightblue' => '191970',
+ 'mintcream' => 'F5FFFA',
+ 'mistyrose' => 'FFE4E1',
+ 'moccasin' => 'FFE4B5',
+ 'navajowhite' => 'FFDEAD',
+ 'navy' => '000080',
+ 'oldlace' => 'FDF5E6',
+ 'olive' => '808000',
+ 'olivedrab' => '6B8E23',
+ 'orange' => 'FFA500',
+ 'orangered' => 'FF4500',
+ 'orchid' => 'DA70D6',
+ 'palegoldenrod' => 'EEE8AA',
+ 'palegreen' => '98FB98',
+ 'paleturquoise' => 'AFEEEE',
+ 'palevioletred' => 'DB7093',
+ 'papayawhip' => 'FFEFD5',
+ 'peachpuff' => 'FFDAB9',
+ 'peru' => 'CD853F',
+ 'pink' => 'FFC0CB',
+ 'plum' => 'DDA0DD',
+ 'powderblue' => 'B0E0E6',
+ 'purple' => '800080',
+ 'red' => 'FF0000',
+ 'rosybrown' => 'BC8F8F',
+ 'royalblue' => '4169E1',
+ 'saddlebrown' => '8B4513',
+ 'salmon' => 'FA8072',
+ 'sandybrown' => 'F4A460',
+ 'seagreen' => '2E8B57',
+ 'seashell' => 'FFF5EE',
+ 'sienna' => 'A0522D',
+ 'silver' => 'C0C0C0',
+ 'skyblue' => '87CEEB',
+ 'slateblue' => '6A5ACD',
+ 'slategray' => '708090',
+ 'slategrey' => '708090',
+ 'snow' => 'FFFAFA',
+ 'springgreen' => '00FF7F',
+ 'steelblue' => '4682B4',
+ 'tan' => 'D2B48C',
+ 'teal' => '008080',
+ 'thistle' => 'D8BFD8',
+ 'tomato' => 'FF6347',
+ 'turquoise' => '40E0D0',
+ 'violet' => 'EE82EE',
+ 'wheat' => 'F5DEB3',
+ 'white' => 'FFFFFF',
+ 'whitesmoke' => 'F5F5F5',
+ 'yellow' => 'FFFF00',
+ 'yellowgreen' => '9ACD32',
+ );
+
+ }
+
+ /**
+ * Use fallback object.
+ *
+ * @access protected
+ * @since 1.2.0
+ */
+ protected function from_fallback() {
+ $this->color = $this->fallback;
+
+ if ( ! $this->fallback_obj ) {
+ $this->fallback_obj = self::newColor( $this->fallback );
+ }
+ $this->color = $this->fallback_obj->color;
+ $this->mode = $this->fallback_obj->mode;
+ $this->red = $this->fallback_obj->red;
+ $this->green = $this->fallback_obj->green;
+ $this->blue = $this->fallback_obj->blue;
+ $this->alpha = $this->fallback_obj->alpha;
+ $this->hue = $this->fallback_obj->hue;
+ $this->saturation = $this->fallback_obj->saturation;
+ $this->lightness = $this->fallback_obj->lightness;
+ $this->luminance = $this->fallback_obj->luminance;
+ $this->hex = $this->fallback_obj->hex;
+ }
+
+ /**
+ * Handle non-existing public methods.
+ *
+ * @access public
+ * @since 1.1.0
+ * @param string $name The method name.
+ * @param mixed $arguments The method arguments.
+ * @return mixed
+ */
+ public function __call( $name, $arguments ) {
+ if ( method_exists( $this, $name ) ) {
+ call_user_func( array( $this, $name ), $arguments );
+ } else {
+ return $arguments;
+ }
+ }
+
+ /**
+ * Handle non-existing public static methods.
+ *
+ * @static
+ * @access public
+ * @since 1.1.0
+ * @param string $name The method name.
+ * @param mixed $arguments The method arguments.
+ * @return mixed
+ */
+ public static function __callStatic( $name, $arguments ) {
+ if ( method_exists( __CLASS__, $name ) ) {
+ call_user_func( array( __CLASS__, $name ), $arguments );
+ } else {
+ return $arguments;
+ }
+ }
+ }
+}
diff --git a/assets/kirki/lib/class-kirki-color.php b/assets/kirki/lib/class-kirki-color.php
new file mode 100644
index 0000000..b761e44
--- /dev/null
+++ b/assets/kirki/lib/class-kirki-color.php
@@ -0,0 +1,342 @@
+mode;
+ }
+ return $obj->toCSS( $mode );
+ }
+
+ /**
+ * Gets the rgb value of a color.
+ *
+ * @static
+ * @access public
+ * @param string $color The color.
+ * @param boolean $implode Whether we want to implode the values or not.
+ * @return array|string
+ */
+ public static function get_rgb( $color, $implode = false ) {
+ $obj = ariColor::newColor( $color );
+ if ( $implode ) {
+ return $obj->toCSS( 'rgb' );
+ }
+ return array( $obj->red, $obj->green, $obj->blue );
+ }
+
+ /**
+ * A proxy for the sanitize_color method.
+ *
+ * @static
+ * @access public
+ * @param string|array $color The color to convert.
+ * @return string The hex value of the color.
+ */
+ public static function rgba2hex( $color ) {
+ return self::sanitize_color( $color, 'hex' );
+ }
+
+ /**
+ * Get the alpha channel from an rgba color.
+ *
+ * @static
+ * @access public
+ * @param string $color The rgba color formatted like rgba(r,g,b,a).
+ * @return int|float The alpha value of the color.
+ */
+ public static function get_alpha_from_rgba( $color ) {
+ $obj = ariColor::newColor( $color );
+ return $obj->alpha;
+ }
+
+ /**
+ * Gets the rgba value of the $color.
+ *
+ * @static
+ * @access public
+ * @param string $color The hex value of a color.
+ * @param int|float $alpha Opacity level (0-1).
+ * @return string
+ */
+ public static function get_rgba( $color = '#fff', $alpha = 1 ) {
+ $obj = ariColor::newColor( $color );
+ if ( 1 == $alpha ) {
+ return $obj->toCSS( 'rgba' );
+ }
+ // Make sure that opacity is properly formatted.
+ // Converts 1-100 values to 0-1.
+ if ( $alpha > 1 || $alpha < -1 ) {
+ // Divide by 100.
+ $alpha /= 100;
+ }
+ // Get absolute value.
+ $alpha = abs( $alpha );
+ // Max 1.
+ if ( 1 < $alpha ) {
+ $alpha = 1;
+ }
+ $new_obj = $obj->getNew( 'alpha', $alpha );
+ return $new_obj->toCSS( 'rgba' );
+ }
+
+ /**
+ * Strips the alpha value from an RGBA color string.
+ *
+ * @static
+ * @access public
+ * @param string $color The RGBA color string.
+ * @return string The corresponding RGB string.
+ */
+ public static function rgba_to_rgb( $color ) {
+ $obj = ariColor::newColor( $color );
+ return $obj->toCSS( 'rgb' );
+ }
+
+ /**
+ * Gets the brightness of the $hex color.
+ *
+ * @static
+ * @access public
+ * @param string $hex The hex value of a color.
+ * @return int Value between 0 and 255.
+ */
+ public static function get_brightness( $hex ) {
+ $hex = self::sanitize_hex( $hex, false );
+
+ // Returns brightness value from 0 to 255.
+ return intval( ( ( hexdec( substr( $hex, 0, 2 ) ) * 299 ) + ( hexdec( substr( $hex, 2, 2 ) ) * 587 ) + ( hexdec( substr( $hex, 4, 2 ) ) * 114 ) ) / 1000 );
+ }
+
+ /**
+ * Adjusts brightness of the $hex color.
+ *
+ * @static
+ * @access public
+ * @param string $hex The hex value of a color.
+ * @param integer $steps Should be between -255 and 255. Negative = darker, positive = lighter.
+ * @return string Returns hex color.
+ */
+ public static function adjust_brightness( $hex, $steps ) {
+ $hex = self::sanitize_hex( $hex, false );
+ $steps = max( -255, min( 255, $steps ) );
+
+ // Adjust number of steps and keep it inside 0 to 255.
+ $red = max( 0, min( 255, hexdec( substr( $hex, 0, 2 ) ) + $steps ) );
+ $green = max( 0, min( 255, hexdec( substr( $hex, 2, 2 ) ) + $steps ) );
+ $blue = max( 0, min( 255, hexdec( substr( $hex, 4, 2 ) ) + $steps ) );
+
+ $red_hex = str_pad( dechex( $red ), 2, '0', STR_PAD_LEFT );
+ $green_hex = str_pad( dechex( $green ), 2, '0', STR_PAD_LEFT );
+ $blue_hex = str_pad( dechex( $blue ), 2, '0', STR_PAD_LEFT );
+ return self::sanitize_hex( $red_hex . $green_hex . $blue_hex );
+ }
+
+ /**
+ * Mixes 2 hex colors.
+ * The "percentage" variable is the percent of the first color.
+ * to be used it the mix. default is 50 (equal mix).
+ *
+ * @static
+ * @access public
+ * @param string|false $hex1 Color.
+ * @param string|false $hex2 Color.
+ * @param int $percentage A value between 0 and 100.
+ * @return string Returns hex color.
+ */
+ public static function mix_colors( $hex1, $hex2, $percentage ) {
+ $hex1 = self::sanitize_hex( $hex1, false );
+ $hex2 = self::sanitize_hex( $hex2, false );
+ $red = ( $percentage * hexdec( substr( $hex1, 0, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 0, 2 ) ) ) / 100;
+ $green = ( $percentage * hexdec( substr( $hex1, 2, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 2, 2 ) ) ) / 100;
+ $blue = ( $percentage * hexdec( substr( $hex1, 4, 2 ) ) + ( 100 - $percentage ) * hexdec( substr( $hex2, 4, 2 ) ) ) / 100;
+ $red_hex = str_pad( dechex( $red ), 2, '0', STR_PAD_LEFT );
+ $green_hex = str_pad( dechex( $green ), 2, '0', STR_PAD_LEFT );
+ $blue_hex = str_pad( dechex( $blue ), 2, '0', STR_PAD_LEFT );
+ return self::sanitize_hex( $red_hex . $green_hex . $blue_hex );
+ }
+
+ /**
+ * Convert hex color to hsv.
+ *
+ * @static
+ * @access public
+ * @param string $hex The hex value of color 1.
+ * @return array Returns array( 'h', 's', 'v' ).
+ */
+ public static function hex_to_hsv( $hex ) {
+ $rgb = (array) (array) self::get_rgb( self::sanitize_hex( $hex, false ) );
+ return self::rgb_to_hsv( $rgb );
+ }
+
+ /**
+ * Convert hex color to hsv.
+ *
+ * @static
+ * @access public
+ * @param string $color The rgb color to convert array( 'r', 'g', 'b' ).
+ * @return array Returns array( 'h', 's', 'v' ).
+ */
+ public static function rgb_to_hsv( $color = array() ) {
+ $var_r = ( $color[0] / 255 );
+ $var_g = ( $color[1] / 255 );
+ $var_b = ( $color[2] / 255 );
+ $var_min = min( $var_r, $var_g, $var_b );
+ $var_max = max( $var_r, $var_g, $var_b );
+ $del_max = $var_max - $var_min;
+ $h = 0;
+ $s = 0;
+ $v = $var_max;
+ if ( 0 != $del_max ) {
+ $s = $del_max / $var_max;
+ $del_r = ( ( ( $var_max - $var_r ) / 6 ) + ( $del_max / 2 ) ) / $del_max;
+ $del_g = ( ( ( $var_max - $var_g ) / 6 ) + ( $del_max / 2 ) ) / $del_max;
+ $del_b = ( ( ( $var_max - $var_b ) / 6 ) + ( $del_max / 2 ) ) / $del_max;
+ if ( $var_r == $var_max ) {
+ $h = $del_b - $del_g;
+ } elseif ( $var_g == $var_max ) {
+ $h = ( 1 / 3 ) + $del_r - $del_b;
+ } elseif ( $var_b == $var_max ) {
+ $h = ( 2 / 3 ) + $del_g - $del_r;
+ }
+ if ( $h < 0 ) {
+ $h++;
+ }
+ if ( $h > 1 ) {
+ $h--;
+ }
+ }
+ return array(
+ 'h' => round( $h, 2 ),
+ 's' => round( $s, 2 ),
+ 'v' => round( $v, 2 ),
+ );
+ }
+
+ /**
+ * This is a very simple algorithm that works by summing up the differences between the three color components red, green and blue.
+ * A value higher than 500 is recommended for good readability.
+ *
+ * @static
+ * @access public
+ * @param string $color_1 The 1st color.
+ * @param string $color_2 The 2nd color.
+ * @return string
+ */
+ public static function color_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) {
+ $color_1 = self::sanitize_hex( $color_1, false );
+ $color_2 = self::sanitize_hex( $color_2, false );
+ $color_1_rgb = self::get_rgb( $color_1 );
+ $color_2_rgb = self::get_rgb( $color_2 );
+ $r_diff = max( $color_1_rgb[0], $color_2_rgb[0] ) - min( $color_1_rgb[0], $color_2_rgb[0] );
+ $g_diff = max( $color_1_rgb[1], $color_2_rgb[1] ) - min( $color_1_rgb[1], $color_2_rgb[1] );
+ $b_diff = max( $color_1_rgb[2], $color_2_rgb[2] ) - min( $color_1_rgb[2], $color_2_rgb[2] );
+ $color_diff = $r_diff + $g_diff + $b_diff;
+ return $color_diff;
+ }
+
+ /**
+ * This function tries to compare the brightness of the colors.
+ * A return value of more than 125 is recommended.
+ * Combining it with the color_difference function above might make sense.
+ *
+ * @static
+ * @access public
+ * @param string $color_1 The 1st color.
+ * @param string $color_2 The 2nd color.
+ * @return string
+ */
+ public static function brightness_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) {
+ $color_1 = self::sanitize_hex( $color_1, false );
+ $color_2 = self::sanitize_hex( $color_2, false );
+ $color_1_rgb = self::get_rgb( $color_1 );
+ $color_2_rgb = self::get_rgb( $color_2 );
+ $br_1 = ( 299 * $color_1_rgb[0] + 587 * $color_1_rgb[1] + 114 * $color_1_rgb[2] ) / 1000;
+ $br_2 = ( 299 * $color_2_rgb[0] + 587 * $color_2_rgb[1] + 114 * $color_2_rgb[2] ) / 1000;
+ return intval( abs( $br_1 - $br_2 ) );
+ }
+
+ /**
+ * Uses the luminosity to calculate the difference between the given colors.
+ * The returned value should be bigger than 5 for best readability.
+ *
+ * @static
+ * @access public
+ * @param string $color_1 The 1st color.
+ * @param string $color_2 The 2nd color.
+ * @return string
+ */
+ public static function lumosity_difference( $color_1 = '#ffffff', $color_2 = '#000000' ) {
+ $color_1 = self::sanitize_hex( $color_1, false );
+ $color_2 = self::sanitize_hex( $color_2, false );
+ $color_1_rgb = self::get_rgb( $color_1 );
+ $color_2_rgb = self::get_rgb( $color_2 );
+ $l1 = 0.2126 * pow( $color_1_rgb[0] / 255, 2.2 ) + 0.7152 * pow( $color_1_rgb[1] / 255, 2.2 ) + 0.0722 * pow( $color_1_rgb[2] / 255, 2.2 );
+ $l2 = 0.2126 * pow( $color_2_rgb[0] / 255, 2.2 ) + 0.7152 * pow( $color_2_rgb[1] / 255, 2.2 ) + 0.0722 * pow( $color_2_rgb[2] / 255, 2.2 );
+ $lum_diff = ( $l1 > $l2 ) ? ( $l1 + 0.05 ) / ( $l2 + 0.05 ) : ( $l2 + 0.05 ) / ( $l1 + 0.05 );
+ return round( $lum_diff, 2 );
+ }
+}
diff --git a/assets/kirki/modules/css-vars/class-kirki-modules-css-vars.php b/assets/kirki/modules/css-vars/class-kirki-modules-css-vars.php
new file mode 100644
index 0000000..e1e9218
--- /dev/null
+++ b/assets/kirki/modules/css-vars/class-kirki-modules-css-vars.php
@@ -0,0 +1,115 @@
+.
+ *
+ * @access public
+ * @since 3.0.28
+ * @return void
+ */
+ public function the_style() {
+ // Get an array of all fields.
+ $fields = Kirki::$fields;
+ echo '';
+ }
+
+ /**
+ * Enqueues the script that handles postMessage
+ * and adds variables to it using the wp_localize_script function.
+ * The rest is handled via JS.
+ *
+ * @access public
+ * @since 3.0.28
+ * @return void
+ */
+ public function postmessage() {
+ wp_enqueue_script( 'kirki_auto_css_vars', trailingslashit( Kirki::$url ) . 'modules/css-vars/script.js', array( 'jquery', 'customize-preview' ), KIRKI_VERSION, true );
+ $fields = Kirki::$fields;
+ $data = array();
+ foreach ( $fields as $field ) {
+ if ( isset( $field['transport'] ) && 'postMessage' === $field['transport'] && isset( $field['css_vars'] ) && ! empty( $field['css_vars'] ) ) {
+ $data[] = $field;
+ }
+ }
+ wp_localize_script( 'kirki_auto_css_vars', 'kirkiCssVarFields', $data );
+ }
+}
diff --git a/assets/kirki/modules/css-vars/script.js b/assets/kirki/modules/css-vars/script.js
new file mode 100644
index 0000000..1c505eb
--- /dev/null
+++ b/assets/kirki/modules/css-vars/script.js
@@ -0,0 +1,61 @@
+/* global kirkiCssVarFields */
+var kirkiCssVars = {
+
+ /**
+ * Get styles.
+ *
+ * @since 3.0.28
+ * @returns {Object}
+ */
+ getStyles: function() {
+ var style = jQuery( '#kirki-css-vars' ),
+ styles = style.html().replace( ':root{', '' ).replace( '}', '' ).split( ';' ),
+ stylesObj = {};
+
+ // Format styles as a object we can then tweak.
+ _.each( styles, function( style ) {
+ style = style.split( ':' );
+ if ( style[0] && style[1] ) {
+ stylesObj[ style[0] ] = style[1];
+ }
+ } );
+ return stylesObj;
+ },
+
+ /**
+ * Builds the styles from an object.
+ *
+ * @since 3.0.28
+ * @param {Object} vars - The vars.
+ * @returns {string}
+ */
+ buildStyle: function( vars ) {
+ var style = '';
+
+ _.each( vars, function( val, name ) {
+ style += name + ':' + val + ';';
+ } );
+ return ':root{' + style + '}';
+ }
+};
+
+jQuery( document ).ready( function() {
+ _.each( kirkiCssVarFields, function( field ) {
+ wp.customize( field.settings, function( value ) {
+ value.bind( function( newVal ) {
+ var styles = kirkiCssVars.getStyles();
+
+ _.each( field.css_vars, function( cssVar ) {
+ if ( 'object' === typeof newVal ) {
+ if ( cssVar[2] && newVal[ cssVar[2] ] ) {
+ styles[ cssVar[0] ] = cssVar[1].replace( '$', newVal[ cssVar[2] ] );
+ }
+ } else {
+ styles[ cssVar[0] ] = cssVar[1].replace( '$', newVal );
+ }
+ } );
+ jQuery( '#kirki-css-vars' ).html( kirkiCssVars.buildStyle( styles ) ) ;
+ } );
+ } );
+ } );
+} );
diff --git a/assets/kirki/modules/css/class-kirki-css-to-file.php b/assets/kirki/modules/css/class-kirki-css-to-file.php
new file mode 100644
index 0000000..067fd7a
--- /dev/null
+++ b/assets/kirki/modules/css/class-kirki-css-to-file.php
@@ -0,0 +1,151 @@
+get_path( 'file' ) ) ) {
+ // If the file-write fails, fallback to inline
+ // and cache the failure so we don't try again immediately.
+ $this->write_file();
+ }
+ add_action( 'customize_save_after', array( $this, 'write_file' ) );
+ }
+
+ /**
+ * Gets the path of the CSS file and folder in the filesystem.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @param string $context Can be "file" or "folder". If empty, returns both as array.
+ * @return string|array
+ */
+ protected function get_path( $context = '' ) {
+
+ $upload_dir = wp_upload_dir();
+
+ $paths = array(
+ 'file' => wp_normalize_path( $upload_dir['basedir'] . '/kirki-css/styles.css' ),
+ 'folder' => wp_normalize_path( $upload_dir['basedir'] . '/kirki-css' ),
+ );
+
+ if ( 'file' === $context ) {
+ return $paths['file'];
+ }
+ if ( 'folder' === $context ) {
+ return $paths['folder'];
+ }
+ return $paths;
+
+ }
+
+ /**
+ * Gets the URL of the CSS file in the filesystem.
+ *
+ * @access public
+ * @since 3.0.0
+ * @return string
+ */
+ public function get_url() {
+
+ $upload_dir = wp_upload_dir();
+ return esc_url_raw( $upload_dir['baseurl'] . '/kirki-css/styles.css' );
+
+ }
+
+ /**
+ * Gets the timestamp of the file.
+ * This will be used as "version" for cache-busting purposes.
+ *
+ * @access public
+ * @since 3.0.0
+ * @return integer|false
+ */
+ public function get_timestamp() {
+
+ if ( file_exists( $this->get_path( 'file' ) ) ) {
+ return filemtime( $this->get_path( 'file' ) );
+ }
+ return false;
+ }
+
+ /**
+ * Writes the file to disk.
+ *
+ * @access public
+ * @since 3.0.0
+ * @return bool
+ */
+ public function write_file() {
+
+ $css = array();
+ $configs = Kirki::$config;
+ foreach ( $configs as $config_id => $args ) {
+ // Get the CSS we want to write.
+ $css[ $config_id ] = apply_filters( "kirki_{$config_id}_dynamic_css", Kirki_Modules_CSS::loop_controls( $config_id ) );
+ }
+ $css = implode( $css, '' );
+
+ // If the folder doesn't exist, create it.
+ if ( ! file_exists( $this->get_path( 'folder' ) ) ) {
+ wp_mkdir_p( $this->get_path( 'folder' ) );
+ }
+
+ $filesystem = $this->get_filesystem();
+ $write_file = (bool) $filesystem->put_contents( $this->get_path( 'file' ), $css );
+ if ( ! $write_file ) {
+ $this->fallback = true;
+ set_transient( 'kirki_css_write_to_file_failed', true, HOUR_IN_SECONDS );
+ }
+ return $write_file;
+
+ }
+
+ /**
+ * Gets the WP_Filesystem object.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @return object
+ */
+ protected function get_filesystem() {
+
+ // The WordPress filesystem.
+ global $wp_filesystem;
+
+ if ( empty( $wp_filesystem ) ) {
+ require_once wp_normalize_path( ABSPATH . '/wp-admin/includes/file.php' );
+ WP_Filesystem();
+ }
+
+ return $wp_filesystem;
+ }
+}
diff --git a/assets/kirki/modules/css/class-kirki-modules-css-generator.php b/assets/kirki/modules/css/class-kirki-modules-css-generator.php
new file mode 100644
index 0000000..e18337f
--- /dev/null
+++ b/assets/kirki/modules/css/class-kirki-modules-css-generator.php
@@ -0,0 +1,280 @@
+ self::$output,
+ 'sanitize_callback' => null,
+ ),
+ );
+ }
+
+ // Get the value of this field.
+ self::$value = Kirki_Values::get_sanitized_field_value( $field );
+
+ // Find the class that will handle the outpout for this field.
+ $classname = 'Kirki_Output';
+ $field_output_classes = apply_filters(
+ "kirki_{$field['kirki_config']}_output_control_classnames", array(
+ 'kirki-background' => 'Kirki_Output_Field_Background',
+ 'kirki-dimensions' => 'Kirki_Output_Field_Dimensions',
+ 'kirki-image' => 'Kirki_Output_Field_Image',
+ 'kirki-typography' => 'Kirki_Output_Field_Typography',
+ 'kirki-multicolor' => 'Kirki_Output_Field_Multicolor',
+ )
+ );
+ if ( array_key_exists( self::$field_type, $field_output_classes ) ) {
+ $classname = $field_output_classes[ self::$field_type ];
+ }
+ $obj = new $classname( $field['kirki_config'], self::$output, self::$value, $field );
+ return $obj->get_styles();
+
+ }
+
+ /**
+ * Gets the array of generated styles and creates the minimized, inline CSS.
+ *
+ * @static
+ * @access public
+ * @param array $css The CSS definitions array.
+ * @return string The generated CSS.
+ */
+ public static function styles_parse( $css = array() ) {
+
+ // Pass our styles from the kirki_styles_array filter.
+ $css = apply_filters( 'kirki_styles_array', $css );
+
+ // Process the array of CSS properties and produce the final CSS.
+ $final_css = '';
+ if ( ! is_array( $css ) || empty( $css ) ) {
+ return '';
+ }
+ foreach ( $css as $media_query => $styles ) {
+ $final_css .= ( 'global' !== $media_query ) ? $media_query . '{' : '';
+ foreach ( $styles as $style => $style_array ) {
+ $css_for_style = '';
+
+ foreach ( $style_array as $property => $value ) {
+ if ( is_string( $value ) && '' !== $value ) {
+ $css_for_style .= $property . ':' . $value . ';';
+ } elseif ( is_array( $value ) ) {
+ foreach ( $value as $subvalue ) {
+ if ( is_string( $subvalue ) && '' !== $subvalue ) {
+ $css_for_style .= $property . ':' . $subvalue . ';';
+ }
+ }
+ }
+ $value = ( is_string( $value ) ) ? $value : '';
+ }
+ if ( '' !== $css_for_style ) {
+ $final_css .= $style . '{' . $css_for_style . '}';
+ }
+ }
+ $final_css .= ( 'global' !== $media_query ) ? '}' : '';
+ }
+ return $final_css;
+ }
+
+ /**
+ * Add prefixes if necessary.
+ *
+ * @param array $css The CSS definitions array.
+ * @return array
+ */
+ public static function add_prefixes( $css ) {
+
+ if ( is_array( $css ) ) {
+ foreach ( $css as $media_query => $elements ) {
+ foreach ( $elements as $element => $style_array ) {
+ foreach ( $style_array as $property => $value ) {
+
+ // Add -webkit-* and -moz-*.
+ if ( is_string( $property ) && in_array(
+ $property, array(
+ 'border-radius',
+ 'box-shadow',
+ 'box-sizing',
+ 'text-shadow',
+ 'transform',
+ 'background-size',
+ 'transition',
+ 'transition-property',
+ ), true
+ ) ) {
+ unset( $css[ $media_query ][ $element ][ $property ] );
+ $css[ $media_query ][ $element ][ '-webkit-' . $property ] = $value;
+ $css[ $media_query ][ $element ][ '-moz-' . $property ] = $value;
+ $css[ $media_query ][ $element ][ $property ] = $value;
+ }
+
+ // Add -ms-* and -o-*.
+ if ( is_string( $property ) && in_array(
+ $property, array(
+ 'transform',
+ 'background-size',
+ 'transition',
+ 'transition-property',
+ ), true
+ ) ) {
+ unset( $css[ $media_query ][ $element ][ $property ] );
+ $css[ $media_query ][ $element ][ '-ms-' . $property ] = $value;
+ $css[ $media_query ][ $element ][ '-o-' . $property ] = $value;
+ $css[ $media_query ][ $element ][ $property ] = $value;
+ }
+ }
+ }
+ }
+ }
+ return $css;
+ }
+}
diff --git a/assets/kirki/modules/css/class-kirki-modules-css.php b/assets/kirki/modules/css/class-kirki-modules-css.php
new file mode 100644
index 0000000..84d2527
--- /dev/null
+++ b/assets/kirki/modules/css/class-kirki-modules-css.php
@@ -0,0 +1,319 @@
+ '/class-kirki-css-to-file.php',
+ 'Kirki_Modules_CSS_Generator' => '/class-kirki-modules-css-generator.php',
+ 'Kirki_Output' => '/class-kirki-output.php',
+ 'Kirki_Output_Field_Background' => '/field/class-kirki-output-field-background.php',
+ 'Kirki_Output_Field_Image' => '/field/class-kirki-output-field-image.php',
+ 'Kirki_Output_Field_Multicolor' => '/field/class-kirki-output-field-multicolor.php',
+ 'Kirki_Output_Field_Dimensions' => '/field/class-kirki-output-field-dimensions.php',
+ 'Kirki_Output_Field_Typography' => '/field/class-kirki-output-field-typography.php',
+ 'Kirki_Output_Property' => '/property/class-kirki-output-property.php',
+ 'Kirki_Output_Property_Background_Image' => '/property/class-kirki-output-property-background-image.php',
+ 'Kirki_Output_Property_Background_Position' => '/property/class-kirki-output-property-background-position.php',
+ 'Kirki_Output_Property_Font_Family' => '/property/class-kirki-output-property-font-family.php',
+ );
+
+ foreach ( $class_files as $class_name => $file ) {
+ if ( ! class_exists( $class_name ) ) {
+ include_once wp_normalize_path( dirname( __FILE__ ) . $file );
+ }
+ }
+
+ add_action( 'init', array( $this, 'init' ) );
+
+ }
+
+ /**
+ * Gets an instance of this object.
+ * Prevents duplicate instances which avoid artefacts and improves performance.
+ *
+ * @static
+ * @access public
+ * @since 3.0.0
+ * @return object
+ */
+ public static function get_instance() {
+ if ( ! self::$instance ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Init.
+ *
+ * @access public
+ */
+ public function init() {
+
+ Kirki_Modules_Webfonts::get_instance();
+
+ global $wp_customize;
+
+ $config = apply_filters( 'kirki_config', array() );
+ $priority = 999;
+ if ( isset( $config['styles_priority'] ) ) {
+ $priority = absint( $config['styles_priority'] );
+ }
+
+ // Allow completely disabling Kirki CSS output.
+ if ( ( defined( 'KIRKI_NO_OUTPUT' ) && true === KIRKI_NO_OUTPUT ) || ( isset( $config['disable_output'] ) && true === $config['disable_output'] ) ) {
+ return;
+ }
+
+ $method = apply_filters( 'kirki_dynamic_css_method', 'inline' );
+ if ( $wp_customize ) {
+ // If we're in the customizer, load inline no matter what.
+ add_action( 'wp_enqueue_scripts', array( $this, 'inline_dynamic_css' ), $priority );
+
+ // If we're using file method, on save write the new styles.
+ if ( 'file' === $method ) {
+ $this->css_to_file = new Kirki_CSS_To_File();
+ add_action( 'customize_save_after', array( $this->css_to_file, 'write_file' ) );
+ }
+ return;
+ }
+
+ if ( 'file' === $method ) {
+ // Attempt to write the CSS to file.
+ $this->css_to_file = new Kirki_CSS_To_File();
+ // If we succesd, load this file.
+ $failed = get_transient( 'kirki_css_write_to_file_failed' );
+ // If writing CSS to file hasn't failed, just enqueue this file.
+ if ( ! $failed ) {
+ add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_compiled_file' ), $priority );
+ return;
+ }
+ }
+
+ // If we are in the customizer, load CSS using inline-styles.
+ // If we are in the frontend AND self::$ajax is true, then load dynamic CSS using AJAX.
+ if ( ( true === self::$ajax ) || ( isset( $config['inline_css'] ) && false === $config['inline_css'] ) ) {
+ add_action( 'wp_enqueue_scripts', array( $this, 'frontend_styles' ), $priority );
+ add_action( 'wp_ajax_kirki_dynamic_css', array( $this, 'ajax_dynamic_css' ) );
+ add_action( 'wp_ajax_nopriv_kirki_dynamic_css', array( $this, 'ajax_dynamic_css' ) );
+ return;
+ }
+
+ // If we got this far then add styles inline.
+ add_action( 'wp_enqueue_scripts', array( $this, 'inline_dynamic_css' ), $priority );
+ }
+
+ /**
+ * Enqueues compiled CSS file.
+ *
+ * @access public
+ * @since 3.0.0
+ */
+ public function enqueue_compiled_file() {
+
+ wp_enqueue_style( 'kirki-styles', $this->css_to_file->get_url(), array(), $this->css_to_file->get_timestamp() );
+
+ }
+ /**
+ * Adds inline styles.
+ *
+ * @access public
+ */
+ public function inline_dynamic_css() {
+ $configs = Kirki::$config;
+ if ( ! $this->processed ) {
+ foreach ( $configs as $config_id => $args ) {
+ if ( isset( $args['disable_output'] ) && true === $args['disable_output'] ) {
+ continue;
+ }
+ $styles = self::loop_controls( $config_id );
+ $styles = apply_filters( "kirki_{$config_id}_dynamic_css", $styles );
+ if ( ! empty( $styles ) ) {
+ $stylesheet = apply_filters( "kirki_{$config_id}_stylesheet", false );
+ if ( $stylesheet ) {
+ wp_add_inline_style( $stylesheet, $styles );
+ continue;
+ }
+ wp_enqueue_style( 'kirki-styles-' . $config_id, trailingslashit( Kirki::$url ) . 'assets/css/kirki-styles.css', array(), KIRKI_VERSION );
+ wp_add_inline_style( 'kirki-styles-' . $config_id, $styles );
+ }
+ }
+ $this->processed = true;
+ }
+
+ if ( self::$enqueue_fa && apply_filters( 'kirki_load_fontawesome', true ) ) {
+ wp_enqueue_script( 'kirki-fontawesome-font', 'https://use.fontawesome.com/30858dc40a.js', array(), '4.0.7', true );
+ }
+ }
+
+ /**
+ * Get the dynamic-css.php file
+ *
+ * @access public
+ */
+ public function ajax_dynamic_css() {
+ require wp_normalize_path( Kirki::$path . '/modules/css/dynamic-css.php' );
+ exit;
+ }
+
+ /**
+ * Enqueues the ajax stylesheet.
+ *
+ * @access public
+ */
+ public function frontend_styles() {
+ wp_enqueue_style( 'kirki-styles-php', admin_url( 'admin-ajax.php' ) . '?action=kirki_dynamic_css', array(), KIRKI_VERSION );
+ }
+
+ /**
+ * Loop through all fields and create an array of style definitions.
+ *
+ * @static
+ * @access public
+ * @param string $config_id The configuration ID.
+ */
+ public static function loop_controls( $config_id ) {
+
+ // Get an instance of the Kirki_Modules_CSS_Generator class.
+ // This will make sure google fonts and backup fonts are loaded.
+ Kirki_Modules_CSS_Generator::get_instance();
+
+ $fields = Kirki::$fields;
+ $css = array();
+
+ // Early exit if no fields are found.
+ if ( empty( $fields ) ) {
+ return;
+ }
+
+ foreach ( $fields as $field ) {
+
+ // Only process fields that belong to $config_id.
+ if ( $config_id !== $field['kirki_config'] ) {
+ continue;
+ }
+
+ if ( true === apply_filters( "kirki_{$config_id}_css_skip_hidden", true ) ) {
+ // Only continue if field dependencies are met.
+ if ( ! empty( $field['required'] ) ) {
+ $valid = true;
+
+ foreach ( $field['required'] as $requirement ) {
+ if ( isset( $requirement['setting'] ) && isset( $requirement['value'] ) && isset( $requirement['operator'] ) ) {
+ $controller_value = Kirki_Values::get_value( $config_id, $requirement['setting'] );
+ if ( ! Kirki_Helper::compare_values( $controller_value, $requirement['value'], $requirement['operator'] ) ) {
+ $valid = false;
+ }
+ }
+ }
+
+ if ( ! $valid ) {
+ continue;
+ }
+ }
+ }
+
+ // Only continue if $field['output'] is set.
+ if ( isset( $field['output'] ) && ! empty( $field['output'] ) ) {
+ $css = Kirki_Helper::array_replace_recursive( $css, Kirki_Modules_CSS_Generator::css( $field ) );
+
+ // Add the globals.
+ if ( isset( self::$css_array[ $config_id ] ) && ! empty( self::$css_array[ $config_id ] ) ) {
+ Kirki_Helper::array_replace_recursive( $css, self::$css_array[ $config_id ] );
+ }
+ }
+ }
+
+ $css = apply_filters( "kirki_{$config_id}_styles", $css );
+
+ if ( is_array( $css ) ) {
+ return Kirki_Modules_CSS_Generator::styles_parse( Kirki_Modules_CSS_Generator::add_prefixes( $css ) );
+ }
+ }
+
+ /**
+ * Runs when we're adding a font-awesome field to allow enqueueing the
+ * fontawesome script on the frontend.
+ *
+ * @static
+ * @since 3.0.26
+ * @access public
+ * @return void
+ */
+ public static function add_fontawesome_script() {
+ self::$enqueue_fa = true;
+ }
+}
diff --git a/assets/kirki/modules/css/class-kirki-output.php b/assets/kirki/modules/css/class-kirki-output.php
new file mode 100644
index 0000000..a81489d
--- /dev/null
+++ b/assets/kirki/modules/css/class-kirki-output.php
@@ -0,0 +1,338 @@
+config_id = $config_id;
+ $this->value = $value;
+ $this->output = $output;
+ $this->field = $field;
+
+ $this->parse_output();
+ }
+
+ /**
+ * If we have a sanitize_callback defined, apply it to the value.
+ *
+ * @param array $output The output args.
+ * @param string|array $value The value.
+ *
+ * @return string|array
+ */
+ protected function apply_sanitize_callback( $output, $value ) {
+
+ if ( isset( $output['sanitize_callback'] ) && null !== $output['sanitize_callback'] ) {
+
+ // If the sanitize_callback is invalid, return the value.
+ if ( ! is_callable( $output['sanitize_callback'] ) ) {
+ return $value;
+ }
+ return call_user_func( $output['sanitize_callback'], $this->value );
+ }
+
+ return $value;
+
+ }
+
+ /**
+ * If we have a value_pattern defined, apply it to the value.
+ *
+ * @param array $output The output args.
+ * @param string|array $value The value.
+ * @return string|array
+ */
+ protected function apply_value_pattern( $output, $value ) {
+
+ if ( isset( $output['value_pattern'] ) && ! empty( $output['value_pattern'] ) && is_string( $output['value_pattern'] ) ) {
+ if ( ! is_array( $value ) ) {
+ $value = str_replace( '$', $value, $output['value_pattern'] );
+ }
+ if ( is_array( $value ) ) {
+ foreach ( array_keys( $value ) as $value_k ) {
+ if ( ! is_string( $value[ $value_k ] ) ) {
+ continue;
+ }
+ if ( isset( $output['choice'] ) ) {
+ if ( $output['choice'] === $value_k ) {
+ $value[ $output['choice'] ] = str_replace( '$', $value[ $output['choice'] ], $output['value_pattern'] );
+ }
+ continue;
+ }
+ $value[ $value_k ] = str_replace( '$', $value[ $value_k ], $output['value_pattern'] );
+ }
+ }
+ $value = $this->apply_pattern_replace( $output, $value );
+ }
+ return $value;
+ }
+
+ /**
+ * If we have a value_pattern defined, apply it to the value.
+ *
+ * @param array $output The output args.
+ * @param string|array $value The value.
+ * @return string|array
+ */
+ protected function apply_pattern_replace( $output, $value ) {
+ if ( isset( $output['pattern_replace'] ) && is_array( $output['pattern_replace'] ) ) {
+ $option_type = ( '' !== Kirki::get_config_param( $this->config_id, 'option_type' ) ) ? Kirki::get_config_param( $this->config_id, 'option_type' ) : 'theme_mod';
+ $option_name = Kirki::get_config_param( $this->config_id, 'option_name' );
+ $options = array();
+ if ( $option_name ) {
+ $options = ( 'site_option' === $option_type ) ? get_site_option( $option_name ) : get_option( $option_name );
+ }
+ foreach ( $output['pattern_replace'] as $search => $replace ) {
+ $replacement = '';
+ switch ( $option_type ) {
+ case 'option':
+ if ( is_array( $options ) ) {
+ if ( $option_name ) {
+ $subkey = str_replace( array( $option_name, '[', ']' ), '', $replace );
+ $replacement = ( isset( $options[ $subkey ] ) ) ? $options[ $subkey ] : '';
+ break;
+ }
+ $replacement = ( isset( $options[ $replace ] ) ) ? $options[ $replace ] : '';
+ break;
+ }
+ $replacement = get_option( $replace );
+ break;
+ case 'site_option':
+ $replacement = ( is_array( $options ) && isset( $options[ $replace ] ) ) ? $options[ $replace ] : get_site_option( $replace );
+ break;
+ case 'user_meta':
+ $user_id = get_current_user_id();
+ if ( $user_id ) {
+ $replacement = get_user_meta( $user_id, $replace, true );
+ }
+ break;
+ default:
+ $replacement = get_theme_mod( $replace );
+ }
+ $replacement = ( false === $replacement ) ? '' : $replacement;
+ if ( is_array( $value ) ) {
+ foreach ( $value as $k => $v ) {
+ $_val = ( isset( $value[ $v ] ) ) ? $value[ $v ] : $v;
+ $value[ $k ] = str_replace( $search, $replacement, $_val );
+ }
+ return $value;
+ }
+ $value = str_replace( $search, $replacement, $value );
+ }
+ }
+ return $value;
+ }
+
+ /**
+ * Parses the output arguments.
+ * Calls the process_output method for each of them.
+ *
+ * @access protected
+ */
+ protected function parse_output() {
+ foreach ( $this->output as $output ) {
+ $skip = false;
+
+ // Apply any sanitization callbacks defined.
+ $value = $this->apply_sanitize_callback( $output, $this->value );
+
+ // Skip if value is empty.
+ if ( '' === $this->value ) {
+ $skip = true;
+ }
+
+ // No need to proceed this if the current value is the same as in the "exclude" value.
+ if ( isset( $output['exclude'] ) && is_array( $output['exclude'] ) ) {
+ foreach ( $output['exclude'] as $exclude ) {
+ if ( is_array( $value ) ) {
+ if ( is_array( $exclude ) ) {
+ $diff1 = array_diff( $value, $exclude );
+ $diff2 = array_diff( $exclude, $value );
+
+ if ( empty( $diff1 ) && empty( $diff2 ) ) {
+ $skip = true;
+ }
+ }
+ // If 'choice' is defined check for sub-values too.
+ // Fixes https://github.com/aristath/kirki/issues/1416.
+ if ( isset( $output['choice'] ) && isset( $value[ $output['choice'] ] ) && $exclude == $value[ $output['choice'] ] ) { // phpcs:ignore WordPress.PHP.StrictComparisons.LooseComparison
+ $skip = true;
+ }
+ }
+ if ( $skip ) {
+ continue;
+ }
+
+ // Skip if value is defined as excluded.
+ if ( $exclude === $value || ( '' === $exclude && empty( $value ) ) ) {
+ $skip = true;
+ }
+ }
+ }
+ if ( $skip ) {
+ continue;
+ }
+
+ // Apply any value patterns defined.
+ $value = $this->apply_value_pattern( $output, $value );
+
+ if ( isset( $output['element'] ) && is_array( $output['element'] ) ) {
+ $output['element'] = array_unique( $output['element'] );
+ sort( $output['element'] );
+ $output['element'] = implode( ',', $output['element'] );
+ }
+
+ $value = $this->process_value( $value, $output );
+ $this->process_output( $output, $value );
+ }
+ }
+
+ /**
+ * Parses an output and creates the styles array for it.
+ *
+ * @access protected
+ * @param array $output The field output.
+ * @param string|array $value The value.
+ *
+ * @return null
+ */
+ protected function process_output( $output, $value ) {
+ if ( ! isset( $output['element'] ) || ! isset( $output['property'] ) ) {
+ return;
+ }
+ $output['media_query'] = ( isset( $output['media_query'] ) ) ? $output['media_query'] : 'global';
+ $output['prefix'] = ( isset( $output['prefix'] ) ) ? $output['prefix'] : '';
+ $output['units'] = ( isset( $output['units'] ) ) ? $output['units'] : '';
+ $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : '';
+
+ // Properties that can accept multiple values.
+ // Useful for example for gradients where all browsers use the "background-image" property
+ // and the browser prefixes go in the value_pattern arg.
+ $accepts_multiple = array(
+ 'background-image',
+ 'background',
+ );
+ if ( in_array( $output['property'], $accepts_multiple, true ) ) {
+ if ( isset( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) && ! is_array( $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] ) ) {
+ $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = (array) $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ];
+ }
+ $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ][] = $output['prefix'] . $value . $output['units'] . $output['suffix'];
+ return;
+ }
+ if ( is_string( $value ) || is_numeric( $value ) ) {
+ $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value ) . $output['units'] . $output['suffix'];
+ }
+ }
+
+ /**
+ * Some CSS properties are unique.
+ * We need to tweak the value to make everything works as expected.
+ *
+ * @access protected
+ * @param string $property The CSS property.
+ * @param string|array $value The value.
+ *
+ * @return array
+ */
+ protected function process_property_value( $property, $value ) {
+ $properties = apply_filters(
+ "kirki_{$this->config_id}_output_property_classnames", array(
+ 'font-family' => 'Kirki_Output_Property_Font_Family',
+ 'background-image' => 'Kirki_Output_Property_Background_Image',
+ 'background-position' => 'Kirki_Output_Property_Background_Position',
+ )
+ );
+ if ( array_key_exists( $property, $properties ) ) {
+ $classname = $properties[ $property ];
+ $obj = new $classname( $property, $value );
+ return $obj->get_value();
+ }
+ return $value;
+ }
+
+ /**
+ * Returns the value.
+ *
+ * @access protected
+ * @param string|array $value The value.
+ * @param array $output The field "output".
+ * @return string|array
+ */
+ protected function process_value( $value, $output ) {
+ if ( isset( $output['property'] ) ) {
+ return $this->process_property_value( $output['property'], $value );
+ }
+ return $value;
+ }
+
+ /**
+ * Exploses the private $styles property to the world
+ *
+ * @access protected
+ * @return array
+ */
+ public function get_styles() {
+ return $this->styles;
+ }
+}
diff --git a/assets/kirki/modules/css/field/class-kirki-output-field-background.php b/assets/kirki/modules/css/field/class-kirki-output-field-background.php
new file mode 100644
index 0000000..4499a27
--- /dev/null
+++ b/assets/kirki/modules/css/field/class-kirki-output-field-background.php
@@ -0,0 +1,48 @@
+ 'global',
+ 'element' => 'body',
+ 'prefix' => '',
+ 'suffix' => '',
+ )
+ );
+
+ foreach ( array( 'background-image', 'background-color', 'background-repeat', 'background-position', 'background-size', 'background-attachment' ) as $property ) {
+
+ // See https://github.com/aristath/kirki/issues/1808.
+ if ( 'background-color' === $property && isset( $value['background-color'] ) && $value['background-color'] && ( ! isset( $value['background-image'] ) || empty( $value['background-image'] ) ) ) {
+ $this->styles[ $output['media_query'] ][ $output['element'] ]['background'] = $output['prefix'] . $this->process_property_value( $property, $value[ $property ] ) . $output['suffix'];
+ }
+
+ if ( isset( $value[ $property ] ) && ! empty( $value[ $property ] ) ) {
+ $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $property ] ) . $output['suffix'];
+ }
+ }
+ }
+}
diff --git a/assets/kirki/modules/css/field/class-kirki-output-field-dimensions.php b/assets/kirki/modules/css/field/class-kirki-output-field-dimensions.php
new file mode 100644
index 0000000..df8e6c5
--- /dev/null
+++ b/assets/kirki/modules/css/field/class-kirki-output-field-dimensions.php
@@ -0,0 +1,56 @@
+ '',
+ 'property' => '',
+ 'media_query' => 'global',
+ 'prefix' => '',
+ 'suffix' => '',
+ )
+ );
+
+ if ( ! is_array( $value ) ) {
+ return;
+ }
+
+ foreach ( array_keys( $value ) as $key ) {
+
+ $property = ( empty( $output['property'] ) ) ? $key : $output['property'] . '-' . $key;
+ if ( isset( $output['choice'] ) && $output['property'] ) {
+ if ( $key === $output['choice'] ) {
+ $property = $output['property'];
+ } else {
+ continue;
+ }
+ }
+ if ( false !== strpos( $output['property'], '%%' ) ) {
+ $property = str_replace( '%%', $key, $output['property'] );
+ }
+ $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $this->process_property_value( $property, $value[ $key ] ) . $output['suffix'];
+ }
+ }
+}
diff --git a/assets/kirki/modules/css/field/class-kirki-output-field-image.php b/assets/kirki/modules/css/field/class-kirki-output-field-image.php
new file mode 100644
index 0000000..6a3f88e
--- /dev/null
+++ b/assets/kirki/modules/css/field/class-kirki-output-field-image.php
@@ -0,0 +1,50 @@
+ 'global',
+ 'prefix' => '',
+ 'units' => '',
+ 'suffix' => '',
+ )
+ );
+ if ( is_array( $value ) ) {
+ if ( isset( $output['choice'] ) && $output['choice'] ) {
+ $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value[ $output['choice'] ] ) . $output['units'] . $output['suffix'];
+ return;
+ }
+ if ( isset( $value['url'] ) ) {
+ $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value['url'] ) . $output['units'] . $output['suffix'];
+ return;
+ }
+ return;
+ }
+ $this->styles[ $output['media_query'] ][ $output['element'] ][ $output['property'] ] = $output['prefix'] . $this->process_property_value( $output['property'], $value ) . $output['units'] . $output['suffix'];
+ }
+}
diff --git a/assets/kirki/modules/css/field/class-kirki-output-field-multicolor.php b/assets/kirki/modules/css/field/class-kirki-output-field-multicolor.php
new file mode 100644
index 0000000..fc44fba
--- /dev/null
+++ b/assets/kirki/modules/css/field/class-kirki-output-field-multicolor.php
@@ -0,0 +1,54 @@
+ $sub_value ) {
+
+ // If "element" is not defined, there's no reason to continue.
+ if ( ! isset( $output['element'] ) ) {
+ continue;
+ }
+
+ // If the "choice" is not the same as the $key in our loop, there's no reason to proceed.
+ if ( isset( $output['choice'] ) && $key !== $output['choice'] ) {
+ continue;
+ }
+
+ // If "property" is not defined, fallback to the $key.
+ $property = ( ! isset( $output['property'] ) || empty( $output['property'] ) ) ? $key : $output['property'];
+
+ // If "media_query" is not defined, use "global".
+ if ( ! isset( $output['media_query'] ) || empty( $output['media_query'] ) ) {
+ $output['media_query'] = 'global';
+ }
+
+ // If "suffix" is defined, add it to the value.
+ $output['suffix'] = ( isset( $output['suffix'] ) ) ? $output['suffix'] : '';
+
+ // Create the styles.
+ $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $sub_value . $output['suffix'];
+
+ }
+ }
+}
diff --git a/assets/kirki/modules/css/field/class-kirki-output-field-typography.php b/assets/kirki/modules/css/field/class-kirki-output-field-typography.php
new file mode 100644
index 0000000..e6a2377
--- /dev/null
+++ b/assets/kirki/modules/css/field/class-kirki-output-field-typography.php
@@ -0,0 +1,96 @@
+field['default'][ $property ] ) ) {
+ continue;
+ }
+
+ // Early exit if the value is not saved in the values.
+ if ( ! isset( $value[ $property ] ) || ! $value[ $property ] ) {
+ continue;
+ }
+
+ // Early exit if we use "choice" but not for this property.
+ if ( isset( $output['choice'] ) && $output['choice'] !== $property ) {
+ continue;
+ }
+
+ // Take care of variants.
+ if ( 'variant' === $property && isset( $value['variant'] ) && ! empty( $value['variant'] ) ) {
+
+ // Get the font_weight.
+ $font_weight = str_replace( 'italic', '', $value['variant'] );
+ $font_weight = ( in_array( $font_weight, array( '', 'regular' ), true ) ) ? '400' : $font_weight;
+
+ // Is this italic?
+ $is_italic = ( false !== strpos( $value['variant'], 'italic' ) );
+ $this->styles[ $output['media_query'] ][ $output['element'] ]['font-weight'] = $font_weight;
+ if ( $is_italic ) {
+ $this->styles[ $output['media_query'] ][ $output['element'] ]['font-style'] = 'italic';
+ }
+ continue;
+ }
+
+ $property_value = $this->process_property_value( $property, $value[ $property ] );
+ if ( 'font-family' === $property ) {
+ $value['font-backup'] = ( isset( $value['font-backup'] ) ) ? $value['font-backup'] : '';
+ $property_value = $this->process_property_value(
+ $property, array(
+ $value['font-family'],
+ $value['font-backup'],
+ )
+ );
+ }
+ $property = ( isset( $output['choice'] ) && isset( $output['property'] ) ) ? $output['property'] : $property;
+ $property_value = ( is_array( $property_value ) && isset( $property_value[0] ) ) ? $property_value[0] : $property_value;
+ $this->styles[ $output['media_query'] ][ $output['element'] ][ $property ] = $output['prefix'] . $property_value . $output['suffix'];
+ }
+ }
+}
diff --git a/assets/kirki/modules/css/property/class-kirki-output-property-background-image.php b/assets/kirki/modules/css/property/class-kirki-output-property-background-image.php
new file mode 100644
index 0000000..f94fe33
--- /dev/null
+++ b/assets/kirki/modules/css/property/class-kirki-output-property-background-image.php
@@ -0,0 +1,40 @@
+value ) && isset( $this->value['url'] ) ) {
+ $this->value = $this->value['url'];
+ }
+
+ if ( false === strpos( $this->value, 'gradient' ) && false === strpos( $this->value, 'url(' ) ) {
+ if ( empty( $this->value ) ) {
+ return;
+ }
+
+ if ( preg_match( '/^\d+$/', $this->value ) ) {
+ $this->value = 'url("' . set_url_scheme( wp_get_attachment_url( $this->value ) ) . '")';
+ } else {
+ $this->value = 'url("' . set_url_scheme( $this->value ) . '")';
+ }
+ }
+ }
+}
diff --git a/assets/kirki/modules/css/property/class-kirki-output-property-background-position.php b/assets/kirki/modules/css/property/class-kirki-output-property-background-position.php
new file mode 100644
index 0000000..5f0e757
--- /dev/null
+++ b/assets/kirki/modules/css/property/class-kirki-output-property-background-position.php
@@ -0,0 +1,72 @@
+value = trim( $this->value );
+
+ // If you use calc() there, I suppose you know what you're doing.
+ // No need to process this any further, just exit.
+ if ( false !== strpos( $this->value, 'calc' ) ) {
+ return;
+ }
+
+ // If the value is initial or inherit, we don't need to do anything.
+ // Just exit.
+ if ( 'initial' === $this->value || 'inherit' === $this->value ) {
+ return;
+ }
+
+ $x_dimensions = array( 'left', 'center', 'right' );
+ $y_dimensions = array( 'top', 'center', 'bottom' );
+
+ // If there's a space, we have an X and a Y value.
+ if ( false !== strpos( $this->value, ' ' ) ) {
+ $xy = explode( ' ', $this->value );
+
+ $x = trim( $xy[0] );
+ $y = trim( $xy[1] );
+
+ // If x is not left/center/right, we need to sanitize it.
+ if ( ! in_array( $x, $x_dimensions, true ) ) {
+ $x = sanitize_text_field( $x );
+ }
+ if ( ! in_array( $y, $y_dimensions, true ) ) {
+ $y = sanitize_text_field( $y );
+ }
+ $this->value = $x . ' ' . $y;
+ return;
+ }
+ $x = 'center';
+ foreach ( $x_dimensions as $x_dimension ) {
+ if ( false !== strpos( $this->value, $x_dimension ) ) {
+ $x = $x_dimension;
+ }
+ }
+ $y = 'center';
+ foreach ( $y_dimensions as $y_dimension ) {
+ if ( false !== strpos( $this->value, $y_dimension ) ) {
+ $y = $y_dimension;
+ }
+ }
+ $this->value = $x . ' ' . $y;
+ }
+}
diff --git a/assets/kirki/modules/css/property/class-kirki-output-property-font-family.php b/assets/kirki/modules/css/property/class-kirki-output-property-font-family.php
new file mode 100644
index 0000000..ff97ec0
--- /dev/null
+++ b/assets/kirki/modules/css/property/class-kirki-output-property-font-family.php
@@ -0,0 +1,65 @@
+value;
+ $backup = '';
+ if ( is_array( $this->value ) && isset( $this->value[0] ) && isset( $this->value[1] ) ) {
+ $family = $this->value[0];
+ $backup = $this->value[1];
+ }
+
+ // Make sure the value is a string.
+ // If not, then early exit.
+ if ( ! is_string( $family ) ) {
+ return;
+ }
+
+ // Hack for standard fonts.
+ $family = str_replace( '"', '"', $family );
+
+ // Add backup font.
+ if ( Kirki_Fonts::is_google_font( $family ) ) {
+
+ if ( '' === $backup && isset( $google_fonts_array[ $family ] ) && isset( $backup_fonts[ $google_fonts_array[ $family ]['category'] ] ) ) {
+ $backup = $backup_fonts[ $google_fonts_array[ $family ]['category'] ];
+ }
+
+ // Add double quotes if needed.
+ if ( false !== strpos( $family, ' ' ) && false === strpos( $family, '"' ) ) {
+ $this->value = '"' . $family . '", ' . $backup;
+ return;
+ }
+ $this->value = $family . ', ' . $backup;
+ return;
+ }
+
+ // Add double quotes if needed.
+ if ( false !== strpos( $family, ' ' ) && false === strpos( $family, '"' ) ) {
+ $this->value = '"' . $family . '"';
+ }
+ $this->value = html_entity_decode( $family, ENT_QUOTES );
+ }
+}
diff --git a/assets/kirki/modules/css/property/class-kirki-output-property.php b/assets/kirki/modules/css/property/class-kirki-output-property.php
new file mode 100644
index 0000000..a81697b
--- /dev/null
+++ b/assets/kirki/modules/css/property/class-kirki-output-property.php
@@ -0,0 +1,64 @@
+property = $property;
+ $this->value = $value;
+ $this->process_value();
+ }
+
+ /**
+ * Modifies the value.
+ *
+ * @access protected
+ */
+ protected function process_value() {
+
+ }
+
+ /**
+ * Gets the value.
+ *
+ * @access protected
+ */
+ public function get_value() {
+ return $this->value;
+ }
+}
diff --git a/assets/kirki/modules/custom-sections/class-kirki-modules-custom-sections.php b/assets/kirki/modules/custom-sections/class-kirki-modules-custom-sections.php
new file mode 100644
index 0000000..9f8b551
--- /dev/null
+++ b/assets/kirki/modules/custom-sections/class-kirki-modules-custom-sections.php
@@ -0,0 +1,162 @@
+ 'Kirki_Sections_Default_Section',
+ 'kirki-expanded' => 'Kirki_Sections_Expanded_Section',
+ 'kirki-nested' => 'Kirki_Sections_Nested_Section',
+ );
+ return array_merge( $section_types, $new_types );
+
+ }
+
+ /**
+ * Add the custom panel types.
+ *
+ * @access public
+ * @since 3.0.0
+ * @param array $panel_types The registered section-types.
+ * @return array
+ */
+ public function set_panel_types( $panel_types ) {
+
+ $new_types = array(
+ 'kirki-nested' => 'Kirki_Panels_Nested_Panel',
+ );
+ return array_merge( $panel_types, $new_types );
+
+ }
+
+ /**
+ * Include the custom-section classes.
+ *
+ * @access public
+ * @since 3.0.0
+ */
+ public function include_sections_and_panels() {
+
+ // Sections.
+ $folder_path = dirname( __FILE__ ) . '/sections/';
+ $section_types = apply_filters( 'kirki_section_types', array() );
+
+ foreach ( $section_types as $id => $class ) {
+ if ( ! class_exists( $class ) ) {
+ $path = wp_normalize_path( $folder_path . 'class-kirki-sections-' . $id . '-section.php' );
+ if ( file_exists( $path ) ) {
+ include_once $path;
+ continue;
+ }
+ $path = str_replace( 'class-kirki-sections-kirki-', 'class-kirki-sections-', $path );
+ if ( file_exists( $path ) ) {
+ include_once $path;
+ }
+ }
+ }
+
+ // Panels.
+ $folder_path = dirname( __FILE__ ) . '/panels/';
+ $panel_types = apply_filters( 'kirki_panel_types', array() );
+
+ foreach ( $panel_types as $id => $class ) {
+ if ( ! class_exists( $class ) ) {
+ $path = wp_normalize_path( $folder_path . 'class-kirki-panels-' . $id . '-panel.php' );
+ if ( file_exists( $path ) ) {
+ include_once $path;
+ continue;
+ }
+ $path = str_replace( 'class-kirki-panels-kirki-', 'class-kirki-panels-', $path );
+ if ( file_exists( $path ) ) {
+ include_once $path;
+ }
+ }
+ }
+
+ }
+
+ /**
+ * Enqueues any necessary scripts and styles.
+ *
+ * @access public
+ * @since 3.0.0
+ */
+ public function enqueue_scrips() {
+
+ wp_enqueue_style( 'kirki-custom-sections', trailingslashit( Kirki::$url ) . 'modules/custom-sections/sections.css', array(), KIRKI_VERSION );
+ wp_enqueue_script( 'kirki-custom-sections', trailingslashit( Kirki::$url ) . 'modules/custom-sections/sections.js', array( 'jquery', 'customize-base', 'customize-controls' ), KIRKI_VERSION, false );
+
+ }
+
+}
diff --git a/assets/kirki/modules/custom-sections/panels/class-kirki-panels-nested-panel.php b/assets/kirki/modules/custom-sections/panels/class-kirki-panels-nested-panel.php
new file mode 100644
index 0000000..12698f7
--- /dev/null
+++ b/assets/kirki/modules/custom-sections/panels/class-kirki-panels-nested-panel.php
@@ -0,0 +1,61 @@
+title, ENT_QUOTES, get_bloginfo( 'charset' ) );
+ $array['content'] = $this->get_content();
+ $array['active'] = $this->active();
+ $array['instanceNumber'] = $this->instance_number;
+
+ return $array;
+ }
+}
diff --git a/assets/kirki/modules/custom-sections/sections.css b/assets/kirki/modules/custom-sections/sections.css
new file mode 100644
index 0000000..969698f
--- /dev/null
+++ b/assets/kirki/modules/custom-sections/sections.css
@@ -0,0 +1,26 @@
+#customize-theme-controls .control-section-kirki-expanded .accordion-section-title {
+ display: none;
+}
+#customize-theme-controls .control-section-kirki-expanded .customize-section-back {
+ display: none;
+}
+#customize-theme-controls .customize-pane-child.control-section-kirki-expanded {
+ position: relative;
+ visibility: visible;
+ height: auto;
+ margin-left: -100%;
+}
+#customize-theme-controls .customize-pane-child.control-section-kirki-expanded h3 .customize-action {
+ display: none;
+}
+
+#customize-theme-controls .customize-pane-child.current-section-parent,
+.in-sub-panel #customize-theme-controls .customize-pane-child.current-panel-parent {
+ transform: translateX(-100%);
+}
+
+.control-section-kirki-nested {
+ margin: 0 -12px;
+}
+
+/*# sourceMappingURL=sections.css.map */
diff --git a/assets/kirki/modules/custom-sections/sections.js b/assets/kirki/modules/custom-sections/sections.js
new file mode 100644
index 0000000..1e8a378
--- /dev/null
+++ b/assets/kirki/modules/custom-sections/sections.js
@@ -0,0 +1,256 @@
+jQuery( document ).ready( function() {
+
+ wp.customize.section.each( function( section ) {
+
+ // Get the pane element.
+ var pane = jQuery( '#sub-accordion-section-' + section.id ),
+ sectionLi = jQuery( '#accordion-section-' + section.id );
+
+ // Check if the section is expanded.
+ if ( sectionLi.hasClass( 'control-section-kirki-expanded' ) ) {
+
+ // Move element.
+ pane.appendTo( sectionLi );
+
+ }
+
+ } );
+
+} );
+
+/**
+ * @see https://wordpress.stackexchange.com/a/256103/17078
+ */
+( function() {
+
+ var _panelEmbed,
+ _panelIsContextuallyActive,
+ _panelAttachEvents,
+ _sectionEmbed,
+ _sectionIsContextuallyActive,
+ _sectionAttachEvents;
+
+ wp.customize.bind( 'pane-contents-reflowed', function() {
+
+ var panels = [],
+ sections = [];
+
+ // Reflow Sections.
+ wp.customize.section.each( function( section ) {
+
+ if ( 'kirki-nested' !== section.params.type || _.isUndefined( section.params.section ) ) {
+ return;
+ }
+ sections.push( section );
+ } );
+
+ sections.sort( wp.customize.utils.prioritySort ).reverse();
+
+ jQuery.each( sections, function( i, section ) {
+ var parentContainer = jQuery( '#sub-accordion-section-' + section.params.section );
+
+ parentContainer.children( '.section-meta' ).after( section.headContainer );
+ } );
+
+ // Reflow Panels.
+ wp.customize.panel.each( function( panel ) {
+ if ( 'kirki-nested' !== panel.params.type || _.isUndefined( panel.params.panel ) ) {
+ return;
+ }
+ panels.push( panel );
+ } );
+
+ panels.sort( wp.customize.utils.prioritySort ).reverse();
+
+ jQuery.each( panels, function( i, panel ) {
+ var parentContainer = jQuery( '#sub-accordion-panel-' + panel.params.panel );
+
+ parentContainer.children( '.panel-meta' ).after( panel.headContainer );
+ } );
+ } );
+
+ // Extend Panel.
+ _panelEmbed = wp.customize.Panel.prototype.embed;
+ _panelIsContextuallyActive = wp.customize.Panel.prototype.isContextuallyActive;
+ _panelAttachEvents = wp.customize.Panel.prototype.attachEvents;
+
+ wp.customize.Panel = wp.customize.Panel.extend( {
+ attachEvents: function() {
+ var panel;
+
+ if ( 'kirki-nested' !== this.params.type || _.isUndefined( this.params.panel ) ) {
+ _panelAttachEvents.call( this );
+ return;
+ }
+
+ _panelAttachEvents.call( this );
+
+ panel = this;
+
+ panel.expanded.bind( function( expanded ) {
+ var parent = wp.customize.panel( panel.params.panel );
+
+ if ( expanded ) {
+ parent.contentContainer.addClass( 'current-panel-parent' );
+ } else {
+ parent.contentContainer.removeClass( 'current-panel-parent' );
+ }
+ } );
+
+ panel.container.find( '.customize-panel-back' ).off( 'click keydown' ).on( 'click keydown', function( event ) {
+ if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+ event.preventDefault(); // Keep this AFTER the key filter above
+
+ if ( panel.expanded() ) {
+ wp.customize.panel( panel.params.panel ).expand();
+ }
+ } );
+ },
+
+ embed: function() {
+
+ var panel = this,
+ parentContainer;
+ if ( 'kirki-nested' !== this.params.type || _.isUndefined( this.params.panel ) ) {
+ _panelEmbed.call( this );
+ return;
+ }
+
+ _panelEmbed.call( this );
+
+ parentContainer = jQuery( '#sub-accordion-panel-' + this.params.panel );
+
+ parentContainer.append( panel.headContainer );
+ },
+
+ isContextuallyActive: function() {
+
+ var panel = this,
+ children,
+ activeCount = 0;
+
+ if ( 'kirki-nested' !== this.params.type ) {
+ return _panelIsContextuallyActive.call( this );
+ }
+
+ children = this._children( 'panel', 'section' );
+
+ wp.customize.panel.each( function( child ) {
+ if ( ! child.params.panel ) {
+ return;
+ }
+
+ if ( child.params.panel !== panel.id ) {
+ return;
+ }
+
+ children.push( child );
+ } );
+
+ children.sort( wp.customize.utils.prioritySort );
+
+ _( children ).each( function( child ) {
+ if ( child.active() && child.isContextuallyActive() ) {
+ activeCount += 1;
+ }
+ } );
+ return ( 0 !== activeCount );
+ }
+ } );
+
+ // Extend Section.
+ _sectionEmbed = wp.customize.Section.prototype.embed;
+ _sectionIsContextuallyActive = wp.customize.Section.prototype.isContextuallyActive;
+ _sectionAttachEvents = wp.customize.Section.prototype.attachEvents;
+
+ wp.customize.Section = wp.customize.Section.extend( {
+ attachEvents: function() {
+
+ var section = this;
+
+ if ( 'kirki-nested' !== this.params.type || _.isUndefined( this.params.section ) ) {
+ _sectionAttachEvents.call( section );
+ return;
+ }
+
+ _sectionAttachEvents.call( section );
+
+ section.expanded.bind( function( expanded ) {
+ var parent = wp.customize.section( section.params.section );
+
+ if ( expanded ) {
+ parent.contentContainer.addClass( 'current-section-parent' );
+ } else {
+ parent.contentContainer.removeClass( 'current-section-parent' );
+ }
+ } );
+
+ section.container.find( '.customize-section-back' ).off( 'click keydown' ).on( 'click keydown', function( event ) {
+ if ( wp.customize.utils.isKeydownButNotEnterEvent( event ) ) {
+ return;
+ }
+ event.preventDefault(); // Keep this AFTER the key filter above
+ if ( section.expanded() ) {
+ wp.customize.section( section.params.section ).expand();
+ }
+ } );
+ },
+
+ embed: function() {
+
+ var section = this,
+ parentContainer;
+
+ if ( 'kirki-nested' !== this.params.type || _.isUndefined( this.params.section ) ) {
+ _sectionEmbed.call( section );
+ return;
+ }
+
+ _sectionEmbed.call( section );
+
+ parentContainer = jQuery( '#sub-accordion-section-' + this.params.section );
+
+ parentContainer.append( section.headContainer );
+ },
+
+ isContextuallyActive: function() {
+ var section = this,
+ children,
+ activeCount = 0;
+ if ( 'kirki-nested' !== this.params.type ) {
+ return _sectionIsContextuallyActive.call( this );
+ }
+
+ children = this._children( 'section', 'control' );
+
+ wp.customize.section.each( function( child ) {
+ if ( ! child.params.section ) {
+ return;
+ }
+
+ if ( child.params.section !== section.id ) {
+ return;
+ }
+ children.push( child );
+ } );
+
+ children.sort( wp.customize.utils.prioritySort );
+
+ _( children ).each( function( child ) {
+ if ( 'undefined' !== typeof child.isContextuallyActive ) {
+ if ( child.active() && child.isContextuallyActive() ) {
+ activeCount += 1;
+ }
+ } else {
+ if ( child.active() ) {
+ activeCount += 1;
+ }
+ }
+ } );
+
+ return ( 0 !== activeCount );
+ }
+ } );
+}( jQuery ) );
diff --git a/assets/kirki/modules/custom-sections/sections/class-kirki-sections-default-section.php b/assets/kirki/modules/custom-sections/sections/class-kirki-sections-default-section.php
new file mode 100644
index 0000000..af676f5
--- /dev/null
+++ b/assets/kirki/modules/custom-sections/sections/class-kirki-sections-default-section.php
@@ -0,0 +1,25 @@
+title, ENT_QUOTES, get_bloginfo( 'charset' ) );
+ $array['content'] = $this->get_content();
+ $array['active'] = $this->active();
+ $array['instanceNumber'] = $this->instance_number;
+
+ $array['customizeAction'] = esc_attr__( 'Customizing', 'kirki' );
+ if ( $this->panel ) {
+ /* translators: The title. */
+ $array['customizeAction'] = sprintf( esc_attr__( 'Customizing ▸ %s', 'kirki' ), esc_html( $this->manager->get_panel( $this->panel )->title ) );
+ }
+ return $array;
+ }
+}
diff --git a/assets/kirki/modules/customizer-branding/branding.js b/assets/kirki/modules/customizer-branding/branding.js
new file mode 100644
index 0000000..3a3c273
--- /dev/null
+++ b/assets/kirki/modules/customizer-branding/branding.js
@@ -0,0 +1,14 @@
+/* global kirkiBranding */
+jQuery( document ).ready( function() {
+
+ 'use strict';
+
+ if ( '' !== kirkiBranding.logoImage ) {
+ jQuery( 'div#customize-info .preview-notice' ).replaceWith( ' ' );
+ }
+
+ if ( '' !== kirkiBranding.description ) {
+ jQuery( 'div#customize-info > .customize-panel-description' ).replaceWith( '' + kirkiBranding.description + '
' );
+ }
+
+} );
diff --git a/assets/kirki/modules/customizer-branding/class-kirki-modules-customizer-branding.php b/assets/kirki/modules/customizer-branding/class-kirki-modules-customizer-branding.php
new file mode 100644
index 0000000..5e354ac
--- /dev/null
+++ b/assets/kirki/modules/customizer-branding/class-kirki-modules-customizer-branding.php
@@ -0,0 +1,89 @@
+ '',
+ 'description' => '',
+ );
+ if ( isset( $config['logo_image'] ) && '' !== $config['logo_image'] ) {
+ $vars['logoImage'] = esc_url_raw( $config['logo_image'] );
+ }
+ if ( isset( $config['description'] ) && '' !== $config['description'] ) {
+ $vars['description'] = esc_textarea( $config['description'] );
+ }
+
+ if ( ! empty( $vars['logoImage'] ) || ! empty( $vars['description'] ) ) {
+ wp_register_script( 'kirki-branding', Kirki::$url . '/modules/customizer-branding/branding.js', array(), KIRKI_VERSION, false );
+ wp_localize_script( 'kirki-branding', 'kirkiBranding', $vars );
+ wp_enqueue_script( 'kirki-branding' );
+ }
+ }
+}
diff --git a/assets/kirki/modules/customizer-styling/class-kirki-modules-customizer-styling.php b/assets/kirki/modules/customizer-styling/class-kirki-modules-customizer-styling.php
new file mode 100644
index 0000000..88b2c33
--- /dev/null
+++ b/assets/kirki/modules/customizer-styling/class-kirki-modules-customizer-styling.php
@@ -0,0 +1,423 @@
+ $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness + 60 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness - 60 )->toCSS( $back_obj->mode );
+ $border_on_back = ( 80 < $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness - 13 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness + 13 )->toCSS( $back_obj->mode );
+ $back_on_back = ( 90 < $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness - 6 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness + 11 )->toCSS( $back_obj->mode );
+ $hover_on_back = ( 90 < $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness - 3 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness + 3 )->toCSS( $back_obj->mode );
+ $arrows_on_back = ( 50 > $back_obj->lightness ) ? $back_obj->getNew( 'lightness', $back_obj->lightness + 30 )->toCSS( $back_obj->mode ) : $back_obj->getNew( 'lightness', $back_obj->lightness - 30 )->toCSS( $back_obj->mode );
+ }
+ $accent = ( isset( $config['color_accent'] ) ) ? $config['color_accent'] : false;
+ if ( $accent ) {
+ $accent_obj = ariColor::newColor( $accent );
+ $text_on_accent = ( 60 > $accent_obj->lightness ) ? $accent_obj->getNew( 'lightness', $accent_obj->lightness + 60 )->toCSS( $accent_obj->mode ) : $accent_obj->getNew( 'lightness', $accent_obj->lightness - 60 )->toCSS( $accent_obj->mode );
+ $border_on_accent = ( 50 < $accent_obj->lightness ) ? $accent_obj->getNew( 'lightness', $accent_obj->lightness - 4 )->toCSS( $accent_obj->mode ) : $accent_obj->getNew( 'lightness', $accent_obj->lightness + 4 )->toCSS( $accent_obj->mode );
+ $accent_disabled_obj = ( 35 < $accent_obj->lightness ) ? $accent_obj->getNew( 'lightness', $accent_obj->lightness - 30 ) : $accent_obj->getNew( 'lightness', $accent_obj->lightness + 30 );
+ $accent_disabled = $accent_disabled_obj->toCSS( $accent_disabled_obj->mode );
+ $text_on_accent_disabled = ( 60 > $accent_disabled_obj->lightness ) ? $accent_disabled_obj->getNew( 'lightness', $accent_disabled_obj->lightness + 60 )->toCSS( $accent_disabled_obj->mode ) : $accent_disabled_obj->getNew( 'lightness', $accent_disabled_obj->lightness - 60 )->toCSS( $accent_disabled_obj->mode );
+ $border_on_accent_disabled = ( 50 < $accent_disabled_obj->lightness ) ? $accent_disabled_obj->getNew( 'lightness', $accent_disabled_obj->lightness - 4 )->toCSS( $accent_disabled_obj->mode ) : $accent_disabled_obj->getNew( 'lightness', $accent_disabled_obj->lightness + 4 )->toCSS( $accent_disabled_obj->mode );
+ }
+ ?>
+
+ =' === operator || 'greater or equal' === operator || 'equal or greater' === operator ) {
+ return value2 >= value1;
+ }
+ if ( '<=' === operator || 'smaller or equal' === operator || 'equal or smaller' === operator ) {
+ return value2 <= value1;
+ }
+ if ( '>' === operator || 'greater' === operator ) {
+ return value2 > value1;
+ }
+ if ( '<' === operator || 'smaller' === operator ) {
+ return value2 < value1;
+ }
+ if ( 'contains' === operator || 'in' === operator ) {
+ if ( _.isArray( value1 ) && _.isArray( value2 ) ) {
+ _.each( value2, function( value ) {
+ if ( value1.includes( value ) ) {
+ found = true;
+ return false;
+ }
+ } );
+ return found;
+ }
+ if ( _.isArray( value2 ) ) {
+ _.each( value2, function( value ) {
+ if ( value == value1 ) { // jshint ignore:line
+ found = true;
+ }
+ } );
+ return found;
+ }
+ if ( _.isObject( value2 ) ) {
+ if ( ! _.isUndefined( value2[ value1 ] ) ) {
+ found = true;
+ }
+ _.each( value2, function( subValue ) {
+ if ( value1 === subValue ) {
+ found = true;
+ }
+ } );
+ return found;
+ }
+ if ( _.isString( value2 ) ) {
+ if ( _.isString( value1 ) ) {
+ return ( -1 < value1.indexOf( value2 ) && -1 < value2.indexOf( value1 ) );
+ }
+ return -1 < value1.indexOf( value2 );
+ }
+ }
+ return value1 == value2;
+ }
+};
+
+jQuery( document ).ready( function() {
+ kirkiDependencies.init();
+} );
diff --git a/assets/kirki/modules/icons/class-kirki-modules-icons.php b/assets/kirki/modules/icons/class-kirki-modules-icons.php
new file mode 100644
index 0000000..fdeda0e
--- /dev/null
+++ b/assets/kirki/modules/icons/class-kirki-modules-icons.php
@@ -0,0 +1,108 @@
+add_icon( $section['id'], $section['icon'], 'section' );
+ }
+ }
+
+ // Parse panels and find ones with icons.
+ foreach ( $panels as $panel ) {
+ if ( isset( $panel['icon'] ) ) {
+ $this->add_icon( $panel['id'], $panel['icon'], 'panel' );
+ }
+ }
+
+ wp_enqueue_script( 'kirki_panel_and_section_icons', trailingslashit( Kirki::$url ) . 'modules/icons/icons.js', array( 'jquery', 'customize-base', 'customize-controls' ), KIRKI_VERSION, true );
+ wp_localize_script( 'kirki_panel_and_section_icons', 'kirkiIcons', self::$icons );
+
+ }
+}
diff --git a/assets/kirki/modules/icons/icons.js b/assets/kirki/modules/icons/icons.js
new file mode 100644
index 0000000..51698a2
--- /dev/null
+++ b/assets/kirki/modules/icons/icons.js
@@ -0,0 +1,30 @@
+/* global kirkiIcons */
+jQuery( document ).ready( function() {
+
+ 'use strict';
+
+ if ( ! _.isUndefined( kirkiIcons.section ) ) {
+
+ // Parse sections and add icons.
+ _.each( kirkiIcons.section, function( icon, sectionID ) {
+
+ // Add icons in list.
+ jQuery( '#accordion-section-' + sectionID + ' > h3' ).addClass( 'dashicons-before ' + icon );
+
+ // Add icons on titles when a section is open.
+ jQuery( '#sub-accordion-section-' + sectionID + ' .customize-section-title > h3' ).append( ' ' );
+ } );
+
+ }
+
+ if ( ! _.isUndefined( kirkiIcons.panel ) ) {
+
+ _.each( kirkiIcons.panel, function( icon, panelID ) {
+
+ // Add icons in lists & headers.
+ jQuery( '#accordion-panel-' + panelID + ' > h3, #sub-accordion-panel-' + panelID + ' .panel-title' ).addClass( 'dashicons-before ' + icon );
+ } );
+
+ }
+
+} );
diff --git a/assets/kirki/modules/loading/class-kirki-modules-loading.php b/assets/kirki/modules/loading/class-kirki-modules-loading.php
new file mode 100644
index 0000000..2429395
--- /dev/null
+++ b/assets/kirki/modules/loading/class-kirki-modules-loading.php
@@ -0,0 +1,169 @@
+remove_default_loading_styles();
+
+ }
+
+ /**
+ * Adds a custom "loading" div $ its styles when changes are made to the customizer.
+ *
+ * @access public
+ */
+ public function add_loader_to_footer() {
+ ?>
+
+
+
+ `.
+ *
+ * @access public
+ */
+ public function add_loader_styles_to_header() {
+ ?>
+
+ meta = get_post_custom( $queried_post->id );
+ }
+ $wp_scripts->add_data( 'kirki_post_meta_previewed_preview', 'data', sprintf( 'var _customizePostPreviewedQueriedObject = %s;', wp_json_encode( $queried_post ) ) );
+ }
+}
diff --git a/assets/kirki/modules/post-meta/customize-controls.js b/assets/kirki/modules/post-meta/customize-controls.js
new file mode 100644
index 0000000..09d8797
--- /dev/null
+++ b/assets/kirki/modules/post-meta/customize-controls.js
@@ -0,0 +1,23 @@
+jQuery( document ).ready( function() {
+
+ var self;
+
+ self = {
+ queriedPost: new wp.customize.Value()
+ };
+
+ // Listen for queried-post messages from the preview.
+ wp.customize.bind( 'ready', function() {
+ wp.customize.previewer.bind( 'queried-post', function( queriedPost ) {
+ self.queriedPost.set( queriedPost || false );
+ } );
+ } );
+
+ // Listen for post
+ self.queriedPost.bind( function( newPost, oldPost ) {
+ window.kirkiPost = false;
+ if ( newPost || oldPost ) {
+ window.kirkiPost = ( newPost ) ? newPost : oldPost;
+ }
+ } );
+} );
diff --git a/assets/kirki/modules/post-meta/customize-preview.js b/assets/kirki/modules/post-meta/customize-preview.js
new file mode 100644
index 0000000..8648d63
--- /dev/null
+++ b/assets/kirki/modules/post-meta/customize-preview.js
@@ -0,0 +1,14 @@
+/* global wp, _customizePostPreviewedQueriedObject */
+jQuery( document ).ready( function() {
+
+ var self = {
+ queriedPost: ( ! _.isUndefined( _customizePostPreviewedQueriedObject ) ) ? _customizePostPreviewedQueriedObject : null
+ };
+
+ // Send the queried post object to the Customizer pane when ready.
+ wp.customize.bind( 'preview-ready', function() {
+ wp.customize.preview.bind( 'active', function() {
+ wp.customize.preview.send( 'queried-post', self.queriedPost );
+ } );
+ } );
+} );
diff --git a/assets/kirki/modules/postmessage/class-kirki-modules-postmessage.php b/assets/kirki/modules/postmessage/class-kirki-modules-postmessage.php
new file mode 100644
index 0000000..bcb5001
--- /dev/null
+++ b/assets/kirki/modules/postmessage/class-kirki-modules-postmessage.php
@@ -0,0 +1,519 @@
+script .= $this->script( $field );
+ }
+ }
+ $this->script = apply_filters( 'kirki_postmessage_script', $this->script );
+ wp_add_inline_script( 'kirki_auto_postmessage', $this->script, 'after' );
+
+ }
+
+ /**
+ * Generates script for a single field.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @param array $args The arguments.
+ */
+ protected function script( $args ) {
+
+ $script = 'wp.customize(\'' . $args['settings'] . '\',function(value){value.bind(function(newval){';
+
+ $add_css = false;
+ foreach ( $args['js_vars'] as $js_var ) {
+ if ( ! isset( $js_var['function'] ) || 'html' !== $js_var['function'] ) {
+ $add_css = true;
+ }
+ }
+
+ if ( $add_css ) {
+
+ // append unique style tag if not exist
+ // The style ID.
+ $style_id = 'kirki-postmessage-' . str_replace( array( '[', ']' ), '', $args['settings'] );
+ $script .= 'if(null===document.getElementById(\'' . $style_id . '\')||\'undefined\'===typeof document.getElementById(\'' . $style_id . '\')){jQuery(\'head\').append(\'\');}';
+ }
+
+ // Add anything we need before the main script.
+ $script .= $this->before_script( $args );
+
+ $field = array(
+ 'scripts' => array(),
+ );
+ // Loop through the js_vars and generate the script.
+ foreach ( $args['js_vars'] as $key => $js_var ) {
+
+ // Skip styles if "exclude" is defined and value is excluded.
+ if ( isset( $js_var['exclude'] ) ) {
+ $js_var['exclude'] = (array) $js_var['exclude'];
+ $script .= 'exclude=false;';
+ foreach ( $js_var['exclude'] as $exclussion ) {
+ $script .= "if(newval=='{$exclussion}'||(''==='{$exclussion}'&&_.isObject(newval)&&_.isEmpty(newval))){exclude=true;}";
+ }
+ }
+ if ( isset( $js_var['element'] ) ) {
+ // Array to string.
+ if ( is_array( $js_var['element'] ) ) {
+ $js_var['element'] = implode( ',', $js_var['element'] );
+ }
+ // Replace single quotes with double quotes to avoid issues with the compiled JS.
+ $js_var['element'] = str_replace( '\'', '"', $js_var['element'] );
+ }
+ if ( isset( $js_var['function'] ) && 'html' === $js_var['function'] ) {
+ $script .= $this->script_html_var( $js_var );
+ continue;
+ }
+ $js_var['index_key'] = $key;
+ $callback = $this->get_callback( $args );
+ if ( is_callable( $callback ) ) {
+ $field['scripts'][ $key ] = call_user_func_array( $callback, array( $js_var, $args ) );
+ continue;
+ }
+ $field['scripts'][ $key ] = $this->script_var( $js_var );
+ }
+ $combo_extra_script = '';
+ $combo_css_script = '';
+ foreach ( $field['scripts'] as $script_array ) {
+ $combo_extra_script .= $script_array['script'];
+ $combo_css_script .= ( 'css' !== $combo_css_script ) ? $script_array['css'] : '';
+ }
+ $text = ( 'css' === $combo_css_script ) ? 'css' : '\'' . $combo_css_script . '\'';
+
+ $script .= $combo_extra_script . "var cssContent={$text};";
+ if ( isset( $js_var['exclude'] ) ) {
+ $script .= 'if(true===exclude){cssContent="";}';
+ }
+ if ( $add_css ) {
+ $script .= "jQuery('#{$style_id}').text(cssContent);jQuery('#{$style_id}').appendTo('head');";
+ }
+ $script .= '});});';
+ return $script;
+ }
+
+ /**
+ * Generates script for a single js_var when using "html" as function.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @param array $args The arguments for this js_var.
+ */
+ protected function script_html_var( $args ) {
+
+ $script = ( isset( $args['choice'] ) ) ? "newval=newval['{$args['choice']}'];" : '';
+
+ // Apply the value_pattern.
+ if ( isset( $args['value_pattern'] ) && '' !== $args['value_pattern'] ) {
+ $script .= $this->value_pattern_replacements( 'newval', $args );
+ }
+
+ if ( isset( $args['attr'] ) ) {
+ $script .= "jQuery('{$args['element']}').attr('{$args['attr']}',newval);";
+ return $script;
+ }
+ $script .= "jQuery('{$args['element']}').html(newval);";
+ return $script;
+ }
+
+ /**
+ * Generates script for a single js_var.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @param array $args The arguments for this js_var.
+ */
+ protected function script_var( $args ) {
+ $script = '';
+ $property_script = '';
+
+ $value_key = 'newval' . $args['index_key'];
+ $property_script .= $value_key . '=newval;';
+
+ $args = $this->get_args( $args );
+
+ // Apply callback to the value if a callback is defined.
+ if ( ! empty( $args['js_callback'] ) && is_array( $args['js_callback'] ) && isset( $args['js_callback'][0] ) && ! empty( $args['js_callback'][0] ) ) {
+ $script .= $value_key . '=' . $args['js_callback'][0] . '(' . $value_key . ',' . $args['js_callback'][1] . ');';
+ }
+
+ // Apply the value_pattern.
+ if ( '' !== $args['value_pattern'] ) {
+ $script .= $this->value_pattern_replacements( $value_key, $args );
+ }
+
+ // Tweak to add url() for background-images.
+ if ( 'background-image' === $args['property'] && ( ! isset( $args['value_pattern'] ) || false === strpos( $args['value_pattern'], 'gradient' ) ) ) {
+ $script .= 'if(-1===' . $value_key . '.indexOf(\'url(\')){' . $value_key . '=\'url("\'+' . $value_key . '+\'")\';}';
+ }
+
+ // Apply prefix.
+ $value = $value_key;
+ if ( '' !== $args['prefix'] ) {
+ $value = "'" . $args['prefix'] . "'+" . $value_key;
+ }
+ $css = $args['element'] . '{' . $args['property'] . ':\'+' . $value . '+\'' . $args['units'] . $args['suffix'] . ';}';
+ if ( isset( $args['media_query'] ) ) {
+ $css = $args['media_query'] . '{' . $css . '}';
+ }
+ return array(
+ 'script' => $property_script . $script,
+ 'css' => $css,
+ );
+ }
+
+ /**
+ * Processes script generation for fields that save an array.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @param array $args The arguments for this js_var.
+ */
+ protected function script_var_array( $args ) {
+
+ $script = ( 0 === $args['index_key'] ) ? 'css=\'\';' : '';
+ $property_script = '';
+
+ // Define choice.
+ $choice = ( isset( $args['choice'] ) && '' !== $args['choice'] ) ? $args['choice'] : '';
+
+ $value_key = 'newval' . $args['index_key'];
+ $property_script .= $value_key . '=newval;';
+
+ $args = $this->get_args( $args );
+
+ // Apply callback to the value if a callback is defined.
+ if ( ! empty( $args['js_callback'] ) && is_array( $args['js_callback'] ) && isset( $args['js_callback'][0] ) && ! empty( $args['js_callback'][0] ) ) {
+ $script .= $value_key . '=' . $args['js_callback'][0] . '(' . $value_key . ',' . $args['js_callback'][1] . ');';
+ }
+ $script .= '_.each(' . $value_key . ', function(subValue,subKey){';
+
+ // Apply the value_pattern.
+ if ( '' !== $args['value_pattern'] ) {
+ $script .= $this->value_pattern_replacements( 'subValue', $args );
+ }
+
+ // Tweak to add url() for background-images.
+ if ( '' === $choice || 'background-image' === $choice ) {
+ $script .= 'if(\'background-image\'===\'' . $args['property'] . '\'||\'background-image\'===subKey){if(-1===subValue.indexOf(\'url(\')){subValue=\'url("\'+subValue+\'")\';}}';
+ }
+
+ // Apply prefix.
+ $value = $value_key;
+ if ( '' !== $args['prefix'] ) {
+ $value = '\'' . $args['prefix'] . '\'+subValue';
+ }
+
+ // Mostly used for padding, margin & position properties.
+ $direction_script = 'if(_.contains([\'top\',\'bottom\',\'left\',\'right\'],subKey)){';
+ $direction_script .= 'css+=\'' . $args['element'] . '{' . $args['property'] . '-\'+subKey+\':\'+subValue+\'' . $args['units'] . $args['suffix'] . ';}\';}';
+ // Allows us to apply this just for a specific choice in the array of the values.
+ if ( '' !== $choice ) {
+ $choice_is_direction = ( false !== strpos( $choice, 'top' ) || false !== strpos( $choice, 'bottom' ) || false !== strpos( $choice, 'left' ) || false !== strpos( $choice, 'right' ) );
+ // The script.
+ $script .= 'if(\'' . $choice . '\'===subKey){';
+ $script .= ( $choice_is_direction ) ? $direction_script . 'else{' : '';
+ $script .= 'css+=\'' . $args['element'] . '{' . $args['property'] . ':\'+subValue+\';}\';';
+ $script .= ( $choice_is_direction ) ? '}' : '';
+ $script .= '}';
+ } else {
+
+ // This is where most object-based fields will go.
+ $script .= $direction_script . 'else{css+=\'' . $args['element'] . '{\'+subKey+\':\'+subValue+\'' . $args['units'] . $args['suffix'] . ';}\';}';
+ }
+ $script .= '});';
+
+ if ( isset( $args['media_query'] ) ) {
+ $script .= 'css=\'' . $args['media_query'] . '{\'+css+\'}\';';
+ }
+
+ return array(
+ 'script' => $property_script . $script,
+ 'css' => 'css',
+ );
+ }
+
+ /**
+ * Processes script generation for typography fields.
+ *
+ * @access protected
+ * @since 3.0.0
+ * @param array $args The arguments for this js_var.
+ * @param array $field The field arguments.
+ */
+ protected function script_var_typography( $args, $field ) {
+
+ $args = $this->get_args( $args );
+
+ $script = '';
+ $css = '';
+
+ // Load the font using WenFontloader.
+ // This is a bit ugly because wp_add_inline_script doesn't allow adding
+ 'edit_theme_options',
+ 'option_type' => 'option',
+ 'option_name' => 'fsmsp_options',
+ )
+ );
+ // Add FSMS Plugin Panel.
+ Kirki::add_panel(
+ 'fsmsp_panel',
+ array(
+ 'title' => __( 'FSMS Plugin', 'full-screen-morphing-search' ),
+ 'priority' => 160,
+ )
+ );
+ // Add Color Section.
+ Kirki::add_section(
+ 'fsmsp_color',
+ array(
+ 'title' => __( 'FSMS Colors', 'full-screen-morphing-search' ),
+ 'priority' => 5,
+ 'panel' => 'fsmsp_panel',
+ )
+ );
+ // FSMS Main Backgroung Color.
+ Kirki::add_field(
+ 'fsmsp_kirki',
+ array(
+ 'type' => 'color-alpha',
+ 'settings' => 'fsmsp_main_backgroung_color',
+ 'label' => __( 'FSMS Main Backgroung Color', 'full-screen-morphing-search' ),
+ 'description' => esc_attr__( 'Change the main background color', 'full-screen-morphing-search' ),
+ 'section' => 'fsmsp_color',
+ 'default' => '#f1f1f1',
+ 'transport' => 'auto',
+ 'output' => array(
+ array(
+ 'element' => array(
+ '#morphsearch',
+ 'div.morphsearch-content',
+ ),
+ 'property' => 'background-color',
+ ),
+ ),
+ )
+ );
+ // FSMS Close Color.
+ Kirki::add_field(
+ 'fsmsp_kirki',
+ array(
+ 'type' => 'color-alpha',
+ 'settings' => 'fsmsp_close_icon_color',
+ 'label' => __( 'FSMS Close Icon Color', 'full-screen-morphing-search' ),
+ 'description' => esc_attr__( 'Change the close icon color', 'full-screen-morphing-search' ),
+ 'section' => 'fsmsp_color',
+ 'default' => '#000',
+ 'transport' => 'auto',
+ 'output' => array(
+ array(
+ 'element' => array(
+ 'span.morphsearch-close::before',
+ 'span.morphsearch-close::after',
+ ),
+ 'property' => 'background',
+ ),
+ ),
+ )
+ );
+ // FSMS Search ... Color.
+ Kirki::add_field(
+ 'fsmsp_kirki',
+ array(
+ 'type' => 'color-alpha',
+ 'settings' => 'fsmsp_search_text_color',
+ 'label' => __( 'FSMS Search … text Color', 'full-screen-morphing-search' ),
+ 'description' => esc_attr__( 'Change the search … text color', 'full-screen-morphing-search' ),
+ 'section' => 'fsmsp_color',
+ 'default' => '#c2c2c2',
+ 'transport' => 'auto',
+ 'output' => array(
+ array(
+ 'element' => 'input.morphsearch-input::placeholder',
+ 'property' => 'color',
+ ),
+ ),
+ )
+ );
+ // FSMS Magnifier Submit Color.
+ Kirki::add_field(
+ 'fsmsp_kirki',
+ array(
+ 'type' => 'color-alpha',
+ 'settings' => 'fsmsp_magnifier_submit_color',
+ 'label' => __( 'FSMS Magnifier Submit Color', 'full-screen-morphing-search' ),
+ 'description' => esc_attr__( 'Change the magnifier submit color', 'full-screen-morphing-search' ),
+ 'section' => 'fsmsp_color',
+ 'default' => '#ddd',
+ 'transport' => 'auto',
+ 'output' => array(
+ array(
+ 'element' => array(
+ '#Layer_1 circle',
+ '#Layer_1 line',
+ ),
+ 'property' => 'stroke',
+ ),
+ ),
+ )
+ );
+ // FSMS Headings Color.
+ Kirki::add_field(
+ 'fsmsp_kirki',
+ array(
+ 'type' => 'color-alpha',
+ 'settings' => 'fsmsp_headings_color',
+ 'label' => __( 'FSMS Headings Color', 'full-screen-morphing-search' ),
+ 'description' => esc_attr__( 'Change the headings color', 'full-screen-morphing-search' ),
+ 'section' => 'fsmsp_color',
+ 'default' => '#c2c2c2',
+ 'transport' => 'auto',
+ 'output' => array(
+ array(
+ 'element' => 'div.dummy-column h2',
+ 'property' => 'color',
+ ),
+ ),
+ )
+ );
+ // FSMS Columns Background Color.
+ Kirki::add_field(
+ 'fsmsp_kirki',
+ array(
+ 'type' => 'color-alpha',
+ 'settings' => 'fsmsp_columns_background_color',
+ 'label' => __( 'FSMS Columns Background Color', 'full-screen-morphing-search' ),
+ 'description' => esc_attr__( 'Change the columns background color', 'full-screen-morphing-search' ),
+ 'section' => 'fsmsp_color',
+ 'default' => 'rgba(118, 117, 128, 0.05)',
+ 'transport' => 'auto',
+ 'output' => array(
+ array(
+ 'element' => 'div.dummy-media-object',
+ 'property' => 'background',
+ ),
+ ),
+ )
+ );
+ // FSMS Columns Hover Background Color.
+ Kirki::add_field(
+ 'fsmsp_kirki',
+ array(
+ 'type' => 'color-alpha',
+ 'settings' => 'fsmsp_columns_hover_background_color',
+ 'label' => __( 'FSMS Columns Hover Background Color', 'full-screen-morphing-search' ),
+ 'description' => esc_attr__( 'Change the columns hover background color', 'full-screen-morphing-search' ),
+ 'section' => 'fsmsp_color',
+ 'default' => 'rgba(118, 117, 128, 0.1)',
+ 'transport' => 'auto',
+ 'output' => array(
+ array(
+ 'element' => array(
+ 'div.dummy-media-object:hover',
+ 'div.dummy-media-object:focus',
+ ),
+ 'property' => 'background',
+ ),
+ ),
+ )
+ );
+ // FSMS Links Color.
+ Kirki::add_field(
+ 'fsmsp_kirki',
+ array(
+ 'type' => 'color-alpha',
+ 'settings' => 'fsmsp_links_color',
+ 'label' => __( 'FSMS Links Color', 'full-screen-morphing-search' ),
+ 'description' => esc_attr__( 'Change the links color', 'full-screen-morphing-search' ),
+ 'section' => 'fsmsp_color',
+ 'default' => 'rgba(145, 145, 145, 0.7)',
+ 'transport' => 'auto',
+ 'output' => array(
+ array(
+ 'element' => 'div.dummy-column h3 a',
+ 'property' => 'color',
+ ),
+ ),
+ )
+ );
+ // FSMS Links Hover Color.
+ Kirki::add_field(
+ 'fsmsp_kirki',
+ array(
+ 'type' => 'color-alpha',
+ 'settings' => 'fsmsp_links_hover_color',
+ 'label' => __( 'FSMS Links Hover Color', 'full-screen-morphing-search' ),
+ 'description' => esc_attr__( 'Change the links hover color', 'full-screen-morphing-search' ),
+ 'section' => 'fsmsp_color',
+ 'default' => 'rgba(236, 90, 98, 1)',
+ 'transport' => 'auto',
+ 'output' => array(
+ array(
+ 'element' => 'div.dummy-media-object:hover h3 a',
+ 'property' => 'color',
+ ),
+ ),
+ )
+ );
+ // Add Search Form Section.
+ Kirki::add_section(
+ 'fsmsp_search_form',
+ array(
+ 'title' => __( 'FSMS Search Form', 'full-screen-morphing-search' ),
+ 'priority' => 10,
+ 'panel' => 'fsmsp_panel',
+ )
+ );
+ // FSMS Search Form Text.
+ Kirki::add_field(
+ 'fsmsp_kirki',
+ array(
+ 'type' => 'text',
+ 'settings' => 'fsmsp_search_form_text',
+ 'label' => __( 'FSMS Search Form Text', 'full-screen-morphing-search' ),
+ 'description' => esc_attr__( 'Change the search form text. If leaved blank, it will return to original value !', 'full-screen-morphing-search' ),
+ 'section' => 'fsmsp_search_form',
+ 'default' => '',
+ 'transport' => 'postMessage',
+ 'js_vars' => array(
+ array(
+ 'element' => 'input.morphsearch-input.ui-autocomplete-input',
+ 'function' => 'html',
+ 'attr' => 'placeholder',
+ ),
+ ),
+ )
+ );
+}
diff --git a/languages/full-screen-morphing-search.pot b/languages/full-screen-morphing-search.pot
new file mode 100644
index 0000000..3ba9bbe
--- /dev/null
+++ b/languages/full-screen-morphing-search.pot
@@ -0,0 +1,136 @@
+#, fuzzy
+msgid ""
+msgstr ""
+"Project-Id-Version: Full Screen Morphing Search\n"
+"Report-Msgid-Bugs-To: \n"
+"POT-Creation-Date: 2018-11-22 02:53+0000\n"
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
+"Last-Translator: FULL NAME \n"
+"Language-Team: \n"
+"Language: \n"
+"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
+"MIME-Version: 1.0\n"
+"Content-Type: text/plain; charset=UTF-8\n"
+"Content-Transfer-Encoding: 8bit\n"
+"X-Generator: Loco https://localise.biz/\n"
+"X-Loco-Version: 2.2.0; wp-4.9.8"
+
+#: class-full-screen-morphing-search.php:87
+msgctxt "placeholder"
+msgid "Search …"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:39
+msgid "FSMS Plugin"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:47
+msgid "FSMS Colors"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:58
+msgid "FSMS Main Backgroung Color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:59
+msgid "Change the main background color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:80
+msgid "FSMS Close Icon Color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:81
+msgid "Change the close icon color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:102
+msgid "FSMS Search … text Color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:103
+msgid "Change the search … text color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:121
+msgid "FSMS Magnifier Submit Color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:122
+msgid "Change the magnifier submit color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:143
+msgid "FSMS Headings Color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:144
+msgid "Change the headings color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:162
+msgid "FSMS Columns Background Color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:163
+msgid "Change the columns background color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:181
+msgid "FSMS Columns Hover Background Color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:182
+msgid "Change the columns hover background color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:203
+msgid "FSMS Links Color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:204
+msgid "Change the links color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:222
+msgid "FSMS Links Hover Color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:223
+msgid "Change the links hover color"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:239
+msgid "FSMS Search Form"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:250
+msgid "FSMS Search Form Text"
+msgstr ""
+
+#: functions-full-screen-morphing-search.php:251
+msgid ""
+"Change the search form text. If leaved blank, it will return to original "
+"value !"
+msgstr ""
+
+#. Name of the plugin
+msgid "Full Screen Morphing Search"
+msgstr ""
+
+#. Description of the plugin
+msgid ""
+"Effect for any WordPress search input that morphs into a fullscreen overlay."
+msgstr ""
+
+#. URI of the plugin
+msgid "http://tympanus.net/codrops/2014/11/04/simple-morphing-search/"
+msgstr ""
+
+#. Author of the plugin
+msgid "LebCit"
+msgstr ""
+
+#. Author URI of the plugin
+msgid "https://lebcit.tk/"
+msgstr ""
diff --git a/readme.txt b/readme.txt
new file mode 100644
index 0000000..a9cb486
--- /dev/null
+++ b/readme.txt
@@ -0,0 +1,97 @@
+=== Full Screen Morphing Search ===
+Contributors: lebcit
+Tags: search, full screen search, morphing search, search overlay, jQuery UI autocomplete
+Requires at least: 4.6
+Tested up to: 4.9.8
+Requires PHP: 5.6
+Stable tag: 2.0
+License: GPLv2 or later
+License URI: https://www.gnu.org/licenses/gpl-2.0.html
+
+Responsive Full Screen Morphing Search Page Overlay With Predictive Autocomplete !
+
+== Description ==
+
+= Full Screen Morphing Search =
+
+Effect for any WordPress search input that morphs into a fullscreen overlay.
+Enlarge the search input and show 5 most recent posts, 5 most used categories and tags with counter.
+Once the input is clicked, the whole search element expands to a fullscreen overlay.
+The fullscreen overlay has a bigger search input.
+
+There are no settings for this plugin. Simply activate it, click on any search input and see the magic happens !
+**PLEASE, MAKE SURE TO HAVE AT LEAST ONE POST WITH ONE CATEGORY AND ONE TAG BEFORE ACTIVATING**
+
+**As of version 2.0**, head over the Customizer, look for **FSMS Plugin**, design it as you want !
+
+Don't forget to take a look at the FAQ Section.
+If you have some issues **don't hesitate**, head over to the Support Section !
+You can also visit my site LebCit.Tk to see the plugin in action and leave your comments.
+If you use this plugin, please consider leaving a Review to give me a push forward ;)
+
+= Credits =
+
+This plugin is created by Manoela Ilic .
+If you want to learn more about this plugin, visit the Simple Morphing Search original post.
+> A Picture is worth a thousand words
+
+I think that a demo is even better !
+See how Full Screen Morphing Search works.
+
+The jQuery UI autocompletition implemented in this plugin is based on Dominykas Gelucevičius post :
+How to create a jQuery autocomplete drop down in WordPress
+
+The main plugin icon is made by Pixel Buddha from www.flaticon.com and is licensed by CC 3.0 BY
+The article icon is made by Freepik from www.flaticon.com and is licensed by CC 3.0 BY
+The category icon is made by Freepik from www.flaticon.com and is licensed by CC 3.0 BY
+The tag icon is made by Freepik from www.flaticon.com and is licensed by CC 3.0 BY
+
+== Installation ==
+
+= How to install the plugin and get it working. =
+
+1. Install Full Screen Morphing Search plugin through the WordPress plugins screen directly.
+2. **Make sure to have at least one post with one category and one tag before activating**.
+3. Activate the plugin through the 'Plugins' screen in WordPress.
+4. Navigate to your site and click on any search input and see the magic happens !
+5. In the Customizer, look for **FSMS Plugin**, design it as you want !
+
+== Frequently Asked Questions ==
+
+= Recent posts thumbnails are not round ! =
+
+You will have to use a thumbnail regenerator.
+I recommend Regenerate Thumbnails .
+
+= The overlay is not covering the whole page ! =
+If your theme has some boxed style(s), like Twenty Sixteen or Twenty Twelve,
+the overlay will only cover the inside box (the site content) !
+
+= Autocomplete predicts only posts and pages ! =
+Yes, just for now !
+I'll be adding some more cool functions with time.
+
+== Screenshots ==
+
+1. As you can see, their is a search form a close button and three columns.
+The first column shows the most 5 recent posts.
+The second column shows the top 5 used categories and how many posts each category has.
+The third column shows the top 5 used tags and how many posts each tag has.
+
+== Changelog ==
+
+= 2.0 =
+* Plugin rewritten from ground up.
+
+= 1.2.1 =
+* Tested up to version 4.9.4 of WordPress.
+
+= 1.2 =
+* Added Predictive Autocomplete For Pages.
+* Added Press Escape Key To Close Search Overlay.
+
+= 1.1 =
+* Added Predictive Autocomplete For Posts.
+
+= 1.0 =
+* Initial release.
\ No newline at end of file