var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!function(e,t){"use strict";"object"==("undefined"==typeof module?"undefined":_typeof(module))&&"object"==_typeof(module.exports)?module.exports=e.document?t(e,!0):function(e){if(!e.document)throw new Error("jQuery requires a window with a document");return t(e)}:t(e)}("undefined"!=typeof window?window:void 0,function(C,e){"use strict";var t=[],E=C.document,r=Object.getPrototypeOf,s=t.slice,g=t.concat,u=t.push,i=t.indexOf,n={},o=n.toString,v=n.hasOwnProperty,a=v.toString,l=a.call(Object),y={},m=function(e){return"function"==typeof e&&"number"!=typeof e.nodeType},x=function(e){return null!=e&&e===e.window},c={type:!0,src:!0,noModule:!0};function b(e,t,n){var r,i=(t=t||E).createElement("script");if(i.text=e,n)for(r in c)n[r]&&(i[r]=n[r]);t.head.appendChild(i).parentNode.removeChild(i)}function w(e){return null==e?e+"":"object"==(void 0===e?"undefined":_typeof(e))||"function"==typeof e?n[o.call(e)]||"object":void 0===e?"undefined":_typeof(e)}var S=function e(t,n){return new e.fn.init(t,n)},f=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function p(e){var t=!!e&&"length"in e&&e.length,n=w(e);return!m(e)&&!x(e)&&("array"===n||0===t||"number"==typeof t&&0+~]|"+M+")"+M+"*"),z=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),X=new RegExp(W),U=new RegExp("^"+R+"$"),V={ID:new RegExp("^#("+R+")"),CLASS:new RegExp("^\\.("+R+")"),TAG:new RegExp("^("+R+"|[*])"),ATTR:new RegExp("^"+I),PSEUDO:new RegExp("^"+W),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+P+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},G=/^(?:input|select|textarea|button)$/i,Y=/^h\d$/i,Q=/^[^{]+\{\s*\[native \w/,J=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,K=/[+~]/,Z=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),ee=function(e,t,n){var r="0x"+t-65536;return r!=r||n?t:r<0?String.fromCharCode(r+65536):String.fromCharCode(r>>10|55296,1023&r|56320)},te=/([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g,ne=function(e,t){return t?"\0"===e?"�":e.slice(0,-1)+"\\"+e.charCodeAt(e.length-1).toString(16)+" ":"\\"+e},re=function(){T()},ie=me(function(e){return!0===e.disabled&&("form"in e||"label"in e)},{dir:"parentNode",next:"legend"});try{L.apply(t=H.call(m.childNodes),m.childNodes),t[m.childNodes.length].nodeType}catch(n){L={apply:t.length?function(e,t){q.apply(e,H.call(t))}:function(e,t){for(var n=e.length,r=0;e[n++]=t[r++];);e.length=n-1}}}function oe(e,t,n,r){var i,o,a,s,u,l,c,f=t&&t.ownerDocument,p=t?t.nodeType:9;if(n=n||[],"string"!=typeof e||!e||1!==p&&9!==p&&11!==p)return n;if(!r&&((t?t.ownerDocument||t:m)!==C&&T(t),t=t||C,E)){if(11!==p&&(u=J.exec(e)))if(i=u[1]){if(9===p){if(!(a=t.getElementById(i)))return n;if(a.id===i)return n.push(a),n}else if(f&&(a=f.getElementById(i))&&y(t,a)&&a.id===i)return n.push(a),n}else{if(u[2])return L.apply(n,t.getElementsByTagName(e)),n;if((i=u[3])&&d.getElementsByClassName&&t.getElementsByClassName)return L.apply(n,t.getElementsByClassName(i)),n}if(d.qsa&&!D[e+" "]&&(!v||!v.test(e))){if(1!==p)f=t,c=e;else if("object"!==t.nodeName.toLowerCase()){for((s=t.getAttribute("id"))?s=s.replace(te,ne):t.setAttribute("id",s=S),o=(l=h(e)).length;o--;)l[o]="#"+s+" "+ye(l[o]);c=l.join(","),f=K.test(e)&&ge(t.parentNode)||t}if(c)try{return L.apply(n,f.querySelectorAll(c)),n}catch(e){}finally{s===S&&t.removeAttribute("id")}}}return g(e.replace(_,"$1"),t,n,r)}function ae(){var r=[];return function e(t,n){return r.push(t+" ")>b.cacheLength&&delete e[r.shift()],e[t+" "]=n}}function se(e){return e[S]=!0,e}function ue(e){var t=C.createElement("fieldset");try{return!!e(t)}catch(e){return!1}finally{t.parentNode&&t.parentNode.removeChild(t),t=null}}function le(e,t){for(var n=e.split("|"),r=n.length;r--;)b.attrHandle[n[r]]=t}function ce(e,t){var n=t&&e,r=n&&1===e.nodeType&&1===t.nodeType&&e.sourceIndex-t.sourceIndex;if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function fe(t){return function(e){return"input"===e.nodeName.toLowerCase()&&e.type===t}}function pe(n){return function(e){var t=e.nodeName.toLowerCase();return("input"===t||"button"===t)&&e.type===n}}function de(t){return function(e){return"form"in e?e.parentNode&&!1===e.disabled?"label"in e?"label"in e.parentNode?e.parentNode.disabled===t:e.disabled===t:e.isDisabled===t||e.isDisabled!==!t&&ie(e)===t:e.disabled===t:"label"in e&&e.disabled===t}}function he(a){return se(function(o){return o=+o,se(function(e,t){for(var n,r=a([],e.length,o),i=r.length;i--;)e[n=r[i]]&&(e[n]=!(t[n]=e[n]))})})}function ge(e){return e&&void 0!==e.getElementsByTagName&&e}for(e in d=oe.support={},i=oe.isXML=function(e){var t=e&&(e.ownerDocument||e).documentElement;return!!t&&"HTML"!==t.nodeName},T=oe.setDocument=function(e){var t,n,r=e?e.ownerDocument||e:m;return r!==C&&9===r.nodeType&&r.documentElement&&(a=(C=r).documentElement,E=!i(C),m!==C&&(n=C.defaultView)&&n.top!==n&&(n.addEventListener?n.addEventListener("unload",re,!1):n.attachEvent&&n.attachEvent("onunload",re)),d.attributes=ue(function(e){return e.className="i",!e.getAttribute("className")}),d.getElementsByTagName=ue(function(e){return e.appendChild(C.createComment("")),!e.getElementsByTagName("*").length}),d.getElementsByClassName=Q.test(C.getElementsByClassName),d.getById=ue(function(e){return a.appendChild(e).id=S,!C.getElementsByName||!C.getElementsByName(S).length}),d.getById?(b.filter.ID=function(e){var t=e.replace(Z,ee);return function(e){return e.getAttribute("id")===t}},b.find.ID=function(e,t){if(void 0!==t.getElementById&&E){var n=t.getElementById(e);return n?[n]:[]}}):(b.filter.ID=function(e){var n=e.replace(Z,ee);return function(e){var t=void 0!==e.getAttributeNode&&e.getAttributeNode("id");return t&&t.value===n}},b.find.ID=function(e,t){if(void 0!==t.getElementById&&E){var n,r,i,o=t.getElementById(e);if(o){if((n=o.getAttributeNode("id"))&&n.value===e)return[o];for(i=t.getElementsByName(e),r=0;o=i[r++];)if((n=o.getAttributeNode("id"))&&n.value===e)return[o]}return[]}}),b.find.TAG=d.getElementsByTagName?function(e,t){return void 0!==t.getElementsByTagName?t.getElementsByTagName(e):d.qsa?t.querySelectorAll(e):void 0}:function(e,t){var n,r=[],i=0,o=t.getElementsByTagName(e);if("*"!==e)return o;for(;n=o[i++];)1===n.nodeType&&r.push(n);return r},b.find.CLASS=d.getElementsByClassName&&function(e,t){if(void 0!==t.getElementsByClassName&&E)return t.getElementsByClassName(e)},s=[],v=[],(d.qsa=Q.test(C.querySelectorAll))&&(ue(function(e){a.appendChild(e).innerHTML="",e.querySelectorAll("[msallowcapture^='']").length&&v.push("[*^$]="+M+"*(?:''|\"\")"),e.querySelectorAll("[selected]").length||v.push("\\["+M+"*(?:value|"+P+")"),e.querySelectorAll("[id~="+S+"-]").length||v.push("~="),e.querySelectorAll(":checked").length||v.push(":checked"),e.querySelectorAll("a#"+S+"+*").length||v.push(".#.+[+~]")}),ue(function(e){e.innerHTML="";var t=C.createElement("input");t.setAttribute("type","hidden"),e.appendChild(t).setAttribute("name","D"),e.querySelectorAll("[name=d]").length&&v.push("name"+M+"*[*^$|!~]?="),2!==e.querySelectorAll(":enabled").length&&v.push(":enabled",":disabled"),a.appendChild(e).disabled=!0,2!==e.querySelectorAll(":disabled").length&&v.push(":enabled",":disabled"),e.querySelectorAll("*,:x"),v.push(",.*:")})),(d.matchesSelector=Q.test(c=a.matches||a.webkitMatchesSelector||a.mozMatchesSelector||a.oMatchesSelector||a.msMatchesSelector))&&ue(function(e){d.disconnectedMatch=c.call(e,"*"),c.call(e,"[s!='']:x"),s.push("!=",W)}),v=v.length&&new RegExp(v.join("|")),s=s.length&&new RegExp(s.join("|")),t=Q.test(a.compareDocumentPosition),y=t||Q.test(a.contains)?function(e,t){var n=9===e.nodeType?e.documentElement:e,r=t&&t.parentNode;return e===r||!(!r||1!==r.nodeType||!(n.contains?n.contains(r):e.compareDocumentPosition&&16&e.compareDocumentPosition(r)))}:function(e,t){if(t)for(;t=t.parentNode;)if(t===e)return!0;return!1},N=t?function(e,t){if(e===t)return l=!0,0;var n=!e.compareDocumentPosition-!t.compareDocumentPosition;return n||(1&(n=(e.ownerDocument||e)===(t.ownerDocument||t)?e.compareDocumentPosition(t):1)||!d.sortDetached&&t.compareDocumentPosition(e)===n?e===C||e.ownerDocument===m&&y(m,e)?-1:t===C||t.ownerDocument===m&&y(m,t)?1:u?O(u,e)-O(u,t):0:4&n?-1:1)}:function(e,t){if(e===t)return l=!0,0;var n,r=0,i=e.parentNode,o=t.parentNode,a=[e],s=[t];if(!i||!o)return e===C?-1:t===C?1:i?-1:o?1:u?O(u,e)-O(u,t):0;if(i===o)return ce(e,t);for(n=e;n=n.parentNode;)a.unshift(n);for(n=t;n=n.parentNode;)s.unshift(n);for(;a[r]===s[r];)r++;return r?ce(a[r],s[r]):a[r]===m?-1:s[r]===m?1:0}),C},oe.matches=function(e,t){return oe(e,null,null,t)},oe.matchesSelector=function(e,t){if((e.ownerDocument||e)!==C&&T(e),t=t.replace(z,"='$1']"),d.matchesSelector&&E&&!D[t+" "]&&(!s||!s.test(t))&&(!v||!v.test(t)))try{var n=c.call(e,t);if(n||d.disconnectedMatch||e.document&&11!==e.document.nodeType)return n}catch(e){}return 0":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(e){return e[1]=e[1].replace(Z,ee),e[3]=(e[3]||e[4]||e[5]||"").replace(Z,ee),"~="===e[2]&&(e[3]=" "+e[3]+" "),e.slice(0,4)},CHILD:function(e){return e[1]=e[1].toLowerCase(),"nth"===e[1].slice(0,3)?(e[3]||oe.error(e[0]),e[4]=+(e[4]?e[5]+(e[6]||1):2*("even"===e[3]||"odd"===e[3])),e[5]=+(e[7]+e[8]||"odd"===e[3])):e[3]&&oe.error(e[0]),e},PSEUDO:function(e){var t,n=!e[6]&&e[2];return V.CHILD.test(e[0])?null:(e[3]?e[2]=e[4]||e[5]||"":n&&X.test(n)&&(t=h(n,!0))&&(t=n.indexOf(")",n.length-t)-n.length)&&(e[0]=e[0].slice(0,t),e[2]=n.slice(0,t)),e.slice(0,3))}},filter:{TAG:function(e){var t=e.replace(Z,ee).toLowerCase();return"*"===e?function(){return!0}:function(e){return e.nodeName&&e.nodeName.toLowerCase()===t}},CLASS:function(e){var t=p[e+" "];return t||(t=new RegExp("(^|"+M+")"+e+"("+M+"|$)"))&&p(e,function(e){return t.test("string"==typeof e.className&&e.className||void 0!==e.getAttribute&&e.getAttribute("class")||"")})},ATTR:function(n,r,i){return function(e){var t=oe.attr(e,n);return null==t?"!="===r:!r||(t+="","="===r?t===i:"!="===r?t!==i:"^="===r?i&&0===t.indexOf(i):"*="===r?i&&-1:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i;function A(e,n,r){return m(n)?S.grep(e,function(e,t){return!!n.call(e,t,e)!==r}):n.nodeType?S.grep(e,function(e){return e===n!==r}):"string"!=typeof n?S.grep(e,function(e){return-1)[^>]*|#([\w-]+))$/;(S.fn.init=function(e,t,n){var r,i;if(!e)return this;if(n=n||j,"string"!=typeof e)return e.nodeType?(this[0]=e,this.length=1,this):m(e)?void 0!==n.ready?n.ready(e):e(S):S.makeArray(e,this);if(!(r="<"===e[0]&&">"===e[e.length-1]&&3<=e.length?[null,e,null]:q.exec(e))||!r[1]&&t)return!t||t.jquery?(t||n).find(e):this.constructor(t).find(e);if(r[1]){if(t=t instanceof S?t[0]:t,S.merge(this,S.parseHTML(r[1],t&&t.nodeType?t.ownerDocument||t:E,!0)),N.test(r[1])&&S.isPlainObject(t))for(r in t)m(this[r])?this[r](t[r]):this.attr(r,t[r]);return this}return(i=E.getElementById(r[2]))&&(this[0]=i,this.length=1),this}).prototype=S.fn,j=S(E);var L=/^(?:parents|prev(?:Until|All))/,H={children:!0,contents:!0,next:!0,prev:!0};function O(e,t){for(;(e=e[t])&&1!==e.nodeType;);return e}S.fn.extend({has:function(e){var t=S(e,this),n=t.length;return this.filter(function(){for(var e=0;e\x20\t\r\n\f]+)/i,ce=/^$|^module$|\/(?:java|ecma)script/i,fe={option:[1,""],thead:[1,"","
"],col:[2,"","
"],tr:[2,"","
"],td:[3,"","
"],_default:[0,"",""]};function pe(e,t){var n;return n=void 0!==e.getElementsByTagName?e.getElementsByTagName(t||"*"):void 0!==e.querySelectorAll?e.querySelectorAll(t||"*"):[],void 0===t||t&&D(e,t)?S.merge([e],n):n}function de(e,t){for(var n=0,r=e.length;nx",y.noCloneChecked=!!he.cloneNode(!0).lastChild.defaultValue;var me=E.documentElement,xe=/^key/,be=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,we=/^([^.]*)(?:\.(.+)|)/;function Te(){return!0}function Ce(){return!1}function Ee(){try{return E.activeElement}catch(e){}}function Se(e,t,n,r,i,o){var a,s;if("object"==(void 0===t?"undefined":_typeof(t))){for(s in"string"!=typeof n&&(r=r||n,n=void 0),t)Se(e,s,n,r,t[s],o);return e}if(null==r&&null==i?(i=n,r=n=void 0):null==i&&("string"==typeof n?(i=r,r=void 0):(i=r,r=n,n=void 0)),!1===i)i=Ce;else if(!i)return e;return 1===o&&(a=i,(i=function(e){return S().off(e),a.apply(this,arguments)}).guid=a.guid||(a.guid=S.guid++)),e.each(function(){S.event.add(this,t,i,r,n)})}S.event={global:{},add:function(t,e,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.get(t);if(v)for(n.handler&&(n=(o=n).handler,i=o.selector),i&&S.find.matchesSelector(me,i),n.guid||(n.guid=S.guid++),(u=v.events)||(u=v.events={}),(a=v.handle)||(a=v.handle=function(e){return void 0!==S&&S.event.triggered!==e.type?S.event.dispatch.apply(t,arguments):void 0}),l=(e=(e||"").match(P)||[""]).length;l--;)d=g=(s=we.exec(e[l])||[])[1],h=(s[2]||"").split(".").sort(),d&&(f=S.event.special[d]||{},d=(i?f.delegateType:f.bindType)||d,f=S.event.special[d]||{},c=S.extend({type:d,origType:g,data:r,handler:n,guid:n.guid,selector:i,needsContext:i&&S.expr.match.needsContext.test(i),namespace:h.join(".")},o),(p=u[d])||((p=u[d]=[]).delegateCount=0,f.setup&&!1!==f.setup.call(t,r,h,a)||t.addEventListener&&t.addEventListener(d,a)),f.add&&(f.add.call(t,c),c.handler.guid||(c.handler.guid=n.guid)),i?p.splice(p.delegateCount++,0,c):p.push(c),S.event.global[d]=!0)},remove:function(e,t,n,r,i){var o,a,s,u,l,c,f,p,d,h,g,v=Y.hasData(e)&&Y.get(e);if(v&&(u=v.events)){for(l=(t=(t||"").match(P)||[""]).length;l--;)if(d=g=(s=we.exec(t[l])||[])[1],h=(s[2]||"").split(".").sort(),d){for(f=S.event.special[d]||{},p=u[d=(r?f.delegateType:f.bindType)||d]||[],s=s[2]&&new RegExp("(^|\\.)"+h.join("\\.(?:.*\\.|)")+"(\\.|$)"),a=o=p.length;o--;)c=p[o],!i&&g!==c.origType||n&&n.guid!==c.guid||s&&!s.test(c.namespace)||r&&r!==c.selector&&("**"!==r||!c.selector)||(p.splice(o,1),c.selector&&p.delegateCount--,f.remove&&f.remove.call(e,c));a&&!p.length&&(f.teardown&&!1!==f.teardown.call(e,h,v.handle)||S.removeEvent(e,d,v.handle),delete u[d])}else for(d in u)S.event.remove(e,d+t[l],n,r,!0);S.isEmptyObject(u)&&Y.remove(e,"handle events")}},dispatch:function(e){var t,n,r,i,o,a,s=S.event.fix(e),u=new Array(arguments.length),l=(Y.get(this,"events")||{})[s.type]||[],c=S.event.special[s.type]||{};for(u[0]=s,t=1;t\x20\t\r\n\f]*)[^>]*)\/>/gi,De=/\s*$/g;function je(e,t){return D(e,"table")&&D(11!==t.nodeType?t:t.firstChild,"tr")&&S(e).children("tbody")[0]||e}function qe(e){return e.type=(null!==e.getAttribute("type"))+"/"+e.type,e}function Le(e){return"true/"===(e.type||"").slice(0,5)?e.type=e.type.slice(5):e.removeAttribute("type"),e}function He(e,t){var n,r,i,o,a,s,u,l;if(1===t.nodeType){if(Y.hasData(e)&&(o=Y.access(e),a=Y.set(t,o),l=o.events))for(i in delete a.handle,a.events={},l)for(n=0,r=l[i].length;n")},clone:function(e,t,n){var r,i,o,a,s,u,l,c=e.cloneNode(!0),f=S.contains(e.ownerDocument,e);if(!(y.noCloneChecked||1!==e.nodeType&&11!==e.nodeType||S.isXMLDoc(e)))for(a=pe(c),r=0,i=(o=pe(e)).length;r").prop({charset:n.scriptCharset,src:n.url}).on("load error",i=function(e){r.remove(),i=null,e&&t("error"===e.type?404:200,e.type)}),E.head.appendChild(r[0])},abort:function(){i&&i()}}});var Bt,Ft=[],zt=/(=)\?(?=&|$)|\?\?/;S.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var e=Ft.pop()||S.expando+"_"+bt++;return this[e]=!0,e}}),S.ajaxPrefilter("json jsonp",function(e,t,n){var r,i,o,a=!1!==e.jsonp&&(zt.test(e.url)?"url":"string"==typeof e.data&&0===(e.contentType||"").indexOf("application/x-www-form-urlencoded")&&zt.test(e.data)&&"data");if(a||"jsonp"===e.dataTypes[0])return r=e.jsonpCallback=m(e.jsonpCallback)?e.jsonpCallback():e.jsonpCallback,a?e[a]=e[a].replace(zt,"$1"+r):!1!==e.jsonp&&(e.url+=(wt.test(e.url)?"&":"?")+e.jsonp+"="+r),e.converters["script json"]=function(){return o||S.error(r+" was not called"),o[0]},e.dataTypes[0]="json",i=C[r],C[r]=function(){o=arguments},n.always(function(){void 0===i?S(C).removeProp(r):C[r]=i,e[r]&&(e.jsonpCallback=t.jsonpCallback,Ft.push(r)),o&&m(i)&&i(o[0]),o=i=void 0}),"script"}),y.createHTMLDocument=((Bt=E.implementation.createHTMLDocument("").body).innerHTML="
",2===Bt.childNodes.length),S.parseHTML=function(e,t,n){return"string"!=typeof e?[]:("boolean"==typeof t&&(n=t,t=!1),t||(y.createHTMLDocument?((r=(t=E.implementation.createHTMLDocument("")).createElement("base")).href=E.location.href,t.head.appendChild(r)):t=E),o=!n&&[],(i=N.exec(e))?[t.createElement(i[1])]:(i=ye([e],t,o),o&&o.length&&S(o).remove(),S.merge([],i.childNodes)));var r,i,o},S.fn.load=function(e,t,n){var r,i,o,a=this,s=e.indexOf(" ");return-1").append(S.parseHTML(e)).find(r):e)}).always(n&&function(e,t){a.each(function(){n.apply(this,o||[e.responseText,t,e])})}),this},S.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(e,t){S.fn[t]=function(e){return this.on(t,e)}}),S.expr.pseudos.animated=function(t){return S.grep(S.timers,function(e){return t===e.elem}).length},S.offset={setOffset:function(e,t,n){var r,i,o,a,s,u,l=S.css(e,"position"),c=S(e),f={};"static"===l&&(e.style.position="relative"),s=c.offset(),o=S.css(e,"top"),u=S.css(e,"left"),i=("absolute"===l||"fixed"===l)&&-1<(o+u).indexOf("auto")?(a=(r=c.position()).top,r.left):(a=parseFloat(o)||0,parseFloat(u)||0),m(t)&&(t=t.call(e,n,S.extend({},s))),null!=t.top&&(f.top=t.top-s.top+a),null!=t.left&&(f.left=t.left-s.left+i),"using"in t?t.using.call(e,f):c.css(f)}},S.fn.extend({offset:function(t){if(arguments.length)return void 0===t?this:this.each(function(e){S.offset.setOffset(this,t,e)});var e,n,r=this[0];return r?r.getClientRects().length?(e=r.getBoundingClientRect(),n=r.ownerDocument.defaultView,{top:e.top+n.pageYOffset,left:e.left+n.pageXOffset}):{top:0,left:0}:void 0},position:function(){if(this[0]){var e,t,n,r=this[0],i={top:0,left:0};if("fixed"===S.css(r,"position"))t=r.getBoundingClientRect();else{for(t=this.offset(),n=r.ownerDocument,e=r.offsetParent||n.documentElement;e&&(e===n.body||e===n.documentElement)&&"static"===S.css(e,"position");)e=e.parentNode;e&&e!==r&&1===e.nodeType&&((i=S(e).offset()).top+=S.css(e,"borderTopWidth",!0),i.left+=S.css(e,"borderLeftWidth",!0))}return{top:t.top-i.top-S.css(r,"marginTop",!0),left:t.left-i.left-S.css(r,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){for(var e=this.offsetParent;e&&"static"===S.css(e,"position");)e=e.offsetParent;return e||me})}}),S.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(t,i){var o="pageYOffset"===i;S.fn[t]=function(e){return B(this,function(e,t,n){var r;if(x(e)?r=e:9===e.nodeType&&(r=e.defaultView),void 0===n)return r?r[i]:e[t];r?r.scrollTo(o?r.pageXOffset:n,o?n:r.pageYOffset):e[t]=n},t,e,arguments.length)}}),S.each(["top","left"],function(e,n){S.cssHooks[n]=$e(y.pixelPosition,function(e,t){if(t)return t=We(e,n),Me.test(t)?S(e).position()[n]+"px":t})}),S.each({Height:"height",Width:"width"},function(a,s){S.each({padding:"inner"+a,content:s,"":"outer"+a},function(r,o){S.fn[o]=function(e,t){var n=arguments.length&&(r||"boolean"!=typeof e),i=r||(!0===e||!0===t?"margin":"border");return B(this,function(e,t,n){var r;return x(e)?0===o.indexOf("outer")?e["inner"+a]:e.document.documentElement["client"+a]:9===e.nodeType?(r=e.documentElement,Math.max(e.body["scroll"+a],r["scroll"+a],e.body["offset"+a],r["offset"+a],r["client"+a])):void 0===n?S.css(e,t,i):S.style(e,t,n,i)},s,n?e:void 0,n)}})}),S.each("blur focus focusin focusout resize scroll click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup contextmenu".split(" "),function(e,n){S.fn[n]=function(e,t){return 0 \n
\n \n
Ошибка!
\n
\n ")))},e.send(null)}function r(e){w(o).html(e);var t=o.offsetHeight;w(o).css({height:"0px"}),a.bottom+t>window.innerHeight?(w(d).removeClass("loading").addClass("active visible upward"),w(o).addClass("upward"),w(o).css({bottom:window.innerHeight-a.top-1+"px",left:a.left+"px",width:a.width+"px",opacity:1})):(w(o).removeClass("upward"),w(d).removeClass("loading").addClass("active visible"),w(o).css({top:a.bottom-1+"px",left:a.left+"px",width:a.width+"px",opacity:1})),w(o).animate({height:t+"px"},250,function(){w(o).css({height:"auto"})}),w(o).find(".cb_header").css("padding-right",AppGrid.getScrollBarWidth())}function u(){w(d).removeClass("active visible upward"),w(o).animate({"min-height":"0px"},250,function(){w(o).html(""),w(o).removeClass("upward"),w(o).remove()})}function m(e){w(o).animate({"min-height":"0px"},250,function(){w(d).removeClass("active visible upward"),w(o).html(""),w(o).removeClass("upward"),w(o).remove(),p(e)})}function h(i){if(void 0!==i.columns){var a="",n="";a+="
",[].forEach.call(i.columns,function(e){var t=void 0!==e.width?"width:"+e.width+"%":"display: none;";a+="
"+e.caption+"
"}),a+="
",[].forEach.call(i.data,function(e){var t=0;n+="
",n+=" ",t++,n+="
"+e[i.columns[t].field]+"
",t++,n+="
"+e[i.columns[t].field]+"
",t++,n+="
"+e[i.columns[t].field]+"
",n+="
"}),w(s).html("
"+a+"
"),r("
"+a+"
")}else{r("\n
\n
\n \n
Ошибка при получении данных с сервера!
\n

Неверный формат данных

\n
\n
")}w(o).get(0).onclick=function(e){if(e.preventDefault(),null!==e.target.closest(".cb_row")){var t=w(e.target).closest(".cb_row");w(d).removeClass("active visible upward"),w(o).animate({"min-height":"0px"},250,function(){w(o).html(""),w(o).removeAttr("style"),w(o).remove(),c.val(t.attr("data-value")),v.text(w(t).attr("data-text")),v.removeClass("default"),l.data.values.value=w(t).attr("data-value"),l.data.values.text=w(t).attr("data-text"),c.change(),p(e),document.removeEventListener("click",m),void 0!==l.boundField&&null!=l.boundField&&l.boundField(t,i.data[w(t).index()])})}null!==e.target.closest(".header")&&e.stopPropagation()}}function p(e){"wheel"===e.type||"click"===e.type?null===e.target.closest(".ui-widget")&&(w(".ui-widget").remove(),w(".dropdown").removeClass("active visible upward")):(w(".ui-widget").remove(),w(".dropdown").removeClass("active visible upward")),0===w(".ui-widget").length&&(document.removeEventListener("wheel",p),document.removeEventListener("click",p),window.removeEventListener("blur",p),window.removeEventListener("resize",p))}return this.each(function(e,t){w(t).find(".text").hasClass("default")&&null!=l.data.values&&(""!=l.data.values.text&&w(t).find(".text").removeClass("default").text(l.data.values.text),w(t).find("input[type=hidden]").val(l.data.values.value||"")),w(t).on("click",function(e){return e.preventDefault(),w(".ui-widget").remove(),void 0!==w(".ui.icon.input[active]").children().eq(0).get(0)&&w(".ui.icon.input[active]").children().eq(0).get(0).blur(),w(".ui.icon.input[active]").removeAttr("active"),w(t).attr("data_filter"),a=(d=t).getBoundingClientRect(),i="¶m_id="+w(d).attr("data_param_id"),s=w(d).find("div.menuBox"),c=w(d).children("input"),v=w(d).children(".text"),!0===l.apiRemout?w(d).hasClass("active visible")?u():(w(d).closest(".ui.form").find(".dropdown").not(w(d)).removeClass("active visible upward"),null!==o&&(w(o).html(""),w(o).removeAttr("style")),null===o&&((o=document.createElement("div")).className="ui-widget comboBoxList"),document.body.appendChild(o),w(d).addClass("loading"),0===w(s).children().length&&!0===l.apiRemout?n():r(w(s).html())):(null!==o&&(w(o).html(""),w(o).removeAttr("style")),null===o&&((o=document.createElement("div")).className="ui-widget comboBoxList"),document.body.appendChild(o),w(d).hasClass("active visible")?u():h(l.data)),window.onkeydown=function(e){27===e.keyCode&&"Escape"===e.key&&(w(".ui-widget").remove(),w(".dropdown").removeClass("active visible upward"))},document.addEventListener("wheel",p),window.addEventListener("blur",p),window.addEventListener("resize",p),document.addEventListener("click",p),!1})})})}(jQuery); !function(h){h&&(h.fn.comboBox?console.info("comboBox already initialized"):h.fn.comboBox=function(i,e){void 0===i&&(i={apiRemout:!1,multiLevel:!1,url:""});var t=i.url,l="",o=null,d=null,s=null,r=null,c=null,n=null,v=null;function a(){var a=new XMLHttpRequest;a.open("get",t+l),a.onreadystatechange=function(){if(4===a.readyState)if(200===a.status){var e=JSON.parse(a.response);l="",i=e,n=[],[].forEach.call(i,function(e){e.children=[],e.expand=!1,e.parent=null;for(var t=e.lvl=0;t"+e.val+"",e.children.forEach(function(e){l+=t(e)})):(e.listval_id===r.val()&&(i=" selected"),""!==e.val&&(l+="
"+e.val+"
")),l}(e)):(e.listval_id===r.val()&&(i=" selected"),void 0!==v&&null!==e.filter.match(v)?""!==e.val&&(l+="
"+e.val+"
"):void 0===v&&""!==e.val&&(l+="
"+e.val+"
"))}),h(d).html(l),u(l),h(s).get(0).onclick=function(e){if(e.preventDefault(),null!==e.target.closest(".item")){var t=h(e.target).closest(".item");h(o).removeClass("active visible"),h(d).find(".selected").removeClass("selected"),h(s).find(".selected").removeClass("selected"),h(d).children().eq(h(t).index()).addClass("selected"),h(t).addClass("selected"),r.val(t.attr("data-value")),c.text(t.text()),h(s).css({border:"1px solid rgba(34,36,38,.15)"}),h(s).animate({height:"0px"},250,function(){h(s).html(""),h(s).removeAttr("style"),h(s).remove(),r.change(),c.removeClass("default"),m(e)})}null!==e.target.closest(".header")&&e.stopPropagation()}}else a.response,u("\n
\n
\n \n
Ошибка!
\n
\n
");var l,t,i,n},a.send(null)}function u(e){h(s).html(e);var t=s.offsetHeight;h(s).css({height:"0px"}),n.bottom+t>window.innerHeight?(h(o).removeClass("loading").addClass("active visible upward"),h(s).addClass("upward"),h(s).css({bottom:window.innerHeight-n.top-1+"px",left:n.left+"px",width:n.width+"px",opacity:1})):(h(s).removeClass("upward"),h(o).removeClass("loading").addClass("active visible"),h(s).css({top:n.bottom-1+"px",left:n.left+"px",width:n.width+"px",opacity:1})),h(s).animate({height:t+"px"},250,function(){h(s).css({height:"auto"})})}function m(e){"wheel"===e.type||"click"===e.type?null===e.target.closest(".ui-widget")&&(h(".ui-widget").remove(),h(".dropdown").removeClass("active visible upward")):(h(".ui-widget").remove(),h(".dropdown").removeClass("active visible upward")),0===h(".ui-widget").length&&(document.removeEventListener("wheel",m),window.removeEventListener("blur",m),window.removeEventListener("resize",m),document.removeEventListener("click",m))}return this.each(function(e,t){h(t).on("click",function(e){return e.preventDefault(),h(".ui-widget").remove(),void 0!==h(".ui.icon.input[active]").children().eq(0).get(0)&&h(".ui.icon.input[active]").children().eq(0).get(0).blur(),h(".ui.icon.input[active]").removeAttr("active"),v=h(t).attr("data_filter"),n=(o=t).getBoundingClientRect(),l="¶m_id="+h(o).attr("data_param_id"),d=h(o).find("div.menu"),r=h(o).children("input"),c=h(o).children(".text"),h(o).hasClass("active visible")?(h(o).removeClass("active visible"),h(s).animate({height:"0px"},250,function(){h(s).html(""),h(s).removeAttr("style"),h(s).removeClass("upward"),h(s).remove()})):(h(o).closest(".ui.form").find(".dropdown").not(h(o)).removeClass("active visible"),null!==s&&(h(s).html(""),h(s).removeAttr("style")),null===s&&((s=document.createElement("div")).className="ui-widget comboBoxList menu transition visible"),document.body.appendChild(s),h(o).addClass("loading"),0===h(d).children().length&&!0===i.apiRemout?a():u(h(d).html())),window.onkeydown=function(e){27===e.keyCode&&"Escape"===e.key&&(h(".ui-widget").remove(),h(".dropdown").removeClass("active visible upward"))},document.addEventListener("wheel",m),window.addEventListener("blur",m),window.addEventListener("resize",m),window.addEventListener("click",m),!1})})})}(jQuery); !function(g){if(g)if(g.fn.fiasFill)console.info("fiasFill already initialized");else{var D=[{id:"src",label:"Текст",placeholder:"Текстовое представление адреса",helper:!0},{id:"region",label:"Регион",placeholder:"Название региона",helper:!0},{id:"area",label:"Район",placeholder:"Название района",helper:!0},{id:"city",label:"Город",placeholder:"Название города",helper:!0},{id:"settlement",label:"Населенный пункт",placeholder:"Название населенного пункта",helper:!0},{id:"street",label:"Улица",placeholder:"Название улицы",helper:!0}],u=[{id:"house",label:"Дом",placeholder:"№",helper:!0},{id:"corp",label:"Корпус",placeholder:"№",helper:!0},{id:"liter",label:"Литер",placeholder:"Литер",helper:!0},{id:"flat",label:"Квартира/офис",placeholder:"№",helper:!0}],b="-",d=null,s=null,r={};g.fn.fiasFill=function(u){return this.each(function(t,a){var e,i,n,r,o=g.extend({container:null,url:"",type:"popap",data:null,title:"Редактор адреса",submit:null,view:"default",extraRow:!0,readOnly:!1},u);if(!(d=a).closest("div[data-fias-fill]")){var l=g(a).attr("data-value");if(""!==l&&null!=l||(l="{}"),o.placeholder=g(d).attr("placeholder"),o.data=v(JSON.parse(l)),o.name=g(d).attr("name"),o.forceReadOnly="true"===g(d).attr("data-readonly")||"1"===g(d).attr("data-readonly"),"default"===o.view)n=(i=o).hasOwnProperty("data")?i.data:i.outputData,r=g('\n
\n \n \n
\n '),g(d).replaceWith(r),r.find("input").attr("data-value",JSON.stringify(i.data)),r.find("input").val(n.text);else{if("card"!==o.view)return!1;o.cardTitle=g(d).attr("data-title"),(s=g('\n
\n
\n
'+e.cardTitle+'
\n
\n
\n
\n '+p(e)+' \n
\n
\n \n
\n ')).find("input").attr("data-value",JSON.stringify(e.data)),g(d).replaceWith(s)}}g("div[data-fias-fill]").each(function(t,l){l.onclick=function(t){o.inputData={};var a=g(l).find("input").attr("data-value");o.readOnly=g(l).hasClass("readonly"),o.data=v(JSON.parse(a));var e,i,n,r=(i={},n=""===(e=o).data.reg_id?"disabled":"",i.dialog=g("
"),i.windowContainer=g("
"),i.windowContainer.html('\n
'+e.title+'
\n
\n
\n '+(e.readOnly?"":'')+"\n "+(e.readOnly?"":'')+'\n \n
\n '),i.dialog.html(i.windowContainer),g("body").append(i.dialog),i.dialog.find(".button-cancel").on("click",function(){m(i)}),window.onkeydown=function(t){27===t.keyCode&&"Escape"===t.key&&m(i)},i);if(o.container=g(r.windowContainer).find(".content div"),o.dialog=r,!((o.element=this)instanceof c))return modalsList.map(function(t){return t.escapeClose&&(t.escapeCloseOld=t.escapeClose,t.escapeClose=!1),t}),new c(o)}})})},g.extend({fiasFill:function(t){if(!(this instanceof c))return new c(t)}})}function c(t){if(!(this instanceof c))return new c(t);var f=this;r=g.extend({},t),"string"==typeof t.data&&""!==t.data&&(t.data=JSON.parse(t.data)),t.data=v(t.data),f.container=t.container,f.inputData=t.data,f.outputData=JSON.parse(JSON.stringify(t.data)),f.submit=void 0!==t.submit?t.submit:null,f.title=t.title,f.url=t.url,f.param={},f.flag=!0,f.withoutStreet=""!==t.data.reg_id,-1!==t.hasOwnProperty("view")&&(f.view=t.view),-1!==t.hasOwnProperty("element")&&(f.element=t.element),-1!==t.hasOwnProperty("dialog")&&(f.dialog=t.dialog),-1!==t.hasOwnProperty("readOnly")&&(f.readOnly=t.readOnly),-1!==t.hasOwnProperty("placeholder")&&(f.placeholder=t.placeholder),f.container.attr("class","fias");var a=D.reduce(function(t,a){return"src"!==a.id?t+"
":">")+"
":t+"
"+(null!=f.inputData[a.id+"_text"]?f.inputData[a.id+"_text"]:b)+"
"},""),e="
"+u.reduce(function(t,a){return t+"
"},"")+"
",i="
",n='\n
\n
\n '+a+"\n "+e+"\n "+(r.extraRow?i:"")+'\n \n
\n \n
'+(""!==f.inputData.text&&null!=f.inputData.text?f.inputData.text:b)+'
\n
\n
\n \n
'+(""!==f.inputData.okatd&&null!=f.inputData.okatd?f.inputData.okatd:b)+'
\n
\n
\n \n
'+(""!==f.inputData.reg_id&&null!=f.inputData.reg_id?f.inputData.reg_id:b)+"
\n
\n
\n
\n ";function h(){var t=[];1 \n
Результаты поиска
\n
\n \n '):g(f.container.offsetParent().find(".modalbox")).append('\n
\n
Результаты поиска
\n
\n
\n '),f.container.find(".row i").on("click",function(t){g(t.target).parent().find("input").trigger("input",1)}),f.container.find("input").on("input",function(d){var s=1");var t="&contentType="+p+"&limit=20";v&&(t="&contentType=house&limit=20");var a=!0,e=!1,i=void 0;try{for(var n,r=D[Symbol.iterator]();!(a=(n=r.next()).done);a=!0){var l=n.value;void 0!==f.outputData[l.id+"_id"]&&(t+="&"+l.id+"Id="+f.outputData[l.id+"_id"])}}catch(t){e=!0,i=t}finally{try{!a&&r.return&&r.return()}finally{if(e)throw i}}var o=c.val().trim();if(3Нет данных";else{var e=!0,i=!1,n=void 0;try{for(var r,l=t[Symbol.iterator]();!(e=(r=l.next()).done);e=!0){var o=r.value;a+="
"+o.name+" "+o.title+"
"}}catch(t){i=!0,n=t}finally{try{!e&&l.return&&l.return()}finally{if(i)throw n}}}g("#fias-search-panel .body").html(a)}}},u.send()},void 0===s?500:0)}),f.container.find("input").on("click",function(t){var a=g(t.currentTarget).closest(".row").attr("data-value");if(f.currentAttr&&f.currentAttr!==a){var e=f.container.find(".row[data-value='"+f.currentAttr+"']");if(e.hasClass("extra-row"))return;e.find("input").val(f.outputData[f.currentAttr+"_text"]),g("#fias-search-panel").stop().animate({right:"0px"},500),delete f.currentAttr}}),g("#fias-search-panel").on("click",function(t){var a=g(t.target).closest(".row");if(0!==a.length){f.outputData[f.currentAttr+"_id"]=a.attr("data-value"),f.outputData[f.currentAttr+"_text"]=a.text(),f.outputData[f.currentAttr]=a.attr("data-raw"),f.container.find(".row[data-value='"+f.currentAttr+"'] input").val(a.text());var e=!1,i=!0,n=!1,r=void 0;try{for(var l,o=D[Symbol.iterator]();!(i=(l=o.next()).done);i=!0){var u=l.value;e&&(f.outputData[u.id+"_id"]="",f.outputData[u.id+"_text"]="",f.outputData[u.id]="",f.container.find(".row[data-value='"+u.id+"'] input").val("")),u.id===f.currentAttr&&(e=!0)}}catch(t){n=!0,r=t}finally{try{!i&&o.return&&o.return()}finally{if(n)throw r}}f.outputData.okatd="",f.outputData.reg_id="",f.outputData.postcode="",f.container.find(".okato-text .value").text(b),f.container.find(".reg-text .value").text(b),f.container.find(".address-text .value").text(h()),f.submit&&f.submit(f.outputData),g("#fias-search-panel").stop().animate({right:"0px"},500),"street"===f.currentAttr&&f.container.find(".col[data-value='house'] input").trigger("input"),delete f.currentAttr}}),void 0!==f.dialog&&g("#fiasDialog .button-submit").on("click",function(t){"card"===f.view&&g(f.element).find("div.ui.small.feed").html(p(f)),g(f.element).find("input").attr("data-value",JSON.stringify(f.outputData)),g(f.element).find("input").val(f.outputData.text),m(r.dialog)}),f.submit&&f.submit(f.outputData),g("#fiasDialog .button-clear").on("click",function(t){l(f.inputData),l(f.outputData),g("#fiasDialog input").each(function(t,a){return g(a).val("")}),g("#fiasDialog .text.row").each(function(t,a){return g(a).find(".text_folder").text(b)})})}function l(t){for(var a in t)t[a]="";return t}function p(t){var a=t.hasOwnProperty("data")?t.data:t.outputData,e=JSON.parse("{"+Object.keys(a).map(function(t){if(""!==a[t]&&null!==t.match("text")&&"src_text"!==t)return'"'+t+'":"'+a[t].replace(/"/gi,""")+'"'}).filter(Boolean).join(",")+"}"),i="",n={house:a.house,liter:a.liter,corp:a.corp,flat:a.flat},r=Object.keys(n).map(function(t){if(""!==n[t])return t+" "+n[t]}).filter(Boolean).join(", ").replace("house ","").replace("liter","литер").replace("corp","к.").replace("flat","кв.");if(""!==r&&(e.house_text=r),0'+t+': '+e[a]+".")};for(var o in e)l(o);i+='
'+e.text+""}else i='";return i}function v(t){return Object.assign({},{text:"",region:"",region_id:"",region_text:"",area:"",area_id:"",area_text:"",city:"",city_id:"",city_text:"",settlement:"",settlement_id:"",settlement_text:"",street:"",street_id:"",street_text:"",house:"",corp:"",liter:"",flat:"",extra:"",okatd:"",reg_id:"",postcode:""},t)}function m(t){modalsList.map(function(t){return t.escapeClose||"escapeCloseOld"in t&&(delete t.escapeCloseOld,t.escapeClose=!0),t}),t.dialog.fadeOut(250).delay(100).queue(function(t){g(this).remove(),t()})}}(jQuery); var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t,a,e){"function"==typeof define&&define.amd?define(["jquery"],t):"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"==typeof Meteor?module.exports=t(require("jquery")):t(a||e)}(function(i){"use strict";var l=function(p,b,w){var C={invalid:[],getCaret:function(){try{var t,a=0,e=p.get(0),n=document.selection,s=e.selectionStart;return n&&-1===navigator.appVersion.indexOf("MSIE 10")?((t=n.createRange()).moveStart("character",-C.val().length),a=t.text.length):(s||"0"===s)&&(a=s),a}catch(t){}},setCaret:function(t){try{if(p.is(":focus")){var a,e=p.get(0);e.setSelectionRange?e.setSelectionRange(t,t):((a=e.createTextRange()).collapse(!0),a.moveEnd("character",t),a.moveStart("character",t),a.select())}}catch(t){}},events:function(){p.on("keydown.mask",function(t){p.data("mask-keycode",t.keyCode||t.which),p.data("mask-previus-value",p.val()),p.data("mask-previus-caret-pos",C.getCaret()),C.maskDigitPosMapOld=C.maskDigitPosMap}).on(i.jMaskGlobals.useInput?"input.mask":"keyup.mask",C.behaviour).on("paste.mask drop.mask",function(){setTimeout(function(){p.keydown().keyup()},100)}).on("change.mask",function(){p.data("changed",!0)}).on("blur.mask",function(){o===C.val()||p.data("changed")||p.trigger("change"),p.data("changed",!1)}).on("blur.mask",function(){o=C.val()}).on("focus.mask",function(t){!0===w.selectOnFocus&&i(t.target).select()}).on("focusout.mask",function(){w.clearIfNotMatch&&!r.test(C.val())&&C.val("")})},getRegexMask:function(){for(var t,a,e,n,s,r,o=[],i=0;i")},fields:function(e){var n=O();return O.each(e,function(e,t){n=n.add(m.get.field(t))}),n},validation:function(n){var i,o;return!!c&&(O.each(c,function(e,t){o=t.identifier||e,m.get.field(o)[0]==n[0]&&(t.identifier=o,i=t)}),i||!1)},value:function(e){var t=[];return t.push(e),m.get.values.call(v,t)[e]},values:function(e){var t=O.isArray(e)?m.get.fields(e):n,c={};return t.each(function(e,t){var n=O(t),i=(n.prop("type"),n.prop("name")),o=n.val(),a=n.is(f.checkbox),r=n.is(f.radio),s=-1!==i.indexOf("[]"),l=!!a&&n.is(":checked");i&&(s?(i=i.replace("[]",""),c[i]||(c[i]=[]),a?l?c[i].push(o||!0):c[i].push(!1):c[i].push(o)):r?c[i]!==q&&0!=c[i]||(c[i]=!!l&&(o||!0)):c[i]=a?!!l&&(o||!0):o)}),c}},has:{field:function(e){return m.verbose("Checking for existence of a field with identifier",e),"string"!=typeof(e=m.escape.string(e))&&m.error(s.identifier,e),0"}),O(n+="")},prompt:function(e){return O("
").addClass("ui basic red pointing prompt label").html(e[0])}},rules:{empty:function(e){return!(e===q||""===e||O.isArray(e)&&0===e.length)},checked:function(){return 0=t},length:function(e,t){return e!==q&&e.length>=t},exactLength:function(e,t){return e!==q&&e.length==t},maxLength:function(e,t){return e!==q&&e.length<=t},match:function(e,t){var n;return O(this),0=t)},exactCount:function(e,t){return 0==t?""===e:1==t?""!==e&&-1===e.search(","):e.split(",").length==t},maxCount:function(e,t){return 0!=t&&(1==t?-1===e.search(","):e.split(",").length<=t)}}}}(jQuery,window,document),function(k,S,e,T){"use strict";S=void 0!==S&&S.Math==Math?S:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")(),k.fn.accordion=function(a){var v,r=k(this),b=(new Date).getTime(),y=[],x=a,C="string"==typeof x,w=[].slice.call(arguments,1);return S.requestAnimationFrame||S.mozRequestAnimationFrame||S.webkitRequestAnimationFrame||S.msRequestAnimationFrame,r.each(function(){var e,c,u=k.isPlainObject(a)?k.extend(!0,{},k.fn.accordion.settings,a):k.extend({},k.fn.accordion.settings),d=u.className,t=u.namespace,f=u.selector,s=u.error,n="."+t,i="module-"+t,o=r.selector||"",g=k(this),p=g.find(f.title),m=g.find(f.content),l=this,h=g.data(i);c={initialize:function(){c.debug("Initializing",g),c.bind.events(),u.observeChanges&&c.observeChanges(),c.instantiate()},instantiate:function(){h=c,g.data(i,c)},destroy:function(){c.debug("Destroying previous instance",g),g.off(n).removeData(i)},refresh:function(){p=g.find(f.title),m=g.find(f.content)},observeChanges:function(){"MutationObserver"in S&&((e=new MutationObserver(function(e){c.debug("DOM tree modified, updating selector cache"),c.refresh()})).observe(l,{childList:!0,subtree:!0}),c.debug("Setting up mutation observer",e))},bind:{events:function(){c.debug("Binding delegated events"),g.on(u.on+n,f.trigger,c.event.click)}},event:{click:function(){c.toggle.call(this)}},toggle:function(e){var t=e!==T?"number"==typeof e?p.eq(e):k(e).closest(f.title):k(this).closest(f.title),n=t.next(m),i=n.hasClass(d.animating),o=n.hasClass(d.active),a=o&&!i,r=!o&&i;c.debug("Toggling visibility of content",t),a||r?u.collapsible?c.close.call(t):c.debug("Cannot close accordion content collapsing is disabled"):c.open.call(t)},open:function(e){var t=e!==T?"number"==typeof e?p.eq(e):k(e).closest(f.title):k(this).closest(f.title),n=t.next(m),i=n.hasClass(d.animating);n.hasClass(d.active)||i?c.debug("Accordion already open, skipping",n):(c.debug("Opening accordion content",t),u.onOpening.call(n),u.onChanging.call(n),u.exclusive&&c.closeOthers.call(t),t.addClass(d.active),n.stop(!0,!0).addClass(d.animating),u.animateChildren&&(k.fn.transition!==T&&g.transition("is supported")?n.children().transition({animation:"fade in",queue:!1,useFailSafe:!0,debug:u.debug,verbose:u.verbose,duration:u.duration}):n.children().stop(!0,!0).animate({opacity:1},u.duration,c.resetOpacity)),n.slideDown(u.duration,u.easing,function(){n.removeClass(d.animating).addClass(d.active),c.reset.display.call(this),u.onOpen.call(this),u.onChange.call(this)}))},close:function(e){var t=e!==T?"number"==typeof e?p.eq(e):k(e).closest(f.title):k(this).closest(f.title),n=t.next(m),i=n.hasClass(d.animating),o=n.hasClass(d.active);!o&&(o||!i)||o&&i||(c.debug("Closing accordion content",n),u.onClosing.call(n),u.onChanging.call(n),t.removeClass(d.active),n.stop(!0,!0).addClass(d.animating),u.animateChildren&&(k.fn.transition!==T&&g.transition("is supported")?n.children().transition({animation:"fade out",queue:!1,useFailSafe:!0,debug:u.debug,verbose:u.verbose,duration:u.duration}):n.children().stop(!0,!0).animate({opacity:0},u.duration,c.resetOpacity)),n.slideUp(u.duration,u.easing,function(){n.removeClass(d.animating).removeClass(d.active),c.reset.display.call(this),u.onClose.call(this),u.onChange.call(this)}))},closeOthers:function(e){var t,n,i,o=e!==T?p.eq(e):k(this).closest(f.title),a=o.parents(f.content).prev(f.title),r=o.closest(f.accordion),s=f.title+"."+d.active+":visible",l=f.content+"."+d.active+":visible";i=u.closeNested?(t=r.find(s).not(a)).next(m):(t=r.find(s).not(a),n=r.find(l).find(s).not(a),(t=t.not(n)).next(m)),0 adjusting invoked element"),c=c.closest(o.checkbox),s.refresh())}},setup:function(){s.set.initialLoad(),s.is.indeterminate()?(s.debug("Initial value is indeterminate"),s.indeterminate()):s.is.checked()?(s.debug("Initial value is checked"),s.check()):(s.debug("Initial value is unchecked"),s.uncheck()),s.remove.initialLoad()},refresh:function(){u=c.children(o.label),d=c.children(o.input),f=d[0]},hide:{input:function(){s.verbose("Modifying z-index to be unselectable"),d.addClass(t.hidden)}},show:{input:function(){s.verbose("Modifying z-index to be selectable"),d.removeClass(t.hidden)}},observeChanges:function(){"MutationObserver"in A&&((e=new MutationObserver(function(e){s.debug("DOM tree modified, updating selector cache"),s.refresh()})).observe(h,{childList:!0,subtree:!0}),s.debug("Setting up mutation observer",e))},attachEvents:function(e,t){var n=T(e);t=T.isFunction(s[t])?s[t]:s.toggle,0").insertAfter(d),s.debug("Creating label",u))}},has:{label:function(){return 0").html(o).attr("data-"+b.value,t).attr("data-"+b.text,t).addClass(h.addition).addClass(h.item),m.hideAdditions&&i.addClass(h.hidden),n=n===_?i:n.add(i),p.verbose("Creating user choices for value",t,i))}),n)},userLabels:function(e){var t=p.get.userValues();t&&(p.debug("Adding user labels",t),X.each(t,function(e,t){p.verbose("Adding custom user value"),p.add.label(t,t)}))},menu:function(){O=X("
").addClass(h.menu).appendTo(w)},sizer:function(){A=X("").addClass(h.sizer).insertAfter(T)}},search:function(e){e=e!==_?e:p.get.query(),p.verbose("Searching for query",e),p.has.minCharacters(e)?p.filter(e):p.hide()},select:{firstUnfiltered:function(){p.verbose("Selecting first non-filtered element"),p.remove.selectedItem(),F.not(y.unselectable).not(y.addition+y.hidden).eq(0).addClass(h.selected)},nextAvailable:function(e){var t=(e=e.eq(0)).nextAll(y.item).not(y.unselectable).eq(0),n=e.prevAll(y.item).not(y.unselectable).eq(0);0").addClass(h.search).prop("autocomplete","off").insertBefore(S)),p.is.multiple()&&p.is.searchSelection()&&!p.has.sizer()&&p.create.sizer(),m.allowTab&&p.set.tabbable()},select:function(){var e=p.get.selectValues();p.debug("Dropdown initialized on a select",e),w.is("select")&&(R=w),0").attr("class",R.attr("class")).addClass(h.selection).addClass(h.dropdown).html(g.dropdown(e)).insertBefore(R),R.hasClass(h.multiple)&&!1===R.prop("multiple")&&(p.error(f.missingMultiple),R.prop("multiple",!0)),R.is("[multiple]")&&p.set.multiple(),R.prop("disabled")&&(p.debug("Disabling dropdown"),w.addClass(h.disabled)),R.removeAttr("class").detach().prependTo(w)),p.refresh()},menu:function(e){O.html(g.menu(e,l)),F=O.find(y.item)},reference:function(){p.debug("Dropdown behavior was called on select, replacing with closest dropdown"),w=w.parent(y.dropdown),j=w.data(C),I=w.get(0),p.refresh(),p.setup.returnedObject()},returnedObject:function(){var e=M.slice(0,n),t=M.slice(n+1);M=e.add(w).add(t)}},refresh:function(){p.refreshSelectors(),p.refreshData()},refreshItems:function(){F=O.find(y.item)},refreshSelectors:function(){p.verbose("Refreshing selector cache"),S=w.find(y.text),T=w.find(y.search),R=w.find(y.input),P=w.find(y.icon),E=0 modified, recreating menu");var n=!1;X.each(e,function(e,t){if(X(t.target).is("select")||X(t.addedNodes).is("select"))return n=!0}),n&&(p.disconnect.selectObserver(),p.refresh(),p.setup.select(),p.set.selected(),p.observe.select())}},menu:{mutation:function(e){var t=e[0],n=t.addedNodes?X(t.addedNodes[0]):X(!1),i=t.removedNodes?X(t.removedNodes[0]):X(!1),o=n.add(i),a=o.is(y.addition)||0t.name?1:-1}),p.debug("Retrieved and sorted values from select",o)):p.debug("Retrieved values from select",o),o},activeItem:function(){return F.filter("."+h.active)},selectedItem:function(){var e=F.not(y.unselectable).filter("."+h.selected);return 0=m.maxSelections?(p.debug("Maximum selection count reached"),m.useLabels&&(F.addClass(h.filtered),p.add.message(c.maxSelections)),!0):(p.verbose("No longer at maximum selection count"),p.remove.message(),p.remove.filteredItem(),p.is.searchSelection()&&p.filterItems(),!1))}},restore:{defaults:function(){p.clear(),p.restore.defaultText(),p.restore.defaultValue()},defaultText:function(){var e=p.get.defaultText();e===p.get.placeholderText?(p.debug("Restoring default placeholder text",e),p.set.placeholderText(e)):(p.debug("Restoring default text",e),p.set.text(e))},placeholderText:function(){p.set.placeholderText()},defaultValue:function(){var e=p.get.defaultValue();e!==_&&(p.debug("Restoring default value",e),""!==e?(p.set.value(e),p.set.selected()):(p.remove.activeItem(),p.remove.selectedItem()))},labels:function(){m.allowAdditions&&(m.useLabels||(p.error(f.labels),m.useLabels=!0),p.debug("Restoring selected values"),p.create.userLabels()),p.check.maxSelections()},selected:function(){p.restore.values(),p.is.multiple()?(p.debug("Restoring previously selected values and labels"),p.restore.labels()):p.debug("Restoring previously selected values")},values:function(){p.set.initialLoad(),m.apiSettings&&m.saveRemoteData&&p.get.remoteValues()?p.restore.remoteValues():p.set.selected(),p.remove.initialLoad()},remoteValues:function(){var e=p.get.remoteValues();p.debug("Recreating selected from session data",e),e&&(p.is.single()?X.each(e,function(e,t){p.set.text(t)}):X.each(e,function(e,t){p.add.label(e,t)}))}},read:{remoteData:function(e){var t;if(J.Storage!==_)return(t=sessionStorage.getItem(e))!==_&&t;p.error(f.noStorage)}},save:{defaults:function(){p.save.defaultText(),p.save.placeholderText(),p.save.defaultValue()},defaultValue:function(){var e=p.get.value();p.verbose("Saving default value as",e),w.data(b.defaultValue,e)},defaultText:function(){var e=p.get.text();p.verbose("Saving default text as",e),w.data(b.defaultText,e)},placeholderText:function(){var e;!1!==m.placeholder&&S.hasClass(h.placeholder)&&(e=p.get.text(),p.verbose("Saving placeholder text as",e),w.data(b.placeholderText,e))},remoteData:function(e,t){J.Storage!==_?(p.verbose("Saving remote data to session storage",t,e),sessionStorage.setItem(t,e)):p.error(f.noStorage)}},clear:function(){p.is.multiple()&&m.useLabels?p.remove.labels():(p.remove.activeItem(),p.remove.selectedItem()),p.set.placeholderText(),p.clearValue()},clearValue:function(){p.set.value("")},scrollPage:function(e,t){var n,i,o=t||p.get.selectedItem(),a=o.closest(y.menu),r=a.outerHeight(),s=a.scrollTop(),l=F.eq(0).outerHeight(),c=Math.floor(r/l),u=(a.prop("scrollHeight"),"up"==e?s-l*c:s+l*c),d=F.not(y.unselectable);i="up"==e?d.index(o)-c:d.index(o)+c,0<(n=("up"==e?0<=i:i").addClass(h.label).attr("data-"+b.value,a).html(g.label(a,t)),i=m.onLabelCreate.call(i,a,t),p.has.label(e)?p.debug("User selection already exists, skipping",a):(m.label.variation&&i.addClass(m.label.variation),!0===n?(p.debug("Animating in label",i),i.addClass(h.hidden).insertBefore(o).transition(m.label.transition,m.label.duration)):(p.debug("Adding selection label",i),i.insertBefore(o)))},message:function(e){var t=O.children(y.message),n=m.templates.message(p.add.variables(e));0").html(n).addClass(h.message).appendTo(O)},optionValue:function(e){var t=p.escape.value(e);0").prop("value",t).addClass(h.addition).html(e).appendTo(R),p.verbose("Adding user addition as an
");for(var e=0;e'),$("head").append(''),$("#libsLoader").remove(),a.loadAndRunApplication(n,s,r))},!1),i.addEventListener("error",function(e){uiAlert("Ошибка загрузки библиотеки","error",!1,"Ошибка",!1)},!1),document.getElementsByTagName("head")[0].appendChild(i),i.src=l[e]}}}():this.loadAndRunApplication(n,s,r)}else{this.currentId=t.id;var u=null;0<=n.indexOf("(")&&(u=n.substr(n.indexOf("(")+1,n.length-n.indexOf("(")-2)),t.initializeApplication(u)}null!==document.getElementById("menu-ow")&&(document.getElementById("menu-ow").style.display="none"),history.pushState(null,null,"?app="+n)}else console.log("Приложение не найдено")}}},{key:"loadAndRunApplication",value:function(e,t){var i=this,n=2 .menu").html("")}},{key:"updateBarcodes",value:function(){for(var e=document.getElementsByClassName("barcode"),t=0;t
",document.body.appendChild(e))),void 0===t&&(t="timtout");var i=document.createElement("div"),a="",s="",r="",o="",l="",c="",d=[];c="\n \n
Зарегистрироваться
\n ",d="timtout"===t?(data_update(),a=""===(r=void 0===(r=$("#menu-ow-title").attr("menu-user"))?"":r)?"":"readonly",s=""===r?"":"disabled",o="\n
\n \n Вы были не активны некоторое время,
для продолжения работы введите пароль\n
",l="autofocus",c="\n \n \n ","loginForm-ow"):"login-page"===t?(o='\n \n ',"loginForm-ow login-page"):"loginForm-ow",i.className=d;var u="\n ";i.innerHTML=u,"SCRIPT"!==e.firstElementChild.tagName&&null!==e.firstElementChild&&e.removeChild(e.firstElementChild),e.insertBefore(i,e.firstElementChild),$(".loginForm-ow .login-iw").animate({top:"60px"},750);var p=document.querySelector(".unlock-button"),h=document.querySelector(".login-button"),m=document.querySelector(".user-change-button");null!==p&&(p.onclick=function(e){n.sessionUnlock(e,t)}),null!==h&&(p.onclick=function(e){n.sessionUnlock(e,t)}),null!==m&&(m.onclick=function(e){var t=document.querySelector("#login-form input[name='user-name']"),i=document.querySelector("#login-form input[name='user-password']");t.removeAttribute("readonly"),t.removeAttribute("disabled"),t.value="",i.value="",t.focus(),n.SessionApp.userChange=!0}),document.onkeydown=function(e){if(13===e.keyCode&&"Enter"===e.key){var t=document.querySelector("#login-form input[name='user-password']");0\n
\n \n ',t.parentNode.insertBefore(i,t)),null!==appManager.SessionApp.activityTimer&&clearInterval(appManager.SessionApp.activityTimer),i.querySelector(".indicator").classList.add("wait"),i.style.cssText="opacity:1;",appManager.SessionApp.activityTimer=setInterval(function(){var e=1800;"undefined"!=typeof locktime&&0!==locktime&&(e=3*locktime),a=100*n++/e,i.querySelector(".indicator .bar").style.cssText="width:"+a+"%;",50<=a&&(i.querySelector(".indicator").classList.remove("wait"),i.querySelector(".indicator").classList.add("alert")),90<=a&&(i.querySelector(".indicator").classList.remove("alert"),i.querySelector(".indicator").classList.add("warning")),100<=a&&(clearInterval(appManager.SessionApp.activityTimer),clearInterval(appManager.SessionApp.activityCheck),appManager.SessionApp.activityTimer=null,appManager.SessionApp.activityCheck=null,appManager.SessionApp.timeOutRedirect=setTimeout(function(){clearTimeout(appManager.SessionApp.timeOutRedirect),appManager.SessionApp.lock=!0,appManager.sessionLock(),i.parentNode.removeChild(i),Object.keys(window).forEach(function(e){/on/.test(e)&&"ontransitionend"!==e&&"ontransitionrun"!==e&&"ontransitionstart"!==e&&"ontransitioncancel"!==e&&"onwebkittransitionend"!==e&&window.removeEventListener(e.slice(2),s)})},1e3))},1e3))):(appManager.SessionApp.timerRun=!1,clearInterval(appManager.SessionApp.activityTimer),null!==(i=document.getElementById("user_activity"))&&i.parentNode.removeChild(i))},250))}}else appManager.stopSessionAppControlled();function s(){appManager.SessionApp.activityListner=performance.now()}}}]),l}(),appManager=new AppManager,menu=$("#menu-ow-title"),username="";void 0!==menu.attr("menu-user")&&(username="admin"===menu.attr("menu-user")?"Администратор":menu.attr("menu-user")),!0!==document.body.classList.contains("admin-panel")&&!0!==document.body.classList.contains("app-menu")&&!0!==document.body.classList.contains("app")||""!==username&&AppManager.SetSessionAppControlled(!0);var AppHeader=function(){function e(){_classCallCheck(this,e),this.menuIsOpen=!0,this.$headerMenuContainer,this.$headerMenuControls,this.$headerRightMenu,this.$headerMenuApp,this.appMenuItems=[]}return _createClass(e,[{key:"init",value:function(){var t=this,e=navigator.userAgent.toLowerCase(),i="";(e.match(/.+(?:me|ox|on|rv|it|era|opr|ie)[\/: ]([\d.]+)/)||[0,"0"])[1];(/msie/i.test(e)&&!/opera/i.test(e)||/trident\//i.test(e)||/edge/i.test(e))&&(i="\n
\n
\n
Браузер Internet Explorer поддерживается ограниченно, часть приложений могут не работать
\n
\n
\n "),this.$headerMenuContainer=$("#menu-ow-title"),this.$headerMenuContainer.html('\n \n \n '),$(i).insertBefore("#menu-ow-title"),setTimeout(function(){$("#msie_alert").remove()},3e3),this.$headerMenuControls=this.$headerMenuContainer.find(".menu-main"),this.$headerRightMenu=this.$headerMenuContainer.find(".menu-right"),this.$headerMenuApp=this.$headerMenuContainer.find(".menu-app"),this.$categoryContainer=this.$headerMenuContainer.find("#menuOwCategory"),this.$categoryMenuButton=$(""),this.$categoryMenuButton.on("click",function(e){"/apps"===location.pathname&&e.preventDefault(),""!==location.search.substr(1,location.search.length)&&t.toggleCategoryMenu()});var n=$("#menu-ow-title"),a="";void 0!==n.attr("menu-user")&&(a="admin"===n.attr("menu-user")?"Администратор":n.attr("menu-user")),""!==a&&this.$headerMenuControls.append(this.$categoryMenuButton),this.setTitle(),void 0!==this.$headerMenuContainer?("Веб-администратор"!==this.$headerMenuContainer.attr("menu-user-id")&&"00000000-0000-0000-0000-000000000000"!==this.$headerMenuContainer.attr("menu-user-id")||this.addMenuItem("admin","/","Администрирование","home layout"),this.addSearchInput(),this.addProfile(),this.categoryList()):console.log("missing DOM element / отсутствует DOM элемент"),(0<=location.search.indexOf("app=")||"-1"===$("#menu-ow-title").attr("level")&&"apps"!==location.pathname.substr(1,location.pathname.length))&&this.toggleCategoryMenu()}},{key:"categoryList",value:function(){var t=this;if(0<$("#menu-ow").length){var o="",l=[];for(var e in userApps)if(0==userApps[e].hidden){var i=userApps[e].category;l.indexOf(i)<0&&l.push(userApps[e].category)}l.sort();var n=localStorage.getItem("dg.menu.page"),a=l.indexOf(n);a<0&&0\n
'+(""===e?"Базовые приложения":e)+"
\n ";var i=[];for(var n in userApps)0==userApps[n].hidden&&userApps[n].category===l[t]&&i.push(userApps[n]);i.sort(function(e,t){return e=e.title,t=t.title,e.localeCompare(t)});for(var a=0;a",o+="
",Icons.hasOwnProperty("icon"+s.id))/\(\d+\)/.test(s.name)?o+=Icons["icon"+s.id](s.name.match(/\d+/)[0]):o+=Icons["icon"+s.id]();else{var r=s.name;0<=r.indexOf("(")&&(r=r.substr(0,r.indexOf("("))),o+=""+s.title+""}o+="
",o+="",o+="",o+="",o+=""}o+=""}),0===l.length&&(o+=""),this.$categoryContainer.html(o),this.$categoryContainer.find(".menu-item").on("click",function(e){void 0===appManager?window.location.href="/webservice/"+$(e.currentTarget).find(".menu-name").text()+"/get":setTimeout(function(){t.toggleCategoryMenu(),appManager.currentApp=$(e.currentTarget).find(".menu-name").text(),appManager.currentAppTitle=$(e.currentTarget).find(".menu-title").text(),appManager.runApplication($(e.currentTarget).find(".menu-name").text())},0)})}}},{key:"setTitle",value:function(){var e=0 "+e+"")}},{key:"addMenuItem",value:function(e,t,i,n,a,s){if(void 0===t?t="/":void 0===i?i="":void 0===n&&(n="book"),"system"===a)this.$headerRightMenu.append("");else if("event"===a){if("string"==typeof s)this.$headerMenuControls.append("");else if("function"==typeof s){var r=$("");r.on("click",function(e){s(e)}),this.$headerMenuControls.append(r)}}else this.$headerMenuControls.append("");this.appMenuItems.push(e)}},{key:"removeMenuItems",value:function(e){var i=[];if(void 0!==e){var t=!0,n=!1,a=void 0;try{for(var s,r=this.appMenuItems[Symbol.iterator]();!(t=(s=r.next()).done);t=!0){var o=s.value;if("string"==typeof e)o===e&&(this.$headerMenuControls.find("[data-name='"+o+"']").remove(),i.push(o));else{var l=!0,c=!1,d=void 0;try{for(var u,p=e[Symbol.iterator]();!(l=(u=p.next()).done);l=!0){o===u.value&&(this.$headerMenuControls.find("[data-name='"+o+"']").remove(),i.push(o))}}catch(e){c=!0,d=e}finally{try{!l&&p.return&&p.return()}finally{if(c)throw d}}}}}catch(e){n=!0,a=e}finally{try{!t&&r.return&&r.return()}finally{if(n)throw a}}}else{var h=!0,m=!1,v=void 0;try{for(var f,g=this.appMenuItems[Symbol.iterator]();!(h=(f=g.next()).done);h=!0){var y=f.value;"admin"!==y&&(this.$headerMenuControls.find("[data-name='"+y+"']").remove(),i.push(y))}}catch(e){m=!0,v=e}finally{try{!h&&g.return&&g.return()}finally{if(m)throw v}}}this.appMenuItems=this.appMenuItems.filter(function(e,t){return i.indexOf(e)<0})}},{key:"toggleCategoryMenu",value:function(){this.menuIsOpen=!this.menuIsOpen,this.$headerMenuContainer.toggleClass("active",this.menuIsOpen),this.$categoryMenuButton.toggleClass("active",this.menuIsOpen),this.$categoryContainer.toggleClass("collapsed"),$("#app-ow").css({display:this.menuIsOpen?"none":"block"})}},{key:"addSearchInput",value:function(){this.$headerRightMenu.append('\n \n ')}},{key:"addProfile",value:function(){var e="admin"===this.$headerMenuContainer.attr("menu-user")?"Администратор":this.$headerMenuContainer.attr("menu-user"),t='
Настройки
';"admin"===this.$headerMenuContainer.attr("menu-user")&&(t='\n Настройки\n Аудит\n '),""!==e?(this.$headerRightMenu.append('\n \n '),this.$headerRightMenu.find(".profile").dropdown()):this.$headerRightMenu.append('\n \n ')}}]),e}(),appHeader=new AppHeader;function owResize(){document.getElementById("menu-ow")&&($("body").addClass("no-overflow"),$("#menu-ow").css("margin-top",$("#menu-ow-title").height()))}"document"in window.self&&("classList"in document.createElement("_")&&(!document.createElementNS||"classList"in document.createElementNS("http://www.w3.org/2000/svg","g"))||function(e){"use strict";if("Element"in e){var t="classList",i="prototype",n=e.Element[i],a=Object,s=String[i].trim||function(){return this.replace(/^\s+|\s+$/g,"")},r=Array[i].indexOf||function(e){for(var t=0,i=this.length;t'+e.error+""),$(".auth_failed").last().fadeTo("slow",1,function(){setTimeout(function(){$(".auth_failed").first().fadeOut(300,function(){$(this).remove()})},2500)})):"/login"==a.attr("action")?window.location="/":"/webservice/admin/execute"==a.attr("action").substring(0,25)&&(window.location="/")},error:function(e,t,i){var n;a.attr("process","").find(".submit-button").removeClass("loading"),n="login-form"==a.attr("id")?0==e.readyState?"Нет соединения с сервером. Возможно сервис DataGate не запущен.":"Ошибка в процессе авторизации или системная ошибка сервера":e.responseText,a.append('
'+n+"
"),$(".auth_failed").last().fadeTo("slow",1,function(){setTimeout(function(){$(".auth_failed").first().fadeOut(300,function(){$(this).remove()})},2500)})}}))}),owResize()}),$(window).on("resize",function(){owResize()});var entityMap={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function escapeHtml(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return entityMap[e]})}function deleteHtmlTags(e){return String(e).replace(/(\<(\/?[^>]+)>)/g,"")}$(window).resize(owResize);var uiAlert=function(e,t,i,n,a){0==n.length&&("error"==t?n="Ошибка":"warning"==t?n="Предупреждение":"info"==t&&(n="Информация"));var s="";if("error"==t)s="exclamation circle";else if("warning"==t)s="exclamation triangle";else{if("info"!=t)return void console.log("Message class is invalid");s="info circle"}a&&(t+=" animated");var r=document.getElementById("alert-panel");null==r&&((r=document.createElement("div")).id="alert-panel",document.body.appendChild(r));var o=document.createElement("div");o.style.display="none",o.className="alert-box "+t,o.innerHTML="
"+n+"

"+e+"

",o.onclick=function(e){e.target.classList.contains("close")&&$(o).fadeOut(200,function(){c(o)})};var l=r.firstChild;function c(e){e&&e.remove(),r&&0==r.children.length&&r.remove()}null==l?r.appendChild(o):r.insertBefore(o,l),$(o).fadeIn(200),(!1===i||0
"+n+"

"+e+"

",$(a).prepend(r),$(r).fadeIn(200),(!(r.onclick=function(e){e.target.classList.contains("close")&&$(r).fadeOut(200,function(){o(r)})})===i||0":"
  • ",s+="",s+="
    ",s+="",s+=n,s+="
    ",s+="
      ",s+="
    • "}var dgChart=function(){function s(e,t,i,n,a){_classCallCheck(this,s),this.container=e,this.predefinedAxisColors=["red","blue","green","orange","","","","","","","",""],this.seriesData=a,this.xFormat=n,this.topTitle=t,this.bottomTitle=i,this.globalPadding=10,this.axisTitlePadding=4,this.axisPenWidth=2,this.axisTicksWidth=4,this.barFilling=.8,this.barOffset=0,this.delimiterX=1,this.stepAxisX=1,this.scales=[],this.init()}return _createClass(s,[{key:"init",value:function(){""==this.container.id&&(this.container.id="chart"+Date.now()),this.id=this.container.id,this.container.style.overflow="hidden",this.mouse={x:void 0,y:void 0},this.canvas=document.createElement("canvas"),this.canvas.classList.add("chart-body"),this.container.appendChild(this.canvas);var e=!1,t={width:0,height:0},i=this.container.getAttribute("style");if(null!=i){for(var n=i.split(";"),a=0;a",c+="",c+="",c+="",c+="",c+="",c+="",d%this.stepAxisX==0&&(c+=""+f.x+""),c+="",d++}}catch(e){p=!0,h=e}finally{try{!u&&v.return&&v.return()}finally{if(p)throw h}}c+="",c+="",c+=""+t+"",c+=""+(0===Math.floor(t/2)?"":Math.floor(t/2))+"",c+="",c+="",c+="",this.chart=$(c),$(this.container).html(this.chart),$("svg rect").on("mouseover",function(e){$(e.currentTarget).attr("")})}},{key:"addScale",value:function(e,t,i){var n=document.createElementNS("http://www.w3.org/2000/svg","g"),a=document.createElementNS("http://www.w3.org/2000/svg","rect");n.setAttribute("class","scale"),n.setAttribute("data-id",e),a.setAttribute("x",14+(this.stepWidth+this.delimiterX)*i),a.setAttribute("y","-187"),a.setAttribute("width","1"),a.setAttribute("height","187"),a.setAttribute("fill","rgb(68,68,68)"),a.setAttribute("stroke-width","2"),a.setAttribute("stroke","transparent"),a.setAttribute("transform","scale(1, -1)"),n.appendChild(a),document.getElementById("hysto-data").getElementsByTagName("svg")[0].appendChild(n),this.scales.push(n)}},{key:"moveScale",value:function(e,t,i){console.log(this.scales);var n=!0,a=!1,s=void 0;try{for(var r,o=this.scales[Symbol.iterator]();!(n=(r=o.next()).done);n=!0)scale=r.value,scale}catch(e){a=!0,s=e}finally{try{!n&&o.return&&o.return()}finally{if(a)throw s}}}}]),s}(); var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},_createClass=function(){function a(t,e){for(var i=0;i",t+="
      ",t+="
      ",t+="
      ",t+="",t+="
      ",this.params.editable&&!this.params.noAdd&&(t+="
      Добавить
      "),this.params.customized&&(t+="
      "),t+="
      ",t+="
      ",t+="
      ",t+="
      ",this.params.filtered&&(t+="
      "),t+="
      ",t+="",null===this.params.parentElem?$(".tab-container").append(t):$(this.params.parentElem).append(t)}},{key:"initEvents",value:function(){$(window).resize(function(){h.resizeGridDialogs()})}},{key:"grid_fetch",value:function(t,e,i,a){var s=this;void 0===a&&""===a||(this._id=a,this._instance="#gridview"+a),null===this._gridData&&($(this._instance).length<=0&&(this.renderTemplate(),this.resizeColumn(),this.initEvents()),this._gridData=[],this._gridData.suffix=a,this._gridData.columns=[],$(this._instance).attr("data-path",t).attr("current-selection",i),this.state.dataPath=t,this.state.currentSelection=i,$(this._instance).find(".grid-nav .right-buttons .add-grid-button").on("click",function(t){s.state.selectedId="",s.state.selectedName="",s.gridItemEdit("","")}),$(this._instance).find(".grid-nav .right-buttons .save-grid-button").on("click",function(t){s.btnCustomizeGrid(t)}),this.params.scaled&&($(this._instance).find(".grid-container .grid-data").width("100%"),$(this._instance).find(".grid-header").css("padding-right",h.getScrollBarWidth()),$(this._instance).find(".grid-filter").css("padding-right",h.getScrollBarWidth())),$(this._instance).find(".grid-container").scroll(function(t){$(s._instance).find(".grid-header").scrollLeft($(s._instance).find(".grid-container").scrollLeft()),$(s._instance).find(".grid-filter").css("margin-left",-$(s._instance).find(".grid-container").scrollLeft()+"px")}));var n=(this.state.parentId||"").toString();$(this._instance).find(".loader").addClass("active");for(var r="",d="",l=0;l"+t.error),void uiAlert("Не получено описание области отображения"+i,"error",!1,"Системная ошибка")}s.renderDataTables()}}).fail(function(t,e,i){$(s._instance).find(".loader").removeClass("active");var a=t.responseText;"{"==a.substr(0,1)&&(a=JSON.parse(a).text),null===s.params.errorHandler?uiAlert(a,"error",!1,"Ошибка при чтении данных"):s.params.errorHandler(t,e,i,s.params.parentElem)})}},{key:"grid_update",value:function(t){this.grid_fetch(this.state.dataPath,this.state.currentPage,"",t)}},{key:"renderDataHeaders",value:function(){for(var t="",e=0;e",t+=""+this._gridData.headers[e].caption+"",!0===this.params.sorted){void 0===this._gridData.columns[e].sorted&&(this._gridData.columns[e].sorted="");var a="sortnone";"asc"===this._gridData.columns[e].sorted?a="sortasc":"desc"===this._gridData.columns[e].sorted&&(a="sortdesc"),t+="
      "}!0===this.params.resizeable&&(t+="
      "),t+=""}$(this._instance).find(".grid-header .stub").html(t)}},{key:"initDataHeaderEvents",value:function(){var s=this;$(this._instance).find(".grid-header .stub .grid-title-col").mouseenter(function(t){for(var e=t.target;e&&!$(e).hasClass("grid-title-col");)e=e.parentElement;null==s._sizeCol&&$(e).addClass("focused")}).mouseleave(function(t){for(var e=t.target;e&&!$(e).hasClass("grid-title-col");)e=e.parentElement;$(e).removeClass("focused")}),$(this._instance).find(".grid-header .stub .grid-title-col").on("click",function(t){var e=t.target;if(!$(e).hasClass("sizer")){for(;e&&!$(e).hasClass("grid-title-col");)e=e.parentElement;for(var i=$(s._instance).find(".grid-header .stub .grid-title-col").toArray().indexOf(e),a=0;a",d+=c,d+=""}a+="
      ",a+=d+"
      "}$(this._instance).find(".grid-data").html(a),!0===this.params.draggable&&($(this._instance).find(".grid-data").find(".draggable").on("dragstart",function(t){void 0!==e.gridDragStart&&e.gridDragStart(t)}),$(this._instance).find(".grid-data").find(".draggable").on("dragend",function(t){void 0!==e.gridDragEnd&&e.gridDragEnd(t)}))}},{key:"initDataContentEvents",value:function(){var e=this;$(this._instance).find(".grid-container .grid-data .row").on("click",function(t){e.editRow(t)})}},{key:"renderDataTables",value:function(){this.adjustColumns(),this.renderDataHeaders(),this.initDataHeaderEvents(),this.initFilters(),this.initPagination(),this.adjustFontSize(),""===this._id&&"undefined"!=typeof fix_container&&fix_container(),$(this._instance).trigger("onload"),this.renderDataContent(),this.initDataContentEvents(),$(this._instance).find(".loader").removeClass("active")}},{key:"initFilters",value:function(){var s=this;if(!0===this.params.filtered){for(var n="",t=function(a){n+="
      ",r="",null!=s._gridData.columns[a].filter&&s._gridData.columns[a].filter.length&&(r+=" filter-active"),n+=""):(i=s._gridData.columns[a].filter,r="",null==i?i="":r=" filter-active",n+="'>",n+="
      "):n+=" empty-col'> ",n+="
      "},e=0;e",s+="",s+=this.state.totalItems+"",this.state.currentPage<5+e){for(i=0;i<=10&&(s+=""+(i+1)+"",!(i>=this.state.totalPages-1));)i++;10...",s+="")}else if(this.state.currentPage>=this.state.totalPages-(5+e))for((i=this.state.totalPages-10)<0&&(i=0),0",s+="...");i"+(i+1)+"",i++;else{for(s+="",s+="...",i=this.state.currentPage-5;i<=this.state.currentPage+5;)s+=""+(i+1)+"",i++;i...",s+="")}$(this._instance).find(".grid-nav .pagination.menu").html(s),$(this._instance).find(".grid-nav .pagination.menu .nav_item").on("click",function(t){for(var e=t.target;e&&!$(e).hasClass("nav_item");)e=e.parentElement;for(var i=$(e).attr("data-index");e&&!$(e).hasClass("gridview");)e=e.parentElement;$(e).attr("id").substring(8);a.grid_fetch(a.state.dataPath,i,a.state.currentSelection,a._id)})}},{key:"changePath",value:function(t,n){var e=t.indexOf("?");if(e<0)return t+"?action="+n;var r=t.substring(0,e+1),i=t.substring(e+1).split("&"),d=!1;return $.each(i,function(t,e){var i,a,s=e.indexOf("=");a=s<0?(i=e,""):(i=e.substring(0,s),e.substring(s+1)),r+=i+"=","action"==i&&(a=n,d=!0),r+=a,r+="&"}),d||(r+="action="+n+"&"),r}},{key:"gridItemEdit",value:function(e,i){var a=this,t="";this.state.parentId&&(t="&parent="+this.state.parentId);var s=document.createElement("div");s.className="modalshade empty",s.id="pendingFade",document.body.appendChild(s);var n=document.createElement("div");n.className="ui text inverted loader active",n.textContent="Загрузка данных...",s.appendChild(n);var r=this.changePath(this.state.dataPath,this.params.getItemSuffix)+"grid="+this._id+"&id="+e+t;if(null!=this.params.actionPath){var d=(this.changePath(this.state.dataPath,this.params.getItemSuffix)+"id="+e+t).split("/");d.splice(2,1,this.params.actionPath),r=d.join("/")}console.log(r),$.ajax({url:r,dataType:"json",method:"GET"}).done(function(t){document.body.removeChild(s),a.gridItemEditModal(e,i,t)}).fail(function(t,e,i){var a=t.responseText;void 0!==a&&"{"==a.substr(0,1)&&(a=JSON.parse(a).text),void 0===a&&"error"==t.statusText&&(a="Ошибка при получении данных"),document.body.removeChild(s),uiAlert(a,"error",!0,"Ошибка",!1)})}},{key:"gridItemEditModal",value:function(n,e,t){var r=this,i=!(3Добавление "+this.params.editTitle+"":o+="
      Редактирование "+this.params.editTitle+"
      "),o+="
      ",o+="
      ",o+="",o+="",o+="",o+=c;var u=!1;void 0!==t.row_readonly&&0!=t.row_readonly&&(u=!0),o.indexOf("
      "),o+="",o+="
      ")),a.windowContainer.innerHTML=o,this.params.closeEdit&&$(a.windowContainer).append(""),u&&($("#"+s).find(".field").addClass("disabled"),$("#"+l).find(".button-submit").addClass("disabled")),h.fillFormFields(t,s),$("#"+s).find(".dropdown").dropdown(),$("#"+s).find(".checkbox").checkbox(),$("#"+s).find(".tabular.menu .item").tab(),$("#"+s+" .field.calendar").calendar(),$("#"+s).submit(function(t){d.formSubmit(t)}),$("#"+l).find(".button-submit").on("click",function(t){$("#"+s).submit()}),a.closeEvent=function(t){$("#"+l+" .gridview").each(function(t,e,i){e.id}),$("#"+l).remove()},$("#"+l).find(".close-modal").on("click",function(t){t.preventDefault();var e=new ModalBox;null!=e&&e.close()}),$("#"+l).find(".button-delete").on("click",function(){var s=$("#"+l).find("form").attr("grid"),t="";t+="
      Подтвердите удаление объекта
      ",t+="
      Вы действительно хотите удалить
      "+e+"
      ?
      ",t+="
      ",t+="",t+="",t+="
      ";new ModalBox(t,"midsize","deleteDialog"),$("#deleteDialog .content");$("#deleteDialog").find(".button-delete").on("click",function(t){var e="";r.state.parentId&&(e="&parent="+r.state.parentId+"&grid="+s);var i=r.changePath(r.state.dataPath,r.params.deleteSuffix)+"id="+n+e;if(null!=r.params.actionPath){var a=(r.changePath(r.state.dataPath,r.params.deleteSuffix)+"id="+n+e).split("/");a.splice(2,1,r.params.actionPath),i=a.join("/")}$.ajax({type:"POST",url:i,dataType:"json",success:function(t){t.hasOwnProperty("error")?uiAlert("Ошибка: "+t.error,"error",!1,"Ошибка"):(d.grid_update(s),(new ModalBox).drop())},error:function(t,e,i){var a=t.responseText;"{"==a.substr(0,1)&&(a=JSON.parse(a).text),uiAlert("При удалении произошла ошибка: "+a,"error",!1,"Ошибка")}})})}),h.resizeGridDialogs(),$("#"+l+" .actions").trigger("onload"),null!=this.gridFormShowing&&this.gridFormShowing(this)}else a.windowContainer.innerHTML="
      "+t.error+"
      "}}},{key:"formSubmit",value:function(t){var a=this,s=this;t.preventDefault();var n=$(t.currentTarget),e=!0,r={},d=void 0===n.attr("data-json");if(null!=s.gridFromBeforeSubmit){var i=s.gridFromBeforeSubmit(s,s._currentGridObject,r);if(void 0!==i&&!i)return}if(n.find(".form-input").each(function(){}),n.find("input.input-required").each(function(){$(this).hasClass("error")||0==$(this).val().length?(e=!1,$(this).parent().addClass("error")):$(this).parent().removeClass("error")}),e){if(0";for(var l=0;lОч.мелко
      ",s+="
      Мелко
      ",s+="
      Обычно
      ",s+="
      Крупно
      ",s+="",s+="";for(var r=this._gridData.columns,d="",l="",o=0,c=0;c",l+="",l+="",l+=""):(o++,d+="",d+="",d+="",d+=""));s+=l+d,s+="
      "+r[c].caption+"
      "+r[c].caption+"
      ",s+="",s+="",s+="",$("body").append(s),this.gridColsDragEvents();var u=t.pageY,h=$("#grid-col-selector .grid-col-popup-header").outerHeight()+$("#grid-col-selector .grid-col-popup-list").outerHeight()+20;$("#grid-col-selector .grid-col-popup-list").css("overflow-y","scroll"),h<200&&(h=200),h>$(window).height()-t.pageY-20&&(h=$(window).height()-t.pageY-20);var f=t.pageX;f+400>$(window).width()-10&&(f=$(window).width()-410),$("#grid-col-selector").css({height:h,top:u,left:f}),$(".modalshade").on("click",function(t){t.target==t.currentTarget&&(e._gridModified?e.saveGridColumns($(a).attr("data-path"),$(a).attr("grid-name")):$(".modalshade").remove())}),$("#grid-col-selector .grid-col-popup-header .close-modal").on("click",function(t){t.preventDefault(),e._gridModified?e.saveGridColumns($(a).attr("data-path"),$(a).attr("grid-name")):$(".modalshade").remove()}),$(".modalshade").bind("contextmenu",function(t){t.preventDefault(),e._gridModified?e.saveGridColumns($(a).attr("data-path"),$(a).attr("grid-name")):$(".modalshade").remove()}),$("#grid-col-selector .grid-columns tr td .icon.toggle").on("click",function(t){$(t.target).hasClass("on")?$(t.target).removeClass("on").addClass("off"):$(t.target).removeClass("off").addClass("on"),e._gridModified=!0}),$("#grid-col-selector .buttons .button").on("click",function(t){$("#grid-col-selector .buttons .button[textsize='"+t.currentTarget.getAttribute("textsize")+"']").removeClass("basic"),$("#grid-col-selector .buttons .button[textsize!='"+t.currentTarget.getAttribute("textsize")+"']").addClass("basic"),e._gridModified=!0}),$("#grid-col-selector").animate({opacity:1},400)}}},{key:"gridColsDragEvents",value:function(){var e=this;$(".drag-drop").find("tr").on("dragover drop dragstart dragleave",function(t){!1===$(event.currentTarget).attr("draggable")?"dragover"===event.type?e.gridColsDragOver(t):"drop"===event.type&&e.gridColsDragDrop(t):"dragstart"===event.type?e.gridColsDragStart(t):"dragleave"===event.type?e.gridColsDragEnd(t):"dragover"===event.type?e.gridColsDragOver(t):"drop"===event.type&&e.gridColsDragDrop(t)})}},{key:"saveGridColumns",value:function(t,e){var i="";$("#grid-col-selector .grid-columns tr td.collapsing").each(function(t,e){0",$.each(t.data,function(t,e){i+="",i+=""+e.name+"",i+="
      ",i+=""}),i+=""),i+="",i+="",i+="",$("body").append(i);a.pageY;var e=$("#popup-selector .popup-header").outerHeight()+$("#popup-selector .popup-list").outerHeight()+20;$("#popup-selector .popup-list").css("overflow-y","scroll"),e<200&&(e=200),$("#popup-selector").css({height:e,top:a.pageY,left:a.pageX-$("#popup-selector .popup-list").width()}),$(".modalshade").on("click",function(t){t.target===t.currentTarget&&$(".modalshade").remove()}),$("#popup-selector").animate({opacity:1},400),$("#popup-selector").find(".btn-newfilter").on("click",function(){l.newFilter()}),$("#popup-selector").find(".btn-clrfilter").on("click",function(){l.clearFilter(s)}),$("#popup-selector").find(".btn-delete").on("click",function(t){t.stopPropagation();for(var e=t.target;e&&0==e.id.length;)e=e.parentElement;$.ajax({type:"POST",url:d.changePath($(o).attr("data-path"),"rmfilter")+"id="+e.id,dataType:"json",success:function(t){t.hasOwnProperty("error")?uiAlert(t.error,"error",!1,"Ошибка при удалении фильтра"):$(e).remove()},error:function(){uiAlert("При удалении фильтра возникла ошибка","error",!1,"Ошибка")}})}),$("#popup-selector").find("tr").on("click",function(t){for(var e=t.target;e&&0==e.id.length;)e=e.parentElement;var i=$(e).attr("fields-sort").split(","),a=[],s=[];$.each(i,function(t,e){var i=e.split(":");2==i.length&&(a.push(i[0]),s.push(i[1]))});for(var n=0;nДобавление нового фильтра
      ","","newFilterDialog").windowContainer.style.maxWidth="500px ! important";var n=$("#newFilterDialog .content");$("#newFilterDialog").find(".button-append").on("click",function(t){if(n.find("input").val().length<3)uiAlert("Требуется ввести наименование не менее 3 символов","error",!1,"Ошибка");else{for(var e="",i=0;i.content").each(function(t,e){var i;i=e.parentElement.classList.contains("fullsize")||e.parentElement.classList.contains("screen")?$(e).parent().height():$(e).parent().parent().height();var a=$(e).parent().find(".header:visible").outerHeight(),s=$(e).parent().find(".actions:visible").outerHeight();void 0===a&&(a=0),void 0===s&&(s=0);var n=i-a-s;e.parentElement.classList.contains("fullsize")||e.parentElement.classList.contains("screen")?e.style.height=n+"px":e.style.maxHeight=n+"px"})}},{key:"fillFormFields",value:function(t,d){$.each(t,function(t,a){if("id"!=t)if($("#"+d).find("input[name='"+t+"']").length)if("checkbox"===$("#"+d).find("input[name='"+t+"']").attr("type"))1==(a=a.toLowerCase())||"true"==a||"yes"==a||"on"==a?$("#"+d).find("input[name="+t+"]").prop("checked",!0):$("#"+d).find("input[name='"+t+"']").removeAttr("checked");else if("radio"===$("#"+d).find("input[name='"+t+"']").attr("type"))a.hasOwnProperty("selection")&&(a=a.values.value),$("#"+d).find("input[name='"+t+"']:not([value='"+a+"'])").prop("checked",!1),$("#"+d).find("input[name='"+t+"'][value='"+a+"']").prop("checked",!0);else if(0<$("#"+d).find("input[name='"+t+"']").closest(".address").length){var e=JSON.stringify(a);$("#"+d).find("input[name='"+t+"']").val(a.text||"").attr("data-value",'""'==e?"{}":e)}else if($("#"+d).find("input[name='"+t+"']").parent().hasClass("dropdown")&&"object"===(void 0===a?"undefined":_typeof(a))){var i="",s="";a.values&&a.selection&&$.each(a.values,function(t,i){$.each(a.selection,function(t,e){e.id==i&&(a.selection[t].selected=1,s=a.selection[t].id)})}),void 0!==a.selection&&""!==a.selection&&$.each(a.selection,function(t,e){i+="
      "});var n=$("#"+d).find("input[name="+t+"]");n.val(a.values.value),n.parent().find(".default.text").val(s),n.parent().find(".menu").html(i)}else a.hasOwnProperty("selection")&&(a=a.values.value),$("#"+d).find("input[name='"+t+"']").val(a);else if($("#"+d).find("textarea[name="+t+"]").length)$("#"+d).find("textarea[name="+t+"]").text(a);else if($("#"+d).find("select[name="+t+"]").length){a.values&&a.selection&&$.each(a.values,function(t,i){$.each(a.selection,function(t,e){e.id==i&&(a.selection[t].selected=1)})});var r="";void 0!==a.selection&&""!==a.selection&&$.each(a.selection,function(t,e){r+="
      ',a+='';for(var r=0,i=0;i<=4;i++){a+="";for(var o=k.width<880?1:e.length/5-1,l=0;l<=o;l++){var u=new Date(e[r],t,n,0,0,0,0).toISOString(),c="";(new Date).getFullYear()===e[r]&&(c=" active"),a+='",r++}a+=""}return a+="
      ",document.querySelector("#calendar_year").innerHTML=e[0]+" год. -"+e[e.length-1]+" год.",a}(e));var n=document.querySelectorAll("#popup-year-row button[data-case-year]");N(),(n=Array.prototype.slice.call(n,0)).forEach(function(t){t.onclick=function(){var e=new Date(t.getAttribute("data-year-value"));N(!1),Y(e.getFullYear(),e.getMonth(),t.getAttribute("data-year-value")),null!==w&&w.focus()}})}function Y(e,t,n){return document.querySelector("#calendar_year").innerHTML=e,document.querySelector("[data-calendar]").setAttribute("date-value",n),document.querySelector("#popup-month-inner").innerHTML=B(t,n),_()}function _(){var e=document.querySelectorAll("[date-value-choice]");Array.prototype.slice.call(e,0).forEach(function(n){n.onclick=function(e){var t=n.parentNode.parentNode.parentNode.parentNode.getAttribute("date-value");return function(e,t){t=t||0;var n=new Date(V("#calendar-popup"+t).attr("date-value"));n.setDate(parseInt(e.currentTarget.innerHTML,10)),q.getElementsByTagName("input")[0].value=n.toISOString(),q.getElementsByClassName("date-field")[0].value=F(n.getDate())+"."+F(n.getMonth()+1)+"."+n.getFullYear(),V(q.getElementsByTagName("input")[0]).trigger("change"),z(),L("active"),null!==w&&w.blur();V(q).removeClass("error"),e.stopPropagation()}(e,new Date(t).getMonth()),!1}})}function H(e,t,n,a){var r=e.currentTarget.parentElement.getAttribute("date-value"),i="";"next"===t?i=E.mobile||k.width<880?1:a:"prev"===t&&(i=E.mobile||k.width<880?-1:-a);var o=new Date(r).getMonth()+1+i,l=new Date(r).getFullYear();if(E.mobile||k.width<880?o<=0?(l--,o=12):13<=o&&(l++,o=1):o<=0?(l--,o=10):11<=o&&(l++,o=1),l<1901||2080"+C[i]+"";var l,u,c=new Date(t),s=c.getFullYear(),d=(c.getDate(),c.getHours()),p=c.getMinutes(),v=c.getSeconds(),m=c.getMilliseconds(),h=new Date;10<=e&&3===M&&(e=9);for(r=e;r",n+="
      ",n+="
      "+I[r]+"
      ",n+="
      ",n+="",n+="",n+=a,n+="";var y=new Date(f.getFullYear(),f.getMonth(),1),b=(l=r+1,u=f.getFullYear(),new Date(u,l,0).getDate()),w=new Date(y).getDay();0===w?w=6:w-=1;var S=h.getDate();f.getFullYear()===h.getFullYear()&&f.getMonth()===h.getMonth()||(S=999);var x=g.getDate();g.getFullYear()===f.getFullYear()&&g.getMonth()===f.getMonth()||(x=999);for(var D=1-w,k=0;k<6;k++){n+="";for(var A=0;A<7;A++)D<=0||b ":f.getMonth()===h.getMonth()||f.getMonth()==f.getMonth()?n+=x===S?"":"":n+="",D++;n+=""}n+="
      "+D+""+D+""+D+"
      ",n+=""}return n}function P(e){void 0===e&&(e=new Date);var t="";for(var n in t+="
      ",r){var a=null;"hh"===n?a=e.getHours():"mm"===n&&(a=e.getMinutes()),t+="
      ",t+="
      ",t+="
      "+(a<10?"0"+a:a)+"
      ",t+="
      ",t+="
      "+("hh"===n?" : ":"")}return t+="
      "}function K(){V("[data-select-time]").each(function(e,t){V(t).on("wheel DOMMouseScroll",function(e){e.originalEvent.preventDefault(),e.originalEvent.stopPropagation(),0",d+=E.mobile?"":"",d+="
      ",d+="
      ",d+="
      "+s.getFullYear()+"
      ",d+="
      ",d+="",d+="
      ",d+="
      ",d+="
      ",d+="
      ",d+="
      Сегодня "+F((new Date).getDate())+" "+T[(new Date).getMonth()]+" "+(new Date).getFullYear()+" г.
      ",d+="
      ",d+="
      ",!0===m.showToday&&(d+=""),!0===m.showClear&&(d+=""),d+="
      ",d+="
      ",d+="
      ",d+=""),x=document.querySelector("[datapicker]"),f=x.getBoundingClientRect(),w.focus(),g=k.width-f.width,f.right>k.width&&h.left>k.width-h.right&&(x.style.cssText="right: "+(k.width-h.right)+"px; top: "+h.bottom+"px;"),E.mobile&&(k.width<640||k.height<480)&&(x.style.cssText="right: 0;top: 0;left: 0;bottom: 0;position: fixed;z-index: 555;",x.classList.add("ui_mobile")),0==(g>h.left||g>k.width-h.right)&&(x.style.cssText="right: "+(k.width-h.right-g)+"px; top: "+h.bottom+"px;"),f.bottom>k.height&&(x.style.cssText+="top: "+(h.top-f.height-10)+"px;"),document.querySelector("[data-history]").addEventListener("wheel",function(e){e.preventDefault(),(new Date).getMonth(),0",c+="
      ",c+="
      Время
      ",c+="
      ",c+="
      ",c+=P(u),c+="
      ",c+="
      ",c+="
      Выбрать
      ",c+="
      Отмена
      ",c+="
      ",c+=""),S.focus(),o=document.querySelector("[data-time-submit]"),l=document.querySelector("[data-time-cancel]"),o.onclick=function(e){y=new Date(document.querySelector("[data-time-value]").getAttribute("data-time-value"));var t=document.querySelector("[data-hh]").getAttribute("value"),n=document.querySelector("[data-mm]").getAttribute("value"),a=new Date(y.getFullYear(),y.getMonth(),y.getDate(),t,n,0,0);b.value=a.toISOString(),S.value=a.toLocaleTimeString(),null!==w&&(w.value=a.toLocaleDateString()),L("active"),V(".calendar-shade").remove(),e.stopPropagation()},l.onclick=function(){b.value="",S.value="",null!==w&&(w.value=""),document.querySelector("[data-time-switch]").innerHTML=P(),document.querySelector("[data-time-switch]").setAttribute("data-time-value",(new Date).toISOString()),R(),K()},R(),K()),document.querySelector(".calendar-shade").onclick=function(e){e.stopPropagation()},document.addEventListener("click",z),window.onresize=function(){z()},window.onkeydown=function(e){27===e.keyCode&&"Escape"===e.key&&z()},window.onblur=function(e){z()},window.addEventListener("wheel",z),null!==(D=document.querySelector("[data-calendar-close]"))&&(D.onclick=function(){z()})}else z()}function U(e){var t=e.querySelectorAll("input")[1];V(e).hasClass("error")&&(t.value=dateFormat(e.querySelectorAll("input")[0].value),V(e).removeClass("error"))}return MaskedInput=function(t){function e(e){return t.apply(this,arguments)}return e.toString=function(){return t.toString()},e}(function(e){if(!e||!e.elm||!e.format)return null;if(!(this instanceof MaskedInput))return new MaskedInput(e);var r=this,i=e.elm,o=e.format,l=e.allowed||"0123456789",u=e.allowedfx||function(){return!0},c=e.separator||"/:-.",s=e.typeon||"_YMDhmsГМДгмдчмс",d=e.onbadkey||function(){},n=e.onfilled||function(){},p=e.onComplit||function(){},a=e.badkeywait||0,t=!e.hasOwnProperty("preserve")||!!e.preserve,v=!0,m=!1,h=o,f=window.addEventListener?function(e,t,n,a){e.addEventListener(t,n,void 0!==a&&a)}:window.attachEvent?function(e,t,n){e.attachEvent("on"+t,n)}:function(e,t,n){e["on"+t]=n},g=function(){for(var e=i.value.length-1;0<=e;e--)for(var t=0,n=s.length;to.length)return!1;for(;-1!==c.indexOf(n.charAt(t-1))&&t<=o.length;)t+=1;if(!u(r,e,t))return d(e),!1;a=n.substr(0,t-1)+e+n.substr(t),-1===l.indexOf(n.charAt(t))&&-1===s.indexOf(n.charAt(t))&&(t+=1);break;case"bksp"===e:if((t-=1)<0)return!1;for(;-1===l.indexOf(n.charAt(t))&&-1===s.indexOf(n.charAt(t))&&1=n.length)return!1;for(;-1!==c.indexOf(n.charAt(t))&&""!==n.charAt(t);)t+=1;a=n.substr(0,t)+o.substr(t,1)+n.substr(t+1),t+=1;break;case"etc"===e:return!0;default:return!1}return i.value="",i.value=a,b(i,t),p(r),!1},D=function(e){if(!v)return!0;if(e=e||event,m)return S(e),!1;var t=w(e);return!!("etc"===t||e.metaKey||e.ctrlKey||e.altKey)||"bksp"!==t&&"del"!==t&&"shift"!==t&&(function(e){if(-1!==l.indexOf(e)||"bksp"===e||"del"===e||"etc"===e)return!0;var t=y(i);return m=!0,d(e),setTimeout(function(){m=!1,b(i,t)},a),!1}(t)?x(t)?(g()&&n(r,y(i)),S(e,!0),!0):(g()&&n(r,y(i)),S(e),!1):(S(e),!1))};return r.resetField=function(){i.value=o},r.setAllowed=function(e){l=e,r.resetField()},r.setCursorPos=function(e){b(i,e)},r.setFormat=function(e){o=e,r.resetField()},r.setSeparator=function(e){c=e,r.resetField()},r.setTypeon=function(e){s=e,r.resetField()},r.setEnabled=function(e){v=e},!i.tagName||"INPUT"!==i.tagName.toUpperCase()&&"TEXTAREA"!==i.tagName.toUpperCase()?null:(r.elm=i,t&&""!==i.value||(i.value=o),f(i,"keydown",function(e){!function(e){if(v){if(e=e||event,m)return S(e);var t=w(e);!e.metaKey&&!e.ctrlKey||"X"!==t&&"V"!==t?e.metaKey||e.ctrlKey||(""===i.value&&(i.value=o,b(i,0)),"bksp"!==t&&"del"!==t||(x(t),S(e))):S(e)}}(e)}),f(i,"keypress",function(e){D(e)}),f(i,"focus",function(){h=i.value}),f(i,"blur",function(){i.value!==h&&i.onchange&&i.onchange()}),r)}),this.each(function(e,a){var t=a.getElementsByTagName("input");if(!(0===t.length||1",r+="",r+="",r+=""}if(a.classList.contains("time")&&(r+="
      ",r+="",r+="",r+="
      "),a.innerHTML+=r,a.classList.contains("date")&&(""!==n&&(a.getElementsByClassName("date-field")[0].value=dateFormat(n)),m.manualInput&&MaskedInput({elm:a.getElementsByClassName("date-field")[0],format:"дд.мм.гггг",onComplit:function(e){0input").prop("readonly")||(m.manualInput?null!==e.target.closest("i.calendar")&&u(e,t):u(e,t),e.stopPropagation())}})}})})}(jQuery); var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};!0===document.body.classList.contains("admin-panel")&&$(document).ready(function(){data_update(),setInterval(data_update,1e4)});var updating=0;function request_failed(){$("#admin-ow-left").html("").addClass("failed"),$("#admin-ow-right").html("").addClass("failed")}function data_update(){updating||(updating=1,$(".task-animation").remove(),$.ajax({method:"GET",url:"/webservice/admin/execute",dataType:"json"}).done(function(e){var t;(updating=0,e&&e.hasOwnProperty("interfaces"))?($(".menu-version").html(e.version),document.getElementById("admin-title-left")||(t="
      Интерфейсы
      ",t+="
      ",t+="
      ",$("#admin-ow-left").removeClass("failed").html(t),$("#admin-ow-left div button").on("click",btnEditLeft)),document.getElementById("admin-title-right")||(t="
      Базы данных
      ",t+="
      ",t+="
      ",$("#admin-ow-right").removeClass("failed").html(t),$("#admin-ow-right div button").on("click",btnEditRight)),$("#admin-ow-left .data-node").addClass("unhandled"),$.each(e.interfaces,function(e,i){if("object"==(void 0===i?"undefined":_typeof(i))){var t=document.getElementById("iface-"+i.id);t?$(t).removeClass("unhandled"):(t="
      ",t+="
      ",t+="
      ",t+="
      ",t+="
      ",t+="
      ",t+="",t+="
      ",$("#admin-ow-left").append(t),$("#iface-"+i.id).on("click",btnEditLeft)),$("#iface-"+i.id+" .node-title").text(i.name),$("#iface-"+i.id+" .node-type").text(i.type),$("#iface-"+i.id+" .node-parameters").text(i.parameters),$("#iface-"+i.id+" .node-status").text(i.status),$("#iface-"+i.id+" .node-lastaction").text(i.lastaction),i.progress.length?($("#iface-"+i.id+" .node-progress div").css("width",i.progress+"%"),$("#iface-"+i.id+" .node-progress").css("display","block")):$("#iface-"+i.id+" .node-progress").css("display","none"),parseInt(i.enabled,10)?$("#iface-"+i.id).removeClass("disabled"):$("#iface-"+i.id).addClass("disabled")}}),$("#admin-ow-left .data-node.unhandled").remove(),$("#admin-ow-right .data-node").addClass("unhandled"),$.each(e.databases,function(e,d){if("object"==(void 0===d?"undefined":_typeof(d))){var i=document.getElementById("db-"+d.id);i?$(i).removeClass("unhandled"):(i="
      ",i+="",i+="
      ",i+="
      ",i+="
      ",i+="
      ",i+="
      ",$("#admin-ow-right").append(i),$("#db-"+d.id+" button").on("click",btnEditRight),t="
      Задачи
      ",t+="",t+="
      ",$("#db-"+d.id+" .container").append(t),$("#db-"+d.id+" .container div button").on("click",btnEditTask)),$("#db-"+d.id+" .node-title").text(d.name),$("#db-"+d.id+" .node-path").text(d.path),$("#db-"+d.id+" .node-status").text(d.status),parseInt(d.enabled,10)?$("#db-"+d.id).removeClass("disabled"):$("#db-"+d.id).addClass("disabled"),$("#db-"+d.id+" .container .data-node").addClass("unhandled"),$.each(d.tasks,function(e,i){if("object"==(void 0===i?"undefined":_typeof(i))){var t="task_"+d.id+"_"+i.id,a=document.getElementById(t);a?$(a).removeClass("unhandled"):(a="
      ",a+="
      ",a+="
      ",a+="
      ",a+="
      ",a+="
      ",a+="
      ",a+="
      ",a+="
      ",a+="",a+="
      ",$("#db-"+d.id+" .container").append(a),$("#"+t).on("click",btnEditTask)),$("#"+t+" .node-title").text(i.name),$("#"+t+" .node-interface").text(i.interface),$("#"+t+" .node-service").text(i.service),$("#"+t+" .node-status").text(i.status),$("#"+t+" .node-lastaction").text(i.lastaction),$("#"+t+" .node-filename").text(i.filename),$("#"+t+" .node-crontab").text(i.crontab),$("#"+t+" .node-private").text(i.private),i.progress.length?($("#"+t+" .node-progress div").css("width",i.progress+"%"),$("#"+t+" .node-progress").css("display","block")):$("#"+t+" .node-progress").css("display","none"),parseInt(i.enabled,10)?$("#"+t).removeClass("disabled"):$("#"+t).addClass("disabled")}}),$("#db-"+d.id+" .container .data-node.unhandled").remove()}}),$("#admin-ow-right .data-node.unhandled").remove(),$(".row-db .container").each(function(e,i){var t=$(i).find(".row-task").length;if(!(0==t||1Изменение настроек интерфейса
      ":"
      Добавление нового интерфейса
      ",n+="
      ",n+="",n+="",i&&(n+=""),n+="
      ",n+="",n+="
      ",n+="
      ",n+="",i&&(t=$(i).find(".node-title").text()),n+="",n+="
      ",n+="
      ",n+="",t=$(i).find(".node-type").text(),i?n+="":(n+=""),n+="
      ",n+="
      ",n+="",t="",i&&(t=$(i).find(".node-parameters").text()),n+="",n+="
      ",n+="
      ",t="",i&&($(i).hasClass("disabled")||(t="checked")),n+="",n+="",n+="
      ",n+="
      ",n+="
      ",i&&(n+=""),n+=i?"":"",n+="",n+="
      ";new ModalBox(n,"ui modal","addDialog");$("#addDialog .ui.dropdown").dropdown(),$("#addDialog div form").submit(formSubmit),$("#addDialog div button.blue").on("click",function(){$(".form").submit()}),$("#addDialog div button.red").on("click",btnDelete)}function btnEditRight(e){for(var i=e.target;i&&!i.hasAttribute("id");)i=i.parentElement;var t,a="";i&&i.hasAttribute("id")&&"admin-title-right"!=i.id?a=i.id:i=null;var d="";d+=i?"
      Изменение настроек соединения с БД
      ":"
      Добавление нового соединения с БД
      ",d+="
      ",d+="",d+="",i&&(d+=""),d+="
      ",d+="",d+="
      ",d+="
      ",d+="",d+="",d+="
      ",d+="
      ",d+="",d+="",d+="
      ",i&&(d+="
      Имя пользователя и пароль необходимо вводить каждый раз при редактировании настроек
      "),d+="
      ",d+="
      ",d+="",d+="",d+="
      ",d+="
      ",d+="",d+="",d+="
      ",d+="
      ",d+="
      ",t="",i&&($(i).hasClass("disabled")||(t="checked")),d+="",d+="",d+="
      ",d+="
      ",d+="
      ",i&&(d+=""),d+=i?"":"",d+="",d+="
      ";new ModalBox(d,"ui modal","addDialog");$("#addDialog div form").submit(formSubmit),$("#addDialog div button.blue").on("click",function(){$(".form").submit()}),$("#addDialog div button.red").on("click",btnDelete)}function btnEditTask(e){for(var l=e.target;l&&!l.hasAttribute("id");)l=l.parentElement;var o="";l&&l.hasAttribute("id")&&"admin-title-task"!=l.id?o=l.id:l=null;for(var c=e.target;c&&(!c.hasAttribute("id")||"admin-title-task"==c.id||$(c).hasClass("row-task"));)c=c.parentElement;$.ajax({type:"GET",url:"/webservice/admin/execute?action=webservice-list",dataType:"json",success:function(e){var t,a,d,n,i=o.substring(5);i=i.substring(i.indexOf("_")+1);var s="";s+=l?"
      Изменение задачи
      ":"
      Добавление новой задачи
      ",s+="
      ",s+="
      База данных: "+$(c).find(".node-title").first().text()+"
      ",s+="",s+="",s+="",l&&(s+=""),s+="
      ",s+="
      ",s+="",t="",l&&(t=$(l).find(".node-title").text()),s+="",s+="
      ",s+="
      ",s+="",t="",l&&(t=$(l).find(".node-filename").text()),s+="",s+="
      ",s+="
      ",s+="
      ",s+="
      ",s+="",t="",l&&(t=$(l).find(".node-crontab").text()),s+="
      ",s+="",s+="",s+="
      ",s+="
      ",s+="
      ",a=$(l).find(".node-service").text(),n=d="",s+="",s+="",s+="
      ",s+="
      ",s+="
      ",s+="
      ",s+="",s+="",s+="
      ",s+="
      ",s+="
      ",t="",l&&($(l).hasClass("disabled")||(t="checked")),s+="",s+="",s+="
      ",l&&(s+="
      ",s+="",s+="
      ",s+="
      Очистить очередь
      ",s+="
      Сбросить метку времени
      ",s+="
      Выгрузить сейчас
      ",s+="
      ",s+="
      "),s+="
      ",s+="
      ",l&&(s+=""),s+=l?"":"",s+="",s+="
      ";new ModalBox(s,"midsize","addDialog");$("#addDialog .dropdown").dropdown(),"1"===$(l).find(".node-private").text()&&($("#addDialog >.header").append(" "),$("#addDialog .red.button").addClass("disabled"),$("#addDialog input[name='name']").closest(".field").addClass("disabled"),$("#addDialog input[name='timing']").closest(".field").addClass("disabled"),$("#addDialog input[name='filename']").closest(".field").addClass("disabled"),$("#addDialog input[name='tasktype']").closest(".field").addClass("disabled")),$("#addDialog .timing-input .menu .item").on("click",function(e){var i=e.currentTarget.getAttribute("t-data");$(e.currentTarget).parent().parent().parent().find("input").val(i)}),$("#addDialog div form").submit(formSubmit),$("#addDialog div button.blue").on("click",function(){$(".form").submit()}),$("#addDialog div button.red").on("click",btnDelete),$("#cron-field .button").on("click",function(e){$("#addDialog input[name='timing']").val(e.currentTarget.getAttribute("t-data"))})},error:function(){uiAlert("Произошла ошибка при загрузке настроечных данных...","error",!1,"Ошибка")}})}function btnTaskClear(e){for(var i=$(e);!i.hasClass("form");)i=i.parent();$.ajax({type:"POST",url:"/webservice/admin/execute?action=task-clear&id="+i.find("input[name=id]").val(),dataType:"json",success:function(e){1==e.status?(new ModalBox).close():uiAlert("Ошибка: "+e.error,"error",!1,"Ошибка")},error:function(){uiAlert("При выполнении операции произошла ошибка...","error",!1,"Ошибка")}})}function btnTaskReset(e){for(var i=$(e);!i.hasClass("form");)i=i.parent();$.ajax({type:"POST",url:"/webservice/admin/execute?action=task-reset&id="+i.find("input[name=id]").val(),dataType:"json",success:function(e){1==e.status?(new ModalBox).close():uiAlert("Ошибка: "+e.error,"error",!1,"Ошибка")},error:function(){uiAlert("При выполнении операции произошла ошибка...","error",!1,"Ошибка")}})}function btnTaskExecute(e){for(var i=$(e);!i.hasClass("form");)i=i.parent();$.ajax({type:"POST",url:"/webservice/admin/execute?action=task-execute&id="+i.find("input[name=id]").val(),dataType:"json",success:function(e){1==e.status?(new ModalBox).close():uiAlert("Ошибка: "+e.error,"error",!1,"Ошибка")},error:function(){uiAlert("При выполнении операции произошла ошибка...","error",!1,"Ошибка")}})}function formSubmit(e){e.preventDefault;var i,t=$(this),a=!0;if(t.find(".input-required").removeClass("error"),t.find(".input-required").parent().removeClass("error"),t.find(".input-required").each(function(e,i){var t="";"DIV"==i.nodeName?0<$(i).find("input").length?t=$(i).find("input").val():0<$(i).find("select").length?t=$(i).find("select").val():0<$(i).find("textarea").length&&(t=$(i).find("textarea").val()):t=$(i).val(),($(i).hasClass("error")||0==t.length||"*"==t)&&("DIV"==i.nodeName?$(i).addClass("error"):$(i).parent().addClass("error"),a=!1)}),a){if(t.parent().parent().find(".actions .button.blue.loading").length)return;t.parent().parent().find(".actions .button.blue").addClass("loading"),i=$(this).serializeArray();for(var d=0;dИзменения сохранены. Через 3 секунды данные обновятся и окно автоматически закроется..."),setTimeout(function(){(new ModalBox).close(),data_update()},2500))},error:function(){t.parent().parent().find(".actions .button.blue").removeClass("loading"),uiAlert("При отправке данных произошла ошибка...","error",!1,"Ошибка")}})}else uiAlert("Не все обязательные поля заполнены...","error",!1,"Ошибка");return!1}function btnDelete(e){for(var i=e.target;i&&!$(i).hasClass("modalbox");)i=i.parentElement;i=$(i).find(".form").toArray()[0];var t=$(i).attr("action"),a=$(i).find("input[name=name]").val(),d=$(i).find("input[name=id]").val(),n=$(i).find("input[name=action]").val(),s=n.indexOf("-");n="delete"+n.substring(s);var l="";l+="
      Подтвердите удаление объекта
      ",l+="
      ",l+="
      Вы действительно хотите удалить
      "+a+"
      ?
      ",l+="
      ",l+="
      ",l+="",l+="",l+="
      ",l+="";new ModalBox(l,"midsize","deleteDialog");$form=$("#deleteDialog .content"),$("#deleteDialog").find(".button-delete").on("click",function(e){$.ajax({type:"POST",url:t,dataType:"json",data:{action:n,id:d},success:function(e){e.hasOwnProperty("error")?($form.append("
      Ошибка: "+e.error+"
      "),$form.find(".message.red").last().fadeTo("slow",1,function(){setTimeout(function(){$form.find(".message.red").first().fadeOut(300,function(){$(this).remove()})},2500)})):($form.parent().html("
      Запрос на удаление объекта отправлен. Через 3 секунды окно автоматически закроется, но удаленный объект может еще какое-то время отображаться...
      "),setTimeout(function(){location.reload()},2500))},error:function(){$form.append("
      При удалении произошла ошибка...
      "),$form.find(".message.red").last().fadeTo("slow",1,function(){setTimeout(function(){$form.find(".message.red").first().fadeOut(300,function(){$(this).remove()})},2500)})}})})}function rowMouse(e,i){$(e).toggleClass("hovered",i)}function showCrontabHint(e){var n=e.currentTarget.parentElement.nextSibling;new ModalBox("
      Описание формата crontab

      Расписание задачи в формате crontab задается в виде списка из пяти элементов, разделенных пробелами, следующего вида:

      minute hour day month weekday

      Каждый элемент определяет условие по времени. Задача выполняется при одновременном выполнении всех пяти условий.

      Элемент minute определяет минуты, hour - часы, day - день (число) месяца, month - месяц, weekday - день недели.

      Каждый из элементов может иметь значения: * (означает постоянное срабатывание), конкретное значение (срабатывание в конкретную минуту, час, день, месяц, день недели), список значений через запятую, */период (срабатывание с заданной периодичностью) или от-до/период (срабатывание с заданной перидичностью в указанном диапазоне значений 'от' и 'до').

      Для элемента minute допускается особое значение +, ускоряющее срабатывание задачи до 15 секунд вместо стандартного 1-минутного шага.

      Для задания значений всех элементов могут использоваться числа (0..59 для минут, 0..23 для часов, 1..31 для дней, 1..12 для месяцев, 1..7 для дней недели, где 1 - понедельник, 7 - воскресенье).Дни недели также могут нумероваться 2-буквенными аббревиатурами (пн, вт, ср, ...) или полными русскими наименованиями. Месяцы также можно обозначать полными русскими наименованиями или 3-буквенными аббревиатурами.

      Примеры обозначений:
      + * * * * - каждые 15 секунд
      * * * * * - каждую минуту
      0 3 * * * - каждый день в 3 часа ночи
      0 3 1 * * - каждое первое число месяца в 3 часа ночи
      0 3 * * 2 - каждый вторник в 3 часа ночи
      0 */3 * * * - каждые 3 часа
      0 7-18/2 * * * - каждые 2 часа в период с 7 до 18 часов
      0 3 1 янв * - в 3 часов ночи 1 января
      Версия Datagate начиная с 1.18.3.22 поддерживает расширенный формат написания следуюших видов:
      ПОСТОЯННО
      - каждые 15 секунд
      КАЖДЫЕ
      n
      МИНУТ
      - с указанной периодичностью в минутах (1...30)
      КАЖДЫЕ
      n
      ЧАСОВ
      - с указанной периодичностью в часах (1...12)
      КАЖДЫЕ
      n
      ДНЕЙ
      - с указанной периодичностью в сутках (1...15)
      КАЖДЫЕ
      n
      МЕСЯЦЕВ
      - с указанной периодичностью в месяцах (1...6)
      В указанных расширенных шаблонах, можно опустить параметр n, что будет подразумевать n=1, например:
      КАЖДЫЙ ЧАС
      - будет выполняться каждый час
      КАЖДЫЙ ДЕНЬ
      - будет выполняться каждый день (сутки)
      ","fullsize","hintDialog");$("#hintDialog .clickable").on("click",function(e){var i=e.currentTarget.innerHTML,t=!1;if(0<=i.indexOf("");i=i.substring(0,a)+"n"+i.substring(d+5),t=!0}n.value=i,(new ModalBox).close(),t&&uiAlert("Не забудьте задать периодичность, которая вам необходима, вместо символа 'n'","warning",5e3,"Напоминание",!0)})} "use strict";var _createClass=function(){function o(e,t){for(var n=0;n",""!==this.content&&void 0!==this.content&&(this.windowContainer.innerHTML=this.content),this.shadeElement.appendChild(this.windowContainer),this.open()}},{key:"open",value:function(){var t=this;$(this.windowContainer).show(),$(window).trigger("resize"),$(document).off("keydown.ModalBox").on("keydown.ModalBox",function(e){27===e.which&&t.escapeClose&&"BODY"===e.target.tagName&&t.close()}),this.shadeElement.click=function(){t.clickClose&&t.close()}}},{key:"close",value:function(e){var n=this;if(!0!==appManager.SessionApp.lock){var t=function(e){var t=modalsList[modalsList.length-1];return null!==t.closeEvent&&t.closeEvent(),$(t.windowContainer).remove(),$(t.shadeElement).remove(),modalsList.pop(),0"+o+""),logLines++});1e3",r+="
      ",r+="
      ",r+="
      ",r+="",r+="",r+="
      ";var o=new ModalBox(r,"fullsize","commonImportDialog");o.windowContainer.setAttribute("data-path",e),o.windowContainer.setAttribute("filename",a.filename),o.windowContainer.setAttribute("rowcount",a.rowcount),r="
      Укажите, какие данные располагаются в каком столбце таблицы
      ",r+="",r+="",v.currentColDefs=n,v.valueMatch=[];var l=0,c=0;$.each(a.columns,function(t,e){0==c&&(c=e.rows.length);var o=e.rows[0].text;v.valueMatch[l]=-1;var a=0;$.each(n,function(t,e){v.importKeyMatch(e,o)&&(v.valueMatch[l]=a),a++}),r+="",l++}),r+="";for(var s=0;s";var u=0;$.each(a.columns,function(t,e){r+="",u++}),r+=""}r+="
      ",r+="",r+="
      ";var d=$("#commonImportDialog .content").append(r);d.find("td").mouseenter(function(t){$(t.target).addClass("focused")}).mouseleave(function(t){$(t.target).removeClass("focused")}),$("#commonImportDialog").find("select.dropdown").dropdown().on("change",function(t){var a,o,n=$(t.target).attr("data-index"),i=$(t.target).val();if("*"==i)v.valueMatch[n]=-1,o=a=!1;else{var r=0;$(t.target).find("option").each(function(t,e){$(e).attr("value")==i&&(v.valueMatch[n]=r-1),r++}),o=!1;for(r=r=0;r
      Выполняется загрузка данных
      "),$.ajax({url:$("#commonImportDialog").attr("data-path"),dataType:"json",method:"POST",data:{filename:$("#commonImportDialog").attr("filename"),columns:o}}).done(function(t){(new ModalBox).close(!0),v.showImportResults(i,t)}).fail(function(t,e,a){$("#commonImportDialog").find(".button-action").removeClass("loading").removeClass("disabled"),$("#commonImportDialog .content .dimmer").remove(),$("#commonImportDialog").find(".import-data").show(),uiAlert(t.responseText,"error",!0,"Ошибка при импорте")})}else uiAlert("Не задано местоположение ключевого столбца","error",!1,"Ошибка параметрирования")}})}},{key:"importKeyMatch",value:function(t,a){t=t.toUpperCase(),a=a.toUpperCase();var o,e=[];if(0<=t.indexOf("|")){var n=t.substring(t.indexOf("|")+1);t=t.substring(0,t.indexOf("|")),e=n.split(","),$.each(e,function(t,e){o|=0<=a.indexOf(e)})}return t==a||o}},{key:"showImportResults",value:function(t,e,a){var o="";void 0===a&&(a="Результаты импорта"),o+="
      "+a+"
      ",o+="
      ",void 0!==e.error&&(o+="
      "+e.error+"
      "),$.each(e.result,function(t,e){o+="
      "+e+"
      "}),o+="
      ",o+="
      ",o+="",o+="
      ",o+="";new ModalBox(o,"fullsize","commonResultsDialog");var n=$("#commonResultsDialog .content"),i=$(window).height()-$("#commonResultsDialog .header").outerHeight()-$("#commonResultsDialog .actions").outerHeight()-120;n.height(i)}}]),v}(); var _createClass=function(){function e(c,t){for(var h=0;h"}},{key:"iconUser",value:function(){return""}},{key:"iconTools",value:function(){return""}},{key:"iconPieChart",value:function(){return""}},{key:"iconChalkboardTeacher",value:function(){return""}},{key:"iconEdit",value:function(){return""}},{key:"iconArchive",value:function(){return""}},{key:"iconRuble",value:function(){return""}},{key:"iconOrganisationCard",value:function(){return""}},{key:"iconRoom",value:function(){return""}},{key:"iconMonitoring",value:function(){return""}},{key:"iconUserPlus",value:function(){return""}},{key:"iconArmchair",value:function(){return""}},{key:"iconBox",value:function(){return""}},{key:"iconLayers",value:function(){return""}},{key:"iconExpert",value:function(){return""}},{key:"iconTeacher",value:function(){return""}},{key:"iconStudents",value:function(){return"\n \n \n \n \n \n \n \n \n \n \n \n \n "}},{key:"iconCloudDB",value:function(){return"\n \n \n \n \n "}},{key:"iconUniversity",value:function(){return""}},{key:"iconEye",value:function(){return""}},{key:"iconStructure",value:function(){return""}},{key:"iconVerify",value:function(){return"\n \n \n \n \n \n \n "}},{key:"iconEnvelope",value:function(){return""}},{key:"iconTest",value:function(){return""}},{key:"iconClassJournal",value:function(){return""}},{key:"iconVectorSquare",value:function(){return""}},{key:"iconUniversityAssn",value:function(){return""}},{key:"iconStuffAssn",value:function(){return""}},{key:"iconPersonAssn",value:function(){return""}},{key:"iconChair",value:function(){return""}},{key:"iconExperts",value:function(){return""}},{key:"iconFolderStructure",value:function(){return"\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n "}},{key:"iconLicenses",value:function(){return""}},{key:"iconEmployee",value:function(){return""}},{key:"iconPortrait",value:function(){return""}},{key:"iconGraduationCap",value:function(){return""}},{key:"iconUsers",value:function(){return""}},{key:"iconCalc",value:function(){return""}},{key:"iconUsersCog",value:function(){return""}},{key:"iconBook",value:function(){return""}},{key:"iconArchiveBox",value:function(){return""}},{key:"iconFood",value:function(){return""}},{key:"iconBriefCase",value:function(){return""}},{key:"iconWallet",value:function(){return""}},{key:"iconIdCard",value:function(){return""}},{key:"iconFileExport",value:function(){return""}},{key:"iconFileSignature",value:function(){return""}},{key:"iconCertificate",value:function(){return""}},{key:"iconNew",value:function(){return""}},{key:"iconCheckDocuments",value:function(){return""}},{key:"iconAttachDocuments",value:function(){return""}},{key:"iconAbort",value:function(){return""}},{key:"iconPrepare",value:function(){return""}},{key:"iconResults",value:function(){return""}},{key:"iconFinal",value:function(){return""}},{key:"iconFinances",value:function(){return""}},{key:"iconList",value:function(){return""}},{key:"iconOrg",value:function(){return""}},{key:"iconOrgBranch",value:function(){return"\n \n \n \n \n \n "}},{key:"iconOrgNew",value:function(){return"\n \n \n \n \n \n "}},{key:"iconJournal",value:function(){return""}},{key:"iconPrint",value:function(){return""}},{key:"iconThumbsDown",value:function(){return""}},{key:"iconCalendar",value:function(){return""}},{key:"iconCart",value:function(){return""}},{key:"iconLicProcess",value:function(){return""}},{key:"iconJournalManage",value:function(){return''}},{key:"iconPtp",value:function(){return""}},{key:"iconReport",value:function(){return'\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n '}},{key:"icon24fd9f5d08b833f75aadaca6b61708a3",value:function(){return this.iconPuzzle()}},{key:"icon9bc65c2abec141778ffaa729489f3e87",value:function(){return this.iconUser()}},{key:"iconbb4c374392133719a324ab1ba2799cd6",value:function(){return this.iconTools()}},{key:"icone5c984a248cfda460b1047a438564e54",value:function(){return this.iconPieChart()}},{key:"icon429809eaa6973c96e62e96b9ddcbca03",value:function(){return this.iconEdit()}},{key:"icone9e08300e5a343413014994a4152295d",value:function(){return this.iconArchive()}},{key:"icon7624b58e48d81ad8e816c40ca7049127",value:function(){return this.iconRuble()}},{key:"icon7352ce0b4e0665659ae6466c18decb2a",value:function(){return this.iconCertificate()}},{key:"icone5e6fb6f6d67065a227d8db316789a17",value:function(){return this.iconOrganisationCard()}},{key:"icon9009dd56fedf3de2f6397c1f26138f75",value:function(){return this.iconOrganisationCard()}},{key:"icon0c309e2baf6eee65994b2c7191b41186",value:function(){return this.iconRoom()}},{key:"iconb4c1948c087fafc89a88450fcbb64c77",value:function(){return this.iconOrganisationCard()}},{key:"icon5398fd939f7244693b33468231ba5d9f",value:function(){return this.iconBox()}},{key:"iconc23891935fdf7ea66bb36ad527a430b5",value:function(){return this.iconBox()}},{key:"icon02e958feacf2fdaf1daeccaa8de8ff76",value:function(){return this.iconLicProcess()}},{key:"icon5095858f6eaa163d8bfef27b33e36e2c",value:function(){return this.iconExperts()}},{key:"icon60e094151683be6647baa0b1072c0420",value:function(){return this.iconLicenses()}},{key:"icon5d5a8a94d68a12ffab2f9c2592e3f7fe",value:function(){return this.iconLayers()}},{key:"icon884860198267a584766fa470e894d146",value:function(){return this.iconCalendar()}},{key:"icon164fffe1a3ffe95abceb6b1ea8811a26",value:function(){return this.iconCart()}},{key:"icon7099464747ad04622e1a6575ead55a11",value:function(){return this.iconFolderStructure()}},{key:"iconce9194234cf2088c855a37592c03b351",value:function(){return this.iconExpert()}},{key:"icon2b0ed0bf32cb56da137554d48f68767a",value:function(){return this.iconTeacher()}},{key:"icon7ef4fecdd4dba4bb7284c01e083888e0",value:function(){return this.iconStudents()}},{key:"icon3abfe3df489f1b3c7f21bcf87e4d7806",value:function(){return this.iconPuzzle()}},{key:"icon25cd610af421079ba6f152ecc7c749d1",value:function(){return this.iconArchive()}},{key:"icon713c8ce3d66cdac0a1e97cab02b0deb8",value:function(){return this.iconCloudDB()}},{key:"iconaee715d0bb322766b19aae838ff72520",value:function(){return this.iconUniversity()}},{key:"icon19fe42bc7cfdc37a2d88684013e66c7b",value:function(){return this.iconEye()}},{key:"icon1b79c9ec28de8c71836f98756342112d",value:function(){return this.iconVerify()}},{key:"iconaa9875740fbfc23e05a47e5a84895129",value:function(){return this.iconStructure()}},{key:"iconfd7979fffc725e97e286af18dbde5a04",value:function(){return this.iconEnvelope()}},{key:"icon6dcf087e68437a63a9f5bc0ff24c17cc",value:function(){return this.iconTest()}},{key:"icon3708de60a13facbdd416a79ece604a02",value:function(){return this.iconVectorSquare()}},{key:"icon28198b369067e88dab9fefe85484dbf4",value:function(){return this.iconClassJournal()}},{key:"icon7c269f218546bdfdd31f71a464fda716",value:function(){return this.iconClassJournal()}},{key:"icone83f22c7601ab276c4f77bd580fdf416",value:function(){return this.iconUniversityAssn()}},{key:"icon58b637730529c1db431b94cabb3d52ce",value:function(){return this.iconStuffAssn()}},{key:"icon3587c1c0238283f9fbf60bcd0b7861be",value:function(){return this.iconStuffAssn()}},{key:"icona9eb7d7dd1f150d2eb6c49de556e2dd6",value:function(){return this.iconPersonAssn()}},{key:"iconbad7786e1885c6ead8ade770a3988651",value:function(){return this.iconArmchair()}},{key:"icone1587068a9a4f663b26c707bf8ed1aa4",value:function(){return this.iconPieChart()}},{key:"icon103f32b247ead545bcc2615b310b3723",value:function(){return this.iconMonitoring()}},{key:"icon440973c1d9063a07223c8c284d057026",value:function(){return this.iconLayers()}},{key:"iconee7c2dc9812b9eb60e0ffe380a3112ec",value:function(){return this.iconPrint()}},{key:"icon08e849ab15793b6baba2e32ba39ffb24",value:function(){return this.iconEnvelope()}},{key:"icone159ad74a82f65881998680f5730b264",value:function(){return this.iconIdCard()}},{key:"icon6bae8c4f401f0ac303e15ef844219f1d",value:function(){return this.iconGraduationCap()}},{key:"icondac63561091bb1271e58286fa36e38ff",value:function(){return this.iconJournalManage()}},{key:"iconbe19d835ae8962460c01703fd05ad9ad",value:function(){return this.iconPtp()}},{key:"icon21c7807c983f5b1e6ced7e6ec5155e35",value:function(){return this.iconTest()}},{key:"iconee2b96b60640553d09473a3f641a0cfd",value:function(){return this.iconPrint()}},{key:"icon877d8eb6e3e12c0a2049213e64f293de",value:function(){return this.iconFolderStructure()}},{key:"icon3eb29d792013f8445b89d1c0cb051d4e",value:function(){return this.iconFolderStructure()}},{key:"icon1b30fe881060a1ea6a97061156a8e883",value:function(){return this.iconReport()}},{key:"icon6079c04608ca0f200bca551ce4fa555f",value:function(){return this.iconTest()}},{key:"icon02a91229deecdf81712488dd00a480c6",value:function(){return''}},{key:"icone35eedc5b7f4ff5958d7bcfd7bf456d6",value:function(c){switch(c){case"5":case"7":case"9":return this.iconCalendar();case"14":case"15":case"16":return this.iconRoom();case"18":return this.iconStructure();case"21":return this.iconUsers();case"22":case"24":return this.iconBriefCase();case"25":return this.iconUsers();case"26":return this.iconBriefCase();case"29":return this.iconPortrait();case"36":return this.iconUsers();case"38":return this.iconEmployee();case"41":return this.iconFileSignature();case"42":return this.iconBook();case"44":return this.iconGraduationCap();case"48":return this.iconPortrait();case"49":return this.iconUsers();case"50":return this.iconPortrait();case"52":return this.iconGraduationCap();case"53":return this.iconChalkboardTeacher();case"54":return this.iconUsersCog();case"55":return this.iconFileExport();case"56":return this.iconGraduationCap();case"57":return this.iconArchiveBox();case"58":return this.iconPieChart();case"64":return this.iconUserPlus();case"66":return this.iconChalkboardTeacher();case"115":return this.iconBook();case"117":return this.iconArchiveBox();case"119":return this.iconBriefCase();case"121":return this.iconUsers();case"123":case"125":return this.iconGraduationCap();case"127":return this.iconRoom();case"126":return this.iconGraduationCap();case"139":case"152":case"153":return this.iconMonitoring();case"157":return this.iconUsersCog();case"169":return this.iconArchiveBox();case"170":return this.iconEmployee();case"171":return this.iconPortrait();case"172":case"173":return this.iconGraduationCap();case"174":return this.iconPortrait();case"175":return this.iconChalkboardTeacher();case"202":return this.iconBook();case"203":return this.iconGraduationCap();case"205":return this.iconStructure();case"211":return this.iconPrint();case"213":case"214":case"215":return this.iconStructure();case"216":return this.iconCalc();case"231":return this.iconFood();case"251":return this.iconUsers();case"271":return this.iconTest();case"468":return this.iconMonitoring();case"474":return this.iconEye();case"475":return this.iconIdCard();case"482":return this.iconWallet();case"483":return this.iconClassJournal();case"505":return this.iconStructure();case"507":return this.iconRoom();case"512":return this.iconUsers();case"516":return this.iconGraduationCap();case"523":return this.iconBook();default:return this.iconFolderStructure()}}}]),c}(); var _createClass=function(){function l(e,t){for(var n=0;n"+escapeHtml(u.value)+"":"item"==t&&(n+="
      "+escapeHtml(u.value)+"
      ")}}catch(e){r=!0,a=e}finally{try{!l&&i.return&&i.return()}finally{if(r)throw a}}return n}},{key:"textHeight",value:function(e,t,n){var l=3t?(void 0===n&&(n=Math.floor(t/2)-4),void 0===l&&(l=Math.floor(t/2)+4),e.slice(0,n)+"..."+e.slice(-l)):e}},{key:"floatValues",value:function(){return/[+-]?([0-9]*[.])?[0-9]+/}}]),e}(); var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_createClass=function(){function s(e,t){for(var i=0;ithis.canvas.clientHeight?this.scrollBarPaint(!0):this.scrollBarPaint(!1),this.ctx.restore()}},{key:"setMousePos",value:function(e){var t=Math.floor(this.canvas.getBoundingClientRect().top)-this.scrollDelta,i=Math.floor((e.clientY-t)/this.itemHeight),s=null;return 0<=i&&i
      "),this.scrollBar=$(this.container).find(".tv-sb"),this.scrollBar.css({position:"absolute",right:"0",top:"0",bottom:"0","overflow-y":"scroll",width:this.getScrollBarWidth()+1+"px"})),this.scrollBar=this.scrollBar.get(0),$(this.scrollBar).find(".slider").height((this.visibleNodes.length+1)*this.itemHeight),this.ctx.clearRect(this.canvas.width-this.scrollBar.offsetWidth-2,-1,this.canvas.width,this.canvas.height),this.scrollBar.onscroll=function(e){return t.paint()}):($(this.scrollBar).remove(),delete this.scrollBar)}},{key:"getScrollBarWidth",value:function(){var e=document.createElement("p");e.style.width="100%",e.style.height="200px";var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.left="0px",t.style.visibility="hidden",t.style.width="200px",t.style.height="150px",t.style.overflow="hidden",t.appendChild(e),document.body.appendChild(t);var i=e.offsetWidth;t.style.overflow="scroll";var s=e.offsetWidth;return i==s&&(s=t.clientWidth),document.body.removeChild(t),i-s}},{key:"deepEqual",value:function(e,t){if(e===t)return!0;if(null==e||"object"!=(void 0===e?"undefined":_typeof(e))||null==t||"object"!=(void 0===t?"undefined":_typeof(t)))return!1;var i=0,s=0;for(var o in e)i+=1;for(var l in t)if(s+=1,!(l in e&&this.deepEqual(e[l],t[l])))return!1;return i==s}},{key:"mouseClick",value:function(e){if(null===this.treeRequest){var t=this.setMousePos(e),i=Math.floor(this.canvas.getBoundingClientRect().left);if(null!=this.selectedNode&&t!=this.selectedNode&&!1===this.selectedNode.CanClose){if(null!=this.selectedNode.unblock)return void this.selectedNode.unblock(this.selectedNode);this.selectedNode.CanClose=!0}if(t!=this.selectedNode&&null!=this.selectedNode&&(this.selectedNode.selected=!1),this.hoveredNode=t,null!=(this.selectedNode=t)){if(!t.selected&&null!==t.tree.onSelect&&!t.tree.onSelect(t))return;if(t.selected=!0,0=s&&e.clientX-i<=o&&t.expand()}else if(0=l&&e.clientX-i<=n&&t.collapse()}}this.paint()}}},{key:"mouseContextmenu",value:function(e){if(e.preventDefault(),null===this.treeRequest){var t=this.setMousePos(event);if(null!=this.selectedNode&&t!=this.selectedNode&&!1===this.selectedNode.CanClose){if(null!=this.selectedNode.unblock)return void this.selectedNode.unblock();this.selectedNode.CanClose=!0}if(t!=this.selectedNode&&null!=this.selectedNode&&(this.selectedNode.selected=!1),this.hoveredNode=t,null!=(this.selectedNode=t)){if(!t.selected&&null!==t.tree.onSelect&&!t.tree.onSelect(t))return;t.selected=!0,t.contextMenu(e)}else if(null!==this.onContextmenu&&!this.onContextmenu(this))return;this.paint()}}}],[{key:"image",value:function(e){return"folder"===e?"":"request"===e?"":"error"===e?"":void 0}}]),s}(),treeNode=function(){function n(e,t,i,s){var o=4>4)%16,1)+i.substr((e>>0)%16,1)+i.substr((e>>12)%16,1)+i.substr((e>>8)%16,1)+i.substr((e>>20)%16,1)+i.substr((e>>16)%16,1)}}]),n}(); var _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t};!function(t,e){"object"==("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=e(function(){try{return require("moment")}catch(t){}}()):"function"==typeof define&&define.amd?define(["require"],function(t){return e(function(){try{return t("moment")}catch(t){}}())}):(t=t||self).Chart=e(t.moment)}(void 0,function(n){"use strict";n=n&&n.hasOwnProperty("default")?n.default:n;var t,u={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]},d=(function(t){var d={};for(var e in u)u.hasOwnProperty(e)&&(d[u[e]]=e);var o=t.exports={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};for(var i in o)if(o.hasOwnProperty(i)){if(!("channels"in o[i]))throw new Error("missing channels property: "+i);if(!("labels"in o[i]))throw new Error("missing channel labels property: "+i);if(o[i].labels.length!==o[i].channels)throw new Error("channel and label counts mismatch: "+i);var n=o[i].channels,a=o[i].labels;delete o[i].channels,delete o[i].labels,Object.defineProperty(o[i],"channels",{value:n}),Object.defineProperty(o[i],"labels",{value:a})}o.rgb.hsl=function(t){var e,i,n=t[0]/255,a=t[1]/255,r=t[2]/255,o=Math.min(n,a,r),s=Math.max(n,a,r),l=s-o;return s===o?e=0:n===s?e=(a-r)/l:a===s?e=2+(r-n)/l:r===s&&(e=4+(n-a)/l),(e=Math.min(60*e,360))<0&&(e+=360),i=(o+s)/2,[e,100*(s===o?0:i<=.5?l/(s+o):l/(2-s-o)),100*i]},o.rgb.hsv=function(t){var e,i,n,a,r,o=t[0]/255,s=t[1]/255,l=t[2]/255,d=Math.max(o,s,l),u=d-Math.min(o,s,l),h=function(t){return(d-t)/6/u+.5};return 0===u?a=r=0:(r=u/d,e=h(o),i=h(s),n=h(l),o===d?a=n-i:s===d?a=1/3+e-n:l===d&&(a=2/3+i-e),a<0?a+=1:1>1&1)*i*255,(e>>2&1)*i*255]},o.ansi256.rgb=function(t){if(232<=t){var e=10*(t-232)+8;return[e,e,e]}var i;return t-=16,[Math.floor(t/36)/5*255,Math.floor((i=t%36)/6)/5*255,i%6/5*255]},o.rgb.hex=function(t){var e=(((255&Math.round(t[0]))<<16)+((255&Math.round(t[1]))<<8)+(255&Math.round(t[2]))).toString(16).toUpperCase();return"000000".substring(e.length)+e},o.hex.rgb=function(t){var e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];var i=e[0];3===e[0].length&&(i=i.split("").map(function(t){return t+t}).join(""));var n=parseInt(i,16);return[n>>16&255,n>>8&255,255&n]},o.rgb.hcg=function(t){var e,i=t[0]/255,n=t[1]/255,a=t[2]/255,r=Math.max(Math.max(i,n),a),o=Math.min(Math.min(i,n),a),s=r-o;return e=s<=0?0:r===i?(n-a)/s%6:r===n?2+(a-i)/s:4+(i-n)/s+4,e/=6,[360*(e%=1),100*s,100*(s<1?o/(1-s):0)]},o.hsl.hcg=function(t){var e=t[1]/100,i=t[2]/100,n=1,a=0;return(n=i<.5?2*e*i:2*e*(1-i))<1&&(a=(i-.5*n)/(1-n)),[t[0],100*n,100*a]},o.hsv.hcg=function(t){var e=t[1]/100,i=t[2]/100,n=e*i,a=0;return n<1&&(a=(i-n)/(1-n)),[t[0],100*n,100*a]},o.hcg.rgb=function(t){var e=t[0]/360,i=t[1]/100,n=t[2]/100;if(0===i)return[255*n,255*n,255*n];var a,r=[0,0,0],o=e%1*6,s=o%1,l=1-s;switch(Math.floor(o)){case 0:r[0]=1,r[1]=s,r[2]=0;break;case 1:r[0]=l,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=s;break;case 3:r[0]=0,r[1]=l,r[2]=1;break;case 4:r[0]=s,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=l}return a=(1-i)*n,[255*(i*r[0]+a),255*(i*r[1]+a),255*(i*r[2]+a)]},o.hcg.hsv=function(t){var e=t[1]/100,i=e+t[2]/100*(1-e),n=0;return 0e.left-1e-6&&t.xe.top-1e-6&&t.y=i?(V.callback(t.onAnimationComplete,[t],e),e.animating=!1,a.splice(r,1)):++r}},$=V.options.resolve,J=["push","pop","shift","splice","unshift"];function Q(e,t){var i=e._chartjs;if(i){var n=i.listeners,a=n.indexOf(t);-1!==a&&n.splice(a,1),0a?(r=a/e.innerRadius,t.arc(o,s,e.innerRadius-a,n+r,i-r,!0)):t.arc(o,s,a,n+Math.PI/2,i-Math.PI/2),t.closePath(),t.clip()}z._set("global",{elements:{arc:{backgroundColor:z.global.defaultColor,borderColor:"#fff",borderWidth:2,borderAlign:"center"}}});var at=G.extend({_type:"arc",inLabelRange:function(t){var e=this._view;return!!e&&Math.pow(t-e.x,2)=i.innerRadius&&r<=i.outerRadius;return l&&d}return!1},getCenterPoint:function(){var t=this._view,e=(t.startAngle+t.endAngle)/2,i=(t.innerRadius+t.outerRadius)/2;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},getArea:function(){var t=this._view;return Math.PI*((t.endAngle-t.startAngle)/(2*Math.PI))*(Math.pow(t.outerRadius,2)-Math.pow(t.innerRadius,2))},tooltipPosition:function(){var t=this._view,e=t.startAngle+(t.endAngle-t.startAngle)/2,i=(t.outerRadius-t.innerRadius)/2+t.innerRadius;return{x:t.x+Math.cos(e)*i,y:t.y+Math.sin(e)*i}},draw:function(){var t,e,i,n,a,r=this._chart.ctx,o=this._view,s="inner"===o.borderAlign?.33:0,l={x:o.x,y:o.y,innerRadius:o.innerRadius,outerRadius:Math.max(o.outerRadius-s,0),pixelMargin:s,startAngle:o.startAngle,endAngle:o.endAngle,fullCircles:Math.floor(o.circumference/it)};if(r.save(),r.fillStyle=o.backgroundColor,r.strokeStyle=o.borderColor,l.fullCircles){for(l.endAngle=l.startAngle+it,r.beginPath(),r.arc(l.x,l.y,l.outerRadius,l.startAngle,l.endAngle),r.arc(l.x,l.y,l.innerRadius,l.endAngle,l.startAngle,!0),r.closePath(),t=0;t=r.left&&e<=r.right)&&(a||i>=r.top&&i<=r.bottom)}z._set("global",{elements:{rectangle:{backgroundColor:ct,borderColor:ct,borderSkipped:"bottom",borderWidth:0}}});var vt=G.extend({_type:"rectangle",draw:function(){var t,e,i,n,a,r,o,s,l,d,u,h,c,f,g,p,m,v=this._chart.ctx,b=this._view,x=(f=gt(t=b),g=f.right-f.left,p=f.bottom-f.top,i=g/2,n=p/2,h=(e=t).borderWidth,d=(l=e).borderSkipped,u={},d&&(l.horizontal?l.base>l.x&&(d=pt(d,"left","right")):l.base(d=ddiv{position:absolute;width:1000000px;height:1000000px;left:0;top:0}.chartjs-size-monitor-shrink>div{position:absolute;width:200%;height:200%;left:0;top:0}"}))&&se.default||se,ue="$chartjs",he="chartjs-size-monitor",ce="chartjs-render-monitor",fe=["animationstart","webkitAnimationStart"],ge={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",pointerenter:"mouseenter",pointerdown:"mousedown",pointermove:"mousemove",pointerup:"mouseup",pointerleave:"mouseout",pointerout:"mouseout"};function pe(t,e){var i=V.getStyle(t,e),n=i&&i.match(/^(\d+)(\.\d+)?px$/);return n?Number(n[1]):void 0}var me=!!function(){var t=!1;try{var e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("e",null,e)}catch(t){}return t}()&&{passive:!0};function ve(t,e,i){t.addEventListener(e,i,me)}function be(t,e,i){t.removeEventListener(e,i,me)}function xe(t,e,i,n,a){return{type:t,chart:e,native:a||null,x:void 0!==i?i:null,y:void 0!==n?n:null}}function ye(t){var e=document.createElement("div");return e.className=t||"",e}function _e(i,n,a){var t,e,r,o,s,l,d,u=i[ue]||(i[ue]={}),h=u.resizer=function(t){var e=ye(he),i=ye(he+"-expand"),n=ye(he+"-shrink");i.appendChild(ye()),n.appendChild(ye()),e.appendChild(i),e.appendChild(n),e._reset=function(){i.scrollLeft=1e6,i.scrollTop=1e6,n.scrollLeft=1e6,n.scrollTop=1e6};var a=function(){e._reset(),t()};return ve(i,"scroll",a.bind(i,"expand")),ve(n,"scroll",a.bind(n,"shrink")),e}((r=!(t=function(){if(u.resizer){var t=a.options.maintainAspectRatio&&i.parentNode,e=t?t.clientWidth:0;n(xe("resize",a)),t&&t.clientWidthl.height-e.height&&(h="bottom");var c=(d.left+d.right)/2,f=(d.top+d.bottom)/2;n="center"===h?(i=function(t){return t<=c},function(t){return c=l.width-e.width/2}),a=function(t){return t+e.width+s.caretSize+s.caretPadding>l.width},r=function(t){return t-e.width-s.caretSize-s.caretPadding<0},o=function(t){return t<=f?"top":"bottom"},i(s.x)?(u="left",a(s.x)&&(u="center",h=o(s.y))):n(s.x)&&(u="right",r(s.x)&&(u="center",h=o(s.y)));var g=t._options;return{xAlign:g.xAlign?g.xAlign:u,yAlign:g.yAlign?g.yAlign:h}}(this,c=F),g=M._chart,p=h.x,m=h.y,v=h.caretSize,b=h.caretPadding,x=h.cornerRadius,y=f.xAlign,_=f.yAlign,k=v+b,w=x+b,"right"===y?p-=c.width:"center"===y&&((p-=c.width/2)+c.width>g.width&&(p=g.width-c.width),p<0&&(p=0)),"top"===_?m+=k:m-="bottom"===_?c.height+k:c.height/2,"center"===_?"left"===y?p+=k:"right"===y&&(p-=k):"left"===y?p-=w:"right"===y&&(p+=w),I={x:p,y:m}}else P.opacity=0;return P.xAlign=T.xAlign,P.yAlign=T.yAlign,P.x=I.x,P.y=I.y,P.width=F.width,P.height=F.height,P.caretX=L.x,P.caretY=L.y,M._model=P,t&&S.custom&&S.custom.call(M,P),M},drawCaret:function(t,e){var i=this._chart.ctx,n=this._view,a=this.getCaretPosition(t,e,n);i.lineTo(a.x1,a.y1),i.lineTo(a.x2,a.y2),i.lineTo(a.x3,a.y3)},getCaretPosition:function(t,e,i){var n,a,r,o,s,l,d=i.caretSize,u=i.cornerRadius,h=i.xAlign,c=i.yAlign,f=t.x,g=t.y,p=e.width,m=e.height;if("center"===c)s=g+m/2,l="left"===h?(a=(n=f)-d,r=n,o=s+d,s-d):(a=(n=f+p)+d,r=n,o=s-d,s+d);else if(r=(n="left"===h?(a=f+u+d)-d:"right"===h?(a=f+p-u-d)-d:(a=i.caretX)-d,a+d),"top"===c)s=(o=g)-d,l=o;else{s=(o=g+m)+d,l=o;var v=r;r=n,n=v}return{x1:n,x2:a,x3:r,y1:o,y2:s,y3:l}},drawTitle:function(t,e,i){var n,a,r,o=e.title,s=o.length;if(s){var l=Ae(e.rtl,e.x,e.width);for(t.x=Le(e,e._titleAlign),i.textAlign=l.textAlign(e._titleAlign),i.textBaseline="middle",n=e.titleFontSize,a=e.titleSpacing,i.fillStyle=e.titleFontColor,i.font=V.fontString(n,e._titleFontStyle,e._titleFontFamily),r=0;r=e[t].length&&e[t].push({}),!e[t][a].type||o.type&&o.type!==e[t][a].type?V.merge(e[t][a],[Ce.getScaleDefaults(r),o]):V.merge(e[t][a],o)}else V._merger(t,e,i,n)}})}function We(){return V.merge({},[].slice.call(arguments),{merger:function(t,e,i,n){var a=e[t]||{},r=i[t];"scales"===t?e[t]=Ee(a,r):"scale"===t?e[t]=V.merge(a,[Ce.getScaleDefaults(r.type),r]):V._merger(t,e,i,n)}})}function Ve(t,e,i){for(var n,a=function(t){return t.id===n};n=e+i++,0<=V.findIndex(t,a););return n}function He(t){return"top"===t||"bottom"===t}function je(i,n){return function(t,e){return t[i]===e[i]?t[n]-e[n]:t[i]-e[i]}}z._set("global",{elements:{},events:["mousemove","mouseout","click","touchstart","touchmove"],hover:{onHover:null,mode:"nearest",intersect:!0,animationDuration:400},onClick:null,maintainAspectRatio:!0,responsive:!0,responsiveAnimationDuration:0});var qe=function(t,e){return this.construct(t,e),this};V.extend(qe.prototype,{construct:function(t,e){var i,n,a=this;(n=(i=(i=e)||{}).data=i.data||{}).datasets=n.datasets||[],n.labels=n.labels||[],i.options=We(z.global,z[i.type],i.options||{}),e=i;var r=Me.acquireContext(t,e),o=r&&r.canvas,s=o&&o.height,l=o&&o.width;a.id=V.uid(),a.ctx=r,a.canvas=o,a.config=e,a.width=l,a.height=s,a.aspectRatio=s?l/s:null,a.options=e.options,a._bufferedRender=!1,a._layers=[],(a.chart=a).controller=a,qe.instances[a.id]=a,Object.defineProperty(a,"data",{get:function(){return a.config.data},set:function(t){a.config.data=t}}),r&&o?(a.initialize(),a.update()):console.error("Failed to create chart: can't acquire context from the given item")},initialize:function(){var t=this;return Se.notify(t,"beforeInit"),V.retinaScale(t,t.options.devicePixelRatio),t.bindEvents(),t.options.responsive&&t.resize(!0),t.initToolTip(),Se.notify(t,"afterInit"),t},clear:function(){return V.canvas.clear(this),this},stop:function(){return Z.cancelAnimation(this),this},resize:function(t){var e=this,i=e.options,n=e.canvas,a=i.maintainAspectRatio&&e.aspectRatio||null,r=Math.max(0,Math.floor(V.getMaximumWidth(n))),o=Math.max(0,Math.floor(a?r/a:V.getMaximumHeight(n)));if((e.width!==r||e.height!==o)&&(n.width=e.width=r,n.height=e.height=o,n.style.width=r+"px",n.style.height=o+"px",V.retinaScale(e,i.devicePixelRatio),!t)){var s={width:r,height:o};Se.notify(e,"resize",[s]),i.onResize&&i.onResize(e,s),e.stop(),e.update({duration:i.responsiveAnimationDuration})}},ensureScalesHaveIDs:function(){var t=this.options,i=t.scales||{},e=t.scale;V.each(i.xAxes,function(t,e){t.id||(t.id=Ve(i.xAxes,"x-axis-",e))}),V.each(i.yAxes,function(t,e){t.id||(t.id=Ve(i.yAxes,"y-axis-",e))}),e&&(e.id=e.id||"scale")},buildOrUpdateScales:function(){var o=this,t=o.options,s=o.scales||{},e=[],l=Object.keys(s).reduce(function(t,e){return t[e]=!1,t},{});t.scales&&(e=e.concat((t.scales.xAxes||[]).map(function(t){return{options:t,dtype:"category",dposition:"bottom"}}),(t.scales.yAxes||[]).map(function(t){return{options:t,dtype:"linear",dposition:"left"}}))),t.scale&&e.push({options:t.scale,dtype:"radialLinear",isDefault:!0,dposition:"chartArea"}),V.each(e,function(t){var e=t.options,i=e.id,n=Be(e.type,t.dtype);He(e.position)!==He(t.dposition)&&(e.position=t.dposition),l[i]=!0;var a=null;if(i in s&&s[i].type===n)(a=s[i]).options=e,a.ctx=o.ctx,a.chart=o;else{var r=Ce.getScaleConstructor(n);if(!r)return;a=new r({id:i,type:n,options:e,ctx:o.ctx,chart:o}),s[a.id]=a}a.mergeTicksOptions(),t.isDefault&&(o.scale=a)}),V.each(l,function(t,e){t||delete s[e]}),o.scales=s,Ce.addScalesToLayout(this)},buildOrUpdateControllers:function(){var t,e,i=this,n=[],a=i.data.datasets;for(t=0,e=a.length;t(a=l.offset?s.maxWidth/u:n/(u-1))&&(a=n/(u-(l.offset?.5:1)),r=s.maxHeight-ei(l.gridLines)-d.padding-ii(l.scaleLabel),o=Math.sqrt(e*e+i*i),f=V.toDegrees(Math.min(Math.asin(Math.min((t.highest.height+6)/a,1)),Math.asin(Math.min(r/o,1))-Math.asin(i/o))),f=Math.max(h,Math.min(c,f))),s.labelRotation=f)},afterCalculateTickRotation:function(){V.callback(this.options.afterCalculateTickRotation,[this])},beforeFit:function(){V.callback(this.options.beforeFit,[this])},fit:function(){var t=this,e=t.minSize={width:0,height:0},i=t.chart,n=t.options,a=n.ticks,r=n.scaleLabel,o=n.gridLines,s=t._isVisible(),l="bottom"===n.position,d=t.isHorizontal();if(d?e.width=t.maxWidth:s&&(e.width=ei(o)+ii(r)),d?s&&(e.height=ei(o)+ii(r)):e.height=t.maxHeight,a.display&&s){var u=ai(a),h=t._getLabelSizes(),c=h.first,f=h.last,g=h.widest,p=h.highest,m=.4*u.minor.lineHeight,v=a.padding;if(d){var b=0!==t.labelRotation,x=V.toRadians(t.labelRotation),y=Math.cos(x),_=Math.sin(x),k=_*g.width+y*(p.height-(b?p.offset:0))+(b?0:m);e.height=Math.min(t.maxHeight,e.height+k+v);var w,M,S=t.getPixelForTick(0)-t.left,C=t.right-t.getPixelForTick(t.getTicks().length-1);M=b?(w=l?y*c.width+_*c.offset:_*(c.height-c.offset),l?_*(f.height-f.offset):y*f.width+_*f.offset):(w=c.width/2,f.width/2),t.paddingLeft=Math.max((w-S)*t.width/(t.width-S),0)+3,t.paddingRight=Math.max((M-C)*t.width/(t.width-C),0)+3}else{var P=a.mirror?0:g.width+v+m;e.width=Math.min(t.maxWidth,e.width+P),t.paddingTop=c.height/2,t.paddingBottom=f.height/2}}t.handleMargins(),t.height=d?(t.width=t._length=i.width-t.margins.left-t.margins.right,e.height):(t.width=e.width,t._length=i.height-t.margins.top-t.margins.bottom)},handleMargins:function(){var t=this;t.margins&&(t.margins.left=Math.max(t.paddingLeft,t.margins.left),t.margins.top=Math.max(t.paddingTop,t.margins.top),t.margins.right=Math.max(t.paddingRight,t.margins.right),t.margins.bottom=Math.max(t.paddingBottom,t.margins.bottom))},afterFit:function(){V.callback(this.options.afterFit,[this])},isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},isFullWidth:function(){return this.options.fullWidth},getRightValue:function(t){if($e(t))return NaN;if(("number"==typeof t||t instanceof Number)&&!isFinite(t))return NaN;if(t)if(this.isHorizontal()){if(void 0!==t.x)return this.getRightValue(t.x)}else if(void 0!==t.y)return this.getRightValue(t.y);return t},_convertTicksToLabels:function(t){var e,i,n,a=this;for(a.ticks=t.map(function(t){return t.value}),a.beforeTickToLabelConversion(),e=a.convertTicksToLabels(t)||a.ticks,a.afterTickToLabelConversion(),i=0,n=t.length;id)return r;return Math.max(d,1)}(0,t,0,s),0e.length-1?null:this.getPixelForValue(e[t],t+this.minIndex)},getValueForPixel:function(t){var e=Math.round(this._startValue+this.getDecimalForPixel(t)*this._valueRange);return Math.min(Math.max(e,0),this.ticks.length-1)},getBasePixel:function(){return this.bottom}});ui._defaults={position:"bottom"};var hi=V.noop,ci=V.isNullOrUndef,fi=li.extend({getRightValue:function(t){return"string"==typeof t?+t:li.prototype.getRightValue.call(this,t)},handleTickRangeOptions:function(){var t=this,e=t.options.ticks;if(e.beginAtZero){var i=V.sign(t.min),n=V.sign(t.max);i<0&&n<0?t.max=0:0=t.max&&(a?t.max=t.min+1:t.min=t.max-1),t.min===t.max&&(t.max++,e.beginAtZero||t.min--)},getTickLimit:function(){var t,e=this.options.ticks,i=e.stepSize,n=e.maxTicksLimit;return i?t=Math.ceil(this.max/i)-Math.floor(this.min/i)+1:(t=this._computeTickLimit(),n=n||11),n&&(t=Math.min(n,t)),t},_computeTickLimit:function(){return Number.POSITIVE_INFINITY},handleDirectionalChanges:hi,buildTicks:function(){var t=this,e=t.options.ticks,i=t.getTickLimit(),v={maxTicks:i=Math.max(2,i),min:e.min,max:e.max,precision:e.precision,stepSize:V.valueOrDefault(e.fixedStepSize,e.stepSize)},n=t.ticks=function(t,e){var i,n,a,r,o=[],s=v.stepSize,l=s||1,d=v.maxTicks-1,u=v.min,h=v.max,c=v.precision,f=e.min,g=e.max,p=V.niceNum((g-f)/d/l)*l;if(p<1e-14&&ci(u)&&ci(h))return[f,g];(r=Math.ceil(g/p)-Math.floor(f/p))>d&&(p=V.niceNum(r*p/d/l)*l),s||ci(c)?i=Math.pow(10,V._decimalPlaces(p)):(i=Math.pow(10,c),p=Math.ceil(p*i)/i),n=Math.floor(f/p)*p,a=Math.ceil(g/p)*p,s&&(!ci(u)&&V.almostWhole(u/p,p/1e3)&&(n=u),!ci(h)&&V.almostWhole(h/p,p/1e3)&&(a=h)),r=(a-n)/p,r=V.almostEquals(r,Math.round(r),p/1e3)?Math.round(r):Math.ceil(r),n=Math.round(n*i)/i,a=Math.round(a*i)/i,o.push(ci(u)?n:u);for(var m=1;me.length-1?null:this.getPixelForValue(e[t])}}),bi=gi;vi._defaults=bi;var xi=V.valueOrDefault,yi=V.math.log10,_i={position:"left",ticks:{callback:Ke.formatters.logarithmic}};function ki(t,e){return V.isFinite(t)&&0<=t?t:e}var wi=li.extend({determineDataLimits:function(){var t,e,i,n,a,r,o=this,s=o.options,l=o.chart,d=l.data.datasets,u=o.isHorizontal();function h(t){return u?t.xAxisID===o.id:t.yAxisID===o.id}o.min=Number.POSITIVE_INFINITY,o.max=Number.NEGATIVE_INFINITY,o.minNotZero=Number.POSITIVE_INFINITY;var c=s.stacked;if(void 0===c)for(t=0;te.length-1?null:this.getPixelForValue(e[t])},_getFirstTickValue:function(t){var e=Math.floor(yi(t));return Math.floor(t/Math.pow(10,e))*Math.pow(10,e)},_configure:function(){var t=this,e=t.min,i=0;li.prototype._configure.call(t),0===e&&(e=t._getFirstTickValue(t.minNotZero),i=xi(t.options.ticks.fontSize,z.global.defaultFontSize)/t._length),t._startValue=yi(e),t._valueOffset=i,t._valueRange=(yi(t.max)-yi(e))/(1-i)},getPixelForValue:function(t){var e=this,i=0;return(t=+e.getRightValue(t))>e.min&&0r.r&&(r.r=f.end,o.r=h),g.startr.b&&(r.b=g.end,o.b=h)}t.setReductions(t.drawingArea,r,o)}(this):this.setCenterPoint(0,0,0,0)},setReductions:function(t,e,i){var n=this,a=e.l/Math.sin(i.l),r=Math.max(e.r-n.width,0)/Math.sin(i.r),o=-e.t/Math.cos(i.t),s=-Math.max(e.b-(n.height-n.paddingTop),0)/Math.cos(i.b);a=Fi(a),r=Fi(r),o=Fi(o),s=Fi(s),n.drawingArea=Math.min(Math.floor(t-(a+r)/2),Math.floor(t-(o+s)/2)),n.setCenterPoint(a,r,o,s)},setCenterPoint:function(t,e,i,n){var a=this,r=a.width-e-a.drawingArea,o=t+a.drawingArea,s=i+a.drawingArea,l=a.height-a.paddingTop-n-a.drawingArea;a.xCenter=Math.floor((o+r)/2+a.left),a.yCenter=Math.floor((s+l)/2+a.top+a.paddingTop)},getIndexAngle:function(t){var e=this.chart,i=(t*(360/e.data.labels.length)+((e.options||{}).startAngle||0))%360;return(i<0?i+360:i)*Math.PI*2/360},getDistanceFromCenterForValue:function(t){var e=this;if(V.isNullOrUndef(t))return NaN;var i=e.drawingArea/(e.max-e.min);return e.options.ticks.reverse?(e.max-t)*i:(t-e.min)*i},getPointPosition:function(t,e){var i=this.getIndexAngle(t)-Math.PI/2;return{x:Math.cos(i)*e+this.xCenter,y:Math.sin(i)*e+this.yCenter}},getPointPositionForValue:function(t,e){return this.getPointPosition(t,this.getDistanceFromCenterForValue(e))},getBasePosition:function(t){var e=this.min,i=this.max;return this.getPointPositionForValue(t||0,this.beginAtZero?0:e<0&&i<0?i:0>1)-1]||null,r=t[n],!a)return{lo:null,hi:r};if(r[e]i))return{lo:a,hi:r};s=n-1}}return{lo:r,hi:null}}(t,e,i),r=a.lo?a.hi?a.lo:t[t.length-2]:t[0],o=a.lo?a.hi?a.hi:t[t.length-1]:t[1],s=o[e]-r[e],l=s?(i-r[e])/s:0,d=(o[n]-r[n])*l;return r[n]+d}function Yi(t,e){var i=t._adapter,n=t.options.time,a=n.parser,r=a||n.format,o=e;return"function"==typeof a&&(o=a(o)),V.isFinite(o)||(o="string"==typeof r?i.parse(o,r):i.parse(o)),null!==o?+o:(a||"function"!=typeof r||(o=r(e),V.isFinite(o)||(o=i.parse(o))),o)}function Gi(t,e){if(V.isNullOrUndef(e))return null;var i=t.options.time,n=Yi(t,t.getRightValue(e));return null===n||i.round&&(n=+t._adapter.startOf(n,i.round)),n}function Xi(t,e,i,n){var a,r,o,s=Vi.length;for(a=Vi.indexOf(t);a1e5*d)throw e+" and "+i+" are too far apart with stepSize of "+d+" "+l;for(a=h;a=u&&i<=h&&m.push(i);return d.min=u,d.max=h,d._unit=g.unit||(f.autoSkip?Xi(g.minUnit,d.min,d.max,v):function(t,e,i,n,a){var r,o;for(r=Vi.length-1;r>=Vi.indexOf(i);r--)if(o=Vi[r],Wi[o].common&&t._adapter.diff(a,n,o)>=e-1)return o;return Vi[i?Vi.indexOf(i):0]}(d,m.length,g.minUnit,d.min,d.max)),d._majorUnit=f.major.enabled&&"year"!==d._unit?function(t){for(var e=Vi.indexOf(t)+1,i=Vi.length;ee&&se?e:t.boxWidth}z._set("global",{legend:{display:!0,position:"top",align:"center",fullWidth:!0,reverse:!1,weight:1e3,onClick:function(t,e){var i=e.datasetIndex,n=this.chart,a=n.getDatasetMeta(i);a.hidden=null===a.hidden?!n.data.datasets[i].hidden:null,n.update()},onHover:null,onLeave:null,labels:{boxWidth:40,padding:10,generateLabels:function(i){var n=i.data.datasets,t=i.options.legend||{},a=t.labels&&t.labels.usePointStyle;return i._getSortedDatasetMetas().map(function(t){var e=t.controller.getStyle(a?0:void 0);return{text:n[t.index].label,fillStyle:e.backgroundColor,hidden:!i.isDatasetVisible(t.index),lineCap:e.borderCapStyle,lineDash:e.borderDash,lineDashOffset:e.borderDashOffset,lineJoin:e.borderJoinStyle,lineWidth:e.borderWidth,strokeStyle:e.borderColor,pointStyle:e.pointStyle,rotation:e.rotation,datasetIndex:t.index}},this)}}},legendCallback:function(t){var e,i,n,a=document.createElement("ul"),r=t.data.datasets;for(a.setAttribute("class",t.id+"-legend"),e=0,i=r.length;el.width)&&(h+=o+n.padding,u[u.length-(0l.height&&(p+=m+n.padding,f.push(m),g.push(v),v=m=0),m=Math.max(m,i),v+=o+c,s[e]={left:0,top:0,width:i,height:o}}),p+=m,f.push(m),g.push(v),l.width+=p}t.width=l.width,t.height=l.height}else t.width=l.width=t.height=l.height=0},afterFit:ln,isHorizontal:function(){return"top"===this.options.position||"bottom"===this.options.position},draw:function(){var g=this,i=g.options,p=i.labels,t=z.global,m=t.defaultColor,v=t.elements.line,b=g.height,x=g.columnHeights,y=g.width,_=g.lineWidths;if(i.display){var k,w=sn(i.rtl,g.left,g.minSize.width),M=g.ctx,e=dn(p.fontColor,t.defaultFontColor),n=V.options._parseFont(p),S=n.size;M.textAlign=w.textAlign("left"),M.textBaseline="middle",M.lineWidth=.5,M.strokeStyle=e,M.fillStyle=e,M.font=n.string;var C=un(p,S),P=g.legendHitBoxes,A=function(t,e){switch(i.align){case"start":return p.padding;case"end":return t-e;default:return(t-e+p.padding)/2}},D=g.isHorizontal();k=D?{x:g.left+A(y,_[0]),y:g.top+p.padding,line:0}:{x:g.left+p.padding,y:g.top+A(b,x[0]),line:0},V.rtl.overrideTextDirection(g.ctx,i.textDirection);var T=S+p.padding;V.each(g.legendItems,function(t,e){var i=M.measureText(t.text).width,n=C+S/2+i,a=k.x,r=k.y;w.setWidth(g.minSize.width),D?0g.left+g.minSize.width&&(r=k.y+=T,k.line++,a=k.x=g.left+A(y,_[k.line])):0g.top+g.minSize.height&&(a=k.x=a+g.columnWidths[k.line]+p.padding,k.line++,r=k.y=g.top+A(b,x[k.line]));var o,s,l,d,u,h,c,f=w.x(a);!function(t,e,i){if(!(isNaN(C)||C<=0)){M.save();var n=dn(i.lineWidth,v.borderWidth);if(M.fillStyle=dn(i.fillStyle,m),M.lineCap=dn(i.lineCap,v.borderCapStyle),M.lineDashOffset=dn(i.lineDashOffset,v.borderDashOffset),M.lineJoin=dn(i.lineJoin,v.borderJoinStyle),M.lineWidth=n,M.strokeStyle=dn(i.strokeStyle,m),M.setLineDash&&M.setLineDash(dn(i.lineDash,v.borderDash)),p&&p.usePointStyle){var a=C*Math.SQRT2/2,r=w.xPlus(t,C/2),o=e+S/2;V.canvas.drawPoint(M,i.pointStyle,a,r,o,i.rotation)}else M.fillRect(w.leftForLtr(t,C),e,C,S),0!==n&&M.strokeRect(w.leftForLtr(t,C),e,C,S);M.restore()}}(f,r,t),P[e].left=w.leftForLtr(f,P[e].width),P[e].top=r,o=f,s=r,l=t,d=i,u=S/2,h=w.xPlus(o,C+u),c=s+u,M.fillText(l.text,h,c),l.hidden&&(M.beginPath(),M.lineWidth=2,M.moveTo(h,c),M.lineTo(w.xPlus(h,d),c),M.stroke()),D?k.x+=n+p.padding:k.y+=T}),V.rtl.restoreTextDirection(g.ctx,i.textDirection)}},_getLegendItemAt:function(t,e){var i,n,a;if(t>=this.left&&t<=this.right&&e>=this.top&&e<=this.bottom)for(a=this.legendHitBoxes,i=0;i=(n=a[i]).left&&t<=n.left+n.width&&e>=n.top&&e<=n.top+n.height)return this.legendItems[i];return null},handleEvent:function(t){var e,i=this.options,n="mouseup"===t.type?"click":t.type;if("mousemove"===n){if(!i.onHover&&!i.onLeave)return}else{if("click"!==n)return;if(!i.onClick)return}e=this._getLegendItemAt(t.x,t.y),"click"===n?e&&i.onClick&&i.onClick.call(this,t.native,e):(i.onLeave&&e!==this._hoveredItem&&(this._hoveredItem&&i.onLeave.call(this,t.native,this._hoveredItem),this._hoveredItem=e),i.onHover&&e&&i.onHover.call(this,t.native,e))}});function cn(t,e){var i=new hn({ctx:t.ctx,options:e,chart:t});le.configure(t,i,e),le.addBox(t,i),t.legend=i}var fn={id:"legend",_element:hn,beforeInit:function(t){var e=t.options.legend;e&&cn(t,e)},beforeUpdate:function(t){var e=t.options.legend,i=t.legend;e?(V.mergeIf(e,z.global.legend),i?(le.configure(t,i,e),i.options=e):cn(t,e)):i&&(le.removeBox(t,i),delete t.legend)},afterEvent:function(t,e){var i=t.legend;i&&i.handleEvent(e)}},gn=V.noop;z._set("global",{title:{display:!1,fontStyle:"bold",fullWidth:!0,padding:10,position:"top",text:"",weight:2e3}});var pn=G.extend({initialize:function(t){V.extend(this,t),this.legendHitBoxes=[]},beforeUpdate:gn,update:function(t,e,i){var n=this;return n.beforeUpdate(),n.maxWidth=t,n.maxHeight=e,n.margins=i,n.beforeSetDimensions(),n.setDimensions(),n.afterSetDimensions(),n.beforeBuildLabels(),n.buildLabels(),n.afterBuildLabels(),n.beforeFit(),n.fit(),n.afterFit(),n.afterUpdate(),n.minSize},afterUpdate:gn,beforeSetDimensions:gn,setDimensions:function(){var t=this;t.isHorizontal()?(t.width=t.maxWidth,t.left=0,t.right=t.width):(t.height=t.maxHeight,t.top=0,t.bottom=t.height),t.paddingLeft=0,t.paddingTop=0,t.paddingRight=0,t.paddingBottom=0,t.minSize={width:0,height:0}},afterSetDimensions:gn,beforeBuildLabels:gn,buildLabels:gn,afterBuildLabels:gn,beforeFit:gn,fit:function(){var t,e=this.options,i=this.minSize={},n=this.isHorizontal();e.display?(t=(V.isArray(e.text)?e.text.length:1)*V.options._parseFont(e).lineHeight+2*e.padding,this.width=i.width=n?this.maxWidth:t,this.height=i.height=n?t:this.maxHeight):this.width=i.width=this.height=i.height=0},afterFit:gn,isHorizontal:function(){var t=this.options.position;return"top"===t||"bottom"===t},draw:function(){var t=this.ctx,e=this.options;if(e.display){var i,n,a,r=V.options._parseFont(e),o=r.lineHeight,s=o/2+e.padding,l=0,d=this.top,u=this.left,h=this.bottom,c=this.right;t.fillStyle=V.valueOrDefault(e.fontColor,z.global.defaultFontColor),t.font=r.string,this.isHorizontal()?(n=u+(c-u)/2,a=d+s,i=c-u):(n="left"===e.position?u+s:c-s,a=d+(h-d)/2,i=h-d,l=Math.PI*("left"===e.position?-.5:.5)),t.save(),t.translate(n,a),t.rotate(l),t.textAlign="center",t.textBaseline="middle";var f=e.text;if(V.isArray(f))for(var g=0,p=0;p=t.length-1?t[0]:t[e+1]:e>=t.length-1?t[t.length-1]:t[e+1]},V.previousItem=function(t,e,i){return i?e<=0?t[t.length-1]:t[e-1]:e<=0?t[0]:t[e-1]},V.niceNum=function(t,e){var i=Math.floor(V.log10(t)),n=t/Math.pow(10,i);return(e?n<1.5?1:n<3?2:n<7?5:10:n<=1?1:n<=2?2:n<=5?5:10)*Math.pow(10,i)},V.requestAnimFrame="undefined"==typeof window?function(t){t()}:window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){return window.setTimeout(t,1e3/60)},V.getRelativePosition=function(t,e){var i,n,a=t.originalEvent||t,r=t.target||t.srcElement,o=r.getBoundingClientRect(),s=a.touches;n=s&&0i.length){for(o=0;oe&&(e=t.length)}),e},V.color=k?function(t){return t instanceof CanvasGradient&&(t=z.global.defaultColor),k(t)}:function(t){return console.error("Color.js not found!"),t},V.getHoverColor=function(t){return t instanceof CanvasPattern||t instanceof CanvasGradient?t:V.color(t).saturate(.5).darken(.1).rgbString()}}(),Ue._adapters=Xe,Ue.Animation=K,Ue.animationService=Z,Ue.controllers=Ut,Ue.DatasetController=et,Ue.defaults=z,Ue.Element=G,Ue.elements=bt,Ue.Interaction=Jt,Ue.layouts=le,Ue.platform=Me,Ue.plugins=Se,Ue.Scale=li,Ue.scaleService=Ce,Ue.Ticks=Ke,Ue.Tooltip=Ne,Ue.helpers.each($i,function(t,e){Ue.scaleService.registerScaleType(e,t,t._defaults)}),vn)vn.hasOwnProperty(_n)&&Ue.plugins.register(vn[_n]);Ue.platform.initialize();var kn=Ue;return"undefined"!=typeof window&&(window.Chart=Ue),(Ue.Chart=Ue).Legend=vn.legend._element,Ue.Title=vn.title._element,Ue.pluginService=Ue.plugins,Ue.PluginBase=Ue.Element.extend({}),Ue.canvasHelpers=Ue.helpers.canvas,Ue.layoutService=Ue.layouts,Ue.LinearScaleBase=fi,Ue.helpers.each(["Bar","Bubble","Doughnut","Line","PolarArea","Radar","Scatter"],function(i){Ue[i]=function(t,e){return new Ue(t,Ue.helpers.merge(e||{},{type:i.charAt(0).toLowerCase()+i.slice(1)}))}}),kn});