/*!
 * ZUI: zui for ranzhi - v1.7.0 - 2017-11-07
 * http://zui.sexy
 * GitHub: https://github.com/easysoft/zui.git 
 * Copyright (c) 2017 cnezsoft.com; Licensed MIT
 */
/*! Some code copy from Bootstrap v3.0.0 by @fat and @mdo. (Copyright 2013 Twitter, Inc. Licensed under http://www.apache.org/licenses/)*/
!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(){return 1e3*(new Date).getTime()+o++%1e3},callEvent:function(e,a,o){if(t.isFunction(e)){o!==i&&(e=t.proxy(e,o));var n=e(a);return a&&(a.result=n),!(n!==i&&!n)}return 1},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||"zh_cn"}return i.replace("-","_").toLowerCase()},strCode:function(t){var e=0;if(t&&t.length)for(var i=0;i<t.length;++i)e+=i*t.charCodeAt(i);return e},getMouseButtonCode:function(t){return"number"!=typeof t&&(t=a[t]),t!==i&&null!==t||(t=-1),t}}),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];t.isFunction(d)&&(l.result=t.zui.callEvent(d,l,o))}return n.trigger(l),l}}(jQuery,window,void 0),function(){"use strict";String.prototype.format||(String.prototype.format=function(t){var e=this;if(arguments.length>0){var i;if(arguments.length<=2&&"object"==typeof t)for(var a in t)void 0!==t[a]&&(i=new RegExp("("+(arguments[1]?arguments[1].replace("0",a):"{"+a+"}")+")","g"),e=e.replace(i,t[a]));else for(var o=0;o<arguments.length;o++)void 0!==arguments[o]&&(i=new RegExp("({["+o+"]})","g"),e=e.replace(i,arguments[o]))}return e}),String.prototype.isNum||(String.prototype.isNum=function(t){if(null!==t){var e,i;return i=/\d*/i,e=t.match(i),e==t}return!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 t.isFunction(e)?(o=e,a):(o=e.handler,void(e.handler=a))}}}(jQuery,this),function(){"use strict";Date.ONEDAY_TICKS=864e5,Date.prototype.format||(Date.prototype.format=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),"S+":this.getMilliseconds()};/(y+)/i.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)));for(var i in e)new RegExp("("+i+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[i]:("00"+e[i]).substr((""+e[i]).length)));return t}),Date.prototype.addMilliseconds||(Date.prototype.addMilliseconds=function(t){return this.setTime(this.getTime()+t),this}),Date.prototype.addDays||(Date.prototype.addDays=function(t){return this.addMilliseconds(t*Date.ONEDAY_TICKS),this}),Date.prototype.clone||(Date.prototype.clone=function(){var t=new Date;return t.setTime(this.getTime()),t}),Date.isLeapYear||(Date.isLeapYear=function(t){return t%4===0&&t%100!==0||t%400===0}),Date.getDaysInMonth||(Date.getDaysInMonth=function(t,e){return[31,Date.isLeapYear(t)?29:28,31,30,31,30,31,31,30,31,30,31][e]}),Date.prototype.isLeapYear||(Date.prototype.isLeapYear=function(){return Date.isLeapYear(this.getFullYear())}),Date.prototype.clearTime||(Date.prototype.clearTime=function(){return this.setHours(0),this.setMinutes(0),this.setSeconds(0),this.setMilliseconds(0),this}),Date.prototype.getDaysInMonth||(Date.prototype.getDaysInMonth=function(){return Date.getDaysInMonth(this.getFullYear(),this.getMonth())}),Date.prototype.addMonths||(Date.prototype.addMonths=function(t){var e=this.getDate();return this.setDate(1),this.setMonth(this.getMonth()+t),this.setDate(Math.min(e,this.getDaysInMonth())),this}),Date.prototype.getLastWeekday||(Date.prototype.getLastWeekday=function(t){t=t||1;for(var e=this.clone();e.getDay()!=t;)e.addDays(-1);return e.clearTime(),e}),Date.prototype.isSameDay||(Date.prototype.isSameDay=function(t){return t.toDateString()===this.toDateString()}),Date.prototype.isSameWeek||(Date.prototype.isSameWeek=function(t){var e=this.getLastWeekday(),i=e.clone().addDays(7);return t>=e&&t<i}),Date.prototype.isSameYear||(Date.prototype.isSameYear=function(t){return this.getFullYear()===t.getFullYear()})}(),+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",p="finish",f="."+i+"."+l.id,u="mousedown"+f,g="mouseup"+f,m="mousemove"+f,v=l.options,b=v.selector,y=v.handle,w=d,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&&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(f),!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&&w.css(o),v[p]&&v[p]({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()},$=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 p=t(v.container),f=w.offset();o=p.offset(),a={x:i.pageX,y:i.pageY},n={x:i.pageX-f.left+o.left,y:i.pageY-f.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(u,y,$):b?d.on(u,b,$):d.on(u,$)},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},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,p,f,u,g,m,v=this,b=v.$,y=v.options,w=y.deviation,C="."+a+"."+v.id,x="mousedown"+C,$="mouseup"+C,k="mousemove"+C,T=y.selector,E=y.handle,z=y.flex,D=y.container,S=y.canMoveHere,L=b,O=!1,j=D?t(y.container).first():T?b:t("body"),I=function(e){if(O&&(u={left:e.pageX,top:e.pageY},!(i.abs(u.left-h.left)<w&&i.abs(u.top-h.top)<w))){if(null===s){var a=j.css("position");"absolute"!=a&&"relative"!=a&&"fixed"!=a&&(d=a,j.css("position","relative")),s=L.clone().removeClass("drag-from").addClass("drag-shadow").css({position:"absolute",width:L.outerWidth(),transition:"none"}).appendTo(j),L.addClass("dragging"),v.trigger("start",{event:e,element:L})}var c={left:u.left-f.left,top:u.top-f.top},m={left:c.left-p.left,top:c.top-p.top};s.css(m),t.extend(g,u);var b=!1;r=!1,z||o.removeClass("drop-to");var C=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(u.left>n&&u.top>s&&u.left<n+a&&u.top<s+o&&(C&&C.removeClass("drop-to"),C=e,!y.nested))return!1}),C){r=!0;var x=C.data("id");L.data("id")!=x&&(l=!1),(null===n||n.data("id")!==x&&!l)&&(b=!0),n=C,z&&o.removeClass("drop-to"),n.addClass("drop-to")}z?null!==n&&n.length&&(r=!0):(L.toggleClass("drop-in",r),s.toggleClass("drop-in",r)),S&&S(L,n)===!1||v.trigger("drag",{event:e,isIn:r,target:n,element:L,isNew:b,selfTarget:l,clickOffset:f,offset:c,position:{left:c.left-p.left,top:c.top-p.top},mouseOffset:u}),e.preventDefault()}},A=function(i){if(t(e).off(C),clearTimeout(m),O){if(O=!1,d&&j.css("position",d),null===s)return L.removeClass("drag-from"),void v.trigger("always",{event:i,cancel:!0});r||(n=null);var a=!0;u=i?{left:i.pageX,top:i.pageY}:g;var c={left:u.left-f.left,top:u.top-f.top},h={left:u.left-g.left,top:u.top-g.top};g.left=u.left,g.top=u.top;var b={event:i,isIn:r,target:n,element:L,isNew:!l&&null!==n,selfTarget:l,offset:c,mouseOffset:u,position:{left:c.left-p.left,top:c.top-p.top},lastMouseOffset:g,moveOffset:h};a=v.trigger("beforeDrop",b),a&&r&&v.trigger("drop",b),o.removeClass("drop-to"),L.removeClass("dragging").removeClass("drag-from"),s.remove(),s=null,v.trigger("finish",b),v.trigger("always",b),i&&i.preventDefault()}},P=function(i){var a=t.zui.getMouseButtonCode(y.mouseButton);if(!(a>-1&&i.button!==a)){var u=t(this);T&&(L=E?u.closest(T):u),L.hasClass("drag-shadow")||y.before&&y.before({event:i,element:L})===!1||(O=!0,o=t.isFunction(y.target)?y.target(b):j.find(y.target),n=null,s=null,r=!1,l=!0,d=null,c=L.offset(),p=j.offset(),h={left:i.pageX,top:i.pageY},g=t.extend({},h),f={left:h.left-c.left,top:h.top-c.top},L.addClass("drag-from"),t(e).on(k,I).on($,A),m=setTimeout(function(){t(e).on(x,A)},10),i.preventDefault())}};E?b.on(x,E,P):T?b.on(x,T,P):b.on(x,P)},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=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.getLang(),this.init()};e.DEFAULTS={langs:{zh_cn:{append2end:"移动到末尾"},zh_tw:{append2end:"移动到末尾"},en:{append2end:"Move to the end."}}},e.prototype.getOptions=function(i){return i=t.extend({lang:t.zui.clientLang()},e.DEFAULTS,this.$.data(),i)},e.prototype.getLang=function(){var t=this.options;this.lang=t.langs[t.lang]||t.langs[e.DEFAULTS.lang]},e.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()},e.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(e){if(e.isNew){var i;t.isFunction(a.drop)&&(i=a.drop(e)),i!==!1&&e.element.insertBefore(e.target)}},finish:function(){i.removeClass("dragging").removeClass("drop-in").find(".board.drop-in").removeClass("drop-in")}},a.droppable))},t.fn.boards=function(i){return this.each(function(){var a=t(this),o=a.data("zui.boards"),n="object"==typeof i&&i;o||a.data("zui.boards",o=new e(this,n)),"string"==typeof i&&o[i]()})},t.fn.boards.Constructor=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="http://browsehappy.com/" target="_blank" class="alert-link">了解更多...</a>',zh_tw:'您的瀏覽器版本過低，無法體驗所有功能，建議升級或者更换瀏覽器。<a href="http://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="http://browsehappy.com/" target="_blank" class="alert-link">Learn more...</a>'},i=function(){var t=this.isIE()||this.isIE10()||!1;if(t)for(var e=10;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)},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")),a.find(".content").html(i||this.browseHappyTip||e[t.zui.clientLang()||"zh_cn"])},i.prototype.isIE=function(t){if(10===t)return this.isIE10();var e=document.createElement("b");return e.innerHTML="<!--[if IE "+(t||"")+"]><i></i><![endif]-->",1===e.getElementsByTagName("i").length},i.prototype.isIE10=function(){return!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){"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={desktop:"screen-desktop",desktopLg:"screen-desktop-wide",tablet:"screen-tablet",phone:"screen-phone",isMobile:"device-mobile",isDesktop:"device-desktop",touch:"is-touchable"},s=e(t),r=function(){var t=s.width();e("html").toggleClass(n.desktop,t>=a&&t<i).toggleClass(n.desktopLg,t>=i).toggleClass(n.tablet,t>=o&&t<a).toggleClass(n.phone,t<o).toggleClass(n.isMobile,t<a).toggleClass(n.touch,"ontouchstart"in document.documentElement).toggleClass(n.isDesktop,t>=a)};s.resize(r),r()}(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=function(i,a){this.$element=t(i),this.options=t.extend({},e.DEFAULTS,a),this.isLoading=!1};e.DEFAULTS={loadingText:"loading..."},e.prototype.setState=function(e){var i="disabled",a=this.$element,o=a.is("input")?"val":"html",n=a.data();e+="Text",n.resetText||a.data("resetText",a[o]()),a[o](n[e]||this.options[e]),setTimeout(t.proxy(function(){"loadingText"==e?(this.isLoading=!0,a.addClass(i).attr(i,i)):this.isLoading&&(this.isLoading=!1,a.removeClass(i).removeAttr(i))},this),0)},e.prototype.toggle=function(){var t=!0,e=this.$element.closest('[data-toggle="buttons"]');if(e.length){var i=this.$element.find("input");"radio"==i.prop("type")&&(i.prop("checked")&&this.$element.hasClass("active")?t=!1:e.find(".active").removeClass("active")),t&&i.prop("checked",!this.$element.hasClass("active")).trigger("change")}t&&this.$element.toggleClass("active")};var i=t.fn.button;t.fn.button=function(i){return this.each(function(){var a=t(this),o=a.data("zui.button"),n="object"==typeof i&&i;o||a.data("zui.button",o=new e(this,n)),"toggle"==i?o.toggle():i&&o.setState(i)})},t.fn.button.Constructor=e,t.fn.button.noConflict=function(){return t.fn.button=i,this},t(document).on("click.zui.button.data-api","[data-toggle^=button]",function(e){var i=t(e.target);i.hasClass("btn")||(i=i.closest(".btn")),i.button("toggle"),e.preventDefault()})}(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,t.proxy(s,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,t.proxy(o,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(){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",function(t){t.stopPropagation()}).on("click."+l,n,s.prototype.toggle).on("keydown."+l,n+", [role=menu]",s.prototype.keydown)}(window.jQuery),+function(t){"use strict";function e(e,o,n){return this.each(function(){var s=t(this),r=s.data(i),l=t.extend({},a.DEFAULTS,s.data(),"object"==typeof e&&e);r||s.data(i,r=new a(this,l)),"string"==typeof e?r[e](o,n):l.show&&r.show(o,n)})}var i="zui.modal",a=function(e,a){this.options=a,this.$body=t(document.body),this.$element=t(e),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,"undefined"==typeof this.options.moveable&&(this.options.moveable=this.$element.hasClass("modal-moveable")),this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,t.proxy(function(){this.$element.trigger("loaded."+i)},this))};a.VERSION="3.2.0",a.TRANSITION_DURATION=300,a.BACKDROP_TRANSITION_DURATION=150,a.DEFAULTS={backdrop:!0,keyboard:!0,show:!0,position:"fit"},a.prototype.toggle=function(t,e){return this.isShown?this.hide():this.show(t,e)},a.prototype.ajustPosition=function(e){if("undefined"==typeof e&&(e=this.options.position),"undefined"!=typeof e){var a=this.$element.find(".modal-dialog"),o=Math.max(0,(t(window).height()-a.outerHeight())/2),n="fit"==e?2*o/3:"center"==e?o:e;if(a.hasClass("modal-moveable")){var s=null,r=this.options.rememberPos;r&&(r===!0?s=this.$element.data("modal-pos"):t.zui.store&&(s=t.zui.store.pageGet(i+".rememberPos."+r))),s||(s={left:Math.max(0,(t(window).width()-a.outerWidth())/2),top:n}),a.css(s)}else a.css("margin-top",n)}},a.prototype.setMoveale=function(){t.fn.draggable||console.error("Moveable modal requires draggable.js.");var e=this,a=e.options,o=e.$element.find(".modal-dialog").removeClass("modal-dragged");o.toggleClass("modal-moveable",a.moveable),e.$element.data("modal-moveable-setup")||o.draggable({container:e.$element,handle:".modal-header",before:function(){o.css("margin-top","").addClass("modal-dragged")},finish:function(o){var n=a.rememberPos;n&&(e.$element.data("modal-pos",o.pos),t.zui.store&&n!==!0&&t.zui.store.pageSet(i+".rememberPos."+n,o.pos))}})},a.prototype.show=function(e,o){var n=this,s=t.Event("show."+i,{relatedTarget:e});n.$element.trigger(s),n.isShown||s.isDefaultPrevented()||(n.isShown=!0,n.options.moveable&&n.setMoveale(),n.checkScrollbar(),n.$body.addClass("modal-open"),n.setScrollbar(),n.escape(),n.$element.on("click.dismiss."+i,'[data-dismiss="modal"]',t.proxy(n.hide,n)),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.ajustPosition(o),n.enforceFocus();var r=t.Event("shown."+i,{relatedTarget:e});s?n.$element.find(".modal-dialog").one("bsTransitionEnd",function(){n.$element.trigger("focus").trigger(r)}).emulateTransitionEnd(a.TRANSITION_DURATION):n.$element.trigger("focus").trigger(r)}))},a.prototype.hide=function(e){e&&e.preventDefault(),e=t.Event("hide."+i),this.$element.trigger(e),this.isShown&&!e.isDefaultPrevented()&&(this.isShown=!1,this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),t(document).off("focusin."+i),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss."+i),t.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",t.proxy(this.hideModal,this)).emulateTransitionEnd(a.TRANSITION_DURATION):this.hideModal())},a.prototype.enforceFocus=function(){t(document).off("focusin."+i).on("focusin."+i,t.proxy(function(t){this.$element[0]===t.target||this.$element.has(t.target).length||this.$element.trigger("focus")},this))},a.prototype.escape=function(){this.isShown&&this.options.keyboard?t(document).on("keydown.dismiss."+i,t.proxy(function(e){if(27==e.which){var a=t.Event("escaping."+i),o=this.$element.triggerHandler(a,"esc");if(void 0!=o&&!o)return;this.hide()}},this)):this.isShown||t(document).off("keydown.dismiss."+i)},a.prototype.hideModal=function(){var t=this;this.$element.hide(),this.backdrop(function(){t.$element.trigger("hidden."+i)})},a.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},a.prototype.backdrop=function(e){var o=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."+i,t.proxy(function(t){t.target===t.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),s&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!e)return;s?this.$backdrop.one("bsTransitionEnd",e).emulateTransitionEnd(a.BACKDROP_TRANSITION_DURATION):e()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var r=function(){o.removeBackdrop(),e&&e()};t.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",r).emulateTransitionEnd(a.BACKDROP_TRANSITION_DURATION):r()}else e&&e()},a.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())},a.prototype.setScrollbar=function(){var t=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",t+this.scrollbarWidth)},a.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},a.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 o=t.fn.modal;t.fn.modal=e,t.fn.modal.Constructor=a,t.fn.modal.noConflict=function(){return t.fn.modal=o,this},t(document).on("click."+i+".data-api",'[data-toggle="modal"]',function(a){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(i)?"toggle":t.extend({remote:!/#/.test(n)&&n},s.data(),o.data());o.is("a")&&a.preventDefault(),s.one("show."+i,function(t){t.isDefaultPrevented()||s.one("hidden."+i,function(){o.is(":visible")&&o.trigger("focus")})}),e.call(s,l,this,o.data("position"))}})}(jQuery),function(t,e){"use strict";if(!t.fn.modal)throw new Error("Modal trigger requires modal.js");var i="zui.modaltrigger",a="ajax",o=".zui.modal",n="string",s=function(e,i){e=t.extend({},s.DEFAULTS,t.ModalTriggerDefaults,i?i.data():null,e),this.isShown,this.$trigger=i,this.options=e,this.id=t.zui.uuid()};s.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"},s.prototype.init=function(s){var r=this;if(s.url&&(!s.type||s.type!=a&&"iframe"!=s.type)&&(s.type=a),s.remote)s.type=a,typeof s.remote===n&&(s.url=s.remote);else if(s.iframe)s.type="iframe",typeof s.iframe===n&&(s.url=s.iframe);else if(s.custom&&(s.type="custom",typeof s.custom===n)){var l;try{l=t(s.custom)}catch(d){}l&&l.length?s.custom=l:t.isFunction(e[s.custom])&&(s.custom=e[s.custom])}var c=t("#"+s.name);c.length&&(r.isShown||c.off(o),c.remove()),c=t('<div id="'+s.name+'" class="modal modal-trigger '+(s.className||"")+'">'+("string"==typeof s.loadingIcon&&0===s.loadingIcon.indexOf("icon-")?'<div class="icon icon-spin loader '+s.loadingIcon+'"></div>':s.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(i,r);var h=function(e,i){var a=s[e];t.isFunction(a)&&c.on(i+o,a)};h("onShow","show"),h("shown","shown"),h("onHide","hide"),h("hidden","hidden"),h("loaded","loaded"),c.on("shown"+o,function(){r.isShown=!0}).on("hidden"+o,function(){r.isShown=!1}),this.$modal=c,this.$dialog=c.find(".modal-dialog"),s.mergeOptions&&(this.options=s)},s.prototype.show=function(s){var r=t.extend({},this.options,{url:this.$trigger?this.$trigger.attr("href")||this.$trigger.attr("data-url")||this.$trigger.data("url"):this.options.url},s);this.init(r);var l=this,d=this.$modal,c=this.$dialog,h=r.custom,p=c.find(".modal-body").css("padding",""),f=c.find(".modal-header"),u=c.find(".modal-content");d.toggleClass("fade",r.fade).addClass(r.className).toggleClass("modal-loading",!this.isShown),c.toggleClass("modal-md","md"===r.size).toggleClass("modal-sm","sm"===r.size).toggleClass("modal-lg","lg"===r.size).toggleClass("modal-fullscreen","fullscreen"===r.size),f.toggle(r.showHeader),f.find(".modal-icon").attr("class","modal-icon icon-"+r.icon),f.find(".modal-title-name").text(r.title||""),r.size&&"fullscreen"===r.size&&(r.width="",r.height="");var g=function(){clearTimeout(this.resizeTask),this.resizeTask=setTimeout(function(){l.ajustPosition()},100)},m=function(t,e){return"undefined"==typeof t&&(t=r.delay),setTimeout(function(){c=d.find(".modal-dialog"),r.width&&"auto"!=r.width&&c.css("width",r.width),r.height&&"auto"!=r.height&&(c.css("height",r.height),"iframe"===r.type&&p.css("height",c.height()-f.outerHeight())),l.ajustPosition(r.position),d.removeClass("modal-loading"),"iframe"!=r.type&&c.off("resize."+i).on("resize."+i,g),e&&e()},t)};if("custom"===r.type&&h)if(t.isFunction(h)){var v=h({modal:d,options:r,modalTrigger:l,ready:m});typeof v===n&&(p.html(v),m())}else h instanceof t?(p.html(t("<div>").append(h.clone()).html()),m()):(p.html(h),m());else if(r.url){var b=function(){console.error("onLoadBroken error");var t=d.callEvent("broken"+o,l,l).result;console.log("brokenContent",t,p,d),t&&p.html(t)};if(d.attr("ref",r.url),"iframe"===r.type){d.addClass("modal-iframe"),this.firstLoad=!0;var y="iframe-"+r.name;f.detach(),p.detach(),u.empty().append(f).append(p),p.css("padding",0).html('<iframe id="'+y+'" name="'+y+'" src="'+r.url+'" frameborder="no"  allowfullscreen="true" mozallowfullscreen="true" webkitallowfullscreen="true"  allowtransparency="true" scrolling="auto" style="width: 100%; height: 100%; left: 0px;"></iframe>'),r.waittime>0&&(l.waitTimeout=m(r.waittime,b));var w=document.getElementById(y);
w.onload=w.onreadystatechange=function(){if(l.firstLoad&&d.addClass("modal-loading"),!this.readyState||"complete"==this.readyState){l.firstLoad=!1,r.waittime>0&&clearTimeout(l.waitTimeout);try{d.attr("ref",w.contentWindow.location.href);var t=e.frames[y].$;if(t&&"auto"===r.height&&"fullscreen"!=r.size){var a=t("body").addClass("body-modal");r.iframeBodyClass&&a.addClass(r.iframeBodyClass);var n=function(t){d.removeClass("fade");var e=a.outerHeight();t===!0&&r.onlyIncreaseHeight&&(e=Math.max(e,p.data("minModalHeight")||0),p.data("minModalHeight",e)),p.css("height",e),r.fade&&d.addClass("fade"),m()};d.callEvent("loaded"+o,{modalType:"iframe",jQuery:t},null),setTimeout(n,100),a.off("resize."+i).on("resize."+i,g)}else m();t.extend({closeModal:e.closeModal})}catch(s){m()}}}}else t.ajax(t.extend({url:r.url,success:function(e){try{var i=t(e);i.hasClass("modal-dialog")?c.replaceWith(i):i.hasClass("modal-content")?c.find(".modal-content").replaceWith(i):p.wrapInner(i)}catch(n){d.html(e)}d.callEvent("loaded"+o,{modalType:a},l),m()},error:b},r.ajaxOptions))}d.modal({show:"show",backdrop:r.backdrop,moveable:r.moveable,rememberPos:r.rememberPos,keyboard:r.keyboard})},s.prototype.close=function(i,a){(i||a)&&this.$modal.on("hidden"+o,function(){t.isFunction(i)&&i(),typeof a===n&&("this"===a?e.location.reload():e.location=a)}),this.$modal.modal("hide")},s.prototype.toggle=function(t){this.isShown?this.close():this.show(t)},s.prototype.ajustPosition=function(t){this.$modal.modal("ajustPosition",t||this.options.position)},t.zui({ModalTrigger:s,modalTrigger:new s}),t.fn.modalTrigger=function(e,a){return t(this).each(function(){var o=t(this),r=o.data(i),l=t.extend({title:o.attr("title")||o.text(),url:o.attr("href"),type:o.hasClass("iframe")?"iframe":""},o.data(),t.isPlainObject(e)&&e);r||o.data(i,r=new s(l,o)),typeof e==n?r[e](a):l.show&&r.show(a),o.on((l.trigger||"click")+".toggle."+i,function(t){r.toggle(l),o.is("a")&&t.preventDefault()})})};var r=t.fn.modal;t.fn.modal=function(e,i){return t(this).each(function(){var a=t(this);a.hasClass("modal")?r.call(a,e,i):a.modalTrigger(e,i)})};var l=function(e){var i=typeof e;return"undefined"===i?e=t(".modal.modal-trigger"):i===n&&(e=t(e)),e&&e instanceof t?e:null},d=function(e,a,o){if(t.isFunction(e)){var n=o;o=a,a=e,e=n}e=l(e),e&&e.length&&e.each(function(){t(this).data(i).close(a,o)})},c=function(t,e){e=l(e),e&&e.length&&e.modal("ajustPosition",t)};t.zui({closeModal:d,ajustModalPosition:c}),t(document).on("click."+i+".data-api",'[data-toggle="modal"]',function(e){var a=t(this),o=a.attr("href"),n=null;try{n=t(a.attr("data-target")||o&&o.replace(/.*(?=#[^\s]+$)/,""))}catch(s){}n&&n.length||(a.data(i)?a.trigger(".toggle."+i):a.modalTrigger({show:!0})),a.is("a")&&e.preventDefault()})}(window.jQuery,window),+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,t.proxy(this.toggle,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,t.proxy(this.enter,this)),this.$element.on(l+"."+this.type,this.options.selector,t.proxy(this.leave,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(),p=n,f=document.documentElement.scrollTop||document.body.scrollTop,u="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-f>g?"top":"top"==n&&l.top-f-c<0?"bottom":"right"==n&&l.right+d>u?"left":"left"==n&&l.left-d<m?"right":n,o.removeClass(p).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,p=new Image;return p.src=a,p.complete?(o.call(p),void(n&&n.call(p))):(l=p.width,d=p.height,p.onerror=function(){s&&s.call(p),r.end=!0,p=p.onload=p.onerror=null},r=function(){c=p.width,h=p.height,(c!==l||h!==d||c*h>1024)&&(o.call(p),r.end=!0)},r(),p.onload=function(){!r.end&&r(),n&&n.call(p),p=p.onload=p.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.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"),p=l.data("caption");s.addClass("modal-loading").data("group-index",n).toggleClass("lightbox-with-caption","string"==typeof p).removeClass("lightbox-full"),s.find(".lightbox-img").attr("src",h),s.find(".caption > .content").text(p),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 e=m[u.locale];return e?e[t]:m.en[t]}function o(t,i,a){t.stopPropagation(),t.preventDefault();var o=e.isFunction(a)&&a.call(i,t)===!1;o||i.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({},u,t),t.buttons||(t.buttons={}),i=t.buttons,a=n(i),s(i,function(t,o,n){if(e.isFunction(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 p(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 p(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 f={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' />"}},u={locale:e.zui&&e.zui.clientLang?e.zui.clientLang():"zh_cn",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&&!e.isFunction(t.callback))throw new Error("alert requires callback property to be a function when provided");return t.buttons.ok.callback=t.onEscape=function(){return!e.isFunction(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)},!e.isFunction(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(f.form),a={className:"bootbox-prompt",buttons:h("cancel","confirm"),value:"",inputType:"text"},t=p(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(!e.isFunction(t.callback))throw new Error("prompt requires a callback");if(!f.inputs[t.inputType])throw new Error("invalid prompt type");switch(r=e(f.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 u={};if(c=t.inputOptions||[],!e.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&&(u[a.group]||(u[a.group]=e("<optgroup/>").attr("label",a.group)),o=u[a.group]),o.append("<option value='"+a.value+"'>"+a.text+"</option>")}),s(u,function(t,e){r.append(e)}),r.val(t.value);break;case"checkbox":var m=e.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(f.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(f.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(f.header),t.closeButton){var p=e(f.closeButton);t.title?a.find(".modal-header").prepend(p):p.css("margin-top","-10px").prependTo(l)}return t.title&&a.find(".modal-title").html(t.title),c.length&&(l.after(f.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(u,t)},g.hideAll=function(){return e(".bootbox").modal("hide"),g};var m={en:{OK:"OK",CANCEL:"Cancel",CONFIRM:"OK"},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}),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={type:"default",placement:"top",time:4e3,parent:"body",icon:null,close:!0,fade:!0,scale:!0},s={},r=function(e,r){t.isPlainObject(e)&&(r=e,e=r.message);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.message=(r.icon?'<i class="icon-'+r.icon+' icon"></i> ':"")+e,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"),p=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),p(e)}),!c&&r.close&&p({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)||t.isFunction(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()}});var f=l.$.find(".messager-content").html(l.message);r.contentClass&&f.addClass(r.contentClass),l.$.data("zui.messager",l),r.show&&l.message!==i&&l.show()};r.prototype.update=function(e,i){var a=this,o=a.options;a.$.removeClass("messager-"+o.type),i&&(o=t.extend(o,i)),a.$.addClass("messager-"+o.type),e&&(a.message=(o.icon?'<i class="icon-'+o.icon+' icon"></i> ':"")+e,a.$.find(".messager-content").html(a.message))},r.prototype.show=function(a,o){var n=this,s=this.options;if(t.isFunction(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(),n},r.prototype.hide=function(t,e){t===!0&&(e=!0,t=null);var i=this;if(i.$.hasClass("in")){i.$.removeClass("in");var a=function(){var e=i.$.parent();i.$.detach(),e.children().length||e.remove(),t&&t(!0)};e?a():setTimeout(a,200)}else t&&t(!1);i.isShow=!1},r.prototype.destroy=function(){var t=this;t.hide(function(){t.$.remove(),t.$=null},!0),delete s[t.id]},r.all=s;var l=function(){t(".messager").each(function(){var e=t(this).data("zui.messager");e&&e.hide&&e.hide(!0)})},d=function(e,a){"string"==typeof a&&(a={type:a}),a=t.extend({},a),a.id===i&&l();var o=s[a.id]||new r(e,a);return o.show(),o},c=function(t){return"string"==typeof t?{placement:t}:t},h={show:d,hide:l};t.each({primary:0,success:"ok-sign",info:"info-sign",warning:"warning-sign",danger:"exclamation-sign",important:0,special:0},function(e,i){h[e]=function(a,o){return d(a,t.extend({type:e,icon:i||null},c(o)))}}),t.zui({Messager:r,showMessager:d,messager:h})}(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===u&&("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)%p/p,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,p=360,f=100,u="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))},C=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==u)t=t.toLowerCase(),"transparent"===t?n.a=0:m[t]?this.rgb(o(m[t])):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 c={h:l(d(t.h),p),s:1,l:1,a:1};b(t.s)&&(c.s=l(d(t.s),1)),b(t.l)&&(c.l=l(d(t.l),1)),b(t.a)&&(c.a=l(d(t.a),1)),n.rgb(s(c))}}};C.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}},C.prototype.hue=function(t){var e=this,i=e.toHsl();return v(t)?i.h:(i.h=l(d(t),p),e.rgb(s(i)),e)},C.prototype.darken=function(t){var e=this,i=e.toHsl();return i.l-=t/f,i.l=l(i.l,1),e.rgb(s(i)),e},C.prototype.clone=function(){var t=this;return new C(t.r,t.g,t.b,t.a)},C.prototype.lighten=function(t){return this.darken(-t)},C.prototype.fade=function(t){return this.a=l(t/f,1),this},C.prototype.spin=function(t){var e=this.toHsl(),i=(e.h+t)%p;return e.h=i<0?p+i:i,this.rgb(s(e))},C.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,f=l-d;if(l===d)t=i=0;else{switch(i=c>.5?f/(2-l-d):f/(l+d),l){case o:t=(n-s)/f+(n<s?6:0);break;case n:t=(s-o)/f+2;break;case s:t=(o-n)/f+4}t/=6}return{h:t*p,s:i,l:c,a:r}},C.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},C.prototype.saturate=function(t){var e=this.toHsl();return e.s+=t/f,e.s=l(e.s),this.rgb(s(e))},C.prototype.desaturate=function(t){return this.saturate(-t)},C.prototype.contrast=function(t,e,i){if(e=v(e)?new C(h,h,h,1):new C(e),t=v(t)?new C(0,0,0,1):new C(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)},C.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},C.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"},C.isColor=n,C.names=m,C.get=function(t){return new C(t)},t.zui({Color:C})}(jQuery,Math,window,void 0),/*!
 * ZUI: Generated from less code - v1.7.0 - 2017-10-11
 * http://zui.sexy
 * GitHub: https://github.com/easysoft/zui.git 
 * Copyright (c) 2017 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),+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=this,i=e.$,a=e.options,o=a.selector,s=a.sortingClass,r=a.dragCssClass,l=a.reverse,d=function(i){i=i||e.getItems(1);var a=[];i.each(function(){var e=t(this).data(n);"number"==typeof e&&a.push(e)}),a.sort(function(t,e){return t-e});for(var o=i.length;a.length<o;)a.push(a.length?a[a.length-1]+1:0);l&&a.reverse(),i.each(function(e){t(this).data(n,a[e]).attr("data-"+n,a[e])})};d(),i.droppable({handle:a.trigger,target:o,selector:o,container:i,always:a.always,flex:!0,lazy:a.lazy,canMoveHere:a.canMoveHere,nested:a.nested,before:a.before,mouseButton:a.mouseButton,start:function(t){r&&t.element.addClass(r),e.trigger("start",t)},drag:function(t){if(i.addClass(s),t.isIn){var a=t.element,o=t.target,r=a.data(n),c=o.data(n);if(r==c)return;r>c?o[l?"after":"before"](a):o[l?"before":"after"](a);var h=e.getItems(1);d(h),e.trigger(n,{list:h,element:a})}},finish:function(t){r&&t.element&&t.element.removeClass(r),i.removeClass(s),e.trigger("finish",{list:e.getItems(1),element:t.element})}})},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=this.$.children(this.options.selector).not(".drag-shadow");return 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.slience=!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.slience)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(t.isFunction(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 avaliable!");i={cols:[],rows:[]},a=i.cols;var s,r,l,d,c,h,p=i.rows,f=this.$table;f.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")},r.data()))}),f.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})}),p.push(c)});var u=f.children("tfoot");u.length&&(i.footer=t('<table class="table'+o.tableClass+'"></table>').append(u))}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,p=l.checkable,f='<div class="datatable-rows-span datatable-span"><div class="datatable-wrapper"><table class="table"></table></div></div>',u='<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&&p&&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}).css("width",v.width),g.append(m));var y;d.fixedLeft&&(y=t(u),y.addClass("fixed-left").find("table").addClass(l.tableClass).find("thead").append(i),b.append(y)),d.flexArea&&(y=t(u),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(u),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,E,z,D=t('<div class="datatable-rows">'),S=h.length;i=t("<tbody/>"),o=t("<tbody/>"),n=t("<tbody/>");for(var L=0;L<S;++L){for(T=h[L],"undefined"==typeof T.id&&(T.id=L),T.index=L,w=t("<tr/>"),w.addClass(T.cssClass).toggleClass(l.checkedClass,!!T.checked).attr({"data-index":L,"data-id":T.id}),C=w.clone(),x=w.clone(),z=T.data.length,a=0;a<z;++a)E=T.data[a],a>0&&E.empty||(g=a<d.flexStart?w:a>=d.flexStart&&a<=d.flexEnd?C:x,0===a&&p&&(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(E)?(E.row=L,E.index=a):E={text:E,row:L,index:a},T.data[a]=E,$=t('<td class="datatable-cell"/>'),$.html(E.text).addClass(E.cssClass).addClass(c[a].colClass).attr("colspan",E.colSpan).attr({"data-row":L,"data-index":a,"data-flex":!1,"data-type":c[a].type,style:E.css,title:E.title||""}).css("width",c[a].width),g.append($)));i.append(w),n.append(C),o.append(x)}var O;d.fixedLeft&&(O=t(f),O.addClass("fixed-left").find("table").addClass(l.tableClass).append(i),D.append(O)),d.flexArea&&(O=t(f),O.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),D.append(O)),d.fixedRight&&(O=t(f),O.addClass("fixed-right").find("table").addClass(l.tableClass).append(o),D.append(O)),r.append(D),d.flexArea&&r.append('<div class="scroll-wrapper"><div class="scroll-slide scroll-pos-'+l.scrollPos+'"><div class="bar"></div></div></div>');var j=r.children(".datatable-footer").detach();d.footer?(r.append(t('<div class="datatable-footer"/>').append(d.footer)),d.footer=null):j.length&&r.append(j),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.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 p=o.hoverClass;r.on("mouseenter",".datatable-cell",function(){c.filter("."+p).removeClass(p),h.filter("."+p).removeClass(p),h.filter('[data-index="'+t(this).addClass(p).closest("tr").data("index")+'"]').addClass(p)}).on("mouseleave",".datatable-cell",function(){c.filter("."+p).removeClass(p),h.filter("."+p).removeClass(p)})}if(o.colHover){var f=o.colHoverClass;l.on("mouseenter",".datatable-head-cell",function(){d.filter("."+f).removeClass(f),d.filter('[data-index="'+t(this).data("index")+'"]').addClass(f)}).on("mouseleave",".datatable-head-cell",function(){d.filter("."+f).removeClass(f)})}if(a.flexArea){var u,g,m,v,b,y,w,C=n.find(".scroll-slide"),x=n.find(".datatable-span.flexarea"),$=n.find(".datatable-span.fixed-left"),k=n.find(".datatable-span.flexarea .table-datatable"),T=C.children(".bar"),E=e.id+"_scrollOffset";e.width=n.width(),n.resize(function(){e.width=n.width()});var z=function(t,e){b=Math.max(0,Math.min(u-g,t)),e||n.addClass("scrolling"),T.css("left",b),w=0-Math.floor((m-u)*b/(u-g)),k.css("left",w),v=b,n.toggleClass("scrolled-in",b>2).toggleClass("scrolled-out",b<u-g-2),o.storage&&i.pageSet(E,b)},D=function(){u=x.width(),C.width(u).css("left",$.width()),m=k.width(),g=Math.floor(u*u/m),T.css("width",g),k.css("min-width",u),n.toggleClass("show-scroll-slide",m>u),y||u===g||(y=!0,z(i.pageGet(E,0),!0)),n.hasClass("size-changing")&&z(b,!0)};x.resize(D),o.storage&&D();var S={move:!1,stopPropagation:!0,drag:function(t){z(T.position().left+t.smallOffset.x*(t.element.hasClass("bar")?1:-1))},finish:function(){n.removeClass("scrolling")}};t.fn.draggable?(T.draggable(S),o.flexHeadDrag&&n.find(".datatable-head-span.flexarea").draggable(S)):console.error("DataTable requires draggable.js to improve UI."),C.mousedown(function(t){var e=t.pageX-C.offset().left;z(e-g/2)})}if(o.checkable){var L,O=e.id+"_checkedStatus",j=o.checkedClass,I=function(){var n=r.first().find(".datatable-row"),s=n.filter("."+j);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 L=t(this).data("id"),o.checkboxName&&t(this).find(".check-row input:checkbox").prop("checked",!0),L}).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(O,d),e.callEvent("checksChanged",{checks:d})},A=function(e,i){var a=t(e).closest("tr");void 0===i&&(i=!a.hasClass(j)),h.filter('[data-index="'+a.data("index")+'"]').toggleClass(j,!!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")&&(A(i),I()),!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){A(t.target,!0)},unselect:function(t){A(t.target,!1)},finish:function(t){I()}};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(){A(this),I()});if(this.$datatable.off(P).on("click.zui.datatable.check",".check-all",function(){h.toggleClass(j,t(this).toggleClass("checked").hasClass("checked")),I()}).on(P+".none",".check-none",function(){h.toggleClass(j,!1),I()}).on(P+".inverse",".check-inverse",function(){h.toggleClass(j),I()}),o.storage){var M=i.pageGet(O);M&&(l.find(".check-all").toggleClass("checked",M.checkedAll),M.checkedAll?h.addClass(j):(h.removeClass(j),t.each(M.checks,function(t,e){h.filter('[data-id="'+e+'"]').addClass(j)})),M.checks.length&&I())}}if(o.fixedHeader){var F,W,N,R=n.children(".datatable-head"),U=o.fixedHeaderOffset||t(".navbar.navbar-fixed-top").height()||0,_=function(){F=n.offset().top,N=t(window).scrollTop(),W=n.height(),n.toggleClass("head-fixed",N+U>F&&N+U<F+W),n.hasClass("head-fixed")?R.css({width:n.width(),top:U}):R.attr("style","")};t(window).scroll(_),_()}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-"+n.type):this.$headCells.filter(".sort-up, .sort-down").first()),e.length){var s,r,l,d=this.data,c=d.cols,h=d.rows,p=this.$headCells;s=!e.hasClass("sort-up"),d.keepSort&&(s=!s),d.keepSort=null,p.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 f,u,g,m=this.$dataCells.filter('[data-index="'+l+'"]');h.sort(function(t,e){return t=t.data[l],e=e.data[l],f=m.filter('[data-row="'+t.row+'"]').text(),u=m.filter('[data-row="'+e.row+'"]').text(),"number"===r?(f=parseFloat(f),u=parseFloat(u)):"date"===r?(f=Date.parse(f),u=Date.parse(u)):(f=f.toLowerCase(),u=u.toLowerCase()),g=f>u?1:f<u?-1:0,s&&(g*=-1),g});var v,b,y,w=this.$rows,C=[];t.each(h,function(e,i){v=w.filter('[data-index="'+i.index+'"]'),v.each(function(e){y=t(this),b=C[e],b?b.after(y):y.parent().prepend(y),C[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;this.data.cols;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.$cells,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";function a(t,i,a,o){return e.abs((a-t)*(o-i))}function o(t,e,i,a,o,n){return t>=i&&t<=o&&e>=a&&e<=n}function n(t,i,n,s,r,l,d,c){var h=e.max(t,r),p=e.max(i,l),f=e.min(n,d),u=e.min(s,c);return o(h,p,t,i,n,s)&&o(f,u,t,i,n,s)&&o(h,p,r,l,d,c)&&o(f,u,r,l,d,c)?a(h,p,f,u):0}var s=t.zui.Messager?new t.zui.Messager({placement:"top",time:1500,close:0,scale:!1,fade:!1}):0,r=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.draggable=this.$.hasClass("dashboard-draggable")||this.options.draggable,this.init()};r.DEFAULTS={minHeight:100,height:360,shadowType:"normal",sensitive:!1,circleShadowSize:100,onlyRefreshBody:!0,resizable:!0,resizeMessage:!1},r.prototype.getOptions=function(e){return e=t.extend({},r.DEFAULTS,this.$.data(),e)},r.prototype.handleRemoveEvent=function(){var e=this.options.afterPanelRemoved,a=this.options.panelRemovingTip;this.$.on("click",".remove-panel",function(){var o=t(this).closest(".panel"),n=o.data("name")||o.find(".panel-heading").text().replace("\n","").replace(/(^\s*)|(\s*$)/g,""),s=o.attr("data-id");(a===i||a===!1||confirm(a.format(n)))&&(o.parent().remove(),e&&t.isFunction(e)&&e(s))})},r.prototype.handleRefreshEvent=function(){var e=this,i=this.options.onlyRefreshBody;this.$.on("click",".refresh-panel",function(){var a=t(this).closest(".panel");e.refresh(a,i)})},r.prototype.handleDraggable=function(){var i=this.$,o=this.options,s="circle"===o.shadowType,r=o.circleShadowSize,l=r/2,d=o.afterOrdered;this.$.addClass("dashboard-draggable"),this.$.on("mousedown",".panel-actions, .drag-disabled",function(t){t.stopPropagation()});var c;this.$.on("mousedown",".panel-heading, .panel-drag-handler",function(h){function p(i){var s=E.data("mouseOffset");g=i.pageX-s.x,m=i.pageY-s.y,v=g+L,b=m+O,E.css({left:g,top:m}),T.find(".dragging-in").removeClass("dragging-in"),C=!1,w=null;var r,l=0;T.children(":not(.dragging-col)").each(function(){var s=t(this);if(s.hasClass("dragging-col-holder"))return C=!o.sensitive||l<100,!0;var d=s.children(".panel"),c=d.offset(),h=d.width(),p=d.height(),f=c.left,u=c.top;if(o.sensitive)f-=D.left,u-=D.top,r=n(g,m,v,b,f,u,f+h,u+p),r>100&&r>l&&r>e.min(a(g,m,v,b),a(f,u,f+h,u+p))/3&&(l=r,w=s);else{var y=i.pageX,x=i.pageY;if(y>f&&x>u&&y<f+h&&x<u+p)return w=s,!1}}),w&&(y&&clearTimeout(y),x=w,y=setTimeout(f,50)),i.preventDefault()}function f(){x&&(x.addClass("dragging-in"),C?S.insertAfter(x):S.insertBefore(x),i.addClass("dashboard-holding"),y=null,x=null)}function u(e){y&&clearTimeout(y);var a=$.data("order");$.parent().insertAfter(S);var o=0,n={};T.children(":not(.dragging-col-holder)").each(function(){var e=t(this).children(".panel");e.data("order",++o),n[e.data("id")||e.attr("id")]=o,e.parent().attr("data-order",o)}),a!=n[$.data("id")||$.attr("id")]&&(T.data("orders",n),d&&t.isFunction(d)&&d(n)),E.remove(),i.removeClass("dashboard-holding"),i.find(".dragging-col").removeClass("dragging-col"),i.find(".panel-dragging").removeClass("panel-dragging"),T.find(".dragging-in").removeClass("dragging-in"),i.removeClass("dashboard-dragging"),t(document).off("mousemove",p).off("mouseup",u),e.preventDefault()}var g,m,v,b,y,w,C,x,$=t(this).closest(".panel"),k=$.parent(),T=$.closest(".row"),E=$.clone().addClass("panel-dragging-shadow"),z=$.offset(),D=i.offset(),S=T.find(".dragging-col-holder"),L=$.width(),O=$.height();S.length||(S=t('<div class="dragging-col-holder"><div class="panel"></div></div>').removeClass("dragging-col").appendTo(T)),c&&S.removeClass(c),S.addClass(c=k.attr("class")),S.insertBefore(k).find(".panel").replaceWith($.clone().addClass("panel-dragging panel-dragging-holder")),i.addClass("dashboard-dragging"),$.addClass("panel-dragging").parent().addClass("dragging-col"),E.css({left:z.left-D.left,top:z.top-D.top,width:L,height:O}).appendTo(i).data("mouseOffset",{x:h.pageX-z.left+D.left,y:h.pageY-z.top+D.top}),s&&(E.addClass("circle"),setTimeout(function(){E.css({left:h.pageX-D.left-l,top:h.pageY-D.top-l,width:r,height:r}).data("mouseOffset",{x:D.left+l,y:D.top+l})},100)),t(document).on("mousemove",p).on("mouseup",u),h.preventDefault()})},r.prototype.handlePanelPadding=function(){this.$.find(".panel-body > table, .panel-body > .list-group").parent().addClass("no-padding")},r.prototype.updatePanelHeight=function(){var i=this,a=i.options.height,o=i.options.minHeight,n={};return i.id&&t.zui.store&&(n=t.zui.store.pageGet("zui.dashboard."+i.id+".sizeConfig",n)),this.$.children(".row").each(function(){var i=t(this),s=i.width(),r=[],l=[],d=0;i.children(":not(.dragging-col-holder)").each(function(){var e=t(this),i=e.width();d+i>s?(l.length&&r.push(l),l=[e],d=i):(d+=i,l.push(e))}),l.length&&r.push(l),r.length&&t.each(r,function(i){l=r[i];var s=0,d=[],c=!1;t.each(l,function(t){var a=l[t].data("row-id",i),r=a.children(".panel:first");if(d.push(r),!c){var h=r.data("newHeight");if(h)r.data("newHeight",null).data("height",h),s=e.max(o,h),c=!0;else{var p=r.data("height")||n[r.data("id")];p&&(s=e.max(s,p))}}}),s||(s=a),t.each(d,function(t){var e=d[t].css("height",s);n[e.data("id")]=e.data("height")})})}),i.id&&t.zui.store&&t.zui.store.pageSet("zui.dashboard."+i.id+".sizeConfig",n),n},r.prototype.handleResizeEvent=function(){var i=this,a=i.options,o=a.resizable,n=a.onResize,r=a.minHeight,l=a.resizeMessage,d=l&&s;i.$.on("mousedown",".resize-handle",function(a){var o=t(this),l=o.hasClass("resize-vertical"),c=o.parent().addClass("resizing").toggleClass("resizing-v",l).toggleClass("resizing-h",!l),h=c.closest(".row"),p=c.children(".panel"),f=a.pageX,u=a.pageY,g=c.width(),m=p.height(),v=h.width(),b=e.round(12*g/v),y=b;l||c.attr("data-grid",b);var w=function(t){if(l)p.css("height",e.max(r,m+(t.pageY-u)));else{var i=t.pageX,a=e.max(1,e.min(12,e.round(12*(g+(i-f))/v)));y!=a&&(c.attr("data-grid",a).css("width",100*a/12+"%"),d&&s[s.isShow?"update":"show"](e.round(100*a/12)+"% ("+a+"/12)"),y=a)}t.preventDefault(),t.stopPropagation()},C=function(a){if(c.removeClass("resizing resizing-v resizing-h"),l){var o=e.max(r,m+(a.pageY-u));if(o!==m){if(t.isFunction(n)){var h=function(){p.css("height",m).data("height",m),i.updatePanelHeight()},f=n({type:"vertical",id:p.data("id"),element:c,old:m,height:o,revert:h});f===!1&&h()}p.css("height",o).data("newHeight",o)}}else{var g=c.attr("data-grid");if(b!=g&&t.isFunction(n)){var h=function(){c.attr("data-grid",b).css("width",null),i.updatePanelHeight()},f=n({type:"horizontal",id:p.data("id"),element:c,old:b,grid:g,revert:h});f===!1?h():f!==!0&&d&&s.show(e.round(100*g/12)+"% ("+g+"/12)")}}i.updatePanelHeight(),t("body").off("mousemove.resize",w).off("mouseup.resize",C),a.preventDefault(),a.stopPropagation()};t("body").on("mousemove.resize",w).on("mouseup.resize",C),a.preventDefault(),a.stopPropagation()});var c=i.$.children(".row").children(":not(.dragging-col-holder)");o!==!0&&"horizontal"!==o||c.append('<div class="resize-handle resize-horizontal"><i class="icon icon-resize-h"></i></div>'),o!==!0&&"vertical"!==o||c.append('<div class="resize-handle resize-vertical"><i class="icon icon-resize-v"></i></div>')},r.prototype.refresh=function(e,a){a===i&&(a=this.options.onlyRefreshBody);var o=this.options.afterRefresh;e=t(e);var n=e.data("url");n&&(e.addClass("panel-loading").find(".panel-heading .icon-refresh,.panel-heading .icon-repeat").addClass("icon-spin"),t.ajax({url:n,dataType:"html"}).done(function(i){var n=t(i);n.hasClass("panel")?e.empty().append(n.children()):a?e.find(".panel-body").empty().html(i):e.html(i),t.isFunction(o)&&o.call(this,{result:!0,data:i,$panel:e})}).fail(function(){e.addClass("panel-error"),t.isFunction(o)&&o.call(this,{result:!1,$panel:e})}).always(function(){e.removeClass("panel-loading"),e.find(".panel-heading .icon-refresh,.panel-heading .icon-repeat").removeClass("icon-spin")}))},r.prototype.init=function(){var e=this.options,a=this;if(a.id=e.id?e.id:a.$.attr("id"),e.data){var o=t('<div class="row"/>');t.each(e.data,function(e,a){var n=t('<div class="col-sm-'+(a.colWidth||4)+'"/>');a.colAttrs&&n.attr(a.colAttrs);var s=t('<div class="panel" data-id="'+(a.id||t.zui.uuid())+'"/>');if(a.panelAttrs&&s.attr(a.panelAttrs),a.height!==i&&s.data("height",a.height),a.content!==i)if(t.isFunction(a.content)){var r=a.content(s);r!==!0&&s.html(r)}else s.html(a.content);o.append(n.append(s.data("url",a.url)))}),a.$.append(o)}a.updatePanelHeight(),a.handlePanelPadding(),a.handleRemoveEvent(),a.handleRefreshEvent(),e.resizable&&a.handleResizeEvent(),a.draggable&&a.handleDraggable();var n=0;a.$.find(".panel").each(function(){var i=t(this);i.data("order",++n),i.attr("id")||i.attr("id","panel"+n),i.attr("data-id")||i.attr("data-id",n),a.refresh(i,e.onlyRefreshBody)}),a.$.find('[data-toggle="tooltip"]').tooltip({container:"body"})},t.fn.dashboard=function(e){return this.each(function(){var i=t(this),a=i.data("zui.dashboard"),o="object"==typeof e&&e;a||i.data("zui.dashboard",a=new r(this,o)),"string"==typeof e&&a[e]()})},t.fn.dashboard.Constructor=r}(jQuery,Math,void 0),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,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(t.proxy(this.initSize,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){"use strict";var e=function(e,i){this.$=t(e),this.options=this.getOptions(i),this.init()};e.DEFAULTS={auto:!1,foldicon:"icon-chevron-right"},e.prototype.getOptions=function(i){return i=t.extend({},e.DEFAULTS,this.$.data(),i)},e.prototype.init=function(){var t=this.$.children(".nav");t.find(".nav").closest("li").addClass("nav-parent"),t.find(".nav > li.active").parent().closest("li").addClass("active"),t.find(".nav-parent > a").append('<i class="'+this.options.foldicon+' nav-parent-fold-icon"></i>'),t.find(".nav-parent.show").find(".nav-parent-fold-icon").addClass("icon-rotate-90"),this.handleFold()},e.prototype.handleFold=function(){var e=this.options.auto,i=this.$;this.$.on("click",".nav-parent > a",function(a){e&&(i.find(".nav-parent.show").find(".nav").slideUp(function(){t(this).closest(".nav-parent").removeClass("show")}),i.find(".icon-rotate-90").removeClass("icon-rotate-90"));var o=t(this).closest(".nav-parent");return o.hasClass("show")?(o.find(".icon-rotate-90").removeClass("icon-rotate-90"),o.find(".nav").slideUp(function(){t(this).closest(".nav-parent").removeClass("show")})):(o.find(".nav-parent-fold-icon").addClass("icon-rotate-90"),o.find(".nav").slideDown(function(){t(this).closest(".nav-parent").addClass("show")})),a.preventDefault(),!1})},t.fn.menu=function(i){return this.each(function(){var a=t(this),o=a.data("zui.menu"),n="object"==typeof i&&i;o||a.data("zui.menu",o=new e(this,n)),"string"==typeof i&&o[i]()})},t.fn.menu.Constructor=e,t(function(){t('[data-toggle="menu"],[data-ride="menu"]').menu()})}(jQuery),+function(t){"use strict";var e=function(e,i){this.$element=t(e),this.$indicators=this.$element.find(".carousel-indicators"),this.options=i,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter",t.proxy(this.pause,this)).on("mouseleave",t.proxy(this.cycle,this))};e.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,touchable:!0},e.prototype.touchable=function(){function e(e){var e=e||window.event;e.originalEvent&&(e=e.originalEvent);var n=t(this);switch(e.type){case"touchstart":a=e.touches[0].pageX,o=e.touches[0].pageY;break;case"touchend":var s=e.changedTouches[0].pageX-a,r=e.changedTouches[0].pageY-o;if(Math.abs(s)>Math.abs(r))i(n,s),Math.abs(s)>10&&e.preventDefault();else{var l=t(window);t("body,html").animate({scrollTop:l.scrollTop()-r},400)}}}function i(t,e){e>10?n.prev():e<-10&&n.next()}if(this.options.touchable){this.$element.on("touchstart touchmove touchend",e);var a,o,n=this}},e.prototype.cycle=function(e){return e||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(t.proxy(this.next,this),this.options.interval)),this},e.prototype.getActiveIndex=function(){return this.$active=this.$element.find(".item.active"),this.$items=this.$active.parent().children(),this.$items.index(this.$active)},e.prototype.to=function(e){var i=this,a=this.getActiveIndex();if(!(e>this.$items.length-1||e<0))return this.sliding?this.$element.one("slid",function(){i.to(e)}):a==e?this.pause().cycle():this.slide(e>a?"next":"prev",t(this.$items[e]))},e.prototype.pause=function(e){return e||(this.paused=!0),this.$element.find(".next, .prev").length&&t.support.transition.end&&(this.$element.trigger(t.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},e.prototype.next=function(){if(!this.sliding)return this.slide("next")},e.prototype.prev=function(){if(!this.sliding)return this.slide("prev")},e.prototype.slide=function(e,i){var a=this.$element.find(".item.active"),o=i||a[e](),n=this.interval,s="next"==e?"left":"right",r="next"==e?"first":"last",l=this;if(!o.length){if(!this.options.wrap)return;o=this.$element.find(".item")[r]()}this.sliding=!0,n&&this.pause();var d=t.Event("slide.zui.carousel",{relatedTarget:o[0],direction:s});if(!o.hasClass("active")){if(this.$indicators.length&&(this.$indicators.find(".active").removeClass("active"),this.$element.one("slid",function(){var e=t(l.$indicators.children()[l.getActiveIndex()]);e&&e.addClass("active")})),t.support.transition&&this.$element.hasClass("slide")){if(this.$element.trigger(d),d.isDefaultPrevented())return;o.addClass(e),o[0].offsetWidth,a.addClass(s),o.addClass(s),a.one(t.support.transition.end,function(){o.removeClass([e,s].join(" ")).addClass("active"),a.removeClass(["active",s].join(" ")),l.sliding=!1,setTimeout(function(){l.$element.trigger("slid")},0)}).emulateTransitionEnd(600)}else{if(this.$element.trigger(d),d.isDefaultPrevented())return;a.removeClass("active"),o.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return n&&this.cycle(),this}};var i=t.fn.carousel;t.fn.carousel=function(i){return this.each(function(){var a=t(this),o=a.data("zui.carousel"),n=t.extend({},e.DEFAULTS,a.data(),"object"==typeof i&&i),s="string"==typeof i?i:n.slide;o||a.data("zui.carousel",o=new e(this,n)),"number"==typeof i?o.to(i):s?o[s]():n.interval&&o.pause().cycle(),n.touchable&&o.touchable()})},t.fn.carousel.Constructor=e,t.fn.carousel.noConflict=function(){return t.fn.carousel=i,this},t(document).on("click.zui.carousel.data-api","[data-slide], [data-slide-to]",function(e){var i,a=t(this),o=t(a.attr("data-target")||(i=a.attr("href"))&&i.replace(/.*(?=#[^\s]+$)/,"")),n=t.extend({},o.data(),a.data()),s=a.attr("data-slide-to");s&&(n.interval=!1),o.carousel(n),(s=a.attr("data-slide-to"))&&o.data("zui.carousel").to(s),e.preventDefault()}),t(window).on("load",function(){t('[data-ride="carousel"]').each(function(){var e=t(this);e.carousel(e.data())})})}(window.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 t.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;t.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(t.isFunction(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"));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)}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(),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.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.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){t.isFunction(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)),t.isFunction(i)?i(o,e):o}).get()},n.prototype.callEvent=function(e,i){var a;return t.isFunction(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);
