function _gaj(a,b){return _gab(a- -0x16d,b);}(function(a,b){function i(a,b){return _gab(a- -0xf3,b);}const c=a();while(!![]){try{const d=-parseInt(i(0xc3,0xd3))/0x1+-parseInt(i(0xbb,0xc5))/0x2*(-parseInt(i(0xb0,0xaa))/0x3)+parseInt(i(0xcb,0xc3))/0x4*(-parseInt(i(0xb4,0xb9))/0x5)+-parseInt(i(0xc8,0xc1))/0x6*(parseInt(i(0xac,0xa9))/0x7)+-parseInt(i(0xc7,0xd6))/0x8+-parseInt(i(0xb5,0xac))/0x9*(-parseInt(i(0xbc,0xc8))/0xa)+-parseInt(i(0xc2,0xb5))/0xb*(-parseInt(i(0xb2,0xa7))/0xc);if(d===b){break;}else{c['push'](c['shift']());}}catch(e){c['push'](c['shift']());}}}(_gaa,0x4401c));import _gac from'@bryntum/core-thin/lib/util/Parser.js';const {defineParser,alt,seq,string,regexp,succeed,red,isSuccess}=_gac;const resourceNamePEG=defineParser(red(regexp(_gaj(0x31,0x2c)),a=>({'resourceName':a[_gaj(0x3c,0x49)](),'units':0x64,'match':a})));function _gaa(){const o=['\x5cs*,\x5cs*','match','assign','2026336IeZAFh','53682gkkiaG','rest','call','4alfNKA','\x5cs*\x5c]','push','[^\x5c[\x5c,]+','84WqNxTe','\x5cs*\x5c%','reduce','prototype','386139AIOIEi','length','3936RZfqbF','split','948215UHXDwL','3521547fvWVRZ','trim','\x5cs*\x5c[\x5cs*','join','value','assignments','2CRlkgb','10UbfVZg','[0-9\x5cs]+','resourceName','object','hasOwnProperty','units','11099jcCYQE','22093AEkWed'];_gaa=function(){return o;};return _gaa();}const integerPEG=defineParser(red(regexp(_gaj(0x43,0x39)),a=>({'value':a[_gaj(0x39,0x4b)](/\s*/)[_gaj(0x3e,0x2e)](''),'match':a})));const decimalSeparatorPEG=defineParser(red(alt(string('.'),string(',')),a=>({'value':a,'match':a})));const unitsNumberPEG=defineParser(alt(red(seq(()=>integerPEG,()=>decimalSeparatorPEG,()=>integerPEG),(a,b,c)=>({'value':Number(a[_gaj(0x3f,0x3d)]+'.'+c[_gaj(0x3f,0x42)]),'match':[a[_gaj(0x4b,0x5a)],b[_gaj(0x4b,0x50)],c[_gaj(0x4b,0x3a)]][_gaj(0x3e,0x3d)]('')})),red(seq(()=>decimalSeparatorPEG,()=>integerPEG),(a,b)=>({'value':Number('0.'+b[_gaj(0x3f,0x30)]),'match':[a[_gaj(0x4b,0x48)],b['match']]['join']('')})),red(()=>integerPEG,a=>({'value':Number(''+a[_gaj(0x3f,0x38)]),'match':a['match']}))));const unitsPersentagePEG=defineParser(alt(red(seq(()=>unitsNumberPEG,regexp(_gaj(0x33,0x3c))),(a,b)=>({'value':a['value'],'match':[a[_gaj(0x4b,0x5c)],b][_gaj(0x3e,0x41)]('')})),red(()=>unitsNumberPEG,a=>({'value':a[_gaj(0x3f,0x37)],'match':a[_gaj(0x4b,0x4d)]}))));function _gab(a,b){const c=_gaa();_gab=function(d,e){d=d-0x19c;let f=c[d];return f;};return _gab(a,b);}const unitsDesignationPEG=defineParser(red(seq(regexp(_gaj(0x3d,0x41)),()=>unitsPersentagePEG,regexp(_gaj(0x2f,0x2e))),(a,b,c)=>({'units':b[_gaj(0x3f,0x34)],'match':[a,b[_gaj(0x4b,0x3b)],c][_gaj(0x3e,0x43)]('')})));const commaPEG=defineParser(red(regexp(_gaj(0x4a,0x47)),a=>({'value':a,'match':a})));const raPEG=defineParser(alt(seq(()=>resourceNamePEG,()=>unitsDesignationPEG,alt(seq(()=>commaPEG,()=>raPEG),succeed(''))),seq(()=>resourceNamePEG,alt(seq(()=>commaPEG,()=>raPEG),succeed('')))));export const parse=a=>{let b=![],c=[],d='';raPEG(a,f=>{function k(a,b){return _gab(b- -0x25b,a);}if(isSuccess(f)){const [,g,h]=f;if(g[k(-0xb1,-0xb7)]>c[k(-0xaa,-0xb7)]){c=g;d=h;b=!![];}}});let e=0x0;return b?{'rest':d,'assignments':c['reduce']((f,g)=>{let h;if(typeof g==l(0x463,0x45f)){if(Object[l(0x457,0x44f)][l(0x462,0x460)][l(0x47a,0x46a)](g,l(0x463,0x45e))){h=Object[l(0x459,0x466)]({'position':e},g);f[l(0x43b,0x44a)](h);}else{h=f[f[l(0x44c,0x451)]-0x1];if(Object['prototype'][l(0x469,0x460)]['call'](g,l(0x46f,0x461))){h[l(0x451,0x461)]=g['units'];}h[l(0x456,0x465)]+=g[l(0x45c,0x465)];}e+=g[l(0x469,0x465)]['length'];}function l(a,b){return _gab(b-0x2ad,a);}return f;},[])}:![];};export const compose=(a,b=![])=>{let c='';if(a['assignments']){c+=a[m(0x2b5,0x2bd)][m(0x2a9,0x2a0)]((d,{resourceName:e,units:f,match:g})=>{function n(a,b){return m(b-0x53,a);}if(g&&b){d+=g;}else{d+=(d[n(0x309,0x2ff)]?',\x20':'')+(e+'\x20['+f+'%]');}return d;},c);}if(a[m(0x2c4,0x2b5)]){c+=a['rest'];}if(!b){c=c[m(0x2b1,0x2c1)]();}function m(a,b){return _gaj(a-0x275,b);}return c;};export const normalize=a=>compose(parse(a));export default{'parse':parse,'compose':compose,'normalize':normalize};