!function(a,b){"function"==typeofdefine&&define.amd?define([],b):"object"==typeofexports?module.exports=b():a.computeLayout=b()}(this,function(){vara=function(){functiona(b){if(b.layout&&!b.isDirty||(b.layout={width:void0,height:void0,top:0,left:0,right:0,bottom:0}),b.style||(b.style={}),b.children||(b.children=[]),b.style.measure&&b.children&&b.children.length)thrownewError("Using custom measure function is supported only for leaf nodes.");returnb.children.forEach(a),b}functionb(a){returnvoid0===a||Number.isNaN(a)}functionc(a){returna===ca||a===da}functiond(a){returna===ea||a===fa}functione(a){returnvoid0===a.style.flex?0:a.style.flex}functionf(a){returnV?!0:e(a)<=0}functiong(a){returne(a)>0?e(a):0}functionh(a){if(V){if(0!==e(a))return1}elseif(e(a)<0)return1;return0}functioni(a,b){if(void0!==a.style.marginStart&&c(b))returna.style.marginStart;vard=null;switch(b){case"row":d=a.style.marginLeft;break;case"row-reverse":d=a.style.marginRight;break;case"column":d=a.style.marginTop;break;case"column-reverse":d=a.style.marginBottom}returnvoid0!==d?d:void0!==a.style.margin?a.style.margin:0}functionj(a,b){if(void0!==a.style.marginEnd&&c(b))returna.style.marginEnd;vard=null;switch(b){case"row":d=a.style.marginRight;break;case"row-reverse":d=a.style.marginLeft;break;case"column":d=a.style.marginBottom;break;case"column-reverse":d=a.style.marginTop}returnnull!=d?d:void0!==a.style.margin?a.style.margin:0}functionk(a,b){if(void0!==a.style.paddingStart&&a.style.paddingStart>=0&&c(b))returna.style.paddingStart;vard=null;switch(b){case"row":d=a.style.paddingLeft;break;case"row-reverse":d=a.style.paddingRight;break;case"column":d=a.style.paddingTop;break;case"column-reverse":d=a.style.paddingBottom}returnnull!=d&&d>=0?d:void0!==a.style.padding&&a.style.padding>=0?a.style.padding:0}functionl(a,b){if(void0!==a.style.paddingEnd&&a.style.paddingEnd>=0&&c(b))returna.style.paddingEnd;vard=null;switch(b){case"row":d=a.style.paddingRight;break;case"row-reverse":d=a.style.paddingLeft;break;case"column":d=a.style.paddingBottom;break;case"column-reverse":d=a.style.paddingTop}returnnull!=d&&d>=0?d:void0!==a.style.padding&&a.style.padding>=0?a.style.padding:0}functionm(a,b){if(void0!==a.style.borderStartWidth&&a.style.borderStartWidth>=0&&c(b))returna.style.borderStartWidth;vard=null;switch(b){case"row":d=a.style.borderLeftWidth;break;case"row-reverse":d=a.style.borderRightWidth;break;case"column":d=a.style.borderTopWidth;break;case"column-reverse":d=a.style.borderBottomWidth}returnnull!=d&&d>=0?d:void0!==a.style.borderWidth&&a.style.borderWidth>=0?a.style.borderWidth:0}functionn(a,b){if(void0!==a.style.borderEndWidth&&a.style.borderEndWidth>=0&&c(b))returna.style.borderEndWidth;vard=null;switch(b){case"row":d=a.style.borderRightWidth;break;case"row-reverse":d=a.style.borderLeftWidth;break;case"column":d=a.style.borderBottomWidth;break;case"column-reverse":d=a.style.borderTopWidth}returnnull!=d&&d>=0?d:void0!==a.style.borderWidth&&a.style.borderWidth>=0?a.style.borderWidth:0}functiono(a,b){returnk(a,b)+m(a,b)}functionp(a,b){returnl(a,b)+n(a,b)}functionq(a,b){returni(a,b)+j(a,b)}functionr(a,b){returno(a,b)+p(a,b)}functions(a){returna.style.justifyContent?a.style.justifyContent:"flex-start"}functiont(a){returna.style.alignContent?a.style.alignContent:"flex-start"}functionu(a,b){returnb.style.alignSelf?b.style.alignSelf:a.style.alignItems?a.style.alignItems:"stretch"}functionv(a,b){if(b===ba){if(a===ca)returnda;if(a===da)returnca}returna}functionw(a,b){varc;returnc=a.style.direction?a.style.direction:_,c===_&&(c=void0===b?aa:b),c}functionx(a){returna.style.flexDirection?a.style.flexDirection:ea}functiony(a,b){returnd(a)?v(ca,b):ea}functionz(a){returna.style.position?a.style.position:pa}functionA(a){returna.style.overflow?a.style.overflow:ra}functionB(a){returnz(a)===pa&&void0!==a.style.flex&&0!==a.style.flex}functionC(a){return"wrap"===a.style.flexWrap}functionD(a,b){returna.layout[Aa[b]]+q(a,b)}functionE(a,b){returnvoid0!==a.style[za[b]]&&a.style[za