1"use strict";(self.webpackChunksalesboxclient=self.webpackChunksalesboxclient||[]).push([[260],{4296:(Ne,$,d)=>{d.d($,{_:()=>j});var A=d(4968),P=d(8675),e=d(3025),y=d(3239),u=d(8372),_=d(4004),M=d(4650);let j=(()=>{class T{constructor(){this.isTablet$=(0,A.R)(window,"resize").pipe((0,P.O)(window),(0,e.h)(window),(0,y.p)(500),(0,u.b)(500),(0,_.U)(E=>E.innerWidth<1024))}}return T.\u0275fac=function(E){return new(E||T)},T.\u0275prov=M.\u0275\u0275defineInjectable({token:T,factory:T.\u0275fac}),T})()},5260:(Ne,$,d)=>{d.r($),d.d($,{MOMENT_DATETIME_WITH_SECONDS_FORMAT:()=>Ze,OrderModule:()=>Vr});var A=d(3267),P=d(2600),e=d(4650),y=d(7579),u=d(2722),_=d(8372),M=d(6608),h=d(8407);d(7147);var E=d(9444),c=d(4006);function ht(i,o){this.lat=i,this.lng=o}function De(i){this.points=i||[],this.length=i.length}De.prototype.area=function(){var o,t,n,r,i=0;for(o=0,t=this.length-1;o<this.length;t=o,o+=1)i+=(n=this.points[o]).lat*(r=this.points[t]).lng,i-=n.lng*r.lat;return i/2},De.prototype.centroid=function(){var t,n,r,a,s,i=0,o=0;for(t=0,n=this.length-1;t<this.length;n=t,t+=1)i+=((a=this.points[t]).lat+(s=this.points[n]).lat)*(r=a.lat*s.lng-s.lat*a.lng),o+=(a.lng+s.lng)*r;return new ht(i/(r=6*this.area()),o/r)};const je=De;var B=d(6981),K=d(2715),S=d(9383),C=d(6895),Q=d(6323),Ue=d(4737),b=d(9549),R=d(4144),ie=d(7957),Pe=d(3238);class w{static mapToArray(o){const t=[];for(const n in o)o.hasOwnProperty(n)&&t.push(o[n]);return t}static handleEvent(o,t,n){0<t.observers.length&&o.run(()=>{t.emit(n)})}}let ut=(()=>{class i{constructor(t,n){this.element=t,this.zone=n,this.DEFAULT_ZOOM=1,this.DEFAULT_CENTER=(0,h.latLng)(38.907192,-77.036871),this.DEFAULT_FPZ_OPTIONS={},this.fitBoundsOptions=this.DEFAULT_FPZ_OPTIONS,this.panOptions=this.DEFAULT_FPZ_OPTIONS,this.zoomOptions=this.DEFAULT_FPZ_OPTIONS,this.zoomPanOptions=this.DEFAULT_FPZ_OPTIONS,this.options={},this.mapReady=new e.EventEmitter,this.zoomChange=new e.EventEmitter,this.centerChange=new e.EventEmitter,this.onClick=new e.EventEmitter,this.onDoubleClick=new e.EventEmitter,this.onMouseDown=new e.EventEmitter,this.onMouseUp=new e.EventEmitter,this.onMouseMove=new e.EventEmitter,this.onMouseOver=new e.EventEmitter,this.onMouseOut=new e.EventEmitter,this.onMapMove=new e.EventEmitter,this.onMapMoveStart=new e.EventEmitter,this.onMapMoveEnd=new e.EventEmitter,this.onMapZoom=new e.EventEmitter,this.onMapZoomStart=new e.EventEmitter,this.onMapZoomEnd=new e.EventEmitter}ngOnInit(){this.zone.runOutsideAngular(()=>{this.map=(0,h.map)(this.element.nativeElement,this.options),this.addMapEventListeners()}),null!=this.center&&null!=this.zoom&&this.setView(this.center,this.zoom),null!=this.fitBounds&&this.setFitBounds(this.fitBounds),null!=this.maxBounds&&this.setMaxBounds(this.maxBounds),null!=this.minZoom&&this.setMinZoom(this.minZoom),null!=this.maxZoom&&this.setMaxZoom(this.maxZoom),this.doResize(),this.mapReady.emit(this.map)}ngOnChanges(t){t.zoom&&t.center&&null!=this.zoom&&null!=this.center?this.setView(t.center.currentValue,t.zoom.currentValue):t.zoom?this.setZoom(t.zoom.currentValue):t.center&&this.setCenter(t.center.currentValue),t.fitBounds&&this.setFitBounds(t.fitBounds.currentValue),t.maxBounds&&this.setMaxBounds(t.maxBounds.currentValue),t.minZoom&&this.setMinZoom(t.minZoom.currentValue),t.maxZoom&&this.setMaxZoom(t.maxZoom.currentValue)}ngOnDestroy(){null!=this.map&&this.map.remove()}getMap(){return this.map}onResize(){this.delayResize()}addMapEventListeners(){const t=(r,a)=>{this.map.on(r,a)};t("click",r=>w.handleEvent(this.zone,this.onClick,r)),t("dblclick",r=>w.handleEvent(this.zone,this.onDoubleClick,r)),t("mousedown",r=>w.handleEvent(this.zone,this.onMouseDown,r)),t("mouseup",r=>w.handleEvent(this.zone,this.onMouseUp,r)),t("mouseover",r=>w.handleEvent(this.zone,this.onMouseOver,r)),t("mouseout",r=>w.handleEvent(this.zone,this.onMouseOut,r)),t("mousemove",r=>w.handleEvent(this.zone,this.onMouseMove,r)),t("zoomstart",r=>w.handleEvent(this.zone,this.onMapZoomStart,r)),t("zoom",r=>w.handleEvent(this.zone,this.onMapZoom,r)),t("zoomend",r=>w.handleEvent(this.zone,this.onMapZoomEnd,r)),t("movestart",r=>w.handleEvent(this.zone,this.onMapMoveStart,r)),t("move",r=>w.handleEvent(this.zone,this.onMapMove,r)),t("moveend",r=>w.handleEvent(this.zone,this.onMapMoveEnd,r));const n=()=>{const r=this.map.getZoom();r!==this.zoom&&(this.zoom=r,w.handleEvent(this.zone,this.zoomChange,r));const a=this.map.getCenter();(null!=a||null!=this.center)&&((null==a||null==this.center)&&a!==this.center||a.lat!==this.center.lat||a.lng!==this.center.lng)&&(this.center=a,w.handleEvent(this.zone,this.centerChange,a))};t("moveend",n),t("zoomend",n)}doResize(){this.zone.runOutsideAngular(()=>{null!=this.map&&this.map.invalidateSize({})})}delayResize(){null!=this.resizeTimer&&clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(this.doResize.bind(this),200)}
1setView(t,n){null!=this.map&&null!=t&&null!=n&&this.map.setView(t,n,this.zoomPanOptions)}setZoom(t){null!=this.map&&null!=t&&this.map.setZoom(t,this.zoomOptions)}setCenter(t){null!=this.map&&null!=t&&this.map.panTo(t,this.panOptions)}setFitBounds(t){null!=this.map&&null!=t&&this.map.fitBounds(t,this.fitBoundsOptions)}setMaxBounds(t){null!=this.map&&null!=t&&this.map.setMaxBounds(t)}setMinZoom(t){null!=this.map&&null!=t&&this.map.setMinZoom(t)}setMaxZoom(t){null!=this.map&&null!=t&&this.map.setMaxZoom(t)}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(e.ElementRef),e.\u0275\u0275directiveInject(e.NgZone))},i.\u0275dir=e.\u0275\u0275defineDirective({type:i,selectors:[["","leaflet",""]],hostBindings:function(t,n){1&t&&e.\u0275\u0275listener("resize",function(){return n.onResize()},!1,e.\u0275\u0275resolveWindow)},inputs:{fitBoundsOptions:["leafletFitBoundsOptions","fitBoundsOptions"],panOptions:["leafletPanOptions","panOptions"],zoomOptions:["leafletZoomOptions","zoomOptions"],zoomPanOptions:["leafletZoomPanOptions","zoomPanOptions"],options:["leafletOptions","options"],zoom:["leafletZoom","zoom"],center:["leafletCenter","center"],fitBounds:["leafletFitBounds","fitBounds"],maxBounds:["leafletMaxBounds","maxBounds"],minZoom:["leafletMinZoom","minZoom"],maxZoom:["leafletMaxZoom","maxZoom"]},outputs:{mapReady:"leafletMapReady",zoomChange:"leafletZoomChange",centerChange:"leafletCenterChange",onClick:"leafletClick",onDoubleClick:"leafletDoubleClick",onMouseDown:"leafletMouseDown",onMouseUp:"leafletMouseUp",onMouseMove:"leafletMouseMove",onMouseOver:"leafletMouseOver",onMouseOut:"leafletMouseOut",onMapMove:"leafletMapMove",onMapMoveStart:"leafletMapMoveStart",onMapMoveEnd:"leafletMapMoveEnd",onMapZoom:"leafletMapZoom",onMapZoomStart:"leafletMapZoomStart",onMapZoomEnd:"leafletMapZoomEnd"},features:[e.\u0275\u0275NgOnChangesFeature]}),i})(),_t=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.\u0275\u0275defineNgModule({type:i}),i.\u0275inj=e.\u0275\u0275defineInjector({}),i})();var re=d(6203);const ft=["drawer"];function vt(i,o){1&i&&(e.\u0275\u0275elementStart(0,"div",22),e.\u0275\u0275element(1,"i-feather",23)(2,"p",24),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("innerText",e.\u0275\u0275pipeBind1(3,1,"order.accurateDeliverySearchHint")))}function yt(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"mat-option",26),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&i){const t=o.$implicit;e.\u0275\u0275property("value",null==t?null:t.properties.place_id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",null==t?null:t.name," ")}}function Ct(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,yt,2,2,"mat-option",25),e.\u0275\u0275elementContainerEnd()),2&i){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.placesList)}}function xt(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-option",27),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"deliveryForm.notFoundSearch")," "))}function Mt(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"i-feather",28),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(r.clearSearchField())}),e.\u0275\u0275elementEnd()}}function bt(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",38)(1,"div",39),e.\u0275\u0275element(2,"i-feather",40),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"div",41),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd()()),2&i){const t=e.\u0275\u0275nextContext().$implicit,n=e.\u0275\u0275nextContext();e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",n.secondsToHours(t.deliveryTime.min)+"-"+n.secondsToHours(t.deliveryTime.max)," ")}}function wt(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",42)(2,"div",43),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementStart(5,"span",44),e.\u0275\u0275text(6),e.\u0275\u0275pipe(7,"price"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementContainerEnd()),2&i){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(4,2,"deliveryZones.mainDelivery")," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(7,4,t.defaultPriceFormationFromAmount)," ")}}function Ot(i,o){1&i&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1,","),e.\u0275\u0275elementEnd())}function St(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"span",44),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"price"),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275pipe(5,"price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(6,Ot,2,0,"span",34),e.\u0275\u0275elementContainerEnd()),2&i){const t=o.$implicit,n=o.last;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate3(" ",e.\u0275\u0275pipeBind1(3,4,t.cost)," ",e.\u0275\u0275pipeBind1(4,6,"deliveryZones.orderFrom")," ",e.\u0275\u0275pipeBind1(5,8,t.sum),""),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",!n)}}function Dt(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",42)(1,"div",43),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275template(4,St,7,10,"ng-container",45),e.\u0275\u0275elementEnd()()),2&i){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(3,2,"deliveryZones.delivery")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",t.listPriceFormationFromAmount)}}function Pt(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",46)(1,"div",47),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",48),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275pipe(7,"price"),e.\u0275\u0275elementEnd()()),2&i){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(3,3,"deliveryZones.freeDelivery")," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate2(" ",e.\u0275\u0275pipeBind1(6,5,"deliveryZones.from")," ",e.\u0275\u0275pipeBind1(7,7,t.freeDeliveryFrom)," ")}}function It(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",49)(1,"div",50),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(4,"div",51),e.\u0275\u0275elementEnd()),2&i){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(3,2,"deliveryZones.schedule"),": "),e.\u0275\u0275advance(2),e.\u0275\u0275property("innerHTML",t.workSchedule,e.\u0275\u0275sanitizeHtml)}}function Et(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",49)(1,"div",50),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",52),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd()()),2&i){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(3,2,"deliveryZones.description"),": "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",t.description," ")}}const Lt=function(i){return{backgroundColor:i}};function Tt(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",29)(1,"div",30),e.\u0275\u0275element(2,"div",31),e.\u0275\u0275elementStart(3,"div",32),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(5,bt,5,1,"div",33),e.\u0275\u0275template(6,wt,8,6,"ng-container",34),e.\u0275\u0275template(7,Dt,5,4,"div",35),e.\u0275\u0275template(8,Pt,8,9,"div",36),e.\u0275\u0275template(9,It,5,4,"div",37),e.\u0275\u0275template(10,Et,6,4,"div",37),e.\u0275\u0275elementEnd()),2&i){const t=o.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(8,Lt,null==t||null==t.options?null:t.options.fillColor)),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.name),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.deliveryTime&&(t.deliveryTime.min>0||t.deliveryTime.min>0)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.defaultPriceFormationFromAmount),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.listPriceFormationFromAmount.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.freeDeliveryFrom),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.workSchedules.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.description)}}function kt(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",53),e.\u0275\u0275listener("leafletMapReady",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();
1return e.\u0275\u0275resetView(a.leafletMapReady(r))})("leafletClick",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();return a.addMarker(r),e.\u0275\u0275resetView(a.showField())}),e.\u0275\u0275elementEnd()}if(2&i){const t=e.\u0275\u0275nextContext();e.\u0275\u0275property("leafletOptions",t.leafletOptions)}}const Ft=["*"];let zt=(()=>{class i{constructor(t,n,r,a){this.amSnackbarService=t,this.translateService=n,this.appService=r,this.iconRegistry=a,this.polygonArray=[],this.workSchedule="",this.calculateDeliveryPrice=new e.EventEmitter,this.leafletOptions=null,this.leafletMarker=null,this.leafletPolygons=[],this.leafletGeocoder=h.Control.Geocoder.nominatim(),this.placeSearchControl=new c.NI(""),this.mappedPolygonArray=[],this.placesList=[],this.isShowInfoSidebar=!0,this.destroy$=new y.x,this.showAddressHint=(0,B.Rs)(),this.iconRegistry.registerIcons([M.ig,M.Df]),function T(i){!function Se(i){i.Polyline.prototype.contains=function(o){let n;return!!this.getBounds().contains(o)&&(n=this.getWindingNumber(o),0!==n)},i.LatLng.prototype.isLeft=function(o,t){return(o.lng-this.lng)*(t.lat-this.lat)-(t.lng-this.lng)*(o.lat-this.lat)},i.Polyline.prototype.getWindingNumber=function(o){let t,n,r,a,s;for(a=this.getLatLngs(),a=function m(g){let f;return f=(Array.isArray?Array.isArray(g):i.Util.isArray(g))?g.reduce(function(D,N,pe,ce){return D.concat(Array.isArray(N)?m(N):N)},[]):g,f}(a),a=a.filter(function(g,f,D){return!(f>0&&g.lat===D[f-1].lat&&g.lng===D[f-1].lng)}),r=a.length,r>0&&!(a[r-1].lat===a[0].lat&&a[r-1].lng===a[0].lng)&&a.push(a[0]),r=a.length-1,s=0,t=0;t<r;t++){if(n=a[t].isLeft(a[t+1],o),0===n){s=1;break}0!==n?a[t].lat<=o.lat?a[t+1].lat>o.lat&&n>0&&s++:a[t+1].lat<=o.lat&&n<0&&s--:s++}return s}}(i)}(h)}ngOnInit(){this.mainCurrency=this.appService.currencySymbols[this.appService.config.config.info.mainCurrency
1],this.mapPolygons(),this.initLeafletMap(),this.emitDeliveryResult(),this.initSubs()}ngAfterViewInit(){this.matDrawer._animationEnd.pipe((0,u.R)(this.destroy$)).subscribe(()=>{this.leafletMap&&this.leafletMap.invalidateSize()})}ngOnDestroy(){this.destroy$.complete(),this.destroy$.next()}initSubs(){this.placeSearchControl.valueChanges.pipe((0,u.R)(this.destroy$),(0,_.b)(400)).subscribe(t=>{!t||this.getPlacesList(t)})}mapPolygons(){this.polygonArray.forEach(t=>{const n={...t,options:{fillColor:"#"+t.color.slice(2),fillOpacity:.5}};this.mappedPolygonArray.push(n),this.initLeafletPolygons(n)})}initLeafletMap(){if(this.leafletMarker=this.getMarker({lat:0,lng:0}),!this.mappedPolygonArray[0]?.coordinates[0]?.lat||!this.mappedPolygonArray[0]?.coordinates[0]?.lng)return this.leafletOptions={layers:this.getLayers(),zoom:12,zoomControl:!1,center:new h.LatLng(49.231729099999995,28.467881366881038)},void this.getCurrentLocation();const t=new je(this.mappedPolygonArray[0]?.coordinates)?.centroid();let n={lat:0,lng:0};n=t?{...t}:{lat:this.mappedPolygonArray[0]?.coordinates[0].lat,lng:this.mappedPolygonArray[0]?.coordinates[0].lng},this.leafletOptions={layers:this.getLayers(),zoom:12,zoomControl:!1,center:new h.LatLng(n.lat,n.lng)}}leafletMapReady(t){setTimeout(()=>{t.invalidateSize(),t.addControl(h.control.zoom({position:"bottomright"})),this.leafletMap=t},0)}getLayers(){return[new h.TileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",{attribution:'© <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',maxZoom:19,minZoom:11,detectRetina:!0}),...this.leafletPolygons,this.leafletMarker]}getMarker({lat:t,lng:n}=this.marker.position){return new h.Marker(new h.LatLng(t,n),{icon:new h.Icon({iconUrl:"/assets/img/marker.svg",iconSize:[40,40],iconAnchor:[20,40],popupAnchor:[0,-40]})})}setMarkerOnTheMap(t,n,r=!0){this.marker={position:{lat:t,lng:n}},this.leafletMap&&(this.leafletMap.removeLayer(this.leafletMarker),this.leafletMap.setZoomAround(new h.LatLng(t,n),17),this.leafletMarker=this.getMarker().addTo(this.leafletMap),this.leafletMap.panTo(new h.LatLng(this.marker.position.lat,this.marker.position.lng),{animate:!0})),this.isPointInsidePolygon(this.marker.position,r)}addMarker(t){[...t?.originalEvent?.target.classList].includes("leaflet-marker-icon")||t.latlng&&(this.markerCoordinates=t,this.setMarkerOnTheMap(t.latlng.lat,t.latlng.lng))}initLeafletPolygons(t){const n=new h.Polygon(t.coordinates.map(r=>new h.LatLng(r.lat,r.lng)),{fillColor:t.options.fillColor,fill:!0,fillOpacity:t.options.fillOpacity});this.leafletPolygons.push(n)}isPointInsidePolygon({lat:t,lng:n},r=!0){if(!this.leafletMarker)return;let a;for(let s=0;s<this.leafletPolygons.length;s++)this.leafletPolygons[s].contains(this.leafletMarker.getLatLng())&&(a=this.mappedPolygonArray[s]);a?(r?this.geocodeLatLng(t,n):(this.placeSearchControl.patchValue(this.placesList[0]?.properties?.place_id,{emitEvent:!1}),this.emitDeliveryResult(t,n)),this.showField(a),this.infoContent=a):(this.infoContent=null,this.emitDeliveryResult(),this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant((0,B.cK)())}}))}showField(t){if(!t)return void(this.infoContent=null);this.infoContent=t;const n_freeDeliveryFrom=this.infoContent?.freeDeliveryFrom?"block":"none",n_workSchedule=this.infoContent?.workSchedules.length?"flex":"none",n_deliveryTime=this.infoContent.deliveryTime&&(this.infoContent.deliveryTime.min>0||this.infoContent.deliveryTime.min>0)?"flex":"none",n_defaultPriceFormationFromAmount=this.infoContent.defaultPriceFormationFromAmount?"flex":"none",n_listPriceFormationFromAmount=this.infoContent.listPriceFormationFromAmount.length?"flex":"none",n_description=this.infoContent.description?"flex":"none",r=this.infoContent.deliveryTime?(0,E.sX)(this.infoContent.deliveryTime.min)+"-"+(0,E.sX)(this.infoContent.deliveryTime.max):"",a=this.infoContent?.listPriceFormationFromAmount.length?this.listPriceFormationFromAmount():"",s=`\n <div style="display:inline-block;max-width: 300px;">\n <div style="display: flex; align-items: center">\n <div\n class="map-sidebar__zone-ellipse"\n style="margin-right:5px;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color:${this?.infoContent?.options?.fillColor}"\n ></div>\n <div\n style="font-weight: 500; font-size: 14px; line-height: 25px; color: #212121"\n >\n ${this.infoContent?.name}\n </div>\n </div>\n <div style="display: flex;\n align-items: center;\n margin-top: 4px;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n display:${n_defaultPriceFormationFromAmount}"\n >\n <div style="color: #8c8c8c">${this.translateService.instant("deliveryZones.mainDelivery")}</div>\n <div\n style="color: #212121; margin-left: 4px; font-weight: 500"\n >\n ${this.infoContent.defaultPriceFormationFromAmount}${this.mainCurrency}\n </div>\n </div>\n <div style="display: flex;\n flex-direction:column;\n margin-top: 4px;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n display:${n_listPriceFormationFromAmount}"\n >\n <div style="color: #8c8c8c">\n ${this.translateService.instant("deliveryZones.delivery")}\n </div>\n <div\n style="color: #212121; font-weight: 500"\n >\n ${a}\n </div>\n </div>\n \n <div\n style=" display: flex;\n align-items: center;\n margin-top: 8px;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n display: ${n_freeDeliveryFrom};\n "\n >\n <div style="font-weight: 500; color: #8c8c8c">\n ${this.translateService.instant("deliveryZones.freeDelivery")}\n </div>\n <div style="color: #212121; margin-left: 4px; font-weight: 500">\n \u043e\u0442 ${this.infoContent?.freeDeliveryFrom}${this.mainCurrency}\n </div>\n </div>\n \n <div\n style="\n margin-top: 8px;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n display:${n_workSchedule};\n flex-direction:column;">\n <div style="color: #8c8c8c;margin-bottom:5px;">${this.translateService.instant("deliveryZones.schedule")}:</div>\n <div style="color: #212121;">\n ${this.workSchedule}\n </div>\n \n </div>\n <div style="display: flex;\n align-items: center;\n margin-top: 8px;\n font-size: 13px;\n height: 20px;\n font-weight: 500;\n display:${n_deliveryTime};\n ">\n <div style="height:20px">\n <svg style="width:20px;height:20px;margin-right:5px;" fill="none" width="20" height="20" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">\n ${this.iconRegistry.getIconElement("clock").innerHTML}\n </svg>\n </div>\n <div class="map-sidebar__duration-text">\n ${r}\n </div>\n </div>\n <div style="display:${n_description};\n margin-top: 8px;\n font-size: 13px;\n font-weight: 500;\n flex-direction:column;\n ">\n <div style="color: #8c8c8c;margin-bottom:5px;">${this.translateService.instant("deliveryZones.description")}:</div>\n <div style="color: #212121;">\n ${this.infoContent.description}\n </div>\n </div>\n </div>\n </div>\n `;this.leafletMarker&&this.leafletMarker.bindPopup(s,{closeButton:!0,maxWidth:300}).togglePopup()}clearSearchField(){this.placeSearchControl.reset(""),this.emitDeliveryResult()}getCurrentLocation(){navigator.geolocation.getCurrentPosition(t=>{this.setMarkerOnTheMap(t.coords.latitude,t.coords.longitude)})}geocodeLatLng(t,n){const r={lat:t||this.markerCoordinates?.latlng?.lat,lng:n||this.markerCoordinates?.latlng?.lng};return new Promise((a,s)=>{this.leafletGeocoder.reverse({lat:r.lat,lng:r.lng},5e7,m=>{m.length?(this.placesList=this.mapPlacesList(m),this.placeSearchControl.patchValue(this.placesList[0]?.properties?.place_id,{emitEvent:!1}),this.emitDeliveryResult(r.lat,r.lng),a(m[0]?.properties?.place_id)):s(null)})})}getPlacesList(t){"number"!=typeof t&&this.leafletGeocoder.geocode(t,n=>{this.placesList=this.mapPlacesList(n)})}geocodeAddress(t){this.leafletGeocoder.geocode(t,n=>{if(n.length){this.placesList=this.mapPlacesList(n),this.placeSearchControl.patchValue(this.placesList[0]?.properties?.place_id,{emitEvent:!1});const r=n[0].center.lat,a=n[0].center.lng;this.emitDeliveryResult(r,a),this.setMarkerOnTheMap(r,a,!1)}else this.emitDeliveryResult(),console.error("geocoding error")})}onAutocompleteBlur(){"string"==typeof this.placeSearchControl.value&&this.geocodeAddress(this.placeSearchControl.value)}selectPlaceOption(t){const n=this.placesList.find(r=>+r?.properties?.place_id==+t.option.value);n&&this.setMarkerOnTheMap(n.center.lat,n.center.lng,!1)}getPlaceTitle(t){return this.placesList?.find(n=>n.properties.place_id===t)?.name}emitDeliveryResult(t,n){if(this.placeSearchControl.value&&t&&n){const r=this.placesList.find(s=>
1s?.properties?.place_id===+this.placeSearchControl.value),a={addressName:r?.name||r?.properties?.display_name,addressLatitude:t,addressLongitude:n,detailAddress:(0,E.S5)(r?.properties?.address)};this.calculateDeliveryPrice.emit(a)}else this.calculateDeliveryPrice.emit(!1)}toggleInfoSidebar(){this.isShowInfoSidebar=!this.isShowInfoSidebar}secondsToHours(t){return(0,E.sX)(t)}listPriceFormationFromAmount(){let t="";const n=this.infoContent.listPriceFormationFromAmount;for(let r=0;r<n.length;r++){const a=n[r];t+=a.cost+this.mainCurrency+" "+this.translateService.instant("deliveryZones.orderFrom")+" "+a.sum+this.mainCurrency,r!==n.length-1&&(t+=", ")}return t}mapPlacesList(t){return t.map(n=>(n.name=n?.properties?.address?(0,E.io)(n.properties.address,!0):n.name,n)).filter(n=>"ru"!==n?.properties?.address?.country_code)}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(K.E),e.\u0275\u0275directiveInject(S.sK),e.\u0275\u0275directiveInject(P.z),e.\u0275\u0275directiveInject(M.Zw))},i.\u0275cmp=e.\u0275\u0275defineComponent({type:i,selectors:[["app-delivery-zones"]],viewQuery:function(t,n){if(1&t&&e.\u0275\u0275viewQuery(ft,5),2&t){let r;e.\u0275\u0275queryRefresh(r=e.\u0275\u0275loadQuery())&&(n.matDrawer=r.first)}},inputs:{polygonArray:"polygonArray",workSchedule:"workSchedule"},outputs:{calculateDeliveryPrice:"calculateDeliveryPrice"},ngContentSelectors:Ft,decls:30,vars:21,consts:[[1,"order-form__group"],["class","address-hint-msg",4,"ngIf"],[1,"order-form__group-raw"],[1,"form-field__lable"],["appearance","outline",1,"am-input","am-input-with-clear","autocomplete-input"],["matInput","","type","text",3,"placeholder","formControl","matAutocomplete","matAutocompletePosition"],[3,"displayWith","optionSelected","closed"],["auto","matAutocomplete"],[4,"ngIf","ngIfElse"],["noData",""],["class","delivery-form__close","name","x","matSuffix","","mat-icon-button","","type","button",3,"click",4,"ngIf"],["mode","side",1,"map-sidebar__container-item",3,"opened","openedChange"],["drawer",""],[1,"map-sidebar__title"],["class","map-sidebar__wrapper",4,"ngFor","ngForOf"],[1,"map"],[1,"map__container"],["id","leafletMap","class","osm-map","leaflet","",3,"leafletOptions","leafletMapReady","leafletClick",4,"ngIf"],[1,"map__icon",3,"click"],["name","location"],[1,"map-sidebar__arrow",3,"click"],[3,"name"],[1,"address-hint-msg"],["name","alert-circle"],[3,"innerText"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["disabled",""],["name","x","matSuffix","","mat-icon-button","","type","button",1,"delivery-form__close",3,"click"],[1,"map-sidebar__wrapper"],[1,"map-sidebar__zone"],[1,"map-sidebar__zone-ellipse",3,"ngStyle"],[1,"map-sidebar__zone-status"],["class","map-sidebar__duration",4,"ngIf"],[4,"ngIf"],["class","map-sidebar__delivery",4,"ngIf"],["class","map-sidebar__free-delivery",4,"ngIf"],["class","map-sidebar__schedule",4,"ngIf"],[1,"map-sidebar__duration"],[1,"map-sidebar__duration-icon"],["name","clock"],[1,"map-sidebar__duration-text"],[1,"map-sidebar__delivery"],[1,"map-sidebar__delivery-title"],[1,"map-sidebar__delivery-price"],[4,"ngFor","ngForOf"],[1,"map-sidebar__free-delivery"],[1,"map-sidebar__free-delivery-title"],[1,"map-sidebar__free-delivery-price"],[1,"map-sidebar__schedule"],[1,"map-sidebar__schedule-title"],[1,"map-sidebar__schedule-text",3,"innerHTML"],[1,"map-sidebar__schedule-text"],["id","leafletMap","leaflet","",1,"osm-map",3,"leafletOptions","leafletMapReady","leafletClick"]],template:function(t,n){if(1&t&&(e.\u0275\u0275projectionDef(),e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275template(1,vt,4,3,"div",1),e.\u0275\u0275elementStart(2,"div",2)(3,"div",3),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"mat-form-field",4),e.\u0275\u0275element(7,"input",5),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275elementStart(9,"mat-autocomplete",6,7),e.\u0275\u0275listener("optionSelected",function(a){return n.selectPlaceOption(a)})("closed",function(){return n.onAutocompleteBlur()}),e.\u0275\u0275template(11,Ct,2,1,"ng-container",8),e.\u0275\u0275template(12,xt,3,3,"ng-template",null,9,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(14,Mt,1,0,"i-feather",10),e.\u0275\u0275elementEnd(),e.\u0275\u0275projection(15),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(16,"mat-drawer-container")(17,"mat-drawer",11,12),e.\u0275\u0275listener("openedChange",function(a){return n.isShowInfoSidebar=a}),e.\u0275\u0275elementStart(19,"div",13),e.\u0275\u0275text(20),e.\u0275\u0275pipe(21,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(22,Tt,11,10,"div",14),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"div",15)(24,"div",16),e.\u0275\u0275template(25,kt,1,1,"div",17),e.\u0275\u0275elementStart(26,"div",18),e.\u0275\u0275listener("click",function(){return n.getCurrentLocation()}),e.\u0275\u0275element(27,"app-icon",19),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(28,"div",20),e.\u0275\u0275listener("click",function(){return n.toggleInfoSidebar()}),e.\u0275\u0275element(29,"i-feather",21),e.\u0275\u0275elementEnd()()()()),2&t){const r=e.\u0275\u0275reference(10),a=e.\u0275\u0275reference(13);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.showAddressHint),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(5,15,"addressSetingForm.address")," "),e.\u0275\u0275advance(3),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(8,17,"deliveryForm.addressAutocompletePlaceholder")),e.\u0275\u0275property("formControl",n.placeSearchControl)("matAutocomplete",r)("matAutocompletePosition","below"),e.\u0275\u0275advance(2),e.\u0275\u0275property("displayWith",n.getPlaceTitle.bind(n)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",(null==n.placesList?null:n.placesList.length)>0)("ngIfElse",a),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",n.placeSearchControl.value),e.\u0275\u0275advance(3),e.\u0275\u0275property("opened",n.isShowInfoSidebar),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(21,19,"deliveryZones.zonesInformation")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",n.mappedPolygonArray),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",n.leafletOptions),e.\u0275\u0275advance(4),e.\u0275\u0275property("name",n.isShowInfoSidebar?"chevron-left":"chevron-right")}},dependencies:[C.sg,C.O5,C.PC,c.Fj,c.JJ,c.oH,Q.u,Ue.o,b.KE,b.R9,R.Nt,ie.XC,ie.ZL,Pe.ey,A.jA,A.kh,ut,S.X$,re.d],styles:['@charset "UTF-8";.delivery-form__search[_ngcontent-%COMP%]{width:calc(100% - 22px)}.delivery-form__close[_ngcontent-%COMP%]{position:absolute;cursor:pointer;stroke-width:2.3px;width:23.5px!important;height:23.5px!important;color:var(--mainTextColor)}.delivery-form__close[_ngcontent-%COMP%]:hover{color:var(--borderColor)}.order-form__group[_ngcontent-%COMP%]{margin-bottom:24px}
1.order-form__group-col[_ngcontent-%COMP%]{width:calc(50% - 10px);padding-bottom:16px;margin-top:24px} .autocomplete-input.mat-form-field-appearance-outline .mat-form-field-infix{padding-right:40px}.address-hint-msg[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:12px;background-color:var(--mainBackgroundColor);border-radius:6px;width:-moz-fit-content;width:fit-content;margin-bottom:12px}.address-hint-msg[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--mainTextColor);font-size:12px;font-weight:500}.address-hint-msg[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%]{color:var(--primaryColor);width:18px;height:18px;min-width:18px;min-height:18px;margin-right:8px}.map[_ngcontent-%COMP%]{border:1px solid var(--borderColor)}.map__container[_ngcontent-%COMP%]{position:relative}.map__icon[_ngcontent-%COMP%]{color:#000;background:#fff;position:absolute;outline:2px solid rgba(0,0,0,.2)!important;margin:12px;-webkit-appearance:none;appearance:none;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:4px;bottom:90px;right:0;height:30px;width:30px;display:inline-flex;align-items:center;justify-content:center}.map__icon[_ngcontent-%COMP%]:hover, .map__icon[_ngcontent-%COMP%]:focus{background-color:#f4f4f4}.map[_ngcontent-%COMP%] .leaflet-pane>svg path.leaflet-interactive{stroke:var(--primaryColor);stroke-width:1;fill-opacity:.2;stroke-opacity:.8}.map-sidebar__arrow[_ngcontent-%COMP%]{position:absolute;top:33px;background-color:var(--primaryColor);padding:17px 7px;box-shadow:0 8px 28px -6px #4f4f4f21,0 8px 28px -6px #18274b0a;border-radius:0 4px 4px 0;margin-left:-1px;cursor:pointer}.map-sidebar__arrow[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%], .map-sidebar__arrow[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{stroke-width:2.5px;width:25px;color:var(--lightTextColor)}.map-sidebar__wrapper[_ngcontent-%COMP%]{padding:8px 0 12px;border-bottom:1px solid rgba(130,130,130,.3)}.map-sidebar__wrapper[_ngcontent-%COMP%]:last-child{border-bottom:none}.map-sidebar__title[_ngcontent-%COMP%]{font-weight:700;font-size:16px;line-height:25px;letter-spacing:0px;text-align:left;color:#212121}.map-sidebar__zone[_ngcontent-%COMP%]{display:flex;align-items:flex-end;margin-top:10px}.map-sidebar__zone-ellipse[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:50%;display:inline-block}.map-sidebar__zone-status[_ngcontent-%COMP%]{font-weight:500;font-size:14px;line-height:19px;letter-spacing:0px;text-align:left;color:#212121;margin-left:8px}.map-sidebar__duration[_ngcontent-%COMP%]{font-size:12px;font-weight:500;line-height:16px;color:#212121;display:inline-flex;align-items:center;margin-top:12px}.map-sidebar__duration-icon[_ngcontent-%COMP%]{height:16px;margin-right:6px}.map-sidebar__duration-icon[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%], .map-sidebar__duration-icon[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{color:#919191;width:16px;height:100%}.map-sidebar__delivery[_ngcontent-%COMP%]{margin-top:8px;font-size:13px;line-height:20px;font-weight:500}.map-sidebar__delivery-title[_ngcontent-%COMP%]{color:#8c8c8c}.map-sidebar__delivery-price[_ngcontent-%COMP%]{color:#212121;margin-left:4px;font-weight:500}.map-sidebar__free-delivery[_ngcontent-%COMP%]{display:flex;align-items:center;margin-top:8px;font-size:13px;line-height:20px;font-weight:500}.map-sidebar__free-delivery-title[_ngcontent-%COMP%]{font-weight:500;color:#8c8c8c}.map-sidebar__free-delivery-price[_ngcontent-%COMP%]{color:#212121;margin-left:4px;font-weight:500}.map-sidebar__schedule[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-top:8px;font-size:13px;line-height:20px;font-weight:500}.map-sidebar__schedule-title[_ngcontent-%COMP%]{color:#8c8c8c;margin-bottom:5px;line-height:19px}.map-sidebar__schedule-text[_ngcontent-%COMP%]{color:#212121;line-height:1.5}.osm-map[_ngcontent-%COMP%]{z-index:0;height:500px;width:100%}mat-drawer-container[_ngcontent-%COMP%]{height:100%;top:0;left:0;box-shadow:0 8px 28px -6px #0000000a;border:1px solid var(--borderColor)}mat-drawer-container[_ngcontent-%COMP%] mat-drawer[_ngcontent-%COMP%]{padding:16px;width:259px}@media (max-width: 576px){mat-drawer-container[_ngcontent-%COMP%] mat-drawer[_ngcontent-%COMP%]{width:240px;padding:8px}} .mat-drawer-inner-container::-webkit-scrollbar{width:6px} .mat-drawer-inner-container::-webkit-scrollbar-thumb{background-color:var(--primaryColor)} .gm-style-iw{max-width:300px!important}']}),i})();var At=d(8987),X=d(2340),Ge=d(727),x=d(1135),I=d(8746),V=d(4004),me=d(9646),Bt=d(1520),ge=d(9300),Y=d(4048),He=d(8311),he=d(3693),ue=d(8712),Rt=d(4593),Vt=d(8156),Zt=d(1570),We=(d(8646),d(9718)),l=d(655),p=d(775);let oe=class{constructor(){this.lat=null,this.lng=null}};(0,l.gn)([(0,p.ep)("x",Number,!0),(0,l.w6)("design:type",Number)],oe.prototype,"lat",void 0),(0,l.gn)([(0,p.ep)("y",Number,!0),(0,l.w6)("design:type",Number)],oe.prototype,"lng",void 0),oe=(0,l.gn)([(0,p.sT)("Coordinates")],oe);let J=class{constructor(){this.min=null,this.max=null}};(0,l.gn)([(0,p.ep)("min",Number,!0),(0,l.w6)("design:type",Number)],J.prototype,"min",void 0),(0,l.gn)([(0,p.ep)("max",Number,!0),(0,l.w6)("design:type",Number)],J.prototype,"max",void 0),J=(0,l.gn)([(0,p.sT)("DeliveryTime")],J);let q=class{constructor(){this.days=[],this.start=null,this.end=null}};(0,l.gn)([(0,p.ep)("days",[Number],!0),(0,l.w6)("design:type",Array)],q.prototype,"days",void 0),(0,l.gn)([(0,p.ep)("start",String,!0),(0,l.w6)("design:type",String)],q.prototype,"start",void 0),(0,l.gn)([(0,p.ep)("end",String,!0),(0,l.w6)("design:type",String)],q.prototype,"end",void 0),q=(0,l.gn)([(0,p.sT)("WorkSchedules")],q);let ae=class{constructor(){this.lineColor=null}};(0,l.gn)([(0,p.ep)("sum",String,!0),(0,l.w6)("design:type",String)],ae.prototype,"lineColor",void 0),ae=(0,l.gn)([(0,p.sT)("Options")],ae);let se=class{constructor(){this.sum=null,this.cost=null}};(0,l.gn)([(0,p.ep)("sum",String,!0),(0,l.w6)("design:type",String)],se.prototype,"sum",void 0),(0,l.gn)([(0,p.ep)("cost",String,!0),(0,l.w6)("design:type",String)],se.prototype,"cost",void 0),se=(0,l.gn)([(0,p.sT)("listPriceFormationFromAmount")],se);let v=class{constructor(){this.id=null,this.name=null,this.description=null,this.coordinates=[],this.deliveryTime=null,this.workSchedules=null,this.deliveries=null,this.lineColor=null,this.color=null,this.lineWidth=null,this.freeDeliveryFrom=null,this.listPriceFormationFromAmount=null,this.available=null,this.createdAt=null,this.updatedAt=null,this.options=null,this.priceFormation=null,this.defaultPriceFormationFromAmount=null,this.order=null}};(0,l.gn)([(0,p.ep)("id",String,!0),(0,l.w6)("design:type",String)],v.prototype,"id",void 0),(0,l.gn)([(0,p.ep)("name",
1String,!0),(0,l.w6)("design:type",String)],v.prototype,"name",void 0),(0,l.gn)([(0,p.ep)("description",String,!0),(0,l.w6)("design:type",String)],v.prototype,"description",void 0),(0,l.gn)([(0,p.ep)("coordinates",[oe],!0),(0,l.w6)("design:type",Array)],v.prototype,"coordinates",void 0),(0,l.gn)([(0,p.ep)("deliveryTime",J,!0),(0,l.w6)("design:type",J)],v.prototype,"deliveryTime",void 0),(0,l.gn)([(0,p.ep)("workSchedules",[q],!0),(0,l.w6)("design:type",Array)],v.prototype,"workSchedules",void 0),(0,l.gn)([(0,p.ep)("deliveries",[String],!0),(0,l.w6)("design:type",Array)],v.prototype,"deliveries",void 0),(0,l.gn)([(0,p.ep)("lineColor",String,!0),(0,l.w6)("design:type",String)],v.prototype,"lineColor",void 0),(0,l.gn)([(0,p.ep)("color",String,!0),(0,l.w6)("design:type",String)],v.prototype,"color",void 0),(0,l.gn)([(0,p.ep)("lineWidth",Number,!0),(0,l.w6)("design:type",Number)],v.prototype,"lineWidth",void 0),(0,l.gn)([(0,p.ep)("freeDeliveryFrom",Number,!0),(0,l.w6)("design:type",Number)],v.prototype,"freeDeliveryFrom",void 0),(0,l.gn)([(0,p.ep)("listPriceFormationFromAmount",[se],!0),(0,l.w6)("design:type",Array)],v.prototype,"listPriceFormationFromAmount",void 0),(0,l.gn)([(0,p.ep)("available",Boolean,!0),(0,l.w6)("design:type",Boolean)],v.prototype,"available",void 0),(0,l.gn)([(0,p.ep)("createdAt",String,!0),(0,l.w6)("design:type",String)],v.prototype,"createdAt",void 0),(0,l.gn)([(0,p.ep)("updatedAt",String,!0),(0,l.w6)("design:type",String)],v.prototype,"updatedAt",void 0),(0,l.gn)([(0,p.ep)("options",ae,!0),(0,l.w6)("design:type",ae)],v.prototype,"options",void 0),(0,l.gn)([(0,p.ep)("priceFormation",String,!0),(0,l.w6)("design:type",String)],v.prototype,"priceFormation",void 0),(0,l.gn)([(0,p.ep)("defaultPriceFormationFromAmount",String,!0),(0,l.w6)("design:type",String)],v.prototype,"defaultPriceFormationFromAmount",void 0),(0,l.gn)([(0,p.ep)("order",Number,!0),(0,l.w6)("design:type",Number)],v.prototype,"order",void 0),v=(0,l.gn)([(0,p.sT)("DeliveryZones")],v);let Nt=(()=>{class i{constructor(t,n){this.apiService=t,this.appService=n}get(){return this.apiService.get(`/companies/${this.appService.subCompaniyId}/delivery-zones`,null,v)}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275inject(We.s),e.\u0275\u0275inject(P.z))},i.\u0275prov=e.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac,providedIn:"root"}),i})();var jt=d(9795),Ut=d(5406),Gt=d(2303),$e=d(1739),Ht=d(4071),_e=d(9204),Wt=d(7697),k=(()=>{return(i=k||(k={})).COURIER="COURIER",i.LIGATAXI="LIGATAXI",i.PICKUP="PICKUP",i.UKRPOSHTA="UKRPOSHTA",i.NOVAPOSHTA="novaposhta",i.MEEST="MEEST",i.INPOST="INPOST",k;var i})(),Ke=d(2893),Le=d(1315),ee=d(5938);function $t(i,o){1&i&&(e.\u0275\u0275elementStart(0,"h2",17),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"order.emailRequiredOrderTitle")," "))}function Kt(i,o){1&i&&(e.\u0275\u0275elementStart(0,"h2",17),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"order.emailRequired")," "))}function Qt(i,o){1&i&&(e.\u0275\u0275elementStart(0,"p",18),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"order.emailRequiredOrderMessage")," "))}function Xt(i,o){1&i&&(e.\u0275\u0275elementStart(0,"p",18),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"order.emailRequiredMessage")," "))}function Yt(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"validationErrors.required")," "))}function Jt(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"validationErrors.invalidEmail")," "))}let Te=(()=>{class i{constructor(t,n,r){this.dialogRef=t,this.data=n,this.fb=r,this.isUpdating=!1}ngOnInit(){this.emailForm=this.fb.group({email:[this.data?.currentEmail||"",[c.kI.required,
1c.kI.email]]})}close(){this.dialogRef.close(null)}submit(){this.emailForm.valid?this.dialogRef.close(this.emailForm.get("email").value):this.emailForm.markAllAsTouched()}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(ee.so),e.\u0275\u0275directiveInject(ee.WI),e.\u0275\u0275directiveInject(c.QS))},i.\u0275cmp=e.\u0275\u0275defineComponent({type:i,selectors:[["app-email-dialog"]],decls:27,vars:22,consts:[[1,"email-dialog"],[1,"email-dialog__head"],["class","email-dialog__title",4,"ngIf","ngIfElse"],["emailTitlePayment",""],[1,"email-dialog__content"],["class","email-dialog__message",4,"ngIf","ngIfElse"],["emailMessagePayment",""],[1,"email-dialog__form",3,"formGroup"],[1,"form-field"],[1,"form-field__lable"],[1,"form-field__control"],["appearance","outline",1,"am-input"],["matInput","","type","email","formControlName","email","autocomplete","off",3,"placeholder","disabled"],[4,"ngIf"],[1,"email-dialog__buttons"],[1,"btn","btn-cancel",3,"disabled","click"],[1,"btn","btn-primary",3,"disabled","click"],[1,"email-dialog__title"],[1,"email-dialog__message"]],template:function(t,n){if(1&t&&(e.\u0275\u0275elementStart(0,"div",0)(1,"div",1),e.\u0275\u0275template(2,$t,3,3,"h2",2),e.\u0275\u0275template(3,Kt,3,3,"ng-template",null,3,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",4),e.\u0275\u0275template(6,Qt,3,3,"p",5),e.\u0275\u0275template(7,Xt,3,3,"ng-template",null,6,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementStart(9,"form",7)(10,"div",8)(11,"div",9),e.\u0275\u0275text(12),e.\u0275\u0275pipe(13,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"div",10)(15,"mat-form-field",11),e.\u0275\u0275element(16,"input",12),e.\u0275\u0275pipe(17,"translate"),e.\u0275\u0275template(18,Yt,3,3,"mat-error",13),e.\u0275\u0275template(19,Jt,3,3,"mat-error",13),e.\u0275\u0275elementEnd()()()()(),e.\u0275\u0275elementStart(20,"div",14)(21,"button",15),e.\u0275\u0275listener("click",function(){return n.close()}),e.\u0275\u0275text(22),e.\u0275\u0275pipe(23,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(24,"button",16),e.\u0275\u0275listener("click",function(){return n.submit()}),e.\u0275\u0275text(25),e.\u0275\u0275pipe(26,"translate"),e.\u0275\u0275elementEnd()()()),2&t){const r=e.\u0275\u0275reference(4),a=e.\u0275\u0275reference(8);e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf","order"===(null==n.data?null:n.data.variant))("ngIfElse",r),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf","order"===(null==n.data?null:n.data.variant))("ngIfElse",a),e.\u0275\u0275advance(3),e.\u0275\u0275property("formGroup",n.emailForm),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(13,14,"order.userEmail")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(17,16,"order.emailPlaceholder")),e.\u0275\u0275property("disabled",n.isUpdating),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.emailForm.get("email").hasError("required")),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.emailForm.get("email").hasError("email")),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",n.isUpdating),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(23,18,"profile.cancel")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",n.isUpdating),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(26,20,"profile.save")," ")}},dependencies:[C.O5,c._Y,c.Fj,c.JJ,c.JL,b.TO,b.KE,R.Nt,c.sg,c.u,S.X$],styles:[".email-dialog[_ngcontent-%COMP%]{color:var(--mainTextColor);background-color:var(--modalBackgroundColor);padding:24px;min-width:400px;max-width:500px}.email-dialog__head[_ngcontent-%COMP%]{margin-bottom:16px}.email-dialog__title[_ngcontent-%COMP%]{font-size:20px;line-height:25px;font-weight:700;text-align:center;color:var(--primaryColor);margin:0}.email-dialog__content[_ngcontent-%COMP%]{margin-bottom:24px}.email-dialog__message[_ngcontent-%COMP%]{text-align:center;font-weight:400;font-size:16px;line-height:20px;margin-bottom:20px}.email-dialog__form[_ngcontent-%COMP%], .email-dialog__form[_ngcontent-%COMP%] .am-input[_ngcontent-%COMP%]{width:100%}.email-dialog__buttons[_ngcontent-%COMP%]{display:flex;gap:12px;justify-content:flex-end}.email-dialog__buttons[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{min-width:100px}.email-dialog__buttons[_ngcontent-%COMP%] .btn-cancel[_ngcontent-%COMP%]{color:var(--primaryColor)}"]}),i})();var qt=d(300),Qe=d(9519),fe=d(2510),U=d(7100),Xe=d(4296);function en(i,o){1&i&&e.\u0275\u0275element(0,"app-loader",23)}function tn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",28),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&i){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.userData.name," ")}}function nn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",5)(1,"h2"),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",24)(5,"div",25)(6,"div",26),e.\u0275\u0275text(7),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(9,tn,2,1,"div",27),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(10,"div",25)(11,"div",26),e.\u0275\u0275text(12),e.\u0275\u0275pipe(13,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(14,"div",28),e.\u0275\u0275text(15),e.\u0275\u0275elementEnd()()()()),2&i){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(3,5,"order.userDataHead")," "),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(8,7,"order.userName")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.userData.name),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(13,9,"order.userPhone")," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",t.userData.phone," ")}}function rn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",5),e.\u0275\u0275element(1,"app-payments",29),e.\u0275\u0275elementEnd()),2&i){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("currentPaymentType",t.currentPaymentType)}}function on(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"mat-option",39),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&i){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function an(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"i-feather",40),e.\u0275\u0275listener("click",function(r){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(4).orderForm.get("userAddress").setValue(null),e.\u0275\u0275resetVie
1w(r.stopPropagation())}),e.\u0275\u0275elementEnd()}}function sn(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",9)(1,"mat-form-field",36)(2,"mat-select",37),e.\u0275\u0275listener("ngModelChange",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(3);return e.\u0275\u0275resetView(a.userAddressChange(r))}),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275template(4,on,3,2,"ng-container",18),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(5,an,1,0,"i-feather",38),e.\u0275\u0275elementEnd()()}if(2&i){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(2),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(3,3,"deliveryForm.savedAddressPlaceholder")),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",t.userAddress),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.orderForm.get("userAddress").value)}}function ln(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",9)(1,"app-google-address-autocomplete",41),e.\u0275\u0275listener("onAddressChange",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext(3);return e.\u0275\u0275resetView(r.onAutocompleteChange())})("calculateDeliveryPrice",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext(3);return e.\u0275\u0275resetView(r.apiCalculatePrice())}),e.\u0275\u0275elementEnd()()}}function dn(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",9)(1,"app-nominatim-autocomplete",41),e.\u0275\u0275listener("onAddressChange",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext(3);return e.\u0275\u0275resetView(r.onAutocompleteChange())})("calculateDeliveryPrice",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext(3);return e.\u0275\u0275resetView(r.apiCalculatePrice())}),e.\u0275\u0275elementEnd()()}}function pn(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,sn,6,5,"div",31),e.\u0275\u0275template(2,ln,2,0,"div",34),e.\u0275\u0275pipe(3,"async"),e.\u0275\u0275template(4,dn,2,0,"ng-template",null,35,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementContainerEnd()),2&i){const t=e.\u0275\u0275reference(5),n=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.isAvailableUserAddress&&n.userAddress.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.useGoogleMaps&&e.\u0275\u0275pipeBind1(3,3,n.setGoogleMapsLoaded))("ngIfElse",t)}}function cn(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"mat-option",39),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&i){const t=o.$implicit;e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.name," ")}}function mn(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"i-feather",40),e.\u0275\u0275listener("click",function(r){return e.\u0275\u0275restoreView(t),e.\u0275\u0275nextContext(5).orderForm.get("userAddress").setValue(null),e.\u0275\u0275resetView(r.stopPropagation())}),e.\u0275\u0275elementEnd()}}function gn(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",9)(1,"mat-form-field",36)(2,"mat-select",37),e.\u0275\u0275listener("ngModelChange",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(4);return e.\u0275\u0275resetView(a.userAddressChange(r))}),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275template(4,cn,3,2,"ng-container",18),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(5,mn,1,0,"i-feather",38),e.\u0275\u0275elementEnd()()}if(2&i){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275advance(2),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(3,3,"deliveryForm.savedAddressPlaceholder")),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",t.userAddress),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.orderForm.get("userAddress").value)}}function hn(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",9)(1,"app-google-address-autocomplete",41),e.\u0275\u0275listener("onAddressChange",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext(4);
1return e.\u0275\u0275resetView(r.onAutocompleteChange())})("calculateDeliveryPrice",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext(4);return e.\u0275\u0275resetView(r.apiCalculatePrice())}),e.\u0275\u0275elementEnd()()}}function un(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",9)(1,"app-nominatim-autocomplete",41),e.\u0275\u0275listener("onAddressChange",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext(4);return e.\u0275\u0275resetView(r.onAutocompleteChange())})("calculateDeliveryPrice",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext(4);return e.\u0275\u0275resetView(r.apiCalculatePrice())}),e.\u0275\u0275elementEnd()()}}function _n(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",46)(1,"div",11)(2,"div",12),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",13)(6,"mat-form-field",14)(7,"input",50),e.\u0275\u0275listener("input",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(5);return e.\u0275\u0275resetView(a.noWhitespace(r))}),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275elementEnd()()()()()}2&i&&(e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(4,2,"order.deliveryBuilding")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(8,4,"order.deliveryBuilding")))}const G=function(){return{"margin-top":"15px"}};function fn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",44),e.\u0275\u0275template(1,_n,9,6,"div",45),e.\u0275\u0275elementStart(2,"div",46)(3,"div",11)(4,"div",12),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"div",13)(8,"mat-form-field",14),e.\u0275\u0275element(9,"input",47),e.\u0275\u0275pipe(10,"translate"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(11,"div",46)(12,"div",11)(13,"div",12),e.\u0275\u0275text(14),e.\u0275\u0275pipe(15,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"div",13)(17,"mat-form-field",14),e.\u0275\u0275element(18,"input",48),e.\u0275\u0275pipe(19,"translate"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(20,"div",46)(21,"div",11)(22,"div",12),e.\u0275\u0275text(23),e.\u0275\u0275pipe(24,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"div",13)(26,"mat-form-field",14),e.\u0275\u0275element(27,"input",49),e.\u0275\u0275pipe(28,"translate"),e.\u0275\u0275elementEnd()()()()()),2&i){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction0(24,G)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.orderForm.get("address").value?null:t.orderForm.get("address").value.addressName)&&!(null!=t.orderForm.get("address").value&&null!=t.orderForm.get("address").value.detailAddress&&t.orderForm.get("address").value.detailAddress.building)),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(6,12,"order.deliveryApartment")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(10,14,"order.deliveryApartment")),e.\u0275\u0275property("afterDotAmount",0),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(15,16,"order.deliveryFloor")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(19,18,"order.deliveryFloor")),e.\u0275\u0275property("afterDotAmount",0)("allowNegative",!0),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(24,20,"order.deliveryEntrance")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(28,22,"order.deliveryEntrance")),e.\u0275\u0275property("afterDotAmount",0)}}function vn(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,gn,6,5,"div",31),e.\u0275\u0275template(2,hn,2,0,"div",34),e.\u0275\u0275pipe(3,"async"),e.\u0275\u0275template(4,un,2,0,"ng-template",null,43,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275template(6,fn,29,25,"div",42),e.\u0275\u0275elementContainerEnd()),2&i){const t=e.\u0275\u0275reference(5),n=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.isAvailableUserAddress&&n.userAddress.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.useGoogleMaps&&e.\u0275\u0275pipeBind1(3,4,n.setGoogleMapsLoaded))("ngIfElse",t),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",null==n.orderForm.get("address").value||null==n.orderForm.get("address").value.detailAddress?null:n.orderForm.get("address").value.detailAddress.street)}}function yn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",44)(1,"div",10)(2,"div",11)(3,"div",12),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",13)(7,"mat-form-field",14),e.\u0275\u0275element(8,"textarea",51),e.\u0275\u0275pipe(9,"translate"),e.\u0275\u0275elementEnd()()()()()),2&i){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("ngStyle",!t.currentDelivery.showAddress&&e.\u0275\u0275pureFunction0(7,G)),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(5,3,"order.deliveryComent")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(9,5,"order.deliveryComentHint"))}}function Cn(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,vn,7,6,"ng-container",7),e.\u0275\u0275template(2,yn,10,8,"div",42),e.\u0275\u0275elementContainerEnd()),2&i){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.showAddress),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.extraField)}}function xn(i,o){if(1&i&&e.\u0275\u0275element(0,"app-support-delivery",53),2&i){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("currentDelivery",t.currentDelivery.deliveryType)}}function Mn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",9),e.\u0275\u0275template(1,xn,1,1,"app-support-delivery",52),e.\u0275\u0275elementEnd()),2&i){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("rerenderComponentKey",t.currentDelivery.deliveryType)}}function bn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"mat-option",39),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&i){const t=o.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.address," ")}}function wn(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"div",13)(8,"mat-form-field",14)(9,"mat-select",54),e.\u0275\u0275listener("selectionChange",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(2);
1return e.\u0275\u0275resetView(a.onAddressChange(r))}),e.\u0275\u0275template(10,bn,2,2,"mat-option",55),e.\u0275\u0275elementEnd()()()()()()()}if(2&i){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(6,2,"order.orderPickupAddresses")," "),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngForOf",t.currentDelivery.addresses)}}function On(i,o){if(1&i&&e.\u0275\u0275element(0,"div",62),2&i){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("innerHTML",t.tooltipText,e.\u0275\u0275sanitizeHtml)}}const Sn=function(i){return{tablet:i}};function Dn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",56)(1,"div",57)(2,"div",58),e.\u0275\u0275element(3,"i-feather",59),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",60),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(7,On,1,1,"div",61),e.\u0275\u0275elementEnd()),2&i){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275property("ngClass",e.\u0275\u0275pureFunction1(6,Sn,t.isTablet)),e.\u0275\u0275advance(1),e.\u0275\u0275property("matTooltip",t.getTooltipTextWithLineBreaks()),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(6,4,"deliveryZones.schedule")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.isTablet)}}function Pn(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",46)(1,"div",11)(2,"div",12),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",13)(6,"mat-form-field",14)(7,"input",50),e.\u0275\u0275listener("input",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(4);return e.\u0275\u0275resetView(a.noWhitespace(r))}),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275elementEnd()()()()()}2&i&&(e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(4,2,"order.deliveryBuilding")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(8,4,"order.deliveryBuilding")))}function In(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",9),e.\u0275\u0275template(1,Pn,9,6,"div",45),e.\u0275\u0275elementStart(2,"div",46)(3,"div",11)(4,"div",12),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"div",13)(8,"mat-form-field",14),e.\u0275\u0275element(9,"input",47),e.\u0275\u0275pipe(10,"translate"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(11,"div",46)(12,"div",11)(13,"div",12),e.\u0275\u0275text(14),e.\u0275\u0275pipe(15,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"div",13)(17,"mat-form-field",14),e.\u0275\u0275element(18,"input",48),e.\u0275\u0275pipe(19,"translate"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(20,"div",46)(21,"div",11)(22,"div",12),e.\u0275\u0275text(23),e.\u0275\u0275pipe(24,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"div",13)(26,"mat-form-field",14),e.\u0275\u0275element(27,"input",49),e.\u0275\u0275pipe(28,"translate"),e.\u0275\u0275elementEnd()()()()()),2&i){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.orderForm.get("address").value?null:t.orderForm.get("address").value.addressName)&&!(null!=t.orderForm.get("address").value&&null!=t.orderForm.get("address").value.detailAddress&&t.orderForm.get("address").value.detailAddress.building)),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(6,11,"order.deliveryApartment")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(10,13,"order.deliveryApartment")),e.\u0275\u0275property("afterDotAmount",0),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(15,15,"order.deliveryFloor")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(19,17,"order.deliveryFloor")),e.\u0275\u0275property("afterDotAmount",0)("allowNegative",!0),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(24,19,"order.deliveryEntrance")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(28,21,"order.deliveryEntrance")),e.\u0275\u0275property("afterDotAmount",0)}}function En(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",44)(1,"div",10)(2,"div",11)(3,"div",12),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",13)(7,"mat-form-field",14),e.\u0275\u0275element(8,"textarea",51),e.\u0275\u0275pipe(9,"translate"),e.\u0275\u0275elementEnd()()()()()),2&i){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("ngStyle",!t.currentDelivery.showAddress&&e.\u0275\u0275pureFunction0(7,G)),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(5,3,"order.deliveryComent")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(9,5,"order.deliveryComentHint"))}}function Ln(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,In,29,23,"div",31),e.\u0275\u0275template(2,En,10,8,"div",42),e.\u0275\u0275elementContainerEnd()),2&i){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.showAddress&&(null==t.orderForm.get("address").value||null==t.orderForm.get("address").value.detailAddress?null:t.orderForm.get("address").value.detailAddress.street)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.extraField)}}function Tn(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",46)(1,"div",11)(2,"div",12),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",13)(6,"mat-form-field",14)(7,"input",50),e.\u0275\u0275listener("input",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(5);
1return e.\u0275\u0275resetView(a.noWhitespace(r))}),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275elementEnd()()()()()}2&i&&(e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(4,2,"order.deliveryBuilding")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(8,4,"order.deliveryBuilding")))}function kn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",44),e.\u0275\u0275template(1,Tn,9,6,"div",45),e.\u0275\u0275elementStart(2,"div",46)(3,"div",11)(4,"div",12),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"div",13)(8,"mat-form-field",14),e.\u0275\u0275element(9,"input",47),e.\u0275\u0275pipe(10,"translate"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(11,"div",46)(12,"div",11)(13,"div",12),e.\u0275\u0275text(14),e.\u0275\u0275pipe(15,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"div",13)(17,"mat-form-field",14),e.\u0275\u0275element(18,"input",48),e.\u0275\u0275pipe(19,"translate"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(20,"div",46)(21,"div",11)(22,"div",12),e.\u0275\u0275text(23),e.\u0275\u0275pipe(24,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"div",13)(26,"mat-form-field",14),e.\u0275\u0275element(27,"input",49),e.\u0275\u0275pipe(28,"translate"),e.\u0275\u0275elementEnd()()()()()),2&i){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction0(24,G)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.orderForm.get("address").value?null:t.orderForm.get("address").value.addressName)&&!(null!=t.orderForm.get("address").value&&null!=t.orderForm.get("address").value.detailAddress&&t.orderForm.get("address").value.detailAddress.building)),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(6,12,"order.deliveryApartment")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(10,14,"order.deliveryApartment")),e.\u0275\u0275property("afterDotAmount",0),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(15,16,"order.deliveryFloor")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(19,18,"order.deliveryFloor")),e.\u0275\u0275property("afterDotAmount",0)("allowNegative",!0),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(24,20,"order.deliveryEntrance")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(28,22,"order.deliveryEntrance")),e.\u0275\u0275property("afterDotAmount",0)}}function Fn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",44)(1,"div",10)(2,"div",11)(3,"div",12),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",13)(7,"mat-form-field",14),e.\u0275\u0275element(8,"textarea",51),e.\u0275\u0275pipe(9,"translate"),e.\u0275\u0275elementEnd()()()()()),2&i){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275property("ngStyle",!t.currentDelivery.showAddress&&e.\u0275\u0275pureFunction0(7,G)),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(5,3,"order.deliveryComent")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(9,5,"order.deliveryComentHint"))}}function zn(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-google-delivery-zones",65),e.\u0275\u0275listener("calculateDeliveryPrice",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(3);return e.\u0275\u0275resetView(a.calculateDeliveryPrice(r))}),e.\u0275\u0275template(1,kn,29,25,"div",42),e.\u0275\u0275template(2,Fn,10,8,"div",42),e.\u0275\u0275elementEnd()}if(2&i){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("workSchedule",t.tooltipText)("polygonArray",t.polygonArray),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.showAddress&&(null==t.orderForm.get("address").value||null==t.orderForm.get("address").value.detailAddress?null:t.orderForm.get("address").value.detailAddress.street)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.extraField)}}function An(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",46)(1,"div",11)(2,"div",12),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",13)(6,"mat-form-field",14)(7,"input",50),e.\u0275\u0275listener("input",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(5);
1return e.\u0275\u0275resetView(a.noWhitespace(r))}),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275elementEnd()()()()()}2&i&&(e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(4,2,"order.deliveryBuilding")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(8,4,"order.deliveryBuilding")))}function Bn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",44),e.\u0275\u0275template(1,An,9,6,"div",45),e.\u0275\u0275elementStart(2,"div",46)(3,"div",11)(4,"div",12),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"div",13)(8,"mat-form-field",14),e.\u0275\u0275element(9,"input",47),e.\u0275\u0275pipe(10,"translate"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(11,"div",46)(12,"div",11)(13,"div",12),e.\u0275\u0275text(14),e.\u0275\u0275pipe(15,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"div",13)(17,"mat-form-field",14),e.\u0275\u0275element(18,"input",48),e.\u0275\u0275pipe(19,"translate"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(20,"div",46)(21,"div",11)(22,"div",12),e.\u0275\u0275text(23),e.\u0275\u0275pipe(24,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(25,"div",13)(26,"mat-form-field",14),e.\u0275\u0275element(27,"input",49),e.\u0275\u0275pipe(28,"translate"),e.\u0275\u0275elementEnd()()()()()),2&i){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction0(24,G)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",(null==t.orderForm.get("address").value?null:t.orderForm.get("address").value.addressName)&&!(null!=t.orderForm.get("address").value&&null!=t.orderForm.get("address").value.detailAddress&&t.orderForm.get("address").value.detailAddress.building)),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(6,12,"order.deliveryApartment")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(10,14,"order.deliveryApartment")),e.\u0275\u0275property("afterDotAmount",0),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(15,16,"order.deliveryFloor")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(19,18,"order.deliveryFloor")),e.\u0275\u0275property("afterDotAmount",0)("allowNegative",!0),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(24,20,"order.deliveryEntrance")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(28,22,"order.deliveryEntrance")),e.\u0275\u0275property("afterDotAmount",0)}}function Rn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",44)(1,"div",10)(2,"div",11)(3,"div",12),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",13)(7,"mat-form-field",14),e.\u0275\u0275element(8,"textarea",51),e.\u0275\u0275pipe(9,"translate"),e.\u0275\u0275elementEnd()()()()()),2&i){const t=e.\u0275\u0275nextContext(4);e.\u0275\u0275property("ngStyle",!t.currentDelivery.showAddress&&e.\u0275\u0275pureFunction0(7,G)),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(5,3,"order.deliveryComent")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(9,5,"order.deliveryComentHint"))}}function Vn(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"app-delivery-zones",65),e.\u0275\u0275listener("calculateDeliveryPrice",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(3);return e.\u0275\u0275resetView(a.calculateDeliveryPrice(r))}),e.\u0275\u0275template(1,Bn,29,25,"div",42),e.\u0275\u0275template(2,Rn,10,8,"div",42),e.\u0275\u0275elementEnd()}if(2&i){const t=e.\u0275\u0275nextContext(3);e.\u0275\u0275property("workSchedule",t.tooltipText)("polygonArray",t.polygonArray),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.showAddress&&(null==t.orderForm.get("address").value||null==t.orderForm.get("address").value.detailAddress?null:t.orderForm.get("address").value.detailAddress.street)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.extraField)}}function Zn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",8),e.\u0275\u0275template(1,zn,3,4,"app-google-delivery-zones",63),e.\u0275\u0275pipe(2,"async"),e.\u0275\u0275template(3,Vn,3,4,"ng-template",null,64,e.\u0275\u0275templateRefExtractor),e.\u0275\u0275elementEnd()),2&i){const t=e.\u0275\u0275reference(4),n=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.useGoogleMaps&&e.\u0275\u0275pipeBind1(2,2,n.setGoogleMapsLoaded))("ngIfElse",t)}}function Nn(i,o){1&i&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1,"OK"),e.\u0275\u0275elementEnd())}function jn(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"validationErrors.required")," "))}function Un(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",8)(1,"div",9)(2,"div",10)(3,"div",11)(4,"div",12),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"div",13)(8,"mat-form-field",14),e.\u0275\u0275element(9,"input",67),e.\u0275\u0275pipe(10,"translate"),e.\u0275\u0275elementStart(11,"mat-datepicker-toggle",68),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext(3);
1return e.\u0275\u0275resetView(r.showTimePickerAlert())}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(12,"ngx-mat-datetime-picker",69,70),e.\u0275\u0275template(14,Nn,2,0,"ng-template"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(15,jn,3,3,"mat-error",7),e.\u0275\u0275elementEnd()()()()()()}if(2&i){const t=e.\u0275\u0275reference(13),n=e.\u0275\u0275nextContext(3);e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(6,9,"order.dateControlHint")," "),e.\u0275\u0275advance(4),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(10,11,"order.datepickerPlaceholder")),e.\u0275\u0275property("ngxMatDatetimePicker",t)("min",n.minDate),e.\u0275\u0275advance(2),e.\u0275\u0275property("for",t),e.\u0275\u0275advance(1),e.\u0275\u0275property("showSeconds",!1)("hideTime",n.hidetime)("defaultTime",n.minTime),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",n.orderForm.get("executeDate").hasError("required"))}}function Gn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",5)(1,"h2"),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(4,"app-radio-button-group",66),e.\u0275\u0275template(5,Un,16,13,"div",32),e.\u0275\u0275elementEnd()),2&i){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(3,3,"order.dateHead")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("radioItems",t.deliveryDateRadioItems),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf","off"==t.orderForm.get("executeNow").value)}}function Hn(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",5)(2,"h2"),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"app-radio-button-group",30),e.\u0275\u0275listener("onChangeValue",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(r.changeDeliveryType())}),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",8),e.\u0275\u0275template(7,pn,6,5,"ng-container",7),e.\u0275\u0275template(8,Cn,3,2,"ng-container",7),e.\u0275\u0275template(9,Mn,2,1,"div",31),e.\u0275\u0275template(10,wn,11,4,"div",32),e.\u0275\u0275template(11,Dn,8,8,"div",33),e.\u0275\u0275template(12,Ln,3,2,"ng-container",7),e.\u0275\u0275template(13,Zn,5,4,"div",32),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(14,Gn,6,5,"div",4),e.\u0275\u0275elementContainerEnd()}if(2&i){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(4,10,"order.deliveryHead")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("radioItems",t.deliveriesRadioItems),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",t.currentDelivery.showAddress&&t.currentDelivery.deliveryType!==t.orderDeliveryTypes.COURIER),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.deliveryType===t.orderDeliveryTypes.COURIER&&!t.isShowZones),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.supportDeliveryService&&t.currentDelivery.deliveryType!=t.orderDeliveryTypes.COURIER),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.addresses.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.deliveryType!==t.orderDeliveryTypes.COURIER&&t.currentDelivery.workSchedules.length||t.currentDelivery.deliveryType===t.orderDeliveryTypes.COURIER&&t.currentDelivery.workSchedules.length&&!t.isShowZones||t.currentDelivery.deliveryType===t.orderDeliveryTypes.PICKUP&&(null==t.orderForm.get("address").value||null==t.orderForm.get("address").value.workSchedules?null:t.orderForm.get("address").value.workSchedules.length)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.deliveryType!==t.orderDeliveryTypes.COURIER),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.currentDelivery.deliveryType===t.orderDeliveryTypes.COURIER&&t.isShowZones),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.showDateAndTimeBlock)}}function Wn(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"validationErrors.required")," "))}function $n(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"mat-option",39),e.\u0275\u0275text(2),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementContainerEnd()),2&i){const t=o.$implicit,n=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("value",t.id),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.getNameByLang(n.mainLanguage)," ")}}function Kn(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",5)(1,"h2"),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"app-use-order-bonuses",71),e.\u0275\u0275listener("onUseBonuses",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();
1return e.\u0275\u0275resetView(a.useBonuses(r))}),e.\u0275\u0275elementEnd()()}if(2&i){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,5,"order.bonusesHead")),e.\u0275\u0275advance(2),e.\u0275\u0275property("userBalance",t.userData.balance)("orderTotalPrice",t.orderTotalPrice)("bonusesBasePrice",t.bonusesBasePrice)("useBonusesCount",t.useBonusesCount)}}function Qn(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",5)(1,"h2"),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"app-use-promocode",72),e.\u0275\u0275listener("onPromoCodeChanege",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(a.usePromocode(r))}),e.\u0275\u0275elementEnd()()}if(2&i){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(3,3,"order.promocodHead")),e.\u0275\u0275advance(2),e.\u0275\u0275property("shoppingCartData",t.shoppingCartData)("promoCode",t.promoCode)}}function Xn(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",5)(1,"div",73)(2,"div",74),e.\u0275\u0275element(3,"i-feather",75),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",76),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275elementEnd()(),e.\u0275\u0275element(7,"div",77),e.\u0275\u0275elementEnd()),2&i){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(6,2,"order.additionalText")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("innerText",t.orderAdditionalText)}}const Yn=function(){return{type:"order-info",showPromoCodeInput:!1,showSupportBtn:!0}};let Ye=(()=>{class i{constructor(t,n,r,a,s,m,g,f,D,N,pe,ce,xe,Me,be,we,Oe){this.analyticsService=t,this.translateService=n,this.route=r,this.shoppingCartService=a,this.dialog=s,this.amSnackbarService=m,this.authService=g,this.appService=f,this.orderService=D,this.router=N,this.fb=pe,this.adapter=ce,this.deliveryZonesService=xe,this.resizeService=Me,this.offersService=be,this.mainService=we,this.userService=Oe,this.userData=new ue.Z,this.deliveryPrice=0,this.currentDelivery=new He.oq,this.shoppingCartData=[],this.paymentsRadioItems=[],this.deliveriesRadioItems=[],this.deliveryDateRadioItems=[],this.subscriptions=new Ge.w0,this.repeatOrderId=null,this.beginCheckoutEventSent=!1,this.isLoading=!0,this.isLoaddingPage=!1,this.productsInitialized=!1,this.wayOfCommunicationsList=[],this.useBonusesCount=0,this.minOrderTotal=0,this.userAddress=[],this.isAvailableUserAddress=!1,this.showPersonalData=(0,B.AC)(),this.showDateAndTimeBlock=(0,B.if)(),this.minDate=new Date((new Date).getTime()+6e4*X.N.deliveryMinimumTime),this.minTime=[this.minDate.getHours(),this.minDate.getMinutes()],this.hidetime=!0,this.phoneControl=new c.p4(null,c.kI.required),this.isHideDeliveries=!1,this.bonusesBasePrice=0,this.isShowZones=!1,this.showEmailField=!1,this.isUpdatingEmail=!1,this.hasPromptedGlobalOrderEmailOnLoad=!1,this.polygonArray=[],this.setGoogleMapsLoaded=new x.X(!1),this.useGoogleMaps=X.N.useGoogleMaps,this.isTablet=!1,this.tooltipText="",this.orderAdditionalText="",this.isShowCounter=!1,this.isQuickOrder=!1,this.paymentByBonuses=!0,this.promocodes=!0,this.orderCommentMsg=(0,B.Gt)(),this.orderDeliveryTypes=k}isEmailRequiredForAllOrders(){return!!this.appService.config?.config?.clientAppFeatures?.order?.isEmailRequiredForOrder}isCurrentPaymentEmailRequired(){return!(!this.currentPaymentType||!this.currentPaymentType.isEmailRequired&&!this.appService.config?.config?.info?.payments?.find(t=>t.paymentType===this.currentPaymentType.value)?.isEmailRequired)}isEmailRequiredForOrderFlow(){return this.isEmailRequiredForAllOrders()||this.isCurrentPaymentEmailRequired()}ngOnDestroy(){this.subscriptions&&this.subscriptions.unsubscribe()}ngOnInit(){this.setGoogleMapsLoaded=this.appService.setGoogleMapsLoaded,this.adapter.setLocale(this.appService.mainLanguage),this.adapter.getFirstDayOfWeek=()=>1,this.userAddress=this.authService.user.addresses,this.userData=this.authService.user,this.hidetime=X.N.datapickerHidetime,this.setConfigData(),this.setResizeServiceSubscription(),this.setPhoneControlValue(),this.buildOrderForm(),this.setQueryParamsSubscription(),this.setDeliveryZonesSubscription(),this.setAppServiceSubscription(),this.orderForm.get("paymentType").value&&this.setCurrentPaymentType(this.orderForm.get("paymentType").value)}setConfigData(){this.isLoaddingPage=!0,this.subscriptions.add(this.mainService.getConfig().pipe((0,I.x)(()=>{this.isLoaddingPage=!1})).subscribe(t=>{this.orderAdditionalText=t.data.config.info.aboutOrderAdditional.find(r=>r.lang===this.appService.mainLanguage)?.about,this.isAvailableUserAddress=t.data.config.functions.usersDatabase.locations,this.wayOfCommunicationsList=t.data.config.info.waysOfCommunications.filter(r=>!0===r.isUse),this.orderForm&&!this.orderForm.get("wayOfCommunicationId").value&&this.wayOfCommunicationsList.length>0&&this.orderForm.get("wayOfCommunicationId").setValue(this.wayOfCommunicationsList[0].id),this.paymentByBonuses=t.data.config.functions.paymentByBonuses.available,this.promocodes=t.data.config.functions.financialSystem.promocodes,this.mainLanguage=this.appService.mainLanguage,this.paymentsR
1adioItems=t.data.config.info.payments.map(r=>({label:r.getPaymentNameByLang(this.appService.mainLanguage),value:r.paymentType,values:r.values,service:r.service||null,isNewPaymentApi:r.isNewPaymentApi,isEmailRequired:r.isEmailRequired})),this.deliveriesRadioItems=t.data.config.info.deliveries.map(r=>({label:r.getDeliveryNameByLang(this.appService.mainLanguage),value:r.deliveryType}));const n=this.appService.config.config.functions.orderDeliveryTime;this.deliveryDateRadioItems=[{label:this.translateService.instant("order.deliveryDateExecuteNow"),value:"on",configParam:n.executeNow},{label:this.translateService.instant("order.deliveryExecuteDate"),value:"off",configParam:n.datePicker}].filter(r=>r.configParam),this.loadOrders(),this.checkEmailRequirement(),this.maybeOpenGlobalOrderEmailOnPageLoad()}))}maybeOpenGlobalOrderEmailOnPageLoad(){!this.hasPromptedGlobalOrderEmailOnLoad&&this.orderForm&&this.isEmailRequiredForAllOrders()&&!this.authService.user?.email&&(this.hasPromptedGlobalOrderEmailOnLoad=!0,this.dialog.open(Te,{width:"500px",autoFocus:!1,panelClass:"dialog",data:{currentEmail:this.authService.user?.email||"",variant:"order"},disableClose:!1}).afterClosed().subscribe(r=>{if(!r)return;this.isUpdatingEmail=!0;const a=Object.assign(new ue.Z,this.authService.user);a.email=r,this.userService.updateUserData(a).subscribe(s=>{this.isUpdatingEmail=!1,s&&(this.authService.user.email=r,this.userData.email=r,this.orderForm.get("email").setValue(r),this.checkEmailRequirement(),this.amSnackbarService.openSnackbar("success",{notification:{body:this.translateService.instant("order.emailUpdated")}}))},()=>{this.isUpdatingEmail=!1,this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant("order.emailUpdateError")}})})}))}setResizeServiceSubscription(){this.subscriptions.add(this.resizeService.isTablet$.subscribe(t=>{this.isTablet=t}))}setPhoneControlValue(){this.phoneControl.setValue(this.userData.phone||this.authService.user.phone||null)}setQueryParamsSubscription(){this.subscriptions.add(this.route.queryParams.subscribe(t=>{t.orderId?(this.repeatOrderId=t.orderId,this.setOrderShoppingCartData(t.orderId),this.apiCalculatePrice()):t.quick_order?this.setQuickOrderdata():this.setShoppingCartData()}))}setDeliveryZonesSubscription(){this.subscriptions.add(this.deliveryZonesService.get().subscribe(t=>{const n=t.data.length>0;this.isShowZones=n,this.polygonArray=t.data,n||this.apiCalculatePrice()}))}setAppServiceSubscription(){this.subscriptions.add(this.appService.appSubject.subscribe(t=>{t.type===qt.z.changeMainSettings&&this.setConfigData()}))}getTooltipContent(){if(this.tooltipText="",this.currentDelivery.deliveryType==this.orderDeliveryTypes.PICKUP)for(const t of this.orderForm.get("address").value?.workSchedules??[]){const r=t.days.map(a=>this.getWeekDayName(a)).join(", ");this.tooltipText+=`${r}: ${t.start}-${t.end}<br>`.trim()}else for(const t of this.currentDelivery.workSchedules){const r=t.days.map(a=>this.getWeekDayName(a)).join(", ");this.tooltipText+=`${r}: ${t.start}-${t.end}<br>`.trim()}}getTooltipTextWithLineBreaks(){return this.tooltipText.replace(/<br>/g,"\n")}showTimePickerAlert(){if(X.N.deliveryMinimumTime<=0)return;const t={title:this.translateService.instant("main.info"),message:this.translateService.instant("order.minimumDeliveryTime",{time:X.N.deliveryMinimumTime}),successBtn:this.translateService.instant("button.understand")};this.dialog.open(Le.W,{autoFocus:!1,panelClass:"dialog",data:t})}getWeekDayName(t){return this.translateService.instant("order.errorAddressDelivery"),[this.translateService.instant("daysOfWeek.monday"),this.translateService.instant("daysOfWeek.tuesday"),this.translateService.instant("daysOfWeek.wednesday"),this.translateService.instant("daysOfWeek.thursday"),this.translateService.instant("daysOfWeek.friday"),this.translateService.instant("daysOfWeek.saturday"),this.translateService.instant("daysOfWeek.sunday")][t-1]}setQuickOrderdata(){const{id:t,modifiers:n,count:r}=this.shoppingCartService.quickOrderItem;this.subscriptions.add(this.offersService.fetchById(t).pipe((0,V.U)(a=>(a.data.modifiers?.some(m=>
1m.modificators.length)&&a.data.modifiers.forEach((m,g)=>{if(n[g]?.selectedList&&n[g].selectedList.length)for(let f=0;f<n[g].selectedList.length;f++){const D=new At.id;D.m=n[g].selectedList[f].m,D.v=n[g].selectedList[f].v,D.payload=n[g].selectedList[f].payload,m.selectedList[f]=D}}),a.data.count=r,a)),(0,I.x)(()=>{this.isLoading=!1,this.isShowCounter=!1,this.productsInitialized=!0})).subscribe(a=>{const s=[{...a.data}],m=a.data;this.shoppingCartData=s.map(g=>({id:g.id,count:g.count||1,offer:m,totalPrice:g.price*g.count,clientId:g.id,typeOrder:"QUICK"})),this.isQuickOrder=!0,this.checkIsDeliveryIsAvailable(this.shoppingCartData),this.apiCalculatePrice()}))}setShoppingCartData(){this.subscriptions.add(this.shoppingCartService.getShopingCartOffers().pipe((0,I.x)(()=>{this.isLoading=!1,this.productsInitialized=!0})).subscribe(t=>{this.checkIsDeliveryIsAvailable(t.items),this.minOrderTotal=t.minOrderTotal,this.shoppingCartData=t.items,this.apiCalculatePrice()}))}setCurrentPaymentType(t){if("string"==typeof t){const n=this.paymentsRadioItems.find(r=>r.value===t);t=n?{value:n.value,additionalField:n.service||null}:{value:t,additionalField:null}}if(t?.value){const n=this.paymentsRadioItems.find(r=>r.value===t?.value&&(r.service||null)===(t?.additionalField||null));if(n){const r=!!n.isEmailRequired||!!this.appService.config?.config?.info?.payments?.find(s=>s.paymentType===n.value)?.isEmailRequired,a=this.authService.user?.email;if(r&&!a)return void this.openEmailDialog(n);this.currentPaymentType=n,n.service?this.orderForm.get("paymentType").setValue({value:n.value,additionalField:n.service},{emitEvent:!1}):this.orderForm.get("paymentType").setValue(n.value,{emitEvent:!1}),this.checkEmailRequirement()}else this.currentPaymentType=null,this.checkEmailRequirement()}else this.currentPaymentType=null,this.checkEmailRequirement()}openEmailDialog(t){this.dialog.open(Te,{width:"500px",autoFocus:!1,panelClass:"dialog",data:{currentEmail:this.authService.user?.email||"",variant:"payment"},disableClose:!1}).afterClosed().subscribe(a=>{if(a){this.isUpdatingEmail=!0;const s=Object.assign(new ue.Z,this.authService.user);s.email=a,this.userService.updateUserData(s).subscribe(m=>{this.isUpdatingEmail=!1,m&&(this.authService.user.email=a,this.userData.email=a,this.orderForm.get("email").setValue(a),this.currentPaymentType=t,t.service?this.orderForm.get("paymentType").setValue({value:t.value,additionalField:t.service},{emitEvent:!1}):this.orderForm.get("paymentType").setValue(t.value,{emitEvent:!1}),this.checkEmailRequirement(),this.amSnackbarService.openSnackbar("success",{notification:{body:this.translateService.instant("order.emailUpdated")}}))},m=>{this.isUpdatingEmail=!1,this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant("order.emailUpdateError")}}),this.orderForm.get("paymentType").setValue(null,{emitEvent:!1}),this.currentPaymentType=null})}else this.orderForm.get("paymentType").setValue(null,{emitEvent:!1}),this.currentPaymentType=null})}openEmailDialogForSubmit(){const t=this.isEmailRequiredForAllOrders()?"order":"payment";this.dialog.open(Te,{width:"500px",autoFocus:!1,panelClass:"dialog",data:{currentEmail:this.authService.user?.email||"",variant:t},disableClose:!1}).afterClosed().subscribe(r=>{if(!r)return;this.isUpdatingEmail=!0;const a=Object.assign(new ue.Z,this.authService.user);a.email=r,this.userService.updateUserData(a).subscribe(s=>{this.isUpdatingEmail=!1,s&&(this.authService.user.email=r,this.userData.email=r,this.orderForm.get("email").setValue(r),this.checkEmailRequirement(),this.createOrder())},()=>{this.isUpdatingEmail=!1,this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant("order.emailUpdateError")}})})})}updateUserEmail(){const t=this.orderForm.get("email").value,n=this.authService.user?.email;if(t&&this.orderForm.get("email").valid&&t!==n){this.isUpdatingEmail=!0;const r={...this.authService.user};return r.email=t,this.userService.updateUserData(r).pipe((0,I.x)(()=>{this.isUpdatingEmail=!1}))}return(0,me.of)(null)}setOrderShoppingCartData(t){this.subscriptions.add(this.orderService.getById(t).pipe((0,I.x)(()=>{this.isLoading=!1,this.productsInitialized=!0})).subscribe(n=>{const{data:r}=n;this.shoppingCartData=r.offers.map(m=>({id:m.offerId,sizeId:m.selectedOfferSize.id,count:m.count,offer:m,totalPrice:m.price*m.count,clientId:m.getClinetId()})),this.currentDelivery.deliveryType===this.orderDeliveryTypes.COURIER&&this.currentDelivery.showAddress&&!this.isShowZones&&n.data.addressLatitude&&n.data.addressLongitude&&(this.orderForm.get("address").patchValue({addressName:n.data.addressName,addressLatitude:n.data.addressLatitude,addressLongitude:n.data.addressLongitude,detailAddress:n.data?.additionalShippingInfo?.detailAddress||null}),this.orderForm.get("buildingName").setValue(null));let s=n.data.paymentType;(n.data.paymentService||n.data.service)&&(s={value:n.data.paymentType,additionalField:n.data.paymentService||n.data.service}),this.orderForm.patchValue({paymentType:s,deliveryType:n.data.deliveryType,executeNow:n.data.executeNow?"on":"off",executeDate:n.data.executeDate,phoneControl:n.data.phone,userName:n.data.customerName,comment:n.data.comment,deliveryComment:n.data.deliveryComment,wayOfCommunicationId:this.validateWayOfCommunication(n.data.wayOfCommunicationId)}),n.data.paymentType&&this.setCurrentPaymentType(s)}))}calculateDeliveryPrice(t){t?(this.orderForm.get("address").setValidators(c.kI.required),this.orderForm.get("address").patchValue(t),this.orderForm.get("buildingName").setValue(null),this.apiCalculatePrice()):(this.orderForm.get("address").setValidators(c.kI.required),this.orderForm.get("address").reset())}checkIsDeliveryIsAvailable(t){if(0===t.length)return;this.isHideDeliveries=t.every(r=>r.offer.isService&&!this.appService.config.config.functions.services.deliveries);const n=this.orderForm.get("deliveryType");this.isHideDeliveries?(this.changeDeliveryType(!1),n.reset(null),n.clearValidators()):n.setValidators(c.kI.required),n.updateV
1alueAndValidity()}userAddressChange(t){if(!t)return;const n=this.userAddress.find(g=>g.id===t),r=this.orderForm.get("address"),{locationName:a,locationLatitude:s,locationLongitude:m}=n;r.patchValue({addressName:a,addressLatitude:s,addressLongitude:m}),this.apiCalculatePrice()}onAutocompleteChange(){this.orderForm.get("userAddress").patchValue(null,{emitEvent:!1})}loadOrders(){(0,B.EF)()&&this.subscriptions.add(this.orderService.getListByUserId(this.authService.user.id,{pageSize:11,page:1,archived:!1}).subscribe(n=>{if(n.data.length){const r=n.data[0],a=this.paymentsRadioItems.find(g=>g.value===r.paymentType),s=this.deliveriesRadioItems.find(g=>g.value===r.deliveryType),m={paymentType:a?r.paymentType:null,deliveryType:s?r.deliveryType:null,phoneControl:r.phone,userName:r.customerName,wayOfCommunicationId:this.validateWayOfCommunication(r.wayOfCommunicationId)};this.orderForm.patchValue(m),r.paymentType&&this.setCurrentPaymentType(r.paymentType),r.addressLatitude&&r.addressLongitude&&(this.orderForm.get("address").patchValue({addressName:r.addressName||"",addressLatitude:r.addressLatitude||"",addressLongitude:r.addressLongitude||"",detailAddress:r.additionalShippingInfo?.detailAddress||null}),this.orderForm.get("buildingName").setValue(null)),r.deliveryType=this.currentDelivery.deliveryType,this.getTooltipContent()}}))}buildOrderForm(){this.orderForm=this.fb.group({paymentType:[null,c.kI.required],deliveryType:[null],executeNow:["on"],executeDate:[null],phoneControl:[this.userData.phone||this.authService.user.phone,c.kI.required],userName:[this.userData.name,c.kI.required],email:[this.userData.email||null,[c.kI.email]],wayOfCommunicationId:[null],comment:[null],deliveryComment:[null],apartmentName:[null],buildingName:[null],floorName:[null],entranceName:[null],address:[null],userAddress:[null],promoCode:[null]}),this.subscriptions.add(this.orderForm.get("deliveryType").valueChanges.subscribe(t=>{this.currentDelivery=this.appService.config.config.info.deliveries.find(n=>n.deliveryType==t)||new He.oq,this.currentDelivery.addresses.length&&this.orderForm.get("address").setValidators(c.kI.required)})),this.subscriptions.add(this.orderForm.get("executeNow").valueChanges.subscribe(t=>{"on"==t?this.orderForm.get("executeDate").disable():this.orderForm.get("executeDate").enable()})),this.subscriptions.add(this.orderForm.get("address").valueChanges.pipe((0,Bt.G)()).subscribe(([t,n])=>{t?.addressName!==n?.addressName&&(this.orderForm.get("buildingName").setValue(null),this.orderForm.get("floorName").setValue(null),this.orderForm.get("entranceName").setValue(null),this.orderForm.get("apartmentName").setValue(null))})),this.subscriptions.add(this.orderForm.get("paymentType").valueChanges.subscribe(()=>{this.checkEmailRequirement()}))}checkEmailRequirement(){this.orderForm&&(this.isEmailRequiredForOrderFlow()?this.authService.user?.email?(this.showEmailField=!1,this.orderForm.get("email").setValidators([c.kI.email])):(this.showEmailField=!0,this.orderForm.get("email").setValidators([c.kI.required,c.kI.email])):(this.showEmailField=!1,this.orderForm.get("email").setValidators([c.kI.email])),this.orderForm.get("email").updateValueAndValidity())}apiCalculatePrice(){const t=this.getOrderData();t.offers.length&&!this.isLoaddingPage&&(this.isLoading=!0,this.subscriptions.add(this.orderService.calculateCashback(t).pipe((0,ge.h)(n=>!!n.data)).subscribe(n=>{this.apiCalculate=n.data,this.bonusesBasePrice=(0,E.UF)(Number((this.apiCalculate?.totalPrice||0)+(this.apiCalculate?.bonusesUsed||0)-(this.apiCalculate?.deliveryPrice||0)),Number(localStorage.getItem($e._.rounding))),this.isLoading=!1},n=>{if(this.isLoading=!1,n?.error?.errors?.id===Ke.t.functionBlocked){const r={title:this.translateService.instant("main.info"),message:n?.error?.errors?.message||this.translateService.instant("order.errorOrderUnknown"),successBtn:this.translateService.instant("button.understand")};this.dialog.open(Le.W,{autoFocus:!1,panelClass:"dialog",data:r})}else this.showOrderErrorResponse(n?.error?.errors?.id,n?.error?.errors?.message)})))}changeDeliveryType(t=!0){this.getTooltipContent();const n=this.orderForm.get("address");n.patchValue({addressName:null,addressLatitude:null,addressLongitude:null,detailAddress:null}),this.orderForm.patchValue({apartmentName:null,buildingName:null,floorName:null,entranceName:null,deliveryComment:null}
1),n.reset(),n.clearValidators(),n.updateValueAndValidity(),t&&this.apiCalculatePrice()}createOrder(){if(this.isLoaddingPage)return;(0,Y.c2)(this.orderForm);const t=this.orderForm.value;if(!this.isHideDeliveries){const n=!t.address||!t.address.addressLatitude&&!t.address.addressLongitude&&this.currentDelivery.deliveryType!==this.orderDeliveryTypes.MEEST,r=!((this.currentDelivery.deliveryType===this.orderDeliveryTypes.MEEST||this.currentDelivery.deliveryType===this.orderDeliveryTypes.NOVAPOSHTA||this.currentDelivery.deliveryType===this.orderDeliveryTypes.UKRPOSHTA||t.address?.detailAddress)&&(t.address?.detailAddress?.building||t.buildingName||!t.apartmentName&&!t.entranceName&&!t.floorName));if(this.currentDelivery.showAddress&&(n||r))return void this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant("order.errorAddressDelivery")}})}if(!this.isHideDeliveries&&this.currentDelivery?.deliveryType===this.orderDeliveryTypes.NOVAPOSHTA){const n=t.address;if(!(n&&"object"==typeof n&&n.city&&n.city?.city&&n.warehouse&&n.warehouse?.warehouse))return void this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant("order.errorAddressDelivery")}})}if(this.isEmailRequiredForOrderFlow()){const n=(this.authService.user?.email||"").trim(),r=this.orderForm.get("email"),s=!!(r?.value||"").trim()&&r?.valid;if(!n&&!s)return(0,Y.c2)(this.orderForm),void this.openEmailDialogForSubmit()}this.orderForm.valid?this.proceedWithOrderCreation():this.showErrorForm()}proceedWithOrderCreation(){this.isLoaddingPage=!0,this.apiCalculatePrice();const t=this.getOrderData();let n=null;"onlinePayment"===t.paymentType&&this.appService.config.config.functions.onlinePayment.available&&(n=window.open("","_blank")),this.orderService.create(t).subscribe(r=>{console.log("order.data",r.data),this.orderService.completedOrder=r.data,this.shoppingCartService.clearQuickOrderItem(),!this.repeatOrderId&&!this.isQuickOrder&&this.shoppingCartService.clearShopingCart(),this.useBonusesCount&&(this.authService.user.balance=this.authService.user.balance-this.useBonusesCount);let a=0;this.shoppingCartData.forEach(s=>{a+=s.count}),"onlinePayment"===r.data.paymentType&&this.appService.config.config.functions.onlinePayment.available?this.orderService.getPayUrl(r.data.id,r.data.paymentService).subscribe(s=>{n?(n.location.href=s.data.url,this.successCreateOrder()):(this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant("order.errorPAYMENT_SERVICE_ERROR")}}),window.location.href=s.data.url)},s=>{n&&n.close(),this.isLoaddingPage=!1,this.showOrderErrorResponse(s?.error?.errors?.id,s?.error?.errors?.message||s?.message),this.orderService.completedOrder.skipPaymentTracking=!0,this.successCreateOrder()}):(this.isLoaddingPage=!1,this.successCreateOrder())},r=>{if(this.isLoaddingPage=!1,n&&n.close(),"EMAIL_REQUIRED"===r?.error?.errors?.id||r?.error?.errors?.message?.includes("email"))return this.amSnackbarService.openSnackbar("error",{notification:{body:r?.error?.errors?.message||this.translateService.instant("order.emailRequired")}}),this.showEmailField=!0,this.orderForm.get("email").setValidators([c.kI.required,c.kI.email]),void this.orderForm.get("email").updateValueAndValidity();if(r?.error?.errors?.id===Ke.t.functionBlocked){const a={title:this.translateService.instant("main.info"),message:r?.error?.errors?.message||this.translateService.instant("order.errorOrderUnknown"),successBtn:this.translateService.instant("button.understand")};this.dialog.open(Le.W,{autoFocus:!1,panelClass:"dialog",data:a}).afterClosed().subscribe({next:()=>{this.router.navigate(["/"])}})}else this.showOrderErrorResponse(r?.error?.errors?.id,r?.error?.errors?.message)})}successCreateOrder(){this.router.navigate(["order/success-order"])}usePromocode(t){this.promoCode=t.promoCode,this.promoCodePrice=t.promoCodePrice,this.apiCalculatePrice()}useBonuses(t){this.useBonusesCount=t,this.apiCalculatePrice()}changeShoppingCart(t){const{items:n,totalPrice:r}=t;!n.length&&!this.isLoading&&this.router.navigate(["/"]),this.shoppingCartData=n,this.minOrderTotal=this.shoppingCartService.lastMinOrderTotal,this.checkIsDeliveryIsAvailable(n),!this.beginCheckoutEventSent&&r&&n.length>0&&(this.beginCheckoutEventSent=!0,this.analyticsService.beginCheckoutEvent({orderPriceKey:r,itemQuantityKey:n.reduce((a,s)=>
1(a+=s?.count,a),0)})),this.orderTotalPrice=r,this.promoCode=null}getOrderData(){let t=this.orderForm.getRawValue(),n=new he.z;n.userId=this.userData.id,n.executeNow="on"===t.executeNow,n.comment=t.comment,n.phone=t.phoneControl;let r=null;return"object"==typeof t.paymentType&&t.paymentType?.value?(n.paymentType=t.paymentType.value,r=t.paymentType.additionalField||null):n.paymentType=t.paymentType,n.service=r||this.currentPaymentType?.service||null,n.paymentService=r||this.currentPaymentType?.service||null,n.isNewPaymentApi=this.currentPaymentType?.isNewPaymentApi||!1,n.deliveryType=t.deliveryType,n.deliveryComment=t.deliveryComment,n.userName=t.userName,n.promoCode=this.promoCode,n.executeDate=t.executeDate,n.wayOfCommunicationId=t.wayOfCommunicationId,n.useBonuses=this.useBonusesCount,n.typeOrder=this.isQuickOrder?"QUICK":"",n.offers=this.shoppingCartData.map(a=>{const s=new Ut.V;return s.count=a.count||1,s.id=a.id,s.modifiers=a.offer.modifiers,s}),t.address&&(n.addressName="string"==typeof t.address?t.address||null:t.address.address&&"string"==typeof t.address.address?t.address.address:t.address.addressName?t.address.addressName:null,n.addressLatitude=t.address.addressLatitude||null,n.addressLongitude=t.address.addressLongitude||null,n.additionalShippingInfo||(n.additionalShippingInfo=new Wt.H),n.additionalShippingInfo.detailAddress=new Qe.F(t.address.detailAddress),n.additionalShippingInfo.type=t?.deliveryType||"",n.additionalShippingInfo.detailAddress&&(n.additionalShippingInfo.detailAddress.building||(n.additionalShippingInfo.detailAddress.building=t.buildingName||null),n.additionalShippingInfo.detailAddress.apartment=t.apartmentName||null,n.additionalShippingInfo.detailAddress.floor=t.floorName||null,n.additionalShippingInfo.detailAddress.entrance=t.entranceName||null),t.address?.city?.city&&t.address?.warehouse?.warehouse&&(n.additionalShippingInfo.city=t.address.city.city||null,n.additionalShippingInfo.warehouse=t.address.warehouse.warehouse||null)),n}changeOffer(t){t&&this.apiCalculatePrice()}showOrderErrorResponse(t,n){const r={BANED:"order.errorBANED",USER_NOT_FOUND:"order.errorUSER_NOT_FOUND",INVALID_COUNT_IN_ORDER_OFFERS_LIST:"order.errorINVALID_COUNT_IN_ORDER_OFFERS_LIST",INVALID_OFFERS_LIST:"order.errorINVALID_OFFERS_LIST",PROMO_NOT_FOUND:"order.errorPROMO_NOT_FOUND",INVALID_BONUSES_COUNT:"order.errorINVALID_BONUSES_COUNT",PROMO_ALREADY_USED:"order.errorPROMO_ALREADY_USED",NOT_AVAILABLE_PAYMENT_METHOD:"order.errorNOT_AVAILABLE_PAYMENT_METHOD",NOT_AVAILABLE_DELIVERY_METHOD:"order.errorNOT_AVAILABLE_DELIVERY_METHOD",PAYMENT_SERVICE_ERROR:"order.errorPAYMENT_SERVICE_ERROR"};if(t&&r[t]||n){if(this.amSnackbarService.openSnackbar("error",{notification:{body:r[t]?this.translateService.instant(r[t]):n}}),("NOT_AVAILABLE_PAYMENT_METHOD"===t||"NOT_AVAILABLE_DELIVERY_METHOD"===t)&&this.setConfigData(),"INVALID_BONUSES_COUNT"===t)return this.useBonusesCount=0,void this.apiCalculatePrice();this.useBonusesCount=0}}showErrorForm(){const t={paymentType:"order.errorPaymentType",deliveryType:"order.errorDeliveryType",userName:"order.error\u0421ontactDetails",address:"order.errorAddressDelivery",phoneControl:"validationErrors.invalidPhone",email:"order.emailRequired"};for(const n in t)if(!this.orderForm.get(n).valid)return void this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant(t[n])}})}noWhitespace(t){t.target.value.includes(" ")&&(t.target.value=t.target.value.replace(/ /g,""))}onAddressChange(t){this.getTooltipContent()}validateWayOfCommunication(t){if(!t){const a=this.wayOfCommunicationsList.find(s=>
1!0===s.isUse);return a?a.id:null}if(this.wayOfCommunicationsList.some(a=>a.id===t&&!0===a.isUse))return t;const r=this.wayOfCommunicationsList.find(a=>!0===a.isUse);return r?r.id:null}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(Rt.y),e.\u0275\u0275directiveInject(S.sK),e.\u0275\u0275directiveInject(fe.gz),e.\u0275\u0275directiveInject(Zt.F),e.\u0275\u0275directiveInject(ee.uw),e.\u0275\u0275directiveInject(K.E),e.\u0275\u0275directiveInject(Vt.e),e.\u0275\u0275directiveInject(P.z),e.\u0275\u0275directiveInject(_e.p),e.\u0275\u0275directiveInject(fe.F0),e.\u0275\u0275directiveInject(c.QS),e.\u0275\u0275directiveInject(U.fM),e.\u0275\u0275directiveInject(Nt),e.\u0275\u0275directiveInject(Xe._),e.\u0275\u0275directiveInject(Ht.b),e.\u0275\u0275directiveInject(Gt.J),e.\u0275\u0275directiveInject(jt.K))},i.\u0275cmp=e.\u0275\u0275defineComponent({type:i,selectors:[["app-order"]],decls:62,vars:45,consts:[[1,"order-container"],[1,"order-form",3,"formGroup"],["class","absolute opacity-bg",4,"ngIf"],[1,"order-form__raw"],["class","order-form__card",4,"ngIf"],[1,"order-form__card"],["formControlName","paymentType",3,"radioItems","additinalCondition","onChangeValue"],[4,"ngIf"],[1,"order-form__group"],[1,"order-form__group-raw"],[1,"order-form__group-col"],[1,"form-field"],[1,"form-field__lable"],[1,"form-field__control"],["appearance","outline",1,"am-input"],["matInput","","type","text","autocomplete","off","formControlName","userName"],["formControlName","phoneControl"],["formControlName","wayOfCommunicationId"],[4,"ngFor","ngForOf"],[1,"order-form__raw","order-form__raw--sm"],[1,"order-form__card","order-form__card--shopping-cart"],[3,"cardConfig","promocode","apiCalculate","shoppingCartData","isLoading","minOrderTotal","deliveryPrice","isShowCounter","changeShoppingCart","onCreateOrder","changeOffer"],["matInput","","formControlName","comment",1,"order-form__comment",3,"placeholder"],[1,"absolute","opacity-bg"],[1,"user-info"],[1,"user-info__item"],[1,"user-info__title"],["class","user-info__data",4,"ngIf"],[1,"user-info__data"],[3,"currentPaymentType"],["formControlName","deliveryType",3,"radioItems","onChangeValue"],["class","order-form__group-raw",4,"ngIf"],["class","order-form__group",4,"ngIf"],["class","order-form__workSchedules",3,"ngClass",4,"ngIf"],["class","order-form__group-raw",4,"ngIf","ngIfElse"],["nominatimAutoNonCourier",""],["appearance","outline",1,"am-input","am-input-with-clear"],["formControlName","userAddress",3,"placeholder","ngModelChange"],["class","auth-card__close","name","x","matSuffix","","mat-icon-button","","type","button",3,"click",4,"ngIf"],[3,"value"],["name","x","matSuffix","","mat-icon-button","","type","button",1,"auth-card__close",3,"click"],["formControlName","address",3,"onAddressChange","calculateDeliveryPrice"],["class","order-form__group-raw",3,"ngStyle",4,"ngIf"],["nominatimAutoCourier",""],[1,"order-form__group-raw",3,"ngStyle"],["class","order-form__group-col-full",4,"ngIf"],[1,"order-form__group-col-full"],["matInput","","formControlName","apartmentName","maxlength","5","appDigitOnly","",3,"placeholder","afterDotAmount"],["matInput","","formControlName","floorName","maxlength","5","appDigitOnly","",3,"placeholder","afterDotAmount","allowNegative"],["matInput","","formControlName","entranceName","maxlength","5","appDigitOnly","",3,"placeholder","afterDotAmount"],["matInput","","formControlName","buildingName","maxlength","6",3,"placeholder","input"],["matInput","","formControlName","deliveryComment","maxlength","500",3,"placeholder"],["formControlName","address",3,"currentDelivery",4,"rerenderComponentKey"],["formControlName","address",3,"currentDelivery"],["formControlName","address",3,"selectionChange"],[3,"value",4,"ngFor","ngForOf"],[1,"order-form__workSchedules",3,"ngClass"],["matTooltipClass","tooltip","matTooltipHideDelay","300","matTooltipPosition","above",1,"order-form__workSchedules-container",3,"matTooltip"],[1,"order-form__workSchedules-icon"],["name","clock"],[1,"order-form__workSchedules-title"],["class","order-form__workSchedules-body",3,"innerHTML",4,"ngIf"],[1,"order-form__workSchedules-body",3,"innerHTML"],[3,"workSchedule","polygonArray","calculateDeliveryPrice",4,"ngIf","ngIfElse"],["nominatimMap",""],[3,"workSchedule","polygonArray","calculateDeliveryPrice"],["formControlName","executeNow",3,"radioItems"],["readonly","","matInput","","formControlName","executeDate",3,"ngxMatDatetimePicker","placeholder","min"],["matSuffix","",3,"for","click"],[3,"showSeconds","hideTime","defaultTime"],["picker1",""],[3,"userBalance","orderTotalPrice","bonusesBasePrice","useBonusesCount","onUseBonuses"],[3,"shoppingCartData","promoCode","onPromoCodeChanege"],[1,"order-form__additionalText-title"],[1,"order-form__additionalText-icon"],["name","info"],[1,"order-form__additionalText-content"],[1,"order-form__additionalText-body",3,"innerText"]],template:function(t,n){1&t&&(e.\u0275\u0275elementStart(0,"div",0)(1,"form",1),e.\u0275\u0275template(2,en,1,0,"app-loader",2),e.\u0275\u0275elementStart(3,"div",3),e.\u0275\u0275template(4,nn,16,11,"div",4),e.\u0275\u0275elementStart(5,"div",5)(6,"h2"),e.\u0275\u0275text(7),e.\u0275\u0275pipe(8,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(9,"app-radio-button-group",6),e.\u0275\u0275listener("onChangeValue",function(a){return n.setCurrentPaymentType(a)}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(10,rn,2,1,"div",4),e.\u0275\u0275template(11,Hn,15,12,"ng-container",7),e.\u0275\u0275elementStart(12,"div",5)(13,"h2"),e.\u0275\u0275text(14),e.\u0275\u0275pipe(15,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(16,"div",8)(17,"div",9)(18,"div",10)(19,"div",11)(20,"div",12),e.\u0275\u0275text(2
11),e.\u0275\u0275pipe(22,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"div",13)(24,"mat-form-field",14),e.\u0275\u0275element(25,"input",15),e.\u0275\u0275template(26,Wn,3,3,"mat-error",7),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(27,"div",10)(28,"div",11)(29,"div",12),e.\u0275\u0275text(30),e.\u0275\u0275pipe(31,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(32,"div",13),e.\u0275\u0275element(33,"app-phone-input",16),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(34,"div",9)(35,"div",10)(36,"div",11)(37,"div",12),e.\u0275\u0275text(38),e.\u0275\u0275pipe(39,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(40,"div",13)(41,"mat-form-field",14)(42,"mat-select",17),e.\u0275\u0275template(43,$n,3,2,"ng-container",18),e.\u0275\u0275elementEnd()()()()()()()(),e.\u0275\u0275template(44,Kn,5,7,"div",4),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(45,"div",19)(46,"div",20)(47,"app-shopping-cart-card",21),e.\u0275\u0275listener("changeShoppingCart",function(a){return n.changeShoppingCart(a)})("onCreateOrder",function(){return n.createOrder()})("changeOffer",function(a){return n.changeOffer(a)}),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(48,Qn,5,5,"div",4),e.\u0275\u0275elementStart(49,"div",5)(50,"h2"),e.\u0275\u0275text(51),e.\u0275\u0275pipe(52,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(53,"div",11)(54,"div",12),e.\u0275\u0275text(55),e.\u0275\u0275pipe(56,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(57,"div",13)(58,"mat-form-field",14),e.\u0275\u0275element(59,"textarea",22),e.\u0275\u0275pipe(60,"translate"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275template(61,Xn,8,4,"div",4),e.\u0275\u0275elementEnd()()()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("formGroup",n.orderForm),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.isLoaddingPage),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.showPersonalData),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(8,28,"order.paymentHead")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("radioItems",n.paymentsRadioItems)("additinalCondition","service"),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.currentPaymentType&&n.currentPaymentType.values.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.productsInitialized&&!n.isHideDeliveries),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(15,30,"order.recipientHead")," "),e.\u0275\u0275advance(7),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(22,32,"order.userName")," "),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngIf",n.orderForm.get("userName").hasError("required")),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(31,34,"order.userPhone")," "),e.\u0275\u0275advance(8),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(39,36,"order.communicationHint")," "),e.\u0275\u0275advance(5),e.\u0275\u0275property("ngForOf",n.wayOfCommunicationsList),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.paymentByBonuses),e.\u0275\u0275advance(3),e.\u0275\u0275property("cardConfig",e.\u0275\u0275pureFunction0(44,Yn))("promocode",n.promoCodePrice)("apiCalculate",n.apiCalculate)("shoppingCartData",n.shoppingCartData)("isLoading",n.isLoading)("minOrderTotal",n.minOrderTotal)("deliveryPrice",n.deliveryPrice)("isShowCounter",n.isShowCounter),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.promocodes),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(52,38,"order.orderHead")),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(56,40,"order.orderControlHint")," "),e.\u0275\u0275advance(4),e.\u0275\u0275property("placeholder",e.\u0275\u0275pipeBind1(60,42,n.orderCommentMsg)),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.orderAdditionalText))},styles:[".order-form[_ngcontent-%COMP%]{display:flex;position:relative}.order-form__raw[_ngcontent-%COMP%]{flex:1;position:relative}.order-form__raw--sm[_ngcontent-%COMP%]{width:480px;flex:none;padding-left:24px}.order-form__card[_ngcontent-%COMP%]{padding:24px;
1background:var(--componentBackgroundColor);border-radius:4px;margin-bottom:24px;position:relative}.order-form__card--shopping-cart[_ngcontent-%COMP%]{padding-left:0;padding-right:0}.order-form__card--shopping-cart[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{height:64px;width:100%}.order-form__group[_ngcontent-%COMP%]{padding:10px 0 20px}.order-form__group[_ngcontent-%COMP%]:last-child{padding-bottom:0}.order-form__group-raw[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-bottom:24px}.order-form__group-raw[_ngcontent-%COMP%]:last-child{padding-bottom:0}.order-form__group-col[_ngcontent-%COMP%]{width:calc(50% - 10px)}.order-form__group-col[_ngcontent-%COMP%] .mat-select-value-text[_ngcontent-%COMP%]{color:red}.order-form__group-col-3[_ngcontent-%COMP%]{width:calc(33.3333333333% - 10px)}.order-form__group-col-3[_ngcontent-%COMP%] .mat-select-value-text[_ngcontent-%COMP%]{color:red}.order-form__group-col-full[_ngcontent-%COMP%]{width:100%;margin-right:10px}.order-form__group-col-full[_ngcontent-%COMP%]:last-child{margin-right:0}.order-form__group-col-full[_ngcontent-%COMP%] .mat-select-value-text[_ngcontent-%COMP%]{color:red}.order-form__btn-wrap[_ngcontent-%COMP%]{padding-top:16px}.order-form__btn-wrap[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{height:48px;width:100%}.order-form__workSchedules[_ngcontent-%COMP%]{color:var(--primaryColor);cursor:pointer;margin-bottom:24px}@media (max-width: 576px){.order-form__workSchedules[_ngcontent-%COMP%]{margin-bottom:20px}}.order-form__workSchedules[_ngcontent-%COMP%]:last-child{margin-bottom:0}.order-form__workSchedules.tablet[_ngcontent-%COMP%]{cursor:default;padding:16px;background-color:var(--mainBackgroundColor);border-radius:6px}.order-form__workSchedules-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;margin-bottom:12px}.order-form__workSchedules-icon[_ngcontent-%COMP%]{width:24px;height:24px}.order-form__workSchedules[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%], .order-form__workSchedules[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{color:var(--primaryColor)}.order-form__workSchedules-title[_ngcontent-%COMP%]{margin-left:10px;font-weight:600;font-size:16px;line-height:16px}.order-form__workSchedules-body[_ngcontent-%COMP%]{color:var(--mainTextColor);font-weight:400;font-size:16px;line-height:20px;white-space:pre-wrap;line-height:.8}.order-form__additionalText-title[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:16px}.order-form__additionalText-icon[_ngcontent-%COMP%]{width:32px;height:32px;display:flex;justify-content:center;align-items:center;border-radius:4px;background-color:var(--borderColor);margin-right:16px}.order-form__additionalText-icon[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%], .order-form__additionalText-icon[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{color:#2890cc;width:22px;height:22px}@media (min-width: 1200px) and (max-width: 1440px){.order-form__additionalText-icon[_ngcontent-%COMP%]{width:28px;height:28px;margin-right:8px}}.order-form__additionalText-content[_ngcontent-%COMP%]{font-weight:700;font-size:24px;line-height:132%;color:var(--mainTextColor)}@media (min-width: 1200px) and (max-width: 1440px){.order-form__additionalText-content[_ngcontent-%COMP%]{font-size:20px}}@media (max-width: 768px){.order-form__additionalText-content[_ngcontent-%COMP%]{font-size:20px}}.order-form__additionalText-body[_ngcontent-%COMP%]{font-weight:500;font-size:16px;line-height:135%;color:var(--greyTextColor);word-wrap:break-word}.order-form__comment[_ngcontent-%COMP%]{height:73px}@media (max-width: 1440px){.order-form__raw--sm[_ngcontent-%COMP%]{width:380px}}@media (max-width: 1200px){.order-form[_ngcontent-%COMP%]{flex-direction:column}.order-form__raw--sm[_ngcontent-%COMP%]{display:flex;flex-direction:column-reverse;width:100%;padding-left:0}.order-form__raw[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:nth-child(1){order:1}.order-form__raw[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:nth-child(2){order:4}.order-form__raw[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:nth-child(3){order:3}.order-form__raw[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:nth-child(4){order:2}}@media (max-width: 576px){.order-form__card--shopping-cart[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{height:44px}.order-form__raw--sm[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:last-child{margin-bottom:24px}.order-form__group-raw[_ngcontent-%COMP%]{flex-direction:column;padding-bottom:20px}.order-form__group-col[_ngcontent-%COMP%], .order-form__group-col-3[_ngcontent-%COMP%], .order-form__group-col-full[_ngcontent-%COMP%]{width:100%;margin-bottom:15px;margin-right:0}.order-form__group-col[_ngcontent-%COMP%]:last-child, .order-form__group-col-3[_ngcontent-%COMP%]:last-child, .order-form__group-col-full[_ngcontent-%COMP%]:last-child{margin-bottom:0}}.user-info[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.user-info__item[_ngcontent-%COMP%]{margin-right:8px;width:100%}.user-info__item[_ngcontent-%COMP%]:last-child{margin-right:0}.user-info__title[_ngcontent-%COMP%]{color:var(--mainTextColor);font-weight:700;font-size:14px;padding-bottom:8px}.user-info__data[_ngcontent-%COMP%]{color:var(--mainTextColor);font-weight:500;font-size:14px;position:relative}.user-info__data-verification[_ngcontent-%COMP%]{position:absolute;top:12px;font-size:14px;right:calc(0% + 12px);cursor:pointer;color:var(--primaryColor)}@media (max-width: 576px){.user-info[_ngcontent-%COMP%]{flex-direction:column}.user-info__item[_ngcontent-%COMP%]{margin-bottom:15px}.user-info__item[_ngcontent-%COMP%]:last-child{margin-bottom:0}}.user-bonuses[_ngcontent-%COMP%]{display:flex}.user-bonuses__control[_ngcontent-%COMP%]{width:360px}.user-bonuses__info[_ngcontent-%COMP%]{padding-left:30px;padding-top:20px}.user-bonuses__info[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:nth-child(2){padding-top:16px}@media (max-width: 576px){.user-bonuses[_ngcontent-%COMP%]{flex-direction:column-reverse}.user-bonuses__control[_ngcontent-%COMP%]{width:100%}.user-bonuses__info[_ngcontent-%COMP%]{padding:0;margin:0}.user-bonuses__info[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:nth-child(2){padding-top:0}.user-bonuses[_ngcontent-%COMP%] .user-info__item[_ngcontent-%COMP%]{margin-right:0;margin-bottom:15px!important}} .tooltip{line-height:.8!important;white-space:pre-line;font-weight:600;font-size:13px;line-height:16px;color:var(--darkGreyTextColor)!important;background-color:var(--borderColor);padding:16px!important;max-width:300px!important}.order-container[_ngcontent-%COMP%]{width:1560px;margin:0 auto;padding-top:50px;padding-bottom:30px}@media (max-width: 1660px){.order-container[_ngcontent-%COMP%]{width:90%}}h2[_ngcontent-%COMP%]{font-weight:700;font-size:24px;color:var(--mainTextColor);padding-bottom:16px}@media (max-width: 768px){h2[_ngcontent-%COMP%]{font-size:20px}}@media (max-width: 576px){h2[_ngcontent-%COMP%]{font-size:18px}}app-nominatim-autocomplete[_ngcontent-%COMP%], app-google-address-autocomplete[_ngcontent-%COMP%], app-support-delivery[_ngcontent-%COMP%]{display:block;width:100%}"]}),i})();var Jn=d(2234);const ei=[{path:"",component:Ye},{path:"success-order",component:d(8748).B}];let ti=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.\u0275\u0275defineNgModule({type:i}),i.\u0275inj=e.\u0275\u0275defineInjector({imports:[fe.Bz.forChild(ei),fe.Bz]}),i})();var ve=d(5032),Je=d(266);function ni(i,o){1&i&&e.\u0275\u0275element(0,"i-feather",5)}function ii(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"button",2),e.\u0275\u0275listener("click",function(){const a=e.\u0275\u0275restoreView(t).$implicit,s=e.\u0275\u0275nextContext();
1return e.\u0275\u0275resetView(s.setValueOnClick({value:a.value,additionalField:a[s.additinalCondition]||null}))}),e.\u0275\u0275template(2,ni,1,0,"i-feather",3),e.\u0275\u0275elementStart(3,"div",4),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementContainerEnd()}if(2&i){const t=o.$implicit,n=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275classProp("checked",n.value===t.value&&n.additinalCondition?t[n.additinalCondition]===n.additionalField:n.value===t.value)("disabled",n.radioIsDisabled),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.value===t.value&&n.additinalCondition?t[n.additinalCondition]===n.additionalField:n.value===t.value),e.\u0275\u0275advance(1),e.\u0275\u0275property("matTooltip",t.label),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.label," ")}}const ri={provide:c.JU,useExisting:(0,e.forwardRef)(()=>qe),multi:!0};let qe=(()=>{class i{constructor(){this.radioItems=[],this.radioIsRequired=!0,this.radioIsValid=!0,this.radioIsDisabled=!1,this.additinalCondition=null,this.onChangeValue=new e.EventEmitter,this.onChange=ve.Z,this.onTouched=ve.Z}set value(t){this.writeValue(t)}get value(){return this._value}get additionalField(){return this._additionalField}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}writeValue(t){"string"==typeof t?(this._value=t,this._additionalField=null,this.onChange(t),this.inputValue=t):t&&"object"==typeof t?(this._value=t?.value||null,this._additionalField=t?.additionalField||null,this.additinalCondition&&null!=this._additionalField?(this.onChange({value:this._value,additionalField:this._additionalField}),this.inputValue={value:this._value,additionalField:this._additionalField}):(this.onChange(t?.value||null),this.inputValue=t?.value||null)):(this._value=null,this._additionalField=null,this.onChange(null),this.inputValue=null)}setValueOnClick(t){this.radioIsDisabled||(this.writeValue(t),this.onChangeValue.emit({value:t.value,additionalField:t?.additionalField||null}))}}return i.\u0275fac=function(t){return new(t||i)},i.\u0275cmp=e.\u0275\u0275defineComponent({type:i,selectors:[["app-radio-button-group"]],inputs:{radioLabel:"radioLabel",radioItems:"radioItems",radioIsRequired:"radioIsRequired",radioIsValid:"radioIsValid",radioIsDisabled:"radioIsDisabled",additinalCondition:"additinalCondition",value:"value"},outputs:{onChangeValue:"onChangeValue"},features:[e.\u0275\u0275ProvidersFeature([ri])],decls:2,vars:1,consts:[[1,"radio-wrap"],[4,"ngFor","ngForOf"],["tabindex","0","type","button",1,"btn",3,"click"],["name","check",4,"ngIf"],[1,"radio-wrap__label",3,"matTooltip"],["name","check"]],template:function(t,n){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275template(1,ii,5,7,"ng-container",1),e.\u0275\u0275elementEnd()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",n.radioItems))},dependencies:[C.sg,C.O5,Q.u,Je.gM],styles:[".btn[_ngcontent-%COMP%]{position:relative;color:var(--primaryColor);background:var(--mainBackgroundColor);height:48px;width:336px;margin-right:8px;margin-bottom:15px;padding-left:41px;padding-right:41px;line-height:1.3}.btn[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%], .btn[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{position:absolute;left:5px;width:19px;height:19px}.btn[_ngcontent-%COMP%]:last-child{margin-right:0}.btn.checked[_ngcontent-%COMP%]{color:var(--lightTextColor);background:var(--primaryColor)}.btn.checked[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%], .btn.checked[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{color:var(--lightTextColor)}@media (max-width: 1660px){.btn[_ngcontent-%COMP%]{width:calc(32% - 5px)}}@media (max-width: 1440px){.btn[_ngcontent-%COMP%]{width:calc(50% - 5px);padding-left:25px;padding-right:25px;font-size:13px}.btn[_ngcontent-%COMP%]:nth-child(2n){margin-right:0}}@media (max-width: 768px){.btn[_ngcontent-%COMP%]{font-size:12px;height:100%;max-height:70px}}@media (max-width: 576px){.btn[_ngcontent-%COMP%]{width:100%;margin-right:0}}.radio-wrap[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}@media (min-width: 768px){.radio-wrap__label[_ngcontent-%COMP%]{display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;text-overflow:ellipsis;cursor:pointer}}"]}),i})();var et=d(9602),ke=d(1884),Fe=d(8505),ye=d(3900),ze=d(262),Ae=d(1845);let F=class{constructor(){this.delivery=null,this.cityRef=null,this.regionRef=null,this.districtRef=null,this.query=null}};(0,l.gn)([(0,p.ep)("delivery",String,!0),(0,l.w6)("design:type",String)],F.prototype,"delivery",void 0),(0,l.gn)([(0,p.ep)("cityRef",String,!0),(0,l.w6)("design:type",String)],F.prototype,"cityRef",void 0),(0,l.gn)([(0,p.ep)("regionRef",String,!0),(0,l.w6)("design:type",String)],F.prototype,"regi
1onRef",void 0),(0,l.gn)([(0,p.ep)("districtRef",String,!0),(0,l.w6)("design:type",String)],F.prototype,"districtRef",void 0),(0,l.gn)([(0,p.ep)("query",String,!0),(0,l.w6)("design:type",String)],F.prototype,"query",void 0),F=(0,l.gn)([(0,p.sT)("CitySearchParams")],F);let z=class{constructor(){this.delivery=null,this.regionName=null,this.districtName=null,this.regionRef=null}};(0,l.gn)([(0,p.ep)("delivery",String,!0),(0,l.w6)("design:type",String)],z.prototype,"delivery",void 0),(0,l.gn)([(0,p.ep)("regionName",String,!0),(0,l.w6)("design:type",String)],z.prototype,"regionName",void 0),(0,l.gn)([(0,p.ep)("districtName",String,!0),(0,l.w6)("design:type",String)],z.prototype,"districtName",void 0),(0,l.gn)([(0,p.ep)("regionRef",String,!0),(0,l.w6)("design:type",String)],z.prototype,"regionRef",void 0),z=(0,l.gn)([(0,p.sT)("RegionSearchParams")],z);let H=class{constructor(){this.areaDescription=null,this.city=null,this.description=null,this.ref=null}};(0,l.gn)([(0,p.ep)("AreaDescription",String,!0),(0,l.w6)("design:type",String)],H.prototype,"areaDescription",void 0),(0,l.gn)([(0,p.ep)("City",p.IK,!0),(0,l.w6)("design:type",Object)],H.prototype,"city",void 0),(0,l.gn)([(0,p.ep)("Description",String,!0),(0,l.w6)("design:type",String)],H.prototype,"description",void 0),(0,l.gn)([(0,p.ep)("Ref",String,!0),(0,l.w6)("design:type",String)],H.prototype,"ref",void 0),H=(0,l.gn)([(0,p.sT)("City")],H);let le=class{constructor(){this.order=new he.z,this.deliveryPrice=0}};(0,l.gn)([(0,p.ep)("order",he.z,!0),(0,l.w6)("design:type",he.z)],le.prototype,"order",void 0),(0,l.gn)([(0,p.ep)("deliveryPrice",Number,!0),(0,l.w6)("design:type",Number)],le.prototype,"deliveryPrice",void 0),le=(0,l.gn)([(0,p.sT)("DeliveryPrice")],le);let Z=class{constructor(){this.description=null,this.latitude=null,this.longitude=null,this.ref=null,this.warehouse=null}};(0,l.gn)([(0,p.ep)("Description",String,!0),(0,l.w6)("design:type",String)],Z.prototype,"description",void 0),(0,l.gn)([(0,p.ep)("Latitude",String,!0),(0,l.w6)("design:type",String)],Z.prototype,"latitude",void 0),(0,l.gn)([(0,p.ep)("Longitude",String,!0),(0,l.w6)("design:type",String)],Z.prototype,"longitude",void 0),(0,l.gn)([(0,p.ep)("Ref",String,!0),(0,l.w6)("design:type",String)],Z.prototype,"ref",void 0),(0,l.gn)([(0,p.ep)("Warehouse",p.IK,!0),(0,l.w6)("design:type",Object)],Z.prototype,"warehouse",void 0),Z=(0,l.gn)([(0,p.sT)("Warehouse")],Z);let te=class{constructor(){this.description=null,this.ref=null}};(0,l.gn)([(0,p.ep)("Description",String,!0),(0,l.w6)("design:type",String)],te.prototype,"description",void 0),(0,l.gn)([(0,p.ep)("Ref",String,!0),(0,l.w6)("design:type",String)],te.prototype,"ref",void 0),te=(0,l.gn)([(0,p.sT)("Region")],te);let tt=(()=>{class i{constructor(t,n){this._apiService=t,this.appService=n}getCities(t){return this._apiService.get(`/companies/${this.appService.subCompaniyId}/deliveries/getCities`,t,H)}getRegions(t){return this._apiService.get(`/companies/${this.appService.subCompaniyId}/deliveries/getRegions`,t,te)}getDistricts(t){return this._apiService.get(`/companies/${this.appService.subCompaniyId}/deliveries/getDistricts`,t,te)}getWarehouses(t){return this._apiService.get(`/companies/${this.appService.subCompaniyId}/deliveries/getWarehouses`,t,Z)}calculateDeliveryPrice(t){return this._apiService.post(`/companies/${this.appService.subCompaniyId}/orders/calculateDeliveryPrice`,t,le)}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275inject(We.s),e.\u0275\u0275inject(P.z))},i.\u0275prov=e.\u0275\u0275defineInjectable({token:i,factory:i.\u0275fac}),i})();var Ce=d(1224);const oi=["autoCompleteInputCity"],ai=["autoCompleteInputRegion"],si=["autoCompleteInputDistrict"],li=["autoCompleteInputWarehouses"];function di(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"validationErrors.required")," "))}function pi(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-option",26),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"deliveryForm.loading"),"... "))}function ci(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-option",26),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"deliveryForm.notFoundSearch")," "))}function mi(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"mat-option",27),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&i){const t=o.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.description," ")}}function gi(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,mi,2,2,"mat-option",18),e.\u0275\u0275elementContainerEnd()),2&i){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.regionOptions)}}function hi(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"validationErrors.required")," "))}function ui(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-option",26),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"deliveryForm.loading"),"... "))}function _i(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-option",26),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"deliveryForm.notFoundSearch")," "))}function fi(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"mat-option",27),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&i){const t=o.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.description," ")}}function vi(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,fi,2,2,"mat-option",18),e.\u0275\u0275elementContainerEnd()),2&i){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.districtOptions)}}function yi(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",2)(1,"div",3)(2,"div",4)(3,"div",5),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"div",6)(7,"mat-form-field",7),e.\u0275\u0275element(8,"input",20,21),e.\u0275\u0275template(10,di,3,3,"mat-error",10),e.\u0275\u0275elementStart(11,"mat-autocomplete",11,22),e.\u0275\u0275template(13,pi,3,3,"mat-option",13),e.\u0275\u0275template(14,ci,3,3,"mat-option",13),e.\u0275\u0275template(15,gi,2,1,"ng-container",10),e.\u0275\u0275elementEnd()()()()(),e.\u0275\u0275elementStart(16,"div",3)(17,"div",4)(18,"div",5),e.\u0275\u0275text(19),e.\u0275\u0275pipe(20,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(21,"div",6)(22,"mat-form-field",7),e.\u0275\u0275element(23,"input",23,24),e.\u0275\u0275template(25,hi,3,3,"mat-error",10),e.\u0275\u0275elementStart(26,"mat-autocomplete",16,25),e.\u0275\u0275template(28,ui,3,3,"mat-option",13),e.\u0275\u0275template(29,_i,3,3,"mat-option",13),e.\u0275\u0275template(30,vi,2,1,"ng-container",10),e.\u0275\u0275elementEnd()()()()()()),2&i){const t=e.\u0275\u0275reference(12),n=e.\u0275\u0275reference(27),r=e.\u0275\u0275nextContext();e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(5,16,"deliveryForm.regionHint")," "),e.\u0275\u0275advance(4),e.\u0275\u0275property("matAutocomplete",t),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.supportDeliveryForm.get("region").hasError("required")||r.supportDeliveryForm.get("district").hasError("whitespace")),e.\u0275\u0275advance(1),e.\u0275\u0275classMap("address-autocomplete"),e.\u0275\u0275property("displayWith",r.getOptionText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.isLoadingOptionsList),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.isLoadingOptionsList&&!r.regionOptions.length&&r.supportDeliveryForm.get("region").value),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.isLoadingOptionsList),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(20,18,"deliveryForm.districtHint")," "),e.\u0275\u0275advance(4),e.\u0275\u0275property("matAutocomplete",n),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.supportDeliveryForm.get("district").hasError("required")||r.supportDeliveryForm.get("district").hasError("whitespace")),e.\u0275\u0275advance(1),e.\u0275\u0275property("displayWith",r.getOptionText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",r.isLoadingOptionsList),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.isLoadingOptionsList&&!r.districtOptions.length&&r.supportDeliveryForm.get("district").value),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!r.isLoadingOptionsList)}}function Ci(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"validationErrors.required")," "))}function xi(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-option",26),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"deliveryForm.loading"),"... "))}function Mi(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-option",26),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"deliveryForm.notFoundSearch")," "))}function bi(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"mat-option",27)(1,"div",28)(2,"div",29),e.\u0275\u0275text(3),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",30),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd()()()),2&i){const t=o.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",t.description," "),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" \u043e\u0431\u043b. ",t.areaDescription," ")}}function wi(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275template(1,bi,6,3,"mat-option",18),e.\u0275\u0275elementContainerEnd()),2&i){const t=e.\u0275\u0275nextContext();e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",t.cityOptions)}}function Oi(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-error"),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"validationErrors.required")," "))}function Si(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-option",26),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"deliveryForm.loading"),"... "))}function Di(i,o){1&i&&(e.\u0275\u0275elementStart(0,"mat-option",26),e.\u0275\u0275text(1),e.\u0275\u0275pipe(2,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(2,1,"deliveryForm.notFoundSearch")," "))}function Pi(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"mat-option",27),e.\u0275\u0275text(1),e.\u0275\u0275elementEnd()),2&i){const t=o.$implicit;e.\u0275\u0275property("value",t),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",t.description," ")}}function Ii(i,o){1&i&&e.\u0275\u0275element(0,"app-loader",31)}const Ei=i=>i.value?null:{supportDelivery:!0};let Li=(()=>{class i{constructor(t,n,r,a,s){this.ngControl=t,this.supportDeliveryService=n,this.fb=r,this.translateService=a,this.amSnackbarService=s,this.currentDelivery="",this.isLoadingOptionsList=!1,this.isLoadingWriteV
1alue=!1,this.cityOptions=[],this.regionOptions=[],this.districtOptions=[],this.minLengthTerm=1,this.warehousesOptions=[],this.warehouses=[],this.EOrderDeliveryTypes=k,this.subs=new Ge.w0,this.onChange=ve.Z,this.onTouched=ve.Z,null!=this.ngControl&&(this.ngControl.valueAccessor=this)}ngOnChanges(){this.fullReset(),this.initForm(),this.supportDeliveryForm.reset(),this.initSubs()}ngAfterViewInit(){this.currentDelivery===k.UKRPOSHTA?(this.subs.add(this.regionAutoCompleteTrigger.panelClosingActions.subscribe(t=>{!t&&"object"!=typeof this.supportDeliveryForm.get("region").value&&!this.supportDeliveryForm.get("region").value&&(this.supportDeliveryForm.reset(),this.supportDeliveryForm.get("district").disable(),this.supportDeliveryForm.get("city").disable(),this.supportDeliveryForm.get("warehouse").disable(),this.changeComponentData())})),this.subs.add(this.districtAutoCompleteTrigger.panelClosingActions.subscribe(t=>{!t&&"object"!=typeof this.supportDeliveryForm.get("district").value&&!this.supportDeliveryForm.get("district").value&&(this.supportDeliveryForm.get("city").reset(),this.supportDeliveryForm.get("warehouse").reset(),this.supportDeliveryForm.get("city").disable(),this.supportDeliveryForm.get("warehouse").disable(),this.changeComponentData())}))):this.minLengthTerm=2,this.subs.add(this.cityAutoCompleteTrigger.panelClosingActions.subscribe(t=>{!t&&"object"!=typeof this.supportDeliveryForm.get("city").value&&!this.supportDeliveryForm.get("city").value&&(this.supportDeliveryForm.get("warehouse").reset(),this.supportDeliveryForm.get("warehouse").disable(),this.changeComponentData())})),this.subs.add(this.warehousesTriggerAutoCompleteTrigger.panelClosingActions.subscribe(t=>{!t&&"object"!=typeof this.supportDeliveryForm.get("warehouse").value&&!this.supportDeliveryForm.get("warehouse").value&&(this.supportDeliveryForm.get("warehouse").setValue(""),this.changeComponentData())}))}ngOnDestroy(){this.subs&&this.subs.unsubscribe()}initForm(){this.supportDeliveryForm=this.fb.group({region:["",[c.kI.required,Y.Fd]],district:[{value:"",disabled:!0},[c.kI.required,Y.Fd]],city:[{value:"",disabled:this.currentDelivery===k.UKRPOSHTA},[c.kI.required,Y.Fd]],warehouse:[{value:"",disabled:!0},[c.kI.required,Y.Fd]]}),this.ngControl.valueAccessor=this,this.ngControl.control.markAsTouched=()=>{this.supportDeliveryForm.markAllAsTouched()}}initSubs(){this.currentDelivery===k.UKRPOSHTA&&(this.setRegionsList(),this.subs.add(this.supportDeliveryForm.get("region").valueChanges.pipe((0,ge.h)(t=>{if(console.log(t),"object"==typeof t)this.districtOptions=[],this.cityOptions=[],this.warehouses=[],this.warehousesOptions=[],this.supportDeliveryForm.get("district").reset(),this.supportDeliveryForm.get("city").reset(),this.supportDeliveryForm.get("warehouse").reset(),this.supportDeliveryForm.get("district").enable(),this.supportDeliveryForm.get("city").disable(),this.supportDeliveryForm.get("warehouse").disable(),this.setDistrictsList(t);else if("string"==typeof t)return t.length||this.setRegionsList(),this.invalidLength=t.length<this.minLengthTerm,null!==t&&t.length>=this.minLengthTerm;return!1}),(0,ke.x)(),(0,_.b)(200),(0,Fe.b)(()=>{this.regionOptions=[],this.isLoadingOptionsList=!0}),(0,ye.w)(t=>this.getRegions(t))).subscribe(t=>{this.regionOptions=t.data,this.isLoadingOptionsList=!1})),this.subs.add(this.supportDeliveryForm.get("district").valueChanges.pipe((0,ge.h)(t=>{if(console.log(t),"object"==typeof t)this.cityOptions=[],this.warehouses=[],this.warehousesOptions=[],this.supportDeliveryForm.get("city").reset(),this.supportDeliveryForm.get("warehouse").reset(),this.supportDeliveryForm.get("city").enable(),this.supportDeliveryForm.get("warehouse").disable(),this.setCitiesList(t);else if("string"==typeof t)return t.length||this.setDistrictsList(null,!0),this.invalidLength=t.length<this.minLengthTerm,null!==t&&t.length>=this.minLengthTerm;return!1}),(0,ke.x)(),(0,_.b)(200),(0,Fe.b)(()=>{this.districtOptions=[],this.isLoadingOptionsList=!0}),(0,ye.w)(t=>this.getDistricts(t))).subscribe(t=>{this.districtOptions=t.data,this.isLoadingOptionsList=!1}))),this.subs.add(this.supportDeliveryForm.get("city").valueChanges.pipe((0,ge.h)(t=>{if("object"==typeof t)this.warehouses=[],this.warehousesOptions=[],this.supportDeliveryForm.get("warehouse").reset(),this.supportDeliveryForm.get("warehouse").enable(),this.setWarehousesList(t);else if("string"==typeof t)return t.length||this.setCitiesList(null,this.currentDelivery===k.UKRPOSHTA),this.invalidLength=t.length<this.minLengthTerm,null!==t&&t.length>=this.minLengthTerm;return!1}),(0,ke.x)(),(0,_.b)(200),(0,Fe.b)(()=>{this.cityOptions=[],this.isLoadingOptionsList=!0}),(0,ye.w)(t=>this.getCities(t))).subscribe(t=>{this.cityOptions=t.data,this.isLoadingOptionsList=!1})),this.subs.add(this.supportDeliveryForm.get("warehouse").valueChanges.subscribe(t=>{t&&"string"==typeof t&&!t.trim()||(this.warehousesOptions=this._filter(t),this.changeComponentData())}))}
1fullReset(){this.isLoadingOptionsList=!1,this.isLoadingWriteValue=!1,this.cityOptions=[],this.invalidLength=!0,this.warehousesOptions=[],this.warehouses=[],this.regionOptions=[]}getCities(t){this.isLoadingOptionsList=!0;const n=new F;return n.delivery=this.currentDelivery,n.regionRef=this.supportDeliveryForm.get("region").value?.ref||null,n.districtRef=this.supportDeliveryForm.get("district").value?.ref||null,n.query=t,this.supportDeliveryService.getCities(n).pipe((0,I.x)(()=>{this.isLoadingOptionsList=!1}),(0,ze.K)(()=>{const r=new Ae.Z;return r.data=[],(0,me.of)(r)}))}getRegions(t){this.isLoadingOptionsList=!0;const n=new z;return n.delivery=this.currentDelivery,n.regionName=t,this.supportDeliveryService.getRegions(n).pipe((0,I.x)(()=>{this.isLoadingOptionsList=!1}),(0,ze.K)(()=>{const r=new Ae.Z;return r.data=[],(0,me.of)(r)}))}getDistricts(t){this.isLoadingOptionsList=!0;const n=new z;return n.delivery=this.currentDelivery,n.regionRef=this.supportDeliveryForm.get("region").value?.ref,n.districtName=t,this.supportDeliveryService.getDistricts(n).pipe((0,I.x)(()=>{this.isLoadingOptionsList=!1}),(0,ze.K)(()=>{const r=new Ae.Z;return r.data=[],(0,me.of)(r)}))}changeComponentData(){const t=this.supportDeliveryForm?.getRawValue();if(t)if("object"==typeof t.warehouse&&t.warehouse?.description){let n=t.city?.description+", "+t.warehouse?.description;this.currentDelivery===k.UKRPOSHTA&&(n=t.region?.description+", "+t.district?.description+", "+t.city?.description+", "+t.warehouse?.description),this.onChange({addressName:n,addressLatitude:t.warehouse.latitude,addressLongitude:t.warehouse.longitude,city:t.city,warehouse:t.warehouse})}else this.onChange(null)}setRegionsList(){const t=new z;t.delivery=this.currentDelivery,t.regionName="",this.isLoadingOptionsList=!0,this.subs.add(this.supportDeliveryService.getRegions(t).pipe((0,I.x)(()=>{this.isLoadingOptionsList=!1})).subscribe({next:n=>{this.regionOptions=n.data},error:()=>{this.isLoadingWriteValue=!1}}))}setDistrictsList(t=null,n=!1){if(!t&&!n)return void(this.districtOptions=[]);const r=new z;r.regionRef=t?.ref||this.supportDeliveryForm.get("region").value?.ref,r.delivery=this.currentDelivery,r.districtName="",this.isLoadingOptionsList=!0,this.subs.add(this.supportDeliveryService.getDistricts(r).pipe((0,I.x)(()=>{this.isLoadingOptionsList=!1})).subscribe({next:a=>{this.districtOptions=a.data},error:()=>{this.isLoadingWriteValue=!1}}))}setCitiesList(t=null,n=!1){if(!t&&!n)return void(this.cityOptions=[]);const r=new F;r.delivery=this.currentDelivery,r.regionRef=this.supportDeliveryForm.get("region").value?.ref,r.districtRef=t?.ref||this.supportDeliveryForm.get("district").value?.ref,r.query="",this.isLoadingOptionsList=!0,this.subs.add(this.supportDeliveryService.getCities(r).pipe((0,I.x)(()=>{this.isLoadingOptionsList=!1})).subscribe({next:a=>{this.cityOptions=a.data},error:()=>{this.isLoadingWriteValue=!1}}))}setWarehousesList(t){if(!t)return void(this.warehouses=[]);const n=new F;n.cityRef=t.ref,n.delivery=this.currentDelivery,this.isLoadingOptionsList=!0,this.subs.add(this.supportDeliveryService.getWarehouses(n).pipe((0,I.x)(()=>{this.isLoadingOptionsList=!1})).subscribe({next:r=>{r.data.length||this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant("deliveryForm.warehousesNotFound")}}),this.warehouses=r.data,this.warehousesOptions=r.data},error:()=>{this.isLoadingWriteValue=!1,this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant("deliveryForm.warehousesNotFound")}})}}))}_filter(t){if(!t||"string"!=typeof t)return this.warehouses;const n=t.toLowerCase();return this.warehouses.filter(r=>r.description.toLowerCase().includes(n))}getOptionText(t){return"string"==typeof t?t:t?t.description:""}registerOnChange(t){this.onChange=t}registerOnTouched(t){this.onTouched=t}writeValue(t){this.supportDeliveryForm?.reset(),this.warehouses=[],this.cityOptions=[],t&&this.changeComponentData()}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(c.a5,10),e.\u0275\u0275directiveInject(tt),e.\u0275\u0275directiveInject(c.QS),e.\u0275\u0275directiveInject(S.sK),e.\u0275\u0275directiveInject(K.E))},i.\u0275cmp=e.\u0275\u0275defineComponent({type:i,selectors:[["app-support-delivery"]],viewQuery:function(t,n){if(1&t&&(e.\u0275\u0275viewQuery(oi,5),e.\u0275\u0275viewQuery(ai,5),e.\u0275\u0275viewQuery(si,5),e.\u0275\u0275viewQuery(li,5)),2&t){let r;e.\u0275\u0275queryRefresh(r=e.\u0275\u0275loadQuery())&&(n.cityAutoCompleteTrigger=r.first),e.\u0275\u0275queryRefresh(r=e.\u0275\u0275loadQuery())&&(n.regionAutoCompleteTrigger=r.first),e.\u0275\u0275queryRefresh(r=e.\u0275\u0275loadQuery())&&(n.districtAutoCompleteTrigger=r.first),e.\u0275\u0275queryRefresh(r=e.\u0275\u0275loadQuery())&&(n.warehousesTriggerAutoCompleteTrigger=r.first)}},inputs:{currentDelivery:"currentDelivery"},features:[e.\u0275\u0275ProvidersFeature([{provide:c.Cf,useValue:Ei,multi:!0}]),e.\u0275\u0275NgOnChangesFeature],decls:34,vars:23,consts:[[3,"formGroup"],["class","order-form__group-raw",4,"ngIf"],[1,"order-form__group-raw"],[1,"order-form__group-col"],[1,"form-field"],[1,"form-field__lable"],[1,"form-field__control"],["appearance","outline",1,"am-input",2,"width","100%"],["matInput","","type","text","autocomplete","off","formControlName","city",3,"matAutocomplete"],["autoCompleteInputCity","matAutocompleteTrigger"],[4,"ngIf"],["autoActiveFirstOption","",3,"displayWith"],["autoCity","matAutocomplete"],["class","is-loading",4,"ngIf"],["matInput","","type","text","autocomplete","off","formControlName","warehouse",3,"matAutocomplete"],["autoCompleteInputWarehouses","matAutocompleteTrigger"],["autoActiveFirstOption","",1,"delivery__autocomplete",3,"displayWith"],["autoWarehouses","matAutocomplete"],[3,"value",4,"ngFor","ngForOf"],["class","absolute opacity-bg",4,"ngIf"],["matInput","","type","text","autocomplete","off","formControlName","regi
1on",3,"matAutocomplete"],["autoCompleteInputRegion","matAutocompleteTrigger"],["autoRegion","matAutocomplete"],["matInput","","type","text","autocomplete","off","formControlName","district",3,"matAutocomplete"],["autoCompleteInputDistrict","matAutocompleteTrigger"],["autoDistrict","matAutocomplete"],[1,"is-loading"],[3,"value"],[1,"city-option"],[1,"city-option__description"],[1,"city-option__area-description"],[1,"absolute","opacity-bg"]],template:function(t,n){if(1&t&&(e.\u0275\u0275elementStart(0,"form",0),e.\u0275\u0275template(1,yi,31,20,"div",1),e.\u0275\u0275elementStart(2,"div",2)(3,"div",3)(4,"div",4)(5,"div",5),e.\u0275\u0275text(6),e.\u0275\u0275pipe(7,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"div",6)(9,"mat-form-field",7),e.\u0275\u0275element(10,"input",8,9),e.\u0275\u0275template(12,Ci,3,3,"mat-error",10),e.\u0275\u0275elementStart(13,"mat-autocomplete",11,12),e.\u0275\u0275template(15,xi,3,3,"mat-option",13),e.\u0275\u0275template(16,Mi,3,3,"mat-option",13),e.\u0275\u0275template(17,wi,2,1,"ng-container",10),e.\u0275\u0275elementEnd()()()()(),e.\u0275\u0275elementStart(18,"div",3)(19,"div",4)(20,"div",5),e.\u0275\u0275text(21),e.\u0275\u0275pipe(22,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(23,"div",6)(24,"mat-form-field",7),e.\u0275\u0275element(25,"input",14,15),e.\u0275\u0275template(27,Oi,3,3,"mat-error",10),e.\u0275\u0275elementStart(28,"mat-autocomplete",16,17),e.\u0275\u0275template(30,Si,3,3,"mat-option",13),e.\u0275\u0275template(31,Di,3,3,"mat-option",13),e.\u0275\u0275template(32,Pi,2,2,"mat-option",18),e.\u0275\u0275elementEnd()()()()()()(),e.\u0275\u0275template(33,Ii,1,0,"app-loader",19)),2&t){const r=e.\u0275\u0275reference(14),a=e.\u0275\u0275reference(29);e.\u0275\u0275property("formGroup",n.supportDeliveryForm),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.currentDelivery===n.EOrderDeliveryTypes.UKRPOSHTA),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(7,19,"deliveryForm.cityHint")," "),e.\u0275\u0275advance(4),e.\u0275\u0275property("matAutocomplete",r),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.supportDeliveryForm.get("city").hasError("required")),e.\u0275\u0275advance(1),e.\u0275\u0275classMap("address-autocomplete"),e.\u0275\u0275property("displayWith",n.getOptionText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.isLoadingOptionsList),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!n.isLoadingOptionsList&&!n.cityOptions.length&&n.supportDeliveryForm.get("city").value),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!n.isLoadingOptionsList),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(22,21,"deliveryForm.warehouseHint")," "),e.\u0275\u0275advance(4),e.\u0275\u0275property("matAutocomplete",a),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.supportDeliveryForm.get("warehouse").hasError("required")||n.supportDeliveryForm.get("warehouse").hasError("whitespace")),e.\u0275\u0275advance(1),e.\u0275\u0275property("displayWith",n.getOptionText),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.isLoadingOptionsList),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!n.isLoadingOptionsList&&!n.warehousesOptions.length&&n.supportDeliveryForm.get("warehouse").value),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngForOf",n.warehousesOptions),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.isLoadingWriteValue)}},dependencies:[C.sg,C.O5,c._Y,c.Fj,c.JJ,c.JL,c.sg,c.u,b.TO,b.KE,R.Nt,ie.XC,ie.ZL,Pe.ey,Ce.R,S.X$],styles:[".order-form[_ngcontent-%COMP%]{display:flex}.order-form__raw[_ngcontent-%COMP%]{flex:1}.order-form__raw--sm[_ngcontent-%COMP%]{width:480px;flex:none;padding-left:24px}.order-form__card[_ngcontent-%COMP%]{padding:24px;background:var(--componentBackgroundColor);border-radius:4px;margin-bottom:24px}.order-form__card[_ngcontent-%COMP%]:last-child{margin-bottom:0}.order-form__group[_ngcontent-%COMP%]{padding-top:10px}.order-form__group-raw[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-bottom:24px}@media (max-width: 576px){.order-form__group-raw[_ngcontent-%COMP%]{flex-direction:column}}.order-form__group-raw[_ngcontent-%COMP%]:last-child{padding-bottom:0}
1.order-form__group-col[_ngcontent-%COMP%]{width:calc(50% - 10px)}@media (max-width: 576px){.order-form__group-col[_ngcontent-%COMP%]{width:100%}.order-form__group-col[_ngcontent-%COMP%]:first-child{margin-bottom:20px}}.order-form__btn-wrap[_ngcontent-%COMP%]{padding-top:16px}.order-form__btn-wrap[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{height:48px;width:100%}.city-option[_ngcontent-%COMP%]{padding:7px 0}.city-option__description[_ngcontent-%COMP%]{line-height:1.5;font-weight:600}.city-option__area-description[_ngcontent-%COMP%]{line-height:1.5;font-size:13px}"]}),i})();var Ti=d(5843),ki=d(6255),Fi=d(9272),zi=d(4495),nt=d(4385),it=d(4091);let Ai=(()=>{class i{constructor(t){this.dialogRef=t}ngOnInit(){}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(ee.so))},i.\u0275cmp=e.\u0275\u0275defineComponent({type:i,selectors:[["app-confirm-use-bonuses"]],decls:10,vars:6,consts:[[1,"confirm-modal"],[1,"confirm-modal__body"],[1,"confirm-modal__btn-wrap"],["type","button",1,"btn","btn-default-primary",3,"click"],["type","button",1,"btn","btn-primary",3,"click"]],template:function(t,n){1&t&&(e.\u0275\u0275elementStart(0,"div",0)(1,"div",1),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",2)(5,"button",3),e.\u0275\u0275listener("click",function(){return n.dialogRef.close(!1)}),e.\u0275\u0275text(6),e.\u0275\u0275pipe(7,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(8,"button",4),e.\u0275\u0275listener("click",function(){return n.dialogRef.close(!0)}),e.\u0275\u0275text(9," \u041e\u043a "),e.\u0275\u0275elementEnd()()()),2&t&&(e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(3,2,"order.confirmModalUseBonuses")," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(7,4,"button.cancel")," "))},dependencies:[S.X$],styles:[".confirm-modal[_ngcontent-%COMP%]{max-width:320px}.confirm-modal__body[_ngcontent-%COMP%]{font-weight:700;font-size:16px;padding-top:8px;color:var(--mainTextColor)}.confirm-modal__btn-wrap[_ngcontent-%COMP%]{padding-top:30px;display:flex;justify-content:flex-end}.confirm-modal__btn-wrap[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{margin-left:15px}"]}),i})();var rt=d(9994);function Bi(i,o){1&i&&e.\u0275\u0275element(0,"app-loader",15)}function Ri(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"i-feather",16),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(r.deleteBonuses())}),e.\u0275\u0275elementEnd()}}let Vi=(()=>{class i{constructor(t,n,r,a,s,m){this.translateService=t,this.dialog=n,this.amSnackbarService=r,this.orderService=a,this.appService=s,this.pricePipe=m,this.userBalance=0,this.useBonusesCount=0,this.orderTotalPrice=0,this.bonusesBasePrice=0,this.onUseBonuses=new e.EventEmitter,this.paymentByBonuses=new it.Q,this.useBonusesControl=new c.p4({value:null,disabled:!this.paymentByBonuses.available}),this.afterDotAmount=+localStorage.getItem($e._.rounding)||2,this.isBonusesLoadding=!1}ngOnChanges(t){if(t.useBonusesCount&&!t.useBonusesCount.firstChange&&0==t.useBonusesCount.currentValue&&(this.deleteBonuses(!1),this.setPaymentByBonuses()),(t.bonusesBasePrice||t.orderTotalPrice)&&this.useBonusesCount>0){const n=this.getMaxAllowed();this.useBonusesCount>n&&(this.useBonusesControl.setValue(n,{emitEvent:!1}),this.onUseBonuses.emit(n))}}ngOnInit(){this.setPaymentByBonuses()}getMaxAllowed(){return this.paymentByBonuses.getMaxPaymentByBonuses(this.bonusesBasePrice||this.orderTotalPrice||0,this.userBalance)}setPaymentByBonuses(t=null){this.isBonusesLoadding=!0,this.orderService.checkPaymentByBonuses().subscribe(n=>{this.paymentByBonuses=n.data,this.paymentByBonuses.available?this.useBonusesControl.enable():this.useBonusesControl.disable(),this.isBonusesLoadding=!1,t&&t()},()=>{this.useBonusesControl.disable(),this.isBonusesLoadding=!1})}useBonuses(){this.setPaymentByBonuses(()=>{const t=this.appService.config.config.functions.paymentByBonuses.cashbackAccrual===it.X.DIFF,n=this.useBonusesControl.value,a=this.paymentByBonuses.getMaxPaymentByBonuses(this.bonusesBasePrice||this.orderTotalPrice,this.userBalance);!n||(n<=a?t?this.dialog.open(Ai).afterClosed().subscribe(m=>{m&&this.emitOnUseBonuses()}):this.emitOnUseBonuses():this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant("order.errorMaxCountBonuses")+" "+this.pricePipe.transform(a)}}))})}emitOnUseBonuses(){this.onUseBonuses.emit(Number(this.useBonusesControl.value)),this.useBonusesControl.disable()}deleteBonuses(t=!0){t&&this.onUseBonuses.emit(0),this.useBonusesControl.reset(),this.useBonusesControl.enable()}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(S.sK),e.\u0275\u0275directiveInject(ee.uw),e.\u0275\u0275directiveInject(K.E),e.\u0275\u0275directiveInject(_e.p),e.\u0275\u0275directiveInject(P.z),e.\u0275\u0275directiveInject(re.d))},i.\u0275cmp=e.\u0275\u0275defineComponent({type:i,selectors:[["app-use-order-bonuses"]
1],inputs:{userBalance:"userBalance",useBonusesCount:"useBonusesCount",orderTotalPrice:"orderTotalPrice",bonusesBasePrice:"bonusesBasePrice"},outputs:{onUseBonuses:"onUseBonuses"},features:[e.\u0275\u0275NgOnChangesFeature],decls:32,vars:23,consts:[[1,"user-bonuses"],[1,"user-bonuses__control"],["class","absolute opacity-bg",4,"ngIf"],[1,"form-field"],[1,"form-field__lable"],[1,"form-field__control"],["appearance","outline",1,"am-input"],["matInput","","type","number","appDigitOnly","","autocomplete","off",3,"afterDotAmount","formControl"],["name","x","matSuffix","","style","cursor: pointer",3,"click",4,"ngIf"],[1,"order-form__btn-wrap"],["type","button",1,"btn","btn-primary",3,"disabled","click"],[1,"user-bonuses__info"],[1,"user-info__item"],[1,"user-info__title"],[1,"user-info__data"],[1,"absolute","opacity-bg"],["name","x","matSuffix","",2,"cursor","pointer",3,"click"]],template:function(t,n){1&t&&(e.\u0275\u0275elementStart(0,"div",0)(1,"div",1),e.\u0275\u0275template(2,Bi,1,0,"app-loader",2),e.\u0275\u0275elementStart(3,"div",3)(4,"div",4),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(7,"div",5)(8,"mat-form-field",6),e.\u0275\u0275element(9,"input",7),e.\u0275\u0275template(10,Ri,1,0,"i-feather",8),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(11,"div",9)(12,"button",10),e.\u0275\u0275listener("click",function(){return n.useBonuses()}),e.\u0275\u0275text(13),e.\u0275\u0275pipe(14,"translate"),e.\u0275\u0275elementEnd()()()(),e.\u0275\u0275elementStart(15,"div",11)(16,"div",12)(17,"div",13),e.\u0275\u0275text(18),e.\u0275\u0275pipe(19,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(20,"div",14)(21,"b"),e.\u0275\u0275text(22),e.\u0275\u0275pipe(23,"price"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementStart(24,"div",12)(25,"div",13),e.\u0275\u0275text(26),e.\u0275\u0275pipe(27,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(28,"div",14)(29,"b"),e.\u0275\u0275text(30),e.\u0275\u0275pipe(31,"price"),e.\u0275\u0275elementEnd()()()()()),2&t&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("ngIf",n.isBonusesLoadding),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(6,11,"order.bonusesControlHint")," "),e.\u0275\u0275advance(4),e.\u0275\u0275property("afterDotAmount",n.afterDotAmount)("formControl",n.useBonusesControl),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.useBonusesControl.disabled&&n.paymentByBonuses.available),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",n.useBonusesControl.disabled),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(14,13,"order.bonusesBtn")," "),e.\u0275\u0275advance(5),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(19,15,"order.bonusesCount")," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate(e.\u0275\u0275pipeBind1(23,17,n.userBalance)),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(27,19,"order.canUseBonuses")," "),e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(31,21,n.paymentByBonuses.getMaxPaymentByBonuses(n.bonusesBasePrice||n.orderTotalPrice,n.userBalance))," "))},dependencies:[C.O5,c.Fj,c.wV,c.JJ,c.oH,Q.u,rt.L,b.KE,b.R9,R.Nt,Ce.R,S.X$,re.d],styles:[".order-form[_ngcontent-%COMP%]{display:flex;position:relative}.order-form__raw[_ngcontent-%COMP%]{flex:1;position:relative}.order-form__raw--sm[_ngcontent-%COMP%]{width:480px;flex:none;padding-left:24px}.order-form__card[_ngcontent-%COMP%]{padding:24px;background:var(--componentBackgroundColor);border-radius:4px;margin-bottom:24px;position:relative}.order-form__card--shopping-cart[_ngcontent-%COMP%]{padding-left:0;padding-right:0}.order-form__card--shopping-cart[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{height:64px;width:100%}.order-form__group[_ngcontent-%COMP%]{padding:10px 0 20px}.order-form__group[_ngcontent-%COMP%]:last-child{padding-bottom:0}.order-form__group-raw[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-bottom:24px}.order-form__group-raw[_ngcontent-%COMP%]:last-child{padding-bottom:0}
1.order-form__group-col[_ngcontent-%COMP%]{width:calc(50% - 10px)}.order-form__group-col[_ngcontent-%COMP%] .mat-select-value-text[_ngcontent-%COMP%]{color:red}.order-form__group-col-3[_ngcontent-%COMP%]{width:calc(33.3333333333% - 10px)}.order-form__group-col-3[_ngcontent-%COMP%] .mat-select-value-text[_ngcontent-%COMP%]{color:red}.order-form__group-col-full[_ngcontent-%COMP%]{width:100%;margin-right:10px}.order-form__group-col-full[_ngcontent-%COMP%]:last-child{margin-right:0}.order-form__group-col-full[_ngcontent-%COMP%] .mat-select-value-text[_ngcontent-%COMP%]{color:red}.order-form__btn-wrap[_ngcontent-%COMP%]{padding-top:16px}.order-form__btn-wrap[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{height:48px;width:100%}.order-form__workSchedules[_ngcontent-%COMP%]{color:var(--primaryColor);cursor:pointer;margin-bottom:24px}@media (max-width: 576px){.order-form__workSchedules[_ngcontent-%COMP%]{margin-bottom:20px}}.order-form__workSchedules[_ngcontent-%COMP%]:last-child{margin-bottom:0}.order-form__workSchedules.tablet[_ngcontent-%COMP%]{cursor:default;padding:16px;background-color:var(--mainBackgroundColor);border-radius:6px}.order-form__workSchedules-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;margin-bottom:12px}.order-form__workSchedules-icon[_ngcontent-%COMP%]{width:24px;height:24px}.order-form__workSchedules[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%], .order-form__workSchedules[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{color:var(--primaryColor)}.order-form__workSchedules-title[_ngcontent-%COMP%]{margin-left:10px;font-weight:600;font-size:16px;line-height:16px}.order-form__workSchedules-body[_ngcontent-%COMP%]{color:var(--mainTextColor);font-weight:400;font-size:16px;line-height:20px;white-space:pre-wrap;line-height:.8}.order-form__additionalText-title[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:16px}.order-form__additionalText-icon[_ngcontent-%COMP%]{width:32px;height:32px;display:flex;justify-content:center;align-items:center;border-radius:4px;background-color:var(--borderColor);margin-right:16px}.order-form__additionalText-icon[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%], .order-form__additionalText-icon[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{color:#2890cc;width:22px;height:22px}@media (min-width: 1200px) and (max-width: 1440px){.order-form__additionalText-icon[_ngcontent-%COMP%]{width:28px;height:28px;margin-right:8px}}.order-form__additionalText-content[_ngcontent-%COMP%]{font-weight:700;font-size:24px;line-height:132%;color:var(--mainTextColor)}@media (min-width: 1200px) and (max-width: 1440px){.order-form__additionalText-content[_ngcontent-%COMP%]{font-size:20px}}@media (max-width: 768px){.order-form__additionalText-content[_ngcontent-%COMP%]{font-size:20px}}.order-form__additionalText-body[_ngcontent-%COMP%]{font-weight:500;font-size:16px;line-height:135%;color:var(--greyTextColor);word-wrap:break-word}.order-form__comment[_ngcontent-%COMP%]{height:73px}@media (max-width: 1440px){.order-form__raw--sm[_ngcontent-%COMP%]{width:380px}}@media (max-width: 1200px){.order-form[_ngcontent-%COMP%]{flex-direction:column}.order-form__raw--sm[_ngcontent-%COMP%]{display:flex;flex-direction:column-reverse;width:100%;padding-left:0}.order-form__raw[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:nth-child(1){order:1}.order-form__raw[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:nth-child(2){order:4}.order-form__raw[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:nth-child(3){order:3}.order-form__raw[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:nth-child(4){order:2}}@media (max-width: 576px){.order-form__card--shopping-cart[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{height:44px}.order-form__raw--sm[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:last-child{margin-bottom:24px}.order-form__group-raw[_ngcontent-%COMP%]{flex-direction:column;padding-bottom:20px}.order-form__group-col[_ngcontent-%COMP%], .order-form__group-col-3[_ngcontent-%COMP%], .order-form__group-col-full[_ngcontent-%COMP%]{width:100%;margin-bottom:15px;margin-right:0}.order-form__group-col[_ngcontent-%COMP%]:last-child, .order-form__group-col-3[_ngcontent-%COMP%]:last-child, .order-form__group-col-full[_ngcontent-%COMP%]:last-child{margin-bottom:0}}.user-info[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.user-info__item[_ngcontent-%COMP%]{margin-right:8px;width:100%}.user-info__item[_ngcontent-%COMP%]:last-child{margin-right:0}.user-info__title[_ngcontent-%COMP%]{color:var(--mainTextColor);font-weight:700;font-size:14px;padding-bottom:8px}.user-info__data[_ngcontent-%COMP%]{color:var(--mainTextColor);font-weight:500;font-size:14px;position:relative}.user-info__data-verification[_ngcontent-%COMP%]{position:absolute;top:12px;font-size:14px;right:calc(0% + 12px);cursor:pointer;color:var(--primaryColor)}@media (max-width: 576px){.user-info[_ngcontent-%COMP%]{flex-direction:column}.user-info__item[_ngcontent-%COMP%]{margin-bottom:15px}.user-info__item[_ngcontent-%COMP%]:last-child{margin-bottom:0}}.user-bonuses[_ngcontent-%COMP%]{display:flex}.user-bonuses__control[_ngcontent-%COMP%]{width:360px}.user-bonuses__info[_ngcontent-%COMP%]{padding-left:30px;padding-top:20px}.user-bonuses__info[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:nth-child(2){padding-top:16px}@media (max-width: 576px){.user-bonuses[_ngcontent-%COMP%]{flex-direction:column-reverse}.user-bonuses__control[_ngcontent-%COMP%]{width:100%}.user-bonuses__info[_ngcontent-%COMP%]{padding:0;margin:0}.user-bonuses__info[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:nth-child(2){padding-top:0}.user-bonuses[_ngcontent-%COMP%] .user-info__item[_ngcontent-%COMP%]{margin-right:0;margin-bottom:15px!important}} .tooltip{line-height:.8!important;white-space:pre-line;font-weight:600;font-size:13px;line-height:16px;color:var(--darkGreyTextColor)!important;background-color:var(--borderColor);padding:16px!important;max-width:300px!important}"]}),i})();var Zi=d(6308),Ni=d(5067);function ji(i,o){1&i&&e.\u0275\u0275element(0,"app-loader",9)}function Ui(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"i-feather",10),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext();
1return e.\u0275\u0275resetView(r.deletePomocode())}),e.\u0275\u0275elementEnd()}}let Gi=(()=>{class i{constructor(t,n,r){this.translateService=t,this.orderService=n,this.amSnackbarService=r,this.shoppingCartData=[],this.onPromoCodeChanege=new e.EventEmitter,this.promoCodeControl=new c.p4,this.isLoadding=!1}ngOnChanges(t){t.promoCode&&!t.promoCode.firstChange&&!t.promoCode.currentValue&&this.deletePomocode(!1)}ngOnInit(){}checkPromocode(){if(!this.promoCodeControl.value)return;this.isLoadding=!0;let t=new Ni.Q;t.offers=this.shoppingCartData.map(n=>new Zi.E(n)),t.promoCode=this.promoCodeControl.value,this.orderService.checkPromocode(t).subscribe(n=>{this.onPromoCodeChanege.emit({promoCode:this.promoCodeControl.value,promoCodePrice:n.data}),this.promoCode=this.promoCodeControl.value,this.promoCodeControl.disable(),this.isLoadding=!1},n=>{switch(n.error.errors.id){case"PROMO_CODE_INVALID_ORDER_AMOUNT":this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant("order.errorInvalidAmount")+" "+String(n.error.errors.message)}});break;case"PROMO_ALREADY_USED":this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant("order.errorPROMO_ALREADY_USED")}});break;case"PROMO_CODE_NOT_AVAILABLE":this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant("order.errorPROMO_CODE_NOT_AVAILABLE")}});break;default:this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant("order.errorPromoCode")}})}this.promoCode=null,this.isLoadding=!1,this.deletePomocode()})}deletePomocode(t=!0){t&&this.onPromoCodeChanege.emit({promoCode:null,promoCodePrice:null}),this.promoCodeControl.reset(),this.promoCodeControl.enable()}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(S.sK),e.\u0275\u0275directiveInject(_e.p),e.\u0275\u0275directiveInject(K.E))},i.\u0275cmp=e.\u0275\u0275defineComponent({type:i,selectors:[["app-use-promocode"]],inputs:{shoppingCartData:"shoppingCartData",promoCode:"promoCode"},outputs:{onPromoCodeChanege:"onPromoCodeChanege"},features:[e.\u0275\u0275NgOnChangesFeature],decls:13,vars:10,consts:[[1,"form-field",2,"position","relative"],["class","absolute opacity-bg",4,"ngIf"],[1,"form-field__lable"],[1,"form-field__control"],["appearance","outline",1,"am-input"],["matInput","","type","text","autocomplete","off",3,"formControl"],["name","x","matSuffix","","style","cursor: pointer;",3,"click",4,"ngIf"],[1,"order-form__btn-wrap"],["type","button",1,"btn","btn-primary",3,"disabled","click"],[1,"absolute","opacity-bg"],["name","x","matSuffix","",2,"cursor","pointer",3,"click"]],template:function(t,n){1&t&&(e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275template(1,ji,1,0,"app-loader",1),e.\u0275\u0275elementStart(2,"div",2),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(5,"div",3)(6,"mat-form-field",4),e.\u0275\u0275element(7,"input",5),e.\u0275\u0275template(8,Ui,1,0,"i-feather",6),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(9,"div",7)(10,"button",8),e.\u0275\u0275listener("click",function(){return n.checkPromocode()}),e.\u0275\u0275text(11),e.\u0275\u0275pipe(12,"translate"),e.\u0275\u0275elementEnd()()()),2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.isLoadding),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(4,6,"order.promocodeHint")," "),e.\u0275\u0275advance(4),e.\u0275\u0275property("formControl",n.promoCodeControl),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.promoCodeControl.disabled),e.\u0275\u0275advance(2),e.\u0275\u0275property("disabled",n.promoCodeControl.disabled),e.\u0275\u0275advance(1),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(12,8,"order.promocodeBtn")," "))},dependencies:[C.O5,c.Fj,c.JJ,c.oH,Q.u,b.KE,b.R9,R.Nt,Ce.R,S.X$],styles:[".order-form[_ngcontent-%COMP%]{display:flex;position:relative}.order-form__raw[_ngcontent-%COMP%]{flex:1;position:relative}.order-form__raw--sm[_ngcontent-%COMP%]{width:480px;flex:none;padding-left:24px}.order-form__card[_ngcontent-%COMP%]{padding:24px;
1background:var(--componentBackgroundColor);border-radius:4px;margin-bottom:24px;position:relative}.order-form__card--shopping-cart[_ngcontent-%COMP%]{padding-left:0;padding-right:0}.order-form__card--shopping-cart[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{height:64px;width:100%}.order-form__group[_ngcontent-%COMP%]{padding:10px 0 20px}.order-form__group[_ngcontent-%COMP%]:last-child{padding-bottom:0}.order-form__group-raw[_ngcontent-%COMP%]{display:flex;justify-content:space-between;padding-bottom:24px}.order-form__group-raw[_ngcontent-%COMP%]:last-child{padding-bottom:0}.order-form__group-col[_ngcontent-%COMP%]{width:calc(50% - 10px)}.order-form__group-col[_ngcontent-%COMP%] .mat-select-value-text[_ngcontent-%COMP%]{color:red}.order-form__group-col-3[_ngcontent-%COMP%]{width:calc(33.3333333333% - 10px)}.order-form__group-col-3[_ngcontent-%COMP%] .mat-select-value-text[_ngcontent-%COMP%]{color:red}.order-form__group-col-full[_ngcontent-%COMP%]{width:100%;margin-right:10px}.order-form__group-col-full[_ngcontent-%COMP%]:last-child{margin-right:0}.order-form__group-col-full[_ngcontent-%COMP%] .mat-select-value-text[_ngcontent-%COMP%]{color:red}.order-form__btn-wrap[_ngcontent-%COMP%]{padding-top:16px}.order-form__btn-wrap[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{height:48px;width:100%}.order-form__workSchedules[_ngcontent-%COMP%]{color:var(--primaryColor);cursor:pointer;margin-bottom:24px}@media (max-width: 576px){.order-form__workSchedules[_ngcontent-%COMP%]{margin-bottom:20px}}.order-form__workSchedules[_ngcontent-%COMP%]:last-child{margin-bottom:0}.order-form__workSchedules.tablet[_ngcontent-%COMP%]{cursor:default;padding:16px;background-color:var(--mainBackgroundColor);border-radius:6px}.order-form__workSchedules-container[_ngcontent-%COMP%]{display:inline-flex;align-items:center;margin-bottom:12px}.order-form__workSchedules-icon[_ngcontent-%COMP%]{width:24px;height:24px}.order-form__workSchedules[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%], .order-form__workSchedules[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{color:var(--primaryColor)}.order-form__workSchedules-title[_ngcontent-%COMP%]{margin-left:10px;font-weight:600;font-size:16px;line-height:16px}.order-form__workSchedules-body[_ngcontent-%COMP%]{color:var(--mainTextColor);font-weight:400;font-size:16px;line-height:20px;white-space:pre-wrap;line-height:.8}.order-form__additionalText-title[_ngcontent-%COMP%]{display:flex;align-items:center;margin-bottom:16px}.order-form__additionalText-icon[_ngcontent-%COMP%]{width:32px;height:32px;display:flex;justify-content:center;align-items:center;border-radius:4px;background-color:var(--borderColor);margin-right:16px}.order-form__additionalText-icon[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%], .order-form__additionalText-icon[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{color:#2890cc;width:22px;height:22px}@media (min-width: 1200px) and (max-width: 1440px){.order-form__additionalText-icon[_ngcontent-%COMP%]{width:28px;height:28px;margin-right:8px}}.order-form__additionalText-content[_ngcontent-%COMP%]{font-weight:700;font-size:24px;line-height:132%;color:var(--mainTextColor)}@media (min-width: 1200px) and (max-width: 1440px){.order-form__additionalText-content[_ngcontent-%COMP%]{font-size:20px}}@media (max-width: 768px){.order-form__additionalText-content[_ngcontent-%COMP%]{font-size:20px}}.order-form__additionalText-body[_ngcontent-%COMP%]{font-weight:500;font-size:16px;line-height:135%;color:var(--greyTextColor);word-wrap:break-word}.order-form__comment[_ngcontent-%COMP%]{height:73px}@media (max-width: 1440px){.order-form__raw--sm[_ngcontent-%COMP%]{width:380px}}@media (max-width: 1200px){.order-form[_ngcontent-%COMP%]{flex-direction:column}.order-form__raw--sm[_ngcontent-%COMP%]{display:flex;flex-direction:column-reverse;width:100%;padding-left:0}.order-form__raw[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:nth-child(1){order:1}.order-form__raw[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:nth-child(2){order:4}.order-form__raw[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:nth-child(3){order:3}.order-form__raw[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:nth-child(4){order:2}}@media (max-width: 576px){.order-form__card--shopping-cart[_ngcontent-%COMP%] .btn[_ngcontent-%COMP%]{height:44px}.order-form__raw--sm[_ngcontent-%COMP%] .order-form__card[_ngcontent-%COMP%]:last-child{margin-bottom:24px}.order-form__group-raw[_ngcontent-%COMP%]{flex-direction:column;padding-bottom:20px}.order-form__group-col[_ngcontent-%COMP%], .order-form__group-col-3[_ngcontent-%COMP%], .order-form__group-col-full[_ngcontent-%COMP%]{width:100%;margin-bottom:15px;margin-right:0}.order-form__group-col[_ngcontent-%COMP%]:last-child, .order-form__group-col-3[_ngcontent-%COMP%]:last-child, .order-form__group-col-full[_ngcontent-%COMP%]:last-child{margin-bottom:0}}.user-info[_ngcontent-%COMP%]{display:flex;justify-content:space-between}.user-info__item[_ngcontent-%COMP%]{margin-right:8px;width:100%}.user-info__item[_ngcontent-%COMP%]:last-child{margin-right:0}.user-info__title[_ngcontent-%COMP%]{color:var(--mainTextColor);font-weight:700;font-size:14px;padding-bottom:8px}.user-info__data[_ngcontent-%COMP%]{color:var(--mainTextColor);font-weight:500;font-size:14px;position:relative}.user-info__data-verification[_ngcontent-%COMP%]{position:absolute;top:12px;font-size:14px;right:calc(0% + 12px);cursor:pointer;color:var(--primaryColor)}@media (max-width: 576px){.user-info[_ngcontent-%COMP%]{flex-direction:column}.user-info__item[_ngcontent-%COMP%]{margin-bottom:15px}.user-info__item[_ngcontent-%COMP%]:last-child{margin-bottom:0}}.user-bonuses[_ngcontent-%COMP%]{display:flex}.user-bonuses__control[_ngcontent-%COMP%]{width:360px}.user-bonuses__info[_ngcontent-%COMP%]{padding-left:30px;padding-top:20px}.user-bonuses__info[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:nth-child(2){padding-top:16px}@media (max-width: 576px){.user-bonuses[_ngcontent-%COMP%]{flex-direction:column-reverse}.user-bonuses__control[_ngcontent-%COMP%]{width:100%}.user-bonuses__info[_ngcontent-%COMP%]{padding:0;margin:0}.user-bonuses__info[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]:nth-child(2){padding-top:0}.user-bonuses[_ngcontent-%COMP%] .user-info__item[_ngcontent-%COMP%]{margin-right:0;margin-bottom:15px!important}} .tooltip{line-height:.8!important;white-space:pre-line;font-weight:600;font-size:13px;line-height:16px;color:var(--darkGreyTextColor)!important;background-color:var(--borderColor);padding:16px!important;max-width:300px!important}"]}),i})();var Hi=d(7398),Wi=d(6709),ot=d(1883),$i=d(9751),ne=d(9841),W=d(5698);const at=["*"];class L{_clearListeners(){for(const o of this._listeners)o.remove();this._listeners=[]}constructor(o){this._ngZone=o,this._pending=[],this._listeners=[],this._targetStream=new x.X(void 0)}getLazyEmitter(o){return this._targetStream.pipe((0,ye.w)(t=>{const n=new $i.y(r=>{if(!t)return void this._pending.push({observable:n,observer:r});const a=t.addListener(o,s=>{this._ngZone.run(()=>r.next(s))});if(a)return this._listeners.push(a),()=>a.remove();r.complete()});return n}))}setTarget(o){const t=this._targetStream.value;o!==t&&(t&&(this._clearListeners(),this._pending=[]),this._targetStream.next(o),this._pending.forEach(n=>n.observable.subscribe(n.observer)),this._pending=[])}destroy(){this._clearListeners(),this._pending=[],this._targetStream.complete()}}const de={center:{lat:37.421995,lng:-122.084092},zoom:17,mapTypeId:"roadmap"};let O=(()=>
1{class i{set center(t){this._center=t}set zoom(t){this._zoom=t}set options(t){this._options=t||de}constructor(t,n,r){if(this._elementRef=t,this._ngZone=n,this._eventManager=new L(this._ngZone),this.height="500px",this.width="500px",this._options=de,this.mapInitialized=new e.EventEmitter,this.authFailure=new e.EventEmitter,this.boundsChanged=this._eventManager.getLazyEmitter("bounds_changed"),this.centerChanged=this._eventManager.getLazyEmitter("center_changed"),this.mapClick=this._eventManager.getLazyEmitter("click"),this.mapDblclick=this._eventManager.getLazyEmitter("dblclick"),this.mapDrag=this._eventManager.getLazyEmitter("drag"),this.mapDragend=this._eventManager.getLazyEmitter("dragend"),this.mapDragstart=this._eventManager.getLazyEmitter("dragstart"),this.headingChanged=this._eventManager.getLazyEmitter("heading_changed"),this.idle=this._eventManager.getLazyEmitter("idle"),this.maptypeidChanged=this._eventManager.getLazyEmitter("maptypeid_changed"),this.mapMousemove=this._eventManager.getLazyEmitter("mousemove"),this.mapMouseout=this._eventManager.getLazyEmitter("mouseout"),this.mapMouseover=this._eventManager.getLazyEmitter("mouseover"),this.projectionChanged=this._eventManager.getLazyEmitter("projection_changed"),this.mapRightclick=this._eventManager.getLazyEmitter("rightclick"),this.tilesloaded=this._eventManager.getLazyEmitter("tilesloaded"),this.tiltChanged=this._eventManager.getLazyEmitter("tilt_changed"),this.zoomChanged=this._eventManager.getLazyEmitter("zoom_changed"),this._isBrowser=(0,C.NF)(r),this._isBrowser){const a=window;this._existingAuthFailureCallback=a.gm_authFailure,a.gm_authFailure=()=>{this._existingAuthFailureCallback&&this._existingAuthFailureCallback(),this.authFailure.emit()}}}ngOnChanges(t){(t.height||t.width)&&this._setSize();const n=this.googleMap;n&&(t.options&&n.setOptions(this._combineOptions()),t.center&&this._center&&n.setCenter(this._center),t.zoom&&null!=this._zoom&&n.setZoom(this._zoom),t.mapTypeId&&this.mapTypeId&&n.setMapTypeId(this.mapTypeId)
1)}ngOnInit(){this._isBrowser&&(this._mapEl=this._elementRef.nativeElement.querySelector(".map-container"),this._setSize(),this._ngZone.runOutsideAngular(()=>{this.googleMap=new google.maps.Map(this._mapEl,this._combineOptions())}),this._eventManager.setTarget(this.googleMap),this.mapInitialized.emit(this.googleMap))}ngOnDestroy(){this._eventManager.destroy(),this._isBrowser&&(window.gm_authFailure=this._existingAuthFailureCallback)}fitBounds(t,n){this._assertInitialized(),this.googleMap.fitBounds(t,n)}panBy(t,n){this._assertInitialized(),this.googleMap.panBy(t,n)}panTo(t){this._assertInitialized(),this.googleMap.panTo(t)}panToBounds(t,n){this._assertInitialized(),this.googleMap.panToBounds(t,n)}getBounds(){return this._assertInitialized(),this.googleMap.getBounds()||null}getCenter(){return this._assertInitialized(),this.googleMap.getCenter()}getClickableIcons(){return this._assertInitialized(),this.googleMap.getClickableIcons()}getHeading(){return this._assertInitialized(),this.googleMap.getHeading()}getMapTypeId(){return this._assertInitialized(),this.googleMap.getMapTypeId()}getProjection(){return this._assertInitialized(),this.googleMap.getProjection()||null}getStreetView(){return this._assertInitialized(),this.googleMap.getStreetView()}getTilt(){return this._assertInitialized(),this.googleMap.getTilt()}getZoom(){return this._assertInitialized(),this.googleMap.getZoom()}get controls(){return this._assertInitialized(),this.googleMap.controls}get data(){return this._assertInitialized(),this.googleMap.data}get mapTypes(){return this._assertInitialized(),this.googleMap.mapTypes}get overlayMapTypes(){return this._assertInitialized(),this.googleMap.overlayMapTypes}_setSize(){if(this._mapEl){const t=this._mapEl.style;t.height=null===this.height?"":dt(this.height)||"500px",t.width=null===this.width?"":dt(this.width)||"500px"}}_combineOptions(){const t=this._options||{};return{...t,center:this._center||t.center||de.center,zoom:this._zoom??t.zoom??de.zoom,mapTypeId:this.mapTypeId||t.mapTypeId||de.mapTypeId}}_assertInitialized(){}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(e.ElementRef),e.\u0275\u0275directiveInject(e.NgZone),e.\u0275\u0275directiveInject(e.PLATFORM_ID))},i.\u0275cmp=e.\u0275\u0275defineComponent({type:i,selectors:[["google-map"]],inputs:{height:"height",width:"width",mapTypeId:"mapTypeId",center:"center",zoom:"zoom",options:"options"},outputs:{mapInitialized:"mapInitialized",authFailure:"authFailure",boundsChanged:"boundsChanged",centerChanged:"centerChanged",mapClick:"mapClick",mapDblclick:"mapDblclick",mapDrag:"mapDrag",mapDragend:"mapDragend",mapDragstart:"mapDragstart",headingChanged:"headingChanged",idle:"idle",maptypeidChanged:"maptypeidChanged",mapMousemove:"mapMousemove",mapMouseout:"mapMouseout",mapMouseover:"mapMouseover",projectionChanged:"projectionChanged",mapRightclick:"mapRightclick",tilesloaded:"tilesloaded",tiltChanged:"tiltChanged",zoomChanged:"zoomChanged"},exportAs:["googleMap"],features:[e.\u0275\u0275NgOnChangesFeature],ngContentSelectors:at,decls:2,vars:0,consts:[[1,"map-container"]],template:function(t,n){1&t&&(e.\u0275\u0275projectionDef(),e.\u0275\u0275element(0,"div",0),e.\u0275\u0275projection(1))},encapsulation:2,changeDetection:0}),i})();const Ki=/([A-Za-z%]+)$/;function dt(i){return null==i?"":Ki.test(i)?i:`${i}px`}let Re=(()=>{class i{set options(t){this._options.next(t||{})}set position(t){this._position.next(t)}constructor(t,n,r){this._googleMap=t,this._elementRef=n,this._ngZone=r,this._eventManager=new L(this._ngZone),this._options=new x.X({}),this._position=new x.X(void 0),this._destroy=new y.x,this.closeclick=this._eventManager.getLazyEmitter("closeclick"),this.contentChanged=this._eventManager.getLazyEmitter("content_changed"),this.domready=this._eventManager.getLazyEmitter("domready"),this.positionChanged=this._eventManager.getLazyEmitter("position_changed"),this.zindexChanged=this._eventManager.getLazyEmitter("zindex_changed")}ngOnInit(){this._googleMap._isBrowser&&(this._combineOptions().pipe((0,W.q)(1)).subscribe(n=>{this._ngZone.runOutsideAngular(()=>{this.infoWindow=new google.maps.InfoWindow(n)}),this._eventManager.setTarget(this.infoWindow)}),this._watchForOptionsChanges(),this._watchForPositionChanges())}ngOnDestroy(){this._eventManager.destroy(),this._destroy.next(),this._destroy.complete(),this.infoWindow&&this.close()}close(){this._assertInitialized(),this.infoWindow.close()}getContent(){return this._assertInitialized(),this.infoWindow.getContent()||null}getPosition(){return this._assertInitialized(),this.infoWindow.getPosition()||null}getZIndex(){return this._assertInitialized(),this.infoWindow.getZIndex()}open(t,n){this._assertInitialized();const r=t?t.getAnchor():void 0;(this.infoWindow.get("anchor")!==r||!r)&&(this._elementRef.nativeElement.style.display="",this.infoWindow.open({map:this._googleMap.googleMap,anchor:r,shouldFocus:n}))}_combineOptions(){return(0,ne.a)([this._options,this._position]).pipe((0,V.U)(([t,n])=>({...t,position:n||t.position,content:this._elementRef.nativeElement})))}_watchForOptionsChanges(){this._options.pipe((0,u.R)(this._destroy)).subscribe(t=>{this._assertInitialized(),this.infoWindow.setOptions(t)})}_watchForPositionChanges(){this._position.pipe((0,u.R)(this._destroy)).subscribe(t=>{t&&(this._assertInitialized(),this.infoWindow.setPosition(t))})}_assertInitialized(){}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(O),e.\u0275\u0275directiveInject(e.ElementRef),e.\u0275\u0275directiveInject(e.NgZone))},i.\u0275dir=e.\u0275\u0275defineDirective({type:i,selectors:[["map-info-window"]],hostAttrs:[2,"display","none"],inputs:{options:"options",position:"position"},outputs:{closeclick:"closeclick",contentChanged:"contentChanged",domready:"domready",positionChanged:"positionChanged",zindexChanged:"zindexChanged"},exportAs:["mapInfoWindow"]}),i})();const er={position:{lat:37.421995,lng:-122.084092}};let Ve=(()=>
1{class i{set title(t){this._title=t}set position(t){this._position=t}set label(t){this._label=t}set clickable(t){this._clickable=t}set options(t){this._options=t}set icon(t){this._icon=t}set visible(t){this._visible=t}constructor(t,n){this._googleMap=t,this._ngZone=n,this._eventManager=new L(this._ngZone),this.animationChanged=this._eventManager.getLazyEmitter("animation_changed"),this.mapClick=this._eventManager.getLazyEmitter("click"),this.clickableChanged=this._eventManager.getLazyEmitter("clickable_changed"),this.cursorChanged=this._eventManager.getLazyEmitter("cursor_changed"),this.mapDblclick=this._eventManager.getLazyEmitter("dblclick"),this.mapDrag=this._eventManager.getLazyEmitter("drag"),this.mapDragend=this._eventManager.getLazyEmitter("dragend"),this.draggableChanged=this._eventManager.getLazyEmitter("draggable_changed"),this.mapDragstart=this._eventManager.getLazyEmitter("dragstart"),this.flatChanged=this._eventManager.getLazyEmitter("flat_changed"),this.iconChanged=this._eventManager.getLazyEmitter("icon_changed"),this.mapMousedown=this._eventManager.getLazyEmitter("mousedown"),this.mapMouseout=this._eventManager.getLazyEmitter("mouseout"),this.mapMouseover=this._eventManager.getLazyEmitter("mouseover"),this.mapMouseup=this._eventManager.getLazyEmitter("mouseup"),this.positionChanged=this._eventManager.getLazyEmitter("position_changed"),this.mapRightclick=this._eventManager.getLazyEmitter("rightclick"),this.shapeChanged=this._eventManager.getLazyEmitter("shape_changed"),this.titleChanged=this._eventManager.getLazyEmitter("title_changed"),this.visibleChanged=this._eventManager.getLazyEmitter("visible_changed"),this.zindexChanged=this._eventManager.getLazyEmitter("zindex_changed")}ngOnInit(){this._googleMap._isBrowser&&(this._ngZone.runOutsideAngular(()=>{this.marker=new google.maps.Marker(this._combineOptions())}),this._assertInitialized(),this.marker.setMap(this._googleMap.googleMap),this._eventManager.setTarget(this.marker))}ngOnChanges(t){const{marker:n,_title:r,_position:a,_label:s,_clickable:m,_icon:g,_visible:f}=this;n&&(t.options&&n.setOptions(this._combineOptions()),t.title&&void 0!==r&&n.setTitle(r),t.position&&a&&n.setPosition(a),t.label&&void 0!==s&&n.setLabel(s),t.clickable&&void 0!==m&&n.setClickable(m),t.icon&&g&&n.setIcon(g),t.visible&&void 0!==f&&n.setVisible(f))}ngOnDestroy(){this._eventManager.destroy(),this.marker&&this.marker.setMap(null)}getAnimation(){return this._assertInitialized(),this.marker.getAnimation()||null}getClickable(){return this._assertInitialized(),this.marker.getClickable()}getCursor(){return this._assertInitialized(),this.marker.getCursor()||null}getDraggable(){return this._assertInitialized(),!!this.marker.getDraggable()}getIcon(){return this._assertInitialized(),this.marker.getIcon()||null}getLabel(){return this._assertInitialized(),this.marker.getLabel()||null}getOpacity(){return this._assertInitialized(),this.marker.getOpacity()||null}getPosition(){return this._assertInitialized(),this.marker.getPosition()||null}getShape(){return this._assertInitialized(),this.marker.getShape()||null}getTitle(){return this._assertInitialized(),this.marker.getTitle()||null}getVisible(){return this._assertInitialized(),this.marker.getVisible()}getZIndex(){return this._assertInitialized(),this.marker.getZIndex()||null}getAnchor(){return this._assertInitialized(),this.marker}_combineOptions(){const t=this._options||er;return{...t,title:this._title||t.title,position:this._position||t.position,label:this._label||t.label,clickable:this._clickable??t.clickable,map:this._googleMap.googleMap,icon:this._icon||t.icon,visible:this._visible??t.visible}}_assertInitialized(){}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(O),e.\u0275\u0275directiveInject(e.NgZone))},i.\u0275dir=e.\u0275\u0275defineDirective({type:i,selectors:[["map-marker"]],inputs:{title:"title",position:"position",label:"label",clickable:"clickable",options:"options",icon:"icon",visible:"visible"},outputs:{animationChanged:"animationChanged",mapClick:"mapClick",clickableChanged:"clickableChanged",cursorChanged:"cursorChanged",mapDblclick:"mapDblclick",mapDrag:"mapDrag",mapDragend:"mapDragend",draggableChanged:"draggableChanged",mapDragstart:"mapDragstart",flatChanged:"flatChanged",iconChanged:"iconChanged",mapMousedown:"mapMousedown",mapMouseout:"mapMouseout",mapM
1ouseover:"mapMouseover",mapMouseup:"mapMouseup",positionChanged:"positionChanged",mapRightclick:"mapRightclick",shapeChanged:"shapeChanged",titleChanged:"titleChanged",visibleChanged:"visibleChanged",zindexChanged:"zindexChanged"},exportAs:["mapMarker"],features:[e.\u0275\u0275NgOnChangesFeature]}),i})(),pt=(()=>{class i{set options(t){this._options.next(t||{})}set paths(t){this._paths.next(t)}constructor(t,n){this._map=t,this._ngZone=n,this._eventManager=new L(this._ngZone),this._options=new x.X({}),this._paths=new x.X(void 0),this._destroyed=new y.x,this.polygonClick=this._eventManager.getLazyEmitter("click"),this.polygonDblclick=this._eventManager.getLazyEmitter("dblclick"),this.polygonDrag=this._eventManager.getLazyEmitter("drag"),this.polygonDragend=this._eventManager.getLazyEmitter("dragend"),this.polygonDragstart=this._eventManager.getLazyEmitter("dragstart"),this.polygonMousedown=this._eventManager.getLazyEmitter("mousedown"),this.polygonMousemove=this._eventManager.getLazyEmitter("mousemove"),this.polygonMouseout=this._eventManager.getLazyEmitter("mouseout"),this.polygonMouseover=this._eventManager.getLazyEmitter("mouseover"),this.polygonMouseup=this._eventManager.getLazyEmitter("mouseup"),this.polygonRightclick=this._eventManager.getLazyEmitter("rightclick")}ngOnInit(){this._map._isBrowser&&(this._combineOptions().pipe((0,W.q)(1)).subscribe(t=>{this._ngZone.runOutsideAngular(()=>{this.polygon=new google.maps.Polygon(t)}),this._assertInitialized(),this.polygon.setMap(this._map.googleMap),this._eventManager.setTarget(this.polygon)}),this._watchForOptionsChanges(),this._watchForPathChanges())}ngOnDestroy(){this._eventManager.destroy(),this._destroyed.next(),this._destroyed.complete(),this.polygon&&this.polygon.setMap(null)}getDraggable(){return this._assertInitialized(),this.polygon.getDraggable()}getEditable(){return this._assertInitialized(),this.polygon.getEditable()}getPath(){return this._assertInitialized(),this.polygon.getPath()}getPaths(){return this._assertInitialized(),this.polygon.getPaths()}getVisible(){return this._assertInitialized(),this.polygon.getVisible()}_combineOptions(){return(0,ne.a)([this._options,this._paths]).pipe((0,V.U)(([t,n])=>({...t,paths:n||t.paths})))}_watchForOptionsChanges(){this._options.pipe((0,u.R)(this._destroyed)).subscribe(t=>{this._assertInitialized(),this.polygon.setOptions(t)})}_watchForPathChanges(){this._paths.pipe((0,u.R)(this._destroyed)).subscribe(t=>{t&&(this._assertInitialized(),this.polygon.setPaths(t))})}_assertInitialized(){}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(O),e.\u0275\u0275directiveInject(e.NgZone))},i.\u0275dir=e.\u0275\u0275defineDirective({type:i,selectors:[["map-polygon"]],inputs:{options:"options",paths:"paths"},outputs:{polygonClick:"polygonClick",polygonDblclick:"polygonDblclick",polygonDrag:"polygonDrag",polygonDragend:"polygonDragend",polygonDragstart:"polygonDragstart",polygonMousedown:"polygonMousedown",polygonMousemove:"polygonMousemove",polygonMouseout:"polygonMouseout",polygonMouseover:"polygonMouseover",polygonMouseup:"polygonMouseup",polygonRightclick:"polygonRightclick"},exportAs:["mapPolygon"]}),i})(),dr=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.\u0275\u0275defineNgModule({type:i}),i.\u0275inj=e.\u0275\u0275defineInjector({}),i})();var pr=d(171),cr=d(671);const mr=["myGoogleMap"],gr=["mapSearchField"],hr=["infoWindow"],ur=["markerElem"];function _r(i,o){1&i&&(e.\u0275\u0275elementStart(0,"div",22),e.\u0275\u0275element(1,"i-feather",23)(2,"p",24),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd()),2&i&&(e.\u0275\u0275advance(2),e.\u0275\u0275property("innerText",e.\u0275\u0275pipeBind1(3,1,"order.accurateDeliverySearchHint")))}function fr(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"i-feather",25),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(r.clearSearchField())}),e.\u0275\u0275elementEnd()}}function vr(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",35)(1,"div",36),e.\u0275\u0275element(2,"i-feather",37),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(3,"div",38),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd()()),2&i){const t=e.\u0275\u0275nextContext().$implicit,n=e.\u0275\u0275nextContext();e.\u0275\u0275advance(4),e.\u0275\u0275textInterpolate1(" ",n.secondsToHours(t.deliveryTime.min)+"-"+n.secondsToHours(t.deliveryTime.max)," ")}}function yr(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"div",39)(2,"div",40),e.\u0275\u0275text(3),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275elementStart(5,"span",41),e.\u0275\u0275text(6),e.\u0275\u0275pipe(7,"price"),e.\u0275\u0275elementEnd()()(),e.\u0275\u0275elementContainerEnd()),2&i){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(4,2,"deliveryZones.mainDelivery")," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(7,4,t.defaultPriceFormationFromAmount)," ")}}function Cr(i,o){1&i&&(e.\u0275\u0275elementStart(0,"span"),e.\u0275\u0275text(1,","),e.\u0275\u0275elementEnd())}function xr(i,o){if(1&i&&(e.\u0275\u0275elementContainerStart(0),e.\u0275\u0275elementStart(1,"span",41),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"price"),e.\u0275\u0275pipe(4,"translate"),e.\u0275\u0275pipe(5,"price"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(6,Cr,2,0,"span",31),e.\u0275\u0275elementContainerEnd()),2&i){const t=o.$implicit,n=o.last;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate3(" ",e.\u0275\u0275pipeBind1(3,4,t.cost)," ",e.\u0275\u0275pipeBind1(4,6,"deliveryZones.orderFrom")," ",e.\u0275\u0275pipeBind1(5,8,t.sum),""),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",!n)}}function Mr(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",39)(1,"div",40),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275template(4,xr,7,10,"ng-container",42),e.\u0275\u0275elementEnd()()),2&i){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(3,2,"deliveryZones.delivery")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",t.listPriceFormationFromAmount)}}function br(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",43)(1,"div",44),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",45),e.\u0275\u0275text(5),e.\u0275\u0275pipe(6,"translate"),e.\u0275\u0275pipe(7,"price"),e.\u0275\u0275elementEnd()()),2&i){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(3,3,"deliveryZones.freeDelivery")," "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate2(" ",e.\u0275\u0275pipeBind1(6,5,"deliveryZones.from")," ",e.\u0275\u0275pipeBind1(7,7,t.freeDeliveryFrom)," ")}}function wr(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",46)(1,"div",47),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275element(4,"div",48),e.\u0275\u0275elementEnd()),2&i){const t=e.\u0275\u0275nextContext(2);e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(3,2,"deliveryZones.schedule"),": "),e.\u0275\u0275advance(2),e.\u0275\u0275property("innerHTML",t.workSchedule,e.\u0275\u0275sanitizeHtml)}}function Or(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",46)(1,"div",47),e.\u0275\u0275text(2),e.\u0275\u0275pipe(3,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(4,"div",49),e.\u0275\u0275text(5),e.\u0275\u0275elementEnd()()),2&i){const t=e.\u0275\u0275nextContext().$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(3,2,"deliveryZones.description"),": "),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",t.description," ")}}const Sr=function(i){return{backgroundColor:i}};function Dr(i,o){if(1&i&&(e.\u0275\u0275elementStart(0,"div",26)(1,"div",27),e.\u0275\u0275element(2,"div",28),e.\u0275\u0275elementStart(3,"div",29),e.\u0275\u0275text(4),e.\u0275\u0275elementEnd()(),e.\u0275\u0275template(5,vr,5,1,"div",30),e.\u0275\u0275template(6,yr,8,6,"ng-container",31),e.\u0275\u0275template(7,Mr,5,4,"div",32),e.\u0275\u0275template(8,br,8,9,"div",33),e.\u0275\u0275template(9,wr,5,4,"div",34),e.\u0275\u0275template(10,Or,6,4,"div",34),e.\u0275\u0275elementEnd()),2&i){const t=o.$implicit;e.\u0275\u0275advance(2),e.\u0275\u0275property("ngStyle",e.\u0275\u0275pureFunction1(8,Sr,null==t||null==t.options?null:t.options.fillColor)),e.\u0275\u0275advance(2),e.\u0275\u0275textInterpolate(t.name),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.deliveryTime&&(t.deliveryTime.min>0||t.deliveryTime.min>0)),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.defaultPriceFormationFromAmount),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.listPriceFormationFromAmount.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.freeDeliveryFrom),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.workSchedules.length),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",t.description)}}function Pr(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"map-polygon",50),e.\u0275\u0275listener("polygonClick",function(r){e.\u0275\u0275restoreView(t);const a=e.\u0275\u0275nextContext(),s=e.\u0275\u0275reference(24);
1return a.addMarker(r),e.\u0275\u0275resetView(a.openInfo(s))}),e.\u0275\u0275elementEnd()}if(2&i){const t=o.$implicit;e.\u0275\u0275property("paths",t.coordinates)("options",t.options)}}function Ir(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",51),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(r.isShowInfoSidebar=!r.isShowInfoSidebar)}),e.\u0275\u0275element(1,"i-feather",52),e.\u0275\u0275elementEnd()}}function Er(i,o){if(1&i){const t=e.\u0275\u0275getCurrentView();e.\u0275\u0275elementStart(0,"div",51),e.\u0275\u0275listener("click",function(){e.\u0275\u0275restoreView(t);const r=e.\u0275\u0275nextContext();return e.\u0275\u0275resetView(r.isShowInfoSidebar=!r.isShowInfoSidebar)}),e.\u0275\u0275element(1,"i-feather",53),e.\u0275\u0275elementEnd()}}const Lr=["*"];let Tr=(()=>{class i{constructor(t,n,r,a){this.amSnackbarService=t,this.translateService=n,this.appService=r,this.iconRegistry=a,this.polygonArray=[],this.workSchedule="",this.markerElem=new google.maps.Marker,this.calculateDeliveryPrice=new e.EventEmitter,this.searchValue="",this.maxZoom=20,this.minZoom=4,this.zIndex=100,this.options={disableDoubleClickZoom:!0,mapTypeId:"terrain",maxZoom:this.maxZoom,minZoom:this.minZoom,zoom:12,mapTypeControl:!1,streetViewControl:!1,fullscreenControl:!0,fullscreenControlOptions:{position:google.maps.ControlPosition.RIGHT_BOTTOM},gestureHandling:"greedy"},this.formattedAddress=null,this.isShowInfoSidebar=!0,this.mappedPolygonArray=[],this.searchValueSubject=new y.x,this.destroy$=new y.x,this.showAddressHint=(0,B.Rs)(),this.geocoder=new google.maps.Geocoder,this.iconRegistry.registerIcons([M.ig,M.Df])}ngOnInit(){this.polygonArray.forEach(n=>{this.zIndex=n.order+1,this.polygon={...n,options:{strokeColor:"#"+n.color.slice(2),fillColor:"#"+n.color.slice(2),strokeWeight:n.lineWidth,clickable:!0,zIndex:this.zIndex,fillOpacity:.2,strokeOpacity:.8}},this.mappedPolygonArray.push(this.polygon)});const t=new je(this.mappedPolygonArray[0]?.coordinates)?.centroid();this.center={...t},this.mainCurrency=this.appService.currencySymbols[this.appService.config.config.info.mainCurrency
1],this.emitDeliveryResult(),this.searchValueSubject.pipe((0,u.R)(this.destroy$),(0,_.b)(3e3)).subscribe(n=>{this.isGeocodingCompleted&&this.geocodeAddress(n)})}checkMapFailure(){this.appService.setGoogleMapsLoaded.next(!1)}changeSearchValueInput(t){const n=t.target.value;this.isGeocodingCompleted=!0,this.searchValueSubject.next(n)}ngAfterViewInit(){this.configureMapFitBounds()}setMarkerOnTheMap(t,n,r=!0){this.marker={position:{lat:t,lng:n},options:{animation:google.maps.Animation.DROP}},this.isPointInsidePolygon(t,n,this.mappedPolygonArray,r)}configureMapFitBounds(){const t=new google.maps.places.SearchBox(this.searchField.nativeElement);t.addListener("places_changed",()=>{this.isGeocodingCompleted=!1;const n=t.getPlaces();if(0===n.length)return;const r=new google.maps.LatLngBounds;n.forEach(a=>{!a.geometry||!a.geometry.location||(a.geometry.viewport?r.union(a.geometry.viewport):r.extend(a.geometry.location),this.setMarkerOnTheMap(a.geometry.location.lat(),a.geometry.location.lng()),this.map.fitBounds(r))})}),this.isGeocodingCompleted=!1,this.showField()}secondsToHours(t){return(0,E.sX)(t)}listPriceFormationFromAmount(){let t="";const n=this.infoContent.listPriceFormationFromAmount;for(let r=0;r<n.length;r++){const a=n[r];t+=a.cost+this.mainCurrency+" "+this.translateService.instant("deliveryZones.orderFrom")+" "+a.sum+this.mainCurrency,r!==n.length-1&&(t+=", ")}return t}showField(t){if(!t)return void(this.infoContent=null);this.infoContent=t;const n_freeDeliveryFrom=this.infoContent?.freeDeliveryFrom?"block":"none",n_workSchedule=this.infoContent?.workSchedules.length?"flex":"none",n_deliveryTime=this.infoContent.deliveryTime&&(this.infoContent.deliveryTime.min>0||this.infoContent.deliveryTime.min>0)?"flex":"none",n_defaultPriceFormationFromAmount=this.infoContent.defaultPriceFormationFromAmount?"flex":"none",n_listPriceFormationFromAmount=this.infoContent.listPriceFormationFromAmount.length?"flex":"none",n_description=this.infoContent.description?"flex":"none",r=this.infoContent.deliveryTime?this.secondsToHours(this.infoContent.deliveryTime.min)+"-"+this.secondsToHours(this.infoContent.deliveryTime.max):"",a=this.infoContent?.listPriceFormationFromAmount.length?this.listPriceFormationFromAmount():"";this?.info?.infoWindow?.setOptions({maxWidth:300}),this?.info?.infoWindow?.setContent(`\n <div style="display:inline-block;max-width: 300px;">\n <div style="display: flex; align-items: center">\n <div\n class="map-sidebar__zone-ellipse"\n style="margin-right:5px;\n width: 14px;\n height: 14px;\n border-radius: 50%;\n background-color:${this?.infoContent?.options?.fillColor}"\n ></div>\n <div\n style="font-weight: 500; font-size: 14px; line-height: 25px; color: #212121"\n >\n ${this.infoContent?.name}\n </div>\n </div>\n \n <div\n style="\n display: flex;\n align-items: center;\n margin-top: 4px;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n display:${n_defaultPriceFormationFromAmount}\n "\n >\n <div style="color: #8c8c8c">${this.translateService.instant("deliveryZones.mainDelivery")}</div>\n <div\n style="color: #212121; margin-left: 4px; font-weight: 500"\n >\n ${this.infoContent.defaultPriceFormationFromAmount}${this.mainCurrency}\n </div>\n </div>\n\n <div\n style="\n display: flex;\n flex-direction:column;\n margin-top: 4px;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n display:${n_listPriceFormationFromAmount}\n "\n >\n <div style="color: #8c8c8c">${this.translateService.instant("deliveryZones.delivery")}</div>\n <div\n style="color: #212121; font-weight: 500"\n >\n ${a}\n </div>\n </div>\n \n <div\n style=" display: flex;\n align-items: center;\n margin-top: 8px;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n display: ${n_freeDeliveryFrom};\n "\n >\n <div style="font-weight: 500; color: #8c8c8c">\n ${this.translateService.instant("deliveryZones.freeDelivery")}\n </div>\n <div style="color: #212121; margin-left: 4px; font-weight: 500">\n \u043e\u0442 ${this.infoContent?.freeDeliveryFrom}${this.mainCurrency}\n </div>\n </div>\n \n <div\n style="\n margin-top: 8px;\n font-size: 13px;\n line-height: 20px;\n font-weight: 500;\n display:${n_workSchedule};\n flex-direction:column;">\n <div style="color: #8c8c8c;margin-bottom:5px;">${this.translateService.instant("deliveryZones.schedule")}:</div>\n <div style="color: #212121;">\n ${this.workSchedule}\n </div>\n \n </div>\n <div style="display: flex;\n align-items: center;\n margin-top: 8px;\n font-size: 13px;\n height: 20px;\n font-weight: 500;\n display:${n_deliveryTime};\n ">\n <div style="height:20px">\n <svg style="width:20px;height:20px;margin-right:5px;" fill="none" width="20" height="20" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg">\n ${this.iconRegistry.getIconElement("clock").innerHTML}\n </svg>\n </div>\n <div class="map-sidebar__duration-text">\n ${r}\n </div>\n </div>\n <div style="display:${n_description};\n margin-top: 8px;\n font-size: 13px;\n font-weight: 500;\n flex-direction:column;\n ">\n <div style="color: #8c8c8c;margin-bottom:5px;">${this.translateService.instant("deliveryZones.description")}:</div>\n <div style="color: #212121;">\n ${this.infoContent.description}\n </div>\n </div>\n </div>\n </div>\n `)}clearSearchField(){this.searchValue="",this.emitDeliveryResult()}isPointInsidePolygon(t,n,r,a=!0){let s,m;for(let g=0;g<r.length;g++){const f=new google.maps.Polygon({paths:r[g].coordinates});s=google.maps.geometry.poly.containsLocation(new google.maps.LatLng(t,n),f),s&&(m=r[g])}
1m?(a&&this.geocodeLatLng(t,n),this.showField(m),this.infoContent=m):(this.infoContent=null,this.emitDeliveryResult(),this.amSnackbarService.openSnackbar("error",{notification:{body:this.translateService.instant((0,B.cK)())}}))}getCurrentLocation(){navigator.geolocation.getCurrentPosition(t=>{this.center={lat:t.coords.latitude,lng:t.coords.longitude},this.setMarkerOnTheMap(t.coords.latitude,t.coords.longitude)})}addMarker(t){this.markerCoordinates=t,null!=t.latLng&&this.setMarkerOnTheMap(t.latLng.lat(),t.latLng.lng())}openInfo(t){this.infoContent&&this.info.open(t)}geocodeLatLng(t,n){const r={lat:t||this.markerCoordinates?.latLng?.lat(),lng:n||this.markerCoordinates?.latLng?.lng()};this.geocoder.geocode({location:r},(a,s)=>{"OK"===s&&(this.searchValue=a[0].formatted_address,this.emitDeliveryResult(t,n,a[0]))})}geocodeAddress(t){this.geocoder.geocode({address:t},(n,r)=>{if("OK"===r&&n.length>0){const a=n[0].geometry.location.lat(),s=n[0].geometry.location.lng(),m=new google.maps.LatLngBounds(new google.maps.LatLng(a,s));this.emitDeliveryResult(a,s),this.setMarkerOnTheMap(a,s,!1),this.map.fitBounds(m)}else this.emitDeliveryResult(),console.error("geocoding error "+r)})}emitDeliveryResult(t,n,r=null){if(this.searchValue.length&&t&&n){const a=new Qe.F;r&&r?.address_components?.forEach(s=>{if(s?.types?.at(0))switch(s.types.at(0)){case"street_number":case"street_address":a.building=s?.long_name||null;break;case"route":a.street=s?.long_name||null;break;case"locality":a.city=s?.long_name||null;break;case"administrative_area_level_1":case"administrative_area_level_2":case"administrative_area_level_3":case"administrative_area_level_4":case"administrative_area_level_5":case"administrative_area_level_6":case"administrative_area_level_7":a.state=s?.long_name||null;break;case"country":a.country=s?.long_name||null,a.countryCode=s?.short_name||null;break;case"postal_code":a.postcode=s?.long_name||null}}),this.calculateDeliveryPrice.emit({addressName:this.searchValue,addressLatitude:t,addressLongitude:n,detailAddress:a})}else this.calculateDeliveryPrice.emit(!1)}closeInfoWindow(){this.info.close()}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(K.E),e.\u0275\u0275directiveInject(S.sK),e.\u0275\u0275directiveInject(P.z),e.\u0275\u0275directiveInject(M.Zw))},i.\u0275cmp=e.\u0275\u0275defineComponent({type:i,selectors:[["app-google-delivery-zones"]],viewQuery:function(t,n){if(1&t&&(e.\u0275\u0275viewQuery(mr,5),e.\u0275\u0275viewQuery(gr,5),e.\u0275\u0275viewQuery(hr,5),e.\u0275\u0275viewQuery(Re,5),e.\u0275\u0275viewQuery(ur,5)),2&t){let r;e.\u0275\u0275queryRefresh(r=e.\u0275\u0275loadQuery())&&(n.map=r.first),e.\u0275\u0275queryRefresh(r=e.\u0275\u0275loadQuery())&&(n.searchField=r.first),e.\u0275\u0275queryRefresh(r=e.\u0275\u0275loadQuery())&&(n.infoWindow=r.first),e.\u0275\u0275queryRefresh(r=e.\u0275\u0275loadQuery())&&(n.info=r.first),e.\u0275\u0275queryRefresh(r=e.\u0275\u0275loadQuery())&&(n.markerElem=r.first)}},inputs:{polygonArray:"polygonArray",workSchedule:"workSchedule"},outputs:{calculateDeliveryPrice:"calculateDeliveryPrice"},ngContentSelectors:Lr,decls:31,vars:23,consts:[[1,"order-form__group"],["class","address-hint-msg",4,"ngIf"],[1,"order-form__group-raw"],[1,"form-field__lable"],["appearance","outline",1,"am-input","am-input-with-clear"],["matInput","","type","text",1,"delivery-form__search",3,"ngModel","placeholder","ngModelChange","input"],["mapSearchField",""],["class","delivery-form__close","name","x","matSuffix","","mat-icon-button","","type","button",3,"click",4,"ngIf"],["mode","side",1,"map-sidebar__container-item",3,"opened","openedChange"],["drawer",""],[1,"map-sidebar__title"],["class","map-sidebar__wrapper",4,"ngFor","ngForOf"],[1,"map"],[1,"map__container"],["height","500px","width","100%",3,"center","options","mapClick","authFailure"],["myGoogleMap",""],[3,"position","label","title","options","mapMouseout","mapMouseover","mapClick"],["markerElem","mapMarker"],[3,"paths","options","polygonClick",4,"ngFor","ngForOf"],[1,"map__icon",3,"click"],["name","location"],["class","map-sidebar__arrow",3,"click",4,"ngIf"],[1,"address-hint-msg"],["name","alert-circle"],[3,"innerText"],["name","x","matSuffix","","mat-icon-button","","type","button",1,"delivery-form__close",3,"click"],[1,"map-sidebar__wrapper"],[1,"map-sidebar__zone"],[1,"map-sidebar__zone-ellipse",3,"ngStyle"],[1,"map-sidebar__zone-status"],["class","map-sidebar__duration",4,"ngIf"],[4,"ngIf"],["class","map-sidebar__delivery",4,"ngIf"],["class","map-sidebar__free-delivery",4,"ngIf"],["class","map-sidebar__schedule",4,"ngIf"],[1,"map-sidebar__duration"],[1,"map-sidebar__duration-icon"],["name","clock"],[1,"map-sidebar__duration-text"],[1,"map-sidebar__delivery"],[1,"map-sidebar__delivery-title"],[1,"map-sidebar__delivery-price"],[4,"ngFor","ngForOf"],[1,"map-sidebar__free-delivery"],[1,"map-sidebar__free-delivery-title"],[1,"map-sidebar__free-delivery-price"],[1,"map-sidebar__schedule"],[1,"map-sidebar__schedule-title"],[1,"map-sidebar__schedule-text",3,"innerHTML"],[1,"map-sidebar__schedule-text"],[3,"paths","options","polygonClick"],[1,"map-sidebar__arrow",3,"click"],["name","chevron-left"],["name","chevron-right"]],template:function(t,n){if(1&t){const r=e.\u0275\u0275getCurrentView();e.\u0275\u0275projectionDef(),e.\u0275\u0275elementStart(0,"div",0),e.\u0275\u0275template(1,_r,4,3,"div",1),e.\u0275\u0275elementStart(2,"div",2)(3,"div",3),e.\u0275\u0275text(4),e.\u0275\u0275pipe(5,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(6,"mat-form-field",4)(7,"input",5,6),e.\u0275\u0275listener("ngModelChange",function(s){return n.searchValue=s})("input",function(s){return n.changeSearchValueInput(s)}),e.\u0275\u0275pipe(9,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(10,fr,1,0,"i-feather",7),e.\u0275\u0275elementEnd(),e.\u0275\u0275projection(11),e.\u0275\u0275elementEnd()(),e.\u0275\u0275elementStart(12,"mat-drawer-container")(13,"mat-drawer",8,9),e.\u0275\u0275listener("openedChange",function(s){return n.isShowInfoSidebar=s}),e.\u0275\u0275elementStart(15,"div",10),e.\u0275\u0275text(16),e.\u0275\u0275pipe(17,"translate"),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(18,Dr,11,10,"div",11),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(19,"div",12)(20,"div",13)(21,"google-map",14,15),e.\u0275\u0275listener("mapClick",function(s){return n.closeInfoWindow(),n.showField(),n.addMarker(s)})("authFailure",function(){return n.checkMapFailure()}),e.\u0275\u0275elementStart(23,"map-marker",16,17),e.\u0275\u0275listener("mapMouseout",function(){return n.closeInfoWindow()})("mapMouseover",function(){e.\u0275\u0275restoreView(r);const s=e.\u0275\u0275reference(24);
1return e.\u0275\u0275resetView(n.openInfo(s))})("mapClick",function(){e.\u0275\u0275restoreView(r);const s=e.\u0275\u0275reference(24);return n.closeInfoWindow(),e.\u0275\u0275resetView(n.openInfo(s))}),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(25,Pr,1,2,"map-polygon",18),e.\u0275\u0275element(26,"map-info-window"),e.\u0275\u0275elementEnd(),e.\u0275\u0275elementStart(27,"div",19),e.\u0275\u0275listener("click",function(){return n.getCurrentLocation()}),e.\u0275\u0275element(28,"app-icon",20),e.\u0275\u0275elementEnd(),e.\u0275\u0275template(29,Ir,2,0,"div",21),e.\u0275\u0275template(30,Er,2,0,"div",21),e.\u0275\u0275elementEnd()()()}2&t&&(e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",n.showAddressHint),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(5,17,"addressSetingForm.address")," "),e.\u0275\u0275advance(3),e.\u0275\u0275propertyInterpolate("placeholder",e.\u0275\u0275pipeBind1(9,19,"deliveryForm.addressAutocompletePlaceholder")),e.\u0275\u0275property("ngModel",n.searchValue),e.\u0275\u0275advance(3),e.\u0275\u0275property("ngIf",null==n.searchValue?null:n.searchValue.length),e.\u0275\u0275advance(3),e.\u0275\u0275property("opened",n.isShowInfoSidebar),e.\u0275\u0275advance(3),e.\u0275\u0275textInterpolate1(" ",e.\u0275\u0275pipeBind1(17,21,"deliveryZones.zonesInformation")," "),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",n.mappedPolygonArray),e.\u0275\u0275advance(3),e.\u0275\u0275property("center",n.center)("options",n.options),e.\u0275\u0275advance(2),e.\u0275\u0275property("position",null==n.marker?null:n.marker.position)("label",null==n.marker?null:n.marker.label)("title",null==n.marker?null:n.marker.title)("options",null==n.marker?null:n.marker.options),e.\u0275\u0275advance(2),e.\u0275\u0275property("ngForOf",n.mappedPolygonArray),e.\u0275\u0275advance(4),e.\u0275\u0275property("ngIf",n.isShowInfoSidebar),e.\u0275\u0275advance(1),e.\u0275\u0275property("ngIf",!n.isShowInfoSidebar))},dependencies:[C.sg,C.O5,C.PC,c.Fj,c.JJ,c.On,Q.u,Ue.o,b.KE,b.R9,R.Nt,O,Re,Ve,pt,A.jA,A.kh,S.X$,re.d],styles:['@charset "UTF-8";.delivery-form__search[_ngcontent-%COMP%]{width:calc(100% - 22px)}.delivery-form__close[_ngcontent-%COMP%]{position:absolute;cursor:pointer;stroke-width:2.3px;width:23.5px!important;height:23.5px!important;color:var(--mainTextColor)}.delivery-form__close[_ngcontent-%COMP%]:hover{color:var(--borderColor)}.order-form__group[_ngcontent-%COMP%]{margin-bottom:24px}.order-form__group-col[_ngcontent-%COMP%]{width:calc(50% - 10px);padding-bottom:16px;margin-top:24px}.address-hint-msg[_ngcontent-%COMP%]{display:inline-flex;align-items:center;padding:12px;background-color:var(--mainBackgroundColor);border-radius:6px;width:-moz-fit-content;width:fit-content;margin-bottom:12px}.address-hint-msg[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{color:var(--mainTextColor);font-size:12px;font-weight:500}.address-hint-msg[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%]{color:var(--primaryColor);width:18px;height:18px;min-width:18px;min-height:18px;margin-right:8px}.map[_ngcontent-%COMP%]{border:1px solid var(--borderColor);border-radius:2px}.map__container[_ngcontent-%COMP%]{position:relative}.map__icon[_ngcontent-%COMP%]{background:rgb(255,255,255);display:inline-flex;align-items:center;justify-content:center;position:absolute;border:none;margin:10px;text-transform:none;-webkit-appearance:none;appearance:none;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:2px;box-shadow:#0000004d 0 1px 4px -1px;overflow:hidden;bottom:163px;right:0;height:40px;width:40px}.map__icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%], .map__icon[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{height:30px;width:30px;color:#666}.map__icon[_ngcontent-%COMP%] svg[_ngcontent-%COMP%]:hover, .map__icon[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]:hover{color:#4f4f4d}.map-sidebar__arrow[_ngcontent-%COMP%]{position:absolute;top:33px;background-color:var(--primaryColor);padding:17px 7px;box-shadow:0 8px 28px -6px #4f4f4f21,0 8px 28px -6px #18274b0a;border-radius:0 4px 4px 0;margin-left:-1px;cursor:pointer}.map-sidebar__arrow[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%], .map-sidebar__arrow[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{stroke-width:2.5px;width:25px;color:var(--lightTextColor)}.map-sidebar__wrapper[_ngcontent-%COMP%]{padding:8px 0 12px;border-bottom:1px solid rgba(130,130,130,.3)}.map-sidebar__wrapper[_ngcontent-%COMP%]:last-child{border-bottom:none}.map-sidebar__title[_ngcontent-%COMP%]{font-weight:700;font-size:16px;line-height:25px;letter-spacing:0px;text-align:left;color:#212121}.map-sidebar__zone[_ngcontent-%COMP%]{display:flex;align-items:flex-end;margin-top:10px}.map-sidebar__zone-ellipse[_ngcontent-%COMP%]{width:20px;height:20px;border-radius:50%;display:inline-block}.map-sidebar__zone-status[_ngcontent-%COMP%]{font-weight:500;font-size:14px;line-height:19px;letter-spacing:0px;text-align:left;color:#212121;margin-left:8px}.map-sidebar__duration[_ngcontent-%COMP%]{font-size:12px;font-weight:500;line-height:16px;color:#212121;display:inline-flex;align-items:center;margin-top:12px}.map-sidebar__duration-icon[_ngcontent-%COMP%]{height:16px;margin-right:6px}.map-sidebar__duration-icon[_ngcontent-%COMP%] i-feather[_ngcontent-%COMP%], .map-sidebar__duration-icon[_ngcontent-%COMP%] app-icon[_ngcontent-%COMP%]{color:#919191;width:16px;height:100%}.map-sidebar__delivery[_ngcontent-%COMP%]{margin-top:8px;font-size:13px;line-height:20px;font-weight:500}.map-sidebar__delivery-title[_ngcontent-%COMP%]{color:#8c8c8c}.map-sidebar__delivery-price[_ngcontent-%COMP%]{color:#212121;margin-left:4px;font-weight:500}.map-sidebar__free-delivery[_ngcontent-%COMP%]{display:flex;align-items:center;margin-top:8px;font-size:13px;line-height:20px;font-weight:500}.map-sidebar__free-delivery-title[_ngcontent-%COMP%]{font-weight:500;color:#8c8c8c}.map-sidebar__free-delivery-price[_ngcontent-%COMP%]{color:#212121;margin-left:4px;font-weight:500}.map-sidebar__schedule[_ngcontent-%COMP%]{display:flex;flex-direction:column;margin-top:8px;font-size:13px;line-height:20px;font-weight:500}.map-sidebar__schedule-title[_ngcontent-%COMP%]{color:#8c8c8c;margin-bottom:5px;line-height:19px}.map-sidebar__schedule-text[_ngcontent-%COMP%]{color:#212121;line-height:1.5}google-map[_ngcontent-%COMP%]{z-index:0}mat-drawer-container[_ngcontent-%COMP%]{height:100%;top:0;left:0;box-shadow:0 8px 28px -6px #0000000a;border:1px solid var(--borderColor)}mat-drawer-container[_ngcontent-%COMP%] mat-drawer[_ngcontent-%COMP%]{padding:16px;width:259px}@media (max-width: 576px){mat-drawer-container[_ngcontent-%COMP%] mat-drawer[_ngcontent-%COMP%]{width:240px;padding:8px}} .mat-drawer-inner-container::-webkit-scrollbar{width:6px} .mat-drawer-inner-container::-webkit-scrollbar-thumb{background-color:var(--primaryColor)} .gm-style-iw{max-width:300px!important}']}),i})();var kr=d(3632);let Fr=(()=>{class i{constructor(t,n){this.templateRef=t,this.viewContainer=n}ngOnChanges(t){t.key&&(this.viewRef&&this.destroyView(),this.createView())}createView(){this.viewRef=this.viewContainer.createEmbeddedView(this.templateRef)}destroyView(){this.viewRef.destroy(),this.viewRef=null}}return i.\u0275fac=function(t){return new(t||i)(e.\u0275\u0275directiveInject(e.TemplateRef),e.\u0275\u0275directiveInject(e.ViewContainerRef))},i.\u0275dir=e.\u0275\u0275defineDirective({type:i,selectors:[["","rerenderComponentKey",""]],inputs:{key:["rerenderComponentKey","key"]},features:[e.\u0275\u0275NgOnChangesFeature]}),i})();var zr=d(9803),Ar=d(4788),Br=d(2186),Rr=d(4221);const Ze=X.N.datapickerHidetime?"YYYY-MM-DD":"YYYY-MM-DD HH:mm",ct={parse:{dateInput:Ze},display:{dateInput:Ze,monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Vr=(()=>{class i{}return i.\u0275fac=function(t){return new(t||i)},i.\u0275mod=e.\u0275\u0275defineNgModule({type:i}),i.\u0275inj=e.\u0275\u0275defineInjector({providers:[tt,_e.p,{provide:U.ab,useValue:ct},{provide:ot.S9,useValue:ct},Xe._,re.d],imports:[C.ez,Jn.m,ti,R.c,U.EC,U.K,ie.Bb,U.Yy,Ti.a,ee.Is,ki.v,Fi.L,kr.U,zi.q,nt.LD,Hi.n,Wi.p9,c.u5,et.FA,ot._W,dr,A.SJ,cr.p0,_t]}),i})();e.\u0275\u0275setComponentScope(Ye,[C.mk,C.sg,C.O5,C.PC,c._Y,c.Fj,c.JJ,c.JL,c.nD,c.sg,c.u,Q.u,rt.L,Fr,Je.gM,b.TO,b.KE,b.R9,R.Nt,U.AB,U.g2,Pe.ey,zr.T,Ar.w,Br.u,Rr.J,Ce.R,nt.gD,et.nW,qe,Li,Vi,Gi,zt,Tr,pr.X],[C.Ov,S.X$])},9994:(Ne,$,d)=>{d.d($,{L:()=>e});var A=d(9444),P=d(4650);let e=(()=>{class y{constructor(_){this.el=_,this.afterDotAmount=2,this.allowNegative=!1,this.regex=new RegExp(/^-?[0-9]+((\.|\,)[0-9]{0,3}){0,1}$/g),this.specialKeys=["Backspace","Tab"]}onKeyDown(_){if(-1!==this.specialKeys.indexOf(_.key))return;const M=this.el.nativeElement.value,h=M.concat(_.key);if(0===this.afterDotAmount&&(h.includes(".")||h.includes(","))&&_.preventDefault(),h.includes(".")){this.text==h&&_.preventDefault();const[j,T]=h.split(".");T.length>+this.afterDotAmount&&_.preventDefault(),this.text=h}this.allowNegative&&!M&&h.includes("-")||h&&!String(h).match(this.regex)&&_.preventDefault()}onPaste(_){_.preventDefault();const M=_.clipboardData.getData("text/plain").replace(/[^\d.]/g,"");document.execCommand("insertText",!1,(0,A.UF)(+M).toString())}onClick(){"0"===this.el.nativeElement.value&&(this.el.nativeElement.value="")}}return y.\u0275fac=function(_){return new(_||y)(P.\u0275\u0275directiveInject(P.ElementRef))},y.\u0275dir=P.\u0275\u0275defineDirective({type:y,selectors:[["","appDigitOnly",""]],hostBindings:function(_,M){1&_&&P.\u0275\u0275listener("keypress",function(j){return M.onKeyDown(j)})("paste",function(j){return M.onPaste(j)})("focus",function(){return M.onClick()})},inputs:{afterDotAmount:"afterDotAmount",allowNegative:"allowNegative"}}),y})()}}]);
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.