var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(b,l,k){b!=Array.prototype&&b!=Object.prototype&&(b[l]=k.value)};$jscomp.getGlobal=function(b){return"undefined"!=typeof window&&window===b?b:"undefined"!=typeof global&&null!=global?global:b};$jscomp.global=$jscomp.getGlobal(this);$jscomp.SYMBOL_PREFIX="jscomp_symbol_";
$jscomp.initSymbol=function(){$jscomp.initSymbol=function(){};$jscomp.global.Symbol||($jscomp.global.Symbol=$jscomp.Symbol)};$jscomp.symbolCounter_=0;$jscomp.Symbol=function(b){return $jscomp.SYMBOL_PREFIX+(b||"")+$jscomp.symbolCounter_++};
$jscomp.initSymbolIterator=function(){$jscomp.initSymbol();var b=$jscomp.global.Symbol.iterator;b||(b=$jscomp.global.Symbol.iterator=$jscomp.global.Symbol("iterator"));"function"!=typeof Array.prototype[b]&&$jscomp.defineProperty(Array.prototype,b,{configurable:!0,writable:!0,value:function(){return $jscomp.arrayIterator(this)}});$jscomp.initSymbolIterator=function(){}};$jscomp.arrayIterator=function(b){var l=0;return $jscomp.iteratorPrototype(function(){return l<b.length?{done:!1,value:b[l++]}:{done:!0}})};
$jscomp.iteratorPrototype=function(b){$jscomp.initSymbolIterator();b={next:b};b[$jscomp.global.Symbol.iterator]=function(){return this};return b};$jscomp.iteratorFromArray=function(b,l){$jscomp.initSymbolIterator();b instanceof String&&(b+="");var k=0,e={next:function(){if(k<b.length){var A=k++;return{value:l(A,b[A]),done:!1}}e.next=function(){return{done:!0,value:void 0}};return e.next()}};e[Symbol.iterator]=function(){return e};return e};
$jscomp.polyfill=function(b,l,k,e){if(l){k=$jscomp.global;b=b.split(".");for(e=0;e<b.length-1;e++){var A=b[e];A in k||(k[A]={});k=k[A]}b=b[b.length-1];e=k[b];l=l(e);l!=e&&null!=l&&$jscomp.defineProperty(k,b,{configurable:!0,writable:!0,value:l})}};$jscomp.polyfill("Array.prototype.keys",function(b){return b?b:function(){return $jscomp.iteratorFromArray(this,function(b){return b})}},"es6","es3");
(function(){function b(a,g,d){var b=a.jq,w=b.prev(),m=[0,0];if(w.length){var C=w[0].style;if(zk(w[0]).isRealVisible()){var x=b[0].style;var p={};var r={};g=["marginTop","marginBottom","marginLeft","marginRight"];for(d=g.length;0<d--;)p[g[d]]=x[g[d]],r[g[d]]=C[g[d]],x[g[d]]=C[g[d]]="0px";g=w.zk.revisedOffset();m[0]=g[0]+w.zk.offsetWidth();m[1]=g[1]+w.zk.offsetHeight()}else return m}else m[0]=d[0]+g.sumStyles("l",jq.paddings)+g.sumStyles("l",jq.borders),m[1]=d[1]+g.sumStyles("t",jq.paddings)+g.sumStyles("t",
jq.borders);g=a.revisedOffset();m[0]=g[0]-m[0];m[1]=g[1]-m[1];zk.copy(x,p);zk.copy(C,r);return[Math.max(0,m[0]),Math.max(0,m[1])]}function l(a,g,d){if(d)return d=a._hgh||(a._hgh=a.top+a.height),a=a._wdh||(a._wdh=a.left+a.width),10!=zk.ie?g.top>=d||g.left<a:Math.round(g.top)>=d||Math.round(g.left)<a;d=a._hgh||(a._hgh=a.top+a.height);a=a._wdh||(a._wdh=a.left+a.width);return 10!=zk.ie?g.left>=a||g.top<d:Math.round(g.left)>=a||Math.round(g.top)<d}function k(a){if(a){var g="_vflexsz";var d="height";var b=
"_vflex";var w="offsetHeight";var m="marginHeight";var C="_maxFlexHeight";var x="_sumFlexHeight";var p=1;var r="getContentEdgeHeight_"}else g="_hflexsz",d="width",b="_hflex",w="offsetWidth",m="marginWidth",C="_maxFlexWidth",x="_sumFlexWidth",p=0,r="getContentEdgeWidth_";return function(h,c,B,q){var v,t,u,z;if(void 0===h[g]){var n=h.firstChild;var f=zk(c);var y=0;if(null!=q)y=q;else{q={};q[d]="auto";h.setFlexSize_(q,!0);var k=q=0;if(n&&n.desktop){for(u=n;u&&u.ignoreFlexSize_(B);)u=u.nextSibling;for(;n;n=
n.nextSibling)if(!n.ignoreFlexSize_(B)&&(z=n.$n())&&(c=z.style.position,"absolute"!=c&&"fixed"!=c)){var e=zk(z);c=0;"min"==n[b]?e.isVisible()&&(c+=void 0===n[g]?zFlex.fixMinFlex(n,z,B):n[g]):(n.beforeParentMinFlex_(B),c+=h.getChildMinSize_(B,n)+e[m]());n[C]&&c>k?k=c:n[x]?q+=c:!n[C]&&u!=n&&l(t||(t=zk(u).dimension(!0)),e.dimension(!0),a)?y+=c:c>y&&(y=c)}}else if(z=c.firstChild)for(n=h.ignoreChildNodeOffset_(B),u=z;z;z=z.nextSibling){var E=3==z.nodeType;if(!E&&(c=z.style.position,"absolute"==c||"fixed"==
c))continue;e=zk(z);c=0;if(n)for(var D=z.firstChild;D;D=D.nextSibling)(v=D&&3==D.nodeType?D.nodeValue:null)?(v=e.textSize(v),v[1]>c&&(c=v[1])):(v=zk(D)).isVisible()&&(v=v[w]()+v[m](),v>c&&(c=v));else c=E?z.nodeValue?f.textSize(z.nodeValue)[p]:0:e[w]()+e[m]();E?c>y&&(y=c):(e=e.dimension(!0),l(t||(t=zk(u).dimension(!0)),e,a)?y+=c:c>y&&(y=c))}else y=f[w]();k&&(q+=k);q>y&&(y=q)}t=h.getMarginSize_(B);zk.webkit&&0>t&&(t=0);q={};f=h.$n();y=zk.isLoaded("zul.wgt")&&h.$instanceof(zul.wgt.Caption)&&0<h.nChildren?
zk(h.$n("cave"))[w]():y;q[d]=y+h[r](y);v=h.setFlexSize_(q,!0);(c={height:f.offsetHeight,width:v&&v.width||f.offsetWidth},0<=c[d])&&(h[g]=c[d]+t);(y=h.ebody)&&"min"==h[b]&&(h[g]+=zk(y)[a?"hasHScroll":"hasVScroll"]()?jq.scrollbarWidth():0);h.afterChildrenMinFlex_(B);h.parent&&"min"!=h.parent[b]&&h.parent.afterChildMinFlexChanged_(h,B)}return h[g]}}function e(){return 0}var A=k(!0),F=k();zFlex={beforeSize:function(a,g,d){var b;d&&this.clearCachedSize_();!zk.mounting&&this.isRealVisible()&&(this._hflex&&
"min"!=this._hflex&&(this.resetSize_("w"),delete this._flexFixed,delete this._cssFlexFixed,(b=this.parent)&&b.afterResetChildSize_("w")),this._vflex&&"min"!=this._vflex&&(this.resetSize_("h"),delete this._flexFixed,delete this._cssFlexFixed,(b=this.parent)&&b.afterResetChildSize_("h")))},onSize:function(){zFlex.fixFlex(this)},fixFlex:function(a){if(a._flexFixed||!a._nvflex&&!a._nhflex)delete a._flexFixed;else if(!((void 0===a._vflex||a._vflexsz&&"min"==a._vflex)&&(void 0===a._hflex||a._hflexsz&&"min"==
a._hflex)||a.ignoreFlexSize_("w")&&a.ignoreFlexSize_("h"))&&a.parent.beforeChildrenFlex_(a)){a._flexFixed=!0;var g=!1,d=[],B=0,w=[],m=0,e=a.$n().parentNode,x=zk(e),p=a.getParentSize_(e),r=p.height,h=p.width,c=e.firstChild,k=[],q=x.hasVScroll(),v=x.hasHScroll(),t=jq.scrollbarWidth(),u=zk.isLoaded("zul.mesh");if(u&&a.$instanceof(zul.mesh.HeaderWidget)){var z=a.parent.parent;if(z._nativebar){var n=z.ebody;var f=zk(n).hasVScroll();n=zk(n).hasHScroll()}}if(q||f)h-=t;if(v||n)r-=t;for(;c&&3==c.nodeType;c=
c.nextSibling);for(var y;c;c=c.nextSibling)if(3===c.nodeType)g=!0;else if(f=c.style.position,"absolute"!=f&&"fixed"!=f&&(n=zk(c),n.isVisible(!0))){z=n.offsetHeight();var l=0<z?n.offsetWidth():0;f=zk.Widget.$(c,{exact:1});if(!(f&&u&&f.$instanceof(zul.mesh.Auxheader))){0==l&&f&&u&&f.$instanceof(zul.mesh.HeaderWidget)&&(l=(l=f.$n("hdfaker"))?zk.parseInt(l.style.width)||l.offsetWidth:0);g&&(y||(y=x.revisedOffset()),g=b(n,x,y),f&&f.isExcludedHflex_()||(h-=g[0]),f&&f.isExcludedVflex_()||(r-=g[1]));if(f&&
f._nhflex&&f.isVisible())f!==a&&(f._flexFixed=!0),"min"==f._hflex?h-=zFlex.fixMinFlex(f,c,"w"):(w.push(f),m+=f._nhflex);else if(!(f||zk.isLoaded("zul.wnd")&&a.$instanceof(zul.wnd.Panelchildren))||f&&!f.isExcludedHflex_())h-=l,h-=n.marginWidth();f&&f._nvflex&&f.isVisible()?(f!==a&&(f._flexFixed=!0),"min"==f._vflex?r-=zFlex.fixMinFlex(f,c,"h"):(d.push(f),k.push(f),B+=f._nvflex)):f&&f.isExcludedVflex_()||(r-=z,r-=n.marginHeight());g=!1}}c=function(a,g,c){for(var b,d=a.length-1;0<d;--d){b=a.shift();var f=
b.isExcludedVflex_()?g:b._nvflex*g/B|0;b.setFlexSize_({height:f});b._vflexsz=f;b.isExcludedVflex_()||(c-=f)}a.length&&(b=a.shift(),b.setFlexSize_({height:c}),b._vflexsz=c)};u=r=Math.max(r,0);c(d,r,u);d=a.getParentSize_(e);d.width>p.width?h+=d.width-p.width:!x.hasVScroll()&&q&&(h+=t);u=h=Math.max(h,0);for(q=w.length-1;0<q;--q)f=w.shift(),e=f.isExcludedHflex_()?h:f._nhflex*h/m|0,f.setFlexSize_({width:e}),f._hflexsz=e,f.isExcludedHflex_()||(u-=e);w.length&&(f=w.shift(),f.setFlexSize_({width:u}),f._hflexsz=
u);w=d.height>p.height;x=!x.hasHScroll()&&v;if(w||x)w?r+=d.height-p.height:x&&(r+=t),u=r=Math.max(r,0),c(k,r,u);a.parent.afterChildrenFlex_(a);a._flexFixed=!1}},onFitSize:function(){var a=this.$n();a&&zk(a).isVisible()&&("min"==this._hflex&&void 0===this._hflexsz&&this.isRealVisible()&&!this.ignoreFlexSize_("w")&&zFlex.fixMinFlex(this,a,"w"),"min"==this._vflex&&void 0===this._vflexsz&&this.isRealVisible()&&!this.ignoreFlexSize_("h")&&zFlex.fixMinFlex(this,a,"h"))},fixMinFlex:function(a,b,d){return("h"==
d?A:"w"==d?F:e)(a,b,d,a.beforeMinFlex_(d))},fixCSSFlex:function(){if(!this._cssFlexFixed&&(this._nvflex||this._nhflex)){var a=this.parent,b=a.$instanceof(zk.Page)?a.$n():a.getFlexContainer_();if(null==b)this._cssflex=!1;else{var d=zFlex.getFlexInfo(this);for(var e=d.isFlexRow,w=d.flexContainerChildren,m=d.childrenWidgets,l=!0,x=[],p=0,r=w.length;p<r;p++){var h=w[p],c=jq(h),k=m[p],q=k.$n(),v=[k._nvflex,k._nhflex];d={};var t=e?"width":"height",u=v[e|0];0<u?(l=!1,c.addClass("z-flex-item"),1!=u&&(h.style["flex-grow"]=
u),h==q||q.style[t]?d[t]="auto":q.style[t]="100%"):0>u&&zFlex.fixMinFlex(k,q,t.substring(0,1));u=v[!e|0];t=e?"height":"width";0<u?(c=e?c.outerHeight(!0)-c.outerHeight():c.outerWidth(!0)-c.outerWidth(),c=0<c?"calc(100% - "+jq.px0(c)+")":"100%",h.style[t]=c,h!=q?q.style[t]="100%":d[t]="auto"):0>u&&zFlex.fixMinFlex(k,q,t.substring(0,1));x.push(d)}l||jq(b).addClass("z-flex").addClass(e?"z-flex-row":"z-flex-column");p=0;for(r=x.length;p<r;p++)d=x[p],0<Object.keys(d).length&&m[p].setFlexSize_(d);a.afterChildrenFlex_(this)}}},
clearCSSFlex:function(a,b,d){if(a._cssFlexFixed){var g=a.parent;g=g.$instanceof(zk.Page)?g.$n():g.getFlexContainer_();b="h"==b;var e=zFlex.getFlexInfo(a),m=e.isFlexRow,k=e.flexContainerChildren;e=e.childrenWidgets;for(var l=!0,p=0,r=k.length;p<r;p++){var h=k[p],c=jq(h),A=e[p],q=A==a,v=A.$n(),t=m?"width":"height";if((d||q)&&b&&m||!b&&!m)h.style["flex-grow"]="",c.removeClass("z-flex-item"),h==v||v.style[t]||(v.style[t]=""),A._cssFlexFixed=!1;t=m?"height":"width";if(d||q){if(b&&!m||!b&&m)h.style[t]=
"",h!=v&&(v.style[t]=""),A._cssFlexFixed=!1}else l=l?!c.hasClass("z-flex-item"):!1}(d||l)&&jq(g).removeClass("z-flex").removeClass(m?"z-flex-row":"z-flex-column");a.afterClearFlex_()}},getFlexInfo:function(a){var b=a.parent;a=b.firstChild;var d=b.getFlexContainer_(),e=d.firstElementChild;b=b.getFlexDirection_();for(var k="row"==b,m=[],l=[],x=null==b,p=!k,r;e&&a;){if(r=a.$n())if(d.contains(r))if(e.contains(r))a._cssFlexFixed=!0,m.push(e),l.push(a),x&&!p&&k&&"block"===jq(e).css("display")&&(p=!0);else{e=
e.nextElementSibling;continue}else{a=a.nextSibling;continue}e=e.nextElementSibling;a=a.nextSibling}p?k=!1:null==b&&(k=!0);return{isFlexRow:k,flexContainerChildren:m,childrenWidgets:l}}}})();
