marketing/autocart.js
2026-08-21 18:17:08 +03:00

1 line
31 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

const _0xa8b336=_0x4e73;function _0x4e73(_0x5336e2,_0x283cd7){_0x5336e2=_0x5336e2-0xfd;const _0x38a10c=_0x38a1();let _0x4e73bf=_0x38a10c[_0x5336e2];return _0x4e73bf;}(function(_0x2cc83f,_0x28457e){const _0x17d808=_0x4e73,_0x2e6b9f=_0x2cc83f();while(!![]){try{const _0x27ca29=parseInt(_0x17d808(0x142))/0x1+parseInt(_0x17d808(0x10c))/0x2+parseInt(_0x17d808(0x143))/0x3+-parseInt(_0x17d808(0x108))/0x4*(parseInt(_0x17d808(0x136))/0x5)+parseInt(_0x17d808(0x10d))/0x6+parseInt(_0x17d808(0x132))/0x7*(parseInt(_0x17d808(0x19b))/0x8)+-parseInt(_0x17d808(0x179))/0x9;if(_0x27ca29===_0x28457e)break;else _0x2e6b9f['push'](_0x2e6b9f['shift']());}catch(_0x451e19){_0x2e6b9f['push'](_0x2e6b9f['shift']());}}}(_0x38a1,0x461ce));const host=_0xa8b336(0x151);function throttle(_0x36e5c6,_0x393a5e,_0xf84024){var _0x42ebfe,_0x31a87a,_0xfb9b0b,_0x5ac855=null,_0x5b5192=0x0;if(!_0xf84024)_0xf84024={};var _0xe65220=function(){const _0x1b38d6=_0x4e73;_0x5b5192=_0xf84024[_0x1b38d6(0x1c7)]===![]?0x0:Date[_0x1b38d6(0x134)](),_0x5ac855=null,_0xfb9b0b=_0x36e5c6[_0x1b38d6(0x1ac)](_0x42ebfe,_0x31a87a);if(!_0x5ac855)_0x42ebfe=_0x31a87a=null;};return function(){const _0x1aaf59=_0x4e73;var _0x321a0f=Date[_0x1aaf59(0x134)]();if(!_0x5b5192&&_0xf84024[_0x1aaf59(0x1c7)]===![])_0x5b5192=_0x321a0f;var _0x15edd2=_0x393a5e-(_0x321a0f-_0x5b5192);_0x42ebfe=this,_0x31a87a=arguments;if(_0x15edd2<=0x0||_0x15edd2>_0x393a5e){_0x5ac855&&(clearTimeout(_0x5ac855),_0x5ac855=null);_0x5b5192=_0x321a0f,_0xfb9b0b=_0x36e5c6['apply'](_0x42ebfe,_0x31a87a);if(!_0x5ac855)_0x42ebfe=_0x31a87a=null;}else!_0x5ac855&&_0xf84024['trailing']!==![]&&(_0x5ac855=setTimeout(_0xe65220,_0x15edd2));return _0xfb9b0b;};}function refreshToken(){const _0x3b6f00=_0xa8b336;return fetch(host+_0x3b6f00(0x133),{'method':'POST','credentials':'include'})[_0x3b6f00(0x183)](_0xd47c7f=>{return _0xd47c7f['json']();});}function initToken(){const _0x1632a5=_0xa8b336;return fetch(host+_0x1632a5(0x1a0),{'method':_0x1632a5(0x1a7),'credentials':'include'})['then'](_0x38dfd6=>{const _0x8ab4fe=_0x1632a5;return _0x38dfd6[_0x8ab4fe(0x14a)]();});}const requestWithRefresh=async function(_0x4f3e74,_0x40b5b2){const _0x459ebf=_0xa8b336;return fetch(_0x4f3e74,{..._0x40b5b2,'credentials':_0x459ebf(0x122)})[_0x459ebf(0x183)](async _0x3d65e9=>_0x3d65e9[_0x459ebf(0x14a)]())['then'](async _0x3b8fea=>{const _0x43e245=_0x459ebf;if(_0x3b8fea[_0x43e245(0x110)]==='need_refresh')return refreshToken()[_0x43e245(0x183)](_0x17a086=>{const _0x3f6f08=_0x43e245;return console[_0x3f6f08(0x1be)]('url',_0x4f3e74),fetch(_0x4f3e74,{..._0x40b5b2,'credentials':_0x3f6f08(0x122)})[_0x3f6f08(0x183)](_0x1339a0=>_0x1339a0[_0x3f6f08(0x14a)]());});return _0x3b8fea;});},replaceProduct=async function(_0x37cade){const _0x50faf6=_0xa8b336;return requestWithRefresh(host+_0x50faf6(0x12f),{'method':'POST','headers':{'Content-Type':_0x50faf6(0x116)},'body':JSON['stringify']({'product_name':_0x37cade})})[_0x50faf6(0x183)](async()=>{updateCart();});},deleteProduct=async function(_0x3fedd6){const _0x50906f=_0xa8b336;return requestWithRefresh(host+_0x50906f(0x14e),{'method':_0x50906f(0x1a7),'headers':{'Content-Type':_0x50906f(0x116)},'body':JSON[_0x50906f(0x1ba)]({'product_name':_0x3fedd6})});},updateCart=throttle(async function(){const _0x1053e5=_0xa8b336;return requestWithRefresh(host+_0x1053e5(0x149),{'headers':{'Content-Type':_0x1053e5(0x116)}})[_0x1053e5(0x183)](_0x12304e=>{const _0x85cba6=_0x1053e5;_0x12304e[_0x85cba6(0x1ad)]!==_0x85cba6(0x191)&&(initialData_g[_0x85cba6(0x186)]=_0x12304e['payload'][_0x85cba6(0x186)],initialData_g['precision']=_0x12304e[_0x85cba6(0x13d)][_0x85cba6(0xff)],_0x12304e[_0x85cba6(0x1ad)]===_0x85cba6(0x18c)&&(allProducts=[],visibleProducts=[],renderProducts(),allProducts=_0x12304e[_0x85cba6(0x13d)]['chunk'],visibleProducts=_0x12304e[_0x85cba6(0x13d)][_0x85cba6(0x121)]),_0x12304e[_0x85cba6(0x1ad)]===_0x85cba6(0x130)&&_0x12304e[_0x85cba6(0x13d)]['chunk'][_0x85cba6(0x177)](_0x235f43=>{const _0xd1aadf=_0x85cba6;let _0xfb026b=allProducts[_0xd1aadf(0x12a)](_0x2ab227=>_0x2ab227[_0xd1aadf(0x160)]===_0x235f43[_0xd1aadf(0x160)]);_0xfb026b===-0x1?(allProducts['push']({..._0x235f43,'image':_0x235f43[_0xd1aadf(0x178)]?.['replace'](_0xd1aadf(0x154),_0xd1aadf(0x18e))}),visibleProducts[_0xd1aadf(0x182)]===allProducts['length']-0x1&&(visibleProducts=allProducts)):(allProducts[_0xfb026b]['n']+=_0x235f43['n'],_0xfb026b<visibleProducts[_0xd1aadf(0x182)]&&(visibleProducts[_0xfb026b]=allProducts[_0xfb026b]));}),console[_0x85cba6(0x1be)](allProducts[_0x85cba6(0x182)],visibleProducts['length']),_0x12304e['status']!==_0x85cba6(0x1cc)&&renderProducts(),updateCart());})[_0x1053e5(0x163)](()=>{updateCart();});},0xbb8),setOption=(_0x360f92,_0xf26e70)=>{const _0x38c927=_0xa8b336;return requestWithRefresh(host+_0x38c927(0x138),{'method':'POST','headers':{'Content-Type':_0x38c927(0x116)},'body':JSON['stringify']({[_0x360f92]:_0xf26e70})})[_0x38c927(0x183)](async _0x535adc=>{wholeRender(await loadInitData()),updateCart();});},loadInitData=async function(){const _0x1f3c0d=_0xa8b336;return fetch(host+'/api/promo/get_initial_data',{'credentials':_0x1f3c0d(0x122)})[_0x1f3c0d(0x183)](async _0x74c5c8=>{const _0x45437a=_0x1f3c0d,_0x1f534d=await _0x74c5c8[_0x45437a(0x14a)]();if(_0x74c5c8[_0x45437a(0x1ad)]===0x191&&_0x1f534d['error_message']!==_0x45437a(0x16b))return await initToken()[_0x45437a(0x183)](_0xa40694=>{const _0x44839e=_0x45437a;return fetch(host+_0x44839e(0x14b),{'credentials':'include'})['then'](_0x391b9b=>_0x391b9b[_0x44839e(0x14a)]());});if(_0x74c5c8[_0x45437a(0x1ad)]===0x193||_0x1f534d[_0x45437a(0x110)]==='need_refresh')return await refreshToken()[_0x45437a(0x183)](_0x178994=>{const _0x595be6=_0x45437a;return fetch(host+'/api/promo/get_initial_data',{'credentials':'include'})[_0x595be6(0x183)](_0x1264a=>_0x1264a[_0x595be6(0x14a)]());});return _0x1f534d;})[_0x1f3c0d(0x183)](_0x23eace=>{return updateCart(),_0x23eace;})[_0x1f3c0d(0x163)](_0x2d5972=>{const _0xf0823e=_0x1f3c0d;return console[_0xf0823e(0x1be)](_0x2d5972),Promise[_0xf0823e(0x1ae)]();});};function debounce(_0x516460,_0x2f7004){let _0x127c99;return function(..._0x23982b){clearTimeout(_0x127c99),_0x127c99=setTimeout(()=>{const _0x1a8d86=_0x4e73;_0x516460[_0x1a8d86(0x1ac)](this,_0x23982b);},_0x2f7004);};}let allProducts,visibleProducts;function renderProduct(_0x1d7f4f,_0x669ec8){const _0x1fc742=_0xa8b336,_0x31b266=document[_0x1fc742(0x19f)]('li');_0x31b266[_0x1fc742(0x141)]=_0x1fc742(0x187);const _0x13129e=_0x1d7f4f[_0x1fc742(0x18b)]==='g'?_0x1d7f4f['n']+'\x20г':_0x1d7f4f['n']+_0x1fc742(0x195);return _0x31b266[_0x1fc742(0x1a5)]=_0x1fc742(0x137)+_0x1d7f4f[_0x1fc742(0x178)]+'\x22\x20alt=\x22\x22></div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22item-details\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22item-name\x22>'+_0x1d7f4f['name']+'</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22item-price\x22>'+_0x13129e+_0x1fc742(0x123)+Math[_0x1fc742(0x144)](_0x1d7f4f[_0x1fc742(0x198)]*0x64)/0x64+_0x1fc742(0x1c6)+_0x669ec8+_0x1fc742(0x11a),_0x31b266;}function _0x38a1(){const _0x1165c5=['tag\x20','\x20<span\x20class=\x22tag-close\x22>×</span>','resize','application/json','index','.cart-item','summary-details','\x22>&#8942;</button>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22menu-dropdown\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<ul>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<li\x20class=\x22menu-replace\x22>Заменить</li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<li\x20class=\x22menu-remove\x22>Удалить</li>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</ul>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','#personModal\x20.tags-wrap[data-target=\x22favorite\x22]',',\x20точность\x20','show','cart-list','addEventListener','\x20&bull;\x20','chunk','include','\x20&times;\x20','avoid','.day-btn','cookie-popup','tag-green','#personModal\x20.autocomplete-list[data-type=\x22','location','findIndex','total-price','top','товаров','.cart-summary','/api/promo/replace_item','data','nextElementSibling','1071NqzotM','/api/guest/refresh_cookie','now','gender','10hlmaSx','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22item-image\x22><img\x20src=\x22','/api/promo/set_option','age','.gender-btn.active','scroll-wrapper','trim','payload','DOMContentLoaded','cookie_accepted','push','className','301912vbWXrj','1387188oWKvAr','round','#personModal\x20.tags-wrap\x20.tag','.menu-btn','appendChild','.col-left','/api/promo/get_updates','json','/api/promo/get_initial_data','товара','family-member','/api/promo/delete_item','.accordion-item','inactive','https://hvatilo.ru','#personModal\x20.pref-input','</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22age\x22>','{SIZE}','modalTitle','remaining-count','expand-categories','style','button','Пожалуйста,\x20введите\x20имя.','currency','children','.cart-footer','день','.reorder-btn','name','cookie-accept','input','catch','hidden','getBoundingClientRect','RUB','personModal','.days-options\x20.day-btn','category','hide','need_refresh','inputName','textContent','\x20лет</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22delete-member\x22\x20data-index=\x22','\x20~\x20с\x20запасами\x20на\x20','category-btn\x20','closest','человек','true','categories-grid','classList','0\x20товаров\x20&bull;\x20','forEach','image','12131856wCtwWg','.summary-days','Редактировать\x20человека','add','setItem','click','reduce','indexOf','.menu-dropdown','length','then','slice','users','excess','cart-item','open','includes','.show-more','unit','clear','.gender-btn[data-gender=\x22m\x22]','65,fit','available_groups','дня','complete','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22avatar\x22>','remove','value','\x20шт','Возраст\x20должен\x20быть\x20от\x207\x20лет.','getItem','price','family-desc','display','28312aOcQdp','initial_groups','inputHeight','flat','createElement','/api/guest/init_cookie?utm_source=hvatilo_promo','categories','querySelector','collapsed','offsetHeight','innerHTML','innerHeight','POST','filter','getElementById','contains','</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22info\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22name\x22>','apply','status','reject','querySelectorAll','#personModal\x20.tags-wrap[data-target=\x22','auto','show-more-btn','#personModal\x20.tags-wrap','maxHeight','товар','weight','savePersonBtn','favorite','toggle','stringify','.days-options','Не\x20указаны','человека','log','.menu-dropdown.active','.menu-btn-wrapper','splice','family-list','дней','500px','\x22>×</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','\x20₽</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20</div>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<div\x20class=\x22menu-btn-wrapper\x22>\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20<button\x20class=\x22menu-btn\x22\x20data-index=\x22','leading','from','div','cart','.gender-btn','waiting','toLowerCase','NumberFormat','target','precision','replacing','flex','addMemberBtn','stopPropagation','.menu-replace','days','.tag-close','inputAge','689436NxcWBq','none','dataset','active','813236WBqDEn','1604946spBSfe','.tag','reload','error_message','replace','Добавить\x20человека'];_0x38a1=function(){return _0x1165c5;};return _0x38a1();}let cartList,scrollWrapper,showMoreBtn,remainingSpan,initialData_g;function renderProducts(){const _0x1db6be=_0xa8b336;cartList[_0x1db6be(0x1a5)]='',visibleProducts[_0x1db6be(0x177)]((_0x45fd89,_0x34476e)=>{const _0x47f3b=_0x1db6be;cartList[_0x47f3b(0x147)](renderProduct(_0x45fd89,_0x34476e));});const _0x3d0f53=allProducts[_0x1db6be(0x182)]-visibleProducts[_0x1db6be(0x182)];_0x3d0f53>0x0?(showMoreBtn['classList'][_0x1db6be(0x193)](_0x1db6be(0x164)),remainingSpan[_0x1db6be(0x16d)]=_0x3d0f53):showMoreBtn[_0x1db6be(0x175)]['add']('hidden'),updateSummaryCount(),calculateListHeight();}function updateSummaryCount(){const _0x5d8c2e=_0xa8b336,_0x25fe69=new Intl[(_0x5d8c2e(0xfd))]('ru-RU',{'style':_0x5d8c2e(0x15b),'currency':_0x5d8c2e(0x166)})['format'](Math[_0x5d8c2e(0x144)](allProducts[_0x5d8c2e(0x17f)]((_0x1ea9ab,_0x7ecd1a)=>_0x1ea9ab+_0x7ecd1a['total_price'],0x0)*0x64)/0x64),_0x102df=Math[_0x5d8c2e(0x144)](initialData_g[_0x5d8c2e(0x105)]*initialData_g[_0x5d8c2e(0x186)]+initialData_g[_0x5d8c2e(0x105)]);document[_0x5d8c2e(0x1a9)](_0x5d8c2e(0x119))[_0x5d8c2e(0x1a5)]=allProducts[_0x5d8c2e(0x182)]+'\x20'+declension(allProducts[_0x5d8c2e(0x182)],[_0x5d8c2e(0x1b5),_0x5d8c2e(0x14c),_0x5d8c2e(0x12d)])+_0x5d8c2e(0x120)+_0x25fe69+_0x5d8c2e(0x16f)+_0x102df+'\x20'+declension(_0x102df,['день','дня',_0x5d8c2e(0x1c3)])+_0x5d8c2e(0x11c)+Math['round'](initialData_g['precision']*0x64)/0x64+'%',document[_0x5d8c2e(0x1a9)](_0x5d8c2e(0x12b))[_0x5d8c2e(0x1a5)]=''+_0x25fe69,allProducts['length']===0x0&&(document[_0x5d8c2e(0x1a9)](_0x5d8c2e(0x119))[_0x5d8c2e(0x1a5)]=_0x5d8c2e(0x176)+_0x25fe69+'\x20₽');}function calculateListHeight(){const _0x1edf7f=_0xa8b336,_0x2f8937=document['querySelector'](_0x1edf7f(0x148));if(!_0x2f8937)return;const _0x4d74a4=_0x2f8937['querySelector']('h1'),_0x273a32=_0x2f8937[_0x1edf7f(0x1a2)]('.subtitle'),_0x5c9d0f=_0x2f8937[_0x1edf7f(0x1a2)](_0x1edf7f(0x12e)),_0x2f51b5=_0x2f8937['querySelector'](_0x1edf7f(0x15d)),_0x571d52=_0x2f8937[_0x1edf7f(0x1a2)](_0x1edf7f(0x18a));let _0x569025=0x0;if(_0x4d74a4)_0x569025+=_0x4d74a4['offsetHeight']+0x6;if(_0x273a32)_0x569025+=_0x273a32['offsetHeight']+0x1c;if(_0x5c9d0f)_0x569025+=_0x5c9d0f[_0x1edf7f(0x1a4)]+0x18;if(_0x571d52&&!_0x571d52[_0x1edf7f(0x175)][_0x1edf7f(0x1aa)](_0x1edf7f(0x164)))_0x569025+=_0x571d52['offsetHeight'];if(_0x2f51b5)_0x569025+=_0x2f51b5['offsetHeight']+0x14;const _0x256edd=0x3c,_0x241b78=_0x2f8937[_0x1edf7f(0x165)](),_0x547291=window[_0x1edf7f(0x1a6)]-_0x241b78[_0x1edf7f(0x12c)]-_0x256edd-0x14,_0x2c2c92=_0x547291-_0x569025;_0x2c2c92>0x64&&(scrollWrapper[_0x1edf7f(0x158)][_0x1edf7f(0x1b4)]=_0x2c2c92+'px',scrollWrapper[_0x1edf7f(0x158)]['overflowY']=_0x1edf7f(0x1b1));}function declension(_0x2daf80,_0x2de82b){const _0x31b42c=[0x2,0x0,0x1,0x1,0x1,0x2],_0x31240b=_0x2daf80%0x64>0x4&&_0x2daf80%0x64<0x14?0x2:_0x31b42c[Math['min'](_0x2daf80%0xa,0x5)];return _0x2de82b[_0x31240b];}function wholeRender(_0x1d3bba){const _0x3545ce=_0xa8b336;initialData_g=_0x1d3bba,document[_0x3545ce(0x1a2)](_0x3545ce(0x17a))[_0x3545ce(0x16d)]=initialData_g[_0x3545ce(0x105)]+'\x20'+declension(initialData_g[_0x3545ce(0x105)],['день',_0x3545ce(0x190),'дней']),allProducts=(Array['isArray'](initialData_g['cart'])?initialData_g[_0x3545ce(0x1ca)]:[]??[])[_0x3545ce(0x19e)]()['map'](_0xf32720=>{const _0x14349e=_0x3545ce;return{..._0xf32720,'image':_0xf32720[_0x14349e(0x178)]?.[_0x14349e(0x111)]('{SIZE}','65,fit')};}),visibleProducts=allProducts[_0x3545ce(0x184)](0x0,visibleProducts?visibleProducts[_0x3545ce(0x182)]:0x5),document[_0x3545ce(0x1af)](_0x3545ce(0x168))['forEach'](_0x32ac3f=>{const _0x4a2aed=_0x3545ce;_0x32ac3f['innerText']['trim']()===''+initialData_g[_0x4a2aed(0x105)]&&_0x32ac3f[_0x4a2aed(0x175)][_0x4a2aed(0x17c)](_0x4a2aed(0x10b));}),console[_0x3545ce(0x1be)](initialData_g);let _0x326855=initialData_g[_0x3545ce(0x185)];cartList=document[_0x3545ce(0x1a9)](_0x3545ce(0x11e)),scrollWrapper=document[_0x3545ce(0x1a9)](_0x3545ce(0x13b)),showMoreBtn=document[_0x3545ce(0x1a9)](_0x3545ce(0x1b2)),remainingSpan=document[_0x3545ce(0x1a9)](_0x3545ce(0x156)),renderProducts(),document[_0x3545ce(0x11f)](_0x3545ce(0x17e),function(_0x449b81){const _0x1f33a3=_0x3545ce,_0x21b2fc=_0x449b81[_0x1f33a3(0xfe)][_0x1f33a3(0x171)](_0x1f33a3(0x146)),_0x180905=_0x449b81['target']['closest'](_0x1f33a3(0x181)),_0x482e78=_0x449b81[_0x1f33a3(0xfe)][_0x1f33a3(0x171)](_0x1f33a3(0x104)),_0x3ccbe4=_0x449b81[_0x1f33a3(0xfe)][_0x1f33a3(0x171)]('.menu-remove'),_0x2e534c=_0x449b81['target'][_0x1f33a3(0x171)](_0x1f33a3(0x15f));if(_0x21b2fc){const _0x37e9c4=_0x21b2fc[_0x1f33a3(0x131)],_0x14a2f4=_0x37e9c4['classList'][_0x1f33a3(0x1aa)](_0x1f33a3(0x10b));document[_0x1f33a3(0x1af)](_0x1f33a3(0x1bf))['forEach'](_0x1b63eb=>_0x1b63eb['classList']['remove']('active')),!_0x14a2f4&&_0x37e9c4['classList'][_0x1f33a3(0x17c)](_0x1f33a3(0x10b)),_0x449b81[_0x1f33a3(0x103)]();}else!_0x180905&&document['querySelectorAll']('.menu-dropdown.active')['forEach'](_0x5ea66f=>_0x5ea66f[_0x1f33a3(0x175)][_0x1f33a3(0x193)]('active'));if(_0x482e78){const _0x236e26=_0x482e78[_0x1f33a3(0x171)](_0x1f33a3(0x1c0)),_0xf58268=_0x236e26['closest'](_0x1f33a3(0x118));_0xf58268[_0x1f33a3(0x175)][_0x1f33a3(0x17c)](_0x1f33a3(0x100));const _0x23a287=Array['from'](cartList[_0x1f33a3(0x15c)])[_0x1f33a3(0x180)](_0xf58268);replaceProduct(allProducts[_0x23a287]['name'])['then'](()=>{const _0xcaf299=_0x1f33a3;_0xf58268['remove'](),document[_0xcaf299(0x1af)](_0xcaf299(0x1bf))[_0xcaf299(0x177)](_0x424a01=>_0x424a01[_0xcaf299(0x175)][_0xcaf299(0x193)](_0xcaf299(0x10b))),visibleProducts[_0xcaf299(0x1c1)](_0x23a287,0x1),allProducts[_0xcaf299(0x1c1)](_0x23a287,0x1),visibleProducts[_0xcaf299(0x182)]<allProducts[_0xcaf299(0x182)]&&visibleProducts[_0xcaf299(0x140)](allProducts[visibleProducts['length']]),renderProducts(),calculateListHeight();});}if(_0x3ccbe4){const _0x43f6f1=_0x3ccbe4[_0x1f33a3(0x171)](_0x1f33a3(0x1c0)),_0xf24345=_0x43f6f1[_0x1f33a3(0x171)](_0x1f33a3(0x118));_0xf24345['classList']['add']('replacing');const _0x5777cf=Array[_0x1f33a3(0x1c8)](cartList['children'])[_0x1f33a3(0x180)](_0xf24345);deleteProduct(allProducts[_0x5777cf]['name'])['then'](()=>{const _0x107943=_0x1f33a3;_0xf24345[_0x107943(0x193)](),document['querySelectorAll'](_0x107943(0x1bf))[_0x107943(0x177)](_0x155ad8=>_0x155ad8[_0x107943(0x175)][_0x107943(0x193)]('active')),visibleProducts[_0x107943(0x1c1)](_0x5777cf,0x1),allProducts[_0x107943(0x1c1)](_0x5777cf,0x1),visibleProducts[_0x107943(0x182)]<allProducts[_0x107943(0x182)]&&visibleProducts['push'](allProducts[visibleProducts[_0x107943(0x182)]]),renderProducts(),calculateListHeight();});}_0x2e534c&&requestWithRefresh(host+'/api/guest/clear_cookie',{'method':_0x1f33a3(0x1a7)})[_0x1f33a3(0x183)](_0x13b5f9=>{const _0x3908dd=_0x1f33a3;document[_0x3908dd(0x129)][_0x3908dd(0x10f)]();});}),showMoreBtn[_0x3545ce(0x11f)]('click',()=>{const _0x13f578=_0x3545ce;while(visibleProducts[_0x13f578(0x182)]<allProducts[_0x13f578(0x182)]){visibleProducts[_0x13f578(0x140)](allProducts[visibleProducts[_0x13f578(0x182)]]);}renderProducts(),scrollWrapper[_0x13f578(0x158)][_0x13f578(0x1b4)]=_0x13f578(0x1c4),calculateListHeight();}),window[_0x3545ce(0x11f)](_0x3545ce(0x115),calculateListHeight),calculateListHeight(),document[_0x3545ce(0x1af)]('.accordion-header')['forEach'](_0x4ad3c3=>{const _0x5b40a8=_0x3545ce;_0x4ad3c3['addEventListener'](_0x5b40a8(0x17e),function(){const _0x16a40c=_0x5b40a8,_0x3d1e7d=this['closest']('.accordion-item'),_0x244765=_0x3d1e7d[_0x16a40c(0x175)]['contains'](_0x16a40c(0x188));document[_0x16a40c(0x1af)](_0x16a40c(0x14f))[_0x16a40c(0x177)](_0x4495e3=>_0x4495e3[_0x16a40c(0x175)][_0x16a40c(0x193)](_0x16a40c(0x188))),!_0x244765&&_0x3d1e7d[_0x16a40c(0x175)][_0x16a40c(0x17c)](_0x16a40c(0x188));});}),document[_0x3545ce(0x1af)]('.day-btn')[_0x3545ce(0x177)](_0x14d3b1=>{const _0x2b0c3f=_0x3545ce;_0x14d3b1[_0x2b0c3f(0x11f)](_0x2b0c3f(0x17e),function(){const _0x4de1cb=_0x2b0c3f,_0x3a4ffd=this[_0x4de1cb(0x171)](_0x4de1cb(0x1bb));_0x3a4ffd[_0x4de1cb(0x1af)](_0x4de1cb(0x125))['forEach'](_0x176e0a=>_0x176e0a[_0x4de1cb(0x175)][_0x4de1cb(0x193)]('active')),this[_0x4de1cb(0x175)]['add']('active'),setOption(_0x4de1cb(0x105),this[_0x4de1cb(0x10a)][_0x4de1cb(0x105)]),document['querySelector'](_0x4de1cb(0x17a))[_0x4de1cb(0x16d)]=this[_0x4de1cb(0x10a)][_0x4de1cb(0x105)]+'\x20'+declension(this[_0x4de1cb(0x10a)][_0x4de1cb(0x105)],[_0x4de1cb(0x15e),_0x4de1cb(0x190),_0x4de1cb(0x1c3)]);});});const _0x2af54e=document[_0x3545ce(0x1a9)](_0x3545ce(0x1c2)),_0x401b7f=document[_0x3545ce(0x1a9)](_0x3545ce(0x199));let _0x11affa=null;function _0x9d597d(){const _0x559a81=_0x3545ce;_0x2af54e[_0x559a81(0x1a5)]='',_0x326855[_0x559a81(0x177)]((_0x3f6ae0,_0x563d86)=>{const _0x11fcf9=_0x559a81,_0x533792='🥦',_0x4a922a=document[_0x11fcf9(0x19f)]('div');_0x4a922a[_0x11fcf9(0x141)]=_0x11fcf9(0x14d),_0x4a922a[_0x11fcf9(0x10a)][_0x11fcf9(0x117)]=_0x563d86,_0x4a922a[_0x11fcf9(0x1a5)]=_0x11fcf9(0x192)+_0x533792+_0x11fcf9(0x1ab)+_0x3f6ae0[_0x11fcf9(0x160)]+_0x11fcf9(0x153)+_0x3f6ae0[_0x11fcf9(0x139)]+_0x11fcf9(0x16e)+_0x563d86+_0x11fcf9(0x1c5),_0x2af54e['appendChild'](_0x4a922a);});const _0x3a0407=_0x326855[_0x559a81(0x182)];_0x401b7f['textContent']=_0x3a0407+'\x20'+declension(_0x3a0407,[_0x559a81(0x172),_0x559a81(0x1bd),'человек']);if(_0x3a0407===0x0)_0x401b7f[_0x559a81(0x16d)]=_0x559a81(0x1bc);document[_0x559a81(0x1af)]('.delete-member')['forEach'](_0x39d6fe=>{const _0x419a38=_0x559a81;_0x39d6fe[_0x419a38(0x11f)](_0x419a38(0x17e),function(_0x9cd90b){const _0x3a39c7=_0x419a38;_0x9cd90b['stopPropagation']();const _0x34f8c2=parseInt(this['dataset'][_0x3a39c7(0x117)]);_0x326855[_0x3a39c7(0x1c1)](_0x34f8c2,0x1),_0x9d597d(),setOption(_0x3a39c7(0x185),_0x326855);});});}_0x9d597d(),_0x2af54e['addEventListener']('click',function(_0x5b08a5){const _0x1782fa=_0x3545ce,_0x310379=_0x5b08a5[_0x1782fa(0xfe)][_0x1782fa(0x171)]('.family-member');if(!_0x310379)return;if(_0x5b08a5[_0x1782fa(0xfe)][_0x1782fa(0x171)]('.delete-member'))return;const _0x300d74=parseInt(_0x310379[_0x1782fa(0x10a)][_0x1782fa(0x117)]);_0x821550(_0x300d74);});const _0x40d14b=document['getElementById'](_0x3545ce(0x167)),_0x551c34=document[_0x3545ce(0x1a9)](_0x3545ce(0x102)),_0xd2fb76=document['getElementById']('closeModalBtn'),_0x250a51=document[_0x3545ce(0x1a9)](_0x3545ce(0x1b7)),_0x2635e9=document[_0x3545ce(0x1a9)](_0x3545ce(0x155)),_0x4357ee=document[_0x3545ce(0x1af)](_0x3545ce(0x1cb)),_0x5c0b01=initialData_g[_0x3545ce(0x18f)];function _0x821550(_0x5ca53e=null){const _0x3fdada=_0x3545ce;_0x11affa=_0x5ca53e,document[_0x3fdada(0x1af)](_0x3fdada(0x1b3))['forEach'](_0x467bd5=>_0x467bd5[_0x3fdada(0x1a5)]='');if(_0x11affa!==null){_0x2635e9['textContent']=_0x3fdada(0x17b);const _0x530898=_0x326855[_0x11affa];document[_0x3fdada(0x1a9)](_0x3fdada(0x16c))['value']=_0x530898['name'],document[_0x3fdada(0x1a9)](_0x3fdada(0x107))[_0x3fdada(0x194)]=_0x530898['age'],document[_0x3fdada(0x1a9)]('inputWeight')[_0x3fdada(0x194)]=_0x530898[_0x3fdada(0x1b6)],document[_0x3fdada(0x1a9)]('inputHeight')[_0x3fdada(0x194)]=_0x530898['height'],_0x4357ee[_0x3fdada(0x177)](_0x3763bd=>{const _0x1f0fc5=_0x3fdada;_0x3763bd[_0x1f0fc5(0x175)][_0x1f0fc5(0x1b9)]('active',_0x3763bd[_0x1f0fc5(0x10a)]['gender']===_0x530898[_0x1f0fc5(0x135)]);});if(_0x530898[_0x3fdada(0x124)])_0x530898[_0x3fdada(0x124)][_0x3fdada(0x177)](_0xaf6efc=>_0x4a40cc(_0xaf6efc,_0x3fdada(0x124),![]));if(_0x530898[_0x3fdada(0x1b8)])_0x530898[_0x3fdada(0x1b8)][_0x3fdada(0x177)](_0x4f15e5=>_0x4a40cc(_0x4f15e5,_0x3fdada(0x1b8),![]));}else _0x2635e9[_0x3fdada(0x16d)]=_0x3fdada(0x112),document[_0x3fdada(0x1a9)](_0x3fdada(0x16c))[_0x3fdada(0x194)]='',document[_0x3fdada(0x1a9)](_0x3fdada(0x107))[_0x3fdada(0x194)]='',document['getElementById']('inputWeight')[_0x3fdada(0x194)]='',document[_0x3fdada(0x1a9)](_0x3fdada(0x19d))[_0x3fdada(0x194)]='',_0x4357ee[_0x3fdada(0x177)](_0x4c8273=>_0x4c8273[_0x3fdada(0x175)][_0x3fdada(0x193)](_0x3fdada(0x10b))),document['querySelector'](_0x3fdada(0x18d))[_0x3fdada(0x175)][_0x3fdada(0x17c)]('active');_0x40d14b[_0x3fdada(0x158)][_0x3fdada(0x19a)]=_0x3fdada(0x101),calculateListHeight();}_0x551c34['addEventListener']('click',()=>_0x821550(null));function _0x42fe70(){const _0x5d837b=_0x3545ce;_0x40d14b[_0x5d837b(0x158)][_0x5d837b(0x19a)]='none';}_0xd2fb76[_0x3545ce(0x11f)](_0x3545ce(0x17e),_0x42fe70),_0x40d14b[_0x3545ce(0x11f)](_0x3545ce(0x17e),function(_0x507585){if(_0x507585['target']===this)_0x42fe70();}),_0x4357ee[_0x3545ce(0x177)](_0x10a776=>{const _0x5a2408=_0x3545ce;_0x10a776[_0x5a2408(0x11f)](_0x5a2408(0x17e),function(){const _0x484eb7=_0x5a2408;_0x4357ee['forEach'](_0x4bf696=>_0x4bf696[_0x484eb7(0x175)][_0x484eb7(0x193)](_0x484eb7(0x10b))),this[_0x484eb7(0x175)][_0x484eb7(0x17c)](_0x484eb7(0x10b));});});function _0x4a40cc(_0x56d609,_0x45231a,_0x49f9f2=!![]){const _0x22e509=_0x3545ce,_0x1b416d=document[_0x22e509(0x1a2)](_0x22e509(0x1b0)+_0x45231a+'\x22]'),_0x37c2b7=_0x1b416d['querySelectorAll'](_0x22e509(0x10e));for(let _0x25ab16 of _0x37c2b7){if(_0x25ab16[_0x22e509(0x16d)][_0x22e509(0x13c)]()[_0x22e509(0x111)]('×','')[_0x22e509(0x13c)]()===_0x56d609)return;}const _0xdf8462=_0x45231a===_0x22e509(0x124)?_0x22e509(0x1b8):_0x22e509(0x124),_0x30252d=document[_0x22e509(0x1a2)]('#personModal\x20.tags-wrap[data-target=\x22'+_0xdf8462+'\x22]'),_0x12d67e=_0x30252d[_0x22e509(0x1af)](_0x22e509(0x10e));for(let _0x4d1e1d of _0x12d67e){if(_0x4d1e1d[_0x22e509(0x16d)][_0x22e509(0x13c)]()['replace']('×','')['trim']()===_0x56d609){_0x4d1e1d[_0x22e509(0x193)]();break;}}const _0x1a0e22=document[_0x22e509(0x19f)](_0x22e509(0x1c9));_0x1a0e22['className']=_0x22e509(0x113)+(_0x45231a===_0x22e509(0x124)?'tag-red':_0x22e509(0x127)),_0x1a0e22[_0x22e509(0x1a5)]=_0x56d609+_0x22e509(0x114),_0x1a0e22[_0x22e509(0x1a2)](_0x22e509(0x106))[_0x22e509(0x11f)](_0x22e509(0x17e),function(){const _0x39cddb=_0x22e509;_0x1a0e22[_0x39cddb(0x193)]();}),_0x1b416d[_0x22e509(0x147)](_0x1a0e22);}document[_0x3545ce(0x1af)](_0x3545ce(0x152))[_0x3545ce(0x177)](_0x2e7c62=>{const _0x37fc45=_0x3545ce,_0x2519e7=_0x2e7c62['dataset']['type'],_0x54222c=document[_0x37fc45(0x1a2)](_0x37fc45(0x128)+_0x2519e7+'\x22]'),_0x14f81d=document['querySelector'](_0x37fc45(0x1b0)+_0x2519e7+'\x22]');_0x2e7c62['addEventListener'](_0x37fc45(0x162),function(){const _0x30150e=_0x37fc45,_0x2409d1=this[_0x30150e(0x194)][_0x30150e(0x1cd)]();_0x54222c['innerHTML']='';const _0x395ae1=new Set();document[_0x30150e(0x1af)](_0x30150e(0x145))['forEach'](_0xed82f7=>{const _0x2666c1=_0x30150e,_0x2a68e5=_0xed82f7['textContent'][_0x2666c1(0x13c)]()[_0x2666c1(0x111)]('×','')[_0x2666c1(0x13c)]();if(_0x2a68e5)_0x395ae1['add'](_0x2a68e5);});if(_0x2409d1[_0x30150e(0x182)]>0x0){const _0x2af28a=_0x5c0b01[_0x30150e(0x1a8)](_0xc411c2=>_0xc411c2[_0x30150e(0x1cd)]()['includes'](_0x2409d1)&&!_0x395ae1['has'](_0xc411c2));_0x2af28a['length']>0x0?(_0x54222c['classList'][_0x30150e(0x17c)]('active'),_0x2af28a[_0x30150e(0x177)](_0x16ab3a=>{const _0x2945b1=_0x30150e,_0x2e8a2a=document['createElement'](_0x2945b1(0x1c9));_0x2e8a2a[_0x2945b1(0x16d)]=_0x16ab3a,_0x2e8a2a[_0x2945b1(0x11f)](_0x2945b1(0x17e),function(){const _0x3a2e33=_0x2945b1;_0x4a40cc(_0x16ab3a,_0x2519e7),_0x2e7c62[_0x3a2e33(0x194)]='',_0x54222c['classList']['remove'](_0x3a2e33(0x10b));}),_0x54222c[_0x2945b1(0x147)](_0x2e8a2a);})):_0x54222c['classList'][_0x30150e(0x193)](_0x30150e(0x10b));}else _0x54222c['classList'][_0x30150e(0x193)](_0x30150e(0x10b));}),document['addEventListener'](_0x37fc45(0x17e),function(_0x4c7d4f){const _0x4583df=_0x37fc45;!_0x2e7c62[_0x4583df(0x1aa)](_0x4c7d4f[_0x4583df(0xfe)])&&!_0x54222c[_0x4583df(0x1aa)](_0x4c7d4f['target'])&&_0x54222c['classList'][_0x4583df(0x193)](_0x4583df(0x10b));});}),_0x250a51[_0x3545ce(0x11f)](_0x3545ce(0x17e),()=>{const _0x2637ff=_0x3545ce,_0x26a3f8=document['getElementById'](_0x2637ff(0x16c))[_0x2637ff(0x194)][_0x2637ff(0x13c)](),_0x94cc1b=document[_0x2637ff(0x1a9)](_0x2637ff(0x107))[_0x2637ff(0x194)][_0x2637ff(0x13c)](),_0x1f5736=document['getElementById']('inputWeight')['value'][_0x2637ff(0x13c)](),_0x7403fe=document['getElementById']('inputHeight')[_0x2637ff(0x194)][_0x2637ff(0x13c)](),_0x4c3011=document[_0x2637ff(0x1a2)](_0x2637ff(0x13a))[_0x2637ff(0x10a)][_0x2637ff(0x135)];if(!_0x26a3f8){alert(_0x2637ff(0x15a));return;}if(!_0x94cc1b||parseInt(_0x94cc1b)<0x7){alert(_0x2637ff(0x196));return;}const _0x4e7b46=[];document[_0x2637ff(0x1a2)]('#personModal\x20.tags-wrap[data-target=\x22avoid\x22]')['querySelectorAll'](_0x2637ff(0x10e))[_0x2637ff(0x177)](_0x36920a=>{const _0x58736b=_0x2637ff;_0x4e7b46[_0x58736b(0x140)](_0x36920a[_0x58736b(0x16d)][_0x58736b(0x13c)]()[_0x58736b(0x111)]('×','')[_0x58736b(0x13c)]());});const _0x5701b1=[];document[_0x2637ff(0x1a2)](_0x2637ff(0x11b))[_0x2637ff(0x1af)](_0x2637ff(0x10e))[_0x2637ff(0x177)](_0x28458e=>{const _0x45e944=_0x2637ff;_0x5701b1[_0x45e944(0x140)](_0x28458e[_0x45e944(0x16d)][_0x45e944(0x13c)]()[_0x45e944(0x111)]('×','')[_0x45e944(0x13c)]());});const _0xb0a9a4={'name':_0x26a3f8,'age':_0x94cc1b,'weight':_0x1f5736,'height':_0x7403fe,'gender':_0x4c3011,'avoid':_0x4e7b46,'favorite':_0x5701b1};_0x11affa!==null?(_0x326855[_0x11affa]=_0xb0a9a4,_0x11affa=null):_0x326855[_0x2637ff(0x140)](_0xb0a9a4),_0x9d597d(),setOption('users',_0x326855),_0x42fe70();});const _0x44b0d2=initialData_g[_0x3545ce(0x18f)],_0xdae0d0=initialData_g[_0x3545ce(0x19c)];let _0x3ad7fd=[..._0xdae0d0],_0x18d1a0=![];const _0x445e74=0x9,_0x43e3e3=debounce(async()=>{const _0x255258=_0x3545ce;return setOption(_0x255258(0x1a1),_0x3ad7fd);},0x5dc),_0x29cb52=document[_0x3545ce(0x1a9)](_0x3545ce(0x174)),_0x14ab60=document[_0x3545ce(0x1a9)](_0x3545ce(0x157));function _0x5a9a39(){const _0x5c2a75=_0x3545ce;_0x29cb52[_0x5c2a75(0x1a5)]='';const _0xb8024b=_0x18d1a0?_0x44b0d2:_0x44b0d2['slice'](0x0,_0x445e74);_0xb8024b['forEach'](_0x511785=>{const _0x100d00=_0x5c2a75,_0x2fb134=document[_0x100d00(0x19f)](_0x100d00(0x159));_0x2fb134['className']=_0x100d00(0x170)+(_0x3ad7fd['includes'](_0x511785)?_0x100d00(0x10b):_0x100d00(0x150)),_0x2fb134[_0x100d00(0x16d)]=_0x511785,_0x2fb134[_0x100d00(0x10a)][_0x100d00(0x169)]=_0x511785,_0x2fb134[_0x100d00(0x11f)](_0x100d00(0x17e),function(){const _0x1e026a=_0x100d00,_0x42ac49=this[_0x1e026a(0x10a)][_0x1e026a(0x169)];_0x3ad7fd[_0x1e026a(0x189)](_0x42ac49)?_0x3ad7fd=_0x3ad7fd[_0x1e026a(0x1a8)](_0x5f4e1c=>_0x5f4e1c!==_0x42ac49):_0x3ad7fd['push'](_0x42ac49),_0x5a9a39(),_0x43e3e3();}),_0x29cb52[_0x100d00(0x147)](_0x2fb134);}),_0x18d1a0?_0x14ab60[_0x5c2a75(0x175)][_0x5c2a75(0x193)](_0x5c2a75(0x1a3)):_0x14ab60[_0x5c2a75(0x175)]['add'](_0x5c2a75(0x1a3));}_0x14ab60[_0x3545ce(0x11f)](_0x3545ce(0x17e),function(){_0x18d1a0=!_0x18d1a0,_0x5a9a39();}),_0x5a9a39();}document[_0xa8b336(0x11f)](_0xa8b336(0x13e),async()=>{wholeRender(await loadInitData());}),document[_0xa8b336(0x11f)](_0xa8b336(0x13e),function(){const _0x10f3ba=_0xa8b336,_0x2eead3=document[_0x10f3ba(0x1a9)](_0x10f3ba(0x126)),_0x4139a9=document[_0x10f3ba(0x1a9)](_0x10f3ba(0x161));!localStorage[_0x10f3ba(0x197)](_0x10f3ba(0x13f))&&setTimeout(()=>{const _0x565e18=_0x10f3ba;_0x2eead3[_0x565e18(0x175)][_0x565e18(0x17c)](_0x565e18(0x11d));},0x1f4),_0x4139a9['addEventListener'](_0x10f3ba(0x17e),function(){const _0x560a07=_0x10f3ba;localStorage[_0x560a07(0x17d)](_0x560a07(0x13f),_0x560a07(0x173)),_0x2eead3[_0x560a07(0x175)][_0x560a07(0x193)]('show'),_0x2eead3[_0x560a07(0x175)][_0x560a07(0x17c)](_0x560a07(0x16a)),setTimeout(()=>{const _0x1bf65f=_0x560a07;_0x2eead3[_0x1bf65f(0x158)]['display']=_0x1bf65f(0x109);},0x190);});});