package assets var CpScriptsJs = []byte(`!function(e,t){void 0===e&&void 0!==window&&(e=window),"function"==typeof define&&define.amd?define(["jquery"],function(e){return t(e)}):"object"==typeof module&&module.exports?module.exports=t(require("jquery")):t(e.jQuery)}(this,function(e){!function(H){"use strict";var d=["sanitize","whiteList","sanitizeFn"],a=["background","cite","href","itemtype","longdesc","poster","src","xlink:href"],e={"*":["class","dir","id","lang","role","tabindex","style",/^aria-[\w-]*$/i],a:["target","href","title","rel"],area:[],b:[],br:[],col:[],code:[],div:[],em:[],hr:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],i:[],img:["src","alt","title","width","height"],li:[],ol:[],p:[],pre:[],s:[],small:[],span:[],sub:[],sup:[],strong:[],u:[],ul:[]},r=/^(?:(?:https?|mailto|ftp|tel|file):|[^&:/?#]*(?:[/?#]|$))/gi,l=/^data:(?:image\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\/(?:mpeg|mp4|ogg|webm)|audio\/(?:mp3|oga|ogg|opus));base64,[a-z0-9+/]+=*$/i;function v(e,t){var i=e.nodeName.toLowerCase();if(-1!==H.inArray(i,t))return-1===H.inArray(i,a)||Boolean(e.nodeValue.match(r)||e.nodeValue.match(l));for(var s=H(t).filter(function(e,t){return t instanceof RegExp}),n=0,o=s.length;n]+>/g,"")),s&&(l=w(l)),l=l.toUpperCase(),o="contains"===i?0<=l.indexOf(t):l.startsWith(t)))break}return o}function A(e){return parseInt(e,10)||0}H.fn.triggerNative=function(e){var t,i=this[0];i.dispatchEvent?(u?t=new Event(e,{bubbles:!0}):(t=document.createEvent("Event")).initEvent(e,!0,!1),i.dispatchEvent(t)):i.fireEvent?((t=document.createEventObject()).eventType=e,i.fireEvent("on"+e,t)):this.trigger(e)};var f={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"},m=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,g=RegExp("[\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff\\u1ab0-\\u1aff\\u1dc0-\\u1dff]","g");function b(e){return f[e]}function w(e){return(e=e.toString())&&e.replace(m,b).replace(g,"")}var x,y,$,k,S=(x={"&":"&","<":"<",">":">",'"':""","'":"'","` + "`" + `":"`"},y="(?:"+Object.keys(x).join("|")+")",$=RegExp(y),k=RegExp(y,"g"),function(e){return e=null==e?"":""+e,$.test(e)?e.replace(k,T):e});function T(e){return x[e]}var L={32:" ",48:"0",49:"1",50:"2",51:"3",52:"4",53:"5",54:"6",55:"7",56:"8",57:"9",59:";",65:"A",66:"B",67:"C",68:"D",69:"E",70:"F",71:"G",72:"H",73:"I",74:"J",75:"K",76:"L",77:"M",78:"N",79:"O",80:"P",81:"Q",82:"R",83:"S",84:"T",85:"U",86:"V",87:"W",88:"X",89:"Y",90:"Z",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9"},z=27,D=13,O=32,M=9,P=38,W=40,B={success:!1,major:"3"};try{B.full=(H.fn.dropdown.Constructor.VERSION||"").split(" ")[0].split("."),B.major=B.full[0],B.success=!0}catch(e){}var j=0,F=".bs.select",R={DISABLED:"disabled",DIVIDER:"divider",SHOW:"open",DROPUP:"dropup",MENU:"dropdown-menu",MENURIGHT:"dropdown-menu-right",MENULEFT:"dropdown-menu-left",BUTTONCLASS:"btn-default",POPOVERHEADER:"popover-title",ICONBASE:"glyphicon",TICKICON:"glyphicon-ok"},U={MENU:"."+R.MENU},_={span:document.createElement("span"),i:document.createElement("i"),subtext:document.createElement("small"),a:document.createElement("a"),li:document.createElement("li"),whitespace:document.createTextNode(" "),fragment:document.createDocumentFragment()};_.a.setAttribute("role","option"),_.subtext.className="text-muted",_.text=_.span.cloneNode(!1),_.text.className="text",_.checkMark=_.span.cloneNode(!1);var V=new RegExp(P+"|"+W),q=new RegExp("^"+M+"$|"+z),G=function(e,t,i){var s=_.li.cloneNode(!1);return e&&(1===e.nodeType||11===e.nodeType?s.appendChild(e):s.innerHTML=e),void 0!==t&&""!==t&&(s.className=t),null!=i&&s.classList.add("optgroup-"+i),s},K=function(e,t,i){var s=_.a.cloneNode(!0);return e&&(11===e.nodeType?s.appendChild(e):s.insertAdjacentHTML("beforeend",e)),void 0!==t&&""!==t&&(s.className=t),"4"===B.major&&s.classList.add("dropdown-item"),i&&s.setAttribute("style",i),s},Y=function(e,t){var i,s,n=_.text.cloneNode(!1);if(e.content)n.innerHTML=e.content;else{if(n.textContent=e.text,e.icon){var o=_.whitespace.cloneNode(!1);(s=(!0===t?_.i:_.span).cloneNode(!1)).className=e.iconBase+" "+e.icon,_.fragment.appendChild(s),_.fragment.appendChild(o)}e.subtext&&((i=_.subtext.cloneNode(!1)).textContent=e.subtext,n.appendChild(i))}if(!0===t)for(;0'},maxOptions:!1,mobile:!1,selectOnTab:!1,dropdownAlignRight:!1,windowPadding:0,virtualScroll:600,display:!1,sanitize:!0,sanitizeFn:null,whiteList:e},X.prototype={constructor:X,init:function(){var i=this,e=this.$element.attr("id");this.selectId=j++,this.$element[0].classList.add("bs-select-hidden"),this.multiple=this.$element.prop("multiple"),this.autofocus=this.$element.prop("autofocus"),this.options.showTick=this.$element[0].classList.contains("show-tick"),this.$newElement=this.createDropdown(),this.$element.after(this.$newElement).prependTo(this.$newElement),this.$button=this.$newElement.children("button"),this.$menu=this.$newElement.children(U.MENU),this.$menuInner=this.$menu.children(".inner"),this.$searchbox=this.$menu.find("input"),this.$element[0].classList.remove("bs-select-hidden"),!0===this.options.dropdownAlignRight&&this.$menu[0].classList.add(R.MENURIGHT),void 0!==e&&this.$button.attr("data-id",e),this.checkDisabled(),this.clickListener(),this.options.liveSearch&&this.liveSearchListener(),this.setStyle(),this.render(),this.setWidth(),this.options.container?this.selectPosition():this.$element.on("hide"+F,function(){if(i.isVirtual()){var e=i.$menuInner[0],t=e.firstChild.cloneNode(!1);e.replaceChild(t,e.firstChild),e.scrollTop=0}}),this.$menu.data("this",this),this.$newElement.data("this",this),this.options.mobile&&this.mobile(),this.$newElement.on({"hide.bs.dropdown":function(e){i.$menuInner.attr("aria-expanded",!1),i.$element.trigger("hide"+F,e)},"hidden.bs.dropdown":function(e){i.$element.trigger("hidden"+F,e)},"show.bs.dropdown":function(e){i.$menuInner.attr("aria-expanded",!0),i.$element.trigger("show"+F,e)},"shown.bs.dropdown":function(e){i.$element.trigger("shown"+F,e)}}),i.$element[0].hasAttribute("required")&&this.$element.on("invalid"+F,function(){i.$button[0].classList.add("bs-invalid"),i.$element.on("shown"+F+".invalid",function(){i.$element.val(i.$element.val()).off("shown"+F+".invalid")}).on("rendered"+F,function(){this.validity.valid&&i.$button[0].classList.remove("bs-invalid"),i.$element.off("rendered"+F)}),i.$button.on("blur"+F,function(){i.$element.trigger("focus").trigger("blur"),i.$button.off("blur"+F)})}),setTimeout(function(){i.createLi(),i.$element.trigger("loaded"+F)})},createDropdown:function(){var e=this.multiple||this.options.showTick?" show-tick":"",t="",i=this.autofocus?" autofocus":"";B.major<4&&this.$element.parent().hasClass("input-group")&&(t=" input-group-btn");var s,n="",o="",a="",r="";return this.options.header&&(n='
'+this.options.header+"
"),this.options.liveSearch&&(o=''),this.multiple&&this.options.actionsBox&&(a='
"),this.multiple&&this.options.doneButton&&(r='
"),s='",H(s)},setPositionData:function(){this.selectpicker.view.canHighlight=[];for(var e=0;e=this.options.virtualScroll||!0===this.options.virtualScroll},createView:function(A,e){e=e||0;var L=this;this.selectpicker.current=A?this.selectpicker.search:this.selectpicker.main;var z,D,O=[];function i(e,t){var i,s,n,o,a,r,l,c,d=L.selectpicker.current.elements.length,p=[],h=!0,u=L.isVirtual();L.selectpicker.view.scrollTop=e,!0===u&&L.sizeInfo.hasScrollBar&&L.$menu[0].offsetWidth>L.sizeInfo.totalMenuWidth&&(L.sizeInfo.menuWidth=L.$menu[0].offsetWidth,L.sizeInfo.totalMenuWidth=L.sizeInfo.menuWidth+L.sizeInfo.scrollBarWidth,L.$menu.css("min-width",L.sizeInfo.menuWidth)),i=Math.ceil(L.sizeInfo.menuInnerHeight/L.sizeInfo.liHeight*1.5),s=Math.round(d/i)||1;for(var f=0;fd-1?0:L.selectpicker.current.data[d-1].position-L.selectpicker.current.data[L.selectpicker.view.position1-1].position,b.firstChild.style.marginTop=v+"px",b.firstChild.style.marginBottom=g+"px"),b.firstChild.appendChild(w)}if(L.prevActiveIndex=L.activeIndex,L.options.liveSearch){if(A&&t){var C,T=0;L.selectpicker.view.canHighlight[T]||(T=1+L.selectpicker.view.canHighlight.slice(1).indexOf(!0)),C=L.selectpicker.view.visibleElements[T],L.selectpicker.view.currentActive&&(L.selectpicker.view.currentActive.classList.remove("active"),L.selectpicker.view.currentActive.firstChild&&L.selectpicker.view.currentActive.firstChild.classList.remove("active")),C&&(C.classList.add("active"),C.firstChild&&C.firstChild.classList.add("active")),L.activeIndex=(L.selectpicker.current.data[T]||{}).index}}else L.$menuInner.trigger("focus")}this.setPositionData(),i(e,!0),this.$menuInner.off("scroll.createView").on("scroll.createView",function(e,t){L.noScroll||i(this.scrollTop,t),L.noScroll=!1}),H(window).off("resize"+F+"."+this.selectId+".createView").on("resize"+F+"."+this.selectId+".createView",function(){L.$newElement.hasClass(R.SHOW)&&i(L.$menuInner[0].scrollTop)})},setPlaceholder:function(){var e=!1;if(this.options.title&&!this.multiple){this.selectpicker.view.titleOption||(this.selectpicker.view.titleOption=document.createElement("option")),e=!0;var t=this.$element[0],i=!1,s=!this.selectpicker.view.titleOption.parentNode;if(s)this.selectpicker.view.titleOption.className="bs-title-option",this.selectpicker.view.titleOption.value="",i=void 0===H(t.options[t.selectedIndex]).attr("selected")&&void 0===this.$element.data("selected");!s&&0===this.selectpicker.view.titleOption.index||t.insertBefore(this.selectpicker.view.titleOption,t.firstChild),i&&(t.selectedIndex=0)}return e},createLi:function(){var l=this,f=this.options.iconBase,m=':not([hidden]):not([data-hidden="true"])',v=[],g=[],c=0,b=0,e=this.setPlaceholder()?1:0;this.options.hideDisabled&&(m+=":not(:disabled)"),!l.options.showTick&&!l.multiple||_.checkMark.parentNode||(_.checkMark.className=f+" "+l.options.tickIcon+" check-mark",_.a.appendChild(_.checkMark));var t=this.$element[0].querySelectorAll("select > *"+m);function w(e){var t=g[g.length-1];t&&"divider"===t.type&&(t.optID||e.optID)||((e=e||{}).type="divider",v.push(G(!1,R.DIVIDER,e.optID?e.optID+"div":void 0)),g.push(e))}function x(e,t){if((t=t||{}).divider="true"===e.getAttribute("data-divider"),t.divider)w({optID:t.optID});else{var i=g.length,s=e.style.cssText,n=s?S(s):"",o=(e.className||"")+(t.optgroupClass||"");t.optID&&(o="opt "+o),t.text=e.textContent,t.content=e.getAttribute("data-content"),t.tokens=e.getAttribute("data-tokens"),t.subtext=e.getAttribute("data-subtext"),t.icon=e.getAttribute("data-icon"),t.iconBase=f;var a=Y(t);v.push(G(K(a,o,n),"",t.optID)),e.liIndex=i,t.display=t.content||t.text,t.type="option",t.index=i,t.option=e,t.disabled=t.disabled||e.disabled,g.push(t);var r=0;t.display&&(r+=t.display.length),t.subtext&&(r+=t.subtext.length),t.icon&&(r+=1),c li")},render:function(){this.setPlaceholder();var e,t=this,i=this.$element[0].selectedOptions,s=i.length,n=this.$button[0],o=n.querySelector(".filter-option-inner-inner"),a=document.createTextNode(this.options.multipleSeparator),r=_.fragment.cloneNode(!1),l=!1;if(this.togglePlaceholder(),this.tabIndex(),"static"===this.options.selectedTextFormat)r=Y({text:this.options.title},!0);else if(!1===(this.multiple&&-1!==this.options.selectedTextFormat.indexOf("count")&&1")).length&&s>e[1]||1===e.length&&2<=s))){for(var c=0;c option"+u+", optgroup"+u+" option"+u).length,m="function"==typeof this.options.countSelectedText?this.options.countSelectedText(s,f):this.options.countSelectedText;r=Y({text:m.replace("{0}",s.toString()).replace("{1}",f.toString())},!0)}if(null==this.options.title&&(this.options.title=this.$element.attr("title")),r.childNodes.length||(r=Y({text:void 0!==this.options.title?this.options.title:this.options.noneSelectedText},!0)),n.title=r.textContent.replace(/<[^>]*>?/g,"").trim(),this.options.sanitize&&l&&N([r],t.options.whiteList,t.options.sanitizeFn),o.innerHTML="",o.appendChild(r),B.major<4&&this.$newElement[0].classList.contains("bs3-has-addon")){var v=n.querySelector(".filter-expand"),g=o.cloneNode(!0);g.className="filter-expand",v?n.replaceChild(g,v):n.appendChild(g)}this.$element.trigger("rendered"+F)},setStyle:function(e,t){var i,s=this.$button[0],n=this.$newElement[0],o=this.options.style.trim();this.$element.attr("class")&&this.$newElement.addClass(this.$element.attr("class").replace(/selectpicker|mobile-device|bs-select-hidden|validate\[.*\]/gi,"")),B.major<4&&(n.classList.add("bs3"),n.parentNode.classList.contains("input-group")&&(n.previousElementSibling||n.nextElementSibling)&&(n.previousElementSibling||n.nextElementSibling).classList.contains("input-group-addon")&&n.classList.add("bs3-has-addon")),i=e?e.trim():o,"add"==t?i&&s.classList.add.apply(s.classList,i.split(" ")):"remove"==t?i&&s.classList.remove.apply(s.classList,i.split(" ")):(o&&s.classList.remove.apply(s.classList,o.split(" ")),i&&s.classList.add.apply(s.classList,i.split(" ")))},liHeight:function(e){if(e||!1!==this.options.size&&!this.sizeInfo){this.sizeInfo||(this.sizeInfo={});var t=document.createElement("div"),i=document.createElement("div"),s=document.createElement("div"),n=document.createElement("ul"),o=document.createElement("li"),a=document.createElement("li"),r=document.createElement("li"),l=document.createElement("a"),c=document.createElement("span"),d=this.options.header&&0this.sizeInfo.menuExtras.vert&&r+this.sizeInfo.menuExtras.vert+50>this.sizeInfo.selectOffsetBot)),"auto"===this.options.size)n=3this.options.size){for(var g=0;gthis.sizeInfo.selectOffsetRight&&this.sizeInfo.selectOffsetRightthis.sizeInfo.menuInnerHeight&&(this.sizeInfo.hasScrollBar=!0,this.sizeInfo.totalMenuWidth=this.sizeInfo.menuWidth+this.sizeInfo.scrollBarWidth,this.$menu.css("min-width",this.sizeInfo.totalMenuWidth)),this.dropdown&&this.dropdown._popper&&this.dropdown._popper.update()},setSize:function(e){if(this.liHeight(e),this.options.header&&this.$menu.css("padding-top",0),!1!==this.options.size){var t,i=this,s=H(window),n=0;if(this.setMenuSize(),this.options.liveSearch&&this.$searchbox.off("input.setMenuSize propertychange.setMenuSize").on("input.setMenuSize propertychange.setMenuSize",function(){return i.setMenuSize()}),"auto"===this.options.size?s.off("resize"+F+"."+this.selectId+".setMenuSize scroll"+F+"."+this.selectId+".setMenuSize").on("resize"+F+"."+this.selectId+".setMenuSize scroll"+F+"."+this.selectId+".setMenuSize",function(){return i.setMenuSize()}):this.options.size&&"auto"!=this.options.size&&this.selectpicker.current.elements.length>this.options.size&&s.off("resize"+F+"."+this.selectId+".setMenuSize scroll"+F+"."+this.selectId+".setMenuSize"),e)n=this.$menuInner[0].scrollTop;else if(!i.multiple){var o=i.$element[0];"number"==typeof(t=(o.options[o.selectedIndex]||{}).liIndex)&&!1!==i.options.size&&(n=(n=i.sizeInfo.liHeight*t)-i.sizeInfo.menuInnerHeight/2+i.sizeInfo.liHeight/2)}i.createView(!1,n)}},setWidth:function(){var i=this;"auto"===this.options.width?requestAnimationFrame(function(){i.$menu.css("min-width","0"),i.$element.on("loaded"+F,function(){i.liHeight(),i.setMenuSize();var e=i.$newElement.clone().appendTo("body"),t=e.css("width","auto").children("button").outerWidth();e.remove(),i.sizeInfo.selectWidth=Math.max(i.sizeInfo.totalMenuWidth,t),i.$newElement.css("width",i.sizeInfo.selectWidth+"px")})}):"fit"===this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width","").addClass("fit-width")):this.options.width?(this.$menu.css("min-width",""),this.$newElement.css("width",this.options.width)):(this.$menu.css("min-width",""),this.$newElement.css("width","")),this.$newElement.hasClass("fit-width")&&"fit"!==this.options.width&&this.$newElement[0].classList.remove("fit-width")},selectPosition:function(){this.$bsContainer=H('
');function e(e){var t={},i=a.options.display||!!H.fn.dropdown.Constructor.Default&&H.fn.dropdown.Constructor.Default.display;a.$bsContainer.addClass(e.attr("class").replace(/form-control|fit-width/gi,"")).toggleClass(R.DROPUP,e.hasClass(R.DROPUP)),s=e.offset(),r.is("body")?n={top:0,left:0}:((n=r.offset()).top+=parseInt(r.css("borderTopWidth"))-r.scrollTop(),n.left+=parseInt(r.css("borderLeftWidth"))-r.scrollLeft()),o=e.hasClass(R.DROPUP)?0:e[0].offsetHeight,(B.major<4||"static"===i)&&(t.top=s.top-n.top+o,t.left=s.left-n.left),t.width=e[0].offsetWidth,a.$bsContainer.css(t)}var s,n,o,a=this,r=H(this.options.container);this.$button.on("click.bs.dropdown.data-api",function(){a.isDisabled()||(e(a.$newElement),a.$bsContainer.appendTo(a.options.container).toggleClass(R.SHOW,!a.$button.hasClass(R.SHOW)).append(a.$menu))}),H(window).off("resize"+F+"."+this.selectId+" scroll"+F+"."+this.selectId).on("resize"+F+"."+this.selectId+" scroll"+F+"."+this.selectId,function(){a.$newElement.hasClass(R.SHOW)&&e(a.$newElement)}),this.$element.on("hide"+F,function(){a.$menu.data("height",a.$menu.height()),a.$bsContainer.detach()})},setOptionStatus:function(){var e=this;if(e.noScroll=!1,e.selectpicker.view.visibleElements&&e.selectpicker.view.visibleElements.length)for(var t=0;t
');y[2]&&($=$.replace("{var}",y[2][1"+$+"")),l=!1,S.$element.trigger("maxReached"+F)),v&&b&&(k.append(H("
"+I+"
")),l=!1,S.$element.trigger("maxReachedGrp"+F)),setTimeout(function(){S.setSelected(o,!1)},10),k.delay(750).fadeOut(300,function(){H(this).remove()})}}}else c.prop("selected",!1),d.selected=!0,S.setSelected(o,!0);!S.multiple||S.multiple&&1===S.options.maxOptions?S.$button.trigger("focus"):S.options.liveSearch&&S.$searchbox.trigger("focus"),l&&(a!=E(S.$element[0])&&S.multiple||r!=S.$element.prop("selectedIndex")&&!S.multiple)&&(C=[d.index,p.prop("selected"),a],S.$element.triggerNative("change"))}}),this.$menu.on("click","li."+R.DISABLED+" a, ."+R.POPOVERHEADER+", ."+R.POPOVERHEADER+" :not(.close)",function(e){e.currentTarget==this&&(e.preventDefault(),e.stopPropagation(),S.options.liveSearch&&!H(e.target).hasClass("close")?S.$searchbox.trigger("focus"):S.$button.trigger("focus"))}),this.$menuInner.on("click",".divider, .dropdown-header",function(e){e.preventDefault(),e.stopPropagation(),S.options.liveSearch?S.$searchbox.trigger("focus"):S.$button.trigger("focus")}),this.$menu.on("click","."+R.POPOVERHEADER+" .close",function(){S.$button.trigger("click")}),this.$searchbox.on("click",function(e){e.stopPropagation()}),this.$menu.on("click",".actions-btn",function(e){S.options.liveSearch?S.$searchbox.trigger("focus"):S.$button.trigger("focus"),e.preventDefault(),e.stopPropagation(),H(this).hasClass("bs-select-all")?S.selectAll():S.deselectAll()}),this.$element.on("change"+F,function(){S.render(),S.$element.trigger("changed"+F,C),C=null}).on("focus"+F,function(){S.options.mobile||S.$button.trigger("focus")})},liveSearchListener:function(){var u=this,f=document.createElement("li");this.$button.on("click.bs.dropdown.data-api",function(){u.$searchbox.val()&&u.$searchbox.val("")}),this.$searchbox.on("click.bs.dropdown.data-api focus.bs.dropdown.data-api touchend.bs.dropdown.data-api",function(e){e.stopPropagation()}),this.$searchbox.on("input propertychange",function(){var e=u.$searchbox.val();if(u.selectpicker.search.elements=[],u.selectpicker.search.data=[],e){var t=[],i=e.toUpperCase(),s={},n=[],o=u._searchStyle(),a=u.options.liveSearchNormalize;a&&(i=w(i)),u._$lisSelected=u.$menuInner.find(".selected");for(var r=0;r=l.selectpicker.view.canHighlight.length&&(t=0),l.selectpicker.view.canHighlight[t+m]||(t=t+1+l.selectpicker.view.canHighlight.slice(t+m+1).indexOf(!0))),e.preventDefault();var v=m+t;e.which===P?0===m&&t===c.length-1?(l.$menuInner[0].scrollTop=l.$menuInner[0].scrollHeight,v=l.selectpicker.current.elements.length-1):d=(o=(n=l.selectpicker.current.data[v]).position-n.height)u+l.sizeInfo.menuInnerHeight),(s=l.selectpicker.main.elements[g]).classList.add("active"),s.firstChild&&s.firstChild.classList.add("active"),l.activeIndex=w[$],s.firstChild.focus(),d&&(l.$menuInner[0].scrollTop=o),a.trigger("focus")}}i&&(e.which===O&&!l.selectpicker.keydown.keyHistory||e.which===D||e.which===M&&l.options.selectOnTab)&&(e.which!==O&&e.preventDefault(),l.options.liveSearch&&e.which===O||(l.$menuInner.find(".active a").trigger("click",!0),a.trigger("focus"),l.options.liveSearch||(e.preventDefault(),H(document).data("spaceSelect",!0))))}},mobile:function(){this.$element[0].classList.add("mobile-device")},refresh:function(){var e=H.extend({},this.options,this.$element.data());this.options=e,this.checkDisabled(),this.setStyle(),this.render(),this.createLi(),this.setWidth(),this.setSize(!0),this.$element.trigger("refreshed"+F)},hide:function(){this.$newElement.hide()},show:function(){this.$newElement.show()},remove:function(){this.$newElement.remove(),this.$element.remove()},destroy:function(){this.$newElement.before(this.$element).remove(),this.$bsContainer?this.$bsContainer.remove():this.$menu.remove(),this.$element.off(F).removeData("selectpicker").removeClass("bs-select-hidden selectpicker"),H(window).off(F+"."+this.selectId)}};var Z=H.fn.selectpicker;H.fn.selectpicker=Q,H.fn.selectpicker.Constructor=X,H.fn.selectpicker.noConflict=function(){return H.fn.selectpicker=Z,this},H(document).off("keydown.bs.dropdown.data-api").on("keydown"+F,'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',X.prototype.keydown).on("focusin.modal",'.bootstrap-select [data-toggle="dropdown"], .bootstrap-select [role="listbox"], .bootstrap-select .bs-searchbox input',function(e){e.stopPropagation()}),H(window).on("load"+F+".data-api",function(){H(".selectpicker").each(function(){var e=H(this);Q.call(e,e.data())})})}(e)}),function(e,t){if("function"==typeof define&&define.amd)define(["module","exports"],t);else if("undefined"!=typeof exports)t(module,exports);else{var i={exports:{}};t(i,i.exports),e.autosize=i.exports}}(this,function(e,t){"use strict";var i,s,p="function"==typeof Map?new Map:(i=[],s=[],{has:function(e){return-1'+e+" "+t+''}function ShowSystemMsg(e,t,i){var s=$(".modal.show .sys-messages");s.length||(s=$("form.alert-here .sys-messages")),s.length?s.html(GetModalAlertTmpl(e,t,i)):ShowSystemMsgModal(e,t,i)}function ShowSystemMsgModal(e,t,i){$("#sys-modal-system-message-placeholder").html("");var s='';$("#sys-modal-system-message-placeholder").html(s),$("#sys-modal-system-message").modal({backdrop:"static",keyboard:!0,show:!1}),$("#sys-modal-system-message").on("hidden.bs.modal",function(e){$("#sys-modal-system-message-placeholder").html("")}),$("#sys-modal-system-message").modal("show")}function AjaxEval(data){try{eval(data)}catch(e){e instanceof SyntaxError&&(console.log(data),console.log("Error: JavaScript code eval error",e.message))}}function AjaxDone(e){AjaxEval(e)}function AjaxFail(e,t,i){"error"===t.toLowerCase()&&"not found"===i.toLowerCase()?AjaxEval(e):(console.log("Error: data sending error, page will be reloaded",e,t,i),setTimeout(function(){window.location.reload(!1)},1e3))}function FormToAjax(i){i.submit(function(e){if(i.hasClass("loading"))e.preventDefault();else{i.addClass("loading").addClass("alert-here");var t=i.find("button[type=submit]");t.addClass("progress-bar-striped").addClass("progress-bar-animated"),""!=t.attr("data-target")&&$("#"+t.attr("data-target")).addClass("progress-bar-striped").addClass("progress-bar-animated"),i.find(".sys-messages").html(""),$.ajax({type:"POST",url:i.attr("action"),data:i.serialize()}).done(function(e){FormDataWasChanged=!1,IsDebugMode()&&console.log("done",e),AjaxDone(e)}).fail(function(e,t,i){IsDebugMode()&&console.log("fail",e,t,i),AjaxFail(e.responseText,t,i)}).always(function(){setTimeout(function(){i.removeClass("loading").removeClass("alert-here"),t.removeClass("progress-bar-striped").removeClass("progress-bar-animated"),""!=t.attr("data-target")&&$("#"+t.attr("data-target")).removeClass("progress-bar-striped").removeClass("progress-bar-animated")},100)}),e.preventDefault()}});var e=i.find("button[type=submit]");""!=e.attr("data-target")&&$("#"+e.attr("data-target")).click(function(){e.click()}),i.hasClass("prev-data-lost")&&i.find("input, textarea, select").on("input",function(){FormDataWasChanged||$(this).hasClass("ignore-lost-data")||(FormDataWasChanged=!0)})}function PreventDataLost(){FormDataWasChanged=FormDataWasChanged||!0}function HtmlDecode(e){return(new DOMParser).parseFromString(e,"text/html").documentElement.textContent}function HtmlFixEditorHtml(e){return newValue=e,newValue=newValue.replace(/ /gi,""),newValue}function AllFormsToAjax(){$("form").each(function(){FormToAjax($(this))})}function BindWindowBeforeUnload(){$(window).bind("beforeunload",function(){if(FormDataWasChanged)return"Some data was changed and not saved. Are you sure want to leave page?"})}function MakeTextAreasAutoSized(){autosize($("textarea.autosize"))}function MakeTextAreasWysiwyg(){$("textarea.wysiwyg").each(function(){var t=$(this)[0],e=t.id,i=t.name,s=t.innerHTML;$(t).wrap('
').remove();var n=document.getElementById(e+"_wysiwyg");n.id=e;var o=window.pell.init({element:n,onChange:function(e){t.innerHTML=HtmlFixEditorHtml(e),$(t).val(HtmlFixEditorHtml(e)),FormDataWasChanged=FormDataWasChanged||!0},defaultParagraphSeparator:"p",styleWithCSS:!1,actions:["paragraph","heading1","heading2","bold","italic","underline","strikethrough","ulist","olist","link",{name:"htmlcode",icon:"HTML",title:"HTML Source",result:function(e,t,i){var s=$(e),n=$(t),o=$(i);if(o.hasClass("pell-button-html-pressed")){o.removeClass("pell-button-html-pressed"),s.removeClass("pell-html-mode"),s.find(".pell-actionbar .pell-button").prop("disabled",!1);var a=s.find("textarea.form-control").val();t.innerHTML=HtmlFixEditorHtml(a),$(t).val(HtmlFixEditorHtml(a)),setTimeout(function(){n.focus()},0)}else o.addClass("pell-button-html-pressed"),s.addClass("pell-html-mode"),s.find(".pell-actionbar .pell-button").prop("disabled",!0),o.prop("disabled",!1),setTimeout(function(){s.find("textarea.form-control").focus()},0)}}],classes:{actionbar:"pell-actionbar",button:"pell-button",content:"pell-content",selected:"pell-button-selected"}});o.onfocusin=function(){$(n).addClass("focused")},o.onfocusout=function(){$(n).find(".pell-actionbar button.pell-button-selected").removeClass("pell-button-selected"),$(n).removeClass("focused")},$(n).append(''),t=document.getElementById(e+"_wysiwyg"),$(t).on("input",function(){FormDataWasChanged=FormDataWasChanged||!0}),t.innerHTML=HtmlFixEditorHtml(HtmlDecode(s)),$(t).val(HtmlFixEditorHtml(HtmlDecode(s))),o.content.innerHTML=HtmlFixEditorHtml(HtmlDecode(s))})}function MakeTextAreasTmplEditor(){$("textarea.tmpl-editor").each(function(){var t=$(this)[0],e=$(this).data("emode"),i="text/html";"js"==e?i="javascript":"css"==e&&(i="css"),CodeMirror.fromTextArea(t,{lineNumbers:!0,lineWrapping:!0,viewportMargin:1/0,mode:i}).on("change",function(e){t.value=e.getValue()})})}function MakeTextAreasNotReactOnTab(){$("textarea.use-tab-key").each(function(){$(this).keydown(function(e){if(9===e.keyCode){var t=this.selectionStart,i=this.selectionEnd,s=$(this),n=s.val();s.val(n.substring(0,t)+"\t"+n.substring(i)),this.selectionStart=this.selectionEnd=t+1,e.preventDefault(),FormDataWasChanged=FormDataWasChanged||!0}})})}function Initialize(){"function"==typeof $?(AllFormsToAjax(),BindWindowBeforeUnload(),MakeTextAreasAutoSized(),MakeTextAreasWysiwyg(),MakeTextAreasTmplEditor(),MakeTextAreasNotReactOnTab()):console.log("Error: jQuery is not loaded!")}return window.addEventListener?window.addEventListener("load",Initialize,!1):window.attachEvent&&window.attachEvent("onload",Initialize),{ShowMsgSuccess:function(e,t){ShowSystemMsg(e,t,!1)},ShowMsgError:function(e,t){ShowSystemMsg(e,t,!0)},FormDataWasChanged:function(){PreventDataLost()},ModalUserProfile:function(){var e='';$("#sys-modal-user-settings-placeholder").html(e),$("#sys-modal-user-settings").modal({backdrop:"static",keyboard:!1,show:!1}),$("#sys-modal-user-settings").on("hidden.bs.modal",function(e){$("#sys-modal-user-settings-placeholder").html("")}),FormToAjax($("#sys-modal-user-settings form")),$("#sys-modal-user-settings").modal("show")},ShopProductsAdd:function(){var selText=$("#lbl_attributes option:selected").text(),selValue=$("#lbl_attributes").val();"0"!=selValue&&($("#lbl_attributes")[0].selectedIndex=0,$("#lbl_attributes").selectpicker("refresh"),0<$("#prod_attr_"+selValue).length||($("#list").append('
'+selText+'
'),PreventDataLost(),$.ajax({type:"POST",url:"/cp/",data:{action:"shop-get-attribute-values",id:selValue}}).done(function(data){try{eval(data)}catch(e){e instanceof SyntaxError&&(console.log(data),console.log("Error: JavaScript code eval error",e.message))}}).fail(function(xhr,status,error){$("#prod_attr_"+selValue).remove();try{eval(xhr.responseText)}catch(e){e instanceof SyntaxError&&(console.log(xhr.responseText),console.log("Error: JavaScript code eval error",e.message))}})))},ShopProductsRemove:function(e){$(e).parent().parent().remove(),PreventDataLost()},ShopAttributesAdd:function(){$("#list").append('
'),PreventDataLost(),setTimeout(function(){$("#list input").last().focus()},100)},ShopAttributesRemove:function(e){$(e).parent().remove(),PreventDataLost()},ShopProductsUploadImage:function(action_name,product_id,input_id){var fd=new FormData;fd.append("action",action_name),fd.append("id",product_id),fd.append("file",$("#"+input_id)[0].files[0]),$.ajax({url:"/cp/",method:"POST",type:"POST",data:fd,contentType:!1,processData:!1}).done(function(data){try{eval(data)}catch(e){e instanceof SyntaxError&&(console.log(data),console.log("Error: JavaScript code eval error",e.message))}}).fail(function(xhr,status,error){try{eval(xhr.responseText)}catch(e){e instanceof SyntaxError&&(console.log(xhr.responseText),console.log("Error: JavaScript code eval error",e.message))}})},ShopProductsDeleteImage:function(e,t,i){$.ajax({type:"POST",url:"/cp/",data:{action:"shop-upload-delete",id:t,file:i}}).done(function(e){IsDebugMode()&&console.log("done",e),AjaxDone(e)}).fail(function(e,t,i){IsDebugMode()&&console.log("fail",e,t,i),AjaxFail(e.responseText,t,i)})},ActionLogout:function(e){confirm(e)&&$.ajax({type:"POST",url:"/cp/",data:{action:"index-user-logout"}}).done(function(e){IsDebugMode()&&console.log("done",e),AjaxDone(e)}).fail(function(e,t,i){IsDebugMode()&&console.log("fail",e,t,i),AjaxFail(e.responseText,t,i)})},ActionDataTableDelete:function(e,t,i,s){confirm(s)&&$.ajax({type:"POST",url:"/cp/",data:{action:t,id:i}}).done(function(e){IsDebugMode()&&console.log("done",e),AjaxDone(e)}).fail(function(e,t,i){IsDebugMode()&&console.log("fail",e,t,i),AjaxFail(e.responseText,t,i)})},ActionRestoreThemeFile:function(e,t,i){return confirm(i)&&$.ajax({type:"POST",url:"/cp/",data:{action:e,file:t}}).done(function(e){IsDebugMode()&&console.log("done",e),AjaxDone(e)}).fail(function(e,t,i){IsDebugMode()&&console.log("fail",e,t,i),AjaxFail(e.responseText,t,i)}),!1}}}(window,$);window.fave=fave}(window,jQuery);`)