AlkantarClanX12

Your IP : 3.133.117.107


Current Path : /home/thanudqk/128shen.com/wp-content/plugins/tablepress/admin/js/build/
Upload File :
Current File : /home/thanudqk/128shen.com/wp-content/plugins/tablepress/admin/js/build/jsuites.js

(()=>{var e;window.jSuites=(function(){var t={195:function(e){e.exports=function(e){function t(e,t){this.highOrder=e,this.lowOrder=t}var n,i,o,a,s,r,l,d,c,u,p=[new t(1779033703,4089235720),new t(3144134277,2227873595),new t(1013904242,4271175723),new t(2773480762,1595750129),new t(1359893119,2917565137),new t(2600822924,725511199),new t(528734635,4215389547),new t(1541459225,327033209)],f=[new t(1116352408,3609767458),new t(1899447441,602891725),new t(3049323471,3964484399),new t(3921009573,2173295548),new t(961987163,4081628472),new t(1508970993,3053834265),new t(2453635748,2937671579),new t(2870763221,3664609560),new t(3624381080,2734883394),new t(310598401,1164996542),new t(607225278,1323610764),new t(1426881987,3590304994),new t(1925078388,4068182383),new t(2162078206,991336113),new t(2614888103,633803317),new t(3248222580,3479774868),new t(3835390401,2666613458),new t(4022224774,944711139),new t(264347078,2341262773),new t(604807628,2007800933),new t(770255983,1495990901),new t(1249150122,1856431235),new t(1555081692,3175218132),new t(1996064986,2198950837),new t(2554220882,3999719339),new t(2821834349,766784016),new t(2952996808,2566594879),new t(3210313671,3203337956),new t(3336571891,1034457026),new t(3584528711,2466948901),new t(113926993,3758326383),new t(338241895,168717936),new t(666307205,1188179964),new t(773529912,1546045734),new t(1294757372,1522805485),new t(1396182291,2643833823),new t(1695183700,2343527390),new t(1986661051,1014477480),new t(2177026350,1206759142),new t(2456956037,344077627),new t(2730485921,1290863460),new t(2820302411,3158454273),new t(3259730800,3505952657),new t(3345764771,106217008),new t(3516065817,3606008344),new t(3600352804,1432725776),new t(4094571909,1467031594),new t(275423344,851169720),new t(430227734,3100823752),new t(506948616,1363258195),new t(659060556,3750685593),new t(883997877,3785050280),new t(958139571,3318307427),new t(1322822218,3812723403),new t(1537002063,2003034995),new t(1747873779,3602036899),new t(1955562222,1575990012),new t(2024104815,1125592928),new t(2227730452,2716904306),new t(2361852424,442776044),new t(2428436474,593698344),new t(2756734187,3733110249),new t(3204031479,2999351573),new t(3329325298,3815920427),new t(3391569614,3928383900),new t(3515267271,566280711),new t(3940187606,3454069534),new t(4118630271,4000239992),new t(116418474,1914138554),new t(174292421,2731055270),new t(289380356,3203993006),new t(460393269,320620315),new t(685471733,587496836),new t(852142971,1086792851),new t(1017036298,365543100),new t(1126000580,2618297676),new t(1288033470,3409855158),new t(1501505948,4234509866),new t(1607167915,987167468),new t(1816402316,1246189591)],h=new Array(64),m=8;function v(e){return unescape(encodeURIComponent(e))}function g(e){for(var t=[],n=(1<<m)-1,i=e.length*m,o=0;o<i;o+=m)t[o>>5]|=(e.charCodeAt(o/m)&n)<<32-m-o%32;return t}function y(e){for(var t,n="0123456789abcdef",i="",o=4*e.length,a=0;a<o;a+=1)t=e[a>>2]>>8*(3-a%4),i+=n.charAt(t>>4&15)+n.charAt(15&t);return i}function b(e,n){var i,o,a;return i=(65535&e.lowOrder)+(65535&n.lowOrder),a=(65535&(o=(e.lowOrder>>>16)+(n.lowOrder>>>16)+(i>>>16)))<<16|65535&i,i=(65535&e.highOrder)+(65535&n.highOrder)+(o>>>16),new t((65535&(o=(e.highOrder>>>16)+(n.highOrder>>>16)+(i>>>16)))<<16|65535&i,a)}function x(e,n,i,o){var a,s,r;return a=(65535&e.lowOrder)+(65535&n.lowOrder)+(65535&i.lowOrder)+(65535&o.lowOrder),r=(65535&(s=(e.lowOrder>>>16)+(n.lowOrder>>>16)+(i.lowOrder>>>16)+(o.lowOrder>>>16)+(a>>>16)))<<16|65535&a,a=(65535&e.highOrder)+(65535&n.highOrder)+(65535&i.highOrder)+(65535&o.highOrder)+(s>>>16),new t((65535&(s=(e.highOrder>>>16)+(n.highOrder>>>16)+(i.highOrder>>>16)+(o.highOrder>>>16)+(a>>>16)))<<16|65535&a,r)}function w(e,n,i,o,a){var s,r,l;return s=(65535&e.lowOrder)+(65535&n.lowOrder)+(65535&i.lowOrder)+(65535&o.lowOrder)+(65535&a.lowOrder),l=(65535&(r=(e.lowOrder>>>16)+(n.lowOrder>>>16)+(i.lowOrder>>>16)+(o.lowOrder>>>16)+(a.lowOrder>>>16)+(s>>>16)))<<16|65535&s,s=(65535&e.highOrder)+(65535&n.highOrder)+(65535&i.highOrder)+(65535&o.highOrder)+(65535&a.highOrder)+(r>>>16),new t((65535&(r=(e.highOrder>>>16)+(n.highOrder>>>16)+(i.highOrder>>>16)+(o.highOrder>>>16)+(a.highOrder>>>16)+(s>>>16)))<<16|65535&s,l)}function L(e,n,i){return new t(e.highOrder&n.highOrder^e.highOrder&i.highOrder^n.highOrder&i.highOrder,e.lowOrder&n.lowOrder^e.lowOrder&i.lowOrder^n.lowOrder&i.lowOrder)}function j(e,n,i){return new t(e.highOrder&n.highOrder^~e.highOrder&i.highOrder,e.lowOrder&n.lowOrder^~e.lowOrder&i.lowOrder)}function E(e,n){return n<=32?new t(e.highOrder>>>n|e.lowOrder<<32-n,e.lowOrder>>>n|e.highOrder<<32-n):new t(e.lowOrder>>>n|e.highOrder<<32-n,e.highOrder>>>n|e.lowOrder<<32-n)}function C(e){var n=E(e,28),i=E(e,34),o=E(e,39);return new t(n.highOrder^i.highOrder^o.highOrder,n.lowOrder^i.lowOrder^o.lowOrder)}function T(e){var n=E(e,14),i=E(e,18),o=E(e,41);return new t(n.highOrder^i.highOrder^o.highOrder,n.lowOrder^i.lowOrder^o.lowOrder)}function k(e){var n=E(e,1),i=E(e,8),o=M(e,7);return new t(n.highOrder^i.highOrder^o.highOrder,n.lowOrder^i.lowOrder^o.lowOrder)}function A(e){var n=E(e,19),i=E(e,61),o=M(e,6);return new t(n.highOrder^i.highOrder^o.highOrder,n.lowOrder^i.lowOrder^o.lowOrder)}function M(e,n){return n<=32?new t(e.highOrder>>>n,e.lowOrder>>>n|e.highOrder<<32-n):new t(0,e.highOrder<<32-n)}var D=(e=v(e)).length*m;(e=g(e))[D>>5]|=128<<24-D%32,e[31+(D+128>>10<<5)]=D;for(var N=0;N<e.length;N+=32){n=p[0],i=p[1],o=p[2],a=p[3],s=p[4],r=p[5],l=p[6],d=p[7];for(var O=0;O<80;O++)h[O]=O<16?new t(e[2*O+N],e[2*O+N+1]):x(A(h[O-2]),h[O-7],k(h[O-15]),h[O-16]),c=w(d,T(s),j(s,r,l),f[O],h[O]),u=b(C(n),L(n,i,o)),d=l,l=r,r=s,s=b(a,c),a=o,o=i,i=n,n=b(c,u);p[0]=b(n,p[0]),p[1]=b(i,p[1]),p[2]=b(o,p[2]),p[3]=b(a,p[3]),p[4]=b(s,p[4]),p[5]=b(r,p[5]),p[6]=b(l,p[6]),p[7]=b(d,p[7])}var I=[];for(N=0;N<p.length;N++)I.push(p[N].highOrder),I.push(p[N].lowOrder);return y(I)}}},n={};function i(e){var o=n[e];if(void 0!==o)return o.exports;var a=n[e]={exports:{}};return t[e].call(a.exports,a,a.exports,i),a.exports}i.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return i.d(t,{a:t}),t},i.d=function(e,t){for(var n in t)i.o(t,n)&&!i.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},i.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};!function(){"use strict";i.d(o,{default:function(){return P}});var e={two:function(e){return 1==(e=""+e).length&&(e="0"+e),e},focus:function(e){if(e.innerText.length){var t=document.createRange(),n=window.getSelection(),i=e.childNodes[e.childNodes.length-1];t.setStart(i,i.length),t.collapse(!0),n.removeAllRanges(),n.addRange(t),e.scrollLeft=e.scrollWidth}},isNumeric:function(e){return"string"==typeof e&&(e=e.trim()),!isNaN(e)&&null!==e&&""!==e},guid:function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}))},getNode:function(){var e=document.getSelection().anchorNode;return e?3==e.nodeType?e.parentNode:e:null},hash:function(e){var t,n,i=0;if(0===e.length)return i;for(t=0;t<e.length;t++)(n=e.charCodeAt(t))>32&&(i=(i<<5)-i+n,i|=0);return i},randomColor:function(t){var n=String("#"+Math.random().toString(16).slice(2,8).toUpperCase()).replace(/[^0-9a-f]/gi,"");n.length<6&&(n=n[0]+n[0]+n[1]+n[1]+n[2]+n[2]);var i,o,a=[];for(o=0;o<3;o++)i=parseInt(n.substr(2*o,2),16),i=Math.round(Math.min(Math.max(0,i+-.25*i),255)).toString(16),a.push(("00"+i).substr(i.length));return 1==t?"#"+e.two(a[0].toString(16))+e.two(a[1].toString(16))+e.two(a[2].toString(16)):a},getWindowWidth:function(){var e=window,t=document,n=t.documentElement,i=t.getElementsByTagName("body")[0];return e.innerWidth||n.clientWidth||i.clientWidth},getWindowHeight:function(){var e=window,t=document,n=t.documentElement,i=t.getElementsByTagName("body")[0];return e.innerHeight||n.clientHeight||i.clientHeight},getPosition:function(e){if(e.changedTouches&&e.changedTouches[0])var t=e.changedTouches[0].pageX,n=e.changedTouches[0].pageY;else t=window.Event?e.pageX:e.clientX+(document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft),n=window.Event?e.pageY:e.clientY+(document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop);return[t,n]},click:function(e){if(e.click)e.click();else{var t=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});e.dispatchEvent(t)}},findElement:function(e,t){var n=!1;return function e(i){i&&!n&&("function"==typeof t?n=t(i):"string"==typeof t&&i.classList&&i.classList.contains(t)&&(n=i)),i.parentNode&&!n&&e(i.parentNode)}(e),n}},t=e;var n,a,s,r,l=(n={now:function(e,n){var i=null,o=null,a=null,s=null,r=null,l=null;return Array.isArray(e)?(i=e[0],o=e[1],a=e[2],s=e[3],r=e[4],l=e[5]):(e||(e=new Date),i=e.getFullYear(),o=e.getMonth()+1,a=e.getDate(),s=e.getHours(),r=e.getMinutes(),l=e.getSeconds()),1==n?t.two(i)+"-"+t.two(o)+"-"+t.two(a):t.two(i)+"-"+t.two(o)+"-"+t.two(a)+" "+t.two(s)+":"+t.two(r)+":"+t.two(l)},toArray:function(e){var t=(n=e.split(-1!==e.indexOf("T")?"T":" "))[1],n=n[0].split("-"),i=parseInt(n[0]),o=parseInt(n[1]),a=parseInt(n[2]),s=0,r=0;return t&&(t=t.split(":"),s=parseInt(t[0]),r=parseInt(t[1])),[i,o,a,s,r,0]}},a=Date.UTC(1900,0,0),s=Date.UTC(1900,1,29),r=864e5,n.dateToNum=function(e){"string"==typeof e&&(e=new Date(e+"  GMT+0"));var t=e.getTime();return t>=s&&(t+=r),(t-=a)/r},n.numToDate=function(e){var t=a+e*r;t>=s&&(t-=r);const i=new Date(t);var o=[i.getUTCFullYear(),i.getUTCMonth()+1,i.getUTCDate(),i.getUTCHours(),i.getUTCMinutes(),i.getUTCSeconds()];return n.now(o)},n.weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],n.months=["January","February","March","April","May","June","July","August","September","October","November","December"],n.weekdaysShort=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],n.monthsShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],n),d=function(e){return"undefined"!=typeof document&&document.dictionary&&document.dictionary[e]||e},c={setDictionary:function(e){document.dictionary||(document.dictionary={});var t=null,n=null,i=Object.keys(e);for(n=0;n<i.length;n++)document.dictionary[i[n]]=e[i[n]];for(n=0;n<l.weekdays.length;n++)t=d(l.weekdays[n]),l.weekdays[n]&&(l.weekdays[n]=t,l.weekdaysShort[n]=t.substr(0,3));for(n=0;n<l.months.length;n++)(t=d(l.months[n]))&&(l.months[n]=t,l.monthsShort[n]=t.substr(0,3))},translate:d};const u=function(e,t){if(!0===t)u.state=u.state.filter((function(e){return null!==e})),setTimeout((function(){u.state.push(e)}),0);else{var n=u.state.indexOf(e);n>=0&&u.state.splice(n,1)}};var p=u;function f(e,t,n){if((e=e.split(".")).length){let i=this,o=null;for(;e.length>1;)if(o=e.shift(),i.hasOwnProperty(o))i=i[o];else{if(void 0===t)return;i[o]={},i=i[o]}if(o=e.shift(),void 0!==t)return!0===n?delete i[o]:i[o]=t,!0;if(i)return i[o]}return!1}function h(e,t){var n={options:{}},i={pointer:null,direction:null,ondragstart:null,ondragend:null,ondrop:null},o=null;for(var a in i)t&&t.hasOwnProperty(a)?n.options[a]=t[a]:n.options[a]=i[a];e.classList.add("jsorting"),e.addEventListener("dragstart",(function(t){let i=t.target;if(3===i.nodeType){if("true"!==i.parentNode.getAttribute("draggable"))return t.preventDefault(),void t.stopPropagation();i=i.parentNode}if("true"===i.getAttribute("draggable")){let a=Array.prototype.indexOf.call(i.parentNode.children,i);o={element:i,o:a,d:a},i.style.opacity="0.25","function"==typeof n.options.ondragstart&&n.options.ondragstart(e,i,t),t.dataTransfer.setDragImage(i,0,0)}})),e.addEventListener("dragover",(function(e){if(e.preventDefault(),o&&s(e.target)&&"true"==e.target.getAttribute("draggable")&&o.element!=e.target){if(n.options.direction)t=e.target.clientWidth/2>e.offsetX;else var t=e.target.clientHeight/2>e.offsetY;t?e.target.parentNode.insertBefore(o.element,e.target):e.target.parentNode.insertBefore(o.element,e.target.nextSibling),o.d=Array.prototype.indexOf.call(e.target.parentNode.children,o.element)}})),e.addEventListener("dragleave",(function(e){e.preventDefault()})),e.addEventListener("dragend",(function(t){t.preventDefault(),o&&("function"==typeof n.options.ondragend&&n.options.ondragend(e,o.element,t),o.o<o.d?t.target.parentNode.insertBefore(o.element,t.target.parentNode.children[o.o]):t.target.parentNode.insertBefore(o.element,t.target.parentNode.children[o.o].nextSibling),o.element.style.opacity="",o=null)})),e.addEventListener("drop",(function(t){t.preventDefault(),o&&(o.o!==o.d&&"function"==typeof n.options.ondrop&&n.options.ondrop(e,o.o,o.d,o.element,t.target,t),o.element.style.opacity="",o=null)}));for(var s=function(e){var t=!1;return function e(n){n.className&&n.classList.contains("jsorting")&&(t=!0),t||e(n.parentNode)}(e),t},r=0;r<e.children.length;r++)e.children[r].hasAttribute("draggable")||e.children[r].setAttribute("draggable","true");return e.val=function(){for(var t=null,n=[],i=0;i<e.children.length;i++)(t=e.children[i].getAttribute("data-id"))&&n.push(t);return n},e}function m(e,t){t.loadUp&&"function"==typeof t.loadUp||(t.loadUp=function(){return!1}),t.loadDown&&"function"==typeof t.loadDown||(t.loadDown=function(){return!1}),t.timer||(t.timer=100);var n=null,i=function(i){if(null==n){var o=!1,a=e.scrollTop;e.scrollTop+2*e.clientHeight>=e.scrollHeight?t.loadDown()&&(a==e.scrollTop&&(e.scrollTop=e.scrollTop-e.clientHeight),o=!0):e.scrollTop<=e.clientHeight&&t.loadUp()&&(a==e.scrollTop&&(e.scrollTop=e.scrollTop+e.clientHeight),o=!0),n=setTimeout((function(){n=null}),t.timer),o&&"function"==typeof t.onupdate&&t.onupdate()}};return e.onscroll=function(e){i()},e.onwheel=function(e){i()},{}}var v=function(){var e=function(t,n){if(Array.isArray(t)){var i={instance:[],complete:n};if(t.length>0)for(var o=0;o<t.length;o++)t[o].multiple=i,i.instance.push(e(t[o]));return i}if(t.data||(t.data={}),t.type&&(t.method=t.type),t.method||(t.method="GET"),t.dataType||(t.dataType="json"),t.data){var a=function(e,t){var n=[];if(e){var i=Object.keys(e);if(i.length)for(var o=0;o<i.length;o++){if(t)var s=t+"["+i[o]+"]";else s=i[o];if(e[s]instanceof FileList)n[s]=e[i[o]];else if(null===e[i[o]]||void 0===e[i[o]])n[s]="";else if("object"==typeof e[i[o]])for(var r=a(e[i[o]],s),l=Object.keys(r),d=0;d<l.length;d++)n[l[d]]=r[l[d]];else n[s]=e[i[o]]}}return n},s=a(t.data),r=Object.keys(s);if("GET"==t.method){if(r.length){var l=[];for(o=0;o<r.length;o++)l.push(r[o]+"="+encodeURIComponent(s[r[o]]));t.url.indexOf("?")<0&&(t.url+="?"),t.url+=l.join("&")}}else for(l=new FormData,o=0;o<r.length;o++)if(s[r[o]]instanceof FileList){if(s[r[o]].length)for(var d=0;d<s[r[o]].length;d++)l.append(r[o],s[r[o]][d],s[r[o]][d].name)}else l.append(r[o],s[r[o]])}var c=new XMLHttpRequest;return c.open(t.method,t.url,!0),c.setRequestHeader("X-Requested-With","XMLHttpRequest"),t.contentType&&c.setRequestHeader("Content-Type",t.contentType),"POST"===t.method?c.setRequestHeader("Accept","application/json"):"blob"===t.dataType?c.responseType="blob":t.contentType||("json"===t.dataType?c.setRequestHeader("Content-Type","text/json"):"html"===t.dataType&&c.setRequestHeader("Content-Type","text/html")),!0!==t.cache&&(c.setRequestHeader("pragma","no-cache"),c.setRequestHeader("cache-control","no-cache")),!0===t.withCredentials&&(c.withCredentials=!0),"function"==typeof t.beforeSend&&t.beforeSend(c),"function"==typeof e.beforeSend&&e.beforeSend(c),document.ajax&&"function"==typeof document.ajax.beforeSend&&document.ajax.beforeSend(c),c.onload=function(){if(c.status>=200&&c.status<300)if("json"===t.dataType)try{var n=JSON.parse(c.responseText);t.success&&"function"==typeof t.success&&t.success(n)}catch(e){t.error&&"function"==typeof t.error&&t.error(e,n)}else n="blob"===t.dataType?c.response:c.responseText,t.success&&"function"==typeof t.success&&t.success(n);else t.error&&"function"==typeof t.error&&t.error(c.responseText,c.status);if(e.queue&&e.queue.length>0&&e.send(e.queue.shift()),e.requests&&e.requests.length){var i=e.requests.indexOf(c);e.requests.splice(i,1),e.requests.length||t.complete&&"function"==typeof t.complete&&t.complete(n),t.group&&e.oncomplete&&"function"==typeof e.oncomplete[t.group]&&(e.pending(t.group)||(e.oncomplete[t.group](),e.oncomplete[t.group]=null)),t.multiple&&t.multiple.instance&&(i=t.multiple.instance.indexOf(c),t.multiple.instance.splice(i,1),t.multiple.instance.length||t.multiple.complete&&"function"==typeof t.multiple.complete&&t.multiple.complete(n))}},c.options=t,c.data=l,!0===t.queue&&e.requests.length>0?e.queue.push(c):e.send(c),c};return e.send=function(t){t.data?Array.isArray(t.data)?t.send(t.data.join("&")):t.send(t.data):t.send(),e.requests.push(t)},e.exists=function(e,t){var n=new XMLHttpRequest;n.open("HEAD",e,!1),n.send(),n.status&&t(n.status)},e.pending=function(t){var n=0,i=e.requests;if(i&&i.length)for(var o=0;o<i.length;o++)t&&t!=i[o].options.group||n++;return n},e.oncomplete={},e.requests=[],e.queue=[],e}();var g=function(){const e={loading:{}};return e.loading.show=function(t){e.loading.element||(e.loading.element=document.createElement("div"),e.loading.element.className="jloading"),document.body.appendChild(e.loading.element),t>0&&setTimeout((function(){e.loading.hide()}),1e3*t)},e.loading.hide=function(){e.loading.element&&e.loading.element.parentNode&&document.body.removeChild(e.loading.element)},e.slideLeft=function(e,t,n){1==t?(e.classList.add("jslide-left-in"),setTimeout((function(){e.classList.remove("jslide-left-in"),"function"==typeof n&&n()}),400)):(e.classList.add("jslide-left-out"),setTimeout((function(){e.classList.remove("jslide-left-out"),"function"==typeof n&&n()}),400))},e.slideRight=function(e,t,n){!0===t?(e.classList.add("jslide-right-in"),setTimeout((function(){e.classList.remove("jslide-right-in"),"function"==typeof n&&n()}),400)):(e.classList.add("jslide-right-out"),setTimeout((function(){e.classList.remove("jslide-right-out"),"function"==typeof n&&n()}),400))},e.slideTop=function(e,t,n){!0===t?(e.classList.add("jslide-top-in"),setTimeout((function(){e.classList.remove("jslide-top-in"),"function"==typeof n&&n()}),400)):(e.classList.add("jslide-top-out"),setTimeout((function(){e.classList.remove("jslide-top-out"),"function"==typeof n&&n()}),400))},e.slideBottom=function(e,t,n){!0===t?(e.classList.add("jslide-bottom-in"),setTimeout((function(){e.classList.remove("jslide-bottom-in"),"function"==typeof n&&n()}),400)):(e.classList.add("jslide-bottom-out"),setTimeout((function(){e.classList.remove("jslide-bottom-out"),"function"==typeof n&&n()}),100))},e.fadeIn=function(e,t){e.style.display="",e.classList.add("jfade-in"),setTimeout((function(){e.classList.remove("jfade-in"),"function"==typeof t&&t()}),2e3)},e.fadeOut=function(e,t){e.classList.add("jfade-out"),setTimeout((function(){e.style.display="none",e.classList.remove("jfade-out"),"function"==typeof t&&t()}),1e3)},e}();var b=function(){var e={text:["@"],currency:["#(.{1})##0?(.{1}0+)?( ?;(.*)?)?","#"],percentage:["0{1}(.{1}0+)?%"],numeric:["0{1}(.{1}0+)?"],datetime:["YYYY","YYY","YY","MMMMM","MMMM","MMM","MM","DDDDD","DDDD","DDD","DD","DY","DAY","WD","D","Q","MONTH","MON","HH24","HH12","HH","\\[H\\]","H","AM/PM","MI","SS","MS","Y","M"],general:["A","0","[0-9a-zA-Z$]+","."]},n=function(){if(-1!==this.mask.toLowerCase().indexOf("[h]")){var e=0;this.date[4]&&(e=parseFloat(this.date[4]/60));var n=parseInt(this.date[3])+e;n/=24}else this.date[0]&&this.date[1]&&this.date[2]||!this.date[3]&&!this.date[4]?(this.date[0]&&this.date[1]&&!this.date[2]&&(this.date[2]=1),n=t.two(this.date[0])+"-"+t.two(this.date[1])+"-"+t.two(this.date[2]),(this.date[3]||this.date[4]||this.date[5])&&(n+=" "+t.two(this.date[3])+":"+t.two(this.date[4])+":"+t.two(this.date[5]))):n=t.two(this.date[3])+":"+t.two(this.date[4])+":"+t.two(this.date[5]);return n},i=function(){var e="";if(this.date[0]&&this.date[1]&&this.date[2]||!this.date[3]&&!this.date[4]){if(this.date[0]||this.date[1]||this.date[2]||this.date[3]||this.date[4]||this.date[5]){this.date[0]&&this.date[1]&&!this.date[2]&&(this.date[2]=1);var t=l.now(this.date);e=l.dateToNum(t),this.date[4]&&(e+=parseFloat(this.date[4]/60))}}else{if(-1!==this.mask.toLowerCase().indexOf("[h]"))e=parseInt(this.date[3]);else{let t=parseInt(this.date[3]);e=t<13&&-1!==this.values.indexOf("PM")?(t+12)%24:t%24}this.date[4]&&(e+=parseFloat(this.date[4]/60)),this.date[5]&&(e+=parseFloat(this.date[5]/3600)),e/=24}return isNaN(e)&&(e=""),e},o=function(e){return null===e||""===e||void 0===e},a=function(e){return"currency"===e||"percentage"===e||"numeric"===e},s=function(e){if(e&&Number(e)==e)return".";if(this.options.decimal)return this.options.decimal;if(this.locale){var t=Intl.NumberFormat(this.locale).format(1.1);return this.options.decimal=t[1]}return e||(e=this.mask),(t=new RegExp("0{1}(.{1})0+","ig").exec(e))&&t[1]&&1==t[1].length?(this.options.decimal=t[1],t[1]):((t=new RegExp("#{1}(.{1})#+","ig").exec(e))&&t[1]&&1==t[1].length?","===t[1]?this.options.decimal=".":this.options.decimal=",":this.options.decimal="1.1".toLocaleString().substring(1,2),this.options.decimal?this.options.decimal:null)},r=function(e,t){if(""==e)return"";t||(t=s.call(this));var n=(e=(""+e).split(t))[0].match(/[-]+/g);return n=!(!n||!n.length),e[0]=e[0].match(/[0-9]+/g),e[0]?(n&&e[0].unshift("-"),e[0]=e[0].join("")):n&&(e[0]="-"),e[0]||e[1]?(void 0!==e[1]&&(e[1]=e[1].match(/[0-9]+/g),e[1]?e[1]=e[1].join(""):e[1]=""),e):""},d=function(e,t){if(""===e)return"";var n=s.call(this),i=this.options;if(""===(e=r.call(this,e)))return"";var o=null;if(e[0]&&(o="percent"===i.style?parseFloat(e[0])/100:parseFloat(e[0]+".1")),("-"===e[0]||"-00"===e[0])&&!e[1]&&t&&"deleteContentBackward"==t.inputType)return"";var a=new Intl.NumberFormat(this.locale,i).format(o);if(a=a.split(n),"percent"===i.style&&-1!==a[0].indexOf("%")&&(a[0]=a[0].replace("%",""),a[2]="%"),void 0!==a[1]){var l=a[1].replace(/[0-9]*/g,"");l&&(a[2]=l)}return void 0!==e[1]?a[1]=n+e[1]:a[1]="",a.join("")},c=function(e,t){var n=f.call(e);if(n){var i=d.call(this,n,t),o=i.length-n.length,a=p.call(e)+o;f.call(e,i,a,!0)}},u=function(e){var t=r.call(this,e);return t?("-"===t[0]&&(t[0]="-0"),parseFloat(t.join("."))):null},p=function(e,t){if(void 0===e){if("DIV"==this.tagName){var n=0;return(s=window.getSelection())&&0!==s.rangeCount&&((o=(r=s.getRangeAt(0)).cloneRange()).selectNodeContents(this),o.setEnd(r.endContainer,r.endOffset),n=o.toString().length),n}return this.selectionStart}var i=f.call(this);if(t){for(var o=null,a=0;a<i.length;a++)(i[a].match(/[\-0-9]/g)||"."===i[a]||","===i[a])&&(o=a);null===o&&(o=i.indexOf(" ")),e>=o&&(e=o+1)}if(e>i.length&&(e=i.length),e)if("DIV"==this.tagName){var s=window.getSelection(),r=document.createRange();this.childNodes[0]&&(r.setStart(this.childNodes[0],e),s.removeAllRanges(),s.addRange(r))}else this.selectionStart=e,this.selectionEnd=e},f=function(e,t,n){if("DIV"==this.tagName){if(void 0===e)return e=this.innerText,this.value&&this.value.length>e.length&&(e=this.value),e;this.innerText!==e&&(this.innerText=e,t&&p.call(this,t,n))}else{if(void 0===e)return this.value;this.value!==e&&(this.value=e,t&&p.call(this,t,n))}},h=l.weekdays,m=l.weekdaysShort,v=l.months,g=l.monthsShort,y={YEAR:function(e,t){var n=""+(new Date).getFullYear();void 0===this.values[this.index]&&(this.values[this.index]=""),parseInt(e)>=0&&parseInt(e)<=10&&this.values[this.index].length<t&&(this.values[this.index]+=e),this.values[this.index].length==t&&(2==t?n=n.substr(0,2)+this.values[this.index]:3==t?n=n.substr(0,1)+this.values[this.index]:4==t&&(n=this.values[this.index]),this.date[0]=n,this.index++)},YYYY:function(e){y.YEAR.call(this,e,4)},YYY:function(e){y.YEAR.call(this,e,3)},YY:function(e){y.YEAR.call(this,e,2)},FIND:function(e,t){if(o(this.values[this.index])&&(this.values[this.index]=""),this.event&&this.event.inputType&&this.event.inputType.indexOf("delete")>-1)this.values[this.index]+=e;else{for(var n=0,i=0,a=(this.values[this.index]+e).toLowerCase(),s=0;s<t.length;s++)0==t[s].toLowerCase().indexOf(a)&&(n=s,i++);if(i>1)this.values[this.index]+=e;else if(1==i){var r=t[n].length-this.values[this.index].length-1;return this.position+=r,this.values[this.index]=t[n],this.index++,n}}},MMM:function(e){var t=y.FIND.call(this,e,g);void 0!==t&&(this.date[1]=t+1)},MON:function(e){y.MMM.call(this,e)},MMMM:function(e){var t=y.FIND.call(this,e,v);void 0!==t&&(this.date[1]=t+1)},MONTH:function(e){y.MMMM.call(this,e)},MMMMM:function(e){o(this.values[this.index])&&(this.values[this.index]="");for(var t=(this.values[this.index]+e).toLowerCase(),n=0;n<v.length;n++)if(0==v[n][0].toLowerCase().indexOf(t)){this.values[this.index]=v[n][0],this.date[1]=n+1,this.index++;break}},MM:function(e){o(this.values[this.index])?parseInt(e)>1&&parseInt(e)<10?(this.date[1]=this.values[this.index]="0"+e,this.index++):parseInt(e)<2&&(this.values[this.index]=e):(1==this.values[this.index]&&parseInt(e)<3||0==this.values[this.index]&&parseInt(e)>0&&parseInt(e)<10)&&(this.date[1]=this.values[this.index]+=e,this.index++)},M:function(e){var t=!1;if(parseInt(e)>=0&&parseInt(e)<10?o(this.values[this.index])?(this.values[this.index]=e,e>1&&(this.date[1]=this.values[this.index],this.index++)):1==this.values[this.index]&&parseInt(e)<3||0==this.values[this.index]&&parseInt(e)>0?(this.date[1]=this.values[this.index]+=e,this.index++):t=!0:t=!0,1==t){var n=parseInt(this.values[this.index]);n>0&&n<12&&(this.date[1]=this.values[this.index],this.index++,this.position--)}},D:function(e){var t=!1;if(parseInt(e)>=0&&parseInt(e)<10?o(this.values[this.index])?(this.values[this.index]=e,parseInt(e)>3&&(this.date[2]=this.values[this.index],this.index++)):3==this.values[this.index]&&parseInt(e)<2||1==this.values[this.index]||2==this.values[this.index]||0==this.values[this.index]&&parseInt(e)>0?(this.date[2]=this.values[this.index]+=e,this.index++):t=!0:t=!0,1==t){var n=parseInt(this.values[this.index]);n>0&&n<32&&(this.date[2]=this.values[this.index],this.index++,this.position--)}},DD:function(e){o(this.values[this.index])?parseInt(e)>3&&parseInt(e)<10?(this.date[2]=this.values[this.index]="0"+e,this.index++):parseInt(e)<10&&(this.values[this.index]=e):(3==this.values[this.index]&&parseInt(e)<2||(1==this.values[this.index]||2==this.values[this.index])&&parseInt(e)<10||0==this.values[this.index]&&parseInt(e)>0&&parseInt(e)<10)&&(this.date[2]=this.values[this.index]+=e,this.index++)},DDD:function(e){y.FIND.call(this,e,m)},DY:function(e){y.DDD.call(this,e)},DDDD:function(e){y.FIND.call(this,e,h)},DAY:function(e){y.DDDD.call(this,e)},HH12:function(e,t){o(this.values[this.index])?parseInt(e)>1&&parseInt(e)<10?(t&&(e=0+e),this.date[3]=this.values[this.index]=e,this.index++):parseInt(e)<10&&(this.values[this.index]=e):(1==this.values[this.index]&&parseInt(e)<3||this.values[this.index]<1&&parseInt(e)<10)&&(this.date[3]=this.values[this.index]+=e,this.index++)},HH24:function(e,t){parseInt(e)>=0&&parseInt(e)<10&&(null==this.values[this.index]||""==this.values[this.index]?parseInt(e)>2&&parseInt(e)<10?(t&&(e=0+e),this.date[3]=this.values[this.index]=e,this.index++):parseInt(e)<10&&(this.values[this.index]=e):(2==this.values[this.index]&&parseInt(e)<4||this.values[this.index]<2&&parseInt(e)<10)&&(t||"0"!==this.values[this.index]||(this.values[this.index]=""),this.date[3]=this.values[this.index]+=e,this.index++))},HH:function(e){y.HH24.call(this,e,1)},H:function(e){y.HH24.call(this,e,0)},"\\[H\\]":function(e){null==this.values[this.index]&&(this.values[this.index]=""),e.match(/[0-9]/g)?this.date[3]=this.values[this.index]+=e:this.values[this.index].match(/[0-9]/g)&&(this.date[3]=this.values[this.index],this.index++,this.position--)},N60:function(e,t){null==this.values[this.index]||""==this.values[this.index]?parseInt(e)>5&&parseInt(e)<10?(this.date[t]=this.values[this.index]="0"+e,this.index++):parseInt(e)<10&&(this.values[this.index]=e):parseInt(e)<10&&(this.date[t]=this.values[this.index]+=e,this.index++)},MI:function(e){y.N60.call(this,e,4)},SS:function(e){y.N60.call(this,e,5)},"AM/PM":function(e){void 0===this.values[this.index]&&(this.values[this.index]=""),""===this.values[this.index]?e.match(/a/i)&&this.date[3]<13?this.values[this.index]+="A":e.match(/p/i)&&(this.values[this.index]+="P"):"A"!==this.values[this.index]&&"P"!==this.values[this.index]||(this.values[this.index]+="M",this.index++)},WD:function(e){void 0===this.values[this.index]&&(this.values[this.index]=""),parseInt(e)>=0&&parseInt(e)<7&&(this.values[this.index]=e),1==this.values[this.index].length&&this.index++},"0{1}(.{1}0+)?":function(e){var t=s.call(this),n=!1;o(this.values[this.index])?this.values[this.index]="":"-"==this.values[this.index]&&(n=!0);var i=r.call(this,this.values[this.index],t);i&&(this.values[this.index]=i.join(t)),parseInt(e)>=0&&parseInt(e)<10?("0"==this.values[this.index]&&e>0?this.values[this.index]="":"-0"==this.values[this.index]&&e>0&&(this.values[this.index]="-"),("0"!=this.values[this.index]&&"-0"!=this.values[this.index]||e==t)&&(this.values[this.index]+=e)):t&&e==t?-1==this.values[this.index].indexOf(t)&&(this.values[this.index]||(this.values[this.index]="0"),this.values[this.index]+=e):"-"==e&&(n=!0),!0===n&&"-"!==this.values[this.index][0]&&(this.values[this.index]="-"+this.values[this.index])},"0{1}(.{1}0+)?%":function(e){y["0{1}(.{1}0+)?"].call(this,e),this.values[this.index].match(/[\-0-9]/g)?this.values[this.index]&&-1==this.values[this.index].indexOf("%")&&(this.values[this.index]+="%"):this.values[this.index]=""},"#(.{1})##0?(.{1}0+)?( ?;(.*)?)?":function(e){y["0{1}(.{1}0+)?"].call(this,e);var t=s.call(this),n=this.tokens[this.index].substr(1,1),i="-"===this.values[this.index][0],o=r.call(this,this.values[this.index],t);if(""!==o){var a=o[0].match(/[0-9]/g);if(a){for(var l=[],d=0,c=(a=a.join("")).length-1;c>=0;c--)l.push(a[c]),++d%3||l.push(n);l=l.reverse(),o[0]=l.join(""),o[0].substr(0,1)==n&&(o[0]=o[0].substr(1))}else o[0]="";this.values[this.index]=o.join(t),i&&(this.values[this.index]="-"+this.values[this.index])}},0:function(e){e.match(/[0-9]/g)&&(this.values[this.index]=e,this.index++)},"[0-9a-zA-Z$]+":function(e){o(this.values[this.index])&&(this.values[this.index]="");var t=this.tokens[this.index];t[this.values[this.index].length]==e?(this.values[this.index]+=e,this.values[this.index]==t&&this.index++):(this.values[this.index]=t,this.index++,e.match(/[\-0-9]/g)&&this.position--)},A:function(e){e.match(/[a-zA-Z]/gi)&&(this.values[this.index]=e,this.index++)},".":function(e){y["[0-9a-zA-Z$]+"].call(this,e)},"@":function(e){o(this.values[this.index])&&(this.values[this.index]=""),this.values[this.index]+=e}},b=function(t){if("general"==this.type)var n=[].concat(e.general);else n=[].concat(e.currency,e.datetime,e.percentage,e.numeric,e.text,e.general);var i=new RegExp(n.join("|"),"gi");return t.match(i)},x=function(t){if(this.type)n="text"==this.type?["text"]:"general"==this.type?["general"]:"datetime"==this.type?["numeric","datetime","general"]:["currency","percentage","numeric","general"];else var n=Object.keys(e);for(var i=0;i<n.length;i++)for(var o=n[i],a=0;a<e[o].length;a++){var s=new RegExp(e[o][a],"gi");if(t.match(s))return{type:o,method:e[o][a]}}},w=function(e){for(var t=[],n=0;n<e.length;n++){var i=x.call(this,e[n]);i?t.push(i.method):t.push(null)}for(n=0;n<t.length;n++)"MM"==t[n]&&(t[n-1]&&t[n-1].indexOf("H")>=0||t[n-2]&&t[n-2].indexOf("H")>=0||t[n+1]&&t[n+1].indexOf("S")>=0||t[n+2]&&t[n+2].indexOf("S")>=0)&&(t[n]="MI");return t},L=function(e){var t=x.call(this,e);if(t)var n=t.type;if(n){for(var i=0,o=b.call(this,e),s=0;s<o.length;s++)(t=x.call(this,o[s]))&&a(t.type)&&i++;i>1&&(n="general")}return n},j=function(){"function"==typeof y[this.methods[this.index]]?(y[this.methods[this.index]].call(this,this.value[this.position]),this.position++):(this.values[this.index]=this.tokens[this.index],this.index++)},E=function(e,i,o){var r=null,l={input:null,value:null,options:{},values:[],index:0,position:0,date:[0,0,0,0,0,0],number:0};if("object"==typeof e){if(l.input=e.target,l.value=f.call(e.target),l.caret=p.call(e.target),(r=e.target.getAttribute("data-mask"))&&(l.mask=r),(r=e.target.getAttribute("data-type"))&&(l.type=r),e.target.mask?(e.target.mask.options&&(l.options=e.target.mask.options),e.target.mask.locale&&(l.locale=e.target.mask.locale)):(r=e.target.getAttribute("data-locale"))&&(l.locale=r,l.mask&&(l.options.style=l.mask)),e.target.attributes&&e.target.attributes.length)for(var h=0;h<e.target.attributes.length;h++){var m=e.target.attributes[h].name,v=e.target.attributes[h].value;"data"==m.substr(0,4)&&(l.options[m.substr(5)]=v)}}else{if("string"==typeof i)l.mask=i;else for(m=Object.keys(i),h=0;h<m.length;h++)l[m[h]]=i[m[h]];"number"==typeof e&&(s.call(l,l.mask),e=(""+e).replace(".",l.options.decimal)),l.value=e,l.input&&(f.call(l.input,e),t.focus(l.input),l.caret=p.call(l.input))}if("="!=(""+l.value)[0]&&(l.mask||l.locale)){var g;if(l.mask&&(l.mask=l.mask.replace(new RegExp(/\[h]/),"|h|"),l.mask=l.mask.replace(new RegExp(/\[.*?\]/),""),l.mask=l.mask.replace(new RegExp(/\|h\|/),"[h]"),-1!==l.mask.indexOf(";")&&(r=l.mask.split(";"),l.mask=r[0]),-1!==l.mask.indexOf("##")&&((g=l.mask.split(";"))[0]&&("object"==typeof e&&(g[0]=g[0].replace(new RegExp(/_\)/g),""),g[0]=g[0].replace(new RegExp(/_\(/g),"")),g[0]=g[0].replace("*","\t"),g[0]=g[0].replace(new RegExp(/_-/g),""),g[0]=g[0].replace(new RegExp(/_/g),""),g[0]=g[0].replace(new RegExp(/"/g),""),g[0]=g[0].replace("##0.###","##0.000"),g[0]=g[0].replace("##0.##","##0.00"),g[0]=g[0].replace("##0.#","##0.0"),g[0]=g[0].replace("##0,###","##0,000"),g[0]=g[0].replace("##0,##","##0,00"),g[0]=g[0].replace("##0,#","##0,0")),l.mask=g[0]),-1!==l.mask.indexOf("\\")&&((g=l.mask.split(";"))[0]=g[0].replace(new RegExp(/\\/g),""),l.mask=g[0]),l.type||(l.type=L.call(l,l.mask)),l.tokens=b.call(l,l.mask)),"object"!=typeof e||!e.inputType||!e.inputType.indexOf("insert")||!e.inputType.indexOf("delete"))if(l.locale)if(l.input)c.call(l,l.input,e);else var y=d.call(l,l.value);else{for(l.methods=w.call(l,l.tokens),l.event=e;l.position<l.value.length&&void 0!==l.tokens[l.index];)j.call(l);if(y=l.values.join(""),a(l.type)&&""!==y){for(;void 0!==l.tokens[l.index];)(r=x.call(l,l.tokens[l.index]))&&"general"==r.type&&(l.values[l.index]=l.tokens[l.index]),l.index++;var C=!0}else C=!1;if(y=l.values.join(""),l.input){if((r=y.length-l.value.length)>0)var T=l.caret+r;else T=l.caret;f.call(l.input,y,T,C)}}if(l.input){var k=null;if(a(l.type)){let e=f.call(l.input);l.number=u.call(l,e),k="percentage"==l.type&&-1!==(""+e).indexOf("%")?E.adjustPrecision(l.number/100):l.number}else"datetime"==l.type&&(k=n.call(l),l.date[0]&&l.date[1]&&l.date[2]&&l.input.setAttribute("data-completed",!0));k&&l.input.setAttribute("data-value",k)}if(void 0!==y)return o?l:y}};return E.adjustPrecision=function(e){if("number"==typeof e&&!Number.isInteger(e)){const t=e.toString().split(".");if(t[1]&&t[1].length>10){let n=0;const i=t[1][t[1].length-2];if(0==i||9==i){for(let e=t[1].length-2;e>0;e--){if(!(n>=0&&t[1][e]==i)){n=0;break}if(n++,n>6)break}if(n)return parseFloat(parseFloat(e).toFixed(t[1].length-1))}}}return e},E.getType=L,E.prepare=function(e,t){return t||(t={}),b.call(t,e)},E.apply=function(e){var t=f.call(e.target);1==e.key.length&&(t+=e.key),f.call(e.target,E(t,e.target.getAttribute("data-mask")))},E.run=function(e,t,n){return E(e,{mask:t,decimal:n})},E.extract=function(e,n,a){if(o(e))return e;if("object"!=typeof n)return e;if((n=Object.assign({},n)).options||(n.options={}),!n.mask&&n.format&&(n.mask=n.format),n.mask){if(-1!==n.mask.indexOf(";")){var r=n.mask.split(";");n.mask=r[0]}n.mask=n.mask.replace(new RegExp(/\[h]/),"|h|"),n.mask=n.mask.replace(new RegExp(/\[.*?\]/),""),n.mask=n.mask.replace(new RegExp(/\|h\|/),"[h]")}s.call(n,n.mask);var l=null,d=null;if("percent"==n.type||"percent"==n.options.style?l="percentage":n.mask&&(l=L.call(n,n.mask)),"general"===l){var c=E(e,n,!0);d=e}else"datetime"===l?(e instanceof Date&&(e=E.getDateString(e,n.mask)),c=E(e,n,!0),d=t.isNumeric(e)?e:i.call(c)):(d=u.call(n,e),"percentage"===l&&-1!==(""+e).indexOf("%")&&(d/=100),c=n);return c.value=d,!c.type&&l&&(c.type=l),a?c:d},E.render=function(e,t,n){if(o(e))return e;if("object"!=typeof t)return e;if((t=Object.assign({},t)).options||(t.options={}),!t.mask&&t.format&&(t.mask=t.format),t.mask){if(-1!==t.mask.indexOf(";")){var i=t.mask.split(";");n||(i[0]=i[0].replace(new RegExp(/_\)/g),""),i[0]=i[0].replace(new RegExp(/_\(/g),"")),t.mask=i[0]}t.mask=t.mask.replace(new RegExp(/\[h]/),"|h|"),t.mask=t.mask.replace(new RegExp(/\[.*?\]/),""),t.mask=t.mask.replace(new RegExp(/\|h\|/),"[h]")}var a=null;"percent"==t.type||"percent"==t.options.style?a="percentage":t.mask?a=L.call(t,t.mask):e instanceof Date&&(a="datetime");var r=!1;if("datetime"==a||"calendar"==t.type)(i=E.getDateString(e,t.mask))&&(e=i),t.mask&&n&&(r=!0);else if("percentage"===a&&(e=E.adjustPrecision(100*e)),"number"==typeof e){if(i=null,t.mask&&n&&-1===(""+e).indexOf("e")){var l=s.call(t,t.mask);if(-1!==t.mask.indexOf(l)){l=(l=""+(l=t.mask.split(l))[1].match(/[0-9]+/g)).length,i=e.toFixed(l);let n=e.toString().split("."),o=n[1];i=o&&o.length>l&&"5"===o[o.length-1]?parseFloat(n[0]+"."+o+"1").toFixed(l):e.toFixed(l)}else i=e.toFixed(0)}else if(t.locale&&n){if(l=(""+e).split("."),t.options){void 0===l[1]&&(l[1]="");var d=l[1].length;if(t.options.minimumFractionDigits>d)for(var c=0;c<t.options.minimumFractionDigits-d;c++)l[1]+="0"}i=l[1].length?l.join("."):l[0],d=l[1].length,t.options&&t.options.maximumFractionDigits<d&&(i=parseFloat(i).toFixed(t.options.maximumFractionDigits))}else i=(""+ +e).replace(/(-?)(\d*)\.?(\d*)e([+-]\d+)/,(function(e,t,n,i,o){return o<0?t+"0."+Array(1-o-n.length).join(0)+n+i:t+n+i+Array(o-i.length+1).join(0)}));null!==i&&(e=i,s.call(t,t.mask),t.options.decimal&&(e=e.replace(".",t.options.decimal)))}else t.mask&&n&&(r=!0);if(r){var u=t.mask.length-e.length;if(u>0)for(c=0;c<u;c++)e+=" "}if(e=E(e,t),n&&"numeric"===a){var p=t.mask.match(new RegExp(/^[0]+$/gm));if(p&&1===p.length){var f=p[0].length;if(f>3)for(e=""+e;e.length<f;)e="0"+e}}return e},E.set=function(e,t){if(t){e.setAttribute("data-mask",t);var n=new Event("input",{bubbles:!0,cancelable:!0});e.dispatchEvent(n)}},E.extractDateFromString=function(e,n){var i=E(e,{mask:n},!0);if(e>0&&Number(e)==e&&(i.values.join("")!==i.value||"numeric"==i.type)){var o=new Date(Math.round(86400*(e-25569)*1e3));return o.getFullYear()+"-"+t.two(o.getMonth())+"-"+t.two(o.getDate())+" 00:00:00"}var a=!1;return i.values&&i.values.length===i.tokens.length&&i.values[i.values.length-1].length>=i.tokens[i.tokens.length-1].length&&(a=!0),i.date[0]&&i.date[1]&&(i.date[2]||a)?(i.date[2]||(i.date[2]=1),i.date[0]+"-"+t.two(i.date[1])+"-"+t.two(i.date[2])+" "+t.two(i.date[3])+":"+t.two(i.date[4])+":"+t.two(i.date[5])):""},E.getDateString=function(e,n){if(n||(n={}),n&&"object"==typeof n)if(n.format)var i=n.format;else n.mask&&(i=n.mask);else i=n;if(i||(i="YYYY-MM-DD"),i.indexOf("[h]")>=0){var o=0;if(e&&t.isNumeric(e)&&(o=parseFloat(24*Number(e)),i.indexOf("mm")>=0)){if((p=(""+o).split("."))[1]){var a=60*parseFloat("0."+p[1]);a=parseFloat(a.toFixed(2))}else a=0;o=parseInt(p[0])+":"+t.two(a)}return o}e instanceof Date?e=l.now(e):e&&t.isNumeric(e)&&(e=l.numToDate(e));for(var s=new RegExp(["DAY","WD","DDDD","DDD","DD","D","Q","HH24","HH12","HH","H","AM/PM","MI","SS","MS","YYYY","YYY","YY","Y","MONTH","MON","MMMMM","MMMM","MMM","MM","M","."].join("|"),"gi"),r=i.match(s),d=0;d<r.length;d++)"MM"==r[d].toUpperCase()&&(r[d-1]&&r[d-1].toUpperCase().indexOf("H")>=0||r[d-2]&&r[d-2].toUpperCase().indexOf("H")>=0||r[d+1]&&r[d+1].toUpperCase().indexOf("S")>=0||r[d+2]&&r[d+2].toUpperCase().indexOf("S")>=0)&&(r[d]="mi");var c={tokens:r};if(e){var u=-1!==(a=""+e).indexOf("T")?"T":" ",p=0,f=0,h=0;if((a=a.split(u))[1]&&(f=(p=a[1].split(":"))[1]?p[1]:0,h=p[2]?p[2]:0,p=p[0]?p[0]:0),(a=a[0].split("-"))[0]&&a[1]&&a[2]&&a[0]>0&&a[1]>0&&a[1]<13&&a[2]>0&&a[2]<32){c.data=[a[0],a[1],a[2],p,f,h],c.value=[];var m=new Date(c.data[0],c.data[1]-1,c.data[2],c.data[3],c.data[4],c.data[5]),v=function(e){var n=this.tokens[e],i=n.toUpperCase(),o=null;"YYYY"===i?o=this.data[0]:"YYY"===i?o=this.data[0].substring(1,4):"YY"===i?o=this.data[0].substring(2,4):"Y"===i?o=this.data[0].substring(3,4):"MON"===n?o=l.months[m.getMonth()].substr(0,3).toUpperCase():"mon"===n?o=l.months[m.getMonth()].substr(0,3).toLowerCase():"MONTH"===n?o=l.months[m.getMonth()].toUpperCase():"month"===n?o=l.months[m.getMonth()].toLowerCase():"MMMMM"===i?o=l.months[m.getMonth()].substr(0,1):"MMMM"===i||"Month"===n?o=l.months[m.getMonth()]:"MMM"===i||"Mon"==n?o=l.months[m.getMonth()].substr(0,3):"MM"===i?o=t.two(this.data[1]):"M"===i?o=m.getMonth()+1:"DAY"===n?o=l.weekdays[m.getDay()].toUpperCase():"day"===n?o=l.weekdays[m.getDay()].toLowerCase():"DDDD"===i||"Day"==n?o=l.weekdays[m.getDay()]:"DDD"===i?o=l.weekdays[m.getDay()].substr(0,3):"DD"===i?o=t.two(this.data[2]):"D"===i?o=parseInt(this.data[2]):"Q"===i?o=Math.floor((m.getMonth()+3)/3):"HH24"===i||"HH"===i?((o=this.data[3])>12&&-1!==this.tokens.indexOf("am/pm")&&(o-=12),o=t.two(o)):"HH12"===i?o=this.data[3]>12?t.two(this.data[3]-12):t.two(this.data[3]):"H"===i?(o=this.data[3])>12&&-1!==this.tokens.indexOf("am/pm")&&(o-=12,o=t.two(o)):"MI"===i?o=t.two(this.data[4]):"SS"===i?o=t.two(this.data[5]):"MS"===i?o=m.getMilliseconds():"AM/PM"===i?o=this.data[3]>=12?"PM":"AM":"WD"===i&&(o=l.weekdays[m.getDay()]),this.value[e]=null===o?this.tokens[e]:o};for(d=0;d<c.tokens.length;d++)v.call(c,d);e=c.value.join("")}else e=""}return e},E}();var w=function(){var e=function(n,i){if(n.calendar)return n.calendar.setOptions(i,!0);var o={type:"calendar",options:{},date:null,setOptions:function(i,a){var s={type:"default",validRange:null,startingDay:null,format:"DD/MM/YYYY",readonly:!0,today:!1,time:!1,resetButton:!0,placeholder:"",months:l.monthsShort,monthsFull:l.months,weekdays:l.weekdays,textDone:c.translate("Done"),textReset:c.translate("Reset"),textUpdate:c.translate("Update"),value:null,fullscreen:!1,opened:!1,onopen:null,onclose:null,onchange:null,onupdate:null,mode:null,position:null,dataType:null,controls:!0,autoSelect:!0};for(var r in s)i&&i.hasOwnProperty(r)?o.options[r]=i[r]:void 0!==o.options[r]&&!0!==a||(o.options[r]=s[r]);if(0==o.options.resetButton?u.style.display="none":u.style.display="",o.options.readonly?n.setAttribute("readonly","readonly"):n.removeAttribute("readonly"),o.options.placeholder?n.setAttribute("placeholder",o.options.placeholder):n.removeAttribute("placeholder"),t.isNumeric(o.options.value)&&o.options.value>0&&(o.options.value=e.numToDate(o.options.value),o.options.dataType="numeric"),u.innerHTML=o.options.textReset,f.innerHTML=o.options.textDone,E.innerHTML=o.options.textUpdate,n.setAttribute("data-mask",o.options.format.toLowerCase()),!o.options.value&&o.options.today)var d=e.now();else d=o.options.value;return d&&(o.options.value=null,o.setValue(d)),o},open:function(i){if(!d.classList.contains("jcalendar-focus")&&!d.classList.contains("jcalendar-inline")){if(e.current=o,p(o,!0),o.getDays(),"year-month-picker"==o.options.type&&o.getMonths(),o.options.time&&(C.value=o.date[3],T.value=o.date[4]),d.classList.add("jcalendar-focus"),t.getWindowWidth()<800||o.options.fullscreen)d.classList.add("jcalendar-fullsize"),g.slideBottom(m,1);else{d.classList.remove("jcalendar-fullsize");var a=n.getBoundingClientRect(),s=m.getBoundingClientRect();if(o.options.position)h.style.position="fixed",window.innerHeight<a.bottom+s.height?h.style.top=a.top-(s.height+2)+"px":h.style.top=a.top+a.height+2+"px",h.style.left=a.left+"px";else if(window.innerHeight<a.bottom+s.height?((r=-1*(a.height+s.height+2))+a.top<0&&(r=-1*(a.top+a.height)),h.style.top=r+"px"):h.style.top="2px",window.innerWidth<a.left+s.width){var r=window.innerWidth-(a.left+s.width+20);h.style.left=r+"px"}else h.style.left="0px"}"function"==typeof o.options.onopen&&o.options.onopen(n)}},close:function(t,i){if(!0!==o.options.autoSelect&&void 0===i&&(i=!1),d.classList.contains("jcalendar-focus")){if(!1!==i){var a=d.querySelector(".jcalendar-selected");if("string"==typeof i)var s=i;else s=!a||a.classList.contains("jcalendar-disabled")?o.options.value:o.getValue();o.setValue(s)}else if(o.options.value){let e=o.options.value;o.options.value="",o.setValue(e)}t||"function"!=typeof o.options.onclose||o.options.onclose(n),d.classList.remove("jcalendar-focus"),p(o,!1),e.current=null}return o.options.value},prev:function(){"years"==o.options.mode?(o.date[0]=o.date[0]-12,o.getYears()):"months"==o.options.mode?(o.date[0]=parseInt(o.date[0])-1,o.getMonths()):(o.date[1]<2?(o.date[0]=o.date[0]-1,o.date[1]=12):o.date[1]=o.date[1]-1,o.getDays())},next:function(){"years"==o.options.mode?(o.date[0]=parseInt(o.date[0])+12,o.getYears()):"months"==o.options.mode?(o.date[0]=parseInt(o.date[0])+1,o.getMonths()):(o.date[1]>11?(o.date[0]=parseInt(o.date[0])+1,o.date[1]=1):o.date[1]=parseInt(o.date[1])+1,o.getDays())},setToday:function(){var e=(new Date).toISOString().substr(0,10);return o.setValue(e),e},setValue:function(t){t||(t=""+t);var i=t,a=o.options.value;if(a!=i){if(i){o.setLabel(i,o.options),(r=i.split(" "))[1]||(r[1]="00:00:00");var s=r[1].split(":"),r=r[0].split("-"),l=parseInt(r[0]),d=parseInt(r[1]),u=parseInt(r[2]),p=parseInt(s[0]),f=parseInt(s[1]);o.date=[l,d,u,p,f,0],t=o.setLabel(i,o.options);var h=e.now(new Date(l,d-1,u),!0);if(o.options.validRange){if(!o.options.validRange[0]||h>=o.options.validRange[0])var m=!0;else m=!1;if(!o.options.validRange[1]||h<=o.options.validRange[1])var v=!0;else v=!1;m&&v?(n.classList.remove("jcalendar_warning"),n.title=""):(n.classList.add("jcalendar_warning"),n.title=c.translate("Date outside the valid range"))}else n.classList.remove("jcalendar_warning"),n.title=""}else{o.date=null;t="";n.classList.remove("jcalendar_warning"),n.title=""}o.options.value=i,"function"==typeof o.options.onchange&&o.options.onchange(n,i,a),n.value!=t&&(n.value=t,"function"==typeof n.oninput&&n.oninput({type:"input",target:n,value:n.value}))}o.getDays(),"year-month-picker"==o.options.type&&o.getMonths()},getValue:function(){return o.date?o.options.time?t.two(o.date[0])+"-"+t.two(o.date[1])+"-"+t.two(o.date[2])+" "+t.two(o.date[3])+":"+t.two(o.date[4])+":"+t.two(0):t.two(o.date[0])+"-"+t.two(o.date[1])+"-"+t.two(o.date[2])+" "+t.two(0)+":"+t.two(0)+":"+t.two(0):""},update:function(e,t){if(e.classList.contains("jcalendar-disabled"));else{var n=d.querySelector(".jcalendar-selected");n&&n.classList.remove("jcalendar-selected"),e.classList.add("jcalendar-selected"),e.classList.contains("jcalendar-set-month")?(o.date[1]=t,o.date[2]=1):o.date[2]=e.innerText,o.options.time?(o.date[3]=C.value,o.date[4]=T.value):o.close(null,!0)}r()},reset:function(){o.setValue(""),o.date=null,o.close(!1,!1)},getDays:function(){o.options.mode="days";var n=new Date,i=o.date&&t.isNumeric(o.date[0])?o.date[0]:parseInt(n.getFullYear()),a=o.date&&t.isNumeric(o.date[1])?o.date[1]:parseInt(n.getMonth())+1,s=o.date&&t.isNumeric(o.date[2])?o.date[2]:parseInt(n.getDate()),l=o.date&&t.isNumeric(o.date[3])?o.date[3]:parseInt(n.getHours()),d=o.date&&t.isNumeric(o.date[4])?o.date[4]:parseInt(n.getMinutes());o.date=[i,a,s,l,d,0],v.innerHTML=i,y.innerHTML=o.options.months[a-1];var c=n.getMonth()==a-1&&n.getFullYear()==i,u=n.getDate(),p=(n=new Date(i,a,0,0,0)).getDate(),f=(n=new Date(i,a-1,0,0,0)).getDay()+1;f-=m=o.options.startingDay||0,x.innerHTML="",(w=document.createElement("tr")).setAttribute("align","center"),x.appendChild(w);for(var h=0;h<7;h++)(j=document.createElement("td")).classList.add("jcalendar-weekday"),j.innerHTML=o.options.weekdays[m].substr(0,1),w.appendChild(j),++m>6&&(m=0);for(var m=0,g=0,b=0;b<6;b++){var w;for((w=document.createElement("tr")).setAttribute("align","center"),w.style.height="34px",h=0;h<7;h++){var j;if((j=document.createElement("td")).classList.add("jcalendar-set-day"),m>=f&&m<f+p){g++,j.innerHTML=g,g==s&&j.classList.add("jcalendar-selected"),c&&u==g&&(j.style.fontWeight="bold");var E=e.now(new Date(i,a-1,g),!0);if(o.options.validRange){if(!o.options.validRange[0]||E>=o.options.validRange[0])var C=!0;else C=!1;if(!o.options.validRange[1]||E<=o.options.validRange[1])var T=!0;else T=!1;C&&T||j.classList.add("jcalendar-disabled")}}w.appendChild(j),m++}x.appendChild(w)}o.options.time?L.style.display="":L.style.display="none",r()},getMonths:function(){o.options.mode="months";var e=o.options.months,n=(o.options.value,new Date),i=parseInt(n.getFullYear()),a=parseInt(n.getMonth())+1,s=o.date&&t.isNumeric(o.date[0])?o.date[0]:i,l=o.date&&t.isNumeric(o.date[1])?o.date[1]:a;v.innerHTML=o.date[0],y.innerHTML=e[l-1];var d=document.createElement("table");d.setAttribute("width","100%");for(var c=null,u=0;u<12;u++){u%4||((c=document.createElement("tr")).setAttribute("align","center"),d.appendChild(c));var p=document.createElement("td");if(p.classList.add("jcalendar-set-month"),p.setAttribute("data-value",u+1),p.innerText=e[u],o.options.validRange){var f=s+"-"+t.two(u+1);if(!o.options.validRange[0]||f>=o.options.validRange[0].substr(0,7))var h=!0;else h=!1;if(!o.options.validRange[1]||f<=o.options.validRange[1].substr(0,7))var m=!0;else m=!1;h&&m||p.classList.add("jcalendar-disabled")}u+1==l&&p.classList.add("jcalendar-selected"),i==s&&u+1==a&&(p.style.fontWeight="bold"),c.appendChild(p)}x.innerHTML='<tr><td colspan="7"></td></tr>',x.children[0].children[0].appendChild(d),r()},getYears:function(){o.options.mode="years";for(var e=new Date,n=e.getFullYear(),i=o.date&&t.isNumeric(o.date[0])?o.date[0]:parseInt(e.getFullYear()),a=[],s=0;s<25;s++)a[s]=parseInt(o.date[0])+(s-12);var l=document.createElement("table");for(l.setAttribute("width","100%"),s=0;s<25;s++){if(!(s%5)){var d=document.createElement("tr");d.setAttribute("align","center"),l.appendChild(d)}var c=document.createElement("td");c.classList.add("jcalendar-set-year"),c.innerText=a[s],i==a[s]&&c.classList.add("jcalendar-selected"),n==a[s]&&(c.style.fontWeight="bold"),d.appendChild(c)}x.innerHTML='<tr><td colspan="7"></td></tr>',x.firstChild.firstChild.appendChild(l),r()},setLabel:function(t,n){return e.getDateString(t,n)},fromFormatted:function(t,n){return e.extractDateFromString(t,n)}},a=function(e){if(t.findElement(e.target,"jcalendar-container")){var n=e.target.className;if("jcalendar-prev"==n)o.prev();else if("jcalendar-next"==n)o.next();else if("jcalendar-month"==n)o.getMonths();else if("jcalendar-year"==n)o.getYears();else if("jcalendar-set-year"==n)o.date[0]=e.target.innerText,"year-month-picker"==o.options.type?o.getMonths():o.getDays();else if(e.target.classList.contains("jcalendar-set-month")){var i=parseInt(e.target.getAttribute("data-value"));"year-month-picker"==o.options.type?o.update(e.target,i):(o.date[1]=i,o.getDays())}else"jcalendar-confirm"==n||"jcalendar-update"==n||"jcalendar-close"==n?o.close(null,!0):"jcalendar-backdrop"==n?o.close(!1,!1):"jcalendar-reset"==n?o.reset():e.target.classList.contains("jcalendar-set-day")&&e.target.innerText&&o.update(e.target)}else o.close(!1,!1)},s=function(t){if(t.target.value&&t.target.value.length>3){var n=e.extractDateFromString(t.target.value,o.options.format);n&&o.setValue(n)}},r=function(){var e=d.querySelector(".jcalendar-selected");e&&e.classList.contains("jcalendar-disabled")?(E.setAttribute("disabled","disabled"),C.setAttribute("disabled","disabled"),T.setAttribute("disabled","disabled")):(E.removeAttribute("disabled"),C.removeAttribute("disabled"),T.removeAttribute("disabled")),"function"==typeof o.options.onupdate&&o.options.onupdate(n,o.getValue())},d=null,u=null,f=null,h=null,m=null,v=null,y=null,b=null,x=null,w=null,L=null,j=null,E=null,C=null,T=null;return function(){"INPUT"==n.tagName&&n.value&&(i.value=n.value),(u=document.createElement("div")).className="jcalendar-reset",(f=document.createElement("div")).className="jcalendar-confirm",(w=document.createElement("div")).className="jcalendar-controls",w.style.borderBottom="1px solid #ddd",w.appendChild(u),w.appendChild(f),(h=document.createElement("div")).className="jcalendar-container",(m=document.createElement("div")).className="jcalendar-content",h.appendChild(m),"DIV"==n.tagName?(d=n).classList.add("jcalendar-inline"):(m.appendChild(w),(d=document.createElement("div")).className="jcalendar"),d.classList.add("jcalendar-container"),d.appendChild(h);var r=document.createElement("div");r.className="jcalendar-table",m.appendChild(r);var l=document.createElement("td");l.setAttribute("colspan","2"),l.className="jcalendar-prev",(v=document.createElement("span")).className="jcalendar-year",(y=document.createElement("span")).className="jcalendar-month";var c=document.createElement("td");c.className="jcalendar-header",c.setAttribute("colspan","3"),c.appendChild(y),c.appendChild(v);var p=document.createElement("td");p.setAttribute("colspan","2"),p.className="jcalendar-next";var k=document.createElement("thead"),A=document.createElement("tr");A.appendChild(l),A.appendChild(c),A.appendChild(p),k.appendChild(A),b=document.createElement("table"),x=document.createElement("tbody"),b.setAttribute("cellpadding","0"),b.setAttribute("cellspacing","0"),b.appendChild(k),b.appendChild(x),r.appendChild(b),(C=document.createElement("select")).className="jcalendar-select",C.onchange=function(){o.date[3]=this.value,"function"==typeof o.options.onupdate&&o.options.onupdate(n,o.getValue())};for(var M=0;M<24;M++)(D=document.createElement("option")).value=M,D.innerHTML=t.two(M),C.appendChild(D);for((T=document.createElement("select")).className="jcalendar-select",T.onchange=function(){o.date[4]=this.value,"function"==typeof o.options.onupdate&&o.options.onupdate(n,o.getValue())},M=0;M<60;M++){var D;(D=document.createElement("option")).value=M,D.innerHTML=t.two(M),T.appendChild(D)}var N=document.createElement("div");N.className="jcalendar-controls",(L=document.createElement("div")).className="jcalendar-time",L.style.maxWidth="140px",L.appendChild(C),L.appendChild(T),(E=document.createElement("button")).setAttribute("type","button"),E.className="jcalendar-update",(j=document.createElement("div")).style.flexGrow="10",j.appendChild(E),N.appendChild(L),"INPUT"==n.tagName&&N.appendChild(j),m.appendChild(N);var O=document.createElement("div");O.className="jcalendar-backdrop",d.appendChild(O),n.addEventListener("keyup",s),d.addEventListener("swipeleft",(function(e){g.slideLeft(b,0,(function(){o.next(),g.slideRight(b,1)})),e.preventDefault(),e.stopPropagation()})),d.addEventListener("swiperight",(function(e){g.slideRight(b,0,(function(){o.prev(),g.slideLeft(b,1)})),e.preventDefault(),e.stopPropagation()})),"ontouchend"in document.documentElement==1?(d.addEventListener("touchend",a),n.addEventListener("touchend",o.open)):(d.addEventListener("mouseup",a),n.addEventListener("mouseup",o.open)),e.hasEvents||(e.hasEvents=!0,document.addEventListener("keydown",e.keydown)),o.setOptions(i),"INPUT"==n.tagName?(n.parentNode.insertBefore(d,n.nextSibling),n.setAttribute("autocomplete","off"),n.classList.add("jcalendar-input"),n.value=o.setLabel(o.getValue(),o.options)):(o.getDays(),o.options.time&&(C.value=o.date[3],T.value=o.date[4])),1==o.options.opened&&o.open(),0==o.options.controls&&h.classList.add("jcalendar-hide-controls"),n.change=o.setValue,n.val=function(e){if(void 0===e)return o.getValue();o.setValue(e)},n.calendar=d.calendar=o}(),o};return e.keydown=function(t){var n=null;(n=e.current)&&(13==t.which?n.close(!1,!0):27==t.which&&n.close(!1,!1))},e.prettify=function(e,t){t||(t={justNow:"Just now",xMinutesAgo:"{0}m ago",xHoursAgo:"{0}h ago",xDaysAgo:"{0}d ago",xWeeksAgo:"{0}w ago",xMonthsAgo:"{0} mon ago",xYearsAgo:"{0}y ago"}),-1===e.indexOf("GMT")&&-1===e.indexOf("Z")&&(e+=" GMT");var n=new Date,i=new Date(e),o=parseInt((n-i)/1e3/60);if(String.prototype.format=function(e){return this.replace("{0}",e)},0==o)var a=t.justNow;else a=o<90?t.xMinutesAgo.format(o):o<1440?t.xHoursAgo.format(Math.round(o/60)):o<20160?t.xDaysAgo.format(Math.round(o/1440)):o<43200?t.xWeeksAgo.format(Math.round(o/10080)):o<1036800?t.xMonthsAgo.format(Math.round(o/43200)):t.xYearsAgo.format(Math.round(o/525600));return a},e.prettifyAll=function(){for(var t=document.querySelectorAll(".prettydate"),n=0;n<t.length;n++)t[n].getAttribute("data-date")?t[n].innerHTML=e.prettify(t[n].getAttribute("data-date")):t[n].innerHTML&&(t[n].setAttribute("title",t[n].innerHTML),t[n].setAttribute("data-date",t[n].innerHTML),t[n].innerHTML=e.prettify(t[n].innerHTML))},e.now=l.now,e.toArray=l.toArray,e.dateToNum=l.dateToNum,e.numToDate=l.numToDate,e.weekdays=l.weekdays,e.months=l.months,e.weekdaysShort=l.weekdaysShort,e.monthsShort=l.monthsShort,e.extractDateFromString=b.extractDateFromString,e.getDateString=b.getDateString,e}();var L=function(){var e={material:[["#ffebee","#fce4ec","#f3e5f5","#e8eaf6","#e3f2fd","#e0f7fa","#e0f2f1","#e8f5e9","#f1f8e9","#f9fbe7","#fffde7","#fff8e1","#fff3e0","#fbe9e7","#efebe9","#fafafa","#eceff1"],["#ffcdd2","#f8bbd0","#e1bee7","#c5cae9","#bbdefb","#b2ebf2","#b2dfdb","#c8e6c9","#dcedc8","#f0f4c3","#fff9c4","#ffecb3","#ffe0b2","#ffccbc","#d7ccc8","#f5f5f5","#cfd8dc"],["#ef9a9a","#f48fb1","#ce93d8","#9fa8da","#90caf9","#80deea","#80cbc4","#a5d6a7","#c5e1a5","#e6ee9c","#fff59d","#ffe082","#ffcc80","#ffab91","#bcaaa4","#eeeeee","#b0bec5"],["#e57373","#f06292","#ba68c8","#7986cb","#64b5f6","#4dd0e1","#4db6ac","#81c784","#aed581","#dce775","#fff176","#ffd54f","#ffb74d","#ff8a65","#a1887f","#e0e0e0","#90a4ae"],["#ef5350","#ec407a","#ab47bc","#5c6bc0","#42a5f5","#26c6da","#26a69a","#66bb6a","#9ccc65","#d4e157","#ffee58","#ffca28","#ffa726","#ff7043","#8d6e63","#bdbdbd","#78909c"],["#f44336","#e91e63","#9c27b0","#3f51b5","#2196f3","#00bcd4","#009688","#4caf50","#8bc34a","#cddc39","#ffeb3b","#ffc107","#ff9800","#ff5722","#795548","#9e9e9e","#607d8b"],["#e53935","#d81b60","#8e24aa","#3949ab","#1e88e5","#00acc1","#00897b","#43a047","#7cb342","#c0ca33","#fdd835","#ffb300","#fb8c00","#f4511e","#6d4c41","#757575","#546e7a"],["#d32f2f","#c2185b","#7b1fa2","#303f9f","#1976d2","#0097a7","#00796b","#388e3c","#689f38","#afb42b","#fbc02d","#ffa000","#f57c00","#e64a19","#5d4037","#616161","#455a64"],["#c62828","#ad1457","#6a1b9a","#283593","#1565c0","#00838f","#00695c","#2e7d32","#558b2f","#9e9d24","#f9a825","#ff8f00","#ef6c00","#d84315","#4e342e","#424242","#37474f"],["#b71c1c","#880e4f","#4a148c","#1a237e","#0d47a1","#006064","#004d40","#1b5e20","#33691e","#827717","#f57f17","#ff6f00","#e65100","#bf360c","#3e2723","#212121","#263238"]],fire:[["0b1a6d","840f38","b60718","de030b","ff0c0c","fd491c","fc7521","faa331","fbb535","ffc73a"],["071147","5f0b28","930513","be0309","ef0000","fa3403","fb670b","f9991b","faad1e","ffc123"],["03071e","370617","6a040f","9d0208","d00000","dc2f02","e85d04","f48c06","faa307","ffba08"],["020619","320615","61040d","8c0207","bc0000","c82a02","d05203","db7f06","e19405","efab00"],["020515","2d0513","58040c","7f0206","aa0000","b62602","b94903","c57205","ca8504","d89b00"]],baby:[["eddcd2","fff1e6","fde2e4","fad2e1","c5dedd","dbe7e4","f0efeb","d6e2e9","bcd4e6","99c1de"],["e1c4b3","ffd5b5","fab6ba","f5a8c4","aacecd","bfd5cf","dbd9d0","baceda","9dc0db","7eb1d5"],["daa990","ffb787","f88e95","f282a9","8fc4c3","a3c8be","cec9b3","9dbcce","82acd2","649dcb"],["d69070","ff9c5e","f66770","f05f8f","74bbb9","87bfae","c5b993","83aac3","699bca","4d89c2"],["c97d5d","f58443","eb4d57","e54a7b","66a9a7","78ae9c","b5a67e","7599b1","5c88b7","4978aa"]],chart:[["#C1D37F","#4C5454","#FFD275","#66586F","#D05D5B","#C96480","#95BF8F","#6EA240","#0F0F0E","#EB8258","#95A3B3","#995D81"]]},t=function(t){return e[t]?e[t]:e.material};return t.get=function(t){return e[t]?e[t]:e},t.set=function(t,n){e[t]=n},t}();function j(e,t){var n={options:{}},i={data:[],position:null,allowCreate:!1,allowChangePosition:!1,onclick:null,onload:null,onchange:null,oncreate:null,ondelete:null,onbeforecreate:null,onchangeposition:null,animation:!1,hideHeaders:!1,padding:null,palette:null,maxWidth:null};for(var o in i)t&&t.hasOwnProperty(o)?n.options[o]=t[o]:n.options[o]=i[o];e.classList.add("jtabs");var a=null,s=null,r=null;const l=function(e){n.options.animation&&setTimeout((function(){let t=n.headers.children[e].getBoundingClientRect();"modern"===n.options.palette?(r.style.width=t.width-4+"px",r.style.left=n.headers.children[e].offsetLeft+2+"px"):(r.style.width=t.width+"px",r.style.left=n.headers.children[e].offsetLeft+"px"),"bottom"===n.options.position?r.style.top="0px":r.style.bottom="0px"}),50)};var d=function(e){"function"==typeof n.headers.scrollTo?n.headers.scrollTo({left:e,behavior:"smooth"}):n.headers.scrollLeft=e,e<=1?a.classList.add("disabled"):a.classList.remove("disabled"),e>=n.headers.scrollWidth-n.headers.offsetWidth?s.classList.add("disabled"):s.classList.remove("disabled"),n.headers.scrollWidth<=n.headers.offsetWidth?(a.style.display="none",s.style.display="none"):(a.style.display="",s.style.display="")};if(n.setBorder=l,n.open=function(t){if(n.content.children[t]){for(var i=null,o=0;o<n.headers.children.length;o++)n.headers.children[o].classList.contains("jtabs-selected")&&(i=o),n.headers.children[o].classList.remove("jtabs-selected"),n.content.children[o]&&n.content.children[o].classList.remove("jtabs-selected");if(n.headers.children[t].classList.add("jtabs-selected"),n.content.children[t]&&n.content.children[t].classList.add("jtabs-selected"),i!=t&&"function"==typeof n.options.onchange&&n.content.children[t]&&n.options.onchange(e,n,t,n.headers.children[t],n.content.children[t]),1==n.options.hideHeaders&&n.headers.children.length<3&&0==n.options.allowCreate)n.headers.parentNode.style.display="none";else{n.headers.parentNode.style.display="";var a=n.headers.children[t].offsetLeft,s=a+n.headers.children[t].offsetWidth,r=n.headers.scrollLeft,c=r+n.headers.offsetWidth;r<=a&&c>=s||d(a-1),l(t)}}},n.selectIndex=function(e){var t=Array.prototype.indexOf.call(n.headers.children,e);return t>=0&&n.open(t),t},n.rename=function(e,t){t||(t=prompt("New title",n.headers.children[e].innerText)),n.headers.children[e].innerText=t,l(n.getActive())},n.create=function(t,i){if("function"==typeof n.options.onbeforecreate){var o=n.options.onbeforecreate(e);if(!1===o)return!1;t=o}var a=n.appendElement(t);return"function"==typeof n.options.oncreate&&n.options.oncreate(e,a),l(n.getActive()),a},n.remove=function(e){return n.deleteElement(e)},n.nextNumber=function(){for(var e=0,t=0;t<n.headers.children.length;t++){var i=n.headers.children[t].innerText.match(/[0-9].*/);i>e&&(e=parseInt(i))}return e?e++:e=1,e},n.deleteElement=function(t){let i=n.getActive();if(!n.headers.children[t])return!1;if(n.headers.removeChild(n.headers.children[t]),n.content.removeChild(n.content.children[t]),i===t)n.open(0);else{let e=n.getActive()||0;l(e)}"function"==typeof n.options.ondelete&&n.options.ondelete(e,t)},n.appendElement=function(e,t,i,o){if(e||(e=prompt("Title?","")),e){var a=document.createElement("div"),s=document.createElement("div");if(s.innerHTML=e,s.content=a,void 0===o)n.content.appendChild(a),n.headers.insertBefore(s,n.headers.lastChild);else{let e=n.content.children[o];e?n.content.insertBefore(a,e):n.content.appendChild(a),e=n.headers.children[o]||n.headers.lastChild,n.headers.insertBefore(s,e)}return n.options.allowChangePosition&&s.setAttribute("draggable","true"),!1!==i&&n.selectIndex(s),"function"==typeof t&&t(a,s),a}},n.getActive=function(){for(var e=0;e<n.headers.children.length;e++)if(n.headers.children[e].classList.contains("jtabs-selected"))return e;return!1},n.updateContent=function(e,t){"string"!=typeof t||(document.createElement("div").innerHTML=t),n.content.children[e].classList.contains("jtabs-selected")&&t.classList.add("jtabs-selected"),n.content.replaceChild(t,n.content.children[e]),l()},n.updatePosition=function(e,t,i,o){if(e>t?n.content.insertBefore(n.content.children[e],n.content.children[t]):n.content.insertBefore(n.content.children[e],n.content.children[t].nextSibling),!1!==o)n.open(t);else{const e=n.getActive();t<e&&n.setBorder(e)}i||"function"!=typeof n.options.onchangeposition||n.options.onchangeposition(n.headers,e,t)},n.move=function(e,t,i,o){e>t?n.headers.insertBefore(n.headers.children[e],n.headers.children[t]):n.headers.insertBefore(n.headers.children[e],n.headers.children[t].nextSibling),n.updatePosition(e,t,i,o)},n.setBorder=l,n.init=function(){e.innerHTML="",n.headers=document.createElement("div"),n.content=document.createElement("div"),n.headers.classList.add("jtabs-headers"),n.content.classList.add("jtabs-content"),n.options.palette?e.classList.add("jtabs-modern"):e.classList.remove("jtabs-modern"),n.options.padding&&(n.content.style.padding=parseInt(n.options.padding)+"px");var t=document.createElement("div");t.className="jtabs-headers-container",t.appendChild(n.headers),n.options.maxWidth&&(t.style.maxWidth=parseInt(n.options.maxWidth)+"px");var i=document.createElement("div");if(i.className="jtabs-controls",i.setAttribute("draggable","false"),t.appendChild(i),"bottom"==n.options.position?(e.appendChild(n.content),e.appendChild(t)):(e.appendChild(t),e.appendChild(n.content)),1==n.options.allowCreate){var o=document.createElement("div");o.className="jtabs-add",o.onclick=function(){n.create()},i.appendChild(o)}(a=document.createElement("div")).className="jtabs-prev",a.onclick=function(){d(n.headers.scrollLeft-n.headers.offsetWidth)},i.appendChild(a),(s=document.createElement("div")).className="jtabs-next",s.onclick=function(){d(n.headers.scrollLeft+n.headers.offsetWidth)},i.appendChild(s);for(var l=0;l<n.options.data.length;l++){if(n.options.data[l].titleElement)var c=n.options.data[l].titleElement;else c=document.createElement("div");if(n.options.data[l].icon){var u=document.createElement("div"),p=document.createElement("i");p.classList.add("material-icons"),p.innerHTML=n.options.data[l].icon,u.appendChild(p),c.appendChild(u)}if(n.options.data[l].title){var f=document.createTextNode(n.options.data[l].title);c.appendChild(f)}if(n.options.data[l].width&&(c.style.width=n.options.data[l].width),n.options.data[l].contentElement)var m=n.options.data[l].contentElement;else(m=document.createElement("div")).innerHTML=n.options.data[l].content;n.headers.appendChild(c),n.content.appendChild(m)}(r=document.createElement("div")).className="jtabs-border",n.headers.appendChild(r),n.options.animation&&e.classList.add("jtabs-animation"),n.headers.addEventListener("click",(function(t){if(t.target.parentNode.classList.contains("jtabs-headers"))var i=t.target;else i="I"==t.target.tagName?t.target.parentNode.parentNode:t.target.parentNode;var o=n.selectIndex(i);"function"==typeof n.options.onclick&&n.options.onclick(e,n,o,n.headers.children[o],n.content.children[o])})),n.headers.addEventListener("contextmenu",(function(e){n.selectIndex(e.target)})),n.headers.children.length&&n.open(0),d(0),1==n.options.allowChangePosition&&h(n.headers,{direction:1,ondrop:function(e,t,i){n.updatePosition(t,i)}}),"function"==typeof n.options.onload&&n.options.onload(e,n)},e.children[0]&&e.children[0].children.length)for(var c=0;c<e.children[0].children.length;c++){var u=n.options.data&&n.options.data[c]?n.options.data[c]:{};e.children[1]&&e.children[1].children[c]?(u.titleElement=e.children[0].children[c],u.contentElement=e.children[1].children[c]):u.contentElement=e.children[0].children[c],n.options.data[c]=u}var p=!1;if(n.options.data)for(c=0;c<n.options.data.length;c++)n.options.data[c].url&&(v({url:n.options.data[c].url,type:"GET",dataType:"text/html",index:c,success:function(e){n.options.data[this.index].content=e},complete:function(){n.init()}}),p=!0);return p||n.init(),e.tabs=n,n}function E(e,n){if(e.color)return e.color.setOptions(n,!0);var i={type:"color",options:{}},o=null,a=null,s=null,r=null,l=null,d=null,c=null;i.setOptions=function(t,n){var o={placeholder:"",value:null,onopen:null,onclose:null,onchange:null,closeOnChange:!0,palette:null,position:null,doneLabel:"Done",resetLabel:"Reset",fullscreen:!1,opened:!1};for(var a in t||(t={}),t&&!t.palette&&(t.palette=L()),o)t&&t.hasOwnProperty(a)?i.options[a]=t[a]:void 0!==i.options[a]&&!0!==n||(i.options[a]=o[a]);return r&&(r.innerHTML=i.options.resetLabel),l&&(l.innerHTML=i.options.doneLabel),i.options.palette&&c&&c.updateContent(0,v()),"string"==typeof i.options.value&&(e.value=i.options.value,"INPUT"===e.tagName&&(e.style.color=e.value,e.style.backgroundColor=e.value)),i.options.placeholder?e.setAttribute("placeholder",i.options.placeholder):e.getAttribute("placeholder")&&e.removeAttribute("placeholder"),i},i.select=function(e){var t=o.querySelector(".jcolor-selected");t&&t.classList.remove("jcolor-selected"),i.values[e]&&i.values[e].classList.add("jcolor-selected"),i.options.value=e},i.open=function(){if(!o.classList.contains("jcolor-focus")){p(i,!0),o.classList.add("jcolor-focus"),i.options.value&&i.select(i.options.value),s.style.marginTop="",s.style.marginLeft="";var n=s.getBoundingClientRect(),r=t.getWindowWidth(),l=t.getWindowHeight();if(r<800||1==i.options.fullscreen?(s.classList.add("jcolor-fullscreen"),g.slideBottom(s,1),a.style.display="block"):(s.classList.contains("jcolor-fullscreen")&&(s.classList.remove("jcolor-fullscreen"),a.style.display=""),i.options.position?s.style.position="fixed":s.style.position="",n.left+n.width>r&&(s.style.marginLeft=-1*(n.left+n.width-(r-20))+"px"),n.top+n.height>l&&(s.style.marginTop=-1*(n.top+n.height-(l-20))+"px")),"function"==typeof i.options.onopen&&i.options.onopen(e,i),c.setBorder(c.getActive()),i.options.value){var d=m(i.options.value);T.forEach((function(e,t){e.value=d[t],e.dispatchEvent(new Event("input"))}))}}},i.close=function(t){return o.classList.contains("jcolor-focus")&&(o.classList.remove("jcolor-focus"),a.style.display="",t||"function"!=typeof i.options.onclose||i.options.onclose(e,i),p(i,!1)),i.options.value},i.setValue=function(t){t||(t=""),t!=i.options.value&&(i.options.value=t,C=t,i.select(t),"function"==typeof i.options.onchange&&i.options.onchange(e,t,i),e.value!=i.options.value&&(e.value=i.options.value,"INPUT"===e.tagName&&(e.style.color=e.value,e.style.backgroundColor=e.value),"function"==typeof e.oninput&&e.oninput({type:"input",target:e,value:e.value})),1==i.options.closeOnChange&&i.close())},i.getValue=function(){return i.options.value};var u=function(e){var t=e.toString(16);return 1===t.length?"0"+t:t},f=function(e,t,n){return"#"+u(e)+u(t)+u(n)},h=function(e){return parseInt("0x"+e)},m=function(e){return[h(e.substr(1,2)),h(e.substr(3,2)),h(e.substr(5,2))]},v=function(){var e=document.createElement("div");e.className="jcolor-grid",i.values=[];var t=document.createElement("table");t.setAttribute("cellpadding","7"),t.setAttribute("cellspacing","0");for(var n=0;n<i.options.palette.length;n++){for(var o=document.createElement("tr"),a=0;a<i.options.palette[n].length;a++){var s=document.createElement("td"),r=i.options.palette[n][a];r.length<7&&"#"!==r.substr(0,1)&&(r="#"+r),s.style.backgroundColor=r,s.setAttribute("data-value",r),s.innerHTML="",o.appendChild(s),i.options.value==r&&s.classList.add("jcolor-selected"),i.values[r]=s}t.appendChild(o)}return e.appendChild(t),e},y=document.createElement("canvas");y.width=200,y.height=160;var b=y.getContext("2d"),x=function(){var e=d.firstChild.getBoundingClientRect();y.width=e.width-14,w()},w=function(){var e=b.createLinearGradient(0,0,y.width,0);e.addColorStop(0,"rgb(255,0,0)"),e.addColorStop(.15,"rgb(255,0,255)"),e.addColorStop(.33,"rgb(0,0,255)"),e.addColorStop(.49,"rgb(0,255,255)"),e.addColorStop(.67,"rgb(0,255,0)"),e.addColorStop(.84,"rgb(255,255,0)"),e.addColorStop(1,"rgb(255,0,0)"),b.fillStyle=e,b.fillRect(0,0,y.width,y.height),(e=b.createLinearGradient(0,0,0,y.height)).addColorStop(0,"rgba(255,255,255,1)"),e.addColorStop(.5,"rgba(255,255,255,0)"),e.addColorStop(.5,"rgba(0,0,0,0)"),e.addColorStop(1,"rgba(0,0,0,1)"),b.fillStyle=e,b.fillRect(0,0,y.width,y.height)},E=function(){var e=document.createElement("div");e.className="jcolor-hsl";var t=document.createElement("div");t.className="jcolor-point";var n=document.createElement("div");n.appendChild(y),n.appendChild(t),e.appendChild(n);var i=function(n,i,o){if(1===n){var a=e.getBoundingClientRect(),s=i-a.left,r=o-a.top;s<0&&(s=0),r<0&&(r=0),s>a.width&&(s=a.width),r>a.height&&(r=a.height),t.style.left=s+"px",t.style.top=r+"px";var l=b.getImageData(s,r,1,1).data;C=f(l[0],l[1],l[2])}};return e.addEventListener("mousedown",(function(e){i(e.buttons,e.clientX,e.clientY)})),e.addEventListener("mousemove",(function(e){i(e.buttons,e.clientX,e.clientY)})),e.addEventListener("touchmove",(function(e){i(1,e.changedTouches[0].clientX,e.changedTouches[0].clientY)})),e},C="",T=[],k=function(){var e=document.createElement("div");e.className="jcolor-sliders";var t=document.createElement("div"),n=function(e){var n=document.createElement("div");n.className="jcolor-sliders-input-container";var i=document.createElement("label");i.innerText=e;var o=document.createElement("div");o.className="jcolor-sliders-input-subcontainer";var a=document.createElement("input");a.type="range",a.min=0,a.max=255,a.value=0,n.appendChild(i),o.appendChild(a);var s=document.createElement("div");return s.innerText=a.value,a.addEventListener("input",(function(){s.innerText=a.value})),o.appendChild(s),n.appendChild(o),t.appendChild(n),a};T=[n("Red"),n("Green"),n("Blue")],e.appendChild(t);var i=document.createElement("div");i.className="jcolor-sliders-final-color";var o=document.createElement("div");o.style.visibility="hidden",o.innerText="a",i.appendChild(o);return T.forEach((function(e){e.addEventListener("input",(function(){var e;e=f(parseInt(T[0].value),parseInt(T[1].value),parseInt(T[2].value)),o.innerText=e,o.style.color=e,o.style.removeProperty("visibility"),C=e,function(){if(""!==C)for(var e=0;e<T.length;e++){var t=m(C);t[e]=0;var n="linear-gradient(90deg, rgb(";n+=t.join(", "),n+="), rgb(",t[e]=255,n+=t.join(", "),n+="))",T[e].style.backgroundImage=n}}()}))})),e.appendChild(i),e};return i.toHex=function(e){var t=function(e){return("0"+parseInt(e).toString(16)).slice(-2)};if(e)return/^#[0-9A-F]{6}$/i.test(e)?e:(e=e.match(/^rgb\((\d+),\s*(\d+),\s*(\d+)\)$/))&&e.length?"#"+t(e[1])+t(e[2])+t(e[3]):""},function(){i.setOptions(n),"INPUT"==e.tagName&&(e.classList.add("jcolor-input"),e.readOnly=!0),(o=document.createElement("div")).className="jcolor",(a=document.createElement("div")).className="jcolor-backdrop",o.appendChild(a),(s=document.createElement("div")).className="jcolor-content";var t=document.createElement("div");t.className="jcolor-controls",s.appendChild(t),(r=document.createElement("div")).className="jcolor-reset",r.innerHTML=i.options.resetLabel,t.appendChild(r),(l=document.createElement("div")).className="jcolor-close",l.innerHTML=i.options.doneLabel,t.appendChild(l),d=document.createElement("div"),s.appendChild(d),c=j(d,{animation:!0,data:[{title:"Grid",contentElement:v()},{title:"Spectrum",contentElement:E()},{title:"Sliders",contentElement:k()}],onchange:function(e,t,n){if(1===n)x();else{var o=""!==C?C:i.getValue();if(2===n&&o){var a=m(o);T.forEach((function(e,t){e.value=a[t],e.dispatchEvent(new Event("input"))}))}}},palette:"modern"}),o.appendChild(s),"INPUT"==e.tagName?e.parentNode.insertBefore(o,e.nextSibling):e.appendChild(o),o.addEventListener("click",(function(e){if("TD"==e.target.tagName){var t=e.target.getAttribute("data-value");t&&i.setValue(t)}else e.target.classList.contains("jcolor-reset")?(i.setValue(""),i.close()):e.target.classList.contains("jcolor-close")?(c.getActive()>0&&i.setValue(C),i.close()):e.target.classList.contains("jcolor-backdrop")?i.close():i.open()})),e.addEventListener("mouseup",(function(e){i.open()})),window.addEventListener("resize",(function(){o.classList.contains("jcolor-focus")&&1==c.getActive()&&x()})),1==i.options.opened&&i.open(),e.change=i.setValue,e.val=function(e){if(void 0===e)return i.getValue();i.setValue(e)},e.color=i,o.color=i}(),i}var C=function(){var e=function(t,n){var i={type:"contextmenu",options:{}},o={items:null,onclick:null};for(var a in o)n&&n.hasOwnProperty(a)?i.options[a]=n[a]:i.options[a]=o[a];function s(e){if(!e.type||"line"!=e.type&&"divisor"!=e.type){d=document.createElement("div");var t=document.createElement("a");if(t.innerHTML=e.title,e.tooltip&&d.setAttribute("title",e.tooltip),e.icon&&d.setAttribute("data-icon",e.icon),e.id&&(d.id=e.id),e.disabled?d.className="jcontextmenu-disabled":e.onclick&&(d.method=e.onclick,d.addEventListener("mousedown",(function(e){e.preventDefault()})),d.addEventListener("mouseup",(function(e){this.method(this,e)}))),d.appendChild(t),e.submenu){var n=document.createElement("span");n.innerHTML="&#9658;",d.appendChild(n),d.classList.add("jcontexthassubmenu");var i=document.createElement("div");i.classList.add("jcontextmenu"),i.setAttribute("tabindex","900");for(var o=e.submenu,a=0;a<o.length;a++){var r=s(o[a]);i.appendChild(r)}d.appendChild(i)}else if(e.shortcut){var l=document.createElement("span");l.innerHTML=e.shortcut,d.appendChild(l)}}else var d=document.createElement("hr");return d}return t.classList.add("jcontextmenu"),i.open=function(n,o){if(o&&(i.options.items=o,i.create(o)),e.current&&e.current.close(),p(i,!0),t.classList.add("jcontextmenu-focus"),e.current=i,i.options.items&&i.options.items.length>0||t.children.length){if(n.target)if(n.changedTouches&&n.changedTouches[0])a=n.changedTouches[0].clientX,s=n.changedTouches[0].clientY;else var a=n.clientX,s=n.clientY;else a=n.x,s=n.y;var r=t.getBoundingClientRect();if(window.innerHeight<s+r.height){var l=s-r.height;l<0&&(l=0),t.style.top=l+"px"}else t.style.top=s+"px";window.innerWidth<a+r.width?a-r.width>0?t.style.left=a-r.width+"px":t.style.left="10px":t.style.left=a+"px"}},i.isOpened=function(){return!!t.classList.contains("jcontextmenu-focus")},i.close=function(){t.classList.contains("jcontextmenu-focus")&&t.classList.remove("jcontextmenu-focus"),p(i,!1)},i.create=function(e){t.innerHTML="";var n=function(){var e=document.createElement("div");e.classList.add("header"),e.addEventListener("click",(function(e){e.preventDefault(),e.stopPropagation()}));var t=document.createElement("a");t.classList.add("title"),t.innerHTML=c.translate("Menu"),e.appendChild(t);var n=document.createElement("a");return n.classList.add("close"),n.innerHTML=c.translate("close"),n.addEventListener("click",(function(e){i.close()})),e.appendChild(n),e}();t.appendChild(n);for(var o=0;o<e.length;o++){var a=s(e[o]);t.appendChild(a)}},"function"==typeof i.options.onclick&&t.addEventListener("click",(function(e){i.options.onclick(i,e)})),i.options.items&&i.create(i.options.items),window.addEventListener("mousewheel",(function(){i.close()})),t.contextmenu=i,i};return e}();var T=function(){var e=function(n,i){if(n.dropdown)return n.dropdown.setOptions(i,!0);var o={type:"dropdown",options:{}},a=function(e,t){e&&e.length&&(!1!==o.options.sortResults&&("function"==typeof o.options.sortResults?e.sort(o.options.sortResults):e.sort(s)),o.setData(e)),"function"==typeof o.options.onload&&o.options.onload(n,o,e,t),t&&l(t),null==t&&(o.options.value=""),n.value=o.options.value,1==o.options.opened&&o.open()},s=function(e,t){var n,i;return"string"==typeof e?n=e:e.text?n=e.text:e.name&&(n=e.name),"string"==typeof t?i=t:t.text?i=t.text:t.name&&(i=t.name),"string"==typeof n||"string"==typeof i?("string"!=typeof n&&(n=""+n),"string"!=typeof i&&(i=""+i),n.localeCompare(i)):n-i},r=function(){o.value={};for(var e=0;e<o.items.length;e++)1==o.items[e].selected&&(o.items[e].element&&o.items[e].element.classList.remove("jdropdown-selected"),o.items[e].selected=null);o.options.value="",n.value=""},l=function(e){if(r(),null!==e)if(e){Array.isArray(e)||(e=(""+e).split(";"));for(var t=0;t<e.length;t++)o.value[e[t]]=""}else void 0!==o.value[""]&&(o.value[""]="");for(t=0;t<o.items.length;t++)void 0!==o.value[d(t)]&&(o.items[t].element&&o.items[t].element.classList.add("jdropdown-selected"),o.items[t].selected=!0,o.value[d(t)]=u(t));o.options.value=Object.keys(o.value).join(";"),o.header.value=o.getText()},d=function(e,t){if(o.options.format)n="id";else var n="value";return o.items[e]?void 0!==t?o.items[e].data[n]=t:o.items[e].data[n]:""},u=function(e,t){if(o.options.format)n="name";else var n="text";return o.items[e]?void 0!==t?o.items[e].data[n]=t:o.items[e].data[n]:""},f=function(){return Object.keys(o.value)},h=function(){for(var e=[],t=Object.keys(o.value),n=0;n<t.length;n++)e.push(o.value[t[n]]);return e};o.setOptions=function(e,i){e||(e={});var s={url:null,data:[],format:0,multiple:!1,autocomplete:!1,remoteSearch:!1,lazyLoading:!1,type:null,width:null,maxWidth:null,opened:!1,value:null,placeholder:"",newOptions:!1,position:!1,onchange:null,onload:null,onopen:null,onclose:null,onfocus:null,onblur:null,oninsert:null,onbeforeinsert:null,onsearch:null,onbeforesearch:null,sortResults:!1,autofocus:!1};for(var r in s)e&&e.hasOwnProperty(r)?o.options[r]=e[r]:void 0!==o.options[r]&&!0!==i||(o.options[r]=s[r]);return 1!=o.options.remoteSearch&&"searchbar"!==o.options.type||(o.options.autocomplete=!0),1==o.options.newOptions?o.header.classList.add("jdropdown-add"):o.header.classList.remove("jdropdown-add"),1==o.options.autocomplete?o.header.removeAttribute("readonly"):o.header.setAttribute("readonly","readonly"),o.options.placeholder?o.header.setAttribute("placeholder",o.options.placeholder):o.header.removeAttribute("placeholder"),n.classList.remove("jdropdown-searchbar"),n.classList.remove("jdropdown-picker"),n.classList.remove("jdropdown-list"),"searchbar"==o.options.type?n.classList.add("jdropdown-searchbar"):"list"==o.options.type?n.classList.add("jdropdown-list"):"picker"==o.options.type?n.classList.add("jdropdown-picker"):t.getWindowWidth()<800?o.options.autocomplete?(n.classList.add("jdropdown-searchbar"),o.options.type="searchbar"):(n.classList.add("jdropdown-picker"),o.options.type="picker"):(o.options.width?(n.style.width=o.options.width,n.style.minWidth=o.options.width):(n.style.removeProperty("width"),n.style.removeProperty("min-width")),n.classList.add("jdropdown-default"),o.options.type="default"),"searchbar"==o.options.type?y.appendChild(w):b.insertBefore(w,b.firstChild),o.options.url&&!e.data?v({url:o.options.url,method:"GET",dataType:"json",success:function(e){e&&a(e,o.options.value)}}):a(o.options.data,o.options.value),o};var y=null,b=null,x=null,w=null,L=null,j=null,E=null;o.getUrl=function(){return o.options.url},o.setUrl=function(e,t){o.options.url=e,v({url:o.options.url,method:"GET",dataType:"json",success:function(e){o.setData(e),"function"==typeof t&&t(o)}})},o.setId=function(e,t){if(o.options.format)n="id";else var n="value";"object"==typeof e?e[n]=t:o.items[e].data[n]=t},o.add=function(e,n){if(!e){var i=1==o.options.autocomplete?o.header.value:"";if(!(e=prompt(c.translate("Add A New Option"),i)))return!1}if(n||(n=t.guid()),o.options.format)a={id:n,name:e};else var a={value:n,text:e};if("function"==typeof o.options.onbeforeinsert){var s=o.options.onbeforeinsert(o,a);if(!1===s)return!1;s&&(a=s)}o.options.data.push(a);var r=o.createItem(a);return x.appendChild(r.element),"function"==typeof o.options.oninsert&&o.options.oninsert(o,a,r),"none"==x.style.display&&(x.style.display=""),o.results&&o.results.push(r),a},o.createItem=function(e,t,n){o.options.format?(e.id||void 0===e.value||(e.id=e.value),e.name||void 0===e.text||(e.name=e.text)):(e.value||void 0===e.id||(e.value=e.id),e.text||void 0===e.name||(e.text=e.name));var i={};if(i.element=document.createElement("div"),i.element.className="jdropdown-item",i.element.indexValue=o.items.length,i.data=e,t&&(i.group=t),e.id&&i.element.setAttribute("id",e.id),1==e.disabled&&i.element.setAttribute("data-disabled",!0),e.tooltip&&i.element.setAttribute("title",e.tooltip),e.image){var a=document.createElement("img");a.className="jdropdown-image",a.src=e.image,e.title||a.classList.add("jdropdown-image-small"),i.element.appendChild(a)}else if(e.icon){var s=document.createElement("span");s.className="jdropdown-icon material-icons",s.innerText=e.icon,e.title||s.classList.add("jdropdown-icon-small"),e.color&&(s.style.color=e.color),i.element.appendChild(s)}else if(e.color){var r=document.createElement("div");r.className="jdropdown-color",r.style.backgroundColor=e.color,i.element.appendChild(r)}if(o.options.format)l=e.name;else var l=e.text;var d=document.createElement("div");if(d.className="jdropdown-description",d.textContent=l||"&nbsp;",e.title){var c=document.createElement("div");c.className="jdropdown-title",c.innerText=e.title,d.appendChild(c)}if(o.options.format)u=e.id;else var u=e.value;return o.value[u]&&(i.element.classList.add("jdropdown-selected"),i.selected=!0),o.items.push(i),i.element.appendChild(d),i},o.appendData=function(e){if(e.length){for(var t=[],n=[],i=0;i<e.length;i++)e[i].group?(n[e[i].group]||(n[e[i].group]=[]),n[e[i].group].push(i)):t.push(i);var a=0,s=Object.keys(n);if(s.length>0)for(i=0;i<s.length;i++){var r=document.createElement("div");r.className="jdropdown-group";var l=document.createElement("div");l.className="jdropdown-group-name",l.textContent=s[i];var d=document.createElement("i");d.className="jdropdown-group-arrow jdropdown-group-arrow-down",l.appendChild(d);var c=document.createElement("div");c.className="jdropdown-group-items";for(var u=0;u<n[s[i]].length;u++){var p=o.createItem(e[n[s[i]][u]],r,s[i]);(0==o.options.lazyLoading||a<200)&&(c.appendChild(p.element),a++)}r.appendChild(l),r.appendChild(c),o.groups.push(r),c.children.length>0&&x.appendChild(r)}if(t.length)for(i=0;i<t.length;i++)p=o.createItem(e[t[i]]),(0==o.options.lazyLoading||a<200)&&(x.appendChild(p.element),a++)}},o.setData=function(e){if(r(),x.textContent="",o.header.value="",o.items=[],e&&e.length){for(var t=0;t<e.length;t++)"object"!=typeof e[t]&&(o.options.format?e[t]={id:e[t],name:e[t]}:e[t]={value:e[t],text:e[t]});o.appendData(e),o.options.data=e}else o.options.data=[];o.close()},o.getData=function(){return o.options.data},o.getPosition=function(e){for(var t=0;t<o.items.length;t++)if(d(t)==e)return t;return!1},o.getText=function(e){var t=h();return e?t:t.join("; ")},o.getValue=function(e){var t=f();return e?t:t.join(";")};var C=function(e){n.value!=o.options.value&&(n.value=o.options.value,"function"==typeof n.oninput&&n.oninput({type:"input",target:n,value:n.value})),"function"==typeof o.options.onchange&&o.options.onchange(n,o,e,o.options.value)};o.setValue=function(e){var t=o.getValue();Array.isArray(e)&&(e=e.join(";")),t!==e&&(l(e),C(t))},o.resetSelected=function(){o.setValue(null)},o.selectIndex=function(e,t){if(e=parseInt(e),o.items&&o.items[e]&&(!0===t||!0!==o.items[e].data.disabled))if(o.setCursor(e,!1),o.options.multiple){var n=o.options.value;o.items[e].selected?(o.items[e].element.classList.remove("jdropdown-selected"),o.items[e].selected=!1,delete o.value[d(e)]):(o.items[e].element.classList.add("jdropdown-selected"),o.items[e].selected=!0,o.value[d(e)]=u(e)),o.options.value=Object.keys(o.value).join(";"),0==o.options.autocomplete&&(o.header.value=h().join("; ")),C(n)}else o.items[e].selected?o.setValue(null):o.setValue(d(e)),o.close()},o.selectItem=function(e){o.selectIndex(e.indexValue)};var T=function(e,t){for(var n=0;n<t.length;n++)if(o.options.format){if(t[n].id==e)return!0}else if(t[n].value==e)return!0;return!1};return o.find=function(e){if(o.search==e.trim())return!1;if(o.search=e,o.setCursor(),o.groups.length)for(var t=0;t<o.groups.length;t++)o.groups[t].lastChild.textContent="";if(x.textContent="",1==o.options.remoteSearch){o.results=null;let t={url:o.options.url,method:"GET",data:{q:e},dataType:"json",success:function(e){o.items=[];var t=Object.keys(o.value);if(t.length)for(var n=0;n<t.length;n++)T(t[n],e)||(o.options.format?e.unshift({id:t[n],name:o.value[t[n]]}):e.unshift({value:t[n],text:o.value[t[n]]}));o.appendData(e),e.length?x.style.display="":x.style.display="none","function"==typeof o.options.onsearch&&o.options.onsearch(o,e)}};if("function"==typeof o.options.onbeforesearch){let e=o.options.onbeforesearch(o,t);if(!1===e)return;"object"==typeof e&&(t=e)}v(t)}else{e=new RegExp(e,"gi");var n=[];for(t=0;t<o.items.length;t++){var i=u(t),a=o.items[t].data.title||"",s=o.items[t].data.group||"",r=o.items[t].data.synonym||"";r&&(r=r.join(" ")),(null==e||1==o.items[t].selected||i.match(e)||a.match(e)||s.match(e)||r.match(e))&&n.push(o.items[t])}if(n.length){x.style.display="",o.results=n;var l=n.length||0;for(1==o.options.lazyLoading&&l>200&&(l=200),t=0;t<l;t++)o.results[t].group?(o.results[t].group.parentNode||x.appendChild(o.results[t].group),o.results[t].group.lastChild.appendChild(o.results[t].element)):x.appendChild(o.results[t].element)}else x.style.display="none",o.results=null}1==o.options.autofocus&&o.first()},o.open=function(){if(!n.classList.contains("jdropdown-focus")){e.current=o,p(o,!0),n.classList.add("jdropdown-focus"),t.getWindowWidth()<800&&(null!=o.options.type&&"picker"!=o.options.type||g.slideBottom(b,1)),1==o.options.autocomplete&&(o.header.value=o.search,o.header.focus());var i=f();if(i[0]){var a=o.getPosition(i[0]);!1!==a&&o.setCursor(a)}if(!o.options.type||"default"==o.options.type){var s=n.getBoundingClientRect(),r=b.getBoundingClientRect();o.options.position?(b.style.position="fixed",window.innerHeight<s.bottom+r.height?(b.style.top="",b.style.bottom=window.innerHeight-s.top+1+"px"):(b.style.top=s.bottom+"px",b.style.bottom=""),b.style.left=s.left+"px"):window.innerHeight<s.bottom+r.height?(b.style.top="",b.style.bottom=s.height+1+"px"):(b.style.top="",b.style.bottom=""),b.style.minWidth=s.width+"px",o.options.maxWidth&&(b.style.maxWidth=o.options.maxWidth),o.items.length||1!=o.options.autocomplete?x.style.display="":x.style.display="none"}}"function"==typeof o.options.onopen&&o.options.onopen(n)},o.close=function(t){return n.classList.contains("jdropdown-focus")&&(o.header.value=o.getText(),o.setCursor(),t||"function"!=typeof o.options.onclose||o.options.onclose(n),o.header.blur&&o.header.blur(),n.classList.remove("jdropdown-focus"),p(o,!1),e.current=null),o.getValue()},o.setCursor=function(e,t){if(null!=o.currentIndex&&o.items&&o.items[o.currentIndex]&&o.items[o.currentIndex].element.classList.remove("jdropdown-cursor"),null==e)o.currentIndex=null;else if(e=parseInt(e),o.items[e].element.parentNode&&(o.items[e].element.classList.add("jdropdown-cursor"),o.currentIndex=e,!1!==t&&o.items[o.currentIndex].element)){x.scrollTop;var n=o.items[o.currentIndex].element;x.scrollTop=n.offsetTop-n.scrollTop+n.clientTop-95}},o.resetCursor=o.setCursor,o.updateCursor=o.setCursor,o.reset=function(){o.setCursor(),o.setValue(null)},o.first=function(){!0===o.options.lazyLoading&&o.loadFirst();var e=x.querySelectorAll(".jdropdown-item");if(e.length){var t=e[0].indexValue;o.setCursor(t)}},o.last=function(){!0===o.options.lazyLoading&&o.loadLast();var e=x.querySelectorAll(".jdropdown-item");if(e.length){var t=e[e.length-1].indexValue;o.setCursor(t)}},o.next=function(e){var t=null;if(e){if(1==e.length){var n=o.currentIndex||-1;e=e.toLowerCase();var i=null,a=null,s=x.querySelectorAll(".jdropdown-item");if(s.length){for(var r=0;r<s.length;r++)if(s[r].indexValue>n&&(i=o.items[s[r].indexValue])&&(a=i.element.innerText[0])&&e==(a=a.toLowerCase())){t=s[r].indexValue;break}o.setCursor(t)}}}else if(null==o.currentIndex||null==o.currentIndex)o.first();else{var l=o.items[o.currentIndex].element,d=l.nextElementSibling;d?(d.classList.contains("jdropdown-group")&&(d=d.lastChild.firstChild),t=d.indexValue):l.parentNode.classList.contains("jdropdown-group-items")&&((d=l.parentNode.parentNode.nextElementSibling)&&(d.classList.contains("jdropdown-group")?d=d.lastChild.firstChild:d.classList.contains("jdropdown-item")?t=d.indexValue:d=null),d&&(t=d.indexValue)),null!==t&&o.setCursor(t)}},o.prev=function(){var e=null;if(null===o.currentIndex)o.first();else{var t=o.items[o.currentIndex].element,n=t.previousElementSibling;n?(n.classList.contains("jdropdown-group")&&(n=n.lastChild.lastChild),e=n.indexValue):t.parentNode.classList.contains("jdropdown-group-items")&&((n=t.parentNode.parentNode.previousElementSibling)&&(n.classList.contains("jdropdown-group")?n=n.lastChild.lastChild:n.classList.contains("jdropdown-item")?e=n.indexValue:n=null),n&&(e=n.indexValue))}null!==e&&o.setCursor(e)},o.loadFirst=function(){if(o.results)var e=o.results;else e=o.items;var t=e.length||0;1==o.options.lazyLoading&&t>200&&(t=200),x.textContent="";for(var n=0;n<t;n++)e[n].group?(e[n].group.parentNode||x.appendChild(e[n].group),e[n].group.lastChild.appendChild(e[n].element)):x.appendChild(e[n].element);x.scrollTop=0},o.loadLast=function(){if(o.results)var e=o.results;else e=o.items;var t=e.length;if(t>200){t-=200,x.textContent="";for(var n=t;n<e.length;n++)e[n].group?(e[n].group.parentNode||x.appendChild(e[n].group),e[n].group.lastChild.appendChild(e[n].element)):x.appendChild(e[n].element);x.scrollTop=x.scrollHeight}},o.loadUp=function(){var e=!1;if(o.results)var t=o.results;else t=o.items;var n=x.querySelectorAll(".jdropdown-item")[0].indexValue;n=o.items[n];var i=t.indexOf(n)-1;if(i>0){for(var a=0;i>0&&t[i]&&a<200;)t[i].group?(t[i].group.parentNode||x.insertBefore(t[i].group,x.firstChild),t[i].group.lastChild.insertBefore(t[i].element,t[i].group.lastChild.firstChild)):x.insertBefore(t[i].element,x.firstChild),i--,a++;e=!0}return e},o.loadDown=function(){var e=!1;if(o.results)var t=o.results;else t=o.items;var n=x.querySelectorAll(".jdropdown-item"),i=n[n.length-1].indexValue;i=o.items[i];var a=t.indexOf(i)+1;if(a<t.length){for(var s=0;a<t.length&&t[a]&&s<200;)t[a].group?(t[a].group.parentNode||x.appendChild(t[a].group),t[a].group.lastChild.appendChild(t[a].element)):x.appendChild(t[a].element),a++,s++;e=!0}return e},function(){if(i||(i={}),"SELECT"==n.tagName){var t=e.extractFromDom(n,i);n=t.el,i=t.options}!i.placeholder&&n.getAttribute("placeholder")&&(i.placeholder=n.getAttribute("placeholder")),o.value={},o.items=[],o.groups=[],o.search="",o.results=null,n.classList.add("jdropdown"),(y=document.createElement("div")).className="jdropdown-container-header",o.header=document.createElement("input"),o.header.className="jdropdown-header jss_object",o.header.type="text",o.header.setAttribute("autocomplete","off"),o.header.onfocus=function(){"function"==typeof o.options.onfocus&&o.options.onfocus(n)},o.header.onblur=function(){"function"==typeof o.options.onblur&&o.options.onblur(n)},o.header.onkeyup=function(e){1!=o.options.autocomplete||E?o.options.autocomplete||o.next(e.key):(o.search!=o.header.value.trim()&&(E=setTimeout((function(){o.find(o.header.value.trim()),E=null}),400)),n.classList.contains("jdropdown-focus")||o.open())},e.hasEvents||(e.hasEvents=!0,document.addEventListener("keydown",e.keydown)),(b=document.createElement("div")).className="jdropdown-container",(x=document.createElement("div")).className="jdropdown-content",(w=document.createElement("div")).className="jdropdown-close",w.textContent="Done",(L=document.createElement("div")).className="jdropdown-reset",L.textContent="x",L.onclick=function(){o.reset(),o.close()},(j=document.createElement("div")).className="jdropdown-backdrop",y.appendChild(o.header),b.appendChild(x),n.appendChild(y),n.appendChild(b),n.appendChild(j),o.setOptions(i),"ontouchsend"in document.documentElement==1?n.addEventListener("touchsend",e.mouseup):n.addEventListener("mouseup",e.mouseup),1==o.options.lazyLoading&&m(x,{loadUp:o.loadUp,loadDown:o.loadDown}),x.onwheel=function(e){e.stopPropagation()},n.change=o.setValue,n.val=function(e){if(void 0===e)return o.getValue(!!o.options.multiple);o.setValue(e)},n.dropdown=o}(),o};return e.keydown=function(t){var n=null;if(n=e.current)if(13==t.which||9==t.which)n.header.value&&null==n.currentIndex&&n.options.newOptions?n.add():(null==n.currentIndex&&1==n.options.autocomplete&&""!=n.header.value&&n.find(n.header.value),n.selectIndex(n.currentIndex));else if(38==t.which)null==n.currentIndex?n.first():n.currentIndex>0&&n.prev(),t.preventDefault();else if(40==t.which)null==n.currentIndex?n.first():n.currentIndex+1<n.items.length&&n.next(),t.preventDefault();else if(36==t.which)n.first(),t.target.classList.contains("jdropdown-header")||t.preventDefault();else if(35==t.which)n.last(),t.target.classList.contains("jdropdown-header")||t.preventDefault();else if(27==t.which)n.close();else if(33==t.which){if(null==n.currentIndex)n.first();else if(n.currentIndex>0)for(var i=0;i<7;i++)n.prev();t.preventDefault()}else if(34==t.which){if(null==n.currentIndex)n.first();else if(n.currentIndex+1<n.items.length)for(i=0;i<7;i++)n.next();t.preventDefault()}},e.mouseup=function(e){var n=t.findElement(e.target,"jdropdown");if(n){var i=n.dropdown;if(e.target.classList.contains("jdropdown-header"))if(n.classList.contains("jdropdown-focus")&&n.classList.contains("jdropdown-default")){var o=n.getBoundingClientRect();if(e.changedTouches&&e.changedTouches[0]){var a=e.changedTouches[0].clientX;e.changedTouches[0].clientY}else a=e.clientX,e.clientY;o.width-(a-o.left)<30?e.target.classList.contains("jdropdown-add")?i.add():i.close():0==i.options.autocomplete&&i.close()}else i.open();else if(e.target.classList.contains("jdropdown-group-name")){var s=e.target.nextSibling.children;if("none"!=e.target.nextSibling.style.display)for(var r=0;r<s.length;r++)"none"!=s[r].style.display&&i.selectItem(s[r])}else e.target.classList.contains("jdropdown-group-arrow")?e.target.classList.contains("jdropdown-group-arrow-down")?(e.target.classList.remove("jdropdown-group-arrow-down"),e.target.classList.add("jdropdown-group-arrow-up"),e.target.parentNode.nextSibling.style.display="none"):(e.target.classList.remove("jdropdown-group-arrow-up"),e.target.classList.add("jdropdown-group-arrow-down"),e.target.parentNode.nextSibling.style.display=""):e.target.classList.contains("jdropdown-item")?i.selectItem(e.target):e.target.classList.contains("jdropdown-image")||e.target.classList.contains("jdropdown-description")?i.selectItem(e.target.parentNode):e.target.classList.contains("jdropdown-title")?i.selectItem(e.target.parentNode.parentNode):(e.target.classList.contains("jdropdown-close")||e.target.classList.contains("jdropdown-backdrop"))&&i.close()}},e.extractFromDom=function(e,t){var n=e;if(t||(t={}),!e.getAttribute("multiple")||t&&null!=t.multiple||(t.multiple=!0),!e.getAttribute("placeholder")||t&&null!=t.placeholder||(t.placeholder=e.getAttribute("placeholder")),!e.getAttribute("data-autocomplete")||t&&null!=t.autocomplete||(t.autocomplete=!0),t&&null!=t.width||(t.width=e.offsetWidth),!e.value||t&&null!=t.value||(t.value=e.value),!t||null==t.data){t.data=[];for(var i=0;i<e.children.length;i++)if("OPTGROUP"==e.children[i].tagName)for(var o=0;o<e.children[i].children.length;o++)t.data.push({value:e.children[i].children[o].value,text:e.children[i].children[o].textContent,group:e.children[i].getAttribute("label")});else t.data.push({value:e.children[i].value,text:e.children[i].textContent})}t&&null!=t.onchange||(t.onchange=function(e,i,o,a){1==t.multiple?obj.items[i].classList.contains("jdropdown-selected")?n.options[i].setAttribute("selected","selected"):n.options[i].removeAttribute("selected"):n.value=a});var a=document.createElement("div");return e.parentNode.insertBefore(a,e),e.style.display="none",{el:e=a,options:t}},e}();function k(e,n){if(e.picker)return e.picker.setOptions(n,!0);var i={type:"picker",options:{}},o=null,a=null,s=function(e){return e instanceof Element||e instanceof HTMLDocument};return i.setOptions=function(e,t){var n={value:0,data:null,render:null,onchange:null,onmouseover:null,onselect:null,onopen:null,onclose:null,onload:null,width:null,header:!0,right:!1,bottom:!1,content:!1,columns:null,grid:null,height:null};for(var r in e&&e.options&&(e.data=e.options),n)e&&e.hasOwnProperty(r)?i.options[r]=e[r]:void 0!==i.options[r]&&!0!==t||(i.options[r]=n[r]);return!1===i.options.header?o.style.display="none":o.style.display="",i.options.width?o.style.width=parseInt(i.options.width)+"px":o.style.width="",i.options.height?(a.style.maxHeight=i.options.height+"px",a.style.overflow="scroll"):a.style.overflow="",i.options.columns>0&&(i.options.grid?(a.classList.add("jpicker-grid"),a.style.gridTemplateColumns="repeat("+i.options.grid+", 1fr)"):(a.classList.add("jpicker-columns"),a.style.width=i.options.width?i.options.width:36*i.options.columns+"px")),isNaN(parseInt(i.options.value))&&(i.options.value=0),function(){a.innerHTML="";for(var e=Object.keys(i.options.data),t=0;t<e.length;t++){var n=document.createElement("div");n.classList.add("jpicker-item"),n.k=e[t],n.v=i.options.data[e[t]];var o=i.getLabel(e[t],n);s(o)?n.appendChild(o):n.innerHTML=o,a.appendChild(n)}}(),i.setValue(i.options.value),i},i.getValue=function(){return i.options.value},i.setValue=function(t,n){if(i.setLabel(t),i.options.value=String(t),e.value!=i.options.value&&(e.value=i.options.value,"function"==typeof e.oninput&&e.oninput({type:"input",target:e,value:e.value})),a.children[t]&&"generic"!==a.children[t].getAttribute("type")&&i.close(),n&&"function"==typeof i.options.onchange){var o=i.options.data[t];i.options.onchange(e,i,o,o,t,n)}},i.getLabel=function(e,t){var n=i.options.data[e]||null;return"function"==typeof i.options.render&&(n=i.options.render(n,t)),n},i.setLabel=function(e){var t;t=i.options.content?'<i class="material-icons">'+i.options.content+"</i>":i.getLabel(e,null),s(t)?(o.innerHTML="",o.appendChild(t)):o.innerHTML=t},i.open=function(){if(!e.classList.contains("jpicker-focus")){p(i,!0),e.classList.add("jpicker-focus"),e.focus();var t,n=0;a.style.marginLeft="";var s=o.getBoundingClientRect(),r=a.getBoundingClientRect();t=window.innerHeight<s.bottom+r.height||i.options.bottom?-1*(r.height+4):s.height+4,!0===i.options.right&&(n=-1*r.width+s.width),r.left+n<0&&(n=n+r.left+10),r.left+r.width>window.innerWidth&&(n=-1*(10+r.left+r.width-window.innerWidth)),a.style.marginTop=parseInt(t)+"px",a.style.marginLeft=parseInt(n)+"px","function"==typeof i.options.onopen&&i.options.onopen(e,i)}},i.close=function(){e.classList.contains("jpicker-focus")&&(e.classList.remove("jpicker-focus"),p(i,!1),"function"==typeof i.options.onclose&&i.options.onclose(e,i))},e.classList.add("jpicker"),e.setAttribute("tabindex","900"),e.onmousedown=function(t){e.classList.contains("jpicker-focus")||i.open()},(o=document.createElement("div")).classList.add("jpicker-header"),(a=document.createElement("div")).classList.add("jpicker-content"),a.onclick=function(e){var n=t.findElement(e.target,"jpicker-item");n&&n.parentNode===a&&i.setValue(n.k,e)},e.appendChild(o),e.appendChild(a),e.value=n.value||0,i.setOptions(n),"function"==typeof i.options.onload&&i.options.onload(e,i),e.change=i.setValue,e.val=function(e){if(void 0===e)return i.getValue();i.setValue(e)},e.picker=i,i}function A(e,n){var i={type:"toolbar",options:{}},o={app:null,container:!1,badge:!1,title:!1,responsive:!1,maxWidth:null,bottom:!0,items:[]};for(var a in o)n&&n.hasOwnProperty(a)?i.options[a]=n[a]:i.options[a]=o[a];!e&&n.app&&n.app.el&&(e=document.createElement("div"),n.app.el.appendChild(e));var s=document.createElement("div");s.classList.add("jtoolbar-item"),s.classList.add("jtoolbar-arrow");var r=document.createElement("div");r.classList.add("jtoolbar-floating"),s.appendChild(r),i.selectItem=function(e){for(var t=l.children,n=0;n<t.length;n++)e!=t[n]&&t[n].classList.remove("jtoolbar-selected");e.classList.add("jtoolbar-selected")},i.hide=function(){g.slideBottom(e,0,(function(){e.style.display="none"}))},i.show=function(){e.style.display="",g.slideBottom(e,1)},i.get=function(){return e},i.setBadge=function(e,t){l.children[e].children[1].firstChild.innerHTML=t},i.destroy=function(){toolbar.remove(),e.innerHTML=""},i.update=function(t,n){for(var o=0;o<l.children.length;o++)"function"==typeof(a=l.children[o]).updateState&&a.updateState(e,i,a,t,n);for(o=0;o<r.children.length;o++){var a;"function"==typeof(a=r.children[o]).updateState&&a.updateState(e,i,a,t,n)}},i.create=function(t){l.innerHTML="";for(var n=0;n<t.length;n++){var o=document.createElement("div");if(o.classList.add("jtoolbar-item"),t[n].width&&(o.style.width=parseInt(t[n].width)+"px"),t[n].k&&(o.k=t[n].k),t[n].tooltip&&o.setAttribute("title",t[n].tooltip),t[n].id&&o.setAttribute("id",t[n].id),t[n].updateState&&(o.updateState=t[n].updateState),t[n].active&&o.classList.add("jtoolbar-active"),t[n].disabled&&o.classList.add("jtoolbar-disabled"),"select"==t[n].type||"dropdown"==t[n].type)k(o,t[n]);else if("divisor"==t[n].type)o.classList.add("jtoolbar-divisor");else if("label"==t[n].type)o.classList.add("jtoolbar-label"),o.innerHTML=t[n].content;else{var a=document.createElement("i");if(void 0===t[n].class)a.classList.add("material-icons");else for(var s=t[n].class.split(" "),r=0;r<s.length;r++)a.classList.add(s[r]);if(a.innerHTML=t[n].content?t[n].content:"",o.appendChild(a),1==i.options.badge){var d=document.createElement("div");d.classList.add("jbadge");var c=document.createElement("div");c.innerHTML=t[n].badge?t[n].badge:"",d.appendChild(c),o.appendChild(d)}if(t[n].title)if(1==i.options.title){var u=document.createElement("span");u.innerHTML=t[n].title,o.appendChild(u)}else o.setAttribute("title",t[n].title);i.options.app&&t[n].route&&(o.route=t[n].route,o.onclick=function(){i.options.app.pages(this.route)},i.options.app.pages(t[n].route,{toolbarItem:o,closed:!0})),"function"==typeof t[n].render&&t[n].render(o,t[n])}t[n].onclick&&(o.onclick=t[n].onclick.bind(t[n],e,i,o)),l.appendChild(o)}setTimeout((function(){i.refresh()}),0)},i.open=function(){s.classList.add("jtoolbar-arrow-selected"),e.getBoundingClientRect(),r.getBoundingClientRect().bottom>window.innerHeight||i.options.bottom?r.style.bottom="0":r.style.removeProperty("bottom"),r.style.right="0",s.children[0].focus(),p(i,!0)},i.close=function(){s.classList.remove("jtoolbar-arrow-selected"),p(i,!1)},i.refresh=function(){if(1==i.options.responsive){var t=e.parentNode.getBoundingClientRect();i.options.maxWidth||(i.options.maxWidth=t.width);var n=parseInt(i.options.maxWidth);for(s.parentNode&&s.parentNode.removeChild(s);r.firstChild;)l.appendChild(r.firstChild);if(n<l.offsetWidth)for(n-=50;l.lastChild&&n<l.offsetWidth;)r.insertBefore(l.lastChild,r.firstChild);r.children.length>0&&l.appendChild(s)}},i.setReadonly=function(t){t=t?"add":"remove",e.classList[t]("jtoolbar-disabled")},e.onclick=function(e){var n=t.findElement(e.target,"jtoolbar-item");n&&i.selectItem(n),e.target.classList.contains("jtoolbar-arrow")&&i.open()},window.addEventListener("resize",(function(){i.refresh()})),e.classList.add("jtoolbar"),e.innerHTML="",1==i.options.container&&e.classList.add("jtoolbar-container");var l=document.createElement("div");return e.appendChild(l),i.options.app&&e.classList.add("jtoolbar-mobile"),i.create(i.options.items),e.toolbar=i,i}var M=function(){var e=function(n,i){var o={type:"editor",options:{}},a={url:null,value:"",snippet:null,toolbar:!0,toolbarOnTop:!1,remoteParser:null,placeholder:null,filterPaste:!0,dropZone:!0,dropAsSnippet:!1,acceptImages:!0,acceptFiles:!1,maxFileSize:5e6,allowImageResize:!0,maxHeight:null,height:null,focus:!1,onclick:null,onfocus:null,onblur:null,onload:null,onkeyup:null,onkeydown:null,onchange:null,extensions:null,type:null};for(var s in a)i&&i.hasOwnProperty(s)?o.options[s]=i[s]:o.options[s]=a[s];var r=null,l=null,d=[];o.el=n,"function"==typeof o.options.onclick&&(n.onclick=function(e){o.options.onclick(n,o,e)}),n.classList.add("jeditor-container");var c=document.createElement("div");c.className="jsnippet",c.setAttribute("contenteditable",!1);var u=document.createElement("div");if(u.className="jeditor-toolbar",o.editor=document.createElement("div"),o.editor.setAttribute("contenteditable",!0),o.editor.setAttribute("spellcheck",!1),o.editor.classList.add("jeditor"),o.options.placeholder&&o.editor.setAttribute("data-placeholder",o.options.placeholder),(o.options.maxHeight||o.options.height)&&(o.editor.style.overflowY="auto",o.options.maxHeight&&(o.editor.style.maxHeight=o.options.maxHeight),o.options.height&&(o.editor.style.height=o.options.height)),o.options.url)v({url:o.options.url,dataType:"html",success:function(t){o.editor.innerHTML=t,e.setCursor(o.editor,"initial"==o.options.focus)}});else if(o.options.value)o.editor.innerHTML=o.options.value;else for(var p=0;p<n.children.length;p++)o.editor.appendChild(n.children[p]);n.innerHTML="";var f=function(e){"function"==typeof o.options.onchange&&o.options.onchange(n,o,e),o.options.value=o.getData(),n.value!=o.options.value&&(n.value=o.options.value,"function"==typeof n.oninput&&n.oninput({type:"input",target:n,value:n.value}))},h=function(){var e=null;if(e=c.children[0]){e.classList.contains("jslider-grid")||e.classList.add("jslider-grid");var t=e.children.length;e.setAttribute("data-number",t>4?4:t),t>4?e.setAttribute("data-total",t-4):e.removeAttribute("data-total")}};o.appendSnippet=function(e){c.innerHTML="";for(var t=["image","title","description","host","url"],n=0;n<t.length;n++){var i=document.createElement("div");if(i.className="jsnippet-"+t[n],i.setAttribute("data-k",t[n]),c.appendChild(i),e[t[n]])if("image"==t[n]){Array.isArray(e.image)||(e.image=[e.image]);for(var a=0;a<e.image.length;a++){var s=document.createElement("img");s.src=e.image[a],i.appendChild(s)}}else i.innerHTML=e[t[n]]}o.editor.appendChild(document.createElement("br")),o.editor.appendChild(c)},o.setData=function(t){o.editor.innerHTML="object"==typeof t?t.content:t,o.options.focus&&e.setCursor(o.editor,!0),d=[]},o.getFiles=function(){for(var e=o.editor.querySelectorAll(".jfile"),t=[],n=0;n<e.length;n++)d[e[n].src]&&t.push(d[e[n].src]);return t},o.getText=function(){return o.editor.innerText},o.getData=function(e){if(e){if(u={content:""},c.innerHTML){u.snippet={};for(var t=0;t<c.children.length;t++){var n=c.children[t].getAttribute("data-k");if(n)if("image"==n){u.snippet.image||(u.snippet.image=[]);for(var i=0;i<c.children[t].children.length;i++)u.snippet.image.push(c.children[t].children[i].getAttribute("src"))}else u.snippet[n]=c.children[t].innerHTML}}var a=Object.keys(d);if(a.length)for(u.files=[],t=0;t<a.length;t++)u.files.push(d[a[t]]);var s=document.createElement("div");s.innerHTML=o.editor.innerHTML;var r=s.querySelector(".jsnippet");r&&r.remove();var l=s.innerHTML;l=(l=(l=l.replace(/<br>/g,"\n")).replace(/<\/div>/g,"</div>\n")).replace(/<(?:.|\n)*?>/gm,""),u.content=l.trim(),H("getData",u)}else var u=o.editor.innerHTML;return u},o.reset=function(){o.editor.innerHTML="",c.innerHTML="",d=[]},o.addPdf=function(e){if("data"!=e.result.substr(0,4))console.error("Invalid source");else{var t=document.createElement("canvas");t.width=60,t.height=60;var n=new Image;t.getContext("2d").drawImage(n,0,0,t.width,t.height),t.toBlob((function(t){var n=document.createElement("img");n.src=window.URL.createObjectURL(t),n.title=e.name,n.className="jfile pdf",d[n.src]={file:n.src,extension:"pdf",content:e.result},document.execCommand("insertHtml",!1,n.outerHTML)}))}},o.addImage=function(e,t){if(e||(e=""),"data"==e.substr(0,4)||o.options.remoteParser){if("data"==e.substr(0,4))n=(n=(n=e.split(";"))[0].split("/"))[1];else{var n=e.substr(e.lastIndexOf(".")+1);e=o.options.remoteParser+e}var i=new Image;i.onload=function(){var e=document.createElement("canvas");e.width=i.width,e.height=i.height,e.getContext("2d").drawImage(i,0,0,e.width,e.height),e.toBlob((function(a){var s,r=document.createElement("img");r.src=window.URL.createObjectURL(a),r.classList.add("jfile"),r.setAttribute("tabindex","900"),r.setAttribute("width",i.width),r.setAttribute("height",i.height),d[r.src]={file:r.src,extension:n,content:e.toDataURL()},o.options.dropAsSnippet||t?(s=r,c.innerHTML||o.appendSnippet({}),c.children[0].appendChild(s),h(),d[r.src].snippet=!0):document.execCommand("insertHtml",!1,r.outerHTML),f()}))},i.src=e}else console.error("remoteParser not defined in your initialization")},o.addFile=function(e){for(var t=[],n=0;n<e.length;n++)if(e[n].size>o.options.maxFileSize)alert("The file is too big");else{var i=e[n].type.split("/");(i="image"==i[0]?1:"pdf"==i[1]?2:0)?(t[n]=new FileReader,t[n].index=n,t[n].type=i,t[n].name=e[n].name,t[n].date=e[n].lastModified,t[n].size=e[n].size,t[n].addEventListener("load",(function(e){2==e.target.type?1==o.options.acceptFiles&&o.addPdf(e.target):o.addImage(e.target.result)}),!1),t[n].readAsDataURL(e[n])):alert("The extension is not allowed")}},o.destroy=function(){o.editor.removeEventListener("mouseup",N),o.editor.removeEventListener("mousedown",O),o.editor.removeEventListener("mousemove",I),o.editor.removeEventListener("keyup",M),o.editor.removeEventListener("keydown",D),o.editor.removeEventListener("dragstart",L),o.editor.removeEventListener("dragenter",j),o.editor.removeEventListener("dragover",E),o.editor.removeEventListener("drop",C),o.editor.removeEventListener("paste",w),o.editor.removeEventListener("blur",T),o.editor.removeEventListener("focus",k),n.editor=null,n.classList.remove("jeditor-container"),u.remove(),c.remove(),o.editor.remove()},o.upload=function(){t.click(o.file)};var m=[HTMLUnknownElement,HTMLAudioElement,HTMLEmbedElement,HTMLIFrameElement,HTMLTextAreaElement,HTMLInputElement,HTMLScriptElement],g=["width","height","align","border","src","tabindex"],y=["color","font-weight","font-size","background","background-color","margin"],b=function(e){if(e.attributes&&e.attributes.length){var t=null,n=e.getAttribute("style");if(n){t=[];for(var i=n.split(";"),a=0;a<i.length;a++){var s=i[a].trim().split(":");if(y.indexOf(s[0].trim())>=0){var r=s.shift();s=s.join(":"),t.push(r+":"+s)}}}"IMG"==e.tagName.toUpperCase()&&(o.options.acceptImages&&e.src?(e.setAttribute("tabindex","900"),o.addImage(e.src)):e.parentNode.removeChild(e));for(var l=[],d=0;d<e.attributes.length;d++)l.push(e.attributes[d].name);l.length&&l.forEach((function(t){-1==g.indexOf(t)?e.removeAttribute(t):-1!==e.attributes[d].value.indexOf("<")&&e.attributes[d].value.replace("<","&#60;")})),e.style="",t&&t.length&&e.setAttribute("style",t.join(";"))}if(e.children.length)for(d=0;d<e.children.length;d++)b(e.children[d]);m.indexOf(e.constructor)>=0&&e.remove()},x=function(e){var t=window.getSelection(),n=document.createRange();n.selectNode(e),t.addRange(n)},w=function(e){if(1==o.options.filterPaste){if(e.clipboardData||e.originalEvent.clipboardData)var t=(e.originalEvent||e).clipboardData.getData("text/html"),n=(e.originalEvent||e).clipboardData.getData("text/plain"),i=(e.originalEvent||e).clipboardData.files;else window.clipboardData&&(t=window.clipboardData.getData("Html"),n=window.clipboardData.getData("Text"),i=window.clipboardData.files);if(i.length)o.addFile(i);else if(t){var a=function(e){e&&(e=e.replace(new RegExp("\x3c!--(.*?)--\x3e","gsi"),""));var t=(new DOMParser).parseFromString(e,"text/html");b(t);var n=document.createElement("span");return n.innerHTML=t.firstChild.innerHTML,n}(t);document.execCommand("insertHtml",!1,a.innerHTML)}else t=n.split("\r\n"),e.target.innerText?(t=t.map((function(e){return"<div>"+e+"</div>"})),document.execCommand("insertHtml",!1,t.join(""))):t.map((function(e){var t=document.createElement("div");t.innerText=e,o.editor.appendChild(t)}));e.preventDefault()}},L=function(e){l&&l.e&&e.preventDefault()},j=function(e){l||0==o.options.dropZone||(n.classList.add("jeditor-dragging"),e.preventDefault())},E=function(e){l||0==o.options.dropZone||(r&&clearTimeout(r),r=setTimeout((function(){n.classList.remove("jeditor-dragging")}),100),e.preventDefault())},C=function(e){if(l||0==o.options.dropZone);else{var t=null;document.caretRangeFromPoint?t=document.caretRangeFromPoint(e.clientX,e.clientY):e.rangeParent&&(t=document.createRange()).setStart(e.rangeParent,e.rangeOffset);var i=window.getSelection();i.removeAllRanges(),i.addRange(t),i.anchorNode.parentNode.focus();var a=(e.originalEvent||e).dataTransfer.getData("text/html"),s=(e.originalEvent||e).dataTransfer.getData("text/plain"),r=(e.originalEvent||e).dataTransfer.files;r.length?o.addFile(r):s&&function(e){var t=document.createElement("div");t.innerHTML=e;var n=t.querySelectorAll("img");if(n.length)for(var i=0;i<n.length;i++)o.addImage(n[i].src)}(a),n.classList.remove("jeditor-dragging"),e.preventDefault()}},T=function(e){H("onevent",e),f(e),"function"==typeof o.options.onblur&&o.options.onblur(n,o,e)},k=function(e){"function"==typeof o.options.onfocus&&o.options.onfocus(n,o,e)},M=function(e){o.editor.innerHTML||(o.editor.innerHTML="<div><br></div>"),"function"==typeof o.options.onkeyup&&o.options.onkeyup(n,o,e)},D=function(e){if(H("onevent",e),"Delete"==e.key&&"IMG"==e.target.tagName){var t=e.target.parentNode;x(e.target),t.classList.contains("jsnippet-image")&&h()}"function"==typeof o.options.onkeydown&&o.options.onkeydown(n,o,e)},N=function(e){if(l&&l.e&&(l.e.classList.remove("resizing"),1==l.e.changed)){var t=l.e.cloneNode();t.width=parseInt(l.e.style.width)||l.e.getAttribute("width"),t.height=parseInt(l.e.style.height)||l.e.getAttribute("height"),l.e.style.width="",l.e.style.height="",x(l.e),document.execCommand("insertHtml",!1,t.outerHTML)}l=!1},O=function(e){var t=function(t){var n=t.getBoundingClientRect();n.width-(e.clientX-n.left)<40&&e.clientY-n.top<40&&(t.innerHTML="",t.remove())};if("IMG"==e.target.tagName)if(e.target.style.cursor){var n=e.target.getBoundingClientRect();l={e:e.target,x:e.clientX,y:e.clientY,w:n.width,h:n.height,d:e.target.style.cursor},e.target.getAttribute("width")||e.target.setAttribute("width",n.width),e.target.getAttribute("height")||e.target.setAttribute("height",n.height);var i=window.getSelection();if(i.rangeCount)for(var o=0;o<i.rangeCount;o++)i.removeRange(i.getRangeAt(o));e.target.classList.add("resizing")}else l=!0;else e.target.classList.contains("jsnippet")?t(e.target):e.target.parentNode.classList.contains("jsnippet")&&t(e.target.parentNode),l=!0},I=function(e){if("IMG"==e.target.tagName&&!e.target.parentNode.classList.contains("jsnippet-image")&&1==o.options.allowImageResize&&e.target.getAttribute("tabindex")){var t=e.target.getBoundingClientRect();e.clientY-t.top<5?t.width-(e.clientX-t.left)<5?e.target.style.cursor="ne-resize":e.clientX-t.left<5?e.target.style.cursor="nw-resize":e.target.style.cursor="n-resize":t.height-(e.clientY-t.top)<5?t.width-(e.clientX-t.left)<5?e.target.style.cursor="se-resize":e.clientX-t.left<5?e.target.style.cursor="sw-resize":e.target.style.cursor="s-resize":t.width-(e.clientX-t.left)<5?e.target.style.cursor="e-resize":e.clientX-t.left<5?e.target.style.cursor="w-resize":e.target.style.cursor=""}if(1==e.which&&l&&l.d){if("e-resize"==l.d||"ne-resize"==l.d||"se-resize"==l.d)if(l.e.style.width=l.w+(e.clientX-l.x),e.shiftKey){var n=(e.clientX-l.x)*(l.h/l.w);l.e.style.height=l.h+n}else n=null;n||"s-resize"!=l.d&&"se-resize"!=l.d&&"sw-resize"!=l.d||e.shiftKey||(l.e.style.height=l.h+(e.clientY-l.y)),l.e.changed=!0}},H=function(e,t){if(o.options.extensions){var n=Object.keys(o.options.extensions);if(n.length)for(var i=0;i<n.length;i++)o.options.extensions[n[i]]&&"function"==typeof o.options.extensions[n[i]][e]&&o.options.extensions[n[i]][e].call(o,t)}};if(document.addEventListener("mouseup",N),document.addEventListener("mousemove",I),o.editor.addEventListener("mousedown",O),o.editor.addEventListener("keyup",M),o.editor.addEventListener("keydown",D),o.editor.addEventListener("dragstart",L),o.editor.addEventListener("dragenter",j),o.editor.addEventListener("dragover",E),o.editor.addEventListener("drop",C),o.editor.addEventListener("paste",w),o.editor.addEventListener("focus",k),o.editor.addEventListener("blur",T),n.appendChild(o.editor),o.options.snippet&&o.appendSnippet(o.options.snippet),o.options.toolbar){if(Array.isArray(o.options.toolbar))var S={container:!0,responsive:!0,items:o.options.toolbar};else S=!0===o.options.toolbar?{container:!0,responsive:!0,items:[]}:o.options.toolbar;S.items&&S.items.length||(S.items=e.getDefaultToolbar(o)),o.options.toolbarOnTop?(n.classList.add("toolbar-on-top"),n.insertBefore(u,n.firstChild)):(o.editor.style.padding="15px",n.appendChild(u)),A(u,S),u.addEventListener("click",(function(){o.editor.focus()}))}return o.file=document.createElement("input"),o.file.style.display="none",o.file.type="file",o.file.setAttribute("accept","image/*"),o.file.onchange=function(){o.addFile(this.files)},n.appendChild(o.file),o.options.focus&&e.setCursor(o.editor,"initial"==o.options.focus),n.change=o.setData,n.val=function(e){if(void 0===e){var t="true"!==n.getAttribute("data-html");return o.getData(t)}o.setData(e)},function(){if(o.options.extensions){var e=Object.keys(o.options.extensions);if(e.length)for(var t=0;t<e.length;t++)o.options.extensions[e[t]]&&"function"==typeof o.options.extensions[e[t]]&&(o.options.extensions[e[t]]=o.options.extensions[e[t]](n,o))}}(),n.editor=o,"function"==typeof o.options.onload&&o.options.onload(n,o,o.editor),o};return e.setCursor=function(e,t){e.focus(),document.execCommand("selectAll");var n=window.getSelection(),i=n.getRangeAt(0);if(1==t)var o=i.startContainer,a=0;else a=(o=i.endContainer).length;i.setStart(o,a),i.setEnd(o,a),n.removeAllRanges(),n.addRange(i)},e.getDefaultToolbar=function(e){var t=function(e,t,n){n.color||(E(n,{onchange:function(e,t){"color"===n.k?document.execCommand("foreColor",!1,t):document.execCommand("backColor",!1,t)}}),n.color.open())},n=[];return n.push({content:"undo",onclick:function(){document.execCommand("undo")}}),n.push({content:"redo",onclick:function(){document.execCommand("redo")}}),n.push({type:"divisor"}),e.options.toolbarOnTop&&(n.push({type:"select",width:"140px",options:["Default","Verdana","Arial","Courier New"],render:function(e){return'<span style="font-family:'+e+'">'+e+"</span>"},onchange:function(e,t,n,i,o){document.execCommand("fontName",!1,i)}}),n.push({type:"select",content:"format_size",options:["x-small","small","medium","large","x-large"],render:function(e){return'<span style="font-size:'+e+'">'+e+"</span>"},onchange:function(e,t,n,i,o){document.execCommand("fontSize",!1,parseInt(o)+1)}}),n.push({type:"select",options:["format_align_left","format_align_center","format_align_right","format_align_justify"],render:function(e){return'<i class="material-icons">'+e+"</i>"},onchange:function(e,t,n,i,o){document.execCommand(["JustifyLeft","justifyCenter","justifyRight","justifyFull"][o])}}),n.push({type:"divisor"}),n.push({content:"format_color_text",k:"color",onclick:t}),n.push({content:"format_color_fill",k:"background-color",onclick:t})),n.push({content:"format_bold",onclick:function(e,t,n){document.execCommand("bold"),document.queryCommandState("bold")?n.classList.add("selected"):n.classList.remove("selected")}}),n.push({content:"format_italic",onclick:function(e,t,n){document.execCommand("italic"),document.queryCommandState("italic")?n.classList.add("selected"):n.classList.remove("selected")}}),n.push({content:"format_underline",onclick:function(e,t,n){document.execCommand("underline"),document.queryCommandState("underline")?n.classList.add("selected"):n.classList.remove("selected")}}),n.push({type:"divisor"}),n.push({content:"format_list_bulleted",onclick:function(e,t,n){document.execCommand("insertUnorderedList"),document.queryCommandState("insertUnorderedList")?n.classList.add("selected"):n.classList.remove("selected")}}),n.push({content:"format_list_numbered",onclick:function(e,t,n){document.execCommand("insertOrderedList"),document.queryCommandState("insertOrderedList")?n.classList.add("selected"):n.classList.remove("selected")}}),n.push({content:"format_indent_increase",onclick:function(e,t,n){document.execCommand("indent",!0,null),document.queryCommandState("indent")?n.classList.add("selected"):n.classList.remove("selected")}}),n.push({content:"format_indent_decrease",onclick:function(){document.execCommand("outdent"),document.queryCommandState("outdent")?this.classList.add("selected"):this.classList.remove("selected")}}),e.options.toolbarOnTop&&(n.push({type:"divisor"}),n.push({content:"photo",onclick:function(){e.upload()}}),n.push({type:"select",content:"table_view",columns:8,grid:8,right:!0,options:["0x0","1x0","2x0","3x0","4x0","5x0","6x0","7x0","0x1","1x1","2x1","3x1","4x1","5x1","6x1","7x1","0x2","1x2","2x2","3x2","4x2","5x2","6x2","7x2","0x3","1x3","2x3","3x3","4x3","5x3","6x3","7x3","0x4","1x4","2x4","3x4","4x4","5x4","6x4","7x4","0x5","1x5","2x5","3x5","4x5","5x5","6x5","7x5","0x6","1x6","2x6","3x6","4x6","5x6","6x6","7x6","0x7","1x7","2x7","3x7","4x7","5x7","6x7","7x7"],render:function(e,t){t&&(t.onmouseover=this.onmouseover,e=e.split("x"),t.setAttribute("data-x",e[0]),t.setAttribute("data-y",e[1]));var n=document.createElement("div");return t.style.margin="1px",t.style.border="1px solid #ddd",n},onmouseover:function(e){for(var t=parseInt(e.target.getAttribute("data-x")),n=parseInt(e.target.getAttribute("data-y")),i=0;i<e.target.parentNode.children.length;i++){var o=e.target.parentNode.children[i],a=parseInt(o.getAttribute("data-x")),s=parseInt(o.getAttribute("data-y"));a<=t&&s<=n?(o.style.backgroundColor="#cae1fc",o.style.borderColor="#2977ff"):(o.style.backgroundColor="",o.style.borderColor="#ddd")}},onchange:function(e,t,n){n=n.split("x");for(var i=document.createElement("table"),o=document.createElement("tbody"),a=0;a<=n[1];a++){for(var s=document.createElement("tr"),r=0;r<=n[0];r++){var l=document.createElement("td");l.innerHTML="",s.appendChild(l)}o.appendChild(s)}i.appendChild(o),i.setAttribute("width","100%"),i.setAttribute("cellpadding","6"),i.setAttribute("cellspacing","0"),document.execCommand("insertHTML",!1,i.outerHTML)}})),n},e}();var D=function(){var e=function(t,n){var i={options:{}},o={type:"big",title:"Untitled",width:510,height:472};for(var a in o)n&&n.hasOwnProperty(a)?i.options[a]=n[a]:i.options[a]=o[a];return i.state={isMinized:!1},i.setState=function(){i.state.isMinized?i.container.classList.remove("jfloating-minimized"):i.container.classList.add("jfloating-minimized"),i.state.isMinized=!i.state.isMinized},i.close=function(){Components.elements.splice(e.elements.indexOf(i.container),1),i.updatePosition(),t.remove()},i.updatePosition=function(){for(var t=0;t<e.elements.length;t++){var n=e.elements[t],i=e.elements[t-1];n.style.right=t*(i?i.offsetWidth:n.offsetWidth)*1.01+"px"}},i.init=function(){(function(){for(var e=document.createElement("div");t.children[0];)e.appendChild(t.children[0]);for(i.content=document.createElement("div"),i.content.className="jfloating_content",i.content.innerHTML=t.innerHTML;e.children[0];)i.content.appendChild(e.children[0]);i.container=document.createElement("div"),i.container.className="jfloating",i.container.appendChild(i.content),i.options.title?i.container.setAttribute("title",i.options.title):i.container.classList.add("no-title"),i.options.width&&(i.container.style.width=parseInt(i.options.width)+"px"),i.options.height&&(i.container.style.height=parseInt(i.options.height)+"px"),t.innerHTML="",t.appendChild(i.container)})(),i.container&&i.container.addEventListener("click",(function(e){var t=e.target.getBoundingClientRect();if(e.target.classList.contains("jfloating")){if(e.changedTouches&&e.changedTouches[0])var n=e.changedTouches[0].clientX,o=e.changedTouches[0].clientY;else n=e.clientX,o=e.clientY;t.width-(n-t.left)<50&&o-t.top<50?setTimeout((function(){i.close()}),100):i.setState()}})),i.container.classList.add("jfloating-"+i.options.type),e.elements.push(i.container),i.updatePosition(),t.floating=i},i.init(),i};return e.elements=[],e}();var N=function(){const e=function(e){return!isNaN(e)&&null!==e&&("string"!=typeof e||""!==e.trim())},t={between:function(e,t){return e>=t[0]&&e<=t[1]},"not between":function(e,t){return e<t[0]||e>t[1]},"<":function(e,t){return e<t[0]},"<=":function(e,t){return e<=t[0]},">":function(e,t){return e>t[0]},">=":function(e,t){return e>=t[0]},"=":function(e,t){return e==t[0]},"!=":function(e,t){return e!=t[0]}},n={"valid date":function(){return!0},"=":function(e,t){return e===t[0]},"!=":function(e,t){return e!==t[0]},"<":function(e,t){return e<t[0]},"<=":function(e,t){return e<=t[0]},">":function(e,t){return e>t[0]},">=":function(e,t){return e>=t[0]},between:function(e,t){return e>=t[0]&&e<=t[1]},"not between":function(e,t){return e<t[0]||e>t[1]}},i={contains:function(e,t){return e.includes(t[0])},"not contains":function(e,t){return!e.includes(t[0])},"begins with":function(e,t){return e.startsWith(t[0])},"ends with":function(e,t){return e.endsWith(t[0])},"=":function(e,t){return e===t[0]},"!=":function(e,t){return e!==t[0]},"valid email":function(e){return new RegExp(/^[^\s@]+@[^\s@]+\.[^\s@]+$/).test(e)},"valid url":function(e){return new RegExp(/(((https?:\/\/)|(www\.))[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]+)/gi).test(e)}},o=function(e,t){return"function"==typeof o[t.type]?!(!t.allowBlank||void 0!==e&&""!==e&&null!==e)||o[t.type].call(this,e,t):null};o.url=function(e){return!!new RegExp(/(((https?:\/\/)|(www\.))[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]+)/gi).test(e)},o.email=function(e){var t=new RegExp(/^[^\s@]+@[^\s@]+\.[^\s@]+$/);return!(!e||!t.test(e))},o.required=function(e){return!(!e||!e.trim())},o.empty=function(e){return null==e||"string"==typeof e&&!e.toString().trim()},o["not exist"]=o.empty,o.notEmpty=function(e){return!o.empty(e)},o.exist=o.notEmpty,o.number=function(n,i){if(!e(n))return!1;if(!i||!i.criteria)return!0;if(!t[i.criteria])return!1;let o=i.value.map((function(e){return parseFloat(e)}));return t[i.criteria](n,o)},o.login=function(e){let t=new RegExp(/^[a-zA-Z0-9._-]+$/);return!(!e||!t.test(e))},o.list=function(e,t){let n,i=typeof e;return("string"===i||"number"===i)&&(n="string"==typeof t.value[0]?t.value[0].split(","):t.value[0],!!Array.isArray(n)&&n.findIndex((function(t){return t==e}))>-1)};const a=function(){let e=new Date;return e.setHours(0,0,0,0),e},s={"one year ago":function(){let e=a();return e.setFullYear(e.getFullYear()-1),e},"one month ago":function(){let e=a();return e.setMonth(e.getMonth()-1),e},"one week ago":function(){let e=a();return e.setDate(e.getDate()-7),e},yesterday:function(){let e=a();return e.setDate(e.getDate()-1),e},today:a,tomorrow:function(){let e=a();return e.setDate(e.getDate()+1),e}};return o.date=function(t,i){if(e(t)&&t>0&&t<1e6&&(t=l.numToDate(t)),"Invalid Date"==new Date(t))return!1;if(!i||!i.criteria)return!0;if(!n[i.criteria])return!1;let o=i.value.map((function(e){return"string"==typeof e&&s[e]?s[e]().getTime():new Date(e).getTime()}));return n[i.criteria](new Date(t).getTime(),o)},o.text=function(e,t){if(null==e)e="";else if("string"!=typeof e)return!1;return!t||!t.criteria||!!i[t.criteria]&&i[t.criteria](e,t.value)},o.textLength=function(e,t){return e=e.toString(),o.number(e.length,t)},o}();var O=function(){var e=function(t,n){var i={options:{}},o={url:null,message:"Are you sure? There are unsaved information in your form",ignore:!1,currentHash:null,submitButton:null,validations:null,onbeforeload:null,onload:null,onbeforesave:null,onsave:null,onbeforeremove:null,onremove:null,onerror:function(e,t){alert(t)}};for(var a in o)n&&n.hasOwnProperty(a)?i.options[a]=n[a]:i.options[a]=o[a];i.options.validations||(i.options.validations={}),i.options.submitButton||(i.options.submitButton=t.querySelector("input[type=submit]")),i.options.submitButton&&i.options.url&&(i.options.submitButton.onclick=function(){i.save()}),i.options.validations.email||(i.options.validations.email=N.email),i.options.validations.length||(i.options.validations.length=N.length),i.options.validations.required||(i.options.validations.required=N.required),i.setUrl=function(e){i.options.url=e},i.load=function(){v({url:i.options.url,method:"GET",dataType:"json",queue:!0,success:function(n){if("function"==typeof i.options.onbeforeload){var o=i.options.onbeforeload(t,n);o&&(n=o)}e.setElements(t,n),"function"==typeof i.options.onload&&i.options.onload(t,n)}})},i.save=function(){var n=i.validate();if(n)i.options.onerror(t,n);else{var o=e.getElements(t,!0);if("function"==typeof i.options.onbeforesave&&!1===(o=i.options.onbeforesave(t,o)))return;v({url:i.options.url,method:"POST",dataType:"json",data:o,success:function(e){"function"==typeof i.options.onsave&&i.options.onsave(t,o,e)}})}},i.remove=function(){if("function"==typeof i.options.onbeforeremove&&!1===i.options.onbeforeremove(t,i))return!1;v({url:i.options.url,method:"DELETE",dataType:"json",success:function(e){"function"==typeof i.options.onremove&&i.options.onremove(t,i,e),i.reset()}})};return i.validateElement=function(n){var o=!1,a=e.getValue(n),s=n.getAttribute("data-validation");return"function"!=typeof i.options.validations[s]||i.options.validations[s](a,n)?n.classList.contains("error")&&function(e){var n=!1;e.classList.remove("error"),e.removeAttribute("title");for(var o=t.querySelectorAll("input, select, textarea, div[name]"),a=0;a<o.length;a++)o[a].getAttribute("data-validation")&&o[a].classList.contains("error")&&(n=!0);i.options.submitButton&&(n?i.options.submitButton.setAttribute("disabled",!0):i.options.submitButton.removeAttribute("disabled"))}(n):o=function(e){e.classList.add("error"),i.options.submitButton&&i.options.submitButton.setAttribute("disabled",!0);var t=e.getAttribute("data-error")||"There is an error in the form";return e.setAttribute("title",t),t}(n),o},i.reset=function(){for(var e=t.querySelectorAll("input, select, textarea, div[name]"),n=0;n<e.length;n++)e[n].getAttribute("name")&&("checkbox"==e[n].type||"radio"==e[n].type?e[n].checked=!1:"function"==typeof e[n].val?e[n].val(""):e[n].value="")},i.validate=function(){for(var e=[],n=t.querySelectorAll("input, select, textarea, div[name]"),o=0;o<n.length;o++)if(n[o].getAttribute("data-validation")){var a=i.validateElement(n[o]);a&&e.push(a)}return e.length>0&&e.join("<br>")},i.getError=function(){return!!i.validation()},i.setHash=function(){return i.getHash(e.getElements(t))},i.getHash=function(e){var t,n=0;if(0===e.length)return n;for(t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return n},i.isChanged=function(){var e=i.setHash();return i.options.currentHash!=e},i.resetTracker=function(){i.options.currentHash=i.setHash(),i.options.ignore=!1},i.setIgnore=function(e){i.options.ignore=!!e},setTimeout((function(){i.options.currentHash=i.setHash()}),1e3),t.addEventListener("keyup",(function(e){e.target.getAttribute("data-validation")&&i.validateElement(e.target)})),e.hasEvents||(window.addEventListener("beforeunload",(function(e){if(i.isChanged()&&0==i.options.ignore){var t=i.options.message?i.options.message:"o/";return t?(void 0===e&&(e=window.event),e&&(e.returnValue=t),t):void 0}})),e.hasEvents=!0),t.form=i,i};return e.getValue=function(e){var t=null;if("checkbox"==e.type)1==e.checked&&(t=e.value||!0);else if("radio"==e.type)1==e.checked&&(t=e.value);else if("file"==e.type)t=e.files;else if("select"==e.tagName&&1==e.multiple){t=[];for(var n=e.querySelectorAll("options[selected]"),i=0;i<n.length;i++)t.push(n[i].value)}else t="function"==typeof e.val?e.val():e.value||"";return t},e.getElements=function(t,n){for(var i={},o=null,a=t.querySelectorAll("input, select, textarea, div[name]"),s=0;s<a.length;s++)(o=a[s].getAttribute("name"))&&(i[o]=e.getValue(a[s])||"");return 1==n?i:JSON.stringify(i)},e.setElements=function(e,t){for(var n=null,i=null,o=e.querySelectorAll("input, select, textarea, div[name]"),a=0;a<o.length;a++){var s=o[a].getAttribute("type");if(n=o[a].getAttribute("name")){if(i=null,(n=n.replace(new RegExp(/\[(.*?)\]/gi),".$1")).match(/\./)){var r=f.call(t,n)||"";void 0!==r&&(i=r)}else void 0!==t[n]&&(i=t[n]);null!==i&&("checkbox"==s||"radio"==s?o[a].checked=!!i:"file"==s||("function"==typeof o[a].val?o[a].val(i):o[a].value=i))}}},e}();var I=function(){var e=function(){var e=null;document.addEventListener("keydown",(function(e){if(27==e.which)for(var t=document.querySelectorAll(".jmodal"),n=0;n<t.length;n++)t[n].parentNode.modal.close()})),document.addEventListener("mouseup",(function(n){let i=n.composedPath();var o=t.findElement(i[0],"jmodal");if(o){var a=o.getBoundingClientRect();if(n.changedTouches&&n.changedTouches[0])var s=n.changedTouches[0].clientX,r=n.changedTouches[0].clientY;else s=n.clientX,r=n.clientY;a.width-(s-a.left)<50&&r-a.top<50&&o.parentNode.modal.close()}e&&(e.element.style.cursor="auto",e=null)})),document.addEventListener("mousedown",(function(n){let i=n.composedPath();var o=t.findElement(i[0],"jmodal");if(o){var a=o.getBoundingClientRect();if(n.changedTouches&&n.changedTouches[0])var s=n.changedTouches[0].clientX,r=n.changedTouches[0].clientY;else s=n.clientX,r=n.clientY;a.width-(s-a.left)<50&&r-a.top<50||r-a.top<50&&(document.selection?document.selection.empty():window.getSelection&&window.getSelection().removeAllRanges(),e={left:a.left,top:a.top,x:n.clientX,y:n.clientY,width:a.width,height:a.height,element:o})}})),document.addEventListener("mousemove",(function(t){if(e){if((t=t||window.event).buttons)var n=t.buttons;else n=t.button?t.button:t.which;n?(e.element.style.top=e.top+(t.clientY-e.y)+e.height/2+"px",e.element.style.left=e.left+(t.clientX-e.x)+e.width/2+"px",e.element.style.cursor="move"):e.element.style.cursor="auto"}}))};return function(n,i){var o={options:{}},a={url:null,onopen:null,onclose:null,onload:null,closed:!1,width:null,height:null,title:null,padding:null,backdrop:!0,icon:null};for(var s in a)i&&i.hasOwnProperty(s)?o.options[s]=i[s]:o.options[s]=a[s];!o.options.title&&n.getAttribute("title")&&(o.options.title=n.getAttribute("title"));for(var r=document.createElement("div");n.children[0];)r.appendChild(n.children[0]);for(o.title=document.createElement("div"),o.title.className="jmodal_title",o.options.icon&&o.title.setAttribute("data-icon",o.options.icon),o.content=document.createElement("div"),o.content.className="jmodal_content",o.content.innerHTML=n.innerHTML;r.children[0];)o.content.appendChild(r.children[0]);if(o.container=document.createElement("div"),o.container.className="jmodal",o.container.appendChild(o.title),o.container.appendChild(o.content),o.options.padding&&(o.content.style.padding=o.options.padding),o.options.width&&(o.container.style.width=o.options.width),o.options.height&&(o.container.style.height=o.options.height),o.options.title){var l=document.createElement("h4");l.innerText=o.options.title,o.title.appendChild(l)}if(n.innerHTML="",n.style.display="none",n.appendChild(o.container),o.options.backdrop){var d=document.createElement("div");d.className="jmodal_backdrop",d.onclick=function(){o.close()},n.appendChild(d)}return o.open=function(){n.style.display="block";var e=o.container.getBoundingClientRect();t.getWindowWidth()<e.width?(o.container.style.top="",o.container.style.left="",o.container.classList.add("jmodal_fullscreen"),g.slideBottom(o.container,1)):o.options.backdrop&&(d.style.display="block"),"function"==typeof o.options.onopen&&o.options.onopen(n,o)},o.resetPosition=function(){o.container.style.top="",o.container.style.left=""},o.isOpen=function(){return"none"!=n.style.display},o.close=function(){o.isOpen()&&(n.style.display="none",o.options.backdrop&&(d.style.display=""),o.container.classList.remove("jmodal_fullscreen"),"function"==typeof o.options.onclose&&o.options.onclose(n,o))},o.options.url?v({url:o.options.url,method:"GET",dataType:"text/html",success:function(e){o.content.innerHTML=e,o.options.closed||o.open(),"function"==typeof o.options.onload&&o.options.onload(o)}}):(o.options.closed||o.open(),"function"==typeof o.options.onload&&o.options.onload(o)),n.modal=o,e(),e=function(){},o}}();var H=function(){var e=function(e){var n={options:{}},i={icon:null,name:"Notification",date:null,error:null,title:null,message:null,timeout:4e3,autoHide:!0,closeable:!0};for(var o in i)e&&e.hasOwnProperty(o)?n.options[o]=e[o]:n.options[o]=i[o];var a=document.createElement("div");a.className="jnotification",n.options.error&&a.classList.add("jnotification-error");var s=document.createElement("div");s.className="jnotification-container",a.appendChild(s);var r=document.createElement("div");r.className="jnotification-header",s.appendChild(r);var l=document.createElement("div");if(l.className="jnotification-image",r.appendChild(l),n.options.icon){var d=document.createElement("img");d.src=n.options.icon,l.appendChild(d)}var c=document.createElement("div");if(c.className="jnotification-name",c.innerHTML=n.options.name,r.appendChild(c),1==n.options.closeable){var u=document.createElement("div");u.className="jnotification-close",u.onclick=function(){n.hide()},r.appendChild(u)}var p=document.createElement("div");p.className="jnotification-date",r.appendChild(p);var f=document.createElement("div");if(f.className="jnotification-content",s.appendChild(f),n.options.title){var h=document.createElement("div");h.className="jnotification-title",h.innerHTML=n.options.title,f.appendChild(h)}var m=document.createElement("div");if(m.className="jnotification-message",m.innerHTML=n.options.message,f.appendChild(m),n.show=function(){document.body.appendChild(a),t.getWindowWidth()>800?g.fadeIn(a):g.slideTop(a,1)},n.hide=function(){t.getWindowWidth()>800?g.fadeOut(a,(function(){a.parentNode&&(a.parentNode.removeChild(a),v&&clearTimeout(v))})):g.slideTop(a,0,(function(){a.parentNode&&(a.parentNode.removeChild(a),v&&clearTimeout(v))}))},n.show(),1==n.options.autoHide)var v=setTimeout((function(){n.hide()}),n.options.timeout);return t.getWindowWidth()<800&&a.addEventListener("swipeup",(function(e){n.hide(),e.preventDefault(),e.stopPropagation()})),n};return e.isVisible=function(){var e=document.querySelector(".jnotification");return!(!e||!e.parentNode)},e}();function S(e,n){if(e.search)return e.search;var i=null,o=function(t){if("function"==typeof r.options.onsearch){var n=r.options.onsearch(r,t);n&&(t=n)}if(l.innerHTML="",t.length){e.style.display="block";for(var i=t.length<11?t.length:10,o=0;o<i;o++){if("string"==typeof t[o])var a=t[o],s=t[o];else!(a=t[o].text)&&t[o].name&&(a=t[o].name),!(s=t[o].value)&&t[o].id&&(s=t[o].id);var d=document.createElement("div");d.setAttribute("data-value",s),d.setAttribute("data-text",a),d.className="jsearch_item",t[o].id&&d.setAttribute("id",t[o].id),r.options.forceSelect&&0==o&&d.classList.add("selected");var c=document.createElement("img");t[o].image?c.src=t[o].image:c.style.display="none",d.appendChild(c);var u=document.createElement("div");u.innerHTML=a,d.appendChild(u),l.appendChild(d)}}else e.style.display=""},a=function(e){if(e!=r.terms)if(r.terms=e,i=r.options.forceSelect?0:null,Array.isArray(r.options.data)){var t=r.options.data.filter((function(t){return function(t){if("string"==typeof t){if((""+t).toLowerCase().search(e.toLowerCase())>=0)return!0}else for(var n in t)if((""+t[n]).toLowerCase().search(e.toLowerCase())>=0)return!0;return!1}(t)}));o(t)}else v({url:r.options.data+e,method:"GET",dataType:"json",success:function(e){o(e)}})},s=null,r=function(e){s&&clearTimeout(s),s=setTimeout((function(){a(e)}),500)};null===n.forceSelect&&(n.forceSelect=!0),r.options={data:n.data||null,input:n.input||null,searchByNode:n.searchByNode||null,onselect:n.onselect||null,forceSelect:n.forceSelect,onsearch:n.onsearch||null,onbeforesearch:n.onbeforesearch||null},r.selectIndex=function(e){var t=e.getAttribute("id"),n=e.getAttribute("data-text"),i=e.getAttribute("data-value"),o=e.children[0].src||"";"function"==typeof r.options.onselect&&r.options.onselect(r,n,i,t,o),r.close()},r.open=function(){e.style.display="block"},r.close=function(){s&&clearTimeout(s),r.terms="",l.innerHTML="",e.style.display=""},r.isOpened=function(){return!!e.style.display},r.keydown=function(e){r.isOpened()&&("Enter"==e.key?null!==i&&l.children[i]?(r.selectIndex(l.children[i]),e.preventDefault()):r.close():"ArrowUp"===e.key?(null!==i&&l.children[0]&&(l.children[i].classList.remove("selected"),r.options.forceSelect||0!==i?(i=Math.max(0,i-1),l.children[i].classList.add("selected")):i=null),e.preventDefault()):"ArrowDown"===e.key&&(null==i?i=-1:l.children[i].classList.remove("selected"),i<9&&l.children[i+1]&&i++,l.children[i].classList.add("selected"),e.preventDefault()))},r.keyup=function(e){if(!r.options.searchByNode&&r.options.input)if("DIV"===r.options.input.tagName)var n=r.options.input.innerText;else n=r.options.input.value;else{var i=t.getNode();i&&(n=i.innerText)}if("function"==typeof r.options.onbeforesearch){var o=r.options.onbeforesearch(r,n);if(o)n=o;else if(!1===o)return}r(n)},r.blur=function(e){r.close()},r.options.input&&(r.options.input.addEventListener("keyup",r.keyup),r.options.input.addEventListener("keydown",r.keydown),r.options.input.addEventListener("blur",r.blur));var l=document.createElement("div");return l.classList.add("jsearch_container"),l.onmousedown=function(e){if(e.target.classList.contains("jsearch_item"))var t=e.target;else t=e.target.parentNode;r.selectIndex(t),e.preventDefault()},e.appendChild(l),e.classList.add("jsearch"),e.search=r,r}function R(e,n){var i={options:{}},o={type:"image",extension:"*",input:!1,minWidth:!1,maxWidth:null,maxHeight:null,maxJpegSizeBytes:null,onchange:null,multiple:!1,remoteParser:null};for(var a in o)n&&n.hasOwnProperty(a)?i.options[a]=n[a]:i.options[a]=o[a];1==i.options.multiple&&e.setAttribute("data-multiple",!0),e.content=[],e.classList.add("jupload"),1==i.options.input&&e.classList.add("input"),i.add=function(n){if(0==i.options.multiple&&(e.content=[],e.innerText=""),"image"==i.options.type){var o=document.createElement("img");o.setAttribute("src",n.file),o.setAttribute("tabindex",-1),e.getAttribute("name")||(o.className="jfile",o.content=n),e.appendChild(o)}else{if(n.name)var a=n.name;else a=n.file;var s=document.createElement("div");s.innerText=a||i.options.type,s.classList.add("jupload-item"),s.setAttribute("tabindex",-1),e.appendChild(s)}n.content&&(n.file=t.guid()),e.content.push(n),"function"==typeof i.options.onchange&&i.options.onchange(e,n)},i.addFromFile=function(e){if(e.type.split("/")[0]==i.options.type){var t=new FileReader;t.addEventListener("load",(function(t){var n={file:t.srcElement.result,extension:e.name.substr(e.name.lastIndexOf(".")+1),name:e.name,size:e.size,lastmodified:e.lastModified,content:t.srcElement.result};i.add(n)})),t.readAsDataURL(e)}else alert(c.translate("This extension is not allowed"))},i.addFromUrl=function(e){if("data"==e.substr(0,4)||i.options.remoteParser)if("data"==e.substr(0,4))if((n=(n=e.split(";"))[0].split("/"))[0].replace("data:","")==i.options.type){var t={file:e,name:"",extension:n[1],content:e};i.add(t)}else alert(i.options.text.extensionNotAllowed);else{var n=e.substr(e.lastIndexOf(".")+1);e=i.options.remoteParser+e,v({url:e,type:"GET",dataType:"blob",success:function(e){}})}else console.error("remoteParser not defined in your initialization")};var s=i.options.type+"/"+i.options.extension,r=document.createElement("input");r.type="file",r.setAttribute("accept",s),r.onchange=function(){for(var e=0;e<this.files.length;e++)i.addFromFile(this.files[e])},1==i.options.multiple&&r.setAttribute("multiple",!0);var l=null;return e.addEventListener("click",(function(n){l=null,e.children.length&&n.target!==e?n.target.parentNode==e&&(l=n.target):t.click(r)})),e.addEventListener("dblclick",(function(e){t.click(r)})),e.addEventListener("dragenter",(function(t){e.style.border="1px dashed #000"})),e.addEventListener("dragleave",(function(t){e.style.border="1px solid #eee"})),e.addEventListener("dragstop",(function(t){e.style.border="1px solid #eee"})),e.addEventListener("dragover",(function(e){e.preventDefault()})),e.addEventListener("keydown",(function(t){if(l&&46==t.which){var n=Array.prototype.indexOf.call(e.children,l);n>=0&&(e.content.splice(n,1),l.remove(),l=null)}})),e.addEventListener("drop",(function(t){t.preventDefault(),t.stopPropagation();var n=(t.originalEvent||t).dataTransfer.getData("text/html");if((t.originalEvent||t).dataTransfer.files.length)for(var o=0;o<t.dataTransfer.files.length;o++)i.addFromFile(t.dataTransfer.files[o]);else if(n){0==i.options.multiple&&(e.innerText="");var a=document.createElement("div");a.innerHTML=n;var s=a.querySelectorAll("img");if(s.length)for(o=0;o<s.length;o++)i.addFromUrl(s[o].src)}return e.style.border="1px solid #eee",!1})),e.val=function(t){if(void 0===t)return e.content&&e.content.length?e.content:null;if(e.innerText="",e.content=[],t)if(Array.isArray(t))for(var n=0;n<t.length;n++)"string"==typeof t[n]?i.add({file:t[n]}):i.add(t[n]);else"string"==typeof t&&i.add({file:t})},e.upload=e.image=i,i}var Y=i(195),V=i.n(Y),F={...c,...t,version:"5.4.2",setExtensions:function(e){if("object"==typeof e)for(var t=Object.keys(e),n=0;n<t.length;n++)F[t[n]]=e[t[n]]},tracking:p,path:f,sorting:h,lazyLoading:m,ajax:v,animation:g,calendar:w,color:E,contextmenu:C,dropdown:T,editor:M,floating:D,form:O,mask:b,modal:I,notification:H,palette:L,picker:k,progressbar:function(e,t){var n={options:{}},i={value:0,onchange:null,width:null};for(var o in i)t&&t.hasOwnProperty(o)?n.options[o]=t[o]:n.options[o]=i[o];e.classList.add("jprogressbar"),e.setAttribute("tabindex",1),e.setAttribute("data-value",n.options.value);var a=document.createElement("div");a.style.width=n.options.value+"%",a.style.color="#fff",e.appendChild(a),n.options.width&&(e.style.width=n.options.width),n.setValue=function(t){t=parseInt(t),n.options.value=t,a.style.width=t+"%",e.setAttribute("data-value",t+"%"),e.style.color=t<6?"#000":"#fff",n.options.value=t,"function"==typeof n.options.onchange&&n.options.onchange(e,t),e.value!=n.options.value&&(e.value=n.options.value,"function"==typeof e.oninput&&e.oninput({type:"input",target:e,value:e.value}))},n.getValue=function(){return n.options.value};var s=function(t){if(t.which){var i=e.getBoundingClientRect();if(t.changedTouches&&t.changedTouches[0]){var o=t.changedTouches[0].clientX;t.changedTouches[0].clientY}else o=t.clientX,t.clientY;n.setValue(Math.round((o-i.left)/i.width*100))}};return"touchstart"in document.documentElement==1?(e.addEventListener("touchstart",s),e.addEventListener("touchend",s)):(e.addEventListener("mousedown",s),e.addEventListener("mousemove",s)),e.change=n.setValue,e.val=function(e){if(void 0===e)return n.getValue();n.setValue(e)},e.progressbar=n,n},rating:function(e,t){if(e.rating)return e.rating.setOptions(t,!0);var n={options:{},setOptions:function(t,i){var o={number:5,value:0,tooltip:["Very bad","Bad","Average","Good","Very good"],onchange:null};for(var a in o)t&&t.hasOwnProperty(a)?n.options[a]=t[a]:void 0!==n.options[a]&&!0!==i||(n.options[a]=o[a]);e.innerHTML="";for(var s=0;s<n.options.number;s++){var r=document.createElement("div");r.setAttribute("data-index",s+1),r.setAttribute("title",n.options.tooltip[s]),e.appendChild(r)}if(n.options.value)for(s=0;s<n.options.number;s++)s<n.options.value&&e.children[s].classList.add("jrating-selected");return n},setValue:function(t){for(var i=0;i<n.options.number;i++)i<t?e.children[i].classList.add("jrating-selected"):(e.children[i].classList.remove("jrating-over"),e.children[i].classList.remove("jrating-selected"));n.options.value=t,"function"==typeof n.options.onchange&&n.options.onchange(e,t),e.value!=n.options.value&&(e.value=n.options.value,"function"==typeof e.oninput&&e.oninput({type:"input",target:e,value:e.value}))},getValue:function(){return n.options.value}};return n.setOptions(t),e.classList.add("jrating"),e.addEventListener("click",(function(e){var t=e.target.getAttribute("data-index");null!=t&&(t==n.options.value?n.setValue(0):n.setValue(t))})),e.addEventListener("mouseover",(function(t){for(var i=t.target.getAttribute("data-index"),o=0;o<n.options.number;o++)o<i?e.children[o].classList.add("jrating-over"):e.children[o].classList.remove("jrating-over")})),e.addEventListener("mouseout",(function(t){for(var i=0;i<n.options.number;i++)e.children[i].classList.remove("jrating-over")})),e.change=n.setValue,e.val=function(e){if(void 0===e)return n.getValue();n.setValue(e)},e.rating=n,n},search:S,slider:function(e,t){var n={options:{},currentImage:null};if(t&&(n.options=t),e.setAttribute("tabindex","900"),n.options.items=[],!e.classList.contains("jslider")){if(e.classList.add("jslider"),e.classList.add("unselectable"),n.options.height&&(e.style.minHeight=parseInt(n.options.height)+"px"),n.options.width&&(e.style.width=parseInt(n.options.width)+"px"),n.options.grid){e.classList.add("jslider-grid");var i=e.children.length;i>4&&e.setAttribute("data-total",i-4),e.setAttribute("data-number",i>4?4:i)}var o=document.createElement("div");if(o.classList.add("jslider-counter"),e.children.length>0)for(var a=0;a<e.children.length;a++){n.options.items.push(e.children[a]);var s=document.createElement("div");s.onclick=function(){var e=Array.prototype.slice.call(o.children).indexOf(this);n.show(n.currentImage=n.options.items[e])},o.appendChild(s)}var r=document.createElement("div");r.className="jslider-caption";var l=document.createElement("div"),d=document.createElement("div");d.className="jslider-close",d.innerHTML="",d.onclick=function(){n.close()},l.appendChild(r),l.appendChild(d)}n.updateCounter=function(e){for(var t=0;t<o.children.length;t++)if(o.children[t].classList.contains("jslider-counter-focus")){o.children[t].classList.remove("jslider-counter-focus");break}o.children[e].classList.add("jslider-counter-focus")},n.show=function(t){t||(t=e.children[0]),e.classList.add("jslider-focus"),e.classList.remove("jslider-grid"),e.appendChild(l),e.appendChild(o);var i=n.options.items.indexOf(t);n.updateCounter(i);for(var a=0;a<e.children.length;a++)e.children[a].style.display="";t.style.display="block",t.previousElementSibling?e.classList.add("jslider-left"):e.classList.remove("jslider-left"),t.nextElementSibling&&"IMG"==t.nextElementSibling.tagName?e.classList.add("jslider-right"):e.classList.remove("jslider-right"),n.currentImage=t,n.currentImage.offsetHeight>n.currentImage.offsetWidth&&n.currentImage.classList.add("jslider-vertical"),l.children[0].innerText=n.currentImage.getAttribute("title")},n.open=function(){n.show(),"function"==typeof n.options.onopen&&n.options.onopen(e)},n.close=function(){e.classList.remove("jslider-focus"),e.classList.remove("jslider-left"),e.classList.remove("jslider-right"),n.options.grid&&e.classList.add("jslider-grid");for(var t=0;t<e.children.length;t++)e.children[t].style.display="";o.remove(),l.remove(),n.currentImage=null,"function"==typeof n.options.onclose&&n.options.onclose(e)},n.reset=function(){e.innerHTML=""},n.next=function(){var e=n.currentImage.nextElementSibling;e&&"IMG"===e.tagName&&n.show(n.currentImage.nextElementSibling)},n.prev=function(){n.currentImage.previousElementSibling&&n.show(n.currentImage.previousElementSibling)};var c=function(e){if("IMG"==e.target.tagName)n.show(e.target);else if(!e.target.classList.contains("jslider-close")&&!e.target.parentNode.classList.contains("jslider-counter")&&!e.target.classList.contains("jslider-counter")){var t=e.offsetX||e.changedTouches[0].clientX;e.target.clientWidth-t<40?n.next():t<40&&n.prev()}};return"ontouchend"in document.documentElement==1?e.addEventListener("touchend",c):e.addEventListener("mouseup",c),e.addEventListener("swipeleft",(function(e){n.next(),e.preventDefault(),e.stopPropagation()})),e.addEventListener("swiperight",(function(e){n.prev(),e.preventDefault(),e.stopPropagation()})),e.addEventListener("keydown",(function(e){27==e.which&&n.close()})),e.slider=n,n},tabs:j,tags:function(e,n){if(e.tags)return e.tags.setOptions(n,!0);var i={type:"tags",options:{}},o=function(){return!!(i.options.limit&&e.children.length>=i.options.limit)},a=null,s=null;i.setOptions=function(t,n){var o={value:"",limit:null,search:null,placeholder:null,validation:null,onbeforepaste:null,onbeforechange:null,onlimit:null,onchange:null,onfocus:null,onblur:null,onload:null};for(var r in o)t&&t.hasOwnProperty(r)?i.options[r]=t[r]:void 0!==i.options[r]&&!0!==n||(i.options[r]=o[r]);return i.options.placeholder?e.setAttribute("data-placeholder",i.options.placeholder):e.removeAttribute("data-placeholder"),e.placeholder=i.options.placeholder,i.setValue(i.options.value),u(),i.options.search?s||(s=document.createElement("div"),e.parentNode.insertBefore(s,e.nextSibling),a=S(s,{data:i.options.search,onselect:function(e,t,n){i.selectIndex(t,n)}})):s&&(a=null,s.remove(),s=null),i},i.add=function(n,s){if("function"==typeof i.options.onbeforechange){var u=i.options.onbeforechange(e,i,i.options.value,n);if(!1===u)return!1;null!=u&&(n=u)}if(a&&a.close(),o())"function"==typeof i.options.onlimit?i.options.onlimit(i,i.options.limit):alert(c.translate("You reach the limit number of entries")+" "+i.options.limit);else{var p=t.getNode();if(!(p&&p.parentNode&&p.parentNode.classList.contains("jtags")&&p.nextSibling)||p.nextSibling.innerText&&p.nextSibling.innerText.trim()){if(e.lastChild&&(e.lastChild.innerText.trim()||e.removeChild(e.lastChild)),n&&"string"!=typeof n){for(var f=0;f<=n.length;f++)if(!o()){if(n[f]&&"string"!=typeof n[f])h=n[f].text,m=n[f].value;else var h=n[f]||"",m=null;v=l(h,m)}}else var v=l(n,n,p);d()}else v=p.nextSibling;s&&r(v)}},i.setLimit=function(t){for(i.options.limit=t,e.children.length;e.children.length>t;)e.removeChild(e.lastChild)},i.remove=function(t){t.parentNode.removeChild(t),e.children.length?d():i.add("",!0)},i.getData=function(){for(var t=[],n=0;n<e.children.length;n++){var i=e.children[n].innerText.replace("\n",""),o=e.children[n].getAttribute("data-value");o||(o=i),(i||o)&&t.push({text:i,value:o})}return t},i.getValue=function(t){var n=null;if(null!=t)(n=e.children[t].getAttribute("data-value"))||(n=e.children[t].innerText.replace("\n",""));else{for(var o=[],a=0;a<e.children.length;a++)(n=e.children[a].innerText.replace("\n",""))&&o.push(i.getValue(a));n=o.join(",")}return n},i.setValue=function(t){if(t){if(e.value!=t)if(Array.isArray(t))i.add(t);else{var n=(""+t).trim(),o=f(n);e.innerHTML="",i.add(o)}}else i.reset()},i.reset=function(){e.classList.add("jtags-empty"),e.innerHTML="<div></div>",d()},i.isValid=function(){for(var t=0,n=0;n<e.children.length;n++)e.children[n].classList.contains("jtags_error")&&t++;return 0==t},i.selectIndex=function(e,n){var a=t.getNode();a&&(a.innerText=e,n&&a.setAttribute("data-value",n),a.classList.remove("jtags_error"),o()||i.add("",!0))},i.search=function(e){e.innerText},i.destroy=function(){e.removeEventListener("mouseup",y),e.removeEventListener("keydown",m),e.removeEventListener("keyup",v),e.removeEventListener("paste",g),e.removeEventListener("focus",b),e.removeEventListener("blur",x),e.parentNode.removeChild(e)};var r=function(t){if(e.children.length){var n=document.createRange(),i=window.getSelection();t||(t=e.childNodes[e.childNodes.length-1]),n.setStart(t,t.length),n.collapse(!0),i.removeAllRanges(),i.addRange(n),e.scrollLeft=e.scrollWidth}},l=function(t,n,i){var o=document.createElement("div");return o.innerHTML=t||"",n&&o.setAttribute("data-value",n),i&&i.parentNode.classList.contains("jtags")?e.insertBefore(o,i.nextSibling):e.appendChild(o),o},d=function(){var t=i.getValue();t!=i.options.value&&(i.options.value=t,"function"==typeof i.options.onchange&&i.options.onchange(e,i,i.options.value),e.value!=i.options.value&&(e.value=i.options.value,"function"==typeof e.oninput&&e.oninput({type:"input",target:e,value:e.value}))),u()},u=function(){for(var t=0;t<e.children.length;t++)"DIV"===e.children[t].tagName&&(i.getValue(t)?(e.children[t].classList.add("jtags_label"),"function"==typeof i.options.validation&&i.getValue(t)?i.options.validation(e.children[t],e.children[t].innerText,e.children[t].getAttribute("data-value"))?e.children[t].classList.remove("jtags_error"):e.children[t].classList.add("jtags_error"):e.children[t].classList.remove("jtags_error")):e.children[t].classList.remove("jtags_label"));p()},p=function(){e.innerText.trim()?e.classList.remove("jtags-empty"):e.children.length&&"BR"!==e.children[0].tagName||(e.innerHTML="",r(l()))},f=function(e){var t=[],n="";if(e=e.trim()){for(var i=0;i<e.length;i++)","==e[i]||";"==e[i]||"\n"==e[i]?n&&(t.push(n.trim()),n=""):n+=e[i];n&&t.push(n)}return t},h=0,m=function(t){h=window.getSelection().anchorOffset,p(),"Tab"===t.key||";"===t.key||","===t.key?(window.getSelection().anchorOffset>1&&(o()?"function"==typeof i.options.onlimit&&i.options.onlimit(i,i.options.limit):i.add("",!0)),t.preventDefault()):"Enter"==t.key?a&&a.isOpened()||(window.getSelection().anchorOffset>1&&(o()||i.add("",!0)),t.preventDefault()):"Backspace"==t.key&&1==e.children.length&&window.getSelection().anchorOffset<1&&t.preventDefault(),a&&a.keydown(t),p()},v=function(e){if(39==e.which){var t=window.getSelection().anchorOffset;t>1&&t==h&&i.add("",!0)}else 13==e.which||38==e.which||40==e.which?e.preventDefault():a&&a.keyup(e);u()},g=function(t){if(t.clipboardData||t.originalEvent.clipboardData)var n=(t.originalEvent||t).clipboardData.getData("text/plain");else window.clipboardData&&(n=window.clipboardData.getData("Text"));var o=f(n);if("function"==typeof i.options.onbeforepaste){var a=i.options.onbeforepaste(e,i,o);if(!1===a)return t.preventDefault(),!1;a&&(o=a)}o.length>1?(i.add(o,!0),t.preventDefault()):o[0]&&(document.execCommand("insertText",!1,o[0]),t.preventDefault())},y=function(t){if(t.target.parentNode&&t.target.parentNode.classList.contains("jtags")&&(t.target.classList.contains("jtags_label")||t.target.classList.contains("jtags_error"))){var n=t.target.getBoundingClientRect();n.width-(t.clientX-n.left)<16&&i.remove(t.target)}t.target==e&&r()},b=function(){e.classList.contains("jtags-focus")||(e.children.length&&!i.getValue(e.children.length-1)||o()||l(""),"function"==typeof i.options.onfocus&&i.options.onfocus(e,i,i.getValue()),e.classList.add("jtags-focus"))},x=function(){if(e.classList.contains("jtags-focus")){a&&a.close();for(var t=0;t<e.children.length-1;t++)i.getValue(t)||e.removeChild(e.children[t]);d(),e.classList.remove("jtags-focus"),"function"==typeof i.options.onblur&&i.options.onblur(e,i,i.getValue())}};return"touchend"in document.documentElement==1?e.addEventListener("touchend",y):e.addEventListener("mouseup",y),e.addEventListener("keydown",m),e.addEventListener("keyup",v),e.addEventListener("paste",g),e.addEventListener("focus",b),e.addEventListener("blur",x),e.setAttribute("contenteditable",!0),e.classList.add("jtags"),i.setOptions(n),"function"==typeof i.options.onload&&i.options.onload(e,i),e.change=i.setValue,e.val=function(e){if(void 0===e)return i.getValue();i.setValue(e)},e.tags=i,i},toolbar:A,upload:R,validations:N};F.image=R,F.image.create=function(e){var t=document.createElement("img");return t.setAttribute("src",e.file),t.className="jfile",t.setAttribute("tabindex",-1),t.content=e,t},F.tracker=O,F.loading=g.loading,F.sha512=V();"undefined"==typeof document||p.state||function(){p.state=[];const e=function(t,n){return!(!t[n.type]||t[n.type]!=n)||!(!t.component||t.component!=n)||!!t.parentNode&&e(t.parentNode,n)};let t=15,n=!1,i={x:null,y:null},o=document.createElement("div");o.classList.add("jtooltip");const a=function(e){return e.shadowRoot||e.tagName.includes("-")},s=function(e){let t,n,i=e.path||e.composedPath&&e.composedPath();return i?(n=i[0],n&&a(n)&&!n.shadowRoot&&e.toElement&&(n=e.toElement)):(t=e.target&&a(e.target)?e.target.shadowRoot:document,n=t.elementFromPoint(x,y)),n};let r,l=["n","ne","e","se","s","sw","w","nw","rotate"];l.forEach((function(e,t){l[t]=document.createElement("div"),l[t].classList.add("jpanel-action"),"rotate"===e?l[t].setAttribute("data-action","rotate"):(l[t].setAttribute("data-action","resize"),l[t].setAttribute("data-position",e+"-resize"))}));const d=function(e){let t=s(e),n=F.findElement(t,"jpanel");n&&!n.classList.contains("readonly")&&n.classList.contains("jpanel-controls")?(n.append(...l),n.classList.contains("jpanel-rotate")||l[l.length-1].remove(),r=n):c(e)},c=function(e){r&&(l.forEach((function(e){e.remove()})),r=null)};document.addEventListener("focusin",d),document.addEventListener("mouseup",(function(e){n&&n.e&&("function"==typeof n.e.refresh&&i.actioned&&n.e.refresh(),n.e.style.cursor=""),i={x:null,y:null},n=!1})),document.addEventListener("mousedown",(function(t){if(t.changedTouches&&t.changedTouches[0])var i=t.changedTouches[0].clientX,o=t.changedTouches[0].clientY;else i=t.clientX,o=t.clientY;let a=s(t),r=a&&"DIV"===a.tagName&&a.getAttribute("contentEditable"),l=F.findElement(a,"jpanel");if(!l||l.classList.contains("readonly")||r)n=!1;else{let e=l.getBoundingClientRect(),t=0;l.style.rotate&&(t=parseFloat(l.style.rotate));let s="move";a.getAttribute("data-action")?s=a.getAttribute("data-action"):l.style.cursor?s="resize":l.style.cursor="move",n={action:s,a:t,e:l,x:i,y:o,l:e.left,t:e.top,b:e.bottom,r:e.right,w:e.width,h:e.height,d:l.style.cursor,actioned:!1},l.style.width||(l.style.width=e.width+"px"),l.style.height||(l.style.height=e.height+"px")}(function(t){if(p.state&&p.state.length>0)for(var n=0;n<p.state.length;n++)p.state[n]&&!e(t,p.state[n])&&p.state[n].close()})(a),d(t)})),document.addEventListener("mousemove",(function(e){if(n){let t=e.clientX||e.pageX,s=e.clientY||e.pageY;if(null==i.x&&null==i.y&&(i.x=t,i.y=s),"move"===n.action){var o=t-i.x,a=s-i.y,r=n.e.offsetTop+a,l=n.e.offsetLeft+o;n.e.style.top=r+"px",n.e.style.left=l+"px","function"==typeof n.e.refresh&&(i.actioned=!0,n.e.refresh("position",r,l))}else if("rotate"===n.action){let e=function(e,t,n,i,o,a){const s=n-e,r=i-t,l=o-e,d=a-t;let c=Math.atan2(r,s),u=Math.atan2(d,l)-c;return u*=180/Math.PI,u<0&&(u+=360),u}(n.l+n.w/2,n.t+n.h/2,n.x,n.y,t,s);e+=n.a%360,e=2*Math.round(e/2),n.e.style.rotate=`${e}deg`,"function"==typeof n.e.refresh&&(i.actioned=!0,n.e.refresh("rotate",e))}else if("resize"===n.action){let o=null,a=null,r=null,l=null;"e-resize"==n.d||"ne-resize"==n.d||"se-resize"==n.d?(r=n.e.offsetWidth+(t-i.x),e.shiftKey&&(l=n.e.offsetHeight+(t-i.x)*(n.e.offsetHeight/n.e.offsetWidth))):"w-resize"!==n.d&&"nw-resize"!=n.d&&"sw-resize"!=n.d||(a=n.e.offsetLeft+(t-i.x),r=n.e.offsetLeft+n.e.offsetWidth-a,e.shiftKey&&(l=n.e.offsetHeight-(t-i.x)*(n.e.offsetHeight/n.e.offsetWidth))),"s-resize"==n.d||"se-resize"==n.d||"sw-resize"==n.d?l||(l=n.e.offsetHeight+(s-i.y)):"n-resize"!==n.d&&"ne-resize"!=n.d&&"nw-resize"!=n.d||(o=n.e.offsetTop+(s-i.y),l=n.e.offsetTop+n.e.offsetHeight-o),o&&(n.e.style.top=o+"px"),a&&(n.e.style.left=a+"px"),r&&(n.e.style.width=r+"px"),l&&(n.e.style.height=l+"px"),"function"==typeof n.e.refresh&&(i.actioned=!0,n.e.refresh("dimensions",r,l))}i.x=t,i.y=s}else{let n=s(e),i=F.findElement(n,"jpanel");if(i)if(i.classList.contains("jpanel-controls")){let e=n.getAttribute("data-position");i.style.cursor=e||""}else if(i.getAttribute("tabindex")){let n=i.getBoundingClientRect();e.clientY-n.top<t?n.width-(e.clientX-n.left)<t?i.style.cursor="ne-resize":e.clientX-n.left<t?i.style.cursor="nw-resize":i.style.cursor="n-resize":n.height-(e.clientY-n.top)<t?n.width-(e.clientX-n.left)<t?i.style.cursor="se-resize":e.clientX-n.left<t?i.style.cursor="sw-resize":i.style.cursor="s-resize":n.width-(e.clientX-n.left)<t?i.style.cursor="e-resize":e.clientX-n.left<t?i.style.cursor="w-resize":i.style.cursor=""}}})),document.addEventListener("mouseover",(function(e){var t=s(e).getAttribute("data-tooltip");if(t){if(o.innerText=t,e.changedTouches&&e.changedTouches[0])var n=e.changedTouches[0].clientX,i=e.changedTouches[0].clientY;else n=e.clientX,i=e.clientY;o.style.top=i+"px",o.style.left=n+"px",document.body.appendChild(o)}else o.innerText&&(o.innerText="",document.body.removeChild(o))})),document.addEventListener("keydown",(function(e){let t=document.activeElement;t&&"Delete"===e.key&&"function"==typeof t.delete&&(t.delete(),e.preventDefault(),e.stopImmediatePropagation()),p.state&&p.state.length&&(t=p.state[p.state.length-1],t&&"Escape"===e.key&&"function"==typeof t.isOpened&&"function"==typeof t.close&&t.isOpened()&&(t.close(),e.preventDefault(),e.stopImmediatePropagation()))})),document.addEventListener("contextmenu",(function(e){var t=document.activeElement;if(t&&"function"==typeof t.contextmenu)t.contextmenu(e),e.preventDefault(),e.stopImmediatePropagation();else if(t=F.findElement(e.target,(function(e){return e.tagName&&e.getAttribute("aria-contextmenu-id")})),t){var n=document.querySelector("#"+t);n?(n.contextmenu.open(e),e.preventDefault(),e.stopImmediatePropagation()):console.error("JSUITES: contextmenu id not found: "+t)}})),document.addEventListener("input",(function(e){(e.target.getAttribute("data-mask")||e.target.mask)&&F.mask(e)}))}();var P=F}(),e=o.default}(),e)})();