/* w2ui 1.5 (c) http://w2ui.com, vitmalina@gmail.com */ var w2ui=w2ui||{},w2obj=w2obj||{},w2utils=function(g){var e={};return{version:"1.5",settings:{locale:"en-us",dateFormat:"m/d/yyyy",timeFormat:"hh:mi pm",datetimeFormat:"m/d/yyyy|hh:mi pm",currencyPrefix:"$",currencySuffix:"",currencyPrecision:2,groupSymbol:",",decimalSymbol:".",shortmonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],fullmonths:["January","February","March","April","May","June","July","August","September","October","November","December"],shortdays:["M","T","W","T","F","S","S"],fulldays:["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],weekStarts:"M",dataType:"HTTPJSON",phrases:{},dateStartYear:1950,dateEndYear:2030,macButtonOrder:!1},isBin:function(e){return/^[0-1]+$/.test(e)},isInt:c,isFloat:function(e){"string"==typeof e&&(e=e.replace(/\s+/g,"").replace(w2utils.settings.groupSymbol,"").replace(w2utils.settings.decimalSymbol,"."));return("number"==typeof e||"string"==typeof e&&""!==e)&&!isNaN(Number(e))},isMoney:function(e){var t=w2utils.settings,i=new RegExp("^"+(t.currencyPrefix?"\\"+t.currencyPrefix+"?":"")+"[-+]?"+(t.currencyPrefix?"\\"+t.currencyPrefix+"?":"")+"[0-9]*[\\"+t.decimalSymbol+"]?[0-9]+"+(t.currencySuffix?"\\"+t.currencySuffix+"?":"")+"$","i");"string"==typeof e&&(e=e.replace(new RegExp(t.groupSymbol,"g"),""));return"object"!=typeof e&&""!==e&&i.test(e)},isHex:function(e){return/^(0x)?[0-9a-fA-F]+$/.test(e)},isAlphaNumeric:function(e){return/^[a-zA-Z0-9_-]+$/.test(e)},isEmail:function(e){return/^[a-zA-Z0-9._%\-+]+@[а-яА-Яa-zA-Z0-9.-]+\.[а-яА-Яa-zA-Z]+$/.test(e)},isIpAddress:function(e){return new RegExp("^((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?).){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$").test(e)},isDate:function(e,t,i){if(!e)return!1;var s,n,l,o="Invalid Date";null==t&&(t=w2utils.settings.dateFormat);if("function"==typeof e.getFullYear)l=e.getFullYear(),s=e.getMonth()+1,n=e.getDate();else if(parseInt(e)==e&&0'+t+""},formatSize:function(e){if(!w2utils.isFloat(e)||""===e)return"";if(0===(e=parseFloat(e)))return 0;var t=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return(Math.floor(e/Math.pow(1024,t)*10)/10).toFixed(0===t?0:1)+" "+(["Bt","KB","MB","GB","TB","PB","EB","ZB"][t]||"??")},formatNumber:function(e,t,i){if(null==e||""===e||"object"==typeof e)return"";i={minimumFractionDigits:t,maximumFractionDigits:t,useGrouping:i};(null==t||t<0)&&(i.minimumFractionDigits=0,i.maximumFractionDigits=20);return parseFloat(e).toLocaleString(w2utils.settings.locale,i)},formatDate:function(e,t){t=t||this.settings.dateFormat;if(""===e||null==e||"object"==typeof e&&!e.getMonth)return"";var i=new Date(e);w2utils.isInt(e)&&(i=new Date(Number(e)));if("Invalid Date"===String(i))return"";var s=i.getFullYear(),e=i.getMonth(),i=i.getDate();return t.toLowerCase().replace("month",w2utils.settings.fullmonths[e]).replace("mon",w2utils.settings.shortmonths[e]).replace(/yyyy/g,("000"+s).slice(-4)).replace(/yyy/g,("000"+s).slice(-4)).replace(/yy/g,("0"+s).slice(-2)).replace(/(^|[^a-z$])y/g,"$1"+s).replace(/mm/g,("0"+(e+1)).slice(-2)).replace(/dd/g,("0"+i).slice(-2)).replace(/th/g,1==i?"st":"th").replace(/th/g,2==i?"nd":"th").replace(/th/g,3==i?"rd":"th").replace(/(^|[^a-z$])m/g,"$1"+(e+1)).replace(/(^|[^a-z$])d/g,"$1"+i)},formatTime:function(e,t){w2utils.settings.shortmonths,w2utils.settings.fullmonths;t=t||this.settings.timeFormat;if(""===e||null==e||"object"==typeof e&&!e.getMonth)return"";var i=new Date(e);w2utils.isInt(e)&&(i=new Date(Number(e)));w2utils.isTime(e)&&(l=w2utils.isTime(e,!0),(i=new Date).setHours(l.hours),i.setMinutes(l.minutes));if("Invalid Date"===String(i))return"";var s="am",n=i.getHours(),e=i.getHours(),l=i.getMinutes(),i=i.getSeconds();l<10&&(l="0"+l);i<10&&(i="0"+i);-1===t.indexOf("am")&&-1===t.indexOf("pm")||(12<=n&&(s="pm"),12=]|='[^']*'|="[^"]*"|=[^'"][^\s>]*)*>/gi,"");break;case"object":if(Array.isArray(e)){e=g.extend(!0,[],e);for(var t=0;t").replace(/</g,"<").replace(/"/g,'"').replace(/&/g,"&");break;case"object":if(Array.isArray(e)){e=g.extend(!0,[],e);for(var t=0;t\|\/? {}\\])/g,"\\$1")},base64encode:function(e){var t,i,s,n,l,o,a="",r=0,d="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e=function(e){e=String(e).replace(/\r\n/g,"\n");for(var t="",i=0;i>6|192):(t+=String.fromCharCode(s>>12|224),t+=String.fromCharCode(s>>6&63|128)),t+=String.fromCharCode(63&s|128))}return t}(e);for(;r>2,n=(3&o)<<4|t>>4,l=(15&t)<<2|i>>6,o=63&i,isNaN(t)?l=o=64:isNaN(i)&&(o=64),a=a+d.charAt(s)+d.charAt(n)+d.charAt(l)+d.charAt(o);return a},base64decode:function(e){var t,i,s,n,l,o="",a=0,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(;a>4,i=(15&s)<<4|n>>2,s=(3&n)<<6|l,o+=String.fromCharCode(t),64!==n&&(o+=String.fromCharCode(i)),64!==l&&(o+=String.fromCharCode(s));return o=function(e){var t,i,s="",n=0,l=0;for(;n>>4&15)+i.charAt(15&t);return s}function s(e){for(var t,i,s="",n=-1;++n>>6&31,128|63&t):t<=65535?s+=String.fromCharCode(224|t>>>12&15,128|t>>>6&63,128|63&t):t<=2097151&&(s+=String.fromCharCode(240|t>>>18&7,128|t>>>12&63,128|t>>>6&63,128|63&t));return s}function n(e){for(var t=Array(e.length>>2),i=0;i>5]|=(255&e.charCodeAt(i/8))<>5]>>>i%32&255);return t}function a(e,t){e[t>>5]|=128<>>9<<4)]=t;for(var i=1732584193,s=-271733879,n=-1732584194,l=271733878,o=0;o>>32-n,i)}function c(e,t,i,s,n,l,o){return r(t&i|~t&s,e,t,n,l,o)}function h(e,t,i,s,n,l,o){return r(t&s|i&~s,e,t,n,l,o)}function p(e,t,i,s,n,l,o){return r(t^i^s,e,t,n,l,o)}function f(e,t,i,s,n,l,o){return r(i^(t|~s),e,t,n,l,o)}function g(e,t){var i=(65535&e)+(65535&t);return(e>>16)+(t>>16)+(i>>16)<<16|65535&i}return function(e){return i(t(s(e)))}(e)},transition:function(e,t,i,s){var n=g(e).width(),l=g(e).height();if(!e||!t)return void console.log("ERROR: Cannot do transition when one of the divs is null");switch(e.parentNode.style.cssText+="perspective: 900px; overflow: hidden;",e.style.cssText+="; position: absolute; z-index: 1019; backface-visibility: hidden",t.style.cssText+="; position: absolute; z-index: 1020; backface-visibility: hidden",i){case"slide-left":e.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0)",t.style.cssText+="overflow: hidden; transform: translate3d("+n+"px, 0, 0)",g(t).show(),window.setTimeout(function(){t.style.cssText+="transition: 0.5s; transform: translate3d(0, 0, 0)",e.style.cssText+="transition: 0.5s; transform: translate3d(-"+n+"px, 0, 0)"},1);break;case"slide-right":e.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0)",t.style.cssText+="overflow: hidden; transform: translate3d(-"+n+"px, 0, 0)",g(t).show(),window.setTimeout(function(){t.style.cssText+="transition: 0.5s; transform: translate3d(0px, 0, 0)",e.style.cssText+="transition: 0.5s; transform: translate3d("+n+"px, 0, 0)"},1);break;case"slide-down":e.style.cssText+="overflow: hidden; z-index: 1; transform: translate3d(0, 0, 0)",t.style.cssText+="overflow: hidden; z-index: 0; transform: translate3d(0, 0, 0)",g(t).show(),window.setTimeout(function(){t.style.cssText+="transition: 0.5s; transform: translate3d(0, 0, 0)",e.style.cssText+="transition: 0.5s; transform: translate3d(0, "+l+"px, 0)"},1);break;case"slide-up":e.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0)",t.style.cssText+="overflow: hidden; transform: translate3d(0, "+l+"px, 0)",g(t).show(),window.setTimeout(function(){t.style.cssText+="transition: 0.5s; transform: translate3d(0, 0, 0)",e.style.cssText+="transition: 0.5s; transform: translate3d(0, 0, 0)"},1);break;case"flip-left":e.style.cssText+="overflow: hidden; transform: rotateY(0deg)",t.style.cssText+="overflow: hidden; transform: rotateY(-180deg)",g(t).show(),window.setTimeout(function(){t.style.cssText+="transition: 0.5s; transform: rotateY(0deg)",e.style.cssText+="transition: 0.5s; transform: rotateY(180deg)"},1);break;case"flip-right":e.style.cssText+="overflow: hidden; transform: rotateY(0deg)",t.style.cssText+="overflow: hidden; transform: rotateY(180deg)",g(t).show(),window.setTimeout(function(){t.style.cssText+="transition: 0.5s; transform: rotateY(0deg)",e.style.cssText+="transition: 0.5s; transform: rotateY(-180deg)"},1);break;case"flip-down":e.style.cssText+="overflow: hidden; transform: rotateX(0deg)",t.style.cssText+="overflow: hidden; transform: rotateX(180deg)",g(t).show(),window.setTimeout(function(){t.style.cssText+="transition: 0.5s; transform: rotateX(0deg)",e.style.cssText+="transition: 0.5s; transform: rotateX(-180deg)"},1);break;case"flip-up":e.style.cssText+="overflow: hidden; transform: rotateX(0deg)",t.style.cssText+="overflow: hidden; transform: rotateX(-180deg)",g(t).show(),window.setTimeout(function(){t.style.cssText+="transition: 0.5s; transform: rotateX(0deg)",e.style.cssText+="transition: 0.5s; transform: rotateX(180deg)"},1);break;case"pop-in":e.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0)",t.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0); transform: scale(.8); opacity: 0;",g(t).show(),window.setTimeout(function(){t.style.cssText+="transition: 0.5s; transform: scale(1); opacity: 1;",e.style.cssText+="transition: 0.5s;"},1);break;case"pop-out":e.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0); transform: scale(1); opacity: 1;",t.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0); opacity: 0;",g(t).show(),window.setTimeout(function(){t.style.cssText+="transition: 0.5s; opacity: 1;",e.style.cssText+="transition: 0.5s; transform: scale(1.7); opacity: 0;"},1);break;default:e.style.cssText+="overflow: hidden; transform: translate3d(0, 0, 0)",t.style.cssText+="overflow: hidden; translate3d(0, 0, 0); opacity: 0;",g(t).show(),window.setTimeout(function(){t.style.cssText+="transition: 0.5s; opacity: 1;",e.style.cssText+="transition: 0.5s"},1)}setTimeout(function(){"slide-down"===i&&(g(e).css("z-index","1019"),g(t).css("z-index","1020")),t&&g(t).css({opacity:"1"}).css(w2utils.cssPrefix({transition:"",transform:""})),e&&g(e).css({opacity:"1"}).css(w2utils.cssPrefix({transition:"",transform:""})),"function"==typeof s&&s()},500)},lock:function(e,t,i){var s={};"object"==typeof t?s=t:(s.msg=t,s.spinner=i);s.msg||0===s.msg||(s.msg="");w2utils.unlock(e),g(e).prepend('
');i=g(e).find(".w2ui-lock"),e=g(e).find(".w2ui-lock-msg");s.msg||e.css({"background-color":"transparent",border:"0px"});!0===s.spinner&&(s.msg='
"+s.msg);null!=s.opacity&&i.css("opacity",s.opacity);"function"==typeof i.fadeIn?(i.fadeIn(200),e.html(s.msg).fadeIn(200)):(i.show(),e.html(s.msg).show(0))},unlock:function(e,t){c(t)?(g(e).find(".w2ui-lock").fadeOut(t),setTimeout(function(){g(e).find(".w2ui-lock").remove(),g(e).find(".w2ui-lock-msg").remove()},t)):(g(e).find(".w2ui-lock").remove(),g(e).find(".w2ui-lock-msg").remove())},message:function(s,e){var t,n,l=this;g().w2tag(),e=e||{width:200,height:100};null==e.on&&g.extend(e,w2utils.event);null==e.width&&(e.width=200);null==e.height&&(e.height=100);var i=parseInt(g(s.box).width()),o=parseInt(g(s.box).height()),a=parseInt(g(s.box).find(s.title).css("height")||0);e.width>i&&(e.width=i-10);e.height>o-a&&(e.height=o-10-a);e.originalWidth=e.width,e.originalHeight=e.height,parseInt(e.width)<0&&(e.width=i+e.width);parseInt(e.width)<10&&(e.width=10);parseInt(e.height)<0&&(e.height=o+e.height-a);parseInt(e.height)<10&&(e.height=10);null==e.hideOnClick&&(e.hideOnClick=!1);var r=g(s.box).data("options")||{};(null==e.width||e.width>r.width-10)&&(e.width=r.width-10);(null==e.height||e.height>r.height-a-5)&&(e.height=r.height-a-5);e.originalHeight<0&&(e.height=o+e.originalHeight-a);e.originalWidth<0&&(e.width=i+2*e.originalWidth);var d=g(s.box).find(s.title),a=g(s.box).find(".w2ui-message.w2ui-closing");0'+(e.body||"")+'
'+(e.buttons||"")+"
"),g(s.box).find(".w2ui-message").css("z-index",1390),d.data("old-z-index",d.css("z-index")),d.css("z-index",1501),g(s.box).find(s.body).before('"),g(s.box).find("#w2ui-message"+u).data("options",e).data("prev_focus",g(":focus"));var h=g(s.box).find("#w2ui-message"+u).css("display");if(g(s.box).find("#w2ui-message"+u).css(w2utils.cssPrefix({transform:"none"===h?"translateY(-"+e.height+"px)":"translateY(0px)"})),"none"===h){if(g(s.box).find("#w2ui-message"+u).show().html(e.html),e.box=g(s.box).find("#w2ui-message"+u),!0===(n=e.trigger({phase:"before",type:"open",target:"self"})).isCancelled)return d.css("z-index",d.data("old-z-index")),void g(s.box).find("#w2ui-message"+u).remove();setTimeout(function(){g(s.box).find("#w2ui-message"+u).css(w2utils.cssPrefix({transform:"none"===h?"translateY(0px)":"translateY(-"+e.height+"px)"}))},1),0===u&&this.lock&&(s.param?this.lock(s.param):this.lock()),setTimeout(function(){g(s.box).find("#w2ui-message"+u).css(w2utils.cssPrefix({transition:"0s"})),e.trigger(g.extend(n,{phase:"after"}))},350)}}function p(e,t){if(null==n&&!0===(n=t.trigger({phase:"before",type:"open",target:"self"})).isCancelled)return d.css("z-index",d.data("old-z-index")),void g(s.box).find("#w2ui-message"+u).remove();var i=e.data("prev_focus");e.remove(),i&&0'+i(e)+"";return g("body").append(e),e=g("#_tmp_width").width(),g("#_tmp_width").remove(),e},scrollBarSize:function(){if(e.scrollBarSize)return e.scrollBarSize;g("body").append('
1
'),e.scrollBarSize=100-g("#_scrollbar_width > div").width(),g("#_scrollbar_width").remove(),0<=String(navigator.userAgent).indexOf("MSIE")&&(e.scrollBarSize=e.scrollBarSize/2);return e.scrollBarSize},checkName:function(e,t){return e&&null!=e.name?null==w2ui[e.name]?!!w2utils.isAlphaNumeric(e.name)||(console.log('ERROR: The parameter "name" has to be alpha-numeric (a-z, 0-9, dash and underscore). '),!1):(console.log('ERROR: The parameter "name" is not unique. There are other objects already created with the same name (obj: '+e.name+")."),!1):(console.log('ERROR: The parameter "name" is required but not supplied in $().'+t+"()."),!1)},checkUniqueId:function(e,t,i,s){g.isArray(t)||(t=[t]);for(var n=0;n").replace(/&/g,"&").replace(/"/g,'"').replace(/ /g," ")),t<=a.length){(s=(s=e.childNodes[o]).childNodes&&0s.length&&(t=s.length);n.setStart(s,t),i?n.setEnd(s,i):n.collapse(!0);l.removeAllRanges(),l.addRange(n)},testLocalStorage:t,hasLocalStorage:t(),isIOS:-1!==navigator.userAgent.toLowerCase().indexOf("iphone")||-1!==navigator.userAgent.toLowerCase().indexOf("ipod")||-1!==navigator.userAgent.toLowerCase().indexOf("ipad")||-1!==navigator.userAgent.toLowerCase().indexOf("mobile")||-1!==navigator.userAgent.toLowerCase().indexOf("android"),isIE:-1!==navigator.userAgent.toLowerCase().indexOf("msie")||-1!==navigator.userAgent.toLowerCase().indexOf("trident")};function c(e){return/^[-+]?[0-9]+$/.test(e)}function i(e){if(null==e)return e;switch(typeof e){case"number":break;case"string":e=String(e).replace(/&/g,"&").replace(/>/g,">").replace(/'+w2utils.formatDate(i,t)+""},datetime:function(e,t){if(""===t&&(t=w2utils.settings.datetimeFormat),null==e||0===e||""===e)return"";var i=w2utils.isDateTime(e,t,!0);return''+w2utils.formatDateTime(i,t)+""},time:function(e,t){if("h24"===(t="h12"===(t=""===t?w2utils.settings.timeFormat:t)?"hh:mi pm":t)&&(t="h24:mi"),null==e||0===e||""===e)return"";var i=w2utils.isDateTime(e,t,!0);return''+w2utils.formatTime(e,t)+""},timestamp:function(e,t){if(""===t&&(t=w2utils.settings.datetimeFormat),null==e||0===e||""===e)return"";var i=w2utils.isDateTime(e,t,!0);return(i=!1===i?w2utils.isDate(e,t,!0):i).toString?i.toString():""},gmt:function(e,t){if(""===t&&(t=w2utils.settings.datetimeFormat),null==e||0===e||""===e)return"";var i=w2utils.isDateTime(e,t,!0);return(i=!1===i?w2utils.isDate(e,t,!0):i).toUTCString?i.toUTCString():""},age:function(e,t){if(null==e||0===e||""===e)return"";var i=w2utils.isDateTime(e,null,!0);return''+w2utils.age(e)+(t?" "+t:"")+""},interval:function(e,t){return null==e||0===e||""===e?"":w2utils.interval(e)+(t?" "+t:"")},toggle:function(e,t){return e?"Yes":""},password:function(e,t){for(var i="",s=0;s/g,"<"),s=new RegExp(s+"(?!([^<]+)?>)","gi");t.innerHTML=t.innerHTML.replace(s,n)}function n(e){return''+e+""}}):y(this).each(o);function o(e,t){for(;-1!==t.innerHTML.indexOf('');)t.innerHTML=t.innerHTML.replace(/\((.|\n|\r)*)\<\/span\>/gi,"$1")}},y.fn.w2tag=function(a,r){if(1===arguments.length&&"object"==typeof a&&null!=(r=a).html&&(a=r.html),null!=(r=y.extend({id:null,auto:null,html:a,position:"right|top",align:"none",left:0,top:0,maxWidth:null,style:"",css:{},className:"",inputClass:"",onShow:null,onHide:null,hideOnKeyPress:!0,hideOnFocus:!1,hideOnBlur:!1,hideOnClick:!1,hideOnChange:!0},r)).name&&null==r.id&&(r.id=r.name),""!==r.class&&""===r.inputClass&&(r.inputClass=r.class),0!==y(this).length)return!0===r.auto||null!=r.showOn||null!=r.hideOn?0!=arguments.length&&a?y(this).each(function(e,t){var i="mouseenter",s="mouseleave";r.showOn&&(i=String(r.showOn).toLowerCase(),delete r.showOn),r.hideOn&&(s=String(r.hideOn).toLowerCase(),delete r.hideOn),r.potision||(r.position="top|bottom"),y(t).off(".w2tooltip").on(i+".w2tooltip",function(){r.auto=!1,y(this).w2tag(a,r)}).on(s+".w2tooltip",function(){y(this).w2tag()})}):y(this).each(function(e,t){y(t).off(".w2tooltip")}):y(this).each(function(e,t){var c,i=(i=""==(i=r.id||t.id)?y(t).find("input").attr("id"):i)||"noid",s=w2utils.escapeId(i);function n(){var e;c.box.css("display","block"),c&&c.box&&y(c.attachedTo).offset()&&(e=c.getPos(),c.box.css({opacity:"1",left:e.left+"px",top:e.top+"px"}).data("w2tag",c).find(".w2ui-tag-body").addClass(e.posClass),c.tmp.pos=e.left+"x"+e.top,y(c.attachedTo).off(".w2tag").css(c.options.css).addClass(c.options.inputClass),c.options.hideOnKeyPress&&y(c.attachedTo).on("keypress.w2tag",c.hide),c.options.hideOnFocus&&y(c.attachedTo).on("focus.w2tag",c.hide),r.hideOnChange&&("INPUT"===t.nodeName?y(t):y(t).find("input")).on("change.w2tag",c.hide),c.options.hideOnBlur&&y(c.attachedTo).on("blur.w2tag",c.hide),c.options.hideOnClick&&y("body").on("click.w2tag"+(c.id||""),c.hide),"function"==typeof c.options.onShow&&c.options.onShow(),l())}function l(e){var t=y(c.attachedTo).offset();0===y(c.attachedTo).length||0===t.left&&0===t.top||0===c.box.find(".w2ui-tag-body").length?c.hide():(t=o(),c.tmp.pos!==t.left+"x"+t.top&&(c.box.css(w2utils.cssPrefix({transition:e?"0s":".2s"})).css({left:t.left+"px",top:t.top+"px"}),c.tmp.pos=t.left+"x"+t.top),c.tmp.timer&&clearTimeout(c.tmp.timer),c.tmp.timer=setTimeout(l,100))}function o(){var e=y(c.attachedTo).offset(),t="w2ui-tag-right",i=parseInt(e.left+c.attachedTo.offsetWidth+(c.options.left||0)),s=parseInt(e.top+(c.options.top||0)),n=c.box.find(".w2ui-tag-body"),l=n[0].offsetWidth,o=n[0].offsetHeight;if("string"==typeof c.options.position&&-1!==c.options.position.indexOf("|")&&(c.options.position=c.options.position.split("|")),"top"===c.options.position)t="w2ui-tag-top",i=parseInt(e.left+(c.options.left||0))-14,s=parseInt(e.top+(c.options.top||0))-o-10;else if("bottom"===c.options.position)t="w2ui-tag-bottom",i=parseInt(e.left+(c.options.left||0))-14,s=parseInt(e.top+c.attachedTo.offsetHeight+(c.options.top||0))+10;else if("left"===c.options.position)t="w2ui-tag-left",i=parseInt(e.left+(c.options.left||0))-l-20,s=parseInt(e.top+(c.options.top||0));else if(Array.isArray(c.options.position)){for(var a=window.innerWidth,r=window.innerHeight,d=0;dc.options.maxWidth&&(i="width: "+c.options.maxWidth+"px"),y("body").append('"),c.box=y("#w2ui-tag-"+s),y(c.attachedTo).data("w2tag",c),setTimeout(n,1))});y(".w2ui-tag").each(function(e,t){t=y(t).data("w2tag");t&&t.hide()})},y.fn.w2overlay=function(e,f){var g=this,m="";if(1===arguments.length&&(f="object"==typeof e?e:{html:e}),2===arguments.length&&(f.html=e),y.isPlainObject(f)||(f={}),(f=y.extend({},{name:null,html:"",align:"none",left:0,top:0,tipLeft:30,noTip:!1,selectable:!1,width:0,height:0,maxWidth:null,maxHeight:null,contextMenu:!1,pageX:null,pageY:null,originalEvent:null,style:"",class:"",overlayStyle:"",onShow:null,onHide:null,openAbove:null,tmp:{}},f)).name&&(m="-"+f.name),0===this.length||""===f.html||null==f.html)return 0';v+='"}!0===l.info&&(l.info={}),null!=l.info&&(o="w2ui-icon-info","function"==typeof l.info.icon?o=l.info.icon(d):"object"==typeof l.info.icon?o=l.info.icon[this.parseField(d,l.field)]||"":"string"==typeof l.info.icon&&(o=l.info.icon),a=l.info.style||"","function"==typeof l.info.style?a=l.info.style(d):"object"==typeof l.info.style?a=l.info.style[this.parseField(d,l.field)]||"":"string"==typeof l.info.style&&(a=l.info.style),v+='"),null!=l.render&&-1!==i?("function"==typeof l.render&&(null!=(a=l.render.call(this,d,i,s,u))&&"object"==typeof a?(u=$.trim(a.html||""),g=a.class||"",f=a.style||""):u=$.trim(a),(u.length<4||"'+v+String(u)+"")),"object"==typeof l.render&&(u='
'+v+String(r)+"
"),"string"==typeof l.render&&(y=[],-1==(r=l.render.toLowerCase().indexOf(":"))?(y[0]=l.render.toLowerCase(),y[1]=""):(y[0]=l.render.toLowerCase().substr(0,r),y[1]=l.render.toLowerCase().substr(r+1)),r=w2utils.formatters[y[0]],u='
'+v+String(u)+"
")):(c&&-1!=["checkbox","check"].indexOf(c.type)&&(c=e?-(i+1):i,h+="text-align: center;",u='',v=""),u='
'+v+String(u)+"
"),null==u&&(u=""),"string"==typeof l.render&&(y=l.render.toLowerCase().split(":"),-1!=["number","int","float","money","currency","percent","size"].indexOf(y[0])&&(f+="text-align: right;")),d&&d.w2ui&&("object"==typeof d.w2ui.style&&("string"==typeof d.w2ui.style[s]&&(f+=d.w2ui.style[s]+";"),"string"==typeof d.w2ui.style[l.field]&&(f+=d.w2ui.style[l.field]+";")),"object"==typeof d.w2ui.class&&("string"==typeof d.w2ui.class[s]&&(g+=d.w2ui.class[s]+" "),"string"==typeof d.w2ui.class[l.field]&&(g+=d.w2ui.class[l.field]+" ")));h=!1;w&&-1!=$.inArray(s,m.columns[i])&&(h=!0);w="string"==typeof l.clipboardCopy?l.clipboardCopy:"Copy to clipboard",m="';return u='"+u+(""!=w2utils.stripTags(u)&&l.clipboardCopy&&w?m:"")+"",u=-1===i&&!0===e?'":u;function k(e){var t="";return n.show.recordTitles&&(null!=l.title?("function"==typeof l.title&&(t=l.title.call(n,d,i,s)),"string"==typeof l.title&&(t=l.title)):t=w2utils.stripTags(String(e).replace(/"/g,"''"))),null!=t?String(t):""}},clipboardCopy:function(e,t){var i=this.records[e],e=this.columns[t],t=e?this.parseField(i,e.field):"";"function"==typeof e.clipboardCopy&&(t=e.clipboardCopy(i)),$("#grid_"+this.name+"_focus").text(t).select(),document.execCommand("copy")},showBubble:function(e,t){var i="",s=this.columns[t].info,n=this.records[e],l=$(this.box).find("#grid_"+this.name+"_data_"+e+"_"+t+" .w2ui-info");if(this.last.bubbleEl&&$(this.last.bubbleEl).w2tag(),this.last.bubbleEl=l,null==s.fields){s.fields=[];for(var o=0;os.maxLength&&(c=c.substr(0,s.maxLength)+"..."),i+=""+a.text+""+((0===c?"0":c)||"")+"")):i+='
';i+=""}else if($.isPlainObject(r)){for(var d in i='',r){var u,c,h=r[d];""!=h&&"-"!=h&&"--"!=h&&"---"!=h?(u=String(h).split(":"),c=(a=null==(a=this.getColumn(u[0]))?{field:u[0],caption:u[0]}:a)?this.parseField(n,a.field):"",1")):i+=''}i+="
"+d+""+((c=null!=s.maxLength&&"string"==typeof c&&c.length>s.maxLength?c.substr(0,s.maxLength)+"...":c)||"")+"
"}$(l).w2tag($.extend({html:i,left:-4,position:"bottom|top",className:"w2ui-info-bubble",style:"",hideOnClick:!0},s.options||{}))},getCellEditable:function(e,t){var i=this.columns[t],s=this.records[e];if(!s||!i)return null;var n=s.w2ui?s.w2ui.editable:null;return!1===n?null:(null!=n&&!0!==n||"function"==typeof(n=i?i.editable:null)&&(i=this.getCellValue(e,t,!1),n=n.call(this,s,e,t,i)),n)},getCellValue:function(e,t,i){var t=this.columns[t],e=(!0!==i?this.records:this.summary)[e],s=this.parseField(e,t.field);return e&&e.w2ui&&e.w2ui.changes&&null!=e.w2ui.changes[t.field]&&(s=e.w2ui.changes[t.field]),$.isPlainObject(s)&&(t.options&&t.options.items?(val=t.options.items.find(function(e){return e.id==s.id}),s=val?val.text:s.id):null!=(s=null!=s.text?s.text:s).id&&(s=s.id)),s=null==s?"":s},getFooterHTML:function(){return'
'},status:function(e){var t,i;null!=e?$("#grid_"+this.name+"_footer").find(".w2ui-footer-left").html(e):(t="",0<(i=this.getSelection()).length&&(this.show.statusSelection&&1=this.columns.length)return null;var n=this.records[e].w2ui,l=(this.columns[t],this.columns[s]),n=n&&n.colspan&&!isNaN(n.colspan[l.field])?parseInt(n.colspan[l.field]):1;if(null==l)return null;if(l&&l.hidden||0===n)return this.nextCell(e,s,i);if(i){t=this.getCellEditable(e,t);if(null==t||-1!=["checkbox","check"].indexOf(t.type))return this.nextCell(e,s,i)}return s},prevCell:function(e,t,i){var s=t-1;if(s<0)return null;var n=this.records[e].w2ui,l=this.columns[s],n=n&&n.colspan&&!isNaN(n.colspan[l.field])?parseInt(n.colspan[l.field]):1;if(null==l)return null;if(l&&l.hidden||0===n)return this.prevCell(e,s,i);if(i){t=this.getCellEditable(e,t);if(null==t||-1!=["checkbox","check"].indexOf(t.type))return this.prevCell(e,s,i)}return s},nextRow:function(e,t){var i=this.last.searchIds,s=null;if(e+1this.records.length);)e++;var n=this.records[e].w2ui,l=this.columns[t],s=0===(n&&n.colspan&&null!=l&&!isNaN(n.colspan[l.field])?parseInt(n.colspan[l.field]):1)?this.nextRow(e,t):e}return s},prevRow:function(e,t){var i=this.last.searchIds,s=null;if(0i[0]){if(e--,0'+e+"",buttons:'",onOpen:function(e){setTimeout(function(){$(this.box).find(".w2ui-btn").focus()},25)},onClose:function(e){"function"==typeof t&&t()}}),w2utils.message.call(this,{box:this.box,path:"w2ui."+this.name,title:".w2ui-grid-header:visible",body:".w2ui-grid-box"},e)}},$.extend(w2grid.prototype,w2utils.event),w2obj.grid=w2grid}(jQuery),function(O){function a(e){this.box=null,this.name=null,this.panels=[],this.tmp={},this.padding=1,this.resizer=4,this.style="",O.extend(!0,this,w2obj.layout,e)}var z=["top","left","main","preview","right","bottom"];O.fn.w2layout=function(e){if(!O.isPlainObject(e)){var t=w2ui[O(this).attr("name")];return t?0"+t+""),l.status=!0,l;if(null==n)return console.log("ERROR: incorrect panel name. Panel name can be main, left, right, top, bottom, preview or css"),l.error=!0,l;if(null==t)return l;var o=this.trigger({phase:"before",type:"content",target:e,object:n,content:t,transition:i});if(!0===o.isCancelled)return l.cancelled=!0,l;if(t instanceof jQuery)return console.log("ERROR: You can not pass jQuery object to w2layout.content() method"),l;var a,r,d="#layout_"+this.name+"_panel_"+n.type,u=O(d+"> .w2ui-panel-content"),c=0;return 0 .w2ui-panel-content")).after('
'),r=O(d+"> .w2ui-panel-content.new-panel"),a.css("top",c),r.css("top",c),"object"==typeof t?(t.box=r[0],t.render()):r.html(t),w2utils.transition(a[0],r[0],i,function(){a.remove(),r.removeClass("new-panel"),r.css("overflow",n.overflow),O(d+"> .w2ui-panel-content").slice(1).remove(),s.resize(),-1!=window.navigator.userAgent.indexOf("MSIE")&&setTimeout(function(){s.resize()},100)}))),this.refresh(e),s.trigger(O.extend(o,{phase:"after"})),s.resize(),-1!=window.navigator.userAgent.indexOf("MSIE")&&setTimeout(function(){s.resize()},100),l},message:function(e,t){var i=this;"string"==typeof t&&(t={width:t.length<300?350:550,height:t.length<300?170:250,body:'
'+t+"
",buttons:'",onOpen:function(e){setTimeout(function(){O(this.box).find(".w2ui-btn").focus()},25)}});var s,n=this.get(e),l=O("#layout_"+this.name+"_panel_"+n.type).css("overflow");t&&(t.onClose&&(s=t.onClose),t.onClose=function(e){"function"==typeof s&&s(e),e.done(function(){O("#layout_"+i.name+"_panel_"+n.type).css("overflow",l)})}),O("#layout_"+this.name+"_panel_"+n.type).css("overflow","hidden"),w2utils.message.call(this,{box:O("#layout_"+this.name+"_panel_"+n.type),param:e,path:"w2ui."+this.name,title:".w2ui-panel-title:visible",body:".w2ui-panel-content"},t)},load:function(s,e,n,l){var o=this;return"css"==s?(O.get(e,function(e,t,i){o.html(s,i.responseText),l&&l()}),!0):null!=this.get(s)&&(O.get(e,function(e,t,i){o.html(s,i.responseText,n),l&&l(),o.resize(),-1!=window.navigator.userAgent.indexOf("MSIE")&&setTimeout(function(){o.resize()},100)}),!0)},sizeTo:function(e,t,i){var s=this;return null!=s.get(e)&&(O(s.box).find(" > div > .w2ui-panel").css(w2utils.cssPrefix("transition",!0!==i?".2s":"0s")),setTimeout(function(){s.set(e,{size:t})},1),setTimeout(function(){O(s.box).find(" > div > .w2ui-panel").css(w2utils.cssPrefix("transition","0s")),s.resize()},500),!0)},show:function(e,t){var i=this,s=this.trigger({phase:"before",type:"show",target:e,object:this.get(e),immediate:t});if(!0!==s.isCancelled){var n=i.get(e);return null==n?!1:(!(n.hidden=!1)===t?(O("#layout_"+i.name+"_panel_"+e).css({opacity:"1"}),i.trigger(O.extend(s,{phase:"after"})),i.resize()):(O("#layout_"+i.name+"_panel_"+e).css({opacity:"0"}),O(i.box).find(" > div > .w2ui-panel").css(w2utils.cssPrefix("transition",".2s")),setTimeout(function(){i.resize()},1),setTimeout(function(){O("#layout_"+i.name+"_panel_"+e).css({opacity:"1"})},250),setTimeout(function(){O(i.box).find(" > div > .w2ui-panel").css(w2utils.cssPrefix("transition","0s")),i.trigger(O.extend(s,{phase:"after"})),i.resize()},500)),!0)}},hide:function(e,t){var i=this,s=this.trigger({phase:"before",type:"hide",target:e,object:this.get(e),immediate:t});if(!0!==s.isCancelled){var n=i.get(e);return null==n?!1:((n.hidden=!0)===t?(O("#layout_"+i.name+"_panel_"+e).css({opacity:"0"}),i.trigger(O.extend(s,{phase:"after"})),i.resize()):(O(i.box).find(" > div > .w2ui-panel").css(w2utils.cssPrefix("transition",".2s")),O("#layout_"+i.name+"_panel_"+e).css({opacity:"0"}),setTimeout(function(){i.resize()},1),setTimeout(function(){O(i.box).find(" > div > .w2ui-panel").css(w2utils.cssPrefix("transition","0s")),i.trigger(O.extend(s,{phase:"after"})),i.resize()},500)),!0)}},toggle:function(e,t){var i=this.get(e);return null!=i&&(i.hidden?this.show(e,t):this.hide(e,t))},set:function(e,t){var i=this.get(e,!0);return null!=i&&(O.extend(this.panels[i],t),null==t.content&&null==t.resizable||this.refresh(e),this.resize(),!0)},get:function(e,t){for(var i=0;i .w2ui-panel-content");return 1!=e.length?null:e[0]},hideToolbar:function(e){var t=this.get(e);t&&(t.show.toolbar=!1,O("#layout_"+this.name+"_panel_"+e+"> .w2ui-panel-toolbar").hide(),this.resize())},showToolbar:function(e){var t=this.get(e);t&&(t.show.toolbar=!0,O("#layout_"+this.name+"_panel_"+e+"> .w2ui-panel-toolbar").show(),this.resize())},toggleToolbar:function(e){var t=this.get(e);t&&(t.show.toolbar?this.hideToolbar(e):this.showToolbar(e))},assignToolbar:function(e,t){"string"==typeof t&&null!=w2ui[t]&&(t=w2ui[t]);var i=this.get(e);i.toolbar=t;var s=O(this.box).find(e+"> .w2ui-panel-toolbar");null!=i.toolbar?(0===s.find("[name="+i.toolbar.name+"]").length?s.w2render(i.toolbar):null!=i.toolbar&&i.toolbar.refresh(),(t.owner=this).showToolbar(e),this.refresh(e)):(s.html(""),this.hideToolbar(e))},hideTabs:function(e){var t=this.get(e);t&&(t.show.tabs=!1,O("#layout_"+this.name+"_panel_"+e+"> .w2ui-panel-tabs").hide(),this.resize())},showTabs:function(e){var t=this.get(e);t&&(t.show.tabs=!0,O("#layout_"+this.name+"_panel_"+e+"> .w2ui-panel-tabs").show(),this.resize())},toggleTabs:function(e){var t=this.get(e);t&&(t.show.tabs?this.hideTabs(e):this.showTabs(e))},render:function(e){var u=this,t=(new Date).getTime(),i=u.trigger({phase:"before",type:"render",target:u.name,box:e});if(!0!==i.isCancelled){if(null!=e&&(0"),0
';O(u.box).find(" > div").append(n)}return O(u.box).find(" > div").append('
'),u.refresh(),u.trigger(O.extend(i,{phase:"after"})),setTimeout(function(){u.tmp.events={resize:function(e){null==w2ui[u.name]?O(window).off("resize.w2ui-"+u.name):w2ui[u.name].resize()},resizeStart:l,mouseMove:a,mouseUp:o},O(window).on("resize.w2ui-"+u.name,u.tmp.events.resize),u.resize()},0),(new Date).getTime()-t}function l(e,t){if(u.box){t=t||window.event,O(document).off("mousemove",u.tmp.events.mouseMove).on("mousemove",u.tmp.events.mouseMove),O(document).off("mouseup",u.tmp.events.mouseUp).on("mouseup",u.tmp.events.mouseUp),u.tmp.resize={type:e,x:t.screenX,y:t.screenY,diff_x:0,diff_y:0,value:0};for(var i=0;it.width&&(l=t.minSize-t.width),t.maxSize&&t.width+l>t.maxSize&&(l=t.maxSize-t.width),a.minSize+l>a.width&&(l=a.width-a.minSize);break;case"right":t.minSize+l>t.width&&(l=t.width-t.minSize),t.maxSize&&t.width-l>t.maxSize&&(l=t.width-t.maxSize),a.minSize-l>a.width&&(l=a.minSize-a.width);break;case"top":t.minSize-o>t.height&&(o=t.minSize-t.height),t.maxSize&&t.height+o>t.maxSize&&(o=t.maxSize-t.height),a.minSize+o>a.height&&(o=a.height-a.minSize);break;case"preview":case"bottom":t.minSize+o>t.height&&(o=t.height-t.minSize),t.maxSize&&t.height-o>t.maxSize&&(o=t.height-t.maxSize),a.minSize-o>a.height&&(o=a.minSize-a.height)}switch(i.diff_x=l,i.diff_y=o,i.type){case"top":case"preview":case"bottom":(i.diff_x=0) .w2ui-panel-content")[0],setTimeout(function(){0 .w2ui-panel-content").length&&(O(l+"> .w2ui-panel-content").removeClass().removeAttr("name").addClass("w2ui-panel-content").css("overflow",n.overflow)[0].style.cssText+=";"+n.style),n.content&&"function"==typeof n.content.render&&n.content.render()},1)):0 .w2ui-panel-content").length&&(O(l+"> .w2ui-panel-content").removeClass().removeAttr("name").addClass("w2ui-panel-content").html(n.content).css("overflow",n.overflow)[0].style.cssText+=";"+n.style);e=O(t.box).find(l+"> .w2ui-panel-tabs");n.show.tabs?0===e.find("[name="+n.tabs.name+"]").length&&null!=n.tabs?e.w2render(n.tabs):n.tabs.refresh():e.html("").removeClass("w2ui-tabs").hide(),e=O(t.box).find(l+"> .w2ui-panel-toolbar"),n.show.toolbar?0===e.find("[name="+n.toolbar.name+"]").length&&null!=n.toolbar?e.w2render(n.toolbar):n.toolbar.refresh():e.html("").removeClass("w2ui-toolbar").hide(),e=O(t.box).find(l+"> .w2ui-panel-title"),n.title?e.html(n.title).show():e.html("").hide()}else{if(0===O("#layout_"+t.name+"_panel_main").length)return void t.render();t.resize();for(var o=0;o div").css({width:s+"px",height:n+"px"});for(var l,o,a,r,d,u,c=this,h=this.get("main"),p=this.get("preview"),f=this.get("left"),g=this.get("right"),m=this.get("top"),w=this.get("bottom"),v=null!=p&&!0!==p.hidden,y=null!=f&&!0!==f.hidden,b=null!=g&&!0!==g.hidden,x=null!=m&&!0!==m.hidden,_=null!=w&&!0!==w.hidden,k=0;kthis.padding?this.resizer:this.padding,O("#layout_"+this.name+"_resizer_top").show().css({display:"block",left:l+"px",top:o+"px",width:a+"px",height:r+"px",cursor:"ns-resize"}).off("mousedown").on("mousedown",function(e){var t=c.trigger({phase:"before",type:"resizerClick",target:"top",originalEvent:e});if(!0!==t.isCancelled)return w2ui[c.name].tmp.events.resizeStart("top",e),c.trigger(O.extend(t,{phase:"after"})),!1}))):(O("#layout_"+this.name+"_panel_top").hide(),O("#layout_"+this.name+"_resizer_top").hide()),null!=f&&!0!==f.hidden?(o=(l=0)+(x?m.sizeCalculated+this.padding:0),a=f.sizeCalculated,r=n-(x?m.sizeCalculated+this.padding:0)-(_?w.sizeCalculated+this.padding:0),d=O("#layout_"+this.name+"_panel_left"),-1!=window.navigator.userAgent.indexOf("MSIE")&&0this.padding?this.resizer:this.padding,O("#layout_"+this.name+"_resizer_left").show().css({display:"block",left:l+"px",top:o+"px",width:a+"px",height:r+"px",cursor:"ew-resize"}).off("mousedown").on("mousedown",function(e){var t=c.trigger({phase:"before",type:"resizerClick",target:"left",originalEvent:e});if(!0!==t.isCancelled)return w2ui[c.name].tmp.events.resizeStart("left",e),c.trigger(O.extend(t,{phase:"after"})),!1}))):(O("#layout_"+this.name+"_panel_left").hide(),O("#layout_"+this.name+"_resizer_left").hide()),null!=g&&!0!==g.hidden?(l=s-g.sizeCalculated,o=0+(x?m.sizeCalculated+this.padding:0),a=g.sizeCalculated,r=n-(x?m.sizeCalculated+this.padding:0)-(_?w.sizeCalculated+this.padding:0),O("#layout_"+this.name+"_panel_right").css({display:"block",left:l+"px",top:o+"px",width:a+"px",height:r+"px"}).show(),g.width=a,g.height=r,g.resizable&&(l-=this.padding,a=this.resizer>this.padding?this.resizer:this.padding,O("#layout_"+this.name+"_resizer_right").show().css({display:"block",left:l+"px",top:o+"px",width:a+"px",height:r+"px",cursor:"ew-resize"}).off("mousedown").on("mousedown",function(e){var t=c.trigger({phase:"before",type:"resizerClick",target:"right",originalEvent:e});if(!0!==t.isCancelled)return w2ui[c.name].tmp.events.resizeStart("right",e),c.trigger(O.extend(t,{phase:"after"})),!1}))):(O("#layout_"+this.name+"_panel_right").hide(),O("#layout_"+this.name+"_resizer_right").hide()),null!=w&&!0!==w.hidden?(l=0,o=n-w.sizeCalculated,a=s,r=w.sizeCalculated,O("#layout_"+this.name+"_panel_bottom").css({display:"block",left:l+"px",top:o+"px",width:a+"px",height:r+"px"}).show(),w.width=a,w.height=r,w.resizable&&(o-=0===this.padding?0:this.padding,r=this.resizer>this.padding?this.resizer:this.padding,O("#layout_"+this.name+"_resizer_bottom").show().css({display:"block",left:l+"px",top:o+"px",width:a+"px",height:r+"px",cursor:"ns-resize"}).off("mousedown").on("mousedown",function(e){var t=c.trigger({phase:"before",type:"resizerClick",target:"bottom",originalEvent:e});if(!0!==t.isCancelled)return w2ui[c.name].tmp.events.resizeStart("bottom",e),c.trigger(O.extend(t,{phase:"after"})),!1}))):(O("#layout_"+this.name+"_panel_bottom").hide(),O("#layout_"+this.name+"_resizer_bottom").hide()),l=0+(y?f.sizeCalculated+this.padding:0),o=0+(x?m.sizeCalculated+this.padding:0),a=s-(y?f.sizeCalculated+this.padding:0)-(b?g.sizeCalculated+this.padding:0),r=n-(x?m.sizeCalculated+this.padding:0)-(_?w.sizeCalculated+this.padding:0)-(v?p.sizeCalculated+this.padding:0),d=O("#layout_"+this.name+"_panel_main"),-1!=window.navigator.userAgent.indexOf("MSIE")&&0this.padding?this.resizer:this.padding,O("#layout_"+this.name+"_resizer_preview").show().css({display:"block",left:l+"px",top:o+"px",width:a+"px",height:r+"px",cursor:"ns-resize"}).off("mousedown").on("mousedown",function(e){var t=c.trigger({phase:"before",type:"resizerClick",target:"preview",originalEvent:e});if(!0!==t.isCancelled)return w2ui[c.name].tmp.events.resizeStart("preview",e),c.trigger(O.extend(t,{phase:"after"})),!1}))):(O("#layout_"+this.name+"_panel_preview").hide(),O("#layout_"+this.name+"_resizer_preview").hide());for(var C=0;C .w2ui-panel-",$=0;T&&(T.title&&($+=w2utils.getSize(O(S+"title").css({top:$+"px",display:"block"}),"height")),T.show.tabs&&(null!=T.tabs&&w2ui[this.name+"_"+z[C]+"_tabs"]&&w2ui[this.name+"_"+z[C]+"_tabs"].resize(),$+=w2utils.getSize(O(S+"tabs").css({top:$+"px",display:"block"}),"height")),T.show.toolbar&&(null!=T.toolbar&&w2ui[this.name+"_"+z[C]+"_toolbar"]&&w2ui[this.name+"_"+z[C]+"_toolbar"].resize(),$+=w2utils.getSize(O(S+"toolbar").css({top:$+"px",display:"block"}),"height"))),O(S+"content").css({display:"block"}).css({top:$+"px"})}return clearTimeout(this._resize_timer),this._resize_timer=setTimeout(function(){for(var e in w2ui){var t;"function"==typeof w2ui[e].resize&&(null==w2ui[e].panels&&w2ui[e].resize(),0<(t=O(w2ui[e].box).parents(".w2ui-layout")).length&&t.attr("name")==c.name&&w2ui[e].resize())}},100),this.trigger(O.extend(i,{phase:"after"})),(new Date).getTime()-e}},destroy:function(){var e=this.trigger({phase:"before",type:"destroy",target:this.name});if(!0!==e.isCancelled)return null!=w2ui[this.name]&&(0"+e+""),"object"==typeof t&&(i.buttons+='"),"string"==typeof t&&(i.buttons+=t)})),0===c("#w2ui-popup").length){if(!0===(n=this.trigger({phase:"before",type:"open",target:"popup",options:i,present:!1})).isCancelled)return;w2popup.status="opening",w2popup.lockScreen(i);var a="";i.showClose&&(a+='
Close
'),i.showMax&&(a+='
Max
');o='
';c("body").append(o);l=c("#w2ui-popup");0'+a+'
';c("#w2ui-popup").html(o),i.title&&c("#w2ui-popup .w2ui-popup-title").append(i.title),i.buttons&&c("#w2ui-popup .w2ui-popup-buttons").append(i.buttons),i.body&&c("#w2ui-popup .w2ui-popup-body").append(i.body),setTimeout(function(){c("#w2ui-popup").css(w2utils.cssPrefix({transition:i.speed+"s opacity, "+i.speed+"s -webkit-transform"})).removeClass("w2ui-popup-opening"),t.focus()},1),setTimeout(function(){c("#w2ui-popup").css(w2utils.cssPrefix("transform",""))},1e3*i.speed),w2popup.status="open",t.trigger(c.extend(n,{phase:"after"}))}else if(!0===i.multiple)w2popup.message(e);else{if(null==w2popup._prev&&null!=w2popup._template&&t.restoreTemplate(),!0===(n=this.trigger({phase:"before",type:"open",target:"popup",options:i,present:!0})).isCancelled)return;w2popup.status="opening",null!=s&&(s.maximized||s.width==i.width&&s.height==i.height||w2popup.resize(i.width,i.height),i.prevSize=i.width+"px:"+i.height+"px",i.maximized=s.maximized);s=c("#w2ui-popup .w2ui-box").clone();s.removeClass("w2ui-box").addClass("w2ui-box-temp").find(".w2ui-popup-body").empty().append(i.body),"string"==typeof i.body&&0Close':"")+(i.showMax?'
Max
':"")).append(i.title),c("#w2ui-popup .w2ui-popup-body").removeClass("w2ui-popup-no-title"),c("#w2ui-popup .w2ui-box, #w2ui-popup .w2ui-box-temp").css("top","")):(c("#w2ui-popup .w2ui-popup-title").hide().html(""),c("#w2ui-popup .w2ui-popup-body").addClass("w2ui-popup-no-title"),c("#w2ui-popup .w2ui-box, #w2ui-popup .w2ui-box-temp").css("top","0px"));var r=c("#w2ui-popup .w2ui-box")[0],d=c("#w2ui-popup .w2ui-box-temp")[0];w2utils.transition(r,d,i.transition,function(){t.restoreTemplate(),c(r).remove(),c(d).removeClass("w2ui-box-temp").addClass("w2ui-box");var e=c(d).find(".w2ui-popup-body");1==e.length&&(e[0].style.cssText=i.style),c("#w2ui-popup").data("prev-size",null),t.focus()}),w2popup.status="open",t.trigger(c.extend(n,{phase:"after"}))}i._last_focus=c(":focus"),i.keyboard&&c(document).on("keydown",this.keydown);var u={resizing:!1,mvMove:function(e){if(1!=u.resizing)return;e=e||window.event;u.div_x=e.screenX-u.x,u.div_y=e.screenY-u.y;e=w2popup.trigger({phase:"before",type:"move",target:"popup",div_x:u.div_x,div_y:u.div_y});if(!0===e.isCancelled)return;c("#w2ui-popup").css(w2utils.cssPrefix({transition:"none",transform:"translate3d("+u.div_x+"px, "+u.div_y+"px, 0px)"})),w2popup.trigger(c.extend(e,{phase:"after"}))},mvStop:function(e){if(1!=u.resizing)return;e=e||window.event;w2popup.status="open",u.div_x=e.screenX-u.x,u.div_y=e.screenY-u.y,c("#w2ui-popup").css({left:u.pos_x+u.div_x+"px",top:u.pos_y+u.div_y+"px"}).css(w2utils.cssPrefix({transition:"none",transform:"translate3d(0px, 0px, 0px)"})),u.resizing=!1,c(document).off("mousemove",u.mvMove),c(document).off("mouseup",u.mvStop),u.isLocked||w2popup.unlock()}};return c("#w2ui-popup .w2ui-popup-title").on("mousedown",function(e){w2popup.get().maximized||function(e){e=e||window.event;w2popup.status="moving",u.resizing=!0,u.isLocked=1==c("#w2ui-popup > .w2ui-lock").length,u.x=e.screenX,u.y=e.screenY,u.pos_x=c("#w2ui-popup").position().left,u.pos_y=c("#w2ui-popup").position().top,u.isLocked||w2popup.lock({opacity:0});c(document).on("mousemove",u.mvMove),c(document).on("mouseup",u.mvStop),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0;{if(!e.preventDefault)return;e.preventDefault()}}(e)}),this}setTimeout(function(){t.open.call(t,i)},100)},action:function(e,t){var i=this,s=c("#w2ui-popup").data("options");null!=t&&(i={parent:this,options:s=c("#w2ui-message"+t).data("options"),close:function(){w2popup.message({msgId:t})}});var n=s.actions[e],s=n;c.isPlainObject(n)&&n.onClick&&(s=n.onClick);n=this.trigger({phase:"before",target:e,msgId:t,type:"action",action:n,originalEvent:event});!0!==n.isCancelled&&("function"==typeof s&&s.call(i,event),this.trigger(c.extend(n,{phase:"after"})))},keydown:function(e){var t=c("#w2ui-popup").data("options");t&&!t.keyboard||!0!==(t=w2popup.trigger({phase:"before",type:"keydown",target:"popup",options:t,originalEvent:e})).isCancelled&&(27===e.keyCode&&(e.preventDefault(),0
':i.prefix="",o.addPrefix(),t=o.helpers.focus.find("input"),""===b(t).val()?(b(t).css("text-indent","-9999em").prev().css("opacity",0),b(o.el).val(a&&null!=a.text?w2utils.lang(a.text):"")):(b(t).css("text-indent",0).prev().css("opacity",1),b(o.el).val(""),setTimeout(function(){o.helpers.prefix&&o.helpers.prefix.hide();var e="position: absolute; opacity: 0; margin: 4px 0px 0px 2px; background-position: left !important;";i.icon?(b(t).css("margin-left","17px"),b(o.helpers.focus).find(".icon-search").attr("style",e+"width: 11px !important; opacity: 1; display: block")):(b(t).css("margin-left","0px"),b(o.helpers.focus).find(".icon-search").attr("style",e+"width: 0px !important; opacity: 0; display: none"))},1)),b(o.el).prop("readonly")||b(o.el).prop("disabled")?setTimeout(function(){b(o.helpers.prefix).css("opacity","0.6"),b(o.helpers.suffix).css("opacity","0.6")},1):setTimeout(function(){b(o.helpers.prefix).css("opacity","1"),b(o.helpers.suffix).css("opacity","1")},1))},1)),-1!==["enum","file"].indexOf(this.type)){var t="";if(a)for(var s=0;s  '):'
  
'+("enum"===o.type?n.text:n.name+' - '+w2utils.formatSize(n.size)+"");t+='
  • '+l+"
  • "}var r=o.helpers.multi,d=r.find("ul");r.attr("style",r.attr("style")+";"+i.style),b(o.el).css("z-index","-1"),b(o.el).prop("readonly")||b(o.el).prop("disabled")?setTimeout(function(){r[0].scrollTop=0,r.addClass("w2ui-readonly").find("li").css("opacity","0.9").parent().find("li.nomouse").hide().find("input").prop("readonly",!0).parents("ul").find(".w2ui-list-remove").hide()},1):setTimeout(function(){r.removeClass("w2ui-readonly").find("li").css("opacity","1").parent().find("li.nomouse").show().find("input").prop("readonly",!1).parents("ul").find(".w2ui-list-remove").show()},1),r.find(".w2ui-enum-placeholder").remove(),d.find("li").not("li.nomouse").remove(),""!==t?d.prepend(t):null!=b(o.el).attr("placeholder")&&""===r.find("input").val()&&(u="padding-top: "+b(this.el).css("padding-top")+";padding-left: "+b(this.el).css("padding-left")+"; box-sizing: "+b(this.el).css("box-sizing")+"; line-height: "+b(this.el).css("line-height")+"; font-size: "+b(this.el).css("font-size")+"; font-family: "+b(this.el).css("font-family")+"; ",r.prepend('
    '+b(o.el).attr("placeholder")+"
    ")),r.off("scroll.w2field").on("scroll.w2field",function(e){e=o.trigger({phase:"before",type:"scroll",target:o.el,originalEvent:e});!0!==e.isCancelled&&o.trigger(b.extend(e,{phase:"after"}))}).find("li").data("mouse","out").on("click",function(e){var t,i,s,n="LI"===e.target.tagName.toUpperCase()?e.target:b(e.target).parents("LI"),l=a[b(n).attr("index")];b(n).hasClass("nomouse")||(e.stopPropagation(),b(e.target).hasClass("w2ui-list-remove")?b(o.el).prop("readonly")||b(o.el).prop("disabled")||!0!==(t=o.trigger({phase:"before",type:"remove",target:o.el,originalEvent:e.originalEvent,item:l})).isCancelled&&(b().w2overlay(),a.splice(b(e.target).attr("index"),1),b(o.el).trigger("input").trigger("change"),b(e.target).parent().fadeOut("fast"),setTimeout(function(){o.refresh(),o.trigger(b.extend(t,{phase:"after"}))},300)):!0!==(t=o.trigger({phase:"before",type:"click",target:o.el,originalEvent:e.originalEvent,item:l})).isCancelled&&("file"===o.type&&(i="",/image/i.test(l.type)&&(i='
    '),s='style="padding: 3px"',i+='
    "+w2utils.lang("Name")+":"+l.name+"
    "+w2utils.lang("Size")+":"+w2utils.formatSize(l.size)+"
    "+w2utils.lang("Type")+": '+l.type+"
    "+w2utils.lang("Modified")+":"+w2utils.date(l.modified)+"
    ",b("#w2ui-overlay").remove(),b(n).w2overlay(i)),o.trigger(b.extend(t,{phase:"after"}))))}).on("mouseover",function(e){var t="LI"===e.target.tagName.toUpperCase()?e.target:b(e.target).parents("LI");if(!b(t).hasClass("nomouse")){if("out"===b(t).data("mouse")){var i=a[b(e.target).attr("index")],i=o.trigger({phase:"before",type:"mouseOver",target:o.el,originalEvent:e.originalEvent,item:i});if(!0===i.isCancelled)return;o.trigger(b.extend(i,{phase:"after"}))}b(t).data("mouse","over")}}).on("mouseout",function(t){var i="LI"===t.target.tagName.toUpperCase()?t.target:b(t.target).parents("LI");b(i).hasClass("nomouse")||(b(i).data("mouse","leaving"),setTimeout(function(){var e;"leaving"===b(i).data("mouse")&&(b(i).data("mouse","out"),e=a[b(t.target).attr("index")],!0!==(e=o.trigger({phase:"before",type:"mouseOut",target:o.el,originalEvent:t.originalEvent,item:e})).isCancelled&&o.trigger(b.extend(e,{phase:"after"})))},0))}),b(this.el).height("auto");d=b(r).find("> div.w2ui-multi-items").height()+2*w2utils.getSize(r,"+height");(d=d<26?26:d)>i.maxHeight&&(d=i.maxHeight),0',s.addSuffix()),l&&s.addPrefix(),s.tmp.current_width=n)},clean:function(e){if("number"==typeof e)return e;var t=this.options;return e=String(e).trim(),-1!==["int","float","money","currency","percent"].indexOf(this.type)&&("string"==typeof e&&(t.autoFormat&&-1!==["money","currency"].indexOf(this.type)&&(e=String(e).replace(t.moneyRE,"")),t.autoFormat&&"percent"===this.type&&(e=String(e).replace(t.percentRE,"")),e=(e=t.autoFormat&&-1!==["int","float"].indexOf(this.type)?String(e).replace(t.numberRE,""):e).replace(/\s+/g,"").replace(w2utils.settings.groupSymbol,"").replace(w2utils.settings.decimalSymbol,".")),parseFloat(e)==e&&(null!=t.min&&et.max&&(e=t.max,b(this.el).val(t.max))),e=""!==e&&w2utils.isFloat(e)?Number(e):""),e},format:function(e){var t=this.options;if(t.autoFormat&&""!==e)switch(this.type){case"money":case"currency":""!==(e=w2utils.formatNumber(e,t.currencyPrecision,t.groupSymbol))&&(e=t.currencyPrefix+e+t.currencySuffix);break;case"percent":""!==(e=w2utils.formatNumber(e,t.precision,t.groupSymbol))&&(e+="%");break;case"float":e=w2utils.formatNumber(e,t.precision,t.groupSymbol);break;case"int":e=w2utils.formatNumber(e,0,t.groupSymbol)}return e},change:function(e){var t,i=this,s=i.options;if(-1!==["int","float","money","currency","percent"].indexOf(this.type)){var n=b(this.el).val(),l=this.format(this.clean(b(this.el).val()));if(""!==n&&n!=l)return b(this.el).val(l).trigger("input").change(),e.stopPropagation(),e.preventDefault(),!1}"color"===this.type&&("rgb"!==(t=b(this.el).val()).substr(0,3).toLowerCase()&&(t="#"+t,8!==(e=b(this.el).val().length)&&6!==e&&3!==e&&(t="")),b(this.el).next().find("div").css("background-color",t),b(this.el).hasClass("has-focus")&&!0!==b(this.el).data("skipInit")&&this.updateOverlay()),-1!==["list","enum","file"].indexOf(this.type)&&(i.refresh(),setTimeout(function(){i.refresh()},5)),-1!==["date","time","datetime"].indexOf(this.type)&&(t=parseInt(i.el.value),w2utils.isInt(i.el.value)&&3e3=s.min||null==s.min?Number((o-a).toFixed(12)):s.min;b(i.el).val(r).trigger("input").change(),l=!0}l&&(e.preventDefault(),setTimeout(function(){i.el.setSelectionRange(i.el.value.length,i.el.value.length)},0))}if("date"===i.type){if(!s.keyboard||b(i.el).prop("readonly")||b(i.el).prop("disabled"))return;var d=864e5,a=1;switch((e.ctrlKey||e.metaKey)&&(a=10),(h=w2utils.isDate(b(i.el).val(),s.format,!0))||(h=new Date,d=0),n){case 38:if(e.shiftKey)break;var u=w2utils.formatDate(h.getTime()+d,s.format);10==a&&(u=w2utils.formatDate(new Date(h.getFullYear(),h.getMonth()+1,h.getDate()),s.format)),b(i.el).val(u).trigger("input").change(),l=!0;break;case 40:if(e.shiftKey)break;u=w2utils.formatDate(h.getTime()-d,s.format);10==a&&(u=w2utils.formatDate(new Date(h.getFullYear(),h.getMonth()-1,h.getDate()),s.format)),b(i.el).val(u).trigger("input").change(),l=!0}l&&(e.preventDefault(),setTimeout(function(){i.el.setSelectionRange(i.el.value.length,i.el.value.length),i.updateOverlay()},0))}if("time"===i.type){if(!s.keyboard||b(i.el).prop("readonly")||b(i.el).prop("disabled"))return;var a=e.ctrlKey||e.metaKey?60:1,o=b(i.el).val(),c=i.toMin(o)||i.toMin((new Date).getHours()+":"+((new Date).getMinutes()-1));switch(n){case 38:if(e.shiftKey)break;c+=a,l=!0;break;case 40:if(e.shiftKey)break;c-=a,l=!0}l&&(b(i.el).val(i.fromMin(c)).trigger("input").change(),e.preventDefault(),setTimeout(function(){i.el.setSelectionRange(i.el.value.length,i.el.value.length)},0))}if("datetime"===i.type){if(!s.keyboard||b(i.el).prop("readonly")||b(i.el).prop("disabled"))return;d=864e5,a=1;(e.ctrlKey||e.metaKey)&&(a=10);var h,p=b(i.el).val();switch((h=w2utils.isDateTime(p,this.options.format,!0))||(h=new Date,d=0),n){case 38:if(e.shiftKey)break;u=w2utils.formatDateTime(h.getTime()+d,s.format);10==a&&(u=w2utils.formatDateTime(new Date(h.getFullYear(),h.getMonth()+1,h.getDate()),s.format)),b(i.el).val(u).trigger("input").change(),l=!0;break;case 40:if(e.shiftKey)break;u=w2utils.formatDateTime(h.getTime()-d,s.format);10==a&&(u=w2utils.formatDateTime(new Date(h.getFullYear(),h.getMonth()-1,h.getDate()),s.format)),b(i.el).val(u).trigger("input").change(),l=!0}l&&(e.preventDefault(),setTimeout(function(){i.el.setSelectionRange(i.el.value.length,i.el.value.length),i.updateOverlay()},0))}if("color"===i.type){if(b(i.el).prop("readonly")||b(i.el).prop("disabled"))return;if((e.ctrlKey||e.metaKey)&&!e.shiftKey){var f=null;switch(n){case 38:f="up";break;case 40:f="down";break;case 39:f="right";break;case 37:f="left"}i.el.nav&&null!=f&&(p=i.el.nav(f),b(i.el).val(p).trigger("input").change(),e.preventDefault())}}if(-1!==["list","combo","enum"].indexOf(i.type)&&!b(i.el).prop("readonly")&&!b(i.el).prop("disabled")){var g=b(i.el).data("selected"),m=b(i.el),w=!1;switch(-1!==["list","enum"].indexOf(i.type)&&("list"===i.type&&(m=b(i.helpers.focus).find("input")),"enum"===i.type&&(m=b(i.helpers.multi).find("input")),-1==[37,38,39,40].indexOf(n)&&setTimeout(function(){i.refresh()},1),86==e.keyCode&&(e.ctrlKey||e.metaKey)&&setTimeout(function(){i.refresh(),i.search(),i.request()},50)),n){case 27:"list"===i.type&&(""!==m.val()&&m.val(""),e.stopPropagation());break;case 37:case 39:break;case 13:if(0===b("#w2ui-overlay").length)break;var v=s.items[s.index];if("enum"===i.type)if(null!=v){if(!0===(y=i.trigger({phase:"before",type:"add",target:i.el,originalEvent:e.originalEvent,item:v})).isCancelled)return;v=y.item,g.length>=s.max&&0=s.max&&0=s.items.length&&(s.index=s.items.length-1),i.updateOverlay(w),e.preventDefault(),void setTimeout(function(){var e;"enum"===i.type||"list"===i.type?(e=m.get(0)).setSelectionRange(e.value.length,e.value.length):i.el.setSelectionRange(i.el.value.length,i.el.value.length)},0);"enum"===i.type&&m.width(8*(m.val().length+2)+"px")}},keyUp:function(e){var t,i;-1!==["list","combo","enum"].indexOf(this.type)&&(b(this.el).prop("readonly")||b(this.el).prop("disabled")||-1==[16,17,18,20,37,39,91].indexOf(e.keyCode)&&(0===(t=b(this.helpers.focus).find("input")).length&&(t=b(this.el)),!0!==(i=this.trigger({phase:"before",type:"search",originalEvent:e,target:t,search:t.val()})).isCancelled&&(this.tmp.force_hide||this.request(),1==t.val().length&&this.refresh(),0!==b("#w2ui-overlay").length&&-1!=[38,40].indexOf(e.keyCode)||this.search(),this.trigger(b.extend(i,{phase:"after"})))))},clearCache:function(){this.options.items=[],this.tmp.xhr_loading=!1,this.tmp.xhr_search="",this.tmp.xhr_total=-1},request:function(e){var t,o=this,a=this.options,r=b(o.el).val()||"";if(a.url){if("enum"===o.type&&(r=0===(t=b(o.helpers.multi).find("input")).length?"":t.val()),"list"===o.type&&(t=b(o.helpers.focus).find("input"),r=0===t.length?"":t.val()),0!==a.minLength&&r.lengtho.tmp.xhr_search.length||r.length>=o.tmp.xhr_search.length&&r.substr(0,o.tmp.xhr_search.length)!==o.tmp.xhr_search||r.lengtha.cacheMax&&e.records.splice(a.cacheMax,1e5),null==a.recId&&null!=a.recid&&(a.recId=a.recid),(a.recId||a.recText)&&e.records.forEach(function(e){"string"==typeof a.recId&&(e.id=e[a.recId]),"function"==typeof a.recId&&(e.id=a.recId(e)),"string"==typeof a.recText&&(e.text=e[a.recText]),"function"==typeof a.recText&&(e.text=a.recText(e))}),o.tmp.xhr_loading=!1,o.tmp.xhr_search=r,o.tmp.xhr_total=e.records.length,o.tmp.lastError="",a.items=o.normMenu(e.records),""===r&&0===e.records.length?o.tmp.emptySet=!0:o.tmp.emptySet=!1,(s=b(o.el).data("find_selected"))&&(Array.isArray(s)?(n=[],s.forEach(function(t){var i=!1;a.items.forEach(function(e){(e.id==t||t&&t.id==e.id)&&(n.push(b.extend(!0,{},e)),i=!0)}),i||n.push(t)})):(n=s,a.items.forEach(function(e){(e.id==s||s&&s.id==e.id)&&(n=e)})),b(o.el).data("selected",n).removeData("find_selected").trigger("input").change()),o.search(),o.trigger(b.extend(i,{phase:"after"}))):console.log("ERROR: server did not return proper structure. It should return",{status:"success",records:[{id:1,text:"item"}]}))}).fail(function(e,t,i){var s,i={status:t,error:i,rawResponseText:e.responseText},i=o.trigger({phase:"before",type:"error",target:o.el,search:r,error:i,xhr:e});if(!0!==i.isCancelled){if("abort"!==t){try{s=b.parseJSON(e.responseText)}catch(e){}console.log("ERROR: Server communication failed.","\n EXPECTED:",{status:"success",records:[{id:1,text:"item"}]},"\n OR:",{status:"error",message:"error message"},"\n RECEIVED:","object"==typeof s?s:e.responseText)}o.tmp.xhr_loading=!1,o.tmp.xhr_search=r,o.tmp.xhr_total=0,o.tmp.emptySet=!0,o.tmp.lastError=i.error||"Server communication failed",a.items=[],o.clearCache(),o.search(),o.updateOverlay(!1),o.trigger(b.extend(i,{phase:"after"}))}}),o.trigger(b.extend(t,{phase:"after"})))},e)}}},search:function(){var e=this,t=this.options,i=b(e.el).val(),s=e.el,n=[],l=b(e.el).data("selected");if("enum"===e.type)for(var o in s=b(e.helpers.multi).find("input"),i=s.val(),l)l[o]&&n.push(l[o].id);else if("list"===e.type)for(var o in s=b(e.helpers.focus).find("input"),i=s.val(),l)l[o]&&n.push(l[o].id);var a=t.items;if(!0!==e.tmp.xhr_loading){for(var r=0,d=0;d',{css:{"background-color":"#f5f5f5"},onShow:function(e){w2utils.isIE&&b(".w2ui-calendar").on("mousedown",function(e){e=b(e.target);1===e.length&&"w2ui-jump-year"===e[0].id&&b("#w2ui-overlay").data("keepOpen",!0)})}}),(t=w2utils.isDate(b(n.el).val(),n.options.format,!0))&&(r=t.getMonth()+1,d=t.getFullYear()),function i(e,t){b("#w2ui-overlay > div > div").html(n.getMonthHTML(e,t,b(n.el).val())),b("#w2ui-overlay .w2ui-calendar-title").on("mousedown",function(){var e,t;b(this).next().hasClass("w2ui-calendar-jump")?b(this).next().remove():(b(this).after('
    '),b(this).next().hide().html(n.getYearHTML()).fadeIn(200),setTimeout(function(){b("#w2ui-overlay .w2ui-calendar-jump").find(".w2ui-jump-month, .w2ui-jump-year").on("click",function(){b(this).hasClass("w2ui-jump-month")&&(b(this).parent().find(".w2ui-jump-month").removeClass("selected"),b(this).addClass("selected"),t=b(this).attr("name")),b(this).hasClass("w2ui-jump-year")&&(b(this).parent().find(".w2ui-jump-year").removeClass("selected"),b(this).addClass("selected"),e=b(this).attr("name")),null!=e&&null!=t&&(b("#w2ui-overlay .w2ui-calendar-jump").fadeOut(100),setTimeout(function(){i(parseInt(t)+1,e)},100))}),b("#w2ui-overlay .w2ui-calendar-jump >:last-child").prop("scrollTop",2e3)},1))}),b("#w2ui-overlay .w2ui-date").on("mousedown",function(){var e=b(this).attr("date");b(n.el).val(e).trigger("input").change(),b(this).css({"background-color":"#B6D5FB","border-color":"#aaa"})}).on("mouseup",function(){setTimeout(function(){0',{css:{"background-color":"#fff"}});var i="h24"===this.options.format;b("#w2ui-overlay > div").html(n.getHourHTML()),b("#w2ui-overlay .w2ui-time").on("mousedown",function(e){b(this).css({"background-color":"#B6D5FB","border-color":"#aaa"});var t=b(this).attr("hour");b(n.el).val((12',{css:{"background-color":"#fff"}}),b("#w2ui-overlay > div").html(n.getMinHTML(t)),b("#w2ui-overlay .w2ui-time").on("mousedown",function(){b(this).css({"background-color":"#B6D5FB","border-color":"#aaa"});var e=b(this).attr("min");b(n.el).val((12',{css:{"background-color":"#f5f5f5"},onShow:function(e){w2utils.isIE&&b(".w2ui-calendar").on("mousedown",function(e){e=b(e.target);1===e.length&&"w2ui-jump-year"===e[0].id&&b("#w2ui-overlay").data("keepOpen",!0)})}}),(t=w2utils.isDateTime(b(n.el).val(),n.options.format,!0))&&(r=t.getMonth()+1,d=t.getFullYear());var s=null;!function i(e,t){b("#w2ui-overlay > div > div").html(n.getMonthHTML(e,t,b(n.el).val())+(l.btn_now?'
    '+w2utils.lang("Current Date & Time")+"
    ":"")),b("#w2ui-overlay .w2ui-calendar-title").on("mousedown",function(){var e,t;b(this).next().hasClass("w2ui-calendar-jump")?b(this).next().remove():(b(this).after('
    '),b(this).next().hide().html(n.getYearHTML()).fadeIn(200),setTimeout(function(){b("#w2ui-overlay .w2ui-calendar-jump").find(".w2ui-jump-month, .w2ui-jump-year").on("click",function(){b(this).hasClass("w2ui-jump-month")&&(b(this).parent().find(".w2ui-jump-month").removeClass("selected"),b(this).addClass("selected"),t=b(this).attr("name")),b(this).hasClass("w2ui-jump-year")&&(b(this).parent().find(".w2ui-jump-year").removeClass("selected"),b(this).addClass("selected"),e=b(this).attr("name")),null!=e&&null!=t&&(b("#w2ui-overlay .w2ui-calendar-jump").fadeOut(100),setTimeout(function(){i(parseInt(t)+1,e)},100))}),b("#w2ui-overlay .w2ui-calendar-jump >:last-child").prop("scrollTop",2e3)},1))}),b("#w2ui-overlay .w2ui-date").on("mousedown",function(){var e=b(this).attr("date");b(n.el).val(e).trigger("input").change(),b(this).css({"background-color":"#B6D5FB","border-color":"#aaa"}),s=new Date(b(this).attr("data-date"))}).on("mouseup",function(){var i,t;0',{css:{"background-color":"#fff"}});n.options.format;b("#w2ui-overlay > div").html(n.getHourHTML()),b("#w2ui-overlay .w2ui-time").on("mousedown",function(e){b(this).css({"background-color":"#B6D5FB","border-color":"#aaa"}),i=b(this).attr("hour"),s.setHours(i);var t=w2utils.formatDateTime(s,n.options.format);b(n.el).val(t).trigger("input").change()}),null==n.options.noMinutes||!1===n.options.noMinutes?b("#w2ui-overlay .w2ui-time").on("mouseup",function(){var e=b(this).attr("hour");0',{css:{"background-color":"#fff"}}),b("#w2ui-overlay > div").html(n.getMinHTML(e)),b("#w2ui-overlay .w2ui-time").on("mousedown",function(){b(this).css({"background-color":"#B6D5FB","border-color":"#aaa"}),t=b(this).attr("min"),s.setHours(i,t);var e=w2utils.formatDateTime(s,n.options.format);b(n.el).val(e).trigger("input").change()}).on("mouseup",function(){setTimeout(function(){0'+d+"",u=b.extend(!0,{},l,{search:!1,render:l.renderDrop,maxHeight:l.maxDropHeight,maxWidth:l.maxDropWidth,msgNoItems:d,onSelect:function(i){var e,t,s;"enum"===n.type?(e=b(n.el).data("selected"),!i.item||!0!==(t=n.trigger({phase:"before",type:"add",target:n.el,originalEvent:i.originalEvent,item:i.item})).isCancelled&&(e.length>=l.max&&0'+i.options.prefix+""),(e=b(i.el).prev()).css({color:b(i.el).css("color"),"font-family":b(i.el).css("font-family"),"font-size":b(i.el).css("font-size"),"padding-top":b(i.el).css("padding-top"),"padding-bottom":b(i.el).css("padding-bottom"),"padding-left":b(i.el).css("padding-left"),"padding-right":0,"margin-top":parseInt(b(i.el).css("margin-top"),10)+2+"px","margin-bottom":parseInt(b(i.el).css("margin-bottom"),10)+1+"px","margin-left":b(i.el).css("margin-left"),"margin-right":0}).on("click",function(e){var t;i.options.icon&&"function"==typeof i.onIconClick?!0!==(t=i.trigger({phase:"before",type:"iconClick",target:i.el,el:b(this).find("span.w2ui-icon")[0]})).isCancelled&&i.trigger(b.extend(t,{phase:"after"})):("list"===i.type?b(i.helpers.focus).find("input"):b(i.el)).focus()}),b(i.el).css("padding-left",e.width()+parseInt(b(i.el).css("padding-left"),10)+"px"),i.helpers.prefix=e))},1)},addSuffix:function(){var t,i,n=this;setTimeout(function(){var e;"clear"!==n.type&&((e=b(n.el).data("tmp")||{})["old-padding-right"]&&b(n.el).css("padding-right",e["old-padding-right"]),e["old-padding-right"]=b(n.el).css("padding-right"),b(n.el).data("tmp",e),i=parseInt(b(n.el).css("padding-right"),10),n.options.arrows&&(n.helpers.arrows&&b(n.helpers.arrows).remove(),b(n.el).after('
     
    '),(t=b(n.el).next()).css({color:b(n.el).css("color"),"font-family":b(n.el).css("font-family"),"font-size":b(n.el).css("font-size"),height:b(n.el).height()+parseInt(b(n.el).css("padding-top"),10)+parseInt(b(n.el).css("padding-bottom"),10)+"px",padding:0,"margin-top":parseInt(b(n.el).css("margin-top"),10)+1+"px","margin-bottom":0,"border-left":"1px solid silver"}).css("margin-left","-"+(t.width()+parseInt(b(n.el).css("margin-right"),10)+12)+"px").on("mousedown",function(t){var i=b("body");function s(e){b(n.el).focus(),n.keyDown(b.Event("keydown"),{keyCode:"up"===b(t.target).attr("type")?38:40}),!1!==e&&b("body").data("_field_update_timer",setTimeout(s,60))}i.on("mouseup",function e(){clearTimeout(i.data("_field_update_timer"));i.off("mouseup",e)}),i.data("_field_update_timer",setTimeout(s,700)),s(!1)}),i+=t.width()+12,b(n.el).css("padding-right",i+"px"),n.helpers.arrows=t),""!==n.options.suffix&&(n.helpers.suffix&&b(n.helpers.suffix).remove(),b(n.el).after('
    '+n.options.suffix+"
    "),(t=b(n.el).next()).css({color:b(n.el).css("color"),"font-family":b(n.el).css("font-family"),"font-size":b(n.el).css("font-size"),"padding-top":b(n.el).css("padding-top"),"padding-bottom":b(n.el).css("padding-bottom"),"padding-left":"3px","padding-right":b(n.el).css("padding-right"),"margin-top":parseInt(b(n.el).css("margin-top"),10)+2+"px","margin-bottom":parseInt(b(n.el).css("margin-bottom"),10)+1+"px"}).on("click",function(e){("list"===n.type?b(n.helpers.focus).find("input"):b(n.el)).focus()}),t.css("margin-left","-"+(w2utils.getSize(t,"width")+parseInt(b(n.el).css("margin-right"),10)+2)+"px"),i+=t.width()+3,b(n.el).css("padding-right",i+"px"),n.helpers.suffix=t))},1)},addFocus:function(){var i,s=this;this.options;b(s.helpers.focus).remove();var e=parseInt(b(s.el).attr("tabIndex"));isNaN(e)||-1===e||(s.el._tabIndex=e),null==(e=s.el._tabIndex?s.el._tabIndex:e)&&(e=-1),isNaN(e)&&(e=0);var t="",e='
    ';b(s.el).attr("tabindex",-1).before(e);e=b(s.el).prev();(s.helpers.focus=e).css({width:b(s.el).width(),"margin-top":b(s.el).css("margin-top"),"margin-left":parseInt(b(s.el).css("margin-left"))+parseInt(b(s.el).css("padding-left"))+"px","margin-bottom":b(s.el).css("margin-bottom"),"margin-right":b(s.el).css("margin-right")}).find("input").css({cursor:"default",width:"100%",outline:"none",opacity:1,margin:0,border:"1px solid transparent",padding:b(s.el).css("padding-top"),"padding-left":0,"margin-left":0,"background-color":"transparent"}),e.find("input").on("click",function(e){0===b("#w2ui-overlay").length&&s.focus(e),e.stopPropagation()}).on("focus",function(e){i=b(s.el).attr("placeholder"),b(s.el).css({outline:"auto 5px #7DB4F3","outline-offset":"2px"}),b(this).val(""),b(s.el).triggerHandler("focus"),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}).on("blur",function(e){b(s.el).css("outline","none"),b(this).val(""),s.refresh(),b(s.el).triggerHandler("blur"),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,null!=i&&b(s.el).attr("placeholder",i)}).on("keydown",function(e){var t=this;s.keyDown(e),setTimeout(function(){""===t.value?b(s.el).attr("placeholder",i):b(s.el).attr("placeholder","")},10)}).on("keyup",function(e){s.keyUp(e)}).on("keypress",function(e){s.keyPress(e)}),e.on("click",function(e){b(this).find("input").focus()}),s.refresh()},addMulti:function(){var n=this;this.options;b(n.helpers.multi).remove();var e,t="",i="margin-top : 0px; margin-bottom : 0px; margin-left : "+b(n.el).css("margin-left")+"; margin-right : "+b(n.el).css("margin-right")+"; width : "+(w2utils.getSize(n.el,"width")-parseInt(b(n.el).css("margin-left"),10)-parseInt(b(n.el).css("margin-right"),10))+"px;",s="";null!=b(n.el).attr("id")&&(s='id="'+b(n.el).attr("id")+'_search" '),"enum"===n.type&&((e=b(n.el).attr("tabIndex"))&&-1!==e&&(n.el._tabIndex=e),null==(e=n.el._tabIndex?n.el._tabIndex:e)&&(e=0),t='
    '),"file"===n.type&&(t='
    ');s=b(n.el).data("tmp")||{};s["old-background-color"]=b(n.el).css("background-color"),s["old-border-color"]=b(n.el).css("border-color"),b(n.el).data("tmp",s),b(n.el).before(t).css({"background-color":"transparent","border-color":"transparent"});var l=b(n.el).prev();n.helpers.multi=l,"enum"===n.type&&(b(n.el).attr("tabindex",-1),l.find("input").on("click",function(e){0===b("#w2ui-overlay").length&&n.focus(e),b(n.el).triggerHandler("click")}).on("focus",function(e){b(l).css({outline:"auto 5px #7DB4F3","outline-offset":"2px"}),b(n.el).triggerHandler("focus"),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}).on("blur",function(e){b(l).css("outline","none"),b(n.el).triggerHandler("blur"),e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}).on("keyup",function(e){n.keyUp(e)}).on("keydown",function(e){n.keyDown(e)}).on("keypress",function(e){n.keyPress(e)}),l.on("click",function(e){b(this).find("input").focus()})),"file"===n.type&&(b(n.el).css("outline","none"),l.find("input").off(".drag").on("click.drag",function(e){e.stopPropagation(),b(n.el).prop("readonly")||b(n.el).prop("disabled")||b(n.el).focus()}).on("dragenter.drag",function(e){b(n.el).prop("readonly")||b(n.el).prop("disabled")||b(l).addClass("w2ui-file-dragover")}).on("dragleave.drag",function(e){b(n.el).prop("readonly")||b(n.el).prop("disabled")||b(l).removeClass("w2ui-file-dragover")}).on("drop.drag",function(e){if(!b(n.el).prop("readonly")&&!b(n.el).prop("disabled")){b(l).removeClass("w2ui-file-dragover");for(var t=e.originalEvent.dataTransfer.files,i=0,s=t.length;is.maxFileSize?(t="Maximum file size is "+w2utils.formatSize(s.maxFileSize),!1===s.silent&&b(i.el).w2tag(t),void console.log("ERROR: "+t)):0!==s.maxSize&&o+l.size>s.maxSize?(t=w2utils.lang("Maximum total size is")+" "+w2utils.formatSize(s.maxSize),void(!1===s.silent?b(i.el).w2tag(t):console.log("ERROR: "+t))):0!==s.max&&a>=s.max?(t=w2utils.lang("Maximum number of files is")+" "+s.max,void(!1===s.silent?b(i.el).w2tag(t):console.log("ERROR: "+t))):(n.push(l),void("undefined"!=typeof FileReader&&!0===s.readContent?((s=new FileReader).onload=function(e){var t=e.target.result,e=t.indexOf(",");l.content=t.substr(e+1),i.refresh(),b(i.el).trigger("input").trigger("change"),i.trigger(b.extend(d,{phase:"after"}))},s.readAsDataURL(e)):(i.refresh(),b(i.el).trigger("input").trigger("change"),i.trigger(b.extend(d,{phase:"after"})))))},normMenu:function(e,t){if(b.isArray(e)){for(var i=0;i'+r[h]+"";var p='
    '+n[e-1]+", "+t+'
    '+c+"",f=1;"M"!==w2utils.settings.weekStarts&&u++,"datetime"===this.type&&(n=w2utils.isDateTime(i,d.format,!0),i=w2utils.formatDate(n,w2utils.settings.dateFormat));for(var g=1;g<43;g++){if(0===u&&1==g){for(var m=0;m<6;m++)p+='';g+=6}else if(gl[e-1]){p+='',g%7==0&&(p+="");continue}var w=t+"/"+e+"/"+f,v=new Date(w),y="";6===v.getDay()&&(y=" w2ui-saturday"),0===v.getDay()&&(y=" w2ui-sunday"),w==o&&(y+=" w2ui-today");var b,x=f,_="",k="",C="datetime"===this.type?(b=w2utils.formatDateTime(w,d.format),w2utils.formatDate(w,w2utils.settings.dateFormat)):b=w2utils.formatDate(w,d.format);d.colored&&void 0!==d.colored[C]&&(k="background-color: "+(w=d.colored[C].split(":"))[0]+";",_="color: "+w[1]+";"),p+='",(g%7==0||0===u&&1==g)&&(p+=""),f++}return p+="
      
    '+x+"
    "},getYearHTML:function(){for(var e=w2utils.settings.shortmonths,t=w2utils.settings.dateStartYear,i=w2utils.settings.dateEndYear,s="",n="",l=0;l'+e[l]+"";for(var o=t;o<=i;o++)n+='
    '+o+"
    ";return'
    '+s+'
    '+n+"
    "},getHourHTML:function(){for(var e=[],t=this.options,i=-1<(t=null==t?{format:w2utils.settings.timeFormat}:t).format.indexOf("h24"),s=0;s<24;s++){var n=12!=s||i?(12<=s&&!i?s-12:s)+":00"+(i?"":s<12?" am":" pm"):"12:00 pm";e[Math.floor(s/8)]||(e[Math.floor(s/8)]="");var l,o,a=this.fromMin(this.toMin(n)),r=this.fromMin(this.toMin(n)+59);"datetime"===this.type&&(l=w2utils.isDateTime(this.el.value,t.format,!0),o=t.format.split("|")[0].trim(),a=w2utils.formatDate(l,o)+" "+a,r=w2utils.formatDate(l,o)+" "+r),e[Math.floor(s/8)]+='
    '+n+"
    "}return'
    '+w2utils.lang("Select Hour")+'
    '+e[0]+" "+e[1]+" "+e[2]+"
    "},getMinHTML:function(e){null==e&&(e=0);for(var t=this.options,i=-1<(t=null==t?{format:w2utils.settings.timeFormat}:t).format.indexOf("h24"),s=[],n=0;n<60;n+=5){var l,o,a=(12'+a+""}return'
    '+w2utils.lang("Select Minute")+'
    '+s[0]+" "+s[1]+" "+s[2]+"
    "},toMin:function(e){if("string"!=typeof e)return null;var t=e.split(":");return 2!==t.length?null:(t[0]=parseInt(t[0]),t[1]=parseInt(t[1]),-1!==e.indexOf("pm")&&12!==t[0]&&(t[0]+=12),60*t[0]+t[1])},fromMin:function(e){1440<=e&&(e%=1440),e<0&&(e=1440+e);var t=Math.floor(e/60),i=(e%60<10?"0":"")+e%60,e=this.options;return-1!==(e=null==e?{format:w2utils.settings.timeFormat}:e).format.indexOf("h24")?t+":"+i:(t<=12?t:t-12)+":"+i+" "+(12<=t?"pm":"am")}},b.extend(n.prototype,w2utils.event),w2obj.field=n}(jQuery),function(y){function h(e){this.name=null,this.header="",this.box=null,this.url="",this.routeData={},this.formURL="",this.formHTML="",this.page=0,this.recid=0,this.fields=[],this.actions={},this.record={},this.original=null,this.postData={},this.httpHeaders={},this.method=null,this.toolbar={},this.tabs={},this.style="",this.focus=0,this.autosize=!0,this.nestedFields=!0,this.multipart=!1,this.tabindexBase=0,this.isGenerated=!1,this.last={xhr:null,errors:[]},y.extend(!0,this,w2obj.form,e)}y.fn.w2form=function(e){if(!y.isPlainObject(e))return(t=w2ui[y(this).attr("name")])?0",c),c.field=c.name),a.fields[u]=c}for(u in i)y.isPlainObject(i[u])?a.record[u]=y.extend(!0,{},i[u]):a.record[u]=i[u];for(u in s)y.isPlainObject(s[u])?a.original[u]=y.extend(!0,{},s[u]):a.original[u]=s[u];return 0'+a.formHTML+""),y(a.box).html(a.formHTML),a.isGenerated=!0,a.render(a.box)),a}},h.prototype={onRequest:null,onLoad:null,onValidate:null,onSubmit:null,onProgress:null,onSave:null,onChange:null,onInput:null,onRender:null,onRefresh:null,onResize:null,onDestroy:null,onAction:null,onToolbar:null,onError:null,msgNotJSON:"Returned data is not in valid JSON format.",msgAJAXerror:"AJAX error. See console for more details.",msgRefresh:"Loading...",msgSaving:"Saving...",get:function(e,t){if(0===arguments.length){for(var i=[],s=0;s'+e+"",buttons:'",onOpen:function(e){setTimeout(function(){y(e.box).find(".w2ui-btn").focus()},25)}}),w2utils.message.call(this,{box:this.box,path:"w2ui."+this.name,title:".w2ui-form-header:visible",body:".w2ui-form-box"},e)},validate:function(e){null==e&&(e=!0),y().w2tag();for(var t=[],i=0;i'),setTimeout(function(){var e={cmd:"save"};e.recid=u.recid,e.name=u.name,y.extend(e,u.postData),y.extend(e,r),u.multipart||u.fields.forEach(function(e){"file"===e.type&&Array.isArray(u.getValue(e.field))&&u.getValue(e.field).forEach(function(e){delete e.file})}),e.record=y.extend(!0,{},u.record);var t=u.trigger({phase:"before",type:"submit",target:u.name,url:u.url,postData:e,httpHeaders:u.httpHeaders});if(!0!==t.isCancelled){var i=t.url;if("object"==typeof t.url&&t.url.save&&(i=t.url.save),u.last.xhr)try{u.last.xhr.abort()}catch(e){}if(!y.isEmptyObject(u.routeData)){var s=w2utils.parseRoute(i);if(0",r),r.html.label=r.html.caption),null==r.html.label&&(r.html.label=r.field),r.html=y.extend(!0,{label:"",span:6,attr:"",text:"",style:"",page:0,column:0},r.html),null==e&&(e=r.html.page),null==t&&(t=r.html.column);var d,u,c='";switch(r.type){case"pass":case"password":c='";break;case"check":case"checks":null==r.options.items&&null!=r.html.items&&(r.options.items=r.html.items);var h=r.options.items,c="";0<(h=!y.isArray(h)?[]:h).length&&(h=w2obj.field.prototype.normMenu.call(this,h,r));for(var p=0;p  '+h[p].text+"
    ";break;case"checkbox":c='";break;case"radio":c="",null==r.options.items&&null!=r.html.items&&(r.options.items=r.html.items);h=r.options.items;0<(h=!y.isArray(h)?[]:h).length&&(h=w2obj.field.prototype.normMenu.call(this,h,r));for(p=0;p  '+h[p].text+"
    ";break;case"select":c='";break;case"textarea":c='";break;case"toggle":c='
    ';break;case"map":case"array":r.html.key=r.html.key||{},r.html.value=r.html.value||{},r.html.tabindex_str=a,c=''+(r.html.text||"")+'
    ';break;case"html":case"div":case"custom":c='
    "+(r&&r.html&&r.html.html?r.html.html:"")+"
    ";break;case"empty":c=r&&r.html?(r.html.html||"")+(r.html.text||""):""}""!==s&&(e!=r.html.page||t!=r.html.column||r.html.group&&s!=r.html.group)&&(i[e][t]+="\n \n ",s=""),r.html.group&&s!=r.html.group&&(u="",r.html.groupCollapsable&&(u=''),o+='\n
    \n
    "+u+r.html.group+'
    \n
    ',s=r.html.group),null==r.html.anchor?(d=null!=r.html.span?"w2ui-span"+r.html.span:"",u=""+w2utils.lang("checkbox"!=r.type?r.html.label:r.html.text)+"",r.html.label||(u=""),o+='\n
    \n '+u+("empty"===r.type?c:"\n
    "+c+("array"!=r.type&&"map"!=r.type?w2utils.lang("checkbox"!=r.type?r.html.text:""):"")+"
    ")+"\n
    "):(i[r.html.page].anchors=i[r.html.page].anchors||{},i[r.html.page].anchors[r.html.anchor]='
    '+("empty"===r.type?c:"
    "+w2utils.lang("checkbox"!=r.type?r.html.label:r.html.text)+c+w2utils.lang("checkbox"!=r.type?r.html.text:"")+"
    ")+"
    "),null==i[r.html.page]&&(i[r.html.page]={}),null==i[r.html.page][r.html.column]&&(i[r.html.page][r.html.column]=""),i[r.html.page][r.html.column]+=o,e=r.html.page,t=r.html.column}if(""!==s&&(i[e][t]+="\n
    \n
    "),this.tabs.tabs)for(p=0;p",m),m.text=m.caption),m.text&&(w.text=m.text),m.style&&(w.style=m.style),m.class&&(w.class=m.class)):(w.text=g,-1!==["save","update","create"].indexOf(g.toLowerCase())?w.class="w2ui-btn-blue":w.class=""),f+='\n ",l++}f+="\n"}o="";for(var v=0;v',i[v].before&&(o+=i[v].before),o+='
    ',Object.keys(i[v]).sort().forEach(function(e,t){e==parseInt(e)&&(o+='
    '+(i[v][e]||"")+"\n
    ")}),o+="\n
    ",i[v].after&&(o+=i[v].after),o+="\n",i[v].anchors&&Object.keys(i[v].anchors).forEach(function(e,t){o=o.replace(e,i[v].anchors[e])});return o+=f},toggleGroup:function(e,t){var i,s=y(this.box).find('.w2ui-group-title[data-group="'+w2utils.base64encode(e)+'"]');"none"==s.next().css("display")&&!0!==t?(s.next().slideDown(300),s.next().next().remove(),s.find("span").addClass("w2ui-icon-collapse").removeClass("w2ui-icon-expand")):(s.next().slideUp(300),i="width: "+s.next().css("width")+";padding-left: "+s.next().css("padding-left")+";padding-right: "+s.next().css("padding-right")+";margin-left: "+s.next().css("margin-left")+";margin-right: "+s.next().css("margin-right")+";",setTimeout(function(){s.next().after('
    ')},100),s.find("span").addClass("w2ui-icon-expand").removeClass("w2ui-icon-collapse"))},action:function(e,t){var i=this.actions[e],s=i;y.isPlainObject(i)&&i.onClick&&(s=i.onClick);i=this.trigger({phase:"before",target:e,type:"action",action:i,originalEvent:t});!0!==i.isCancelled&&("function"==typeof s&&s.call(this,t),this.trigger(y.extend(i,{phase:"after"})))},resize:function(){var e,t,i,s,n,l,o,a,r=this,d=this.trigger({phase:"before",target:this.name,type:"resize"});function u(){e.width(y(r.box).width()).height(y(r.box).height()),i.css("top",""!==r.header?w2utils.getSize(t,"height"):0),s.css("top",(""!==r.header?w2utils.getSize(t,"height"):0)+("object"==typeof r.toolbar&&y.isArray(r.toolbar.items)&&0 div.w2ui-form-box"),t=y(this.box).find("> div .w2ui-form-header"),i=y(this.box).find("> div .w2ui-form-toolbar"),s=y(this.box).find("> div .w2ui-form-tabs"),n=y(this.box).find("> div .w2ui-page"),l=y(this.box).find("> div .w2ui-page.page-"+this.page),o=y(this.box).find("> div .w2ui-page.page-"+this.page+" > div"),a=y(this.box).find("> div .w2ui-buttons"),u(),this.autosize&&(0!==parseInt(y(this.box).height())&&!0!==y(this.box).data("auto-size")||(y(this.box).height((0'+a[g].text+"'+(e.html.key.text||"")+''+(e.html.value.text||"")+"";t.append(e)},p.el.mapRefresh=function(u,c){var s,n,l=1;"map"==p.type&&(null==(u=!y.isPlainObject(u)?{}:u)._order&&(u._order=Object.keys(u)),t=u._order),(t="array"==p.type?(u=!Array.isArray(u)?[]:u).map(function(e){return e.key}):t).forEach(function(t){s=c.find("#"+w2utils.escapeId(p.name)+"_key_"+l),n=c.find("#"+w2utils.escapeId(p.name)+"_value_"+l),0!=s.length&&0!=n.length||(p.el.mapAdd(p,c,l),s=c.find("#"+w2utils.escapeId(p.name)+"_key_"+l),n=c.find("#"+w2utils.escapeId(p.name)+"_value_"+l));var e,i=u[t];"array"!=p.type||0<(e=u.filter(function(e){return e.key==t})).length&&(i=e[0].value),s.val(t),n.val(i),!0!==p.disabled&&!1!==p.disabled||(s.prop("readOnly",!!p.disabled),n.prop("readOnly",!!p.disabled)),s.parents(".w2ui-map-field").attr("data-key",t),l++});var e=c.find("#"+w2utils.escapeId(p.name)+"_key_"+l).parent(),t=c.find("#"+w2utils.escapeId(p.name)+"_key_"+(l+1)).parent();0!==e.length||s&&(!0===s.prop("readOnly")||!0===s.prop("disabled"))||p.el.mapAdd(p,c,l),1==e.length&&1==t.length&&(e.removeAttr("data-key"),e.find(".key").val(t.find(".key").val()),e.find(".value").val(t.find(".value").val()),t.remove()),!0!==p.disabled&&!1!==p.disabled||(e.find(".key").prop("readOnly",!!p.disabled),e.find(".value").prop("readOnly",!!p.disabled)),y(p.el).next().find("input.w2ui-map").off(".mapChange").on("keyup.mapChange",function(e){var t=y(e.target).parents(".w2ui-map-field");13==e.keyCode&&t.next().find("input.key").focus()}).on("change.mapChange",function(){var e=y(event.target).parents(".w2ui-map-field"),i=e.attr("data-key"),t=e.find(".key").val(),s=e.find(".value").val(),n={},l={},o=null,a=null;n[t]=s,"array"==p.type&&(u.forEach(function(e,t){e.key==i&&(a=t)}),o=u[a]),null!=i&&"map"==p.type&&(l[i]=u[i]),null!=i&&"array"==p.type&&(l[i]=o.value);n=h.trigger({phase:"before",target:p.field,type:"change",originalEvent:event,value_new:n,value_previous:l});if(!0!==n.isCancelled){if("map"==p.type){delete u[i];l=u._order.indexOf(i);if(""!=t){if(null!=u[t]){for(var r,d=0;r=t+ ++d,null!=u[r];);t=r,e.find(".key").val(r)}u[t]=s,e.attr("data-key",t),-1!=l?u._order[l]=t:u._order.push(t)}else u._order.splice(l,1),e.find(".value").val("")}else"array"==p.type&&(""!=t?null==o?u.push({key:t,value:s}):(o.key=t,o.value=s):u.splice(a,1));h.setValue(p.field,u),p.el.mapRefresh(u,c),h.trigger(y.extend(n,{phase:"after"}))}})},p.el.mapRefresh(o,y(p.el).parent().find(".w2ui-map-container"))}(this,l);break;case"div":case"custom":y(l.el).html(o);break;case"html":case"empty":break;default:y(l.el).val(o),y(l.el).w2field(y.extend({},l.options,{type:l.type}))}}for(var m=y(this.box).find(".w2ui-page"),c=0;c *").length&&y(m[c]).wrapInner("
    ");return this.trigger(y.extend(t,{phase:"after"})),this.resize(),(new Date).getTime()-e}}},render:function(e){var t=(new Date).getTime(),i=this;if("object"==typeof e&&(0'+(""!==this.header?'
    '+this.header+"
    ":"")+' '+this.formHTML+"";return y(this.box).attr("name",this.name).addClass("w2ui-reset w2ui-form").html(e),0 input, select, textarea, div > label:nth-child(1) > :radio").not(".file-input");y(t[e]).is(":hidden")&&t.length>=e;)e++;t[e]&&t[e].focus()},destroy:function(){var e=this.trigger({phase:"before",target:this.name,type:"destroy"});!0!==e.isCancelled&&("object"==typeof this.toolbar&&this.toolbar.destroy&&this.toolbar.destroy(),"object"==typeof this.tabs&&this.tabs.destroy&&this.tabs.destroy(),0