admin-general.js 6.98 KB
!function(t){var e={};function i(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(n,o,function(e){return t[e]}.bind(null,o));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=53)}({1:function(t,e){t.exports=jQuery},10:function(t,e,i){"use strict";var n=i(7);e.a=class{constructor(){this.init()}init(){Object(n.b)()}}},22:function(t,e,i){"use strict";i.d(e,"a",(function(){return c}));var n=i(10);const o=i(1);class s{constructor(t){this.element=t,this.settings=this.getDefaults(),this.init(),this.setInitialized()}setInitialized(){r.add(this.element)}getDefaults(){return{width:this.element.getAttribute("data-width")?this.element.getAttribute("data-width"):250,noclick:!!this.element.getAttribute("data-noclick")&&this.element.getAttribute("data-noclick"),position:this.getPosition()}}isInitialized(){return r.isInitialized(this.element)}init(){this.isInitialized()||(o(this.element).pointer({content:this.getRelatedHTML(),position:this.settings.position,pointerWidth:this.settings.width,pointerClass:this.getPointerClass()}),this.initEvents())}getPosition(){let t={at:"left top",my:"right top",edge:"right"},e=this.element.getAttribute("data-pos"),i=this.element.getAttribute("data-pos_edge");return"right"===e&&(t={at:"right middle",my:"left middle",edge:"left"}),"right_bottom"===e&&(t={at:"right middle",my:"left bottom",edge:"none"}),"left"===e&&(t={at:"left middle",my:"right middle",edge:"right"}),i&&(t.edge=i),t}getPointerClass(){let t=["ac-wp-pointer","wp-pointer","wp-pointer-"+this.settings.position.edge];return this.settings.noclick&&t.push("noclick"),t.join(" ")}getRelatedHTML(){let t=document.getElementById(this.element.getAttribute("rel"));return t?t.innerHTML:""}initEvents(){let t=o(this.element);this.settings.noclick||t.click((function(){t.hasClass("open")?t.removeClass("open"):t.addClass("open")})),t.click((function(){t.pointer("open")})),t.mouseenter((function(){t.pointer("open"),setTimeout(()=>{t.pointer("open")},2)})),t.mouseleave((function(){setTimeout(()=>{t.hasClass("open")||0!==o(".ac-wp-pointer.hover").length||t.pointer("close")},1)})),t.on("close",()=>{setTimeout(()=>{t.hasClass("open")||t.pointer("close")})})}}class r{static isInitialized(t){return this.initElements.filter(e=>e===t).length>0}static add(t){this.initElements.push(t)}}r.initElements=[];const c=(t=null)=>{t||(t=document.querySelectorAll(".ac-pointer")),t.forEach(t=>{new s(t)}),o(".ac-wp-pointer").hover((function(){o(this).addClass("hover")}),(function(){o(this).removeClass("hover"),o(".ac-pointer").trigger("close")})).on("click",".close",(function(){o(".ac-pointer").removeClass("open")})),new n.a}},46:function(t,e,i){var n,o;
/*!
 * JavaScript Cookie v2.2.1
 * https://github.com/js-cookie/js-cookie
 *
 * Copyright 2006, 2015 Klaus Hartl & Fagner Brack
 * Released under the MIT license
 */!function(s){if(void 0===(o="function"==typeof(n=s)?n.call(e,i,e,t):n)||(t.exports=o),!0,t.exports=s(),!!0){var r=window.Cookies,c=window.Cookies=s();c.noConflict=function(){return window.Cookies=r,c}}}((function(){function t(){for(var t=0,e={};t<arguments.length;t++){var i=arguments[t];for(var n in i)e[n]=i[n]}return e}function e(t){return t.replace(/(%[0-9A-Z]{2})+/g,decodeURIComponent)}return function i(n){function o(){}function s(e,i,s){if("undefined"!=typeof document){"number"==typeof(s=t({path:"/"},o.defaults,s)).expires&&(s.expires=new Date(1*new Date+864e5*s.expires)),s.expires=s.expires?s.expires.toUTCString():"";try{var r=JSON.stringify(i);/^[\{\[]/.test(r)&&(i=r)}catch(t){}i=n.write?n.write(i,e):encodeURIComponent(String(i)).replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g,decodeURIComponent),e=encodeURIComponent(String(e)).replace(/%(23|24|26|2B|5E|60|7C)/g,decodeURIComponent).replace(/[\(\)]/g,escape);var c="";for(var l in s)s[l]&&(c+="; "+l,!0!==s[l]&&(c+="="+s[l].split(";")[0]));return document.cookie=e+"="+i+c}}function r(t,i){if("undefined"!=typeof document){for(var o={},s=document.cookie?document.cookie.split("; "):[],r=0;r<s.length;r++){var c=s[r].split("="),l=c.slice(1).join("=");i||'"'!==l.charAt(0)||(l=l.slice(1,-1));try{var a=e(c[0]);if(l=(n.read||n)(l,a)||e(l),i)try{l=JSON.parse(l)}catch(t){}if(o[a]=l,t===a)break}catch(t){}}return t?o[t]:o}}return o.set=s,o.get=function(t){return r(t,!1)},o.getJSON=function(t){return r(t,!0)},o.remove=function(e,i){s(e,"",t(i,{expires:-1}))},o.defaults={},o.withConverter=i,o}((function(){}))}))},53:function(t,e,i){"use strict";i.r(e);let n=i(46);class o{constructor(t){this.element=t,this.init()}init(){if(this.element.classList.contains("-closable")){const t=this.element.querySelector(".ac-section__header");if(t&&t.addEventListener("click",()=>{this.toggle()}),this.isStorable()){let t=n.get(this.getCookieKey());void 0!==t&&(1===parseInt(t)?this.open:this.close())}}}getCookieKey(){return"ac-section_"+this.getSectionId()}getSectionId(){return this.element.dataset.section}isStorable(){return void 0!==this.element.dataset.section}toggle(){this.isOpen()?this.close():this.open()}isOpen(){return!this.element.classList.contains("-closed")}open(){this.element.classList.remove("-closed"),this.isStorable()&&n.set(this.getCookieKey(),1)}close(){this.element.classList.add("-closed"),this.isStorable()&&n.set(this.getCookieKey(),0)}}var s=i(22);const r=i(1);r(document).ready(()=>{Object(s.a)(),document.querySelectorAll(".ac-section").forEach(t=>{new o(t)}),r(document).on("select2:open",()=>{let t=document.querySelector(".select2-container--open .select2-search__field");t&&t.focus()})})},7:function(t,e,i){"use strict";i.d(e,"b",(function(){return n})),i.d(e,"a",(function(){return o}));const n=()=>{document.querySelectorAll("[data-ac-tip]").forEach(t=>{new o(t)})};class o{constructor(t,e=""){this.element=t,this.content=e||t.dataset.acTip,this.tip=s(this.content),this.initEvents()}initEvents(){"1"!==this.element.dataset.acTooltipInit&&(this.element.dataset.acTooltipInit="1",document.body.appendChild(this.tip),this.element.addEventListener("mouseenter",()=>{const t=document.body.getBoundingClientRect(),e=this.element.getBoundingClientRect();this.tip.style.left=e.left-t.left+this.element.offsetWidth/2+"px",this.tip.style.top=e.top-t.top+this.element.offsetHeight+"px",this.tip.classList.add("hover")}),this.element.addEventListener("mouseleave",()=>{this.tip.classList.remove("hover")}))}}const s=t=>{let e=document.createElement("div");return e.classList.add("ac-tooltip"),e.innerHTML=t,e}}});