/*
 Select2 4.1.0-rc.0 | https://github.com/select2/select2/blob/master/LICENSE.md */
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof module&&module.exports?module.exports=function(e,b){return void 0===b&&(b="undefined"!=typeof window?require("jquery"):require("jquery")(e)),a(b),b}:a(jQuery)}(function(a){function e(a,b){var c,q,g,f,x,d,e=b&&b.split("/"),h=z.map,l=h&&h["*"]||{};if(a){b=(a=a.split("/")).length-1;z.nodeIdCompat&&E.test(a[b])&&(a[b]=a[b].replace(E,""));"."===a[0].charAt(0)&&e&&(a=e.slice(0,e.length-1).concat(a));for(b=0;b<a.length;b++)"."===
(c=a[b])?(a.splice(b,1),--b):".."===c&&(0===b||1===b&&".."===a[2]||".."===a[b-1]||0<b&&(a.splice(b-1,2),b-=2));a=a.join("/")}if((e||l)&&h){for(b=(c=a.split("/")).length;0<b;--b){if(q=c.slice(0,b).join("/"),e)for(d=e.length;0<d;--d)if(g=h[e.slice(0,d).join("/")],g=g&&g[q]){var B=g;var F=b;break}if(B)break;!f&&l&&l[q]&&(f=l[q],x=b)}!B&&f&&(B=f,F=x);B&&(c.splice(0,F,B),a=c.join("/"))}return a}function b(a,b){return function(){var c=G.call(arguments,0);return"string"!=typeof c[0]&&1===c.length&&c.push(null),
p.apply(m,c.concat([a,b]))}}function c(a){var b;if(A.call(y,a)&&(b=y[a],delete y[a],D[a]=!0,n.apply(m,b)),!A.call(v,a)&&!A.call(D,a))throw Error("No "+a);return v[a]}function d(a){var b,c=a?a.indexOf("!"):-1;return-1<c&&(b=a.substring(0,c),a=a.substring(c+1,a.length)),[b,a]}function h(a){return a?d(a):[]}var l,k,m,n,p,u,w,v,y,z,D,A,G,E;var C=((r=a&&a.fn&&a.fn.select2&&a.fn.select2.amd?a.fn.select2.amd:r)&&r.requirejs||(r?k=r:r={},v={},y={},z={},D={},A=Object.prototype.hasOwnProperty,G=[].slice,E=
/\.js$/,u=function(a,b){var t,q,g=d(a),f=g[0];b=b[1];return a=g[1],f&&(t=c(f=e(f,b))),f?a=t&&t.normalize?t.normalize(a,(q=b,function(a){return e(a,q)})):e(a,b):(f=(g=d(a=e(a,b)))[0],a=g[1],f&&(t=c(f))),{f:f?f+"!"+a:a,n:a,pr:f,p:t}},w={require:function(a){return b(a)},exports:function(a){var b=v[a];return void 0!==b?b:v[a]={}},module:function(a){return{id:a,uri:"",exports:v[a],config:(b=a,function(){return z&&z.config&&z.config[b]||{}})};var b}},n=function(a,d,e,q){var g,f,x=[];var t=typeof e;var l=
h(q=q||a);if("undefined"==t||"function"==t){d=!d.length&&e.length?["require","exports","module"]:d;for(f=0;f<d.length;f+=1)if("require"===(t=(g=u(d[f],l)).f))x[f]=w.require(a);else if("exports"===t){x[f]=w.exports(a);var F=!0}else if("module"===t)var B=x[f]=w.module(a);else if(A.call(v,t)||A.call(y,t)||A.call(D,t))x[f]=c(t);else{if(!g.p)throw Error(a+" missing "+t);g.p.load(g.n,b(q,!0),function(a){return function(f){v[a]=f}}(t),{});x[f]=v[t]}t=e?e.apply(v[a],x):void 0;a&&(B&&B.exports!==m&&B.exports!==
v[a]?v[a]=B.exports:t===m&&F||(v[a]=t))}else a&&(v[a]=e)},l=k=p=function(a,b,d,q,g){if("string"==typeof a)return w[a]?w[a](b):c(u(a,h(b)).f);if(!a.splice){if((z=a).deps&&p(z.deps,z.callback),!b)return;b.splice?(a=b,b=d,d=null):a=m}return b=b||function(){},"function"==typeof d&&(d=q,q=g),q?n(m,a,b,d):setTimeout(function(){n(m,a,b,d)},4),p},p.config=function(a){return p(a)},l._defined=v,(C=function(a,b,c){if("string"!=typeof a)throw Error("See almond README: incorrect module build, no module name");
b.splice||(c=b,b=[]);A.call(v,a)||A.call(y,a)||(y[a]=[a,b,c])}).amd={jQuery:!0},r.requirejs=l,r.require=k,r.define=C),r.define("almond",function(){}),r.define("jquery",[],function(){var b=a||$;return null==b&&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."),b}),r.define("select2/utils",["jquery"],function(a){function b(a){var b;a=a.prototype;var f=[];for(b in a)"function"==
typeof a[b]&&"constructor"!==b&&f.push(b);return f}function c(){this.listeners={}}var q={Extend:function(a,b){function f(){this.constructor=a}var g,c={}.hasOwnProperty;for(g in b)c.call(b,g)&&(a[g]=b[g]);return f.prototype=b.prototype,a.prototype=new f,a.__super__=b.prototype,a},Decorate:function(a,g){function f(){var b=Array.prototype.unshift,f=a.prototype.constructor;0<g.prototype.constructor.length&&(b.call(arguments,a.prototype.constructor),f=g.prototype.constructor);f.apply(this,arguments)}var c=
b(g),q=b(a);g.displayName=a.displayName;f.prototype=new function(){this.constructor=f};for(var x=0;x<q.length;x++){var d=q[x];f.prototype[d]=a.prototype[d]}for(q=0;q<c.length;q++)x=c[q],f.prototype[x]=function(a){var b=function(){};a in f.prototype&&(b=f.prototype[a]);var c=g.prototype[a];return function(){return Array.prototype.unshift.call(arguments,b),c.apply(this,arguments)}}(x);return f}};c.prototype.on=function(a,b){this.listeners=this.listeners||{};a in this.listeners?this.listeners[a].push(b):
this.listeners[a]=[b]};c.prototype.trigger=function(a){var b=Array.prototype.slice,f=b.call(arguments,1);this.listeners=this.listeners||{};0===(f=null==f?[]:f).length&&f.push({});(f[0]._type=a)in this.listeners&&this.invoke(this.listeners[a],b.call(arguments,1));"*"in this.listeners&&this.invoke(this.listeners["*"],arguments)};c.prototype.invoke=function(a,b){for(var f=0,g=a.length;f<g;f++)a[f].apply(this,b)};q.Observable=c;q.generateChars=function(a){for(var b="",f=0;f<a;f++)b+=Math.floor(36*Math.random()).toString(36);
return b};q.bind=function(a,b){return function(){a.apply(b,arguments)}};q._convertData=function(a){for(var b in a){var f=b.split("-"),g=a;if(1!==f.length){for(var c=0;c<f.length;c++){var q=f[c];(q=q.substring(0,1).toLowerCase()+q.substring(1))in g||(g[q]={});c==f.length-1&&(g[q]=a[b]);g=g[q]}delete a[b]}}return a};q.hasScroll=function(b,g){b=a(g);var f=g.style.overflowX,c=g.style.overflowY;return(f!==c||"hidden"!==c&&"visible"!==c)&&("scroll"===f||"scroll"===c||b.innerHeight()<g.scrollHeight||b.innerWidth()<
g.scrollWidth)};q.escapeMarkup=function(a){var b={"\\":"&#92;","&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#47;"};return"string"!=typeof a?a:String(a).replace(/[&<>"'\/\\]/g,function(a){return b[a]})};q.__cache={};var g=0;return q.GetUniqueElementId=function(a){var b=a.getAttribute("data-select2-id");return null!=b||(b=a.id?"select2-data-"+a.id:"select2-data-"+(++g).toString()+"-"+q.generateChars(4),a.setAttribute("data-select2-id",b)),b},q.StoreData=function(a,b,g){a=q.GetUniqueElementId(a);
q.__cache[a]||(q.__cache[a]={});q.__cache[a][b]=g},q.GetData=function(b,g){var f=q.GetUniqueElementId(b);return g?q.__cache[f]&&null!=q.__cache[f][g]?q.__cache[f][g]:a(b).data(g):q.__cache[f]},q.RemoveData=function(a){var b=q.GetUniqueElementId(a);null!=q.__cache[b]&&delete q.__cache[b];a.removeAttribute("data-select2-id")},q.copyNonInternalCssClasses=function(a,b){var f=(f=a.getAttribute("class").trim().split(/\s+/)).filter(function(a){return 0===a.indexOf("select2-")});b=(b=b.getAttribute("class").trim().split(/\s+/)).filter(function(a){return 0!==
a.indexOf("select2-")});b=f.concat(b);a.setAttribute("class",b.join(" "))},q}),r.define("select2/results",["jquery","./utils"],function(a,b){function c(a,b,f){this.$element=a;this.data=f;this.options=b;c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<ul class="select2-results__options" role="listbox"></ul>');return this.options.get("multiple")&&b.attr("aria-multiselectable","true"),this.$results=b},c.prototype.clear=function(){this.$results.empty()},
c.prototype.displayMessage=function(b){var g=this.options.get("escapeMarkup");this.clear();this.hideLoading();var f=a('<li role="alert" aria-live="assertive" class="select2-results__option"></li>'),c=this.options.get("translations").get(b.message);f.append(g(c(b.args)));f[0].className+=" select2-results__message";this.$results.append(f)},c.prototype.hideMessages=function(){this.$results.find(".select2-results__message").remove()},c.prototype.append=function(a){this.hideLoading();var b=[];if(null!=
a.results&&0!==a.results.length){a.results=this.sort(a.results);for(var f=0;f<a.results.length;f++){var c=a.results[f];c=this.option(c);b.push(c)}this.$results.append(b)}else 0===this.$results.children().length&&this.trigger("results:message",{message:"noResults"})},c.prototype.position=function(a,b){b.find(".select2-results").append(a)},c.prototype.sort=function(a){return this.options.get("sorter")(a)},c.prototype.highlightFirstItem=function(){var a=this.$results.find(".select2-results__option--selectable"),
b=a.filter(".select2-results__option--selected");(0<b.length?b:a).first().trigger("mouseenter");this.ensureHighlightVisible()},c.prototype.setClasses=function(){var c=this;this.data.current(function(g){var f=g.map(function(a){return a.id.toString()});c.$results.find(".select2-results__option--selectable").each(function(){var c=a(this),g=b.GetData(this,"data"),q=""+g.id;null!=g.element&&g.element.selected||null==g.element&&-1<f.indexOf(q)?(this.classList.add("select2-results__option--selected"),c.attr("aria-selected",
"true")):(this.classList.remove("select2-results__option--selected"),c.attr("aria-selected","false"))})})},c.prototype.showLoading=function(a){this.hideLoading();a={disabled:!0,loading:!0,text:this.options.get("translations").get("searching")(a)};a=this.option(a);a.className+=" loading-results";this.$results.prepend(a)},c.prototype.hideLoading=function(){this.$results.find(".loading-results").remove()},c.prototype.option=function(c){var g=document.createElement("li");g.classList.add("select2-results__option");
g.classList.add("select2-results__option--selectable");var f={role:"option"},q=window.Element.prototype.matches||window.Element.prototype.msMatchesSelector||window.Element.prototype.webkitMatchesSelector;for(d in(null!=c.element&&q.call(c.element,":disabled")||null==c.element&&c.disabled)&&(f["aria-disabled"]="true",g.classList.remove("select2-results__option--selectable"),g.classList.add("select2-results__option--disabled")),null==c.id&&g.classList.remove("select2-results__option--selectable"),null!=
c._resultId&&(g.id=c._resultId),c.title&&(g.title=c.title),c.children&&(f.role="group",f["aria-label"]=c.text,g.classList.remove("select2-results__option--selectable"),g.classList.add("select2-results__option--group")),f)g.setAttribute(d,f[d]);if(c.children){var d=a(g);f=document.createElement("strong");f.className="select2-results__group";this.template(c,f);var e=[];for(q=0;q<c.children.length;q++){var t=c.children[q];t=this.option(t);e.push(t)}q=a("<ul></ul>",{class:"select2-results__options select2-results__options--nested",
role:"none"});q.append(e);d.append(f);d.append(q)}else this.template(c,g);return b.StoreData(g,"data",c),g},c.prototype.bind=function(c,g){var f=this;this.$results.attr("id",c.id+"-results");c.on("results:all",function(a){f.clear();f.append(a.data);c.isOpen()&&(f.setClasses(),f.highlightFirstItem())});c.on("results:append",function(a){f.append(a.data);c.isOpen()&&f.setClasses()});c.on("query",function(a){f.hideMessages();f.showLoading(a)});c.on("select",function(){c.isOpen()&&(f.setClasses(),f.options.get("scrollAfterSelect")&&
f.highlightFirstItem())});c.on("unselect",function(){c.isOpen()&&(f.setClasses(),f.options.get("scrollAfterSelect")&&f.highlightFirstItem())});c.on("open",function(){f.$results.attr("aria-expanded","true");f.$results.attr("aria-hidden","false");f.setClasses();f.ensureHighlightVisible()});c.on("close",function(){f.$results.attr("aria-expanded","false");f.$results.attr("aria-hidden","true");f.$results.removeAttr("aria-activedescendant")});c.on("results:toggle",function(){var a=f.getHighlightedResults();
0!==a.length&&a.trigger("mouseup")});c.on("results:select",function(){var a,c=f.getHighlightedResults();0!==c.length&&(a=b.GetData(c[0],"data"),c.hasClass("select2-results__option--selected")?f.trigger("close",{}):f.trigger("select",{data:a}))});c.on("results:previous",function(){var a,b=f.getHighlightedResults(),c=f.$results.find(".select2-results__option--selectable"),g=c.index(b);0>=g||(a=g-1,0===b.length&&(a=0),(g=c.eq(a)).trigger("mouseenter"),b=f.$results.offset().top,c=g.offset().top,g=f.$results.scrollTop()+
(c-b),0===a?f.$results.scrollTop(0):0>c-b&&f.$results.scrollTop(g))});c.on("results:next",function(){var a,b=f.getHighlightedResults(),c=f.$results.find(".select2-results__option--selectable"),g=c.index(b)+1;g>=c.length||((a=c.eq(g)).trigger("mouseenter"),b=f.$results.offset().top+f.$results.outerHeight(!1),c=a.offset().top+a.outerHeight(!1),a=f.$results.scrollTop()+c-b,0===g?f.$results.scrollTop(0):b<c&&f.$results.scrollTop(a))});c.on("results:focus",function(a){a.element[0].classList.add("select2-results__option--highlighted");
a.element[0].setAttribute("aria-selected","true")});c.on("results:message",function(a){f.displayMessage(a)});a.fn.mousewheel&&this.$results.on("mousewheel",function(a){var b=f.$results.scrollTop(),c=f.$results.get(0).scrollHeight-b+a.deltaY;b=0<a.deltaY&&0>=b-a.deltaY;c=0>a.deltaY&&c<=f.$results.height();b?(f.$results.scrollTop(0),a.preventDefault(),a.stopPropagation()):c&&(f.$results.scrollTop(f.$results.get(0).scrollHeight-f.$results.height()),a.preventDefault(),a.stopPropagation())});this.$results.on("mouseup",
".select2-results__option--selectable",function(c){var g=a(this),q=b.GetData(this,"data");g.hasClass("select2-results__option--selected")?f.options.get("multiple")?f.trigger("unselect",{originalEvent:c,data:q}):f.trigger("close",{}):f.trigger("select",{originalEvent:c,data:q})});this.$results.on("mouseenter",".select2-results__option--selectable",function(c){c=b.GetData(this,"data");f.getHighlightedResults().removeClass("select2-results__option--highlighted").attr("aria-selected","false");f.trigger("results:focus",
{data:c,element:a(this)})})},c.prototype.getHighlightedResults=function(){return this.$results.find(".select2-results__option--highlighted")},c.prototype.destroy=function(){this.$results.remove()},c.prototype.ensureHighlightVisible=function(){var a,b,c,d,e=this.getHighlightedResults();0!==e.length&&(a=this.$results.find(".select2-results__option--selectable").index(e),d=this.$results.offset().top,b=e.offset().top,c=this.$results.scrollTop()+(b-d),d=b-d,c-=2*e.outerHeight(!1),2>=a?this.$results.scrollTop(0):
(d>this.$results.outerHeight()||0>d)&&this.$results.scrollTop(c))},c.prototype.template=function(b,c){var f=this.options.get("templateResult"),g=this.options.get("escapeMarkup");b=f(b,c);null==b?c.style.display="none":"string"==typeof b?c.innerHTML=g(b):a(c).append(b)},c}),r.define("select2/keys",[],function(){return{BACKSPACE:8,TAB:9,ENTER:13,SHIFT:16,CTRL:17,ALT:18,ESC:27,SPACE:32,PAGE_UP:33,PAGE_DOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40,DELETE:46}}),r.define("select2/selection/base",
["jquery","../utils","../keys"],function(a,b,c){function d(a,b){this.$element=a;this.options=b;d.__super__.constructor.call(this)}return b.Extend(d,b.Observable),d.prototype.render=function(){var c=a('<span class="select2-selection" role="combobox"  aria-haspopup="true" aria-expanded="false"></span>');return this._tabindex=0,null!=b.GetData(this.$element[0],"old-tabindex")?this._tabindex=b.GetData(this.$element[0],"old-tabindex"):null!=this.$element.attr("tabindex")&&(this._tabindex=this.$element.attr("tabindex")),
c.attr("title",this.$element.attr("title")),c.attr("tabindex",this._tabindex),c.attr("aria-disabled","false"),this.$selection=c},d.prototype.bind=function(a,b){var f=this,g=a.id+"-results";this.container=a;this.$selection.on("focus",function(a){f.trigger("focus",a)});this.$selection.on("blur",function(a){f._handleBlur(a)});this.$selection.on("keydown",function(a){f.trigger("keypress",a);a.which===c.SPACE&&a.preventDefault()});a.on("results:focus",function(a){f.$selection.attr("aria-activedescendant",
a.data._resultId)});a.on("selection:update",function(a){f.update(a.data)});a.on("open",function(){f.$selection.attr("aria-expanded","true");f.$selection.attr("aria-owns",g);f._attachCloseHandler(a)});a.on("close",function(){f.$selection.attr("aria-expanded","false");f.$selection.removeAttr("aria-activedescendant");f.$selection.removeAttr("aria-owns");f.$selection.trigger("focus");f._detachCloseHandler(a)});a.on("enable",function(){f.$selection.attr("tabindex",f._tabindex);f.$selection.attr("aria-disabled",
"false")});a.on("disable",function(){f.$selection.attr("tabindex","-1");f.$selection.attr("aria-disabled","true")})},d.prototype._handleBlur=function(b){var c=this;window.setTimeout(function(){document.activeElement==c.$selection[0]||a.contains(c.$selection[0],document.activeElement)||c.trigger("blur",b)},1)},d.prototype._attachCloseHandler=function(c){a(document.body).on("mousedown.select2."+c.id,function(c){var f=a(c.target).closest(".select2");a(".select2.select2-container--open").each(function(){this!=
f[0]&&b.GetData(this,"element").select2("close")})})},d.prototype._detachCloseHandler=function(b){a(document.body).off("mousedown.select2."+b.id)},d.prototype.position=function(a,b){b.find(".selection").append(a)},d.prototype.destroy=function(){this._detachCloseHandler(this.container)},d.prototype.update=function(a){throw Error("The `update` method must be defined in child classes.");},d.prototype.isEnabled=function(){return!this.isDisabled()},d.prototype.isDisabled=function(){return this.options.get("disabled")},
d}),r.define("select2/selection/single",["jquery","./base","../utils","../keys"],function(a,b,c,d){function g(){g.__super__.constructor.apply(this,arguments)}return c.Extend(g,b),g.prototype.render=function(){var a=g.__super__.render.call(this);return a[0].classList.add("select2-selection--single"),a.html('<span class="select2-selection__rendered"></span><span class="select2-selection__arrow" role="presentation"><b role="presentation"></b></span>'),a},g.prototype.bind=function(a,b){var c=this;g.__super__.bind.apply(this,
arguments);var f=a.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",f).attr("role","textbox").attr("aria-readonly","true");this.$selection.attr("aria-labelledby",f);this.$selection.attr("aria-controls",f);this.$selection.on("mousedown",function(a){1===a.which&&c.trigger("toggle",{originalEvent:a})});this.$selection.on("focus",function(a){});this.$selection.on("blur",function(a){});a.on("focus",function(b){a.isOpen()||c.$selection.trigger("focus")})},g.prototype.clear=
function(){var a=this.$selection.find(".select2-selection__rendered");a.empty();a.removeAttr("title")},g.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},g.prototype.selectionContainer=function(){return a("<span></span>")},g.prototype.update=function(a){var b,c;0!==a.length?(c=a[0],b=this.$selection.find(".select2-selection__rendered"),a=this.display(c,b),b.empty().append(a),(c=c.title||c.text)?b.attr("title",c):b.removeAttr("title")):
this.clear()},g}),r.define("select2/selection/multiple",["jquery","./base","../utils"],function(a,b,c){function d(a,b){d.__super__.constructor.apply(this,arguments)}return c.Extend(d,b),d.prototype.render=function(){var a=d.__super__.render.call(this);return a[0].classList.add("select2-selection--multiple"),a.html('<ul class="select2-selection__rendered"></ul>'),a},d.prototype.bind=function(b,f){var g=this;d.__super__.bind.apply(this,arguments);var e=b.id+"-container";this.$selection.find(".select2-selection__rendered").attr("id",
e);this.$selection.on("click",function(a){g.trigger("toggle",{originalEvent:a})});this.$selection.on("click",".select2-selection__choice__remove",function(b){var f;g.isDisabled()||(f=a(this).parent(),f=c.GetData(f[0],"data"),g.trigger("unselect",{originalEvent:b,data:f}))});this.$selection.on("keydown",".select2-selection__choice__remove",function(a){g.isDisabled()||a.stopPropagation()})},d.prototype.clear=function(){var a=this.$selection.find(".select2-selection__rendered");a.empty();a.removeAttr("title")},
d.prototype.display=function(a,b){var c=this.options.get("templateSelection");return this.options.get("escapeMarkup")(c(a,b))},d.prototype.selectionContainer=function(){return a('<li class="select2-selection__choice"><button type="button" class="select2-selection__choice__remove" tabindex="-1"><span aria-hidden="true">&times;</span></button><span class="select2-selection__choice__display"></span></li>')},d.prototype.update=function(a){if(this.clear(),0!==a.length){for(var b=[],g=this.$selection.find(".select2-selection__rendered").attr("id")+
"-choice-",d=0;d<a.length;d++){var e=a[d],q=this.selectionContainer(),t=this.display(e,q),h=g+c.generateChars(4)+"-";e.id?h+=e.id:h+=c.generateChars(4);q.find(".select2-selection__choice__display").append(t).attr("id",h);var l=e.title||e.text;l&&q.attr("title",l);t=this.options.get("translations").get("removeItem");l=q.find(".select2-selection__choice__remove");l.attr("title",t());l.attr("aria-label",t());l.attr("aria-describedby",h);c.StoreData(q[0],"data",e);b.push(q)}this.$selection.find(".select2-selection__rendered").append(b)}},
d}),r.define("select2/selection/placeholder",[],function(){function a(a,b,c){this.placeholder=this.normalizePlaceholder(c.get("placeholder"));a.call(this,b,c)}return a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b?{id:"",text:b}:b},a.prototype.createPlaceholder=function(a,b){a=this.selectionContainer();a.html(this.display(b));a[0].classList.add("select2-selection__placeholder");a[0].classList.remove("select2-selection__choice");b=b.title||b.text||a.text();return this.$selection.find(".select2-selection__rendered").attr("title",
b),a},a.prototype.update=function(a,b){var c=1==b.length&&b[0].id!=this.placeholder.id;if(1<b.length||c)return a.call(this,b);this.clear();b=this.createPlaceholder(this.placeholder);this.$selection.find(".select2-selection__rendered").append(b)},a}),r.define("select2/selection/allowClear",["jquery","../keys","../utils"],function(a,b,c){function d(){}return d.prototype.bind=function(a,b,c){var f=this;a.call(this,b,c);null==this.placeholder&&this.options.get("debug")&&window.console&&console.error&&
console.error("Select2: The `allowClear` option should be used in combination with the `placeholder` option.");this.$selection.on("mousedown",".select2-selection__clear",function(a){f._handleClear(a)});b.on("keypress",function(a){f._handleKeyboardClear(a,b)})},d.prototype._handleClear=function(a,b){if(!this.isDisabled()&&(a=this.$selection.find(".select2-selection__clear"),0!==a.length)){b.stopPropagation();b=c.GetData(a[0],"data");a=this.$element.val();this.$element.val(this.placeholder.id);var f=
{data:b};if(this.trigger("clear",f),f.prevented)this.$element.val(a);else{for(var g=0;g<b.length;g++)if(f={data:b[g]},this.trigger("unselect",f),f.prevented)return void this.$element.val(a);this.$element.trigger("input").trigger("change");this.trigger("toggle",{})}}},d.prototype._handleKeyboardClear=function(a,c,d){d.isOpen()||c.which!=b.DELETE&&c.which!=b.BACKSPACE||this._handleClear(c)},d.prototype.update=function(b,f){var g,d;b.call(this,f);this.$selection.find(".select2-selection__clear").remove();
this.$selection[0].classList.remove("select2-selection--clearable");0<this.$selection.find(".select2-selection__placeholder").length||0===f.length||(g=this.$selection.find(".select2-selection__rendered").attr("id"),d=this.options.get("translations").get("removeAllItems"),(b=a('<button type="button" class="select2-selection__clear" tabindex="-1"><span aria-hidden="true">&times;</span></button>')).attr("title",d()),b.attr("aria-label",d()),b.attr("aria-describedby",g),c.StoreData(b[0],"data",f),this.$selection.prepend(b),
this.$selection[0].classList.add("select2-selection--clearable"))},d}),r.define("select2/selection/search",["jquery","../utils","../keys"],function(a,b,c){function d(a,b,c){a.call(this,b,c)}return d.prototype.render=function(b){var c=this.options.get("translations").get("search"),d=a('<span class="select2-search select2-search--inline"><textarea class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" ></textarea></span>');
this.$searchContainer=d;this.$search=d.find("textarea");this.$search.prop("autocomplete",this.options.get("autocomplete"));this.$search.attr("aria-label",c());b=b.call(this);return this._transferTabIndex(),b.append(this.$searchContainer),b},d.prototype.bind=function(a,f,d){var g=this,e=f.id+"-results",q=f.id+"-container";a.call(this,f,d);g.$search.attr("aria-describedby",q);f.on("open",function(){g.$search.attr("aria-controls",e);g.$search.trigger("focus")});f.on("close",function(){g.$search.val("");
g.resizeSearch();g.$search.removeAttr("aria-controls");g.$search.removeAttr("aria-activedescendant");g.$search.trigger("focus")});f.on("enable",function(){g.$search.prop("disabled",!1);g._transferTabIndex()});f.on("disable",function(){g.$search.prop("disabled",!0)});f.on("focus",function(a){g.$search.trigger("focus")});f.on("results:focus",function(a){a.data._resultId?g.$search.attr("aria-activedescendant",a.data._resultId):g.$search.removeAttr("aria-activedescendant")});this.$selection.on("focusin",
".select2-search--inline",function(a){g.trigger("focus",a)});this.$selection.on("focusout",".select2-search--inline",function(a){g._handleBlur(a)});this.$selection.on("keydown",".select2-search--inline",function(a){var f;a.stopPropagation();g.trigger("keypress",a);g._keyUpPrevented=a.isDefaultPrevented();a.which!==c.BACKSPACE||""!==g.$search.val()||0<(f=g.$selection.find(".select2-selection__choice").last()).length&&(f=b.GetData(f[0],"data"),g.searchRemoveChoice(f),a.preventDefault())});this.$selection.on("click",
".select2-search--inline",function(a){g.$search.val()&&a.stopPropagation()});var t=(f=document.documentMode)&&11>=f;this.$selection.on("input.searchcheck",".select2-search--inline",function(a){t?g.$selection.off("input.search input.searchcheck"):g.$selection.off("keyup.search")});this.$selection.on("keyup.search input.search",".select2-search--inline",function(a){var b;t&&"input"===a.type?g.$selection.off("input.search input.searchcheck"):(b=a.which)!=c.SHIFT&&b!=c.CTRL&&b!=c.ALT&&b!=c.TAB&&g.handleSearch(a)})},
d.prototype._transferTabIndex=function(a){this.$search.attr("tabindex",this.$selection.attr("tabindex"));this.$selection.attr("tabindex","-1")},d.prototype.createPlaceholder=function(a,b){this.$search.attr("placeholder",b.text)},d.prototype.update=function(a,b){var c=this.$search[0]==document.activeElement;this.$search.attr("placeholder","");a.call(this,b);this.resizeSearch();c&&this.$search.trigger("focus")},d.prototype.handleSearch=function(){var a;this.resizeSearch();this._keyUpPrevented||(a=this.$search.val(),
this.trigger("query",{term:a}));this._keyUpPrevented=!1},d.prototype.searchRemoveChoice=function(a,b){this.trigger("unselect",{data:b});this.$search.val(b.text);this.handleSearch()},d.prototype.resizeSearch=function(){this.$search.css("width","25px");var a="100%";""===this.$search.attr("placeholder")&&(a=.75*(this.$search.val().length+1)+"em");this.$search.css("width",a)},d}),r.define("select2/selection/selectionCss",["../utils"],function(a){function b(){}return b.prototype.render=function(b){var c=
b.call(this);b=this.options.get("selectionCssClass")||"";return-1!==b.indexOf(":all:")&&(b=b.replace(":all:",""),a.copyNonInternalCssClasses(c[0],this.$element[0])),c.addClass(b),c},b}),r.define("select2/selection/eventRelay",["jquery"],function(a){function b(){}return b.prototype.bind=function(b,c,g){var f=this,d="open opening close closing select selecting unselect unselecting clear clearing".split(" "),e=["opening","closing","selecting","unselecting","clearing"];b.call(this,c,g);c.on("*",function(b,
c){var g;-1!==d.indexOf(b)&&(c=c||{},g=a.Event("select2:"+b,{params:c}),f.$element.trigger(g),-1!==e.indexOf(b)&&(c.prevented=g.isDefaultPrevented()))})},b}),r.define("select2/translation",["jquery","require"],function(a,b){function c(a){this.dict=a||{}}return c.prototype.all=function(){return this.dict},c.prototype.get=function(a){return this.dict[a]},c.prototype.extend=function(b){this.dict=a.extend({},b.all(),this.dict)},c._cache={},c.loadPath=function(a){var g;return a in c._cache||(g=b(a),c._cache[a]=
g),new c(c._cache[a])},c}),r.define("select2/diacritics",[],function(){return{"\u24b6":"A","\uff21":"A","\u00c0":"A","\u00c1":"A","\u00c2":"A","\u1ea6":"A","\u1ea4":"A","\u1eaa":"A","\u1ea8":"A","\u00c3":"A","\u0100":"A","\u0102":"A","\u1eb0":"A","\u1eae":"A","\u1eb4":"A","\u1eb2":"A","\u0226":"A","\u01e0":"A","\u00c4":"A","\u01de":"A","\u1ea2":"A","\u00c5":"A","\u01fa":"A","\u01cd":"A","\u0200":"A","\u0202":"A","\u1ea0":"A","\u1eac":"A","\u1eb6":"A","\u1e00":"A","\u0104":"A","\u023a":"A","\u2c6f":"A",
"\ua732":"AA","\u00c6":"AE","\u01fc":"AE","\u01e2":"AE","\ua734":"AO","\ua736":"AU","\ua738":"AV","\ua73a":"AV","\ua73c":"AY","\u24b7":"B","\uff22":"B","\u1e02":"B","\u1e04":"B","\u1e06":"B","\u0243":"B","\u0182":"B","\u0181":"B","\u24b8":"C","\uff23":"C","\u0106":"C","\u0108":"C","\u010a":"C","\u010c":"C","\u00c7":"C","\u1e08":"C","\u0187":"C","\u023b":"C","\ua73e":"C","\u24b9":"D","\uff24":"D","\u1e0a":"D","\u010e":"D","\u1e0c":"D","\u1e10":"D","\u1e12":"D","\u1e0e":"D","\u0110":"D","\u018b":"D",
"\u018a":"D","\u0189":"D","\ua779":"D","\u01f1":"DZ","\u01c4":"DZ","\u01f2":"Dz","\u01c5":"Dz","\u24ba":"E","\uff25":"E","\u00c8":"E","\u00c9":"E","\u00ca":"E","\u1ec0":"E","\u1ebe":"E","\u1ec4":"E","\u1ec2":"E","\u1ebc":"E","\u0112":"E","\u1e14":"E","\u1e16":"E","\u0114":"E","\u0116":"E","\u00cb":"E","\u1eba":"E","\u011a":"E","\u0204":"E","\u0206":"E","\u1eb8":"E","\u1ec6":"E","\u0228":"E","\u1e1c":"E","\u0118":"E","\u1e18":"E","\u1e1a":"E","\u0190":"E","\u018e":"E","\u24bb":"F","\uff26":"F","\u1e1e":"F",
"\u0191":"F","\ua77b":"F","\u24bc":"G","\uff27":"G","\u01f4":"G","\u011c":"G","\u1e20":"G","\u011e":"G","\u0120":"G","\u01e6":"G","\u0122":"G","\u01e4":"G","\u0193":"G","\ua7a0":"G","\ua77d":"G","\ua77e":"G","\u24bd":"H","\uff28":"H","\u0124":"H","\u1e22":"H","\u1e26":"H","\u021e":"H","\u1e24":"H","\u1e28":"H","\u1e2a":"H","\u0126":"H","\u2c67":"H","\u2c75":"H","\ua78d":"H","\u24be":"I","\uff29":"I","\u00cc":"I","\u00cd":"I","\u00ce":"I","\u0128":"I","\u012a":"I","\u012c":"I","\u0130":"I","\u00cf":"I",
"\u1e2e":"I","\u1ec8":"I","\u01cf":"I","\u0208":"I","\u020a":"I","\u1eca":"I","\u012e":"I","\u1e2c":"I","\u0197":"I","\u24bf":"J","\uff2a":"J","\u0134":"J","\u0248":"J","\u24c0":"K","\uff2b":"K","\u1e30":"K","\u01e8":"K","\u1e32":"K","\u0136":"K","\u1e34":"K","\u0198":"K","\u2c69":"K","\ua740":"K","\ua742":"K","\ua744":"K","\ua7a2":"K","\u24c1":"L","\uff2c":"L","\u013f":"L","\u0139":"L","\u013d":"L","\u1e36":"L","\u1e38":"L","\u013b":"L","\u1e3c":"L","\u1e3a":"L","\u0141":"L","\u023d":"L","\u2c62":"L",
"\u2c60":"L","\ua748":"L","\ua746":"L","\ua780":"L","\u01c7":"LJ","\u01c8":"Lj","\u24c2":"M","\uff2d":"M","\u1e3e":"M","\u1e40":"M","\u1e42":"M","\u2c6e":"M","\u019c":"M","\u24c3":"N","\uff2e":"N","\u01f8":"N","\u0143":"N","\u00d1":"N","\u1e44":"N","\u0147":"N","\u1e46":"N","\u0145":"N","\u1e4a":"N","\u1e48":"N","\u0220":"N","\u019d":"N","\ua790":"N","\ua7a4":"N","\u01ca":"NJ","\u01cb":"Nj","\u24c4":"O","\uff2f":"O","\u00d2":"O","\u00d3":"O","\u00d4":"O","\u1ed2":"O","\u1ed0":"O","\u1ed6":"O","\u1ed4":"O",
"\u00d5":"O","\u1e4c":"O","\u022c":"O","\u1e4e":"O","\u014c":"O","\u1e50":"O","\u1e52":"O","\u014e":"O","\u022e":"O","\u0230":"O","\u00d6":"O","\u022a":"O","\u1ece":"O","\u0150":"O","\u01d1":"O","\u020c":"O","\u020e":"O","\u01a0":"O","\u1edc":"O","\u1eda":"O","\u1ee0":"O","\u1ede":"O","\u1ee2":"O","\u1ecc":"O","\u1ed8":"O","\u01ea":"O","\u01ec":"O","\u00d8":"O","\u01fe":"O","\u0186":"O","\u019f":"O","\ua74a":"O","\ua74c":"O","\u0152":"OE","\u01a2":"OI","\ua74e":"OO","\u0222":"OU","\u24c5":"P","\uff30":"P",
"\u1e54":"P","\u1e56":"P","\u01a4":"P","\u2c63":"P","\ua750":"P","\ua752":"P","\ua754":"P","\u24c6":"Q","\uff31":"Q","\ua756":"Q","\ua758":"Q","\u024a":"Q","\u24c7":"R","\uff32":"R","\u0154":"R","\u1e58":"R","\u0158":"R","\u0210":"R","\u0212":"R","\u1e5a":"R","\u1e5c":"R","\u0156":"R","\u1e5e":"R","\u024c":"R","\u2c64":"R","\ua75a":"R","\ua7a6":"R","\ua782":"R","\u24c8":"S","\uff33":"S","\u1e9e":"S","\u015a":"S","\u1e64":"S","\u015c":"S","\u1e60":"S","\u0160":"S","\u1e66":"S","\u1e62":"S","\u1e68":"S",
"\u0218":"S","\u015e":"S","\u2c7e":"S","\ua7a8":"S","\ua784":"S","\u24c9":"T","\uff34":"T","\u1e6a":"T","\u0164":"T","\u1e6c":"T","\u021a":"T","\u0162":"T","\u1e70":"T","\u1e6e":"T","\u0166":"T","\u01ac":"T","\u01ae":"T","\u023e":"T","\ua786":"T","\ua728":"TZ","\u24ca":"U","\uff35":"U","\u00d9":"U","\u00da":"U","\u00db":"U","\u0168":"U","\u1e78":"U","\u016a":"U","\u1e7a":"U","\u016c":"U","\u00dc":"U","\u01db":"U","\u01d7":"U","\u01d5":"U","\u01d9":"U","\u1ee6":"U","\u016e":"U","\u0170":"U","\u01d3":"U",
"\u0214":"U","\u0216":"U","\u01af":"U","\u1eea":"U","\u1ee8":"U","\u1eee":"U","\u1eec":"U","\u1ef0":"U","\u1ee4":"U","\u1e72":"U","\u0172":"U","\u1e76":"U","\u1e74":"U","\u0244":"U","\u24cb":"V","\uff36":"V","\u1e7c":"V","\u1e7e":"V","\u01b2":"V","\ua75e":"V","\u0245":"V","\ua760":"VY","\u24cc":"W","\uff37":"W","\u1e80":"W","\u1e82":"W","\u0174":"W","\u1e86":"W","\u1e84":"W","\u1e88":"W","\u2c72":"W","\u24cd":"X","\uff38":"X","\u1e8a":"X","\u1e8c":"X","\u24ce":"Y","\uff39":"Y","\u1ef2":"Y","\u00dd":"Y",
"\u0176":"Y","\u1ef8":"Y","\u0232":"Y","\u1e8e":"Y","\u0178":"Y","\u1ef6":"Y","\u1ef4":"Y","\u01b3":"Y","\u024e":"Y","\u1efe":"Y","\u24cf":"Z","\uff3a":"Z","\u0179":"Z","\u1e90":"Z","\u017b":"Z","\u017d":"Z","\u1e92":"Z","\u1e94":"Z","\u01b5":"Z","\u0224":"Z","\u2c7f":"Z","\u2c6b":"Z","\ua762":"Z","\u24d0":"a","\uff41":"a","\u1e9a":"a","\u00e0":"a","\u00e1":"a","\u00e2":"a","\u1ea7":"a","\u1ea5":"a","\u1eab":"a","\u1ea9":"a","\u00e3":"a","\u0101":"a","\u0103":"a","\u1eb1":"a","\u1eaf":"a","\u1eb5":"a",
"\u1eb3":"a","\u0227":"a","\u01e1":"a","\u00e4":"a","\u01df":"a","\u1ea3":"a","\u00e5":"a","\u01fb":"a","\u01ce":"a","\u0201":"a","\u0203":"a","\u1ea1":"a","\u1ead":"a","\u1eb7":"a","\u1e01":"a","\u0105":"a","\u2c65":"a","\u0250":"a","\ua733":"aa","\u00e6":"ae","\u01fd":"ae","\u01e3":"ae","\ua735":"ao","\ua737":"au","\ua739":"av","\ua73b":"av","\ua73d":"ay","\u24d1":"b","\uff42":"b","\u1e03":"b","\u1e05":"b","\u1e07":"b","\u0180":"b","\u0183":"b","\u0253":"b","\u24d2":"c","\uff43":"c","\u0107":"c",
"\u0109":"c","\u010b":"c","\u010d":"c","\u00e7":"c","\u1e09":"c","\u0188":"c","\u023c":"c","\ua73f":"c","\u2184":"c","\u24d3":"d","\uff44":"d","\u1e0b":"d","\u010f":"d","\u1e0d":"d","\u1e11":"d","\u1e13":"d","\u1e0f":"d","\u0111":"d","\u018c":"d","\u0256":"d","\u0257":"d","\ua77a":"d","\u01f3":"dz","\u01c6":"dz","\u24d4":"e","\uff45":"e","\u00e8":"e","\u00e9":"e","\u00ea":"e","\u1ec1":"e","\u1ebf":"e","\u1ec5":"e","\u1ec3":"e","\u1ebd":"e","\u0113":"e","\u1e15":"e","\u1e17":"e","\u0115":"e","\u0117":"e",
"\u00eb":"e","\u1ebb":"e","\u011b":"e","\u0205":"e","\u0207":"e","\u1eb9":"e","\u1ec7":"e","\u0229":"e","\u1e1d":"e","\u0119":"e","\u1e19":"e","\u1e1b":"e","\u0247":"e","\u025b":"e","\u01dd":"e","\u24d5":"f","\uff46":"f","\u1e1f":"f","\u0192":"f","\ua77c":"f","\u24d6":"g","\uff47":"g","\u01f5":"g","\u011d":"g","\u1e21":"g","\u011f":"g","\u0121":"g","\u01e7":"g","\u0123":"g","\u01e5":"g","\u0260":"g","\ua7a1":"g","\u1d79":"g","\ua77f":"g","\u24d7":"h","\uff48":"h","\u0125":"h","\u1e23":"h","\u1e27":"h",
"\u021f":"h","\u1e25":"h","\u1e29":"h","\u1e2b":"h","\u1e96":"h","\u0127":"h","\u2c68":"h","\u2c76":"h","\u0265":"h","\u0195":"hv","\u24d8":"i","\uff49":"i","\u00ec":"i","\u00ed":"i","\u00ee":"i","\u0129":"i","\u012b":"i","\u012d":"i","\u00ef":"i","\u1e2f":"i","\u1ec9":"i","\u01d0":"i","\u0209":"i","\u020b":"i","\u1ecb":"i","\u012f":"i","\u1e2d":"i","\u0268":"i","\u0131":"i","\u24d9":"j","\uff4a":"j","\u0135":"j","\u01f0":"j","\u0249":"j","\u24da":"k","\uff4b":"k","\u1e31":"k","\u01e9":"k","\u1e33":"k",
"\u0137":"k","\u1e35":"k","\u0199":"k","\u2c6a":"k","\ua741":"k","\ua743":"k","\ua745":"k","\ua7a3":"k","\u24db":"l","\uff4c":"l","\u0140":"l","\u013a":"l","\u013e":"l","\u1e37":"l","\u1e39":"l","\u013c":"l","\u1e3d":"l","\u1e3b":"l","\u017f":"l","\u0142":"l","\u019a":"l","\u026b":"l","\u2c61":"l","\ua749":"l","\ua781":"l","\ua747":"l","\u01c9":"lj","\u24dc":"m","\uff4d":"m","\u1e3f":"m","\u1e41":"m","\u1e43":"m","\u0271":"m","\u026f":"m","\u24dd":"n","\uff4e":"n","\u01f9":"n","\u0144":"n","\u00f1":"n",
"\u1e45":"n","\u0148":"n","\u1e47":"n","\u0146":"n","\u1e4b":"n","\u1e49":"n","\u019e":"n","\u0272":"n","\u0149":"n","\ua791":"n","\ua7a5":"n","\u01cc":"nj","\u24de":"o","\uff4f":"o","\u00f2":"o","\u00f3":"o","\u00f4":"o","\u1ed3":"o","\u1ed1":"o","\u1ed7":"o","\u1ed5":"o","\u00f5":"o","\u1e4d":"o","\u022d":"o","\u1e4f":"o","\u014d":"o","\u1e51":"o","\u1e53":"o","\u014f":"o","\u022f":"o","\u0231":"o","\u00f6":"o","\u022b":"o","\u1ecf":"o","\u0151":"o","\u01d2":"o","\u020d":"o","\u020f":"o","\u01a1":"o",
"\u1edd":"o","\u1edb":"o","\u1ee1":"o","\u1edf":"o","\u1ee3":"o","\u1ecd":"o","\u1ed9":"o","\u01eb":"o","\u01ed":"o","\u00f8":"o","\u01ff":"o","\u0254":"o","\ua74b":"o","\ua74d":"o","\u0275":"o","\u0153":"oe","\u01a3":"oi","\u0223":"ou","\ua74f":"oo","\u24df":"p","\uff50":"p","\u1e55":"p","\u1e57":"p","\u01a5":"p","\u1d7d":"p","\ua751":"p","\ua753":"p","\ua755":"p","\u24e0":"q","\uff51":"q","\u024b":"q","\ua757":"q","\ua759":"q","\u24e1":"r","\uff52":"r","\u0155":"r","\u1e59":"r","\u0159":"r","\u0211":"r",
"\u0213":"r","\u1e5b":"r","\u1e5d":"r","\u0157":"r","\u1e5f":"r","\u024d":"r","\u027d":"r","\ua75b":"r","\ua7a7":"r","\ua783":"r","\u24e2":"s","\uff53":"s","\u00df":"s","\u015b":"s","\u1e65":"s","\u015d":"s","\u1e61":"s","\u0161":"s","\u1e67":"s","\u1e63":"s","\u1e69":"s","\u0219":"s","\u015f":"s","\u023f":"s","\ua7a9":"s","\ua785":"s","\u1e9b":"s","\u24e3":"t","\uff54":"t","\u1e6b":"t","\u1e97":"t","\u0165":"t","\u1e6d":"t","\u021b":"t","\u0163":"t","\u1e71":"t","\u1e6f":"t","\u0167":"t","\u01ad":"t",
"\u0288":"t","\u2c66":"t","\ua787":"t","\ua729":"tz","\u24e4":"u","\uff55":"u","\u00f9":"u","\u00fa":"u","\u00fb":"u","\u0169":"u","\u1e79":"u","\u016b":"u","\u1e7b":"u","\u016d":"u","\u00fc":"u","\u01dc":"u","\u01d8":"u","\u01d6":"u","\u01da":"u","\u1ee7":"u","\u016f":"u","\u0171":"u","\u01d4":"u","\u0215":"u","\u0217":"u","\u01b0":"u","\u1eeb":"u","\u1ee9":"u","\u1eef":"u","\u1eed":"u","\u1ef1":"u","\u1ee5":"u","\u1e73":"u","\u0173":"u","\u1e77":"u","\u1e75":"u","\u0289":"u","\u24e5":"v","\uff56":"v",
"\u1e7d":"v","\u1e7f":"v","\u028b":"v","\ua75f":"v","\u028c":"v","\ua761":"vy","\u24e6":"w","\uff57":"w","\u1e81":"w","\u1e83":"w","\u0175":"w","\u1e87":"w","\u1e85":"w","\u1e98":"w","\u1e89":"w","\u2c73":"w","\u24e7":"x","\uff58":"x","\u1e8b":"x","\u1e8d":"x","\u24e8":"y","\uff59":"y","\u1ef3":"y","\u00fd":"y","\u0177":"y","\u1ef9":"y","\u0233":"y","\u1e8f":"y","\u00ff":"y","\u1ef7":"y","\u1e99":"y","\u1ef5":"y","\u01b4":"y","\u024f":"y","\u1eff":"y","\u24e9":"z","\uff5a":"z","\u017a":"z","\u1e91":"z",
"\u017c":"z","\u017e":"z","\u1e93":"z","\u1e95":"z","\u01b6":"z","\u0225":"z","\u0240":"z","\u2c6c":"z","\ua763":"z","\u0386":"\u0391","\u0388":"\u0395","\u0389":"\u0397","\u038a":"\u0399","\u03aa":"\u0399","\u038c":"\u039f","\u038e":"\u03a5","\u03ab":"\u03a5","\u038f":"\u03a9","\u03ac":"\u03b1","\u03ad":"\u03b5","\u03ae":"\u03b7","\u03af":"\u03b9","\u03ca":"\u03b9","\u0390":"\u03b9","\u03cc":"\u03bf","\u03cd":"\u03c5","\u03cb":"\u03c5","\u03b0":"\u03c5","\u03ce":"\u03c9","\u03c2":"\u03c3","\u2019":"'"}}),
r.define("select2/data/base",["../utils"],function(a){function b(a,c){b.__super__.constructor.call(this)}return a.Extend(b,a.Observable),b.prototype.current=function(a){throw Error("The `current` method must be defined in child classes.");},b.prototype.query=function(a,b){throw Error("The `query` method must be defined in child classes.");},b.prototype.bind=function(a,b){},b.prototype.destroy=function(){},b.prototype.generateResultId=function(b,c){b=b.id+"-result-";return b+=a.generateChars(4),null!=
c.id?b+="-"+c.id.toString():b+="-"+a.generateChars(4),b},b}),r.define("select2/data/select",["./base","../utils","jquery"],function(a,b,c){function d(a,b){this.$element=a;this.options=b;d.__super__.constructor.call(this)}return b.Extend(d,a),d.prototype.current=function(a){var b=this;a(Array.prototype.map.call(this.$element[0].querySelectorAll(":checked"),function(a){return b.item(c(a))}))},d.prototype.select=function(a){var b,c=this;if(a.selected=!0,null!=a.element&&"option"===a.element.tagName.toLowerCase())return a.element.selected=
!0,void this.$element.trigger("input").trigger("change");this.$element.prop("multiple")?this.current(function(b){var f=[];(a=[a]).push.apply(a,b);for(b=0;b<a.length;b++){var d=a[b].id;-1===f.indexOf(d)&&f.push(d)}c.$element.val(f);c.$element.trigger("input").trigger("change")}):(b=a.id,this.$element.val(b),this.$element.trigger("input").trigger("change"))},d.prototype.unselect=function(a){var b=this;if(this.$element.prop("multiple")){if(a.selected=!1,null!=a.element&&"option"===a.element.tagName.toLowerCase())return a.element.selected=
!1,void this.$element.trigger("input").trigger("change");this.current(function(c){for(var f=[],d=0;d<c.length;d++){var g=c[d].id;g!==a.id&&-1===f.indexOf(g)&&f.push(g)}b.$element.val(f);b.$element.trigger("input").trigger("change")})}},d.prototype.bind=function(a,b){var c=this;(this.container=a).on("select",function(a){c.select(a.data)});a.on("unselect",function(a){c.unselect(a.data)})},d.prototype.destroy=function(){this.$element.find("*").each(function(){b.RemoveData(this)})},d.prototype.query=
function(a,b){var f=[],d=this;this.$element.children().each(function(){var b;"option"!==this.tagName.toLowerCase()&&"optgroup"!==this.tagName.toLowerCase()||(b=c(this),b=d.item(b),null!==(b=d.matches(a,b))&&f.push(b))});b({results:f})},d.prototype.addOptions=function(a){this.$element.append(a)},d.prototype.option=function(a){var f;a.children?(f=document.createElement("optgroup")).label=a.text:void 0!==(f=document.createElement("option")).textContent?f.textContent=a.text:f.innerText=a.text;void 0!==
a.id&&(f.value=a.id);a.disabled&&(f.disabled=!0);a.selected&&(f.selected=!0);a.title&&(f.title=a.title);a=this._normalizeItem(a);return a.element=f,b.StoreData(f,"data",a),c(f)},d.prototype.item=function(a){var f;if(null!=(f=b.GetData(a[0],"data")))return f;var d=a[0];if("option"===d.tagName.toLowerCase())f={id:a.val(),text:a.text(),disabled:a.prop("disabled"),selected:a.prop("selected"),title:a.prop("title")};else if("optgroup"===d.tagName.toLowerCase()){f={text:a.prop("label"),children:[],title:a.prop("title")};
d=a.children("option");for(var g=[],e=0;e<d.length;e++){var q=c(d[e]);q=this.item(q);g.push(q)}f.children=g}return(f=this._normalizeItem(f)).element=a[0],b.StoreData(a[0],"data",f),f},d.prototype._normalizeItem=function(a){a!==Object(a)&&(a={id:a,text:a});return null!=(a=c.extend({},{text:""},a)).id&&(a.id=a.id.toString()),null!=a.text&&(a.text=a.text.toString()),null==a._resultId&&a.id&&null!=this.container&&(a._resultId=this.generateResultId(this.container,a)),c.extend({},{selected:!1,disabled:!1},
a)},d.prototype.matches=function(a,b){return this.options.get("matcher")(a,b)},d}),r.define("select2/data/array",["./select","../utils","jquery"],function(a,b,c){function d(a,b){this._dataToConvert=b.get("data")||[];d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype.bind=function(a,b){d.__super__.bind.call(this,a,b);this.addOptions(this.convertToOptions(this._dataToConvert))},d.prototype.select=function(a){var b=this.$element.find("option").filter(function(b,c){return c.value==
a.id.toString()});0===b.length&&(b=this.option(a),this.addOptions(b));d.__super__.select.call(this,a)},d.prototype.convertToOptions=function(a){for(var b=this,d=this.$element.find("option"),e=d.map(function(){return b.item(c(this)).id}).get(),g=[],q=0;q<a.length;q++){var h,l,t=this._normalizeItem(a[q]);0<=e.indexOf(t.id)?(h=d.filter(function(a){return function(){return c(this).val()==a.id}}(t)),l=this.item(h),l=c.extend(!0,{},t,l),l=this.option(l),h.replaceWith(l)):(l=this.option(t),t.children&&(t=
this.convertToOptions(t.children),l.append(t)),g.push(l))}return g},d}),r.define("select2/data/ajax",["./array","../utils","jquery"],function(a,b,c){function d(a,b){this.ajaxOptions=this._applyDefaults(b.get("ajax"));null!=this.ajaxOptions.processResults&&(this.processResults=this.ajaxOptions.processResults);d.__super__.constructor.call(this,a,b)}return b.Extend(d,a),d.prototype._applyDefaults=function(a){return c.extend({},{data:function(a){return c.extend({},a,{q:a.term})},transport:function(a,
b,d){a=c.ajax(a);return a.then(b),a.fail(d),a}},a,!0)},d.prototype.processResults=function(a){return a},d.prototype.query=function(a,b){function d(){var c=e.transport(e,function(c){c=f.processResults(c,a);f.options.get("debug")&&window.console&&console.error&&(c&&c.results&&Array.isArray(c.results)||console.error("Select2: The AJAX results did not return an array in the `results` key of the response."));b(c)},function(){"status"in c&&(0===c.status||"0"===c.status)||f.trigger("results:message",{message:"errorLoading"})});
f._request=c}var f=this;null!=this._request&&("function"==typeof this._request.abort&&this._request.abort(),this._request=null);var e=c.extend({type:"GET"},this.ajaxOptions);"function"==typeof e.url&&(e.url=e.url.call(this.$element,a));"function"==typeof e.data&&(e.data=e.data.call(this.$element,a));this.ajaxOptions.delay&&null!=a.term?(this._queryTimeout&&window.clearTimeout(this._queryTimeout),this._queryTimeout=window.setTimeout(d,this.ajaxOptions.delay)):d()},d}),r.define("select2/data/tags",
["jquery"],function(a){function b(a,b,c){var d=c.get("tags"),e=c.get("createTag");void 0!==e&&(this.createTag=e);e=c.get("insertTag");if(void 0!==e&&(this.insertTag=e),a.call(this,b,c),Array.isArray(d))for(a=0;a<d.length;a++)b=d[a],b=this._normalizeItem(b),b=this.option(b),this.$element.append(b)}return b.prototype.query=function(a,b,c){var d=this;this._removeOldTags();null!=b.term&&null==b.page?a.call(this,b,function I(a,f){for(var e=a.results,g=0;g<e.length;g++){var h=e[g],q=null!=h.children&&!I({results:h.children},
!0);if((h.text||"").toUpperCase()===(b.term||"").toUpperCase()||q)return!f&&(a.data=e,void c(a))}if(f)return!0;var l;f=d.createTag(b);null!=f&&((l=d.option(f)).attr("data-select2-tag","true"),d.addOptions([l]),d.insertTag(e,f));a.results=e;c(a)}):a.call(this,b,c)},b.prototype.createTag=function(a,b){if(null==b.term)return null;b=b.term.trim();return""===b?null:{id:b,text:b}},b.prototype.insertTag=function(a,b,c){b.unshift(c)},b.prototype._removeOldTags=function(b){this.$element.find("option[data-select2-tag]").each(function(){this.selected||
a(this).remove()})},b}),r.define("select2/data/tokenizer",["jquery"],function(a){function b(a,b,c){var d=c.get("tokenizer");void 0!==d&&(this.tokenizer=d);a.call(this,b,c)}return b.prototype.bind=function(a,b,c){a.call(this,b,c);this.$search=b.dropdown.$search||b.selection.$search||c.find(".select2-search__field")},b.prototype.query=function(b,c,d){var f=this;c.term=c.term||"";var e=this.tokenizer(c,this.options,function(b){var c,d=f._normalizeItem(b);f.$element.find("option").filter(function(){return a(this).val()===
d.id}).length||((c=f.option(d)).attr("data-select2-tag",!0),f._removeOldTags(),f.addOptions([c]));f.trigger("select",{data:d})});e.term!==c.term&&(this.$search.length&&(this.$search.val(e.term),this.$search.trigger("focus")),c.term=e.term);b.call(this,c,d)},b.prototype.tokenizer=function(b,c,d,f){b=d.get("tokenSeparators")||[];d=c.term;for(var e=0,g=this.createTag||function(a){return{id:a.term,text:a.term}};e<d.length;){var h=d[e];-1!==b.indexOf(h)?(h=d.substr(0,e),null!=(h=g(a.extend({},c,{term:h})))?
(f(h),d=d.substr(e+1)||"",e=0):e++):e++}return{term:d}},b}),r.define("select2/data/minimumInputLength",[],function(){function a(a,b,c){this.minimumInputLength=c.get("minimumInputLength");a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.term=b.term||"";b.term.length<this.minimumInputLength?this.trigger("results:message",{message:"inputTooShort",args:{minimum:this.minimumInputLength,input:b.term,params:b}}):a.call(this,b,c)},a}),r.define("select2/data/maximumInputLength",[],function(){function a(a,
b,c){this.maximumInputLength=c.get("maximumInputLength");a.call(this,b,c)}return a.prototype.query=function(a,b,c){b.term=b.term||"";0<this.maximumInputLength&&b.term.length>this.maximumInputLength?this.trigger("results:message",{message:"inputTooLong",args:{maximum:this.maximumInputLength,input:b.term,params:b}}):a.call(this,b,c)},a}),r.define("select2/data/maximumSelectionLength",[],function(){function a(a,b,c){this.maximumSelectionLength=c.get("maximumSelectionLength");a.call(this,b,c)}return a.prototype.bind=
function(a,b,c){var d=this;a.call(this,b,c);b.on("select",function(){d._checkIfMaximumSelected()})},a.prototype.query=function(a,b,c){var d=this;this._checkIfMaximumSelected(function(){a.call(d,b,c)})},a.prototype._checkIfMaximumSelected=function(a,b){var c=this;this.current(function(a){a=null!=a?a.length:0;0<c.maximumSelectionLength&&a>=c.maximumSelectionLength?c.trigger("results:message",{message:"maximumSelected",args:{maximum:c.maximumSelectionLength}}):b&&b()})},a}),r.define("select2/dropdown",
["jquery","./utils"],function(a,b){function c(a,b){this.$element=a;this.options=b;c.__super__.constructor.call(this)}return b.Extend(c,b.Observable),c.prototype.render=function(){var b=a('<span class="select2-dropdown"><span class="select2-results"></span></span>');return b.attr("dir",this.options.get("dir")),this.$dropdown=b},c.prototype.bind=function(){},c.prototype.position=function(a,b){},c.prototype.destroy=function(){this.$dropdown.remove()},c}),r.define("select2/dropdown/search",["jquery"],
function(a){function b(){}return b.prototype.render=function(b){var c=b.call(this),d=this.options.get("translations").get("search");b=a('<span class="select2-search select2-search--dropdown"><input class="select2-search__field" type="search" tabindex="-1" autocorrect="off" autocapitalize="none" spellcheck="false" role="searchbox" aria-autocomplete="list" /></span>');return this.$searchContainer=b,this.$search=b.find("input"),this.$search.prop("autocomplete",this.options.get("autocomplete")),this.$search.attr("aria-label",
d()),c.prepend(b),c},b.prototype.bind=function(b,c,d){var f=this,e=c.id+"-results";b.call(this,c,d);this.$search.on("keydown",function(a){f.trigger("keypress",a);f._keyUpPrevented=a.isDefaultPrevented()});this.$search.on("input",function(b){a(this).off("keyup")});this.$search.on("keyup input",function(a){f.handleSearch(a)});c.on("open",function(){f.$search.attr("tabindex",0);f.$search.attr("aria-controls",e);f.$search.trigger("focus");window.setTimeout(function(){f.$search.trigger("focus")},0)});
c.on("close",function(){f.$search.attr("tabindex",-1);f.$search.removeAttr("aria-controls");f.$search.removeAttr("aria-activedescendant");f.$search.val("");f.$search.trigger("blur")});c.on("focus",function(){c.isOpen()||f.$search.trigger("focus")});c.on("results:all",function(a){null!=a.query.term&&""!==a.query.term||(f.showSearch(a)?f.$searchContainer[0].classList.remove("select2-search--hide"):f.$searchContainer[0].classList.add("select2-search--hide"))});c.on("results:focus",function(a){a.data._resultId?
f.$search.attr("aria-activedescendant",a.data._resultId):f.$search.removeAttr("aria-activedescendant")})},b.prototype.handleSearch=function(a){var b;this._keyUpPrevented||(b=this.$search.val(),this.trigger("query",{term:b}));this._keyUpPrevented=!1},b.prototype.showSearch=function(a,b){return!0},b}),r.define("select2/dropdown/hidePlaceholder",[],function(){function a(a,b,c,d){this.placeholder=this.normalizePlaceholder(c.get("placeholder"));a.call(this,b,c,d)}return a.prototype.append=function(a,b){b.results=
this.removePlaceholder(b.results);a.call(this,b)},a.prototype.normalizePlaceholder=function(a,b){return"string"==typeof b?{id:"",text:b}:b},a.prototype.removePlaceholder=function(a,b){a=b.slice(0);for(var c=b.length-1;0<=c;c--)this.placeholder.id===b[c].id&&a.splice(c,1);return a},a}),r.define("select2/dropdown/infiniteScroll",["jquery"],function(a){function b(a,b,c,d){this.lastParams={};a.call(this,b,c,d);this.$loadingMore=this.createLoadingMore();this.loading=!1}return b.prototype.append=function(a,
b){this.$loadingMore.remove();this.loading=!1;a.call(this,b);this.showLoadingMore(b)&&(this.$results.append(this.$loadingMore),this.loadMoreIfNeeded())},b.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c);b.on("query",function(a){d.lastParams=a;d.loading=!0});b.on("query:append",function(a){d.lastParams=a;d.loading=!0});this.$results.on("scroll",this.loadMoreIfNeeded.bind(this))},b.prototype.loadMoreIfNeeded=function(){var b=a.contains(document.documentElement,this.$loadingMore[0]);!this.loading&&
b&&(b=this.$results.offset().top+this.$results.outerHeight(!1),this.$loadingMore.offset().top+this.$loadingMore.outerHeight(!1)<=b+50&&this.loadMore())},b.prototype.loadMore=function(){this.loading=!0;var b=a.extend({},{page:1},this.lastParams);b.page++;this.trigger("query:append",b)},b.prototype.showLoadingMore=function(a,b){return b.pagination&&b.pagination.more},b.prototype.createLoadingMore=function(){var b=a('<li class="select2-results__option select2-results__option--load-more"role="option" aria-disabled="true"></li>'),
c=this.options.get("translations").get("loadingMore");return b.html(c(this.lastParams)),b},b}),r.define("select2/dropdown/attachBody",["jquery","../utils"],function(a,b){function c(b,c,d){this.$dropdownParent=a(d.get("dropdownParent")||document.body);b.call(this,c,d)}return c.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c);b.on("open",function(){d._showDropdown();d._attachPositioningHandler(b);d._bindContainerResultHandlers(b)});b.on("close",function(){d._hideDropdown();d._detachPositioningHandler(b)});
this.$dropdownContainer.on("mousedown",function(a){a.stopPropagation()})},c.prototype.destroy=function(a){a.call(this);this.$dropdownContainer.remove()},c.prototype.position=function(a,b,c){b.attr("class",c.attr("class"));b[0].classList.remove("select2");b[0].classList.add("select2-container--open");b.css({position:"absolute",top:-999999});this.$container=c},c.prototype.render=function(b){var c=a("<span></span>");b=b.call(this);return c.append(b),this.$dropdownContainer=c},c.prototype._hideDropdown=
function(a){this.$dropdownContainer.detach()},c.prototype._bindContainerResultHandlers=function(a,b){var c;this._containerResultsHandlersBound||(c=this,b.on("results:all",function(){c._positionDropdown();c._resizeDropdown()}),b.on("results:append",function(){c._positionDropdown();c._resizeDropdown()}),b.on("results:message",function(){c._positionDropdown();c._resizeDropdown()}),b.on("select",function(){c._positionDropdown();c._resizeDropdown()}),b.on("unselect",function(){c._positionDropdown();c._resizeDropdown()}),
this._containerResultsHandlersBound=!0)},c.prototype._attachPositioningHandler=function(c,d){var f=this;c="scroll.select2."+d.id;var e="resize.select2."+d.id,g="orientationchange.select2."+d.id;d=this.$container.parents().filter(b.hasScroll);d.each(function(){b.StoreData(this,"select2-scroll-position",{x:a(this).scrollLeft(),y:a(this).scrollTop()})});d.on(c,function(c){c=b.GetData(this,"select2-scroll-position");a(this).scrollTop(c.y)});a(window).on(c+" "+e+" "+g,function(a){f._positionDropdown();
f._resizeDropdown()})},c.prototype._detachPositioningHandler=function(c,d){c="scroll.select2."+d.id;var f="resize.select2."+d.id;d="orientationchange.select2."+d.id;this.$container.parents().filter(b.hasScroll).off(c);a(window).off(c+" "+f+" "+d)},c.prototype._positionDropdown=function(){var b=a(window),c=this.$dropdown[0].classList.contains("select2-dropdown--above"),d=this.$dropdown[0].classList.contains("select2-dropdown--below"),e=null,h=this.$container.offset();h.bottom=h.top+this.$container.outerHeight(!1);
var l=this.$container.outerHeight(!1);var m=h.top;l=h.top+l;var k=this.$dropdown.outerHeight(!1),n=b.scrollTop(),t=b.scrollTop()+b.height(),p=n<h.top-k;b=t>h.bottom+k;n={left:h.left,top:l};t=this.$dropdownParent;"static"===t.css("position")&&(t=t.offsetParent());h={top:0,left:0};(a.contains(document.body,t[0])||t[0].isConnected)&&(h=t.offset());n.top-=h.top;n.left-=h.left;c||d||(e="below");b||!p||c?!p&&b&&c&&(e="below"):e="above";("above"==e||c&&"below"!==e)&&(n.top=m-h.top-k);null!=e&&(this.$dropdown[0].classList.remove("select2-dropdown--below"),
this.$dropdown[0].classList.remove("select2-dropdown--above"),this.$dropdown[0].classList.add("select2-dropdown--"+e),this.$container[0].classList.remove("select2-container--below"),this.$container[0].classList.remove("select2-container--above"),this.$container[0].classList.add("select2-container--"+e));this.$dropdownContainer.css(n)},c.prototype._resizeDropdown=function(){var a={width:this.$container.outerWidth(!1)+"px"};this.options.get("dropdownAutoWidth")&&(a.minWidth=a.width,a.position="relative",
a.width="auto");this.$dropdown.css(a)},c.prototype._showDropdown=function(a){this.$dropdownContainer.appendTo(this.$dropdownParent);this._positionDropdown();this._resizeDropdown()},c}),r.define("select2/dropdown/minimumResultsForSearch",[],function(){function a(a,b,c,d){this.minimumResultsForSearch=c.get("minimumResultsForSearch");0>this.minimumResultsForSearch&&(this.minimumResultsForSearch=1/0);a.call(this,b,c,d)}return a.prototype.showSearch=function(a,b){return!(function f(a){for(var b=0,c=0;c<
a.length;c++){var d=a[c];d.children?b+=f(d.children):b++}return b}(b.data.results)<this.minimumResultsForSearch)&&a.call(this,b)},a}),r.define("select2/dropdown/selectOnClose",["../utils"],function(a){function b(){}return b.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c);b.on("close",function(a){d._handleSelectOnClose(a)})},b.prototype._handleSelectOnClose=function(b,c){if(c&&null!=c.originalSelect2Event&&(b=c.originalSelect2Event,"select"===b._type||"unselect"===b._type))return;b=this.getHighlightedResults();
1>b.length||null!=(b=a.GetData(b[0],"data")).element&&b.element.selected||null==b.element&&b.selected||this.trigger("select",{data:b})},b}),r.define("select2/dropdown/closeOnSelect",[],function(){function a(){}return a.prototype.bind=function(a,b,c){var d=this;a.call(this,b,c);b.on("select",function(a){d._selectTriggered(a)});b.on("unselect",function(a){d._selectTriggered(a)})},a.prototype._selectTriggered=function(a,b){(a=b.originalEvent)&&(a.ctrlKey||a.metaKey)||this.trigger("close",{originalEvent:a,
originalSelect2Event:b})},a}),r.define("select2/dropdown/dropdownCss",["../utils"],function(a){function b(){}return b.prototype.render=function(b){var c=b.call(this);b=this.options.get("dropdownCssClass")||"";return-1!==b.indexOf(":all:")&&(b=b.replace(":all:",""),a.copyNonInternalCssClasses(c[0],this.$element[0])),c.addClass(b),c},b}),r.define("select2/dropdown/tagsSearchHighlight",["../utils"],function(a){function b(){}return b.prototype.highlightFirstItem=function(b){var c=this.$results.find(".select2-results__option--selectable:not(.select2-results__option--selected)");
if(0<c.length){var d=c.first();if((c=a.GetData(d[0],"data").element)&&c.getAttribute&&"true"===c.getAttribute("data-select2-tag"))return void d.trigger("mouseenter")}b.call(this)},b}),r.define("select2/i18n/en",[],function(){return{errorLoading:function(){return"The results could not be loaded."},inputTooLong:function(a){var b=a.input.length-a.maximum;a="Please delete "+b+" character";return 1!=b&&(a+="s"),a},inputTooShort:function(a){return"Please enter "+(a.minimum-a.input.length)+" or more characters"},
loadingMore:function(){return"Loading more results\u2026"},maximumSelected:function(a){var b="You can only select "+a.maximum+" item";return 1!=a.maximum&&(b+="s"),b},noResults:function(){return"No results found"},searching:function(){return"Searching\u2026"},removeAllItems:function(){return"Remove all items"},removeItem:function(){return"Remove item"},search:function(){return"Search"}}}),r.define("select2/defaults","jquery ./results ./selection/single ./selection/multiple ./selection/placeholder ./selection/allowClear ./selection/search ./selection/selectionCss ./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 ./dropdown/dropdownCss ./dropdown/tagsSearchHighlight ./i18n/en".split(" "),
function(a,b,c,d,e,f,h,l,m,k,n,p,w,u,r,v,z,y,D,A,C,E,G,J,K,L,M,N,O,P,Q){function g(){this.reset()}return g.prototype.apply=function(g){var n;null==(g=a.extend(!0,{},this.defaults,g)).dataAdapter&&(null!=g.ajax?g.dataAdapter=r:null!=g.data?g.dataAdapter=u:g.dataAdapter=w,0<g.minimumInputLength&&(g.dataAdapter=k.Decorate(g.dataAdapter,y)),0<g.maximumInputLength&&(g.dataAdapter=k.Decorate(g.dataAdapter,D)),0<g.maximumSelectionLength&&(g.dataAdapter=k.Decorate(g.dataAdapter,A)),g.tags&&(g.dataAdapter=
k.Decorate(g.dataAdapter,v)),null==g.tokenSeparators&&null==g.tokenizer||(g.dataAdapter=k.Decorate(g.dataAdapter,z)));null==g.resultsAdapter&&(g.resultsAdapter=b,null!=g.ajax&&(g.resultsAdapter=k.Decorate(g.resultsAdapter,J)),null!=g.placeholder&&(g.resultsAdapter=k.Decorate(g.resultsAdapter,G)),g.selectOnClose&&(g.resultsAdapter=k.Decorate(g.resultsAdapter,M)),g.tags&&(g.resultsAdapter=k.Decorate(g.resultsAdapter,P)));null==g.dropdownAdapter&&(g.multiple?g.dropdownAdapter=C:(n=k.Decorate(C,E),g.dropdownAdapter=
n),0!==g.minimumResultsForSearch&&(g.dropdownAdapter=k.Decorate(g.dropdownAdapter,L)),g.closeOnSelect&&(g.dropdownAdapter=k.Decorate(g.dropdownAdapter,N)),null!=g.dropdownCssClass&&(g.dropdownAdapter=k.Decorate(g.dropdownAdapter,O)),g.dropdownAdapter=k.Decorate(g.dropdownAdapter,K));null==g.selectionAdapter&&(g.multiple?g.selectionAdapter=d:g.selectionAdapter=c,null!=g.placeholder&&(g.selectionAdapter=k.Decorate(g.selectionAdapter,e)),g.allowClear&&(g.selectionAdapter=k.Decorate(g.selectionAdapter,
f)),g.multiple&&(g.selectionAdapter=k.Decorate(g.selectionAdapter,h)),null!=g.selectionCssClass&&(g.selectionAdapter=k.Decorate(g.selectionAdapter,l)),g.selectionAdapter=k.Decorate(g.selectionAdapter,m));g.language=this._resolveLanguage(g.language);g.language.push("en");n=[];for(var p=0;p<g.language.length;p++){var q=g.language[p];-1===n.indexOf(q)&&n.push(q)}return g.language=n,g.translations=this._processTranslations(g.language,g.debug),g},g.prototype.reset=function(){function b(a){return a.replace(/[^\u0000-\u007E]/g,
function(a){return p[a]||a})}this.defaults={amdLanguageBase:"./i18n/",autocomplete:"off",closeOnSelect:!0,debug:!1,dropdownAutoWidth:!1,escapeMarkup:k.escapeMarkup,language:{},matcher:function H(c,d){if(null==c.term||""===c.term.trim())return d;if(d.children&&0<d.children.length){for(var f=a.extend(!0,{},d),e=d.children.length-1;0<=e;e--)null==H(c,d.children[e])&&f.children.splice(e,1);return 0<f.children.length?f:H(c,f)}f=b(d.text).toUpperCase();c=b(c.term).toUpperCase();return-1<f.indexOf(c)?d:
null},minimumInputLength:0,maximumInputLength:0,maximumSelectionLength:0,minimumResultsForSearch:0,selectOnClose:!1,scrollAfterSelect:!1,sorter:function(a){return a},templateResult:function(a){return a.text},templateSelection:function(a){return a.text},theme:"default",width:"resolve"}},g.prototype.applyFromElement=function(a,b){var c=a.language,d=this.defaults.language,f=b.prop("lang");b=b.closest("[lang]").prop("lang");b=Array.prototype.concat.call(this._resolveLanguage(f),this._resolveLanguage(c),
this._resolveLanguage(d),this._resolveLanguage(b));return a.language=b,a},g.prototype._resolveLanguage=function(b){if(!b||a.isEmptyObject(b))return[];if(a.isPlainObject(b))return[b];var c;b=Array.isArray(b)?b:[b];for(var d=[],f=0;f<b.length;f++)d.push(b[f]),"string"==typeof b[f]&&0<b[f].indexOf("-")&&(c=b[f].split("-")[0],d.push(c));return d},g.prototype._processTranslations=function(b,c){for(var d=new n,f=0;f<b.length;f++){var e=new n,g=b[f];if("string"==typeof g)try{e=n.loadPath(g)}catch(R){try{g=
this.defaults.amdLanguageBase+g,e=n.loadPath(g)}catch(S){c&&window.console&&console.warn&&console.warn('Select2: The language file for "'+g+'" could not be automatically loaded. A fallback will be used instead.')}}else e=a.isPlainObject(g)?new n(g):g;d.extend(e)}return d},g.prototype.set=function(b,c){var d={};d[a.camelCase(b)]=c;d=k._convertData(d);a.extend(!0,this.defaults,d)},new g}),r.define("select2/options",["jquery","./defaults","./utils"],function(a,b,c){function d(a,c){this.options=a;null!=
c&&this.fromElement(c);null!=c&&(this.options=b.applyFromElement(this.options,c));this.options=b.apply(this.options)}return d.prototype.fromElement=function(b){function d(a,b){return b.toUpperCase()}var e=["select2"];null==this.options.multiple&&(this.options.multiple=b.prop("multiple"));null==this.options.disabled&&(this.options.disabled=b.prop("disabled"));null==this.options.autocomplete&&b.prop("autocomplete")&&(this.options.autocomplete=b.prop("autocomplete"));null==this.options.dir&&(b.prop("dir")?
this.options.dir=b.prop("dir"):b.closest("[dir]").prop("dir")?this.options.dir=b.closest("[dir]").prop("dir"):this.options.dir="ltr");b.prop("disabled",this.options.disabled);b.prop("multiple",this.options.multiple);c.GetData(b[0],"select2Tags")&&(this.options.debug&&window.console&&console.warn&&console.warn('Select2: The `data-select2-tags` attribute has been changed to use the `data-data` and `data-tags="true"` attributes and will be removed in future versions of Select2.'),c.StoreData(b[0],"data",
c.GetData(b[0],"select2Tags")),c.StoreData(b[0],"tags",!0));c.GetData(b[0],"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."),b.attr("ajax--url",c.GetData(b[0],"ajaxUrl")),c.StoreData(b[0],"ajax-Url",c.GetData(b[0],"ajaxUrl")));for(var g={},h=0;h<b[0].attributes.length;h++){var l=b[0].attributes[h].name,k="data-";l.substr(0,
k.length)==k&&(l=l.substring(k.length),k=c.GetData(b[0],l),g[l.replace(/-([a-z])/g,d)]=k)}a.fn.jquery&&"1."==a.fn.jquery.substr(0,2)&&b[0].dataset&&(g=a.extend(!0,{},b[0].dataset,g));var m;b=a.extend(!0,{},c.GetData(b[0]),g);for(m in b=c._convertData(b))-1<e.indexOf(m)||(a.isPlainObject(this.options[m])?a.extend(this.options[m],b[m]):this.options[m]=b[m]);return this},d.prototype.get=function(a){return this.options[a]},d.prototype.set=function(a,b){this.options[a]=b},d}),r.define("select2/core",["jquery",
"./options","./utils","./keys"],function(a,b,c,d){var e=function(a,d){null!=c.GetData(a[0],"select2")&&c.GetData(a[0],"select2").destroy();this.$element=a;this.id=this._generateId(a);d=d||{};this.options=new b(d,a);e.__super__.constructor.call(this);var f=a.attr("tabindex")||0;c.StoreData(a[0],"old-tabindex",f);a.attr("tabindex","-1");d=this.options.get("dataAdapter");this.dataAdapter=new d(a,this.options);f=this.render();this._placeContainer(f);d=this.options.get("selectionAdapter");this.selection=
new d(a,this.options);this.$selection=this.selection.render();this.selection.position(this.$selection,f);d=this.options.get("dropdownAdapter");this.dropdown=new d(a,this.options);this.$dropdown=this.dropdown.render();this.dropdown.position(this.$dropdown,f);f=this.options.get("resultsAdapter");this.results=new f(a,this.options,this.dataAdapter);this.$results=this.results.render();this.results.position(this.$results,this.$dropdown);var h=this;this._bindAdapters();this._registerDomEvents();this._registerDataEvents();
this._registerSelectionEvents();this._registerDropdownEvents();this._registerResultsEvents();this._registerEvents();this.dataAdapter.current(function(a){h.trigger("selection:update",{data:a})});a[0].classList.add("select2-hidden-accessible");a.attr("aria-hidden","true");this._syncAttributes();c.StoreData(a[0],"select2",this);a.data("select2",this)};return c.Extend(e,c.Observable),e.prototype._generateId=function(a){return"select2-"+(null!=a.attr("id")?a.attr("id"):null!=a.attr("name")?a.attr("name")+
"-"+c.generateChars(2):c.generateChars(4)).replace(/(:|\.|\[|\]|,)/g,"")},e.prototype._placeContainer=function(a){a.insertAfter(this.$element);var b=this._resolveWidth(this.$element,this.options.get("width"));null!=b&&a.css("width",b)},e.prototype._resolveWidth=function(a,b){var c=/^width:(([-+]?([0-9]*\.)?[0-9]+)(px|em|ex|%|in|cm|mm|pt|pc))/i;if("resolve"==b)return c=this._resolveWidth(a,"style"),null!=c?c:this._resolveWidth(a,"element");if("element"==b)return c=a.outerWidth(!1),0>=c?"auto":c+"px";
if("style"!=b)return"computedstyle"!=b?b:window.getComputedStyle(a[0]).width;a=a.attr("style");if("string"!=typeof a)return null;a=a.split(";");b=0;for(var d=a.length;b<d;b+=1){var e=a[b].replace(/\s/g,"").match(c);if(null!==e&&1<=e.length)return e[1]}return null},e.prototype._bindAdapters=function(){this.dataAdapter.bind(this,this.$container);this.selection.bind(this,this.$container);this.dropdown.bind(this,this.$container);this.results.bind(this,this.$container)},e.prototype._registerDomEvents=
function(){var a=this;this.$element.on("change.select2",function(){a.dataAdapter.current(function(b){a.trigger("selection:update",{data:b})})});this.$element.on("focus.select2",function(b){a.trigger("focus",b)});this._syncA=c.bind(this._syncAttributes,this);this._syncS=c.bind(this._syncSubtree,this);this._observer=new window.MutationObserver(function(b){a._syncA();a._syncS(b)});this._observer.observe(this.$element[0],{attributes:!0,childList:!0,subtree:!1})},e.prototype._registerDataEvents=function(){var a=
this;this.dataAdapter.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerSelectionEvents=function(){var a=this,b=["toggle","focus"];this.selection.on("toggle",function(){a.toggleDropdown()});this.selection.on("focus",function(b){a.focus(b)});this.selection.on("*",function(c,d){-1===b.indexOf(c)&&a.trigger(c,d)})},e.prototype._registerDropdownEvents=function(){var a=this;this.dropdown.on("*",function(b,c){a.trigger(b,c)})},e.prototype._registerResultsEvents=function(){var a=this;this.results.on("*",
function(b,c){a.trigger(b,c)})},e.prototype._registerEvents=function(){var a=this;this.on("open",function(){a.$container[0].classList.add("select2-container--open")});this.on("close",function(){a.$container[0].classList.remove("select2-container--open")});this.on("enable",function(){a.$container[0].classList.remove("select2-container--disabled")});this.on("disable",function(){a.$container[0].classList.add("select2-container--disabled")});this.on("blur",function(){a.$container[0].classList.remove("select2-container--focus")});
this.on("query",function(b){a.isOpen()||a.trigger("open",{});this.dataAdapter.query(b,function(c){a.trigger("results:all",{data:c,query:b})})});this.on("query:append",function(b){this.dataAdapter.query(b,function(c){a.trigger("results:append",{data:c,query:b})})});this.on("keypress",function(b){var c=b.which;a.isOpen()?c===d.ESC||c===d.UP&&b.altKey?(a.close(b),b.preventDefault()):c===d.ENTER||c===d.TAB?(a.trigger("results:select",{}),b.preventDefault()):c===d.SPACE&&b.ctrlKey?(a.trigger("results:toggle",
{}),b.preventDefault()):c===d.UP?(a.trigger("results:previous",{}),b.preventDefault()):c===d.DOWN&&(a.trigger("results:next",{}),b.preventDefault()):(c===d.ENTER||c===d.SPACE||c===d.DOWN&&b.altKey)&&(a.open(),b.preventDefault())})},e.prototype._syncAttributes=function(){this.options.set("disabled",this.$element.prop("disabled"));this.isDisabled()?(this.isOpen()&&this.close(),this.trigger("disable",{})):this.trigger("enable",{})},e.prototype._isChangeMutation=function(a){var b=this;if(a.addedNodes&&
0<a.addedNodes.length)for(var c=0;c<a.addedNodes.length;c++){if(a.addedNodes[c].selected)return!0}else{if(a.removedNodes&&0<a.removedNodes.length)return!0;if(Array.isArray(a))return a.some(function(a){return b._isChangeMutation(a)})}return!1},e.prototype._syncSubtree=function(a){a=this._isChangeMutation(a);var b=this;a&&this.dataAdapter.current(function(a){b.trigger("selection:update",{data:a})})},e.prototype.trigger=function(a,b){var c=e.__super__.trigger,d={open:"opening",close:"closing",select:"selecting",
unselect:"unselecting",clear:"clearing"};if(void 0===b&&(b={}),a in d){var f=d[a];d={prevented:!1,name:a,args:b};if(c.call(this,f,d),d.prevented)return void(b.prevented=!0)}c.call(this,a,b)},e.prototype.toggleDropdown=function(){this.isDisabled()||(this.isOpen()?this.close():this.open())},e.prototype.open=function(){this.isOpen()||this.isDisabled()||this.trigger("query",{})},e.prototype.close=function(a){this.isOpen()&&this.trigger("close",{originalEvent:a})},e.prototype.isEnabled=function(){return!this.isDisabled()},
e.prototype.isDisabled=function(){return this.options.get("disabled")},e.prototype.isOpen=function(){return this.$container[0].classList.contains("select2-container--open")},e.prototype.hasFocus=function(){return this.$container[0].classList.contains("select2-container--focus")},e.prototype.focus=function(a){this.hasFocus()||(this.$container[0].classList.add("select2-container--focus"),this.trigger("focus",{}))},e.prototype.enable=function(a){this.options.get("debug")&&window.console&&console.warn&&
console.warn('Select2: The `select2("enable")` method has been deprecated and will be removed in later Select2 versions. Use $element.prop("disabled") instead.');a=!(a=null==a||0===a.length?[!0]:a)[0];this.$element.prop("disabled",a)},e.prototype.data=function(){this.options.get("debug")&&0<arguments.length&&window.console&&console.warn&&console.warn('Select2: Data can no longer be set using `select2("data")`. You should consider setting the value instead using `$element.val()`.');var a=[];return this.dataAdapter.current(function(b){a=
b}),a},e.prototype.val=function(a){if(this.options.get("debug")&&window.console&&console.warn&&console.warn('Select2: The `select2("val")` method has been deprecated and will be removed in later Select2 versions. Use $element.val() instead.'),null==a||0===a.length)return this.$element.val();a=a[0];Array.isArray(a)&&(a=a.map(function(a){return a.toString()}));this.$element.val(a).trigger("input").trigger("change")},e.prototype.destroy=function(){c.RemoveData(this.$container[0]);this.$container.remove();
this._observer.disconnect();this._syncS=this._syncA=this._observer=null;this.$element.off(".select2");this.$element.attr("tabindex",c.GetData(this.$element[0],"old-tabindex"));this.$element[0].classList.remove("select2-hidden-accessible");this.$element.attr("aria-hidden","false");c.RemoveData(this.$element[0]);this.$element.removeData("select2");this.dataAdapter.destroy();this.selection.destroy();this.dropdown.destroy();this.results.destroy();this.results=this.dropdown=this.selection=this.dataAdapter=
null},e.prototype.render=function(){var b=a('<span class="select2 select2-container"><span class="selection"></span><span class="dropdown-wrapper" aria-hidden="true"></span></span>');return b.attr("dir",this.options.get("dir")),this.$container=b,this.$container[0].classList.add("select2-container--"+this.options.get("theme")),c.StoreData(b[0],"element",this.$element),b},e}),r.define("jquery-mousewheel",["jquery"],function(a){return a}),r.define("jquery.select2",["jquery","jquery-mousewheel","./select2/core",
"./select2/defaults","./select2/utils"],function(a,b,c,d,e){var f;return null==a.fn.select2&&(f=["open","close","destroy"],a.fn.select2=function(b){if("object"==typeof(b=b||{}))return this.each(function(){var d=a.extend(!0,{},b);new c(a(this),d)}),this;if("string"!=typeof b)throw Error("Invalid arguments for Select2: "+b);var d,h=Array.prototype.slice.call(arguments,1);return this.each(function(){var a=e.GetData(this,"select2");null==a&&window.console&&console.error&&console.error("The select2('"+
b+"') method was called on an element that is not using Select2.");d=a[b].apply(a,h)}),-1<f.indexOf(b)?this:d}),null==a.fn.select2.defaults&&(a.fn.select2.defaults=d),c}),{define:r.define,require:r.require});var r=C.require("jquery.select2");return a.fn.select2.amd=C,r});"undefined"===typeof window.tdcPostSettings&&(window.tdcPostSettings={tdbTemplateType:"all"});
if(window.tdbVue&&"undefined"!==typeof window.tdbVue.router){var eventHub=new CloudLibraryVue;CloudLibraryVue.component("image-links",{template:'\n            <a :class="classes" :href="link">{{text}}</a>\n        ',props:{classes:[],link:"",text:""}});new CloudLibraryVue({el:"#tdb-modal",router:window.tdbVue.router})}window.tdbVueManager&&"undefined"!==typeof window.tdbVueManager.router&&new CloudLibraryVue({el:"#tdb-modal-website-manager",router:window.tdbVueManager.router});
(function(){function a(a,c,d,e,l,k,m){var b=jQuery(".tdb-"+a+"-templates");b.length&&"undefined"===typeof b.data("tdb-templates")&&("undefined"!==typeof k&&k.call(),tdbGetMobileTemplates(a,c,b),k="","undefined"!==typeof tdcState&&(k=tdcState.isMobileComposer()?"1":""),k={action:"tdb_get_"+a+"_templates",mobile_templates:k,_nonce:window.tdb_globals.wpRestNonce},k[a+"_id"]=c,jQuery.ajax({type:"POST",url:td_ajax_url,data:k,success:function(h,k,n){b.html("");h=jQuery.parseJSON(h);k='<div class="tdb-templates-header"><div class="tdb-templates-header-item tdb-templates-header-item-name"><span>Cloud Templates</span></div>'+
("undefined"!==typeof e&&!0===e?'<div class="tdb-templates-header-item tdb-templates-header-item-global"><span>Global</span></div>':"")+'<div class="tdb-templates-header-item tdb-templates-header-item-mobile" title="Optional - Create or assign a dedicated Mobile Template"><span>Mobile Template</span></div></div>';var p=n="",w=!1;_.isArray(h)&&h.length?(_.each(h,function(b,h,k){h="";"true"===b.is_current.toString()&&(h=" tdb-current",w=!0);h='<div class="tdb-template-el tdb-'+a+"-template-el"+h+'"  data-template-id="'+
b.template_id+'"><div class="tdb-template-el-id tdb-'+a+'-template-id">'+b.template_id+'</div><div class="tdb-template-el-title" data-type="'+a+'" data-action="'+d+'" title="'+b.template_title+' - Set template for this post" data-'+a+'-id="'+c+'" data-template-id="'+b.template_id+'">'+b.template_title+'</div><div class="tdb-template-el-wrap"><div class="tdb-template-el-icon"><div class="tdb-template-el-options"><div title="Rename template" class="tdb-template-el-edit">Rename</div><div title="Duplicate template" class="tdb-template-el-duplicate">Duplicate</div><div title="Delete template" class="tdb-template-el-delete">Delete</div></div></div></div>';
"undefined"!==typeof e&&!0===e&&(k="","undefined"!==typeof l&&""!==l&&(k='data-global-action="'+l+'"'),h+='<div class="tdb-template-el-global tdb-'+a+'-template-global" title="Set as Global Template" data-type="'+a+'" data-'+a+'-id="'+c+'" data-template-id="'+b.template_id+'" '+k+'><input type="checkbox" class="tdb-template-el-global-input tdb-'+a+'-template-global-input" '+(!0===b.is_global?'checked="checked" ':"")+'><label></label><span class="tdb-template-el-global-checked tdb-'+a+'-template-global-checked">Global</span></div>');
h+='<div class="tdb-template-el-mobile-wrap tdb-'+a+'-template-mobile" data-type="'+a+'" data-'+a+'-id="'+c+'" data-template-id="'+b.template_id+'"><span class="tdb-template-el-mobile">'+(""===b.mobile_template_title?"-":'<span class="tdb-template-el-mobile-active">Yes</span>')+'</span><div class="tdb-template-el-mobile-btns" data-mobile-template-id="'+b.mobile_template_id+'" data-template-id="'+b.template_id+'"><div title="Optional - New mobile template" class="'+a+"id-"+b.template_id+' tdb-template-el-mobile-btn tdb-template-el-mobile-blank tdb-create-mobile-template" data-type="'+
a+'" data-'+a+'-id="'+c+'" data-template-id="'+b.template_id+'"></div><div title="Load mobile template from TagDiv Cloud Library" class="'+a+"id-"+b.template_id+' tdb-template-el-mobile-btn tdb-template-el-mobile-import tdb-load-mobile-template"></div></div></div>';p+=h+"</div>"}),"undefined"!==typeof e&&!0===e&&(n+='<div class="tdb-template-el tdb-'+a+"-template-el "+(w?"":"tdb-current")+'"><div class="tdb-template-el-id tdb-'+a+'-template-id"></div><div class="tdb-template-el-title" data-type="'+
a+'" data-action="'+d+'" title="Set as Global Template" data-'+a+'-id="'+c+'" data-template-id="">Global Template</div></div>'),b.append(n+k+p)):(b.append(k),b.append('<div class="tdb-templates-desc">No cloud templates. Please import one or more templates from <b>Cloud Library</b>.</div>'));b.data("tdb-templates",!0);"undefined"!==typeof m&&m.call()},error:function(a,b,c){}}))}function e(a,c,d){var b=jQuery(window);b.resize(function(){var e=b.width();a.offset().left+c.width()>e?c.hasClass(d)||c.addClass(d):
c.hasClass(d)&&c.removeClass(d)});b.resize()}jQuery(document).ready(function(){jQuery("#wp-admin-bar-tdb_template_builder_disabled a").click(function(a){a.preventDefault();alert("Please select tagDiv Builder Template from the theme panel or set a default template. The current page/post uses a template that is not editable.")});jQuery("#wp-admin-bar-new-tdb_templates").hide()});jQuery("body").on("click","#wp-admin-bar-tdb_template_load, .tdb-load-mobile-template",function(a){a.preventDefault();var b=
jQuery(this),d=b.attr("class");a="";var e=!1;b.hasClass("tdb-load-mobile-template")&&(e=!0);"undefined"!==typeof d&&(0===d.indexOf("singleid-")?(a={wp_type:"single",templateType:"Single"},b=d.split(" ")[0].replace("singleid-",""),e?a.assign_mobile_to_template=b:a.assign_to_post=b):0===d.indexOf("categoryid-")?(a={wp_type:"category",templateType:"Category"},b=d.split(" ")[0].replace("categoryid-",""),e?a.assign_mobile_to_template=b:a.assign_to_category=b):0===d.indexOf("404")?(a={wp_type:"404",templateType:"404"},
b=btoa(window.location.href),e?a.assign_mobile_to_template=b:a.assign_to_404=b):0===d.indexOf("date")?(a={wp_type:"date",templateType:"Date"},b=btoa(window.location.href),e?a.assign_mobile_to_template=b:a.assign_to_archive=b):0===d.indexOf("search")?(a={wp_type:"search",templateType:"Search"},b=btoa(window.location.href),e?a.assign_mobile_to_template=b:a.assign_to_search=b):0===d.indexOf("attachment")?(a={wp_type:"attachment",templateType:"Attachment"},b=btoa(window.location.href),e?a.assign_mobile_to_template=
b:a.assign_to_attachment=b):0===d.indexOf("authorid")?(a={wp_type:"author",templateType:"Author"},b=d.split(" ")[0].replace("authorid-",""),e?a.assign_mobile_to_template=b:a.assign_to_author=b):0===d.indexOf("tagid")?(a={wp_type:"tag",templateType:"Tag"},b=d.split(" ")[0].replace("tagid-",""),e?a.assign_mobile_to_template=b:a.assign_to_tag=b):0===d.indexOf("pageid")?(a={wp_type:"page",templateType:"Pages"},b=d.split(" ")[0].replace("pageid-",""),e&&(a.assign_mobile_to_template=b)):0===d.indexOf("woo_productid-")?
(a={wp_type:"woo_product",templateType:"Woo Product"},b=d.split(" ")[0].replace("woo_productid-",""),e?a.assign_mobile_to_template=b:a.assign_to_woo_product=b):0===d.indexOf("woo_archive")?(a={wp_type:"woo_archive",templateType:"Woo Archive"},b=btoa(window.location.href),e?a.assign_mobile_to_template=b:a.assign_to_search=b):0===d.indexOf("woo_search_archive")?(a={wp_type:"woo_search_archive",templateType:"Woo Search"},b=btoa(window.location.href),e?a.assign_mobile_to_template=b:a.assign_to_search=
b):0===d.indexOf("woo_shop_base")?(a={wp_type:"woo_shop_base",templateType:"Woo Shop Base"},b=btoa(window.location.href),e?a.assign_mobile_to_template=b:a.assign_to_search=b):0===d.indexOf("cpt_tax")?(a={wp_type:"cpt_tax",templateType:"Custom Taxonomy"},b=d.split(" ")[0].replace("templateid-",""),e?a.assign_mobile_to_template=b:a.assign_to_cpt_tax=b):0===d.indexOf("cpt")&&(a={wp_type:"cpt",templateType:"Custom Post Type"},b=d.split(" ")[0].replace("cptid-",""),e?a.assign_mobile_to_template=b:a.assign_to_cpt=
b),""!==a&&(a.hide_mobile_selector="hide",window.tdbVue.router.push({name:"loadRoute",params:a})))}).on("click",".tdb-create-mobile-template",function(a){var b=jQuery(this),d=b.data("template-id"),e=b.data("type");tdConfirm.modal({caption:"Create Mobile "+("page"===e?"Page":"Template"),objectContext:window,callbackYes:function(){var a=jQuery("#tdb-new-template-name"),c=jQuery("#tdb-copy-content");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_create_mobile_template",template_id:d,template_title:a.val(),
template_type:e,copyContent:c.is(":checked")?"1":"0",_nonce:window.tdb_globals.wpRestNonce},success:function(a,c,h){a=jQuery.parseJSON(a);"undefined"!==typeof a.mobile_template_id&&(tdConfirm.close(),c=b.closest(".tdb-template-el"),c.length&&(h=c.find(".tdb-template-el-mobile:first"),c.find(".tdb-template-el-mobile-btns:first").data("mobile-template-id",a.mobile_template_id),h.html('<span class="tdb-template-el-mobile-active">Yes</span>')),tdbGetMobileTemplates(e,d))},error:function(a,b,c){}})},htmlInfoContent:"Enter the mobile "+
("page"===e?"page":"template")+' name: <input id="tdb-new-template-name" type="text" value=""onfocus="(function(e){ jQuery( e.target ).siblings(\'#tdb-modal-notice\').fadeOut(50); })(event)"/><em id="tdb-modal-notice"></em><div class="tdb-form-check"><input type="checkbox" class="form-check-input" id="tdb-copy-content"><label class="form-check-label" for="tdb-copy-content"><span class="tdb-check"></span><span class="tdb-check-title">Copy content</span></label></div>',textYes:"Create",textNo:"Cancel"})}).on("click",
"#wp-admin-bar-tdb_template_single > a, #wp-admin-bar-tdb_template_category > a, #wp-admin-bar-tdb_template_404 > a, #wp-admin-bar-tdb_template_date > a, #wp-admin-bar-tdb_template_search > a, #wp-admin-bar-tdb_template_attachment > a, #wp-admin-bar-tdb_template_author > a, #wp-admin-bar-tdb_template_tag > a, #wp-admin-bar-tdb_template_woo_product > a, #wp-admin-bar-tdb_template_woo_archive > a, #wp-admin-bar-tdb_template_woo_shop_base > a, #wp-admin-bar-tdb_template_woo_search_archive > a, #wp-admin-bar-tdb_template_cpt > a, #wp-admin-bar-tdb_template_cpt_tax > a",
function(b){b.preventDefault();var c=jQuery(this),d=c.parent(),h=d.attr("class"),l="",k="",m="",n="";switch(d.attr("id")){case "wp-admin-bar-tdb_template_single":l="single";k="tdb_assign_single_template_to_post";m="tdb_assign_single_template_global";n=h.replace(l+"id-","");break;case "wp-admin-bar-tdb_template_category":l="category";k="tdb_assign_cat_template_to_cat";m="tdb_assign_cat_template_global";n=h.replace(l+"id-","");break;case "wp-admin-bar-tdb_template_404":l="404";k="tdb_assign_404_template_global";
m="";n=h.replace("templateid-","");break;case "wp-admin-bar-tdb_template_date":l="date";k="tdb_assign_date_template_global";m="";n=h.replace("templateid-","");break;case "wp-admin-bar-tdb_template_search":l="search";k="tdb_assign_search_template_global";m="";n=h.replace("templateid-","");break;case "wp-admin-bar-tdb_template_attachment":l="attachment";k="tdb_assign_attachment_template_global";m="";n=h.replace("templateid-","");break;case "wp-admin-bar-tdb_template_author":l="author";k="tdb_assign_author_template_to_author";
m="tdb_assign_author_template_global";n=h.replace(l+"id-","");break;case "wp-admin-bar-tdb_template_tag":l="tag";k="tdb_assign_tag_template_to_tag";m="tdb_assign_tag_template_global";n=h.replace(l+"id-","");break;case "wp-admin-bar-tdb_template_woo_product":l="woo_product";k="tdb_assign_woo_product_template_to_product";m="tdb_assign_woo_product_template_global";n=h.replace(l+"id-","");break;case "wp-admin-bar-tdb_template_woo_archive":l="woo_archive";k="tdb_assign_woo_archive_template_to_tax";m="tdb_assign_woo_archive_template_global";
n=h.replace(l+"id-","");break;case "wp-admin-bar-tdb_template_woo_search_archive":l="woo_search_archive";k="tdb_assign_woo_search_archive_template_global";m="";n=h.replace("templateid-","");break;case "wp-admin-bar-tdb_template_woo_shop_base":l="woo_shop_base";k="tdb_assign_woo_shop_base_template_global";m="";n=h.replace("templateid-","");break;case "wp-admin-bar-tdb_template_cpt":l="cpt";k="tdb_assign_cpt_template_to_cpt";m="tdb_assign_cpt_template_global";n=h.replace(l+"id-","");break;case "wp-admin-bar-tdb_template_cpt_tax":l=
"cpt_tax",k="tdb_assign_cpt_tax_template_to_tax",m="tdb_assign_cpt_tax_template_global",n=h.replace("templateid-","")}var p=jQuery(".tdb-"+l+"-templates");p.length?b.currentTarget===this&&jQuery(b.target).parent().attr("id")==="wp-admin-bar-tdb_template_"+l&&(p.toggle(),c.toggleClass("tdb-templates-open"),c.toggleClass("tdb-templates-close")):(c.addClass("tdb-templates-loading"),p=jQuery('<div class="tdb-templates tdb-'+l+'-templates" data-type="'+l+'"></div>'),p.insertAfter(c),p.show());a(l,n,k,
""===m?!1:!0,m,void 0,function(){c.removeClass("tdb-templates-loading");c.addClass("tdb-templates-open");e(c,p,"tdb-templates-align-right")})}).on("click","#wp-admin-bar-tdc_page_mobile_template > a",function(a){a.preventDefault();var b=jQuery(this);a=b.parent().attr("class").replace("pageid-","");var d=jQuery("#tdb-mobile-templates");d.length?(d.toggle(),b.toggleClass("tdb-templates-open"),b.toggleClass("tdb-templates-close")):(b.addClass("tdb-templates-loading"),b.addClass("tdb-templates-open"),
tdbGetMobileTemplates("page",a,b,void 0,function(){b.removeClass("tdb-templates-loading");jQuery("#tdb-mobile-templates").show();e(b,jQuery("#tdb-mobile-templates"),"tdb-mobile-templates-align-right")}))}).on("click","#wp-admin-bar-tdc_create_mobile_page",function(a){var b=jQuery(this).attr("class").split(" ")[0].replace("pageid-","");tdConfirm.modal({caption:"Create Mobile Page",objectContext:window,callbackYes:function(){var a=jQuery("#tdb-new-template-name"),c=jQuery("#tdb-copy-content");jQuery.ajax({type:"POST",
url:td_ajax_url,data:{action:"tdb_create_mobile_template",template_id:b,template_title:a.val(),template_type:"page",copyContent:c.is(":checked")?"1":"0",_nonce:window.tdb_globals.wpRestNonce},success:function(c,d,e){"undefined"!==typeof jQuery.parseJSON(c).mobile_template_id&&(tdConfirm.close(),c=jQuery("#wp-admin-bar-tdc_page_mobile_template"),c.length&&c.find("a:first").html('<span class="td-mob-page-before">Mobile page</span>'+a.val()),tdbGetMobileTemplates("page",b))},error:function(a,b,c){}})},
htmlInfoContent:'Enter the mobile page name: <input id="tdb-new-template-name" type="text" value="" onfocus="(function(e){ jQuery( e.target ).siblings(\'#tdb-modal-notice\').fadeOut(50); })(event)"/><em id="tdb-modal-notice"></em><div class="tdb-form-check"><input type="checkbox" class="form-check-input" id="tdb-copy-content"><label class="form-check-label" for="tdb-copy-content"><span class="tdb-check"></span><span class="tdb-check-title">Copy content</span></label></div>',textYes:"Create",textNo:"Cancel"})}).on("click",
".tdb-single-template-global label, .tdb-category-template-global label, .tdb-author-template-global label, .tdb-tag-template-global label, .tdb-woo_product-template-global label, .tdb-woo_archive-template-global label, .tdb-cpt-template-global label, .tdb-cpt_tax-template-global label ",function(a){a.preventDefault();a=jQuery(this);var b=a.closest(".tdb-template-el-global"),d=b.data("type"),e=b.data("global-action");b=a.parent().data(d+"-id");var l=a.parent().data("template-id"),k=jQuery(".tdb-templates");
a={action:e,template_id:l,_nonce:window.tdb_globals.wpRestNonce};switch(d){case "single":a.single_id=b;break;case "category":a.category_id=b;break;case "tag":a.tag_id=b;break;case "author":a.author_id=b;break;case "woo_product":a.woo_product_id=b;break;case "woo_archive":a.woo_term_id=b;break;case "cpt":a.cpt_id=b;break;case "cpt_tax":a.cpt_tax_id=b}jQuery.ajax({type:"POST",url:td_ajax_url,data:a,success:function(a,b,c){a=jQuery.parseJSON(a);"undefined"!==typeof a.reload&&window.location.reload();
"undefined"!==typeof a.global_template_id&&(k.find(".tdb-"+d+'-template-global > input[type="checkbox"]').removeAttr("checked"),k.find(".tdb-"+d+'-template-global[data-template-id="'+l+'"] > input[type="checkbox"]').attr("checked",!0))},error:function(a,b,c){}});return!1}).on("click",".tdb-template-el-title",function(a){a.preventDefault();if(a.target===a.currentTarget){a=jQuery(this);var b=a.data("action"),d=a.data("type"),e=a.data(d+"-id"),l=a.data("template-id");b={action:b,template_id:l,_nonce:window.tdb_globals.wpRestNonce};
"cpt"===d?b.cpt=a.data("cpt-id"):"cpt_tax"===d&&(b.cpt_tax=a.data("cpt_tax-id"));switch(d){case "single":b.single_id=e;break;case "category":b.category_id=e;break;case "author":b.author_id=e;break;case "tag":b.tag_id=e;break;case "woo_product":b.woo_product_id=e;break;case "woo_archive":b.woo_term_id=e;break;case "cpt":b.cpt_id=e;break;case "cpt_tax":b.cpt_tax_id=e}jQuery.ajax({type:"POST",url:td_ajax_url,data:b,success:function(a,b,c){"undefined"===typeof jQuery.parseJSON(a).reload&&"cpt"!==d&&"cpt_tax"!==
d||window.location.reload()},error:function(a,b,c){}});return!1}}).on("change",".tdb-template-el-title-input",function(a){a.preventDefault();a=jQuery(this);var b=a.closest(".tdb-templates"),d=a.closest(".tdb-template-el"),e=d.find(".tdb-template-el-title:first");b.data("type");b=d.data("template-id");e.html();jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_change_template_name",template_id:b,template_title:a.val(),_nonce:window.tdb_globals.wpRestNonce},success:function(a,b,c){a=jQuery.parseJSON(a);
"undefined"!==typeof a.template_id&&(e.html(a.template_title),e.removeData("title"))},error:function(a,b,c){}})}).on("click",".tdb-template-el-edit",function(a){a.preventDefault();var b=jQuery(this);a=b.closest(".tdb-templates");var d=b.closest(".tdb-template-el");b=d.find(".tdb-template-el-title:first");a.data("type");d.data("template-id");d=b.html();"undefined"===typeof b.data("title")&&(a.find(".tdb-template-el-title").each(function(a,b){a=jQuery(b);b=a.data("title");"undefined"!==typeof b&&(a.html(b),
a.removeData("title"))}),b.data("title",b.html()),b.html('<input class="tdb-template-el-title-input" type="text" value="'+d+'">'),b.find("input").focus().select())}).on("click",".tdb-template-el-duplicate",function(b){b.preventDefault();b=jQuery(this);var c=b.closest(".tdb-templates"),d=b.closest(".tdb-template-el"),e=d.find(".tdb-template-el-title:first"),l=c.data("type");b=d.data("template-id");var k=e.html(),m=e.data(l+"-id"),n=e.data("action"),p="";0<="single category tag author woo_product woo_archive".split(" ").indexOf(l)&&
(d=d.find(".tdb-template-el-global:first"),d.length&&(p=d.data("global-action")));tdbApi.run({wpNonce:window.tdb_globals.wpRestNonce,cloudEndPoint:"td-cloud-library/new_template",post:{postId:b,templateType:l,templateName:k,duplicateTemplate:!0},done:function(b){c.removeData("tdb-templates");a(l,0<="single category tag author woo_product woo_archive cpt".split(" ").indexOf(l)?m:"",n,""===p?!1:!0,p)},error:function(a){console.log("td-cloud-library/new_template ( duplicate template ) - ERROR",a)}});
jQuery(".tdb-template-el-title-input").trigger("change")}).on("keyup",".tdb-template-el-title-input",function(a){27===a.keyCode&&jQuery(this).trigger("change")}).on("click",".tdb-template-el-delete",function(a){a=jQuery(this);a.closest(".tdb-templates");var b=a.closest(".tdb-template-el");a=b.data("template-id");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_delete_template",template_id:a,_nonce:window.tdb_globals.wpRestNonce},success:function(a,c,e){a=jQuery.parseJSON(a);"undefined"!==
typeof a.reload&&window.location.reload();"undefined"!==typeof a.template_id&&b.remove()},error:function(a,b,c){}});jQuery(".tdb-template-el-title-input").trigger("change")}).on("click",function(a){a=jQuery(a.target);a.closest("#wp-admin-bar-tdb_template_single").length||a.closest("#wp-admin-bar-tdb_template_category").length||a.closest("#wp-admin-bar-tdb_template_404").length||a.closest("#wp-admin-bar-tdb_template_date").length||a.closest("#wp-admin-bar-tdb_template_search").length||a.closest("#wp-admin-bar-tdb_template_attachment").length||
a.closest("#wp-admin-bar-tdb_template_author").length||a.closest("#wp-admin-bar-tdb_template_tag").length||a.closest("#wp-admin-bar-tdb_template_woo_product").length||a.closest("#wp-admin-bar-tdb_template_woo_archive").length||a.closest("#wp-admin-bar-tdb_template_woo_search_archive").length||a.closest("#wp-admin-bar-tdb_template_woo_shop_base").length||a.closest("#wp-admin-bar-tdb_template_cpt").length||a.closest("#wp-admin-bar-tdb_template_cpt_tax").length||a.closest("#wp-admin-bar-tdc_page_mobile_template").length||
(a=jQuery(".tdb-templates"),a.length&&(a.hide(),a.prev("a").removeClass("tdb-templates-open").addClass("tdb-templates-close"),jQuery(".tdb-template-el-title-input").trigger("change")),a=jQuery("#tdb-mobile-templates"),a.length&&(a.hide(),a.prev("a").removeClass("tdb-templates-open").addClass("tdb-templates-close")))}).on("click","#tdb-mobile-templates .tdb-template-el-mobile-list-el",function(a){var b=jQuery(this),d=jQuery("#tdb-mobile-templates");a=b.data("template-id");var e=b.data("mobile-template-id"),
l=d.closest(".tdb-template-el-mobile-btns"),k=b.closest(".tdb-template-el-mobile-wrap"),m=b.closest("#wp-admin-bar-tdc_page_mobile_template");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_set_mobile_template",template_id:a,mobile_template_id:e,_nonce:window.tdb_globals.wpRestNonce},success:function(a,c,h){a=jQuery.parseJSON(a);_.isObject(a)&&!_.isUndefined(a.result)&&1===a.result&&(l.data("mobile-template-id",e),d.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),d.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+
e+'"]').addClass("tdb-current"),k.length&&(a=k.find(".tdb-template-el-mobile:first"),""===e?a.html("-"):a.html('<span class="tdb-template-el-mobile-active">Yes</span>')),m.length&&(m.find("a:first").html('<span class="td-mob-page-before" style="margin-right:10px;">Mobile page</span>'+b.find(".tdb-template-el-mobile-list-title:first").html()),"No mobile page"===b.find(".tdb-template-el-mobile-list-title:first").html()&&m.find("a:first").html('<span class="td-mob-page-before">Mobile page</span>')))}})}).on("click",
"#tdb-mobile-templates .tdb-template-el-mobile-list-edit",function(a){a.stopPropagation()}).on("click","#tdb-mobile-templates .tdb-template-el-mobile-list-delete",function(a){a.stopPropagation();a=jQuery(this);var b=a.data("type"),d=a.closest(".tdb-template-el-mobile-list-el"),e=d.data("template-id");a=d.data("mobile-template-id");var l=d.hasClass("tdb-current"),k=jQuery("#tdb-mobile-templates").closest(".tdb-template-el");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_delete_template",
template_id:a,_nonce:window.tdb_globals.wpRestNonce},success:function(a,c,h){"undefined"!==typeof jQuery.parseJSON(a).template_id&&tdbGetMobileTemplates(b,e,void 0,function(){jQuery("#tdb-mobile-templates").addClass("loading")},function(){jQuery("#tdb-mobile-templates").removeClass("loading");if(l)if("page"===b){var a=jQuery("#wp-admin-bar-tdc_page_mobile_template");a.length&&a.find("a:first").html('<span class="td-mob-page-before">Mobile page</span>No mobile page')}else d.remove(),k.length&&k.find(".tdb-template-el-mobile:first").html("-")})},
error:function(a,b,c){}})}).on("mouseenter",".tdb-template-el-mobile-btns",function(a){a=jQuery(this);var b=a.data("mobile-template-id"),d=a.data("template-id"),e=jQuery("#tdb-mobile-templates");e.find(".tdb-template-el-mobile-list-inner").is(":empty")||(e.appendTo(a).show(),e.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),e.find(".tdb-template-el-mobile-list-el").data("template-id",d),e.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+b+'"]').addClass("tdb-current"))}).on("mouseleave",
".tdb-template-el-mobile-btns",function(a){a=jQuery(".tdb-templates");var b=jQuery("#tdb-mobile-templates");b.hide();b.insertBefore(a);b.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current")});jQuery(".tdb-templates");window.tdbGetMobileTemplates=function(a,c,d,e,l,k,m){var b=jQuery("#tdb-mobile-templates",k);b.length||(b=jQuery('<div id="tdb-mobile-templates" class="tdb-template-el-mobile-list"><div class="tdb-template-el-mobile-list-inner"></div><div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div><a href="https://tagdiv.com/newspaper-10-3-7-update-brings-customizable-and-fast-mobile-pages/" target="_blank" style="height: auto;padding: 0;color: #1a9a75;" class="tdb-template-el-mobile-list-no-el">Documentation &#187;</a></div>'),
b.hide());"undefined"!==typeof d&&b.insertAfter(d);d={action:"tdb_get_"+a+"_mobile_templates",_nonce:window.tdb_globals.wpRestNonce};d[a+"_id"]=c;"undefined"!==typeof e&&e.call();jQuery.ajax({type:"POST",url:td_ajax_url,data:d,success:function(d,e,h){var k="";h=jQuery.parseJSON(d);d='<li id="wp-admin-bar-tdb_template_load" class="pageid-'+c+' tdb-load-mobile-template tdb-template-el-mobile-list-el"><div class="ab-item ab-empty-item" title="Optional - Load mobile page from TagDiv Cloud Library"></div><span class="tdb-template-el-mobile-list-title">Load mobile page from Cloud Library</span></li><li id="wp-admin-bar-tdc_create_mobile_page" class="pageid-'+
c+' tdb-template-el-mobile-list-el"><div class="ab-item ab-empty-item" title="Optional - Create blank mobile page"></div><span class="tdb-template-el-mobile-list-title">Create blank mobile page</span></li>';if(_.isArray(h)&&h.length){var n=!1,p="template";e="";"page"===a&&(p="page",e=d);_.each(h,function(b,d,e){d="";_.isUndefined(b.is_current)||(d="tdb-current",n=!0);k+='<div class="tdb-template-el-mobile-list-el '+d+'" data-mobile-template-id="'+b.template_id+'" data-template-id="'+c+'"><div class="tdb-template-el-mobile-list-title" title="'+
b.template_title+'">'+b.template_title+'</div><a class="tdb-template-el-mobile-list-edit" title="Edit mobile '+p+' with tagDiv Composer" href="'+b.template_url+'" target="_blank"></a><div class="tdb-template-el-mobile-list-delete" title="Delete mobile '+p+'" data-type="'+a+'"></div></div>'});""!==k&&(h="",n||(h="tdb-current",n=!0),k=e+'<div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div><div class="tdb-template-el-mobile-list-el '+
h+'" data-mobile-template-id="" data-template-id="'+c+'"><div class="tdb-template-el-mobile-list-title">No mobile '+p+"</div></div>"+k);""!==k&&(b.html('<div class="tdb-template-el-mobile-list-inner">'+k+'</div><div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div><a href="https://tagdiv.com/newspaper-10-3-7-update-brings-customizable-and-fast-mobile-pages/" target="_blank" style="height: auto;padding: 0;color: #1a9a75;" class="tdb-template-el-mobile-list-no-el">Documentation &#187;</a>'),
e=b.parent(".tdb-template-el-mobile-btns"),!_.isUndefined(m)&&e.length&&(b.find(".tdb-template-el-mobile-list-el").removeClass("tdb-current"),b.find(".tdb-template-el-mobile-list-el").data("template-id",c),b.find('.tdb-template-el-mobile-list-el[data-mobile-template-id="'+m+'"]').addClass("tdb-current")),b.is(":visible")&&e.length?b.show():b.hide())}""===k&&("page"===a?b.html(d+'<div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div><div class="tdb-template-el-mobile-list-inner"><div class="tdb-template-el-mobile-list-no-el">No mobile page, please import or create a new mobile page.</div><div class="tdb-template-el-mobile-list-separator" style="height: 1px;width: 100%;background-color: #ebebeb;margin: 10px 0;"></div><a href="https://tagdiv.com/newspaper-10-3-7-update-brings-customizable-and-fast-mobile-pages/" target="_blank" style="height: auto;padding: 0;color: #1a9a75;" class="tdb-template-el-mobile-list-no-el">Documentation &#187;</a></div>'):
b.html(""));"undefined"!==typeof l&&l.call()}})}})();
jQuery(window).on("load",function(){var a=!1;window.parent===window.top&&"undefined"!==typeof window.name&&"tdc-live-iframe"===window.name&&"undefined"!==typeof window.parent.tdcSidebar&&(a=!0);if(window.self===window.top||a)jQuery(".tdb_single_reading_progress").each(function(){var e=jQuery(this),b=e.data("td-block-uid");e=e.data("bar-position");var c=new tdReadingProgressBar.item;c.blockUid=b;c.barPosition=e;tdReadingProgressBar.addItem(c);a&&tdReadingProgressBar.createFixedBar(c,0,30)}),a||tdReadingProgressBar.calculateBarsFill()});
var tdbMenu={};
(function(){tdbMenu={items:[],item:function(){this.blockUid="";this._outsideClickArea=this._mainMenu=this._itemsWithSubmenu=null;this._outsideClickExcludedAreas="";this._openMenuClass="tdb-hover";this._openMenuBodyClass="tdb-open-menu";this._is_initialized=this.isMegaMenuParentPos=this.isMegaMenuFull=this.inComposer=!1},init:function(){tdbMenu.items=[]},_initialize_item:function(a){if(!0!==a._is_initialized){tdbMenu._setHover(a);var e=0<jQuery("."+a.blockUid).parents(".td-header-template-wrap").length,b=
a.jqueryObj.find(".tdb-menu .tdb-mega-menu .sub-menu"),c=a.jqueryObj.find(".tdb-menu .tdb-mega-menu-page .sub-menu");0<b.length&&(window.tdb_globals.isAjax?e||(a.isMegaMenuFull&&tdbMenu.megaMenuFull(a,a.inComposer),a.isMegaMenuParentPos&&tdbMenu.megaMenuParentPos(a,a.inComposer)):(a.isMegaMenuFull&&tdbMenu.megaMenuFull(a,a.inComposer),a.isMegaMenuParentPos&&tdbMenu.megaMenuParentPos(a,a.inComposer)));0<c.length&&0<jQuery("."+a.blockUid).parents(".tdc-row-is-sticky").length&&(window.tdb_globals.isAjax?
e||tdbMenu.pageMegaMenuHeight(a,a.inComposer):tdbMenu.pageMegaMenuHeight(a,a.inComposer));a._is_initialized=!0}},addItem:function(a){if("undefined"===typeof a.blockUid)throw"item.blockUid is not defined";tdbMenu.items.push(a);tdbMenu._initialize_item(a)},deleteItem:function(a){for(var e=0;e<tdbMenu.items.length;e++)if(tdbMenu.items[e].blockUid===a)return tdbMenu.items.splice(e,1),!0;return!1},megaMenuFull:function(a,e){function b(){k=c.find(".tdb-menu .tdb-mega-menu .sub-menu");k.each(function(){l=
-d.left+"px";jQuery(this).attr("style","left:"+l+"; width: "+jQuery("body").outerWidth()+"px !important")});m||(c.find(".tdb-mega-menu-inactive").removeClass("tdb-mega-menu-inactive"),m=!0)}var c=a.jqueryObj,d,h,l,k,m=!1;jQuery(window).resize(function(){setTimeout(function(){d=c.offset();h=d.left;b();e&&setInterval(function(){d=c.offset();d.left!==h&&(b(),h=d.left)},1E3)},1500)});jQuery(window).resize()},megaMenuParentPos:function(a,e){function b(){l=c.find(".tdb-menu .tdb-mega-menu > ul");l.show();
l.each(function(){jQuery(this).css("left","");k=jQuery(this).offset();m=k.left;0>m?jQuery(this).offset({left:0}):(n=jQuery(window).width()-(m+jQuery(this).outerWidth()),0>n&&jQuery(this).offset({left:jQuery(window).width()-jQuery(this).outerWidth()}))});p||(c.find(".tdb-mega-menu-inactive").removeClass("tdb-mega-menu-inactive"),p=!0);l.hide()}var c=a.jqueryObj,d,h,l,k,m,n,p=!1;setTimeout(function(){jQuery(window).resize(function(){d=c.offset();h=d.left;b();e&&setInterval(function(){d=c.offset();d.left!==
h&&(b(),h=d.left)},1E3)});jQuery(window).resize()},60)},pageMegaMenuHeight:function(a,e){function b(){h.show();h.each(function(){var a=jQuery(this),b=a.find("> li"),e=d.offset().top+d.outerHeight();b=b.outerHeight();var h=c.scrollTop(),p=c.height();e+b>p+h?a.css({height:p+h-e,"overflow-y":"auto"}):a.css({height:"auto","overflow-y":"visible"})});h.hide()}var c=jQuery(window),d=a.jqueryObj,h=d.find(".tdb-menu .tdb-mega-menu-page > ul");setTimeout(function(){c.on("resize scroll",function(){b();e&&setInterval(function(){b()},
1E3)});c.resize().scroll()},1500)},_getSubmenuPosition:function(a){var e=jQuery(window).width();a=a.children(".sub-menu").first();if(0<a.length){var b=a.offset().left+a.width();b>e&&(a.parent().parent().hasClass("tdb-menu")?a.css("left","-"+(b-e)+"px"):a.addClass("reversed").css("left","-"+(a.width()+0)+"px"))}},_getMouseAngleDirection:function(a,e,b,c){return Math.atan2(b-a,c-e)/Math.PI*180},_setHover:function(a){var e=a.jqueryObj.find(".tdb-menu");e.supersubs({minWidth:10,maxWidth:20,extraWidth:1,
applyMin:!0});var b=e.find(".menu-item-has-children > a, .tdb-mega-menu > a");b.parent().find(".sub-menu").first().css("display","none");if(tdDetect.isTouchDevice)jQuery(document).on("touchstart","body",function(c){var d=b.parent(),e=jQuery("body");e.hasClass(a._openMenuBodyClass)&&!d.is(c.target)&&0===d.has(c.target).length&&(d.removeClass(a._openMenuClass),d.children(".sub-menu").hide(),e.removeClass(a._openMenuBodyClass))}),b.on("touchstart",function(c){c.preventDefault();c.stopPropagation();var d=
jQuery(this);c=d.parent();var e=jQuery("body");c.hasClass(a._openMenuClass)?null!==d.attr("href")&&"#"!==d.attr("href")?window.location.href=d.attr("href"):((c.parent().hasClass("tdb-menu")||c.parent().hasClass("top-header-menu"))&&e.removeClass(a._openMenuBodyClass),c.removeClass(a._openMenuClass),c.find(".sub-menu").hide(),c.find("li").removeClass(a._openMenuClass)):(c.parent().hasClass("tdb-menu")||c.parent().hasClass("top-header-menu")?(b.parent().removeClass(a._openMenuClass),b.parent().children(".sub-menu").hide()):
(d=c.siblings(),d.removeClass(a._openMenuClass),d.find(".sub-menu").hide(),d.find("li").removeClass(a._openMenuClass)),c.addClass(a._openMenuClass),c.children(".sub-menu").show(),tdbMenu._getSubmenuPosition(c),e.addClass(a._openMenuBodyClass))});else{var c={},d,h=!0;e.on("mouseleave",function(){b.parent().removeClass(a._openMenuClass);b.parent().children(".sub-menu").hide();c={}});e.find(".menu-item").hover(function(){var e=jQuery(this),k="",m,n;if(e.hasClass("menu-item-has-children")||e.hasClass("tdb-mega-menu"))if(e.parent().hasClass("tdb-menu"))if(jQuery.isEmptyObject(c))e.addClass(a._openMenuClass),
e.children(".sub-menu").show(),c=e;else{if(e[0]!==c[0]){var p=n=m=0;var u=null;!0===h&&(h=!1,d=setTimeout(function(){b.parent().removeClass(a._openMenuClass);b.parent().children(".sub-menu").hide();e.addClass(a._openMenuClass);e.children(".sub-menu").show();c=e},400));e.on("mousemove",function(l){5<=m?(m=0,u=tdbMenu._getMouseAngleDirection(n,p,l.pageX,l.pageY),n=l.pageX,p=l.pageY):(m++,0===n&&0===p&&(n=l.pageX,p=l.pageY));null!==u&&(85<u||-85>u)&&(b.parent().removeClass(a._openMenuClass),b.parent().children(".sub-menu").hide(),
e.addClass(a._openMenuClass),e.children(".sub-menu").show(),e.off("mousemove"),clearTimeout(d),h=!0,c=e)})}}else k=e.siblings(),k.removeClass(a._openMenuClass),k.find(".sub-menu").hide(),k.find("li").removeClass(a._openMenuClass),e.addClass(a._openMenuClass),e.children(".sub-menu").show(),tdbMenu._getSubmenuPosition(e);else e.parent().hasClass("tdb-menu")?jQuery.isEmptyObject(c)||(p=n=m=0,u=null,!0===h&&(h=!1,d=setTimeout(function(){b.parent().removeClass(a._openMenuClass);b.parent().children(".sub-menu").hide();
c={}},400)),e.on("mousemove",function(l){5<=m?(m=0,u=tdbMenu._getMouseAngleDirection(n,p,l.pageX,l.pageY),n=l.pageX,p=l.pageY):(m++,0===n&&0===p&&(n=l.pageX,p=l.pageY));null!==u&&(85<u||-85>u)&&(b.parent().removeClass(a._openMenuClass),b.parent().children(".sub-menu").hide(),e.off("mousemove"),clearTimeout(d),h=!0,c={})})):(c=e.parent(),k=e.siblings(),k.removeClass(a._openMenuClass),k.find(".sub-menu").hide(),k.find("li").removeClass(a._openMenuClass))},function(){var a=jQuery(this);!1===h&&(clearTimeout(d),
h=!0);a.off("mousemove")})}},unsetHover:function(a){null!==a._itemsWithSubmenu&&a._itemsWithSubmenu.off();null!==a._outsideClickArea&&a._outsideClickArea.off()}}})();var tdbMenuItemPullDown={};
(function(){tdbMenuItemPullDown={init:function(){setTimeout(function(){jQuery(".tdb-menu-items-pulldown").each(function(a,e){var b=jQuery(e),c=b.parent().attr("id");e=jQuery("."+c);var d="";"none"!==e.css("max-width")&&(d=e.css("max-width"));if(e.hasClass("tdb-menu-items-in-more")){var h=b.find(".tdb-menu:first"),l=h.parents(".tdb-menu-items-pulldown:first"),k=[];a=new tdPullDown.item;if(void 0!==e.css("display")&&"inline-block"===e.css("display")){var m=e.closest(".vc_column_container");l=m;var n=
"";n=0!==m.find(".tdc-elements").length?".tdc-elements":".wpb_wrapper";m.find(n+" > .td_block_wrap").each(function(){var a=.9*m.outerWidth(!0),b=jQuery(this).outerWidth(!0);if(jQuery(this).data("td-block-uid")!==c)if(b<a)k.push(jQuery(this));else return!1})}a.blockUid=c;a.horizontal_jquery_obj=h;a.vertical_jquery_obj=b.find(".tdb-menu-items-dropdown:first");a.horizontal_element_css_class="tdb-menu-item-button";a.horizontal_no_items_css_class="tdb-menu-items-empty";a.container_jquery_obj=l;a.horizontal_max_width=
d;a.excluded_jquery_elements=k;a.isTdbMenu=!0;b=e.find(".tdb-main-sub-icon-fake");b.length&&(a.main_sub_icon=b.html());e=e.find(".tdb-sub-icon-fake");e.length&&(a.sub_icon=e.html());tdPullDown.add_item(a)}h.parents(".tdb-menu-items-pulldown:first").hasClass("tdb-menu-items-pulldown-inactive")&&h.parents(".tdb-menu-items-pulldown:first").removeClass("tdb-menu-items-pulldown-inactive")})},50)}}})();jQuery().ready(function(){});jQuery(window).on("load",function(){tdbMenuItemPullDown.init()});
var tdbSearch={};
(function(){tdbSearch={items:[],init:function(){tdbSearch.items=[]},item:function(){this.jqueryObj=this.blockAtts=this.blockUid=void 0;this._is_search_open=!1;this._is_live_search_active=!0;this._last_request_results_count=this._current_selection_index=0;this._first_down_up=!0;this._resultsLimit=void 0;this._openSearchFormClass="";this._is_initialized=this.disable_trigger=this.isSearchFormFull=this.inComposer=!1},_initialize_item:function(a){if(!0!==a._is_initialized){jQuery(document).on("click",function(b){!0===
a._is_search_open&&(a.jqueryObj.find("*").find(b.target).length||tdbSearch.hide_search_box(a))});if(!a.disable_trigger)a.jqueryObj.find(".tdb-head-search-btn").on("click",function(b){b.preventDefault();b.stopPropagation();!0===a._is_search_open?tdbSearch.hide_search_box(a):tdbSearch.show_search_box(a)});a._is_live_search_active&&!a.inComposer&&a.jqueryObj.find(".tdb-head-search-form-input").keydown(function(b){if(b.which&&39===b.which||b.keyCode&&39===b.keyCode||b.which&&37===b.which||b.keyCode&&
37===b.keyCode)tdbSearch.set_input_focus(a);else{if(b.which&&13===b.which||b.keyCode&&13===b.keyCode)return b=a.jqueryObj.find(".tdb-aj-cur-element"),0<b.length?window.location=b.find(".entry-title a").attr("href"):jQuery(this).parent().parent().submit(),!1;if(b.which&&40===b.which||b.keyCode&&40===b.keyCode)return tdbSearch.move_prompt_down(a),!1;if(b.which&&38===b.which||b.keyCode&&38===b.keyCode)return tdbSearch.move_prompt_up(a),!1;(b.which&&8===b.which||b.keyCode&&8===b.keyCode)&&1===jQuery(this).val().length&&
a.jqueryObj.find(".tdb-aj-search").empty();tdbSearch.set_input_focus(a);setTimeout(function(){tdbSearch.do_ajax_call(a)},100);return!0}});if(!a.disable_trigger){var e=0<jQuery("."+a.blockUid).parents(".td-header-template-wrap").length;window.tdb_globals.isAjax?e||(a.isSearchFormFull?tdbSearch.searchFormWidth(a,!0,a.inComposer):tdbSearch.searchFormWidth(a,!1,a.inComposer)):a.isSearchFormFull?tdbSearch.searchFormWidth(a,!0,a.inComposer):tdbSearch.searchFormWidth(a,!1,a.inComposer)}a._is_initialized=
!0}},addItem:function(a){if("undefined"===typeof a.blockUid)throw"item.blockUid is not defined";tdbSearch.items.push(a);tdbSearch._initialize_item(a)},deleteItem:function(a){for(var e=0;e<tdbSearch.items.length;e++)if(tdbSearch.items[e].blockUid===a)return tdbSearch.items.splice(e,1),!0;return!1},searchFormWidth:function(a,e,b){function c(){k=-h.left+"px";m.attr("style",m.attr("style")+";left:"+k)}var d=a.jqueryObj,h,l,k,m=d.find(".tdb-drop-down-search");jQuery(window).resize(function(){var a=d.offset().left;
e?(m.attr("style","width: "+jQuery("body").outerWidth()+"px !important; left: -"+a+"px;"),setTimeout(function(){h=d.offset();l=h.left;c();b&&setInterval(function(){h=d.offset();h.left!==l&&(c(),l=h.left)},1E3)},500)):m.attr("style","width: "+jQuery("body").outerWidth()+"px !important;")});a.inComposer&&jQuery(window).resize()},show_search_box:function(a){a.jqueryObj.find(".tdb-drop-down-search").addClass(a._openSearchFormClass);!0!==tdDetect.isIos&&setTimeout(function(){document.querySelector("."+
a.blockUid+" .tdb-head-search-form-input").focus()},200);a._is_search_open=!0},hide_search_box:function(a){a.jqueryObj.find(".tdb-drop-down-search").removeClass(a._openSearchFormClass);a._is_search_open=!1},move_prompt_up:function(a){!0===a._first_down_up?(a._first_down_up=!1,0===a._current_selection_index?a._current_selection_index=a._last_request_results_count-1:a._current_selection_index--):0===a._current_selection_index?a._current_selection_index=a._last_request_results_count:a._current_selection_index--;
tdbSearch._repaintCurrentElement(a)},move_prompt_down:function(a){!0===a._first_down_up?a._first_down_up=!1:a._current_selection_index===a._last_request_results_count?a._current_selection_index=0:a._current_selection_index++;tdbSearch._repaintCurrentElement(a)},set_input_focus:function(a){a._current_selection_index=0;a._first_down_up=!0;a.jqueryObj.find(".tdb-search-form").fadeTo(100,1);a.jqueryObj.find(".td_module_wrap").removeClass("tdb-aj-cur-element")},remove_input_focus:function(a){0!==a._last_request_results_count&&
a.jqueryObj.find(".tdb-head-search-form-input").addClass("tdb-head-search-nofocus")},_repaintCurrentElement:function(a){a.jqueryObj.find(".td_module_wrap").removeClass("tdb-aj-cur-element");a._current_selection_index>a._last_request_results_count-1?(a.jqueryObj.find(".tdb-search-form").fadeTo(100,1),a.jqueryObj.find(".tdb-head-search-form-input").removeClass("tdb-head-search-nofocus")):(tdbSearch.remove_input_focus(a),a.jqueryObj.find(".td_module_wrap").eq(a._current_selection_index).addClass("tdb-aj-cur-element"))},
do_ajax_call:function(a){var e=a.jqueryObj.find(".tdb-head-search-form-input").val();""===e?tdbSearch.set_input_focus(a):tdLocalCache.exist("tdb-"+e)?tdbSearch.process_ajax_response(tdLocalCache.get("tdb-"+e),a):jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"td_ajax_search",module:"tdb_module_search",atts:a.blockAtts,td_string:e,limit:a._resultsLimit},success:function(b,c,d){tdLocalCache.set("tdb-"+e,b);tdbSearch.process_ajax_response(b,a)},error:function(a,c,d){window.console.log(d)}})},
process_ajax_response:function(a,e){var b=e.jqueryObj.find(".tdb-head-search-form-input").val(),c=e.jqueryObj.find(".tdb-aj-search");""===b?c.empty():(a=jQuery.parseJSON(a),a.td_search_query===b&&(e._current_selection_index=0,e._last_request_results_count=a.td_total_in_list,e._first_down_up=!0,c.html(a.td_data),"undefined"!==typeof window.tdAnimationStack&&!0===window.tdAnimationStack.activated&&(window.tdAnimationStack.check_for_new_items(".tdb-aj-search .td-animation-stack",window.tdAnimationStack.SORTED_METHOD.sort_left_to_right,
!0,!1),window.tdAnimationStack.compute_items(!1))))},hideAllItems:function(){tdbSearch.items.forEach(function(a){tdbSearch.hide_search_box(a)})}}})();jQuery().ready(function(){tdbSearch.init();setTimeout(function(){jQuery(window).resize()},500)});var tdbLocationFinder={};jQuery().ready(function(){tdbLocationFinder.init()});
(function(){tdbLocationFinder={items:[],item:function(){this.blockObj=this.uid="";this.mapMarker=this.map=void 0;this.defLong=this.defLat=0;this.defZoom=3;this.defAddress="";this.errorContainer=void 0;this._is_initialized=this._in_composer=!1},init:function(){tdbLocationFinder.items=[];this._is_running=!1},_initialize_item:function(a){!0!==a._is_initialized&&(a.errorContainer=a.blockObj.find(".tdb-s-notif"),tdbLocationFinder.initMap(a),a._in_composer||(""!==a.defAddress&&tdbLocationFinder.displayLocationByAddress(a,
a.defAddress),tdbLocationFinder.locationSearch(a),tdbLocationFinder.currentLocation(a)),a._is_initialized=!0)},addItem:function(a){if("undefined"===typeof a.uid)throw"item.uid is not defined";tdbLocationFinder.items.push(a);tdbLocationFinder._initialize_item(a)},locationSearch:function(a){var e=document.querySelector("#tdb-lf-search-"+a.uid),b=new google.maps.places.Autocomplete(e,{types:["address"],fields:["address_components","geometry"]});b.addListener("place_changed",function(){var c=b.getPlace();
e.classList.add("loading");e.disabled=!0;tdbLocationFinder.updateError(a,"",!1);if(c.geometry){var d=c.address_components,h="",l="",k="",m="",n="",p="",u=c.geometry.location;for(c=0;c<d.length;c++)for(var w=0;w<d[c].types.length;w++)"route"===d[c].types[w]&&(h=d[c].long_name),"street_number"===d[c].types[w]&&(l=d[c].long_name),"postal_code"===d[c].types[w]&&(k=d[c].long_name),"locality"===d[c].types[w]&&(m=d[c].long_name),"administrative_area_level_1"===d[c].types[w]&&(n=d[c].long_name),"country"===
d[c].types[w]&&(p=d[c].long_name);""===n&&(n=m);setTimeout(function(){tdbLocationFinder.updateLocationInputs(a,h,l,k,m,n,p);tdbLocationFinder.updateMap(a,u.lat(),u.lng(),15);e.classList.remove("loading");e.disabled=!1},400)}else setTimeout(function(){e.value="";tdbLocationFinder.updateLocationInputs(a,"","","");tdbLocationFinder.updateMap(a,0,0,3);e.classList.remove("loading");e.disabled=!1},400)})},displayLocationByAddress:function(a,e){var b={lat:0,lng:0};(new google.maps.Geocoder).geocode({address:e},
function(c,d){if("OK"===d)return c=c[0].geometry.location,tdbLocationFinder.updateMap(a,c.lat(),c.lng(),15),b});return b},currentLocation:function(a){var e=a.blockObj.find(".tdb-lf-curr-loc"),b=a.blockObj.find("#tdb-lf-search-"+a.uid);e.on("click",function(){b.addClass("loading").prop("disabled",!0);tdbLocationFinder.updateError(a,"",!1);navigator.geolocation.getCurrentPosition(function(c){c=new google.maps.LatLng(c.coords.latitude,c.coords.longitude);(new google.maps.Geocoder).geocode({location:c},
function(c,e){if("OK"===e){e=c[0].address_components;var d="",h="",m="",n="",p="",u="",w=c[0].geometry.location;for(c=0;c<e.length;c++)for(var v=0;v<e[c].types.length;v++)"route"===e[c].types[v]&&(d=e[c].long_name),"street_number"===e[c].types[v]&&(h=e[c].long_name),"postal_code"===e[c].types[v]&&(m=e[c].long_name),"locality"===e[c].types[v]&&(n=e[c].long_name),"administrative_area_level_1"===e[c].types[v]&&(p=e[c].long_name),"country"===e[c].types[v]&&(u=e[c].long_name);""===p&&(p=n);setTimeout(function(){b.val(d+
(""!==h?" "+h:"")+", "+n+", "+u);tdbLocationFinder.updateLocationInputs(a,d,h,m,n,p,u);tdbLocationFinder.updateMap(a,w.lat(),w.lng(),15);b.removeClass("loading").prop("disabled",!1)},400)}else b.removeClass("loading").prop("disabled",!1)})},function(){tdbLocationFinder.updateError(a,"Unable to retrieve your current location. Please activate the location setting, then refresh the page.",!0);b.removeClass("loading").prop("disabled",!1)})})},initMap:function(a){var e=document.querySelector("."+a.uid+
" .tdb-lf-map"),b={lat:a.defLat,lng:a.defLong};a.map=new google.maps.Map(e,{center:b,zoom:a.defZoom});a.mapMarker=new google.maps.Marker({position:b,map:a.map})},updateMap:function(a,e,b,c){e=new google.maps.LatLng(e,b);a.map.setCenter(e);a.map.setZoom(c);a.mapMarker.setPosition(e)},updateLocationInputs:function(a,e,b,c,d,h,l){var k=jQuery("#tdb-lf-address-"+a.uid),m=jQuery("#tdb-lf-postal-code-"+a.uid),n=jQuery("#tdb-lf-city-"+a.uid),p=jQuery("#tdb-lf-state-"+a.uid);a=jQuery("#tdb-lf-country-"+a.uid);
k.val(e+" "+b);m.val(c);n.val(d);p.val(h);a.val(l)},updateError:function(a,e,b){b=void 0===b?!0:b;a=a.errorContainer;a.find(".tdb-s-notif-descr").html(e);b?a.show():a.hide()},deleteItem:function(a){for(var e=0;e<tdbLocationFinder.items.length;e++)if(tdbLocationFinder.items[e].uid===a)return tdbLocationFinder.items.splice(e,1),!0;return!1},resetItems:function(){tdbLocationFinder.items=[]}}})();var tdbLocationDisplay={};jQuery().ready(function(){tdbLocationDisplay.init()});
(function(){tdbLocationDisplay={items:[],item:function(){this.blockObj=this.uid="";this.mapMarker=this.map=void 0;this.address="";this._is_initialized=!1},init:function(){tdbLocationDisplay.items=[];this._is_running=!1},_initialize_item:function(a){!0!==a._is_initialized&&((new google.maps.Geocoder).geocode({address:a.address},function(e,b){"OK"===b?(e=e[0].geometry.location,tdbLocationDisplay.initMap(a,e.lat(),e.lng(),15)):tdbLocationDisplay.initMap(a,0,0,3)}),a._is_initialized=!0)},addItem:function(a){if("undefined"===
typeof a.uid)throw"item.uid is not defined";tdbLocationDisplay.items.push(a);tdbLocationDisplay._initialize_item(a)},initMap:function(a,e,b,c){var d=document.querySelector("."+a.uid+" .tdb-sld-map");e={lat:e,lng:b};a.map=new google.maps.Map(d,{center:e,zoom:c});a.mapMarker=new google.maps.Marker({position:e,map:a.map})},deleteItem:function(a){for(var e=0;e<tdbLocationDisplay.items.length;e++)if(tdbLocationDisplay.items[e].uid===a)return tdbLocationDisplay.items.splice(e,1),!0;return!1},resetItems:function(){tdbLocationDisplay.items=
[]}}})();var tdbFormTaxonomies={};jQuery().ready(function(){tdbFormTaxonomies.init()});
(function(){tdbFormTaxonomies={items:[],item:function(){this.termName=this.termType=this.showAllTerms=this.blockObj=this.uid="";this.subChildDisplay=this.childDisplay=this.parentDisplay="dropdown";this.subChildLimit=this.childLimit=this.parentLimit=-1;this._is_initialized=this._in_composer=this.disabledForGuests=!1},init:function(){tdbFormTaxonomies.items=[];this._is_running=!1},_initialize_item:function(a){if(!0!==a._is_initialized){jQuery(document).on("select2:open",function(){document.querySelector(".select2-search__field").focus()});
a.disabledForGuests||jQuery("."+a.uid+" .tdb-s-form-group select").select2({dropdownCssClass:"tdb-s-select2 tdb-s-select2-"+a.uid,templateSelection:function(a){return jQuery(a.element).text().replace(/ *\([^)]*\) */g,"")}});if(!a.showAllTerms)a.blockObj.on("change","select.tdb-s-form-input",function(e){e=jQuery(e.target);var b=e.closest(".tdb-s-form-group").data("term-hierarchy"),c=e.val(),d=e.find("option:selected").text().replace(/ *\([^)]*\) */g,""),h="",l="",k=e.attr("data-old-term-id");e.attr("data-old-term-id",
c);"parent"===b?h="child":"child"===b&&(h="sub-child");"child"===h?l=a.childDisplay:"sub-child"===h&&(l=a.subChildDisplay);tdbFormTaxonomies.removeChildTerms(a,k,b);"dropdown"===l?tdbFormTaxonomies.buildNewTermDropdown(a,c,d,b,h):"checkbox"===l&&tdbFormTaxonomies.buildNewTermCheckboxes(a,c,d,b,h)});a.blockObj.on("click",".tdb-s-fc-label",function(e){console.log("hi");e.preventDefault();var b=jQuery(e.target);e=b.find('input[type="checkbox"]');var c=b.closest(".tdb-s-form-group").data("term-hierarchy"),
d=e.val();b=b.find(".tdb-s-fc-title").text();var h="",l="",k=a.blockObj.find(".tdb-s-form");e.prop("disabled")||("parent"===c?h="child":"child"===c?h="sub-child":"sub-child"===c&&(h="last-level"),"child"===h?l=a.childDisplay:"sub-child"===h&&(l=a.subChildDisplay),e.prop("checked")?(e.prop("checked",!1),a.showAllTerms?tdbFormTaxonomies.manageLimits(a):tdbFormTaxonomies.removeChildTerms(a,d,c)):(e.prop("checked",!0),a.showAllTerms?tdbFormTaxonomies.manageLimits(a):"last-level"===h?(k.addClass("tdb-s-content-loading"),
setTimeout(function(){tdbFormTaxonomies.manageLimits(a);k.removeClass("tdb-s-content-loading")},400)):"dropdown"===l?tdbFormTaxonomies.buildNewTermDropdown(a,d,b,c,h):"checkbox"===l&&tdbFormTaxonomies.buildNewTermCheckboxes(a,d,b,c,h)))});a.blockObj.on("keyup",".tdb-ft-checkbox-search",function(){var a=jQuery(this),b=new RegExp(a.val(),"i");a.closest(".tdb-s-form-group").find(".tdb-s-fc-label").each(function(){var a=jQuery(this),d=a.closest(".tdb-s-form-check");b.test(a.text())?d.show():d.hide()})});
a._is_initialized=!0}},addItem:function(a){if("undefined"===typeof a.uid)throw"item.uid is not defined";tdbFormTaxonomies.items.push(a);tdbFormTaxonomies._initialize_item(a)},buildNewTermDropdown:function(a,e,b,c,d){var h=a.blockObj.find(".tdb-s-content"),l=h.find(".tdb-s-fc-inner");h.addClass("tdb-s-content-loading");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_get_child_terms",termID:e,termType:a.termType},success:function(c){c=jQuery.parseJSON(c);var k="";c.length&&(k='<div class="tdb-s-form-group tdb-s-content" data-term-hierarchy="'+
d+'" data-parent-id="'+e+'" data-display="dropdown">',k+='<label class="tdb-s-form-label">'+(b.charAt(0).toUpperCase()+b.slice(1))+"</label>",k+='<div class="tdb-s-form-select-wrap">',k+='<select class="tdb-s-form-input" name="tdb-posts-form-taxonomies-'+a.uid+'[]">',k+='<option value="">-- Select '+d+" "+(a.termName.charAt(0).toLowerCase()+a.termName.slice(1))+" --</option>",jQuery.each(c,function(a,b){k+='<option value="'+b.term_id+'">'+b.name+"</option>"}),k+="</select>",k+='<svg class="tdb-s-form-select-icon" xmlns="http://www.w3.org/2000/svg" width="8.947" height="12.578" viewBox="0 0 8.947 12.578"><g transform="translate(7.947 1) rotate(90)"><path d="M0,7.947A1,1,0,0,1-.58,7.761,1,1,0,0,1-.815,6.366l2.06-2.893L-.815.58A1,1,0,0,1-.58-.815,1,1,0,0,1,.815-.58L3.288,2.893a1,1,0,0,1,0,1.16L.815,7.527A1,1,0,0,1,0,7.947Z" transform="translate(8.104 0)"/><path d="M2.474,7.947a1,1,0,0,1-.815-.42L-.815,4.053a1,1,0,0,1,0-1.16L1.659-.58A1,1,0,0,1,3.053-.815,1,1,0,0,1,3.288.58L1.228,3.473l2.06,2.893a1,1,0,0,1-.814,1.58Z" transform="translate(0 0)"/></g></svg>',
k+="</div>",k+="</div>");setTimeout(function(){""!==k&&(l.append(k),a.blockObj.find('.tdb-s-form-group[data-parent-id="'+e+'"] select').select2({dropdownCssClass:"tdb-s-select2 tdb-s-select2-"+a.uid}));tdbFormTaxonomies.manageLimits(a);h.removeClass("tdb-s-content-loading")},200)}})},buildNewTermCheckboxes:function(a,e,b,c,d){var h=a.blockObj.find(".tdb-s-content"),l=h.find(".tdb-s-fc-inner");h.addClass("tdb-s-content-loading");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_get_child_terms",
termID:e,termType:a.termType},success:function(c){c=jQuery.parseJSON(c);var k="";c.length&&(k='<div class="tdb-s-form-group tdb-s-content" data-term-hierarchy="'+d+'" data-parent-id="'+e+'" data-display="checkbox">',k+='<label class="tdb-s-form-label">',k+=b.charAt(0).toUpperCase()+b.slice(1)+"",k+='<input class="tdb-s-form-input tdb-ft-checkbox-search" type="text" placeholder="Search by keyword...">',k+="</label>",k+='<div class="tdb-s-form-checkboxes-wrap">',jQuery.each(c,function(b,c){k+='<div class="tdb-s-form-check">';
k+='<label class="tdb-s-fc-label">';k+='<input type="checkbox" name="tdb-posts-form-taxonomies-'+a.uid+'[]" value="'+c.term_id+'">';k+='<span class="tdb-s-fc-check"></span>';k+='<span class="tdb-s-fc-title">'+c.name+"</span>";k+="</label>";k+="</div>"}),k+="</div>",k+="</div>");setTimeout(function(){""!==k&&l.append(k);tdbFormTaxonomies.manageLimits(a);h.removeClass("tdb-s-content-loading")},200)}})},removeChildTerms:function(a,e,b){var c=a.blockObj.find(".tdb-s-content"),d=c.find('.tdb-s-form-group[data-parent-id="'+
e+'"]');c.addClass("tdb-s-content-loading");setTimeout(function(){if(d.length&&(d.remove(),"parent"===b)){var e=void 0,l=d.find("input:checked");l.length&&l.each(function(){e=c.find('.tdb-s-form-group[data-parent-id="'+jQuery(this).val()+'"]')});l=d.find("select");l.length&&(e=c.find('.tdb-s-form-group[data-parent-id="'+l.val()+'"]'));"undefined"!==typeof e&&e.length&&e.remove()}tdbFormTaxonomies.manageLimits(a);c.removeClass("tdb-s-content-loading")},400)},manageLimits:function(a){var e=a.blockObj.find(".tdb-ft-limit-warning"),
b=e.find(".tdb-ft-limit-parent-notif"),c=e.find(".tdb-ft-limit-child-notif"),d=e.find(".tdb-ft-limit-sub-child-notif"),h=a.blockObj.find('.tdb-s-form-group[data-term-hierarchy="parent"]'),l=a.blockObj.find('.tdb-s-form-group[data-term-hierarchy="child"]'),k=a.blockObj.find('.tdb-s-form-group[data-term-hierarchy="sub-child"]'),m=h.find("input:checked").length,n=l.find("input:checked").length,p=k.find("input:checked").length;m=-1<a.parentLimit&&m>=a.parentLimit;n=-1<a.childLimit&&n>=a.childLimit;a=
-1<a.subChildLimit&&p>=a.subChildLimit;m&&b.length||n&&c.length||a&&d.length?e.show():e.hide();m?(h.find('input[type="checkbox"]:not(:checked)').prop("disabled",!0),b.show()):(h.find('input[type="checkbox"]:not(:checked)').prop("disabled",!1),b.hide());n?(l.find('input[type="checkbox"]:not(:checked)').prop("disabled",!0),c.show()):(l.find('input[type="checkbox"]:not(:checked)').prop("disabled",!1),c.hide());a?(k.find('input[type="checkbox"]:not(:checked)').prop("disabled",!0),d.show()):(k.find('input[type="checkbox"]:not(:checked)').prop("disabled",
!1),d.hide())},deleteItem:function(a){for(var e=0;e<tdbFormTaxonomies.items.length;e++)if(tdbFormTaxonomies.items[e].uid===a)return tdbFormTaxonomies.items.splice(e,1),!0;return!1},resetItems:function(){tdbFormTaxonomies.items=[]}}})();var tdbFormFileUpload={};jQuery().ready(function(){tdbFormFileUpload.init()});
(function(){tdbFormFileUpload={items:[],item:function(){this.blockObj=this.uid="";this.fileType="image";this.fileExtensions=["jpg","jpeg","png","gif","ico"];this.maxUploadSize=0;this._is_initialized=this._in_composer=!1},init:function(){tdbFormFileUpload.items=[];this._is_running=!1},_initialize_item:function(a){if(!0!==a._is_initialized){var e=a.blockObj.find(".tdb-s-form-file");e.bind("dragover",function(){jQuery(this).addClass("tdb-s-form-file-dragover")});e.bind("dragleave drop",function(){jQuery(this).removeClass("tdb-s-form-file-dragover")});
a.blockObj.find(".tdb-s-form-file input").on("change",function(b){var c=jQuery(this);b=b.currentTarget.files[0];tdbFormFileUpload.manageNotif(a,!1);-1===jQuery.inArray(c.val().split(".").pop().toLowerCase(),a.fileExtensions)?(tdbFormFileUpload.manageNotif(a,!0,"Sorry, you are not allowed to upload this "+a.fileType+" file type."),c.val("")):b.size>a.maxUploadSize?(tdbFormFileUpload.manageNotif(a,!0,"Sorry, the "+a.fileType+" exceeds the maximum upload file size limit."),c.val("")):tdbFormFileUpload.addPreview(a,
b)});a.blockObj.on("click",".tdb-s-ffp-remove",function(b){b.preventDefault();tdbFormFileUpload.removePreview(a)});a._is_initialized=!0}},addItem:function(a){if("undefined"===typeof a.uid)throw"item.uid is not defined";tdbFormFileUpload.items.push(a);tdbFormFileUpload._initialize_item(a)},manageNotif:function(a,e,b){b=void 0===b?"":b;a=a.blockObj.find(".tdb-s-notif");e?a.show().text(b):a.hide().text(b)},addPreview:function(a,e){a.blockObj.find(".tdb-s-form");var b=a.blockObj.find(".tdb-s-form-file");
b.addClass("tdb-s-content-loading");setTimeout(function(){switch(a.fileType){case "image":var c=new FileReader;c.onload=function(){b.prepend('<div class="tdb-s-form-file-preview tdb-s-form-file-preview-image"><div class="tdb-s-ffip-img" style="background-image:url('+c.result+')"></div><button class="tdb-s-btn tdb-s-btn-sm tdb-s-btn-red tdb-s-ffp-remove" title="Remove image file"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash-2"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg></button></div>')};
c.readAsDataURL(e);break;case "document":b.prepend('<div class="tdb-s-form-file-box tdb-s-form-file-preview tdb-s-form-file-preview-document"><svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-file-text tdb-s-ffu-ico"><path d="M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"></path><polyline points="14 2 14 8 20 8"></polyline><line x1="16" y1="13" x2="8" y2="13"></line><line x1="16" y1="17" x2="8" y2="17"></line><polyline points="10 9 9 9 8 9"></polyline></svg><div class="tdb-s-ffu-txt">'+
e.name+'</div><button class="tdb-s-btn tdb-s-btn-sm tdb-s-btn-red tdb-s-ffp-remove" title="Remove file"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash-2"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg></button></div>');
break;case "audio":var d=new FileReader;d.onload=function(){b.prepend('<div class="tdb-s-form-file-preview tdb-s-form-file-preview-audio"><audio controls class="tdb-s-ffu-audio"><source src="'+d.result+'" type="'+e.type+'"></audio><button class="tdb-s-btn tdb-s-btn-sm tdb-s-btn-red tdb-s-ffp-remove" title="Remove audio file"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash-2"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg></button></div>')};
d.readAsDataURL(e);break;case "video":var h=new FileReader;h.onload=function(){b.prepend('<div class="tdb-s-form-file-preview tdb-s-form-file-preview-video"><video class="tdb-s-ffip-video" controls><source src="'+h.result+'" type="'+e.type+'"></video><button class="tdb-s-btn tdb-s-btn-sm tdb-s-btn-red tdb-s-ffp-remove" title="Remove video file"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-trash-2"><polyline points="3 6 5 6 21 6"></polyline><path d="M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"></path><line x1="10" y1="11" x2="10" y2="17"></line><line x1="14" y1="11" x2="14" y2="17"></line></svg></button></div>')};
h.readAsDataURL(e)}b.addClass("tdb-s-form-file-previewing");b.removeClass("tdb-s-content-loading")},600)},removePreview:function(a){var e=a.blockObj.find(".tdb-s-form-file"),b=e.find(".tdb-s-form-file-input");e.addClass("tdb-s-content-loading");setTimeout(function(){a.blockObj.attr("data-no-save","false");e.find(".tdb-s-form-file-preview").remove();b.val("");e.removeClass("tdb-s-form-file-previewing");e.removeClass("tdb-s-content-loading")},400)},deleteItem:function(a){for(var e=0;e<tdbFormFileUpload.items.length;e++)if(tdbFormFileUpload.items[e].uid===
a)return tdbFormFileUpload.items.splice(e,1),!0;return!1},resetItems:function(){tdbFormFileUpload.items=[]}}})();var tdbFilters={};
(function(){tdbFilters={items:[],init:function(){tdbFilters.items=[]},item:function(){this.jqueryObj=this.blockAtts=this.blockUid=void 0;this._is_initialized=this.enabled_on_mobiles=this.inComposer=!1},_initialize_item:function(a){if(!0!==a._is_initialized){if(!0===a.enabled_on_mobiles){a.jqueryObj.closest(".vc_column_container").addClass("tdb-filters-mobile");jQuery("body").addClass("tdb-filters");var e=jQuery(".tdb-filters-button-mobile"),b=e.get(0);b=jQuery._data(b,"events");if(void 0===b||void 0===
b.click)e.on("click",function(){jQuery("body").toggleClass("tdb-filters-open")})}else a.jqueryObj.closest(".vc_column_container").removeClass("tdb-filters-mobile"),jQuery("body").removeClass("tdb-filters");!0!==a.inComposer&&(window.onpopstate=function(a){null!==a.state&&window.location.reload()},a.jqueryObj.on("click",".tdb-filters-clear-all",function(a){a.preventDefault();a.stopPropagation();a=new URLSearchParams(window.location.search);var b=window.location.href;a.forEach(function(a,c){-1!==c.indexOf("tdb_")&&
(b=tdbFilters.removeQueryParam(b,c))});window.history.pushState({},"",b);window.location.reload()}),a.jqueryObj.on("click",".tdb-filter-item",function(a){var b=jQuery(this),c=b.parents("ul").data("taxonomy"),e=b.data("term-slug");b.data("term-name");b.hasClass("selected")||b.hasClass("tdb-filter-link")?b.hasClass("selected")&&b.hasClass("tdb-filter-link")&&a.preventDefault():-1!==c.indexOf("tdb_")?(a=tdbFilters.removeQueryParam(window.location.href,"tdb-loop-page"),window.location.href=tdbFilters.updateQuery(a,
c,e)):console.log("invalid filter: "+c)}),a.jqueryObj.on("change",".tdb-filter-item-dropdown",function(a){var b=jQuery(this);a=b.hasClass("multiple");var c=b.data("taxonomy"),e=jQuery("option:selected",this),k=jQuery("option:selected:last",this);k=a?k.data("term-slug"):e.data("term-slug");b.val();e.data("filter-link");-1!==c.indexOf("tdb_")?(b=tdbFilters.removeQueryParam(window.location.href,"tdb-loop-page"),a||(b=tdbFilters.removeQueryParam(b,c)),window.location.href=k?tdbFilters.updateQuery(b,c,
k):b):console.log("invalid filter: "+c)}),jQuery(document).on("tdb_filters_remove_filter",function(b,d){b=d.term;a.jqueryObj.find('[data-taxonomy="'+d.tax+'"]').find("li[data-term-slug="+b+"]").removeClass("selected")}),a._is_initialized=!0)}},addItem:function(a){if("undefined"===typeof a.blockUid)throw"item.blockUid is not defined";tdbFilters.items.push(a);tdbFilters._initialize_item(a)},deleteItem:function(a){for(var e=0;e<tdbFilters.items.length;e++)if(tdbFilters.items[e].blockUid===a)return tdbFilters.items.splice(e,
1),!0;return!1},updateQuery:function(a,e,b){var c=new RegExp("([?&])"+e+"=.*?(&|$)","i"),d=-1!==a.indexOf("?")?"&":"?";return a.match(c)?(d=new URLSearchParams(window.location.search),a.replace(c,"$1"+e+"="+d.get(e)+","+b+"$2")):""===b?a:a+d+e+"="+b},removeQueryParam:function(a,e){return a.replace(new RegExp("([?&])"+e+"=.*?(&|$)","i"),"$1").replace(/[&|?]\s*$/,"")}}})();jQuery().ready(function(){tdbFilters.init()});var tdbFiltersLoop={};
(function(){tdbFiltersLoop={items:[],init:function(){tdbFiltersLoop.items=[]},item:function(){this.jqueryObj=this.blockAtts=this.blockUid=void 0;this._is_initialized=this.inComposer=!1},_initialize_item:function(a){!0!==a._is_initialized&&(a._is_initialized=!0)},addItem:function(a){if("undefined"===typeof a.blockUid)throw"item.blockUid is not defined";tdbFiltersLoop.items.push(a);tdbFiltersLoop._initialize_item(a)},deleteItem:function(a){for(var e=0;e<tdbFiltersLoop.items.length;e++)if(tdbFiltersLoop.items[e].blockUid===
a)return tdbFiltersLoop.items.splice(e,1),!0;return!1}}})();jQuery().ready(function(){tdbFiltersLoop.init()});var tdbFiltersList={};
(function(){tdbFiltersList={items:[],init:function(){tdbFiltersList.items=[]},item:function(){this.jqueryObj=this.blockUid=void 0;this.sampleData=!1;this.closeIcon="";this._is_initialized=this.inComposer=!1},_initialize_item:function(a){!0!==a._is_initialized&&!0!==a.inComposer&&!0!==a.sampleData&&(a.jqueryObj.on("click",".remove",function(a){a.preventDefault();a.stopPropagation();a=jQuery(this).parent().data("tax");var b=jQuery(this).parent().data("term-slug").toString();jQuery(this).parents("li").hide();
jQuery(document).trigger("tdb_filters_remove_filter",{tax:a,term:b});var c=tdbFiltersList.removeQueryParam(window.location.href,"tdb-loop-page");window.location.href=tdbFiltersList.updateQuery(c,a,b)}),window.onpopstate=function(a){null!==a.state&&window.location.reload()},a._is_initialized=!0)},addItem:function(a){if("undefined"===typeof a.blockUid)throw"item.blockUid is not defined";tdbFiltersList.items.push(a);tdbFiltersList._initialize_item(a)},deleteItem:function(a){for(var e=0;e<tdbFiltersList.items.length;e++)if(tdbFiltersList.items[e].blockUid===
a)return tdbFiltersList.items.splice(e,1),!0;return!1},updateQuery:function(a,e,b){var c=new RegExp("([?&])"+e+"=.*?(&|$)","i"),d=(new URLSearchParams(window.location.search)).get(e),h="";if(-1!==d.indexOf(",")){d=d.split(",");for(var l=0;l<d.length;l++)d[l]!==b&&(h+=d[l]+",");h=h.replace(/,\s*$/,"");return a.replace(c,"$1"+e+"="+h+"$2")}return a.replace(c,"$1").replace(/[&|?]\s*$/,"")},removeQueryParam:function(a,e){return a.replace(new RegExp("([?&])"+e+"=.*?(&|$)","i"),"$1").replace(/[&|?]\s*$/,
"")},getItemIndex:function(a){var e=0,b=0;jQuery.each(tdbFiltersList.items,function(c,d){if(d.blockUid===a)return b=e,!1;e++});return b},getItemObjById:function(a){return tdbFiltersList.items[tdbFiltersList.getItemIndex(a)]}}})();jQuery().ready(function(){tdbFiltersList.init()});var tdbFiltersDropdown={};jQuery().ready(function(){tdbFiltersDropdown.init()});
(function(){tdbFiltersDropdown={items:[],item:function(){this.type=this.dropdownObj=this.blockObj=this.dropdownUid=this.uid="";this.isMultiSelect=!1;this.filter_singular_name=this.taxonomy_name=this.taxonomy=this.prefix="";this._is_initialized=this.inComposer=!1},init:function(){tdbFiltersDropdown.items=[];this._is_running=!1},_initialize_item:function(a){if(!0!==a._is_initialized){if("dropdown_search"===a.type)jQuery("."+a.dropdownUid+" .tdb-s-form-group select").select2({placeholder:"-- Search "+
(a.taxonomy_name.charAt(0).toLowerCase()+a.taxonomy_name.slice(1))+" --",minimumInputLength:2,ajax:{url:td_ajax_url,dataType:"json",delay:250,data:function(b){return{action:"tdb_get_search_query_tax_terms",taxonomy:a.taxonomy,search_query:b.term}},processResults:function(a){var b=[];a&&jQuery.each(a,function(a,c){b.push({id:c.term_id,text:c.name,slug:c.slug})});return{results:b}},cache:!0},dropdownCssClass:"tdb-s-select2 tdb-s-select2-"+a.dropdownUid,templateSelection:function(a){jQuery(a.element).attr("data-term-slug",
a.slug);return a.text}});else{var e=jQuery("."+a.dropdownUid+" .tdb-s-form-group select"),b={dropdownCssClass:"tdb-s-select2 tdb-s-select2-"+a.dropdownUid+" tdb-select2-multi",templateSelection:function(a){return jQuery(a.element).text().replace(/ *\([^)]*\) */g,"")}};a.isMultiSelect?(b.dropdownCssClass="tdb-s-select2 tdb-s-select2-"+a.dropdownUid+" tdb-select2-multi",b.placeholder="-- Select "+a.filter_singular_name.toLowerCase()+" --"):b.dropdownCssClass="tdb-s-select2 tdb-s-select2-"+a.dropdownUid;
e.select2(b).on("select2:open",function(b){jQuery(".tdb-s-select2-"+a.dropdownUid+" .select2-search__field").focus()})}a._is_initialized=!0}},addItem:function(a){if("undefined"===typeof a.uid)throw"item.uid is not defined";tdbFiltersDropdown.items.push(a);tdbFiltersDropdown._initialize_item(a)},deleteItem:function(a){for(var e=0;e<tdbFiltersDropdown.items.length;e++)if(tdbFiltersDropdown.items[e].uid===a)return tdbFiltersDropdown.items.splice(e,1),!0;return!1},resetItems:function(){tdbFiltersDropdown.items=
[]}}})();var tdbReviewsList={};jQuery().ready(function(){tdbReviewsList.init()});
(function(){tdbReviewsList={items:[],item:function(){this.blockObj=this.uid="";this.articleAuthorID=0;this.articleAuthorBadge="";this.currentUserID=0;this.deleteTxt=this.requiredTxt=this.replyTxt=this.cancelReplyTxt=this.cancelTxt=this.titleTag=this.emailHolder=this.nameHolder=this.replyHolder=this.submitTxt=this.currentUserEmail=this.currentUserName="";this._is_initialized=this._in_composer=!1},init:function(){tdbReviewsList.items=[];this._is_running=!1},_initialize_item:function(a){!0!==a._is_initialized&&
(a.blockObj.on("click",".tdb-surl-review-leave-reply",function(e){e.preventDefault();e=jQuery(this);var b=e.attr("data-action"),c=e.closest(".tdb-surl-review"),d=""!==a.currentUserName&&""!==a.currentUserEmail;"reply"===b?(e.text(a.cancelReplyTxt),e.attr("data-action","cancel"),c.find("> .tdb-surl-review-right").append('<div class="tdb-surl-review-reply-form tdb-s-form tdb-s-content"><div class="tdb-s-form-content"><div class="tdb-s-fc-inner"><div class="tdb-s-form-group tdb-s-form-group-sm tdb-s-form-group-content"><textarea class="tdb-s-form-input" name="content" placeholder="'+
a.replyHolder+'"></textarea></div><div class="tdb-s-form-group tdb-s-form-group-sm tdb-s-form-group-name"><input class="tdb-s-form-input" type="text" name="name" value="'+a.currentUserName+'" '+(d?"disabled":"")+' placeholder="'+a.nameHolder+'" /></div><div class="tdb-s-form-group tdb-s-form-group-sm tdb-s-form-group-email"><input class="tdb-s-form-input" type="email" name="email" value="'+a.currentUserEmail+'" '+(d?"disabled":"")+' placeholder="'+a.emailHolder+'" /></div></div></div><div class="tdb-s-form-footer"><button class="tdb-s-btn tdb-s-btn-sm tdb-surl-review-reply-submit">'+
a.submitTxt+'</button><button class="tdb-s-btn tdb-s-btn-sm tdb-s-btn-hollow tdb-surl-review-reply-cancel">'+a.cancelTxt+"</button></div></div>"),e=c.find(".tdb-surl-review-reply-form"),jQuery("html, body").animate({scrollTop:e.offset().top-e.height()},200)):"cancel"===b&&(e.text(a.replyTxt),e.attr("data-action","reply"),c.find(".tdb-surl-review-reply-form").remove())}),a.blockObj.on("click",".tdb-surl-review-reply-cancel",function(e){var b=jQuery(this);e=b.closest(".tdb-surl-review").find(".tdb-surl-review-leave-reply");
b=b.closest(".tdb-surl-review-reply-form");e.text(a.replyTxt);e.attr("data-action","reply");b.remove()}),a.blockObj.on("click",".tdb-surl-review-reply-submit",function(e){e.preventDefault();var b=jQuery(this),c=b.closest(".tdb-surl-review");e=c.data("review-id");var d=c.find(".tdb-surl-review-leave-reply"),h=b.closest(".tdb-surl-review-reply-form"),l=h.find('[name="content"]'),k=h.find('[name="name"]'),m=h.find('[name="email"]'),n=0;h.find(".tdb-s-fg-error").removeClass(".tdb-s-fg-error");""===l.val()?
(l.closest(".tdb-s-form-group").addClass("tdb-s-fg-error"),l.closest(".tdb-s-form-group").append('<span class="tdb-s-fg-error-msg">'+a.requiredTxt+"</span>"),n++):(l.closest(".tdb-s-form-group").removeClass("tdb-s-fg-error"),l.closest(".tdb-s-form-group").find(".tdb-s-fg-error-msg").remove());""!==k.val()||k.prop("disabled")?(k.closest(".tdb-s-form-group").removeClass("tdb-s-fg-error"),k.closest(".tdb-s-form-group").find(".tdb-s-fg-error-msg").remove()):(k.closest(".tdb-s-form-group").addClass("tdb-s-fg-error"),
k.closest(".tdb-s-form-group").append('<span class="tdb-s-fg-error-msg">'+a.requiredTxt+"</span>"),n++);""!==m.val()||m.prop("disabled")?(m.closest(".tdb-s-form-group").removeClass("tdb-s-fg-error"),m.closest(".tdb-s-form-group").find(".tdb-s-fg-error-msg").remove()):(m.closest(".tdb-s-form-group").addClass("tdb-s-fg-error"),m.closest(".tdb-s-form-group").append('<span class="tdb-s-fg-error-msg">'+a.requiredTxt+"</span>"),m++);0===n&&(h.addClass("tdb-s-content-disabled"),b.addClass("tdb-s-btn-saving"),
jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_review_reply_on_submit",content:l.val(),name:k.val(),email:m.val(),reviewID:e,userID:a.currentUserID},success:function(e){e=jQuery.parseJSON(e);if(""!==e.reply_id){var m=c.find(".tdb-surl-review-replies"),n="",p=a.currentUserID==a.articleAuthorID,y="";p&&(y="tdb-surl-review-reply-article-author");b.addClass("tdb-s-btn-saved");n+='<div class="tdb-surl-review tdb-surl-review-reply '+y+' tdb-s-content" data-review-reply-id="'+e.reply_id+'">';
n+='<div class="tdb-surl-review-right">';n+="<"+a.titleTag+' class="tdb-surl-review-title" '+(p?'title="Article author"':"")+">";n+=k.val();p&&(n+=a.articleAuthorBadge);n+="</"+a.titleTag+">";n+='<div class="tdb-surl-review-content">'+l.val()+"</div>";0!=a.currentUserID&&(n+='<div class="tdb-surl-review-options">',n+='<a class="tdb-surl-review-reply-delete" href="#">'+a.deleteTxt+"</a>",n+="</div>");n+="</div>";n+="</div>";setTimeout(function(){m.length?m.append(n):c.find("> .tdb-surl-review-right").append('<div class="tdb-surl-review-replies">'+
n+"</div>");h.remove();d.text(a.replyTxt);d.attr("data-action","reply")},200)}}}))}),a.blockObj.on("click",".tdb-surl-review-reply-delete",function(a){a.preventDefault();var b=jQuery(this),c=b.closest(".tdb-surl-review:not(.tdb-surl-review-reply)");a=c.data("review-id");var d=b.closest(".tdb-surl-review-reply");b=d.data("review-reply-id");d.addClass("tdb-s-content-disabled");jQuery.ajax({type:"POST",url:td_ajax_url,data:{action:"tdb_review_reply_on_delete",reviewID:a,reviewReplyID:b},success:function(a){jQuery.parseJSON(a).success&&
setTimeout(function(){d.remove();var a=c.find(".tdb-surl-review-replies");a.find(".tdb-surl-review-reply").length||a.remove()},200)}})}),a._is_initialized=!0)},addItem:function(a){if("undefined"===typeof a.uid)throw"item.uid is not defined";tdbReviewsList.items.push(a);tdbReviewsList._initialize_item(a)},deleteItem:function(a){for(var e=0;e<tdbReviewsList.items.length;e++)if(tdbReviewsList.items[e].uid===a)return tdbReviewsList.items.splice(e,1),!0;return!1},resetItems:function(){tdbReviewsList.items=
[]}}})();var tdbCustomForms={};jQuery().ready(function(){tdbCustomForms.init()});
(function(){tdbCustomForms={items:[],item:function(){this.formType=this.blockObj=this.uid="";this.formData=new FormData;this.customPostTitleField=this.successURL=this.currentUserID=this.formGroupClass="";this.enablePostCreate=!1;this.higher_msg=this.lower_msg=this.valid_email_msg=this.blank_fields_msg=this.required_field_error=this.emailSubject=this.sendEmailToCustomAddr=this.sendEmailToAuthor=this.sendEmailToAdmin=this.enableEmailSubmit=this.linkToPostID=this.postStatus=this.postType=this.postID=
"";this._is_initialized=this._in_composer=!1},init:function(){tdbCustomForms.items=[];this._is_running=!1},_initialize_item:function(a){!0!==a._is_initialized&&(a.blockObj.find(".tdb-s-btn").on("click",function(e){e.preventDefault();e=a.blockObj.find(".tdb-s-form");var b=jQuery(a.formGroupClass+".tdb-s-form-group"),c={},d=!1;a.formData=new FormData;b.removeClass("tdb-s-fg-error");b.find(".tdb-s-fg-error-msg").remove();e.find(".tdb-s-notif").remove();b=tdbCustomForms.getFormContentElements(a);c["content-fields"]=
b.elements;b.hasErrors&&(d=b.hasErrors);b=tdbCustomForms.getFormFileElements(a);c["file-delete-fields"]=b.deleteElements;b.hasErrors&&(d=b.hasErrors);b=tdbCustomForms.getFormACFElements(a);c["acf-fields"]=b.elements;"post"===a.formType&&""!==b.postTitle&&(c["post-title"]=b.postTitle);b.hasErrors&&(d=b.hasErrors);"post"===a.formType&&(b=tdbCustomForms.getFormTaxonomyElements(a),c.taxonomies=b.elements,b.hasErrors&&(d=b.hasErrors),b=tdbCustomForms.getFormLocationElement(a),c["location-data"]=b.element,
b.hasErrors&&(d=b.hasErrors),b=tdbCustomForms.getFormTitleElement(a),"undefined"===typeof c["post-title"]&&(c["post-title"]=b.postTitle),b.hasErrors&&(d=b.hasErrors));d?e.prepend('<div class="tdb-s-notif tdb-s-notif-sm tdb-s-notif-error"><div class="tdb-s-notif-descr">'+a.blank_fields_msg+"</div></div>"):(a.formData.append("formElements",JSON.stringify(c)),a.formData.append("enctype","multipart/form-data"),"user"===a.formType?(a.formData.append("action","tdb_user_form_on_submit"),a.formData.append("userID",
a.currentUserID),tdbCustomForms.userFormAjaxCall(a)):"post"===a.formType&&(a.formData.append("action","tdb_posts_form_on_submit"),a.formData.append("enablePostCreate",a.enablePostCreate),a.formData.append("postID",a.postID),a.formData.append("authorID",a.currentUserID),a.formData.append("postType",a.postType),a.formData.append("postStatus",a.postStatus),a.formData.append("linkToPostID",a.linkToPostID),a.formData.append("enableEmailSubmit",a.enableEmailSubmit),a.formData.append("sendEmailToAdmin",
a.sendEmailToAdmin),a.formData.append("sendEmailToAuthor",a.sendEmailToAuthor),a.formData.append("sendEmailToCustomAddr",a.sendEmailToCustomAddr),a.formData.append("emailSubject",a.emailSubject),tdbCustomForms.postFormAjaxCall(a)))}),a._is_initialized=!0)},getFormContentElements:function(a){var e=[],b=!1;jQuery(a.formGroupClass+".tdb_form_content").each(function(){var c=jQuery(this),d=c.data("required"),h=c.data("custom-field"),l=c.data("form-type"),k=c.find(".tdb-s-form-group"),m=c.find(".tdb-s-form-label").text().replace(" *",
""),n=c.find("textarea");c=c.find(".wp-editor-wrap");var p="";l===a.formType&&(p=c.hasClass("tmce-active")?tinymce.get(n.attr("id")).getContent():n.val(),e.filter(function(a){return a.name===h}).length||(1===d&&""===p?(k.addClass("tdb-s-fg-error"),k.append('<span class="tdb-s-fg-error-msg">'+a.required_field_error+"</span>"),b=!0):(d=encodeURIComponent(p).replace(/%([0-9A-F]{2})/g,function(a,b){return String.fromCharCode("0x"+b)}),m={name:h,value:btoa(d),label:m},e.push(m))))});return{elements:e,
hasErrors:b}},getFormFileElements:function(a){var e=[],b=!1;jQuery(a.formGroupClass+".tdb_form_file_upload").each(function(){var c=jQuery(this),d=c.data("form-type"),h=c.data("required"),l=c.data("no-save"),k=c.data("custom-field"),m=c.find(".tdb-s-form-group");c=c.find("input");var n=c.val();d===a.formType&&""!==k&&!1===l&&(1===h&&""===n?(m.addClass("tdb-s-fg-error"),m.append('<span class="tdb-s-fg-error-msg">'+a.required_field_error+"</span>"),b=!0):(a.formData.append(k,c.prop("files")[0]),""===
n&&e.push(k)))});return{deleteElements:e,hasErrors:b}},getFormACFElements:function(a){var e=[],b="",c=!1;jQuery(a.formGroupClass+".tdb-posts-form-acf-input").each(function(){var d=jQuery(this),h=d.data("form-type"),l=d.data("type"),k=d.data("required"),m=d.data("name"),n=d.find(".tdb-s-form-label").text().replace(" *",""),p=void 0;if(h===a.formType&&!e.filter(function(a){return a.name===m}).length)switch(l){case "text":case "textarea":case "url":case "select":p=d.find(".tdb-s-form-input");var u=p.val();
1===k&&""===p.val()?(d.addClass("tdb-s-fg-error"),d.append('<span class="tdb-s-fg-error-msg">'+a.required_field_error+"</span>"),c=!0):(n={name:m,value:u,label:n,type:l},"select"===l?(jQuery.isArray(u)?(u.forEach(function(a,b){u[b]={value:a,label:p.find('option[value="'+a+'"]').text()}}),n.type=l+"_multiple"):(u={value:u,label:p.find('option[value="'+u+'"]').text()},"post"===a.formType&&m===a.customPostTitleField&&(b=u)),n.value=u):("textarea"===l&&(n.value=encodeURI(u)),"post"===a.formType&&m===
a.customPostTitleField&&(b=u)),e.push(n));break;case "email":h=/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/;p=d.find(".tdb-s-form-input");1===k&&""===p.val()?(d.addClass("tdb-s-fg-error"),d.append('<span class="tdb-s-fg-error-msg">'+a.required_field_error+"</span>"),c=!0):p.val().match(h)||""===p.val()?(l={name:m,value:p.val(),label:n,type:l},e.push(l),"post"===a.formType&&m===a.customPostTitleField&&(b=p.val())):(d.addClass("tdb-s-fg-error"),d.append('<span class="tdb-s-fg-error-msg">'+a.valid_email_msg+
"</span>"),c=!0);break;case "number":p=d.find(".tdb-s-form-input");h=p.attr("min");var w=p.attr("max");1===k&&""===p.val()?(d.addClass("tdb-s-fg-error"),d.append('<span class="tdb-s-fg-error-msg">'+a.required_field_error+"</span>"),c=!0):p.val()<h&&""!==p.val()?(d.addClass("tdb-s-fg-error"),d.append('<span class="tdb-s-fg-error-msg">'+a.lower_msg+h+".</span>"),c=!0):p.val()>w&&""!==p.val()?(d.addClass("tdb-s-fg-error"),d.append('<span class="tdb-s-fg-error-msg">'+a.higher_msg+w+".</span>"),c=!0):
(l={name:m,value:p.val(),label:n,type:l},e.push(l),"post"===a.formType&&m===a.customPostTitleField&&(b=p.val()));break;case "checkbox":if(1!==k||d.find("input:checked").length){var v=[];d.find("input:checked").each(function(){var a=jQuery(this);v.push({value:a.val(),label:a.siblings(".tdb-fi-check-label").text()})});e.push({name:m,value:v,label:n,type:l})}else d.addClass("tdb-s-fg-error"),d.append('<span class="tdb-s-fg-error-msg">'+a.required_field_error+"</span>"),c=!0;break;case "radio":case "button_group":1!==
k||d.find("input:checked").length?(d=d.find("input:checked"),k={value:d.val(),label:d.siblings(".tdb-fi-check-label").text()},e.push({name:m,value:k,label:n,type:l}),"post"===a.formType&&m===a.customPostTitleField&&(b=d.siblings(".tdb-fi-check-label").text())):(d.addClass("tdb-s-fg-error"),d.append('<span class="tdb-s-fg-error-msg">'+a.required_field_error+"</span>"),c=!0)}});return{elements:e,postTitle:b,hasErrors:c}},getFormTaxonomyElements:function(a){var e=[],b=!1;jQuery(a.formGroupClass+".tdb_form_taxonomies").each(function(){var c=
jQuery(this),d=c.data("tax-type"),h=c.data("required"),l=c.find('[data-term-hierarchy="parent"]'),k=l.data("display");c=c.find('[data-term-hierarchy="child"], [data-term-hierarchy="sub-child"]');var m=[];e.filter(function(a){return a.taxType===d}).length||("dropdown"===k?(k=l.find("select"),1===h&&""===k.val()?(l.addClass("tdb-s-fg-error"),l.append('<span class="tdb-s-fg-error-msg">'+a.required_field_error+"</span>"),b=!0):""!==k.val()&&m.push(parseInt(k.val()))):(k=l.find("input:checked"),1!==h||
k.length?k.each(function(){m.push(parseInt(jQuery(this).val()))}):(l.addClass("tdb-s-fg-error"),l.append('<span class="tdb-s-fg-error-msg">'+a.required_field_error+"</span>"),b=!0)),c.each(function(){var a=jQuery(this);"dropdown"===a.data("display")?(a=a.find("select"),""!==a.val()&&m.push(parseInt(a.val()))):a.find("input:checked").each(function(){m.push(parseInt(jQuery(this).val()))})}),m.length&&e.push({terms:m,taxType:d}))});return{elements:e,hasErrors:b}},getFormLocationElement:function(a){var e=
jQuery(a.formGroupClass+".tdb_location_finder").first(),b={},c=!1;if(e.length){var d=e.data("tax-type"),h=e.data("required"),l=e.find(".tdb-s-form-group-lf-search input"),k=l.closest(".tdb-s-form-group"),m=e.find(".tdb-s-form-group-lf-address input"),n=e.find(".tdb-s-form-group-lf-postal-code input"),p=e.find(".tdb-s-form-group-lf-city input"),u=e.find(".tdb-s-form-group-lf-state input");e=e.find(".tdb-s-form-group-lf-country input");1===h&&""===l.val()?(k.addClass("tdb-s-fg-error"),k.append('<span class="tdb-s-fg-error-msg">'+
a.required_field_error+"</span>"),c=!0):""!==p.val()&&""!==u.val()&&""!==e.val()&&(b={address:m.val(),postalCode:n.val(),city:p.val(),state:u.val(),country:e.val(),taxType:d})}return{element:b,hasErrors:c}},getFormTitleElement:function(a){var e=jQuery(a.formGroupClass+".tdb_form_title input").first(),b="",c=!1;if(e.length){e=e.first();var d=e.closest(".tdb-s-form-group");""===e.val()?(d.addClass("tdb-s-fg-error"),d.append('<span class="tdb-s-fg-error-msg">'+a.required_field_error+"</span>"),c=!0):
b=e.val()}return{postTitle:b,hasErrors:c}},userFormAjaxCall:function(a){var e=a.blockObj.find(".tdb-s-form"),b=jQuery(a.formGroupClass+".tdb-s-form-group"),c=a.blockObj.find(".tdb-s-btn");b.addClass("tdb-s-content-disabled");e.addClass("tdb-s-content-disabled");c.addClass("tdb-s-btn-saving");jQuery.ajax({method:"POST",url:td_ajax_url,data:a.formData,contentType:!1,processData:!1,success:function(d){d=jQuery.parseJSON(d);""!==d.success&&e.prepend('<div class="tdb-s-notif tdb-s-notif-sm tdb-s-notif-success"><div class="tdb-s-notif-descr">'+
d.success+"</div></div>");if(d.errors.length){var h='<div class="tdb-s-notif tdb-s-notif-sm tdb-s-notif-error">';h+='<ul class="tdb-s-notif-list">';jQuery.each(d.errors,function(a,b){h+="<li>"+b+"</li>"});h+="</ul>";h+="</div>";e.prepend(h)}c.addClass("tdb-s-btn-saved");e.removeClass("tdb-s-content-disabled");setTimeout(function(){b.removeClass("tdb-s-content-disabled");c.removeClass("tdb-s-btn-saving").removeClass("tdb-s-btn-saved");setTimeout(function(){a.blockObj.find(".tdb-s-notif-success").remove();
a.blockObj.find(".tdb-s-notif-error").remove()},4E3)},200)}})},postFormAjaxCall:function(a){var e=a.blockObj.find(".tdb-s-form"),b=jQuery(a.formGroupClass+".tdb-s-form-group"),c=a.blockObj.find(".tdb-s-btn");b.addClass("tdb-s-content-disabled");e.addClass("tdb-s-content-disabled");c.addClass("tdb-s-btn-saving");jQuery.ajax({method:"POST",url:td_ajax_url,data:a.formData,contentType:!1,processData:!1,success:function(d){d=jQuery.parseJSON(d);if(""!==a.successURL&&""!==d.success.create_post&&""===a.postID)window.location.replace(a.successURL);
else{if(""!==d.success.create_post||""!==d.success.email){var h='<div class="tdb-s-notif tdb-s-notif-sm tdb-s-notif-success"><ul class="tdb-s-notif-list">';""!==d.success.create_post&&(h+="<li>"+d.success.create_post+"</li>");""!==d.success.email&&(h+="<li>"+d.success.email+"</li>");e.prepend(h+"</ul></div>")}if(""!==d.errors.create_post||""!==d.errors.email)h='<div class="tdb-s-notif tdb-s-notif-sm tdb-s-notif-error"><ul class="tdb-s-notif-list">',""!==d.errors.create_post&&(h+="<li>"+d.errors.create_post+
"</li>"),""!==d.errors.email&&(h+="<li>"+d.errors.email+"</li>"),e.prepend(h+"</ul></div>");c.addClass("tdb-s-btn-saved");e.removeClass("tdb-s-content-disabled");""!==d.success.create_post&&""===a.postID?setTimeout(function(){window.location.replace(window.location.pathname+window.location.search+window.location.hash)},1E3):setTimeout(function(){b.removeClass("tdb-s-content-disabled");c.removeClass("tdb-s-btn-saving").removeClass("tdb-s-btn-saved");setTimeout(function(){a.blockObj.find(".tdb-s-notif-success").remove();
a.blockObj.find(".tdb-s-notif-error").remove()},4E3)},200)}}})},addItem:function(a){if("undefined"===typeof a.uid)throw"item.uid is not defined";tdbCustomForms.items.push(a);tdbCustomForms._initialize_item(a)},deleteItem:function(a){for(var e=0;e<tdbCustomForms.items.length;e++)if(tdbCustomForms.items[e].uid===a)return tdbCustomForms.items.splice(e,1),!0;return!1},resetItems:function(){tdbCustomForms.items=[]}}})();
