/*!
 * ZUI: Zdoo template - v1.10.0 - 2021-11-18
 * http://openzui.com
 * GitHub: https://github.com/easysoft/zui.git 
 * Copyright (c) 2021 cnezsoft.com; Licensed MIT
 */
!function(t,e,i){"use strict";if("undefined"==typeof t)throw new Error("ZUI requires jQuery");t.zui||(t.zui=function(e){t.isPlainObject(e)&&t.extend(t.zui,e)});var a={all:-1,left:0,middle:1,right:2},o=0;t.zui({uuid:function(t){var e=1e5*(Date.now()-1580890015292)+10*Math.floor(1e4*Math.random())+o++%10;return t?e:e.toString(36)},callEvent:function(t,e,a){if("function"==typeof t){a!==i&&(t=t.bind(a));var o=t(e);return e&&(e.result=o),!(o!==i&&!o)}return 1},strCode:function(t){var e=0;if("string"!=typeof t&&(t=String(t)),t&&t.length)for(var i=0;i<t.length;++i)e+=(i+1)*t.charCodeAt(i);return e},getMouseButtonCode:function(t){return"number"!=typeof t&&(t=a[t]),t!==i&&null!==t||(t=-1),t},defaultLang:"en",clientLang:function(){var i,a=e.config;if("undefined"!=typeof a&&a.clientLang&&(i=a.clientLang),!i){var o=t("html").attr("lang");i=o?o:navigator.userLanguage||navigator.userLanguage||t.zui.defaultLang}return i.replace("-","_").toLowerCase()},langDataMap:{},addLangData:function(e,i,a){var o={};a&&i&&e?(o[i]={},o[i][e]=a):e&&i&&!a?(a=i,t.each(a,function(t){o[t]={},o[t][e]=a[t]})):!e||i||a||t.each(a,function(e){var i=a[e];t.each(i,function(t){o[t]||(o[t]={}),o[t][e]=i[t]})}),t.extend(!0,t.zui.langDataMap,o)},getLangData:function(e,i,a){if(!arguments.length)return t.extend({},t.zui.langDataMap);if(1===arguments.length)return t.extend({},t.zui.langDataMap[e]);if(2===arguments.length){var o=t.zui.langDataMap[e];return o?i?o[i]:o:{}}if(3===arguments.length){i=i||t.zui.clientLang();var o=t.zui.langDataMap[e],n=o?o[i]:{};return t.extend(!0,{},a[i]||a.en||a.zh_cn,n)}return null},lang:function(){return arguments.length&&t.isPlainObject(arguments[arguments.length-1])?t.zui.addLangData.apply(null,arguments):t.zui.getLangData.apply(null,arguments)},_scrollbarWidth:0,checkBodyScrollbar:function(){if(document.body.clientWidth>=e.innerWidth)return 0;if(!t.zui._scrollbarWidth){var i=document.createElement("div");i.className="scrollbar-measure",document.body.appendChild(i),t.zui._scrollbarWidth=i.offsetWidth-i.clientWidth,document.body.removeChild(i)}return t.zui._scrollbarWidth},fixBodyScrollbar:function(){if(t.zui.checkBodyScrollbar()){var e=t("body"),i=parseInt(e.css("padding-right")||0,10);return t.zui._scrollbarWidth&&e.css({paddingRight:i+t.zui._scrollbarWidth,overflowY:"hidden"}),!0}},resetBodyScrollbar:function(){t("body").css({paddingRight:"",overflowY:""})}}),t.fn.callEvent=function(e,a,o){var n=t(this),s=e.indexOf(".zui."),r=s<0?e:e.substring(0,s),l=t.Event(r,a);if(o===i&&s>0&&(o=n.data(e.substring(s+1))),o&&o.options){var d=o.options[r];"function"==typeof d&&(l.result=t.zui.callEvent(d,l,o))}return n.trigger(l),l},t.fn.callComEvent=function(t,e,a){a===i||Array.isArray(a)||(a=[a]);var o,n=this;n.trigger(e,a);var s=t.options[e];return s&&(o=s.apply(t,a)),o}}(jQuery,window,void 0),function(){"use strict";var t=function(t,e){if(arguments.length>1){var i;if(2==arguments.length&&"object"==typeof e)for(var a in e)void 0!==e[a]&&(i=new RegExp("({"+a+"})","g"),t=t.replace(i,e[a]));else for(var o=1;o<arguments.length;o++)void 0!==arguments[o]&&(i=new RegExp("({["+(o-1)+"]})","g"),t=t.replace(i,arguments[o]))}return t},e=function(t){if(null!==t){var e,i;return i=/\d*/i,e=t.match(i),e==t}return!1},i={formatString:t,string:{format:t,isNum:e}};window.$&&window.$.zui?$.zui(i):window.stringHelper=i.string,window.noStringPrototypeHelper||(String.prototype.format||(String.prototype.format=function(){var e=[].slice.call(arguments);return e.unshift(this),t.apply(this,e)}),String.prototype.isNum||(String.prototype.isNum=function(){return e(this)}),String.prototype.endsWith||(String.prototype.endsWith=function(t,e){return(void 0===e||e>this.length)&&(e=this.length),this.substring(e-t.length,e)===t}),String.prototype.startsWith||Object.defineProperty(String.prototype,"startsWith",{value:function(t,e){return e=!e||e<0?0:+e,this.substring(e,e+t.length)===t}}),String.prototype.includes||(String.prototype.includes=function(){return String.prototype.indexOf.apply(this,arguments)!==-1}))}(),/*!
 * jQuery resize event - v1.1
 * http://benalman.com/projects/jquery-resize-plugin/
 * Copyright (c) 2010 "Cowboy" Ben Alman
 * MIT & GPL http://benalman.com/about/license/
 */
