Popup Maker – Popup Forms, Optins & More - Version 1.7.7

Version Description

Download this release

Release Info

Developer danieliser
Plugin Icon 128x128 Popup Maker – Popup Forms, Optins & More
Version 1.7.7
Comparing to
See all releases

Code changes from version 1.7.6 to 1.7.7

assets/js/admin-general.js CHANGED
@@ -7576,8 +7576,8 @@ function pumChecked(val1, val2, print) {
7576
  };
7577
 
7578
  if (typeof $.fn !== "undefined") {
7579
- $.fn.pumSerializeObject = $.fn.serializeObject = FormSerializer.serializeObject;
7580
- $.fn.pumSerializeJSON = $.fn.serializeJSON = FormSerializer.serializeJSON;
7581
  }
7582
 
7583
  exports.FormSerializer = FormSerializer;
7576
  };
7577
 
7578
  if (typeof $.fn !== "undefined") {
7579
+ $.fn.pumSerializeObject = FormSerializer.serializeObject;
7580
+ $.fn.pumSerializeJSON = FormSerializer.serializeJSON;
7581
  }
7582
 
7583
  exports.FormSerializer = FormSerializer;
assets/js/admin-general.min.js CHANGED
@@ -1,4 +1,4 @@
1
  function pumSelected(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}function pumChecked(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?' checked="checked"':"":i}!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.pumselect2&&e.fn.pumselect2.amd)var t=e.fn.pumselect2.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,u,c,d,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&&A.test(e[o])&&(e[o]=e[o].replace(A,"")),e=h.slice(0,h.length-1).concat(e),c=0;c<e.length;c+=1)if(p=e[c],"."===p)e.splice(c,1),c-=1;else if(".."===p){if(1===c&&(".."===e[2]||".."===e[0]))break;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((h||m)&&f){for(n=e.split("/"),c=n.length;c>0;c-=1){if(i=n.slice(0,c).join("/"),h)for(d=h.length;d>0;d-=1)if(r=f[h.slice(0,d).join("/")],r&&(r=r[i])){s=r,a=c;break}if(s)break;!l&&m&&m[i]&&(l=m[i],u=c)}!s&&l&&(s=l,a=u),s&&(n.splice(0,a,s),e=n.join("/"))}return e}function o(e,n){return function(){var i=w.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 u(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 c(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 d(e){return function(){return y&&y.config&&y.config[e]||{}}}var p,h,f,m,g={},v={},y={},_={},b=Object.prototype.hasOwnProperty,w=[].slice,A=/\.js$/;f=function(e,t){var n,i=c(e),r=i[0];return e=i[1],r&&(r=s(r,t),n=u(r)),r?e=n&&n.normalize?n.normalize(e,a(t)):s(e,t):(e=s(e,t),i=c(e),r=i[0],e=i[1],r&&(n=u(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:d(e)}}},p=function(e,n,i,s){var a,c,d,p,h,y,b=[],w=typeof i;if(s=s||e,"undefined"===w||"function"===w){for(n=!n.length&&i.length?["require","exports","module"]:n,h=0;h<n.length;h+=1)if(p=f(n[h],s),c=p.f,"require"===c)b[h]=m.require(e);else if("exports"===c)b[h]=m.exports(e),y=!0;else if("module"===c)a=b[h]=m.module(e);else if(r(g,c)||r(v,c)||r(_,c))b[h]=u(c);else{if(!p.p)throw new Error(e+" missing "+c);p.p.load(p.n,o(s,!0),l(c),{}),b[h]=g[c]}d=i?i.apply(g[e],b):void 0,e&&(a&&a.exports!==t&&a.exports!==g[e]?g[e]=a.exports:d===t&&y||(g[e]=d))}else e&&(g[e]=i)},e=n=h=function(e,n,i,r,s){if("string"==typeof e)return m[e]?m[e](n):u(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("pumselect2/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 u=(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)}}),c=0;c<s.length;c++){var d=s[c];i.prototype[d]=u(d)}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={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};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("pumselect2/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="pumselect2-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="pumselect2-results__option"></li>'),r=this.options.get("translations").get(t.message);i.append(n(r(t.args))),i[0].className+=" pumselect2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".pumselect2-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(".pumselect2-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(".pumselect2-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="pumselect2-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="pumselect2-results__group";e(a);this.template(t,a);for(var l=[],u=0;u<t.children.length;u++){var c=t.children[u],d=this.option(c);l.push(d)}var p=e("<ul></ul>",{"class":"pumselect2-results__options pumselect2-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("pumselect2-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",".pumselect2-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",".pumselect2-results__option[aria-selected]",function(t){var n=e(this).data("data");i.getHighlightedResults().removeClass("pumselect2-results__option--highlighted"),i.trigger("results:focus",{data:n,element:e(this)})})},n.prototype.getHighlightedResults=function(){var e=this.$results.find(".pumselect2-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("pumselect2/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("pumselect2/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="pumselect2-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.pumselect2."+t.id,function(t){var n=e(t.target),i=n.closest(".pumselect2"),r=e(".pumselect2.pumselect2-container--open");r.each(function(){var t=e(this);if(this!=i[0]){var n=t.data("element");n.pumselect2("close")}})})},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.pumselect2."+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("pumselect2/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("pumselect2-selection--single"),e.html('<span class="pumselect2-selection__rendered"></span><span class="pumselect2-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(".pumselect2-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(".pumselect2-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(".pumselect2-selection__rendered"),i=this.display(t,n);n.empty().append(i),n.prop("title",t.title||t.text)},r}),t.define("pumselect2/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("pumselect2-selection--multiple"),e.html('<ul class="pumselect2-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",".pumselect2-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(".pumselect2-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="pumselect2-selection__choice"><span class="pumselect2-selection__choice__remove" role="presentation">&times;</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(".pumselect2-selection__rendered");n.appendMany(a,t)}},i}),t.define("pumselect2/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("pumselect2-selection__placeholder").removeClass("pumselect2-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(".pumselect2-selection__rendered").append(r)},t}),t.define("pumselect2/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",".pumselect2-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(".pumselect2-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(".pumselect2-selection__placeholder").length>0||0===n.length)){var i=e('<span class="pumselect2-selection__clear">&times;</span>');i.data("data",n),this.$selection.find(".pumselect2-selection__rendered").prepend(i)}},n}),t.define("pumselect2/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="pumselect2-search pumselect2-search--inline"><input class="pumselect2-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",".pumselect2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".pumselect2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".pumselect2-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(".pumselect2-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",".pumselect2-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",".pumselect2-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(".pumselect2-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(".pumselect2-selection__rendered").innerWidth();else{var t=this.$search.val().length+1;e=.75*t+"em"}this.$search.css("width",e)},i}),t.define("pumselect2/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("pumselect2:"+t,{params:n});r.$element.trigger(i),e.inArray(t,o)!==-1&&(n.prevented=i.isDefaultPrevented())}})},t}),t.define("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/data/select",["./base","../utils","jquery"],function(e,t,n){
2
- 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("pumselect2/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 u=this._normalizeItem(e[l]);if(n.inArray(u.id,o)>=0){var c=s.filter(i(u)),d=this.item(c),p=n.extend(!0,{},u,d),h=this.option(p);c.replaceWith(h)}else{var f=this.option(u);if(u.children){var m=this.convertToOptions(u.children);t.appendMany(f,m)}a.push(f)}}return a},i}),t.define("pumselect2/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("pumselect2/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],u=this._normalizeItem(l),c=this.option(u);this.$element.append(c)}}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],u=null!=l.children&&!i({results:l.children},!0),c=l.text===t.term;if(c||u)return!s&&(e.data=o,void n(e))}if(s)return!0;var d=r.createTag(t);if(null!=d){var p=r.option(d);p.attr("data-pumselect2-tag",!0),r.addOptions([p]),r.insertTag(o,d)}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-pumselect2-tag]"));n.each(function(){this.selected||e(this).remove()})},t}),t.define("pumselect2/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(".pumselect2-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 u=o[a];if(e.inArray(u,s)!==-1){var c=o.substr(0,a),d=e.extend({},n,{term:c}),p=l(d);null!=p?(r(p),o=o.substr(a+1)||"",a=0):a++}else a++}return{term:o}},t}),t.define("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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="pumselect2-dropdown"><span class="pumselect2-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("pumselect2/dropdown/search",["jquery","../utils"],function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),i=e('<span class="pumselect2-search pumselect2-search--dropdown"><input class="pumselect2-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("pumselect2-search--hide"):r.$searchContainer.addClass("pumselect2-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("pumselect2/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("pumselect2/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="pumselect2-results__option pumselect2-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("pumselect2/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("pumselect2"),t.addClass("pumselect2-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.pumselect2."+i.id,o="resize.pumselect2."+i.id,a="orientationchange.pumselect2."+i.id,l=this.$container.parents().filter(t.hasScroll);l.each(function(){e(this).data("pumselect2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),l.on(s,function(t){var n=e(this).data("pumselect2-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.pumselect2."+i.id,s="resize.pumselect2."+i.id,o="orientationchange.pumselect2."+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("pumselect2-dropdown--above"),i=this.$dropdown.hasClass("pumselect2-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()},u=l.top<s.top-a.height,c=l.bottom>s.bottom+a.height,d={left:s.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h=p.offset();d.top-=h.top,d.left-=h.left,n||i||(r="below"),c||!u||n?!u&&c&&n&&(r="below"):r="above",("above"==r||n&&"below"!==r)&&(d.top=o.top-a.height),null!=r&&(this.$dropdown.removeClass("pumselect2-dropdown--below pumselect2-dropdown--above").addClass("pumselect2-dropdown--"+r),this.$container.removeClass("pumselect2-container--below pumselect2-container--above").addClass("pumselect2-container--"+r)),this.$dropdownContainer.css(d)},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("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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,u,c,d,p,h,f,m,g,v,y,_,b,w,A,$,x,C,j,k,P){function O(){this.reset()}O.prototype.apply=function(d){if(d=e.extend(!0,{},this.defaults,d),null==d.dataAdapter){if(null!=d.ajax?d.dataAdapter=f:null!=d.data?d.dataAdapter=h:d.dataAdapter=p,d.minimumInputLength>0&&(d.dataAdapter=u.Decorate(d.dataAdapter,v)),d.maximumInputLength>0&&(d.dataAdapter=u.Decorate(d.dataAdapter,y)),d.maximumSelectionLength>0&&(d.dataAdapter=u.Decorate(d.dataAdapter,_)),d.tags&&(d.dataAdapter=u.Decorate(d.dataAdapter,m)),null==d.tokenSeparators&&null==d.tokenizer||(d.dataAdapter=u.Decorate(d.dataAdapter,g)),null!=d.query){var P=t(d.amdBase+"compat/query");d.dataAdapter=u.Decorate(d.dataAdapter,P)}if(null!=d.initSelection){var O=t(d.amdBase+"compat/initSelection");d.dataAdapter=u.Decorate(d.dataAdapter,O)}}if(null==d.resultsAdapter&&(d.resultsAdapter=n,null!=d.ajax&&(d.resultsAdapter=u.Decorate(d.resultsAdapter,$)),null!=d.placeholder&&(d.resultsAdapter=u.Decorate(d.resultsAdapter,A)),d.selectOnClose&&(d.resultsAdapter=u.Decorate(d.resultsAdapter,j))),null==d.dropdownAdapter){if(d.multiple)d.dropdownAdapter=b;else{var M=u.Decorate(b,w);d.dropdownAdapter=M}if(0!==d.minimumResultsForSearch&&(d.dropdownAdapter=u.Decorate(d.dropdownAdapter,C)),d.closeOnSelect&&(d.dropdownAdapter=u.Decorate(d.dropdownAdapter,k)),null!=d.dropdownCssClass||null!=d.dropdownCss||null!=d.adaptDropdownCssClass){var S=t(d.amdBase+"compat/dropdownCss");d.dropdownAdapter=u.Decorate(d.dropdownAdapter,S)}d.dropdownAdapter=u.Decorate(d.dropdownAdapter,x)}if(null==d.selectionAdapter){if(d.multiple?d.selectionAdapter=r:d.selectionAdapter=i,null!=d.placeholder&&(d.selectionAdapter=u.Decorate(d.selectionAdapter,s)),d.allowClear&&(d.selectionAdapter=u.Decorate(d.selectionAdapter,o)),d.multiple&&(d.selectionAdapter=u.Decorate(d.selectionAdapter,a)),null!=d.containerCssClass||null!=d.containerCss||null!=d.adaptContainerCssClass){var U=t(d.amdBase+"compat/containerCss");d.selectionAdapter=u.Decorate(d.selectionAdapter,U)}d.selectionAdapter=u.Decorate(d.selectionAdapter,l)}if("string"==typeof d.language)if(d.language.indexOf("-")>0){var D=d.language.split("-"),E=D[0];d.language=[d.language,E]}else d.language=[d.language];if(e.isArray(d.language)){var T=new c;d.language.push("en");for(var q=d.language,z=0;z<q.length;z++){var I=q[z],L={};try{L=c.loadPath(I)}catch(H){try{I=this.defaults.amdLanguageBase+I,L=c.loadPath(I)}catch(R){d.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+I+'" could not be automatically loaded. A fallback will be used instead.');continue}}T.extend(L)}d.translations=T}else{var N=c.loadPath(this.defaults.amdLanguageBase+"en"),F=new c(d.language);F.extend(N),d.translations=F}return d},O.prototype.reset=function(){function t(e){function t(e){return d[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 u=t(r.text).toUpperCase(),c=t(i.term).toUpperCase();return u.indexOf(c)>-1?r:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:u.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=u._convertData(r);e.extend(this.defaults,s)};var M=new O;return M}),t.define("pumselect2/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=["pumselect2"];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("pumselect2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-pumselect2-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("pumselect2Tags")),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("pumselect2/core",["jquery","./options","./utils","./keys"],function(e,t,n,i){var r=function(e,n){null!=e.data("pumselect2")&&e.data("pumselect2").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 u=this.options.get("resultsAdapter");this.results=new u(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var c=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){c.trigger("selection:update",{data:e})}),e.addClass("pumselect2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("pumselect2",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="pumselect2-"+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 u=o[a].replace(/\s/g,""),c=u.match(n);if(null!==c&&c.length>=1)return c[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.pumselect2",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("pumselect2-container--open")}),this.on("close",function(){e.$container.removeClass("pumselect2-container--open")}),this.on("enable",function(){e.$container.removeClass("pumselect2-container--disabled")}),this.on("disable",function(){e.$container.addClass("pumselect2-container--disabled")}),this.on("blur",function(){e.$container.removeClass("pumselect2-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("pumselect2-container--open")},r.prototype.hasFocus=function(){return this.$container.hasClass("pumselect2-container--focus")},r.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("pumselect2-container--focus"),this.trigger("focus",{}))},r.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `pumselect2("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 `pumselect2("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 `pumselect2("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(".pumselect2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("pumselect2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("pumselect2"),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="pumselect2 pumselect2-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("pumselect2-container--"+this.options.get("theme")),t.data("element",this.$element),t},r}),t.define("pumselect2/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("pumselect2-")&&o.push(this)})),r=e.trim(n.attr("class")),r&&(r=""+r,e(r.split(/\s+/)).each(function(){0!==this.indexOf("pumselect2-")&&(s=i(this),null!=s&&o.push(s))})),t.attr("class",o.join(" "));
3
- }return{syncCssClasses:t}}),t.define("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2-dropdown--below"),n.addClass("pumselect2-container--below")},e}),t.define("pumselect2/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("pumselect2/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),u=0,d=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&&(d=o.wheelDeltaX*-1),"axis"in o&&o.axis===o.HORIZONTAL_AXIS&&(d=p*-1,p=0),u=0===p?d:p,"deltaY"in o&&(p=o.deltaY*-1,u=p),"deltaX"in o&&(d=o.deltaX,0===p&&(u=d*-1)),0!==p||0!==d){if(1===o.deltaMode){var g=e.data(this,"mousewheel-line-height");u*=g,p*=g,d*=g}else if(2===o.deltaMode){var v=e.data(this,"mousewheel-page-height");u*=v,p*=v,d*=v}if(h=Math.max(Math.abs(p),Math.abs(d)),(!s||h<s)&&(s=h,i(o,h)&&(s/=40)),i(o,h)&&(u/=40,d/=40,p/=40),u=Math[u>=1?"floor":"ceil"](u/s),d=Math[d>=1?"floor":"ceil"](d/s),p=Math[p>=1?"floor":"ceil"](p/s),c.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();f=t.clientX-y.left,m=t.clientY-y.top}return t.deltaX=d,t.deltaY=p,t.deltaFactor=s,t.offsetX=f,t.offsetY=m,t.deltaMode=0,a.unshift(t,u,d,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 c.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 u=o.length;u;)e.event.fixHooks[o[--u]]=e.event.mouseHooks;var c=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",c.getLineHeight(this)),e.data(this,"mousewheel-page-height",c.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.pumselect2",["jquery","jquery-mousewheel","./pumselect2/core","./pumselect2/defaults"],function(e,t,n,i){if(null==e.fn.pumselect2){var r=["open","close","destroy"];e.fn.pumselect2=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("pumselect2");null==n&&window.console&&console.error&&console.error("The pumselect2('"+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.pumselect2.defaults&&(e.fn.pumselect2.defaults=i),n}),{define:t.define,require:t.require}}(),n=t.require("jquery.pumselect2");return e.fn.pumselect2.amd=t,n}),function(e){"use strict";var t={init:function(){e(".pum-color-picker").filter(":not(.pum-color-picker-initialized)").addClass("pum-color-picker-initialized").wpColorPicker({change:function(t,n){e(t.target).trigger("colorchange",n)},clear:function(t){e(t.target).prev().trigger("colorchange").wpColorPicker("close")}})}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.colorpicker=t,e(document).on("click",".iris-palette",function(){e(this).parents(".wp-picker-active").find("input.pum-color-picker").trigger("change"),setTimeout(PopMakeAdmin.update_theme,500)}).on("colorchange",function(t,n){var i=e(t.target),r=i.parents("tr").next("tr.background-opacity"),s="";void 0!==n&&void 0!==n.color&&(s=n.color.toString()),i.hasClass("background-color")&&("string"==typeof s&&s.length?r.show():r.hide()),i.val(s),"popup_theme"===e("form#post input#post_type").val()&&PopMakeAdmin.update_theme()}).on("pum_init",t.init)}(jQuery),function(e){"use strict";var t={init:function(){t.checkDependencies()},checkDependencies:function(t){var n=e(t);t=n.length?n:e("[data-pum-dependencies]:not([data-pum-processed-dependencies])"),t.each(function(){var t,n=e(this),i=n.data("id"),r=n.data("pum-processed-dependencies")||{},s=Object.keys(r).length,o=0,a=n.data("pum-dependent-fields");if(!n.data("pum-processed-dependencies")){r=n.data("pum-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("pum-processed-dependencies",r).attr("data-pum-processed-dependencies",r)}a||(a=e.map(r,function(t,n){var i=e('.pum-field[data-id="'+n+'"]');return i.length?i.eq(0):null}),n.data("pum-dependent-fields",a)),e(a).each(function(){var t,a=e(this),l=a.find(":input:first"),u=a.data("id"),c=l.val(),d=r[u],p=a.data("pum-field-dependents")||[];if(p.indexOf(i)===-1&&(p.push(i),a.data("pum-field-dependents",p)),"undefined"==typeof d||null===d)return n.hide(),!1;if(a.hasClass("pum-field-radio")&&(c=a.find(":input:checked").val()),a.hasClass("pum-field-multicheck")&&(c=[],a.find(":checkbox:checked").each(function(t){c[t]=e(this).val(),"string"!=typeof c[t]||isNaN(parseInt(c[t]))||(c[t]=parseInt(c[t]))})),a.hasClass("pum-field-select")||a.hasClass("pum-field-radio"))t=d&&d.indexOf(c)!==-1;else if(a.hasClass("pum-field-checkbox"))t=d===l.is(":checked");else if(a.hasClass("pum-field-multicheck"))if(Array.isArray(d)){t=!1;for(var h=0;h<d.length;h++)c.indexOf(d[h])!==-1&&(t=!0)}else t=c.indexOf(d)!==-1;else t=Array.isArray(d)?d.indexOf(c)!==-1:d==c;return t?(o++,void(o===s&&n.show())):(n.hide(),!1)})})},form_check:function(){e(document).trigger("pum_form_check")},is_field:function(e){if("object"!=typeof e)return!1;var t=[void 0===e.type&&(void 0!==e.label||void 0!==e.desc),void 0!==e.type&&"string"==typeof e.type];return t.indexOf(!0)>=0},parseFields:function(e,t){return t=t||{},_.each(e,function(n,i){e[i]=PUM_Admin.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(n,i,r){var s,o=[],a={},l=e.extend(!0,{id:"",tabs:{},sections:{},fields:{},maintabs:{},subtabs:{}},n),u=e.extend({id:l.id,classes:[],tabs:{},vertical:!0,form:!0,meta:{"data-min-height":250}},l.maintabs),c=e.extend({classes:["link-tabs","sub-tabs"],tabs:{}},l.subtabs),d=["pum-dynamic-form"];return i=i||{},Object.keys(l.tabs).length&&Object.keys(l.sections).length?(d.push("tabbed-content"),_.each(l.fields,function(n,r){"object"==typeof n&&Object.keys(n).length&&(void 0===u.tabs[r]&&(u.tabs[r]={label:l.tabs[r],content:""}),c=e.extend(c,{id:l.id+"-"+r+"-subtabs",tabs:{}}),_.each(n,function(e,n){if("object"==typeof e&&Object.keys(e).length){if(t.is_field(e)){var s={};s[n]=e,n="main",e=s}void 0===c.tabs[n]&&(c.tabs[n]={label:l.sections[r][n],content:""}),e=t.parseFields(e,i),_.each(e,function(e){a[e.id]=e,c.tabs[n].content+=PUM_Admin.templates.field(e)}),""===c.tabs[n].content&&delete c.tabs[n]}}),Object.keys(c.tabs).length?u.tabs[r].content=PUM_Admin.templates.tabs(c):delete u.tabs[r])}),Object.keys(u.tabs).length&&(s=PUM_Admin.templates.tabs(u))):Object.keys(l.tabs).length?(d.push("tabbed-content"),_.each(l.fields,function(e,n){"object"==typeof e&&Object.keys(e).length&&(void 0===u.tabs[n]&&(u.tabs[n]={label:l.tabs[n],content:""}),o=[],e=t.parseFields(e,i),_.each(e,function(e){a[e.id]=e,o.push(PUM_Admin.templates.field(e))}),o.length?u.tabs[n].content=PUM_Admin.templates.section({fields:o}):delete u.tabs[n])}),Object.keys(u.tabs).length&&(s=PUM_Admin.templates.tabs(u))):Object.keys(l.sections).length?_.each(l.fields,function(e,n){o=[],o.push(PUM_Admin.templates.field({type:"heading",desc:l.sections[n]||""})),e=t.parseFields(e,i),_.each(e,function(e){a[e.id]=e,o.push(PUM_Admin.templates.field(e))}),s+=PUM_Admin.templates.section({fields:o})}):(l.fields=t.parseFields(l.fields,i),_.each(l.fields,function(e){a[e.id]=e,o.push(PUM_Admin.templates.field(e))}),s=PUM_Admin.templates.section({fields:o})),void 0!==r&&r.length&&r.addClass(d.join(" ")).data("form_fields",a).html(s).trigger("pum_init"),s}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.forms=t,e(document).on("pum_init pum_form_check",function(){PUM_Admin.forms.init()}).on("pumFieldChanged",".pum-field",function(){var t,n=e(this),i=n.data("pum-field-dependents")||[],r=e();if(i&&!(i.length<=0)){for(t=0;t<i.length;t++)r=r.add('.pum-field[data-id="'+i[t]+'"]');PUM_Admin.forms.checkDependencies(r)}}).on("pumFieldChanged",".pum-field-dynamic-desc",function(){var t=e(this),n=t.find(":input"),i=t.parents(".pum-dynamic-form:first"),r=n.val(),s=i.data("form_fields")||{},o=s[t.data("id")]||{},a=t.find(".pum-desc"),l=t.data("pum-dynamic-desc");switch(o.type){case"radio":r=t.find(":input:checked").val()}o.value=r,l&&l.length&&a.html(PUM_Admin.templates.renderInline(l,o))}).on("change",".pum-field-select select",function(){e(this).parents(".pum-field").trigger("pumFieldChanged")}).on("click",".pum-field-checkbox input",function(){e(this).parents(".pum-field").trigger("pumFieldChanged")}).on("click",".pum-field-multicheck input",function(){e(this).parents(".pum-field").trigger("pumFieldChanged")}).on("click",".pum-field-radio input",function(t){var n=e(this),i=n.parents("li"),r=n.parents(".pum-field");r.trigger("pumFieldChanged"),r.find("li.pum-selected").removeClass("pum-selected"),i.addClass("pum-selected")})}(jQuery),function(e){"use strict";var t,n,i=e("html"),r=e(document),s="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]",o={_current:null,forceFocus:function(e){PUM_Admin.modals._current&&!PUM_Admin.modals._current.contains(e.target)&&(e.stopPropagation(),PUM_Admin.modals._current.focus())},trapEscapeKey:function(e){27===e.keyCode&&(PUM_Admin.modals.closeAll(),e.preventDefault())},trapTabKey:function(t){if(9===t.keyCode){var n=PUM_Admin.modals._current.find("*").filter(s).filter(":visible"),i=e(":focus"),r=n.length,o=n.index(i);t.shiftKey?0===o&&(n.get(r-1).focus(),t.preventDefault()):o===r-1&&(n.get(0).focus(),t.preventDefault())}},setFocusToFirstItem:function(){PUM_Admin.modals._current.find(".pum-modal-content *").filter(s).filter(":visible").first().focus()},closeAll:function(i){e(".pum-modal-background").off("keydown.pum_modal").hide(0,function(){e("html").css({overflow:"visible",width:"auto"}),t&&(t.attr("aria-hidden","false"),t=null),n.length&&n.focus(),PUM_Admin.modals._current=null,r.off("focus.pum_modal"),void 0!==i&&i()}).attr("aria-hidden","true")},show:function(r,s){e(".pum-modal-background").off("keydown.pum_modal").hide(0).attr("aria-hidden","true"),i.data("origwidth",i.innerWidth()).css({overflow:"hidden",width:i.innerWidth()});var o=e(":focus");o.parents(".pum-modal-wrap").length||(n=o),PUM_Admin.modals._current=e(r),PUM_Admin.modals._current.on("keydown.pum_modal",function(e){PUM_Admin.modals.trapEscapeKey(e),PUM_Admin.modals.trapTabKey(e)}).show(0,function(){t=e("body > *").filter(":visible").not(PUM_Admin.modals._current),t.attr("aria-hidden","true"),PUM_Admin.modals._current.trigger("pum_init").on("focus.pum_modal",PUM_Admin.modals.forceFocus),PUM_Admin.modals.setFocusToFirstItem(),void 0!==s&&s()}).attr("aria-hidden","false")},remove:function(t){e(t).remove()},replace:function(t,n){PUM_Admin.modals.remove(e.trim(t)),e("body").append(e.trim(n))},reload:function(t,n,i){PUM_Admin.modals.replace(t,n),PUM_Admin.modals.show(t,i),e(t).trigger("pum_init")}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.modals=o,e(document).on("click",".pum-modal-background, .pum-modal-wrap .cancel, .pum-modal-wrap .pum-modal-close",function(t){var n=e(t.target);(n.hasClass("cancel")||n.hasClass("pum-modal-close")||n.hasClass("submitdelete"))&&(PUM_Admin.modals.closeAll(),t.preventDefault(),t.stopPropagation())})}(jQuery),function(e){"use strict";var t={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,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)}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.models=t}(jQuery),function(e){"use strict";var t={cloneables:{slider:e('<input type="range" class="pum-range-slider" />'),plus:e('<button type="button" class="pum-range-plus">+</button>'),minus:e('<button type="button" class="pum-range-minus">-</button>')},init:function(){e(".pum-field-rangeslider:not(.pum-rangeslider-initialized)").each(function(){var n=e(this).addClass("pum-rangeslider-initialized"),i=n.find("input.pum-range-manual"),r=t.cloneables.slider.clone(),s=t.cloneables.plus.clone(),o=t.cloneables.minus.clone(),a={force:i.data("force-minmax"),min:parseInt(i.attr("min"),10)||0,max:parseInt(i.attr("max"),10)||100,step:parseInt(i.attr("step"),10)||1,value:parseInt(i.attr("value"),10)||0};a.force&&a.value>a.max&&(a.value=a.max,i.val(a.value)),r.prop({min:a.min||0,max:a.force||a.max&&a.max>a.value?a.max:1.5*a.value,step:a.step||1.5*a.value/100,value:a.value}).on("change input",function(){i.trigger("input")}),i.next().after(o,s),i.before(r)})}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.rangesliders=t,e(document).on("pum_init",PUM_Admin.rangesliders.init).on("input",".pum-field-rangeslider.pum-rangeslider-initialized .pum-range-slider",function(){var t=e(this);t.siblings(".pum-range-manual").val(t.val())}).on("change",".pum-range-manual",function(){var t=e(this),n=parseInt(t.prop("max"),0),i=parseInt(t.prop("min"),0),r=parseInt(t.prop("step"),0),s=t.data("force-minmax"),o=parseInt(t.val(),0),a=t.prev();isNaN(o)&&(o=a.val()),s&&o>n?o=n:s&&o<i&&(o=i),t.val(o).trigger("input"),a.prop({max:s||n&&n>o?n:1.5*o,step:r||1.5*o/100,value:o})}).on("click",".pum-range-plus",function(t){var n=e(this).siblings(".pum-range-manual"),i=parseInt(n.prop("max"),0),r=parseInt(n.prop("step"),0),s=n.data("force-minmax"),o=parseInt(n.val(),0),a=n.prev();t.preventDefault(),o+=r,isNaN(o)&&(o=a.val()),s&&o>i&&(o=i),n.val(o).trigger("input"),a.val(o)}).on("click",".pum-range-minus",function(t){var n=e(this).siblings(".pum-range-manual"),i=parseInt(n.prop("min"),0),r=parseInt(n.prop("step"),0),s=n.data("force-minmax"),o=parseInt(n.val(),0),a=n.prev();t.preventDefault(),o-=r,isNaN(o)&&(o=a.val()),s&&o<i&&(o=i),n.val(o).trigger("input"),a.val(o)})}(jQuery),function(e){"use strict";e.fn.pumselect2=e.fn.pumselect2||e.fn.select2;var t={init:function(){e(".pum-field-select2 select").filter(":not(.pumselect2-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:"pum_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:PUM_Admin.select2.formatObject,templateSelection:PUM_Admin.select2.formatObjectSelection})),t.addClass("pumselect2-initialized").pumselect2(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:"pum_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}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.select2=t,e(document).on("pum_init",function(){PUM_Admin.select2.init()})}(jQuery),function(e,t){if("function"!=typeof window.$$){var n,i,r={},s={};window.$$=function(o,a){return a?((n=a.selector)&&(a=n),i=s[a],i===t&&(i=s[a]={}),n=i[o],n!==t?n:i[o]=e(o,$$(a))):(n=r[o],n!==t?n:r[o]=e(o))},window.$$clear=function(e,i){i?((n=i.selector)&&(i=n),e&&(n=s[i])&&(n[e]=t),s[i]=t):e?(r[e]=t,s[e]=t):(r={},s={})},window.$$fresh=function(e,t){return $$clear(e,t),$$(e,t)}}}(jQuery),function(e,t){if("function"==typeof define&&define.amd)define(["exports","jquery"],function(e,n){return t(e,n)});else if("undefined"!=typeof exports){var n=require("jquery");t(exports,n)}else 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"1"===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 u(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 c(){return p}function d(){return JSON.stringify(c())}var p={},h={};this.addPair=l,this.addPairs=u,this.serialize=c,this.serializeJSON=d}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.pumSerializeObject=t.fn.serializeObject=n.serializeObject,t.fn.pumSerializeJSON=t.fn.serializeJSON=n.serializeJSON),e.FormSerializer=n,n}),function(e){"use strict";var t={init:function(){e(".pum-tabs-container").filter(":not(.pum-tabs-initialized)").each(function(){var t=e(this).addClass("pum-tabs-initialized"),n=t.find("> ul.tabs"),i=n.find("> li:first"),r=t.data("min-height");if(t.hasClass("vertical-tabs")){var s=r&&r>0?r:n.eq(0).outerHeight(!0);t.css({minHeight:s+"px"}),t.parent().innerHeight<s&&t.parent().css({minHeight:s+"px"})}i.trigger("click")})}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.tabs=t,e(document).on("pum_init",PUM_Admin.tabs.init).on("click",".pum-tabs-initialized li.tab",function(t){var n=e(this),i=n.parents(".pum-tabs-container:first"),r=i.find("> ul.tabs > li.tab"),s=i.find("> div.tab-content"),o=n.find("a").attr("href");r.removeClass("active"),s.removeClass("active"),n.addClass("active"),i.find("> div.tab-content"+o).addClass("active"),t.preventDefault()})}(jQuery),function(e){"use strict";var t=pum_admin_vars.I10n,n={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=PUM_Admin.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?"pum-shortcode-w-content":"pum-shortcode";return PUM_Admin.templates.render(i,n)},modal:function(n){var i=e.extend(!0,{},{id:"",title:"",description:"",classes:"",save_button:t.save,cancel_button:t.cancel,content:""},n);return PUM_Admin.templates.render("pum-modal",i)},tabs:function(t){return t=e.extend(!0,{},{id:"",vertical:!1,form:!1,classes:[],tabs:{},meta:{}},t),"string"==typeof t.classes&&(t.classes=[t.classes]),t.form&&t.classes.push("pum-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(" "),PUM_Admin.templates.render("pum-tabs",t)},section:function(t){var n=e.extend(!0,{},{classes:[],fields:[]},t);return PUM_Admin.templates.render("pum-field-section",n)},fieldArgs:function(t){var n=[],i=e.extend(!0,{},PUM_Admin.models.field(t));switch(null!==i.value&&i.value!==!1||void 0===t.std||(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("pum-required")),"string"==typeof i.dynamic_desc&&i.dynamic_desc.length&&(i.classes.push("pum-field-dynamic-desc"),i.desc=PUM_Admin.templates.renderInline(i.dynamic_desc,i)),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||"object"==typeof i.value&&Object.keys(i.value).length&&void 0!==i.value[t]||Array.isArray(i.value)&&i.value.indexOf(t)!==-1)?o="selected":i.multiple||i.value!=t||(o="selected")),n.push(PUM_Admin.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||"object"==typeof i.value&&Object.keys(i.value).length&&void 0!==i.value[t]||Array.isArray(i.value)&&i.value.indexOf(t)!==-1)?n="selected":i.multiple||i.value!=t||(n="selected")),s.push(PUM_Admin.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("pum-field-objectselect"),i.classes.push("postselect"===t.type?"pum-field-postselect":"pum-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("pum-field-select2"),i.placeholder&&(i.meta["data-placeholder"]=i.placeholder));break;case"radio":void 0!==i.options&&(_.each(i.options,function(e,t){n.push(PUM_Admin.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(PUM_Admin.templates.prepareMeta({label:e,value:t,meta:{checked:"object"==typeof i.value&&Object.keys(i.value).length&&void 0!==i.value[t]||Array.isArray(i.value)&&i.value.indexOf(t)!==-1}}))}),i.options=n);break;case"checkbox":switch(typeof i.value){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;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(PUM_Admin.templates.prepareMeta({label:e,value:t,meta:{selected:r}}))}),i.units=n);break;case"license_key":i.value=e.extend({key:"",license:{},messages:[],status:"empty",expires:!1,classes:!1},i.value),i.classes.push("pum-license-"+i.value.status+"-notice"),i.value.classes&&i.classes.push(i.value.classes)}return i},field:function(t){var n,i=PUM_Admin.templates.fieldArgs(t);return n="pum-field-"+i.type,"objectselfect"!==i.type&&"postselect"!==i.type&&"taxonomyselect"!==i.type||(n="pum-field-select"),e("#tmpl-"+n).length?(i.field=PUM_Admin.templates.render(n,i),PUM_Admin.templates.render("pum-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}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.templates=n}(jQuery),function(e){"use strict";function t(t,n){return e.inArray(n,t)!==-1}function n(e,t,i){var r=t[0];t.length>1?(e[r]||(e[r]=t[1]?{}:[]),n(e[r],t.slice(1),i)):(r||(r=e.length),e[r]=i)}String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};var i="color,date,datetime,datetime-local,email,hidden,month,number,password,range,search,tel,text,time,url,week".split(","),r="select,textarea".split(","),s=/\[([^\]]*)\]/g,o={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},checked:function(e,t,n){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),
4
- void 0!==n&&n?i?' checked="checked"':"":i},selected:function(e,t,n){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},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)}},serializeForm:function(o){e.extend({},o);var a={},l=e.extend(!0,{include:[],exclude:[],includeByClass:""},o);return this.find(":input").each(function(){var o;!this.name||this.disabled||t(l.exclude,this.name)||l.include.length&&!t(l.include,this.name)||this.className.indexOf(l.includeByClass)===-1||(o=this.name.replace(s,"[$1").split("["),o[0]&&(this.checked||t(i,this.type)||t(r,this.nodeName.toLowerCase()))&&("checkbox"===this.type&&o.push(""),n(a,o,e(this).val())))}),a}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.utils=o,window.PUMUtils=o,e.fn.pumSerializeForm=o.serializeForm}(jQuery);
1
  function pumSelected(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}function pumChecked(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?' checked="checked"':"":i}!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.pumselect2&&e.fn.pumselect2.amd)var t=e.fn.pumselect2.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,u,c,d,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&&A.test(e[o])&&(e[o]=e[o].replace(A,"")),e=h.slice(0,h.length-1).concat(e),c=0;c<e.length;c+=1)if(p=e[c],"."===p)e.splice(c,1),c-=1;else if(".."===p){if(1===c&&(".."===e[2]||".."===e[0]))break;c>0&&(e.splice(c-1,2),c-=2)}e=e.join("/")}else 0===e.indexOf("./")&&(e=e.substring(2));if((h||m)&&f){for(n=e.split("/"),c=n.length;c>0;c-=1){if(i=n.slice(0,c).join("/"),h)for(d=h.length;d>0;d-=1)if(r=f[h.slice(0,d).join("/")],r&&(r=r[i])){s=r,a=c;break}if(s)break;!l&&m&&m[i]&&(l=m[i],u=c)}!s&&l&&(s=l,a=u),s&&(n.splice(0,a,s),e=n.join("/"))}return e}function o(e,n){return function(){var i=w.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 u(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 c(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 d(e){return function(){return y&&y.config&&y.config[e]||{}}}var p,h,f,m,g={},v={},y={},_={},b=Object.prototype.hasOwnProperty,w=[].slice,A=/\.js$/;f=function(e,t){var n,i=c(e),r=i[0];return e=i[1],r&&(r=s(r,t),n=u(r)),r?e=n&&n.normalize?n.normalize(e,a(t)):s(e,t):(e=s(e,t),i=c(e),r=i[0],e=i[1],r&&(n=u(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:d(e)}}},p=function(e,n,i,s){var a,c,d,p,h,y,b=[],w=typeof i;if(s=s||e,"undefined"===w||"function"===w){for(n=!n.length&&i.length?["require","exports","module"]:n,h=0;h<n.length;h+=1)if(p=f(n[h],s),c=p.f,"require"===c)b[h]=m.require(e);else if("exports"===c)b[h]=m.exports(e),y=!0;else if("module"===c)a=b[h]=m.module(e);else if(r(g,c)||r(v,c)||r(_,c))b[h]=u(c);else{if(!p.p)throw new Error(e+" missing "+c);p.p.load(p.n,o(s,!0),l(c),{}),b[h]=g[c]}d=i?i.apply(g[e],b):void 0,e&&(a&&a.exports!==t&&a.exports!==g[e]?g[e]=a.exports:d===t&&y||(g[e]=d))}else e&&(g[e]=i)},e=n=h=function(e,n,i,r,s){if("string"==typeof e)return m[e]?m[e](n):u(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("pumselect2/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 u=(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)}}),c=0;c<s.length;c++){var d=s[c];i.prototype[d]=u(d)}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={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};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("pumselect2/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="pumselect2-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="pumselect2-results__option"></li>'),r=this.options.get("translations").get(t.message);i.append(n(r(t.args))),i[0].className+=" pumselect2-results__message",this.$results.append(i)},n.prototype.hideMessages=function(){this.$results.find(".pumselect2-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(".pumselect2-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(".pumselect2-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="pumselect2-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="pumselect2-results__group";e(a);this.template(t,a);for(var l=[],u=0;u<t.children.length;u++){var c=t.children[u],d=this.option(c);l.push(d)}var p=e("<ul></ul>",{"class":"pumselect2-results__options pumselect2-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("pumselect2-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",".pumselect2-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",".pumselect2-results__option[aria-selected]",function(t){var n=e(this).data("data");i.getHighlightedResults().removeClass("pumselect2-results__option--highlighted"),i.trigger("results:focus",{data:n,element:e(this)})})},n.prototype.getHighlightedResults=function(){var e=this.$results.find(".pumselect2-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("pumselect2/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("pumselect2/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="pumselect2-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.pumselect2."+t.id,function(t){var n=e(t.target),i=n.closest(".pumselect2"),r=e(".pumselect2.pumselect2-container--open");r.each(function(){var t=e(this);if(this!=i[0]){var n=t.data("element");n.pumselect2("close")}})})},i.prototype._detachCloseHandler=function(t){e(document.body).off("mousedown.pumselect2."+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("pumselect2/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("pumselect2-selection--single"),e.html('<span class="pumselect2-selection__rendered"></span><span class="pumselect2-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(".pumselect2-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(".pumselect2-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(".pumselect2-selection__rendered"),i=this.display(t,n);n.empty().append(i),n.prop("title",t.title||t.text)},r}),t.define("pumselect2/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("pumselect2-selection--multiple"),e.html('<ul class="pumselect2-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",".pumselect2-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(".pumselect2-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="pumselect2-selection__choice"><span class="pumselect2-selection__choice__remove" role="presentation">&times;</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(".pumselect2-selection__rendered");n.appendMany(a,t)}},i}),t.define("pumselect2/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("pumselect2-selection__placeholder").removeClass("pumselect2-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(".pumselect2-selection__rendered").append(r)},t}),t.define("pumselect2/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",".pumselect2-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(".pumselect2-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(".pumselect2-selection__placeholder").length>0||0===n.length)){var i=e('<span class="pumselect2-selection__clear">&times;</span>');i.data("data",n),this.$selection.find(".pumselect2-selection__rendered").prepend(i)}},n}),t.define("pumselect2/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="pumselect2-search pumselect2-search--inline"><input class="pumselect2-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",".pumselect2-search--inline",function(e){r.trigger("focus",e)}),this.$selection.on("focusout",".pumselect2-search--inline",function(e){r._handleBlur(e)}),this.$selection.on("keydown",".pumselect2-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(".pumselect2-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",".pumselect2-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",".pumselect2-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(".pumselect2-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(".pumselect2-selection__rendered").innerWidth();else{var t=this.$search.val().length+1;e=.75*t+"em"}this.$search.css("width",e)},i}),t.define("pumselect2/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("pumselect2:"+t,{params:n});r.$element.trigger(i),e.inArray(t,o)!==-1&&(n.prevented=i.isDefaultPrevented())}})},t}),t.define("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/data/select",["./base","../utils","jquery"],function(e,t,n){
2
+ 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("pumselect2/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 u=this._normalizeItem(e[l]);if(n.inArray(u.id,o)>=0){var c=s.filter(i(u)),d=this.item(c),p=n.extend(!0,{},u,d),h=this.option(p);c.replaceWith(h)}else{var f=this.option(u);if(u.children){var m=this.convertToOptions(u.children);t.appendMany(f,m)}a.push(f)}}return a},i}),t.define("pumselect2/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("pumselect2/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],u=this._normalizeItem(l),c=this.option(u);this.$element.append(c)}}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],u=null!=l.children&&!i({results:l.children},!0),c=l.text===t.term;if(c||u)return!s&&(e.data=o,void n(e))}if(s)return!0;var d=r.createTag(t);if(null!=d){var p=r.option(d);p.attr("data-pumselect2-tag",!0),r.addOptions([p]),r.insertTag(o,d)}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-pumselect2-tag]"));n.each(function(){this.selected||e(this).remove()})},t}),t.define("pumselect2/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(".pumselect2-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 u=o[a];if(e.inArray(u,s)!==-1){var c=o.substr(0,a),d=e.extend({},n,{term:c}),p=l(d);null!=p?(r(p),o=o.substr(a+1)||"",a=0):a++}else a++}return{term:o}},t}),t.define("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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="pumselect2-dropdown"><span class="pumselect2-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("pumselect2/dropdown/search",["jquery","../utils"],function(e,t){function n(){}return n.prototype.render=function(t){var n=t.call(this),i=e('<span class="pumselect2-search pumselect2-search--dropdown"><input class="pumselect2-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("pumselect2-search--hide"):r.$searchContainer.addClass("pumselect2-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("pumselect2/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("pumselect2/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="pumselect2-results__option pumselect2-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("pumselect2/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("pumselect2"),t.addClass("pumselect2-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.pumselect2."+i.id,o="resize.pumselect2."+i.id,a="orientationchange.pumselect2."+i.id,l=this.$container.parents().filter(t.hasScroll);l.each(function(){e(this).data("pumselect2-scroll-position",{x:e(this).scrollLeft(),y:e(this).scrollTop()})}),l.on(s,function(t){var n=e(this).data("pumselect2-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.pumselect2."+i.id,s="resize.pumselect2."+i.id,o="orientationchange.pumselect2."+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("pumselect2-dropdown--above"),i=this.$dropdown.hasClass("pumselect2-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()},u=l.top<s.top-a.height,c=l.bottom>s.bottom+a.height,d={left:s.left,top:o.bottom},p=this.$dropdownParent;"static"===p.css("position")&&(p=p.offsetParent());var h=p.offset();d.top-=h.top,d.left-=h.left,n||i||(r="below"),c||!u||n?!u&&c&&n&&(r="below"):r="above",("above"==r||n&&"below"!==r)&&(d.top=o.top-a.height),null!=r&&(this.$dropdown.removeClass("pumselect2-dropdown--below pumselect2-dropdown--above").addClass("pumselect2-dropdown--"+r),this.$container.removeClass("pumselect2-container--below pumselect2-container--above").addClass("pumselect2-container--"+r)),this.$dropdownContainer.css(d)},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("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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,u,c,d,p,h,f,m,g,v,y,_,b,w,A,$,x,C,j,k,P){function O(){this.reset()}O.prototype.apply=function(d){if(d=e.extend(!0,{},this.defaults,d),null==d.dataAdapter){if(null!=d.ajax?d.dataAdapter=f:null!=d.data?d.dataAdapter=h:d.dataAdapter=p,d.minimumInputLength>0&&(d.dataAdapter=u.Decorate(d.dataAdapter,v)),d.maximumInputLength>0&&(d.dataAdapter=u.Decorate(d.dataAdapter,y)),d.maximumSelectionLength>0&&(d.dataAdapter=u.Decorate(d.dataAdapter,_)),d.tags&&(d.dataAdapter=u.Decorate(d.dataAdapter,m)),null==d.tokenSeparators&&null==d.tokenizer||(d.dataAdapter=u.Decorate(d.dataAdapter,g)),null!=d.query){var P=t(d.amdBase+"compat/query");d.dataAdapter=u.Decorate(d.dataAdapter,P)}if(null!=d.initSelection){var O=t(d.amdBase+"compat/initSelection");d.dataAdapter=u.Decorate(d.dataAdapter,O)}}if(null==d.resultsAdapter&&(d.resultsAdapter=n,null!=d.ajax&&(d.resultsAdapter=u.Decorate(d.resultsAdapter,$)),null!=d.placeholder&&(d.resultsAdapter=u.Decorate(d.resultsAdapter,A)),d.selectOnClose&&(d.resultsAdapter=u.Decorate(d.resultsAdapter,j))),null==d.dropdownAdapter){if(d.multiple)d.dropdownAdapter=b;else{var M=u.Decorate(b,w);d.dropdownAdapter=M}if(0!==d.minimumResultsForSearch&&(d.dropdownAdapter=u.Decorate(d.dropdownAdapter,C)),d.closeOnSelect&&(d.dropdownAdapter=u.Decorate(d.dropdownAdapter,k)),null!=d.dropdownCssClass||null!=d.dropdownCss||null!=d.adaptDropdownCssClass){var S=t(d.amdBase+"compat/dropdownCss");d.dropdownAdapter=u.Decorate(d.dropdownAdapter,S)}d.dropdownAdapter=u.Decorate(d.dropdownAdapter,x)}if(null==d.selectionAdapter){if(d.multiple?d.selectionAdapter=r:d.selectionAdapter=i,null!=d.placeholder&&(d.selectionAdapter=u.Decorate(d.selectionAdapter,s)),d.allowClear&&(d.selectionAdapter=u.Decorate(d.selectionAdapter,o)),d.multiple&&(d.selectionAdapter=u.Decorate(d.selectionAdapter,a)),null!=d.containerCssClass||null!=d.containerCss||null!=d.adaptContainerCssClass){var U=t(d.amdBase+"compat/containerCss");d.selectionAdapter=u.Decorate(d.selectionAdapter,U)}d.selectionAdapter=u.Decorate(d.selectionAdapter,l)}if("string"==typeof d.language)if(d.language.indexOf("-")>0){var D=d.language.split("-"),E=D[0];d.language=[d.language,E]}else d.language=[d.language];if(e.isArray(d.language)){var T=new c;d.language.push("en");for(var q=d.language,I=0;I<q.length;I++){var z=q[I],L={};try{L=c.loadPath(z)}catch(H){try{z=this.defaults.amdLanguageBase+z,L=c.loadPath(z)}catch(R){d.debug&&window.console&&console.warn&&console.warn('Select2: The language file for "'+z+'" could not be automatically loaded. A fallback will be used instead.');continue}}T.extend(L)}d.translations=T}else{var N=c.loadPath(this.defaults.amdLanguageBase+"en"),F=new c(d.language);F.extend(N),d.translations=F}return d},O.prototype.reset=function(){function t(e){function t(e){return d[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 u=t(r.text).toUpperCase(),c=t(i.term).toUpperCase();return u.indexOf(c)>-1?r:null}this.defaults={amdBase:"./",amdLanguageBase:"./i18n/",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:u.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=u._convertData(r);e.extend(this.defaults,s)};var M=new O;return M}),t.define("pumselect2/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=["pumselect2"];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("pumselect2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-pumselect2-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("pumselect2Tags")),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("pumselect2/core",["jquery","./options","./utils","./keys"],function(e,t,n,i){var r=function(e,n){null!=e.data("pumselect2")&&e.data("pumselect2").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 u=this.options.get("resultsAdapter");this.results=new u(e,this.options,this.dataAdapter),this.$results=this.results.render(),this.results.position(this.$results,this.$dropdown);var c=this;this._bindAdapters(),this._registerDomEvents(),this._registerDataEvents(),this._registerSelectionEvents(),this._registerDropdownEvents(),this._registerResultsEvents(),this._registerEvents(),this.dataAdapter.current(function(e){c.trigger("selection:update",{data:e})}),e.addClass("pumselect2-hidden-accessible"),e.attr("aria-hidden","true"),this._syncAttributes(),e.data("pumselect2",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="pumselect2-"+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 u=o[a].replace(/\s/g,""),c=u.match(n);if(null!==c&&c.length>=1)return c[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.pumselect2",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("pumselect2-container--open")}),this.on("close",function(){e.$container.removeClass("pumselect2-container--open")}),this.on("enable",function(){e.$container.removeClass("pumselect2-container--disabled")}),this.on("disable",function(){e.$container.addClass("pumselect2-container--disabled")}),this.on("blur",function(){e.$container.removeClass("pumselect2-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("pumselect2-container--open")},r.prototype.hasFocus=function(){return this.$container.hasClass("pumselect2-container--focus")},r.prototype.focus=function(e){this.hasFocus()||(this.$container.addClass("pumselect2-container--focus"),this.trigger("focus",{}))},r.prototype.enable=function(e){this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `pumselect2("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 `pumselect2("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 `pumselect2("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(".pumselect2"),this.$element.attr("tabindex",this.$element.data("old-tabindex")),this.$element.removeClass("pumselect2-hidden-accessible"),this.$element.attr("aria-hidden","false"),this.$element.removeData("pumselect2"),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="pumselect2 pumselect2-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("pumselect2-container--"+this.options.get("theme")),t.data("element",this.$element),t},r}),t.define("pumselect2/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("pumselect2-")&&o.push(this)})),r=e.trim(n.attr("class")),r&&(r=""+r,e(r.split(/\s+/)).each(function(){0!==this.indexOf("pumselect2-")&&(s=i(this),null!=s&&o.push(s))})),t.attr("class",o.join(" "));
3
+ }return{syncCssClasses:t}}),t.define("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2/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("pumselect2-dropdown--below"),n.addClass("pumselect2-container--below")},e}),t.define("pumselect2/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("pumselect2/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),u=0,d=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&&(d=o.wheelDeltaX*-1),"axis"in o&&o.axis===o.HORIZONTAL_AXIS&&(d=p*-1,p=0),u=0===p?d:p,"deltaY"in o&&(p=o.deltaY*-1,u=p),"deltaX"in o&&(d=o.deltaX,0===p&&(u=d*-1)),0!==p||0!==d){if(1===o.deltaMode){var g=e.data(this,"mousewheel-line-height");u*=g,p*=g,d*=g}else if(2===o.deltaMode){var v=e.data(this,"mousewheel-page-height");u*=v,p*=v,d*=v}if(h=Math.max(Math.abs(p),Math.abs(d)),(!s||h<s)&&(s=h,i(o,h)&&(s/=40)),i(o,h)&&(u/=40,d/=40,p/=40),u=Math[u>=1?"floor":"ceil"](u/s),d=Math[d>=1?"floor":"ceil"](d/s),p=Math[p>=1?"floor":"ceil"](p/s),c.settings.normalizeOffset&&this.getBoundingClientRect){var y=this.getBoundingClientRect();f=t.clientX-y.left,m=t.clientY-y.top}return t.deltaX=d,t.deltaY=p,t.deltaFactor=s,t.offsetX=f,t.offsetY=m,t.deltaMode=0,a.unshift(t,u,d,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 c.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 u=o.length;u;)e.event.fixHooks[o[--u]]=e.event.mouseHooks;var c=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",c.getLineHeight(this)),e.data(this,"mousewheel-page-height",c.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.pumselect2",["jquery","jquery-mousewheel","./pumselect2/core","./pumselect2/defaults"],function(e,t,n,i){if(null==e.fn.pumselect2){var r=["open","close","destroy"];e.fn.pumselect2=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("pumselect2");null==n&&window.console&&console.error&&console.error("The pumselect2('"+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.pumselect2.defaults&&(e.fn.pumselect2.defaults=i),n}),{define:t.define,require:t.require}}(),n=t.require("jquery.pumselect2");return e.fn.pumselect2.amd=t,n}),function(e){"use strict";var t={init:function(){e(".pum-color-picker").filter(":not(.pum-color-picker-initialized)").addClass("pum-color-picker-initialized").wpColorPicker({change:function(t,n){e(t.target).trigger("colorchange",n)},clear:function(t){e(t.target).prev().trigger("colorchange").wpColorPicker("close")}})}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.colorpicker=t,e(document).on("click",".iris-palette",function(){e(this).parents(".wp-picker-active").find("input.pum-color-picker").trigger("change"),setTimeout(PopMakeAdmin.update_theme,500)}).on("colorchange",function(t,n){var i=e(t.target),r=i.parents("tr").next("tr.background-opacity"),s="";void 0!==n&&void 0!==n.color&&(s=n.color.toString()),i.hasClass("background-color")&&("string"==typeof s&&s.length?r.show():r.hide()),i.val(s),"popup_theme"===e("form#post input#post_type").val()&&PopMakeAdmin.update_theme()}).on("pum_init",t.init)}(jQuery),function(e){"use strict";var t={init:function(){t.checkDependencies()},checkDependencies:function(t){var n=e(t);t=n.length?n:e("[data-pum-dependencies]:not([data-pum-processed-dependencies])"),t.each(function(){var t,n=e(this),i=n.data("id"),r=n.data("pum-processed-dependencies")||{},s=Object.keys(r).length,o=0,a=n.data("pum-dependent-fields");if(!n.data("pum-processed-dependencies")){r=n.data("pum-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("pum-processed-dependencies",r).attr("data-pum-processed-dependencies",r)}a||(a=e.map(r,function(t,n){var i=e('.pum-field[data-id="'+n+'"]');return i.length?i.eq(0):null}),n.data("pum-dependent-fields",a)),e(a).each(function(){var t,a=e(this),l=a.find(":input:first"),u=a.data("id"),c=l.val(),d=r[u],p=a.data("pum-field-dependents")||[];if(p.indexOf(i)===-1&&(p.push(i),a.data("pum-field-dependents",p)),"undefined"==typeof d||null===d)return n.hide(),!1;if(a.hasClass("pum-field-radio")&&(c=a.find(":input:checked").val()),a.hasClass("pum-field-multicheck")&&(c=[],a.find(":checkbox:checked").each(function(t){c[t]=e(this).val(),"string"!=typeof c[t]||isNaN(parseInt(c[t]))||(c[t]=parseInt(c[t]))})),a.hasClass("pum-field-select")||a.hasClass("pum-field-radio"))t=d&&d.indexOf(c)!==-1;else if(a.hasClass("pum-field-checkbox"))t=d===l.is(":checked");else if(a.hasClass("pum-field-multicheck"))if(Array.isArray(d)){t=!1;for(var h=0;h<d.length;h++)c.indexOf(d[h])!==-1&&(t=!0)}else t=c.indexOf(d)!==-1;else t=Array.isArray(d)?d.indexOf(c)!==-1:d==c;return t?(o++,void(o===s&&n.show())):(n.hide(),!1)})})},form_check:function(){e(document).trigger("pum_form_check")},is_field:function(e){if("object"!=typeof e)return!1;var t=[void 0===e.type&&(void 0!==e.label||void 0!==e.desc),void 0!==e.type&&"string"==typeof e.type];return t.indexOf(!0)>=0},parseFields:function(e,t){return t=t||{},_.each(e,function(n,i){e[i]=PUM_Admin.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(n,i,r){var s,o=[],a={},l=e.extend(!0,{id:"",tabs:{},sections:{},fields:{},maintabs:{},subtabs:{}},n),u=e.extend({id:l.id,classes:[],tabs:{},vertical:!0,form:!0,meta:{"data-min-height":250}},l.maintabs),c=e.extend({classes:["link-tabs","sub-tabs"],tabs:{}},l.subtabs),d=["pum-dynamic-form"];return i=i||{},Object.keys(l.tabs).length&&Object.keys(l.sections).length?(d.push("tabbed-content"),_.each(l.fields,function(n,r){"object"==typeof n&&Object.keys(n).length&&(void 0===u.tabs[r]&&(u.tabs[r]={label:l.tabs[r],content:""}),c=e.extend(c,{id:l.id+"-"+r+"-subtabs",tabs:{}}),_.each(n,function(e,n){if("object"==typeof e&&Object.keys(e).length){if(t.is_field(e)){var s={};s[n]=e,n="main",e=s}void 0===c.tabs[n]&&(c.tabs[n]={label:l.sections[r][n],content:""}),e=t.parseFields(e,i),_.each(e,function(e){a[e.id]=e,c.tabs[n].content+=PUM_Admin.templates.field(e)}),""===c.tabs[n].content&&delete c.tabs[n]}}),Object.keys(c.tabs).length?u.tabs[r].content=PUM_Admin.templates.tabs(c):delete u.tabs[r])}),Object.keys(u.tabs).length&&(s=PUM_Admin.templates.tabs(u))):Object.keys(l.tabs).length?(d.push("tabbed-content"),_.each(l.fields,function(e,n){"object"==typeof e&&Object.keys(e).length&&(void 0===u.tabs[n]&&(u.tabs[n]={label:l.tabs[n],content:""}),o=[],e=t.parseFields(e,i),_.each(e,function(e){a[e.id]=e,o.push(PUM_Admin.templates.field(e))}),o.length?u.tabs[n].content=PUM_Admin.templates.section({fields:o}):delete u.tabs[n])}),Object.keys(u.tabs).length&&(s=PUM_Admin.templates.tabs(u))):Object.keys(l.sections).length?_.each(l.fields,function(e,n){o=[],o.push(PUM_Admin.templates.field({type:"heading",desc:l.sections[n]||""})),e=t.parseFields(e,i),_.each(e,function(e){a[e.id]=e,o.push(PUM_Admin.templates.field(e))}),s+=PUM_Admin.templates.section({fields:o})}):(l.fields=t.parseFields(l.fields,i),_.each(l.fields,function(e){a[e.id]=e,o.push(PUM_Admin.templates.field(e))}),s=PUM_Admin.templates.section({fields:o})),void 0!==r&&r.length&&r.addClass(d.join(" ")).data("form_fields",a).html(s).trigger("pum_init"),s}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.forms=t,e(document).on("pum_init pum_form_check",function(){PUM_Admin.forms.init()}).on("pumFieldChanged",".pum-field",function(){var t,n=e(this),i=n.data("pum-field-dependents")||[],r=e();if(i&&!(i.length<=0)){for(t=0;t<i.length;t++)r=r.add('.pum-field[data-id="'+i[t]+'"]');PUM_Admin.forms.checkDependencies(r)}}).on("pumFieldChanged",".pum-field-dynamic-desc",function(){var t=e(this),n=t.find(":input"),i=t.parents(".pum-dynamic-form:first"),r=n.val(),s=i.data("form_fields")||{},o=s[t.data("id")]||{},a=t.find(".pum-desc"),l=t.data("pum-dynamic-desc");switch(o.type){case"radio":r=t.find(":input:checked").val()}o.value=r,l&&l.length&&a.html(PUM_Admin.templates.renderInline(l,o))}).on("change",".pum-field-select select",function(){e(this).parents(".pum-field").trigger("pumFieldChanged")}).on("click",".pum-field-checkbox input",function(){e(this).parents(".pum-field").trigger("pumFieldChanged")}).on("click",".pum-field-multicheck input",function(){e(this).parents(".pum-field").trigger("pumFieldChanged")}).on("click",".pum-field-radio input",function(t){var n=e(this),i=n.parents("li"),r=n.parents(".pum-field");r.trigger("pumFieldChanged"),r.find("li.pum-selected").removeClass("pum-selected"),i.addClass("pum-selected")})}(jQuery),function(e){"use strict";var t,n,i=e("html"),r=e(document),s="a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), iframe, object, embed, *[tabindex], *[contenteditable]",o={_current:null,forceFocus:function(e){PUM_Admin.modals._current&&!PUM_Admin.modals._current.contains(e.target)&&(e.stopPropagation(),PUM_Admin.modals._current.focus())},trapEscapeKey:function(e){27===e.keyCode&&(PUM_Admin.modals.closeAll(),e.preventDefault())},trapTabKey:function(t){if(9===t.keyCode){var n=PUM_Admin.modals._current.find("*").filter(s).filter(":visible"),i=e(":focus"),r=n.length,o=n.index(i);t.shiftKey?0===o&&(n.get(r-1).focus(),t.preventDefault()):o===r-1&&(n.get(0).focus(),t.preventDefault())}},setFocusToFirstItem:function(){PUM_Admin.modals._current.find(".pum-modal-content *").filter(s).filter(":visible").first().focus()},closeAll:function(i){e(".pum-modal-background").off("keydown.pum_modal").hide(0,function(){e("html").css({overflow:"visible",width:"auto"}),t&&(t.attr("aria-hidden","false"),t=null),n.length&&n.focus(),PUM_Admin.modals._current=null,r.off("focus.pum_modal"),void 0!==i&&i()}).attr("aria-hidden","true")},show:function(r,s){e(".pum-modal-background").off("keydown.pum_modal").hide(0).attr("aria-hidden","true"),i.data("origwidth",i.innerWidth()).css({overflow:"hidden",width:i.innerWidth()});var o=e(":focus");o.parents(".pum-modal-wrap").length||(n=o),PUM_Admin.modals._current=e(r),PUM_Admin.modals._current.on("keydown.pum_modal",function(e){PUM_Admin.modals.trapEscapeKey(e),PUM_Admin.modals.trapTabKey(e)}).show(0,function(){t=e("body > *").filter(":visible").not(PUM_Admin.modals._current),t.attr("aria-hidden","true"),PUM_Admin.modals._current.trigger("pum_init").on("focus.pum_modal",PUM_Admin.modals.forceFocus),PUM_Admin.modals.setFocusToFirstItem(),void 0!==s&&s()}).attr("aria-hidden","false")},remove:function(t){e(t).remove()},replace:function(t,n){PUM_Admin.modals.remove(e.trim(t)),e("body").append(e.trim(n))},reload:function(t,n,i){PUM_Admin.modals.replace(t,n),PUM_Admin.modals.show(t,i),e(t).trigger("pum_init")}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.modals=o,e(document).on("click",".pum-modal-background, .pum-modal-wrap .cancel, .pum-modal-wrap .pum-modal-close",function(t){var n=e(t.target);(n.hasClass("cancel")||n.hasClass("pum-modal-close")||n.hasClass("submitdelete"))&&(PUM_Admin.modals.closeAll(),t.preventDefault(),t.stopPropagation())})}(jQuery),function(e){"use strict";var t={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,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)}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.models=t}(jQuery),function(e){"use strict";var t={cloneables:{slider:e('<input type="range" class="pum-range-slider" />'),plus:e('<button type="button" class="pum-range-plus">+</button>'),minus:e('<button type="button" class="pum-range-minus">-</button>')},init:function(){e(".pum-field-rangeslider:not(.pum-rangeslider-initialized)").each(function(){var n=e(this).addClass("pum-rangeslider-initialized"),i=n.find("input.pum-range-manual"),r=t.cloneables.slider.clone(),s=t.cloneables.plus.clone(),o=t.cloneables.minus.clone(),a={force:i.data("force-minmax"),min:parseInt(i.attr("min"),10)||0,max:parseInt(i.attr("max"),10)||100,step:parseInt(i.attr("step"),10)||1,value:parseInt(i.attr("value"),10)||0};a.force&&a.value>a.max&&(a.value=a.max,i.val(a.value)),r.prop({min:a.min||0,max:a.force||a.max&&a.max>a.value?a.max:1.5*a.value,step:a.step||1.5*a.value/100,value:a.value}).on("change input",function(){i.trigger("input")}),i.next().after(o,s),i.before(r)})}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.rangesliders=t,e(document).on("pum_init",PUM_Admin.rangesliders.init).on("input",".pum-field-rangeslider.pum-rangeslider-initialized .pum-range-slider",function(){var t=e(this);t.siblings(".pum-range-manual").val(t.val())}).on("change",".pum-range-manual",function(){var t=e(this),n=parseInt(t.prop("max"),0),i=parseInt(t.prop("min"),0),r=parseInt(t.prop("step"),0),s=t.data("force-minmax"),o=parseInt(t.val(),0),a=t.prev();isNaN(o)&&(o=a.val()),s&&o>n?o=n:s&&o<i&&(o=i),t.val(o).trigger("input"),a.prop({max:s||n&&n>o?n:1.5*o,step:r||1.5*o/100,value:o})}).on("click",".pum-range-plus",function(t){var n=e(this).siblings(".pum-range-manual"),i=parseInt(n.prop("max"),0),r=parseInt(n.prop("step"),0),s=n.data("force-minmax"),o=parseInt(n.val(),0),a=n.prev();t.preventDefault(),o+=r,isNaN(o)&&(o=a.val()),s&&o>i&&(o=i),n.val(o).trigger("input"),a.val(o)}).on("click",".pum-range-minus",function(t){var n=e(this).siblings(".pum-range-manual"),i=parseInt(n.prop("min"),0),r=parseInt(n.prop("step"),0),s=n.data("force-minmax"),o=parseInt(n.val(),0),a=n.prev();t.preventDefault(),o-=r,isNaN(o)&&(o=a.val()),s&&o<i&&(o=i),n.val(o).trigger("input"),a.val(o)})}(jQuery),function(e){"use strict";e.fn.pumselect2=e.fn.pumselect2||e.fn.select2;var t={init:function(){e(".pum-field-select2 select").filter(":not(.pumselect2-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:"pum_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:PUM_Admin.select2.formatObject,templateSelection:PUM_Admin.select2.formatObjectSelection})),t.addClass("pumselect2-initialized").pumselect2(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:"pum_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}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.select2=t,e(document).on("pum_init",function(){PUM_Admin.select2.init()})}(jQuery),function(e,t){if("function"!=typeof window.$$){var n,i,r={},s={};window.$$=function(o,a){return a?((n=a.selector)&&(a=n),i=s[a],i===t&&(i=s[a]={}),n=i[o],n!==t?n:i[o]=e(o,$$(a))):(n=r[o],n!==t?n:r[o]=e(o))},window.$$clear=function(e,i){i?((n=i.selector)&&(i=n),e&&(n=s[i])&&(n[e]=t),s[i]=t):e?(r[e]=t,s[e]=t):(r={},s={})},window.$$fresh=function(e,t){return $$clear(e,t),$$(e,t)}}}(jQuery),function(e,t){if("function"==typeof define&&define.amd)define(["exports","jquery"],function(e,n){return t(e,n)});else if("undefined"!=typeof exports){var n=require("jquery");t(exports,n)}else 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"1"===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 u(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 c(){return p}function d(){return JSON.stringify(c())}var p={},h={};this.addPair=l,this.addPairs=u,this.serialize=c,this.serializeJSON=d}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.pumSerializeObject=n.serializeObject,t.fn.pumSerializeJSON=n.serializeJSON),e.FormSerializer=n,n}),function(e){"use strict";var t={init:function(){e(".pum-tabs-container").filter(":not(.pum-tabs-initialized)").each(function(){var t=e(this).addClass("pum-tabs-initialized"),n=t.find("> ul.tabs"),i=n.find("> li:first"),r=t.data("min-height");if(t.hasClass("vertical-tabs")){var s=r&&r>0?r:n.eq(0).outerHeight(!0);t.css({minHeight:s+"px"}),t.parent().innerHeight<s&&t.parent().css({minHeight:s+"px"})}i.trigger("click")})}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.tabs=t,e(document).on("pum_init",PUM_Admin.tabs.init).on("click",".pum-tabs-initialized li.tab",function(t){var n=e(this),i=n.parents(".pum-tabs-container:first"),r=i.find("> ul.tabs > li.tab"),s=i.find("> div.tab-content"),o=n.find("a").attr("href");r.removeClass("active"),s.removeClass("active"),n.addClass("active"),i.find("> div.tab-content"+o).addClass("active"),t.preventDefault()})}(jQuery),function(e){"use strict";var t=pum_admin_vars.I10n,n={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=PUM_Admin.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?"pum-shortcode-w-content":"pum-shortcode";return PUM_Admin.templates.render(i,n)},modal:function(n){var i=e.extend(!0,{},{id:"",title:"",description:"",classes:"",save_button:t.save,cancel_button:t.cancel,content:""},n);return PUM_Admin.templates.render("pum-modal",i)},tabs:function(t){return t=e.extend(!0,{},{id:"",vertical:!1,form:!1,classes:[],tabs:{},meta:{}},t),"string"==typeof t.classes&&(t.classes=[t.classes]),t.form&&t.classes.push("pum-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(" "),PUM_Admin.templates.render("pum-tabs",t)},section:function(t){var n=e.extend(!0,{},{classes:[],fields:[]},t);return PUM_Admin.templates.render("pum-field-section",n)},fieldArgs:function(t){var n=[],i=e.extend(!0,{},PUM_Admin.models.field(t));switch(null!==i.value&&i.value!==!1||void 0===t.std||(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("pum-required")),"string"==typeof i.dynamic_desc&&i.dynamic_desc.length&&(i.classes.push("pum-field-dynamic-desc"),i.desc=PUM_Admin.templates.renderInline(i.dynamic_desc,i)),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||"object"==typeof i.value&&Object.keys(i.value).length&&void 0!==i.value[t]||Array.isArray(i.value)&&i.value.indexOf(t)!==-1)?o="selected":i.multiple||i.value!=t||(o="selected")),n.push(PUM_Admin.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||"object"==typeof i.value&&Object.keys(i.value).length&&void 0!==i.value[t]||Array.isArray(i.value)&&i.value.indexOf(t)!==-1)?n="selected":i.multiple||i.value!=t||(n="selected")),s.push(PUM_Admin.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("pum-field-objectselect"),i.classes.push("postselect"===t.type?"pum-field-postselect":"pum-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("pum-field-select2"),i.placeholder&&(i.meta["data-placeholder"]=i.placeholder));break;case"radio":void 0!==i.options&&(_.each(i.options,function(e,t){n.push(PUM_Admin.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(PUM_Admin.templates.prepareMeta({label:e,value:t,meta:{checked:"object"==typeof i.value&&Object.keys(i.value).length&&void 0!==i.value[t]||Array.isArray(i.value)&&i.value.indexOf(t)!==-1}}))}),i.options=n);break;case"checkbox":switch(typeof i.value){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;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(PUM_Admin.templates.prepareMeta({label:e,value:t,meta:{selected:r}}))}),i.units=n);break;case"license_key":i.value=e.extend({key:"",license:{},messages:[],status:"empty",expires:!1,classes:!1},i.value),i.classes.push("pum-license-"+i.value.status+"-notice"),i.value.classes&&i.classes.push(i.value.classes)}return i},field:function(t){var n,i=PUM_Admin.templates.fieldArgs(t);return n="pum-field-"+i.type,"objectselfect"!==i.type&&"postselect"!==i.type&&"taxonomyselect"!==i.type||(n="pum-field-select"),e("#tmpl-"+n).length?(i.field=PUM_Admin.templates.render(n,i),PUM_Admin.templates.render("pum-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}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.templates=n}(jQuery),function(e){"use strict";function t(t,n){return e.inArray(n,t)!==-1}function n(e,t,i){var r=t[0];t.length>1?(e[r]||(e[r]=t[1]?{}:[]),n(e[r],t.slice(1),i)):(r||(r=e.length),e[r]=i)}String.prototype.capitalize=function(){return this.charAt(0).toUpperCase()+this.slice(1)};var i="color,date,datetime,datetime-local,email,hidden,month,number,password,range,search,tel,text,time,url,week".split(","),r="select,textarea".split(","),s=/\[([^\]]*)\]/g,o={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},checked:function(e,t,n){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;
4
+ },selected:function(e,t,n){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},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)}},serializeForm:function(o){e.extend({},o);var a={},l=e.extend(!0,{include:[],exclude:[],includeByClass:""},o);return this.find(":input").each(function(){var o;!this.name||this.disabled||t(l.exclude,this.name)||l.include.length&&!t(l.include,this.name)||this.className.indexOf(l.includeByClass)===-1||(o=this.name.replace(s,"[$1").split("["),o[0]&&(this.checked||t(i,this.type)||t(r,this.nodeName.toLowerCase()))&&("checkbox"===this.type&&o.push(""),n(a,o,e(this).val())))}),a}};window.PUM_Admin=window.PUM_Admin||{},window.PUM_Admin.utils=o,window.PUMUtils=o,e.fn.pumSerializeForm=o.serializeForm}(jQuery);
classes/Abstract/Upgrade/Popups.php CHANGED
@@ -91,7 +91,7 @@ abstract class PUM_Abstract_Upgrade_Popups extends PUM_Abstract_Upgrade implemen
91
  /**
92
  * Executes a single step in the batch process.
93
  *
94
- * @return int|string|\WP_Error Next step number, 'done', or a WP_Error object.
95
  */
