Viewing File: /home/fshjisk/mimikoparis/wp-content/plugins/content-control/assets/scripts/settings-page.min.js
!function(e){"function"==typeof define&&void 0!==define.amd&&define.amd?define(["jquery"],e):e("object"==typeof exports?require("jquery"):jQuery)}(function(e){var t=function(){if(e&&e.fn&&e.fn.jpselect2&&e.fn.jpselect2.amd)var t=e.fn.jpselect2.amd;var t;return function(){if(!t||!t.requirejs){t?n=t:t={};var e,n,i;!function(t){function r(e,t){return b.call(e,t)}function s(e,t){var n,i,r,s,o,a,l,c,d,u,p,h=t&&t.split("/"),f=y.map,m=f&&f["*"]||{};if(e&&"."===e.charAt(0))if(t){for(e=e.split("/"),o=e.length-1,y.nodeIdCompat&&w.test(e[o])&&(e[o]=e[o].replace(w,"")),e=h.slice(0,h.length-1).concat(e),d=0;d<e.length;d+=1)if(p=e[d],"."===p)e.splice(d,1),d-=1;else if(".."===p){if(1===d&&(".."===e[2]||".."===e[0]))break;d>0&&(e.splice(d-1,2),d-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((h||m)&&f){for(n=e.split("/"),d=n.length;d>0;d-=1){if(i=n.slice(0,d).join("/"),h)for(u=h.length;u>0;u-=1)if(r=f[h.slice(0,u).join("/")],r&&(r=r[i])){s=r,a=d;break}if(s)break;!l&&m&&m[i]&&(l=m[i],c=d)}!s&&l&&(s=l,a=c),s&&(n.splice(0,a,s),e=n.join("/"))}return e}function o(e,n){return function(){var i=j.call(arguments,0);return"string"!=typeof i[0]&&1===i.length&&i.push(null),h.apply(t,i.concat([e,n]))}}function a(e){return function(t){return s(t,e)}}function l(e){return function(t){g[e]=t}}function c(e){if(r(v,e)){var n=v[e];delete v[e],_[e]=!0,p.apply(t,n)}if(!r(g,e)&&!r(_,e))throw new Error("No "+e);return g[e]}function d(e){var t,n=e?e.indexOf("!"):-1;return n>-1&&(t=e.substring(0,n),e=e.substring(n+1,e.length)),[t,e]}function u(e){return function(){return y&&y.config&&y.config[e]||{}}}var p,h,f,m,g={},v={},y={},_={},b=Object.prototype.hasOwnProperty,j=[].slice,w=/\.js$/;f=function(e,t){var n,i=d(e),r=i[0];return e=i[1],r&&(r=s(r,t),n=c(r)),r?e=n&&n.normalize?n.normalize(e,a(t)):s(e,t):(e=s(e,t),i=d(e),r=i[0],e=i[1],r&&(n=c(r))),{f:r?r+"!"+e:e,n:e,pr:r,p:n}},m={require:function(e){return o(e)},exports:function(e){var t=g[e];return"undefined"!=typeof t?t:g[e]={}},module:function(e){return{id:e,uri:"",exports:g[e],config:u(e)}}},p=function(e,n,i,s){var a,d,u,p,h,y,b=[],j=typeof i;if(s=s||e,"undefined"===j||"function"===j){for(n=!n.length&&i.length?["require","exports","module"]:n,h=0;h<n.length;h+=1)if(p=f(n[h],s),d=p.f,"require"===d)b[h]=m.require(e);else if("exports"===d)b[h]=m.exports(e),y=!0;else if("module"===d)a=b[h]=m.module(e);else if(r(g,d)||r(v,d)||r(_,d))b[h]=c(d);else{if(!p.p)throw new Error(e+" missing "+d);p.p.load(p.n,o(s,!0),l(d),{}),b[h]=g[d]}u=i?i.apply(g[e],b):void 0,e&&(a&&a.exports!==t&&a.exports!==g[e]?g[e]=a.exports:u===t&&y||(g[e]=u))}else e&&(g[e]=i)},e=n=h=function(e,n,i,r,s){if("string"==typeof e)return m[e]?m[e](n):c(f(e,n).f);if(!e.splice){if(y=e,y.deps&&h(y.deps,y.callback),!n)return;n.splice?(e=n,n=i,i=null):e=t}return n=n||function(){},"function"==typeof i&&(i=r,r=s),r?p(t,e,n,i):setTimeout(function(){p(t,e,n,i)},4),h},h.config=function(e){return h(e)},e._defined=g,i=function(e,t,n){if("string"!=typeof e)throw new Error("See almond README: incorrect module build, no module name");t.splice||(n=t,t=[]),r(g,e)||r(v,e)||(v[e]=[e,t,n])},i.amd={jQuery:!0}}(),t.requirejs=e,t.require=n,t.define=i}}(),t.define("almond",function(){}),t.define("jquery",[],function(){var t=e||$;return null==t&&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."),t}),t.define("jpselect2/utils",["jquery"],function(e){function t(e){var t=e.prototype,n=[];for(var i in t){var r=t[i];"function"==typeof r&&"constructor"!==i&&n.push(i)}return n}var n={};n.Extend=function(e,t){function n(){this.constructor=e}var i={}.hasOwnProperty;for(var r in t)i.call(t,r)&&(e[r]=t[r]);return n.prototype=t.prototype,e.prototype=new n,e.__super__=t.prototype,e},n.Decorate=function(e,n){function i(){var t=Array.prototype.unshift,i=n.prototype.constructor.length,r=e.prototype.constructor;i>0&&(t.call(arguments,e.prototype.constructor),r=n.prototype.constructor),r.apply(this,arguments)}function r(){this.constructor=i}var s=t(n),o=t(e);n.displayName=e.displayName,i.prototype=new r;for(var a=0;a<o.length;a++){var l=o[a];i.prototype[l]=e.prototype[l]}for(var c=(function(e){var t=function(){};e in i.prototype&&(t=i.prototype[e]);var r=n.prototype[e];return function(){var e=Array.prototype.unshift;return e.call(arguments,t),r.apply(this,arguments)}}),d=0;d<s.length;d++){var u=s[d];i.prototype[u]=c(u)}return i};var i=function(){this.listeners={}};return i.prototype.on=function(e,t){this.listeners=this.listeners||{},e in this.listeners?this.listeners[e].push(t):this.listeners[e]=[t]},i.prototype.trigger=function(e){var t=Array.prototype.slice;this.listeners=this.listeners||{},e in this.listeners&&this.invoke(this.listeners[e],t.call(arguments,1)),"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)},i.prototype.invoke=function(e,t){for(var n=0,i=e.length;n<i;n++)e[n].apply(this,t)},n.Observable=i,n.generateChars=function(e){for(var t="",n=0;n<e;n++){var i=Math.floor(36*Math.random());t+=i.toString(36)}return t},n.bind=function(e,t){return function(){e.apply(t,arguments)}},n._convertData=function(e){for(var t in e){var n=t.split("-"),i=e;if(1!==n.length){for(var r=0;r<n.length;r++){var s=n[r];s=s.substring(0,1).toLowerCase()+s.substring(1),s in i||(i[s]={}),r==n.length-1&&(i[s]=e[t]),i=i[s]}delete e[t]}}return e},n.hasScroll=function(t,n){var i=e(n),r=n.style.overflowX,s=n.style.overflowY;return(r!==s||"hidden"!==s&&"visible"!==s)&&("scroll"===r||"scroll"===s||(i.innerHeight()<n.scrollHeight||i.innerWidth()<n.scrollWidth))},n.escapeMarkup=function(e){var t={"\\":"\","&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};return"string"!=typeof e?e:String(e).replace(/[&<>"'\/\\]/g,function(e){return t[e]})},n.appendMany=function(t,n){if("1.7"===e.fn.jquery.substr(0,3)){var i=e();e.map(n,function(e){i=i.add(e)}),n=i}t.append(n)},n}),t.define("jpselect2/results",["jquery","./utils"],function(e,t){function n(e,t,i){this.$element=e,this.data=i,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<ul class="jpselect2-results__options" role="tree"></ul>');return this.options.get("multiple")&&t.attr("aria-multiselectable","true"),this.$results=t,t},n.prototype.clear=function(){this.$results.empty()},n.prototype.displayMessage=function(t){var n=this.options.get("escapeMarkup");this.clear(),this.hideLoading();var i=e('<li role="treeitem" aria-live="assertive" class="jpselect2-results__option"></li>'),r=this.options.get("translations").get(t.message);i.append(n(r(t.args))),i[0].className+=" jpselect2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".jpselect2-results__message").remove()},n.prototype.append=function(e){this.hideLoading();var t=[];if(null==e.results||0===e.results.length)return void(0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"}));e.results=this.sort(e.results);for(var n=0;n<e.results.length;n++){var i=e.results[n],r=this.option(i);t.push(r)}this.$results.append(t)},n.prototype.position=function(e,t){var n=t.find(".jpselect2-results");n.append(e)},n.prototype.sort=function(e){var t=this.options.get("sorter");return t(e)},n.prototype.setClasses=function(){var t=this;this.data.current(function(n){var i=e.map(n,function(e){return e.id.toString()}),r=t.$results.find(".jpselect2-results__option[aria-selected]");r.each(function(){var t=e(this),n=e.data(this,"data"),r=""+n.id;null!=n.element&&n.element.selected||null==n.element&&e.inArray(r,i)>-1?t.attr("aria-selected","true"):t.attr("aria-selected","false")});var s=r.filter("[aria-selected=true]");s.length>0?s.first().trigger("mouseenter"):r.first().trigger("mouseenter")})},n.prototype.showLoading=function(e){this.hideLoading();var t=this.options.get("translations").get("searching"),n={disabled:!0,loading:!0,text:t(e)},i=this.option(n);i.className+=" loading-results",this.$results.prepend(i)},n.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},n.prototype.option=function(t){var n=document.createElement("li");n.className="jpselect2-results__option";var i={role:"treeitem","aria-selected":"false"};t.disabled&&(delete i["aria-selected"],i["aria-disabled"]="true"),null==t.id&&delete i["aria-selected"],null!=t._resultId&&(n.id=t._resultId),t.title&&(n.title=t.title),t.children&&(i.role="group",i["aria-label"]=t.text,delete i["aria-selected"]);for(var r in i){var s=i[r];n.setAttribute(r,s)}if(t.children){var o=e(n),a=document.createElement("strong");a.className="jpselect2-results__group";e(a);this.template(t,a);for(var l=[],c=0;c<t.children.length;c++){var d=t.children[c],u=this.option(d);l.push(u)}var p=e("<ul></ul>",{"class":"jpselect2-results__options jpselect2-results__options--nested"});p.append(l),o.append(a),o.append(p)}else this.template(t,n);return e.data(n,"data",t),n},n.prototype.bind=function(t,n){var i=this,r=t.id+"-results";this.$results.attr("id",r),t.on("results:all",function(e){i.clear(),i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("results:append",function(e){i.append(e.data),t.isOpen()&&i.setClasses()}),t.on("query",function(e){i.hideMessages(),i.showLoading(e)}),t.on("select",function(){t.isOpen()&&i.setClasses()}),t.on("unselect",function(){t.isOpen()&&i.setClasses()}),t.on("open",function(){i.$results.attr("aria-expanded","true"),i.$results.attr("aria-hidden","false"),i.setClasses(),i.ensureHighlightVisible()}),t.on("close",function(){i.$results.attr("aria-expanded","false"),i.$results.attr("aria-hidden","true"),i.$results.removeAttr("aria-activedescendant")}),t.on("results:toggle",function(){var e=i.getHighlightedResults();0!==e.length&&e.trigger("mouseup")}),t.on("results:select",function(){var e=i.getHighlightedResults();if(0!==e.length){var t=e.data("data");"true"==e.attr("aria-selected")?i.trigger("close",{}):i.trigger("select",{data:t})}}),t.on("results:previous",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e);if(0!==n){var r=n-1;0===e.length&&(r=0);var s=t.eq(r);s.trigger("mouseenter");var o=i.$results.offset().top,a=s.offset().top,l=i.$results.scrollTop()+(a-o);0===r?i.$results.scrollTop(0):a-o<0&&i.$results.scrollTop(l)}}),t.on("results:next",function(){var e=i.getHighlightedResults(),t=i.$results.find("[aria-selected]"),n=t.index(e),r=n+1;if(!(r>=t.length)){var s=t.eq(r);s.trigger("mouseenter");var o=i.$results.offset().top+i.$results.outerHeight(!1),a=s.offset().top+s.outerHeight(!1),l=i.$results.scrollTop()+a-o;0===r?i.$results.scrollTop(0):a>o&&i.$results.scrollTop(l)}}),t.on("results:focus",function(e){e.element.addClass("jpselect2-results__option--highlighted")}),t.on("results:message",function(e){i.displayMessage(e)}),e.fn.mousewheel&&this.$results.on("mousewheel",function(e){var t=i.$results.scrollTop(),n=i.$results.get(0).scrollHeight-t+e.deltaY,r=e.deltaY>0&&t-e.deltaY<=0,s=e.deltaY<0&&n<=i.$results.height();r?(i.$results.scrollTop(0),e.preventDefault(),e.stopPropagation()):s&&(i.$results.scrollTop(i.$results.get(0).scrollHeight-i.$results.height()),e.preventDefault(),e.stopPropagation())}),this.$results.on("mouseup",".jpselect2-results__option[aria-selected]",function(t){var n=e(this),r=n.data("data");return"true"===n.attr("aria-selected")?void(i.options.get("multiple")?i.trigger("unselect",{originalEvent:t,data:r}):i.trigger("close",{})):void i.trigger("select",{originalEvent:t,data:r})}),this.$results.on("mouseenter",".jpselect2-results__option[aria-selected]",function(t){var n=e(this).data("data");i.getHighlightedResults().removeClass("jpselect2-results__option--highlighted"),i.trigger("results:focus",{data:n,element:e(this)})})},n.prototype.getHighlightedResults=function(){var e=this.$results.find(".jpselect2-results__option--highlighted");return e},n.prototype.destroy=function(){this.$results.remove()},n.prototype.ensureHighlightVisible=function(){var e=this.getHighlightedResults();if(0!==e.length){var t=this.$results.find("[aria-selected]"),n=t.index(e),i=this.$results.offset().top,r=e.offset().top,s=this.$results.scrollTop()+(r-i),o=r-i;s-=2*e.outerHeight(!1),n<=2?this.$results.scrollTop(0):(o>this.$results.outerHeight()||o<0)&&this.$results.scrollTop(s)}},n.prototype.template=function(t,n){var i=this.options.get("templateResult"),r=this.options.get("escapeMarkup"),s=i(t,n);null==s?n.style.display="none":"string"==typeof s?n.innerHTML=r(s):e(n).append(s)},n}),t.define("jpselect2/keys",[],function(){var e={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 e}),t.define("jpselect2/selection/base",["jquery","../utils","../keys"],function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,t.Observable),i.prototype.render=function(){var t=e('<span class="jpselect2-selection" role="combobox" aria-haspopup="true" aria-expanded="false"></span>');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")),t.attr("title",this.$element.attr("title")),t.attr("tabindex",this._tabindex),this.$selection=t,t},i.prototype.bind=function(e,t){var i=this,r=(e.id+"-container",e.id+"-results");this.container=e,this.$selection.on("focus",function(e){i.trigger("focus",e)}),this.$selection.on("blur",function(e){i._handleBlur(e)}),this.$selection.on("keydown",function(e){i.trigger("keypress",e),e.which===n.SPACE&&e.preventDefault()}),e.on("results:focus",function(e){i.$selection.attr("aria-activedescendant",e.data._resultId)}),e.on("selection:update",function(e){i.update(e.data)}),e.on("open",function(){i.$selection.attr("aria-expanded","true"),i.$selection.attr("aria-owns",r),i._attachCloseHandler(e)}),e.on("close",function(){i.$selection.attr("aria-expanded","false"),i.$selection.removeAttr("aria-activedescendant"),i.$selection.removeAttr("aria-owns"),i.$selection.focus(),i._detachCloseHandler(e)}),e.on("enable",function(){i.$selection.attr("tabindex",i._tabindex)}),e.on("disable",function(){i.$selection.attr("tabindex","-1")})},i.prototype._handleBlur=function(t){var n=this;window.setTimeout(function(){document.activeElement==n.$selection[0]||e.contains(n.$selection[0],document.activeElement)||n.trigger("blur",t)},1)},i.prototype._attachCloseHandler=function(t){e(document.body).on("mousedown.jpselect2."+t.id,function(t){var n=e(t.target),i=n.closest(".jpselect2"),r=e(".jpselect2.jpselect2-container--open");r.each(function(){var t=e(this);if(this!=i[0]){var n=t.data("element");n.jpselect2("close")}})})},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.jpselect2."+t.id)},i.prototype.position=function(e,t){var n=t.find(".selection");n.append(e)},i.prototype.destroy=function(){this._detachCloseHandler(this.container)},i.prototype.update=function(e){throw new Error("The `update` method must be defined in child classes.")},i}),t.define("jpselect2/selection/single",["jquery","./base","../utils","../keys"],function(e,t,n,i){function r(){r.__super__.constructor.apply(this,arguments)}return n.Extend(r,t),r.prototype.render=function(){var e=r.__super__.render.call(this);return e.addClass("jpselect2-selection--single"),e.html('<span class="jpselect2-selection__rendered"></span><span class="jpselect2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),e},r.prototype.bind=function(e,t){var n=this;r.__super__.bind.apply(this,arguments);var i=e.id+"-container";this.$selection.find(".jpselect2-selection__rendered").attr("id",i),this.$selection.attr("aria-labelledby",i),this.$selection.on("mousedown",function(e){1===e.which&&n.trigger("toggle",{originalEvent:e})}),this.$selection.on("focus",function(e){}),this.$selection.on("blur",function(e){}),e.on("selection:update",function(e){n.update(e.data)})},r.prototype.clear=function(){this.$selection.find(".jpselect2-selection__rendered").empty()},r.prototype.display=function(e,t){var n=this.options.get("templateSelection"),i=this.options.get("escapeMarkup");return i(n(e,t))},r.prototype.selectionContainer=function(){return e("<span></span>")},r.prototype.update=function(e){if(0===e.length)return void this.clear();var t=e[0],n=this.$selection.find(".jpselect2-selection__rendered"),i=this.display(t,n);n.empty().append(i),n.prop("title",t.title||t.text)},r}),t.define("jpselect2/selection/multiple",["jquery","./base","../utils"],function(e,t,n){function i(e,t){i.__super__.constructor.apply(this,arguments)}return n.Extend(i,t),i.prototype.render=function(){var e=i.__super__.render.call(this);return e.addClass("jpselect2-selection--multiple"),e.html('<ul class="jpselect2-selection__rendered"></ul>'),e},i.prototype.bind=function(t,n){var r=this;i.__super__.bind.apply(this,arguments),this.$selection.on("click",function(e){r.trigger("toggle",{originalEvent:e})}),this.$selection.on("click",".jpselect2-selection__choice__remove",function(t){if(!r.options.get("disabled")){var n=e(this),i=n.parent(),s=i.data("data");r.trigger("unselect",{originalEvent:t,data:s})}})},i.prototype.clear=function(){this.$selection.find(".jpselect2-selection__rendered").empty()},i.prototype.display=function(e,t){var n=this.options.get("templateSelection"),i=this.options.get("escapeMarkup");return i(n(e,t))},i.prototype.selectionContainer=function(){var t=e('<li class="jpselect2-selection__choice"><span class="jpselect2-selection__choice__remove" role="presentation">×</span></li>');return t},i.prototype.update=function(e){if(this.clear(),0!==e.length){for(var t=[],i=0;i<e.length;i++){var r=e[i],s=this.selectionContainer(),o=this.display(r,s);s.append(o),s.prop("title",r.title||r.text),s.data("data",r),t.push(s)}var a=this.$selection.find(".jpselect2-selection__rendered");n.appendMany(a,t)}},i}),t.define("jpselect2/selection/placeholder",["../utils"],function(e){function t(e,t,n){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n)}return t.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},t.prototype.createPlaceholder=function(e,t){var n=this.selectionContainer();return n.html(this.display(t)),n.addClass("jpselect2-selection__placeholder").removeClass("jpselect2-selection__choice"),n},t.prototype.update=function(e,t){var n=1==t.length&&t[0].id!=this.placeholder.id,i=t.length>1;if(i||n)return e.call(this,t);this.clear();var r=this.createPlaceholder(this.placeholder);this.$selection.find(".jpselect2-selection__rendered").append(r)},t}),t.define("jpselect2/selection/allowClear",["jquery","../keys"],function(e,t){function n(){}return n.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),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",".jpselect2-selection__clear",function(e){i._handleClear(e)}),t.on("keypress",function(e){i._handleKeyboardClear(e,t)})},n.prototype._handleClear=function(e,t){if(!this.options.get("disabled")){var n=this.$selection.find(".jpselect2-selection__clear");if(0!==n.length){t.stopPropagation();for(var i=n.data("data"),r=0;r<i.length;r++){var s={data:i[r]};if(this.trigger("unselect",s),s.prevented)return}this.$element.val(this.placeholder.id).trigger("change"),this.trigger("toggle",{})}}},n.prototype._handleKeyboardClear=function(e,n,i){i.isOpen()||n.which!=t.DELETE&&n.which!=t.BACKSPACE||this._handleClear(n)},n.prototype.update=function(t,n){if(t.call(this,n),!(this.$selection.find(".jpselect2-selection__placeholder").length>0||0===n.length)){var i=e('<span class="jpselect2-selection__clear">×</span>');i.data("data",n),this.$selection.find(".jpselect2-selection__rendered").prepend(i)}},n}),t.define("jpselect2/selection/search",["jquery","../utils","../keys"],function(e,t,n){function i(e,t,n){e.call(this,t,n)}return i.prototype.render=function(t){var n=e('<li class="jpselect2-search jpselect2-search--inline"><input class="jpselect2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" aria-autocomplete="list" /></li>');this.$searchContainer=n,this.$search=n.find("input");var i=t.call(this);return this._transferTabIndex(),i},i.prototype.bind=function(e,t,i){var r=this;e.call(this,t,i),t.on("open",function(){r.$search.trigger("focus")}),t.on("close",function(){r.$search.val(""),r.$search.removeAttr("aria-activedescendant"),r.$search.trigger("focus")}),t.on("enable",function(){r.$search.prop("disabled",!1),r._transferTabIndex()}),t.on("disable",function(){r.$search.prop("disabled",!0)}),t.on("focus",function(e){r.$search.trigger("focus")}),t.on("results:focus",function(e){r.$search.attr("aria-activedescendant",e.id)}),this.$selection.on("focusin",".jpselect2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".jpselect2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".jpselect2-search--inline",function(e){e.stopPropagation(),r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented();var t=e.which;if(t===n.BACKSPACE&&""===r.$search.val()){var i=r.$searchContainer.prev(".jpselect2-selection__choice");if(i.length>0){var s=i.data("data");r.searchRemoveChoice(s),e.preventDefault()}}});var s=document.documentMode,o=s&&s<=11;this.$selection.on("input.searchcheck",".jpselect2-search--inline",function(e){return o?void r.$selection.off("input.search input.searchcheck"):void r.$selection.off("keyup.search")}),this.$selection.on("keyup.search input.search",".jpselect2-search--inline",function(e){if(o&&"input"===e.type)return void r.$selection.off("input.search input.searchcheck");var t=e.which;t!=n.SHIFT&&t!=n.CTRL&&t!=n.ALT&&t!=n.TAB&&r.handleSearch(e)})},i.prototype._transferTabIndex=function(e){this.$search.attr("tabindex",this.$selection.attr("tabindex")),this.$selection.attr("tabindex","-1")},i.prototype.createPlaceholder=function(e,t){this.$search.attr("placeholder",t.text)},i.prototype.update=function(e,t){var n=this.$search[0]==document.activeElement;this.$search.attr("placeholder",""),e.call(this,t),this.$selection.find(".jpselect2-selection__rendered").append(this.$searchContainer),this.resizeSearch(),n&&this.$search.focus()},i.prototype.handleSearch=function(){if(this.resizeSearch(),!this._keyUpPrevented){var e=this.$search.val();this.trigger("query",{term:e})}this._keyUpPrevented=!1},i.prototype.searchRemoveChoice=function(e,t){this.trigger("unselect",{data:t}),this.$search.val(t.text),this.handleSearch()},i.prototype.resizeSearch=function(){this.$search.css("width","25px");var e="";if(""!==this.$search.attr("placeholder"))e=this.$selection.find(".jpselect2-selection__rendered").innerWidth();else{var t=this.$search.val().length+1;e=.75*t+"em"}this.$search.css("width",e)},i}),t.define("jpselect2/selection/eventRelay",["jquery"],function(e){function t(){}return t.prototype.bind=function(t,n,i){var r=this,s=["open","opening","close","closing","select","selecting","unselect","unselecting"],o=["opening","closing","selecting","unselecting"];t.call(this,n,i),n.on("*",function(t,n){if(e.inArray(t,s)!==-1){n=n||{};var i=e.Event("jpselect2:"+t,{params:n});r.$element.trigger(i),e.inArray(t,o)!==-1&&(n.prevented=i.isDefaultPrevented())}})},t}),t.define("jpselect2/translation",["jquery","require"],function(e,t){function n(e){this.dict=e||{}}return n.prototype.all=function(){return this.dict},n.prototype.get=function(e){return this.dict[e]},n.prototype.extend=function(t){this.dict=e.extend({},t.all(),this.dict)},n._cache={},n.loadPath=function(e){if(!(e in n._cache)){var i=t(e);n._cache[e]=i}return new n(n._cache[e])},n}),t.define("jpselect2/diacritics",[],function(){var e={"Ⓐ":"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","Ά":"Α","Έ":"Ε","Ή":"Η","Ί":"Ι","Ϊ":"Ι","Ό":"Ο","Ύ":"Υ","Ϋ":"Υ","Ώ":"Ω","ά":"α","έ":"ε","ή":"η","ί":"ι","ϊ":"ι","ΐ":"ι","ό":"ο","ύ":"υ","ϋ":"υ","ΰ":"υ","ω":"ω","ς":"σ"};return e}),t.define("jpselect2/data/base",["../utils"],function(e){function t(e,n){t.__super__.constructor.call(this)}return e.Extend(t,e.Observable),t.prototype.current=function(e){throw new Error("The `current` method must be defined in child classes.")},t.prototype.query=function(e,t){throw new Error("The `query` method must be defined in child classes.")},t.prototype.bind=function(e,t){},t.prototype.destroy=function(){},t.prototype.generateResultId=function(t,n){var i=t.id+"-result-";return i+=e.generateChars(4),i+=null!=n.id?"-"+n.id.toString():"-"+e.generateChars(4)},t}),t.define("jpselect2/data/select",["./base","../utils","jquery"],function(e,t,n){function i(e,t){this.$element=e,this.options=t,i.__super__.constructor.call(this)}return t.Extend(i,e),i.prototype.current=function(e){var t=[],i=this;this.$element.find(":selected").each(function(){var e=n(this),r=i.item(e);t.push(r)}),e(t)},i.prototype.select=function(e){var t=this;if(e.selected=!0,n(e.element).is("option"))return e.element.selected=!0,void this.$element.trigger("change");if(this.$element.prop("multiple"))this.current(function(i){var r=[];e=[e],e.push.apply(e,i);for(var s=0;s<e.length;s++){var o=e[s].id;n.inArray(o,r)===-1&&r.push(o)}t.$element.val(r),
t.$element.trigger("change")});else{var i=e.id;this.$element.val(i),this.$element.trigger("change")}},i.prototype.unselect=function(e){var t=this;if(this.$element.prop("multiple"))return e.selected=!1,n(e.element).is("option")?(e.element.selected=!1,void this.$element.trigger("change")):void this.current(function(i){for(var r=[],s=0;s<i.length;s++){var o=i[s].id;o!==e.id&&n.inArray(o,r)===-1&&r.push(o)}t.$element.val(r),t.$element.trigger("change")})},i.prototype.bind=function(e,t){var n=this;this.container=e,e.on("select",function(e){n.select(e.data)}),e.on("unselect",function(e){n.unselect(e.data)})},i.prototype.destroy=function(){this.$element.find("*").each(function(){n.removeData(this,"data")})},i.prototype.query=function(e,t){var i=[],r=this,s=this.$element.children();s.each(function(){var t=n(this);if(t.is("option")||t.is("optgroup")){var s=r.item(t),o=r.matches(e,s);null!==o&&i.push(o)}}),t({results:i})},i.prototype.addOptions=function(e){t.appendMany(this.$element,e)},i.prototype.option=function(e){var t;e.children?(t=document.createElement("optgroup"),t.label=e.text):(t=document.createElement("option"),void 0!==t.textContent?t.textContent=e.text:t.innerText=e.text),e.id&&(t.value=e.id),e.disabled&&(t.disabled=!0),e.selected&&(t.selected=!0),e.title&&(t.title=e.title);var i=n(t),r=this._normalizeItem(e);return r.element=t,n.data(t,"data",r),i},i.prototype.item=function(e){var t={};if(t=n.data(e[0],"data"),null!=t)return t;if(e.is("option"))t={id:e.val(),text:e.text(),disabled:e.prop("disabled"),selected:e.prop("selected"),title:e.prop("title")};else if(e.is("optgroup")){t={text:e.prop("label"),children:[],title:e.prop("title")};for(var i=e.children("option"),r=[],s=0;s<i.length;s++){var o=n(i[s]),a=this.item(o);r.push(a)}t.children=r}return t=this._normalizeItem(t),t.element=e[0],n.data(e[0],"data",t),t},i.prototype._normalizeItem=function(e){n.isPlainObject(e)||(e={id:e,text:e}),e=n.extend({},{text:""},e);var t={selected:!1,disabled:!1};return null!=e.id&&(e.id=e.id.toString()),null!=e.text&&(e.text=e.text.toString()),null==e._resultId&&e.id&&null!=this.container&&(e._resultId=this.generateResultId(this.container,e)),n.extend({},t,e)},i.prototype.matches=function(e,t){var n=this.options.get("matcher");return n(e,t)},i}),t.define("jpselect2/data/array",["./select","../utils","jquery"],function(e,t,n){function i(e,t){var n=t.get("data")||[];i.__super__.constructor.call(this,e,t),this.addOptions(this.convertToOptions(n))}return t.Extend(i,e),i.prototype.select=function(e){var t=this.$element.find("option").filter(function(t,n){return n.value==e.id.toString()});0===t.length&&(t=this.option(e),this.addOptions(t)),i.__super__.select.call(this,e)},i.prototype.convertToOptions=function(e){function i(e){return function(){return n(this).val()==e.id}}for(var r=this,s=this.$element.find("option"),o=s.map(function(){return r.item(n(this)).id}).get(),a=[],l=0;l<e.length;l++){var c=this._normalizeItem(e[l]);if(n.inArray(c.id,o)>=0){var d=s.filter(i(c)),u=this.item(d),p=n.extend(!0,{},c,u),h=this.option(p);d.replaceWith(h)}else{var f=this.option(c);if(c.children){var m=this.convertToOptions(c.children);t.appendMany(f,m)}a.push(f)}}return a},i}),t.define("jpselect2/data/ajax",["./array","../utils","jquery"],function(e,t,n){function i(e,t){this.ajaxOptions=this._applyDefaults(t.get("ajax")),null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults),i.__super__.constructor.call(this,e,t)}return t.Extend(i,e),i.prototype._applyDefaults=function(e){var t={data:function(e){return n.extend({},e,{q:e.term})},transport:function(e,t,i){var r=n.ajax(e);return r.then(t),r.fail(i),r}};return n.extend({},t,e,!0)},i.prototype.processResults=function(e){return e},i.prototype.query=function(e,t){function i(){var i=s.transport(s,function(i){var s=r.processResults(i,e);r.options.get("debug")&&window.console&&console.error&&(s&&s.results&&n.isArray(s.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response.")),t(s)},function(){r.trigger("results:message",{message:"errorLoading"})});r._request=i}var r=this;null!=this._request&&(n.isFunction(this._request.abort)&&this._request.abort(),this._request=null);var s=n.extend({type:"GET"},this.ajaxOptions);"function"==typeof s.url&&(s.url=s.url.call(this.$element,e)),"function"==typeof s.data&&(s.data=s.data.call(this.$element,e)),this.ajaxOptions.delay&&""!==e.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(i,this.ajaxOptions.delay)):i()},i}),t.define("jpselect2/data/tags",["jquery"],function(e){function t(t,n,i){var r=i.get("tags"),s=i.get("createTag");void 0!==s&&(this.createTag=s);var o=i.get("insertTag");if(void 0!==o&&(this.insertTag=o),t.call(this,n,i),e.isArray(r))for(var a=0;a<r.length;a++){var l=r[a],c=this._normalizeItem(l),d=this.option(c);this.$element.append(d)}}return t.prototype.query=function(e,t,n){function i(e,s){for(var o=e.results,a=0;a<o.length;a++){var l=o[a],c=null!=l.children&&!i({results:l.children},!0),d=l.text===t.term;if(d||c)return!s&&(e.data=o,void n(e))}if(s)return!0;var u=r.createTag(t);if(null!=u){var p=r.option(u);p.attr("data-jpselect2-tag",!0),r.addOptions([p]),r.insertTag(o,u)}e.results=o,n(e)}var r=this;return this._removeOldTags(),null==t.term||null!=t.page?void e.call(this,t,n):void e.call(this,t,i)},t.prototype.createTag=function(t,n){var i=e.trim(n.term);return""===i?null:{id:i,text:i}},t.prototype.insertTag=function(e,t,n){t.unshift(n)},t.prototype._removeOldTags=function(t){var n=(this._lastTag,this.$element.find("option[data-jpselect2-tag]"));n.each(function(){this.selected||e(this).remove()})},t}),t.define("jpselect2/data/tokenizer",["jquery"],function(e){function t(e,t,n){var i=n.get("tokenizer");void 0!==i&&(this.tokenizer=i),e.call(this,t,n)}return t.prototype.bind=function(e,t,n){e.call(this,t,n),this.$search=t.dropdown.$search||t.selection.$search||n.find(".jpselect2-search__field")},t.prototype.query=function(e,t,n){function i(e){r.trigger("select",{data:e})}var r=this;t.term=t.term||"";var s=this.tokenizer(t,this.options,i);s.term!==t.term&&(this.$search.length&&(this.$search.val(s.term),this.$search.focus()),t.term=s.term),e.call(this,t,n)},t.prototype.tokenizer=function(t,n,i,r){for(var s=i.get("tokenSeparators")||[],o=n.term,a=0,l=this.createTag||function(e){return{id:e.term,text:e.term}};a<o.length;){var c=o[a];if(e.inArray(c,s)!==-1){var d=o.substr(0,a),u=e.extend({},n,{term:d}),p=l(u);null!=p?(r(p),o=o.substr(a+1)||"",a=0):a++}else a++}return{term:o}},t}),t.define("jpselect2/data/minimumInputLength",[],function(){function e(e,t,n){this.minimumInputLength=n.get("minimumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",t.term.length<this.minimumInputLength?void this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),t.define("jpselect2/data/maximumInputLength",[],function(){function e(e,t,n){this.maximumInputLength=n.get("maximumInputLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){return t.term=t.term||"",this.maximumInputLength>0&&t.term.length>this.maximumInputLength?void this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:t.term,params:t}}):void e.call(this,t,n)},e}),t.define("jpselect2/data/maximumSelectionLength",[],function(){function e(e,t,n){this.maximumSelectionLength=n.get("maximumSelectionLength"),e.call(this,t,n)}return e.prototype.query=function(e,t,n){var i=this;this.current(function(r){var s=null!=r?r.length:0;return i.maximumSelectionLength>0&&s>=i.maximumSelectionLength?void i.trigger("results:message",{message:"maximumSelected",args:{maximum:i.maximumSelectionLength}}):void e.call(i,t,n)})},e}),t.define("jpselect2/dropdown",["jquery","./utils"],function(e,t){function n(e,t){this.$element=e,this.options=t,n.__super__.constructor.call(this)}return t.Extend(n,t.Observable),n.prototype.render=function(){var t=e('<span class="jpselect2-dropdown"><span class="jpselect2-results"></span></span>');return t.attr("dir",this.options.get("dir")),this.$dropdown=t,t},n.prototype.bind=function(){},n.prototype.position=function(e,t){},n.prototype.destroy=function(){this.$dropdown.remove()},n}),t.define("jpselect2/dropdown/search",["jquery","../utils"],function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),i=e('<span class="jpselect2-search jpselect2-search--dropdown"><input class="jpselect2-search__field" type="search" tabindex="-1" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" role="textbox" /></span>');return this.$searchContainer=i,this.$search=i.find("input"),n.prepend(i),n},n.prototype.bind=function(t,n,i){var r=this;t.call(this,n,i),this.$search.on("keydown",function(e){r.trigger("keypress",e),r._keyUpPrevented=e.isDefaultPrevented()}),this.$search.on("input",function(t){e(this).off("keyup")}),this.$search.on("keyup input",function(e){r.handleSearch(e)}),n.on("open",function(){r.$search.attr("tabindex",0),r.$search.focus(),window.setTimeout(function(){r.$search.focus()},0)}),n.on("close",function(){r.$search.attr("tabindex",-1),r.$search.val("")}),n.on("results:all",function(e){if(null==e.query.term||""===e.query.term){var t=r.showSearch(e);t?r.$searchContainer.removeClass("jpselect2-search--hide"):r.$searchContainer.addClass("jpselect2-search--hide")}})},n.prototype.handleSearch=function(e){if(!this._keyUpPrevented){var t=this.$search.val();this.trigger("query",{term:t})}this._keyUpPrevented=!1},n.prototype.showSearch=function(e,t){return!0},n}),t.define("jpselect2/dropdown/hidePlaceholder",[],function(){function e(e,t,n,i){this.placeholder=this.normalizePlaceholder(n.get("placeholder")),e.call(this,t,n,i)}return e.prototype.append=function(e,t){t.results=this.removePlaceholder(t.results),e.call(this,t)},e.prototype.normalizePlaceholder=function(e,t){return"string"==typeof t&&(t={id:"",text:t}),t},e.prototype.removePlaceholder=function(e,t){for(var n=t.slice(0),i=t.length-1;i>=0;i--){var r=t[i];this.placeholder.id===r.id&&n.splice(i,1)}return n},e}),t.define("jpselect2/dropdown/infiniteScroll",["jquery"],function(e){function t(e,t,n,i){this.lastParams={},e.call(this,t,n,i),this.$loadingMore=this.createLoadingMore(),this.loading=!1}return t.prototype.append=function(e,t){this.$loadingMore.remove(),this.loading=!1,e.call(this,t),this.showLoadingMore(t)&&this.$results.append(this.$loadingMore)},t.prototype.bind=function(t,n,i){var r=this;t.call(this,n,i),n.on("query",function(e){r.lastParams=e,r.loading=!0}),n.on("query:append",function(e){r.lastParams=e,r.loading=!0}),this.$results.on("scroll",function(){var t=e.contains(document.documentElement,r.$loadingMore[0]);if(!r.loading&&t){var n=r.$results.offset().top+r.$results.outerHeight(!1),i=r.$loadingMore.offset().top+r.$loadingMore.outerHeight(!1);n+50>=i&&r.loadMore()}})},t.prototype.loadMore=function(){this.loading=!0;var t=e.extend({},{page:1},this.lastParams);t.page++,this.trigger("query:append",t)},t.prototype.showLoadingMore=function(e,t){return t.pagination&&t.pagination.more},t.prototype.createLoadingMore=function(){var t=e('<li class="jpselect2-results__option jpselect2-results__option--load-more"role="treeitem" aria-disabled="true"></li>'),n=this.options.get("translations").get("loadingMore");return t.html(n(this.lastParams)),t},t}),t.define("jpselect2/dropdown/attachBody",["jquery","../utils"],function(e,t){function n(t,n,i){this.$dropdownParent=i.get("dropdownParent")||e(document.body),t.call(this,n,i)}return n.prototype.bind=function(e,t,n){var i=this,r=!1;e.call(this,t,n),t.on("open",function(){i._showDropdown(),i._attachPositioningHandler(t),r||(r=!0,t.on("results:all",function(){i._positionDropdown(),i._resizeDropdown()}),t.on("results:append",function(){i._positionDropdown(),i._resizeDropdown()}))}),t.on("close",function(){i._hideDropdown(),i._detachPositioningHandler(t)}),this.$dropdownContainer.on("mousedown",function(e){e.stopPropagation()})},n.prototype.destroy=function(e){e.call(this),this.$dropdownContainer.remove()},n.prototype.position=function(e,t,n){t.attr("class",n.attr("class")),t.removeClass("jpselect2"),t.addClass("jpselect2-container--open"),t.css({position:"absolute",top:-999999}),this.$container=n},n.prototype.render=function(t){var n=e("<span></span>"),i=t.call(this);return n.append(i),this.$dropdownContainer=n,n},n.prototype._hideDropdown=function(e){this.$dropdownContainer.detach()},n.prototype._attachPositioningHandler=function(n,i){var r=this,s="scroll.jpselect2."+i.id,o="resize.jpselect2."+i.id,a="orientationchange.jpselect2."+i.id,l=this.$container.parents().filter(t.hasScroll);l.each(function(){e(this).data("jpselect2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),l.on(s,function(t){var n=e(this).data("jpselect2-scroll-position");e(this).scrollTop(n.y)}),e(window).on(s+" "+o+" "+a,function(e){r._positionDropdown(),r._resizeDropdown()})},n.prototype._detachPositioningHandler=function(n,i){var r="scroll.jpselect2."+i.id,s="resize.jpselect2."+i.id,o="orientationchange.jpselect2."+i.id,a=this.$container.parents().filter(t.hasScroll);a.off(r),e(window).off(r+" "+s+" "+o)},n.prototype._positionDropdown=function(){var t=e(window),n=this.$dropdown.hasClass("jpselect2-dropdown--above"),i=this.$dropdown.hasClass("jpselect2-dropdown--below"),r=null,s=this.$container.offset();s.bottom=s.top+this.$container.outerHeight(!1);var o={height:this.$container.outerHeight(!1)};o.top=s.top,o.bottom=s.top+o.height;var a={height:this.$dropdown.outerHeight(!1)},l={top:t.scrollTop(),bottom:t.scrollTop()+t.height()},c=l.top<s.top-a.height,d=l.bottom>s.bottom+a.height,u={left:s.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h=p.offset();u.top-=h.top,u.left-=h.left,n||i||(r="below"),d||!c||n?!c&&d&&n&&(r="below"):r="above",("above"==r||n&&"below"!==r)&&(u.top=o.top-a.height),null!=r&&(this.$dropdown.removeClass("jpselect2-dropdown--below jpselect2-dropdown--above").addClass("jpselect2-dropdown--"+r),this.$container.removeClass("jpselect2-container--below jpselect2-container--above").addClass("jpselect2-container--"+r)),this.$dropdownContainer.css(u)},n.prototype._resizeDropdown=function(){var e={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(e.minWidth=e.width,e.width="auto"),this.$dropdown.css(e)},n.prototype._showDropdown=function(e){this.$dropdownContainer.appendTo(this.$dropdownParent),this._positionDropdown(),this._resizeDropdown()},n}),t.define("jpselect2/dropdown/minimumResultsForSearch",[],function(){function e(t){for(var n=0,i=0;i<t.length;i++){var r=t[i];r.children?n+=e(r.children):n++}return n}function t(e,t,n,i){this.minimumResultsForSearch=n.get("minimumResultsForSearch"),this.minimumResultsForSearch<0&&(this.minimumResultsForSearch=1/0),e.call(this,t,n,i)}return t.prototype.showSearch=function(t,n){return!(e(n.data.results)<this.minimumResultsForSearch)&&t.call(this,n)},t}),t.define("jpselect2/dropdown/selectOnClose",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("close",function(){i._handleSelectOnClose()})},e.prototype._handleSelectOnClose=function(){var e=this.getHighlightedResults();if(!(e.length<1)){var t=e.data("data");null!=t.element&&t.element.selected||null==t.element&&t.selected||this.trigger("select",{data:t})}},e}),t.define("jpselect2/dropdown/closeOnSelect",[],function(){function e(){}return e.prototype.bind=function(e,t,n){var i=this;e.call(this,t,n),t.on("select",function(e){i._selectTriggered(e)}),t.on("unselect",function(e){i._selectTriggered(e)})},e.prototype._selectTriggered=function(e,t){var n=t.originalEvent;n&&n.ctrlKey||this.trigger("close",{})},e}),t.define("jpselect2/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 1!=t&&(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 1!=e.maximum&&(t+="s"),t},noResults:function(){return"No results found"},searching:function(){return"Searching…"}}}),t.define("jpselect2/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(e,t,n,i,r,s,o,a,l,c,d,u,p,h,f,m,g,v,y,_,b,j,w,C,x,$,A,k,P){function O(){this.reset()}O.prototype.apply=function(u){if(u=e.extend(!0,{},this.defaults,u),null==u.dataAdapter){if(null!=u.ajax?u.dataAdapter=f:null!=u.data?u.dataAdapter=h:u.dataAdapter=p,u.minimumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,v)),u.maximumInputLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,y)),u.maximumSelectionLength>0&&(u.dataAdapter=c.Decorate(u.dataAdapter,_)),u.tags&&(u.dataAdapter=c.Decorate(u.dataAdapter,m)),null==u.tokenSeparators&&null==u.tokenizer||(u.dataAdapter=c.Decorate(u.dataAdapter,g)),null!=u.query){var P=t(u.amdBase+"compat/query");u.dataAdapter=c.Decorate(u.dataAdapter,P)}if(null!=u.initSelection){var O=t(u.amdBase+"compat/initSelection");u.dataAdapter=c.Decorate(u.dataAdapter,O)}}if(null==u.resultsAdapter&&(u.resultsAdapter=n,null!=u.ajax&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,C)),null!=u.placeholder&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,w)),u.selectOnClose&&(u.resultsAdapter=c.Decorate(u.resultsAdapter,A))),null==u.dropdownAdapter){if(u.multiple)u.dropdownAdapter=b;else{var E=c.Decorate(b,j);u.dropdownAdapter=E}if(0!==u.minimumResultsForSearch&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,$)),u.closeOnSelect&&(u.dropdownAdapter=c.Decorate(u.dropdownAdapter,k)),null!=u.dropdownCssClass||null!=u.dropdownCss||null!=u.adaptDropdownCssClass){var S=t(u.amdBase+"compat/dropdownCss");u.dropdownAdapter=c.Decorate(u.dropdownAdapter,S)}u.dropdownAdapter=c.Decorate(u.dropdownAdapter,x)}if(null==u.selectionAdapter){if(u.multiple?u.selectionAdapter=r:u.selectionAdapter=i,null!=u.placeholder&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,s)),u.allowClear&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,o)),u.multiple&&(u.selectionAdapter=c.Decorate(u.selectionAdapter,a)),null!=u.containerCssClass||null!=u.containerCss||null!=u.adaptContainerCssClass){var T=t(u.amdBase+"compat/containerCss");u.selectionAdapter=c.Decorate(u.selectionAdapter,T)}u.selectionAdapter=c.Decorate(u.selectionAdapter,l)}if("string"==typeof u.language)if(u.language.indexOf("-")>0){var J=u.language.split("-"),D=J[0];u.language=[u.language,D]}else u.language=[u.language];if(e.isArray(u.language)){var q=new d;u.language.push("en");for(var I=u.language,z=0;z<I.length;z++){var L=I[z],M={};try{M=d.loadPath(L)}catch(H){try{L=this.defaults.amdLanguageBase+L,M=d.loadPath(L)}catch(R){u.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+L+'" could not be automatically loaded. A fallback will be used instead.');continue}}q.extend(M)}u.translations=q}else{var U=d.loadPath(this.defaults.amdLanguageBase+"en"),N=new d(u.language);N.extend(U),u.translations=N}return u},O.prototype.reset=function(){function t(e){function t(e){return u[e]||e}return e.replace(/[^\u0000-\u007E]/g,t)}function n(i,r){if(""===e.trim(i.term))return r;if(r.children&&r.children.length>0){for(var s=e.extend(!0,{},r),o=r.children.length-1;o>=0;o--){var a=r.children[o],l=n(i,a);null==l&&s.children.splice(o,1)}return s.children.length>0?s:n(i,s)}var c=t(r.text).toUpperCase(),d=t(i.term).toUpperCase();return c.indexOf(d)>-1?r:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:c.escapeMarkup,language:P,matcher:n,minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,sorter:function(e){return e},templateResult:function(e){return e.text},templateSelection:function(e){return e.text},theme:"default",width:"resolve"}},O.prototype.set=function(t,n){var i=e.camelCase(t),r={};r[i]=n;var s=c._convertData(r);e.extend(this.defaults,s)};var E=new O;return E}),t.define("jpselect2/options",["require","jquery","./defaults","./utils"],function(e,t,n,i){function r(t,r){if(this.options=t,null!=r&&this.fromElement(r),this.options=n.apply(this.options),r&&r.is("input")){var s=e(this.get("amdBase")+"compat/inputData");this.options.dataAdapter=i.Decorate(this.options.dataAdapter,s)}}return r.prototype.fromElement=function(e){var n=["jpselect2"];null==this.options.multiple&&(this.options.multiple=e.prop("multiple")),null==this.options.disabled&&(this.options.disabled=e.prop("disabled")),null==this.options.language&&(e.prop("lang")?this.options.language=e.prop("lang").toLowerCase():e.closest("[lang]").prop("lang")&&(this.options.language=e.closest("[lang]").prop("lang"))),null==this.options.dir&&(e.prop("dir")?this.options.dir=e.prop("dir"):e.closest("[dir]").prop("dir")?this.options.dir=e.closest("[dir]").prop("dir"):this.options.dir="ltr"),e.prop("disabled",this.options.disabled),e.prop("multiple",this.options.multiple),e.data("jpselect2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-jpselect2-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("jpselect2Tags")),e.data("tags",!0)),e.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."),e.attr("ajax--url",e.data("ajaxUrl")),e.data("ajax--url",e.data("ajaxUrl")));var r={};r=t.fn.jquery&&"1."==t.fn.jquery.substr(0,2)&&e[0].dataset?t.extend(!0,{},e[0].dataset,e.data()):e.data();var s=t.extend(!0,{},r);s=i._convertData(s);for(var o in s)t.inArray(o,n)>-1||(t.isPlainObject(this.options[o])?t.extend(this.options[o],s[o]):this.options[o]=s[o]);return this},r.prototype.get=function(e){return this.options[e]},r.prototype.set=function(e,t){this.options[e]=t},r}),t.define("jpselect2/core",["jquery","./options","./utils","./keys"],function(e,t,n,i){var r=function(e,n){null!=e.data("jpselect2")&&e.data("jpselect2").destroy(),this.$element=e,this.id=this._generateId(e),n=n||{},this.options=new t(n,e),r.__super__.constructor.call(this);var i=e.attr("tabindex")||0;e.data("old-tabindex",i),e.attr("tabindex","-1");var s=this.options.get("dataAdapter");this.dataAdapter=new s(e,this.options);var o=this.render();this._placeContainer(o);var a=this.options.get("selectionAdapter");this.selection=new a(e,this.options),this.$selection=this.selection.render(),this.selection.position(this.$selection,o);var l=this.options.get("dropdownAdapter");this.dropdown=new l(e,this.options),this.$dropdown=this.dropdown.render(),this.dropdown.position(this.$dropdown,o);var c=this.options.get("resultsAdapter");this.results=new c(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var d=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){d.trigger("selection:update",{data:e})}),e.addClass("jpselect2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("jpselect2",this)};return n.Extend(r,n.Observable),r.prototype._generateId=function(e){var t="";return t=null!=e.attr("id")?e.attr("id"):null!=e.attr("name")?e.attr("name")+"-"+n.generateChars(2):n.generateChars(4),t=t.replace(/(:|\.|\[|\]|,)/g,""),t="jpselect2-"+t},r.prototype._placeContainer=function(e){e.insertAfter(this.$element);var t=this._resolveWidth(this.$element,this.options.get("width"));null!=t&&e.css("width",t)},r.prototype._resolveWidth=function(e,t){var n=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==t){var i=this._resolveWidth(e,"style");return null!=i?i:this._resolveWidth(e,"element")}if("element"==t){var r=e.outerWidth(!1);return r<=0?"auto":r+"px"}if("style"==t){var s=e.attr("style");if("string"!=typeof s)return null;for(var o=s.split(";"),a=0,l=o.length;a<l;a+=1){var c=o[a].replace(/\s/g,""),d=c.match(n);if(null!==d&&d.length>=1)return d[1]}return null}return t},r.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)},r.prototype._registerDomEvents=function(){var t=this;this.$element.on("change.jpselect2",function(){t.dataAdapter.current(function(e){t.trigger("selection:update",{data:e})})}),this._sync=n.bind(this._syncAttributes,this),this.$element[0].attachEvent&&this.$element[0].attachEvent("onpropertychange",this._sync);var i=window.MutationObserver||window.WebKitMutationObserver||window.MozMutationObserver;null!=i?(this._observer=new i(function(n){e.each(n,t._sync)}),this._observer.observe(this.$element[0],{attributes:!0,subtree:!1})):this.$element[0].addEventListener&&this.$element[0].addEventListener("DOMAttrModified",t._sync,!1)},r.prototype._registerDataEvents=function(){var e=this;this.dataAdapter.on("*",function(t,n){e.trigger(t,n)})},r.prototype._registerSelectionEvents=function(){var t=this,n=["toggle","focus"];this.selection.on("toggle",function(){t.toggleDropdown()}),this.selection.on("focus",function(e){t.focus(e)}),this.selection.on("*",function(i,r){e.inArray(i,n)===-1&&t.trigger(i,r)})},r.prototype._registerDropdownEvents=function(){var e=this;this.dropdown.on("*",function(t,n){e.trigger(t,n)})},r.prototype._registerResultsEvents=function(){var e=this;this.results.on("*",function(t,n){e.trigger(t,n)})},r.prototype._registerEvents=function(){var e=this;this.on("open",function(){e.$container.addClass("jpselect2-container--open")}),this.on("close",function(){e.$container.removeClass("jpselect2-container--open")}),this.on("enable",function(){e.$container.removeClass("jpselect2-container--disabled")}),this.on("disable",function(){e.$container.addClass("jpselect2-container--disabled")}),this.on("blur",function(){e.$container.removeClass("jpselect2-container--focus")}),this.on("query",function(t){e.isOpen()||e.trigger("open",{}),this.dataAdapter.query(t,function(n){e.trigger("results:all",{data:n,query:t})})}),this.on("query:append",function(t){this.dataAdapter.query(t,function(n){e.trigger("results:append",{data:n,query:t})})}),this.on("keypress",function(t){var n=t.which;e.isOpen()?n===i.ESC||n===i.TAB||n===i.UP&&t.altKey?(e.close(),t.preventDefault()):n===i.ENTER?(e.trigger("results:select",{}),t.preventDefault()):n===i.SPACE&&t.ctrlKey?(e.trigger("results:toggle",{}),t.preventDefault()):n===i.UP?(e.trigger("results:previous",{}),t.preventDefault()):n===i.DOWN&&(e.trigger("results:next",{}),t.preventDefault()):(n===i.ENTER||n===i.SPACE||n===i.DOWN&&t.altKey)&&(e.open(),t.preventDefault())})},r.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",{})},r.prototype.trigger=function(e,t){var n=r.__super__.trigger,i={open:"opening",close:"closing",select:"selecting",unselect:"unselecting"};if(void 0===t&&(t={}),e in i){var s=i[e],o={prevented:!1,name:e,args:t};if(n.call(this,s,o),o.prevented)return void(t.prevented=!0)}n.call(this,e,t)},r.prototype.toggleDropdown=function(){this.options.get("disabled")||(this.isOpen()?this.close():this.open())},r.prototype.open=function(){this.isOpen()||this.trigger("query",{})},r.prototype.close=function(){this.isOpen()&&this.trigger("close",{})},r.prototype.isOpen=function(){return this.$container.hasClass("jpselect2-container--open")},r.prototype.hasFocus=function(){return this.$container.hasClass("jpselect2-container--focus")},r.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("jpselect2-container--focus"),this.trigger("focus",{}))},r.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `jpselect2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.'),null!=e&&0!==e.length||(e=[!0]);var t=!e[0];this.$element.prop("disabled",t)},r.prototype.data=function(){this.options.get("debug")&&arguments.length>0&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `jpselect2("data")`. You should consider setting the value instead using `$element.val()`.');var e=[];return this.dataAdapter.current(function(t){e=t}),e},r.prototype.val=function(t){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `jpselect2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==t||0===t.length)return this.$element.val();var n=t[0];e.isArray(n)&&(n=e.map(n,function(e){return e.toString()})),this.$element.val(n).trigger("change")},r.prototype.destroy=function(){this.$container.remove(),this.$element[0].detachEvent&&this.$element[0].detachEvent("onpropertychange",this._sync),null!=this._observer?(this._observer.disconnect(),this._observer=null):this.$element[0].removeEventListener&&this.$element[0].removeEventListener("DOMAttrModified",this._sync,!1),this._sync=null,this.$element.off(".jpselect2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("jpselect2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("jpselect2"),this.dataAdapter.destroy(),this.selection.destroy(),this.dropdown.destroy(),this.results.destroy(),this.dataAdapter=null,this.selection=null,this.dropdown=null,this.results=null},r.prototype.render=function(){var t=e('<span class="jpselect2 jpselect2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return t.attr("dir",this.options.get("dir")),this.$container=t,this.$container.addClass("jpselect2-container--"+this.options.get("theme")),t.data("element",this.$element),t},r}),t.define("jpselect2/compat/utils",["jquery"],function(e){function t(t,n,i){var r,s,o=[];r=e.trim(t.attr("class")),r&&(r=""+r,e(r.split(/\s+/)).each(function(){0===this.indexOf("jpselect2-")&&o.push(this)})),r=e.trim(n.attr("class")),r&&(r=""+r,e(r.split(/\s+/)).each(function(){0!==this.indexOf("jpselect2-")&&(s=i(this),null!=s&&o.push(s))})),t.attr("class",o.join(" "))}return{syncCssClasses:t}}),t.define("jpselect2/compat/containerCss",["jquery","./utils"],function(e,t){function n(e){return null}function i(){}return i.prototype.render=function(i){var r=i.call(this),s=this.options.get("containerCssClass")||"";e.isFunction(s)&&(s=s(this.$element));var o=this.options.get("adaptContainerCssClass");if(o=o||n,s.indexOf(":all:")!==-1){s=s.replace(":all:","");var a=o;o=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("containerCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(r,this.$element,o),r.css(l),r.addClass(s),r},i}),t.define("jpselect2/compat/dropdownCss",["jquery","./utils"],function(e,t){
function n(e){return null}function i(){}return i.prototype.render=function(i){var r=i.call(this),s=this.options.get("dropdownCssClass")||"";e.isFunction(s)&&(s=s(this.$element));var o=this.options.get("adaptDropdownCssClass");if(o=o||n,s.indexOf(":all:")!==-1){s=s.replace(":all:","");var a=o;o=function(e){var t=a(e);return null!=t?t+" "+e:e}}var l=this.options.get("dropdownCss")||{};return e.isFunction(l)&&(l=l(this.$element)),t.syncCssClasses(r,this.$element,o),r.css(l),r.addClass(s),r},i}),t.define("jpselect2/compat/initSelection",["jquery"],function(e){function t(e,t,n){n.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=n.get("initSelection"),this._isInitialized=!1,e.call(this,t,n)}return t.prototype.current=function(t,n){var i=this;return this._isInitialized?void t.call(this,n):void this.initSelection.call(null,this.$element,function(t){i._isInitialized=!0,e.isArray(t)||(t=[t]),n(t)})},t}),t.define("jpselect2/compat/inputData",["jquery"],function(e){function t(e,t,n){this._currentData=[],this._valueSeparator=n.get("valueSeparator")||",","hidden"===t.prop("type")&&n.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 `<select>` element instead."),e.call(this,t,n)}return t.prototype.current=function(t,n){function i(t,n){var r=[];return t.selected||e.inArray(t.id,n)!==-1?(t.selected=!0,r.push(t)):t.selected=!1,t.children&&r.push.apply(r,i(t.children,n)),r}for(var r=[],s=0;s<this._currentData.length;s++){var o=this._currentData[s];r.push.apply(r,i(o,this.$element.val().split(this._valueSeparator)))}n(r)},t.prototype.select=function(t,n){if(this.options.get("multiple")){var i=this.$element.val();i+=this._valueSeparator+n.id,this.$element.val(i),this.$element.trigger("change")}else this.current(function(t){e.map(t,function(e){e.selected=!1})}),this.$element.val(n.id),this.$element.trigger("change")},t.prototype.unselect=function(e,t){var n=this;t.selected=!1,this.current(function(e){for(var i=[],r=0;r<e.length;r++){var s=e[r];t.id!=s.id&&i.push(s.id)}n.$element.val(i.join(n._valueSeparator)),n.$element.trigger("change")})},t.prototype.query=function(e,t,n){for(var i=[],r=0;r<this._currentData.length;r++){var s=this._currentData[r],o=this.matches(t,s);null!==o&&i.push(o)}n({results:i})},t.prototype.addOptions=function(t,n){var i=e.map(n,function(t){return e.data(t[0],"data")});this._currentData.push.apply(this._currentData,i)},t}),t.define("jpselect2/compat/matcher",["jquery"],function(e){function t(t){function n(n,i){var r=e.extend(!0,{},i);if(null==n.term||""===e.trim(n.term))return r;if(i.children){for(var s=i.children.length-1;s>=0;s--){var o=i.children[s],a=t(n.term,o.text,o);a||r.children.splice(s,1)}if(r.children.length>0)return r}return t(n.term,i.text,i)?r:null}return n}return t}),t.define("jpselect2/compat/query",[],function(){function e(e,t,n){n.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."),e.call(this,t,n)}return e.prototype.query=function(e,t,n){t.callback=n;var i=this.options.get("query");i.call(null,t)},e}),t.define("jpselect2/dropdown/attachContainer",[],function(){function e(e,t,n){e.call(this,t,n)}return e.prototype.position=function(e,t,n){var i=n.find(".dropdown-wrapper");i.append(t),t.addClass("jpselect2-dropdown--below"),n.addClass("jpselect2-container--below")},e}),t.define("jpselect2/dropdown/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);var i=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$dropdown.on(i.join(" "),function(e){e.stopPropagation()})},e}),t.define("jpselect2/selection/stopPropagation",[],function(){function e(){}return e.prototype.bind=function(e,t,n){e.call(this,t,n);var i=["blur","change","click","dblclick","focus","focusin","focusout","input","keydown","keyup","keypress","mousedown","mouseenter","mouseleave","mousemove","mouseover","mouseup","search","touchend","touchstart"];this.$selection.on(i.join(" "),function(e){e.stopPropagation()})},e}),function(n){"function"==typeof t.define&&t.define.amd?t.define("jquery-mousewheel",["jquery"],n):"object"==typeof exports?module.exports=n:n(e)}(function(e){function t(t){var o=t||window.event,a=l.call(arguments,1),c=0,u=0,p=0,h=0,f=0,m=0;if(t=e.event.fix(o),t.type="mousewheel","detail"in o&&(p=o.detail*-1),"wheelDelta"in o&&(p=o.wheelDelta),"wheelDeltaY"in o&&(p=o.wheelDeltaY),"wheelDeltaX"in o&&(u=o.wheelDeltaX*-1),"axis"in o&&o.axis===o.HORIZONTAL_AXIS&&(u=p*-1,p=0),c=0===p?u:p,"deltaY"in o&&(p=o.deltaY*-1,c=p),"deltaX"in o&&(u=o.deltaX,0===p&&(c=u*-1)),0!==p||0!==u){if(1===o.deltaMode){var g=e.data(this,"mousewheel-line-height");c*=g,p*=g,u*=g}else if(2===o.deltaMode){var v=e.data(this,"mousewheel-page-height");c*=v,p*=v,u*=v}if(h=Math.max(Math.abs(p),Math.abs(u)),(!s||h<s)&&(s=h,i(o,h)&&(s/=40)),i(o,h)&&(c/=40,u/=40,p/=40),c=Math[c>=1?"floor":"ceil"](c/s),u=Math[u>=1?"floor":"ceil"](u/s),p=Math[p>=1?"floor":"ceil"](p/s),d.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();f=t.clientX-y.left,m=t.clientY-y.top}return t.deltaX=u,t.deltaY=p,t.deltaFactor=s,t.offsetX=f,t.offsetY=m,t.deltaMode=0,a.unshift(t,c,u,p),r&&clearTimeout(r),r=setTimeout(n,200),(e.event.dispatch||e.event.handle).apply(this,a)}}function n(){s=null}function i(e,t){return d.settings.adjustOldDeltas&&"mousewheel"===e.type&&t%120===0}var r,s,o=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],a="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],l=Array.prototype.slice;if(e.event.fixHooks)for(var c=o.length;c;)e.event.fixHooks[o[--c]]=e.event.mouseHooks;var d=e.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var n=a.length;n;)this.addEventListener(a[--n],t,!1);else this.onmousewheel=t;e.data(this,"mousewheel-line-height",d.getLineHeight(this)),e.data(this,"mousewheel-page-height",d.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var n=a.length;n;)this.removeEventListener(a[--n],t,!1);else this.onmousewheel=null;e.removeData(this,"mousewheel-line-height"),e.removeData(this,"mousewheel-page-height")},getLineHeight:function(t){var n=e(t),i=n["offsetParent"in e.fn?"offsetParent":"parent"]();return i.length||(i=e("body")),parseInt(i.css("fontSize"),10)||parseInt(n.css("fontSize"),10)||16},getPageHeight:function(t){return e(t).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};e.fn.extend({mousewheel:function(e){return e?this.bind("mousewheel",e):this.trigger("mousewheel")},unmousewheel:function(e){return this.unbind("mousewheel",e)}})}),t.define("jquery.jpselect2",["jquery","jquery-mousewheel","./jpselect2/core","./jpselect2/defaults"],function(e,t,n,i){if(null==e.fn.jpselect2){var r=["open","close","destroy"];e.fn.jpselect2=function(t){if(t=t||{},"object"==typeof t)return this.each(function(){var i=e.extend(!0,{},t);new n(e(this),i)}),this;if("string"==typeof t){var i;return this.each(function(){var n=e(this).data("jpselect2");null==n&&window.console&&console.error&&console.error("The jpselect2('"+t+"') method was called on an element that is not using Select2.");var r=Array.prototype.slice.call(arguments,1);i=n[t].apply(n,r)}),e.inArray(t,r)>-1?this:i}throw new Error("Invalid arguments for Select2: "+t)}}return null==e.fn.jpselect2.defaults&&(e.fn.jpselect2.defaults=i),n}),{define:t.define,require:t.require}}(),n=t.require("jquery.jpselect2");return e.fn.jpselect2.amd=t,n}),function(e,t){t(e,e.jQuery||e.Zepto||e.ender||e.$)}(this,function(e,t){function n(e,n){function r(e,t,n){return e[t]=n,e}function s(e,t){var n,s=e.match(i.key);try{t=JSON.parse(t)}catch(a){}for(;void 0!==(n=s.pop());)if(i.push.test(n)){var l=o(e.replace(/\[\]$/,""));t=r([],l,t)}else i.fixed.test(n)?t=r([],n,t):i.named.test(n)&&(t=r({},n,t));return t}function o(e){return void 0===h[e]&&(h[e]=0),h[e]++}function a(e){switch(t('[name="'+e.name+'"]',n).attr("type")){case"checkbox":return"on"===e.value||e.value;default:return e.value}}function l(t){if(!i.validate.test(t.name))return this;var n=s(t.name,a(t));return p=e.extend(!0,p,n),this}function c(t){if(!e.isArray(t))throw new Error("formSerializer.addPairs expects an Array");for(var n=0,i=t.length;n<i;n++)this.addPair(t[n]);return this}function d(){return p}function u(){return JSON.stringify(d())}var p={},h={};this.addPair=l,this.addPairs=c,this.serialize=d,this.serializeJSON=u}var i={validate:/^[a-z_][a-z0-9_-]*(?:\[(?:\d*|[a-z0-9_-]+)\])*$/i,key:/[a-z0-9_-]+|(?=\[\])/gi,push:/^$/,fixed:/^\d+$/,named:/^[a-z0-9_-]+$/i};return n.patterns=i,n.serializeObject=function(){var e;return e=this.is("form")?this.serializeArray():this.find(":input").serializeArray(),new n(t,this).addPairs(e).serialize()},n.serializeJSON=function(){var e;return e=this.is("form")?this.serializeArray():this.find(":input").serializeArray(),new n(t,this).addPairs(e).serializeJSON()},"undefined"!=typeof t.fn&&(t.fn.serializeObject=n.serializeObject,t.fn.serializeJSON=n.serializeJSON),e.FormSerializer=n,n});var JPCC,wpActiveEditor=!0;!function(e){function t(){var e={},t=function(t,n,i){"boolean"==typeof n&&(i=n,n=!1);var r=n?n.selector+" "+t:t;return(void 0===e[r]||i)&&(e[r]=n?n.find(t):jQuery(t)),e[r]};return t.elementCache=e,t}var n,i,r,s=e("html"),o=e(document),a="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]",l=jp_cc_vars.I10n,c={EncodeType:"entity",isEmpty:function(e){return!e||(null===e||0==e.length||/^\s+$/.test(e))},arr1:[" ","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ",""","&","<",">","Œ","œ","Š","š","Ÿ","ˆ","˜"," "," "," ","‌","‍","‎","‏","–","—","‘","’","‚","“","”","„","†","‡","‰","‹","›","€","ƒ","Α","Β","Γ","Δ","Ε","Ζ","Η","Θ","Ι","Κ","Λ","Μ","Ν","Ξ","Ο","Π","Ρ","Σ","Τ","Υ","Φ","Χ","Ψ","Ω","α","β","γ","δ","ε","ζ","η","θ","ι","κ","λ","μ","ν","ξ","ο","π","ρ","ς","σ","τ","υ","φ","χ","ψ","ω","ϑ","ϒ","ϖ","•","…","′","″","‾","⁄","℘","ℑ","ℜ","™","ℵ","←","↑","→","↓","↔","↵","⇐","⇑","⇒","⇓","⇔","∀","∂","∃","∅","∇","∈","∉","∋","∏","∑","−","∗","√","∝","∞","∠","∧","∨","∩","∪","∫","∴","∼","≅","≈","≠","≡","≤","≥","⊂","⊃","⊄","⊆","⊇","⊕","⊗","⊥","⋅","⌈","⌉","⌊","⌋","⟨","⟩","◊","♠","♣","♥","♦"],arr2:[" ","¡","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","­","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾","¿","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","×","Ø","Ù","Ú","Û","Ü","Ý","Þ","ß","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","÷","ø","ù","ú","û","ü","ý","þ","ÿ",""","&","<",">","Œ","œ","Š","š","Ÿ","ˆ","˜"," "," "," ","‌","‍","‎","‏","–","—","‘","’","‚","“","”","„","†","‡","‰","‹","›","€","ƒ","Α","Β","Γ","Δ","Ε","Ζ","Η","Θ","Ι","Κ","Λ","Μ","Ν","Ξ","Ο","Π","Ρ","Σ","Τ","Υ","Φ","Χ","Ψ","Ω","α","β","γ","δ","ε","ζ","η","θ","ι","κ","λ","μ","ν","ξ","ο","π","ρ","ς","σ","τ","υ","φ","χ","ψ","ω","ϑ","ϒ","ϖ","•","…","′","″","‾","⁄","℘","ℑ","ℜ","™","ℵ","←","↑","→","↓","↔","↵","⇐","⇑","⇒","⇓","⇔","∀","∂","∃","∅","∇","∈","∉","∋","∏","∑","−","∗","√","∝","∞","∠","∧","∨","∩","∪","∫","∴","∼","≅","≈","≠","≡","≤","≥","⊂","⊃","⊄","⊆","⊇","⊕","⊗","⊥","⋅","⌈","⌉","⌊","⌋","〈","〉","◊","♠","♣","♥","♦"],HTML2Numerical:function(e){return this.swapArrayVals(e,this.arr1,this.arr2)},NumericalToHTML:function(e){return this.swapArrayVals(e,this.arr2,this.arr1)},numEncode:function(e){if(this.isEmpty(e))return"";for(var t=[],n=e.length,i=0;i<n;i++){var r=e.charAt(i);r<" "||r>"~"?(t.push("&#"),t.push(r.charCodeAt()),t.push(";")):t.push(r)}return t.join("")},htmlDecode:function(e){var t,n,i=e;if(this.isEmpty(i))return"";i=this.HTML2Numerical(i);var r=i.match(/&#[0-9]{1,5};/g);if(null!=r)for(var s=0;s<r.length;s++)n=r[s],t=n.substring(2,n.length-1),i=t>=-32768&&t<=65535?i.replace(n,String.fromCharCode(t)):i.replace(n,"");return i},htmlEncode:function(e,t){return this.isEmpty(e)?"":(t=t||!1,t&&(e="numerical"==this.EncodeType?e.replace(/&/g,"&"):e.replace(/&/g,"&")),e=this.XSSEncode(e,!1),"numerical"!=this.EncodeType&&t||(e=this.HTML2Numerical(e)),e=this.numEncode(e),t||(e=e.replace(/&#/g,"##AMPHASH##"),e="numerical"==this.EncodeType?e.replace(/&/g,"&"):e.replace(/&/g,"&"),e=e.replace(/##AMPHASH##/g,"&#")),e=e.replace(/&#\d*([^\d;]|$)/g,"$1"),t||(e=this.correctEncoding(e)),"entity"==this.EncodeType&&(e=this.NumericalToHTML(e)),e)},XSSEncode:function(e,t){return this.isEmpty(e)?"":(t=t||!0,t?(e=e.replace(/\'/g,"'"),e=e.replace(/\"/g,"""),e=e.replace(/</g,"<"),e=e.replace(/>/g,">")):(e=e.replace(/\'/g,"'"),e=e.replace(/\"/g,"""),e=e.replace(/</g,"<"),e=e.replace(/>/g,">")),e)},hasEncoded:function(e){return!!/&#[0-9]{1,5};/g.test(e)||!!/&[A-Z]{2,6};/gi.test(e)},stripUnicode:function(e){return e.replace(/[^\x20-\x7E]/g,"")},correctEncoding:function(e){return e.replace(/(&)(amp;)+/,"$1")},swapArrayVals:function(e,t,n){if(this.isEmpty(e))return"";var i;if(t&&n&&t.length==n.length)for(var r=0,s=t.length;r<s;r++)i=new RegExp(t[r],"g"),e=e.replace(i,n[r]);return e},inArray:function(e,t){for(var n=0,i=t.length;n<i;n++)if(t[n]===e)return n;return-1}};c.EncodeType="entity",JPCC={forms:{init:function(){JPCC.forms.checkDependencies()},checkDependencies:function(t){var n=e(t);t=n.length?n:e("[data-jp-cc-dependencies]:not([data-jp-cc-processed-dependencies])"),t.each(function(){var t,n=e(this),i=n.data("id"),r=n.data("jp-cc-processed-dependencies")||{},s=Object.keys(r).length,o=0,a=n.data("jp-cc-dependent-fields");if(!n.data("jp-cc-processed-dependencies")){r=n.data("jp-cc-dependencies"),"string"==typeof r&&(r=JSON.parse(r));for(t in r)r.hasOwnProperty(t)&&("string"==typeof r[t]?r[t].indexOf(",")!==-1?r[t]=r[t].split(","):r[t]=[r[t]]:"number"==typeof r[t]&&(r[t]=[r[t]]));s=Object.keys(r).length,n.data("jp-cc-processed-dependencies",r).attr("data-jp-cc-processed-dependencies",r)}a||(a=e.map(r,function(t,n){var i=e('.jp-cc-field[data-id="'+n+'"]');return i.length?i.eq(0):null}),n.data("jp-cc-dependent-fields",a)),e(a).each(function(){var t,a=e(this),l=a.find(":input:first"),c=a.data("id"),d=l.val(),u=r[c],p=a.data("jp-cc-field-dependents")||[];if(p.indexOf(i)===-1&&(p.push(i),a.data("jp-cc-field-dependents",p)),"undefined"==typeof u||null===u)return n.removeClass("jp-cc-dependencies-met").hide(0).trigger("jpCCFormDependencyUnmet"),!1;if(a.hasClass("jp-cc-field-radio")&&(d=a.find(":input:checked").val()),a.hasClass("jp-cc-field-multicheck")&&(d=[],a.find(":checkbox:checked").each(function(t){d[t]=e(this).val(),"string"!=typeof d[t]||isNaN(parseInt(d[t]))||(d[t]=parseInt(d[t]))})),a.hasClass("jp-cc-field-select")||a.hasClass("jp-cc-field-radio"))t=u&&u.indexOf(d)!==-1;else if(a.hasClass("jp-cc-field-checkbox"))t=u===l.is(":checked");else if(a.hasClass("jp-cc-field-multicheck"))if(Array.isArray(u)){t=!1;for(var h=0;h<u.length;h++)d.indexOf(u[h])!==-1&&(t=!0)}else t=d.indexOf(u)!==-1;else t=Array.isArray(u)?u.indexOf(d)!==-1:u==d;return t?(o++,void(o===s&&n.addClass("jp-cc-dependencies-met").show(0).trigger("jpCCFormDependencyMet"))):(n.removeClass("jp-cc-dependencies-met").hide(0).trigger("jpCCFormDependencyUnmet"),!1)})})},form_check:function(){e(document).trigger("jp_cc_form_check")},flattenFields:function(e){var t={},n=e.tabs||{},i=e.sections||{},r=e.fields||{};return Object.keys(n).length&&Object.keys(i).length?_.each(r,function(e,n){"object"==typeof e&&Object.keys(e).length&&_.each(e,function(e,n){if("object"==typeof e&&Object.keys(e).length){if(forms.is_field(e)){var i={};i[n]=e,n="main",e=i}_.each(e,function(e){t[e.id]=e})}})}):Object.keys(n).length?_.each(r,function(e,n){"object"==typeof e&&Object.keys(e).length&&_.each(e,function(e){t[e.id]=e})}):Object.keys(i).length?_.each(r,function(e,n){_.each(e,function(e){t[e.id]=e})}):(r=forms.parseFields(r,values),_.each(r,function(e){t[e.id]=e})),t},parseFields:function(e,t){return t=t||{},_.each(e,function(n,i){e[i]=JPCC.models.field(n),"object"!=typeof e[i].meta&&(e[i].meta={}),void 0!==t[i]&&(e[i].value=t[i]),""===e[i].id&&(e[i].id=i)}),e},renderTab:function(){},renderSection:function(){},render:function(t,n,i){var r,s=[],o={},a=e.extend(!0,{id:"",tabs:{},sections:{},fields:{},maintabs:{},subtabs:{}},t),l=e.extend({id:a.id,classes:[],tabs:{},vertical:!0,form:!0,meta:{"data-min-height":250}},a.maintabs),c=e.extend({classes:["link-tabs","sub-tabs"],tabs:{}},a.subtabs),d=["jp-cc-dynamic-form"];return n=n||{},Object.keys(a.tabs).length&&Object.keys(a.sections).length?(d.push("tabbed-content"),_.each(a.fields,function(t,i){"object"==typeof t&&Object.keys(t).length&&(void 0===l.tabs[i]&&(l.tabs[i]={label:a.tabs[i],content:""}),c=e.extend(c,{id:a.id+"-"+i+"-subtabs",tabs:{}}),_.each(t,function(e,t){if("object"==typeof e&&Object.keys(e).length){if(forms.is_field(e)){var r={};r[t]=e,t="main",e=r}void 0===c.tabs[t]&&(c.tabs[t]={label:a.sections[i][t],content:""}),e=forms.parseFields(e,n),_.each(e,function(e){o[e.id]=e,c.tabs[t].content+=JPCC.templates.field(e)}),""===c.tabs[t].content&&delete c.tabs[t]}}),Object.keys(c.tabs).length?l.tabs[i].content=JPCC.templates.tabs(c):delete l.tabs[i])}),Object.keys(l.tabs).length&&(r=JPCC.templates.tabs(l))):Object.keys(a.tabs).length?(d.push("tabbed-content"),_.each(a.fields,function(e,t){"object"==typeof e&&Object.keys(e).length&&(void 0===l.tabs[t]&&(l.tabs[t]={label:a.tabs[t],content:""}),s=[],e=forms.parseFields(e,n),_.each(e,function(e){o[e.id]=e,s.push(JPCC.templates.field(e))}),s.length?l.tabs[t].content=JPCC.templates.section({fields:s}):delete l.tabs[t])}),Object.keys(l.tabs).length&&(r=JPCC.templates.tabs(l))):Object.keys(a.sections).length?_.each(a.fields,function(e,t){s=[],s.push(JPCC.templates.field({type:"heading",desc:a.sections[t]||""})),e=forms.parseFields(e,n),_.each(e,function(e){o[e.id]=e,s.push(JPCC.templates.field(e))}),r+=JPCC.templates.section({fields:s})}):(a.fields=forms.parseFields(a.fields,n),_.each(a.fields,function(e){o[e.id]=e,s.push(JPCC.templates.field(e))}),r=JPCC.templates.section({fields:s})),void 0!==i&&i.length&&i.addClass(d.join(" ")).data("form_fields",o).html(r).trigger("jp_cc_init"),r},parseValues:function(e,t){if(t=t||!1,!t)return e;for(var n in t)t.hasOwnProperty(n)&&(e.hasOwnProperty(n+"_unit")&&(e[n]+=e[n+"_unit"],delete e[n+"_unit"]),"undefined"!=typeof e[n]?t[n].allow_html&&!JPCC.utils.htmlencoder.hasEncoded(e[n])&&(e[n]=JPCC.utils.htmlencoder.htmlEncode(e[n])):"checkbox"===t[n].type&&(e[n]=!1));return e},select:function(){var t=e(this),n=t.parents(".jp-cc-field").data("id"),i=t.val(),r=e(".jp-cc-field").filter('[class*="'+n+'--"]');r.hide(),r.filter("."+n+"--"+i).show()},checkbox:function(){var t=e(this),n=t.parents(".jp-cc-field").data("id"),i=t.is(":checked"),r=n+"--",s=e(".jp-cc-field").filter('[class*="'+r+'"]');i?(s.filter("."+n+"--checked").show(),s.filter("."+n+"--unchecked").hide()):(s.filter("."+n+"--checked").show(),s.filter("."+n+"--unchecked").hide())}},models:{field:function(t){return e.extend(!0,{},{type:"text",id:"",id_prefix:"",name:"",label:null,placeholder:"",desc:null,dynamic_desc:null,size:"regular",classes:[],dependencies:"",value:null,select2:!1,allow_html:!1,multiple:!1,as_array:!1,options:[],object_type:null,object_key:null,std:null,min:0,max:50,step:1,unit:"px",units:{},required:!1,desc_position:"bottom",meta:{}},t)}},selectors:new t,utils:{htmlencoder:c,convert_meta_to_object:function(e){var t,n,i,r={};for(i in e)e.hasOwnProperty(i)&&(t=i.split(/_(.+)?/)[0],n=i.split(/_(.+)?/)[1],void 0===r[t]&&(r[t]={}),r[t][n]=e[i]);return r},object_to_array:function(e){var t,n=[];if("object"==typeof e){for(t in e)n.push(e[t]);e=n}return e},convert_hex:function(e,t){if(void 0===e)return"";void 0===t&&(t=100),e=e.replace("#","");var n=parseInt(e.substring(0,2),16),i=parseInt(e.substring(2,4),16),r=parseInt(e.substring(4,6),16),s="rgba("+n+","+i+","+r+","+t/100+")";return s},debounce:function(e,t){var n;return function(){var i=this,r=arguments;window.clearTimeout(n),n=window.setTimeout(function(){e.apply(i,r)},t)}},throttle:function(e,t){var n=!1,i=function(){n=!1};return function(){n||(e(),window.setTimeout(i,t),n=!0)}}},wp_editor:function(t){var n,i=new RegExp("jp_cc_id","g");return"undefined"==typeof tinyMCEPreInit||"undefined"==typeof QTags||"undefined"==typeof jp_cc_wpeditor_vars?(console.warn("js_wp_editor( $settings ); must be loaded"),this):(n={mode:"html",mceInit:{theme:"modern",skin:"lightgray",language:"en",formats:{alignleft:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"left"},deep:!1,remove:"none"},{selector:"img,table,dl.wp-caption",classes:["alignleft"],deep:!1,remove:"none"}],aligncenter:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"center"},deep:!1,remove:"none"},{selector:"img,table,dl.wp-caption",classes:["aligncenter"],deep:!1,remove:"none"}],alignright:[{selector:"p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li",styles:{textAlign:"right"},deep:!1,remove:"none"},{selector:"img,table,dl.wp-caption",classes:["alignright"],deep:!1,remove:"none"}],strikethrough:{inline:"del",deep:!0,split:!0}},relative_urls:!1,remove_script_host:!1,convert_urls:!1,browser_spellcheck:!0,fix_list_elements:!0,entities:"38,amp,60,lt,62,gt",entity_encoding:"raw",keep_styles:!1,paste_webkit_styles:"font-weight font-style color",preview_styles:"font-family font-size font-weight font-style text-decoration text-transform",wpeditimage_disable_captions:!1,wpeditimage_html5_captions:!1,plugins:"charmap,hr,media,paste,tabfocus,textcolor,fullscreen,wordpress,wpeditimage,wpgallery,wplink,wpdialogs,wpview,image",content_css:jp_cc_wpeditor_vars.includes_url+"css/dashicons.css?ver=3.9,"+jp_cc_wpeditor_vars.includes_url+"js/mediaelement/mediaelementplayer.min.css?ver=3.9,"+jp_cc_wpeditor_vars.includes_url+"js/mediaelement/wp-mediaelement.css?ver=3.9,"+jp_cc_wpeditor_vars.includes_url+"js/tinymce/skins/wordpress/wp-content.css?ver=3.9",selector:"#jp_cc_id",resize:"vertical",menubar:!1,wpautop:!0,indent:!1,toolbar1:"bold,italic,strikethrough,bullist,numlist,blockquote,hr,alignleft,aligncenter,alignright,link,unlink,wp_more,spellchecker,fullscreen,wp_adv",toolbar2:"formatselect,underline,alignjustify,forecolor,pastetext,removeformat,charmap,outdent,indent,undo,redo,wp_help",toolbar3:"",toolbar4:"",tabfocus_elements:":prev,:next",body_class:"jp_cc_id"}},tinyMCEPreInit.mceInit.jp_cc_id&&(n.mceInit=tinyMCEPreInit.mceInit.jp_cc_id),t=e.extend(!0,{},n,t),this.each(function(){var n=e(this),r=n.attr("id"),s={};void 0!==tinyMCE.editors[r]&&tinyMCE.remove(tinymce.editors[r]),n.is("textarea")||(console.warn("Element must be a textarea"),n.closest(".wp-editor-wrap").length&&(s.editor_wrap=n.closest(".wp-editor-wrap"),s.field_parent=s.editor_wrap.parent(),s.editor_wrap.before(n.clone()),s.editor_wrap.remove(),n=s.field_parent.find('textarea[id="'+r+'"]'))),n.addClass("wp-editor-area").show(),e.each(t.mceInit,function(n,s){"string"==e.type(s)&&(t.mceInit[n]=s.replace(i,r))}),t.mode="tmce"==t.mode?"tmce":"html",tinyMCEPreInit.mceInit[r]=t.mceInit;var o=e('<div id="wp-'+r+'-wrap" class="wp-core-ui wp-editor-wrap '+t.mode+'-active" />'),a=e('<div id="wp-'+r+'-editor-tools" class="wp-editor-tools hide-if-no-js" />'),l=e('<div class="wp-editor-tabs" />'),c=e('<a id="'+r+'-html" class="wp-switch-editor switch-html" data-wp-editor-id="'+r+'">Text</a>'),d=e('<a id="'+r+'-tmce" class="wp-switch-editor switch-tmce" data-wp-editor-id="'+r+'">Visual</a>'),u=e('<div id="wp-'+r+'-media-buttons" class="wp-media-buttons" />'),p=e('<a href="#" id="insert-media-button" class="button insert-media add_media" data-editor="'+r+'" title="Add Media"><span class="wp-media-buttons-icon"></span> Add Media</a>'),h=e('<div id="wp-'+r+'-editor-container" class="wp-editor-container" />'),f=!1;p.appendTo(u),u.appendTo(a),c.appendTo(l),d.appendTo(l),l.appendTo(a),a.appendTo(o),h.appendTo(o),h.append(n.clone().addClass("wp-editor-area")),f!==!1&&e.each(f,function(){e('link[href="'+this+'"]').length||n.before('<link rel="stylesheet" type="text/css" href="'+this+'">')}),n.before('<link rel="stylesheet" id="editor-buttons-css" href="'+jp_cc_wpeditor_vars.includes_url+'css/editor.css" type="text/css" media="all">'),n.before(o),n.remove(),new QTags(r),QTags._buttonsInit(),switchEditors.go(r,t.mode),e(".insert-media",o).on("click",function(t){var n=e(t.currentTarget),i={frame:"post",state:"insert",title:wp.media.view.l10n.addMedia,multiple:!0};t.preventDefault(),n.blur(),n.hasClass("gallery")&&(i.state="gallery",i.title=wp.media.view.l10n.createGalleryTitle),wp.media.editor.open(r,i)})}))},templates:{render:function(e,t){var n=wp.template(e);return t=t||{},void 0!==t.classes&&Array.isArray(t.classes)&&(t.classes=t.classes.join(" ")),t=JPCC.templates.prepareMeta(t),n(t)},renderInline:function(e,t){var n={evaluate:/<#([\s\S]+?)#>/g,interpolate:/\{\{\{([\s\S]+?)\}\}\}/g,escape:/\{\{([^\}]+?)\}\}(?!\})/g,variable:"data"},i=_.template(e,null,n);return i(t)},shortcode:function(t){var n=e.extend(!0,{},{tag:"",meta:{},has_content:!1,content:""},t),i=n.has_content?"jp-cc-shortcode-w-content":"jp-cc-shortcode";return JPCC.templates.render(i,n)},modal:function(t){var n=e.extend(!0,{},{id:"",title:"",description:"",classes:"",save_button:l.save,cancel_button:l.cancel,content:""},t);return JPCC.templates.render("jp-cc-modal",n)},tabs:function(t){return t=e.extend(!0,{},{id:"",vertical:!0,form:!0,classes:[],tabs:{general:{label:"General",content:""}},meta:{}},t),"string"==typeof t.classes&&(t.classes=[t.classes]),t.form&&t.classes.push("jp-cc-tabbed-form"),t.meta["data-tab-count"]=Object.keys(t.tabs).length,t.classes.push(t.vertical?"vertical-tabs":"horizontal-tabs"),t.classes=t.classes.join(" "),JPCC.templates.render("jp-cc-tabs",t)},section:function(t){var n=e.extend(!0,{},{classes:[],fields:[]},t);return JPCC.templates.render("jp-cc-field-section",n)},fieldArgs:function(t){var n=[],i=e.extend(!0,{},JPCC.models.field(t));switch(void 0===t.std||"checkbox"===t.type||null!==i.value&&i.value!==!1||(i.value=t.std),"string"==typeof i.classes&&(i.classes=i.classes.split(" ")),void 0!==t["class"]&&i.classes.push(t["class"]),void 0!==t.dependencies&&"object"==typeof t.dependencies&&(i.dependencies=JSON.stringify(t.dependencies)),i.required&&(i.meta.required=!0,i.classes.push("jp-cc-required")),"string"==typeof i.dynamic_desc&&i.dynamic_desc.length&&(i.classes.push("jp-cc-field-dynamic-desc"),i.desc=JPCC.templates.renderInline(i.dynamic_desc,i)),i.allow_html&&(i.classes.push("jp-cc-field-"+i.type+"--html"),"string"==typeof i.value&&""!==i.value&&JPCC.utils.htmlencoder.hasEncoded(i.value)&&(i.value=JPCC.utils.htmlencoder.htmlDecode(i.value))),t.type){case"select":case"objectselect":case"postselect":case"taxonomyselect":void 0!==i.options&&(_.each(i.options,function(e,t){var r,s,o=!1;"object"!=typeof e?(null!==i.value&&(i.multiple&&("string"==typeof i.value&&i.value==t||Array.isArray(i.value)&&i.value.indexOf(t)!==-1||!Array.isArray(i.value)&&"object"==typeof i.value&&Object.keys(i.value).length&&void 0!==i.value[t])?o="selected":i.multiple||i.value!=t||(o="selected")),n.push(JPCC.templates.prepareMeta({label:e,value:t,meta:{selected:o}}))):(r=t,s=[],_.each(e,function(e,t){var n=!1;null!==i.value&&(i.multiple&&("string"==typeof i.value&&i.value==t||Array.isArray(i.value)&&i.value.indexOf(t)!==-1||!Array.isArray(i.value)&&"object"==typeof i.value&&Object.keys(i.value).length&&void 0!==i.value[t])?n="selected":i.multiple||i.value!=t||(n="selected")),s.push(JPCC.templates.prepareMeta({label:e,value:t,meta:{selected:n}}))}),n.push({label:r,options:s}))}),i.options=n),i.multiple&&(i.meta.multiple=!0,i.as_array&&(i.name+="[]"),i.value&&i.value.length||(i.value=[]),"string"==typeof i.value&&(i.value=[i.value])),"select"!==t.type&&(i.select2=!0,i.classes.push("jp-cc-field-objectselect"),i.classes.push("postselect"===t.type?"jp-cc-field-postselect":"jp-cc-field-taxonomyselect"),i.meta["data-objecttype"]="postselect"===t.type?"post_type":"taxonomy",i.meta["data-objectkey"]="postselect"===t.type?t.post_type:t.taxonomy,i.meta["data-current"]="object"==typeof i.value||Array.isArray(i.value)?JSON.stringify(i.value):i.value),i.select2&&(i.classes.push("jp-cc-field-select2"),
i.classes.push("jpselect2"),i.placeholder&&(i.meta["data-placeholder"]=i.placeholder));break;case"radio":void 0!==i.options&&(_.each(i.options,function(e,t){n.push(JPCC.templates.prepareMeta({label:e,value:t,meta:{checked:i.value===t}}))}),i.options=n);break;case"multicheck":void 0!==i.options&&(i.value!==!1&&null!==i.value||(i.value=[]),"string"==typeof i.value&&i.value.indexOf(",")&&(i.value=i.value.split(",")),i.as_array&&(i.name+="[]"),_.each(i.options,function(e,t){n.push(JPCC.templates.prepareMeta({label:e,value:t,meta:{checked:Array.isArray(i.value)&&i.value.indexOf(t)!==-1||!Array.isArray(i.value)&&"object"==typeof i.value&&Object.keys(i.value).length&&void 0!==i.value[t]}}))}),i.options=n);break;case"checkbox":switch(typeof i.value){case"object":Array.isArray(i.value)&&1===i.value.length&&"1"===i.value[0].toString()&&(i.value=!0,i.meta.checked=!0);break;case"boolean":i.value&&(i.meta.checked=!0);break;case"string":"true"!==i.value&&"yes"!==i.value&&"1"!==i.value||(i.meta.checked=!0);break;case"number":(1===parseInt(i.value,10)||parseInt(i.value,10)>0)&&(i.meta.checked=!0)}break;case"rangeslider":i.meta.step=i.step,i.meta.min=i.min,i.meta.max=i.max,i.meta["data-force-minmax"]=i.force_minmax.toString();break;case"textarea":i.meta.cols=i.cols,i.meta.rows=i.rows;break;case"measure":"string"==typeof i.value&&""!==i.value?(i.number=parseInt(i.value),i.unitValue=i.value.replace(i.number,""),i.value=i.number):i.unitValue=null,void 0!==i.units&&(_.each(i.units,function(e,t){var r=!1;i.unitValue==t&&(r="selected"),n.push(JPCC.templates.prepareMeta({label:e,value:t,meta:{selected:r}}))}),i.units=n);break;case"color":"string"==typeof i.value&&""!==i.value&&(i.meta["data-default-color"]=i.value);break;case"license_key":i.value=e.extend({key:"",license:{},messages:[],status:"empty",expires:!1,classes:!1},i.value),i.classes.push("jp-cc-license-"+i.value.status+"-notice"),i.value.classes&&i.classes.push(i.value.classes)}return i},field:function(t){var n,i=JPCC.templates.fieldArgs(t);return n="jp-cc-field-"+i.type,"objectselfect"!==i.type&&"postselect"!==i.type&&"taxonomyselect"!==i.type||(n="jp-cc-field-select"),e("#tmpl-"+n).length?(i.field=JPCC.templates.render(n,i),JPCC.templates.render("jp-cc-field-wrapper",i)):(console.warn("No field template found for type:"+i.type+" fieldID: "+i.id),"")},prepareMeta:function(e){var t,n=[];for(t in e.meta)e.meta.hasOwnProperty(t)&&("boolean"==typeof e.meta[t]?e.meta[t]&&n.push(_.escape(t)):n.push(_.escape(t)+'="'+_.escape(e.meta[t])+'"'));return e.meta=n.join(" "),e}},modals:{_current:null,forceFocus:function(e){JPCC.modals._current&&!JPCC.modals._current.contains(e.target)&&(e.stopPropagation(),JPCC.modals._current.focus())},trapEscapeKey:function(e){27===e.keyCode&&(JPCC.modals.closeAll(),e.preventDefault())},trapTabKey:function(t){if(9===t.keyCode){var n=JPCC.modals._current.find("*").filter(a).filter(":visible"),i=e(":focus"),r=n.length,s=n.index(i);t.shiftKey?0===s&&(n.get(r-1).focus(),t.preventDefault()):s===r-1&&(n.get(0).focus(),t.preventDefault())}},setFocusToFirstItem:function(){JPCC.modals._current.find(".jp-cc-modal-content *").filter(a).filter(":visible").first().focus()},closeAll:function(t){e(".jp-cc-modal-background").off("keydown.jp_cc_modal").hide(0,function(){e("html").css({overflow:"visible",width:"auto"}),n&&(n.attr("aria-hidden","false"),n=null),i.length&&i.focus(),JPCC.modals._current=null,o.off("focus.jp_cc_modal"),void 0!==t&&t()}).attr("aria-hidden","true")},show:function(t,r){e(".jp-cc-modal-background").off("keydown.jp_cc_modal").hide(0).attr("aria-hidden","true"),s.data("origwidth",s.innerWidth()).css({overflow:"hidden",width:s.innerWidth()});var o=e(":focus");o.parents(".jp-cc-modal-wrap").length||(i=o),JPCC.modals._current=e(t),JPCC.modals._current.on("keydown.jp_cc_modal",function(e){JPCC.modals.trapEscapeKey(e),JPCC.modals.trapTabKey(e)}).show(0,function(){n=e("body > *").filter(":visible").not(JPCC.modals._current),n.attr("aria-hidden","true"),JPCC.modals._current.trigger("jp_cc_init").on("focus.jp_cc_modal",JPCC.modals.forceFocus),JPCC.modals.setFocusToFirstItem(),void 0!==r&&r()}).attr("aria-hidden","false")},remove:function(t){e(t).remove()},replace:function(t,n){JPCC.modals.remove(e.trim(t)),e("body").append(e.trim(n))},reload:function(e,t,n){JPCC.modals.replace(e,t),JPCC.modals.show(e,n)}},tabs:{init:function(){e(".jp-cc-tabs-container").filter(":not(.initialized)").each(function(){var t=e(this),n=t.find(".tab:first");t.hasClass("vertical-tabs")&&t.css({minHeight:t.find(".tabs").eq(0).outerHeight(!0)}),t.find(".active").removeClass("active"),n.addClass("active"),e(n.find("a").attr("href")).addClass("active"),t.addClass("initialized")})}},select2:{init:function(){e(".jpselect2 select").filter(":not(.jpselect2-initialized)").each(function(){var t=e(this),n=t.data("current")||t.val(),i=t.data("objecttype"),r=t.data("objectkey"),s=t.data("objectexcludes")||null,o={width:"100%",multiple:!1,dropdownParent:t.parent()};t.attr("multiple")&&(o.multiple=!0),i&&r&&(o=e.extend(o,{ajax:{url:ajaxurl,dataType:"json",delay:250,data:function(e){return{s:e.term,paged:e.page,action:"jp_cc_object_search",object_type:i,object_key:r,exclude:s}},processResults:function(e,t){return t.page=t.page||1,{results:e.items,pagination:{more:10*t.page<e.total_count}}},cache:!0},cache:!0,escapeMarkup:function(e){return e},maximumInputLength:20,closeOnSelect:!o.multiple,templateResult:JPCC.select2.formatObject,templateSelection:JPCC.select2.formatObjectSelection})),t.addClass("jpselect2-initialized").jpselect2(o),null!==n&&void 0!==n?o.multiple&&"object"!=typeof n&&""!==n?n=[n]:o.multiple||""!==n||(n=null):n=null,i&&r&&null!==n&&("number"==typeof n||n.length)?e.ajax({url:ajaxurl,data:{action:"jp_cc_object_search",object_type:i,object_key:r,exclude:s,include:n&&n.length?"string"==typeof n||"number"==typeof n?[n]:n:null},dataType:"json",success:function(i){e.each(i.items,function(e,n){t.find('option[value="'+n.id+'"]').length||t.prepend('<option value="'+n.id+'">'+n.text+"</option>")}),t.val(n).trigger("change")}}):n&&(o.multiple&&n.length||!o.multiple&&""!==n)?t.val(n).trigger("change"):null===n&&t.val(n).trigger("change")})},formatObject:function(e){return e.text},formatObjectSelection:function(e){return e.text||e.text}},restrictions:{_last_index:0,_is_edit:!1,_open_modal:null,template:{row:function(t){var n=e.extend(!0,{},{index:"",title:"",who:"",roles:[],conditions:[]},t);return JPCC.templates.render("jp-cc-restriction-table-row",n)}},add:function(){var t=e("table#jp-cc-restrictions tbody.has-items tr"),n=t.length?t.last().index()+1:0;JPCC.restrictions._is_edit=!1,JPCC.restrictions.renderForm(n)},edit:function(t){var n=e(t.target),i=n.parents("tr"),r=i.data("index"),s=i.length?i.serializeObject().jp_cc_settings.restrictions[0]:null;JPCC.restrictions._is_edit=!0,JPCC.restrictions.renderForm(r,s)},refresh:function(t){var n=e("table#jp-cc-restrictions tbody.has-items"),i=t||n.serializeObject().jp_cc_settings.restrictions,r=0;n.find("tr").remove(),_.each(i,function(e){var t=e;t.index=r,n.append(JPCC.restrictions.template.row(t)),r++})},save:function(t){var n=JPCC.restrictions._modal.data("restriction_index"),i=JPCC.restrictions._modal.find(".jp-cc-form"),r=i.serializeObject(),s=e("table#jp-cc-restrictions tbody"),o=s.find('> tr[data-index="'+n+'"]'),a=e.extend(!0,{},{index:n},r),l=JPCC.restrictions.template.row(a);o.length?o.replaceWith(l):(s.filter(".no-items").hide(),s.filter(".has-items").show().append(l)),JPCC.restrictions.autosave(),void 0!==t&&t()},remove:function(t){var n=e(void 0!==t.target?t.target:t),i=n.parents("tr"),r=n.parents("table");i.remove(),r.find("tbody.has-items tr[data-index]").length||r.find("tbody.no-items").show()},renderForm:function(t,n){var i,r,s={},o=["jp-cc-restriction-editor"],a=e.extend(!0,{},{id:"jp-cc-restriction-editor",label:l.restriction_modal.title,description:l.restriction_modal.description,values:n||{index:t},sections:{general:l.tabs.general,protection:l.tabs.protection,content:l.tabs.content},fields:jp_cc_restriction_fields});void 0===n&&(n={}),Object.keys(a.sections).length?(o.push("tabbed-content"),void 0===i&&(i={}),_.each(a.fields,function(e,t){void 0===i[t]&&(i[t]=[]),_.each(e,function(e,s){r=e,void 0!==n[e.id]&&(r.value=n[e.id]),i[t].push(JPCC.templates.field(r))}),i[t]=JPCC.templates.section({fields:i[t]})}),_.each(i,function(e,t){s[t]={label:a.sections[t],content:e}}),s=JPCC.templates.tabs({id:a.id,classes:"",tabs:s}),modal_content=s):(void 0===i&&(i=[]),_.each(a.fields,function(e,t){r=e,void 0!==n[e.id]&&(r.value=n[e.id]),i.push(JPCC.templates.field(r))}),modal_content=JPCC.templates.section({fields:i})),JPCC.restrictions._modal=JPCC.templates.modal({id:a.id,title:a.label,description:a.description,save_button:JPCC.restrictions._is_edit?l.update:l.add,classes:o,content:modal_content,meta:{"data-restriction_index":t}}),JPCC.modals.reload("#"+a.id,JPCC.restrictions._modal,function(){JPCC.restrictions._modal=JPCC.modals._current,JPCC.restrictions._modal.find(".jp-cc-form").submit(function(e){e.preventDefault(),JPCC.restrictions.save(function(){JPCC.modals.closeAll(function(){JPCC.restrictions._modal.remove()})})})})},autosave:function(){var t=e("table#jp-cc-restrictions tbody.has-items"),n=t.serializeObject().jp_cc_settings.restrictions;wp.ajax.send("jp_cc_options_autosave",{success:function(e){},error:function(e){console.log(e)},data:{nonce:jp_cc_vars.nonce,key:"restrictions",value:n}})}},conditions:{get_conditions:function(){return window.jp_cc_conditions_selectlist},not_operand_checkbox:function(t){return t=t||e(".jp-cc-not-operand"),t.each(function(){var t=e(this),n=t.find("input");n.prop("checked",!n.is(":checked")),JPCC.conditions.toggle_not_operand(t)})},toggle_not_operand:function(t){return t=t||e(".jp-cc-not-operand"),t.each(function(){var t=e(this),n=t.find("input"),i=t.find(".is"),r=t.find(".not"),s=t.parents(".jp-cc-facet-target");n.is(":checked")?(i.hide(),r.show(),s.addClass("not-operand-checked")):(i.show(),r.hide(),s.removeClass("not-operand-checked"))})},template:{editor:function(t){var n=e.extend(!0,{},{groups:[]},t);return n.groups=JPCC.utils.object_to_array(n.groups),JPCC.templates.render("jp-cc-condition-editor",n)},group:function(t){var n,i=e.extend(!0,{},{index:"",facets:[]},t);for(i.facets=JPCC.utils.object_to_array(i.facets),n=0;i.facets.length>n;n++)i.facets[n].index=n,i.facets[n].group=i.index;return JPCC.templates.render("jp-cc-condition-group",i)},facet:function(t){var n=e.extend(!0,{},{group:"",index:"",target:"",not_operand:!1,settings:{}},t);return JPCC.templates.render("jp-cc-condition-facet",n)},settings:function(t,n){var i=[],r=e.extend(!0,{},{index:"",group:"",target:null,fields:[]},t);return r.fields.length||void 0===jp_cc_conditions[t.target]||(r.fields=jp_cc_conditions[t.target].fields),void 0===n&&(n={}),_.each(r.fields,function(e,t){e=JPCC.models.field(e),"object"!=typeof e.meta&&(e.meta={}),void 0!==n[t]&&(e.value=n[t]),e.name="conditions["+r.group+"]["+r.index+"][settings]["+t+"]",""===e.id&&(e.id="conditions_"+r.group+"_"+r.index+"_settings_"+t),i.push(JPCC.templates.field(e))}),JPCC.templates.section({fields:i})},selectbox:function(t){var n=e.extend(!0,{},{id:null,name:null,type:"select",group:"",index:"",value:null,select2:!0,classes:["facet-target","facet-select"],options:JPCC.conditions.get_conditions()},t);return null===n.id&&(n.id="conditions_"+n.group+"_"+n.index+"_target"),null===n.name&&(n.name="conditions["+n.group+"]["+n.index+"][target]"),JPCC.templates.field(n)}},groups:{add:function(t,n,i){var r=e(t),s={index:r.find(".facet-group-wrap").length,facets:[{target:n||null,not_operand:i||!1,settings:{}}]};r.find(".facet-groups").append(JPCC.conditions.template.group(s)),r.addClass("has-conditions")},remove:function(t){var n=t.parents(".facet-builder");t.prev(".facet-group-wrap").find(".and .add-facet").removeClass("disabled"),t.remove(),JPCC.conditions.renumber(),0===n.find(".facet-group-wrap").length&&(n.removeClass("has-conditions"),e("#jp-cc-first-condition").val(null).trigger("change"))}},facets:{add:function(e,t,n){var i={group:e.data("index"),index:e.find(".facet").length,target:t||null,not_operand:n||!1,settings:{}};e.find(".facet-list").append(JPCC.conditions.template.facet(i))},remove:function(e){var t=e.parents(".facet-group-wrap");e.remove(),0===t.find(".facet").length?JPCC.conditions.groups.remove(t):JPCC.conditions.renumber()}},renumber:function(){e(".facet-builder .facet-group-wrap").each(function(){var t=e(this),n=t.parent().children().index(t);t.data("index",n).find(".facet").each(function(){var t=e(this),i=t.parent().children().index(t);t.data("index",i).find("[name]").each(function(){this.name=this.name.replace(/conditions\[\d*?\]\[\d*?\]/,"conditions["+n+"]["+i+"]"),this.id=this.id.replace(/conditions_\d*?_\d*?_/,"conditions_"+n+"_"+i+"_")})})})}},checked:function(e,t,n){"use strict";var i=!1;return"object"==typeof e&&"string"==typeof t&&jQuery.inArray(t,e)!==-1?i=!0:"object"==typeof t&&"string"==typeof e&&jQuery.inArray(e,t)!==-1?i=!0:e===t?i=!0:e==t&&(i=!0),void 0!==n&&n?i?' checked="checked"':"":i},selected:function(e,t,n){"use strict";var i=!1;return"object"==typeof e&&"string"==typeof t&&jQuery.inArray(t,e)!==-1?i=!0:"object"==typeof t&&"string"==typeof e&&jQuery.inArray(e,t)!==-1?i=!0:e===t&&(i=!0),void 0!==n&&n?i?' selected="selected"':"":i}},e.fn.wp_editor=JPCC.wp_editor,e(document).on("jp_cc_init",function(){JPCC.tabs.init(),JPCC.select2.init(),JPCC.conditions.renumber(),JPCC.conditions.toggle_not_operand(),e(".jp-cc-field-editor textarea:not(.initialized)").each(function(){var t=e(this).addClass("initialized");t.wp_editor({mode:"tmce"})})}).on("mousedown",".jp-cc-submit button",function(t){var n=e(t.target).parents("form").eq(0);tinyMCE.triggerSave(),n.trigger("jp_cc_before_submit")}).on("jp_cc_init jp_cc_form_check",function(){JPCC.forms.init()}).on("jpCCFieldChanged",".jp-cc-field",function(){var t,n=e(this),i=n.data("jp-cc-field-dependents")||[],r=e();if(i&&!(i.length<=0)){for(t=0;t<i.length;t++)r=r.add('.jp-cc-field[data-id="'+i[t]+'"]');JPCC.forms.checkDependencies(r)}}).on("jpCCFieldChanged",".jp-cc-field-dynamic-desc",function(){var t=e(this),n=t.find(":input"),i=t.parents(".jp-cc-dynamic-form:first"),r=n.val(),s=i.data("form_fields")||{},o=s[t.data("id")]||{},a=t.find(".jp-cc-desc"),l=t.data("jp-cc-dynamic-desc");switch(o.type){case"radio":r=t.find(":input:checked").val()}o.value=r,l&&l.length&&a.html(JPCC.templates.renderInline(l,o))}).on("change",".jp-cc-field-select select",function(){e(this).parents(".jp-cc-field").trigger("jpCCFieldChanged")}).on("click",".jp-cc-field-checkbox input",function(){e(this).parents(".jp-cc-field").trigger("jpCCFieldChanged")}).on("click",".jp-cc-field-multicheck input",function(){e(this).parents(".jp-cc-field").trigger("jpCCFieldChanged")}).on("click",".jp-cc-field-radio input",function(t){var n=e(this),i=n.parents("li"),r=n.parents(".jp-cc-field");r.trigger("jpCCFieldChanged"),r.find("li.jp-cc-selected").removeClass("jp-cc-selected"),i.addClass("jp-cc-selected")}).on("click",".jp-cc-tabs-container .tab",function(t){var n=e(this),i=n.parents(".jp-cc-tabs-container:first"),r=n.find("a").attr("href");i.find(".active").removeClass("active"),n.addClass("active"),e(r).addClass("active"),t.preventDefault()}).on("click",".add_new_restriction",function(e){JPCC.restrictions.add()}).on("click",".edit_restriction",function(e){JPCC.restrictions.edit(e)}).on("click",".remove_restriction",function(e){confirm(l.restrictions.confirm_remove)&&JPCC.restrictions.remove(e)}).on("click",".bulkactions .button",function(t){var n=e("#jp-cc-restrictions tbody.has-items .check-column input:checked");switch(e(this).prev().val()){case"trash":JPCC.restrictions.remove(n)}e("#cb-select-all, #cb-select-all-1").prop("checked",!1),e(".bulkactions select").val(-1)}).on("click",".jp-cc-modal-background, .jp-cc-modal-wrap .cancel, .jp-cc-modal-wrap .jp-cc-modal-close",function(t){var n=e(t.target);(n.hasClass("cancel")||n.hasClass("jp-cc-modal-close")||n.hasClass("submitdelete"))&&(JPCC.modals.closeAll(),t.preventDefault(),t.stopPropagation())}).on("select2:select jpselect2:select","#jp-cc-first-condition",function(t){var n=e(this),i=n.parents(".facet-builder").eq(0),r=n.val(),s=i.find("#jp-cc-first-facet-operand"),o=s.is(":checked");JPCC.conditions.groups.add(i,r,o),n.val(null).trigger("change"),s.prop("checked",!1).parents(".jp-cc-facet-target, .face-target").removeClass("not-operand-checked"),e(document).trigger("jp_cc_init")}).on("click",".facet-builder .jp-cc-not-operand",function(){JPCC.conditions.not_operand_checkbox(e(this))}).on("change",".facet-builder .facet-target select",function(t){var n=e(this),i=n.parents(".facet"),r=n.val(),s={target:r};""!==r&&r!==i.data("target")&&(i.data("target",r).find(".facet-settings").html(JPCC.conditions.template.settings(s)),e(document).trigger("jp_cc_init"))}).on("click",".facet-builder .facet-group-wrap:last-child .and .add-facet",function(){JPCC.conditions.groups.add(e(this).parents(".facet-builder").eq(0)),e(document).trigger("jp_cc_init")}).on("click",".facet-builder .add-or .add-facet:not(.disabled)",function(){JPCC.conditions.facets.add(e(this).parents(".facet-group-wrap").eq(0)),e(document).trigger("jp_cc_init")}).on("click",".facet-builder .remove-facet",function(){JPCC.conditions.facets.remove(e(this).parents(".facet").eq(0)),e(document).trigger("jp_cc_init")}).on("click",".jp-cc-field-link button",function(t){var n=e(this).next().select(),i=n.attr("id");return r=n,wpLink.open(i,n.val(),""),JPCC.selectors("#wp-link-wrap").removeClass("has-text-field"),JPCC.selectors("#wp-link-target").hide(),JPCC.selectors("#jp-cc-restriction-editor",!0).hide(),!1}).on("click","#wp-link-submit, #wp-link-cancel button, #wp-link-close",function(e){var t=wpLink.getAttrs();if(void 0!==r&&r)return"wp-link-submit"===e.target.id&&r.val(t.href),wpLink.textarea=r,wpLink.close(),r=!1,JPCC.selectors("#jp-cc-restriction-editor").show(),e.preventDefault?e.preventDefault():e.returnValue=!1,e.stopPropagation(),!1}).ready(function(){var t=e("table#jp-cc-restrictions tbody");t.length&&(void 0!==jp_cc_restrictions&&jp_cc_restrictions.length&&(t.filter(".has-items").show(),t.filter(".no-items").hide(),JPCC.restrictions.refresh(jp_cc_restrictions)),t.sortable({handle:".dashicons-menu",stop:function(e,t){JPCC.restrictions.refresh(),JPCC.restrictions.autosave()}}))})}(jQuery);
Back to Directory
File Manager