function(t,e,i){"$:nomunge";function a(){o=e[r](function(){n.each(function(){var e=t(this),i=e.width(),a=e.height(),o=t.data(this,d);i===o.w&&a===o.h||e.trigger(l,[o.w=i,o.h=a])}),a()},s[c])}var o,n=t([]),s=t.resize=t.extend(t.resize,{}),r="setTimeout",l="resize",d=l+"-special-event",c="delay",h="throttleWindow";s[c]=250,s[h]=!0,t.event.special[l]={setup:function(){if(!s[h]&&this[r])return!1;var e=t(this);n=n.add(e),t.data(this,d,{w:e.width(),h:e.height()}),1===n.length&&a()},teardown:function(){if(!s[h]&&this[r])return!1;var e=t(this);n=n.not(e),e.removeData(d),n.length||clearTimeout(o)},add:function(e){function a(e,a,n){var s=t(this),r=t.data(this,d)||{};r.w=a!==i?a:s.width(),r.h=n!==i?n:s.height(),o.apply(this,arguments)}if(!s[h]&&this[r])return!1;var o;return"function"==typeof e?(o=e,a):(o=e.handler,void(e.handler=a))}}}(jQuery,this),function(t){"use strict";var e=864e5,i=function(t){return t instanceof Date||("number"==typeof t&&t<1e10&&(t*=1e3),t=new Date(t)),t},a=function(t){return i(t).getTime()},o=function(t,e){t=i(t),void 0===e&&(e="yyyy-MM-dd hh:mm:ss");var a={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"q+":Math.floor((t.getMonth()+3)/3),"S+":t.getMilliseconds()};/(y+)/i.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(var o in a)new RegExp("("+o+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?a[o]:("00"+a[o]).substr((""+a[o]).length)));return e},n=function(t,e){return t.setTime(t.getTime()+e),t},s=function(t,i){return n(t,i*e)},r=function(t){return new Date(i(t).getTime())},l=function(t){return t%4===0&&t%100!==0||t%400===0},d=function(t,e){return[31,l(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},c=function(t){return d(t.getFullYear(),t.getMonth())},h=function(t){return t.setHours(0),t.setMinutes(0),t.setSeconds(0),t.setMilliseconds(0),t},u=function(t,e){var i=t.getDate();return t.setDate(1),t.setMonth(t.getMonth()+e),t.setDate(Math.min(i,c(t))),t},p=function(t,e){e=e||1;for(var i=new Date(t.getTime());i.getDay()!=e;)i=s(i,-1);return h(i)},f=function(t,e){return t.toDateString()===e.toDateString()},g=function(t,e){var i=p(t),a=s(r(i),7);return e>=i&&e<a},m=function(t,e){return t.getFullYear()===e.getFullYear()},v={formatDate:o,createDate:i,date:{ONEDAY_TICKS:e,create:i,getTimestamp:a,format:o,addMilliseconds:n,addDays:s,cloneDate:r,isLeapYear:l,getDaysInMonth:d,getDaysOfThisMonth:c,clearTime:h,addMonths:u,getLastWeekday:p,isSameDay:f,isSameWeek:g,isSameYear:m}};t.$&&t.$.zui?$.zui(v):t.dateHelper=v.date,t.noDatePrototypeHelper||(Date.ONEDAY_TICKS=e,Date.prototype.format||(Date.prototype.format=function(t){return o(this,t)}),Date.prototype.addMilliseconds||(Date.prototype.addMilliseconds=function(t){return n(this,t)}),Date.prototype.addDays||(Date.prototype.addDays=function(t){return s(this,t)}),Date.prototype.clone||(Date.prototype.clone=function(){return r(this)}),Date.isLeapYear||(Date.isLeapYear=function(t){return l(t)}),Date.getDaysInMonth||(Date.getDaysInMonth=function(t,e){return d(t,e)}),Date.prototype.isLeapYear||(Date.prototype.isLeapYear=function(){return l(this.getFullYear())}),Date.prototype.clearTime||(Date.prototype.clearTime=function(){return h(this)}),Date.prototype.getDaysInMonth||(Date.prototype.getDaysInMonth=function(){return c(this)}),Date.prototype.addMonths||(Date.prototype.addMonths=function(t){return u(this,t)}),Date.prototype.getLastWeekday||(Date.prototype.getLastWeekday=function(t){return p(this,t)}),Date.prototype.isSameDay||(Date.prototype.isSameDay=function(t){return f(t,this)}),Date.prototype.isSameWeek||(Date.prototype.isSameWeek=function(t){return g(t,this)}),Date.prototype.isSameYear||(Date.prototype.isSameYear=function(t){return m(this,t)}),Date.create||(Date.create=function(t){return i(t)}),Date.timestamp||(Date.timestamp=function(t){return a(t)}))}(window),+function(t){"use strict";function e(){var t=document.createElement("bootstrap"),e={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var i in e)if(void 0!==t.style[i])return{end:e[i]};return!1}t.fn.emulateTransitionEnd=function(e){var i=!1,a=this;t(this).one("bsTransitionEnd",function(){i=!0});var o=function(){i||t(a).trigger(t.support.transition.end)};return setTimeout(o,e),this},t(function(){t.support.transition=e(),t.support.transition&&(t.event.special.bsTransitionEnd={bindType:t.support.transition.end,delegateType:t.support.transition.end,handle:function(e){if(t(e.target).is(this))return e.handleObj.handler.apply(this,arguments)}})})}(jQuery),function(t,e){"use strict";var i="zui.draggable",a={container:"body",move:!0},o=0,n=function(e,i){var n=this;n.$=t(e),n.id=o++,n.options=t.extend({},a,n.$.data(),i),n.init()};n.DEFAULTS=a,n.NAME=i,n.prototype.init=function(){var a,o,n,s,r,l=this,d=l.$,c="before",h="drag",u="finish",p="."+i+"."+l.id,f="mousedown"+p,g="mouseup"+p,m="mousemove"+p,v=l.options,b=v.selector,y=v.handle,w=d,_="function"==typeof v.move,C=function(t){var e=t.pageX,i=t.pageY;r=!0;var o={left:e-n.x,top:i-n.y};w.removeClass("drag-ready").addClass("dragging"),v.move&&(_?v.move(o,w):w.css(o)),v[h]&&v[h]({event:t,element:w,startOffset:n,pos:o,offset:{x:e-a.x,y:i-a.y},smallOffset:{x:e-s.x,y:i-s.y}}),s.x=e,s.y=i,v.stopPropagation&&t.stopPropagation()},x=function(i){if(t(e).off(p),!r)return void w.removeClass("drag-ready");var o={left:i.pageX-n.x,top:i.pageY-n.y};w.removeClass("drag-ready dragging"),v.move&&(_?v.move(o,w):w.css(o)),v[u]&&v[u]({event:i,element:w,startOffset:n,pos:o,offset:{x:i.pageX-a.x,y:i.pageY-a.y},smallOffset:{x:i.pageX-s.x,y:i.pageY-s.y}}),i.preventDefault(),v.stopPropagation&&i.stopPropagation()},k=function(i){var l=t.zui.getMouseButtonCode(v.mouseButton);if(!(l>-1&&i.button!==l)){var d=t(this);if(b&&(w=y?d.closest(b):d),v[c]){var h=v[c]({event:i,element:w});if(h===!1)return}var u=t(v.container),p=w.offset();o=u.offset(),a={x:i.pageX,y:i.pageY},n={x:i.pageX-p.left+o.left,y:i.pageY-p.top+o.top},s=t.extend({},a),r=!1,w.addClass("drag-ready"),i.preventDefault(),v.stopPropagation&&i.stopPropagation(),t(e).on(m,C).on(g,x)}};y?d.on(f,y,k):b?d.on(f,b,k):d.on(f,k)},n.prototype.destroy=function(){var a="."+i+"."+this.id;this.$.off(a),t(e).off(a),this.$.data(i,null)},t.fn.draggable=function(e){return this.each(function(){var a=t(this),o=a.data(i),s="object"==typeof e&&e;o||a.data(i,o=new n(this,s)),"string"==typeof e&&o[e]()})},t.fn.draggable.Constructor=n}(jQuery,document),function(t,e,i){"use strict";var a="zui.droppable",o={target:".droppable-target",deviation:5,sensorOffsetX:0,sensorOffsetY:0,dropToClass:"drop-to",dropTargetClass:"drop-target"},n=0,s=function(e,i){var a=this;a.id=n++,a.$=t(e),a.options=t.extend({},o,a.$.data(),i),a.init()};s.DEFAULTS=o,s.NAME=a,s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},s.prototype.init=function(){var o,n,s,r,l,d,c,h,u,p,f,g,m,v=this,b=v.$,y=v.options,w=y.deviation,_="."+a+"."+v.id,C="mousedown"+_,x="mouseup"+_,k="mousemove"+_,T=y.selector,D=y.handle,$=y.flex,S=y.container,M=y.canMoveHere,z=y.dropToClass,I=b,E=!1,U=S?t(y.container).first():T?b:t("body"),P=function(e){if(E&&(f={left:e.pageX,top:e.pageY},!(i.abs(f.left-h.left)<w&&i.abs(f.top-h.top)<w))){if(null===s){var a=U.css("position");"absolute"!=a&&"relative"!=a&&"fixed"!=a&&(d=a,U.css("position","relative")),s=I.clone().removeClass("drag-from").addClass("drag-shadow").css({position:"absolute",width:I.outerWidth(),transition:"none"}).appendTo(U),I.addClass("dragging"),o.addClass(y.dropTargetClass),v.trigger("start",{event:e,element:I,shadowElement:s,targets:o})}var c={left:f.left-p.left,top:f.top-p.top},m={left:c.left-u.left,top:c.top-u.top};s.css(m),t.extend(g,f);var b=!1;r=!1,$||o.removeClass(z);var _=null;if(o.each(function(){var e=t(this),i=e.offset(),a=e.outerWidth(),o=e.outerHeight(),n=i.left+y.sensorOffsetX,s=i.top+y.sensorOffsetY;if(f.left>n&&f.top>s&&f.left<n+a&&f.top<s+o&&(_&&_.removeClass(z),_=e,!y.nested))return!1}),_){r=!0;var C=_.data("id");I.data("id")!=C&&(l=!1),(null===n||n.data("id")!==C&&!l)&&(b=!0),n=_,$&&o.removeClass(z),n.addClass(z)}$?null!==n&&n.length&&(r=!0):(I.toggleClass("drop-in",r),s.toggleClass("drop-in",r)),M&&M(I,n)===!1||v.trigger("drag",{event:e,isIn:r,target:n,element:I,isNew:b,selfTarget:l,clickOffset:p,offset:c,position:{left:c.left-u.left,top:c.top-u.top},mouseOffset:f}),e.preventDefault()}},H=function(i){if(t(e).off(_),clearTimeout(m),E){if(E=!1,d&&U.css("position",d),null===s)return I.removeClass("drag-from"),void v.trigger("always",{event:i,cancel:!0});r||(n=null);var a=!0;f=i?{left:i.pageX,top:i.pageY}:g;var c={left:f.left-p.left,top:f.top-p.top},h={left:f.left-g.left,top:f.top-g.top};g.left=f.left,g.top=f.top;var b={event:i,isIn:r,target:n,element:I,isNew:!l&&null!==n,selfTarget:l,offset:c,mouseOffset:f,position:{left:c.left-u.left,top:c.top-u.top},lastMouseOffset:g,moveOffset:h};a=v.trigger("beforeDrop",b),a&&r&&v.trigger("drop",b),o.removeClass(z).removeClass(y.dropTargetClass),I.removeClass("dragging").removeClass("drag-from"),s.remove(),s=null,v.trigger("finish",b),v.trigger("always",b),i&&i.preventDefault()}},L=function(i){var a=t.zui.getMouseButtonCode(y.mouseButton);if(!(a>-1&&i.button!==a)){var f=t(this);T&&(I=D?f.closest(T):f),I.hasClass("drag-shadow")||y.before&&y.before({event:i,element:I})===!1||(E=!0,o="function"==typeof y.target?y.target(I,b):U.find(y.target),n=null,s=null,r=!1,l=!0,d=null,c=I.offset(),u=U.offset(),u.top=u.top-U.scrollTop(),u.left=u.left-U.scrollLeft(),h={left:i.pageX,top:i.pageY},g=t.extend({},h),p={left:h.left-c.left,top:h.top-c.top},I.addClass("drag-from"),t(e).on(k,P).on(x,H),m=setTimeout(function(){t(e).on(C,H)},10),i.preventDefault(),y.stopPropagation&&i.stopPropagation())}};D?b.on(C,D,L):T?b.on(C,T,L):b.on(C,L)},s.prototype.destroy=function(){var i="."+a+"."+this.id;this.$.off(i),t(e).off(i),this.$.data(a,null)},s.prototype.reset=function(){this.destroy(),this.init()},t.fn.droppable=function(e){return this.each(function(){var i=t(this),o=i.data(a),n="object"==typeof e&&e;o||i.data(a,o=new s(this,n)),"string"==typeof e&&o[e]()})},t.fn.droppable.Constructor=s}(jQuery,document,Math),function(t){"use strict";if(!t.fn.droppable)throw new Error("Droppable requires for boards");var e="zui.boards",i=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.getLang(),this.init()};i.DEFAULTS={lang:"en",langs:{zh_cn:{append2end:"移动到末尾"},zh_tw:{append2end:"移动到末尾"},en:{append2end:"Move to the end."}}},i.prototype.getOptions=function(e){return e=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.getLang=function(){var i=this.options;this.langName=i.lang||t.zui.clientLang(),this.lang=t.zui.getLangData(e,this.langName,i.langs)},i.prototype.init=function(){var e=1,i=this.lang;this.$.find('.board-item:not(".disable-drop"), .board:not(".disable-drop")').each(function(){var a=t(this);a.attr("id")?a.attr("data-id",a.attr("id")):a.attr("data-id")||a.attr("data-id","board"+e++),a.hasClass("board")&&a.find(".board-list").append('<div class="board-item board-item-empty"><i class="icon-plus"></i> {append2end}</div>'.format(i)).append('<div class="board-item board-item-shadow"></div>'.format(i))}),this.bind()},i.prototype.bind=function(e){var i=this.$,a=this.options;i.droppable(t.extend({before:a.before,target:'.board-item:not(".disable-drop, .board-item-shadow")',flex:!0,selector:'.board-item:not(".disable-drop, .board-item-shadow")',start:function(t){i.addClass("dragging").find(".board-item-shadow").height(t.element.outerHeight())},drag:function(t){if(i.find(".board.drop-in-empty").removeClass("drop-in-empty"),t.isIn){var e=t.target.closest(".board").addClass("drop-in"),a=e.find(".board-item-shadow"),o=t.target;i.addClass("drop-in").find(".board.drop-in").not(e).removeClass("drop-in"),a.insertBefore(o),e.toggleClass("drop-in-empty",o.hasClass("board-item-empty"))}},drop:function(t){if(t.isNew){var e;"function"==typeof a.drop&&(e=a.drop(t)),e!==!1&&t.element.insertBefore(t.target)}},finish:function(){i.removeClass("dragging").removeClass("drop-in").find(".board.drop-in").removeClass("drop-in")}},a.droppable))},t.fn.boards=function(a){return this.each(function(){var o=t(this),n=o.data(e),s="object"==typeof a&&a;n||o.data(e,n=new i(this,s)),"string"==typeof a&&n[a]()})},t.fn.boards.Constructor=i}(jQuery),/*!
 * jQuery Hotkeys Plugin
 * Copyright 2010, John Resig
 * Dual licensed under the MIT or GPL Version 2 licenses.
 *
 * Based upon the plugin by Tzury Bar Yochay:
 * http://github.com/tzuryby/hotkeys
 *
 * Original idea by:
 * Binny V A, http://www.openjs.com/scripts/events/keyboard_shortcuts/
*/
function(t){function e(e){if("string"==typeof e.data){var i=e.handler,a=e.data.toLowerCase().split(" ");e.handler=function(e){if(this===e.target||!/textarea|select/i.test(e.target.nodeName)&&"text"!==e.target.type){var o="keypress"!==e.type&&t.hotkeys.specialKeys[e.which],n=String.fromCharCode(e.which).toLowerCase(),s="",r={};e.altKey&&"alt"!==o&&(s+="alt+"),e.ctrlKey&&"ctrl"!==o&&(s+="ctrl+"),e.metaKey&&!e.ctrlKey&&"meta"!==o&&(s+="meta+"),e.shiftKey&&"shift"!==o&&(s+="shift+"),o?r[s+o]=!0:(r[s+n]=!0,r[s+t.hotkeys.shiftNums[n]]=!0,"shift+"===s&&(r[t.hotkeys.shiftNums[n]]=!0));for(var l=0,d=a.length;l<d;l++)if(r[a[l]])return i.apply(this,arguments)}}}}t.hotkeys={version:"0.8",specialKeys:{8:"backspace",9:"tab",13:"return",16:"shift",17:"ctrl",18:"alt",19:"pause",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"insert",46:"del",96:"0",97:"1",98:"2",99:"3",100:"4",101:"5",102:"6",103:"7",104:"8",105:"9",106:"*",107:"+",109:"-",110:".",111:"/",112:"f1",113:"f2",114:"f3",115:"f4",116:"f5",117:"f6",118:"f7",119:"f8",120:"f9",121:"f10",122:"f11",123:"f12",144:"numlock",145:"scroll",191:"/",224:"meta"},shiftNums:{"`":"~",1:"!",2:"@",3:"#",4:"$",5:"%",6:"^",7:"&",8:"*",9:"(",0:")","-":"_","=":"+",";":": ","'":'"',",":"<",".":">","/":"?","\\":"|"}},t.each(["keydown","keyup","keypress"],function(){t.event.special[this]={add:e}})}(jQuery),function(t){"use strict";t.fn.fixOlPd=function(e){return e=e||10,this.each(function(){var i=t(this);i.css("paddingLeft",Math.ceil(Math.log10(i.children().length))*e+10)})},t(function(){t(".ol-pd-fix,.article ol").fixOlPd()})}(jQuery),function(t){"use strict";var e={zh_cn:'您的浏览器版本过低，无法体验所有功能，建议升级或者更换浏览器。 <a href="https://browsehappy.com/" target="_blank" class="alert-link">了解更多...</a>',zh_tw:'您的瀏覽器版本過低，無法體驗所有功能，建議升級或者更换瀏覽器。<a href="https://browsehappy.com/" target="_blank" class="alert-link">了解更多...</a>',en:'Your browser is too old, it has been unable to experience the colorful internet. We strongly recommend that you upgrade a better one. <a href="https://browsehappy.com/" target="_blank" class="alert-link">Learn more...</a>'},i=function(){for(var t=!1,e=11;e>5;e--)if(this.isIE(e)){t=e;break}this.ie=t,this.cssHelper()};i.prototype.cssHelper=function(){var e=this.ie,i=t("html");i.toggleClass("ie",e).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"),e&&i.addClass("ie-"+e).toggleClass("gt-ie-7 gte-ie-8 support-ie",e>=8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie",e<8).toggleClass("gt-ie-8 gte-ie-9",e>=9).toggleClass("lte-ie-8 lt-ie-9",e<9).toggleClass("gt-ie-9 gte-ie-10",e>=10).toggleClass("lte-ie-9 lt-ie-10",e<10).toggleClass("gt-ie-10 gte-ie-11",e>=11).toggleClass("lte-ie-10 lt-ie-11",e<11)},i.prototype.tip=function(i){var a=t("#browseHappyTip");a.length||(a=t('<div id="browseHappyTip" class="alert alert-dismissable alert-danger-inverse alert-block" style="position: relative; z-index: 99999"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><div class="container"><div class="content text-center"></div></div></div>'),a.prependTo("body")),i||(i=t.zui.getLangData("zui.browser",t.zui.clientLang(),e),"object"==typeof i&&(i=i.tip)),a.find(".content").html(i)},i.prototype.isIE=function(t){if(11===t)return this.isIE11();if(10===t)return this.isIE10();if(!t&&(this.isIE11()||this.isIE10()))return!0;var e=document.createElement("b");return e.innerHTML="<!--[if IE "+(t||"")+"]><i></i><![endif]-->",1===e.getElementsByTagName("i").length},i.prototype.isIE10=function(){return navigator.appVersion.indexOf("MSIE 10")!==-1},i.prototype.isIE11=function(){var t=navigator.userAgent;return t.indexOf("Trident")!==-1&&t.indexOf("rv:11")!==-1},t.zui({browser:new i}),t(function(){t("body").hasClass("disabled-browser-tip")||t.zui.browser.ie&&t.zui.browser.ie<8&&t.zui.browser.tip()})}(jQuery),function(t,e){"use strict";var i="zui.pager",a={page:1,recTotal:0,recPerPage:10},o={zh_cn:{pageOfText:"第 {0} 页",prev:"上一页",next:"下一页",first:"第一页",last:"最后一页","goto":"跳转",pageOf:"第 <strong>{page}</strong> 页",totalPage:"共 <strong>{totalPage}</strong> 页",totalCount:"共 <strong>{recTotal}</strong> 项",pageSize:"每页 <strong>{recPerPage}</strong> 项",itemsRange:"第 <strong>{start}</strong> ~ <strong>{end}</strong> 项",pageOfTotal:"第 <strong>{page}</strong>/<strong>{totalPage}</strong> 页"},zh_tw:{pageOfText:"第 {0} 頁",prev:"上一頁",next:"下一頁",first:"第一頁",last:"最後一頁","goto":"跳轉",pageOf:"第 <strong>{page}</strong> 頁",totalPage:"共 <strong>{totalPage}</strong> 頁",totalCount:"共 <strong>{recTotal}</strong> 項",pageSize:"每頁 <strong>{recPerPage}</strong> 項",itemsRange:"第 <strong>{start}</strong> ~ <strong>{end}</strong> 項",pageOfTotal:"第 <strong>{page}</strong>/<strong>{totalPage}</strong> 頁"},en:{pageOfText:"Page {0}",prev:"Prev",next:"Next",first:"First",last:"Last","goto":"Goto",pageOf:"Page <strong>{page}</strong>",totalPage:"<strong>{totalPage}</strong> pages",totalCount:"Total: <strong>{recTotal}</strong> items",pageSize:"<strong>{recPerPage}</strong> per page",itemsRange:"From <strong>{start}</strong> to <strong>{end}</strong>",pageOfTotal:"Page <strong>{page}</strong> of <strong>{totalPage}</strong>"}},n=function(e,a){var s=this;s.name=i,s.$=t(e),a=s.options=t.extend({},n.DEFAULTS,this.$.data(),a),s.langName=a.lang||t.zui.clientLang(),s.lang=t.zui.getLangData(i,s.langName,o),s.state={},s.set(a.page,a.recTotal,a.recPerPage,!0),s.$.on("click",".pager-goto-btn",function(){var e=t(this).closest(".pager-goto"),i=parseInt(e.find(".pager-goto-input").val());NaN!==i&&s.set(i)}).on("click",".pager-item",function(){var e=t(this).data("page");"number"==typeof e&&e>0&&s.set(e)}).on("click",".pager-size-menu [data-size]",function(){var e=t(this).data("size");"number"==typeof e&&e>0&&s.set(-1,-1,e)})};n.prototype.set=function(e,i,o,n){var s=this;"object"==typeof e&&null!==e&&(o=e.recPerPage,i=e.recTotal,e=e.page);var r=s.state;r||(r=t.extend({},a));var l=t.extend({},r);return"number"==typeof o&&o>0&&(r.recPerPage=o),"number"==typeof i&&i>=0&&(r.recTotal=i),"number"==typeof e&&e>=0&&(r.page=e),r.totalPage=r.recTotal&&r.recPerPage?Math.ceil(r.recTotal/r.recPerPage):1,r.page=Math.max(0,Math.min(r.page,r.totalPage)),r.pageRecCount=r.recTotal,r.page&&r.recTotal&&(r.page<r.totalPage?r.pageRecCount=r.recPerPage:r.page>1&&(r.pageRecCount=r.recTotal-r.recPerPage*(r.page-1))),r.skip=r.page>1?(r.page-1)*r.recPerPage:0,r.start=r.skip+1,r.end=r.skip+r.pageRecCount,r.prev=r.page>1?r.page-1:0,r.next=r.page<r.totalPage?r.page+1:0,s.state=r,n||l.page===r.page&&l.recTotal===r.recTotal&&l.recPerPage===r.recPerPage||s.$.callComEvent(s,"onPageChange",[r,l]),s.render()},n.prototype.createLinkItem=function(i,a,o){var n=this;a===e&&(a=i);var s=t('<a title="'+n.lang.pageOfText.format(i)+'" class="pager-item" data-page="'+i+'"/>').attr("href",i?n.createLink(i,n.state):"###").html(a);return o||(s=t("<li />").append(s).toggleClass("active",i===n.state.page).toggleClass("disabled",!i||i===n.state.page)),s},n.prototype.createNavItems=function(t){var i=this,a=i.$,o=i.state,n=o.totalPage,s=o.page,r=function(t,o){if(t===!1)return void a.append(i.createLinkItem(0,o||i.options.navEllipsisItem));o===e&&(o=t);for(var n=t;n<=o;++n)a.append(i.createLinkItem(n))};t===e&&(t=i.options.maxNavCount||10),r(1),n>1&&(n<=t?r(2,n):s<t-2?(r(2,t-2),r(!1),r(n)):s>n-t+2?(r(!1),r(n-t+2,n)):(r(!1),r(s-Math.ceil((t-4)/2),s+Math.floor((t-4)/2)),r(!1),r(n)))},n.prototype.createGoto=function(){var e=this,i=this.state,a=t('<div class="input-group pager-goto" style="width: '+(35+9*(i.page+"").length+25+12*e.lang["goto"].length)+'px"><input value="'+i.page+'" type="number" min="1" max="'+i.totalPage+'" placeholder="'+i.page+'" class="form-control pager-goto-input"><span class="input-group-btn"><button class="btn pager-goto-btn" type="button">'+e.lang["goto"]+"</button></span></div>");return a},n.prototype.createSizeMenu=function(){var e=this,i=this.state,a=t('<ul class="dropdown-menu"></ul>'),o=e.options.pageSizeOptions;"string"==typeof o&&(o=o.split(","));for(var n=0;n<o.length;++n){var s=o[n];"string"==typeof s&&(s=parseInt(s));var r=t('<li><a href="###" data-size="'+s+'">'+s+"</a></li>").toggleClass("active",s===i.recPerPage);a.append(r)}return t('<div class="btn-group pager-size-menu"><button type="button" class="btn dropdown-toggle" data-toggle="dropdown">'+e.lang.pageSize.format(i)+' <span class="caret"></span></button></div>').addClass(e.options.menuDirection).append(a)},n.prototype.createElement=function(e,i,a){var o=this,n=o.createLinkItem.bind(o),s=o.lang;switch(e){case"prev":return n(a.prev,s.prev);case"prev_icon":return n(a.prev,'<i class="icon '+o.options.prevIcon+'"></i>');case"next":return n(a.next,s.next);case"next_icon":return n(a.next,'<i class="icon '+o.options.nextIcon+'"></i>');case"first":return n(1,s.first);case"first_icon":return n(1,'<i class="icon '+o.options.firstIcon+'"></i>');case"last":return n(a.totalPage,s.last);case"last_icon":return n(a.totalPage,'<i class="icon '+o.options.lastIcon+'"></i>');case"space":case"|":return t('<li class="space" />');case"nav":case"pages":return void o.createNavItems();case"total_text":return t(('<div class="pager-label">'+s.totalCount+"</div>").format(a));case"page_text":return t(('<div class="pager-label">'+s.pageOf+"</div>").format(a));case"total_page_text":return t(('<div class="pager-label">'+s.totalPage+"</div>").format(a));case"page_of_total_text":return t(('<div class="pager-label">'+s.pageOfTotal+"</div>").format(a));case"page_size_text":return t(('<div class="pager-label">'+s.pageSize+"</div>").format(a));case"items_range_text":return t(('<div class="pager-label">'+s.itemsRange+"</div>").format(a));case"goto":return o.createGoto();case"size_menu":return o.createSizeMenu();default:return t("<li/>").html(e.format(a))}},n.prototype.createLink=function(i,a){i===e&&(i=this.state.page),a===e&&(a=this.state);var o=this.options.linkCreator;return"string"==typeof o?o.format(t.extend({},a,{page:i})):"function"==typeof o?o(i,a):"#page="+i},n.prototype.render=function(e){var i=this,a=i.state,o=i.options.elementCreator||i.createElement,n=t.isPlainObject(o);e=e||i.elements||i.options.elements,"string"==typeof e&&(e=e.split(",")),i.elements=e,i.$.empty();for(var s=0;s<e.length;++s){var r=t.trim(e[s]),l=n?o[r]||o:o,d=l.call(i,r,i.$,a);d===!1&&(d=i.createElement(r,i.$,a)),d instanceof t&&("LI"!==d[0].tagName&&(d=t("<li/>").append(d)),i.$.append(d))}var c=null;return i.$.children("li").each(function(){var e=t(this),i=!!e.children(".pager-item").length;c?c.toggleClass("pager-item-right",!i):i&&e.addClass("pager-item-left"),c=i?e:null}),c&&c.addClass("pager-item-right"),i.$.callComEvent(i,"onRender",[a]),i},n.DEFAULTS=t.extend({elements:["first_icon","prev_icon","pages","next_icon","last_icon","page_of_total_text","items_range_text","total_text"],prevIcon:"icon-double-angle-left",nextIcon:"icon-double-angle-right",firstIcon:"icon-step-backward",lastIcon:"icon-step-forward",navEllipsisItem:'<i class="icon icon-ellipsis-h"></i>',maxNavCount:10,menuDirection:"dropdown",pageSizeOptions:[10,20,30,50,100]},a),t.fn.pager=function(e){return this.each(function(){var a=t(this),o=a.data(i),s="object"==typeof e&&e;o||a.data(i,o=new n(this,s)),"string"==typeof e&&o[e]()})},n.NAME=i,n.LANG=o,t.fn.pager.Constructor=n,t(function(){t('[data-ride="pager"]').pager()})}(jQuery,void 0),+function(t){"use strict";var e="zui.tab",i=function(e){this.element=t(e)};i.prototype.show=function(){var i=this.element,a=i.closest("ul:not(.dropdown-menu)"),o=i.attr("data-target")||i.attr("data-tab");if(o||(o=i.attr("href"),o=o&&o.replace(/.*(?=#[^\s]*$)/,"")),!i.parent("li").hasClass("active")){var n=a.find(".active:last a")[0],s=t.Event("show."+e,{relatedTarget:n});if(i.trigger(s),!s.isDefaultPrevented()){var r=t(o);this.activate(i.parent("li"),a),this.activate(r,r.parent(),function(){i.trigger({type:"shown."+e,relatedTarget:n})})}}},i.prototype.activate=function(e,i,a){function o(){n.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),e.addClass("active"),s?(e[0].offsetWidth,e.addClass("in")):e.removeClass("fade"),e.parent(".dropdown-menu")&&e.closest("li.dropdown").addClass("active"),a&&a()}var n=i.find("> .active"),s=a&&t.support.transition&&n.hasClass("fade");s?n.one(t.support.transition.end,o).emulateTransitionEnd(150):o(),n.removeClass("in")};var a=t.fn.tab;t.fn.tab=function(a){return this.each(function(){var o=t(this),n=o.data(e);n||o.data(e,n=new i(this)),"string"==typeof a&&n[a]()})},t.fn.tab.Constructor=i,t.fn.tab.noConflict=function(){return t.fn.tab=a,this},t(document).on("click.zui.tab.data-api",'[data-toggle="tab"], [data-tab]',function(e){e.preventDefault(),t(this).tab("show")})}(window.jQuery),function(t,e){"use strict";var i=1200,a=992,o=768,n=e(t),s=function(){var t=n.width();e("html").toggleClass("screen-desktop",t>=a&&t<i).toggleClass("screen-desktop-wide",t>=i).toggleClass("screen-tablet",t>=o&&t<a).toggleClass("screen-phone",t<o).toggleClass("device-mobile",t<a).toggleClass("device-desktop",t>=a)},r="",l=navigator.userAgent;l.match(/(iPad|iPhone|iPod)/i)?r+=" os-ios":l.match(/android/i)?r+=" os-android":l.match(/Win/i)?r+=" os-windows":l.match(/Mac/i)?r+=" os-mac":l.match(/Linux/i)?r+=" os-linux":l.match(/X11/i)&&(r+=" os-unix"),"ontouchstart"in document.documentElement&&(r+=" is-touchable"),e("html").addClass(r),n.resize(s),s()}(window,jQuery),+function(t){"use strict";var e='[data-dismiss="alert"]',i="zui.alert",a=function(i){t(i).on("click",e,this.close)};a.prototype.close=function(e){function a(){s.trigger("closed."+i).remove()}var o=t(this),n=o.attr("data-target");n||(n=o.attr("href"),n=n&&n.replace(/.*(?=#[^\s]*$)/,""));var s=t(n);e&&e.preventDefault(),s.length||(s=o.hasClass("alert")?o:o.parent()),s.trigger(e=t.Event("close."+i)),e.isDefaultPrevented()||(s.removeClass("in"),t.support.transition&&s.hasClass("fade")?s.one(t.support.transition.end,a).emulateTransitionEnd(150):a())};var o=t.fn.alert;t.fn.alert=function(e){return this.each(function(){var o=t(this),n=o.data(i);n||o.data(i,n=new a(this)),"string"==typeof e&&n[e].call(o)})},t.fn.alert.Constructor=a,t.fn.alert.noConflict=function(){return t.fn.alert=o,this},t(document).on("click."+i+".data-api",e,a.prototype.close)}(window.jQuery),+function(t){"use strict";var e="zui.collapse",i=function(e,a){this.$element=t(e),this.options=t.extend({},i.DEFAULTS,a),this.transitioning=null,this.options.parent&&(this.$parent=t(this.options.parent)),this.options.toggle&&this.toggle()};i.DEFAULTS={toggle:!0},i.prototype.dimension=function(){var t=this.$element.hasClass("width");return t?"width":"height"},i.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var i=t.Event("show."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var a=this.$parent&&this.$parent.find(".in");if(a&&a.length){var o=a.data(e);if(o&&o.transitioning)return;a.collapse("hide"),o||a.data(e,null)}var n=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[n](0),this.transitioning=1;var s=function(){this.$element.removeClass("collapsing").addClass("in")[n]("auto"),this.transitioning=0,this.$element.trigger("shown."+e)};if(!t.support.transition)return s.call(this);var r=t.camelCase(["scroll",n].join("-"));this.$element.one(t.support.transition.end,s.bind(this)).emulateTransitionEnd(350)[n](this.$element[0][r])}}},i.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var i=t.Event("hide."+e);if(this.$element.trigger(i),!i.isDefaultPrevented()){var a=this.dimension();this.$element[a](this.$element[a]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var o=function(){this.transitioning=0,this.$element.trigger("hidden."+e).removeClass("collapsing").addClass("collapse")};return t.support.transition?void this.$element[a](0).one(t.support.transition.end,o.bind(this)).emulateTransitionEnd(350):o.call(this)}}},i.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var a=t.fn.collapse;t.fn.collapse=function(a){return this.each(function(){var o=t(this),n=o.data(e),s=t.extend({},i.DEFAULTS,o.data(),"object"==typeof a&&a);n||o.data(e,n=new i(this,s)),"string"==typeof a&&n[a]()})},t.fn.collapse.Constructor=i,t.fn.collapse.noConflict=function(){return t.fn.collapse=a,this},t(document).on("click."+e+".data-api","[data-toggle=collapse]",function(i){var a,o=t(this),n=o.attr("data-target")||i.preventDefault()||(a=o.attr("href"))&&a.replace(/.*(?=#[^\s]+$)/,""),s=t(n),r=s.data(e),l=r?"toggle":o.data(),d=o.attr("data-parent"),c=d&&t(d);r&&r.transitioning||(c&&c.find('[data-toggle=collapse][data-parent="'+d+'"]').not(o).addClass("collapsed"),o[s.hasClass("in")?"addClass":"removeClass"]("collapsed")),s.collapse(l)})}(window.jQuery),+function(t){"use strict";function e(e){t(o).remove(),t(n).each(function(e){var o=i(t(this));o.hasClass("open")&&(o.trigger(e=t.Event("hide."+a)),e.isDefaultPrevented()||o.removeClass("open").trigger("hidden."+a))})}function i(e){var i=e.attr("data-target");i||(i=e.attr("href"),i=i&&/#/.test(i)&&i.replace(/.*(?=#[^\s]*$)/,""));var a;try{a=i&&t(i)}catch(o){}return a&&a.length?a:e.parent()}var a="zui.dropdown",o=".dropdown-backdrop",n="[data-toggle=dropdown]",s=function(e){t(e).on("click."+a,this.toggle)};s.prototype.toggle=function(o){var n=t(this);if(!n.is(".disabled, :disabled")){var s=i(n),r=s.hasClass("open");if(e(),!r){if("ontouchstart"in document.documentElement&&!s.closest(".navbar-nav").length&&t('<div class="dropdown-backdrop"/>').insertAfter(t(this)).on("click",e),s.trigger(o=t.Event("show."+a)),o.isDefaultPrevented())return;s.toggleClass("open").trigger("shown."+a),n.focus()}return!1}},s.prototype.keydown=function(e){if(/(38|40|27)/.test(e.keyCode)){var a=t(this);if(e.preventDefault(),e.stopPropagation(),!a.is(".disabled, :disabled")){var o=i(a),s=o.hasClass("open");if(!s||s&&27==e.keyCode)return 27==e.which&&o.find(n).focus(),a.click();var r=t("[role=menu] li:not(.divider):visible a",o);if(r.length){var l=r.index(r.filter(":focus"));38==e.keyCode&&l>0&&l--,40==e.keyCode&&l<r.length-1&&l++,~l||(l=0),r.eq(l).focus()}}}};var r=t.fn.dropdown;t.fn.dropdown=function(e){return this.each(function(){var i=t(this),a=i.data("dropdown");a||i.data("dropdown",a=new s(this)),"string"==typeof e&&a[e].call(i)})},t.fn.dropdown.Constructor=s,t.fn.dropdown.noConflict=function(){return t.fn.dropdown=r,this};var l=a+".data-api";t(document).on("click."+l,e).on("click."+l,".dropdown form,.not-clear-menu",function(t){t.stopPropagation()}).on("click."+l,n,s.prototype.toggle).on("keydown."+l,n+", [role=menu]",s.prototype.keydown)}(window.jQuery),+function(t,e){"use strict";function i(e,i,n){return this.each(function(){var s=t(this),r=s.data(a),l=t.extend({},o.DEFAULTS,s.data(),"object"==typeof e&&e);r||s.data(a,r=new o(this,l)),"string"==typeof e?r[e](i,n):l.show&&r.show(i,n)})}var a="zui.modal",o=function(i,o){var n=this;n.options=o,n.$body=t(document.body),n.$element=t(i),n.$backdrop=n.isShown=null,n.scrollbarWidth=0,o.moveable===e&&(n.options.moveable=n.$element.hasClass("modal-moveable")),o.remote&&n.$element.find(".modal-content").load(o.remote,function(){n.$element.trigger("loaded."+a)}),o.scrollInside&&t(window).on("resize."+a,function(){n.isShown&&n.adjustPosition(e,100)})};o.VERSION="3.2.0",o.TRANSITION_DURATION=300,o.BACKDROP_TRANSITION_DURATION=150,o.DEFAULTS={backdrop:!0,keyboard:!0,show:!0,position:"fit"};var n=function(e,i){var a=t(window);i.left=Math.max(0,Math.min(i.left,a.width()-e.outerWidth())),i.top=Math.max(0,Math.min(i.top,a.height()-e.outerHeight())),e.css(i)};o.prototype.toggle=function(t,e){return this.isShown?this.hide():this.show(t,e)},o.prototype.adjustPosition=function(i,o){var s=this;if(clearTimeout(s.reposTask),o)return void(s.reposTask=setTimeout(s.adjustPosition.bind(s,i,0),o));var r=s.options;if(i===e&&(i=r.position),i!==e&&null!==i){"function"==typeof i&&(i=i(s));var l=s.$element.find(".modal-dialog"),d=t(window).height(),c={maxHeight:"initial",overflow:"visible"},h=l.find(".modal-body").css(c);if(r.scrollInside&&h.length){var u=r.headerHeight,p=r.footerHeight,f=l.find(".modal-header"),g=l.find(".modal-footer");"number"!=typeof u&&(u=f.length?f.outerHeight():"function"==typeof u?u(f):0),"number"!=typeof p&&(p=g.length?g.outerHeight():"function"==typeof p?p(g):0),c.maxHeight=d-u-p,c.overflow=h[0].scrollHeight>c.maxHeight?"auto":"visible",h.css(c)}var m=Math.max(0,(d-l.outerHeight())/2);if("fit"===i?i={top:m>50?Math.floor(2*m/3):m}:"center"===i?i={top:m}:t.isPlainObject(i)||(i={top:i}),l.hasClass("modal-moveable")){var v=null,b=r.rememberPos;b&&(b===!0?v=s.$element.data("modal-pos"):t.zui.store&&(v=t.zui.store.pageGet(a+".rememberPos."+b))),i=t.extend(i,{left:Math.max(0,(t(window).width()-l.outerWidth())/2)},v),"inside"===r.moveable?n(l,i):l.css(i)}else l.css(i)}},o.prototype.setMoveable=function(){t.fn.draggable||console.error("Moveable modal requires draggable.js.");var e=this,i=e.options,o=e.$element.find(".modal-dialog").removeClass("modal-dragged");o.toggleClass("modal-moveable",!!i.moveable),e.$element.data("modal-moveable-setup")||o.draggable({container:e.$element,handle:".modal-header",before:function(){var t=o.css("margin-top");t&&"0px"!==t&&o.css("top",t).css("margin-top","").addClass("modal-dragged")},finish:function(o){var n=i.rememberPos;n&&(e.$element.data("modal-pos",o.pos),t.zui.store&&n!==!0&&t.zui.store.pageSet(a+".rememberPos."+n,o.pos))},move:"inside"!==i.moveable||function(t){n(o,t)}})},o.prototype.show=function(e,i){var n=this,s=t.Event("show."+a,{relatedTarget:e});n.$element.trigger(s),n.$element.toggleClass("modal-scroll-inside",!!n.options.scrollInside),n.isShown||s.isDefaultPrevented()||(n.isShown=!0,n.options.moveable&&n.setMoveable(),n.options.backdrop!==!1&&(n.setScrollbar(),n.$body.addClass("modal-open")),n.escape(),n.$element.on("click.dismiss."+a,'[data-dismiss="modal"]',function(t){n.hide(),t.stopPropagation()}),n.backdrop(function(){var s=t.support.transition&&n.$element.hasClass("fade");n.$element.parent().length||n.$element.appendTo(n.$body),n.$element.show().scrollTop(0),s&&n.$element[0].offsetWidth,n.$element.addClass("in").attr("aria-hidden",!1),n.adjustPosition(i),n.enforceFocus();var r=t.Event("shown."+a,{relatedTarget:e});s?n.$element.find(".modal-dialog").one("bsTransitionEnd",function(){n.$element.trigger("focus").trigger(r)}).emulateTransitionEnd(o.TRANSITION_DURATION):n.$element.trigger("focus").trigger(r)}))},o.prototype.hide=function(e){e&&e.preventDefault&&e.preventDefault();var i=this;e=t.Event("hide."+a),i.$element.trigger(e),i.isShown&&!e.isDefaultPrevented()&&(i.isShown=!1,i.options.backdrop!==!1&&(i.$body.removeClass("modal-open"),i.resetScrollbar()),i.escape(),t(document).off("focusin."+a),i.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss."+a),t.support.transition&&i.$element.hasClass("fade")?i.$element.one("bsTransitionEnd",i.hideModal.bind(i)).emulateTransitionEnd(o.TRANSITION_DURATION):i.hideModal())},o.prototype.enforceFocus=function(){t(document).off("focusin."+a).on("focusin."+a,function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")}.bind(this))},o.prototype.escape=function(){this.isShown&&this.options.keyboard?t(document).on("keydown.dismiss."+a,function(i){if(27==i.which){var o=t.Event("escaping."+a),n=this.$element.triggerHandler(o,"esc");if(n!=e&&!n)return;this.hide()}}.bind(this)):this.isShown||t(document).off("keydown.dismiss."+a)},o.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$element.trigger("hidden."+a)})},o.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},o.prototype.backdrop=function(e){var i=this,n=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var s=t.support.transition&&n;if(this.$backdrop=t('<div class="modal-backdrop '+n+'" />').appendTo(this.$body),this.$element.on("mousedown.dismiss."+a,function(t){t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))}.bind(this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;s?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(o.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var r=function(){i.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",r).emulateTransitionEnd(o.BACKDROP_TRANSITION_DURATION):r()}else e&&e()},o.prototype.setScrollbar=function(){t.zui.fixBodyScrollbar()&&this.options.onSetScrollbar&&this.options.onSetScrollbar()},o.prototype.resetScrollbar=function(){t.zui.resetBodyScrollbar(),this.options.onSetScrollbar&&this.options.onSetScrollbar("")},o.prototype.measureScrollbar=function(){var t=document.createElement("div");t.className="modal-scrollbar-measure",this.$body.append(t);var e=t.offsetWidth-t.clientWidth;return this.$body[0].removeChild(t),e};var s=t.fn.modal;t.fn.modal=i,t.fn.modal.Constructor=o,t.fn.modal.noConflict=function(){return t.fn.modal=s,this},t(document).on("click."+a+".data-api",'[data-toggle="modal"]',function(e){var o=t(this),n=o.attr("href"),s=null;try{s=t(o.attr("data-target")||n&&n.replace(/.*(?=#[^\s]+$)/,""))}catch(r){return}if(s.length){var l=s.data(a)?"toggle":t.extend({remote:!/#/.test(n)&&n},s.data(),o.data());o.is("a")&&e.preventDefault(),s.one("show."+a,function(t){t.isDefaultPrevented()||s.one("hidden."+a,function(){o.is(":visible")&&o.trigger("focus")})}),i.call(s,l,this,o.data("position"))}})}(jQuery,void 0),function(t,e,i){"use strict";if(!t.fn.modal)throw new Error("Modal trigger requires modal.js");var a="zui.modaltrigger",o="ajax",n=".zui.modal",s="string",r=function(e,i){e=t.extend({},r.DEFAULTS,t.ModalTriggerDefaults,i?i.data():null,e),this.isShown,this.$trigger=i,this.options=e,this.id=t.zui.uuid(),e.show&&this.show()};r.DEFAULTS={type:"custom",height:"auto",name:"triggerModal",fade:!0,position:"fit",showHeader:!0,delay:0,backdrop:!0,keyboard:!0,waittime:0,loadingIcon:"icon-spinner-indicator",scrollInside:!1},r.prototype.initOptions=function(i){if(i.url&&(!i.type||i.type!=o&&"iframe"!=i.type)&&(i.type=o),i.remote)i.type=o,typeof i.remote===s&&(i.url=i.remote);else if(i.iframe)i.type="iframe",typeof i.iframe===s&&(i.url=i.iframe);else if(i.custom&&(i.type="custom",typeof i.custom===s)){var a;try{a=t(i.custom)}catch(n){}a&&a.length?i.custom=a:"function"==typeof e[i.custom]&&(i.custom=e[i.custom])}return i},r.prototype.init=function(e){var i=this,o=t("#"+e.name);o.length&&(i.isShown||o.off(n),o.remove()),o=t('<div id="'+e.name+'" class="modal modal-trigger '+(e.className||"")+'">'+("string"==typeof e.loadingIcon&&0===e.loadingIcon.indexOf("icon-")?'<div class="icon icon-spin loader '+e.loadingIcon+'"></div>':e.loadingIcon)+'<div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button class="close" data-dismiss="modal">×</button><h4 class="modal-title"><i class="modal-icon"></i> <span class="modal-title-name"></span></h4></div><div class="modal-body"></div></div></div></div>').appendTo("body").data(a,i);var s=function(t,i,a){a=a||e[t],"function"==typeof a&&o.on(i+n,a)};s("onShow","show"),s("shown","shown"),s("onHide","hide",function(t){if("iframe"===e.type&&i.$iframeBody){var a=i.$iframeBody.triggerHandler("modalhide"+n,[i]);a===!1&&t.preventDefault()}var o=e.onHide;if(o)return o(t)}),s("hidden","hidden"),s("loaded","loaded"),o.on("shown"+n,function(){i.isShown=!0}).on("hidden"+n,function(){i.isShown=!1}),this.$modal=o,this.$dialog=o.find(".modal-dialog"),e.mergeOptions&&(this.options=e)},r.prototype.show=function(i){var n=this,l=t.extend({},r.DEFAULTS,n.options,{url:n.$trigger?n.$trigger.attr("href")||n.$trigger.attr("data-url")||n.$trigger.data("url"):n.options.url},i),d=n.isShown;l=n.initOptions(l),d||n.init(l);var c=n.$modal,h=c.find(".modal-dialog"),u=l.custom,p=h.find(".modal-body").css("padding","").toggleClass("load-indicator loading",!!d),f=h.find(".modal-header"),g=h.find(".modal-content");c.toggleClass("fade",l.fade).addClass(l.className).toggleClass("modal-loading",!d).toggleClass("modal-scroll-inside",!!l.scrollInside),h.toggleClass("modal-md","md"===l.size).toggleClass("modal-sm","sm"===l.size).toggleClass("modal-lg","lg"===l.size).toggleClass("modal-fullscreen","fullscreen"===l.size),f.toggle(l.showHeader),f.find(".modal-icon").attr("class","modal-icon icon-"+l.icon),f.find(".modal-title-name").text(l.title||""),l.size&&"fullscreen"===l.size&&(l.width="",l.height="");var m=function(){clearTimeout(this.resizeTask),this.resizeTask=setTimeout(function(){n.adjustPosition(l.position)},100)},v=function(t,e){return"undefined"==typeof t&&(t=l.delay),setTimeout(function(){h=c.find(".modal-dialog"),l.width&&"auto"!=l.width&&h.css("width",l.width),l.height&&"auto"!=l.height&&(h.css("height",l.height),"iframe"===l.type&&p.css("height",h.height()-f.outerHeight())),n.adjustPosition(l.position),c.removeClass("modal-loading").removeClass("modal-updating"),d&&p.removeClass("loading"),"iframe"!=l.type&&(p=h.off("resize."+a).find(".modal-body").off("resize."+a),l.scrollInside&&(p=p.children().off("resize."+a)),(p.length?p:h).on("resize."+a,m)),e&&e()},t)};if("custom"===l.type&&u)if("function"==typeof u){var b=u({modal:c,options:l,modalTrigger:n,ready:v});typeof b===s&&(p.html(b),v())}else u instanceof t?(p.html(t("<div>").append(u.clone()).html()),v()):(p.html(u),v());else if(l.url){var y=function(){var t=c.callComEvent(n,"broken");"string"==typeof t&&p.html(t),v()};if(c.attr("ref",l.url),"iframe"===l.type){c.addClass("modal-iframe"),this.firstLoad=!0;var w="iframe-"+l.name;f.detach(),p.detach(),g.empty().append(f).append(p),p.css("padding",0).html('<iframe id="'+w+'" name="'+w+'" src="'+l.url+'" frameborder="no"  allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"  allowtransparency="true" scrolling="auto" style="width: 100%; height: 100%; left: 0px;"></iframe>'),l.waittime>0&&(n.waitTimeout=v(l.waittime,y));var _=document.getElementById(w);_.onload=_.onreadystatechange=function(i){var o=!!l.scrollInside;if(n.firstLoad&&c.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){n.firstLoad=!1,l.waittime>0&&clearTimeout(n.waitTimeout);try{c.attr("ref",_.contentWindow.location.href);var s=e.frames[w].$;if(s&&"auto"===l.height&&"fullscreen"!=l.size){var r=s("body").addClass("body-modal").toggleClass("body-modal-scroll-inside",o);n.$iframeBody=r,l.iframeBodyClass&&r.addClass(l.iframeBodyClass);var d=[],h=function(i){c.removeClass("fade");var a=r.outerHeight();if(i===!0&&l.onlyIncreaseHeight&&(a=Math.max(a,p.data("minModalHeight")||0),p.data("minModalHeight",a)),o){var n=l.headerHeight;"number"!=typeof n?n=f.outerHeight():"function"==typeof n&&(n=n(f));var s=t(e).height();a=Math.min(a,s-n)}for(d.length>1&&a===d[0]&&(a=Math.max(a,d[1])),d.push(a);d.length>2;)d.shift();p.css("height",a),l.fade&&c.addClass("fade"),v()};c.callComEvent(n,"loaded",{modalType:"iframe",jQuery:s}),setTimeout(h,100),r.off("resize."+a).on("resize."+a,h),o&&t(e).off("resize."+a).on("resize."+a,h)}else v();var u=l.handleLinkInIframe;u&&s("body").on("click","string"==typeof u?u:"a[href]",function(){t(this).is('[data-toggle="modal"]')||c.addClass("modal-updating")}),l.iframeStyle&&s("head").append("<style>"+l.iframeStyle+"</style>")}catch(i){v()}}}}else t.ajax(t.extend({url:l.url,success:function(i){try{var s=t(i);s.filter(".modal-dialog").length?h.parent().empty().append(s):s.filter(".modal-content").length?h.find(".modal-content").replaceWith(s):p.wrapInner(s)}catch(r){e.console&&e.console.warn&&console.warn("ZUI: Cannot recogernize remote content.",{error:r,data:i}),c.html(i)}c.callComEvent(n,"loaded",{modalType:o}),v(),l.scrollInside&&t(e).off("resize."+a).on("resize."+a,m)},error:y},l.ajaxOptions))}d||c.modal({show:"show",backdrop:l.backdrop,moveable:l.moveable,rememberPos:l.rememberPos,
keyboard:l.keyboard,scrollInside:l.scrollInside})},r.prototype.close=function(t,i){var a=this;(t||i)&&a.$modal.on("hidden"+n,function(){"function"==typeof t&&t(),typeof i===s&&i.length&&!a.$modal.data("cancel-reload")&&("this"===i?e.location.reload():e.location=i)}),a.$modal.modal("hide")},r.prototype.toggle=function(t){this.isShown?this.close():this.show(t)},r.prototype.adjustPosition=function(t){t=t===i?this.options.position:t,"function"==typeof t&&(t=t(this)),this.$modal.modal("adjustPosition",t)},t.zui({ModalTrigger:r,modalTrigger:new r}),t.fn.modalTrigger=function(e,i){return t(this).each(function(){var o=t(this),n=o.data(a),l=t.extend({title:o.attr("title")||o.text(),url:o.attr("href"),type:o.hasClass("iframe")?"iframe":""},o.data(),t.isPlainObject(e)&&e);return n?void(typeof e==s?n[e](i):l.show&&n.show(i)):(o.data(a,n=new r(l,o)),void o.on((l.trigger||"click")+".toggle."+a,function(e){l=t.extend(l,{url:o.attr("href")||o.attr("data-url")||o.data("url")||l.url}),n.toggle(l),o.is("a")&&e.preventDefault()}))})};var l=t.fn.modal;t.fn.modal=function(e,i){return t(this).each(function(){var a=t(this);a.hasClass("modal")?l.call(a,e,i):a.modalTrigger(e,i)})},t.fn.modal.bs=l;var d=function(e){return e?e=t(e):(e=t(".modal.modal-trigger"),!e.length),e&&e instanceof t?e:null},c=function(i,o,n){var s=i;if("function"==typeof i){var r=n;n=o,o=i,i=r}i=d(i),i&&i.length?i.each(function(){t(this).data(a).close(o,n)}):t("body").hasClass("modal-open")||t(".modal.in").length||t("body").hasClass("body-modal")&&e.parent.$.zui.closeModal(s,o,n)},h=function(t,e){e=d(e),e&&e.length&&e.modal("adjustPosition",t)},u=function(e,i){"string"==typeof e&&(e={url:e});var o=d(i);o&&o.length&&o.each(function(){t(this).data(a).show(e)})};t.zui({reloadModal:u,closeModal:c,ajustModalPosition:h,adjustModalPosition:h}),t(document).on("click."+a+".data-api",'[data-toggle="modal"]',function(e){var i=t(this),o=i.attr("href"),n=null;try{n=t(i.attr("data-target")||o&&o.replace(/.*(?=#[^\s]+$)/,""))}catch(s){}n&&n.length||(i.data(a)?i.trigger(".toggle."+a):i.modalTrigger({show:!0})),i.is("a")&&e.preventDefault()}).on("click."+a+".data-api",'[data-dismiss="modal"]',function(){t.zui.closeModal()})}(window.jQuery,window,void 0),+function(t){"use strict";var e=function(t,e){this.type=null,this.options=null,this.enabled=null,this.timeout=null,this.hoverState=null,this.$element=null,this.init("tooltip",t,e)};e.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},e.prototype.init=function(e,i,a){this.enabled=!0,this.type=e,this.$element=t(i),this.options=this.getOptions(a);for(var o=this.options.trigger.split(" "),n=o.length;n--;){var s=o[n];if("click"==s)this.$element.on("click."+this.type,this.options.selector,this.toggle.bind(this));else if("manual"!=s){var r="hover"==s?"mouseenter":"focus",l="hover"==s?"mouseleave":"blur";this.$element.on(r+"."+this.type,this.options.selector,this.enter.bind(this)),this.$element.on(l+"."+this.type,this.options.selector,this.leave.bind(this))}}this.options.selector?this._options=t.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.getOptions=function(e){return e=t.extend({},this.getDefaults(),this.$element.data(),e),e.delay&&"number"==typeof e.delay&&(e.delay={show:e.delay,hide:e.delay}),e},e.prototype.getDelegateOptions=function(){var e={},i=this.getDefaults();return this._options&&t.each(this._options,function(t,a){i[t]!=a&&(e[t]=a)}),e},e.prototype.enter=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="in",i.options.delay&&i.options.delay.show?void(i.timeout=setTimeout(function(){"in"==i.hoverState&&i.show()},i.options.delay.show)):i.show()},e.prototype.leave=function(e){var i=e instanceof this.constructor?e:t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type);return clearTimeout(i.timeout),i.hoverState="out",i.options.delay&&i.options.delay.hide?void(i.timeout=setTimeout(function(){"out"==i.hoverState&&i.hide()},i.options.delay.hide)):i.hide()},e.prototype.show=function(e){var i=t.Event("show.zui."+this.type);if((e||this.hasContent())&&this.enabled){var a=this;if(a.$element.trigger(i),i.isDefaultPrevented())return;var o=a.tip();a.setContent(e),a.options.animation&&o.addClass("fade");var n="function"==typeof a.options.placement?a.options.placement.call(a,o[0],a.$element[0]):a.options.placement,s=/\s?auto?\s?/i,r=s.test(n);r&&(n=n.replace(s,"")||"top"),o.detach().css({top:0,left:0,display:"block"}).addClass(n),a.options.container?o.appendTo(a.options.container):o.insertAfter(a.$element);var l=a.getPosition(),d=o[0].offsetWidth,c=o[0].offsetHeight;if(r){var h=a.$element.parent(),u=n,p=document.documentElement.scrollTop||document.body.scrollTop,f="body"==a.options.container?window.innerWidth:h.outerWidth(),g="body"==a.options.container?window.innerHeight:h.outerHeight(),m="body"==a.options.container?0:h.offset().left;n="bottom"==n&&l.top+l.height+c-p>g?"top":"top"==n&&l.top-p-c<0?"bottom":"right"==n&&l.right+d>f?"left":"left"==n&&l.left-d<m?"right":n,o.removeClass(u).addClass(n)}var v=a.getCalculatedOffset(n,l,d,c);a.applyPlacement(v,n);var b=function(){var t=a.hoverState;a.$element.trigger("shown.zui."+a.type),a.hoverState=null,"out"==t&&a.leave(a)};t.support.transition&&a.$tip.hasClass("fade")?o.one("bsTransitionEnd",b).emulateTransitionEnd(150):b()}},e.prototype.applyPlacement=function(t,e){var i,a=this.tip(),o=a[0].offsetWidth,n=a[0].offsetHeight,s=parseInt(a.css("margin-top"),10),r=parseInt(a.css("margin-left"),10);isNaN(s)&&(s=0),isNaN(r)&&(r=0),t.top=t.top+s,t.left=t.left+r,a.offset(t).addClass("in");var l=a[0].offsetWidth,d=a[0].offsetHeight;if("top"==e&&d!=n&&(i=!0,t.top=t.top+n-d),/bottom|top/.test(e)){var c=0;t.left<0&&(c=t.left*-2,t.left=0,a.offset(t),l=a[0].offsetWidth,d=a[0].offsetHeight),this.replaceArrow(c-o+l,l,"left")}else this.replaceArrow(d-n,d,"top");i&&a.offset(t)},e.prototype.replaceArrow=function(t,e,i){this.arrow().css(i,t?50*(1-t/e)+"%":"")},e.prototype.setContent=function(t){var e=this.tip(),i=t||this.getTitle();this.options.tipId&&e.attr("id",this.options.tipId),this.options.tipClass&&e.addClass(this.options.tipClass),e.find(".tooltip-inner")[this.options.html?"html":"text"](i),e.removeClass("fade in top bottom left right")},e.prototype.hide=function(){function e(){"in"!=i.hoverState&&a.detach()}var i=this,a=this.tip(),o=t.Event("hide.zui."+this.type);if(this.$element.trigger(o),!o.isDefaultPrevented())return a.removeClass("in"),t.support.transition&&this.$tip.hasClass("fade")?a.one(t.support.transition.end,e).emulateTransitionEnd(150):e(),this.$element.trigger("hidden.zui."+this.type),this},e.prototype.fixTitle=function(){var t=this.$element;(t.attr("title")||"string"!=typeof t.attr("data-original-title"))&&t.attr("data-original-title",t.attr("title")||"").attr("title","")},e.prototype.hasContent=function(){return this.getTitle()},e.prototype.getPosition=function(){var e=this.$element[0];return t.extend({},"function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{width:e.offsetWidth,height:e.offsetHeight},this.$element.offset())},e.prototype.getCalculatedOffset=function(t,e,i,a){return"bottom"==t?{top:e.top+e.height,left:e.left+e.width/2-i/2}:"top"==t?{top:e.top-a,left:e.left+e.width/2-i/2}:"left"==t?{top:e.top+e.height/2-a/2,left:e.left-i}:{top:e.top+e.height/2-a/2,left:e.left+e.width}},e.prototype.getTitle=function(){var t,e=this.$element,i=this.options;return t=e.attr("data-original-title")||("function"==typeof i.title?i.title.call(e[0]):i.title)},e.prototype.tip=function(){return this.$tip=this.$tip||t(this.options.template)},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},e.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},e.prototype.enable=function(){this.enabled=!0},e.prototype.disable=function(){this.enabled=!1},e.prototype.toggleEnabled=function(){this.enabled=!this.enabled},e.prototype.toggle=function(e){var i=e?t(e.currentTarget)[this.type](this.getDelegateOptions()).data("zui."+this.type):this;i.tip().hasClass("in")?i.leave(i):i.enter(i)},e.prototype.destroy=function(){this.hide().$element.off("."+this.type).removeData("zui."+this.type)};var i=t.fn.tooltip;t.fn.tooltip=function(i,a){return this.each(function(){var o=t(this),n=o.data("zui.tooltip"),s="object"==typeof i&&i;n||o.data("zui.tooltip",n=new e(this,s)),"string"==typeof i&&n[i](a)})},t.fn.tooltip.Constructor=e,t.fn.tooltip.noConflict=function(){return t.fn.tooltip=i,this}}(window.jQuery),+function(t){"use strict";var e=function(t,e){this.init("popover",t,e)};if(!t.fn.tooltip)throw new Error("Popover requires tooltip.js");e.DEFAULTS=t.extend({},t.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),e.prototype=t.extend({},t.fn.tooltip.Constructor.prototype),e.prototype.constructor=e,e.prototype.getDefaults=function(){return e.DEFAULTS},e.prototype.setContent=function(){var t=this.tip(),e=this.getTarget();if(e)return e.find(".arrow").length<1&&t.addClass("no-arrow"),void t.html(e.html());var i=this.getTitle(),a=this.getContent();t.find(".popover-title")[this.options.html?"html":"text"](i),t.find(".popover-content")[this.options.html?"html":"text"](a),t.removeClass("fade top bottom left right in"),this.options.tipId&&t.attr("id",this.options.tipId),this.options.tipClass&&t.addClass(this.options.tipClass),t.find(".popover-title").html()||t.find(".popover-title").hide()},e.prototype.hasContent=function(){return this.getTarget()||this.getTitle()||this.getContent()},e.prototype.getContent=function(){var t=this.$element,e=this.options;return t.attr("data-content")||("function"==typeof e.content?e.content.call(t[0]):e.content)},e.prototype.getTarget=function(){var e=this.$element,i=this.options,a=e.attr("data-target")||("function"==typeof i.target?i.target.call(e[0]):i.target);return!!a&&("$next"==a?e.next(".popover"):t(a))},e.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},e.prototype.tip=function(){return this.$tip||(this.$tip=t(this.options.template)),this.$tip};var i=t.fn.popover;t.fn.popover=function(i){return this.each(function(){var a=t(this),o=a.data("zui.popover"),n="object"==typeof i&&i;o||a.data("zui.popover",o=new e(this,n)),"string"==typeof i&&o[i]()})},t.fn.popover.Constructor=e,t.fn.popover.noConflict=function(){return t.fn.popover=i,this}}(window.jQuery),/*! TangBin: image.ready.js http://www.planeart.cn/?p=1121 */
function(t){"use strict";t.zui.imgReady=function(){var t=[],e=null,i=function(){for(var e=0;e<t.length;e++)t[e].end?t.splice(e--,1):t[e]();!t.length&&a()},a=function(){clearInterval(e),e=null};return function(a,o,n,s){var r,l,d,c,h,u=new Image;return u.src=a,u.complete?(o.call(u),void(n&&n.call(u))):(l=u.width,d=u.height,u.onerror=function(){s&&s.call(u),r.end=!0,u=u.onload=u.onerror=null},r=function(){c=u.width,h=u.height,(c!==l||h!==d||c*h>1024)&&(o.call(u),r.end=!0)},r(),u.onload=function(){!r.end&&r(),n&&n.call(u),u=u.onload=u.onerror=null},void(r.end||(t.push(r),null===e&&(e=setInterval(i,40)))))}}()}(jQuery),function(t,e,i){"use strict";if(!t.fn.modalTrigger)throw new Error("modal & modalTrigger requires for lightbox");if(!t.zui.imgReady)throw new Error("imgReady requires for lightbox");var a=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};a.DEFAULTS={modalTeamplate:'<div class="icon-spinner icon-spin loader"></div><div class="modal-dialog"><button class="close" data-dismiss="modal" aria-hidden="true"><i class="icon-remove"></i></button><button class="controller prev"><i class="icon icon-chevron-left"></i></button><button class="controller next"><i class="icon icon-chevron-right"></i></button><img class="lightbox-img" src="{image}" alt="" data-dismiss="modal" /><div class="caption"><div class="content">{caption}<div></div></div>'},a.prototype.getOptions=function(e){var i="image";return e=t.extend({},a.DEFAULTS,this.$.data(),e),e[i]||(e[i]=this.$.attr("src")||this.$.attr("href")||this.$.find("img").attr("src"),this.$.data(i,e[i])),e},a.prototype.init=function(){this.bindEvents()},a.prototype.initGroups=function(){var e=this.$.data("groups");e||(e=t('[data-toggle="lightbox"][data-group="'+this.options.group+'"], [data-lightbox-group="'+this.options.group+'"]'),this.$.data("groups",e),e.each(function(e){t(this).attr("data-group-index",e)})),this.groups=e,this.groupIndex=parseInt(this.$.data("group-index"))},a.prototype.setImage=function(t,e){void 0!==t&&(this.options.image=t),void 0!==e&&(this.options.caption=e)},a.prototype.show=function(t,e){this.setImage(t,e),this.$.triggerHandler("click")},a.prototype.bindEvents=function(){var a=this.$,o=this,n=this.options;return!!n.image&&void a.modalTrigger({type:"custom",name:"lightboxModal",position:"center",custom:function(a){o.initGroups();var s=a.modal,r=o.groups,l=o.groupIndex;s.addClass("modal-lightbox").html(n.modalTeamplate.format(n)).toggleClass("lightbox-with-caption","string"==typeof n.caption).removeClass("lightbox-full").data("group-index",l);var d=s.find(".modal-dialog"),c=t(e).width();t.zui.imgReady(n.image,function(){d.css({width:i.min(c,this.width)}),c<this.width+30&&s.addClass("lightbox-full"),a.ready(200)}),s.find(".prev").toggleClass("show",r.filter('[data-group-index="'+(l-1)+'"]').length>0),s.find(".next").toggleClass("show",r.filter('[data-group-index="'+(l+1)+'"]').length>0),s.find(".controller").click(function(){var o=t(this),n=s.data("group-index")+(o.hasClass("prev")?-1:1),l=r.filter('[data-group-index="'+n+'"]');if(l.length){var h=l.data("image"),u=l.data("caption");s.addClass("modal-loading").data("group-index",n).toggleClass("lightbox-with-caption","string"==typeof u).removeClass("lightbox-full"),s.find(".lightbox-img").attr("src",h),s.find(".caption > .content").text(u),c=t(e).width(),t.zui.imgReady(h,function(){d.css({width:i.min(c,this.width)}),c<this.width+30&&s.addClass("lightbox-full"),a.ready()})}return s.find(".prev").toggleClass("show",r.filter('[data-group-index="'+(n-1)+'"]').length>0),s.find(".next").toggleClass("show",r.filter('[data-group-index="'+(n+1)+'"]').length>0),!1})}})},t.fn.lightbox=function(e){var i="group"+(new Date).getTime();return this.each(function(){var o=t(this),n="object"==typeof e&&e;"object"==typeof n&&n.group?o.attr("data-lightbox-group",n.group):o.data("group")?o.attr("data-lightbox-group",o.data("group")):o.attr("data-lightbox-group",i),o.data("group",o.data("lightbox-group"));var s=o.data("zui.lightbox");s||o.data("zui.lightbox",s=new a(this,n)),"string"==typeof e&&s[e]()})},t.fn.lightbox.Constructor=a,t(function(){t('[data-toggle="lightbox"]').lightbox()})}(jQuery,window,Math),/*! bootbox.js v4.4.0 http://bootboxjs.com/license.txt */
function(t,e){"use strict";"function"==typeof define&&define.amd?define(["jquery"],e):"object"==typeof exports?module.exports=e(require("jquery")):t.bootbox=e(t.jQuery)}(this,function t(e,i){"use strict";function a(t){var i=e.zui&&e.zui.getLangData?e.zui.getLangData("bootbox",f.locale,m):m[f.locale];return i?i[t]:m.en[t]}function o(t,e,i){t.stopPropagation(),t.preventDefault();var a="function"==typeof i&&i.call(e,t)===!1;a||e.modal("hide")}function n(t){var e,i=0;for(e in t)i++;return i}function s(t,i){var a=0;e.each(t,function(t,e){i(t,e,a++)})}function r(t){var i,a;if("object"!=typeof t)throw new Error("Please supply an object of options");if(!t.message)throw new Error("Please specify a message");return t=e.extend({},f,t),t.buttons||(t.buttons={}),i=t.buttons,a=n(i),s(i,function(t,o,n){if("function"==typeof o&&(o=i[t]={callback:o}),"object"!==e.type(o))throw new Error("button with key "+t+" must be an object");o.label||(o.label=t),o.className||(2===a&&("ok"===t||"confirm"===t)||1===a?o.className="btn-primary":o.className="btn-default")}),t}function l(t,e){var i=t.length,a={};if(i<1||i>2)throw new Error("Invalid argument length");return 2===i||"string"==typeof t[0]?(a[e[0]]=t[0],a[e[1]]=t[1]):a=t[0],a}function d(t,i,a){return e.extend(!0,{},t,l(i,a))}function c(t,e,i,a){var o={className:"bootbox-"+t,buttons:h.apply(null,e)};return u(d(o,a,i),e)}function h(){for(var t={},e=0,i=arguments.length;e<i;e++){var o=arguments[e],n=o.toLowerCase(),s=o.toUpperCase();t[n]={label:a(s)}}return t}function u(t,e){var a={};return s(e,function(t,e){a[e]=!0}),s(t.buttons,function(t){if(a[t]===i)throw new Error("button key "+t+" is not allowed (options are "+e.join("\n")+")")}),t}var p={dialog:"<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'></div></div></div></div></div>",header:"<div class='modal-header'><h4 class='modal-title'></h4></div>",footer:"<div class='modal-footer'></div>",closeButton:"<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>&times;</button>",form:"<form class='bootbox-form'></form>",inputs:{text:"<input class='bootbox-input bootbox-input-text form-control' autocomplete=off type=text />",textarea:"<textarea class='bootbox-input bootbox-input-textarea form-control'></textarea>",email:"<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />",select:"<select class='bootbox-input bootbox-input-select form-control'></select>",checkbox:"<div class='checkbox'><label><input class='bootbox-input bootbox-input-checkbox' type='checkbox' /></label></div>",date:"<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />",time:"<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />",number:"<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />",password:"<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password' />"}},f={locale:e.zui&&e.zui.clientLang?e.zui.clientLang():"en",backdrop:"static",animate:!0,className:null,closeButton:!0,show:!0,container:"body"},g={};g.alert=function(){var t;if(t=c("alert",["ok"],["message","callback"],arguments),t.callback&&"function"!=typeof t.callback)throw new Error("alert requires callback property to be a function when provided");return t.buttons.ok.callback=t.onEscape=function(){return"function"!=typeof t.callback||t.callback.call(this)},g.dialog(t)},g.confirm=function(){var t;if(t=c("confirm",["confirm","cancel"],["message","callback"],arguments),t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,!1)},t.buttons.confirm.callback=function(){return t.callback.call(this,!0)},"function"!=typeof t.callback)throw new Error("confirm requires a callback");return g.dialog(t)},g.prompt=function(){var t,a,o,n,r,l,c;if(n=e(p.form),a={className:"bootbox-prompt",buttons:h("cancel","confirm"),value:"",inputType:"text"},t=u(d(a,arguments,["title","callback"]),["confirm","cancel"]),l=t.show===i||t.show,t.message=n,t.buttons.cancel.callback=t.onEscape=function(){return t.callback.call(this,null)},t.buttons.confirm.callback=function(){var i;switch(t.inputType){case"text":case"textarea":case"email":case"select":case"date":case"time":case"number":case"password":i=r.val();break;case"checkbox":var a=r.find("input:checked");i=[],s(a,function(t,a){i.push(e(a).val())})}return t.callback.call(this,i)},t.show=!1,!t.title)throw new Error("prompt requires a title");if("function"!=typeof t.callback)throw new Error("prompt requires a callback");if(!p.inputs[t.inputType])throw new Error("invalid prompt type");switch(r=e(p.inputs[t.inputType]),t.inputType){case"text":case"textarea":case"email":case"date":case"time":case"number":case"password":r.val(t.value);break;case"select":var f={};if(c=t.inputOptions||[],!Array.isArray(c))throw new Error("Please pass an array of input options");if(!c.length)throw new Error("prompt with select requires options");s(c,function(t,a){var o=r;if(a.value===i||a.text===i)throw new Error("given options in wrong format");a.group&&(f[a.group]||(f[a.group]=e("<optgroup/>").attr("label",a.group)),o=f[a.group]),o.append("<option value='"+a.value+"'>"+a.text+"</option>")}),s(f,function(t,e){r.append(e)}),r.val(t.value);break;case"checkbox":var m=Array.isArray(t.value)?t.value:[t.value];if(c=t.inputOptions||[],!c.length)throw new Error("prompt with checkbox requires options");if(!c[0].value||!c[0].text)throw new Error("given options in wrong format");r=e("<div/>"),s(c,function(i,a){var o=e(p.inputs[t.inputType]);o.find("input").attr("value",a.value),o.find("label").append(a.text),s(m,function(t,e){e===a.value&&o.find("input").prop("checked",!0)}),r.append(o)})}return t.placeholder&&r.attr("placeholder",t.placeholder),t.pattern&&r.attr("pattern",t.pattern),t.maxlength&&r.attr("maxlength",t.maxlength),n.append(r),n.on("submit",function(t){t.preventDefault(),t.stopPropagation(),o.find(".btn-primary").click()}),o=g.dialog(t),o.off("shown.zui.modal"),o.on("shown.zui.modal",function(){r.focus()}),l===!0&&o.modal("show"),o},g.dialog=function(t){t=r(t);var a=e(p.dialog),n=a.find(".modal-dialog"),l=a.find(".modal-body"),d=t.buttons,c="",h={onEscape:t.onEscape};if(e.fn.modal===i)throw new Error("$.fn.modal is not defined; please double check you have included the Bootstrap JavaScript library. See http://getbootstrap.com/javascript/ for more details.");if(s(d,function(t,e){c+="<button data-bb-handler='"+t+"' type='button' class='btn "+e.className+"'>"+e.label+"</button>",h[t]=e.callback}),l.find(".bootbox-body").html(t.message),t.animate===!0&&a.addClass("fade"),t.className&&a.addClass(t.className),"large"===t.size?n.addClass("modal-lg"):"small"===t.size&&n.addClass("modal-sm"),t.title&&l.before(p.header),t.closeButton){var u=e(p.closeButton);t.title?a.find(".modal-header").prepend(u):u.css("margin-top","-10px").prependTo(l)}return t.title&&a.find(".modal-title").html(t.title),c.length&&(l.after(p.footer),a.find(".modal-footer").html(c)),a.on("hidden.zui.modal",function(t){t.target===this&&a.remove()}),a.on("shown.zui.modal",function(){a.find(".btn-primary:first").focus()}),"static"!==t.backdrop&&a.on("click.dismiss.zui.modal",function(t){a.children(".modal-backdrop").length&&(t.currentTarget=a.children(".modal-backdrop").get(0)),t.target===t.currentTarget&&a.trigger("escape.close.bb")}),a.on("escape.close.bb",function(t){h.onEscape&&o(t,a,h.onEscape)}),a.on("click",".modal-footer button",function(t){var i=e(this).data("bb-handler");o(t,a,h[i])}),a.on("click",".bootbox-close-button",function(t){o(t,a,h.onEscape)}),a.on("keyup",function(t){27===t.which&&a.trigger("escape.close.bb")}),e(t.container).append(a),a.modal({backdrop:!!t.backdrop&&"static",keyboard:!1,show:!1}),t.show&&a.modal("show"),a},g.setDefaults=function(){var t={};2===arguments.length?t[arguments[0]]=arguments[1]:t=arguments[0],e.extend(f,t)},g.hideAll=function(){return e(".bootbox").modal("hide"),g};var m={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"Confirm"},zh_cn:{OK:"确认",CANCEL:"取消",CONFIRM:"确认"},zh_tw:{OK:"確認",CANCEL:"取消",CONFIRM:"確認"}};return g.addLocale=function(t,i){return e.each(["OK","CANCEL","CONFIRM"],function(t,e){if(!i[e])throw new Error("Please supply a translation for '"+e+"'")}),m[t]={OK:i.OK,CANCEL:i.CANCEL,CONFIRM:i.CONFIRM},g},g.removeLocale=function(t){return delete m[t],g},g.setLocale=function(t){return g.setDefaults("locale",t)},g.init=function(i){return t(i||e)},g}),/*!
Chosen, a Select Box Enhancer for jQuery and Prototype
by Patrick Filler for Harvest, http://getharvest.com

Version 1.1.0
Full source at https://github.com/harvesthq/chosen
Copyright (c) 2011 Harvest http://getharvest.com

MIT License, https://github.com/harvesthq/chosen/blob/master/LICENSE.md
*/
function(){var t,e,i,a,o,n={}.hasOwnProperty,s=function(t,e){function i(){this.constructor=t}for(var a in e)n.call(e,a)&&(t[a]=e[a]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},r={zh_cn:{no_results_text:"没有找到"},zh_tw:{no_results_text:"沒有找到"},en:{no_results_text:"No results match"}},l={};a=function(){function e(){this.options_index=0,this.parsed=[]}return e.prototype.add_node=function(t){return"OPTGROUP"===t.nodeName.toUpperCase()?this.add_group(t):this.add_option(t)},e.prototype.add_group=function(e){var i,a,o,n,s,r;for(i=this.parsed.length,this.parsed.push({array_index:i,group:!0,label:this.escapeExpression(e.label),children:0,disabled:e.disabled,title:e.title,search_keys:t.trim(e.getAttribute("data-keys")||"").replace(/,/g," ")}),s=e.childNodes,r=[],o=0,n=s.length;o<n;o++)a=s[o],r.push(this.add_option(a,i,e.disabled));return r},e.prototype.add_option=function(e,i,a){if("OPTION"===e.nodeName.toUpperCase())return""!==e.text?(null!=i&&(this.parsed[i].children+=1),this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,value:e.value,text:e.text,title:e.title,html:e.innerHTML,selected:e.selected,disabled:a===!0?a:e.disabled,group_array_index:i,classes:e.className,style:e.style.cssText,data:e.getAttribute("data-data"),search_keys:(t.trim(e.getAttribute("data-keys")||"")+e.value).replace(/,/," ")})):this.parsed.push({array_index:this.parsed.length,options_index:this.options_index,empty:!0}),this.options_index+=1},e.prototype.escapeExpression=function(t){var e,i;return null==t||t===!1?"":/[\&\<\>\"\'\`]/.test(t)?(e={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#x27;","`":"&#x60;"},i=/&(?!\w+;)|[\<\>\"\'\`]/g,t.replace(i,function(t){return e[t]||"&amp;"})):t},e}(),a.select_to_array=function(t){var e,i,o,n,s;for(i=new a,s=t.childNodes,o=0,n=s.length;o<n;o++)e=s[o],i.add_node(e);return i.parsed},e=function(){function e(i,a){if(this.form_field=i,this.options=t.extend({},l,null!=a?a:{}),e.browser_is_supported()){var o=this.options.lang||t.zui.clientLang?t.zui.clientLang():"en",n=t.zui.clientLang?t.zui.clientLang():"en";t.isPlainObject(o)?this.lang=t.zui.getLangData?t.zui.getLangData("chosen",n,r):t.extend(o,r.en,r[n]):this.lang=t.zui.getLangData?t.zui.getLangData("chosen",o,r):r[o||n]||r.en,this.is_multiple=this.form_field.multiple,this.set_default_text(),this.set_default_values(),this.setup(),this.set_up_html(),this.register_observers()}}return e.prototype.set_default_values=function(){var t=this,e=t.options;t.click_test_action=function(e){return t.test_active_click(e)},t.activate_action=function(e){return t.activate_field(e)},t.active_field=!1,t.mouse_on_container=!1,t.results_showing=!1,t.result_highlighted=null,t.allow_single_deselect=null!=e.allow_single_deselect&&null!=this.form_field.options[0]&&""===t.form_field.options[0].text&&e.allow_single_deselect,t.disable_search_threshold=e.disable_search_threshold||0,t.disable_search=e.disable_search||!1,t.enable_split_word_search=null==e.enable_split_word_search||e.enable_split_word_search,t.group_search=null==e.group_search||e.group_search,t.search_contains=e.search_contains||!1,t.single_backstroke_delete=null==e.single_backstroke_delete||e.single_backstroke_delete,t.max_selected_options=e.max_selected_options||1/0,t.drop_direction=e.drop_direction||"auto",t.drop_item_height=void 0!==e.drop_item_height?e.drop_item_height:25,t.max_drop_height=void 0!==e.max_drop_height?e.max_drop_height:240,t.middle_highlight=e.middle_highlight,t.compact_search=e.compact_search||!1,t.inherit_select_classes=e.inherit_select_classes||!1,t.display_selected_options=null==e.display_selected_options||e.display_selected_options,t.sort_value_splitter=e.sort_value_spliter||e.sort_value_splitter||",",t.sort_field=e.sort_field;var i=e.max_drop_width;return"string"==typeof i&&i.indexOf("px")===i.length-2&&(i=parseInt(i.substring(0,i.length-2))),t.max_drop_width=i,t.display_disabled_options=null==e.display_disabled_options||e.display_disabled_options},e.prototype.set_default_text=function(){return this.form_field.getAttribute("data-placeholder")?this.default_text=this.form_field.getAttribute("data-placeholder"):this.is_multiple?this.default_text=this.options.placeholder_text_multiple||this.options.placeholder_text||e.default_multiple_text:this.default_text=this.options.placeholder_text_single||this.options.placeholder_text||e.default_single_text,this.results_none_found=this.form_field.getAttribute("data-no_results_text")||this.options.no_results_text||this.lang.no_results_text||e.default_no_result_text},e.prototype.mouse_enter=function(){return this.mouse_on_container=!0},e.prototype.mouse_leave=function(){return this.mouse_on_container=!1},e.prototype.input_focus=function(t){var e=this;if(this.is_multiple){if(!this.active_field)return setTimeout(function(){return e.container_mousedown()},50)}else if(!this.active_field)return this.activate_field()},e.prototype.input_blur=function(t){var e=this;if(!this.mouse_on_container)return this.active_field=!1,setTimeout(function(){return e.blur_test()},100)},e.prototype.results_option_build=function(e){var i,a,o,n,s;i="",s=this.results_data;var r=e&&e.first?[]:null;for(o=0,n=s.length;o<n;o++)a=s[o],i+=a.group?this.result_add_group(a):this.result_add_option(a),r&&a.selected&&r.push(a);if(r){var l,d;if(this.sort_field&&this.is_multiple){l=t(this.sort_field);var c=l.val();if(d="string"==typeof c&&c.length?c.split(this.sort_value_splitter):[],d.length){var h={};for(o=0;o<d.length;++o)h[d[o]]=o;r.sort(function(t,e){var i=h[t.value],a=h[e.value];return void 0===i&&(i=0),void 0===a&&(a=0),i-a})}}for(d=[],o=0;o<r.length;++o)a=r[o],this.is_multiple?(this.choice_build(a),d.push(a.value)):this.single_set_selected_text(a.text);l&&l.length&&l.val(d.join(this.sort_value_splitter))}return i},e.prototype.result_add_option=function(t){var e,i;return t.search_match&&this.include_option_in_results(t)?(e=[],t.disabled||t.selected&&this.is_multiple||e.push("active-result"),!t.disabled||t.selected&&this.is_multiple||e.push("disabled-result"),t.selected&&e.push("result-selected"),null!=t.group_array_index&&e.push("group-option"),""!==t.classes&&e.push(t.classes),i=document.createElement("li"),i.className=e.join(" "),i.style.cssText=t.style,i.title=t.title,i.setAttribute("data-option-array-index",t.array_index),i.setAttribute("data-data",t.data),i.innerHTML=t.search_text,this.outerHTML(i)):""},e.prototype.result_add_group=function(t){var e;return(t.search_match||t.group_match)&&t.active_options>0?(e=document.createElement("li"),e.className="group-result",e.title=t.title,e.innerHTML=t.search_text,this.outerHTML(e)):""},e.prototype.results_update_field=function(){this.set_default_text(),this.is_multiple||this.results_reset_cleanup(),this.result_clear_highlight(),this.results_build(),this.results_showing&&(this.winnow_results(),this.autoResizeDrop())},e.prototype.reset_single_select_options=function(){var t,e,i,a,o;for(a=this.results_data,o=[],e=0,i=a.length;e<i;e++)t=a[e],t.selected?o.push(t.selected=!1):o.push(void 0);return o},e.prototype.results_toggle=function(){return this.results_showing?this.results_hide():this.results_show()},e.prototype.results_search=function(t){return this.results_showing?this.winnow_results(1):this.results_show()},e.prototype.winnow_results=function(t){var e,i,a,o,n,s,r,l,d,c,h,u,p;for(this.no_results_clear(),n=0,r=this.get_search_text(),e=r.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),o=this.search_contains?"":"^",a=new RegExp(o+e,"i"),c=new RegExp(e,"i"),p=this.results_data,h=0,u=p.length;h<u;h++)i=p[h],i.search_match=!1,s=null,this.include_option_in_results(i)&&(i.group&&(i.group_match=!1,i.active_options=0),null!=i.group_array_index&&this.results_data[i.group_array_index]&&(s=this.results_data[i.group_array_index],0===s.active_options&&s.search_match&&(n+=1),s.active_options+=1),i.group&&!this.group_search||(i.search_text=i.group?i.label:i.html,i.search_keys_match=this.search_string_match(i.search_keys,a),i.search_text_match=this.search_string_match(i.search_text,a),i.search_match=i.search_text_match||i.search_keys_match,i.search_match&&!i.group&&(n+=1),i.search_match?(i.search_text_match&&i.search_text.length?(l=i.search_text.search(c),d=i.search_text.substr(0,l+r.length)+"</em>"+i.search_text.substr(l+r.length),i.search_text=d.substr(0,l)+"<em>"+d.substr(l)):i.search_keys_match&&i.search_keys.length&&(l=i.search_keys.search(c),d=i.search_keys.substr(0,l+r.length)+"</em>"+i.search_keys.substr(l+r.length),i.search_text+='&nbsp; <small style="opacity: 0.7">'+d.substr(0,l)+"<em>"+d.substr(l)+"</small>"),null!=s&&(s.group_match=!0)):null!=i.group_array_index&&this.results_data[i.group_array_index].search_match&&(i.search_match=!0)));return this.result_clear_highlight(),n<1&&r.length?(this.update_results_content(""),this.no_results(r)):(this.update_results_content(this.results_option_build()),this.winnow_results_set_highlight(t))},e.prototype.search_string_match=function(t,e){var i,a,o,n;if(e.test(t))return!0;if(this.enable_split_word_search&&(t.indexOf(" ")>=0||0===t.indexOf("["))&&(a=t.replace(/\[|\]/g,"").split(" "),a.length))for(o=0,n=a.length;o<n;o++)if(i=a[o],e.test(i))return!0},e.prototype.choices_count=function(){var t,e,i,a;if(null!=this.selected_option_count)return this.selected_option_count;for(this.selected_option_count=0,a=this.form_field.options,e=0,i=a.length;e<i;e++)t=a[e],t.selected&&""!=t.value&&(this.selected_option_count+=1);return this.selected_option_count},e.prototype.choices_click=function(t){if(t.preventDefault(),!this.results_showing&&!this.is_disabled)return this.results_show()},e.prototype.keyup_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),e){case 8:if(this.is_multiple&&this.backstroke_length<1&&this.choices_count()>0)return this.keydown_backstroke();if(!this.pending_backstroke)return this.result_clear_highlight(),this.results_search();break;case 13:if(t.preventDefault(),this.results_showing)return this.result_select(t);break;case 27:return this.results_showing&&this.results_hide(),!0;case 9:case 38:case 40:case 16:case 91:case 17:break;default:return this.results_search()}},e.prototype.clipboard_event_checker=function(t){var e=this;return setTimeout(function(){return e.results_search()},50)},e.prototype.container_width=function(){return null!=this.options.width?this.options.width:this.form_field&&this.form_field.classList&&this.form_field.classList.contains("form-control")?"100%":""+this.form_field.offsetWidth+"px"},e.prototype.include_option_in_results=function(t){return!(this.is_multiple&&!this.display_selected_options&&t.selected)&&(!(!this.display_disabled_options&&t.disabled)&&!t.empty)},e.prototype.search_results_touchstart=function(t){return this.touch_started=!0,this.search_results_mouseover(t)},e.prototype.search_results_touchmove=function(t){return this.touch_started=!1,this.search_results_mouseout(t)},e.prototype.search_results_touchend=function(t){if(this.touch_started)return this.search_results_mouseup(t)},e.prototype.outerHTML=function(t){var e;return t.outerHTML?t.outerHTML:(e=document.createElement("div"),e.appendChild(t),e.innerHTML)},e.browser_is_supported=function(){return"Microsoft Internet Explorer"===window.navigator.appName?document.documentMode>=8:!/iP(od|hone)/i.test(window.navigator.userAgent)&&(!/Android/i.test(window.navigator.userAgent)||!/Mobile/i.test(window.navigator.userAgent))},e.default_multiple_text="",e.default_single_text="",e.default_no_result_text="No results match",e}(),t=jQuery,t.fn.extend({chosen:function(a){return e.browser_is_supported()?this.each(function(e){var o=t(this),n=o.data("chosen");"destroy"===a&&n?n.destroy():n||o.data("chosen",new i(this,t.extend({},o.data(),a)))}):this}}),i=function(e){function i(){return o=i.__super__.constructor.apply(this,arguments)}return s(i,e),i.prototype.setup=function(){return this.form_field_jq=t(this.form_field),this.current_selectedIndex=this.form_field.selectedIndex,this.is_rtl=this.form_field_jq.hasClass("chosen-rtl")},i.prototype.set_up_html=function(){var e,i;e=["chosen-container"],e.push("chosen-container-"+(this.is_multiple?"multi":"single")),this.inherit_select_classes&&this.form_field.className&&e.push(this.form_field.className),this.is_rtl&&e.push("chosen-rtl");var a=this.form_field.getAttribute("data-css-class");return a&&e.push(a),i={"class":e.join(" "),style:"width: "+this.container_width()+";",title:this.form_field.title},this.form_field.id.length&&(i.id=this.form_field.id.replace(/[^\w]/g,"_")+"_chosen"),this.container=t("<div />",i),this.is_multiple?this.container.html('<ul class="chosen-choices"><li class="search-field"><input type="text" value="'+this.default_text+'" class="default" autocomplete="off" style="width:25px;" /></li></ul><div class="chosen-drop"><ul class="chosen-results"></ul></div>'):(this.container.html('<a class="chosen-single chosen-default" tabindex="-1"><span>'+this.default_text+'</span><div><b></b></div><div class="chosen-search"><input type="text" autocomplete="off" /></div></a><div class="chosen-drop"><ul class="chosen-results"></ul></div>'),this.compact_search?this.container.addClass("chosen-compact").find(".chosen-search").appendTo(this.container.find(".chosen-single")):this.container.find(".chosen-search").prependTo(this.container.find(".chosen-drop")),this.options.highlight_selected!==!1&&this.container.addClass("chosen-highlight-selected")),this.form_field_jq.hide().after(this.container),this.dropdown=this.container.find("div.chosen-drop").first(),this.search_field=this.container.find("input").first(),this.search_results=this.container.find("ul.chosen-results").first(),this.search_field_scale(),this.search_no_results=this.container.find("li.no-results").first(),this.is_multiple?(this.search_choices=this.container.find("ul.chosen-choices").first(),this.search_container=this.container.find("li.search-field").first()):(this.search_container=this.container.find("div.chosen-search").first(),this.selected_item=this.container.find(".chosen-single").first()),this.options.drop_width&&this.dropdown.css("width",this.options.drop_width).addClass("chosen-drop-size-limited"),this.max_drop_width&&this.dropdown.addClass("chosen-auto-max-width"),this.options.no_wrap&&this.dropdown.addClass("chosen-no-wrap"),this.results_build(),this.set_tab_index(),this.set_label_behavior(),this.form_field_jq.trigger("chosen:ready",{chosen:this})},i.prototype.register_observers=function(){var t=this;return this.container.bind("mousedown.chosen",function(e){t.container_mousedown(e)}),this.container.bind("mouseup.chosen",function(e){t.container_mouseup(e)}),this.container.bind("mouseenter.chosen",function(e){t.mouse_enter(e)}),this.container.bind("mouseleave.chosen",function(e){t.mouse_leave(e)}),this.search_results.bind("mouseup.chosen",function(e){t.search_results_mouseup(e)}),this.search_results.bind("mouseover.chosen",function(e){t.search_results_mouseover(e)}),this.search_results.bind("mouseout.chosen",function(e){t.search_results_mouseout(e)}),this.search_results.bind("mousewheel.chosen DOMMouseScroll.chosen",function(e){t.search_results_mousewheel(e)}),this.search_results.bind("touchstart.chosen",function(e){t.search_results_touchstart(e)}),this.search_results.bind("touchmove.chosen",function(e){t.search_results_touchmove(e)}),this.search_results.bind("touchend.chosen",function(e){t.search_results_touchend(e)}),this.form_field_jq.bind("chosen:updated.chosen",function(e){t.results_update_field(e)}),this.form_field_jq.bind("chosen:activate.chosen",function(e){t.activate_field(e)}),this.form_field_jq.bind("chosen:open.chosen",function(e){t.container_mousedown(e)}),this.form_field_jq.bind("chosen:close.chosen",function(e){t.input_blur(e)}),this.search_field.bind("blur.chosen",function(e){t.input_blur(e)}),this.search_field.bind("keyup.chosen",function(e){t.keyup_checker(e)}),this.search_field.bind("keydown.chosen",function(e){t.keydown_checker(e)}),this.search_field.bind("focus.chosen",function(e){t.input_focus(e)}),this.search_field.bind("cut.chosen",function(e){t.clipboard_event_checker(e)}),this.search_field.bind("paste.chosen",function(e){t.clipboard_event_checker(e)}),this.is_multiple?this.search_choices.bind("click.chosen",function(e){t.choices_click(e)}):this.container.bind("click.chosen",function(t){t.preventDefault()})},i.prototype.destroy=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.search_field[0].tabIndex&&(this.form_field_jq[0].tabIndex=this.search_field[0].tabIndex),this.container.remove(),this.form_field_jq.removeData("chosen"),this.form_field_jq.show()},i.prototype.search_field_disabled=function(){return this.is_disabled=this.form_field_jq[0].disabled,this.is_disabled?(this.container.addClass("chosen-disabled"),this.search_field[0].disabled=!0,this.is_multiple||this.selected_item.unbind("focus.chosen",this.activate_action),this.close_field()):(this.container.removeClass("chosen-disabled"),this.search_field[0].disabled=!1,this.is_multiple?void 0:this.selected_item.bind("focus.chosen",this.activate_action))},i.prototype.container_mousedown=function(e){if(!this.is_disabled&&(e&&"mousedown"===e.type&&!this.results_showing&&e.preventDefault(),null==e||!t(e.target).hasClass("search-choice-close")))return this.active_field?this.is_multiple||!e||t(e.target)[0]!==this.selected_item[0]&&!t(e.target).parents("a.chosen-single").length||(e.preventDefault(),this.results_toggle()):(this.is_multiple&&this.search_field.val(""),t(this.container[0].ownerDocument).bind("click.chosen",this.click_test_action),this.results_show()),this.activate_field()},i.prototype.container_mouseup=function(t){if("ABBR"===t.target.nodeName&&!this.is_disabled)return this.results_reset(t)},i.prototype.search_results_mousewheel=function(t){var e;if(t.originalEvent&&(e=-t.originalEvent.wheelDelta||t.originalEvent.detail),null!=e)return t.preventDefault(),"DOMMouseScroll"===t.type&&(e=40*e),this.search_results.scrollTop(e+this.search_results.scrollTop())},i.prototype.blur_test=function(t){if(!this.active_field&&this.container.hasClass("chosen-container-active"))return this.close_field()},i.prototype.close_field=function(){return t(this.container[0].ownerDocument).unbind("click.chosen",this.click_test_action),this.active_field=!1,this.results_hide(),this.container.removeClass("chosen-container-active"),this.clear_backstroke(),this.show_search_field_default(),this.search_field_scale()},i.prototype.activate_field=function(){return this.container.addClass("chosen-container-active"),this.active_field=!0,this.search_field.val(this.search_field.val()),this.search_field.focus()},i.prototype.test_active_click=function(e){var i;return i=t(e.target).closest(".chosen-container"),i.length&&this.container[0]===i[0]?this.active_field=!0:this.close_field()},i.prototype.results_build=function(){return this.parsing=!0,this.selected_option_count=null,this.results_data=a.select_to_array(this.form_field),this.is_multiple?this.search_choices.find("li.search-choice").remove():this.is_multiple||(this.single_set_selected_text(),this.disable_search||this.form_field.options.length<=this.disable_search_threshold?(this.search_field[0].readOnly=!0,this.container.addClass("chosen-container-single-nosearch"),this.container.removeClass("chosen-with-search")):(this.search_field[0].readOnly=!1,this.container.removeClass("chosen-container-single-nosearch"),this.container.addClass("chosen-with-search"))),this.update_results_content(this.results_option_build({first:!0})),this.search_field_disabled(),this.show_search_field_default(),this.search_field_scale(),this.parsing=!1},i.prototype.result_do_highlight=function(t,e){if(t.length){var i,a,o,n,s,r,l=-1;this.result_clear_highlight(),this.result_highlight=t,this.result_highlight.addClass("highlighted"),o=parseInt(this.search_results.css("maxHeight"),10),r=this.result_highlight.outerHeight(),s=this.search_results.scrollTop(),n=o+s,a=this.result_highlight.position().top+this.search_results.scrollTop(),i=a+r,this.middle_highlight&&(e||"always"===this.middle_highlight)?l=Math.min(a-r,Math.max(0,a-(o-r)/2)):i>=n?l=i-o>0?i-o:0:a<s&&(l=a),l>-1?this.search_results.scrollTop(l):this.result_highlight.scrollIntoView&&this.result_highlight.scrollIntoView()}},i.prototype.result_clear_highlight=function(){return this.result_highlight&&this.result_highlight.removeClass("highlighted"),this.result_highlight=null},i.prototype.results_show=function(){var e=this;if(e.is_multiple&&e.max_selected_options<=e.choices_count())return e.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1;e.results_showing=!0,e.search_field.focus(),e.search_field.val(e.search_field.val()),e.container.addClass("chosen-with-drop"),e.winnow_results(1);var i=e.drop_direction;if("function"==typeof i&&(i=i.call(this)),"auto"===i)if(e.drop_directionFixed)i=e.drop_directionFixed;else{var a=e.container.find(".chosen-drop"),o=a.outerHeight();e.drop_item_height&&o<e.max_drop_height&&(o=Math.min(e.max_drop_height,a.find(".chosen-results>.active-result").length*e.drop_item_height));var n=e.container.offset();n.top+o+30>t(window).height()+t(window).scrollTop()&&(i="up"),e.drop_directionFixed=i}return e.container.toggleClass("chosen-up","up"===i),e.autoResizeDrop(),e.form_field_jq.trigger("chosen:showing_dropdown",{chosen:e})},i.prototype.autoResizeDrop=function(){var e=this,i=e.max_drop_width;if(i){var a=e.container.find(".chosen-drop");a.removeClass("in");var o=0,n=a.find(".chosen-results"),s=n.children("li"),r=parseFloat(n.css("padding-left").replace("px","")),l=parseFloat(n.css("padding-right").replace("px","")),d=(isNaN(r)?0:r)+(isNaN(l)?0:l);s.each(function(){o=Math.max(o,t(this).outerWidth())}),a.css("width",Math.min(o+d+20,i)),e.fixDropWidthTimer=setTimeout(function(){e.fixDropWidthTimer=null,a.addClass("in"),e.winnow_results_set_highlight(1)},50)}},i.prototype.update_results_content=function(t){return this.search_results.html(t)},i.prototype.results_hide=function(){var t=this;return t.fixDropWidthTimer&&(clearTimeout(t.fixDropWidthTimer),t.fixDropWidthTimer=null),t.results_showing&&(t.result_clear_highlight(),t.container.removeClass("chosen-with-drop"),t.form_field_jq.trigger("chosen:hiding_dropdown",{chosen:t}),t.drop_directionFixed=0),t.results_showing=!1},i.prototype.set_tab_index=function(t){var e;if(this.form_field.tabIndex)return e=this.form_field.tabIndex,this.form_field.tabIndex=-1,this.search_field[0].tabIndex=e},i.prototype.set_label_behavior=function(){var e=this;if(this.form_field_label=this.form_field_jq.parents("label"),!this.form_field_label.length&&this.form_field.id.length&&(this.form_field_label=t("label[for='"+this.form_field.id+"']")),this.form_field_label.length>0)return this.form_field_label.bind("click.chosen",function(t){return e.is_multiple?e.container_mousedown(t):e.activate_field()})},i.prototype.show_search_field_default=function(){return this.is_multiple&&this.choices_count()<1&&!this.active_field?(this.search_field.val(this.default_text),this.search_field.addClass("default")):(this.search_field.val(""),this.search_field.removeClass("default"))},i.prototype.search_results_mouseup=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first(),i.length)return this.result_highlight=i,this.result_select(e),this.search_field.focus()},i.prototype.search_results_mouseover=function(e){var i;if(i=t(e.target).hasClass("active-result")?t(e.target):t(e.target).parents(".active-result").first())return this.result_do_highlight(i)},i.prototype.search_results_mouseout=function(e){if(t(e.target).hasClass("active-result"))return this.result_clear_highlight()},i.prototype.choice_build=function(e){var i,a,o=this;return i=t("<li />",{"class":"search-choice"}).html("<span title='"+e.html+"'>"+e.html+"</span>"),e.disabled?i.addClass("search-choice-disabled"):(a=t("<a />",{"class":"search-choice-close","data-option-array-index":e.array_index}),a.bind("click.chosen",function(t){return o.choice_destroy_link_click(t)}),i.append(a)),this.search_container.before(i)},i.prototype.choice_destroy_link_click=function(e){if(e.preventDefault(),e.stopPropagation(),!this.is_disabled)return this.choice_destroy(t(e.target))},i.prototype.choice_destroy=function(t){if(this.result_deselect(t[0].getAttribute("data-option-array-index")))return this.show_search_field_default(),this.is_multiple&&this.choices_count()>0&&this.search_field.val().length<1&&this.results_hide(),t.parents("li").first().remove(),this.search_field_scale()},i.prototype.results_reset=function(){var t=this.form_field_jq.val();this.reset_single_select_options(),this.form_field.options[0].selected=!0,this.single_set_selected_text(),this.show_search_field_default(),this.results_reset_cleanup();var e=this.form_field_jq.val(),i={selected:e};if(t===e||e.length||(i.deselected=t),this.form_field_jq.trigger("change",i),this.sync_sort_field(),this.active_field)return this.results_hide()},i.prototype.results_reset_cleanup=function(){return this.current_selectedIndex=this.form_field.selectedIndex,this.selected_item.find("abbr").remove()},i.prototype.result_select=function(t){var e,i;if(this.result_highlight)return e=this.result_highlight,this.result_clear_highlight(),this.is_multiple&&this.max_selected_options<=this.choices_count()?(this.form_field_jq.trigger("chosen:maxselected",{chosen:this}),!1):(this.is_multiple?e.removeClass("active-result"):this.reset_single_select_options(),i=this.results_data[e[0].getAttribute("data-option-array-index")],i.selected=!0,this.form_field.options[i.options_index].selected=!0,this.selected_option_count=null,this.is_multiple?this.choice_build(i):this.single_set_selected_text(i.text),(t.metaKey||t.ctrlKey)&&this.is_multiple||this.results_hide(),this.search_field.val(""),(this.is_multiple||this.form_field.selectedIndex!==this.current_selectedIndex)&&(this.form_field_jq.trigger("change",{selected:this.form_field.options[i.options_index].value}),this.sync_sort_field()),this.current_selectedIndex=this.form_field.selectedIndex,this.search_field_scale())},i.prototype.single_set_selected_text=function(t){return null==t&&(t=this.default_text),t===this.default_text?this.selected_item.addClass("chosen-default"):(this.single_deselect_control_build(),this.selected_item.removeClass("chosen-default")),this.compact_search&&this.search_field.attr("placeholder",t),this.selected_item.find("span").attr("title",t).text(t)},i.prototype.sync_sort_field=function(){var e=this;if(e.is_multiple&&e.sort_field){var i=t(e.sort_field);if(!i.length)return;var a=[];e.search_choices.find("li.search-choice").each(function(){var i=t(this),o=i.children(".search-choice-close").first().data("optionArrayIndex"),n=e.results_data[o];n&&n.selected&&a.push(n.value)}),i.val(a.join(e.sort_value_splitter)).trigger("change")}},i.prototype.result_deselect=function(t){var e;return e=this.results_data[t],!this.form_field.options[e.options_index].disabled&&(e.selected=!1,this.form_field.options[e.options_index].selected=!1,this.selected_option_count=null,this.result_clear_highlight(),this.results_showing&&this.winnow_results(),this.form_field_jq.trigger("change",{deselected:this.form_field.options[e.options_index].value}),this.sync_sort_field(),this.search_field_scale(),!0)},i.prototype.single_deselect_control_build=function(){if(this.allow_single_deselect)return this.selected_item.find("abbr").length||this.selected_item.find("span").first().after('<abbr class="search-choice-close"></abbr>'),this.selected_item.addClass("chosen-single-with-deselect")},i.prototype.get_search_text=function(){return this.search_field.val()===this.default_text?"":t("<div/>").text(t.trim(this.search_field.val())).html()},i.prototype.winnow_results_set_highlight=function(t){var e,i;if(i=this.is_multiple?[]:this.search_results.find(".result-selected.active-result"),e=i.length?i.first():this.search_results.find(".active-result").first(),null!=e)return this.result_do_highlight(e,t)},i.prototype.no_results=function(e){var i;return i=t('<li class="no-results">'+this.results_none_found+' "<span></span>"</li>'),i.find("span").first().html(e),this.search_results.append(i),this.form_field_jq.trigger("chosen:no_results",{chosen:this})},i.prototype.no_results_clear=function(){return this.search_results.find(".no-results").remove()},i.prototype.keydown_arrow=function(){var t;return this.results_showing&&this.result_highlight?(t=this.result_highlight.nextAll("li.active-result").first())?this.result_do_highlight(t):void 0:this.results_show()},i.prototype.keyup_arrow=function(){var t;return this.results_showing||this.is_multiple?this.result_highlight?(t=this.result_highlight.prevAll("li.active-result"),t.length?this.result_do_highlight(t.first()):(this.choices_count()>0&&this.results_hide(),this.result_clear_highlight())):void 0:this.results_show()},i.prototype.keydown_backstroke=function(){var t;return this.pending_backstroke?(this.choice_destroy(this.pending_backstroke.find("a").first()),this.clear_backstroke()):(t=this.search_container.siblings("li.search-choice").last(),t.length&&!t.hasClass("search-choice-disabled")?(this.pending_backstroke=t,this.single_backstroke_delete?this.keydown_backstroke():this.pending_backstroke.addClass("search-choice-focus")):void 0)},i.prototype.clear_backstroke=function(){return this.pending_backstroke&&this.pending_backstroke.removeClass("search-choice-focus"),this.pending_backstroke=null},i.prototype.keydown_checker=function(t){var e,i;switch(e=null!=(i=t.which)?i:t.keyCode,this.search_field_scale(),8!==e&&this.pending_backstroke&&this.clear_backstroke(),e){case 8:this.backstroke_length=this.search_field.val().length;break;case 9:this.results_showing&&!this.is_multiple&&this.result_select(t),this.mouse_on_container=!1;break;case 13:t.preventDefault();break;case 38:t.preventDefault(),this.keyup_arrow();break;case 40:t.preventDefault(),this.keydown_arrow()}},i.prototype.search_field_scale=function(){var e,i,a,o,n,s,r,l,d;if(this.is_multiple){for(a=0,r=0,n="position:absolute; left: -1000px; top: -1000px; display:none;",s=["font-size","font-style","font-weight","font-family","line-height","text-transform","letter-spacing"],l=0,d=s.length;l<d;l++)o=s[l],n+=o+":"+this.search_field.css(o)+";";return e=t("<div />",{style:n}),e.text(this.search_field.val()),t("body").append(e),r=e.width()+25,e.remove(),i=this.container.outerWidth(),r>i-10&&(r=i-10),this.search_field.css({width:r+"px"})}},i}(e),i.DEFAULTS=l,i.LANGUAGES=r,t.fn.chosen.Constructor=i}.call(this),function(t){"use strict";var e="zui.selectable",i=function(i,a){this.name=e,this.$=t(i),this.id=t.zui.uuid(),this.selectOrder=1,this.selections={},this.getOptions(a),this._init()},a=function(t,e,i){return t>=i.left&&t<=i.left+i.width&&e>=i.top&&e<=i.top+i.height},o=function(t,e){var i=Math.max(t.left,e.left),o=Math.max(t.top,e.top),n=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height);return a(i,o,t)&&a(n,s,t)&&a(i,o,e)&&a(n,s,e)};i.DEFAULTS={selector:"li,tr,div",trigger:"",selectClass:"active",rangeStyle:{border:"1px solid "+(t.zui.colorset?t.zui.colorset.primary:"#3280fc"),backgroundColor:t.zui.colorset?new t.zui.Color(t.zui.colorset.primary).fade(20).toCssStr():"rgba(50, 128, 252, 0.2)"},clickBehavior:"toggle",ignoreVal:3,listenClick:!0},i.prototype.getOptions=function(e){this.options=t.extend({},i.DEFAULTS,this.$.data(),e)},i.prototype.select=function(t){this.toggle(t,!0)},i.prototype.unselect=function(t){this.toggle(t,!1)},i.prototype.toggle=function(e,i,a){var o,n,s=this.options.selector,r=this;if(void 0===e)return void this.$.find(s).each(function(){r.toggle(this,i)});if("object"==typeof e?(o=t(e).closest(s),n=o.data("id")):(n=e,o=r.$.find('.selectable-item[data-id="'+n+'"]')),o&&o.length){if(n||(n=t.zui.uuid(),o.attr("data-id",n)),void 0!==i&&null!==i||(i=!r.selections[n]),!!i!=!!r.selections[n]){var l;"function"==typeof a&&(l=a(i)),l!==!0&&(r.selections[n]=!!i&&r.selectOrder++,r.callEvent(i?"select":"unselect",{id:n,selections:r.selections,target:o,
selected:r.getSelectedArray()},r))}r.options.selectClass&&o.toggleClass(r.options.selectClass,i)}},i.prototype.getSelectedArray=function(){var e=[];return t.each(this.selections,function(t,i){i&&e.push(t)}),e},i.prototype.syncSelectionsFromClass=function(){var e=this,i=e.$children=e.$.find(e.options.selector);e.selections={},i.each(function(){var i=t(this);e.selections[i.data("id")]=i.hasClass(e.options.selectClass)})},i.prototype._init=function(){var e,i,a,n,s,r,l,d=this.options,c=this,h=d.ignoreVal,u=!0,p="."+this.name+"."+this.id,f="function"==typeof d.checkFunc?d.checkFunc:null,g="function"==typeof d.rangeFunc?d.rangeFunc:null,m=!1,v=null,b="mousedown"+p,y=function(){n&&c.$children.each(function(){var e=t(this),i=e.offset();i.width=e.outerWidth(),i.height=e.outerHeight();var a=g?g.call(this,n,i):o(n,i);if(f){var s=f.call(c,{intersect:a,target:e,range:n,targetRange:i});s===!0?c.select(e):s===!1&&c.unselect(e)}else a?c.select(e):c.multiKey||c.unselect(e)})},w=function(o){m&&(s=o.pageX,r=o.pageY,n={width:Math.abs(s-e),height:Math.abs(r-i),left:s>e?e:s,top:r>i?i:r},u&&n.width<h&&n.height<h||(a||(a=t('.selectable-range[data-id="'+c.id+'"]'),a.length||(a=t('<div class="selectable-range" data-id="'+c.id+'"></div>').css(t.extend({zIndex:1060,position:"absolute",top:e,left:i,pointerEvents:"none"},c.options.rangeStyle)).appendTo(t("body")))),a.css(n),clearTimeout(l),l=setTimeout(y,10),u=!1))},_=function(e){t(document).off(p),clearTimeout(v),m&&(m=!1,a&&a.remove(),u||n&&(clearTimeout(l),y(),n=null),c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()}),e.preventDefault())},C=function(o){if(m)return _(o);var n=t.zui.getMouseButtonCode(d.mouseButton);if(!(n>-1&&o.button!==n||t(o.target).closest("input,select,textarea,label").length||c.altKey||3===o.which||c.callEvent("start",o)===!1)){var s=c.$children=c.$.find(d.selector);s.addClass("selectable-item");var r=c.multiKey?"multi":d.clickBehavior;if("single"===r&&c.unselect(),d.listenClick&&("multi"===r?c.toggle(o.target):"single"===r?c.select(o.target):"toggle"===r&&c.toggle(o.target,null,function(t){c.unselect()})),c.callEvent("startDrag",o)===!1)return void c.callEvent("finish",{selections:c.selections,selected:c.getSelectedArray()});e=o.pageX,i=o.pageY,a=null,u=!0,m=!0,t(document).on("mousemove"+p,w).on("mouseup"+p,_),v=setTimeout(function(){t(document).on(b,_)},10),o.preventDefault()}},x=d.container&&"default"!==d.container?t(d.container):this.$;d.trigger?x.on(b,d.trigger,C):x.on(b,C),t(document).on("keydown",function(t){var e=t.keyCode;17===e||91==e?c.multiKey=e:18===e&&(c.altKey=!0)}).on("keyup",function(t){c.multiKey=!1,c.altKey=!1})},i.prototype.callEvent=function(e,i){var a=t.Event(e+"."+this.name);this.$.trigger(a,i);var o=a.result,n=this.options[e];return"function"==typeof n&&(o=n.apply(this,Array.isArray(i)?i:[i])),o},t.fn.selectable=function(a){return this.each(function(){var o=t(this),n=o.data(e),s="object"==typeof a&&a;n||o.data(e,n=new i(this,s)),"string"==typeof a&&n[a]()})},t.fn.selectable.Constructor=i,t(function(){t('[data-ride="selectable"]').selectable()})}(jQuery),function(t,e,i){"use strict";var a=0,o='<div class="messager messager-{type} {placement}" style="display: none"><div class="messager-content"></div><div class="messager-actions"></div></div>',n={icons:{},type:"default",placement:"top",time:4e3,parent:"body",close:!0,fade:!0,scale:!0},s={},r=function(e,r){t.isPlainObject(e)?r=t.extend({},r,e):e&&(r?r.content=e:r={content:e});var l=this;r=l.options=t.extend({},n,r),l.id=r.id||a++;var d=s[l.id];d&&d.destroy(),s[l.id]=l,l.$=t(o.format(r)).toggleClass("fade",r.fade).toggleClass("scale",r.scale).attr("id","messager-"+l.id),r.cssClass&&l.$.addClass(r.cssClass);var c=!1,h=l.$.find(".messager-actions"),u=function(e){var a=t('<button type="button" class="action action-'+e.name+'"/>');"close"===e.name&&a.addClass("close"),e.html!==i&&a.html(e.html),e.icon!==i&&a.append('<i class="action-icon icon-'+e.icon+'"/>'),e.text!==i&&a.append('<span class="action-text">'+e.text+"</span>"),e.tooltip!==i&&a.attr("title",e.tooltip).tooltip(),a.data("action",e),h.append(a)};r.actions&&t.each(r.actions,function(t,e){e.name===i&&(e.name=t),"close"==e.name&&(c=!0),u(e)}),!c&&r.close&&u({name:"close",html:"&times;"}),l.$.on("click",".action",function(e){var i,a=t(this).data("action");r.onAction&&(i=r.onAction.call(this,a.name,a,l),i===!1)||"function"==typeof a.action&&(i=a.action.call(this,l),i===!1)||(l.hide(),e.stopPropagation())}),l.$.on("click",function(t){if(r.onAction){var e=r.onAction.call(this,"content",null,l);e===!0&&l.hide()}}),l.$.data("zui.messager",l),r.show&&l.message!==i&&l.show()};r.prototype.update=function(e,i){t.isPlainObject(e)?i=e:e&&(i?i.content=e:i={content:e});var a=this,o=a.options;a.$.removeClass("messager-"+o.type);var n=a.$.find(".messager-content");o.contentClass&&n.removeClass(o.contentClass),i&&(o=t.extend(o,i)),a.$.addClass("messager-"+o.type).toggleClass("messager-notification",!!o.notification),o.contentClass&&n.addClass(o.contentClass);var s=o.title,r=o.icon;if(e=o.content,n.empty(),s){var l=t('<div class="messager-title"></div>');l[o.html?"html":"text"](s),n.append(l)}if(e){var d=t('<div class="messager-text"></div>');d[o.html?"html":"text"](e),n.append(d)}var c=a.$.find(".messager-icon");if(r){var h=t.isPlainObject(r)?r.html:'<i class="icon-'+r+' icon"></i>';c.length?c.html(h):n.before('<div class="messager-icon">'+h+"<div>")}else c.remove();a.$.toggleClass("messager-has-icon",!!r),a.updateTime||o.onUpdate&&o.onUpdate.call(a,o),a.updateTime=Date.now()},r.prototype.show=function(a,o){var n=this,s=this.options;if("function"==typeof a){var r=o;o=a,r!==i&&(a=r)}if(n.isShow)return void n.hide(function(){n.show(a,o)});n.hiding&&(clearTimeout(n.hiding),n.hiding=null),n.update(a);var l=s.placement,d=t(s.parent),c=d.children(".messagers-holder."+l);if(c.length||(c=t("<div/>").attr("class","messagers-holder "+l).appendTo(d)),c.append(n.$),"center"===l){var h=t(e).height()-c.height();c.css("top",Math.max(-h,h/2))}return n.$.show().addClass("in"),s.time&&(n.hiding=setTimeout(function(){n.hide()},s.time)),n.isShow=!0,o&&o(),s.onShow&&s.onShow.call(n,s),n},r.prototype.hide=function(t,e){t===!0&&(e=!0,t=null);var i=this,a=i.options;if(i.$.hasClass("in")){i.$.removeClass("in");var o=function(){var o=i.$.parent();i.$.detach(),o.children().length||o.remove(),t&&t(!0),a.onHide&&a.onHide.call(i,e)};e?o():setTimeout(o,200)}else t&&t(!1),a.onHide&&a.onHide.call(i,e);i.isShow=!1},r.prototype.destroy=function(){var t=this;t.hide(function(){t.$.remove(),t.$=null},!0),delete s[t.id]};var l=function(e){if(e===i)t(".messager").each(function(){var e=t(this).data("zui.messager");e&&e.hide&&e.hide(!0)});else{var a=t("#messager-"+e).data("zui.messager");a&&a.hide&&a.hide()}},d=function(e,a){"string"==typeof a&&(a={type:a}),t.isPlainObject(e)&&(a=t.extend({},a,e),e=null),a=t.extend({},a),a.id===i&&l();var o=s[a.id]||new r(e,a);return o.show(),o},c={notification:!0,placement:"bottom-right",time:0,icon:"bell icon-2x"},h=function(e,i,a){var o=t.extend({id:t.zui.uuid()},c),n="string"==typeof e,s="string"==typeof i;return n&&s?a=t.extend(o,a,{title:e,content:i}):n&&t.isPlainObject(i)?a=t.extend(o,a,i,{title:e}):t.isPlainObject(e)?a=t.extend(o,a,i,e):n&&(a=t.extend(o,a,{title:e})),d(a)},u=function(t){return"string"==typeof t?{placement:t}:t},p={show:d,hide:l};r.all=s,r.DEFAULTS=n,r.NOTIFICATION_DEFAULTS=c,t.each({primary:0,success:"ok-sign",info:"info-sign",warning:"warning-sign",danger:"exclamation-sign",important:0,special:0},function(e,i){p[e]=function(a,o){return d(a,t.extend({type:e,icon:r.DEFAULTS.icons[e]||i||null},u(o)))}}),t.zui({Messager:r,showMessager:d,showNotification:h,messager:p})}(jQuery,window,void 0),function(t,e,i,a){"use strict";function o(t){if(t=t.toLowerCase(),t&&c.test(t)){var e;if(4===t.length){var i="#";for(e=1;e<4;e+=1)i+=t.slice(e,e+1).concat(t.slice(e,e+1));t=i}var a=[];for(e=1;e<7;e+=2)a.push(y("0x"+t.slice(e,e+2)));return{r:a[0],g:a[1],b:a[2],a:1}}throw new Error("Wrong hex string! (hex: "+t+")")}function n(e){return typeof e===f&&("transparent"===e.toLowerCase()||m[e.toLowerCase()]||c.test(t.trim(e.toLowerCase())))}function s(t){function e(t){return t=t<0?t+1:t>1?t-1:t,6*t<1?r+(s-r)*t*6:2*t<1?s:3*t<2?r+(s-r)*(2/3-t)*6:r}var i=t.h,a=t.s,o=t.l,n=t.a;i=d(i)%u/u,a=l(d(a)),o=l(d(o)),n=l(d(n));var s=o<=.5?o*(a+1):o+a-o*a,r=2*o-s,c={r:e(i+1/3)*h,g:e(i)*h,b:e(i-1/3)*h,a:n};return c}function r(t,i,a){return v(a)&&(a=0),v(i)&&(i=h),e.min(e.max(t,a),i)}function l(t,e){return r(t,e)}function d(t){return"number"==typeof t?t:parseFloat(t)}var c=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,h=255,u=360,p=100,f="string",g="object",m={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"},v=function(t){return t===a},b=function(t){return!v(t)},y=function(t){return parseInt(t)},w=function(t){return y(l(d(t),h))},_=function(t,e,i,a){var n=this;if(n.r=n.g=n.b=0,n.a=1,b(a)&&(n.a=l(d(a),1)),b(t)&&b(e)&&b(i))n.r=w(t),n.g=w(e),n.b=w(i);else if(b(t)){var r=typeof t;if(r==f)if(t=t.toLowerCase(),"transparent"===t)n.a=0;else if(m[t])n.rgb(o(m[t]));else if(0===t.indexOf("rgb")){var c=t.substring(t.indexOf("(")+1,t.lastIndexOf(")")).split(",",4);n.rgb({r:c[0],g:c[1],b:c[2],a:c[3]})}else n.rgb(o(t));else if("number"==r&&v(e))n.r=n.g=n.b=w(t);else if(r==g&&b(t.r))n.r=w(t.r),b(t.g)&&(n.g=w(t.g)),b(t.b)&&(n.b=w(t.b)),b(t.a)&&(n.a=l(d(t.a),1));else if(r==g&&b(t.h)){var h={h:l(d(t.h),u),s:1,l:1,a:1};b(t.s)&&(h.s=l(d(t.s),1)),b(t.l)&&(h.l=l(d(t.l),1)),b(t.a)&&(h.a=l(d(t.a),1)),n.rgb(s(h))}}};_.prototype.rgb=function(t){var e=this;if(b(t)){if(typeof t==g)b(t.r)&&(e.r=w(t.r)),b(t.g)&&(e.g=w(t.g)),b(t.b)&&(e.b=w(t.b)),b(t.a)&&(e.a=l(d(t.a),1));else{var i=y(d(t));e.r=i,e.g=i,e.b=i}return e}return{r:e.r,g:e.g,b:e.b,a:e.a}},_.prototype.hue=function(t){var e=this,i=e.toHsl();return v(t)?i.h:(i.h=l(d(t),u),e.rgb(s(i)),e)},_.prototype.darken=function(t){var e=this,i=e.toHsl();return i.l-=t/p,i.l=l(i.l,1),e.rgb(s(i)),e},_.prototype.clone=function(){var t=this;return new _(t.r,t.g,t.b,t.a)},_.prototype.lighten=function(t){return this.darken(-t)},_.prototype.fade=function(t){return this.a=l(t/p,1),this},_.prototype.spin=function(t){var e=this.toHsl(),i=(e.h+t)%u;return e.h=i<0?u+i:i,this.rgb(s(e))},_.prototype.toHsl=function(){var t,i,a=this,o=a.r/h,n=a.g/h,s=a.b/h,r=a.a,l=e.max(o,n,s),d=e.min(o,n,s),c=(l+d)/2,p=l-d;if(l===d)t=i=0;else{switch(i=c>.5?p/(2-l-d):p/(l+d),l){case o:t=(n-s)/p+(n<s?6:0);break;case n:t=(s-o)/p+2;break;case s:t=(o-n)/p+4}t/=6}return{h:t*u,s:i,l:c,a:r}},_.prototype.luma=function(){var t=this.r/h,i=this.g/h,a=this.b/h;return t=t<=.03928?t/12.92:e.pow((t+.055)/1.055,2.4),i=i<=.03928?i/12.92:e.pow((i+.055)/1.055,2.4),a=a<=.03928?a/12.92:e.pow((a+.055)/1.055,2.4),.2126*t+.7152*i+.0722*a},_.prototype.saturate=function(t){var e=this.toHsl();return e.s+=t/p,e.s=l(e.s),this.rgb(s(e))},_.prototype.desaturate=function(t){return this.saturate(-t)},_.prototype.contrast=function(t,e,i){if(e=v(e)?new _(h,h,h,1):new _(e),t=v(t)?new _(0,0,0,1):new _(t),t.luma()>e.luma()){var a=e;e=t,t=a}return this.a<.5?t:(i=v(i)?.43:d(i),this.luma()<i?e:t)},_.prototype.hexStr=function(){var t=this.r.toString(16),e=this.g.toString(16),i=this.b.toString(16);return 1==t.length&&(t="0"+t),1==e.length&&(e="0"+e),1==i.length&&(i="0"+i),"#"+t+e+i},_.prototype.toCssStr=function(){var t=this;return t.a>0?t.a<1?"rgba("+t.r+","+t.g+","+t.b+","+t.a+")":t.hexStr():"transparent"},_.isColor=n,_.names=m,_.get=function(t){return new _(t)},t.zui({Color:_})}(jQuery,Math,window,void 0),/*!
 * ZUI: Generated from less code - v1.10.0 - 2021-11-18
 * http://openzui.com
 * GitHub: https://github.com/easysoft/zui.git 
 * Copyright (c) 2021 cnezsoft.com; Licensed MIT
 */
function(t){"use strict";var e=0,i=["primary","red","yellow","green","blue","purple","brown","dark"],a={primary:"#3280fc",secondary:"#145ccd",pale:"#ebf2f9",fore:"#353535",back:"#fff",grayDarker:"#222222",grayDark:"#333333",gray:"#808080",grayLight:"#dddddd",grayLighter:"#e5e5e5",grayPale:"#f1f1f1",white:"#fff",black:"#000",red:"#ea644a",yellow:"#f1a325",green:"#38b03f",blue:"#03b8cf",purple:"#8666b8",brown:"#bd7b46",greenPale:"#ddf4df",yellowPale:"#fff0d5",redPale:"#ffe5e0",bluePale:"#ddf3f5",brownPale:"#f7ebe1",purplePale:"#f5eeff",light:"#fff",dark:"#353535",success:"#38b03f",warning:"#f1a325",danger:"#ea644a",info:"#03b8cf",important:"#bd7b46",special:"#8666b8",successPale:"#ddf4df",warningPale:"#fff0d5",dangerPale:"#ffe5e0",infoPale:"#ddf3f5",importantPale:"#f7ebe1",specialPale:"#f5eeff"};a.get=function(o){"undefined"!=typeof o&&"random"!==o||(o=i[e++%i.length]);var n=a[o]?a[o]:o;return t.zui.Color?new t.zui.Color(n):n},t.zui({colorset:a}),t.zui.Color&&t.extend(t.zui.Color,a)}(jQuery),/*!
 * Datetimepicker for Bootstrap
 * Copyright 2012 Stefan Petre
 * Licensed under the Apache License v2.0
 */
!function(t){function e(){return new Date(Date.UTC.apply(Date,arguments))}var i=function(e,i){var o=this;this.element=t(e),this.language=(i.language||this.element.data("date-language")||(t.zui&&t.zui.clientLang?t.zui.clientLang().replace("_","-"):"zh-cn")).toLowerCase(),this.lang=t.zui&&t.zui.getLangData?t.zui.getLangData("datetimepicker",this.language,a):a[this.language],this.isRTL=this.lang.rtl||!1,this.formatType=i.formatType||this.element.data("format-type")||"standard",this.format=n.parseFormat(i.format||this.element.data("date-format")||this.lang.format||n.getDefaultFormat(this.formatType,"input"),this.formatType),this.isInline=!1,this.isVisible=!1,this.isInput=this.element.is("input"),this.component=!!this.element.is(".date")&&this.element.find(".input-group-addon .icon-th, .input-group-addon .icon-time, .input-group-addon .icon-calendar").parent(),this.componentReset=!!this.element.is(".date")&&this.element.find(".input-group-addon .icon-remove").parent(),this.hasInput=this.component&&this.element.find("input").length,this.component&&0===this.component.length&&(this.component=!1),this.linkField=i.linkField||this.element.data("link-field")||!1,this.linkFormat=n.parseFormat(i.linkFormat||this.element.data("link-format")||n.getDefaultFormat(this.formatType,"link"),this.formatType),this.minuteStep=i.minuteStep||this.element.data("minute-step")||5,this.pickerPosition=i.pickerPosition||this.element.data("picker-position")||"bottom-right",this.showMeridian=i.showMeridian||this.element.data("show-meridian")||!1,this.initialDate=i.initialDate||new Date,this.pickerClass=i.eleClass,this.onlyPickTime=i.maxView<=1,this.pickerId=i.eleId,this._attachEvents(),this.formatViewType="datetime","formatViewType"in i?this.formatViewType=i.formatViewType:"formatViewType"in this.element.data()&&(this.formatViewType=this.element.data("formatViewType")),this.minView=0,"minView"in i?this.minView=i.minView:"minView"in this.element.data()&&(this.minView=this.element.data("min-view")),this.minView=n.convertViewMode(this.minView),this.maxView=n.modes.length-1,"maxView"in i?this.maxView=i.maxView:"maxView"in this.element.data()&&(this.maxView=this.element.data("max-view")),this.maxView=n.convertViewMode(this.maxView),this.wheelViewModeNavigation=!1,"wheelViewModeNavigation"in i?this.wheelViewModeNavigation=i.wheelViewModeNavigation:"wheelViewModeNavigation"in this.element.data()&&(this.wheelViewModeNavigation=this.element.data("view-mode-wheel-navigation")),this.wheelViewModeNavigationInverseDirection=!1,"wheelViewModeNavigationInverseDirection"in i?this.wheelViewModeNavigationInverseDirection=i.wheelViewModeNavigationInverseDirection:"wheelViewModeNavigationInverseDirection"in this.element.data()&&(this.wheelViewModeNavigationInverseDirection=this.element.data("view-mode-wheel-navigation-inverse-dir")),this.wheelViewModeNavigationDelay=100,"wheelViewModeNavigationDelay"in i?this.wheelViewModeNavigationDelay=i.wheelViewModeNavigationDelay:"wheelViewModeNavigationDelay"in this.element.data()&&(this.wheelViewModeNavigationDelay=this.element.data("view-mode-wheel-navigation-delay")),this.startViewMode=2,"startView"in i?this.startViewMode=i.startView:"startView"in this.element.data()&&(this.startViewMode=this.element.data("start-view")),this.startViewMode=n.convertViewMode(this.startViewMode),this.viewMode=this.startViewMode,this.viewSelect=this.minView,"viewSelect"in i?this.viewSelect=i.viewSelect:"viewSelect"in this.element.data()&&(this.viewSelect=this.element.data("view-select")),this.viewSelect=n.convertViewMode(this.viewSelect),this.forceParse=!0,"forceParse"in i?this.forceParse=i.forceParse:"dateForceParse"in this.element.data()&&(this.forceParse=this.element.data("date-force-parse")),this.picker=t(n.template).appendTo(this.isInline?this.element:"body").on({click:this.click.bind(this)}),this.wheelViewModeNavigation&&(t.fn.mousewheel?this.picker.on({mousewheel:this.mousewheel.bind(this)}):console.log("Mouse Wheel event is not supported. Please include the jQuery Mouse Wheel plugin before enabling this option")),this.isInline?this.picker.addClass("datetimepicker-inline"):this.picker.addClass("datetimepicker-dropdown-"+this.pickerPosition+" dropdown-menu"),this.isRTL&&(this.picker.addClass("datetimepicker-rtl"),this.picker.find(".prev span, .next span").toggleClass("icon-arrow-left icon-arrow-right")),t(document).on("mousedown",function(e){0===t(e.target).closest(".datetimepicker").length&&o.hide()}),this.autoclose=!1,"autoclose"in i?this.autoclose=i.autoclose:"dateAutoclose"in this.element.data()&&(this.autoclose=this.element.data("date-autoclose")),this.keyboardNavigation=!0,"keyboardNavigation"in i?this.keyboardNavigation=i.keyboardNavigation:"dateKeyboardNavigation"in this.element.data()&&(this.keyboardNavigation=this.element.data("date-keyboard-navigation")),this.todayBtn=i.todayBtn||this.element.data("date-today-btn")||!1,this.todayHighlight=i.todayHighlight||this.element.data("date-today-highlight")||!1,this.weekStart=(i.weekStart||this.element.data("date-weekstart")||this.lang.weekStart||0)%7,this.weekEnd=(this.weekStart+6)%7,this.startDate=-(1/0),this.endDate=1/0,this.daysOfWeekDisabled=[],this.setStartDate(i.startDate||this.element.data("date-startdate")),this.setEndDate(i.endDate||this.element.data("date-enddate")),this.setDaysOfWeekDisabled(i.daysOfWeekDisabled||this.element.data("date-days-of-week-disabled")),this.fillDow(),this.fillMonths(),this.update(),this.showMode(),this.isInline&&this.show()};i.prototype={constructor:i,_events:[],_attachEvents:function(){this._detachEvents(),this.isInput?this._events=[[this.element,{focus:this.show.bind(this),keyup:this.update.bind(this),keydown:this.keydown.bind(this)}]]:this.component&&this.hasInput?(this._events=[[this.element.find("input"),{focus:this.show.bind(this),keyup:this.update.bind(this),keydown:this.keydown.bind(this)}],[this.component,{click:this.show.bind(this)}]],this.componentReset&&this._events.push([this.componentReset,{click:this.reset.bind(this)}])):this.element.is("div")?this.isInline=!0:this._events=[[this.element,{click:this.show.bind(this)}]];for(var t,e,i=0;i<this._events.length;i++)t=this._events[i][0],e=this._events[i][1],t.on(e)},_detachEvents:function(){for(var t,e,i=0;i<this._events.length;i++)t=this._events[i][0],e=this._events[i][1],t.off(e);this._events=[]},show:function(e){this.picker.show(),this.height=this.component?this.component.outerHeight():this.element.outerHeight(),this.forceParse&&this.update(),this.place(),t(window).on("resize",this.place.bind(this)),e&&(e.stopPropagation(),e.preventDefault()),this.isVisible=!0,this.element.trigger({type:"show",date:this.date})},hide:function(e){this.isVisible&&(this.isInline||(this.picker.hide(),t(window).off("resize",this.place),this.viewMode=this.startViewMode,this.showMode(),this.isInput||t(document).off("mousedown",this.hide),this.forceParse&&(this.isInput&&this.element.val()||this.hasInput&&this.element.find("input").val())&&this.setValue(),this.isVisible=!1,this.element.trigger({type:"hide",date:this.date})))},remove:function(){this._detachEvents(),this.picker.remove(),delete this.picker,delete this.element.data().datetimepicker},getDate:function(){var t=this.getUTCDate();return new Date(t.getTime()+6e4*t.getTimezoneOffset())},getUTCDate:function(){return this.date},setDate:function(t){this.setUTCDate(new Date(t.getTime()-6e4*t.getTimezoneOffset()))},setUTCDate:function(t){t>=this.startDate&&t<=this.endDate?(this.date=t,this.setValue(),this.viewDate=this.date,this.fill()):this.element.trigger({type:"outOfRange",date:t,startDate:this.startDate,endDate:this.endDate})},setFormat:function(t){this.format=n.parseFormat(t,this.formatType);var e;this.isInput?e=this.element:this.component&&(e=this.element.find("input")),e&&e.val()&&this.setValue()},setValue:function(){var e=this.getFormattedDate();this.isInput?this.element.val(e):(this.component&&this.element.find("input").val(e),this.element.data("date",e)),this.linkField&&t("#"+this.linkField).val(this.getFormattedDate(this.linkFormat))},getFormattedDate:function(t){return void 0==t&&(t=this.format),n.formatDate(this.date,t,this.language,this.formatType)},setStartDate:function(t){this.startDate=t||-(1/0),this.startDate!==-(1/0)&&(this.startDate=n.parseDate(this.startDate,this.format,this.language,this.formatType)),this.update(),this.updateNavArrows()},setEndDate:function(t){this.endDate=t||1/0,this.endDate!==1/0&&(this.endDate=n.parseDate(this.endDate,this.format,this.language,this.formatType)),this.update(),this.updateNavArrows()},setDaysOfWeekDisabled:function(e){this.daysOfWeekDisabled=e||[],Array.isArray(this.daysOfWeekDisabled)||(this.daysOfWeekDisabled=this.daysOfWeekDisabled.split(/,\s*/)),this.daysOfWeekDisabled=t.map(this.daysOfWeekDisabled,function(t){return parseInt(t,10)}),this.update(),this.updateNavArrows()},place:function(){if(!this.isInline){var e=0;t("div").each(function(){var i=parseInt(t(this).css("zIndex"),10);i>e&&(e=i)});var i,a,o,n=e+10;this.component?(i=this.component.offset(),o=i.left,"bottom-left"!==this.pickerPosition&&"top-left"!==this.pickerPosition&&"auto-left"!==this.pickerPosition||(o+=this.component.outerWidth()-this.picker.outerWidth())):(i=this.element.offset(),o=i.left);var s=0===this.pickerPosition.indexOf("auto-"),r=s?(i.top+this.picker.outerHeight()>t(window).height()+t(window).scrollTop()?"top":"bottom")+(0===this.pickerPosition.lastIndexOf("-left")?"-left":"-right"):this.pickerPosition;a="top-left"===r||"top-right"===r?i.top-this.picker.outerHeight():i.top+this.height,this.picker.css({top:a,left:o,zIndex:n}).attr("class","datetimepicker dropdown-menu datetimepicker-dropdown-"+r),this.pickerClass&&this.picker.addClass(this.pickerClass),this.pickerId&&this.picker.attr("id",this.pickerId),this.onlyPickTime&&this.picker.addClass("datetimepicker-only-time")}},update:function(){var t,e=!1;arguments&&arguments.length&&("string"==typeof arguments[0]||arguments[0]instanceof Date)?(t=arguments[0],e=!0):(t=this.element.data("date")||(this.isInput?this.element.val():this.element.find("input").val())||this.initialDate,("string"==typeof t||t instanceof String)&&(t=t.replace(/^\s+|\s+$/g,""))),t||(t=new Date,e=!1),this.date=n.parseDate(t,this.format,this.language,this.formatType),e&&this.setValue(),this.date<this.startDate?this.viewDate=new Date(this.startDate):this.date>this.endDate?this.viewDate=new Date(this.endDate):this.viewDate=new Date(this.date),this.fill()},fillDow:function(){for(var t=this.weekStart,e="<tr>";t<this.weekStart+7;)e+='<th class="dow">'+this.lang.daysMin[t++%7]+"</th>";e+="</tr>",this.picker.find(".datetimepicker-days thead").append(e)},fillMonths:function(){for(var t="",e=0;e<12;)t+='<span class="month">'+this.lang.monthsShort[e++]+"</span>";this.picker.find(".datetimepicker-months td").html(t)},fill:function(){if(null!=this.date&&null!=this.viewDate){var i=new Date(this.viewDate),a=i.getUTCFullYear(),o=i.getUTCMonth(),s=i.getUTCDate(),r=i.getUTCHours(),l=i.getUTCMinutes(),d=this.startDate!==-(1/0)?this.startDate.getUTCFullYear():-(1/0),c=this.startDate!==-(1/0)?this.startDate.getUTCMonth():-(1/0),h=this.endDate!==1/0?this.endDate.getUTCFullYear():1/0,u=this.endDate!==1/0?this.endDate.getUTCMonth():1/0,p=new e(this.date.getUTCFullYear(),this.date.getUTCMonth(),this.date.getUTCDate()).valueOf(),f=new Date;if(this.picker.find(".datetimepicker-days thead th:eq(1)").text(this.lang.months[o]+" "+a),"time"==this.formatViewType){var g=r%12?r%12:12,m=(g<10?"0":"")+g,v=(l<10?"0":"")+l,b=this.lang.meridiem[r<12?0:1];this.picker.find(".datetimepicker-hours thead th:eq(1)").text(m+":"+v+" "+b.toUpperCase()),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(m+":"+v+" "+b.toUpperCase())}else this.picker.find(".datetimepicker-hours thead th:eq(1)").text(s+" "+this.lang.months[o]+" "+a),this.picker.find(".datetimepicker-minutes thead th:eq(1)").text(s+" "+this.lang.months[o]+" "+a);this.picker.find("tfoot th.today").text(this.lang.today).toggle(this.todayBtn!==!1),this.updateNavArrows(),this.fillMonths();var y=e(a,o-1,28,0,0,0,0),w=n.getDaysInMonth(y.getUTCFullYear(),y.getUTCMonth());y.setUTCDate(w),y.setUTCDate(w-(y.getUTCDay()-this.weekStart+7)%7);var _=new Date(y);_.setUTCDate(_.getUTCDate()+42),_=_.valueOf();for(var C,x=[];y.valueOf()<_;)y.getUTCDay()==this.weekStart&&x.push("<tr>"),C="",y.getUTCFullYear()<a||y.getUTCFullYear()==a&&y.getUTCMonth()<o?C+=" old":(y.getUTCFullYear()>a||y.getUTCFullYear()==a&&y.getUTCMonth()>o)&&(C+=" new"),this.todayHighlight&&y.getUTCFullYear()==f.getFullYear()&&y.getUTCMonth()==f.getMonth()&&y.getUTCDate()==f.getDate()&&(C+=" today"),y.valueOf()==p&&(C+=" active"),(y.valueOf()+864e5<=this.startDate||y.valueOf()>this.endDate||t.inArray(y.getUTCDay(),this.daysOfWeekDisabled)!==-1)&&(C+=" disabled"),x.push('<td class="day'+C+'">'+y.getUTCDate()+"</td>"),y.getUTCDay()==this.weekEnd&&x.push("</tr>"),y.setUTCDate(y.getUTCDate()+1);this.picker.find(".datetimepicker-days tbody").empty().append(x.join("")),x=[];for(var k="",T="",D="",$=0;$<24;$++){var S=e(a,o,s,$);C="",S.valueOf()+36e5<=this.startDate||S.valueOf()>this.endDate?C+=" disabled":r==$&&(C+=" active"),this.showMeridian&&2==this.lang.meridiem.length?(T=$<12?this.lang.meridiem[0]:this.lang.meridiem[1],T!=D&&(""!=D&&x.push("</fieldset>"),x.push('<fieldset class="hour"><legend>'+T.toUpperCase()+"</legend>")),D=T,k=$%12?$%12:12,x.push('<span class="hour'+C+" hour_"+($<12?"am":"pm")+'">'+k+"</span>"),23==$&&x.push("</fieldset>")):(k=$+":00",x.push('<span class="hour'+C+'">'+k+"</span>"))}this.picker.find(".datetimepicker-hours td").html(x.join("")),x=[],k="",T="",D="";for(var $=0;$<60;$+=this.minuteStep){var S=e(a,o,s,r,$,0);C="",S.valueOf()<this.startDate||S.valueOf()>this.endDate?C+=" disabled":Math.floor(l/this.minuteStep)==Math.floor($/this.minuteStep)&&(C+=" active"),this.showMeridian&&2==this.lang.meridiem.length?(T=r<12?this.lang.meridiem[0]:this.lang.meridiem[1],T!=D&&(""!=D&&x.push("</fieldset>"),x.push('<fieldset class="minute"><legend>'+T.toUpperCase()+"</legend>")),D=T,k=r%12?r%12:12,x.push('<span class="minute'+C+'">'+k+":"+($<10?"0"+$:$)+"</span>"),59==$&&x.push("</fieldset>")):(k=$+":00",x.push('<span class="minute'+C+'">'+r+":"+($<10?"0"+$:$)+"</span>"))}this.picker.find(".datetimepicker-minutes td").html(x.join(""));var M=this.date.getUTCFullYear(),z=this.picker.find(".datetimepicker-months").find("th:eq(1)").text(a).end().find("span").removeClass("active");M==a&&z.eq(this.date.getUTCMonth()).addClass("active"),(a<d||a>h)&&z.addClass("disabled"),a==d&&z.slice(0,c).addClass("disabled"),a==h&&z.slice(u+1).addClass("disabled"),x="",a=10*parseInt(a/10,10);var I=this.picker.find(".datetimepicker-years").find("th:eq(1)").text(a+"-"+(a+9)).end().find("td");a-=1;for(var $=-1;$<11;$++)x+='<span class="year'+($==-1||10==$?" old":"")+(M==a?" active":"")+(a<d||a>h?" disabled":"")+'">'+a+"</span>",a+=1;I.html(x),this.place()}},updateNavArrows:function(){var t=new Date(this.viewDate),e=t.getUTCFullYear(),i=t.getUTCMonth(),a=t.getUTCDate(),o=t.getUTCHours();switch(this.viewMode){case 0:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&a<=this.startDate.getUTCDate()&&o<=this.startDate.getUTCHours()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&a>=this.endDate.getUTCDate()&&o>=this.endDate.getUTCHours()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 1:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()&&a<=this.startDate.getUTCDate()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()&&a>=this.endDate.getUTCDate()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 2:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()&&i<=this.startDate.getUTCMonth()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()&&i>=this.endDate.getUTCMonth()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"});break;case 3:case 4:this.startDate!==-(1/0)&&e<=this.startDate.getUTCFullYear()?this.picker.find(".prev").css({visibility:"hidden"}):this.picker.find(".prev").css({visibility:"visible"}),this.endDate!==1/0&&e>=this.endDate.getUTCFullYear()?this.picker.find(".next").css({visibility:"hidden"}):this.picker.find(".next").css({visibility:"visible"})}},mousewheel:function(t){if(t.preventDefault(),t.stopPropagation(),!this.wheelPause){this.wheelPause=!0;var e=t.originalEvent,i=e.wheelDelta,a=i>0?1:0===i?0:-1;this.wheelViewModeNavigationInverseDirection&&(a=-a),this.showMode(a),setTimeout(function(){this.wheelPause=!1}.bind(this),this.wheelViewModeNavigationDelay)}},click:function(i){i.stopPropagation(),i.preventDefault();var a=t(i.target).closest("span, td, th, legend");if(1==a.length){if(a.is(".disabled"))return void this.element.trigger({type:"outOfRange",date:this.viewDate,startDate:this.startDate,endDate:this.endDate});switch(a[0].nodeName.toLowerCase()){case"th":switch(a[0].className){case"switch":this.showMode(1);break;case"prev":case"next":var o=n.modes[this.viewMode].navStep*("prev"==a[0].className?-1:1);switch(this.viewMode){case 0:this.viewDate=this.moveHour(this.viewDate,o);break;case 1:this.viewDate=this.moveDate(this.viewDate,o);break;case 2:this.viewDate=this.moveMonth(this.viewDate,o);break;case 3:case 4:this.viewDate=this.moveYear(this.viewDate,o)}this.fill();break;case"today":var s=new Date;s=e(s.getFullYear(),s.getMonth(),s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),0),s<this.startDate?s=this.startDate:s>this.endDate&&(s=this.endDate),this.viewMode=this.startViewMode,this.showMode(0),this._setDate(s),this.fill(),this.autoclose&&this.hide()}break;case"span":if(!a.is(".disabled")){var r=this.viewDate.getUTCFullYear(),l=this.viewDate.getUTCMonth(),d=this.viewDate.getUTCDate(),c=this.viewDate.getUTCHours(),h=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();if(a.is(".month")?(this.viewDate.setUTCDate(1),l=a.parent().find("span").index(a),d=this.viewDate.getUTCDate(),this.viewDate.setUTCMonth(l),this.element.trigger({type:"changeMonth",date:this.viewDate}),this.viewSelect>=3&&this._setDate(e(r,l,d,c,h,u,0))):a.is(".year")?(this.viewDate.setUTCDate(1),r=parseInt(a.text(),10)||0,this.viewDate.setUTCFullYear(r),this.element.trigger({type:"changeYear",date:this.viewDate}),this.viewSelect>=4&&this._setDate(e(r,l,d,c,h,u,0))):a.is(".hour")?(c=parseInt(a.text(),10)||0,(a.hasClass("hour_am")||a.hasClass("hour_pm"))&&(12==c&&a.hasClass("hour_am")?c=0:12!=c&&a.hasClass("hour_pm")&&(c+=12)),this.viewDate.setUTCHours(c),this.element.trigger({type:"changeHour",date:this.viewDate}),this.viewSelect>=1&&this._setDate(e(r,l,d,c,h,u,0))):a.is(".minute")&&(h=parseInt(a.text().substr(a.text().indexOf(":")+1),10)||0,this.viewDate.setUTCMinutes(h),this.element.trigger({type:"changeMinute",date:this.viewDate}),this.viewSelect>=0&&this._setDate(e(r,l,d,c,h,u,0))),0!=this.viewMode){var p=this.viewMode;this.showMode(-1),this.fill(),p==this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide()}break;case"td":if(a.is(".day")&&!a.is(".disabled")){var d=parseInt(a.text(),10)||1,r=this.viewDate.getUTCFullYear(),l=this.viewDate.getUTCMonth(),c=this.viewDate.getUTCHours(),h=this.viewDate.getUTCMinutes(),u=this.viewDate.getUTCSeconds();a.is(".old")?0===l?(l=11,r-=1):l-=1:a.is(".new")&&(11==l?(l=0,r+=1):l+=1),this.viewDate.setUTCFullYear(r),this.viewDate.setUTCMonth(l,d),this.element.trigger({type:"changeDay",date:this.viewDate}),this.viewSelect>=2&&this._setDate(e(r,l,d,c,h,u,0));var p=this.viewMode;this.showMode(-1),this.fill(),p==this.viewMode&&this.autoclose&&this.hide()}}}},_setDate:function(t,e){e&&"date"!=e||(this.date=t),e&&"view"!=e||(this.viewDate=t),this.fill(),this.setValue();var i;this.isInput?i=this.element:this.component&&(i=this.element.find("input")),i&&(i.change(),this.autoclose&&(!e||"date"==e)),this.element.trigger({type:"changeDate",date:this.date}),null===t&&(this.date=this.viewDate)},moveMinute:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return i.setUTCMinutes(i.getUTCMinutes()+e*this.minuteStep),i},moveHour:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return i.setUTCHours(i.getUTCHours()+e),i},moveDate:function(t,e){if(!e)return t;var i=new Date(t.valueOf());return i.setUTCDate(i.getUTCDate()+e),i},moveMonth:function(t,e){if(!e)return t;var i,a,o=new Date(t.valueOf()),n=o.getUTCDate(),s=o.getUTCMonth(),r=Math.abs(e);if(e=e>0?1:-1,1==r)a=e==-1?function(){return o.getUTCMonth()==s}:function(){return o.getUTCMonth()!=i},i=s+e,o.setUTCMonth(i),(i<0||i>11)&&(i=(i+12)%12);else{for(var l=0;l<r;l++)o=this.moveMonth(o,e);i=o.getUTCMonth(),o.setUTCDate(n),a=function(){return i!=o.getUTCMonth()}}for(;a();)o.setUTCDate(--n),o.setUTCMonth(i);return o},moveYear:function(t,e){return this.moveMonth(t,12*e)},dateWithinRange:function(t){return t>=this.startDate&&t<=this.endDate},keydown:function(t){if(this.picker.is(":not(:visible)"))return void(27==t.keyCode&&this.show());var e,i,a,o=!1;switch(t.keyCode){case 27:this.hide(),t.preventDefault();break;case 37:case 39:if(!this.keyboardNavigation)break;e=37==t.keyCode?-1:1,viewMode=this.viewMode,t.ctrlKey?viewMode+=2:t.shiftKey&&(viewMode+=1),4==viewMode?(i=this.moveYear(this.date,e),a=this.moveYear(this.viewDate,e)):3==viewMode?(i=this.moveMonth(this.date,e),a=this.moveMonth(this.viewDate,e)):2==viewMode?(i=this.moveDate(this.date,e),a=this.moveDate(this.viewDate,e)):1==viewMode?(i=this.moveHour(this.date,e),a=this.moveHour(this.viewDate,e)):0==viewMode&&(i=this.moveMinute(this.date,e),a=this.moveMinute(this.viewDate,e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=a,this.setValue(),this.update(),t.preventDefault(),o=!0);break;case 38:case 40:if(!this.keyboardNavigation)break;e=38==t.keyCode?-1:1,viewMode=this.viewMode,t.ctrlKey?viewMode+=2:t.shiftKey&&(viewMode+=1),4==viewMode?(i=this.moveYear(this.date,e),a=this.moveYear(this.viewDate,e)):3==viewMode?(i=this.moveMonth(this.date,e),a=this.moveMonth(this.viewDate,e)):2==viewMode?(i=this.moveDate(this.date,7*e),a=this.moveDate(this.viewDate,7*e)):1==viewMode?this.showMeridian?(i=this.moveHour(this.date,6*e),a=this.moveHour(this.viewDate,6*e)):(i=this.moveHour(this.date,4*e),a=this.moveHour(this.viewDate,4*e)):0==viewMode&&(i=this.moveMinute(this.date,4*e),a=this.moveMinute(this.viewDate,4*e)),this.dateWithinRange(i)&&(this.date=i,this.viewDate=a,this.setValue(),this.update(),t.preventDefault(),o=!0);break;case 13:if(0!=this.viewMode){var n=this.viewMode;this.showMode(-1),this.fill(),n==this.viewMode&&this.autoclose&&this.hide()}else this.fill(),this.autoclose&&this.hide();t.preventDefault();break;case 9:this.hide()}if(o){var s;this.isInput?s=this.element:this.component&&(s=this.element.find("input")),s&&s.change(),this.element.trigger({type:"changeDate",date:this.date})}},showMode:function(t){if(t){var e=Math.max(0,Math.min(n.modes.length-1,this.viewMode+t));e>=this.minView&&e<=this.maxView&&(this.element.trigger({type:"changeMode",date:this.viewDate,oldViewMode:this.viewMode,newViewMode:e}),this.viewMode=e)}this.picker.find(">div").hide().filter(".datetimepicker-"+n.modes[this.viewMode].clsName).css("display","block"),this.updateNavArrows()},reset:function(t){this._setDate(null,"date")}},t.fn.datetimepicker=function(e){var a=Array.apply(null,arguments);return a.shift(),this.each(function(){var o=t(this),n=o.data("datetimepicker"),s="object"==typeof e&&e;n||o.data("datetimepicker",n=new i(this,t.extend({},t.fn.datetimepicker.defaults,o.data(),s))),"string"==typeof e&&"function"==typeof n[e]&&n[e].apply(n,a)})},t.fn.datetimepicker.defaults={pickerPosition:"auto-right"},t.fn.datetimepicker.Constructor=i;var a=t.fn.datetimepicker.dates={en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat","Sun"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa","Su"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],meridiem:["am","pm"],suffix:["st","nd","rd","th"],today:"Today"},"zh-cn":{days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今日",suffix:[],meridiem:[]},"zh-tw":{days:["星期日","星期一","星期二","星期三","星期四","星期五","星期六","星期日"],daysShort:["周日","周一","周二","周三","周四","周五","周六","周日"],daysMin:["日","一","二","三","四","五","六","日"],months:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthsShort:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],today:"今天",suffix:[],meridiem:["上午","下午"]}},o=function(e){var i=a[e];return i||(i=t.zui&&t.zui.getLangData?a[e]=t.zui.getLangData("datetimepicker",this.language,a):a.en),i},n={modes:[{clsName:"minutes",navFnc:"Hours",navStep:1},{clsName:"hours",navFnc:"Date",navStep:1},{clsName:"days",navFnc:"Month",navStep:1},{clsName:"months",navFnc:"FullYear",navStep:1},{clsName:"years",navFnc:"FullYear",navStep:10}],isLeapYear:function(t){return t%4===0&&t%100!==0||t%400===0},getDaysInMonth:function(t,e){return[31,n.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]},getDefaultFormat:function(t,e){if("standard"==t)return"input"==e?"yyyy-mm-dd hh:ii":"yyyy-mm-dd hh:ii:ss";if("php"==t)return"input"==e?"Y-m-d H:i":"Y-m-d H:i:s";throw new Error("Invalid format type.")},validParts:function(t){if("standard"==t)return/hh?|HH?|p|P|ii?|ss?|dd?|DD?|mm?|MM?|yy(?:yy)?/g;if("php"==t)return/[dDjlNwzFmMnStyYaABgGhHis]/g;throw new Error("Invalid format type.")},nonpunctuation:/[^ -\/:-@\[-`{-~\t\n\rTZ]+/g,parseFormat:function(t,e){var i=t.replace(this.validParts(e),"\0").split("\0"),a=t.match(this.validParts(e));if(!i||!i.length||!a||0==a.length)throw new Error("Invalid date format.");return{separators:i,parts:a}},parseDate:function(a,n,s,r){if(a instanceof Date){var l=new Date(a.valueOf()-6e4*a.getTimezoneOffset());return l.setMilliseconds(0),l}if(/^\d{4}\-\d{1,2}\-\d{1,2}$/.test(a)&&(n=this.parseFormat("yyyy-mm-dd",r)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}$/.test(a)&&(n=this.parseFormat("yyyy-mm-dd hh:ii",r)),/^\d{4}\-\d{1,2}\-\d{1,2}[T ]\d{1,2}\:\d{1,2}\:\d{1,2}[Z]{0,1}$/.test(a)&&(n=this.parseFormat("yyyy-mm-dd hh:ii:ss",r)),/^[-+]\d+[dmwy]([\s,]+[-+]\d+[dmwy])*$/.test(a)){var d,c,h=/([-+]\d+)([dmwy])/,u=a.match(/([-+]\d+)([dmwy])/g);a=new Date;for(var p=0;p<u.length;p++)switch(d=h.exec(u[p]),c=parseInt(d[1]),d[2]){case"d":a.setUTCDate(a.getUTCDate()+c);break;case"m":a=i.prototype.moveMonth.call(i.prototype,a,c);break;case"w":a.setUTCDate(a.getUTCDate()+7*c);break;case"y":a=i.prototype.moveYear.call(i.prototype,a,c)}return e(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate(),a.getUTCHours(),a.getUTCMinutes(),a.getUTCSeconds(),0)}var f,g,d,u=a&&a.match(this.nonpunctuation)||[],a=new Date(0,0,0,0,0,0,0),m={},v=["hh","h","ii","i","ss","s","yyyy","yy","M","MM","m","mm","D","DD","d","dd","H","HH","p","P"],b={hh:function(t,e){return t.setUTCHours(e)},h:function(t,e){return t.setUTCHours(e)},HH:function(t,e){return t.setUTCHours(12==e?0:e)},H:function(t,e){return t.setUTCHours(12==e?0:e)},ii:function(t,e){return t.setUTCMinutes(e)},i:function(t,e){return t.setUTCMinutes(e)},ss:function(t,e){return t.setUTCSeconds(e)},s:function(t,e){return t.setUTCSeconds(e)},yyyy:function(t,e){return t.setUTCFullYear(e)},yy:function(t,e){return t.setUTCFullYear(2e3+e)},m:function(t,e){for(e-=1;e<0;)e+=12;for(e%=12,t.setUTCMonth(e);t.getUTCMonth()!=e;)t.setUTCDate(t.getUTCDate()-1);return t},d:function(t,e){return t.setUTCDate(e)},p:function(t,e){return t.setUTCHours(1==e?t.getUTCHours()+12:t.getUTCHours())}};if(b.M=b.MM=b.mm=b.m,b.dd=b.d,b.P=b.p,a=e(a.getFullYear(),a.getMonth(),a.getDate(),a.getHours(),a.getMinutes(),a.getSeconds()),u.length==n.parts.length){for(var p=0,y=n.parts.length;p<y;p++){if(f=parseInt(u[p],10),d=n.parts[p],isNaN(f))switch(d){case"MM":g=t(o(s).months).filter(function(){var t=this.slice(0,u[p].length),e=u[p].slice(0,t.length);return t==e}),f=t.inArray(g[0],o(s).months)+1;break;case"M":g=t(o(s).monthsShort).filter(function(){var t=this.slice(0,u[p].length),e=u[p].slice(0,t.length);return t==e}),f=t.inArray(g[0],o(s).monthsShort)+1;break;case"p":case"P":f=t.inArray(u[p].toLowerCase(),o(s).meridiem)}m[d]=f}for(var w,p=0;p<v.length;p++)w=v[p],w in m&&!isNaN(m[w])&&b[w](a,m[w])}return a},formatDate:function(e,i,a,s){if(null==e)return"";var r;if("standard"==s)r={yy:e.getUTCFullYear().toString().substring(2),yyyy:e.getUTCFullYear(),m:e.getUTCMonth()+1,M:o(a).monthsShort[e.getUTCMonth()],MM:o(a).months[e.getUTCMonth()],d:e.getUTCDate(),D:o(a).daysShort[e.getUTCDay()],DD:o(a).days[e.getUTCDay()],p:2==o(a).meridiem.length?o(a).meridiem[e.getUTCHours()<12?0:1]:"",h:e.getUTCHours(),i:e.getUTCMinutes(),s:e.getUTCSeconds()},2==o(a).meridiem.length?r.H=r.h%12==0?12:r.h%12:r.H=r.h,r.HH=(r.H<10?"0":"")+r.H,r.P=r.p.toUpperCase(),r.hh=(r.h<10?"0":"")+r.h,r.ii=(r.i<10?"0":"")+r.i,r.ss=(r.s<10?"0":"")+r.s,r.dd=(r.d<10?"0":"")+r.d,r.mm=(r.m<10?"0":"")+r.m;else{if("php"!=s)throw new Error("Invalid format type.");r={y:e.getUTCFullYear().toString().substring(2),Y:e.getUTCFullYear(),F:o(a).months[e.getUTCMonth()],M:o(a).monthsShort[e.getUTCMonth()],n:e.getUTCMonth()+1,t:n.getDaysInMonth(e.getUTCFullYear(),e.getUTCMonth()),j:e.getUTCDate(),l:o(a).days[e.getUTCDay()],D:o(a).daysShort[e.getUTCDay()],w:e.getUTCDay(),N:0==e.getUTCDay()?7:e.getUTCDay(),S:e.getUTCDate()%10<=o(a).suffix.length?o(a).suffix[e.getUTCDate()%10-1]:"",a:2==o(a).meridiem.length?o(a).meridiem[e.getUTCHours()<12?0:1]:"",g:e.getUTCHours()%12==0?12:e.getUTCHours()%12,G:e.getUTCHours(),i:e.getUTCMinutes(),s:e.getUTCSeconds()},r.m=(r.n<10?"0":"")+r.n,r.d=(r.j<10?"0":"")+r.j,r.A=r.a.toString().toUpperCase(),r.h=(r.g<10?"0":"")+r.g,r.H=(r.G<10?"0":"")+r.G,r.i=(r.i<10?"0":"")+r.i,r.s=(r.s<10?"0":"")+r.s}for(var e=[],l=t.extend([],i.separators),d=0,c=i.parts.length;d<c;d++)l.length&&e.push(l.shift()),e.push(r[i.parts[d]]);return l.length&&e.push(l.shift()),e.join("")},convertViewMode:function(t){switch(t){case 4:case"decade":t=4;break;case 3:case"year":t=3;break;case 2:case"month":t=2;break;case 1:case"day":t=1;break;case 0:case"hour":t=0}return t},headTemplate:'<thead><tr><th class="prev"><i class="icon-arrow-left"/></th><th colspan="5" class="switch"></th><th class="next"><i class="icon-arrow-right"/></th></tr></thead>',contTemplate:'<tbody><tr><td colspan="7"></td></tr></tbody>',footTemplate:'<tfoot><tr><th colspan="7" class="today"></th></tr></tfoot>'};n.template='<div class="datetimepicker"><div class="datetimepicker-minutes"><table class=" table-condensed">'+n.headTemplate+n.contTemplate+n.footTemplate+'</table></div><div class="datetimepicker-hours"><table class=" table-condensed">'+n.headTemplate+n.contTemplate+n.footTemplate+'</table></div><div class="datetimepicker-days"><table class=" table-condensed">'+n.headTemplate+"<tbody></tbody>"+n.footTemplate+'</table></div><div class="datetimepicker-months"><table class="table-condensed">'+n.headTemplate+n.contTemplate+n.footTemplate+'</table></div><div class="datetimepicker-years"><table class="table-condensed">'+n.headTemplate+n.contTemplate+n.footTemplate+"</table></div></div>",t.fn.datetimepicker.DPGlobal=n,t.fn.datetimepicker.noConflict=function(){return t.fn.datetimepicker=old,this},t(document).on("focus.datetimepicker.data-api click.datetimepicker.data-api",'[data-provide="datetimepicker"]',function(e){
var i=t(this);i.data("datetimepicker")||(e.preventDefault(),i.datetimepicker("show"))}),t(function(){t('[data-provide="datetimepicker-inline"]').datetimepicker()})}(window.jQuery),+function(t,e,i){"use strict";if(!t.fn.droppable)return void console.error("Sortable requires droppable.js");var a="zui.sortable",o={selector:"li,div",dragCssClass:"invisible",sortingClass:"sortable-sorting"},n="order",s=function(e,i){var a=this;a.$=t(e),a.options=t.extend({},o,a.$.data(),i),a.init()};s.DEFAULTS=o,s.NAME=a,s.prototype.init=function(){var e,i=this,a=i.$,o=i.options,s=o.selector,r=o.containerSelector,l=o.sortingClass,d=o.dragCssClass,c=o.targetSelector,h=o.reverse,u=function(e){e=e||i.getItems(1);var a=e.length;a&&e.each(function(e){var i=h?a-e:e;t(this).attr("data-"+n,i).data(n,i)})};c||u(),a.droppable({handle:o.trigger,target:c?c:r?s+","+r:s,selector:s,container:a,always:o.always,flex:!0,lazy:o.lazy,canMoveHere:o.canMoveHere,dropToClass:o.dropToClass,before:o.before,nested:!!r,mouseButton:o.mouseButton,stopPropagation:o.stopPropagation,start:function(t){d&&t.element.addClass(d),e=!1,i.$element=t.element,i.trigger("start",t)},drag:function(t){if(a.addClass(l),t.isIn){var o=t.element,d=t.target,c=r&&d.is(r);if(c){if(!d.children(s).filter(".dragging").length){d.append(o);var p=i.getItems(1);u(p),i.trigger(n,{list:p,element:o})}return}var f=o.data(n),g=d.data(n);if(f===g)return u(p);f>g?d[h?"after":"before"](o):d[h?"before":"after"](o),e=!0;var p=i.getItems(1);u(p),i.trigger(n,{list:p,element:o})}},finish:function(t){d&&t.element&&t.element.removeClass(d),a.removeClass(l),i.trigger("finish",{list:i.getItems(),element:t.element,changed:e}),i.$element=null}})},s.prototype.destroy=function(){this.$.droppable("destroy"),this.$.data(a,null)},s.prototype.reset=function(){this.destroy(),this.init()},s.prototype.getItems=function(e){var i,a=this,o=a.options.targetSelector;return i=o?"function"==typeof o?o(a.$element,a.$):a.$.find(o):a.$.find(a.options.selector),i=i.not(".drag-shadow"),e?i:i.map(function(){var e=t(this);return{item:e,order:e.data("order")}})},s.prototype.trigger=function(e,i){return t.zui.callEvent(this.options[e],i,this)},t.fn.sortable=function(e){return this.each(function(){var i=t(this),o=i.data(a),n="object"==typeof e&&e;o?"object"==typeof e&&o.reset():i.data(a,o=new s(this,n)),"string"==typeof e&&o[e]()})},t.fn.sortable.Constructor=s}(jQuery,window,document),function(t,e){"use strict";var i,a,o="localStorage",n="page_"+t.location.pathname+t.location.search,s=function(){this.silence=!0;try{o in t&&t[o]&&t[o].setItem&&(this.enable=!0,i=t[o])}catch(s){}this.enable||(a={},i={getLength:function(){var t=0;return e.each(a,function(){t++}),t},key:function(t){var i,o=0;return e.each(a,function(e){return o===t?(i=e,!1):void o++}),i},removeItem:function(t){delete a[t]},getItem:function(t){return a[t]},setItem:function(t,e){a[t]=e},clear:function(){a={}}}),this.storage=i,this.page=this.get(n,{})};s.prototype.pageSave=function(){if(e.isEmptyObject(this.page))this.remove(n);else{var t,i=[];for(t in this.page){var a=this.page[t];null===a&&i.push(t)}for(t=i.length-1;t>=0;t--)delete this.page[i[t]];this.set(n,this.page)}},s.prototype.pageRemove=function(t){"undefined"!=typeof this.page[t]&&(this.page[t]=null,this.pageSave())},s.prototype.pageClear=function(){this.page={},this.pageSave()},s.prototype.pageGet=function(t,e){var i=this.page[t];return void 0===e||null!==i&&void 0!==i?i:e},s.prototype.pageSet=function(t,i){e.isPlainObject(t)?e.extend(!0,this.page,t):this.page[this.serialize(t)]=i,this.pageSave()},s.prototype.check=function(){if(!this.enable&&!this.silence)throw new Error("Browser not support localStorage or enable status been set true.");return this.enable},s.prototype.length=function(){return this.check()?i.getLength?i.getLength():i.length:0},s.prototype.removeItem=function(t){return i.removeItem(t),this},s.prototype.remove=function(t){return this.removeItem(t)},s.prototype.getItem=function(t){return i.getItem(t)},s.prototype.get=function(t,e){var i=this.deserialize(this.getItem(t));return"undefined"!=typeof i&&null!==i||"undefined"==typeof e?i:e},s.prototype.key=function(t){return i.key(t)},s.prototype.setItem=function(t,e){return i.setItem(t,e),this},s.prototype.set=function(t,e){return void 0===e?this.remove(t):(this.setItem(t,this.serialize(e)),this)},s.prototype.clear=function(){return i.clear(),this},s.prototype.forEach=function(t){for(var e=this.length(),a=e-1;a>=0;a--){var o=i.key(a);t(o,this.get(o))}return this},s.prototype.getAll=function(){var t={};return this.forEach(function(e,i){t[e]=i}),t},s.prototype.serialize=function(t){return"string"==typeof t?t:JSON.stringify(t)},s.prototype.deserialize=function(t){if("string"==typeof t)try{return JSON.parse(t)}catch(e){return t||void 0}},e.zui({store:new s})}(window,jQuery),function(t){"use strict";var e="zui.datatable",i=t.zui.store,a=function(i,a){this.name=e,this.$=t(i),this.isTable="TABLE"===this.$[0].tagName,this.firstShow=!0,this.isTable?(this.$table=this.$,this.id="datatable-"+(this.$.attr("id")||t.zui.uuid())):(this.$datatable=this.$.addClass("datatable"),this.$.attr("id")?this.id=this.$.attr("id"):(this.id="datatable-"+t.zui.uuid(),this.$.attr("id",this.id))),this.getOptions(a),this.load(),this.callEvent("ready")};a.DEFAULTS={checkable:!1,checkByClickRow:!0,checkedClass:"active",checkboxName:null,selectable:!0,sortable:!1,storage:!0,fixedHeader:!1,fixedHeaderOffset:0,fixedLeftWidth:"30%",fixedRightWidth:"30%",flexHeadDrag:!0,scrollPos:"in",rowHover:!0,colHover:!0,hoverClass:"hover",colHoverClass:"col-hover",fixCellHeight:!0,mergeRows:!1,minColWidth:20,minFixedLeftWidth:200,minFixedRightWidth:200,minFlexAreaWidth:200},a.prototype.getOptions=function(e){var i=this.$;e=t.extend({},a.DEFAULTS,this.$.data(),e),e.tableClass=e.tableClass||"",e.tableClass=" "+e.tableClass+" table-datatable",t.each(["bordered","condensed","striped","condensed","fixed"],function(t,a){a="table-"+a,i.hasClass(a)&&(e.tableClass+=" "+a)}),(i.hasClass("table-hover")||e.rowHover)&&(e.tableClass+=" table-hover"),e.checkable&&t.fn.selectable||(e.selectable=!1),this.options=e},a.prototype.load=function(i){var a,o=this.options;if("function"==typeof i)i=i(this.data,this),i.keepSort=!0;else if(t.isPlainObject(i))this.data=i;else if("string"==typeof i){var n=t(i);n.length&&(this.$table=n.first(),this.$table.data(e,this),this.isTable=!0),i=null}else i=o.data;if(!i){if(!this.isTable)throw new Error("No data available!");i={cols:[],rows:[]},a=i.cols;var s,r,l,d,c,h,u=i.rows,p=this.$table;p.children("thead").children("tr:first").children("th").each(function(){r=t(this),a.push(t.extend({text:r.html(),flex:r.hasClass("flex-col"),width:"auto",cssClass:r.attr("class"),css:r.attr("style"),type:"string",ignore:r.hasClass("ignore"),sort:!r.hasClass("sort-disabled"),mergeRows:r.attr("merge-rows"),title:r.attr("title")},r.data()))}),p.children("tbody").children("tr").each(function(){l=t(this),c=t.extend({data:[],checked:!1,cssClass:l.attr("class"),css:l.attr("style"),id:l.attr("id")},l.data()),l.children("td").each(function(){if(d=t(this),h=d.attr("colspan")||1,c.data.push(t.extend({cssClass:d.attr("class"),css:d.attr("style"),text:d.html(),colSpan:h,title:d.attr("title")},d.data())),h>1)for(s=1;s<h;s++)c.data.push({empty:!0})}),u.push(c)});var f=p.children("tfoot");f.length&&(i.footer=t('<table class="table'+o.tableClass+'"></table>').append(f))}i.flexStart=-1,i.flexEnd=-1,a=i.cols,i.colsLength=a.length;for(var s=0;s<i.colsLength;++s){var g=a[s];g.flex&&(i.flexStart<0&&(i.flexStart=s),i.flexEnd=s)}0===i.flexStart&&i.flexEnd===i.colsLength&&(i.flexStart=-1,i.flexEnd=-1),i.flexArea=i.flexStart>=0,i.fixedRight=i.flexEnd>=0&&i.flexEnd<i.colsLength-1,i.fixedLeft=i.flexStart>0,i.flexStart<0&&i.flexEnd<0&&(i.fixedLeft=!0,i.flexStart=i.colsLength,i.flexEnd=i.colsLength),this.data=i,this.callEvent("afterLoad",{data:i}),this.render()},a.prototype.render=function(){var i,a,o,n,s=this,r=s.$datatable||(s.isTable?t('<div class="datatable" id="'+s.id+'"/>'):s.$datatable),l=s.options,d=s.data,c=s.data.cols,h=s.data.rows,u=l.checkable,p='<div class="datatable-rows-span datatable-span"><div class="datatable-wrapper"><table class="table"></table></div></div>',f='<div class="datatable-head-span datatable-span"><div class="datatable-wrapper"><table class="table"><thead></thead></table></div></div>';r.children(".datatable-head, .datatable-rows, .scroll-wrapper").remove(),r.toggleClass("sortable",l.sortable);var g,m,v,b=t('<div class="datatable-head"/>');for(i=t('<tr class="datatable-row datatable-row-left"/>'),o=t('<tr class="datatable-row datatable-row-right"/>'),n=t('<tr class="datatable-row datatable-row-flex"/>'),a=0;a<c.length;a++)v=c[a],g=a<d.flexStart?i:a>=d.flexStart&&a<=d.flexEnd?n:o,0===a&&u&&g.append('<th data-index="check" class="check-all check-btn"><i class="icon-check-empty"></i></th>'),v.ignore||(m=t('<th class="datatable-head-cell"/>'),m.toggleClass("sort-down","down"===v.sort).toggleClass("sort-up","up"===v.sort).toggleClass("sort-disabled",v.sort===!1),m.addClass(v.cssClass).addClass(v.colClass).html(v.text).attr({"data-index":a,"data-type":v.type,style:v.css,title:v.title}).css("width",v.width),g.append(m));var y;d.fixedLeft&&(y=t(f),y.addClass("fixed-left").find("table").addClass(l.tableClass).find("thead").append(i),b.append(y)),d.flexArea&&(y=t(f),y.addClass("flexarea").find(".datatable-wrapper").append('<div class="scrolled-shadow scrolled-in-shadow"></div><div class="scrolled-shadow scrolled-out-shadow"></div>').find("table").addClass(l.tableClass).find("thead").append(n),b.append(y)),d.fixedRight&&(y=t(f),y.addClass("fixed-right").find("table").addClass(l.tableClass).find("thead").append(o),b.append(y)),r.append(b);var w,_,C,x,k,T,D,$,S=t('<div class="datatable-rows">'),M=h.length;i=t("<tbody/>"),o=t("<tbody/>"),n=t("<tbody/>");for(var z=0;z<M;++z){for(T=h[z],"undefined"==typeof T.id&&(T.id=z),T.index=z,w=t('<tr class="datatable-row"/>'),w.addClass(T.cssClass).toggleClass(l.checkedClass,!!T.checked).attr({"data-index":z,"data-id":T.id}),_=w.clone().addClass("datatable-row-flex"),C=w.clone().addClass("datatable-row-right"),w.addClass("datatable-row-left"),$=T.data.length,a=0;a<$;++a)D=T.data[a],a>0&&D.empty||(g=a<d.flexStart?w:a>=d.flexStart&&a<=d.flexEnd?_:C,0===a&&u&&(k=t('<td data-index="check" class="check-row check-btn"><i class="icon-check-empty"></i></td>'),l.checkboxName&&k.append('<input class="hide" type="checkbox" name="'+l.checkboxName+'" value="'+T.id+'">'),g.append(k)),c[a].ignore||(t.isPlainObject(D)?(D.row=z,D.index=a):D={text:D,row:z,index:a},T.data[a]=D,x=t('<td class="datatable-cell"/>'),x.html(D.text).addClass(D.cssClass).addClass(c[a].colClass).attr("colspan",D.colSpan).attr({"data-row":z,"data-index":a,"data-flex":!1,"data-type":c[a].type,style:D.css,title:D.title||""}).css("width",c[a].width),g.append(x)));i.append(w),n.append(_),o.append(C)}var I;d.fixedLeft&&(I=t(p),I.addClass("fixed-left").find("table").addClass(l.tableClass).append(i),S.append(I)),d.flexArea&&(I=t(p),I.addClass("flexarea").find(".datatable-wrapper").append('<div class="scrolled-shadow scrolled-in-shadow"></div><div class="scrolled-shadow scrolled-out-shadow"></div>').find("table").addClass(l.tableClass).append(n),S.append(I)),d.fixedRight&&(I=t(p),I.addClass("fixed-right").find("table").addClass(l.tableClass).append(o),S.append(I)),r.append(S),d.flexArea&&r.append('<div class="scroll-wrapper"><div class="scroll-slide scroll-pos-'+l.scrollPos+'"><div class="bar"></div></div></div>');var E=r.children(".datatable-footer").detach();d.footer?(r.append(t('<div class="datatable-footer"/>').append(d.footer)),d.footer=null):E.length&&r.append(E),s.$datatable=r.data(e,s),s.isTable&&s.firstShow&&(s.$table.attr("data-datatable-id",this.id).hide().after(r),s.firstShow=!1),s.bindEvents(),s.refreshSize(),s.callEvent("render")},a.prototype.toggleAnimation=function(t){var e=this;void 0===t&&(t=e.$.hasClass("no-animation")),e.toggleAnimationTimer&&(clearTimeout(e.toggleAnimationTimer),e.toggleAnimationTimer=null),t?e.toggleAnimationTimer=setTimeout(function(){e.toggleAnimationTimer=null,e.$.removeClass("no-animation")},500):e.$.addClass("no-animation")},a.prototype.bindEvents=function(){var e=this,a=this.data,o=this.options,n=this.$datatable,s=e.$dataSpans=n.children(".datatable-head, .datatable-rows").find(".datatable-span"),r=e.$rowsSpans=n.children(".datatable-rows").children(".datatable-rows-span"),l=e.$headSpans=n.children(".datatable-head").children(".datatable-head-span"),d=e.$cells=s.find(".datatable-head-cell,.datatable-cell"),c=e.$dataCells=d.filter(".datatable-cell");e.$headCells=d.filter(".datatable-head-cell");var h=e.$rows=e.$rowsSpans.find(".datatable-row");if(o.rowHover){var u=o.hoverClass;r.on("mouseenter",".datatable-cell",function(){c.filter("."+u).removeClass(u),h.filter("."+u).removeClass(u),h.filter('[data-index="'+t(this).addClass(u).data("row")+'"]').addClass(u)}).on("mouseleave",".datatable-cell",function(){c.filter("."+u).removeClass(u),h.filter("."+u).removeClass(u)})}if(o.colHover){var p=o.colHoverClass;l.on("mouseenter",".datatable-head-cell",function(){d.filter("."+p).removeClass(p),d.filter('[data-index="'+t(this).data("index")+'"]').addClass(p)}).on("mouseleave",".datatable-head-cell",function(){d.filter("."+p).removeClass(p)})}if(a.flexArea){var f,g,m,v,b,y,w=n.find(".scroll-slide"),_=n.find(".datatable-span.flexarea"),C=n.find(".datatable-span.fixed-left"),x=n.find(".datatable-span.flexarea .table-datatable"),k=w.children(".bar"),T=e.id+"_scrollOffset";e.width=n.width(),n.resize(function(){e.width=n.width()});var D=function(t,e){v=Math.max(0,Math.min(f-g,t)),e||n.addClass("scrolling"),k.css("left",v),y=0-Math.floor((m-f)*v/(f-g)),x.css("left",y),n.toggleClass("scrolled-in",v>2).toggleClass("scrolled-out",v<f-g-2),o.storage&&i.pageSet(T,v)},$=function(){f=_.width(),w.css({width:f,left:C.width()}),m=0,x.first().find("tr:first").children("td,th").each(function(){m+=t(this).outerWidth()}),g=Math.floor(f*f/m),k.css("width",g),x.css("min-width",Math.max(f,m)),n.toggleClass("show-scroll-slide",m>f),b||f===g||(b=!0,D(i.pageGet(T,0),!0)),n.hasClass("size-changing")&&D(v,!0)};_.resize($),o.storage&&$();var S={move:!1,stopPropagation:!0,drag:function(t){D(k.position().left+t.smallOffset.x*(t.element.hasClass("bar")?1:-1))},finish:function(){n.removeClass("scrolling")}};t.fn.draggable?(k.draggable(S),o.flexHeadDrag&&n.find(".datatable-head-span.flexarea").draggable(S)):console.error("DataTable requires draggable.js to improve UI."),w.mousedown(function(t){var e=t.pageX-w.offset().left;D(e-g/2)})}if(o.checkable){var M,z=e.id+"_checkedStatus",I=o.checkedClass,E=function(){var n=r.first().find(".datatable-row"),s=n.filter("."+I);o.checkboxName&&n.find(".check-row input:checkbox").prop("checked",!1);var d={checkedAll:n.length===s.length&&s.length>0,checks:s.map(function(){return M=t(this).data("id"),o.checkboxName&&t(this).find(".check-row input:checkbox").prop("checked",!0),M}).toArray()};e.checks=d,t.each(a.rows,function(e,i){i.checked=t.inArray(i.id,d.checks)>-1}),l.find(".check-all").toggleClass("checked",!!d.checkedAll),o.storage&&i.pageSet(z,d),e.callEvent("checksChanged",{checks:d})},U=function(e,i){var a=t(e).closest("tr");void 0===i&&(i=!a.hasClass(I)),h.filter('[data-index="'+a.data("index")+'"]').toggleClass(I,!!i)},P="click.zui.datatable.check";if(o.selectable){var H={selector:".datatable-rows .datatable-row",trigger:".datatable-rows",start:function(e){var i=t(e.target).closest(".check-row, .check-btn");if(i.length)return i.is(".check-row")&&(U(i),E()),!1},rangeFunc:function(t,e){return Math.max(t.top,e.top)<Math.min(t.top+t.height,e.top+e.height)},select:function(t){U(t.target,!0)},unselect:function(t){U(t.target,!1)},finish:function(t){E()}};t.isPlainObject(o.selectable)&&t.extend(H,o.selectable),this.$datatable.selectable(H)}else this.$rowsSpans.off(P).on(P+"row",o.checkByClickRow?"tr":".check-row",function(){U(this),E()});if(this.$datatable.off(P).on("click.zui.datatable.check",".check-all",function(){e.toggleAnimation(!1),h.toggleClass(I,t(this).toggleClass("checked").hasClass("checked")),E(),e.toggleAnimation(!0)}).on(P+".none",".check-none",function(){e.toggleAnimation(!1),h.toggleClass(I,!1),E(),e.toggleAnimation(!0)}).on(P+".inverse",".check-inverse",function(){e.toggleAnimation(!1),h.toggleClass(I),E(),e.toggleAnimation(!0)}),o.storage){var L=i.pageGet(z);L&&(l.find(".check-all").toggleClass("checked",L.checkedAll),L.checkedAll?h.addClass(I):(h.removeClass(I),t.each(L.checks,function(t,e){h.filter('[data-id="'+e+'"]').addClass(I)})),L.checks.length&&E())}}if(o.fixedHeader){var A,O,F,N=n.children(".datatable-head"),j=o.fixedHeaderOffset||t(".navbar.navbar-fixed-top").height()||0,R=function(){A=n.offset().top,F=t(window).scrollTop(),O=n.height(),n.toggleClass("head-fixed",F+j>A&&F+j<A+O),n.hasClass("head-fixed")?N.css({width:n.width(),top:j}):N.attr("style","")};t(window).scroll(R),R()}o.sortable?(l.on("click","th:not(.sort-disabled, .check-btn)",function(){n.hasClass("size-changing")||e.sortTable(t(this))}),o.storage&&e.sortTable()):o.mergeRows&&this.mergeRows()},a.prototype.mergeRows=function(){for(var e=this.$rowsSpans.find(".datatable-cell"),i=this.data.cols,a=0;a<i.length;a++){var o=i[a];if(o.mergeRows){var n=e.filter('[data-index="'+a+'"]');if(n.length>1){var s,r;n.each(function(){var e=t(this);s&&e.html()===s.html()?(r=s.attr("rowspan")||1,"number"!=typeof r&&(r=parseInt(r),isNaN(r)&&(r=1)),s.attr("rowspan",r+1).css("vertical-align","middle"),e.remove()):s=e})}}}},a.prototype.sortTable=function(e){var i=t.zui.store,a=this.options,o=this.id+"_datatableSorter",n=a.storage?i.pageGet(o):null;if(e||(e=n?this.$headCells.filter('[data-index="'+n.index+'"]').addClass("sort-"+("up"===n.type?"down":"up")):this.$headCells.filter(".sort-up, .sort-down").first()),e.length){var s,r,l,d=this.data,c=d.cols,h=d.rows,u=this.$headCells;s=!e.hasClass("sort-up"),d.keepSort&&(s=!s),d.keepSort=null,u.removeClass("sort-up sort-down"),e.addClass(s?"sort-up":"sort-down"),l=e.data("index"),t.each(c,function(t,e){t==l||"up"!==e.sort&&"down"!==e.sort?t==l&&(e.sort=s?"up":"down",r=e.type):e.sort=!0});var p,f,g,m=this.$dataCells.filter('[data-index="'+l+'"]');h.sort(function(t,e){return t=t.data[l],e=e.data[l],p=m.filter('[data-row="'+t.row+'"]').text(),f=m.filter('[data-row="'+e.row+'"]').text(),"number"===r?(p=parseFloat(p),f=parseFloat(f)):"date"===r?(p=Date.parse(p),f=Date.parse(f)):(p=p.toLowerCase(),f=f.toLowerCase()),g=p<f?1:p>f?-1:0,s&&(g*=-1),g});var v,b,y,w=this.$rows,_=[];t.each(h,function(e,i){v=w.filter('[data-index="'+i.index+'"]'),v.each(function(e){y=t(this),b=_[e],b?b.after(y):y.parent().prepend(y),_[e]=y})}),n={index:l,type:s?"up":"down"},a.storage&&i.pageSet(o,n),this.callEvent("sort",{sorter:n})}},a.prototype.refreshSize=function(){var e,i=this.$datatable,a=this.options,o=this.data.rows;if(i.find(".datatable-span.fixed-left").css("width",a.fixedLeftWidth),i.find(".datatable-span.fixed-right").css("width",a.fixedRightWidth),a.fixCellHeight){var n=function(e){var i,a,o=0;return e.css("height","auto"),e.each(function(){i=t(this),a=i.attr("rowspan"),a&&1!=a||(o=Math.max(o,i.outerHeight()))}),o},s=this.$dataCells,r=this.$headCells,l=n(r);r.css("min-height",l).css("height",l);var d;for(e=0;e<o.length;++e){d=s.filter('[data-row="'+e+'"]');var c=n(d);d.css("min-height",c).css("height",c)}}},a.prototype.callEvent=function(t,e){var i=this.$.callEvent(t+"."+this.name,e,this).result;return!(void 0!==i&&!i)},t.fn.datatable=function(i,o){return this.each(function(){var n=t(this),s=n.data(e),r="object"==typeof i&&i;s||n.data(e,s=new a(this,r)),"string"==typeof i&&("load"!==i||!t.isPlainObject(o)||void 0!==o.keepSort&&null!==o.keepSort||(o.keepSort=!0),s[i](o))})},t.fn.datatable.Constructor=a}(jQuery),function(t,e,i){"use strict";t.fn.draggable||console.error("img-cutter requires draggable.js"),t.zui.imgReady||console.error("img-cutter requires image.ready.js");var a="zui.imgCutter",o=function(e,i){this.$=t(e),this.initOptions(i),this.init()};o.DEFAULTS={coverColor:"#000",coverOpacity:.6,defaultWidth:128,defaultHeight:128,minWidth:48,minHeight:48},o.prototype.callEvent=function(t,e){var o=this.$.callEvent(t+"."+a,e,this);return!(o.result!==i&&!o.result)},o.prototype.initOptions=function(e){this.options=t.extend({},o.DEFAULTS,this.$.data(),e),this.options.coverOpacityIE=100*this.options.coverOpacity,this.clipWidth=this.options.defaultWidth,this.clipHeight=this.options.defaultHeight},o.prototype.init=function(){this.initDom(),this.initSize(),this.bindEvents()},o.prototype.initDom=function(){this.$canvas=this.$.children(".canvas"),this.$img=this.$canvas.children("img"),this.$actions=this.$.children(".actions"),this.$btn=this.$.find(".img-cutter-submit"),this.$preview=this.$.find(".img-cutter-preview"),this.options.img=this.$img.attr("src"),this.$canvas.append('<div class="cover" style="background: {coverColor}; opacity: {coverOpacity}; filter:alpha(opacity={coverOpacityIE});"></div><div class="controller" style="width: {defaultWidth}px; height: {defaultHeight}px"><div class="control" data-direction="top"></div><div class="control" data-direction="right"></div><div class="control" data-direction="bottom"></div><div class="control" data-direction="left"></div><div class="control" data-direction="top-left"></div><div class="control" data-direction="top-right"></div><div class="control" data-direction="bottom-left"></div><div class="control" data-direction="bottom-right"></div></div><div class="cliper"><img src="{img}"/></div>'.format(this.options)),this.$cover=this.$canvas.children(".cover"),this.$controller=this.$canvas.children(".controller"),this.$cliper=this.$canvas.children(".cliper"),this.$chipImg=this.$cliper.children("img"),this.options.fixedRatio&&this.$.addClass("fixed-ratio")},o.prototype.resetImage=function(t){var e=this;e.options.img=t,e.$img.attr("src",t),e.$chipImg.attr("src",t),e.imgWidth=i,e.left=i,e.initSize()},o.prototype.initSize=function(){var a=this;a.imgWidth||t.zui.imgReady(a.options.img,function(){a.imgWidth=this.width,a.imgHeight=this.height,(this.width<a.options.minWidth||this.height<a.options.minHeight)&&(a.options.onSizeError&&a.options.onSizeError({width:this.width,height:this.height}),a.options.minWidth=e.min(this.width,a.options.minWidth),a.options.minHeight=e.min(this.height,a.options.minHeight)),a.callEvent("ready")});var o=setInterval(function(){a.imgWidth&&(clearInterval(o),a.width=e.min(a.imgWidth,a.$.width()),a.$canvas.css("width",this.width),a.$cliper.css("width",this.width),a.height=a.$canvas.height(),a.left===i&&(a.left=e.floor((a.width-a.$controller.width())/2),a.top=e.floor((a.height-a.$controller.height())/2)),a.refreshSize())},0)},o.prototype.refreshSize=function(t){var i=this.options;this.clipWidth=e.max(i.minWidth,e.min(this.width,this.clipWidth)),this.clipHeight=e.max(i.minHeight,e.min(this.height,this.clipHeight)),i.fixedRatio&&(t&&"height"===t?(this.clipWidth=e.max(i.minWidth,e.min(this.width,this.clipHeight*i.defaultWidth/i.defaultHeight)),this.clipHeight=this.clipWidth*i.defaultHeight/i.defaultWidth):(this.clipHeight=e.max(i.minHeight,e.min(this.height,this.clipWidth*i.defaultHeight/i.defaultWidth)),this.clipWidth=this.clipHeight*i.defaultWidth/i.defaultHeight)),this.left=e.min(this.width-this.clipWidth,e.max(0,this.left)),this.top=e.min(this.height-this.clipHeight,e.max(0,this.top)),this.right=this.left+this.clipWidth,this.bottom=this.top+this.clipHeight,this.$controller.css({left:this.left,top:this.top,width:this.clipWidth,height:this.clipHeight}),this.$cliper.css("clip","rect({0}px {1}px {2}px {3}px".format(this.top,this.left+this.clipWidth,this.top+this.clipHeight,this.left)),this.callEvent("change",{top:this.top,left:this.left,bottom:this.bottom,right:this.right,width:this.clipWidth,height:this.clipHeight})},o.prototype.getData=function(){var t=this;return t.data={originWidth:t.imgWidth,originHeight:t.imgHeight,scaleWidth:t.width,scaleHeight:t.height,width:t.right-t.left,height:t.bottom-t.top,left:t.left,top:t.top,right:t.right,bottom:t.bottom,scaled:t.imgWidth!=t.width||t.imgHeight!=t.height},t.data},o.prototype.bindEvents=function(){var i=this,a=this.options;this.$.resize(this.initSize.bind(this)),this.$btn.hover(function(){i.$.toggleClass("hover")}).click(function(){var e=i.getData();if(i.callEvent("before",e)){var o=a.post||a.get||a.url||null;null!==o&&t.ajax({type:a.post?"POST":"GET",url:o,data:e}).done(function(t){i.callEvent("done",t)}).fail(function(t){i.callEvent("fail",t)}).always(function(t){i.callEvent("always",t)})}}),this.$controller.draggable({move:!1,container:this.$canvas,drag:function(t){i.left+=t.smallOffset.x,i.top+=t.smallOffset.y,i.refreshSize()}}),this.$controller.children(".control").draggable({move:!1,container:this.$canvas,stopPropagation:!0,drag:function(t){var o=t.element.data("direction"),n=t.smallOffset,s=!1;switch(o){case"left":case"top-left":case"bottom-left":i.left+=n.x,i.left=e.min(i.right-a.minWidth,e.max(0,i.left)),i.clipWidth=i.right-i.left;break;case"right":case"top-right":case"bottom-right":i.clipWidth+=n.x,i.clipWidth=e.min(i.width-i.left,e.max(a.minWidth,i.clipWidth))}switch(o){case"top":case"top-left":case"top-right":i.top+=n.y,i.top=e.min(i.bottom-a.minHeight,e.max(0,i.top)),i.clipHeight=i.bottom-i.top,s=!0;break;case"bottom":case"bottom-left":case"bottom-right":i.clipHeight+=n.y,i.clipHeight=e.min(i.height-i.top,e.max(a.minHeight,i.clipHeight)),s=!0}i.refreshSize(s)}})},t.fn.imgCutter=function(e){return this.each(function(){var i=t(this),n=i.data(a),s="object"==typeof e&&e;n||i.data(a,n=new o(this,s)),"string"==typeof e&&n[e]()})},t.fn.imgCutter.Constructor=o,t(function(){t('[data-toggle="imgCutter"]').imgCutter()})}(jQuery,Math,void 0),function(t,e){"use strict";var i="zui.contextmenu",a={animation:"fade",menuTemplate:'<ul class="dropdown-menu"></ul>',toggleTrigger:!1,duration:200,limitInsideWindow:!0},o=!1,n={},s="zui-contextmenu-"+t.zui.uuid(),r=0,l=0,d=function(){return t(document).off("mousemove."+i).on("mousemove."+i,function(t){r=t.clientX,l=t.clientY}),n},c=function(e,i){if("string"==typeof e&&(e="seperator"===e||"divider"===e||"-"===e||"|"===e?{type:"seperator"}:{label:e,id:i}),"seperator"===e.type||"divider"===e.type)return t('<li class="divider"></li>');var a=t("<a/>").attr(t.extend({href:e.url||"###","class":e.className,style:e.style},e.attrs)).data("item",e);return e.html?e.html===!0?a.html(e.label||e.text):a=t(e.html):a.text(e.label||e.text),e.icon&&a.prepend('<i class="icon icon-'+e.icon+'"></i>'),e.onClick&&a.on("click",e.onClick),t("<li />").toggleClass("disabled",e.disabled===!0).append(a)},h=function(e){var i=t("#"+s);return i.length&&i.hasClass("contextmenu-show")&&(!e||(i.data("options")||{}).id===e)},u=null,p=function(e,i){"function"==typeof e&&(i=e,e=null),u&&(clearTimeout(u),u=null);var a=t("#"+s);if(a.length){var o=a.removeClass("contextmenu-show").data("options");if(!e||o.id===e){var r=function(){a.find(".contextmenu-menu").removeClass("open"),o.onHidden&&o.onHidden(),i&&i()};o.onHide&&o.onHide();var l=o.animation;a.find(".contextmenu-menu").removeClass("in"),l?u=setTimeout(r,o.duration):r()}}return n},f=function(d,h,f){t.isPlainObject(d)&&(f=h,h=d,d=h.items),o=!0,h=t.extend({},a,h);var g=t("#"+s);g.length||(g=t('<div style="position: fixed; z-index: 2000;" class="contextmenu" id="'+s+'"><div class="contextmenu-menu"></div></div>').appendTo("body"));var m=g.find(".contextmenu-menu").off("click."+i).on("click."+i,"a,.contextmenu-item",function(e){var i=t(this),a=h.onClickItem&&h.onClickItem(i.data("item"),i,e,h);a!==!1&&p()}).empty();m.attr("class","contextmenu-menu"+(h.className?" "+h.className:"")),g.attr("class","contextmenu contextmenu-show");var v=h.menuCreator;if(v)m.append(v(d,h));else{m.append(h.menuTemplate);var b=m.children().first(),y=h.itemCreator||c,w=typeof d;if("string"===w?d=d.split(","):"function"===w&&(d=d(h)),!d)return!1;t.each(d,function(t,e){b.append(y(e,t,h))})}var _=h.animation,C=h.duration;_===!0&&(h.animation=_="fade"),u&&(clearTimeout(u),u=null);var x=function(){m.addClass("in"),h.onShown&&h.onShown(),f&&f()};h.onShow&&h.onShow(),g.data("options",{animation:_,onHide:h.onHide,onHidden:h.onHidden,id:h.id,duration:C});var k=h.x,T=h.y;k===e&&(k=(h.event||h).clientX),k===e&&(k=r),T===e&&(T=(h.event||h).clientY),T===e&&(T=l);var b=m.children().first(),D=b.outerWidth(),$=b.outerHeight();if(h.position){var S=h.position({x:k,y:T,width:D,height:$},h,m);S&&(k=S.x,T=S.y)}if(h.limitInsideWindow){var M=t(window);k=Math.max(0,Math.min(k,M.width()-D)),T=Math.max(0,Math.min(T,M.height()-$))}return g.css({left:k,top:T}).show(),m.addClass("open"),_?(m.addClass(_),u=setTimeout(function(){x(),o=!1},10)):(x(),o=!1),n};t.extend(n,{NAME:i,DEFAULTS:a,show:f,hide:p,listenMouse:d,isShow:h}),t.zui({ContextMenu:n});var g=function(e,a){var o=this;o.name=i,o.$=t(e),o.id=t.zui.uuid(),a=o.options=t.extend({trigger:"contextmenu"},n.DEFAULTS,this.$.data(),a);var s=function(t){if("mousedown"!==t.type||2===t.button){if(a.toggleTrigger&&o.isShow())o.hide();else{var e={x:t.clientX,y:t.clientY,event:t};if(o.show(e)===!1)return}return t.preventDefault(),t.returnValue=!1,!1}},r=a.trigger,l=r+"."+i;a.selector?o.$.on(l,a.selector,s):o.$.on(l,s),a.show&&o.show("object"==typeof a.show?a.show:null)};g.prototype.destory=function(){that.$.off("."+i)},g.prototype.hide=function(t){return n.hide(this.id,t)},g.prototype.show=function(e,i){return e=t.extend({id:this.id,$toggle:this.$},this.options,e),n.show(e,i)},g.prototype.isShow=function(){return h(this.id)},t.fn.contextmenu=function(e){return this.each(function(){var a=t(this),o=a.data(i),n="object"==typeof e&&e;o||a.data(i,o=new g(this,n)),"string"==typeof e&&o[e]()})},t.fn.contextmenu.Constructor=g,t.fn.contextDropdown=function(e){t(this).contextmenu(t.extend({trigger:"click",animation:"fade",toggleTrigger:!0,menuCreator:function(e,i){var a=i.$toggle,o=a.attr("data-target");o||(o=a.attr("href"),o=o&&/#/.test(o)&&o.replace(/.*(?=#[^\s]*$)/,""));var n=o?t(o):a.next(".dropdown-menu"),s=i.transferEvent;if(s!==!1){var r="data-contextmenu-index";n.find("a,.contextmenu-item").each(function(e){t(this).attr(r,e)});var l=n.clone();return l.on("string"==typeof s?s:"click","a,.contextmenu-item",function(e){var i=n.find("["+r+'="'+t(this).attr(r)+'"]'),a=i[0];if(a)return a[e.type]?a[e.type]():i.trigger(e.type),e.preventDefault(),e.stopPropagation(),!1}),l}return n.clone()},position:function(t,e,i){var a=e.placement,o=e.$toggle;if(!a){var n=i.find(".dropdown-menu"),s=n.hasClass("pull-right"),r=o.parent().hasClass("dropup");a=s?r?"top-right":"bottom-right":r?"top-left":"bottom-left",s&&n.removeClass("pull-right")}var l=o[0].getBoundingClientRect();switch(a){case"top-left":return{x:l.left,y:Math.floor(l.top-t.height)};case"top-right":return{x:Math.floor(l.right-t.width),y:Math.floor(l.top-t.height)};case"bottom-left":return{x:l.left,y:l.bottom};case"bottom-right":return{x:Math.floor(l.right-t.width),y:l.bottom}}return t}},e))},t(document).on("click",function(e){var a=t(e.target),n=a.closest('[data-toggle="context-dropdown"]');if(n.length){var s=n.data(i);s||n.contextDropdown({show:!0})}else o||a.closest(".contextmenu").length||p()})}(jQuery,void 0),function(t){"use strict";var e="zui.searchBox",i=function(e,a){var o=this;o.name=name,o.$=t(e),o.options=a=t.extend({},i.DEFAULTS,o.$.data(),a);var n=o.$.is(a.inputSelector)?o.$:o.$.find(a.inputSelector);if(n.length){var s=function(){o.changeTimer&&(clearTimeout(o.changeTimer),o.changeTimer=null)},r=function(){s();var t=o.getSearch();if(t!==o.lastValue){var e=""===t;n.toggleClass("empty",e),o.$.callComEvent(o,"onSearchChange",[t,e]),o.lastValue=t}};o.$input=n=n.first(),n.on(a.listenEvent,function(t){o.changeTimer=setTimeout(function(){r()},a.changeDelay)}).on("focus",function(t){n.addClass("focus"),o.$.callComEvent(o,"onFocus",[t])}).on("blur",function(t){n.removeClass("focus"),o.$.callComEvent(o,"onBlur",[t])}).on("keydown",function(t){var e=0,i=t.which;27===i&&a.escToClear?(this.setSearch("",!0),r(),
e=1):13===i&&a.onPressEnter&&(r(),o.$.callComEvent(o,"onPressEnter",[t]));var n=o.$.callComEvent(o,"onKeyDown",[t]);n===!1&&(e=1),e&&t.preventDefault()}),o.$.on("click",".search-clear-btn",function(t){o.setSearch("",!0),r(),o.focus(),t.preventDefault()}),r()}else console.error("ZUI: search box init error, cannot find search box input element.")};i.DEFAULTS={inputSelector:'input[type="search"],input[type="text"]',listenEvent:"change input paste",changeDelay:500},i.prototype.getSearch=function(){return this.$input&&t.trim(this.$input.val())},i.prototype.setSearch=function(t,e){var i=this.$input;i&&(i.val(t),e||i.trigger("change"))},i.prototype.focus=function(){this.$input&&this.$input.focus()},t.fn.searchBox=function(a){return this.each(function(){var o=t(this),n=o.data(e),s="object"==typeof a&&a;n||o.data(e,n=new i(this,s)),"string"==typeof a&&n[a]()})},i.NAME=e,t.fn.searchBox.Constructor=i}(jQuery),function(t){"use strict";function e(e,i){if(e===!1)return e;if(!e)return i;e===!0?e={add:!0,"delete":!0,edit:!0,sort:!0}:"string"==typeof e&&(e=e.split(","));var a;return Array.isArray(e)&&(a={},t.each(e,function(e,i){t.isPlainObject(i)?a[i.action]=i:a[i]=!0}),e=a),t.isPlainObject(e)&&(a={},t.each(e,function(e,i){i?a[e]=t.extend({type:e},s[e],t.isPlainObject(i)?i:null):a[e]=!1}),e=a),i?t.extend(!0,{},i,e):e}function i(e,i,a){return i=i||e.type,t(a||e.template).addClass("tree-action").attr(t.extend({"data-type":i,title:e.title||""},e.attr)).data("action",e)}var a="zui.tree",o=0,n=function(e,i){this.name=a,this.$=t(e),this.getOptions(i),this._init()},s={sort:{template:'<a class="sort-handler" href="javascript:;"><i class="icon icon-move"></i></a>'},add:{template:'<a href="javascript:;"><i class="icon icon-plus"></i></a>'},edit:{template:'<a href="javascript:;"><i class="icon icon-pencil"></i></a>'},"delete":{template:'<a href="javascript:;"><i class="icon icon-trash"></i></a>'}};n.DEFAULTS={animate:null,initialState:"normal",toggleTemplate:'<i class="list-toggle icon"></i>'},n.prototype.add=function(e,i,a,o,n){var s,r=t(e),l=this.options;if(r.is("li")?(s=r.children("ul"),s.length||(s=t("<ul/>"),r.append(s),this._initList(s,r))):s=r,s){var d=this;Array.isArray(i)||(i=[i]),t.each(i,function(e,i){var a=t("<li/>").data(i).appendTo(s);void 0!==i.id&&a.attr("data-id",i.id);var o=l.itemWrapper?t(l.itemWrapper===!0?'<div class="tree-item-wrapper"/>':l.itemWrapper).appendTo(a):a;if(i.html)o.html(i.html);else if("function"==typeof d.options.itemCreator){var n=d.options.itemCreator(a,i);n!==!0&&n!==!1&&o.html(n)}else i.url?o.append(t("<a/>",{href:i.url}).text(i.title||i.name)):o.append(t("<span/>").text(i.title||i.name));d._initItem(a,i.idx||e,s,i),i.children&&i.children.length&&d.add(a,i.children)}),this._initList(s),a&&!s.hasClass("tree")&&d.expand(s.parent("li"),o,n)}},n.prototype.reload=function(e){var i=this;e&&(i.$.empty(),i.add(i.$,e)),i.isPreserve&&i.store.time&&i.$.find("li:not(.tree-action-item)").each(function(){var e=t(this);i[i.store[e.data("id")]?"expand":"collapse"](e,!0,!0)})},n.prototype._initList=function(a,o,n,s){var r=this;a.hasClass("tree")?(n=0,o=null):(o=(o||a.closest("li")).addClass("has-list"),o.find(".list-toggle").length||o.prepend(this.options.toggleTemplate),n=n||o.data("idx")),a.removeClass("has-active-item");var l=a.attr("data-idx",n||0).children("li:not(.tree-action-item)").each(function(e){r._initItem(t(this),e+1,a)});1!==l.length||l.find("ul").length||l.addClass("tree-single-item"),s=s||(o?o.data():null);var d=e(s?s.actions:null,this.actions);if(d){if(d.add&&d.add.templateInList!==!1){var c=a.children("li.tree-action-item");c.length?c.detach().appendTo(a):t('<li class="tree-action-item"/>').append(i(d.add,"add",d.add.templateInList)).appendTo(a)}d.sort&&a.sortable(t.extend({dragCssClass:"tree-drag-holder",trigger:".sort-handler",selector:"li:not(.tree-action-item)",finish:function(t){r.callEvent("action",{action:d.sort,$list:a,target:t.target,item:s})}},d.sort.options,t.isPlainObject(this.options.sortable)?this.options.sortable:null))}o&&(o.hasClass("open")||s&&s.open)&&o.addClass("open in")},n.prototype._initItem=function(a,o,n,s){if(void 0===o){var r=a.prev("li");o=r.length?r.data("idx")+1:1}if(n=n||a.closest("ul"),a.attr("data-idx",o).removeClass("tree-single-item"),!a.data("id")){var l=o;n.hasClass("tree")||(l=n.parent("li").data("id")+"-"+l),a.attr("data-id",l)}a.hasClass("active")&&n.parent("li").addClass("has-active-item"),s=s||a.data();var d=e(s.actions,this.actions);if(d){var c=a.find(".tree-actions");c.length||(c=t('<div class="tree-actions"/>').appendTo(this.options.itemWrapper?a.find(".tree-item-wrapper"):a),t.each(d,function(t,e){e&&c.append(i(e,t))}))}var h=a.children("ul");h.length&&this._initList(h,a,o,s)},n.prototype._init=function(){var i=this.options,n=this;this.actions=e(i.actions),this.$.addClass("tree"),i.animate&&this.$.addClass("tree-animate"),this._initList(this.$);var s=i.initialState,r=t.zui&&t.zui.store&&t.zui.store.enable;r&&(this.selector=a+"::"+(i.name||"")+"#"+(this.$.attr("id")||o++),this.store=t.zui.store[i.name?"get":"pageGet"](this.selector,{})),"preserve"===s&&(r?this.isPreserve=!0:this.options.initialState=s="normal"),this.reload(i.data),r&&(this.isPreserve=!0),"expand"===s?this.expand():"collapse"===s?this.collapse():"active"===s&&this.expandSelect(".active"),this.$.on("click",'.list-toggle,a[href="#"],.tree-toggle',function(e){var i=t(this),a=i.parent("li");n.callEvent("hit",{target:a,item:a.data()}),n.toggle(a),i.is("a")&&e.preventDefault()}).on("click",".tree-action",function(){var e=t(this),i=e.data();if(i.action&&(i=i.action),"sort"!==i.type){var a=e.closest("li:not(.tree-action-item)");n.callEvent("action",{action:i,target:this,$item:a,item:a.data()})}})},n.prototype.preserve=function(e,i,a){if(this.isPreserve)if(e)i=i||e.data("id"),a=void 0===a&&e.hasClass("open"),a?this.store[i]=a:delete this.store[i],this.store.time=(new Date).getTime(),t.zui.store[this.options.name?"set":"pageSet"](this.selector,this.store);else{var o=this;this.store={},this.$.find("li").each(function(){o.preserve(t(this))})}},n.prototype.expandSelect=function(t){this.show(t,!0)},n.prototype.expand=function(t,e,i){t?(t.addClass("open"),!e&&this.options.animate?setTimeout(function(){t.addClass("in")},10):t.addClass("in")):t=this.$.find("li.has-list").addClass("open in"),i||this.preserve(t),this.callEvent("expand",t,this)},n.prototype.show=function(e,i,a){var o=this;e instanceof t||(e=o.$.find("li").filter(e)),e.each(function(){var e=t(this);if(o.expand(e,i,a),e)for(var n=e.parent("ul");n&&n.length&&!n.hasClass("tree");){var s=n.parent("li");s.length?(o.expand(s,i,a),n=s.parent("ul")):n=!1}})},n.prototype.collapse=function(t,e,i){t?!e&&this.options.animate?(t.removeClass("in"),setTimeout(function(){t.removeClass("open")},300)):t.removeClass("open in"):t=this.$.find("li.has-list").removeClass("open in"),i||this.preserve(t),this.callEvent("collapse",t,this)},n.prototype.toggle=function(t){var e=t&&t.hasClass("open")||t===!1||void 0===t&&this.$.find("li.has-list.open").length;this[e?"collapse":"expand"](t)},n.prototype.getOptions=function(e){this.options=t.extend({},n.DEFAULTS,this.$.data(),e),null===this.options.animate&&this.$.hasClass("tree-animate")&&(this.options.animate=!0)},n.prototype.toData=function(e,i){"function"==typeof e&&(i=e,e=null),e=e||this.$;var a=this;return e.children("li:not(.tree-action-item)").map(function(){var e=t(this),o=e.data();delete o["zui.droppable"];var n=e.children("ul");return n.length&&(o.children=a.toData(n)),"function"==typeof i?i(o,e):o}).get()},n.prototype.callEvent=function(e,i){var a;return"function"==typeof this.options[e]&&(a=this.options[e](i,this)),this.$.trigger(t.Event(e+"."+this.name,i)),a},t.fn.tree=function(e,i){return this.each(function(){var o=t(this),s=o.data(a),r="object"==typeof e&&e;s||o.data(a,s=new n(this,r)),"string"==typeof e&&s[e](i)})},t.fn.tree.Constructor=n,t(function(){t('[data-ride="tree"]').tree()})}(jQuery),function(t){t.fn.fixedDate=function(){return t(this).each(function(){var e=t(this).attr("autocomplete","off");"0000-00-00"==e.val()&&e.focus(function(){"0000-00-00"==e.val()&&e.val("").datetimepicker("update")}).blur(function(){""==e.val()&&e.val("0000-00-00")})})},window.datepickerOptions={language:t("html").attr("lang"),weekStart:1,todayBtn:1,autoclose:1,todayHighlight:1,startView:2,forceParse:0,showMeridian:1,format:"yyyy-mm-dd hh:ii",startDate:"1970-1-1"},t.extend(t.fn.datetimepicker.defaults,window.datepickerOptions),t(function(){var e={minView:2,format:"yyyy-mm-dd"},i={startView:1,minView:0,maxView:1,format:"hh:ii"},a={minView:3,startView:3,format:"yyyy-mm"};t(".datepicker-wrapper").click(function(){t(this).find(".form-date, .form-datetime, .form-time, .form-month").datetimepicker("show").focus()}),t.fn.datepicker=function(i){return this.datetimepicker(t.extend({},e,i))},t.fn.timepicker=function(e){return this.datetimepicker(t.extend({},i,e))},t.fn.monthpicker=function(e){return this.datetimepicker(t.extend({},a,e))},t.fn.datepickerAll=function(){return this.find(".form-datetime").fixedDate().datetimepicker(),this.find(".form-date").fixedDate().datepicker(),this.find(".form-time").fixedDate().timepicker(),this.find(".form-month").fixedDate().monthpicker(),this},t("body").datepickerAll()})}(jQuery),function(t){"use strict";var e="zui.fileInput",i=t.BYTE_UNITS={B:1,KB:1024,MB:1048576,GB:1073741824,TB:1099511627776},a=t.formatBytes=function(t,e,a){return void 0===e&&(e=2),a||(a=t<i.KB?"B":t<i.MB?"KB":t<i.GB?"MB":t<i.TB?"GB":"TB"),(t/i[a]).toFixed(e)+a},o=function(t){if("string"==typeof t){t=t.toUpperCase();var e=t.replace(/\d+/,"");t=parseFloat(t.replace(e,"")),t*=i[e]||i[e+"B"],t=Math.floor(t)}return t},n=function(i,s){var r=this;r.name=e;var l=r.$=t(i);s=r.options=t.extend({},n.DEFAULTS,this.$.data(),s),s.fileMaxSize&&"string"==typeof s.fileMaxSize&&(s.fileMaxSize=o(s.fileMaxSize));var d=r.$input=l.find('input[type="file"]');l.on("click",".file-input-btn",function(){d.trigger("click")}).on("click",".file-input-rename",function(){r.oldName=l.addClass("edit").find(".file-editbox").focus().val(),t.fn.fixInputGroup&&l.find(".input-group,.btn-group").fixInputGroup()}).on("click",".file-input-delete",function(){d.val(""),r.update(),s.onDelete&&s.onDelete(r)}).on("click",".file-name-cancel",function(){l.removeClass("edit").find(".file-editbox").focus().val(r.oldName)}).on("click",".file-name-confirm",function(){var e=l.find(".file-editbox"),i=t.trim(e.val());i.length?l.removeClass("edit").find(".file-title").text(i).attr("title",i):e.focus()}).on("change input paste",".file-editbox",function(){var e=t(this);e.attr("size",Math.max(5,e.val().length))}),d.on("change",function(){var t=r.getFile();t&&s.fileMaxSize&&t.size>s.fileMaxSize&&(d.val(""),(window.bootbox||window).alert(s.fileSizeError.format(a(s.fileMaxSize)))),r.update()}),r.update()};n.prototype.getFile=function(){var t=this.$input.prop("files");return t&&t[0]},n.prototype.update=function(){var t=this,e=t.$,i=t.getFile(),o=!i;e.toggleClass("normal",!o).toggleClass("empty",o),i?(t.oldName=i.name,e.find(".file-title").text(i.name).attr("title",i.name),e.find(".file-size").text(a(i.size)),e.find(".file-editbox").val(i.name).attr("size",i.name.length),t.options.onSelect&&t.options.onSelect(i,t)):e.find(".file-editbox").val("")},n.DEFAULTS={fileMaxSize:0,fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInput=function(i){return this.each(function(){var a=t(this),o=a.data(e),s="object"==typeof i&&i;o||a.data(e,o=new n(this,s)),"string"==typeof i&&o[i]()})},n.NAME=e,t.fn.fileInput.Constructor=n,t(function(){t('[data-provide="fileInput"]').fileInput()});var s="zui.fileInputList",r=function(e,i){var a=this;a.name=s;var o=a.$=t(e);i=a.options=t.extend({},r.DEFAULTS,this.$.data(),i),a.$template=o.find(".file-input").detach(),a.add()};r.prototype.add=function(){var t=this,e=t.options,i=t.$template.clone();"before"===e.appendWay?t.$.prepend(i):t.$.append(i),i.fileInput({fileMaxSize:e.eachFileMaxSize,fileSizeError:e.fileSizeError,onDelete:function(e){e.$.remove(),t.options.onDelete&&t.options.onDelete(e,t)},onSelect:function(e,i){t.add(),t.options.onSelect&&t.options.onSelect(e,i,t)}})},r.DEFAULTS={fileMaxSize:0,eachFileMaxSize:0,appendWay:"after",fileSizeError:"无法上传大于 {0} 的文件。"},t.fn.fileInputList=function(e){return this.each(function(){var i=t(this),a=i.data(s),o="object"==typeof e&&e;a||i.data(s,a=new r(this,o)),"string"==typeof e&&a[e]()})},r.NAME=s,t.fn.fileInputList.Constructor=r,t(function(){t('[data-provide="fileInputList"]').fileInputList()})}(jQuery),function(t,e){"use strict";var i="zui.table",a={zh_cn:{selectedItems:"已选择 <strong>{0}</strong> 项",attrTotal:"{0}总计 <strong>{1}</strong>"},zh_tw:{selectedItems:"已选择 <strong>{0}</strong> 项",attrTotal:"{0}总计 <strong>{1}</strong>"},en:{selectedItems:"Seleted <strong>{0}</strong> items",attrTotal:"{0} total <strong>{1}</strong>"},de:{selectedItems:"<strong>{0}</strong> ausgewählt",attrTotal:"{0} insgesamt <strong>{1}</strong>"},fr:{selectedItems:"<strong>{0}</strong> sélectionnés",attrTotal:"{0} total <strong>{1}</strong>"}},o=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),n=function(o,s){var r=this;r.name=i;var l=r.$=t(o);s=r.options=t.extend({},n.DEFAULTS,this.$.data(),s),r.langName=s.lang||t.zui.clientLang(),r.lang=t.zui.getLangData(i,r.langName,a),l.attr("id")||(l.attr("id","table-"+t.zui.uuid()),s.hot&&console.warn("ZUI: table hot replace id not defined, the element id attribute should be set.")),l.attr("data-ride")||l.attr("data-ride","table");var d=r.getTable();if(d.length){r.getTable().find("thead>tr>th").each(function(){var e=t(this);if(!e.attr("title")){var i=t.trim(e.find("a").text()||e.text()||"");i.length&&e.attr("title",i)}}),"auto"===s.checkable&&(s.checkable=!!l.find('input[type="checkbox"]').length),s.checkable&&(l.on("click",".check-all",function(){r.checkAll(!t(this).hasClass("checked"))}),s.checkOnClickRow===e&&(s.checkOnClickRow=!l.find('tr input[type="text"],tr textarea').length),s.checkOnClickRow&&l.on("click","tbody>tr",function(e){t(e.target).closest('.btn,a,.not-check,.form-control,input[type="text"],.chosen-container,td,th').length||r.checkRow(t(this))}),l.on("click",'tbody input[type="checkbox"],tbody label[for]',function(e){e.stopPropagation();var i=t(this);i.is("label")&&(i=i.closest(".checkbox-primary").find('input[type="checkbox"]')),r.checkRow(i.closest("tr"),i.is(":checked"))}),s.selectable&&t.fn.selectable&&l.selectable(t.extend({},{selector:r.isDataTable?".fixed-left tbody>tr":"tbody>tr",selectClass:"",trigger:".c-id",clickBehavior:"multi",listenClick:!1,select:function(e){r.checkRow(e.target,!0),z,t.cookie("ajax_dragSelected")||(t.cookie("ajax_dragSelected","on",{expires:config.cookieLife,path:config.webRoot}),t.ajaxSendScore("dragSelected"))},unselect:function(t){r.checkRow(t.target,!1)},rangeStyle:{border:"1px solid #006af1",backgroundColor:"rgba(50,128,252,0.2)",borderRadius:"2px"}},t.isPlainObject(s.selectable)?s.selectable:null)));var c=r.$form=l.is("form")?l:l.find("form");c.length&&(s.ajaxForm?c.ajaxForm(t.isPlainObject(s.ajaxForm)?s.ajaxForm:null):c.on("click","[data-form-action]",function(){c.attr("action",t(this).data("formAction")).submit()})),(s.fixFooter||s.fixHeader)&&(r.pageFooterHeight=t("#footer").outerHeight(),r.pageHeaderHeight=(t("#mainNavbar").outerHeight()||0)+(t("#menu").outerHeight()||0),r.updateFixUI(),t(window).on("scroll resize",function(){r.updateFixUI()}).on("sidebar.toggle querybox.toggle",function(){setTimeout(function(){r.updateFixUI()},200)})),s.group&&(l.on("click",".group-toggle",function(){r.toggleRowGroup(t(this).closest("tr").data("id"))}),t(document).on("click",".group-collapse-all",function(){r.toggleGroups(!1)}).on("click",".group-expand-all",function(){r.toggleGroups(!0)})),r.defaultStatistic=l.find(".table-statistic").html(),r.updateStatistic(),r.initModals(),r.checkItems={},r.updateCheckUI()}};n.prototype.reload=function(e){var i=this,a=i.options,o=a.replaceId;if(!o)return e&&e();"self"===o&&(o=i.$.attr("id"));var n=t("<div></div>");i.$.addClass("load-indicator loading"),n.load(window.location.href+" #"+o,function(){i.$.empty().html(n.children().html()).removeClass("load-indicator loading"),i.$.trigger("beforeTableReload"),i.updateStatistic(),i.initModals(),i.$.datepickerAll();var o=i.$.find("tbody>tr"),s=!1;t.each(i.checkItems,function(t,e){e&&(i.checkRow(o.filter('[data-id="'+t+'"]'),!0,!0),s=!0)}),s&&i.updateCheckUI(),i.$.trigger("tableReload");var r=t("#mainMenu>.btn-toolbar>.btn-active-text>.label");r.length&&r.text(i.getTable().find("tbody:first>tr:not(.table-children)").length),i.$.find('[data-ride="pager"]').pager(),e&&e(),a.afterReload&&a.afterReload()})},n.prototype.initModals=function(){var e=this,i=e.options,a=e.$.find(i.iframeModalTrigger);if(a.length){var o={type:"iframe",onHide:i.replaceId?function(){var a=t.cookie("selfClose");(1==a||i.hot)&&(t("#triggerModal").data("cancel-reload",1),e.reload(function(){t.cookie("selfClose",0)}))}:null};a.modalTrigger(o)}},n.prototype.getTable=function(){var t=this.$;if(this.isDataTable)return t.find("div.datatable");var e=t.is("table")?t:t.find("table:not(.fixed-header-copy)").first();return e.is(".datatable")&&(this.isDataTable=!0,e=t.find("div.datatable")),e},n.prototype.toggleGroups=function(e){var i=this,a={};i.$.find("tbody>tr").each(function(){var o=t(this).closest("tr").data("id");a[o]||i.toggleRowGroup(o,e)})},n.prototype.toggleRowGroup=function(i,a){var o=this.$.find('tbody>tr[data-id="'+i+'"]'),n=o.filter(".group-summary"),s=a===e?!n.hasClass("hidden"):!!a;o.not(".group-summary").toggleClass("hidden",!s),n.toggleClass("hidden",s),t("body").toggleClass("table-group-collapsed",!this.$.find("tbody>tr.group-summary.hidden").length)},n.prototype.updateStatistic=function(){var i=this,a=i.$.find(".table-statistic");if(a.length){if(i.defaultStatistic===e&&(i.defaultStatistic=a.html()),i.options.statisticCreator)return void a.html(i.options.statisticCreator(i)||i.defaultStatistic);var o=i.statisticCols;if(!o&&o!==!1){o={};var n=!1;i.getTable().find("thead th").each(function(e){var i=t(this),a=i.data("statistic");a&&(n=!0,o[e]={format:a,name:t.trim(i.text())})}),i.statisticCols=!!n&&o}var s=0;o&&t.each(o,function(t){o[t].total=0,o[t].checkedTotal=0}),i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr").each(function(){var i=t(this),a=i.hasClass("checked"),n=i.children("td");a&&s++,o&&t.each(o,function(t){var i=n.eq(t),s=i.data("statistic-val");s===e&&(s=i.text());var r=parseFloat(s);isNaN(r)&&(r=parseFloat(s.replace(/[^0-9\.]/gi,""))),isNaN(r)&&(r=0),o[t].total+=r,a&&(o[t].checkedTotal+=r)})});var r=[];if(s)r.push(i.lang.selectedItems.format(s));else if(i.defaultStatistic)return void a.html(i.defaultStatistic);o&&t.each(o,function(t){var e=o[t],a=e[s?"checkedTotal":"total"];e.format&&(a=e.format.format(a)),r.push(i.lang.attrTotal.format(e.name,a))}),a.html(r.join(", "))}},n.prototype.updateFixUI=function(e){var i=this,a=(new Date).getTime();if(!e&&(i.lastUpdateCall&&clearTimeout(i.lastUpdateCall),!i.lastUpdateTime||a-i.lastUpdateTime<100))return void(i.lastUpdateCall=setTimeout(function(){i.updateFixUI(!0)},200));if(i.lastUpdateTime=a,i.lastUpdateCall&&(clearTimeout(i.lastUpdateCall),i.lastUpdateCall=null),o){var n=i.getTable();if(n.parent().is(".table-responsive")){var s=n.find("thead"),r=0;s.find("th").each(function(){r+=t(this).outerWidth()}),n.css("min-width",r)}}i.options.fixHeader&&!i.isDataTable&&i.fixHeader(),i.options.fixFooter&&i.fixFooter()},n.prototype.fixHeader=function(){var e=this,i=e.getTable(),a=i.find("thead"),o=a[0].getBoundingClientRect(),n=e.options.fixHeader,s=t.isFunction(n)?n(o,a):o.top<("number"==typeof n?n:e.pageHeaderHeight||-5),r=e.$.find(".fix-table-copy-wrapper"),l=i.parent(),d=l.is(".table-responsive");if(s){if(r.length||(r=t('<div class="fix-table-copy-wrapper" style="overflow: hidden; position:fixed; z-index: 3; top: 0;"></div>').append(t('<table class="fixed-header-copy"></table>').addClass(i.attr("class")).append(a.clone())).insertAfter(i)),d){var c=l[0].getBoundingClientRect();r.css({top:e.pageHeaderHeight||0,left:c.left,width:l.width()}),r.find(".fixed-header-copy").css({left:o.left-c.left,position:"relative",minWidth:i.width()}),l.data("fixHeaderScroll")||(l.data("fixHeaderScroll",1),i.width()>l.width()&&l.on("scroll",function(){e.fixHeader()}))}else r.css({top:e.pageHeaderHeight||0,left:o.left,width:o.width});var h=r.find("th");a.find("th").each(function(e){h.eq(e).css("width",t(this).outerWidth())})}else r.remove()},n.prototype.fixFooter=function(){var e,i=this,a=i.getTable(),o=i.$.find(".table-footer");if(i.isDataTable)e=a[0].getBoundingClientRect();else{var n=a.find("tbody");if(!n.length)return;e=n[0].getBoundingClientRect(),e=n[0].getBoundingClientRect()}var s=i.options.fixFooter;o.toggleClass("fixed-footer",!!r);var r=t.isFunction(s)?s(e,o):e.bottom>window.innerHeight-("number"==typeof s?s:i.pageFooterHeight||5);o.toggleClass("fixed-footer",!!r),a.toggleClass("with-footer-fixed",!!r),a.trigger("fixFooter",r);var l=t("body"),d=l.hasClass("body-modal");if(r){var c=a.parent(),h=c.is(".table-responsive");o.css({bottom:i.pageFooterHeight||0,left:h?c[0].getBoundingClientRect().left:e.left,width:h?c.width():e.width}),d&&l.css("padding-bottom",40),i.$.css("margin-bottom",o.outerHeight())}else o.css({width:"",left:0,bottom:0}),d&&l.css("padding-bottom",0),i.$.css("margin-bottom","")},n.prototype.checkAll=function(e){var i=this,a=i.$.find(i.isDataTable?".fixed-left tbody>tr":"tbody>tr");a.each(function(){var a=t(this);a.parent().closest("tr").length||i.checkRow(t(this),e,!0)}),i.updateCheckUI()},n.prototype.checkRow=function(t,i,a){var o=this;o.isDataTable&&!t.is(".datatable-row-left")&&(t=o.getTable().find('.datatable-row-left[data-index="'+t.data("index")+'"]'));var n=t.find('input[type="checkbox"]');n.length&&(i===e&&(i=!n.is(":checked")),o.isDataTable?o.getTable().find('.datatable-row[data-index="'+t.data("index")+'"]').toggleClass("checked",i):t.toggleClass("checked",i),this.checkItems[t.data("id")]=i,n.prop("checked",i).trigger("change"),a||o.updateCheckUI())},n.prototype.updateCheckUI=function(){var e=this,i=e.getTable(),a=i.find(e.isDataTable?".fixed-left tbody>tr":"tbody>tr").filter(function(){var e=t(this);return!e.hasClass("group-summary")&&e.find('input[type="checkbox"]').length&&!e.parent().closest("tr").length}),o=!1,n=null,s=0,r=!1,l=a.length;a.each(function(a){var d=t(this),c=d.find('input[type="checkbox"]');r=c.is(":checked");var h=e.isDataTable?i.find('.datatable-row[data-index="'+d.data("index")+'"]'):d;h.toggleClass("checked",r),h.toggleClass("row-check-begin",r&&!o),n&&n.toggleClass("row-check-end",!r&&o),r&&(s+=1),n=h,o=r,l===a+1&&h.toggleClass("row-check-end",r)}),e.$.toggleClass("has-row-checked",s>0).find(".check-all").toggleClass("checked",!(!l||s!==l)),e.updateStatistic(),e.options.onCheckChange&&e.options.onCheckChange()},n.DEFAULTS={checkable:"auto",ajaxForm:!1,selectable:!0,fixHeader:!0,fixFooter:!0,iframeWidth:900,replaceId:"self",hot:!1,iframeModalTrigger:'.iframe,[data-toggle="modal"][data-type="iframe"]'},t.fn.table=function(e){return this.each(function(){var a=t(this),o=a.data(i),s="object"==typeof e&&e;o||a.data(i,o=new n(this,s)),"string"==typeof e&&o[e]()})},n.NAME=i,t.fn.table.Constructor=n,t(function(){t('[data-ride="table"]').table()})}(jQuery,void 0),function(t){"use strict";var e="zui.searchList",i=function(t,e){if(t&&t.length)for(var i=0;i<t.length;++i)if(e.indexOf(t[i])<0)return!1;return!0},a=function(i,o){var n=this;n.name=e;var s=n.$=t(i);o=n.options=t.extend({},a.DEFAULTS,this.$.data(),o);var r=s.find(o.searchBox);r.length&&(r.searchBox({onSearchChange:function(t){n.search(t)},onKeyDown:function(t){var e=t.which;if(13===e){var i=n.getActiveItem();i.length&&(o.onSelectItem?o.onSelectItem(i):window.location.href=i.attr("href")),t.preventDefault()}else if(38===e){var i=n.getActiveItem();i.removeClass("active");for(var a=i.prev();a.length&&!a.is(".search-list-item:not(.hidden)");)a=a.prev();a.length||(a=n.getItems().not(".hidden").last()),n.scrollTo(a.addClass("active")),t.preventDefault()}else if(40===e){var i=n.getActiveItem();i.removeClass("active");for(var s=i.next();s.length&&!s.is(".search-list-item:not(.hidden)");)s=s.next();s.length||(s=n.getItems().not(".hidden").first()),n.scrollTo(s.addClass("active")),t.preventDefault()}},onFocus:function(){s.addClass("searchbox-focus")},onBlur:function(){s.removeClass("searchbox-focus")}}),n.searchBox=r.data("zui.searchBox"),n.search(n.searchBox.getSearch()));var l=n.$menu=s.closest(".dropdown-menu");if(l.length){n.isDropdown=!0,s.on("click",function(e){t(e.target).closest(o.selector+",[data-toggle]").length||e.stopPropagation()});var d=l.parent();d.on(d.hasClass("dropdown-hover")?"mouseenter":"shown.zui.dropdown",function(){n.tryLoadRemote(function(){if(d.hasClass("dropup")){var t=null,e=d[0].getBoundingClientRect();e.top<220&&(t=Math.floor(e.top)-57),l.find(".list-group").css("max-height",t)}setTimeout(function(){n.searchBox&&n.searchBox.focus()},50)})})}s.on("mouseenter",o.selector,function(){s.find(n.options.selector).not(".hidden").removeClass("active"),t(this).addClass("active")})};a.prototype.tryLoadRemote=function(t){var e=this,i=e.options;i.url||i.ajax?e.isLoaded?t():e.loadRemote(t):t()},a.prototype.loadRemote=function(e){var i=this,a=i.options;i.$menu.addClass("load-indicator loading").find(".list-group").remove(),i.isLoaded=!1,t.ajax(t.extend({url:a.url,type:"GET",dataType:"html",success:function(a,o,n){var s=t(a);s.hasClass("list-group")||(s=t('<div class="list-group"></div>').append(s)),i.$menu.append(s),i.$menu.removeClass("loading"),i.isLoaded=!0,e&&e(!0)},error:function(){i.$menu.removeClass("loading").append('<div class="list-group"><div class="text-error has-padding">'+(a.errorText||window.lang&&window.lang.timeout)+"</div></div>"),e&&e(!1)}},a.ajax))},a.prototype.scrollTo=function(t){t.length&&t[0].scrollIntoViewIfNeeded&&t[0].scrollIntoViewIfNeeded({behavior:"smooth"})},a.prototype.getItems=function(){return this.$.find(this.options.selector).addClass("search-list-item")},a.prototype.getActiveItem=function(){return this.getItems().filter(".active:first")},a.prototype.search=function(e){var a=this,o=void 0===e||null===e||""===e;a.$.toggleClass("has-search-text",!o);var n=a.getItems().removeClass("active");if(o)n.removeClass("hidden");else{var s=t.trim(e).split(" ");n.each(function(){var e=t(this),a=e.text()+" "+(e.data("key")||e.data("filter"));e.toggleClass("hidden",!i(s,a))})}a.scrollTo(n.not(".hidden").first().addClass("active"))},a.DEFAULTS={selector:".list-group a:not(.not-list-item)",searchBox:".search-box",onSelectItem:null},t.fn.searchList=function(i){return this.each(function(){var o=t(this),n=o.data(e),s="object"==typeof i&&i;n||o.data(e,n=new a(this,s)),"string"==typeof i&&n[i]()})},a.NAME=e,t.fn.searchList.Constructor=a,t(function(){t('[data-ride="searchList"]').searchList()})}(jQuery),function(t){window.config||(window.config={}),window.createLink||(t.createLink=window.createLink=function(t,e,a,o,n){if(o||(o=config.defaultView),n||(n=!1),a)for(a=a.split("&"),i=0;i<a.length;i++){var s=a[i].split("=");a[i]=[s.shift(),s.join("=")]}var r;if("GET"!=config.requestType){if("PATH_INFO"==config.requestType&&(r=config.webRoot+t+config.requestFix+e),"PATH_INFO2"==config.requestType&&(r=config.webRoot+"index.php/"+t+config.requestFix+e),a)for(i=0;i<a.length;i++)r+=config.requestFix+a[i][1];r+="."+o}else if(r=config.router+"?"+config.moduleVar+"="+t+"&"+config.methodVar+"="+e+"&"+config.viewVar+"="+o,a)for(i=0;i<a.length;i++)r+="&"+a[i][0]+"="+a[i][1];if(void 0!==config.onlybody&&"yes"==config.onlybody||n){var l="GET"!=config.requestType?"?onlybody=yes":"&onlybody=yes";r+=l}return r}),t(function(){var e=t("#main,#mainContent,#mainRow,.auto-fade-in");e.length&&e.hasClass("fade")&&setTimeout(function(){e.addClass("in")},e.data("fadeTime")||200)});var e=function(t){var e=0;if(t){var i=t.split(":");e+=60*parseInt(i[0]),e+=parseInt(i[1])}return e},a=function(t){t%=1440;var e=Math.floor(t/60),i=t%60;return e<10&&(e="0"+e),i<10&&(i="0"+i),e+":"+i},o=function(t){if("string"==typeof t&&(t=e(t)),"number"==typeof t)if(t<1e5){var i=new Date;i.setHours(Math.floor(t/60)%24),i.setMinutes(t%60),t=i}else t=new Date(t);return t},n=function(t,i){for(var n=i?o(i):new Date,s=n.getHours(),r=10*Math.floor(n.getMinutes()/10)+10,l=0;l<24;++l){var d=(l+s)%24;if(!(d<5))for(var c=0;c<6;++c){var h=a(60*d+10*c+r);t.append('<option value="'+h+'">'+h+"</option>")}}t.val()||(time=e(n.format("hh:mm")),time=time-time%10+10,t.val(a(time)))};t.fn.timeSpanControl=function(i){return this.each(function(){var s=t(this),r=t.extend({},i,s.data()),l=s.find('[name="begin"],.control-time-begin'),d=s.find('[name="end"],.control-time-end'),c=function(){var t=l.val();if(s.find(".hide-empty-begin").toggleClass("hide",!t),t){var i=a(e(t)+30);d.find('option[value="'+i+'"]').length&&d.val(i),r.onChange&&r.onChange(d,i)}};if(s.data("timeSpanControlInit")){if(r.begin){var h=o(r.begin).format("hh:mm");l.find('option[value="'+h+'"]').length&&l.val(h),r.onChange&&r.onChange(l,h)}if(r.end){var u=o(r.end).format("hh:mm");d.find('option[value="'+u+'"]').length&&d.val(u),r.onChange&&r.onChange(d,u)}}else l.on("change",c),n(l,r.begin),n(d,r.end),s.data("timeSpanControlInit",!0);r.end||c()})},t.timeSpanControl={convertTimeToNum:e,convertNumToTime:a,initTimeSelect:n,createTime:o},t.removeAnchor=window.removeAnchor=function(t){var e=t.lastIndexOf("#");return e>-1?t.substr(0,e):t},t.refreshPage=function(){location.href=removeAnchor(location.href)},t.extend(t.fn.table.Constructor.DEFAULTS,{fixFooter:36}),t.chosenDefaultOptions={middle_highlight:!0,disable_search_threshold:1,compact_search:!0,allow_single_deselect:!0,placeholder_text_single:" ",placeholder_text_multiple:" ",max_drop_width:400,search_contains:!0,drop_direction:function(){var e=t(this.container).closest(".table-responsive:not(.scroll-none)");if(e.length){if(this.drop_directionFixed)return this.drop_directionFixed;var i="down",a=this.container.find(".chosen-drop"),o=this.container.position(),n=a.outerHeight();return o.top>=n&&o.top+n<e.outerHeight()&&(i="up"),this.drop_directionFixed=i,i}return"auto"}},t.chosenSimpleOptions=t.extend({},t.chosenDefaultOptions,{disable_search_threshold:6}),t.fn._chosen=t.fn.chosen,t.fn.chosen=function(e){return"string"==typeof e?this._chosen(e):this.each(function(){var i=t(this).addClass("chosen-controled");return i._chosen(t.extend({},i.hasClass("chosen-simple")?t.chosenSimpleOptions:t.chosenDefaultOptions,i.data(),e))})};var s=function(e){e.each(function(){var e=t(this);e.closest(".template").length||e.chosen()})};t.extend(t.fn.pager.Constructor.DEFAULTS,{maxNavCount:8,prevIcon:"icon-angle-left",nextIcon:"icon-angle-right",firstIcon:"icon-first-page",lastIcon:"icon-last-page",navEllipsisItem:"…",menuDirection:"dropup",pageSizeOptions:[5,10,15,20,25,30,35,40,45,50,100,200,500,1e3,2e3],elements:["total_text","size_menu","first_icon","prev_icon",'<div class="pager-label"><strong>{page}</strong>/<strong>{totalPage}</strong></div>',"next_icon","last_icon"],onPageChange:function(e,i){e.recPerPage!==i.recPerPage&&t.cookie(this.options.pageCookie,e.recPerPage,{expires:config.cookieLife,path:config.webRoot}),e.recPerPage!==i.recPerPage&&(window.location.href=this.createLink())}}),t.extend(t.zui.Messager.DEFAULTS,{cssClass:"messagger-rz",icons:{success:"check-sign",info:"info",warning:"bell",danger:"alert"}}),t.fn.reverseOrder=function(){return this.each(function(){var e=t(this);e.prependTo(e.parent())})};var r=function(e,i){var a=t(e);if(!a.data("historiesInited")){a.data("historiesInited",1);var o=a.find(".histories-list").first();i=t.extend({},a.data(),i);var n=!0,s=!1;if(a.on("click",".btn-reverse",function(){o.children("li").reverseOrder(),n=!n,t(this).find(".icon").toggleClass("icon-arrow-up",n).toggleClass("icon-arrow-down",!n),t.cookie&&t.cookie("historyOrder",n?"log-asc":"log-desc",{path:v.webRoot});var e="#lastComment",i=t(e);i.length&&window.KindEditor&&t.fn.kindeditor&&(window.KindEditor.remove(e),
i.kindeditor())}).on("click",".btn-expand-all",function(){var e=t(this).find(".icon");s=!s,e.toggleClass("icon-plus",!s).toggleClass("icon-minus",s),o.children("li").toggleClass("show-changes",s)}).on("click",".btn-expand",function(){t(this).closest("li").toggleClass("show-changes")}).on("click",".btn-strip",function(){var e=t(this),a=e.find(".icon"),o=a.hasClass("icon-code");a.toggleClass("icon-code",!o).toggleClass("icon-text",o),e.attr("title",o?i.original:i.textdiff),e.closest("li").toggleClass("show-original",o)}),o.find(".btn-strip").attr("title",i.original),t.cookie){var r=t.cookie("historyOrder");"log-desc"===r&&a.find(".btn-reverse").click()}var l=a.find(".modal-comment").modal({show:!1}).on("shown.zui.modal",function(){var t=l.find("#comment");t.length&&(t.focus(),window.editor&&window.editor.comment&&window.editor.comment.focus())}).on("show.zui.modal",function(){var e=l.find("#comment");e.length&&!e.data("keditor")&&t.fn.kindeditor&&e.kindeditor()});a.on("click",".btn-comment",function(t){l.modal("toggle"),t.preventDefault()}).on("click",".btn-edit-comment,.btn-hide-form",function(){t(this).closest("li").toggleClass("show-form")});var d=a.find(".comment-edit-form");d.ajaxForm({success:function(t,e,i,a){setTimeout(function(){d.closest("li").removeClass("show-form")},2e3)}})}};t.fn.histories=function(t){return this.each(function(){r(this,t)})},t(function(){var e=t("#dropMenu,.drop-menu");e.length&&e.on("click",".toggle-right-col",function(e){var i=t(this).closest("#dropMenu,.drop-menu").toggleClass("show-right-col");i.find(".search-box").width(i.hasClass("show-right-col")?i.find(".col-left").width()-20:"auto"),e.stopPropagation(),e.preventDefault()})}),t.fn.colorPicker&&t.extend(t.fn.colorPicker.Constructor.DEFAULTS,{colors:["#3DA7F5","#75C941","#2DBDB2","#797EC9","#FFAF38","#FF4E3E"]}),t.extend(t.fn.modal.bs.Constructor.DEFAULTS,{scrollInside:!0,backdrop:"static",headerHeight:100,onSetScrollbar:function(e){t("#mainNavbar,#menu").css("padding-right",e)}});var l={scrollInside:!0,backdrop:"static",headerHeight:40,name:"ajaxModal",delay:200,handleLinkInIframe:".loadInModal,.load-in-modal"};t.extend(t.zui.ModalTrigger.DEFAULTS,l),t.extend(t.zui.modalTrigger.options,l),t.fixedTableHead=window.fixedTableHead=function(e,i){var a=t(e);if(a.is("table")||(a=a.find("table")),a.length){var o=t(i||window),n=null,s=function(){var e=a.children("thead"),i=e[0].getBoundingClientRect(),o=a.next(".fixed-head-table");if(i.top<0){var s=e.width();if(o.length){if(n!==s){n=s;var r=o.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())})}}else{var o=t("<table class='table fixed-head-table' style='position:fixed; top: 0;'></table>").addClass(a.attr("class")),l=e.clone(),r=l.find("th");e.find("th").each(function(e){r.eq(e).width(t(this).width())}),o.append(l).insertAfter(a)}o.css({left:i.left,width:i.width}).show()}else o.hide()};o.on("scroll",s).on("resize",s),s()}},t(document).on("click","tr[data-url]",function(e){if(!t(e.target).is("a")){var i=t(this),a=i.data("href")||i.data("url");a&&(window.location.href=a)}}),"yes"===config.onlybody&&self===parent&&(window.location.href=window.location.href.replace("?onlybody=yes","").replace("&onlybody=yes","")),t.fn.tree.Constructor.DEFAULTS.initialState="preserve",t.closeModal=function(e,i,a){t.zui.closeModal(a,e,i)};var d=function(e){var i,a,o=t(e),n=o.children(".input-group-addon,.form-control:not(.chosen-controled),.chosen-container,.btn,.input-control,.input-group-btn,.datepicker-wrapper,.picker").not(".hidden,:hidden"),s=1===n.length;n.each(function(e){var o=t(this),r=o.is(".input-group-addon")?"addon":o.is(".chosen-container")?"chosen":o.is(".btn")?"btn":o.is(".input-control,.datepicker-wrapper")?"insideInput":o.is(".input-group-btn")?"insideBtn":o.is(".picker")?"picker":"input",l="btn"===r?4:1,d={};if(s)d.borderTopLeftRadius=l,d.borderBottomLeftRadius=l,d.borderTopRightRadius=l,d.borderBottomRightRadius=l;else{var c=!i,h=e===n.length-1;d.borderTopLeftRadius=0,d.borderBottomLeftRadius=0,d.borderTopRightRadius=0,d.borderBottomRightRadius=0,c&&("addon"===r&&(d.borderLeftWidth=1),d.borderTopLeftRadius=l,d.borderBottomLeftRadius=l),h&&("addon"===r&&(d.borderRightWidth=1),d.borderTopRightRadius=l,d.borderBottomRightRadius=l),a?"chosen"!==a&&"picker"!==a&&"input"!==a&&"btn"!==a&&"insideInput"!==a&&"insideBtn"!==a||"chosen"!==r&&"picker"!==r&&"input"!==r&&"btn"!==r&&"insideInput"!==r&&"insideBtn"!==r?"addon"===a&&"addon"===r&&(d.borderLeftWidth=1):d.borderLeftColor="transparent":d.borderLeftColor=""}("insideBtn"===r?o.children(".btn"):"insideInput"===r?o.find(".form-control"):"chosen"===r?o.find(".chosen-single,.chosen-choices"):"picker"===r?o.find(".picker-selections"):o).css(d),i=o,a=r})};t.fn.fixInputGroup=function(){return this.each(function(){var e=t(this);e.is(".input-group,.btn-group")||(e=e.find(".input-group,.btn-group"),e.length&&e.fixInputGroup()),d(this)})};var c=function(){var e=t(".main-actions>.btn-toolbar");if(e.length){var i,a,o=!1,n=null,s=e.children(),r=s.length;for(s.each(function(e){i=t(this),a=i.is(".divider"),a&&!n&&i.hide(),o||a||(o=!0),n=a?null:i,!a||e!==r-1&&0!==e||i.hide()});i.length&&i.is(".divider");)i=i.hide().prev();o||e.hide()}},h=function(){for(var e=t("#mainContent>.main-row>.main-col,#mainContent>.main-col"),i=e.children(".main-actions"),a=i.prev();a.length&&a.is(":hidden");)a=a.prev();if(i.length&&a.length){t('<div class="main-actions-holder"></div>').css("height",i.outerHeight()).insertAfter(i);var o=function(){var e=a[0].getBoundingClientRect(),o=e.top+e.height+120>t(window).height();t("body").toggleClass("main-actions-fixed",o),o&&i.width(a.width())};t.resetToolbarPosition=o,o(),t(window).on("resize scroll",o)}},u=t.appAvatarTones=["#56c6ed","#787bff","#edcb45","#ff7940"],p=t.namedAppIcons={superadmin:{color:"#787bff",icon:"config-outline"},home:{color:"#56c6ed",icon:"home"},c:{color:"#787bff",icon:"crm"},o:{color:"#edcb45",icon:"oa"},t:{color:"#ff7940",icon:"team"},p:{color:"#56c6ed",icon:"proj"},d:{color:"#787bff",icon:"doc"},g:{color:"#56c6ed",icon:"g"},$:{color:"#edcb45",icon:"cash"},h:{color:"#ff7940",icon:"hr"},i:{color:"#56c6ed",icon:"psi"},f:{color:"#787bff",icon:"flow"},a:{color:"#edcb45",icon:"ameba"},z:{color:"#56c6ed",icon:"zentao"},k:{color:"#ff7940",icon:"k"},edu:{color:"#787bff",icon:"e"},todo:{color:"#00da88",icon:"check-circle"},action:{color:"#16a8f8",icon:"file-text"},welfare:{color:"#ff7940",icon:'gift'}};p.dashboard=p.home,p.crm=p.c,p.oa=p.o,p.team=p.t,p.proj=p.p,p.doc=p.d,p.cash=p.$,p.hr=p.h,p.psi=p.i,p.flow=p.f,p.ameba=p.a,p.zentao=p.z,p.knowledge=p.k,p.train=p.k,p.gantt=p.g,t.fn.renderAvatar=function(){return this.each(function(){var e=t(this);if(e.hasClass("avatar-app")){var i=""+e.data("code");if(e.find("img,.text,.icon").length&&(!p[i]||e.find(".icon").length))return void(e.data("tone")||e.attr("data-tone",u[(e.data("id")||0)%4]));if(p[i])e.attr("data-tone",p[i].color).html('<i class="icon icon-'+p[i].icon+'" style="color: '+p[i].color+'"></i>');else{var a=e.data("id"),o=""+e.data("name"),n=e.hasClass("avatar-user")?1:o.length,s=u[a%4];e.attr("data-tone",s).addClass("with-text").css("color",s),n>1&&e.addClass("with-double-chars"),e.html('<div class="text-icon" style="border-color:'+s+'"><span class="text"><span>'+(n>0?o.slice(0,1).toUpperCase():"")+'</span><span class="text-extra">'+(n>1?o.slice(1,2).toUpperCase():"")+"</span></span></div>")}}else{if(e.find("img").length)return;var a=e.data("id"),o=""+e.data("name"),r=new t.zui.Color({h:41*t.zui.strCode(a)%360,s:.8,l:.63}),s=r.toCssStr(),l=r.contrast().toCssStr();if(e.css({backgroundColor:s,color:l}),!e.find(".text,.icon").length)if(o){var n=e.hasClass("avatar-user")?1:o.length;e.attr("data-tone",s).addClass("with-text").css("color",s),n>1&&e.addClass("with-double-chars"),e.html('<div class="text-icon" style="border:none;color:'+l+'"><span class="text"><span>'+(n>0?o.slice(0,1).toUpperCase():"")+'</span><span class="text-extra">'+(n>1?o.slice(1,2).toUpperCase():"")+"</span></span></div>")}else e.append('<i class="icon icon-user"></i>')}})},t.showAppNotification=function(e){if(e.app&&t.namedAppIcons[e.app]){var i=t('<div class="avatar avatar-app avatar-inverse"></div>').attr({"data-code":e.app,"data-id":e.app,"data-name":e.appName||e.title}).addClass(e.avatarClass||"avatar-lg"),a=i.renderAvatar()[0].outerHTML;e=t.extend(e,{icon:{html:a}})}return t.zui.showNotification(e)};var f=t.zui.initPage=function(e){var i=t(e||"body");i.find(".histories").histories(),s(i.find(".chosen,.chosen-simple")),t.fn.datepickerAll&&i.datepickerAll(),i.find(".input-group,.btn-group").fixInputGroup(),i.find(".avatar-app,.avatar-user").renderAvatar(),i.find('[data-provide="fileInputList"]').fileInputList()};t(function(){t("body").addClass("m-{currentModule}-{currentMethod} app-{appName}".format(config)),t("#menuActions").appendTo("#menu>.container"),f(),c(),h(),t(document).on("loaded.zui.modal",function(e,i){setTimeout(function(){f(i&&"iframe"===i.modalType?i.jQuery("body"):t(e.target))},100)})})}(jQuery);
