{"mappings":"0mBAAA,IAAAA,EAAAC,EAAA,S,aAYO,SAASC,EACfC,EACAC,EACAC,EACAC,IAEAC,mCAA8B,CAC7BC,IAAK,CACJC,SAAU,EACTC,4BACCP,GACAQ,iCAA4BP,EAAkBC,EAAyBC,O,CAOrE,SAASM,EACfC,EACAV,EACAW,EACAC,EACAC,IAEAC,+BACC,CACCC,YAAa,CACZC,GAAIN,EACJO,SAAUjB,EAAUkB,MAAQ,GAAGC,WAAWC,QAAQ,IAAK,KACvDC,mBAAoBR,GAErBP,SAAU,EACTC,4BAAuBP,GAAWsB,iDAA4CtB,EAAWW,SAEvFY,mCAA8BvB,EAAWW,IAE7CC,E,CAIK,SAASY,EAA6CC,EAAuBC,GAAqB,GAClF,IAAlBD,IACHE,0BAAqB,CACpBC,MAAOC,eAAaC,cACpBC,SAAUC,mBAAiBC,MAC3BC,OAAQR,EAAqBS,iBAAeC,aAAeD,iBAAeE,W,CAKtE,SAASC,KACfX,0BAAqB,CACpBC,MAAOC,eAAaU,aACpBR,SAAUC,mBAAiBQ,uBAC3BN,OAAQC,iBAAeI,aACvBE,MAAO,Q","sources":["src/DirectRental/Telemetry.ts"],"sourcesContent":["import { ApartmentAM } from '../Apartments/Api/ApartmentAM';\nimport {\n\taddEcommerceAddToCartNewEvent,\n\taddEcommercePurchaseEvent,\n\tapartmentToProductData,\n\tgetCategoryNameForApartment,\n\tgetCategoryNameForApartmentFromLocationData,\n\tgetLocationFieldsForApartment,\n} from '../Telemetry/TelemetryManager';\nimport { LocationData } from '../LocationDataProvider/LocationData';\nimport { addTelemetryEventGA4, GA4EventAction, GA4EventCategory, GA4EventType } from '../Telemetry/TelemetryGA4';\n\nexport function addTelemetryEventForNewRentalProcessStart(\n\tapartment: ApartmentAM,\n\tmunicipalityName: string,\n\tmunicipalitySubAreaName: string | undefined,\n\tbusinessEntityName: string,\n) {\n\taddEcommerceAddToCartNewEvent({\n\t\tadd: {\n\t\t\tproducts: [\n\t\t\t\tapartmentToProductData(\n\t\t\t\t\tapartment,\n\t\t\t\t\tgetCategoryNameForApartment(municipalityName, municipalitySubAreaName, businessEntityName),\n\t\t\t\t),\n\t\t\t],\n\t\t},\n\t});\n}\n\nexport function addTelemetryEventForRentalComplete(\n\trentalId: string,\n\tapartment: ApartmentAM,\n\tlocationData: LocationData,\n\tuserIsCurrentCustomer: boolean,\n\tpVariationId?: string,\n) {\n\taddEcommercePurchaseEvent(\n\t\t{\n\t\t\tactionField: {\n\t\t\t\tid: rentalId,\n\t\t\t\trevenue: (apartment.rent || 0).toString().replace(',', '.'),\n\t\t\t\tprocessVariationId: pVariationId,\n\t\t\t},\n\t\t\tproducts: [\n\t\t\t\tapartmentToProductData(apartment, getCategoryNameForApartmentFromLocationData(apartment, locationData)),\n\t\t\t],\n\t\t\t...getLocationFieldsForApartment(apartment, locationData),\n\t\t},\n\t\tuserIsCurrentCustomer,\n\t);\n}\n\nexport function addTelemetryEventForContactRequestStepChange(newStepNumber: number, switchedFromRental = false) {\n\tif (newStepNumber === 3) {\n\t\taddTelemetryEventGA4({\n\t\t\tevent: GA4EventType.generate_lead,\n\t\t\tcategory: GA4EventCategory.leads,\n\t\t\taction: switchedFromRental ? GA4EventAction.keskeyttajat : GA4EventAction.eparoijat,\n\t\t});\n\t}\n}\n\nexport function addTelemetryEventForCreditCheckFailed() {\n\taddTelemetryEventGA4({\n\t\tevent: GA4EventType.credit_check,\n\t\tcategory: GA4EventCategory.ecommerce_directrental,\n\t\taction: GA4EventAction.credit_check,\n\t\tlabel: 'fail',\n\t});\n}\n\nexport type ContactRequestStepName = 'Tunnistautuminen' | 'Yhteystiedot' | 'Valmis';\n"],"names":["$5KVkw","parcelRequire","addTelemetryEventForNewRentalProcessStart","apartment","municipalityName","municipalitySubAreaName","businessEntityName","addEcommerceAddToCartNewEvent","add","products","apartmentToProductData","getCategoryNameForApartment","addTelemetryEventForRentalComplete","rentalId","locationData","userIsCurrentCustomer","pVariationId","addEcommercePurchaseEvent","actionField","id","revenue","rent","toString","replace","processVariationId","getCategoryNameForApartmentFromLocationData","getLocationFieldsForApartment","addTelemetryEventForContactRequestStepChange","newStepNumber","switchedFromRental","addTelemetryEventGA4","event","GA4EventType","generate_lead","category","GA4EventCategory","leads","action","GA4EventAction","keskeyttajat","eparoijat","addTelemetryEventForCreditCheckFailed","credit_check","ecommerce_directrental","label"],"version":3,"file":"ApartmentPageNew.d2d102e2.js.map"}