PageSourceSearch

https://artelli.moscow/var/cache/asset20_923a0152a90dd69cb945765b84c502dd.js

js artelli.moscow collected 2026-10-04 09:37:52 UTC 17,599 bytes, 71 lines download raw bytes

1app.flyDot=(function(){var ARC_RISE=56;var MIN_TOP=8;var STEPS=24;var controlY=function(s,e,apex){return apex-Math.sqrt((s-apex)*(e-apex))};var keyframes=function(from,to){var low=Math.min(from.y,to.y);var apex=Math.min(low-1,Math.max(low-ARC_RISE,MIN_TOP));var cx=(from.x+to.x)/2;var cy=controlY(from.y,to.y,apex);var frames=[];for(var i=0;i<=STEPS;i++){var t=i/STEPS;var u=1-t;var x=u*u*from.x+2*u*t*cx+t*t*to.x;var y=u*u*from.y+2*u*t*cy+t*t*to.y;var scale=t<0.12?0.5+t/0.12*0.5:(t>0.7?1-(t-0.7)/0.3*0.55:1);var opacity=t>0.85?Math.max(0,1-(t-0.85)/0.15):1;frames.push({offset:t,transform:'translate3d('+x.toFixed(1)+'px,'+y.toFixed(1)+'px,0) scale('+scale.toFixed(3)+')',opacity:opacity})}
2return frames};var reducedMotion=window.matchMedia&&window.matchMedia('(prefers-reduced-motion: reduce)');var fly=function(rect,to,options){var dot=document.createElement('div');if(!rect||(reducedMotion&&reducedMotion.matches)||typeof dot.animate!=='function'){setTimeout(options.onLand,50);return}
3var from={x:rect.left+rect.width/2,y:rect.top+rect.height/2};var distance=Math.sqrt(Math.pow(to.x-from.x,2)+Math.pow(to.y-from.y,2));var duration=Math.round(Math.max(450,Math.min(700,380+distance*0.35)));dot.className='flyToCart'+(options.modifier?' '+options.modifier:'');document.documentElement.appendChild(dot);var animation=dot.animate(keyframes(from,to),{duration:duration,easing:'linear',fill:'forwards'});var remove=function(){dot.parentNode&&dot.parentNode.removeChild(dot)};animation.onfinish=remove;animation.oncancel=remove;var land=function(){setTimeout(options.onLand,Math.max(0,duration-(options.lead||0)))};animation.ready?animation.ready.then(land,land):land()};fly.onScreen=function(elements){var root=document.documentElement;for(var i=0;i<elements.length;i++){var rect=elements[i]&&elements[i].getBoundingClientRect();if(rect&&rect.width&&rect.bottom>0&&rect.top<root.clientHeight&&rect.right>0&&rect.left<root.clientWidth){return rect}}
4return null};return fly})();app.flyToCart=function(rect){var cart=document.querySelector('[data-fly-to-cart]');var box=cart&&cart.getBoundingClientRect();if(!box||!box.width||!box.height){return}
5var toEnd=cart.getAttribute('data-fly-to-cart')==='end';app.flyDot(rect,{x:toEnd?box.right-box.height/2:box.left+box.width/2,y:box.top+box.height/2},{onLand:function(){cart.animate&&cart.animate([{transform:'scale(1)'},{transform:'scale('+(toEnd?1.05:1.1)+')'},{transform:'scale(1)'}],{duration:250})}})};app.flyToCart.startOf=function(dishId,part){var cards=document.querySelectorAll('.ddish[data-id="'+dishId+'"]');return app.flyDot.onScreen(Array.prototype.map.call(cards,function(card){return card.querySelector(part)}))};app.dishControlsComponent={components:{animatedCount:app.commonAnimatedCountComponent},props:['dish','readonly'],data(){return{pendingAction:null,gtmQueue:0,}},computed:{...Vuex.mapState(['cart','cartLoading']),isLoadingIncrease(){return this.cartLoading&&this.pendingAction==='increase'},isLoadingDecrease(){return this.cartLoading&&this.pendingAction==='decrease'},similarDishes(){return this.cart&&this.cart.dishes.filter(dish=>dish.dishId===Number(this.dish.id))},isSimilar(){return this.similarDishes&&this.similarDishes.length>1},similarNum(){return this.similarDishes&&this.similarDishes.reduce((sum,dish)=>sum+dish.num,0)},cartDish(){return this.similarDishes&&this.similarDishes[0]},partial(){return this.cartDish&&this.cartDish.partialConfig},isControlsVisible(){if(this.readonly||this.partial){return!1}
6if(this.isSimilar){return this.similarNum}
7return this.cartDish&&this.cartDish.num},isPlusDisabled(){return!!this.cartDish.promoLimited},},methods:{changeAmount(e,sign){if(sign==='plus'){this.handleIncrease(e)}else{this.handleDecrease()}
8this.recalc({cb:this.cbRecalcCart,})},handleIncrease(e){if(this.isPlusDisabled){return}
9this.pendingAction='increase';if(this.isSimilar){this.$parent.onDishClick(e);return}
10this.gtmQueue++;this.cartDish.num++;app.flyToCart&&app.flyToCart(e.currentTarget.getBoundingClientRect())},handleDecrease(){this.pendingAction='decrease';this.gtmQueue--;this.cartDish.num--;this.cartDish.num=Math.max(this.cartDish.num,0)},getFormData(){if(!this.cart){return null}
11let formData=JSON.parse(JSON.stringify(this.cart));delete formData.timeframe.daysPreorder;delete formData.timeframe.needPreorderMessage;delete formData.timeframe.types;return formData},recalc(params){PubSub.publish('recalcCart',{formData:this.getFormData(),clear:params&&params.clear,cb:params&&params.cb})},cbRecalcCart(response){this.pendingAction=null;const addedCount=this.gtmQueue;this.gtmQueue=0;if(addedCount>0){PubSub.publish('gtmNotify',{event:'addToCart',cart:response.cart,dishSelected:{dishPosId:this.cartDish.dishPosId,count:addedCount}})}}},template:`
12        <div v-if="isControlsVisible" key="controls" class="ddish__controls">
13                <button type="button"
14                        class="ddish__button"
15                        :class="{'ddish__button--loading': isLoadingDecrease}"
16                        data-action="minus"
17                        @click.stop="changeAmount($event, 'minus')"></button>
18
19                <div class="ddish__num ddish__num--animated">
20                    <animatedCount :value="isSimilar ? similarNum : cartDish.num" />
21                </div>
22
23                <button type="button"
24                        class="ddish__button"
25                        :class="{'ddish__button--loading': isLoadingIncrease}"
26                        data-action="plus"
27                        :dish-id="dish.id"
28                        :disabled="isPlusDisabled"
29                        @click.stop="changeAmount($event, 'plus')"></button>
30        </div>
31        <slot v-else-if="$slots.default"></slot>
32        <div v-else class="ddish__plus" :data-id="dish.id" @></div>
33    `};app.addModule(()=>{const isMobile=!!app.menuHydrationMobile;function onDishSelected(e,dishSelected){if(!dishSelected){return}
34const flyRect=app.flyToCart&&!dishSelected.forceRemoveDish&&app.flyToCart.startOf(dishSelected.dishPosId.split('_')[0],'.ddish__plus, .ddish__controls');PubSub.publish('recalcCart',{cartSwitchConfirmed:!1,changeAmount:{forceRemoveDish:dishSelected.forceRemoveDish,dishPosId:dishSelected.dishPosId,add:dishSelected.count,addWeight:dishSelected.addWeight},cb:function(response){PubSub.publish('gtmNotify',{event:'addToCart',cart:response.cart,dishSelected:dishSelected,});flyRect&&response.cart&&!response.error&&app.flyToCart(flyRect)}})}
35PubSub.subscribe('dishSelected',onDishSelected);const getPointDishPrice=(prices)=>{if(!prices){return null}
36return Object.values(prices).find((price)=>price&&price.isWithPoints&&price.pointDishMinSum)||null};const isPointDishBlocked=(prices)=>{const pointDishPrice=getPointDishPrice(prices);if(!pointDishPrice){return!1}
37const cart=app.store&&app.store.state&&app.store.state.cart;return((cart&&cart.amount&&cart.amount.pointDishRegularSum)||0)<pointDishPrice.pointDishMinSum};const getPointDishBlockedText=(prices)=>{const pointDishPrice=getPointDishPrice(prices);return(pointDishPrice&&pointDishPrice.pointDishBlockedText)||''};function createVueDish(dish){dish.classList.add('ddish--observed');const dishId=dish.dataset.id;const dishModifiers=dish.dataset.modifiers;const dishPrices=dish.dataset.prices;const dishParams=dish.dataset.params;const dishCombo=dish.dataset.combo;const orderScheduleStop=!!dish.dataset.orderScheduleStop;const orderScheduleLabel=dish.dataset.orderScheduleLabel||'';const section=dish.closest('.sect');const sectionModifiers=section&&section.dataset.modifiers;const discountEl=dish.querySelector('.ddish__badge--discount');const secondsDiscount=discountEl&&discountEl.dataset.seconds;if(secondsDiscount){discountEl.setAttribute('ref','lto')}
38if(!dishId){return}
39const favs=isMobile?Array.from(dish.querySelectorAll('.dishFav')):[];
39favs.forEach((fav)=>fav.remove());const vm=new Vue({components:{'dish-controls':app.dishControlsComponent,},data(){return{sectionModifiers,dish:{id:dishId,modifiers:dishModifiers?JSON.parse(dishModifiers):null,prices:dishPrices?JSON.parse(dishPrices):null,params:dishParams?JSON.parse(dishParams):null,},isLoading:!1}},computed:{...Vuex.mapState(['company','address']),},mounted(){this.$refs.dishPhotoRef&&this.$refs.dishPhotoRef.classList.add('lazyload');this.$refs.dishVideo&&app.lazyLoadVideo&&app.lazyLoadVideo(this.$refs.dishVideo);const lto=this.$refs.lto||(isMobile&&secondsDiscount&&this.$el.querySelector('.ddish__badge--discount'));lto&&PubSub.publish('initLto',lto)},methods:{onDishClick(e){const target=e.target;if(target.closest('.ddish:not(.ddish--stop)')){let plusClicked=target.closest('.ddish__plus');if(this.company&&this.company.isQrReadonly){plusClicked=!1}
40this.toCart({plusClicked:plusClicked});e.preventDefault()}},toCart(params){let forceAddress=''
41if(this.address&&this.address.warning){forceAddress='showUserAddress'}
42let restriction=dish.dataset.restriction||(section&&section.dataset.restriction);let restrictionConfirmed=params&&params.restrictionConfirmed;if(isPointDishBlocked(this.dish.prices)){PubSub.publish('showToast',{text:getPointDishBlockedText(this.dish.prices)});return}
43if(restriction&&!restrictionConfirmed){PubSub.publish('showRestriction',{text:restriction,cb:()=>{setTimeout(()=>{this.toCart({...params,restrictionConfirmed:!0})},500)}});return}
44let modifiers=this.dish.modifiers;if(!modifiers||modifiers.length===1){if(this.sectionModifiers){modifiers=(modifiers||[]).concat(JSON.parse(this.sectionModifiers))}}
45let photo=dish.querySelector('.ddish__photo')
46let ingredients=dish.querySelector('.ddish__ingredients');let price=dish.querySelector('.ddish__sum');let size=dish.querySelector('.ddish__size');if(modifiers){for(let i=0;i<modifiers.length;i++){let modifier=modifiers[i];if(modifier.options){for(let j=0;j<modifier.options.length;j++){let option=modifier.options[j];if(option.price_formatted){option.priceFormatted=option.price_formatted}
47if(option.size_formatted){option.sizeFormatted=option.size_formatted}
48modifiers[i].options[j]=option;modifiers[i].pos=i}}}}
49let navigateTopping=!0;if(params&&params.plusClicked){let requiredModifiers=(modifiers||[]).filter(function(modifier){return(modifier.required&&modifier.type!=='sizes')||modifier.min||(modifier.options&&modifier.options.find(option=>option.min))||(modifier.type==='sizes'&&modifier.options.length>1)});if(!requiredModifiers.length){navigateTopping=!1}}
50if(forceAddress){navigateTopping=!0}
51if(dishCombo&&this.company&&this.company.isUseCombo){navigateTopping=!0}
52if(orderScheduleStop){navigateTopping=!0}
53let prices=this.dish.prices;const isPartial=prices&&prices[0]&&prices[0].partialConfig;if(navigateTopping||isPartial){const nameEl=dish.querySelector('.ddish__name');const node=!isMobile&&Array.from(nameEl.childNodes).find((node)=>node.nodeType===Node.TEXT_NODE);const name=isMobile?nameEl.innerText:node&&node.textContent.trim();const dishData={id:this.dish.id,name:name||'',ingredients:ingredients?ingredients.dataset.full:'',nutrients:dish.dataset.nutrients?JSON.parse(dish.dataset.nutrients):'',prices:prices,media:dish.dataset.media?JSON.parse(dish.dataset.media):null,price:price?price.innerText:'',balance:dish.dataset.balance||'',size:size?size.innerText:'',params:this.dish.params,photo:{full:photo?photo.dataset.full:'/assets/company2/menu/i/bg.png',low:photo?photo.dataset.lowsrc:'/assets/company2/menu/i/bg.png',ratio:photo?photo.dataset.ratio:60},extraPhotos:photo&&photo.dataset.extraphotos?JSON.parse(photo.dataset.extraphotos):null,orderScheduleStop:orderScheduleStop,orderScheduleLabel:orderScheduleLabel};if(dishCombo&&this.company&&this.company.isUseCombo){dishData.combo={active:!0};PubSub.publish('showCombo',{dish:dishData,forceAddress:forceAddress,modifiers:modifiers})}else{PubSub.publish('showTopping',{dish:dishData,forceAddress:forceAddress,modifiers:modifiers})}}else{PubSub.publish('dishSelected',{dishPosId:this.dish.id+'_0',count:1})}},onDishSelected(e,dishSelected){const dishId=dishSelected.dishPosId.split('_')[0];if(dishId===this.dish.id){this.isLoading=!0;PubSub.publish('recalcCart',{cartSwitchConfirmed:!1,changeAmount:{forceRemoveDish:dishSelected.forceRemoveDish,dishPosId:dishSelected.dishPosId,add:dishSelected.count,addWeight:dishSelected.addWeight},cb:(response)=>{this.isLoading=!1;PubSub.publish('gtmNotify',{event:'addToCart',cart:response.cart,dishSelected:dishSelected})}})}},},store:app.store,el:dish});const photos=favs.length&&vm.$el.querySelector('.ddish__photos');
53photos&&favs.forEach((fav)=>photos.appendChild(fav));return vm}
54const findDishes=(root,selector)=>{const dishes=Array.from(root.querySelectorAll((isMobile?'.menu ':'')+selector));return isMobile?dishes.filter((dish)=>!dish.closest('.popProducts')):dishes};const dishes=findDishes(document,'.ddish:not(.ddish--observed)');if(!dishes.length&&!isMobile){return}
55const observer=new IntersectionObserver((entries,observer)=>{entries.forEach(entry=>{if(entry.isIntersecting){const dish=entry.target;createVueDish(dish);observer.unobserve(dish)}})},{threshold:0.1});const badges=[];dishes.forEach(dish=>{const badgeElements=dish.querySelectorAll('.ddish__badge:not(.ddish__badge--discount)');badgeElements.forEach(badge=>{const badgeName=badge.textContent.trim();if(badgeName&&!badges.includes(badgeName)){badges.push(badgeName)}});observer.observe(dish)});if(!isMobile){const filterList=badges.map(item=>({id:item,name:item,isSelected:!1,}));app.updateStore({filterList})}
56const hydrateDish=(target)=>{if(target.classList.contains('ddish--observed')){return target.__vue__}
57observer.unobserve(target);return createVueDish(target)};const observeDishes=(root)=>{findDishes(root,'.ddish:not(.ddish--observed)').forEach((dish)=>observer.observe(dish))};if(isMobile){app.hydrateMenuDish=hydrateDish;app.hydrateMenuDishes=observeDishes;PubSub.subscribe('menuSynced',()=>observeDishes(document))}
58function hydrateAndOpenDish(dishId,plusClicked){const target=findDishes(document,'.ddish[data-id="'+dishId+'"]')[0];if(!target){return}
59const vm=hydrateDish(target);if(vm){vm.$nextTick(()=>{setTimeout(()=>{window.scrollTo({top:vm.$el.getBoundingClientRect().top+window.scrollY-107,behavior:'smooth'})},0);vm.toCart({plusClicked:plusClicked})})}}
60PubSub.subscribe('hydrateDish',(e,params)=>{const dishId=params.id
61hydrateAndOpenDish(dishId,params.plusClicked||!1)});if(window.location.href.indexOf('#addToCart')){const match=window.location.href.match(/#addToCart-(\d+)/);if(match){hydrateAndOpenDish(match[1],!isMobile);window.history.replaceState(null,null,window.location.href.split('#')[0])}}});app.addModule(()=>{const sectionNavs=document.querySelectorAll('.sect__nav');sectionNavs.forEach((nav)=>{const parentSection=nav.closest('.sect');const subsectionsContainer=parentSection.querySelector('.sect__subsections');const subsectionButtons=nav.querySelectorAll('.sect__navButton');if(!subsectionsContainer){return}
62let activeSubsection=nav.querySelector('.sect__navButton--active');let activeSection=null;if(activeSubsection){const activeId=activeSubsection.getAttribute('data-id');activeSection=subsectionsContainer.querySelector(`.sect[data-id="${activeId}"]`)}
63subsectionButtons.forEach((button)=>{button.addEventListener('click',function(){if(this===activeSubsection){return}
64if(activeSubsection){activeSubsection.classList.remove('sect__navButton--active')}
65this.classList.add('sect__navButton--active');activeSubsection=this;const subsectionId=this.getAttribute('data-id');const newSection=subsectionsContainer.querySelector(`.sect[data-id="${subsectionId}"]`);if(!newSection){return}
66if(activeSection){const previousSection=activeSection;const currentHeight=subsectionsContainer.offsetHeight;subsectionsContainer.style.height=currentHeight+'px';subsectionsContainer.classList.add('sect__subsections--transitioning');previousSection.style.opacity='0';setTimeout(()=>{previousSection.classList.add('sect--hidden');previousSection.style.opacity='';newSection.classList.remove('sect--hidden');newSection.style.opacity='0';const newHeight=newSection.offsetHeight;subsectionsContainer.style.height=newHeight+'px';setTimeout(()=>{newSection.style.opacity='1';setTimeout(()=>{subsectionsContainer.style.height='';subsectionsContainer.classList.remove('sect__subsections--transitioning');newSection.style.opacity=''},300)},50)},300)}else{newSection.classList.remove('sect--hidden')}
67activeSection=newSection})})})});const videoPlay=(video,flag)=>{if(flag){video.play();return}
68video.pause();video.currentTime=0};if('IntersectionObserver' in window){const videoObserver=new IntersectionObserver((entries,observer)=>
68{entries.forEach((entry)=>{if(!entry.isIntersecting){return}
69const video=entry.target;const videoSrc=video.getAttribute('data-src');video.src=videoSrc;video.load();observer.unobserve(video);video.addEventListener('canplaythrough',()=>{video.classList.add('ddish__video--loaded');video.addEventListener('mouseenter',(event)=>{videoPlay(event.target,!0)});video.addEventListener('mouseleave',(event)=>{videoPlay(event.target,!1)})})})},{rootMargin:'300px',});app.lazyLoadVideo=(video)=>{videoObserver.observe(video)}}else{app.lazyLoadVideo=(video)=>{video.src=video.getAttribute('data-src');video.load()}};app.addModule(()=>{PubSub.subscribe('syncMenu',()=>{app.fetch(window.location.href.split('?')[0]+'?needJsonMenu',{},(response)=>{if(!response.error){const div=document.createElement('div');div.innerHTML=response.html;const promoLimitedSection=div.querySelector('.sect--promoLimited')
70if(promoLimitedSection){document.querySelector('.sect--promoLimited').innerHTML=promoLimitedSection.innerHTML}
71PubSub.publish('menuSynced')}})})});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.