PageSourceSearch

https://iampho.ru/var/cache/asset20_df45a8d041207810eade76d0a1e3bf2f.js

js iampho.ru collected 2026-10-07 18:09:46 UTC 14,802 bytes, 163 lines download raw bytes

1app.gDeliveryTypesComponent={props:['types','currentType','deliveryTime','isHighDelivery'],computed:{...Vuex.mapState(['loc']),typesHashMap(){return this.types.reduce((acc,type,idx)=>{acc[type.id]=idx;return acc},{})},indicatorStyle(){return{transform:`translateX(${this.typesHashMap[this.currentType] * 100}%)`}},isSingleType(){return this.types.length===1},},methods:{setType(type){this.$emit('setType',type)},},template:`
2        <div class="gDelivery__types" :class="{'gDelivery__types--single': isSingleType}">
3            <div class="gDelivery__indicator" :style="indicatorStyle"></div>
4
5            <button v-for="item of types"
6                    :key="item.id"
7                    :disabled="item.id === currentType"
8                    class="gDelivery__type"
9                    :class="{'gDelivery__type--active': item.id === currentType}"
10                    type="button"
11                    @click="setType(item.id)">
12                <span class="gDelivery__typeName">
13                    {{ isSingleType ? item.singleName : item.name }}
14                </span>
15                <span v-if="item.id === 'delivery' && deliveryTime"
16                      class="gDelivery__typeTime"
17                      :class="{'gDelivery__typeTime--high': isHighDelivery}">
18                    <svg v-if="isHighDelivery"
19                         class="gDelivery__typeTimeBolt"
20                         width="7" height="14" viewBox="0 0 7 14" fill="none" xmlns="http://www.w3.org/2000/svg">
21                        <path fill-rule="evenodd" clip-rule="evenodd" d="M2.24998 0C2.14179 0 2.03653 0.0446554 1.94998 0.127263C1.86343 0.209872 1.80027 0.325976 1.76998 0.458148L0.0199998 8.09396C-0.00173424 8.18879 -0.00582042 8.28876 0.00806497 8.38595C0.0219504 8.48314 0.0534259 8.57489 0.0999989 8.65391C0.146572 8.73294 0.206963 8.79708 0.27639 8.84126C0.345817 8.88544 0.422373 8.90844 0.499995 8.90844H2.43347L2.00348 13.2838C1.98931 13.4261 2.01339 13.5704 2.07178 13.6932C2.13018 13.816 2.21947 13.91 2.32516 13.9601C2.43086 14.0101 2.54673 14.0132 2.65399 13.9689C2.76124 13.9245 2.85356 13.8354 2.91597 13.7158L6.91593 6.08001C6.96617 5.98418 6.99502 5.87279 6.99941 5.75773C7.0038 5.64266 6.98357 5.52824 6.94086 5.42666C6.89816 5.32509 6.83459 5.24017 6.75693 5.18097C6.67928 5.12178 6.59045 5.09052 6.49993 5.09054H4.72145L5.96794 0.859665C5.99629 0.763415 6.00589 0.659857 5.99593 0.557852C5.98597 0.455847 5.95674 0.358431 5.91075 0.273938C5.86475 0.189445 5.80335 0.120392 5.73181 0.0726849C5.66027 0.0249782 5.58071 3.85906e-05 5.49994 0H2.24998Z" fill="currentColor"/>
22                    </svg>
23                    <svg v-else width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg">
24                        <path d="M11 6C11 8.76 8.76 11 6 11C3.24 11 1 8.76 1 6C1 3.24 3.24 1 6 1C8.76 1 11 3.24 11 6Z" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
25                        <path d="M7.85494 7.58988L6.30494 6.66488C6.03494 6.50488 5.81494 6.11988 5.81494 5.80488V3.75488" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" stroke-linejoin="round"/>
26                    </svg>
27                    {{ deliveryTime }}
28                </span>
29                <div class="gDelivery__hint">
30                    <div class="gDelivery__hintTitle">
31                        <svg width="8" height="16" viewBox="0 0 8 16" fill="none" xmlns="http://www.w3.org/2000/svg">
32                            <path fill-rule="evenodd" clip-rule="evenodd" d="M2.5714 0C2.44776 0 2.32746 0.0510348 2.22855 0.145444C2.12964 0.239853 2.05745 0.372543 2.02284 0.523598L0.022857 9.25023C-0.00198199 9.35862 -0.00665191 9.47287 0.00921711 9.58394C0.0250861 9.69502 0.0610581 9.79987 0.114284 9.89019C0.167511 9.9805 0.23653 10.0538 0.315875 10.1043C0.39522 10.1548 0.482712 10.1811 0.571423 10.1811H2.78111L2.28969 15.1814C2.2735 15.3442 2.30101 15.5091 2.36775 15.6494C2.43449 15.7897 2.53654 15.8972 2.65733 15.9544C2.77812 16.0115 2.91055 16.0151 3.03313 15.9644C3.1557 15.9138 3.26122 15.8118 3.33254 15.6752L7.90392 6.94858C7.96133 6.83906 7.99431 6.71176 7.99933 6.58026C8.00435 6.44876 7.98122 6.31799 7.93242 6.2019C7.88361 6.08581 7.81096 5.98877 7.72221 5.92111C7.63346 5.85346 7.53194 5.81774 7.42849 5.81776H5.39594L6.8205 0.982474C6.8529 0.872474 6.86388 0.754123 6.85249 0.637545C6.84111 0.520968 6.80771 0.409635 6.75514 0.313072C6.70257 0.216509 6.6324 0.13759 6.55064 0.0830684C6.46888 0.0285465 6.37795 4.41035e-05 6.28565 0H2.5714Z" fill="white"/>
33                        </svg>
34                        {{ loc['highDelivery/hint/title'] }}
35                    </div>
36                    <div class="gDelivery__hintText">{{ loc['highDelivery/hint/text'] }}</div>
37                </div>
38            </button>
39        </div>
40    `,};app.gDeliveryPreorderComponent={components:{cartPreorder:app.cartPreorderComponent,},props:['address','company'],data(){return{isOpen:!1,submitting:!1,snapshot:null,}},computed:{...Vuex.mapState(['cart','loc']),hasCart(){return Boolean(this.cart&&this.cart.timeframe)},buttonLabel(){const tf=this.cart&&this.cart.timeframe;const day=tf&&tf.activeDay&&tf.activeDay.name;const time=tf&&tf.activeTime&&tf.activeTime.name;if(day&&time){return day+', '+time}
41if(day){return day}
42return this.loc['gDelivery/preorder/placeholder']},canApply(){const tf=this.cart&&this.cart.timeframe;return Boolean(tf&&tf.activeDay&&tf.activeDay.id&&tf.activeTime&&tf.activeTime.id)},}
42,methods:{toggle(){if(this.submitting){return}
43if(this.isOpen){this.close();return}
44this.open()},open(){if(!this.hasCart){return}
45this.snapshot={activeType:this.cart.timeframe.activeType,activeDay:this.cart.timeframe.activeDay?{...this.cart.timeframe.activeDay}:null,activeTime:this.cart.timeframe.activeTime?{...this.cart.timeframe.activeTime}:null,};this.cart.timeframe.activeType='preorder';this.isOpen=!0},close(){if(this.snapshot&&this.hasCart){this.cart.timeframe.activeType=this.snapshot.activeType;this.cart.timeframe.activeDay=this.snapshot.activeDay;this.cart.timeframe.activeTime=this.snapshot.activeTime}
46this.snapshot=null;this.isOpen=!1},onInnerNavigate(){},getFormData(){if(!this.cart){return null}
47const formData=JSON.parse(JSON.stringify(this.cart));if(formData.timeframe){delete formData.timeframe.daysPreorder;delete formData.timeframe.needPreorderMessage;delete formData.timeframe.types}
48return formData},apply(){if(this.submitting||!this.canApply){return}
49this.submitting=!0;this.snapshot=null;PubSub.publish('recalcCart',{noTimeout:!0,formData:this.getFormData(),cb:(response)=>{if(response&&response.error){this.submitting=!1;return}
50window.location.reload()},})},onDocClick(event){if(!this.isOpen){return}
51if(this.$el.contains(event.target)){return}
52this.close()},},mounted(){document.addEventListener('click',this.onDocClick)},beforeDestroy(){document.removeEventListener('click',this.onDocClick)},template:`
53<div class="gDelivery__preorder"
54     :class="{'gDelivery__preorder--open': isOpen}">
55
56    <button type="button"
57            class="gDelivery__preorderButton"
58            @click="toggle">
59
60        <svg class="gDelivery__preorderIcon" width="14" height="14" viewBox="0 0 14 14" fill="none">
61            <path d="M13 7A6 6 0 1 1 1 7a6 6 0 0 1 12 0Z"
62                  stroke="currentColor" stroke-width="1.4"/>
63            <path d="M9 8.5L7 7.5V3.5"
64                  stroke="currentColor" stroke-width="1.4" stroke-linecap="round"/>
65        </svg>
66
67        <span class="gDelivery__preorderLabel">{{ buttonLabel }}</span>
68
69        <svg class="gDelivery__preorderArr" width="8" height="13" viewBox="0 0 8 13" fill="none">
70            <path d="M2 2L6 6.5L2 11"
71                  stroke="currentColor" stroke-width="2.55785" stroke-linecap="round"/>
72        </svg>
73    </button>
74
75    <div v-if="isOpen"
76         class="gDelivery__preorderPopover"
77         @click.stop>
78
79        <cart-preorder
80            v-if="hasCart"
81            :cart="cart"
82            :loc="loc"
83            :address="address"
84            :company="company"
85            @navigate="onInnerNavigate"/>
86
87        <button type="button"
88                class="gDelivery__preorderApply"
89                :disabled="!canApply || submitting"
90                @click="apply">
91            {{ loc['gDelivery/preorder/apply'] }}
92        </button>
93    </div>
94</div>
95    `};app.addModule(()=>{new Vue({components:{deliveryTypes:app.gDeliveryTypesComponent,gDeliveryPreorder:app.gDeliveryPreorderComponent,},data(){return{menuSwitchConfirmed:!1,highDemandTippy:null,}},computed:{...Vuex.mapState(['address','company','loc','forcePickupFirstRestaurant','restaurants','useExpressDelivery']),preorderEnabled(){return!!(this.company&&this.company.isPreorderTimeOnMain)},types(){return[this.company.enabledDeliveryTypes.courier&&{id:'delivery',name:this.loc['cart/delivery'],singleName:this.loc['cart/onlyDelivery']},this.company.enabledDeliveryTypes.courier&&this.useExpressDelivery&&{id:'express',name:'Express',singleName:'Express'},this.company.enabledDeliveryTypes.pickup&&{id:'pickup',name:this.loc['cart/pickup'],singleName:this.loc['cart/onlyPickup']},this.company.enabledDeliveryTypes.inside&&{id:'inside',name:this.loc['cart/inside']},this.company.enabledDeliveryTypes.drive&&{id:'drive',name:this.loc['cart/drive'],},this.company.enabledDeliveryTypes.banquet&&{id:'banquet',name:this.loc['cart/banquet'],}].filter(Boolean)},isAllTypes(){return this.types.length>=4},currentType(){let currentType=this.address.type;if(currentType==='delivery'&&this.useExpressDelivery&&this.address.isExpress){currentType='express'}
96return currentType},typeAddress(){const type=app.isPointDeliveryType(this.currentType)?'pickup':this.currentType;return this.address[type==='express'?'delivery':type]},label(){const address=this.typeAddress;if(!address){const slug=this.currentType==='express'?'delivery':this.currentType;return this.loc['address2/title/'+slug]}
97if(this.currentType!=='delivery'&&this.currentType!=='express'){return address.name}
98return[address.city,address.district,address.street&&address.street.replace('улица','ул.').replace('проезд ','пр-д ').replace(' проезд',' пр-д').replace('переулок','пер.').replace('набережная','наб.').replace('площадь','пл.').replace('шоссе','ш.').replace('проспект','пр-т'),address.house].filter(
98Boolean).join(', ')},isHighDelivery(){if(this.address&&this.address.delivery&&this.address.delivery.currentZone){return this.address.delivery.currentZone.highDemand&&this.address.delivery.currentZone.highDemand.isActive}
99return!1},deliveryTime(){if(this.address&&this.address.delivery&&this.address.delivery.currentZone){const zone=this.address.delivery.currentZone;return zone.highDemand&&zone.highDemand.isActive?zone.highDemand.deliveryTime:zone.deliveryTime}
100return null}},methods:{changeAddress(){let _this=this;let payload={address:this.address,menuSwitchConfirmed:this.menuSwitchConfirmed,meta:{company:this.company.id}};app.fetch('/address/change',payload,function(response){if(response.error){if(response.error==='confirmMenuSwitch'){if(window.confirm(response.message)){_this.menuSwitchConfirmed=!0;_this.changeAddress()}else{_this.address.type='delivery';_this.loading=!1}
101return}
102app.alert(response.message,'danger');_this.loading=!1}else if(response.reload||response.cityUrl){if(response.cityUrl){window.location.assign(response.cityUrl)}else{window.location.reload()}}else{window.location.reload()}})},setType(currentType){const type=typeof currentType==='string'?currentType:this.currentType;if(this.forcePickupFirstRestaurant&&type==='pickup'&&type!==this.currentType){if(this.restaurants[0]){let address=this.address;address.type='pickup';address.pickup=this.restaurants[0];address.delayed=!1;app.updateStore({address:address,});this.changeAddress();return}}
103PubSub.publish('showUserAddress',{type,forceReload:this.address.warning})}},store:app.store,template:`
104        
105    <transition name="gDelivery__fade" mode="out-in">
106         <div v-if="address" 
107             key="0" 
108             class="gDelivery__container"
109             :class="{'gDelivery__types--all': isAllTypes}">
110
111            <deliveryTypes
112                :types="types"
113                :currentType="currentType"
114                :deliveryTime="deliveryTime"
115                :isHighDelivery="isHighDelivery"
116                @setType="setType">
117            </deliveryTypes>
118
119            <div class="gDelivery__addressGroup">
120
121                <button type="button"
122                        class="gDelivery__address addressWave"
123                        :class="{
124                            'gDelivery__address--withPreorder': preorderEnabled,
125                            'addressWave--active': !typeAddress
126                        }"
127                        @click="setType">
128
129                        <svg class="gDelivery__marker" width="11" height="17" viewBox="0 0 11 17" fill="currentColor">
130                            <path d="M8.71576 11.2694C8.91355 11.0013 9.25731 10.9195 9.48333 11.0868C9.70917 11.2541 9.73178 11.6068 9.53412 11.8749L5.95306 16.7304C5.75526 16.9985 5.41151 17.0803 5.18548 16.913C4.95952 16.7457 4.93692 16.393 5.1347 16.1249L8.71576 11.2694Z" fill="url(#paint0_linear_1802_153302)" fill-opacity="0.5"/>
131                            <path d="M5.5 0C8.53757 0 11 2.46253 11 5.5C10.9999 8.36878 8.80311 10.7229 6 10.9756V16.5C6 16.7761 5.77614 17 5.5 17C5.22386 17 5 16.7761 5 16.5V10.9756C2.19689 10.7229 9.27374e-05 8.36878 0 5.5C0 2.46253 2.46243 0 5.5 0ZM5.5 4C4.67157 4 4 4.67157 4 5.5C4 6.32843 4.67157 7 5.5 7C6.32843 7 7 6.32843 7 5.5C7 4.67157 6.32843 4 5.5 4Z" fill="#0F0F0F"/>
132                            <defs>
133                            <linearGradient id="paint0_linear_1802_153302" x1="5.51001" y1="16.442" x2="8.36649" y2="12.6947" gradientUnits="userSpaceOnUse">
134                            <stop/>
135                            <stop offset="1" stop-opacity="0"/>
136                            </linearGradient>
137                            </defs>
138                        </svg>
139
140
141                    <span class="addressWave__label">{{ label }}</span>
142
143
144                    <svg v-if="!preorderEnabled"
145                         class="gDelivery__arr" width="8" height="13" fill="none" viewBox="0 0 8 13">
146                        <path d="M2 2L6 6.5L2 11" stroke="currentColor" stroke-width="2.55785" stroke-linecap="round"/>
147                    </svg>
148
149
150                </button>
151
152                <gDeliveryPreorder
153                    v-if="preorderEnabled"
154                    :address="address"
155                    :company="company"/>
156
157            </div>
158
159        </div>
160        <div v-else key="1" class="gDelivery__container"></div>
161    </transition>
162        
163        `}).$mount('#gDelivery')});

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.