{"version":3,"sources":["node_modules/fast-deep-equal/index.js","libs/listing-profile-common/src/lib/listing-profile.ts","libs/listing-profile-common/src/lib/update-operations.ts","libs/listing-profile-common/src/lib/listing-profile.service.ts","libs/businesses/src/lib/product-activation-prereq-form/product-activation-prereq-form.component.ts","libs/businesses/src/lib/product-activation-prereq-form/product-activation-prereq-form.component.html","libs/businesses/src/lib/product-activation-prereq-form/validators.ts"],"sourcesContent":["'use strict';\n\n// do not edit .js files directly - edit src/index.jst\nmodule.exports = function equal(a, b) {\n if (a === b) return true;\n if (a && b && typeof a == 'object' && typeof b == 'object') {\n if (a.constructor !== b.constructor) return false;\n var length, i, keys;\n if (Array.isArray(a)) {\n length = a.length;\n if (length != b.length) return false;\n for (i = length; i-- !== 0;) if (!equal(a[i], b[i])) return false;\n return true;\n }\n if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;\n if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();\n if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();\n keys = Object.keys(a);\n length = keys.length;\n if (length !== Object.keys(b).length) return false;\n for (i = length; i-- !== 0;) if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;\n for (i = length; i-- !== 0;) {\n var key = keys[i];\n if (!equal(a[key], b[key])) return false;\n }\n return true;\n }\n\n // true if both NaN, false otherwise\n return a !== a && b !== b;\n};","import { DayOfWeek, RegularHoursPeriod, TimeOfDay } from '@vendasta/listing-products';\nexport { ListingProfile } from '@vendasta/listing-products';\n\nfunction is24Hours(hourPeriod: RegularHoursPeriod) {\n return timeIsMidnight(hourPeriod.openTime) && timeIsMidnight(hourPeriod.closeTime);\n}\n\nfunction timeIsMidnight(tod: TimeOfDay) {\n if ((tod.hours === 0 || tod.hours === 24) && tod.minutes === 0) {\n return true;\n }\n return false;\n}\n\nfunction transformUndefinedTimeObject(rhp: RegularHoursPeriod): RegularHoursPeriod {\n if (!rhp.openTime) {\n rhp.openTime = {\n hours: 0,\n minutes: 0,\n seconds: 0,\n nanos: 0,\n toApiJson: undefined,\n };\n }\n if (!rhp.openTime.hours) {\n rhp.openTime.hours = 0;\n }\n if (!rhp.openTime.minutes) {\n rhp.openTime.minutes = 0;\n }\n if (!rhp.closeTime) {\n rhp.closeTime = {\n hours: 0,\n minutes: 0,\n seconds: 0,\n nanos: 0,\n toApiJson: undefined,\n };\n }\n if (!rhp.closeTime.hours) {\n rhp.closeTime.hours = 0;\n }\n if (!rhp.closeTime.minutes) {\n rhp.closeTime.minutes = 0;\n }\n\n return rhp;\n}\n\nfunction bIsNextDayToA(a: DayOfWeek, b: DayOfWeek) {\n if (a + 1 === b) {\n return true;\n }\n if ((a + 1) % 8 === 0) {\n if (b === 1) {\n return true;\n }\n }\n return false;\n}\n\nexport function MergeHours(regularHours: RegularHoursPeriod[]): RegularHoursPeriod[] {\n const mergedHours: RegularHoursPeriod[] = [];\n for (let i = 0; i < regularHours.length; i++) {\n let combiningWrap = false;\n let curr = regularHours[i];\n let next = regularHours[i + 1];\n // If this is the last element in the week we need to check if it\n // should be combined with the first element in the week\n if (i === regularHours.length - 1) {\n if ((curr.closeDay + 1) % 8 === 0) {\n combiningWrap = true;\n next = regularHours[0];\n }\n }\n // Unfuck shitty typescript objects\n if (curr) {\n curr = transformUndefinedTimeObject(curr);\n }\n if (next) {\n next = transformUndefinedTimeObject(next);\n }\n\n if (\n next && // There must be a next entry to paste to\n !is24Hours(curr) && // Don't combine if either span is 24 hours\n !is24Hours(next) &&\n bIsNextDayToA(curr.openDay, next.openDay) && // Spans must be consecutive days\n timeIsMidnight(curr.closeTime) && // Span must end at midnight\n timeIsMidnight(next.openTime) && // Next span must start at midnight\n // Merged span must be less than or equal to 24 hours\n (curr.openTime.hours > next.closeTime.hours ||\n (curr.openTime.hours === next.closeTime.hours && curr.openTime.minutes >= next.closeTime.minutes))\n ) {\n const cs: RegularHoursPeriod = {\n openDay: curr.openDay,\n openTime: curr.openTime,\n closeDay: next.closeDay,\n closeTime: next.closeTime,\n toApiJson(): object {\n return undefined;\n },\n };\n mergedHours.push(cs);\n // For the special case of the last span combining with the first, we\n // also need to go back and remove the first\n if (combiningWrap) {\n mergedHours.shift();\n }\n i++; // skip the next span since it has been combined with the current span\n } else {\n mergedHours.push(curr);\n }\n }\n\n return mergedHours;\n}\n\nexport function SplitHours(timeSpanList: RegularHoursPeriod[]): RegularHoursPeriod[] {\n return timeSpanList.reduce((acc: RegularHoursPeriod[], curr: RegularHoursPeriod) => {\n if (curr.openTime.hours < curr.closeTime.hours) {\n acc.push(curr);\n return acc;\n }\n\n const preMidnightHoursPeriod = new RegularHoursPeriod({\n ...curr,\n closeTime: new TimeOfDay({ hours: 24, minutes: 0 }),\n });\n\n acc.push(preMidnightHoursPeriod);\n\n if (curr.closeTime.hours === 0) {\n return acc;\n }\n\n const nextDay = curr.closeDay + 1 > DayOfWeek.SUNDAY ? 1 : curr.closeDay + 1;\n\n const crossMidnightHoursPeriod = new RegularHoursPeriod({\n ...curr,\n openTime: new TimeOfDay({ hours: 0, minutes: 0 }),\n closeDay: nextDay,\n openDay: nextDay,\n });\n\n acc.push(crossMidnightHoursPeriod);\n return acc;\n }, []);\n}\n","import {\n BingAttributes,\n BusinessHours,\n GoogleAttributes,\n LocationInterface,\n ExternalIdentifiers,\n Geo,\n RichData,\n ServiceArea,\n SocialURLs,\n LegacyProductDetails,\n} from '@vendasta/listing-products';\n\n/**\n * @deprecated This method should not be used. It is a direct copy of the internal rxjs applyMixins function that is no longer exported.\n *\n * This is a copy of internal rxjs implementation details. This function used to be exported, but is now unexported as\n * it wasn't intended to be used outside the library itself. We copied this as a low effort way to migrate to rxjs 7.\n * We should remove this and use the public API.\n *\n * Ultimately, this is based off the alternative implementation of the `applyMixins` function from the TypeScript handbook:\n * https://www.typescriptlang.org/docs/handbook/mixins.html#alternative-pattern\n *\n * @param derivedCtor The class that will be extended\n * @param baseCtors The mixins that will be applied to the derived class\n * @returns void\n *\n * It may make sense to move this to a shared lib, or look at the current typescript handbook implementation to see if\n * there is a better way to do this. I.e. without using `any` types.\n */\n\nfunction applyMixins(derivedCtor: any, baseCtors: any[]): void {\n for (let i = 0, len = baseCtors.length; i < len; i++) {\n const baseCtor = baseCtors[i];\n const propertyKeys = Object.getOwnPropertyNames(baseCtor.prototype);\n for (let j = 0, len2 = propertyKeys.length; j < len2; j++) {\n const name = propertyKeys[j];\n derivedCtor.prototype[name] = baseCtor.prototype[name];\n }\n }\n}\n\nexport class UpdateOperations {\n private operations: AbstractUpdateOperation[] = [];\n\n addUpdateOperation(updateOperation: AbstractUpdateOperation): void {\n this.operations.push(updateOperation);\n }\n\n toApiJson(): object[] {\n if (this.operations.length === 0) {\n return null;\n }\n\n return this.operations\n .map((operation: AbstractUpdateOperation) => {\n const op: any = {};\n const json = operation.toApiJson();\n\n if (json === null) {\n return null;\n }\n\n const mask = operation.getMask();\n if (mask.length === 0) {\n return null;\n }\n\n op[operation.OPERATION_ID] = this.cleanNonFieldMaskProperties(json, mask);\n op.fieldMask = {\n paths: mask,\n };\n return op;\n })\n .filter((op) => !!op);\n }\n\n cleanNonFieldMaskProperties(json: object, paths: string[]): object {\n for (const key in json) {\n if (Object.prototype.hasOwnProperty.call(json, key) && paths.indexOf(key) === -1) {\n delete json[key];\n }\n }\n return json;\n }\n}\n\nexport abstract class AbstractUpdateOperation {\n OPERATION_ID: string;\n\n abstract toApiJson(): object;\n\n getMask(): string[] {\n const mask: string[] = [];\n for (const key in this) {\n if (\n Object.prototype.hasOwnProperty.call(this, key) &&\n typeof this[key] !== 'undefined' &&\n key !== 'OPERATION_ID'\n ) {\n mask.push(key);\n }\n }\n\n return mask;\n }\n}\n\nexport class NapUpdateOperation extends AbstractUpdateOperation implements LocationInterface {\n OPERATION_ID = 'nap';\n companyName: string;\n address: string;\n address2: string;\n city: string;\n state: string;\n zip: string;\n country: string;\n serviceAreaBusiness: boolean;\n website: string;\n workNumber: string[];\n callTrackingNumber: string[];\n location: Geo;\n timezone: string;\n serviceArea: ServiceArea;\n\n constructor(kwargs?: LocationInterface) {\n super();\n return Object.assign(this, kwargs);\n }\n\n toApiJson(): object {\n if (\n typeof this.companyName === 'undefined' &&\n typeof this.address === 'undefined' &&\n typeof this.address2 === 'undefined' &&\n typeof this.city === 'undefined' &&\n typeof this.state === 'undefined' &&\n typeof this.zip === 'undefined' &&\n typeof this.country === 'undefined' &&\n typeof this.website === 'undefined' &&\n typeof this.workNumber === 'undefined' &&\n typeof this.callTrackingNumber === 'undefined' &&\n typeof this.location === 'undefined' &&\n typeof this.timezone === 'undefined' &&\n typeof this.serviceAreaBusiness === 'undefined' &&\n typeof this.serviceArea === 'undefined'\n ) {\n return null;\n }\n return {\n companyName: typeof this.companyName !== 'undefined' ? this.companyName : null,\n address: typeof this.address !== 'undefined' ? this.address : null,\n address2: typeof this.address2 !== 'undefined' ? this.address2 : null,\n city: typeof this.city !== 'undefined' ? this.city : null,\n state: typeof this.state !== 'undefined' ? this.state : null,\n zip: typeof this.zip !== 'undefined' ? this.zip : null,\n country: typeof this.country !== 'undefined' ? this.country : null,\n serviceAreaBusiness: typeof this.serviceAreaBusiness !== 'undefined' ? this.serviceAreaBusiness : null,\n serviceArea: typeof this.serviceArea !== 'undefined' ? this.serviceArea?.toApiJson() : null,\n website: typeof this.website !== 'undefined' ? this.website : null,\n workNumber: typeof this.workNumber !== 'undefined' ? this.workNumber : null,\n callTrackingNumber: typeof this.callTrackingNumber !== 'undefined' ? this.callTrackingNumber : null,\n location: typeof this.location !== 'undefined' ? this.location.toApiJson() : null,\n timezone: typeof this.timezone !== 'undefined' ? this.timezone : null,\n };\n }\n}\n\nexport class ExternalIdentifiersUpdateOperation extends ExternalIdentifiers implements AbstractUpdateOperation {\n OPERATION_ID = 'externalIdentifiers';\n getMask: () => string[];\n toApiJsonWithMask: () => object;\n}\napplyMixins(ExternalIdentifiersUpdateOperation, [AbstractUpdateOperation]);\n\nexport class SocialURLsUpdateOperation extends SocialURLs implements AbstractUpdateOperation {\n OPERATION_ID = 'socialUrls';\n getMask: () => string[];\n toApiJsonWithMask: () => object;\n}\napplyMixins(SocialURLsUpdateOperation, [AbstractUpdateOperation]);\n\nexport class RichDataUpdateOperation extends RichData implements AbstractUpdateOperation {\n OPERATION_ID = 'richData';\n getMask: () => string[];\n toApiJsonWithMask: () => object;\n}\napplyMixins(RichDataUpdateOperation, [AbstractUpdateOperation]);\n\nexport class GoogleAttributesUpdateOperation extends GoogleAttributes implements AbstractUpdateOperation {\n OPERATION_ID = 'googleAttributes';\n getMask: () => string[];\n toApiJsonWithMask: () => object;\n}\napplyMixins(GoogleAttributesUpdateOperation, [AbstractUpdateOperation]);\n\nexport class BingAttributesUpdateOperation extends BingAttributes implements AbstractUpdateOperation {\n OPERATION_ID = 'bingAttributes';\n getMask: () => string[];\n toApiJsonWithMask: () => object;\n}\napplyMixins(BingAttributesUpdateOperation, [AbstractUpdateOperation]);\n\nexport class BusinessHoursUpdateOperation extends BusinessHours implements AbstractUpdateOperation {\n OPERATION_ID = 'businessHours';\n getMask: () => string[];\n toApiJsonWithMask: () => object;\n}\napplyMixins(BusinessHoursUpdateOperation, [AbstractUpdateOperation]);\n\nexport class MoreHoursUpdateOperation extends BusinessHours implements AbstractUpdateOperation {\n OPERATION_ID = 'moreHours';\n getMask: () => string[];\n toApiJsonWithMask: () => object;\n}\napplyMixins(MoreHoursUpdateOperation, [AbstractUpdateOperation]);\n\nexport class LegacyProductDetailsUpdateOperation extends LegacyProductDetails implements AbstractUpdateOperation {\n OPERATION_ID = 'legacyProductDetails';\n getMask: () => string[];\n toApiJsonWithMask: () => object;\n}\napplyMixins(LegacyProductDetailsUpdateOperation, [AbstractUpdateOperation]);\n","import { HttpErrorResponse, HttpResponse } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { Observable, throwError as observableThrowError } from 'rxjs';\nimport { catchError, map, share } from 'rxjs/operators';\nimport { UpdateOperations } from './update-operations';\nimport {\n ProjectionFilter,\n GetMultiListingProfileRequest,\n ListingProfileApiService as ApiService,\n UpdateListingProfileRequest,\n ListingProfile,\n} from '@vendasta/listing-products';\nimport { TranslateService } from '@ngx-translate/core';\n\n@Injectable({ providedIn: 'root' })\nexport class ListingProfileService {\n constructor(\n private lp: ApiService,\n private translate: TranslateService,\n ) {}\n\n get(businessId: string, projectionFilter: ProjectionFilter): Observable {\n return this.lp\n .getMulti(\n new GetMultiListingProfileRequest({\n businessIds: [businessId],\n projectionFilter: projectionFilter,\n languageCode: this.translate.currentLang || this.translate.defaultLang,\n }),\n )\n .pipe(\n map((response) => {\n return response?.listingProfiles?.length > 0 ? response.listingProfiles[0].listingProfile : null;\n }),\n share(),\n );\n }\n\n bulkUpdate(businessId: string, updateOperations: UpdateOperations): Observable> {\n return this.lp\n .update(\n new UpdateListingProfileRequest({\n businessId: businessId,\n updateOperations: updateOperations.toApiJson(),\n }),\n )\n .pipe(\n catchError((err: HttpErrorResponse) => {\n let message;\n if (err.status === 401) {\n message = this.translate.instant('FRONTEND.BUSINESSES.INVALID_SESSION');\n } else if (err.status === 400) {\n message =\n (err.error && err.error.message) || this.translate.instant('FRONTEND.BUSINESSES.INVALID_SUBMISSION');\n } else {\n message = this.translate.instant('FRONTEND.BUSINESSES.FAILED_TO_UPDATE');\n }\n return observableThrowError({ message: message, retryable: err.status === 401 });\n }),\n share(),\n );\n }\n}\n","import { HttpResponse } from '@angular/common/http';\nimport { Component, EventEmitter, Input, OnDestroy, OnInit, Output } from '@angular/core';\nimport {\n UntypedFormArray,\n UntypedFormBuilder,\n UntypedFormControl,\n UntypedFormGroup,\n ValidatorFn,\n Validators,\n} from '@angular/forms';\nimport {\n AccountGroup,\n AccountGroupService,\n ProjectionFilter,\n RichDataUpdateOperation,\n UpdateOperations,\n} from '@galaxy/account-group';\nimport {\n BusinessHoursUpdateOperation,\n UpdateOperations as LPUpdateOperations,\n ListingProfileService,\n MergeHours,\n SplitHours,\n} from '@galaxy/listing-profile-common';\nimport { PartnerApiService } from '@galaxy/marketplace-apps';\nimport { TranslateService } from '@ngx-translate/core';\nimport { SnackbarService } from '@vendasta/galaxy/snackbar-service';\nimport {\n BusinessHours,\n ListingProfile,\n RegularHoursPeriod,\n ProjectionFilter as LPProjectionFilter,\n} from '@vendasta/listing-products';\nimport { OrderFormOptionsInterface } from '@vendasta/store';\nimport equal from 'fast-deep-equal';\nimport { BehaviorSubject, EMPTY, Observable, Subscription, combineLatest, of } from 'rxjs';\nimport { catchError, debounceTime, filter, map, startWith, switchMap, tap } from 'rxjs/operators';\nimport { arrayAllTruthyItemsRequired, totalLengthOfRepeatedFieldValidator } from './validators';\n\ninterface BusinessSectionConfig {\n showHoO: boolean;\n showServices: boolean;\n showBrands: boolean;\n showDescription: boolean;\n showLongDescription: boolean;\n}\n\n@Component({\n selector: 'business-product-activation-prereq-form',\n templateUrl: './product-activation-prereq-form.component.html',\n styleUrls: ['./product-activation-prereq-form.component.scss'],\n})\nexport class ProductActivationPrereqFormComponent implements OnInit, OnDestroy {\n @Input() businessId: string;\n @Input() expanded = false;\n @Input() orderFormOptions: OrderFormOptionsInterface = {};\n\n @Input()\n set productIds(productIds: string[]) {\n this.productIds$$.next(productIds);\n }\n\n @Output() hasBusinessProductActivationPrereqFormEvent: EventEmitter = new EventEmitter();\n\n private productIds$$: BehaviorSubject = new BehaviorSubject([]);\n private sectionConfig$$: BehaviorSubject = new BehaviorSubject(null);\n private submitting$$: BehaviorSubject = new BehaviorSubject(false);\n private loading$$: BehaviorSubject = new BehaviorSubject(true);\n private business$: Observable;\n private listingProfile$: Observable;\n readonly productIds$: Observable = this.productIds$$.asObservable();\n readonly sectionConfig$: Observable = this.sectionConfig$$.asObservable();\n readonly submitting$: Observable = this.submitting$$.asObservable();\n readonly loading$: Observable = this.loading$$.asObservable();\n hasRestrictions$: Observable;\n\n private subscriptions: Subscription[] = [];\n\n businessActivationForm: UntypedFormGroup;\n servicesPlaceholder: string;\n brandsPlaceholder: string;\n\n currentSubmittedFormValues: any;\n public hasUnsavedChanges$$: BehaviorSubject = new BehaviorSubject(false);\n public hasUnsavedChanges$ = this.hasUnsavedChanges$$.asObservable();\n public isValid$: Observable = of(true);\n\n public static checkChipFieldValidity(chipField: any): boolean {\n if (!chipField) {\n return false;\n }\n\n // the chips component's empty state is a list with one empty string\n if (chipField instanceof Array) {\n if (chipField.length === 1 && chipField[0] === '') {\n return false;\n }\n }\n return true;\n }\n\n constructor(\n private fb: UntypedFormBuilder,\n private accountGroupService: AccountGroupService,\n private listingProfileService: ListingProfileService,\n private partnerApiService: PartnerApiService,\n private translateService: TranslateService,\n private alertService: SnackbarService,\n ) {}\n\n ngOnInit(): void {\n this.servicesPlaceholder = this.orderFormOptions?.bypassRequiredQuestions\n ? this.translateService.instant('FRONTEND.BUSINESSES.SERVICES_OFFERED')\n : this.translateService.instant('FRONTEND.BUSINESSES.SERVICES_OFFERED') + ' *';\n this.brandsPlaceholder = this.orderFormOptions?.bypassRequiredQuestions\n ? this.translateService.instant('FRONTEND.BUSINESSES.BRANDS_CARRIED')\n : this.translateService.instant('FRONTEND.BUSINESSES.BRANDS_CARRIED') + ' *';\n\n this.business$ = this.accountGroupService\n .get(\n this.businessId,\n new ProjectionFilter({\n richData: true,\n accountGroupExternalIdentifiers: true,\n }),\n )\n .pipe(catchError(() => of(new AccountGroup())));\n\n this.listingProfile$ = this.listingProfileService\n .get(\n this.businessId,\n new LPProjectionFilter({\n businessHours: true,\n }),\n )\n .pipe(catchError(() => of(new ListingProfile())));\n\n this.getSectionConfig$();\n\n this.hasRestrictions$ = this.sectionConfig$.pipe(\n map((resp) => {\n if (\n resp &&\n (resp.showDescription || resp.showLongDescription || resp.showHoO || resp.showServices || resp.showBrands)\n ) {\n return true;\n } else {\n this.hasBusinessProductActivationPrereqFormEvent.emit(false);\n return false;\n }\n }),\n );\n\n this.subscriptions.push(\n combineLatest([this.business$, this.listingProfile$, this.sectionConfig$])\n .pipe(\n map(([business, listingProfile, sectionConfig]) => {\n const shortDescription = sectionConfig?.showDescription\n ? (business && business.richData && business.richData.shortDescription) || ''\n : null;\n const longDescription = sectionConfig?.showLongDescription\n ? (business && business.richData && business.richData.description) || ''\n : null;\n\n let businessHours: RegularHoursPeriod[] = null;\n if (sectionConfig?.showHoO) {\n const generalHours = listingProfile.businessHours?.find((hours) => hours.hoursTypeId === 'GENERAL');\n businessHours = MergeHours(generalHours?.regularHours || []);\n }\n\n let servicesOffered = null;\n if (sectionConfig?.showServices) {\n servicesOffered = [''];\n if (business?.richData?.servicesOffered && business.richData.servicesOffered.length) {\n servicesOffered = business.richData.servicesOffered;\n }\n }\n\n let brandsCarried = null;\n if (sectionConfig?.showBrands) {\n brandsCarried = [''];\n if (business?.richData?.brandsCarried && business.richData.brandsCarried.length) {\n brandsCarried = business.richData.brandsCarried;\n }\n }\n\n const validators: ValidatorFn[] = [];\n const arrayValidators: ValidatorFn[] = [];\n if (!this.orderFormOptions?.bypassRequiredQuestions) {\n validators.push(Validators.required);\n arrayValidators.push(arrayAllTruthyItemsRequired());\n }\n\n const businessProfileForm = new UntypedFormGroup({});\n if (shortDescription !== null) {\n businessProfileForm.addControl('shortDescription', this.fb.control(shortDescription, validators));\n }\n if (longDescription !== null) {\n businessProfileForm.addControl('description', this.fb.control(longDescription, validators));\n }\n if (businessHours !== null) {\n businessProfileForm.addControl('businessHours', this.fb.control(businessHours, []));\n }\n if (servicesOffered !== null) {\n businessProfileForm.addControl(\n 'servicesOffered',\n this.fb.array(servicesOffered, [\n Validators.compose([\n Validators.minLength(1),\n Validators.maxLength(15),\n ...arrayValidators,\n totalLengthOfRepeatedFieldValidator(\n 256,\n this.translateService.instant('FRONTEND.BUSINESSES.SERVICES_OFFERED'),\n ),\n ]),\n ]),\n );\n }\n if (brandsCarried !== null) {\n businessProfileForm.addControl(\n 'brandsCarried',\n this.fb.array(\n brandsCarried,\n Validators.compose([\n Validators.minLength(1),\n Validators.maxLength(15),\n ...arrayValidators,\n totalLengthOfRepeatedFieldValidator(\n 256,\n this.translateService.instant('FRONTEND.BUSINESSES.BRANDS_CARRIED'),\n ),\n ]),\n ),\n );\n }\n this.currentSubmittedFormValues = JSON.parse(JSON.stringify(businessProfileForm.value));\n return businessProfileForm;\n }),\n )\n .subscribe((form) => {\n this.businessActivationForm = form;\n if (this.orderFormOptions?.readOnly && this.businessActivationForm.controls.businessHours) {\n this.businessActivationForm.controls.businessHours.disable();\n }\n\n // Track changes\n Object.keys(this.businessActivationForm.controls).map((controlName) => {\n return this.subscriptions.push(\n this.businessActivationForm.controls[controlName].valueChanges\n .pipe(\n debounceTime(500),\n tap((changes) =>\n this.hasUnsavedChanges$$.next(!equal(this.currentSubmittedFormValues[controlName], changes)),\n ),\n )\n .subscribe(),\n );\n });\n\n this.isValid$ = this.businessActivationForm.valueChanges.pipe(\n startWith([null]),\n map(() => {\n let hasSubmittedRequiredValues = true;\n for (const key of Object.keys(this.currentSubmittedFormValues)) {\n const formValue = this.currentSubmittedFormValues[key];\n if (!ProductActivationPrereqFormComponent.checkChipFieldValidity(formValue)) {\n hasSubmittedRequiredValues = false;\n break;\n }\n }\n const isValid = this.businessActivationForm.valid && hasSubmittedRequiredValues;\n if (!isValid) {\n this.setAsTouched(this.businessActivationForm);\n }\n return isValid;\n }),\n );\n }),\n );\n }\n\n getSectionConfig$(): void {\n this.loading$$.next(true);\n combineLatest([this.productIds$, this.business$])\n .pipe(\n switchMap(([productIds, business]) => {\n if (!productIds || productIds.length === 0 || business?.deleted || !business.externalIdentifiers) {\n this.loading$$.next(false);\n return of(EMPTY);\n }\n return this.partnerApiService.getMultiApp({\n partnerId: business.externalIdentifiers.partnerId,\n marketId: business.externalIdentifiers.marketId,\n appKeys: productIds.map((appId) => {\n return { appId: appId };\n }),\n includeNotEnabled: true,\n });\n }),\n filter((resp: any) => Boolean(resp?.apps)),\n map((resp) => resp.apps.map((app) => app?.activationInformation?.requiredBusinessData)),\n map((configs) => configs.filter((config) => config)),\n map((configs) =>\n configs.reduce(\n (acc, appConfig) => {\n acc.showHoO = acc.showHoO || appConfig.hours;\n acc.showDescription = acc.showDescription || appConfig.descriptionShort;\n acc.showLongDescription = acc.showLongDescription || appConfig.descriptionLong;\n acc.showBrands = acc.showBrands || appConfig.brands;\n acc.showServices = acc.showServices || appConfig.services;\n return acc;\n },\n {\n showHoO: false,\n showServices: false,\n showBrands: false,\n showDescription: false,\n showLongDescription: false,\n } as BusinessSectionConfig,\n ),\n ),\n catchError((err) => {\n console.error('Error caught: ', err);\n this.loading$$.next(false);\n return EMPTY;\n }),\n )\n .subscribe((config) => {\n this.sectionConfig$$.next(config);\n this.loading$$.next(false);\n });\n }\n\n private setAsTouched(form: UntypedFormGroup): void {\n form.markAsTouched();\n const controls = form.controls;\n for (const i of Object.keys(controls)) {\n if (controls[i] instanceof UntypedFormControl) {\n controls[i].markAsTouched();\n } else if (controls[i] instanceof UntypedFormGroup) {\n this.setAsTouched(controls[i] as UntypedFormGroup);\n } else if (controls[i] instanceof UntypedFormArray) {\n (controls[i] as UntypedFormArray).controls.forEach((c) => c.markAsTouched());\n }\n controls[i].updateValueAndValidity({ emitEvent: false });\n }\n form.updateValueAndValidity({ emitEvent: false });\n }\n\n onSubmit(): void {\n if (this.businessActivationForm.pristine) {\n this.alertService.openErrorSnack('FRONTEND.BUSINESSES.NO_CHANGES_TO_SAVE');\n return;\n }\n\n if (!this.businessActivationForm.valid) {\n let errorMsg = this.translateService.instant('FRONTEND.BUSINESSES.INVALID_SUBMISSION') + ': ';\n if (this.businessActivationForm.get('servicesOffered')?.invalid) {\n errorMsg +=\n this.translateService.instant('FRONTEND.BUSINESSES.PRODUCT_ACTIVATION_FORM.INVALID_SERVICES_OFFERED_FIELD') +\n ' ';\n }\n if (this.businessActivationForm.get('brandsCarried')?.invalid) {\n if (this.businessActivationForm.get('servicesOffered')?.invalid) {\n errorMsg += '| ';\n }\n errorMsg += this.translateService.instant(\n 'FRONTEND.BUSINESSES.PRODUCT_ACTIVATION_FORM.INVALID_BRANDS_CARRIED_FIELD',\n );\n }\n this.alertService.openErrorSnack(errorMsg);\n return;\n }\n\n const data = this.businessActivationForm.value;\n const updateOperations = new UpdateOperations();\n let listingProfileUpdate$: Observable> = of(null);\n\n if (this.businessActivationForm.controls.businessHours?.dirty) {\n const lpUpdateOperations = new LPUpdateOperations();\n lpUpdateOperations.addUpdateOperation(\n new BusinessHoursUpdateOperation(\n new BusinessHours({\n regularHours: SplitHours(data.businessHours),\n hoursTypeId: 'GENERAL',\n }),\n ),\n );\n listingProfileUpdate$ = this.listingProfileService.bulkUpdate(this.businessId, lpUpdateOperations);\n }\n\n const richDataUpdateOperation: RichDataUpdateOperation = new RichDataUpdateOperation();\n if (this.businessActivationForm.controls.brandsCarried?.dirty) {\n richDataUpdateOperation.brandsCarried = data.brandsCarried;\n }\n if (this.businessActivationForm.controls.servicesOffered?.dirty) {\n richDataUpdateOperation.servicesOffered = data.servicesOffered;\n }\n if (this.businessActivationForm.controls.shortDescription?.dirty) {\n richDataUpdateOperation.shortDescription = data.shortDescription;\n }\n if (this.businessActivationForm.controls.description?.dirty) {\n richDataUpdateOperation.description = data.description;\n }\n\n updateOperations.addUpdateOperation(richDataUpdateOperation);\n\n this.submitting$$.next(true);\n const agUpdate$ = this.accountGroupService.bulkUpdate(this.businessId, updateOperations);\n this.subscriptions.push(\n combineLatest([agUpdate$, listingProfileUpdate$]).subscribe({\n next: () => {\n this.alertService.openSuccessSnack('FRONTEND.BUSINESSES.PRODUCT_ACTIVATION_FORM.SUCCESS_MESSAGE');\n this.currentSubmittedFormValues = JSON.parse(JSON.stringify(data));\n this.businessActivationForm.updateValueAndValidity();\n this.hasUnsavedChanges$$.next(false);\n },\n error: (err) => {\n console.error('Error saving to account group %s; error %s', this.businessId, err);\n this.alertService.openErrorSnack('FRONTEND.BUSINESSES.PRODUCT_ACTIVATION_FORM.ERROR_MESSAGE');\n this.submitting$$.next(false);\n },\n complete: () => {\n this.submitting$$.next(false);\n },\n }),\n );\n }\n\n ngOnDestroy(): void {\n this.subscriptions.forEach((subscription) => subscription.unsubscribe());\n }\n}\n","\n
\n
\n
\n\n \n \n \n \n \n {{ 'FRONTEND.BUSINESSES.PRODUCT_ACTIVATION_FORM.ACCOUNT_INFORMATION' | translate }}\n \n \n {{ 'FRONTEND.BUSINESSES.PRODUCT_ACTIVATION_FORM.ACCOUNT_INFORMATION_SUBTITLE' | translate }}\n \n \n \n \n \n \n\n\n\n
\n \n \n \n \n \n warning\n \n \n info_outline\n \n \n {{ 'FRONTEND.BUSINESSES.PRODUCT_ACTIVATION_FORM.FULL_BUSINESS_PROFILE' | translate }}\n \n \n \n \n \n \n {{ 'FRONTEND.BUSINESSES.PRODUCT_ACTIVATION_FORM.FULL_BUSINESS_PROFILE_DESCRIPTION' | translate }}\n \n \n \n \n {{\n 'FRONTEND.BUSINESSES.PRODUCT_ACTIVATION_FORM.FULL_BUSINESS_PROFILE_READ_ONLY_DESCRIPTION' | translate\n }}\n \n \n \n \n \n \n \n {{ 'FRONTEND.BUSINESSES.LONG_DESCRIPTION' | translate }}\n *\n \n \n {{ longDescription.value.length }} / 750\n \n
\n
\n {{ 'FRONTEND.BUSINESSES.LONG_DESCRIPTION' | translate }}\n
\n
\n {{ businessActivationForm.controls.description?.value }}\n
\n
\n \n \n {{ 'FRONTEND.BUSINESSES.SHORT_DESCRIPTION' | translate }}\n *\n \n \n {{ shortDescription.value.length }} / 200\n \n
\n
\n {{ 'FRONTEND.BUSINESSES.SHORT_DESCRIPTION' | translate }}\n
\n
\n {{ businessActivationForm.controls.shortDescription?.value }}\n
\n
\n \n \n
\n \n {{ 'FRONTEND.BUSINESSES.SAVE' | translate }}\n \n \n {{ 'FRONTEND.BUSINESSES.UNSAVED_CHANGES' | translate }}\n \n
\n
\n
\n
\n","import { AbstractControl, ValidatorFn } from '@angular/forms';\n\nexport function totalLengthOfRepeatedFieldValidator(maxLength: number, friendlyName: string): ValidatorFn {\n return (control: AbstractControl): { [key: string]: any } => {\n if (!control.value) {\n return null;\n }\n if (control.value.length === 0) {\n return null;\n }\n\n const value = control.value.filter((val: string) => !!val).join(',');\n return value.length > maxLength\n ? {\n lengthOfRepeatedField: {\n maxLength: maxLength,\n friendlyName: friendlyName,\n },\n }\n : null;\n };\n}\n\n// Validation to ensure that all items in an array control have truthy values\nexport function arrayAllTruthyItemsRequired(): ValidatorFn {\n return (control: AbstractControl): { [key: string]: any } => {\n const values = (control.value || []).filter((v: any) => !!v);\n return values.length !== control.value.length ? { required: '' } : null;\n };\n}\n"],"mappings":"ijCAAA,IAAAA,GAAAC,GAAA,CAAAC,GAAAC,KAAA,cAGAA,GAAO,QAAU,SAASC,EAAMC,EAAGC,EAAG,CACpC,GAAID,IAAMC,EAAG,MAAO,GACpB,GAAID,GAAKC,GAAK,OAAOD,GAAK,UAAY,OAAOC,GAAK,SAAU,CAC1D,GAAID,EAAE,cAAgBC,EAAE,YAAa,MAAO,GAC5C,IAAIC,EAAQ,EAAGC,EACf,GAAI,MAAM,QAAQH,CAAC,EAAG,CAEpB,GADAE,EAASF,EAAE,OACPE,GAAUD,EAAE,OAAQ,MAAO,GAC/B,IAAK,EAAIC,EAAQ,MAAQ,GAAI,GAAI,CAACH,EAAMC,EAAE,CAAC,EAAGC,EAAE,CAAC,CAAC,EAAG,MAAO,GAC5D,MAAO,EACT,CACA,GAAID,EAAE,cAAgB,OAAQ,OAAOA,EAAE,SAAWC,EAAE,QAAUD,EAAE,QAAUC,EAAE,MAC5E,GAAID,EAAE,UAAY,OAAO,UAAU,QAAS,OAAOA,EAAE,QAAQ,IAAMC,EAAE,QAAQ,EAC7E,GAAID,EAAE,WAAa,OAAO,UAAU,SAAU,OAAOA,EAAE,SAAS,IAAMC,EAAE,SAAS,EAGjF,GAFAE,EAAO,OAAO,KAAKH,CAAC,EACpBE,EAASC,EAAK,OACVD,IAAW,OAAO,KAAKD,CAAC,EAAE,OAAQ,MAAO,GAC7C,IAAK,EAAIC,EAAQ,MAAQ,GAAI,GAAI,CAAC,OAAO,UAAU,eAAe,KAAKD,EAAGE,EAAK,CAAC,CAAC,EAAG,MAAO,GAC3F,IAAK,EAAID,EAAQ,MAAQ,GAAI,C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AA,yBAAA,EAAA,CAAA,cAAA,YAAA,EAAA,WAAA,SAAA,EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,WAAA,GAAA,sBAAA,GAAA,qBAAA,IAAA,YAAA,MAAA,kBAAA,cAAA,cAAA,mBAAA,EAAA,CAAA,QAAA,KAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,QAAA,EAAA,CAAA,WAAA,GAAA,sBAAA,GAAA,qBAAA,IAAA,YAAA,MAAA,kBAAA,mBAAA,cAAA,yBAAA,EAAA,CAAA,cAAA,iBAAA,EAAA,eAAA,UAAA,UAAA,QAAA,YAAA,gBAAA,YAAA,EAAA,CAAA,cAAA,uBAAA,EAAA,eAAA,UAAA,UAAA,QAAA,YAAA,gBAAA,YAAA,EAAA,CAAA,kBAAA,GAAA,QAAA,UAAA,OAAA,SAAA,EAAA,UAAA,EAAA,CAAA,cAAA,0BAAA,EAAA,iBAAA,CAAA,EAAAC,SAAA,SAAAC,EAAAC,EAAA,IAAAD,EAAA,ICpDjD1O,EAAA,EAAA4O,GAAA,EAAA,EAAA,eAAA,CAAA,eAIA5O,EAAA,EAAA6O,GAAA,EAAA,EAAA,cAAA,KAAA,EAAAjM,CAAA,EAAqB,EAAAkM,GAAA,GAAA,GAAA,cAAA,KAAA,EAAAlM,CAAA,mBAJNvC,EAAA,OAAAD,EAAA,EAAA,EAAAuO,EAAA3N,QAAA,CAAA,EAAwB,WAAA+N,CAAA;qIDoDjC,IAAO7K,EAAP8K,SAAO9K,CAAoC,GAAA","names":["require_fast_deep_equal","__commonJSMin","exports","module","equal","a","b","length","keys","key","is24Hours","hourPeriod","timeIsMidnight","openTime","closeTime","tod","hours","minutes","transformUndefinedTimeObject","rhp","seconds","nanos","toApiJson","undefined","bIsNextDayToA","a","b","MergeHours","regularHours","mergedHours","i","length","combiningWrap","curr","next","closeDay","openDay","cs","push","shift","SplitHours","timeSpanList","reduce","acc","preMidnightHoursPeriod","RegularHoursPeriod","__spreadProps","__spreadValues","TimeOfDay","nextDay","DayOfWeek","SUNDAY","crossMidnightHoursPeriod","applyMixins","derivedCtor","baseCtors","i","len","length","baseCtor","propertyKeys","Object","getOwnPropertyNames","prototype","j","len2","name","UpdateOperations","constructor","operations","addUpdateOperation","updateOperation","push","toApiJson","map","operation","op","json","mask","getMask","OPERATION_ID","cleanNonFieldMaskProperties","fieldMask","paths","filter","key","hasOwnProperty","call","indexOf","AbstractUpdateOperation","ExternalIdentifiersUpdateOperation","ExternalIdentifiers","constructor","OPERATION_ID","applyMixins","AbstractUpdateOperation","SocialURLsUpdateOperation","SocialURLs","RichDataUpdateOperation","RichData","GoogleAttributesUpdateOperation","GoogleAttributes","BingAttributesUpdateOperation","BingAttributes","BusinessHoursUpdateOperation","BusinessHours","MoreHoursUpdateOperation","LegacyProductDetailsUpdateOperation","LegacyProductDetails","ListingProfileService","constructor","lp","translate","get","businessId","projectionFilter","getMulti","GetMultiListingProfileRequest","businessIds","languageCode","currentLang","defaultLang","pipe","map","response","listingProfiles","length","listingProfile","share","bulkUpdate","updateOperations","update","UpdateListingProfileRequest","toApiJson","catchError","err","message","status","instant","error","observableThrowError","retryable","ɵɵinject","ListingProfileApiService","TranslateService","factory","ɵfac","providedIn","_ListingProfileService","import_fast_deep_equal","totalLengthOfRepeatedFieldValidator","maxLength","friendlyName","control","value","length","filter","val","join","lengthOfRepeatedField","arrayAllTruthyItemsRequired","v","required","ɵɵelementContainerStart","ɵɵelement","ɵɵelementStart","ɵɵtext","ɵɵelementEnd","ɵɵtemplate","ProductActivationPrereqFormComponent_ng_template_2_ng_container_0_ng_container_1_ng_template_9_Template","ɵɵadvance","ɵɵtextInterpolate1","ɵɵpipeBind1","ɵɵproperty","content_r2","ɵɵpureFunction1","_c0","sectionConfig_r1","ProductActivationPrereqFormComponent_ng_template_2_ng_container_0_ng_container_1_Template","ctx_r2","sectionConfig$","ProductActivationPrereqFormComponent_ng_template_2_ng_container_0_Template","hasRestrictions$","businessActivationForm","loading$","get","ProductActivationPrereqFormComponent_ng_template_4_glxy_form_field_16_span_4_Template","orderFormOptions","bypassRequiredQuestions","longDescription_r5","value","length","controls","description","ProductActivationPrereqFormComponent_ng_template_4_glxy_form_field_18_span_4_Template","shortDescription_r6","shortDescription","servicesPlaceholder","readOnly","brandsPlaceholder","submitting$","ɵɵlistener","ɵɵrestoreView","_r4","ɵɵnextContext","ɵɵresetView","onSubmit","$event","i0","preventDefault","ProductActivationPrereqFormComponent_ng_template_4_ng_container_5_Template","ProductActivationPrereqFormComponent_ng_template_4_ng_template_6_Template","ɵɵtemplateRefExtractor","ProductActivationPrereqFormComponent_ng_template_4_ng_container_12_Template","ProductActivationPrereqFormComponent_ng_template_4_ng_template_13_Template","ProductActivationPrereqFormComponent_ng_template_4_forms_business_hours_15_Template","ProductActivationPrereqFormComponent_ng_template_4_glxy_form_field_16_Template","ProductActivationPrereqFormComponent_ng_template_4_div_17_Template","ProductActivationPrereqFormComponent_ng_template_4_glxy_form_field_18_Template","ProductActivationPrereqFormComponent_ng_template_4_div_19_Template","ProductActivationPrereqFormComponent_ng_template_4_forms_va_input_repeated_20_Template","ProductActivationPrereqFormComponent_ng_template_4_forms_va_input_repeated_21_Template","ProductActivationPrereqFormComponent_ng_template_4_button_23_Template","ProductActivationPrereqFormComponent_ng_template_4_span_24_Template","expanded","infoIcon_r8","readOnlyPanelMessage_r9","sectionConfig_r7","showHoO","showLongDescription","showDescription","showServices","showBrands","hasUnsavedChanges$","ProductActivationPrereqFormComponent","productIds","productIds$$","next","checkChipFieldValidity","chipField","Array","constructor","fb","accountGroupService","listingProfileService","partnerApiService","translateService","alertService","hasBusinessProductActivationPrereqFormEvent","EventEmitter","BehaviorSubject","sectionConfig$$","submitting$$","loading$$","productIds$","asObservable","subscriptions","hasUnsavedChanges$$","isValid$","of","ngOnInit","instant","business$","businessId","ProjectionFilter","richData","accountGroupExternalIdentifiers","pipe","catchError","AccountGroup","listingProfile$","LPProjectionFilter","businessHours","ListingProfile","getSectionConfig$","map","resp","emit","push","combineLatest","business","listingProfile","sectionConfig","longDescription","generalHours","find","hours","hoursTypeId","MergeHours","regularHours","servicesOffered","brandsCarried","validators","arrayValidators","Validators","required","arrayAllTruthyItemsRequired","businessProfileForm","UntypedFormGroup","addControl","control","array","compose","minLength","maxLength","totalLengthOfRepeatedFieldValidator","currentSubmittedFormValues","JSON","parse","stringify","subscribe","form","disable","Object","keys","controlName","valueChanges","debounceTime","tap","changes","equal","startWith","hasSubmittedRequiredValues","key","formValue","isValid","valid","setAsTouched","switchMap","deleted","externalIdentifiers","EMPTY","getMultiApp","partnerId","marketId","appKeys","appId","includeNotEnabled","filter","Boolean","apps","app","activationInformation","requiredBusinessData","configs","config","reduce","acc","appConfig","descriptionShort","descriptionLong","brands","services","err","console","error","markAsTouched","i","UntypedFormControl","UntypedFormArray","forEach","c","updateValueAndValidity","emitEvent","pristine","openErrorSnack","errorMsg","invalid","data","updateOperations","UpdateOperations","listingProfileUpdate$","dirty","lpUpdateOperations","LPUpdateOperations","addUpdateOperation","BusinessHoursUpdateOperation","BusinessHours","SplitHours","bulkUpdate","richDataUpdateOperation","RichDataUpdateOperation","agUpdate$","openSuccessSnack","complete","ngOnDestroy","subscription","unsubscribe","ɵɵdirectiveInject","UntypedFormBuilder","AccountGroupService","ListingProfileService","PartnerApiService","TranslateService","SnackbarService","selectors","inputs","outputs","decls","vars","consts","template","rf","ctx","ProductActivationPrereqFormComponent_ng_container_0_Template","ProductActivationPrereqFormComponent_ng_template_2_Template","ProductActivationPrereqFormComponent_ng_template_4_Template","loaded_r10","_ProductActivationPrereqFormComponent"],"x_google_ignoreList":[0]}