96
  public function process_step() {
97
  $current_count = $this->get_current_count();
91
  /**
92
  * Executes a single step in the batch process.
93
  *
94
+ * @return int|string|WP_Error Next step number, 'done', or a WP_Error object.
95
  */
96
  public function process_step() {
97
  $current_count = $this->get_current_count();
classes/Abstract/Upgrade/Settings.php CHANGED
@@ -26,7 +26,7 @@ abstract class PUM_Abstract_Upgrade_Settings extends PUM_Abstract_Upgrade {
26
  /**
27
  * Executes a single step in the batch process.
28
  *
29
- * @return int|string|\WP_Error Next step number, 'done', or a WP_Error object.
30
  */
31
  public function process_step() {
32
 
26
  /**
27
  * Executes a single step in the batch process.
28
  *
29
+ * @return int|string|WP_Error Next step number, 'done', or a WP_Error object.
30
  */
31
  public function process_step() {
32
 
classes/Abstract/Upgrade/Themes.php CHANGED
@@ -90,7 +90,7 @@ abstract class PUM_Abstract_Upgrade_Themes extends PUM_Abstract_Upgrade implemen
90
  /**
91
  * Executes a single step in the batch process.
92
  *
93
- * @return int|string|\WP_Error Next step number, 'done', or a WP_Error object.
94
  */
95
  public function process_step() {
96
  $current_count = $this->get_current_count();
90
  /**
91
  * Executes a single step in the batch process.
92
  *
93
+ * @return int|string|WP_Error Next step number, 'done', or a WP_Error object.
94
  */
95
  public function process_step() {
96
  $current_count = $this->get_current_count();
classes/Admin/Ajax.php CHANGED
@@ -197,7 +197,7 @@ class PUM_Admin_Ajax {
197
  $process->pre_fetch();
198
  }
199
 
200
- /** @var int|string|\WP_Error $step */
201
  $step = $process->process_step();
202
 
203
  if ( is_wp_error( $step ) ) {
197
  $process->pre_fetch();
198
  }
199
 
200
+ /** @var int|string|WP_Error $step */
201
  $step = $process->process_step();
202
 
203
  if ( is_wp_error( $step ) ) {
classes/Analytics.php CHANGED
@@ -97,15 +97,15 @@ class PUM_Analytics {
97
  }
98
 
99
  /**
100
- * @param \WP_REST_Request $request
101
  *
102
- * @return \WP_Error|mixed
103
  */
104
- public static function analytics_endpoint( \WP_REST_Request $request ) {
105
  $args = $request->get_params();
106
 
107
  if ( ! $args || empty( $args['pid'] ) ) {
108
- return new \WP_Error( 'missing_params', __( 'Missing Parameters.' ), array( 'status' => 404 ) );
109
  }
110
 
111
  self::track( $args );
97
  }
98
 
99
  /**
100
+ * @param WP_REST_Request $request
101
  *
102
+ * @return WP_Error|mixed
103
  */
104
+ public static function analytics_endpoint( WP_REST_Request $request ) {
105
  $args = $request->get_params();
106
 
107
  if ( ! $args || empty( $args['pid'] ) ) {
108
+ return new WP_Error( 'missing_params', __( 'Missing Parameters.' ), array( 'status' => 404 ) );
109
  }
110
 
111
  self::track( $args );
classes/AssetCache.php CHANGED
@@ -80,7 +80,7 @@ class PUM_AssetCache {
80
 
81
  global $wp_filesystem;
82
 
83
- /** @var \WP_Filesystem_Base $wp_filesystem */
84
  $wp_filesystem->mkdir( self::$cache_dir );
85
  }
86
 
@@ -224,7 +224,7 @@ class PUM_AssetCache {
224
 
225
  WP_Filesystem();
226
 
227
- /** @var \WP_Filesystem_Base $wp_filesystem */
228
  global $wp_filesystem;
229
 
230
  return $wp_filesystem->put_contents( $file, $contents, FS_CHMOD_FILE );
80
 
81
  global $wp_filesystem;
82
 
83
+ /** @var WP_Filesystem_Base $wp_filesystem */
84
  $wp_filesystem->mkdir( self::$cache_dir );
85
  }
86
 
224
 
225
  WP_Filesystem();
226
 
227
+ /** @var WP_Filesystem_Base $wp_filesystem */
228
  global $wp_filesystem;
229
 
230
  return $wp_filesystem->put_contents( $file, $contents, FS_CHMOD_FILE );
classes/GA.php CHANGED
@@ -79,7 +79,7 @@ class PUM_GA {
79
  *
80
  * @param null $data
81
  *
82
- * @return array|bool|\WP_Error
83
  */
84
  public static function fire_hit( $data = null ) {
85
  if ( $data ) {
79
  *
80
  * @param null $data
81
  *
82
+ * @return array|bool|WP_Error
83
  */
84
  public static function fire_hit( $data = null ) {
85
  if ( $data ) {
classes/Helpers.php CHANGED
@@ -12,6 +12,18 @@ if ( ! defined( 'ABSPATH' ) ) {
12
 
13
  class PUM_Helpers {
14
 
 
 
 
 
 
 
 
 
 
 
 
 
15
  /**
16
  * Sort array by priority value
17
  *
12
 
13
  class PUM_Helpers {
14
 
15
+ public static function upload_dir_url( $path = '' ) {
16
+ $upload_dir = wp_upload_dir();
17
+ $upload_dir = $upload_dir['baseurl'];
18
+ $upload_dir = preg_replace( '/^https?:/', '', $upload_dir );
19
+
20
+ if ( ! empty ( $path ) ) {
21
+ $upload_dir = trailingslashit( $upload_dir ) . $path;
22
+ }
23
+
24
+ return $upload_dir;
25
+ }
26
+
27
  /**
28
  * Sort array by priority value
29
  *
classes/Model/Popup.php CHANGED
@@ -97,7 +97,7 @@ class PUM_Model_Popup extends PUM_Model_Post {
97
  public function get_title() {
98
  $title = $this->get_meta( 'popup_title' );
99
 
100
- return apply_filters( 'pum_popup_get_title', $title, $this->ID );
101
  }
102
 
103
  /**
97
  public function get_title() {
98
  $title = $this->get_meta( 'popup_title' );
99
 
100
+ return (string) apply_filters( 'pum_popup_get_title', $title, $this->ID );
101
  }
102
 
103
  /**
classes/Popups.php CHANGED
@@ -51,4 +51,3 @@ class PUM_Popups {
51
  }
52
 
53
  }
54
-
51
  }
52
 
53
  }
 
classes/Site/Assets.php CHANGED
@@ -54,8 +54,7 @@ class PUM_Site_Assets {
54
  * Initialize
55
  */
56
  public static function init() {
57
- $upload_dir = wp_upload_dir();
58
- self::$cache_url = trailingslashit( $upload_dir['baseurl'] ) . 'pum';
59
  self::$debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
60
  self::$suffix = self::$debug ? '' : '.min';
61
  self::$js_url = Popup_Maker::$URL . 'assets/js/';
54
  * Initialize
55
  */
56
  public static function init() {
57
+ self::$cache_url = PUM_Helpers::upload_dir_url( 'pum' );
 
58
  self::$debug = defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG;
59
  self::$suffix = self::$debug ? '' : '.min';
60
  self::$js_url = Popup_Maker::$URL . 'assets/js/';
classes/Site/Popups.php CHANGED
@@ -18,7 +18,7 @@ class PUM_Site_Popups {
18
  public static $current;
19
 
20
  /**
21
- * @var \WP_Query|null
22
  */
23
  public static $loaded;
24
 
@@ -65,8 +65,8 @@ class PUM_Site_Popups {
65
  * @return null|WP_Query
66
  */
67
  public static function get_loaded_popups() {
68
- if ( ! self::$loaded instanceof \WP_Query ) {
69
- self::$loaded = new \WP_Query();
70
  self::$loaded->posts = array();
71
  }
72
 
18
  public static $current;
19
 
20
  /**
21
+ * @var WP_Query|null
22
  */
23
  public static $loaded;
24
 
65
  * @return null|WP_Query
66
  */
67
  public static function get_loaded_popups() {
68
+ if ( ! self::$loaded instanceof WP_Query ) {
69
+ self::$loaded = new WP_Query();
70
  self::$loaded->posts = array();
71
  }
72
 
classes/Upgrades.php CHANGED
@@ -410,7 +410,7 @@ class PUM_Upgrades {
410
  $upgrade->pre_fetch();
411
  }
412
 
413
- /** @var int|string|\WP_Error $step */
414
  $step = $upgrade->process_step();
415
 
416
  if ( ! is_wp_error( $step ) ) {
410
  $upgrade->pre_fetch();
411
  }
412
 
413
+ /** @var int|string|WP_Error $step */
414
  $step = $upgrade->process_step();
415
 
416
  if ( ! is_wp_error( $step ) ) {
includes/class-pum.php CHANGED
@@ -7,7 +7,7 @@ if ( ! defined( 'ABSPATH' ) ) {
7
 
8
  class PUM {
9
 
10
- const VER = '1.7.6';
11
 
12
  const DB_VER = 8;
13
 
7
 
8
  class PUM {
9
 
10
+ const VER = '1.7.7';
11
 
12
  const DB_VER = 8;
13
 
includes/popup-functions.php CHANGED
@@ -58,7 +58,7 @@ function pum_is_popup( $popup ) {
58
  /**
59
  * @param $popup_id
60
  *
61
- * @return array|null|\WP_Post
62
  */
63
  function popmake_get_popup( $popup_id ) {
64
  if ( ! $popup_id ) {
@@ -849,7 +849,7 @@ function popmake_popup_is_loadable( $popup_id ) {
849
 
850
 
851
  /**
852
- * @return \WP_Query
853
  */
854
  function get_all_popups() {
855
  $query = PUM_Popups::get_all();
58
  /**
59
  * @param $popup_id
60
  *
61
+ * @return array|null|WP_Post
62
  */
63
  function popmake_get_popup( $popup_id ) {
64
  if ( ! $popup_id ) {
849
 
850
 
851
  /**
852
+ * @return WP_Query
853
  */
854
  function get_all_popups() {
855
  $query = PUM_Popups::get_all();
includes/pum-popup-functions.php CHANGED
@@ -25,7 +25,13 @@ function pum_popup( $popup_id = null ) {
25
  * @return string
26
  */
27
  function pum_get_popup_title( $popup_id = null ) {
28
- return pum_get_popup( $popup_id )->get_title();
 
 
 
 
 
 
29
  }
30
 
31
  /**
@@ -36,7 +42,13 @@ function pum_get_popup_title( $popup_id = null ) {
36
  * @return array
37
  */
38
  function pum_get_popup_triggers( $popup_id = null ) {
39
- return pum_get_popup( $popup_id )->get_triggers();
 
 
 
 
 
 
40
  }
41
 
42
  /**
@@ -47,7 +59,13 @@ function pum_get_popup_triggers( $popup_id = null ) {
47
  * @return array
48
  */
49
  function pum_get_popup_cookies( $popup_id = null ) {
50
- return pum_get_popup( $popup_id )->get_cookies();
 
 
 
 
 
 
51
  }
52
 
53
  /**
@@ -56,5 +74,11 @@ function pum_get_popup_cookies( $popup_id = null ) {
56
  * @return bool
57
  */
58
  function pum_is_popup_loadable( $popup_id = null ) {
59
- return pum_get_popup( $popup_id )->is_loadable();
 
 
 
 
 
 
60
  }
25
  * @return string
26
  */
27
  function pum_get_popup_title( $popup_id = null ) {
28
+ $popup = pum_get_popup( $popup_id );
29
+
30
+ if ( ! pum_is_popup( $popup ) ) {
31
+ return "";
32
+ }
33
+
34
+ return $popup->get_title();
35
  }
36
 
37
  /**
42
  * @return array
43
  */
44
  function pum_get_popup_triggers( $popup_id = null ) {
45
+ $popup = pum_get_popup( $popup_id );
46
+
47
+ if ( ! pum_is_popup( $popup ) ) {
48
+ return array();
49
+ }
50
+
51
+ return $popup->get_triggers();
52
  }
53
 
54
  /**
59
  * @return array
60
  */
61
  function pum_get_popup_cookies( $popup_id = null ) {
62
+ $popup = pum_get_popup( $popup_id );
63
+
64
+ if ( ! pum_is_popup( $popup ) ) {
65
+ return array();
66
+ }
67
+
68
+ return $popup->get_cookies();
69
  }
70
 
71
  /**
74
  * @return bool
75
  */
76
  function pum_is_popup_loadable( $popup_id = null ) {
77
+ $popup = pum_get_popup( $popup_id );
78
+
79
+ if ( ! pum_is_popup( $popup ) ) {
80
+ return false;
81
+ }
82
+
83
+ return $popup->is_loadable();
84
  }
includes/pum-sdk/freemius/includes/class-freemius.php CHANGED
@@ -2377,7 +2377,7 @@
2377
  * @author Vova Feldman (@svovaf)
2378
  * @since 1.1.7.4
2379
  *
2380
- * @return \WP_User
2381
  */
2382
  static function _get_current_wp_user() {
2383
  self::require_pluggable_essentials();
2377
  * @author Vova Feldman (@svovaf)
2378
  * @since 1.1.7.4
2379
  *
2380
+ * @return WP_User
2381
  */
2382
  static function _get_current_wp_user() {
2383
  self::require_pluggable_essentials();
includes/pum-sdk/freemius/includes/class-fs-plugin-updater.php CHANGED
@@ -674,7 +674,7 @@ if ( !isset($info->error) ) {
674
  *
675
  * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/.
676
  * @param string $remote_source Path to upgrade/zip-file-name.tmp.
677
- * @param \WP_Upgrader $upgrader Instance of the upgrader which installs the plugin.
678
  *
679
  * @return string|WP_Error
680
  */
674
  *
675
  * @param string $source Path to upgrade/zip-file-name.tmp/subdirectory/.
676
  * @param string $remote_source Path to upgrade/zip-file-name.tmp.
677
+ * @param WP_Upgrader $upgrader Instance of the upgrader which installs the plugin.
678
  *
679
  * @return string|WP_Error
680
  */
includes/pum-sdk/freemius/includes/sdk/FreemiusWordPress.php CHANGED
@@ -587,7 +587,7 @@
587
  #----------------------------------------------------------------------------------
588
 
589
  /**
590
- * @param \WP_Error $pError
591
  *
592
  * @return bool
593
  */
587
  #----------------------------------------------------------------------------------
588
 
589
  /**
590
+ * @param WP_Error $pError
591
  *
592
  * @return bool
593
  */
languages/popup-maker.pot CHANGED
@@ -162,7 +162,7 @@ msgstr ""
162
  msgid "Subscribers"
163
  msgstr ""
164
 
165
- #: classes/Admin/Pages.php:56, classes/Admin/Pages.php:149, classes/Admin/Templates.php:415, classes/Admin/Templates.php:643, classes/Site/Assets.php:242, includes/admin/admin-setup.php:24
166
  msgid "Settings"
167
  msgstr ""
168
 
@@ -254,7 +254,7 @@ msgstr ""
254
  msgid "Display"
255
  msgstr ""
256
 
257
- #: classes/Admin/Popups.php:291, classes/Admin/Popups.php:307, classes/Admin/Templates.php:406, classes/Site/Assets.php:243
258
  msgid "Triggers"
259
  msgstr ""
260
 
@@ -266,7 +266,7 @@ msgstr ""
266
  msgid "General Settings"
267
  msgstr ""
268
 
269
- #: classes/Admin/Popups.php:310, classes/Site/Assets.php:246
270
  msgid "Conditions"
271
  msgstr ""
272
 
@@ -1120,7 +1120,7 @@ msgstr ""
1120
  msgid "Cookies control the repeat display of a popup."
1121
  msgstr ""
1122
 
1123
- #: classes/Admin/Templates.php:634, classes/Site/Assets.php:244
1124
  msgid "Cookies"
1125
  msgstr ""
1126
 
@@ -1780,79 +1780,79 @@ msgstr ""
1780
  msgid "Subscription Form Placeholder"
1781
  msgstr ""
1782
 
1783
- #: classes/Site/Assets.php:231, classes/Types.php:22, includes/admin/class-pum-admin-upgrades.php:110, includes/admin/class-pum-admin-upgrades.php:111, includes/admin/class-pum-admin-upgrades.php:256, includes/integrations/class-pum-gravity-forms.php:53, includes/modules/admin-bar.php:414
1784
  msgid "Popup Maker"
1785
  msgstr ""
1786
 
1787
- #: classes/Site/Assets.php:231
1788
  msgid "Debug Mode Enabled"
1789
  msgstr ""
1790
 
1791
- #: classes/Site/Assets.php:232
1792
  msgid "Debug started at:"
1793
  msgstr ""
1794
 
1795
- #: classes/Site/Assets.php:233
1796
  msgid "For more information on how to use this information visit %s"
1797
  msgstr ""
1798
 
1799
- #: classes/Site/Assets.php:234
1800
  msgid "Global Information"
1801
  msgstr ""
1802
 
1803
- #: classes/Site/Assets.php:235
1804
  msgid "Localized variables"
1805
  msgstr ""
1806
 
1807
- #: classes/Site/Assets.php:236
1808
  msgid "Popups Initializing"
1809
  msgstr ""
1810
 
1811
- #: classes/Site/Assets.php:237
1812
  msgid "Popups Initialized"
1813
  msgstr ""
1814
 
1815
- #: classes/Site/Assets.php:238
1816
  msgid "Popup: #"
1817
  msgstr ""
1818
 
1819
- #: classes/Site/Assets.php:239
1820
  msgid "Theme ID: "
1821
  msgstr ""
1822
 
1823
- #: classes/Site/Assets.php:240
1824
  msgid "Method Call:"
1825
  msgstr ""
1826
 
1827
- #: classes/Site/Assets.php:241
1828
  msgid "Method Arguments:"
1829
  msgstr ""
1830
 
1831
- #: classes/Site/Assets.php:245
1832
  msgid "Delay:"
1833
  msgstr ""
1834
 
1835
- #: classes/Site/Assets.php:247
1836
  msgid "Cookie:"
1837
  msgstr ""
1838
 
1839
- #: classes/Site/Assets.php:248
1840
  msgid "Settings:"
1841
  msgstr ""
1842
 
1843
- #: classes/Site/Assets.php:249
1844
  msgid "Selector:"
1845
  msgstr ""
1846
 
1847
- #: classes/Site/Assets.php:250
1848
  msgid "Mobile Disabled:"
1849
  msgstr ""
1850
 
1851
- #: classes/Site/Assets.php:251
1852
  msgid "Tablet Disabled:"
1853
  msgstr ""
1854
 
1855
- #: classes/Site/Assets.php:252
1856
  msgid "Event: %s"
1857
  msgstr ""
1858
 
162
  msgid "Subscribers"
163
  msgstr ""
164
 
165
+ #: classes/Admin/Pages.php:56, classes/Admin/Pages.php:149, classes/Admin/Templates.php:415, classes/Admin/Templates.php:643, classes/Site/Assets.php:241, includes/admin/admin-setup.php:24
166
  msgid "Settings"
167
  msgstr ""
168
 
254
  msgid "Display"
255
  msgstr ""
256
 
257
+ #: classes/Admin/Popups.php:291, classes/Admin/Popups.php:307, classes/Admin/Templates.php:406, classes/Site/Assets.php:242
258
  msgid "Triggers"
259
  msgstr ""
260
 
266
  msgid "General Settings"
267
  msgstr ""
268
 
269
+ #: classes/Admin/Popups.php:310, classes/Site/Assets.php:245
270
  msgid "Conditions"
271
  msgstr ""
272
 
1120
  msgid "Cookies control the repeat display of a popup."
1121
  msgstr ""
1122
 
1123
+ #: classes/Admin/Templates.php:634, classes/Site/Assets.php:243
1124
  msgid "Cookies"
1125
  msgstr ""
1126
 
1780
  msgid "Subscription Form Placeholder"
1781
  msgstr ""
1782
 
1783
+ #: classes/Site/Assets.php:230, classes/Types.php:22, includes/admin/class-pum-admin-upgrades.php:110, includes/admin/class-pum-admin-upgrades.php:111, includes/admin/class-pum-admin-upgrades.php:256, includes/integrations/class-pum-gravity-forms.php:53, includes/modules/admin-bar.php:414
1784
  msgid "Popup Maker"
1785
  msgstr ""
1786
 
1787
+ #: classes/Site/Assets.php:230
1788
  msgid "Debug Mode Enabled"
1789
  msgstr ""
1790
 
1791
+ #: classes/Site/Assets.php:231
1792
  msgid "Debug started at:"
1793
  msgstr ""
1794
 
1795
+ #: classes/Site/Assets.php:232
1796
  msgid "For more information on how to use this information visit %s"
1797
  msgstr ""
1798
 
1799
+ #: classes/Site/Assets.php:233
1800
  msgid "Global Information"
1801
  msgstr ""
1802
 
1803
+ #: classes/Site/Assets.php:234
1804
  msgid "Localized variables"
1805
  msgstr ""
1806
 
1807
+ #: classes/Site/Assets.php:235
1808
  msgid "Popups Initializing"
1809
  msgstr ""
1810
 
1811
+ #: classes/Site/Assets.php:236
1812
  msgid "Popups Initialized"
1813
  msgstr ""
1814
 
1815
+ #: classes/Site/Assets.php:237
1816
  msgid "Popup: #"
1817
  msgstr ""
1818
 
1819
+ #: classes/Site/Assets.php:238
1820
  msgid "Theme ID: "
1821
  msgstr ""
1822
 
1823
+ #: classes/Site/Assets.php:239
1824
  msgid "Method Call:"
1825
  msgstr ""
1826
 
1827
+ #: classes/Site/Assets.php:240
1828
  msgid "Method Arguments:"
1829
  msgstr ""
1830
 
1831
+ #: classes/Site/Assets.php:244
1832
  msgid "Delay:"
1833
  msgstr ""
1834
 
1835
+ #: classes/Site/Assets.php:246
1836
  msgid "Cookie:"
1837
  msgstr ""
1838
 
1839
+ #: classes/Site/Assets.php:247
1840
  msgid "Settings:"
1841
  msgstr ""
1842
 
1843
+ #: classes/Site/Assets.php:248
1844
  msgid "Selector:"
1845
  msgstr ""
1846
 
1847
+ #: classes/Site/Assets.php:249
1848
  msgid "Mobile Disabled:"
1849
  msgstr ""
1850
 
1851
+ #: classes/Site/Assets.php:250
1852
  msgid "Tablet Disabled:"
1853
  msgstr ""
1854
 
1855
+ #: classes/Site/Assets.php:251
1856
  msgid "Event: %s"
1857
  msgstr ""
1858
 
popup-maker.php CHANGED
@@ -4,7 +4,7 @@
4
  * Plugin URI: https://wppopupmaker.com/?utm_campaign=PluginInfo&utm_source=plugin-header&utm_medium=plugin-uri
5
  * Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
6
  * Author: WP Popup Maker
7
- * Version: 1.7.6
8
  * Author URI: https://wppopupmaker.com/?utm_campaign=PluginInfo&utm_source=plugin-header&utm_medium=author-uri
9
  * Text Domain: popup-maker
10
  *
@@ -93,7 +93,7 @@ class Popup_Maker {
93
  /**
94
  * @var string Plugin Version
95
  */
96
- public static $VER = '1.7.6';
97
 
98
  /**
99
  * @var int DB Version
@@ -214,6 +214,8 @@ class Popup_Maker {
214
  */
215
  private function includes() {
216
 
 
 
217
  // Initialize global options
218
  PUM_Options::init();
219
 
4
  * Plugin URI: https://wppopupmaker.com/?utm_campaign=PluginInfo&utm_source=plugin-header&utm_medium=plugin-uri
5
  * Description: Easily create & style popups with any content. Theme editor to quickly style your popups. Add forms, social media boxes, videos & more.
6
  * Author: WP Popup Maker
7
+ * Version: 1.7.7
8
  * Author URI: https://wppopupmaker.com/?utm_campaign=PluginInfo&utm_source=plugin-header&utm_medium=author-uri
9
  * Text Domain: popup-maker
10
  *
93
  /**
94
  * @var string Plugin Version
95
  */
96
+ public static $VER = '1.7.7';
97
 
98
  /**
99
  * @var int DB Version
214
  */
215
  private function includes() {
216
 
217
+ require_once self::$DIR . 'includes/compat.php';
218
+
219
  // Initialize global options
220
  PUM_Options::init();
221
 
readme.txt CHANGED
@@ -6,7 +6,7 @@ Donate link:
6
  Tags: marketing, popup, popups, optin, advertising, conversion, responsive popups, promotion, popover, pop-up, pop over, lightbox, conversion, modal
7
  Requires at least: 3.6
8
  Tested up to: 4.9.4
9
- Stable tag: 1.7.6
10
  License: GNU Version 3 or Any Later Version
11
 
12
  Everything you need to create unique user experiences. Insert forms & other content from your favorite plugins to create custom responsive popups.
@@ -101,24 +101,33 @@ There are several common causes for this which include:
101
 
102
  == Changelog ==
103
 
104
- = v1.7.5 - 03/12/2017 =
 
 
 
 
 
 
 
 
 
105
  * Fix: Sticky Popup Maker settings checkboxes that wouldn't uncheck after save.
106
 
107
- = v1.7.4 - 03/12/2017 =
108
  * Fix: Invalid method declaration error introduced by v1.7.2 patch to Shortcode core class.
109
 
110
- = v1.7.3 - 03/12/2017 =
111
  * Fix: Error due to usage of __CLASS__ rather than $this.
112
  * Fix: Edge case where function returns can't be used inside empty().
113
 
114
- = v1.7.2 - 03/12/2017 =
115
  * Fix: Initialization variable wasn't set to true early enough.
116
 
117
- = v1.7.1 - 03/12/2017 =
118
  * Fix: Empty value errors.
119
  * Fix: Missing function for 3rd party plugin backward compatibility (Elementor).
120
 
121
- = v1.7.0 - 03/12/2017 =
122
  This was one of our biggest updates to date in terms of improving existing functionality, reducing maintenance and the time it takes to implement new features in the future.
123
 
124
  Noticeably there are a lot of interface changes with this version as we simplified from having many meta boxes in the popup editor to a new single panel interface.
6
  Tags: marketing, popup, popups, optin, advertising, conversion, responsive popups, promotion, popover, pop-up, pop over, lightbox, conversion, modal
7
  Requires at least: 3.6
8
  Tested up to: 4.9.4
9
+ Stable tag: 1.7.7
10
  License: GNU Version 3 or Any Later Version
11
 
12
  Everything you need to create unique user experiences. Insert forms & other content from your favorite plugins to create custom responsive popups.
101
 
102
  == Changelog ==
103
 
104
+ = v1.7.7 - 03/13/2018 =
105
+ * Fix: Removed jQuery.serializeJSON functionality which was unused and causing conflicts with WooCommerce.
106
+ * Fix: SSL Issues due to not specifying protocol.
107
+ * Fix: Error caused by invalid popup object being used in function.
108
+ * Fix: PHP 5.2 compatibility issue.
109
+
110
+ = v1.7.6 - 03/12/2018 =
111
+ * Fix: Undid previous changes from 1.7.1 and reworked in a new way to be backward compatible with existing extensions.
112
+
113
+ = v1.7.5 - 03/12/2018 =
114
  * Fix: Sticky Popup Maker settings checkboxes that wouldn't uncheck after save.
115
 
116
+ = v1.7.4 - 03/12/2018 =
117
  * Fix: Invalid method declaration error introduced by v1.7.2 patch to Shortcode core class.
118
 
119
+ = v1.7.3 - 03/12/2018 =
120
  * Fix: Error due to usage of __CLASS__ rather than $this.
121
  * Fix: Edge case where function returns can't be used inside empty().
122
 
123
+ = v1.7.2 - 03/12/2018 =
124
  * Fix: Initialization variable wasn't set to true early enough.
125
 
126
+ = v1.7.1 - 03/12/2018 =
127
  * Fix: Empty value errors.
128
  * Fix: Missing function for 3rd party plugin backward compatibility (Elementor).
129
 
130
+ = v1.7.0 - 03/12/2018 =
131
  This was one of our biggest updates to date in terms of improving existing functionality, reducing maintenance and the time it takes to implement new features in the future.
132
 
133
  Noticeably there are a lot of interface changes with this version as we simplified from having many meta boxes in the popup editor to a new single panel interface.